From 3304c0b7e6cfe50f24ab55120d6f7160459e753f Mon Sep 17 00:00:00 2001 From: rambohe-ch Date: Thu, 17 Oct 2024 16:48:25 +1100 Subject: [PATCH] feat: improve gpu-provisioner based on sigs.k8s.io/karpenter 1. upgrade CRD: Machine to NodeClaim 2. update aws/karpenter-core to sigs.k8s.io/karpenter 3. add webhook for v1beta1.NodeClaim and v1.NodeClaim conversion 4. add instance garbage collection controller for cleanuping leaked cloud provider instance and node. 5. remove unused files like sku, pricing, instancetype, etc. 6. improve nodeclaim launch error cases: if the return error is InvalidParameterError, LocationRestrictionError or InsufficientCapacityError, [nodeclaim launch] controller will publish a warning event, then delete the nodeclaim because of these errors are not recoverable, so it is not necessary to retry create agentpool. 7. add unit test cases Signed-off-by: rambohe-ch --- .github/workflows/markdown-link-check.yml | 4 +- .gitignore | 1 + .golangci.yaml | 9 +- Dockerfile | 3 +- Makefile | 7 +- .../crds/karpenter.sh_machines.yaml | 293 - .../crds/karpenter.sh_nodeclaims.yaml | 825 + .../templates/clusterrole-core.yaml | 37 +- .../templates/configmap-logging.yaml | 40 - .../gpu-provisioner/templates/configmap.yaml | 13 - .../gpu-provisioner/templates/deployment.yaml | 11 +- charts/gpu-provisioner/templates/role.yaml | 34 - .../templates/rolebinding.yaml | 20 - charts/gpu-provisioner/templates/secret.yaml | 5 + charts/gpu-provisioner/templates/service.yaml | 30 + charts/gpu-provisioner/values.yaml | 11 +- cmd/controller/main.go | 27 +- examples/machine-regular.yaml | 70 - ...machine-gpu.yaml => v1-nodeclaim-gpu.yaml} | 32 +- examples/v1beta1-nodeclaim-gpu.yaml | 68 + go.mod | 156 +- go.sum | 524 +- hack/code/instancetype_testdata_gen.go | 162 - hack/code/prices/prices_gen.go | 188 - hack/codegen.sh | 112 - pkg/apis/apis.go | 47 - pkg/apis/crds/karpenter.sh_machines.yaml | 293 - pkg/apis/settings/settings.go | 93 - pkg/apis/settings/suite_test.go | 59 - pkg/apis/settings/zz_generated.deepcopy.go | 38 - pkg/apis/v1alpha1/register.go | 153 - pkg/auth/cred.go | 1 - pkg/cache/cache.go | 29 - pkg/cache/unavailableofferings.go | 72 - pkg/cache/unavailableofferings_test.go | 63 - pkg/cloudprovider/cloudprovider.go | 139 +- pkg/cloudprovider/cloudprovider_test.go | 385 + pkg/cloudprovider/utils.go | 56 - pkg/controllers/controllers.go | 31 + .../instance/garbagecollection/controller.go | 131 + .../garbagecollection/controller_test.go | 281 + .../instance/garbagecollection/readme.md | 16 + pkg/fake/azure_client.go | 45 +- pkg/fake/cloudprovider.go | 210 - pkg/fake/instanceType.go | 188 - pkg/fake/k8sClient.go | 59 +- pkg/fake/nodeclaim.go | 83 + pkg/fake/pricingapi.go | 56 - pkg/fake/resourceskuapi.go | 56 - pkg/fake/zz_generated.sku.go | 350 - pkg/operator/operator.go | 37 +- pkg/providers/instance/armutils.go | 4 +- pkg/providers/instance/azure_client.go | 32 +- pkg/providers/instance/instance.go | 147 +- pkg/providers/instance/instance_test.go | 219 +- pkg/providers/instancetype/instancetype.go | 377 - pkg/providers/instancetype/instancetypes.go | 136 - pkg/providers/pricing/client/pricingapi.go | 82 - .../pricing/client/pricingapi_types.go | 57 - pkg/providers/pricing/pricing.go | 251 - pkg/providers/pricing/suite_test.go | 91 - pkg/providers/pricing/zz_generated.pricing.go | 25800 ------------ pkg/staticprovisioner/provisioner.go | 42 - pkg/tests/utils.go | 103 - pkg/utils/gpu.go | 111 - pkg/utils/utils.go | 31 - .../e2e/pkg/environment/common/environment.go | 30 +- .../e2e/pkg/environment/common/expectation.go | 31 +- test/e2e/pkg/environment/common/monitor.go | 9 +- test/e2e/pkg/environment/common/setup.go | 23 +- test/e2e/suites/suite_test.go | 206 +- .../pkg/errors/armerrors.go | 34 +- .../pkg/errors/consts.go | 14 +- .../azure-sdk-for-go/sdk/azcore/CHANGELOG.md | 15 + .../azcore/internal/pollers/async/async.go | 2 +- .../sdk/azcore/internal/pollers/body/body.go | 2 +- .../sdk/azcore/internal/pollers/fake/fake.go | 2 +- .../sdk/azcore/internal/pollers/loc/loc.go | 2 +- .../sdk/azcore/internal/pollers/op/op.go | 11 +- .../sdk/azcore/internal/pollers/util.go | 14 +- .../sdk/azcore/internal/shared/constants.go | 2 +- .../sdk/azcore/runtime/pager.go | 13 +- .../sdk/azcore/runtime/request.go | 10 + .../sdk/azidentity/.gitignore | 4 - .../sdk/azidentity/CHANGELOG.md | 551 - .../sdk/azidentity/LICENSE.txt | 21 - .../sdk/azidentity/MIGRATION.md | 307 - .../azure-sdk-for-go/sdk/azidentity/README.md | 257 - .../sdk/azidentity/TOKEN_CACHING.MD | 70 - .../sdk/azidentity/TROUBLESHOOTING.md | 231 - .../sdk/azidentity/assets.json | 6 - .../sdk/azidentity/authentication_record.go | 95 - .../sdk/azidentity/azidentity.go | 190 - .../sdk/azidentity/azure_cli_credential.go | 190 - .../azure_developer_cli_credential.go | 169 - .../azidentity/azure_pipelines_credential.go | 130 - .../azidentity/chained_token_credential.go | 138 - .../azure-sdk-for-go/sdk/azidentity/ci.yml | 46 - .../azidentity/client_assertion_credential.go | 85 - .../client_certificate_credential.go | 174 - .../azidentity/client_secret_credential.go | 75 - .../sdk/azidentity/confidential_client.go | 184 - .../azidentity/default_azure_credential.go | 165 - .../azidentity/developer_credential_util.go | 38 - .../sdk/azidentity/device_code_credential.go | 138 - .../sdk/azidentity/environment_credential.go | 167 - .../azure-sdk-for-go/sdk/azidentity/errors.go | 168 - .../azure-sdk-for-go/sdk/azidentity/go.work | 6 - .../sdk/azidentity/go.work.sum | 60 - .../interactive_browser_credential.go | 118 - .../sdk/azidentity/internal/exported.go | 18 - .../sdk/azidentity/internal/internal.go | 31 - .../sdk/azidentity/logging.go | 14 - .../azidentity/managed-identity-matrix.json | 17 - .../sdk/azidentity/managed_identity_client.go | 501 - .../azidentity/managed_identity_credential.go | 128 - .../sdk/azidentity/on_behalf_of_credential.go | 113 - .../sdk/azidentity/public_client.go | 273 - .../sdk/azidentity/test-resources-post.ps1 | 112 - .../sdk/azidentity/test-resources-pre.ps1 | 44 - .../sdk/azidentity/test-resources.bicep | 219 - .../username_password_credential.go | 90 - .../sdk/azidentity/version.go | 18 - .../sdk/azidentity/workload_identity.go | 131 - .../compute/armcompute/CHANGELOG.md | 7980 ---- .../compute/armcompute/LICENSE.txt | 21 - .../compute/armcompute/README.md | 88 - .../compute/armcompute/autorest.md | 12 - .../compute/armcompute/build.go | 7 - .../resourcemanager/compute/armcompute/ci.yml | 28 - .../zz_generated_availabilitysets_client.go | 466 - ...erated_capacityreservationgroups_client.go | 418 - ...z_generated_capacityreservations_client.go | 406 - ...ted_cloudserviceoperatingsystems_client.go | 306 - ...erated_cloudserviceroleinstances_client.go | 573 - .../zz_generated_cloudserviceroles_client.go | 183 - .../zz_generated_cloudservices_client.go | 886 - ...erated_cloudservicesupdatedomain_client.go | 257 - .../zz_generated_communitygalleries_client.go | 112 - ...generated_communitygalleryimages_client.go | 118 - ...ed_communitygalleryimageversions_client.go | 125 - .../armcompute/zz_generated_constants.go | 2495 -- ...zz_generated_dedicatedhostgroups_client.go | 407 - .../zz_generated_dedicatedhosts_client.go | 471 - .../zz_generated_diskaccesses_client.go | 774 - .../zz_generated_diskencryptionsets_client.go | 507 - .../zz_generated_diskrestorepoint_client.go | 348 - .../armcompute/zz_generated_disks_client.go | 564 - .../zz_generated_galleries_client.go | 433 - ...zz_generated_galleryapplications_client.go | 397 - ...rated_galleryapplicationversions_client.go | 427 - .../zz_generated_galleryimages_client.go | 396 - ...z_generated_galleryimageversions_client.go | 426 - ..._generated_gallerysharingprofile_client.go | 120 - .../armcompute/zz_generated_images_client.go | 429 - .../zz_generated_loganalytics_client.go | 181 - .../compute/armcompute/zz_generated_models.go | 9540 ----- .../armcompute/zz_generated_models_serde.go | 3416 -- .../zz_generated_operations_client.go | 98 - ...nerated_proximityplacementgroups_client.go | 405 - .../zz_generated_resourceskus_client.go | 121 - .../armcompute/zz_generated_response_types.go | 1403 - ...enerated_restorepointcollections_client.go | 425 - .../zz_generated_restorepoints_client.go | 257 - .../zz_generated_sharedgalleries_client.go | 179 - ...zz_generated_sharedgalleryimages_client.go | 190 - ...rated_sharedgalleryimageversions_client.go | 203 - .../zz_generated_snapshots_client.go | 566 - .../zz_generated_sshpublickeys_client.go | 459 - .../armcompute/zz_generated_time_rfc3339.go | 86 - .../armcompute/zz_generated_usage_client.go | 121 - ...ed_virtualmachineextensionimages_client.go | 246 - ...nerated_virtualmachineextensions_client.go | 387 - ...z_generated_virtualmachineimages_client.go | 376 - ...ted_virtualmachineimagesedgezone_client.go | 401 - ...erated_virtualmachineruncommands_client.go | 522 - .../zz_generated_virtualmachines_client.go | 1639 - ...virtualmachinescalesetextensions_client.go | 397 - ...almachinescalesetrollingupgrades_client.go | 310 - ...enerated_virtualmachinescalesets_client.go | 1562 - ...rtualmachinescalesetvmextensions_client.go | 412 - ...tualmachinescalesetvmruncommands_client.go | 425 - ...erated_virtualmachinescalesetvms_client.go | 1155 - ...zz_generated_virtualmachinesizes_client.go | 115 - .../armcontainerservice/v4/CHANGELOG.md | 589 + .../armcontainerservice/v4/README.md | 35 +- .../v4/agentpools_client.go | 119 +- .../armcontainerservice/v4/assets.json | 2 +- .../armcontainerservice/v4/autorest.md | 8 +- .../armcontainerservice/v4/build.go | 2 +- .../armcontainerservice/v4/ci.yml | 4 +- .../armcontainerservice/v4/client_factory.go | 82 +- .../armcontainerservice/v4/constants.go | 98 +- .../armcontainerservice/v4/date_type.go | 3 +- .../v4/maintenanceconfigurations_client.go | 53 +- .../v4/managedclusters_client.go | 597 +- .../armcontainerservice/v4/models.go | 341 +- .../armcontainerservice/v4/models_serde.go | 988 +- .../v4/operations_client.go | 8 +- .../armcontainerservice/v4/options.go | 55 + .../v4/privateendpointconnections_client.go | 46 +- .../v4/privatelinkresources_client.go | 12 +- .../v4/resolveprivatelinkserviceid_client.go | 12 +- .../v4/{response_types.go => responses.go} | 53 + .../v4/snapshots_client.go | 86 +- .../armcontainerservice/v4/time_rfc3339.go | 70 +- .../v4/trustedaccessrolebindings_client.go | 345 + .../v4/trustedaccessroles_client.go | 104 + .../network/armnetwork/CHANGELOG.md | 350 - .../network/armnetwork/LICENSE.txt | 21 - .../network/armnetwork/README.md | 86 - .../armnetwork/adminrulecollections_client.go | 352 - .../network/armnetwork/adminrules_client.go | 369 - ...atewayprivateendpointconnections_client.go | 330 - ...ationgatewayprivatelinkresources_client.go | 127 - .../armnetwork/applicationgateways_client.go | 1043 - .../applicationsecuritygroups_client.go | 428 - .../network/armnetwork/autorest.md | 12 - .../armnetwork/availabledelegations_client.go | 122 - .../availableendpointservices_client.go | 122 - .../availableprivateendpointtypes_client.go | 194 - ...vailableresourcegroupdelegations_client.go | 127 - .../availableservicealiases_client.go | 192 - .../azurefirewallfqdntags_client.go | 117 - .../armnetwork/azurefirewalls_client.go | 498 - .../network/armnetwork/bastionhosts_client.go | 434 - .../bgpservicecommunities_client.go | 117 - .../network/armnetwork/build.go | 7 - .../resourcemanager/network/armnetwork/ci.yml | 28 - .../configurationpolicygroups_client.go | 330 - .../armnetwork/connectionmonitors_client.go | 598 - .../connectivityconfigurations_client.go | 335 - .../network/armnetwork/constants.go | 3695 -- .../armnetwork/customipprefixes_client.go | 429 - .../armnetwork/ddoscustompolicies_client.go | 302 - .../armnetwork/ddosprotectionplans_client.go | 427 - .../armnetwork/defaultsecurityrules_client.go | 189 - .../armnetwork/dscpconfiguration_client.go | 368 - ...xpressroutecircuitauthorizations_client.go | 330 - .../expressroutecircuitconnections_client.go | 351 - .../expressroutecircuitpeerings_client.go | 330 - .../armnetwork/expressroutecircuits_client.go | 775 - .../expressrouteconnections_client.go | 317 - ...ressroutecrossconnectionpeerings_client.go | 330 - .../expressroutecrossconnections_client.go | 594 - .../armnetwork/expressroutegateways_client.go | 412 - .../armnetwork/expressroutelinks_client.go | 187 - .../expressrouteportauthorizations_client.go | 330 - .../armnetwork/expressrouteports_client.go | 484 - .../expressrouteportslocations_client.go | 171 - ...xpressrouteproviderportslocation_client.go | 107 - .../expressrouteserviceproviders_client.go | 117 - .../armnetwork/firewallpolicies_client.go | 429 - .../firewallpolicyidpssignatures_client.go | 114 - ...policyidpssignaturesfiltervalues_client.go | 114 - ...allpolicyidpssignaturesoverrides_client.go | 287 - ...rewallpolicyrulecollectiongroups_client.go | 330 - .../network/armnetwork/flowlogs_client.go | 389 - .../network/armnetwork/groups_client.go | 334 - .../armnetwork/hubroutetables_client.go | 328 - .../hubvirtualnetworkconnections_client.go | 330 - .../armnetwork/inboundnatrules_client.go | 331 - .../armnetwork/inboundsecurityrule_client.go | 128 - .../interfaceipconfigurations_client.go | 189 - .../interfaceloadbalancers_client.go | 127 - .../network/armnetwork/interfaces_client.go | 1148 - .../interfacetapconfigurations_client.go | 330 - .../armnetwork/ipallocations_client.go | 429 - .../network/armnetwork/ipgroups_client.go | 427 - .../loadbalancerbackendaddresspools_client.go | 330 - ...balancerfrontendipconfigurations_client.go | 189 - .../loadbalancerloadbalancingrules_client.go | 189 - .../loadbalancernetworkinterfaces_client.go | 127 - .../loadbalanceroutboundrules_client.go | 189 - .../armnetwork/loadbalancerprobes_client.go | 187 - .../armnetwork/loadbalancers_client.go | 560 - .../armnetwork/localnetworkgateways_client.go | 368 - .../network/armnetwork/management_client.go | 922 - ...ntgroupnetworkmanagerconnections_client.go | 272 - .../armnetwork/managercommits_client.go | 123 - .../managerdeploymentstatus_client.go | 115 - .../network/armnetwork/managers_client.go | 431 - .../network/armnetwork/models.go | 16991 -------- .../network/armnetwork/models_serde.go | 32651 ---------------- .../network/armnetwork/natgateways_client.go | 426 - .../network/armnetwork/natrules_client.go | 328 - .../network/armnetwork/operations_client.go | 105 - .../armnetwork/p2svpngateways_client.go | 768 - .../armnetwork/packetcaptures_client.go | 462 - ...erexpressroutecircuitconnections_client.go | 199 - .../network/armnetwork/polymorphic_helpers.go | 209 - .../armnetwork/privatednszonegroups_client.go | 330 - .../armnetwork/privateendpoints_client.go | 371 - .../armnetwork/privatelinkservices_client.go | 907 - .../network/armnetwork/profiles_client.go | 417 - .../armnetwork/publicipaddresses_client.go | 902 - .../armnetwork/publicipprefixes_client.go | 429 - .../resourcenavigationlinks_client.go | 119 - .../network/armnetwork/response_types.go | 3102 -- .../armnetwork/routefilterrules_client.go | 329 - .../network/armnetwork/routefilters_client.go | 428 - .../network/armnetwork/routes_client.go | 327 - .../network/armnetwork/routetables_client.go | 426 - .../armnetwork/routingintent_client.go | 328 - .../armnetwork/scopeconnections_client.go | 309 - .../securityadminconfigurations_client.go | 332 - .../armnetwork/securitygroups_client.go | 428 - .../securitypartnerproviders_client.go | 428 - .../armnetwork/securityrules_client.go | 328 - .../serviceassociationlinks_client.go | 119 - .../serviceendpointpolicies_client.go | 431 - ...serviceendpointpolicydefinitions_client.go | 330 - .../servicetaginformation_client.go | 131 - .../network/armnetwork/servicetags_client.go | 110 - .../armnetwork/staticmembers_client.go | 329 - .../network/armnetwork/subnets_client.go | 472 - ...riptionnetworkmanagerconnections_client.go | 272 - .../network/armnetwork/time_rfc3339.go | 87 - .../network/armnetwork/usages_client.go | 121 - .../armnetwork/virtualappliances_client.go | 429 - .../virtualappliancesites_client.go | 330 - .../armnetwork/virtualapplianceskus_client.go | 169 - .../virtualhubbgpconnection_client.go | 260 - .../virtualhubbgpconnections_client.go | 267 - .../virtualhubipconfiguration_client.go | 330 - .../virtualhubroutetablev2s_client.go | 330 - .../network/armnetwork/virtualhubs_client.go | 494 - ...virtualnetworkgatewayconnections_client.go | 841 - .../virtualnetworkgatewaynatrules_client.go | 332 - .../virtualnetworkgateways_client.go | 1510 - .../virtualnetworkpeerings_client.go | 333 - .../armnetwork/virtualnetworks_client.go | 557 - .../armnetwork/virtualnetworktaps_client.go | 427 - .../virtualrouterpeerings_client.go | 330 - .../armnetwork/virtualrouters_client.go | 371 - .../network/armnetwork/virtualwans_client.go | 424 - .../armnetwork/vpnconnections_client.go | 476 - .../network/armnetwork/vpngateways_client.go | 633 - .../armnetwork/vpnlinkconnections_client.go | 282 - .../vpnserverconfigurations_client.go | 428 - ...urationsassociatedwithvirtualwan_client.go | 122 - .../vpnsitelinkconnections_client.go | 124 - .../network/armnetwork/vpnsitelinks_client.go | 188 - .../network/armnetwork/vpnsites_client.go | 424 - .../vpnsitesconfiguration_client.go | 123 - .../network/armnetwork/watchers_client.go | 1199 - .../webapplicationfirewallpolicies_client.go | 362 - .../armnetwork/webcategories_client.go | 171 - .../mgmt/2019-12-01/compute/CHANGELOG.md | 2 - .../mgmt/2019-12-01/compute/_meta.json | 11 - .../2019-12-01/compute/availabilitysets.go | 652 - .../compute/mgmt/2019-12-01/compute/client.go | 43 - .../2019-12-01/compute/containerservices.go | 538 - .../2019-12-01/compute/dedicatedhostgroups.go | 585 - .../mgmt/2019-12-01/compute/dedicatedhosts.go | 493 - .../2019-12-01/compute/diskencryptionsets.go | 601 - .../compute/mgmt/2019-12-01/compute/disks.go | 774 - .../compute/mgmt/2019-12-01/compute/enums.go | 1393 - .../mgmt/2019-12-01/compute/galleries.go | 580 - .../2019-12-01/compute/galleryapplications.go | 485 - .../compute/galleryapplicationversions.go | 514 - .../mgmt/2019-12-01/compute/galleryimages.go | 492 - .../compute/galleryimageversions.go | 503 - .../compute/mgmt/2019-12-01/compute/images.go | 583 - .../mgmt/2019-12-01/compute/loganalytics.go | 206 - .../compute/mgmt/2019-12-01/compute/models.go | 15500 -------- .../mgmt/2019-12-01/compute/operations.go | 98 - .../compute/proximityplacementgroups.go | 575 - .../mgmt/2019-12-01/compute/resourceskus.go | 149 - .../mgmt/2019-12-01/compute/snapshots.go | 767 - .../mgmt/2019-12-01/compute/sshpublickeys.go | 649 - .../compute/mgmt/2019-12-01/compute/usage.go | 155 - .../mgmt/2019-12-01/compute/version.go | 19 - .../compute/virtualmachineextensionimages.go | 270 - .../compute/virtualmachineextensions.go | 442 - .../compute/virtualmachineimages.go | 432 - .../compute/virtualmachineruncommands.go | 237 - .../2019-12-01/compute/virtualmachines.go | 1945 - .../virtualmachinescalesetextensions.go | 483 - .../virtualmachinescalesetrollingupgrades.go | 346 - .../compute/virtualmachinescalesets.go | 2018 - .../virtualmachinescalesetvmextensions.go | 453 - .../compute/virtualmachinescalesetvms.go | 1341 - .../2019-12-01/compute/virtualmachinesizes.go | 114 - .../mgmt/2022-08-01/compute/CHANGELOG.md | 2 - .../mgmt/2022-08-01/compute/_meta.json | 11 - .../2022-08-01/compute/availabilitysets.go | 652 - .../compute/capacityreservationgroups.go | 596 - .../compute/capacityreservations.go | 493 - .../compute/mgmt/2022-08-01/compute/client.go | 43 - .../compute/cloudserviceoperatingsystems.go | 422 - .../compute/cloudserviceroleinstances.go | 715 - .../2022-08-01/compute/cloudserviceroles.go | 229 - .../mgmt/2022-08-01/compute/cloudservices.go | 1198 - .../compute/cloudservicesupdatedomain.go | 319 - .../2022-08-01/compute/communitygalleries.go | 108 - .../compute/communitygalleryimages.go | 228 - .../compute/communitygalleryimageversions.go | 234 - .../2022-08-01/compute/dedicatedhostgroups.go | 589 - .../mgmt/2022-08-01/compute/dedicatedhosts.go | 575 - .../mgmt/2022-08-01/compute/diskaccesses.go | 1045 - .../2022-08-01/compute/diskencryptionsets.go | 719 - .../2022-08-01/compute/diskrestorepoint.go | 407 - .../compute/mgmt/2022-08-01/compute/disks.go | 774 - .../compute/mgmt/2022-08-01/compute/enums.go | 2248 -- .../mgmt/2022-08-01/compute/galleries.go | 588 - .../2022-08-01/compute/galleryapplications.go | 485 - .../compute/galleryapplicationversions.go | 516 - .../mgmt/2022-08-01/compute/galleryimages.go | 492 - .../compute/galleryimageversions.go | 503 - .../compute/gallerysharingprofile.go | 114 - .../compute/mgmt/2022-08-01/compute/images.go | 583 - .../mgmt/2022-08-01/compute/loganalytics.go | 206 - .../compute/mgmt/2022-08-01/compute/models.go | 24333 ------------ .../mgmt/2022-08-01/compute/operations.go | 98 - .../compute/proximityplacementgroups.go | 575 - .../mgmt/2022-08-01/compute/resourceskus.go | 153 - .../compute/restorepointcollections.go | 582 - .../mgmt/2022-08-01/compute/restorepoints.go | 302 - .../2022-08-01/compute/sharedgalleries.go | 227 - .../2022-08-01/compute/sharedgalleryimages.go | 233 - .../compute/sharedgalleryimageversions.go | 240 - .../mgmt/2022-08-01/compute/snapshots.go | 777 - .../mgmt/2022-08-01/compute/sshpublickeys.go | 649 - .../compute/mgmt/2022-08-01/compute/usage.go | 155 - .../mgmt/2022-08-01/compute/version.go | 19 - .../compute/virtualmachineextensionimages.go | 270 - .../compute/virtualmachineextensions.go | 454 - .../compute/virtualmachineimages.go | 508 - .../compute/virtualmachineimagesedgezone.go | 445 - .../compute/virtualmachineruncommands.go | 689 - .../2022-08-01/compute/virtualmachines.go | 2205 -- .../virtualmachinescalesetextensions.go | 495 - .../virtualmachinescalesetrollingupgrades.go | 346 - .../compute/virtualmachinescalesets.go | 2170 - .../virtualmachinescalesetvmextensions.go | 469 - .../virtualmachinescalesetvmruncommands.go | 495 - .../compute/virtualmachinescalesetvms.go | 1430 - .../2022-08-01/compute/virtualmachinesizes.go | 113 - .../Azure/go-autorest/autorest/adal/README.md | 2 +- .../go-autorest/autorest/adal/devicetoken.go | 10 +- .../go-autorest/autorest/adal/persist.go | 3 +- .../Azure/go-autorest/autorest/adal/token.go | 9 +- vendor/github.com/Azure/skewer/.gitignore | 18 - vendor/github.com/Azure/skewer/.golangci.yml | 136 - .../Azure/skewer/CODE_OF_CONDUCT.md | 9 - vendor/github.com/Azure/skewer/LICENSE | 21 - vendor/github.com/Azure/skewer/README.md | 138 - vendor/github.com/Azure/skewer/SECURITY.md | 41 - vendor/github.com/Azure/skewer/cache.go | 375 - vendor/github.com/Azure/skewer/clients.go | 63 - vendor/github.com/Azure/skewer/const.go | 68 - vendor/github.com/Azure/skewer/interface.go | 24 - vendor/github.com/Azure/skewer/justfile | 17 - vendor/github.com/Azure/skewer/sku.go | 574 - vendor/github.com/Azure/skewer/strings.go | 20 - vendor/github.com/Azure/skewer/vmsize.go | 131 - vendor/github.com/Azure/skewer/wrap.go | 13 - .../apps/internal/local/server.go | 177 - .../apps/public/public.go | 756 - .../aws/karpenter-core/pkg/apis/apis.go | 49 - .../pkg/apis/crds/karpenter.sh_machines.yaml | 354 - .../apis/crds/karpenter.sh_provisioners.yaml | 373 - .../pkg/apis/settings/settings.go | 110 - .../apis/settings/zz_generated.deepcopy.go | 49 - .../pkg/apis/v1alpha5/limits.go | 41 - .../pkg/apis/v1alpha5/machine_status.go | 66 - .../pkg/apis/v1alpha5/provisioner.go | 136 - .../pkg/apis/v1alpha5/provisioner_status.go | 51 - .../apis/v1alpha5/provisioner_validation.go | 339 - .../pkg/apis/v1alpha5/register.go | 50 - .../karpenter-core/pkg/cloudprovider/types.go | 211 - .../pkg/controllers/consistency/controller.go | 127 - .../pkg/controllers/consistency/metrics.go | 41 - .../pkg/controllers/controllers.go | 70 - .../pkg/controllers/counter/controller.go | 114 - .../deprovisioning/consolidation.go | 200 - .../controllers/deprovisioning/controller.go | 347 - .../pkg/controllers/deprovisioning/drift.go | 106 - .../controllers/deprovisioning/emptiness.go | 60 - .../emptymachineconsolidation.go | 87 - .../deprovisioning/events/events.go | 114 - .../controllers/deprovisioning/expiration.go | 124 - .../pkg/controllers/deprovisioning/helpers.go | 270 - .../pkg/controllers/deprovisioning/metrics.go | 73 - .../multimachineconsolidation.go | 169 - .../controllers/deprovisioning/pdblimits.go | 88 - .../singlemachineconsolidation.go | 76 - .../pkg/controllers/deprovisioning/types.go | 204 - .../controllers/deprovisioning/validation.go | 181 - .../machine/disruption/controller.go | 154 - .../controllers/machine/disruption/drift.go | 80 - .../machine/disruption/emptiness.go | 109 - .../machine/disruption/expiration.go | 89 - .../machine/garbagecollection/controller.go | 345 - .../machine/lifecycle/initialization.go | 147 - .../controllers/machine/lifecycle/launch.go | 159 - .../machine/lifecycle/registration.go | 142 - .../machine/termination/controller.go | 128 - .../pkg/controllers/metrics/pod/controller.go | 216 - .../metrics/provisioner/controller.go | 205 - .../controllers/metrics/state/controller.go | 56 - .../controllers/metrics/state/scraper/node.go | 276 - .../controllers/provisioning/controller.go | 74 - .../controllers/provisioning/provisioner.go | 439 - .../scheduling/machinetemplate.go | 111 - .../provisioning/scheduling/scheduler.go | 367 - .../pkg/controllers/state/statenode.go | 357 - .../pkg/controllers/termination/controller.go | 151 - .../termination/terminator/events/events.go | 43 - .../termination/terminator/eviction.go | 134 - .../termination/terminator/terminator.go | 145 - .../aws/karpenter-core/pkg/metrics/metrics.go | 112 - .../pkg/operator/controller/controller.go | 61 - .../pkg/operator/controller/singleton.go | 176 - .../pkg/operator/controller/typed.go | 84 - .../pkg/operator/injection/injection.go | 111 - .../aws/karpenter-core/pkg/operator/logger.go | 84 - .../karpenter-core/pkg/operator/operator.go | 205 - .../pkg/operator/options/options.go | 79 - .../karpenter-core/pkg/operator/profiling.go | 40 - .../pkg/scheduling/hostportusage.go | 144 - .../pkg/scheduling/requirements.go | 225 - .../pkg/scheduling/volumeusage.go | 311 - .../karpenter-core/pkg/test/provisioner.go | 99 - .../aws/karpenter-core/pkg/test/settings.go | 45 - .../pkg/utils/functional/functional.go | 76 - .../pkg/utils/machine/machine.go | 289 - .../aws/karpenter-core/pkg/utils/node/node.go | 58 - .../pkg/utils/pod/scheduling.go | 106 - .../aws/karpenter-core/pkg/utils/sets/sets.go | 178 - vendor/github.com/awslabs/operatorpkg/LICENSE | 175 + .../operatorpkg}/NOTICE | 1 - .../operatorpkg/controller/controller.go | 12 + .../awslabs/operatorpkg/metrics/metrics.go | 129 + .../awslabs/operatorpkg/object/object.go | 52 + .../awslabs/operatorpkg/option/function.go | 13 + .../operatorpkg/singleton/controller.go | 38 + .../awslabs/operatorpkg/status/condition.go | 58 + .../operatorpkg/status/condition_set.go | 244 + .../awslabs/operatorpkg/status/controller.go | 262 + .../awslabs/operatorpkg/status/doc.go | 3 + .../status/zz_generated.deepcopy.go | 24 + vendor/github.com/benbjohnson/clock/LICENSE | 21 - vendor/github.com/benbjohnson/clock/README.md | 104 - vendor/github.com/benbjohnson/clock/clock.go | 340 - .../github.com/deckarep/golang-set/README.md | 95 - .../deckarep/golang-set/iterator.go | 58 - vendor/github.com/deckarep/golang-set/set.go | 217 - .../deckarep/golang-set/threadsafe.go | 283 - .../deckarep/golang-set/threadunsafe.go | 340 - .../emicklei/go-restful/v3/CHANGES.md | 24 +- .../emicklei/go-restful/v3/README.md | 5 +- .../emicklei/go-restful/v3/constants.go | 2 + .../emicklei/go-restful/v3/request.go | 5 +- .../emicklei/go-restful/v3/response.go | 3 + .../emicklei/go-restful/v3/route.go | 17 +- .../emicklei/go-restful/v3/route_builder.go | 55 +- .../github.com/evanphx/json-patch/.gitignore | 6 + .../browser => evanphx/json-patch}/LICENSE | 26 +- .../github.com/evanphx/json-patch/README.md | 317 + .../github.com/evanphx/json-patch/errors.go | 38 + vendor/github.com/evanphx/json-patch/merge.go | 389 + vendor/github.com/evanphx/json-patch/patch.go | 809 + .../json-patch/v5/internal/json/decode.go | 1385 + .../json-patch/v5/internal/json/encode.go | 1486 + .../json-patch/v5/internal/json/fold.go | 141 + .../json-patch/v5/internal/json/fuzz.go | 42 + .../json-patch/v5/internal/json/indent.go | 143 + .../json-patch/v5/internal/json/scanner.go | 610 + .../json-patch/v5/internal/json/stream.go | 495 + .../json-patch/v5/internal/json/tables.go | 218 + .../json-patch/v5/internal/json/tags.go | 38 + .../github.com/evanphx/json-patch/v5/merge.go | 110 +- .../github.com/evanphx/json-patch/v5/patch.go | 436 +- .../github.com/fsnotify/fsnotify/.cirrus.yml | 13 + .../github.com/fsnotify/fsnotify/.gitignore | 1 + .../github.com/fsnotify/fsnotify/CHANGELOG.md | 83 +- vendor/github.com/fsnotify/fsnotify/README.md | 81 +- .../fsnotify/fsnotify/backend_fen.go | 552 +- .../fsnotify/fsnotify/backend_inotify.go | 377 +- .../fsnotify/fsnotify/backend_kqueue.go | 295 +- .../fsnotify/fsnotify/backend_other.go | 205 +- .../fsnotify/fsnotify/backend_windows.go | 247 +- .../github.com/fsnotify/fsnotify/fsnotify.go | 91 +- vendor/github.com/fsnotify/fsnotify/mkdoc.zsh | 125 +- .../github.com/go-logfmt/logfmt/CHANGELOG.md | 46 +- vendor/github.com/go-logfmt/logfmt/README.md | 30 +- vendor/github.com/go-logfmt/logfmt/decode.go | 17 + vendor/github.com/go-logr/logr/README.md | 127 +- vendor/github.com/go-logr/logr/SECURITY.md | 18 + vendor/github.com/go-logr/logr/context.go | 33 + .../github.com/go-logr/logr/context_noslog.go | 49 + .../github.com/go-logr/logr/context_slog.go | 83 + vendor/github.com/go-logr/logr/funcr/funcr.go | 250 +- .../github.com/go-logr/logr/funcr/slogsink.go | 105 + vendor/github.com/go-logr/logr/logr.go | 78 +- vendor/github.com/go-logr/logr/sloghandler.go | 192 + vendor/github.com/go-logr/logr/slogr.go | 100 + vendor/github.com/go-logr/logr/slogr/slogr.go | 61 + vendor/github.com/go-logr/logr/slogsink.go | 120 + vendor/github.com/go-logr/zapr/.golangci.yaml | 20 + vendor/github.com/go-logr/zapr/README.md | 39 +- vendor/github.com/go-logr/zapr/slogzapr.go | 183 + vendor/github.com/go-logr/zapr/zapr.go | 15 +- vendor/github.com/go-logr/zapr/zapr_noslog.go | 34 + vendor/github.com/go-logr/zapr/zapr_slog.go | 48 + .../go-openapi/jsonpointer/pointer.go | 147 +- .../jsonreference/internal/normalize_url.go | 5 + vendor/github.com/go-openapi/swag/util.go | 16 +- .../go-playground/locales/.gitignore | 24 - .../go-playground/locales/.travis.yml | 26 - .../github.com/go-playground/locales/LICENSE | 21 - .../go-playground/locales/README.md | 170 - .../locales/currency/currency.go | 311 - .../github.com/go-playground/locales/logo.png | Bin 37360 -> 0 bytes .../github.com/go-playground/locales/rules.go | 293 - .../universal-translator/.gitignore | 25 - .../universal-translator/.travis.yml | 27 - .../universal-translator/LICENSE | 21 - .../universal-translator/Makefile | 18 - .../universal-translator/README.md | 87 - .../universal-translator/errors.go | 148 - .../universal-translator/import_export.go | 274 - .../universal-translator/logo.png | Bin 16598 -> 0 bytes .../universal-translator/translator.go | 420 - .../universal_translator.go | 113 - .../go-playground/validator/v10/LICENSE | 22 - .../validator/v10/MAINTAINERS.md | 16 - .../go-playground/validator/v10/Makefile | 18 - .../go-playground/validator/v10/README.md | 348 - .../go-playground/validator/v10/baked_in.go | 2785 -- .../go-playground/validator/v10/cache.go | 327 - .../validator/v10/country_codes.go | 1150 - .../validator/v10/currency_codes.go | 79 - .../go-playground/validator/v10/doc.go | 1464 - .../go-playground/validator/v10/errors.go | 272 - .../validator/v10/field_level.go | 120 - .../go-playground/validator/v10/logo.png | Bin 13443 -> 0 bytes .../validator/v10/postcode_regexes.go | 173 - .../go-playground/validator/v10/regexes.go | 137 - .../validator/v10/struct_level.go | 175 - .../validator/v10/translations.go | 11 - .../go-playground/validator/v10/util.go | 288 - .../go-playground/validator/v10/validator.go | 485 - .../validator/v10/validator_instance.go | 702 - .../go-task/slim-sprig/{ => v3}/.editorconfig | 0 .../slim-sprig/{ => v3}/.gitattributes | 0 .../go-task/slim-sprig/{ => v3}/.gitignore | 0 .../go-task/slim-sprig/{ => v3}/CHANGELOG.md | 19 + .../go-task/slim-sprig/{ => v3}/LICENSE.txt | 0 .../go-task/slim-sprig/{ => v3}/README.md | 2 +- .../go-task/slim-sprig/{ => v3}/Taskfile.yml | 2 +- .../go-task/slim-sprig/{ => v3}/crypto.go | 0 .../go-task/slim-sprig/{ => v3}/date.go | 0 .../go-task/slim-sprig/{ => v3}/defaults.go | 0 .../go-task/slim-sprig/{ => v3}/dict.go | 0 .../go-task/slim-sprig/{ => v3}/doc.go | 0 .../go-task/slim-sprig/{ => v3}/functions.go | 0 .../go-task/slim-sprig/{ => v3}/list.go | 0 .../go-task/slim-sprig/{ => v3}/network.go | 0 .../go-task/slim-sprig/{ => v3}/numeric.go | 0 .../go-task/slim-sprig/{ => v3}/reflect.go | 0 .../go-task/slim-sprig/{ => v3}/regex.go | 0 .../go-task/slim-sprig/{ => v3}/strings.go | 0 .../go-task/slim-sprig/{ => v3}/url.go | 0 .../golang/protobuf/jsonpb/decode.go | 1 + .../golang/protobuf/jsonpb/encode.go | 1 + .../github.com/golang/protobuf/ptypes/any.go | 7 +- .../{gnostic => gnostic-models}/LICENSE | 0 .../compiler/README.md | 0 .../compiler/context.go | 0 .../compiler/error.go | 0 .../compiler/extensions.go | 2 +- .../compiler/helpers.go | 2 +- .../compiler/main.go | 0 .../compiler/reader.go | 0 .../extensions/README.md | 0 .../extensions/extension.pb.go | 4 +- .../extensions/extension.proto | 0 .../extensions/extensions.go | 0 .../jsonschema/README.md | 0 .../jsonschema/base.go | 15 +- .../jsonschema/display.go | 0 .../jsonschema/models.go | 0 .../jsonschema/operations.go | 0 .../jsonschema/reader.go | 0 .../jsonschema/schema.json | 0 .../jsonschema/writer.go | 0 .../openapiv2/OpenAPIv2.go | 2 +- .../openapiv2/OpenAPIv2.pb.go | 4 +- .../openapiv2/OpenAPIv2.proto | 0 .../openapiv2/README.md | 0 .../openapiv2/document.go | 2 +- .../openapiv2/openapi-2.0.json | 0 .../openapiv3/OpenAPIv3.go | 2 +- .../openapiv3/OpenAPIv3.pb.go | 4 +- .../openapiv3/OpenAPIv3.proto | 0 .../openapiv3/README.md | 0 .../openapiv3/document.go | 2 +- .../google/gnostic/openapiv3/openapi-3.0.json | 1251 - .../google/gnostic/openapiv3/openapi-3.1.json | 1250 - .../github.com/google/pprof/profile/encode.go | 88 +- .../github.com/google/pprof/profile/filter.go | 4 + .../pprof/profile/legacy_java_profile.go | 4 +- .../google/pprof/profile/legacy_profile.go | 31 +- .../github.com/google/pprof/profile/merge.go | 282 +- .../google/pprof/profile/profile.go | 75 +- .../github.com/google/pprof/profile/proto.go | 19 +- .../github.com/google/pprof/profile/prune.go | 26 +- .../grpc-gateway/v2/{LICENSE.txt => LICENSE} | 0 .../grpc-gateway/v2/internal/httprule/fuzz.go | 4 +- .../v2/internal/httprule/parse.go | 19 +- .../grpc-gateway/v2/runtime/BUILD.bazel | 12 +- .../grpc-gateway/v2/runtime/context.go | 53 +- .../grpc-gateway/v2/runtime/convert.go | 46 +- .../grpc-gateway/v2/runtime/errors.go | 8 +- .../grpc-gateway/v2/runtime/fieldmask.go | 9 +- .../grpc-gateway/v2/runtime/handler.go | 19 +- .../v2/runtime/marshal_httpbodyproto.go | 2 +- .../grpc-gateway/v2/runtime/marshal_jsonpb.go | 27 +- .../grpc-gateway/v2/runtime/marshal_proto.go | 9 +- .../grpc-gateway/v2/runtime/mux.go | 92 +- .../grpc-gateway/v2/runtime/pattern.go | 2 - .../grpc-gateway/v2/runtime/query.go | 40 +- .../v2/utilities/readerfactory.go | 3 +- .../grpc-gateway/v2/utilities/trie.go | 2 +- .../hashicorp/golang-lru/.golangci.yml | 30 + vendor/github.com/hashicorp/golang-lru/2q.go | 3 +- .../github.com/hashicorp/golang-lru/LICENSE | 2 + .../github.com/hashicorp/golang-lru/README.md | 26 +- vendor/github.com/hashicorp/golang-lru/arc.go | 1 - vendor/github.com/hashicorp/golang-lru/lru.go | 119 +- .../hashicorp/golang-lru/simplelru/lru.go | 6 +- .../golang-lru/simplelru/lru_interface.go | 5 +- .../hashicorp/golang-lru/testing.go | 16 + .../inconshreveable/mousetrap/LICENSE | 201 + .../inconshreveable/mousetrap/README.md | 23 + .../inconshreveable/mousetrap/trap_others.go | 16 + .../inconshreveable/mousetrap/trap_windows.go | 42 + vendor/github.com/leodido/go-urn/.gitignore | 12 - vendor/github.com/leodido/go-urn/LICENSE | 21 - vendor/github.com/leodido/go-urn/README.md | 81 - vendor/github.com/leodido/go-urn/machine.go | 1691 - .../github.com/leodido/go-urn/machine.go.rl | 159 - vendor/github.com/leodido/go-urn/makefile | 53 - vendor/github.com/leodido/go-urn/urn.go | 86 - .../golang_protobuf_extensions/NOTICE | 1 - .../pbutil/.gitignore | 1 - .../pbutil/Makefile | 7 - .../pbutil/decode.go | 75 - .../pbutil/encode.go | 46 - vendor/github.com/onsi/ginkgo/v2/CHANGELOG.md | 181 + .../github.com/onsi/ginkgo/v2/CONTRIBUTING.md | 10 +- vendor/github.com/onsi/ginkgo/v2/Makefile | 11 + vendor/github.com/onsi/ginkgo/v2/README.md | 6 +- vendor/github.com/onsi/ginkgo/v2/core_dsl.go | 109 +- .../ginkgo/v2/ginkgo/build/build_command.go | 15 +- .../v2/ginkgo/generators/bootstrap_command.go | 2 +- .../v2/ginkgo/generators/generate_command.go | 3 +- .../onsi/ginkgo/v2/ginkgo/internal/compile.go | 14 +- .../ginkgo/v2/ginkgo/internal/gocovmerge.go | 129 + .../ginkgo/internal/profiles_and_reports.go | 46 +- .../ginkgo/v2/ginkgo/internal/test_suite.go | 9 +- .../onsi/ginkgo/v2/ginkgo/outline/ginkgo.go | 7 +- .../onsi/ginkgo/v2/ginkgo/outline/import.go | 9 +- .../ginkgo/v2/ginkgo/watch/dependencies.go | 2 +- .../ginkgo/v2/ginkgo/watch/package_hash.go | 13 +- .../github.com/onsi/ginkgo/v2/ginkgo_t_dsl.go | 110 +- .../onsi/ginkgo/v2/internal/global/init.go | 11 + .../onsi/ginkgo/v2/internal/group.go | 5 +- .../onsi/ginkgo/v2/internal/node.go | 43 +- .../v2/internal/output_interceptor_wasm.go | 7 + .../v2/internal/progress_report_wasm.go | 10 + .../onsi/ginkgo/v2/internal/spec_context.go | 4 +- .../onsi/ginkgo/v2/internal/suite.go | 51 +- .../onsi/ginkgo/v2/internal/writer.go | 6 +- .../ginkgo/v2/reporters/default_reporter.go | 61 +- .../onsi/ginkgo/v2/reporters/json_report.go | 6 +- .../onsi/ginkgo/v2/reporters/junit_report.go | 14 + .../onsi/ginkgo/v2/reporting_dsl.go | 59 +- vendor/github.com/onsi/ginkgo/v2/table_dsl.go | 117 +- .../onsi/ginkgo/v2/types/code_location.go | 2 +- .../github.com/onsi/ginkgo/v2/types/config.go | 24 +- .../github.com/onsi/ginkgo/v2/types/errors.go | 13 +- .../github.com/onsi/ginkgo/v2/types/flags.go | 15 +- .../onsi/ginkgo/v2/types/label_filter.go | 229 +- .../github.com/onsi/ginkgo/v2/types/types.go | 4 +- .../onsi/ginkgo/v2/types/version.go | 2 +- vendor/github.com/onsi/gomega/CHANGELOG.md | 117 + vendor/github.com/onsi/gomega/gomega_dsl.go | 14 +- .../onsi/gomega/internal/async_assertion.go | 7 +- vendor/github.com/onsi/gomega/matchers.go | 73 +- .../matchers/be_comparable_to_matcher.go | 4 +- .../onsi/gomega/matchers/be_false_matcher.go | 13 +- .../onsi/gomega/matchers/be_true_matcher.go | 13 +- .../gomega/matchers/have_exact_elements.go | 7 +- .../gomega/matchers/have_http_body_matcher.go | 9 +- .../gomega/matchers/match_error_matcher.go | 25 +- .../onsi/gomega/matchers/receive_matcher.go | 70 +- .../bipartitegraph/bipartitegraphmatching.go | 7 + vendor/github.com/pkg/browser/README.md | 55 - vendor/github.com/pkg/browser/browser.go | 57 - .../github.com/pkg/browser/browser_darwin.go | 5 - .../github.com/pkg/browser/browser_freebsd.go | 14 - .../github.com/pkg/browser/browser_linux.go | 21 - .../github.com/pkg/browser/browser_netbsd.go | 14 - .../github.com/pkg/browser/browser_openbsd.go | 14 - .../pkg/browser/browser_unsupported.go | 12 - .../github.com/pkg/browser/browser_windows.go | 7 - .../prometheus/collectors/expvar_collector.go | 2 +- .../collectors/go_collector_latest.go | 9 +- .../client_golang/prometheus/counter.go | 26 +- .../client_golang/prometheus/desc.go | 32 +- .../prometheus/expvar_collector.go | 2 +- .../client_golang/prometheus/gauge.go | 8 +- .../client_golang/prometheus/histogram.go | 178 +- .../prometheus/internal/difflib.go | 2 +- .../client_golang/prometheus/labels.go | 60 +- .../client_golang/prometheus/metric.go | 3 + .../prometheus/process_collector_other.go | 4 +- .../prometheus/process_collector_wasip1.go} | 21 +- .../client_golang/prometheus/promhttp/http.go | 19 +- .../prometheus/promhttp/instrument_client.go | 4 +- .../prometheus/promhttp/instrument_server.go | 45 +- .../prometheus/promhttp/option.go | 6 +- .../client_golang/prometheus/registry.go | 6 +- .../client_golang/prometheus/summary.go | 41 +- .../client_golang/prometheus/value.go | 55 +- .../client_golang/prometheus/vec.go | 87 +- .../prometheus/client_model/go/metrics.pb.go | 371 +- .../prometheus/common/expfmt/decode.go | 36 +- .../prometheus/common/expfmt/encode.go | 87 +- .../prometheus/common/expfmt/expfmt.go | 166 +- .../common/expfmt/openmetrics_create.go | 283 +- .../prometheus/common/expfmt/text_create.go | 118 +- .../prometheus/common/expfmt/text_parse.go | 8 +- .../prometheus/common/model/alert.go | 31 +- .../prometheus/common/model/labels.go | 22 +- .../prometheus/common/model/labelset.go | 11 - .../common/model/labelset_string.go | 45 + .../common/model/labelset_string_go120.go | 39 + .../prometheus/common/model/metadata.go | 28 + .../prometheus/common/model/metric.go | 369 +- .../prometheus/common/model/signature.go | 6 +- .../prometheus/common/model/silence.go | 2 +- .../prometheus/common/model/value.go | 16 +- .../prometheus/common/model/value_float.go | 14 +- .../prometheus/procfs/.golangci.yml | 3 + .../prometheus/procfs/Makefile.common | 22 +- vendor/github.com/prometheus/procfs/README.md | 4 +- vendor/github.com/prometheus/procfs/arp.go | 6 +- .../github.com/prometheus/procfs/buddyinfo.go | 6 +- .../github.com/prometheus/procfs/cpuinfo.go | 17 +- vendor/github.com/prometheus/procfs/crypto.go | 7 +- vendor/github.com/prometheus/procfs/fs.go | 11 +- .../prometheus/procfs/fs_statfs_notype.go | 23 + .../prometheus/procfs/fs_statfs_type.go | 33 + .../github.com/prometheus/procfs/fscache.go | 6 +- .../prometheus/procfs/internal/util/parse.go | 15 + vendor/github.com/prometheus/procfs/ipvs.go | 7 +- .../github.com/prometheus/procfs/loadavg.go | 4 +- vendor/github.com/prometheus/procfs/mdstat.go | 36 +- .../github.com/prometheus/procfs/meminfo.go | 4 +- .../github.com/prometheus/procfs/mountinfo.go | 10 +- .../prometheus/procfs/mountstats.go | 117 +- .../prometheus/procfs/net_conntrackstat.go | 91 +- .../prometheus/procfs/net_ip_socket.go | 32 +- .../prometheus/procfs/net_protocols.go | 4 +- .../github.com/prometheus/procfs/net_route.go | 143 + .../prometheus/procfs/net_sockstat.go | 9 +- .../prometheus/procfs/net_softnet.go | 9 +- .../github.com/prometheus/procfs/net_unix.go | 16 +- .../prometheus/procfs/net_wireless.go | 182 + .../github.com/prometheus/procfs/net_xfrm.go | 2 +- .../github.com/prometheus/procfs/netstat.go | 25 +- vendor/github.com/prometheus/procfs/proc.go | 37 +- .../prometheus/procfs/proc_cgroup.go | 4 +- .../prometheus/procfs/proc_cgroups.go | 8 +- .../prometheus/procfs/proc_fdinfo.go | 10 +- .../prometheus/procfs/proc_interrupts.go | 2 +- .../prometheus/procfs/proc_limits.go | 4 +- .../github.com/prometheus/procfs/proc_maps.go | 24 +- .../prometheus/procfs/proc_netstat.go | 4 +- .../github.com/prometheus/procfs/proc_ns.go | 6 +- .../github.com/prometheus/procfs/proc_psi.go | 6 +- .../prometheus/procfs/proc_smaps.go | 4 +- .../github.com/prometheus/procfs/proc_snmp.go | 4 +- .../github.com/prometheus/procfs/proc_stat.go | 8 +- .../prometheus/procfs/proc_status.go | 53 +- .../github.com/prometheus/procfs/proc_sys.go | 2 +- vendor/github.com/prometheus/procfs/slab.go | 2 +- .../github.com/prometheus/procfs/softirqs.go | 24 +- vendor/github.com/prometheus/procfs/stat.go | 28 +- vendor/github.com/prometheus/procfs/swaps.go | 8 +- vendor/github.com/prometheus/procfs/thread.go | 11 +- vendor/github.com/prometheus/procfs/vm.go | 2 +- .../github.com/prometheus/procfs/zoneinfo.go | 4 +- .../statsd_exporter/pkg/level/level.go | 97 + .../statsd_exporter/pkg/mapper/escape.go | 12 + .../statsd_exporter/pkg/mapper/fsm/dump.go | 2 +- .../statsd_exporter/pkg/mapper/fsm/fsm.go | 3 +- .../statsd_exporter/pkg/mapper/mapper.go | 41 +- .../pkg/mapper/mapper_defaults.go | 6 +- .../statsd_exporter/pkg/mapper/mapping.go | 26 +- .../golang-set => robfig/cron/v3}/.gitignore | 0 vendor/github.com/robfig/cron/v3/.travis.yml | 1 + vendor/github.com/robfig/cron/v3/LICENSE | 21 + vendor/github.com/robfig/cron/v3/README.md | 125 + vendor/github.com/robfig/cron/v3/chain.go | 92 + .../robfig/cron/v3/constantdelay.go | 27 + vendor/github.com/robfig/cron/v3/cron.go | 355 + vendor/github.com/robfig/cron/v3/doc.go | 231 + vendor/github.com/robfig/cron/v3/logger.go | 86 + vendor/github.com/robfig/cron/v3/option.go | 45 + vendor/github.com/robfig/cron/v3/parser.go | 434 + vendor/github.com/robfig/cron/v3/spec.go | 188 + vendor/github.com/samber/lo/CHANGELOG.md | 7 +- vendor/github.com/samber/lo/Dockerfile | 2 +- vendor/github.com/samber/lo/Makefile | 26 +- vendor/github.com/samber/lo/README.md | 642 +- vendor/github.com/samber/lo/channel.go | 19 +- vendor/github.com/samber/lo/concurrency.go | 53 +- vendor/github.com/samber/lo/errors.go | 30 +- vendor/github.com/samber/lo/find.go | 263 +- .../lo/internal/constraints/constraints.go | 42 + .../lo/internal/constraints/ordered_go118.go | 11 + .../lo/internal/constraints/ordered_go121.go | 9 + .../samber/lo/internal/rand/ordered_go118.go | 14 + .../samber/lo/internal/rand/ordered_go122.go | 13 + vendor/github.com/samber/lo/intersect.go | 117 +- vendor/github.com/samber/lo/map.go | 116 +- vendor/github.com/samber/lo/math.go | 32 +- vendor/github.com/samber/lo/retry.go | 10 +- vendor/github.com/samber/lo/slice.go | 286 +- vendor/github.com/samber/lo/string.go | 88 +- vendor/github.com/samber/lo/time.go | 85 + vendor/github.com/samber/lo/tuples.go | 524 +- .../github.com/samber/lo/type_manipulation.go | 42 +- vendor/github.com/samber/lo/types.go | 16 +- .../validator/v10 => spf13/cobra}/.gitignore | 26 +- vendor/github.com/spf13/cobra/.golangci.yml | 62 + vendor/github.com/spf13/cobra/.mailmap | 3 + vendor/github.com/spf13/cobra/CONDUCT.md | 37 + vendor/github.com/spf13/cobra/CONTRIBUTING.md | 50 + vendor/github.com/spf13/cobra/LICENSE.txt | 174 + vendor/github.com/spf13/cobra/MAINTAINERS | 13 + vendor/github.com/spf13/cobra/Makefile | 35 + vendor/github.com/spf13/cobra/README.md | 112 + vendor/github.com/spf13/cobra/active_help.go | 67 + vendor/github.com/spf13/cobra/args.go | 131 + .../spf13/cobra/bash_completions.go | 712 + .../spf13/cobra/bash_completionsV2.go | 396 + vendor/github.com/spf13/cobra/cobra.go | 244 + vendor/github.com/spf13/cobra/command.go | 1885 + .../doc.go => spf13/cobra/command_notwin.go} | 12 +- vendor/github.com/spf13/cobra/command_win.go | 41 + vendor/github.com/spf13/cobra/completions.go | 901 + .../spf13/cobra/fish_completions.go | 292 + vendor/github.com/spf13/cobra/flag_groups.go | 290 + .../spf13/cobra/powershell_completions.go | 325 + .../spf13/cobra/shell_completions.go | 98 + .../github.com/spf13/cobra/zsh_completions.go | 308 + vendor/go.opencensus.io/Makefile | 8 +- vendor/go.opencensus.io/opencensus.go | 2 +- .../plugin/ocgrpc/client_metrics.go | 9 + .../plugin/ocgrpc/server_metrics.go | 9 + .../plugin/ocgrpc/stats_common.go | 23 +- vendor/go.opencensus.io/stats/doc.go | 7 +- .../go.opencensus.io/stats/internal/record.go | 6 + vendor/go.opencensus.io/stats/record.go | 21 +- .../stats/view/aggregation.go | 6 +- .../go.opencensus.io/stats/view/collector.go | 9 +- vendor/go.opencensus.io/stats/view/doc.go | 2 +- vendor/go.opencensus.io/stats/view/worker.go | 27 +- vendor/go.opencensus.io/tag/profile_19.go | 1 + vendor/go.opencensus.io/tag/profile_not19.go | 1 + vendor/go.opencensus.io/trace/doc.go | 13 +- vendor/go.opencensus.io/trace/lrumap.go | 2 +- vendor/go.opencensus.io/trace/trace_go11.go | 1 + .../go.opencensus.io/trace/trace_nongo11.go | 1 + vendor/go.uber.org/atomic/.codecov.yml | 19 - vendor/go.uber.org/atomic/.gitignore | 15 - vendor/go.uber.org/atomic/CHANGELOG.md | 100 - vendor/go.uber.org/atomic/LICENSE.txt | 19 - vendor/go.uber.org/atomic/Makefile | 79 - vendor/go.uber.org/atomic/README.md | 63 - vendor/go.uber.org/atomic/bool.go | 81 - vendor/go.uber.org/atomic/doc.go | 23 - vendor/go.uber.org/atomic/duration.go | 82 - vendor/go.uber.org/atomic/duration_ext.go | 40 - vendor/go.uber.org/atomic/error.go | 51 - vendor/go.uber.org/atomic/error_ext.go | 39 - vendor/go.uber.org/atomic/float64.go | 77 - vendor/go.uber.org/atomic/float64_ext.go | 69 - vendor/go.uber.org/atomic/gen.go | 27 - vendor/go.uber.org/atomic/int32.go | 102 - vendor/go.uber.org/atomic/int64.go | 102 - vendor/go.uber.org/atomic/nocmp.go | 35 - vendor/go.uber.org/atomic/string.go | 54 - vendor/go.uber.org/atomic/string_ext.go | 45 - vendor/go.uber.org/atomic/time_ext.go | 36 - vendor/go.uber.org/atomic/uint32.go | 102 - vendor/go.uber.org/atomic/uint64.go | 102 - vendor/go.uber.org/atomic/uintptr.go | 102 - vendor/go.uber.org/atomic/unsafe_pointer.go | 58 - vendor/go.uber.org/atomic/value.go | 31 - .../automaxprocs/internal/cgroups/cgroup.go | 1 + .../automaxprocs/internal/cgroups/cgroups.go | 5 +- .../automaxprocs/internal/cgroups/cgroups2.go | 176 + .../automaxprocs/internal/cgroups/errors.go | 1 + .../internal/cgroups/mountpoint.go | 5 + .../automaxprocs/internal/cgroups/subsys.go | 1 + .../internal/runtime/cpu_quota_linux.go | 24 +- .../internal/runtime/cpu_quota_unsupported.go | 1 + .../automaxprocs/internal/runtime/runtime.go | 2 +- .../automaxprocs/maxprocs/maxprocs.go | 2 +- .../automaxprocs/maxprocs/version.go | 2 +- vendor/go.uber.org/mock/CONTRIBUTORS | 37 - vendor/go.uber.org/mock/gomock/controller.go | 2 + vendor/go.uber.org/mock/gomock/matchers.go | 75 + vendor/go.uber.org/zap/.golangci.yml | 77 + vendor/go.uber.org/zap/.readme.tmpl | 10 +- vendor/go.uber.org/zap/CHANGELOG.md | 292 +- .../go.uber.org/zap/{LICENSE.txt => LICENSE} | 0 vendor/go.uber.org/zap/Makefile | 87 +- vendor/go.uber.org/zap/README.md | 78 +- vendor/go.uber.org/zap/array.go | 127 + vendor/go.uber.org/zap/array_go118.go | 156 - vendor/go.uber.org/zap/buffer/buffer.go | 5 + vendor/go.uber.org/zap/buffer/pool.go | 20 +- vendor/go.uber.org/zap/config.go | 84 +- vendor/go.uber.org/zap/error.go | 14 +- vendor/go.uber.org/zap/field.go | 196 +- vendor/go.uber.org/zap/http_handler.go | 19 +- .../go.uber.org/zap/internal/level_enabler.go | 2 + .../time.go => zap/internal/pool/pool.go} | 51 +- .../stacktrace/stack.go} | 81 +- .../go.uber.org/zap/internal/ztest/clock.go | 123 +- vendor/go.uber.org/zap/level.go | 9 +- vendor/go.uber.org/zap/logger.go | 87 +- vendor/go.uber.org/zap/options.go | 15 + vendor/go.uber.org/zap/sink.go | 5 +- vendor/go.uber.org/zap/sugar.go | 108 +- vendor/go.uber.org/zap/writer.go | 12 +- .../zap/zapcore/console_encoder.go | 16 +- vendor/go.uber.org/zap/zapcore/core.go | 6 +- vendor/go.uber.org/zap/zapcore/encoder.go | 15 + vendor/go.uber.org/zap/zapcore/entry.go | 22 +- vendor/go.uber.org/zap/zapcore/error.go | 14 +- vendor/go.uber.org/zap/zapcore/field.go | 2 +- .../go.uber.org/zap/zapcore/json_encoder.go | 157 +- .../bool_ext.go => zap/zapcore/lazy_with.go} | 49 +- vendor/go.uber.org/zap/zapcore/sampler.go | 9 +- vendor/go.uber.org/zap/zapio/writer.go | 148 - vendor/go.uber.org/zap/zaptest/logger.go | 37 +- vendor/golang.org/x/crypto/sha3/doc.go | 62 - vendor/golang.org/x/crypto/sha3/hashes.go | 101 - .../golang.org/x/crypto/sha3/hashes_noasm.go | 23 - vendor/golang.org/x/crypto/sha3/keccakf.go | 414 - .../golang.org/x/crypto/sha3/keccakf_amd64.go | 13 - .../golang.org/x/crypto/sha3/keccakf_amd64.s | 390 - vendor/golang.org/x/crypto/sha3/register.go | 18 - vendor/golang.org/x/crypto/sha3/sha3.go | 185 - vendor/golang.org/x/crypto/sha3/sha3_s390x.go | 303 - vendor/golang.org/x/crypto/sha3/sha3_s390x.s | 33 - vendor/golang.org/x/crypto/sha3/shake.go | 174 - .../golang.org/x/crypto/sha3/shake_noasm.go | 15 - vendor/golang.org/x/crypto/sha3/xor.go | 40 - vendor/golang.org/x/exp/AUTHORS | 3 - vendor/golang.org/x/exp/CONTRIBUTORS | 3 - vendor/golang.org/x/exp/LICENSE | 4 +- vendor/golang.org/x/exp/maps/maps.go | 94 + vendor/golang.org/x/exp/slices/cmp.go | 44 + vendor/golang.org/x/exp/slices/slices.go | 515 + vendor/golang.org/x/exp/slices/sort.go | 197 + .../golang.org/x/exp/slices/zsortanyfunc.go | 479 + .../golang.org/x/exp/slices/zsortordered.go | 481 + vendor/golang.org/x/net/http2/transport.go | 4 - vendor/golang.org/x/oauth2/deviceauth.go | 198 + .../x/oauth2/internal/client_appengine.go | 1 - vendor/golang.org/x/oauth2/internal/oauth2.go | 2 +- vendor/golang.org/x/oauth2/internal/token.go | 130 +- vendor/golang.org/x/oauth2/oauth2.go | 33 +- vendor/golang.org/x/oauth2/pkce.go | 68 + vendor/golang.org/x/oauth2/token.go | 21 +- vendor/golang.org/x/sync/LICENSE | 4 +- vendor/golang.org/x/sys/cpu/asm_aix_ppc64.s | 17 - vendor/golang.org/x/sys/cpu/byteorder.go | 66 - vendor/golang.org/x/sys/cpu/cpu.go | 291 - vendor/golang.org/x/sys/cpu/cpu_aix.go | 33 - vendor/golang.org/x/sys/cpu/cpu_arm.go | 73 - vendor/golang.org/x/sys/cpu/cpu_arm64.go | 182 - vendor/golang.org/x/sys/cpu/cpu_arm64.s | 39 - vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go | 12 - vendor/golang.org/x/sys/cpu/cpu_gc_s390x.go | 21 - vendor/golang.org/x/sys/cpu/cpu_gc_x86.go | 15 - .../golang.org/x/sys/cpu/cpu_gccgo_arm64.go | 11 - .../golang.org/x/sys/cpu/cpu_gccgo_s390x.go | 22 - vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.c | 37 - vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.go | 31 - vendor/golang.org/x/sys/cpu/cpu_linux.go | 15 - vendor/golang.org/x/sys/cpu/cpu_linux_arm.go | 39 - .../golang.org/x/sys/cpu/cpu_linux_arm64.go | 116 - .../golang.org/x/sys/cpu/cpu_linux_mips64x.go | 22 - .../golang.org/x/sys/cpu/cpu_linux_noinit.go | 9 - .../golang.org/x/sys/cpu/cpu_linux_ppc64x.go | 30 - .../golang.org/x/sys/cpu/cpu_linux_s390x.go | 40 - vendor/golang.org/x/sys/cpu/cpu_loong64.go | 12 - vendor/golang.org/x/sys/cpu/cpu_mips64x.go | 15 - vendor/golang.org/x/sys/cpu/cpu_mipsx.go | 11 - .../golang.org/x/sys/cpu/cpu_netbsd_arm64.go | 173 - .../golang.org/x/sys/cpu/cpu_openbsd_arm64.go | 65 - .../golang.org/x/sys/cpu/cpu_openbsd_arm64.s | 11 - vendor/golang.org/x/sys/cpu/cpu_other_arm.go | 9 - .../golang.org/x/sys/cpu/cpu_other_arm64.go | 9 - .../golang.org/x/sys/cpu/cpu_other_mips64x.go | 11 - .../golang.org/x/sys/cpu/cpu_other_ppc64x.go | 12 - .../golang.org/x/sys/cpu/cpu_other_riscv64.go | 11 - vendor/golang.org/x/sys/cpu/cpu_ppc64x.go | 16 - vendor/golang.org/x/sys/cpu/cpu_riscv64.go | 11 - vendor/golang.org/x/sys/cpu/cpu_s390x.go | 172 - vendor/golang.org/x/sys/cpu/cpu_s390x.s | 57 - vendor/golang.org/x/sys/cpu/cpu_wasm.go | 17 - vendor/golang.org/x/sys/cpu/cpu_x86.go | 151 - vendor/golang.org/x/sys/cpu/cpu_x86.s | 26 - vendor/golang.org/x/sys/cpu/cpu_zos.go | 10 - vendor/golang.org/x/sys/cpu/cpu_zos_s390x.go | 25 - vendor/golang.org/x/sys/cpu/endian_big.go | 10 - vendor/golang.org/x/sys/cpu/endian_little.go | 10 - vendor/golang.org/x/sys/cpu/hwcap_linux.go | 71 - vendor/golang.org/x/sys/cpu/parse.go | 43 - .../x/sys/cpu/proc_cpuinfo_linux.go | 53 - vendor/golang.org/x/sys/cpu/runtime_auxv.go | 16 - .../x/sys/cpu/runtime_auxv_go121.go | 18 - .../golang.org/x/sys/cpu/syscall_aix_gccgo.go | 26 - .../x/sys/cpu/syscall_aix_ppc64_gc.go | 35 - vendor/golang.org/x/sys/unix/mremap.go | 5 + .../golang.org/x/sys/unix/syscall_darwin.go | 12 + vendor/golang.org/x/sys/unix/syscall_unix.go | 9 + .../x/sys/unix/zsyscall_darwin_amd64.go | 33 + .../x/sys/unix/zsyscall_darwin_amd64.s | 10 + .../x/sys/unix/zsyscall_darwin_arm64.go | 33 + .../x/sys/unix/zsyscall_darwin_arm64.s | 10 + .../x/sys/windows/security_windows.go | 24 +- .../x/sys/windows/zsyscall_windows.go | 9 + vendor/golang.org/x/text/cases/cases.go | 162 + vendor/golang.org/x/text/cases/context.go | 376 + vendor/golang.org/x/text/cases/fold.go | 34 + vendor/golang.org/x/text/cases/icu.go | 61 + vendor/golang.org/x/text/cases/info.go | 82 + vendor/golang.org/x/text/cases/map.go | 816 + .../golang.org/x/text/cases/tables10.0.0.go | 2255 ++ .../golang.org/x/text/cases/tables11.0.0.go | 2316 ++ .../golang.org/x/text/cases/tables12.0.0.go | 2359 ++ .../golang.org/x/text/cases/tables13.0.0.go | 2399 ++ .../golang.org/x/text/cases/tables15.0.0.go | 2527 ++ vendor/golang.org/x/text/cases/tables9.0.0.go | 2215 ++ vendor/golang.org/x/text/cases/trieval.go | 217 + vendor/golang.org/x/text/internal/internal.go | 49 + vendor/golang.org/x/text/internal/match.go | 67 + vendor/golang.org/x/time/LICENSE | 4 +- vendor/golang.org/x/time/rate/rate.go | 2 + vendor/golang.org/x/tools/cover/profile.go | 266 + .../gomodules.xyz/jsonpatch/v2/jsonpatch.go | 162 +- .../appengine/internal/api.go | 347 +- .../appengine/internal/api_classic.go | 29 +- .../appengine/internal/api_common.go | 50 +- .../appengine/internal/identity.go | 7 +- .../appengine/internal/identity_classic.go | 23 +- .../appengine/internal/identity_flex.go | 1 + .../appengine/internal/identity_vm.go | 20 +- .../appengine/internal/main.go | 1 + .../appengine/internal/main_vm.go | 3 +- .../appengine/internal/transaction.go | 10 +- .../appengine/urlfetch/urlfetch.go | 9 +- .../genproto/{ => googleapis/api}/LICENSE | 0 .../genproto/googleapis/rpc}/LICENSE | 1 + vendor/google.golang.org/grpc/README.md | 60 +- .../grpc/attributes/attributes.go | 59 +- .../grpc/balancer/balancer.go | 62 +- .../grpc/balancer/base/balancer.go | 22 +- .../grpc/balancer_conn_wrappers.go | 75 +- .../grpc_binarylog_v1/binarylog.pb.go | 2 +- vendor/google.golang.org/grpc/call.go | 11 +- vendor/google.golang.org/grpc/clientconn.go | 248 +- vendor/google.golang.org/grpc/codec.go | 8 +- vendor/google.golang.org/grpc/dialoptions.go | 42 +- .../grpc/encoding/encoding.go | 17 +- .../grpc/encoding/proto/proto.go | 4 +- .../grpc/grpclog/component.go | 40 +- .../google.golang.org/grpc/grpclog/grpclog.go | 30 +- .../google.golang.org/grpc/grpclog/logger.go | 30 +- .../grpc/grpclog/loggerv2.go | 56 +- .../grpc/health/grpc_health_v1/health.pb.go | 2 +- .../health/grpc_health_v1/health_grpc.pb.go | 22 +- vendor/google.golang.org/grpc/interceptor.go | 12 +- .../grpc/internal/backoff/backoff.go | 36 + .../balancer/gracefulswitch/gracefulswitch.go | 59 +- .../grpc/internal/balancerload/load.go | 4 +- .../grpc/internal/binarylog/method_logger.go | 4 +- .../grpc/internal/buffer/unbounded.go | 18 +- .../grpc/internal/channelz/funcs.go | 69 +- .../grpc/internal/channelz/logging.go | 12 +- .../grpc/internal/channelz/types.go | 5 + .../grpc/internal/channelz/util_linux.go | 2 +- .../grpc/internal/channelz/util_nonlinux.go | 2 +- .../grpc/internal/credentials/credentials.go | 8 +- .../grpc/internal/envconfig/envconfig.go | 12 +- .../grpc/internal/grpclog/grpclog.go | 40 +- .../grpc/internal/grpclog/prefixLogger.go | 8 +- .../grpc/internal/grpcrand/grpcrand.go | 7 + .../internal/grpcsync/callback_serializer.go | 54 +- .../grpc/internal/grpcsync/pubsub.go | 121 + .../grpc/{ => internal/idle}/idle.go | 188 +- .../grpc/internal/internal.go | 51 +- .../grpc/internal/metadata/metadata.go | 2 +- .../grpc/internal/pretty/pretty.go | 2 +- .../grpc/internal/resolver/config_selector.go | 4 +- .../internal/resolver/dns/dns_resolver.go | 74 +- .../grpc/internal/status/status.go | 36 +- .../grpc/internal/transport/controlbuf.go | 16 +- .../grpc/internal/transport/handler_server.go | 13 +- .../grpc/internal/transport/http2_client.go | 56 +- .../grpc/internal/transport/http2_server.go | 22 +- .../grpc/internal/transport/http_util.go | 77 +- .../grpc/internal/transport/transport.go | 19 +- .../google.golang.org/grpc/picker_wrapper.go | 34 +- vendor/google.golang.org/grpc/pickfirst.go | 88 +- vendor/google.golang.org/grpc/preloader.go | 2 +- vendor/google.golang.org/grpc/resolver/map.go | 10 +- .../grpc/resolver/resolver.go | 84 +- .../grpc/resolver_conn_wrapper.go | 10 +- vendor/google.golang.org/grpc/rpc_util.go | 44 +- vendor/google.golang.org/grpc/server.go | 231 +- .../grpc/shared_buffer_pool.go | 154 + vendor/google.golang.org/grpc/stats/stats.go | 14 +- .../google.golang.org/grpc/status/status.go | 14 +- vendor/google.golang.org/grpc/stream.go | 130 +- vendor/google.golang.org/grpc/tap/tap.go | 6 + vendor/google.golang.org/grpc/trace.go | 6 +- vendor/google.golang.org/grpc/version.go | 2 +- vendor/google.golang.org/grpc/vet.sh | 10 +- .../encoding/protodelim/protodelim.go | 160 + .../protobuf/encoding/protojson/encode.go | 20 +- .../protobuf/encoding/prototext/encode.go | 20 +- .../protobuf/internal/descfmt/stringer.go | 1 + .../editiondefaults/editions_defaults.binpb | Bin 63 -> 93 bytes .../internal/editionssupport/editions.go | 13 + .../protobuf/internal/encoding/tag/tag.go | 4 +- .../protobuf/internal/errors/errors.go | 15 + .../protobuf/internal/filedesc/desc.go | 84 +- .../protobuf/internal/filedesc/desc_init.go | 41 +- .../protobuf/internal/filedesc/desc_lazy.go | 44 +- .../internal/filedesc/desc_list_gen.go | 11 + .../protobuf/internal/filedesc/editions.go | 22 +- .../protobuf/internal/filedesc/placeholder.go | 1 + .../protobuf/internal/genid/descriptor_gen.go | 46 +- .../internal/genid/go_features_gen.go | 2 +- .../protobuf/internal/impl/codec_field.go | 64 +- .../protobuf/internal/impl/codec_map.go | 15 +- .../protobuf/internal/impl/legacy_enum.go | 1 + .../internal/impl/legacy_extension.go | 2 +- .../protobuf/internal/impl/legacy_file.go | 4 +- .../protobuf/internal/impl/legacy_message.go | 10 +- .../protobuf/internal/impl/message_reflect.go | 31 +- .../internal/impl/message_reflect_gen.go | 142 +- .../protobuf/internal/version/version.go | 4 +- .../protobuf/proto/decode.go | 2 + .../protobuf/proto/encode.go | 44 +- .../protobuf/proto/extension.go | 11 +- .../protobuf/proto/messageset.go | 7 +- .../google.golang.org/protobuf/proto/size.go | 2 + .../protobuf/reflect/protodesc/desc.go | 13 +- .../protobuf/reflect/protodesc/desc_init.go | 49 +- .../reflect/protodesc/desc_validate.go | 61 +- .../protobuf/reflect/protodesc/editions.go | 11 +- .../protobuf/reflect/protodesc/proto.go | 22 + .../protobuf/reflect/protoreflect/proto.go | 2 +- .../reflect/protoreflect/source_gen.go | 19 + .../protobuf/reflect/protoreflect/type.go | 6 + .../types/descriptorpb/descriptor.pb.go | 636 +- .../types/gofeaturespb/go_features.pb.go | 122 +- .../types/gofeaturespb/go_features.proto | 28 - .../k8s.io/api/admission/v1/generated.pb.go | 127 +- .../v1/types_swagger_doc_generated.go | 2 +- .../api/admission/v1beta1/generated.pb.go | 129 +- .../v1beta1/types_swagger_doc_generated.go | 2 +- .../admissionregistration/v1/generated.pb.go | 6593 +++- .../admissionregistration/v1/generated.proto | 639 + .../api/admissionregistration/v1/register.go | 4 + .../api/admissionregistration/v1/types.go | 669 + .../v1/types_swagger_doc_generated.go | 188 +- .../v1/zz_generated.deepcopy.go | 458 + .../api/admissionregistration/v1alpha1/doc.go | 23 + .../v1alpha1/generated.pb.go | 4633 +++ .../v1alpha1/generated.proto | 609 + .../v1alpha1/register.go | 56 + .../admissionregistration/v1alpha1/types.go | 665 + .../v1alpha1/types_swagger_doc_generated.go | 204 + .../v1alpha1/zz_generated.deepcopy.go | 475 + .../v1beta1/generated.pb.go | 6046 ++- .../v1beta1/generated.proto | 672 +- .../admissionregistration/v1beta1/register.go | 4 + .../admissionregistration/v1beta1/types.go | 740 +- .../v1beta1/types_swagger_doc_generated.go | 193 +- .../v1beta1/zz_generated.deepcopy.go | 463 +- .../zz_generated.prerelease-lifecycle.go | 72 + .../v1alpha1 => api/apidiscovery/v2}/doc.go | 9 +- .../api/apidiscovery/v2/generated.pb.go | 1742 + .../api/apidiscovery/v2/generated.proto | 156 + vendor/k8s.io/api/apidiscovery/v2/register.go | 56 + vendor/k8s.io/api/apidiscovery/v2/types.go | 155 + .../apidiscovery/v2/zz_generated.deepcopy.go | 190 + .../api/apidiscovery/v2beta1}/doc.go | 13 +- .../api/apidiscovery/v2beta1/generated.pb.go | 1743 + .../api/apidiscovery/v2beta1/generated.proto | 156 + .../api/apidiscovery/v2beta1/register.go | 56 + .../k8s.io/api/apidiscovery/v2beta1/types.go | 163 + .../v2beta1/zz_generated.deepcopy.go | 190 + .../zz_generated.prerelease-lifecycle.go | 58 + .../v1alpha1/generated.pb.go | 165 +- .../v1alpha1/generated.proto | 6 +- .../api/apiserverinternal/v1alpha1/types.go | 6 +- .../v1alpha1/types_swagger_doc_generated.go | 3 +- .../v1alpha1/zz_generated.deepcopy.go | 5 + vendor/k8s.io/api/apps/v1/generated.pb.go | 540 +- vendor/k8s.io/api/apps/v1/generated.proto | 41 +- vendor/k8s.io/api/apps/v1/types.go | 44 +- .../apps/v1/types_swagger_doc_generated.go | 20 +- .../api/apps/v1/zz_generated.deepcopy.go | 21 + .../k8s.io/api/apps/v1beta1/generated.pb.go | 504 +- .../k8s.io/api/apps/v1beta1/generated.proto | 87 +- vendor/k8s.io/api/apps/v1beta1/types.go | 87 +- .../v1beta1/types_swagger_doc_generated.go | 70 +- .../api/apps/v1beta1/zz_generated.deepcopy.go | 21 + .../k8s.io/api/apps/v1beta2/generated.pb.go | 563 +- .../k8s.io/api/apps/v1beta2/generated.proto | 43 +- vendor/k8s.io/api/apps/v1beta2/types.go | 43 +- .../v1beta2/types_swagger_doc_generated.go | 22 +- .../api/apps/v1beta2/zz_generated.deepcopy.go | 21 + .../api/authentication/v1/generated.pb.go | 525 +- .../api/authentication/v1/generated.proto | 24 + .../k8s.io/api/authentication/v1/register.go | 1 + vendor/k8s.io/api/authentication/v1/types.go | 29 + .../v1/types_swagger_doc_generated.go | 21 +- .../v1/zz_generated.deepcopy.go | 44 + .../k8s.io/api/authentication/v1alpha1/doc.go | 23 + .../authentication/v1alpha1/generated.pb.go | 566 + .../authentication/v1alpha1/generated.proto | 51 + .../api/authentication/v1alpha1/register.go | 51 + .../api/authentication/v1alpha1/types.go | 48 + .../v1alpha1/types_swagger_doc_generated.go | 49 + .../v1alpha1}/zz_generated.deepcopy.go | 47 +- .../zz_generated.prerelease-lifecycle.go | 40 + .../authentication/v1beta1/generated.pb.go | 487 +- .../authentication/v1beta1/generated.proto | 24 + .../api/authentication/v1beta1/register.go | 1 + .../api/authentication/v1beta1/types.go | 30 + .../v1beta1/types_swagger_doc_generated.go | 21 +- .../v1beta1/zz_generated.deepcopy.go | 44 + .../zz_generated.prerelease-lifecycle.go | 18 + .../api/authorization/v1/generated.pb.go | 177 +- .../api/authorization/v1/generated.proto | 9 + vendor/k8s.io/api/authorization/v1/types.go | 9 + .../v1/types_swagger_doc_generated.go | 2 +- .../api/authorization/v1beta1/generated.pb.go | 183 +- .../api/authorization/v1beta1/generated.proto | 9 + .../k8s.io/api/authorization/v1beta1/types.go | 9 + .../v1beta1/types_swagger_doc_generated.go | 2 +- .../k8s.io/api/autoscaling/v1/generated.pb.go | 255 +- .../k8s.io/api/autoscaling/v1/generated.proto | 42 +- vendor/k8s.io/api/autoscaling/v1/types.go | 79 +- .../v1/types_swagger_doc_generated.go | 42 +- .../k8s.io/api/autoscaling/v2/generated.pb.go | 243 +- .../k8s.io/api/autoscaling/v2/generated.proto | 20 +- vendor/k8s.io/api/autoscaling/v2/types.go | 61 +- .../v2/types_swagger_doc_generated.go | 22 +- .../api/autoscaling/v2beta1/generated.pb.go | 243 +- .../api/autoscaling/v2beta1/generated.proto | 7 +- .../k8s.io/api/autoscaling/v2beta1/types.go | 7 +- .../v2beta1/types_swagger_doc_generated.go | 6 +- .../api/autoscaling/v2beta2/generated.pb.go | 255 +- .../api/autoscaling/v2beta2/generated.proto | 28 +- .../k8s.io/api/autoscaling/v2beta2/types.go | 66 +- .../v2beta2/types_swagger_doc_generated.go | 26 +- vendor/k8s.io/api/batch/v1/generated.pb.go | 1077 +- vendor/k8s.io/api/batch/v1/generated.proto | 196 +- vendor/k8s.io/api/batch/v1/types.go | 284 +- .../batch/v1/types_swagger_doc_generated.go | 70 +- .../api/batch/v1/zz_generated.deepcopy.go | 84 + .../k8s.io/api/batch/v1beta1/generated.pb.go | 330 +- .../k8s.io/api/batch/v1beta1/generated.proto | 15 +- vendor/k8s.io/api/batch/v1beta1/register.go | 1 - vendor/k8s.io/api/batch/v1beta1/types.go | 20 +- .../v1beta1/types_swagger_doc_generated.go | 16 +- .../batch/v1beta1/zz_generated.deepcopy.go | 27 - .../zz_generated.prerelease-lifecycle.go | 18 - .../api/certificates/v1/generated.pb.go | 133 +- vendor/k8s.io/api/certificates/v1/types.go | 3 +- .../v1/types_swagger_doc_generated.go | 2 +- .../k8s.io/api/certificates/v1alpha1/doc.go | 24 + .../api/certificates/v1alpha1/generated.pb.go | 831 + .../api/certificates/v1alpha1/generated.proto | 103 + .../api/certificates/v1alpha1/register.go | 61 + .../k8s.io/api/certificates/v1alpha1/types.go | 106 + .../v1alpha1/types_swagger_doc_generated.go | 60 + .../v1alpha1/zz_generated.deepcopy.go | 102 + .../zz_generated.prerelease-lifecycle.go | 58 + .../api/certificates/v1beta1/generated.pb.go | 135 +- .../api/certificates/v1beta1/generated.proto | 6 +- .../k8s.io/api/certificates/v1beta1/types.go | 9 +- .../v1beta1/types_swagger_doc_generated.go | 4 +- .../api/coordination/v1/generated.pb.go | 85 +- .../api/coordination/v1/generated.proto | 6 +- vendor/k8s.io/api/coordination/v1/types.go | 6 +- .../v1/types_swagger_doc_generated.go | 8 +- .../api/coordination/v1beta1/generated.pb.go | 85 +- .../api/coordination/v1beta1/generated.proto | 6 +- .../k8s.io/api/coordination/v1beta1/types.go | 6 +- .../v1beta1/types_swagger_doc_generated.go | 8 +- .../api/core/v1/annotation_key_constants.go | 44 +- vendor/k8s.io/api/core/v1/generated.pb.go | 9569 +++-- vendor/k8s.io/api/core/v1/generated.proto | 913 +- vendor/k8s.io/api/core/v1/toleration.go | 14 +- vendor/k8s.io/api/core/v1/types.go | 1129 +- .../core/v1/types_swagger_doc_generated.go | 334 +- .../k8s.io/api/core/v1/well_known_labels.go | 4 + .../api/core/v1/zz_generated.deepcopy.go | 491 +- .../k8s.io/api/discovery/v1/generated.pb.go | 137 +- .../k8s.io/api/discovery/v1/generated.proto | 34 +- vendor/k8s.io/api/discovery/v1/types.go | 50 +- .../v1/types_swagger_doc_generated.go | 18 +- .../api/discovery/v1beta1/generated.pb.go | 135 +- .../api/discovery/v1beta1/generated.proto | 19 +- vendor/k8s.io/api/discovery/v1beta1/types.go | 36 +- .../v1beta1/types_swagger_doc_generated.go | 16 +- vendor/k8s.io/api/events/v1/generated.pb.go | 111 +- .../events/v1/types_swagger_doc_generated.go | 2 +- .../k8s.io/api/events/v1beta1/generated.pb.go | 111 +- .../v1beta1/types_swagger_doc_generated.go | 2 +- .../api/extensions/v1beta1/generated.pb.go | 11015 ++---- .../api/extensions/v1beta1/generated.proto | 382 +- .../k8s.io/api/extensions/v1beta1/register.go | 2 - vendor/k8s.io/api/extensions/v1beta1/types.go | 511 +- .../v1beta1/types_swagger_doc_generated.go | 213 +- .../v1beta1/zz_generated.deepcopy.go | 457 +- .../zz_generated.prerelease-lifecycle.go | 48 - vendor/k8s.io/api/flowcontrol/v1/doc.go | 24 + .../k8s.io/api/flowcontrol/v1/generated.pb.go | 5666 +++ .../k8s.io/api/flowcontrol/v1/generated.proto | 520 + .../flowcontrol/{v1alpha1 => v1}/register.go | 6 +- .../api/flowcontrol/{v1alpha1 => v1}/types.go | 181 +- .../v1/types_swagger_doc_generated.go | 274 + .../flowcontrol/v1/zz_generated.deepcopy.go | 588 + .../api/flowcontrol/v1beta1/generated.pb.go | 539 +- .../api/flowcontrol/v1beta1/generated.proto | 73 +- .../k8s.io/api/flowcontrol/v1beta1/types.go | 88 +- .../v1beta1/types_swagger_doc_generated.go | 17 +- .../v1beta1/zz_generated.deepcopy.go | 41 + .../zz_generated.prerelease-lifecycle.go | 8 +- .../api/flowcontrol/v1beta2/generated.pb.go | 540 +- .../api/flowcontrol/v1beta2/generated.proto | 73 +- .../k8s.io/api/flowcontrol/v1beta2/types.go | 84 +- .../v1beta2/types_swagger_doc_generated.go | 17 +- .../v1beta2/zz_generated.deepcopy.go | 41 + .../zz_generated.prerelease-lifecycle.go | 28 + .../flowcontrol/{v1alpha1 => v1beta3}/doc.go | 6 +- .../{v1alpha1 => v1beta3}/generated.pb.go | 598 +- .../{v1alpha1 => v1beta3}/generated.proto | 105 +- .../api/flowcontrol/v1beta3/register.go | 58 + .../k8s.io/api/flowcontrol/v1beta3/types.go | 677 + .../types_swagger_doc_generated.go | 19 +- .../zz_generated.deepcopy.go | 43 +- .../zz_generated.prerelease-lifecycle.go | 34 +- .../k8s.io/api/networking/v1/generated.pb.go | 1169 +- .../k8s.io/api/networking/v1/generated.proto | 237 +- vendor/k8s.io/api/networking/v1/types.go | 282 +- .../v1/types_swagger_doc_generated.go | 143 +- .../networking/v1/zz_generated.deepcopy.go | 91 +- .../api/networking/v1alpha1/generated.pb.go | 1462 +- .../api/networking/v1alpha1/generated.proto | 123 +- .../api/networking/v1alpha1/register.go | 16 +- .../k8s.io/api/networking/v1alpha1/types.go | 144 +- .../v1alpha1/types_swagger_doc_generated.go | 86 +- .../networking/v1alpha1/well_known_labels.go | 33 + .../v1alpha1/zz_generated.deepcopy.go | 161 +- .../zz_generated.prerelease-lifecycle.go | 60 +- .../api/networking/v1beta1/generated.pb.go | 858 +- .../api/networking/v1beta1/generated.proto | 118 +- vendor/k8s.io/api/networking/v1beta1/types.go | 127 +- .../v1beta1/types_swagger_doc_generated.go | 89 +- .../v1beta1/zz_generated.deepcopy.go | 67 + vendor/k8s.io/api/node/v1/generated.pb.go | 99 +- vendor/k8s.io/api/node/v1/generated.proto | 10 +- vendor/k8s.io/api/node/v1/types.go | 12 +- .../node/v1/types_swagger_doc_generated.go | 12 +- .../k8s.io/api/node/v1alpha1/generated.pb.go | 103 +- .../k8s.io/api/node/v1alpha1/generated.proto | 14 +- vendor/k8s.io/api/node/v1alpha1/types.go | 16 +- .../v1alpha1/types_swagger_doc_generated.go | 14 +- .../k8s.io/api/node/v1beta1/generated.pb.go | 99 +- .../k8s.io/api/node/v1beta1/generated.proto | 12 +- vendor/k8s.io/api/node/v1beta1/types.go | 14 +- .../v1beta1/types_swagger_doc_generated.go | 12 +- vendor/k8s.io/api/policy/v1/doc.go | 2 +- vendor/k8s.io/api/policy/v1/generated.pb.go | 167 +- vendor/k8s.io/api/policy/v1/generated.proto | 28 + vendor/k8s.io/api/policy/v1/types.go | 48 + .../policy/v1/types_swagger_doc_generated.go | 11 +- .../api/policy/v1/zz_generated.deepcopy.go | 5 + vendor/k8s.io/api/policy/v1beta1/doc.go | 2 +- .../k8s.io/api/policy/v1beta1/generated.pb.go | 4972 +-- .../k8s.io/api/policy/v1beta1/generated.proto | 305 +- vendor/k8s.io/api/policy/v1beta1/register.go | 2 - vendor/k8s.io/api/policy/v1beta1/types.go | 419 +- .../v1beta1/types_swagger_doc_generated.go | 171 +- .../policy/v1beta1/zz_generated.deepcopy.go | 372 +- .../zz_generated.prerelease-lifecycle.go | 36 - vendor/k8s.io/api/rbac/v1/generated.pb.go | 137 +- vendor/k8s.io/api/rbac/v1/generated.proto | 12 + vendor/k8s.io/api/rbac/v1/types.go | 12 + .../rbac/v1/types_swagger_doc_generated.go | 6 +- .../k8s.io/api/rbac/v1alpha1/generated.pb.go | 141 +- .../k8s.io/api/rbac/v1alpha1/generated.proto | 10 + vendor/k8s.io/api/rbac/v1alpha1/types.go | 10 + .../v1alpha1/types_swagger_doc_generated.go | 2 +- .../k8s.io/api/rbac/v1beta1/generated.pb.go | 137 +- .../k8s.io/api/rbac/v1beta1/generated.proto | 10 + vendor/k8s.io/api/rbac/v1beta1/types.go | 10 + .../v1beta1/types_swagger_doc_generated.go | 2 +- vendor/k8s.io/api/resource/v1alpha2/doc.go | 24 + .../api/resource/v1alpha2/generated.pb.go | 10589 +++++ .../api/resource/v1alpha2/generated.proto | 749 + .../api/resource/v1alpha2/namedresources.go | 127 + .../k8s.io/api/resource/v1alpha2/register.go | 69 + vendor/k8s.io/api/resource/v1alpha2/types.go | 737 + .../v1alpha2/types_swagger_doc_generated.go | 395 + .../v1alpha2/zz_generated.deepcopy.go | 1126 + .../k8s.io/api/scheduling/v1/generated.pb.go | 73 +- .../k8s.io/api/scheduling/v1/generated.proto | 4 +- vendor/k8s.io/api/scheduling/v1/types.go | 4 +- .../v1/types_swagger_doc_generated.go | 6 +- .../api/scheduling/v1alpha1/generated.pb.go | 71 +- .../api/scheduling/v1alpha1/generated.proto | 4 +- .../k8s.io/api/scheduling/v1alpha1/types.go | 4 +- .../v1alpha1/types_swagger_doc_generated.go | 6 +- .../api/scheduling/v1beta1/generated.pb.go | 73 +- .../api/scheduling/v1beta1/generated.proto | 4 +- vendor/k8s.io/api/scheduling/v1beta1/types.go | 4 +- .../v1beta1/types_swagger_doc_generated.go | 6 +- vendor/k8s.io/api/storage/v1/generated.pb.go | 259 +- vendor/k8s.io/api/storage/v1/generated.proto | 138 +- vendor/k8s.io/api/storage/v1/types.go | 144 +- .../storage/v1/types_swagger_doc_generated.go | 82 +- .../api/storage/v1alpha1/generated.pb.go | 753 +- .../api/storage/v1alpha1/generated.proto | 80 +- .../k8s.io/api/storage/v1alpha1/register.go | 2 + vendor/k8s.io/api/storage/v1alpha1/types.go | 95 +- .../v1alpha1/types_swagger_doc_generated.go | 59 +- .../storage/v1alpha1/zz_generated.deepcopy.go | 66 + .../zz_generated.prerelease-lifecycle.go | 36 + .../api/storage/v1beta1/generated.pb.go | 259 +- .../api/storage/v1beta1/generated.proto | 121 +- vendor/k8s.io/api/storage/v1beta1/types.go | 128 +- .../v1beta1/types_swagger_doc_generated.go | 78 +- .../api/storagemigration/v1alpha1/doc.go | 23 + .../storagemigration/v1alpha1/generated.pb.go | 1688 + .../storagemigration/v1alpha1/generated.proto | 127 + .../api/storagemigration/v1alpha1/register.go | 58 + .../api/storagemigration/v1alpha1/types.go | 131 + .../v1alpha1/types_swagger_doc_generated.go | 95 + .../v1alpha1/zz_generated.deepcopy.go | 160 + .../zz_generated.prerelease-lifecycle.go | 58 + .../pkg/apis/apiextensions/deepcopy.go | 8 +- .../pkg/apis/apiextensions/types.go | 25 + .../apis/apiextensions/types_jsonschema.go | 81 + .../pkg/apis/apiextensions/v1/conversion.go | 26 +- .../pkg/apis/apiextensions/v1/deepcopy.go | 8 +- .../pkg/apis/apiextensions/v1/generated.pb.go | 833 +- .../pkg/apis/apiextensions/v1/generated.proto | 109 +- .../pkg/apis/apiextensions/v1/types.go | 38 +- .../apis/apiextensions/v1/types_jsonschema.go | 135 +- .../v1/zz_generated.conversion.go | 41 + .../apiextensions/v1/zz_generated.deepcopy.go | 35 +- .../apis/apiextensions/v1beta1/deepcopy.go | 8 +- .../apiextensions/v1beta1/generated.pb.go | 896 +- .../apiextensions/v1beta1/generated.proto | 111 +- .../pkg/apis/apiextensions/v1beta1/types.go | 40 +- .../apiextensions/v1beta1/types_jsonschema.go | 135 +- .../v1beta1/zz_generated.conversion.go | 42 + .../v1beta1/zz_generated.deepcopy.go | 40 +- .../apiextensions/zz_generated.deepcopy.go | 40 +- .../v1/customresourcecolumndefinition.go | 84 + .../v1/customresourceconversion.go | 52 + .../v1/customresourcedefinition.go | 218 + .../v1/customresourcedefinitioncondition.go | 80 + .../v1/customresourcedefinitionnames.go | 88 + .../v1/customresourcedefinitionspec.go | 93 + .../v1/customresourcedefinitionstatus.go | 64 + .../v1/customresourcedefinitionversion.go | 121 + .../v1/customresourcesubresources.go | 52 + .../v1/customresourcesubresourcescale.go | 57 + .../v1/customresourcevalidation.go | 39 + .../apiextensions/v1/externaldocumentation.go | 48 + .../apiextensions/v1/jsonschemaprops.go | 463 + .../apiextensions/v1/selectablefield.go | 39 + .../apiextensions/v1/servicereference.go | 66 + .../apiextensions/v1/validationrule.go | 88 + .../apiextensions/v1/webhookclientconfig.go | 59 + .../apiextensions/v1/webhookconversion.go | 50 + .../v1beta1/customresourcecolumndefinition.go | 84 + .../v1beta1/customresourceconversion.go | 63 + .../v1beta1/customresourcedefinition.go | 218 + .../customresourcedefinitioncondition.go | 80 + .../v1beta1/customresourcedefinitionnames.go | 88 + .../v1beta1/customresourcedefinitionspec.go | 148 + .../v1beta1/customresourcedefinitionstatus.go | 64 + .../customresourcedefinitionversion.go | 121 + .../v1beta1/customresourcesubresources.go | 52 + .../v1beta1/customresourcesubresourcescale.go | 57 + .../v1beta1/customresourcevalidation.go | 39 + .../v1beta1/externaldocumentation.go | 48 + .../apiextensions/v1beta1/jsonschemaprops.go | 463 + .../apiextensions/v1beta1/selectablefield.go} | 20 +- .../apiextensions/v1beta1/servicereference.go | 66 + .../apiextensions/v1beta1/validationrule.go | 88 + .../v1beta1/webhookclientconfig.go | 59 + .../client/clientset/clientset/clientset.go | 23 +- .../clientset/clientset/scheme/register.go | 2 +- .../v1/customresourcedefinition.go | 59 + .../v1beta1/customresourcedefinition.go | 59 + .../apiextensions/interface.go | 54 + .../v1/customresourcedefinition.go | 89 + .../apiextensions/v1/interface.go | 45 + .../v1beta1/customresourcedefinition.go | 89 + .../apiextensions/v1beta1/interface.go | 45 + .../informers/externalversions/factory.go | 261 + .../informers/externalversions/generic.go | 67 + .../internalinterfaces/factory_interfaces.go | 40 + .../v1/customresourcedefinition.go | 68 + .../apiextensions/v1/expansion_generated.go} | 18 +- .../v1beta1/customresourcedefinition.go | 68 + .../v1beta1/expansion_generated.go | 23 + .../k8s.io/apimachinery/pkg/api/errors/OWNERS | 1 - .../apimachinery/pkg/api/meta/conditions.go | 37 +- .../apimachinery/pkg/api/meta/errors.go | 35 +- .../k8s.io/apimachinery/pkg/api/meta/help.go | 86 +- .../apimachinery/pkg/api/resource/OWNERS | 1 - .../apimachinery/pkg/api/resource/amount.go | 38 + .../pkg/api/resource/generated.pb.go | 43 +- .../apimachinery/pkg/api/resource/quantity.go | 10 + .../pkg/api/validation}/OWNERS | 2 - .../pkg/api/validation/objectmeta.go | 9 +- .../pkg/apis/meta/internalversion/defaults.go | 38 + .../pkg/apis/meta/internalversion/types.go | 25 + .../zz_generated.conversion.go | 2 + .../internalversion/zz_generated.deepcopy.go | 5 + .../pkg/apis/meta/v1/generated.pb.go | 478 +- .../pkg/apis/meta/v1/generated.proto | 93 +- .../apimachinery/pkg/apis/meta/v1/helpers.go | 2 +- .../apimachinery/pkg/apis/meta/v1/types.go | 126 +- .../meta/v1/types_swagger_doc_generated.go | 25 +- .../pkg/apis/meta/v1/unstructured/helpers.go | 2 +- .../apis/meta/v1/unstructured/unstructured.go | 5 + .../meta/v1/unstructured/unstructured_list.go | 9 + .../pkg/apis/meta/v1/validation/validation.go | 40 +- .../apis/meta/v1/zz_generated.conversion.go | 7 + .../pkg/apis/meta/v1/zz_generated.deepcopy.go | 5 + .../pkg/apis/meta/v1beta1/generated.pb.go | 45 +- .../v1beta1/types_swagger_doc_generated.go | 2 +- .../k8s.io/apimachinery/pkg/labels/labels.go | 2 + .../apimachinery/pkg/labels/selector.go | 141 +- .../k8s.io/apimachinery/pkg/runtime/codec.go | 1 - .../apimachinery/pkg/runtime/converter.go | 4 +- .../apimachinery/pkg/runtime/generated.pb.go | 65 +- .../k8s.io/apimachinery/pkg/runtime/helper.go | 35 +- .../apimachinery/pkg/runtime/interfaces.go | 5 + .../pkg/runtime/schema/generated.pb.go | 31 +- .../pkg/runtime/schema/group_version.go | 8 +- .../k8s.io/apimachinery/pkg/runtime/scheme.go | 3 +- .../pkg/runtime/serializer/codec_factory.go | 3 +- .../runtime/serializer/streaming/streaming.go | 20 - .../serializer/versioning/versioning.go | 2 +- .../k8s.io/apimachinery/pkg/runtime/splice.go | 76 + .../k8s.io/apimachinery/pkg/runtime/types.go | 2 +- .../apimachinery/pkg/types/namespacedname.go | 11 + .../apimachinery/pkg/util/cache/expiring.go | 12 +- .../pkg/util/cache/lruexpirecache.go | 13 + .../k8s.io/apimachinery/pkg/util/diff/diff.go | 37 +- .../k8s.io/apimachinery/pkg/util/dump/dump.go | 54 + .../apimachinery/pkg/util/errors/errors.go | 2 +- .../apimachinery/pkg/util/framer/framer.go | 2 +- .../pkg/util/intstr/generated.pb.go | 47 +- .../apimachinery/pkg/util/intstr/intstr.go | 13 +- .../pkg/util/managedfields/endpoints.yaml | 7018 ++++ .../pkg/util/managedfields/fieldmanager.go | 57 + .../managedfields/internal/atmostevery.go | 60 + .../internal/buildmanagerinfo.go | 74 + .../managedfields/internal/capmanagers.go | 133 + .../util/managedfields/internal/conflict.go | 89 + .../managedfields/internal/fieldmanager.go | 209 + .../pkg/util/managedfields/internal/fields.go | 47 + .../managedfields/internal/lastapplied.go | 50 + .../internal/lastappliedmanager.go | 171 + .../internal/lastappliedupdater.go | 102 + .../managedfields/internal/managedfields.go | 248 + .../internal/managedfieldsupdater.go | 82 + .../util/managedfields/internal/manager.go | 52 + .../managedfields/internal/pathelement.go | 140 + .../managedfields/internal/skipnonapplied.go | 89 + .../util/managedfields/internal/stripmeta.go | 90 + .../managedfields/internal/structuredmerge.go | 189 + .../managedfields/internal/typeconverter.go | 193 + .../managedfields/internal/versioncheck.go | 52 + .../internal/versionconverter.go | 123 + .../pkg/util/managedfields/node.yaml | 261 + .../pkg/util/managedfields/pod.yaml | 121 + .../pkg/util/managedfields/scalehandler.go | 174 + .../pkg/util/managedfields/typeconverter.go | 47 + .../apimachinery/pkg/util/mergepatch/util.go | 7 +- .../k8s.io/apimachinery/pkg/util/net/util.go | 6 + .../k8s.io/apimachinery/pkg/util/rand/rand.go | 127 + .../apimachinery/pkg/util/runtime/runtime.go | 15 +- .../k8s.io/apimachinery/pkg/util/sets/byte.go | 148 +- .../k8s.io/apimachinery/pkg/util/sets/doc.go | 9 +- .../apimachinery/pkg/util/sets/empty.go | 4 +- .../k8s.io/apimachinery/pkg/util/sets/int.go | 148 +- .../apimachinery/pkg/util/sets/int32.go | 148 +- .../apimachinery/pkg/util/sets/int64.go | 148 +- .../k8s.io/apimachinery/pkg/util/sets/set.go | 242 + .../apimachinery/pkg/util/sets/string.go | 148 +- .../pkg/util/strategicpatch/OWNERS | 1 + .../pkg/util/strategicpatch/meta.go | 89 + .../pkg/util/strategicpatch/patch.go | 65 +- .../apimachinery/pkg/util/validation/OWNERS | 11 + .../pkg/util/validation/field/errors.go | 4 +- .../pkg/util/validation/validation.go | 64 +- .../apimachinery/pkg/util/version/version.go | 47 + .../apimachinery/pkg/util/wait/backoff.go | 502 + .../apimachinery/pkg/util/wait/delay.go | 51 + .../apimachinery/pkg/util/wait/error.go | 96 + .../k8s.io/apimachinery/pkg/util/wait/loop.go | 95 + .../k8s.io/apimachinery/pkg/util/wait/poll.go | 315 + .../apimachinery/pkg/util/wait/timer.go | 121 + .../k8s.io/apimachinery/pkg/util/wait/wait.go | 634 +- .../v1/auditannotation.go | 48 + .../v1/expressionwarning.go | 48 + .../v1/matchcondition.go | 48 + .../v1/matchresources.go | 90 + .../v1/mutatingwebhook.go | 14 + .../namedrulewithoperations.go} | 38 +- .../admissionregistration/v1/paramkind.go | 48 + .../admissionregistration/v1/paramref.go | 71 + .../admissionregistration/v1/typechecking.go | 44 + .../v1/validatingadmissionpolicy.go | 256 + .../v1/validatingadmissionpolicybinding.go | 247 + .../validatingadmissionpolicybindingspec.go | 72 + .../v1/validatingadmissionpolicyspec.go | 117 + .../v1/validatingadmissionpolicystatus.go | 66 + .../v1/validatingwebhook.go | 14 + .../admissionregistration/v1/validation.go | 70 + .../admissionregistration/v1/variable.go | 48 + .../v1alpha1/auditannotation.go | 48 + .../v1alpha1/expressionwarning.go | 48 + .../v1alpha1/matchcondition.go | 48 + .../v1alpha1/matchresources.go | 90 + .../v1alpha1/namedrulewithoperations.go | 95 + .../v1alpha1/paramkind.go | 48 + .../v1alpha1/paramref.go | 71 + .../v1alpha1/typechecking.go | 44 + .../v1alpha1/validatingadmissionpolicy.go | 256 + .../validatingadmissionpolicybinding.go | 247 + .../validatingadmissionpolicybindingspec.go | 72 + .../v1alpha1/validatingadmissionpolicyspec.go | 117 + .../validatingadmissionpolicystatus.go | 66 + .../v1alpha1/validation.go | 70 + .../v1alpha1/variable.go | 48 + .../v1beta1/auditannotation.go | 48 + .../v1beta1/expressionwarning.go | 48 + .../v1beta1/matchcondition.go | 48 + .../v1beta1/matchresources.go | 90 + .../v1beta1/mutatingwebhook.go | 29 +- .../v1beta1/namedrulewithoperations.go | 95 + .../v1beta1/paramkind.go | 48 + .../admissionregistration/v1beta1/paramref.go | 71 + .../admissionregistration/v1beta1/rule.go | 76 - .../v1beta1/typechecking.go | 44 + .../v1beta1/validatingadmissionpolicy.go | 256 + .../validatingadmissionpolicybinding.go | 247 + .../validatingadmissionpolicybindingspec.go | 72 + .../v1beta1/validatingadmissionpolicyspec.go | 117 + .../validatingadmissionpolicystatus.go | 66 + .../v1beta1/validatingwebhook.go | 29 +- .../v1beta1/validation.go | 70 + .../admissionregistration/v1beta1/variable.go | 48 + .../v1alpha1/serverstorageversion.go | 11 + .../apps/v1/statefulsetordinals.go | 39 + .../apps/v1/statefulsetspec.go | 9 + .../v1beta1/statefulsetordinals.go} | 20 +- .../apps/v1beta1/statefulsetspec.go | 9 + .../apps/v1beta2/statefulsetordinals.go | 39 + .../apps/v1beta2/statefulsetspec.go | 9 + .../applyconfigurations/batch/v1/jobspec.go | 45 + .../applyconfigurations/batch/v1/jobstatus.go | 18 + .../batch/v1/successpolicy.go | 44 + .../batch/v1/successpolicyrule.go | 48 + .../v1alpha1/clustertrustbundle.go | 247 + .../v1alpha1/clustertrustbundlespec.go | 48 + .../core/v1/apparmorprofile.go | 52 + .../core/v1/claimsource.go | 48 + .../core/v1/clustertrustbundleprojection.go | 79 + .../applyconfigurations/core/v1/container.go | 67 +- .../core/v1/containerresizepolicy.go | 52 + .../core/v1/containerstatus.go | 54 +- .../core/v1/ephemeralcontainer.go | 21 + .../core/v1/ephemeralcontainercommon.go | 67 +- .../applyconfigurations/core/v1/hostip.go | 39 + .../core/v1/lifecyclehandler.go | 9 + .../core/v1/loadbalanceringress.go | 13 + .../core/v1/modifyvolumestatus.go | 52 + .../core/v1/noderuntimehandler.go | 48 + .../core/v1/noderuntimehandlerfeatures.go | 39 + .../applyconfigurations/core/v1/nodestatus.go | 14 + .../core/v1/persistentvolumeclaimspec.go | 29 +- .../core/v1/persistentvolumeclaimstatus.go | 44 +- .../core/v1/persistentvolumespec.go | 9 + .../core/v1/persistentvolumestatus.go | 16 +- .../core/v1/podaffinityterm.go | 22 + .../v1/podresourceclaim.go} | 30 +- .../core/v1/podresourceclaimstatus.go | 48 + .../core/v1/podschedulinggate.go | 39 + .../core/v1/podsecuritycontext.go | 9 + .../applyconfigurations/core/v1/podspec.go | 28 + .../applyconfigurations/core/v1/podstatus.go | 63 +- .../v1/resourceclaim.go} | 14 +- .../core/v1/resourcerequirements.go | 18 +- .../core/v1/securitycontext.go | 9 + .../core/v1/servicespec.go | 17 +- .../core/v1/sleepaction.go | 39 + .../core/v1/typedobjectreference.go | 66 + .../core/v1/volumemount.go | 21 +- .../core/v1/volumemountstatus.go | 70 + .../core/v1/volumeprojection.go | 9 + .../core/v1/volumeresourcerequirements.go | 52 + .../extensions/v1beta1/allowedhostpath.go | 48 - .../v1beta1/fsgroupstrategyoptions.go | 57 - .../extensions/v1beta1/hostportrange.go | 48 - .../extensions/v1beta1/idrange.go | 48 - .../v1beta1/ingressloadbalanceringress.go | 62 + .../v1beta1/ingressloadbalancerstatus.go | 44 + .../extensions/v1beta1/ingressportstatus.go | 61 + .../extensions/v1beta1/ingressstatus.go | 8 +- .../extensions/v1beta1/networkpolicy.go | 11 +- .../v1beta1/podsecuritypolicyspec.go | 285 - .../v1beta1/runasgroupstrategyoptions.go | 57 - .../v1beta1/runasuserstrategyoptions.go | 57 - .../v1beta1/runtimeclassstrategyoptions.go | 50 - .../v1beta1/selinuxstrategyoptions.go | 53 - .../supplementalgroupsstrategyoptions.go | 57 - .../v1/exemptprioritylevelconfiguration.go | 48 + .../flowdistinguishermethod.go | 8 +- .../{v1alpha1 => v1}/flowschema.go | 16 +- .../flowcontrol/v1/flowschemacondition.go | 80 + .../{v1alpha1 => v1}/flowschemaspec.go | 2 +- .../{v1alpha1 => v1}/flowschemastatus.go | 2 +- .../{v1alpha1 => v1}/groupsubject.go | 2 +- .../limitedprioritylevelconfiguration.go | 30 +- .../{v1alpha1 => v1}/limitresponse.go | 8 +- .../{v1alpha1 => v1}/nonresourcepolicyrule.go | 2 +- .../policyruleswithsubjects.go | 2 +- .../prioritylevelconfiguration.go | 16 +- .../v1/prioritylevelconfigurationcondition.go | 80 + .../prioritylevelconfigurationreference.go | 2 +- .../prioritylevelconfigurationspec.go | 17 +- .../prioritylevelconfigurationstatus.go | 2 +- .../{v1alpha1 => v1}/queuingconfiguration.go | 2 +- .../{v1alpha1 => v1}/resourcepolicyrule.go | 2 +- .../{v1alpha1 => v1}/serviceaccountsubject.go | 2 +- .../flowcontrol/{v1alpha1 => v1}/subject.go | 8 +- .../{v1alpha1 => v1}/usersubject.go | 2 +- .../exemptprioritylevelconfiguration.go | 48 + .../limitedprioritylevelconfiguration.go | 18 + .../v1beta1/prioritylevelconfigurationspec.go | 9 + .../exemptprioritylevelconfiguration.go | 48 + .../limitedprioritylevelconfiguration.go | 18 + .../v1beta2/prioritylevelconfigurationspec.go | 9 + .../exemptprioritylevelconfiguration.go | 48 + .../v1beta3/flowdistinguishermethod.go | 43 + .../v1beta3/flowschema.go} | 95 +- .../flowschemacondition.go | 18 +- .../flowcontrol/v1beta3/flowschemaspec.go | 71 + .../v1beta3/flowschemastatus.go} | 20 +- .../v1beta3/groupsubject.go} | 14 +- .../limitedprioritylevelconfiguration.go | 66 + .../flowcontrol/v1beta3/limitresponse.go | 52 + .../v1beta3/nonresourcepolicyrule.go | 52 + .../v1beta3/policyruleswithsubjects.go | 72 + .../v1beta3/prioritylevelconfiguration.go | 256 + .../prioritylevelconfigurationcondition.go | 18 +- .../prioritylevelconfigurationreference.go | 39 + .../v1beta3/prioritylevelconfigurationspec.go | 61 + .../prioritylevelconfigurationstatus.go | 44 + .../v1beta3/queuingconfiguration.go | 57 + .../flowcontrol/v1beta3/resourcepolicyrule.go | 83 + .../v1beta3/serviceaccountsubject.go | 48 + .../flowcontrol/v1beta3/subject.go | 70 + .../flowcontrol/v1beta3/usersubject.go | 39 + .../applyconfigurations/internal/internal.go | 3389 +- .../applyconfigurations/meta/v1/listmeta.go | 66 - .../meta/v1/unstructured.go | 2 +- .../v1/ingressloadbalanceringress.go | 62 + .../v1/ingressloadbalancerstatus.go | 44 + .../networking/v1/ingressportstatus.go | 61 + .../networking/v1/ingressstatus.go | 8 +- .../networking/v1/networkpolicy.go | 11 +- .../networking/v1alpha1/clustercidrspec.go | 70 - .../v1alpha1/{clustercidr.go => ipaddress.go} | 78 +- .../networking/v1alpha1/ipaddressspec.go | 39 + .../networking/v1alpha1/parentreference.go | 66 + .../v1alpha1/servicecidr.go} | 95 +- .../networking/v1alpha1/servicecidrspec.go | 41 + .../servicecidrstatus.go} | 14 +- .../v1beta1/ingressloadbalanceringress.go | 62 + .../v1beta1/ingressloadbalancerstatus.go | 44 + .../networking/v1beta1/ingressportstatus.go | 61 + .../networking/v1beta1/ingressstatus.go | 8 +- .../policy/v1/poddisruptionbudgetspec.go | 16 +- .../policy/v1beta1/allowedhostpath.go | 48 - .../policy/v1beta1/fsgroupstrategyoptions.go | 57 - .../policy/v1beta1/hostportrange.go | 48 - .../policy/v1beta1/idrange.go | 48 - .../policy/v1beta1/poddisruptionbudgetspec.go | 16 +- .../policy/v1beta1/podsecuritypolicyspec.go | 285 - .../v1beta1/runasgroupstrategyoptions.go | 57 - .../v1beta1/runasuserstrategyoptions.go | 57 - .../v1beta1/runtimeclassstrategyoptions.go | 50 - .../policy/v1beta1/selinuxstrategyoptions.go | 53 - .../supplementalgroupsstrategyoptions.go | 57 - .../resource/v1alpha2/allocationresult.go | 66 + .../v1alpha2/allocationresultmodel.go | 39 + .../v1alpha2/driverallocationresult.go | 52 + .../resource/v1alpha2/driverrequests.go | 66 + .../namedresourcesallocationresult.go | 39 + .../v1alpha2/namedresourcesattribute.go | 100 + .../v1alpha2/namedresourcesattributevalue.go | 97 + .../resource/v1alpha2/namedresourcesfilter.go | 39 + .../v1alpha2/namedresourcesinstance.go | 53 + .../v1alpha2/namedresourcesintslice.go | 41 + .../v1alpha2/namedresourcesrequest.go | 39 + .../v1alpha2/namedresourcesresources.go | 44 + .../v1alpha2/namedresourcesstringslice.go | 41 + .../resource/v1alpha2/podschedulingcontext.go | 258 + .../v1alpha2/podschedulingcontextspec.go | 50 + .../v1alpha2/podschedulingcontextstatus.go | 44 + .../resource/v1alpha2/resourceclaim.go | 258 + .../resourceclaimconsumerreference.go | 70 + .../v1alpha2/resourceclaimparameters.go | 272 + .../resourceclaimparametersreference.go | 57 + .../v1alpha2/resourceclaimschedulingstatus.go | 50 + .../resource/v1alpha2/resourceclaimspec.go | 61 + .../resource/v1alpha2/resourceclaimstatus.go | 71 + .../v1alpha2/resourceclaimtemplate.go | 249 + .../v1alpha2/resourceclaimtemplatespec.go | 188 + .../resource/v1alpha2/resourceclass.go | 275 + .../v1alpha2/resourceclassparameters.go | 277 + .../resourceclassparametersreference.go | 66 + .../resource/v1alpha2/resourcefilter.go | 48 + .../resource/v1alpha2/resourcefiltermodel.go | 39 + .../resource/v1alpha2/resourcehandle.go | 57 + .../resource/v1alpha2/resourcemodel.go | 39 + .../resource/v1alpha2/resourcerequest.go | 52 + .../resource/v1alpha2/resourcerequestmodel.go | 39 + .../resource/v1alpha2/resourceslice.go | 265 + .../v1alpha2/structuredresourcehandle.go | 75 + .../resource/v1alpha2/vendorparameters.go | 52 + .../storage/v1alpha1/volumeattributesclass.go | 262 + .../v1alpha1/groupversionresource.go | 57 + .../v1alpha1/migrationcondition.go | 81 + .../v1alpha1/storageversionmigration.go | 256 + .../v1alpha1/storageversionmigrationspec.go | 48 + .../v1alpha1/storageversionmigrationstatus.go | 53 + .../discovery/aggregated_discovery.go | 278 + .../client-go/discovery/discovery_client.go | 343 +- vendor/k8s.io/client-go/dynamic/simple.go | 71 +- vendor/k8s.io/client-go/features/envvar.go | 138 + vendor/k8s.io/client-go/features/features.go | 143 + .../client-go/features/known_features.go | 54 + .../admissionregistration/interface.go | 8 + .../admissionregistration/v1/interface.go | 14 + .../v1/validatingadmissionpolicy.go | 89 + .../v1/validatingadmissionpolicybinding.go | 89 + .../v1alpha1/interface.go | 52 + .../v1alpha1/validatingadmissionpolicy.go | 89 + .../validatingadmissionpolicybinding.go | 89 + .../v1beta1/interface.go | 14 + .../v1beta1/validatingadmissionpolicy.go | 89 + .../validatingadmissionpolicybinding.go | 89 + .../informers/certificates/interface.go | 8 + .../v1alpha1/clustertrustbundle.go | 89 + .../certificates/v1alpha1/interface.go | 45 + vendor/k8s.io/client-go/informers/doc.go | 18 + .../informers/extensions/v1beta1/interface.go | 7 - vendor/k8s.io/client-go/informers/factory.go | 103 +- .../informers/flowcontrol/interface.go | 20 +- .../informers/flowcontrol/v1/flowschema.go | 89 + .../flowcontrol/{v1alpha1 => v1}/interface.go | 2 +- .../v1/prioritylevelconfiguration.go | 89 + .../{v1alpha1 => v1beta3}/flowschema.go | 20 +- .../flowcontrol/v1beta3/interface.go | 52 + .../prioritylevelconfiguration.go | 20 +- vendor/k8s.io/client-go/informers/generic.go | 73 +- .../networking/v1alpha1/interface.go | 17 +- .../v1alpha1/ipaddress.go} | 44 +- .../{clustercidr.go => servicecidr.go} | 38 +- .../informers/policy/v1beta1/interface.go | 7 - .../client-go/informers/resource/interface.go | 46 + .../informers/resource/v1alpha2/interface.go | 87 + .../resource/v1alpha2/podschedulingcontext.go | 90 + .../resource/v1alpha2/resourceclaim.go | 90 + .../v1alpha2/resourceclaimparameters.go | 90 + .../v1alpha2/resourceclaimtemplate.go | 90 + .../v1alpha2/resourceclass.go} | 44 +- .../v1alpha2/resourceclassparameters.go | 90 + .../resource/v1alpha2/resourceslice.go | 89 + .../informers/storage/v1alpha1/interface.go | 7 + .../storage/v1alpha1/volumeattributesclass.go | 89 + .../informers/storagemigration/interface.go | 46 + .../storagemigration/v1alpha1/interface.go | 45 + .../v1alpha1/storageversionmigration.go | 89 + .../k8s.io/client-go/kubernetes/clientset.go | 187 +- vendor/k8s.io/client-go/kubernetes/doc.go | 9 +- .../client-go/kubernetes/scheme/register.go | 16 +- .../v1/admissionregistration_client.go | 10 + .../v1/generated_expansion.go | 4 + .../v1/validatingadmissionpolicy.go | 243 + .../v1/validatingadmissionpolicybinding.go | 197 + .../v1alpha1/admissionregistration_client.go | 112 + .../v1alpha1/doc.go | 0 .../v1alpha1/generated_expansion.go} | 11 +- .../v1alpha1/validatingadmissionpolicy.go | 243 + .../validatingadmissionpolicybinding.go | 197 + .../v1beta1/admissionregistration_client.go | 10 + .../v1beta1/generated_expansion.go | 4 + .../v1beta1/validatingadmissionpolicy.go | 243 + .../validatingadmissionpolicybinding.go | 197 + .../v1/authentication_client.go | 5 + .../authentication/v1/generated_expansion.go | 2 + .../authentication/v1/selfsubjectreview.go | 64 + .../v1alpha1/authentication_client.go | 107 + .../typed/authentication/v1alpha1/doc.go | 20 + .../v1alpha1/generated_expansion.go | 21 + .../v1alpha1/selfsubjectreview.go | 64 + .../v1beta1/authentication_client.go | 5 + .../v1beta1/generated_expansion.go | 2 + .../v1beta1/selfsubjectreview.go | 64 + .../v1alpha1/certificates_client.go | 107 + .../v1alpha1/clustertrustbundle.go | 197 + .../typed/certificates/v1alpha1/doc.go | 20 + .../v1alpha1/generated_expansion.go | 21 + .../typed/events/v1beta1/event_expansion.go | 3 +- .../extensions/v1beta1/extensions_client.go | 5 - .../extensions/v1beta1/generated_expansion.go | 2 - .../typed/extensions/v1beta1/networkpolicy.go | 48 - .../extensions/v1beta1/podsecuritypolicy.go | 197 - .../kubernetes/typed/flowcontrol/v1}/doc.go | 4 +- .../{v1alpha1 => v1}/flowcontrol_client.go | 38 +- .../typed/flowcontrol/v1/flowschema.go | 243 + .../{v1alpha1 => v1}/generated_expansion.go | 2 +- .../v1/prioritylevelconfiguration.go | 243 + .../typed/flowcontrol/v1beta3}/doc.go | 7 +- .../flowcontrol/v1beta3/flowcontrol_client.go | 112 + .../{v1alpha1 => v1beta3}/flowschema.go | 56 +- .../v1beta3/generated_expansion.go | 23 + .../prioritylevelconfiguration.go | 56 +- .../typed/networking/v1/networkpolicy.go | 48 - .../typed/networking/v1alpha1/clustercidr.go | 197 - .../v1alpha1/generated_expansion.go | 4 +- .../typed/networking/v1alpha1/ipaddress.go | 197 + .../networking/v1alpha1/networking_client.go | 11 +- .../typed/networking/v1alpha1/servicecidr.go | 243 + .../policy/v1beta1/generated_expansion.go | 2 - .../typed/policy/v1beta1/podsecuritypolicy.go | 197 - .../typed/policy/v1beta1/policy_client.go | 5 - .../kubernetes/typed/resource/v1alpha2/doc.go | 20 + .../resource/v1alpha2/generated_expansion.go | 33 + .../resource/v1alpha2/podschedulingcontext.go | 256 + .../resource/v1alpha2/resource_client.go | 137 + .../typed/resource/v1alpha2/resourceclaim.go | 256 + .../v1alpha2/resourceclaimparameters.go | 208 + .../v1alpha2/resourceclaimtemplate.go | 208 + .../typed/resource/v1alpha2/resourceclass.go | 197 + .../v1alpha2/resourceclassparameters.go | 208 + .../typed/resource/v1alpha2/resourceslice.go | 197 + .../storage/v1alpha1/generated_expansion.go | 2 + .../typed/storage/v1alpha1/storage_client.go | 5 + .../storage/v1alpha1/volumeattributesclass.go | 197 + .../typed/storagemigration/v1alpha1/doc.go | 20 + .../v1alpha1/generated_expansion.go | 21 + .../v1alpha1/storagemigration_client.go | 107 + .../v1alpha1/storageversionmigration.go | 243 + .../v1/expansion_generated.go | 8 + .../v1/validatingadmissionpolicy.go | 68 + .../v1/validatingadmissionpolicybinding.go | 68 + .../v1alpha1/expansion_generated.go | 27 + .../v1alpha1/validatingadmissionpolicy.go | 68 + .../validatingadmissionpolicybinding.go | 68 + .../v1beta1/expansion_generated.go | 8 + .../v1beta1/validatingadmissionpolicy.go | 68 + .../validatingadmissionpolicybinding.go | 68 + .../v1alpha1/clustertrustbundle.go | 68 + .../v1alpha1/expansion_generated.go | 23 + .../extensions/v1beta1/expansion_generated.go | 4 - .../extensions/v1beta1/podsecuritypolicy.go | 68 - .../{v1alpha1 => v1}/expansion_generated.go | 2 +- .../{v1alpha1 => v1}/flowschema.go | 18 +- .../prioritylevelconfiguration.go | 18 +- .../v1beta3/expansion_generated.go | 27 + .../listers/flowcontrol/v1beta3/flowschema.go | 68 + .../v1beta3/prioritylevelconfiguration.go | 68 + .../v1alpha1/expansion_generated.go | 10 +- .../listers/networking/v1alpha1/ipaddress.go | 68 + .../{clustercidr.go => servicecidr.go} | 38 +- .../policy/v1beta1/expansion_generated.go | 4 - .../policy/v1beta1/podsecuritypolicy.go | 68 - .../resource/v1alpha2/expansion_generated.go | 67 + .../resource/v1alpha2/podschedulingcontext.go | 99 + .../resource/v1alpha2/resourceclaim.go | 99 + .../v1alpha2/resourceclaimparameters.go | 99 + .../v1alpha2/resourceclaimtemplate.go | 99 + .../resource/v1alpha2/resourceclass.go | 68 + .../v1alpha2/resourceclassparameters.go | 99 + .../resource/v1alpha2/resourceslice.go | 68 + .../storage/v1alpha1/expansion_generated.go | 4 + .../storage/v1alpha1/volumeattributesclass.go | 68 + .../v1alpha1/expansion_generated.go | 23 + .../v1alpha1/storageversionmigration.go | 68 + vendor/k8s.io/client-go/metadata/metadata.go | 4 +- vendor/k8s.io/client-go/openapi/OWNERS | 4 + vendor/k8s.io/client-go/openapi/client.go | 7 +- .../k8s.io/client-go/openapi/groupversion.go | 47 +- .../k8s.io/client-go/openapi/typeconverter.go | 48 + .../pkg/apis/clientauthentication/types.go | 5 + .../pkg/apis/clientauthentication/v1/types.go | 5 + .../v1/zz_generated.conversion.go | 2 + .../clientauthentication/v1beta1/types.go | 5 + .../v1beta1/zz_generated.conversion.go | 2 + vendor/k8s.io/client-go/pkg/version/base.go | 3 +- .../plugin/pkg/client/auth/exec/exec.go | 19 +- vendor/k8s.io/client-go/rest/client.go | 3 +- vendor/k8s.io/client-go/rest/config.go | 20 +- vendor/k8s.io/client-go/rest/exec.go | 4 +- vendor/k8s.io/client-go/rest/request.go | 124 +- vendor/k8s.io/client-go/rest/transport.go | 5 +- vendor/k8s.io/client-go/rest/url_utils.go | 4 +- vendor/k8s.io/client-go/rest/with_retry.go | 38 +- .../k8s.io/client-go/restmapper/shortcut.go | 36 +- vendor/k8s.io/client-go/testing/actions.go | 698 + vendor/k8s.io/client-go/testing/fake.go | 220 + vendor/k8s.io/client-go/testing/fixture.go | 581 + vendor/k8s.io/client-go/testing/interface.go | 66 + .../k8s.io/client-go/tools/auth/clientauth.go | 5 +- vendor/k8s.io/client-go/tools/cache/OWNERS | 4 +- .../client-go/tools/cache/controller.go | 98 +- .../client-go/tools/cache/delta_fifo.go | 142 +- .../client-go/tools/cache/expiration_cache.go | 2 - vendor/k8s.io/client-go/tools/cache/fifo.go | 14 +- vendor/k8s.io/client-go/tools/cache/index.go | 3 +- .../k8s.io/client-go/tools/cache/listers.go | 20 +- .../client-go/tools/cache/object-names.go | 65 + .../k8s.io/client-go/tools/cache/reflector.go | 509 +- .../reflector_data_consistency_detector.go | 119 + .../client-go/tools/cache/shared_informer.go | 337 +- vendor/k8s.io/client-go/tools/cache/store.go | 31 +- .../client-go/tools/cache/synctrack/lazy.go | 83 + .../tools/cache/synctrack/synctrack.go | 120 + .../tools/cache/thread_safe_store.go | 327 +- .../client-go/tools/clientcmd/api/doc.go | 2 +- .../client-go/tools/clientcmd/api/helpers.go | 91 +- .../client-go/tools/clientcmd/api/types.go | 19 +- .../client-go/tools/clientcmd/api/v1/doc.go | 2 +- .../client-go/tools/clientcmd/api/v1/types.go | 5 + .../api/v1/zz_generated.conversion.go | 2 + .../client-go/tools/clientcmd/auth_loaders.go | 3 +- .../tools/clientcmd/client_config.go | 56 +- .../client-go/tools/clientcmd/loader.go | 33 +- .../tools/clientcmd/merged_client_builder.go | 4 +- .../client-go/tools/clientcmd/overrides.go | 42 +- .../tools/internal/events/interfaces.go | 59 + .../tools/leaderelection/leaderelection.go | 48 +- .../client-go/tools/leaderelection/metrics.go | 30 +- .../resourcelock/configmaplock.go | 126 - .../resourcelock/endpointslock.go | 121 - .../leaderelection/resourcelock/interface.go | 42 +- .../leaderelection/resourcelock/leaselock.go | 12 +- .../k8s.io/client-go/tools/metrics/metrics.go | 65 + vendor/k8s.io/client-go/tools/pager/pager.go | 41 +- vendor/k8s.io/client-go/tools/record/event.go | 227 +- vendor/k8s.io/client-go/tools/record/fake.go | 30 +- .../k8s.io/client-go/tools/reference/ref.go | 2 +- vendor/k8s.io/client-go/transport/cache.go | 22 +- .../k8s.io/client-go/transport/cache_go118.go | 24 + vendor/k8s.io/client-go/transport/config.go | 14 +- .../client-go/transport/token_source.go | 4 +- .../k8s.io/client-go/transport/transport.go | 83 +- vendor/k8s.io/client-go/util/cert/cert.go | 44 +- vendor/k8s.io/client-go/util/cert/io.go | 7 +- .../client-go/util/flowcontrol/backoff.go | 3 +- vendor/k8s.io/client-go/util/keyutil/key.go | 9 +- .../util/workqueue/delaying_queue.go | 61 +- .../client-go/util/workqueue/metrics.go | 9 +- .../k8s.io/client-go/util/workqueue/queue.go | 108 +- .../util/workqueue/rate_limiting_queue.go | 61 +- .../k8s.io/cloud-provider/api/retry_error.go | 46 + .../cli/flag/ciphersuites_flag.go | 147 + .../colon_separated_multimap_string_string.go | 102 + .../cli/flag/configuration_map.go | 53 + .../k8s.io/component-base/cli/flag/flags.go | 66 + .../langle_separated_map_string_string.go | 82 + .../cli/flag/map_string_bool.go | 90 + .../cli/flag/map_string_string.go | 112 + .../cli/flag/namedcertkey_flag.go | 113 + .../component-base/cli/flag/noop.go} | 31 +- .../component-base/cli/flag/omitempty.go} | 25 +- .../component-base/cli/flag/sectioned.go | 105 + .../component-base/cli/flag/string_flag.go | 56 + .../cli/flag/string_slice_flag.go | 62 + .../component-base/cli/flag/tristate.go | 83 + vendor/k8s.io/component-base/config/types.go | 80 - .../config/v1alpha1/conversion.go | 53 - .../config/v1alpha1/defaults.go | 98 - .../config/v1alpha1/register.go | 31 - .../component-base/config/v1alpha1/types.go | 82 - .../v1alpha1/zz_generated.conversion.go | 133 - .../config/v1alpha1/zz_generated.deepcopy.go | 88 - .../csi-translation-lib/plugins/azure_file.go | 4 +- .../k8s.io/csi-translation-lib/plugins/rbd.go | 2 +- .../k8s.io/csi-translation-lib/translate.go | 10 +- vendor/k8s.io/klog/v2/.golangci.yaml | 6 + vendor/k8s.io/klog/v2/OWNERS | 4 +- vendor/k8s.io/klog/v2/contextual_slog.go | 31 + .../k8s.io/klog/v2/internal/buffer/buffer.go | 12 +- vendor/k8s.io/klog/v2/internal/clock/clock.go | 21 +- .../klog/v2/internal/serialize/keyvalues.go | 71 +- .../internal/serialize/keyvalues_no_slog.go | 97 + .../v2/internal/serialize/keyvalues_slog.go | 155 + .../internal/sloghandler/sloghandler_slog.go | 96 + .../k8s.io/klog/v2/k8s_references_slog.go | 34 +- vendor/k8s.io/klog/v2/klog.go | 161 +- vendor/k8s.io/klog/v2/klog_file.go | 4 +- vendor/k8s.io/klog/v2/klogr.go | 46 +- vendor/k8s.io/klog/v2/klogr_slog.go | 96 + vendor/k8s.io/klog/v2/safeptr.go | 34 + .../kube-openapi/pkg/builder3/util/util.go | 51 - .../k8s.io/kube-openapi/pkg/cached/cache.go | 330 +- .../k8s.io/kube-openapi/pkg/common/common.go | 41 +- .../kube-openapi/pkg/handler3/handler.go | 79 +- .../k8s.io/kube-openapi/pkg/internal/flags.go | 1 + .../kube-openapi/pkg/openapiconv/convert.go | 322 - .../k8s.io/kube-openapi/pkg/schemaconv/smd.go | 3 - .../kube-openapi/pkg/schemamutation/walker.go | 519 - .../k8s.io/kube-openapi/pkg/spec3/encoding.go | 21 + .../k8s.io/kube-openapi/pkg/spec3/example.go | 14 + .../pkg/spec3/external_documentation.go | 13 + vendor/k8s.io/kube-openapi/pkg/spec3/fuzz.go | 27 + .../k8s.io/kube-openapi/pkg/spec3/header.go | 31 + .../kube-openapi/pkg/spec3/media_type.go | 20 + .../kube-openapi/pkg/spec3/operation.go | 27 + .../kube-openapi/pkg/spec3/parameter.go | 31 + vendor/k8s.io/kube-openapi/pkg/spec3/path.go | 47 +- .../kube-openapi/pkg/spec3/request_body.go | 21 + .../k8s.io/kube-openapi/pkg/spec3/response.go | 52 + .../kube-openapi/pkg/spec3/security_scheme.go | 17 + .../k8s.io/kube-openapi/pkg/spec3/server.go | 26 + vendor/k8s.io/kube-openapi/pkg/spec3/spec.go | 25 + .../kube-openapi/pkg/util/proto/document.go | 2 +- .../pkg/util/proto/document_v3.go | 2 +- .../kube-openapi/pkg/validation/spec/fuzz.go | 502 - .../pkg/validation/spec/gnostic.go | 2 +- vendor/k8s.io/utils/integer/integer.go | 73 - vendor/k8s.io/utils/pointer/pointer.go | 283 +- vendor/k8s.io/utils/ptr/OWNERS | 10 + vendor/k8s.io/utils/ptr/README.md | 3 + vendor/k8s.io/utils/ptr/ptr.go | 73 + vendor/k8s.io/utils/trace/trace.go | 19 + .../pkg/apis/duck/v1/addressable_types.go | 4 + .../pkg/apis/duck/v1/auth_types.go | 25 + .../pkg/apis/duck/v1/destination.go | 31 + .../pkg/apis/duck/v1/kresource_type.go | 7 + .../pkg/apis/duck/v1/source_types.go | 9 + .../pkg/apis/duck/v1/zz_generated.deepcopy.go | 41 + .../injection/apiextensions/client/client.go | 57 + .../customresourcedefinition.go | 52 + .../informers/factory/factory.go | 56 + .../client/injection/kube/client/client.go | 18293 --------- .../injection/kube/client/client_expansion.go | 160 - .../pkg/environment/client_config.go | 24 +- vendor/knative.dev/pkg/injection/clients.go | 19 - .../clients/dynamicclient/dynamicclient.go | 49 - .../informers/core/v1/secret/secret.go | 50 + vendor/knative.dev/pkg/injection/informers.go | 35 - vendor/knative.dev/pkg/injection/interface.go | 29 - vendor/knative.dev/pkg/metrics/metrics.go | 6 +- vendor/knative.dev/pkg/profiling/server.go | 7 +- vendor/knative.dev/pkg/version/version.go | 4 +- .../pkg/webhook/certificates/certificates.go | 108 + .../pkg/webhook/certificates/controller.go | 81 + vendor/knative.dev/pkg/webhook/helper.go | 14 + .../conversion/controller.go | 163 + .../conversion/conversion.go | 207 + .../resourcesemantics/conversion/options.go | 49 + .../conversion/reconciler.go | 119 + vendor/knative.dev/pkg/webhook/webhook.go | 66 +- vendor/modules.txt | 480 +- .../sigs.k8s.io/controller-runtime/.gitignore | 3 + .../controller-runtime/.golangci.yml | 243 +- vendor/sigs.k8s.io/controller-runtime/FAQ.md | 4 +- .../sigs.k8s.io/controller-runtime/Makefile | 52 +- vendor/sigs.k8s.io/controller-runtime/OWNERS | 3 +- .../controller-runtime/OWNERS_ALIASES | 28 +- .../sigs.k8s.io/controller-runtime/README.md | 8 +- .../sigs.k8s.io/controller-runtime/RELEASE.md | 16 +- .../controller-runtime/SECURITY_CONTACTS | 5 +- .../controller-runtime/TMP-LOGGING.md | 4 +- .../controller-runtime/VERSIONING.md | 8 +- .../sigs.k8s.io/controller-runtime/alias.go | 15 +- vendor/sigs.k8s.io/controller-runtime/doc.go | 4 +- .../pkg/builder/controller.go | 204 +- .../controller-runtime/pkg/builder/options.go | 26 +- .../controller-runtime/pkg/builder/webhook.go | 90 +- .../controller-runtime/pkg/cache/cache.go | 546 +- .../pkg/cache/delegating_by_gvk_cache.go | 135 + .../pkg/cache/informer_cache.go | 157 +- .../pkg/cache/internal/cache_reader.go | 93 +- .../pkg/cache/internal/deleg_map.go | 126 - .../pkg/cache/internal/disabledeepcopy.go | 35 - .../pkg/cache/internal/informers.go | 596 + .../pkg/cache/internal/informers_map.go | 480 - .../pkg/cache/internal/selector.go | 15 - .../pkg/cache/internal/transformers.go | 50 - .../pkg/cache/multi_namespace_cache.go | 269 +- .../pkg/certwatcher/certwatcher.go | 54 +- .../pkg/client/apiutil/apimachinery.go | 105 +- .../pkg/client/apiutil/dynamicrestmapper.go | 290 - .../pkg/client/apiutil/errors.go | 54 + .../pkg/client/apiutil/restmapper.go | 335 + .../controller-runtime/pkg/client/client.go | 396 +- ...ient_cache.go => client_rest_resources.go} | 27 +- .../pkg/client/config/config.go | 40 +- .../controller-runtime/pkg/client/doc.go | 3 +- .../controller-runtime/pkg/client/dryrun.go | 46 +- .../pkg/client/fake/client.go | 1280 + .../controller-runtime/pkg/client/fake/doc.go | 38 + .../pkg/client/fieldowner.go | 106 + .../pkg/client/interceptor/intercept.go | 166 + .../pkg/client/interfaces.go | 80 +- .../pkg/client/metadata_client.go | 16 +- .../pkg/client/namespaced_client.go | 91 +- .../controller-runtime/pkg/client/options.go | 112 +- .../controller-runtime/pkg/client/split.go | 141 - .../pkg/client/typed_client.go | 125 +- .../pkg/client/unstructured_client.go | 180 +- .../controller-runtime/pkg/client/watch.go | 30 +- .../controller-runtime/pkg/cluster/cluster.go | 180 +- .../pkg/cluster/internal.go | 41 +- .../controller-runtime/pkg/config/config.go | 112 - .../pkg/config/controller.go | 49 + .../controller-runtime/pkg/config/doc.go | 25 - .../pkg/config/v1alpha1/register.go | 37 - .../pkg/config/v1alpha1/types.go | 157 - .../config/v1alpha1/zz_generated.deepcopy.go | 153 - .../pkg/controller/controller.go | 83 +- .../pkg/controller/controllertest/doc.go | 20 + .../pkg/controller/controllertest/testing.go | 68 + .../unconventionallisttypecrd.go | 76 + .../pkg/controller/controllertest/util.go | 171 + .../controllerutil/controllerutil.go | 138 +- .../controller-runtime/pkg/envtest/crd.go | 39 +- .../controller-runtime/pkg/envtest/server.go | 71 +- .../controller-runtime/pkg/envtest/webhook.go | 36 +- .../controller-runtime/pkg/event/event.go | 51 +- .../controller-runtime/pkg/handler/enqueue.go | 45 +- .../pkg/handler/enqueue_mapped.go | 67 +- .../pkg/handler/enqueue_owner.go | 108 +- .../pkg/handler/eventhandler.go | 72 +- .../controller-runtime/pkg/healthz/healthz.go | 12 +- .../pkg/internal/controller/controller.go | 111 +- .../internal/controller/metrics/metrics.go | 8 + .../pkg/internal/field/selector/utils.go | 37 + .../pkg/internal/objectutil/objectutil.go | 36 - .../pkg/internal/recorder/recorder.go | 9 +- .../source/event_handler.go} | 74 +- .../pkg/internal/source/kind.go | 137 + .../pkg/internal/syncs/syncs.go | 38 + .../internal/testing/controlplane/kubectl.go | 1 + .../testing/process/procattr_other.go | 28 + .../internal/testing/process/procattr_unix.go | 33 + .../pkg/internal/testing/process/process.go | 4 + .../controller-runtime/pkg/log/deleg.go | 43 +- .../controller-runtime/pkg/log/log.go | 55 +- .../pkg/manager/internal.go | 230 +- .../controller-runtime/pkg/manager/manager.go | 384 +- .../pkg/manager/runnable_group.go | 24 +- .../controller-runtime/pkg/manager/server.go | 109 + .../pkg/metrics/client_go_adapter.go | 54 +- .../pkg/metrics/leaderelection.go | 47 + .../pkg/metrics/listener.go | 52 - .../pkg/metrics/server/doc.go} | 17 +- .../pkg/metrics/server/server.go | 340 + .../pkg/metrics/workqueue.go | 8 +- .../pkg/predicate/predicate.go | 206 +- .../pkg/reconcile/reconcile.go | 72 +- .../pkg/runtime/inject/inject.go | 164 - .../controller-runtime/pkg/source/source.go | 270 +- .../pkg/webhook/admission/decode.go | 38 +- .../pkg/webhook/admission/defaulter.go | 19 +- .../pkg/webhook/admission/defaulter_custom.go | 28 +- .../pkg/webhook/admission/doc.go | 6 - .../pkg/webhook/admission/http.go | 72 +- .../pkg/webhook/admission/inject.go | 31 - .../pkg/webhook/admission/multi.go | 52 - .../pkg/webhook/admission/response.go | 23 +- .../pkg/webhook/admission/validator.go | 109 +- .../pkg/webhook/admission/validator_custom.go | 54 +- .../pkg/webhook/admission/webhook.go | 119 +- .../controller-runtime/pkg/webhook/alias.go | 2 + .../pkg/webhook/conversion/conversion.go | 40 +- .../pkg/webhook/conversion/decoder.go | 7 +- .../controller-runtime/pkg/webhook/server.go | 253 +- vendor/sigs.k8s.io/karpenter/LICENSE | 201 + vendor/sigs.k8s.io/karpenter/NOTICE | 18 + vendor/sigs.k8s.io/karpenter/pkg/apis/apis.go | 41 + .../apis/crds/karpenter.sh_nodeclaims.yaml | 814 + .../pkg/apis/crds/karpenter.sh_nodepools.yaml | 1063 + .../sigs.k8s.io/karpenter/pkg/apis/v1/doc.go | 42 + .../karpenter/pkg/apis/v1/duration.go | 87 + .../karpenter/pkg/apis/v1/labels.go | 146 + .../karpenter/pkg/apis/v1/nodeclaim.go | 144 + .../pkg/apis/v1/nodeclaim_conversion.go | 190 + .../pkg/apis/v1/nodeclaim_defaults.go | 22 + .../karpenter/pkg/apis/v1/nodeclaim_status.go | 76 + .../pkg/apis/v1/nodeclaim_validation.go | 154 + .../karpenter/pkg/apis/v1/nodepool.go | 403 + .../pkg/apis/v1/nodepool_conversion.go | 201 + .../pkg/apis/v1/nodepool_defaults.go} | 8 +- .../karpenter/pkg/apis/v1/nodepool_status.go | 55 + .../pkg/apis/v1/nodepool_validation.go | 61 + .../karpenter/pkg/apis/v1/taints.go | 48 + .../pkg/apis/v1/zz_generated.deepcopy.go | 540 + .../karpenter/pkg/apis/v1beta1/doc.go | 42 + .../karpenter/pkg/apis/v1beta1/duration.go | 87 + .../karpenter/pkg/apis/v1beta1}/labels.go | 61 +- .../karpenter/pkg/apis/v1beta1/nodeclaim.go} | 105 +- .../pkg/apis/v1beta1/nodeclaim_conversion.go | 29 + .../pkg/apis/v1beta1/nodeclaim_defaults.go | 22 + .../pkg/apis/v1beta1/nodeclaim_status.go | 70 + .../pkg/apis/v1beta1/nodeclaim_validation.go | 136 + .../karpenter/pkg/apis/v1beta1/nodepool.go | 284 + .../pkg/apis/v1beta1/nodepool_conversion.go | 29 + .../pkg/apis/v1beta1/nodepool_defaults.go | 24 + .../pkg/apis/v1beta1/nodepool_status.go | 55 + .../pkg/apis/v1beta1/nodepool_validation.go | 61 + .../karpenter/pkg/apis/v1beta1/taints.go | 48 + .../apis/v1beta1}/zz_generated.deepcopy.go | 349 +- .../cloudprovider/metrics/cloudprovider.go | 87 +- .../karpenter/pkg/cloudprovider/types.go | 419 + .../karpenter/pkg/controllers/controllers.go | 99 + .../controllers/disruption/consolidation.go | 298 + .../pkg/controllers/disruption/controller.go | 292 + .../pkg/controllers/disruption/drift.go | 125 + .../pkg/controllers/disruption/emptiness.go | 136 + .../controllers/disruption/events/events.go | 138 + .../pkg/controllers/disruption/helpers.go | 269 + .../pkg/controllers/disruption/metrics.go | 89 + .../disruption/multinodeconsolidation.go | 226 + .../disruption/orchestration/metrics.go | 46 + .../disruption/orchestration/queue.go | 361 + .../disruption/singlenodeconsolidation.go | 111 + .../pkg/controllers/disruption/types.go | 183 + .../pkg/controllers/disruption/validation.go | 215 + .../leasegarbagecollection/controller.go | 70 + .../leasegarbagecollection}/metrics.go | 30 +- .../controllers/metrics/node/controller.go | 204 + .../metrics/nodepool/controller.go | 141 + .../pkg/controllers/metrics/pod/controller.go | 190 + .../controllers/migration/crd/controller.go | 120 + .../migration/resource/controller.go | 86 + .../node/termination/controller.go | 291 + .../controllers/node}/termination/metrics.go | 22 +- .../termination/terminator/events/events.go | 77 + .../node/termination/terminator/eviction.go | 213 + .../node/termination/terminator/terminator.go | 203 + .../nodeclaim/consistency/controller.go | 152 + .../nodeclaim}/consistency/events.go | 16 +- .../nodeclaim}/consistency/nodeshape.go | 37 +- .../nodeclaim}/consistency/termination.go | 27 +- .../nodeclaim/disruption/consolidation.go | 78 + .../nodeclaim/disruption/controller.go | 131 + .../controllers/nodeclaim/disruption/drift.go | 120 + .../nodeclaim/expiration/controller.go | 80 + .../nodeclaim/garbagecollection/controller.go | 139 + .../nodeclaim}/lifecycle/controller.go | 101 +- .../controllers/nodeclaim/lifecycle/events.go | 70 + .../nodeclaim/lifecycle/initialization.go | 141 + .../controllers/nodeclaim/lifecycle/launch.go | 144 + .../nodeclaim}/lifecycle/liveness.go | 34 +- .../nodeclaim/lifecycle/registration.go | 122 + .../nodeclaim/podevents/controller.go | 113 + .../nodeclaim/termination/controller.go | 222 + .../nodeclaim/termination/metrics.go | 49 + .../nodepool/counter/controller.go | 136 + .../controllers/nodepool/hash/controller.go | 117 + .../nodepool/readiness/controller.go | 127 + .../nodepool/validation/controller.go | 75 + .../pkg/controllers/provisioning/batcher.go | 10 +- .../controllers/provisioning/controller.go | 115 + .../controllers/provisioning/provisioner.go | 521 + .../provisioning/scheduling}/events.go | 22 +- .../provisioning/scheduling/existingnode.go | 41 +- .../provisioning/scheduling/metrics.go | 61 + .../provisioning/scheduling/nodeclaim.go} | 137 +- .../scheduling/nodeclaimtemplate.go | 94 + .../provisioning/scheduling/preferences.go | 26 +- .../provisioning/scheduling/queue.go | 4 +- .../provisioning/scheduling/scheduler.go | 396 + .../provisioning/scheduling/topology.go | 103 +- .../provisioning/scheduling/topologygroup.go | 50 +- .../scheduling/topologynodefilter.go | 11 +- .../provisioning/scheduling/volumetopology.go | 113 +- .../pkg/controllers/state/cluster.go | 395 +- .../controllers/state/informer/daemonset.go | 38 +- .../pkg/controllers/state/informer/node.go | 27 +- .../controllers/state/informer/nodeclaim.go} | 46 +- .../controllers/state/informer/nodepool.go} | 43 +- .../pkg/controllers/state/informer/pod.go | 26 +- .../pkg/controllers/state/metrics.go | 52 + .../pkg/controllers/state/statenode.go | 516 + .../state/zz_generated.deepcopy.go | 60 +- .../karpenter}/pkg/events/recorder.go | 2 + .../karpenter}/pkg/metrics/constants.go | 18 +- .../karpenter/pkg/metrics/metrics.go | 97 + .../karpenter/pkg/metrics/store.go | 107 + .../pkg/metrics/workqueue_provider.go | 114 + .../pkg/operator/injection/injection.go | 83 + .../karpenter/pkg/operator/logging/logging.go | 121 + .../karpenter/pkg/operator/operator.go | 276 + .../pkg/operator/options/injectable.go | 31 + .../karpenter/pkg/operator/options/options.go | 155 + .../karpenter/pkg/scheduling/hostportusage.go | 114 + .../karpenter}/pkg/scheduling/requirement.go | 140 +- .../karpenter/pkg/scheduling/requirements.go | 334 + .../karpenter}/pkg/scheduling/taints.go | 32 +- .../karpenter/pkg/scheduling/volumeusage.go | 227 + .../pkg/scheduling/zz_generated.deepcopy.go | 181 + .../karpenter}/pkg/test/cachesyncingclient.go | 13 +- .../karpenter}/pkg/test/daemonsets.go | 2 + .../karpenter}/pkg/test/deployment.go | 11 +- .../karpenter}/pkg/test/environment.go | 61 +- .../karpenter}/pkg/test/eventrecorder.go | 4 +- .../karpenter}/pkg/test/metadata.go | 12 +- .../karpenter}/pkg/test/namespace.go | 2 + .../karpenter/pkg/test/nodeclaim.go} | 42 +- .../karpenter/pkg/test/nodeclass.go | 48 + .../karpenter/pkg/test/nodepool.go | 90 + .../karpenter}/pkg/test/nodes.go | 48 +- .../sigs.k8s.io/karpenter/pkg/test/options.go | 83 + .../karpenter}/pkg/test/pods.go | 207 +- .../karpenter}/pkg/test/randomdelay.go | 2 + .../karpenter}/pkg/test/replicaset.go | 2 + .../karpenter/pkg/test/statefulsets.go | 66 + .../karpenter}/pkg/test/storage.go | 86 +- .../karpenter.test.sh_testnodeclasses.yaml | 104 + .../karpenter/pkg/test}/v1alpha1/doc.go | 23 +- .../pkg/test/v1alpha1/testnodeclass.go | 52 + .../pkg/test/v1alpha1/testnodeclass_status.go | 39 + .../test/v1alpha1/zz_generated.deepcopy.go | 106 + .../pkg/utils/disruption/disruption.go | 78 + .../karpenter}/pkg/utils/env/env.go | 31 +- .../karpenter/pkg/utils/node/node.go | 163 + .../pkg/utils/nodeclaim/nodeclaim.go | 246 + .../karpenter/pkg/utils/nodepool/nodepool.go | 50 + .../karpenter/pkg/utils/pdb/pdb.go | 112 + .../karpenter/pkg/utils/pod/scheduling.go | 200 + .../pkg/utils/pretty/changemonitor.go | 8 +- .../karpenter/pkg/utils/pretty/pretty.go | 87 + .../pkg/utils/resources/resources.go | 115 +- .../karpenter}/pkg/utils/result/result.go | 2 + .../pkg/utils/termination/termination.go | 71 + .../karpenter/pkg/utils/volume/volume.go | 45 + .../karpenter/pkg/webhooks/webhooks.go | 187 + .../v4/fieldpath/pathelementmap.go | 45 +- .../v4/merge/conflict.go | 121 + .../structured-merge-diff/v4/merge/update.go | 358 + .../v4/schema/elements.go | 3 +- .../v4/schema/schemaschema.go | 3 +- .../structured-merge-diff/v4/typed/compare.go | 460 + .../structured-merge-diff/v4/typed/helpers.go | 21 +- .../structured-merge-diff/v4/typed/merge.go | 61 +- .../structured-merge-diff/v4/typed/parser.go | 12 +- .../structured-merge-diff/v4/typed/remove.go | 4 +- .../v4/typed/tofieldset.go | 24 +- .../structured-merge-diff/v4/typed/typed.go | 187 +- .../structured-merge-diff/v4/typed/union.go | 276 - .../v4/typed/validate.go | 14 +- .../v4/value/mapreflect.go | 2 +- .../v4/value/mapunstructured.go | 8 +- .../v4/value/reflectcache.go | 4 +- vendor/sigs.k8s.io/yaml/LICENSE | 256 + vendor/sigs.k8s.io/yaml/OWNERS | 8 +- vendor/sigs.k8s.io/yaml/fields.go | 55 +- .../yaml/goyaml.v2}/LICENSE | 0 .../yaml/goyaml.v2/LICENSE.libyaml} | 17 +- .../yaml/goyaml.v2/NOTICE} | 12 +- vendor/sigs.k8s.io/yaml/goyaml.v2/OWNERS | 24 + vendor/sigs.k8s.io/yaml/goyaml.v2/README.md | 143 + vendor/sigs.k8s.io/yaml/goyaml.v2/apic.go | 744 + vendor/sigs.k8s.io/yaml/goyaml.v2/decode.go | 815 + vendor/sigs.k8s.io/yaml/goyaml.v2/emitterc.go | 1685 + vendor/sigs.k8s.io/yaml/goyaml.v2/encode.go | 390 + vendor/sigs.k8s.io/yaml/goyaml.v2/parserc.go | 1095 + vendor/sigs.k8s.io/yaml/goyaml.v2/readerc.go | 412 + vendor/sigs.k8s.io/yaml/goyaml.v2/resolve.go | 258 + vendor/sigs.k8s.io/yaml/goyaml.v2/scannerc.go | 2711 ++ vendor/sigs.k8s.io/yaml/goyaml.v2/sorter.go | 113 + vendor/sigs.k8s.io/yaml/goyaml.v2/writerc.go | 26 + vendor/sigs.k8s.io/yaml/goyaml.v2/yaml.go | 478 + vendor/sigs.k8s.io/yaml/goyaml.v2/yamlh.go | 739 + .../yaml/goyaml.v2/yamlprivateh.go | 173 + vendor/sigs.k8s.io/yaml/yaml.go | 145 +- vendor/sigs.k8s.io/yaml/yaml_go110.go | 17 + 2630 files changed, 228864 insertions(+), 375289 deletions(-) delete mode 100644 charts/gpu-provisioner/crds/karpenter.sh_machines.yaml create mode 100644 charts/gpu-provisioner/crds/karpenter.sh_nodeclaims.yaml delete mode 100644 charts/gpu-provisioner/templates/configmap-logging.yaml delete mode 100644 charts/gpu-provisioner/templates/configmap.yaml create mode 100644 charts/gpu-provisioner/templates/secret.yaml create mode 100644 charts/gpu-provisioner/templates/service.yaml delete mode 100644 examples/machine-regular.yaml rename examples/{machine-gpu.yaml => v1-nodeclaim-gpu.yaml} (70%) create mode 100644 examples/v1beta1-nodeclaim-gpu.yaml delete mode 100644 hack/code/instancetype_testdata_gen.go delete mode 100644 hack/code/prices/prices_gen.go delete mode 100755 hack/codegen.sh delete mode 100644 pkg/apis/apis.go delete mode 100644 pkg/apis/crds/karpenter.sh_machines.yaml delete mode 100644 pkg/apis/settings/settings.go delete mode 100644 pkg/apis/settings/suite_test.go delete mode 100644 pkg/apis/settings/zz_generated.deepcopy.go delete mode 100644 pkg/apis/v1alpha1/register.go delete mode 100644 pkg/cache/cache.go delete mode 100644 pkg/cache/unavailableofferings.go delete mode 100644 pkg/cache/unavailableofferings_test.go create mode 100644 pkg/cloudprovider/cloudprovider_test.go delete mode 100644 pkg/cloudprovider/utils.go create mode 100644 pkg/controllers/controllers.go create mode 100644 pkg/controllers/instance/garbagecollection/controller.go create mode 100644 pkg/controllers/instance/garbagecollection/controller_test.go create mode 100644 pkg/controllers/instance/garbagecollection/readme.md delete mode 100644 pkg/fake/cloudprovider.go delete mode 100644 pkg/fake/instanceType.go create mode 100644 pkg/fake/nodeclaim.go delete mode 100644 pkg/fake/pricingapi.go delete mode 100644 pkg/fake/resourceskuapi.go delete mode 100644 pkg/fake/zz_generated.sku.go delete mode 100644 pkg/providers/instancetype/instancetype.go delete mode 100644 pkg/providers/instancetype/instancetypes.go delete mode 100644 pkg/providers/pricing/client/pricingapi.go delete mode 100644 pkg/providers/pricing/client/pricingapi_types.go delete mode 100644 pkg/providers/pricing/pricing.go delete mode 100644 pkg/providers/pricing/suite_test.go delete mode 100644 pkg/providers/pricing/zz_generated.pricing.go delete mode 100644 pkg/staticprovisioner/provisioner.go delete mode 100644 pkg/tests/utils.go delete mode 100644 pkg/utils/gpu.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/.gitignore delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/CHANGELOG.md delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/LICENSE.txt delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/MIGRATION.md delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/README.md delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/TOKEN_CACHING.MD delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/TROUBLESHOOTING.md delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/assets.json delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/authentication_record.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azidentity.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azure_cli_credential.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azure_developer_cli_credential.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azure_pipelines_credential.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/chained_token_credential.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/ci.yml delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/client_assertion_credential.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/client_certificate_credential.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/client_secret_credential.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/confidential_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/default_azure_credential.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/developer_credential_util.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/device_code_credential.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/environment_credential.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/errors.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/go.work delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/go.work.sum delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/interactive_browser_credential.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/internal/exported.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/internal/internal.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/logging.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed-identity-matrix.json delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed_identity_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed_identity_credential.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/on_behalf_of_credential.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/public_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/test-resources-post.ps1 delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/test-resources-pre.ps1 delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/test-resources.bicep delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/username_password_credential.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/version.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/workload_identity.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/CHANGELOG.md delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/LICENSE.txt delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/README.md delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/autorest.md delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/build.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/ci.yml delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_availabilitysets_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_capacityreservationgroups_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_capacityreservations_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_cloudserviceoperatingsystems_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_cloudserviceroleinstances_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_cloudserviceroles_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_cloudservices_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_cloudservicesupdatedomain_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_communitygalleries_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_communitygalleryimages_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_communitygalleryimageversions_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_constants.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_dedicatedhostgroups_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_dedicatedhosts_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_diskaccesses_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_diskencryptionsets_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_diskrestorepoint_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_disks_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_galleries_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_galleryapplications_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_galleryapplicationversions_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_galleryimages_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_galleryimageversions_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_gallerysharingprofile_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_images_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_loganalytics_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_models.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_models_serde.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_operations_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_proximityplacementgroups_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_resourceskus_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_response_types.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_restorepointcollections_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_restorepoints_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_sharedgalleries_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_sharedgalleryimages_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_sharedgalleryimageversions_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_snapshots_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_sshpublickeys_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_time_rfc3339.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_usage_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_virtualmachineextensionimages_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_virtualmachineextensions_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_virtualmachineimages_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_virtualmachineimagesedgezone_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_virtualmachineruncommands_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_virtualmachines_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_virtualmachinescalesetextensions_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_virtualmachinescalesetrollingupgrades_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_virtualmachinescalesets_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_virtualmachinescalesetvmextensions_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_virtualmachinescalesetvmruncommands_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_virtualmachinescalesetvms_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_virtualmachinesizes_client.go rename vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/{response_types.go => responses.go} (83%) create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/trustedaccessrolebindings_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/trustedaccessroles_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/CHANGELOG.md delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/LICENSE.txt delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/README.md delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/adminrulecollections_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/adminrules_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/applicationgatewayprivateendpointconnections_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/applicationgatewayprivatelinkresources_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/applicationgateways_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/applicationsecuritygroups_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/autorest.md delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/availabledelegations_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/availableendpointservices_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/availableprivateendpointtypes_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/availableresourcegroupdelegations_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/availableservicealiases_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/azurefirewallfqdntags_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/azurefirewalls_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/bastionhosts_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/bgpservicecommunities_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/build.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/ci.yml delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/configurationpolicygroups_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/connectionmonitors_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/connectivityconfigurations_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/constants.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/customipprefixes_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/ddoscustompolicies_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/ddosprotectionplans_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/defaultsecurityrules_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/dscpconfiguration_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/expressroutecircuitauthorizations_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/expressroutecircuitconnections_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/expressroutecircuitpeerings_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/expressroutecircuits_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/expressrouteconnections_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/expressroutecrossconnectionpeerings_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/expressroutecrossconnections_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/expressroutegateways_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/expressroutelinks_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/expressrouteportauthorizations_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/expressrouteports_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/expressrouteportslocations_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/expressrouteproviderportslocation_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/expressrouteserviceproviders_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/firewallpolicies_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignatures_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignaturesfiltervalues_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignaturesoverrides_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/firewallpolicyrulecollectiongroups_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/flowlogs_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/groups_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/hubroutetables_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/hubvirtualnetworkconnections_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/inboundnatrules_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/inboundsecurityrule_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/interfaceipconfigurations_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/interfaceloadbalancers_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/interfaces_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/interfacetapconfigurations_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/ipallocations_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/ipgroups_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/loadbalancerbackendaddresspools_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/loadbalancerfrontendipconfigurations_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/loadbalancerloadbalancingrules_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/loadbalancernetworkinterfaces_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/loadbalanceroutboundrules_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/loadbalancerprobes_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/loadbalancers_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/localnetworkgateways_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/management_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/managementgroupnetworkmanagerconnections_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/managercommits_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/managerdeploymentstatus_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/managers_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/models.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/models_serde.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/natgateways_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/natrules_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/operations_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/p2svpngateways_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/packetcaptures_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/peerexpressroutecircuitconnections_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/polymorphic_helpers.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/privatednszonegroups_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/privateendpoints_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/privatelinkservices_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/profiles_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/publicipaddresses_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/publicipprefixes_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/resourcenavigationlinks_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/response_types.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/routefilterrules_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/routefilters_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/routes_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/routetables_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/routingintent_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/scopeconnections_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/securityadminconfigurations_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/securitygroups_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/securitypartnerproviders_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/securityrules_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/serviceassociationlinks_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/serviceendpointpolicies_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/serviceendpointpolicydefinitions_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/servicetaginformation_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/servicetags_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/staticmembers_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/subnets_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/subscriptionnetworkmanagerconnections_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/time_rfc3339.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/usages_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/virtualappliances_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/virtualappliancesites_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/virtualapplianceskus_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/virtualhubbgpconnection_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/virtualhubbgpconnections_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/virtualhubipconfiguration_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/virtualhubroutetablev2s_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/virtualhubs_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/virtualnetworkgatewayconnections_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/virtualnetworkgatewaynatrules_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/virtualnetworkgateways_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/virtualnetworkpeerings_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/virtualnetworks_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/virtualnetworktaps_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/virtualrouterpeerings_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/virtualrouters_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/virtualwans_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/vpnconnections_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/vpngateways_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/vpnlinkconnections_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/vpnserverconfigurations_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/vpnserverconfigurationsassociatedwithvirtualwan_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/vpnsitelinkconnections_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/vpnsitelinks_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/vpnsites_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/vpnsitesconfiguration_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/watchers_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/webapplicationfirewallpolicies_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/webcategories_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/CHANGELOG.md delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/_meta.json delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/availabilitysets.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/containerservices.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/dedicatedhostgroups.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/dedicatedhosts.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/diskencryptionsets.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/disks.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/enums.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/galleries.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/galleryapplications.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/galleryapplicationversions.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/galleryimages.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/galleryimageversions.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/images.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/loganalytics.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/models.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/operations.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/proximityplacementgroups.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/resourceskus.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/snapshots.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/sshpublickeys.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/usage.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/version.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachineextensionimages.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachineextensions.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachineimages.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachineruncommands.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachines.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinescalesetextensions.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinescalesetrollingupgrades.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinescalesets.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinescalesetvmextensions.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinescalesetvms.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinesizes.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/CHANGELOG.md delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/_meta.json delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/availabilitysets.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/capacityreservationgroups.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/capacityreservations.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/cloudserviceoperatingsystems.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/cloudserviceroleinstances.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/cloudserviceroles.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/cloudservices.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/cloudservicesupdatedomain.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/communitygalleries.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/communitygalleryimages.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/communitygalleryimageversions.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/dedicatedhostgroups.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/dedicatedhosts.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/diskaccesses.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/diskencryptionsets.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/diskrestorepoint.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/disks.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/enums.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/galleries.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/galleryapplications.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/galleryapplicationversions.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/galleryimages.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/galleryimageversions.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/gallerysharingprofile.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/images.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/loganalytics.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/models.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/operations.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/proximityplacementgroups.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/resourceskus.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/restorepointcollections.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/restorepoints.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/sharedgalleries.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/sharedgalleryimages.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/sharedgalleryimageversions.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/snapshots.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/sshpublickeys.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/usage.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/version.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachineextensionimages.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachineextensions.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachineimages.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachineimagesedgezone.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachineruncommands.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachines.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachinescalesetextensions.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachinescalesetrollingupgrades.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachinescalesets.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachinescalesetvmextensions.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachinescalesetvmruncommands.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachinescalesetvms.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachinesizes.go delete mode 100644 vendor/github.com/Azure/skewer/.gitignore delete mode 100644 vendor/github.com/Azure/skewer/.golangci.yml delete mode 100644 vendor/github.com/Azure/skewer/CODE_OF_CONDUCT.md delete mode 100644 vendor/github.com/Azure/skewer/LICENSE delete mode 100644 vendor/github.com/Azure/skewer/README.md delete mode 100644 vendor/github.com/Azure/skewer/SECURITY.md delete mode 100644 vendor/github.com/Azure/skewer/cache.go delete mode 100644 vendor/github.com/Azure/skewer/clients.go delete mode 100644 vendor/github.com/Azure/skewer/const.go delete mode 100644 vendor/github.com/Azure/skewer/interface.go delete mode 100644 vendor/github.com/Azure/skewer/justfile delete mode 100644 vendor/github.com/Azure/skewer/sku.go delete mode 100644 vendor/github.com/Azure/skewer/strings.go delete mode 100644 vendor/github.com/Azure/skewer/vmsize.go delete mode 100644 vendor/github.com/Azure/skewer/wrap.go delete mode 100644 vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/local/server.go delete mode 100644 vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/public/public.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/apis/apis.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/apis/crds/karpenter.sh_machines.yaml delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/apis/crds/karpenter.sh_provisioners.yaml delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/apis/settings/settings.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/apis/settings/zz_generated.deepcopy.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/apis/v1alpha5/limits.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/apis/v1alpha5/machine_status.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/apis/v1alpha5/provisioner.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/apis/v1alpha5/provisioner_status.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/apis/v1alpha5/provisioner_validation.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/apis/v1alpha5/register.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/cloudprovider/types.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/controllers/consistency/controller.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/controllers/consistency/metrics.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/controllers/controllers.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/controllers/counter/controller.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/controllers/deprovisioning/consolidation.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/controllers/deprovisioning/controller.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/controllers/deprovisioning/drift.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/controllers/deprovisioning/emptiness.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/controllers/deprovisioning/emptymachineconsolidation.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/controllers/deprovisioning/events/events.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/controllers/deprovisioning/expiration.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/controllers/deprovisioning/helpers.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/controllers/deprovisioning/metrics.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/controllers/deprovisioning/multimachineconsolidation.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/controllers/deprovisioning/pdblimits.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/controllers/deprovisioning/singlemachineconsolidation.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/controllers/deprovisioning/types.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/controllers/deprovisioning/validation.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/controllers/machine/disruption/controller.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/controllers/machine/disruption/drift.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/controllers/machine/disruption/emptiness.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/controllers/machine/disruption/expiration.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/controllers/machine/garbagecollection/controller.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/controllers/machine/lifecycle/initialization.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/controllers/machine/lifecycle/launch.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/controllers/machine/lifecycle/registration.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/controllers/machine/termination/controller.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/controllers/metrics/pod/controller.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/controllers/metrics/provisioner/controller.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/controllers/metrics/state/controller.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/controllers/metrics/state/scraper/node.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/controllers/provisioning/controller.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/controllers/provisioning/provisioner.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/controllers/provisioning/scheduling/machinetemplate.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/controllers/provisioning/scheduling/scheduler.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/controllers/state/statenode.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/controllers/termination/controller.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/controllers/termination/terminator/events/events.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/controllers/termination/terminator/eviction.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/controllers/termination/terminator/terminator.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/metrics/metrics.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/operator/controller/controller.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/operator/controller/singleton.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/operator/controller/typed.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/operator/injection/injection.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/operator/logger.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/operator/operator.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/operator/options/options.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/operator/profiling.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/scheduling/hostportusage.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/scheduling/requirements.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/scheduling/volumeusage.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/test/provisioner.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/test/settings.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/utils/functional/functional.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/utils/machine/machine.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/utils/node/node.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/utils/pod/scheduling.go delete mode 100644 vendor/github.com/aws/karpenter-core/pkg/utils/sets/sets.go create mode 100644 vendor/github.com/awslabs/operatorpkg/LICENSE rename vendor/github.com/{aws/karpenter-core => awslabs/operatorpkg}/NOTICE (87%) create mode 100644 vendor/github.com/awslabs/operatorpkg/controller/controller.go create mode 100644 vendor/github.com/awslabs/operatorpkg/metrics/metrics.go create mode 100644 vendor/github.com/awslabs/operatorpkg/object/object.go create mode 100644 vendor/github.com/awslabs/operatorpkg/option/function.go create mode 100644 vendor/github.com/awslabs/operatorpkg/singleton/controller.go create mode 100644 vendor/github.com/awslabs/operatorpkg/status/condition.go create mode 100644 vendor/github.com/awslabs/operatorpkg/status/condition_set.go create mode 100644 vendor/github.com/awslabs/operatorpkg/status/controller.go create mode 100644 vendor/github.com/awslabs/operatorpkg/status/doc.go create mode 100644 vendor/github.com/awslabs/operatorpkg/status/zz_generated.deepcopy.go delete mode 100644 vendor/github.com/benbjohnson/clock/LICENSE delete mode 100644 vendor/github.com/benbjohnson/clock/README.md delete mode 100644 vendor/github.com/benbjohnson/clock/clock.go delete mode 100644 vendor/github.com/deckarep/golang-set/README.md delete mode 100644 vendor/github.com/deckarep/golang-set/iterator.go delete mode 100644 vendor/github.com/deckarep/golang-set/set.go delete mode 100644 vendor/github.com/deckarep/golang-set/threadsafe.go delete mode 100644 vendor/github.com/deckarep/golang-set/threadunsafe.go create mode 100644 vendor/github.com/evanphx/json-patch/.gitignore rename vendor/github.com/{pkg/browser => evanphx/json-patch}/LICENSE (72%) create mode 100644 vendor/github.com/evanphx/json-patch/README.md create mode 100644 vendor/github.com/evanphx/json-patch/errors.go create mode 100644 vendor/github.com/evanphx/json-patch/merge.go create mode 100644 vendor/github.com/evanphx/json-patch/patch.go create mode 100644 vendor/github.com/evanphx/json-patch/v5/internal/json/decode.go create mode 100644 vendor/github.com/evanphx/json-patch/v5/internal/json/encode.go create mode 100644 vendor/github.com/evanphx/json-patch/v5/internal/json/fold.go create mode 100644 vendor/github.com/evanphx/json-patch/v5/internal/json/fuzz.go create mode 100644 vendor/github.com/evanphx/json-patch/v5/internal/json/indent.go create mode 100644 vendor/github.com/evanphx/json-patch/v5/internal/json/scanner.go create mode 100644 vendor/github.com/evanphx/json-patch/v5/internal/json/stream.go create mode 100644 vendor/github.com/evanphx/json-patch/v5/internal/json/tables.go create mode 100644 vendor/github.com/evanphx/json-patch/v5/internal/json/tags.go create mode 100644 vendor/github.com/fsnotify/fsnotify/.cirrus.yml create mode 100644 vendor/github.com/go-logr/logr/SECURITY.md create mode 100644 vendor/github.com/go-logr/logr/context.go create mode 100644 vendor/github.com/go-logr/logr/context_noslog.go create mode 100644 vendor/github.com/go-logr/logr/context_slog.go create mode 100644 vendor/github.com/go-logr/logr/funcr/slogsink.go create mode 100644 vendor/github.com/go-logr/logr/sloghandler.go create mode 100644 vendor/github.com/go-logr/logr/slogr.go create mode 100644 vendor/github.com/go-logr/logr/slogr/slogr.go create mode 100644 vendor/github.com/go-logr/logr/slogsink.go create mode 100644 vendor/github.com/go-logr/zapr/.golangci.yaml create mode 100644 vendor/github.com/go-logr/zapr/slogzapr.go create mode 100644 vendor/github.com/go-logr/zapr/zapr_noslog.go create mode 100644 vendor/github.com/go-logr/zapr/zapr_slog.go delete mode 100644 vendor/github.com/go-playground/locales/.gitignore delete mode 100644 vendor/github.com/go-playground/locales/.travis.yml delete mode 100644 vendor/github.com/go-playground/locales/LICENSE delete mode 100644 vendor/github.com/go-playground/locales/README.md delete mode 100644 vendor/github.com/go-playground/locales/currency/currency.go delete mode 100644 vendor/github.com/go-playground/locales/logo.png delete mode 100644 vendor/github.com/go-playground/locales/rules.go delete mode 100644 vendor/github.com/go-playground/universal-translator/.gitignore delete mode 100644 vendor/github.com/go-playground/universal-translator/.travis.yml delete mode 100644 vendor/github.com/go-playground/universal-translator/LICENSE delete mode 100644 vendor/github.com/go-playground/universal-translator/Makefile delete mode 100644 vendor/github.com/go-playground/universal-translator/README.md delete mode 100644 vendor/github.com/go-playground/universal-translator/errors.go delete mode 100644 vendor/github.com/go-playground/universal-translator/import_export.go delete mode 100644 vendor/github.com/go-playground/universal-translator/logo.png delete mode 100644 vendor/github.com/go-playground/universal-translator/translator.go delete mode 100644 vendor/github.com/go-playground/universal-translator/universal_translator.go delete mode 100644 vendor/github.com/go-playground/validator/v10/LICENSE delete mode 100644 vendor/github.com/go-playground/validator/v10/MAINTAINERS.md delete mode 100644 vendor/github.com/go-playground/validator/v10/Makefile delete mode 100644 vendor/github.com/go-playground/validator/v10/README.md delete mode 100644 vendor/github.com/go-playground/validator/v10/baked_in.go delete mode 100644 vendor/github.com/go-playground/validator/v10/cache.go delete mode 100644 vendor/github.com/go-playground/validator/v10/country_codes.go delete mode 100644 vendor/github.com/go-playground/validator/v10/currency_codes.go delete mode 100644 vendor/github.com/go-playground/validator/v10/doc.go delete mode 100644 vendor/github.com/go-playground/validator/v10/errors.go delete mode 100644 vendor/github.com/go-playground/validator/v10/field_level.go delete mode 100644 vendor/github.com/go-playground/validator/v10/logo.png delete mode 100644 vendor/github.com/go-playground/validator/v10/postcode_regexes.go delete mode 100644 vendor/github.com/go-playground/validator/v10/regexes.go delete mode 100644 vendor/github.com/go-playground/validator/v10/struct_level.go delete mode 100644 vendor/github.com/go-playground/validator/v10/translations.go delete mode 100644 vendor/github.com/go-playground/validator/v10/util.go delete mode 100644 vendor/github.com/go-playground/validator/v10/validator.go delete mode 100644 vendor/github.com/go-playground/validator/v10/validator_instance.go rename vendor/github.com/go-task/slim-sprig/{ => v3}/.editorconfig (100%) rename vendor/github.com/go-task/slim-sprig/{ => v3}/.gitattributes (100%) rename vendor/github.com/go-task/slim-sprig/{ => v3}/.gitignore (100%) rename vendor/github.com/go-task/slim-sprig/{ => v3}/CHANGELOG.md (95%) rename vendor/github.com/go-task/slim-sprig/{ => v3}/LICENSE.txt (100%) rename vendor/github.com/go-task/slim-sprig/{ => v3}/README.md (88%) rename vendor/github.com/go-task/slim-sprig/{ => v3}/Taskfile.yml (89%) rename vendor/github.com/go-task/slim-sprig/{ => v3}/crypto.go (100%) rename vendor/github.com/go-task/slim-sprig/{ => v3}/date.go (100%) rename vendor/github.com/go-task/slim-sprig/{ => v3}/defaults.go (100%) rename vendor/github.com/go-task/slim-sprig/{ => v3}/dict.go (100%) rename vendor/github.com/go-task/slim-sprig/{ => v3}/doc.go (100%) rename vendor/github.com/go-task/slim-sprig/{ => v3}/functions.go (100%) rename vendor/github.com/go-task/slim-sprig/{ => v3}/list.go (100%) rename vendor/github.com/go-task/slim-sprig/{ => v3}/network.go (100%) rename vendor/github.com/go-task/slim-sprig/{ => v3}/numeric.go (100%) rename vendor/github.com/go-task/slim-sprig/{ => v3}/reflect.go (100%) rename vendor/github.com/go-task/slim-sprig/{ => v3}/regex.go (100%) rename vendor/github.com/go-task/slim-sprig/{ => v3}/strings.go (100%) rename vendor/github.com/go-task/slim-sprig/{ => v3}/url.go (100%) rename vendor/github.com/google/{gnostic => gnostic-models}/LICENSE (100%) rename vendor/github.com/google/{gnostic => gnostic-models}/compiler/README.md (100%) rename vendor/github.com/google/{gnostic => gnostic-models}/compiler/context.go (100%) rename vendor/github.com/google/{gnostic => gnostic-models}/compiler/error.go (100%) rename vendor/github.com/google/{gnostic => gnostic-models}/compiler/extensions.go (97%) rename vendor/github.com/google/{gnostic => gnostic-models}/compiler/helpers.go (99%) rename vendor/github.com/google/{gnostic => gnostic-models}/compiler/main.go (100%) rename vendor/github.com/google/{gnostic => gnostic-models}/compiler/reader.go (100%) rename vendor/github.com/google/{gnostic => gnostic-models}/extensions/README.md (100%) rename vendor/github.com/google/{gnostic => gnostic-models}/extensions/extension.pb.go (99%) rename vendor/github.com/google/{gnostic => gnostic-models}/extensions/extension.proto (100%) rename vendor/github.com/google/{gnostic => gnostic-models}/extensions/extensions.go (100%) rename vendor/github.com/google/{gnostic => gnostic-models}/jsonschema/README.md (100%) rename vendor/github.com/google/{gnostic => gnostic-models}/jsonschema/base.go (90%) rename vendor/github.com/google/{gnostic => gnostic-models}/jsonschema/display.go (100%) rename vendor/github.com/google/{gnostic => gnostic-models}/jsonschema/models.go (100%) rename vendor/github.com/google/{gnostic => gnostic-models}/jsonschema/operations.go (100%) rename vendor/github.com/google/{gnostic => gnostic-models}/jsonschema/reader.go (100%) rename vendor/github.com/google/{gnostic => gnostic-models}/jsonschema/schema.json (100%) rename vendor/github.com/google/{gnostic => gnostic-models}/jsonschema/writer.go (100%) rename vendor/github.com/google/{gnostic => gnostic-models}/openapiv2/OpenAPIv2.go (99%) rename vendor/github.com/google/{gnostic => gnostic-models}/openapiv2/OpenAPIv2.pb.go (99%) rename vendor/github.com/google/{gnostic => gnostic-models}/openapiv2/OpenAPIv2.proto (100%) rename vendor/github.com/google/{gnostic => gnostic-models}/openapiv2/README.md (100%) rename vendor/github.com/google/{gnostic => gnostic-models}/openapiv2/document.go (96%) rename vendor/github.com/google/{gnostic => gnostic-models}/openapiv2/openapi-2.0.json (100%) rename vendor/github.com/google/{gnostic => gnostic-models}/openapiv3/OpenAPIv3.go (99%) rename vendor/github.com/google/{gnostic => gnostic-models}/openapiv3/OpenAPIv3.pb.go (99%) rename vendor/github.com/google/{gnostic => gnostic-models}/openapiv3/OpenAPIv3.proto (100%) rename vendor/github.com/google/{gnostic => gnostic-models}/openapiv3/README.md (100%) rename vendor/github.com/google/{gnostic => gnostic-models}/openapiv3/document.go (96%) delete mode 100644 vendor/github.com/google/gnostic/openapiv3/openapi-3.0.json delete mode 100644 vendor/github.com/google/gnostic/openapiv3/openapi-3.1.json rename vendor/github.com/grpc-ecosystem/grpc-gateway/v2/{LICENSE.txt => LICENSE} (100%) create mode 100644 vendor/github.com/hashicorp/golang-lru/.golangci.yml create mode 100644 vendor/github.com/hashicorp/golang-lru/testing.go create mode 100644 vendor/github.com/inconshreveable/mousetrap/LICENSE create mode 100644 vendor/github.com/inconshreveable/mousetrap/README.md create mode 100644 vendor/github.com/inconshreveable/mousetrap/trap_others.go create mode 100644 vendor/github.com/inconshreveable/mousetrap/trap_windows.go delete mode 100644 vendor/github.com/leodido/go-urn/.gitignore delete mode 100644 vendor/github.com/leodido/go-urn/LICENSE delete mode 100644 vendor/github.com/leodido/go-urn/README.md delete mode 100644 vendor/github.com/leodido/go-urn/machine.go delete mode 100644 vendor/github.com/leodido/go-urn/machine.go.rl delete mode 100644 vendor/github.com/leodido/go-urn/makefile delete mode 100644 vendor/github.com/leodido/go-urn/urn.go delete mode 100644 vendor/github.com/matttproud/golang_protobuf_extensions/NOTICE delete mode 100644 vendor/github.com/matttproud/golang_protobuf_extensions/pbutil/.gitignore delete mode 100644 vendor/github.com/matttproud/golang_protobuf_extensions/pbutil/Makefile delete mode 100644 vendor/github.com/matttproud/golang_protobuf_extensions/pbutil/decode.go delete mode 100644 vendor/github.com/matttproud/golang_protobuf_extensions/pbutil/encode.go create mode 100644 vendor/github.com/onsi/ginkgo/v2/Makefile create mode 100644 vendor/github.com/onsi/ginkgo/v2/ginkgo/internal/gocovmerge.go create mode 100644 vendor/github.com/onsi/ginkgo/v2/internal/output_interceptor_wasm.go create mode 100644 vendor/github.com/onsi/ginkgo/v2/internal/progress_report_wasm.go delete mode 100644 vendor/github.com/pkg/browser/README.md delete mode 100644 vendor/github.com/pkg/browser/browser.go delete mode 100644 vendor/github.com/pkg/browser/browser_darwin.go delete mode 100644 vendor/github.com/pkg/browser/browser_freebsd.go delete mode 100644 vendor/github.com/pkg/browser/browser_linux.go delete mode 100644 vendor/github.com/pkg/browser/browser_netbsd.go delete mode 100644 vendor/github.com/pkg/browser/browser_openbsd.go delete mode 100644 vendor/github.com/pkg/browser/browser_unsupported.go delete mode 100644 vendor/github.com/pkg/browser/browser_windows.go rename vendor/{google.golang.org/genproto/protobuf/field_mask/field_mask.go => github.com/prometheus/client_golang/prometheus/process_collector_wasip1.go} (54%) create mode 100644 vendor/github.com/prometheus/common/model/labelset_string.go create mode 100644 vendor/github.com/prometheus/common/model/labelset_string_go120.go create mode 100644 vendor/github.com/prometheus/common/model/metadata.go create mode 100644 vendor/github.com/prometheus/procfs/fs_statfs_notype.go create mode 100644 vendor/github.com/prometheus/procfs/fs_statfs_type.go create mode 100644 vendor/github.com/prometheus/procfs/net_route.go create mode 100644 vendor/github.com/prometheus/procfs/net_wireless.go create mode 100644 vendor/github.com/prometheus/statsd_exporter/pkg/level/level.go rename vendor/github.com/{deckarep/golang-set => robfig/cron/v3}/.gitignore (100%) create mode 100644 vendor/github.com/robfig/cron/v3/.travis.yml create mode 100644 vendor/github.com/robfig/cron/v3/LICENSE create mode 100644 vendor/github.com/robfig/cron/v3/README.md create mode 100644 vendor/github.com/robfig/cron/v3/chain.go create mode 100644 vendor/github.com/robfig/cron/v3/constantdelay.go create mode 100644 vendor/github.com/robfig/cron/v3/cron.go create mode 100644 vendor/github.com/robfig/cron/v3/doc.go create mode 100644 vendor/github.com/robfig/cron/v3/logger.go create mode 100644 vendor/github.com/robfig/cron/v3/option.go create mode 100644 vendor/github.com/robfig/cron/v3/parser.go create mode 100644 vendor/github.com/robfig/cron/v3/spec.go create mode 100644 vendor/github.com/samber/lo/internal/constraints/constraints.go create mode 100644 vendor/github.com/samber/lo/internal/constraints/ordered_go118.go create mode 100644 vendor/github.com/samber/lo/internal/constraints/ordered_go121.go create mode 100644 vendor/github.com/samber/lo/internal/rand/ordered_go118.go create mode 100644 vendor/github.com/samber/lo/internal/rand/ordered_go122.go create mode 100644 vendor/github.com/samber/lo/time.go rename vendor/github.com/{go-playground/validator/v10 => spf13/cobra}/.gitignore (52%) create mode 100644 vendor/github.com/spf13/cobra/.golangci.yml create mode 100644 vendor/github.com/spf13/cobra/.mailmap create mode 100644 vendor/github.com/spf13/cobra/CONDUCT.md create mode 100644 vendor/github.com/spf13/cobra/CONTRIBUTING.md create mode 100644 vendor/github.com/spf13/cobra/LICENSE.txt create mode 100644 vendor/github.com/spf13/cobra/MAINTAINERS create mode 100644 vendor/github.com/spf13/cobra/Makefile create mode 100644 vendor/github.com/spf13/cobra/README.md create mode 100644 vendor/github.com/spf13/cobra/active_help.go create mode 100644 vendor/github.com/spf13/cobra/args.go create mode 100644 vendor/github.com/spf13/cobra/bash_completions.go create mode 100644 vendor/github.com/spf13/cobra/bash_completionsV2.go create mode 100644 vendor/github.com/spf13/cobra/cobra.go create mode 100644 vendor/github.com/spf13/cobra/command.go rename vendor/github.com/{matttproud/golang_protobuf_extensions/pbutil/doc.go => spf13/cobra/command_notwin.go} (73%) create mode 100644 vendor/github.com/spf13/cobra/command_win.go create mode 100644 vendor/github.com/spf13/cobra/completions.go create mode 100644 vendor/github.com/spf13/cobra/fish_completions.go create mode 100644 vendor/github.com/spf13/cobra/flag_groups.go create mode 100644 vendor/github.com/spf13/cobra/powershell_completions.go create mode 100644 vendor/github.com/spf13/cobra/shell_completions.go create mode 100644 vendor/github.com/spf13/cobra/zsh_completions.go delete mode 100644 vendor/go.uber.org/atomic/.codecov.yml delete mode 100644 vendor/go.uber.org/atomic/.gitignore delete mode 100644 vendor/go.uber.org/atomic/CHANGELOG.md delete mode 100644 vendor/go.uber.org/atomic/LICENSE.txt delete mode 100644 vendor/go.uber.org/atomic/Makefile delete mode 100644 vendor/go.uber.org/atomic/README.md delete mode 100644 vendor/go.uber.org/atomic/bool.go delete mode 100644 vendor/go.uber.org/atomic/doc.go delete mode 100644 vendor/go.uber.org/atomic/duration.go delete mode 100644 vendor/go.uber.org/atomic/duration_ext.go delete mode 100644 vendor/go.uber.org/atomic/error.go delete mode 100644 vendor/go.uber.org/atomic/error_ext.go delete mode 100644 vendor/go.uber.org/atomic/float64.go delete mode 100644 vendor/go.uber.org/atomic/float64_ext.go delete mode 100644 vendor/go.uber.org/atomic/gen.go delete mode 100644 vendor/go.uber.org/atomic/int32.go delete mode 100644 vendor/go.uber.org/atomic/int64.go delete mode 100644 vendor/go.uber.org/atomic/nocmp.go delete mode 100644 vendor/go.uber.org/atomic/string.go delete mode 100644 vendor/go.uber.org/atomic/string_ext.go delete mode 100644 vendor/go.uber.org/atomic/time_ext.go delete mode 100644 vendor/go.uber.org/atomic/uint32.go delete mode 100644 vendor/go.uber.org/atomic/uint64.go delete mode 100644 vendor/go.uber.org/atomic/uintptr.go delete mode 100644 vendor/go.uber.org/atomic/unsafe_pointer.go delete mode 100644 vendor/go.uber.org/atomic/value.go create mode 100644 vendor/go.uber.org/automaxprocs/internal/cgroups/cgroups2.go delete mode 100644 vendor/go.uber.org/mock/CONTRIBUTORS create mode 100644 vendor/go.uber.org/zap/.golangci.yml rename vendor/go.uber.org/zap/{LICENSE.txt => LICENSE} (100%) delete mode 100644 vendor/go.uber.org/zap/array_go118.go rename vendor/go.uber.org/{atomic/time.go => zap/internal/pool/pool.go} (56%) rename vendor/go.uber.org/zap/{stacktrace.go => internal/stacktrace/stack.go} (73%) rename vendor/go.uber.org/{atomic/bool_ext.go => zap/zapcore/lazy_with.go} (60%) delete mode 100644 vendor/go.uber.org/zap/zapio/writer.go delete mode 100644 vendor/golang.org/x/crypto/sha3/doc.go delete mode 100644 vendor/golang.org/x/crypto/sha3/hashes.go delete mode 100644 vendor/golang.org/x/crypto/sha3/hashes_noasm.go delete mode 100644 vendor/golang.org/x/crypto/sha3/keccakf.go delete mode 100644 vendor/golang.org/x/crypto/sha3/keccakf_amd64.go delete mode 100644 vendor/golang.org/x/crypto/sha3/keccakf_amd64.s delete mode 100644 vendor/golang.org/x/crypto/sha3/register.go delete mode 100644 vendor/golang.org/x/crypto/sha3/sha3.go delete mode 100644 vendor/golang.org/x/crypto/sha3/sha3_s390x.go delete mode 100644 vendor/golang.org/x/crypto/sha3/sha3_s390x.s delete mode 100644 vendor/golang.org/x/crypto/sha3/shake.go delete mode 100644 vendor/golang.org/x/crypto/sha3/shake_noasm.go delete mode 100644 vendor/golang.org/x/crypto/sha3/xor.go delete mode 100644 vendor/golang.org/x/exp/AUTHORS delete mode 100644 vendor/golang.org/x/exp/CONTRIBUTORS create mode 100644 vendor/golang.org/x/exp/maps/maps.go create mode 100644 vendor/golang.org/x/exp/slices/cmp.go create mode 100644 vendor/golang.org/x/exp/slices/slices.go create mode 100644 vendor/golang.org/x/exp/slices/sort.go create mode 100644 vendor/golang.org/x/exp/slices/zsortanyfunc.go create mode 100644 vendor/golang.org/x/exp/slices/zsortordered.go create mode 100644 vendor/golang.org/x/oauth2/deviceauth.go create mode 100644 vendor/golang.org/x/oauth2/pkce.go delete mode 100644 vendor/golang.org/x/sys/cpu/asm_aix_ppc64.s delete mode 100644 vendor/golang.org/x/sys/cpu/byteorder.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_aix.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_arm.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_arm64.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_arm64.s delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_gc_s390x.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_gc_x86.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_gccgo_arm64.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_gccgo_s390x.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.c delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_linux.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_linux_arm.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_linux_arm64.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_linux_mips64x.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_linux_noinit.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_linux_ppc64x.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_linux_s390x.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_loong64.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_mips64x.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_mipsx.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_netbsd_arm64.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_openbsd_arm64.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_openbsd_arm64.s delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_other_arm.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_other_arm64.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_other_mips64x.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_other_ppc64x.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_other_riscv64.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_ppc64x.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_riscv64.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_s390x.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_s390x.s delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_wasm.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_x86.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_x86.s delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_zos.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_zos_s390x.go delete mode 100644 vendor/golang.org/x/sys/cpu/endian_big.go delete mode 100644 vendor/golang.org/x/sys/cpu/endian_little.go delete mode 100644 vendor/golang.org/x/sys/cpu/hwcap_linux.go delete mode 100644 vendor/golang.org/x/sys/cpu/parse.go delete mode 100644 vendor/golang.org/x/sys/cpu/proc_cpuinfo_linux.go delete mode 100644 vendor/golang.org/x/sys/cpu/runtime_auxv.go delete mode 100644 vendor/golang.org/x/sys/cpu/runtime_auxv_go121.go delete mode 100644 vendor/golang.org/x/sys/cpu/syscall_aix_gccgo.go delete mode 100644 vendor/golang.org/x/sys/cpu/syscall_aix_ppc64_gc.go create mode 100644 vendor/golang.org/x/text/cases/cases.go create mode 100644 vendor/golang.org/x/text/cases/context.go create mode 100644 vendor/golang.org/x/text/cases/fold.go create mode 100644 vendor/golang.org/x/text/cases/icu.go create mode 100644 vendor/golang.org/x/text/cases/info.go create mode 100644 vendor/golang.org/x/text/cases/map.go create mode 100644 vendor/golang.org/x/text/cases/tables10.0.0.go create mode 100644 vendor/golang.org/x/text/cases/tables11.0.0.go create mode 100644 vendor/golang.org/x/text/cases/tables12.0.0.go create mode 100644 vendor/golang.org/x/text/cases/tables13.0.0.go create mode 100644 vendor/golang.org/x/text/cases/tables15.0.0.go create mode 100644 vendor/golang.org/x/text/cases/tables9.0.0.go create mode 100644 vendor/golang.org/x/text/cases/trieval.go create mode 100644 vendor/golang.org/x/text/internal/internal.go create mode 100644 vendor/golang.org/x/text/internal/match.go create mode 100644 vendor/golang.org/x/tools/cover/profile.go rename vendor/google.golang.org/genproto/{ => googleapis/api}/LICENSE (100%) rename vendor/{github.com/aws/karpenter-core => google.golang.org/genproto/googleapis/rpc}/LICENSE (99%) create mode 100644 vendor/google.golang.org/grpc/internal/grpcsync/pubsub.go rename vendor/google.golang.org/grpc/{ => internal/idle}/idle.go (61%) create mode 100644 vendor/google.golang.org/grpc/shared_buffer_pool.go create mode 100644 vendor/google.golang.org/protobuf/encoding/protodelim/protodelim.go create mode 100644 vendor/google.golang.org/protobuf/internal/editionssupport/editions.go delete mode 100644 vendor/google.golang.org/protobuf/types/gofeaturespb/go_features.proto create mode 100644 vendor/k8s.io/api/admissionregistration/v1alpha1/doc.go create mode 100644 vendor/k8s.io/api/admissionregistration/v1alpha1/generated.pb.go create mode 100644 vendor/k8s.io/api/admissionregistration/v1alpha1/generated.proto create mode 100644 vendor/k8s.io/api/admissionregistration/v1alpha1/register.go create mode 100644 vendor/k8s.io/api/admissionregistration/v1alpha1/types.go create mode 100644 vendor/k8s.io/api/admissionregistration/v1alpha1/types_swagger_doc_generated.go create mode 100644 vendor/k8s.io/api/admissionregistration/v1alpha1/zz_generated.deepcopy.go rename vendor/k8s.io/{component-base/config/v1alpha1 => api/apidiscovery/v2}/doc.go (75%) create mode 100644 vendor/k8s.io/api/apidiscovery/v2/generated.pb.go create mode 100644 vendor/k8s.io/api/apidiscovery/v2/generated.proto create mode 100644 vendor/k8s.io/api/apidiscovery/v2/register.go create mode 100644 vendor/k8s.io/api/apidiscovery/v2/types.go create mode 100644 vendor/k8s.io/api/apidiscovery/v2/zz_generated.deepcopy.go rename vendor/{github.com/aws/karpenter-core/pkg/apis/v1alpha5 => k8s.io/api/apidiscovery/v2beta1}/doc.go (70%) create mode 100644 vendor/k8s.io/api/apidiscovery/v2beta1/generated.pb.go create mode 100644 vendor/k8s.io/api/apidiscovery/v2beta1/generated.proto create mode 100644 vendor/k8s.io/api/apidiscovery/v2beta1/register.go create mode 100644 vendor/k8s.io/api/apidiscovery/v2beta1/types.go create mode 100644 vendor/k8s.io/api/apidiscovery/v2beta1/zz_generated.deepcopy.go create mode 100644 vendor/k8s.io/api/apidiscovery/v2beta1/zz_generated.prerelease-lifecycle.go create mode 100644 vendor/k8s.io/api/authentication/v1alpha1/doc.go create mode 100644 vendor/k8s.io/api/authentication/v1alpha1/generated.pb.go create mode 100644 vendor/k8s.io/api/authentication/v1alpha1/generated.proto create mode 100644 vendor/k8s.io/api/authentication/v1alpha1/register.go create mode 100644 vendor/k8s.io/api/authentication/v1alpha1/types.go create mode 100644 vendor/k8s.io/api/authentication/v1alpha1/types_swagger_doc_generated.go rename vendor/k8s.io/{component-base/config => api/authentication/v1alpha1}/zz_generated.deepcopy.go (51%) create mode 100644 vendor/k8s.io/api/authentication/v1alpha1/zz_generated.prerelease-lifecycle.go create mode 100644 vendor/k8s.io/api/certificates/v1alpha1/doc.go create mode 100644 vendor/k8s.io/api/certificates/v1alpha1/generated.pb.go create mode 100644 vendor/k8s.io/api/certificates/v1alpha1/generated.proto create mode 100644 vendor/k8s.io/api/certificates/v1alpha1/register.go create mode 100644 vendor/k8s.io/api/certificates/v1alpha1/types.go create mode 100644 vendor/k8s.io/api/certificates/v1alpha1/types_swagger_doc_generated.go create mode 100644 vendor/k8s.io/api/certificates/v1alpha1/zz_generated.deepcopy.go create mode 100644 vendor/k8s.io/api/certificates/v1alpha1/zz_generated.prerelease-lifecycle.go create mode 100644 vendor/k8s.io/api/flowcontrol/v1/doc.go create mode 100644 vendor/k8s.io/api/flowcontrol/v1/generated.pb.go create mode 100644 vendor/k8s.io/api/flowcontrol/v1/generated.proto rename vendor/k8s.io/api/flowcontrol/{v1alpha1 => v1}/register.go (95%) rename vendor/k8s.io/api/flowcontrol/{v1alpha1 => v1}/types.go (75%) create mode 100644 vendor/k8s.io/api/flowcontrol/v1/types_swagger_doc_generated.go create mode 100644 vendor/k8s.io/api/flowcontrol/v1/zz_generated.deepcopy.go rename vendor/k8s.io/api/flowcontrol/{v1alpha1 => v1beta3}/doc.go (77%) rename vendor/k8s.io/api/flowcontrol/{v1alpha1 => v1beta3}/generated.pb.go (86%) rename vendor/k8s.io/api/flowcontrol/{v1alpha1 => v1beta3}/generated.proto (79%) create mode 100644 vendor/k8s.io/api/flowcontrol/v1beta3/register.go create mode 100644 vendor/k8s.io/api/flowcontrol/v1beta3/types.go rename vendor/k8s.io/api/flowcontrol/{v1alpha1 => v1beta3}/types_swagger_doc_generated.go (81%) rename vendor/k8s.io/api/flowcontrol/{v1alpha1 => v1beta3}/zz_generated.deepcopy.go (92%) rename vendor/k8s.io/api/flowcontrol/{v1alpha1 => v1beta3}/zz_generated.prerelease-lifecycle.go (94%) create mode 100644 vendor/k8s.io/api/networking/v1alpha1/well_known_labels.go create mode 100644 vendor/k8s.io/api/resource/v1alpha2/doc.go create mode 100644 vendor/k8s.io/api/resource/v1alpha2/generated.pb.go create mode 100644 vendor/k8s.io/api/resource/v1alpha2/generated.proto create mode 100644 vendor/k8s.io/api/resource/v1alpha2/namedresources.go create mode 100644 vendor/k8s.io/api/resource/v1alpha2/register.go create mode 100644 vendor/k8s.io/api/resource/v1alpha2/types.go create mode 100644 vendor/k8s.io/api/resource/v1alpha2/types_swagger_doc_generated.go create mode 100644 vendor/k8s.io/api/resource/v1alpha2/zz_generated.deepcopy.go create mode 100644 vendor/k8s.io/api/storagemigration/v1alpha1/doc.go create mode 100644 vendor/k8s.io/api/storagemigration/v1alpha1/generated.pb.go create mode 100644 vendor/k8s.io/api/storagemigration/v1alpha1/generated.proto create mode 100644 vendor/k8s.io/api/storagemigration/v1alpha1/register.go create mode 100644 vendor/k8s.io/api/storagemigration/v1alpha1/types.go create mode 100644 vendor/k8s.io/api/storagemigration/v1alpha1/types_swagger_doc_generated.go create mode 100644 vendor/k8s.io/api/storagemigration/v1alpha1/zz_generated.deepcopy.go create mode 100644 vendor/k8s.io/api/storagemigration/v1alpha1/zz_generated.prerelease-lifecycle.go create mode 100644 vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/customresourcecolumndefinition.go create mode 100644 vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/customresourceconversion.go create mode 100644 vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/customresourcedefinition.go create mode 100644 vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/customresourcedefinitioncondition.go create mode 100644 vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/customresourcedefinitionnames.go create mode 100644 vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/customresourcedefinitionspec.go create mode 100644 vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/customresourcedefinitionstatus.go create mode 100644 vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/customresourcedefinitionversion.go create mode 100644 vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/customresourcesubresources.go create mode 100644 vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/customresourcesubresourcescale.go create mode 100644 vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/customresourcevalidation.go create mode 100644 vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/externaldocumentation.go create mode 100644 vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/jsonschemaprops.go create mode 100644 vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/selectablefield.go create mode 100644 vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/servicereference.go create mode 100644 vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/validationrule.go create mode 100644 vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/webhookclientconfig.go create mode 100644 vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/webhookconversion.go create mode 100644 vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/customresourcecolumndefinition.go create mode 100644 vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/customresourceconversion.go create mode 100644 vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/customresourcedefinition.go create mode 100644 vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/customresourcedefinitioncondition.go create mode 100644 vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/customresourcedefinitionnames.go create mode 100644 vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/customresourcedefinitionspec.go create mode 100644 vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/customresourcedefinitionstatus.go create mode 100644 vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/customresourcedefinitionversion.go create mode 100644 vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/customresourcesubresources.go create mode 100644 vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/customresourcesubresourcescale.go create mode 100644 vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/customresourcevalidation.go create mode 100644 vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/externaldocumentation.go create mode 100644 vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/jsonschemaprops.go rename vendor/k8s.io/{client-go/applyconfigurations/extensions/v1beta1/allowedflexvolume.go => apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/selectablefield.go} (51%) create mode 100644 vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/servicereference.go create mode 100644 vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/validationrule.go create mode 100644 vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/webhookclientconfig.go create mode 100644 vendor/k8s.io/apiextensions-apiserver/pkg/client/informers/externalversions/apiextensions/interface.go create mode 100644 vendor/k8s.io/apiextensions-apiserver/pkg/client/informers/externalversions/apiextensions/v1/customresourcedefinition.go create mode 100644 vendor/k8s.io/apiextensions-apiserver/pkg/client/informers/externalversions/apiextensions/v1/interface.go create mode 100644 vendor/k8s.io/apiextensions-apiserver/pkg/client/informers/externalversions/apiextensions/v1beta1/customresourcedefinition.go create mode 100644 vendor/k8s.io/apiextensions-apiserver/pkg/client/informers/externalversions/apiextensions/v1beta1/interface.go create mode 100644 vendor/k8s.io/apiextensions-apiserver/pkg/client/informers/externalversions/factory.go create mode 100644 vendor/k8s.io/apiextensions-apiserver/pkg/client/informers/externalversions/generic.go create mode 100644 vendor/k8s.io/apiextensions-apiserver/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go create mode 100644 vendor/k8s.io/apiextensions-apiserver/pkg/client/listers/apiextensions/v1/customresourcedefinition.go rename vendor/{github.com/aws/karpenter-core/pkg/apis/settings/injectable.go => k8s.io/apiextensions-apiserver/pkg/client/listers/apiextensions/v1/expansion_generated.go} (67%) create mode 100644 vendor/k8s.io/apiextensions-apiserver/pkg/client/listers/apiextensions/v1beta1/customresourcedefinition.go create mode 100644 vendor/k8s.io/apiextensions-apiserver/pkg/client/listers/apiextensions/v1beta1/expansion_generated.go rename vendor/k8s.io/{component-base/config => apimachinery/pkg/api/validation}/OWNERS (84%) create mode 100644 vendor/k8s.io/apimachinery/pkg/apis/meta/internalversion/defaults.go create mode 100644 vendor/k8s.io/apimachinery/pkg/runtime/splice.go create mode 100644 vendor/k8s.io/apimachinery/pkg/util/dump/dump.go create mode 100644 vendor/k8s.io/apimachinery/pkg/util/managedfields/endpoints.yaml create mode 100644 vendor/k8s.io/apimachinery/pkg/util/managedfields/fieldmanager.go create mode 100644 vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/atmostevery.go create mode 100644 vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/buildmanagerinfo.go create mode 100644 vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/capmanagers.go create mode 100644 vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/conflict.go create mode 100644 vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/fieldmanager.go create mode 100644 vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/fields.go create mode 100644 vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/lastapplied.go create mode 100644 vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/lastappliedmanager.go create mode 100644 vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/lastappliedupdater.go create mode 100644 vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/managedfields.go create mode 100644 vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/managedfieldsupdater.go create mode 100644 vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/manager.go create mode 100644 vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/pathelement.go create mode 100644 vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/skipnonapplied.go create mode 100644 vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/stripmeta.go create mode 100644 vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/structuredmerge.go create mode 100644 vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/typeconverter.go create mode 100644 vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/versioncheck.go create mode 100644 vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/versionconverter.go create mode 100644 vendor/k8s.io/apimachinery/pkg/util/managedfields/node.yaml create mode 100644 vendor/k8s.io/apimachinery/pkg/util/managedfields/pod.yaml create mode 100644 vendor/k8s.io/apimachinery/pkg/util/managedfields/scalehandler.go create mode 100644 vendor/k8s.io/apimachinery/pkg/util/managedfields/typeconverter.go create mode 100644 vendor/k8s.io/apimachinery/pkg/util/rand/rand.go create mode 100644 vendor/k8s.io/apimachinery/pkg/util/sets/set.go create mode 100644 vendor/k8s.io/apimachinery/pkg/util/validation/OWNERS create mode 100644 vendor/k8s.io/apimachinery/pkg/util/wait/backoff.go create mode 100644 vendor/k8s.io/apimachinery/pkg/util/wait/delay.go create mode 100644 vendor/k8s.io/apimachinery/pkg/util/wait/error.go create mode 100644 vendor/k8s.io/apimachinery/pkg/util/wait/loop.go create mode 100644 vendor/k8s.io/apimachinery/pkg/util/wait/poll.go create mode 100644 vendor/k8s.io/apimachinery/pkg/util/wait/timer.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/auditannotation.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/expressionwarning.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/matchcondition.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/matchresources.go rename vendor/k8s.io/client-go/applyconfigurations/admissionregistration/{v1beta1/rulewithoperations.go => v1/namedrulewithoperations.go} (56%) create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/paramkind.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/paramref.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/typechecking.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/validatingadmissionpolicy.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/validatingadmissionpolicybinding.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/validatingadmissionpolicybindingspec.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/validatingadmissionpolicyspec.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/validatingadmissionpolicystatus.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/validation.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/variable.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1/auditannotation.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1/expressionwarning.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1/matchcondition.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1/matchresources.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1/namedrulewithoperations.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1/paramkind.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1/paramref.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1/typechecking.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1/validatingadmissionpolicy.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1/validatingadmissionpolicybinding.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1/validatingadmissionpolicybindingspec.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1/validatingadmissionpolicyspec.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1/validatingadmissionpolicystatus.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1/validation.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1/variable.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/auditannotation.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/expressionwarning.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/matchcondition.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/matchresources.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/namedrulewithoperations.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/paramkind.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/paramref.go delete mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/rule.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/typechecking.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/validatingadmissionpolicy.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/validatingadmissionpolicybinding.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/validatingadmissionpolicybindingspec.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/validatingadmissionpolicyspec.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/validatingadmissionpolicystatus.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/validation.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/variable.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/apps/v1/statefulsetordinals.go rename vendor/k8s.io/client-go/applyconfigurations/{policy/v1beta1/allowedflexvolume.go => apps/v1beta1/statefulsetordinals.go} (50%) create mode 100644 vendor/k8s.io/client-go/applyconfigurations/apps/v1beta2/statefulsetordinals.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/batch/v1/successpolicy.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/batch/v1/successpolicyrule.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/certificates/v1alpha1/clustertrustbundle.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/certificates/v1alpha1/clustertrustbundlespec.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/core/v1/apparmorprofile.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/core/v1/claimsource.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/core/v1/clustertrustbundleprojection.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/core/v1/containerresizepolicy.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/core/v1/hostip.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/core/v1/modifyvolumestatus.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/core/v1/noderuntimehandler.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/core/v1/noderuntimehandlerfeatures.go rename vendor/k8s.io/client-go/applyconfigurations/{autoscaling/v2/podresourcemetricsource.go => core/v1/podresourceclaim.go} (51%) create mode 100644 vendor/k8s.io/client-go/applyconfigurations/core/v1/podresourceclaimstatus.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/core/v1/podschedulinggate.go rename vendor/k8s.io/client-go/applyconfigurations/{extensions/v1beta1/allowedcsidriver.go => core/v1/resourceclaim.go} (65%) create mode 100644 vendor/k8s.io/client-go/applyconfigurations/core/v1/sleepaction.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/core/v1/typedobjectreference.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/core/v1/volumemountstatus.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/core/v1/volumeresourcerequirements.go delete mode 100644 vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/allowedhostpath.go delete mode 100644 vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/fsgroupstrategyoptions.go delete mode 100644 vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/hostportrange.go delete mode 100644 vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/idrange.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/ingressloadbalanceringress.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/ingressloadbalancerstatus.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/ingressportstatus.go delete mode 100644 vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/podsecuritypolicyspec.go delete mode 100644 vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/runasgroupstrategyoptions.go delete mode 100644 vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/runasuserstrategyoptions.go delete mode 100644 vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/runtimeclassstrategyoptions.go delete mode 100644 vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/selinuxstrategyoptions.go delete mode 100644 vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/supplementalgroupsstrategyoptions.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/exemptprioritylevelconfiguration.go rename vendor/k8s.io/client-go/applyconfigurations/flowcontrol/{v1alpha1 => v1}/flowdistinguishermethod.go (87%) rename vendor/k8s.io/client-go/applyconfigurations/flowcontrol/{v1alpha1 => v1}/flowschema.go (94%) create mode 100644 vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/flowschemacondition.go rename vendor/k8s.io/client-go/applyconfigurations/flowcontrol/{v1alpha1 => v1}/flowschemaspec.go (99%) rename vendor/k8s.io/client-go/applyconfigurations/flowcontrol/{v1alpha1 => v1}/flowschemastatus.go (99%) rename vendor/k8s.io/client-go/applyconfigurations/flowcontrol/{v1alpha1 => v1}/groupsubject.go (98%) rename vendor/k8s.io/client-go/applyconfigurations/flowcontrol/{v1alpha1 => v1}/limitedprioritylevelconfiguration.go (57%) rename vendor/k8s.io/client-go/applyconfigurations/flowcontrol/{v1alpha1 => v1}/limitresponse.go (88%) rename vendor/k8s.io/client-go/applyconfigurations/flowcontrol/{v1alpha1 => v1}/nonresourcepolicyrule.go (99%) rename vendor/k8s.io/client-go/applyconfigurations/flowcontrol/{v1alpha1 => v1}/policyruleswithsubjects.go (99%) rename vendor/k8s.io/client-go/applyconfigurations/flowcontrol/{v1alpha1 => v1}/prioritylevelconfiguration.go (94%) create mode 100644 vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/prioritylevelconfigurationcondition.go rename vendor/k8s.io/client-go/applyconfigurations/flowcontrol/{v1alpha1 => v1}/prioritylevelconfigurationreference.go (98%) rename vendor/k8s.io/client-go/applyconfigurations/flowcontrol/{v1alpha1 => v1}/prioritylevelconfigurationspec.go (73%) rename vendor/k8s.io/client-go/applyconfigurations/flowcontrol/{v1alpha1 => v1}/prioritylevelconfigurationstatus.go (99%) rename vendor/k8s.io/client-go/applyconfigurations/flowcontrol/{v1alpha1 => v1}/queuingconfiguration.go (99%) rename vendor/k8s.io/client-go/applyconfigurations/flowcontrol/{v1alpha1 => v1}/resourcepolicyrule.go (99%) rename vendor/k8s.io/client-go/applyconfigurations/flowcontrol/{v1alpha1 => v1}/serviceaccountsubject.go (99%) rename vendor/k8s.io/client-go/applyconfigurations/flowcontrol/{v1alpha1 => v1}/subject.go (92%) rename vendor/k8s.io/client-go/applyconfigurations/flowcontrol/{v1alpha1 => v1}/usersubject.go (98%) create mode 100644 vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta1/exemptprioritylevelconfiguration.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta2/exemptprioritylevelconfiguration.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3/exemptprioritylevelconfiguration.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3/flowdistinguishermethod.go rename vendor/k8s.io/client-go/applyconfigurations/{extensions/v1beta1/podsecuritypolicy.go => flowcontrol/v1beta3/flowschema.go} (66%) rename vendor/k8s.io/client-go/applyconfigurations/flowcontrol/{v1alpha1 => v1beta3}/flowschemacondition.go (83%) create mode 100644 vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3/flowschemaspec.go rename vendor/k8s.io/client-go/applyconfigurations/{extensions/v1beta1/networkpolicystatus.go => flowcontrol/v1beta3/flowschemastatus.go} (60%) rename vendor/k8s.io/client-go/applyconfigurations/{policy/v1beta1/allowedcsidriver.go => flowcontrol/v1beta3/groupsubject.go} (65%) create mode 100644 vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3/limitedprioritylevelconfiguration.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3/limitresponse.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3/nonresourcepolicyrule.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3/policyruleswithsubjects.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3/prioritylevelconfiguration.go rename vendor/k8s.io/client-go/applyconfigurations/flowcontrol/{v1alpha1 => v1beta3}/prioritylevelconfigurationcondition.go (86%) create mode 100644 vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3/prioritylevelconfigurationreference.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3/prioritylevelconfigurationspec.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3/prioritylevelconfigurationstatus.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3/queuingconfiguration.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3/resourcepolicyrule.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3/serviceaccountsubject.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3/subject.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3/usersubject.go delete mode 100644 vendor/k8s.io/client-go/applyconfigurations/meta/v1/listmeta.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/networking/v1/ingressloadbalanceringress.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/networking/v1/ingressloadbalancerstatus.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/networking/v1/ingressportstatus.go delete mode 100644 vendor/k8s.io/client-go/applyconfigurations/networking/v1alpha1/clustercidrspec.go rename vendor/k8s.io/client-go/applyconfigurations/networking/v1alpha1/{clustercidr.go => ipaddress.go} (69%) create mode 100644 vendor/k8s.io/client-go/applyconfigurations/networking/v1alpha1/ipaddressspec.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/networking/v1alpha1/parentreference.go rename vendor/k8s.io/client-go/applyconfigurations/{policy/v1beta1/podsecuritypolicy.go => networking/v1alpha1/servicecidr.go} (65%) create mode 100644 vendor/k8s.io/client-go/applyconfigurations/networking/v1alpha1/servicecidrspec.go rename vendor/k8s.io/client-go/applyconfigurations/networking/{v1/networkpolicystatus.go => v1alpha1/servicecidrstatus.go} (68%) create mode 100644 vendor/k8s.io/client-go/applyconfigurations/networking/v1beta1/ingressloadbalanceringress.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/networking/v1beta1/ingressloadbalancerstatus.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/networking/v1beta1/ingressportstatus.go delete mode 100644 vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/allowedhostpath.go delete mode 100644 vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/fsgroupstrategyoptions.go delete mode 100644 vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/hostportrange.go delete mode 100644 vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/idrange.go delete mode 100644 vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/podsecuritypolicyspec.go delete mode 100644 vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/runasgroupstrategyoptions.go delete mode 100644 vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/runasuserstrategyoptions.go delete mode 100644 vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/runtimeclassstrategyoptions.go delete mode 100644 vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/selinuxstrategyoptions.go delete mode 100644 vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/supplementalgroupsstrategyoptions.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha2/allocationresult.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha2/allocationresultmodel.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha2/driverallocationresult.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha2/driverrequests.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha2/namedresourcesallocationresult.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha2/namedresourcesattribute.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha2/namedresourcesattributevalue.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha2/namedresourcesfilter.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha2/namedresourcesinstance.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha2/namedresourcesintslice.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha2/namedresourcesrequest.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha2/namedresourcesresources.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha2/namedresourcesstringslice.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha2/podschedulingcontext.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha2/podschedulingcontextspec.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha2/podschedulingcontextstatus.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourceclaim.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourceclaimconsumerreference.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourceclaimparameters.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourceclaimparametersreference.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourceclaimschedulingstatus.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourceclaimspec.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourceclaimstatus.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourceclaimtemplate.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourceclaimtemplatespec.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourceclass.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourceclassparameters.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourceclassparametersreference.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourcefilter.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourcefiltermodel.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourcehandle.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourcemodel.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourcerequest.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourcerequestmodel.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourceslice.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha2/structuredresourcehandle.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha2/vendorparameters.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/storage/v1alpha1/volumeattributesclass.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/storagemigration/v1alpha1/groupversionresource.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/storagemigration/v1alpha1/migrationcondition.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/storagemigration/v1alpha1/storageversionmigration.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/storagemigration/v1alpha1/storageversionmigrationspec.go create mode 100644 vendor/k8s.io/client-go/applyconfigurations/storagemigration/v1alpha1/storageversionmigrationstatus.go create mode 100644 vendor/k8s.io/client-go/discovery/aggregated_discovery.go create mode 100644 vendor/k8s.io/client-go/features/envvar.go create mode 100644 vendor/k8s.io/client-go/features/features.go create mode 100644 vendor/k8s.io/client-go/features/known_features.go create mode 100644 vendor/k8s.io/client-go/informers/admissionregistration/v1/validatingadmissionpolicy.go create mode 100644 vendor/k8s.io/client-go/informers/admissionregistration/v1/validatingadmissionpolicybinding.go create mode 100644 vendor/k8s.io/client-go/informers/admissionregistration/v1alpha1/interface.go create mode 100644 vendor/k8s.io/client-go/informers/admissionregistration/v1alpha1/validatingadmissionpolicy.go create mode 100644 vendor/k8s.io/client-go/informers/admissionregistration/v1alpha1/validatingadmissionpolicybinding.go create mode 100644 vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/validatingadmissionpolicy.go create mode 100644 vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/validatingadmissionpolicybinding.go create mode 100644 vendor/k8s.io/client-go/informers/certificates/v1alpha1/clustertrustbundle.go create mode 100644 vendor/k8s.io/client-go/informers/certificates/v1alpha1/interface.go create mode 100644 vendor/k8s.io/client-go/informers/doc.go create mode 100644 vendor/k8s.io/client-go/informers/flowcontrol/v1/flowschema.go rename vendor/k8s.io/client-go/informers/flowcontrol/{v1alpha1 => v1}/interface.go (99%) create mode 100644 vendor/k8s.io/client-go/informers/flowcontrol/v1/prioritylevelconfiguration.go rename vendor/k8s.io/client-go/informers/flowcontrol/{v1alpha1 => v1beta3}/flowschema.go (83%) create mode 100644 vendor/k8s.io/client-go/informers/flowcontrol/v1beta3/interface.go rename vendor/k8s.io/client-go/informers/flowcontrol/{v1alpha1 => v1beta3}/prioritylevelconfiguration.go (81%) rename vendor/k8s.io/client-go/informers/{extensions/v1beta1/podsecuritypolicy.go => networking/v1alpha1/ipaddress.go} (50%) rename vendor/k8s.io/client-go/informers/networking/v1alpha1/{clustercidr.go => servicecidr.go} (69%) create mode 100644 vendor/k8s.io/client-go/informers/resource/interface.go create mode 100644 vendor/k8s.io/client-go/informers/resource/v1alpha2/interface.go create mode 100644 vendor/k8s.io/client-go/informers/resource/v1alpha2/podschedulingcontext.go create mode 100644 vendor/k8s.io/client-go/informers/resource/v1alpha2/resourceclaim.go create mode 100644 vendor/k8s.io/client-go/informers/resource/v1alpha2/resourceclaimparameters.go create mode 100644 vendor/k8s.io/client-go/informers/resource/v1alpha2/resourceclaimtemplate.go rename vendor/k8s.io/client-go/informers/{policy/v1beta1/podsecuritypolicy.go => resource/v1alpha2/resourceclass.go} (51%) create mode 100644 vendor/k8s.io/client-go/informers/resource/v1alpha2/resourceclassparameters.go create mode 100644 vendor/k8s.io/client-go/informers/resource/v1alpha2/resourceslice.go create mode 100644 vendor/k8s.io/client-go/informers/storage/v1alpha1/volumeattributesclass.go create mode 100644 vendor/k8s.io/client-go/informers/storagemigration/interface.go create mode 100644 vendor/k8s.io/client-go/informers/storagemigration/v1alpha1/interface.go create mode 100644 vendor/k8s.io/client-go/informers/storagemigration/v1alpha1/storageversionmigration.go create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/validatingadmissionpolicy.go create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/validatingadmissionpolicybinding.go create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/admissionregistration_client.go rename vendor/k8s.io/client-go/kubernetes/typed/{flowcontrol => admissionregistration}/v1alpha1/doc.go (100%) rename vendor/{sigs.k8s.io/controller-runtime/pkg/config/v1alpha1/doc.go => k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/generated_expansion.go} (73%) create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/validatingadmissionpolicy.go create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/validatingadmissionpolicybinding.go create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/validatingadmissionpolicy.go create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/validatingadmissionpolicybinding.go create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/selfsubjectreview.go create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authentication/v1alpha1/authentication_client.go create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authentication/v1alpha1/doc.go create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authentication/v1alpha1/generated_expansion.go create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authentication/v1alpha1/selfsubjectreview.go create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/selfsubjectreview.go create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/certificates_client.go create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/clustertrustbundle.go create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/doc.go create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/generated_expansion.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/podsecuritypolicy.go rename vendor/k8s.io/{apiextensions-apiserver/pkg/client/clientset/clientset => client-go/kubernetes/typed/flowcontrol/v1}/doc.go (88%) rename vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/{v1alpha1 => v1}/flowcontrol_client.go (64%) create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/flowschema.go rename vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/{v1alpha1 => v1}/generated_expansion.go (97%) create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/prioritylevelconfiguration.go rename vendor/k8s.io/{component-base/config => client-go/kubernetes/typed/flowcontrol/v1beta3}/doc.go (77%) create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta3/flowcontrol_client.go rename vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/{v1alpha1 => v1beta3}/flowschema.go (77%) create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta3/generated_expansion.go rename vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/{v1alpha1 => v1beta3}/prioritylevelconfiguration.go (74%) delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/networking/v1alpha1/clustercidr.go create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/networking/v1alpha1/ipaddress.go create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/networking/v1alpha1/servicecidr.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/podsecuritypolicy.go create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/doc.go create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/generated_expansion.go create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/podschedulingcontext.go create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/resource_client.go create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/resourceclaim.go create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/resourceclaimparameters.go create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/resourceclaimtemplate.go create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/resourceclass.go create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/resourceclassparameters.go create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/resourceslice.go create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/volumeattributesclass.go create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/storagemigration/v1alpha1/doc.go create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/storagemigration/v1alpha1/generated_expansion.go create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/storagemigration/v1alpha1/storagemigration_client.go create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/storagemigration/v1alpha1/storageversionmigration.go create mode 100644 vendor/k8s.io/client-go/listers/admissionregistration/v1/validatingadmissionpolicy.go create mode 100644 vendor/k8s.io/client-go/listers/admissionregistration/v1/validatingadmissionpolicybinding.go create mode 100644 vendor/k8s.io/client-go/listers/admissionregistration/v1alpha1/expansion_generated.go create mode 100644 vendor/k8s.io/client-go/listers/admissionregistration/v1alpha1/validatingadmissionpolicy.go create mode 100644 vendor/k8s.io/client-go/listers/admissionregistration/v1alpha1/validatingadmissionpolicybinding.go create mode 100644 vendor/k8s.io/client-go/listers/admissionregistration/v1beta1/validatingadmissionpolicy.go create mode 100644 vendor/k8s.io/client-go/listers/admissionregistration/v1beta1/validatingadmissionpolicybinding.go create mode 100644 vendor/k8s.io/client-go/listers/certificates/v1alpha1/clustertrustbundle.go create mode 100644 vendor/k8s.io/client-go/listers/certificates/v1alpha1/expansion_generated.go delete mode 100644 vendor/k8s.io/client-go/listers/extensions/v1beta1/podsecuritypolicy.go rename vendor/k8s.io/client-go/listers/flowcontrol/{v1alpha1 => v1}/expansion_generated.go (98%) rename vendor/k8s.io/client-go/listers/flowcontrol/{v1alpha1 => v1}/flowschema.go (79%) rename vendor/k8s.io/client-go/listers/flowcontrol/{v1alpha1 => v1}/prioritylevelconfiguration.go (79%) create mode 100644 vendor/k8s.io/client-go/listers/flowcontrol/v1beta3/expansion_generated.go create mode 100644 vendor/k8s.io/client-go/listers/flowcontrol/v1beta3/flowschema.go create mode 100644 vendor/k8s.io/client-go/listers/flowcontrol/v1beta3/prioritylevelconfiguration.go create mode 100644 vendor/k8s.io/client-go/listers/networking/v1alpha1/ipaddress.go rename vendor/k8s.io/client-go/listers/networking/v1alpha1/{clustercidr.go => servicecidr.go} (54%) delete mode 100644 vendor/k8s.io/client-go/listers/policy/v1beta1/podsecuritypolicy.go create mode 100644 vendor/k8s.io/client-go/listers/resource/v1alpha2/expansion_generated.go create mode 100644 vendor/k8s.io/client-go/listers/resource/v1alpha2/podschedulingcontext.go create mode 100644 vendor/k8s.io/client-go/listers/resource/v1alpha2/resourceclaim.go create mode 100644 vendor/k8s.io/client-go/listers/resource/v1alpha2/resourceclaimparameters.go create mode 100644 vendor/k8s.io/client-go/listers/resource/v1alpha2/resourceclaimtemplate.go create mode 100644 vendor/k8s.io/client-go/listers/resource/v1alpha2/resourceclass.go create mode 100644 vendor/k8s.io/client-go/listers/resource/v1alpha2/resourceclassparameters.go create mode 100644 vendor/k8s.io/client-go/listers/resource/v1alpha2/resourceslice.go create mode 100644 vendor/k8s.io/client-go/listers/storage/v1alpha1/volumeattributesclass.go create mode 100644 vendor/k8s.io/client-go/listers/storagemigration/v1alpha1/expansion_generated.go create mode 100644 vendor/k8s.io/client-go/listers/storagemigration/v1alpha1/storageversionmigration.go create mode 100644 vendor/k8s.io/client-go/openapi/OWNERS create mode 100644 vendor/k8s.io/client-go/openapi/typeconverter.go create mode 100644 vendor/k8s.io/client-go/testing/actions.go create mode 100644 vendor/k8s.io/client-go/testing/fake.go create mode 100644 vendor/k8s.io/client-go/testing/fixture.go create mode 100644 vendor/k8s.io/client-go/testing/interface.go create mode 100644 vendor/k8s.io/client-go/tools/cache/object-names.go create mode 100644 vendor/k8s.io/client-go/tools/cache/reflector_data_consistency_detector.go create mode 100644 vendor/k8s.io/client-go/tools/cache/synctrack/lazy.go create mode 100644 vendor/k8s.io/client-go/tools/cache/synctrack/synctrack.go create mode 100644 vendor/k8s.io/client-go/tools/internal/events/interfaces.go delete mode 100644 vendor/k8s.io/client-go/tools/leaderelection/resourcelock/configmaplock.go delete mode 100644 vendor/k8s.io/client-go/tools/leaderelection/resourcelock/endpointslock.go create mode 100644 vendor/k8s.io/client-go/transport/cache_go118.go create mode 100644 vendor/k8s.io/cloud-provider/api/retry_error.go create mode 100644 vendor/k8s.io/component-base/cli/flag/ciphersuites_flag.go create mode 100644 vendor/k8s.io/component-base/cli/flag/colon_separated_multimap_string_string.go create mode 100644 vendor/k8s.io/component-base/cli/flag/configuration_map.go create mode 100644 vendor/k8s.io/component-base/cli/flag/flags.go create mode 100644 vendor/k8s.io/component-base/cli/flag/langle_separated_map_string_string.go create mode 100644 vendor/k8s.io/component-base/cli/flag/map_string_bool.go create mode 100644 vendor/k8s.io/component-base/cli/flag/map_string_string.go create mode 100644 vendor/k8s.io/component-base/cli/flag/namedcertkey_flag.go rename vendor/{sigs.k8s.io/controller-runtime/pkg/runtime/inject/doc.go => k8s.io/component-base/cli/flag/noop.go} (60%) rename vendor/{github.com/aws/karpenter-core/pkg/operator/scheme/scheme.go => k8s.io/component-base/cli/flag/omitempty.go} (62%) create mode 100644 vendor/k8s.io/component-base/cli/flag/sectioned.go create mode 100644 vendor/k8s.io/component-base/cli/flag/string_flag.go create mode 100644 vendor/k8s.io/component-base/cli/flag/string_slice_flag.go create mode 100644 vendor/k8s.io/component-base/cli/flag/tristate.go delete mode 100644 vendor/k8s.io/component-base/config/types.go delete mode 100644 vendor/k8s.io/component-base/config/v1alpha1/conversion.go delete mode 100644 vendor/k8s.io/component-base/config/v1alpha1/defaults.go delete mode 100644 vendor/k8s.io/component-base/config/v1alpha1/register.go delete mode 100644 vendor/k8s.io/component-base/config/v1alpha1/types.go delete mode 100644 vendor/k8s.io/component-base/config/v1alpha1/zz_generated.conversion.go delete mode 100644 vendor/k8s.io/component-base/config/v1alpha1/zz_generated.deepcopy.go create mode 100644 vendor/k8s.io/klog/v2/.golangci.yaml create mode 100644 vendor/k8s.io/klog/v2/contextual_slog.go create mode 100644 vendor/k8s.io/klog/v2/internal/serialize/keyvalues_no_slog.go create mode 100644 vendor/k8s.io/klog/v2/internal/serialize/keyvalues_slog.go create mode 100644 vendor/k8s.io/klog/v2/internal/sloghandler/sloghandler_slog.go rename pkg/providers/pricing/client/filter.go => vendor/k8s.io/klog/v2/k8s_references_slog.go (53%) create mode 100644 vendor/k8s.io/klog/v2/klogr_slog.go create mode 100644 vendor/k8s.io/klog/v2/safeptr.go delete mode 100644 vendor/k8s.io/kube-openapi/pkg/builder3/util/util.go delete mode 100644 vendor/k8s.io/kube-openapi/pkg/openapiconv/convert.go delete mode 100644 vendor/k8s.io/kube-openapi/pkg/schemamutation/walker.go delete mode 100644 vendor/k8s.io/kube-openapi/pkg/validation/spec/fuzz.go delete mode 100644 vendor/k8s.io/utils/integer/integer.go create mode 100644 vendor/k8s.io/utils/ptr/OWNERS create mode 100644 vendor/k8s.io/utils/ptr/README.md create mode 100644 vendor/k8s.io/utils/ptr/ptr.go create mode 100644 vendor/knative.dev/pkg/apis/duck/v1/auth_types.go create mode 100644 vendor/knative.dev/pkg/client/injection/apiextensions/client/client.go create mode 100644 vendor/knative.dev/pkg/client/injection/apiextensions/informers/apiextensions/v1/customresourcedefinition/customresourcedefinition.go create mode 100644 vendor/knative.dev/pkg/client/injection/apiextensions/informers/factory/factory.go delete mode 100644 vendor/knative.dev/pkg/client/injection/kube/client/client_expansion.go delete mode 100644 vendor/knative.dev/pkg/injection/clients/dynamicclient/dynamicclient.go create mode 100644 vendor/knative.dev/pkg/injection/clients/namespacedkube/informers/core/v1/secret/secret.go create mode 100644 vendor/knative.dev/pkg/webhook/certificates/certificates.go create mode 100644 vendor/knative.dev/pkg/webhook/certificates/controller.go create mode 100644 vendor/knative.dev/pkg/webhook/resourcesemantics/conversion/controller.go create mode 100644 vendor/knative.dev/pkg/webhook/resourcesemantics/conversion/conversion.go create mode 100644 vendor/knative.dev/pkg/webhook/resourcesemantics/conversion/options.go create mode 100644 vendor/knative.dev/pkg/webhook/resourcesemantics/conversion/reconciler.go create mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/cache/delegating_by_gvk_cache.go delete mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/cache/internal/deleg_map.go delete mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/cache/internal/disabledeepcopy.go create mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/cache/internal/informers.go delete mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/cache/internal/informers_map.go delete mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/cache/internal/transformers.go delete mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/client/apiutil/dynamicrestmapper.go create mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/client/apiutil/errors.go create mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/client/apiutil/restmapper.go rename vendor/sigs.k8s.io/controller-runtime/pkg/client/{client_cache.go => client_rest_resources.go} (82%) create mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/client/fake/client.go create mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/client/fake/doc.go create mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/client/fieldowner.go create mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/client/interceptor/intercept.go delete mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/client/split.go delete mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/config/config.go create mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/config/controller.go delete mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/config/doc.go delete mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/config/v1alpha1/register.go delete mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/config/v1alpha1/types.go delete mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/config/v1alpha1/zz_generated.deepcopy.go create mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/controller/controllertest/doc.go create mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/controller/controllertest/testing.go create mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/controller/controllertest/unconventionallisttypecrd.go create mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/controller/controllertest/util.go create mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/internal/field/selector/utils.go rename vendor/sigs.k8s.io/controller-runtime/pkg/{source/internal/eventsource.go => internal/source/event_handler.go} (61%) create mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/internal/source/kind.go create mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/internal/syncs/syncs.go create mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/internal/testing/process/procattr_other.go create mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/internal/testing/process/procattr_unix.go create mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/manager/server.go create mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/metrics/leaderelection.go delete mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/metrics/listener.go rename vendor/{github.com/aws/karpenter-core/pkg/utils/pretty/pretty.go => sigs.k8s.io/controller-runtime/pkg/metrics/server/doc.go} (71%) create mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/metrics/server/server.go delete mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/runtime/inject/inject.go delete mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/webhook/admission/inject.go create mode 100644 vendor/sigs.k8s.io/karpenter/LICENSE create mode 100644 vendor/sigs.k8s.io/karpenter/NOTICE create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/apis/apis.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/apis/crds/karpenter.sh_nodeclaims.yaml create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/apis/crds/karpenter.sh_nodepools.yaml create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/apis/v1/doc.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/apis/v1/duration.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/apis/v1/labels.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/apis/v1/nodeclaim.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/apis/v1/nodeclaim_conversion.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/apis/v1/nodeclaim_defaults.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/apis/v1/nodeclaim_status.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/apis/v1/nodeclaim_validation.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/apis/v1/nodepool.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/apis/v1/nodepool_conversion.go rename vendor/{github.com/aws/karpenter-core/pkg/apis/v1alpha5/provisioner_defaults.go => sigs.k8s.io/karpenter/pkg/apis/v1/nodepool_defaults.go} (80%) create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/apis/v1/nodepool_status.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/apis/v1/nodepool_validation.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/apis/v1/taints.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/apis/v1/zz_generated.deepcopy.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/apis/v1beta1/doc.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/apis/v1beta1/duration.go rename vendor/{github.com/aws/karpenter-core/pkg/apis/v1alpha5 => sigs.k8s.io/karpenter/pkg/apis/v1beta1}/labels.go (69%) rename vendor/{github.com/aws/karpenter-core/pkg/apis/v1alpha5/machine.go => sigs.k8s.io/karpenter/pkg/apis/v1beta1/nodeclaim.go} (51%) create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/apis/v1beta1/nodeclaim_conversion.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/apis/v1beta1/nodeclaim_defaults.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/apis/v1beta1/nodeclaim_status.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/apis/v1beta1/nodeclaim_validation.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/apis/v1beta1/nodepool.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/apis/v1beta1/nodepool_conversion.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/apis/v1beta1/nodepool_defaults.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/apis/v1beta1/nodepool_status.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/apis/v1beta1/nodepool_validation.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/apis/v1beta1/taints.go rename vendor/{github.com/aws/karpenter-core/pkg/apis/v1alpha5 => sigs.k8s.io/karpenter/pkg/apis/v1beta1}/zz_generated.deepcopy.go (63%) rename vendor/{github.com/aws/karpenter-core => sigs.k8s.io/karpenter}/pkg/cloudprovider/metrics/cloudprovider.go (58%) create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/cloudprovider/types.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/controllers/controllers.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/controllers/disruption/consolidation.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/controllers/disruption/controller.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/controllers/disruption/drift.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/controllers/disruption/emptiness.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/controllers/disruption/events/events.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/controllers/disruption/helpers.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/controllers/disruption/metrics.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/controllers/disruption/multinodeconsolidation.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/controllers/disruption/orchestration/metrics.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/controllers/disruption/orchestration/queue.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/controllers/disruption/singlenodeconsolidation.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/controllers/disruption/types.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/controllers/disruption/validation.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/controllers/leasegarbagecollection/controller.go rename vendor/{github.com/aws/karpenter-core/pkg/controllers/provisioning => sigs.k8s.io/karpenter/pkg/controllers/leasegarbagecollection}/metrics.go (60%) create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/controllers/metrics/node/controller.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/controllers/metrics/nodepool/controller.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/controllers/metrics/pod/controller.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/controllers/migration/crd/controller.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/controllers/migration/resource/controller.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/controllers/node/termination/controller.go rename vendor/{github.com/aws/karpenter-core/pkg/controllers => sigs.k8s.io/karpenter/pkg/controllers/node}/termination/metrics.go (71%) create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/controllers/node/termination/terminator/events/events.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/controllers/node/termination/terminator/eviction.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/controllers/node/termination/terminator/terminator.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/controllers/nodeclaim/consistency/controller.go rename vendor/{github.com/aws/karpenter-core/pkg/controllers => sigs.k8s.io/karpenter/pkg/controllers/nodeclaim}/consistency/events.go (64%) rename vendor/{github.com/aws/karpenter-core/pkg/controllers => sigs.k8s.io/karpenter/pkg/controllers/nodeclaim}/consistency/nodeshape.go (55%) rename vendor/{github.com/aws/karpenter-core/pkg/controllers => sigs.k8s.io/karpenter/pkg/controllers/nodeclaim}/consistency/termination.go (61%) create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/controllers/nodeclaim/disruption/consolidation.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/controllers/nodeclaim/disruption/controller.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/controllers/nodeclaim/disruption/drift.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/controllers/nodeclaim/expiration/controller.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/controllers/nodeclaim/garbagecollection/controller.go rename vendor/{github.com/aws/karpenter-core/pkg/controllers/machine => sigs.k8s.io/karpenter/pkg/controllers/nodeclaim}/lifecycle/controller.go (58%) create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/controllers/nodeclaim/lifecycle/events.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/controllers/nodeclaim/lifecycle/initialization.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/controllers/nodeclaim/lifecycle/launch.go rename vendor/{github.com/aws/karpenter-core/pkg/controllers/machine => sigs.k8s.io/karpenter/pkg/controllers/nodeclaim}/lifecycle/liveness.go (51%) create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/controllers/nodeclaim/lifecycle/registration.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/controllers/nodeclaim/podevents/controller.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/controllers/nodeclaim/termination/controller.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/controllers/nodeclaim/termination/metrics.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/controllers/nodepool/counter/controller.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/controllers/nodepool/hash/controller.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/controllers/nodepool/readiness/controller.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/controllers/nodepool/validation/controller.go rename vendor/{github.com/aws/karpenter-core => sigs.k8s.io/karpenter}/pkg/controllers/provisioning/batcher.go (87%) create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/controllers/provisioning/controller.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/controllers/provisioning/provisioner.go rename vendor/{github.com/aws/karpenter-core/pkg/controllers/provisioning/scheduling/events => sigs.k8s.io/karpenter/pkg/controllers/provisioning/scheduling}/events.go (72%) rename vendor/{github.com/aws/karpenter-core => sigs.k8s.io/karpenter}/pkg/controllers/provisioning/scheduling/existingnode.go (72%) create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/controllers/provisioning/scheduling/metrics.go rename vendor/{github.com/aws/karpenter-core/pkg/controllers/provisioning/scheduling/machine.go => sigs.k8s.io/karpenter/pkg/controllers/provisioning/scheduling/nodeclaim.go} (64%) create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/controllers/provisioning/scheduling/nodeclaimtemplate.go rename vendor/{github.com/aws/karpenter-core => sigs.k8s.io/karpenter}/pkg/controllers/provisioning/scheduling/preferences.go (82%) rename vendor/{github.com/aws/karpenter-core => sigs.k8s.io/karpenter}/pkg/controllers/provisioning/scheduling/queue.go (97%) create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/controllers/provisioning/scheduling/scheduler.go rename vendor/{github.com/aws/karpenter-core => sigs.k8s.io/karpenter}/pkg/controllers/provisioning/scheduling/topology.go (81%) rename vendor/{github.com/aws/karpenter-core => sigs.k8s.io/karpenter}/pkg/controllers/provisioning/scheduling/topologygroup.go (82%) rename vendor/{github.com/aws/karpenter-core => sigs.k8s.io/karpenter}/pkg/controllers/provisioning/scheduling/topologynodefilter.go (88%) rename vendor/{github.com/aws/karpenter-core => sigs.k8s.io/karpenter}/pkg/controllers/provisioning/scheduling/volumetopology.go (64%) rename vendor/{github.com/aws/karpenter-core => sigs.k8s.io/karpenter}/pkg/controllers/state/cluster.go (51%) rename vendor/{github.com/aws/karpenter-core => sigs.k8s.io/karpenter}/pkg/controllers/state/informer/daemonset.go (63%) rename vendor/{github.com/aws/karpenter-core => sigs.k8s.io/karpenter}/pkg/controllers/state/informer/node.go (76%) rename vendor/{github.com/aws/karpenter-core/pkg/controllers/state/informer/machine.go => sigs.k8s.io/karpenter/pkg/controllers/state/informer/nodeclaim.go} (50%) rename vendor/{github.com/aws/karpenter-core/pkg/controllers/state/informer/provisioner.go => sigs.k8s.io/karpenter/pkg/controllers/state/informer/nodepool.go} (51%) rename vendor/{github.com/aws/karpenter-core => sigs.k8s.io/karpenter}/pkg/controllers/state/informer/pod.go (77%) create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/controllers/state/metrics.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/controllers/state/statenode.go rename vendor/{github.com/aws/karpenter-core => sigs.k8s.io/karpenter}/pkg/controllers/state/zz_generated.deepcopy.go (75%) rename vendor/{github.com/aws/karpenter-core => sigs.k8s.io/karpenter}/pkg/events/recorder.go (98%) rename vendor/{github.com/aws/karpenter-core => sigs.k8s.io/karpenter}/pkg/metrics/constants.go (84%) create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/metrics/metrics.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/metrics/store.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/metrics/workqueue_provider.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/operator/injection/injection.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/operator/logging/logging.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/operator/operator.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/operator/options/injectable.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/operator/options/options.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/scheduling/hostportusage.go rename vendor/{github.com/aws/karpenter-core => sigs.k8s.io/karpenter}/pkg/scheduling/requirement.go (55%) create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/scheduling/requirements.go rename vendor/{github.com/aws/karpenter-core => sigs.k8s.io/karpenter}/pkg/scheduling/taints.go (51%) create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/scheduling/volumeusage.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/scheduling/zz_generated.deepcopy.go rename vendor/{github.com/aws/karpenter-core => sigs.k8s.io/karpenter}/pkg/test/cachesyncingclient.go (93%) rename vendor/{github.com/aws/karpenter-core => sigs.k8s.io/karpenter}/pkg/test/daemonsets.go (98%) rename vendor/{github.com/aws/karpenter-core => sigs.k8s.io/karpenter}/pkg/test/deployment.go (89%) rename vendor/{github.com/aws/karpenter-core => sigs.k8s.io/karpenter}/pkg/test/environment.go (67%) rename vendor/{github.com/aws/karpenter-core => sigs.k8s.io/karpenter}/pkg/test/eventrecorder.go (96%) rename vendor/{github.com/aws/karpenter-core => sigs.k8s.io/karpenter}/pkg/test/metadata.go (85%) rename vendor/{github.com/aws/karpenter-core => sigs.k8s.io/karpenter}/pkg/test/namespace.go (97%) rename vendor/{github.com/aws/karpenter-core/pkg/test/machine.go => sigs.k8s.io/karpenter/pkg/test/nodeclaim.go} (51%) create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/test/nodeclass.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/test/nodepool.go rename vendor/{github.com/aws/karpenter-core => sigs.k8s.io/karpenter}/pkg/test/nodes.go (56%) create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/test/options.go rename vendor/{github.com/aws/karpenter-core => sigs.k8s.io/karpenter}/pkg/test/pods.go (59%) rename vendor/{github.com/aws/karpenter-core => sigs.k8s.io/karpenter}/pkg/test/randomdelay.go (98%) rename vendor/{github.com/aws/karpenter-core => sigs.k8s.io/karpenter}/pkg/test/replicaset.go (98%) create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/test/statefulsets.go rename vendor/{github.com/aws/karpenter-core => sigs.k8s.io/karpenter}/pkg/test/storage.go (61%) create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/test/v1alpha1/crds/karpenter.test.sh_testnodeclasses.yaml rename {pkg/apis => vendor/sigs.k8s.io/karpenter/pkg/test}/v1alpha1/doc.go (60%) create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/test/v1alpha1/testnodeclass.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/test/v1alpha1/testnodeclass_status.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/test/v1alpha1/zz_generated.deepcopy.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/utils/disruption/disruption.go rename vendor/{github.com/aws/karpenter-core => sigs.k8s.io/karpenter}/pkg/utils/env/env.go (86%) create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/utils/node/node.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/utils/nodeclaim/nodeclaim.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/utils/nodepool/nodepool.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/utils/pdb/pdb.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/utils/pod/scheduling.go rename vendor/{github.com/aws/karpenter-core => sigs.k8s.io/karpenter}/pkg/utils/pretty/changemonitor.go (85%) create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/utils/pretty/pretty.go rename vendor/{github.com/aws/karpenter-core => sigs.k8s.io/karpenter}/pkg/utils/resources/resources.go (50%) rename vendor/{github.com/aws/karpenter-core => sigs.k8s.io/karpenter}/pkg/utils/result/result.go (96%) create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/utils/termination/termination.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/utils/volume/volume.go create mode 100644 vendor/sigs.k8s.io/karpenter/pkg/webhooks/webhooks.go create mode 100644 vendor/sigs.k8s.io/structured-merge-diff/v4/merge/conflict.go create mode 100644 vendor/sigs.k8s.io/structured-merge-diff/v4/merge/update.go create mode 100644 vendor/sigs.k8s.io/structured-merge-diff/v4/typed/compare.go delete mode 100644 vendor/sigs.k8s.io/structured-merge-diff/v4/typed/union.go rename vendor/{github.com/matttproud/golang_protobuf_extensions => sigs.k8s.io/yaml/goyaml.v2}/LICENSE (100%) rename vendor/{github.com/deckarep/golang-set/LICENSE => sigs.k8s.io/yaml/goyaml.v2/LICENSE.libyaml} (77%) rename vendor/{github.com/aws/karpenter-core/pkg/controllers/metrics/state/scraper/scraper.go => sigs.k8s.io/yaml/goyaml.v2/NOTICE} (84%) create mode 100644 vendor/sigs.k8s.io/yaml/goyaml.v2/OWNERS create mode 100644 vendor/sigs.k8s.io/yaml/goyaml.v2/README.md create mode 100644 vendor/sigs.k8s.io/yaml/goyaml.v2/apic.go create mode 100644 vendor/sigs.k8s.io/yaml/goyaml.v2/decode.go create mode 100644 vendor/sigs.k8s.io/yaml/goyaml.v2/emitterc.go create mode 100644 vendor/sigs.k8s.io/yaml/goyaml.v2/encode.go create mode 100644 vendor/sigs.k8s.io/yaml/goyaml.v2/parserc.go create mode 100644 vendor/sigs.k8s.io/yaml/goyaml.v2/readerc.go create mode 100644 vendor/sigs.k8s.io/yaml/goyaml.v2/resolve.go create mode 100644 vendor/sigs.k8s.io/yaml/goyaml.v2/scannerc.go create mode 100644 vendor/sigs.k8s.io/yaml/goyaml.v2/sorter.go create mode 100644 vendor/sigs.k8s.io/yaml/goyaml.v2/writerc.go create mode 100644 vendor/sigs.k8s.io/yaml/goyaml.v2/yaml.go create mode 100644 vendor/sigs.k8s.io/yaml/goyaml.v2/yamlh.go create mode 100644 vendor/sigs.k8s.io/yaml/goyaml.v2/yamlprivateh.go diff --git a/.github/workflows/markdown-link-check.yml b/.github/workflows/markdown-link-check.yml index 00e6c44f..668be36e 100644 --- a/.github/workflows/markdown-link-check.yml +++ b/.github/workflows/markdown-link-check.yml @@ -17,4 +17,6 @@ jobs: use-quiet-mode: 'yes' # this will show detailed HTTP status for checked links use-verbose-mode: 'yes' - config-file: '.github/markdown.links.config.json' + folder-path: '.' + check-modified-files-only: 'yes' + base-branch: 'main' diff --git a/.gitignore b/.gitignore index 525df9cd..fcb065dd 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,4 @@ _output/ /hack/tools/bin/ /coverage.txt /coverage.out +gpu-provisioner-values.yaml diff --git a/.golangci.yaml b/.golangci.yaml index a09702cd..02d42db4 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -1,10 +1,9 @@ run: - deadline: 10m + timeout: 15m linters: disable-all: true enable: - - deadcode - gosimple - govet - ineffassign @@ -12,9 +11,11 @@ linters: - nakedret - nilerr - prealloc - - structcheck - typecheck - unused - - varcheck + - gci + - gofmt + - goimports + - staticcheck # Run with --fast=false for more extensive checks fast: true diff --git a/Dockerfile b/Dockerfile index 2a7d7cc3..cf89025a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,6 +2,7 @@ FROM --platform=$BUILDPLATFORM golang:1.22 as builder ARG TARGETOS ARG TARGETARCH +ARG KARPENTERVER WORKDIR /workspace # Copy the Go Modules manifests @@ -27,7 +28,7 @@ COPY vendor/ vendor/ # by leaving it empty we can ensure that the container and binary shipped on it will have the same platform. RUN --mount=type=cache,target=${GOCACHE} \ --mount=type=cache,id=gpu-provisioner-controller,sharing=locked,target=/go/pkg/mod \ - CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} GO111MODULE=on go build -a -o manager cmd/main.go + CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} GO111MODULE=on go build -a -o manager -ldflags "-X sigs.k8s.io/karpenter/pkg/operator.Version=${KARPENTERVER}" cmd/main.go # Use distroless as minimal base image to package the manager binary # Refer to https://github.com/GoogleContainerTools/distroless for more details diff --git a/Makefile b/Makefile index 615f8cab..d37d0049 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ endif TOOLS_DIR := hack/tools TOOLS_BIN_DIR := $(abspath $(TOOLS_DIR)/bin) -GOLANGCI_LINT_VER := v1.54.1 +GOLANGCI_LINT_VER := v1.61.0 GOLANGCI_LINT_BIN := golangci-lint GOLANGCI_LINT := $(abspath $(TOOLS_BIN_DIR)/$(GOLANGCI_LINT_BIN)-$(GOLANGCI_LINT_VER)) @@ -38,7 +38,9 @@ BUILD_DATE_VAR := $(REPO_PATH)/pkg/version.BuildDate BUILD_DATE := $$(date +%Y-%m-%d-%H:%M) GIT_VAR := $(REPO_PATH)/pkg/version.GitCommit GIT_HASH := $$(git rev-parse --short HEAD) -LDFLAGS ?= "-X $(BUILD_DATE_VAR)=$(BUILD_DATE) -X $(BUILD_VERSION_VAR)=$(IMAGE_VERSION) -X $(GIT_VAR)=$(GIT_HASH)" +KARPENTER_VERSION_KEY := sigs.k8s.io/karpenter/pkg/operator.Version +KARPENTER_VERSION_VAL := $(shell git describe --tags --always | cut -d"v" -f2) +LDFLAGS ?= "-X $(BUILD_DATE_VAR)=$(BUILD_DATE) -X $(BUILD_VERSION_VAR)=$(IMAGE_VERSION) -X $(GIT_VAR)=$(GIT_HASH) -X $(KARPENTER_VERSION_KEY)=$(KARPENTER_VERSION_VAL)" # AKS INT/Staging Test AZURE_SUBSCRIPTION_ID ?= ff05f55d-22b5-44a7-b704-f9a8efd493ed @@ -138,6 +140,7 @@ docker-build: docker-buildx --output=$(OUTPUT_TYPE) \ --platform="linux/$(ARCH)" \ --pull \ + --build-arg="KARPENTERVER=$(KARPENTER_VERSION_VAL)" \ --tag $(REGISTRY)/$(IMG_NAME):$(IMG_TAG) . diff --git a/charts/gpu-provisioner/crds/karpenter.sh_machines.yaml b/charts/gpu-provisioner/crds/karpenter.sh_machines.yaml deleted file mode 100644 index 0304d1fc..00000000 --- a/charts/gpu-provisioner/crds/karpenter.sh_machines.yaml +++ /dev/null @@ -1,293 +0,0 @@ ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.12.0 - name: machines.karpenter.sh -spec: - group: karpenter.sh - names: - categories: - - karpenter - kind: Machine - listKind: MachineList - plural: machines - singular: machine - scope: Cluster - versions: - - additionalPrinterColumns: - - jsonPath: .metadata.labels.node\.kubernetes\.io/instance-type - name: Type - type: string - - jsonPath: .metadata.labels.karpenter\.k8s\.azure/zone - name: Zone - type: string - - jsonPath: .status.nodeName - name: Node - type: string - - jsonPath: .status.conditions[?(@.type=="Ready")].status - name: Ready - type: string - - jsonPath: .metadata.creationTimestamp - name: Age - type: date - - jsonPath: .metadata.labels.karpenter\.sh/capacity-type - name: Capacity - priority: 1 - type: string - - jsonPath: .metadata.labels.karpenter\.sh/provisioner-name - name: Provisioner - priority: 1 - type: string - - jsonPath: .spec.machineTemplateRef.name - name: Template - priority: 1 - type: string - name: v1alpha5 - schema: - openAPIV3Schema: - description: Machine is the Schema for the Machines API - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: MachineSpec describes the desired state of the Machine - properties: - kubelet: - description: Kubelet are options passed to the kubelet when provisioning nodes - properties: - clusterDNS: - description: clusterDNS is a list of IP addresses for the cluster DNS server. Note that not all providers may use all addresses. - items: - type: string - type: array - containerRuntime: - description: ContainerRuntime is the container runtime to be used with your worker nodes. - type: string - cpuCFSQuota: - description: CPUCFSQuota enables CPU CFS quota enforcement for containers that specify CPU limits. - type: boolean - evictionHard: - additionalProperties: - type: string - description: EvictionHard is the map of signal names to quantities that define hard eviction thresholds - type: object - evictionMaxPodGracePeriod: - description: EvictionMaxPodGracePeriod is the maximum allowed grace period (in seconds) to use when terminating pods in response to soft eviction thresholds being met. - format: int32 - type: integer - evictionSoft: - additionalProperties: - type: string - description: EvictionSoft is the map of signal names to quantities that define soft eviction thresholds - type: object - evictionSoftGracePeriod: - additionalProperties: - type: string - description: EvictionSoftGracePeriod is the map of signal names to quantities that define grace periods for each eviction signal - type: object - imageGCHighThresholdPercent: - description: ImageGCHighThresholdPercent is the percent of disk usage after which image garbage collection is always run. The percent is calculated by dividing this field value by 100, so this field must be between 0 and 100, inclusive. When specified, the value must be greater than ImageGCLowThresholdPercent. - format: int32 - maximum: 100 - minimum: 0 - type: integer - imageGCLowThresholdPercent: - description: ImageGCLowThresholdPercent is the percent of disk usage before which image garbage collection is never run. Lowest disk usage to garbage collect to. The percent is calculated by dividing this field value by 100, so the field value must be between 0 and 100, inclusive. When specified, the value must be less than imageGCHighThresholdPercent - format: int32 - maximum: 100 - minimum: 0 - type: integer - kubeReserved: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: KubeReserved contains resources reserved for Kubernetes system components. - type: object - maxPods: - description: MaxPods is an override for the maximum number of pods that can run on a worker node instance. - format: int32 - minimum: 0 - type: integer - podsPerCore: - description: PodsPerCore is an override for the number of pods that can run on a worker node instance based on the number of cpu cores. This value cannot exceed MaxPods, so, if MaxPods is a lower value, that value will be used. - format: int32 - minimum: 0 - type: integer - systemReserved: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: SystemReserved contains resources reserved for OS system daemons and kernel memory. - type: object - type: object - machineTemplateRef: - description: MachineTemplateRef is a reference to an object that defines provider specific configuration - properties: - apiVersion: - description: API version of the referent - type: string - kind: - description: 'Kind of the referent; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds"' - type: string - name: - description: 'Name of the referent; More info: http://kubernetes.io/docs/user-guide/identifiers#names' - type: string - required: - - name - type: object - requirements: - description: Requirements are layered with Labels and applied to every node. - items: - description: A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - properties: - key: - description: The label key that the selector applies to. - type: string - operator: - description: Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. - type: string - values: - description: An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - resources: - description: Resources models the resource requirements for the Machine to launch - properties: - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: Requests describes the minimum required resources for the Machine to launch - type: object - type: object - startupTaints: - description: StartupTaints are taints that are applied to nodes upon startup which are expected to be removed automatically within a short period of time, typically by a DaemonSet that tolerates the taint. These are commonly used by daemonsets to allow initialization and enforce startup ordering. StartupTaints are ignored for provisioning purposes in that pods are not required to tolerate a StartupTaint in order to have nodes provisioned for them. - items: - description: The node this Taint is attached to has the "effect" on any pod that does not tolerate the Taint. - properties: - effect: - description: Required. The effect of the taint on pods that do not tolerate the taint. Valid effects are NoSchedule, PreferNoSchedule and NoExecute. - type: string - key: - description: Required. The taint key to be applied to a node. - type: string - timeAdded: - description: TimeAdded represents the time at which the taint was added. It is only written for NoExecute taints. - format: date-time - type: string - value: - description: The taint value corresponding to the taint key. - type: string - required: - - effect - - key - type: object - type: array - taints: - description: Taints will be applied to the machine's node. - items: - description: The node this Taint is attached to has the "effect" on any pod that does not tolerate the Taint. - properties: - effect: - description: Required. The effect of the taint on pods that do not tolerate the taint. Valid effects are NoSchedule, PreferNoSchedule and NoExecute. - type: string - key: - description: Required. The taint key to be applied to a node. - type: string - timeAdded: - description: TimeAdded represents the time at which the taint was added. It is only written for NoExecute taints. - format: date-time - type: string - value: - description: The taint value corresponding to the taint key. - type: string - required: - - effect - - key - type: object - type: array - type: object - status: - description: MachineStatus defines the observed state of Machine - properties: - allocatable: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: Allocatable is the estimated allocatable capacity of the machine - type: object - capacity: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: Capacity is the estimated full capacity of the machine - type: object - conditions: - description: Conditions contains signals for health and readiness - items: - description: 'Condition defines a readiness condition for a Knative resource. See: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties' - properties: - lastTransitionTime: - description: LastTransitionTime is the last time the condition transitioned from one status to another. We use VolatileTime in place of metav1.Time to exclude this from creating equality.Semantic differences (all other things held constant). - type: string - message: - description: A human readable message indicating details about the transition. - type: string - reason: - description: The reason for the condition's last transition. - type: string - severity: - description: Severity with which to treat failures of this type of condition. When this is not specified, it defaults to Error. - type: string - status: - description: Status of the condition, one of True, False, Unknown. - type: string - type: - description: Type of condition. - type: string - required: - - status - - type - type: object - type: array - nodeName: - description: NodeName is the name of the corresponding node object - type: string - providerID: - description: ProviderID of the corresponding node object - type: string - type: object - type: object - served: true - storage: true - subresources: - status: {} diff --git a/charts/gpu-provisioner/crds/karpenter.sh_nodeclaims.yaml b/charts/gpu-provisioner/crds/karpenter.sh_nodeclaims.yaml new file mode 100644 index 00000000..61b7c486 --- /dev/null +++ b/charts/gpu-provisioner/crds/karpenter.sh_nodeclaims.yaml @@ -0,0 +1,825 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.16.3 + name: nodeclaims.karpenter.sh +spec: + group: karpenter.sh + names: + categories: + - karpenter + kind: NodeClaim + listKind: NodeClaimList + plural: nodeclaims + singular: nodeclaim + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .metadata.labels.node\.kubernetes\.io/instance-type + name: Type + type: string + - jsonPath: .metadata.labels.karpenter\.sh/capacity-type + name: Capacity + type: string + - jsonPath: .metadata.labels.topology\.kubernetes\.io/zone + name: Zone + type: string + - jsonPath: .status.nodeName + name: Node + type: string + - jsonPath: .status.conditions[?(@.type=="Ready")].status + name: Ready + type: string + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + - jsonPath: .status.providerID + name: ID + priority: 1 + type: string + - jsonPath: .metadata.labels.karpenter\.sh/nodepool + name: NodePool + priority: 1 + type: string + - jsonPath: .spec.nodeClassRef.name + name: NodeClass + priority: 1 + type: string + name: v1 + schema: + openAPIV3Schema: + description: NodeClaim is the Schema for the NodeClaims API + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: NodeClaimSpec describes the desired state of the NodeClaim + properties: + expireAfter: + default: 720h + description: |- + ExpireAfter is the duration the controller will wait + before terminating a node, measured from when the node is created. This + is useful to implement features like eventually consistent node upgrade, + memory leak protection, and disruption testing. + pattern: ^(([0-9]+(s|m|h))+)|(Never)$ + type: string + nodeClassRef: + description: NodeClassRef is a reference to an object that defines provider specific configuration + properties: + group: + description: API version of the referent + pattern: ^[^/]*$ + type: string + kind: + description: 'Kind of the referent; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds"' + type: string + name: + description: 'Name of the referent; More info: http://kubernetes.io/docs/user-guide/identifiers#names' + type: string + required: + - group + - kind + - name + type: object + requirements: + description: Requirements are layered with GetLabels and applied to every node. + items: + description: |- + A node selector requirement with min values is a selector that contains values, a key, an operator that relates the key and values + and minValues that represent the requirement to have at least that many values. + properties: + key: + description: The label key that the selector applies to. + type: string + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*(\/))?([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$ + x-kubernetes-validations: + - message: label domain "kubernetes.io" is restricted + rule: self in ["beta.kubernetes.io/instance-type", "failure-domain.beta.kubernetes.io/region", "beta.kubernetes.io/os", "beta.kubernetes.io/arch", "failure-domain.beta.kubernetes.io/zone", "topology.kubernetes.io/zone", "topology.kubernetes.io/region", "node.kubernetes.io/instance-type", "kubernetes.io/arch", "kubernetes.io/os", "node.kubernetes.io/windows-build"] || self.find("^([^/]+)").endsWith("node.kubernetes.io") || self.find("^([^/]+)").endsWith("node-restriction.kubernetes.io") || !self.find("^([^/]+)").endsWith("kubernetes.io") + - message: label domain "k8s.io" is restricted + rule: self.find("^([^/]+)").endsWith("kops.k8s.io") || !self.find("^([^/]+)").endsWith("k8s.io") + - message: label domain "karpenter.sh" is restricted + rule: self in ["karpenter.sh/capacity-type", "karpenter.sh/nodepool"] || !self.find("^([^/]+)").endsWith("karpenter.sh") + - message: label "kubernetes.io/hostname" is restricted + rule: self != "kubernetes.io/hostname" + minValues: + description: |- + This field is ALPHA and can be dropped or replaced at any time + MinValues is the minimum number of unique values required to define the flexibility of the specific requirement. + maximum: 50 + minimum: 1 + type: integer + operator: + description: |- + Represents a key's relationship to a set of values. + Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. + type: string + enum: + - In + - NotIn + - Exists + - DoesNotExist + - Gt + - Lt + values: + description: |- + An array of string values. If the operator is In or NotIn, + the values array must be non-empty. If the operator is Exists or DoesNotExist, + the values array must be empty. If the operator is Gt or Lt, the values + array must have a single element, which will be interpreted as an integer. + This array is replaced during a strategic merge patch. + items: + type: string + type: array + x-kubernetes-list-type: atomic + maxLength: 63 + pattern: ^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$ + required: + - key + - operator + type: object + maxItems: 100 + type: array + x-kubernetes-validations: + - message: requirements with operator 'In' must have a value defined + rule: 'self.all(x, x.operator == ''In'' ? x.values.size() != 0 : true)' + - message: requirements operator 'Gt' or 'Lt' must have a single positive integer value + rule: 'self.all(x, (x.operator == ''Gt'' || x.operator == ''Lt'') ? (x.values.size() == 1 && int(x.values[0]) >= 0) : true)' + - message: requirements with 'minValues' must have at least that many values specified in the 'values' field + rule: 'self.all(x, (x.operator == ''In'' && has(x.minValues)) ? x.values.size() >= x.minValues : true)' + resources: + description: Resources models the resource requirements for the NodeClaim to launch + properties: + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: Requests describes the minimum required resources for the NodeClaim to launch + type: object + type: object + startupTaints: + description: |- + StartupTaints are taints that are applied to nodes upon startup which are expected to be removed automatically + within a short period of time, typically by a DaemonSet that tolerates the taint. These are commonly used by + daemonsets to allow initialization and enforce startup ordering. StartupTaints are ignored for provisioning + purposes in that pods are not required to tolerate a StartupTaint in order to have nodes provisioned for them. + items: + description: |- + The node this Taint is attached to has the "effect" on + any pod that does not tolerate the Taint. + properties: + effect: + description: |- + Required. The effect of the taint on pods + that do not tolerate the taint. + Valid effects are NoSchedule, PreferNoSchedule and NoExecute. + type: string + enum: + - NoSchedule + - PreferNoSchedule + - NoExecute + key: + description: Required. The taint key to be applied to a node. + type: string + minLength: 1 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*(\/))?([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$ + timeAdded: + description: |- + TimeAdded represents the time at which the taint was added. + It is only written for NoExecute taints. + format: date-time + type: string + value: + description: The taint value corresponding to the taint key. + type: string + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*(\/))?([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$ + required: + - effect + - key + type: object + type: array + taints: + description: Taints will be applied to the NodeClaim's node. + items: + description: |- + The node this Taint is attached to has the "effect" on + any pod that does not tolerate the Taint. + properties: + effect: + description: |- + Required. The effect of the taint on pods + that do not tolerate the taint. + Valid effects are NoSchedule, PreferNoSchedule and NoExecute. + type: string + enum: + - NoSchedule + - PreferNoSchedule + - NoExecute + key: + description: Required. The taint key to be applied to a node. + type: string + minLength: 1 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*(\/))?([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$ + timeAdded: + description: |- + TimeAdded represents the time at which the taint was added. + It is only written for NoExecute taints. + format: date-time + type: string + value: + description: The taint value corresponding to the taint key. + type: string + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*(\/))?([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$ + required: + - effect + - key + type: object + type: array + terminationGracePeriod: + description: |- + TerminationGracePeriod is the maximum duration the controller will wait before forcefully deleting the pods on a node, measured from when deletion is first initiated. + + Warning: this feature takes precedence over a Pod's terminationGracePeriodSeconds value, and bypasses any blocked PDBs or the karpenter.sh/do-not-disrupt annotation. + + This field is intended to be used by cluster administrators to enforce that nodes can be cycled within a given time period. + When set, drifted nodes will begin draining even if there are pods blocking eviction. Draining will respect PDBs and the do-not-disrupt annotation until the TGP is reached. + + Karpenter will preemptively delete pods so their terminationGracePeriodSeconds align with the node's terminationGracePeriod. + If a pod would be terminated without being granted its full terminationGracePeriodSeconds prior to the node timeout, + that pod will be deleted at T = node timeout - pod terminationGracePeriodSeconds. + + The feature can also be used to allow maximum time limits for long-running jobs which can delay node termination with preStop hooks. + If left undefined, the controller will wait indefinitely for pods to be drained. + pattern: ^([0-9]+(s|m|h))+$ + type: string + required: + - nodeClassRef + - requirements + type: object + x-kubernetes-validations: + - message: spec is immutable + rule: self == oldSelf + status: + description: NodeClaimStatus defines the observed state of NodeClaim + properties: + allocatable: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: Allocatable is the estimated allocatable capacity of the node + type: object + capacity: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: Capacity is the estimated full capacity of the node + type: object + conditions: + description: Conditions contains signals for health and readiness + items: + description: Condition aliases the upstream type and adds additional helper methods + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + pattern: ^([A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?|)$ + type: string + status: + description: status of the condition, one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - status + - type + type: object + type: array + imageID: + description: ImageID is an identifier for the image that runs on the node + type: string + lastPodEventTime: + description: |- + LastPodEventTime is updated with the last time a pod was scheduled + or removed from the node. A pod going terminal or terminating + is also considered as removed. + format: date-time + type: string + nodeName: + description: NodeName is the name of the corresponding node object + type: string + providerID: + description: ProviderID of the corresponding node object + type: string + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} + - additionalPrinterColumns: + - jsonPath: .metadata.labels.node\.kubernetes\.io/instance-type + name: Type + type: string + - jsonPath: .metadata.labels.topology\.kubernetes\.io/zone + name: Zone + type: string + - jsonPath: .status.nodeName + name: Node + type: string + - jsonPath: .status.conditions[?(@.type=="Ready")].status + name: Ready + type: string + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + - jsonPath: .metadata.labels.karpenter\.sh/capacity-type + name: Capacity + priority: 1 + type: string + - jsonPath: .metadata.labels.karpenter\.sh/nodepool + name: NodePool + priority: 1 + type: string + - jsonPath: .spec.nodeClassRef.name + name: NodeClass + priority: 1 + type: string + name: v1beta1 + schema: + openAPIV3Schema: + description: NodeClaim is the Schema for the NodeClaims API + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: NodeClaimSpec describes the desired state of the NodeClaim + properties: + kubelet: + description: |- + Kubelet defines args to be used when configuring kubelet on provisioned nodes. + They are a subset of the upstream types, recognizing not all options may be supported. + Wherever possible, the types and names should reflect the upstream kubelet types. + properties: + clusterDNS: + description: |- + clusterDNS is a list of IP addresses for the cluster DNS server. + Note that not all providers may use all addresses. + items: + type: string + type: array + cpuCFSQuota: + description: CPUCFSQuota enables CPU CFS quota enforcement for containers that specify CPU limits. + type: boolean + evictionHard: + additionalProperties: + type: string + pattern: ^((\d{1,2}(\.\d{1,2})?|100(\.0{1,2})?)%||(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?)$ + description: EvictionHard is the map of signal names to quantities that define hard eviction thresholds + type: object + x-kubernetes-validations: + - message: valid keys for evictionHard are ['memory.available','nodefs.available','nodefs.inodesFree','imagefs.available','imagefs.inodesFree','pid.available'] + rule: self.all(x, x in ['memory.available','nodefs.available','nodefs.inodesFree','imagefs.available','imagefs.inodesFree','pid.available']) + evictionMaxPodGracePeriod: + description: |- + EvictionMaxPodGracePeriod is the maximum allowed grace period (in seconds) to use when terminating pods in + response to soft eviction thresholds being met. + format: int32 + type: integer + evictionSoft: + additionalProperties: + type: string + pattern: ^((\d{1,2}(\.\d{1,2})?|100(\.0{1,2})?)%||(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?)$ + description: EvictionSoft is the map of signal names to quantities that define soft eviction thresholds + type: object + x-kubernetes-validations: + - message: valid keys for evictionSoft are ['memory.available','nodefs.available','nodefs.inodesFree','imagefs.available','imagefs.inodesFree','pid.available'] + rule: self.all(x, x in ['memory.available','nodefs.available','nodefs.inodesFree','imagefs.available','imagefs.inodesFree','pid.available']) + evictionSoftGracePeriod: + additionalProperties: + type: string + description: EvictionSoftGracePeriod is the map of signal names to quantities that define grace periods for each eviction signal + type: object + x-kubernetes-validations: + - message: valid keys for evictionSoftGracePeriod are ['memory.available','nodefs.available','nodefs.inodesFree','imagefs.available','imagefs.inodesFree','pid.available'] + rule: self.all(x, x in ['memory.available','nodefs.available','nodefs.inodesFree','imagefs.available','imagefs.inodesFree','pid.available']) + imageGCHighThresholdPercent: + description: |- + ImageGCHighThresholdPercent is the percent of disk usage after which image + garbage collection is always run. The percent is calculated by dividing this + field value by 100, so this field must be between 0 and 100, inclusive. + When specified, the value must be greater than ImageGCLowThresholdPercent. + format: int32 + maximum: 100 + minimum: 0 + type: integer + imageGCLowThresholdPercent: + description: |- + ImageGCLowThresholdPercent is the percent of disk usage before which image + garbage collection is never run. Lowest disk usage to garbage collect to. + The percent is calculated by dividing this field value by 100, + so the field value must be between 0 and 100, inclusive. + When specified, the value must be less than imageGCHighThresholdPercent + format: int32 + maximum: 100 + minimum: 0 + type: integer + kubeReserved: + additionalProperties: + type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + description: KubeReserved contains resources reserved for Kubernetes system components. + type: object + x-kubernetes-validations: + - message: valid keys for kubeReserved are ['cpu','memory','ephemeral-storage','pid'] + rule: self.all(x, x=='cpu' || x=='memory' || x=='ephemeral-storage' || x=='pid') + - message: kubeReserved value cannot be a negative resource quantity + rule: self.all(x, !self[x].startsWith('-')) + maxPods: + description: |- + MaxPods is an override for the maximum number of pods that can run on + a worker node instance. + format: int32 + minimum: 0 + type: integer + podsPerCore: + description: |- + PodsPerCore is an override for the number of pods that can run on a worker node + instance based on the number of cpu cores. This value cannot exceed MaxPods, so, if + MaxPods is a lower value, that value will be used. + format: int32 + minimum: 0 + type: integer + systemReserved: + additionalProperties: + type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + description: SystemReserved contains resources reserved for OS system daemons and kernel memory. + type: object + x-kubernetes-validations: + - message: valid keys for systemReserved are ['cpu','memory','ephemeral-storage','pid'] + rule: self.all(x, x=='cpu' || x=='memory' || x=='ephemeral-storage' || x=='pid') + - message: systemReserved value cannot be a negative resource quantity + rule: self.all(x, !self[x].startsWith('-')) + type: object + x-kubernetes-validations: + - message: imageGCHighThresholdPercent must be greater than imageGCLowThresholdPercent + rule: 'has(self.imageGCHighThresholdPercent) && has(self.imageGCLowThresholdPercent) ? self.imageGCHighThresholdPercent > self.imageGCLowThresholdPercent : true' + - message: evictionSoft OwnerKey does not have a matching evictionSoftGracePeriod + rule: has(self.evictionSoft) ? self.evictionSoft.all(e, (e in self.evictionSoftGracePeriod)):true + - message: evictionSoftGracePeriod OwnerKey does not have a matching evictionSoft + rule: has(self.evictionSoftGracePeriod) ? self.evictionSoftGracePeriod.all(e, (e in self.evictionSoft)):true + nodeClassRef: + description: NodeClassRef is a reference to an object that defines provider specific configuration + properties: + apiVersion: + description: API version of the referent + type: string + kind: + description: 'Kind of the referent; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds"' + type: string + name: + description: 'Name of the referent; More info: http://kubernetes.io/docs/user-guide/identifiers#names' + type: string + required: + - name + type: object + requirements: + description: Requirements are layered with GetLabels and applied to every node. + items: + description: |- + A node selector requirement with min values is a selector that contains values, a key, an operator that relates the key and values + and minValues that represent the requirement to have at least that many values. + properties: + key: + description: The label key that the selector applies to. + type: string + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*(\/))?([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$ + x-kubernetes-validations: + - message: label domain "kubernetes.io" is restricted + rule: self in ["beta.kubernetes.io/instance-type", "failure-domain.beta.kubernetes.io/region", "beta.kubernetes.io/os", "beta.kubernetes.io/arch", "failure-domain.beta.kubernetes.io/zone", "topology.kubernetes.io/zone", "topology.kubernetes.io/region", "node.kubernetes.io/instance-type", "kubernetes.io/arch", "kubernetes.io/os", "node.kubernetes.io/windows-build"] || self.find("^([^/]+)").endsWith("node.kubernetes.io") || self.find("^([^/]+)").endsWith("node-restriction.kubernetes.io") || !self.find("^([^/]+)").endsWith("kubernetes.io") + - message: label domain "k8s.io" is restricted + rule: self.find("^([^/]+)").endsWith("kops.k8s.io") || !self.find("^([^/]+)").endsWith("k8s.io") + - message: label domain "karpenter.sh" is restricted + rule: self in ["karpenter.sh/capacity-type", "karpenter.sh/nodepool"] || !self.find("^([^/]+)").endsWith("karpenter.sh") + - message: label "kubernetes.io/hostname" is restricted + rule: self != "kubernetes.io/hostname" + minValues: + description: |- + This field is ALPHA and can be dropped or replaced at any time + MinValues is the minimum number of unique values required to define the flexibility of the specific requirement. + maximum: 50 + minimum: 1 + type: integer + operator: + description: |- + Represents a key's relationship to a set of values. + Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. + type: string + enum: + - In + - NotIn + - Exists + - DoesNotExist + - Gt + - Lt + values: + description: |- + An array of string values. If the operator is In or NotIn, + the values array must be non-empty. If the operator is Exists or DoesNotExist, + the values array must be empty. If the operator is Gt or Lt, the values + array must have a single element, which will be interpreted as an integer. + This array is replaced during a strategic merge patch. + items: + type: string + type: array + x-kubernetes-list-type: atomic + maxLength: 63 + pattern: ^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$ + required: + - key + - operator + type: object + maxItems: 100 + type: array + x-kubernetes-validations: + - message: requirements with operator 'In' must have a value defined + rule: 'self.all(x, x.operator == ''In'' ? x.values.size() != 0 : true)' + - message: requirements operator 'Gt' or 'Lt' must have a single positive integer value + rule: 'self.all(x, (x.operator == ''Gt'' || x.operator == ''Lt'') ? (x.values.size() == 1 && int(x.values[0]) >= 0) : true)' + - message: requirements with 'minValues' must have at least that many values specified in the 'values' field + rule: 'self.all(x, (x.operator == ''In'' && has(x.minValues)) ? x.values.size() >= x.minValues : true)' + resources: + description: Resources models the resource requirements for the NodeClaim to launch + properties: + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: Requests describes the minimum required resources for the NodeClaim to launch + type: object + type: object + startupTaints: + description: |- + StartupTaints are taints that are applied to nodes upon startup which are expected to be removed automatically + within a short period of time, typically by a DaemonSet that tolerates the taint. These are commonly used by + daemonsets to allow initialization and enforce startup ordering. StartupTaints are ignored for provisioning + purposes in that pods are not required to tolerate a StartupTaint in order to have nodes provisioned for them. + items: + description: |- + The node this Taint is attached to has the "effect" on + any pod that does not tolerate the Taint. + properties: + effect: + description: |- + Required. The effect of the taint on pods + that do not tolerate the taint. + Valid effects are NoSchedule, PreferNoSchedule and NoExecute. + type: string + enum: + - NoSchedule + - PreferNoSchedule + - NoExecute + key: + description: Required. The taint key to be applied to a node. + type: string + minLength: 1 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*(\/))?([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$ + timeAdded: + description: |- + TimeAdded represents the time at which the taint was added. + It is only written for NoExecute taints. + format: date-time + type: string + value: + description: The taint value corresponding to the taint key. + type: string + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*(\/))?([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$ + required: + - effect + - key + type: object + type: array + taints: + description: Taints will be applied to the NodeClaim's node. + items: + description: |- + The node this Taint is attached to has the "effect" on + any pod that does not tolerate the Taint. + properties: + effect: + description: |- + Required. The effect of the taint on pods + that do not tolerate the taint. + Valid effects are NoSchedule, PreferNoSchedule and NoExecute. + type: string + enum: + - NoSchedule + - PreferNoSchedule + - NoExecute + key: + description: Required. The taint key to be applied to a node. + type: string + minLength: 1 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*(\/))?([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$ + timeAdded: + description: |- + TimeAdded represents the time at which the taint was added. + It is only written for NoExecute taints. + format: date-time + type: string + value: + description: The taint value corresponding to the taint key. + type: string + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*(\/))?([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$ + required: + - effect + - key + type: object + type: array + required: + - nodeClassRef + - requirements + type: object + status: + description: NodeClaimStatus defines the observed state of NodeClaim + properties: + allocatable: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: Allocatable is the estimated allocatable capacity of the node + type: object + capacity: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: Capacity is the estimated full capacity of the node + type: object + conditions: + description: Conditions contains signals for health and readiness + items: + description: Condition aliases the upstream type and adds additional helper methods + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + pattern: ^([A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?|)$ + type: string + status: + description: status of the condition, one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - status + - type + type: object + type: array + imageID: + description: ImageID is an identifier for the image that runs on the node + type: string + nodeName: + description: NodeName is the name of the corresponding node object + type: string + providerID: + description: ProviderID of the corresponding node object + type: string + type: object + required: + - spec + type: object + served: true + storage: false + subresources: + status: {} + conversion: + strategy: Webhook + webhook: + conversionReviewVersions: + - v1beta1 + - v1 + clientConfig: + service: + namespace: gpu-provisioner + name: gpu-provisioner + port: 8443 diff --git a/charts/gpu-provisioner/templates/clusterrole-core.yaml b/charts/gpu-provisioner/templates/clusterrole-core.yaml index b9c2840f..338e9b6d 100644 --- a/charts/gpu-provisioner/templates/clusterrole-core.yaml +++ b/charts/gpu-provisioner/templates/clusterrole-core.yaml @@ -29,37 +29,52 @@ metadata: {{- end }} rules: # Read - - apiGroups: [ "karpenter.sh" ] - resources: [ "provisioners" ] - verbs: [ "get", "list", "watch" ] - apiGroups: ["karpenter.sh"] - resources: ["machines", "machines/status"] + resources: ["nodeclaims", "nodeclaims/status"] verbs: ["get", "list", "watch"] - apiGroups: [""] - resources: ["pods", "nodes", "persistentvolumes", "persistentvolumeclaims", "replicationcontrollers", "namespaces"] + resources: ["pods", "nodes", "persistentvolumes", "persistentvolumeclaims", "replicationcontrollers", "namespaces", "configmaps", "secrets"] verbs: ["get", "list", "watch"] - apiGroups: ["storage.k8s.io"] - resources: ["storageclasses", "csinodes"] + resources: ["storageclasses", "csinodes", "volumeattachments"] verbs: ["get", "watch", "list"] - apiGroups: ["apps"] resources: ["daemonsets", "deployments", "replicasets", "statefulsets"] verbs: ["list", "watch"] - - apiGroups: [ "policy" ] - resources: [ "poddisruptionbudgets" ] - verbs: [ "get", "list", "watch" ] + - apiGroups: ["policy"] + resources: ["poddisruptionbudgets"] + verbs: ["get", "list", "watch"] + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["list", "watch"] + - apiGroups: ["coordination.k8s.io"] + resources: ["leases"] + verbs: ["list", "watch"] # Write - apiGroups: ["karpenter.sh"] - resources: ["machines", "machines/status"] + resources: ["nodeclaims", "nodeclaims/status"] verbs: ["create", "delete", "update", "patch"] - apiGroups: [""] resources: ["events"] verbs: ["create", "patch"] - apiGroups: [""] resources: ["nodes"] - verbs: ["patch", "delete"] + verbs: ["patch", "delete", "update"] - apiGroups: [""] resources: ["pods/eviction"] verbs: ["create"] + - apiGroups: [""] + resources: ["pods"] + verbs: ["delete"] + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["update", "patch"] + - apiGroups: [""] + resources: ["secrets"] + verbs: ["update"] + - apiGroups: ["coordination.k8s.io"] + resources: ["leases"] + verbs: ["delete"] {{- with .Values.additionalClusterRoleRules -}} {{ toYaml . | nindent 2 }} {{- end -}} diff --git a/charts/gpu-provisioner/templates/configmap-logging.yaml b/charts/gpu-provisioner/templates/configmap-logging.yaml deleted file mode 100644 index 699fa594..00000000 --- a/charts/gpu-provisioner/templates/configmap-logging.yaml +++ /dev/null @@ -1,40 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: gpu-provisioner-config-logging - namespace: {{ .Release.Namespace }} - labels: - {{- include "gpu-provisioner.labels" . | nindent 4 }} - {{- with .Values.additionalAnnotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -data: - # https://github.com/uber-go/zap/blob/aa3e73ec0896f8b066ddf668597a02f89628ee50/config.go - zap-logger-config: | - { - "level": "{{ .Values.logLevel }}", - "development": false, - "disableStacktrace": true, - "disableCaller": true, - "sampling": { - "initial": 100, - "thereafter": 100 - }, - "outputPaths": [{{ include "gpu-provisioner.controller.outputPathsList" . }}], - "errorOutputPaths": [{{ include "gpu-provisioner.controller.errorOutputPathsList" . }}], - "encoding": "{{ .Values.logEncoding }}", - "encoderConfig": { - "timeKey": "time", - "levelKey": "level", - "nameKey": "logger", - "callerKey": "caller", - "messageKey": "message", - "stacktraceKey": "stacktrace", - "levelEncoder": "capital", - "timeEncoder": "iso8601" - } - } -{{- with .Values.controller.logLevel }} - loglevel.controller: {{ . | quote }} -{{- end }} diff --git a/charts/gpu-provisioner/templates/configmap.yaml b/charts/gpu-provisioner/templates/configmap.yaml deleted file mode 100644 index c54f7284..00000000 --- a/charts/gpu-provisioner/templates/configmap.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: gpu-provisioner-global-settings - namespace: {{ .Release.Namespace }} - labels: - {{- include "gpu-provisioner.labels" . | nindent 4 }} - {{- with .Values.additionalAnnotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -data: - {{- list .Values.settings "" | include "flattenSettings" | indent 2 }} diff --git a/charts/gpu-provisioner/templates/deployment.yaml b/charts/gpu-provisioner/templates/deployment.yaml index 39e1a216..2ce7b204 100644 --- a/charts/gpu-provisioner/templates/deployment.yaml +++ b/charts/gpu-provisioner/templates/deployment.yaml @@ -32,7 +32,6 @@ spec: {{- with .Values.podAnnotations }} {{- toYaml . | nindent 8 }} {{- end }} - checksum/settings: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: @@ -74,6 +73,16 @@ spec: valueFrom: fieldRef: fieldPath: metadata.namespace + - name: KARPENTER_SERVICE + value: {{ include "gpu-provisioner.fullname" . }} + - name: METRICS_PORT + value: "{{ .Values.controller.metrics.port }}" + - name: HEALTH_PROBE_PORT + value: "{{ .Values.controller.healthProbe.port }}" + - name: WEBHOOK_PORT + value: "{{ .Values.controller.webhook.port }}" + - name: WEBHOOK_METRICS_PORT + value: "{{ .Values.controller.webhookMetrics.port }}" {{- with .Values.controller.env }} {{- toYaml . | nindent 12 }} {{- end }} diff --git a/charts/gpu-provisioner/templates/role.yaml b/charts/gpu-provisioner/templates/role.yaml index 3ebd01fc..7b983e15 100644 --- a/charts/gpu-provisioner/templates/role.yaml +++ b/charts/gpu-provisioner/templates/role.yaml @@ -14,20 +14,7 @@ rules: - apiGroups: ["coordination.k8s.io"] resources: ["leases"] verbs: ["get", "watch"] - - apiGroups: [""] - resources: ["configmaps", "namespaces", "secrets"] - verbs: ["get", "list", "watch"] # Write - - apiGroups: [""] - resources: ["secrets"] - verbs: ["update"] - resourceNames: ["{{ include "gpu-provisioner.fullname" . }}-cert"] - - apiGroups: [""] - resources: ["configmaps"] - verbs: ["update", "patch", "delete"] - resourceNames: - - gpu-provisioner-global-settings - - config-logging - apiGroups: ["coordination.k8s.io"] resources: ["leases"] verbs: ["patch", "update"] @@ -38,24 +25,3 @@ rules: - apiGroups: ["coordination.k8s.io"] resources: ["leases"] verbs: ["create"] - - apiGroups: [""] - resources: ["configmaps"] - verbs: ["create"] ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: Role -metadata: - name: {{ include "gpu-provisioner.fullname" . }}-dns - namespace: kube-system - labels: - {{- include "gpu-provisioner.labels" . | nindent 4 }} - {{- with .Values.additionalAnnotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -rules: - # Read - - apiGroups: [""] - resources: ["services"] - resourceNames: ["kube-dns"] - verbs: ["get"] diff --git a/charts/gpu-provisioner/templates/rolebinding.yaml b/charts/gpu-provisioner/templates/rolebinding.yaml index 0f242c30..9baddda0 100644 --- a/charts/gpu-provisioner/templates/rolebinding.yaml +++ b/charts/gpu-provisioner/templates/rolebinding.yaml @@ -13,26 +13,6 @@ roleRef: apiGroup: rbac.authorization.k8s.io kind: Role name: {{ include "gpu-provisioner.fullname" . }} -subjects: - - kind: ServiceAccount - name: gpu-provisioner - namespace: {{ .Release.Namespace }} ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding -metadata: - name: {{ include "gpu-provisioner.fullname" . }}-dns - namespace: kube-system - labels: - {{- include "gpu-provisioner.labels" . | nindent 4 }} - {{- with .Values.additionalAnnotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: Role - name: {{ include "gpu-provisioner.fullname" . }}-dns subjects: - kind: ServiceAccount name: gpu-provisioner diff --git a/charts/gpu-provisioner/templates/secret.yaml b/charts/gpu-provisioner/templates/secret.yaml new file mode 100644 index 00000000..d724f48c --- /dev/null +++ b/charts/gpu-provisioner/templates/secret.yaml @@ -0,0 +1,5 @@ +apiVersion: v1 +kind: Secret +metadata: + name: {{ include "gpu-provisioner.fullname" . }}-cert + namespace: {{ .Release.Namespace }} \ No newline at end of file diff --git a/charts/gpu-provisioner/templates/service.yaml b/charts/gpu-provisioner/templates/service.yaml new file mode 100644 index 00000000..84b5a85b --- /dev/null +++ b/charts/gpu-provisioner/templates/service.yaml @@ -0,0 +1,30 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "gpu-provisioner.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "gpu-provisioner.labels" . | nindent 4 }} + {{- if or .Values.additionalAnnotations .Values.service.annotations }} + annotations: + {{- with .Values.additionalAnnotations }} + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .Values.service.annotations }} + {{- toYaml . | nindent 4 }} + {{- end }} + {{- end }} +spec: + type: ClusterIP + ports: + - name: http-metrics + port: {{ .Values.controller.metrics.port }} + protocol: TCP + - name: webhook + port: {{ .Values.controller.webhook.port }} + protocol: TCP + - name: webhook-metrics + port: {{ .Values.controller.webhookMetrics.port }} + protocol: TCP + selector: + {{- include "gpu-provisioner.selectorLabels" . | nindent 4 }} \ No newline at end of file diff --git a/charts/gpu-provisioner/values.yaml b/charts/gpu-provisioner/values.yaml index 31f6bb97..543106e6 100644 --- a/charts/gpu-provisioner/values.yaml +++ b/charts/gpu-provisioner/values.yaml @@ -12,6 +12,9 @@ additionalAnnotations: {} imagePullPolicy: IfNotPresent # -- Image pull secrets for Docker images. imagePullSecrets: [] +service: + # -- Additional annotations for the Service. + annotations: {} serviceAccount: # -- Specifies if a ServiceAccount should be created. create: true @@ -142,10 +145,16 @@ controller: logEncoding: "" metrics: # -- The container port to use for metrics. - port: 8000 + port: 8080 healthProbe: # -- The container port to use for http health probe. port: 8081 + webhook: + # -- The container port to use for http health probe. + port: 8443 + webhookMetrics: + # -- The container port to use for http health probe. + port: 8001 # -- Global log level logLevel: debug # -- Global log encoding diff --git a/cmd/controller/main.go b/cmd/controller/main.go index dc62531d..f5dfe1f4 100644 --- a/cmd/controller/main.go +++ b/cmd/controller/main.go @@ -16,37 +16,36 @@ limitations under the License. package main import ( - "github.com/samber/lo" - "github.com/azure/gpu-provisioner/pkg/cloudprovider" + "github.com/azure/gpu-provisioner/pkg/controllers" "github.com/azure/gpu-provisioner/pkg/operator" - - "github.com/aws/karpenter-core/pkg/cloudprovider/metrics" - corecontrollers "github.com/aws/karpenter-core/pkg/controllers" - "github.com/aws/karpenter-core/pkg/controllers/state" - coreoperator "github.com/aws/karpenter-core/pkg/operator" + "sigs.k8s.io/karpenter/pkg/cloudprovider/metrics" + karpentercontrollers "sigs.k8s.io/karpenter/pkg/controllers" + karpenteroperator "sigs.k8s.io/karpenter/pkg/operator" + "sigs.k8s.io/karpenter/pkg/webhooks" ) func main() { - ctx, op := operator.NewOperator(coreoperator.NewOperator()) + ctx, op := operator.NewOperator(karpenteroperator.NewOperator()) azureCloudProvider := cloudprovider.New( - op.InstanceTypesProvider, op.InstanceProvider, op.GetClient(), ) - lo.Must0(op.AddHealthzCheck("cloud-provider", azureCloudProvider.LivenessProbe)) cloudProvider := metrics.Decorate(azureCloudProvider) op. - WithControllers(ctx, corecontrollers.NewControllers( + WithControllers(ctx, karpentercontrollers.NewControllers( ctx, + op.Manager, op.Clock, op.GetClient(), - op.KubernetesInterface, - state.NewCluster(op.Clock, op.GetClient(), cloudProvider), op.EventRecorder, cloudProvider, )...). - Start(ctx) + WithControllers(ctx, controllers.NewControllers( + op.GetClient(), + cloudProvider, + )...). + WithWebhooks(ctx, webhooks.NewWebhooks()...).Start(ctx, cloudProvider) } diff --git a/examples/machine-regular.yaml b/examples/machine-regular.yaml deleted file mode 100644 index 6a353893..00000000 --- a/examples/machine-regular.yaml +++ /dev/null @@ -1,70 +0,0 @@ -apiVersion: karpenter.sh/v1alpha5 -kind: Machine -metadata: - name: regularvms - labels: - karpenter.sh/provisioner-name: default - kaito.sh/workspace: none -spec: - taints: - - key: "sku" - value: "gpu" - effect: "NoSchedule" - machineTemplateRef: - name: regular - requirements: - - key: node.kubernetes.io/instance-type - operator: In - values: - - Standard_D4ads_v5 - - Standard_D4as_v4 - - Standard_D4as_v5 - - Standard_D4ds_v4 - - Standard_D4ds_v5 - - Standard_D4lds_v5 - - Standard_D4ls_v5 - - Standard_D4s_v3 - - Standard_D4s_v4 - - Standard_D4s_v5 - - Standard_D8ads_v5 - - Standard_D8as_v4 - - Standard_D8as_v5 - - Standard_D8ds_v4 - - Standard_D8ds_v5 - - Standard_D8lds_v5 - - Standard_D8ls_v5 - - Standard_D8s_v3 - - Standard_D8s_v4 - - Standard_D8s_v5 - - Standard_DC4ds_v3 - - Standard_DC4s_v2 - - Standard_DC4s_v3 - - Standard_DC8ds_v3 - - Standard_DC8s_v3 - - Standard_DS12-1_v2 - - Standard_DS12-2_v2 - - Standard_DS12_v2 - - Standard_DS13-2_v2 - - Standard_DS13-4_v2 - - Standard_DS13_v2 - - Standard_DS3_v2 - - Standard_DS4_v2 - - key: karpenter.sh/provisioner-name - operator: In - values: - - default - - key: kubernetes.io/arch - operator: In - values: - - amd64 - - key: kubernetes.io/os - operator: In - values: - - linux - resources: - requests: - cpu: 2310m - memory: 725280Ki - pods: "7" - -status: diff --git a/examples/machine-gpu.yaml b/examples/v1-nodeclaim-gpu.yaml similarity index 70% rename from examples/machine-gpu.yaml rename to examples/v1-nodeclaim-gpu.yaml index cd9047b0..90fba5c1 100644 --- a/examples/machine-gpu.yaml +++ b/examples/v1-nodeclaim-gpu.yaml @@ -1,17 +1,22 @@ -apiVersion: karpenter.sh/v1alpha5 -kind: Machine +apiVersion: karpenter.sh/v1 +kind: NodeClaim metadata: - name: gpuvm + name: gpuvmv1 labels: - karpenter.sh/provisioner-name: default - kaito.sh/workspace: none + karpenter.sh/nodepool: kaito + kaito.sh/workspace: test-gpu-provisioner + kaito.sh/workspacenamespace: default + annotations: + karpenter.sh/do-not-disrupt: "true" spec: taints: - key: "sku" value: "gpu" effect: "NoSchedule" - machineTemplateRef: + nodeClassRef: name: gpuonly1 + kind: AKSNodeClass + group: karpenter.azure.com requirements: - key: node.kubernetes.io/instance-type operator: In @@ -42,27 +47,22 @@ spec: # - Standard_NV6 # - Standard_NV12 # - Standard_NV24 - - key: karpenter.sh/provisioner-name + - key: karpenter.sh/nodepool operator: In values: - - default + - kaito - key: gpu-provisioner.sh/machine-type operator: In values: - gpu - - key: kubernetes.io/arch + - key: karpenter.azure.com/sku-name operator: In values: - - amd64 + - Standard_NC12s_v3 - key: kubernetes.io/os operator: In values: - linux resources: requests: - cpu: 2310m - memory: 725280Ki - pods: "7" - storage: 120Gi - -status: + ephemeral-storage: 120Gi diff --git a/examples/v1beta1-nodeclaim-gpu.yaml b/examples/v1beta1-nodeclaim-gpu.yaml new file mode 100644 index 00000000..3bcafde5 --- /dev/null +++ b/examples/v1beta1-nodeclaim-gpu.yaml @@ -0,0 +1,68 @@ +apiVersion: karpenter.sh/v1beta1 +kind: NodeClaim +metadata: + name: gpuvmbeta + labels: + karpenter.sh/nodepool: kaito + kaito.sh/workspace: test-gpu-provisioner + kaito.sh/workspacenamespace: default + annotations: + karpenter.sh/do-not-disrupt: "true" +spec: + taints: + - key: "sku" + value: "gpu" + effect: "NoSchedule" + nodeClassRef: + name: gpuonly1 + kind: AKSNodeClass + apiVersion: karpenter.azure.com/v1alpha2 + requirements: + - key: node.kubernetes.io/instance-type + operator: In + values: +# - Standard_NC6 +# - Standard_NC12 +# - Standard_NC24 +# - Standard_NC24r +# - Standard_NC6s_v2 +# - Standard_NC12s_v2 +# - Standard_NC24s_v2 +# - Standard_NC24rs_v2 +# - Standard_NC6s_v3 + - Standard_NC12s_v3 +# - Standard_NC24s_v3 +# - Standard_NC24rs_v3 +# - Standard_NC12 +# - Standard_NC16as_T4_v3 +# - Standard_NC24 +# - Standard_NC24r +# - Standard_NC4as_T4_v3 +# - Standard_NC64as_T4_v3 +# - Standard_NC8as_T4_v3 +# - Standard_ND6s +# - Standard_ND12s +# - Standard_ND24s +# - Standard_ND24rs +# - Standard_NV6 +# - Standard_NV12 +# - Standard_NV24 + - key: karpenter.sh/nodepool + operator: In + values: + - kaito + - key: gpu-provisioner.sh/machine-type + operator: In + values: + - gpu + - key: karpenter.azure.com/sku-name + operator: In + values: + - Standard_NC12s_v3 + - key: kubernetes.io/os + operator: In + values: + - linux + resources: + requests: + ephemeral-storage: 120Gi diff --git a/go.mod b/go.mod index c8017468..a617ed54 100644 --- a/go.mod +++ b/go.mod @@ -1,136 +1,132 @@ module github.com/azure/gpu-provisioner -go 1.22.3 +go 1.22.5 -toolchain go1.22.5 +toolchain go1.23.1 require ( github.com/Azure/azure-sdk-for-go v68.0.0+incompatible - github.com/Azure/azure-sdk-for-go-extensions v0.1.1 - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.11.1 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.6.0 - github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute v1.0.0 - github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4 v4.3.0 - github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork v1.1.0 + github.com/Azure/azure-sdk-for-go-extensions v0.1.8 + github.com/Azure/azure-sdk-for-go/sdk/azcore v1.12.0 + github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4 v4.8.0 github.com/Azure/go-armbalancer v0.0.2 github.com/Azure/go-autorest/autorest v0.11.29 github.com/Azure/go-autorest/autorest/to v0.4.0 - github.com/Azure/skewer v0.0.19 github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 - github.com/aws/karpenter-core v0.29.2 - github.com/go-playground/validator/v10 v10.13.0 + github.com/awslabs/operatorpkg v0.0.0-20240805231134-67d0acfb6306 github.com/google/uuid v1.6.0 - github.com/onsi/ginkgo/v2 v2.11.0 - github.com/onsi/gomega v1.27.10 - github.com/patrickmn/go-cache v2.1.0+incompatible + github.com/imdario/mergo v0.3.16 + github.com/onsi/ginkgo/v2 v2.19.1 + github.com/onsi/gomega v1.34.1 github.com/pkg/errors v0.9.1 - github.com/samber/lo v1.38.1 + github.com/samber/lo v1.46.0 github.com/stretchr/testify v1.9.0 - go.uber.org/mock v0.3.0 + go.uber.org/mock v0.4.0 go.uber.org/multierr v1.11.0 - k8s.io/api v0.25.4 - k8s.io/apimachinery v0.25.4 - k8s.io/client-go v0.25.4 - k8s.io/klog/v2 v2.100.1 - knative.dev/pkg v0.0.0-20230502134655-db8a35330281 - sigs.k8s.io/controller-runtime v0.13.1 + k8s.io/api v0.30.3 + k8s.io/apimachinery v0.30.3 + k8s.io/client-go v0.30.3 + k8s.io/klog/v2 v2.130.1 + knative.dev/pkg v0.0.0-20231010144348-ca8c009405dd + sigs.k8s.io/controller-runtime v0.18.4 + sigs.k8s.io/karpenter v1.0.4 ) require ( contrib.go.opencensus.io/exporter/ocagent v0.7.1-0.20200907061046-05415f1de66d // indirect - contrib.go.opencensus.io/exporter/prometheus v0.4.0 // indirect - github.com/Azure/azure-sdk-for-go/sdk/internal v1.8.0 // indirect + contrib.go.opencensus.io/exporter/prometheus v0.4.2 // indirect + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/internal v1.9.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0 // indirect github.com/Azure/go-autorest v14.2.0+incompatible // indirect - github.com/Azure/go-autorest/autorest/adal v0.9.23 // indirect + github.com/Azure/go-autorest/autorest/adal v0.9.24 // indirect github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect github.com/Azure/go-autorest/autorest/validation v0.3.1 // indirect github.com/Azure/go-autorest/logger v0.2.1 // indirect github.com/Azure/go-autorest/tracing v0.6.0 // indirect github.com/Pallinder/go-randomdata v1.2.0 // indirect github.com/avast/retry-go v3.0.0+incompatible // indirect - github.com/benbjohnson/clock v1.1.0 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/blang/semver/v4 v4.0.0 // indirect github.com/blendle/zapdriver v1.3.1 // indirect github.com/census-instrumentation/opencensus-proto v0.4.1 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/deckarep/golang-set v1.8.0 // indirect - github.com/emicklei/go-restful/v3 v3.9.0 // indirect - github.com/evanphx/json-patch/v5 v5.6.0 // indirect - github.com/fsnotify/fsnotify v1.6.0 // indirect + github.com/emicklei/go-restful/v3 v3.11.0 // indirect + github.com/evanphx/json-patch v5.6.0+incompatible // indirect + github.com/evanphx/json-patch/v5 v5.9.0 // indirect + github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/go-kit/log v0.2.1 // indirect - github.com/go-logfmt/logfmt v0.5.1 // indirect - github.com/go-logr/logr v1.2.4 // indirect - github.com/go-logr/zapr v1.2.4 // indirect - github.com/go-openapi/jsonpointer v0.19.6 // indirect - github.com/go-openapi/jsonreference v0.20.1 // indirect - github.com/go-openapi/swag v0.22.3 // indirect - github.com/go-playground/locales v0.14.1 // indirect - github.com/go-playground/universal-translator v0.18.1 // indirect - github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect + github.com/go-logfmt/logfmt v0.6.0 // indirect + github.com/go-logr/logr v1.4.2 // indirect + github.com/go-logr/zapr v1.3.0 // indirect + github.com/go-openapi/jsonpointer v0.20.0 // indirect + github.com/go-openapi/jsonreference v0.20.2 // indirect + github.com/go-openapi/swag v0.22.4 // indirect + github.com/go-task/slim-sprig/v3 v3.0.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang-jwt/jwt/v4 v4.5.0 // indirect github.com/golang-jwt/jwt/v5 v5.2.1 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect - github.com/golang/protobuf v1.5.3 // indirect - github.com/google/gnostic v0.5.7-v3refs // indirect + github.com/golang/protobuf v1.5.4 // indirect + github.com/google/gnostic-models v0.6.8 // indirect github.com/google/go-cmp v0.6.0 // indirect github.com/google/gofuzz v1.2.0 // indirect - github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3 // indirect - github.com/hashicorp/golang-lru v0.5.4 // indirect - github.com/imdario/mergo v0.3.16 // indirect + github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0 // indirect + github.com/hashicorp/golang-lru v1.0.2 // indirect + github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/kelseyhightower/envconfig v1.4.0 // indirect github.com/kylelemons/godebug v1.1.0 // indirect - github.com/leodido/go-urn v1.2.3 // indirect github.com/mailru/easyjson v0.7.7 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/mitchellh/hashstructure/v2 v2.0.2 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect - github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect + github.com/patrickmn/go-cache v2.1.0+incompatible // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.15.0 // indirect - github.com/prometheus/client_model v0.4.0 // indirect - github.com/prometheus/common v0.42.0 // indirect - github.com/prometheus/procfs v0.9.0 // indirect - github.com/prometheus/statsd_exporter v0.21.0 // indirect + github.com/prometheus/client_golang v1.19.1 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.53.0 // indirect + github.com/prometheus/procfs v0.12.0 // indirect + github.com/prometheus/statsd_exporter v0.24.0 // indirect + github.com/robfig/cron/v3 v3.0.1 // indirect + github.com/spf13/cobra v1.8.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/stretchr/objx v0.5.2 // indirect - go.opencensus.io v0.23.0 // indirect - go.uber.org/atomic v1.9.0 // indirect - go.uber.org/automaxprocs v1.4.0 // indirect - go.uber.org/zap v1.24.0 // indirect - golang.org/x/crypto v0.24.0 // indirect - golang.org/x/exp v0.0.0-20220303212507-bbda1eaf7a17 // indirect - golang.org/x/net v0.26.0 // indirect - golang.org/x/oauth2 v0.7.0 // indirect - golang.org/x/sync v0.7.0 // indirect - golang.org/x/sys v0.21.0 // indirect - golang.org/x/term v0.21.0 // indirect + go.opencensus.io v0.24.0 // indirect + go.uber.org/automaxprocs v1.5.3 // indirect + go.uber.org/zap v1.27.0 // indirect + golang.org/x/crypto v0.25.0 // indirect + golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect + golang.org/x/net v0.27.0 // indirect + golang.org/x/oauth2 v0.18.0 // indirect + golang.org/x/sync v0.8.0 // indirect + golang.org/x/sys v0.22.0 // indirect + golang.org/x/term v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect - golang.org/x/time v0.3.0 // indirect - golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect - gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect - google.golang.org/api v0.61.0 // indirect - google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect - google.golang.org/grpc v1.56.3 // indirect - google.golang.org/protobuf v1.33.0 // indirect + golang.org/x/time v0.6.0 // indirect + golang.org/x/tools v0.23.0 // indirect + gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect + google.golang.org/api v0.146.0 // indirect + google.golang.org/appengine v1.6.8 // indirect + google.golang.org/genproto v0.0.0-20231009173412-8bfb1ae86b6c // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20231009173412-8bfb1ae86b6c // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20231009173412-8bfb1ae86b6c // indirect + google.golang.org/grpc v1.59.0 // indirect + google.golang.org/protobuf v1.34.1 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/apiextensions-apiserver v0.25.4 // indirect - k8s.io/cloud-provider v0.25.4 // indirect - k8s.io/component-base v0.25.4 // indirect - k8s.io/csi-translation-lib v0.25.4 // indirect - k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f // indirect - k8s.io/utils v0.0.0-20230209194617-a36077c30491 // indirect + k8s.io/apiextensions-apiserver v0.30.3 // indirect + k8s.io/cloud-provider v0.30.3 // indirect + k8s.io/component-base v0.30.3 // indirect + k8s.io/csi-translation-lib v0.30.3 // indirect + k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect + k8s.io/utils v0.0.0-20240102154912-e7106e64919e // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect - sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect - sigs.k8s.io/yaml v1.3.0 // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect + sigs.k8s.io/yaml v1.4.0 // indirect ) diff --git a/go.sum b/go.sum index 0147cf26..c86b9bcc 100644 --- a/go.sum +++ b/go.sum @@ -13,18 +13,6 @@ cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKV cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= -cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= -cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= -cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= -cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= -cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= -cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY= -cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSUM= -cloud.google.com/go v0.87.0/go.mod h1:TpDYlFy7vuLzZMMZ+B6iRiELaY7z/gJPaqbMx6mlWcY= -cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aDQ= -cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI= -cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4= -cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= @@ -44,29 +32,25 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= contrib.go.opencensus.io/exporter/ocagent v0.7.1-0.20200907061046-05415f1de66d h1:LblfooH1lKOpp1hIhukktmSAxFkqMPFk9KR6iZ0MJNI= contrib.go.opencensus.io/exporter/ocagent v0.7.1-0.20200907061046-05415f1de66d/go.mod h1:IshRmMJBhDfFj5Y67nVhMYTTIze91RUeT73ipWKs/GY= -contrib.go.opencensus.io/exporter/prometheus v0.4.0 h1:0QfIkj9z/iVZgK31D9H9ohjjIDApI2GOPScCKwxedbs= -contrib.go.opencensus.io/exporter/prometheus v0.4.0/go.mod h1:o7cosnyfuPVK0tB8q0QmaQNhGnptITnPQB+z1+qeFB0= +contrib.go.opencensus.io/exporter/prometheus v0.4.2 h1:sqfsYl5GIY/L570iT+l93ehxaWJs2/OwXtiWwew3oAg= +contrib.go.opencensus.io/exporter/prometheus v0.4.2/go.mod h1:dvEHbiKmgvbr5pjaF9fpw1KeYcjrnC1J8B+JKjsZyRQ= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/Azure/azure-sdk-for-go v68.0.0+incompatible h1:fcYLmCpyNYRnvJbPerq7U0hS+6+I79yEDJBqVNcqUzU= github.com/Azure/azure-sdk-for-go v68.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/azure-sdk-for-go-extensions v0.1.1 h1:IJ61WZkgI/AmegGdAInvaKdRfnY4rSDzpy1vweiXpwA= -github.com/Azure/azure-sdk-for-go-extensions v0.1.1/go.mod h1:ixc1COEyxrkiw2E74EJGI2ojS/g49uLTkyY6lWg108Y= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.11.1 h1:E+OJmp2tPvt1W+amx48v1eqbjDYsgN+RzP4q16yV5eM= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.11.1/go.mod h1:a6xsAQUZg+VsS3TJ05SRp524Hs4pZ/AeFSr5ENf0Yjo= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.6.0 h1:U2rTu3Ef+7w9FHKIAXM6ZyqF3UOWJZ12zIm8zECAFfg= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.6.0/go.mod h1:9kIvujWAA58nmPmWB1m23fyWic1kYZMxD9CxaWn4Qpg= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.8.0 h1:jBQA3cKT4L2rWMpgE7Yt3Hwh2aUj8KXjIGLxjHeYNNo= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.8.0/go.mod h1:4OG6tQ9EOP/MT0NMjDlRzWoVFxfu9rN9B2X+tlSVktg= -github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute v1.0.0 h1:/Di3vB4sNeQ+7A8efjUVENvyB945Wruvstucqp7ZArg= -github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute v1.0.0/go.mod h1:gM3K25LQlsET3QR+4V74zxCsFAy0r6xMNN9n80SZn+4= -github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4 v4.3.0 h1:U73ZEM5QTwb7x/VrXLTi+sb6Aw9DqFJxOpWuj+pDPfk= -github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4 v4.3.0/go.mod h1:WpiaNrHqgIy+P5gTYbOA/JuMmxq7uq8onUvVBybjIlI= -github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.1.2 h1:mLY+pNLjCUeKhgnAJWAKhEUQM+RJQo2H1fuGSw1Ky1E= -github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.1.2/go.mod h1:FbdwsQ2EzwvXxOPcMFYO8ogEc9uMMIj3YkmCdXdAFmk= -github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork v1.1.0 h1:QM6sE5k2ZT/vI5BEe0r7mqjsUSnhVBFbOsVkEuaEfiA= -github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork v1.1.0/go.mod h1:243D9iHbcQXoFUtgHJwL7gl2zx1aDuDMjvBZVGr2uW0= -github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.0.0 h1:ECsQtyERDVz3NP3kvDOTLvbQhqWp/x9EsGKtb4ogUr8= -github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.0.0/go.mod h1:s1tW/At+xHqjNFvWU4G0c0Qv33KOhvbGNj0RCTQDV8s= +github.com/Azure/azure-sdk-for-go-extensions v0.1.8 h1:x8Vu78C4r8mh6V2yQKQRSWLU+EYBVwFsf3XECddyb6s= +github.com/Azure/azure-sdk-for-go-extensions v0.1.8/go.mod h1:4su5NjJwhqFH2B/5zJSKOz7hazfr2y38Iu6W4ZK0HYA= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.12.0 h1:1nGuui+4POelzDwI7RG56yfQJHCnKvwfMoU7VsEp+Zg= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.12.0/go.mod h1:99EvauvlcJ1U06amZiksfYz/3aFGyIhWGHVyiZXtBAI= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 h1:tfLQ34V6F7tVSwoTf/4lH5sE0o6eCJuNDTmH09nDpbc= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0/go.mod h1:9kIvujWAA58nmPmWB1m23fyWic1kYZMxD9CxaWn4Qpg= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.9.0 h1:H+U3Gk9zY56G3u872L82bk4thcsy2Gghb9ExT4Zvm1o= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.9.0/go.mod h1:mgrmMSgaLp9hmax62XQTd0N4aAqSE5E0DulSpVYK7vc= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4 v4.8.0 h1:0nGmzwBv5ougvzfGPCO2ljFRHvun57KpNrVCMrlk0ns= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4 v4.8.0/go.mod h1:gYq8wyDgv6JLhGbAU6gg8amCPgQWRE+aCvrV2gyzdfs= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v2 v2.0.0 h1:PTFGRSlMKCQelWwxUyYVEUqseBJVemLyqWJjvMyt0do= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v2 v2.0.0/go.mod h1:LRr2FzBTQlONPPa5HREE5+RjSCTXl7BwOvYOaWTqCaI= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0 h1:Dd+RhdJn0OTtVGaeDLZpcumkIVCtA/3/Fo42+eoYvVM= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0/go.mod h1:5kakwfW5CjC9KK+Q4wjXAg+ShuIm2mBMua0ZFj2C8PE= github.com/Azure/go-armbalancer v0.0.2 h1:NVnxsTWHI5/fEzL6k6TjxPUfcB/3Si3+HFOZXOu0QtA= github.com/Azure/go-armbalancer v0.0.2/go.mod h1:yTg7MA/8YnfKQc9o97tzAJ7fbdVkod1xGsIvKmhYPRE= github.com/Azure/go-autorest v14.2.0+incompatible h1:V5VMDjClD3GiElqLWO7mz2MxNAK/vTfRHdAubSIPRgs= @@ -74,8 +58,8 @@ github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSW github.com/Azure/go-autorest/autorest v0.11.29 h1:I4+HL/JDvErx2LjyzaVxllw2lRDB5/BT2Bm4g20iqYw= github.com/Azure/go-autorest/autorest v0.11.29/go.mod h1:ZtEzC4Jy2JDrZLxvWs8LrBWEBycl1hbT1eknI8MtfAs= github.com/Azure/go-autorest/autorest/adal v0.9.22/go.mod h1:XuAbAEUv2Tta//+voMI038TrJBqjKam0me7qR+L8Cmk= -github.com/Azure/go-autorest/autorest/adal v0.9.23 h1:Yepx8CvFxwNKpH6ja7RZ+sKX+DWYNldbLiALMC3BTz8= -github.com/Azure/go-autorest/autorest/adal v0.9.23/go.mod h1:5pcMqFkdPhviJdlEy3kC/v1ZLnQl0MH6XA5YCcMhy4c= +github.com/Azure/go-autorest/autorest/adal v0.9.24 h1:BHZfgGsGwdkHDyZdtQRQk1WeUdW0m2WPAwuHZwUi5i4= +github.com/Azure/go-autorest/autorest/adal v0.9.24/go.mod h1:7T1+g0PYFmACYW5LlG2fcoPiPlFHjClyRGL7dRlP5c8= github.com/Azure/go-autorest/autorest/date v0.3.0 h1:7gUk1U5M/CQbp9WoqinNzJar+8KY+LPI6wiWrP/myHw= github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74= github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= @@ -89,13 +73,10 @@ github.com/Azure/go-autorest/logger v0.2.1 h1:IG7i4p/mDa2Ce4TRyAO8IHnVhAVF3RFU+Z github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= github.com/Azure/go-autorest/tracing v0.6.0 h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUMfuitfgcfuo= github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= -github.com/Azure/skewer v0.0.19 h1:+qA1z8isKmlNkhAwZErNS2wD2jaemSk9NszYKr8dddU= -github.com/Azure/skewer v0.0.19/go.mod h1:LVH7jmduRKmPj8YcIz7V4f53xJEntjweL4aoLyChkwk= github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 h1:XHOnouVk1mxXfQidrMEnLlPk9UMeRtyBTnEFtxkV0kU= github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/Pallinder/go-randomdata v1.2.0 h1:DZ41wBchNRb/0GfsePLiSwb0PHZmT67XY00lCDlaYPg= github.com/Pallinder/go-randomdata v1.2.0/go.mod h1:yHmJgulpD2Nfrm0cR9tI/+oAgRqCQQixsA8HyRZfV9Y= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= @@ -103,13 +84,12 @@ github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuy github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= +github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/avast/retry-go v3.0.0+incompatible h1:4SOWQ7Qs+oroOTQOYnAHqelpCO0biHSxpiH9JdtuBj0= github.com/avast/retry-go v3.0.0+incompatible/go.mod h1:XtSnn+n/sHqQIpZ10K1qAevBhOOCWBLXXy3hyiqqBrY= -github.com/aws/karpenter-core v0.29.2 h1:iS8bjC1911LA459gLEl7Jkr0QRbyKMeXB2b4NEVGQIE= -github.com/aws/karpenter-core v0.29.2/go.mod h1:GzFITbd2ijUiV4UJ0wox4RJQsFD2ncyJYtLmUlYnmJY= -github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= -github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= +github.com/awslabs/operatorpkg v0.0.0-20240805231134-67d0acfb6306 h1:0dzaVod1XLEc38H4IB+KOgStoCt8RkCVI4t+XsSPrWE= +github.com/awslabs/operatorpkg v0.0.0-20240805231134-67d0acfb6306/go.mod h1:7u2ugtOiWSvqqwNlnQ8W+2TjwnSTbHoMHnR1AKpKVMA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -121,8 +101,8 @@ github.com/blendle/zapdriver v1.3.1/go.mod h1:mdXfREi6u5MArG4j9fewC+FGnXaBR+T4Ox github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/census-instrumentation/opencensus-proto v0.4.1 h1:iKLQ0xPNFxR/2hzXZMrBo8f1j86j5WHzznCCQxV/b8g= github.com/census-instrumentation/opencensus-proto v0.4.1/go.mod h1:4T9NM4+4Vw91VeyqjLS6ao50K5bOcLKN6Q42XnYaRYw= -github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= @@ -130,33 +110,23 @@ github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5P github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/deckarep/golang-set v1.8.0 h1:sk9/l/KqpunDwP7pSjUg0keiOOLEnOBHzykLrsPppp4= -github.com/deckarep/golang-set v1.8.0/go.mod h1:5nI87KwE7wgsBU1F4GKAw2Qod7p5kyS383rP6+o6qqo= -github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= -github.com/emicklei/go-restful/v3 v3.9.0 h1:XwGDlfxEnQZzuopoqxwSEllNcCOM9DhhFyhFIIGKwxE= -github.com/emicklei/go-restful/v3 v3.9.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g= +github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= -github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/evanphx/json-patch v0.5.2/go.mod h1:ZWS5hhDbVDyob71nXKNL0+PWn6ToqBHMikGIFbs31qQ= -github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84= -github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/evanphx/json-patch/v5 v5.6.0 h1:b91NhWfaz02IuVxO9faSllyAtNXHMPkC5J8sJCLunww= -github.com/evanphx/json-patch/v5 v5.6.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4= -github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= -github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= +github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U= +github.com/evanphx/json-patch v5.6.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/evanphx/json-patch/v5 v5.9.0 h1:kcBlZQbplgElYIlo/n1hJbls2z/1awpXxpRi0/FOJfg= +github.com/evanphx/json-patch/v5 v5.9.0/go.mod h1:VNkHZ/282BpEyt/tObQO8s5CMPmYYq14uClGH4abBuQ= +github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= +github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -164,35 +134,30 @@ github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2 github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= +github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= -github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA= github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= -github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= -github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/zapr v1.2.4 h1:QHVo+6stLbfJmYGkQ7uGHUCu5hnAFAj6mDe6Ea0SeOo= -github.com/go-logr/zapr v1.2.4/go.mod h1:FyHWQIzQORZ0QVE1BtVHv3cKtNLuXsbNLtpuhNapBOA= -github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= +github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= +github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= +github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= +github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/zapr v1.3.0 h1:XGdV8XW8zdwFiwOA2Dryh1gj2KRQyOOoNmBy4EplIcQ= +github.com/go-logr/zapr v1.3.0/go.mod h1:YKepepNBd1u/oyhd/yQmtjVXmm9uML4IXUgMOwR8/Gg= github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= -github.com/go-openapi/jsonreference v0.20.1 h1:FBLnyygC4/IZZr893oiomc9XaghoveYTrLC1F86HID8= -github.com/go-openapi/jsonreference v0.20.1/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= -github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g= +github.com/go-openapi/jsonpointer v0.20.0 h1:ESKJdU9ASRfaPNOPRx12IUyA1vn3R9GiE3KYD14BXdQ= +github.com/go-openapi/jsonpointer v0.20.0/go.mod h1:6PGzBjjIIumbLYysB73Klnms1mwnU4G3YHOECG3CedA= +github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE= +github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= -github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= -github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= -github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= -github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= -github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= -github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= -github.com/go-playground/validator/v10 v10.13.0 h1:cFRQdfaSMCOSfGCCLB20MHvuoHb/s5G8L5pu2ppK5AQ= -github.com/go-playground/validator/v10 v10.13.0/go.mod h1:dwu7+CG8/CtBiJFZDz4e+5Upb6OLw04gtBYw0mcG/z4= +github.com/go-openapi/swag v0.22.4 h1:QLMzNJnMGPRNDCbySlcj1x01tzU8/9LTTL9hZZZogBU= +github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= -github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= +github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= +github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= @@ -202,8 +167,8 @@ github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.1.0 h1:/d3pCKDPWNnvIWe0vVUpNP32qc8U3PDVxySP/y360qE= -github.com/golang/glog v1.1.0/go.mod h1:pfYeQZ3JWZoXTV5sFc986z3HTpwQs9At6P4ImfuP3NQ= +github.com/golang/glog v1.1.2 h1:DVjP2PbBOzHyzA+dn3WhHIq4NdVu3Q+pvivFICf/7fo= +github.com/golang/glog v1.1.2/go.mod h1:zR+okUeTbrL6EL3xHUDxZuEtGv04p5shwip1+mL/rLQ= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -216,8 +181,6 @@ github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= -github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= -github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -233,15 +196,13 @@ github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QD github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/gnostic v0.5.7-v3refs h1:FhTMOKj2VhjpouxvWJAV1TL304uMlb9zcDqkl6cEI54= -github.com/google/gnostic v0.5.7-v3refs/go.mod h1:73MKFl6jIHelAJNaBGFzt3SPtZULs9dYrGFt8OiIsHQ= +github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= +github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -249,11 +210,11 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -261,8 +222,6 @@ github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= @@ -270,35 +229,26 @@ github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec= -github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6 h1:k7nVchz72niMH6YLQNvHSdIE7iqsQxK1P41mySCvssg= +github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6/go.mod h1:kf6iHlnVGwgKolg33glAes7Yg/8iWP8ukqeldJSO7jw= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= -github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM= github.com/grpc-ecosystem/grpc-gateway v1.14.6/go.mod h1:zdiPV4Yse/1gnckTHtghG4GkDEdKCRJduHpTxT3/jcw= -github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3 h1:lLT7ZLSzGLI08vc9cpd+tYmNWjdKDqyr/2L+f6U12Fk= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3/go.mod h1:o//XUCC/F+yRGJoPO/VU0GSB0f8Nhgmxx0VIRUvaC0w= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0 h1:RtRsiaGvWxcwd8y3BiRZxsylPT8hLWZ5SPcfI+3IDNk= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0/go.mod h1:TzP6duP4Py2pHLVPPQp42aoYI92+PCrVotyR5e8Vqlk= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= -github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c= +github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4= github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= -github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= +github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= +github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= @@ -319,7 +269,6 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxv github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= @@ -329,13 +278,9 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/leodido/go-urn v1.2.3 h1:6BE2vPT0lqoz3fmOesHZiaiFh7889ssCo2GMvLCfiuA= -github.com/leodido/go-urn v1.2.3/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= -github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/mitchellh/hashstructure/v2 v2.0.2 h1:vGKWl0YJqUNxE8d+h8f6NJLcCJrgbhC4NcD46KavDd4= github.com/mitchellh/hashstructure/v2 v2.0.2/go.mod h1:MG3aRVU/N29oo/V/IhBX8GR/zz4kQkprJgF2EVszyDE= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -349,14 +294,10 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= -github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= -github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= -github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= -github.com/onsi/ginkgo/v2 v2.11.0 h1:WgqUCUt/lT6yXoQ8Wef0fsNn5cAuMK7+KT9UFRz2tcU= -github.com/onsi/ginkgo/v2 v2.11.0/go.mod h1:ZhrRA5XmEE3x3rhlzamx/JJvujdZoJ2uvgI7kR0iZvM= -github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= -github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M= +github.com/onsi/ginkgo/v2 v2.19.1 h1:QXgq3Z8Crl5EL1WBAC98A5sEBHARrAJNzAmMxzLcRF0= +github.com/onsi/ginkgo/v2 v2.19.1/go.mod h1:O3DtEWQkPa/F7fBMgmZQKKsluAy8pd3rEQdrjkPb9zA= +github.com/onsi/gomega v1.34.1 h1:EUMJIKUjM8sKjYbtxQI9A4z2o+rruxnzNvpknOXie6k= +github.com/onsi/gomega v1.34.1/go.mod h1:kU1QgUvBDLXBJq618Xvm2LUX6rSAfRaFRTcdOeDLwwY= github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc= github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ= github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= @@ -367,45 +308,58 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g= +github.com/prashantv/gostub v1.1.0/go.mod h1:A5zLQHz7ieHGG7is6LLXLz7I8+3LZzsrV0P1IAHhP5U= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.15.0 h1:5fCgGYogn0hFdhyhLbw7hEsWxufKtY9klyvdNfFlFhM= -github.com/prometheus/client_golang v1.15.0/go.mod h1:e9yaBhRPU2pPNsZwE+JdQl0KEt1N9XgF6zxWmaC0xOk= +github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= +github.com/prometheus/client_golang v1.12.2/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= +github.com/prometheus/client_golang v1.13.0/go.mod h1:vTeo+zgvILHsnnj/39Ou/1fPN5nJFOEMgftOUOmlvYQ= +github.com/prometheus/client_golang v1.19.1 h1:wZWJDwK+NameRJuPGDhlnFgx8e8HN3XHQeLaYJFJBOE= +github.com/prometheus/client_golang v1.19.1/go.mod h1:mP78NwGzrVks5S2H6ab8+ZZGJLZUq1hoULYBAYBw1Ho= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.4.0 h1:5lQXD3cAg1OXBf4Wq03gTrXHeaV0TQvGfUooCfx1yqY= -github.com/prometheus/client_model v0.4.0/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= -github.com/prometheus/common v0.28.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/common v0.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI1YM= -github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc= +github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= +github.com/prometheus/common v0.35.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= +github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= +github.com/prometheus/common v0.53.0 h1:U2pL9w9nmJwJDa4qqLQ3ZaePJ6ZTwt7cMD3AG3+aLCE= +github.com/prometheus/common v0.53.0/go.mod h1:BrxBKv3FWBIGXw89Mg1AeBq7FSyRzXWI3l3e7W3RN5U= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.9.0 h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJfhI= -github.com/prometheus/procfs v0.9.0/go.mod h1:+pB4zwohETzFnmlpe6yd2lSc+0/46IYZRB/chUwxUZY= -github.com/prometheus/statsd_exporter v0.21.0 h1:hA05Q5RFeIjgwKIYEdFd59xu5Wwaznf33yKI+pyX6T8= -github.com/prometheus/statsd_exporter v0.21.0/go.mod h1:rbT83sZq2V+p73lHhPZfMc3MLCHmSHelCh9hSGYNLTQ= +github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= +github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= +github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= +github.com/prometheus/statsd_exporter v0.22.7/go.mod h1:N/TevpjkIh9ccs6nuzY3jQn9dFqnUakOjnEuMPJJJnI= +github.com/prometheus/statsd_exporter v0.24.0 h1:aZmN6CzS2H1Non1JKZdjkQlAkDtGoQBYIESk2SlU1OI= +github.com/prometheus/statsd_exporter v0.24.0/go.mod h1:+dQiRTqn9DnPmN5mI5Xond+k8nuRKzdgh1omxh9OgFY= +github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs= +github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= -github.com/samber/lo v1.38.1 h1:j2XEAqXKb09Am4ebOg31SpvzUTTs6EN3VfgeLUhPdXM= -github.com/samber/lo v1.38.1/go.mod h1:+m/ZKRl6ClXCE2Lgf3MsQlWfh4bn1bz6CXEOxnEXnEA= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/samber/lo v1.46.0 h1:w8G+oaCPgz1PoCJztqymCFaKwXt+5cCXn51uPxExFfQ= +github.com/samber/lo v1.46.0/go.mod h1:RmDH9Ct32Qy3gduHQuKJ3gW1fMHAnE/fAzQuf6He5cU= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= +github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= @@ -415,48 +369,40 @@ github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stvp/go-udp-testing v0.0.0-20201019212854-469649b16807/go.mod h1:7jxmlfBCDBXRzr0eAQJ48XC1hBu1np4CS5+cHEYfwpc= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= -go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= -go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= +go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= +go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= -go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/automaxprocs v1.4.0 h1:CpDZl6aOlLhReez+8S3eEotD7Jx0Os++lemPlMULQP0= -go.uber.org/automaxprocs v1.4.0/go.mod h1:/mTEdr7LvHhs0v7mjdxDreTz1OG5zdZGqgOnhWiR/+Q= -go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= -go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk= -go.uber.org/goleak v1.2.0/go.mod h1:XJYK+MuIchqpmGmUSAzotztawfKvYLUIgg7guXrwVUo= -go.uber.org/mock v0.3.0 h1:3mUxI1No2/60yUYax92Pt8eNOEecx2D3lcXZh2NEZJo= -go.uber.org/mock v0.3.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= +go.uber.org/automaxprocs v1.5.3 h1:kWazyxZUrS3Gs4qUpbwo5kEIMGe/DAvi5Z4tl2NW4j8= +go.uber.org/automaxprocs v1.5.3/go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnwa1WM0= +go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= +go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU= +go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= -go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= +go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= +go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -466,8 +412,9 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= -golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= -golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= +golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30= +golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -478,8 +425,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20220303212507-bbda1eaf7a17 h1:3MTrJm4PyNL9NBqvYDSj3DHl46qQakyfqfWo4jgfaEM= -golang.org/x/exp v0.0.0-20220303212507-bbda1eaf7a17/go.mod h1:lgLbSvA5ygNOMpwM/9anMpWVlVJ7Z+cHWq/eFuinpGE= +golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8= +golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -492,8 +439,6 @@ golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= @@ -502,12 +447,10 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= -golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.19.0 h1:fEdghXQSo20giMthA7cd28ZC+jts4amQ3YMXiP5oMQ8= +golang.org/x/mod v0.19.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -538,38 +481,26 @@ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= -golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= -golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= +golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.7.0 h1:qe6s0zUXlPX80/dITx3440hWZ7GwMwgDDyrSGTPJG/g= -golang.org/x/oauth2 v0.7.0/go.mod h1:hPLQkd9LyjfXTiRohC/41GhcFqxisoUQ99sCUOHO9x4= +golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +golang.org/x/oauth2 v0.18.0 h1:09qnuIAgzdx1XplqJvW6CQqMCtGZykZWcXzPMPUusvI= +golang.org/x/oauth2 v0.18.0/go.mod h1:Wf7knwG0MPoWIMMBgFlEaSUDaKskp0dCfrlJRJXbBi8= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -580,10 +511,11 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -615,59 +547,47 @@ golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220708085239-5a0f0661e09d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= -golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= +golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= -golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= +golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= +golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= +golang.org/x/term v0.22.0 h1:BbsgPEJULsl2fV/AT3v15Mjva5yXKQDyKf+TbDz7QJk= +golang.org/x/term v0.22.0/go.mod h1:F3qCibpT5AMpCRfhfT53vVJwhLtIVHhB9XDjfFvnMI4= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= -golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.6.0 h1:eTDhh4ZXt5Qf0augr54TN6suAUudPcawVZeIAPU7D4U= +golang.org/x/time v0.6.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -709,27 +629,17 @@ golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= -golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/tools v0.23.0 h1:SGsXPZ+2l4JsgaCKkx+FQ9YZ5XEtA1GZYuoDjenLjvg= +golang.org/x/tools v0.23.0/go.mod h1:pnu6ufv6vQkll6szChhK3C3L/ruaIv5eBeztNG8wtsI= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -gomodules.xyz/jsonpatch/v2 v2.2.0 h1:4pT439QV83L+G9FkcCriY6EkpcK6r6bK+A5FBUMI7qY= -gomodules.xyz/jsonpatch/v2 v2.2.0/go.mod h1:WXp+iVDkoLQqPudfQ9GBlwB2eZ5DKOnjQZCYdOS8GPY= +gomodules.xyz/jsonpatch/v2 v2.4.0 h1:Ci3iUJyx9UeRx7CeFN8ARgGbkESwJK+KB9lLcWxY/Zw= +gomodules.xyz/jsonpatch/v2 v2.4.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= @@ -747,29 +657,16 @@ google.golang.org/api v0.25.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0M google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= -google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= -google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= -google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= -google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= -google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= -google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= -google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= -google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= -google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU= -google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k= -google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= -google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= -google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI= -google.golang.org/api v0.61.0 h1:TXXKS1slM3b2bZNJwD5DV/Tp6/M2cLzLOLh9PjDhrw8= -google.golang.org/api v0.61.0/go.mod h1:xQRti5UdCmoCEqFxcz93fTl338AVqDgyaDRuOZ3hg9I= +google.golang.org/api v0.146.0 h1:9aBYT4vQXt9dhCuLNfwfd3zpwu8atg0yPkjBymwSrOM= +google.golang.org/api v0.146.0/go.mod h1:OARJqIfoYjXJj4C1AiBSXYZt03qsoz8FQYU6fBEfrHM= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= -google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= +google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -801,36 +698,12 @@ google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7Fc google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= -google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= -google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20210713002101-d411969a0d9a/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= -google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= -google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= -google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= -google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w= -google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 h1:KpwkzHKEF7B9Zxg18WzOa7djJ+Ha5DzthMyZYQfEn2A= -google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU= +google.golang.org/genproto v0.0.0-20231009173412-8bfb1ae86b6c h1:ml3TAUoIIzQUtX88s/icpXCFW9lV5VwsuIuS1htNjKY= +google.golang.org/genproto v0.0.0-20231009173412-8bfb1ae86b6c/go.mod h1:MugzuwC+GYOxyF0XUGQvsT97bOgWCV7MM1XMc5FZv8E= +google.golang.org/genproto/googleapis/api v0.0.0-20231009173412-8bfb1ae86b6c h1:0RtEmmHjemvUXloH7+RuBSIw7n+GEHMOMY1CkGYnWq4= +google.golang.org/genproto/googleapis/api v0.0.0-20231009173412-8bfb1ae86b6c/go.mod h1:Wth13BrWMRN/G+guBLupKa6fslcWZv14R0ZKDRkNfY8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231009173412-8bfb1ae86b6c h1:jHkCUWkseRf+W+edG5hMzr/Uh1xkDREY4caybAq4dpY= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231009173412-8bfb1ae86b6c/go.mod h1:4cYg8o5yUbm77w8ZX00LhMVNl/YVBFJRYWDc0uYWMs0= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -843,22 +716,9 @@ google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKa google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= -google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= -google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= -google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.56.3 h1:8I4C0Yq1EjstUzUJzpcRVbuYA2mODtEmpWiQoN/b2nc= -google.golang.org/grpc v1.56.3/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s= -google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= +google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk= +google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -871,9 +731,10 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= -google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= +google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -883,8 +744,6 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EV gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -895,7 +754,6 @@ gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -905,36 +763,38 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.25.4 h1:3YO8J4RtmG7elEgaWMb4HgmpS2CfY1QlaOz9nwB+ZSs= -k8s.io/api v0.25.4/go.mod h1:IG2+RzyPQLllQxnhzD8KQNEu4c4YvyDTpSMztf4A0OQ= -k8s.io/apiextensions-apiserver v0.25.4 h1:7hu9pF+xikxQuQZ7/30z/qxIPZc2J1lFElPtr7f+B6U= -k8s.io/apiextensions-apiserver v0.25.4/go.mod h1:bkSGki5YBoZWdn5pWtNIdGvDrrsRWlmnvl9a+tAw5vQ= -k8s.io/apimachinery v0.25.4 h1:CtXsuaitMESSu339tfhVXhQrPET+EiWnIY1rcurKnAc= -k8s.io/apimachinery v0.25.4/go.mod h1:jaF9C/iPNM1FuLl7Zuy5b9v+n35HGSh6AQ4HYRkCqwo= -k8s.io/client-go v0.25.4 h1:3RNRDffAkNU56M/a7gUfXaEzdhZlYhoW8dgViGy5fn8= -k8s.io/client-go v0.25.4/go.mod h1:8trHCAC83XKY0wsBIpbirZU4NTUpbuhc2JnI7OruGZw= -k8s.io/cloud-provider v0.25.4 h1:juIfru1jVX6BlDWcJ18sv6aWxMSMmcjWf2HNXUtnkiI= -k8s.io/cloud-provider v0.25.4/go.mod h1:L018fvnYxHrJP93UNSu8ODZYd/HCukliBzzNsV4TqC0= -k8s.io/component-base v0.25.4 h1:n1bjg9Yt+G1C0WnIDJmg2fo6wbEU1UGMRiQSjmj7hNQ= -k8s.io/component-base v0.25.4/go.mod h1:nnZJU8OP13PJEm6/p5V2ztgX2oyteIaAGKGMYb2L2cY= -k8s.io/csi-translation-lib v0.25.4 h1:y8+C2sVIkA9K3Q8yofMc8DJzHUyKdFXlHk563nR1Kgc= -k8s.io/csi-translation-lib v0.25.4/go.mod h1:T8l3i4NTGQ0xgXiBHEr4euaO1kw59sNrH57Fa6SXBCY= -k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg= -k8s.io/klog/v2 v2.100.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= -k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f h1:2kWPakN3i/k81b0gvD5C5FJ2kxm1WrQFanWchyKuqGg= -k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f/go.mod h1:byini6yhqGC14c3ebc/QwanvYwhuMWF6yz2F8uwW8eg= -k8s.io/utils v0.0.0-20230209194617-a36077c30491 h1:r0BAOLElQnnFhE/ApUsg3iHdVYYPBjNSSOMowRZxxsY= -k8s.io/utils v0.0.0-20230209194617-a36077c30491/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -knative.dev/pkg v0.0.0-20230502134655-db8a35330281 h1:9mN8O5XO68DKlkzEhFAShUx+O/I+TQR71vmTvYt8oF4= -knative.dev/pkg v0.0.0-20230502134655-db8a35330281/go.mod h1:2qWPP9Gjh9Q7ETti+WRHnBnGCSCq+6q7m3p/nmUQviE= +k8s.io/api v0.30.3 h1:ImHwK9DCsPA9uoU3rVh4QHAHHK5dTSv1nxJUapx8hoQ= +k8s.io/api v0.30.3/go.mod h1:GPc8jlzoe5JG3pb0KJCSLX5oAFIW3/qNJITlDj8BH04= +k8s.io/apiextensions-apiserver v0.30.3 h1:oChu5li2vsZHx2IvnGP3ah8Nj3KyqG3kRSaKmijhB9U= +k8s.io/apiextensions-apiserver v0.30.3/go.mod h1:uhXxYDkMAvl6CJw4lrDN4CPbONkF3+XL9cacCT44kV4= +k8s.io/apimachinery v0.30.3 h1:q1laaWCmrszyQuSQCfNB8cFgCuDAoPszKY4ucAjDwHc= +k8s.io/apimachinery v0.30.3/go.mod h1:iexa2somDaxdnj7bha06bhb43Zpa6eWH8N8dbqVjTUc= +k8s.io/client-go v0.30.3 h1:bHrJu3xQZNXIi8/MoxYtZBBWQQXwy16zqJwloXXfD3k= +k8s.io/client-go v0.30.3/go.mod h1:8d4pf8vYu665/kUbsxWAQ/JDBNWqfFeZnvFiVdmx89U= +k8s.io/cloud-provider v0.30.3 h1:SNWZmllTymOTzIPJuhtZH6il/qVi75dQARRQAm9k6VY= +k8s.io/cloud-provider v0.30.3/go.mod h1:Ax0AVdHnM7tMYnJH1Ycy4SMBD98+4zA+tboUR9eYsY8= +k8s.io/component-base v0.30.3 h1:Ci0UqKWf4oiwy8hr1+E3dsnliKnkMLZMVbWzeorlk7s= +k8s.io/component-base v0.30.3/go.mod h1:C1SshT3rGPCuNtBs14RmVD2xW0EhRSeLvBh7AGk1quA= +k8s.io/csi-translation-lib v0.30.3 h1:wBaPWnOi14/vANRIrp8pmbdx/Pgz2QRcroH7wkodezc= +k8s.io/csi-translation-lib v0.30.3/go.mod h1:3AizNZbDttVDH1RO0x1yGEQP74e9Xbfb60IBP1oWO1o= +k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= +k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= +k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= +k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340/go.mod h1:yD4MZYeKMBwQKVht279WycxKyM84kkAx2DPrTXaeb98= +k8s.io/utils v0.0.0-20240102154912-e7106e64919e h1:eQ/4ljkx21sObifjzXwlPKpdGLrCfRziVtos3ofG/sQ= +k8s.io/utils v0.0.0-20240102154912-e7106e64919e/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +knative.dev/pkg v0.0.0-20231010144348-ca8c009405dd h1:KJXBX9dOmRTUWduHg1gnWtPGIEl+GMh8UHdrBEZgOXE= +knative.dev/pkg v0.0.0-20231010144348-ca8c009405dd/go.mod h1:36cYnaOVHkzmhgybmYX6zDaTl3PakFeJQJl7wi6/RLE= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/controller-runtime v0.13.1 h1:tUsRCSJVM1QQOOeViGeX3GMT3dQF1eePPw6sEE3xSlg= -sigs.k8s.io/controller-runtime v0.13.1/go.mod h1:Zbz+el8Yg31jubvAEyglRZGdLAjplZl+PgtYNI6WNTI= +sigs.k8s.io/controller-runtime v0.18.4 h1:87+guW1zhvuPLh1PHybKdYFLU0YJp4FhJRmiHvm5BZw= +sigs.k8s.io/controller-runtime v0.18.4/go.mod h1:TVoGrfdpbA9VRFaRnKgk9P5/atA0pMwq+f+msb9M8Sg= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= -sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE= -sigs.k8s.io/structured-merge-diff/v4 v4.2.3/go.mod h1:qjx8mGObPmV2aSZepjQjbmb2ihdVs8cGKBraizNC69E= -sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= -sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= +sigs.k8s.io/karpenter v1.0.4 h1:tE4gbYjXZ2uny35QmrKFSuMhxkIfGCqCulXhwyN2D3c= +sigs.k8s.io/karpenter v1.0.4/go.mod h1:3NLmsnHHw8p4VutpjTOPUZyhE3qH6yGTs8O94Lsu8uw= +sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4= +sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08= +sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= +sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= diff --git a/hack/code/instancetype_testdata_gen.go b/hack/code/instancetype_testdata_gen.go deleted file mode 100644 index 13b4e771..00000000 --- a/hack/code/instancetype_testdata_gen.go +++ /dev/null @@ -1,162 +0,0 @@ -/* -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. -*/ - -package main - -import ( - "bytes" - "context" - "fmt" - "os" - "strings" - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute" - - "github.com/samber/lo" -) - -func main() { - fmt.Println("starting generation of sku data...") - tenantID := os.Getenv("TENANT_ID") - sub := os.Getenv("SUBSCRIPTION_ID") - aadClientID := os.Getenv("AAD_CLIENT_ID") - aadClientSecret := os.Getenv("AAD_CLIENT_SECRET") - path, region, selectedSkus := os.Args[2], os.Args[3], os.Args[4] - skus := strings.Split(selectedSkus, ",") - targetSkus := map[string]struct{}{} - for _, sku := range skus { - targetSkus[sku] = struct{}{} - } - if tenantID == "" || sub == "" || aadClientID == "" || aadClientSecret == "" || path == "" { - fmt.Println("missing env vars") - os.Exit(1) - } - cred, err := azidentity.NewClientSecretCredential(tenantID, aadClientID, aadClientSecret, nil) - if err != nil { - fmt.Printf("failed to create credential: %v", err) - } - - ctx := context.Background() - if err != nil { - fmt.Printf("failed to create client factory: %v", err) - } - - client, err := armcompute.NewResourceSKUsClient(sub, cred, nil) - if err != nil { - panic(err) - } - pager := client.NewListPager(&armcompute.ResourceSKUsClientListOptions{ - // filter by location - Filter: lo.ToPtr("location eq 'eastus'"), - }) - skuData := []*armcompute.ResourceSKU{} - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - fmt.Printf("failed to get next page: %v", err) - } - for _, sku := range page.Value { - if _, ok := targetSkus[*sku.Name]; !ok { - continue - } - skuData = append(skuData, sku) - } - } - fmt.Println("Successfully Fetched all the SKUs", len(skuData)) - writeSkuData(skuData, region, path) - fmt.Println("Successfully Generated all the SKUs") -} - -func writeSkuData(ResourceSkus []*armcompute.ResourceSKU, location, path string) { - src := &bytes.Buffer{} - fmt.Fprintln(src, "//go:build !ignore_autogenerated") - license := lo.Must(os.ReadFile("hack/boilerplate.go.txt")) - fmt.Fprintln(src, string(license)) - fmt.Fprintln(src, "package fake") - fmt.Fprintln(src, "import (") - fmt.Fprintln(src, ` "github.com/samber/lo"`) - fmt.Fprintln(src, ` // nolint SA1019 - deprecated package`) - fmt.Fprintln(src, ` "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute"`) - fmt.Fprintln(src, ")") - now := time.Now().UTC().Format(time.RFC3339) - fmt.Fprintf(src, "// generated at %s\n\n\n", now) - fmt.Fprintln(src, "// ResourceSkus is a list of all available skus from azure") - fmt.Fprintln(src, "var ResourceSkus = []compute.ResourceSku{") - for _, sku := range ResourceSkus { - fmt.Fprintln(src, " {") - fmt.Fprintf(src, " Name: lo.ToPtr(%q),\n", lo.FromPtrOr(sku.Name, "")) - fmt.Fprintf(src, " Tier: lo.ToPtr(%q),\n", lo.FromPtrOr(sku.Tier, "")) - fmt.Fprintf(src, " Kind: lo.ToPtr(%q),\n", lo.FromPtrOr(sku.Kind, "")) - fmt.Fprintf(src, " Size: lo.ToPtr(%q),\n", lo.FromPtrOr(sku.Size, "")) - fmt.Fprintf(src, " Family: lo.ToPtr(%q),\n", lo.FromPtrOr(sku.Family, "")) - fmt.Fprintf(src, " ResourceType: lo.ToPtr(%q),\n", lo.FromPtrOr(sku.ResourceType, "")) - fmt.Fprintln(src, " APIVersions: &[]string{") - for _, apiVersion := range sku.APIVersions { - fmt.Fprintf(src, " lo.ToPtr(%q),\n", lo.FromPtrOr(apiVersion, "")) - } - fmt.Fprintln(src, " },") - if sku.Capacity != nil { - fmt.Fprintln(src, " Capacity: compute.ResourceSkuCapacity{") - fmt.Fprintf(src, " Minimum: lo.ToPtr(%d),\n", lo.FromPtrOr(sku.Capacity.Minimum, 0)) - fmt.Fprintf(src, " Maximum: lo.ToPtr(%d),\n", lo.FromPtrOr(sku.Capacity.Maximum, 0)) - fmt.Fprintf(src, " Default: lo.ToPtr(%d),\n", lo.FromPtrOr(sku.Capacity.Default, 0)) - fmt.Fprintf(src, " },") - } - fmt.Fprintf(src, " Costs: &[]compute.ResourceSkuCosts{") - for _, cost := range sku.Costs { - fmt.Fprintf(src, " {MeterID: lo.ToPtr(%s), Quantity: lo.ToPtr(%q), ExtendedUnit: lo.ToPtr(%q)},", lo.FromPtrOr(cost.MeterID, ""), lo.FromPtrOr(cost.Quantity, 0.0), lo.FromPtrOr(cost.ExtendedUnit, "")) - } - fmt.Fprintln(src, " },") - fmt.Fprintln(src, " Restrictions: &[]compute.ResourceSkuRestrictions{") - for _, restriction := range sku.Restrictions { - fmt.Fprintln(src, " {") - fmt.Printf(" Type: lo.ToPtr(%s),", lo.FromPtrOr(restriction.Type, "")) - for _, value := range restriction.Values { - fmt.Fprintf(src, " Values: &[]string{%q},", lo.FromPtrOr(value, "")) - } - fmt.Fprintln(src, " },") - } - fmt.Fprintln(src, " },") - fmt.Fprintln(src, " Capabilities: &[]compute.ResourceSkuCapabilities{") - for _, capability := range sku.Capabilities { - fmt.Fprintf(src, " {Name: lo.ToPtr(%q), Value: lo.ToPtr(%q)},\n", *capability.Name, *capability.Value) - } - fmt.Fprintln(src, " },") - fmt.Fprintf(src, " Locations: &[]string{%q},\n", location) - fmt.Fprintf(src, " LocationInfo: &[]compute.ResourceSkuLocationInfo{") - for _, locationInfo := range sku.LocationInfo { - fmt.Fprintf(src, " {Location: lo.ToPtr(%q),", location) - fmt.Fprintln(src, " Zones: &[]string{") - for _, zone := range locationInfo.Zones { - fmt.Fprintf(src, " %q,\n", lo.FromPtr(zone)) - } - fmt.Fprintln(src, " },") - - } - fmt.Fprintln(src, " },") - fmt.Fprintln(src, " },") - - fmt.Fprintln(src, "},") - } - - fmt.Fprintln(src, "}") - fmt.Println(src.String()) - fmt.Println("writing file to", path) - if err := os.WriteFile(path, src.Bytes(), 0600); err != nil { - fmt.Printf("failed to write file: %v", err) - panic(err) - } -} diff --git a/hack/code/prices/prices_gen.go b/hack/code/prices/prices_gen.go deleted file mode 100644 index 43d22134..00000000 --- a/hack/code/prices/prices_gen.go +++ /dev/null @@ -1,188 +0,0 @@ -/* -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. -*/ - -package main - -import ( - "bytes" - "context" - "flag" - "fmt" - "go/format" - "log" - "os" - "runtime" - "runtime/pprof" - "sort" - "time" - - "github.com/azure/gpu-provisioner/pkg/providers/pricing" - "github.com/samber/lo" -) - -var regions = []string{ - "australiacentral", - "australiacentral2", - "australiaeast", - "australiasoutheast", - "brazilsouth", - "brazilsoutheast", - "canadacentral", - "canadaeast", - "centralindia", - "centralus", - "eastasia", - "eastus", - "eastus2", - "francecentral", - "francesouth", - "germanynorth", - "germanywestcentral", - "japaneast", - "japanwest", - "jioindiacentral", - "jioindiawest", - "koreacentral", - "koreasouth", - "northcentralus", - "northeurope", - "norwayeast", - "norwaywest", - "polandcentral", - "qatarcentral", - "southafricanorth", - "southafricawest", - "southcentralus", - "southeastasia", - "southindia", - "swedencentral", - "swedensouth", - "switzerlandnorth", - "switzerlandwest", - "uaecentral", - "uaenorth", - "uksouth", - "ukwest", - "westcentralus", - "westeurope", - "westindia", - "westus", - "westus2", - "westus3", -} - -func main() { - flag.Parse() - if flag.NArg() != 1 { - log.Fatalf("Usage: %s pkg/providers/pricing/zz_generated.pricing.go", os.Args[0]) - } - - generatePricing(flag.Arg(0)) -} - -func generatePricing(filePath string) { - f, err := os.Create("pricing.heapprofile") - if err != nil { - log.Fatal("could not create memory profile: ", err) - } - defer f.Close() // error handling omitted for example - - ctx := context.Background() - updateStarted := time.Now() - src := &bytes.Buffer{} - fmt.Fprintln(src, "//go:build !ignore_autogenerated") - license := lo.Must(os.ReadFile("hack/boilerplate.go.txt")) - fmt.Fprintln(src, string(license)) - fmt.Fprintln(src, "package pricing") - fmt.Fprintln(src, `import "time"`) - now := time.Now().UTC().Format(time.RFC3339) - fmt.Fprintf(src, "// generated at %s\n\n\n", now) - fmt.Fprintf(src, "var initialPriceUpdate, _ = time.Parse(time.RFC3339, \"%s\")\n", now) - fmt.Fprintln(src, "var initialOnDemandPrices = map[string]map[string]float64{}") - fmt.Fprintln(src, "func init() {") - // record prices for each region - var pricingProviderByRegion = map[string]chan *pricing.Provider{} - for _, region := range regions { - resultsChan := make(chan *pricing.Provider) - log.Println("fetching pricing data in region", region) - go func(region string, resultsChan chan *pricing.Provider) { - pricingProvider := pricing.NewProvider(ctx, pricing.NewAPI(), region, make(chan struct{})) - attempts := 0 - for { - if pricingProvider.OnDemandLastUpdated().After(updateStarted) { - break - } - - if attempts == 0 { - log.Println("started wait loop for pricing update on region", region) - } else if attempts%10 == 0 { - log.Printf("waiting on pricing update on region %s...\n", region) - } else if time.Since(updateStarted) >= time.Minute*5 { - log.Fatalf("failed to update region %s within 2 minutes", region) - } - time.Sleep(1 * time.Second) - attempts += 1 - } - log.Printf("fetched pricing for region %s\n", region) - resultsChan <- pricingProvider - }(region, resultsChan) - pricingProviderByRegion[region] = resultsChan - } - for _, region := range regions { - pricingProviderChan := pricingProviderByRegion[region] - var pricingProvider *pricing.Provider = <-pricingProviderChan - log.Println("writing output for", region) - instanceTypes := pricingProvider.InstanceTypes() - sort.Strings(instanceTypes) - - writePricing(src, instanceTypes, region, pricingProvider.OnDemandPrice) - } - fmt.Fprintln(src, "}") - formatted, err := format.Source(src.Bytes()) - if err != nil { - if err := os.WriteFile(filePath, src.Bytes(), 0644); err != nil { - log.Fatalf("writing output, %s", err) - } - log.Fatalf("formatting generated source, %s", err) - } - - if err := os.WriteFile(filePath, formatted, 0644); err != nil { - log.Fatalf("writing output, %s", err) - } - runtime.GC() - if err := pprof.WriteHeapProfile(f); err != nil { - log.Fatal("could not write memory profile: ", err) - } - log.Printf("successfully generated pricing file: \"%s\"\n", filePath) -} - -func writePricing(src *bytes.Buffer, instanceNames []string, region string, getPrice func(instanceType string) (float64, bool)) { - fmt.Fprintf(src, "// %s\n", region) - fmt.Fprintf(src, "initialOnDemandPrices[%q] = map[string]float64{\n", region) - sort.Strings(instanceNames) - for _, instanceName := range instanceNames { - price, ok := getPrice(instanceName) - if !ok { - continue - } - - // TODO: look at grouping by families to make the generated output nicer: - // https://github.com/Azure/karpenter/pull/94#discussion_r1120901524 - _, err := fmt.Fprintf(src, "\"%s\":%f, \n", instanceName, price) - if err != nil { - log.Fatalf("error writing, %s", err) - } - } - fmt.Fprintln(src, "\n}") -} diff --git a/hack/codegen.sh b/hack/codegen.sh deleted file mode 100755 index 31774b41..00000000 --- a/hack/codegen.sh +++ /dev/null @@ -1,112 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -if [ -z ${ENABLE_GIT_PUSH+x} ];then - ENABLE_GIT_PUSH=false -fi - -echo "api-code-gen running ENABLE_GIT_PUSH: ${ENABLE_GIT_PUSH}" - -pricing() { - GENERATED_FILE="pkg/providers/pricing/zz_generated.pricing.go" - NO_UPDATE=$' pkg/providers/pricing/zz_generated.pricing.go | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)' - SUBJECT="Pricing" - - go run hack/code/prices/prices_gen.go -- "${GENERATED_FILE}" - - GIT_DIFF=$(git diff --stat "${GENERATED_FILE}") - checkForUpdates "${GIT_DIFF}" "${NO_UPDATE}" "${SUBJECT} beside timestamps since last update" "${GENERATED_FILE}" -} - -skugen() { - SUBSCRIPTION_ID=$(az account show --query 'id' --output tsv) - export SUBSCRIPTION_ID - if [ -z "${SUBSCRIPTION_ID}" ]; then - echo "No subscription is set. Please login and set a subscription." - return 1 - fi - - RG_NAME="skugen-sp" - RG_LOCATION="eastus" - - az group create --name "${RG_NAME}" --location "${RG_LOCATION}" > /dev/null 2>&1 - - SP_NAME="skugen-$(date +%s)" - - # Note to use skugen you need valid azure credentials, and references to token credentials - # you can create a token credential by running the following command: - # az ad sp create-for-rbac --name "skugen" --role contributor --scopes /subscriptions//resourceGroups/ - # and then export the following environment variables that use the returned Service Principal JSON: - # export TENANT_ID= - # export AAD_CLIENT_ID= - # export AAD_CLIENT_SECRET= - # This script automatically creates these variables and deletes the service principal after running, - # but just note these variables are required to interact with the skugen API. - - # Fix for SC2086 - SP_JSON=$(az ad sp create-for-rbac --name "${SP_NAME}" --role contributor --scopes /subscriptions/"${SUBSCRIPTION_ID}"/resourceGroups/"${RG_NAME}") - - # Fixes for SC2155 and SC2086 combined - TENANT_ID=$(echo "$SP_JSON" | jq -r '.tenant') - export TENANT_ID - - AAD_CLIENT_ID=$(echo "$SP_JSON" | jq -r '.appId') - export AAD_CLIENT_ID - - AAD_CLIENT_SECRET=$(echo "$SP_JSON" | jq -r '.password') - export AAD_CLIENT_SECRET - GENERATED_FILE=$(PWD)/"pkg/fake/zz_generated.sku.go" - echo GENERATED_FILE: "${GENERATED_FILE}" - SUBJECT="SKUGEN" - NO_UPDATE=$' pkg/fake/zz_generated.sku.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)' - - go run hack/code/instancetype_testdata_gen.go -- "${GENERATED_FILE}" "" "Standard_D2_v2,Standard_D2_v3,Standard_DS2_v2,Standard_D2s_v3,Standard_D2_v5,Standard_F16s_v2,Standard_NC24ads_A100_v4" - - GIT_DIFF=$(git diff --stat "${GENERATED_FILE}") - checkForUpdates "${GIT_DIFF}" "${NO_UPDATE}" "${SUBJECT} beside timestamps since last update" "${GENERATED_FILE}" - - az ad sp delete --id "${AAD_CLIENT_ID}" -} - -checkForUpdates() { - GIT_DIFF=$1 - NO_UPDATE=$2 - SUBJECT=$3 - GENERATED_FILE=$4 - - echo "Checking git diff for updates. ${GIT_DIFF}, ${NO_UPDATE}" - if [[ "${GIT_DIFF}" == "${NO_UPDATE}" ]]; then - noUpdates "${SUBJECT}" - git checkout "${GENERATED_FILE}" - else - echo "true" >/tmp/api-code-gen-updates - git add "${GENERATED_FILE}" - if [[ $ENABLE_GIT_PUSH == true ]]; then - gitCommitAndPush "${SUBJECT}" - fi - fi -} - -gitOpenAndPullBranch() { - git fetch origin - git checkout api-code-gen || git checkout -b api-code-gen || true -} - -gitCommitAndPush() { - UPDATE_SUBJECT=$1 - git commit -m "APICodeGen updates from Azure API for ${UPDATE_SUBJECT}" - git push --set-upstream origin api-code-gen -} - -noUpdates() { - UPDATE_SUBJECT=$1 - echo "No updates from Azure API for ${UPDATE_SUBJECT}" -} - -if [[ $ENABLE_GIT_PUSH == true ]]; then - gitOpenAndPullBranch -fi - -# Run all the codegen scripts -pricing -skugen diff --git a/pkg/apis/apis.go b/pkg/apis/apis.go deleted file mode 100644 index 55e5dc99..00000000 --- a/pkg/apis/apis.go +++ /dev/null @@ -1,47 +0,0 @@ -/* - Copyright (c) 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. -*/ - -// Package apis contains Kubernetes API groups. -package apis - -import ( - _ "embed" - - "k8s.io/apimachinery/pkg/runtime" - - "github.com/aws/karpenter-core/pkg/operator/scheme" - - "github.com/samber/lo" - - coresettings "github.com/aws/karpenter-core/pkg/apis/settings" - "github.com/azure/gpu-provisioner/pkg/apis/settings" - "github.com/azure/gpu-provisioner/pkg/apis/v1alpha1" -) - -var ( - // Builder includes all types within the apis package - Builder = runtime.NewSchemeBuilder( - v1alpha1.SchemeBuilder.AddToScheme, - ) - // AddToScheme may be used to add all resources defined in the project to a Scheme - AddToScheme = Builder.AddToScheme - Settings = []coresettings.Injectable{&settings.Settings{}} -) - -//go:generate controller-gen crd object:headerFile="../../hack/boilerplate.go.txt" paths="./..." output:crd:artifacts:config=crds - -func init() { - lo.Must0(AddToScheme(scheme.Scheme)) -} diff --git a/pkg/apis/crds/karpenter.sh_machines.yaml b/pkg/apis/crds/karpenter.sh_machines.yaml deleted file mode 100644 index 0304d1fc..00000000 --- a/pkg/apis/crds/karpenter.sh_machines.yaml +++ /dev/null @@ -1,293 +0,0 @@ ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.12.0 - name: machines.karpenter.sh -spec: - group: karpenter.sh - names: - categories: - - karpenter - kind: Machine - listKind: MachineList - plural: machines - singular: machine - scope: Cluster - versions: - - additionalPrinterColumns: - - jsonPath: .metadata.labels.node\.kubernetes\.io/instance-type - name: Type - type: string - - jsonPath: .metadata.labels.karpenter\.k8s\.azure/zone - name: Zone - type: string - - jsonPath: .status.nodeName - name: Node - type: string - - jsonPath: .status.conditions[?(@.type=="Ready")].status - name: Ready - type: string - - jsonPath: .metadata.creationTimestamp - name: Age - type: date - - jsonPath: .metadata.labels.karpenter\.sh/capacity-type - name: Capacity - priority: 1 - type: string - - jsonPath: .metadata.labels.karpenter\.sh/provisioner-name - name: Provisioner - priority: 1 - type: string - - jsonPath: .spec.machineTemplateRef.name - name: Template - priority: 1 - type: string - name: v1alpha5 - schema: - openAPIV3Schema: - description: Machine is the Schema for the Machines API - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: MachineSpec describes the desired state of the Machine - properties: - kubelet: - description: Kubelet are options passed to the kubelet when provisioning nodes - properties: - clusterDNS: - description: clusterDNS is a list of IP addresses for the cluster DNS server. Note that not all providers may use all addresses. - items: - type: string - type: array - containerRuntime: - description: ContainerRuntime is the container runtime to be used with your worker nodes. - type: string - cpuCFSQuota: - description: CPUCFSQuota enables CPU CFS quota enforcement for containers that specify CPU limits. - type: boolean - evictionHard: - additionalProperties: - type: string - description: EvictionHard is the map of signal names to quantities that define hard eviction thresholds - type: object - evictionMaxPodGracePeriod: - description: EvictionMaxPodGracePeriod is the maximum allowed grace period (in seconds) to use when terminating pods in response to soft eviction thresholds being met. - format: int32 - type: integer - evictionSoft: - additionalProperties: - type: string - description: EvictionSoft is the map of signal names to quantities that define soft eviction thresholds - type: object - evictionSoftGracePeriod: - additionalProperties: - type: string - description: EvictionSoftGracePeriod is the map of signal names to quantities that define grace periods for each eviction signal - type: object - imageGCHighThresholdPercent: - description: ImageGCHighThresholdPercent is the percent of disk usage after which image garbage collection is always run. The percent is calculated by dividing this field value by 100, so this field must be between 0 and 100, inclusive. When specified, the value must be greater than ImageGCLowThresholdPercent. - format: int32 - maximum: 100 - minimum: 0 - type: integer - imageGCLowThresholdPercent: - description: ImageGCLowThresholdPercent is the percent of disk usage before which image garbage collection is never run. Lowest disk usage to garbage collect to. The percent is calculated by dividing this field value by 100, so the field value must be between 0 and 100, inclusive. When specified, the value must be less than imageGCHighThresholdPercent - format: int32 - maximum: 100 - minimum: 0 - type: integer - kubeReserved: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: KubeReserved contains resources reserved for Kubernetes system components. - type: object - maxPods: - description: MaxPods is an override for the maximum number of pods that can run on a worker node instance. - format: int32 - minimum: 0 - type: integer - podsPerCore: - description: PodsPerCore is an override for the number of pods that can run on a worker node instance based on the number of cpu cores. This value cannot exceed MaxPods, so, if MaxPods is a lower value, that value will be used. - format: int32 - minimum: 0 - type: integer - systemReserved: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: SystemReserved contains resources reserved for OS system daemons and kernel memory. - type: object - type: object - machineTemplateRef: - description: MachineTemplateRef is a reference to an object that defines provider specific configuration - properties: - apiVersion: - description: API version of the referent - type: string - kind: - description: 'Kind of the referent; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds"' - type: string - name: - description: 'Name of the referent; More info: http://kubernetes.io/docs/user-guide/identifiers#names' - type: string - required: - - name - type: object - requirements: - description: Requirements are layered with Labels and applied to every node. - items: - description: A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - properties: - key: - description: The label key that the selector applies to. - type: string - operator: - description: Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. - type: string - values: - description: An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - resources: - description: Resources models the resource requirements for the Machine to launch - properties: - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: Requests describes the minimum required resources for the Machine to launch - type: object - type: object - startupTaints: - description: StartupTaints are taints that are applied to nodes upon startup which are expected to be removed automatically within a short period of time, typically by a DaemonSet that tolerates the taint. These are commonly used by daemonsets to allow initialization and enforce startup ordering. StartupTaints are ignored for provisioning purposes in that pods are not required to tolerate a StartupTaint in order to have nodes provisioned for them. - items: - description: The node this Taint is attached to has the "effect" on any pod that does not tolerate the Taint. - properties: - effect: - description: Required. The effect of the taint on pods that do not tolerate the taint. Valid effects are NoSchedule, PreferNoSchedule and NoExecute. - type: string - key: - description: Required. The taint key to be applied to a node. - type: string - timeAdded: - description: TimeAdded represents the time at which the taint was added. It is only written for NoExecute taints. - format: date-time - type: string - value: - description: The taint value corresponding to the taint key. - type: string - required: - - effect - - key - type: object - type: array - taints: - description: Taints will be applied to the machine's node. - items: - description: The node this Taint is attached to has the "effect" on any pod that does not tolerate the Taint. - properties: - effect: - description: Required. The effect of the taint on pods that do not tolerate the taint. Valid effects are NoSchedule, PreferNoSchedule and NoExecute. - type: string - key: - description: Required. The taint key to be applied to a node. - type: string - timeAdded: - description: TimeAdded represents the time at which the taint was added. It is only written for NoExecute taints. - format: date-time - type: string - value: - description: The taint value corresponding to the taint key. - type: string - required: - - effect - - key - type: object - type: array - type: object - status: - description: MachineStatus defines the observed state of Machine - properties: - allocatable: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: Allocatable is the estimated allocatable capacity of the machine - type: object - capacity: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: Capacity is the estimated full capacity of the machine - type: object - conditions: - description: Conditions contains signals for health and readiness - items: - description: 'Condition defines a readiness condition for a Knative resource. See: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties' - properties: - lastTransitionTime: - description: LastTransitionTime is the last time the condition transitioned from one status to another. We use VolatileTime in place of metav1.Time to exclude this from creating equality.Semantic differences (all other things held constant). - type: string - message: - description: A human readable message indicating details about the transition. - type: string - reason: - description: The reason for the condition's last transition. - type: string - severity: - description: Severity with which to treat failures of this type of condition. When this is not specified, it defaults to Error. - type: string - status: - description: Status of the condition, one of True, False, Unknown. - type: string - type: - description: Type of condition. - type: string - required: - - status - - type - type: object - type: array - nodeName: - description: NodeName is the name of the corresponding node object - type: string - providerID: - description: ProviderID of the corresponding node object - type: string - type: object - type: object - served: true - storage: true - subresources: - status: {} diff --git a/pkg/apis/settings/settings.go b/pkg/apis/settings/settings.go deleted file mode 100644 index c34a7b1d..00000000 --- a/pkg/apis/settings/settings.go +++ /dev/null @@ -1,93 +0,0 @@ -/* - Copyright (c) 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. -*/ - -package settings - -import ( - "context" - "encoding/json" - "fmt" - - "github.com/go-playground/validator/v10" - "go.uber.org/multierr" - v1 "k8s.io/api/core/v1" - "knative.dev/pkg/configmap" -) - -type settingsKeyType struct{} - -var ContextKey = settingsKeyType{} - -var defaultSettings = Settings{ - ClusterName: "", -} - -// +k8s:deepcopy-gen=true -type Settings struct { - ClusterName string `validate:"required"` -} - -func (*Settings) ConfigMap() string { - return "gpu-provisioner-global-settings" -} - -// Inject creates a Settings from the supplied ConfigMap -func (*Settings) Inject(ctx context.Context, cm *v1.ConfigMap) (context.Context, error) { - s := defaultSettings.DeepCopy() - - if err := configmap.Parse(cm.Data, - configmap.AsString("azure.clusterName", &s.ClusterName), - ); err != nil { - return ctx, fmt.Errorf("parsing settings, %w", err) - } - if err := s.Validate(); err != nil { - return ctx, fmt.Errorf("validating settings, %w", err) - } - - return ToContext(ctx, s), nil -} - -func (s Settings) Data() (map[string]string, error) { - d := map[string]string{} - - raw, err := json.Marshal(s) - if err != nil { - return nil, fmt.Errorf("marshaling settings, %w", err) - } - if err = json.Unmarshal(raw, &d); err != nil { - return d, fmt.Errorf("unmarshalling settings, %w", err) - } - return d, nil -} - -func (s Settings) Validate() error { - validate := validator.New() - return multierr.Combine( - validate.Struct(s), - ) -} - -func ToContext(ctx context.Context, s *Settings) context.Context { - return context.WithValue(ctx, ContextKey, s) -} - -func FromContext(ctx context.Context) *Settings { - data := ctx.Value(ContextKey) - if data == nil { - // This is developer error if this happens, so we should panic - panic("settings doesn't exist in context") - } - return data.(*Settings) -} diff --git a/pkg/apis/settings/suite_test.go b/pkg/apis/settings/suite_test.go deleted file mode 100644 index 2c619e03..00000000 --- a/pkg/apis/settings/suite_test.go +++ /dev/null @@ -1,59 +0,0 @@ -/* - Copyright (c) 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. -*/ - -package settings_test - -import ( - "context" - "testing" - - . "github.com/onsi/ginkgo/v2" - . "github.com/onsi/gomega" - v1 "k8s.io/api/core/v1" - . "knative.dev/pkg/logging/testing" - - "github.com/azure/gpu-provisioner/pkg/apis/settings" -) - -var ctx context.Context - -func TestAPIs(t *testing.T) { - ctx = TestContextWithLogger(t) - RegisterFailHandler(Fail) - RunSpecs(t, "Settings") -} - -var _ = Describe("Validation", func() { - It("should succeed to set defaults", func() { - cm := &v1.ConfigMap{ - Data: map[string]string{ - "azure.clusterName": "my-cluster", - }, - } - ctx, err := (&settings.Settings{}).Inject(ctx, cm) - Expect(err).ToNot(HaveOccurred()) - s := settings.FromContext(ctx) - Expect(s.ClusterName).To(Equal("my-cluster")) - - }) - - It("should fail validation with panic when clusterName not included", func() { - cm := &v1.ConfigMap{ - Data: map[string]string{}, - } - _, err := (&settings.Settings{}).Inject(ctx, cm) - Expect(err).To(HaveOccurred()) - }) -}) diff --git a/pkg/apis/settings/zz_generated.deepcopy.go b/pkg/apis/settings/zz_generated.deepcopy.go deleted file mode 100644 index 20dcda75..00000000 --- a/pkg/apis/settings/zz_generated.deepcopy.go +++ /dev/null @@ -1,38 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* - Copyright (c) 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. -*/ - -// Code generated by controller-gen. DO NOT EDIT. - -package settings - -import () - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Settings) DeepCopyInto(out *Settings) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Settings. -func (in *Settings) DeepCopy() *Settings { - if in == nil { - return nil - } - out := new(Settings) - in.DeepCopyInto(out) - return out -} diff --git a/pkg/apis/v1alpha1/register.go b/pkg/apis/v1alpha1/register.go deleted file mode 100644 index 90fa69c3..00000000 --- a/pkg/apis/v1alpha1/register.go +++ /dev/null @@ -1,153 +0,0 @@ -/* - Copyright (c) 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. -*/ - -package v1alpha1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - //nolint SA1019 - deprecated package - "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute" - "github.com/aws/karpenter-core/pkg/apis/v1alpha5" -) - -const () - -var ( - LabelDomain = "karpenter.k8s.azure" - - // may not be able to use Regular instead of On-demand - PrioritySpot = string(compute.Spot) - PriorityRegular = string(compute.Regular) - AzureToKubeArchitectures = map[string]string{ - // TODO: consider using constants like compute.ArchitectureArm64 - "x64": v1alpha5.ArchitectureAmd64, - "Arm64": v1alpha5.ArchitectureArm64, - } - RestrictedLabelDomains = []string{ - LabelDomain, - } - - // alternative zone label for Machine (the standard one is protected for AKS nodes) - AlternativeLabelTopologyZone = LabelDomain + "/zone" - - ManufacturerNvidia = "nvidia" - - // TODO: this set needs to be designed properly and carefully; essentially represents the API - - LabelSKUTier = LabelDomain + "/sku-tier" // Basic, Standard [, Premium?] - - // composites - LabelSKUName = LabelDomain + "/sku-name" // Standard_A1_v2 - LabelSKUSize = LabelDomain + "/sku-size" // A1_v2 - LabelSKUSeries = LabelDomain + "/sku-series" // DCSv3 (Family+Subfamily+AdditionalFeatures+Version] - - // size parts - LabelSKUFamily = LabelDomain + "/sku-family" // standardAv2Family - LabelSKUSubfamily = LabelDomain + "/sku-subfamily" // TODO:example - LabelSKUCPU = LabelDomain + "/sku-cpu" // sku.vCPUs - LabelSKUCPUConstrained = LabelDomain + "/sku-cpu-constrained" - LabelSKUAccelerator = LabelDomain + "/sku-accelerator" - LabelSKUVersion = LabelDomain + "/sku-version" // v1 (?), v2,v3,... - - // capabilities (from additive features in VM size name, or from SKU capabilities) - // https://learn.microsoft.com/en-us/azure/virtual-machines/vm-naming-conventions - LabelSKUCpuTypeAmd = LabelDomain + "/sku-cpu-type-amd" // a - LabelSKUStorageBlockPerformance = LabelDomain + "/sku-storage-block-performance" // b - LabelSKUConfidential = LabelDomain + "/sku-confidential" // c - LabelSKUStorageDiskful = LabelDomain + "/sku-storage-diskful" // d - LabelSKUIsolatedSize = LabelDomain + "/sku-isolated-size" // i - LabelSKUMemoryLow = LabelDomain + "/sku-memory-low" // l - LabelSKUMemoryIntensive = LabelDomain + "/sku-memory-intensive" // m - LabelSKUMemoryTiny = LabelDomain + "/sku-memory-tiny" // t - LabelSKUStoragePremiumCapable = LabelDomain + "/sku-storage-premium-capable" // s = sku.UltraSSDAvailable (?) - - LabelSKUMemory = LabelDomain + "/sku-memory" // sku.MemoryGB - LabelSKUHyperVGeneration = LabelDomain + "/sku-hyperv-generation" // sku.HyperVGenerations - LabelSKUAcceleratedNetworking = LabelDomain + "/sku-networking-accelerated" // sku.AcceleratedNetworkingEnabled - - LabelSKUEncryptionAtHostSupported = LabelDomain + "/sku-encryptionathost-capable" // sku.EncryptionAtHostSupported - LabelSKUEphemeralOSDiskSupported = LabelDomain + "/sku-storage-os-ephemeral-capable" // sku.EphemeralOSDiskSupported - LabelSKUCachedDiskSize = LabelDomain + "/sku-storage-cache-maxsize" // sku.CachedDiskBytes - LabelSKUMaxResourceVolume = LabelDomain + "/sku-storage-temp-maxsize" // sku.MaxResourceVolumeMB - - // GPU LABELS! - LabelSKUGPUName = LabelDomain + "/sku-gpu-name" // ie GPU Accelerator type we parse from vmSize - LabelSKUGPUManufacturer = LabelDomain + "/sku-gpu-manufacturer" // ie NVIDIA, AMD, etc - LabelSKUGPUCount = LabelDomain + "/sku-gpu-count" // ie 16, 32, etc - - SkuFeatureToLabel = map[rune]string{ - 'a': LabelSKUCpuTypeAmd, - 'b': LabelSKUStorageBlockPerformance, - 'c': LabelSKUConfidential, - 'd': LabelSKUStorageDiskful, - 'i': LabelSKUIsolatedSize, - 'l': LabelSKUMemoryLow, - 'm': LabelSKUMemoryIntensive, - 't': LabelSKUMemoryTiny, - 's': LabelSKUStoragePremiumCapable, - } -) - -var ( - Scheme = runtime.NewScheme() - Group = "karpenter.k8s.azure" - SchemeGroupVersion = schema.GroupVersion{Group: Group, Version: "v1alpha1"} - SchemeBuilder = runtime.NewSchemeBuilder(func(scheme *runtime.Scheme) error { - scheme.AddKnownTypes(SchemeGroupVersion) - metav1.AddToGroupVersion(scheme, SchemeGroupVersion) - return nil - }) -) - -func init() { - v1alpha5.RestrictedLabelDomains = v1alpha5.RestrictedLabelDomains.Insert(RestrictedLabelDomains...) - v1alpha5.WellKnownLabels = v1alpha5.WellKnownLabels.Insert( - LabelSKUTier, - LabelSKUName, - LabelSKUSize, - LabelSKUSeries, - LabelSKUFamily, - LabelSKUSubfamily, - LabelSKUCPU, - LabelSKUCPUConstrained, - LabelSKUAccelerator, - LabelSKUVersion, - - LabelSKUCpuTypeAmd, - LabelSKUStorageBlockPerformance, - LabelSKUConfidential, - LabelSKUStorageDiskful, - LabelSKUIsolatedSize, - LabelSKUMemoryLow, - LabelSKUMemoryIntensive, - LabelSKUMemoryTiny, - LabelSKUStoragePremiumCapable, - - LabelSKUMemory, - LabelSKUHyperVGeneration, - LabelSKUAcceleratedNetworking, - - LabelSKUEncryptionAtHostSupported, - LabelSKUEphemeralOSDiskSupported, - LabelSKUCachedDiskSize, - LabelSKUMaxResourceVolume, - - LabelSKUGPUName, - LabelSKUGPUManufacturer, - LabelSKUGPUCount, - ) -} diff --git a/pkg/auth/cred.go b/pkg/auth/cred.go index 7c7d68c8..8cbe81bd 100644 --- a/pkg/auth/cred.go +++ b/pkg/auth/cred.go @@ -31,7 +31,6 @@ import ( "github.com/Azure/go-autorest/autorest/to" "github.com/AzureAD/microsoft-authentication-library-for-go/apps/confidential" "github.com/azure/gpu-provisioner/pkg/utils" - "github.com/pkg/errors" ) diff --git a/pkg/cache/cache.go b/pkg/cache/cache.go deleted file mode 100644 index d527c496..00000000 --- a/pkg/cache/cache.go +++ /dev/null @@ -1,29 +0,0 @@ -/* - Copyright (c) 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. -*/ - -package cache - -import "time" - -const ( - // KubernetesVersionTTL is the time before the detected Kubernetes version is removed from cache, - // to be re-detected next time it is needed. - KubernetesVersionTTL = 15 * time.Minute - // UnavailableOfferingsTTL is the time before offerings that were marked as unavailable - // are removed from the cache and are available for launch again - UnavailableOfferingsTTL = 3 * time.Minute - // DefaultCleanupInterval triggers cache cleanup (lazy eviction) at this interval. - DefaultCleanupInterval = 10 * time.Minute -) diff --git a/pkg/cache/unavailableofferings.go b/pkg/cache/unavailableofferings.go deleted file mode 100644 index ab372d08..00000000 --- a/pkg/cache/unavailableofferings.go +++ /dev/null @@ -1,72 +0,0 @@ -/* - Copyright (c) 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. -*/ - -package cache - -import ( - "context" - "fmt" - - "github.com/patrickmn/go-cache" - "knative.dev/pkg/logging" -) - -// UnavailableOfferings stores any offerings that return ICE (insufficient capacity errors) when -// attempting to launch the capacity. These offerings are ignored as long as they are in the cache on -// GetInstanceTypes responses -type UnavailableOfferings struct { - // key: ::, value: struct{}{} - cache *cache.Cache -} - -func NewUnavailableOfferingsWithCache(c *cache.Cache) *UnavailableOfferings { - return &UnavailableOfferings{ - cache: c, - } -} - -func NewUnavailableOfferings() *UnavailableOfferings { - c := cache.New(UnavailableOfferingsTTL, DefaultCleanupInterval) - return &UnavailableOfferings{ - cache: c, - } -} - -// IsUnavailable returns true if the offering appears in the cache -func (u *UnavailableOfferings) IsUnavailable(instanceType, zone, capacityType string) bool { - _, found := u.cache.Get(u.key(instanceType, zone, capacityType)) - return found -} - -// MarkUnavailable communicates recently observed temporary capacity shortages in the provided offerings -func (u *UnavailableOfferings) MarkUnavailable(ctx context.Context, unavailableReason, instanceType, zone, capacityType string) { - // even if the key is already in the cache, we still need to call Set to extend the cached entry's TTL - logging.FromContext(ctx).With( - "unavailable", unavailableReason, - "instance-type", instanceType, - "zone", zone, - "capacity-type", capacityType, - "ttl", UnavailableOfferingsTTL).Debugf("removing offering from offerings") - u.cache.SetDefault(u.key(instanceType, zone, capacityType), struct{}{}) -} - -func (u *UnavailableOfferings) Flush() { - u.cache.Flush() -} - -// key returns the cache key for all offerings in the cache -func (u *UnavailableOfferings) key(instanceType string, zone string, capacityType string) string { - return fmt.Sprintf("%s:%s:%s", capacityType, instanceType, zone) -} diff --git a/pkg/cache/unavailableofferings_test.go b/pkg/cache/unavailableofferings_test.go deleted file mode 100644 index 6eeaf1d9..00000000 --- a/pkg/cache/unavailableofferings_test.go +++ /dev/null @@ -1,63 +0,0 @@ -/* - Copyright (c) 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. -*/ - -package cache - -import ( - "context" - "testing" - "time" - - "github.com/patrickmn/go-cache" -) - -func TestUnavailableOfferings(t *testing.T) { - // create a new cache with a short TTL - c := cache.New(time.Second, time.Second) - u := NewUnavailableOfferingsWithCache(c) - - // test that an offering is not marked as unavailable initially - if u.IsUnavailable("NV16as_v4", "westus", "spot") { - t.Error("Offering should not be marked as unavailable initially") - } - - // mark the offering as unavailable - u.MarkUnavailable(context.TODO(), "test reason", "NV16as_v4", "westus", "spot") - - // test that the offering is now marked as unavailable - if !u.IsUnavailable("NV16as_v4", "westus", "spot") { - t.Error("Offering should be marked as unavailable after being marked as such") - } - - // wait for the cache entry to expire - time.Sleep(time.Second) - - // test that the offering is no longer marked as unavailable - if u.IsUnavailable("NV16as_v4", "westus", "spot") { - t.Error("Offering should not be marked as unavailable after cache entry has expired") - } -} - -func TestUnavailableOfferings_KeyGeneration(t *testing.T) { - c := cache.New(time.Second, time.Second) - u := NewUnavailableOfferingsWithCache(c) - - // test that the key is generated correctly - expectedKey := "spot:NV16as_v4:westus" - key := u.key("NV16as_v4", "westus", "spot") - if key != expectedKey { - t.Errorf("Expected key to be %s, but got %s", expectedKey, key) - } -} diff --git a/pkg/cloudprovider/cloudprovider.go b/pkg/cloudprovider/cloudprovider.go index 468a0ef8..b3dae7c6 100644 --- a/pkg/cloudprovider/cloudprovider.go +++ b/pkg/cloudprovider/cloudprovider.go @@ -18,68 +18,61 @@ package cloudprovider import ( "context" "fmt" - "net/http" + "strings" + "time" - "k8s.io/klog/v2" - "sigs.k8s.io/controller-runtime/pkg/client" - - "github.com/azure/gpu-provisioner/pkg/apis" + "github.com/awslabs/operatorpkg/status" "github.com/azure/gpu-provisioner/pkg/providers/instance" - "github.com/azure/gpu-provisioner/pkg/providers/instancetype" "github.com/samber/lo" - - coreapis "github.com/aws/karpenter-core/pkg/apis" - "github.com/aws/karpenter-core/pkg/apis/v1alpha5" - "github.com/aws/karpenter-core/pkg/cloudprovider" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/klog/v2" + "sigs.k8s.io/controller-runtime/pkg/client" + karpenterv1 "sigs.k8s.io/karpenter/pkg/apis/v1" + "sigs.k8s.io/karpenter/pkg/cloudprovider" ) -func init() { - coreapis.Settings = append(coreapis.Settings, apis.Settings...) -} - -var _ cloudprovider.CloudProvider = (*CloudProvider)(nil) +var _ cloudprovider.CloudProvider = &CloudProvider{} type CloudProvider struct { - instanceTypeProvider *instancetype.Provider - instanceProvider *instance.Provider - kubeClient client.Client + instanceProvider *instance.Provider + kubeClient client.Client } -func New(instanceTypeProvider *instancetype.Provider, instanceProvider *instance.Provider, kubeClient client.Client) *CloudProvider { +func New(instanceProvider *instance.Provider, kubeClient client.Client) *CloudProvider { return &CloudProvider{ - instanceTypeProvider: instanceTypeProvider, - instanceProvider: instanceProvider, - kubeClient: kubeClient, + instanceProvider: instanceProvider, + kubeClient: kubeClient, } } // Create a node given the constraints. -func (c *CloudProvider) Create(ctx context.Context, machine *v1alpha5.Machine) (*v1alpha5.Machine, error) { - klog.InfoS("Create", "machine", klog.KObj(machine)) +func (c *CloudProvider) Create(ctx context.Context, nodeClaim *karpenterv1.NodeClaim) (*karpenterv1.NodeClaim, error) { + klog.InfoS("Create", "nodeClaim", klog.KObj(nodeClaim)) - instance, err := c.instanceProvider.Create(ctx, machine) + instance, err := c.instanceProvider.Create(ctx, nodeClaim) if err != nil { return nil, fmt.Errorf("creating instance, %w", err) } - m := c.instanceToMachine(ctx, instance) - m.Labels = lo.Assign(m.Labels, instance.Labels) - return m, nil + nc := c.instanceToNodeClaim(ctx, instance) + nc.Labels = lo.Assign(nc.Labels, instance.Labels) + return nc, nil } -func (c *CloudProvider) List(ctx context.Context) ([]*v1alpha5.Machine, error) { - machines := []*v1alpha5.Machine{} +func (c *CloudProvider) List(ctx context.Context) ([]*karpenterv1.NodeClaim, error) { + nodeClaims := []*karpenterv1.NodeClaim{} instances, err := c.instanceProvider.List(ctx) if err != nil { return nil, err } for index := range instances { - machines = append(machines, c.instanceToMachine(ctx, instances[index])) + nodeClaims = append(nodeClaims, c.instanceToNodeClaim(ctx, instances[index])) } - return machines, nil + return nodeClaims, nil } -func (c *CloudProvider) Get(ctx context.Context, providerID string) (*v1alpha5.Machine, error) { +func (c *CloudProvider) Get(ctx context.Context, providerID string) (*karpenterv1.NodeClaim, error) { klog.InfoS("Get", "providerID", providerID) instance, err := c.instanceProvider.Get(ctx, providerID) @@ -89,34 +82,76 @@ func (c *CloudProvider) Get(ctx context.Context, providerID string) (*v1alpha5.M if instance == nil { return nil, fmt.Errorf("cannot find a ready instance , %w", err) } - return c.instanceToMachine(ctx, instance), err -} - -func (c *CloudProvider) LivenessProbe(req *http.Request) error { - return c.instanceTypeProvider.LivenessProbe(req) + return c.instanceToNodeClaim(ctx, instance), err } -func (c *CloudProvider) Delete(ctx context.Context, machine *v1alpha5.Machine) error { - klog.InfoS("Delete", "machine", klog.KObj(machine)) - if len(machine.Status.ProviderID) != 0 { - return c.instanceProvider.Delete(ctx, machine.Status.ProviderID) - } - return c.instanceProvider.DeleteByName(ctx, machine.Name) +func (c *CloudProvider) Delete(ctx context.Context, nodeClaim *karpenterv1.NodeClaim) error { + klog.InfoS("Delete", "nodeClaim", klog.KObj(nodeClaim)) + return c.instanceProvider.Delete(ctx, nodeClaim.Name) } -func (c *CloudProvider) IsMachineDrifted(ctx context.Context, machine *v1alpha5.Machine) (bool, error) { - klog.InfoS("IsMachineDrifted", "machine", klog.KObj(machine)) - return false, nil +func (c *CloudProvider) IsDrifted(ctx context.Context, nodeClaim *karpenterv1.NodeClaim) (cloudprovider.DriftReason, error) { + klog.V(5).InfoS("IsDrifted", "nodeclaim", klog.KObj(nodeClaim)) + return cloudprovider.DriftReason(""), nil } -func (c *CloudProvider) GetInstanceTypes(ctx context.Context, provisioner *v1alpha5.Provisioner) ([]*cloudprovider.InstanceType, error) { - - instanceTypes := []*cloudprovider.InstanceType{} - - return instanceTypes, nil +func (c *CloudProvider) GetInstanceTypes(ctx context.Context, nodePool *karpenterv1.NodePool) ([]*cloudprovider.InstanceType, error) { + return []*cloudprovider.InstanceType{}, nil } // Name returns the CloudProvider implementation name. func (c *CloudProvider) Name() string { return "azure" } + +func (c *CloudProvider) GetSupportedNodeClasses() []status.Object { + return []status.Object{} +} + +func (c *CloudProvider) instanceToNodeClaim(ctx context.Context, instanceObj *instance.Instance) *karpenterv1.NodeClaim { + nodeClaim := &karpenterv1.NodeClaim{} + if instanceObj == nil { + return nodeClaim + } + + labels := instanceObj.Labels + annotations := map[string]string{} + + nodeClaim.Name = lo.FromPtr(instanceObj.Name) + + if instanceObj.CapacityType != nil { + labels[karpenterv1.CapacityTypeLabelKey] = *instanceObj.CapacityType + } + + if instanceObj.Type != nil { + labels[corev1.LabelInstanceTypeStable] = lo.FromPtr(instanceObj.Type) + } + + if instanceObj.Tags[karpenterv1.NodePoolLabelKey] != nil { + labels[karpenterv1.NodePoolLabelKey] = *instanceObj.Tags[karpenterv1.NodePoolLabelKey] + } + + nodeClaim.Labels = labels + nodeClaim.Annotations = annotations + if timestamp, ok := labels[instance.NodeClaimCreationLabel]; ok { + if creationTime, err := time.Parse(instance.CreationTimestampLayout, timestamp); err == nil { + nodeClaim.CreationTimestamp = metav1.Time{Time: creationTime} + } + } + + if instanceObj.ID != nil { + nodeClaim.Status.ProviderID = lo.FromPtr(instanceObj.ID) + } + + if instanceObj.ImageID != nil { + nodeClaim.Status.ImageID = *instanceObj.ImageID + } + + if instanceObj.State != nil { + if strings.Contains(strings.ToLower(*instanceObj.State), "deleting") { + nodeClaim.DeletionTimestamp = &metav1.Time{Time: time.Now()} + } + } + + return nodeClaim +} diff --git a/pkg/cloudprovider/cloudprovider_test.go b/pkg/cloudprovider/cloudprovider_test.go new file mode 100644 index 00000000..aae86553 --- /dev/null +++ b/pkg/cloudprovider/cloudprovider_test.go @@ -0,0 +1,385 @@ +/* + Copyright (c) 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. +*/ + +package cloudprovider + +import ( + "context" + "errors" + "fmt" + "net/http" + "testing" + + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4" + "github.com/azure/gpu-provisioner/pkg/fake" + "github.com/azure/gpu-provisioner/pkg/providers/instance" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "go.uber.org/mock/gomock" + v1 "k8s.io/api/core/v1" + "sigs.k8s.io/controller-runtime/pkg/client" + karpenterv1 "sigs.k8s.io/karpenter/pkg/apis/v1" + "sigs.k8s.io/karpenter/pkg/cloudprovider" +) + +func TestCreate(t *testing.T) { + testcases := map[string]struct { + nodeClaim *karpenterv1.NodeClaim + mockAgentPoolResp func(nodeClaim *karpenterv1.NodeClaim, mockHandler *fake.MockPollingHandler[armcontainerservice.AgentPoolsClientCreateOrUpdateResponse]) (*runtime.Poller[armcontainerservice.AgentPoolsClientCreateOrUpdateResponse], error) + expectedError bool + }{ + "successfully create instance": { + nodeClaim: fake.GetNodeClaimObj("agentpool0", map[string]string{"test": "test"}, []v1.Taint{}, karpenterv1.ResourceRequirements{}, []v1.NodeSelectorRequirement{ + { + Key: "node.kubernetes.io/instance-type", + Operator: "In", + Values: []string{"Standard_NC6s_v3"}, + }, + }), + mockAgentPoolResp: func(nodeClaim *karpenterv1.NodeClaim, mockHandler *fake.MockPollingHandler[armcontainerservice.AgentPoolsClientCreateOrUpdateResponse]) (*runtime.Poller[armcontainerservice.AgentPoolsClientCreateOrUpdateResponse], error) { + ap := fake.CreateAgentPoolObjWithNodeClaim(nodeClaim) + + createResp := armcontainerservice.AgentPoolsClientCreateOrUpdateResponse{ + AgentPool: ap, + } + resp := http.Response{StatusCode: http.StatusAccepted, Body: http.NoBody} + + mockHandler.EXPECT().Done().Return(true).Times(3) + mockHandler.EXPECT().Result(gomock.Any(), gomock.Any()).Return(nil) + + pollingOptions := &runtime.NewPollerOptions[armcontainerservice.AgentPoolsClientCreateOrUpdateResponse]{ + Handler: mockHandler, + Response: &createResp, + } + + p, err := runtime.NewPoller(&resp, runtime.NewPipeline("", "", runtime.PipelineOptions{}, nil), pollingOptions) + return p, err + }, + expectedError: false, + }, + "failed to create instance": { + nodeClaim: fake.GetNodeClaimObj("invalid-nodeclaim-name", map[string]string{"test": "test"}, []v1.Taint{}, karpenterv1.ResourceRequirements{}, []v1.NodeSelectorRequirement{ + { + Key: "node.kubernetes.io/instance-type", + Operator: "In", + Values: []string{"Standard_NC6s_v3"}, + }, + }), + expectedError: true, + }, + } + + for k, tc := range testcases { + t.Run(k, func(t *testing.T) { + mockCtrl := gomock.NewController(t) + defer mockCtrl.Finish() + + // prepare agentPoolClient with poller + agentPoolMocks := fake.NewMockAgentPoolsAPI(mockCtrl) + if tc.mockAgentPoolResp != nil { + mockHandler := fake.NewMockPollingHandler[armcontainerservice.AgentPoolsClientCreateOrUpdateResponse](mockCtrl) + p, err := tc.mockAgentPoolResp(tc.nodeClaim, mockHandler) + agentPoolMocks.EXPECT().BeginCreateOrUpdate(gomock.Any(), gomock.Any(), gomock.Any(), tc.nodeClaim.Name, gomock.Any(), gomock.Any()).Return(p, err) + } + + // prepare kubeclient + mockK8sClient := fake.NewClient() + nodeList := fake.CreateNodeListWithNodeClaim([]*karpenterv1.NodeClaim{tc.nodeClaim}) + relevantMap := mockK8sClient.CreateMapWithType(nodeList) + for _, obj := range nodeList.Items { + n := obj + objKey := client.ObjectKeyFromObject(&n) + relevantMap[objKey] = &n + } + mockK8sClient.On("List", mock.IsType(context.Background()), mock.IsType(&v1.NodeList{}), mock.Anything).Return(nil) + + // prepare instance provider + mockAzClient := instance.NewAZClientFromAPI(agentPoolMocks) + instanceProvider := instance.NewProvider(mockAzClient, mockK8sClient, "testRG", "nodeRG", "testCluster") + + // create cloud provider and call create function + cloudProvider := New(instanceProvider, nil) + nc, err := cloudProvider.Create(context.Background(), tc.nodeClaim) + + if tc.expectedError { + assert.Error(t, err, "expect error but got nil") + } else if !tc.expectedError { + assert.NoError(t, err, "Not expected to return error") + } + + if nc != nil { + assert.Equal(t, nc.Name, tc.nodeClaim.Name, "nodeclaim name is not the same") + assert.NotEmpty(t, nc.Status.ProviderID, "provider id is not empty") + } + }) + } +} + +func TestList(t *testing.T) { + testcases := map[string]struct { + nodeClaims []*karpenterv1.NodeClaim + mockAgentPoolResp func(nodeClaims []*karpenterv1.NodeClaim) *runtime.Pager[armcontainerservice.AgentPoolsClientListResponse] + expectedError bool + }{ + "successfully list instances": { + nodeClaims: []*karpenterv1.NodeClaim{ + fake.GetNodeClaimObj("agentpool1", map[string]string{"test": "test"}, []v1.Taint{}, karpenterv1.ResourceRequirements{}, []v1.NodeSelectorRequirement{ + { + Key: "node.kubernetes.io/instance-type", + Operator: "In", + Values: []string{"Standard_NC6s_v3"}, + }, + }), + fake.GetNodeClaimObj("agentpool2", map[string]string{"test": "test"}, []v1.Taint{}, karpenterv1.ResourceRequirements{}, []v1.NodeSelectorRequirement{ + { + Key: "node.kubernetes.io/instance-type", + Operator: "In", + Values: []string{"Standard_NC6s_v3"}, + }, + }), + }, + mockAgentPoolResp: func(nodeClaims []*karpenterv1.NodeClaim) *runtime.Pager[armcontainerservice.AgentPoolsClientListResponse] { + var agentPools []*armcontainerservice.AgentPool + for i := range nodeClaims { + ap := fake.CreateAgentPoolObjWithNodeClaim(nodeClaims[i]) + agentPools = append(agentPools, &ap) + } + return runtime.NewPager(runtime.PagingHandler[armcontainerservice.AgentPoolsClientListResponse]{ + More: func(page armcontainerservice.AgentPoolsClientListResponse) bool { + return false + }, + Fetcher: func(ctx context.Context, page *armcontainerservice.AgentPoolsClientListResponse) (armcontainerservice.AgentPoolsClientListResponse, error) { + return armcontainerservice.AgentPoolsClientListResponse{ + AgentPoolListResult: armcontainerservice.AgentPoolListResult{ + Value: agentPools, + }, + }, nil + }, + }) + }, + expectedError: false, + }, + "failed to list instances": { + mockAgentPoolResp: func(nodeClaims []*karpenterv1.NodeClaim) *runtime.Pager[armcontainerservice.AgentPoolsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[armcontainerservice.AgentPoolsClientListResponse]{ + More: func(page armcontainerservice.AgentPoolsClientListResponse) bool { + return false + }, + Fetcher: func(ctx context.Context, page *armcontainerservice.AgentPoolsClientListResponse) (armcontainerservice.AgentPoolsClientListResponse, error) { + return armcontainerservice.AgentPoolsClientListResponse{}, errors.New("Failed to fetch page") + }, + }) + }, + expectedError: true, + }, + } + + for k, tc := range testcases { + t.Run(k, func(t *testing.T) { + mockCtrl := gomock.NewController(t) + defer mockCtrl.Finish() + + // prepare agentPoolClient with poller + agentPoolMocks := fake.NewMockAgentPoolsAPI(mockCtrl) + if tc.mockAgentPoolResp != nil { + pager := tc.mockAgentPoolResp(tc.nodeClaims) + agentPoolMocks.EXPECT().NewListPager(gomock.Any(), gomock.Any(), gomock.Any()).Return(pager) + } + + // prepare kubeclient + mockK8sClient := fake.NewClient() + mockK8sClient.On("List", mock.IsType(context.Background()), mock.IsType(&v1.NodeList{}), mock.Anything).Return(nil) + + // prepare instance provider + mockAzClient := instance.NewAZClientFromAPI(agentPoolMocks) + instanceProvider := instance.NewProvider(mockAzClient, mockK8sClient, "testRG", "nodeRG", "testCluster") + + // create cloud provider and call list function + cloudProvider := New(instanceProvider, nil) + nodeClaims, err := cloudProvider.List(context.Background()) + + if tc.expectedError { + assert.Error(t, err, "expect error but got nil") + } else if !tc.expectedError { + assert.NoError(t, err, "Not expected to return error") + } + + assert.Equal(t, len(tc.nodeClaims), len(nodeClaims), "Number of NodeClaims should be same") + for i := range tc.nodeClaims { + assert.Equal(t, nodeClaims[i].Name, tc.nodeClaims[i].Name, "NodeClaim name should be same") + assert.Equal(t, nodeClaims[i].Labels[v1.LabelInstanceTypeStable], tc.nodeClaims[i].Spec.Requirements[0].Values[0], "Instance type should be same") + } + }) + } +} + +func TestGet(t *testing.T) { + testcases := map[string]struct { + nodeClaim *karpenterv1.NodeClaim + mockAgentPoolResp func(nodeClaim *karpenterv1.NodeClaim) (armcontainerservice.AgentPoolsClientGetResponse, error) + expectedError error + IsNodeClaimNotFoundError bool + }{ + "successfully get instance": { + nodeClaim: fake.GetNodeClaimObj("agentpool1", map[string]string{"test": "test"}, []v1.Taint{}, karpenterv1.ResourceRequirements{}, []v1.NodeSelectorRequirement{ + { + Key: "node.kubernetes.io/instance-type", + Operator: "In", + Values: []string{"Standard_NC6s_v3"}, + }, + }), + mockAgentPoolResp: func(nodeClaim *karpenterv1.NodeClaim) (armcontainerservice.AgentPoolsClientGetResponse, error) { + return armcontainerservice.AgentPoolsClientGetResponse{AgentPool: fake.CreateAgentPoolObjWithNodeClaim(nodeClaim)}, nil + }, + expectedError: nil, + }, + "failed to get instance": { + nodeClaim: fake.GetNodeClaimObj("agentpool1", map[string]string{"test": "test"}, []v1.Taint{}, karpenterv1.ResourceRequirements{}, []v1.NodeSelectorRequirement{ + { + Key: "node.kubernetes.io/instance-type", + Operator: "In", + Values: []string{"Standard_NC6s_v3"}, + }, + }), + mockAgentPoolResp: func(nodeClaim *karpenterv1.NodeClaim) (armcontainerservice.AgentPoolsClientGetResponse, error) { + return armcontainerservice.AgentPoolsClientGetResponse{AgentPool: fake.CreateAgentPoolObjWithNodeClaim(nodeClaim)}, fmt.Errorf("internal server error") + }, + expectedError: errors.New("internal server error"), + }, + "instance doesn't exist": { + nodeClaim: fake.GetNodeClaimObj("agentpool1", map[string]string{"test": "test"}, []v1.Taint{}, karpenterv1.ResourceRequirements{}, []v1.NodeSelectorRequirement{ + { + Key: "node.kubernetes.io/instance-type", + Operator: "In", + Values: []string{"Standard_NC6s_v3"}, + }, + }), + mockAgentPoolResp: func(nodeClaim *karpenterv1.NodeClaim) (armcontainerservice.AgentPoolsClientGetResponse, error) { + return armcontainerservice.AgentPoolsClientGetResponse{AgentPool: fake.CreateAgentPoolObjWithNodeClaim(nodeClaim)}, fmt.Errorf("Agent Pool not found") + }, + IsNodeClaimNotFoundError: true, + }, + } + + for k, tc := range testcases { + t.Run(k, func(t *testing.T) { + mockCtrl := gomock.NewController(t) + defer mockCtrl.Finish() + + // prepare agentPoolClient with poller + agentPoolMocks := fake.NewMockAgentPoolsAPI(mockCtrl) + if tc.mockAgentPoolResp != nil { + resp, err := tc.mockAgentPoolResp(tc.nodeClaim) + agentPoolMocks.EXPECT().Get(gomock.Any(), gomock.Any(), gomock.Any(), tc.nodeClaim.Name, gomock.Any()).Return(resp, err) + } + + // prepare instance provider + mockAzClient := instance.NewAZClientFromAPI(agentPoolMocks) + instanceProvider := instance.NewProvider(mockAzClient, nil, "testRG", "nodeRG", "testCluster") + + // create cloud provider and call list function + cloudProvider := New(instanceProvider, nil) + nodeClaim, err := cloudProvider.Get(context.Background(), tc.nodeClaim.Status.ProviderID) + + if tc.IsNodeClaimNotFoundError { + if !cloudprovider.IsNodeClaimNotFoundError(err) { + assert.Error(t, err, "expect IsNodeClaimNotFoundError but got other error") + } + } else if tc.expectedError != nil { + assert.Contains(t, err.Error(), tc.expectedError.Error()) + } else { + assert.Equal(t, nodeClaim.Name, tc.nodeClaim.Name, "NodeClaim name should be same") + assert.Equal(t, nodeClaim.Status.ProviderID, tc.nodeClaim.Status.ProviderID, "Instance ProviderID should be same") + } + }) + } +} + +func TestDelete(t *testing.T) { + testcases := map[string]struct { + nodeClaim *karpenterv1.NodeClaim + mockAgentPoolResp func(mockHandler *fake.MockPollingHandler[armcontainerservice.AgentPoolsClientDeleteResponse]) (*runtime.Poller[armcontainerservice.AgentPoolsClientDeleteResponse], error) + expectedError error + }{ + "successfully delete instance": { + nodeClaim: fake.GetNodeClaimObj("agentpool1", map[string]string{"test": "test"}, []v1.Taint{}, karpenterv1.ResourceRequirements{}, []v1.NodeSelectorRequirement{ + { + Key: "node.kubernetes.io/instance-type", + Operator: "In", + Values: []string{"Standard_NC6s_v3"}, + }, + }), + mockAgentPoolResp: func(mockHandler *fake.MockPollingHandler[armcontainerservice.AgentPoolsClientDeleteResponse]) (*runtime.Poller[armcontainerservice.AgentPoolsClientDeleteResponse], error) { + delResp := armcontainerservice.AgentPoolsClientDeleteResponse{} + resp := http.Response{Status: "200 OK", StatusCode: http.StatusOK, Body: http.NoBody} + + mockHandler.EXPECT().Done().Return(true).Times(3) + mockHandler.EXPECT().Result(gomock.Any(), gomock.Any()).Return(nil) + + pollingOptions := &runtime.NewPollerOptions[armcontainerservice.AgentPoolsClientDeleteResponse]{ + Handler: mockHandler, + Response: &delResp, + } + + p, err := runtime.NewPoller(&resp, runtime.NewPipeline("", "", runtime.PipelineOptions{}, nil), pollingOptions) + return p, err + }, + expectedError: nil, + }, + "failed to delete instance": { + nodeClaim: fake.GetNodeClaimObj("agentpool1", map[string]string{"test": "test"}, []v1.Taint{}, karpenterv1.ResourceRequirements{}, []v1.NodeSelectorRequirement{ + { + Key: "node.kubernetes.io/instance-type", + Operator: "In", + Values: []string{"Standard_NC6s_v3"}, + }, + }), + mockAgentPoolResp: func(mockHandler *fake.MockPollingHandler[armcontainerservice.AgentPoolsClientDeleteResponse]) (*runtime.Poller[armcontainerservice.AgentPoolsClientDeleteResponse], error) { + return nil, errors.New("internal server error") + }, + expectedError: errors.New("internal server error"), + }, + } + + for k, tc := range testcases { + t.Run(k, func(t *testing.T) { + mockCtrl := gomock.NewController(t) + defer mockCtrl.Finish() + + // prepare agentPoolClient with poller + agentPoolMocks := fake.NewMockAgentPoolsAPI(mockCtrl) + if tc.mockAgentPoolResp != nil { + mockHandler := fake.NewMockPollingHandler[armcontainerservice.AgentPoolsClientDeleteResponse](mockCtrl) + resp, err := tc.mockAgentPoolResp(mockHandler) + agentPoolMocks.EXPECT().BeginDelete(gomock.Any(), gomock.Any(), gomock.Any(), tc.nodeClaim.Name, gomock.Any()).Return(resp, err) + } + + // prepare instance provider + mockAzClient := instance.NewAZClientFromAPI(agentPoolMocks) + instanceProvider := instance.NewProvider(mockAzClient, nil, "testRG", "nodeRG", "testCluster") + + // create cloud provider and call list function + cloudProvider := New(instanceProvider, nil) + err := cloudProvider.Delete(context.Background(), tc.nodeClaim) + + if tc.expectedError != nil { + assert.Contains(t, err.Error(), tc.expectedError.Error()) + } else { + assert.NoError(t, err, "expect no error but got one") + } + }) + } +} diff --git a/pkg/cloudprovider/utils.go b/pkg/cloudprovider/utils.go deleted file mode 100644 index 7399640a..00000000 --- a/pkg/cloudprovider/utils.go +++ /dev/null @@ -1,56 +0,0 @@ -/* - Copyright (c) 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. -*/ - -package cloudprovider - -import ( - "context" - - "github.com/aws/karpenter-core/pkg/apis/v1alpha5" - "github.com/azure/gpu-provisioner/pkg/providers/instance" - "github.com/samber/lo" - "knative.dev/pkg/logging" -) - -func (c *CloudProvider) instanceToMachine(ctx context.Context, instanceObj *instance.Instance) *v1alpha5.Machine { - machine := &v1alpha5.Machine{} - labels := instanceObj.Labels - annotations := map[string]string{} - - machine.Name = lo.FromPtr(instanceObj.Name) - - if instanceObj.CapacityType != nil { - labels[v1alpha5.LabelCapacityType] = *instanceObj.CapacityType - } - - if v, ok := instanceObj.Tags[v1alpha5.ProvisionerNameLabelKey]; ok { - labels[v1alpha5.ProvisionerNameLabelKey] = *v - } - if v, ok := instanceObj.Tags[v1alpha5.MachineManagedByAnnotationKey]; ok { - annotations[v1alpha5.MachineManagedByAnnotationKey] = *v - } - - machine.Labels = labels - machine.Annotations = annotations - - if instanceObj != nil && instanceObj.ID != nil { - machine.Status.ProviderID = lo.FromPtr(instanceObj.ID) - annotations[v1alpha5.MachineLinkedAnnotationKey] = lo.FromPtr(instanceObj.ID) - } else { - logging.FromContext(ctx).Warnf("Provider ID cannot be nil") - } - - return machine -} diff --git a/pkg/controllers/controllers.go b/pkg/controllers/controllers.go new file mode 100644 index 00000000..bad54c28 --- /dev/null +++ b/pkg/controllers/controllers.go @@ -0,0 +1,31 @@ +/* +Copyright The Kubernetes Authors. + +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. +*/ + +package controllers + +import ( + "github.com/awslabs/operatorpkg/controller" + instancegarbagecollection "github.com/azure/gpu-provisioner/pkg/controllers/instance/garbagecollection" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/karpenter/pkg/cloudprovider" +) + +func NewControllers(kubeClient client.Client, cloudProvider cloudprovider.CloudProvider) []controller.Controller { + controllers := []controller.Controller{ + instancegarbagecollection.NewController(kubeClient, cloudProvider), + } + return controllers +} diff --git a/pkg/controllers/instance/garbagecollection/controller.go b/pkg/controllers/instance/garbagecollection/controller.go new file mode 100644 index 00000000..5fb331f8 --- /dev/null +++ b/pkg/controllers/instance/garbagecollection/controller.go @@ -0,0 +1,131 @@ +/* +Copyright The Kubernetes Authors. + +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. +*/ + +package garbagecollection + +import ( + "context" + "time" + + "github.com/awslabs/operatorpkg/singleton" + "github.com/samber/lo" + "go.uber.org/multierr" + "k8s.io/apimachinery/pkg/util/sets" + "k8s.io/client-go/util/workqueue" + "knative.dev/pkg/logging" + controllerruntime "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/manager" + "sigs.k8s.io/controller-runtime/pkg/reconcile" + v1 "sigs.k8s.io/karpenter/pkg/apis/v1" + "sigs.k8s.io/karpenter/pkg/cloudprovider" + "sigs.k8s.io/karpenter/pkg/operator/injection" + nodeclaimutil "sigs.k8s.io/karpenter/pkg/utils/nodeclaim" +) + +type Controller struct { + kubeClient client.Client + cloudProvider cloudprovider.CloudProvider +} + +func NewController(kubeClient client.Client, cloudProvider cloudprovider.CloudProvider) *Controller { + return &Controller{ + kubeClient: kubeClient, + cloudProvider: cloudProvider, + } +} + +func (c *Controller) Reconcile(ctx context.Context) (reconcile.Result, error) { + ctx = injection.WithControllerName(ctx, "instance.garbagecollection") + // list all agentpools + cloudNodeClaims, err := c.cloudProvider.List(ctx) + if err != nil { + return reconcile.Result{}, err + } + + cloudNodeClaims = lo.Filter(cloudNodeClaims, func(nc *v1.NodeClaim, _ int) bool { + return nc.DeletionTimestamp.IsZero() + }) + + kaitoNodeClaims, err := nodeclaimutil.AllKaitoNodeClaims(ctx, c.kubeClient) + if err != nil { + return reconcile.Result{}, err + } + + clusterNodeClaimNames := sets.New[string](lo.FilterMap(kaitoNodeClaims, func(nc v1.NodeClaim, _ int) (string, bool) { + return nc.Name, true + })...) + + // instance's related NodeClaim has been removed, and instance has been created for more than 10min + // so we need to garbage these leaked cloudprovider instances and nodes. + deletedCloudProviderInstances := lo.Filter(cloudNodeClaims, func(nc *v1.NodeClaim, _ int) bool { + if clusterNodeClaimNames.Has(nc.Name) { + return false + } + + if !nc.CreationTimestamp.IsZero() { + // agentpool has been created less than 10 minutes, skip it + if nc.CreationTimestamp.Time.Add(10 * time.Minute).After(time.Now()) { + return false + } + } + + return true + }) + logging.FromContext(ctx).Infow("instance garbagecollection status", "garbaged instance count", len(deletedCloudProviderInstances)) + + errs := make([]error, len(deletedCloudProviderInstances)) + workqueue.ParallelizeUntil(ctx, 20, len(deletedCloudProviderInstances), func(i int) { + if err := c.cloudProvider.Delete(ctx, deletedCloudProviderInstances[i]); err != nil { + logging.FromContext(ctx).Errorf("failed to delete leaked cloudprovider instance(%s), %v", deletedCloudProviderInstances[i].Name, err) + errs[i] = cloudprovider.IgnoreNodeClaimNotFoundError(err) + return + } + logging.FromContext(ctx).Infow("delete leaked cloudprovider instance successfully", "name", deletedCloudProviderInstances[i].Name) + + if len(deletedCloudProviderInstances[i].Status.ProviderID) != 0 { + nodes, err := nodeclaimutil.AllNodesForNodeClaim(ctx, c.kubeClient, deletedCloudProviderInstances[i]) + if err != nil { + errs[i] = err + return + } + + subErrs := make([]error, len(nodes)) + for k := range nodes { + // If we still get the Node, but it's already marked as terminating, we don't need to call Delete again + if nodes[k].DeletionTimestamp.IsZero() { + // We delete nodes to trigger the node finalization and deletion flow + if err := c.kubeClient.Delete(ctx, nodes[k]); client.IgnoreNotFound(err) != nil { + logging.FromContext(ctx).Errorf("failed to delete leaked node(%s), %v", nodes[k].Name, err) + subErrs[k] = err + } else { + logging.FromContext(ctx).Infow("delete leaked node successfully", "name", nodes[k].Name) + } + } + } + errs[i] = multierr.Combine(subErrs...) + } + }) + + return reconcile.Result{RequeueAfter: time.Minute * 2}, multierr.Combine(errs...) +} + +func (c *Controller) Register(_ context.Context, m manager.Manager) error { + return controllerruntime.NewControllerManagedBy(m). + Named("instance.garbagecollection"). + WatchesRawSource(singleton.Source()). + Complete(singleton.AsReconciler(c)) +} diff --git a/pkg/controllers/instance/garbagecollection/controller_test.go b/pkg/controllers/instance/garbagecollection/controller_test.go new file mode 100644 index 00000000..55e98d43 --- /dev/null +++ b/pkg/controllers/instance/garbagecollection/controller_test.go @@ -0,0 +1,281 @@ +/* +Copyright The Kubernetes Authors. + +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. +*/ + +package garbagecollection + +import ( + "context" + "errors" + "net/http" + "testing" + + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4" + "github.com/azure/gpu-provisioner/pkg/cloudprovider" + "github.com/azure/gpu-provisioner/pkg/fake" + "github.com/azure/gpu-provisioner/pkg/providers/instance" + "github.com/samber/lo" + "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" + v1 "k8s.io/api/core/v1" + k8sruntime "k8s.io/apimachinery/pkg/runtime" + "k8s.io/client-go/kubernetes/scheme" + "sigs.k8s.io/controller-runtime/pkg/client" + fakeclient "sigs.k8s.io/controller-runtime/pkg/client/fake" + karpenterv1 "sigs.k8s.io/karpenter/pkg/apis/v1" +) + +func TestReconcile(t *testing.T) { + testcases := map[string]struct { + nodeClaims []*karpenterv1.NodeClaim + leakedNodeClaims []*karpenterv1.NodeClaim + mockListAgentPoolResp func(nodeClaims []*karpenterv1.NodeClaim) *runtime.Pager[armcontainerservice.AgentPoolsClientListResponse] + mockDeleteAgentPoolResp func(mockHandler *fake.MockPollingHandler[armcontainerservice.AgentPoolsClientDeleteResponse]) (*runtime.Poller[armcontainerservice.AgentPoolsClientDeleteResponse], error) + expectedError error + }{ + "garbage collection leaked instance without providerID successfully": { + nodeClaims: []*karpenterv1.NodeClaim{ + fake.GetNodeClaimObj("agentpool1", map[string]string{"test": "test"}, []v1.Taint{}, karpenterv1.ResourceRequirements{}, []v1.NodeSelectorRequirement{ + { + Key: "node.kubernetes.io/instance-type", + Operator: "In", + Values: []string{"Standard_NC6s_v3"}, + }, + }), + fake.GetNodeClaimObj("agentpool2", map[string]string{"test": "test"}, []v1.Taint{}, karpenterv1.ResourceRequirements{}, []v1.NodeSelectorRequirement{ + { + Key: "node.kubernetes.io/instance-type", + Operator: "In", + Values: []string{"Standard_NC6s_v3"}, + }, + }), + }, + leakedNodeClaims: []*karpenterv1.NodeClaim{ + fake.GetNodeClaimObjWithoutProviderID("agentpool3", map[string]string{"test": "test"}, []v1.Taint{}, karpenterv1.ResourceRequirements{}, []v1.NodeSelectorRequirement{ + { + Key: "node.kubernetes.io/instance-type", + Operator: "In", + Values: []string{"Standard_NC6s_v3"}, + }, + }), + }, + mockListAgentPoolResp: func(nodeClaims []*karpenterv1.NodeClaim) *runtime.Pager[armcontainerservice.AgentPoolsClientListResponse] { + var agentPools []*armcontainerservice.AgentPool + for i := range nodeClaims { + ap := fake.CreateAgentPoolObjWithNodeClaim(nodeClaims[i]) + agentPools = append(agentPools, &ap) + } + return runtime.NewPager(runtime.PagingHandler[armcontainerservice.AgentPoolsClientListResponse]{ + More: func(page armcontainerservice.AgentPoolsClientListResponse) bool { + return false + }, + Fetcher: func(ctx context.Context, page *armcontainerservice.AgentPoolsClientListResponse) (armcontainerservice.AgentPoolsClientListResponse, error) { + return armcontainerservice.AgentPoolsClientListResponse{ + AgentPoolListResult: armcontainerservice.AgentPoolListResult{ + Value: agentPools, + }, + }, nil + }, + }) + }, + mockDeleteAgentPoolResp: func(mockHandler *fake.MockPollingHandler[armcontainerservice.AgentPoolsClientDeleteResponse]) (*runtime.Poller[armcontainerservice.AgentPoolsClientDeleteResponse], error) { + delResp := armcontainerservice.AgentPoolsClientDeleteResponse{} + resp := http.Response{Status: "200 OK", StatusCode: http.StatusOK, Body: http.NoBody} + + mockHandler.EXPECT().Done().Return(true).Times(3) + mockHandler.EXPECT().Result(gomock.Any(), gomock.Any()).Return(nil) + + pollingOptions := &runtime.NewPollerOptions[armcontainerservice.AgentPoolsClientDeleteResponse]{ + Handler: mockHandler, + Response: &delResp, + } + + p, err := runtime.NewPoller(&resp, runtime.NewPipeline("", "", runtime.PipelineOptions{}, nil), pollingOptions) + return p, err + }, + expectedError: nil, + }, + "garbage collection leaked instance with providerID successfully": { + nodeClaims: []*karpenterv1.NodeClaim{ + fake.GetNodeClaimObj("agentpool1", map[string]string{"test": "test"}, []v1.Taint{}, karpenterv1.ResourceRequirements{}, []v1.NodeSelectorRequirement{ + { + Key: "node.kubernetes.io/instance-type", + Operator: "In", + Values: []string{"Standard_NC6s_v3"}, + }, + }), + fake.GetNodeClaimObj("agentpool2", map[string]string{"test": "test"}, []v1.Taint{}, karpenterv1.ResourceRequirements{}, []v1.NodeSelectorRequirement{ + { + Key: "node.kubernetes.io/instance-type", + Operator: "In", + Values: []string{"Standard_NC6s_v3"}, + }, + }), + }, + leakedNodeClaims: []*karpenterv1.NodeClaim{ + fake.GetNodeClaimObj("agentpool3", map[string]string{"test": "test"}, []v1.Taint{}, karpenterv1.ResourceRequirements{}, []v1.NodeSelectorRequirement{ + { + Key: "node.kubernetes.io/instance-type", + Operator: "In", + Values: []string{"Standard_NC6s_v3"}, + }, + }), + }, + mockListAgentPoolResp: func(nodeClaims []*karpenterv1.NodeClaim) *runtime.Pager[armcontainerservice.AgentPoolsClientListResponse] { + var agentPools []*armcontainerservice.AgentPool + for i := range nodeClaims { + ap := fake.CreateAgentPoolObjWithNodeClaim(nodeClaims[i]) + agentPools = append(agentPools, &ap) + } + return runtime.NewPager(runtime.PagingHandler[armcontainerservice.AgentPoolsClientListResponse]{ + More: func(page armcontainerservice.AgentPoolsClientListResponse) bool { + return false + }, + Fetcher: func(ctx context.Context, page *armcontainerservice.AgentPoolsClientListResponse) (armcontainerservice.AgentPoolsClientListResponse, error) { + return armcontainerservice.AgentPoolsClientListResponse{ + AgentPoolListResult: armcontainerservice.AgentPoolListResult{ + Value: agentPools, + }, + }, nil + }, + }) + }, + mockDeleteAgentPoolResp: func(mockHandler *fake.MockPollingHandler[armcontainerservice.AgentPoolsClientDeleteResponse]) (*runtime.Poller[armcontainerservice.AgentPoolsClientDeleteResponse], error) { + delResp := armcontainerservice.AgentPoolsClientDeleteResponse{} + resp := http.Response{Status: "200 OK", StatusCode: http.StatusOK, Body: http.NoBody} + + mockHandler.EXPECT().Done().Return(true).Times(3) + mockHandler.EXPECT().Result(gomock.Any(), gomock.Any()).Return(nil) + + pollingOptions := &runtime.NewPollerOptions[armcontainerservice.AgentPoolsClientDeleteResponse]{ + Handler: mockHandler, + Response: &delResp, + } + + p, err := runtime.NewPoller(&resp, runtime.NewPipeline("", "", runtime.PipelineOptions{}, nil), pollingOptions) + return p, err + }, + expectedError: nil, + }, + "failed to garbage collection leaked instance": { + nodeClaims: []*karpenterv1.NodeClaim{ + fake.GetNodeClaimObj("agentpool1", map[string]string{"test": "test"}, []v1.Taint{}, karpenterv1.ResourceRequirements{}, []v1.NodeSelectorRequirement{ + { + Key: "node.kubernetes.io/instance-type", + Operator: "In", + Values: []string{"Standard_NC6s_v3"}, + }, + }), + fake.GetNodeClaimObj("agentpool2", map[string]string{"test": "test"}, []v1.Taint{}, karpenterv1.ResourceRequirements{}, []v1.NodeSelectorRequirement{ + { + Key: "node.kubernetes.io/instance-type", + Operator: "In", + Values: []string{"Standard_NC6s_v3"}, + }, + }), + }, + leakedNodeClaims: []*karpenterv1.NodeClaim{ + fake.GetNodeClaimObjWithoutProviderID("agentpool3", map[string]string{"test": "test"}, []v1.Taint{}, karpenterv1.ResourceRequirements{}, []v1.NodeSelectorRequirement{ + { + Key: "node.kubernetes.io/instance-type", + Operator: "In", + Values: []string{"Standard_NC6s_v3"}, + }, + }), + }, + mockListAgentPoolResp: func(nodeClaims []*karpenterv1.NodeClaim) *runtime.Pager[armcontainerservice.AgentPoolsClientListResponse] { + var agentPools []*armcontainerservice.AgentPool + for i := range nodeClaims { + ap := fake.CreateAgentPoolObjWithNodeClaim(nodeClaims[i]) + agentPools = append(agentPools, &ap) + } + return runtime.NewPager(runtime.PagingHandler[armcontainerservice.AgentPoolsClientListResponse]{ + More: func(page armcontainerservice.AgentPoolsClientListResponse) bool { + return false + }, + Fetcher: func(ctx context.Context, page *armcontainerservice.AgentPoolsClientListResponse) (armcontainerservice.AgentPoolsClientListResponse, error) { + return armcontainerservice.AgentPoolsClientListResponse{ + AgentPoolListResult: armcontainerservice.AgentPoolListResult{ + Value: agentPools, + }, + }, nil + }, + }) + }, + mockDeleteAgentPoolResp: func(mockHandler *fake.MockPollingHandler[armcontainerservice.AgentPoolsClientDeleteResponse]) (*runtime.Poller[armcontainerservice.AgentPoolsClientDeleteResponse], error) { + return nil, errors.New("internal server error") + }, + expectedError: errors.New("internal server error"), + }, + } + + for k, tc := range testcases { + t.Run(k, func(t *testing.T) { + mockCtrl := gomock.NewController(t) + defer mockCtrl.Finish() + + // prepare agentPoolClient with poller + agentPoolMocks := fake.NewMockAgentPoolsAPI(mockCtrl) + if tc.mockListAgentPoolResp != nil { + pager := tc.mockListAgentPoolResp(append(tc.nodeClaims, tc.leakedNodeClaims...)) + agentPoolMocks.EXPECT().NewListPager(gomock.Any(), gomock.Any(), gomock.Any()).Return(pager) + } + + if tc.mockDeleteAgentPoolResp != nil { + mockHandler := fake.NewMockPollingHandler[armcontainerservice.AgentPoolsClientDeleteResponse](mockCtrl) + resp, err := tc.mockDeleteAgentPoolResp(mockHandler) + agentPoolMocks.EXPECT().BeginDelete(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return(resp, err) + } + + // prepare kubeclient + // sigs.k8s.io/karpenter/pkg/apis/v1/doc.go + // karpenter scheme has been registered in scheme.Scheme + nodeList := fake.CreateNodeListWithNodeClaim(append(tc.nodeClaims, tc.leakedNodeClaims...)) + nodes := lo.FilterMap(nodeList.Items, func(node v1.Node, _ int) (k8sruntime.Object, bool) { + return &node, true + }) + + nodeClaims := lo.FilterMap(tc.nodeClaims, func(nc *karpenterv1.NodeClaim, _ int) (k8sruntime.Object, bool) { + return nc, true + }) + + fakeClient := fakeclient.NewClientBuilder().WithScheme(scheme.Scheme). + WithRuntimeObjects(nodes...). + WithRuntimeObjects(nodeClaims...). + WithIndex(&v1.Node{}, "spec.providerID", func(o client.Object) []string { + return []string{o.(*v1.Node).Spec.ProviderID} + }). + Build() + + // prepare instance provider + mockAzClient := instance.NewAZClientFromAPI(agentPoolMocks) + instanceProvider := instance.NewProvider(mockAzClient, fakeClient, "testRG", "nodeRG", "testCluster") + + // create cloud provider + cloudProvider := cloudprovider.New(instanceProvider, nil) + + // create garbage collection controller + c := NewController(fakeClient, cloudProvider) + _, err := c.Reconcile(context.Background()) + + if tc.expectedError != nil { + assert.Contains(t, err.Error(), tc.expectedError.Error()) + } else { + assert.NoError(t, err, "expect no error but got one") + } + }) + } +} diff --git a/pkg/controllers/instance/garbagecollection/readme.md b/pkg/controllers/instance/garbagecollection/readme.md new file mode 100644 index 00000000..e0c06e6d --- /dev/null +++ b/pkg/controllers/instance/garbagecollection/readme.md @@ -0,0 +1,16 @@ +## instance garbage collection controller + +- background + +When agentpool is in the Creating process, if user starts to delete NodeClaim such as `kubectl delete nodeclaim {NodeClaimName}`, [nodeclaim termination controller](https://github.com/kubernetes-sigs/karpenter/blob/v1.0.4/pkg/controllers/nodeclaim/termination/controller.go) will remove the termination finalizer of NodeClaim, then NodeClaim will be removed from the cluster. But agentpoll is still in the Creating process, this means agentpool and related node will be leaked. + +- solution + +A new garbage collection controller named [instance garbage collection] is used for garbaging leaked agentpool and node. + + 1. if agentpool releated NodeClaim is removed in the cluster, and agentpool is created more than 10min, [instance garbage collection] controller will delete the agentpool resource. + 2. if the leaked agentpool has related nodes, [instance garbage collection] controller will aslo delete node resource. + +## others + +[nodeclaim.garbagecollection controller](https://github.com/kubernetes-sigs/karpenter/blob/v1.0.4/pkg/controllers/nodeclaim/garbagecollection/controller.go) will not take effect in our scenario. When the backend agent pool is removed, it triggers the [node termination controller], which in turn triggers the [nodeclaim termination controller]. As a result, no NodeClaims will be leaked when backend agent pools are removed. \ No newline at end of file diff --git a/pkg/fake/azure_client.go b/pkg/fake/azure_client.go index 59ad48db..859c97a1 100644 --- a/pkg/fake/azure_client.go +++ b/pkg/fake/azure_client.go @@ -22,12 +22,15 @@ limitations under the License. package fake import ( - context "context" - reflect "reflect" - - runtime "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - v4 "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4" - gomock "go.uber.org/mock/gomock" + "context" + "reflect" + "fmt" + + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4" + "go.uber.org/mock/gomock" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + karpenterv1 "sigs.k8s.io/karpenter/pkg/apis/v1" ) // MockAgentPoolsAPI is a mock of AgentPoolsAPI interface. @@ -54,10 +57,10 @@ func (m *MockAgentPoolsAPI) EXPECT() *MockAgentPoolsAPIMockRecorder { } // BeginCreateOrUpdate mocks base method. -func (m *MockAgentPoolsAPI) BeginCreateOrUpdate(ctx context.Context, resourceGroupName, resourceName, agentPoolName string, parameters v4.AgentPool, options *v4.AgentPoolsClientBeginCreateOrUpdateOptions) (*runtime.Poller[v4.AgentPoolsClientCreateOrUpdateResponse], error) { +func (m *MockAgentPoolsAPI) BeginCreateOrUpdate(ctx context.Context, resourceGroupName, resourceName, agentPoolName string, parameters armcontainerservice.AgentPool, options *armcontainerservice.AgentPoolsClientBeginCreateOrUpdateOptions) (*runtime.Poller[armcontainerservice.AgentPoolsClientCreateOrUpdateResponse], error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "BeginCreateOrUpdate", ctx, resourceGroupName, resourceName, agentPoolName, parameters, options) - ret0, _ := ret[0].(*runtime.Poller[v4.AgentPoolsClientCreateOrUpdateResponse]) + ret0, _ := ret[0].(*runtime.Poller[armcontainerservice.AgentPoolsClientCreateOrUpdateResponse]) ret1, _ := ret[1].(error) return ret0, ret1 } @@ -69,10 +72,10 @@ func (mr *MockAgentPoolsAPIMockRecorder) BeginCreateOrUpdate(ctx, resourceGroupN } // BeginDelete mocks base method. -func (m *MockAgentPoolsAPI) BeginDelete(ctx context.Context, resourceGroupName, resourceName, agentPoolName string, options *v4.AgentPoolsClientBeginDeleteOptions) (*runtime.Poller[v4.AgentPoolsClientDeleteResponse], error) { +func (m *MockAgentPoolsAPI) BeginDelete(ctx context.Context, resourceGroupName, resourceName, agentPoolName string, options *armcontainerservice.AgentPoolsClientBeginDeleteOptions) (*runtime.Poller[armcontainerservice.AgentPoolsClientDeleteResponse], error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "BeginDelete", ctx, resourceGroupName, resourceName, agentPoolName, options) - ret0, _ := ret[0].(*runtime.Poller[v4.AgentPoolsClientDeleteResponse]) + ret0, _ := ret[0].(*runtime.Poller[armcontainerservice.AgentPoolsClientDeleteResponse]) ret1, _ := ret[1].(error) return ret0, ret1 } @@ -84,10 +87,10 @@ func (mr *MockAgentPoolsAPIMockRecorder) BeginDelete(ctx, resourceGroupName, res } // Get mocks base method. -func (m *MockAgentPoolsAPI) Get(ctx context.Context, resourceGroupName, resourceName, agentPoolName string, options *v4.AgentPoolsClientGetOptions) (v4.AgentPoolsClientGetResponse, error) { +func (m *MockAgentPoolsAPI) Get(ctx context.Context, resourceGroupName, resourceName, agentPoolName string, options *armcontainerservice.AgentPoolsClientGetOptions) (armcontainerservice.AgentPoolsClientGetResponse, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Get", ctx, resourceGroupName, resourceName, agentPoolName, options) - ret0, _ := ret[0].(v4.AgentPoolsClientGetResponse) + ret0, _ := ret[0].(armcontainerservice.AgentPoolsClientGetResponse) ret1, _ := ret[1].(error) return ret0, ret1 } @@ -99,10 +102,10 @@ func (mr *MockAgentPoolsAPIMockRecorder) Get(ctx, resourceGroupName, resourceNam } // NewListPager mocks base method. -func (m *MockAgentPoolsAPI) NewListPager(resourceGroupName, resourceName string, options *v4.AgentPoolsClientListOptions) *runtime.Pager[v4.AgentPoolsClientListResponse] { +func (m *MockAgentPoolsAPI) NewListPager(resourceGroupName, resourceName string, options *armcontainerservice.AgentPoolsClientListOptions) *runtime.Pager[armcontainerservice.AgentPoolsClientListResponse] { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "NewListPager", resourceGroupName, resourceName, options) - ret0, _ := ret[0].(*runtime.Pager[v4.AgentPoolsClientListResponse]) + ret0, _ := ret[0].(*runtime.Pager[armcontainerservice.AgentPoolsClientListResponse]) return ret0 } @@ -111,3 +114,17 @@ func (mr *MockAgentPoolsAPIMockRecorder) NewListPager(resourceGroupName, resourc mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewListPager", reflect.TypeOf((*MockAgentPoolsAPI)(nil).NewListPager), resourceGroupName, resourceName, options) } + +func CreateAgentPoolObjWithNodeClaim(nc *karpenterv1.NodeClaim) armcontainerservice.AgentPool { + return armcontainerservice.AgentPool{ + Name: &nc.Name, + ID: to.Ptr(fmt.Sprintf("azure:///subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/nodeRG/providers/Microsoft.Compute/virtualMachineScaleSets/aks-%s-20562481-vmss/virtualMachines/0", nc.Name)), + Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{ + VMSize: to.Ptr(nc.Spec.Requirements[0].Values[0]), + NodeLabels: map[string]*string{ + "test": to.Ptr("test"), + "kaito.sh/workspace": to.Ptr("none"), + }, + }, + } +} \ No newline at end of file diff --git a/pkg/fake/cloudprovider.go b/pkg/fake/cloudprovider.go deleted file mode 100644 index 43b9dff7..00000000 --- a/pkg/fake/cloudprovider.go +++ /dev/null @@ -1,210 +0,0 @@ -/* - Copyright (c) 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. -*/ -// https://github.com/kubernetes-sigs/karpenter/blob/62fe4ac537b8e381bbb11bd344bb2f05850cb619/pkg/cloudprovider/fake/cloudprovider.go - -package fake - -import ( - "context" - "fmt" - "math" - "sort" - "sync" - - "github.com/aws/karpenter-core/pkg/utils/functional" - "github.com/aws/karpenter-core/pkg/utils/resources" - "github.com/samber/lo" - v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/resource" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/util/sets" - - "github.com/aws/karpenter-core/pkg/apis/v1alpha5" - "github.com/aws/karpenter-core/pkg/cloudprovider" - "github.com/aws/karpenter-core/pkg/scheduling" - "github.com/aws/karpenter-core/pkg/test" -) - -var _ cloudprovider.CloudProvider = (*CloudProvider)(nil) - -type CloudProvider struct { - InstanceTypes []*cloudprovider.InstanceType - mu sync.RWMutex - // CreateCalls contains the arguments for every create call that was made since it was cleared - CreateCalls []*v1alpha5.Machine - CreatedMachines map[string]*v1alpha5.Machine - DeleteCalls []*v1alpha5.Machine - Drifted bool - AllowedCreateCalls int -} - -func NewCloudProvider() *CloudProvider { - return &CloudProvider{ - AllowedCreateCalls: math.MaxInt, - CreatedMachines: map[string]*v1alpha5.Machine{}, - } -} - -// Reset is for BeforeEach calls in testing to reset the tracking of CreateCalls -func (c *CloudProvider) Reset() { - c.mu.Lock() - defer c.mu.Unlock() - c.CreateCalls = []*v1alpha5.Machine{} - c.CreatedMachines = map[string]*v1alpha5.Machine{} - c.DeleteCalls = []*v1alpha5.Machine{} - c.AllowedCreateCalls = math.MaxInt - c.Drifted = false -} - -func (c *CloudProvider) Create(ctx context.Context, machine *v1alpha5.Machine) (*v1alpha5.Machine, error) { - c.mu.Lock() - c.CreateCalls = append(c.CreateCalls, machine) - if len(c.CreateCalls) > c.AllowedCreateCalls { - c.mu.Unlock() - return &v1alpha5.Machine{}, fmt.Errorf("erroring as number of AllowedCreateCalls has been exceeded") - } - c.mu.Unlock() - - requirements := scheduling.NewNodeSelectorRequirements(machine.Spec.Requirements...) - instanceTypes := lo.Filter(lo.Must(c.GetInstanceTypes(ctx, &v1alpha5.Provisioner{})), func(i *cloudprovider.InstanceType, _ int) bool { - return requirements.Get(v1.LabelInstanceTypeStable).Has(i.Name) - }) - // Order instance types so that we get the cheapest instance types of the available offerings - sort.Slice(instanceTypes, func(i, j int) bool { - iOfferings := instanceTypes[i].Offerings.Available().Requirements(requirements) - jOfferings := instanceTypes[j].Offerings.Available().Requirements(requirements) - return iOfferings.Cheapest().Price < jOfferings.Cheapest().Price - }) - instanceType := instanceTypes[0] - // Labels - labels := map[string]string{} - for key, requirement := range instanceType.Requirements { - if requirement.Operator() == v1.NodeSelectorOpIn { - labels[key] = requirement.Values()[0] - } - } - // Find Offering - for _, o := range instanceType.Offerings.Available() { - if requirements.Compatible(scheduling.NewRequirements( - scheduling.NewRequirement(v1.LabelTopologyZone, v1.NodeSelectorOpIn, o.Zone), - scheduling.NewRequirement(v1alpha5.LabelCapacityType, v1.NodeSelectorOpIn, o.CapacityType), - )) == nil { - labels[v1.LabelTopologyZone] = o.Zone - labels[v1alpha5.LabelCapacityType] = o.CapacityType - break - } - } - created := &v1alpha5.Machine{ - ObjectMeta: metav1.ObjectMeta{ - Name: machine.Name, - Labels: lo.Assign(labels, machine.Labels), - Annotations: machine.Annotations, - }, - Spec: *machine.Spec.DeepCopy(), - Status: v1alpha5.MachineStatus{ - ProviderID: test.RandomProviderID(), - Capacity: functional.FilterMap(instanceType.Capacity, func(_ v1.ResourceName, v resource.Quantity) bool { return !resources.IsZero(v) }), - Allocatable: functional.FilterMap(instanceType.Allocatable(), func(_ v1.ResourceName, v resource.Quantity) bool { return !resources.IsZero(v) }), - }, - } - c.CreatedMachines[created.Status.ProviderID] = created - return created, nil -} - -func (c *CloudProvider) Get(_ context.Context, id string) (*v1alpha5.Machine, error) { - c.mu.RLock() - defer c.mu.RUnlock() - - if machine, ok := c.CreatedMachines[id]; ok { - return machine.DeepCopy(), nil - } - return nil, cloudprovider.NewMachineNotFoundError(fmt.Errorf("no machine exists with id '%s'", id)) -} - -func (c *CloudProvider) List(_ context.Context) ([]*v1alpha5.Machine, error) { - c.mu.RLock() - defer c.mu.RUnlock() - - return lo.Map(lo.Values(c.CreatedMachines), func(m *v1alpha5.Machine, _ int) *v1alpha5.Machine { - return m.DeepCopy() - }), nil -} - -func (c *CloudProvider) GetInstanceTypes(_ context.Context, _ *v1alpha5.Provisioner) ([]*cloudprovider.InstanceType, error) { - if c.InstanceTypes != nil { - return c.InstanceTypes, nil - } - return []*cloudprovider.InstanceType{ - NewInstanceType(InstanceTypeOptions{ - Name: "default-instance-type", - }), - NewInstanceType(InstanceTypeOptions{ - Name: "small-instance-type", - Resources: map[v1.ResourceName]resource.Quantity{ - v1.ResourceCPU: resource.MustParse("2"), - v1.ResourceMemory: resource.MustParse("2Gi"), - }, - }), - NewInstanceType(InstanceTypeOptions{ - Name: "gpu-vendor-instance-type", - Resources: map[v1.ResourceName]resource.Quantity{ - ResourceGPUVendorA: resource.MustParse("2"), - }}), - NewInstanceType(InstanceTypeOptions{ - Name: "gpu-vendor-b-instance-type", - Resources: map[v1.ResourceName]resource.Quantity{ - ResourceGPUVendorB: resource.MustParse("2"), - }, - }), - NewInstanceType(InstanceTypeOptions{ - Name: "arm-instance-type", - Architecture: "arm64", - OperatingSystems: sets.NewString("ios", string(v1.Linux), string(v1.Windows), "darwin"), - Resources: map[v1.ResourceName]resource.Quantity{ - v1.ResourceCPU: resource.MustParse("16"), - v1.ResourceMemory: resource.MustParse("128Gi"), - }, - }), - NewInstanceType(InstanceTypeOptions{ - Name: "single-pod-instance-type", - Resources: map[v1.ResourceName]resource.Quantity{ - v1.ResourcePods: resource.MustParse("1"), - }, - }), - }, nil -} - -func (c *CloudProvider) Delete(_ context.Context, m *v1alpha5.Machine) error { - c.mu.Lock() - defer c.mu.Unlock() - - c.DeleteCalls = append(c.DeleteCalls, m) - if _, ok := c.CreatedMachines[m.Status.ProviderID]; ok { - delete(c.CreatedMachines, m.Status.ProviderID) - return nil - } - return cloudprovider.NewMachineNotFoundError(fmt.Errorf("no machine exists with provider id '%s'", m.Status.ProviderID)) -} - -func (c *CloudProvider) IsMachineDrifted(context.Context, *v1alpha5.Machine) (bool, error) { - c.mu.RLock() - defer c.mu.RUnlock() - return c.Drifted, nil -} - -// Name returns the CloudProvider implementation name. -func (c *CloudProvider) Name() string { - return "fake" -} diff --git a/pkg/fake/instanceType.go b/pkg/fake/instanceType.go deleted file mode 100644 index 881f769f..00000000 --- a/pkg/fake/instanceType.go +++ /dev/null @@ -1,188 +0,0 @@ -/* - Copyright (c) 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. -*/ -// https://github.com/kubernetes-sigs/karpenter/blob/62fe4ac537b8e381bbb11bd344bb2f05850cb619/pkg/cloudprovider/fake/instancetype.go - -package fake - -import ( - "fmt" - "strings" - - "github.com/samber/lo" - - "github.com/aws/karpenter-core/pkg/apis/v1alpha5" - "github.com/aws/karpenter-core/pkg/cloudprovider" - "github.com/aws/karpenter-core/pkg/scheduling" - v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/resource" - utilsets "k8s.io/apimachinery/pkg/util/sets" -) - -const ( - LabelInstanceSize = "size" - ExoticInstanceLabelKey = "special" - IntegerInstanceLabelKey = "integer" - ResourceGPUVendorA v1.ResourceName = "fake.com/vendor-a" - ResourceGPUVendorB v1.ResourceName = "fake.com/vendor-b" -) - -func init() { - v1alpha5.WellKnownLabels.Insert( - LabelInstanceSize, - ExoticInstanceLabelKey, - IntegerInstanceLabelKey, - ) -} - -func NewInstanceType(options InstanceTypeOptions) *cloudprovider.InstanceType { - if options.Resources == nil { - options.Resources = map[v1.ResourceName]resource.Quantity{} - } - if r := options.Resources[v1.ResourceCPU]; r.IsZero() { - options.Resources[v1.ResourceCPU] = resource.MustParse("4") - } - if r := options.Resources[v1.ResourceMemory]; r.IsZero() { - options.Resources[v1.ResourceMemory] = resource.MustParse("4Gi") - } - if r := options.Resources[v1.ResourcePods]; r.IsZero() { - options.Resources[v1.ResourcePods] = resource.MustParse("5") - } - if len(options.Offerings) == 0 { - options.Offerings = []cloudprovider.Offering{ - {CapacityType: "spot", Zone: "test-zone-1", Price: priceFromResources(options.Resources), Available: true}, - {CapacityType: "spot", Zone: "test-zone-2", Price: priceFromResources(options.Resources), Available: true}, - {CapacityType: "on-demand", Zone: "test-zone-1", Price: priceFromResources(options.Resources), Available: true}, - {CapacityType: "on-demand", Zone: "test-zone-2", Price: priceFromResources(options.Resources), Available: true}, - {CapacityType: "on-demand", Zone: "test-zone-3", Price: priceFromResources(options.Resources), Available: true}, - } - } - if len(options.Architecture) == 0 { - options.Architecture = "amd64" - } - if options.OperatingSystems.Len() == 0 { - options.OperatingSystems = utilsets.NewString(string(v1.Linux), string(v1.Windows), "darwin") - } - requirements := scheduling.NewRequirements( - scheduling.NewRequirement(v1.LabelInstanceTypeStable, v1.NodeSelectorOpIn, options.Name), - scheduling.NewRequirement(v1.LabelArchStable, v1.NodeSelectorOpIn, options.Architecture), - scheduling.NewRequirement(v1.LabelOSStable, v1.NodeSelectorOpIn, options.OperatingSystems.List()...), - scheduling.NewRequirement(v1.LabelTopologyZone, v1.NodeSelectorOpIn, lo.Map(options.Offerings.Available(), func(o cloudprovider.Offering, _ int) string { return o.Zone })...), - scheduling.NewRequirement(v1alpha5.LabelCapacityType, v1.NodeSelectorOpIn, lo.Map(options.Offerings.Available(), func(o cloudprovider.Offering, _ int) string { return o.CapacityType })...), - scheduling.NewRequirement(LabelInstanceSize, v1.NodeSelectorOpDoesNotExist), - scheduling.NewRequirement(ExoticInstanceLabelKey, v1.NodeSelectorOpDoesNotExist), - scheduling.NewRequirement(IntegerInstanceLabelKey, v1.NodeSelectorOpIn, fmt.Sprint(options.Resources.Cpu().Value())), - ) - if options.Resources.Cpu().Cmp(resource.MustParse("4")) > 0 && - options.Resources.Memory().Cmp(resource.MustParse("8Gi")) > 0 { - requirements.Get(LabelInstanceSize).Insert("large") - requirements.Get(ExoticInstanceLabelKey).Insert("optional") - } else { - requirements.Get(LabelInstanceSize).Insert("small") - } - - return &cloudprovider.InstanceType{ - Name: options.Name, - Requirements: requirements, - Offerings: options.Offerings, - Capacity: options.Resources, - Overhead: &cloudprovider.InstanceTypeOverhead{ - KubeReserved: v1.ResourceList{ - v1.ResourceCPU: resource.MustParse("100m"), - v1.ResourceMemory: resource.MustParse("10Mi"), - }, - }, - } -} - -// InstanceTypesAssorted create many unique instance types with varying CPU/memory/architecture/OS/zone/capacity type. -func InstanceTypesAssorted() []*cloudprovider.InstanceType { - var instanceTypes []*cloudprovider.InstanceType - for _, cpu := range []int{1, 2, 4, 8, 16, 32, 64} { - for _, mem := range []int{1, 2, 4, 8, 16, 32, 64, 128} { - for _, zone := range []string{"test-zone-1", "test-zone-2", "test-zone-3"} { - for _, ct := range []string{v1alpha5.CapacityTypeSpot, v1alpha5.CapacityTypeOnDemand} { - for _, os := range []utilsets.String{utilsets.NewString(string(v1.Linux)), utilsets.NewString(string(v1.Windows))} { - for _, arch := range []string{v1alpha5.ArchitectureAmd64, v1alpha5.ArchitectureArm64} { - opts := InstanceTypeOptions{ - Name: fmt.Sprintf("%d-cpu-%d-mem-%s-%s-%s-%s", cpu, mem, arch, strings.Join(os.List(), ","), zone, ct), - Architecture: arch, - OperatingSystems: os, - Resources: v1.ResourceList{ - v1.ResourceCPU: resource.MustParse(fmt.Sprintf("%d", cpu)), - v1.ResourceMemory: resource.MustParse(fmt.Sprintf("%dGi", mem)), - }, - } - price := priceFromResources(opts.Resources) - opts.Offerings = []cloudprovider.Offering{ - { - CapacityType: ct, - Zone: zone, - Price: price, - Available: true, - }, - } - instanceTypes = append(instanceTypes, NewInstanceType(opts)) - } - } - } - } - } - } - return instanceTypes -} - -// InstanceTypes creates instance types with incrementing resources -// 2Gi of RAM and 10 pods for every 1vcpu -// i.e. 1vcpu, 2Gi mem, 10 pods -// -// 2vcpu, 4Gi mem, 20 pods -// 3vcpu, 6Gi mem, 30 pods -func InstanceTypes(total int) []*cloudprovider.InstanceType { - instanceTypes := []*cloudprovider.InstanceType{} - for i := 0; i < total; i++ { - instanceTypes = append(instanceTypes, NewInstanceType(InstanceTypeOptions{ - Name: fmt.Sprintf("fake-it-%d", i), - Resources: map[v1.ResourceName]resource.Quantity{ - v1.ResourceCPU: resource.MustParse(fmt.Sprintf("%d", i+1)), - v1.ResourceMemory: resource.MustParse(fmt.Sprintf("%dGi", (i+1)*2)), - v1.ResourcePods: resource.MustParse(fmt.Sprintf("%d", (i+1)*10)), - }, - })) - } - return instanceTypes -} - -type InstanceTypeOptions struct { - Name string - Offerings cloudprovider.Offerings - Architecture string - OperatingSystems utilsets.String - Resources v1.ResourceList -} - -func priceFromResources(resources v1.ResourceList) float64 { - price := 0.0 - for k, v := range resources { - switch k { - case v1.ResourceCPU: - price += 0.1 * v.AsApproximateFloat64() - case v1.ResourceMemory: - price += 0.1 * v.AsApproximateFloat64() / (1e9) - case ResourceGPUVendorA, ResourceGPUVendorB: - price += 1.0 - } - } - return price -} diff --git a/pkg/fake/k8sClient.go b/pkg/fake/k8sClient.go index db50c0dc..f79fdb04 100644 --- a/pkg/fake/k8sClient.go +++ b/pkg/fake/k8sClient.go @@ -17,15 +17,18 @@ package fake import ( "context" + "fmt" "reflect" "github.com/stretchr/testify/mock" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/meta" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/types" k8sClient "sigs.k8s.io/controller-runtime/pkg/client" + karpenterv1 "sigs.k8s.io/karpenter/pkg/apis/v1" ) // MockClient is a mock for the controller-runtime dynamic client interface. @@ -167,22 +170,68 @@ func (m *MockClient) RESTMapper() meta.RESTMapper { return args.Get(0).(meta.RESTMapper) } +// StatusClient interface +func (m *MockClient) Status() k8sClient.StatusWriter { + return m.StatusMock +} + +// SubResourceClientConstructor interface +func (m *MockClient) SubResource(subResource string) k8sClient.SubResourceClient { + return m.StatusMock +} + type MockStatusClient struct { mock.Mock } +// Create implements client.StatusWriter +func (*MockStatusClient) Create(ctx context.Context, obj k8sClient.Object, subResource k8sClient.Object, opts ...k8sClient.SubResourceCreateOption) error { + panic("unimplemented") +} + // Patch implements client.StatusWriter -func (*MockStatusClient) Patch(ctx context.Context, obj k8sClient.Object, patch k8sClient.Patch, opts ...k8sClient.PatchOption) error { +func (*MockStatusClient) Patch(ctx context.Context, obj k8sClient.Object, patch k8sClient.Patch, opts ...k8sClient.SubResourcePatchOption) error { panic("unimplemented") } // Update implements client.StatusWriter -func (*MockStatusClient) Update(ctx context.Context, obj k8sClient.Object, opts ...k8sClient.UpdateOption) error { +func (*MockStatusClient) Update(ctx context.Context, obj k8sClient.Object, opts ...k8sClient.SubResourceUpdateOption) error { panic("unimplemented") } -// StatusClient interface +func (*MockStatusClient) Get(ctx context.Context, obj k8sClient.Object, subResource k8sClient.Object, opts ...k8sClient.SubResourceGetOption) error { + panic("unimplemented") +} -func (m *MockClient) Status() k8sClient.StatusWriter { - return m.StatusMock +func CreateNodeListWithNodeClaim(nodeClaims []*karpenterv1.NodeClaim) *corev1.NodeList { + nodes := []corev1.Node{} + for i := range nodeClaims { + if len(nodeClaims[i].Status.ProviderID) == 0 { + continue + } + nodes = append(nodes, corev1.Node{ + ObjectMeta: metav1.ObjectMeta{ + Name: fmt.Sprintf("aks-%s-20562481-vmss_0", nodeClaims[i].Name), + Labels: map[string]string{ + "agentpool": nodeClaims[i].Name, + "kubernetes.azure.com/agentpool": nodeClaims[i].Name, + }, + }, + Spec: corev1.NodeSpec{ + ProviderID: nodeClaims[i].Status.ProviderID, + }, + Status: corev1.NodeStatus{ + Conditions: []corev1.NodeCondition{ + { + Type: corev1.NodeReady, + Status: corev1.ConditionTrue, + }, + }, + }, + }) + } + + return &corev1.NodeList{ + Items: nodes, + } } diff --git a/pkg/fake/nodeclaim.go b/pkg/fake/nodeclaim.go new file mode 100644 index 00000000..c1ff1c38 --- /dev/null +++ b/pkg/fake/nodeclaim.go @@ -0,0 +1,83 @@ +/* + Copyright (c) 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. +*/ + +package fake + +import ( + "fmt" + + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/samber/lo" + v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + karpenterv1 "sigs.k8s.io/karpenter/pkg/apis/v1" +) + +func GetNodeClaimObj(name string, labels map[string]string, taints []v1.Taint, resource karpenterv1.ResourceRequirements, req []v1.NodeSelectorRequirement) *karpenterv1.NodeClaim { + requirements := lo.Map(req, func(v1Requirements v1.NodeSelectorRequirement, _ int) karpenterv1.NodeSelectorRequirementWithMinValues { + return karpenterv1.NodeSelectorRequirementWithMinValues{ + NodeSelectorRequirement: v1.NodeSelectorRequirement{ + Key: v1Requirements.Key, + Operator: v1Requirements.Operator, + Values: v1Requirements.Values, + }, + MinValues: to.Ptr(int(1)), + } + }) + + labels["kaito.sh/workspace"] = "none" + return &karpenterv1.NodeClaim{ + ObjectMeta: metav1.ObjectMeta{ + Name: name, + Namespace: "nodeclaim-ns", + Labels: labels, + }, + Spec: karpenterv1.NodeClaimSpec{ + Resources: resource, + Requirements: requirements, + NodeClassRef: &karpenterv1.NodeClassReference{}, + Taints: taints, + }, + Status: karpenterv1.NodeClaimStatus{ + ProviderID: fmt.Sprintf("azure:///subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/nodeRG/providers/Microsoft.Compute/virtualMachineScaleSets/aks-%s-20562481-vmss/virtualMachines/0", name), + }, + } +} + +func GetNodeClaimObjWithoutProviderID(name string, labels map[string]string, taints []v1.Taint, resource karpenterv1.ResourceRequirements, req []v1.NodeSelectorRequirement) *karpenterv1.NodeClaim { + requirements := lo.Map(req, func(v1Requirements v1.NodeSelectorRequirement, _ int) karpenterv1.NodeSelectorRequirementWithMinValues { + return karpenterv1.NodeSelectorRequirementWithMinValues{ + NodeSelectorRequirement: v1.NodeSelectorRequirement{ + Key: v1Requirements.Key, + Operator: v1Requirements.Operator, + Values: v1Requirements.Values, + }, + MinValues: to.Ptr(int(1)), + } + }) + return &karpenterv1.NodeClaim{ + ObjectMeta: metav1.ObjectMeta{ + Name: name, + Namespace: "nodeclaim-ns", + Labels: labels, + }, + Spec: karpenterv1.NodeClaimSpec{ + Resources: resource, + Requirements: requirements, + NodeClassRef: &karpenterv1.NodeClassReference{}, + Taints: taints, + }, + } +} diff --git a/pkg/fake/pricingapi.go b/pkg/fake/pricingapi.go deleted file mode 100644 index 27858654..00000000 --- a/pkg/fake/pricingapi.go +++ /dev/null @@ -1,56 +0,0 @@ -/* - Copyright (c) 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. -*/ - -package fake - -import ( - "context" - "errors" - - "github.com/azure/gpu-provisioner/pkg/providers/pricing/client" -) - -type PricingAPI struct { - client.PricingAPI - PricingBehavior -} -type PricingBehavior struct { - NextError AtomicError - ProductsPricePage AtomicPtr[client.ProductsPricePage] -} - -func (p *PricingAPI) Reset() { - p.NextError.Reset() - p.ProductsPricePage.Reset() -} - -func (p *PricingAPI) GetProductsPricePages(_ context.Context, _ []*client.Filter, fn func(output *client.ProductsPricePage)) error { - if !p.NextError.IsNil() { - return p.NextError.Get() - } - if !p.ProductsPricePage.IsNil() { - fn(p.ProductsPricePage.Clone()) - return nil - } - // fail if the test doesn't provide specific data which causes our pricing provider to use its static price list - return errors.New("no pricing data provided") -} - -func NewProductPrice(instanceType string, price float64) client.Item { - return client.Item{ - ArmSkuName: instanceType, - RetailPrice: price, - } -} diff --git a/pkg/fake/resourceskuapi.go b/pkg/fake/resourceskuapi.go deleted file mode 100644 index 8aebc741..00000000 --- a/pkg/fake/resourceskuapi.go +++ /dev/null @@ -1,56 +0,0 @@ -/* - Copyright (c) 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. -*/ - -package fake - -import ( - "context" - - //nolint SA1019 - deprecated package - "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute" - "github.com/Azure/skewer" -) - -// TODO: consider using fakes from skewer itself - -// assert that the fake implements the interface -var _ skewer.ResourceClient = &ResourceSKUsAPI{} - -type ResourceSKUsAPI struct { - // skewer.ResourceClient -} - -// Reset must be called between tests otherwise tests will pollute each other. -func (s *ResourceSKUsAPI) Reset() { - //c.ResourceSKUsBehavior.Reset() -} - -func (s *ResourceSKUsAPI) ListComplete(_ context.Context, _, _ string) (compute.ResourceSkusResultIterator, error) { - return compute.NewResourceSkusResultIterator( - compute.NewResourceSkusResultPage( - // cur - compute.ResourceSkusResult{ - Value: &ResourceSkus, - }, - // fn - func(ctx context.Context, result compute.ResourceSkusResult) (compute.ResourceSkusResult, error) { - return compute.ResourceSkusResult{ - Value: nil, // end of iterator - NextLink: nil, - }, nil - }, - ), - ), nil -} diff --git a/pkg/fake/zz_generated.sku.go b/pkg/fake/zz_generated.sku.go deleted file mode 100644 index d59f83b3..00000000 --- a/pkg/fake/zz_generated.sku.go +++ /dev/null @@ -1,350 +0,0 @@ -//go:build !ignore_autogenerated - -/* - Copyright (c) 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. -*/ - -package fake - -import ( - "github.com/samber/lo" - // nolint SA1019 - deprecated package - "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute" -) - -// generated at 2023-09-28T21:15:02Z - -// ResourceSkus is a list of all available skus from azure -var ResourceSkus = []compute.ResourceSku{ - { - Name: lo.ToPtr("Standard_D2s_v3"), - Tier: lo.ToPtr("Standard"), - Kind: lo.ToPtr(""), - Size: lo.ToPtr("D2s_v3"), - Family: lo.ToPtr("standardDSv3Family"), - ResourceType: lo.ToPtr("virtualMachines"), - APIVersions: &[]string{}, - Costs: &[]compute.ResourceSkuCosts{}, - Restrictions: &[]compute.ResourceSkuRestrictions{}, - Capabilities: &[]compute.ResourceSkuCapabilities{ - {Name: lo.ToPtr("MaxResourceVolumeMB"), Value: lo.ToPtr("16384")}, - {Name: lo.ToPtr("OSVhdSizeMB"), Value: lo.ToPtr("1047552")}, - {Name: lo.ToPtr("vCPUs"), Value: lo.ToPtr("2")}, - {Name: lo.ToPtr("MemoryPreservingMaintenanceSupported"), Value: lo.ToPtr("True")}, - {Name: lo.ToPtr("HyperVGenerations"), Value: lo.ToPtr("V1,V2")}, - {Name: lo.ToPtr("MemoryGB"), Value: lo.ToPtr("8")}, - {Name: lo.ToPtr("MaxDataDiskCount"), Value: lo.ToPtr("4")}, - {Name: lo.ToPtr("CpuArchitectureType"), Value: lo.ToPtr("x64")}, - {Name: lo.ToPtr("LowPriorityCapable"), Value: lo.ToPtr("True")}, - {Name: lo.ToPtr("PremiumIO"), Value: lo.ToPtr("True")}, - {Name: lo.ToPtr("VMDeploymentTypes"), Value: lo.ToPtr("IaaS")}, - {Name: lo.ToPtr("vCPUsAvailable"), Value: lo.ToPtr("2")}, - {Name: lo.ToPtr("ACUs"), Value: lo.ToPtr("160")}, - {Name: lo.ToPtr("vCPUsPerCore"), Value: lo.ToPtr("2")}, - {Name: lo.ToPtr("CombinedTempDiskAndCachedIOPS"), Value: lo.ToPtr("4000")}, - {Name: lo.ToPtr("CombinedTempDiskAndCachedReadBytesPerSecond"), Value: lo.ToPtr("33554432")}, - {Name: lo.ToPtr("CombinedTempDiskAndCachedWriteBytesPerSecond"), Value: lo.ToPtr("33554432")}, - {Name: lo.ToPtr("CachedDiskBytes"), Value: lo.ToPtr("53687091200")}, - {Name: lo.ToPtr("UncachedDiskIOPS"), Value: lo.ToPtr("3200")}, - {Name: lo.ToPtr("UncachedDiskBytesPerSecond"), Value: lo.ToPtr("50331648")}, - {Name: lo.ToPtr("EphemeralOSDiskSupported"), Value: lo.ToPtr("True")}, - {Name: lo.ToPtr("EncryptionAtHostSupported"), Value: lo.ToPtr("True")}, - {Name: lo.ToPtr("CapacityReservationSupported"), Value: lo.ToPtr("False")}, - {Name: lo.ToPtr("AcceleratedNetworkingEnabled"), Value: lo.ToPtr("True")}, - {Name: lo.ToPtr("RdmaEnabled"), Value: lo.ToPtr("False")}, - {Name: lo.ToPtr("MaxNetworkInterfaces"), Value: lo.ToPtr("2")}, - }, - Locations: &[]string{""}, - LocationInfo: &[]compute.ResourceSkuLocationInfo{{Location: lo.ToPtr(""), Zones: &[]string{ - "3", - "2", - "1", - }, - }, - }, - }, - { - Name: lo.ToPtr("Standard_D2_v2"), - Tier: lo.ToPtr("Standard"), - Kind: lo.ToPtr(""), - Size: lo.ToPtr("D2_v2"), - Family: lo.ToPtr("standardDv2Family"), - ResourceType: lo.ToPtr("virtualMachines"), - APIVersions: &[]string{}, - Costs: &[]compute.ResourceSkuCosts{}, - Restrictions: &[]compute.ResourceSkuRestrictions{}, - Capabilities: &[]compute.ResourceSkuCapabilities{ - {Name: lo.ToPtr("MaxResourceVolumeMB"), Value: lo.ToPtr("102400")}, - {Name: lo.ToPtr("OSVhdSizeMB"), Value: lo.ToPtr("1047552")}, - {Name: lo.ToPtr("vCPUs"), Value: lo.ToPtr("2")}, - {Name: lo.ToPtr("MemoryPreservingMaintenanceSupported"), Value: lo.ToPtr("True")}, - {Name: lo.ToPtr("HyperVGenerations"), Value: lo.ToPtr("V1")}, - {Name: lo.ToPtr("MemoryGB"), Value: lo.ToPtr("7")}, - {Name: lo.ToPtr("MaxDataDiskCount"), Value: lo.ToPtr("8")}, - {Name: lo.ToPtr("CpuArchitectureType"), Value: lo.ToPtr("x64")}, - {Name: lo.ToPtr("LowPriorityCapable"), Value: lo.ToPtr("True")}, - {Name: lo.ToPtr("PremiumIO"), Value: lo.ToPtr("False")}, - {Name: lo.ToPtr("VMDeploymentTypes"), Value: lo.ToPtr("IaaS,PaaS")}, - {Name: lo.ToPtr("vCPUsAvailable"), Value: lo.ToPtr("2")}, - {Name: lo.ToPtr("ACUs"), Value: lo.ToPtr("210")}, - {Name: lo.ToPtr("vCPUsPerCore"), Value: lo.ToPtr("1")}, - {Name: lo.ToPtr("CombinedTempDiskAndCachedIOPS"), Value: lo.ToPtr("6000")}, - {Name: lo.ToPtr("CombinedTempDiskAndCachedReadBytesPerSecond"), Value: lo.ToPtr("97517568")}, - {Name: lo.ToPtr("CombinedTempDiskAndCachedWriteBytesPerSecond"), Value: lo.ToPtr("48234496")}, - {Name: lo.ToPtr("EphemeralOSDiskSupported"), Value: lo.ToPtr("False")}, - {Name: lo.ToPtr("EncryptionAtHostSupported"), Value: lo.ToPtr("False")}, - {Name: lo.ToPtr("CapacityReservationSupported"), Value: lo.ToPtr("False")}, - {Name: lo.ToPtr("AcceleratedNetworkingEnabled"), Value: lo.ToPtr("True")}, - {Name: lo.ToPtr("RdmaEnabled"), Value: lo.ToPtr("False")}, - {Name: lo.ToPtr("MaxNetworkInterfaces"), Value: lo.ToPtr("2")}, - }, - Locations: &[]string{""}, - LocationInfo: &[]compute.ResourceSkuLocationInfo{{Location: lo.ToPtr(""), Zones: &[]string{ - "3", - "2", - "1", - }, - }, - }, - }, - { - Name: lo.ToPtr("Standard_D2_v3"), - Tier: lo.ToPtr("Standard"), - Kind: lo.ToPtr(""), - Size: lo.ToPtr("D2_v3"), - Family: lo.ToPtr("standardDv3Family"), - ResourceType: lo.ToPtr("virtualMachines"), - APIVersions: &[]string{}, - Costs: &[]compute.ResourceSkuCosts{}, - Restrictions: &[]compute.ResourceSkuRestrictions{}, - Capabilities: &[]compute.ResourceSkuCapabilities{ - {Name: lo.ToPtr("MaxResourceVolumeMB"), Value: lo.ToPtr("51200")}, - {Name: lo.ToPtr("OSVhdSizeMB"), Value: lo.ToPtr("1047552")}, - {Name: lo.ToPtr("vCPUs"), Value: lo.ToPtr("2")}, - {Name: lo.ToPtr("MemoryPreservingMaintenanceSupported"), Value: lo.ToPtr("True")}, - {Name: lo.ToPtr("HyperVGenerations"), Value: lo.ToPtr("V1")}, - {Name: lo.ToPtr("MemoryGB"), Value: lo.ToPtr("8")}, - {Name: lo.ToPtr("MaxDataDiskCount"), Value: lo.ToPtr("4")}, - {Name: lo.ToPtr("CpuArchitectureType"), Value: lo.ToPtr("x64")}, - {Name: lo.ToPtr("LowPriorityCapable"), Value: lo.ToPtr("True")}, - {Name: lo.ToPtr("PremiumIO"), Value: lo.ToPtr("False")}, - {Name: lo.ToPtr("VMDeploymentTypes"), Value: lo.ToPtr("IaaS,PaaS")}, - {Name: lo.ToPtr("vCPUsAvailable"), Value: lo.ToPtr("2")}, - {Name: lo.ToPtr("ACUs"), Value: lo.ToPtr("160")}, - {Name: lo.ToPtr("vCPUsPerCore"), Value: lo.ToPtr("2")}, - {Name: lo.ToPtr("CombinedTempDiskAndCachedIOPS"), Value: lo.ToPtr("3000")}, - {Name: lo.ToPtr("CombinedTempDiskAndCachedReadBytesPerSecond"), Value: lo.ToPtr("48234496")}, - {Name: lo.ToPtr("CombinedTempDiskAndCachedWriteBytesPerSecond"), Value: lo.ToPtr("24117248")}, - {Name: lo.ToPtr("EphemeralOSDiskSupported"), Value: lo.ToPtr("False")}, - {Name: lo.ToPtr("EncryptionAtHostSupported"), Value: lo.ToPtr("False")}, - {Name: lo.ToPtr("CapacityReservationSupported"), Value: lo.ToPtr("False")}, - {Name: lo.ToPtr("AcceleratedNetworkingEnabled"), Value: lo.ToPtr("True")}, - {Name: lo.ToPtr("RdmaEnabled"), Value: lo.ToPtr("False")}, - {Name: lo.ToPtr("MaxNetworkInterfaces"), Value: lo.ToPtr("2")}, - }, - Locations: &[]string{""}, - LocationInfo: &[]compute.ResourceSkuLocationInfo{{Location: lo.ToPtr(""), Zones: &[]string{ - "3", - "2", - "1", - }, - }, - }, - }, - { - Name: lo.ToPtr("Standard_D2_v5"), - Tier: lo.ToPtr("Standard"), - Kind: lo.ToPtr(""), - Size: lo.ToPtr("D2_v5"), - Family: lo.ToPtr("standardDv5Family"), - ResourceType: lo.ToPtr("virtualMachines"), - APIVersions: &[]string{}, - Costs: &[]compute.ResourceSkuCosts{}, - Restrictions: &[]compute.ResourceSkuRestrictions{}, - Capabilities: &[]compute.ResourceSkuCapabilities{ - {Name: lo.ToPtr("MaxResourceVolumeMB"), Value: lo.ToPtr("0")}, - {Name: lo.ToPtr("OSVhdSizeMB"), Value: lo.ToPtr("1047552")}, - {Name: lo.ToPtr("vCPUs"), Value: lo.ToPtr("2")}, - {Name: lo.ToPtr("MemoryPreservingMaintenanceSupported"), Value: lo.ToPtr("True")}, - {Name: lo.ToPtr("HyperVGenerations"), Value: lo.ToPtr("V1,V2")}, - {Name: lo.ToPtr("MemoryGB"), Value: lo.ToPtr("8")}, - {Name: lo.ToPtr("MaxDataDiskCount"), Value: lo.ToPtr("4")}, - {Name: lo.ToPtr("CpuArchitectureType"), Value: lo.ToPtr("x64")}, - {Name: lo.ToPtr("LowPriorityCapable"), Value: lo.ToPtr("True")}, - {Name: lo.ToPtr("PremiumIO"), Value: lo.ToPtr("False")}, - {Name: lo.ToPtr("VMDeploymentTypes"), Value: lo.ToPtr("IaaS")}, - {Name: lo.ToPtr("vCPUsAvailable"), Value: lo.ToPtr("2")}, - {Name: lo.ToPtr("vCPUsPerCore"), Value: lo.ToPtr("2")}, - {Name: lo.ToPtr("CombinedTempDiskAndCachedIOPS"), Value: lo.ToPtr("19000")}, - {Name: lo.ToPtr("CombinedTempDiskAndCachedReadBytesPerSecond"), Value: lo.ToPtr("131072000")}, - {Name: lo.ToPtr("CombinedTempDiskAndCachedWriteBytesPerSecond"), Value: lo.ToPtr("131072000")}, - {Name: lo.ToPtr("UncachedDiskIOPS"), Value: lo.ToPtr("3750")}, - {Name: lo.ToPtr("UncachedDiskBytesPerSecond"), Value: lo.ToPtr("89128960")}, - {Name: lo.ToPtr("EphemeralOSDiskSupported"), Value: lo.ToPtr("False")}, - {Name: lo.ToPtr("EncryptionAtHostSupported"), Value: lo.ToPtr("True")}, - {Name: lo.ToPtr("CapacityReservationSupported"), Value: lo.ToPtr("False")}, - {Name: lo.ToPtr("AcceleratedNetworkingEnabled"), Value: lo.ToPtr("True")}, - {Name: lo.ToPtr("RdmaEnabled"), Value: lo.ToPtr("False")}, - {Name: lo.ToPtr("MaxNetworkInterfaces"), Value: lo.ToPtr("2")}, - }, - Locations: &[]string{""}, - LocationInfo: &[]compute.ResourceSkuLocationInfo{{Location: lo.ToPtr(""), Zones: &[]string{ - "3", - "1", - "2", - }, - }, - }, - }, - { - Name: lo.ToPtr("Standard_DS2_v2"), - Tier: lo.ToPtr("Standard"), - Kind: lo.ToPtr(""), - Size: lo.ToPtr("DS2_v2"), - Family: lo.ToPtr("standardDSv2Family"), - ResourceType: lo.ToPtr("virtualMachines"), - APIVersions: &[]string{}, - Costs: &[]compute.ResourceSkuCosts{}, - Restrictions: &[]compute.ResourceSkuRestrictions{}, - Capabilities: &[]compute.ResourceSkuCapabilities{ - {Name: lo.ToPtr("MaxResourceVolumeMB"), Value: lo.ToPtr("14336")}, - {Name: lo.ToPtr("OSVhdSizeMB"), Value: lo.ToPtr("1047552")}, - {Name: lo.ToPtr("vCPUs"), Value: lo.ToPtr("2")}, - {Name: lo.ToPtr("MemoryPreservingMaintenanceSupported"), Value: lo.ToPtr("True")}, - {Name: lo.ToPtr("HyperVGenerations"), Value: lo.ToPtr("V1,V2")}, - {Name: lo.ToPtr("MemoryGB"), Value: lo.ToPtr("7")}, - {Name: lo.ToPtr("MaxDataDiskCount"), Value: lo.ToPtr("8")}, - {Name: lo.ToPtr("CpuArchitectureType"), Value: lo.ToPtr("x64")}, - {Name: lo.ToPtr("LowPriorityCapable"), Value: lo.ToPtr("True")}, - {Name: lo.ToPtr("PremiumIO"), Value: lo.ToPtr("True")}, - {Name: lo.ToPtr("VMDeploymentTypes"), Value: lo.ToPtr("IaaS")}, - {Name: lo.ToPtr("vCPUsAvailable"), Value: lo.ToPtr("2")}, - {Name: lo.ToPtr("ACUs"), Value: lo.ToPtr("210")}, - {Name: lo.ToPtr("vCPUsPerCore"), Value: lo.ToPtr("1")}, - {Name: lo.ToPtr("CombinedTempDiskAndCachedIOPS"), Value: lo.ToPtr("8000")}, - {Name: lo.ToPtr("CombinedTempDiskAndCachedReadBytesPerSecond"), Value: lo.ToPtr("65536000")}, - {Name: lo.ToPtr("CombinedTempDiskAndCachedWriteBytesPerSecond"), Value: lo.ToPtr("65536000")}, - {Name: lo.ToPtr("CachedDiskBytes"), Value: lo.ToPtr("92341796864")}, - {Name: lo.ToPtr("UncachedDiskIOPS"), Value: lo.ToPtr("6400")}, - {Name: lo.ToPtr("UncachedDiskBytesPerSecond"), Value: lo.ToPtr("96000000")}, - {Name: lo.ToPtr("EphemeralOSDiskSupported"), Value: lo.ToPtr("True")}, - {Name: lo.ToPtr("EncryptionAtHostSupported"), Value: lo.ToPtr("True")}, - {Name: lo.ToPtr("CapacityReservationSupported"), Value: lo.ToPtr("False")}, - {Name: lo.ToPtr("AcceleratedNetworkingEnabled"), Value: lo.ToPtr("True")}, - {Name: lo.ToPtr("RdmaEnabled"), Value: lo.ToPtr("False")}, - {Name: lo.ToPtr("MaxNetworkInterfaces"), Value: lo.ToPtr("2")}, - }, - Locations: &[]string{""}, - LocationInfo: &[]compute.ResourceSkuLocationInfo{{Location: lo.ToPtr(""), Zones: &[]string{ - "3", - "2", - "1", - }, - }, - }, - }, - { - Name: lo.ToPtr("Standard_F16s_v2"), - Tier: lo.ToPtr("Standard"), - Kind: lo.ToPtr(""), - Size: lo.ToPtr("F16s_v2"), - Family: lo.ToPtr("standardFSv2Family"), - ResourceType: lo.ToPtr("virtualMachines"), - APIVersions: &[]string{}, - Costs: &[]compute.ResourceSkuCosts{}, - Restrictions: &[]compute.ResourceSkuRestrictions{}, - Capabilities: &[]compute.ResourceSkuCapabilities{ - {Name: lo.ToPtr("MaxResourceVolumeMB"), Value: lo.ToPtr("131072")}, - {Name: lo.ToPtr("OSVhdSizeMB"), Value: lo.ToPtr("1047552")}, - {Name: lo.ToPtr("vCPUs"), Value: lo.ToPtr("16")}, - {Name: lo.ToPtr("MemoryPreservingMaintenanceSupported"), Value: lo.ToPtr("True")}, - {Name: lo.ToPtr("HyperVGenerations"), Value: lo.ToPtr("V1,V2")}, - {Name: lo.ToPtr("MemoryGB"), Value: lo.ToPtr("32")}, - {Name: lo.ToPtr("MaxDataDiskCount"), Value: lo.ToPtr("32")}, - {Name: lo.ToPtr("CpuArchitectureType"), Value: lo.ToPtr("x64")}, - {Name: lo.ToPtr("LowPriorityCapable"), Value: lo.ToPtr("True")}, - {Name: lo.ToPtr("PremiumIO"), Value: lo.ToPtr("True")}, - {Name: lo.ToPtr("VMDeploymentTypes"), Value: lo.ToPtr("IaaS")}, - {Name: lo.ToPtr("vCPUsAvailable"), Value: lo.ToPtr("16")}, - {Name: lo.ToPtr("ACUs"), Value: lo.ToPtr("195")}, - {Name: lo.ToPtr("vCPUsPerCore"), Value: lo.ToPtr("2")}, - {Name: lo.ToPtr("CombinedTempDiskAndCachedIOPS"), Value: lo.ToPtr("32000")}, - {Name: lo.ToPtr("CombinedTempDiskAndCachedReadBytesPerSecond"), Value: lo.ToPtr("262144000")}, - {Name: lo.ToPtr("CombinedTempDiskAndCachedWriteBytesPerSecond"), Value: lo.ToPtr("262144000")}, - {Name: lo.ToPtr("CachedDiskBytes"), Value: lo.ToPtr("274877906944")}, - {Name: lo.ToPtr("UncachedDiskIOPS"), Value: lo.ToPtr("25600")}, - {Name: lo.ToPtr("UncachedDiskBytesPerSecond"), Value: lo.ToPtr("384000000")}, - {Name: lo.ToPtr("EphemeralOSDiskSupported"), Value: lo.ToPtr("True")}, - {Name: lo.ToPtr("EncryptionAtHostSupported"), Value: lo.ToPtr("True")}, - {Name: lo.ToPtr("CapacityReservationSupported"), Value: lo.ToPtr("False")}, - {Name: lo.ToPtr("AcceleratedNetworkingEnabled"), Value: lo.ToPtr("True")}, - {Name: lo.ToPtr("RdmaEnabled"), Value: lo.ToPtr("False")}, - {Name: lo.ToPtr("MaxNetworkInterfaces"), Value: lo.ToPtr("4")}, - }, - Locations: &[]string{""}, - LocationInfo: &[]compute.ResourceSkuLocationInfo{{Location: lo.ToPtr(""), Zones: &[]string{ - "3", - "1", - "2", - }, - }, - }, - }, - { - Name: lo.ToPtr("Standard_NC24ads_A100_v4"), - Tier: lo.ToPtr("Standard"), - Kind: lo.ToPtr(""), - Size: lo.ToPtr("NC24ads_A100_v4"), - Family: lo.ToPtr("StandardNCADSA100v4Family"), - ResourceType: lo.ToPtr("virtualMachines"), - APIVersions: &[]string{}, - Costs: &[]compute.ResourceSkuCosts{}, - Restrictions: &[]compute.ResourceSkuRestrictions{}, - Capabilities: &[]compute.ResourceSkuCapabilities{ - {Name: lo.ToPtr("MaxResourceVolumeMB"), Value: lo.ToPtr("65536")}, - {Name: lo.ToPtr("OSVhdSizeMB"), Value: lo.ToPtr("1047552")}, - {Name: lo.ToPtr("vCPUs"), Value: lo.ToPtr("24")}, - {Name: lo.ToPtr("MemoryPreservingMaintenanceSupported"), Value: lo.ToPtr("False")}, - {Name: lo.ToPtr("HyperVGenerations"), Value: lo.ToPtr("V2")}, - {Name: lo.ToPtr("MemoryGB"), Value: lo.ToPtr("220")}, - {Name: lo.ToPtr("MaxDataDiskCount"), Value: lo.ToPtr("8")}, - {Name: lo.ToPtr("CpuArchitectureType"), Value: lo.ToPtr("x64")}, - {Name: lo.ToPtr("LowPriorityCapable"), Value: lo.ToPtr("True")}, - {Name: lo.ToPtr("PremiumIO"), Value: lo.ToPtr("True")}, - {Name: lo.ToPtr("VMDeploymentTypes"), Value: lo.ToPtr("IaaS")}, - {Name: lo.ToPtr("vCPUsAvailable"), Value: lo.ToPtr("24")}, - {Name: lo.ToPtr("GPUs"), Value: lo.ToPtr("1")}, - {Name: lo.ToPtr("vCPUsPerCore"), Value: lo.ToPtr("1")}, - {Name: lo.ToPtr("CombinedTempDiskAndCachedIOPS"), Value: lo.ToPtr("75000")}, - {Name: lo.ToPtr("CombinedTempDiskAndCachedReadBytesPerSecond"), Value: lo.ToPtr("1000000000")}, - {Name: lo.ToPtr("CombinedTempDiskAndCachedWriteBytesPerSecond"), Value: lo.ToPtr("1000000000")}, - {Name: lo.ToPtr("CachedDiskBytes"), Value: lo.ToPtr("274877906944")}, - {Name: lo.ToPtr("UncachedDiskIOPS"), Value: lo.ToPtr("25600")}, - {Name: lo.ToPtr("UncachedDiskBytesPerSecond"), Value: lo.ToPtr("384000000")}, - {Name: lo.ToPtr("NvmeDiskSizeInMiB"), Value: lo.ToPtr("915456")}, - {Name: lo.ToPtr("EphemeralOSDiskSupported"), Value: lo.ToPtr("True")}, - {Name: lo.ToPtr("EncryptionAtHostSupported"), Value: lo.ToPtr("True")}, - {Name: lo.ToPtr("CapacityReservationSupported"), Value: lo.ToPtr("False")}, - {Name: lo.ToPtr("AcceleratedNetworkingEnabled"), Value: lo.ToPtr("True")}, - {Name: lo.ToPtr("RdmaEnabled"), Value: lo.ToPtr("False")}, - {Name: lo.ToPtr("MaxNetworkInterfaces"), Value: lo.ToPtr("2")}, - }, - Locations: &[]string{""}, - LocationInfo: &[]compute.ResourceSkuLocationInfo{{Location: lo.ToPtr(""), Zones: &[]string{ - "3", - }, - }, - }, - }, -} diff --git a/pkg/operator/operator.go b/pkg/operator/operator.go index bc39fb5a..b3227d1a 100644 --- a/pkg/operator/operator.go +++ b/pkg/operator/operator.go @@ -20,25 +20,16 @@ import ( "fmt" "os" - "github.com/aws/karpenter-core/pkg/operator" "github.com/azure/gpu-provisioner/pkg/auth" - azurecache "github.com/azure/gpu-provisioner/pkg/cache" "github.com/azure/gpu-provisioner/pkg/providers/instance" - "github.com/azure/gpu-provisioner/pkg/providers/instancetype" - "github.com/azure/gpu-provisioner/pkg/providers/pricing" - "github.com/patrickmn/go-cache" "knative.dev/pkg/logging" + "sigs.k8s.io/karpenter/pkg/operator" ) // Operator is injected into the AWS CloudProvider's factories type Operator struct { *operator.Operator - - UnavailableOfferingsCache *azurecache.UnavailableOfferings - - PricingProvider *pricing.Provider - InstanceTypesProvider *instancetype.Provider - InstanceProvider *instance.Provider + InstanceProvider *instance.Provider } func NewOperator(ctx context.Context, operator *operator.Operator) (context.Context, *Operator) { @@ -55,37 +46,17 @@ func NewOperator(ctx context.Context, operator *operator.Operator) (context.Cont panic(fmt.Sprintf("Configure azure client fails. Please ensure federatedcredential has been created for identity %s.", os.Getenv("AZURE_CLIENT_ID"))) } - unavailableOfferingsCache := azurecache.NewUnavailableOfferings() - pricingProvider := pricing.NewProvider( - ctx, - pricing.NewAPI(), - azConfig.Location, - operator.Elected(), - ) - - instanceTypeProvider := instancetype.NewProvider( - azConfig.Location, - cache.New(instancetype.InstanceTypesCacheTTL, azurecache.DefaultCleanupInterval), - azClient.SKUClient, - pricingProvider, - unavailableOfferingsCache, - ) instanceProvider := instance.NewProvider( azClient, operator.GetClient(), - instanceTypeProvider, - unavailableOfferingsCache, azConfig.ResourceGroup, azConfig.NodeResourceGroup, azConfig.ClusterName, ) return ctx, &Operator{ - Operator: operator, - UnavailableOfferingsCache: unavailableOfferingsCache, - PricingProvider: pricingProvider, - InstanceTypesProvider: instanceTypeProvider, - InstanceProvider: instanceProvider, + Operator: operator, + InstanceProvider: instanceProvider, } } diff --git a/pkg/providers/instance/armutils.go b/pkg/providers/instance/armutils.go index 756c570d..a5c40dad 100644 --- a/pkg/providers/instance/armutils.go +++ b/pkg/providers/instance/armutils.go @@ -37,7 +37,7 @@ func createAgentPool(ctx context.Context, client AgentPoolsAPI, rg, apName, clus return &res.AgentPool, nil } -func deleteAgentPool(ctx context.Context, client AgentPoolsAPI, rg, apName, clusterName string) error { +func deleteAgentPool(ctx context.Context, client AgentPoolsAPI, rg, clusterName, apName string) error { klog.InfoS("deleteAgentPool", "agentpool", apName) poller, err := client.BeginDelete(ctx, rg, clusterName, apName, nil) if err != nil { @@ -57,7 +57,7 @@ func deleteAgentPool(ctx context.Context, client AgentPoolsAPI, rg, apName, clus return err } -func getAgentPool(ctx context.Context, client AgentPoolsAPI, rg, apName, clusterName string) (*armcontainerservice.AgentPool, error) { +func getAgentPool(ctx context.Context, client AgentPoolsAPI, rg, clusterName, apName string) (*armcontainerservice.AgentPool, error) { resp, err := client.Get(ctx, rg, clusterName, apName, nil) if err != nil { return nil, err diff --git a/pkg/providers/instance/azure_client.go b/pkg/providers/instance/azure_client.go index 5e9b5a74..c2c3d17d 100644 --- a/pkg/providers/instance/azure_client.go +++ b/pkg/providers/instance/azure_client.go @@ -23,19 +23,13 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4" - "github.com/azure/gpu-provisioner/pkg/utils" - "github.com/google/uuid" - - // nolint SA1019 - deprecated package - "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute" - "github.com/Azure/skewer" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4" "github.com/Azure/go-autorest/autorest/azure" "github.com/azure/gpu-provisioner/pkg/auth" + "github.com/azure/gpu-provisioner/pkg/utils" armopts "github.com/azure/gpu-provisioner/pkg/utils/opts" + "github.com/google/uuid" "k8s.io/klog/v2" ) @@ -52,17 +46,13 @@ type AgentPoolsAPI interface { type AZClient struct { agentPoolsClient AgentPoolsAPI - // SKU CLIENT is still using track 1 because skewer does not support the track 2 path. We need to refactor this once skewer supports track 2 - SKUClient skewer.ResourceClient } func NewAZClientFromAPI( agentPoolsClient AgentPoolsAPI, - skuClient skewer.ResourceClient, ) *AZClient { return &AZClient{ agentPoolsClient: agentPoolsClient, - SKUClient: skuClient, } } @@ -99,30 +89,14 @@ func NewAZClient(cfg *auth.Config, env *azure.Environment) (*AZClient, error) { opts = setArmClientOptions() } - if err != nil { - klog.Errorf("Failed to get E2E testing cert: %v", err) - } - agentPoolClient, err := armcontainerservice.NewAgentPoolsClient(cfg.SubscriptionID, cred, opts) if err != nil { return nil, err } klog.V(5).Infof("Created agent pool client %v using token credential", agentPoolClient) - interfacesClient, err := armnetwork.NewInterfacesClient(cfg.SubscriptionID, cred, opts) - if err != nil { - return nil, err - } - klog.V(5).Infof("Created network interface client %v using token credential", interfacesClient) - - // TODO: this one is not enabled for rate limiting / throttling ... - // TODO Move this over to track 2 when skewer is migrated - skuClient := compute.NewResourceSkusClient(cfg.SubscriptionID) - skuClient.Authorizer = azClientConfig.Authorizer - klog.V(5).Infof("Created sku client with authorizer: %v", skuClient) return &AZClient{ agentPoolsClient: agentPoolClient, - SKUClient: skuClient, }, nil } diff --git a/pkg/providers/instance/instance.go b/pkg/providers/instance/instance.go index 00114565..c9dc4ebd 100644 --- a/pkg/providers/instance/instance.go +++ b/pkg/providers/instance/instance.go @@ -21,29 +21,27 @@ import ( "strings" "time" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4" - "k8s.io/apimachinery/pkg/api/resource" - "k8s.io/apimachinery/pkg/util/wait" - "k8s.io/klog/v2" - "github.com/azure/gpu-provisioner/pkg/utils" "github.com/samber/lo" v1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/resource" + "k8s.io/apimachinery/pkg/util/wait" "k8s.io/client-go/util/retry" - "sigs.k8s.io/controller-runtime/pkg/client" - + "k8s.io/klog/v2" "knative.dev/pkg/logging" - - "github.com/aws/karpenter-core/pkg/apis/v1alpha5" - "github.com/aws/karpenter-core/pkg/scheduling" - "github.com/azure/gpu-provisioner/pkg/cache" - "github.com/azure/gpu-provisioner/pkg/providers/instancetype" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "sigs.k8s.io/controller-runtime/pkg/client" + karpenterv1 "sigs.k8s.io/karpenter/pkg/apis/v1" + "sigs.k8s.io/karpenter/pkg/cloudprovider" + "sigs.k8s.io/karpenter/pkg/scheduling" ) const ( - LabelMachineType = "kaito.sh/machine-type" + LabelMachineType = "kaito.sh/machine-type" + NodeClaimCreationLabel = "kaito.sh/creation-timestamp" + // use self-defined layout in order to satisfy node label syntax + CreationTimestampLayout = "2006-01-02T15-04-05Z" ) var ( @@ -51,69 +49,76 @@ var ( ) type Provider struct { - azClient *AZClient - kubeClient client.Client - instanceTypeProvider *instancetype.Provider - resourceGroup string - nodeResourceGroup string - clusterName string - unavailableOfferings *cache.UnavailableOfferings + azClient *AZClient + kubeClient client.Client + resourceGroup string + nodeResourceGroup string + clusterName string } func NewProvider( azClient *AZClient, kubeClient client.Client, - instanceTypeProvider *instancetype.Provider, - offeringsCache *cache.UnavailableOfferings, - resourceGroup string, nodeResourceGroup string, clusterName string, ) *Provider { return &Provider{ - azClient: azClient, - kubeClient: kubeClient, - instanceTypeProvider: instanceTypeProvider, - resourceGroup: resourceGroup, - nodeResourceGroup: nodeResourceGroup, - clusterName: clusterName, - unavailableOfferings: offeringsCache, + azClient: azClient, + kubeClient: kubeClient, + resourceGroup: resourceGroup, + nodeResourceGroup: nodeResourceGroup, + clusterName: clusterName, } } // Create an instance given the constraints. // instanceTypes should be sorted by priority for spot capacity type. -func (p *Provider) Create(ctx context.Context, machine *v1alpha5.Machine) (*Instance, error) { - klog.InfoS("Instance.Create", "machine", klog.KObj(machine)) +func (p *Provider) Create(ctx context.Context, nodeClaim *karpenterv1.NodeClaim) (*Instance, error) { + klog.InfoS("Instance.Create", "nodeClaim", klog.KObj(nodeClaim)) - // We made a strong assumption here. The machine name should be a valid agent pool name without "-". - apName := machine.Name + // We made a strong assumption here. The nodeClaim name should be a valid agent pool name without "-". + apName := nodeClaim.Name if len(apName) > 11 { //https://learn.microsoft.com/en-us/troubleshoot/azure/azure-kubernetes/aks-common-issues-faq#what-naming-restrictions-are-enforced-for-aks-resources-and-parameters- - return nil, fmt.Errorf("the length agentpool name should be less than 11, got %d (%s)", len(apName), apName) + return nil, cloudprovider.NewInvalidParameterError(fmt.Errorf("the length agentpool name should be less than 11, got %d (%s)", len(apName), apName)) } var ap *armcontainerservice.AgentPool err := retry.OnError(retry.DefaultBackoff, func(err error) bool { return false }, func() error { - instanceTypes := scheduling.NewNodeSelectorRequirements(machine.Spec.Requirements...).Get("node.kubernetes.io/instance-type").Values() + instanceTypes := scheduling.NewNodeSelectorRequirementsWithMinValues(nodeClaim.Spec.Requirements...).Get("node.kubernetes.io/instance-type").Values() if len(instanceTypes) == 0 { - return fmt.Errorf("machine spec has no requirement for instance type") + return fmt.Errorf("nodeClaim spec has no requirement for instance type") } vmSize := instanceTypes[0] - apObj := newAgentPoolObject(vmSize, machine) + apObj := newAgentPoolObject(vmSize, nodeClaim) logging.FromContext(ctx).Debugf("creating Agent pool %s (%s)", apName, vmSize) var err error ap, err = createAgentPool(ctx, p.azClient.agentPoolsClient, p.resourceGroup, apName, p.clusterName, apObj) if err != nil { - return fmt.Errorf("agentPool.BeginCreateOrUpdate for %q failed: %w", apName, err) + logging.FromContext(ctx).Errorf("failed to create agent pool for nodeclaim(%s), %v", nodeClaim.Name, err) + switch { + case strings.Contains(err.Error(), "Operation is not allowed because there's an in progress create node pool operation"): + // when gpu-provisioner restarted after crash for unknown reason, we may come across this error that agent pool creating + // is in progress, so we just need to wait node ready based on the apObj. + ap = &apObj + return nil + case strings.Contains(err.Error(), "all requested instance types were unavailable during launch") && len(instanceTypes) == 1: + return cloudprovider.NewInsufficientCapacityError(err) + case strings.Contains(err.Error(), "InvalidParameter") && len(instanceTypes) == 1: + return cloudprovider.NewInvalidParameterError(err) + case strings.Contains(err.Error(), "is not allowed in your subscription in location") && len(instanceTypes) == 1: + return cloudprovider.NewLocationRestrictionError(err) + default: + return fmt.Errorf("agentPool.BeginCreateOrUpdate for %q failed: %w", apName, err) + } } logging.FromContext(ctx).Debugf("created agent pool %s", *ap.ID) return nil - }) if err != nil { return nil, err @@ -154,8 +159,11 @@ func (p *Provider) Get(ctx context.Context, id string) (*Instance, error) { if err != nil { return nil, fmt.Errorf("getting agentpool name, %w", err) } - apObj, err := getAgentPool(ctx, p.azClient.agentPoolsClient, p.resourceGroup, apName, p.clusterName) + apObj, err := getAgentPool(ctx, p.azClient.agentPoolsClient, p.resourceGroup, p.clusterName, apName) if err != nil { + if strings.Contains(err.Error(), "Agent Pool not found") { + return nil, cloudprovider.NewNodeClaimNotFoundError(err) + } logging.FromContext(ctx).Errorf("Get agentpool %q failed: %v", apName, err) return nil, fmt.Errorf("agentPool.Get for %s failed: %w", apName, err) } @@ -170,28 +178,14 @@ func (p *Provider) List(ctx context.Context) ([]*Instance, error) { return nil, fmt.Errorf("agentPool.NewListPager failed: %w", err) } - return p.fromAPListToInstances(ctx, apList) + instances, err := p.fromAPListToInstances(ctx, apList) + return instances, cloudprovider.IgnoreNodeClaimNotFoundError(err) } -func (p *Provider) Delete(ctx context.Context, id string) error { - klog.InfoS("Instance.Delete", "id", id) +func (p *Provider) Delete(ctx context.Context, apName string) error { + klog.InfoS("Instance.Delete", "agentpool name", apName) - apName, err := utils.ParseAgentPoolNameFromID(id) - if err != nil { - return fmt.Errorf("getting agentpool name, %w", err) - } - err = deleteAgentPool(ctx, p.azClient.agentPoolsClient, p.resourceGroup, apName, p.clusterName) - if err != nil { - logging.FromContext(ctx).Errorf("Deleting agentpool %q failed: %v", apName, err) - return fmt.Errorf("agentPool.Delete for %q failed: %w", apName, err) - } - return nil -} - -func (p *Provider) DeleteByName(ctx context.Context, apName string) error { - klog.InfoS("Instance.DeleteByName", "agentpool name", apName) - - err := deleteAgentPool(ctx, p.azClient.agentPoolsClient, p.resourceGroup, apName, p.clusterName) + err := deleteAgentPool(ctx, p.azClient.agentPoolsClient, p.resourceGroup, p.clusterName, apName) if err != nil { logging.FromContext(ctx).Errorf("Deleting agentpool %q failed: %v", apName, err) return fmt.Errorf("agentPool.Delete for %q failed: %w", apName, err) @@ -199,7 +193,7 @@ func (p *Provider) DeleteByName(ctx context.Context, apName string) error { return nil } -func (p *Provider) convertAgentPoolToInstance(_ context.Context, apObj *armcontainerservice.AgentPool, id string) (*Instance, error) { +func (p *Provider) convertAgentPoolToInstance(ctx context.Context, apObj *armcontainerservice.AgentPool, id string) (*Instance, error) { if apObj == nil || len(id) == 0 { return nil, fmt.Errorf("agent pool or provider id is nil") } @@ -216,6 +210,7 @@ func (p *Provider) convertAgentPoolToInstance(_ context.Context, apObj *armconta Tags: apObj.Properties.Tags, State: apObj.Properties.ProvisioningState, Labels: instanceLabels, + ImageID: apObj.Properties.NodeImageVersion, }, nil } @@ -299,10 +294,10 @@ func (p *Provider) fromKaitoAgentPoolToInstance(ctx context.Context, apObj *armc } func (p *Provider) fromAPListToInstances(ctx context.Context, apList []*armcontainerservice.AgentPool) ([]*Instance, error) { + instances := []*Instance{} if len(apList) == 0 { - return nil, fmt.Errorf("no agentpools found") + return instances, cloudprovider.NewNodeClaimNotFoundError(fmt.Errorf("agentpools not found")) } - instances := []*Instance{} for index := range apList { // skip agentPool that is not owned by kaito if !agentPoolIsOwnedByKaito(apList[index]) { @@ -311,24 +306,31 @@ func (p *Provider) fromAPListToInstances(ctx context.Context, apList []*armconta instance, err := p.fromKaitoAgentPoolToInstance(ctx, apList[index]) if err != nil { - return nil, err + return instances, err } if instance != nil { instances = append(instances, instance) } } + + if len(instances) == 0 { + return instances, cloudprovider.NewNodeClaimNotFoundError(fmt.Errorf("agentpools not found")) + } + return instances, nil } -func newAgentPoolObject(vmSize string, machine *v1alpha5.Machine) armcontainerservice.AgentPool { - taints := machine.Spec.Taints +func newAgentPoolObject(vmSize string, nodeClaim *karpenterv1.NodeClaim) armcontainerservice.AgentPool { + taints := nodeClaim.Spec.Taints taintsStr := []*string{} for _, t := range taints { taintsStr = append(taintsStr, to.Ptr(fmt.Sprintf("%s=%s:%s", t.Key, t.Value, t.Effect))) } + scaleSetsType := armcontainerservice.AgentPoolTypeVirtualMachineScaleSets - labels := map[string]*string{v1alpha5.ProvisionerNameLabelKey: to.Ptr("default")} - for k, v := range machine.Labels { + // todo: why nodepool label is used here + labels := map[string]*string{karpenterv1.NodePoolLabelKey: to.Ptr("kaito")} + for k, v := range nodeClaim.Labels { labels[k] = to.Ptr(v) } @@ -337,10 +339,13 @@ func newAgentPoolObject(vmSize string, machine *v1alpha5.Machine) armcontainerse } else { labels = lo.Assign(labels, map[string]*string{LabelMachineType: to.Ptr("cpu")}) } + // NodeClaimCreationLabel is used for recording the create timestamp of agentPool resource. + // then used by garbage collection controller to cleanup orphan agentpool which lived more than 10min + labels[NodeClaimCreationLabel] = to.Ptr(nodeClaim.CreationTimestamp.UTC().Format(CreationTimestampLayout)) storage := &resource.Quantity{} - if machine.Spec.Resources.Requests != nil { - storage = machine.Spec.Resources.Requests.Storage() + if nodeClaim.Spec.Resources.Requests != nil { + storage = nodeClaim.Spec.Resources.Requests.Storage() } return armcontainerservice.AgentPool{ diff --git a/pkg/providers/instance/instance_test.go b/pkg/providers/instance/instance_test.go index d8d81c03..6ead5d09 100644 --- a/pkg/providers/instance/instance_test.go +++ b/pkg/providers/instance/instance_test.go @@ -21,47 +21,48 @@ import ( "net/http" "testing" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4" - "github.com/aws/karpenter-core/pkg/apis/v1alpha5" "github.com/azure/gpu-provisioner/pkg/fake" - "github.com/azure/gpu-provisioner/pkg/tests" "github.com/samber/lo" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "go.uber.org/mock/gomock" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/controller-runtime/pkg/client" + karpenterv1 "sigs.k8s.io/karpenter/pkg/apis/v1" ) func TestNewAgentPoolObject(t *testing.T) { testCases := []struct { - name string - vmSize string - machine *v1alpha5.Machine - expected armcontainerservice.AgentPool + name string + vmSize string + nodeClaim *karpenterv1.NodeClaim + expected armcontainerservice.AgentPool }{ { - name: "Machine with Storage requirement", + name: "NodeClaim with Storage requirement", vmSize: "Standard_NC6s_v3", - machine: tests.GetMachineObj("machine-test", map[string]string{"test": "test"}, []v1.Taint{}, v1alpha5.ResourceRequirements{ + nodeClaim: fake.GetNodeClaimObj("nodeclaim-test", map[string]string{"test": "test"}, []v1.Taint{}, karpenterv1.ResourceRequirements{ Requests: v1.ResourceList{ v1.ResourceStorage: lo.FromPtr(resource.NewQuantity(30, resource.DecimalSI)), }, }, []v1.NodeSelectorRequirement{}), - expected: tests.GetAgentPoolObj(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets, + expected: GetAgentPoolObj(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets, armcontainerservice.ScaleSetPriorityRegular, map[string]*string{"test": to.Ptr("test")}, []*string{}, 30, "Standard_NC6s_v3"), }, { - name: "Machine with no Storage requirement", + name: "NodeClaim with no Storage requirement", vmSize: "Standard_NC6s_v3", - machine: tests.GetMachineObj("machine-test", map[string]string{"test": "test"}, []v1.Taint{}, v1alpha5.ResourceRequirements{ + nodeClaim: fake.GetNodeClaimObj("nodeclaim-test", map[string]string{"test": "test"}, []v1.Taint{}, karpenterv1.ResourceRequirements{ Requests: v1.ResourceList{}, }, []v1.NodeSelectorRequirement{}), - expected: tests.GetAgentPoolObj(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets, + expected: GetAgentPoolObj(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets, armcontainerservice.ScaleSetPriorityRegular, map[string]*string{"test": to.Ptr("test")}, []*string{}, 0, "Standard_NC6s_v3"), }, @@ -69,7 +70,7 @@ func TestNewAgentPoolObject(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - result := newAgentPoolObject(tc.vmSize, tc.machine) + result := newAgentPoolObject(tc.vmSize, tc.nodeClaim) assert.Equal(t, tc.expected.Properties.Type, result.Properties.Type) assert.Equal(t, tc.expected.Properties.OSDiskSizeGB, result.Properties.OSDiskSizeGB) }) @@ -88,12 +89,12 @@ func TestGet(t *testing.T) { { name: "Successfully Get instance from agent pool", id: "azure:///subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/nodeRG/providers/Microsoft.Compute/virtualMachineScaleSets/aks-agentpool0-20562481-vmss/virtualMachines/0", - mockAgentPool: tests.GetAgentPoolObjWithName("agentpool0", "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/nodeRG/providers/Microsoft.Compute/virtualMachineScaleSets/aks-agentpool0-20562481-vmss", "Standard_NC6s_v3"), + mockAgentPool: GetAgentPoolObjWithName("agentpool0", "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/nodeRG/providers/Microsoft.Compute/virtualMachineScaleSets/aks-agentpool0-20562481-vmss", "Standard_NC6s_v3"), mockAgentPoolResp: func(ap armcontainerservice.AgentPool) armcontainerservice.AgentPoolsClientGetResponse { return armcontainerservice.AgentPoolsClientGetResponse{AgentPool: ap} }, callK8sMocks: func(c *fake.MockClient) { - nodeList := tests.GetNodeList([]v1.Node{tests.ReadyNode}) + nodeList := GetNodeList([]v1.Node{ReadyNode}) relevantMap := c.CreateMapWithType(nodeList) //insert node objects into the map for _, obj := range nodeList.Items { @@ -162,9 +163,9 @@ func TestFromAgentPoolToInstance(t *testing.T) { }{ { name: "Successfully Get instance from agent pool", - mockAgentPool: tests.GetAgentPoolObjWithName("agentpool0", "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/nodeRG/providers/Microsoft.Compute/virtualMachineScaleSets/aks-agentpool0-20562481-vmss", "Standard_NC6s_v3"), + mockAgentPool: GetAgentPoolObjWithName("agentpool0", "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/nodeRG/providers/Microsoft.Compute/virtualMachineScaleSets/aks-agentpool0-20562481-vmss", "Standard_NC6s_v3"), callK8sMocks: func(c *fake.MockClient) { - nodeList := tests.GetNodeList([]v1.Node{tests.ReadyNode}) + nodeList := GetNodeList([]v1.Node{ReadyNode}) relevantMap := c.CreateMapWithType(nodeList) //insert node objects into the map for _, obj := range nodeList.Items { @@ -179,7 +180,7 @@ func TestFromAgentPoolToInstance(t *testing.T) { }, { name: "Fail to get instance from agent pool because node is nil", - mockAgentPool: tests.GetAgentPoolObjWithName("agentpool0", "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/nodeRG/providers/Microsoft.Compute/virtualMachineScaleSets/aks-agentpool0-20562481-vmss", "Standard_NC6s_v3"), + mockAgentPool: GetAgentPoolObjWithName("agentpool0", "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/nodeRG/providers/Microsoft.Compute/virtualMachineScaleSets/aks-agentpool0-20562481-vmss", "Standard_NC6s_v3"), callK8sMocks: func(c *fake.MockClient) { c.On("List", mock.IsType(context.Background()), mock.IsType(&v1.NodeList{}), mock.Anything).Return(nil) @@ -188,7 +189,7 @@ func TestFromAgentPoolToInstance(t *testing.T) { }, { name: "Fail to get instance from agent pool due to error in retrieving node list", - mockAgentPool: tests.GetAgentPoolObjWithName("agentpool0", "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/nodeRG/providers/Microsoft.Compute/virtualMachineScaleSets/aks-agentpool0-20562481-vmss", "Standard_NC6s_v3"), + mockAgentPool: GetAgentPoolObjWithName("agentpool0", "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/nodeRG/providers/Microsoft.Compute/virtualMachineScaleSets/aks-agentpool0-20562481-vmss", "Standard_NC6s_v3"), callK8sMocks: func(c *fake.MockClient) { c.On("List", mock.IsType(context.Background()), mock.IsType(&v1.NodeList{}), mock.Anything).Return(errors.New("Fail to get node list")) }, @@ -211,7 +212,6 @@ func TestFromAgentPoolToInstance(t *testing.T) { p := createTestProvider(agentPoolMocks, mockK8sClient) instance, err := p.fromRegisteredAgentPoolToInstance(context.Background(), &tc.mockAgentPool) - if tc.expectedError == nil { assert.NoError(t, err, "Not expected to return error") if !tc.isInstanceNil { @@ -232,13 +232,13 @@ func TestFromAgentPoolToInstance(t *testing.T) { func TestDelete(t *testing.T) { testCases := []struct { name string - id string + apName string mockAgentPoolResp func(mockHandler *fake.MockPollingHandler[armcontainerservice.AgentPoolsClientDeleteResponse]) (*runtime.Poller[armcontainerservice.AgentPoolsClientDeleteResponse], error) expectedError error }{ { - name: "Successfully delete instance", - id: "azure:///subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/nodeRG/providers/Microsoft.Compute/virtualMachineScaleSets/aks-agentpool0-20562481-vmss/virtualMachines/0", + name: "Successfully delete instance", + apName: "agentpool0", mockAgentPoolResp: func(mockHandler *fake.MockPollingHandler[armcontainerservice.AgentPoolsClientDeleteResponse]) (*runtime.Poller[armcontainerservice.AgentPoolsClientDeleteResponse], error) { delResp := armcontainerservice.AgentPoolsClientDeleteResponse{} resp := http.Response{Status: "200 OK", StatusCode: http.StatusOK, Body: http.NoBody} @@ -256,14 +256,14 @@ func TestDelete(t *testing.T) { }, }, { - name: "Successfully deletes instance because poller returns a 404 not found error", - id: "azure:///subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/nodeRG/providers/Microsoft.Compute/virtualMachineScaleSets/aks-agentpool0-20562481-vmss/virtualMachines/0", + name: "Successfully deletes instance because poller returns a 404 not found error", + apName: "agentpool0", mockAgentPoolResp: func(mockHandler *fake.MockPollingHandler[armcontainerservice.AgentPoolsClientDeleteResponse]) (*runtime.Poller[armcontainerservice.AgentPoolsClientDeleteResponse], error) { delResp := armcontainerservice.AgentPoolsClientDeleteResponse{} resp := http.Response{StatusCode: http.StatusBadRequest, Body: http.NoBody} mockHandler.EXPECT().Done().Return(false) - mockHandler.EXPECT().Poll(gomock.Any()).Return(&resp, tests.NotFoundAzError()) + mockHandler.EXPECT().Poll(gomock.Any()).Return(&resp, NotFoundAzError()) pollingOptions := &runtime.NewPollerOptions[armcontainerservice.AgentPoolsClientDeleteResponse]{ Handler: mockHandler, @@ -275,8 +275,8 @@ func TestDelete(t *testing.T) { }, }, { - name: "Fail to delete instance because poller returns error", - id: "azure:///subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/nodeRG/providers/Microsoft.Compute/virtualMachineScaleSets/aks-agentpool0-20562481-vmss/virtualMachines/0", + name: "Fail to delete instance because poller returns error", + apName: "agentpool0", mockAgentPoolResp: func(mockHandler *fake.MockPollingHandler[armcontainerservice.AgentPoolsClientDeleteResponse]) (*runtime.Poller[armcontainerservice.AgentPoolsClientDeleteResponse], error) { delResp := armcontainerservice.AgentPoolsClientDeleteResponse{} resp := http.Response{StatusCode: http.StatusBadRequest, Body: http.NoBody} @@ -295,25 +295,20 @@ func TestDelete(t *testing.T) { expectedError: errors.New("Failed to fetch latest status of operation"), }, { - name: "Successfully delete instance because agentPool.Delete returns a NotFound error", - id: "azure:///subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/nodeRG/providers/Microsoft.Compute/virtualMachineScaleSets/aks-agentpool0-20562481-vmss/virtualMachines/0", + name: "Successfully delete instance because agentPool.Delete returns a NotFound error", + apName: "agentpool0", mockAgentPoolResp: func(mockHandler *fake.MockPollingHandler[armcontainerservice.AgentPoolsClientDeleteResponse]) (*runtime.Poller[armcontainerservice.AgentPoolsClientDeleteResponse], error) { - return nil, tests.NotFoundAzError() + return nil, NotFoundAzError() }, }, { - name: "Fail to delete instance because agentPool.Delete returns a failure", - id: "azure:///subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/nodeRG/providers/Microsoft.Compute/virtualMachineScaleSets/aks-agentpool0-20562481-vmss/virtualMachines/0", + name: "Fail to delete instance because agentPool.Delete returns a failure", + apName: "agentpool0", mockAgentPoolResp: func(mockHandler *fake.MockPollingHandler[armcontainerservice.AgentPoolsClientDeleteResponse]) (*runtime.Poller[armcontainerservice.AgentPoolsClientDeleteResponse], error) { return nil, errors.New("Failed to delete agent pool") }, expectedError: errors.New("Failed to delete agent pool"), }, - { - name: "Fail to delete instance because agent pool ID cannot be parsed properly", - id: "azure:///subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/nodeRG/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachines/0", - expectedError: errors.New("getting agentpool name, id does not match the regxp for ParseAgentPoolNameFromID"), - }, } for _, tc := range testCases { @@ -332,7 +327,7 @@ func TestDelete(t *testing.T) { mockK8sClient := fake.NewClient() p := createTestProvider(agentPoolMocks, mockK8sClient) - err := p.Delete(context.Background(), tc.id) + err := p.Delete(context.Background(), tc.apName) if tc.expectedError == nil { assert.NoError(t, err, "Not expected to return error") @@ -354,8 +349,8 @@ func TestList(t *testing.T) { { name: "Successfully list instances", mockAgentPoolList: func() []*armcontainerservice.AgentPool { - ap := tests.GetAgentPoolObjWithName("agentpool0", "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/nodeRG/providers/Microsoft.Compute/virtualMachineScaleSets/aks-agentpool0-20562481-vmss", "Standard_NC6s_v3") - ap1 := tests.GetAgentPoolObjWithName("agentpool1", "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/nodeRG/providers/Microsoft.Compute/virtualMachineScaleSets/aks-agentpool0-20562481-vmss", "Standard_NC6s_v3") + ap := GetAgentPoolObjWithName("agentpool0", "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/nodeRG/providers/Microsoft.Compute/virtualMachineScaleSets/aks-agentpool0-20562481-vmss", "Standard_NC6s_v3") + ap1 := GetAgentPoolObjWithName("agentpool1", "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/nodeRG/providers/Microsoft.Compute/virtualMachineScaleSets/aks-agentpool0-20562481-vmss", "Standard_NC6s_v3") return []*armcontainerservice.AgentPool{ &ap, &ap1, @@ -376,7 +371,7 @@ func TestList(t *testing.T) { }) }, callK8sMocks: func(c *fake.MockClient) { - nodeList := tests.GetNodeList([]v1.Node{tests.ReadyNode}) + nodeList := GetNodeList([]v1.Node{ReadyNode}) relevantMap := c.CreateMapWithType(nodeList) //insert node objects into the map for _, obj := range nodeList.Items { @@ -457,7 +452,7 @@ func TestFromAPListToInstanceFailure(t *testing.T) { return []*armcontainerservice.AgentPool{} }, expectedError: func(err string) error { - return errors.New("no agentpools found") + return errors.New("nodeclaim not found, agentpools not found") }, }, } @@ -475,7 +470,7 @@ func TestFromAPListToInstanceFailure(t *testing.T) { instanceList, err := p.fromAPListToInstances(context.Background(), tc.mockAgentPoolList(tc.id)) assert.EqualError(t, err, tc.expectedError(tc.id).Error()) - assert.Nil(t, instanceList, "Response instance list should be nil") + assert.Empty(t, instanceList, "Response instance list should be empty") }) } } @@ -483,21 +478,21 @@ func TestFromAPListToInstanceFailure(t *testing.T) { func TestCreateSuccess(t *testing.T) { testCases := []struct { name string - machine *v1alpha5.Machine - mockAgentPoolResp func(machine *v1alpha5.Machine, mockHandler *fake.MockPollingHandler[armcontainerservice.AgentPoolsClientCreateOrUpdateResponse]) (*runtime.Poller[armcontainerservice.AgentPoolsClientCreateOrUpdateResponse], error) + nodeClaim *karpenterv1.NodeClaim + mockAgentPoolResp func(nodeClaim *karpenterv1.NodeClaim, mockHandler *fake.MockPollingHandler[armcontainerservice.AgentPoolsClientCreateOrUpdateResponse]) (*runtime.Poller[armcontainerservice.AgentPoolsClientCreateOrUpdateResponse], error) callK8sMocks func(c *fake.MockClient) }{ { name: "Successfully create instance", - machine: tests.GetMachineObj("agentpool0", map[string]string{"test": "test"}, []v1.Taint{}, v1alpha5.ResourceRequirements{}, []v1.NodeSelectorRequirement{ + nodeClaim: fake.GetNodeClaimObj("agentpool0", map[string]string{"test": "test"}, []v1.Taint{}, karpenterv1.ResourceRequirements{}, []v1.NodeSelectorRequirement{ { Key: "node.kubernetes.io/instance-type", Operator: "In", Values: []string{"Standard_NC6s_v3"}, }, }), - mockAgentPoolResp: func(machine *v1alpha5.Machine, mockHandler *fake.MockPollingHandler[armcontainerservice.AgentPoolsClientCreateOrUpdateResponse]) (*runtime.Poller[armcontainerservice.AgentPoolsClientCreateOrUpdateResponse], error) { - ap := tests.GetAgentPoolObjWithName(machine.Name, "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/nodeRG/providers/Microsoft.Compute/virtualMachineScaleSets/aks-agentpool0-20562481-vmss", machine.Spec.Requirements[0].Values[0]) + mockAgentPoolResp: func(nodeClaim *karpenterv1.NodeClaim, mockHandler *fake.MockPollingHandler[armcontainerservice.AgentPoolsClientCreateOrUpdateResponse]) (*runtime.Poller[armcontainerservice.AgentPoolsClientCreateOrUpdateResponse], error) { + ap := GetAgentPoolObjWithName(nodeClaim.Name, "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/nodeRG/providers/Microsoft.Compute/virtualMachineScaleSets/aks-agentpool0-20562481-vmss", nodeClaim.Spec.Requirements[0].Values[0]) createResp := armcontainerservice.AgentPoolsClientCreateOrUpdateResponse{ AgentPool: ap, @@ -516,7 +511,7 @@ func TestCreateSuccess(t *testing.T) { return p, err }, callK8sMocks: func(c *fake.MockClient) { - nodeList := tests.GetNodeList([]v1.Node{tests.ReadyNode}) + nodeList := GetNodeList([]v1.Node{ReadyNode}) relevantMap := c.CreateMapWithType(nodeList) //insert node objects into the map for _, obj := range nodeList.Items { @@ -531,15 +526,15 @@ func TestCreateSuccess(t *testing.T) { }, { name: "Successfully create instance after waiting for node to be ready", - machine: tests.GetMachineObj("agentpool0", map[string]string{"test": "test"}, []v1.Taint{}, v1alpha5.ResourceRequirements{}, []v1.NodeSelectorRequirement{ + nodeClaim: fake.GetNodeClaimObj("agentpool0", map[string]string{"test": "test"}, []v1.Taint{}, karpenterv1.ResourceRequirements{}, []v1.NodeSelectorRequirement{ { Key: "node.kubernetes.io/instance-type", Operator: "In", Values: []string{"Standard_NC6s_v3"}, }, }), - mockAgentPoolResp: func(machine *v1alpha5.Machine, mockHandler *fake.MockPollingHandler[armcontainerservice.AgentPoolsClientCreateOrUpdateResponse]) (*runtime.Poller[armcontainerservice.AgentPoolsClientCreateOrUpdateResponse], error) { - ap := tests.GetAgentPoolObjWithName(machine.Name, "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/nodeRG/providers/Microsoft.Compute/virtualMachineScaleSets/aks-agentpool0-20562481-vmss", machine.Spec.Requirements[0].Values[0]) + mockAgentPoolResp: func(nodeClaim *karpenterv1.NodeClaim, mockHandler *fake.MockPollingHandler[armcontainerservice.AgentPoolsClientCreateOrUpdateResponse]) (*runtime.Poller[armcontainerservice.AgentPoolsClientCreateOrUpdateResponse], error) { + ap := GetAgentPoolObjWithName(nodeClaim.Name, "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/nodeRG/providers/Microsoft.Compute/virtualMachineScaleSets/aks-agentpool0-20562481-vmss", nodeClaim.Spec.Requirements[0].Values[0]) createResp := armcontainerservice.AgentPoolsClientCreateOrUpdateResponse{ AgentPool: ap, @@ -559,7 +554,7 @@ func TestCreateSuccess(t *testing.T) { }, callK8sMocks: func(c *fake.MockClient) { c.On("List", mock.IsType(context.Background()), mock.IsType(&v1.NodeList{}), mock.Anything).Return(nil).Once().Run(func(args mock.Arguments) { - nodeList := tests.GetNodeList([]v1.Node{tests.ReadyNode}) + nodeList := GetNodeList([]v1.Node{ReadyNode}) relevantMap := c.CreateMapWithType(nodeList) //insert node objects into the map for _, obj := range nodeList.Items { @@ -584,8 +579,8 @@ func TestCreateSuccess(t *testing.T) { if tc.mockAgentPoolResp != nil { mockHandler := fake.NewMockPollingHandler[armcontainerservice.AgentPoolsClientCreateOrUpdateResponse](mockCtrl) - p, err := tc.mockAgentPoolResp(tc.machine, mockHandler) - agentPoolMocks.EXPECT().BeginCreateOrUpdate(gomock.Any(), gomock.Any(), gomock.Any(), tc.machine.Name, gomock.Any(), gomock.Any()).Return(p, err) + p, err := tc.mockAgentPoolResp(tc.nodeClaim, mockHandler) + agentPoolMocks.EXPECT().BeginCreateOrUpdate(gomock.Any(), gomock.Any(), gomock.Any(), tc.nodeClaim.Name, gomock.Any(), gomock.Any()).Return(p, err) } mockK8sClient := fake.NewClient() @@ -595,12 +590,12 @@ func TestCreateSuccess(t *testing.T) { p := createTestProvider(agentPoolMocks, mockK8sClient) - instance, err := p.Create(context.Background(), tc.machine) + instance, err := p.Create(context.Background(), tc.nodeClaim) assert.NoError(t, err, "Not expected to return error") assert.NotNil(t, instance, "Response instance should not be nil") - assert.Equal(t, &tc.machine.Name, instance.Name, "Instance name should be same as machine name") - assert.Equal(t, &tc.machine.Spec.Requirements[0].Values[0], instance.Type, "Instance type should be same as machine's instance type") + assert.Equal(t, &tc.nodeClaim.Name, instance.Name, "Instance name should be same as nodeclaim name") + assert.Equal(t, &tc.nodeClaim.Spec.Requirements[0].Values[0], instance.Type, "Instance type should be same as nodeclaim's instance type") }) } } @@ -608,22 +603,22 @@ func TestCreateSuccess(t *testing.T) { func TestCreateFailure(t *testing.T) { testCases := []struct { name string - machine *v1alpha5.Machine - mockAgentPoolResp func(machine *v1alpha5.Machine, mockHandler *fake.MockPollingHandler[armcontainerservice.AgentPoolsClientCreateOrUpdateResponse]) (*runtime.Poller[armcontainerservice.AgentPoolsClientCreateOrUpdateResponse], error) + nodeClaim *karpenterv1.NodeClaim + mockAgentPoolResp func(nodeClaim *karpenterv1.NodeClaim, mockHandler *fake.MockPollingHandler[armcontainerservice.AgentPoolsClientCreateOrUpdateResponse]) (*runtime.Poller[armcontainerservice.AgentPoolsClientCreateOrUpdateResponse], error) callK8sMocks func(c *fake.MockClient) expectedError error }{ { name: "Fail to create instance because node is not found and returns error on retry", - machine: tests.GetMachineObj("agentpool0", map[string]string{"test": "test"}, []v1.Taint{}, v1alpha5.ResourceRequirements{}, []v1.NodeSelectorRequirement{ + nodeClaim: fake.GetNodeClaimObj("agentpool0", map[string]string{"test": "test"}, []v1.Taint{}, karpenterv1.ResourceRequirements{}, []v1.NodeSelectorRequirement{ { Key: "node.kubernetes.io/instance-type", Operator: "In", Values: []string{"Standard_NC6s_v3"}, }, }), - mockAgentPoolResp: func(machine *v1alpha5.Machine, mockHandler *fake.MockPollingHandler[armcontainerservice.AgentPoolsClientCreateOrUpdateResponse]) (*runtime.Poller[armcontainerservice.AgentPoolsClientCreateOrUpdateResponse], error) { - ap := tests.GetAgentPoolObjWithName(machine.Name, "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/nodeRG/providers/Microsoft.Compute/virtualMachineScaleSets/aks-agentpool0-20562481-vmss", machine.Spec.Requirements[0].Values[0]) + mockAgentPoolResp: func(nodeClaim *karpenterv1.NodeClaim, mockHandler *fake.MockPollingHandler[armcontainerservice.AgentPoolsClientCreateOrUpdateResponse]) (*runtime.Poller[armcontainerservice.AgentPoolsClientCreateOrUpdateResponse], error) { + ap := GetAgentPoolObjWithName(nodeClaim.Name, "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/nodeRG/providers/Microsoft.Compute/virtualMachineScaleSets/aks-agentpool0-20562481-vmss", nodeClaim.Spec.Requirements[0].Values[0]) createResp := armcontainerservice.AgentPoolsClientCreateOrUpdateResponse{ AgentPool: ap, @@ -650,15 +645,15 @@ func TestCreateFailure(t *testing.T) { }, { name: "Fail to create instance because node object is not found", - machine: tests.GetMachineObj("agentpool0", map[string]string{"test": "test"}, []v1.Taint{}, v1alpha5.ResourceRequirements{}, []v1.NodeSelectorRequirement{ + nodeClaim: fake.GetNodeClaimObj("agentpool0", map[string]string{"test": "test"}, []v1.Taint{}, karpenterv1.ResourceRequirements{}, []v1.NodeSelectorRequirement{ { Key: "node.kubernetes.io/instance-type", Operator: "In", Values: []string{"Standard_NC6s_v3"}, }, }), - mockAgentPoolResp: func(machine *v1alpha5.Machine, mockHandler *fake.MockPollingHandler[armcontainerservice.AgentPoolsClientCreateOrUpdateResponse]) (*runtime.Poller[armcontainerservice.AgentPoolsClientCreateOrUpdateResponse], error) { - ap := tests.GetAgentPoolObjWithName(machine.Name, "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/nodeRG/providers/Microsoft.Compute/virtualMachineScaleSets/aks-agentpool0-20562481-vmss", machine.Spec.Requirements[0].Values[0]) + mockAgentPoolResp: func(nodeClaim *karpenterv1.NodeClaim, mockHandler *fake.MockPollingHandler[armcontainerservice.AgentPoolsClientCreateOrUpdateResponse]) (*runtime.Poller[armcontainerservice.AgentPoolsClientCreateOrUpdateResponse], error) { + ap := GetAgentPoolObjWithName(nodeClaim.Name, "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/nodeRG/providers/Microsoft.Compute/virtualMachineScaleSets/aks-agentpool0-20562481-vmss", nodeClaim.Spec.Requirements[0].Values[0]) createResp := armcontainerservice.AgentPoolsClientCreateOrUpdateResponse{ AgentPool: ap, @@ -683,14 +678,14 @@ func TestCreateFailure(t *testing.T) { }, { name: "Fail to delete instance because poller returns error", - machine: tests.GetMachineObj("agentpool0", map[string]string{"test": "test"}, []v1.Taint{}, v1alpha5.ResourceRequirements{}, []v1.NodeSelectorRequirement{ + nodeClaim: fake.GetNodeClaimObj("agentpool0", map[string]string{"test": "test"}, []v1.Taint{}, karpenterv1.ResourceRequirements{}, []v1.NodeSelectorRequirement{ { Key: "node.kubernetes.io/instance-type", Operator: "In", Values: []string{"Standard_NC6s_v3"}, }, }), - mockAgentPoolResp: func(machine *v1alpha5.Machine, mockHandler *fake.MockPollingHandler[armcontainerservice.AgentPoolsClientCreateOrUpdateResponse]) (*runtime.Poller[armcontainerservice.AgentPoolsClientCreateOrUpdateResponse], error) { + mockAgentPoolResp: func(nodeClaim *karpenterv1.NodeClaim, mockHandler *fake.MockPollingHandler[armcontainerservice.AgentPoolsClientCreateOrUpdateResponse]) (*runtime.Poller[armcontainerservice.AgentPoolsClientCreateOrUpdateResponse], error) { createResp := armcontainerservice.AgentPoolsClientCreateOrUpdateResponse{ AgentPool: armcontainerservice.AgentPool{}, } @@ -711,26 +706,26 @@ func TestCreateFailure(t *testing.T) { }, { name: "Fail to create instance because agentPool.CreateOrUpdate returns a failure", - machine: tests.GetMachineObj("agentpool0", map[string]string{"test": "test"}, []v1.Taint{}, v1alpha5.ResourceRequirements{}, []v1.NodeSelectorRequirement{ + nodeClaim: fake.GetNodeClaimObj("agentpool0", map[string]string{"test": "test"}, []v1.Taint{}, karpenterv1.ResourceRequirements{}, []v1.NodeSelectorRequirement{ { Key: "node.kubernetes.io/instance-type", Operator: "In", Values: []string{"Standard_D4s_v4"}, }, }), - mockAgentPoolResp: func(machine *v1alpha5.Machine, mockHandler *fake.MockPollingHandler[armcontainerservice.AgentPoolsClientCreateOrUpdateResponse]) (*runtime.Poller[armcontainerservice.AgentPoolsClientCreateOrUpdateResponse], error) { + mockAgentPoolResp: func(nodeClaim *karpenterv1.NodeClaim, mockHandler *fake.MockPollingHandler[armcontainerservice.AgentPoolsClientCreateOrUpdateResponse]) (*runtime.Poller[armcontainerservice.AgentPoolsClientCreateOrUpdateResponse], error) { return nil, errors.New("Failed to create agent pool") }, expectedError: errors.New("Failed to create agent pool"), }, { - name: "Fail to create instance because machine spec does not have requirement for instance type", - machine: tests.GetMachineObj("agentpool0", map[string]string{"test": "test"}, []v1.Taint{}, v1alpha5.ResourceRequirements{}, []v1.NodeSelectorRequirement{}), - expectedError: errors.New("machine spec has no requirement for instance type"), + name: "Fail to create instance because nodeClaim spec does not have requirement for instance type", + nodeClaim: fake.GetNodeClaimObj("agentpool0", map[string]string{"test": "test"}, []v1.Taint{}, karpenterv1.ResourceRequirements{}, []v1.NodeSelectorRequirement{}), + expectedError: errors.New("nodeClaim spec has no requirement for instance type"), }, { - name: "Fail to create instance because of invalid machine name", - machine: tests.GetMachineObj("invalid-machine-name", map[string]string{"test": "test"}, []v1.Taint{}, v1alpha5.ResourceRequirements{}, []v1.NodeSelectorRequirement{}), + name: "Fail to create instance because of invalid nodeClaim name", + nodeClaim: fake.GetNodeClaimObj("invalid-nodeclaim-name", map[string]string{"test": "test"}, []v1.Taint{}, karpenterv1.ResourceRequirements{}, []v1.NodeSelectorRequirement{}), expectedError: errors.New("the length agentpool name should be less than 11"), }, @@ -745,8 +740,8 @@ func TestCreateFailure(t *testing.T) { if tc.mockAgentPoolResp != nil { mockHandler := fake.NewMockPollingHandler[armcontainerservice.AgentPoolsClientCreateOrUpdateResponse](mockCtrl) - p, err := tc.mockAgentPoolResp(tc.machine, mockHandler) - agentPoolMocks.EXPECT().BeginCreateOrUpdate(gomock.Any(), gomock.Any(), gomock.Any(), tc.machine.Name, gomock.Any(), gomock.Any()).Return(p, err) + p, err := tc.mockAgentPoolResp(tc.nodeClaim, mockHandler) + agentPoolMocks.EXPECT().BeginCreateOrUpdate(gomock.Any(), gomock.Any(), gomock.Any(), tc.nodeClaim.Name, gomock.Any(), gomock.Any()).Return(p, err) } mockK8sClient := fake.NewClient() @@ -756,7 +751,7 @@ func TestCreateFailure(t *testing.T) { p := createTestProvider(agentPoolMocks, mockK8sClient) - instance, err := p.Create(context.Background(), tc.machine) + instance, err := p.Create(context.Background(), tc.nodeClaim) assert.Contains(t, err.Error(), tc.expectedError.Error()) assert.Nil(t, instance, "Response instance should be nil") @@ -765,6 +760,68 @@ func TestCreateFailure(t *testing.T) { } func createTestProvider(agentPoolsAPIMocks *fake.MockAgentPoolsAPI, mockK8sClient *fake.MockClient) *Provider { - mockAzClient := NewAZClientFromAPI(agentPoolsAPIMocks, nil) - return NewProvider(mockAzClient, mockK8sClient, nil, nil, "testRG", "nodeRG", "testCluster") + mockAzClient := NewAZClientFromAPI(agentPoolsAPIMocks) + return NewProvider(mockAzClient, mockK8sClient, "testRG", "nodeRG", "testCluster") +} + +func GetAgentPoolObj(apType armcontainerservice.AgentPoolType, capacityType armcontainerservice.ScaleSetPriority, + labels map[string]*string, taints []*string, storage int32, vmSize string) armcontainerservice.AgentPool { + return armcontainerservice.AgentPool{ + Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{ + NodeLabels: labels, + NodeTaints: taints, + Type: to.Ptr(apType), + VMSize: to.Ptr(vmSize), + OSType: to.Ptr(armcontainerservice.OSTypeLinux), + Count: to.Ptr(int32(1)), + ScaleSetPriority: to.Ptr(capacityType), + OSDiskSizeGB: to.Ptr(storage), + }, + } +} + +func GetAgentPoolObjWithName(apName string, apId string, vmSize string) armcontainerservice.AgentPool { + return armcontainerservice.AgentPool{ + Name: &apName, + ID: &apId, + Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{ + VMSize: &vmSize, + NodeLabels: map[string]*string{ + "test": to.Ptr("test"), + "kaito.sh/workspace": to.Ptr("none"), + }, + }, + } +} +func GetNodeList(nodes []v1.Node) *v1.NodeList { + return &v1.NodeList{ + Items: nodes, + } +} + +var ( + ReadyNode = v1.Node{ + ObjectMeta: metav1.ObjectMeta{ + Name: "aks-agentpool0-20562481-vmss_0", + Labels: map[string]string{ + "agentpool": "agentpool0", + "kubernetes.azure.com/agentpool": "agentpool0", + }, + }, + Spec: v1.NodeSpec{ + ProviderID: "azure:///subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/nodeRG/providers/Microsoft.Compute/virtualMachineScaleSets/aks-agentpool0-20562481-vmss/virtualMachines/0", + }, + Status: v1.NodeStatus{ + Conditions: []v1.NodeCondition{ + { + Type: v1.NodeReady, + Status: v1.ConditionTrue, + }, + }, + }, + } +) + +func NotFoundAzError() *azcore.ResponseError { + return &azcore.ResponseError{ErrorCode: "NotFound"} } diff --git a/pkg/providers/instancetype/instancetype.go b/pkg/providers/instancetype/instancetype.go deleted file mode 100644 index 23d68b7b..00000000 --- a/pkg/providers/instancetype/instancetype.go +++ /dev/null @@ -1,377 +0,0 @@ -/* - Copyright (c) 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. -*/ - -package instancetype - -import ( - "context" - "fmt" - "math" - "strconv" - "strings" - - "github.com/Azure/skewer" - "github.com/azure/gpu-provisioner/pkg/utils" - "github.com/samber/lo" - v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/resource" - "knative.dev/pkg/logging" - "knative.dev/pkg/ptr" - - "github.com/aws/karpenter-core/pkg/apis/v1alpha5" - "github.com/aws/karpenter-core/pkg/cloudprovider" - "github.com/aws/karpenter-core/pkg/scheduling" - - "github.com/azure/gpu-provisioner/pkg/apis/v1alpha1" - - "github.com/aws/karpenter-core/pkg/utils/resources" -) - -const ( - memoryAvailable = "memory.available" -) - -func NewInstanceType(ctx context.Context, sku *skewer.SKU, kc *v1alpha5.KubeletConfiguration, region string, - offerings cloudprovider.Offerings) *cloudprovider.InstanceType { - return &cloudprovider.InstanceType{ - Name: sku.GetName(), - Requirements: computeRequirements(ctx, sku, offerings, region), - Offerings: offerings, - Capacity: computeCapacity(sku, kc), - Overhead: &cloudprovider.InstanceTypeOverhead{ - KubeReserved: kubeReservedResources(cpu(sku), pods(sku, kc), kc), - SystemReserved: systemReservedResources(kc), - EvictionThreshold: evictionThreshold(memory(sku), kc), - }, - } -} - -// TODO: remove nolint on gocyclo. Added for now in order to pass "make verify" in azure/poc -// nolint: gocyclo -func computeRequirements(ctx context.Context, sku *skewer.SKU, offerings cloudprovider.Offerings, region string) scheduling.Requirements { - // TODO: Switch the AvailableOfferings call back to the cloudprovider.AvailableOfferings call - requirements := scheduling.NewRequirements( - // Well Known Upstream - // TODO: should this include tier (e.g. Standard) or not? Name does ... - scheduling.NewRequirement(v1.LabelInstanceTypeStable, v1.NodeSelectorOpIn, sku.GetName()), - scheduling.NewRequirement(v1.LabelArchStable, v1.NodeSelectorOpIn, getArchitecture(sku)), - scheduling.NewRequirement(v1.LabelOSStable, v1.NodeSelectorOpIn, string(v1.Linux)), - scheduling.NewRequirement(v1.LabelTopologyRegion, v1.NodeSelectorOpIn, region), - - // Well Known to Karpenter - scheduling.NewRequirement( - v1alpha5.LabelCapacityType, - v1.NodeSelectorOpIn, - lo.Map(offerings.Available(), func(o cloudprovider.Offering, _ int) string { return o.CapacityType })...), - - // Well Known to Azure - scheduling.NewRequirement(v1alpha1.LabelSKUCPU, v1.NodeSelectorOpIn, fmt.Sprint(cpu(sku).Value())), - scheduling.NewRequirement(v1alpha1.LabelSKUMemory, v1.NodeSelectorOpIn, fmt.Sprint(memory(sku).ScaledValue(resource.Mega))), - scheduling.NewRequirement(v1alpha1.LabelSKUGPUCount, v1.NodeSelectorOpIn, fmt.Sprint(gpuNvidiaCount(sku).Value())), - scheduling.NewRequirement(v1alpha1.LabelSKUGPUManufacturer, v1.NodeSelectorOpDoesNotExist), - scheduling.NewRequirement(v1alpha1.LabelSKUGPUName, v1.NodeSelectorOpDoesNotExist), - - scheduling.NewRequirement(v1alpha1.LabelSKUTier, v1.NodeSelectorOpDoesNotExist), - //scheduling.NewRequirement(LabelSKUSizeGen, v1.NodeSelectorOpDoesNotExist), - - // composites - scheduling.NewRequirement(v1alpha1.LabelSKUName, v1.NodeSelectorOpDoesNotExist), - scheduling.NewRequirement(v1alpha1.LabelSKUSize, v1.NodeSelectorOpDoesNotExist), - scheduling.NewRequirement(v1alpha1.LabelSKUSeries, v1.NodeSelectorOpDoesNotExist), - - // size parts - scheduling.NewRequirement(v1alpha1.LabelSKUFamily, v1.NodeSelectorOpDoesNotExist), - scheduling.NewRequirement(v1alpha1.LabelSKUSubfamily, v1.NodeSelectorOpDoesNotExist), - scheduling.NewRequirement(v1alpha1.LabelSKUCPUConstrained, v1.NodeSelectorOpDoesNotExist), // TODO: check predicate specified - scheduling.NewRequirement(v1alpha1.LabelSKUAccelerator, v1.NodeSelectorOpDoesNotExist), - scheduling.NewRequirement(v1alpha1.LabelSKUVersion, v1.NodeSelectorOpDoesNotExist), - - // SKU capabilities - scheduling.NewRequirement(v1alpha1.LabelSKUStoragePremiumCapable, v1.NodeSelectorOpDoesNotExist), - scheduling.NewRequirement(v1alpha1.LabelSKUEncryptionAtHostSupported, v1.NodeSelectorOpDoesNotExist), - scheduling.NewRequirement(v1alpha1.LabelSKUEphemeralOSDiskSupported, v1.NodeSelectorOpDoesNotExist), - scheduling.NewRequirement(v1alpha1.LabelSKUAcceleratedNetworking, v1.NodeSelectorOpDoesNotExist), - scheduling.NewRequirement(v1alpha1.LabelSKUHyperVGeneration, v1.NodeSelectorOpDoesNotExist), - scheduling.NewRequirement(v1alpha1.LabelSKUCachedDiskSize, v1.NodeSelectorOpDoesNotExist), - scheduling.NewRequirement(v1alpha1.LabelSKUMaxResourceVolume, v1.NodeSelectorOpDoesNotExist), - - // all additive feature initialized elsewhere - ) - - // composites - requirements[v1alpha1.LabelSKUName].Insert(sku.GetName()) - requirements[v1alpha1.LabelSKUSize].Insert(*sku.Size) - - vmsize, err := sku.GetVMSize() - if err != nil { - logging.FromContext(ctx).Errorf("parsing VM size %s, %v", *sku.Size, err) - return requirements - } - // logging.FromContext(ctx).Debugf("VM Size %s: %s", *i.Size, vmsize) - - requirements[v1alpha1.LabelSKUSeries].Insert(vmsize.Series) - - // size parts - requirements[v1alpha1.LabelSKUFamily].Insert(vmsize.Family) - if vmsize.Subfamily != nil { - requirements[v1alpha1.LabelSKUSubfamily].Insert(*vmsize.Subfamily) - } - - if vmsize.CpusConstrained != nil { - requirements[v1alpha1.LabelSKUCPUConstrained].Insert(*vmsize.CpusConstrained) - } - - // everything from additive features - for _, featureLabel := range v1alpha1.SkuFeatureToLabel { - requirements.Add(scheduling.NewRequirement(featureLabel, v1.NodeSelectorOpDoesNotExist)) - } - for _, feature := range vmsize.AdditiveFeatures { - if featureLabel, ok := v1alpha1.SkuFeatureToLabel[feature]; ok { - requirements[featureLabel].Insert("true") // TODO: correct way to deal with bool in requirements? - } else { - if feature != 'p' && feature != 'r' { // known not in mapping - logging.FromContext(ctx).Debugf("Ignoring unrecognized feature of VM Size %s: %s", sku.GetName(), string(feature)) - } - } - } - - // (How? Would have to introduce requirements at offering level ...) - if sku.IsPremiumIO() { - requirements[v1alpha1.LabelSKUStoragePremiumCapable].Insert("true") - } - if sku.IsEncryptionAtHostSupported() { - requirements[v1alpha1.LabelSKUEncryptionAtHostSupported].Insert("true") - } - if sku.IsEphemeralOSDiskSupported() && vmsize.Series != "Dlds_v5" { // Dlds_v5 does not support ephemeral OS disk, contrary to what it claims - requirements[v1alpha1.LabelSKUEphemeralOSDiskSupported].Insert("true") - } - if sku.IsAcceleratedNetworkingSupported() { - requirements[v1alpha1.LabelSKUAcceleratedNetworking].Insert("true") // TODO: correct way to deal with bool in requirements? - } - // multiple values for instance type requirement: - if sku.IsHyperVGen1Supported() { - requirements[v1alpha1.LabelSKUHyperVGeneration].Insert("V1") - } - if sku.IsHyperVGen2Supported() { - requirements[v1alpha1.LabelSKUHyperVGeneration].Insert("V2") - } - - if utils.IsNvidiaEnabledSKU(sku.GetName()) { - requirements[v1alpha1.LabelSKUGPUManufacturer].Insert(v1alpha1.ManufacturerNvidia) - if vmsize.AcceleratorType != nil { - requirements[v1alpha1.LabelSKUGPUName].Insert(*vmsize.AcceleratorType) - } - } - - if maxCached, err := sku.MaxCachedDiskBytes(); err == nil { - requirements[v1alpha1.LabelSKUCachedDiskSize].Insert(fmt.Sprint(maxCached)) - } - if maxTemp, err := sku.MaxResourceVolumeMB(); err == nil { - requirements[v1alpha1.LabelSKUMaxResourceVolume].Insert(fmt.Sprint(maxTemp)) - } - - if vmsize.AcceleratorType != nil { - requirements[v1alpha1.LabelSKUAccelerator].Insert(*vmsize.AcceleratorType) - } - - requirements[v1alpha1.LabelSKUVersion].Insert(vmsize.Version) - - // TODO: more: GPU, etc. - - return requirements -} - -func getArchitecture(sku *skewer.SKU) string { - // TODO: error handling - architecture, _ := sku.GetCPUArchitectureType() - if value, ok := v1alpha1.AzureToKubeArchitectures[architecture]; ok { - return value - } - - return architecture // unrecognized -} - -func computeCapacity(sku *skewer.SKU, kc *v1alpha5.KubeletConfiguration) v1.ResourceList { - return v1.ResourceList{ - v1.ResourceCPU: *cpu(sku), - v1.ResourceMemory: *memory(sku), - v1.ResourceEphemeralStorage: *getEphemeralStorage(sku), - v1.ResourcePods: *pods(sku, kc), - // TODO: (important) more: GPU etc. - "nvidia.com/gpu": *gpuNvidiaCount(sku), - } -} - -// gpuNvidiaCount returns the number of Nvidia GPUs in the SKU. Currently nvidia is the only gpu manufacturer we support. -func gpuNvidiaCount(sku *skewer.SKU) *resource.Quantity { - count, err := sku.GPU() - if err != nil || !utils.IsNvidiaEnabledSKU(sku.GetName()) { - count = 0 - } - return resources.Quantity(fmt.Sprint(count)) -} -func cpu(sku *skewer.SKU) *resource.Quantity { - // TODO: error handling - vcpu, _ := sku.VCPU() - return resources.Quantity(fmt.Sprint(vcpu)) -} - -func memory(sku *skewer.SKU) *resource.Quantity { - // TODO: error handling - // TODO: Account for VM overhead in calculation - memory, _ := sku.Memory() // in GB! and float! - return resources.Quantity(fmt.Sprintf("%fG", memory)) -} - -// TODO: Don't see a way to get default Azure volume size ... -func getEphemeralStorage(*skewer.SKU) *resource.Quantity { - return resource.NewScaledQuantity(20, resource.Giga) -} - -func pods(sku *skewer.SKU, kc *v1alpha5.KubeletConfiguration) *resource.Quantity { - // TODO: fine-tune pods calc - var count int64 - switch { - case kc != nil && kc.MaxPods != nil: - count = int64(ptr.Int32Value(kc.MaxPods)) - default: - count = 110 - } - // TODO: feature flag for PodsPerCoreEnabled? - if kc != nil && ptr.Int32Value(kc.PodsPerCore) > 0 { - count = lo.Min([]int64{int64(ptr.Int32Value(kc.PodsPerCore)) * cpu(sku).Value(), count}) - } - return resources.Quantity(fmt.Sprint(count)) -} - -/* -// TODO: no way to distinguish between AMD and Nvidia GPUs -// TODO: skewer should support this natively -func (i *InstanceType) nvidiaGPUs() *resource.Quantity { - count, err := i.SKU.GetCapabilityIntegerQuantity("GPUs") - if err != nil { - count = 0 - } - return resources.Quantity(fmt.Sprint(count)) -} - -func (i *InstanceType) amdGPUs() *resource.Quantity { - count, err := i.SKU.GetCapabilityIntegerQuantity("GPUs") - if err != nil { - count = 0 - } - return resources.Quantity(fmt.Sprint(count)) -} -*/ - -func systemReservedResources(kc *v1alpha5.KubeletConfiguration) v1.ResourceList { - // default system-reserved resources: https://kubernetes.io/docs/tasks/administer-cluster/reserve-compute-resources/#system-reserved - resources := v1.ResourceList{ - v1.ResourceCPU: resource.MustParse("100m"), - v1.ResourceMemory: resource.MustParse("100Mi"), - v1.ResourceEphemeralStorage: resource.MustParse("1Gi"), - } - if kc != nil && kc.SystemReserved != nil { - return lo.Assign(resources, kc.SystemReserved) - } - return resources -} - -func kubeReservedResources(cpus, pods *resource.Quantity, kc *v1alpha5.KubeletConfiguration) v1.ResourceList { - // TODO: replace with Azure/AKS computation; current values and computation are just placeholders, borrowed from AWS provider - - resources := v1.ResourceList{ - v1.ResourceMemory: resource.MustParse(fmt.Sprintf("%dMi", (11*pods.Value())+255)), - v1.ResourceEphemeralStorage: resource.MustParse("1Gi"), // default kube-reserved ephemeral-storage - } - - // kube-reserved Computed from - // https://github.com/bottlerocket-os/bottlerocket/pull/1388/files#diff-bba9e4e3e46203be2b12f22e0d654ebd270f0b478dd34f40c31d7aa695620f2fR611 - for _, cpuRange := range []struct { - start int64 - end int64 - percentage float64 - }{ - {start: 0, end: 1000, percentage: 0.06}, - {start: 1000, end: 2000, percentage: 0.01}, - {start: 2000, end: 4000, percentage: 0.005}, - {start: 4000, end: 1 << 31, percentage: 0.0025}, - } { - cpuSt := cpus - if cpu := cpuSt.MilliValue(); cpu >= cpuRange.start { - r := float64(cpuRange.end - cpuRange.start) - if cpu < cpuRange.end { - r = float64(cpu - cpuRange.start) - } - cpuOverhead := resources.Cpu() - cpuOverhead.Add(*resource.NewMilliQuantity(int64(r*cpuRange.percentage), resource.DecimalSI)) - resources[v1.ResourceCPU] = *cpuOverhead - } - } - if kc != nil && kc.KubeReserved != nil { - return lo.Assign(resources, kc.KubeReserved) - } - return resources -} - -func evictionThreshold(memory *resource.Quantity, kc *v1alpha5.KubeletConfiguration) v1.ResourceList { - overhead := v1.ResourceList{ - v1.ResourceMemory: resource.MustParse("100Mi"), - } - if kc == nil { - return overhead - } - - override := v1.ResourceList{} - var evictionSignals []map[string]string - if kc.EvictionHard != nil { - evictionSignals = append(evictionSignals, kc.EvictionHard) - } - // TODO: feature flag for enabling soft eviction? - if kc.EvictionSoft != nil { - evictionSignals = append(evictionSignals, kc.EvictionSoft) - } - - for _, m := range evictionSignals { - temp := v1.ResourceList{} - if v, ok := m[memoryAvailable]; ok { - if strings.HasSuffix(v, "%") { - p := mustParsePercentage(v) - - // Calculation is node.capacity * evictionHard[memory.available] if percentage - // From https://kubernetes.io/docs/concepts/scheduling-eviction/node-pressure-eviction/#eviction-signals - temp[v1.ResourceMemory] = resource.MustParse(fmt.Sprint(math.Ceil(float64(memory.Value()) / 100 * p))) - } else { - temp[v1.ResourceMemory] = resource.MustParse(v) - } - } - override = resources.MaxResources(override, temp) - } - // Assign merges maps from left to right so overrides will always be taken last - return lo.Assign(overhead, override) -} - -func mustParsePercentage(v string) float64 { - p, err := strconv.ParseFloat(strings.Trim(v, "%"), 64) - if err != nil { - panic(fmt.Sprintf("expected percentage value to be a float but got %s, %v", v, err)) - } - // Setting percentage value to 100% is considered disabling the threshold according to - // https://kubernetes.io/docs/reference/config-api/kubelet-config.v1beta1/ - if p == 100 { - p = 0 - } - return p -} diff --git a/pkg/providers/instancetype/instancetypes.go b/pkg/providers/instancetype/instancetypes.go deleted file mode 100644 index 2f058df5..00000000 --- a/pkg/providers/instancetype/instancetypes.go +++ /dev/null @@ -1,136 +0,0 @@ -/* - Copyright (c) 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. -*/ - -package instancetype - -import ( - "context" - "fmt" - "net/http" - "sync" - "time" - - "github.com/aws/karpenter-core/pkg/apis/v1alpha5" - - kcache "github.com/azure/gpu-provisioner/pkg/cache" - "github.com/patrickmn/go-cache" - "knative.dev/pkg/logging" - - "github.com/aws/karpenter-core/pkg/cloudprovider" - - "github.com/azure/gpu-provisioner/pkg/apis/v1alpha1" - "github.com/azure/gpu-provisioner/pkg/providers/pricing" - - "github.com/Azure/skewer" -) - -const ( - InstanceTypesCacheKey = "types" - InstanceTypesCacheTTL = 23 * time.Hour // AWS uses 5 min here. TODO: check on why that frequent. Pricing? -) - -type Provider struct { - sync.Mutex - region string - resourceSkusClient skewer.ResourceClient - pricingProvider *pricing.Provider - unavailableOfferings *kcache.UnavailableOfferings - // Has one cache entry for all the instance types (key: InstanceTypesCacheKey) - cache *cache.Cache -} - -func NewProvider(region string, cache *cache.Cache, resourceSkusClient skewer.ResourceClient, pricingProvider *pricing.Provider, offeringsCache *kcache.UnavailableOfferings) *Provider { - return &Provider{ - // TODO: skewer api, subnetprovider, pricing provider, unavailable offerings, ... - region: region, - resourceSkusClient: resourceSkusClient, - pricingProvider: pricingProvider, - unavailableOfferings: offeringsCache, - cache: cache, - } -} - -// List Get all instance type options -func (p *Provider) List( - ctx context.Context, kc *v1alpha5.KubeletConfiguration) ([]*cloudprovider.InstanceType, error) { - p.Lock() - defer p.Unlock() - // Get SKUs from Azure - skus, err := p.getInstanceTypes(ctx) - if err != nil { - return nil, err - } - - // Get Viable offerings - - result := []*cloudprovider.InstanceType{} - for _, sku := range skus { - instanceType := NewInstanceType(ctx, sku, kc, p.region, p.createOfferings(ctx, sku)) - if len(instanceType.Offerings) == 0 { - continue - } - result = append(result, instanceType) - } - return result, nil -} - -func (p *Provider) LivenessProbe(req *http.Request) error { - p.Lock() - //nolint: staticcheck - p.Unlock() - return p.pricingProvider.LivenessProbe(req) -} - -func (p *Provider) createOfferings(ctx context.Context, sku *skewer.SKU) []cloudprovider.Offering { - - var offerings []cloudprovider.Offering - onDemandPrice, ok := p.pricingProvider.OnDemandPrice(*sku.Name) - - if !p.unavailableOfferings.IsUnavailable(*sku.Name, p.region, v1alpha1.PriorityRegular) { - offerings = append(offerings, cloudprovider.Offering{Zone: "", CapacityType: v1alpha1.PriorityRegular, Price: onDemandPrice, Available: ok}) - } - return offerings -} - -// getInstanceTypes retrieves all instance types from skewer using some opinionated filters -func (p *Provider) getInstanceTypes(ctx context.Context) (map[string]*skewer.SKU, error) { - if cached, ok := p.cache.Get(InstanceTypesCacheKey); ok { - return cached.(map[string]*skewer.SKU), nil - } - instanceTypes := map[string]*skewer.SKU{} - - // TODO: filter! - cache, err := skewer.NewCache(ctx, skewer.WithLocation(p.region), skewer.WithResourceClient(p.resourceSkusClient)) - if err != nil { - return nil, fmt.Errorf("fetching SKUs using skewer, %w", err) - } - - skus := cache.List(ctx, skewer.ResourceTypeFilter(skewer.VirtualMachines)) - for i := range skus { - if p.filter(&skus[i]) { - instanceTypes[skus[i].GetName()] = &skus[i] - } - } - - logging.FromContext(ctx).Debugf("Discovered %d SKUs for region %s", len(instanceTypes), p.region) - p.cache.SetDefault(InstanceTypesCacheKey, instanceTypes) - return instanceTypes, nil -} - -// filter the instance types to include useful ones for Kubernetes -func (p *Provider) filter(_ *skewer.SKU) bool { - // TODO: filter. AWS provider filters out FPGA and older GPU instances (see comment there) - return true -} diff --git a/pkg/providers/pricing/client/pricingapi.go b/pkg/providers/pricing/client/pricingapi.go deleted file mode 100644 index c68e8458..00000000 --- a/pkg/providers/pricing/client/pricingapi.go +++ /dev/null @@ -1,82 +0,0 @@ -/* - Copyright (c) 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. -*/ - -package client - -import ( - "context" - "encoding/json" - "fmt" - "io" - "net/http" - "net/url" - "strings" -) - -const ( - apiVersion = "2021-10-01-preview" - pricingURL = "https://prices.azure.com/api/retail/prices?api-version=" + apiVersion -) - -type PricingAPI interface { - GetProductsPricePages(context.Context, []*Filter, func(output *ProductsPricePage)) error -} - -type pricingAPI struct{} - -func New() PricingAPI { - return &pricingAPI{} -} - -func (papi *pricingAPI) GetProductsPricePages(_ context.Context, filters []*Filter, pageHandler func(output *ProductsPricePage)) error { - nextURL := pricingURL - - if len(filters) > 0 { - filterParams := []string{} - for _, filter := range filters { - filterParams = append(filterParams, filter.String()) - } - - filterParamsEscaped := url.QueryEscape(strings.Join(filterParams[:], " and ")) - - nextURL += fmt.Sprintf("&$filter=%s", filterParamsEscaped) - } - - for nextURL != "" { - res, err := http.Get(nextURL) - if err != nil { - return err - } - - if res.StatusCode != 200 { - return fmt.Errorf("got a non-200 status code: %d", res.StatusCode) - } - - resBody, err := io.ReadAll(res.Body) - if err != nil { - return err - } - - page := ProductsPricePage{} - err = json.Unmarshal(resBody, &page) - if err != nil { - return err - } - - pageHandler(&page) - nextURL = page.NextPageLink - } - return nil -} diff --git a/pkg/providers/pricing/client/pricingapi_types.go b/pkg/providers/pricing/client/pricingapi_types.go deleted file mode 100644 index 35263702..00000000 --- a/pkg/providers/pricing/client/pricingapi_types.go +++ /dev/null @@ -1,57 +0,0 @@ -/* - Copyright (c) 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. -*/ - -// Generated structs based off of the json retrieved from the https://prices.azure.com/api/retail/prices API - -package client - -import ( - "time" -) - -type Item struct { - CurrencyCode string `json:"currencyCode"` - TierMinimumUnits float64 `json:"tierMinimumUnits"` - RetailPrice float64 `json:"retailPrice"` - UnitPrice float64 `json:"unitPrice"` - ArmRegionName string `json:"armRegionName"` - Location string `json:"location"` - EffectiveStartDate time.Time `json:"effectiveStartDate"` - MeterID string `json:"meterId"` - MeterName string `json:"meterName"` - ProductID string `json:"productId"` - SkuID string `json:"skuId"` - AvailabilityID any `json:"availabilityId"` - ProductName string `json:"productName"` - SkuName string `json:"skuName"` - ServiceName string `json:"serviceName"` - ServiceID string `json:"serviceId"` - ServiceFamily string `json:"serviceFamily"` - UnitOfMeasure string `json:"unitOfMeasure"` - Type string `json:"type"` - IsPrimaryMeterRegion bool `json:"isPrimaryMeterRegion"` - ArmSkuName string `json:"armSkuName"` - EffectiveEndDate time.Time `json:"effectiveEndDate,omitempty"` - ReservationTerm string `json:"reservationTerm,omitempty"` -} - -type ProductsPricePage struct { - BillingCurrency string `json:"BillingCurrency"` - CustomerEntityID string `json:"CustomerEntityId"` - CustomerEntityType string `json:"CustomerEntityType"` - Items []Item `json:"Items"` - NextPageLink string `json:"NextPageLink"` - Count int `json:"Count"` -} diff --git a/pkg/providers/pricing/pricing.go b/pkg/providers/pricing/pricing.go deleted file mode 100644 index 763e79d9..00000000 --- a/pkg/providers/pricing/pricing.go +++ /dev/null @@ -1,251 +0,0 @@ -/* - Copyright (c) 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. -*/ - -package pricing - -import ( - "context" - "errors" - "net/http" - "strings" - "sync" - "time" - - "github.com/aws/karpenter-core/pkg/utils/pretty" - "github.com/azure/gpu-provisioner/pkg/providers/pricing/client" - "github.com/samber/lo" - "knative.dev/pkg/logging" -) - -// pricingUpdatePeriod is how often we try to update our pricing information after the initial update on startup -const pricingUpdatePeriod = 12 * time.Hour - -// Provider provides actual pricing data to the Azure cloud provider to allow it to make more informed decisions -// regarding which instances to launch. This is initialized at startup with a periodically updated static price list to -// support running in locations where pricing data is unavailable. In those cases the static pricing data provides a -// relative ordering that is still more accurate than our previous pricing model. In the event that a pricing update -// fails, the previous pricing information is retained and used which may be the static initial pricing data if pricing -// updates never succeed. -type Provider struct { - pricing client.PricingAPI - region string - cm *pretty.ChangeMonitor - - mu sync.RWMutex - onDemandUpdateTime time.Time - onDemandPrices map[string]float64 -} - -type Err struct { - error - lastUpdateTime time.Time -} - -// NewAPI returns a pricing API -func NewAPI() client.PricingAPI { - return client.New() -} - -func NewProvider(ctx context.Context, pricing client.PricingAPI, region string, startAsync <-chan struct{}) *Provider { - // see if we've got region specific pricing data - staticPricing, ok := initialOnDemandPrices[region] - if !ok { - // and if not, fall back to the always available eastus - staticPricing = initialOnDemandPrices["eastus"] - } - - p := &Provider{ - region: region, - onDemandUpdateTime: initialPriceUpdate, - onDemandPrices: staticPricing, - pricing: pricing, - cm: pretty.NewChangeMonitor(), - } - ctx = logging.WithLogger(ctx, logging.FromContext(ctx).Named("pricing")) - - go func() { - // perform an initial price update at startup - p.updatePricing(ctx) - - startup := time.Now() - // wait for leader election or to be signaled to exit - select { - case <-startAsync: - case <-ctx.Done(): - return - } - // if it took many hours to be elected leader, we want to re-fetch pricing before we start our periodic - // polling - if time.Since(startup) > pricingUpdatePeriod { - p.updatePricing(ctx) - } - - for { - select { - case <-ctx.Done(): - return - case <-time.After(pricingUpdatePeriod): - p.updatePricing(ctx) - } - } - }() - return p -} - -// InstanceTypes returns the list of all instance types for which either a price is known. -func (p *Provider) InstanceTypes() []string { - p.mu.RLock() - defer p.mu.RUnlock() - return lo.Keys(p.onDemandPrices) -} - -// OnDemandLastUpdated returns the time that the on-demand pricing was last updated -func (p *Provider) OnDemandLastUpdated() time.Time { - p.mu.RLock() - defer p.mu.RUnlock() - return p.onDemandUpdateTime -} - -// OnDemandPrice returns the last known on-demand price for a given instance type, returning false if there is no -// known on-demand pricing for the instance type. -func (p *Provider) OnDemandPrice(instanceType string) (float64, bool) { - p.mu.RLock() - defer p.mu.RUnlock() - price, ok := p.onDemandPrices[instanceType] - if !ok { - return 0.0, false - } - return price, true -} - -func (p *Provider) updatePricing(ctx context.Context) { - var wg sync.WaitGroup - wg.Add(1) - go func() { - defer wg.Done() - if err := p.UpdateOnDemandPricing(ctx); err != nil { - logging.FromContext(ctx).Errorf("error updating on-demand pricing for region %s, %s, using existing pricing data from %s", p.region, err, err.lastUpdateTime.Format(time.RFC3339)) - } - }() - - wg.Wait() -} - -func (p *Provider) UpdateOnDemandPricing(ctx context.Context) *Err { - // standard on-demand instances - var wg sync.WaitGroup - var onDemandPrices map[string]float64 - var onDemandErr error - - wg.Add(1) - go func() { - defer wg.Done() - onDemandPrices, onDemandErr = p.fetchOnDemandPricing(ctx) - }() - - wg.Wait() - - p.mu.Lock() - defer p.mu.Unlock() - err := onDemandErr - if err != nil { - return &Err{error: err, lastUpdateTime: p.onDemandUpdateTime} - } - - if len(onDemandPrices) == 0 { - return &Err{error: errors.New("no on-demand pricing found"), lastUpdateTime: p.onDemandUpdateTime} - } - - p.onDemandPrices = lo.Assign(onDemandPrices) - p.onDemandUpdateTime = time.Now() - if p.cm.HasChanged("on-demand-prices", p.onDemandPrices) { - logging.FromContext(ctx).With("instance-type-count", len(p.onDemandPrices)).Infof("updated on-demand pricing for region %s", p.region) - } - return nil -} - -func (p *Provider) fetchOnDemandPricing(ctx context.Context) (map[string]float64, error) { - prices := map[string]float64{} - filters := []*client.Filter{ - { - Field: "priceType", - Operator: client.Equals, - Value: "Consumption", - }, - { - Field: "currencyCode", - Operator: client.Equals, - Value: "USD", - }, - { - Field: "serviceFamily", - Operator: client.Equals, - Value: "Compute", - }, - { - Field: "serviceName", - Operator: client.Equals, - Value: "Virtual Machines", - }, - { - Field: "armRegionName", - Operator: client.Equals, - Value: p.region, - }} - if err := p.pricing.GetProductsPricePages(ctx, filters, p.onDemandPage(prices)); err != nil { - return nil, err - } - return prices, nil -} - -func (p *Provider) onDemandPage(prices map[string]float64) func(page *client.ProductsPricePage) { - return func(page *client.ProductsPricePage) { - for _, pItem := range page.Items { - if strings.HasSuffix(pItem.ProductName, " Windows") { - continue - } - if strings.HasSuffix(pItem.MeterName, " Low Priority") { - // https://learn.microsoft.com/en-us/azure/batch/batch-spot-vms#differences-between-spot-and-low-priority-vms - continue - } - if strings.HasSuffix(pItem.SkuName, " Spot") { - continue - } - prices[pItem.ArmSkuName] = pItem.RetailPrice - } - } -} - -func (p *Provider) LivenessProbe(_ *http.Request) error { - // ensure we don't deadlock and nolint for the empty critical section - p.mu.Lock() - //nolint: staticcheck - p.mu.Unlock() - return nil -} - -func (p *Provider) Reset() { - // see if we've got region specific pricing data - staticPricing, ok := initialOnDemandPrices[p.region] - if !ok { - // and if not, fall back to the always available eastus - staticPricing = initialOnDemandPrices["eastus"] - } - - p.mu.Lock() - defer p.mu.Unlock() - p.onDemandPrices = staticPricing - p.onDemandUpdateTime = initialPriceUpdate -} diff --git a/pkg/providers/pricing/suite_test.go b/pkg/providers/pricing/suite_test.go deleted file mode 100644 index 9ed8ca9e..00000000 --- a/pkg/providers/pricing/suite_test.go +++ /dev/null @@ -1,91 +0,0 @@ -/* - Copyright (c) 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. -*/ - -package pricing_test - -import ( - "context" - "fmt" - "testing" - "time" - - . "github.com/onsi/ginkgo/v2" - . "github.com/onsi/gomega" - . "knative.dev/pkg/logging/testing" - - "github.com/azure/gpu-provisioner/pkg/fake" - "github.com/azure/gpu-provisioner/pkg/providers/pricing" - "github.com/azure/gpu-provisioner/pkg/providers/pricing/client" -) - -var ctx context.Context -var stop context.CancelFunc - -var fakePricingAPI *fake.PricingAPI -var pricingProvider *pricing.Provider - -func TestAzure(t *testing.T) { - ctx = TestContextWithLogger(t) - RegisterFailHandler(Fail) - RunSpecs(t, "Providers/Pricing/Azure") -} - -var _ = BeforeSuite(func() { - ctx, stop = context.WithCancel(ctx) - - fakePricingAPI = &fake.PricingAPI{} - pricingProvider = pricing.NewProvider(ctx, fakePricingAPI, "", make(chan struct{})) -}) - -var _ = AfterSuite(func() { - stop() -}) - -var _ = BeforeEach(func() { - fakePricingAPI.Reset() -}) - -var _ = Describe("Pricing", func() { - BeforeEach(func() { - fakePricingAPI.Reset() - }) - It("should return static on-demand data if pricing API fails", func() { - fakePricingAPI.NextError.Set(fmt.Errorf("failed")) - p := pricing.NewProvider(ctx, fakePricingAPI, "", make(chan struct{})) - price, ok := p.OnDemandPrice("Standard_D1") - Expect(ok).To(BeTrue()) - Expect(price).To(BeNumerically(">", 0)) - }) - It("should update on-demand pricing with response from the pricing API", func() { - // modify our API before creating the pricing provider as it performs an initial update on creation. - fakePricingAPI.ProductsPricePage.Set(&client.ProductsPricePage{ - Items: []client.Item{ - fake.NewProductPrice("Standard_D1", 1.20), - fake.NewProductPrice("Standard_D14", 1.23), - }, - }) - updateStart := time.Now() - p := pricing.NewProvider(ctx, fakePricingAPI, "", make(chan struct{})) - Eventually(func() bool { return p.OnDemandLastUpdated().After(updateStart) }).Should(BeTrue()) - - price, ok := p.OnDemandPrice("Standard_D1") - Expect(ok).To(BeTrue()) - Expect(price).To(BeNumerically("==", 1.20)) - - price, ok = p.OnDemandPrice("Standard_D14") - Expect(ok).To(BeTrue()) - Expect(price).To(BeNumerically("==", 1.23)) - }) -}) diff --git a/pkg/providers/pricing/zz_generated.pricing.go b/pkg/providers/pricing/zz_generated.pricing.go deleted file mode 100644 index 82b02476..00000000 --- a/pkg/providers/pricing/zz_generated.pricing.go +++ /dev/null @@ -1,25800 +0,0 @@ -//go:build !ignore_autogenerated - -/* - Copyright (c) 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. -*/ - -package pricing - -import "time" - -// generated at 2023-09-28T21:13:32Z - -var initialPriceUpdate, _ = time.Parse(time.RFC3339, "2023-09-28T21:13:32Z") -var initialOnDemandPrices = map[string]map[string]float64{} - -func init() { - // australiacentral - initialOnDemandPrices["australiacentral"] = map[string]float64{ - "Basic_A0": 0.024000, - "Basic_A1": 0.032000, - "Basic_A2": 0.098000, - "Basic_A3": 0.232000, - "Basic_A4": 0.464000, - "Dadsv5_Type1": 8.008000, - "Dasv4_Type1": 6.600000, - "Dasv4_Type2": 6.600000, - "Dasv5_Type1": 6.653000, - "Ddsv4_Type 1": 4.998000, - "Ddsv4_Type2": 5.936000, - "Ddsv5_Type1": 7.498000, - "Dsv3_Type3": 6.599000, - "Dsv3_Type4": 8.249000, - "Dsv4_Type1": 5.280000, - "Dsv4_Type2": 6.336000, - "Dsv5_Type1": 6.600000, - "Eadsv5_Type1": 8.395000, - "Easv4_Type1": 7.973000, - "Easv4_Type2": 7.973000, - "Easv5_Type1": 7.181000, - "Ebdsv5-Type1": 7.075000, - "Ebsv5-Type1": 6.266000, - "Edsv4_Type 1": 6.125000, - "Edsv5_Type1": 9.187000, - "Esv3_Type3": 6.434000, - "Esv4_Type1": 5.315000, - "Esv4_Type2": 6.976000, - "Esv5_Type1": 7.973000, - "Fsv2_Type2": 4.396000, - "Fsv2_Type4": 5.861000, - "Lasv3_Type1": 8.228000, - "Lsv3_Type1": 9.196000, - "Msmv2_Type1": 158.140000, - "Msv2_Type1": 79.080000, - "Standard_A0": 0.029000, - "Standard_A1": 0.071000, - "Standard_A1_v2": 0.050000, - "Standard_A2": 0.142000, - "Standard_A2_v2": 0.106000, - "Standard_A2m_v2": 0.149000, - "Standard_A3": 0.284000, - "Standard_A4": 0.568000, - "Standard_A4_v2": 0.222000, - "Standard_A4m_v2": 0.312000, - "Standard_A5": 0.278000, - "Standard_A6": 0.556000, - "Standard_A7": 1.112000, - "Standard_A8_v2": 0.467000, - "Standard_A8m_v2": 0.655000, - "Standard_B12ms": 0.634000, - "Standard_B16als_v2": 0.747000, - "Standard_B16as_v2": 0.834000, - "Standard_B16ls_v2": 0.748000, - "Standard_B16ms": 0.845000, - "Standard_B16s_v2": 0.918000, - "Standard_B1ls": 0.006600, - "Standard_B1ms": 0.026400, - "Standard_B1s": 0.013200, - "Standard_B20ms": 1.056000, - "Standard_B2als_v2": 0.047500, - "Standard_B2as_v2": 0.104000, - "Standard_B2ats_v2": 0.011900, - "Standard_B2ls_v2": 0.062000, - "Standard_B2ms": 0.106000, - "Standard_B2s_v2": 0.106000, - "Standard_B2ts_v2": 0.013200, - "Standard_B32als_v2": 1.346000, - "Standard_B32as_v2": 1.520000, - "Standard_B32ls_v2": 1.496000, - "Standard_B32s_v2": 1.690000, - "Standard_B4als_v2": 0.187000, - "Standard_B4as_v2": 0.190000, - "Standard_B4ls_v2": 0.187000, - "Standard_B4ms": 0.211000, - "Standard_B4s_v2": 0.211000, - "Standard_B8als_v2": 0.337000, - "Standard_B8as_v2": 0.417000, - "Standard_B8ls_v2": 0.411000, - "Standard_B8ms": 0.422000, - "Standard_B8s_v2": 0.459000, - "Standard_D11_v2": 0.200000, - "Standard_D11_v2_Promo": 0.249000, - "Standard_D12_v2": 0.399000, - "Standard_D12_v2_Promo": 0.498750, - "Standard_D13_v2": 0.798000, - "Standard_D13_v2_Promo": 0.997000, - "Standard_D14_v2_Promo": 1.995000, - "Standard_D15_v2": 1.995000, - "Standard_D15i_v2": 1.995000, - "Standard_D16_v3": 1.000000, - "Standard_D16_v4": 0.960000, - "Standard_D16_v5": 0.960000, - "Standard_D16a_v4": 0.960000, - "Standard_D16ads_v5": 1.040000, - "Standard_D16as_v5": 0.864000, - "Standard_D16d_v4": 1.136000, - "Standard_D16d_v5": 1.136000, - "Standard_D16ds_v4": 1.136000, - "Standard_D16ds_v5": 1.136000, - "Standard_D16lds_v5": 1.008000, - "Standard_D16ls_v5": 0.888000, - "Standard_D16s_v3": 1.000000, - "Standard_D16s_v4": 0.960000, - "Standard_D16s_v5": 0.960000, - "Standard_D1_v2": 0.084000, - "Standard_D2_v2": 0.168000, - "Standard_D2_v2_Promo": 0.210000, - "Standard_D2_v3": 0.125000, - "Standard_D2_v5": 0.120000, - "Standard_D2a_v4": 0.120000, - "Standard_D2ads_v5": 0.130000, - "Standard_D2as_v4": 0.120000, - "Standard_D2as_v5": 0.108000, - "Standard_D2d_v4": 0.142000, - "Standard_D2d_v5": 0.142000, - "Standard_D2ds_v4": 0.142000, - "Standard_D2ds_v5": 0.142000, - "Standard_D2lds_v5": 0.126000, - "Standard_D2ls_v5": 0.111000, - "Standard_D2s_v3": 0.125000, - "Standard_D2s_v5": 0.120000, - "Standard_D32-16s_v3": 2.000000, - "Standard_D32-8s_v3": 2.000000, - "Standard_D32_v3": 2.000000, - "Standard_D32_v4": 1.920000, - "Standard_D32_v5": 1.920000, - "Standard_D32a_v4": 1.920000, - "Standard_D32ads_v5": 2.080000, - "Standard_D32as_v4": 1.920000, - "Standard_D32as_v5": 1.728000, - "Standard_D32d_v4": 2.272000, - "Standard_D32d_v5": 2.272000, - "Standard_D32ds_v4": 2.272000, - "Standard_D32ds_v5": 2.272000, - "Standard_D32lds_v5": 2.016000, - "Standard_D32ls_v5": 1.776000, - "Standard_D32s_v3": 2.000000, - "Standard_D32s_v4": 1.920000, - "Standard_D32s_v5": 1.920000, - "Standard_D3_v2": 0.336000, - "Standard_D3_v2_Promo": 0.420000, - "Standard_D48_v3": 3.000000, - "Standard_D48_v4": 2.880000, - "Standard_D48_v5": 2.880000, - "Standard_D48a_v4": 2.880000, - "Standard_D48ads_v5": 3.120000, - "Standard_D48as_v4": 2.880000, - "Standard_D48as_v5": 2.592000, - "Standard_D48d_v4": 3.408000, - "Standard_D48d_v5": 3.408000, - "Standard_D48ds_v4": 3.408000, - "Standard_D48ds_v5": 3.408000, - "Standard_D48lds_v5": 3.024000, - "Standard_D48ls_v5": 2.664000, - "Standard_D48s_v3": 3.000000, - "Standard_D48s_v4": 2.880000, - "Standard_D48s_v5": 2.880000, - "Standard_D4_v2": 0.673000, - "Standard_D4_v2_Promo": 0.841000, - "Standard_D4_v3": 0.250000, - "Standard_D4_v4": 0.240000, - "Standard_D4_v5": 0.240000, - "Standard_D4a_v4": 0.240000, - "Standard_D4ads_v5": 0.260000, - "Standard_D4as_v4": 0.240000, - "Standard_D4as_v5": 0.216000, - "Standard_D4d_v4": 0.284000, - "Standard_D4d_v5": 0.284000, - "Standard_D4ds_v4": 0.284000, - "Standard_D4ds_v5": 0.284000, - "Standard_D4lds_v5": 0.252000, - "Standard_D4ls_v5": 0.222000, - "Standard_D4s_v3": 0.250000, - "Standard_D4s_v4": 0.240000, - "Standard_D4s_v5": 0.240000, - "Standard_D5_v2": 1.345000, - "Standard_D5_v2_Promo": 1.681000, - "Standard_D64-16s_v3": 4.000000, - "Standard_D64_v3": 4.000000, - "Standard_D64_v4": 3.840000, - "Standard_D64_v5": 3.840000, - "Standard_D64a_v4": 3.840000, - "Standard_D64ads_v5": 4.160000, - "Standard_D64as_v4": 3.840000, - "Standard_D64as_v5": 3.456000, - "Standard_D64d_v4": 4.544000, - "Standard_D64d_v5": 4.544000, - "Standard_D64ds_v4": 4.544000, - "Standard_D64ds_v5": 4.544000, - "Standard_D64lds_v5": 4.032000, - "Standard_D64ls_v5": 3.552000, - "Standard_D64s_v3": 4.000000, - "Standard_D64s_v4": 3.840000, - "Standard_D64s_v5": 3.840000, - "Standard_D8_v3": 0.500000, - "Standard_D8_v4": 0.480000, - "Standard_D8_v5": 0.480000, - "Standard_D8a_v4": 0.480000, - "Standard_D8ads_v5": 0.520000, - "Standard_D8as_v4": 0.480000, - "Standard_D8as_v5": 0.432000, - "Standard_D8d_v4": 0.568000, - "Standard_D8d_v5": 0.568000, - "Standard_D8ds_v4": 0.568000, - "Standard_D8ds_v5": 0.568000, - "Standard_D8lds_v5": 0.504000, - "Standard_D8ls_v5": 0.444000, - "Standard_D8s_v3": 0.500000, - "Standard_D8s_v4": 0.480000, - "Standard_D8s_v5": 0.480000, - "Standard_D96_v5": 5.760000, - "Standard_D96a_v4": 5.760000, - "Standard_D96ads_v5": 6.240000, - "Standard_D96as_v4": 5.760000, - "Standard_D96as_v5": 5.184000, - "Standard_D96ds_v5": 6.816000, - "Standard_D96lds_v5": 6.048000, - "Standard_D96ls_v5": 5.328000, - "Standard_D96s_v5": 5.760000, - "Standard_DS11-1_v2": 0.200000, - "Standard_DS11_v2": 0.200000, - "Standard_DS11_v2_Promo": 0.249000, - "Standard_DS12-1_v2": 0.399000, - "Standard_DS12-2_v2": 0.399000, - "Standard_DS12_v2": 0.399000, - "Standard_DS12_v2_Promo": 0.498750, - "Standard_DS13-2_v2": 0.798000, - "Standard_DS13-4_v2": 0.798000, - "Standard_DS13_v2": 0.798000, - "Standard_DS13_v2_Promo": 0.997000, - "Standard_DS14-4_v2": 1.596000, - "Standard_DS14-8_v2": 1.596000, - "Standard_DS14_v2": 1.596000, - "Standard_DS15_v2": 1.995000, - "Standard_DS15i_v2": 1.995000, - "Standard_DS1_v2": 0.084000, - "Standard_DS2_v2": 0.168000, - "Standard_DS2_v2_Promo": 0.210000, - "Standard_DS3_v2_Promo": 0.420000, - "Standard_DS4_v2": 0.673000, - "Standard_DS4_v2_Promo": 0.841000, - "Standard_DS5_v2": 1.345000, - "Standard_DS5_v2_Promo": 1.681000, - "Standard_E104i_v5": 8.637000, - "Standard_E104id_v5": 9.953000, - "Standard_E104ids_v5": 9.953000, - "Standard_E104is_v5": 8.637000, - "Standard_E112iads_v5": 9.794000, - "Standard_E112ias_v5": 8.378000, - "Standard_E112ibds_v5": 12.382000, - "Standard_E112ibs_v5": 10.965000, - "Standard_E16-4ads_v5": 1.272000, - "Standard_E16-4as_v4": 1.208000, - "Standard_E16-4as_v5": 1.088000, - "Standard_E16-4ds_v4": 1.392000, - "Standard_E16-4ds_v5": 1.392000, - "Standard_E16-4s_v3": 1.277000, - "Standard_E16-4s_v4": 1.208000, - "Standard_E16-4s_v5": 1.208000, - "Standard_E16-8ads_v5": 1.272000, - "Standard_E16-8as_v4": 1.208000, - "Standard_E16-8as_v5": 1.088000, - "Standard_E16-8ds_v4": 1.392000, - "Standard_E16-8ds_v5": 1.392000, - "Standard_E16-8s_v3": 1.277000, - "Standard_E16-8s_v4": 1.208000, - "Standard_E16-8s_v5": 1.208000, - "Standard_E16_v3": 1.277000, - "Standard_E16_v4": 1.208000, - "Standard_E16_v5": 1.208000, - "Standard_E16ads_v5": 1.272000, - "Standard_E16as_v4": 1.208000, - "Standard_E16bds_v5": 1.608000, - "Standard_E16bs_v5": 1.424000, - "Standard_E16d_v4": 1.392000, - "Standard_E16d_v5": 1.392000, - "Standard_E16ds_v4": 1.392000, - "Standard_E16ds_v5": 1.392000, - "Standard_E16s_v4": 1.208000, - "Standard_E16s_v5": 1.208000, - "Standard_E20_v3": 1.509000, - "Standard_E20_v4": 1.510000, - "Standard_E20_v5": 1.510000, - "Standard_E20a_v4": 1.510000, - "Standard_E20ads_v5": 1.590000, - "Standard_E20as_v4": 1.510000, - "Standard_E20as_v5": 1.360000, - "Standard_E20d_v4": 1.740000, - "Standard_E20d_v5": 1.740000, - "Standard_E20ds_v4": 1.740000, - "Standard_E20ds_v5": 1.740000, - "Standard_E20s_v3": 1.509000, - "Standard_E20s_v4": 1.510000, - "Standard_E20s_v5": 1.510000, - "Standard_E2_v3": 0.160000, - "Standard_E2_v4": 0.151000, - "Standard_E2_v5": 0.151000, - "Standard_E2a_v4": 0.151000, - "Standard_E2ads_v5": 0.159000, - "Standard_E2as_v4": 0.151000, - "Standard_E2as_v5": 0.136000, - "Standard_E2bds_v5": 0.201000, - "Standard_E2bs_v5": 0.178000, - "Standard_E2d_v4": 0.174000, - "Standard_E2d_v5": 0.174000, - "Standard_E2ds_v4": 0.174000, - "Standard_E2ds_v5": 0.174000, - "Standard_E2s_v3": 0.160000, - "Standard_E2s_v4": 0.151000, - "Standard_E32-16ads_v5": 2.544000, - "Standard_E32-16as_v5": 2.176000, - "Standard_E32-16ds_v4": 2.784000, - "Standard_E32-16ds_v5": 2.784000, - "Standard_E32-16s_v3": 2.554000, - "Standard_E32-16s_v4": 2.416000, - "Standard_E32-16s_v5": 2.416000, - "Standard_E32-8ads_v5": 2.544000, - "Standard_E32-8as_v4": 2.416000, - "Standard_E32-8as_v5": 2.176000, - "Standard_E32-8ds_v4": 2.784000, - "Standard_E32-8ds_v5": 2.784000, - "Standard_E32-8s_v3": 2.554000, - "Standard_E32-8s_v4": 2.416000, - "Standard_E32-8s_v5": 2.416000, - "Standard_E32_v3": 2.554000, - "Standard_E32_v5": 2.416000, - "Standard_E32a_v4": 2.416000, - "Standard_E32ads_v5": 2.544000, - "Standard_E32as_v4": 2.416000, - "Standard_E32as_v5": 2.176000, - "Standard_E32bds_v5": 3.216000, - "Standard_E32bs_v5": 2.848000, - "Standard_E32d_v4": 2.784000, - "Standard_E32d_v5": 2.784000, - "Standard_E32ds_v4": 2.784000, - "Standard_E32s_v3": 2.554000, - "Standard_E32s_v4": 2.416000, - "Standard_E32s_v5": 2.416000, - "Standard_E4-2ads_v5": 0.318000, - "Standard_E4-2as_v4": 0.302000, - "Standard_E4-2as_v5": 0.272000, - "Standard_E4-2ds_v4": 0.348000, - "Standard_E4-2ds_v5": 0.348000, - "Standard_E4-2s_v3": 0.319000, - "Standard_E4-2s_v4": 0.302000, - "Standard_E4-2s_v5": 0.302000, - "Standard_E48_v3": 3.623000, - "Standard_E48_v4": 3.624000, - "Standard_E48_v5": 3.624000, - "Standard_E48a_v4": 3.624000, - "Standard_E48ads_v5": 3.816000, - "Standard_E48as_v4": 3.624000, - "Standard_E48bds_v5": 4.824000, - "Standard_E48bs_v5": 4.272000, - "Standard_E48d_v4": 4.176000, - "Standard_E48d_v5": 4.176000, - "Standard_E48ds_v4": 4.176000, - "Standard_E48ds_v5": 4.176000, - "Standard_E48s_v3": 3.623000, - "Standard_E48s_v4": 3.624000, - "Standard_E48s_v5": 3.624000, - "Standard_E4_v3": 0.319000, - "Standard_E4_v4": 0.302000, - "Standard_E4_v5": 0.302000, - "Standard_E4a_v4": 0.302000, - "Standard_E4ads_v5": 0.318000, - "Standard_E4as_v4": 0.302000, - "Standard_E4as_v5": 0.272000, - "Standard_E4bds_v5": 0.402000, - "Standard_E4bs_v5": 0.356000, - "Standard_E4d_v4": 0.348000, - "Standard_E4d_v5": 0.348000, - "Standard_E4ds_v4": 0.348000, - "Standard_E4ds_v5": 0.348000, - "Standard_E4s_v3": 0.319000, - "Standard_E4s_v4": 0.302000, - "Standard_E4s_v5": 0.302000, - "Standard_E64-16ads_v5": 5.088000, - "Standard_E64-16as_v5": 4.352000, - "Standard_E64-16ds_v4": 5.568000, - "Standard_E64-16ds_v5": 5.568000, - "Standard_E64-16s_v3": 4.347000, - "Standard_E64-16s_v4": 4.832000, - "Standard_E64-16s_v5": 4.832000, - "Standard_E64-32ads_v5": 5.088000, - "Standard_E64-32as_v4": 4.832000, - "Standard_E64-32as_v5": 4.352000, - "Standard_E64-32ds_v4": 5.568000, - "Standard_E64-32ds_v5": 5.568000, - "Standard_E64-32s_v3": 4.347000, - "Standard_E64-32s_v4": 4.832000, - "Standard_E64-32s_v5": 4.832000, - "Standard_E64_v3": 4.347000, - "Standard_E64_v4": 4.832000, - "Standard_E64_v5": 4.832000, - "Standard_E64ads_v5": 5.088000, - "Standard_E64as_v4": 4.832000, - "Standard_E64bds_v5": 6.432000, - "Standard_E64bs_v5": 5.696000, - "Standard_E64d_v4": 5.568000, - "Standard_E64d_v5": 5.568000, - "Standard_E64ds_v4": 5.568000, - "Standard_E64ds_v5": 5.568000, - "Standard_E64s_v3": 4.347000, - "Standard_E64s_v4": 4.832000, - "Standard_E64s_v5": 4.832000, - "Standard_E8-2ads_v5": 0.636000, - "Standard_E8-2as_v4": 0.604000, - "Standard_E8-2as_v5": 0.544000, - "Standard_E8-2ds_v4": 0.696000, - "Standard_E8-2ds_v5": 0.696000, - "Standard_E8-2s_v3": 0.638000, - "Standard_E8-2s_v4": 0.604000, - "Standard_E8-2s_v5": 0.604000, - "Standard_E8-4ads_v5": 0.636000, - "Standard_E8-4as_v4": 0.604000, - "Standard_E8-4as_v5": 0.544000, - "Standard_E8-4ds_v4": 0.696000, - "Standard_E8-4ds_v5": 0.696000, - "Standard_E8-4s_v3": 0.638000, - "Standard_E8-4s_v4": 0.604000, - "Standard_E8-4s_v5": 0.604000, - "Standard_E80ids_v4": 6.960000, - "Standard_E80is_v4": 6.040000, - "Standard_E8_v3": 0.638000, - "Standard_E8_v4": 0.604000, - "Standard_E8_v5": 0.604000, - "Standard_E8a_v4": 0.604000, - "Standard_E8ads_v5": 0.636000, - "Standard_E8as_v4": 0.604000, - "Standard_E8as_v5": 0.544000, - "Standard_E8bds_v5": 0.804000, - "Standard_E8bs_v5": 0.712000, - "Standard_E8d_v4": 0.696000, - "Standard_E8d_v5": 0.696000, - "Standard_E8ds_v4": 0.696000, - "Standard_E8ds_v5": 0.696000, - "Standard_E8s_v3": 0.638000, - "Standard_E8s_v4": 0.604000, - "Standard_E8s_v5": 0.604000, - "Standard_E96-24as_v4": 7.248000, - "Standard_E96-24as_v5": 6.528000, - "Standard_E96-24ds_v5": 8.352000, - "Standard_E96-24s_v5": 7.248000, - "Standard_E96-48ads_v5": 7.632000, - "Standard_E96-48as_v4": 7.248000, - "Standard_E96-48as_v5": 6.528000, - "Standard_E96-48ds_v5": 8.352000, - "Standard_E96-48s_v5": 7.248000, - "Standard_E96_v5": 7.248000, - "Standard_E96a_v4": 7.248000, - "Standard_E96ads_v5": 7.632000, - "Standard_E96as_v4": 7.248000, - "Standard_E96as_v5": 6.528000, - "Standard_E96bds_v5": 9.648000, - "Standard_E96bs_v5": 8.544000, - "Standard_E96ds_v5": 8.352000, - "Standard_E96iads_v5": 8.395000, - "Standard_E96ias_v4": 7.248000, - "Standard_E96ias_v5": 7.181000, - "Standard_E96s_v5": 7.248000, - "Standard_F1": 0.065000, - "Standard_F16": 1.042000, - "Standard_F16s": 1.042000, - "Standard_F16s_v2": 0.888000, - "Standard_F1s": 0.065000, - "Standard_F2": 0.130000, - "Standard_F2s": 0.130000, - "Standard_F2s_v2": 0.111000, - "Standard_F32s_v2": 1.776000, - "Standard_F4": 0.260000, - "Standard_F48s_v2": 2.664000, - "Standard_F4s": 0.260000, - "Standard_F4s_v2": 0.222000, - "Standard_F64s_v2": 3.552000, - "Standard_F72s_v2": 3.996000, - "Standard_F8": 0.521000, - "Standard_F8s": 0.521000, - "Standard_F8s_v2": 0.444000, - "Standard_L16as_v3": 1.496000, - "Standard_L16s_v3": 1.672000, - "Standard_L32as_v3": 2.992000, - "Standard_L32s_v3": 3.344000, - "Standard_L48as_v3": 4.488000, - "Standard_L48s_v3": 5.016000, - "Standard_L64as_v3": 5.984000, - "Standard_L64s_v3": 6.688000, - "Standard_L80as_v3": 7.480000, - "Standard_L80s_v3": 8.360000, - "Standard_L8as_v3": 0.748000, - "Standard_L8s_v3": 0.836000, - "Standard_M128": 19.340000, - "Standard_M128-32ms": 38.697600, - "Standard_M128-64ms": 38.697600, - "Standard_M128dms_v2": 38.700000, - "Standard_M128ds_v2": 19.340000, - "Standard_M128m": 38.697600, - "Standard_M128ms": 38.697600, - "Standard_M128ms_v2": 38.090000, - "Standard_M128s_v2": 18.730000, - "Standard_M16-4ms": 4.455900, - "Standard_M16-8ms": 4.455900, - "Standard_M16ms": 4.455900, - "Standard_M16s": 3.461000, - "Standard_M192idms_v2": 46.490000, - "Standard_M192ids_v2": 23.250000, - "Standard_M192ims_v2": 45.880000, - "Standard_M192is_v2": 22.640000, - "Standard_M208-104ms_v2": 64.699000, - "Standard_M208-104s_v2": 32.350000, - "Standard_M208-52ms_v2": 64.699000, - "Standard_M208-52s_v2": 32.350000, - "Standard_M208ms_v2": 64.699000, - "Standard_M208s_v2": 32.350000, - "Standard_M32-16ms": 8.911700, - "Standard_M32-8ms": 8.911700, - "Standard_M32dms_v2": 8.910000, - "Standard_M32ms": 8.911700, - "Standard_M32ms_v2": 8.760000, - "Standard_M32s": 4.835800, - "Standard_M32ts": 3.248000, - "Standard_M416-104ms_v2": 143.770000, - "Standard_M416-104s_v2": 71.891000, - "Standard_M416-208ms_v2": 143.770000, - "Standard_M416-208s_v2": 71.891000, - "Standard_M416is_v2": 71.891000, - "Standard_M416ms_v2": 143.770000, - "Standard_M416s_8_v2": 95.860000, - "Standard_M416s_v2": 71.891000, - "Standard_M64": 9.670000, - "Standard_M64-16ms": 14.989000, - "Standard_M64-32ms": 14.989000, - "Standard_M64dms_v2": 14.990000, - "Standard_M64ds_v2": 9.670000, - "Standard_M64ls": 6.498000, - "Standard_M64ms_v2": 14.690000, - "Standard_M64s": 9.670000, - "Standard_M64s_v2": 9.370000, - "Standard_M8-4ms": 2.227900, - "Standard_M8ms": 2.227900, - "Standard_NC16as_T4_v3": 1.565000, - "Standard_NC4as_T4_v3": 0.684000, - "Standard_NC64as_T4_v3": 5.645000, - "Standard_NC8as_T4_v3": 0.977000, - } - // australiacentral2 - initialOnDemandPrices["australiacentral2"] = map[string]float64{ - "Basic_A0": 0.024000, - "Basic_A1": 0.032000, - "Basic_A2": 0.098000, - "Basic_A3": 0.232000, - "Basic_A4": 0.464000, - "Dadsv5_Type1": 8.008000, - "Dasv4_Type1": 6.600000, - "Dasv4_Type2": 6.600000, - "Dasv5_Type1": 6.653000, - "Ddsv4_Type 1": 4.998000, - "Ddsv4_Type2": 5.936000, - "Ddsv5_Type1": 7.498000, - "Dsv3_Type3": 6.599000, - "Dsv3_Type4": 8.249000, - "Dsv4_Type1": 5.280000, - "Dsv4_Type2": 6.336000, - "Dsv5_Type1": 6.600000, - "Eadsv5_Type1": 8.395000, - "Easv4_Type1": 7.973000, - "Easv4_Type2": 7.973000, - "Easv5_Type1": 7.181000, - "Ebdsv5-Type1": 7.075000, - "Ebsv5-Type1": 6.266000, - "Edsv4_Type 1": 6.125000, - "Edsv4_Type2": 9.008000, - "Edsv5_Type1": 9.187000, - "Esv3_Type3": 6.434000, - "Esv3_Type4": 8.717000, - "Esv4_Type1": 5.315000, - "Esv4_Type2": 6.976000, - "Fsv2_Type2": 4.396000, - "Lasv3_Type1": 8.228000, - "Lsv3_Type1": 9.196000, - "Msmv2_Type1": 158.140000, - "Msv2_Type1": 79.080000, - "Standard_A0": 0.029000, - "Standard_A1": 0.071000, - "Standard_A1_v2": 0.050000, - "Standard_A2": 0.142000, - "Standard_A2_v2": 0.106000, - "Standard_A2m_v2": 0.149000, - "Standard_A3": 0.284000, - "Standard_A4": 0.568000, - "Standard_A4_v2": 0.222000, - "Standard_A4m_v2": 0.312000, - "Standard_A5": 0.278000, - "Standard_A6": 0.556000, - "Standard_A7": 1.112000, - "Standard_A8_v2": 0.467000, - "Standard_A8m_v2": 0.655000, - "Standard_B12ms": 0.634000, - "Standard_B16als_v2": 0.673000, - "Standard_B16as_v2": 0.760000, - "Standard_B16ls_v2": 0.822000, - "Standard_B16ms": 0.845000, - "Standard_B16s_v2": 0.918000, - "Standard_B1ls": 0.006600, - "Standard_B1ms": 0.026400, - "Standard_B1s": 0.013200, - "Standard_B20ms": 1.056000, - "Standard_B2als_v2": 0.047500, - "Standard_B2as_v2": 0.095000, - "Standard_B2ats_v2": 0.021100, - "Standard_B2ls_v2": 0.062000, - "Standard_B2ms": 0.106000, - "Standard_B2s": 0.052800, - "Standard_B2s_v2": 0.106000, - "Standard_B2ts_v2": 0.022400, - "Standard_B32als_v2": 1.493000, - "Standard_B32as_v2": 1.520000, - "Standard_B32ls_v2": 1.496000, - "Standard_B32s_v2": 1.690000, - "Standard_B4als_v2": 0.168000, - "Standard_B4as_v2": 0.208000, - "Standard_B4ls_v2": 0.206000, - "Standard_B4ms": 0.211000, - "Standard_B4s_v2": 0.230000, - "Standard_B8als_v2": 0.337000, - "Standard_B8as_v2": 0.417000, - "Standard_B8ls_v2": 0.411000, - "Standard_B8ms": 0.422000, - "Standard_B8s_v2": 0.459000, - "Standard_D11_v2": 0.200000, - "Standard_D11_v2_Promo": 0.249000, - "Standard_D12_v2_Promo": 0.498750, - "Standard_D13_v2": 0.798000, - "Standard_D13_v2_Promo": 0.997000, - "Standard_D14_v2": 1.596000, - "Standard_D14_v2_Promo": 1.995000, - "Standard_D15i_v2": 1.995000, - "Standard_D16_v3": 1.000000, - "Standard_D16_v4": 0.960000, - "Standard_D16_v5": 0.960000, - "Standard_D16a_v4": 0.960000, - "Standard_D16ads_v5": 1.040000, - "Standard_D16as_v4": 0.960000, - "Standard_D16as_v5": 0.864000, - "Standard_D16d_v5": 1.136000, - "Standard_D16ds_v4": 1.136000, - "Standard_D16ds_v5": 1.136000, - "Standard_D16lds_v5": 1.008000, - "Standard_D16ls_v5": 0.888000, - "Standard_D16s_v3": 1.000000, - "Standard_D16s_v4": 0.960000, - "Standard_D16s_v5": 0.960000, - "Standard_D1_v2": 0.084000, - "Standard_D2_v2": 0.168000, - "Standard_D2_v2_Promo": 0.210000, - "Standard_D2_v3": 0.125000, - "Standard_D2_v4": 0.120000, - "Standard_D2_v5": 0.120000, - "Standard_D2a_v4": 0.120000, - "Standard_D2ads_v5": 0.130000, - "Standard_D2as_v4": 0.120000, - "Standard_D2as_v5": 0.108000, - "Standard_D2d_v4": 0.142000, - "Standard_D2d_v5": 0.142000, - "Standard_D2ds_v4": 0.142000, - "Standard_D2ds_v5": 0.142000, - "Standard_D2lds_v5": 0.126000, - "Standard_D2ls_v5": 0.111000, - "Standard_D2s_v3": 0.125000, - "Standard_D2s_v4": 0.120000, - "Standard_D2s_v5": 0.120000, - "Standard_D32-16s_v3": 2.000000, - "Standard_D32-8s_v3": 2.000000, - "Standard_D32_v3": 2.000000, - "Standard_D32_v4": 1.920000, - "Standard_D32_v5": 1.920000, - "Standard_D32a_v4": 1.920000, - "Standard_D32ads_v5": 2.080000, - "Standard_D32as_v4": 1.920000, - "Standard_D32as_v5": 1.728000, - "Standard_D32d_v4": 2.272000, - "Standard_D32d_v5": 2.272000, - "Standard_D32ds_v4": 2.272000, - "Standard_D32lds_v5": 2.016000, - "Standard_D32ls_v5": 1.776000, - "Standard_D32s_v3": 2.000000, - "Standard_D32s_v4": 1.920000, - "Standard_D3_v2": 0.336000, - "Standard_D3_v2_Promo": 0.420000, - "Standard_D48_v3": 3.000000, - "Standard_D48_v4": 2.880000, - "Standard_D48_v5": 2.880000, - "Standard_D48a_v4": 2.880000, - "Standard_D48ads_v5": 3.120000, - "Standard_D48as_v4": 2.880000, - "Standard_D48as_v5": 2.592000, - "Standard_D48d_v4": 3.408000, - "Standard_D48d_v5": 3.408000, - "Standard_D48ds_v4": 3.408000, - "Standard_D48ds_v5": 3.408000, - "Standard_D48lds_v5": 3.024000, - "Standard_D48ls_v5": 2.664000, - "Standard_D48s_v3": 3.000000, - "Standard_D48s_v4": 2.880000, - "Standard_D48s_v5": 2.880000, - "Standard_D4_v2": 0.673000, - "Standard_D4_v2_Promo": 0.841000, - "Standard_D4_v3": 0.250000, - "Standard_D4_v4": 0.240000, - "Standard_D4_v5": 0.240000, - "Standard_D4a_v4": 0.240000, - "Standard_D4as_v4": 0.240000, - "Standard_D4as_v5": 0.216000, - "Standard_D4d_v4": 0.284000, - "Standard_D4d_v5": 0.284000, - "Standard_D4ds_v4": 0.284000, - "Standard_D4ds_v5": 0.284000, - "Standard_D4lds_v5": 0.252000, - "Standard_D4ls_v5": 0.222000, - "Standard_D4s_v3": 0.250000, - "Standard_D4s_v4": 0.240000, - "Standard_D4s_v5": 0.240000, - "Standard_D5_v2": 1.345000, - "Standard_D5_v2_Promo": 1.681000, - "Standard_D64-16s_v3": 4.000000, - "Standard_D64_v3": 4.000000, - "Standard_D64_v4": 3.840000, - "Standard_D64_v5": 3.840000, - "Standard_D64a_v4": 3.840000, - "Standard_D64ads_v5": 4.160000, - "Standard_D64as_v4": 3.840000, - "Standard_D64as_v5": 3.456000, - "Standard_D64d_v4": 4.544000, - "Standard_D64d_v5": 4.544000, - "Standard_D64ds_v4": 4.544000, - "Standard_D64ds_v5": 4.544000, - "Standard_D64lds_v5": 4.032000, - "Standard_D64ls_v5": 3.552000, - "Standard_D64s_v3": 4.000000, - "Standard_D64s_v4": 3.840000, - "Standard_D64s_v5": 3.840000, - "Standard_D8_v3": 0.500000, - "Standard_D8_v4": 0.480000, - "Standard_D8_v5": 0.480000, - "Standard_D8a_v4": 0.480000, - "Standard_D8ads_v5": 0.520000, - "Standard_D8as_v4": 0.480000, - "Standard_D8as_v5": 0.432000, - "Standard_D8d_v4": 0.568000, - "Standard_D8d_v5": 0.568000, - "Standard_D8ds_v4": 0.568000, - "Standard_D8ds_v5": 0.568000, - "Standard_D8lds_v5": 0.504000, - "Standard_D8ls_v5": 0.444000, - "Standard_D8s_v3": 0.500000, - "Standard_D8s_v4": 0.480000, - "Standard_D8s_v5": 0.480000, - "Standard_D96_v5": 5.760000, - "Standard_D96a_v4": 5.760000, - "Standard_D96ads_v5": 6.240000, - "Standard_D96as_v4": 5.760000, - "Standard_D96as_v5": 5.184000, - "Standard_D96d_v5": 6.816000, - "Standard_D96ds_v5": 6.816000, - "Standard_D96lds_v5": 6.048000, - "Standard_D96ls_v5": 5.328000, - "Standard_D96s_v5": 5.760000, - "Standard_DS11-1_v2": 0.200000, - "Standard_DS11_v2": 0.200000, - "Standard_DS11_v2_Promo": 0.249000, - "Standard_DS12-1_v2": 0.399000, - "Standard_DS12-2_v2": 0.399000, - "Standard_DS12_v2": 0.399000, - "Standard_DS12_v2_Promo": 0.498750, - "Standard_DS13-2_v2": 0.798000, - "Standard_DS13-4_v2": 0.798000, - "Standard_DS13_v2": 0.798000, - "Standard_DS13_v2_Promo": 0.997000, - "Standard_DS14-4_v2": 1.596000, - "Standard_DS14-8_v2": 1.596000, - "Standard_DS14_v2": 1.596000, - "Standard_DS14_v2_Promo": 1.995000, - "Standard_DS15_v2": 1.995000, - "Standard_DS15i_v2": 1.995000, - "Standard_DS1_v2": 0.084000, - "Standard_DS2_v2": 0.168000, - "Standard_DS2_v2_Promo": 0.210000, - "Standard_DS3_v2": 0.336000, - "Standard_DS3_v2_Promo": 0.420000, - "Standard_DS4_v2": 0.673000, - "Standard_DS4_v2_Promo": 0.841000, - "Standard_DS5_v2": 1.345000, - "Standard_DS5_v2_Promo": 1.681000, - "Standard_E104i_v5": 8.637000, - "Standard_E104id_v5": 9.953000, - "Standard_E104ids_v5": 9.953000, - "Standard_E104is_v5": 8.637000, - "Standard_E112iads_v5": 9.794000, - "Standard_E112ias_v5": 8.378000, - "Standard_E112ibds_v5": 12.382000, - "Standard_E112ibs_v5": 10.965000, - "Standard_E16-4ads_v5": 1.272000, - "Standard_E16-4as_v4": 1.208000, - "Standard_E16-4ds_v4": 1.392000, - "Standard_E16-4ds_v5": 1.392000, - "Standard_E16-4s_v3": 1.277000, - "Standard_E16-4s_v4": 1.208000, - "Standard_E16-4s_v5": 1.208000, - "Standard_E16-8ads_v5": 1.272000, - "Standard_E16-8as_v5": 1.088000, - "Standard_E16-8ds_v4": 1.392000, - "Standard_E16-8ds_v5": 1.392000, - "Standard_E16-8s_v3": 1.277000, - "Standard_E16-8s_v4": 1.208000, - "Standard_E16-8s_v5": 1.208000, - "Standard_E16_v3": 1.277000, - "Standard_E16_v4": 1.208000, - "Standard_E16_v5": 1.208000, - "Standard_E16a_v4": 1.208000, - "Standard_E16ads_v5": 1.272000, - "Standard_E16as_v4": 1.208000, - "Standard_E16bds_v5": 1.608000, - "Standard_E16bs_v5": 1.424000, - "Standard_E16d_v4": 1.392000, - "Standard_E16d_v5": 1.392000, - "Standard_E16ds_v4": 1.392000, - "Standard_E16ds_v5": 1.392000, - "Standard_E16s_v3": 1.277000, - "Standard_E16s_v4": 1.208000, - "Standard_E20_v3": 1.509000, - "Standard_E20_v4": 1.510000, - "Standard_E20_v5": 1.510000, - "Standard_E20a_v4": 1.510000, - "Standard_E20ads_v5": 1.590000, - "Standard_E20as_v5": 1.360000, - "Standard_E20d_v4": 1.740000, - "Standard_E20ds_v4": 1.740000, - "Standard_E20ds_v5": 1.740000, - "Standard_E20s_v3": 1.509000, - "Standard_E20s_v4": 1.510000, - "Standard_E20s_v5": 1.510000, - "Standard_E2_v3": 0.160000, - "Standard_E2_v4": 0.151000, - "Standard_E2_v5": 0.151000, - "Standard_E2a_v4": 0.151000, - "Standard_E2ads_v5": 0.159000, - "Standard_E2as_v4": 0.151000, - "Standard_E2as_v5": 0.136000, - "Standard_E2bds_v5": 0.201000, - "Standard_E2bs_v5": 0.178000, - "Standard_E2d_v5": 0.174000, - "Standard_E2ds_v4": 0.174000, - "Standard_E2ds_v5": 0.174000, - "Standard_E2s_v4": 0.151000, - "Standard_E2s_v5": 0.151000, - "Standard_E32-16ads_v5": 2.544000, - "Standard_E32-16as_v4": 2.416000, - "Standard_E32-16as_v5": 2.176000, - "Standard_E32-16ds_v4": 2.784000, - "Standard_E32-16ds_v5": 2.784000, - "Standard_E32-16s_v3": 2.554000, - "Standard_E32-16s_v4": 2.416000, - "Standard_E32-16s_v5": 2.416000, - "Standard_E32-8ads_v5": 2.544000, - "Standard_E32-8as_v4": 2.416000, - "Standard_E32-8as_v5": 2.176000, - "Standard_E32-8ds_v4": 2.784000, - "Standard_E32-8ds_v5": 2.784000, - "Standard_E32-8s_v3": 2.554000, - "Standard_E32-8s_v4": 2.416000, - "Standard_E32-8s_v5": 2.416000, - "Standard_E32_v3": 2.554000, - "Standard_E32_v4": 2.416000, - "Standard_E32_v5": 2.416000, - "Standard_E32a_v4": 2.416000, - "Standard_E32ads_v5": 2.544000, - "Standard_E32as_v4": 2.416000, - "Standard_E32bds_v5": 3.216000, - "Standard_E32bs_v5": 2.848000, - "Standard_E32d_v4": 2.784000, - "Standard_E32d_v5": 2.784000, - "Standard_E32ds_v4": 2.784000, - "Standard_E32ds_v5": 2.784000, - "Standard_E32s_v3": 2.554000, - "Standard_E32s_v4": 2.416000, - "Standard_E32s_v5": 2.416000, - "Standard_E4-2ads_v5": 0.318000, - "Standard_E4-2as_v4": 0.302000, - "Standard_E4-2as_v5": 0.272000, - "Standard_E4-2ds_v4": 0.348000, - "Standard_E4-2ds_v5": 0.348000, - "Standard_E4-2s_v3": 0.319000, - "Standard_E4-2s_v4": 0.302000, - "Standard_E4-2s_v5": 0.302000, - "Standard_E48_v3": 3.623000, - "Standard_E48_v4": 3.624000, - "Standard_E48_v5": 3.624000, - "Standard_E48a_v4": 3.624000, - "Standard_E48ads_v5": 3.816000, - "Standard_E48as_v5": 3.264000, - "Standard_E48bds_v5": 4.824000, - "Standard_E48bs_v5": 4.272000, - "Standard_E48d_v4": 4.176000, - "Standard_E48d_v5": 4.176000, - "Standard_E48ds_v4": 4.176000, - "Standard_E48ds_v5": 4.176000, - "Standard_E48s_v3": 3.623000, - "Standard_E48s_v4": 3.624000, - "Standard_E48s_v5": 3.624000, - "Standard_E4_v3": 0.319000, - "Standard_E4_v4": 0.302000, - "Standard_E4_v5": 0.302000, - "Standard_E4a_v4": 0.302000, - "Standard_E4ads_v5": 0.318000, - "Standard_E4as_v4": 0.302000, - "Standard_E4as_v5": 0.272000, - "Standard_E4bds_v5": 0.402000, - "Standard_E4bs_v5": 0.356000, - "Standard_E4d_v4": 0.348000, - "Standard_E4d_v5": 0.348000, - "Standard_E4ds_v5": 0.348000, - "Standard_E4s_v3": 0.319000, - "Standard_E4s_v4": 0.302000, - "Standard_E4s_v5": 0.302000, - "Standard_E64-16ads_v5": 5.088000, - "Standard_E64-16as_v4": 4.832000, - "Standard_E64-16as_v5": 4.352000, - "Standard_E64-16ds_v4": 5.568000, - "Standard_E64-16ds_v5": 5.568000, - "Standard_E64-16s_v3": 4.347000, - "Standard_E64-16s_v4": 4.832000, - "Standard_E64-16s_v5": 4.832000, - "Standard_E64-32ads_v5": 5.088000, - "Standard_E64-32as_v4": 4.832000, - "Standard_E64-32as_v5": 4.352000, - "Standard_E64-32ds_v4": 5.568000, - "Standard_E64-32ds_v5": 5.568000, - "Standard_E64-32s_v3": 4.347000, - "Standard_E64-32s_v4": 4.832000, - "Standard_E64-32s_v5": 4.832000, - "Standard_E64_v3": 4.347000, - "Standard_E64_v4": 4.832000, - "Standard_E64_v5": 4.832000, - "Standard_E64a_v4": 4.832000, - "Standard_E64ads_v5": 5.088000, - "Standard_E64as_v4": 4.832000, - "Standard_E64as_v5": 4.352000, - "Standard_E64bds_v5": 6.432000, - "Standard_E64bs_v5": 5.696000, - "Standard_E64d_v4": 5.568000, - "Standard_E64d_v5": 5.568000, - "Standard_E64ds_v4": 5.568000, - "Standard_E64ds_v5": 5.568000, - "Standard_E64s_v3": 4.347000, - "Standard_E64s_v4": 4.832000, - "Standard_E64s_v5": 4.832000, - "Standard_E8-2ads_v5": 0.636000, - "Standard_E8-2as_v4": 0.604000, - "Standard_E8-2as_v5": 0.544000, - "Standard_E8-2ds_v4": 0.696000, - "Standard_E8-2ds_v5": 0.696000, - "Standard_E8-2s_v3": 0.638000, - "Standard_E8-2s_v4": 0.604000, - "Standard_E8-2s_v5": 0.604000, - "Standard_E8-4ads_v5": 0.636000, - "Standard_E8-4as_v4": 0.604000, - "Standard_E8-4as_v5": 0.544000, - "Standard_E8-4ds_v4": 0.696000, - "Standard_E8-4ds_v5": 0.696000, - "Standard_E8-4s_v3": 0.638000, - "Standard_E8-4s_v4": 0.604000, - "Standard_E8-4s_v5": 0.604000, - "Standard_E80ids_v4": 6.960000, - "Standard_E80is_v4": 6.040000, - "Standard_E8_v3": 0.638000, - "Standard_E8_v4": 0.604000, - "Standard_E8_v5": 0.604000, - "Standard_E8a_v4": 0.604000, - "Standard_E8ads_v5": 0.636000, - "Standard_E8as_v4": 0.604000, - "Standard_E8as_v5": 0.544000, - "Standard_E8bds_v5": 0.804000, - "Standard_E8bs_v5": 0.712000, - "Standard_E8d_v4": 0.696000, - "Standard_E8d_v5": 0.696000, - "Standard_E8ds_v4": 0.696000, - "Standard_E8ds_v5": 0.696000, - "Standard_E8s_v3": 0.638000, - "Standard_E8s_v4": 0.604000, - "Standard_E8s_v5": 0.604000, - "Standard_E96-24ads_v5": 7.632000, - "Standard_E96-24as_v5": 6.528000, - "Standard_E96-24ds_v5": 8.352000, - "Standard_E96-48ads_v5": 7.632000, - "Standard_E96-48as_v4": 7.248000, - "Standard_E96-48as_v5": 6.528000, - "Standard_E96-48ds_v5": 8.352000, - "Standard_E96-48s_v5": 7.248000, - "Standard_E96_v5": 7.248000, - "Standard_E96a_v4": 7.248000, - "Standard_E96ads_v5": 7.632000, - "Standard_E96as_v4": 7.248000, - "Standard_E96as_v5": 6.528000, - "Standard_E96bds_v5": 9.648000, - "Standard_E96bs_v5": 8.544000, - "Standard_E96d_v5": 8.352000, - "Standard_E96ds_v5": 8.352000, - "Standard_E96ias_v4": 7.248000, - "Standard_E96ias_v5": 7.181000, - "Standard_E96s_v5": 7.248000, - "Standard_F1": 0.065000, - "Standard_F16": 1.042000, - "Standard_F16s": 1.042000, - "Standard_F16s_v2": 0.888000, - "Standard_F1s": 0.065000, - "Standard_F2": 0.130000, - "Standard_F2s": 0.130000, - "Standard_F2s_v2": 0.111000, - "Standard_F32s_v2": 1.776000, - "Standard_F4": 0.260000, - "Standard_F48s_v2": 2.664000, - "Standard_F4s": 0.260000, - "Standard_F4s_v2": 0.222000, - "Standard_F64s_v2": 3.552000, - "Standard_F72s_v2": 3.996000, - "Standard_F8": 0.521000, - "Standard_F8s": 0.521000, - "Standard_F8s_v2": 0.444000, - "Standard_L16as_v3": 1.496000, - "Standard_L16s_v3": 1.672000, - "Standard_L32as_v3": 2.992000, - "Standard_L32s_v3": 3.344000, - "Standard_L48as_v3": 4.488000, - "Standard_L48s_v3": 5.016000, - "Standard_L64as_v3": 5.984000, - "Standard_L64s_v3": 6.688000, - "Standard_L80as_v3": 7.480000, - "Standard_L80s_v3": 8.360000, - "Standard_L8as_v3": 0.748000, - "Standard_L8s_v3": 0.836000, - "Standard_M128": 19.340000, - "Standard_M128-32ms": 38.697600, - "Standard_M128-64ms": 38.697600, - "Standard_M128m": 38.697600, - "Standard_M128ms": 38.697600, - "Standard_M128s": 19.340000, - "Standard_M16-4ms": 4.455900, - "Standard_M16-8ms": 4.455900, - "Standard_M16ms": 4.455900, - "Standard_M16s": 3.461000, - "Standard_M208-104ms_v2": 64.699000, - "Standard_M208-104s_v2": 32.350000, - "Standard_M208-52ms_v2": 64.699000, - "Standard_M208-52s_v2": 32.350000, - "Standard_M208ms_v2": 64.699000, - "Standard_M208s_v2": 32.350000, - "Standard_M32-16ms": 8.911700, - "Standard_M32-8ms": 8.911700, - "Standard_M32ls": 3.447600, - "Standard_M32ms": 8.911700, - "Standard_M32s": 4.835800, - "Standard_M32ts": 3.248000, - "Standard_M416-104ms_v2": 143.770000, - "Standard_M416-104s_v2": 71.891000, - "Standard_M416-208ms_v2": 143.770000, - "Standard_M416-208s_v2": 71.891000, - "Standard_M416is_v2": 71.891000, - "Standard_M416ms_v2": 143.770000, - "Standard_M416s_8_v2": 95.860000, - "Standard_M416s_v2": 71.891000, - "Standard_M64": 9.670000, - "Standard_M64-16ms": 14.989000, - "Standard_M64-32ms": 14.989000, - "Standard_M64ls": 6.498000, - "Standard_M64m": 14.989000, - "Standard_M64ms": 14.989000, - "Standard_M64s": 9.670000, - "Standard_M8-2ms": 2.227900, - "Standard_M8-4ms": 2.227900, - "Standard_NC16as_T4_v3": 1.565000, - "Standard_NC4as_T4_v3": 0.684000, - "Standard_NC64as_T4_v3": 5.645000, - "Standard_NC8as_T4_v3": 0.977000, - } - // australiaeast - initialOnDemandPrices["australiaeast"] = map[string]float64{ - "DCdsv3 Type1": 7.498000, - "Dasv4_Type2": 6.600000, - "Ddsv5_Type1": 7.498000, - "Dsv3_Type3": 5.280000, - "Dsv4_Type2": 6.336000, - "Eadsv5_Type1": 8.395000, - "Easv4_Type1": 7.973000, - "Easv4_Type2": 7.973000, - "Ebsv5-Type1": 6.266000, - "Esv3_Type3": 5.148000, - "Esv4_Type1": 5.315000, - "Fsv2 Type3": 5.128000, - "Fsv2_Type2": 4.396000, - "Lsv2_Type1": 8.228000, - "Lsv3_Type1": 9.196000, - "Msmv2_Type1": 158.140000, - "Msv2MedMem Type1": 20.606000, - "Standard_A1_v2": 0.050000, - "Standard_A3": 0.284000, - "Standard_B16als_v2": 0.747000, - "Standard_B16as_v2": 0.834000, - "Standard_B1ms": 0.026400, - "Standard_B2ls_v2": 0.062000, - "Standard_B2ps_v2": 0.084800, - "Standard_B2pts_v2": 0.019800, - "Standard_B2s": 0.052800, - "Standard_B32s_v2": 1.690000, - "Standard_B4als_v2": 0.168000, - "Standard_B4ls_v2": 0.187000, - "Standard_B4ms": 0.211000, - "Standard_B4pls_v2": 0.169000, - "Standard_B8ls_v2": 0.411000, - "Standard_B8pls_v2": 0.300000, - "Standard_D1": 0.093000, - "Standard_D15_v2": 1.995000, - "Standard_D16d_v4": 1.136000, - "Standard_D16d_v5": 1.136000, - "Standard_D16ds_v4": 1.136000, - "Standard_D16pds_v5": 0.912000, - "Standard_D2_v2": 0.168000, - "Standard_D2as_v4": 0.120000, - "Standard_D2s_v3": 0.125000, - "Standard_D2s_v5": 0.120000, - "Standard_D3": 0.372000, - "Standard_D32-16s_v3": 2.000000, - "Standard_D32_v4": 1.920000, - "Standard_D32ads_v5": 2.080000, - "Standard_D32s_v5": 1.920000, - "Standard_D48_v4": 2.880000, - "Standard_D48lds_v5": 3.024000, - "Standard_D48ls_v5": 2.664000, - "Standard_D48ps_v5": 2.304000, - "Standard_D48s_v4": 2.880000, - "Standard_D4_v2": 0.673000, - "Standard_D4_v4": 0.240000, - "Standard_D4ads_v5": 0.260000, - "Standard_D5_v2": 1.345000, - "Standard_D5_v2_Promo": 1.345000, - "Standard_D64a_v4": 3.840000, - "Standard_D64ds_v4": 4.544000, - "Standard_D64plds_v5": 3.232000, - "Standard_D8_v4": 0.480000, - "Standard_D8as_v4": 0.480000, - "Standard_D8ds_v4": 0.568000, - "Standard_D8lds_v5": 0.504000, - "Standard_D8ps_v5": 0.384000, - "Standard_D96ls_v5": 5.328000, - "Standard_DC24ds_v3": 3.408000, - "Standard_DC24s_v3": 2.880000, - "Standard_DC32ds_v3": 4.544000, - "Standard_DC48ds_v3": 6.816000, - "Standard_DC4s_v2": 0.480000, - "Standard_DS1": 0.093000, - "Standard_DS11_v2_Promo": 0.200000, - "Standard_DS13": 0.840000, - "Standard_DS13-4_v2": 0.798000, - "Standard_DS13_v2_Promo": 0.798000, - "Standard_DS14-4_v2": 1.596000, - "Standard_DS2": 0.186000, - "Standard_DS4_v2": 0.673000, - "Standard_DS5_v2": 1.345000, - "Standard_E104i_v5": 8.637000, - "Standard_E104ids_v5": 9.953000, - "Standard_E112iads_v5": 9.794000, - "Standard_E16-4ds_v4": 1.392000, - "Standard_E16-4ds_v5": 1.392000, - "Standard_E16-4s_v5": 1.208000, - "Standard_E16_v3": 1.277000, - "Standard_E16ads_v5": 1.272000, - "Standard_E16d_v4": 1.392000, - "Standard_E16d_v5": 1.392000, - "Standard_E16s_v3": 1.277000, - "Standard_E16s_v4": 1.208000, - "Standard_E20_v5": 1.510000, - "Standard_E20ds_v4": 1.740000, - "Standard_E20ds_v5": 1.740000, - "Standard_E20pds_v5": 1.390000, - "Standard_E20ps_v5": 1.208000, - "Standard_E20s_v3": 1.509000, - "Standard_E20s_v4": 1.510000, - "Standard_E2_v3": 0.160000, - "Standard_E2a_v4": 0.151000, - "Standard_E2ads_v5": 0.159000, - "Standard_E2as_v5": 0.136000, - "Standard_E2d_v5": 0.174000, - "Standard_E32-16as_v4": 2.416000, - "Standard_E32-16as_v5": 2.176000, - "Standard_E32-8as_v5": 2.176000, - "Standard_E32_v5": 2.416000, - "Standard_E32ds_v5": 2.784000, - "Standard_E4-2ds_v4": 0.348000, - "Standard_E4-2s_v4": 0.302000, - "Standard_E4-2s_v5": 0.302000, - "Standard_E48_v4": 3.624000, - "Standard_E48a_v4": 3.624000, - "Standard_E48as_v4": 3.624000, - "Standard_E48s_v3": 3.623000, - "Standard_E4_v5": 0.302000, - "Standard_E4ds_v4": 0.348000, - "Standard_E4s_v5": 0.302000, - "Standard_E64-16s_v5": 4.832000, - "Standard_E64a_v4": 4.832000, - "Standard_E64as_v4": 4.832000, - "Standard_E64bds_v5": 6.432000, - "Standard_E64s_v3": 4.347000, - "Standard_E8-4as_v4": 0.604000, - "Standard_E8-4ds_v4": 0.696000, - "Standard_E8-4ds_v5": 0.696000, - "Standard_E8-4s_v3": 0.638000, - "Standard_E8-4s_v5": 0.604000, - "Standard_E8ads_v5": 0.636000, - "Standard_E8as_v5": 0.544000, - "Standard_E8bs_v5": 0.712000, - "Standard_E8s_v3": 0.638000, - "Standard_E96-24ads_v5": 7.632000, - "Standard_E96-48as_v4": 7.248000, - "Standard_E96-48ds_v5": 8.352000, - "Standard_E96bs_v5": 8.544000, - "Standard_F1": 0.065000, - "Standard_F16s": 1.042000, - "Standard_F2": 0.130000, - "Standard_F4": 0.260000, - "Standard_F4s": 0.260000, - "Standard_F72s_v2": 3.996000, - "Standard_FX12mds": 1.356000, - "Standard_FX24mds": 2.712000, - "Standard_G2": 1.276000, - "Standard_G5": 10.208000, - "Standard_GS5-8": 10.208000, - "Standard_HB120-64rs_v2": 5.220000, - "Standard_HC44rs": 4.594000, - "Standard_L32s_v3": 3.344000, - "Standard_L48as_v3": 4.488000, - "Standard_L4s": 0.374000, - "Standard_M128-64ms": 38.697600, - "Standard_M128s_v2": 18.733000, - "Standard_M16s": 3.461000, - "Standard_M192is_v2": 22.636000, - "Standard_M416is_v2": 71.891000, - "Standard_M64": 9.670000, - "Standard_M64ms_v2": 14.688000, - "Standard_M64s": 9.670000, - "Standard_M8-2ms": 2.227900, - "Standard_NC12": 3.100000, - "Standard_NC24r": 6.842000, - "Standard_NC6": 1.550000, - "Standard_NC6s_v3": 4.234000, - "Standard_NC8as_T4_v3": 0.978000, - "Standard_NV12ads_A10_v5": 1.317000, - "Standard_NV12s_v3": 1.590000, - "Standard_NV16as_v4": 1.351000, - "Standard_NV6ads_A10_v5": 0.658000, - } - // australiasoutheast - initialOnDemandPrices["australiasoutheast"] = map[string]float64{ - "Basic_A4": 0.464000, - "Dadsv5_Type1": 8.248000, - "Dasv4_Type2": 6.589000, - "Dasv5_Type1": 6.887000, - "Ddsv5_Type1": 7.756000, - "Dsv3_Type3": 5.280000, - "Dsv4_Type1": 5.491000, - "Dsv4_Type2": 6.864000, - "Easv5_Type1": 7.756000, - "Ebdsv5-Type1": 7.642000, - "Ebsv5-Type1": 6.818000, - "Edsv4_Type 1": 6.589000, - "Edsv5_Type1": 9.884000, - "Esv3_Type4": 6.974000, - "Esv4_Type1": 5.766000, - "Fsv2 Type3": 5.642000, - "Fsv2_Type2": 4.376000, - "Lasv3_Type1": 8.923000, - "Lsv3_Type1": 9.981000, - "Mdsv2MedMem_Type1": 19.076000, - "Msmv2MedMem Type1": 37.565000, - "Msmv2_Type1": 158.140000, - "Msv2MedMem Type1": 18.474000, - "Standard_A1": 0.071000, - "Standard_A1_v2": 0.050000, - "Standard_A2": 0.142000, - "Standard_A3": 0.284000, - "Standard_A4_v2": 0.222000, - "Standard_A5": 0.278000, - "Standard_A8m_v2": 0.786000, - "Standard_B16as_v2": 0.782000, - "Standard_B16ms": 0.845000, - "Standard_B16s_v2": 0.865000, - "Standard_B1s": 0.013200, - "Standard_B20ms": 1.057000, - "Standard_B2als_v2": 0.048900, - "Standard_B2ls_v2": 0.054100, - "Standard_B2ms": 0.106000, - "Standard_B2s": 0.052800, - "Standard_B2s_v2": 0.108000, - "Standard_B2ts_v2": 0.022700, - "Standard_B32als_v2": 1.385000, - "Standard_B32ls_v2": 1.532000, - "Standard_B32s_v2": 1.731000, - "Standard_B4als_v2": 0.173000, - "Standard_B4ls_v2": 0.192000, - "Standard_B4s_v2": 0.235000, - "Standard_B8als_v2": 0.346000, - "Standard_B8as_v2": 0.428000, - "Standard_B8ms": 0.423000, - "Standard_B8s_v2": 0.469000, - "Standard_D1": 0.093000, - "Standard_D11": 0.210000, - "Standard_D11_v2": 0.200000, - "Standard_D11_v2_Promo": 0.200000, - "Standard_D12": 0.420000, - "Standard_D12_v2_Promo": 0.399000, - "Standard_D13": 0.840000, - "Standard_D13_v2": 0.798000, - "Standard_D13_v2_Promo": 0.798000, - "Standard_D14": 1.680000, - "Standard_D14_v2": 1.596000, - "Standard_D14_v2_Promo": 1.596000, - "Standard_D15i_v2": 1.995000, - "Standard_D16_v4": 0.998000, - "Standard_D16_v5": 0.998000, - "Standard_D16ads_v5": 1.071000, - "Standard_D16as_v4": 0.998000, - "Standard_D16as_v5": 0.894000, - "Standard_D16d_v4": 1.085000, - "Standard_D16d_v5": 1.175000, - "Standard_D16ds_v4": 1.085000, - "Standard_D16ls_v5": 0.884000, - "Standard_D16s_v3": 1.000000, - "Standard_D16s_v5": 0.998000, - "Standard_D1_v2": 0.077800, - "Standard_D2_v2_Promo": 0.155760, - "Standard_D2_v4": 0.125000, - "Standard_D2_v5": 0.125000, - "Standard_D2a_v4": 0.125000, - "Standard_D2as_v5": 0.112000, - "Standard_D2ds_v4": 0.136000, - "Standard_D2ds_v5": 0.147000, - "Standard_D2lds_v5": 0.125000, - "Standard_D2ls_v5": 0.111000, - "Standard_D2s_v3": 0.125000, - "Standard_D3": 0.372000, - "Standard_D32-8s_v3": 2.000000, - "Standard_D32_v3": 2.000000, - "Standard_D32_v4": 1.997000, - "Standard_D32a_v4": 1.997000, - "Standard_D32ads_v5": 2.142000, - "Standard_D32as_v4": 1.997000, - "Standard_D32d_v4": 2.170000, - "Standard_D32d_v5": 2.350000, - "Standard_D32ds_v4": 2.170000, - "Standard_D32ds_v5": 2.350000, - "Standard_D32lds_v5": 1.997000, - "Standard_D32ls_v5": 1.768000, - "Standard_D3_v2_Promo": 0.311000, - "Standard_D48_v5": 2.995000, - "Standard_D48ads_v5": 3.214000, - "Standard_D48as_v5": 2.683000, - "Standard_D48d_v5": 3.526000, - "Standard_D48lds_v5": 2.995000, - "Standard_D48ls_v5": 2.652000, - "Standard_D48s_v3": 3.000000, - "Standard_D48s_v4": 2.995000, - "Standard_D48s_v5": 2.995000, - "Standard_D4_v2": 0.623000, - "Standard_D4_v2_Promo": 0.623000, - "Standard_D4_v3": 0.250000, - "Standard_D4_v4": 0.250000, - "Standard_D4_v5": 0.250000, - "Standard_D4ads_v5": 0.268000, - "Standard_D4ahs_v4": 0.250000, - "Standard_D4d_v4": 0.271000, - "Standard_D4ds_v5": 0.294000, - "Standard_D4lds_v5": 0.250000, - "Standard_D4ls_v5": 0.221000, - "Standard_D5_v2": 1.246000, - "Standard_D5_v2_Promo": 1.246000, - "Standard_D64-32s_v3": 4.000000, - "Standard_D64_v3": 4.000000, - "Standard_D64_v5": 3.994000, - "Standard_D64a_v4": 3.994000, - "Standard_D64ads_v5": 4.285000, - "Standard_D64as_v5": 3.578000, - "Standard_D64d_v4": 4.339000, - "Standard_D64d_v5": 4.701000, - "Standard_D64lds_v5": 3.994000, - "Standard_D64ls_v5": 3.536000, - "Standard_D64s_v4": 3.994000, - "Standard_D8_v5": 0.499000, - "Standard_D8a_v4": 0.499000, - "Standard_D8as_v5": 0.447000, - "Standard_D8d_v4": 0.542000, - "Standard_D8d_v5": 0.588000, - "Standard_D8s_v4": 0.499000, - "Standard_D96_v5": 5.990000, - "Standard_D96a_v4": 5.990000, - "Standard_D96as_v5": 5.366000, - "Standard_DC1s_v2": 0.125000, - "Standard_DC2s_v2": 0.250000, - "Standard_DC4s_v2": 0.499000, - "Standard_DC8_v2": 0.998000, - "Standard_DS11-1_v2": 0.200000, - "Standard_DS11_v2": 0.200000, - "Standard_DS12": 0.420000, - "Standard_DS12-1_v2": 0.399000, - "Standard_DS13": 0.840000, - "Standard_DS13-4_v2": 0.798000, - "Standard_DS14": 1.680000, - "Standard_DS14-8_v2": 1.596000, - "Standard_DS14_v2_Promo": 1.596000, - "Standard_DS15i_v2": 1.995000, - "Standard_DS2_v2": 0.155760, - "Standard_DS2_v2_Promo": 0.155760, - "Standard_DS3": 0.372000, - "Standard_DS3_v2": 0.311000, - "Standard_DS3_v2_Promo": 0.311000, - "Standard_DS4": 0.744000, - "Standard_DS4_v2_Promo": 0.623000, - "Standard_DS5_v2": 1.246000, - "Standard_E104i_v5": 9.369000, - "Standard_E104id_v5": 10.708000, - "Standard_E104ids_v5": 10.708000, - "Standard_E112iads_v5": 10.490000, - "Standard_E112ias_v5": 9.049000, - "Standard_E16-4ads_v5": 1.362000, - "Standard_E16-4ds_v4": 1.382000, - "Standard_E16-4ds_v5": 1.498000, - "Standard_E16-4s_v4": 1.310000, - "Standard_E16-4s_v5": 1.310000, - "Standard_E16-8ads_v5": 1.362000, - "Standard_E16-8as_v5": 1.175000, - "Standard_E16-8ds_v4": 1.382000, - "Standard_E16-8s_v3": 1.277000, - "Standard_E16-8s_v5": 1.310000, - "Standard_E16_v3": 1.277000, - "Standard_E16_v4": 1.310000, - "Standard_E16_v5": 1.310000, - "Standard_E16a_v4": 1.310000, - "Standard_E16as_v5": 1.175000, - "Standard_E16bds_v5": 1.737000, - "Standard_E16bs_v5": 1.550000, - "Standard_E16d_v4": 1.382000, - "Standard_E16d_v5": 1.498000, - "Standard_E16ds_v4": 1.382000, - "Standard_E16ds_v5": 1.498000, - "Standard_E16s_v3": 1.277000, - "Standard_E16s_v4": 1.310000, - "Standard_E20_v3": 1.509000, - "Standard_E20_v4": 1.638000, - "Standard_E20_v5": 1.638000, - "Standard_E20ads_v5": 1.703000, - "Standard_E20d_v4": 1.728000, - "Standard_E20d_v5": 1.872000, - "Standard_E20s_v3": 1.509000, - "Standard_E2_v3": 0.160000, - "Standard_E2_v5": 0.164000, - "Standard_E2as_v5": 0.147000, - "Standard_E2bs_v5": 0.194000, - "Standard_E2d_v5": 0.187000, - "Standard_E2ds_v4": 0.173000, - "Standard_E2ds_v5": 0.187000, - "Standard_E2s_v3": 0.160000, - "Standard_E2s_v4": 0.164000, - "Standard_E2s_v5": 0.164000, - "Standard_E32-16ads_v5": 2.725000, - "Standard_E32-16ds_v4": 2.765000, - "Standard_E32-16s_v4": 2.621000, - "Standard_E32-16s_v5": 2.621000, - "Standard_E32-8as_v4": 2.621000, - "Standard_E32-8as_v5": 2.350000, - "Standard_E32-8ds_v4": 2.765000, - "Standard_E32-8ds_v5": 2.995000, - "Standard_E32_v4": 2.621000, - "Standard_E32a_v4": 2.621000, - "Standard_E32ads_v5": 2.725000, - "Standard_E32as_v4": 2.621000, - "Standard_E32bds_v5": 3.474000, - "Standard_E32d_v4": 2.765000, - "Standard_E32ds_v4": 2.765000, - "Standard_E32s_v5": 2.621000, - "Standard_E4-2ads_v5": 0.341000, - "Standard_E4-2ds_v4": 0.346000, - "Standard_E4-2ds_v5": 0.374000, - "Standard_E4-2s_v3": 0.319000, - "Standard_E4-2s_v5": 0.328000, - "Standard_E48_v3": 3.623000, - "Standard_E48_v4": 3.931000, - "Standard_E48_v5": 3.931000, - "Standard_E48as_v5": 3.526000, - "Standard_E48bds_v5": 5.210000, - "Standard_E48ds_v4": 4.147000, - "Standard_E48ds_v5": 4.493000, - "Standard_E48s_v4": 3.931000, - "Standard_E48s_v5": 3.931000, - "Standard_E4_v3": 0.319000, - "Standard_E4_v4": 0.328000, - "Standard_E4a_v4": 0.328000, - "Standard_E4ads_v5": 0.341000, - "Standard_E4as_v4": 0.328000, - "Standard_E4bds_v5": 0.434000, - "Standard_E4d_v4": 0.346000, - "Standard_E4d_v5": 0.374000, - "Standard_E4ds_v4": 0.346000, - "Standard_E4s_v3": 0.319000, - "Standard_E4s_v5": 0.328000, - "Standard_E64-16ads_v5": 5.450000, - "Standard_E64-16as_v4": 5.242000, - "Standard_E64-16s_v4": 5.242000, - "Standard_E64-16s_v5": 5.242000, - "Standard_E64-32ds_v4": 5.530000, - "Standard_E64-32s_v4": 5.242000, - "Standard_E64-32s_v5": 5.242000, - "Standard_E64_v3": 4.347000, - "Standard_E64_v5": 5.242000, - "Standard_E64a_v4": 5.242000, - "Standard_E64as_v4": 5.242000, - "Standard_E64as_v5": 4.701000, - "Standard_E64bds_v5": 6.947000, - "Standard_E64ds_v4": 5.530000, - "Standard_E64ds_v5": 5.990000, - "Standard_E64i_v3": 4.347000, - "Standard_E64s_v3": 4.347000, - "Standard_E64s_v4": 5.242000, - "Standard_E64s_v5": 5.242000, - "Standard_E8-2ads_v5": 0.681000, - "Standard_E8-2ds_v5": 0.749000, - "Standard_E8-2s_v3": 0.638000, - "Standard_E8-2s_v4": 0.655000, - "Standard_E8-4ads_v5": 0.681000, - "Standard_E8-4as_v5": 0.588000, - "Standard_E8-4ds_v4": 0.691000, - "Standard_E8-4ds_v5": 0.749000, - "Standard_E8-4s_v4": 0.655000, - "Standard_E80ids_v4": 6.912000, - "Standard_E8_v5": 0.655000, - "Standard_E8a_v4": 0.655000, - "Standard_E8as_v4": 0.655000, - "Standard_E8as_v5": 0.588000, - "Standard_E8bds_v5": 0.868000, - "Standard_E8d_v5": 0.749000, - "Standard_E8ds_v4": 0.691000, - "Standard_E8s_v3": 0.638000, - "Standard_E8s_v4": 0.655000, - "Standard_E8s_v5": 0.655000, - "Standard_E96-24ads_v5": 8.174000, - "Standard_E96-24ds_v5": 8.986000, - "Standard_E96-24s_v5": 7.862000, - "Standard_E96-48as_v5": 7.051000, - "Standard_E96-48ds_v5": 8.986000, - "Standard_E96_v5": 7.862000, - "Standard_E96a_v4": 7.862000, - "Standard_E96d_v5": 8.986000, - "Standard_E96ds_v5": 8.986000, - "Standard_E96iads_v5": 8.992000, - "Standard_E96ias_v5": 7.756000, - "Standard_E96s_v5": 7.862000, - "Standard_F1": 0.065000, - "Standard_F2": 0.130000, - "Standard_F2s_v2": 0.111000, - "Standard_F4": 0.260000, - "Standard_F48s_v2": 2.672000, - "Standard_F4s_v2": 0.223000, - "Standard_F64s_v2": 3.563000, - "Standard_F72s_v2": 4.009000, - "Standard_F8": 0.521000, - "Standard_F8s": 0.521000, - "Standard_F8s_v2": 0.445000, - "Standard_L32as_v3": 3.245000, - "Standard_L32s_v3": 3.630000, - "Standard_L48as_v3": 4.867000, - "Standard_L80s_v3": 9.074000, - "Standard_L8as_v3": 0.811000, - "Standard_L8s_v3": 0.907000, - "Standard_M128-32ms": 38.698000, - "Standard_M128-64ms": 38.698000, - "Standard_M128dms_v2": 34.697000, - "Standard_M128m": 38.698000, - "Standard_M128s": 19.340000, - "Standard_M16ms": 4.455900, - "Standard_M16s": 3.461000, - "Standard_M192ids_v2": 20.842000, - "Standard_M192is_v2": 20.294000, - "Standard_M208-104ms_v2": 64.699000, - "Standard_M208-52ms_v2": 64.699000, - "Standard_M208ms_v2": 64.699000, - "Standard_M32-16ms": 8.911700, - "Standard_M32ms": 8.911700, - "Standard_M32ms_v2": 7.853000, - "Standard_M32ts": 3.248000, - "Standard_M416-104ms_v2": 143.770000, - "Standard_M416-104s_v2": 71.891000, - "Standard_M416-208ms_v2": 143.770000, - "Standard_M416is_v2": 71.891000, - "Standard_M416ms_v2": 143.770000, - "Standard_M64": 9.670000, - "Standard_M64-16ms": 14.989000, - "Standard_M64-32ms": 14.989000, - "Standard_M64dms_v2": 13.442000, - "Standard_M64ls": 6.498000, - "Standard_M64s_v2": 8.397000, - "Standard_M8-2ms": 2.227900, - "Standard_M8-4ms": 2.227900, - } - // brazilsouth - initialOnDemandPrices["brazilsouth"] = map[string]float64{ - "Basic_A0": 0.022000, - "Basic_A1": 0.041000, - "Basic_A2": 0.112000, - "Basic_A3": 0.232000, - "Basic_A4": 0.464000, - "Dadsv5_Type1": 10.164000, - "Dasv4_Type1": 8.078000, - "Dasv4_Type2": 8.415000, - "Dasv5_Type1": 8.501000, - "Ddsv4_Type 1": 6.336000, - "Ddsv4_Type2": 7.524000, - "Ddsv5_Type1": 9.504000, - "Dsv3_Type3": 6.996000, - "Dsv3_Type4": 8.413000, - "Dsv4_Type1": 6.731000, - "Dsv4_Type2": 8.078000, - "Dsv5_Type1": 8.415000, - "Eadsv5_Type1": 10.982000, - "Easv4_Type1": 10.613000, - "Easv4_Type2": 10.613000, - "Easv5_Type1": 9.557000, - "Ebdsv5-Type1": 9.381000, - "Ebsv5-Type1": 8.430000, - "Edsv4_Type 1": 8.025000, - "Edsv4_Type2": 9.551000, - "Edsv5_Type1": 12.038000, - "Esv3_Type3": 8.010000, - "Esv3_Type4": 10.852000, - "Esv4_Type1": 7.075000, - "Esv4_Type2": 9.286000, - "Esv5_Type1": 10.613000, - "FXmds Type1": 7.339000, - "Fsv2 Type3": 6.052000, - "Fsv2_Type2": 5.188000, - "Fsv2_Type4": 6.917000, - "Lasv3_Type1": 10.956000, - "Lsv3_Type1": 12.232000, - "Mdsmv2MedMem _Type1": 57.250000, - "Mdsv2MedMem_Type1": 28.614000, - "Ms_Type1": 28.604000, - "Msm_Type1": 57.258000, - "Msmv2MedMem Type1": 56.347000, - "Msmv2_Type1": 212.680000, - "Msv2MedMem Type1": 27.712000, - "Msv2_Type1": 106.350000, - "NVsv3_Type1": 8.527000, - "Standard_A0": 0.024000, - "Standard_A1": 0.080000, - "Standard_A1_v2": 0.061000, - "Standard_A2": 0.160000, - "Standard_A2_v2": 0.129000, - "Standard_A2m_v2": 0.208000, - "Standard_A3": 0.320000, - "Standard_A4": 0.640000, - "Standard_A4_v2": 0.270000, - "Standard_A4m_v2": 0.437000, - "Standard_A5": 0.291000, - "Standard_A6": 0.582000, - "Standard_A7": 1.164000, - "Standard_A8_v2": 0.567000, - "Standard_A8m_v2": 0.917000, - "Standard_B12ms": 0.806000, - "Standard_B16als_v2": 0.857000, - "Standard_B16as_v2": 0.968000, - "Standard_B16ls_v2": 0.952000, - "Standard_B16ms": 1.075000, - "Standard_B16s_v2": 1.149000, - "Standard_B1ls": 0.008400, - "Standard_B1ms": 0.033600, - "Standard_B1s": 0.016800, - "Standard_B20ms": 1.344000, - "Standard_B2als_v2": 0.069700, - "Standard_B2as_v2": 0.130000, - "Standard_B2ats_v2": 0.015100, - "Standard_B2ls_v2": 0.076400, - "Standard_B2ms": 0.134000, - "Standard_B2s": 0.067200, - "Standard_B2s_v2": 0.134000, - "Standard_B2ts_v2": 0.016800, - "Standard_B32als_v2": 1.714000, - "Standard_B32as_v2": 1.936000, - "Standard_B32ls_v2": 2.051000, - "Standard_B32s_v2": 2.298000, - "Standard_B4als_v2": 0.214000, - "Standard_B4as_v2": 0.242000, - "Standard_B4ls_v2": 0.257000, - "Standard_B4ms": 0.269000, - "Standard_B4s_v2": 0.269000, - "Standard_B8als_v2": 0.465000, - "Standard_B8as_v2": 0.484000, - "Standard_B8ls_v2": 0.513000, - "Standard_B8ms": 0.538000, - "Standard_B8s_v2": 0.574000, - "Standard_D1": 0.095000, - "Standard_D11": 0.235000, - "Standard_D11_v2": 0.235000, - "Standard_D11_v2_Promo": 0.235000, - "Standard_D12": 0.470000, - "Standard_D12_v2": 0.470000, - "Standard_D12_v2_Promo": 0.470000, - "Standard_D13": 0.939000, - "Standard_D13_v2": 0.940000, - "Standard_D13_v2_Promo": 0.940000, - "Standard_D14": 1.879000, - "Standard_D14_v2": 1.879000, - "Standard_D14_v2_Promo": 1.879000, - "Standard_D15_v2": 2.349000, - "Standard_D15i_v2": 2.349000, - "Standard_D16_v3": 1.272000, - "Standard_D16_v4": 1.224000, - "Standard_D16_v5": 1.224000, - "Standard_D16a_v4": 1.224000, - "Standard_D16ads_v5": 1.320000, - "Standard_D16as_v4": 1.224000, - "Standard_D16as_v5": 1.104000, - "Standard_D16as_v5_Promo": 0.979000, - "Standard_D16d_v4": 1.440000, - "Standard_D16d_v5": 1.440000, - "Standard_D16ds_v4": 1.440000, - "Standard_D16ds_v5": 1.440000, - "Standard_D16lds_v5": 1.192000, - "Standard_D16ls_v5": 1.048000, - "Standard_D16s_v3": 1.272000, - "Standard_D16s_v4": 1.224000, - "Standard_D16s_v5": 1.224000, - "Standard_D1_v2": 0.085600, - "Standard_D2": 0.190000, - "Standard_D2_v2": 0.171000, - "Standard_D2_v2_Promo": 0.171000, - "Standard_D2_v3": 0.159000, - "Standard_D2_v4": 0.153000, - "Standard_D2_v5": 0.153000, - "Standard_D2a_v4": 0.153000, - "Standard_D2ads_v5": 0.165000, - "Standard_D2as_v4": 0.153000, - "Standard_D2as_v5": 0.138000, - "Standard_D2as_v5_Promo": 0.122000, - "Standard_D2d_v4": 0.180000, - "Standard_D2d_v5": 0.180000, - "Standard_D2ds_v4": 0.180000, - "Standard_D2ds_v5": 0.180000, - "Standard_D2lds_v5": 0.149000, - "Standard_D2ls_v5": 0.131000, - "Standard_D2s_v3": 0.159000, - "Standard_D2s_v4": 0.153000, - "Standard_D2s_v5": 0.153000, - "Standard_D3": 0.380000, - "Standard_D32-16s_v3": 2.544000, - "Standard_D32-8s_v3": 2.544000, - "Standard_D32_v3": 2.544000, - "Standard_D32_v4": 2.448000, - "Standard_D32_v5": 2.448000, - "Standard_D32a_v4": 2.448000, - "Standard_D32ads_v5": 2.640000, - "Standard_D32as_v4": 2.448000, - "Standard_D32as_v5": 2.208000, - "Standard_D32as_v5_Promo": 1.958000, - "Standard_D32d_v4": 2.880000, - "Standard_D32d_v5": 2.880000, - "Standard_D32ds_v4": 2.880000, - "Standard_D32ds_v5": 2.880000, - "Standard_D32lds_v5": 2.384000, - "Standard_D32ls_v5": 2.096000, - "Standard_D32s_v3": 2.544000, - "Standard_D32s_v4": 2.448000, - "Standard_D32s_v5": 2.448000, - "Standard_D3_v2": 0.343000, - "Standard_D3_v2_Promo": 0.343000, - "Standard_D4": 0.760000, - "Standard_D48_v3": 3.816000, - "Standard_D48_v4": 3.672000, - "Standard_D48_v5": 3.672000, - "Standard_D48a_v4": 3.672000, - "Standard_D48ads_v5": 3.960000, - "Standard_D48as_v4": 3.672000, - "Standard_D48as_v5": 3.312000, - "Standard_D48as_v5_Promo": 2.938000, - "Standard_D48d_v4": 4.320000, - "Standard_D48d_v5": 4.320000, - "Standard_D48ds_v4": 4.320000, - "Standard_D48ds_v5": 4.320000, - "Standard_D48lds_v5": 3.576000, - "Standard_D48ls_v5": 3.144000, - "Standard_D48s_v3": 3.816000, - "Standard_D48s_v4": 3.672000, - "Standard_D48s_v5": 3.672000, - "Standard_D4_v2": 0.685000, - "Standard_D4_v2_Promo": 0.685000, - "Standard_D4_v3": 0.318000, - "Standard_D4_v4": 0.306000, - "Standard_D4_v5": 0.306000, - "Standard_D4a_v4": 0.306000, - "Standard_D4ads_v5": 0.330000, - "Standard_D4as_v4": 0.306000, - "Standard_D4as_v5": 0.276000, - "Standard_D4as_v5_Promo": 0.245000, - "Standard_D4d_v4": 0.360000, - "Standard_D4d_v5": 0.360000, - "Standard_D4ds_v4": 0.360000, - "Standard_D4ds_v5": 0.360000, - "Standard_D4lds_v5": 0.298000, - "Standard_D4ls_v5": 0.262000, - "Standard_D4s_v3": 0.318000, - "Standard_D4s_v4": 0.306000, - "Standard_D4s_v5": 0.306000, - "Standard_D5_v2": 1.370000, - "Standard_D5_v2_Promo": 1.370000, - "Standard_D64-16s_v3": 5.088000, - "Standard_D64-32s_v3": 5.088000, - "Standard_D64_v3": 5.088000, - "Standard_D64_v4": 4.896000, - "Standard_D64_v5": 4.896000, - "Standard_D64a_v4": 4.896000, - "Standard_D64ads_v5": 5.280000, - "Standard_D64as_v4": 4.896000, - "Standard_D64as_v5": 4.416000, - "Standard_D64as_v5_Promo": 3.917000, - "Standard_D64d_v4": 5.760000, - "Standard_D64d_v5": 5.760000, - "Standard_D64ds_v4": 5.760000, - "Standard_D64ds_v5": 5.760000, - "Standard_D64lds_v5": 4.768000, - "Standard_D64ls_v5": 4.192000, - "Standard_D64s_v3": 5.088000, - "Standard_D64s_v4": 4.896000, - "Standard_D64s_v5": 4.896000, - "Standard_D8_v3": 0.636000, - "Standard_D8_v4": 0.612000, - "Standard_D8_v5": 0.612000, - "Standard_D8a_v4": 0.612000, - "Standard_D8ads_v5": 0.660000, - "Standard_D8as_v4": 0.612000, - "Standard_D8as_v5": 0.552000, - "Standard_D8as_v5_Promo": 0.490000, - "Standard_D8d_v4": 0.720000, - "Standard_D8d_v5": 0.720000, - "Standard_D8ds_v4": 0.720000, - "Standard_D8ds_v5": 0.720000, - "Standard_D8lds_v5": 0.596000, - "Standard_D8ls_v5": 0.524000, - "Standard_D8s_v3": 0.636000, - "Standard_D8s_v4": 0.612000, - "Standard_D8s_v5": 0.612000, - "Standard_D96_v5": 7.344000, - "Standard_D96a_v4": 7.344000, - "Standard_D96ads_v5": 7.920000, - "Standard_D96as_v4": 7.344000, - "Standard_D96as_v5": 6.624000, - "Standard_D96as_v5_Promo": 5.875000, - "Standard_D96d_v5": 8.640000, - "Standard_D96ds_v5": 8.640000, - "Standard_D96lds_v5": 7.152000, - "Standard_D96ls_v5": 6.288000, - "Standard_D96s_v5": 7.344000, - "Standard_DS1": 0.095000, - "Standard_DS11": 0.235000, - "Standard_DS11-1_v2": 0.235000, - "Standard_DS11_v2": 0.235000, - "Standard_DS11_v2_Promo": 0.235000, - "Standard_DS12": 0.470000, - "Standard_DS12-1_v2": 0.470000, - "Standard_DS12-2_v2": 0.470000, - "Standard_DS12_v2": 0.470000, - "Standard_DS12_v2_Promo": 0.470000, - "Standard_DS13": 0.939000, - "Standard_DS13-2_v2": 0.940000, - "Standard_DS13-4_v2": 0.940000, - "Standard_DS13_v2": 0.940000, - "Standard_DS13_v2_Promo": 0.940000, - "Standard_DS14": 1.879000, - "Standard_DS14-4_v2": 1.879000, - "Standard_DS14-8_v2": 1.879000, - "Standard_DS14_v2": 1.879000, - "Standard_DS14_v2_Promo": 1.879000, - "Standard_DS15_v2": 2.349000, - "Standard_DS15i_v2": 2.349000, - "Standard_DS1_v2": 0.085600, - "Standard_DS2": 0.190000, - "Standard_DS2_v2": 0.171000, - "Standard_DS2_v2_Promo": 0.171000, - "Standard_DS3": 0.380000, - "Standard_DS3_v2": 0.343000, - "Standard_DS3_v2_Promo": 0.343000, - "Standard_DS4": 0.760000, - "Standard_DS4_v2": 0.685000, - "Standard_DS4_v2_Promo": 0.685000, - "Standard_DS5_v2": 1.370000, - "Standard_DS5_v2_Promo": 1.370000, - "Standard_E104i_v5": 11.497000, - "Standard_E104id_v5": 13.042000, - "Standard_E104ids_v5": 13.042000, - "Standard_E104is_v5": 11.497000, - "Standard_E112iads_v5": 12.813000, - "Standard_E112ias_v5": 11.150000, - "Standard_E112ibds_v5": 16.416000, - "Standard_E112ibs_v5": 14.753000, - "Standard_E16-4ads_v5": 1.664000, - "Standard_E16-4as_v4": 1.608000, - "Standard_E16-4as_v5": 1.448000, - "Standard_E16-4ds_v4": 1.824000, - "Standard_E16-4ds_v5": 1.824000, - "Standard_E16-4s_v3": 1.879000, - "Standard_E16-4s_v4": 1.608000, - "Standard_E16-4s_v5": 1.608000, - "Standard_E16-8ads_v5": 1.664000, - "Standard_E16-8as_v4": 1.608000, - "Standard_E16-8as_v5": 1.448000, - "Standard_E16-8ds_v4": 1.824000, - "Standard_E16-8ds_v5": 1.824000, - "Standard_E16-8s_v3": 1.879000, - "Standard_E16-8s_v4": 1.608000, - "Standard_E16-8s_v5": 1.608000, - "Standard_E16_v3": 1.879000, - "Standard_E16_v4": 1.608000, - "Standard_E16_v5": 1.608000, - "Standard_E16a_v4": 1.608000, - "Standard_E16ads_v5": 1.664000, - "Standard_E16as_v4": 1.608000, - "Standard_E16as_v5": 1.448000, - "Standard_E16bds_v5": 2.132000, - "Standard_E16bs_v5": 1.916000, - "Standard_E16d_v4": 1.824000, - "Standard_E16d_v5": 1.824000, - "Standard_E16ds_v4": 1.824000, - "Standard_E16ds_v5": 1.824000, - "Standard_E16s_v3": 1.879000, - "Standard_E16s_v4": 1.608000, - "Standard_E16s_v5": 1.608000, - "Standard_E20_v3": 2.800000, - "Standard_E20_v4": 2.010000, - "Standard_E20_v5": 2.010000, - "Standard_E20a_v4": 2.010000, - "Standard_E20ads_v5": 2.080000, - "Standard_E20as_v4": 2.010000, - "Standard_E20as_v5": 1.810000, - "Standard_E20d_v4": 2.280000, - "Standard_E20d_v5": 2.280000, - "Standard_E20ds_v4": 2.280000, - "Standard_E20ds_v5": 2.280000, - "Standard_E20s_v3": 2.800000, - "Standard_E20s_v4": 2.010000, - "Standard_E20s_v5": 2.010000, - "Standard_E2_v3": 0.235000, - "Standard_E2_v4": 0.201000, - "Standard_E2_v5": 0.201000, - "Standard_E2a_v4": 0.201000, - "Standard_E2ads_v5": 0.208000, - "Standard_E2as_v4": 0.201000, - "Standard_E2as_v5": 0.181000, - "Standard_E2bds_v5": 0.267000, - "Standard_E2bs_v5": 0.240000, - "Standard_E2d_v4": 0.228000, - "Standard_E2d_v5": 0.228000, - "Standard_E2ds_v4": 0.228000, - "Standard_E2ds_v5": 0.228000, - "Standard_E2s_v3": 0.235000, - "Standard_E2s_v4": 0.201000, - "Standard_E2s_v5": 0.201000, - "Standard_E32-16ads_v5": 3.328000, - "Standard_E32-16as_v4": 3.216000, - "Standard_E32-16as_v5": 2.896000, - "Standard_E32-16ds_v4": 3.648000, - "Standard_E32-16ds_v5": 3.648000, - "Standard_E32-16s_v3": 3.758000, - "Standard_E32-16s_v4": 3.216000, - "Standard_E32-16s_v5": 3.216000, - "Standard_E32-8ads_v5": 3.328000, - "Standard_E32-8as_v4": 3.216000, - "Standard_E32-8as_v5": 2.896000, - "Standard_E32-8ds_v4": 3.648000, - "Standard_E32-8ds_v5": 3.648000, - "Standard_E32-8s_v3": 3.758000, - "Standard_E32-8s_v4": 3.216000, - "Standard_E32-8s_v5": 3.216000, - "Standard_E32_v3": 3.758000, - "Standard_E32_v4": 3.216000, - "Standard_E32_v5": 3.216000, - "Standard_E32a_v4": 3.216000, - "Standard_E32ads_v5": 3.328000, - "Standard_E32as_v4": 3.216000, - "Standard_E32as_v5": 2.896000, - "Standard_E32bds_v5": 4.264000, - "Standard_E32bs_v5": 3.832000, - "Standard_E32d_v4": 3.648000, - "Standard_E32d_v5": 3.648000, - "Standard_E32ds_v4": 3.648000, - "Standard_E32ds_v5": 3.648000, - "Standard_E32s_v3": 3.758000, - "Standard_E32s_v4": 3.216000, - "Standard_E32s_v5": 3.216000, - "Standard_E4-2ads_v5": 0.416000, - "Standard_E4-2as_v4": 0.402000, - "Standard_E4-2as_v5": 0.362000, - "Standard_E4-2ds_v4": 0.456000, - "Standard_E4-2ds_v5": 0.456000, - "Standard_E4-2s_v3": 0.470000, - "Standard_E4-2s_v4": 0.402000, - "Standard_E4-2s_v5": 0.402000, - "Standard_E48_v3": 5.637000, - "Standard_E48_v4": 4.824000, - "Standard_E48_v5": 4.824000, - "Standard_E48a_v4": 4.824000, - "Standard_E48ads_v5": 4.992000, - "Standard_E48as_v4": 4.824000, - "Standard_E48as_v5": 4.344000, - "Standard_E48bds_v5": 6.396000, - "Standard_E48bs_v5": 5.748000, - "Standard_E48d_v4": 5.472000, - "Standard_E48d_v5": 5.472000, - "Standard_E48ds_v4": 5.472000, - "Standard_E48ds_v5": 5.472000, - "Standard_E48s_v3": 5.637000, - "Standard_E48s_v4": 4.824000, - "Standard_E48s_v5": 4.824000, - "Standard_E4_v3": 0.470000, - "Standard_E4_v4": 0.402000, - "Standard_E4_v5": 0.402000, - "Standard_E4a_v4": 0.402000, - "Standard_E4ads_v5": 0.416000, - "Standard_E4as_v4": 0.402000, - "Standard_E4as_v5": 0.362000, - "Standard_E4bds_v5": 0.533000, - "Standard_E4bs_v5": 0.479000, - "Standard_E4d_v4": 0.456000, - "Standard_E4d_v5": 0.456000, - "Standard_E4ds_v4": 0.456000, - "Standard_E4ds_v5": 0.456000, - "Standard_E4s_v3": 0.470000, - "Standard_E4s_v4": 0.402000, - "Standard_E4s_v5": 0.402000, - "Standard_E64-16ads_v5": 6.656000, - "Standard_E64-16as_v4": 6.432000, - "Standard_E64-16as_v5": 5.792000, - "Standard_E64-16ds_v4": 7.296000, - "Standard_E64-16ds_v5": 7.296000, - "Standard_E64-16s_v3": 6.764000, - "Standard_E64-16s_v4": 6.432000, - "Standard_E64-16s_v5": 6.432000, - "Standard_E64-32ads_v5": 6.656000, - "Standard_E64-32as_v4": 6.432000, - "Standard_E64-32as_v5": 5.792000, - "Standard_E64-32ds_v4": 7.296000, - "Standard_E64-32ds_v5": 7.296000, - "Standard_E64-32s_v3": 6.764000, - "Standard_E64-32s_v4": 6.432000, - "Standard_E64-32s_v5": 6.432000, - "Standard_E64_v3": 6.764000, - "Standard_E64_v4": 6.432000, - "Standard_E64_v5": 6.432000, - "Standard_E64a_v4": 6.432000, - "Standard_E64ads_v5": 6.656000, - "Standard_E64as_v4": 6.432000, - "Standard_E64as_v5": 5.792000, - "Standard_E64bds_v5": 8.528000, - "Standard_E64bs_v5": 7.664000, - "Standard_E64d_v4": 7.296000, - "Standard_E64d_v5": 7.296000, - "Standard_E64ds_v4": 7.296000, - "Standard_E64ds_v5": 7.296000, - "Standard_E64i_v3": 6.764000, - "Standard_E64is_v3": 6.764000, - "Standard_E64s_v3": 6.764000, - "Standard_E64s_v4": 6.432000, - "Standard_E64s_v5": 6.432000, - "Standard_E8-2ads_v5": 0.832000, - "Standard_E8-2as_v4": 0.804000, - "Standard_E8-2as_v5": 0.724000, - "Standard_E8-2ds_v4": 0.912000, - "Standard_E8-2ds_v5": 0.912000, - "Standard_E8-2s_v3": 0.940000, - "Standard_E8-2s_v4": 0.804000, - "Standard_E8-2s_v5": 0.804000, - "Standard_E8-4ads_v5": 0.832000, - "Standard_E8-4as_v4": 0.804000, - "Standard_E8-4as_v5": 0.724000, - "Standard_E8-4ds_v4": 0.912000, - "Standard_E8-4ds_v5": 0.912000, - "Standard_E8-4s_v3": 0.940000, - "Standard_E8-4s_v4": 0.804000, - "Standard_E8-4s_v5": 0.804000, - "Standard_E80ids_v4": 9.120000, - "Standard_E80is_v4": 8.040000, - "Standard_E8_v3": 0.940000, - "Standard_E8_v4": 0.804000, - "Standard_E8_v5": 0.804000, - "Standard_E8a_v4": 0.804000, - "Standard_E8ads_v5": 0.832000, - "Standard_E8as_v4": 0.804000, - "Standard_E8as_v5": 0.724000, - "Standard_E8bds_v5": 1.066000, - "Standard_E8bs_v5": 0.958000, - "Standard_E8d_v4": 0.912000, - "Standard_E8d_v5": 0.912000, - "Standard_E8ds_v4": 0.912000, - "Standard_E8ds_v5": 0.912000, - "Standard_E8s_v3": 0.940000, - "Standard_E8s_v4": 0.804000, - "Standard_E8s_v5": 0.804000, - "Standard_E96-24ads_v5": 9.984000, - "Standard_E96-24as_v4": 9.648000, - "Standard_E96-24as_v5": 8.688000, - "Standard_E96-24ds_v5": 10.944000, - "Standard_E96-24s_v5": 9.648000, - "Standard_E96-48ads_v5": 9.984000, - "Standard_E96-48as_v4": 9.648000, - "Standard_E96-48as_v5": 8.688000, - "Standard_E96-48ds_v5": 10.944000, - "Standard_E96-48s_v5": 9.648000, - "Standard_E96_v5": 9.648000, - "Standard_E96a_v4": 9.648000, - "Standard_E96ads_v5": 9.984000, - "Standard_E96as_v4": 9.648000, - "Standard_E96as_v5": 8.688000, - "Standard_E96bds_v5": 12.792000, - "Standard_E96bs_v5": 11.496000, - "Standard_E96d_v5": 10.944000, - "Standard_E96ds_v5": 10.944000, - "Standard_E96iads_v5": 10.982000, - "Standard_E96ias_v5": 9.557000, - "Standard_E96s_v5": 9.648000, - "Standard_F1": 0.071800, - "Standard_F16": 1.148000, - "Standard_F16s": 1.148000, - "Standard_F16s_v2": 1.048000, - "Standard_F1s": 0.071800, - "Standard_F2": 0.144000, - "Standard_F2s": 0.144000, - "Standard_F2s_v2": 0.131000, - "Standard_F32s_v2": 2.096000, - "Standard_F4": 0.287000, - "Standard_F48s_v2": 3.144000, - "Standard_F4s": 0.287000, - "Standard_F4s_v2": 0.262000, - "Standard_F64s_v2": 4.192000, - "Standard_F72s_v2": 4.716000, - "Standard_F8": 0.574000, - "Standard_F8s": 0.574000, - "Standard_F8s_v2": 0.524000, - "Standard_FX12mds": 1.668000, - "Standard_FX24mds": 3.336000, - "Standard_FX36mds": 5.004000, - "Standard_FX48mds": 6.672000, - "Standard_FX4mds": 0.556000, - "Standard_HB120-16rs_v2": 7.200000, - "Standard_HB120-32rs_v2": 7.200000, - "Standard_HB120-64rs_v2": 7.200000, - "Standard_HB120-96rs_v2": 7.200000, - "Standard_HB120rs_v2": 7.200000, - "Standard_HC44-16rs": 6.336000, - "Standard_HC44-32rs": 6.336000, - "Standard_HC44rs": 6.336000, - "Standard_L16as_v3": 1.992000, - "Standard_L16s_v3": 2.224000, - "Standard_L32as_v3": 3.984000, - "Standard_L32s_v3": 4.448000, - "Standard_L48as_v3": 5.976000, - "Standard_L48s_v3": 6.672000, - "Standard_L64as_v3": 7.968000, - "Standard_L64s_v3": 8.896000, - "Standard_L80as_v3": 9.960000, - "Standard_L80s_v3": 11.120000, - "Standard_L8as_v3": 0.996000, - "Standard_L8s_v3": 1.112000, - "Standard_M128": 26.009000, - "Standard_M128-32ms": 52.042000, - "Standard_M128-64ms": 52.042000, - "Standard_M128dms_v2": 52.046000, - "Standard_M128ds_v2": 26.013000, - "Standard_M128m": 52.042000, - "Standard_M128ms": 52.042000, - "Standard_M128ms_v2": 51.225000, - "Standard_M128s": 26.009000, - "Standard_M128s_v2": 25.192000, - "Standard_M16-4ms": 5.992000, - "Standard_M16-8ms": 5.992000, - "Standard_M16ms": 5.992000, - "Standard_M16s": 4.655000, - "Standard_M192idms_v2": 62.524000, - "Standard_M192ids_v2": 31.262000, - "Standard_M192ims_v2": 61.704000, - "Standard_M192is_v2": 30.442000, - "Standard_M208-104ms_v2": 87.009000, - "Standard_M208-104s_v2": 43.504000, - "Standard_M208-52ms_v2": 87.009000, - "Standard_M208-52s_v2": 43.504000, - "Standard_M208ms_v2": 87.009000, - "Standard_M208s_v2": 43.504000, - "Standard_M32-16ms": 11.985000, - "Standard_M32-8ms": 11.985000, - "Standard_M32dms_v2": 11.985000, - "Standard_M32ls": 4.582435, - "Standard_M32ms": 11.985000, - "Standard_M32ms_v2": 11.780000, - "Standard_M32s": 6.503000, - "Standard_M32ts": 4.317665, - "Standard_M416-104ms_v2": 193.340000, - "Standard_M416-104s_v2": 96.681000, - "Standard_M416-208ms_v2": 193.340000, - "Standard_M416-208s_v2": 96.681000, - "Standard_M416is_v2": 96.681000, - "Standard_M416ms_v2": 193.340000, - "Standard_M416s_8_v2": 105.120000, - "Standard_M416s_v2": 96.681000, - "Standard_M64": 13.005000, - "Standard_M64-16ms": 20.158000, - "Standard_M64-32ms": 20.158000, - "Standard_M64dms_v2": 20.163000, - "Standard_M64ds_v2": 13.005000, - "Standard_M64ls": 8.636925, - "Standard_M64m": 20.158000, - "Standard_M64ms": 20.158000, - "Standard_M64ms_v2": 19.753000, - "Standard_M64s": 13.005000, - "Standard_M64s_v2": 12.594000, - "Standard_M8-2ms": 2.996000, - "Standard_M8-4ms": 2.996000, - "Standard_M8ms": 2.996000, - "Standard_NC12s_v3": 12.240000, - "Standard_NC16as_T4_v3": 2.046000, - "Standard_NC24rs_v3": 26.928000, - "Standard_NC24s_v3": 24.480000, - "Standard_NC4as_T4_v3": 0.894000, - "Standard_NC64as_T4_v3": 7.383000, - "Standard_NC6s_v3": 6.120000, - "Standard_NC8as_T4_v3": 1.277000, - "Standard_ND96ams_A100_v4": 65.540000, - "Standard_ND96amsr_A100_v4": 65.540000, - "Standard_NV12ads_A10_v5": 1.816000, - "Standard_NV12s_v3": 1.938000, - "Standard_NV18ads_A10_v5": 3.200000, - "Standard_NV24s_v3": 3.876000, - "Standard_NV36adms_A10_v5": 9.040000, - "Standard_NV36ads_A10_v5": 6.400000, - "Standard_NV48s_v3": 7.752000, - "Standard_NV6ads_A10_v5": 0.908000, - "Standard_NV72ads_A10_v5": 13.040000, - } - // brazilsoutheast - initialOnDemandPrices["brazilsoutheast"] = map[string]float64{ - "Basic_A2": 0.146000, - "Ddsv5_Type1": 12.355000, - "Ebdsv5-Type1": 12.195000, - "Edsv4_Type 1": 10.512000, - "Esv5_Type1": 13.797000, - "Fsv2_Type2": 8.992000, - "Lsv3_Type1": 15.902000, - "Mdsmv2MedMem _Type1": 66.058000, - "Msmv2MedMem Type1": 65.016000, - "Standard_A2m_v2": 0.270000, - "Standard_A4_v2": 0.351000, - "Standard_A8_v2": 0.737000, - "Standard_A8m_v2": 1.192000, - "Standard_B16as_v2": 1.258000, - "Standard_B16ls_v2": 1.311000, - "Standard_B16s_v2": 1.398000, - "Standard_B2als_v2": 0.087900, - "Standard_B2as_v2": 0.167000, - "Standard_B2ls_v2": 0.096600, - "Standard_B2s_v2": 0.184000, - "Standard_B2ts_v2": 0.021800, - "Standard_B32ls_v2": 2.623000, - "Standard_B4as_v2": 0.315000, - "Standard_B8ls_v2": 0.656000, - "Standard_D1": 0.124000, - "Standard_D11": 0.306000, - "Standard_D11_v2": 0.306000, - "Standard_D12": 0.611000, - "Standard_D12_v2": 0.611000, - "Standard_D13": 1.221000, - "Standard_D16_v5": 1.591000, - "Standard_D16a_v4": 1.591000, - "Standard_D16as_v5": 1.435000, - "Standard_D16d_v4": 1.873000, - "Standard_D16lds_v5": 1.550000, - "Standard_D1_v2": 0.111000, - "Standard_D2": 0.247000, - "Standard_D2_v3": 0.207000, - "Standard_D2_v5": 0.199000, - "Standard_D2ads_v5": 0.215000, - "Standard_D2as_v5": 0.179000, - "Standard_D2ds_v5": 0.234000, - "Standard_D2lds_v5": 0.194000, - "Standard_D2s_v4": 0.199000, - "Standard_D2s_v5": 0.199000, - "Standard_D32_v5": 3.182000, - "Standard_D32s_v3": 3.307000, - "Standard_D32s_v5": 3.182000, - "Standard_D48_v4": 4.773000, - "Standard_D48ds_v5": 5.616000, - "Standard_D4_v3": 0.413000, - "Standard_D4lds_v5": 0.387000, - "Standard_D4s_v3": 0.413000, - "Standard_D64-16s_v3": 6.614000, - "Standard_D64_v5": 6.365000, - "Standard_D64as_v5": 5.741000, - "Standard_D64d_v4": 7.491000, - "Standard_D64ds_v5": 7.488000, - "Standard_D64ls_v5": 5.450000, - "Standard_D64s_v3": 6.614000, - "Standard_D64s_v4": 6.364000, - "Standard_D64s_v5": 6.365000, - "Standard_D8_v4": 0.796000, - "Standard_D8d_v4": 0.936000, - "Standard_D8ds_v5": 0.936000, - "Standard_D8lds_v5": 0.775000, - "Standard_D8s_v3": 0.827000, - "Standard_D96ads_v5": 10.296000, - "Standard_D96s_v5": 9.547000, - "Standard_DS11-1_v2": 0.306000, - "Standard_DS12-1_v2": 0.611000, - "Standard_DS12_v2": 0.611000, - "Standard_DS13": 1.221000, - "Standard_DS13-2_v2": 1.222000, - "Standard_DS13-4_v2": 1.222000, - "Standard_DS14-4_v2": 2.443000, - "Standard_DS15_v2": 3.054000, - "Standard_DS3_v2": 0.445000, - "Standard_DS5_v2": 1.780000, - "Standard_E112ias_v5": 14.494000, - "Standard_E112ibs_v5": 19.179000, - "Standard_E16-4s_v3": 2.444000, - "Standard_E16-8as_v5": 1.882000, - "Standard_E16-8s_v5": 2.090000, - "Standard_E16_v3": 2.444000, - "Standard_E16a_v4": 2.090000, - "Standard_E16ads_v5": 2.163000, - "Standard_E16as_v4": 2.090000, - "Standard_E16bds_v5": 2.772000, - "Standard_E16bs_v5": 2.491000, - "Standard_E16d_v4": 2.389000, - "Standard_E20_v5": 2.613000, - "Standard_E20ads_v5": 2.704000, - "Standard_E20as_v4": 2.613000, - "Standard_E20ds_v4": 2.986000, - "Standard_E20s_v3": 3.640000, - "Standard_E2_v3": 0.306000, - "Standard_E2_v4": 0.261000, - "Standard_E2_v5": 0.261000, - "Standard_E2as_v4": 0.261000, - "Standard_E2ds_v4": 0.299000, - "Standard_E32-16s_v5": 4.181000, - "Standard_E32-8as_v4": 4.181000, - "Standard_E32-8ds_v4": 4.778000, - "Standard_E32_v3": 4.888000, - "Standard_E32_v4": 4.181000, - "Standard_E32_v5": 4.181000, - "Standard_E32ads_v5": 4.326000, - "Standard_E32bds_v5": 5.543000, - "Standard_E32bs_v5": 4.982000, - "Standard_E32d_v5": 4.742000, - "Standard_E32ds_v4": 4.778000, - "Standard_E32ds_v5": 4.742000, - "Standard_E4-2as_v4": 0.523000, - "Standard_E4-2as_v5": 0.471000, - "Standard_E4-2ds_v4": 0.597000, - "Standard_E4-2ds_v5": 0.593000, - "Standard_E4-2s_v3": 0.611000, - "Standard_E4-2s_v4": 0.523000, - "Standard_E4-2s_v5": 0.523000, - "Standard_E48_v5": 6.271000, - "Standard_E48as_v5": 5.647000, - "Standard_E48bds_v5": 8.315000, - "Standard_E48ds_v5": 7.114000, - "Standard_E4_v5": 0.523000, - "Standard_E4as_v5": 0.471000, - "Standard_E4d_v4": 0.597000, - "Standard_E4ds_v5": 0.593000, - "Standard_E4s_v4": 0.523000, - "Standard_E64-16as_v4": 8.362000, - "Standard_E64-16s_v5": 8.362000, - "Standard_E64-32ads_v5": 8.653000, - "Standard_E64-32as_v5": 7.530000, - "Standard_E64-32s_v4": 8.362000, - "Standard_E64_v4": 8.362000, - "Standard_E64bs_v5": 9.963000, - "Standard_E64is_v3": 8.798000, - "Standard_E8-2ads_v5": 1.082000, - "Standard_E8-2s_v4": 1.045000, - "Standard_E8-4as_v4": 1.045000, - "Standard_E8-4s_v4": 1.045000, - "Standard_E8-4s_v5": 1.045000, - "Standard_E8_v3": 1.222000, - "Standard_E8_v4": 1.045000, - "Standard_E8ads_v5": 1.082000, - "Standard_E8as_v4": 1.045000, - "Standard_E8as_v5": 0.941000, - "Standard_E8ds_v5": 1.186000, - "Standard_E96-24ds_v5": 14.227000, - "Standard_E96a_v4": 12.542000, - "Standard_E96ads_v5": 12.979000, - "Standard_E96as_v5": 11.294000, - "Standard_E96iads_v5": 14.277000, - "Standard_F16s_v2": 1.362000, - "Standard_F2s_v2": 0.170000, - "Standard_F32s_v2": 2.725000, - "Standard_F4s_v2": 0.341000, - "Standard_F8": 0.747000, - "Standard_F8s": 0.747000, - "Standard_FX24mds": 4.337000, - "Standard_L16s_v3": 2.891000, - "Standard_L32as_v3": 5.179000, - "Standard_L64as_v3": 10.358000, - "Standard_L80as_v3": 12.948000, - "Standard_L8as_v3": 1.295000, - "Standard_M128dms_v2": 60.053000, - "Standard_M128ds_v2": 30.015000, - "Standard_M128ms_v2": 59.106000, - "Standard_M16ms": 6.914000, - "Standard_M192is_v2": 35.125000, - "Standard_M208-104ms_v2": 116.010000, - "Standard_M208-104s_v2": 58.004000, - "Standard_M208ms_v2": 116.010000, - "Standard_M208s_v2": 58.004000, - "Standard_M32ts": 5.129765, - "Standard_M416-208ms_v2": 257.780000, - "Standard_M416-208s_v2": 128.910000, - "Standard_M416is_v2": 128.910000, - "Standard_M64-16ms": 23.259100, - "Standard_M64-32ms": 23.259100, - "Standard_M64ms_v2": 22.792000, - "Standard_M64s_v2": 14.532000, - "Standard_M8-2ms": 3.457000, - "Standard_PB12s": 1.660000, - } - // canadacentral - initialOnDemandPrices["canadacentral"] = map[string]float64{ - "Basic_A0": 0.020000, - "Basic_A1": 0.026000, - "Basic_A2": 0.087000, - "Basic_A3": 0.194000, - "Basic_A4": 0.387000, - "DCdsv3 Type1": 6.653000, - "DCsv2 Type 1": 0.942000, - "DCsv3 Type1": 5.650000, - "Dadsv5_Type1": 7.084000, - "Dasv4_Type1": 5.885000, - "Dasv4_Type2": 5.885000, - "Dasv5_Type1": 5.914000, - "Ddsv4_Type 1": 4.435000, - "Ddsv4_Type2": 5.267000, - "Ddsv5_Type1": 6.653000, - "Dsv3_Type3": 4.884000, - "Dsv3_Type4": 5.886000, - "Dsv4_Type1": 4.708000, - "Dsv4_Type2": 5.650000, - "Dsv5_Type1": 5.885000, - "Eadsv5_Type1": 7.603000, - "Easv4_Type1": 7.286000, - "Easv4_Type2": 7.286000, - "Easv5_Type1": 6.547000, - "Ebdsv5-Type1": 6.494000, - "Ebsv5-Type1": 5.790000, - "Edsv4_Type 1": 5.561000, - "Edsv4_Type2": 6.604000, - "Edsv5_Type1": 8.342000, - "Esv3_Type3": 4.705000, - "Esv3_Type4": 6.375000, - "Esv4_Type1": 4.857000, - "Esv4_Type2": 6.376000, - "Esv5_Type1": 7.286000, - "FXmds Type1": 5.069000, - "Fsv2 Type3": 4.297000, - "Fsv2_Type2": 3.683000, - "Fsv2_Type4": 4.897000, - "Lsv3_Type1": 8.448000, - "Mdsmv2MedMem _Type1": 32.295000, - "Mdsv2MedMem_Type1": 16.141000, - "Ms_Type1": 16.136000, - "Msm_Type1": 32.300000, - "Msmv2MedMem Type1": 31.786000, - "Msmv2_Type1": 130.880000, - "Msv2MedMem Type1": 15.632000, - "Msv2_Type1": 65.446000, - "NVasv4_Type1": 8.612000, - "Standard_A0": 0.022000, - "Standard_A1": 0.056000, - "Standard_A1_v2": 0.043000, - "Standard_A2": 0.111000, - "Standard_A2_v2": 0.091000, - "Standard_A2m_v2": 0.129000, - "Standard_A3": 0.222000, - "Standard_A4": 0.446000, - "Standard_A4_v2": 0.191000, - "Standard_A4m_v2": 0.270000, - "Standard_A5": 0.242000, - "Standard_A6": 0.484000, - "Standard_A7": 0.968000, - "Standard_A8_v2": 0.400000, - "Standard_A8m_v2": 0.568000, - "Standard_B12ms": 0.556000, - "Standard_B16als_v2": 0.666000, - "Standard_B16as_v2": 0.742000, - "Standard_B16ls_v2": 0.731000, - "Standard_B16ms": 0.742000, - "Standard_B16pls_v2": 0.595000, - "Standard_B16ps_v2": 0.662000, - "Standard_B16s_v2": 0.816000, - "Standard_B1ls": 0.005800, - "Standard_B1ms": 0.023000, - "Standard_B1s": 0.011600, - "Standard_B20ms": 0.927000, - "Standard_B2als_v2": 0.051000, - "Standard_B2as_v2": 0.083600, - "Standard_B2ats_v2": 0.010500, - "Standard_B2ls_v2": 0.046400, - "Standard_B2ms": 0.092800, - "Standard_B2pls_v2": 0.046000, - "Standard_B2ps_v2": 0.082800, - "Standard_B2pts_v2": 0.018400, - "Standard_B2s": 0.046400, - "Standard_B2s_v2": 0.102000, - "Standard_B2ts_v2": 0.011600, - "Standard_B32als_v2": 1.332000, - "Standard_B32as_v2": 1.338000, - "Standard_B32ls_v2": 1.315000, - "Standard_B32s_v2": 1.485000, - "Standard_B4als_v2": 0.148000, - "Standard_B4as_v2": 0.186000, - "Standard_B4ls_v2": 0.183000, - "Standard_B4ms": 0.185000, - "Standard_B4pls_v2": 0.149000, - "Standard_B4ps_v2": 0.166000, - "Standard_B4s_v2": 0.186000, - "Standard_B8als_v2": 0.333000, - "Standard_B8as_v2": 0.371000, - "Standard_B8ls_v2": 0.366000, - "Standard_B8ms": 0.371000, - "Standard_B8pls_v2": 0.297000, - "Standard_B8ps_v2": 0.331000, - "Standard_B8s_v2": 0.408000, - "Standard_D1": 0.074700, - "Standard_D11": 0.193000, - "Standard_D11_v2": 0.183000, - "Standard_D11_v2_Promo": 0.199000, - "Standard_D12": 0.387000, - "Standard_D12_v2": 0.366000, - "Standard_D12_v2_Promo": 0.399000, - "Standard_D13": 0.773000, - "Standard_D13_v2": 0.732000, - "Standard_D13_v2_Promo": 0.798000, - "Standard_D14": 1.546000, - "Standard_D14_v2": 1.463000, - "Standard_D14_v2_Promo": 1.596000, - "Standard_D15_v2": 1.829000, - "Standard_D15i_v2": 1.829000, - "Standard_D16_v3": 0.888000, - "Standard_D16_v4": 0.856000, - "Standard_D16_v5": 0.856000, - "Standard_D16a_v4": 0.856000, - "Standard_D16ads_v5": 0.920000, - "Standard_D16as_v4": 0.856000, - "Standard_D16as_v5": 0.768000, - "Standard_D16as_v5_Promo": 0.685000, - "Standard_D16d_v4": 1.008000, - "Standard_D16d_v5": 1.008000, - "Standard_D16ds_v4": 1.008000, - "Standard_D16ds_v5": 1.008000, - "Standard_D16lds_v5": 0.848000, - "Standard_D16ls_v5": 0.744000, - "Standard_D16pds_v5": 0.808000, - "Standard_D16plds_v5": 0.678000, - "Standard_D16pls_v5": 0.595000, - "Standard_D16ps_v5": 0.685000, - "Standard_D16s_v3": 0.888000, - "Standard_D16s_v4": 0.856000, - "Standard_D16s_v5": 0.856000, - "Standard_D1_v2": 0.070000, - "Standard_D2": 0.149000, - "Standard_D2_v2": 0.140000, - "Standard_D2_v2_Promo": 0.152000, - "Standard_D2_v3": 0.111000, - "Standard_D2_v4": 0.107000, - "Standard_D2_v5": 0.107000, - "Standard_D2a_v4": 0.107000, - "Standard_D2ads_v5": 0.115000, - "Standard_D2as_v4": 0.107000, - "Standard_D2as_v5": 0.096000, - "Standard_D2as_v5_Promo": 0.085600, - "Standard_D2d_v4": 0.126000, - "Standard_D2d_v5": 0.126000, - "Standard_D2ds_v4": 0.126000, - "Standard_D2ds_v5": 0.126000, - "Standard_D2lds_v5": 0.106000, - "Standard_D2ls_v5": 0.093000, - "Standard_D2pds_v5": 0.101000, - "Standard_D2plds_v5": 0.084800, - "Standard_D2pls_v5": 0.074400, - "Standard_D2ps_v5": 0.085600, - "Standard_D2s_v3": 0.111000, - "Standard_D2s_v4": 0.107000, - "Standard_D2s_v5": 0.107000, - "Standard_D3": 0.299000, - "Standard_D32-16s_v3": 1.776000, - "Standard_D32-8s_v3": 1.776000, - "Standard_D32_v3": 1.776000, - "Standard_D32_v4": 1.712000, - "Standard_D32_v5": 1.712000, - "Standard_D32a_v4": 1.712000, - "Standard_D32ads_v5": 1.840000, - "Standard_D32as_v4": 1.712000, - "Standard_D32as_v5": 1.536000, - "Standard_D32as_v5_Promo": 1.370000, - "Standard_D32d_v4": 2.016000, - "Standard_D32d_v5": 2.016000, - "Standard_D32ds_v4": 2.016000, - "Standard_D32ds_v5": 2.016000, - "Standard_D32lds_v5": 1.696000, - "Standard_D32ls_v5": 1.488000, - "Standard_D32pds_v5": 1.616000, - "Standard_D32plds_v5": 1.357000, - "Standard_D32pls_v5": 1.190000, - "Standard_D32ps_v5": 1.370000, - "Standard_D32s_v3": 1.776000, - "Standard_D32s_v4": 1.712000, - "Standard_D32s_v5": 1.712000, - "Standard_D3_v2": 0.280000, - "Standard_D3_v2_Promo": 0.305000, - "Standard_D4": 0.597000, - "Standard_D48_v3": 2.664000, - "Standard_D48_v4": 2.568000, - "Standard_D48_v5": 2.568000, - "Standard_D48a_v4": 2.568000, - "Standard_D48ads_v5": 2.760000, - "Standard_D48as_v4": 2.568000, - "Standard_D48as_v5": 2.304000, - "Standard_D48as_v5_Promo": 2.054000, - "Standard_D48d_v4": 3.024000, - "Standard_D48d_v5": 3.024000, - "Standard_D48ds_v4": 3.024000, - "Standard_D48ds_v5": 3.024000, - "Standard_D48lds_v5": 2.544000, - "Standard_D48ls_v5": 2.232000, - "Standard_D48pds_v5": 2.424000, - "Standard_D48plds_v5": 2.035000, - "Standard_D48pls_v5": 1.786000, - "Standard_D48ps_v5": 2.054000, - "Standard_D48s_v3": 2.664000, - "Standard_D48s_v4": 2.568000, - "Standard_D48s_v5": 2.568000, - "Standard_D4_v2": 0.560000, - "Standard_D4_v2_Promo": 0.610000, - "Standard_D4_v3": 0.222000, - "Standard_D4_v4": 0.214000, - "Standard_D4_v5": 0.214000, - "Standard_D4a_v4": 0.214000, - "Standard_D4ads_v5": 0.230000, - "Standard_D4as_v4": 0.214000, - "Standard_D4as_v5": 0.192000, - "Standard_D4as_v5_Promo": 0.171000, - "Standard_D4d_v4": 0.252000, - "Standard_D4d_v5": 0.252000, - "Standard_D4ds_v4": 0.252000, - "Standard_D4ds_v5": 0.252000, - "Standard_D4lds_v5": 0.212000, - "Standard_D4ls_v5": 0.186000, - "Standard_D4pds_v5": 0.202000, - "Standard_D4plds_v5": 0.170000, - "Standard_D4pls_v5": 0.149000, - "Standard_D4ps_v5": 0.171000, - "Standard_D4s_v3": 0.222000, - "Standard_D4s_v4": 0.214000, - "Standard_D4s_v5": 0.214000, - "Standard_D5_v2": 1.120000, - "Standard_D5_v2_Promo": 1.220000, - "Standard_D64-16s_v3": 3.552000, - "Standard_D64-32s_v3": 3.552000, - "Standard_D64_v3": 3.552000, - "Standard_D64_v4": 3.424000, - "Standard_D64_v5": 3.424000, - "Standard_D64a_v4": 3.424000, - "Standard_D64ads_v5": 3.680000, - "Standard_D64as_v4": 3.424000, - "Standard_D64as_v5": 3.072000, - "Standard_D64as_v5_Promo": 2.739000, - "Standard_D64d_v4": 4.032000, - "Standard_D64d_v5": 4.032000, - "Standard_D64ds_v4": 4.032000, - "Standard_D64ds_v5": 4.032000, - "Standard_D64lds_v5": 3.392000, - "Standard_D64ls_v5": 2.976000, - "Standard_D64pds_v5": 3.232000, - "Standard_D64plds_v5": 2.714000, - "Standard_D64pls_v5": 2.381000, - "Standard_D64ps_v5": 2.739000, - "Standard_D64s_v3": 3.552000, - "Standard_D64s_v4": 3.424000, - "Standard_D64s_v5": 3.424000, - "Standard_D8_v3": 0.444000, - "Standard_D8_v4": 0.428000, - "Standard_D8_v5": 0.428000, - "Standard_D8a_v4": 0.428000, - "Standard_D8ads_v5": 0.460000, - "Standard_D8as_v4": 0.428000, - "Standard_D8as_v5": 0.384000, - "Standard_D8as_v5_Promo": 0.342000, - "Standard_D8d_v4": 0.504000, - "Standard_D8d_v5": 0.504000, - "Standard_D8ds_v4": 0.504000, - "Standard_D8ds_v5": 0.504000, - "Standard_D8lds_v5": 0.424000, - "Standard_D8ls_v5": 0.372000, - "Standard_D8pds_v5": 0.404000, - "Standard_D8plds_v5": 0.339000, - "Standard_D8pls_v5": 0.298000, - "Standard_D8ps_v5": 0.342000, - "Standard_D8s_v3": 0.444000, - "Standard_D8s_v4": 0.428000, - "Standard_D8s_v5": 0.428000, - "Standard_D96_v5": 5.136000, - "Standard_D96a_v4": 5.136000, - "Standard_D96ads_v5": 5.520000, - "Standard_D96as_v4": 5.136000, - "Standard_D96as_v5": 4.608000, - "Standard_D96as_v5_Promo": 4.109000, - "Standard_D96d_v5": 6.048000, - "Standard_D96ds_v5": 6.048000, - "Standard_D96lds_v5": 5.088000, - "Standard_D96ls_v5": 4.464000, - "Standard_D96s_v5": 5.136000, - "Standard_DC16ds_v3": 2.016000, - "Standard_DC16s_v3": 1.712000, - "Standard_DC1ds_v3": 0.126000, - "Standard_DC1s_v2": 0.107000, - "Standard_DC1s_v3": 0.107000, - "Standard_DC24ds_v3": 3.024000, - "Standard_DC24s_v3": 2.568000, - "Standard_DC2ds_v3": 0.252000, - "Standard_DC2s_v2": 0.214000, - "Standard_DC2s_v3": 0.214000, - "Standard_DC32ds_v3": 4.032000, - "Standard_DC32s_v3": 3.424000, - "Standard_DC48ds_v3": 6.048000, - "Standard_DC48s_v3": 5.136000, - "Standard_DC4ds_v3": 0.504000, - "Standard_DC4s_v2": 0.428000, - "Standard_DC4s_v3": 0.428000, - "Standard_DC8_v2": 0.856000, - "Standard_DC8ds_v3": 1.008000, - "Standard_DC8s_v3": 0.856000, - "Standard_DS1": 0.074700, - "Standard_DS11": 0.193000, - "Standard_DS11-1_v2": 0.183000, - "Standard_DS11_v2": 0.183000, - "Standard_DS11_v2_Promo": 0.199000, - "Standard_DS12": 0.387000, - "Standard_DS12-1_v2": 0.366000, - "Standard_DS12-2_v2": 0.366000, - "Standard_DS12_v2": 0.366000, - "Standard_DS12_v2_Promo": 0.399000, - "Standard_DS13": 0.773000, - "Standard_DS13-2_v2": 0.732000, - "Standard_DS13-4_v2": 0.732000, - "Standard_DS13_v2": 0.732000, - "Standard_DS13_v2_Promo": 0.798000, - "Standard_DS14": 1.546000, - "Standard_DS14-4_v2": 1.463000, - "Standard_DS14-8_v2": 1.463000, - "Standard_DS14_v2": 1.463000, - "Standard_DS14_v2_Promo": 1.596000, - "Standard_DS15_v2": 1.829000, - "Standard_DS15i_v2": 1.829000, - "Standard_DS1_v2": 0.070000, - "Standard_DS2": 0.149000, - "Standard_DS2_v2": 0.140000, - "Standard_DS2_v2_Promo": 0.152000, - "Standard_DS3": 0.299000, - "Standard_DS3_v2": 0.280000, - "Standard_DS3_v2_Promo": 0.305000, - "Standard_DS4": 0.597000, - "Standard_DS4_v2": 0.560000, - "Standard_DS4_v2_Promo": 0.610000, - "Standard_DS5_v2": 1.120000, - "Standard_DS5_v2_Promo": 1.220000, - "Standard_E104i_v5": 7.894000, - "Standard_E104id_v5": 9.038000, - "Standard_E104ids_v5": 9.038000, - "Standard_E104is_v5": 7.894000, - "Standard_E112iads_v5": 8.870000, - "Standard_E112ias_v5": 7.638000, - "Standard_E112ibds_v5": 11.365000, - "Standard_E112ibs_v5": 10.133000, - "Standard_E16-4ads_v5": 1.152000, - "Standard_E16-4as_v4": 1.104000, - "Standard_E16-4as_v5": 0.992000, - "Standard_E16-4ds_v4": 1.264000, - "Standard_E16-4ds_v5": 1.264000, - "Standard_E16-4s_v3": 1.168000, - "Standard_E16-4s_v4": 1.104000, - "Standard_E16-4s_v5": 1.104000, - "Standard_E16-8ads_v5": 1.152000, - "Standard_E16-8as_v4": 1.104000, - "Standard_E16-8as_v5": 0.992000, - "Standard_E16-8ds_v4": 1.264000, - "Standard_E16-8ds_v5": 1.264000, - "Standard_E16-8s_v3": 1.168000, - "Standard_E16-8s_v4": 1.104000, - "Standard_E16-8s_v5": 1.104000, - "Standard_E16_v3": 1.168000, - "Standard_E16_v4": 1.104000, - "Standard_E16_v5": 1.104000, - "Standard_E16a_v4": 1.104000, - "Standard_E16ads_v5": 1.152000, - "Standard_E16as_v4": 1.104000, - "Standard_E16as_v5": 0.992000, - "Standard_E16bds_v5": 1.476000, - "Standard_E16bs_v5": 1.316000, - "Standard_E16d_v4": 1.264000, - "Standard_E16d_v5": 1.264000, - "Standard_E16ds_v4": 1.264000, - "Standard_E16ds_v5": 1.264000, - "Standard_E16pds_v5": 1.012000, - "Standard_E16ps_v5": 0.883000, - "Standard_E16s_v3": 1.168000, - "Standard_E16s_v4": 1.104000, - "Standard_E16s_v5": 1.104000, - "Standard_E20_v3": 1.460000, - "Standard_E20_v4": 1.380000, - "Standard_E20_v5": 1.380000, - "Standard_E20a_v4": 1.380000, - "Standard_E20ads_v5": 1.440000, - "Standard_E20as_v4": 1.380000, - "Standard_E20as_v5": 1.240000, - "Standard_E20d_v4": 1.580000, - "Standard_E20d_v5": 1.580000, - "Standard_E20ds_v4": 1.580000, - "Standard_E20ds_v5": 1.580000, - "Standard_E20pds_v5": 1.265000, - "Standard_E20ps_v5": 1.104000, - "Standard_E20s_v3": 1.460000, - "Standard_E20s_v4": 1.380000, - "Standard_E20s_v5": 1.380000, - "Standard_E2_v3": 0.146000, - "Standard_E2_v4": 0.138000, - "Standard_E2_v5": 0.138000, - "Standard_E2a_v4": 0.138000, - "Standard_E2ads_v5": 0.144000, - "Standard_E2as_v4": 0.138000, - "Standard_E2as_v5": 0.124000, - "Standard_E2bds_v5": 0.185000, - "Standard_E2bs_v5": 0.165000, - "Standard_E2d_v4": 0.158000, - "Standard_E2d_v5": 0.158000, - "Standard_E2ds_v4": 0.158000, - "Standard_E2ds_v5": 0.158000, - "Standard_E2pds_v5": 0.127000, - "Standard_E2ps_v5": 0.110000, - "Standard_E2s_v3": 0.146000, - "Standard_E2s_v4": 0.138000, - "Standard_E2s_v5": 0.138000, - "Standard_E32-16ads_v5": 2.304000, - "Standard_E32-16as_v4": 2.208000, - "Standard_E32-16as_v5": 1.984000, - "Standard_E32-16ds_v4": 2.528000, - "Standard_E32-16ds_v5": 2.528000, - "Standard_E32-16s_v3": 2.336000, - "Standard_E32-16s_v4": 2.208000, - "Standard_E32-16s_v5": 2.208000, - "Standard_E32-8ads_v5": 2.304000, - "Standard_E32-8as_v4": 2.208000, - "Standard_E32-8as_v5": 1.984000, - "Standard_E32-8ds_v4": 2.528000, - "Standard_E32-8ds_v5": 2.528000, - "Standard_E32-8s_v3": 2.336000, - "Standard_E32-8s_v4": 2.208000, - "Standard_E32-8s_v5": 2.208000, - "Standard_E32_v3": 2.336000, - "Standard_E32_v4": 2.208000, - "Standard_E32_v5": 2.208000, - "Standard_E32a_v4": 2.208000, - "Standard_E32ads_v5": 2.304000, - "Standard_E32as_v4": 2.208000, - "Standard_E32as_v5": 1.984000, - "Standard_E32bds_v5": 2.952000, - "Standard_E32bs_v5": 2.632000, - "Standard_E32d_v4": 2.528000, - "Standard_E32d_v5": 2.528000, - "Standard_E32ds_v4": 2.528000, - "Standard_E32ds_v5": 2.528000, - "Standard_E32pds_v5": 2.024000, - "Standard_E32ps_v5": 1.766000, - "Standard_E32s_v3": 2.336000, - "Standard_E32s_v4": 2.208000, - "Standard_E32s_v5": 2.208000, - "Standard_E4-2ads_v5": 0.288000, - "Standard_E4-2as_v4": 0.276000, - "Standard_E4-2as_v5": 0.248000, - "Standard_E4-2ds_v4": 0.316000, - "Standard_E4-2ds_v5": 0.316000, - "Standard_E4-2s_v3": 0.292000, - "Standard_E4-2s_v4": 0.276000, - "Standard_E4-2s_v5": 0.276000, - "Standard_E48_v3": 3.311000, - "Standard_E48_v4": 3.312000, - "Standard_E48_v5": 3.312000, - "Standard_E48a_v4": 3.312000, - "Standard_E48ads_v5": 3.456000, - "Standard_E48as_v4": 3.312000, - "Standard_E48as_v5": 2.976000, - "Standard_E48bds_v5": 4.428000, - "Standard_E48bs_v5": 3.948000, - "Standard_E48d_v4": 3.792000, - "Standard_E48d_v5": 3.792000, - "Standard_E48ds_v4": 3.792000, - "Standard_E48ds_v5": 3.792000, - "Standard_E48s_v3": 3.311000, - "Standard_E48s_v4": 3.312000, - "Standard_E48s_v5": 3.312000, - "Standard_E4_v3": 0.292000, - "Standard_E4_v4": 0.276000, - "Standard_E4_v5": 0.276000, - "Standard_E4a_v4": 0.276000, - "Standard_E4ads_v5": 0.288000, - "Standard_E4as_v4": 0.276000, - "Standard_E4as_v5": 0.248000, - "Standard_E4bds_v5": 0.369000, - "Standard_E4bs_v5": 0.329000, - "Standard_E4d_v4": 0.316000, - "Standard_E4d_v5": 0.316000, - "Standard_E4ds_v4": 0.316000, - "Standard_E4ds_v5": 0.316000, - "Standard_E4pds_v5": 0.253000, - "Standard_E4ps_v5": 0.221000, - "Standard_E4s_v3": 0.292000, - "Standard_E4s_v4": 0.276000, - "Standard_E4s_v5": 0.276000, - "Standard_E64-16ads_v5": 4.608000, - "Standard_E64-16as_v4": 4.416000, - "Standard_E64-16as_v5": 3.968000, - "Standard_E64-16ds_v4": 5.056000, - "Standard_E64-16ds_v5": 5.056000, - "Standard_E64-16s_v3": 3.974000, - "Standard_E64-16s_v4": 4.416000, - "Standard_E64-16s_v5": 4.416000, - "Standard_E64-32ads_v5": 4.608000, - "Standard_E64-32as_v4": 4.416000, - "Standard_E64-32as_v5": 3.968000, - "Standard_E64-32ds_v4": 5.056000, - "Standard_E64-32ds_v5": 5.056000, - "Standard_E64-32s_v3": 3.974000, - "Standard_E64-32s_v4": 4.416000, - "Standard_E64-32s_v5": 4.416000, - "Standard_E64_v3": 3.974000, - "Standard_E64_v4": 4.416000, - "Standard_E64_v5": 4.416000, - "Standard_E64a_v4": 4.416000, - "Standard_E64ads_v5": 4.608000, - "Standard_E64as_v4": 4.416000, - "Standard_E64as_v5": 3.968000, - "Standard_E64bds_v5": 5.904000, - "Standard_E64bs_v5": 5.264000, - "Standard_E64d_v4": 5.056000, - "Standard_E64d_v5": 5.056000, - "Standard_E64ds_v4": 5.056000, - "Standard_E64ds_v5": 5.056000, - "Standard_E64i_v3": 3.974000, - "Standard_E64is_v3": 3.974000, - "Standard_E64s_v3": 3.974000, - "Standard_E64s_v4": 4.416000, - "Standard_E64s_v5": 4.416000, - "Standard_E8-2ads_v5": 0.576000, - "Standard_E8-2as_v4": 0.552000, - "Standard_E8-2as_v5": 0.496000, - "Standard_E8-2ds_v4": 0.632000, - "Standard_E8-2ds_v5": 0.632000, - "Standard_E8-2s_v3": 0.584000, - "Standard_E8-2s_v4": 0.552000, - "Standard_E8-2s_v5": 0.552000, - "Standard_E8-4ads_v5": 0.576000, - "Standard_E8-4as_v4": 0.552000, - "Standard_E8-4as_v5": 0.496000, - "Standard_E8-4ds_v4": 0.632000, - "Standard_E8-4ds_v5": 0.632000, - "Standard_E8-4s_v3": 0.584000, - "Standard_E8-4s_v4": 0.552000, - "Standard_E8-4s_v5": 0.552000, - "Standard_E80ids_v4": 6.320000, - "Standard_E80is_v4": 5.520000, - "Standard_E8_v3": 0.584000, - "Standard_E8_v4": 0.552000, - "Standard_E8_v5": 0.552000, - "Standard_E8a_v4": 0.552000, - "Standard_E8ads_v5": 0.576000, - "Standard_E8as_v4": 0.552000, - "Standard_E8as_v5": 0.496000, - "Standard_E8bds_v5": 0.738000, - "Standard_E8bs_v5": 0.658000, - "Standard_E8d_v4": 0.632000, - "Standard_E8d_v5": 0.632000, - "Standard_E8ds_v4": 0.632000, - "Standard_E8ds_v5": 0.632000, - "Standard_E8pds_v5": 0.506000, - "Standard_E8ps_v5": 0.442000, - "Standard_E8s_v3": 0.584000, - "Standard_E8s_v4": 0.552000, - "Standard_E8s_v5": 0.552000, - "Standard_E96-24ads_v5": 6.912000, - "Standard_E96-24as_v4": 6.624000, - "Standard_E96-24as_v5": 5.952000, - "Standard_E96-24ds_v5": 7.584000, - "Standard_E96-24s_v5": 6.624000, - "Standard_E96-48ads_v5": 6.912000, - "Standard_E96-48as_v4": 6.624000, - "Standard_E96-48as_v5": 5.952000, - "Standard_E96-48ds_v5": 7.584000, - "Standard_E96-48s_v5": 6.624000, - "Standard_E96_v5": 6.624000, - "Standard_E96a_v4": 6.624000, - "Standard_E96ads_v5": 6.912000, - "Standard_E96as_v4": 6.624000, - "Standard_E96as_v5": 5.952000, - "Standard_E96bds_v5": 8.856000, - "Standard_E96bs_v5": 7.896000, - "Standard_E96d_v5": 7.584000, - "Standard_E96ds_v5": 7.584000, - "Standard_E96iads_v5": 7.603000, - "Standard_E96ias_v4": 6.624000, - "Standard_E96ias_v5": 6.547000, - "Standard_E96s_v5": 6.624000, - "Standard_F1": 0.051900, - "Standard_F16": 0.830000, - "Standard_F16s": 0.830000, - "Standard_F16s_v2": 0.741000, - "Standard_F1s": 0.051900, - "Standard_F2": 0.104000, - "Standard_F2s": 0.104000, - "Standard_F2s_v2": 0.092700, - "Standard_F32s_v2": 1.482000, - "Standard_F4": 0.207000, - "Standard_F48s_v2": 2.224000, - "Standard_F4s": 0.207000, - "Standard_F4s_v2": 0.185000, - "Standard_F64s_v2": 2.965000, - "Standard_F72s_v2": 3.335000, - "Standard_F8": 0.415000, - "Standard_F8s": 0.415000, - "Standard_F8s_v2": 0.371000, - "Standard_FX12mds": 1.152000, - "Standard_FX24mds": 2.304000, - "Standard_FX36mds": 3.456000, - "Standard_FX48mds": 4.608000, - "Standard_FX4mds": 0.384000, - "Standard_G1": 0.484000, - "Standard_G2": 0.968000, - "Standard_G3": 1.936000, - "Standard_G4": 3.872000, - "Standard_G5": 7.744000, - "Standard_GS1": 0.484000, - "Standard_GS2": 0.968000, - "Standard_GS3": 1.936000, - "Standard_GS4": 3.872000, - "Standard_GS4-4": 3.872000, - "Standard_GS4-8": 3.872000, - "Standard_GS5": 7.744000, - "Standard_GS5-16": 7.744000, - "Standard_GS5-8": 7.744000, - "Standard_HB120-16rs_v2": 4.320000, - "Standard_HB120-32rs_v2": 4.320000, - "Standard_HB120-64rs_v2": 4.320000, - "Standard_HB120-96rs_v2": 4.320000, - "Standard_HB120rs_v2": 4.320000, - "Standard_HC44-16rs": 3.802000, - "Standard_HC44-32rs": 3.802000, - "Standard_HC44rs": 3.802000, - "Standard_L112ias_v3": 10.595000, - "Standard_L16as_v3": 1.376000, - "Standard_L16s": 1.376000, - "Standard_L16s_v3": 1.536000, - "Standard_L32as_v3": 2.752000, - "Standard_L32s": 2.752000, - "Standard_L32s_v3": 3.072000, - "Standard_L48as_v3": 4.128000, - "Standard_L48s_v3": 4.608000, - "Standard_L4s": 0.344000, - "Standard_L64as_v3": 5.504000, - "Standard_L64s_v3": 6.144000, - "Standard_L80as_v3": 6.880000, - "Standard_L80s_v3": 7.680000, - "Standard_L8as_v3": 0.688000, - "Standard_L8s": 0.688000, - "Standard_L8s_v3": 0.768000, - "Standard_L96ias_v3": 9.082000, - "Standard_M128": 14.671800, - "Standard_M128-32ms": 29.356800, - "Standard_M128-64ms": 29.356800, - "Standard_M128dms_v2": 29.359000, - "Standard_M128ds_v2": 14.674000, - "Standard_M128m": 29.356800, - "Standard_M128ms": 29.356800, - "Standard_M128ms_v2": 28.896000, - "Standard_M128s": 14.671800, - "Standard_M128s_v2": 14.211000, - "Standard_M16-4ms": 3.380300, - "Standard_M16-8ms": 3.380300, - "Standard_M16ms": 3.380300, - "Standard_M16s": 2.625700, - "Standard_M192idms_v2": 35.270000, - "Standard_M192ids_v2": 17.635000, - "Standard_M192ims_v2": 34.807000, - "Standard_M192is_v2": 17.172000, - "Standard_M208-104ms_v2": 53.544000, - "Standard_M208-104s_v2": 26.771000, - "Standard_M208-52ms_v2": 53.544000, - "Standard_M208-52s_v2": 26.771000, - "Standard_M208ms_v2": 53.544000, - "Standard_M208s_v2": 26.771000, - "Standard_M32-16ms": 6.760600, - "Standard_M32-8ms": 6.760600, - "Standard_M32dms_v2": 6.761000, - "Standard_M32ls": 3.160300, - "Standard_M32ms": 6.760600, - "Standard_M32ms_v2": 6.645000, - "Standard_M32s": 3.668500, - "Standard_M32ts": 2.977700, - "Standard_M416-104ms_v2": 118.980000, - "Standard_M416-104s_v2": 59.496000, - "Standard_M416-208ms_v2": 118.980000, - "Standard_M416-208s_v2": 59.496000, - "Standard_M416is_v2": 59.496000, - "Standard_M416ms_v2": 118.980000, - "Standard_M416s_8_v2": 79.330000, - "Standard_M416s_v2": 59.496000, - "Standard_M64": 7.335900, - "Standard_M64-16ms": 11.370700, - "Standard_M64-32ms": 11.370700, - "Standard_M64dms_v2": 11.374000, - "Standard_M64ds_v2": 7.336000, - "Standard_M64ls": 5.956500, - "Standard_M64m": 11.370700, - "Standard_M64ms": 11.370700, - "Standard_M64ms_v2": 11.143000, - "Standard_M64s": 7.335900, - "Standard_M64s_v2": 7.104000, - "Standard_M8-2ms": 1.690150, - "Standard_M8-4ms": 1.690150, - "Standard_M8ms": 1.690150, - "Standard_NC12s_v3": 6.732000, - "Standard_NC24rs_v3": 14.810000, - "Standard_NC24s_v3": 13.464000, - "Standard_NC6s_v3": 3.366000, - "Standard_ND96ams_A100_v4": 39.324000, - "Standard_ND96amsr_A100_v4": 39.324000, - "Standard_NV12ads_A10_v5": 1.090000, - "Standard_NV16as_v4": 1.118000, - "Standard_NV18ads_A10_v5": 1.920000, - "Standard_NV32as_v4": 2.237000, - "Standard_NV36adms_A10_v5": 5.424000, - "Standard_NV36ads_A10_v5": 3.840000, - "Standard_NV4as_v4": 0.280000, - "Standard_NV6ads_A10_v5": 0.545000, - "Standard_NV72ads_A10_v5": 7.824000, - "Standard_NV8as_v4": 0.559000, - } - // canadaeast - initialOnDemandPrices["canadaeast"] = map[string]float64{ - "Basic_A0": 0.020000, - "Basic_A1": 0.026000, - "Basic_A2": 0.087000, - "Basic_A3": 0.194000, - "Basic_A4": 0.387000, - "DCsv2 Type 1": 0.942000, - "Dadsv5_Type1": 7.084000, - "Dasv4_Type1": 5.885000, - "Dasv4_Type2": 5.885000, - "Dasv5_Type1": 5.914000, - "Ddsv4_Type 1": 4.435000, - "Ddsv4_Type2": 5.267000, - "Ddsv5_Type1": 6.653000, - "Dsv3_Type3": 4.709000, - "Dsv3_Type4": 5.886000, - "Dsv4_Type1": 4.708000, - "Dsv4_Type2": 5.650000, - "Dsv5_Type1": 5.885000, - "Eadsv5_Type1": 7.603000, - "Easv4_Type1": 7.286000, - "Easv4_Type2": 7.286000, - "Easv5_Type1": 6.547000, - "Ebdsv5-Type1": 6.494000, - "Ebsv5-Type1": 5.790000, - "Edsv4_Type 1": 5.562000, - "Edsv4_Type2": 7.231000, - "Edsv5_Type1": 8.342000, - "Esv3_Type3": 4.705000, - "Esv3_Type4": 6.375000, - "Esv4_Type1": 4.857000, - "Esv4_Type2": 6.376000, - "Esv5_Type1": 7.286000, - "FXmds Type1": 5.069000, - "Fsv2 Type3": 4.297000, - "Fsv2_Type2": 3.683000, - "Fsv2_Type4": 4.897000, - "Lasv3_Type1": 7.568000, - "Lsv3_Type1": 8.448000, - "Mdsmv2MedMem _Type1": 32.295000, - "Mdsv2MedMem_Type1": 16.141000, - "Msmv2MedMem Type1": 31.786000, - "Msmv2_Type1": 130.880000, - "Msv2MedMem Type1": 15.632000, - "Msv2_Type1": 65.446000, - "Standard_A0": 0.022000, - "Standard_A1": 0.056000, - "Standard_A1_v2": 0.043000, - "Standard_A2": 0.111000, - "Standard_A2_v2": 0.091000, - "Standard_A2m_v2": 0.129000, - "Standard_A3": 0.222000, - "Standard_A4": 0.446000, - "Standard_A4_v2": 0.191000, - "Standard_A4m_v2": 0.270000, - "Standard_A5": 0.242000, - "Standard_A6": 0.484000, - "Standard_A7": 0.968000, - "Standard_A8_v2": 0.400000, - "Standard_A8m_v2": 0.568000, - "Standard_B12ms": 0.557000, - "Standard_B16als_v2": 0.666000, - "Standard_B16as_v2": 0.669000, - "Standard_B16ls_v2": 0.731000, - "Standard_B16ms": 0.742000, - "Standard_B16s_v2": 0.816000, - "Standard_B1ls": 0.005800, - "Standard_B1ms": 0.023200, - "Standard_B1s": 0.011600, - "Standard_B20ms": 0.928000, - "Standard_B2als_v2": 0.041800, - "Standard_B2as_v2": 0.083600, - "Standard_B2ats_v2": 0.019700, - "Standard_B2ls_v2": 0.046400, - "Standard_B2ms": 0.092800, - "Standard_B2s": 0.046400, - "Standard_B2s_v2": 0.092800, - "Standard_B2ts_v2": 0.020800, - "Standard_B32als_v2": 1.184000, - "Standard_B32as_v2": 1.338000, - "Standard_B32ls_v2": 1.315000, - "Standard_B32s_v2": 1.485000, - "Standard_B4als_v2": 0.148000, - "Standard_B4as_v2": 0.167000, - "Standard_B4ls_v2": 0.183000, - "Standard_B4ms": 0.186000, - "Standard_B4s_v2": 0.186000, - "Standard_B8als_v2": 0.333000, - "Standard_B8as_v2": 0.371000, - "Standard_B8ls_v2": 0.366000, - "Standard_B8ms": 0.371000, - "Standard_B8s_v2": 0.408000, - "Standard_D11_v2": 0.183000, - "Standard_D11_v2_Promo": 0.183000, - "Standard_D12_v2": 0.366000, - "Standard_D12_v2_Promo": 0.366000, - "Standard_D13_v2": 0.732000, - "Standard_D13_v2_Promo": 0.732000, - "Standard_D14_v2": 1.463000, - "Standard_D14_v2_Promo": 1.463000, - "Standard_D15_v2": 1.829000, - "Standard_D15i_v2": 1.829000, - "Standard_D16_v3": 0.888000, - "Standard_D16_v4": 0.856000, - "Standard_D16_v5": 0.856000, - "Standard_D16a_v4": 0.856000, - "Standard_D16ads_v5": 0.920000, - "Standard_D16as_v4": 0.856000, - "Standard_D16as_v5": 0.768000, - "Standard_D16as_v5_Promo": 0.685000, - "Standard_D16d_v4": 1.008000, - "Standard_D16d_v5": 1.008000, - "Standard_D16ds_v4": 1.008000, - "Standard_D16ds_v5": 1.008000, - "Standard_D16lds_v5": 0.848000, - "Standard_D16ls_v5": 0.744000, - "Standard_D16s_v3": 0.888000, - "Standard_D16s_v4": 0.856000, - "Standard_D16s_v5": 0.856000, - "Standard_D1_v2": 0.070000, - "Standard_D2_v2": 0.140000, - "Standard_D2_v2_Promo": 0.140000, - "Standard_D2_v3": 0.111000, - "Standard_D2_v4": 0.107000, - "Standard_D2_v5": 0.107000, - "Standard_D2a_v4": 0.107000, - "Standard_D2ads_v5": 0.115000, - "Standard_D2as_v4": 0.107000, - "Standard_D2as_v5": 0.096000, - "Standard_D2as_v5_Promo": 0.085600, - "Standard_D2d_v4": 0.126000, - "Standard_D2d_v5": 0.126000, - "Standard_D2ds_v4": 0.126000, - "Standard_D2ds_v5": 0.126000, - "Standard_D2lds_v5": 0.106000, - "Standard_D2ls_v5": 0.093000, - "Standard_D2s_v3": 0.111000, - "Standard_D2s_v4": 0.107000, - "Standard_D2s_v5": 0.107000, - "Standard_D32-16s_v3": 1.776000, - "Standard_D32-8s_v3": 1.776000, - "Standard_D32_v3": 1.776000, - "Standard_D32_v4": 1.712000, - "Standard_D32_v5": 1.712000, - "Standard_D32a_v4": 1.712000, - "Standard_D32ads_v5": 1.840000, - "Standard_D32as_v4": 1.712000, - "Standard_D32as_v5": 1.536000, - "Standard_D32as_v5_Promo": 1.370000, - "Standard_D32d_v4": 2.016000, - "Standard_D32d_v5": 2.016000, - "Standard_D32ds_v4": 2.016000, - "Standard_D32ds_v5": 2.016000, - "Standard_D32lds_v5": 1.696000, - "Standard_D32ls_v5": 1.488000, - "Standard_D32s_v3": 1.776000, - "Standard_D32s_v4": 1.712000, - "Standard_D32s_v5": 1.712000, - "Standard_D3_v2": 0.280000, - "Standard_D3_v2_Promo": 0.280000, - "Standard_D48_v3": 2.664000, - "Standard_D48_v4": 2.568000, - "Standard_D48_v5": 2.568000, - "Standard_D48a_v4": 2.568000, - "Standard_D48ads_v5": 2.760000, - "Standard_D48as_v4": 2.568000, - "Standard_D48as_v5": 2.304000, - "Standard_D48as_v5_Promo": 2.054000, - "Standard_D48d_v4": 3.024000, - "Standard_D48d_v5": 3.024000, - "Standard_D48ds_v4": 3.024000, - "Standard_D48ds_v5": 3.024000, - "Standard_D48lds_v5": 2.544000, - "Standard_D48ls_v5": 2.232000, - "Standard_D48s_v3": 2.664000, - "Standard_D48s_v4": 2.568000, - "Standard_D48s_v5": 2.568000, - "Standard_D4_v2": 0.560000, - "Standard_D4_v2_Promo": 0.560000, - "Standard_D4_v3": 0.222000, - "Standard_D4_v4": 0.214000, - "Standard_D4_v5": 0.214000, - "Standard_D4a_v4": 0.214000, - "Standard_D4ads_v5": 0.230000, - "Standard_D4as_v4": 0.214000, - "Standard_D4as_v5": 0.192000, - "Standard_D4as_v5_Promo": 0.171000, - "Standard_D4d_v4": 0.252000, - "Standard_D4d_v5": 0.252000, - "Standard_D4ds_v4": 0.252000, - "Standard_D4ds_v5": 0.252000, - "Standard_D4lds_v5": 0.212000, - "Standard_D4ls_v5": 0.186000, - "Standard_D4s_v3": 0.222000, - "Standard_D4s_v4": 0.214000, - "Standard_D4s_v5": 0.214000, - "Standard_D5_v2": 1.120000, - "Standard_D5_v2_Promo": 1.120000, - "Standard_D64-16s_v3": 3.552000, - "Standard_D64-32s_v3": 3.552000, - "Standard_D64_v3": 3.552000, - "Standard_D64_v4": 3.424000, - "Standard_D64_v5": 3.424000, - "Standard_D64a_v4": 3.424000, - "Standard_D64ads_v5": 3.680000, - "Standard_D64as_v4": 3.424000, - "Standard_D64as_v5": 3.072000, - "Standard_D64as_v5_Promo": 2.739000, - "Standard_D64d_v4": 4.032000, - "Standard_D64d_v5": 4.032000, - "Standard_D64ds_v4": 4.032000, - "Standard_D64ds_v5": 4.032000, - "Standard_D64lds_v5": 3.392000, - "Standard_D64ls_v5": 2.976000, - "Standard_D64s_v3": 3.552000, - "Standard_D64s_v4": 3.424000, - "Standard_D64s_v5": 3.424000, - "Standard_D8_v3": 0.444000, - "Standard_D8_v4": 0.428000, - "Standard_D8_v5": 0.428000, - "Standard_D8a_v4": 0.428000, - "Standard_D8ads_v5": 0.460000, - "Standard_D8as_v4": 0.428000, - "Standard_D8as_v5": 0.384000, - "Standard_D8as_v5_Promo": 0.342000, - "Standard_D8d_v4": 0.504000, - "Standard_D8d_v5": 0.504000, - "Standard_D8ds_v4": 0.504000, - "Standard_D8ds_v5": 0.504000, - "Standard_D8lds_v5": 0.424000, - "Standard_D8ls_v5": 0.372000, - "Standard_D8s_v3": 0.444000, - "Standard_D8s_v4": 0.428000, - "Standard_D8s_v5": 0.428000, - "Standard_D96_v5": 5.136000, - "Standard_D96a_v4": 5.136000, - "Standard_D96ads_v5": 5.520000, - "Standard_D96as_v4": 5.136000, - "Standard_D96as_v5": 4.608000, - "Standard_D96as_v5_Promo": 4.109000, - "Standard_D96d_v5": 6.048000, - "Standard_D96ds_v5": 6.048000, - "Standard_D96lds_v5": 5.088000, - "Standard_D96ls_v5": 4.464000, - "Standard_D96s_v5": 5.136000, - "Standard_DC1s_v2": 0.107000, - "Standard_DC2s_v2": 0.214000, - "Standard_DC4s_v2": 0.428000, - "Standard_DC8_v2": 0.856000, - "Standard_DS11-1_v2": 0.183000, - "Standard_DS11_v2": 0.183000, - "Standard_DS11_v2_Promo": 0.183000, - "Standard_DS12-1_v2": 0.366000, - "Standard_DS12-2_v2": 0.366000, - "Standard_DS12_v2": 0.366000, - "Standard_DS12_v2_Promo": 0.366000, - "Standard_DS13-2_v2": 0.732000, - "Standard_DS13-4_v2": 0.732000, - "Standard_DS13_v2": 0.732000, - "Standard_DS13_v2_Promo": 0.732000, - "Standard_DS14-4_v2": 1.463000, - "Standard_DS14-8_v2": 1.463000, - "Standard_DS14_v2": 1.463000, - "Standard_DS14_v2_Promo": 1.463000, - "Standard_DS15_v2": 1.829000, - "Standard_DS15i_v2": 1.829000, - "Standard_DS1_v2": 0.070000, - "Standard_DS2_v2": 0.140000, - "Standard_DS2_v2_Promo": 0.140000, - "Standard_DS3_v2": 0.280000, - "Standard_DS3_v2_Promo": 0.280000, - "Standard_DS4_v2": 0.560000, - "Standard_DS4_v2_Promo": 0.560000, - "Standard_DS5_v2": 1.120000, - "Standard_DS5_v2_Promo": 1.120000, - "Standard_E104i_v5": 7.894000, - "Standard_E104id_v5": 9.038000, - "Standard_E104ids_v5": 9.038000, - "Standard_E104is_v5": 7.894000, - "Standard_E112iads_v5": 8.870000, - "Standard_E112ias_v5": 7.638000, - "Standard_E112ibds_v5": 11.365000, - "Standard_E112ibs_v5": 10.133000, - "Standard_E16-4ads_v5": 1.152000, - "Standard_E16-4as_v4": 1.104000, - "Standard_E16-4as_v5": 0.992000, - "Standard_E16-4ds_v4": 1.264000, - "Standard_E16-4ds_v5": 1.264000, - "Standard_E16-4s_v3": 1.168000, - "Standard_E16-4s_v4": 1.104000, - "Standard_E16-4s_v5": 1.104000, - "Standard_E16-8ads_v5": 1.152000, - "Standard_E16-8as_v4": 1.104000, - "Standard_E16-8as_v5": 0.992000, - "Standard_E16-8ds_v4": 1.264000, - "Standard_E16-8ds_v5": 1.264000, - "Standard_E16-8s_v3": 1.168000, - "Standard_E16-8s_v4": 1.104000, - "Standard_E16-8s_v5": 1.104000, - "Standard_E16_v3": 1.168000, - "Standard_E16_v4": 1.104000, - "Standard_E16_v5": 1.104000, - "Standard_E16a_v4": 1.104000, - "Standard_E16ads_v5": 1.152000, - "Standard_E16as_v4": 1.104000, - "Standard_E16as_v5": 0.992000, - "Standard_E16bds_v5": 1.476000, - "Standard_E16bs_v5": 1.316000, - "Standard_E16d_v4": 1.264000, - "Standard_E16d_v5": 1.264000, - "Standard_E16ds_v4": 1.264000, - "Standard_E16ds_v5": 1.264000, - "Standard_E16s_v3": 1.168000, - "Standard_E16s_v4": 1.104000, - "Standard_E16s_v5": 1.104000, - "Standard_E20_v3": 1.460000, - "Standard_E20_v4": 1.380000, - "Standard_E20_v5": 1.380000, - "Standard_E20a_v4": 1.380000, - "Standard_E20ads_v5": 1.440000, - "Standard_E20as_v4": 1.380000, - "Standard_E20as_v5": 1.240000, - "Standard_E20d_v4": 1.580000, - "Standard_E20d_v5": 1.580000, - "Standard_E20ds_v4": 1.580000, - "Standard_E20ds_v5": 1.580000, - "Standard_E20s_v3": 1.460000, - "Standard_E20s_v4": 1.380000, - "Standard_E20s_v5": 1.380000, - "Standard_E2_v3": 0.146000, - "Standard_E2_v4": 0.138000, - "Standard_E2_v5": 0.138000, - "Standard_E2a_v4": 0.138000, - "Standard_E2ads_v5": 0.144000, - "Standard_E2as_v4": 0.138000, - "Standard_E2as_v5": 0.124000, - "Standard_E2bds_v5": 0.185000, - "Standard_E2bs_v5": 0.165000, - "Standard_E2d_v4": 0.158000, - "Standard_E2d_v5": 0.158000, - "Standard_E2ds_v4": 0.158000, - "Standard_E2ds_v5": 0.158000, - "Standard_E2s_v3": 0.146000, - "Standard_E2s_v4": 0.138000, - "Standard_E2s_v5": 0.138000, - "Standard_E32-16ads_v5": 2.304000, - "Standard_E32-16as_v4": 2.208000, - "Standard_E32-16as_v5": 1.984000, - "Standard_E32-16ds_v4": 2.528000, - "Standard_E32-16ds_v5": 2.528000, - "Standard_E32-16s_v3": 2.336000, - "Standard_E32-16s_v4": 2.208000, - "Standard_E32-16s_v5": 2.208000, - "Standard_E32-8ads_v5": 2.304000, - "Standard_E32-8as_v4": 2.208000, - "Standard_E32-8as_v5": 1.984000, - "Standard_E32-8ds_v4": 2.528000, - "Standard_E32-8ds_v5": 2.528000, - "Standard_E32-8s_v3": 2.336000, - "Standard_E32-8s_v4": 2.208000, - "Standard_E32-8s_v5": 2.208000, - "Standard_E32_v3": 2.336000, - "Standard_E32_v4": 2.208000, - "Standard_E32_v5": 2.208000, - "Standard_E32a_v4": 2.208000, - "Standard_E32ads_v5": 2.304000, - "Standard_E32as_v4": 2.208000, - "Standard_E32as_v5": 1.984000, - "Standard_E32bds_v5": 2.952000, - "Standard_E32bs_v5": 2.632000, - "Standard_E32d_v4": 2.528000, - "Standard_E32d_v5": 2.528000, - "Standard_E32ds_v4": 2.528000, - "Standard_E32ds_v5": 2.528000, - "Standard_E32s_v3": 2.336000, - "Standard_E32s_v4": 2.208000, - "Standard_E32s_v5": 2.208000, - "Standard_E4-2ads_v5": 0.288000, - "Standard_E4-2as_v4": 0.276000, - "Standard_E4-2as_v5": 0.248000, - "Standard_E4-2ds_v4": 0.316000, - "Standard_E4-2ds_v5": 0.316000, - "Standard_E4-2s_v3": 0.292000, - "Standard_E4-2s_v4": 0.276000, - "Standard_E4-2s_v5": 0.276000, - "Standard_E48_v3": 3.311000, - "Standard_E48_v4": 3.312000, - "Standard_E48_v5": 3.312000, - "Standard_E48a_v4": 3.312000, - "Standard_E48ads_v5": 3.456000, - "Standard_E48as_v4": 3.312000, - "Standard_E48as_v5": 2.976000, - "Standard_E48bds_v5": 4.428000, - "Standard_E48bs_v5": 3.948000, - "Standard_E48d_v4": 3.792000, - "Standard_E48d_v5": 3.792000, - "Standard_E48ds_v4": 3.792000, - "Standard_E48ds_v5": 3.792000, - "Standard_E48s_v3": 3.311000, - "Standard_E48s_v4": 3.312000, - "Standard_E48s_v5": 3.312000, - "Standard_E4_v3": 0.292000, - "Standard_E4_v4": 0.276000, - "Standard_E4_v5": 0.276000, - "Standard_E4a_v4": 0.276000, - "Standard_E4ads_v5": 0.288000, - "Standard_E4as_v4": 0.276000, - "Standard_E4as_v5": 0.248000, - "Standard_E4bds_v5": 0.369000, - "Standard_E4bs_v5": 0.329000, - "Standard_E4d_v4": 0.316000, - "Standard_E4d_v5": 0.316000, - "Standard_E4ds_v4": 0.316000, - "Standard_E4ds_v5": 0.316000, - "Standard_E4s_v3": 0.292000, - "Standard_E4s_v4": 0.276000, - "Standard_E4s_v5": 0.276000, - "Standard_E64-16ads_v5": 4.608000, - "Standard_E64-16as_v4": 4.416000, - "Standard_E64-16as_v5": 3.968000, - "Standard_E64-16ds_v4": 5.056000, - "Standard_E64-16ds_v5": 5.056000, - "Standard_E64-16s_v3": 3.974000, - "Standard_E64-16s_v4": 4.416000, - "Standard_E64-16s_v5": 4.416000, - "Standard_E64-32ads_v5": 4.608000, - "Standard_E64-32as_v4": 4.416000, - "Standard_E64-32as_v5": 3.968000, - "Standard_E64-32ds_v4": 5.056000, - "Standard_E64-32ds_v5": 5.056000, - "Standard_E64-32s_v3": 3.974000, - "Standard_E64-32s_v4": 4.416000, - "Standard_E64-32s_v5": 4.416000, - "Standard_E64_v3": 3.974000, - "Standard_E64_v4": 4.416000, - "Standard_E64_v5": 4.416000, - "Standard_E64a_v4": 4.416000, - "Standard_E64ads_v5": 4.608000, - "Standard_E64as_v4": 4.416000, - "Standard_E64as_v5": 3.968000, - "Standard_E64bds_v5": 5.904000, - "Standard_E64bs_v5": 5.264000, - "Standard_E64d_v4": 5.056000, - "Standard_E64d_v5": 5.056000, - "Standard_E64ds_v4": 5.056000, - "Standard_E64ds_v5": 5.056000, - "Standard_E64i_v3": 3.974000, - "Standard_E64is_v3": 3.974000, - "Standard_E64s_v3": 3.974000, - "Standard_E64s_v4": 4.416000, - "Standard_E64s_v5": 4.416000, - "Standard_E8-2ads_v5": 0.576000, - "Standard_E8-2as_v4": 0.552000, - "Standard_E8-2as_v5": 0.496000, - "Standard_E8-2ds_v4": 0.632000, - "Standard_E8-2ds_v5": 0.632000, - "Standard_E8-2s_v3": 0.584000, - "Standard_E8-2s_v4": 0.552000, - "Standard_E8-2s_v5": 0.552000, - "Standard_E8-4ads_v5": 0.576000, - "Standard_E8-4as_v4": 0.552000, - "Standard_E8-4as_v5": 0.496000, - "Standard_E8-4ds_v4": 0.632000, - "Standard_E8-4ds_v5": 0.632000, - "Standard_E8-4s_v3": 0.584000, - "Standard_E8-4s_v4": 0.552000, - "Standard_E8-4s_v5": 0.552000, - "Standard_E80ids_v4": 6.320000, - "Standard_E80is_v4": 5.520000, - "Standard_E8_v3": 0.584000, - "Standard_E8_v4": 0.552000, - "Standard_E8_v5": 0.552000, - "Standard_E8a_v4": 0.552000, - "Standard_E8ads_v5": 0.576000, - "Standard_E8as_v4": 0.552000, - "Standard_E8as_v5": 0.496000, - "Standard_E8bds_v5": 0.738000, - "Standard_E8bs_v5": 0.658000, - "Standard_E8d_v4": 0.632000, - "Standard_E8d_v5": 0.632000, - "Standard_E8ds_v4": 0.632000, - "Standard_E8ds_v5": 0.632000, - "Standard_E8s_v3": 0.584000, - "Standard_E8s_v4": 0.552000, - "Standard_E8s_v5": 0.552000, - "Standard_E96-24ads_v5": 6.912000, - "Standard_E96-24as_v4": 6.624000, - "Standard_E96-24as_v5": 5.952000, - "Standard_E96-24ds_v5": 7.584000, - "Standard_E96-24s_v5": 6.624000, - "Standard_E96-48ads_v5": 6.912000, - "Standard_E96-48as_v4": 6.624000, - "Standard_E96-48as_v5": 5.952000, - "Standard_E96-48ds_v5": 7.584000, - "Standard_E96-48s_v5": 6.624000, - "Standard_E96_v5": 6.624000, - "Standard_E96a_v4": 6.624000, - "Standard_E96ads_v5": 6.912000, - "Standard_E96as_v4": 6.624000, - "Standard_E96as_v5": 5.952000, - "Standard_E96bds_v5": 8.856000, - "Standard_E96bs_v5": 7.896000, - "Standard_E96d_v5": 7.584000, - "Standard_E96ds_v5": 7.584000, - "Standard_E96iads_v5": 7.603000, - "Standard_E96ias_v4": 6.624000, - "Standard_E96ias_v5": 6.547000, - "Standard_E96s_v5": 6.624000, - "Standard_F1": 0.054600, - "Standard_F16": 0.874000, - "Standard_F16s": 0.874000, - "Standard_F16s_v2": 0.741000, - "Standard_F1s": 0.054600, - "Standard_F2": 0.109000, - "Standard_F2s": 0.109000, - "Standard_F2s_v2": 0.092700, - "Standard_F32s_v2": 1.482000, - "Standard_F4": 0.218000, - "Standard_F48s_v2": 2.224000, - "Standard_F4s": 0.218000, - "Standard_F4s_v2": 0.185000, - "Standard_F64s_v2": 2.965000, - "Standard_F72s_v2": 3.335000, - "Standard_F8": 0.437000, - "Standard_F8s": 0.437000, - "Standard_F8s_v2": 0.371000, - "Standard_FX12mds": 1.152000, - "Standard_FX24mds": 2.304000, - "Standard_FX36mds": 3.456000, - "Standard_FX48mds": 4.608000, - "Standard_FX4mds": 0.384000, - "Standard_G1": 0.484000, - "Standard_G2": 0.968000, - "Standard_G3": 1.936000, - "Standard_G4": 3.872000, - "Standard_G5": 7.744000, - "Standard_GS1": 0.484000, - "Standard_GS2": 0.968000, - "Standard_GS3": 1.936000, - "Standard_GS4": 3.872000, - "Standard_GS4-4": 3.872000, - "Standard_GS4-8": 3.872000, - "Standard_GS5": 7.744000, - "Standard_GS5-16": 7.744000, - "Standard_GS5-8": 7.744000, - "Standard_L16as_v3": 1.376000, - "Standard_L16s": 1.376000, - "Standard_L16s_v3": 1.536000, - "Standard_L32as_v3": 2.752000, - "Standard_L32s": 2.752000, - "Standard_L32s_v3": 3.072000, - "Standard_L48as_v3": 4.128000, - "Standard_L48s_v3": 4.608000, - "Standard_L4s": 0.344000, - "Standard_L64as_v3": 5.504000, - "Standard_L64s_v3": 6.144000, - "Standard_L80as_v3": 6.880000, - "Standard_L80s_v3": 7.680000, - "Standard_L8as_v3": 0.688000, - "Standard_L8s": 0.688000, - "Standard_L8s_v3": 0.768000, - "Standard_M128": 14.671800, - "Standard_M128-32ms": 29.356800, - "Standard_M128-64ms": 29.356800, - "Standard_M128dms_v2": 29.359000, - "Standard_M128ds_v2": 14.674000, - "Standard_M128m": 29.356800, - "Standard_M128ms": 29.356800, - "Standard_M128ms_v2": 28.896000, - "Standard_M128s": 14.671800, - "Standard_M128s_v2": 14.211000, - "Standard_M16-4ms": 3.380300, - "Standard_M16-8ms": 3.380300, - "Standard_M16ms": 3.380300, - "Standard_M16s": 2.625700, - "Standard_M192idms_v2": 35.270000, - "Standard_M192ids_v2": 17.635000, - "Standard_M192ims_v2": 34.807000, - "Standard_M192is_v2": 17.172000, - "Standard_M208-104ms_v2": 53.544000, - "Standard_M208-104s_v2": 26.771000, - "Standard_M208-52ms_v2": 53.544000, - "Standard_M208-52s_v2": 26.771000, - "Standard_M208ms_v2": 53.544000, - "Standard_M208s_v2": 26.771000, - "Standard_M32-16ms": 6.760600, - "Standard_M32-8ms": 6.760600, - "Standard_M32dms_v2": 6.761000, - "Standard_M32ls": 3.160300, - "Standard_M32ms": 6.760600, - "Standard_M32ms_v2": 6.645000, - "Standard_M32s": 3.668500, - "Standard_M32ts": 2.977700, - "Standard_M416-104ms_v2": 118.980000, - "Standard_M416-104s_v2": 59.496000, - "Standard_M416-208ms_v2": 118.980000, - "Standard_M416-208s_v2": 59.496000, - "Standard_M416is_v2": 59.496000, - "Standard_M416ms_v2": 118.980000, - "Standard_M416s_8_v2": 79.330000, - "Standard_M416s_v2": 59.496000, - "Standard_M64": 7.335900, - "Standard_M64-16ms": 11.370700, - "Standard_M64-32ms": 11.370700, - "Standard_M64dms_v2": 11.374000, - "Standard_M64ds_v2": 7.336000, - "Standard_M64ls": 5.956500, - "Standard_M64m": 11.370700, - "Standard_M64ms": 11.370700, - "Standard_M64ms_v2": 11.143000, - "Standard_M64s": 7.335900, - "Standard_M64s_v2": 7.104000, - "Standard_M8-2ms": 1.690150, - "Standard_M8-4ms": 1.690150, - "Standard_M8ms": 1.690150, - "Standard_ND96ams_A100_v4": 39.324000, - "Standard_ND96amsr_A100_v4": 39.324000, - } - // centralindia - initialOnDemandPrices["centralindia"] = map[string]float64{ - "Basic_A0": 0.018000, - "Basic_A1": 0.030000, - "Basic_A2": 0.096000, - "Basic_A3": 0.232000, - "Basic_A4": 0.464000, - "DCdsv3 Type1": 6.336000, - "DCsv3 Type1": 5.333000, - "Dadsv5_Type1": 4.133000, - "Dasv4_Type1": 5.333000, - "Dasv4_Type2": 5.333000, - "Dasv5_Type1": 3.422000, - "Ddsv4_Type 1": 4.294000, - "Ddsv4_Type2": 5.100000, - "Ddsv5_Type1": 6.442000, - "Dsv3_Type3": 4.445000, - "Dsv3_Type4": 5.556000, - "Dsv4_Type1": 4.444000, - "Dsv4_Type2": 5.333000, - "Dsv5_Type1": 5.555000, - "Eadsv5_Type1": 4.385000, - "Easv4_Type1": 6.864000, - "Easv4_Type2": 6.864000, - "Easv5_Type1": 3.775000, - "Ebdsv5-Type1": 6.195000, - "Ebsv5-Type1": 5.456000, - "Edsv4_Type 1": 5.315000, - "Edsv4_Type2": 6.312000, - "Edsv5_Type1": 7.973000, - "Esv3_Type3": 4.506000, - "Esv3_Type4": 6.105000, - "Esv4_Type1": 4.576000, - "Esv4_Type2": 6.006000, - "Esv5_Type1": 6.864000, - "FXmds Type1": 5.174000, - "Fsv2 Type3": 3.927000, - "Fsv2_Type2": 3.366000, - "Lsv2_Type1": 7.788000, - "Lsv3_Type1": 8.712000, - "Mdsmv2MedMem _Type1": 30.290000, - "Mdsv2MedMem_Type1": 15.139000, - "Ms_Type1": 15.134000, - "Msm_Type1": 30.294000, - "Msmv2MedMem Type1": 29.812000, - "Msmv2_Type1": 112.340000, - "Msv2MedMem Type1": 14.662000, - "Msv2_Type1": 56.174000, - "NVasv4_Type1": 10.047000, - "NVsv3_Type1": 7.022000, - "Standard_A0": 0.020000, - "Standard_A1": 0.066000, - "Standard_A1_v2": 0.047000, - "Standard_A2": 0.131000, - "Standard_A2_v2": 0.098000, - "Standard_A2m_v2": 0.158000, - "Standard_A3": 0.262000, - "Standard_A4": 0.524000, - "Standard_A4_v2": 0.206000, - "Standard_A4m_v2": 0.333000, - "Standard_A5": 0.260000, - "Standard_A6": 0.520000, - "Standard_A7": 1.040000, - "Standard_A8_v2": 0.433000, - "Standard_A8m_v2": 0.699000, - "Standard_B12ms": 0.538000, - "Standard_B16als_v2": 0.349000, - "Standard_B16as_v2": 0.467000, - "Standard_B16ls_v2": 0.708000, - "Standard_B16ms": 0.717000, - "Standard_B16pls_v2": 0.391000, - "Standard_B16ps_v2": 0.432000, - "Standard_B16s_v2": 0.790000, - "Standard_B1ls": 0.005600, - "Standard_B1ms": 0.022400, - "Standard_B1s": 0.011200, - "Standard_B20ms": 0.896000, - "Standard_B2als_v2": 0.024600, - "Standard_B2as_v2": 0.058400, - "Standard_B2ats_v2": 0.006150, - "Standard_B2ls_v2": 0.044800, - "Standard_B2ms": 0.089600, - "Standard_B2pls_v2": 0.022400, - "Standard_B2ps_v2": 0.044800, - "Standard_B2pts_v2": 0.005600, - "Standard_B2s": 0.044800, - "Standard_B2s_v2": 0.089600, - "Standard_B2ts_v2": 0.011200, - "Standard_B32als_v2": 0.844000, - "Standard_B32as_v2": 0.934000, - "Standard_B32ls_v2": 1.417000, - "Standard_B32s_v2": 1.434000, - "Standard_B4als_v2": 0.106000, - "Standard_B4as_v2": 0.098400, - "Standard_B4ls_v2": 0.177000, - "Standard_B4ms": 0.179000, - "Standard_B4pls_v2": 0.097700, - "Standard_B4ps_v2": 0.108000, - "Standard_B4s_v2": 0.198000, - "Standard_B8als_v2": 0.211000, - "Standard_B8as_v2": 0.234000, - "Standard_B8ls_v2": 0.317000, - "Standard_B8ms": 0.358000, - "Standard_B8pls_v2": 0.159000, - "Standard_B8ps_v2": 0.216000, - "Standard_B8s_v2": 0.358000, - "Standard_D1": 0.070500, - "Standard_D11": 0.182000, - "Standard_D11_v2": 0.189000, - "Standard_D11_v2_Promo": 0.189000, - "Standard_D12": 0.365000, - "Standard_D12_v2": 0.379000, - "Standard_D12_v2_Promo": 0.379000, - "Standard_D13": 0.730000, - "Standard_D13_v2": 0.758000, - "Standard_D13_v2_Promo": 0.758000, - "Standard_D14": 1.460000, - "Standard_D14_v2": 1.516000, - "Standard_D14_v2_Promo": 1.516000, - "Standard_D15_v2": 1.895000, - "Standard_D15i_v2": 1.895000, - "Standard_D16_v3": 0.840000, - "Standard_D16_v4": 0.808000, - "Standard_D16_v5": 0.808000, - "Standard_D16a_v4": 0.493000, - "Standard_D16ads_v5": 0.537000, - "Standard_D16as_v4": 0.493000, - "Standard_D16as_v5": 0.444000, - "Standard_D16as_v5_Promo": 0.405000, - "Standard_D16d_v4": 0.976000, - "Standard_D16d_v5": 0.976000, - "Standard_D16ds_v4": 0.976000, - "Standard_D16ds_v5": 0.976000, - "Standard_D16lds_v5": 0.792000, - "Standard_D16ls_v5": 0.680000, - "Standard_D16pds_v5": 0.483000, - "Standard_D16plds_v5": 0.392000, - "Standard_D16pls_v5": 0.341000, - "Standard_D16ps_v5": 0.405000, - "Standard_D16s_v3": 0.840000, - "Standard_D16s_v4": 0.808000, - "Standard_D16s_v5": 0.808000, - "Standard_D1_v2": 0.084000, - "Standard_D2": 0.141000, - "Standard_D2_v2": 0.169000, - "Standard_D2_v2_Promo": 0.169000, - "Standard_D2_v3": 0.105000, - "Standard_D2_v4": 0.101000, - "Standard_D2_v5": 0.101000, - "Standard_D2a_v4": 0.062200, - "Standard_D2ads_v5": 0.067100, - "Standard_D2as_v4": 0.062200, - "Standard_D2as_v5": 0.055600, - "Standard_D2as_v5_Promo": 0.050600, - "Standard_D2d_v4": 0.122000, - "Standard_D2d_v5": 0.122000, - "Standard_D2ds_v4": 0.122000, - "Standard_D2ds_v5": 0.122000, - "Standard_D2lds_v5": 0.099000, - "Standard_D2ls_v5": 0.085000, - "Standard_D2pds_v5": 0.060400, - "Standard_D2plds_v5": 0.049000, - "Standard_D2pls_v5": 0.042600, - "Standard_D2ps_v5": 0.050600, - "Standard_D2s_v3": 0.105000, - "Standard_D2s_v4": 0.101000, - "Standard_D2s_v5": 0.101000, - "Standard_D3": 0.282000, - "Standard_D32-16s_v3": 1.680000, - "Standard_D32-8s_v3": 1.680000, - "Standard_D32_v3": 1.680000, - "Standard_D32_v4": 1.616000, - "Standard_D32_v5": 1.616000, - "Standard_D32a_v4": 0.987000, - "Standard_D32ads_v5": 1.074000, - "Standard_D32as_v4": 0.987000, - "Standard_D32as_v5": 0.889000, - "Standard_D32as_v5_Promo": 0.810000, - "Standard_D32d_v4": 1.952000, - "Standard_D32d_v5": 1.952000, - "Standard_D32ds_v4": 1.952000, - "Standard_D32ds_v5": 1.952000, - "Standard_D32lds_v5": 1.584000, - "Standard_D32ls_v5": 1.360000, - "Standard_D32pds_v5": 0.966000, - "Standard_D32plds_v5": 0.784000, - "Standard_D32pls_v5": 0.682000, - "Standard_D32ps_v5": 0.810000, - "Standard_D32s_v3": 1.680000, - "Standard_D32s_v4": 1.616000, - "Standard_D32s_v5": 1.616000, - "Standard_D3_v2": 0.337000, - "Standard_D3_v2_Promo": 0.337000, - "Standard_D4": 0.564000, - "Standard_D48_v3": 2.520000, - "Standard_D48_v4": 2.424000, - "Standard_D48_v5": 2.424000, - "Standard_D48a_v4": 1.481000, - "Standard_D48ads_v5": 1.610000, - "Standard_D48as_v4": 1.481000, - "Standard_D48as_v5": 1.333000, - "Standard_D48as_v5_Promo": 1.214000, - "Standard_D48d_v4": 2.928000, - "Standard_D48d_v5": 2.928000, - "Standard_D48ds_v4": 2.928000, - "Standard_D48ds_v5": 2.928000, - "Standard_D48lds_v5": 2.376000, - "Standard_D48ls_v5": 2.040000, - "Standard_D48pds_v5": 1.450000, - "Standard_D48plds_v5": 1.176000, - "Standard_D48pls_v5": 1.022000, - "Standard_D48ps_v5": 1.214000, - "Standard_D48s_v3": 2.520000, - "Standard_D48s_v4": 2.424000, - "Standard_D48s_v5": 2.424000, - "Standard_D4_v2": 0.675000, - "Standard_D4_v2_Promo": 0.675000, - "Standard_D4_v3": 0.210000, - "Standard_D4_v4": 0.202000, - "Standard_D4_v5": 0.202000, - "Standard_D4a_v4": 0.123000, - "Standard_D4ads_v5": 0.134000, - "Standard_D4as_v4": 0.123000, - "Standard_D4as_v5": 0.111000, - "Standard_D4as_v5_Promo": 0.101000, - "Standard_D4d_v4": 0.244000, - "Standard_D4d_v5": 0.244000, - "Standard_D4ds_v4": 0.244000, - "Standard_D4ds_v5": 0.244000, - "Standard_D4lds_v5": 0.198000, - "Standard_D4ls_v5": 0.170000, - "Standard_D4pds_v5": 0.121000, - "Standard_D4plds_v5": 0.098000, - "Standard_D4pls_v5": 0.085200, - "Standard_D4ps_v5": 0.101000, - "Standard_D4s_v3": 0.210000, - "Standard_D4s_v4": 0.202000, - "Standard_D4s_v5": 0.202000, - "Standard_D5_v2": 1.350000, - "Standard_D5_v2_Promo": 1.350000, - "Standard_D64-16s_v3": 3.360000, - "Standard_D64-32s_v3": 3.360000, - "Standard_D64_v3": 3.360000, - "Standard_D64_v4": 3.232000, - "Standard_D64_v5": 3.232000, - "Standard_D64a_v4": 1.975000, - "Standard_D64ads_v5": 2.147000, - "Standard_D64as_v4": 1.975000, - "Standard_D64as_v5": 1.778000, - "Standard_D64as_v5_Promo": 1.619000, - "Standard_D64d_v4": 3.904000, - "Standard_D64d_v5": 3.904000, - "Standard_D64ds_v4": 3.904000, - "Standard_D64ds_v5": 3.904000, - "Standard_D64lds_v5": 3.168000, - "Standard_D64ls_v5": 2.720000, - "Standard_D64pds_v5": 1.933000, - "Standard_D64plds_v5": 1.568000, - "Standard_D64pls_v5": 1.363000, - "Standard_D64ps_v5": 1.619000, - "Standard_D64s_v3": 3.360000, - "Standard_D64s_v4": 3.232000, - "Standard_D64s_v5": 3.232000, - "Standard_D8_v3": 0.420000, - "Standard_D8_v4": 0.404000, - "Standard_D8_v5": 0.404000, - "Standard_D8a_v4": 0.246000, - "Standard_D8ads_v5": 0.268000, - "Standard_D8as_v4": 0.246000, - "Standard_D8as_v5": 0.222000, - "Standard_D8as_v5_Promo": 0.202000, - "Standard_D8d_v4": 0.488000, - "Standard_D8d_v5": 0.488000, - "Standard_D8ds_v4": 0.488000, - "Standard_D8ds_v5": 0.488000, - "Standard_D8lds_v5": 0.396000, - "Standard_D8ls_v5": 0.340000, - "Standard_D8pds_v5": 0.242000, - "Standard_D8plds_v5": 0.196000, - "Standard_D8pls_v5": 0.170000, - "Standard_D8ps_v5": 0.202000, - "Standard_D8s_v3": 0.420000, - "Standard_D8s_v4": 0.404000, - "Standard_D8s_v5": 0.404000, - "Standard_D96_v5": 4.848000, - "Standard_D96a_v4": 2.962000, - "Standard_D96ads_v5": 3.221000, - "Standard_D96as_v4": 2.962000, - "Standard_D96as_v5": 2.666000, - "Standard_D96as_v5_Promo": 2.429000, - "Standard_D96d_v5": 5.856000, - "Standard_D96ds_v5": 5.856000, - "Standard_D96lds_v5": 4.752000, - "Standard_D96ls_v5": 4.080000, - "Standard_D96s_v5": 4.848000, - "Standard_DC16ads_v5": 0.537000, - "Standard_DC16as_v5": 0.444000, - "Standard_DC16ds_v3": 1.920000, - "Standard_DC16s_v3": 1.616000, - "Standard_DC1ds_v3": 0.120000, - "Standard_DC1s_v3": 0.101000, - "Standard_DC24ds_v3": 2.880000, - "Standard_DC24s_v3": 2.424000, - "Standard_DC2ads_v5": 0.067100, - "Standard_DC2as_v5": 0.055600, - "Standard_DC2ds_v3": 0.240000, - "Standard_DC2s_v3": 0.202000, - "Standard_DC32ads_v5": 1.074000, - "Standard_DC32as_v5": 0.889000, - "Standard_DC32ds_v3": 3.840000, - "Standard_DC32s_v3": 3.232000, - "Standard_DC48ads_v5": 1.610000, - "Standard_DC48as_v5": 1.333000, - "Standard_DC48ds_v3": 5.760000, - "Standard_DC48s_v3": 4.848000, - "Standard_DC4ads_v5": 0.134000, - "Standard_DC4as_v5": 0.111000, - "Standard_DC4ds_v3": 0.480000, - "Standard_DC4s_v3": 0.404000, - "Standard_DC64ads_v5": 2.147000, - "Standard_DC64as_v5": 1.778000, - "Standard_DC8ads_v5": 0.268000, - "Standard_DC8as_v5": 0.222000, - "Standard_DC8ds_v3": 0.960000, - "Standard_DC8s_v3": 0.808000, - "Standard_DC96ads_v5": 3.221000, - "Standard_DC96as_v5": 2.666000, - "Standard_DS1": 0.070500, - "Standard_DS11": 0.182000, - "Standard_DS11-1_v2": 0.189000, - "Standard_DS11_v2": 0.189000, - "Standard_DS11_v2_Promo": 0.189000, - "Standard_DS12": 0.365000, - "Standard_DS12-1_v2": 0.379000, - "Standard_DS12-2_v2": 0.379000, - "Standard_DS12_v2": 0.379000, - "Standard_DS12_v2_Promo": 0.379000, - "Standard_DS13": 0.730000, - "Standard_DS13-2_v2": 0.758000, - "Standard_DS13-4_v2": 0.758000, - "Standard_DS13_v2": 0.758000, - "Standard_DS13_v2_Promo": 0.758000, - "Standard_DS14": 1.460000, - "Standard_DS14-4_v2": 1.516000, - "Standard_DS14-8_v2": 1.516000, - "Standard_DS14_v2": 1.516000, - "Standard_DS14_v2_Promo": 1.516000, - "Standard_DS15_v2": 1.895000, - "Standard_DS15i_v2": 1.895000, - "Standard_DS1_v2": 0.084000, - "Standard_DS2": 0.141000, - "Standard_DS2_v2": 0.169000, - "Standard_DS2_v2_Promo": 0.169000, - "Standard_DS3": 0.282000, - "Standard_DS3_v2": 0.337000, - "Standard_DS3_v2_Promo": 0.337000, - "Standard_DS4": 0.564000, - "Standard_DS4_v2": 0.675000, - "Standard_DS4_v2_Promo": 0.675000, - "Standard_DS5_v2": 1.350000, - "Standard_DS5_v2_Promo": 1.350000, - "Standard_E104i_v5": 7.436000, - "Standard_E104id_v5": 8.637000, - "Standard_E104ids_v5": 8.637000, - "Standard_E104is_v5": 7.436000, - "Standard_E112iads_v5": 5.116000, - "Standard_E112ias_v5": 4.404000, - "Standard_E112ibds_v5": 10.842000, - "Standard_E112ibs_v5": 9.548000, - "Standard_E16-4ads_v5": 0.664000, - "Standard_E16-4as_v4": 1.040000, - "Standard_E16-4as_v5": 0.572000, - "Standard_E16-4ds_v4": 1.208000, - "Standard_E16-4ds_v5": 1.208000, - "Standard_E16-4s_v3": 1.096000, - "Standard_E16-4s_v4": 1.040000, - "Standard_E16-4s_v5": 1.040000, - "Standard_E16-8ads_v5": 0.664000, - "Standard_E16-8as_v4": 1.040000, - "Standard_E16-8as_v5": 0.572000, - "Standard_E16-8ds_v4": 1.208000, - "Standard_E16-8ds_v5": 1.208000, - "Standard_E16-8s_v3": 1.096000, - "Standard_E16-8s_v4": 1.040000, - "Standard_E16-8s_v5": 1.040000, - "Standard_E16_v3": 1.096000, - "Standard_E16_v4": 1.040000, - "Standard_E16_v5": 1.040000, - "Standard_E16a_v4": 0.635000, - "Standard_E16ads_v5": 0.664000, - "Standard_E16as_v4": 0.635000, - "Standard_E16as_v5": 0.572000, - "Standard_E16bds_v5": 1.408000, - "Standard_E16bs_v5": 1.240000, - "Standard_E16d_v4": 1.208000, - "Standard_E16d_v5": 1.208000, - "Standard_E16ds_v4": 1.208000, - "Standard_E16ds_v5": 1.208000, - "Standard_E16pds_v5": 0.656000, - "Standard_E16ps_v5": 0.520000, - "Standard_E16s_v3": 1.096000, - "Standard_E16s_v4": 1.040000, - "Standard_E16s_v5": 1.040000, - "Standard_E20_v3": 1.370000, - "Standard_E20_v4": 1.300000, - "Standard_E20_v5": 1.300000, - "Standard_E20a_v4": 0.794000, - "Standard_E20ads_v5": 0.830000, - "Standard_E20as_v4": 0.794000, - "Standard_E20as_v5": 0.715000, - "Standard_E20d_v4": 1.510000, - "Standard_E20d_v5": 1.510000, - "Standard_E20ds_v4": 1.510000, - "Standard_E20ds_v5": 1.510000, - "Standard_E20pds_v5": 0.820000, - "Standard_E20ps_v5": 0.650000, - "Standard_E20s_v3": 1.370000, - "Standard_E20s_v4": 1.300000, - "Standard_E20s_v5": 1.300000, - "Standard_E2_v3": 0.137000, - "Standard_E2_v4": 0.130000, - "Standard_E2_v5": 0.130000, - "Standard_E2a_v4": 0.080000, - "Standard_E2ads_v5": 0.083000, - "Standard_E2as_v4": 0.080000, - "Standard_E2as_v5": 0.071500, - "Standard_E2bds_v5": 0.176000, - "Standard_E2bs_v5": 0.155000, - "Standard_E2d_v4": 0.151000, - "Standard_E2d_v5": 0.151000, - "Standard_E2ds_v4": 0.151000, - "Standard_E2ds_v5": 0.151000, - "Standard_E2pds_v5": 0.082000, - "Standard_E2ps_v5": 0.065000, - "Standard_E2s_v3": 0.137000, - "Standard_E2s_v4": 0.130000, - "Standard_E2s_v5": 0.130000, - "Standard_E32-16ads_v5": 1.329000, - "Standard_E32-16as_v4": 2.080000, - "Standard_E32-16as_v5": 1.144000, - "Standard_E32-16ds_v4": 2.416000, - "Standard_E32-16ds_v5": 2.416000, - "Standard_E32-16s_v3": 2.192000, - "Standard_E32-16s_v4": 2.080000, - "Standard_E32-16s_v5": 2.080000, - "Standard_E32-8ads_v5": 1.329000, - "Standard_E32-8as_v4": 2.080000, - "Standard_E32-8as_v5": 1.144000, - "Standard_E32-8ds_v4": 2.416000, - "Standard_E32-8ds_v5": 2.416000, - "Standard_E32-8s_v3": 2.192000, - "Standard_E32-8s_v4": 2.080000, - "Standard_E32-8s_v5": 2.080000, - "Standard_E32_v3": 2.192000, - "Standard_E32_v4": 2.080000, - "Standard_E32_v5": 2.080000, - "Standard_E32a_v4": 1.271000, - "Standard_E32ads_v5": 1.329000, - "Standard_E32as_v4": 1.271000, - "Standard_E32as_v5": 1.144000, - "Standard_E32bds_v5": 2.816000, - "Standard_E32bs_v5": 2.480000, - "Standard_E32d_v4": 2.416000, - "Standard_E32d_v5": 2.416000, - "Standard_E32ds_v4": 2.416000, - "Standard_E32ds_v5": 2.416000, - "Standard_E32pds_v5": 1.312000, - "Standard_E32ps_v5": 1.040000, - "Standard_E32s_v3": 2.192000, - "Standard_E32s_v4": 2.080000, - "Standard_E32s_v5": 2.080000, - "Standard_E4-2ads_v5": 0.166000, - "Standard_E4-2as_v4": 0.260000, - "Standard_E4-2as_v5": 0.143000, - "Standard_E4-2ds_v4": 0.302000, - "Standard_E4-2ds_v5": 0.302000, - "Standard_E4-2s_v3": 0.274000, - "Standard_E4-2s_v4": 0.260000, - "Standard_E4-2s_v5": 0.260000, - "Standard_E48_v3": 3.281000, - "Standard_E48_v4": 3.120000, - "Standard_E48_v5": 3.120000, - "Standard_E48a_v4": 1.906000, - "Standard_E48ads_v5": 1.993000, - "Standard_E48as_v4": 1.906000, - "Standard_E48as_v5": 1.716000, - "Standard_E48bds_v5": 4.224000, - "Standard_E48bs_v5": 3.720000, - "Standard_E48d_v4": 3.624000, - "Standard_E48d_v5": 3.624000, - "Standard_E48ds_v4": 3.624000, - "Standard_E48ds_v5": 3.624000, - "Standard_E48s_v3": 3.281000, - "Standard_E48s_v4": 3.120000, - "Standard_E48s_v5": 3.120000, - "Standard_E4_v3": 0.274000, - "Standard_E4_v4": 0.260000, - "Standard_E4_v5": 0.260000, - "Standard_E4a_v4": 0.158000, - "Standard_E4ads_v5": 0.166000, - "Standard_E4as_v4": 0.158000, - "Standard_E4as_v5": 0.143000, - "Standard_E4bds_v5": 0.352000, - "Standard_E4bs_v5": 0.310000, - "Standard_E4d_v4": 0.302000, - "Standard_E4d_v5": 0.302000, - "Standard_E4ds_v4": 0.302000, - "Standard_E4ds_v5": 0.302000, - "Standard_E4pds_v5": 0.164000, - "Standard_E4ps_v5": 0.130000, - "Standard_E4s_v3": 0.274000, - "Standard_E4s_v4": 0.260000, - "Standard_E4s_v5": 0.260000, - "Standard_E64-16ads_v5": 2.658000, - "Standard_E64-16as_v4": 4.160000, - "Standard_E64-16as_v5": 2.288000, - "Standard_E64-16ds_v4": 4.832000, - "Standard_E64-16ds_v5": 4.832000, - "Standard_E64-16s_v3": 3.937000, - "Standard_E64-16s_v4": 4.160000, - "Standard_E64-16s_v5": 4.160000, - "Standard_E64-32ads_v5": 2.658000, - "Standard_E64-32as_v4": 4.160000, - "Standard_E64-32as_v5": 2.288000, - "Standard_E64-32ds_v4": 4.832000, - "Standard_E64-32ds_v5": 4.832000, - "Standard_E64-32s_v3": 3.937000, - "Standard_E64-32s_v4": 4.160000, - "Standard_E64-32s_v5": 4.160000, - "Standard_E64_v3": 3.937000, - "Standard_E64_v4": 4.160000, - "Standard_E64_v5": 4.160000, - "Standard_E64a_v4": 2.542000, - "Standard_E64ads_v5": 2.658000, - "Standard_E64as_v4": 2.542000, - "Standard_E64as_v5": 2.288000, - "Standard_E64bds_v5": 5.632000, - "Standard_E64bs_v5": 4.960000, - "Standard_E64d_v4": 4.832000, - "Standard_E64d_v5": 4.832000, - "Standard_E64ds_v4": 4.832000, - "Standard_E64ds_v5": 4.832000, - "Standard_E64s_v3": 3.937000, - "Standard_E64s_v4": 4.160000, - "Standard_E64s_v5": 4.160000, - "Standard_E8-2ads_v5": 0.332000, - "Standard_E8-2as_v4": 0.520000, - "Standard_E8-2as_v5": 0.286000, - "Standard_E8-2ds_v4": 0.604000, - "Standard_E8-2ds_v5": 0.604000, - "Standard_E8-2s_v3": 0.548000, - "Standard_E8-2s_v4": 0.520000, - "Standard_E8-2s_v5": 0.520000, - "Standard_E8-4ads_v5": 0.332000, - "Standard_E8-4as_v4": 0.520000, - "Standard_E8-4as_v5": 0.286000, - "Standard_E8-4ds_v4": 0.604000, - "Standard_E8-4ds_v5": 0.604000, - "Standard_E8-4s_v3": 0.548000, - "Standard_E8-4s_v4": 0.520000, - "Standard_E8-4s_v5": 0.520000, - "Standard_E80ids_v4": 6.040000, - "Standard_E80is_v4": 5.200000, - "Standard_E8_v3": 0.548000, - "Standard_E8_v4": 0.520000, - "Standard_E8_v5": 0.520000, - "Standard_E8a_v4": 0.317000, - "Standard_E8ads_v5": 0.332000, - "Standard_E8as_v4": 0.317000, - "Standard_E8as_v5": 0.286000, - "Standard_E8bds_v5": 0.704000, - "Standard_E8bs_v5": 0.620000, - "Standard_E8d_v4": 0.604000, - "Standard_E8d_v5": 0.604000, - "Standard_E8ds_v4": 0.604000, - "Standard_E8ds_v5": 0.604000, - "Standard_E8pds_v5": 0.328000, - "Standard_E8ps_v5": 0.260000, - "Standard_E8s_v3": 0.548000, - "Standard_E8s_v4": 0.520000, - "Standard_E8s_v5": 0.520000, - "Standard_E96-24ads_v5": 3.986000, - "Standard_E96-24as_v4": 6.240000, - "Standard_E96-24as_v5": 3.432000, - "Standard_E96-24ds_v5": 7.248000, - "Standard_E96-24s_v5": 6.240000, - "Standard_E96-48ads_v5": 3.986000, - "Standard_E96-48as_v4": 6.240000, - "Standard_E96-48as_v5": 3.432000, - "Standard_E96-48ds_v5": 7.248000, - "Standard_E96-48s_v5": 6.240000, - "Standard_E96_v5": 6.240000, - "Standard_E96a_v4": 3.813000, - "Standard_E96ads_v5": 3.986000, - "Standard_E96as_v4": 3.813000, - "Standard_E96as_v5": 3.432000, - "Standard_E96bds_v5": 8.448000, - "Standard_E96bs_v5": 7.440000, - "Standard_E96d_v5": 7.248000, - "Standard_E96ds_v5": 7.248000, - "Standard_E96iads_v5": 4.385000, - "Standard_E96ias_v5": 3.775000, - "Standard_E96s_v5": 6.240000, - "Standard_EC16ads_v5": 0.664000, - "Standard_EC16as_v5": 0.572000, - "Standard_EC20ads_v5": 0.831000, - "Standard_EC20as_v5": 0.715000, - "Standard_EC2ads_v5": 0.083100, - "Standard_EC2as_v5": 0.071500, - "Standard_EC32ads_v5": 1.329000, - "Standard_EC32as_v5": 1.144000, - "Standard_EC48ads_v5": 1.993000, - "Standard_EC48as_v5": 1.716000, - "Standard_EC4ads_v5": 0.166000, - "Standard_EC4as_v5": 0.143000, - "Standard_EC64ads_v5": 2.658000, - "Standard_EC64as_v5": 2.288000, - "Standard_EC8ads_v5": 0.332000, - "Standard_EC8as_v5": 0.286000, - "Standard_EC96ads_v5": 3.986000, - "Standard_EC96as_v5": 3.432000, - "Standard_EC96iads_v5": 4.385000, - "Standard_EC96ias_v5": 3.775000, - "Standard_F1": 0.049000, - "Standard_F16": 0.790000, - "Standard_F16s": 0.790000, - "Standard_F16s_v2": 0.680000, - "Standard_F1s": 0.049000, - "Standard_F2": 0.098800, - "Standard_F2s": 0.098800, - "Standard_F2s_v2": 0.085000, - "Standard_F32s_v2": 1.360000, - "Standard_F4": 0.198000, - "Standard_F48s_v2": 2.040000, - "Standard_F4s": 0.198000, - "Standard_F4s_v2": 0.170000, - "Standard_F64s_v2": 2.720000, - "Standard_F72s_v2": 3.060000, - "Standard_F8": 0.395000, - "Standard_F8s": 0.395000, - "Standard_F8s_v2": 0.340000, - "Standard_FX12mds": 1.176000, - "Standard_FX24mds": 2.352000, - "Standard_FX36mds": 3.528000, - "Standard_FX48mds": 4.704000, - "Standard_FX4mds": 0.392000, - "Standard_H16": 1.995000, - "Standard_H16m": 2.674000, - "Standard_H16mr": 2.941000, - "Standard_H16r": 2.195000, - "Standard_H8": 0.998000, - "Standard_H8m": 1.337000, - "Standard_HB120-16rs_v3": 5.040000, - "Standard_HB120-32rs_v3": 5.040000, - "Standard_HB120-64rs_v3": 5.040000, - "Standard_HB120-96rs_v3": 5.040000, - "Standard_HB120rs_v3": 5.040000, - "Standard_HC44-16rs": 4.435000, - "Standard_HC44-32rs": 4.435000, - "Standard_HC44rs": 4.435000, - "Standard_L16s_v2": 1.416000, - "Standard_L16s_v3": 1.584000, - "Standard_L32s_v2": 2.832000, - "Standard_L32s_v3": 3.168000, - "Standard_L48s_v2": 4.248000, - "Standard_L48s_v3": 4.752000, - "Standard_L64s_v2": 5.664000, - "Standard_L64s_v3": 6.336000, - "Standard_L80s_v2": 7.080000, - "Standard_L80s_v3": 7.920000, - "Standard_L88is_v2": 7.788000, - "Standard_L8s_v2": 0.708000, - "Standard_L8s_v3": 0.792000, - "Standard_L96s_v2": 8.496000, - "Standard_M128": 13.762000, - "Standard_M128-32ms": 27.536000, - "Standard_M128-64ms": 27.536000, - "Standard_M128dms_v2": 27.536000, - "Standard_M128ds_v2": 13.763000, - "Standard_M128m": 27.536000, - "Standard_M128ms": 27.536000, - "Standard_M128ms_v2": 27.102000, - "Standard_M128s": 13.762000, - "Standard_M128s_v2": 13.329000, - "Standard_M16-4ms": 3.171000, - "Standard_M16-8ms": 3.171000, - "Standard_M16ms": 3.171000, - "Standard_M16s": 2.463000, - "Standard_M192idms_v2": 33.080000, - "Standard_M192ids_v2": 16.540000, - "Standard_M192ims_v2": 32.646000, - "Standard_M192is_v2": 16.106000, - "Standard_M208ms_v2": 45.959000, - "Standard_M208s_v2": 22.979000, - "Standard_M32-16ms": 6.341000, - "Standard_M32-8ms": 6.341000, - "Standard_M32dms_v2": 6.341000, - "Standard_M32ls": 2.964074, - "Standard_M32ms": 6.341000, - "Standard_M32ms_v2": 6.232000, - "Standard_M32s": 3.441000, - "Standard_M32ts": 2.792812, - "Standard_M416is_v2": 51.067000, - "Standard_M416ms_v2": 102.120000, - "Standard_M416s_8_v2": 92.550000, - "Standard_M416s_v2": 51.067000, - "Standard_M64": 6.881000, - "Standard_M64-16ms": 10.666000, - "Standard_M64-32ms": 10.666000, - "Standard_M64dms_v2": 10.668000, - "Standard_M64ds_v2": 6.880000, - "Standard_M64ls": 5.586656, - "Standard_M64m": 10.666000, - "Standard_M64ms": 10.666000, - "Standard_M64ms_v2": 10.451000, - "Standard_M64s": 6.881000, - "Standard_M64s_v2": 6.663000, - "Standard_M8-2ms": 1.585000, - "Standard_M8-4ms": 1.585000, - "Standard_M8ms": 1.585000, - "Standard_NC12s_v3": 8.468000, - "Standard_NC16as_T4_v3": 1.324000, - "Standard_NC24ads_A100_v4": 5.142000, - "Standard_NC24rs_v3": 18.630000, - "Standard_NC24s_v3": 16.936000, - "Standard_NC48ads_A100_v4": 10.284000, - "Standard_NC4as_T4_v3": 0.579000, - "Standard_NC64as_T4_v3": 4.787000, - "Standard_NC6s_v3": 4.234000, - "Standard_NC8as_T4_v3": 0.827000, - "Standard_NC96ads_A100_v4": 20.569000, - "Standard_NV12": 3.436000, - "Standard_NV12ads_A10_v5": 1.271000, - "Standard_NV12s_v3": 1.596000, - "Standard_NV16as_v4": 1.305000, - "Standard_NV18ads_A10_v5": 2.240000, - "Standard_NV24": 6.872000, - "Standard_NV24s_v3": 3.192000, - "Standard_NV32as_v4": 2.610000, - "Standard_NV36adms_A10_v5": 6.328000, - "Standard_NV36ads_A10_v5": 4.480000, - "Standard_NV48s_v3": 6.384000, - "Standard_NV4as_v4": 0.326000, - "Standard_NV6": 1.718000, - "Standard_NV6ads_A10_v5": 0.636000, - "Standard_NV72ads_A10_v5": 9.128000, - "Standard_NV8as_v4": 0.652000, - } - // centralus - initialOnDemandPrices["centralus"] = map[string]float64{ - "Basic_A0": 0.018000, - "Basic_A1": 0.025000, - "Basic_A2": 0.085000, - "Basic_A3": 0.188000, - "Basic_A4": 0.376000, - "DCdsv3 Type1": 6.742000, - "DCsv3 Type1": 5.728000, - "Dadsv5_Type1": 7.170000, - "Dasv4_Type1": 5.728000, - "Dasv4_Type2": 5.728000, - "Dasv5_Type1": 5.986000, - "Ddsv4_Type 1": 4.495000, - "Ddsv4_Type2": 5.337000, - "Ddsv5_Type1": 6.742000, - "Dsv3_Type3": 4.774000, - "Dsv3_Type4": 5.968000, - "Dsv4_Type1": 4.773000, - "Dsv4_Type2": 5.966000, - "Dsv5_Type1": 5.966000, - "Eadsv5_Type1": 7.816000, - "Easv4_Type1": 7.518000, - "Easv4_Type2": 7.518000, - "Easv5_Type1": 6.742000, - "Ebdsv5-Type1": 6.643000, - "Ebsv5-Type1": 5.927000, - "Edsv4_Type 1": 5.728000, - "Edsv4_Type2": 6.802000, - "Edsv5_Type1": 8.592000, - "Esv3_Type3": 4.856000, - "Esv3_Type4": 6.579000, - "Esv4_Type1": 5.012000, - "Esv4_Type2": 6.578000, - "Esv5_Type1": 7.518000, - "Fsv2 Type3": 5.161000, - "Fsv2_Type2": 3.804000, - "Fsv2_Type4": 5.283000, - "Lasv3_Type1": 7.756000, - "Lsv2_Type1": 8.237000, - "Lsv3_Type1": 8.651000, - "Mdsmv2MedMem _Type1": 33.176000, - "Mdsv2MedMem_Type1": 16.582000, - "Ms_Type1": 16.576000, - "Msm_Type1": 33.180000, - "Msmv2MedMem Type1": 32.653000, - "Msmv2_Type1": 123.240000, - "Msv2MedMem Type1": 16.059000, - "Msv2_Type1": 61.628000, - "Standard_A0": 0.020000, - "Standard_A1": 0.060000, - "Standard_A1_v2": 0.043000, - "Standard_A2": 0.120000, - "Standard_A2_v2": 0.091000, - "Standard_A2m_v2": 0.129000, - "Standard_A3": 0.240000, - "Standard_A4": 0.480000, - "Standard_A4_v2": 0.191000, - "Standard_A4m_v2": 0.270000, - "Standard_A5": 0.250000, - "Standard_A6": 0.500000, - "Standard_A7": 1.000000, - "Standard_A8_v2": 0.400000, - "Standard_A8m_v2": 0.568000, - "Standard_B12ms": 0.599000, - "Standard_B16als_v2": 0.602000, - "Standard_B16as_v2": 0.680000, - "Standard_B16ls_v2": 0.666000, - "Standard_B16ms": 0.799000, - "Standard_B16pls_v2": 0.538000, - "Standard_B16ps_v2": 0.681000, - "Standard_B16s_v2": 0.826000, - "Standard_B1ls": 0.006240, - "Standard_B1ms": 0.025000, - "Standard_B1s": 0.012500, - "Standard_B20ms": 0.998000, - "Standard_B2als_v2": 0.042500, - "Standard_B2as_v2": 0.094200, - "Standard_B2ats_v2": 0.019800, - "Standard_B2ls_v2": 0.056200, - "Standard_B2ms": 0.099800, - "Standard_B2pls_v2": 0.047200, - "Standard_B2ps_v2": 0.085100, - "Standard_B2pts_v2": 0.018700, - "Standard_B2s": 0.049900, - "Standard_B2s_v2": 0.103000, - "Standard_B2ts_v2": 0.011800, - "Standard_B32als_v2": 1.204000, - "Standard_B32as_v2": 1.360000, - "Standard_B32ls_v2": 1.332000, - "Standard_B32s_v2": 1.504000, - "Standard_B4als_v2": 0.151000, - "Standard_B4as_v2": 0.170000, - "Standard_B4ls_v2": 0.185000, - "Standard_B4ms": 0.200000, - "Standard_B4pls_v2": 0.153000, - "Standard_B4ps_v2": 0.152000, - "Standard_B4s_v2": 0.188000, - "Standard_B8als_v2": 0.301000, - "Standard_B8as_v2": 0.377000, - "Standard_B8ls_v2": 0.370000, - "Standard_B8ms": 0.399000, - "Standard_B8pls_v2": 0.269000, - "Standard_B8ps_v2": 0.304000, - "Standard_B8s_v2": 0.413000, - "Standard_D1": 0.077000, - "Standard_D11": 0.193000, - "Standard_D11_v2": 0.185000, - "Standard_D11_v2_Promo": 0.185000, - "Standard_D12": 0.386000, - "Standard_D12_v2": 0.371000, - "Standard_D12_v2_Promo": 0.371000, - "Standard_D13": 0.771000, - "Standard_D13_v2": 0.741000, - "Standard_D13_v2_Promo": 0.741000, - "Standard_D14": 1.542000, - "Standard_D14_v2": 1.482000, - "Standard_D14_v2_Promo": 1.482000, - "Standard_D15_v2": 1.853000, - "Standard_D15i_v2": 1.853000, - "Standard_D16_v3": 0.880000, - "Standard_D16_v4": 0.868000, - "Standard_D16_v5": 0.868000, - "Standard_D16a_v4": 0.868000, - "Standard_D16ads_v5": 0.931000, - "Standard_D16as_v4": 0.868000, - "Standard_D16as_v5": 0.777000, - "Standard_D16d_v4": 1.022000, - "Standard_D16d_v5": 1.022000, - "Standard_D16ds_v4": 1.022000, - "Standard_D16ds_v5": 1.022000, - "Standard_D16lds_v5": 0.868000, - "Standard_D16ls_v5": 0.768000, - "Standard_D16pds_v5": 0.818000, - "Standard_D16plds_v5": 0.694000, - "Standard_D16pls_v5": 0.615000, - "Standard_D16ps_v5": 0.696000, - "Standard_D16s_v3": 0.880000, - "Standard_D16s_v4": 0.868000, - "Standard_D16s_v5": 0.868000, - "Standard_D1_v2": 0.073000, - "Standard_D2": 0.154000, - "Standard_D2_v2": 0.146000, - "Standard_D2_v2_Promo": 0.146000, - "Standard_D2_v3": 0.110000, - "Standard_D2_v4": 0.108000, - "Standard_D2_v5": 0.108000, - "Standard_D2a_v4": 0.108000, - "Standard_D2ads_v5": 0.116000, - "Standard_D2as_v4": 0.108000, - "Standard_D2as_v5": 0.097200, - "Standard_D2d_v4": 0.128000, - "Standard_D2d_v5": 0.128000, - "Standard_D2ds_v4": 0.128000, - "Standard_D2ds_v5": 0.128000, - "Standard_D2lds_v5": 0.108000, - "Standard_D2ls_v5": 0.096100, - "Standard_D2pds_v5": 0.102000, - "Standard_D2plds_v5": 0.086800, - "Standard_D2pls_v5": 0.076800, - "Standard_D2ps_v5": 0.087000, - "Standard_D2s_v3": 0.110000, - "Standard_D2s_v4": 0.108000, - "Standard_D2s_v5": 0.108000, - "Standard_D3": 0.308000, - "Standard_D32-16s_v3": 1.760000, - "Standard_D32-8s_v3": 1.760000, - "Standard_D32_v3": 1.760000, - "Standard_D32_v4": 1.736000, - "Standard_D32_v5": 1.736000, - "Standard_D32a_v4": 1.736000, - "Standard_D32ads_v5": 1.862000, - "Standard_D32as_v4": 1.736000, - "Standard_D32as_v5": 1.555000, - "Standard_D32d_v4": 2.043000, - "Standard_D32d_v5": 2.043000, - "Standard_D32ds_v4": 2.043000, - "Standard_D32ds_v5": 2.043000, - "Standard_D32lds_v5": 1.736000, - "Standard_D32ls_v5": 1.537000, - "Standard_D32pds_v5": 1.635000, - "Standard_D32plds_v5": 1.389000, - "Standard_D32pls_v5": 1.229000, - "Standard_D32ps_v5": 1.392000, - "Standard_D32s_v3": 1.760000, - "Standard_D32s_v4": 1.736000, - "Standard_D32s_v5": 1.736000, - "Standard_D3_v2": 0.293000, - "Standard_D3_v2_Promo": 0.293000, - "Standard_D4": 0.616000, - "Standard_D48_v3": 2.640000, - "Standard_D48_v4": 2.604000, - "Standard_D48_v5": 2.604000, - "Standard_D48a_v4": 2.604000, - "Standard_D48ads_v5": 2.793000, - "Standard_D48as_v4": 2.604000, - "Standard_D48as_v5": 2.332000, - "Standard_D48d_v4": 3.065000, - "Standard_D48d_v5": 3.065000, - "Standard_D48ds_v4": 3.065000, - "Standard_D48ds_v5": 3.065000, - "Standard_D48lds_v5": 2.604000, - "Standard_D48ls_v5": 2.305000, - "Standard_D48pds_v5": 2.453000, - "Standard_D48plds_v5": 2.083000, - "Standard_D48pls_v5": 1.844000, - "Standard_D48ps_v5": 2.088000, - "Standard_D48s_v3": 2.640000, - "Standard_D48s_v4": 2.604000, - "Standard_D48s_v5": 2.604000, - "Standard_D4_v2": 0.585000, - "Standard_D4_v2_Promo": 0.585000, - "Standard_D4_v3": 0.220000, - "Standard_D4_v4": 0.217000, - "Standard_D4_v5": 0.217000, - "Standard_D4a_v4": 0.217000, - "Standard_D4ads_v5": 0.233000, - "Standard_D4as_v4": 0.217000, - "Standard_D4as_v5": 0.194000, - "Standard_D4d_v4": 0.255000, - "Standard_D4d_v5": 0.255000, - "Standard_D4ds_v4": 0.255000, - "Standard_D4ds_v5": 0.255000, - "Standard_D4lds_v5": 0.217000, - "Standard_D4ls_v5": 0.192000, - "Standard_D4pds_v5": 0.204000, - "Standard_D4plds_v5": 0.174000, - "Standard_D4pls_v5": 0.154000, - "Standard_D4ps_v5": 0.174000, - "Standard_D4s_v3": 0.220000, - "Standard_D4s_v4": 0.217000, - "Standard_D4s_v5": 0.217000, - "Standard_D5_v2": 1.170000, - "Standard_D5_v2_Promo": 1.170000, - "Standard_D64-16s_v3": 3.520000, - "Standard_D64-32s_v3": 3.520000, - "Standard_D64_v3": 3.520000, - "Standard_D64_v4": 3.471000, - "Standard_D64_v5": 3.471000, - "Standard_D64a_v4": 3.471000, - "Standard_D64ads_v5": 3.724000, - "Standard_D64as_v4": 3.471000, - "Standard_D64as_v5": 3.110000, - "Standard_D64d_v4": 4.086000, - "Standard_D64d_v5": 4.086000, - "Standard_D64ds_v4": 4.086000, - "Standard_D64ds_v5": 4.086000, - "Standard_D64lds_v5": 3.471000, - "Standard_D64ls_v5": 3.074000, - "Standard_D64pds_v5": 3.270000, - "Standard_D64plds_v5": 2.777000, - "Standard_D64pls_v5": 2.459000, - "Standard_D64ps_v5": 2.784000, - "Standard_D64s_v3": 3.520000, - "Standard_D64s_v4": 3.471000, - "Standard_D64s_v5": 3.471000, - "Standard_D8_v3": 0.440000, - "Standard_D8_v4": 0.434000, - "Standard_D8_v5": 0.434000, - "Standard_D8a_v4": 0.434000, - "Standard_D8ads_v5": 0.466000, - "Standard_D8as_v4": 0.434000, - "Standard_D8as_v5": 0.389000, - "Standard_D8d_v4": 0.511000, - "Standard_D8d_v5": 0.511000, - "Standard_D8ds_v4": 0.511000, - "Standard_D8ds_v5": 0.511000, - "Standard_D8lds_v5": 0.434000, - "Standard_D8ls_v5": 0.384000, - "Standard_D8pds_v5": 0.409000, - "Standard_D8plds_v5": 0.347000, - "Standard_D8pls_v5": 0.307000, - "Standard_D8ps_v5": 0.348000, - "Standard_D8s_v3": 0.440000, - "Standard_D8s_v4": 0.434000, - "Standard_D8s_v5": 0.434000, - "Standard_D96_v5": 5.207000, - "Standard_D96a_v4": 5.207000, - "Standard_D96ads_v5": 5.587000, - "Standard_D96as_v4": 5.207000, - "Standard_D96as_v5": 4.665000, - "Standard_D96d_v5": 6.129000, - "Standard_D96ds_v5": 6.129000, - "Standard_D96lds_v5": 5.207000, - "Standard_D96ls_v5": 4.610000, - "Standard_D96s_v5": 5.207000, - "Standard_DC16ads_v5": 0.931000, - "Standard_DC16as_v5": 0.777000, - "Standard_DC16ds_v3": 2.043000, - "Standard_DC16eds_v5": 1.022000, - "Standard_DC16es_v5": 0.868000, - "Standard_DC16s_v3": 1.736000, - "Standard_DC1ds_v3": 0.128000, - "Standard_DC1s_v3": 0.108000, - "Standard_DC24ds_v3": 3.065000, - "Standard_DC24s_v3": 2.604000, - "Standard_DC2ads_v5": 0.116000, - "Standard_DC2as_v5": 0.097200, - "Standard_DC2ds_v3": 0.255000, - "Standard_DC2eds_v5": 0.128000, - "Standard_DC2es_v5": 0.108000, - "Standard_DC2s": 0.474000, - "Standard_DC2s_v3": 0.217000, - "Standard_DC32ads_v5": 1.862000, - "Standard_DC32as_v5": 1.555000, - "Standard_DC32ds_v3": 4.086000, - "Standard_DC32eds_v5": 2.043000, - "Standard_DC32es_v5": 1.736000, - "Standard_DC32s_v3": 3.471000, - "Standard_DC48ads_v5": 2.793000, - "Standard_DC48as_v5": 2.332000, - "Standard_DC48ds_v3": 6.129000, - "Standard_DC48eds_v5": 3.065000, - "Standard_DC48es_v5": 2.604000, - "Standard_DC48s_v3": 5.207000, - "Standard_DC4ads_v5": 0.233000, - "Standard_DC4as_v5": 0.194000, - "Standard_DC4ds_v3": 0.511000, - "Standard_DC4eds_v5": 0.255000, - "Standard_DC4es_v5": 0.217000, - "Standard_DC4s": 0.949000, - "Standard_DC4s_v3": 0.434000, - "Standard_DC64ads_v5": 3.724000, - "Standard_DC64as_v5": 3.110000, - "Standard_DC64eds_v5": 4.086000, - "Standard_DC64es_v5": 3.471000, - "Standard_DC8ads_v5": 0.466000, - "Standard_DC8as_v5": 0.389000, - "Standard_DC8ds_v3": 1.022000, - "Standard_DC8eds_v5": 0.511000, - "Standard_DC8es_v5": 0.434000, - "Standard_DC8s_v3": 0.868000, - "Standard_DC96ads_v5": 5.587000, - "Standard_DC96as_v5": 4.665000, - "Standard_DC96eds_v5": 6.129000, - "Standard_DC96es_v5": 5.207000, - "Standard_DS1": 0.077000, - "Standard_DS11": 0.193000, - "Standard_DS11-1_v2": 0.185000, - "Standard_DS11_v2": 0.185000, - "Standard_DS11_v2_Promo": 0.185000, - "Standard_DS12": 0.386000, - "Standard_DS12-1_v2": 0.371000, - "Standard_DS12-2_v2": 0.371000, - "Standard_DS12_v2": 0.371000, - "Standard_DS12_v2_Promo": 0.371000, - "Standard_DS13": 0.771000, - "Standard_DS13-2_v2": 0.741000, - "Standard_DS13-4_v2": 0.741000, - "Standard_DS13_v2": 0.741000, - "Standard_DS13_v2_Promo": 0.741000, - "Standard_DS14": 1.542000, - "Standard_DS14-4_v2": 1.482000, - "Standard_DS14-8_v2": 1.482000, - "Standard_DS14_v2": 1.482000, - "Standard_DS14_v2_Promo": 1.482000, - "Standard_DS15_v2": 1.853000, - "Standard_DS15i_v2": 1.853000, - "Standard_DS1_v2": 0.073000, - "Standard_DS2": 0.154000, - "Standard_DS2_v2": 0.146000, - "Standard_DS2_v2_Promo": 0.146000, - "Standard_DS3": 0.308000, - "Standard_DS3_v2": 0.293000, - "Standard_DS3_v2_Promo": 0.293000, - "Standard_DS4": 0.616000, - "Standard_DS4_v2": 0.585000, - "Standard_DS4_v2_Promo": 0.585000, - "Standard_DS5_v2": 1.170000, - "Standard_DS5_v2_Promo": 1.170000, - "Standard_E104i_v5": 8.144000, - "Standard_E104id_v5": 9.308000, - "Standard_E104ids_v5": 9.308000, - "Standard_E104is_v5": 8.144000, - "Standard_E112iads_v5": 9.119000, - "Standard_E112ias_v5": 7.866000, - "Standard_E112ibds_v5": 11.625000, - "Standard_E112ibs_v5": 10.372000, - "Standard_E16-4ads_v5": 1.184000, - "Standard_E16-4as_v4": 1.139000, - "Standard_E16-4as_v5": 1.022000, - "Standard_E16-4ds_v4": 1.302000, - "Standard_E16-4ds_v5": 1.302000, - "Standard_E16-4s_v3": 1.167000, - "Standard_E16-4s_v4": 1.139000, - "Standard_E16-4s_v5": 1.139000, - "Standard_E16-8ads_v5": 1.184000, - "Standard_E16-8as_v4": 1.139000, - "Standard_E16-8as_v5": 1.022000, - "Standard_E16-8ds_v4": 1.302000, - "Standard_E16-8ds_v5": 1.302000, - "Standard_E16-8s_v3": 1.167000, - "Standard_E16-8s_v4": 1.139000, - "Standard_E16-8s_v5": 1.139000, - "Standard_E16_v3": 1.167000, - "Standard_E16_v4": 1.139000, - "Standard_E16_v5": 1.139000, - "Standard_E16a_v4": 1.139000, - "Standard_E16ads_v5": 1.184000, - "Standard_E16as_v4": 1.139000, - "Standard_E16as_v5": 1.022000, - "Standard_E16bds_v5": 1.510000, - "Standard_E16bs_v5": 1.347000, - "Standard_E16d_v4": 1.302000, - "Standard_E16d_v5": 1.302000, - "Standard_E16ds_v4": 1.302000, - "Standard_E16ds_v5": 1.302000, - "Standard_E16pds_v5": 1.041000, - "Standard_E16ps_v5": 0.911000, - "Standard_E16s_v3": 1.167000, - "Standard_E16s_v4": 1.139000, - "Standard_E16s_v5": 1.139000, - "Standard_E20_v3": 1.460000, - "Standard_E20_v4": 1.424000, - "Standard_E20_v5": 1.424000, - "Standard_E20a_v4": 1.424000, - "Standard_E20ads_v5": 1.480000, - "Standard_E20as_v4": 1.424000, - "Standard_E20as_v5": 1.277000, - "Standard_E20d_v4": 1.627000, - "Standard_E20d_v5": 1.627000, - "Standard_E20ds_v4": 1.627000, - "Standard_E20ds_v5": 1.627000, - "Standard_E20pds_v5": 1.302000, - "Standard_E20ps_v5": 1.139000, - "Standard_E20s_v3": 1.460000, - "Standard_E20s_v4": 1.424000, - "Standard_E20s_v5": 1.424000, - "Standard_E2_v3": 0.146000, - "Standard_E2_v4": 0.142000, - "Standard_E2_v5": 0.142000, - "Standard_E2a_v4": 0.142000, - "Standard_E2ads_v5": 0.148000, - "Standard_E2as_v4": 0.142000, - "Standard_E2as_v5": 0.128000, - "Standard_E2bds_v5": 0.189000, - "Standard_E2bs_v5": 0.168000, - "Standard_E2d_v4": 0.163000, - "Standard_E2d_v5": 0.163000, - "Standard_E2ds_v4": 0.163000, - "Standard_E2ds_v5": 0.163000, - "Standard_E2pds_v5": 0.130000, - "Standard_E2ps_v5": 0.114000, - "Standard_E2s_v3": 0.146000, - "Standard_E2s_v4": 0.142000, - "Standard_E2s_v5": 0.142000, - "Standard_E32-16ads_v5": 2.368000, - "Standard_E32-16as_v4": 2.278000, - "Standard_E32-16as_v5": 2.043000, - "Standard_E32-16ds_v4": 2.604000, - "Standard_E32-16ds_v5": 2.604000, - "Standard_E32-16s_v3": 2.334000, - "Standard_E32-16s_v4": 2.278000, - "Standard_E32-16s_v5": 2.278000, - "Standard_E32-8ads_v5": 2.368000, - "Standard_E32-8as_v4": 2.278000, - "Standard_E32-8as_v5": 2.043000, - "Standard_E32-8ds_v4": 2.604000, - "Standard_E32-8ds_v5": 2.604000, - "Standard_E32-8s_v3": 2.334000, - "Standard_E32-8s_v4": 2.278000, - "Standard_E32-8s_v5": 2.278000, - "Standard_E32_v3": 2.334000, - "Standard_E32_v4": 2.278000, - "Standard_E32_v5": 2.278000, - "Standard_E32a_v4": 2.278000, - "Standard_E32ads_v5": 2.368000, - "Standard_E32as_v4": 2.278000, - "Standard_E32as_v5": 2.043000, - "Standard_E32bds_v5": 3.019000, - "Standard_E32bs_v5": 2.694000, - "Standard_E32d_v4": 2.604000, - "Standard_E32d_v5": 2.604000, - "Standard_E32ds_v4": 2.604000, - "Standard_E32ds_v5": 2.604000, - "Standard_E32pds_v5": 2.083000, - "Standard_E32ps_v5": 1.822000, - "Standard_E32s_v3": 2.334000, - "Standard_E32s_v4": 2.278000, - "Standard_E32s_v5": 2.278000, - "Standard_E4-2ads_v5": 0.296000, - "Standard_E4-2as_v4": 0.285000, - "Standard_E4-2as_v5": 0.255000, - "Standard_E4-2ds_v4": 0.325000, - "Standard_E4-2ds_v5": 0.325000, - "Standard_E4-2s_v3": 0.292000, - "Standard_E4-2s_v4": 0.285000, - "Standard_E4-2s_v5": 0.285000, - "Standard_E48_v3": 3.501000, - "Standard_E48_v4": 3.417000, - "Standard_E48_v5": 3.417000, - "Standard_E48a_v4": 3.417000, - "Standard_E48ads_v5": 3.553000, - "Standard_E48as_v4": 3.417000, - "Standard_E48as_v5": 3.065000, - "Standard_E48bds_v5": 4.529000, - "Standard_E48bs_v5": 4.041000, - "Standard_E48d_v4": 3.905000, - "Standard_E48d_v5": 3.905000, - "Standard_E48ds_v4": 3.905000, - "Standard_E48ds_v5": 3.905000, - "Standard_E48s_v3": 3.501000, - "Standard_E48s_v4": 3.417000, - "Standard_E48s_v5": 3.417000, - "Standard_E4_v3": 0.292000, - "Standard_E4_v4": 0.285000, - "Standard_E4_v5": 0.285000, - "Standard_E4a_v4": 0.285000, - "Standard_E4ads_v5": 0.296000, - "Standard_E4as_v4": 0.285000, - "Standard_E4as_v5": 0.255000, - "Standard_E4bds_v5": 0.377000, - "Standard_E4bs_v5": 0.337000, - "Standard_E4d_v4": 0.325000, - "Standard_E4d_v5": 0.325000, - "Standard_E4ds_v4": 0.325000, - "Standard_E4ds_v5": 0.325000, - "Standard_E4pds_v5": 0.260000, - "Standard_E4ps_v5": 0.228000, - "Standard_E4s_v3": 0.292000, - "Standard_E4s_v4": 0.285000, - "Standard_E4s_v5": 0.285000, - "Standard_E64-16ads_v5": 4.737000, - "Standard_E64-16as_v4": 4.556000, - "Standard_E64-16as_v5": 4.086000, - "Standard_E64-16ds_v4": 5.207000, - "Standard_E64-16ds_v5": 5.207000, - "Standard_E64-16s_v3": 4.200000, - "Standard_E64-16s_v4": 4.556000, - "Standard_E64-16s_v5": 4.556000, - "Standard_E64-32ads_v5": 4.737000, - "Standard_E64-32as_v4": 4.556000, - "Standard_E64-32as_v5": 4.086000, - "Standard_E64-32ds_v4": 5.207000, - "Standard_E64-32ds_v5": 5.207000, - "Standard_E64-32s_v3": 4.200000, - "Standard_E64-32s_v4": 4.556000, - "Standard_E64-32s_v5": 4.556000, - "Standard_E64_v3": 4.200000, - "Standard_E64_v4": 4.556000, - "Standard_E64_v5": 4.556000, - "Standard_E64a_v4": 4.556000, - "Standard_E64ads_v5": 4.737000, - "Standard_E64as_v4": 4.556000, - "Standard_E64as_v5": 4.086000, - "Standard_E64bds_v5": 6.039000, - "Standard_E64bs_v5": 5.388000, - "Standard_E64d_v4": 5.207000, - "Standard_E64d_v5": 5.207000, - "Standard_E64ds_v4": 5.207000, - "Standard_E64ds_v5": 5.207000, - "Standard_E64i_v3": 4.199000, - "Standard_E64is_v3": 4.199000, - "Standard_E64s_v3": 4.200000, - "Standard_E64s_v4": 4.556000, - "Standard_E64s_v5": 4.556000, - "Standard_E8-2ads_v5": 0.592000, - "Standard_E8-2as_v4": 0.570000, - "Standard_E8-2as_v5": 0.511000, - "Standard_E8-2ds_v4": 0.651000, - "Standard_E8-2ds_v5": 0.651000, - "Standard_E8-2s_v3": 0.583000, - "Standard_E8-2s_v4": 0.570000, - "Standard_E8-2s_v5": 0.570000, - "Standard_E8-4ads_v5": 0.592000, - "Standard_E8-4as_v4": 0.570000, - "Standard_E8-4as_v5": 0.511000, - "Standard_E8-4ds_v4": 0.651000, - "Standard_E8-4ds_v5": 0.651000, - "Standard_E8-4s_v3": 0.583000, - "Standard_E8-4s_v4": 0.570000, - "Standard_E8-4s_v5": 0.570000, - "Standard_E80ids_v4": 6.509000, - "Standard_E80is_v4": 5.695000, - "Standard_E8_v3": 0.583000, - "Standard_E8_v4": 0.570000, - "Standard_E8_v5": 0.570000, - "Standard_E8a_v4": 0.570000, - "Standard_E8ads_v5": 0.592000, - "Standard_E8as_v4": 0.570000, - "Standard_E8as_v5": 0.511000, - "Standard_E8bds_v5": 0.755000, - "Standard_E8bs_v5": 0.673000, - "Standard_E8d_v4": 0.651000, - "Standard_E8d_v5": 0.651000, - "Standard_E8ds_v4": 0.651000, - "Standard_E8ds_v5": 0.651000, - "Standard_E8pds_v5": 0.521000, - "Standard_E8ps_v5": 0.456000, - "Standard_E8s_v3": 0.583000, - "Standard_E8s_v4": 0.570000, - "Standard_E8s_v5": 0.570000, - "Standard_E96-24ads_v5": 7.105000, - "Standard_E96-24as_v4": 6.834000, - "Standard_E96-24as_v5": 6.129000, - "Standard_E96-24ds_v5": 7.811000, - "Standard_E96-24s_v5": 6.834000, - "Standard_E96-48ads_v5": 7.105000, - "Standard_E96-48as_v4": 6.834000, - "Standard_E96-48as_v5": 6.129000, - "Standard_E96-48ds_v5": 7.811000, - "Standard_E96-48s_v5": 6.834000, - "Standard_E96_v5": 6.834000, - "Standard_E96a_v4": 6.834000, - "Standard_E96ads_v5": 7.105000, - "Standard_E96as_v4": 6.834000, - "Standard_E96as_v5": 6.129000, - "Standard_E96bds_v5": 9.058000, - "Standard_E96bs_v5": 8.082000, - "Standard_E96d_v5": 7.811000, - "Standard_E96ds_v5": 7.811000, - "Standard_E96iads_v5": 7.816000, - "Standard_E96ias_v5": 6.742000, - "Standard_E96s_v5": 6.834000, - "Standard_EC16ads_v5": 1.184000, - "Standard_EC16as_v5": 1.022000, - "Standard_EC16eds_v5": 1.302000, - "Standard_EC16es_v5": 1.139000, - "Standard_EC20ads_v5": 1.480000, - "Standard_EC20as_v5": 1.277000, - "Standard_EC2ads_v5": 0.148000, - "Standard_EC2as_v5": 0.128000, - "Standard_EC2eds_v5": 0.163000, - "Standard_EC2es_v5": 0.142000, - "Standard_EC32ads_v5": 2.368000, - "Standard_EC32as_v5": 2.043000, - "Standard_EC32eds_v5": 2.604000, - "Standard_EC32es_v5": 2.278000, - "Standard_EC48ads_v5": 3.553000, - "Standard_EC48as_v5": 3.065000, - "Standard_EC48eds_v5": 3.905000, - "Standard_EC48es_v5": 3.417000, - "Standard_EC4ads_v5": 0.296000, - "Standard_EC4as_v5": 0.255000, - "Standard_EC4eds_v5": 0.325000, - "Standard_EC4es_v5": 0.285000, - "Standard_EC64ads_v5": 4.737000, - "Standard_EC64as_v5": 4.086000, - "Standard_EC64eds_v5": 5.207000, - "Standard_EC64es_v5": 4.556000, - "Standard_EC8ads_v5": 0.592000, - "Standard_EC8as_v5": 0.511000, - "Standard_EC8eds_v5": 0.651000, - "Standard_EC8es_v5": 0.570000, - "Standard_EC96ads_v5": 7.105000, - "Standard_EC96as_v5": 6.129000, - "Standard_EC96eds_v5": 7.811000, - "Standard_EC96es_v5": 6.834000, - "Standard_EC96iads_v5": 7.816000, - "Standard_EC96ias_v5": 6.742000, - "Standard_F1": 0.054700, - "Standard_F16": 0.875000, - "Standard_F16s": 0.875000, - "Standard_F16s_v2": 0.816000, - "Standard_F1s": 0.054700, - "Standard_F2": 0.109000, - "Standard_F2s": 0.109000, - "Standard_F2s_v2": 0.102000, - "Standard_F32s_v2": 1.632000, - "Standard_F4": 0.219000, - "Standard_F48s_v2": 2.448000, - "Standard_F4s": 0.219000, - "Standard_F4s_v2": 0.204000, - "Standard_F64s_v2": 3.264000, - "Standard_F72s_v2": 3.672000, - "Standard_F8": 0.438000, - "Standard_F8s": 0.438000, - "Standard_F8s_v2": 0.408000, - "Standard_HB120-16rs_v2": 4.428000, - "Standard_HB120-32rs_v2": 4.428000, - "Standard_HB120-64rs_v2": 4.428000, - "Standard_HB120-96rs_v2": 4.428000, - "Standard_HB120rs_v2": 4.428000, - "Standard_L16as_v3": 1.410000, - "Standard_L16s_v2": 1.555000, - "Standard_L16s_v3": 1.573000, - "Standard_L32as_v3": 2.820000, - "Standard_L32s_v2": 3.110000, - "Standard_L32s_v3": 3.146000, - "Standard_L48as_v3": 4.231000, - "Standard_L48s_v2": 4.665000, - "Standard_L48s_v3": 4.719000, - "Standard_L64as_v3": 5.641000, - "Standard_L64s_v2": 6.220000, - "Standard_L64s_v3": 6.292000, - "Standard_L80as_v3": 7.051000, - "Standard_L80s_v2": 7.774000, - "Standard_L80s_v3": 7.865000, - "Standard_L88is_v2": 8.552000, - "Standard_L8as_v3": 0.705000, - "Standard_L8s_v2": 0.777000, - "Standard_L8s_v3": 0.786000, - "Standard_M128": 15.072000, - "Standard_M128-32ms": 30.157000, - "Standard_M128-64ms": 30.157000, - "Standard_M128dms_v2": 30.160000, - "Standard_M128ds_v2": 15.074000, - "Standard_M128m": 30.157000, - "Standard_M128ms": 30.157000, - "Standard_M128ms_v2": 29.684000, - "Standard_M128s": 15.072000, - "Standard_M128s_v2": 14.599000, - "Standard_M16-4ms": 3.472000, - "Standard_M16-8ms": 3.472000, - "Standard_M16ms": 3.472000, - "Standard_M16s": 2.697000, - "Standard_M192idms_v2": 36.232000, - "Standard_M192ids_v2": 18.116000, - "Standard_M192ims_v2": 35.757000, - "Standard_M192is_v2": 17.641000, - "Standard_M208-104ms_v2": 50.421000, - "Standard_M208-104s_v2": 25.210000, - "Standard_M208-52ms_v2": 50.421000, - "Standard_M208-52s_v2": 25.210000, - "Standard_M208ms_v2": 50.421000, - "Standard_M208s_v2": 25.210000, - "Standard_M32-16ms": 6.945000, - "Standard_M32-8ms": 6.945000, - "Standard_M32dms_v2": 6.945000, - "Standard_M32ls": 3.246000, - "Standard_M32ms": 6.945000, - "Standard_M32ms_v2": 6.826000, - "Standard_M32s": 5.395000, - "Standard_M32ts": 3.059000, - "Standard_M416-104ms_v2": 112.040000, - "Standard_M416-104s_v2": 56.025000, - "Standard_M416-208ms_v2": 112.040000, - "Standard_M416-208s_v2": 56.025000, - "Standard_M416is_v2": 56.025000, - "Standard_M416ms_v2": 112.040000, - "Standard_M416s_8_v2": 74.700000, - "Standard_M416s_v2": 56.025000, - "Standard_M64": 7.536000, - "Standard_M64-16ms": 15.079000, - "Standard_M64-32ms": 15.079000, - "Standard_M64dms_v2": 11.684000, - "Standard_M64ds_v2": 7.536000, - "Standard_M64ls": 6.493000, - "Standard_M64m": 15.079000, - "Standard_M64ms": 15.079000, - "Standard_M64ms_v2": 11.446000, - "Standard_M64s": 7.536000, - "Standard_M64s_v2": 7.298000, - "Standard_M8-2ms": 1.736000, - "Standard_M8-4ms": 1.736000, - "Standard_M8ms": 1.736000, - "Standard_NC12s_v3": 6.916000, - "Standard_NC16as_T4_v3": 1.360000, - "Standard_NC24rs_v3": 15.214000, - "Standard_NC24s_v3": 13.831000, - "Standard_NC4as_T4_v3": 0.594000, - "Standard_NC64as_T4_v3": 4.907000, - "Standard_NC6s_v3": 3.458000, - "Standard_NC8as_T4_v3": 0.849000, - "Standard_ND96amsr_A100_v4": 37.030000, - "Standard_NV12ads_A10_v5": 1.117000, - "Standard_NV18ads_A10_v5": 1.968000, - "Standard_NV36adms_A10_v5": 5.560000, - "Standard_NV36ads_A10_v5": 3.936000, - "Standard_NV6ads_A10_v5": 0.558000, - "Standard_NV72ads_A10_v5": 8.020000, - } - // eastasia - initialOnDemandPrices["eastasia"] = map[string]float64{ - "Basic_A0": 0.018000, - "Basic_A1": 0.038000, - "Basic_A2": 0.104000, - "Basic_A3": 0.232000, - "Basic_A4": 0.464000, - "Dadsv5_Type1": 8.747000, - "Dasv4_Type1": 6.970000, - "Dasv4_Type2": 7.260000, - "Dasv5_Type1": 7.330000, - "Ddsv4_Type 1": 5.456000, - "Ddsv4_Type2": 6.479000, - "Ddsv5_Type1": 8.184000, - "Dsv3_Type3": 5.796000, - "Dsv3_Type4": 7.245000, - "Dsv4_Type1": 5.808000, - "Dsv4_Type2": 6.970000, - "Dsv5_Type1": 7.260000, - "Eadsv5_Type1": 9.161000, - "Easv4_Type1": 8.818000, - "Easv4_Type2": 8.818000, - "Easv5_Type1": 7.946000, - "Ebdsv5-Type1": 7.814000, - "Ebsv5-Type1": 7.005000, - "Edsv4_Type 1": 6.160000, - "Edsv4_Type2": 9.321000, - "Edsv5_Type1": 9.240000, - "Esv3_Type3": 5.222000, - "Esv3_Type4": 7.075000, - "Esv4_Type1": 5.878000, - "Esv4_Type2": 7.715000, - "Esv5_Type1": 8.818000, - "Fsv2 Type3": 4.990000, - "Fsv2_Type2": 4.277000, - "Fsv2_Type4": 5.702000, - "Lasv3_Type1": 9.064000, - "Lsv3_Type1": 10.120000, - "Mdsmv2MedMem _Type1": 46.974000, - "Mdsv2MedMem_Type1": 23.478000, - "Msmv2MedMem Type1": 46.234000, - "Msmv2_Type1": 169.050000, - "Msv2MedMem Type1": 22.738000, - "Msv2_Type1": 84.534000, - "Standard_A0": 0.020000, - "Standard_A1": 0.060000, - "Standard_A1_v2": 0.050000, - "Standard_A2": 0.120000, - "Standard_A2_v2": 0.106000, - "Standard_A2m_v2": 0.178000, - "Standard_A3": 0.240000, - "Standard_A4": 0.480000, - "Standard_A4_v2": 0.222000, - "Standard_A4m_v2": 0.374000, - "Standard_A5": 0.294000, - "Standard_A6": 0.588000, - "Standard_A7": 1.176000, - "Standard_A8_v2": 0.467000, - "Standard_A8m_v2": 0.786000, - "Standard_B12ms": 0.701000, - "Standard_B16als_v2": 0.745000, - "Standard_B16as_v2": 0.841000, - "Standard_B16ls_v2": 0.901000, - "Standard_B16ms": 0.934000, - "Standard_B16pls_v2": 0.731000, - "Standard_B16ps_v2": 0.816000, - "Standard_B16s_v2": 1.008000, - "Standard_B1ls": 0.007300, - "Standard_B1ms": 0.029200, - "Standard_B1s": 0.014600, - "Standard_B20ms": 1.168000, - "Standard_B2als_v2": 0.061800, - "Standard_B2as_v2": 0.105000, - "Standard_B2ats_v2": 0.022300, - "Standard_B2ls_v2": 0.058400, - "Standard_B2ms": 0.117000, - "Standard_B2pls_v2": 0.046400, - "Standard_B2ps_v2": 0.092800, - "Standard_B2pts_v2": 0.020800, - "Standard_B2s": 0.058400, - "Standard_B2s_v2": 0.117000, - "Standard_B2ts_v2": 0.014600, - "Standard_B32als_v2": 1.489000, - "Standard_B32as_v2": 1.829000, - "Standard_B32ls_v2": 1.655000, - "Standard_B32s_v2": 2.016000, - "Standard_B4als_v2": 0.205000, - "Standard_B4as_v2": 0.229000, - "Standard_B4ls_v2": 0.207000, - "Standard_B4ms": 0.234000, - "Standard_B4pls_v2": 0.164000, - "Standard_B4ps_v2": 0.204000, - "Standard_B4s_v2": 0.252000, - "Standard_B8als_v2": 0.372000, - "Standard_B8as_v2": 0.457000, - "Standard_B8ls_v2": 0.451000, - "Standard_B8ms": 0.467000, - "Standard_B8pls_v2": 0.329000, - "Standard_B8ps_v2": 0.371000, - "Standard_B8s_v2": 0.504000, - "Standard_D1": 0.113000, - "Standard_D11": 0.242000, - "Standard_D11_v2": 0.229000, - "Standard_D11_v2_Promo": 0.229000, - "Standard_D12": 0.483000, - "Standard_D12_v2": 0.459000, - "Standard_D12_v2_Promo": 0.459000, - "Standard_D13": 0.966000, - "Standard_D13_v2": 0.918000, - "Standard_D13_v2_Promo": 0.918000, - "Standard_D14": 1.932000, - "Standard_D14_v2": 1.835000, - "Standard_D14_v2_Promo": 1.835000, - "Standard_D15_v2": 2.294000, - "Standard_D15i_v2": 2.294000, - "Standard_D16_v3": 1.056000, - "Standard_D16_v4": 1.056000, - "Standard_D16_v5": 1.056000, - "Standard_D16a_v4": 1.056000, - "Standard_D16ads_v5": 1.136000, - "Standard_D16as_v4": 1.056000, - "Standard_D16as_v5": 0.952000, - "Standard_D16as_v5_Promo": 0.848000, - "Standard_D16d_v4": 1.240000, - "Standard_D16d_v5": 1.240000, - "Standard_D16ds_v4": 1.240000, - "Standard_D16ds_v5": 1.240000, - "Standard_D16lds_v5": 0.984000, - "Standard_D16ls_v5": 0.864000, - "Standard_D16pds_v5": 0.996000, - "Standard_D16plds_v5": 0.784000, - "Standard_D16pls_v5": 0.688000, - "Standard_D16ps_v5": 0.848000, - "Standard_D16s_v3": 1.056000, - "Standard_D16s_v4": 1.056000, - "Standard_D16s_v5": 1.056000, - "Standard_D1_v2": 0.107000, - "Standard_D2": 0.225000, - "Standard_D2_v2": 0.214000, - "Standard_D2_v2_Promo": 0.214000, - "Standard_D2_v3": 0.132000, - "Standard_D2_v4": 0.132000, - "Standard_D2_v5": 0.132000, - "Standard_D2a_v4": 0.132000, - "Standard_D2ads_v5": 0.142000, - "Standard_D2as_v4": 0.132000, - "Standard_D2as_v5": 0.119000, - "Standard_D2as_v5_Promo": 0.106000, - "Standard_D2d_v4": 0.155000, - "Standard_D2d_v5": 0.155000, - "Standard_D2ds_v4": 0.155000, - "Standard_D2ds_v5": 0.155000, - "Standard_D2lds_v5": 0.123000, - "Standard_D2ls_v5": 0.108000, - "Standard_D2pds_v5": 0.125000, - "Standard_D2plds_v5": 0.098000, - "Standard_D2pls_v5": 0.086000, - "Standard_D2ps_v5": 0.106000, - "Standard_D2s_v3": 0.132000, - "Standard_D2s_v4": 0.132000, - "Standard_D2s_v5": 0.132000, - "Standard_D3": 0.451000, - "Standard_D32-16s_v3": 2.112000, - "Standard_D32-8s_v3": 2.112000, - "Standard_D32_v3": 2.112000, - "Standard_D32_v4": 2.112000, - "Standard_D32_v5": 2.112000, - "Standard_D32a_v4": 2.112000, - "Standard_D32ads_v5": 2.272000, - "Standard_D32as_v4": 2.112000, - "Standard_D32as_v5": 1.904000, - "Standard_D32as_v5_Promo": 1.696000, - "Standard_D32d_v4": 2.480000, - "Standard_D32d_v5": 2.480000, - "Standard_D32ds_v4": 2.480000, - "Standard_D32ds_v5": 2.480000, - "Standard_D32lds_v5": 1.968000, - "Standard_D32ls_v5": 1.728000, - "Standard_D32pds_v5": 1.992000, - "Standard_D32plds_v5": 1.568000, - "Standard_D32pls_v5": 1.376000, - "Standard_D32ps_v5": 1.696000, - "Standard_D32s_v3": 2.112000, - "Standard_D32s_v4": 2.112000, - "Standard_D32s_v5": 2.112000, - "Standard_D3_v2": 0.428000, - "Standard_D3_v2_Promo": 0.428000, - "Standard_D4": 0.902000, - "Standard_D48_v3": 3.168000, - "Standard_D48_v4": 3.168000, - "Standard_D48_v5": 3.168000, - "Standard_D48a_v4": 3.168000, - "Standard_D48ads_v5": 3.408000, - "Standard_D48as_v4": 3.168000, - "Standard_D48as_v5": 2.856000, - "Standard_D48as_v5_Promo": 2.544000, - "Standard_D48d_v4": 3.720000, - "Standard_D48d_v5": 3.720000, - "Standard_D48ds_v4": 3.720000, - "Standard_D48ds_v5": 3.720000, - "Standard_D48lds_v5": 2.952000, - "Standard_D48ls_v5": 2.592000, - "Standard_D48pds_v5": 2.988000, - "Standard_D48plds_v5": 2.352000, - "Standard_D48pls_v5": 2.064000, - "Standard_D48ps_v5": 2.544000, - "Standard_D48s_v3": 3.168000, - "Standard_D48s_v4": 3.168000, - "Standard_D48s_v5": 3.168000, - "Standard_D4_v2": 0.857000, - "Standard_D4_v2_Promo": 0.857000, - "Standard_D4_v3": 0.264000, - "Standard_D4_v4": 0.264000, - "Standard_D4_v5": 0.264000, - "Standard_D4a_v4": 0.264000, - "Standard_D4ads_v5": 0.284000, - "Standard_D4as_v4": 0.264000, - "Standard_D4as_v5": 0.238000, - "Standard_D4as_v5_Promo": 0.212000, - "Standard_D4d_v4": 0.310000, - "Standard_D4d_v5": 0.310000, - "Standard_D4ds_v4": 0.310000, - "Standard_D4ds_v5": 0.310000, - "Standard_D4lds_v5": 0.246000, - "Standard_D4ls_v5": 0.216000, - "Standard_D4pds_v5": 0.249000, - "Standard_D4plds_v5": 0.196000, - "Standard_D4pls_v5": 0.172000, - "Standard_D4ps_v5": 0.212000, - "Standard_D4s_v3": 0.264000, - "Standard_D4s_v4": 0.264000, - "Standard_D4s_v5": 0.264000, - "Standard_D5_v2": 1.714000, - "Standard_D5_v2_Promo": 1.714000, - "Standard_D64-16s_v3": 4.224000, - "Standard_D64-32s_v3": 4.224000, - "Standard_D64_v3": 4.224000, - "Standard_D64_v4": 4.224000, - "Standard_D64_v5": 4.224000, - "Standard_D64a_v4": 4.224000, - "Standard_D64ads_v5": 4.544000, - "Standard_D64as_v4": 4.224000, - "Standard_D64as_v5": 3.808000, - "Standard_D64as_v5_Promo": 3.392000, - "Standard_D64d_v4": 4.960000, - "Standard_D64d_v5": 4.960000, - "Standard_D64ds_v4": 4.960000, - "Standard_D64ds_v5": 4.960000, - "Standard_D64lds_v5": 3.936000, - "Standard_D64ls_v5": 3.456000, - "Standard_D64pds_v5": 3.984000, - "Standard_D64plds_v5": 3.136000, - "Standard_D64pls_v5": 2.752000, - "Standard_D64ps_v5": 3.392000, - "Standard_D64s_v3": 4.224000, - "Standard_D64s_v4": 4.224000, - "Standard_D64s_v5": 4.224000, - "Standard_D8_v3": 0.528000, - "Standard_D8_v4": 0.528000, - "Standard_D8_v5": 0.528000, - "Standard_D8a_v4": 0.528000, - "Standard_D8ads_v5": 0.568000, - "Standard_D8as_v4": 0.528000, - "Standard_D8as_v5": 0.476000, - "Standard_D8as_v5_Promo": 0.424000, - "Standard_D8d_v4": 0.620000, - "Standard_D8d_v5": 0.620000, - "Standard_D8ds_v4": 0.620000, - "Standard_D8ds_v5": 0.620000, - "Standard_D8lds_v5": 0.492000, - "Standard_D8ls_v5": 0.432000, - "Standard_D8pds_v5": 0.498000, - "Standard_D8plds_v5": 0.392000, - "Standard_D8pls_v5": 0.344000, - "Standard_D8ps_v5": 0.424000, - "Standard_D8s_v3": 0.528000, - "Standard_D8s_v4": 0.528000, - "Standard_D8s_v5": 0.528000, - "Standard_D96_v5": 6.336000, - "Standard_D96a_v4": 6.336000, - "Standard_D96ads_v5": 6.816000, - "Standard_D96as_v4": 6.336000, - "Standard_D96as_v5": 5.712000, - "Standard_D96as_v5_Promo": 5.088000, - "Standard_D96d_v5": 7.440000, - "Standard_D96ds_v5": 7.440000, - "Standard_D96lds_v5": 5.904000, - "Standard_D96ls_v5": 5.184000, - "Standard_D96s_v5": 6.336000, - "Standard_DC16ads_v5": 1.136000, - "Standard_DC16as_v5": 0.952000, - "Standard_DC2ads_v5": 0.142000, - "Standard_DC2as_v5": 0.119000, - "Standard_DC32ads_v5": 2.272000, - "Standard_DC32as_v5": 1.904000, - "Standard_DC48ads_v5": 3.408000, - "Standard_DC48as_v5": 2.856000, - "Standard_DC4ads_v5": 0.284000, - "Standard_DC4as_v5": 0.238000, - "Standard_DC64ads_v5": 4.544000, - "Standard_DC64as_v5": 3.808000, - "Standard_DC8ads_v5": 0.568000, - "Standard_DC8as_v5": 0.476000, - "Standard_DC96ads_v5": 6.816000, - "Standard_DC96as_v5": 5.712000, - "Standard_DS1": 0.113000, - "Standard_DS11": 0.242000, - "Standard_DS11-1_v2": 0.229000, - "Standard_DS11_v2": 0.229000, - "Standard_DS11_v2_Promo": 0.229000, - "Standard_DS12": 0.483000, - "Standard_DS12-1_v2": 0.459000, - "Standard_DS12-2_v2": 0.459000, - "Standard_DS12_v2": 0.459000, - "Standard_DS12_v2_Promo": 0.459000, - "Standard_DS13": 0.966000, - "Standard_DS13-2_v2": 0.918000, - "Standard_DS13-4_v2": 0.918000, - "Standard_DS13_v2": 0.918000, - "Standard_DS13_v2_Promo": 0.918000, - "Standard_DS14": 1.932000, - "Standard_DS14-4_v2": 1.835000, - "Standard_DS14-8_v2": 1.835000, - "Standard_DS14_v2": 1.835000, - "Standard_DS14_v2_Promo": 1.835000, - "Standard_DS15_v2": 2.294000, - "Standard_DS15i_v2": 2.294000, - "Standard_DS1_v2": 0.107000, - "Standard_DS2": 0.225000, - "Standard_DS2_v2": 0.214000, - "Standard_DS2_v2_Promo": 0.214000, - "Standard_DS3": 0.451000, - "Standard_DS3_v2": 0.428000, - "Standard_DS3_v2_Promo": 0.428000, - "Standard_DS4": 0.902000, - "Standard_DS4_v2": 0.857000, - "Standard_DS4_v2_Promo": 0.857000, - "Standard_DS5_v2": 1.714000, - "Standard_DS5_v2_Promo": 1.714000, - "Standard_E104i_v5": 9.552000, - "Standard_E104id_v5": 10.010000, - "Standard_E104ids_v5": 10.010000, - "Standard_E104is_v5": 9.552000, - "Standard_E112iads_v5": 10.688000, - "Standard_E112ias_v5": 9.271000, - "Standard_E112ibds_v5": 13.675000, - "Standard_E112ibs_v5": 12.258000, - "Standard_E16-4ads_v5": 1.388000, - "Standard_E16-4as_v4": 1.336000, - "Standard_E16-4as_v5": 1.204000, - "Standard_E16-4ds_v4": 1.400000, - "Standard_E16-4ds_v5": 1.400000, - "Standard_E16-4s_v3": 1.336000, - "Standard_E16-4s_v4": 1.336000, - "Standard_E16-4s_v5": 1.336000, - "Standard_E16-8ads_v5": 1.388000, - "Standard_E16-8as_v4": 1.336000, - "Standard_E16-8as_v5": 1.204000, - "Standard_E16-8ds_v4": 1.400000, - "Standard_E16-8ds_v5": 1.400000, - "Standard_E16-8s_v3": 1.336000, - "Standard_E16-8s_v4": 1.336000, - "Standard_E16-8s_v5": 1.336000, - "Standard_E16_v3": 1.336000, - "Standard_E16_v4": 1.336000, - "Standard_E16_v5": 1.336000, - "Standard_E16a_v4": 1.336000, - "Standard_E16ads_v5": 1.388000, - "Standard_E16as_v4": 1.336000, - "Standard_E16as_v5": 1.204000, - "Standard_E16bds_v5": 1.776000, - "Standard_E16bs_v5": 1.592000, - "Standard_E16d_v4": 1.400000, - "Standard_E16d_v5": 1.400000, - "Standard_E16ds_v4": 1.400000, - "Standard_E16ds_v5": 1.400000, - "Standard_E16pds_v5": 1.124000, - "Standard_E16ps_v5": 1.072000, - "Standard_E16s_v3": 1.336000, - "Standard_E16s_v4": 1.336000, - "Standard_E16s_v5": 1.336000, - "Standard_E20_v3": 1.670000, - "Standard_E20_v4": 1.670000, - "Standard_E20_v5": 1.670000, - "Standard_E20a_v4": 1.670000, - "Standard_E20ads_v5": 1.735000, - "Standard_E20as_v4": 1.670000, - "Standard_E20as_v5": 1.505000, - "Standard_E20d_v4": 1.750000, - "Standard_E20d_v5": 1.750000, - "Standard_E20ds_v4": 1.750000, - "Standard_E20ds_v5": 1.750000, - "Standard_E20pds_v5": 1.405000, - "Standard_E20ps_v5": 1.340000, - "Standard_E20s_v3": 1.670000, - "Standard_E20s_v4": 1.670000, - "Standard_E20s_v5": 1.670000, - "Standard_E2_v3": 0.167000, - "Standard_E2_v4": 0.167000, - "Standard_E2_v5": 0.167000, - "Standard_E2a_v4": 0.167000, - "Standard_E2ads_v5": 0.174000, - "Standard_E2as_v4": 0.167000, - "Standard_E2as_v5": 0.150000, - "Standard_E2bds_v5": 0.222000, - "Standard_E2bs_v5": 0.199000, - "Standard_E2d_v4": 0.175000, - "Standard_E2d_v5": 0.175000, - "Standard_E2ds_v4": 0.175000, - "Standard_E2ds_v5": 0.175000, - "Standard_E2pds_v5": 0.141000, - "Standard_E2ps_v5": 0.134000, - "Standard_E2s_v3": 0.167000, - "Standard_E2s_v4": 0.167000, - "Standard_E2s_v5": 0.167000, - "Standard_E32-16ads_v5": 2.776000, - "Standard_E32-16as_v4": 2.672000, - "Standard_E32-16as_v5": 2.408000, - "Standard_E32-16ds_v4": 2.800000, - "Standard_E32-16ds_v5": 2.800000, - "Standard_E32-16s_v3": 2.672000, - "Standard_E32-16s_v4": 2.672000, - "Standard_E32-16s_v5": 2.672000, - "Standard_E32-8ads_v5": 2.776000, - "Standard_E32-8as_v4": 2.672000, - "Standard_E32-8as_v5": 2.408000, - "Standard_E32-8ds_v4": 2.800000, - "Standard_E32-8ds_v5": 2.800000, - "Standard_E32-8s_v3": 2.672000, - "Standard_E32-8s_v4": 2.672000, - "Standard_E32-8s_v5": 2.672000, - "Standard_E32_v3": 2.672000, - "Standard_E32_v4": 2.672000, - "Standard_E32_v5": 2.672000, - "Standard_E32a_v4": 2.672000, - "Standard_E32ads_v5": 2.776000, - "Standard_E32as_v4": 2.672000, - "Standard_E32as_v5": 2.408000, - "Standard_E32bds_v5": 3.552000, - "Standard_E32bs_v5": 3.184000, - "Standard_E32d_v4": 2.800000, - "Standard_E32d_v5": 2.800000, - "Standard_E32ds_v4": 2.800000, - "Standard_E32ds_v5": 2.800000, - "Standard_E32pds_v5": 2.248000, - "Standard_E32ps_v5": 2.144000, - "Standard_E32s_v3": 2.672000, - "Standard_E32s_v4": 2.672000, - "Standard_E32s_v5": 2.672000, - "Standard_E4-2ads_v5": 0.347000, - "Standard_E4-2as_v4": 0.334000, - "Standard_E4-2as_v5": 0.301000, - "Standard_E4-2ds_v4": 0.350000, - "Standard_E4-2ds_v5": 0.350000, - "Standard_E4-2s_v3": 0.334000, - "Standard_E4-2s_v4": 0.334000, - "Standard_E4-2s_v5": 0.334000, - "Standard_E48_v3": 4.008000, - "Standard_E48_v4": 4.008000, - "Standard_E48_v5": 4.008000, - "Standard_E48a_v4": 4.008000, - "Standard_E48ads_v5": 4.164000, - "Standard_E48as_v4": 4.008000, - "Standard_E48as_v5": 3.612000, - "Standard_E48bds_v5": 5.328000, - "Standard_E48bs_v5": 4.776000, - "Standard_E48d_v4": 4.200000, - "Standard_E48d_v5": 4.200000, - "Standard_E48ds_v4": 4.200000, - "Standard_E48ds_v5": 4.200000, - "Standard_E48s_v3": 4.008000, - "Standard_E48s_v4": 4.008000, - "Standard_E48s_v5": 4.008000, - "Standard_E4_v3": 0.334000, - "Standard_E4_v4": 0.334000, - "Standard_E4_v5": 0.334000, - "Standard_E4a_v4": 0.334000, - "Standard_E4ads_v5": 0.347000, - "Standard_E4as_v4": 0.334000, - "Standard_E4as_v5": 0.301000, - "Standard_E4bds_v5": 0.444000, - "Standard_E4bs_v5": 0.398000, - "Standard_E4d_v4": 0.350000, - "Standard_E4d_v5": 0.350000, - "Standard_E4ds_v4": 0.350000, - "Standard_E4ds_v5": 0.350000, - "Standard_E4pds_v5": 0.281000, - "Standard_E4ps_v5": 0.268000, - "Standard_E4s_v3": 0.334000, - "Standard_E4s_v4": 0.334000, - "Standard_E4s_v5": 0.334000, - "Standard_E64-16ads_v5": 5.552000, - "Standard_E64-16as_v4": 5.344000, - "Standard_E64-16as_v5": 4.816000, - "Standard_E64-16ds_v4": 5.600000, - "Standard_E64-16ds_v5": 5.600000, - "Standard_E64-16s_v3": 4.810000, - "Standard_E64-16s_v4": 5.344000, - "Standard_E64-16s_v5": 5.344000, - "Standard_E64-32ads_v5": 5.552000, - "Standard_E64-32as_v4": 5.344000, - "Standard_E64-32as_v5": 4.816000, - "Standard_E64-32ds_v4": 5.600000, - "Standard_E64-32ds_v5": 5.600000, - "Standard_E64-32s_v3": 4.810000, - "Standard_E64-32s_v4": 5.344000, - "Standard_E64-32s_v5": 5.344000, - "Standard_E64_v3": 4.810000, - "Standard_E64_v4": 5.344000, - "Standard_E64_v5": 5.344000, - "Standard_E64a_v4": 5.344000, - "Standard_E64ads_v5": 5.552000, - "Standard_E64as_v4": 5.344000, - "Standard_E64as_v5": 4.816000, - "Standard_E64bds_v5": 7.104000, - "Standard_E64bs_v5": 6.368000, - "Standard_E64d_v4": 5.600000, - "Standard_E64d_v5": 5.600000, - "Standard_E64ds_v4": 5.600000, - "Standard_E64ds_v5": 5.600000, - "Standard_E64i_v3": 4.810000, - "Standard_E64is_v3": 4.810000, - "Standard_E64s_v3": 4.810000, - "Standard_E64s_v4": 5.344000, - "Standard_E64s_v5": 5.344000, - "Standard_E8-2ads_v5": 0.694000, - "Standard_E8-2as_v4": 0.668000, - "Standard_E8-2as_v5": 0.602000, - "Standard_E8-2ds_v4": 0.700000, - "Standard_E8-2ds_v5": 0.700000, - "Standard_E8-2s_v3": 0.668000, - "Standard_E8-2s_v4": 0.668000, - "Standard_E8-2s_v5": 0.668000, - "Standard_E8-4ads_v5": 0.694000, - "Standard_E8-4as_v4": 0.668000, - "Standard_E8-4as_v5": 0.602000, - "Standard_E8-4ds_v4": 0.700000, - "Standard_E8-4ds_v5": 0.700000, - "Standard_E8-4s_v3": 0.668000, - "Standard_E8-4s_v4": 0.668000, - "Standard_E8-4s_v5": 0.668000, - "Standard_E80ids_v4": 7.000000, - "Standard_E80is_v4": 6.680000, - "Standard_E8_v3": 0.668000, - "Standard_E8_v4": 0.668000, - "Standard_E8_v5": 0.668000, - "Standard_E8a_v4": 0.668000, - "Standard_E8ads_v5": 0.694000, - "Standard_E8as_v4": 0.668000, - "Standard_E8as_v5": 0.602000, - "Standard_E8bds_v5": 0.888000, - "Standard_E8bs_v5": 0.796000, - "Standard_E8d_v4": 0.700000, - "Standard_E8d_v5": 0.700000, - "Standard_E8ds_v4": 0.700000, - "Standard_E8ds_v5": 0.700000, - "Standard_E8pds_v5": 0.562000, - "Standard_E8ps_v5": 0.536000, - "Standard_E8s_v3": 0.668000, - "Standard_E8s_v4": 0.668000, - "Standard_E8s_v5": 0.668000, - "Standard_E96-24ads_v5": 8.328000, - "Standard_E96-24as_v4": 8.016000, - "Standard_E96-24as_v5": 7.224000, - "Standard_E96-24ds_v5": 8.400000, - "Standard_E96-24s_v5": 8.016000, - "Standard_E96-48ads_v5": 8.328000, - "Standard_E96-48as_v4": 8.016000, - "Standard_E96-48as_v5": 7.224000, - "Standard_E96-48ds_v5": 8.400000, - "Standard_E96-48s_v5": 8.016000, - "Standard_E96_v5": 8.016000, - "Standard_E96a_v4": 8.016000, - "Standard_E96ads_v5": 8.328000, - "Standard_E96as_v4": 8.016000, - "Standard_E96as_v5": 7.224000, - "Standard_E96bds_v5": 10.656000, - "Standard_E96bs_v5": 9.552000, - "Standard_E96d_v5": 8.400000, - "Standard_E96ds_v5": 8.400000, - "Standard_E96iads_v5": 9.161000, - "Standard_E96ias_v5": 7.946000, - "Standard_E96s_v5": 8.016000, - "Standard_EC16ads_v5": 1.388000, - "Standard_EC16as_v5": 1.204000, - "Standard_EC20ads_v5": 1.735000, - "Standard_EC20as_v5": 1.505000, - "Standard_EC2ads_v5": 0.174000, - "Standard_EC2as_v5": 0.151000, - "Standard_EC32ads_v5": 2.776000, - "Standard_EC32as_v5": 2.408000, - "Standard_EC48ads_v5": 4.164000, - "Standard_EC48as_v5": 3.612000, - "Standard_EC4ads_v5": 0.347000, - "Standard_EC4as_v5": 0.301000, - "Standard_EC64ads_v5": 5.552000, - "Standard_EC64as_v5": 4.816000, - "Standard_EC8ads_v5": 0.694000, - "Standard_EC8as_v5": 0.602000, - "Standard_EC96ads_v5": 8.328000, - "Standard_EC96as_v5": 7.224000, - "Standard_EC96iads_v5": 9.161000, - "Standard_EC96ias_v5": 7.946000, - "Standard_F1": 0.072000, - "Standard_F16": 1.155000, - "Standard_F16s": 1.155000, - "Standard_F16s_v2": 0.864000, - "Standard_F1s": 0.072000, - "Standard_F2": 0.144000, - "Standard_F2s": 0.144000, - "Standard_F2s_v2": 0.108000, - "Standard_F32s_v2": 1.728000, - "Standard_F4": 0.289000, - "Standard_F48s_v2": 2.592000, - "Standard_F4s": 0.289000, - "Standard_F4s_v2": 0.216000, - "Standard_F64s_v2": 3.456000, - "Standard_F72s_v2": 3.888000, - "Standard_F8": 0.578000, - "Standard_F8s": 0.578000, - "Standard_F8s_v2": 0.432000, - "Standard_L16as_v3": 1.648000, - "Standard_L16s_v3": 1.840000, - "Standard_L32as_v3": 3.296000, - "Standard_L32s_v3": 3.680000, - "Standard_L48as_v3": 4.944000, - "Standard_L48s_v3": 5.520000, - "Standard_L64as_v3": 6.592000, - "Standard_L64s_v3": 7.360000, - "Standard_L80as_v3": 8.240000, - "Standard_L80s_v3": 9.200000, - "Standard_L8as_v3": 0.824000, - "Standard_L8s_v3": 0.920000, - "Standard_M128": 24.177500, - "Standard_M128-32ms": 48.376250, - "Standard_M128-64ms": 48.376250, - "Standard_M128dms_v2": 42.704000, - "Standard_M128ds_v2": 21.344000, - "Standard_M128m": 48.376250, - "Standard_M128ms": 48.376250, - "Standard_M128ms_v2": 42.031000, - "Standard_M128s": 24.177500, - "Standard_M128s_v2": 20.671000, - "Standard_M16-4ms": 5.569875, - "Standard_M16-8ms": 5.569875, - "Standard_M16ms": 5.569875, - "Standard_M16s": 4.326500, - "Standard_M192idms_v2": 51.302000, - "Standard_M192ids_v2": 25.651000, - "Standard_M192ims_v2": 50.629000, - "Standard_M192is_v2": 24.978000, - "Standard_M208-104ms_v2": 69.161000, - "Standard_M208-104s_v2": 34.580000, - "Standard_M208-52ms_v2": 69.161000, - "Standard_M208-52s_v2": 34.580000, - "Standard_M208ms_v2": 69.161000, - "Standard_M208s_v2": 34.580000, - "Standard_M32-16ms": 11.139625, - "Standard_M32-8ms": 11.139625, - "Standard_M32dms_v2": 9.834000, - "Standard_M32ls": 3.806725, - "Standard_M32ms": 11.139625, - "Standard_M32ms_v2": 9.665000, - "Standard_M32s": 6.044750, - "Standard_M32ts": 3.586775, - "Standard_M416-104ms_v2": 153.680000, - "Standard_M416-104s_v2": 76.849000, - "Standard_M416-208ms_v2": 153.680000, - "Standard_M416-208s_v2": 76.849000, - "Standard_M416is_v2": 76.849000, - "Standard_M416ms_v2": 153.680000, - "Standard_M416s_8_v2": 102.470000, - "Standard_M416s_v2": 76.849000, - "Standard_M64": 12.088750, - "Standard_M64-16ms": 18.737500, - "Standard_M64-32ms": 18.737500, - "Standard_M64dms_v2": 16.544000, - "Standard_M64ds_v2": 10.670000, - "Standard_M64ls": 7.174875, - "Standard_M64m": 18.737500, - "Standard_M64ms": 18.737500, - "Standard_M64ms_v2": 16.207000, - "Standard_M64s": 12.088750, - "Standard_M64s_v2": 10.334000, - "Standard_M8-2ms": 2.784875, - "Standard_M8-4ms": 2.784875, - "Standard_M8ms": 2.784875, - "Standard_NC12s_v3": 9.486000, - "Standard_NC24rs_v3": 20.869000, - "Standard_NC24s_v3": 18.972000, - "Standard_NC6s_v3": 4.743000, - "Standard_ND40s_v2": 29.205000, - "Standard_NV12ads_A10_v5": 1.407000, - "Standard_NV18ads_A10_v5": 2.480000, - "Standard_NV36adms_A10_v5": 7.006000, - "Standard_NV36ads_A10_v5": 4.960000, - "Standard_NV6ads_A10_v5": 0.704000, - "Standard_NV72ads_A10_v5": 10.106000, - } - // eastus - initialOnDemandPrices["eastus"] = map[string]float64{ - "Basic_A0": 0.018000, - "Basic_A1": 0.023000, - "Basic_A2": 0.079000, - "Basic_A3": 0.176000, - "Basic_A4": 0.352000, - "DCadsv5 Type 1": 6.345000, - "DCasv5 Type 1": 5.298000, - "DCdsv3 Type1": 5.966000, - "DCsv2 Type 1": 0.845000, - "DCsv3 Type1": 5.069000, - "Dadsv5_Type1": 6.345000, - "Dasv4_Type1": 5.069000, - "Dasv4_Type2": 5.280000, - "Dasv5_Type1": 5.298000, - "Ddsv4_Type 1": 3.978000, - "Ddsv4_Type2": 4.723000, - "Ddsv5_Type1": 5.966000, - "Dsv3_Type3": 4.225000, - "Dsv3_Type4": 5.281000, - "Dsv4_Type1": 4.224000, - "Dsv4_Type2": 5.069000, - "Dsv5_Type1": 5.280000, - "ECadsv5 Type 1": 7.608000, - "ECasv5 Type 1": 6.563000, - "Eadsv5_Type1": 6.917000, - "Easv4_Type1": 6.653000, - "Easv4_Type2": 6.653000, - "Easv5_Type1": 5.966000, - "Ebdsv5-Type1": 5.878000, - "Ebsv5-Type1": 5.245000, - "Edsv4_Type 1": 5.069000, - "Edsv4_Type2": 6.019000, - "Edsv5_Type1": 7.603000, - "Esv3_Type3": 4.297000, - "Esv3_Type4": 5.822000, - "Esv4_Type1": 4.435000, - "Esv4_Type2": 5.821000, - "Esv5_Type1": 6.653000, - "FXmds Type1": 4.910000, - "Fsv2 Type3": 3.927000, - "Fsv2_Type2": 3.366000, - "Fsv2_Type4": 4.468000, - "Lasv3_Type1": 6.864000, - "Lsv2_Type1": 6.864000, - "Lsv3_Type1": 7.656000, - "Mdsmv2MedMem _Type1": 29.359000, - "Mdsv2MedMem_Type1": 14.674000, - "Ms_Type1": 14.669000, - "Msm_Type1": 29.363000, - "Msmv2MedMem Type1": 28.896000, - "Msmv2_Type1": 109.060000, - "Msv2MedMem Type1": 14.211000, - "Msv2_Type1": 54.538000, - "NDamsrA100v4_Type1": 36.047000, - "NDasrA100v4_Type1": 29.917000, - "NVasv4_Type1": 7.176000, - "NVsv3_Type1": 5.016000, - "Standard_A0": 0.020000, - "Standard_A1": 0.060000, - "Standard_A1_v2": 0.043000, - "Standard_A2": 0.120000, - "Standard_A2_v2": 0.091000, - "Standard_A2m_v2": 0.119000, - "Standard_A3": 0.240000, - "Standard_A4": 0.480000, - "Standard_A4_v2": 0.191000, - "Standard_A4m_v2": 0.238000, - "Standard_A5": 0.250000, - "Standard_A6": 0.500000, - "Standard_A7": 1.000000, - "Standard_A8_v2": 0.400000, - "Standard_A8m_v2": 0.475000, - "Standard_B12ms": 0.499000, - "Standard_B16als_v2": 0.533000, - "Standard_B16as_v2": 0.675000, - "Standard_B16ls_v2": 0.663000, - "Standard_B16ms": 0.666000, - "Standard_B16pls_v2": 0.550000, - "Standard_B16ps_v2": 0.611000, - "Standard_B16s_v2": 0.739000, - "Standard_B1ls": 0.005200, - "Standard_B1ms": 0.020700, - "Standard_B1s": 0.010400, - "Standard_B20ms": 0.832000, - "Standard_B2als_v2": 0.046800, - "Standard_B2as_v2": 0.084400, - "Standard_B2ats_v2": 0.009400, - "Standard_B2ls_v2": 0.041600, - "Standard_B2ms": 0.083200, - "Standard_B2pls_v2": 0.042800, - "Standard_B2ps_v2": 0.067200, - "Standard_B2pts_v2": 0.008400, - "Standard_B2s": 0.041600, - "Standard_B2s_v2": 0.092400, - "Standard_B2ts_v2": 0.019600, - "Standard_B32als_v2": 1.213000, - "Standard_B32as_v2": 1.203000, - "Standard_B32ls_v2": 1.326000, - "Standard_B32s_v2": 1.478000, - "Standard_B4als_v2": 0.133000, - "Standard_B4as_v2": 0.169000, - "Standard_B4ls_v2": 0.166000, - "Standard_B4ms": 0.166000, - "Standard_B4pls_v2": 0.119000, - "Standard_B4ps_v2": 0.153000, - "Standard_B4s_v2": 0.166000, - "Standard_B8als_v2": 0.303000, - "Standard_B8as_v2": 0.338000, - "Standard_B8ls_v2": 0.332000, - "Standard_B8ms": 0.333000, - "Standard_B8pls_v2": 0.238000, - "Standard_B8ps_v2": 0.269000, - "Standard_B8s_v2": 0.333000, - "Standard_D1": 0.077000, - "Standard_D11": 0.193000, - "Standard_D11_v2": 0.185000, - "Standard_D11_v2_Promo": 0.185000, - "Standard_D12": 0.386000, - "Standard_D12_v2": 0.371000, - "Standard_D12_v2_Promo": 0.371000, - "Standard_D13": 0.771000, - "Standard_D13_v2": 0.741000, - "Standard_D13_v2_Promo": 0.741000, - "Standard_D14": 1.542000, - "Standard_D14_v2": 1.482000, - "Standard_D14_v2_Promo": 1.482000, - "Standard_D15_v2": 1.853000, - "Standard_D15i_v2": 1.853000, - "Standard_D16_v3": 0.768000, - "Standard_D16_v4": 0.768000, - "Standard_D16_v5": 0.768000, - "Standard_D16a_v4": 0.768000, - "Standard_D16ads_v5": 0.824000, - "Standard_D16as_v4": 0.768000, - "Standard_D16as_v5": 0.688000, - "Standard_D16d_v4": 0.904000, - "Standard_D16d_v5": 0.904000, - "Standard_D16ds_v4": 0.904000, - "Standard_D16ds_v5": 0.904000, - "Standard_D16lds_v5": 0.768000, - "Standard_D16ls_v5": 0.680000, - "Standard_D16pds_v5": 0.723000, - "Standard_D16plds_v5": 0.614000, - "Standard_D16pls_v5": 0.544000, - "Standard_D16ps_v5": 0.616000, - "Standard_D16s_v3": 0.768000, - "Standard_D16s_v4": 0.768000, - "Standard_D16s_v5": 0.768000, - "Standard_D1_v2": 0.073000, - "Standard_D2": 0.154000, - "Standard_D2_v2": 0.146000, - "Standard_D2_v2_Promo": 0.146000, - "Standard_D2_v3": 0.096000, - "Standard_D2_v4": 0.096000, - "Standard_D2_v5": 0.096000, - "Standard_D2a_v4": 0.096000, - "Standard_D2ads_v5": 0.103000, - "Standard_D2as_v4": 0.096000, - "Standard_D2as_v5": 0.086000, - "Standard_D2d_v4": 0.113000, - "Standard_D2d_v5": 0.113000, - "Standard_D2ds_v4": 0.113000, - "Standard_D2ds_v5": 0.113000, - "Standard_D2lds_v5": 0.096000, - "Standard_D2ls_v5": 0.085000, - "Standard_D2pds_v5": 0.090400, - "Standard_D2plds_v5": 0.076800, - "Standard_D2pls_v5": 0.068000, - "Standard_D2ps_v5": 0.077000, - "Standard_D2s_v3": 0.096000, - "Standard_D2s_v4": 0.096000, - "Standard_D2s_v5": 0.096000, - "Standard_D3": 0.308000, - "Standard_D32-16s_v3": 1.536000, - "Standard_D32-8s_v3": 1.536000, - "Standard_D32_v3": 1.536000, - "Standard_D32_v4": 1.536000, - "Standard_D32_v5": 1.536000, - "Standard_D32a_v4": 1.536000, - "Standard_D32ads_v5": 1.648000, - "Standard_D32as_v4": 1.536000, - "Standard_D32as_v5": 1.376000, - "Standard_D32d_v4": 1.808000, - "Standard_D32d_v5": 1.808000, - "Standard_D32ds_v4": 1.808000, - "Standard_D32ds_v5": 1.808000, - "Standard_D32lds_v5": 1.536000, - "Standard_D32ls_v5": 1.360000, - "Standard_D32pds_v5": 1.446000, - "Standard_D32plds_v5": 1.229000, - "Standard_D32pls_v5": 1.088000, - "Standard_D32ps_v5": 1.232000, - "Standard_D32s_v3": 1.536000, - "Standard_D32s_v4": 1.536000, - "Standard_D32s_v5": 1.536000, - "Standard_D3_v2": 0.293000, - "Standard_D3_v2_Promo": 0.293000, - "Standard_D4": 0.616000, - "Standard_D48_v3": 2.304000, - "Standard_D48_v4": 2.304000, - "Standard_D48_v5": 2.304000, - "Standard_D48a_v4": 2.304000, - "Standard_D48ads_v5": 2.472000, - "Standard_D48as_v4": 2.304000, - "Standard_D48as_v5": 2.064000, - "Standard_D48d_v4": 2.712000, - "Standard_D48d_v5": 2.712000, - "Standard_D48ds_v4": 2.712000, - "Standard_D48ds_v5": 2.712000, - "Standard_D48lds_v5": 2.304000, - "Standard_D48ls_v5": 2.040000, - "Standard_D48pds_v5": 2.170000, - "Standard_D48plds_v5": 1.843000, - "Standard_D48pls_v5": 1.632000, - "Standard_D48ps_v5": 1.848000, - "Standard_D48s_v3": 2.304000, - "Standard_D48s_v4": 2.304000, - "Standard_D48s_v5": 2.304000, - "Standard_D4_v2": 0.585000, - "Standard_D4_v2_Promo": 0.585000, - "Standard_D4_v3": 0.192000, - "Standard_D4_v4": 0.192000, - "Standard_D4_v5": 0.192000, - "Standard_D4a_v4": 0.192000, - "Standard_D4ads_v5": 0.206000, - "Standard_D4as_v4": 0.192000, - "Standard_D4as_v5": 0.172000, - "Standard_D4d_v4": 0.226000, - "Standard_D4d_v5": 0.226000, - "Standard_D4ds_v4": 0.226000, - "Standard_D4ds_v5": 0.226000, - "Standard_D4lds_v5": 0.192000, - "Standard_D4ls_v5": 0.170000, - "Standard_D4pds_v5": 0.181000, - "Standard_D4plds_v5": 0.154000, - "Standard_D4pls_v5": 0.136000, - "Standard_D4ps_v5": 0.154000, - "Standard_D4s_v3": 0.192000, - "Standard_D4s_v4": 0.192000, - "Standard_D4s_v5": 0.192000, - "Standard_D5_v2": 1.170000, - "Standard_D5_v2_Promo": 1.170000, - "Standard_D64-16s_v3": 3.072000, - "Standard_D64-32s_v3": 3.072000, - "Standard_D64_v3": 3.072000, - "Standard_D64_v4": 3.072000, - "Standard_D64_v5": 3.072000, - "Standard_D64a_v4": 3.072000, - "Standard_D64ads_v5": 3.296000, - "Standard_D64as_v4": 3.072000, - "Standard_D64as_v5": 2.752000, - "Standard_D64d_v4": 3.616000, - "Standard_D64d_v5": 3.616000, - "Standard_D64ds_v4": 3.616000, - "Standard_D64ds_v5": 3.616000, - "Standard_D64lds_v5": 3.072000, - "Standard_D64ls_v5": 2.720000, - "Standard_D64pds_v5": 2.893000, - "Standard_D64plds_v5": 2.458000, - "Standard_D64pls_v5": 2.176000, - "Standard_D64ps_v5": 2.464000, - "Standard_D64s_v3": 3.072000, - "Standard_D64s_v4": 3.072000, - "Standard_D64s_v5": 3.072000, - "Standard_D8_v3": 0.384000, - "Standard_D8_v4": 0.384000, - "Standard_D8_v5": 0.384000, - "Standard_D8a_v4": 0.384000, - "Standard_D8ads_v5": 0.412000, - "Standard_D8as_v4": 0.384000, - "Standard_D8as_v5": 0.344000, - "Standard_D8d_v4": 0.452000, - "Standard_D8d_v5": 0.452000, - "Standard_D8ds_v4": 0.452000, - "Standard_D8ds_v5": 0.452000, - "Standard_D8lds_v5": 0.384000, - "Standard_D8ls_v5": 0.340000, - "Standard_D8pds_v5": 0.362000, - "Standard_D8plds_v5": 0.307000, - "Standard_D8pls_v5": 0.272000, - "Standard_D8ps_v5": 0.308000, - "Standard_D8s_v3": 0.384000, - "Standard_D8s_v4": 0.384000, - "Standard_D8s_v5": 0.384000, - "Standard_D96_v5": 4.608000, - "Standard_D96a_v4": 4.608000, - "Standard_D96ads_v5": 4.944000, - "Standard_D96as_v4": 4.608000, - "Standard_D96as_v5": 4.128000, - "Standard_D96d_v5": 5.424000, - "Standard_D96ds_v5": 5.424000, - "Standard_D96lds_v5": 4.608000, - "Standard_D96ls_v5": 4.080000, - "Standard_D96s_v5": 4.608000, - "Standard_DC16ads_cc_v5": 0.824000, - "Standard_DC16ads_v5": 0.824000, - "Standard_DC16as_cc_v5": 0.688000, - "Standard_DC16as_v5": 0.688000, - "Standard_DC16ds_v3": 1.808000, - "Standard_DC16s_v3": 1.536000, - "Standard_DC1ds_v3": 0.113000, - "Standard_DC1s_v2": 0.096000, - "Standard_DC1s_v3": 0.096000, - "Standard_DC24ds_v3": 2.712000, - "Standard_DC24s_v3": 2.304000, - "Standard_DC2ads_v5": 0.103000, - "Standard_DC2as_v5": 0.086000, - "Standard_DC2ds_v3": 0.226000, - "Standard_DC2s": 0.198000, - "Standard_DC2s_v2": 0.192000, - "Standard_DC2s_v3": 0.192000, - "Standard_DC32ads_cc_v5": 1.648000, - "Standard_DC32ads_v5": 1.648000, - "Standard_DC32as_cc_v5": 1.376000, - "Standard_DC32as_v5": 1.376000, - "Standard_DC32ds_v3": 3.616000, - "Standard_DC32s_v3": 3.072000, - "Standard_DC48ads_cc_v5": 2.472000, - "Standard_DC48ads_v5": 2.472000, - "Standard_DC48as_cc_v5": 2.064000, - "Standard_DC48as_v5": 2.064000, - "Standard_DC48ds_v3": 5.424000, - "Standard_DC48s_v3": 4.608000, - "Standard_DC4ads_cc_v5": 0.206000, - "Standard_DC4ads_v5": 0.206000, - "Standard_DC4as_cc_v5": 0.172000, - "Standard_DC4as_v5": 0.172000, - "Standard_DC4ds_v3": 0.452000, - "Standard_DC4s": 0.395000, - "Standard_DC4s_v2": 0.384000, - "Standard_DC4s_v3": 0.384000, - "Standard_DC64ads_cc_v5": 3.296000, - "Standard_DC64ads_v5": 3.296000, - "Standard_DC64as_cc_v5": 2.752000, - "Standard_DC64as_v5": 2.752000, - "Standard_DC8_v2": 0.768000, - "Standard_DC8ads_cc_v5": 0.412000, - "Standard_DC8ads_v5": 0.412000, - "Standard_DC8as_cc_v5": 0.344000, - "Standard_DC8as_v5": 0.344000, - "Standard_DC8ds_v3": 0.904000, - "Standard_DC8s_v3": 0.768000, - "Standard_DC96ads_cc_v5": 4.944000, - "Standard_DC96ads_v5": 4.944000, - "Standard_DC96as_cc_v5": 4.128000, - "Standard_DC96as_v5": 4.128000, - "Standard_DS1": 0.077000, - "Standard_DS11": 0.193000, - "Standard_DS11-1_v2": 0.185000, - "Standard_DS11_v2": 0.185000, - "Standard_DS11_v2_Promo": 0.185000, - "Standard_DS12": 0.386000, - "Standard_DS12-1_v2": 0.371000, - "Standard_DS12-2_v2": 0.371000, - "Standard_DS12_v2": 0.371000, - "Standard_DS12_v2_Promo": 0.371000, - "Standard_DS13": 0.771000, - "Standard_DS13-2_v2": 0.741000, - "Standard_DS13-4_v2": 0.741000, - "Standard_DS13_v2": 0.741000, - "Standard_DS13_v2_Promo": 0.741000, - "Standard_DS14": 1.542000, - "Standard_DS14-4_v2": 1.482000, - "Standard_DS14-8_v2": 1.482000, - "Standard_DS14_v2": 1.482000, - "Standard_DS14_v2_Promo": 1.482000, - "Standard_DS15_v2": 1.853000, - "Standard_DS15i_v2": 1.853000, - "Standard_DS1_v2": 0.073000, - "Standard_DS2": 0.154000, - "Standard_DS2_v2": 0.146000, - "Standard_DS2_v2_Promo": 0.146000, - "Standard_DS3": 0.308000, - "Standard_DS3_v2": 0.293000, - "Standard_DS3_v2_Promo": 0.293000, - "Standard_DS4": 0.616000, - "Standard_DS4_v2": 0.585000, - "Standard_DS4_v2_Promo": 0.585000, - "Standard_DS5_v2": 1.170000, - "Standard_DS5_v2_Promo": 1.170000, - "Standard_E104i_v5": 7.207000, - "Standard_E104id_v5": 8.237000, - "Standard_E104ids_v5": 8.237000, - "Standard_E104is_v5": 7.207000, - "Standard_E112iads_v5": 8.070000, - "Standard_E112ias_v5": 6.961000, - "Standard_E112ibds_v5": 10.287000, - "Standard_E112ibs_v5": 9.178000, - "Standard_E16-4ads_v5": 1.048000, - "Standard_E16-4as_v4": 1.008000, - "Standard_E16-4as_v5": 0.904000, - "Standard_E16-4ds_v4": 1.152000, - "Standard_E16-4ds_v5": 1.152000, - "Standard_E16-4s_v3": 1.008000, - "Standard_E16-4s_v4": 1.008000, - "Standard_E16-4s_v5": 1.008000, - "Standard_E16-8ads_v5": 1.048000, - "Standard_E16-8as_v4": 1.008000, - "Standard_E16-8as_v5": 0.904000, - "Standard_E16-8ds_v4": 1.152000, - "Standard_E16-8ds_v5": 1.152000, - "Standard_E16-8s_v3": 1.008000, - "Standard_E16-8s_v4": 1.008000, - "Standard_E16-8s_v5": 1.008000, - "Standard_E16_v3": 1.008000, - "Standard_E16_v4": 1.008000, - "Standard_E16_v5": 1.008000, - "Standard_E16a_v4": 1.008000, - "Standard_E16ads_v5": 1.048000, - "Standard_E16as_v4": 1.008000, - "Standard_E16as_v5": 0.904000, - "Standard_E16bds_v5": 1.336000, - "Standard_E16bs_v5": 1.192000, - "Standard_E16d_v4": 1.152000, - "Standard_E16d_v5": 1.152000, - "Standard_E16ds_v4": 1.152000, - "Standard_E16ds_v5": 1.152000, - "Standard_E16pds_v5": 0.922000, - "Standard_E16ps_v5": 0.806000, - "Standard_E16s_v3": 1.008000, - "Standard_E16s_v4": 1.008000, - "Standard_E16s_v5": 1.008000, - "Standard_E20_v3": 1.260000, - "Standard_E20_v4": 1.260000, - "Standard_E20_v5": 1.260000, - "Standard_E20a_v4": 1.260000, - "Standard_E20ads_v5": 1.310000, - "Standard_E20as_v4": 1.260000, - "Standard_E20as_v5": 1.130000, - "Standard_E20d_v4": 1.440000, - "Standard_E20d_v5": 1.440000, - "Standard_E20ds_v4": 1.440000, - "Standard_E20ds_v5": 1.440000, - "Standard_E20pds_v5": 1.152000, - "Standard_E20ps_v5": 1.008000, - "Standard_E20s_v3": 1.260000, - "Standard_E20s_v4": 1.260000, - "Standard_E20s_v5": 1.260000, - "Standard_E2_v3": 0.126000, - "Standard_E2_v4": 0.126000, - "Standard_E2_v5": 0.126000, - "Standard_E2a_v4": 0.126000, - "Standard_E2ads_v5": 0.131000, - "Standard_E2as_v4": 0.126000, - "Standard_E2as_v5": 0.113000, - "Standard_E2bds_v5": 0.167000, - "Standard_E2bs_v5": 0.149000, - "Standard_E2d_v4": 0.144000, - "Standard_E2d_v5": 0.144000, - "Standard_E2ds_v4": 0.144000, - "Standard_E2ds_v5": 0.144000, - "Standard_E2pds_v5": 0.115000, - "Standard_E2ps_v5": 0.101000, - "Standard_E2s_v3": 0.126000, - "Standard_E2s_v4": 0.126000, - "Standard_E2s_v5": 0.126000, - "Standard_E32-16ads_v5": 2.096000, - "Standard_E32-16as_v4": 2.016000, - "Standard_E32-16as_v5": 1.808000, - "Standard_E32-16ds_v4": 2.304000, - "Standard_E32-16ds_v5": 2.304000, - "Standard_E32-16s_v3": 2.016000, - "Standard_E32-16s_v4": 2.016000, - "Standard_E32-16s_v5": 2.016000, - "Standard_E32-8ads_v5": 2.096000, - "Standard_E32-8as_v4": 2.016000, - "Standard_E32-8as_v5": 1.808000, - "Standard_E32-8ds_v4": 2.304000, - "Standard_E32-8ds_v5": 2.304000, - "Standard_E32-8s_v3": 2.016000, - "Standard_E32-8s_v4": 2.016000, - "Standard_E32-8s_v5": 2.016000, - "Standard_E32_v3": 2.016000, - "Standard_E32_v4": 2.016000, - "Standard_E32_v5": 2.016000, - "Standard_E32a_v4": 2.016000, - "Standard_E32ads_v5": 2.096000, - "Standard_E32as_v4": 2.016000, - "Standard_E32as_v5": 1.808000, - "Standard_E32bds_v5": 2.672000, - "Standard_E32bs_v5": 2.384000, - "Standard_E32d_v4": 2.304000, - "Standard_E32d_v5": 2.304000, - "Standard_E32ds_v4": 2.304000, - "Standard_E32ds_v5": 2.304000, - "Standard_E32pds_v5": 1.843000, - "Standard_E32ps_v5": 1.613000, - "Standard_E32s_v3": 2.016000, - "Standard_E32s_v4": 2.016000, - "Standard_E32s_v5": 2.016000, - "Standard_E4-2ads_v5": 0.262000, - "Standard_E4-2as_v4": 0.252000, - "Standard_E4-2as_v5": 0.226000, - "Standard_E4-2ds_v4": 0.288000, - "Standard_E4-2ds_v5": 0.288000, - "Standard_E4-2s_v3": 0.252000, - "Standard_E4-2s_v4": 0.252000, - "Standard_E4-2s_v5": 0.252000, - "Standard_E48_v3": 3.024000, - "Standard_E48_v4": 3.024000, - "Standard_E48_v5": 3.024000, - "Standard_E48a_v4": 3.024000, - "Standard_E48ads_v5": 3.144000, - "Standard_E48as_v4": 3.024000, - "Standard_E48as_v5": 2.712000, - "Standard_E48bds_v5": 4.008000, - "Standard_E48bs_v5": 3.576000, - "Standard_E48d_v4": 3.456000, - "Standard_E48d_v5": 3.456000, - "Standard_E48ds_v4": 3.456000, - "Standard_E48ds_v5": 3.456000, - "Standard_E48s_v3": 3.024000, - "Standard_E48s_v4": 3.024000, - "Standard_E48s_v5": 3.024000, - "Standard_E4_v3": 0.252000, - "Standard_E4_v4": 0.252000, - "Standard_E4_v5": 0.252000, - "Standard_E4a_v4": 0.252000, - "Standard_E4ads_v5": 0.262000, - "Standard_E4as_v4": 0.252000, - "Standard_E4as_v5": 0.226000, - "Standard_E4bds_v5": 0.334000, - "Standard_E4bs_v5": 0.298000, - "Standard_E4d_v4": 0.288000, - "Standard_E4d_v5": 0.288000, - "Standard_E4ds_v4": 0.288000, - "Standard_E4ds_v5": 0.288000, - "Standard_E4pds_v5": 0.230000, - "Standard_E4ps_v5": 0.202000, - "Standard_E4s_v3": 0.252000, - "Standard_E4s_v4": 0.252000, - "Standard_E4s_v5": 0.252000, - "Standard_E64-16ads_v5": 4.192000, - "Standard_E64-16as_v4": 4.032000, - "Standard_E64-16as_v5": 3.616000, - "Standard_E64-16ds_v4": 4.608000, - "Standard_E64-16ds_v5": 4.608000, - "Standard_E64-16s_v3": 3.629000, - "Standard_E64-16s_v4": 4.032000, - "Standard_E64-16s_v5": 4.032000, - "Standard_E64-32ads_v5": 4.192000, - "Standard_E64-32as_v4": 4.032000, - "Standard_E64-32as_v5": 3.616000, - "Standard_E64-32ds_v4": 4.608000, - "Standard_E64-32ds_v5": 4.608000, - "Standard_E64-32s_v3": 3.629000, - "Standard_E64-32s_v4": 4.032000, - "Standard_E64-32s_v5": 4.032000, - "Standard_E64_v3": 3.629000, - "Standard_E64_v4": 4.032000, - "Standard_E64_v5": 4.032000, - "Standard_E64a_v4": 4.032000, - "Standard_E64ads_v5": 4.192000, - "Standard_E64as_v4": 4.032000, - "Standard_E64as_v5": 3.616000, - "Standard_E64bds_v5": 5.344000, - "Standard_E64bs_v5": 4.768000, - "Standard_E64d_v4": 4.608000, - "Standard_E64d_v5": 4.608000, - "Standard_E64ds_v4": 4.608000, - "Standard_E64ds_v5": 4.608000, - "Standard_E64i_v3": 3.629000, - "Standard_E64is_v3": 3.629000, - "Standard_E64s_v3": 3.629000, - "Standard_E64s_v4": 4.032000, - "Standard_E64s_v5": 4.032000, - "Standard_E8-2ads_v5": 0.524000, - "Standard_E8-2as_v4": 0.504000, - "Standard_E8-2as_v5": 0.452000, - "Standard_E8-2ds_v4": 0.576000, - "Standard_E8-2ds_v5": 0.576000, - "Standard_E8-2s_v3": 0.504000, - "Standard_E8-2s_v4": 0.504000, - "Standard_E8-2s_v5": 0.504000, - "Standard_E8-4ads_v5": 0.524000, - "Standard_E8-4as_v4": 0.504000, - "Standard_E8-4as_v5": 0.452000, - "Standard_E8-4ds_v4": 0.576000, - "Standard_E8-4ds_v5": 0.576000, - "Standard_E8-4s_v3": 0.504000, - "Standard_E8-4s_v4": 0.504000, - "Standard_E8-4s_v5": 0.504000, - "Standard_E80ids_v4": 5.760000, - "Standard_E80is_v4": 5.040000, - "Standard_E8_v3": 0.504000, - "Standard_E8_v4": 0.504000, - "Standard_E8_v5": 0.504000, - "Standard_E8a_v4": 0.504000, - "Standard_E8ads_v5": 0.524000, - "Standard_E8as_v4": 0.504000, - "Standard_E8as_v5": 0.452000, - "Standard_E8bds_v5": 0.668000, - "Standard_E8bs_v5": 0.596000, - "Standard_E8d_v4": 0.576000, - "Standard_E8d_v5": 0.576000, - "Standard_E8ds_v4": 0.576000, - "Standard_E8ds_v5": 0.576000, - "Standard_E8pds_v5": 0.461000, - "Standard_E8ps_v5": 0.403000, - "Standard_E8s_v3": 0.504000, - "Standard_E8s_v4": 0.504000, - "Standard_E8s_v5": 0.504000, - "Standard_E96-24ads_v5": 6.288000, - "Standard_E96-24as_v4": 6.048000, - "Standard_E96-24as_v5": 5.424000, - "Standard_E96-24ds_v5": 6.912000, - "Standard_E96-24s_v5": 6.048000, - "Standard_E96-48ads_v5": 6.288000, - "Standard_E96-48as_v4": 6.048000, - "Standard_E96-48as_v5": 5.424000, - "Standard_E96-48ds_v5": 6.912000, - "Standard_E96-48s_v5": 6.048000, - "Standard_E96_v5": 6.048000, - "Standard_E96a_v4": 6.048000, - "Standard_E96ads_v5": 6.288000, - "Standard_E96as_v4": 6.048000, - "Standard_E96as_v5": 5.424000, - "Standard_E96bds_v5": 8.016000, - "Standard_E96bs_v5": 7.152000, - "Standard_E96d_v5": 6.912000, - "Standard_E96ds_v5": 6.912000, - "Standard_E96iads_v5": 6.917000, - "Standard_E96ias_v5": 5.966000, - "Standard_E96s_v5": 6.048000, - "Standard_EC16ads_cc_v5": 1.048000, - "Standard_EC16ads_v5": 1.048000, - "Standard_EC16as_cc_v5": 0.904000, - "Standard_EC16as_v5": 0.904000, - "Standard_EC20ads_cc_v5": 1.310000, - "Standard_EC20ads_v5": 1.310000, - "Standard_EC20as_cc_v5": 1.130000, - "Standard_EC20as_v5": 1.130000, - "Standard_EC2ads_v5": 0.131000, - "Standard_EC2as_v5": 0.113000, - "Standard_EC32ads_cc_v5": 2.096000, - "Standard_EC32ads_v5": 2.096000, - "Standard_EC32as_cc_v5": 1.808000, - "Standard_EC32as_v5": 1.808000, - "Standard_EC48ads_cc_v5": 3.144000, - "Standard_EC48ads_v5": 3.144000, - "Standard_EC48as_cc_v5": 2.712000, - "Standard_EC48as_v5": 2.712000, - "Standard_EC4ads_cc_v5": 0.262000, - "Standard_EC4ads_v5": 0.262000, - "Standard_EC4as_cc_v5": 0.226000, - "Standard_EC4as_v5": 0.226000, - "Standard_EC64ads_cc_v5": 4.192000, - "Standard_EC64ads_v5": 4.192000, - "Standard_EC64as_cc_v5": 3.616000, - "Standard_EC64as_v5": 3.616000, - "Standard_EC8ads_cc_v5": 0.524000, - "Standard_EC8ads_v5": 0.524000, - "Standard_EC8as_cc_v5": 0.452000, - "Standard_EC8as_v5": 0.452000, - "Standard_EC96ads_cc_v5": 6.288000, - "Standard_EC96ads_v5": 6.288000, - "Standard_EC96as_cc_v5": 5.424000, - "Standard_EC96as_v5": 5.424000, - "Standard_EC96iads_v5": 6.917000, - "Standard_EC96ias_v5": 5.966000, - "Standard_F1": 0.049700, - "Standard_F16": 0.796000, - "Standard_F16s": 0.796000, - "Standard_F16s_v2": 0.677000, - "Standard_F1s": 0.049700, - "Standard_F2": 0.099000, - "Standard_F2s": 0.099000, - "Standard_F2s_v2": 0.084600, - "Standard_F32s_v2": 1.353000, - "Standard_F4": 0.199000, - "Standard_F48s_v2": 2.030000, - "Standard_F4s": 0.199000, - "Standard_F4s_v2": 0.169000, - "Standard_F64s_v2": 2.706000, - "Standard_F72s_v2": 3.045000, - "Standard_F8": 0.398000, - "Standard_F8s": 0.398000, - "Standard_F8s_v2": 0.338000, - "Standard_FX12mds": 1.116000, - "Standard_FX24mds": 2.232000, - "Standard_FX36mds": 3.348000, - "Standard_FX48mds": 4.464000, - "Standard_FX4mds": 0.372000, - "Standard_H16": 1.807000, - "Standard_H16m": 2.422000, - "Standard_H16mr": 2.664000, - "Standard_H16r": 1.988000, - "Standard_H8": 0.904000, - "Standard_H8m": 1.211000, - "Standard_HB120-16rs_v2": 3.600000, - "Standard_HB120-16rs_v3": 3.600000, - "Standard_HB120-32rs_v2": 3.600000, - "Standard_HB120-32rs_v3": 3.600000, - "Standard_HB120-64rs_v2": 3.600000, - "Standard_HB120-64rs_v3": 3.600000, - "Standard_HB120-96rs_v2": 3.600000, - "Standard_HB120-96rs_v3": 3.600000, - "Standard_HB120rs_v2": 3.600000, - "Standard_HB120rs_v3": 3.600000, - "Standard_HB176-144rs_v4": 7.200000, - "Standard_HB176-24rs_v4": 7.200000, - "Standard_HB176-48rs_v4": 7.200000, - "Standard_HB176-96rs_v4": 7.200000, - "Standard_HB176rs_v4": 7.200000, - "Standard_HB60-15rs": 2.280000, - "Standard_HB60-30rs": 2.280000, - "Standard_HB60-45rs": 2.280000, - "Standard_HB60rs": 2.280000, - "Standard_HC44-16rs": 3.168000, - "Standard_HC44-32rs": 3.168000, - "Standard_HC44rs": 3.168000, - "Standard_HX176-144rs": 8.640000, - "Standard_HX176-24rs": 8.640000, - "Standard_HX176-48rs": 8.640000, - "Standard_HX176-96rs": 8.640000, - "Standard_HX176rs": 8.640000, - "Standard_L16as_v3": 1.248000, - "Standard_L16s_v2": 1.248000, - "Standard_L16s_v3": 1.392000, - "Standard_L32as_v3": 2.496000, - "Standard_L32s_v2": 2.496000, - "Standard_L32s_v3": 2.784000, - "Standard_L48as_v3": 3.744000, - "Standard_L48s_v2": 3.744000, - "Standard_L48s_v3": 4.176000, - "Standard_L64as_v3": 4.992000, - "Standard_L64s_v2": 4.992000, - "Standard_L64s_v3": 5.568000, - "Standard_L80as_v3": 6.240000, - "Standard_L80s_v2": 6.240000, - "Standard_L80s_v3": 6.960000, - "Standard_L88is_v2": 6.864000, - "Standard_L8as_v3": 0.624000, - "Standard_L8s_v2": 0.624000, - "Standard_L8s_v3": 0.696000, - "Standard_M128": 13.338000, - "Standard_M128-32ms": 26.688000, - "Standard_M128-64ms": 26.688000, - "Standard_M128dms_v2": 26.690000, - "Standard_M128ds_v2": 13.340000, - "Standard_M128m": 26.688000, - "Standard_M128ms": 26.688000, - "Standard_M128ms_v2": 26.269000, - "Standard_M128s": 13.338000, - "Standard_M128s_v2": 12.919000, - "Standard_M16-4ms": 3.073000, - "Standard_M16-8ms": 3.073000, - "Standard_M16ms": 3.073000, - "Standard_M16s": 2.387000, - "Standard_M192idms_v2": 32.064000, - "Standard_M192ids_v2": 16.032000, - "Standard_M192ims_v2": 31.643000, - "Standard_M192is_v2": 15.611000, - "Standard_M208-104ms_v2": 44.620000, - "Standard_M208-104s_v2": 22.310000, - "Standard_M208-52ms_v2": 44.620000, - "Standard_M208-52s_v2": 22.310000, - "Standard_M208ms_v2": 44.620000, - "Standard_M208s_v2": 22.310000, - "Standard_M32-16ms": 6.146000, - "Standard_M32-8ms": 6.146000, - "Standard_M32dms_v2": 6.146000, - "Standard_M32ls": 2.873000, - "Standard_M32ms": 6.146000, - "Standard_M32ms_v2": 6.041000, - "Standard_M32s": 3.335000, - "Standard_M32ts": 2.707000, - "Standard_M416-104ms_v2": 99.150000, - "Standard_M416-104s_v2": 49.580000, - "Standard_M416-208ms_v2": 99.150000, - "Standard_M416-208s_v2": 49.580000, - "Standard_M416is_v2": 49.580000, - "Standard_M416ms_v2": 99.150000, - "Standard_M416s_8_v2": 66.110000, - "Standard_M416s_v2": 49.580000, - "Standard_M64": 6.669000, - "Standard_M64-16ms": 10.337000, - "Standard_M64-32ms": 10.337000, - "Standard_M64dms_v2": 10.340000, - "Standard_M64ds_v2": 6.669000, - "Standard_M64ls": 5.415000, - "Standard_M64m": 10.337000, - "Standard_M64ms": 10.337000, - "Standard_M64ms_v2": 10.130000, - "Standard_M64s": 6.669000, - "Standard_M64s_v2": 6.459000, - "Standard_M8-2ms": 1.536500, - "Standard_M8-4ms": 1.536500, - "Standard_M8ms": 1.536500, - "Standard_NC12": 1.800000, - "Standard_NC12s_v2": 4.140000, - "Standard_NC12s_v3": 6.120000, - "Standard_NC16as_T4_v3": 1.204000, - "Standard_NC24": 3.600000, - "Standard_NC24ads_A100_v4": 3.673000, - "Standard_NC24r": 3.960000, - "Standard_NC24rs_v2": 9.108000, - "Standard_NC24rs_v3": 13.460000, - "Standard_NC24s_v2": 8.280000, - "Standard_NC24s_v3": 12.240000, - "Standard_NC48ads_A100_v4": 7.346000, - "Standard_NC4as_T4_v3": 0.526000, - "Standard_NC6": 0.900000, - "Standard_NC64as_T4_v3": 4.352000, - "Standard_NC6s_v2": 2.070000, - "Standard_NC6s_v3": 3.060000, - "Standard_NC8as_T4_v3": 0.752000, - "Standard_NC96ads_A100_v4": 14.692000, - "Standard_ND12s": 4.140000, - "Standard_ND24rs": 9.108000, - "Standard_ND24s": 8.280000, - "Standard_ND40rs_v2": 22.032000, - "Standard_ND40s_v2": 12.240000, - "Standard_ND6s": 2.070000, - "Standard_ND96ams_A100_v4": 32.770000, - "Standard_ND96amsr_A100_v4": 32.770000, - "Standard_ND96asr_A100_v4": 27.197000, - "Standard_ND96asr_v4": 27.197000, - "Standard_NP10s": 1.650000, - "Standard_NP20s": 3.300000, - "Standard_NP40s": 6.600000, - "Standard_NV12": 2.280000, - "Standard_NV12ads_A10_v5": 0.908000, - "Standard_NV12s_v3": 1.140000, - "Standard_NV16as_v4": 0.932000, - "Standard_NV18ads_A10_v5": 1.600000, - "Standard_NV24": 4.560000, - "Standard_NV24s_v3": 2.280000, - "Standard_NV32as_v4": 1.864000, - "Standard_NV36adms_A10_v5": 4.520000, - "Standard_NV36ads_A10_v5": 3.200000, - "Standard_NV48s_v3": 4.560000, - "Standard_NV4as_v4": 0.233000, - "Standard_NV6": 1.140000, - "Standard_NV6ads_A10_v5": 0.454000, - "Standard_NV72ads_A10_v5": 6.520000, - "Standard_NV8as_v4": 0.466000, - "Standard_PB12s": 1.660000, - "Standard_PB24s": 3.320000, - "Standard_PB6s": 0.830000, - } - // eastus2 - initialOnDemandPrices["eastus2"] = map[string]float64{ - "Dasv4_Type2": 5.069000, - "Ddsv4_Type2": 4.723000, - "Dsv5_Type1": 5.280000, - "Easv4_Type2": 6.653000, - "Lasv3_Type1": 6.864000, - "Lsv2_Type1": 6.864000, - "Msmv2_Type1": 109.060000, - "NVsv3_Type1": 5.016000, - "Standard_A1": 0.060000, - "Standard_A4": 0.480000, - "Standard_B16ls_v2": 0.589000, - "Standard_B16pls_v2": 0.476000, - "Standard_B16s_v2": 0.739000, - "Standard_B1s": 0.010400, - "Standard_B20ms": 0.832000, - "Standard_B2as_v2": 0.084400, - "Standard_B2ls_v2": 0.050800, - "Standard_B2pls_v2": 0.042800, - "Standard_B2ts_v2": 0.010400, - "Standard_B4as_v2": 0.169000, - "Standard_B4ls_v2": 0.147000, - "Standard_B4ms": 0.166000, - "Standard_B4ps_v2": 0.153000, - "Standard_B4s_v2": 0.185000, - "Standard_B8als_v2": 0.303000, - "Standard_B8ms": 0.333000, - "Standard_D12": 0.347000, - "Standard_D12_v2_Promo": 0.299000, - "Standard_D14_v2_Promo": 1.196000, - "Standard_D16_v3": 0.768000, - "Standard_D16as_v4": 0.768000, - "Standard_D16d_v4": 0.904000, - "Standard_D2_v2": 0.114000, - "Standard_D2as_v4": 0.096000, - "Standard_D2as_v5": 0.086000, - "Standard_D2as_v5_Promo": 0.077000, - "Standard_D2ds_v4": 0.113000, - "Standard_D2ds_v5": 0.113000, - "Standard_D2pds_v5": 0.090400, - "Standard_D2pls_v5": 0.068000, - "Standard_D2s_v4": 0.096000, - "Standard_D32-8s_v3": 1.536000, - "Standard_D32as_v4": 1.536000, - "Standard_D32as_v5_Promo": 1.232000, - "Standard_D32ds_v4": 1.808000, - "Standard_D32ls_v5": 1.360000, - "Standard_D32pds_v5": 1.446000, - "Standard_D48_v4": 2.304000, - "Standard_D48_v5": 2.304000, - "Standard_D48as_v4": 2.304000, - "Standard_D48ds_v4": 2.712000, - "Standard_D4_v5": 0.192000, - "Standard_D4ads_v5": 0.206000, - "Standard_D4as_v4": 0.192000, - "Standard_D4as_v5": 0.172000, - "Standard_D4d_v5": 0.226000, - "Standard_D4pds_v5": 0.181000, - "Standard_D4ps_v5": 0.154000, - "Standard_D4s_v3": 0.192000, - "Standard_D64ads_v5": 3.296000, - "Standard_D64as_v4": 3.072000, - "Standard_D64ls_v5": 2.720000, - "Standard_D64pls_v5": 2.176000, - "Standard_D64s_v3": 3.072000, - "Standard_D64s_v5": 3.072000, - "Standard_D8_v3": 0.384000, - "Standard_D8a_v4": 0.384000, - "Standard_D8ads_v5": 0.412000, - "Standard_D8ds_v5": 0.452000, - "Standard_D8lds_v5": 0.384000, - "Standard_D8ps_v5": 0.308000, - "Standard_D8s_v5": 0.384000, - "Standard_D96as_v4": 4.608000, - "Standard_D96s_v5": 4.608000, - "Standard_DC16as_v5": 0.688000, - "Standard_DC2ads_v5": 0.103000, - "Standard_DC2ds_v3": 0.226000, - "Standard_DC48as_v5": 2.064000, - "Standard_DC48eds_v5": 2.712000, - "Standard_DC64eds_v5": 3.616000, - "Standard_DC8s_v3": 0.768000, - "Standard_DC96ads_v5": 4.944000, - "Standard_DS11_v2": 0.149000, - "Standard_DS12_v2_Promo": 0.299000, - "Standard_DS13-2_v2": 0.598000, - "Standard_DS13_v2_Promo": 0.598000, - "Standard_DS14": 1.387000, - "Standard_DS14-4_v2": 1.196000, - "Standard_E104i_v5": 7.207000, - "Standard_E16-4ads_v5": 1.048000, - "Standard_E16-4ds_v4": 1.152000, - "Standard_E16-4ds_v5": 1.152000, - "Standard_E16-8as_v4": 1.008000, - "Standard_E16_v3": 1.064000, - "Standard_E16_v5": 1.008000, - "Standard_E16bds_v5": 1.336000, - "Standard_E16d_v4": 1.152000, - "Standard_E16ds_v5": 1.152000, - "Standard_E20_v3": 1.460000, - "Standard_E20_v4": 1.260000, - "Standard_E20_v5": 1.260000, - "Standard_E20d_v4": 1.440000, - "Standard_E20ps_v5": 1.008000, - "Standard_E20s_v3": 1.460000, - "Standard_E20s_v5": 1.260000, - "Standard_E2_v3": 0.133000, - "Standard_E2_v4": 0.126000, - "Standard_E2d_v4": 0.144000, - "Standard_E2s_v3": 0.133000, - "Standard_E2s_v4": 0.126000, - "Standard_E32-16as_v4": 2.016000, - "Standard_E32-16ds_v4": 2.304000, - "Standard_E32-16ds_v5": 2.304000, - "Standard_E32-8ads_v5": 2.096000, - "Standard_E32-8as_v4": 2.016000, - "Standard_E32-8ds_v5": 2.304000, - "Standard_E32-8s_v3": 2.128000, - "Standard_E32_v3": 2.128000, - "Standard_E32as_v5": 1.808000, - "Standard_E32bs_v5": 2.384000, - "Standard_E32d_v4": 2.304000, - "Standard_E32ds_v5": 2.304000, - "Standard_E32s_v4": 2.016000, - "Standard_E32s_v5": 2.016000, - "Standard_E48as_v5": 2.712000, - "Standard_E4ds_v4": 0.288000, - "Standard_E4ps_v5": 0.202000, - "Standard_E64-16as_v4": 4.032000, - "Standard_E64-16as_v5": 3.616000, - "Standard_E64-32ads_v5": 4.192000, - "Standard_E64-32ds_v4": 4.608000, - "Standard_E64-32ds_v5": 4.608000, - "Standard_E64ds_v5": 4.608000, - "Standard_E64s_v3": 3.629000, - "Standard_E8-2s_v3": 0.532000, - "Standard_E8ads_v5": 0.524000, - "Standard_E8bs_v5": 0.596000, - "Standard_E8ds_v4": 0.576000, - "Standard_E8ps_v5": 0.403000, - "Standard_E8s_v4": 0.504000, - "Standard_E96-24ds_v5": 6.912000, - "Standard_E96-48ds_v5": 6.912000, - "Standard_E96_v5": 6.048000, - "Standard_E96ads_v5": 6.288000, - "Standard_E96bds_v5": 8.016000, - "Standard_EC48ads_v5": 3.144000, - "Standard_EC4ads_v5": 0.262000, - "Standard_EC8es_v5": 0.504000, - "Standard_F1": 0.049700, - "Standard_F4": 0.199000, - "Standard_F8s": 0.398000, - "Standard_FX36mds": 3.348000, - "Standard_FX4mds": 0.372000, - "Standard_HB176-144rs_v4": 7.200000, - "Standard_L16as_v3": 1.248000, - "Standard_L16s_v3": 1.396000, - "Standard_L32s_v2": 2.496000, - "Standard_L48s_v3": 4.188000, - "Standard_L4s": 0.343000, - "Standard_L8s_v2": 0.624000, - "Standard_M128ds_v2": 13.340000, - "Standard_M12s_v3": 0.000000, - "Standard_M176ds_3_v3": 0.000000, - "Standard_M176s_3_v3": 0.000000, - "Standard_M208-104s_v2": 22.310000, - "Standard_M24s_v3": 0.000000, - "Standard_M32-8ms": 6.146000, - "Standard_M32ls": 2.873000, - "Standard_M416is_v2": 49.580000, - "Standard_M64": 6.669000, - "Standard_M64ls": 5.415000, - "Standard_M64m": 10.337000, - "Standard_M64ms": 10.337000, - "Standard_M64s_v2": 6.459000, - "Standard_M96s_1_v3": 0.000000, - "Standard_NC24r": 3.960000, - "Standard_NC48ads_A100_v4": 7.346000, - "Standard_NC4as_T4_v3": 0.526000, - "Standard_NC6": 0.900000, - "Standard_NC64as_T4_v3": 4.352000, - "Standard_NG8ads_V620_v1": 1.095000, - "Standard_NV16as_v4": 0.932000, - "Standard_NV4as_v4": 0.233000, - } - // francecentral - initialOnDemandPrices["francecentral"] = map[string]float64{ - "Basic_A2": 0.101000, - "Basic_A4": 0.449000, - "Dadsv5_Type1": 7.454000, - "Dasv4_Type2": 6.160000, - "Ddsv4_Type 1": 4.646000, - "Dsv3_Type4": 6.170000, - "Dsv4_Type2": 5.914000, - "Easv4_Type1": 7.814000, - "Easv5_Type1": 7.022000, - "Ebsv5-Type1": 6.213000, - "Edsv4_Type2": 7.064000, - "Edsv5_Type1": 8.923000, - "Esv3_Type3": 5.043000, - "Esv4_Type2": 6.838000, - "Esv5_Type1": 7.814000, - "Fsv2_Type2": 4.000000, - "Fsv2_Type4": 5.333000, - "Lsv3_Type1": 8.888000, - "Mdsmv2MedMem _Type1": 36.992000, - "Ms_Type1": 18.483000, - "NVsv3_Type1": 6.270000, - "Standard_A0": 0.022000, - "Standard_A1": 0.066000, - "Standard_A2": 0.132000, - "Standard_A2_v2": 0.106000, - "Standard_A2m_v2": 0.178000, - "Standard_A3": 0.264000, - "Standard_A5": 0.297000, - "Standard_A6": 0.594000, - "Standard_A7": 1.188000, - "Standard_A8m_v2": 0.786000, - "Standard_B12ms": 0.566000, - "Standard_B16als_v2": 0.676000, - "Standard_B16as_v2": 0.680000, - "Standard_B16ls_v2": 0.742000, - "Standard_B16pls_v2": 0.606000, - "Standard_B16ps_v2": 0.602000, - "Standard_B16s_v2": 0.755000, - "Standard_B1ls": 0.005900, - "Standard_B1s": 0.011800, - "Standard_B2als_v2": 0.051700, - "Standard_B2as_v2": 0.094200, - "Standard_B2ats_v2": 0.010600, - "Standard_B2ls_v2": 0.056400, - "Standard_B2ps_v2": 0.084400, - "Standard_B2pts_v2": 0.009400, - "Standard_B2s": 0.047200, - "Standard_B2s_v2": 0.104000, - "Standard_B2ts_v2": 0.011800, - "Standard_B32as_v2": 1.360000, - "Standard_B32ls_v2": 1.337000, - "Standard_B32s_v2": 1.510000, - "Standard_B4als_v2": 0.169000, - "Standard_B4as_v2": 0.188000, - "Standard_B4ls_v2": 0.167000, - "Standard_B4pls_v2": 0.133000, - "Standard_B4ps_v2": 0.169000, - "Standard_B4s_v2": 0.207000, - "Standard_B8als_v2": 0.338000, - "Standard_B8ms": 0.378000, - "Standard_B8pls_v2": 0.303000, - "Standard_B8s_v2": 0.378000, - "Standard_D12_v2": 0.469000, - "Standard_D14_v2": 1.874000, - "Standard_D15i_v2": 2.343000, - "Standard_D16_v3": 0.896000, - "Standard_D16a_v4": 0.896000, - "Standard_D16as_v4": 0.896000, - "Standard_D16ls_v5": 0.808000, - "Standard_D16pls_v5": 0.648000, - "Standard_D16ps_v5": 0.720000, - "Standard_D2_v2": 0.175000, - "Standard_D2_v5": 0.112000, - "Standard_D2ads_v5": 0.121000, - "Standard_D2as_v4": 0.112000, - "Standard_D2as_v5": 0.101000, - "Standard_D2ds_v4": 0.132000, - "Standard_D2ds_v5": 0.132000, - "Standard_D2lds_v5": 0.115000, - "Standard_D2ls_v5": 0.101000, - "Standard_D2plds_v5": 0.092500, - "Standard_D2ps_v5": 0.090000, - "Standard_D2s_v3": 0.112000, - "Standard_D32-16s_v3": 1.792000, - "Standard_D32_v3": 1.792000, - "Standard_D32_v5": 1.792000, - "Standard_D32a_v4": 1.792000, - "Standard_D32ads_v5": 1.936000, - "Standard_D32as_v4": 1.792000, - "Standard_D32as_v5": 1.616000, - "Standard_D32d_v4": 2.112000, - "Standard_D32ds_v4": 2.112000, - "Standard_D32ds_v5": 2.112000, - "Standard_D32pds_v5": 1.696000, - "Standard_D32pls_v5": 1.296000, - "Standard_D32ps_v5": 1.440000, - "Standard_D32s_v3": 1.792000, - "Standard_D32s_v4": 1.792000, - "Standard_D48_v3": 2.688000, - "Standard_D48_v4": 2.688000, - "Standard_D48_v5": 2.688000, - "Standard_D48a_v4": 2.688000, - "Standard_D48as_v5": 2.424000, - "Standard_D48d_v5": 3.168000, - "Standard_D48ds_v5": 3.168000, - "Standard_D48plds_v5": 2.220000, - "Standard_D48ps_v5": 2.160000, - "Standard_D48s_v3": 2.688000, - "Standard_D48s_v4": 2.688000, - "Standard_D4_v2": 0.702000, - "Standard_D4_v3": 0.224000, - "Standard_D4_v4": 0.224000, - "Standard_D4_v5": 0.224000, - "Standard_D4a_v4": 0.224000, - "Standard_D4ads_v5": 0.242000, - "Standard_D4as_v4": 0.224000, - "Standard_D4ds_v4": 0.264000, - "Standard_D4ds_v5": 0.264000, - "Standard_D4ls_v5": 0.202000, - "Standard_D4ps_v5": 0.180000, - "Standard_D5_v2": 1.404000, - "Standard_D64-32s_v3": 3.584000, - "Standard_D64_v4": 3.584000, - "Standard_D64_v5": 3.584000, - "Standard_D64a_v4": 3.584000, - "Standard_D64as_v4": 3.584000, - "Standard_D64d_v4": 4.224000, - "Standard_D64d_v5": 4.224000, - "Standard_D64lds_v5": 3.680000, - "Standard_D64plds_v5": 2.960000, - "Standard_D64pls_v5": 2.592000, - "Standard_D64ps_v5": 2.880000, - "Standard_D64s_v3": 3.584000, - "Standard_D64s_v4": 3.584000, - "Standard_D64s_v5": 3.584000, - "Standard_D8_v3": 0.448000, - "Standard_D8ads_v5": 0.484000, - "Standard_D8as_v4": 0.448000, - "Standard_D8as_v5": 0.404000, - "Standard_D8d_v4": 0.528000, - "Standard_D8d_v5": 0.528000, - "Standard_D8ds_v4": 0.528000, - "Standard_D8lds_v5": 0.460000, - "Standard_D8plds_v5": 0.370000, - "Standard_D8pls_v5": 0.324000, - "Standard_D8s_v4": 0.448000, - "Standard_D8s_v5": 0.448000, - "Standard_D96_v5": 5.376000, - "Standard_D96as_v4": 5.376000, - "Standard_D96ds_v5": 6.336000, - "Standard_DS11-1_v2": 0.234000, - "Standard_DS12-1_v2": 0.469000, - "Standard_DS12-2_v2": 0.469000, - "Standard_DS13-4_v2": 0.937000, - "Standard_DS13_v2": 0.937000, - "Standard_DS14_v2": 1.874000, - "Standard_DS1_v2": 0.087700, - "Standard_DS2_v2": 0.175000, - "Standard_DS3_v2": 0.351000, - "Standard_DS4_v2": 0.702000, - "Standard_DS5_v2": 1.404000, - "Standard_E104id_v5": 9.667000, - "Standard_E104ids_v5": 9.667000, - "Standard_E104is_v5": 8.466000, - "Standard_E112ias_v5": 8.193000, - "Standard_E16-4as_v5": 1.064000, - "Standard_E16-4ds_v4": 1.352000, - "Standard_E16-4s_v4": 1.184000, - "Standard_E16-4s_v5": 1.184000, - "Standard_E16-8ads_v5": 1.224000, - "Standard_E16-8as_v4": 1.184000, - "Standard_E16-8ds_v4": 1.352000, - "Standard_E16-8s_v4": 1.184000, - "Standard_E16-8s_v5": 1.184000, - "Standard_E16a_v4": 1.184000, - "Standard_E16ads_v5": 1.224000, - "Standard_E16as_v5": 1.064000, - "Standard_E16bds_v5": 1.580000, - "Standard_E16bs_v5": 1.412000, - "Standard_E16d_v5": 1.352000, - "Standard_E16ds_v4": 1.352000, - "Standard_E16ds_v5": 1.352000, - "Standard_E16pds_v5": 1.080000, - "Standard_E16ps_v5": 0.944000, - "Standard_E16s_v5": 1.184000, - "Standard_E20_v5": 1.480000, - "Standard_E20as_v5": 1.330000, - "Standard_E20d_v4": 1.690000, - "Standard_E20ds_v4": 1.690000, - "Standard_E20pds_v5": 1.350000, - "Standard_E20ps_v5": 1.180000, - "Standard_E20s_v5": 1.480000, - "Standard_E2_v3": 0.156000, - "Standard_E2_v5": 0.148000, - "Standard_E2a_v4": 0.148000, - "Standard_E2as_v5": 0.133000, - "Standard_E2d_v4": 0.169000, - "Standard_E2d_v5": 0.169000, - "Standard_E2ds_v5": 0.169000, - "Standard_E2ps_v5": 0.118000, - "Standard_E32-16ds_v5": 2.704000, - "Standard_E32-8ads_v5": 2.448000, - "Standard_E32-8as_v5": 2.128000, - "Standard_E32-8ds_v4": 2.704000, - "Standard_E32-8ds_v5": 2.704000, - "Standard_E32-8s_v3": 2.496000, - "Standard_E32-8s_v4": 2.368000, - "Standard_E32-8s_v5": 2.368000, - "Standard_E32a_v4": 2.368000, - "Standard_E32as_v4": 2.368000, - "Standard_E32as_v5": 2.128000, - "Standard_E32bds_v5": 3.160000, - "Standard_E32bs_v5": 2.824000, - "Standard_E32d_v5": 2.704000, - "Standard_E32ps_v5": 1.888000, - "Standard_E32s_v5": 2.368000, - "Standard_E4-2as_v4": 0.296000, - "Standard_E4-2as_v5": 0.266000, - "Standard_E4-2ds_v4": 0.338000, - "Standard_E48_v3": 3.740000, - "Standard_E48_v5": 3.552000, - "Standard_E48a_v4": 3.552000, - "Standard_E48as_v4": 3.552000, - "Standard_E48as_v5": 3.192000, - "Standard_E48bds_v5": 4.740000, - "Standard_E48d_v4": 4.056000, - "Standard_E48d_v5": 4.056000, - "Standard_E48ds_v5": 4.056000, - "Standard_E48s_v3": 3.740000, - "Standard_E48s_v5": 3.552000, - "Standard_E4_v5": 0.296000, - "Standard_E4a_v4": 0.296000, - "Standard_E4as_v4": 0.296000, - "Standard_E4as_v5": 0.266000, - "Standard_E4d_v4": 0.338000, - "Standard_E4d_v5": 0.338000, - "Standard_E4ds_v5": 0.338000, - "Standard_E4pds_v5": 0.270000, - "Standard_E4ps_v5": 0.236000, - "Standard_E4s_v3": 0.312000, - "Standard_E4s_v4": 0.296000, - "Standard_E64-16ads_v5": 4.896000, - "Standard_E64-16as_v4": 4.736000, - "Standard_E64-16s_v3": 4.488000, - "Standard_E64-16s_v5": 4.736000, - "Standard_E64-32ads_v5": 4.896000, - "Standard_E64-32as_v5": 4.256000, - "Standard_E64-32ds_v4": 5.408000, - "Standard_E64-32s_v4": 4.736000, - "Standard_E64-32s_v5": 4.736000, - "Standard_E64_v5": 4.736000, - "Standard_E64a_v4": 4.736000, - "Standard_E64as_v5": 4.256000, - "Standard_E64ds_v4": 5.408000, - "Standard_E64ds_v5": 5.408000, - "Standard_E64i_v3": 4.488000, - "Standard_E64is_v3": 4.488000, - "Standard_E64s_v3": 4.488000, - "Standard_E64s_v4": 4.736000, - "Standard_E64s_v5": 4.736000, - "Standard_E8-2as_v4": 0.592000, - "Standard_E8-2ds_v4": 0.676000, - "Standard_E8-2s_v3": 0.624000, - "Standard_E8-2s_v5": 0.592000, - "Standard_E8-4ads_v5": 0.612000, - "Standard_E8-4as_v5": 0.532000, - "Standard_E80ids_v4": 6.760000, - "Standard_E80is_v4": 5.920000, - "Standard_E8_v3": 0.624000, - "Standard_E8a_v4": 0.592000, - "Standard_E8as_v4": 0.592000, - "Standard_E8as_v5": 0.532000, - "Standard_E8bs_v5": 0.706000, - "Standard_E8ds_v5": 0.676000, - "Standard_E8s_v4": 0.592000, - "Standard_E8s_v5": 0.592000, - "Standard_E96-24as_v4": 7.104000, - "Standard_E96-24s_v5": 7.104000, - "Standard_E96-48ads_v5": 7.344000, - "Standard_E96-48as_v4": 7.104000, - "Standard_E96-48as_v5": 6.384000, - "Standard_E96-48s_v5": 7.104000, - "Standard_E96_v5": 7.104000, - "Standard_E96a_v4": 7.104000, - "Standard_E96ads_v5": 7.344000, - "Standard_E96as_v5": 6.384000, - "Standard_E96ds_v5": 8.112000, - "Standard_E96ias_v4": 7.104000, - "Standard_E96ias_v5": 7.022000, - "Standard_E96s_v5": 7.104000, - "Standard_F16s": 0.808000, - "Standard_F16s_v2": 0.808000, - "Standard_F2": 0.101000, - "Standard_F4": 0.202000, - "Standard_F48s_v2": 2.424000, - "Standard_F4s": 0.202000, - "Standard_F4s_v2": 0.202000, - "Standard_F72s_v2": 3.636000, - "Standard_F8": 0.404000, - "Standard_F8s": 0.404000, - "Standard_F8s_v2": 0.404000, - "Standard_L16as_v3": 1.448000, - "Standard_L16s_v2": 1.448000, - "Standard_L32as_v3": 2.896000, - "Standard_L32s_v2": 2.896000, - "Standard_L48as_v3": 4.344000, - "Standard_L64s_v2": 5.792000, - "Standard_L64s_v3": 6.464000, - "Standard_L80as_v3": 7.240000, - "Standard_L80s_v2": 7.240000, - "Standard_L8as_v3": 0.724000, - "Standard_L8s_v2": 0.724000, - "Standard_L96ias_v3": 9.557000, - "Standard_M128": 16.806000, - "Standard_M128-32ms": 33.627000, - "Standard_M128dms_v2": 33.629000, - "Standard_M128ms": 33.627000, - "Standard_M128ms_v2": 33.099000, - "Standard_M128s": 16.806000, - "Standard_M16-4ms": 3.872000, - "Standard_M16s": 3.008000, - "Standard_M192idms_v2": 40.400000, - "Standard_M192ids_v2": 20.200000, - "Standard_M32-8ms": 7.744000, - "Standard_M32ms": 7.744000, - "Standard_M32ms_v2": 7.611000, - "Standard_M32s": 4.202000, - "Standard_M32ts": 3.175000, - "Standard_M64dms_v2": 13.028000, - "Standard_M64ls": 6.351000, - "Standard_M64ms": 13.025000, - "Standard_M64ms_v2": 12.763000, - "Standard_M64s": 8.403000, - "Standard_M64s_v2": 8.138000, - "Standard_M8-4ms": 1.936000, - "Standard_M8ms": 1.936000, - "Standard_NC12s_v3": 7.160000, - "Standard_NC24ads_A100_v4": 4.591000, - "Standard_NC24rs_v3": 15.753000, - "Standard_NC24s_v3": 14.321000, - "Standard_NC6s_v3": 3.580000, - "Standard_NC96ads_A100_v4": 18.365000, - "Standard_ND96amsr_A100_v4": 40.962000, - "Standard_NV36ads_A10_v5": 4.000000, - "Standard_NV48s_v3": 5.700000, - } - // francesouth - initialOnDemandPrices["francesouth"] = map[string]float64{ - "Basic_A0": 0.026000, - "Basic_A1": 0.033800, - "Basic_A2": 0.131300, - "Basic_A3": 0.291200, - "Basic_A4": 0.583700, - "Dadsv5_Type1": 9.690000, - "Dasv4_Type1": 8.008000, - "Dasv4_Type2": 8.008000, - "Dasv5_Type1": 8.088000, - "Ddsv4_Type 1": 6.046000, - "Ddsv4_Type2": 7.180000, - "Ddsv5_Type1": 9.060000, - "Dsv3_Type3": 6.422000, - "Dsv3_Type4": 8.028000, - "Dsv4_Type1": 6.420000, - "Dsv4_Type2": 8.026000, - "Dsv5_Type1": 8.008000, - "Eadsv5_Type1": 10.502000, - "Easv4_Type1": 10.159000, - "Easv4_Type2": 10.159000, - "Easv5_Type1": 9.129000, - "Ebdsv5-Type1": 9.038000, - "Ebsv5-Type1": 8.077000, - "Edsv4_Type 1": 7.705000, - "Edsv4_Type2": 9.149000, - "Edsv5_Type1": 11.600000, - "Esv3_Type3": 6.531000, - "Esv3_Type4": 8.849000, - "Esv4_Type1": 6.742000, - "Esv4_Type2": 8.848000, - "Esv5_Type1": 10.159000, - "Fsv2 Type3": 6.538000, - "Fsv2_Type2": 5.116000, - "Fsv2_Type4": 7.106000, - "Lasv3_Type1": 10.353000, - "Lsv3_Type1": 11.554000, - "Standard_A0": 0.028600, - "Standard_A1": 0.085800, - "Standard_A1_v2": 0.065000, - "Standard_A2": 0.171600, - "Standard_A2_v2": 0.137800, - "Standard_A2m_v2": 0.231400, - "Standard_A3": 0.343200, - "Standard_A4": 0.686400, - "Standard_A4_v2": 0.288600, - "Standard_A4m_v2": 0.486200, - "Standard_A5": 0.386100, - "Standard_A6": 0.772200, - "Standard_A7": 1.544400, - "Standard_A8_v2": 0.607100, - "Standard_A8m_v2": 1.021800, - "Standard_B12ms": 0.811000, - "Standard_B16als_v2": 0.783000, - "Standard_B16as_v2": 0.958000, - "Standard_B16ls_v2": 0.943000, - "Standard_B16ms": 1.082000, - "Standard_B16s_v2": 1.055000, - "Standard_B1ls": 0.008450, - "Standard_B1ms": 0.033800, - "Standard_B1s": 0.016900, - "Standard_B20ms": 1.352000, - "Standard_B2als_v2": 0.055300, - "Standard_B2as_v2": 0.120000, - "Standard_B2ats_v2": 0.013800, - "Standard_B2ls_v2": 0.070600, - "Standard_B2ms": 0.135000, - "Standard_B2s": 0.067600, - "Standard_B2s_v2": 0.123000, - "Standard_B2ts_v2": 0.024500, - "Standard_B32als_v2": 1.713000, - "Standard_B32as_v2": 1.768000, - "Standard_B32ls_v2": 1.739000, - "Standard_B32s_v2": 1.964000, - "Standard_B4als_v2": 0.196000, - "Standard_B4as_v2": 0.239000, - "Standard_B4ls_v2": 0.217000, - "Standard_B4ms": 0.270000, - "Standard_B4s_v2": 0.245000, - "Standard_B8als_v2": 0.428000, - "Standard_B8as_v2": 0.442000, - "Standard_B8ls_v2": 0.472000, - "Standard_B8ms": 0.541000, - "Standard_B8s_v2": 0.528000, - "Standard_D11_v2": 0.304000, - "Standard_D12_v2": 0.608000, - "Standard_D13_v2": 1.217000, - "Standard_D14_v2": 2.434000, - "Standard_D15_v2": 3.042000, - "Standard_D15i_v2": 3.042000, - "Standard_D16_v3": 1.164800, - "Standard_D16_v4": 1.167000, - "Standard_D16_v5": 1.165000, - "Standard_D16a_v4": 1.165000, - "Standard_D16ads_v5": 1.258000, - "Standard_D16as_v4": 1.165000, - "Standard_D16as_v5": 1.050000, - "Standard_D16d_v4": 1.374000, - "Standard_D16d_v5": 1.373000, - "Standard_D16ds_v4": 1.374000, - "Standard_D16ds_v5": 1.373000, - "Standard_D16lds_v5": 1.196000, - "Standard_D16ls_v5": 1.050000, - "Standard_D16s_v3": 1.164800, - "Standard_D16s_v4": 1.167000, - "Standard_D16s_v5": 1.165000, - "Standard_D1_v2": 0.114000, - "Standard_D2_v2": 0.228000, - "Standard_D2_v3": 0.145600, - "Standard_D2_v4": 0.146000, - "Standard_D2_v5": 0.146000, - "Standard_D2a_v4": 0.146000, - "Standard_D2ads_v5": 0.157000, - "Standard_D2as_v4": 0.146000, - "Standard_D2as_v5": 0.131000, - "Standard_D2d_v4": 0.172000, - "Standard_D2d_v5": 0.172000, - "Standard_D2ds_v4": 0.172000, - "Standard_D2ds_v5": 0.172000, - "Standard_D2lds_v5": 0.150000, - "Standard_D2ls_v5": 0.131000, - "Standard_D2s_v3": 0.145600, - "Standard_D2s_v4": 0.146000, - "Standard_D2s_v5": 0.146000, - "Standard_D32-16s_v3": 2.329600, - "Standard_D32-8s_v3": 2.329600, - "Standard_D32_v3": 2.329600, - "Standard_D32_v4": 2.335000, - "Standard_D32_v5": 2.330000, - "Standard_D32a_v4": 2.330000, - "Standard_D32ads_v5": 2.517000, - "Standard_D32as_v4": 2.330000, - "Standard_D32as_v5": 2.101000, - "Standard_D32d_v4": 2.748000, - "Standard_D32d_v5": 2.746000, - "Standard_D32ds_v4": 2.748000, - "Standard_D32ds_v5": 2.746000, - "Standard_D32lds_v5": 2.392000, - "Standard_D32ls_v5": 2.101000, - "Standard_D32s_v3": 2.329600, - "Standard_D32s_v4": 2.335000, - "Standard_D32s_v5": 2.330000, - "Standard_D3_v2": 0.456000, - "Standard_D48_v3": 3.494000, - "Standard_D48_v4": 3.502000, - "Standard_D48_v5": 3.494000, - "Standard_D48a_v4": 3.494000, - "Standard_D48ads_v5": 3.775000, - "Standard_D48as_v4": 3.494000, - "Standard_D48as_v5": 3.151000, - "Standard_D48d_v4": 4.122000, - "Standard_D48d_v5": 4.118000, - "Standard_D48ds_v4": 4.122000, - "Standard_D48ds_v5": 4.118000, - "Standard_D48lds_v5": 3.588000, - "Standard_D48ls_v5": 3.151000, - "Standard_D48s_v3": 3.494000, - "Standard_D48s_v4": 3.502000, - "Standard_D48s_v5": 3.494000, - "Standard_D4_v2": 0.912000, - "Standard_D4_v3": 0.291000, - "Standard_D4_v4": 0.292000, - "Standard_D4_v5": 0.291000, - "Standard_D4a_v4": 0.291000, - "Standard_D4ads_v5": 0.315000, - "Standard_D4as_v4": 0.291000, - "Standard_D4as_v5": 0.263000, - "Standard_D4d_v4": 0.344000, - "Standard_D4d_v5": 0.343000, - "Standard_D4ds_v4": 0.344000, - "Standard_D4ds_v5": 0.343000, - "Standard_D4lds_v5": 0.299000, - "Standard_D4ls_v5": 0.263000, - "Standard_D4s_v3": 0.291000, - "Standard_D4s_v4": 0.292000, - "Standard_D4s_v5": 0.291000, - "Standard_D5_v2": 1.824000, - "Standard_D64-16s_v3": 4.659000, - "Standard_D64-32s_v3": 4.659000, - "Standard_D64_v3": 4.659000, - "Standard_D64_v4": 4.669000, - "Standard_D64_v5": 4.659000, - "Standard_D64a_v4": 4.659000, - "Standard_D64ads_v5": 5.034000, - "Standard_D64as_v4": 4.659000, - "Standard_D64as_v5": 4.202000, - "Standard_D64d_v4": 5.496000, - "Standard_D64d_v5": 5.491000, - "Standard_D64ds_v4": 5.496000, - "Standard_D64ds_v5": 5.491000, - "Standard_D64lds_v5": 4.784000, - "Standard_D64ls_v5": 4.202000, - "Standard_D64s_v3": 4.659000, - "Standard_D64s_v4": 4.669000, - "Standard_D64s_v5": 4.659000, - "Standard_D8_v3": 0.582000, - "Standard_D8_v4": 0.584000, - "Standard_D8_v5": 0.582000, - "Standard_D8a_v4": 0.582000, - "Standard_D8ads_v5": 0.629000, - "Standard_D8as_v4": 0.582000, - "Standard_D8as_v5": 0.525000, - "Standard_D8d_v4": 0.687000, - "Standard_D8d_v5": 0.686000, - "Standard_D8ds_v4": 0.687000, - "Standard_D8ds_v5": 0.686000, - "Standard_D8lds_v5": 0.598000, - "Standard_D8ls_v5": 0.525000, - "Standard_D8s_v3": 0.582000, - "Standard_D8s_v4": 0.584000, - "Standard_D8s_v5": 0.582000, - "Standard_D96_v5": 6.989000, - "Standard_D96a_v4": 6.989000, - "Standard_D96ads_v5": 7.550000, - "Standard_D96as_v4": 6.989000, - "Standard_D96as_v5": 6.302000, - "Standard_D96d_v5": 8.237000, - "Standard_D96ds_v5": 8.237000, - "Standard_D96lds_v5": 7.176000, - "Standard_D96ls_v5": 6.302000, - "Standard_D96s_v5": 6.989000, - "Standard_DS11-1_v2": 0.304000, - "Standard_DS11_v2": 0.304000, - "Standard_DS12-1_v2": 0.608000, - "Standard_DS12-2_v2": 0.608000, - "Standard_DS12_v2": 0.608000, - "Standard_DS13-2_v2": 1.217000, - "Standard_DS13-4_v2": 1.217000, - "Standard_DS13_v2": 1.217000, - "Standard_DS14-4_v2": 2.434000, - "Standard_DS14-8_v2": 2.434000, - "Standard_DS14_v2": 2.434000, - "Standard_DS15_v2": 3.042000, - "Standard_DS15i_v2": 3.042000, - "Standard_DS1_v2": 0.114000, - "Standard_DS2_v2": 0.228000, - "Standard_DS3_v2": 0.456000, - "Standard_DS4_v2": 0.912000, - "Standard_DS5_v2": 1.824000, - "Standard_E104i_v5": 11.005000, - "Standard_E104id_v5": 12.567000, - "Standard_E104ids_v5": 12.567000, - "Standard_E104is_v5": 11.005000, - "Standard_E112iads_v5": 12.252000, - "Standard_E112ias_v5": 10.651000, - "Standard_E112ibds_v5": 15.816000, - "Standard_E112ibs_v5": 14.134000, - "Standard_E16-4ads_v5": 1.591000, - "Standard_E16-4as_v4": 1.539000, - "Standard_E16-4as_v5": 1.383000, - "Standard_E16-4ds_v4": 1.751000, - "Standard_E16-4ds_v5": 1.758000, - "Standard_E16-4s_v3": 1.621000, - "Standard_E16-4s_v4": 1.532000, - "Standard_E16-4s_v5": 1.539000, - "Standard_E16-8ads_v5": 1.591000, - "Standard_E16-8as_v4": 1.539000, - "Standard_E16-8as_v5": 1.383000, - "Standard_E16-8ds_v4": 1.751000, - "Standard_E16-8ds_v5": 1.758000, - "Standard_E16-8s_v3": 1.621000, - "Standard_E16-8s_v4": 1.532000, - "Standard_E16-8s_v5": 1.539000, - "Standard_E16_v3": 1.621000, - "Standard_E16_v4": 1.532000, - "Standard_E16_v5": 1.539000, - "Standard_E16a_v4": 1.539000, - "Standard_E16ads_v5": 1.591000, - "Standard_E16as_v4": 1.539000, - "Standard_E16as_v5": 1.383000, - "Standard_E16bds_v5": 2.054000, - "Standard_E16bs_v5": 1.836000, - "Standard_E16d_v4": 1.751000, - "Standard_E16d_v5": 1.758000, - "Standard_E16ds_v4": 1.751000, - "Standard_E16ds_v5": 1.758000, - "Standard_E16s_v3": 1.621000, - "Standard_E16s_v4": 1.532000, - "Standard_E16s_v5": 1.539000, - "Standard_E20_v3": 2.028000, - "Standard_E20_v4": 1.915000, - "Standard_E20_v5": 1.924000, - "Standard_E20a_v4": 1.924000, - "Standard_E20ads_v5": 1.989000, - "Standard_E20as_v4": 1.924000, - "Standard_E20as_v5": 1.729000, - "Standard_E20d_v4": 2.189000, - "Standard_E20d_v5": 2.197000, - "Standard_E20ds_v4": 2.189000, - "Standard_E20ds_v5": 2.197000, - "Standard_E20s_v3": 2.028000, - "Standard_E20s_v4": 1.915000, - "Standard_E20s_v5": 1.924000, - "Standard_E2_v3": 0.202800, - "Standard_E2_v4": 0.192000, - "Standard_E2_v5": 0.192000, - "Standard_E2a_v4": 0.192000, - "Standard_E2ads_v5": 0.199000, - "Standard_E2as_v4": 0.192000, - "Standard_E2as_v5": 0.173000, - "Standard_E2bds_v5": 0.257000, - "Standard_E2bs_v5": 0.229000, - "Standard_E2d_v4": 0.219000, - "Standard_E2d_v5": 0.220000, - "Standard_E2ds_v4": 0.219000, - "Standard_E2ds_v5": 0.220000, - "Standard_E2s_v3": 0.202800, - "Standard_E2s_v4": 0.192000, - "Standard_E2s_v5": 0.192000, - "Standard_E32-16ads_v5": 3.182000, - "Standard_E32-16as_v4": 3.078000, - "Standard_E32-16as_v5": 2.766000, - "Standard_E32-16ds_v4": 3.502000, - "Standard_E32-16ds_v5": 3.515000, - "Standard_E32-16s_v3": 3.244800, - "Standard_E32-16s_v4": 3.064000, - "Standard_E32-16s_v5": 3.078000, - "Standard_E32-8ads_v5": 3.182000, - "Standard_E32-8as_v4": 3.078000, - "Standard_E32-8as_v5": 2.766000, - "Standard_E32-8ds_v4": 3.502000, - "Standard_E32-8ds_v5": 3.515000, - "Standard_E32-8s_v3": 3.244800, - "Standard_E32-8s_v4": 3.064000, - "Standard_E32-8s_v5": 3.078000, - "Standard_E32_v3": 3.244800, - "Standard_E32_v4": 3.064000, - "Standard_E32_v5": 3.078000, - "Standard_E32a_v4": 3.078000, - "Standard_E32ads_v5": 3.182000, - "Standard_E32as_v4": 3.078000, - "Standard_E32as_v5": 2.766000, - "Standard_E32bds_v5": 4.108000, - "Standard_E32bs_v5": 3.671000, - "Standard_E32d_v4": 3.502000, - "Standard_E32d_v5": 3.515000, - "Standard_E32ds_v4": 3.502000, - "Standard_E32ds_v5": 3.515000, - "Standard_E32s_v3": 3.244800, - "Standard_E32s_v4": 3.064000, - "Standard_E32s_v5": 3.078000, - "Standard_E4-2ads_v5": 0.398000, - "Standard_E4-2as_v4": 0.385000, - "Standard_E4-2as_v5": 0.346000, - "Standard_E4-2ds_v4": 0.438000, - "Standard_E4-2ds_v5": 0.439000, - "Standard_E4-2s_v3": 0.405600, - "Standard_E4-2s_v4": 0.383000, - "Standard_E4-2s_v5": 0.385000, - "Standard_E48_v3": 4.863000, - "Standard_E48_v4": 4.596000, - "Standard_E48_v5": 4.618000, - "Standard_E48a_v4": 4.618000, - "Standard_E48ads_v5": 4.774000, - "Standard_E48as_v4": 4.618000, - "Standard_E48as_v5": 4.150000, - "Standard_E48bds_v5": 6.162000, - "Standard_E48bs_v5": 5.507000, - "Standard_E48d_v4": 5.253000, - "Standard_E48d_v5": 5.273000, - "Standard_E48ds_v4": 5.253000, - "Standard_E48ds_v5": 5.273000, - "Standard_E48s_v3": 4.863000, - "Standard_E48s_v4": 4.596000, - "Standard_E48s_v5": 4.618000, - "Standard_E4_v3": 0.405600, - "Standard_E4_v4": 0.383000, - "Standard_E4_v5": 0.385000, - "Standard_E4a_v4": 0.385000, - "Standard_E4ads_v5": 0.398000, - "Standard_E4as_v4": 0.385000, - "Standard_E4as_v5": 0.346000, - "Standard_E4bds_v5": 0.514000, - "Standard_E4bs_v5": 0.459000, - "Standard_E4d_v4": 0.438000, - "Standard_E4d_v5": 0.439000, - "Standard_E4ds_v4": 0.438000, - "Standard_E4ds_v5": 0.439000, - "Standard_E4s_v3": 0.405600, - "Standard_E4s_v4": 0.383000, - "Standard_E4s_v5": 0.385000, - "Standard_E64-16ads_v5": 6.365000, - "Standard_E64-16as_v4": 6.157000, - "Standard_E64-16as_v5": 5.533000, - "Standard_E64-16ds_v4": 7.004000, - "Standard_E64-16ds_v5": 7.030000, - "Standard_E64-16s_v3": 5.835000, - "Standard_E64-16s_v4": 6.129000, - "Standard_E64-16s_v5": 6.157000, - "Standard_E64-32ads_v5": 6.365000, - "Standard_E64-32as_v4": 6.157000, - "Standard_E64-32as_v5": 5.533000, - "Standard_E64-32ds_v4": 7.004000, - "Standard_E64-32ds_v5": 7.030000, - "Standard_E64-32s_v3": 5.835000, - "Standard_E64-32s_v4": 6.129000, - "Standard_E64-32s_v5": 6.157000, - "Standard_E64_v3": 5.835000, - "Standard_E64_v4": 6.129000, - "Standard_E64_v5": 6.157000, - "Standard_E64a_v4": 6.157000, - "Standard_E64ads_v5": 6.365000, - "Standard_E64as_v4": 6.157000, - "Standard_E64as_v5": 5.533000, - "Standard_E64bds_v5": 8.216000, - "Standard_E64bs_v5": 7.342000, - "Standard_E64d_v4": 7.004000, - "Standard_E64d_v5": 7.030000, - "Standard_E64ds_v4": 7.004000, - "Standard_E64ds_v5": 7.030000, - "Standard_E64i_v3": 5.835000, - "Standard_E64is_v3": 5.835000, - "Standard_E64s_v3": 5.835000, - "Standard_E64s_v4": 6.129000, - "Standard_E64s_v5": 6.157000, - "Standard_E8-2ads_v5": 0.796000, - "Standard_E8-2as_v4": 0.770000, - "Standard_E8-2as_v5": 0.692000, - "Standard_E8-2ds_v4": 0.876000, - "Standard_E8-2ds_v5": 0.879000, - "Standard_E8-2s_v3": 0.810000, - "Standard_E8-2s_v4": 0.766000, - "Standard_E8-2s_v5": 0.770000, - "Standard_E8-4ads_v5": 0.796000, - "Standard_E8-4as_v4": 0.770000, - "Standard_E8-4as_v5": 0.692000, - "Standard_E8-4ds_v4": 0.876000, - "Standard_E8-4ds_v5": 0.879000, - "Standard_E8-4s_v3": 0.810000, - "Standard_E8-4s_v4": 0.766000, - "Standard_E8-4s_v5": 0.770000, - "Standard_E80ids_v4": 8.755000, - "Standard_E80is_v4": 7.661000, - "Standard_E8_v3": 0.810000, - "Standard_E8_v4": 0.766000, - "Standard_E8_v5": 0.770000, - "Standard_E8a_v4": 0.770000, - "Standard_E8ads_v5": 0.796000, - "Standard_E8as_v4": 0.770000, - "Standard_E8as_v5": 0.692000, - "Standard_E8bds_v5": 1.027000, - "Standard_E8bs_v5": 0.918000, - "Standard_E8d_v4": 0.876000, - "Standard_E8d_v5": 0.879000, - "Standard_E8ds_v4": 0.876000, - "Standard_E8ds_v5": 0.879000, - "Standard_E8s_v3": 0.810000, - "Standard_E8s_v4": 0.766000, - "Standard_E8s_v5": 0.770000, - "Standard_E96-24ads_v5": 9.547000, - "Standard_E96-24as_v4": 9.235000, - "Standard_E96-24as_v5": 8.299000, - "Standard_E96-24ds_v5": 10.546000, - "Standard_E96-24s_v5": 9.235000, - "Standard_E96-48ads_v5": 9.547000, - "Standard_E96-48as_v4": 9.235000, - "Standard_E96-48as_v5": 8.299000, - "Standard_E96-48ds_v5": 10.546000, - "Standard_E96-48s_v5": 9.235000, - "Standard_E96_v5": 9.235000, - "Standard_E96a_v4": 9.235000, - "Standard_E96ads_v5": 9.547000, - "Standard_E96as_v4": 9.235000, - "Standard_E96as_v5": 8.299000, - "Standard_E96bds_v5": 12.324000, - "Standard_E96bs_v5": 11.014000, - "Standard_E96d_v5": 10.546000, - "Standard_E96ds_v5": 10.546000, - "Standard_E96iads_v5": 10.502000, - "Standard_E96ias_v4": 9.235000, - "Standard_E96ias_v5": 9.129000, - "Standard_E96s_v5": 9.235000, - "Standard_F1": 0.065600, - "Standard_F16": 1.050000, - "Standard_F16s": 1.050000, - "Standard_F16s_v2": 1.047000, - "Standard_F1s": 0.065600, - "Standard_F2": 0.131000, - "Standard_F2s": 0.131000, - "Standard_F2s_v2": 0.131000, - "Standard_F32s_v2": 2.094000, - "Standard_F4": 0.262000, - "Standard_F48s_v2": 3.142000, - "Standard_F4s": 0.262000, - "Standard_F4s_v2": 0.262000, - "Standard_F64s_v2": 4.189000, - "Standard_F72s_v2": 4.712000, - "Standard_F8": 0.525000, - "Standard_F8s": 0.525000, - "Standard_F8s_v2": 0.524000, - "Standard_L16as_v3": 1.882000, - "Standard_L16s_v3": 2.101000, - "Standard_L32as_v3": 3.765000, - "Standard_L32s_v3": 4.202000, - "Standard_L48as_v3": 5.647000, - "Standard_L48s_v3": 6.302000, - "Standard_L64as_v3": 7.530000, - "Standard_L64s_v3": 8.403000, - "Standard_L80as_v3": 9.412000, - "Standard_L80s_v3": 10.504000, - "Standard_L8as_v3": 0.941000, - "Standard_L8s_v3": 1.050000, - } - // germanynorth - initialOnDemandPrices["germanynorth"] = map[string]float64{ - "Dasv4_Type1": 8.222000, - "Dasv4_Type2": 8.222000, - "Dasv5_Type1": 8.328000, - "Ddsv5_Type1": 9.335000, - "Dsv3_Type3": 6.549000, - "Dsv5_Type1": 8.223000, - "Eadsv5_Type1": 10.845000, - "Easv4_Type1": 10.433000, - "Ebdsv5-Type1": 9.106000, - "Ebsv5-Type1": 8.145000, - "Edsv5_Type1": 11.875000, - "Esv3_Type3": 6.660000, - "Esv5_Type1": 10.433000, - "Fsv2_Type2": 4.993000, - "Lasv3_Type1": 10.639000, - "Lsv3_Type1": 11.898000, - "Standard_A2m_v2": 0.161000, - "Standard_A4_v2": 0.213000, - "Standard_A8_v2": 0.426000, - "Standard_B12ms": 0.749000, - "Standard_B16als_v2": 0.869000, - "Standard_B16as_v2": 0.972000, - "Standard_B16ls_v2": 0.958000, - "Standard_B16ms": 0.998000, - "Standard_B16s_v2": 1.072000, - "Standard_B1ls": 0.007800, - "Standard_B20ms": 1.248000, - "Standard_B2als_v2": 0.056200, - "Standard_B2as_v2": 0.122000, - "Standard_B2ats_v2": 0.023200, - "Standard_B2ls_v2": 0.071600, - "Standard_B2ms": 0.125000, - "Standard_B2s": 0.062400, - "Standard_B2s_v2": 0.134000, - "Standard_B2ts_v2": 0.024800, - "Standard_B32as_v2": 1.797000, - "Standard_B32ls_v2": 1.915000, - "Standard_B32s_v2": 1.997000, - "Standard_B4als_v2": 0.199000, - "Standard_B4as_v2": 0.243000, - "Standard_B4ls_v2": 0.221000, - "Standard_B4ms": 0.250000, - "Standard_B4s_v2": 0.250000, - "Standard_B8als_v2": 0.435000, - "Standard_B8as_v2": 0.449000, - "Standard_B8ls_v2": 0.479000, - "Standard_B8ms": 0.499000, - "Standard_B8s_v2": 0.536000, - "Standard_D12_v2": 0.432000, - "Standard_D14_v2": 1.726000, - "Standard_D15_v2": 2.158000, - "Standard_D15i_v2": 2.158000, - "Standard_D16_v3": 1.196000, - "Standard_D16_v5": 1.196000, - "Standard_D16a_v4": 1.196000, - "Standard_D16ads_v5": 1.300000, - "Standard_D16as_v4": 1.196000, - "Standard_D16d_v5": 1.414000, - "Standard_D16ds_v4": 1.408000, - "Standard_D16ds_v5": 1.414000, - "Standard_D16lds_v5": 1.154000, - "Standard_D16ls_v5": 1.009000, - "Standard_D16s_v4": 1.196000, - "Standard_D1_v2": 0.087100, - "Standard_D2_v3": 0.150000, - "Standard_D2_v4": 0.150000, - "Standard_D2_v5": 0.150000, - "Standard_D2ads_v5": 0.163000, - "Standard_D2as_v5": 0.135000, - "Standard_D2d_v4": 0.176000, - "Standard_D2d_v5": 0.177000, - "Standard_D2ds_v4": 0.176000, - "Standard_D2lds_v5": 0.144000, - "Standard_D2ls_v5": 0.126000, - "Standard_D2s_v3": 0.150000, - "Standard_D2s_v4": 0.150000, - "Standard_D2s_v5": 0.150000, - "Standard_D32-16s_v3": 2.392000, - "Standard_D32-8s_v3": 2.392000, - "Standard_D32_v3": 2.392000, - "Standard_D32_v4": 2.392000, - "Standard_D32ads_v5": 2.600000, - "Standard_D32d_v4": 2.816000, - "Standard_D32ds_v5": 2.829000, - "Standard_D32lds_v5": 2.309000, - "Standard_D32ls_v5": 2.018000, - "Standard_D32s_v3": 2.392000, - "Standard_D32s_v4": 2.392000, - "Standard_D48_v4": 3.588000, - "Standard_D48_v5": 3.588000, - "Standard_D48ads_v5": 3.900000, - "Standard_D48as_v4": 3.588000, - "Standard_D48d_v4": 4.223000, - "Standard_D48ds_v5": 4.243000, - "Standard_D48ls_v5": 3.026000, - "Standard_D48s_v5": 3.588000, - "Standard_D4_v4": 0.299000, - "Standard_D4_v5": 0.299000, - "Standard_D4a_v4": 0.299000, - "Standard_D4as_v4": 0.299000, - "Standard_D4as_v5": 0.270000, - "Standard_D4d_v4": 0.352000, - "Standard_D4d_v5": 0.354000, - "Standard_D4ds_v4": 0.352000, - "Standard_D4ds_v5": 0.354000, - "Standard_D4s_v3": 0.299000, - "Standard_D4s_v4": 0.299000, - "Standard_D4s_v5": 0.299000, - "Standard_D64-16s_v3": 4.784000, - "Standard_D64-32s_v3": 4.784000, - "Standard_D64_v3": 4.784000, - "Standard_D64_v5": 4.784000, - "Standard_D64ads_v5": 5.200000, - "Standard_D64as_v4": 4.784000, - "Standard_D64as_v5": 4.326000, - "Standard_D64d_v4": 5.631000, - "Standard_D64ds_v4": 5.631000, - "Standard_D64lds_v5": 4.618000, - "Standard_D64ls_v5": 4.035000, - "Standard_D64s_v4": 4.784000, - "Standard_D8_v3": 0.598000, - "Standard_D8_v4": 0.598000, - "Standard_D8_v5": 0.598000, - "Standard_D8a_v4": 0.598000, - "Standard_D8d_v4": 0.704000, - "Standard_D8d_v5": 0.707000, - "Standard_D8ds_v5": 0.707000, - "Standard_D8s_v3": 0.598000, - "Standard_D8s_v4": 0.598000, - "Standard_D8s_v5": 0.598000, - "Standard_D96_v5": 7.176000, - "Standard_D96a_v4": 7.176000, - "Standard_D96ads_v5": 7.800000, - "Standard_D96as_v5": 6.490000, - "Standard_D96d_v5": 8.486000, - "Standard_D96lds_v5": 6.926000, - "Standard_D96ls_v5": 6.053000, - "Standard_D96s_v5": 7.176000, - "Standard_DS11-1_v2": 0.216000, - "Standard_DS11_v2": 0.216000, - "Standard_DS12-1_v2": 0.432000, - "Standard_DS12-2_v2": 0.432000, - "Standard_DS12_v2": 0.432000, - "Standard_DS13-2_v2": 0.863000, - "Standard_DS13-4_v2": 0.863000, - "Standard_DS13_v2": 0.863000, - "Standard_DS14-8_v2": 1.726000, - "Standard_DS15_v2": 2.158000, - "Standard_DS15i_v2": 2.158000, - "Standard_DS2_v2": 0.174000, - "Standard_DS4_v2": 0.697000, - "Standard_DS5_v2": 1.394000, - "Standard_E104i_v5": 11.303000, - "Standard_E104ids_v5": 12.864000, - "Standard_E104is_v5": 11.303000, - "Standard_E112ias_v5": 10.971000, - "Standard_E112ibds_v5": 15.936000, - "Standard_E16-4as_v4": 1.581000, - "Standard_E16-4as_v5": 1.425000, - "Standard_E16-4ds_v4": 1.807000, - "Standard_E16-4ds_v5": 1.799000, - "Standard_E16-4s_v3": 1.581000, - "Standard_E16-4s_v5": 1.581000, - "Standard_E16-8as_v4": 1.581000, - "Standard_E16-8as_v5": 1.425000, - "Standard_E16-8ds_v4": 1.807000, - "Standard_E16-8ds_v5": 1.799000, - "Standard_E16-8s_v3": 1.581000, - "Standard_E16-8s_v4": 1.581000, - "Standard_E16_v3": 1.581000, - "Standard_E16_v4": 1.581000, - "Standard_E16a_v4": 1.581000, - "Standard_E16ads_v5": 1.643000, - "Standard_E16as_v4": 1.581000, - "Standard_E16d_v4": 1.807000, - "Standard_E16d_v5": 1.799000, - "Standard_E16ds_v4": 1.807000, - "Standard_E16ds_v5": 1.799000, - "Standard_E16s_v4": 1.581000, - "Standard_E20_v3": 1.976000, - "Standard_E20_v4": 1.976000, - "Standard_E20as_v4": 1.976000, - "Standard_E20as_v5": 1.781000, - "Standard_E20d_v4": 2.259000, - "Standard_E20d_v5": 2.249000, - "Standard_E20ds_v4": 2.259000, - "Standard_E20ds_v5": 2.249000, - "Standard_E20s_v3": 1.976000, - "Standard_E20s_v4": 1.976000, - "Standard_E2_v3": 0.198000, - "Standard_E2_v5": 0.198000, - "Standard_E2a_v4": 0.198000, - "Standard_E2ads_v5": 0.205000, - "Standard_E2as_v4": 0.198000, - "Standard_E2as_v5": 0.178000, - "Standard_E2bds_v5": 0.259000, - "Standard_E2bs_v5": 0.231000, - "Standard_E2d_v4": 0.226000, - "Standard_E2d_v5": 0.225000, - "Standard_E2ds_v4": 0.226000, - "Standard_E2ds_v5": 0.225000, - "Standard_E2s_v3": 0.198000, - "Standard_E2s_v5": 0.198000, - "Standard_E32-16ads_v5": 3.286000, - "Standard_E32-16as_v4": 3.162000, - "Standard_E32-16as_v5": 2.850000, - "Standard_E32-16ds_v4": 3.614000, - "Standard_E32-16ds_v5": 3.598000, - "Standard_E32-16s_v3": 3.162000, - "Standard_E32-16s_v5": 3.162000, - "Standard_E32-8ads_v5": 3.286000, - "Standard_E32-8as_v4": 3.162000, - "Standard_E32-8as_v5": 2.850000, - "Standard_E32-8ds_v4": 3.614000, - "Standard_E32-8ds_v5": 3.598000, - "Standard_E32-8s_v3": 3.162000, - "Standard_E32-8s_v4": 3.162000, - "Standard_E32_v3": 3.162000, - "Standard_E32_v4": 3.162000, - "Standard_E32_v5": 3.162000, - "Standard_E32a_v4": 3.162000, - "Standard_E32ads_v5": 3.286000, - "Standard_E32as_v4": 3.162000, - "Standard_E32as_v5": 2.850000, - "Standard_E32ds_v5": 3.598000, - "Standard_E32s_v4": 3.162000, - "Standard_E4-2ads_v5": 0.411000, - "Standard_E4-2ds_v4": 0.452000, - "Standard_E4-2ds_v5": 0.450000, - "Standard_E4-2s_v4": 0.395000, - "Standard_E4-2s_v5": 0.395000, - "Standard_E48_v3": 4.743000, - "Standard_E48_v5": 4.742000, - "Standard_E48as_v4": 4.742000, - "Standard_E48bds_v5": 6.209000, - "Standard_E48bs_v5": 5.554000, - "Standard_E48d_v5": 5.398000, - "Standard_E48ds_v4": 5.421000, - "Standard_E48s_v3": 4.743000, - "Standard_E48s_v4": 4.743000, - "Standard_E48s_v5": 4.742000, - "Standard_E4_v3": 0.395000, - "Standard_E4a_v4": 0.395000, - "Standard_E4ads_v5": 0.411000, - "Standard_E4as_v4": 0.395000, - "Standard_E4bds_v5": 0.517000, - "Standard_E4bs_v5": 0.463000, - "Standard_E4d_v5": 0.450000, - "Standard_E4ds_v4": 0.452000, - "Standard_E4ds_v5": 0.450000, - "Standard_E4s_v3": 0.395000, - "Standard_E4s_v5": 0.395000, - "Standard_E64-16as_v5": 5.699000, - "Standard_E64-16ds_v4": 7.228000, - "Standard_E64-16s_v3": 5.691000, - "Standard_E64-16s_v4": 6.324000, - "Standard_E64-16s_v5": 6.323000, - "Standard_E64-32ads_v5": 6.573000, - "Standard_E64-32as_v4": 6.323000, - "Standard_E64-32as_v5": 5.699000, - "Standard_E64-32ds_v4": 7.228000, - "Standard_E64-32ds_v5": 7.197000, - "Standard_E64-32s_v3": 5.691000, - "Standard_E64-32s_v4": 6.324000, - "Standard_E64_v3": 5.691000, - "Standard_E64_v4": 6.324000, - "Standard_E64_v5": 6.323000, - "Standard_E64a_v4": 6.323000, - "Standard_E64as_v4": 6.323000, - "Standard_E64as_v5": 5.699000, - "Standard_E64d_v5": 7.197000, - "Standard_E64ds_v4": 7.228000, - "Standard_E64is_v3": 5.691000, - "Standard_E64s_v3": 5.691000, - "Standard_E64s_v4": 6.324000, - "Standard_E8-2ads_v5": 0.822000, - "Standard_E8-2as_v4": 0.790000, - "Standard_E8-2ds_v4": 0.903000, - "Standard_E8-2ds_v5": 0.900000, - "Standard_E8-2s_v4": 0.791000, - "Standard_E8-4ads_v5": 0.822000, - "Standard_E8-4as_v4": 0.790000, - "Standard_E8-4as_v5": 0.712000, - "Standard_E8-4ds_v4": 0.903000, - "Standard_E8-4ds_v5": 0.900000, - "Standard_E8-4s_v4": 0.791000, - "Standard_E80ids_v4": 9.035000, - "Standard_E8_v3": 0.790000, - "Standard_E8_v4": 0.791000, - "Standard_E8ads_v5": 0.822000, - "Standard_E8as_v4": 0.790000, - "Standard_E8as_v5": 0.712000, - "Standard_E8bs_v5": 0.926000, - "Standard_E8d_v4": 0.903000, - "Standard_E8d_v5": 0.900000, - "Standard_E8ds_v4": 0.903000, - "Standard_E8s_v4": 0.791000, - "Standard_E8s_v5": 0.790000, - "Standard_E96-24as_v5": 8.549000, - "Standard_E96-24ds_v5": 10.795000, - "Standard_E96-24s_v5": 9.485000, - "Standard_E96-48as_v4": 9.485000, - "Standard_E96-48ds_v5": 10.795000, - "Standard_E96-48s_v5": 9.485000, - "Standard_E96as_v4": 9.485000, - "Standard_E96bs_v5": 11.107000, - "Standard_E96d_v5": 10.795000, - "Standard_E96ds_v5": 10.795000, - "Standard_E96iads_v5": 10.845000, - "Standard_E96ias_v5": 9.404000, - "Standard_E96s_v5": 9.485000, - "Standard_F16s": 1.186000, - "Standard_F16s_v2": 1.009000, - "Standard_F1s": 0.074100, - "Standard_F2": 0.148000, - "Standard_F32s_v2": 2.018000, - "Standard_F48s_v2": 3.027000, - "Standard_F4s": 0.296000, - "Standard_F4s_v2": 0.252000, - "Standard_F64s_v2": 4.035000, - "Standard_F8s": 0.593000, - "Standard_L16s_v3": 2.163000, - "Standard_L48as_v3": 5.803000, - "Standard_L48s_v3": 6.490000, - "Standard_L64as_v3": 7.738000, - "Standard_L80s_v3": 10.816000, - "Standard_L8as_v3": 0.967000, - "Standard_M128": 24.276000, - "Standard_M128-32ms": 48.547000, - "Standard_M128-64ms": 48.547000, - "Standard_M128s": 24.276000, - "Standard_M16-8ms": 5.593000, - "Standard_M16ms": 5.593000, - "Standard_M32-8ms": 11.186000, - "Standard_M32ls": 4.482000, - "Standard_M32s": 6.070000, - "Standard_M32ts": 4.222000, - "Standard_M64": 12.138000, - "Standard_M64-32ms": 18.813000, - "Standard_M64m": 18.813000, - "Standard_M64ms": 18.813000, - "Standard_M64s": 12.138000, - "Standard_M8-2ms": 2.796000, - "Standard_M8ms": 2.796000, - "Standard_ND96ams_A100_v4": 55.381000, - "Standard_ND96amsr_A100_v4": 55.381000, - } - // germanywestcentral - initialOnDemandPrices["germanywestcentral"] = map[string]float64{ - "Dadsv5_Type1": 7.700000, - "Dasv4_Type1": 6.325000, - "Dasv4_Type2": 6.325000, - "Dasv5_Type1": 6.406000, - "Ddsv4_Type 1": 4.787000, - "Ddsv4_Type2": 5.685000, - "Ddsv5_Type1": 7.181000, - "Dsv3_Type3": 5.086000, - "Dsv3_Type4": 6.357000, - "Dsv4_Type1": 5.060000, - "Dsv4_Type2": 6.072000, - "Dsv5_Type1": 6.325000, - "Eadsv5_Type1": 8.342000, - "Easv4_Type1": 8.026000, - "Easv4_Type2": 8.026000, - "Easv5_Type1": 7.234000, - "Ebdsv5-Type1": 7.005000, - "Ebsv5-Type1": 6.266000, - "Edsv4_Type 1": 6.090000, - "Edsv4_Type2": 7.231000, - "Edsv5_Type1": 9.134000, - "Esv3_Type3": 5.162000, - "Esv3_Type4": 6.994000, - "Esv4_Type1": 5.350000, - "Esv4_Type2": 7.022000, - "Esv5_Type1": 8.026000, - "Fsv2 Type3": 4.481000, - "Fsv2_Type2": 3.841000, - "Fsv2_Type4": 5.122000, - "Lsv2_Type1": 8.184000, - "Lsv3_Type1": 9.152000, - "Mdsmv2MedMem _Type1": 41.103000, - "Mdsv2MedMem_Type1": 20.544000, - "Ms_Type1": 20.536000, - "Msm_Type1": 41.108000, - "Msmv2MedMem Type1": 40.455000, - "Msmv2_Type1": 130.880000, - "Msv2MedMem Type1": 19.896000, - "Msv2_Type1": 65.446000, - "Standard_A1_v2": 0.041000, - "Standard_A2_v2": 0.087000, - "Standard_A2m_v2": 0.124000, - "Standard_A4_v2": 0.183000, - "Standard_A4m_v2": 0.260000, - "Standard_A8_v2": 0.383000, - "Standard_A8m_v2": 0.546000, - "Standard_B12ms": 0.576000, - "Standard_B16als_v2": 0.612000, - "Standard_B16as_v2": 0.691000, - "Standard_B16ls_v2": 0.754000, - "Standard_B16ms": 0.768000, - "Standard_B16pls_v2": 0.544000, - "Standard_B16ps_v2": 0.614000, - "Standard_B16s_v2": 0.842000, - "Standard_B1ls": 0.006000, - "Standard_B1ms": 0.024000, - "Standard_B1s": 0.012000, - "Standard_B20ms": 0.960000, - "Standard_B2als_v2": 0.043200, - "Standard_B2as_v2": 0.095600, - "Standard_B2ats_v2": 0.020000, - "Standard_B2ls_v2": 0.048000, - "Standard_B2ms": 0.096000, - "Standard_B2pls_v2": 0.047600, - "Standard_B2ps_v2": 0.086000, - "Standard_B2pts_v2": 0.018800, - "Standard_B2s": 0.048000, - "Standard_B2s_v2": 0.096000, - "Standard_B2ts_v2": 0.021200, - "Standard_B32als_v2": 1.371000, - "Standard_B32as_v2": 1.382000, - "Standard_B32ls_v2": 1.507000, - "Standard_B32s_v2": 1.536000, - "Standard_B4als_v2": 0.171000, - "Standard_B4as_v2": 0.191000, - "Standard_B4ls_v2": 0.188000, - "Standard_B4ms": 0.192000, - "Standard_B4pls_v2": 0.136000, - "Standard_B4ps_v2": 0.154000, - "Standard_B4s_v2": 0.192000, - "Standard_B8als_v2": 0.343000, - "Standard_B8as_v2": 0.346000, - "Standard_B8ls_v2": 0.377000, - "Standard_B8ms": 0.384000, - "Standard_B8pls_v2": 0.309000, - "Standard_B8ps_v2": 0.307000, - "Standard_B8s_v2": 0.384000, - "Standard_D11_v2": 0.166000, - "Standard_D12_v2": 0.332000, - "Standard_D13_v2": 0.664000, - "Standard_D14_v2": 1.328000, - "Standard_D15_v2": 1.660000, - "Standard_D15i_v2": 1.660000, - "Standard_D16_v3": 0.920000, - "Standard_D16_v4": 0.920000, - "Standard_D16_v5": 0.920000, - "Standard_D16ads_v5": 1.000000, - "Standard_D16as_v5": 0.832000, - "Standard_D16d_v4": 1.088000, - "Standard_D16d_v5": 1.088000, - "Standard_D16ds_v4": 1.088000, - "Standard_D16ds_v5": 1.088000, - "Standard_D16lds_v5": 0.888000, - "Standard_D16ls_v5": 0.776000, - "Standard_D16pds_v5": 0.872000, - "Standard_D16plds_v5": 0.712000, - "Standard_D16pls_v5": 0.621000, - "Standard_D16ps_v5": 0.736000, - "Standard_D16s_v3": 0.920000, - "Standard_D16s_v4": 0.920000, - "Standard_D16s_v5": 0.920000, - "Standard_D1_v2": 0.067000, - "Standard_D2_v2": 0.133000, - "Standard_D2_v3": 0.115000, - "Standard_D2_v4": 0.115000, - "Standard_D2_v5": 0.115000, - "Standard_D2ads_v5": 0.125000, - "Standard_D2as_v5": 0.104000, - "Standard_D2d_v4": 0.136000, - "Standard_D2d_v5": 0.136000, - "Standard_D2ds_v4": 0.136000, - "Standard_D2ds_v5": 0.136000, - "Standard_D2lds_v5": 0.111000, - "Standard_D2ls_v5": 0.097000, - "Standard_D2pds_v5": 0.109000, - "Standard_D2plds_v5": 0.089000, - "Standard_D2pls_v5": 0.077600, - "Standard_D2ps_v5": 0.092000, - "Standard_D2s_v3": 0.115000, - "Standard_D2s_v4": 0.115000, - "Standard_D2s_v5": 0.115000, - "Standard_D32-16s_v3": 1.840000, - "Standard_D32-8s_v3": 1.840000, - "Standard_D32_v3": 1.840000, - "Standard_D32_v4": 1.840000, - "Standard_D32_v5": 1.840000, - "Standard_D32ads_v5": 2.000000, - "Standard_D32as_v5": 1.664000, - "Standard_D32d_v4": 2.176000, - "Standard_D32d_v5": 2.176000, - "Standard_D32ds_v4": 2.176000, - "Standard_D32ds_v5": 2.176000, - "Standard_D32lds_v5": 1.776000, - "Standard_D32ls_v5": 1.552000, - "Standard_D32pds_v5": 1.744000, - "Standard_D32plds_v5": 1.424000, - "Standard_D32pls_v5": 1.242000, - "Standard_D32ps_v5": 1.472000, - "Standard_D32s_v3": 1.840000, - "Standard_D32s_v4": 1.840000, - "Standard_D32s_v5": 1.840000, - "Standard_D3_v2": 0.266000, - "Standard_D48_v3": 2.760000, - "Standard_D48_v4": 2.760000, - "Standard_D48_v5": 2.760000, - "Standard_D48ads_v5": 3.000000, - "Standard_D48as_v5": 2.496000, - "Standard_D48d_v4": 3.264000, - "Standard_D48d_v5": 3.264000, - "Standard_D48ds_v4": 3.264000, - "Standard_D48ds_v5": 3.264000, - "Standard_D48lds_v5": 2.664000, - "Standard_D48ls_v5": 2.328000, - "Standard_D48pds_v5": 2.616000, - "Standard_D48plds_v5": 2.136000, - "Standard_D48pls_v5": 1.862000, - "Standard_D48ps_v5": 2.208000, - "Standard_D48s_v3": 2.760000, - "Standard_D48s_v4": 2.760000, - "Standard_D48s_v5": 2.760000, - "Standard_D4_v2": 0.532000, - "Standard_D4_v3": 0.230000, - "Standard_D4_v4": 0.230000, - "Standard_D4_v5": 0.230000, - "Standard_D4ads_v5": 0.250000, - "Standard_D4as_v5": 0.208000, - "Standard_D4d_v4": 0.272000, - "Standard_D4d_v5": 0.272000, - "Standard_D4ds_v4": 0.272000, - "Standard_D4ds_v5": 0.272000, - "Standard_D4lds_v5": 0.222000, - "Standard_D4ls_v5": 0.194000, - "Standard_D4pds_v5": 0.218000, - "Standard_D4plds_v5": 0.178000, - "Standard_D4pls_v5": 0.155000, - "Standard_D4ps_v5": 0.184000, - "Standard_D4s_v3": 0.230000, - "Standard_D4s_v4": 0.230000, - "Standard_D4s_v5": 0.230000, - "Standard_D5_v2": 1.064000, - "Standard_D64-16s_v3": 3.680000, - "Standard_D64-32s_v3": 3.680000, - "Standard_D64_v3": 3.680000, - "Standard_D64_v4": 3.680000, - "Standard_D64_v5": 3.680000, - "Standard_D64ads_v5": 4.000000, - "Standard_D64as_v5": 3.328000, - "Standard_D64d_v4": 4.352000, - "Standard_D64d_v5": 4.352000, - "Standard_D64ds_v4": 4.352000, - "Standard_D64ds_v5": 4.352000, - "Standard_D64lds_v5": 3.552000, - "Standard_D64ls_v5": 3.104000, - "Standard_D64pds_v5": 3.488000, - "Standard_D64plds_v5": 2.848000, - "Standard_D64pls_v5": 2.483000, - "Standard_D64ps_v5": 2.944000, - "Standard_D64s_v3": 3.680000, - "Standard_D64s_v4": 3.680000, - "Standard_D64s_v5": 3.680000, - "Standard_D8_v3": 0.460000, - "Standard_D8_v4": 0.460000, - "Standard_D8_v5": 0.460000, - "Standard_D8ads_v5": 0.500000, - "Standard_D8as_v5": 0.416000, - "Standard_D8d_v4": 0.544000, - "Standard_D8d_v5": 0.544000, - "Standard_D8ds_v4": 0.544000, - "Standard_D8ds_v5": 0.544000, - "Standard_D8lds_v5": 0.444000, - "Standard_D8ls_v5": 0.388000, - "Standard_D8pds_v5": 0.436000, - "Standard_D8plds_v5": 0.356000, - "Standard_D8pls_v5": 0.310000, - "Standard_D8ps_v5": 0.368000, - "Standard_D8s_v3": 0.460000, - "Standard_D8s_v4": 0.460000, - "Standard_D8s_v5": 0.460000, - "Standard_D96_v5": 5.520000, - "Standard_D96ads_v5": 6.000000, - "Standard_D96as_v5": 4.992000, - "Standard_D96d_v5": 6.528000, - "Standard_D96ds_v5": 6.528000, - "Standard_D96lds_v5": 5.328000, - "Standard_D96ls_v5": 4.656000, - "Standard_D96s_v5": 5.520000, - "Standard_DC16ads_v5": 1.000000, - "Standard_DC16as_v5": 0.832000, - "Standard_DC2ads_v5": 0.125000, - "Standard_DC2as_v5": 0.104000, - "Standard_DC32ads_v5": 2.000000, - "Standard_DC32as_v5": 1.664000, - "Standard_DC48ads_v5": 3.000000, - "Standard_DC48as_v5": 2.496000, - "Standard_DC4ads_v5": 0.250000, - "Standard_DC4as_v5": 0.208000, - "Standard_DC64ads_v5": 4.000000, - "Standard_DC64as_v5": 3.328000, - "Standard_DC8ads_v5": 0.500000, - "Standard_DC8as_v5": 0.416000, - "Standard_DC96ads_v5": 6.000000, - "Standard_DC96as_v5": 4.992000, - "Standard_DS11-1_v2": 0.166000, - "Standard_DS11_v2": 0.166000, - "Standard_DS12-1_v2": 0.332000, - "Standard_DS12-2_v2": 0.332000, - "Standard_DS12_v2": 0.332000, - "Standard_DS13-2_v2": 0.664000, - "Standard_DS13-4_v2": 0.664000, - "Standard_DS13_v2": 0.664000, - "Standard_DS14-4_v2": 1.328000, - "Standard_DS14-8_v2": 1.328000, - "Standard_DS14_v2": 1.328000, - "Standard_DS15_v2": 1.660000, - "Standard_DS15i_v2": 1.660000, - "Standard_DS1_v2": 0.067000, - "Standard_DS2_v2": 0.133000, - "Standard_DS3_v2": 0.266000, - "Standard_DS4_v2": 0.532000, - "Standard_DS5_v2": 1.064000, - "Standard_E104i_v5": 8.694000, - "Standard_E104id_v5": 9.896000, - "Standard_E104ids_v5": 9.896000, - "Standard_E104is_v5": 8.694000, - "Standard_E112iads_v5": 9.733000, - "Standard_E112ias_v5": 8.439000, - "Standard_E112ibds_v5": 12.258000, - "Standard_E112ibs_v5": 10.965000, - "Standard_E16-4ads_v5": 1.264000, - "Standard_E16-4as_v5": 1.096000, - "Standard_E16-4ds_v4": 1.384000, - "Standard_E16-4ds_v5": 1.384000, - "Standard_E16-4s_v3": 1.216000, - "Standard_E16-4s_v4": 1.216000, - "Standard_E16-4s_v5": 1.216000, - "Standard_E16-8ads_v5": 1.264000, - "Standard_E16-8as_v5": 1.096000, - "Standard_E16-8ds_v4": 1.384000, - "Standard_E16-8ds_v5": 1.384000, - "Standard_E16-8s_v3": 1.216000, - "Standard_E16-8s_v4": 1.216000, - "Standard_E16-8s_v5": 1.216000, - "Standard_E16_v3": 1.216000, - "Standard_E16_v4": 1.216000, - "Standard_E16_v5": 1.216000, - "Standard_E16ads_v5": 1.264000, - "Standard_E16as_v5": 1.096000, - "Standard_E16bds_v5": 1.592000, - "Standard_E16bs_v5": 1.424000, - "Standard_E16d_v4": 1.384000, - "Standard_E16d_v5": 1.384000, - "Standard_E16ds_v4": 1.384000, - "Standard_E16ds_v5": 1.384000, - "Standard_E16pds_v5": 1.104000, - "Standard_E16ps_v5": 0.973000, - "Standard_E16s_v3": 1.216000, - "Standard_E16s_v4": 1.216000, - "Standard_E16s_v5": 1.216000, - "Standard_E20_v3": 1.520000, - "Standard_E20_v4": 1.520000, - "Standard_E20_v5": 1.520000, - "Standard_E20ads_v5": 1.580000, - "Standard_E20as_v5": 1.370000, - "Standard_E20d_v4": 1.730000, - "Standard_E20d_v5": 1.730000, - "Standard_E20ds_v4": 1.730000, - "Standard_E20ds_v5": 1.730000, - "Standard_E20pds_v5": 1.380000, - "Standard_E20ps_v5": 1.216000, - "Standard_E20s_v3": 1.520000, - "Standard_E20s_v4": 1.520000, - "Standard_E20s_v5": 1.520000, - "Standard_E2_v3": 0.152000, - "Standard_E2_v4": 0.152000, - "Standard_E2_v5": 0.152000, - "Standard_E2ads_v5": 0.158000, - "Standard_E2as_v5": 0.137000, - "Standard_E2bds_v5": 0.199000, - "Standard_E2bs_v5": 0.178000, - "Standard_E2d_v4": 0.173000, - "Standard_E2d_v5": 0.173000, - "Standard_E2ds_v4": 0.173000, - "Standard_E2ds_v5": 0.173000, - "Standard_E2pds_v5": 0.138000, - "Standard_E2ps_v5": 0.122000, - "Standard_E2s_v3": 0.152000, - "Standard_E2s_v4": 0.152000, - "Standard_E2s_v5": 0.152000, - "Standard_E32-16ads_v5": 2.528000, - "Standard_E32-16as_v5": 2.192000, - "Standard_E32-16ds_v4": 2.768000, - "Standard_E32-16ds_v5": 2.768000, - "Standard_E32-16s_v3": 2.432000, - "Standard_E32-16s_v4": 2.432000, - "Standard_E32-16s_v5": 2.432000, - "Standard_E32-8ads_v5": 2.528000, - "Standard_E32-8as_v5": 2.192000, - "Standard_E32-8ds_v4": 2.768000, - "Standard_E32-8ds_v5": 2.768000, - "Standard_E32-8s_v3": 2.432000, - "Standard_E32-8s_v4": 2.432000, - "Standard_E32-8s_v5": 2.432000, - "Standard_E32_v3": 2.432000, - "Standard_E32_v4": 2.432000, - "Standard_E32_v5": 2.432000, - "Standard_E32ads_v5": 2.528000, - "Standard_E32as_v5": 2.192000, - "Standard_E32bds_v5": 3.184000, - "Standard_E32bs_v5": 2.848000, - "Standard_E32d_v4": 2.768000, - "Standard_E32d_v5": 2.768000, - "Standard_E32ds_v4": 2.768000, - "Standard_E32ds_v5": 2.768000, - "Standard_E32pds_v5": 2.208000, - "Standard_E32ps_v5": 1.946000, - "Standard_E32s_v3": 2.432000, - "Standard_E32s_v4": 2.432000, - "Standard_E32s_v5": 2.432000, - "Standard_E4-2ads_v5": 0.316000, - "Standard_E4-2as_v5": 0.274000, - "Standard_E4-2ds_v4": 0.346000, - "Standard_E4-2ds_v5": 0.346000, - "Standard_E4-2s_v3": 0.304000, - "Standard_E4-2s_v4": 0.304000, - "Standard_E4-2s_v5": 0.304000, - "Standard_E48_v3": 3.648000, - "Standard_E48_v4": 3.648000, - "Standard_E48_v5": 3.648000, - "Standard_E48ads_v5": 3.792000, - "Standard_E48as_v5": 3.288000, - "Standard_E48bds_v5": 4.776000, - "Standard_E48bs_v5": 4.272000, - "Standard_E48d_v4": 4.152000, - "Standard_E48d_v5": 4.152000, - "Standard_E48ds_v4": 4.152000, - "Standard_E48ds_v5": 4.152000, - "Standard_E48s_v3": 3.648000, - "Standard_E48s_v4": 3.648000, - "Standard_E48s_v5": 3.648000, - "Standard_E4_v3": 0.304000, - "Standard_E4_v4": 0.304000, - "Standard_E4_v5": 0.304000, - "Standard_E4ads_v5": 0.316000, - "Standard_E4as_v5": 0.274000, - "Standard_E4bds_v5": 0.398000, - "Standard_E4bs_v5": 0.356000, - "Standard_E4d_v4": 0.346000, - "Standard_E4d_v5": 0.346000, - "Standard_E4ds_v4": 0.346000, - "Standard_E4ds_v5": 0.346000, - "Standard_E4pds_v5": 0.276000, - "Standard_E4ps_v5": 0.243000, - "Standard_E4s_v3": 0.304000, - "Standard_E4s_v4": 0.304000, - "Standard_E4s_v5": 0.304000, - "Standard_E64-16ads_v5": 5.056000, - "Standard_E64-16as_v5": 4.384000, - "Standard_E64-16ds_v4": 5.536000, - "Standard_E64-16ds_v5": 5.536000, - "Standard_E64-16s_v3": 4.378000, - "Standard_E64-16s_v4": 4.864000, - "Standard_E64-16s_v5": 4.864000, - "Standard_E64-32ads_v5": 5.056000, - "Standard_E64-32as_v5": 4.384000, - "Standard_E64-32ds_v4": 5.536000, - "Standard_E64-32ds_v5": 5.536000, - "Standard_E64-32s_v3": 4.378000, - "Standard_E64-32s_v4": 4.864000, - "Standard_E64-32s_v5": 4.864000, - "Standard_E64_v3": 4.378000, - "Standard_E64_v4": 4.864000, - "Standard_E64_v5": 4.864000, - "Standard_E64ads_v5": 5.056000, - "Standard_E64as_v5": 4.384000, - "Standard_E64bds_v5": 6.368000, - "Standard_E64bs_v5": 5.696000, - "Standard_E64d_v4": 5.536000, - "Standard_E64d_v5": 5.536000, - "Standard_E64ds_v4": 5.536000, - "Standard_E64ds_v5": 5.536000, - "Standard_E64i_v3": 4.378000, - "Standard_E64is_v3": 4.378000, - "Standard_E64s_v3": 4.378000, - "Standard_E64s_v4": 4.864000, - "Standard_E64s_v5": 4.864000, - "Standard_E8-2ads_v5": 0.632000, - "Standard_E8-2as_v5": 0.548000, - "Standard_E8-2ds_v4": 0.692000, - "Standard_E8-2ds_v5": 0.692000, - "Standard_E8-2s_v3": 0.608000, - "Standard_E8-2s_v4": 0.608000, - "Standard_E8-2s_v5": 0.608000, - "Standard_E8-4ads_v5": 0.632000, - "Standard_E8-4as_v5": 0.548000, - "Standard_E8-4ds_v4": 0.692000, - "Standard_E8-4ds_v5": 0.692000, - "Standard_E8-4s_v3": 0.608000, - "Standard_E8-4s_v4": 0.608000, - "Standard_E8-4s_v5": 0.608000, - "Standard_E80ids_v4": 6.920000, - "Standard_E80is_v4": 6.080000, - "Standard_E8_v3": 0.608000, - "Standard_E8_v4": 0.608000, - "Standard_E8_v5": 0.608000, - "Standard_E8ads_v5": 0.632000, - "Standard_E8as_v5": 0.548000, - "Standard_E8bds_v5": 0.796000, - "Standard_E8bs_v5": 0.712000, - "Standard_E8d_v4": 0.692000, - "Standard_E8d_v5": 0.692000, - "Standard_E8ds_v4": 0.692000, - "Standard_E8ds_v5": 0.692000, - "Standard_E8pds_v5": 0.552000, - "Standard_E8ps_v5": 0.486000, - "Standard_E8s_v3": 0.608000, - "Standard_E8s_v4": 0.608000, - "Standard_E8s_v5": 0.608000, - "Standard_E96-24ads_v5": 7.584000, - "Standard_E96-24as_v5": 6.576000, - "Standard_E96-24ds_v5": 8.304000, - "Standard_E96-24s_v5": 7.296000, - "Standard_E96-48ads_v5": 7.584000, - "Standard_E96-48as_v5": 6.576000, - "Standard_E96-48ds_v5": 8.304000, - "Standard_E96-48s_v5": 7.296000, - "Standard_E96_v5": 7.296000, - "Standard_E96ads_v5": 7.584000, - "Standard_E96as_v5": 6.576000, - "Standard_E96bds_v5": 9.552000, - "Standard_E96bs_v5": 8.544000, - "Standard_E96d_v5": 8.304000, - "Standard_E96ds_v5": 8.304000, - "Standard_E96iads_v5": 8.342000, - "Standard_E96ias_v5": 7.234000, - "Standard_E96s_v5": 7.296000, - "Standard_EC16ads_v5": 1.264000, - "Standard_EC16as_v5": 1.096000, - "Standard_EC20ads_v5": 1.580000, - "Standard_EC20as_v5": 1.370000, - "Standard_EC2ads_v5": 0.158000, - "Standard_EC2as_v5": 0.137000, - "Standard_EC32ads_v5": 2.528000, - "Standard_EC32as_v5": 2.192000, - "Standard_EC48ads_v5": 3.792000, - "Standard_EC48as_v5": 3.288000, - "Standard_EC4ads_v5": 0.316000, - "Standard_EC4as_v5": 0.274000, - "Standard_EC64ads_v5": 5.056000, - "Standard_EC64as_v5": 4.384000, - "Standard_EC8ads_v5": 0.632000, - "Standard_EC8as_v5": 0.548000, - "Standard_EC96ads_v5": 7.584000, - "Standard_EC96as_v5": 6.576000, - "Standard_EC96iads_v5": 8.342000, - "Standard_EC96ias_v5": 7.234000, - "Standard_F1": 0.057000, - "Standard_F16": 0.909000, - "Standard_F16s": 0.909000, - "Standard_F16s_v2": 0.776000, - "Standard_F1s": 0.057000, - "Standard_F2": 0.114000, - "Standard_F2s": 0.114000, - "Standard_F2s_v2": 0.097000, - "Standard_F32s_v2": 1.552000, - "Standard_F4": 0.227000, - "Standard_F48s_v2": 2.328000, - "Standard_F4s": 0.227000, - "Standard_F4s_v2": 0.194000, - "Standard_F64s_v2": 3.104000, - "Standard_F72s_v2": 3.492000, - "Standard_F8": 0.454000, - "Standard_F8s": 0.454000, - "Standard_F8s_v2": 0.388000, - "Standard_L16s_v2": 1.488000, - "Standard_L16s_v3": 1.664000, - "Standard_L32s_v2": 2.976000, - "Standard_L32s_v3": 3.328000, - "Standard_L48s_v2": 4.464000, - "Standard_L48s_v3": 4.992000, - "Standard_L64s_v2": 5.952000, - "Standard_L64s_v3": 6.656000, - "Standard_L80s_v2": 7.440000, - "Standard_L80s_v3": 8.320000, - "Standard_L8s_v2": 0.744000, - "Standard_L8s_v3": 0.832000, - "Standard_M128": 18.674000, - "Standard_M128-32ms": 37.344000, - "Standard_M128-64ms": 37.344000, - "Standard_M128dms_v2": 37.366000, - "Standard_M128ds_v2": 18.676000, - "Standard_M128m": 37.344000, - "Standard_M128ms": 37.344000, - "Standard_M128ms_v2": 36.777000, - "Standard_M128s": 18.674000, - "Standard_M128s_v2": 18.087000, - "Standard_M16-4ms": 4.302000, - "Standard_M16-8ms": 4.302000, - "Standard_M16ms": 4.302000, - "Standard_M16s": 3.342000, - "Standard_M192idms_v2": 44.889000, - "Standard_M192ids_v2": 22.445000, - "Standard_M192ims_v2": 44.300000, - "Standard_M192is_v2": 21.856000, - "Standard_M208-104ms_v2": 53.544000, - "Standard_M208-104s_v2": 26.772000, - "Standard_M208-52ms_v2": 53.544000, - "Standard_M208-52s_v2": 26.772000, - "Standard_M208ms_v2": 53.544000, - "Standard_M208s_v2": 26.772000, - "Standard_M32-16ms": 8.604000, - "Standard_M32-8ms": 8.604000, - "Standard_M32dms_v2": 8.604000, - "Standard_M32ls": 3.448000, - "Standard_M32ms": 8.604000, - "Standard_M32ms_v2": 8.457000, - "Standard_M32s": 4.669000, - "Standard_M32ts": 3.248000, - "Standard_M416-104ms_v2": 118.980000, - "Standard_M416-104s_v2": 59.496000, - "Standard_M416-208ms_v2": 118.980000, - "Standard_M416-208s_v2": 59.496000, - "Standard_M416is_v2": 59.496000, - "Standard_M416ms_v2": 118.980000, - "Standard_M416s_8_v2": 79.750000, - "Standard_M416s_v2": 59.496000, - "Standard_M64": 9.337000, - "Standard_M64-16ms": 14.472000, - "Standard_M64-32ms": 14.472000, - "Standard_M64dms_v2": 14.476000, - "Standard_M64ds_v2": 9.337000, - "Standard_M64ls": 6.498000, - "Standard_M64m": 14.472000, - "Standard_M64ms": 14.472000, - "Standard_M64ms_v2": 14.181000, - "Standard_M64s": 9.337000, - "Standard_M64s_v2": 9.042000, - "Standard_M8-2ms": 2.151000, - "Standard_M8-4ms": 2.151000, - "Standard_M8ms": 2.151000, - "Standard_NC16as_T4_v3": 1.504000, - "Standard_NC4as_T4_v3": 0.658000, - "Standard_NC64as_T4_v3": 5.428000, - "Standard_NC8as_T4_v3": 0.939000, - "Standard_NV12ads_A10_v5": 1.180000, - "Standard_NV18ads_A10_v5": 2.080000, - "Standard_NV36adms_A10_v5": 5.876000, - "Standard_NV36ads_A10_v5": 4.160000, - "Standard_NV6ads_A10_v5": 0.590000, - "Standard_NV72ads_A10_v5": 8.476000, - } - // japaneast - initialOnDemandPrices["japaneast"] = map[string]float64{ - "Basic_A0": 0.022000, - "Basic_A1": 0.032000, - "Basic_A2": 0.109000, - "Basic_A3": 0.276000, - "Basic_A4": 0.552000, - "DCdsv3 Type1": 7.709000, - "DCsv3 Type1": 6.547000, - "Dadsv5_Type1": 8.254000, - "Dasv4_Type1": 6.547000, - "Dasv4_Type2": 6.820000, - "Dasv5_Type1": 6.899000, - "Ddsv4_Type 1": 5.139000, - "Ddsv4_Type2": 6.103000, - "Ddsv5_Type1": 7.709000, - "Dsv3_Type3": 5.456000, - "Dsv3_Type4": 6.820000, - "Dsv4_Type1": 5.456000, - "Dsv4_Type2": 6.547000, - "Dsv5_Type1": 6.820000, - "Eadsv5_Type1": 8.395000, - "Easv4_Type1": 8.025000, - "Easv4_Type2": 8.026000, - "Easv5_Type1": 7.234000, - "Ebdsv5-Type1": 7.146000, - "Ebsv5-Type1": 6.371000, - "Edsv4_Type 1": 6.125000, - "Edsv4_Type2": 7.273000, - "Edsv5_Type1": 9.187000, - "Esv3_Type3": 5.182000, - "Esv3_Type4": 7.021000, - "Esv4_Type1": 5.350000, - "Esv4_Type2": 7.022000, - "Esv5_Type1": 8.026000, - "FXmds Type1": 5.993000, - "Fsv2 Type3": 4.943000, - "Fsv2_Type2": 4.237000, - "Fsv2_Type4": 5.650000, - "Lsv2_Type1": 8.052000, - "Lsv3_Type1": 8.998000, - "Mdsmv2MedMem _Type1": 42.571000, - "Mdsv2MedMem_Type1": 21.277000, - "Ms_Type1": 21.270000, - "Msm_Type1": 42.577000, - "Msmv2MedMem Type1": 41.899000, - "Msmv2_Type1": 130.880000, - "Msv2MedMem Type1": 20.606000, - "Msv2_Type1": 65.446000, - "NVasv4_Type1": 10.406000, - "NVsv3_Type1": 6.952000, - "Standard_A0": 0.024000, - "Standard_A1": 0.081000, - "Standard_A1_v2": 0.054000, - "Standard_A2": 0.162000, - "Standard_A2_v2": 0.113000, - "Standard_A2m_v2": 0.153000, - "Standard_A3": 0.324000, - "Standard_A4": 0.648000, - "Standard_A4_v2": 0.238000, - "Standard_A4m_v2": 0.322000, - "Standard_A5": 0.281000, - "Standard_A6": 0.562000, - "Standard_A7": 1.124000, - "Standard_A8_v2": 0.500000, - "Standard_A8m_v2": 0.677000, - "Standard_B12ms": 0.653000, - "Standard_B16als_v2": 0.768000, - "Standard_B16as_v2": 0.858000, - "Standard_B16ls_v2": 0.844000, - "Standard_B16ms": 0.870000, - "Standard_B16pls_v2": 0.686000, - "Standard_B16ps_v2": 0.765000, - "Standard_B16s_v2": 0.870000, - "Standard_B1ls": 0.006800, - "Standard_B1ms": 0.027200, - "Standard_B1s": 0.013600, - "Standard_B20ms": 1.088000, - "Standard_B2als_v2": 0.049000, - "Standard_B2as_v2": 0.098000, - "Standard_B2ats_v2": 0.012300, - "Standard_B2ls_v2": 0.054400, - "Standard_B2ms": 0.109000, - "Standard_B2pls_v2": 0.052400, - "Standard_B2ps_v2": 0.095600, - "Standard_B2pts_v2": 0.020000, - "Standard_B2s": 0.054400, - "Standard_B2s_v2": 0.109000, - "Standard_B2ts_v2": 0.022800, - "Standard_B32als_v2": 1.536000, - "Standard_B32as_v2": 1.715000, - "Standard_B32ls_v2": 1.689000, - "Standard_B32s_v2": 1.888000, - "Standard_B4als_v2": 0.174000, - "Standard_B4as_v2": 0.214000, - "Standard_B4ls_v2": 0.211000, - "Standard_B4ms": 0.218000, - "Standard_B4pls_v2": 0.171000, - "Standard_B4ps_v2": 0.191000, - "Standard_B4s_v2": 0.236000, - "Standard_B8als_v2": 0.384000, - "Standard_B8as_v2": 0.429000, - "Standard_B8ls_v2": 0.422000, - "Standard_B8ms": 0.435000, - "Standard_B8pls_v2": 0.343000, - "Standard_B8ps_v2": 0.382000, - "Standard_B8s_v2": 0.472000, - "Standard_D1": 0.110000, - "Standard_D11": 0.242000, - "Standard_D11_v2": 0.229000, - "Standard_D11_v2_Promo": 0.229000, - "Standard_D12": 0.483000, - "Standard_D12_v2": 0.459000, - "Standard_D12_v2_Promo": 0.459000, - "Standard_D13": 0.966000, - "Standard_D13_v2": 0.918000, - "Standard_D13_v2_Promo": 0.918000, - "Standard_D14": 1.932000, - "Standard_D14_v2": 1.835000, - "Standard_D14_v2_Promo": 1.835000, - "Standard_D15_v2": 2.294000, - "Standard_D15i_v2": 2.294000, - "Standard_D16_v3": 1.032000, - "Standard_D16_v4": 0.992000, - "Standard_D16_v5": 0.992000, - "Standard_D16a_v4": 0.992000, - "Standard_D16ads_v5": 1.072000, - "Standard_D16as_v4": 0.992000, - "Standard_D16as_v5": 0.896000, - "Standard_D16as_v5_Promo": 0.792000, - "Standard_D16d_v4": 1.168000, - "Standard_D16d_v5": 1.168000, - "Standard_D16ds_v4": 1.168000, - "Standard_D16ds_v5": 1.168000, - "Standard_D16lds_v5": 0.976000, - "Standard_D16ls_v5": 0.856000, - "Standard_D16pds_v5": 0.936000, - "Standard_D16plds_v5": 0.784000, - "Standard_D16pls_v5": 0.685000, - "Standard_D16ps_v5": 0.792000, - "Standard_D16s_v3": 1.032000, - "Standard_D16s_v4": 0.992000, - "Standard_D16s_v5": 0.992000, - "Standard_D1_v2": 0.102000, - "Standard_D2": 0.221000, - "Standard_D2_v2": 0.205000, - "Standard_D2_v2_Promo": 0.205000, - "Standard_D2_v3": 0.129000, - "Standard_D2_v4": 0.124000, - "Standard_D2_v5": 0.124000, - "Standard_D2a_v4": 0.124000, - "Standard_D2ads_v5": 0.134000, - "Standard_D2as_v4": 0.124000, - "Standard_D2as_v5": 0.112000, - "Standard_D2as_v5_Promo": 0.099000, - "Standard_D2d_v4": 0.146000, - "Standard_D2d_v5": 0.146000, - "Standard_D2ds_v4": 0.146000, - "Standard_D2ds_v5": 0.146000, - "Standard_D2lds_v5": 0.122000, - "Standard_D2ls_v5": 0.107000, - "Standard_D2pds_v5": 0.117000, - "Standard_D2plds_v5": 0.098000, - "Standard_D2pls_v5": 0.085600, - "Standard_D2ps_v5": 0.099000, - "Standard_D2s_v3": 0.129000, - "Standard_D2s_v4": 0.124000, - "Standard_D2s_v5": 0.124000, - "Standard_D3": 0.442000, - "Standard_D32-16s_v3": 2.064000, - "Standard_D32-8s_v3": 2.064000, - "Standard_D32_v3": 2.064000, - "Standard_D32_v4": 1.984000, - "Standard_D32_v5": 1.984000, - "Standard_D32a_v4": 1.984000, - "Standard_D32ads_v5": 2.144000, - "Standard_D32as_v4": 1.984000, - "Standard_D32as_v5": 1.792000, - "Standard_D32as_v5_Promo": 1.584000, - "Standard_D32d_v4": 2.336000, - "Standard_D32d_v5": 2.336000, - "Standard_D32ds_v4": 2.336000, - "Standard_D32ds_v5": 2.336000, - "Standard_D32lds_v5": 1.952000, - "Standard_D32ls_v5": 1.712000, - "Standard_D32pds_v5": 1.872000, - "Standard_D32plds_v5": 1.568000, - "Standard_D32pls_v5": 1.370000, - "Standard_D32ps_v5": 1.584000, - "Standard_D32s_v3": 2.064000, - "Standard_D32s_v4": 1.984000, - "Standard_D32s_v5": 1.984000, - "Standard_D3_v2": 0.409000, - "Standard_D3_v2_Promo": 0.409000, - "Standard_D4": 0.883000, - "Standard_D48_v3": 3.096000, - "Standard_D48_v4": 2.976000, - "Standard_D48_v5": 2.976000, - "Standard_D48a_v4": 2.976000, - "Standard_D48ads_v5": 3.216000, - "Standard_D48as_v4": 2.976000, - "Standard_D48as_v5": 2.688000, - "Standard_D48as_v5_Promo": 2.376000, - "Standard_D48d_v4": 3.504000, - "Standard_D48d_v5": 3.504000, - "Standard_D48ds_v4": 3.504000, - "Standard_D48ds_v5": 3.504000, - "Standard_D48lds_v5": 2.928000, - "Standard_D48ls_v5": 2.568000, - "Standard_D48pds_v5": 2.808000, - "Standard_D48plds_v5": 2.352000, - "Standard_D48pls_v5": 2.054000, - "Standard_D48ps_v5": 2.376000, - "Standard_D48s_v3": 3.096000, - "Standard_D48s_v4": 2.976000, - "Standard_D48s_v5": 2.976000, - "Standard_D4_v2": 0.818000, - "Standard_D4_v2_Promo": 0.818000, - "Standard_D4_v3": 0.258000, - "Standard_D4_v4": 0.248000, - "Standard_D4_v5": 0.248000, - "Standard_D4a_v4": 0.248000, - "Standard_D4ads_v5": 0.268000, - "Standard_D4as_v4": 0.248000, - "Standard_D4as_v5": 0.224000, - "Standard_D4as_v5_Promo": 0.198000, - "Standard_D4d_v4": 0.292000, - "Standard_D4d_v5": 0.292000, - "Standard_D4ds_v4": 0.292000, - "Standard_D4ds_v5": 0.292000, - "Standard_D4lds_v5": 0.244000, - "Standard_D4ls_v5": 0.214000, - "Standard_D4pds_v5": 0.234000, - "Standard_D4plds_v5": 0.196000, - "Standard_D4pls_v5": 0.171000, - "Standard_D4ps_v5": 0.198000, - "Standard_D4s_v3": 0.258000, - "Standard_D4s_v4": 0.248000, - "Standard_D4s_v5": 0.248000, - "Standard_D5_v2": 1.636000, - "Standard_D5_v2_Promo": 1.636000, - "Standard_D64-16s_v3": 4.128000, - "Standard_D64-32s_v3": 4.128000, - "Standard_D64_v3": 4.128000, - "Standard_D64_v4": 3.968000, - "Standard_D64_v5": 3.968000, - "Standard_D64a_v4": 3.968000, - "Standard_D64ads_v5": 4.288000, - "Standard_D64as_v4": 3.968000, - "Standard_D64as_v5": 3.584000, - "Standard_D64as_v5_Promo": 3.168000, - "Standard_D64d_v4": 4.672000, - "Standard_D64d_v5": 4.672000, - "Standard_D64ds_v4": 4.672000, - "Standard_D64ds_v5": 4.672000, - "Standard_D64lds_v5": 3.904000, - "Standard_D64ls_v5": 3.424000, - "Standard_D64pds_v5": 3.744000, - "Standard_D64plds_v5": 3.136000, - "Standard_D64pls_v5": 2.739000, - "Standard_D64ps_v5": 3.168000, - "Standard_D64s_v3": 4.128000, - "Standard_D64s_v4": 3.968000, - "Standard_D64s_v5": 3.968000, - "Standard_D8_v3": 0.516000, - "Standard_D8_v4": 0.496000, - "Standard_D8_v5": 0.496000, - "Standard_D8a_v4": 0.496000, - "Standard_D8ads_v5": 0.536000, - "Standard_D8as_v4": 0.496000, - "Standard_D8as_v5": 0.448000, - "Standard_D8as_v5_Promo": 0.396000, - "Standard_D8d_v4": 0.584000, - "Standard_D8d_v5": 0.584000, - "Standard_D8ds_v4": 0.584000, - "Standard_D8ds_v5": 0.584000, - "Standard_D8lds_v5": 0.488000, - "Standard_D8ls_v5": 0.428000, - "Standard_D8pds_v5": 0.468000, - "Standard_D8plds_v5": 0.392000, - "Standard_D8pls_v5": 0.342000, - "Standard_D8ps_v5": 0.396000, - "Standard_D8s_v3": 0.516000, - "Standard_D8s_v4": 0.496000, - "Standard_D8s_v5": 0.496000, - "Standard_D96_v5": 5.952000, - "Standard_D96a_v4": 5.952000, - "Standard_D96ads_v5": 6.432000, - "Standard_D96as_v4": 5.952000, - "Standard_D96as_v5": 5.376000, - "Standard_D96as_v5_Promo": 4.752000, - "Standard_D96d_v5": 7.008000, - "Standard_D96ds_v5": 7.008000, - "Standard_D96lds_v5": 5.856000, - "Standard_D96ls_v5": 5.136000, - "Standard_D96s_v5": 5.952000, - "Standard_DC16ads_v5": 1.072000, - "Standard_DC16as_v5": 0.896000, - "Standard_DC16ds_v3": 2.336000, - "Standard_DC16s_v3": 1.984000, - "Standard_DC1ds_v3": 0.146000, - "Standard_DC1s_v3": 0.124000, - "Standard_DC24ds_v3": 3.504000, - "Standard_DC24s_v3": 2.976000, - "Standard_DC2ads_v5": 0.134000, - "Standard_DC2as_v5": 0.112000, - "Standard_DC2ds_v3": 0.292000, - "Standard_DC2s_v3": 0.248000, - "Standard_DC32ads_v5": 2.144000, - "Standard_DC32as_v5": 1.792000, - "Standard_DC32ds_v3": 4.672000, - "Standard_DC32s_v3": 3.968000, - "Standard_DC48ads_v5": 3.216000, - "Standard_DC48as_v5": 2.688000, - "Standard_DC48ds_v3": 7.008000, - "Standard_DC48s_v3": 5.952000, - "Standard_DC4ads_v5": 0.268000, - "Standard_DC4as_v5": 0.224000, - "Standard_DC4ds_v3": 0.584000, - "Standard_DC4s_v3": 0.496000, - "Standard_DC64ads_v5": 4.288000, - "Standard_DC64as_v5": 3.584000, - "Standard_DC8ads_v5": 0.536000, - "Standard_DC8as_v5": 0.448000, - "Standard_DC8ds_v3": 1.168000, - "Standard_DC8s_v3": 0.992000, - "Standard_DC96ads_v5": 6.432000, - "Standard_DC96as_v5": 5.376000, - "Standard_DS1": 0.110000, - "Standard_DS11": 0.242000, - "Standard_DS11-1_v2": 0.229000, - "Standard_DS11_v2": 0.229000, - "Standard_DS11_v2_Promo": 0.229000, - "Standard_DS12": 0.483000, - "Standard_DS12-1_v2": 0.459000, - "Standard_DS12-2_v2": 0.459000, - "Standard_DS12_v2": 0.459000, - "Standard_DS12_v2_Promo": 0.459000, - "Standard_DS13": 0.966000, - "Standard_DS13-2_v2": 0.918000, - "Standard_DS13-4_v2": 0.918000, - "Standard_DS13_v2": 0.918000, - "Standard_DS13_v2_Promo": 0.918000, - "Standard_DS14": 1.932000, - "Standard_DS14-4_v2": 1.835000, - "Standard_DS14-8_v2": 1.835000, - "Standard_DS14_v2": 1.835000, - "Standard_DS14_v2_Promo": 1.835000, - "Standard_DS15_v2": 2.294000, - "Standard_DS15i_v2": 2.294000, - "Standard_DS1_v2": 0.102000, - "Standard_DS2": 0.221000, - "Standard_DS2_v2": 0.205000, - "Standard_DS2_v2_Promo": 0.205000, - "Standard_DS3": 0.442000, - "Standard_DS3_v2": 0.409000, - "Standard_DS3_v2_Promo": 0.409000, - "Standard_DS4": 0.883000, - "Standard_DS4_v2": 0.818000, - "Standard_DS4_v2_Promo": 0.818000, - "Standard_DS5_v2": 1.636000, - "Standard_DS5_v2_Promo": 1.636000, - "Standard_E104i_v5": 8.694000, - "Standard_E104id_v5": 9.953000, - "Standard_E104ids_v5": 9.953000, - "Standard_E104is_v5": 8.694000, - "Standard_E112iads_v5": 9.794000, - "Standard_E112ias_v5": 8.439000, - "Standard_E112ibds_v5": 12.505000, - "Standard_E112ibs_v5": 11.150000, - "Standard_E16-4ads_v5": 1.272000, - "Standard_E16-4as_v4": 1.216000, - "Standard_E16-4as_v5": 1.096000, - "Standard_E16-4ds_v4": 1.392000, - "Standard_E16-4ds_v5": 1.392000, - "Standard_E16-4s_v3": 1.280000, - "Standard_E16-4s_v4": 1.216000, - "Standard_E16-4s_v5": 1.216000, - "Standard_E16-8ads_v5": 1.272000, - "Standard_E16-8as_v4": 1.216000, - "Standard_E16-8as_v5": 1.096000, - "Standard_E16-8ds_v4": 1.392000, - "Standard_E16-8ds_v5": 1.392000, - "Standard_E16-8s_v3": 1.280000, - "Standard_E16-8s_v4": 1.216000, - "Standard_E16-8s_v5": 1.216000, - "Standard_E16_v3": 1.280000, - "Standard_E16_v4": 1.216000, - "Standard_E16_v5": 1.216000, - "Standard_E16a_v4": 1.216000, - "Standard_E16ads_v5": 1.272000, - "Standard_E16as_v4": 1.216000, - "Standard_E16as_v5": 1.096000, - "Standard_E16bds_v5": 1.624000, - "Standard_E16bs_v5": 1.448000, - "Standard_E16d_v4": 1.392000, - "Standard_E16d_v5": 1.392000, - "Standard_E16ds_v4": 1.392000, - "Standard_E16ds_v5": 1.392000, - "Standard_E16pds_v5": 1.112000, - "Standard_E16ps_v5": 0.973000, - "Standard_E16s_v3": 1.280000, - "Standard_E16s_v4": 1.216000, - "Standard_E16s_v5": 1.216000, - "Standard_E20_v3": 1.600000, - "Standard_E20_v4": 1.520000, - "Standard_E20_v5": 1.520000, - "Standard_E20a_v4": 1.520000, - "Standard_E20ads_v5": 1.590000, - "Standard_E20as_v4": 1.520000, - "Standard_E20as_v5": 1.370000, - "Standard_E20d_v4": 1.740000, - "Standard_E20d_v5": 1.740000, - "Standard_E20ds_v4": 1.740000, - "Standard_E20ds_v5": 1.740000, - "Standard_E20pds_v5": 1.390000, - "Standard_E20ps_v5": 1.216000, - "Standard_E20s_v3": 1.600000, - "Standard_E20s_v4": 1.520000, - "Standard_E20s_v5": 1.520000, - "Standard_E2_v3": 0.160000, - "Standard_E2_v4": 0.152000, - "Standard_E2_v5": 0.152000, - "Standard_E2a_v4": 0.152000, - "Standard_E2ads_v5": 0.159000, - "Standard_E2as_v4": 0.152000, - "Standard_E2as_v5": 0.137000, - "Standard_E2bds_v5": 0.203000, - "Standard_E2bs_v5": 0.181000, - "Standard_E2d_v4": 0.174000, - "Standard_E2d_v5": 0.174000, - "Standard_E2ds_v4": 0.174000, - "Standard_E2ds_v5": 0.174000, - "Standard_E2pds_v5": 0.139000, - "Standard_E2ps_v5": 0.122000, - "Standard_E2s_v3": 0.160000, - "Standard_E2s_v4": 0.152000, - "Standard_E2s_v5": 0.152000, - "Standard_E32-16ads_v5": 2.544000, - "Standard_E32-16as_v4": 2.432000, - "Standard_E32-16as_v5": 2.192000, - "Standard_E32-16ds_v4": 2.784000, - "Standard_E32-16ds_v5": 2.784000, - "Standard_E32-16s_v3": 2.560000, - "Standard_E32-16s_v4": 2.432000, - "Standard_E32-16s_v5": 2.432000, - "Standard_E32-8ads_v5": 2.544000, - "Standard_E32-8as_v4": 2.432000, - "Standard_E32-8as_v5": 2.192000, - "Standard_E32-8ds_v4": 2.784000, - "Standard_E32-8ds_v5": 2.784000, - "Standard_E32-8s_v3": 2.560000, - "Standard_E32-8s_v4": 2.432000, - "Standard_E32-8s_v5": 2.432000, - "Standard_E32_v3": 2.560000, - "Standard_E32_v4": 2.432000, - "Standard_E32_v5": 2.432000, - "Standard_E32a_v4": 2.432000, - "Standard_E32ads_v5": 2.544000, - "Standard_E32as_v4": 2.432000, - "Standard_E32as_v5": 2.192000, - "Standard_E32bds_v5": 3.248000, - "Standard_E32bs_v5": 2.896000, - "Standard_E32d_v4": 2.784000, - "Standard_E32d_v5": 2.784000, - "Standard_E32ds_v4": 2.784000, - "Standard_E32ds_v5": 2.784000, - "Standard_E32pds_v5": 2.224000, - "Standard_E32ps_v5": 1.946000, - "Standard_E32s_v3": 2.560000, - "Standard_E32s_v4": 2.432000, - "Standard_E32s_v5": 2.432000, - "Standard_E4-2ads_v5": 0.318000, - "Standard_E4-2as_v4": 0.304000, - "Standard_E4-2as_v5": 0.274000, - "Standard_E4-2ds_v4": 0.348000, - "Standard_E4-2ds_v5": 0.348000, - "Standard_E4-2s_v3": 0.320000, - "Standard_E4-2s_v4": 0.304000, - "Standard_E4-2s_v5": 0.304000, - "Standard_E48_v3": 3.647000, - "Standard_E48_v4": 3.648000, - "Standard_E48_v5": 3.648000, - "Standard_E48a_v4": 3.648000, - "Standard_E48ads_v5": 3.816000, - "Standard_E48as_v4": 3.648000, - "Standard_E48as_v5": 3.288000, - "Standard_E48bds_v5": 4.872000, - "Standard_E48bs_v5": 4.344000, - "Standard_E48d_v4": 4.176000, - "Standard_E48d_v5": 4.176000, - "Standard_E48ds_v4": 4.176000, - "Standard_E48ds_v5": 4.176000, - "Standard_E48s_v3": 3.647000, - "Standard_E48s_v4": 3.648000, - "Standard_E48s_v5": 3.648000, - "Standard_E4_v3": 0.320000, - "Standard_E4_v4": 0.304000, - "Standard_E4_v5": 0.304000, - "Standard_E4a_v4": 0.304000, - "Standard_E4ads_v5": 0.318000, - "Standard_E4as_v4": 0.304000, - "Standard_E4as_v5": 0.274000, - "Standard_E4bds_v5": 0.406000, - "Standard_E4bs_v5": 0.362000, - "Standard_E4d_v4": 0.348000, - "Standard_E4d_v5": 0.348000, - "Standard_E4ds_v4": 0.348000, - "Standard_E4ds_v5": 0.348000, - "Standard_E4pds_v5": 0.278000, - "Standard_E4ps_v5": 0.243000, - "Standard_E4s_v3": 0.320000, - "Standard_E4s_v4": 0.304000, - "Standard_E4s_v5": 0.304000, - "Standard_E64-16ads_v5": 5.088000, - "Standard_E64-16as_v4": 4.864000, - "Standard_E64-16as_v5": 4.384000, - "Standard_E64-16ds_v4": 5.568000, - "Standard_E64-16ds_v5": 5.568000, - "Standard_E64-16s_v3": 4.376000, - "Standard_E64-16s_v4": 4.864000, - "Standard_E64-16s_v5": 4.864000, - "Standard_E64-32ads_v5": 5.088000, - "Standard_E64-32as_v4": 4.864000, - "Standard_E64-32as_v5": 4.384000, - "Standard_E64-32ds_v4": 5.568000, - "Standard_E64-32ds_v5": 5.568000, - "Standard_E64-32s_v3": 4.376000, - "Standard_E64-32s_v4": 4.864000, - "Standard_E64-32s_v5": 4.864000, - "Standard_E64_v3": 4.376000, - "Standard_E64_v4": 4.864000, - "Standard_E64_v5": 4.864000, - "Standard_E64a_v4": 4.864000, - "Standard_E64ads_v5": 5.088000, - "Standard_E64as_v4": 4.864000, - "Standard_E64as_v5": 4.384000, - "Standard_E64bds_v5": 6.496000, - "Standard_E64bs_v5": 5.792000, - "Standard_E64d_v4": 5.568000, - "Standard_E64d_v5": 5.568000, - "Standard_E64ds_v4": 5.568000, - "Standard_E64ds_v5": 5.568000, - "Standard_E64i_v3": 4.376000, - "Standard_E64is_v3": 4.376000, - "Standard_E64s_v3": 4.376000, - "Standard_E64s_v4": 4.864000, - "Standard_E64s_v5": 4.864000, - "Standard_E8-2ads_v5": 0.636000, - "Standard_E8-2as_v4": 0.608000, - "Standard_E8-2as_v5": 0.548000, - "Standard_E8-2ds_v4": 0.696000, - "Standard_E8-2ds_v5": 0.696000, - "Standard_E8-2s_v3": 0.640000, - "Standard_E8-2s_v4": 0.608000, - "Standard_E8-2s_v5": 0.608000, - "Standard_E8-4ads_v5": 0.636000, - "Standard_E8-4as_v4": 0.608000, - "Standard_E8-4as_v5": 0.548000, - "Standard_E8-4ds_v4": 0.696000, - "Standard_E8-4ds_v5": 0.696000, - "Standard_E8-4s_v3": 0.640000, - "Standard_E8-4s_v4": 0.608000, - "Standard_E8-4s_v5": 0.608000, - "Standard_E80ids_v4": 6.960000, - "Standard_E80is_v4": 6.080000, - "Standard_E8_v3": 0.640000, - "Standard_E8_v4": 0.608000, - "Standard_E8_v5": 0.608000, - "Standard_E8a_v4": 0.608000, - "Standard_E8ads_v5": 0.636000, - "Standard_E8as_v4": 0.608000, - "Standard_E8as_v5": 0.548000, - "Standard_E8bds_v5": 0.812000, - "Standard_E8bs_v5": 0.724000, - "Standard_E8d_v4": 0.696000, - "Standard_E8d_v5": 0.696000, - "Standard_E8ds_v4": 0.696000, - "Standard_E8ds_v5": 0.696000, - "Standard_E8pds_v5": 0.556000, - "Standard_E8ps_v5": 0.486000, - "Standard_E8s_v3": 0.640000, - "Standard_E8s_v4": 0.608000, - "Standard_E8s_v5": 0.608000, - "Standard_E96-24ads_v5": 7.632000, - "Standard_E96-24as_v4": 7.296000, - "Standard_E96-24as_v5": 6.576000, - "Standard_E96-24ds_v5": 8.352000, - "Standard_E96-24s_v5": 7.296000, - "Standard_E96-48ads_v5": 7.632000, - "Standard_E96-48as_v4": 7.296000, - "Standard_E96-48as_v5": 6.576000, - "Standard_E96-48ds_v5": 8.352000, - "Standard_E96-48s_v5": 7.296000, - "Standard_E96_v5": 7.296000, - "Standard_E96a_v4": 7.296000, - "Standard_E96ads_v5": 7.632000, - "Standard_E96as_v4": 7.296000, - "Standard_E96as_v5": 6.576000, - "Standard_E96bds_v5": 9.744000, - "Standard_E96bs_v5": 8.688000, - "Standard_E96d_v5": 8.352000, - "Standard_E96ds_v5": 8.352000, - "Standard_E96iads_v5": 8.395000, - "Standard_E96ias_v5": 7.234000, - "Standard_E96s_v5": 7.296000, - "Standard_EC16ads_v5": 1.272000, - "Standard_EC16as_v5": 1.096000, - "Standard_EC20ads_v5": 1.590000, - "Standard_EC20as_v5": 1.370000, - "Standard_EC2ads_v5": 0.159000, - "Standard_EC2as_v5": 0.137000, - "Standard_EC32ads_v5": 2.544000, - "Standard_EC32as_v5": 2.192000, - "Standard_EC48ads_v5": 3.816000, - "Standard_EC48as_v5": 3.288000, - "Standard_EC4ads_v5": 0.318000, - "Standard_EC4as_v5": 0.274000, - "Standard_EC64ads_v5": 5.088000, - "Standard_EC64as_v5": 4.384000, - "Standard_EC8ads_v5": 0.636000, - "Standard_EC8as_v5": 0.548000, - "Standard_EC96ads_v5": 7.632000, - "Standard_EC96as_v5": 6.576000, - "Standard_EC96iads_v5": 8.395000, - "Standard_EC96ias_v5": 7.234000, - "Standard_F1": 0.063000, - "Standard_F16": 1.008000, - "Standard_F16s": 1.008000, - "Standard_F16s_v2": 0.856000, - "Standard_F1s": 0.063000, - "Standard_F2": 0.126000, - "Standard_F2s": 0.126000, - "Standard_F2s_v2": 0.107000, - "Standard_F32s_v2": 1.712000, - "Standard_F4": 0.252000, - "Standard_F48s_v2": 2.568000, - "Standard_F4s": 0.252000, - "Standard_F4s_v2": 0.214000, - "Standard_F64s_v2": 3.424000, - "Standard_F72s_v2": 3.852000, - "Standard_F8": 0.504000, - "Standard_F8s": 0.504000, - "Standard_F8s_v2": 0.428000, - "Standard_FX12mds": 1.362000, - "Standard_FX24mds": 2.724000, - "Standard_FX36mds": 4.086000, - "Standard_FX48mds": 5.448000, - "Standard_FX4mds": 0.454000, - "Standard_G1": 0.576000, - "Standard_G2": 1.151000, - "Standard_G3": 2.302000, - "Standard_G4": 4.602000, - "Standard_G5": 9.205000, - "Standard_GS1": 0.576000, - "Standard_GS2": 1.151000, - "Standard_GS3": 2.302000, - "Standard_GS4": 4.602000, - "Standard_GS4-4": 4.602000, - "Standard_GS4-8": 4.602000, - "Standard_GS5": 9.205000, - "Standard_GS5-16": 9.205000, - "Standard_GS5-8": 9.205000, - "Standard_H16": 2.291000, - "Standard_H16m": 3.070000, - "Standard_H16mr": 3.377000, - "Standard_H16r": 2.520000, - "Standard_H8": 1.145000, - "Standard_H8m": 1.535000, - "Standard_HB120-16rs_v2": 5.220000, - "Standard_HB120-16rs_v3": 5.220000, - "Standard_HB120-32rs_v2": 5.220000, - "Standard_HB120-32rs_v3": 5.220000, - "Standard_HB120-64rs_v2": 5.220000, - "Standard_HB120-64rs_v3": 5.220000, - "Standard_HB120-96rs_v2": 5.220000, - "Standard_HB120-96rs_v3": 5.220000, - "Standard_HB120rs_v2": 5.220000, - "Standard_HB120rs_v3": 5.220000, - "Standard_HC44-16rs": 4.594000, - "Standard_HC44-32rs": 4.594000, - "Standard_HC44rs": 4.594000, - "Standard_L112ias_v3": 11.273000, - "Standard_L16as_v3": 1.464000, - "Standard_L16s": 1.464000, - "Standard_L16s_v2": 1.464000, - "Standard_L16s_v3": 1.636000, - "Standard_L32as_v3": 2.928000, - "Standard_L32s": 2.928000, - "Standard_L32s_v2": 2.928000, - "Standard_L32s_v3": 3.272000, - "Standard_L48as_v3": 4.392000, - "Standard_L48s_v2": 4.392000, - "Standard_L48s_v3": 4.908000, - "Standard_L4s": 0.366000, - "Standard_L64as_v3": 5.856000, - "Standard_L64s_v2": 5.856000, - "Standard_L64s_v3": 6.544000, - "Standard_L80as_v3": 7.320000, - "Standard_L80s_v2": 7.320000, - "Standard_L80s_v3": 8.180000, - "Standard_L88is_v2": 8.052000, - "Standard_L8as_v3": 0.732000, - "Standard_L8s": 0.732000, - "Standard_L8s_v2": 0.732000, - "Standard_L8s_v3": 0.818000, - "Standard_L96ias_v3": 9.662000, - "Standard_M128": 19.340000, - "Standard_M128-32ms": 38.698000, - "Standard_M128-64ms": 38.698000, - "Standard_M128dms_v2": 38.701000, - "Standard_M128ds_v2": 19.343000, - "Standard_M128m": 38.698000, - "Standard_M128ms": 38.698000, - "Standard_M128ms_v2": 38.090000, - "Standard_M128s": 19.340000, - "Standard_M128s_v2": 18.733000, - "Standard_M16-4ms": 4.455900, - "Standard_M16-8ms": 4.455900, - "Standard_M16ms": 4.455900, - "Standard_M16s": 3.461000, - "Standard_M192idms_v2": 46.493000, - "Standard_M192ids_v2": 23.246000, - "Standard_M192ims_v2": 45.882000, - "Standard_M192is_v2": 22.636000, - "Standard_M208-104ms_v2": 53.544000, - "Standard_M208-104s_v2": 26.772000, - "Standard_M208-52ms_v2": 53.544000, - "Standard_M208-52s_v2": 26.772000, - "Standard_M208ms_v2": 53.544000, - "Standard_M208s_v2": 26.772000, - "Standard_M32-16ms": 8.911700, - "Standard_M32-8ms": 8.911700, - "Standard_M32dms_v2": 8.912000, - "Standard_M32ls": 3.447600, - "Standard_M32ms": 8.911700, - "Standard_M32ms_v2": 8.759000, - "Standard_M32s": 4.835800, - "Standard_M32ts": 3.248000, - "Standard_M416-104ms_v2": 118.980000, - "Standard_M416-104s_v2": 59.496000, - "Standard_M416-208ms_v2": 118.980000, - "Standard_M416-208s_v2": 59.496000, - "Standard_M416is_v2": 59.496000, - "Standard_M416ms_v2": 118.980000, - "Standard_M416s_8_v2": 79.750000, - "Standard_M416s_v2": 59.496000, - "Standard_M64": 9.670000, - "Standard_M64-16ms": 14.989000, - "Standard_M64-32ms": 14.989000, - "Standard_M64dms_v2": 14.993000, - "Standard_M64ds_v2": 9.670000, - "Standard_M64ls": 6.498000, - "Standard_M64m": 14.989000, - "Standard_M64ms": 14.989000, - "Standard_M64ms_v2": 14.688000, - "Standard_M64s": 9.670000, - "Standard_M64s_v2": 9.365000, - "Standard_M8-2ms": 2.227900, - "Standard_M8-4ms": 2.227900, - "Standard_M8ms": 2.227900, - "Standard_NC12s_v3": 8.388000, - "Standard_NC16as_T4_v3": 1.625000, - "Standard_NC24ads_A100_v4": 5.326000, - "Standard_NC24rs_v3": 18.454000, - "Standard_NC24s_v3": 16.776000, - "Standard_NC48ads_A100_v4": 10.652000, - "Standard_NC4as_T4_v3": 0.710000, - "Standard_NC64as_T4_v3": 5.875000, - "Standard_NC6s_v3": 4.194000, - "Standard_NC8as_T4_v3": 1.015000, - "Standard_NC96ads_A100_v4": 21.303000, - "Standard_ND96ams_A100_v4": 47.517000, - "Standard_ND96amsr_A100_v4": 47.517000, - "Standard_NV12": 3.160000, - "Standard_NV12ads_A10_v5": 1.317000, - "Standard_NV12s_v3": 1.580000, - "Standard_NV16as_v4": 1.351000, - "Standard_NV18ads_A10_v5": 2.320000, - "Standard_NV24": 6.319000, - "Standard_NV24s_v3": 3.160000, - "Standard_NV32as_v4": 2.703000, - "Standard_NV36adms_A10_v5": 6.554000, - "Standard_NV36ads_A10_v5": 4.640000, - "Standard_NV48s_v3": 6.320000, - "Standard_NV4as_v4": 0.338000, - "Standard_NV6": 1.580000, - "Standard_NV6ads_A10_v5": 0.658000, - "Standard_NV72ads_A10_v5": 9.454000, - "Standard_NV8as_v4": 0.676000, - } - // japanwest - initialOnDemandPrices["japanwest"] = map[string]float64{ - "Basic_A0": 0.017100, - "Basic_A1": 0.032000, - "Basic_A2": 0.099000, - "Basic_A3": 0.219600, - "Basic_A4": 0.439200, - "DCdsv3 Type1": 7.709000, - "DCsv3 Type1": 6.547000, - "Dadsv5_Type1": 8.254000, - "Dasv4_Type1": 6.820000, - "Dasv4_Type2": 6.820000, - "Dasv5_Type1": 6.899000, - "Ddsv4_Type 1": 5.625000, - "Ddsv4_Type2": 6.680000, - "Ddsv5_Type1": 7.709000, - "Dsv3_Type3": 5.460000, - "Dsv3_Type4": 6.824000, - "Dsv4_Type1": 5.456000, - "Dsv4_Type2": 6.820000, - "Dsv5_Type1": 6.820000, - "Eadsv5_Type1": 8.395000, - "Easv4_Type1": 8.026000, - "Easv4_Type2": 8.026000, - "Easv5_Type1": 7.234000, - "Ebdsv5-Type1": 7.040000, - "Ebsv5-Type1": 6.266000, - "Edsv4_Type 1": 6.737000, - "Edsv4_Type2": 8.001000, - "Edsv5_Type1": 9.187000, - "Esv3_Type3": 5.192000, - "Esv3_Type4": 7.034000, - "Esv4_Type1": 5.351000, - "Esv4_Type2": 7.023000, - "Esv5_Type1": 8.026000, - "Fsv2 Type3": 5.465000, - "Fsv2_Type2": 4.277000, - "Fsv2_Type4": 5.940000, - "Lasv3_Type1": 8.052000, - "Lsv3_Type1": 8.998000, - "Mdsmv2MedMem _Type1": 42.571000, - "Mdsv2MedMem_Type1": 21.277000, - "Msmv2MedMem Type1": 41.899000, - "Msmv2_Type1": 169.050000, - "Msv2MedMem Type1": 20.606000, - "Msv2_Type1": 84.534000, - "Standard_A0": 0.021000, - "Standard_A1": 0.073000, - "Standard_A1_v2": 0.054000, - "Standard_A2": 0.146000, - "Standard_A2_v2": 0.113000, - "Standard_A2m_v2": 0.178000, - "Standard_A3": 0.292000, - "Standard_A4": 0.584000, - "Standard_A4_v2": 0.238000, - "Standard_A4m_v2": 0.374000, - "Standard_A5": 0.258000, - "Standard_A6": 0.516000, - "Standard_A7": 1.032000, - "Standard_A8_v2": 0.500000, - "Standard_A8m_v2": 0.786000, - "Standard_B12ms": 0.719000, - "Standard_B16als_v2": 0.694000, - "Standard_B16as_v2": 0.858000, - "Standard_B16ls_v2": 0.771000, - "Standard_B16ms": 0.958000, - "Standard_B16s_v2": 0.870000, - "Standard_B1ls": 0.007490, - "Standard_B1ms": 0.030000, - "Standard_B1s": 0.015000, - "Standard_B20ms": 1.198000, - "Standard_B2als_v2": 0.049000, - "Standard_B2as_v2": 0.107000, - "Standard_B2ats_v2": 0.012300, - "Standard_B2ls_v2": 0.063600, - "Standard_B2ms": 0.120000, - "Standard_B2s": 0.059900, - "Standard_B2s_v2": 0.109000, - "Standard_B2ts_v2": 0.022800, - "Standard_B32als_v2": 1.388000, - "Standard_B32as_v2": 1.568000, - "Standard_B32ls_v2": 1.689000, - "Standard_B32s_v2": 1.741000, - "Standard_B4als_v2": 0.192000, - "Standard_B4as_v2": 0.214000, - "Standard_B4ls_v2": 0.211000, - "Standard_B4ms": 0.240000, - "Standard_B4s_v2": 0.236000, - "Standard_B8als_v2": 0.384000, - "Standard_B8as_v2": 0.392000, - "Standard_B8ls_v2": 0.422000, - "Standard_B8ms": 0.479000, - "Standard_B8s_v2": 0.472000, - "Standard_D1": 0.096000, - "Standard_D11": 0.210000, - "Standard_D11_v2": 0.200000, - "Standard_D11_v2_Promo": 0.200000, - "Standard_D12": 0.420000, - "Standard_D12_v2": 0.399000, - "Standard_D12_v2_Promo": 0.399000, - "Standard_D13": 0.840000, - "Standard_D13_v2": 0.798000, - "Standard_D13_v2_Promo": 0.798000, - "Standard_D14": 1.680000, - "Standard_D14_v2": 1.596000, - "Standard_D14_v2_Promo": 1.596000, - "Standard_D15_v2": 1.995000, - "Standard_D15i_v2": 1.995000, - "Standard_D16_v3": 1.032000, - "Standard_D16_v4": 1.091000, - "Standard_D16_v5": 0.992000, - "Standard_D16a_v4": 0.992000, - "Standard_D16ads_v5": 1.072000, - "Standard_D16as_v4": 0.992000, - "Standard_D16as_v5": 0.896000, - "Standard_D16d_v4": 1.284000, - "Standard_D16d_v5": 1.168000, - "Standard_D16ds_v4": 1.284000, - "Standard_D16ds_v5": 1.168000, - "Standard_D16lds_v5": 0.976000, - "Standard_D16ls_v5": 0.856000, - "Standard_D16s_v3": 1.032000, - "Standard_D16s_v4": 1.091000, - "Standard_D16s_v5": 0.992000, - "Standard_D1_v2": 0.091000, - "Standard_D2": 0.192000, - "Standard_D2_v2": 0.182000, - "Standard_D2_v2_Promo": 0.182000, - "Standard_D2_v3": 0.129000, - "Standard_D2_v4": 0.136000, - "Standard_D2_v5": 0.124000, - "Standard_D2a_v4": 0.124000, - "Standard_D2ads_v5": 0.134000, - "Standard_D2as_v4": 0.124000, - "Standard_D2as_v5": 0.112000, - "Standard_D2d_v4": 0.161000, - "Standard_D2d_v5": 0.146000, - "Standard_D2ds_v4": 0.161000, - "Standard_D2ds_v5": 0.146000, - "Standard_D2lds_v5": 0.122000, - "Standard_D2ls_v5": 0.107000, - "Standard_D2s_v3": 0.129000, - "Standard_D2s_v4": 0.136000, - "Standard_D2s_v5": 0.124000, - "Standard_D3": 0.384000, - "Standard_D32-16s_v3": 2.064000, - "Standard_D32-8s_v3": 2.064000, - "Standard_D32_v3": 2.064000, - "Standard_D32_v4": 2.182000, - "Standard_D32_v5": 1.984000, - "Standard_D32a_v4": 1.984000, - "Standard_D32ads_v5": 2.144000, - "Standard_D32as_v4": 1.984000, - "Standard_D32as_v5": 1.792000, - "Standard_D32d_v4": 2.569000, - "Standard_D32d_v5": 2.336000, - "Standard_D32ds_v4": 2.569000, - "Standard_D32ds_v5": 2.336000, - "Standard_D32lds_v5": 1.952000, - "Standard_D32ls_v5": 1.712000, - "Standard_D32s_v3": 2.064000, - "Standard_D32s_v4": 2.182000, - "Standard_D32s_v5": 1.984000, - "Standard_D3_v2": 0.365000, - "Standard_D3_v2_Promo": 0.365000, - "Standard_D4": 0.768000, - "Standard_D48_v3": 3.096000, - "Standard_D48_v4": 3.274000, - "Standard_D48_v5": 2.976000, - "Standard_D48a_v4": 2.976000, - "Standard_D48ads_v5": 3.216000, - "Standard_D48as_v4": 2.976000, - "Standard_D48as_v5": 2.688000, - "Standard_D48d_v4": 3.853000, - "Standard_D48d_v5": 3.504000, - "Standard_D48ds_v4": 3.853000, - "Standard_D48ds_v5": 3.504000, - "Standard_D48lds_v5": 2.928000, - "Standard_D48ls_v5": 2.568000, - "Standard_D48s_v3": 3.096000, - "Standard_D48s_v4": 3.274000, - "Standard_D48s_v5": 2.976000, - "Standard_D4_v2": 0.729000, - "Standard_D4_v2_Promo": 0.729000, - "Standard_D4_v3": 0.258000, - "Standard_D4_v4": 0.273000, - "Standard_D4_v5": 0.248000, - "Standard_D4a_v4": 0.248000, - "Standard_D4ads_v5": 0.268000, - "Standard_D4as_v4": 0.248000, - "Standard_D4as_v5": 0.224000, - "Standard_D4d_v4": 0.321000, - "Standard_D4d_v5": 0.292000, - "Standard_D4ds_v4": 0.321000, - "Standard_D4ds_v5": 0.292000, - "Standard_D4lds_v5": 0.244000, - "Standard_D4ls_v5": 0.214000, - "Standard_D4s_v3": 0.258000, - "Standard_D4s_v4": 0.273000, - "Standard_D4s_v5": 0.248000, - "Standard_D5_v2": 1.459000, - "Standard_D5_v2_Promo": 1.459000, - "Standard_D64-16s_v3": 4.128000, - "Standard_D64-32s_v3": 4.128000, - "Standard_D64_v3": 4.128000, - "Standard_D64_v4": 4.365000, - "Standard_D64_v5": 3.968000, - "Standard_D64a_v4": 3.968000, - "Standard_D64ads_v5": 4.288000, - "Standard_D64as_v4": 3.968000, - "Standard_D64as_v5": 3.584000, - "Standard_D64d_v4": 5.138000, - "Standard_D64d_v5": 4.672000, - "Standard_D64ds_v4": 5.138000, - "Standard_D64ds_v5": 4.672000, - "Standard_D64lds_v5": 3.904000, - "Standard_D64ls_v5": 3.424000, - "Standard_D64s_v3": 4.128000, - "Standard_D64s_v4": 4.365000, - "Standard_D64s_v5": 3.968000, - "Standard_D8_v3": 0.516000, - "Standard_D8_v4": 0.546000, - "Standard_D8_v5": 0.496000, - "Standard_D8a_v4": 0.496000, - "Standard_D8ads_v5": 0.536000, - "Standard_D8as_v4": 0.496000, - "Standard_D8as_v5": 0.448000, - "Standard_D8d_v4": 0.642000, - "Standard_D8d_v5": 0.584000, - "Standard_D8ds_v4": 0.642000, - "Standard_D8ds_v5": 0.584000, - "Standard_D8lds_v5": 0.488000, - "Standard_D8ls_v5": 0.428000, - "Standard_D8s_v3": 0.516000, - "Standard_D8s_v4": 0.546000, - "Standard_D8s_v5": 0.496000, - "Standard_D96_v5": 5.952000, - "Standard_D96a_v4": 5.952000, - "Standard_D96ads_v5": 6.432000, - "Standard_D96as_v4": 5.952000, - "Standard_D96as_v5": 5.376000, - "Standard_D96d_v5": 7.008000, - "Standard_D96ds_v5": 7.008000, - "Standard_D96lds_v5": 5.856000, - "Standard_D96ls_v5": 5.136000, - "Standard_D96s_v5": 5.952000, - "Standard_DC16ds_v3": 2.336000, - "Standard_DC16s_v3": 1.984000, - "Standard_DC1ds_v3": 0.146000, - "Standard_DC1s_v3": 0.124000, - "Standard_DC24ds_v3": 3.504000, - "Standard_DC24s_v3": 2.976000, - "Standard_DC2ds_v3": 0.292000, - "Standard_DC2s_v3": 0.248000, - "Standard_DC32ds_v3": 4.672000, - "Standard_DC32s_v3": 3.968000, - "Standard_DC48ds_v3": 7.008000, - "Standard_DC48s_v3": 5.952000, - "Standard_DC4ds_v3": 0.584000, - "Standard_DC4s_v3": 0.496000, - "Standard_DC8ds_v3": 1.168000, - "Standard_DC8s_v3": 0.992000, - "Standard_DS1": 0.096000, - "Standard_DS11": 0.210000, - "Standard_DS11-1_v2": 0.200000, - "Standard_DS11_v2": 0.200000, - "Standard_DS11_v2_Promo": 0.200000, - "Standard_DS12": 0.420000, - "Standard_DS12-1_v2": 0.399000, - "Standard_DS12-2_v2": 0.399000, - "Standard_DS12_v2": 0.399000, - "Standard_DS12_v2_Promo": 0.399000, - "Standard_DS13": 0.840000, - "Standard_DS13-2_v2": 0.798000, - "Standard_DS13-4_v2": 0.798000, - "Standard_DS13_v2": 0.798000, - "Standard_DS13_v2_Promo": 0.798000, - "Standard_DS14": 1.680000, - "Standard_DS14-4_v2": 1.596000, - "Standard_DS14-8_v2": 1.596000, - "Standard_DS14_v2": 1.596000, - "Standard_DS14_v2_Promo": 1.596000, - "Standard_DS15_v2": 1.995000, - "Standard_DS15i_v2": 1.995000, - "Standard_DS1_v2": 0.091000, - "Standard_DS2": 0.192000, - "Standard_DS2_v2": 0.182000, - "Standard_DS2_v2_Promo": 0.182000, - "Standard_DS3": 0.384000, - "Standard_DS3_v2": 0.365000, - "Standard_DS3_v2_Promo": 0.365000, - "Standard_DS4": 0.768000, - "Standard_DS4_v2": 0.729000, - "Standard_DS4_v2_Promo": 0.729000, - "Standard_DS5_v2": 1.459000, - "Standard_DS5_v2_Promo": 1.459000, - "Standard_E104i_v5": 8.694000, - "Standard_E104id_v5": 9.953000, - "Standard_E104ids_v5": 9.953000, - "Standard_E104is_v5": 8.694000, - "Standard_E112iads_v5": 9.794000, - "Standard_E112ias_v5": 8.439000, - "Standard_E112ibds_v5": 12.320000, - "Standard_E112ibs_v5": 10.965000, - "Standard_E16-4ads_v5": 1.272000, - "Standard_E16-4as_v4": 1.216000, - "Standard_E16-4as_v5": 1.096000, - "Standard_E16-4ds_v4": 1.529000, - "Standard_E16-4ds_v5": 1.392000, - "Standard_E16-4s_v3": 1.280000, - "Standard_E16-4s_v4": 1.338000, - "Standard_E16-4s_v5": 1.216000, - "Standard_E16-8ads_v5": 1.272000, - "Standard_E16-8as_v4": 1.216000, - "Standard_E16-8as_v5": 1.096000, - "Standard_E16-8ds_v4": 1.529000, - "Standard_E16-8ds_v5": 1.392000, - "Standard_E16-8s_v3": 1.280000, - "Standard_E16-8s_v4": 1.338000, - "Standard_E16-8s_v5": 1.216000, - "Standard_E16_v3": 1.280000, - "Standard_E16_v4": 1.338000, - "Standard_E16_v5": 1.216000, - "Standard_E16a_v4": 1.216000, - "Standard_E16ads_v5": 1.272000, - "Standard_E16as_v4": 1.216000, - "Standard_E16as_v5": 1.096000, - "Standard_E16bds_v5": 1.600000, - "Standard_E16bs_v5": 1.424000, - "Standard_E16d_v4": 1.529000, - "Standard_E16d_v5": 1.392000, - "Standard_E16ds_v4": 1.529000, - "Standard_E16ds_v5": 1.392000, - "Standard_E16s_v3": 1.280000, - "Standard_E16s_v4": 1.338000, - "Standard_E16s_v5": 1.216000, - "Standard_E20_v3": 1.600000, - "Standard_E20_v4": 1.672000, - "Standard_E20_v5": 1.520000, - "Standard_E20a_v4": 1.520000, - "Standard_E20ads_v5": 1.590000, - "Standard_E20as_v4": 1.520000, - "Standard_E20as_v5": 1.370000, - "Standard_E20d_v4": 1.911000, - "Standard_E20d_v5": 1.740000, - "Standard_E20ds_v4": 1.911000, - "Standard_E20ds_v5": 1.740000, - "Standard_E20s_v3": 1.600000, - "Standard_E20s_v4": 1.672000, - "Standard_E20s_v5": 1.520000, - "Standard_E2_v3": 0.160000, - "Standard_E2_v4": 0.167000, - "Standard_E2_v5": 0.152000, - "Standard_E2a_v4": 0.152000, - "Standard_E2ads_v5": 0.159000, - "Standard_E2as_v4": 0.152000, - "Standard_E2as_v5": 0.137000, - "Standard_E2bds_v5": 0.200000, - "Standard_E2bs_v5": 0.178000, - "Standard_E2d_v4": 0.191000, - "Standard_E2d_v5": 0.174000, - "Standard_E2ds_v4": 0.191000, - "Standard_E2ds_v5": 0.174000, - "Standard_E2s_v3": 0.160000, - "Standard_E2s_v4": 0.167000, - "Standard_E2s_v5": 0.152000, - "Standard_E32-16ads_v5": 2.544000, - "Standard_E32-16as_v4": 2.432000, - "Standard_E32-16as_v5": 2.192000, - "Standard_E32-16ds_v4": 3.057000, - "Standard_E32-16ds_v5": 2.784000, - "Standard_E32-16s_v3": 2.560000, - "Standard_E32-16s_v4": 2.675000, - "Standard_E32-16s_v5": 2.432000, - "Standard_E32-8ads_v5": 2.544000, - "Standard_E32-8as_v4": 2.432000, - "Standard_E32-8as_v5": 2.192000, - "Standard_E32-8ds_v4": 3.057000, - "Standard_E32-8ds_v5": 2.784000, - "Standard_E32-8s_v3": 2.560000, - "Standard_E32-8s_v4": 2.675000, - "Standard_E32-8s_v5": 2.432000, - "Standard_E32_v3": 2.560000, - "Standard_E32_v4": 2.675000, - "Standard_E32_v5": 2.432000, - "Standard_E32a_v4": 2.432000, - "Standard_E32ads_v5": 2.544000, - "Standard_E32as_v4": 2.432000, - "Standard_E32as_v5": 2.192000, - "Standard_E32bds_v5": 3.200000, - "Standard_E32bs_v5": 2.848000, - "Standard_E32d_v4": 3.057000, - "Standard_E32d_v5": 2.784000, - "Standard_E32ds_v4": 3.057000, - "Standard_E32ds_v5": 2.784000, - "Standard_E32s_v3": 2.560000, - "Standard_E32s_v4": 2.675000, - "Standard_E32s_v5": 2.432000, - "Standard_E4-2ads_v5": 0.318000, - "Standard_E4-2as_v4": 0.304000, - "Standard_E4-2as_v5": 0.274000, - "Standard_E4-2ds_v4": 0.382000, - "Standard_E4-2ds_v5": 0.348000, - "Standard_E4-2s_v3": 0.320000, - "Standard_E4-2s_v4": 0.334000, - "Standard_E4-2s_v5": 0.304000, - "Standard_E48_v3": 3.840000, - "Standard_E48_v4": 4.013000, - "Standard_E48_v5": 3.648000, - "Standard_E48a_v4": 3.648000, - "Standard_E48ads_v5": 3.816000, - "Standard_E48as_v4": 3.648000, - "Standard_E48as_v5": 3.288000, - "Standard_E48bds_v5": 4.800000, - "Standard_E48bs_v5": 4.272000, - "Standard_E48d_v4": 4.586000, - "Standard_E48d_v5": 4.176000, - "Standard_E48ds_v4": 4.586000, - "Standard_E48ds_v5": 4.176000, - "Standard_E48s_v3": 3.840000, - "Standard_E48s_v4": 4.013000, - "Standard_E48s_v5": 3.648000, - "Standard_E4_v3": 0.320000, - "Standard_E4_v4": 0.334000, - "Standard_E4_v5": 0.304000, - "Standard_E4a_v4": 0.304000, - "Standard_E4ads_v5": 0.318000, - "Standard_E4as_v4": 0.304000, - "Standard_E4as_v5": 0.274000, - "Standard_E4bds_v5": 0.400000, - "Standard_E4bs_v5": 0.356000, - "Standard_E4d_v4": 0.382000, - "Standard_E4d_v5": 0.348000, - "Standard_E4ds_v4": 0.382000, - "Standard_E4ds_v5": 0.348000, - "Standard_E4s_v3": 0.320000, - "Standard_E4s_v4": 0.334000, - "Standard_E4s_v5": 0.304000, - "Standard_E64-16ads_v5": 5.088000, - "Standard_E64-16as_v4": 4.864000, - "Standard_E64-16as_v5": 4.384000, - "Standard_E64-16ds_v4": 6.115000, - "Standard_E64-16ds_v5": 5.568000, - "Standard_E64-16s_v3": 4.609000, - "Standard_E64-16s_v4": 5.350000, - "Standard_E64-16s_v5": 4.864000, - "Standard_E64-32ads_v5": 5.088000, - "Standard_E64-32as_v4": 4.864000, - "Standard_E64-32as_v5": 4.384000, - "Standard_E64-32ds_v4": 6.115000, - "Standard_E64-32ds_v5": 5.568000, - "Standard_E64-32s_v3": 4.609000, - "Standard_E64-32s_v4": 5.350000, - "Standard_E64-32s_v5": 4.864000, - "Standard_E64_v3": 4.609000, - "Standard_E64_v4": 5.350000, - "Standard_E64_v5": 4.864000, - "Standard_E64a_v4": 4.864000, - "Standard_E64ads_v5": 5.088000, - "Standard_E64as_v4": 4.864000, - "Standard_E64as_v5": 4.384000, - "Standard_E64bds_v5": 6.400000, - "Standard_E64bs_v5": 5.696000, - "Standard_E64d_v4": 6.115000, - "Standard_E64d_v5": 5.568000, - "Standard_E64ds_v4": 6.115000, - "Standard_E64ds_v5": 5.568000, - "Standard_E64i_v3": 4.609000, - "Standard_E64is_v3": 4.609000, - "Standard_E64s_v3": 4.609000, - "Standard_E64s_v4": 5.350000, - "Standard_E64s_v5": 4.864000, - "Standard_E8-2ads_v5": 0.636000, - "Standard_E8-2as_v4": 0.608000, - "Standard_E8-2as_v5": 0.548000, - "Standard_E8-2ds_v4": 0.764000, - "Standard_E8-2ds_v5": 0.696000, - "Standard_E8-2s_v3": 0.640000, - "Standard_E8-2s_v4": 0.669000, - "Standard_E8-2s_v5": 0.608000, - "Standard_E8-4ads_v5": 0.636000, - "Standard_E8-4as_v4": 0.608000, - "Standard_E8-4as_v5": 0.548000, - "Standard_E8-4ds_v4": 0.764000, - "Standard_E8-4ds_v5": 0.696000, - "Standard_E8-4s_v3": 0.640000, - "Standard_E8-4s_v4": 0.669000, - "Standard_E8-4s_v5": 0.608000, - "Standard_E80ids_v4": 7.644000, - "Standard_E80is_v4": 6.688000, - "Standard_E8_v3": 0.640000, - "Standard_E8_v4": 0.669000, - "Standard_E8_v5": 0.608000, - "Standard_E8a_v4": 0.608000, - "Standard_E8ads_v5": 0.636000, - "Standard_E8as_v4": 0.608000, - "Standard_E8as_v5": 0.548000, - "Standard_E8bds_v5": 0.800000, - "Standard_E8bs_v5": 0.712000, - "Standard_E8d_v4": 0.764000, - "Standard_E8d_v5": 0.696000, - "Standard_E8ds_v4": 0.764000, - "Standard_E8ds_v5": 0.696000, - "Standard_E8s_v3": 0.640000, - "Standard_E8s_v4": 0.669000, - "Standard_E8s_v5": 0.608000, - "Standard_E96-24ads_v5": 7.632000, - "Standard_E96-24as_v4": 7.296000, - "Standard_E96-24as_v5": 6.576000, - "Standard_E96-24ds_v5": 8.352000, - "Standard_E96-24s_v5": 7.296000, - "Standard_E96-48ads_v5": 7.632000, - "Standard_E96-48as_v4": 7.296000, - "Standard_E96-48as_v5": 6.576000, - "Standard_E96-48ds_v5": 8.352000, - "Standard_E96-48s_v5": 7.296000, - "Standard_E96_v5": 7.296000, - "Standard_E96a_v4": 7.296000, - "Standard_E96ads_v5": 7.632000, - "Standard_E96as_v4": 7.296000, - "Standard_E96as_v5": 6.576000, - "Standard_E96bds_v5": 9.600000, - "Standard_E96bs_v5": 8.544000, - "Standard_E96d_v5": 8.352000, - "Standard_E96ds_v5": 8.352000, - "Standard_E96iads_v5": 8.395000, - "Standard_E96ias_v4": 7.296000, - "Standard_E96ias_v5": 7.234000, - "Standard_E96s_v5": 7.296000, - "Standard_F1": 0.063000, - "Standard_F16": 1.008000, - "Standard_F16s": 1.008000, - "Standard_F16s_v2": 0.938000, - "Standard_F1s": 0.063000, - "Standard_F2": 0.126000, - "Standard_F2s": 0.126000, - "Standard_F2s_v2": 0.117000, - "Standard_F32s_v2": 1.877000, - "Standard_F4": 0.252000, - "Standard_F48s_v2": 2.815000, - "Standard_F4s": 0.252000, - "Standard_F4s_v2": 0.235000, - "Standard_F64s_v2": 3.754000, - "Standard_F72s_v2": 4.223000, - "Standard_F8": 0.504000, - "Standard_F8s": 0.504000, - "Standard_F8s_v2": 0.469000, - "Standard_L16as_v3": 1.464000, - "Standard_L16s_v3": 1.636000, - "Standard_L32as_v3": 2.928000, - "Standard_L32s_v3": 3.272000, - "Standard_L48as_v3": 4.392000, - "Standard_L48s_v3": 4.908000, - "Standard_L64as_v3": 5.856000, - "Standard_L64s_v3": 6.544000, - "Standard_L80as_v3": 7.320000, - "Standard_L80s_v3": 8.180000, - "Standard_L8as_v3": 0.732000, - "Standard_L8s_v3": 0.818000, - "Standard_M128": 19.340000, - "Standard_M128-32ms": 38.698000, - "Standard_M128-64ms": 38.698000, - "Standard_M128dms_v2": 38.701000, - "Standard_M128ds_v2": 19.343000, - "Standard_M128m": 38.698000, - "Standard_M128ms": 38.698000, - "Standard_M128ms_v2": 38.090000, - "Standard_M128s": 19.340000, - "Standard_M128s_v2": 18.733000, - "Standard_M16-4ms": 4.455900, - "Standard_M16-8ms": 4.455900, - "Standard_M16ms": 4.455900, - "Standard_M16s": 3.461000, - "Standard_M192idms_v2": 46.493000, - "Standard_M192ids_v2": 23.246000, - "Standard_M192ims_v2": 45.882000, - "Standard_M192is_v2": 22.636000, - "Standard_M208-104ms_v2": 69.161000, - "Standard_M208-104s_v2": 34.580000, - "Standard_M208-52ms_v2": 69.161000, - "Standard_M208-52s_v2": 34.580000, - "Standard_M208ms_v2": 69.161000, - "Standard_M208s_v2": 34.580000, - "Standard_M32-16ms": 8.911700, - "Standard_M32-8ms": 8.911700, - "Standard_M32dms_v2": 8.912000, - "Standard_M32ls": 3.447600, - "Standard_M32ms": 8.911700, - "Standard_M32ms_v2": 8.759000, - "Standard_M32s": 4.835800, - "Standard_M32ts": 3.248000, - "Standard_M416-104ms_v2": 153.680000, - "Standard_M416-104s_v2": 76.849000, - "Standard_M416-208ms_v2": 153.680000, - "Standard_M416-208s_v2": 76.849000, - "Standard_M416is_v2": 76.849000, - "Standard_M416ms_v2": 153.680000, - "Standard_M416s_8_v2": 102.470000, - "Standard_M416s_v2": 76.849000, - "Standard_M64": 9.670000, - "Standard_M64-16ms": 14.989000, - "Standard_M64-32ms": 14.989000, - "Standard_M64dms_v2": 14.993000, - "Standard_M64ds_v2": 9.670000, - "Standard_M64ls": 6.498000, - "Standard_M64m": 14.989000, - "Standard_M64ms": 14.989000, - "Standard_M64ms_v2": 14.688000, - "Standard_M64s": 9.670000, - "Standard_M64s_v2": 9.365000, - "Standard_M8-2ms": 2.227900, - "Standard_M8-4ms": 2.227900, - "Standard_M8ms": 2.227900, - "Standard_ND96ams_A100_v4": 50.794000, - "Standard_ND96amsr_A100_v4": 50.794000, - } - // jioindiacentral - initialOnDemandPrices["jioindiacentral"] = map[string]float64{ - "Dadsv5_Type1": 4.133000, - "Dasv4_Type1": 5.333000, - "Dasv4_Type2": 5.333000, - "Dasv5_Type1": 3.422000, - "Dsv3_Type3": 4.445000, - "Dsv5_Type1": 5.555000, - "Easv4_Type1": 6.864000, - "Easv4_Type2": 6.864000, - "Easv5_Type1": 3.775000, - "Ebdsv5-Type1": 6.195000, - "Ebsv5-Type1": 5.456000, - "Esv3_Type3": 4.506000, - "Esv3_Type4": 6.105000, - "Lasv3_Type1": 7.788000, - "Lsv3_Type1": 8.712000, - "Standard_A1_v2": 0.047000, - "Standard_A2_v2": 0.098000, - "Standard_A2m_v2": 0.158000, - "Standard_A4_v2": 0.206000, - "Standard_A4m_v2": 0.333000, - "Standard_A8_v2": 0.433000, - "Standard_A8m_v2": 0.699000, - "Standard_B12ms": 0.538000, - "Standard_B16als_v2": 0.422000, - "Standard_B16as_v2": 0.467000, - "Standard_B16ls_v2": 0.635000, - "Standard_B16ms": 0.717000, - "Standard_B16s_v2": 0.790000, - "Standard_B1ls": 0.005600, - "Standard_B1ms": 0.022400, - "Standard_B1s": 0.011200, - "Standard_B20ms": 0.896000, - "Standard_B2als_v2": 0.024600, - "Standard_B2as_v2": 0.049200, - "Standard_B2ats_v2": 0.006150, - "Standard_B2ls_v2": 0.054000, - "Standard_B2ms": 0.089600, - "Standard_B2s": 0.044800, - "Standard_B2s_v2": 0.089600, - "Standard_B2ts_v2": 0.020400, - "Standard_B32als_v2": 0.844000, - "Standard_B32as_v2": 0.787000, - "Standard_B32ls_v2": 1.417000, - "Standard_B32s_v2": 1.581000, - "Standard_B4als_v2": 0.087200, - "Standard_B4as_v2": 0.098400, - "Standard_B4ls_v2": 0.177000, - "Standard_B4ms": 0.179000, - "Standard_B4s_v2": 0.179000, - "Standard_B8als_v2": 0.174000, - "Standard_B8as_v2": 0.197000, - "Standard_B8ls_v2": 0.354000, - "Standard_B8ms": 0.358000, - "Standard_B8s_v2": 0.358000, - "Standard_D11_v2": 0.189000, - "Standard_D12_v2": 0.379000, - "Standard_D13_v2": 0.758000, - "Standard_D14_v2": 1.516000, - "Standard_D15_v2": 1.895000, - "Standard_D15i_v2": 1.895000, - "Standard_D16_v3": 0.840000, - "Standard_D16a_v4": 0.493000, - "Standard_D16ads_v5": 0.537000, - "Standard_D16as_v4": 0.493000, - "Standard_D16as_v5": 0.444000, - "Standard_D16lds_v5": 0.792000, - "Standard_D16ls_v5": 0.680000, - "Standard_D16s_v3": 0.840000, - "Standard_D1_v2": 0.084000, - "Standard_D2_v2": 0.169000, - "Standard_D2_v3": 0.105000, - "Standard_D2a_v4": 0.062200, - "Standard_D2ads_v5": 0.067100, - "Standard_D2as_v4": 0.062200, - "Standard_D2as_v5": 0.055600, - "Standard_D2lds_v5": 0.099000, - "Standard_D2ls_v5": 0.085000, - "Standard_D2s_v3": 0.105000, - "Standard_D32-16s_v3": 1.680000, - "Standard_D32-8s_v3": 1.680000, - "Standard_D32_v3": 1.680000, - "Standard_D32a_v4": 0.987000, - "Standard_D32ads_v5": 1.074000, - "Standard_D32as_v4": 0.987000, - "Standard_D32as_v5": 0.889000, - "Standard_D32lds_v5": 1.584000, - "Standard_D32ls_v5": 1.360000, - "Standard_D32s_v3": 1.680000, - "Standard_D3_v2": 0.337000, - "Standard_D48_v3": 2.520000, - "Standard_D48a_v4": 1.481000, - "Standard_D48ads_v5": 1.610000, - "Standard_D48as_v4": 1.481000, - "Standard_D48as_v5": 1.333000, - "Standard_D48lds_v5": 2.376000, - "Standard_D48ls_v5": 2.040000, - "Standard_D48s_v3": 2.520000, - "Standard_D4_v2": 0.675000, - "Standard_D4_v3": 0.210000, - "Standard_D4a_v4": 0.123000, - "Standard_D4ads_v5": 0.134000, - "Standard_D4as_v4": 0.123000, - "Standard_D4as_v5": 0.111000, - "Standard_D4lds_v5": 0.198000, - "Standard_D4ls_v5": 0.170000, - "Standard_D4s_v3": 0.210000, - "Standard_D5_v2": 1.350000, - "Standard_D64-16s_v3": 3.360000, - "Standard_D64-32s_v3": 3.360000, - "Standard_D64_v3": 3.360000, - "Standard_D64a_v4": 1.975000, - "Standard_D64ads_v5": 2.147000, - "Standard_D64as_v4": 1.975000, - "Standard_D64as_v5": 1.778000, - "Standard_D64lds_v5": 3.168000, - "Standard_D64ls_v5": 2.720000, - "Standard_D64s_v3": 3.360000, - "Standard_D8_v3": 0.420000, - "Standard_D8a_v4": 0.246000, - "Standard_D8ads_v5": 0.268000, - "Standard_D8as_v4": 0.246000, - "Standard_D8as_v5": 0.222000, - "Standard_D8lds_v5": 0.396000, - "Standard_D8ls_v5": 0.340000, - "Standard_D8s_v3": 0.420000, - "Standard_D96a_v4": 2.962000, - "Standard_D96ads_v5": 3.221000, - "Standard_D96as_v4": 2.962000, - "Standard_D96as_v5": 2.666000, - "Standard_D96lds_v5": 4.752000, - "Standard_D96ls_v5": 4.080000, - "Standard_DS11-1_v2": 0.189000, - "Standard_DS11_v2": 0.189000, - "Standard_DS12-1_v2": 0.379000, - "Standard_DS12-2_v2": 0.379000, - "Standard_DS12_v2": 0.379000, - "Standard_DS13-2_v2": 0.758000, - "Standard_DS13-4_v2": 0.758000, - "Standard_DS13_v2": 0.758000, - "Standard_DS14-4_v2": 1.516000, - "Standard_DS14-8_v2": 1.516000, - "Standard_DS14_v2": 1.516000, - "Standard_DS15_v2": 1.895000, - "Standard_DS15i_v2": 1.895000, - "Standard_DS1_v2": 0.084000, - "Standard_DS2_v2": 0.169000, - "Standard_DS3_v2": 0.337000, - "Standard_DS4_v2": 0.675000, - "Standard_DS5_v2": 1.350000, - "Standard_E112iads_v5": 5.116000, - "Standard_E112ias_v5": 4.404000, - "Standard_E112ibds_v5": 10.842000, - "Standard_E112ibs_v5": 9.548000, - "Standard_E16-4ads_v5": 0.664000, - "Standard_E16-4as_v4": 1.040000, - "Standard_E16-4as_v5": 0.572000, - "Standard_E16-4s_v3": 1.096000, - "Standard_E16-8ads_v5": 0.664000, - "Standard_E16-8as_v4": 1.040000, - "Standard_E16-8as_v5": 0.572000, - "Standard_E16-8s_v3": 1.096000, - "Standard_E16_v3": 1.096000, - "Standard_E16a_v4": 0.635000, - "Standard_E16ads_v5": 0.664000, - "Standard_E16as_v4": 0.635000, - "Standard_E16as_v5": 0.572000, - "Standard_E16bds_v5": 1.408000, - "Standard_E16bs_v5": 1.240000, - "Standard_E16s_v3": 1.096000, - "Standard_E20_v3": 1.370000, - "Standard_E20a_v4": 0.794000, - "Standard_E20ads_v5": 0.830000, - "Standard_E20as_v4": 0.794000, - "Standard_E20as_v5": 0.715000, - "Standard_E20s_v3": 1.370000, - "Standard_E2_v3": 0.137000, - "Standard_E2a_v4": 0.080000, - "Standard_E2ads_v5": 0.083000, - "Standard_E2as_v4": 0.080000, - "Standard_E2as_v5": 0.071500, - "Standard_E2bds_v5": 0.176000, - "Standard_E2bs_v5": 0.155000, - "Standard_E2s_v3": 0.137000, - "Standard_E32-16ads_v5": 1.329000, - "Standard_E32-16as_v4": 2.080000, - "Standard_E32-16as_v5": 1.144000, - "Standard_E32-16s_v3": 2.192000, - "Standard_E32-8ads_v5": 1.329000, - "Standard_E32-8as_v4": 2.080000, - "Standard_E32-8as_v5": 1.144000, - "Standard_E32-8s_v3": 2.192000, - "Standard_E32_v3": 2.192000, - "Standard_E32a_v4": 1.271000, - "Standard_E32ads_v5": 1.329000, - "Standard_E32as_v4": 1.271000, - "Standard_E32as_v5": 1.144000, - "Standard_E32bds_v5": 2.816000, - "Standard_E32bs_v5": 2.480000, - "Standard_E32s_v3": 2.192000, - "Standard_E4-2ads_v5": 0.166000, - "Standard_E4-2as_v4": 0.260000, - "Standard_E4-2as_v5": 0.143000, - "Standard_E4-2s_v3": 0.274000, - "Standard_E48_v3": 3.281000, - "Standard_E48a_v4": 1.906000, - "Standard_E48ads_v5": 1.993000, - "Standard_E48as_v4": 1.906000, - "Standard_E48as_v5": 1.716000, - "Standard_E48bds_v5": 4.224000, - "Standard_E48bs_v5": 3.720000, - "Standard_E48s_v3": 3.281000, - "Standard_E4_v3": 0.274000, - "Standard_E4a_v4": 0.158000, - "Standard_E4ads_v5": 0.166000, - "Standard_E4as_v4": 0.158000, - "Standard_E4as_v5": 0.143000, - "Standard_E4bds_v5": 0.352000, - "Standard_E4bs_v5": 0.310000, - "Standard_E4s_v3": 0.274000, - "Standard_E64-16ads_v5": 2.658000, - "Standard_E64-16as_v4": 4.160000, - "Standard_E64-16as_v5": 2.288000, - "Standard_E64-16s_v3": 3.937000, - "Standard_E64-32ads_v5": 2.658000, - "Standard_E64-32as_v4": 4.160000, - "Standard_E64-32as_v5": 2.288000, - "Standard_E64-32s_v3": 3.937000, - "Standard_E64_v3": 3.937000, - "Standard_E64a_v4": 2.542000, - "Standard_E64ads_v5": 2.658000, - "Standard_E64as_v4": 2.542000, - "Standard_E64as_v5": 2.288000, - "Standard_E64bds_v5": 5.632000, - "Standard_E64bs_v5": 4.960000, - "Standard_E64s_v3": 3.937000, - "Standard_E8-2ads_v5": 0.332000, - "Standard_E8-2as_v4": 0.520000, - "Standard_E8-2as_v5": 0.286000, - "Standard_E8-2s_v3": 0.548000, - "Standard_E8-4ads_v5": 0.332000, - "Standard_E8-4as_v4": 0.520000, - "Standard_E8-4as_v5": 0.286000, - "Standard_E8-4s_v3": 0.548000, - "Standard_E8_v3": 0.548000, - "Standard_E8a_v4": 0.317000, - "Standard_E8ads_v5": 0.332000, - "Standard_E8as_v4": 0.317000, - "Standard_E8as_v5": 0.286000, - "Standard_E8bds_v5": 0.704000, - "Standard_E8bs_v5": 0.620000, - "Standard_E8s_v3": 0.548000, - "Standard_E96-24ads_v5": 3.986000, - "Standard_E96-24as_v4": 6.240000, - "Standard_E96-24as_v5": 3.432000, - "Standard_E96-48ads_v5": 3.986000, - "Standard_E96-48as_v4": 6.240000, - "Standard_E96-48as_v5": 3.432000, - "Standard_E96a_v4": 3.813000, - "Standard_E96ads_v5": 3.986000, - "Standard_E96as_v4": 3.813000, - "Standard_E96as_v5": 3.432000, - "Standard_E96bds_v5": 8.448000, - "Standard_E96bs_v5": 7.440000, - "Standard_E96iads_v5": 4.385000, - "Standard_E96ias_v4": 6.240000, - "Standard_E96ias_v5": 3.775000, - "Standard_F1": 0.049000, - "Standard_F16": 0.790000, - "Standard_F16s": 0.790000, - "Standard_F1s": 0.049000, - "Standard_F2": 0.098800, - "Standard_F2s": 0.098800, - "Standard_F4": 0.198000, - "Standard_F4s": 0.198000, - "Standard_F8": 0.395000, - "Standard_F8s": 0.395000, - "Standard_L16as_v3": 1.416000, - "Standard_L16s_v3": 1.584000, - "Standard_L32as_v3": 2.832000, - "Standard_L32s_v3": 3.168000, - "Standard_L48as_v3": 4.248000, - "Standard_L48s_v3": 4.752000, - "Standard_L64as_v3": 5.664000, - "Standard_L64s_v3": 6.336000, - "Standard_L80as_v3": 7.080000, - "Standard_L80s_v3": 7.920000, - "Standard_L8as_v3": 0.708000, - "Standard_L8s_v3": 0.792000, - } - // jioindiawest - initialOnDemandPrices["jioindiawest"] = map[string]float64{ - "Dadsv5_Type1": 4.133000, - "Dasv4_Type1": 5.333000, - "Dasv4_Type2": 5.333000, - "Dasv5_Type1": 3.422000, - "Dsv3_Type3": 4.445000, - "Dsv5_Type1": 5.555000, - "Eadsv5_Type1": 4.385000, - "Easv4_Type1": 6.864000, - "Easv4_Type2": 6.864000, - "Easv5_Type1": 3.775000, - "Ebdsv5-Type1": 6.195000, - "Ebsv5-Type1": 5.456000, - "Esv3_Type3": 4.506000, - "Esv3_Type4": 6.105000, - "Fsv2 Type3": 3.927000, - "Fsv2_Type2": 3.366000, - "Fsv2_Type4": 5.142000, - "Lasv3_Type1": 7.788000, - "Lsv3_Type1": 8.712000, - "Standard_A1_v2": 0.047000, - "Standard_A2_v2": 0.098000, - "Standard_A2m_v2": 0.158000, - "Standard_A4_v2": 0.206000, - "Standard_A4m_v2": 0.333000, - "Standard_A8_v2": 0.433000, - "Standard_A8m_v2": 0.699000, - "Standard_B12ms": 0.538000, - "Standard_B16als_v2": 0.349000, - "Standard_B16as_v2": 0.394000, - "Standard_B16ls_v2": 0.708000, - "Standard_B16ms": 0.717000, - "Standard_B16s_v2": 0.790000, - "Standard_B1ls": 0.005600, - "Standard_B1ms": 0.022400, - "Standard_B1s": 0.011200, - "Standard_B20ms": 0.896000, - "Standard_B2als_v2": 0.024600, - "Standard_B2as_v2": 0.058400, - "Standard_B2ats_v2": 0.015400, - "Standard_B2ls_v2": 0.054000, - "Standard_B2ms": 0.089600, - "Standard_B2s": 0.044800, - "Standard_B2s_v2": 0.098800, - "Standard_B2ts_v2": 0.020400, - "Standard_B32als_v2": 0.844000, - "Standard_B32as_v2": 0.787000, - "Standard_B32ls_v2": 1.269000, - "Standard_B32s_v2": 1.434000, - "Standard_B4als_v2": 0.087200, - "Standard_B4as_v2": 0.098400, - "Standard_B4ls_v2": 0.159000, - "Standard_B4ms": 0.179000, - "Standard_B4s_v2": 0.198000, - "Standard_B8als_v2": 0.174000, - "Standard_B8as_v2": 0.197000, - "Standard_B8ls_v2": 0.354000, - "Standard_B8ms": 0.358000, - "Standard_B8s_v2": 0.358000, - "Standard_D11_v2": 0.189000, - "Standard_D12_v2": 0.379000, - "Standard_D13_v2": 0.758000, - "Standard_D14_v2": 1.516000, - "Standard_D14_v2_Promo": 1.516000, - "Standard_D15_v2": 1.895000, - "Standard_D15i_v2": 1.895000, - "Standard_D16_v3": 0.840000, - "Standard_D16a_v4": 0.493000, - "Standard_D16ads_v5": 0.537000, - "Standard_D16as_v4": 0.493000, - "Standard_D16as_v5": 0.444000, - "Standard_D16lds_v5": 0.792000, - "Standard_D16ls_v5": 0.680000, - "Standard_D16s_v3": 0.840000, - "Standard_D1_v2": 0.084000, - "Standard_D2_v2": 0.169000, - "Standard_D2_v3": 0.105000, - "Standard_D2a_v4": 0.062200, - "Standard_D2ads_v5": 0.067100, - "Standard_D2as_v4": 0.062200, - "Standard_D2as_v5": 0.055600, - "Standard_D2lds_v5": 0.099000, - "Standard_D2ls_v5": 0.085000, - "Standard_D2s_v3": 0.105000, - "Standard_D32-16s_v3": 1.680000, - "Standard_D32-8s_v3": 1.680000, - "Standard_D32_v3": 1.680000, - "Standard_D32a_v4": 0.987000, - "Standard_D32ads_v5": 1.074000, - "Standard_D32as_v4": 0.987000, - "Standard_D32as_v5": 0.889000, - "Standard_D32lds_v5": 1.584000, - "Standard_D32ls_v5": 1.360000, - "Standard_D32s_v3": 1.680000, - "Standard_D3_v2": 0.337000, - "Standard_D48_v3": 2.520000, - "Standard_D48a_v4": 1.481000, - "Standard_D48ads_v5": 1.610000, - "Standard_D48as_v4": 1.481000, - "Standard_D48as_v5": 1.333000, - "Standard_D48lds_v5": 2.376000, - "Standard_D48ls_v5": 2.040000, - "Standard_D48s_v3": 2.520000, - "Standard_D4_v2": 0.675000, - "Standard_D4_v3": 0.210000, - "Standard_D4a_v4": 0.123000, - "Standard_D4ads_v5": 0.134000, - "Standard_D4as_v4": 0.123000, - "Standard_D4as_v5": 0.111000, - "Standard_D4lds_v5": 0.198000, - "Standard_D4ls_v5": 0.170000, - "Standard_D4s_v3": 0.210000, - "Standard_D5_v2": 1.350000, - "Standard_D5_v2_Promo": 1.350000, - "Standard_D64-16s_v3": 3.360000, - "Standard_D64-32s_v3": 3.360000, - "Standard_D64_v3": 3.360000, - "Standard_D64a_v4": 1.975000, - "Standard_D64ads_v5": 2.147000, - "Standard_D64as_v4": 1.975000, - "Standard_D64as_v5": 1.778000, - "Standard_D64lds_v5": 3.168000, - "Standard_D64ls_v5": 2.720000, - "Standard_D64s_v3": 3.360000, - "Standard_D8_v3": 0.420000, - "Standard_D8a_v4": 0.246000, - "Standard_D8ads_v5": 0.268000, - "Standard_D8as_v4": 0.246000, - "Standard_D8as_v5": 0.222000, - "Standard_D8lds_v5": 0.396000, - "Standard_D8ls_v5": 0.340000, - "Standard_D8s_v3": 0.420000, - "Standard_D96a_v4": 2.962000, - "Standard_D96ads_v5": 3.221000, - "Standard_D96as_v4": 2.962000, - "Standard_D96as_v5": 2.666000, - "Standard_D96lds_v5": 4.752000, - "Standard_D96ls_v5": 4.080000, - "Standard_DS11-1_v2": 0.189000, - "Standard_DS11_v2": 0.189000, - "Standard_DS12-1_v2": 0.379000, - "Standard_DS12-2_v2": 0.379000, - "Standard_DS12_v2": 0.379000, - "Standard_DS13-2_v2": 0.758000, - "Standard_DS13-4_v2": 0.758000, - "Standard_DS13_v2": 0.758000, - "Standard_DS14-4_v2": 1.516000, - "Standard_DS14-8_v2": 1.516000, - "Standard_DS14_v2": 1.516000, - "Standard_DS14_v2_Promo": 1.516000, - "Standard_DS15_v2": 1.895000, - "Standard_DS15i_v2": 1.895000, - "Standard_DS1_v2": 0.084000, - "Standard_DS2_v2": 0.169000, - "Standard_DS3_v2": 0.337000, - "Standard_DS4_v2": 0.675000, - "Standard_DS5_v2": 1.350000, - "Standard_DS5_v2_Promo": 1.350000, - "Standard_E112iads_v5": 5.116000, - "Standard_E112ias_v5": 4.404000, - "Standard_E112ibds_v5": 10.842000, - "Standard_E112ibs_v5": 9.548000, - "Standard_E16-4ads_v5": 0.664000, - "Standard_E16-4as_v4": 1.040000, - "Standard_E16-4as_v5": 0.572000, - "Standard_E16-4s_v3": 1.096000, - "Standard_E16-8ads_v5": 0.664000, - "Standard_E16-8as_v4": 1.040000, - "Standard_E16-8as_v5": 0.572000, - "Standard_E16-8s_v3": 1.096000, - "Standard_E16_v3": 1.096000, - "Standard_E16a_v4": 0.635000, - "Standard_E16ads_v5": 0.664000, - "Standard_E16as_v4": 0.635000, - "Standard_E16as_v5": 0.572000, - "Standard_E16bds_v5": 1.408000, - "Standard_E16bs_v5": 1.240000, - "Standard_E16ds_v5": 0.604000, - "Standard_E16s_v3": 1.096000, - "Standard_E16s_v5": 0.520000, - "Standard_E20_v3": 1.370000, - "Standard_E20a_v4": 0.794000, - "Standard_E20ads_v5": 0.830000, - "Standard_E20as_v4": 0.794000, - "Standard_E20as_v5": 0.715000, - "Standard_E20ds_v5": 0.755000, - "Standard_E20s_v3": 1.370000, - "Standard_E20s_v5": 0.650000, - "Standard_E2_v3": 0.137000, - "Standard_E2a_v4": 0.080000, - "Standard_E2ads_v5": 0.083000, - "Standard_E2as_v4": 0.080000, - "Standard_E2as_v5": 0.071500, - "Standard_E2bds_v5": 0.176000, - "Standard_E2bs_v5": 0.155000, - "Standard_E2ds_v5": 0.075500, - "Standard_E2s_v3": 0.137000, - "Standard_E2s_v5": 0.065000, - "Standard_E32-16ads_v5": 1.329000, - "Standard_E32-16as_v4": 2.080000, - "Standard_E32-16as_v5": 1.144000, - "Standard_E32-16s_v3": 2.192000, - "Standard_E32-8ads_v5": 1.329000, - "Standard_E32-8as_v4": 2.080000, - "Standard_E32-8as_v5": 1.144000, - "Standard_E32-8s_v3": 2.192000, - "Standard_E32_v3": 2.192000, - "Standard_E32a_v4": 1.271000, - "Standard_E32ads_v5": 1.329000, - "Standard_E32as_v4": 1.271000, - "Standard_E32as_v5": 1.144000, - "Standard_E32bds_v5": 2.816000, - "Standard_E32bs_v5": 2.480000, - "Standard_E32ds_v5": 1.208000, - "Standard_E32s_v3": 2.192000, - "Standard_E32s_v5": 1.040000, - "Standard_E4-2ads_v5": 0.166000, - "Standard_E4-2as_v4": 0.260000, - "Standard_E4-2as_v5": 0.143000, - "Standard_E4-2s_v3": 0.274000, - "Standard_E48_v3": 3.281000, - "Standard_E48a_v4": 1.906000, - "Standard_E48ads_v5": 1.993000, - "Standard_E48as_v4": 1.906000, - "Standard_E48as_v5": 1.716000, - "Standard_E48bds_v5": 4.224000, - "Standard_E48bs_v5": 3.720000, - "Standard_E48ds_v5": 1.812000, - "Standard_E48s_v3": 3.281000, - "Standard_E48s_v5": 1.560000, - "Standard_E4_v3": 0.274000, - "Standard_E4a_v4": 0.158000, - "Standard_E4ads_v5": 0.166000, - "Standard_E4as_v4": 0.158000, - "Standard_E4as_v5": 0.143000, - "Standard_E4bds_v5": 0.352000, - "Standard_E4bs_v5": 0.310000, - "Standard_E4ds_v5": 0.151000, - "Standard_E4s_v3": 0.274000, - "Standard_E4s_v5": 0.130000, - "Standard_E64-16ads_v5": 2.658000, - "Standard_E64-16as_v4": 4.160000, - "Standard_E64-16as_v5": 2.288000, - "Standard_E64-16s_v3": 3.937000, - "Standard_E64-32ads_v5": 2.658000, - "Standard_E64-32as_v4": 4.160000, - "Standard_E64-32as_v5": 2.288000, - "Standard_E64-32s_v3": 3.937000, - "Standard_E64_v3": 3.937000, - "Standard_E64a_v4": 2.542000, - "Standard_E64ads_v5": 2.658000, - "Standard_E64as_v4": 2.542000, - "Standard_E64as_v5": 2.288000, - "Standard_E64bds_v5": 5.632000, - "Standard_E64bs_v5": 4.960000, - "Standard_E64ds_v5": 2.416000, - "Standard_E64s_v3": 3.937000, - "Standard_E64s_v5": 2.080000, - "Standard_E8-2ads_v5": 0.332000, - "Standard_E8-2as_v4": 0.520000, - "Standard_E8-2as_v5": 0.286000, - "Standard_E8-2s_v3": 0.548000, - "Standard_E8-4ads_v5": 0.332000, - "Standard_E8-4as_v4": 0.520000, - "Standard_E8-4as_v5": 0.286000, - "Standard_E8-4s_v3": 0.548000, - "Standard_E8_v3": 0.548000, - "Standard_E8a_v4": 0.317000, - "Standard_E8ads_v5": 0.332000, - "Standard_E8as_v4": 0.317000, - "Standard_E8as_v5": 0.286000, - "Standard_E8bds_v5": 0.704000, - "Standard_E8bs_v5": 0.620000, - "Standard_E8ds_v5": 0.302000, - "Standard_E8s_v3": 0.548000, - "Standard_E8s_v5": 0.260000, - "Standard_E96-24ads_v5": 3.986000, - "Standard_E96-24as_v4": 6.240000, - "Standard_E96-24as_v5": 3.432000, - "Standard_E96-48ads_v5": 3.986000, - "Standard_E96-48as_v4": 6.240000, - "Standard_E96-48as_v5": 3.432000, - "Standard_E96a_v4": 3.813000, - "Standard_E96ads_v5": 3.986000, - "Standard_E96as_v4": 3.813000, - "Standard_E96as_v5": 3.432000, - "Standard_E96bds_v5": 8.448000, - "Standard_E96bs_v5": 7.440000, - "Standard_E96ds_v5": 3.624000, - "Standard_E96iads_v5": 4.385000, - "Standard_E96ias_v4": 6.240000, - "Standard_E96ias_v5": 3.775000, - "Standard_E96s_v5": 3.120000, - "Standard_F1": 0.049000, - "Standard_F16": 0.790000, - "Standard_F16s": 0.790000, - "Standard_F16s_v2": 0.680000, - "Standard_F1s": 0.049000, - "Standard_F2": 0.098800, - "Standard_F2s": 0.098800, - "Standard_F2s_v2": 0.085000, - "Standard_F32s_v2": 1.360000, - "Standard_F4": 0.198000, - "Standard_F48s_v2": 2.040000, - "Standard_F4s": 0.198000, - "Standard_F4s_v2": 0.170000, - "Standard_F64s_v2": 2.720000, - "Standard_F72s_v2": 3.060000, - "Standard_F8": 0.395000, - "Standard_F8s": 0.395000, - "Standard_F8s_v2": 0.340000, - "Standard_L16as_v3": 1.416000, - "Standard_L16s_v3": 1.584000, - "Standard_L32as_v3": 2.832000, - "Standard_L32s_v3": 3.168000, - "Standard_L48as_v3": 4.248000, - "Standard_L48s_v3": 4.752000, - "Standard_L64as_v3": 5.664000, - "Standard_L64s_v3": 6.336000, - "Standard_L80as_v3": 7.080000, - "Standard_L80s_v3": 7.920000, - "Standard_L8as_v3": 0.708000, - "Standard_L8s_v3": 0.792000, - "Standard_NC12s_v3": 8.468000, - "Standard_NC24ads_A100_v4": 5.142000, - "Standard_NC24rs_v3": 18.630000, - "Standard_NC24s_v3": 16.936000, - "Standard_NC48ads_A100_v4": 10.284000, - "Standard_NC6s_v3": 4.234000, - "Standard_NC96ads_A100_v4": 20.569000, - } - // koreacentral - initialOnDemandPrices["koreacentral"] = map[string]float64{ - "Basic_A4": 0.449000, - "Dasv5_Type1": 6.530000, - "Easv5_Type1": 7.181000, - "Edsv4_Type 1": 6.090000, - "Esv3_Type3": 5.162000, - "Lsv3_Type1": 8.998000, - "Msv2_Type1": 65.446000, - "Standard_A0": 0.020000, - "Standard_A5": 0.172000, - "Standard_A8_v2": 0.450000, - "Standard_B16als_v2": 0.737000, - "Standard_B16as_v2": 0.822000, - "Standard_B16ms": 0.832000, - "Standard_B2ls_v2": 0.052000, - "Standard_B2s_v2": 0.113000, - "Standard_B32als_v2": 1.473000, - "Standard_B32ls_v2": 1.621000, - "Standard_B32s_v2": 1.664000, - "Standard_B4as_v2": 0.206000, - "Standard_B8as_v2": 0.411000, - "Standard_B8ls_v2": 0.405000, - "Standard_B8ms": 0.416000, - "Standard_B8s_v2": 0.453000, - "Standard_D11_v2": 0.200000, - "Standard_D12_v2": 0.399000, - "Standard_D15_v2": 1.995000, - "Standard_D16_v5": 0.944000, - "Standard_D16ads_v5": 1.016000, - "Standard_D16as_v5": 0.848000, - "Standard_D16as_v5_Promo": 0.752000, - "Standard_D16d_v4": 1.112000, - "Standard_D16lds_v5": 0.880000, - "Standard_D16s_v4": 0.944000, - "Standard_D16s_v5": 0.944000, - "Standard_D2_v2_Promo": 0.165000, - "Standard_D2a_v4": 0.118000, - "Standard_D2ads_v5": 0.127000, - "Standard_D2as_v5_Promo": 0.094000, - "Standard_D2d_v4": 0.139000, - "Standard_D2s_v5": 0.118000, - "Standard_D32-8s_v3": 1.968000, - "Standard_D32ds_v5": 2.224000, - "Standard_D32s_v5": 1.888000, - "Standard_D48_v4": 2.832000, - "Standard_D48a_v4": 2.832000, - "Standard_D48ads_v5": 3.048000, - "Standard_D48as_v4": 2.832000, - "Standard_D48d_v5": 3.336000, - "Standard_D48ds_v5": 3.336000, - "Standard_D48lds_v5": 2.640000, - "Standard_D48s_v4": 2.832000, - "Standard_D48s_v5": 2.832000, - "Standard_D4_v2": 0.660000, - "Standard_D4_v2_Promo": 0.660000, - "Standard_D4_v4": 0.236000, - "Standard_D4a_v4": 0.236000, - "Standard_D4as_v5": 0.212000, - "Standard_D4as_v5_Promo": 0.188000, - "Standard_D4d_v4": 0.278000, - "Standard_D4ds_v4": 0.278000, - "Standard_D4s_v3": 0.246000, - "Standard_D4s_v4": 0.236000, - "Standard_D64-16s_v3": 3.936000, - "Standard_D64-32s_v3": 3.936000, - "Standard_D64a_v4": 3.776000, - "Standard_D64as_v5": 3.392000, - "Standard_D64as_v5_Promo": 3.008000, - "Standard_D64d_v5": 4.448000, - "Standard_D64s_v3": 3.936000, - "Standard_D8a_v4": 0.472000, - "Standard_D8as_v4": 0.472000, - "Standard_D8d_v5": 0.556000, - "Standard_D8ds_v4": 0.556000, - "Standard_D8lds_v5": 0.440000, - "Standard_D96a_v4": 5.664000, - "Standard_DS12-2_v2": 0.399000, - "Standard_DS13-4_v2": 0.798000, - "Standard_DS2_v2": 0.165000, - "Standard_DS2_v2_Promo": 0.165000, - "Standard_E112iads_v5": 9.733000, - "Standard_E16-4as_v5": 1.088000, - "Standard_E16-4s_v4": 1.216000, - "Standard_E16-8as_v4": 1.216000, - "Standard_E16-8as_v5": 1.088000, - "Standard_E16as_v4": 1.216000, - "Standard_E16as_v5": 1.088000, - "Standard_E16d_v4": 1.384000, - "Standard_E20_v4": 1.520000, - "Standard_E20d_v5": 1.730000, - "Standard_E20ds_v5": 1.730000, - "Standard_E2as_v5": 0.136000, - "Standard_E2ds_v4": 0.173000, - "Standard_E2s_v3": 0.160000, - "Standard_E32-16ds_v5": 2.768000, - "Standard_E32-8ads_v5": 2.528000, - "Standard_E32-8as_v5": 2.176000, - "Standard_E32-8ds_v4": 2.768000, - "Standard_E32_v5": 2.432000, - "Standard_E32a_v4": 2.432000, - "Standard_E32bs_v5": 2.848000, - "Standard_E32d_v4": 2.768000, - "Standard_E32ds_v4": 2.768000, - "Standard_E32ds_v5": 2.768000, - "Standard_E32s_v3": 2.560000, - "Standard_E32s_v4": 2.432000, - "Standard_E32s_v5": 2.432000, - "Standard_E48_v5": 3.648000, - "Standard_E48a_v4": 3.648000, - "Standard_E48bds_v5": 4.776000, - "Standard_E48bs_v5": 4.272000, - "Standard_E4ads_v5": 0.316000, - "Standard_E4as_v5": 0.272000, - "Standard_E4bs_v5": 0.356000, - "Standard_E4ds_v4": 0.346000, - "Standard_E4s_v4": 0.304000, - "Standard_E4s_v5": 0.304000, - "Standard_E64-16ds_v4": 5.536000, - "Standard_E64-16s_v5": 4.864000, - "Standard_E64-32as_v4": 4.864000, - "Standard_E64-32as_v5": 4.352000, - "Standard_E64-32s_v3": 4.376000, - "Standard_E64ads_v5": 5.056000, - "Standard_E64as_v4": 4.864000, - "Standard_E64d_v5": 5.536000, - "Standard_E64ds_v5": 5.536000, - "Standard_E64i_v3": 4.376000, - "Standard_E64s_v4": 4.864000, - "Standard_E64s_v5": 4.864000, - "Standard_E8-2as_v5": 0.544000, - "Standard_E8-2s_v5": 0.608000, - "Standard_E8-4as_v5": 0.544000, - "Standard_E8-4ds_v5": 0.692000, - "Standard_E8-4s_v3": 0.640000, - "Standard_E8-4s_v4": 0.608000, - "Standard_E8-4s_v5": 0.608000, - "Standard_E8_v3": 0.640000, - "Standard_E8_v4": 0.608000, - "Standard_E8as_v4": 0.608000, - "Standard_E8bds_v5": 0.796000, - "Standard_E8d_v5": 0.692000, - "Standard_E8s_v4": 0.608000, - "Standard_E8s_v5": 0.608000, - "Standard_E96-24ads_v5": 7.584000, - "Standard_E96-24as_v4": 7.296000, - "Standard_E96-24s_v5": 7.296000, - "Standard_E96-48as_v4": 7.296000, - "Standard_E96-48ds_v5": 8.304000, - "Standard_E96bds_v5": 9.552000, - "Standard_E96ds_v5": 8.304000, - "Standard_E96s_v5": 7.296000, - "Standard_F16s": 0.816000, - "Standard_F16s_v2": 0.768000, - "Standard_F2s": 0.102000, - "Standard_F8": 0.408000, - "Standard_FX24mds": 2.700000, - "Standard_HB176-48rs_v4": 9.720000, - "Standard_HC44-32rs": 4.277000, - "Standard_HX176-96rs": 11.664000, - "Standard_L16as_v3": 1.464000, - "Standard_L32s_v3": 3.272000, - "Standard_L64s_v3": 6.544000, - "Standard_L80as_v3": 7.320000, - "Standard_L8as_v3": 0.732000, - "Standard_M128ms": 38.698000, - "Standard_M208-104ms_v2": 53.544000, - "Standard_M208-104s_v2": 26.772000, - "Standard_M208-52ms_v2": 53.544000, - "Standard_M208ms_v2": 53.544000, - "Standard_M208s_v2": 26.772000, - "Standard_M32-16ms": 8.912000, - "Standard_M416-104s_v2": 59.496000, - "Standard_M416-208ms_v2": 118.980000, - "Standard_M416ms_v2": 118.980000, - "Standard_M416s_v2": 59.496000, - "Standard_M64-32ms": 14.989000, - "Standard_M64ls": 6.498000, - "Standard_M64ms_v2": 14.688000, - "Standard_M8-2ms": 2.228000, - "Standard_NC24rs_v3": 18.630000, - "Standard_NC4as_T4_v3": 0.647000, - "Standard_NV16as_v4": 1.258000, - "Standard_NV32as_v4": 2.516000, - "Standard_NV4as_v4": 0.315000, - "Standard_NV72ads_A10_v5": 8.802000, - "Standard_NV8as_v4": 0.629000, - } - // koreasouth - initialOnDemandPrices["koreasouth"] = map[string]float64{ - "Basic_A4": 0.404000, - "Dasv4_Type2": 5.847000, - "Dasv5_Type1": 6.092000, - "Ddsv4_Type2": 5.449000, - "Ddsv5_Type1": 6.861000, - "Dsv3_Type3": 4.859000, - "Dsv4_Type1": 4.873000, - "Dsv4_Type2": 6.091000, - "Dsv5_Type1": 6.072000, - "Eadsv5_Type1": 7.954000, - "Easv4_Type2": 7.603000, - "Edsv5_Type1": 8.744000, - "Fsv2 Type3": 4.858000, - "Fsv2_Type2": 3.802000, - "Msmv2_Type1": 136.330000, - "Standard_A1": 0.060000, - "Standard_A2": 0.119000, - "Standard_A4": 0.475000, - "Standard_A4m_v2": 0.251000, - "Standard_A7": 0.618000, - "Standard_B12ms": 0.622000, - "Standard_B16as_v2": 0.692000, - "Standard_B16ls_v2": 0.678000, - "Standard_B16s_v2": 0.765000, - "Standard_B1s": 0.013000, - "Standard_B20ms": 1.037000, - "Standard_B2as_v2": 0.086500, - "Standard_B2ats_v2": 0.010800, - "Standard_B2ls_v2": 0.047800, - "Standard_B2ms": 0.104000, - "Standard_B2s_v2": 0.105000, - "Standard_B32als_v2": 1.372000, - "Standard_B32as_v2": 1.384000, - "Standard_B32ls_v2": 1.356000, - "Standard_B32s_v2": 1.531000, - "Standard_B4ls_v2": 0.170000, - "Standard_B4ms": 0.207000, - "Standard_B8als_v2": 0.343000, - "Standard_B8as_v2": 0.383000, - "Standard_B8ls_v2": 0.339000, - "Standard_B8s_v2": 0.383000, - "Standard_D13_v2": 0.718000, - "Standard_D16ads_v5": 0.948000, - "Standard_D16d_v4": 1.043000, - "Standard_D16ds_v5": 1.040000, - "Standard_D2_v2_Promo": 0.149000, - "Standard_D2a_v4": 0.111000, - "Standard_D2as_v4": 0.111000, - "Standard_D2s_v3": 0.111000, - "Standard_D32-16s_v3": 1.772000, - "Standard_D32-8s_v3": 1.772000, - "Standard_D32d_v4": 2.086000, - "Standard_D32ds_v4": 2.086000, - "Standard_D32ls_v5": 1.564000, - "Standard_D32s_v5": 1.766000, - "Standard_D48ads_v5": 2.843000, - "Standard_D48as_v4": 2.658000, - "Standard_D48d_v4": 3.129000, - "Standard_D48ds_v5": 3.119000, - "Standard_D48lds_v5": 2.650000, - "Standard_D4_v2_Promo": 0.594000, - "Standard_D4_v3": 0.221000, - "Standard_D4_v4": 0.221000, - "Standard_D4ads_v5": 0.237000, - "Standard_D4as_v4": 0.221000, - "Standard_D4s_v4": 0.221000, - "Standard_D5_v2": 1.189000, - "Standard_D64-32s_v3": 3.544000, - "Standard_D64_v3": 3.544000, - "Standard_D64_v4": 3.544000, - "Standard_D64a_v4": 3.544000, - "Standard_D64as_v4": 3.544000, - "Standard_D64as_v5": 3.165000, - "Standard_D64d_v5": 4.158000, - "Standard_D64s_v5": 3.533000, - "Standard_D8a_v4": 0.443000, - "Standard_D8d_v4": 0.521000, - "Standard_D8s_v5": 0.442000, - "Standard_D96as_v5": 4.747000, - "Standard_D96d_v5": 6.238000, - "Standard_D96s_v5": 5.299000, - "Standard_DS11_v2": 0.179000, - "Standard_DS12-1_v2": 0.359000, - "Standard_DS13-2_v2": 0.718000, - "Standard_DS13_v2_Promo": 0.718000, - "Standard_DS14-4_v2": 1.435000, - "Standard_DS14_v2": 1.435000, - "Standard_DS4_v2_Promo": 0.594000, - "Standard_E104i_v5": 8.288000, - "Standard_E16-4ds_v4": 1.317000, - "Standard_E16-4s_v4": 1.152000, - "Standard_E16-8ds_v4": 1.317000, - "Standard_E16-8s_v4": 1.152000, - "Standard_E16-8s_v5": 1.159000, - "Standard_E16_v4": 1.152000, - "Standard_E16bds_v5": 1.536000, - "Standard_E20_v4": 1.440000, - "Standard_E20a_v4": 1.440000, - "Standard_E20as_v4": 1.440000, - "Standard_E20d_v4": 1.646000, - "Standard_E20d_v5": 1.656000, - "Standard_E20ds_v5": 1.656000, - "Standard_E20s_v4": 1.440000, - "Standard_E2_v4": 0.144000, - "Standard_E2_v5": 0.145000, - "Standard_E2as_v5": 0.130000, - "Standard_E2bs_v5": 0.171000, - "Standard_E2ds_v4": 0.165000, - "Standard_E32-16as_v5": 2.079000, - "Standard_E32-16ds_v5": 2.650000, - "Standard_E32-16s_v3": 2.304000, - "Standard_E32-8ads_v5": 2.410000, - "Standard_E32-8as_v5": 2.079000, - "Standard_E32-8ds_v4": 2.633000, - "Standard_E32-8s_v4": 2.304000, - "Standard_E32_v3": 2.304000, - "Standard_E32_v4": 2.304000, - "Standard_E32_v5": 2.318000, - "Standard_E32bds_v5": 3.073000, - "Standard_E32bs_v5": 2.742000, - "Standard_E32d_v5": 2.650000, - "Standard_E4-2as_v5": 0.260000, - "Standard_E4-2ds_v4": 0.329000, - "Standard_E4-2s_v4": 0.288000, - "Standard_E48_v3": 3.234000, - "Standard_E48as_v4": 3.456000, - "Standard_E48as_v5": 3.119000, - "Standard_E48bds_v5": 4.609000, - "Standard_E48bs_v5": 4.112000, - "Standard_E48d_v4": 3.950000, - "Standard_E48s_v3": 3.234000, - "Standard_E4_v3": 0.288000, - "Standard_E4a_v4": 0.288000, - "Standard_E4as_v4": 0.288000, - "Standard_E4as_v5": 0.260000, - "Standard_E4d_v4": 0.329000, - "Standard_E4ds_v4": 0.329000, - "Standard_E4s_v3": 0.288000, - "Standard_E4s_v4": 0.288000, - "Standard_E64-16ads_v5": 4.821000, - "Standard_E64-16ds_v4": 5.266000, - "Standard_E64-32ds_v4": 5.266000, - "Standard_E64-32s_v4": 4.608000, - "Standard_E64_v3": 3.881000, - "Standard_E64_v5": 4.637000, - "Standard_E64as_v4": 4.608000, - "Standard_E64as_v5": 4.158000, - "Standard_E64d_v4": 5.266000, - "Standard_E64ds_v5": 5.299000, - "Standard_E64s_v3": 3.881000, - "Standard_E64s_v5": 4.637000, - "Standard_E8-2ads_v5": 0.603000, - "Standard_E8-4s_v3": 0.576000, - "Standard_E8-4s_v5": 0.580000, - "Standard_E8as_v5": 0.520000, - "Standard_E8d_v5": 0.662000, - "Standard_E96-24ads_v5": 7.231000, - "Standard_E96-48as_v5": 6.238000, - "Standard_E96-48ds_v5": 7.949000, - "Standard_E96bs_v5": 8.225000, - "Standard_E96d_v5": 7.949000, - "Standard_E96ds_v5": 7.949000, - "Standard_E96s_v5": 6.955000, - "Standard_F16s": 0.816000, - "Standard_F1s": 0.051000, - "Standard_F2s": 0.102000, - "Standard_F2s_v2": 0.096100, - "Standard_F48s_v2": 2.305000, - "Standard_F4s": 0.204000, - "Standard_F64s_v2": 3.074000, - "Standard_F72s_v2": 3.458000, - "Standard_L16as_v3": 1.435000, - "Standard_L32s_v3": 3.211000, - "Standard_L48as_v3": 4.306000, - "Standard_L64as_v3": 5.741000, - "Standard_L80as_v3": 7.176000, - "Standard_L80s_v3": 8.027000, - "Standard_L8s_v3": 0.803000, - "Standard_M128": 19.340000, - "Standard_M128-32ms": 38.698000, - "Standard_M128-64ms": 38.698000, - "Standard_M128s": 19.340000, - "Standard_M16ms": 4.456000, - "Standard_M208-104ms_v2": 55.775000, - "Standard_M208-104s_v2": 27.888000, - "Standard_M208-52ms_v2": 55.775000, - "Standard_M32-8ms": 8.912000, - "Standard_M32ls": 3.448000, - "Standard_M32ms": 8.912000, - "Standard_M32ts": 3.248000, - "Standard_M416is_v2": 61.975000, - "Standard_M416ms_v2": 123.940000, - "Standard_M64": 9.670000, - "Standard_M64-32ms": 14.989000, - "Standard_M64ls": 6.498000, - "Standard_M64m": 14.989000, - "Standard_M8-4ms": 2.228000, - "Standard_NV36ads_A10_v5": 4.000000, - } - // northcentralus - initialOnDemandPrices["northcentralus"] = map[string]float64{ - "Basic_A0": 0.018000, - "Basic_A1": 0.023000, - "Basic_A2": 0.085000, - "Basic_A3": 0.188000, - "Basic_A4": 0.376000, - "DCsv2 Type 1": 0.845000, - "Dadsv5_Type1": 6.345000, - "Dasv4_Type1": 5.069000, - "Dasv4_Type2": 5.280000, - "Dasv5_Type1": 5.298000, - "Ddsv4_Type 1": 3.978000, - "Ddsv4_Type2": 4.723000, - "Ddsv5_Type1": 5.966000, - "Dsv3_Type3": 4.225000, - "Dsv3_Type4": 5.281000, - "Dsv4_Type1": 4.224000, - "Dsv4_Type2": 5.069000, - "Dsv5_Type1": 5.280000, - "Eadsv5_Type1": 6.917000, - "Easv4_Type1": 6.653000, - "Easv4_Type2": 6.653000, - "Easv5_Type1": 5.966000, - "Ebdsv5-Type1": 5.878000, - "Ebsv5-Type1": 5.245000, - "Edsv4_Type 1": 5.069000, - "Edsv4_Type2": 6.019000, - "Edsv5_Type1": 7.603000, - "Esv3_Type3": 4.297000, - "Esv3_Type4": 5.822000, - "Esv4_Type1": 4.435000, - "Esv4_Type2": 5.821000, - "Esv5_Type1": 6.653000, - "Fsv2 Type3": 3.927000, - "Fsv2_Type2": 3.366000, - "Fsv2_Type4": 4.488000, - "Lsv3_Type1": 7.678000, - "Mdsmv2MedMem _Type1": 29.359000, - "Mdsv2MedMem_Type1": 14.674000, - "Ms_Type1": 14.669000, - "Msm_Type1": 29.363000, - "Msmv2MedMem Type1": 28.896000, - "Msmv2_Type1": 109.060000, - "Msv2MedMem Type1": 14.211000, - "Msv2_Type1": 54.538000, - "NVasv4_Type1": 8.612000, - "Standard_A0": 0.020000, - "Standard_A1": 0.060000, - "Standard_A1_v2": 0.043000, - "Standard_A2": 0.120000, - "Standard_A2_v2": 0.091000, - "Standard_A2m_v2": 0.129000, - "Standard_A3": 0.240000, - "Standard_A4": 0.480000, - "Standard_A4_v2": 0.191000, - "Standard_A4m_v2": 0.270000, - "Standard_A5": 0.250000, - "Standard_A6": 0.500000, - "Standard_A7": 1.000000, - "Standard_A8_v2": 0.400000, - "Standard_A8m_v2": 0.568000, - "Standard_B12ms": 0.499000, - "Standard_B16als_v2": 0.606000, - "Standard_B16as_v2": 0.602000, - "Standard_B16ls_v2": 0.589000, - "Standard_B16ms": 0.666000, - "Standard_B16pls_v2": 0.550000, - "Standard_B16ps_v2": 0.611000, - "Standard_B16s_v2": 0.666000, - "Standard_B1ls": 0.005200, - "Standard_B1ms": 0.020800, - "Standard_B1s": 0.010400, - "Standard_B20ms": 0.832000, - "Standard_B2als_v2": 0.037600, - "Standard_B2as_v2": 0.075200, - "Standard_B2ats_v2": 0.018600, - "Standard_B2ls_v2": 0.041600, - "Standard_B2ms": 0.083200, - "Standard_B2pls_v2": 0.033600, - "Standard_B2ps_v2": 0.067200, - "Standard_B2pts_v2": 0.008400, - "Standard_B2s": 0.041600, - "Standard_B2s_v2": 0.092400, - "Standard_B2ts_v2": 0.019600, - "Standard_B32als_v2": 1.065000, - "Standard_B32as_v2": 1.350000, - "Standard_B32ls_v2": 1.179000, - "Standard_B32s_v2": 1.478000, - "Standard_B4als_v2": 0.152000, - "Standard_B4as_v2": 0.169000, - "Standard_B4ls_v2": 0.166000, - "Standard_B4ms": 0.166000, - "Standard_B4pls_v2": 0.137000, - "Standard_B4ps_v2": 0.134000, - "Standard_B4s_v2": 0.166000, - "Standard_B8als_v2": 0.303000, - "Standard_B8as_v2": 0.301000, - "Standard_B8ls_v2": 0.295000, - "Standard_B8ms": 0.333000, - "Standard_B8pls_v2": 0.238000, - "Standard_B8ps_v2": 0.269000, - "Standard_B8s_v2": 0.370000, - "Standard_D1": 0.077000, - "Standard_D11": 0.193000, - "Standard_D11_v2": 0.185000, - "Standard_D11_v2_Promo": 0.185000, - "Standard_D12": 0.386000, - "Standard_D12_v2": 0.370000, - "Standard_D12_v2_Promo": 0.370000, - "Standard_D13": 0.771000, - "Standard_D13_v2": 0.741000, - "Standard_D13_v2_Promo": 0.741000, - "Standard_D14": 1.542000, - "Standard_D14_v2": 1.482000, - "Standard_D14_v2_Promo": 1.482000, - "Standard_D15_v2": 1.852000, - "Standard_D15i_v2": 1.852000, - "Standard_D16_v3": 0.800000, - "Standard_D16_v4": 0.768000, - "Standard_D16_v5": 0.768000, - "Standard_D16a_v4": 0.768000, - "Standard_D16ads_v5": 0.824000, - "Standard_D16as_v4": 0.768000, - "Standard_D16as_v5": 0.688000, - "Standard_D16d_v4": 0.904000, - "Standard_D16d_v5": 0.904000, - "Standard_D16ds_v4": 0.904000, - "Standard_D16ds_v5": 0.904000, - "Standard_D16lds_v5": 0.768000, - "Standard_D16ls_v5": 0.680000, - "Standard_D16pds_v5": 0.723000, - "Standard_D16plds_v5": 0.614000, - "Standard_D16pls_v5": 0.544000, - "Standard_D16ps_v5": 0.616000, - "Standard_D16s_v3": 0.800000, - "Standard_D16s_v4": 0.768000, - "Standard_D16s_v5": 0.768000, - "Standard_D1_v2": 0.073000, - "Standard_D2": 0.154000, - "Standard_D2_v2": 0.146000, - "Standard_D2_v2_Promo": 0.146000, - "Standard_D2_v3": 0.100000, - "Standard_D2_v4": 0.096000, - "Standard_D2_v5": 0.096000, - "Standard_D2a_v4": 0.096000, - "Standard_D2ads_v5": 0.103000, - "Standard_D2as_v4": 0.096000, - "Standard_D2as_v5": 0.086000, - "Standard_D2d_v4": 0.113000, - "Standard_D2d_v5": 0.113000, - "Standard_D2ds_v4": 0.113000, - "Standard_D2ds_v5": 0.113000, - "Standard_D2lds_v5": 0.096000, - "Standard_D2ls_v5": 0.085000, - "Standard_D2pds_v5": 0.090400, - "Standard_D2plds_v5": 0.076800, - "Standard_D2pls_v5": 0.068000, - "Standard_D2ps_v5": 0.077000, - "Standard_D2s_v3": 0.100000, - "Standard_D2s_v4": 0.096000, - "Standard_D2s_v5": 0.096000, - "Standard_D3": 0.308000, - "Standard_D32-16s_v3": 1.600000, - "Standard_D32-8s_v3": 1.600000, - "Standard_D32_v3": 1.600000, - "Standard_D32_v4": 1.536000, - "Standard_D32_v5": 1.536000, - "Standard_D32a_v4": 1.536000, - "Standard_D32ads_v5": 1.648000, - "Standard_D32as_v4": 1.536000, - "Standard_D32as_v5": 1.376000, - "Standard_D32d_v4": 1.808000, - "Standard_D32d_v5": 1.808000, - "Standard_D32ds_v4": 1.808000, - "Standard_D32ds_v5": 1.808000, - "Standard_D32lds_v5": 1.536000, - "Standard_D32ls_v5": 1.360000, - "Standard_D32pds_v5": 1.446000, - "Standard_D32plds_v5": 1.229000, - "Standard_D32pls_v5": 1.088000, - "Standard_D32ps_v5": 1.232000, - "Standard_D32s_v3": 1.600000, - "Standard_D32s_v4": 1.536000, - "Standard_D32s_v5": 1.536000, - "Standard_D3_v2": 0.293000, - "Standard_D3_v2_Promo": 0.293000, - "Standard_D4": 0.616000, - "Standard_D48_v3": 2.400000, - "Standard_D48_v4": 2.304000, - "Standard_D48_v5": 2.304000, - "Standard_D48a_v4": 2.304000, - "Standard_D48ads_v5": 2.472000, - "Standard_D48as_v4": 2.304000, - "Standard_D48as_v5": 2.064000, - "Standard_D48d_v4": 2.712000, - "Standard_D48d_v5": 2.712000, - "Standard_D48ds_v4": 2.712000, - "Standard_D48ds_v5": 2.712000, - "Standard_D48lds_v5": 2.304000, - "Standard_D48ls_v5": 2.040000, - "Standard_D48pds_v5": 2.170000, - "Standard_D48plds_v5": 1.843000, - "Standard_D48pls_v5": 1.632000, - "Standard_D48ps_v5": 1.848000, - "Standard_D48s_v3": 2.400000, - "Standard_D48s_v4": 2.304000, - "Standard_D48s_v5": 2.304000, - "Standard_D4_v2": 0.585000, - "Standard_D4_v2_Promo": 0.585000, - "Standard_D4_v3": 0.200000, - "Standard_D4_v4": 0.192000, - "Standard_D4_v5": 0.192000, - "Standard_D4a_v4": 0.192000, - "Standard_D4ads_v5": 0.206000, - "Standard_D4as_v4": 0.192000, - "Standard_D4as_v5": 0.172000, - "Standard_D4d_v4": 0.226000, - "Standard_D4d_v5": 0.226000, - "Standard_D4ds_v4": 0.226000, - "Standard_D4ds_v5": 0.226000, - "Standard_D4lds_v5": 0.192000, - "Standard_D4ls_v5": 0.170000, - "Standard_D4pds_v5": 0.181000, - "Standard_D4plds_v5": 0.154000, - "Standard_D4pls_v5": 0.136000, - "Standard_D4ps_v5": 0.154000, - "Standard_D4s_v3": 0.200000, - "Standard_D4s_v4": 0.192000, - "Standard_D4s_v5": 0.192000, - "Standard_D5_v2": 1.170000, - "Standard_D5_v2_Promo": 1.170000, - "Standard_D64-16s_v3": 3.200000, - "Standard_D64-32s_v3": 3.200000, - "Standard_D64_v3": 3.200000, - "Standard_D64_v4": 3.072000, - "Standard_D64_v5": 3.072000, - "Standard_D64a_v4": 3.072000, - "Standard_D64ads_v5": 3.296000, - "Standard_D64as_v4": 3.072000, - "Standard_D64as_v5": 2.752000, - "Standard_D64d_v4": 3.616000, - "Standard_D64d_v5": 3.616000, - "Standard_D64ds_v4": 3.616000, - "Standard_D64ds_v5": 3.616000, - "Standard_D64lds_v5": 3.072000, - "Standard_D64ls_v5": 2.720000, - "Standard_D64pds_v5": 2.893000, - "Standard_D64plds_v5": 2.458000, - "Standard_D64pls_v5": 2.176000, - "Standard_D64ps_v5": 2.464000, - "Standard_D64s_v3": 3.200000, - "Standard_D64s_v4": 3.072000, - "Standard_D64s_v5": 3.072000, - "Standard_D8_v3": 0.400000, - "Standard_D8_v4": 0.384000, - "Standard_D8_v5": 0.384000, - "Standard_D8a_v4": 0.384000, - "Standard_D8ads_v5": 0.412000, - "Standard_D8as_v4": 0.384000, - "Standard_D8as_v5": 0.344000, - "Standard_D8d_v4": 0.452000, - "Standard_D8d_v5": 0.452000, - "Standard_D8ds_v4": 0.452000, - "Standard_D8ds_v5": 0.452000, - "Standard_D8lds_v5": 0.384000, - "Standard_D8ls_v5": 0.340000, - "Standard_D8pds_v5": 0.362000, - "Standard_D8plds_v5": 0.307000, - "Standard_D8pls_v5": 0.272000, - "Standard_D8ps_v5": 0.308000, - "Standard_D8s_v3": 0.400000, - "Standard_D8s_v4": 0.384000, - "Standard_D8s_v5": 0.384000, - "Standard_D96_v5": 4.608000, - "Standard_D96a_v4": 4.608000, - "Standard_D96ads_v5": 4.944000, - "Standard_D96as_v4": 4.608000, - "Standard_D96as_v5": 4.128000, - "Standard_D96d_v5": 5.424000, - "Standard_D96ds_v5": 5.424000, - "Standard_D96lds_v5": 4.608000, - "Standard_D96ls_v5": 4.080000, - "Standard_D96s_v5": 4.608000, - "Standard_DC1s_v2": 0.096000, - "Standard_DC2s_v2": 0.192000, - "Standard_DC4s_v2": 0.384000, - "Standard_DC8_v2": 0.768000, - "Standard_DS1": 0.077000, - "Standard_DS11": 0.193000, - "Standard_DS11-1_v2": 0.185000, - "Standard_DS11_v2": 0.185000, - "Standard_DS11_v2_Promo": 0.185000, - "Standard_DS12": 0.386000, - "Standard_DS12-1_v2": 0.370000, - "Standard_DS12-2_v2": 0.370000, - "Standard_DS12_v2": 0.370000, - "Standard_DS12_v2_Promo": 0.370000, - "Standard_DS13": 0.771000, - "Standard_DS13-2_v2": 0.741000, - "Standard_DS13-4_v2": 0.741000, - "Standard_DS13_v2": 0.741000, - "Standard_DS13_v2_Promo": 0.741000, - "Standard_DS14": 1.542000, - "Standard_DS14-4_v2": 1.482000, - "Standard_DS14-8_v2": 1.482000, - "Standard_DS14_v2": 1.482000, - "Standard_DS14_v2_Promo": 1.482000, - "Standard_DS15_v2": 1.852000, - "Standard_DS15i_v2": 1.852000, - "Standard_DS1_v2": 0.073000, - "Standard_DS2": 0.154000, - "Standard_DS2_v2": 0.146000, - "Standard_DS2_v2_Promo": 0.146000, - "Standard_DS3": 0.308000, - "Standard_DS3_v2": 0.293000, - "Standard_DS3_v2_Promo": 0.293000, - "Standard_DS4": 0.616000, - "Standard_DS4_v2": 0.585000, - "Standard_DS4_v2_Promo": 0.585000, - "Standard_DS5_v2": 1.170000, - "Standard_DS5_v2_Promo": 1.170000, - "Standard_E104i_v5": 7.207000, - "Standard_E104id_v5": 8.237000, - "Standard_E104ids_v5": 8.237000, - "Standard_E104is_v5": 7.207000, - "Standard_E112iads_v5": 8.070000, - "Standard_E112ias_v5": 6.961000, - "Standard_E112ibds_v5": 10.287000, - "Standard_E112ibs_v5": 9.178000, - "Standard_E16-4ads_v5": 1.048000, - "Standard_E16-4as_v4": 1.008000, - "Standard_E16-4as_v5": 0.904000, - "Standard_E16-4ds_v4": 1.152000, - "Standard_E16-4ds_v5": 1.152000, - "Standard_E16-4s_v3": 1.008000, - "Standard_E16-4s_v4": 1.008000, - "Standard_E16-4s_v5": 1.008000, - "Standard_E16-8ads_v5": 1.048000, - "Standard_E16-8as_v4": 1.008000, - "Standard_E16-8as_v5": 0.904000, - "Standard_E16-8ds_v4": 1.152000, - "Standard_E16-8ds_v5": 1.152000, - "Standard_E16-8s_v3": 1.008000, - "Standard_E16-8s_v4": 1.008000, - "Standard_E16-8s_v5": 1.008000, - "Standard_E16_v3": 1.008000, - "Standard_E16_v4": 1.008000, - "Standard_E16_v5": 1.008000, - "Standard_E16a_v4": 1.008000, - "Standard_E16ads_v5": 1.048000, - "Standard_E16as_v4": 1.008000, - "Standard_E16as_v5": 0.904000, - "Standard_E16bds_v5": 1.336000, - "Standard_E16bs_v5": 1.192000, - "Standard_E16d_v4": 1.152000, - "Standard_E16d_v5": 1.152000, - "Standard_E16ds_v4": 1.152000, - "Standard_E16ds_v5": 1.152000, - "Standard_E16pds_v5": 0.922000, - "Standard_E16ps_v5": 0.806000, - "Standard_E16s_v3": 1.008000, - "Standard_E16s_v4": 1.008000, - "Standard_E16s_v5": 1.008000, - "Standard_E20_v3": 1.260000, - "Standard_E20_v4": 1.260000, - "Standard_E20_v5": 1.260000, - "Standard_E20a_v4": 1.260000, - "Standard_E20ads_v5": 1.310000, - "Standard_E20as_v4": 1.260000, - "Standard_E20as_v5": 1.130000, - "Standard_E20d_v4": 1.440000, - "Standard_E20d_v5": 1.440000, - "Standard_E20ds_v4": 1.440000, - "Standard_E20ds_v5": 1.440000, - "Standard_E20pds_v5": 1.152000, - "Standard_E20ps_v5": 1.008000, - "Standard_E20s_v3": 1.260000, - "Standard_E20s_v4": 1.260000, - "Standard_E20s_v5": 1.260000, - "Standard_E2_v3": 0.126000, - "Standard_E2_v4": 0.126000, - "Standard_E2_v5": 0.126000, - "Standard_E2a_v4": 0.126000, - "Standard_E2ads_v5": 0.131000, - "Standard_E2as_v4": 0.126000, - "Standard_E2as_v5": 0.113000, - "Standard_E2bds_v5": 0.167000, - "Standard_E2bs_v5": 0.149000, - "Standard_E2d_v4": 0.144000, - "Standard_E2d_v5": 0.144000, - "Standard_E2ds_v4": 0.144000, - "Standard_E2ds_v5": 0.144000, - "Standard_E2pds_v5": 0.115000, - "Standard_E2ps_v5": 0.101000, - "Standard_E2s_v3": 0.126000, - "Standard_E2s_v4": 0.126000, - "Standard_E2s_v5": 0.126000, - "Standard_E32-16ads_v5": 2.096000, - "Standard_E32-16as_v4": 2.016000, - "Standard_E32-16as_v5": 1.808000, - "Standard_E32-16ds_v4": 2.304000, - "Standard_E32-16ds_v5": 2.304000, - "Standard_E32-16s_v3": 2.016000, - "Standard_E32-16s_v4": 2.016000, - "Standard_E32-16s_v5": 2.016000, - "Standard_E32-8ads_v5": 2.096000, - "Standard_E32-8as_v4": 2.016000, - "Standard_E32-8as_v5": 1.808000, - "Standard_E32-8ds_v4": 2.304000, - "Standard_E32-8ds_v5": 2.304000, - "Standard_E32-8s_v3": 2.016000, - "Standard_E32-8s_v4": 2.016000, - "Standard_E32-8s_v5": 2.016000, - "Standard_E32_v3": 2.016000, - "Standard_E32_v4": 2.016000, - "Standard_E32_v5": 2.016000, - "Standard_E32a_v4": 2.016000, - "Standard_E32ads_v5": 2.096000, - "Standard_E32as_v4": 2.016000, - "Standard_E32as_v5": 1.808000, - "Standard_E32bds_v5": 2.672000, - "Standard_E32bs_v5": 2.384000, - "Standard_E32d_v4": 2.304000, - "Standard_E32d_v5": 2.304000, - "Standard_E32ds_v4": 2.304000, - "Standard_E32ds_v5": 2.304000, - "Standard_E32pds_v5": 1.843000, - "Standard_E32ps_v5": 1.613000, - "Standard_E32s_v3": 2.016000, - "Standard_E32s_v4": 2.016000, - "Standard_E32s_v5": 2.016000, - "Standard_E4-2ads_v5": 0.262000, - "Standard_E4-2as_v4": 0.252000, - "Standard_E4-2as_v5": 0.226000, - "Standard_E4-2ds_v4": 0.288000, - "Standard_E4-2ds_v5": 0.288000, - "Standard_E4-2s_v3": 0.252000, - "Standard_E4-2s_v4": 0.252000, - "Standard_E4-2s_v5": 0.252000, - "Standard_E48_v3": 3.024000, - "Standard_E48_v4": 3.024000, - "Standard_E48_v5": 3.024000, - "Standard_E48a_v4": 3.024000, - "Standard_E48ads_v5": 3.144000, - "Standard_E48as_v4": 3.024000, - "Standard_E48as_v5": 2.712000, - "Standard_E48bds_v5": 4.008000, - "Standard_E48bs_v5": 3.576000, - "Standard_E48d_v4": 3.456000, - "Standard_E48d_v5": 3.456000, - "Standard_E48ds_v4": 3.456000, - "Standard_E48ds_v5": 3.456000, - "Standard_E48s_v3": 3.024000, - "Standard_E48s_v4": 3.024000, - "Standard_E48s_v5": 3.024000, - "Standard_E4_v3": 0.252000, - "Standard_E4_v4": 0.252000, - "Standard_E4_v5": 0.252000, - "Standard_E4a_v4": 0.252000, - "Standard_E4ads_v5": 0.262000, - "Standard_E4as_v4": 0.252000, - "Standard_E4as_v5": 0.226000, - "Standard_E4bds_v5": 0.334000, - "Standard_E4bs_v5": 0.298000, - "Standard_E4d_v4": 0.288000, - "Standard_E4d_v5": 0.288000, - "Standard_E4ds_v4": 0.288000, - "Standard_E4ds_v5": 0.288000, - "Standard_E4pds_v5": 0.230000, - "Standard_E4ps_v5": 0.202000, - "Standard_E4s_v3": 0.252000, - "Standard_E4s_v4": 0.252000, - "Standard_E4s_v5": 0.252000, - "Standard_E64-16ads_v5": 4.192000, - "Standard_E64-16as_v4": 4.032000, - "Standard_E64-16as_v5": 3.616000, - "Standard_E64-16ds_v4": 4.608000, - "Standard_E64-16ds_v5": 4.608000, - "Standard_E64-16s_v3": 3.629000, - "Standard_E64-16s_v4": 4.032000, - "Standard_E64-16s_v5": 4.032000, - "Standard_E64-32ads_v5": 4.192000, - "Standard_E64-32as_v4": 4.032000, - "Standard_E64-32as_v5": 3.616000, - "Standard_E64-32ds_v4": 4.608000, - "Standard_E64-32ds_v5": 4.608000, - "Standard_E64-32s_v3": 3.629000, - "Standard_E64-32s_v4": 4.032000, - "Standard_E64-32s_v5": 4.032000, - "Standard_E64_v3": 3.629000, - "Standard_E64_v4": 4.032000, - "Standard_E64_v5": 4.032000, - "Standard_E64a_v4": 4.032000, - "Standard_E64ads_v5": 4.192000, - "Standard_E64as_v4": 4.032000, - "Standard_E64as_v5": 3.616000, - "Standard_E64bds_v5": 5.344000, - "Standard_E64bs_v5": 4.768000, - "Standard_E64d_v4": 4.608000, - "Standard_E64d_v5": 4.608000, - "Standard_E64ds_v4": 4.608000, - "Standard_E64ds_v5": 4.608000, - "Standard_E64i_v3": 3.629000, - "Standard_E64is_v3": 3.629000, - "Standard_E64s_v3": 3.629000, - "Standard_E64s_v4": 4.032000, - "Standard_E64s_v5": 4.032000, - "Standard_E8-2ads_v5": 0.524000, - "Standard_E8-2as_v4": 0.504000, - "Standard_E8-2as_v5": 0.452000, - "Standard_E8-2ds_v4": 0.576000, - "Standard_E8-2ds_v5": 0.576000, - "Standard_E8-2s_v3": 0.504000, - "Standard_E8-2s_v4": 0.504000, - "Standard_E8-2s_v5": 0.504000, - "Standard_E8-4ads_v5": 0.524000, - "Standard_E8-4as_v4": 0.504000, - "Standard_E8-4as_v5": 0.452000, - "Standard_E8-4ds_v4": 0.576000, - "Standard_E8-4ds_v5": 0.576000, - "Standard_E8-4s_v3": 0.504000, - "Standard_E8-4s_v4": 0.504000, - "Standard_E8-4s_v5": 0.504000, - "Standard_E80ids_v4": 5.760000, - "Standard_E80is_v4": 5.040000, - "Standard_E8_v3": 0.504000, - "Standard_E8_v4": 0.504000, - "Standard_E8_v5": 0.504000, - "Standard_E8a_v4": 0.504000, - "Standard_E8ads_v5": 0.524000, - "Standard_E8as_v4": 0.504000, - "Standard_E8as_v5": 0.452000, - "Standard_E8bds_v5": 0.668000, - "Standard_E8bs_v5": 0.596000, - "Standard_E8d_v4": 0.576000, - "Standard_E8d_v5": 0.576000, - "Standard_E8ds_v4": 0.576000, - "Standard_E8ds_v5": 0.576000, - "Standard_E8pds_v5": 0.461000, - "Standard_E8ps_v5": 0.403000, - "Standard_E8s_v3": 0.504000, - "Standard_E8s_v4": 0.504000, - "Standard_E8s_v5": 0.504000, - "Standard_E96-24ads_v5": 6.288000, - "Standard_E96-24as_v4": 6.048000, - "Standard_E96-24as_v5": 5.424000, - "Standard_E96-24ds_v5": 6.912000, - "Standard_E96-24s_v5": 6.048000, - "Standard_E96-48ads_v5": 6.288000, - "Standard_E96-48as_v4": 6.048000, - "Standard_E96-48as_v5": 5.424000, - "Standard_E96-48ds_v5": 6.912000, - "Standard_E96-48s_v5": 6.048000, - "Standard_E96_v5": 6.048000, - "Standard_E96a_v4": 6.048000, - "Standard_E96ads_v5": 6.288000, - "Standard_E96as_v4": 6.048000, - "Standard_E96as_v5": 5.424000, - "Standard_E96bds_v5": 8.016000, - "Standard_E96bs_v5": 7.152000, - "Standard_E96d_v5": 6.912000, - "Standard_E96ds_v5": 6.912000, - "Standard_E96iads_v5": 6.917000, - "Standard_E96ias_v5": 5.966000, - "Standard_E96s_v5": 6.048000, - "Standard_F1": 0.049700, - "Standard_F16": 0.796000, - "Standard_F16s": 0.796000, - "Standard_F16s_v2": 0.680000, - "Standard_F1s": 0.049700, - "Standard_F2": 0.099000, - "Standard_F2s": 0.099000, - "Standard_F2s_v2": 0.085000, - "Standard_F32s_v2": 1.360000, - "Standard_F4": 0.199000, - "Standard_F48s_v2": 2.040000, - "Standard_F4s": 0.199000, - "Standard_F4s_v2": 0.170000, - "Standard_F64s_v2": 2.720000, - "Standard_F72s_v2": 3.060000, - "Standard_F8": 0.398000, - "Standard_F8s": 0.398000, - "Standard_F8s_v2": 0.340000, - "Standard_H16": 1.808000, - "Standard_H16m": 2.423000, - "Standard_H16mr": 2.665000, - "Standard_H16r": 1.989000, - "Standard_H8": 0.904000, - "Standard_H8m": 1.211000, - "Standard_HB120-16rs_v2": 4.320000, - "Standard_HB120-32rs_v2": 4.320000, - "Standard_HB120-64rs_v2": 4.320000, - "Standard_HB120-96rs_v2": 4.320000, - "Standard_HB120rs_v2": 4.320000, - "Standard_L112ias_v3": 9.610000, - "Standard_L16as_v3": 1.248000, - "Standard_L16s_v3": 1.396000, - "Standard_L32as_v3": 2.496000, - "Standard_L32s_v3": 2.792000, - "Standard_L48as_v3": 3.744000, - "Standard_L48s_v3": 4.188000, - "Standard_L64as_v3": 4.992000, - "Standard_L64s_v3": 5.584000, - "Standard_L80as_v3": 6.240000, - "Standard_L80s_v3": 6.980000, - "Standard_L8as_v3": 0.624000, - "Standard_L8s_v3": 0.698000, - "Standard_L96ias_v3": 8.237000, - "Standard_M128": 13.338000, - "Standard_M128-32ms": 26.688000, - "Standard_M128-64ms": 26.688000, - "Standard_M128dms_v2": 26.690000, - "Standard_M128ds_v2": 13.340000, - "Standard_M128m": 26.688000, - "Standard_M128ms": 26.688000, - "Standard_M128ms_v2": 26.269000, - "Standard_M128s": 13.338000, - "Standard_M128s_v2": 12.919000, - "Standard_M16-4ms": 3.073000, - "Standard_M16-8ms": 3.073000, - "Standard_M16ms": 3.073000, - "Standard_M16s": 2.387000, - "Standard_M192idms_v2": 32.064000, - "Standard_M192ids_v2": 16.032000, - "Standard_M192ims_v2": 31.643000, - "Standard_M192is_v2": 15.611000, - "Standard_M208-104ms_v2": 44.620000, - "Standard_M208-104s_v2": 22.310000, - "Standard_M208-52ms_v2": 44.620000, - "Standard_M208-52s_v2": 22.310000, - "Standard_M208ms_v2": 44.620000, - "Standard_M208s_v2": 22.310000, - "Standard_M32-16ms": 6.146000, - "Standard_M32-8ms": 6.146000, - "Standard_M32dms_v2": 6.146000, - "Standard_M32ls": 2.873000, - "Standard_M32ms": 6.146000, - "Standard_M32ms_v2": 6.041000, - "Standard_M32s": 3.335000, - "Standard_M32ts": 2.707000, - "Standard_M416-104ms_v2": 99.150000, - "Standard_M416-104s_v2": 49.580000, - "Standard_M416-208ms_v2": 99.150000, - "Standard_M416-208s_v2": 49.580000, - "Standard_M416is_v2": 49.580000, - "Standard_M416ms_v2": 99.150000, - "Standard_M416s_8_v2": 66.110000, - "Standard_M416s_v2": 49.580000, - "Standard_M64": 6.669000, - "Standard_M64-16ms": 10.337000, - "Standard_M64-32ms": 10.337000, - "Standard_M64dms_v2": 10.340000, - "Standard_M64ds_v2": 6.669000, - "Standard_M64ls": 5.415000, - "Standard_M64m": 10.337000, - "Standard_M64ms": 10.337000, - "Standard_M64ms_v2": 10.130000, - "Standard_M64s": 6.669000, - "Standard_M64s_v2": 6.459000, - "Standard_M8-2ms": 1.536500, - "Standard_M8-4ms": 1.536500, - "Standard_M8ms": 1.536500, - "Standard_NC12": 1.800000, - "Standard_NC16as_T4_v3": 1.204000, - "Standard_NC24": 3.600000, - "Standard_NC24r": 3.960000, - "Standard_NC4as_T4_v3": 0.526000, - "Standard_NC6": 0.900000, - "Standard_NC64as_T4_v3": 4.352000, - "Standard_NC8as_T4_v3": 0.752000, - "Standard_ND96ams_A100_v4": 39.324000, - "Standard_ND96amsr_A100_v4": 39.324000, - "Standard_NV12": 2.280000, - "Standard_NV12ads_A10_v5": 1.090000, - "Standard_NV16as_v4": 1.118000, - "Standard_NV18ads_A10_v5": 1.920000, - "Standard_NV24": 4.560000, - "Standard_NV32as_v4": 2.237000, - "Standard_NV36adms_A10_v5": 5.424000, - "Standard_NV36ads_A10_v5": 3.840000, - "Standard_NV4as_v4": 0.280000, - "Standard_NV6": 1.140000, - "Standard_NV6ads_A10_v5": 0.545000, - "Standard_NV72ads_A10_v5": 7.824000, - "Standard_NV8as_v4": 0.559000, - } - // northeurope - initialOnDemandPrices["northeurope"] = map[string]float64{ - "Basic_A0": 0.018000, - "Basic_A1": 0.025000, - "Basic_A2": 0.075000, - "Basic_A3": 0.188000, - "Basic_A4": 0.376000, - "DCadsv5 Type 1": 7.084000, - "DCasv5 Type 1": 5.914000, - "DCdsv3 Type1": 6.653000, - "DCsv2 Type 1": 0.942000, - "DCsv3 Type1": 5.650000, - "Dadsv5_Type1": 7.084000, - "Dasv4_Type1": 5.650000, - "Dasv4_Type2": 5.885000, - "Dasv5_Type1": 5.914000, - "Ddsv4_Type 1": 4.435000, - "Ddsv4_Type2": 5.267000, - "Ddsv5_Type1": 6.653000, - "Dsv3_Type3": 4.709000, - "Dsv3_Type4": 5.886000, - "Dsv4_Type1": 4.708000, - "Dsv4_Type2": 5.650000, - "Dsv5_Type1": 5.885000, - "ECadsv5 Type 1": 8.480000, - "ECasv5 Type 1": 7.376000, - "Eadsv5_Type1": 7.709000, - "Easv4_Type1": 7.392000, - "Easv4_Type2": 7.445000, - "Easv5_Type1": 6.706000, - "Ebdsv5-Type1": 6.582000, - "Ebsv5-Type1": 5.914000, - "Edsv4_Type 1": 5.632000, - "Edsv4_Type2": 6.688000, - "Edsv5_Type1": 8.448000, - "Esv3_Type3": 4.774000, - "Esv3_Type4": 6.469000, - "Esv4_Type1": 4.963000, - "Esv4_Type2": 6.514000, - "Esv5_Type1": 7.445000, - "Fsv2 Type3": 4.435000, - "Fsv2_Type2": 3.802000, - "Fsv2_Type4": 5.069000, - "Lsv2_Type1": 7.568000, - "Lsv3_Type1": 8.448000, - "Mdsmv2MedMem _Type1": 35.231000, - "Mdsv2MedMem_Type1": 17.609000, - "Ms_Type1": 17.603000, - "Msm_Type1": 35.236000, - "Msmv2MedMem Type1": 34.675000, - "Msmv2_Type1": 130.880000, - "Msv2MedMem Type1": 17.053000, - "Msv2_Type1": 65.446000, - "NVasv4_Type1": 8.612000, - "NVsv3_Type1": 5.317000, - "Standard_A0": 0.020000, - "Standard_A1": 0.060000, - "Standard_A1_v2": 0.041000, - "Standard_A2": 0.120000, - "Standard_A2_v2": 0.087000, - "Standard_A2m_v2": 0.139000, - "Standard_A3": 0.240000, - "Standard_A4": 0.480000, - "Standard_A4_v2": 0.183000, - "Standard_A4m_v2": 0.291000, - "Standard_A5": 0.248000, - "Standard_A6": 0.496000, - "Standard_A7": 0.992000, - "Standard_A8_v2": 0.383000, - "Standard_A8m_v2": 0.611000, - "Standard_B12ms": 0.546000, - "Standard_B16als_v2": 0.578000, - "Standard_B16as_v2": 0.726000, - "Standard_B16ls_v2": 0.646000, - "Standard_B16ms": 0.728000, - "Standard_B16pls_v2": 0.595000, - "Standard_B16ps_v2": 0.589000, - "Standard_B16s_v2": 0.730000, - "Standard_B1ls": 0.005700, - "Standard_B1ms": 0.022700, - "Standard_B1s": 0.011300, - "Standard_B20ms": 0.909000, - "Standard_B2als_v2": 0.050000, - "Standard_B2as_v2": 0.090800, - "Standard_B2ats_v2": 0.019400, - "Standard_B2ls_v2": 0.045600, - "Standard_B2ms": 0.091000, - "Standard_B2pls_v2": 0.046000, - "Standard_B2ps_v2": 0.082800, - "Standard_B2pts_v2": 0.009200, - "Standard_B2s": 0.045000, - "Standard_B2s_v2": 0.091200, - "Standard_B2ts_v2": 0.020600, - "Standard_B32als_v2": 1.156000, - "Standard_B32as_v2": 1.453000, - "Standard_B32ls_v2": 1.292000, - "Standard_B32s_v2": 1.459000, - "Standard_B4als_v2": 0.163000, - "Standard_B4as_v2": 0.163000, - "Standard_B4ls_v2": 0.180000, - "Standard_B4ms": 0.182000, - "Standard_B4pls_v2": 0.149000, - "Standard_B4ps_v2": 0.147000, - "Standard_B4s_v2": 0.201000, - "Standard_B8als_v2": 0.326000, - "Standard_B8as_v2": 0.326000, - "Standard_B8ls_v2": 0.323000, - "Standard_B8ms": 0.364000, - "Standard_B8pls_v2": 0.261000, - "Standard_B8ps_v2": 0.294000, - "Standard_B8s_v2": 0.402000, - "Standard_D1": 0.073000, - "Standard_D11": 0.193000, - "Standard_D11_v2": 0.185000, - "Standard_D11_v2_Promo": 0.185000, - "Standard_D12": 0.386000, - "Standard_D12_v2": 0.371000, - "Standard_D12_v2_Promo": 0.371000, - "Standard_D13": 0.771000, - "Standard_D13_v2": 0.741000, - "Standard_D13_v2_Promo": 0.741000, - "Standard_D14": 1.542000, - "Standard_D14_v2": 1.482000, - "Standard_D14_v2_Promo": 1.482000, - "Standard_D15_v2": 1.853000, - "Standard_D15i_v2": 1.853000, - "Standard_D16_v3": 0.856000, - "Standard_D16_v4": 0.856000, - "Standard_D16_v5": 0.856000, - "Standard_D16a_v4": 0.856000, - "Standard_D16ads_v5": 0.920000, - "Standard_D16as_v4": 0.856000, - "Standard_D16as_v5": 0.768000, - "Standard_D16d_v4": 1.008000, - "Standard_D16d_v5": 1.008000, - "Standard_D16ds_v4": 1.008000, - "Standard_D16ds_v5": 1.008000, - "Standard_D16lds_v5": 0.872000, - "Standard_D16ls_v5": 0.730000, - "Standard_D16pds_v5": 0.806000, - "Standard_D16plds_v5": 0.698000, - "Standard_D16pls_v5": 0.584000, - "Standard_D16ps_v5": 0.688000, - "Standard_D16s_v3": 0.856000, - "Standard_D16s_v4": 0.856000, - "Standard_D16s_v5": 0.856000, - "Standard_D1_v2": 0.065800, - "Standard_D2": 0.146000, - "Standard_D2_v2": 0.132000, - "Standard_D2_v2_Promo": 0.132000, - "Standard_D2_v3": 0.107000, - "Standard_D2_v4": 0.107000, - "Standard_D2_v5": 0.107000, - "Standard_D2a_v4": 0.107000, - "Standard_D2ads_v5": 0.115000, - "Standard_D2as_v4": 0.107000, - "Standard_D2as_v5": 0.096000, - "Standard_D2d_v4": 0.126000, - "Standard_D2d_v5": 0.126000, - "Standard_D2ds_v4": 0.126000, - "Standard_D2ds_v5": 0.126000, - "Standard_D2lds_v5": 0.109000, - "Standard_D2ls_v5": 0.091200, - "Standard_D2pds_v5": 0.101000, - "Standard_D2plds_v5": 0.087200, - "Standard_D2pls_v5": 0.073000, - "Standard_D2ps_v5": 0.086000, - "Standard_D2s_v3": 0.107000, - "Standard_D2s_v4": 0.107000, - "Standard_D2s_v5": 0.107000, - "Standard_D3": 0.292000, - "Standard_D32-16s_v3": 1.712000, - "Standard_D32-8s_v3": 1.712000, - "Standard_D32_v3": 1.712000, - "Standard_D32_v4": 1.712000, - "Standard_D32_v5": 1.712000, - "Standard_D32a_v4": 1.712000, - "Standard_D32ads_v5": 1.840000, - "Standard_D32as_v4": 1.712000, - "Standard_D32as_v5": 1.536000, - "Standard_D32d_v4": 2.016000, - "Standard_D32d_v5": 2.016000, - "Standard_D32ds_v4": 2.016000, - "Standard_D32ds_v5": 2.016000, - "Standard_D32lds_v5": 1.744000, - "Standard_D32ls_v5": 1.459000, - "Standard_D32pds_v5": 1.613000, - "Standard_D32plds_v5": 1.395000, - "Standard_D32pls_v5": 1.167000, - "Standard_D32ps_v5": 1.376000, - "Standard_D32s_v3": 1.712000, - "Standard_D32s_v4": 1.712000, - "Standard_D32s_v5": 1.712000, - "Standard_D3_v2": 0.263000, - "Standard_D3_v2_Promo": 0.263000, - "Standard_D4": 0.584000, - "Standard_D48_v3": 2.568000, - "Standard_D48_v4": 2.568000, - "Standard_D48_v5": 2.568000, - "Standard_D48a_v4": 2.568000, - "Standard_D48ads_v5": 2.760000, - "Standard_D48as_v4": 2.568000, - "Standard_D48as_v5": 2.304000, - "Standard_D48d_v4": 3.024000, - "Standard_D48d_v5": 3.024000, - "Standard_D48ds_v4": 3.024000, - "Standard_D48ds_v5": 3.024000, - "Standard_D48lds_v5": 2.616000, - "Standard_D48ls_v5": 2.189000, - "Standard_D48pds_v5": 2.419000, - "Standard_D48plds_v5": 2.093000, - "Standard_D48pls_v5": 1.751000, - "Standard_D48ps_v5": 2.064000, - "Standard_D48s_v3": 2.568000, - "Standard_D48s_v4": 2.568000, - "Standard_D48s_v5": 2.568000, - "Standard_D4_v2": 0.527000, - "Standard_D4_v2_Promo": 0.527000, - "Standard_D4_v3": 0.214000, - "Standard_D4_v4": 0.214000, - "Standard_D4_v5": 0.214000, - "Standard_D4a_v4": 0.214000, - "Standard_D4ads_v5": 0.230000, - "Standard_D4as_v4": 0.214000, - "Standard_D4as_v5": 0.192000, - "Standard_D4d_v4": 0.252000, - "Standard_D4d_v5": 0.252000, - "Standard_D4ds_v4": 0.252000, - "Standard_D4ds_v5": 0.252000, - "Standard_D4lds_v5": 0.218000, - "Standard_D4ls_v5": 0.182000, - "Standard_D4pds_v5": 0.202000, - "Standard_D4plds_v5": 0.174000, - "Standard_D4pls_v5": 0.146000, - "Standard_D4ps_v5": 0.172000, - "Standard_D4s_v3": 0.214000, - "Standard_D4s_v4": 0.214000, - "Standard_D4s_v5": 0.214000, - "Standard_D5_v2": 1.053000, - "Standard_D5_v2_Promo": 1.053000, - "Standard_D64-16s_v3": 3.424000, - "Standard_D64-32s_v3": 3.424000, - "Standard_D64_v3": 3.424000, - "Standard_D64_v4": 3.424000, - "Standard_D64_v5": 3.424000, - "Standard_D64a_v4": 3.424000, - "Standard_D64ads_v5": 3.680000, - "Standard_D64as_v4": 3.424000, - "Standard_D64as_v5": 3.072000, - "Standard_D64d_v4": 4.032000, - "Standard_D64d_v5": 4.032000, - "Standard_D64ds_v4": 4.032000, - "Standard_D64ds_v5": 4.032000, - "Standard_D64lds_v5": 3.488000, - "Standard_D64ls_v5": 2.918000, - "Standard_D64pds_v5": 3.226000, - "Standard_D64plds_v5": 2.790000, - "Standard_D64pls_v5": 2.334000, - "Standard_D64ps_v5": 2.752000, - "Standard_D64s_v3": 3.424000, - "Standard_D64s_v4": 3.424000, - "Standard_D64s_v5": 3.424000, - "Standard_D8_v3": 0.428000, - "Standard_D8_v4": 0.428000, - "Standard_D8_v5": 0.428000, - "Standard_D8a_v4": 0.428000, - "Standard_D8ads_v5": 0.460000, - "Standard_D8as_v4": 0.428000, - "Standard_D8as_v5": 0.384000, - "Standard_D8d_v4": 0.504000, - "Standard_D8d_v5": 0.504000, - "Standard_D8ds_v4": 0.504000, - "Standard_D8ds_v5": 0.504000, - "Standard_D8lds_v5": 0.436000, - "Standard_D8ls_v5": 0.365000, - "Standard_D8pds_v5": 0.403000, - "Standard_D8plds_v5": 0.349000, - "Standard_D8pls_v5": 0.292000, - "Standard_D8ps_v5": 0.344000, - "Standard_D8s_v3": 0.428000, - "Standard_D8s_v4": 0.428000, - "Standard_D8s_v5": 0.428000, - "Standard_D96_v5": 5.136000, - "Standard_D96a_v4": 5.136000, - "Standard_D96ads_v5": 5.520000, - "Standard_D96as_v4": 5.136000, - "Standard_D96as_v5": 4.608000, - "Standard_D96d_v5": 6.048000, - "Standard_D96ds_v5": 6.048000, - "Standard_D96lds_v5": 5.232000, - "Standard_D96ls_v5": 4.378000, - "Standard_D96s_v5": 5.136000, - "Standard_DC16ads_cc_v5": 0.920000, - "Standard_DC16ads_v5": 0.920000, - "Standard_DC16as_cc_v5": 0.768000, - "Standard_DC16as_v5": 0.768000, - "Standard_DC16ds_v3": 2.016000, - "Standard_DC16eds_v5": 1.008000, - "Standard_DC16es_v5": 0.856000, - "Standard_DC16s_v3": 1.712000, - "Standard_DC1ds_v3": 0.126000, - "Standard_DC1s_v2": 0.107000, - "Standard_DC1s_v3": 0.107000, - "Standard_DC24ds_v3": 3.024000, - "Standard_DC24s_v3": 2.568000, - "Standard_DC2ads_v5": 0.115000, - "Standard_DC2as_v5": 0.096000, - "Standard_DC2ds_v3": 0.252000, - "Standard_DC2eds_v5": 0.126000, - "Standard_DC2es_v5": 0.107000, - "Standard_DC2s_v2": 0.214000, - "Standard_DC2s_v3": 0.214000, - "Standard_DC32ads_cc_v5": 1.840000, - "Standard_DC32ads_v5": 1.840000, - "Standard_DC32as_cc_v5": 1.536000, - "Standard_DC32as_v5": 1.536000, - "Standard_DC32ds_v3": 4.032000, - "Standard_DC32eds_v5": 2.016000, - "Standard_DC32es_v5": 1.712000, - "Standard_DC32s_v3": 3.424000, - "Standard_DC48ads_cc_v5": 2.760000, - "Standard_DC48ads_v5": 2.760000, - "Standard_DC48as_cc_v5": 2.304000, - "Standard_DC48as_v5": 2.304000, - "Standard_DC48ds_v3": 6.048000, - "Standard_DC48eds_v5": 3.024000, - "Standard_DC48es_v5": 2.568000, - "Standard_DC48s_v3": 5.136000, - "Standard_DC4ads_cc_v5": 0.230000, - "Standard_DC4ads_v5": 0.230000, - "Standard_DC4as_cc_v5": 0.192000, - "Standard_DC4as_v5": 0.192000, - "Standard_DC4ds_v3": 0.504000, - "Standard_DC4eds_v5": 0.252000, - "Standard_DC4es_v5": 0.214000, - "Standard_DC4s_v2": 0.428000, - "Standard_DC4s_v3": 0.428000, - "Standard_DC64ads_cc_v5": 3.680000, - "Standard_DC64ads_v5": 3.680000, - "Standard_DC64as_cc_v5": 3.072000, - "Standard_DC64as_v5": 3.072000, - "Standard_DC64eds_v5": 4.032000, - "Standard_DC64es_v5": 3.424000, - "Standard_DC8_v2": 0.856000, - "Standard_DC8ads_cc_v5": 0.460000, - "Standard_DC8ads_v5": 0.460000, - "Standard_DC8as_cc_v5": 0.384000, - "Standard_DC8as_v5": 0.384000, - "Standard_DC8ds_v3": 1.008000, - "Standard_DC8eds_v5": 0.504000, - "Standard_DC8es_v5": 0.428000, - "Standard_DC8s_v3": 0.856000, - "Standard_DC96ads_cc_v5": 5.520000, - "Standard_DC96ads_v5": 5.520000, - "Standard_DC96as_cc_v5": 4.608000, - "Standard_DC96as_v5": 4.608000, - "Standard_DC96eds_v5": 6.048000, - "Standard_DC96es_v5": 5.136000, - "Standard_DS1": 0.073000, - "Standard_DS11": 0.193000, - "Standard_DS11-1_v2": 0.185000, - "Standard_DS11_v2": 0.185000, - "Standard_DS11_v2_Promo": 0.185000, - "Standard_DS12": 0.386000, - "Standard_DS12-1_v2": 0.371000, - "Standard_DS12-2_v2": 0.371000, - "Standard_DS12_v2": 0.371000, - "Standard_DS12_v2_Promo": 0.371000, - "Standard_DS13": 0.771000, - "Standard_DS13-2_v2": 0.741000, - "Standard_DS13-4_v2": 0.741000, - "Standard_DS13_v2": 0.741000, - "Standard_DS13_v2_Promo": 0.741000, - "Standard_DS14": 1.542000, - "Standard_DS14-4_v2": 1.482000, - "Standard_DS14-8_v2": 1.482000, - "Standard_DS14_v2": 1.482000, - "Standard_DS14_v2_Promo": 1.482000, - "Standard_DS15_v2": 1.853000, - "Standard_DS15i_v2": 1.853000, - "Standard_DS1_v2": 0.065800, - "Standard_DS2": 0.146000, - "Standard_DS2_v2": 0.132000, - "Standard_DS2_v2_Promo": 0.132000, - "Standard_DS3": 0.292000, - "Standard_DS3_v2": 0.263000, - "Standard_DS3_v2_Promo": 0.263000, - "Standard_DS4": 0.584000, - "Standard_DS4_v2": 0.527000, - "Standard_DS4_v2_Promo": 0.527000, - "Standard_DS5_v2": 1.053000, - "Standard_DS5_v2_Promo": 1.053000, - "Standard_E104i_v5": 8.065000, - "Standard_E104id_v5": 9.152000, - "Standard_E104ids_v5": 9.152000, - "Standard_E104is_v5": 8.065000, - "Standard_E112iads_v5": 8.994000, - "Standard_E112ias_v5": 7.823000, - "Standard_E112ibds_v5": 11.519000, - "Standard_E112ibs_v5": 10.349000, - "Standard_E16-4ads_v5": 1.168000, - "Standard_E16-4as_v4": 1.128000, - "Standard_E16-4as_v5": 1.016000, - "Standard_E16-4ds_v4": 1.280000, - "Standard_E16-4ds_v5": 1.280000, - "Standard_E16-4s_v3": 1.128000, - "Standard_E16-4s_v4": 1.128000, - "Standard_E16-4s_v5": 1.128000, - "Standard_E16-8ads_v5": 1.168000, - "Standard_E16-8as_v4": 1.128000, - "Standard_E16-8as_v5": 1.016000, - "Standard_E16-8ds_v4": 1.280000, - "Standard_E16-8ds_v5": 1.280000, - "Standard_E16-8s_v3": 1.128000, - "Standard_E16-8s_v4": 1.128000, - "Standard_E16-8s_v5": 1.128000, - "Standard_E16_v3": 1.128000, - "Standard_E16_v4": 1.128000, - "Standard_E16_v5": 1.128000, - "Standard_E16a_v4": 1.128000, - "Standard_E16ads_v5": 1.168000, - "Standard_E16as_v4": 1.128000, - "Standard_E16as_v5": 1.016000, - "Standard_E16bds_v5": 1.496000, - "Standard_E16bs_v5": 1.344000, - "Standard_E16d_v4": 1.280000, - "Standard_E16d_v5": 1.280000, - "Standard_E16ds_v4": 1.280000, - "Standard_E16ds_v5": 1.280000, - "Standard_E16pds_v5": 1.024000, - "Standard_E16ps_v5": 0.902000, - "Standard_E16s_v3": 1.128000, - "Standard_E16s_v4": 1.128000, - "Standard_E16s_v5": 1.128000, - "Standard_E20_v3": 1.410000, - "Standard_E20_v4": 1.410000, - "Standard_E20_v5": 1.410000, - "Standard_E20a_v4": 1.410000, - "Standard_E20ads_v5": 1.460000, - "Standard_E20as_v4": 1.410000, - "Standard_E20as_v5": 1.270000, - "Standard_E20d_v4": 1.600000, - "Standard_E20d_v5": 1.600000, - "Standard_E20ds_v4": 1.600000, - "Standard_E20ds_v5": 1.600000, - "Standard_E20pds_v5": 1.280000, - "Standard_E20ps_v5": 1.128000, - "Standard_E20s_v3": 1.410000, - "Standard_E20s_v4": 1.410000, - "Standard_E20s_v5": 1.410000, - "Standard_E2_v3": 0.141000, - "Standard_E2_v4": 0.141000, - "Standard_E2_v5": 0.141000, - "Standard_E2a_v4": 0.141000, - "Standard_E2ads_v5": 0.146000, - "Standard_E2as_v4": 0.141000, - "Standard_E2as_v5": 0.127000, - "Standard_E2bds_v5": 0.187000, - "Standard_E2bs_v5": 0.168000, - "Standard_E2d_v4": 0.160000, - "Standard_E2d_v5": 0.160000, - "Standard_E2ds_v4": 0.160000, - "Standard_E2ds_v5": 0.160000, - "Standard_E2pds_v5": 0.128000, - "Standard_E2ps_v5": 0.113000, - "Standard_E2s_v3": 0.141000, - "Standard_E2s_v4": 0.141000, - "Standard_E2s_v5": 0.141000, - "Standard_E32-16ads_v5": 2.336000, - "Standard_E32-16as_v4": 2.256000, - "Standard_E32-16as_v5": 2.032000, - "Standard_E32-16ds_v4": 2.560000, - "Standard_E32-16ds_v5": 2.560000, - "Standard_E32-16s_v3": 2.256000, - "Standard_E32-16s_v4": 2.256000, - "Standard_E32-16s_v5": 2.256000, - "Standard_E32-8ads_v5": 2.336000, - "Standard_E32-8as_v4": 2.256000, - "Standard_E32-8as_v5": 2.032000, - "Standard_E32-8ds_v4": 2.560000, - "Standard_E32-8ds_v5": 2.560000, - "Standard_E32-8s_v3": 2.256000, - "Standard_E32-8s_v4": 2.256000, - "Standard_E32-8s_v5": 2.256000, - "Standard_E32_v3": 2.256000, - "Standard_E32_v4": 2.256000, - "Standard_E32_v5": 2.256000, - "Standard_E32a_v4": 2.256000, - "Standard_E32ads_v5": 2.336000, - "Standard_E32as_v4": 2.256000, - "Standard_E32as_v5": 2.032000, - "Standard_E32bds_v5": 2.992000, - "Standard_E32bs_v5": 2.688000, - "Standard_E32d_v4": 2.560000, - "Standard_E32d_v5": 2.560000, - "Standard_E32ds_v4": 2.560000, - "Standard_E32ds_v5": 2.560000, - "Standard_E32pds_v5": 2.048000, - "Standard_E32ps_v5": 1.805000, - "Standard_E32s_v3": 2.256000, - "Standard_E32s_v4": 2.256000, - "Standard_E32s_v5": 2.256000, - "Standard_E4-2ads_v5": 0.292000, - "Standard_E4-2as_v4": 0.282000, - "Standard_E4-2as_v5": 0.254000, - "Standard_E4-2ds_v4": 0.320000, - "Standard_E4-2ds_v5": 0.320000, - "Standard_E4-2s_v3": 0.282000, - "Standard_E4-2s_v4": 0.282000, - "Standard_E4-2s_v5": 0.282000, - "Standard_E48_v3": 3.384000, - "Standard_E48_v4": 3.384000, - "Standard_E48_v5": 3.384000, - "Standard_E48a_v4": 3.384000, - "Standard_E48ads_v5": 3.504000, - "Standard_E48as_v4": 3.384000, - "Standard_E48as_v5": 3.048000, - "Standard_E48bds_v5": 4.488000, - "Standard_E48bs_v5": 4.032000, - "Standard_E48d_v4": 3.840000, - "Standard_E48d_v5": 3.840000, - "Standard_E48ds_v4": 3.840000, - "Standard_E48ds_v5": 3.840000, - "Standard_E48s_v3": 3.384000, - "Standard_E48s_v4": 3.384000, - "Standard_E48s_v5": 3.384000, - "Standard_E4_v3": 0.282000, - "Standard_E4_v4": 0.282000, - "Standard_E4_v5": 0.282000, - "Standard_E4a_v4": 0.282000, - "Standard_E4ads_v5": 0.292000, - "Standard_E4as_v4": 0.282000, - "Standard_E4as_v5": 0.254000, - "Standard_E4bds_v5": 0.374000, - "Standard_E4bs_v5": 0.336000, - "Standard_E4d_v4": 0.320000, - "Standard_E4d_v5": 0.320000, - "Standard_E4ds_v4": 0.320000, - "Standard_E4ds_v5": 0.320000, - "Standard_E4pds_v5": 0.256000, - "Standard_E4ps_v5": 0.226000, - "Standard_E4s_v3": 0.282000, - "Standard_E4s_v4": 0.282000, - "Standard_E4s_v5": 0.282000, - "Standard_E64-16ads_v5": 4.672000, - "Standard_E64-16as_v4": 4.512000, - "Standard_E64-16as_v5": 4.064000, - "Standard_E64-16ds_v4": 5.120000, - "Standard_E64-16ds_v5": 5.120000, - "Standard_E64-16s_v3": 4.061000, - "Standard_E64-16s_v4": 4.512000, - "Standard_E64-16s_v5": 4.512000, - "Standard_E64-32ads_v5": 4.672000, - "Standard_E64-32as_v4": 4.512000, - "Standard_E64-32as_v5": 4.064000, - "Standard_E64-32ds_v4": 5.120000, - "Standard_E64-32ds_v5": 5.120000, - "Standard_E64-32s_v3": 4.061000, - "Standard_E64-32s_v4": 4.512000, - "Standard_E64-32s_v5": 4.512000, - "Standard_E64_v3": 4.061000, - "Standard_E64_v4": 4.512000, - "Standard_E64_v5": 4.512000, - "Standard_E64a_v4": 4.512000, - "Standard_E64ads_v5": 4.672000, - "Standard_E64as_v4": 4.512000, - "Standard_E64as_v5": 4.064000, - "Standard_E64bds_v5": 5.984000, - "Standard_E64bs_v5": 5.376000, - "Standard_E64d_v4": 5.120000, - "Standard_E64d_v5": 5.120000, - "Standard_E64ds_v4": 5.120000, - "Standard_E64ds_v5": 5.120000, - "Standard_E64i_v3": 4.061000, - "Standard_E64is_v3": 4.061000, - "Standard_E64s_v3": 4.061000, - "Standard_E64s_v4": 4.512000, - "Standard_E64s_v5": 4.512000, - "Standard_E8-2ads_v5": 0.584000, - "Standard_E8-2as_v4": 0.564000, - "Standard_E8-2as_v5": 0.508000, - "Standard_E8-2ds_v4": 0.640000, - "Standard_E8-2ds_v5": 0.640000, - "Standard_E8-2s_v3": 0.564000, - "Standard_E8-2s_v4": 0.564000, - "Standard_E8-2s_v5": 0.564000, - "Standard_E8-4ads_v5": 0.584000, - "Standard_E8-4as_v4": 0.564000, - "Standard_E8-4as_v5": 0.508000, - "Standard_E8-4ds_v4": 0.640000, - "Standard_E8-4ds_v5": 0.640000, - "Standard_E8-4s_v3": 0.564000, - "Standard_E8-4s_v4": 0.564000, - "Standard_E8-4s_v5": 0.564000, - "Standard_E80ids_v4": 6.400000, - "Standard_E80is_v4": 5.640000, - "Standard_E8_v3": 0.564000, - "Standard_E8_v4": 0.564000, - "Standard_E8_v5": 0.564000, - "Standard_E8a_v4": 0.564000, - "Standard_E8ads_v5": 0.584000, - "Standard_E8as_v4": 0.564000, - "Standard_E8as_v5": 0.508000, - "Standard_E8bds_v5": 0.748000, - "Standard_E8bs_v5": 0.672000, - "Standard_E8d_v4": 0.640000, - "Standard_E8d_v5": 0.640000, - "Standard_E8ds_v4": 0.640000, - "Standard_E8ds_v5": 0.640000, - "Standard_E8pds_v5": 0.512000, - "Standard_E8ps_v5": 0.451000, - "Standard_E8s_v3": 0.564000, - "Standard_E8s_v4": 0.564000, - "Standard_E8s_v5": 0.564000, - "Standard_E96-24ads_v5": 7.008000, - "Standard_E96-24as_v4": 6.768000, - "Standard_E96-24as_v5": 6.096000, - "Standard_E96-24ds_v5": 7.680000, - "Standard_E96-24s_v5": 6.768000, - "Standard_E96-48ads_v5": 7.008000, - "Standard_E96-48as_v4": 6.768000, - "Standard_E96-48as_v5": 6.096000, - "Standard_E96-48ds_v5": 7.680000, - "Standard_E96-48s_v5": 6.768000, - "Standard_E96_v5": 6.768000, - "Standard_E96a_v4": 6.768000, - "Standard_E96ads_v5": 7.008000, - "Standard_E96as_v4": 6.768000, - "Standard_E96as_v5": 6.096000, - "Standard_E96bds_v5": 8.976000, - "Standard_E96bs_v5": 8.064000, - "Standard_E96d_v5": 7.680000, - "Standard_E96ds_v5": 7.680000, - "Standard_E96iads_v5": 7.709000, - "Standard_E96ias_v5": 6.706000, - "Standard_E96s_v5": 6.768000, - "Standard_EC16ads_cc_v5": 1.168000, - "Standard_EC16ads_v5": 1.168000, - "Standard_EC16as_cc_v5": 1.016000, - "Standard_EC16as_v5": 1.016000, - "Standard_EC16eds_v5": 1.280000, - "Standard_EC16es_v5": 1.128000, - "Standard_EC20ads_cc_v5": 1.460000, - "Standard_EC20ads_v5": 1.460000, - "Standard_EC20as_cc_v5": 1.270000, - "Standard_EC20as_v5": 1.270000, - "Standard_EC2ads_v5": 0.146000, - "Standard_EC2as_v5": 0.127000, - "Standard_EC2eds_v5": 0.160000, - "Standard_EC2es_v5": 0.141000, - "Standard_EC32ads_cc_v5": 2.336000, - "Standard_EC32ads_v5": 2.336000, - "Standard_EC32as_cc_v5": 2.032000, - "Standard_EC32as_v5": 2.032000, - "Standard_EC32eds_v5": 2.560000, - "Standard_EC32es_v5": 2.256000, - "Standard_EC48ads_cc_v5": 3.504000, - "Standard_EC48ads_v5": 3.504000, - "Standard_EC48as_cc_v5": 3.048000, - "Standard_EC48as_v5": 3.048000, - "Standard_EC48eds_v5": 3.840000, - "Standard_EC48es_v5": 3.384000, - "Standard_EC4ads_cc_v5": 0.292000, - "Standard_EC4ads_v5": 0.292000, - "Standard_EC4as_cc_v5": 0.254000, - "Standard_EC4as_v5": 0.254000, - "Standard_EC4eds_v5": 0.320000, - "Standard_EC4es_v5": 0.282000, - "Standard_EC64ads_cc_v5": 4.672000, - "Standard_EC64ads_v5": 4.672000, - "Standard_EC64as_cc_v5": 4.064000, - "Standard_EC64as_v5": 4.064000, - "Standard_EC64eds_v5": 5.120000, - "Standard_EC64es_v5": 4.512000, - "Standard_EC8ads_cc_v5": 0.584000, - "Standard_EC8ads_v5": 0.584000, - "Standard_EC8as_cc_v5": 0.508000, - "Standard_EC8as_v5": 0.508000, - "Standard_EC8eds_v5": 0.640000, - "Standard_EC8es_v5": 0.564000, - "Standard_EC96ads_cc_v5": 7.008000, - "Standard_EC96ads_v5": 7.008000, - "Standard_EC96as_cc_v5": 6.096000, - "Standard_EC96as_v5": 6.096000, - "Standard_EC96eds_v5": 7.680000, - "Standard_EC96es_v5": 6.768000, - "Standard_EC96iads_v5": 7.709000, - "Standard_EC96ias_v5": 6.706000, - "Standard_F1": 0.056600, - "Standard_F16": 0.905000, - "Standard_F16s": 0.905000, - "Standard_F16s_v2": 0.768000, - "Standard_F1s": 0.056600, - "Standard_F2": 0.113000, - "Standard_F2s": 0.113000, - "Standard_F2s_v2": 0.096000, - "Standard_F32s_v2": 1.536000, - "Standard_F4": 0.226000, - "Standard_F48s_v2": 2.304000, - "Standard_F4s": 0.226000, - "Standard_F4s_v2": 0.192000, - "Standard_F64s_v2": 3.072000, - "Standard_F72s_v2": 3.456000, - "Standard_F8": 0.452000, - "Standard_F8s": 0.452000, - "Standard_F8s_v2": 0.384000, - "Standard_FX12mds": 1.248000, - "Standard_FX24mds": 2.496000, - "Standard_FX36mds": 3.744000, - "Standard_FX48mds": 4.992000, - "Standard_FX4mds": 0.416000, - "Standard_H16": 1.941000, - "Standard_H16m": 2.601000, - "Standard_H16mr": 2.861000, - "Standard_H16r": 2.136000, - "Standard_H8": 0.971000, - "Standard_H8m": 1.301000, - "Standard_HC44-16rs": 3.802000, - "Standard_HC44-32rs": 3.802000, - "Standard_HC44rs": 3.802000, - "Standard_L112ias_v3": 10.595000, - "Standard_L16as_v3": 1.376000, - "Standard_L16s_v2": 1.376000, - "Standard_L16s_v3": 1.536000, - "Standard_L32as_v3": 2.752000, - "Standard_L32s_v2": 2.752000, - "Standard_L32s_v3": 3.072000, - "Standard_L48as_v3": 4.128000, - "Standard_L48s_v2": 4.128000, - "Standard_L48s_v3": 4.608000, - "Standard_L64as_v3": 5.504000, - "Standard_L64s_v2": 5.504000, - "Standard_L64s_v3": 6.144000, - "Standard_L80as_v3": 6.880000, - "Standard_L80s_v2": 6.880000, - "Standard_L80s_v3": 7.680000, - "Standard_L88is_v2": 7.568000, - "Standard_L8as_v3": 0.688000, - "Standard_L8s_v2": 0.688000, - "Standard_L8s_v3": 0.768000, - "Standard_L96ias_v3": 9.082000, - "Standard_M128": 16.006000, - "Standard_M128-32ms": 32.025600, - "Standard_M128-64ms": 32.025600, - "Standard_M128dms_v2": 32.028000, - "Standard_M128ds_v2": 16.008000, - "Standard_M128m": 32.025600, - "Standard_M128ms": 32.025600, - "Standard_M128ms_v2": 31.523000, - "Standard_M128s": 16.006000, - "Standard_M128s_v2": 15.503000, - "Standard_M16-4ms": 3.687600, - "Standard_M16-8ms": 3.687600, - "Standard_M16ms": 3.687600, - "Standard_M16s": 2.864000, - "Standard_M192idms_v2": 38.477000, - "Standard_M192ids_v2": 19.238000, - "Standard_M192ims_v2": 37.972000, - "Standard_M192is_v2": 18.733000, - "Standard_M208-104ms_v2": 49.974000, - "Standard_M208-104s_v2": 24.987000, - "Standard_M208-52ms_v2": 49.974000, - "Standard_M208-52s_v2": 24.987000, - "Standard_M208ms_v2": 49.974000, - "Standard_M208s_v2": 24.987000, - "Standard_M32-16ms": 7.375200, - "Standard_M32-8ms": 7.375200, - "Standard_M32dms_v2": 7.375000, - "Standard_M32ls": 3.189000, - "Standard_M32ms": 7.375200, - "Standard_M32ms_v2": 7.249000, - "Standard_M32s": 4.002000, - "Standard_M32ts": 3.004770, - "Standard_M416-104ms_v2": 111.050000, - "Standard_M416-104s_v2": 55.530000, - "Standard_M416-208ms_v2": 111.050000, - "Standard_M416-208s_v2": 55.530000, - "Standard_M416is_v2": 55.530000, - "Standard_M416ms_v2": 111.050000, - "Standard_M416s_8_v2": 73.980000, - "Standard_M416s_v2": 55.530000, - "Standard_M64": 8.003000, - "Standard_M64-16ms": 12.405000, - "Standard_M64-32ms": 12.405000, - "Standard_M64dms_v2": 12.408000, - "Standard_M64ds_v2": 8.003000, - "Standard_M64ls": 6.010650, - "Standard_M64m": 12.405000, - "Standard_M64ms": 12.405000, - "Standard_M64ms_v2": 12.156000, - "Standard_M64s": 8.003000, - "Standard_M64s_v2": 7.750000, - "Standard_M8-2ms": 1.843800, - "Standard_M8-4ms": 1.843800, - "Standard_M8ms": 1.843800, - "Standard_NC12": 1.944000, - "Standard_NC12s_v3": 6.610000, - "Standard_NC16as_T4_v3": 1.342000, - "Standard_NC24": 3.888000, - "Standard_NC24ads_A100_v4": 4.408000, - "Standard_NC24r": 4.277000, - "Standard_NC24rs_v3": 14.541000, - "Standard_NC24s_v3": 13.219000, - "Standard_NC48ads_A100_v4": 8.815000, - "Standard_NC4as_T4_v3": 0.587000, - "Standard_NC6": 0.972000, - "Standard_NC64as_T4_v3": 4.853000, - "Standard_NC6s_v3": 3.305000, - "Standard_NC8as_T4_v3": 0.838000, - "Standard_NC96ads_A100_v4": 17.630000, - "Standard_NV12": 2.420000, - "Standard_NV12ads_A10_v5": 1.090000, - "Standard_NV12s_v3": 1.210000, - "Standard_NV16as_v4": 1.118000, - "Standard_NV18ads_A10_v5": 1.920000, - "Standard_NV24": 4.840000, - "Standard_NV24s_v3": 2.420000, - "Standard_NV32as_v4": 2.237000, - "Standard_NV36adms_A10_v5": 5.424000, - "Standard_NV36ads_A10_v5": 3.840000, - "Standard_NV48s_v3": 4.838000, - "Standard_NV4as_v4": 0.280000, - "Standard_NV6": 1.210000, - "Standard_NV6ads_A10_v5": 0.545000, - "Standard_NV72ads_A10_v5": 7.824000, - "Standard_NV8as_v4": 0.559000, - } - // norwayeast - initialOnDemandPrices["norwayeast"] = map[string]float64{ - "Dadsv5_Type1": 9.073000, - "Dasv4_Type1": 7.550000, - "Dasv4_Type2": 7.550000, - "Dasv5_Type1": 7.576000, - "Ddsv5_Type1": 7.899000, - "Dsv3_Type3": 6.042000, - "Dsv3_Type4": 7.552000, - "Dsv5_Type1": 6.958000, - "Eadsv5_Type1": 9.891000, - "Easv4_Type1": 9.514000, - "Easv4_Type2": 9.514000, - "Easv5_Type1": 8.532000, - "Ebdsv5-Type1": 8.406000, - "Ebsv5-Type1": 7.500000, - "Edsv5_Type1": 10.048000, - "Esv3_Type3": 6.145000, - "Esv3_Type4": 8.325000, - "Esv5_Type1": 8.828000, - "Fsv2 Type3": 5.398800, - "Fsv2_Type2": 4.225100, - "Fsv2_Type4": 5.867400, - "Lasv3_Type1": 9.816000, - "Lsv3_Type1": 10.980000, - "Mdsmv2MedMem _Type1": 41.983000, - "Mdsv2MedMem_Type1": 20.984000, - "Ms_Type1": 20.976000, - "Msm_Type1": 41.989000, - "Msmv2MedMem Type1": 41.321000, - "Msv2MedMem Type1": 20.322000, - "NVsv3_Type1": 9.718000, - "Standard_A1_v2": 0.045100, - "Standard_A2_v2": 0.095700, - "Standard_A2m_v2": 0.136000, - "Standard_A4_v2": 0.201000, - "Standard_A4m_v2": 0.286000, - "Standard_A8_v2": 0.421000, - "Standard_A8m_v2": 0.601000, - "Standard_B12ms": 0.634000, - "Standard_B16als_v2": 0.747000, - "Standard_B16as_v2": 0.834000, - "Standard_B16ls_v2": 0.822000, - "Standard_B16ms": 0.845000, - "Standard_B16s_v2": 0.845000, - "Standard_B1ls": 0.006600, - "Standard_B1ms": 0.026400, - "Standard_B1s": 0.013200, - "Standard_B20ms": 1.056000, - "Standard_B2als_v2": 0.047500, - "Standard_B2as_v2": 0.095000, - "Standard_B2ats_v2": 0.021100, - "Standard_B2ls_v2": 0.062000, - "Standard_B2ms": 0.106000, - "Standard_B2s": 0.052800, - "Standard_B2s_v2": 0.106000, - "Standard_B2ts_v2": 0.013200, - "Standard_B32als_v2": 1.494000, - "Standard_B32as_v2": 1.521000, - "Standard_B32ls_v2": 1.643000, - "Standard_B32s_v2": 1.837000, - "Standard_B4als_v2": 0.187000, - "Standard_B4as_v2": 0.208000, - "Standard_B4ls_v2": 0.187000, - "Standard_B4ms": 0.211000, - "Standard_B4s_v2": 0.230000, - "Standard_B8als_v2": 0.374000, - "Standard_B8as_v2": 0.380000, - "Standard_B8ls_v2": 0.411000, - "Standard_B8ms": 0.422000, - "Standard_B8s_v2": 0.459000, - "Standard_D11_v2": 0.209000, - "Standard_D12_v2": 0.417000, - "Standard_D13_v2": 0.835000, - "Standard_D14_v2": 1.670000, - "Standard_D15_v2": 2.087000, - "Standard_D15i_v2": 2.087000, - "Standard_D16_v3": 1.056000, - "Standard_D16_v4": 1.012000, - "Standard_D16_v5": 1.012000, - "Standard_D16a_v4": 1.098000, - "Standard_D16ads_v5": 1.178000, - "Standard_D16as_v4": 1.098000, - "Standard_D16as_v5": 0.984000, - "Standard_D16d_v4": 1.197000, - "Standard_D16d_v5": 1.197000, - "Standard_D16ds_v4": 1.197000, - "Standard_D16ds_v5": 1.197000, - "Standard_D16lds_v5": 1.098000, - "Standard_D16ls_v5": 0.972000, - "Standard_D16s_v3": 1.056000, - "Standard_D16s_v4": 1.012000, - "Standard_D16s_v5": 1.012000, - "Standard_D1_v2": 0.074700, - "Standard_D2_v2": 0.150000, - "Standard_D2_v3": 0.132000, - "Standard_D2_v4": 0.126000, - "Standard_D2_v5": 0.127000, - "Standard_D2a_v4": 0.137000, - "Standard_D2ads_v5": 0.147000, - "Standard_D2as_v4": 0.137000, - "Standard_D2as_v5": 0.123000, - "Standard_D2d_v4": 0.150000, - "Standard_D2d_v5": 0.150000, - "Standard_D2ds_v4": 0.150000, - "Standard_D2ds_v5": 0.150000, - "Standard_D2lds_v5": 0.137000, - "Standard_D2ls_v5": 0.122000, - "Standard_D2s_v3": 0.132000, - "Standard_D2s_v4": 0.126000, - "Standard_D2s_v5": 0.127000, - "Standard_D32-16s_v3": 2.112000, - "Standard_D32-8s_v3": 2.112000, - "Standard_D32_v3": 2.112000, - "Standard_D32_v4": 2.024000, - "Standard_D32_v5": 2.024000, - "Standard_D32a_v4": 2.196000, - "Standard_D32ads_v5": 2.357000, - "Standard_D32as_v4": 2.196000, - "Standard_D32as_v5": 1.968000, - "Standard_D32d_v4": 2.394000, - "Standard_D32d_v5": 2.394000, - "Standard_D32ds_v4": 2.394000, - "Standard_D32ds_v5": 2.394000, - "Standard_D32lds_v5": 2.196000, - "Standard_D32ls_v5": 1.945000, - "Standard_D32s_v3": 2.112000, - "Standard_D32s_v4": 2.024000, - "Standard_D32s_v5": 2.024000, - "Standard_D3_v2": 0.299000, - "Standard_D48_v3": 3.168000, - "Standard_D48_v4": 3.036000, - "Standard_D48_v5": 3.036000, - "Standard_D48a_v4": 3.295000, - "Standard_D48ads_v5": 3.535000, - "Standard_D48as_v4": 3.295000, - "Standard_D48as_v5": 2.952000, - "Standard_D48d_v4": 3.590000, - "Standard_D48d_v5": 3.590000, - "Standard_D48ds_v4": 3.590000, - "Standard_D48ds_v5": 3.590000, - "Standard_D48lds_v5": 3.295000, - "Standard_D48ls_v5": 2.917000, - "Standard_D48s_v3": 3.168000, - "Standard_D48s_v4": 3.036000, - "Standard_D48s_v5": 3.036000, - "Standard_D4_v2": 0.598000, - "Standard_D4_v3": 0.264000, - "Standard_D4_v4": 0.253000, - "Standard_D4_v5": 0.253000, - "Standard_D4a_v4": 0.275000, - "Standard_D4ads_v5": 0.295000, - "Standard_D4as_v4": 0.275000, - "Standard_D4as_v5": 0.246000, - "Standard_D4d_v4": 0.299000, - "Standard_D4d_v5": 0.299000, - "Standard_D4ds_v4": 0.299000, - "Standard_D4ds_v5": 0.299000, - "Standard_D4lds_v5": 0.275000, - "Standard_D4ls_v5": 0.243000, - "Standard_D4s_v3": 0.264000, - "Standard_D4s_v4": 0.253000, - "Standard_D4s_v5": 0.253000, - "Standard_D5_v2": 1.196000, - "Standard_D64-16s_v3": 4.224000, - "Standard_D64-32s_v3": 4.224000, - "Standard_D64_v3": 4.224000, - "Standard_D64_v4": 4.048000, - "Standard_D64_v5": 4.048000, - "Standard_D64a_v4": 4.393000, - "Standard_D64ads_v5": 4.713000, - "Standard_D64as_v4": 4.393000, - "Standard_D64as_v5": 3.935000, - "Standard_D64d_v4": 4.787000, - "Standard_D64d_v5": 4.787000, - "Standard_D64ds_v4": 4.787000, - "Standard_D64ds_v5": 4.787000, - "Standard_D64lds_v5": 4.393000, - "Standard_D64ls_v5": 3.890000, - "Standard_D64s_v3": 4.224000, - "Standard_D64s_v4": 4.048000, - "Standard_D64s_v5": 4.048000, - "Standard_D8_v3": 0.528000, - "Standard_D8_v4": 0.506000, - "Standard_D8_v5": 0.506000, - "Standard_D8a_v4": 0.549000, - "Standard_D8ads_v5": 0.589000, - "Standard_D8as_v4": 0.549000, - "Standard_D8as_v5": 0.492000, - "Standard_D8d_v4": 0.598000, - "Standard_D8d_v5": 0.598000, - "Standard_D8ds_v4": 0.598000, - "Standard_D8ds_v5": 0.598000, - "Standard_D8lds_v5": 0.549000, - "Standard_D8ls_v5": 0.486000, - "Standard_D8s_v3": 0.528000, - "Standard_D8s_v4": 0.506000, - "Standard_D8s_v5": 0.506000, - "Standard_D96_v5": 6.072000, - "Standard_D96a_v4": 6.589000, - "Standard_D96ads_v5": 7.070000, - "Standard_D96as_v4": 6.589000, - "Standard_D96as_v5": 5.903000, - "Standard_D96d_v5": 7.181000, - "Standard_D96ds_v5": 7.181000, - "Standard_D96lds_v5": 6.589000, - "Standard_D96ls_v5": 5.834000, - "Standard_D96s_v5": 6.072000, - "Standard_DS11-1_v2": 0.209000, - "Standard_DS11_v2": 0.209000, - "Standard_DS12-1_v2": 0.417000, - "Standard_DS12-2_v2": 0.417000, - "Standard_DS12_v2": 0.417000, - "Standard_DS13-2_v2": 0.835000, - "Standard_DS13-4_v2": 0.835000, - "Standard_DS13_v2": 0.835000, - "Standard_DS14-4_v2": 1.670000, - "Standard_DS14-8_v2": 1.670000, - "Standard_DS14_v2": 1.670000, - "Standard_DS15_v2": 2.087000, - "Standard_DS15i_v2": 2.087000, - "Standard_DS1_v2": 0.074700, - "Standard_DS2_v2": 0.150000, - "Standard_DS3_v2": 0.299000, - "Standard_DS4_v2": 0.598000, - "Standard_DS5_v2": 1.196000, - "Standard_E104i_v5": 9.564000, - "Standard_E104id_v5": 10.885000, - "Standard_E104ids_v5": 10.885000, - "Standard_E104is_v5": 9.564000, - "Standard_E112iads_v5": 11.540000, - "Standard_E112ias_v5": 9.954000, - "Standard_E112ibds_v5": 14.711000, - "Standard_E112ibs_v5": 13.125000, - "Standard_E16-4ads_v5": 1.499000, - "Standard_E16-4as_v4": 1.441000, - "Standard_E16-4as_v5": 1.293000, - "Standard_E16-4ds_v4": 1.522000, - "Standard_E16-4ds_v5": 1.522000, - "Standard_E16-4s_v3": 1.408000, - "Standard_E16-4s_v4": 1.338000, - "Standard_E16-4s_v5": 1.338000, - "Standard_E16-8ads_v5": 1.499000, - "Standard_E16-8as_v4": 1.441000, - "Standard_E16-8as_v5": 1.293000, - "Standard_E16-8ds_v4": 1.522000, - "Standard_E16-8ds_v5": 1.522000, - "Standard_E16-8s_v3": 1.408000, - "Standard_E16-8s_v4": 1.338000, - "Standard_E16-8s_v5": 1.338000, - "Standard_E16_v3": 1.408000, - "Standard_E16_v4": 1.338000, - "Standard_E16_v5": 1.338000, - "Standard_E16a_v4": 1.441000, - "Standard_E16ads_v5": 1.499000, - "Standard_E16as_v4": 1.441000, - "Standard_E16as_v5": 1.293000, - "Standard_E16bds_v5": 1.910000, - "Standard_E16bs_v5": 1.705000, - "Standard_E16d_v4": 1.522000, - "Standard_E16d_v5": 1.522000, - "Standard_E16ds_v4": 1.522000, - "Standard_E16ds_v5": 1.522000, - "Standard_E16s_v3": 1.408000, - "Standard_E16s_v4": 1.338000, - "Standard_E16s_v5": 1.338000, - "Standard_E20_v3": 1.760000, - "Standard_E20_v4": 1.672000, - "Standard_E20_v5": 1.672000, - "Standard_E20a_v4": 1.802000, - "Standard_E20ads_v5": 1.873000, - "Standard_E20as_v4": 1.802000, - "Standard_E20as_v5": 1.616000, - "Standard_E20d_v4": 1.903000, - "Standard_E20d_v5": 1.903000, - "Standard_E20ds_v4": 1.903000, - "Standard_E20ds_v5": 1.903000, - "Standard_E20s_v3": 1.760000, - "Standard_E20s_v4": 1.672000, - "Standard_E20s_v5": 1.672000, - "Standard_E2_v3": 0.176000, - "Standard_E2_v4": 0.167000, - "Standard_E2_v5": 0.167000, - "Standard_E2a_v4": 0.180000, - "Standard_E2ads_v5": 0.187000, - "Standard_E2as_v4": 0.180000, - "Standard_E2as_v5": 0.162000, - "Standard_E2bds_v5": 0.239000, - "Standard_E2bs_v5": 0.213000, - "Standard_E2d_v4": 0.190000, - "Standard_E2d_v5": 0.190000, - "Standard_E2ds_v4": 0.190000, - "Standard_E2ds_v5": 0.190000, - "Standard_E2s_v3": 0.176000, - "Standard_E2s_v4": 0.167000, - "Standard_E2s_v5": 0.167000, - "Standard_E32-16ads_v5": 2.997000, - "Standard_E32-16as_v4": 2.883000, - "Standard_E32-16as_v5": 2.585000, - "Standard_E32-16ds_v4": 3.045000, - "Standard_E32-16ds_v5": 3.045000, - "Standard_E32-16s_v3": 2.816000, - "Standard_E32-16s_v4": 2.675000, - "Standard_E32-16s_v5": 2.675000, - "Standard_E32-8ads_v5": 2.997000, - "Standard_E32-8as_v4": 2.883000, - "Standard_E32-8as_v5": 2.585000, - "Standard_E32-8ds_v4": 3.045000, - "Standard_E32-8ds_v5": 3.045000, - "Standard_E32-8s_v3": 2.816000, - "Standard_E32-8s_v4": 2.675000, - "Standard_E32-8s_v5": 2.675000, - "Standard_E32_v3": 2.816000, - "Standard_E32_v4": 2.675000, - "Standard_E32_v5": 2.675000, - "Standard_E32a_v4": 2.883000, - "Standard_E32ads_v5": 2.997000, - "Standard_E32as_v4": 2.883000, - "Standard_E32as_v5": 2.585000, - "Standard_E32bds_v5": 3.821000, - "Standard_E32bs_v5": 3.409000, - "Standard_E32d_v4": 3.045000, - "Standard_E32d_v5": 3.045000, - "Standard_E32ds_v4": 3.045000, - "Standard_E32ds_v5": 3.045000, - "Standard_E32s_v3": 2.816000, - "Standard_E32s_v4": 2.675000, - "Standard_E32s_v5": 2.675000, - "Standard_E4-2ads_v5": 0.375000, - "Standard_E4-2as_v4": 0.360000, - "Standard_E4-2as_v5": 0.323000, - "Standard_E4-2ds_v4": 0.381000, - "Standard_E4-2ds_v5": 0.381000, - "Standard_E4-2s_v3": 0.352000, - "Standard_E4-2s_v4": 0.334000, - "Standard_E4-2s_v5": 0.334000, - "Standard_E48_v3": 4.012000, - "Standard_E48_v4": 4.013000, - "Standard_E48_v5": 4.013000, - "Standard_E48a_v4": 4.324000, - "Standard_E48ads_v5": 4.496000, - "Standard_E48as_v4": 4.324000, - "Standard_E48as_v5": 3.878000, - "Standard_E48bds_v5": 5.731000, - "Standard_E48bs_v5": 5.114000, - "Standard_E48d_v4": 4.567000, - "Standard_E48d_v5": 4.567000, - "Standard_E48ds_v4": 4.567000, - "Standard_E48ds_v5": 4.567000, - "Standard_E48s_v3": 4.012000, - "Standard_E48s_v4": 4.013000, - "Standard_E48s_v5": 4.013000, - "Standard_E4_v3": 0.352000, - "Standard_E4_v4": 0.334000, - "Standard_E4_v5": 0.334000, - "Standard_E4a_v4": 0.360000, - "Standard_E4ads_v5": 0.375000, - "Standard_E4as_v4": 0.360000, - "Standard_E4as_v5": 0.323000, - "Standard_E4bds_v5": 0.478000, - "Standard_E4bs_v5": 0.426000, - "Standard_E4d_v4": 0.381000, - "Standard_E4d_v5": 0.381000, - "Standard_E4ds_v4": 0.381000, - "Standard_E4ds_v5": 0.381000, - "Standard_E4s_v3": 0.352000, - "Standard_E4s_v4": 0.334000, - "Standard_E4s_v5": 0.334000, - "Standard_E64-16ads_v5": 5.995000, - "Standard_E64-16as_v4": 5.766000, - "Standard_E64-16as_v5": 5.171000, - "Standard_E64-16ds_v4": 6.090000, - "Standard_E64-16ds_v5": 6.090000, - "Standard_E64-16s_v3": 4.814000, - "Standard_E64-16s_v4": 5.350000, - "Standard_E64-16s_v5": 5.350000, - "Standard_E64-32ads_v5": 5.995000, - "Standard_E64-32as_v4": 5.766000, - "Standard_E64-32as_v5": 5.171000, - "Standard_E64-32ds_v4": 6.090000, - "Standard_E64-32ds_v5": 6.090000, - "Standard_E64-32s_v3": 4.814000, - "Standard_E64-32s_v4": 5.350000, - "Standard_E64-32s_v5": 5.350000, - "Standard_E64_v3": 4.814000, - "Standard_E64_v4": 5.350000, - "Standard_E64_v5": 5.350000, - "Standard_E64a_v4": 5.766000, - "Standard_E64ads_v5": 5.995000, - "Standard_E64as_v4": 5.766000, - "Standard_E64as_v5": 5.171000, - "Standard_E64bds_v5": 7.642000, - "Standard_E64bs_v5": 6.818000, - "Standard_E64d_v4": 6.090000, - "Standard_E64d_v5": 6.090000, - "Standard_E64ds_v4": 6.090000, - "Standard_E64ds_v5": 6.090000, - "Standard_E64i_v3": 4.814000, - "Standard_E64is_v3": 4.814000, - "Standard_E64s_v3": 4.814000, - "Standard_E64s_v4": 5.350000, - "Standard_E64s_v5": 5.350000, - "Standard_E8-2ads_v5": 0.749000, - "Standard_E8-2as_v4": 0.721000, - "Standard_E8-2as_v5": 0.646000, - "Standard_E8-2ds_v4": 0.761000, - "Standard_E8-2ds_v5": 0.761000, - "Standard_E8-2s_v3": 0.704000, - "Standard_E8-2s_v4": 0.669000, - "Standard_E8-2s_v5": 0.669000, - "Standard_E8-4ads_v5": 0.749000, - "Standard_E8-4as_v4": 0.721000, - "Standard_E8-4as_v5": 0.646000, - "Standard_E8-4ds_v4": 0.761000, - "Standard_E8-4ds_v5": 0.761000, - "Standard_E8-4s_v3": 0.704000, - "Standard_E8-4s_v4": 0.669000, - "Standard_E8-4s_v5": 0.669000, - "Standard_E80ids_v4": 7.612000, - "Standard_E80is_v4": 6.688000, - "Standard_E8_v3": 0.704000, - "Standard_E8_v4": 0.669000, - "Standard_E8_v5": 0.669000, - "Standard_E8a_v4": 0.721000, - "Standard_E8ads_v5": 0.749000, - "Standard_E8as_v4": 0.721000, - "Standard_E8as_v5": 0.646000, - "Standard_E8bds_v5": 0.955000, - "Standard_E8bs_v5": 0.852000, - "Standard_E8d_v4": 0.761000, - "Standard_E8d_v5": 0.761000, - "Standard_E8ds_v4": 0.761000, - "Standard_E8ds_v5": 0.761000, - "Standard_E8s_v3": 0.704000, - "Standard_E8s_v4": 0.669000, - "Standard_E8s_v5": 0.669000, - "Standard_E96-24ads_v5": 8.992000, - "Standard_E96-24as_v4": 8.649000, - "Standard_E96-24as_v5": 7.756000, - "Standard_E96-24ds_v5": 9.134000, - "Standard_E96-24s_v5": 8.026000, - "Standard_E96-48ads_v5": 8.992000, - "Standard_E96-48as_v4": 8.649000, - "Standard_E96-48as_v5": 7.756000, - "Standard_E96-48ds_v5": 9.134000, - "Standard_E96-48s_v5": 8.026000, - "Standard_E96_v5": 8.026000, - "Standard_E96a_v4": 8.649000, - "Standard_E96ads_v5": 8.992000, - "Standard_E96as_v4": 8.649000, - "Standard_E96as_v5": 7.756000, - "Standard_E96bds_v5": 11.463000, - "Standard_E96bs_v5": 10.227000, - "Standard_E96d_v5": 9.134000, - "Standard_E96ds_v5": 9.134000, - "Standard_E96iads_v5": 9.891000, - "Standard_E96ias_v4": 8.649000, - "Standard_E96ias_v5": 8.532000, - "Standard_E96s_v5": 8.026000, - "Standard_F1": 0.062500, - "Standard_F16": 1.000000, - "Standard_F16s": 1.000000, - "Standard_F16s_v2": 0.854000, - "Standard_F1s": 0.062500, - "Standard_F2": 0.125000, - "Standard_F2s": 0.125000, - "Standard_F2s_v2": 0.107000, - "Standard_F32s_v2": 1.709000, - "Standard_F4": 0.250000, - "Standard_F48s_v2": 2.563000, - "Standard_F4s": 0.250000, - "Standard_F4s_v2": 0.214000, - "Standard_F64s_v2": 3.418000, - "Standard_F72s_v2": 3.845000, - "Standard_F8": 0.499000, - "Standard_F8s": 0.499000, - "Standard_F8s_v2": 0.427000, - "Standard_L16as_v3": 1.785000, - "Standard_L16s_v3": 1.996000, - "Standard_L32as_v3": 3.569000, - "Standard_L32s_v3": 3.993000, - "Standard_L48as_v3": 5.354000, - "Standard_L48s_v3": 5.989000, - "Standard_L64as_v3": 7.139000, - "Standard_L64s_v3": 7.985000, - "Standard_L80as_v3": 8.923000, - "Standard_L80s_v3": 9.981000, - "Standard_L8as_v3": 0.892000, - "Standard_L8s_v3": 0.998000, - "Standard_M128": 19.073000, - "Standard_M128-32ms": 38.164000, - "Standard_M128-64ms": 38.164000, - "Standard_M128dms_v2": 38.167000, - "Standard_M128ds_v2": 19.076000, - "Standard_M128m": 38.164000, - "Standard_M128ms": 38.164000, - "Standard_M128ms_v2": 37.565000, - "Standard_M128s": 19.073000, - "Standard_M128s_v2": 18.474000, - "Standard_M16-4ms": 4.394000, - "Standard_M16-8ms": 4.394000, - "Standard_M16ms": 4.394000, - "Standard_M16s": 3.413000, - "Standard_M192idms_v2": 45.851000, - "Standard_M192ids_v2": 22.925000, - "Standard_M192ims_v2": 45.249000, - "Standard_M192is_v2": 22.324000, - "Standard_M32-16ms": 8.789000, - "Standard_M32-8ms": 8.789000, - "Standard_M32dms_v2": 8.789000, - "Standard_M32ls": 4.108000, - "Standard_M32ms": 8.789000, - "Standard_M32ms_v2": 8.638000, - "Standard_M32s": 6.827000, - "Standard_M32ts": 3.871000, - "Standard_M64": 9.537000, - "Standard_M64-16ms": 19.082000, - "Standard_M64-32ms": 19.082000, - "Standard_M64dms_v2": 14.786000, - "Standard_M64ds_v2": 9.537000, - "Standard_M64ls": 8.217000, - "Standard_M64m": 19.082000, - "Standard_M64ms": 19.082000, - "Standard_M64ms_v2": 14.485000, - "Standard_M64s": 9.537000, - "Standard_M64s_v2": 9.236000, - "Standard_M8-2ms": 2.197000, - "Standard_M8-4ms": 2.197000, - "Standard_M8ms": 2.197000, - "Standard_ND96ams_A100_v4": 46.861000, - "Standard_ND96amsr_A100_v4": 46.861000, - "Standard_NV12s_v3": 1.568000, - "Standard_NV24s_v3": 3.135000, - "Standard_NV48s_v3": 6.270000, - } - // norwaywest - initialOnDemandPrices["norwaywest"] = map[string]float64{ - "Dasv4_Type2": 9.816000, - "Ddsv4_Type 1": 6.846000, - "Ddsv5_Type1": 10.269000, - "Dsv3_Type3": 7.858000, - "Dsv3_Type4": 9.823000, - "Dsv5_Type1": 9.045000, - "Easv4_Type1": 12.368000, - "Easv4_Type2": 12.368000, - "Easv5_Type1": 11.092000, - "Ebdsv5-Type1": 10.928000, - "Edsv5_Type1": 13.062000, - "Esv3_Type3": 7.992000, - "Esv4_Type1": 7.651000, - "Esv5_Type1": 11.477000, - "Fsv2_Type2": 8.343000, - "Lasv3_Type1": 12.760000, - "Lsv3_Type1": 14.273000, - "Mdsmv2MedMem _Type1": 54.608000, - "Mdsv2MedMem_Type1": 27.294000, - "Msmv2MedMem Type1": 53.747000, - "Msv2MedMem Type1": 26.433000, - "Standard_A2_v2": 0.124000, - "Standard_A2m_v2": 0.177000, - "Standard_A4m_v2": 0.372000, - "Standard_A8_v2": 0.548000, - "Standard_A8m_v2": 0.781000, - "Standard_B16als_v2": 0.949000, - "Standard_B16as_v2": 1.062000, - "Standard_B16ls_v2": 0.973000, - "Standard_B16ms": 1.098000, - "Standard_B16s_v2": 1.172000, - "Standard_B1ls": 0.008580, - "Standard_B1ms": 0.034300, - "Standard_B20ms": 1.373000, - "Standard_B2as_v2": 0.133000, - "Standard_B2ats_v2": 0.015400, - "Standard_B2ls_v2": 0.068600, - "Standard_B2s_v2": 0.146000, - "Standard_B32als_v2": 1.898000, - "Standard_B32as_v2": 2.124000, - "Standard_B32s_v2": 2.196000, - "Standard_B4als_v2": 0.237000, - "Standard_B4as_v2": 0.266000, - "Standard_B4ls_v2": 0.262000, - "Standard_B4ms": 0.275000, - "Standard_B4s_v2": 0.275000, - "Standard_B8as_v2": 0.494000, - "Standard_B8ls_v2": 0.523000, - "Standard_B8ms": 0.549000, - "Standard_B8s_v2": 0.549000, - "Standard_D13_v2": 1.085000, - "Standard_D14_v2": 2.171000, - "Standard_D15_v2": 2.713000, - "Standard_D15i_v2": 2.713000, - "Standard_D16_v3": 1.373000, - "Standard_D16_v4": 1.316000, - "Standard_D16_v5": 1.316000, - "Standard_D16a_v4": 1.428000, - "Standard_D16as_v4": 1.428000, - "Standard_D16d_v4": 1.556000, - "Standard_D16d_v5": 1.556000, - "Standard_D16ds_v4": 1.556000, - "Standard_D16ds_v5": 1.556000, - "Standard_D16lds_v5": 1.428000, - "Standard_D16s_v3": 1.373000, - "Standard_D16s_v4": 1.316000, - "Standard_D16s_v5": 1.316000, - "Standard_D1_v2": 0.097100, - "Standard_D2_v2": 0.194000, - "Standard_D2_v3": 0.172000, - "Standard_D2_v4": 0.164000, - "Standard_D2a_v4": 0.178000, - "Standard_D2as_v4": 0.178000, - "Standard_D2as_v5": 0.160000, - "Standard_D2d_v4": 0.194000, - "Standard_D2d_v5": 0.194000, - "Standard_D2ds_v4": 0.194000, - "Standard_D2ds_v5": 0.194000, - "Standard_D2lds_v5": 0.178000, - "Standard_D2s_v3": 0.172000, - "Standard_D32-16s_v3": 2.746000, - "Standard_D32-8s_v3": 2.746000, - "Standard_D32_v3": 2.746000, - "Standard_D32_v5": 2.631000, - "Standard_D32a_v4": 2.855000, - "Standard_D32ads_v5": 3.064000, - "Standard_D32as_v5": 2.558000, - "Standard_D32d_v4": 3.112000, - "Standard_D32ds_v5": 3.112000, - "Standard_D32ls_v5": 2.528000, - "Standard_D32s_v3": 2.746000, - "Standard_D32s_v5": 2.631000, - "Standard_D48_v3": 4.118000, - "Standard_D48_v4": 3.947000, - "Standard_D48_v5": 3.947000, - "Standard_D48a_v4": 4.283000, - "Standard_D48as_v5": 3.837000, - "Standard_D48d_v5": 4.668000, - "Standard_D48ds_v4": 4.668000, - "Standard_D48ls_v5": 3.792000, - "Standard_D48s_v3": 4.118000, - "Standard_D4_v2": 0.778000, - "Standard_D4_v3": 0.343000, - "Standard_D4_v4": 0.329000, - "Standard_D4a_v4": 0.357000, - "Standard_D4ads_v5": 0.383000, - "Standard_D4as_v4": 0.357000, - "Standard_D4as_v5": 0.320000, - "Standard_D4d_v4": 0.389000, - "Standard_D4ds_v4": 0.389000, - "Standard_D4ds_v5": 0.389000, - "Standard_D4lds_v5": 0.357000, - "Standard_D4ls_v5": 0.316000, - "Standard_D4s_v3": 0.343000, - "Standard_D4s_v4": 0.329000, - "Standard_D4s_v5": 0.329000, - "Standard_D64-16s_v3": 5.491000, - "Standard_D64_v4": 5.262000, - "Standard_D64_v5": 5.262000, - "Standard_D64a_v4": 5.711000, - "Standard_D64d_v5": 6.223000, - "Standard_D64ds_v4": 6.223000, - "Standard_D64s_v3": 5.491000, - "Standard_D64s_v5": 5.262000, - "Standard_D8a_v4": 0.714000, - "Standard_D8ads_v5": 0.766000, - "Standard_D8as_v4": 0.714000, - "Standard_D8as_v5": 0.639000, - "Standard_D8d_v4": 0.778000, - "Standard_D8d_v5": 0.778000, - "Standard_D8ds_v5": 0.778000, - "Standard_D8ls_v5": 0.632000, - "Standard_D8s_v3": 0.686000, - "Standard_D8s_v4": 0.658000, - "Standard_D8s_v5": 0.658000, - "Standard_D96_v5": 7.894000, - "Standard_D96a_v4": 8.566000, - "Standard_D96ads_v5": 9.191000, - "Standard_D96as_v4": 8.566000, - "Standard_D96as_v5": 7.674000, - "Standard_D96d_v5": 9.335000, - "Standard_D96ds_v5": 9.335000, - "Standard_D96lds_v5": 8.566000, - "Standard_D96s_v5": 7.894000, - "Standard_DS11-1_v2": 0.272000, - "Standard_DS11_v2": 0.272000, - "Standard_DS12-1_v2": 0.542000, - "Standard_DS13-2_v2": 1.085000, - "Standard_DS13-4_v2": 1.085000, - "Standard_DS14-4_v2": 2.171000, - "Standard_DS14-8_v2": 2.171000, - "Standard_DS14_v2": 2.171000, - "Standard_DS15_v2": 2.713000, - "Standard_DS15i_v2": 2.713000, - "Standard_DS1_v2": 0.097100, - "Standard_DS3_v2": 0.389000, - "Standard_DS5_v2": 1.554000, - "Standard_E104i_v5": 12.433000, - "Standard_E104ids_v5": 14.151000, - "Standard_E112iads_v5": 15.001000, - "Standard_E112ias_v5": 12.940000, - "Standard_E112ibs_v5": 17.063000, - "Standard_E16-4ds_v5": 1.979000, - "Standard_E16-4s_v4": 1.739000, - "Standard_E16-4s_v5": 1.739000, - "Standard_E16-8ads_v5": 1.948000, - "Standard_E16-8as_v4": 1.874000, - "Standard_E16-8as_v5": 1.681000, - "Standard_E16-8ds_v5": 1.979000, - "Standard_E16-8s_v3": 1.830000, - "Standard_E16-8s_v4": 1.739000, - "Standard_E16-8s_v5": 1.739000, - "Standard_E16_v3": 1.830000, - "Standard_E16_v5": 1.739000, - "Standard_E16a_v4": 1.874000, - "Standard_E16ads_v5": 1.948000, - "Standard_E16as_v4": 1.874000, - "Standard_E16as_v5": 1.681000, - "Standard_E16bs_v5": 2.216000, - "Standard_E16d_v4": 1.979000, - "Standard_E16d_v5": 1.979000, - "Standard_E16ds_v5": 1.979000, - "Standard_E16s_v3": 1.830000, - "Standard_E16s_v4": 1.739000, - "Standard_E20_v3": 2.288000, - "Standard_E20_v4": 2.174000, - "Standard_E20_v5": 2.174000, - "Standard_E20a_v4": 2.342000, - "Standard_E20ads_v5": 2.435000, - "Standard_E20as_v5": 2.101000, - "Standard_E20d_v4": 2.474000, - "Standard_E20d_v5": 2.474000, - "Standard_E20ds_v4": 2.474000, - "Standard_E20s_v3": 2.288000, - "Standard_E20s_v4": 2.174000, - "Standard_E2_v3": 0.229000, - "Standard_E2_v4": 0.217000, - "Standard_E2_v5": 0.217000, - "Standard_E2as_v4": 0.234000, - "Standard_E2bds_v5": 0.310000, - "Standard_E2ds_v4": 0.247000, - "Standard_E2s_v3": 0.229000, - "Standard_E2s_v4": 0.217000, - "Standard_E2s_v5": 0.217000, - "Standard_E32-16ads_v5": 3.896000, - "Standard_E32-16as_v4": 3.748000, - "Standard_E32-16ds_v4": 3.958000, - "Standard_E32-8ads_v5": 3.896000, - "Standard_E32-8as_v4": 3.748000, - "Standard_E32-8as_v5": 3.361000, - "Standard_E32-8s_v4": 3.478000, - "Standard_E32-8s_v5": 3.478000, - "Standard_E32_v3": 3.661000, - "Standard_E32_v4": 3.478000, - "Standard_E32_v5": 3.478000, - "Standard_E32a_v4": 3.748000, - "Standard_E32ads_v5": 3.896000, - "Standard_E32as_v5": 3.361000, - "Standard_E32bs_v5": 4.432000, - "Standard_E32d_v4": 3.958000, - "Standard_E32d_v5": 3.958000, - "Standard_E32ds_v5": 3.958000, - "Standard_E32s_v3": 3.661000, - "Standard_E4-2ds_v4": 0.495000, - "Standard_E4-2ds_v5": 0.495000, - "Standard_E4-2s_v4": 0.435000, - "Standard_E4-2s_v5": 0.435000, - "Standard_E48_v3": 5.215000, - "Standard_E48_v4": 5.217000, - "Standard_E48a_v4": 5.622000, - "Standard_E48as_v5": 5.042000, - "Standard_E48bds_v5": 7.451000, - "Standard_E48bs_v5": 6.648000, - "Standard_E48d_v4": 5.937000, - "Standard_E48d_v5": 5.937000, - "Standard_E48ds_v4": 5.937000, - "Standard_E48ds_v5": 5.937000, - "Standard_E4_v4": 0.435000, - "Standard_E4a_v4": 0.468000, - "Standard_E4ads_v5": 0.487000, - "Standard_E4as_v4": 0.468000, - "Standard_E4as_v5": 0.420000, - "Standard_E4bds_v5": 0.621000, - "Standard_E4bs_v5": 0.554000, - "Standard_E4d_v5": 0.495000, - "Standard_E4ds_v4": 0.495000, - "Standard_E4s_v4": 0.435000, - "Standard_E4s_v5": 0.435000, - "Standard_E64-16as_v5": 6.722000, - "Standard_E64-16ds_v5": 7.916000, - "Standard_E64-16s_v3": 6.258000, - "Standard_E64-16s_v5": 6.956000, - "Standard_E64-32ads_v5": 7.793000, - "Standard_E64-32as_v5": 6.722000, - "Standard_E64-32ds_v5": 7.916000, - "Standard_E64-32s_v4": 6.956000, - "Standard_E64-32s_v5": 6.956000, - "Standard_E64_v4": 6.956000, - "Standard_E64a_v4": 7.495000, - "Standard_E64ads_v5": 7.793000, - "Standard_E64as_v4": 7.495000, - "Standard_E64as_v5": 6.722000, - "Standard_E64bs_v5": 8.864000, - "Standard_E64d_v4": 7.916000, - "Standard_E64d_v5": 7.916000, - "Standard_E64ds_v4": 7.916000, - "Standard_E64ds_v5": 7.916000, - "Standard_E64i_v3": 6.258000, - "Standard_E64s_v3": 6.258000, - "Standard_E64s_v4": 6.956000, - "Standard_E64s_v5": 6.956000, - "Standard_E8-2as_v4": 0.937000, - "Standard_E8-2as_v5": 0.840000, - "Standard_E8-2ds_v4": 0.990000, - "Standard_E8-2s_v3": 0.915000, - "Standard_E8-2s_v5": 0.869000, - "Standard_E8-4ads_v5": 0.974000, - "Standard_E8-4as_v4": 0.937000, - "Standard_E8-4as_v5": 0.840000, - "Standard_E8-4ds_v4": 0.990000, - "Standard_E8-4s_v4": 0.869000, - "Standard_E8-4s_v5": 0.869000, - "Standard_E80ids_v4": 9.896000, - "Standard_E8_v3": 0.915000, - "Standard_E8a_v4": 0.937000, - "Standard_E8ads_v5": 0.974000, - "Standard_E8as_v4": 0.937000, - "Standard_E8as_v5": 0.840000, - "Standard_E8bs_v5": 1.108000, - "Standard_E8d_v4": 0.990000, - "Standard_E8d_v5": 0.990000, - "Standard_E8ds_v4": 0.990000, - "Standard_E8ds_v5": 0.990000, - "Standard_E8s_v3": 0.915000, - "Standard_E8s_v4": 0.869000, - "Standard_E8s_v5": 0.869000, - "Standard_E96-24as_v4": 11.243000, - "Standard_E96-48ads_v5": 11.689000, - "Standard_E96-48as_v5": 10.083000, - "Standard_E96-48s_v5": 10.433000, - "Standard_E96_v5": 10.433000, - "Standard_E96a_v4": 11.243000, - "Standard_E96as_v4": 11.243000, - "Standard_E96as_v5": 10.083000, - "Standard_E96bs_v5": 13.296000, - "Standard_E96ds_v5": 11.875000, - "Standard_E96iads_v5": 12.858000, - "Standard_E96ias_v4": 11.243000, - "Standard_E96ias_v5": 11.092000, - "Standard_E96s_v5": 10.433000, - "Standard_F1": 0.081200, - "Standard_F16": 1.300000, - "Standard_F16s": 1.300000, - "Standard_F16s_v2": 1.264000, - "Standard_F1s": 0.081200, - "Standard_F2": 0.163000, - "Standard_F2s": 0.163000, - "Standard_F4s_v2": 0.316000, - "Standard_F64s_v2": 5.057000, - "Standard_F8": 0.649000, - "Standard_F8s": 0.649000, - "Standard_F8s_v2": 0.632000, - "Standard_L16as_v3": 2.320000, - "Standard_L32as_v3": 4.640000, - "Standard_L32s_v3": 5.190000, - "Standard_L48s_v3": 7.786000, - "Standard_L64s_v3": 10.381000, - "Standard_L80s_v3": 12.976000, - "Standard_L8s_v3": 1.298000, - "Standard_M128": 24.809000, - "Standard_M128-64ms": 49.640000, - "Standard_M128dms_v2": 49.643000, - "Standard_M128ds_v2": 24.812000, - "Standard_M128ms": 49.640000, - "Standard_M128s": 24.809000, - "Standard_M128s_v2": 24.030000, - "Standard_M16-4ms": 5.716000, - "Standard_M16-8ms": 5.716000, - "Standard_M16ms": 5.716000, - "Standard_M16s": 4.440000, - "Standard_M192ids_v2": 29.819000, - "Standard_M192ims_v2": 58.856000, - "Standard_M192is_v2": 29.037000, - "Standard_M32-8ms": 11.432000, - "Standard_M32dms_v2": 11.432000, - "Standard_M32ls": 5.344000, - "Standard_M32ms_v2": 11.236000, - "Standard_M32s": 6.203100, - "Standard_M64": 12.404000, - "Standard_M64-32ms": 19.226820, - "Standard_M64ls": 10.071900, - "Standard_M64ms": 19.226820, - "Standard_M64s": 12.404000, - "Standard_M64s_v2": 12.013000, - "Standard_M8-2ms": 2.858000, - "Standard_M8ms": 2.858000, - "Standard_NV12s_v3": 2.038000, - "Standard_NV48s_v3": 8.151000, - } - // polandcentral - initialOnDemandPrices["polandcentral"] = map[string]float64{ - "Basic_A0": 0.023200, - "Basic_A1": 0.029700, - "Basic_A2": 0.102000, - "Basic_A3": 0.227000, - "Basic_A4": 0.454000, - "Dadsv5_Type1": 8.470000, - "Dasv4_Type1": 6.958000, - "Dasv4_Type2": 6.958000, - "Dasv5_Type1": 7.047000, - "Ddsv4_Type 1": 5.280000, - "Ddsv4_Type2": 6.249000, - "Ddsv5_Type1": 7.899000, - "Dsv3_Type1": 6.970000, - "Dsv3_Type2": 6.970000, - "Dsv3_Type3": 6.970000, - "Dsv3_Type4": 6.970000, - "Dsv4_Type1": 5.566000, - "Dsv4_Type2": 6.679000, - "Dsv5_Type1": 6.958000, - "Eadsv5_Type1": 9.176000, - "Easv4_Type1": 8.828000, - "Easv4_Type2": 8.828000, - "Easv5_Type1": 7.957000, - "Ebdsv5-Type1": 7.705000, - "Ebsv5-Type1": 6.892000, - "Edsv4_Type 1": 6.706000, - "Edsv4_Type2": 7.963000, - "Edsv5_Type1": 10.047000, - "Esv3_Type1": 8.131000, - "Esv3_Type2": 8.131000, - "Esv3_Type3": 8.131000, - "Esv3_Type4": 8.131000, - "Esv4_Type1": 5.887000, - "Esv4_Type2": 7.715000, - "Esv5_Type1": 8.829000, - "Fsv2 Type3": 5.636000, - "Fsv2_Type2": 5.636000, - "Fsv2_Type4": 5.636000, - "Lasv3_Type1": 9.002000, - "Standard_A0": 0.021900, - "Standard_A1": 0.066000, - "Standard_A1_v2": 0.045100, - "Standard_A2": 0.132000, - "Standard_A2_v2": 0.094700, - "Standard_A2m_v2": 0.124000, - "Standard_A3": 0.264000, - "Standard_A4": 0.528000, - "Standard_A4_v2": 0.200000, - "Standard_A4m_v2": 0.249000, - "Standard_A5": 0.275000, - "Standard_A6": 0.550000, - "Standard_A7": 1.100000, - "Standard_A8_v2": 0.419000, - "Standard_A8m_v2": 0.498000, - "Standard_B12ms": 0.634000, - "Standard_B16ms": 0.845000, - "Standard_B1ls": 0.006600, - "Standard_B1ms": 0.026400, - "Standard_B1s": 0.013200, - "Standard_B20ms": 1.056000, - "Standard_B2ms": 0.106000, - "Standard_B2s": 0.052800, - "Standard_B4ms": 0.211000, - "Standard_B8ms": 0.422000, - "Standard_D11_v2": 0.188000, - "Standard_D12_v2": 0.380000, - "Standard_D13_v2": 0.760000, - "Standard_D14_v2": 1.520000, - "Standard_D15_v2": 1.900000, - "Standard_D15i_v2": 1.900000, - "Standard_D16_v3": 1.056000, - "Standard_D16_v4": 1.012000, - "Standard_D16_v5": 1.012000, - "Standard_D16a_v4": 1.012000, - "Standard_D16ads_v5": 1.100000, - "Standard_D16as_v4": 1.012000, - "Standard_D16as_v5": 0.915000, - "Standard_D16d_v4": 1.197000, - "Standard_D16d_v5": 1.197000, - "Standard_D16ds_v4": 1.197000, - "Standard_D16ds_v5": 1.197000, - "Standard_D16lds_v5": 0.977000, - "Standard_D16ls_v5": 0.854000, - "Standard_D16s_v3": 1.056000, - "Standard_D16s_v4": 1.012000, - "Standard_D16s_v5": 1.012000, - "Standard_D1_v2": 0.074800, - "Standard_D2_v2": 0.150000, - "Standard_D2_v3": 0.132000, - "Standard_D2_v4": 0.126000, - "Standard_D2_v5": 0.127000, - "Standard_D2a_v4": 0.126000, - "Standard_D2ads_v5": 0.138000, - "Standard_D2as_v4": 0.126000, - "Standard_D2as_v5": 0.114000, - "Standard_D2d_v4": 0.150000, - "Standard_D2d_v5": 0.150000, - "Standard_D2ds_v4": 0.150000, - "Standard_D2ds_v5": 0.150000, - "Standard_D2lds_v5": 0.122000, - "Standard_D2ls_v5": 0.107000, - "Standard_D2s_v3": 0.132000, - "Standard_D2s_v4": 0.126000, - "Standard_D2s_v5": 0.127000, - "Standard_D32-16s_v3": 2.112000, - "Standard_D32-8s_v3": 2.112000, - "Standard_D32_v3": 2.112000, - "Standard_D32_v4": 2.024000, - "Standard_D32_v5": 2.024000, - "Standard_D32a_v4": 2.024000, - "Standard_D32ads_v5": 2.200000, - "Standard_D32as_v4": 2.024000, - "Standard_D32as_v5": 1.830000, - "Standard_D32d_v4": 2.394000, - "Standard_D32d_v5": 2.394000, - "Standard_D32ds_v4": 2.394000, - "Standard_D32ds_v5": 2.394000, - "Standard_D32lds_v5": 1.954000, - "Standard_D32ls_v5": 1.707000, - "Standard_D32s_v3": 2.112000, - "Standard_D32s_v4": 2.024000, - "Standard_D32s_v5": 2.024000, - "Standard_D3_v2": 0.299000, - "Standard_D48_v3": 3.168000, - "Standard_D48_v4": 3.036000, - "Standard_D48_v5": 3.036000, - "Standard_D48a_v4": 3.036000, - "Standard_D48ads_v5": 3.300000, - "Standard_D48as_v4": 3.036000, - "Standard_D48as_v5": 2.746000, - "Standard_D48d_v4": 3.590000, - "Standard_D48d_v5": 3.590000, - "Standard_D48ds_v4": 3.590000, - "Standard_D48ds_v5": 3.590000, - "Standard_D48lds_v5": 2.930000, - "Standard_D48ls_v5": 2.561000, - "Standard_D48s_v3": 3.168000, - "Standard_D48s_v4": 3.036000, - "Standard_D48s_v5": 3.036000, - "Standard_D4_v2": 0.598000, - "Standard_D4_v3": 0.264000, - "Standard_D4_v4": 0.253000, - "Standard_D4_v5": 0.253000, - "Standard_D4a_v4": 0.253000, - "Standard_D4ads_v5": 0.275000, - "Standard_D4as_v4": 0.253000, - "Standard_D4as_v5": 0.229000, - "Standard_D4d_v4": 0.299000, - "Standard_D4d_v5": 0.299000, - "Standard_D4ds_v4": 0.299000, - "Standard_D4ds_v5": 0.299000, - "Standard_D4lds_v5": 0.244000, - "Standard_D4ls_v5": 0.213000, - "Standard_D4s_v3": 0.264000, - "Standard_D4s_v4": 0.253000, - "Standard_D4s_v5": 0.253000, - "Standard_D5_v2": 1.197000, - "Standard_D64-16s_v3": 4.224000, - "Standard_D64-32s_v3": 4.224000, - "Standard_D64_v3": 4.224000, - "Standard_D64_v4": 4.048000, - "Standard_D64_v5": 4.048000, - "Standard_D64a_v4": 4.048000, - "Standard_D64ads_v5": 4.400000, - "Standard_D64as_v4": 4.048000, - "Standard_D64as_v5": 3.661000, - "Standard_D64d_v4": 4.787000, - "Standard_D64d_v5": 4.787000, - "Standard_D64ds_v4": 4.787000, - "Standard_D64ds_v5": 4.787000, - "Standard_D64lds_v5": 3.907000, - "Standard_D64ls_v5": 3.414000, - "Standard_D64s_v3": 4.224000, - "Standard_D64s_v4": 4.048000, - "Standard_D64s_v5": 4.048000, - "Standard_D8_v3": 0.528000, - "Standard_D8_v4": 0.506000, - "Standard_D8_v5": 0.506000, - "Standard_D8a_v4": 0.506000, - "Standard_D8ads_v5": 0.550000, - "Standard_D8as_v4": 0.506000, - "Standard_D8as_v5": 0.458000, - "Standard_D8d_v4": 0.598000, - "Standard_D8d_v5": 0.598000, - "Standard_D8ds_v4": 0.598000, - "Standard_D8ds_v5": 0.598000, - "Standard_D8lds_v5": 0.488000, - "Standard_D8ls_v5": 0.427000, - "Standard_D8s_v3": 0.528000, - "Standard_D8s_v4": 0.506000, - "Standard_D8s_v5": 0.506000, - "Standard_D96_v5": 6.072000, - "Standard_D96a_v4": 6.072000, - "Standard_D96ads_v5": 6.600000, - "Standard_D96as_v4": 6.072000, - "Standard_D96as_v5": 5.491000, - "Standard_D96d_v5": 7.181000, - "Standard_D96ds_v5": 7.181000, - "Standard_D96lds_v5": 5.861000, - "Standard_D96ls_v5": 5.122000, - "Standard_D96s_v5": 6.072000, - "Standard_DS11-1_v2": 0.188000, - "Standard_DS11_v2": 0.188000, - "Standard_DS12-1_v2": 0.380000, - "Standard_DS12-2_v2": 0.380000, - "Standard_DS12_v2": 0.380000, - "Standard_DS13-2_v2": 0.760000, - "Standard_DS13-4_v2": 0.760000, - "Standard_DS13_v2": 0.760000, - "Standard_DS14-4_v2": 1.520000, - "Standard_DS14-8_v2": 1.520000, - "Standard_DS14_v2": 1.520000, - "Standard_DS15_v2": 1.900000, - "Standard_DS15i_v2": 1.900000, - "Standard_DS1_v2": 0.074800, - "Standard_DS2_v2": 0.150000, - "Standard_DS3_v2": 0.299000, - "Standard_DS4_v2": 0.598000, - "Standard_DS5_v2": 1.197000, - "Standard_E104i_v5": 9.564000, - "Standard_E104id_v5": 10.885000, - "Standard_E104ids_v5": 10.885000, - "Standard_E104is_v5": 9.564000, - "Standard_E112iads_v5": 10.706000, - "Standard_E112ias_v5": 9.283000, - "Standard_E112ibds_v5": 13.484000, - "Standard_E112ibs_v5": 12.061000, - "Standard_E16-4ads_v5": 1.390000, - "Standard_E16-4as_v4": 1.338000, - "Standard_E16-4as_v5": 1.206000, - "Standard_E16-4ds_v4": 1.522000, - "Standard_E16-4ds_v5": 1.522000, - "Standard_E16-4s_v3": 1.408000, - "Standard_E16-4s_v4": 1.338000, - "Standard_E16-4s_v5": 1.338000, - "Standard_E16-8ads_v5": 1.390000, - "Standard_E16-8as_v4": 1.338000, - "Standard_E16-8as_v5": 1.206000, - "Standard_E16-8ds_v4": 1.522000, - "Standard_E16-8ds_v5": 1.522000, - "Standard_E16-8s_v3": 1.408000, - "Standard_E16-8s_v4": 1.338000, - "Standard_E16-8s_v5": 1.338000, - "Standard_E16_v3": 1.408000, - "Standard_E16_v4": 1.338000, - "Standard_E16_v5": 1.338000, - "Standard_E16a_v4": 1.338000, - "Standard_E16ads_v5": 1.390000, - "Standard_E16as_v4": 1.338000, - "Standard_E16as_v5": 1.206000, - "Standard_E16bds_v5": 1.751000, - "Standard_E16bs_v5": 1.566000, - "Standard_E16d_v4": 1.522000, - "Standard_E16d_v5": 1.522000, - "Standard_E16ds_v4": 1.522000, - "Standard_E16ds_v5": 1.522000, - "Standard_E16s_v3": 1.408000, - "Standard_E16s_v4": 1.338000, - "Standard_E16s_v5": 1.338000, - "Standard_E20_v3": 1.760000, - "Standard_E20_v4": 1.672000, - "Standard_E20_v5": 1.672000, - "Standard_E20a_v4": 1.672000, - "Standard_E20ads_v5": 1.738000, - "Standard_E20as_v4": 1.672000, - "Standard_E20as_v5": 1.507000, - "Standard_E20d_v4": 1.903000, - "Standard_E20d_v5": 1.903000, - "Standard_E20ds_v4": 1.903000, - "Standard_E20ds_v5": 1.903000, - "Standard_E20s_v3": 1.760000, - "Standard_E20s_v4": 1.672000, - "Standard_E20s_v5": 1.672000, - "Standard_E2_v3": 0.176000, - "Standard_E2_v4": 0.167000, - "Standard_E2_v5": 0.167000, - "Standard_E2a_v4": 0.167000, - "Standard_E2ads_v5": 0.174000, - "Standard_E2as_v4": 0.167000, - "Standard_E2as_v5": 0.151000, - "Standard_E2bds_v5": 0.219000, - "Standard_E2bs_v5": 0.196000, - "Standard_E2d_v4": 0.190000, - "Standard_E2d_v5": 0.190000, - "Standard_E2ds_v4": 0.190000, - "Standard_E2ds_v5": 0.190000, - "Standard_E2s_v3": 0.176000, - "Standard_E2s_v4": 0.167000, - "Standard_E2s_v5": 0.167000, - "Standard_E32-16ads_v5": 2.781000, - "Standard_E32-16as_v4": 2.675000, - "Standard_E32-16as_v5": 2.411000, - "Standard_E32-16ds_v4": 3.045000, - "Standard_E32-16ds_v5": 3.045000, - "Standard_E32-16s_v3": 2.816000, - "Standard_E32-16s_v4": 2.675000, - "Standard_E32-16s_v5": 2.675000, - "Standard_E32-8ads_v5": 2.781000, - "Standard_E32-8as_v4": 2.675000, - "Standard_E32-8as_v5": 2.411000, - "Standard_E32-8ds_v4": 3.045000, - "Standard_E32-8ds_v5": 3.045000, - "Standard_E32-8s_v3": 2.816000, - "Standard_E32-8s_v4": 2.675000, - "Standard_E32-8s_v5": 2.675000, - "Standard_E32_v3": 2.816000, - "Standard_E32_v4": 2.675000, - "Standard_E32_v5": 2.675000, - "Standard_E32a_v4": 2.675000, - "Standard_E32ads_v5": 2.781000, - "Standard_E32as_v4": 2.675000, - "Standard_E32as_v5": 2.411000, - "Standard_E32bds_v5": 3.502000, - "Standard_E32bs_v5": 3.133000, - "Standard_E32d_v4": 3.045000, - "Standard_E32d_v5": 3.045000, - "Standard_E32ds_v4": 3.045000, - "Standard_E32ds_v5": 3.045000, - "Standard_E32s_v3": 2.816000, - "Standard_E32s_v4": 2.675000, - "Standard_E32s_v5": 2.675000, - "Standard_E4-2ads_v5": 0.348000, - "Standard_E4-2as_v4": 0.334000, - "Standard_E4-2as_v5": 0.301000, - "Standard_E4-2ds_v4": 0.381000, - "Standard_E4-2ds_v5": 0.381000, - "Standard_E4-2s_v3": 0.352000, - "Standard_E4-2s_v4": 0.334000, - "Standard_E4-2s_v5": 0.334000, - "Standard_E48_v3": 4.224000, - "Standard_E48_v4": 4.013000, - "Standard_E48_v5": 4.013000, - "Standard_E48a_v4": 4.013000, - "Standard_E48ads_v5": 4.171000, - "Standard_E48as_v4": 4.013000, - "Standard_E48as_v5": 3.617000, - "Standard_E48bds_v5": 5.254000, - "Standard_E48bs_v5": 4.699000, - "Standard_E48d_v4": 4.567000, - "Standard_E48d_v5": 4.567000, - "Standard_E48ds_v4": 4.567000, - "Standard_E48ds_v5": 4.567000, - "Standard_E48s_v3": 4.224000, - "Standard_E48s_v4": 4.013000, - "Standard_E48s_v5": 4.013000, - "Standard_E4_v3": 0.352000, - "Standard_E4_v4": 0.334000, - "Standard_E4_v5": 0.334000, - "Standard_E4a_v4": 0.334000, - "Standard_E4ads_v5": 0.348000, - "Standard_E4as_v4": 0.334000, - "Standard_E4as_v5": 0.301000, - "Standard_E4bds_v5": 0.438000, - "Standard_E4bs_v5": 0.392000, - "Standard_E4d_v4": 0.381000, - "Standard_E4d_v5": 0.381000, - "Standard_E4ds_v4": 0.381000, - "Standard_E4ds_v5": 0.381000, - "Standard_E4s_v3": 0.352000, - "Standard_E4s_v4": 0.334000, - "Standard_E4s_v5": 0.334000, - "Standard_E64-16ads_v5": 5.562000, - "Standard_E64-16as_v4": 5.350000, - "Standard_E64-16as_v5": 4.822000, - "Standard_E64-16ds_v4": 6.090000, - "Standard_E64-16ds_v5": 6.090000, - "Standard_E64-16s_v3": 5.069000, - "Standard_E64-16s_v4": 5.350000, - "Standard_E64-16s_v5": 5.350000, - "Standard_E64-32ads_v5": 5.562000, - "Standard_E64-32as_v4": 5.350000, - "Standard_E64-32as_v5": 4.822000, - "Standard_E64-32ds_v4": 6.090000, - "Standard_E64-32ds_v5": 6.090000, - "Standard_E64-32s_v3": 5.069000, - "Standard_E64-32s_v4": 5.350000, - "Standard_E64-32s_v5": 5.350000, - "Standard_E64_v3": 5.069000, - "Standard_E64_v4": 5.350000, - "Standard_E64_v5": 5.350000, - "Standard_E64a_v4": 5.350000, - "Standard_E64ads_v5": 5.562000, - "Standard_E64as_v4": 5.350000, - "Standard_E64as_v5": 4.822000, - "Standard_E64bds_v5": 7.005000, - "Standard_E64bs_v5": 6.266000, - "Standard_E64d_v4": 6.090000, - "Standard_E64d_v5": 6.090000, - "Standard_E64ds_v4": 6.090000, - "Standard_E64ds_v5": 6.090000, - "Standard_E64i_v3": 5.069000, - "Standard_E64is_v3": 5.069000, - "Standard_E64s_v3": 5.069000, - "Standard_E64s_v4": 5.350000, - "Standard_E64s_v5": 5.350000, - "Standard_E8-2ads_v5": 0.695000, - "Standard_E8-2as_v4": 0.669000, - "Standard_E8-2as_v5": 0.603000, - "Standard_E8-2ds_v4": 0.761000, - "Standard_E8-2ds_v5": 0.761000, - "Standard_E8-2s_v3": 0.704000, - "Standard_E8-2s_v4": 0.669000, - "Standard_E8-2s_v5": 0.669000, - "Standard_E8-4ads_v5": 0.695000, - "Standard_E8-4as_v4": 0.669000, - "Standard_E8-4as_v5": 0.603000, - "Standard_E8-4ds_v4": 0.761000, - "Standard_E8-4ds_v5": 0.761000, - "Standard_E8-4s_v3": 0.704000, - "Standard_E8-4s_v4": 0.669000, - "Standard_E8-4s_v5": 0.669000, - "Standard_E80ids_v4": 7.612000, - "Standard_E80is_v4": 6.688000, - "Standard_E8_v3": 0.704000, - "Standard_E8_v4": 0.669000, - "Standard_E8_v5": 0.669000, - "Standard_E8a_v4": 0.669000, - "Standard_E8ads_v5": 0.695000, - "Standard_E8as_v4": 0.669000, - "Standard_E8as_v5": 0.603000, - "Standard_E8bds_v5": 0.876000, - "Standard_E8bs_v5": 0.783000, - "Standard_E8d_v4": 0.761000, - "Standard_E8d_v5": 0.761000, - "Standard_E8ds_v4": 0.761000, - "Standard_E8ds_v5": 0.761000, - "Standard_E8s_v3": 0.704000, - "Standard_E8s_v4": 0.669000, - "Standard_E8s_v5": 0.669000, - "Standard_E96-24ads_v5": 8.342000, - "Standard_E96-24as_v4": 8.026000, - "Standard_E96-24as_v5": 7.234000, - "Standard_E96-24ds_v5": 9.134000, - "Standard_E96-24s_v5": 8.026000, - "Standard_E96-48ads_v5": 8.342000, - "Standard_E96-48as_v4": 8.026000, - "Standard_E96-48as_v5": 7.234000, - "Standard_E96-48ds_v5": 9.134000, - "Standard_E96-48s_v5": 8.026000, - "Standard_E96_v5": 8.026000, - "Standard_E96a_v4": 8.026000, - "Standard_E96ads_v5": 8.342000, - "Standard_E96as_v4": 8.026000, - "Standard_E96as_v5": 7.234000, - "Standard_E96bds_v5": 10.507000, - "Standard_E96bs_v5": 9.398000, - "Standard_E96d_v5": 9.134000, - "Standard_E96ds_v5": 9.134000, - "Standard_E96iads_v5": 9.177000, - "Standard_E96ias_v4": 8.026000, - "Standard_E96ias_v5": 7.957000, - "Standard_E96s_v5": 8.026000, - "Standard_F1": 0.062400, - "Standard_F16": 0.999000, - "Standard_F16s": 0.999000, - "Standard_F16s_v2": 0.854000, - "Standard_F1s": 0.062400, - "Standard_F2": 0.125000, - "Standard_F2s": 0.125000, - "Standard_F2s_v2": 0.107000, - "Standard_F32s_v2": 1.707000, - "Standard_F4": 0.250000, - "Standard_F48s_v2": 2.561000, - "Standard_F4s": 0.250000, - "Standard_F4s_v2": 0.213000, - "Standard_F64s_v2": 3.414000, - "Standard_F72s_v2": 3.841000, - "Standard_F8": 0.499000, - "Standard_F8s": 0.499000, - "Standard_F8s_v2": 0.427000, - "Standard_L112ias_v3": 12.603000, - "Standard_L16as_v3": 1.637000, - "Standard_L32as_v3": 3.274000, - "Standard_L48as_v3": 4.910000, - "Standard_L64as_v3": 6.547000, - "Standard_L80as_v3": 8.184000, - "Standard_L8as_v3": 0.818000, - "Standard_L96ias_v3": 10.803000, - "Standard_ND96ams_A100_v4": 46.861000, - "Standard_ND96amsr_A100_v4": 46.861000, - "Standard_SQLG7_AMD_IaaS": 10.701000, - "Standard_SQLG7_AMD_NVME": 10.701000, - } - // qatarcentral - initialOnDemandPrices["qatarcentral"] = map[string]float64{ - "Basic_A0": 0.019800, - "Basic_A1": 0.029700, - "Basic_A2": 0.085800, - "Basic_A3": 0.224000, - "Basic_A4": 0.449000, - "Dadsv5_Type1": 7.817000, - "Dasv4_Type1": 6.474000, - "Dasv4_Type2": 6.474000, - "Dasv5_Type1": 6.530000, - "Ddsv4_Type 1": 4.136000, - "Ddsv4_Type2": 5.789000, - "Ddsv5_Type1": 7.318000, - "Dsv3_Type3": 5.170000, - "Dsv3_Type4": 6.460000, - "Dsv4_Type1": 5.170000, - "Dsv4_Type2": 6.217000, - "Dsv5_Type1": 6.474000, - "Eadsv5_Type1": 8.496000, - "Easv4_Type1": 8.189000, - "Easv4_Type2": 8.189000, - "Easv5_Type1": 7.392000, - "Ebdsv5-Type1": 7.251000, - "Ebsv5-Type1": 6.512000, - "Edsv4_Type 1": 6.195000, - "Edsv4_Type2": 7.942000, - "Edsv5_Type1": 9.293000, - "Esv3_Type3": 6.653000, - "Esv3_Type4": 6.986000, - "Esv4_Type1": 5.456000, - "Esv4_Type2": 7.161000, - "Esv5_Type1": 8.189000, - "Fsv2 Type3": 4.874000, - "Fsv2_Type2": 4.178000, - "Fsv2_Type4": 5.386000, - "Lasv3_Type1": 8.316000, - "Lsv3_Type1": 9.284000, - "Standard_A0": 0.022000, - "Standard_A1": 0.066000, - "Standard_A1_v2": 0.043200, - "Standard_A2": 0.132000, - "Standard_A2_v2": 0.091200, - "Standard_A2m_v2": 0.119000, - "Standard_A3": 0.264000, - "Standard_A4": 0.528000, - "Standard_A4_v2": 0.191000, - "Standard_A4m_v2": 0.250000, - "Standard_A5": 0.297000, - "Standard_A6": 0.594000, - "Standard_A7": 1.188000, - "Standard_A8_v2": 0.400000, - "Standard_A8m_v2": 0.524000, - "Standard_B12ms": 0.602000, - "Standard_B16als_v2": 0.713000, - "Standard_B16as_v2": 0.796000, - "Standard_B16ls_v2": 0.784000, - "Standard_B16ms": 0.802000, - "Standard_B16s_v2": 0.876000, - "Standard_B1ls": 0.006300, - "Standard_B1ms": 0.025100, - "Standard_B1s": 0.012500, - "Standard_B20ms": 1.003000, - "Standard_B2als_v2": 0.054300, - "Standard_B2as_v2": 0.090300, - "Standard_B2ats_v2": 0.011300, - "Standard_B2ls_v2": 0.059400, - "Standard_B2ms": 0.100000, - "Standard_B2s": 0.050200, - "Standard_B2s_v2": 0.110000, - "Standard_B2ts_v2": 0.021700, - "Standard_B32als_v2": 1.279000, - "Standard_B32as_v2": 1.592000, - "Standard_B32ls_v2": 1.421000, - "Standard_B32s_v2": 1.605000, - "Standard_B4als_v2": 0.178000, - "Standard_B4as_v2": 0.181000, - "Standard_B4ls_v2": 0.178000, - "Standard_B4ms": 0.201000, - "Standard_B4s_v2": 0.219000, - "Standard_B8als_v2": 0.320000, - "Standard_B8as_v2": 0.361000, - "Standard_B8ls_v2": 0.392000, - "Standard_B8ms": 0.401000, - "Standard_B8s_v2": 0.401000, - "Standard_D11_v2": 0.179000, - "Standard_D11_v2_Promo": 0.179000, - "Standard_D12_v2": 0.359000, - "Standard_D12_v2_Promo": 0.359000, - "Standard_D13_v2": 0.718000, - "Standard_D13_v2_Promo": 0.718000, - "Standard_D14_v2": 1.435000, - "Standard_D14_v2_Promo": 1.435000, - "Standard_D15_v2": 1.794000, - "Standard_D15i_v2": 1.794000, - "Standard_D16_v3": 0.942000, - "Standard_D16_v4": 0.942000, - "Standard_D16_v5": 0.942000, - "Standard_D16a_v4": 0.942000, - "Standard_D16ads_v5": 1.015000, - "Standard_D16as_v4": 0.942000, - "Standard_D16as_v5": 0.848000, - "Standard_D16d_v4": 1.109000, - "Standard_D16d_v5": 1.109000, - "Standard_D16ds_v4": 1.109000, - "Standard_D16ds_v5": 1.109000, - "Standard_D16lds_v5": 0.960000, - "Standard_D16ls_v5": 0.845000, - "Standard_D16s_v3": 0.942000, - "Standard_D16s_v4": 0.942000, - "Standard_D16s_v5": 0.942000, - "Standard_D1_v2": 0.068700, - "Standard_D2_v2": 0.137000, - "Standard_D2_v2_Promo": 0.137000, - "Standard_D2_v3": 0.118000, - "Standard_D2_v4": 0.118000, - "Standard_D2_v5": 0.118000, - "Standard_D2a_v4": 0.118000, - "Standard_D2ads_v5": 0.127000, - "Standard_D2as_v4": 0.118000, - "Standard_D2as_v5": 0.106000, - "Standard_D2d_v4": 0.139000, - "Standard_D2d_v5": 0.139000, - "Standard_D2ds_v4": 0.139000, - "Standard_D2ds_v5": 0.139000, - "Standard_D2lds_v5": 0.120000, - "Standard_D2ls_v5": 0.106000, - "Standard_D2s_v3": 0.118000, - "Standard_D2s_v4": 0.118000, - "Standard_D2s_v5": 0.118000, - "Standard_D32-16s_v3": 1.883000, - "Standard_D32-8s_v3": 1.883000, - "Standard_D32_v3": 1.883000, - "Standard_D32_v4": 1.883000, - "Standard_D32_v5": 1.883000, - "Standard_D32a_v4": 1.883000, - "Standard_D32ads_v5": 2.030000, - "Standard_D32as_v4": 1.883000, - "Standard_D32as_v5": 1.696000, - "Standard_D32d_v4": 2.218000, - "Standard_D32d_v5": 2.218000, - "Standard_D32ds_v4": 2.218000, - "Standard_D32ds_v5": 2.218000, - "Standard_D32lds_v5": 1.920000, - "Standard_D32ls_v5": 1.690000, - "Standard_D32s_v3": 1.883000, - "Standard_D32s_v4": 1.883000, - "Standard_D32s_v5": 1.883000, - "Standard_D3_v2": 0.275000, - "Standard_D3_v2_Promo": 0.275000, - "Standard_D48_v3": 2.825000, - "Standard_D48_v4": 2.825000, - "Standard_D48_v5": 2.825000, - "Standard_D48a_v4": 2.825000, - "Standard_D48ads_v5": 3.046000, - "Standard_D48as_v4": 2.825000, - "Standard_D48as_v5": 2.544000, - "Standard_D48d_v4": 3.326000, - "Standard_D48d_v5": 3.326000, - "Standard_D48ds_v4": 3.326000, - "Standard_D48ds_v5": 3.326000, - "Standard_D48lds_v5": 2.880000, - "Standard_D48ls_v5": 2.534000, - "Standard_D48s_v3": 2.825000, - "Standard_D48s_v4": 2.825000, - "Standard_D48s_v5": 2.825000, - "Standard_D4_v2": 0.550000, - "Standard_D4_v2_Promo": 0.550000, - "Standard_D4_v3": 0.235000, - "Standard_D4_v4": 0.235000, - "Standard_D4_v5": 0.235000, - "Standard_D4a_v4": 0.235000, - "Standard_D4ads_v5": 0.254000, - "Standard_D4as_v4": 0.235000, - "Standard_D4as_v5": 0.212000, - "Standard_D4d_v4": 0.277000, - "Standard_D4d_v5": 0.277000, - "Standard_D4ds_v4": 0.277000, - "Standard_D4ds_v5": 0.277000, - "Standard_D4lds_v5": 0.240000, - "Standard_D4ls_v5": 0.211000, - "Standard_D4s_v3": 0.235000, - "Standard_D4s_v4": 0.235000, - "Standard_D4s_v5": 0.235000, - "Standard_D5_v2": 1.099000, - "Standard_D5_v2_Promo": 1.099000, - "Standard_D64-16s_v3": 3.766000, - "Standard_D64-32s_v3": 3.766000, - "Standard_D64_v3": 3.766000, - "Standard_D64_v4": 3.766000, - "Standard_D64_v5": 3.766000, - "Standard_D64a_v4": 3.766000, - "Standard_D64ads_v5": 4.061000, - "Standard_D64as_v4": 3.766000, - "Standard_D64as_v5": 3.392000, - "Standard_D64d_v4": 4.435000, - "Standard_D64d_v5": 4.435000, - "Standard_D64ds_v4": 4.435000, - "Standard_D64ds_v5": 4.435000, - "Standard_D64lds_v5": 3.840000, - "Standard_D64ls_v5": 3.379000, - "Standard_D64s_v3": 3.766000, - "Standard_D64s_v4": 3.766000, - "Standard_D64s_v5": 3.766000, - "Standard_D8_v3": 0.471000, - "Standard_D8_v4": 0.471000, - "Standard_D8_v5": 0.471000, - "Standard_D8a_v4": 0.471000, - "Standard_D8ads_v5": 0.508000, - "Standard_D8as_v4": 0.471000, - "Standard_D8as_v5": 0.424000, - "Standard_D8d_v4": 0.554000, - "Standard_D8d_v5": 0.554000, - "Standard_D8ds_v4": 0.554000, - "Standard_D8ds_v5": 0.554000, - "Standard_D8lds_v5": 0.480000, - "Standard_D8ls_v5": 0.422000, - "Standard_D8s_v3": 0.471000, - "Standard_D8s_v4": 0.471000, - "Standard_D8s_v5": 0.471000, - "Standard_D96_v5": 5.650000, - "Standard_D96a_v4": 5.650000, - "Standard_D96ads_v5": 6.091000, - "Standard_D96as_v4": 5.650000, - "Standard_D96as_v5": 5.088000, - "Standard_D96d_v5": 6.653000, - "Standard_D96ds_v5": 6.653000, - "Standard_D96lds_v5": 5.760000, - "Standard_D96ls_v5": 5.069000, - "Standard_D96s_v5": 5.650000, - "Standard_DS1": 0.080400, - "Standard_DS11": 0.208000, - "Standard_DS11-1_v2": 0.179000, - "Standard_DS11_v2": 0.179000, - "Standard_DS11_v2_Promo": 0.179000, - "Standard_DS12": 0.416000, - "Standard_DS12-1_v2": 0.359000, - "Standard_DS12-2_v2": 0.359000, - "Standard_DS12_v2": 0.359000, - "Standard_DS12_v2_Promo": 0.359000, - "Standard_DS13": 0.832000, - "Standard_DS13-2_v2": 0.718000, - "Standard_DS13-4_v2": 0.718000, - "Standard_DS13_v2": 0.718000, - "Standard_DS13_v2_Promo": 0.718000, - "Standard_DS14": 1.665000, - "Standard_DS14-4_v2": 1.435000, - "Standard_DS14-8_v2": 1.435000, - "Standard_DS14_v2": 1.435000, - "Standard_DS14_v2_Promo": 1.435000, - "Standard_DS15_v2": 1.794000, - "Standard_DS15i_v2": 1.794000, - "Standard_DS1_v2": 0.068700, - "Standard_DS2": 0.161000, - "Standard_DS2_v2": 0.137000, - "Standard_DS2_v2_Promo": 0.137000, - "Standard_DS3": 0.322000, - "Standard_DS3_v2": 0.275000, - "Standard_DS3_v2_Promo": 0.275000, - "Standard_DS4": 0.643000, - "Standard_DS4_v2": 0.550000, - "Standard_DS4_v2_Promo": 0.550000, - "Standard_DS5_v2": 1.099000, - "Standard_DS5_v2_Promo": 1.099000, - "Standard_E104i_v5": 8.872000, - "Standard_E104id_v5": 10.067000, - "Standard_E104ids_v5": 10.067000, - "Standard_E104is_v5": 8.872000, - "Standard_E112iads_v5": 9.911000, - "Standard_E112ias_v5": 8.624000, - "Standard_E112ibds_v5": 12.690000, - "Standard_E112ibs_v5": 11.396000, - "Standard_E16-4ads_v5": 1.287000, - "Standard_E16-4as_v4": 1.241000, - "Standard_E16-4as_v5": 1.120000, - "Standard_E16-4ds_v4": 1.408000, - "Standard_E16-4ds_v5": 1.408000, - "Standard_E16-4s_v3": 1.241000, - "Standard_E16-4s_v4": 1.241000, - "Standard_E16-4s_v5": 1.241000, - "Standard_E16-8ads_v5": 1.287000, - "Standard_E16-8as_v4": 1.241000, - "Standard_E16-8as_v5": 1.120000, - "Standard_E16-8ds_v4": 1.408000, - "Standard_E16-8ds_v5": 1.408000, - "Standard_E16-8s_v3": 1.241000, - "Standard_E16-8s_v4": 1.241000, - "Standard_E16-8s_v5": 1.241000, - "Standard_E16_v3": 1.241000, - "Standard_E16_v4": 1.241000, - "Standard_E16_v5": 1.241000, - "Standard_E16a_v4": 1.241000, - "Standard_E16ads_v5": 1.287000, - "Standard_E16as_v4": 1.241000, - "Standard_E16as_v5": 1.120000, - "Standard_E16bds_v5": 1.648000, - "Standard_E16bs_v5": 1.480000, - "Standard_E16d_v4": 1.408000, - "Standard_E16d_v5": 1.408000, - "Standard_E16ds_v4": 1.408000, - "Standard_E16ds_v5": 1.408000, - "Standard_E16s_v3": 1.241000, - "Standard_E16s_v4": 1.241000, - "Standard_E16s_v5": 1.241000, - "Standard_E20_v3": 1.550000, - "Standard_E20_v4": 1.550000, - "Standard_E20_v5": 1.551000, - "Standard_E20a_v4": 1.551000, - "Standard_E20ads_v5": 1.609000, - "Standard_E20as_v4": 1.551000, - "Standard_E20as_v5": 1.400000, - "Standard_E20d_v4": 1.760000, - "Standard_E20d_v5": 1.760000, - "Standard_E20ds_v4": 1.760000, - "Standard_E20ds_v5": 1.760000, - "Standard_E20s_v3": 1.550000, - "Standard_E20s_v4": 1.550000, - "Standard_E20s_v5": 1.551000, - "Standard_E2_v3": 0.155000, - "Standard_E2_v4": 0.155000, - "Standard_E2_v5": 0.155000, - "Standard_E2a_v4": 0.155000, - "Standard_E2ads_v5": 0.161000, - "Standard_E2as_v4": 0.155000, - "Standard_E2as_v5": 0.140000, - "Standard_E2bds_v5": 0.206000, - "Standard_E2bs_v5": 0.185000, - "Standard_E2d_v4": 0.176000, - "Standard_E2d_v5": 0.176000, - "Standard_E2ds_v4": 0.176000, - "Standard_E2ds_v5": 0.176000, - "Standard_E2s_v3": 0.155000, - "Standard_E2s_v4": 0.155000, - "Standard_E2s_v5": 0.155000, - "Standard_E32-16ads_v5": 2.574000, - "Standard_E32-16as_v4": 2.482000, - "Standard_E32-16as_v5": 2.240000, - "Standard_E32-16ds_v4": 2.816000, - "Standard_E32-16ds_v5": 2.816000, - "Standard_E32-16s_v3": 2.482000, - "Standard_E32-16s_v4": 2.482000, - "Standard_E32-16s_v5": 2.482000, - "Standard_E32-8ads_v5": 2.574000, - "Standard_E32-8as_v4": 2.482000, - "Standard_E32-8as_v5": 2.240000, - "Standard_E32-8ds_v4": 2.816000, - "Standard_E32-8ds_v5": 2.816000, - "Standard_E32-8s_v3": 2.482000, - "Standard_E32-8s_v4": 2.482000, - "Standard_E32-8s_v5": 2.482000, - "Standard_E32_v3": 2.482000, - "Standard_E32_v4": 2.482000, - "Standard_E32_v5": 2.482000, - "Standard_E32a_v4": 2.482000, - "Standard_E32ads_v5": 2.574000, - "Standard_E32as_v4": 2.482000, - "Standard_E32as_v5": 2.240000, - "Standard_E32bds_v5": 3.296000, - "Standard_E32bs_v5": 2.960000, - "Standard_E32d_v4": 2.816000, - "Standard_E32d_v5": 2.816000, - "Standard_E32ds_v4": 2.816000, - "Standard_E32ds_v5": 2.816000, - "Standard_E32s_v3": 2.482000, - "Standard_E32s_v4": 2.482000, - "Standard_E32s_v5": 2.482000, - "Standard_E4-2ads_v5": 0.322000, - "Standard_E4-2as_v4": 0.310000, - "Standard_E4-2as_v5": 0.280000, - "Standard_E4-2ds_v4": 0.352000, - "Standard_E4-2ds_v5": 0.352000, - "Standard_E4-2s_v3": 0.310000, - "Standard_E4-2s_v4": 0.310000, - "Standard_E4-2s_v5": 0.310000, - "Standard_E48_v3": 3.722000, - "Standard_E48_v4": 3.722000, - "Standard_E48_v5": 3.722000, - "Standard_E48a_v4": 3.722000, - "Standard_E48ads_v5": 3.862000, - "Standard_E48as_v4": 3.722000, - "Standard_E48as_v5": 3.360000, - "Standard_E48bds_v5": 4.944000, - "Standard_E48bs_v5": 4.440000, - "Standard_E48d_v4": 4.224000, - "Standard_E48d_v5": 4.224000, - "Standard_E48ds_v4": 4.224000, - "Standard_E48ds_v5": 4.224000, - "Standard_E48s_v3": 3.722000, - "Standard_E48s_v4": 3.722000, - "Standard_E48s_v5": 3.722000, - "Standard_E4_v3": 0.310000, - "Standard_E4_v4": 0.310000, - "Standard_E4_v5": 0.310000, - "Standard_E4a_v4": 0.310000, - "Standard_E4ads_v5": 0.322000, - "Standard_E4as_v4": 0.310000, - "Standard_E4as_v5": 0.280000, - "Standard_E4bds_v5": 0.412000, - "Standard_E4bs_v5": 0.370000, - "Standard_E4d_v4": 0.352000, - "Standard_E4d_v5": 0.352000, - "Standard_E4ds_v4": 0.352000, - "Standard_E4ds_v5": 0.352000, - "Standard_E4s_v3": 0.310000, - "Standard_E4s_v4": 0.310000, - "Standard_E4s_v5": 0.310000, - "Standard_E64-16ads_v5": 5.149000, - "Standard_E64-16as_v4": 4.963000, - "Standard_E64-16as_v5": 4.480000, - "Standard_E64-16ds_v4": 5.632000, - "Standard_E64-16ds_v5": 5.632000, - "Standard_E64-16s_v3": 4.963000, - "Standard_E64-16s_v4": 4.963000, - "Standard_E64-16s_v5": 4.963000, - "Standard_E64-32ads_v5": 5.149000, - "Standard_E64-32as_v4": 4.963000, - "Standard_E64-32as_v5": 4.480000, - "Standard_E64-32ds_v4": 5.632000, - "Standard_E64-32ds_v5": 5.632000, - "Standard_E64-32s_v3": 4.963000, - "Standard_E64-32s_v4": 4.963000, - "Standard_E64-32s_v5": 4.963000, - "Standard_E64_v3": 4.963000, - "Standard_E64_v4": 4.963000, - "Standard_E64_v5": 4.963000, - "Standard_E64a_v4": 4.963000, - "Standard_E64ads_v5": 5.149000, - "Standard_E64as_v4": 4.963000, - "Standard_E64as_v5": 4.480000, - "Standard_E64bds_v5": 6.592000, - "Standard_E64bs_v5": 5.920000, - "Standard_E64d_v4": 5.632000, - "Standard_E64d_v5": 5.632000, - "Standard_E64ds_v4": 5.632000, - "Standard_E64ds_v5": 5.632000, - "Standard_E64i_v3": 4.963000, - "Standard_E64is_v3": 4.963000, - "Standard_E64is_v4_SPECIAL": 4.963000, - "Standard_E64s_v3": 4.963000, - "Standard_E64s_v4": 4.963000, - "Standard_E64s_v5": 4.963000, - "Standard_E8-2ads_v5": 0.644000, - "Standard_E8-2as_v4": 0.620000, - "Standard_E8-2as_v5": 0.560000, - "Standard_E8-2ds_v4": 0.704000, - "Standard_E8-2ds_v5": 0.704000, - "Standard_E8-2s_v3": 0.620000, - "Standard_E8-2s_v4": 0.620000, - "Standard_E8-2s_v5": 0.620000, - "Standard_E8-4ads_v5": 0.644000, - "Standard_E8-4as_v4": 0.620000, - "Standard_E8-4as_v5": 0.560000, - "Standard_E8-4ds_v4": 0.704000, - "Standard_E8-4ds_v5": 0.704000, - "Standard_E8-4s_v3": 0.620000, - "Standard_E8-4s_v4": 0.620000, - "Standard_E8-4s_v5": 0.620000, - "Standard_E80ids_v4": 7.040000, - "Standard_E80is_v4": 6.200000, - "Standard_E8_v3": 0.620000, - "Standard_E8_v4": 0.620000, - "Standard_E8_v5": 0.620000, - "Standard_E8a_v4": 0.620000, - "Standard_E8ads_v5": 0.644000, - "Standard_E8as_v4": 0.620000, - "Standard_E8as_v5": 0.560000, - "Standard_E8bds_v5": 0.824000, - "Standard_E8bs_v5": 0.740000, - "Standard_E8d_v4": 0.704000, - "Standard_E8d_v5": 0.704000, - "Standard_E8ds_v4": 0.704000, - "Standard_E8ds_v5": 0.704000, - "Standard_E8s_v3": 0.620000, - "Standard_E8s_v4": 0.620000, - "Standard_E8s_v5": 0.620000, - "Standard_E96-24ads_v5": 7.723000, - "Standard_E96-24as_v4": 7.445000, - "Standard_E96-24as_v5": 6.720000, - "Standard_E96-24ds_v5": 8.448000, - "Standard_E96-24s_v5": 7.445000, - "Standard_E96-48ads_v5": 7.723000, - "Standard_E96-48as_v4": 7.445000, - "Standard_E96-48as_v5": 6.720000, - "Standard_E96-48ds_v5": 8.448000, - "Standard_E96-48s_v5": 7.445000, - "Standard_E96_v5": 7.445000, - "Standard_E96a_v4": 7.445000, - "Standard_E96ads_v5": 7.723000, - "Standard_E96as_v4": 7.445000, - "Standard_E96as_v5": 6.720000, - "Standard_E96bds_v5": 9.888000, - "Standard_E96bs_v5": 8.880000, - "Standard_E96d_v5": 8.448000, - "Standard_E96ds_v5": 8.448000, - "Standard_E96iads_v5": 8.496000, - "Standard_E96ias_v4": 7.445000, - "Standard_E96ias_v5": 7.392000, - "Standard_E96s_v5": 7.445000, - "Standard_F1": 0.059700, - "Standard_F16": 0.955000, - "Standard_F16s": 0.955000, - "Standard_F16s_v2": 0.845000, - "Standard_F1s": 0.059700, - "Standard_F2": 0.119000, - "Standard_F2s": 0.119000, - "Standard_F2s_v2": 0.106000, - "Standard_F32s_v2": 1.688000, - "Standard_F4": 0.239000, - "Standard_F48s_v2": 2.534000, - "Standard_F4s": 0.239000, - "Standard_F4s_v2": 0.211000, - "Standard_F64s_v2": 3.376000, - "Standard_F72s_v2": 3.802000, - "Standard_F8": 0.478000, - "Standard_F8s": 0.478000, - "Standard_F8s_v2": 0.422000, - "Standard_HB120-16rs_v2": 5.148000, - "Standard_HB120-32rs_v2": 5.148000, - "Standard_HB120-64rs_v2": 5.148000, - "Standard_HB120-96rs_v2": 5.148000, - "Standard_HB120rs_v2": 5.148000, - "Standard_L16as_v3": 1.512000, - "Standard_L16s_v3": 1.688000, - "Standard_L32as_v3": 3.024000, - "Standard_L32s_v3": 3.376000, - "Standard_L48as_v3": 4.536000, - "Standard_L48s_v3": 5.064000, - "Standard_L64as_v3": 6.048000, - "Standard_L64s_v3": 6.752000, - "Standard_L80as_v3": 7.560000, - "Standard_L80s_v3": 8.440000, - "Standard_L8as_v3": 0.756000, - "Standard_L8s_v3": 0.844000, - "Standard_M128": 17.610000, - "Standard_M128-32ms": 35.230000, - "Standard_M128-64ms": 35.230000, - "Standard_M128dms_v2": 35.230000, - "Standard_M128ds_v2": 17.610000, - "Standard_M128m": 35.230000, - "Standard_M128ms": 35.230000, - "Standard_M128ms_v2": 34.680000, - "Standard_M128s": 17.610000, - "Standard_M128s_v2": 17.050000, - "Standard_M16-4ms": 4.060000, - "Standard_M16-8ms": 4.060000, - "Standard_M16ms": 4.060000, - "Standard_M16s": 3.150000, - "Standard_M192idms_v2": 42.320000, - "Standard_M192ids_v2": 21.160000, - "Standard_M192ims_v2": 41.770000, - "Standard_M192is_v2": 20.610000, - "Standard_M32-16ms": 8.110000, - "Standard_M32-8ms": 8.110000, - "Standard_M32dms_v2": 8.110000, - "Standard_M32ls": 3.540000, - "Standard_M32ms": 8.110000, - "Standard_M32ms_v2": 7.970000, - "Standard_M32s": 4.400000, - "Standard_M32ts": 3.330000, - "Standard_M64": 8.800000, - "Standard_M64-16ms": 13.650000, - "Standard_M64-32ms": 13.650000, - "Standard_M64dms_v2": 13.650000, - "Standard_M64ds_v2": 8.800000, - "Standard_M64ls": 6.660000, - "Standard_M64m": 13.650000, - "Standard_M64ms": 13.650000, - "Standard_M64ms_v2": 13.370000, - "Standard_M64s": 8.800000, - "Standard_M64s_v2": 8.530000, - "Standard_M8-2ms": 2.030000, - "Standard_M8-4ms": 2.030000, - "Standard_M8ms": 2.030000, - "Standard_NC12s_v3": 8.411000, - "Standard_NC24rs_v3": 18.503000, - "Standard_NC24s_v3": 16.821000, - "Standard_NC6s_v3": 4.205000, - "Standard_NV12ads_A10_v5": 1.298000, - "Standard_NV18ads_A10_v5": 2.288000, - "Standard_NV36adms_A10_v5": 6.464000, - "Standard_NV36ads_A10_v5": 4.576000, - "Standard_NV6ads_A10_v5": 0.649000, - "Standard_NV72ads_A10_v5": 9.324000, - } - // southafricanorth - initialOnDemandPrices["southafricanorth"] = map[string]float64{ - "Dadsv5_Type1": 8.470000, - "Dasv4_Type1": 6.985000, - "Dasv4_Type2": 6.985000, - "Dasv5_Type1": 7.053000, - "Ddsv4_Type 1": 5.280000, - "Ddsv4_Type2": 6.270000, - "Ddsv5_Type1": 7.920000, - "Dsv3_Type3": 5.662000, - "Dsv3_Type4": 7.077000, - "Dsv4_Type1": 5.588000, - "Dsv4_Type2": 6.706000, - "Dsv5_Type1": 6.985000, - "Eadsv5_Type1": 9.134000, - "Easv4_Type1": 8.870000, - "Easv4_Type2": 8.870000, - "Easv5_Type1": 7.973000, - "Ebdsv5-Type1": 7.814000, - "Ebsv5-Type1": 7.040000, - "Edsv4_Type 1": 6.688000, - "Edsv4_Type2": 8.067000, - "Edsv5_Type1": 10.032000, - "Esv3_Type3": 5.758000, - "Esv3_Type4": 7.801000, - "Esv4_Type1": 5.913000, - "Esv4_Type2": 7.762000, - "Esv5_Type1": 8.870000, - "Fsv2 Type3": 5.267000, - "Fsv2_Type2": 4.510000, - "Fsv2_Type4": 6.019000, - "Lasv3_Type1": 9.020000, - "Lsv3_Type1": 10.076000, - "Mdsmv2MedMem _Type1": 39.341000, - "Mdsv2MedMem_Type1": 19.663000, - "Ms_Type1": 19.656000, - "Msm_Type1": 39.347000, - "Msmv2MedMem Type1": 38.721000, - "Msmv2_Type1": 109.060000, - "Msv2MedMem Type1": 19.043000, - "Msv2_Type1": 54.538000, - "NVsv3_Type1": 6.420000, - "Standard_A1_v2": 0.048200, - "Standard_A2_v2": 0.102000, - "Standard_A2m_v2": 0.133000, - "Standard_A4_v2": 0.213000, - "Standard_A4m_v2": 0.279000, - "Standard_A8_v2": 0.446000, - "Standard_A8m_v2": 0.586000, - "Standard_B12ms": 0.651000, - "Standard_B16als_v2": 0.765000, - "Standard_B16as_v2": 0.855000, - "Standard_B16ls_v2": 0.769000, - "Standard_B16ms": 0.868000, - "Standard_B16s_v2": 0.868000, - "Standard_B1ls": 0.006800, - "Standard_B1ms": 0.027100, - "Standard_B1s": 0.013600, - "Standard_B20ms": 1.085000, - "Standard_B2als_v2": 0.048800, - "Standard_B2as_v2": 0.097700, - "Standard_B2ats_v2": 0.021400, - "Standard_B2ls_v2": 0.063500, - "Standard_B2ms": 0.108000, - "Standard_B2s": 0.054200, - "Standard_B2s_v2": 0.109000, - "Standard_B2ts_v2": 0.013600, - "Standard_B32als_v2": 1.531000, - "Standard_B32as_v2": 1.710000, - "Standard_B32ls_v2": 1.684000, - "Standard_B32s_v2": 1.736000, - "Standard_B4als_v2": 0.191000, - "Standard_B4as_v2": 0.195000, - "Standard_B4ls_v2": 0.211000, - "Standard_B4ms": 0.217000, - "Standard_B4s_v2": 0.217000, - "Standard_B8als_v2": 0.383000, - "Standard_B8as_v2": 0.427000, - "Standard_B8ls_v2": 0.421000, - "Standard_B8ms": 0.434000, - "Standard_B8s_v2": 0.471000, - "Standard_D1": 0.089800, - "Standard_D11": 0.232000, - "Standard_D11_v2": 0.200000, - "Standard_D12": 0.465000, - "Standard_D12_v2": 0.401000, - "Standard_D13": 0.930000, - "Standard_D13_v2": 0.801000, - "Standard_D14": 1.859000, - "Standard_D14_v2": 1.603000, - "Standard_D15_v2": 2.003000, - "Standard_D15i_v2": 2.003000, - "Standard_D16_v3": 1.016000, - "Standard_D16_v4": 1.016000, - "Standard_D16_v5": 1.016000, - "Standard_D16a_v4": 1.016000, - "Standard_D16ads_v5": 1.100000, - "Standard_D16as_v4": 1.016000, - "Standard_D16as_v5": 0.916000, - "Standard_D16as_v5_Promo": 0.816000, - "Standard_D16d_v4": 1.200000, - "Standard_D16d_v5": 1.200000, - "Standard_D16ds_v4": 1.200000, - "Standard_D16ds_v5": 1.200000, - "Standard_D16lds_v5": 1.040000, - "Standard_D16ls_v5": 0.912000, - "Standard_D16s_v3": 1.016000, - "Standard_D16s_v4": 1.016000, - "Standard_D16s_v5": 1.016000, - "Standard_D1_v2": 0.076700, - "Standard_D2": 0.180000, - "Standard_D2_v2": 0.153000, - "Standard_D2_v3": 0.127000, - "Standard_D2_v4": 0.127000, - "Standard_D2_v5": 0.127000, - "Standard_D2a_v4": 0.127000, - "Standard_D2ads_v5": 0.138000, - "Standard_D2as_v4": 0.127000, - "Standard_D2as_v5": 0.115000, - "Standard_D2as_v5_Promo": 0.102000, - "Standard_D2d_v4": 0.150000, - "Standard_D2d_v5": 0.150000, - "Standard_D2ds_v4": 0.150000, - "Standard_D2ds_v5": 0.150000, - "Standard_D2lds_v5": 0.130000, - "Standard_D2ls_v5": 0.114000, - "Standard_D2s_v3": 0.127000, - "Standard_D2s_v4": 0.127000, - "Standard_D2s_v5": 0.127000, - "Standard_D3": 0.359000, - "Standard_D32-16s_v3": 2.032000, - "Standard_D32-8s_v3": 2.032000, - "Standard_D32_v3": 2.032000, - "Standard_D32_v4": 2.032000, - "Standard_D32_v5": 2.032000, - "Standard_D32a_v4": 2.032000, - "Standard_D32ads_v5": 2.200000, - "Standard_D32as_v4": 2.032000, - "Standard_D32as_v5": 1.832000, - "Standard_D32as_v5_Promo": 1.632000, - "Standard_D32d_v4": 2.400000, - "Standard_D32d_v5": 2.400000, - "Standard_D32ds_v4": 2.400000, - "Standard_D32ds_v5": 2.400000, - "Standard_D32lds_v5": 2.080000, - "Standard_D32ls_v5": 1.824000, - "Standard_D32s_v3": 2.032000, - "Standard_D32s_v4": 2.032000, - "Standard_D32s_v5": 2.032000, - "Standard_D3_v2": 0.307000, - "Standard_D4": 0.718000, - "Standard_D48_v3": 3.048000, - "Standard_D48_v4": 3.048000, - "Standard_D48_v5": 3.048000, - "Standard_D48a_v4": 3.048000, - "Standard_D48ads_v5": 3.300000, - "Standard_D48as_v4": 3.048000, - "Standard_D48as_v5": 2.748000, - "Standard_D48as_v5_Promo": 2.448000, - "Standard_D48d_v4": 3.600000, - "Standard_D48d_v5": 3.600000, - "Standard_D48ds_v4": 3.600000, - "Standard_D48ds_v5": 3.600000, - "Standard_D48lds_v5": 3.120000, - "Standard_D48ls_v5": 2.736000, - "Standard_D48s_v3": 3.048000, - "Standard_D48s_v4": 3.048000, - "Standard_D48s_v5": 3.048000, - "Standard_D4_v2": 0.614000, - "Standard_D4_v3": 0.254000, - "Standard_D4_v4": 0.254000, - "Standard_D4_v5": 0.254000, - "Standard_D4a_v4": 0.254000, - "Standard_D4ads_v5": 0.275000, - "Standard_D4as_v4": 0.254000, - "Standard_D4as_v5": 0.229000, - "Standard_D4as_v5_Promo": 0.204000, - "Standard_D4d_v4": 0.300000, - "Standard_D4d_v5": 0.300000, - "Standard_D4ds_v4": 0.300000, - "Standard_D4ds_v5": 0.300000, - "Standard_D4lds_v5": 0.260000, - "Standard_D4ls_v5": 0.228000, - "Standard_D4s_v3": 0.254000, - "Standard_D4s_v4": 0.254000, - "Standard_D4s_v5": 0.254000, - "Standard_D5_v2": 1.227000, - "Standard_D64-16s_v3": 4.064000, - "Standard_D64-32s_v3": 4.064000, - "Standard_D64_v3": 4.064000, - "Standard_D64_v4": 4.064000, - "Standard_D64_v5": 4.064000, - "Standard_D64a_v4": 4.064000, - "Standard_D64ads_v5": 4.400000, - "Standard_D64as_v4": 4.064000, - "Standard_D64as_v5": 3.664000, - "Standard_D64as_v5_Promo": 3.264000, - "Standard_D64d_v4": 4.800000, - "Standard_D64d_v5": 4.800000, - "Standard_D64ds_v4": 4.800000, - "Standard_D64ds_v5": 4.800000, - "Standard_D64lds_v5": 4.160000, - "Standard_D64ls_v5": 3.648000, - "Standard_D64s_v3": 4.064000, - "Standard_D64s_v4": 4.064000, - "Standard_D64s_v5": 4.064000, - "Standard_D8_v3": 0.508000, - "Standard_D8_v4": 0.508000, - "Standard_D8_v5": 0.508000, - "Standard_D8a_v4": 0.508000, - "Standard_D8ads_v5": 0.550000, - "Standard_D8as_v4": 0.508000, - "Standard_D8as_v5": 0.458000, - "Standard_D8as_v5_Promo": 0.408000, - "Standard_D8d_v4": 0.600000, - "Standard_D8d_v5": 0.600000, - "Standard_D8ds_v4": 0.600000, - "Standard_D8ds_v5": 0.600000, - "Standard_D8lds_v5": 0.520000, - "Standard_D8ls_v5": 0.456000, - "Standard_D8s_v3": 0.508000, - "Standard_D8s_v4": 0.508000, - "Standard_D8s_v5": 0.508000, - "Standard_D96_v5": 6.096000, - "Standard_D96a_v4": 6.096000, - "Standard_D96ads_v5": 6.600000, - "Standard_D96as_v4": 6.096000, - "Standard_D96as_v5": 5.496000, - "Standard_D96as_v5_Promo": 4.896000, - "Standard_D96d_v5": 7.200000, - "Standard_D96ds_v5": 7.200000, - "Standard_D96lds_v5": 6.240000, - "Standard_D96ls_v5": 5.472000, - "Standard_D96s_v5": 6.096000, - "Standard_DS1": 0.089800, - "Standard_DS11": 0.232000, - "Standard_DS11-1_v2": 0.200000, - "Standard_DS11_v2": 0.200000, - "Standard_DS11_v2_Promo": 0.000000, - "Standard_DS12": 0.465000, - "Standard_DS12-1_v2": 0.401000, - "Standard_DS12-2_v2": 0.401000, - "Standard_DS12_v2": 0.401000, - "Standard_DS12_v2_Promo": 0.000000, - "Standard_DS13": 0.930000, - "Standard_DS13-2_v2": 0.801000, - "Standard_DS13-4_v2": 0.801000, - "Standard_DS13_v2": 0.801000, - "Standard_DS13_v2_Promo": 0.000000, - "Standard_DS14": 1.859000, - "Standard_DS14-4_v2": 1.603000, - "Standard_DS14-8_v2": 1.603000, - "Standard_DS14_v2": 1.603000, - "Standard_DS14_v2_Promo": 0.000000, - "Standard_DS15_v2": 2.003000, - "Standard_DS15i_v2": 2.003000, - "Standard_DS1_v2": 0.076700, - "Standard_DS2": 0.180000, - "Standard_DS2_v2": 0.153000, - "Standard_DS2_v2_Promo": 0.000000, - "Standard_DS3": 0.359000, - "Standard_DS3_v2": 0.307000, - "Standard_DS3_v2_Promo": 0.000000, - "Standard_DS4": 0.718000, - "Standard_DS4_v2": 0.614000, - "Standard_DS4_v2_Promo": 0.000000, - "Standard_DS5_v2": 1.227000, - "Standard_DS5_v2_Promo": 0.000000, - "Standard_E104i_v5": 9.610000, - "Standard_E104id_v5": 10.868000, - "Standard_E104ids_v5": 10.868000, - "Standard_E104is_v5": 9.610000, - "Standard_E112iads_v5": 10.657000, - "Standard_E112ias_v5": 9.302000, - "Standard_E112ibds_v5": 13.675000, - "Standard_E112ibs_v5": 12.320000, - "Standard_E16-4ads_v5": 1.384000, - "Standard_E16-4as_v4": 1.344000, - "Standard_E16-4as_v5": 1.208000, - "Standard_E16-4ds_v4": 1.520000, - "Standard_E16-4ds_v5": 1.520000, - "Standard_E16-4s_v3": 1.344000, - "Standard_E16-4s_v4": 1.344000, - "Standard_E16-4s_v5": 1.344000, - "Standard_E16-8ads_v5": 1.384000, - "Standard_E16-8as_v4": 1.344000, - "Standard_E16-8as_v5": 1.208000, - "Standard_E16-8ds_v4": 1.520000, - "Standard_E16-8ds_v5": 1.520000, - "Standard_E16-8s_v3": 1.344000, - "Standard_E16-8s_v4": 1.344000, - "Standard_E16-8s_v5": 1.344000, - "Standard_E16_v3": 1.344000, - "Standard_E16_v4": 1.344000, - "Standard_E16_v5": 1.344000, - "Standard_E16a_v4": 1.344000, - "Standard_E16ads_v5": 1.384000, - "Standard_E16as_v4": 1.344000, - "Standard_E16as_v5": 1.208000, - "Standard_E16bds_v5": 1.776000, - "Standard_E16bs_v5": 1.600000, - "Standard_E16d_v4": 1.520000, - "Standard_E16d_v5": 1.520000, - "Standard_E16ds_v4": 1.520000, - "Standard_E16ds_v5": 1.520000, - "Standard_E16s_v3": 1.344000, - "Standard_E16s_v4": 1.344000, - "Standard_E16s_v5": 1.344000, - "Standard_E20_v3": 1.680000, - "Standard_E20_v4": 1.680000, - "Standard_E20_v5": 1.680000, - "Standard_E20a_v4": 1.680000, - "Standard_E20ads_v5": 1.730000, - "Standard_E20as_v4": 1.680000, - "Standard_E20as_v5": 1.510000, - "Standard_E20d_v4": 1.900000, - "Standard_E20d_v5": 1.900000, - "Standard_E20ds_v4": 1.900000, - "Standard_E20ds_v5": 1.900000, - "Standard_E20s_v3": 1.680000, - "Standard_E20s_v4": 1.680000, - "Standard_E20s_v5": 1.680000, - "Standard_E2_v3": 0.168000, - "Standard_E2_v4": 0.168000, - "Standard_E2_v5": 0.168000, - "Standard_E2a_v4": 0.168000, - "Standard_E2ads_v5": 0.173000, - "Standard_E2as_v4": 0.168000, - "Standard_E2as_v5": 0.151000, - "Standard_E2bds_v5": 0.222000, - "Standard_E2bs_v5": 0.200000, - "Standard_E2d_v4": 0.190000, - "Standard_E2d_v5": 0.190000, - "Standard_E2ds_v4": 0.190000, - "Standard_E2ds_v5": 0.190000, - "Standard_E2s_v3": 0.168000, - "Standard_E2s_v4": 0.168000, - "Standard_E2s_v5": 0.168000, - "Standard_E32-16ads_v5": 2.768000, - "Standard_E32-16as_v4": 2.688000, - "Standard_E32-16as_v5": 2.416000, - "Standard_E32-16ds_v4": 3.040000, - "Standard_E32-16ds_v5": 3.040000, - "Standard_E32-16s_v3": 2.688000, - "Standard_E32-16s_v4": 2.688000, - "Standard_E32-16s_v5": 2.688000, - "Standard_E32-8ads_v5": 2.768000, - "Standard_E32-8as_v4": 2.688000, - "Standard_E32-8as_v5": 2.416000, - "Standard_E32-8ds_v4": 3.040000, - "Standard_E32-8ds_v5": 3.040000, - "Standard_E32-8s_v3": 2.688000, - "Standard_E32-8s_v4": 2.688000, - "Standard_E32-8s_v5": 2.688000, - "Standard_E32_v3": 2.688000, - "Standard_E32_v4": 2.688000, - "Standard_E32_v5": 2.688000, - "Standard_E32a_v4": 2.688000, - "Standard_E32ads_v5": 2.768000, - "Standard_E32as_v4": 2.688000, - "Standard_E32as_v5": 2.416000, - "Standard_E32bds_v5": 3.552000, - "Standard_E32bs_v5": 3.200000, - "Standard_E32d_v4": 3.040000, - "Standard_E32d_v5": 3.040000, - "Standard_E32ds_v4": 3.040000, - "Standard_E32ds_v5": 3.040000, - "Standard_E32s_v3": 2.688000, - "Standard_E32s_v4": 2.688000, - "Standard_E32s_v5": 2.688000, - "Standard_E4-2ads_v5": 0.346000, - "Standard_E4-2as_v4": 0.336000, - "Standard_E4-2as_v5": 0.302000, - "Standard_E4-2ds_v4": 0.380000, - "Standard_E4-2ds_v5": 0.380000, - "Standard_E4-2s_v3": 0.336000, - "Standard_E4-2s_v4": 0.336000, - "Standard_E4-2s_v5": 0.336000, - "Standard_E48_v3": 4.032000, - "Standard_E48_v4": 4.032000, - "Standard_E48_v5": 4.032000, - "Standard_E48a_v4": 4.032000, - "Standard_E48ads_v5": 4.152000, - "Standard_E48as_v4": 4.032000, - "Standard_E48as_v5": 3.624000, - "Standard_E48bds_v5": 5.328000, - "Standard_E48bs_v5": 4.800000, - "Standard_E48d_v4": 4.560000, - "Standard_E48d_v5": 4.560000, - "Standard_E48ds_v4": 4.560000, - "Standard_E48ds_v5": 4.560000, - "Standard_E48s_v3": 4.032000, - "Standard_E48s_v4": 4.032000, - "Standard_E48s_v5": 4.032000, - "Standard_E4_v3": 0.336000, - "Standard_E4_v4": 0.336000, - "Standard_E4_v5": 0.336000, - "Standard_E4a_v4": 0.336000, - "Standard_E4ads_v5": 0.346000, - "Standard_E4as_v4": 0.336000, - "Standard_E4as_v5": 0.302000, - "Standard_E4bds_v5": 0.444000, - "Standard_E4bs_v5": 0.400000, - "Standard_E4d_v4": 0.380000, - "Standard_E4d_v5": 0.380000, - "Standard_E4ds_v4": 0.380000, - "Standard_E4ds_v5": 0.380000, - "Standard_E4s_v3": 0.336000, - "Standard_E4s_v4": 0.336000, - "Standard_E4s_v5": 0.336000, - "Standard_E64-16ads_v5": 5.536000, - "Standard_E64-16as_v4": 5.376000, - "Standard_E64-16as_v5": 4.832000, - "Standard_E64-16ds_v4": 6.080000, - "Standard_E64-16ds_v5": 6.080000, - "Standard_E64-16s_v3": 4.863000, - "Standard_E64-16s_v4": 5.376000, - "Standard_E64-16s_v5": 5.376000, - "Standard_E64-32ads_v5": 5.536000, - "Standard_E64-32as_v4": 5.376000, - "Standard_E64-32as_v5": 4.832000, - "Standard_E64-32ds_v4": 6.080000, - "Standard_E64-32ds_v5": 6.080000, - "Standard_E64-32s_v3": 4.863000, - "Standard_E64-32s_v4": 5.376000, - "Standard_E64-32s_v5": 5.376000, - "Standard_E64_v3": 4.863000, - "Standard_E64_v4": 5.376000, - "Standard_E64_v5": 5.376000, - "Standard_E64a_v4": 5.376000, - "Standard_E64ads_v5": 5.536000, - "Standard_E64as_v4": 5.376000, - "Standard_E64as_v5": 4.832000, - "Standard_E64bds_v5": 7.104000, - "Standard_E64bs_v5": 6.400000, - "Standard_E64d_v4": 6.080000, - "Standard_E64d_v5": 6.080000, - "Standard_E64ds_v4": 6.080000, - "Standard_E64ds_v5": 6.080000, - "Standard_E64i_v3": 4.863000, - "Standard_E64is_v3": 4.863000, - "Standard_E64s_v3": 4.863000, - "Standard_E64s_v4": 5.376000, - "Standard_E64s_v5": 5.376000, - "Standard_E8-2ads_v5": 0.692000, - "Standard_E8-2as_v4": 0.672000, - "Standard_E8-2as_v5": 0.604000, - "Standard_E8-2ds_v4": 0.760000, - "Standard_E8-2ds_v5": 0.760000, - "Standard_E8-2s_v3": 0.672000, - "Standard_E8-2s_v4": 0.672000, - "Standard_E8-2s_v5": 0.672000, - "Standard_E8-4ads_v5": 0.692000, - "Standard_E8-4as_v4": 0.672000, - "Standard_E8-4as_v5": 0.604000, - "Standard_E8-4ds_v4": 0.760000, - "Standard_E8-4ds_v5": 0.760000, - "Standard_E8-4s_v3": 0.672000, - "Standard_E8-4s_v4": 0.672000, - "Standard_E8-4s_v5": 0.672000, - "Standard_E80ids_v4": 7.600000, - "Standard_E80is_v4": 6.720000, - "Standard_E8_v3": 0.672000, - "Standard_E8_v4": 0.672000, - "Standard_E8_v5": 0.672000, - "Standard_E8a_v4": 0.672000, - "Standard_E8ads_v5": 0.692000, - "Standard_E8as_v4": 0.672000, - "Standard_E8as_v5": 0.604000, - "Standard_E8bds_v5": 0.888000, - "Standard_E8bs_v5": 0.800000, - "Standard_E8d_v4": 0.760000, - "Standard_E8d_v5": 0.760000, - "Standard_E8ds_v4": 0.760000, - "Standard_E8ds_v5": 0.760000, - "Standard_E8s_v3": 0.672000, - "Standard_E8s_v4": 0.672000, - "Standard_E8s_v5": 0.672000, - "Standard_E96-24ads_v5": 8.304000, - "Standard_E96-24as_v4": 8.064000, - "Standard_E96-24as_v5": 7.248000, - "Standard_E96-24ds_v5": 9.120000, - "Standard_E96-24s_v5": 8.064000, - "Standard_E96-48ads_v5": 8.304000, - "Standard_E96-48as_v4": 8.064000, - "Standard_E96-48as_v5": 7.248000, - "Standard_E96-48ds_v5": 9.120000, - "Standard_E96-48s_v5": 8.064000, - "Standard_E96_v5": 8.064000, - "Standard_E96a_v4": 8.064000, - "Standard_E96ads_v5": 8.304000, - "Standard_E96as_v4": 8.064000, - "Standard_E96as_v5": 7.248000, - "Standard_E96bds_v5": 10.656000, - "Standard_E96bs_v5": 9.600000, - "Standard_E96d_v5": 9.120000, - "Standard_E96ds_v5": 9.120000, - "Standard_E96iads_v5": 9.134000, - "Standard_E96ias_v4": 8.064000, - "Standard_E96ias_v5": 7.973000, - "Standard_E96s_v5": 8.064000, - "Standard_F1": 0.066700, - "Standard_F16": 1.066000, - "Standard_F16s": 1.066000, - "Standard_F16s_v2": 0.911000, - "Standard_F1s": 0.066700, - "Standard_F2": 0.133000, - "Standard_F2s": 0.133000, - "Standard_F2s_v2": 0.114000, - "Standard_F32s_v2": 1.822000, - "Standard_F4": 0.267000, - "Standard_F48s_v2": 2.734000, - "Standard_F4s": 0.267000, - "Standard_F4s_v2": 0.228000, - "Standard_F64s_v2": 3.645000, - "Standard_F72s_v2": 4.100000, - "Standard_F8": 0.533000, - "Standard_F8s": 0.533000, - "Standard_F8s_v2": 0.456000, - "Standard_L16as_v3": 1.640000, - "Standard_L16s_v3": 1.832000, - "Standard_L32as_v3": 3.280000, - "Standard_L32s_v3": 3.664000, - "Standard_L48as_v3": 4.920000, - "Standard_L48s_v3": 5.496000, - "Standard_L64as_v3": 6.560000, - "Standard_L64s_v3": 7.328000, - "Standard_L80as_v3": 8.200000, - "Standard_L80s_v3": 9.160000, - "Standard_L8as_v3": 0.820000, - "Standard_L8s_v3": 0.916000, - "Standard_M128": 17.873000, - "Standard_M128-32ms": 35.762000, - "Standard_M128-64ms": 35.762000, - "Standard_M128dms_v2": 35.767000, - "Standard_M128ds_v2": 17.877000, - "Standard_M128m": 35.762000, - "Standard_M128ms": 35.762000, - "Standard_M128ms_v2": 35.203000, - "Standard_M128s": 17.873000, - "Standard_M128s_v2": 17.313000, - "Standard_M16-4ms": 4.118000, - "Standard_M16-8ms": 4.118000, - "Standard_M16ms": 4.118000, - "Standard_M16s": 3.199000, - "Standard_M192idms_v2": 42.969000, - "Standard_M192ids_v2": 21.484000, - "Standard_M192ims_v2": 42.405000, - "Standard_M192is_v2": 20.920000, - "Standard_M208-104ms_v2": 59.791000, - "Standard_M208-104s_v2": 29.895000, - "Standard_M208-52ms_v2": 59.791000, - "Standard_M208-52s_v2": 29.895000, - "Standard_M208ms_v2": 59.791000, - "Standard_M208s_v2": 29.895000, - "Standard_M32-16ms": 8.236000, - "Standard_M32-8ms": 8.236000, - "Standard_M32dms_v2": 8.236000, - "Standard_M32ls": 3.829709, - "Standard_M32ms": 8.236000, - "Standard_M32ms_v2": 8.095000, - "Standard_M32s": 4.469000, - "Standard_M32ts": 3.608431, - "Standard_M416-104ms_v2": 132.860000, - "Standard_M416-104s_v2": 66.437000, - "Standard_M416-208ms_v2": 132.860000, - "Standard_M416-208s_v2": 66.437000, - "Standard_M416is_v2": 66.437000, - "Standard_M416ms_v2": 132.860000, - "Standard_M416s_8_v2": 96.520000, - "Standard_M416s_v2": 66.437000, - "Standard_M64": 8.936000, - "Standard_M64-16ms": 13.852000, - "Standard_M64-32ms": 13.852000, - "Standard_M64dms_v2": 13.857000, - "Standard_M64ds_v2": 8.937000, - "Standard_M64ls": 7.218195, - "Standard_M64m": 13.852000, - "Standard_M64ms": 13.852000, - "Standard_M64ms_v2": 13.575000, - "Standard_M64s": 8.936000, - "Standard_M64s_v2": 8.655000, - "Standard_M8-2ms": 2.059000, - "Standard_M8-4ms": 2.059000, - "Standard_M8ms": 2.059000, - "Standard_ND96ams_A100_v4": 47.844000, - "Standard_ND96amsr_A100_v4": 47.844000, - "Standard_NV12ads_A10_v5": 1.326000, - "Standard_NV12s_v3": 1.460000, - "Standard_NV18ads_A10_v5": 2.336000, - "Standard_NV24s_v3": 2.921000, - "Standard_NV36adms_A10_v5": 6.599000, - "Standard_NV36ads_A10_v5": 4.672000, - "Standard_NV48s_v3": 5.841000, - "Standard_NV6ads_A10_v5": 0.663000, - "Standard_NV72ads_A10_v5": 9.519000, - } - // southafricawest - initialOnDemandPrices["southafricawest"] = map[string]float64{ - "Dadsv5_Type1": 11.011000, - "Dasv4_Type2": 9.080000, - "Ddsv5_Type1": 10.296000, - "Dsv3_Type3": 7.098000, - "Eadsv5_Type1": 11.875000, - "Easv4_Type1": 11.532000, - "Easv4_Type2": 11.532000, - "Easv5_Type1": 10.365000, - "Ebdsv5-Type1": 10.159000, - "Ebsv5-Type1": 9.152000, - "Edsv5_Type1": 13.042000, - "Esv5_Type1": 11.532000, - "Fsv2_Type2": 5.655000, - "Lasv3_Type1": 11.726000, - "Standard_A1_v2": 0.060500, - "Standard_A2m_v2": 0.166000, - "Standard_A4_v2": 0.267000, - "Standard_A8m_v2": 0.734000, - "Standard_B16als_v2": 0.973000, - "Standard_B16as_v2": 1.016000, - "Standard_B16ls_v2": 0.999000, - "Standard_B16ms": 1.085000, - "Standard_B16s_v2": 1.202000, - "Standard_B1ls": 0.008500, - "Standard_B2als_v2": 0.063500, - "Standard_B2ats_v2": 0.015900, - "Standard_B2ls_v2": 0.079700, - "Standard_B2ms": 0.135625, - "Standard_B2s_v2": 0.141000, - "Standard_B2ts_v2": 0.026800, - "Standard_B32als_v2": 1.946000, - "Standard_B32as_v2": 2.031000, - "Standard_B32s_v2": 2.257000, - "Standard_B4als_v2": 0.225000, - "Standard_B4as_v2": 0.254000, - "Standard_B4ls_v2": 0.250000, - "Standard_B4ms": 0.271250, - "Standard_B8als_v2": 0.487000, - "Standard_B8ls_v2": 0.500000, - "Standard_B8ms": 0.542375, - "Standard_B8s_v2": 0.564000, - "Standard_D1": 0.113000, - "Standard_D11": 0.291000, - "Standard_D12": 0.583000, - "Standard_D12_v2": 0.502000, - "Standard_D13": 1.165000, - "Standard_D14": 2.331000, - "Standard_D14_v2": 2.009000, - "Standard_D15_v2": 2.512000, - "Standard_D15i_v2": 2.512000, - "Standard_D16a_v4": 1.321000, - "Standard_D16ads_v5": 1.430000, - "Standard_D16as_v5": 1.191000, - "Standard_D16d_v5": 1.560000, - "Standard_D16ds_v5": 1.560000, - "Standard_D16ls_v5": 1.186000, - "Standard_D16s_v3": 1.270000, - "Standard_D16s_v4": 1.344000, - "Standard_D16s_v5": 1.321000, - "Standard_D1_v2": 0.096200, - "Standard_D2_v3": 0.158750, - "Standard_D2_v4": 0.168000, - "Standard_D2_v5": 0.165000, - "Standard_D2a_v4": 0.165000, - "Standard_D2as_v4": 0.165000, - "Standard_D2as_v5": 0.149000, - "Standard_D2d_v4": 0.198000, - "Standard_D2ds_v4": 0.198000, - "Standard_D2ds_v5": 0.195000, - "Standard_D2lds_v5": 0.169000, - "Standard_D2ls_v5": 0.148000, - "Standard_D2s_v3": 0.158750, - "Standard_D2s_v4": 0.168000, - "Standard_D2s_v5": 0.165000, - "Standard_D32-16s_v3": 2.540000, - "Standard_D32-8s_v3": 2.540000, - "Standard_D32_v4": 2.688000, - "Standard_D32a_v4": 2.642000, - "Standard_D32ads_v5": 2.860000, - "Standard_D32as_v4": 2.642000, - "Standard_D32as_v5": 2.382000, - "Standard_D32d_v5": 3.120000, - "Standard_D32ds_v4": 3.164000, - "Standard_D32ds_v5": 3.120000, - "Standard_D32lds_v5": 2.704000, - "Standard_D32s_v3": 2.540000, - "Standard_D32s_v4": 2.688000, - "Standard_D4": 0.900000, - "Standard_D48_v3": 3.810000, - "Standard_D48_v4": 4.032000, - "Standard_D48ads_v5": 4.290000, - "Standard_D48d_v4": 4.746000, - "Standard_D48d_v5": 4.680000, - "Standard_D48ds_v4": 4.746000, - "Standard_D48ls_v5": 3.557000, - "Standard_D48s_v3": 3.810000, - "Standard_D48s_v5": 3.962000, - "Standard_D4_v2": 0.769000, - "Standard_D4_v3": 0.317500, - "Standard_D4_v4": 0.336000, - "Standard_D4_v5": 0.330000, - "Standard_D4a_v4": 0.330000, - "Standard_D4ads_v5": 0.358000, - "Standard_D4as_v4": 0.330000, - "Standard_D4d_v5": 0.390000, - "Standard_D4ds_v4": 0.396000, - "Standard_D4lds_v5": 0.338000, - "Standard_D4s_v4": 0.336000, - "Standard_D4s_v5": 0.330000, - "Standard_D5_v2": 1.539000, - "Standard_D64_v3": 5.080000, - "Standard_D64_v4": 5.376000, - "Standard_D64_v5": 5.283000, - "Standard_D64a_v4": 5.283000, - "Standard_D64ads_v5": 5.720000, - "Standard_D64as_v4": 5.283000, - "Standard_D64ds_v4": 6.328000, - "Standard_D64ds_v5": 6.240000, - "Standard_D64lds_v5": 5.408000, - "Standard_D64ls_v5": 4.742000, - "Standard_D64s_v4": 5.376000, - "Standard_D8_v3": 0.635000, - "Standard_D8_v5": 0.660000, - "Standard_D8ads_v5": 0.715000, - "Standard_D8as_v5": 0.595000, - "Standard_D8d_v5": 0.780000, - "Standard_D8ds_v4": 0.791000, - "Standard_D8ls_v5": 0.593000, - "Standard_D8s_v3": 0.635000, - "Standard_D8s_v5": 0.660000, - "Standard_D96a_v4": 7.925000, - "Standard_D96as_v5": 7.145000, - "Standard_D96d_v5": 9.360000, - "Standard_D96lds_v5": 8.112000, - "Standard_DS11": 0.291000, - "Standard_DS11_v2": 0.251000, - "Standard_DS11_v2_Promo": 0.000000, - "Standard_DS12-2_v2": 0.502000, - "Standard_DS12_v2": 0.502000, - "Standard_DS12_v2_Promo": 0.000000, - "Standard_DS13": 1.165000, - "Standard_DS13-2_v2": 1.005000, - "Standard_DS13-4_v2": 1.005000, - "Standard_DS13_v2": 1.005000, - "Standard_DS14": 2.331000, - "Standard_DS14-4_v2": 2.009000, - "Standard_DS14-8_v2": 2.009000, - "Standard_DS14_v2": 2.009000, - "Standard_DS15_v2": 2.512000, - "Standard_DS15i_v2": 2.512000, - "Standard_DS2_v2": 0.192000, - "Standard_DS2_v2_Promo": 0.000000, - "Standard_DS3_v2": 0.385000, - "Standard_DS3_v2_Promo": 0.000000, - "Standard_DS4": 0.900000, - "Standard_DS4_v2_Promo": 0.000000, - "Standard_DS5_v2": 1.539000, - "Standard_DS5_v2_Promo": 0.000000, - "Standard_E104i_v5": 12.492000, - "Standard_E104id_v5": 14.128000, - "Standard_E104ids_v5": 14.128000, - "Standard_E104is_v5": 12.492000, - "Standard_E112iads_v5": 13.854000, - "Standard_E112ias_v5": 12.092000, - "Standard_E112ibds_v5": 17.778000, - "Standard_E112ibs_v5": 16.016000, - "Standard_E16-4ads_v5": 1.799000, - "Standard_E16-4as_v5": 1.570000, - "Standard_E16-4ds_v4": 1.935000, - "Standard_E16-4ds_v5": 1.976000, - "Standard_E16-4s_v3": 1.680000, - "Standard_E16-4s_v4": 1.693000, - "Standard_E16-4s_v5": 1.747000, - "Standard_E16-8ads_v5": 1.799000, - "Standard_E16-8as_v4": 1.747000, - "Standard_E16-8ds_v4": 1.935000, - "Standard_E16-8ds_v5": 1.976000, - "Standard_E16-8s_v3": 1.680000, - "Standard_E16-8s_v5": 1.747000, - "Standard_E16_v3": 1.680000, - "Standard_E16_v4": 1.693000, - "Standard_E16as_v5": 1.570000, - "Standard_E16bs_v5": 2.080000, - "Standard_E16d_v4": 1.935000, - "Standard_E16ds_v4": 1.935000, - "Standard_E16ds_v5": 1.976000, - "Standard_E16s_v4": 1.693000, - "Standard_E20_v3": 2.100000, - "Standard_E20_v4": 2.117000, - "Standard_E20_v5": 2.184000, - "Standard_E20a_v4": 2.184000, - "Standard_E20ads_v5": 2.249000, - "Standard_E20as_v4": 2.184000, - "Standard_E20as_v5": 1.963000, - "Standard_E20d_v4": 2.419000, - "Standard_E20d_v5": 2.470000, - "Standard_E20ds_v4": 2.419000, - "Standard_E20s_v3": 2.100000, - "Standard_E20s_v4": 2.117000, - "Standard_E2_v3": 0.210000, - "Standard_E2_v4": 0.212000, - "Standard_E2_v5": 0.218000, - "Standard_E2a_v4": 0.218000, - "Standard_E2as_v4": 0.218000, - "Standard_E2bds_v5": 0.289000, - "Standard_E2bs_v5": 0.260000, - "Standard_E2d_v4": 0.242000, - "Standard_E2d_v5": 0.247000, - "Standard_E2ds_v4": 0.242000, - "Standard_E2ds_v5": 0.247000, - "Standard_E2s_v3": 0.210000, - "Standard_E2s_v4": 0.212000, - "Standard_E2s_v5": 0.218000, - "Standard_E32-16as_v4": 3.494000, - "Standard_E32-16ds_v4": 3.871000, - "Standard_E32-16s_v3": 3.360000, - "Standard_E32-16s_v4": 3.387000, - "Standard_E32-16s_v5": 3.494000, - "Standard_E32-8ads_v5": 3.598000, - "Standard_E32-8as_v5": 3.141000, - "Standard_E32-8ds_v4": 3.871000, - "Standard_E32-8ds_v5": 3.952000, - "Standard_E32-8s_v3": 3.360000, - "Standard_E32-8s_v4": 3.387000, - "Standard_E32-8s_v5": 3.494000, - "Standard_E32_v3": 3.360000, - "Standard_E32_v4": 3.387000, - "Standard_E32_v5": 3.494000, - "Standard_E32a_v4": 3.494000, - "Standard_E32as_v4": 3.494000, - "Standard_E32bds_v5": 4.618000, - "Standard_E32d_v4": 3.871000, - "Standard_E32d_v5": 3.952000, - "Standard_E32ds_v4": 3.871000, - "Standard_E32ds_v5": 3.952000, - "Standard_E32s_v3": 3.360000, - "Standard_E32s_v4": 3.387000, - "Standard_E32s_v5": 3.494000, - "Standard_E4-2as_v4": 0.437000, - "Standard_E4-2as_v5": 0.393000, - "Standard_E4-2ds_v4": 0.484000, - "Standard_E4-2ds_v5": 0.494000, - "Standard_E4-2s_v3": 0.420000, - "Standard_E4-2s_v4": 0.423000, - "Standard_E4-2s_v5": 0.437000, - "Standard_E48_v4": 5.080000, - "Standard_E48_v5": 5.242000, - "Standard_E48a_v4": 5.242000, - "Standard_E48ads_v5": 5.398000, - "Standard_E48as_v4": 5.242000, - "Standard_E48as_v5": 4.711000, - "Standard_E48bs_v5": 6.240000, - "Standard_E48d_v4": 5.806000, - "Standard_E48d_v5": 5.928000, - "Standard_E48ds_v4": 5.806000, - "Standard_E48ds_v5": 5.928000, - "Standard_E48s_v4": 5.080000, - "Standard_E48s_v5": 5.242000, - "Standard_E4_v3": 0.420000, - "Standard_E4ads_v5": 0.450000, - "Standard_E4as_v4": 0.437000, - "Standard_E4as_v5": 0.393000, - "Standard_E4d_v4": 0.484000, - "Standard_E4d_v5": 0.494000, - "Standard_E4s_v3": 0.420000, - "Standard_E4s_v5": 0.437000, - "Standard_E64-16ads_v5": 7.197000, - "Standard_E64-16as_v4": 6.989000, - "Standard_E64-16as_v5": 6.282000, - "Standard_E64-16ds_v4": 7.741000, - "Standard_E64-16ds_v5": 7.904000, - "Standard_E64-16s_v3": 6.096000, - "Standard_E64-16s_v4": 6.774000, - "Standard_E64-16s_v5": 6.989000, - "Standard_E64-32as_v4": 6.989000, - "Standard_E64-32as_v5": 6.282000, - "Standard_E64-32ds_v5": 7.904000, - "Standard_E64-32s_v3": 6.096000, - "Standard_E64_v3": 6.096000, - "Standard_E64_v4": 6.774000, - "Standard_E64a_v4": 6.989000, - "Standard_E64ads_v5": 7.197000, - "Standard_E64as_v4": 6.989000, - "Standard_E64bds_v5": 9.235000, - "Standard_E64bs_v5": 8.320000, - "Standard_E64d_v4": 7.741000, - "Standard_E64i_v3": 6.096000, - "Standard_E8-2ads_v5": 0.900000, - "Standard_E8-2as_v4": 0.874000, - "Standard_E8-2as_v5": 0.785000, - "Standard_E8-2ds_v4": 0.968000, - "Standard_E8-2s_v3": 0.840000, - "Standard_E8-2s_v4": 0.847000, - "Standard_E8-2s_v5": 0.874000, - "Standard_E8-4as_v4": 0.874000, - "Standard_E8-4as_v5": 0.785000, - "Standard_E8-4ds_v5": 0.988000, - "Standard_E8-4s_v3": 0.840000, - "Standard_E8-4s_v4": 0.847000, - "Standard_E80ids_v4": 9.677000, - "Standard_E8_v3": 0.840000, - "Standard_E8_v4": 0.847000, - "Standard_E8_v5": 0.874000, - "Standard_E8a_v4": 0.874000, - "Standard_E8ads_v5": 0.900000, - "Standard_E8as_v4": 0.874000, - "Standard_E8as_v5": 0.785000, - "Standard_E8bds_v5": 1.154000, - "Standard_E8bs_v5": 1.040000, - "Standard_E8d_v5": 0.988000, - "Standard_E8s_v4": 0.847000, - "Standard_E8s_v5": 0.874000, - "Standard_E96-24ads_v5": 10.795000, - "Standard_E96-24as_v5": 9.422000, - "Standard_E96-24ds_v5": 11.856000, - "Standard_E96-24s_v5": 10.483000, - "Standard_E96-48as_v4": 10.483000, - "Standard_E96-48as_v5": 9.422000, - "Standard_E96a_v4": 10.483000, - "Standard_E96as_v4": 10.483000, - "Standard_E96as_v5": 9.422000, - "Standard_E96bds_v5": 13.853000, - "Standard_E96bs_v5": 12.480000, - "Standard_E96d_v5": 11.856000, - "Standard_E96ds_v5": 11.856000, - "Standard_E96iads_v5": 11.875000, - "Standard_E96ias_v4": 10.483000, - "Standard_E96s_v5": 10.483000, - "Standard_F16": 1.337000, - "Standard_F16s": 1.337000, - "Standard_F16s_v2": 1.140000, - "Standard_F2": 0.167000, - "Standard_F2s": 0.167000, - "Standard_F2s_v2": 0.142500, - "Standard_F4": 0.334000, - "Standard_F4s": 0.334000, - "Standard_F4s_v2": 0.285000, - "Standard_F72s_v2": 5.130000, - "Standard_F8s": 0.669000, - "Standard_F8s_v2": 0.570000, - "Standard_L16as_v3": 2.132000, - "Standard_L16s_v3": 2.382000, - "Standard_L32as_v3": 4.264000, - "Standard_L64as_v3": 8.528000, - "Standard_L80as_v3": 10.660000, - "Standard_L80s_v3": 11.908000, - "Standard_L8s_v3": 1.191000, - "Standard_M128": 22.408000, - "Standard_M128-64ms": 44.836000, - "Standard_M128ms": 44.836000, - "Standard_M16-4ms": 5.163000, - "Standard_M16-8ms": 5.163000, - "Standard_M16ms": 5.163000, - "Standard_M32-16ms": 10.325000, - "Standard_M32-8ms": 10.325000, - "Standard_M32ms": 10.325000, - "Standard_M32s": 5.603000, - "Standard_M32ts": 4.548000, - "Standard_M64": 11.204000, - "Standard_M64-16ms": 17.367000, - "Standard_M64-32ms": 17.367000, - "Standard_M64ls": 9.097000, - "Standard_M64ms": 17.367000, - "Standard_M64s": 11.204000, - "Standard_M8-2ms": 2.581000, - "Standard_M8-4ms": 2.581000, - "Standard_ND96ams_A100_v4": 62.197000, - "Standard_ND96amsr_A100_v4": 62.197000, - } - // southcentralus - initialOnDemandPrices["southcentralus"] = map[string]float64{ - "Basic_A0": 0.018000, - "Basic_A1": 0.025000, - "Basic_A2": 0.079000, - "Basic_A3": 0.176000, - "Basic_A4": 0.352000, - "DCdsv3 Type1": 7.160000, - "DCsv2 Type 1": 1.014000, - "DCsv3 Type1": 6.083000, - "Dadsv5_Type1": 7.614000, - "Dasv4_Type1": 6.083000, - "Dasv4_Type2": 6.083000, - "Dasv5_Type1": 6.357000, - "Ddsv4_Type 1": 4.773000, - "Ddsv4_Type2": 5.668000, - "Ddsv5_Type1": 7.160000, - "Dsv3_Type3": 5.069000, - "Dsv3_Type4": 6.336000, - "Dsv4_Type1": 5.069000, - "Dsv4_Type2": 6.336000, - "Dsv5_Type1": 6.336000, - "Eadsv5_Type1": 8.300000, - "Easv4_Type1": 7.983000, - "Easv4_Type2": 7.983000, - "Easv5_Type1": 7.160000, - "Ebdsv5-Type1": 7.054000, - "Ebsv5-Type1": 6.294000, - "Edsv4_Type 1": 6.083000, - "Edsv4_Type2": 7.223000, - "Edsv5_Type1": 9.124000, - "Esv3_Type3": 4.972000, - "Esv3_Type4": 6.736000, - "Esv4_Type1": 5.322000, - "Esv4_Type2": 6.985000, - "Esv5_Type1": 7.983000, - "FXmds Type1": 5.892000, - "Fsv2 Type3": 5.161000, - "Fsv2_Type2": 4.039000, - "Fsv2_Type4": 5.610000, - "Lsv2_Type1": 8.237000, - "Lsv3_Type1": 9.187000, - "Mdsmv2MedMem _Type1": 35.231000, - "Mdsv2MedMem_Type1": 17.609000, - "Ms_Type1": 17.603000, - "Msm_Type1": 35.236000, - "Msmv2MedMem Type1": 34.675000, - "Msmv2_Type1": 130.880000, - "Msv2MedMem Type1": 17.053000, - "Msv2_Type1": 65.446000, - "NDamsrA100v4_Type1": 43.256000, - "NDasrA100v4_Type1": 35.893000, - "NVasv4_Type1": 8.612000, - "NVsv3_Type1": 6.019000, - "Standard_A0": 0.020000, - "Standard_A1": 0.060000, - "Standard_A1_v2": 0.043000, - "Standard_A2": 0.120000, - "Standard_A2_v2": 0.091000, - "Standard_A2m_v2": 0.124000, - "Standard_A3": 0.240000, - "Standard_A4": 0.480000, - "Standard_A4_v2": 0.191000, - "Standard_A4m_v2": 0.248000, - "Standard_A5": 0.220000, - "Standard_A6": 0.440000, - "Standard_A7": 0.880000, - "Standard_A8_v2": 0.400000, - "Standard_A8m_v2": 0.495000, - "Standard_B12ms": 0.599000, - "Standard_B16als_v2": 0.639000, - "Standard_B16as_v2": 0.722000, - "Standard_B16ls_v2": 0.781000, - "Standard_B16ms": 0.799000, - "Standard_B16pls_v2": 0.571000, - "Standard_B16ps_v2": 0.645000, - "Standard_B16s_v2": 0.872000, - "Standard_B1ls": 0.006240, - "Standard_B1ms": 0.025000, - "Standard_B1s": 0.012500, - "Standard_B20ms": 0.998000, - "Standard_B2als_v2": 0.054300, - "Standard_B2as_v2": 0.099400, - "Standard_B2ats_v2": 0.011300, - "Standard_B2ls_v2": 0.059100, - "Standard_B2ms": 0.099800, - "Standard_B2pls_v2": 0.049500, - "Standard_B2ps_v2": 0.080600, - "Standard_B2pts_v2": 0.010100, - "Standard_B2s": 0.049900, - "Standard_B2s_v2": 0.109000, - "Standard_B2ts_v2": 0.021700, - "Standard_B32als_v2": 1.426000, - "Standard_B32as_v2": 1.444000, - "Standard_B32ls_v2": 1.415000, - "Standard_B32s_v2": 1.745000, - "Standard_B4als_v2": 0.178000, - "Standard_B4as_v2": 0.180000, - "Standard_B4ls_v2": 0.195000, - "Standard_B4ms": 0.200000, - "Standard_B4pls_v2": 0.161000, - "Standard_B4ps_v2": 0.180000, - "Standard_B4s_v2": 0.218000, - "Standard_B8als_v2": 0.320000, - "Standard_B8as_v2": 0.361000, - "Standard_B8ls_v2": 0.354000, - "Standard_B8ms": 0.399000, - "Standard_B8pls_v2": 0.322000, - "Standard_B8ps_v2": 0.359000, - "Standard_B8s_v2": 0.436000, - "Standard_D1": 0.067000, - "Standard_D11": 0.173000, - "Standard_D11_v2": 0.166000, - "Standard_D11_v2_Promo": 0.166000, - "Standard_D12": 0.347000, - "Standard_D12_v2": 0.332000, - "Standard_D12_v2_Promo": 0.332000, - "Standard_D13": 0.694000, - "Standard_D13_v2": 0.665000, - "Standard_D13_v2_Promo": 0.665000, - "Standard_D14": 1.387000, - "Standard_D14_v2": 1.330000, - "Standard_D14_v2_Promo": 1.330000, - "Standard_D15_v2": 1.662000, - "Standard_D15i_v2": 1.662000, - "Standard_D16_v3": 0.880000, - "Standard_D16_v4": 0.922000, - "Standard_D16_v5": 0.922000, - "Standard_D16a_v4": 0.922000, - "Standard_D16ads_v5": 0.989000, - "Standard_D16as_v4": 0.922000, - "Standard_D16as_v5": 0.826000, - "Standard_D16d_v4": 1.175000, - "Standard_D16d_v5": 1.085000, - "Standard_D16ds_v4": 1.175000, - "Standard_D16ds_v5": 1.085000, - "Standard_D16lds_v5": 0.922000, - "Standard_D16ls_v5": 0.816000, - "Standard_D16pds_v5": 0.867000, - "Standard_D16plds_v5": 0.737000, - "Standard_D16pls_v5": 0.653000, - "Standard_D16ps_v5": 0.739000, - "Standard_D16s_v3": 0.880000, - "Standard_D16s_v4": 0.922000, - "Standard_D16s_v5": 0.922000, - "Standard_D1_v2": 0.063600, - "Standard_D2": 0.134000, - "Standard_D2_v2": 0.127000, - "Standard_D2_v2_Promo": 0.127000, - "Standard_D2_v3": 0.110000, - "Standard_D2_v4": 0.115000, - "Standard_D2_v5": 0.115000, - "Standard_D2a_v4": 0.115000, - "Standard_D2ads_v5": 0.124000, - "Standard_D2as_v4": 0.115000, - "Standard_D2as_v5": 0.103000, - "Standard_D2d_v4": 0.147000, - "Standard_D2d_v5": 0.136000, - "Standard_D2ds_v4": 0.147000, - "Standard_D2ds_v5": 0.136000, - "Standard_D2lds_v5": 0.115000, - "Standard_D2ls_v5": 0.102000, - "Standard_D2pds_v5": 0.108000, - "Standard_D2plds_v5": 0.092200, - "Standard_D2pls_v5": 0.081600, - "Standard_D2ps_v5": 0.092400, - "Standard_D2s_v3": 0.110000, - "Standard_D2s_v4": 0.115000, - "Standard_D2s_v5": 0.115000, - "Standard_D3": 0.268000, - "Standard_D32-16s_v3": 1.760000, - "Standard_D32-8s_v3": 1.760000, - "Standard_D32_v3": 1.760000, - "Standard_D32_v4": 1.843000, - "Standard_D32_v5": 1.843000, - "Standard_D32a_v4": 1.843000, - "Standard_D32ads_v5": 1.978000, - "Standard_D32as_v4": 1.843000, - "Standard_D32as_v5": 1.651000, - "Standard_D32d_v4": 2.350000, - "Standard_D32d_v5": 2.170000, - "Standard_D32ds_v4": 2.350000, - "Standard_D32ds_v5": 2.170000, - "Standard_D32lds_v5": 1.843000, - "Standard_D32ls_v5": 1.632000, - "Standard_D32pds_v5": 1.734000, - "Standard_D32plds_v5": 1.475000, - "Standard_D32pls_v5": 1.306000, - "Standard_D32ps_v5": 1.478000, - "Standard_D32s_v3": 1.760000, - "Standard_D32s_v4": 1.843000, - "Standard_D32s_v5": 1.843000, - "Standard_D3_v2": 0.254000, - "Standard_D3_v2_Promo": 0.254000, - "Standard_D4": 0.536000, - "Standard_D48_v3": 2.640000, - "Standard_D48_v4": 2.765000, - "Standard_D48_v5": 2.765000, - "Standard_D48a_v4": 2.765000, - "Standard_D48ads_v5": 2.966000, - "Standard_D48as_v4": 2.765000, - "Standard_D48as_v5": 2.477000, - "Standard_D48d_v4": 3.526000, - "Standard_D48d_v5": 3.254000, - "Standard_D48ds_v4": 3.526000, - "Standard_D48ds_v5": 3.254000, - "Standard_D48lds_v5": 2.765000, - "Standard_D48ls_v5": 2.448000, - "Standard_D48pds_v5": 2.602000, - "Standard_D48plds_v5": 2.212000, - "Standard_D48pls_v5": 1.958000, - "Standard_D48ps_v5": 2.218000, - "Standard_D48s_v3": 2.640000, - "Standard_D48s_v4": 2.765000, - "Standard_D48s_v5": 2.765000, - "Standard_D4_v2": 0.509000, - "Standard_D4_v2_Promo": 0.509000, - "Standard_D4_v3": 0.220000, - "Standard_D4_v4": 0.230000, - "Standard_D4_v5": 0.230000, - "Standard_D4a_v4": 0.230000, - "Standard_D4ads_v5": 0.247000, - "Standard_D4as_v4": 0.230000, - "Standard_D4as_v5": 0.206000, - "Standard_D4d_v4": 0.294000, - "Standard_D4d_v5": 0.271000, - "Standard_D4ds_v4": 0.294000, - "Standard_D4ds_v5": 0.271000, - "Standard_D4lds_v5": 0.230000, - "Standard_D4ls_v5": 0.204000, - "Standard_D4pds_v5": 0.217000, - "Standard_D4plds_v5": 0.184000, - "Standard_D4pls_v5": 0.163000, - "Standard_D4ps_v5": 0.185000, - "Standard_D4s_v3": 0.220000, - "Standard_D4s_v4": 0.230000, - "Standard_D4s_v5": 0.230000, - "Standard_D5_v2": 1.017000, - "Standard_D5_v2_Promo": 1.017000, - "Standard_D64-16s_v3": 3.520000, - "Standard_D64-32s_v3": 3.520000, - "Standard_D64_v3": 3.520000, - "Standard_D64_v4": 3.686000, - "Standard_D64_v5": 3.686000, - "Standard_D64a_v4": 3.686000, - "Standard_D64ads_v5": 3.955000, - "Standard_D64as_v4": 3.686000, - "Standard_D64as_v5": 3.302000, - "Standard_D64d_v4": 4.701000, - "Standard_D64d_v5": 4.339000, - "Standard_D64ds_v4": 4.701000, - "Standard_D64ds_v5": 4.339000, - "Standard_D64lds_v5": 3.686000, - "Standard_D64ls_v5": 3.264000, - "Standard_D64pds_v5": 3.469000, - "Standard_D64plds_v5": 2.949000, - "Standard_D64pls_v5": 2.611000, - "Standard_D64ps_v5": 2.957000, - "Standard_D64s_v3": 3.520000, - "Standard_D64s_v4": 3.686000, - "Standard_D64s_v5": 3.686000, - "Standard_D8_v3": 0.440000, - "Standard_D8_v4": 0.461000, - "Standard_D8_v5": 0.461000, - "Standard_D8a_v4": 0.461000, - "Standard_D8ads_v5": 0.494000, - "Standard_D8as_v4": 0.461000, - "Standard_D8as_v5": 0.413000, - "Standard_D8d_v4": 0.588000, - "Standard_D8d_v5": 0.542000, - "Standard_D8ds_v4": 0.588000, - "Standard_D8ds_v5": 0.542000, - "Standard_D8lds_v5": 0.461000, - "Standard_D8ls_v5": 0.408000, - "Standard_D8pds_v5": 0.434000, - "Standard_D8plds_v5": 0.369000, - "Standard_D8pls_v5": 0.326000, - "Standard_D8ps_v5": 0.370000, - "Standard_D8s_v3": 0.440000, - "Standard_D8s_v4": 0.461000, - "Standard_D8s_v5": 0.461000, - "Standard_D96_v5": 5.530000, - "Standard_D96a_v4": 5.530000, - "Standard_D96ads_v5": 5.933000, - "Standard_D96as_v4": 5.530000, - "Standard_D96as_v5": 4.954000, - "Standard_D96d_v5": 6.509000, - "Standard_D96ds_v5": 6.509000, - "Standard_D96lds_v5": 5.530000, - "Standard_D96ls_v5": 4.896000, - "Standard_D96s_v5": 5.530000, - "Standard_DC16ds_v3": 2.170000, - "Standard_DC16s_v3": 1.843000, - "Standard_DC1ds_v3": 0.136000, - "Standard_DC1s_v2": 0.115000, - "Standard_DC1s_v3": 0.115000, - "Standard_DC24ds_v3": 3.254000, - "Standard_DC24s_v3": 2.765000, - "Standard_DC2ds_v3": 0.271000, - "Standard_DC2s_v2": 0.230000, - "Standard_DC2s_v3": 0.230000, - "Standard_DC32ds_v3": 4.339000, - "Standard_DC32s_v3": 3.686000, - "Standard_DC48ds_v3": 6.509000, - "Standard_DC48s_v3": 5.530000, - "Standard_DC4ds_v3": 0.542000, - "Standard_DC4s_v2": 0.461000, - "Standard_DC4s_v3": 0.461000, - "Standard_DC8_v2": 0.922000, - "Standard_DC8ds_v3": 1.085000, - "Standard_DC8s_v3": 0.922000, - "Standard_DS1": 0.067000, - "Standard_DS11": 0.173000, - "Standard_DS11-1_v2": 0.166000, - "Standard_DS11_v2": 0.166000, - "Standard_DS11_v2_Promo": 0.166000, - "Standard_DS12": 0.347000, - "Standard_DS12-1_v2": 0.332000, - "Standard_DS12-2_v2": 0.332000, - "Standard_DS12_v2": 0.332000, - "Standard_DS12_v2_Promo": 0.332000, - "Standard_DS13": 0.694000, - "Standard_DS13-2_v2": 0.665000, - "Standard_DS13-4_v2": 0.665000, - "Standard_DS13_v2": 0.665000, - "Standard_DS13_v2_Promo": 0.665000, - "Standard_DS14": 1.387000, - "Standard_DS14-4_v2": 1.330000, - "Standard_DS14-8_v2": 1.330000, - "Standard_DS14_v2": 1.330000, - "Standard_DS14_v2_Promo": 1.330000, - "Standard_DS15_v2": 1.662000, - "Standard_DS15i_v2": 1.662000, - "Standard_DS1_v2": 0.063600, - "Standard_DS2": 0.134000, - "Standard_DS2_v2": 0.127000, - "Standard_DS2_v2_Promo": 0.127000, - "Standard_DS3": 0.268000, - "Standard_DS3_v2": 0.254000, - "Standard_DS3_v2_Promo": 0.254000, - "Standard_DS4": 0.536000, - "Standard_DS4_v2": 0.509000, - "Standard_DS4_v2_Promo": 0.509000, - "Standard_DS5_v2": 1.017000, - "Standard_DS5_v2_Promo": 1.017000, - "Standard_E104i_v5": 8.649000, - "Standard_E104id_v5": 9.884000, - "Standard_E104ids_v5": 9.884000, - "Standard_E104is_v5": 8.649000, - "Standard_E112iads_v5": 9.684000, - "Standard_E112ias_v5": 8.353000, - "Standard_E112ibds_v5": 12.345000, - "Standard_E112ibs_v5": 11.014000, - "Standard_E16-4ads_v5": 1.258000, - "Standard_E16-4as_v4": 1.210000, - "Standard_E16-4as_v5": 1.085000, - "Standard_E16-4ds_v4": 1.498000, - "Standard_E16-4ds_v5": 1.382000, - "Standard_E16-4s_v3": 1.166000, - "Standard_E16-4s_v4": 1.210000, - "Standard_E16-4s_v5": 1.210000, - "Standard_E16-8ads_v5": 1.258000, - "Standard_E16-8as_v4": 1.210000, - "Standard_E16-8as_v5": 1.085000, - "Standard_E16-8ds_v4": 1.498000, - "Standard_E16-8ds_v5": 1.382000, - "Standard_E16-8s_v3": 1.166000, - "Standard_E16-8s_v4": 1.210000, - "Standard_E16-8s_v5": 1.210000, - "Standard_E16_v3": 1.166000, - "Standard_E16_v4": 1.210000, - "Standard_E16_v5": 1.210000, - "Standard_E16a_v4": 1.210000, - "Standard_E16ads_v5": 1.258000, - "Standard_E16as_v4": 1.210000, - "Standard_E16as_v5": 1.085000, - "Standard_E16bds_v5": 1.603000, - "Standard_E16bs_v5": 1.430000, - "Standard_E16d_v4": 1.498000, - "Standard_E16d_v5": 1.382000, - "Standard_E16ds_v4": 1.498000, - "Standard_E16ds_v5": 1.382000, - "Standard_E16pds_v5": 1.106000, - "Standard_E16ps_v5": 0.968000, - "Standard_E16s_v3": 1.166000, - "Standard_E16s_v4": 1.210000, - "Standard_E16s_v5": 1.210000, - "Standard_E20_v3": 1.460000, - "Standard_E20_v4": 1.512000, - "Standard_E20_v5": 1.512000, - "Standard_E20a_v4": 1.512000, - "Standard_E20ads_v5": 1.572000, - "Standard_E20as_v4": 1.512000, - "Standard_E20as_v5": 1.356000, - "Standard_E20d_v4": 1.872000, - "Standard_E20d_v5": 1.728000, - "Standard_E20ds_v4": 1.872000, - "Standard_E20ds_v5": 1.728000, - "Standard_E20pds_v5": 1.382000, - "Standard_E20ps_v5": 1.210000, - "Standard_E20s_v3": 1.460000, - "Standard_E20s_v4": 1.512000, - "Standard_E20s_v5": 1.512000, - "Standard_E2_v3": 0.146000, - "Standard_E2_v4": 0.151000, - "Standard_E2_v5": 0.151000, - "Standard_E2a_v4": 0.151000, - "Standard_E2ads_v5": 0.157000, - "Standard_E2as_v4": 0.151000, - "Standard_E2as_v5": 0.136000, - "Standard_E2bds_v5": 0.200000, - "Standard_E2bs_v5": 0.179000, - "Standard_E2d_v4": 0.187000, - "Standard_E2d_v5": 0.173000, - "Standard_E2ds_v4": 0.187000, - "Standard_E2ds_v5": 0.173000, - "Standard_E2pds_v5": 0.138000, - "Standard_E2ps_v5": 0.121000, - "Standard_E2s_v3": 0.146000, - "Standard_E2s_v4": 0.151000, - "Standard_E2s_v5": 0.151000, - "Standard_E32-16ads_v5": 2.515000, - "Standard_E32-16as_v4": 2.419000, - "Standard_E32-16as_v5": 2.170000, - "Standard_E32-16ds_v4": 2.995000, - "Standard_E32-16ds_v5": 2.765000, - "Standard_E32-16s_v3": 2.333000, - "Standard_E32-16s_v4": 2.419000, - "Standard_E32-16s_v5": 2.419000, - "Standard_E32-8ads_v5": 2.515000, - "Standard_E32-8as_v4": 2.419000, - "Standard_E32-8as_v5": 2.170000, - "Standard_E32-8ds_v4": 2.995000, - "Standard_E32-8ds_v5": 2.765000, - "Standard_E32-8s_v3": 2.333000, - "Standard_E32-8s_v4": 2.419000, - "Standard_E32-8s_v5": 2.419000, - "Standard_E32_v3": 2.333000, - "Standard_E32_v4": 2.419000, - "Standard_E32_v5": 2.419000, - "Standard_E32a_v4": 2.419000, - "Standard_E32ads_v5": 2.515000, - "Standard_E32as_v4": 2.419000, - "Standard_E32as_v5": 2.170000, - "Standard_E32bds_v5": 3.206000, - "Standard_E32bs_v5": 2.861000, - "Standard_E32d_v4": 2.995000, - "Standard_E32d_v5": 2.765000, - "Standard_E32ds_v4": 2.995000, - "Standard_E32ds_v5": 2.765000, - "Standard_E32pds_v5": 2.212000, - "Standard_E32ps_v5": 1.935000, - "Standard_E32s_v3": 2.333000, - "Standard_E32s_v4": 2.419000, - "Standard_E32s_v5": 2.419000, - "Standard_E4-2ads_v5": 0.314000, - "Standard_E4-2as_v4": 0.302000, - "Standard_E4-2as_v5": 0.271000, - "Standard_E4-2ds_v4": 0.374000, - "Standard_E4-2ds_v5": 0.346000, - "Standard_E4-2s_v3": 0.292000, - "Standard_E4-2s_v4": 0.302000, - "Standard_E4-2s_v5": 0.302000, - "Standard_E48_v3": 3.499000, - "Standard_E48_v4": 3.629000, - "Standard_E48_v5": 3.629000, - "Standard_E48a_v4": 3.629000, - "Standard_E48ads_v5": 3.773000, - "Standard_E48as_v4": 3.629000, - "Standard_E48as_v5": 3.254000, - "Standard_E48bds_v5": 4.810000, - "Standard_E48bs_v5": 4.291000, - "Standard_E48d_v4": 4.493000, - "Standard_E48d_v5": 4.147000, - "Standard_E48ds_v4": 4.493000, - "Standard_E48ds_v5": 4.147000, - "Standard_E48s_v3": 3.499000, - "Standard_E48s_v4": 3.629000, - "Standard_E48s_v5": 3.629000, - "Standard_E4_v3": 0.292000, - "Standard_E4_v4": 0.302000, - "Standard_E4_v5": 0.302000, - "Standard_E4a_v4": 0.302000, - "Standard_E4ads_v5": 0.314000, - "Standard_E4as_v4": 0.302000, - "Standard_E4as_v5": 0.271000, - "Standard_E4bds_v5": 0.401000, - "Standard_E4bs_v5": 0.358000, - "Standard_E4d_v4": 0.374000, - "Standard_E4d_v5": 0.346000, - "Standard_E4ds_v4": 0.374000, - "Standard_E4ds_v5": 0.346000, - "Standard_E4pds_v5": 0.276000, - "Standard_E4ps_v5": 0.242000, - "Standard_E4s_v3": 0.292000, - "Standard_E4s_v4": 0.302000, - "Standard_E4s_v5": 0.302000, - "Standard_E64-16ads_v5": 5.030000, - "Standard_E64-16as_v4": 4.838000, - "Standard_E64-16as_v5": 4.339000, - "Standard_E64-16ds_v4": 5.990000, - "Standard_E64-16ds_v5": 5.530000, - "Standard_E64-16s_v3": 4.199000, - "Standard_E64-16s_v4": 4.838000, - "Standard_E64-16s_v5": 4.838000, - "Standard_E64-32ads_v5": 5.030000, - "Standard_E64-32as_v4": 4.838000, - "Standard_E64-32as_v5": 4.339000, - "Standard_E64-32ds_v4": 5.990000, - "Standard_E64-32ds_v5": 5.530000, - "Standard_E64-32s_v3": 4.199000, - "Standard_E64-32s_v4": 4.838000, - "Standard_E64-32s_v5": 4.838000, - "Standard_E64_v3": 4.199000, - "Standard_E64_v4": 4.838000, - "Standard_E64_v5": 4.838000, - "Standard_E64a_v4": 4.838000, - "Standard_E64ads_v5": 5.030000, - "Standard_E64as_v4": 4.838000, - "Standard_E64as_v5": 4.339000, - "Standard_E64bds_v5": 6.413000, - "Standard_E64bs_v5": 5.722000, - "Standard_E64d_v4": 5.990000, - "Standard_E64d_v5": 5.530000, - "Standard_E64ds_v4": 5.990000, - "Standard_E64ds_v5": 5.530000, - "Standard_E64i_v3": 4.199000, - "Standard_E64is_v3": 4.199000, - "Standard_E64s_v3": 4.199000, - "Standard_E64s_v4": 4.838000, - "Standard_E64s_v5": 4.838000, - "Standard_E8-2ads_v5": 0.629000, - "Standard_E8-2as_v4": 0.605000, - "Standard_E8-2as_v5": 0.542000, - "Standard_E8-2ds_v4": 0.749000, - "Standard_E8-2ds_v5": 0.691000, - "Standard_E8-2s_v3": 0.583000, - "Standard_E8-2s_v4": 0.605000, - "Standard_E8-2s_v5": 0.605000, - "Standard_E8-4ads_v5": 0.629000, - "Standard_E8-4as_v4": 0.605000, - "Standard_E8-4as_v5": 0.542000, - "Standard_E8-4ds_v4": 0.749000, - "Standard_E8-4ds_v5": 0.691000, - "Standard_E8-4s_v3": 0.583000, - "Standard_E8-4s_v4": 0.605000, - "Standard_E8-4s_v5": 0.605000, - "Standard_E80ids_v4": 7.488000, - "Standard_E80is_v4": 6.048000, - "Standard_E8_v3": 0.583000, - "Standard_E8_v4": 0.605000, - "Standard_E8_v5": 0.605000, - "Standard_E8a_v4": 0.605000, - "Standard_E8ads_v5": 0.629000, - "Standard_E8as_v4": 0.605000, - "Standard_E8as_v5": 0.542000, - "Standard_E8bds_v5": 0.802000, - "Standard_E8bs_v5": 0.715000, - "Standard_E8d_v4": 0.749000, - "Standard_E8d_v5": 0.691000, - "Standard_E8ds_v4": 0.749000, - "Standard_E8ds_v5": 0.691000, - "Standard_E8pds_v5": 0.553000, - "Standard_E8ps_v5": 0.484000, - "Standard_E8s_v3": 0.583000, - "Standard_E8s_v4": 0.605000, - "Standard_E8s_v5": 0.605000, - "Standard_E96-24ads_v5": 7.546000, - "Standard_E96-24as_v4": 7.258000, - "Standard_E96-24as_v5": 6.509000, - "Standard_E96-24ds_v5": 8.294000, - "Standard_E96-24s_v5": 7.258000, - "Standard_E96-48ads_v5": 7.546000, - "Standard_E96-48as_v4": 7.258000, - "Standard_E96-48as_v5": 6.509000, - "Standard_E96-48ds_v5": 8.294000, - "Standard_E96-48s_v5": 7.258000, - "Standard_E96_v5": 7.258000, - "Standard_E96a_v4": 7.258000, - "Standard_E96ads_v5": 7.546000, - "Standard_E96as_v4": 7.258000, - "Standard_E96as_v5": 6.509000, - "Standard_E96bds_v5": 9.619000, - "Standard_E96bs_v5": 8.582000, - "Standard_E96d_v5": 8.294000, - "Standard_E96ds_v5": 8.294000, - "Standard_E96iads_v5": 8.300000, - "Standard_E96ias_v5": 7.160000, - "Standard_E96s_v5": 7.258000, - "Standard_F1": 0.054700, - "Standard_F16": 0.875000, - "Standard_F16s": 0.875000, - "Standard_F16s_v2": 0.816000, - "Standard_F1s": 0.054700, - "Standard_F2": 0.109000, - "Standard_F2s": 0.109000, - "Standard_F2s_v2": 0.102000, - "Standard_F32s_v2": 1.632000, - "Standard_F4": 0.219000, - "Standard_F48s_v2": 2.448000, - "Standard_F4s": 0.219000, - "Standard_F4s_v2": 0.204000, - "Standard_F64s_v2": 3.264000, - "Standard_F72s_v2": 3.672000, - "Standard_F8": 0.438000, - "Standard_F8s": 0.438000, - "Standard_F8s_v2": 0.408000, - "Standard_FX12mds": 1.339000, - "Standard_FX24mds": 2.678000, - "Standard_FX36mds": 4.018000, - "Standard_FX48mds": 5.357000, - "Standard_FX4mds": 0.446000, - "Standard_H16": 1.749000, - "Standard_H16m": 2.343000, - "Standard_H16mr": 2.577000, - "Standard_H16r": 1.924000, - "Standard_H8": 0.875000, - "Standard_H8m": 1.172000, - "Standard_HB120-16rs_v2": 3.960000, - "Standard_HB120-16rs_v3": 3.960000, - "Standard_HB120-32rs_v2": 3.960000, - "Standard_HB120-32rs_v3": 3.960000, - "Standard_HB120-64rs_v2": 3.960000, - "Standard_HB120-64rs_v3": 3.960000, - "Standard_HB120-96rs_v2": 3.960000, - "Standard_HB120-96rs_v3": 3.960000, - "Standard_HB120rs_v2": 3.960000, - "Standard_HB120rs_v3": 3.960000, - "Standard_HB176-144rs_v4": 8.640000, - "Standard_HB176-24rs_v4": 8.640000, - "Standard_HB176-48rs_v4": 8.640000, - "Standard_HB176-96rs_v4": 8.640000, - "Standard_HB176rs_v4": 8.640000, - "Standard_HB60-15rs": 2.508000, - "Standard_HB60-30rs": 2.508000, - "Standard_HB60-45rs": 2.508000, - "Standard_HB60rs": 2.508000, - "Standard_HC44-16rs": 3.484000, - "Standard_HC44-32rs": 3.484000, - "Standard_HC44rs": 3.484000, - "Standard_HX176-144rs": 10.368000, - "Standard_HX176-24rs": 10.368000, - "Standard_HX176-48rs": 10.368000, - "Standard_HX176-96rs": 10.368000, - "Standard_HX176rs": 10.368000, - "Standard_L16s_v2": 1.498000, - "Standard_L16s_v3": 1.670000, - "Standard_L32s_v2": 2.995000, - "Standard_L32s_v3": 3.341000, - "Standard_L48s_v2": 4.493000, - "Standard_L48s_v3": 5.011000, - "Standard_L64s_v2": 5.990000, - "Standard_L64s_v3": 6.682000, - "Standard_L80s_v2": 7.488000, - "Standard_L80s_v3": 8.352000, - "Standard_L88is_v2": 8.237000, - "Standard_L8s_v2": 0.749000, - "Standard_L8s_v3": 0.835000, - "Standard_L96s_v2": 8.986000, - "Standard_M128": 16.006000, - "Standard_M128-32ms": 32.026000, - "Standard_M128-64ms": 32.026000, - "Standard_M128dms_v2": 32.028000, - "Standard_M128ds_v2": 16.008000, - "Standard_M128m": 32.026000, - "Standard_M128ms": 32.026000, - "Standard_M128ms_v2": 31.523000, - "Standard_M128s": 16.006000, - "Standard_M128s_v2": 15.503000, - "Standard_M16-4ms": 3.688000, - "Standard_M16-8ms": 3.688000, - "Standard_M16ms": 3.688000, - "Standard_M16s": 2.864000, - "Standard_M192idms_v2": 38.477000, - "Standard_M192ids_v2": 19.238000, - "Standard_M192ims_v2": 37.972000, - "Standard_M192is_v2": 18.733000, - "Standard_M208-104ms_v2": 53.544000, - "Standard_M208-104s_v2": 26.772000, - "Standard_M208-52ms_v2": 53.544000, - "Standard_M208-52s_v2": 26.772000, - "Standard_M208ms_v2": 53.544000, - "Standard_M208s_v2": 26.772000, - "Standard_M32-16ms": 7.375000, - "Standard_M32-8ms": 7.375000, - "Standard_M32dms_v2": 7.375000, - "Standard_M32ls": 3.448000, - "Standard_M32ms": 7.375000, - "Standard_M32ms_v2": 7.249000, - "Standard_M32s": 4.002000, - "Standard_M32ts": 3.248000, - "Standard_M416-104ms_v2": 118.980000, - "Standard_M416-104s_v2": 59.496000, - "Standard_M416-208ms_v2": 118.980000, - "Standard_M416-208s_v2": 59.496000, - "Standard_M416is_v2": 59.496000, - "Standard_M416ms_v2": 118.980000, - "Standard_M416s_8_v2": 79.330000, - "Standard_M416s_v2": 59.496000, - "Standard_M64": 8.003000, - "Standard_M64-16ms": 12.405000, - "Standard_M64-32ms": 12.405000, - "Standard_M64dms_v2": 12.408000, - "Standard_M64ds_v2": 8.003000, - "Standard_M64ls": 6.498000, - "Standard_M64m": 12.405000, - "Standard_M64ms": 12.405000, - "Standard_M64ms_v2": 12.156000, - "Standard_M64s": 8.003000, - "Standard_M64s_v2": 7.750000, - "Standard_M8-2ms": 1.844000, - "Standard_M8-4ms": 1.844000, - "Standard_M8ms": 1.844000, - "Standard_NC12": 2.160000, - "Standard_NC12s_v2": 4.968000, - "Standard_NC12s_v3": 6.732000, - "Standard_NC16ads_A10_v4": 2.640000, - "Standard_NC16as_T4_v3": 1.445000, - "Standard_NC24": 4.320000, - "Standard_NC24ads_A100_v4": 4.408000, - "Standard_NC24r": 4.752000, - "Standard_NC24rs_v2": 10.930000, - "Standard_NC24rs_v3": 14.810400, - "Standard_NC24s_v2": 9.936000, - "Standard_NC24s_v3": 13.464000, - "Standard_NC32ads_A10_v4": 5.280000, - "Standard_NC48ads_A100_v4": 8.815000, - "Standard_NC4as_T4_v3": 0.631000, - "Standard_NC6": 1.080000, - "Standard_NC64as_T4_v3": 5.222000, - "Standard_NC6s_v2": 2.484000, - "Standard_NC6s_v3": 3.366000, - "Standard_NC8ads_A10_v4": 1.320000, - "Standard_NC8as_T4_v3": 0.902000, - "Standard_NC96ads_A100_v4": 17.630000, - "Standard_ND12s": 4.968000, - "Standard_ND24rs": 10.930000, - "Standard_ND24s": 9.936000, - "Standard_ND40rs_v2": 26.438000, - "Standard_ND40s_v2": 14.688000, - "Standard_ND6s": 2.484000, - "Standard_ND96ams_A100_v4": 39.324000, - "Standard_ND96amsr_A100_v4": 39.324000, - "Standard_ND96asr_A100_v4": 32.630000, - "Standard_ND96asr_v4": 32.630000, - "Standard_NP10s": 1.980000, - "Standard_NP20s": 3.960000, - "Standard_NP40s": 7.920000, - "Standard_NV12": 2.300000, - "Standard_NV12ads_A10_v5": 1.090000, - "Standard_NV12s_v2": 1.368000, - "Standard_NV12s_v3": 1.368000, - "Standard_NV16as_v4": 1.118000, - "Standard_NV18ads_A10_v5": 1.920000, - "Standard_NV24": 4.599000, - "Standard_NV24s_v2": 2.736000, - "Standard_NV24s_v3": 2.736000, - "Standard_NV32as_v4": 2.237000, - "Standard_NV36adms_A10_v5": 5.424000, - "Standard_NV36ads_A10_v5": 3.840000, - "Standard_NV48s_v3": 5.472000, - "Standard_NV4as_v4": 0.280000, - "Standard_NV6": 1.150000, - "Standard_NV6ads_A10_v5": 0.545000, - "Standard_NV6s_v2": 0.684000, - "Standard_NV72ads_A10_v5": 7.824000, - "Standard_NV8as_v4": 0.559000, - "Standard_PB12s": 1.826000, - "Standard_PB24s": 3.652000, - "Standard_PB6s": 0.913000, - } - // southeastasia - initialOnDemandPrices["southeastasia"] = map[string]float64{ - "Basic_A1": 0.030000, - "Basic_A2": 0.095000, - "DCdsv3 Type1": 7.445000, - "DCsv2 Type 1": 1.056000, - "Dasv4_Type2": 6.600000, - "Dasv5_Type1": 6.653000, - "Dsv3_Type4": 6.590000, - "Dsv4_Type2": 6.336000, - "Eadsv5_Type1": 8.395000, - "Easv4_Type1": 8.026000, - "Easv4_Type2": 8.026000, - "Easv5_Type1": 7.181000, - "Edsv4_Type 1": 6.125000, - "Edsv4_Type2": 7.273000, - "Edsv5_Type1": 9.187000, - "Esv3_Type3": 5.192000, - "Esv4_Type2": 7.022000, - "Esv5_Type1": 8.026000, - "Fsv2 Type3": 4.528000, - "Fsv2_Type2": 3.881000, - "Lsv3_Type1": 9.196000, - "Mdsv2MedMem_Type1": 21.277000, - "Ms_Type1": 21.270000, - "Msmv2MedMem Type1": 41.899000, - "Msmv2_Type1": 141.780000, - "Msv2MedMem Type1": 20.606000, - "NVsv3_Type1": 6.972000, - "Standard_A2": 0.120000, - "Standard_A5": 0.270000, - "Standard_A7": 1.080000, - "Standard_A8_v2": 0.417000, - "Standard_A8m_v2": 0.589000, - "Standard_B12ms": 0.634000, - "Standard_B16als_v2": 0.742000, - "Standard_B16as_v2": 0.829000, - "Standard_B16ls_v2": 0.822000, - "Standard_B16pls_v2": 0.674000, - "Standard_B16ps_v2": 0.678000, - "Standard_B16s_v2": 0.845000, - "Standard_B1ls": 0.006600, - "Standard_B20ms": 1.056000, - "Standard_B2pts_v2": 0.019800, - "Standard_B2s": 0.052800, - "Standard_B2ts_v2": 0.013200, - "Standard_B32als_v2": 1.485000, - "Standard_B32as_v2": 1.510000, - "Standard_B32ls_v2": 1.643000, - "Standard_B32s_v2": 1.690000, - "Standard_B4als_v2": 0.167000, - "Standard_B4as_v2": 0.207000, - "Standard_B4ls_v2": 0.206000, - "Standard_B4ms": 0.211000, - "Standard_B4s_v2": 0.211000, - "Standard_B8as_v2": 0.414000, - "Standard_B8ls_v2": 0.411000, - "Standard_B8ms": 0.422000, - "Standard_B8pls_v2": 0.300000, - "Standard_B8ps_v2": 0.376000, - "Standard_B8s_v2": 0.459000, - "Standard_D12": 0.420000, - "Standard_D12_v2_Promo": 0.382000, - "Standard_D13_v2": 0.765000, - "Standard_D13_v2_Promo": 0.765000, - "Standard_D14_v2": 1.530000, - "Standard_D14_v2_Promo": 1.530000, - "Standard_D15i_v2": 1.912000, - "Standard_D16_v5": 0.960000, - "Standard_D16a_v4": 0.960000, - "Standard_D16ads_v5": 1.032000, - "Standard_D16as_v4": 0.960000, - "Standard_D16as_v5": 0.864000, - "Standard_D16d_v5": 1.128000, - "Standard_D16ds_v4": 1.128000, - "Standard_D16ds_v5": 1.128000, - "Standard_D16ls_v5": 0.784000, - "Standard_D16pds_v5": 0.904000, - "Standard_D16plds_v5": 0.720000, - "Standard_D16s_v4": 0.960000, - "Standard_D1_v2": 0.078900, - "Standard_D2_v2_Promo": 0.158000, - "Standard_D2_v3": 0.125000, - "Standard_D2as_v4": 0.120000, - "Standard_D2as_v5": 0.108000, - "Standard_D2d_v4": 0.141000, - "Standard_D2d_v5": 0.141000, - "Standard_D2ds_v4": 0.141000, - "Standard_D2plds_v5": 0.090000, - "Standard_D2s_v5": 0.120000, - "Standard_D32-16s_v3": 2.000000, - "Standard_D32-8s_v3": 2.000000, - "Standard_D32_v4": 1.920000, - "Standard_D32_v5": 1.920000, - "Standard_D32ads_v5": 2.064000, - "Standard_D32lds_v5": 1.792000, - "Standard_D32ls_v5": 1.568000, - "Standard_D32pds_v5": 1.808000, - "Standard_D32s_v3": 2.000000, - "Standard_D32s_v5": 1.920000, - "Standard_D48_v3": 3.000000, - "Standard_D48_v4": 2.880000, - "Standard_D48ads_v5": 3.096000, - "Standard_D48d_v4": 3.384000, - "Standard_D48ds_v4": 3.384000, - "Standard_D48ls_v5": 2.352000, - "Standard_D48plds_v5": 2.160000, - "Standard_D48s_v3": 3.000000, - "Standard_D48s_v4": 2.880000, - "Standard_D4_v3": 0.250000, - "Standard_D4_v4": 0.240000, - "Standard_D4a_v4": 0.240000, - "Standard_D4ads_v5": 0.258000, - "Standard_D4ds_v4": 0.282000, - "Standard_D4ls_v5": 0.196000, - "Standard_D4pds_v5": 0.226000, - "Standard_D4plds_v5": 0.180000, - "Standard_D4ps_v5": 0.192000, - "Standard_D4s_v3": 0.250000, - "Standard_D64_v5": 3.840000, - "Standard_D64d_v5": 4.512000, - "Standard_D64ds_v4": 4.512000, - "Standard_D64ls_v5": 3.136000, - "Standard_D64pls_v5": 2.509000, - "Standard_D64s_v3": 4.000000, - "Standard_D8_v4": 0.480000, - "Standard_D8_v5": 0.480000, - "Standard_D8ads_v5": 0.516000, - "Standard_D8as_v5": 0.432000, - "Standard_D8d_v5": 0.564000, - "Standard_D8lds_v5": 0.448000, - "Standard_D8ls_v5": 0.392000, - "Standard_D8plds_v5": 0.360000, - "Standard_D8pls_v5": 0.314000, - "Standard_D8ps_v5": 0.384000, - "Standard_D8s_v3": 0.500000, - "Standard_D96_v5": 5.760000, - "Standard_D96a_v4": 5.760000, - "Standard_D96d_v5": 6.768000, - "Standard_D96s_v5": 5.760000, - "Standard_DC16ads_v5": 1.032000, - "Standard_DC16as_cc_v5": 0.864000, - "Standard_DC16as_v5": 0.864000, - "Standard_DC16ds_v3": 2.256000, - "Standard_DC1s_v2": 0.120000, - "Standard_DC24ds_v3": 3.384000, - "Standard_DC32ads_cc_v5": 2.064000, - "Standard_DC32ads_v5": 2.064000, - "Standard_DC32as_cc_v5": 1.728000, - "Standard_DC32ds_v3": 4.512000, - "Standard_DC48ads_cc_v5": 3.096000, - "Standard_DC48ads_v5": 3.096000, - "Standard_DC48as_cc_v5": 2.592000, - "Standard_DC48as_v5": 2.592000, - "Standard_DC48ds_v3": 6.768000, - "Standard_DC4as_v5": 0.216000, - "Standard_DC4ds_v3": 0.564000, - "Standard_DC64ads_cc_v5": 4.128000, - "Standard_DC64as_cc_v5": 3.456000, - "Standard_DC8ads_v5": 0.516000, - "Standard_DC96ads_v5": 6.192000, - "Standard_DC96as_v5": 5.184000, - "Standard_DS1": 0.098000, - "Standard_DS11_v2": 0.191000, - "Standard_DS12": 0.420000, - "Standard_DS12-2_v2": 0.382000, - "Standard_DS12_v2": 0.382000, - "Standard_DS13-2_v2": 0.765000, - "Standard_DS14-8_v2": 1.530000, - "Standard_DS2": 0.196000, - "Standard_DS3": 0.392000, - "Standard_DS4_v2": 0.631000, - "Standard_DS4_v2_Promo": 0.631000, - "Standard_DS5_v2": 1.263000, - "Standard_DS5_v2_Promo": 1.263000, - "Standard_E16-4ads_v5": 1.272000, - "Standard_E16-4as_v5": 1.088000, - "Standard_E16-4ds_v4": 1.392000, - "Standard_E16-4s_v3": 1.280000, - "Standard_E16-4s_v5": 1.216000, - "Standard_E16-8ads_v5": 1.272000, - "Standard_E16-8ds_v4": 1.392000, - "Standard_E16-8s_v3": 1.280000, - "Standard_E16-8s_v5": 1.216000, - "Standard_E16_v3": 1.280000, - "Standard_E16a_v4": 1.216000, - "Standard_E16ads_v5": 1.272000, - "Standard_E16as_v4": 1.216000, - "Standard_E16as_v5": 1.088000, - "Standard_E16s_v3": 1.280000, - "Standard_E16s_v4": 1.216000, - "Standard_E16s_v5": 1.216000, - "Standard_E20_v3": 1.600000, - "Standard_E20as_v5": 1.360000, - "Standard_E20ds_v4": 1.740000, - "Standard_E20ds_v5": 1.740000, - "Standard_E20s_v4": 1.520000, - "Standard_E20s_v5": 1.520000, - "Standard_E2_v4": 0.152000, - "Standard_E2a_v4": 0.152000, - "Standard_E2bs_v5": 0.178000, - "Standard_E2ds_v4": 0.174000, - "Standard_E2ds_v5": 0.174000, - "Standard_E32-16ads_v5": 2.544000, - "Standard_E32-16as_v5": 2.176000, - "Standard_E32-16ds_v5": 2.784000, - "Standard_E32-8ads_v5": 2.544000, - "Standard_E32-8as_v5": 2.176000, - "Standard_E32-8ds_v4": 2.784000, - "Standard_E32-8s_v4": 2.432000, - "Standard_E32_v3": 2.560000, - "Standard_E32_v4": 2.432000, - "Standard_E32_v5": 2.432000, - "Standard_E32ads_v5": 2.544000, - "Standard_E32as_v4": 2.432000, - "Standard_E32as_v5": 2.176000, - "Standard_E32bs_v5": 2.848000, - "Standard_E32ds_v5": 2.784000, - "Standard_E32pds_v5": 2.224000, - "Standard_E32s_v4": 2.432000, - "Standard_E32s_v5": 2.432000, - "Standard_E4-2as_v4": 0.304000, - "Standard_E4-2as_v5": 0.272000, - "Standard_E4-2ds_v4": 0.348000, - "Standard_E4-2ds_v5": 0.348000, - "Standard_E48_v5": 3.648000, - "Standard_E48a_v4": 3.648000, - "Standard_E48as_v4": 3.648000, - "Standard_E48bs_v5": 4.272000, - "Standard_E48d_v5": 4.176000, - "Standard_E48ds_v4": 4.176000, - "Standard_E4_v4": 0.304000, - "Standard_E4_v5": 0.304000, - "Standard_E4ds_v5": 0.348000, - "Standard_E64-16as_v5": 4.352000, - "Standard_E64-16ds_v4": 5.568000, - "Standard_E64-16ds_v5": 5.568000, - "Standard_E64-16s_v3": 4.609000, - "Standard_E64-32ads_v5": 5.088000, - "Standard_E64-32as_v5": 4.352000, - "Standard_E64-32s_v4": 4.864000, - "Standard_E64_v3": 4.609000, - "Standard_E64as_v5": 4.352000, - "Standard_E64bds_v5": 6.432000, - "Standard_E64d_v4": 5.568000, - "Standard_E64d_v5": 5.568000, - "Standard_E64s_v4": 4.864000, - "Standard_E8-2as_v5": 0.544000, - "Standard_E8-2s_v4": 0.608000, - "Standard_E8-2s_v5": 0.608000, - "Standard_E8-4ads_v5": 0.636000, - "Standard_E8-4as_v4": 0.608000, - "Standard_E8-4as_v5": 0.544000, - "Standard_E8-4s_v3": 0.640000, - "Standard_E8_v4": 0.608000, - "Standard_E8_v5": 0.608000, - "Standard_E8as_v4": 0.608000, - "Standard_E8bds_v5": 0.804000, - "Standard_E8d_v4": 0.696000, - "Standard_E8ds_v5": 0.696000, - "Standard_E96-24as_v5": 6.528000, - "Standard_E96-24s_v5": 7.296000, - "Standard_E96-48as_v4": 7.296000, - "Standard_E96-48as_v5": 6.528000, - "Standard_E96-48ds_v5": 8.352000, - "Standard_E96-48s_v5": 7.296000, - "Standard_E96_v5": 7.296000, - "Standard_E96a_v4": 7.296000, - "Standard_E96as_v5": 6.528000, - "Standard_E96iads_v5": 8.395000, - "Standard_E96s_v5": 7.296000, - "Standard_EC16ads_cc_v5": 1.272000, - "Standard_EC16as_v5": 1.088000, - "Standard_EC20ads_cc_v5": 1.590000, - "Standard_EC20ads_v5": 1.590000, - "Standard_EC20as_cc_v5": 1.360000, - "Standard_EC2ads_v5": 0.159000, - "Standard_EC32ads_v5": 2.544000, - "Standard_EC32as_cc_v5": 2.176000, - "Standard_EC48ads_cc_v5": 3.816000, - "Standard_EC48as_v5": 3.264000, - "Standard_EC4ads_cc_v5": 0.318000, - "Standard_EC4as_v5": 0.272000, - "Standard_EC64ads_cc_v5": 5.088000, - "Standard_EC64ads_v5": 5.088000, - "Standard_EC8ads_v5": 0.636000, - "Standard_EC8as_cc_v5": 0.544000, - "Standard_EC8as_v5": 0.544000, - "Standard_EC96as_cc_v5": 6.528000, - "Standard_EC96ias_v5": 7.181000, - "Standard_F16": 0.924000, - "Standard_F16s": 0.924000, - "Standard_F1s": 0.057700, - "Standard_F2s": 0.115000, - "Standard_F4": 0.231000, - "Standard_F48s_v2": 2.352000, - "Standard_F4s": 0.231000, - "Standard_F64s_v2": 3.136000, - "Standard_F72s_v2": 3.528000, - "Standard_F8": 0.462000, - "Standard_FX12mds": 1.356000, - "Standard_FX24mds": 2.712000, - "Standard_FX48mds": 5.424000, - "Standard_G4": 5.280000, - "Standard_GS1": 0.660000, - "Standard_GS2": 1.320000, - "Standard_GS4": 5.280000, - "Standard_GS5": 9.390000, - "Standard_GS5-8": 9.390000, - "Standard_H16": 1.848000, - "Standard_H16m": 2.476000, - "Standard_H16mr": 2.724000, - "Standard_H8m": 1.238000, - "Standard_HC44-32rs": 4.118000, - "Standard_HC44rs": 4.118000, - "Standard_L16s": 1.496000, - "Standard_L16s_v2": 1.496000, - "Standard_L32as_v3": 2.992000, - "Standard_L32s": 2.992000, - "Standard_L32s_v2": 2.992000, - "Standard_L48s_v2": 4.488000, - "Standard_L48s_v3": 5.016000, - "Standard_L4s": 0.374000, - "Standard_L64s_v2": 5.984000, - "Standard_L80s_v3": 8.360000, - "Standard_L88is_v2": 8.228000, - "Standard_L8s_v2": 0.748000, - "Standard_L8s_v3": 0.836000, - "Standard_M128-64ms": 38.698000, - "Standard_M128dms_v2": 38.701000, - "Standard_M128m": 38.698000, - "Standard_M128ms": 38.698000, - "Standard_M16-4ms": 4.455900, - "Standard_M16ms": 4.455900, - "Standard_M192ids_v2": 23.246000, - "Standard_M192ims_v2": 45.882000, - "Standard_M192is_v2": 22.636000, - "Standard_M208-104ms_v2": 58.006000, - "Standard_M208-52s_v2": 29.003000, - "Standard_M32-8ms": 8.911700, - "Standard_M32dms_v2": 8.912000, - "Standard_M32ls": 3.447600, - "Standard_M32ms_v2": 8.759000, - "Standard_M32s": 4.835800, - "Standard_M416-104ms_v2": 128.900000, - "Standard_M416is_v2": 64.454000, - "Standard_M416ms_v2": 128.900000, - "Standard_M64ds_v2": 9.670000, - "Standard_M64ms": 14.989000, - "Standard_M8-2ms": 2.227900, - "Standard_M8-4ms": 2.227900, - "Standard_NC12s_v2": 6.077000, - "Standard_NC12s_v3": 8.468000, - "Standard_NC24": 5.283000, - "Standard_NC24rs_v2": 13.369000, - "Standard_NC24rs_v3": 18.630000, - "Standard_NC6": 1.321000, - "Standard_NC64as_T4_v3": 6.089000, - "Standard_NC6s_v3": 4.234000, - "Standard_NP10s": 2.145000, - "Standard_NV12ads_A10_v5": 1.180000, - "Standard_NV36adms_A10_v5": 5.876000, - "Standard_NV48s_v3": 6.360000, - "Standard_NV6ads_A10_v5": 0.590000, - } - // southindia - initialOnDemandPrices["southindia"] = map[string]float64{ - "Basic_A4": 0.418000, - "Dasv4_Type1": 7.445000, - "Easv4_Type1": 9.380000, - "Easv4_Type2": 9.380000, - "Fsv2_Type2": 3.703000, - "Lasv3_Type1": 9.678000, - "Mdsv2MedMem_Type1": 22.158000, - "Msmv2MedMem Type1": 43.633000, - "Msv2_Type1": 82.352000, - "Standard_A1_v2": 0.047000, - "Standard_A2_v2": 0.098000, - "Standard_A5": 0.234000, - "Standard_A7": 0.936000, - "Standard_A8m_v2": 0.633000, - "Standard_B12ms": 0.706000, - "Standard_B16als_v2": 0.825000, - "Standard_B16ms": 0.941000, - "Standard_B1s": 0.014500, - "Standard_B2als_v2": 0.062200, - "Standard_B2ls_v2": 0.067900, - "Standard_B2ms": 0.118000, - "Standard_B2s_v2": 0.117000, - "Standard_B32als_v2": 1.649000, - "Standard_B32as_v2": 1.697000, - "Standard_B32ls_v2": 1.809000, - "Standard_B4als_v2": 0.188000, - "Standard_B4ls_v2": 0.208000, - "Standard_B8ls_v2": 0.416000, - "Standard_D1": 0.094400, - "Standard_D12": 0.489000, - "Standard_D12_v2_Promo": 0.379000, - "Standard_D13": 0.977000, - "Standard_D13_v2": 0.758000, - "Standard_D15_v2": 1.895000, - "Standard_D15i_v2": 1.895000, - "Standard_D16ads_v5": 1.162000, - "Standard_D16as_v5": 0.970000, - "Standard_D16as_v5_Promo": 0.869000, - "Standard_D16d_v4": 1.274000, - "Standard_D16d_v5": 1.275000, - "Standard_D2_v4": 0.135000, - "Standard_D2ads_v5": 0.145000, - "Standard_D2as_v5": 0.121000, - "Standard_D2as_v5_Promo": 0.109000, - "Standard_D2d_v5": 0.159000, - "Standard_D2lds_v5": 0.135000, - "Standard_D3": 0.378000, - "Standard_D32_v4": 2.164000, - "Standard_D32a_v4": 2.166000, - "Standard_D32ads_v5": 2.324000, - "Standard_D32as_v5_Promo": 1.737000, - "Standard_D32lds_v5": 2.166000, - "Standard_D32ls_v5": 1.918000, - "Standard_D32s_v4": 2.164000, - "Standard_D32s_v5": 2.166000, - "Standard_D3_v2": 0.337000, - "Standard_D48_v3": 3.246000, - "Standard_D48a_v4": 3.249000, - "Standard_D4_v4": 0.271000, - "Standard_D4ads_v5": 0.290000, - "Standard_D4d_v4": 0.318000, - "Standard_D4ds_v4": 0.318000, - "Standard_D4lds_v5": 0.271000, - "Standard_D4s_v3": 0.271000, - "Standard_D4s_v4": 0.271000, - "Standard_D5_v2_Promo": 1.350000, - "Standard_D64-32s_v3": 4.328000, - "Standard_D64_v3": 4.328000, - "Standard_D64a_v4": 4.332000, - "Standard_D64d_v4": 5.095000, - "Standard_D64ds_v4": 5.095000, - "Standard_D8as_v4": 0.541000, - "Standard_D8as_v5": 0.485000, - "Standard_D8d_v5": 0.637000, - "Standard_D8ls_v5": 0.479000, - "Standard_D8s_v3": 0.541000, - "Standard_D96_v5": 6.497000, - "Standard_D96ls_v5": 5.753000, - "Standard_DC1s_v3": 0.135000, - "Standard_DC2s_v3": 0.271000, - "Standard_DC4ds_v3": 0.637000, - "Standard_DC8s_v3": 1.083000, - "Standard_DS12-2_v2": 0.379000, - "Standard_DS14_v2_Promo": 1.516000, - "Standard_DS15i_v2": 1.895000, - "Standard_DS1_v2": 0.084000, - "Standard_DS3": 0.378000, - "Standard_DS4": 0.755000, - "Standard_DS5_v2": 1.350000, - "Standard_E112ias_v5": 9.815000, - "Standard_E112ibds_v5": 14.505000, - "Standard_E16-4as_v5": 1.275000, - "Standard_E16-8ds_v4": 1.524000, - "Standard_E16_v3": 1.334000, - "Standard_E16as_v5": 1.275000, - "Standard_E16d_v4": 1.524000, - "Standard_E16s_v4": 1.334000, - "Standard_E20as_v5": 1.593000, - "Standard_E2bs_v5": 0.210000, - "Standard_E2d_v4": 0.191000, - "Standard_E2ds_v5": 0.203000, - "Standard_E32-16as_v4": 2.843000, - "Standard_E32-16as_v5": 2.549000, - "Standard_E32-16s_v3": 2.667000, - "Standard_E32-8as_v4": 2.843000, - "Standard_E32-8ds_v4": 3.048000, - "Standard_E32_v5": 2.843000, - "Standard_E32as_v4": 2.843000, - "Standard_E32as_v5": 2.549000, - "Standard_E32bds_v5": 3.768000, - "Standard_E32s_v3": 2.667000, - "Standard_E32s_v5": 2.843000, - "Standard_E4-2ads_v5": 0.369000, - "Standard_E4-2s_v5": 0.355000, - "Standard_E48_v5": 4.264000, - "Standard_E48a_v4": 4.264000, - "Standard_E48ads_v5": 4.433000, - "Standard_E48d_v4": 4.572000, - "Standard_E48d_v5": 4.873000, - "Standard_E4_v3": 0.334000, - "Standard_E4ads_v5": 0.369000, - "Standard_E4as_v4": 0.355000, - "Standard_E4bds_v5": 0.471000, - "Standard_E4s_v4": 0.333000, - "Standard_E4s_v5": 0.355000, - "Standard_E64-16ds_v4": 6.096000, - "Standard_E64-32ds_v5": 6.497000, - "Standard_E64_v3": 4.801000, - "Standard_E64_v5": 5.685000, - "Standard_E64i_v3": 4.801000, - "Standard_E64s_v3": 4.801000, - "Standard_E8-2as_v4": 0.711000, - "Standard_E8-2ds_v4": 0.762000, - "Standard_E8-2s_v4": 0.667000, - "Standard_E8-4as_v4": 0.711000, - "Standard_E80ids_v4": 9.155160, - "Standard_E8_v4": 0.667000, - "Standard_E8ads_v5": 0.739000, - "Standard_E8bs_v5": 0.840000, - "Standard_E8s_v5": 0.711000, - "Standard_E96-24ads_v5": 8.866000, - "Standard_E96-24as_v5": 7.648000, - "Standard_E96-48as_v4": 8.528000, - "Standard_E96-48as_v5": 7.648000, - "Standard_E96a_v4": 8.528000, - "Standard_E96bds_v5": 11.303000, - "Standard_E96d_v5": 9.746000, - "Standard_E96s_v5": 8.528000, - "Standard_F1": 0.060000, - "Standard_F16s": 0.966000, - "Standard_F2s": 0.121000, - "Standard_F4": 0.242000, - "Standard_F4s_v2": 0.187000, - "Standard_F64s_v2": 2.992000, - "Standard_F72s_v2": 3.366000, - "Standard_L32as_v3": 3.519000, - "Standard_L64s_v3": 7.873000, - "Standard_L8s_v3": 0.984000, - "Standard_M128ms": 40.440000, - "Standard_M128ms_v2": 39.666000, - "Standard_M16-4ms": 4.610000, - "Standard_M192ids_v2": 24.208000, - "Standard_M208ms_v2": 67.376000, - "Standard_M32dms_v2": 9.280000, - "Standard_M32s": 5.052500, - "Standard_M416is_v2": 74.866000, - "Standard_M416s_v2": 74.866000, - "Standard_M64-32ms": 15.664000, - "Standard_M64ls": 6.822900, - "Standard_M64m": 15.664000, - "Standard_M8ms": 2.305000, - "Standard_NC16as_T4_v3": 1.697000, - "Standard_NC4as_T4_v3": 0.742000, - "Standard_NC8as_T4_v3": 1.059000, - "Standard_SQLG7_AMD_IaaS": 11.370000, - } - // swedencentral - initialOnDemandPrices["swedencentral"] = map[string]float64{ - "Dasv4_Type1": 5.610000, - "Dasv5_Type1": 5.667000, - "Ddsv4_Type 1": 4.224000, - "Ddsv4_Type2": 5.016000, - "Ddsv5_Type1": 6.336000, - "Dsv3_Type3": 4.488000, - "Dsv3_Type4": 5.386000, - "Dsv4_Type1": 4.488000, - "Dsv4_Type2": 5.386000, - "Eadsv5_Type1": 7.339000, - "Easv4_Type1": 7.075000, - "Easv4_Type2": 7.075000, - "Ebdsv5-Type1": 6.248000, - "Edsv4_Type 1": 5.350000, - "Edsv4_Type2": 6.354000, - "Edsv5_Type1": 8.026000, - "Esv3_Type3": 4.717000, - "Esv3_Type4": 6.191000, - "Esv4_Type2": 6.191000, - "Esv5_Type1": 7.075000, - "Lsv2_Type1": 7.172000, - "Mdsmv2MedMem _Type1": 41.103000, - "Mdsv2MedMem_Type1": 20.544000, - "Msmv2MedMem Type1": 40.455000, - "Msmv2_Type1": 130.880000, - "Msv2_Type1": 65.446000, - "Standard_A1_v2": 0.041000, - "Standard_A2_v2": 0.086100, - "Standard_A2m_v2": 0.113000, - "Standard_A4_v2": 0.182000, - "Standard_A4m_v2": 0.226000, - "Standard_A8_v2": 0.380000, - "Standard_A8m_v2": 0.453000, - "Standard_B12ms": 0.518000, - "Standard_B16als_v2": 0.624000, - "Standard_B16as_v2": 0.622000, - "Standard_B16ls_v2": 0.686000, - "Standard_B16ms": 0.691000, - "Standard_B16pls_v2": 0.561000, - "Standard_B16ps_v2": 0.624000, - "Standard_B16s_v2": 0.765000, - "Standard_B1ms": 0.021600, - "Standard_B1s": 0.010800, - "Standard_B2als_v2": 0.048100, - "Standard_B2as_v2": 0.077800, - "Standard_B2ats_v2": 0.009720, - "Standard_B2ls_v2": 0.052400, - "Standard_B2ms": 0.086400, - "Standard_B2pls_v2": 0.043600, - "Standard_B2ps_v2": 0.078000, - "Standard_B2pts_v2": 0.017800, - "Standard_B2s_v2": 0.095600, - "Standard_B2ts_v2": 0.020000, - "Standard_B32als_v2": 1.249000, - "Standard_B32as_v2": 1.244000, - "Standard_B32ls_v2": 1.224000, - "Standard_B32s_v2": 1.382000, - "Standard_B4als_v2": 0.138000, - "Standard_B4as_v2": 0.156000, - "Standard_B4ls_v2": 0.171000, - "Standard_B4ms": 0.173000, - "Standard_B4pls_v2": 0.140000, - "Standard_B4ps_v2": 0.156000, - "Standard_B4s_v2": 0.191000, - "Standard_B8als_v2": 0.275000, - "Standard_B8as_v2": 0.311000, - "Standard_B8ls_v2": 0.343000, - "Standard_B8ms": 0.346000, - "Standard_B8pls_v2": 0.280000, - "Standard_B8ps_v2": 0.312000, - "Standard_B8s_v2": 0.346000, - "Standard_D11_v2": 0.171000, - "Standard_D12_v2": 0.345000, - "Standard_D12_v2_Promo": 0.345000, - "Standard_D13_v2": 0.691000, - "Standard_D14_v2_Promo": 1.381000, - "Standard_D15_v2": 1.726000, - "Standard_D16_v3": 0.816000, - "Standard_D16_v4": 0.816000, - "Standard_D16_v5": 0.816000, - "Standard_D16ads_v5": 0.880000, - "Standard_D16as_v4": 0.816000, - "Standard_D16d_v5": 0.960000, - "Standard_D16ds_v5": 0.960000, - "Standard_D16lds_v5": 0.832000, - "Standard_D16ls_v5": 0.728000, - "Standard_D16pds_v5": 0.768000, - "Standard_D16plds_v5": 0.666000, - "Standard_D16ps_v5": 0.656000, - "Standard_D16s_v3": 0.816000, - "Standard_D16s_v4": 0.816000, - "Standard_D16s_v5": 0.816000, - "Standard_D1_v2": 0.068000, - "Standard_D2_v2": 0.136000, - "Standard_D2_v4": 0.102000, - "Standard_D2_v5": 0.102000, - "Standard_D2a_v4": 0.102000, - "Standard_D2ads_v5": 0.110000, - "Standard_D2as_v4": 0.102000, - "Standard_D2as_v5": 0.092000, - "Standard_D2d_v4": 0.120000, - "Standard_D2d_v5": 0.120000, - "Standard_D2ds_v5": 0.120000, - "Standard_D2lds_v5": 0.104000, - "Standard_D2ls_v5": 0.091000, - "Standard_D2pds_v5": 0.096000, - "Standard_D2plds_v5": 0.083200, - "Standard_D2ps_v5": 0.082000, - "Standard_D2s_v3": 0.102000, - "Standard_D2s_v4": 0.102000, - "Standard_D2s_v5": 0.102000, - "Standard_D32-8s_v3": 1.632000, - "Standard_D32_v3": 1.632000, - "Standard_D32_v4": 1.632000, - "Standard_D32_v5": 1.632000, - "Standard_D32as_v4": 1.632000, - "Standard_D32d_v4": 1.920000, - "Standard_D32d_v5": 1.920000, - "Standard_D32ds_v4": 1.920000, - "Standard_D32ds_v5": 1.920000, - "Standard_D32lds_v5": 1.664000, - "Standard_D32ls_v5": 1.456000, - "Standard_D32pds_v5": 1.536000, - "Standard_D32plds_v5": 1.331000, - "Standard_D32pls_v5": 1.168000, - "Standard_D32ps_v5": 1.312000, - "Standard_D32s_v3": 1.632000, - "Standard_D32s_v4": 1.632000, - "Standard_D3_v2": 0.272000, - "Standard_D48_v3": 2.448000, - "Standard_D48_v4": 2.448000, - "Standard_D48_v5": 2.448000, - "Standard_D48a_v4": 2.448000, - "Standard_D48ads_v5": 2.640000, - "Standard_D48as_v4": 2.448000, - "Standard_D48as_v5": 2.208000, - "Standard_D48d_v4": 2.880000, - "Standard_D48d_v5": 2.880000, - "Standard_D48ds_v4": 2.880000, - "Standard_D48lds_v5": 2.496000, - "Standard_D48ls_v5": 2.184000, - "Standard_D48pds_v5": 2.304000, - "Standard_D48plds_v5": 1.997000, - "Standard_D48pls_v5": 1.752000, - "Standard_D48ps_v5": 1.968000, - "Standard_D48s_v3": 2.448000, - "Standard_D48s_v4": 2.448000, - "Standard_D48s_v5": 2.448000, - "Standard_D4_v2": 0.544000, - "Standard_D4_v2_Promo": 0.544000, - "Standard_D4_v3": 0.204000, - "Standard_D4_v4": 0.204000, - "Standard_D4_v5": 0.204000, - "Standard_D4a_v4": 0.204000, - "Standard_D4ads_v5": 0.220000, - "Standard_D4as_v4": 0.204000, - "Standard_D4as_v5": 0.184000, - "Standard_D4d_v4": 0.240000, - "Standard_D4d_v5": 0.240000, - "Standard_D4ds_v4": 0.240000, - "Standard_D4ds_v5": 0.240000, - "Standard_D4lds_v5": 0.208000, - "Standard_D4pds_v5": 0.192000, - "Standard_D4plds_v5": 0.166000, - "Standard_D4pls_v5": 0.146000, - "Standard_D4s_v3": 0.204000, - "Standard_D4s_v4": 0.204000, - "Standard_D5_v2": 1.088000, - "Standard_D5_v2_Promo": 1.088000, - "Standard_D64-16s_v3": 3.264000, - "Standard_D64-32s_v3": 3.264000, - "Standard_D64_v3": 3.264000, - "Standard_D64_v5": 3.264000, - "Standard_D64a_v4": 3.264000, - "Standard_D64ads_v5": 3.520000, - "Standard_D64as_v4": 3.264000, - "Standard_D64as_v5": 2.944000, - "Standard_D64d_v4": 3.840000, - "Standard_D64d_v5": 3.840000, - "Standard_D64ds_v4": 3.840000, - "Standard_D64ds_v5": 3.840000, - "Standard_D64lds_v5": 3.328000, - "Standard_D64ls_v5": 2.912000, - "Standard_D64pds_v5": 3.072000, - "Standard_D64plds_v5": 2.662000, - "Standard_D64pls_v5": 2.336000, - "Standard_D64ps_v5": 2.624000, - "Standard_D64s_v3": 3.264000, - "Standard_D64s_v4": 3.264000, - "Standard_D8_v3": 0.408000, - "Standard_D8_v4": 0.408000, - "Standard_D8_v5": 0.408000, - "Standard_D8a_v4": 0.408000, - "Standard_D8ads_v5": 0.440000, - "Standard_D8as_v4": 0.408000, - "Standard_D8as_v5": 0.368000, - "Standard_D8d_v4": 0.480000, - "Standard_D8d_v5": 0.480000, - "Standard_D8ds_v5": 0.480000, - "Standard_D8lds_v5": 0.416000, - "Standard_D8ls_v5": 0.364000, - "Standard_D8plds_v5": 0.333000, - "Standard_D8s_v5": 0.408000, - "Standard_D96_v5": 4.896000, - "Standard_D96a_v4": 4.896000, - "Standard_D96ads_v5": 5.280000, - "Standard_D96as_v4": 4.896000, - "Standard_D96as_v5": 4.416000, - "Standard_D96d_v5": 5.760000, - "Standard_D96lds_v5": 4.992000, - "Standard_D96ls_v5": 4.368000, - "Standard_D96s_v5": 4.896000, - "Standard_DC4s": 0.395000, - "Standard_DS11-1_v2": 0.171000, - "Standard_DS11_v2": 0.171000, - "Standard_DS11_v2_Promo": 0.171000, - "Standard_DS12-1_v2": 0.345000, - "Standard_DS12-2_v2": 0.345000, - "Standard_DS12_v2": 0.345000, - "Standard_DS12_v2_Promo": 0.345000, - "Standard_DS13-2_v2": 0.691000, - "Standard_DS13-4_v2": 0.691000, - "Standard_DS13_v2": 0.691000, - "Standard_DS13_v2_Promo": 0.691000, - "Standard_DS14-8_v2": 1.381000, - "Standard_DS14_v2": 1.381000, - "Standard_DS14_v2_Promo": 1.381000, - "Standard_DS15_v2": 1.726000, - "Standard_DS15i_v2": 1.726000, - "Standard_DS2_v2": 0.136000, - "Standard_DS2_v2_Promo": 0.136000, - "Standard_DS3_v2": 0.272000, - "Standard_DS3_v2_Promo": 0.272000, - "Standard_DS4_v2": 0.544000, - "Standard_DS4_v2_Promo": 0.544000, - "Standard_DS5_v2": 1.088000, - "Standard_E104i_v5": 7.665000, - "Standard_E104id_v5": 8.694000, - "Standard_E104is_v5": 7.665000, - "Standard_E112iads_v5": 8.562000, - "Standard_E112ias_v5": 7.454000, - "Standard_E112ibs_v5": 9.825000, - "Standard_E16-4ads_v5": 1.112000, - "Standard_E16-4as_v4": 1.072000, - "Standard_E16-4as_v5": 0.968000, - "Standard_E16-4ds_v4": 1.216000, - "Standard_E16-4s_v3": 1.072000, - "Standard_E16-4s_v4": 1.072000, - "Standard_E16-4s_v5": 1.072000, - "Standard_E16-8ads_v5": 1.112000, - "Standard_E16-8as_v5": 0.968000, - "Standard_E16-8ds_v4": 1.216000, - "Standard_E16-8ds_v5": 1.216000, - "Standard_E16-8s_v3": 1.072000, - "Standard_E16-8s_v4": 1.072000, - "Standard_E16-8s_v5": 1.072000, - "Standard_E16_v3": 1.072000, - "Standard_E16_v4": 1.072000, - "Standard_E16_v5": 1.072000, - "Standard_E16a_v4": 1.072000, - "Standard_E16ads_v5": 1.112000, - "Standard_E16as_v4": 1.072000, - "Standard_E16as_v5": 0.968000, - "Standard_E16bs_v5": 1.276000, - "Standard_E16d_v4": 1.216000, - "Standard_E16d_v5": 1.216000, - "Standard_E16ds_v4": 1.216000, - "Standard_E16ds_v5": 1.216000, - "Standard_E16pds_v5": 0.973000, - "Standard_E16ps_v5": 0.856000, - "Standard_E16s_v3": 1.072000, - "Standard_E16s_v4": 1.072000, - "Standard_E20_v3": 1.340000, - "Standard_E20_v4": 1.340000, - "Standard_E20_v5": 1.340000, - "Standard_E20a_v4": 1.340000, - "Standard_E20ads_v5": 1.390000, - "Standard_E20as_v4": 1.340000, - "Standard_E20as_v5": 1.210000, - "Standard_E20d_v4": 1.520000, - "Standard_E20d_v5": 1.520000, - "Standard_E20ds_v4": 1.520000, - "Standard_E20ds_v5": 1.520000, - "Standard_E20ps_v5": 1.070000, - "Standard_E20s_v3": 1.340000, - "Standard_E20s_v4": 1.340000, - "Standard_E20s_v5": 1.340000, - "Standard_E2_v3": 0.134000, - "Standard_E2_v4": 0.134000, - "Standard_E2_v5": 0.134000, - "Standard_E2a_v4": 0.134000, - "Standard_E2ads_v5": 0.139000, - "Standard_E2as_v4": 0.134000, - "Standard_E2as_v5": 0.121000, - "Standard_E2bds_v5": 0.178000, - "Standard_E2bs_v5": 0.160000, - "Standard_E2d_v4": 0.152000, - "Standard_E2d_v5": 0.152000, - "Standard_E2ds_v4": 0.152000, - "Standard_E2ds_v5": 0.152000, - "Standard_E2pds_v5": 0.122000, - "Standard_E2ps_v5": 0.107000, - "Standard_E2s_v3": 0.134000, - "Standard_E2s_v4": 0.134000, - "Standard_E32-16ads_v5": 2.224000, - "Standard_E32-16as_v4": 2.144000, - "Standard_E32-16as_v5": 1.936000, - "Standard_E32-16ds_v4": 2.432000, - "Standard_E32-16ds_v5": 2.432000, - "Standard_E32-16s_v3": 2.144000, - "Standard_E32-16s_v4": 2.144000, - "Standard_E32-16s_v5": 2.144000, - "Standard_E32-8ads_v5": 2.224000, - "Standard_E32-8as_v4": 2.144000, - "Standard_E32-8as_v5": 1.936000, - "Standard_E32-8ds_v4": 2.432000, - "Standard_E32-8s_v3": 2.144000, - "Standard_E32-8s_v4": 2.144000, - "Standard_E32-8s_v5": 2.144000, - "Standard_E32_v3": 2.144000, - "Standard_E32_v4": 2.144000, - "Standard_E32_v5": 2.144000, - "Standard_E32a_v4": 2.144000, - "Standard_E32as_v4": 2.144000, - "Standard_E32as_v5": 1.936000, - "Standard_E32bs_v5": 2.552000, - "Standard_E32d_v4": 2.432000, - "Standard_E32ds_v4": 2.432000, - "Standard_E32ds_v5": 2.432000, - "Standard_E32pds_v5": 1.946000, - "Standard_E32ps_v5": 1.712000, - "Standard_E32s_v3": 2.144000, - "Standard_E32s_v4": 2.144000, - "Standard_E32s_v5": 2.144000, - "Standard_E4-2ads_v5": 0.278000, - "Standard_E4-2as_v4": 0.268000, - "Standard_E4-2as_v5": 0.242000, - "Standard_E4-2ds_v4": 0.304000, - "Standard_E4-2ds_v5": 0.304000, - "Standard_E4-2s_v5": 0.268000, - "Standard_E48_v3": 3.216000, - "Standard_E48_v4": 3.216000, - "Standard_E48_v5": 3.216000, - "Standard_E48ads_v5": 3.336000, - "Standard_E48as_v4": 3.216000, - "Standard_E48as_v5": 2.904000, - "Standard_E48bds_v5": 4.260000, - "Standard_E48bs_v5": 3.828000, - "Standard_E48d_v4": 3.648000, - "Standard_E48d_v5": 3.648000, - "Standard_E48ds_v4": 3.648000, - "Standard_E48ds_v5": 3.648000, - "Standard_E48s_v3": 3.216000, - "Standard_E48s_v4": 3.216000, - "Standard_E48s_v5": 3.216000, - "Standard_E4_v3": 0.268000, - "Standard_E4_v5": 0.268000, - "Standard_E4a_v4": 0.268000, - "Standard_E4ads_v5": 0.278000, - "Standard_E4as_v4": 0.268000, - "Standard_E4as_v5": 0.242000, - "Standard_E4bds_v5": 0.355000, - "Standard_E4bs_v5": 0.319000, - "Standard_E4d_v4": 0.304000, - "Standard_E4d_v5": 0.304000, - "Standard_E4ds_v4": 0.304000, - "Standard_E4ds_v5": 0.304000, - "Standard_E4pds_v5": 0.243000, - "Standard_E4ps_v5": 0.214000, - "Standard_E4s_v3": 0.268000, - "Standard_E4s_v5": 0.268000, - "Standard_E64-16ads_v5": 4.448000, - "Standard_E64-16as_v4": 4.288000, - "Standard_E64-16as_v5": 3.872000, - "Standard_E64-16ds_v4": 4.864000, - "Standard_E64-16ds_v5": 4.864000, - "Standard_E64-16s_v3": 4.288000, - "Standard_E64-16s_v4": 4.288000, - "Standard_E64-16s_v5": 4.288000, - "Standard_E64-32ads_v5": 4.448000, - "Standard_E64-32as_v4": 4.288000, - "Standard_E64-32as_v5": 3.872000, - "Standard_E64-32ds_v5": 4.864000, - "Standard_E64-32s_v3": 4.288000, - "Standard_E64_v3": 4.288000, - "Standard_E64_v4": 4.288000, - "Standard_E64a_v4": 4.288000, - "Standard_E64ads_v5": 4.448000, - "Standard_E64as_v5": 3.872000, - "Standard_E64bds_v5": 5.680000, - "Standard_E64bs_v5": 5.104000, - "Standard_E64d_v4": 4.864000, - "Standard_E64d_v5": 4.864000, - "Standard_E64ds_v4": 4.864000, - "Standard_E64ds_v5": 4.864000, - "Standard_E64i_v4_SPECIAL": 4.288000, - "Standard_E64ids_v4_SPECIAL": 4.864000, - "Standard_E64is_v3": 4.288000, - "Standard_E64is_v4_SPECIAL": 4.288000, - "Standard_E64s_v3": 4.288000, - "Standard_E64s_v4": 4.288000, - "Standard_E64s_v5": 4.288000, - "Standard_E8-2as_v4": 0.536000, - "Standard_E8-2as_v5": 0.484000, - "Standard_E8-2s_v5": 0.536000, - "Standard_E8-4ads_v5": 0.556000, - "Standard_E8-4as_v5": 0.484000, - "Standard_E8-4ds_v5": 0.608000, - "Standard_E8-4s_v3": 0.536000, - "Standard_E8-4s_v4": 0.536000, - "Standard_E80ids_v4": 6.080000, - "Standard_E80is_v4": 5.360000, - "Standard_E8_v3": 0.536000, - "Standard_E8_v4": 0.536000, - "Standard_E8_v5": 0.536000, - "Standard_E8a_v4": 0.536000, - "Standard_E8ads_v5": 0.556000, - "Standard_E8as_v4": 0.536000, - "Standard_E8bds_v5": 0.710000, - "Standard_E8bs_v5": 0.638000, - "Standard_E8d_v4": 0.608000, - "Standard_E8d_v5": 0.608000, - "Standard_E8ds_v4": 0.608000, - "Standard_E8ds_v5": 0.608000, - "Standard_E8ps_v5": 0.428000, - "Standard_E8s_v3": 0.536000, - "Standard_E8s_v4": 0.536000, - "Standard_E96-24ads_v5": 6.672000, - "Standard_E96-24as_v5": 5.808000, - "Standard_E96-24ds_v5": 7.296000, - "Standard_E96-24s_v5": 6.432000, - "Standard_E96-48as_v4": 6.432000, - "Standard_E96-48as_v5": 5.808000, - "Standard_E96-48ds_v5": 7.296000, - "Standard_E96-48s_v5": 6.432000, - "Standard_E96_v5": 6.432000, - "Standard_E96a_v4": 6.432000, - "Standard_E96ads_v5": 6.672000, - "Standard_E96as_v4": 6.432000, - "Standard_E96as_v5": 5.808000, - "Standard_E96bds_v5": 8.520000, - "Standard_E96bs_v5": 7.656000, - "Standard_E96d_v5": 7.296000, - "Standard_E96iads_v5": 7.339000, - "Standard_E96ias_v5": 6.389000, - "Standard_F1": 0.056800, - "Standard_F16": 0.909000, - "Standard_F16s": 0.909000, - "Standard_F16s_v2": 0.776000, - "Standard_F2": 0.114000, - "Standard_F4": 0.227000, - "Standard_F48s_v2": 2.328000, - "Standard_F4s": 0.227000, - "Standard_F4s_v2": 0.194000, - "Standard_F64s_v2": 3.104000, - "Standard_F72s_v2": 3.492000, - "Standard_F8s": 0.455000, - "Standard_F8s_v2": 0.388000, - "Standard_HB176-144rs_v4": 9.360000, - "Standard_HB176-24rs_v4": 9.360000, - "Standard_HB176-48rs_v4": 9.360000, - "Standard_HB176rs_v4": 9.360000, - "Standard_HX176-144rs": 11.232000, - "Standard_HX176-24rs": 11.232000, - "Standard_HX176-48rs": 11.232000, - "Standard_HX176-96rs": 11.232000, - "Standard_HX176rs": 11.232000, - "Standard_L112ias_v3": 10.041000, - "Standard_L16as_v3": 1.304000, - "Standard_L16s_v2": 1.304000, - "Standard_L32as_v3": 2.608000, - "Standard_L32s_v2": 2.608000, - "Standard_L48as_v3": 3.912000, - "Standard_L48s_v2": 3.912000, - "Standard_L48s_v3": 4.368000, - "Standard_L64as_v3": 5.216000, - "Standard_L64s_v2": 5.216000, - "Standard_L64s_v3": 5.824000, - "Standard_L80as_v3": 6.520000, - "Standard_L80s_v3": 7.280000, - "Standard_L88is_v2": 7.172000, - "Standard_L8as_v3": 0.652000, - "Standard_L8s_v2": 0.652000, - "Standard_L8s_v3": 0.728000, - "Standard_M128": 18.673000, - "Standard_M128-64ms": 37.363000, - "Standard_M128dms_v2": 37.366000, - "Standard_M128ds_v2": 18.676000, - "Standard_M128m": 37.363000, - "Standard_M128ms": 37.363000, - "Standard_M128ms_v2": 36.777000, - "Standard_M128s": 18.673000, - "Standard_M128s_v2": 18.087000, - "Standard_M16-4ms": 4.302000, - "Standard_M16-8ms": 4.302000, - "Standard_M16ms": 4.302000, - "Standard_M16s": 3.342000, - "Standard_M192idms_v2": 44.889000, - "Standard_M192ids_v2": 22.445000, - "Standard_M192ims_v2": 44.300000, - "Standard_M192is_v2": 21.856000, - "Standard_M208-104ms_v2": 53.544000, - "Standard_M208-104s_v2": 26.772000, - "Standard_M208-52ms_v2": 53.544000, - "Standard_M208-52s_v2": 26.772000, - "Standard_M208ms_v2": 53.544000, - "Standard_M208s_v2": 26.772000, - "Standard_M32-16ms": 8.604000, - "Standard_M32-8ms": 8.604000, - "Standard_M32dms_v2": 8.604000, - "Standard_M32ls": 4.022000, - "Standard_M32ms": 8.604000, - "Standard_M32s": 4.669000, - "Standard_M32ts": 3.790000, - "Standard_M416-104ms_v2": 118.980000, - "Standard_M416-208ms_v2": 118.980000, - "Standard_M416-208s_v2": 59.496000, - "Standard_M416is_v2": 59.496000, - "Standard_M416ms_v2": 118.980000, - "Standard_M416s_8_v2": 79.750000, - "Standard_M416s_v2": 59.496000, - "Standard_M64": 9.337000, - "Standard_M64-16ms": 14.471800, - "Standard_M64-32ms": 14.471800, - "Standard_M64dms_v2": 14.476000, - "Standard_M64ds_v2": 9.337000, - "Standard_M64ls": 7.581000, - "Standard_M64m": 14.471800, - "Standard_M64ms": 14.471800, - "Standard_M64ms_v2": 14.181000, - "Standard_M64s_v2": 9.042000, - "Standard_M8-4ms": 2.151100, - "Standard_M8ms": 2.151100, - "Standard_ND40s_v2": 12.240000, - "Standard_ND96ams_A100_v4": 42.601000, - "Standard_ND96amsr_A100_v4": 42.601000, - "Standard_NV18ads_A10_v5": 2.080000, - "Standard_NV36adms_A10_v5": 5.876000, - "Standard_NV36ads_A10_v5": 4.160000, - "Standard_NV6ads_A10_v5": 0.590000, - "Standard_NV72ads_A10_v5": 8.476000, - "Standard_SQLG7_NVME": 7.904000, - } - // swedensouth - initialOnDemandPrices["swedensouth"] = map[string]float64{ - "Dadsv5_Type1": 8.809000, - "Dasv4_Type1": 7.293000, - "Dasv4_Type2": 7.293000, - "Dasv5_Type1": 7.367000, - "Ddsv5_Type1": 8.237000, - "Dsv3_Type3": 5.834000, - "Dsv3_Type4": 7.001000, - "Dsv4_Type1": 5.834000, - "Dsv5_Type1": 7.293000, - "Eadsv5_Type1": 9.541000, - "Easv4_Type1": 9.198000, - "Easv4_Type2": 9.198000, - "Easv5_Type1": 8.305000, - "Ebdsv5-Type1": 8.122000, - "Ebsv5-Type1": 7.299000, - "Edsv4_Type 1": 6.956000, - "Esv3_Type3": 6.132000, - "Esv3_Type4": 8.048000, - "Lasv3_Type1": 9.324000, - "Lsv3_Type1": 10.410000, - "Standard_A1_v2": 0.053300, - "Standard_A2_v2": 0.112000, - "Standard_A2m_v2": 0.147000, - "Standard_A4_v2": 0.237000, - "Standard_A4m_v2": 0.294000, - "Standard_A8_v2": 0.495000, - "Standard_A8m_v2": 0.588000, - "Standard_B12ms": 0.673000, - "Standard_B16als_v2": 0.716000, - "Standard_B16as_v2": 0.809000, - "Standard_B16ls_v2": 0.869000, - "Standard_B16ms": 0.898000, - "Standard_B16s_v2": 0.899000, - "Standard_B1ls": 0.007020, - "Standard_B1ms": 0.028100, - "Standard_B1s": 0.014000, - "Standard_B20ms": 1.123000, - "Standard_B2als_v2": 0.050500, - "Standard_B2as_v2": 0.101000, - "Standard_B2ats_v2": 0.012600, - "Standard_B2ls_v2": 0.056200, - "Standard_B2ms": 0.112000, - "Standard_B2s": 0.056200, - "Standard_B2s_v2": 0.122000, - "Standard_B2ts_v2": 0.014000, - "Standard_B32als_v2": 1.432000, - "Standard_B32as_v2": 1.617000, - "Standard_B32ls_v2": 1.739000, - "Standard_B32s_v2": 1.944000, - "Standard_B4als_v2": 0.179000, - "Standard_B4as_v2": 0.221000, - "Standard_B4ls_v2": 0.199000, - "Standard_B4ms": 0.225000, - "Standard_B4s_v2": 0.243000, - "Standard_B8als_v2": 0.358000, - "Standard_B8as_v2": 0.404000, - "Standard_B8ls_v2": 0.435000, - "Standard_B8ms": 0.449000, - "Standard_B8s_v2": 0.486000, - "Standard_D11_v2": 0.223000, - "Standard_D11_v2_Promo": 0.223000, - "Standard_D12_v2": 0.449000, - "Standard_D12_v2_Promo": 0.449000, - "Standard_D13_v2": 0.898000, - "Standard_D13_v2_Promo": 0.898000, - "Standard_D14_v2": 1.795000, - "Standard_D14_v2_Promo": 1.795000, - "Standard_D15_v2": 2.244000, - "Standard_D15i_v2": 2.244000, - "Standard_D16_v3": 1.061000, - "Standard_D16_v4": 1.061000, - "Standard_D16_v5": 1.061000, - "Standard_D16a_v4": 1.061000, - "Standard_D16ads_v5": 1.144000, - "Standard_D16as_v4": 1.061000, - "Standard_D16as_v5": 0.957000, - "Standard_D16as_v5_Promo": 0.853000, - "Standard_D16d_v4": 1.248000, - "Standard_D16d_v5": 1.248000, - "Standard_D16ds_v5": 1.248000, - "Standard_D16lds_v5": 1.082000, - "Standard_D16ls_v5": 0.946000, - "Standard_D16s_v3": 1.061000, - "Standard_D16s_v4": 1.061000, - "Standard_D16s_v5": 1.061000, - "Standard_D1_v2": 0.088400, - "Standard_D2_v2": 0.177000, - "Standard_D2_v2_Promo": 0.177000, - "Standard_D2_v3": 0.133000, - "Standard_D2_v4": 0.133000, - "Standard_D2_v5": 0.133000, - "Standard_D2a_v4": 0.133000, - "Standard_D2ads_v5": 0.143000, - "Standard_D2as_v4": 0.133000, - "Standard_D2as_v5": 0.120000, - "Standard_D2as_v5_Promo": 0.107000, - "Standard_D2d_v4": 0.156000, - "Standard_D2d_v5": 0.156000, - "Standard_D2ds_v5": 0.156000, - "Standard_D2lds_v5": 0.135000, - "Standard_D2ls_v5": 0.118000, - "Standard_D2s_v3": 0.133000, - "Standard_D2s_v4": 0.133000, - "Standard_D2s_v5": 0.133000, - "Standard_D32-16s_v3": 2.122000, - "Standard_D32-8s_v3": 2.122000, - "Standard_D32_v3": 2.122000, - "Standard_D32_v4": 2.122000, - "Standard_D32_v5": 2.122000, - "Standard_D32a_v4": 2.122000, - "Standard_D32ads_v5": 2.288000, - "Standard_D32as_v4": 2.122000, - "Standard_D32as_v5": 1.914000, - "Standard_D32as_v5_Promo": 1.706000, - "Standard_D32d_v4": 2.496000, - "Standard_D32d_v5": 2.496000, - "Standard_D32ds_v5": 2.496000, - "Standard_D32lds_v5": 2.163000, - "Standard_D32ls_v5": 1.893000, - "Standard_D32s_v3": 2.122000, - "Standard_D32s_v4": 2.122000, - "Standard_D32s_v5": 2.122000, - "Standard_D3_v2": 0.353000, - "Standard_D3_v2_Promo": 0.353000, - "Standard_D48_v3": 3.182000, - "Standard_D48_v4": 3.182000, - "Standard_D48_v5": 3.182000, - "Standard_D48a_v4": 3.182000, - "Standard_D48ads_v5": 3.432000, - "Standard_D48as_v4": 3.182000, - "Standard_D48as_v5": 2.870000, - "Standard_D48as_v5_Promo": 2.558000, - "Standard_D48d_v4": 3.744000, - "Standard_D48d_v5": 3.744000, - "Standard_D48ds_v5": 3.744000, - "Standard_D48lds_v5": 3.245000, - "Standard_D48ls_v5": 2.839000, - "Standard_D48s_v3": 3.182000, - "Standard_D48s_v4": 3.182000, - "Standard_D48s_v5": 3.182000, - "Standard_D4_v2": 0.707000, - "Standard_D4_v2_Promo": 0.707000, - "Standard_D4_v3": 0.265000, - "Standard_D4_v4": 0.265000, - "Standard_D4_v5": 0.265000, - "Standard_D4a_v4": 0.265000, - "Standard_D4ads_v5": 0.286000, - "Standard_D4as_v4": 0.265000, - "Standard_D4as_v5": 0.239000, - "Standard_D4as_v5_Promo": 0.213000, - "Standard_D4d_v4": 0.312000, - "Standard_D4d_v5": 0.312000, - "Standard_D4ds_v5": 0.312000, - "Standard_D4lds_v5": 0.270000, - "Standard_D4ls_v5": 0.237000, - "Standard_D4s_v3": 0.265000, - "Standard_D4s_v4": 0.265000, - "Standard_D4s_v5": 0.265000, - "Standard_D5_v2": 1.414000, - "Standard_D5_v2_Promo": 1.414000, - "Standard_D64-16s_v3": 4.243000, - "Standard_D64-32s_v3": 4.243000, - "Standard_D64_v3": 4.243000, - "Standard_D64_v4": 4.243000, - "Standard_D64_v5": 4.243000, - "Standard_D64a_v4": 4.243000, - "Standard_D64ads_v5": 4.576000, - "Standard_D64as_v4": 4.243000, - "Standard_D64as_v5": 3.827000, - "Standard_D64as_v5_Promo": 3.411000, - "Standard_D64d_v4": 4.992000, - "Standard_D64d_v5": 4.992000, - "Standard_D64ds_v5": 4.992000, - "Standard_D64lds_v5": 4.326000, - "Standard_D64ls_v5": 3.786000, - "Standard_D64s_v3": 4.243000, - "Standard_D64s_v4": 4.243000, - "Standard_D64s_v5": 4.243000, - "Standard_D8_v3": 0.530000, - "Standard_D8_v4": 0.530000, - "Standard_D8_v5": 0.530000, - "Standard_D8a_v4": 0.530000, - "Standard_D8ads_v5": 0.572000, - "Standard_D8as_v4": 0.530000, - "Standard_D8as_v5": 0.478000, - "Standard_D8as_v5_Promo": 0.426000, - "Standard_D8d_v4": 0.624000, - "Standard_D8d_v5": 0.624000, - "Standard_D8ds_v5": 0.624000, - "Standard_D8lds_v5": 0.541000, - "Standard_D8ls_v5": 0.473000, - "Standard_D8s_v3": 0.530000, - "Standard_D8s_v4": 0.530000, - "Standard_D8s_v5": 0.530000, - "Standard_D96_v5": 6.365000, - "Standard_D96a_v4": 6.365000, - "Standard_D96ads_v5": 6.864000, - "Standard_D96as_v4": 6.365000, - "Standard_D96as_v5": 5.741000, - "Standard_D96as_v5_Promo": 5.117000, - "Standard_D96d_v5": 7.488000, - "Standard_D96ds_v5": 7.488000, - "Standard_D96lds_v5": 6.490000, - "Standard_D96ls_v5": 5.678000, - "Standard_D96s_v5": 6.365000, - "Standard_DS11-1_v2": 0.223000, - "Standard_DS11_v2": 0.223000, - "Standard_DS11_v2_Promo": 0.223000, - "Standard_DS12-1_v2": 0.449000, - "Standard_DS12-2_v2": 0.449000, - "Standard_DS12_v2": 0.449000, - "Standard_DS12_v2_Promo": 0.449000, - "Standard_DS13-2_v2": 0.898000, - "Standard_DS13-4_v2": 0.898000, - "Standard_DS13_v2": 0.898000, - "Standard_DS13_v2_Promo": 0.898000, - "Standard_DS14-4_v2": 1.795000, - "Standard_DS14-8_v2": 1.795000, - "Standard_DS14_v2": 1.795000, - "Standard_DS14_v2_Promo": 1.795000, - "Standard_DS15_v2": 2.244000, - "Standard_DS15i_v2": 2.244000, - "Standard_DS1_v2": 0.088400, - "Standard_DS2_v2": 0.177000, - "Standard_DS2_v2_Promo": 0.177000, - "Standard_DS3_v2": 0.353000, - "Standard_DS3_v2_Promo": 0.353000, - "Standard_DS4_v2": 0.707000, - "Standard_DS4_v2_Promo": 0.707000, - "Standard_DS5_v2": 1.414000, - "Standard_DS5_v2_Promo": 1.414000, - "Standard_E104i_v5": 9.964000, - "Standard_E104id_v5": 11.303000, - "Standard_E104ids_v5": 11.303000, - "Standard_E104is_v5": 9.964000, - "Standard_E112iads_v5": 11.131000, - "Standard_E112ias_v5": 9.690000, - "Standard_E112ibds_v5": 14.214000, - "Standard_E112ibs_v5": 12.773000, - "Standard_E16-4ads_v5": 1.446000, - "Standard_E16-4as_v4": 1.394000, - "Standard_E16-4as_v5": 1.258000, - "Standard_E16-4ds_v4": 1.581000, - "Standard_E16-4ds_v5": 1.581000, - "Standard_E16-4s_v3": 1.394000, - "Standard_E16-4s_v5": 1.394000, - "Standard_E16-8ads_v5": 1.446000, - "Standard_E16-8as_v4": 1.394000, - "Standard_E16-8as_v5": 1.258000, - "Standard_E16-8ds_v4": 1.581000, - "Standard_E16-8ds_v5": 1.581000, - "Standard_E16-8s_v3": 1.394000, - "Standard_E16-8s_v5": 1.394000, - "Standard_E16_v3": 1.394000, - "Standard_E16_v5": 1.394000, - "Standard_E16a_v4": 1.394000, - "Standard_E16ads_v5": 1.446000, - "Standard_E16as_v4": 1.394000, - "Standard_E16as_v5": 1.258000, - "Standard_E16bds_v5": 1.846000, - "Standard_E16bs_v5": 1.659000, - "Standard_E16d_v4": 1.581000, - "Standard_E16d_v5": 1.581000, - "Standard_E16ds_v4": 1.581000, - "Standard_E16ds_v5": 1.581000, - "Standard_E16s_v3": 1.394000, - "Standard_E16s_v5": 1.394000, - "Standard_E20_v3": 1.742000, - "Standard_E20_v5": 1.742000, - "Standard_E20a_v4": 1.742000, - "Standard_E20ads_v5": 1.807000, - "Standard_E20as_v4": 1.742000, - "Standard_E20as_v5": 1.573000, - "Standard_E20d_v4": 1.976000, - "Standard_E20d_v5": 1.976000, - "Standard_E20ds_v4": 1.976000, - "Standard_E20ds_v5": 1.976000, - "Standard_E20s_v3": 1.742000, - "Standard_E20s_v5": 1.742000, - "Standard_E2_v3": 0.174000, - "Standard_E2_v5": 0.174000, - "Standard_E2a_v4": 0.174000, - "Standard_E2ads_v5": 0.181000, - "Standard_E2as_v4": 0.174000, - "Standard_E2as_v5": 0.157000, - "Standard_E2bds_v5": 0.231000, - "Standard_E2bs_v5": 0.207000, - "Standard_E2d_v4": 0.198000, - "Standard_E2d_v5": 0.198000, - "Standard_E2ds_v4": 0.198000, - "Standard_E2ds_v5": 0.198000, - "Standard_E2s_v3": 0.174000, - "Standard_E2s_v5": 0.174000, - "Standard_E32-16ads_v5": 2.891000, - "Standard_E32-16as_v4": 2.787000, - "Standard_E32-16as_v5": 2.517000, - "Standard_E32-16ds_v4": 3.162000, - "Standard_E32-16ds_v5": 3.162000, - "Standard_E32-16s_v3": 2.787000, - "Standard_E32-16s_v5": 2.787000, - "Standard_E32-8ads_v5": 2.891000, - "Standard_E32-8as_v4": 2.787000, - "Standard_E32-8as_v5": 2.517000, - "Standard_E32-8ds_v4": 3.162000, - "Standard_E32-8ds_v5": 3.162000, - "Standard_E32-8s_v3": 2.787000, - "Standard_E32-8s_v5": 2.787000, - "Standard_E32_v3": 2.787000, - "Standard_E32_v5": 2.787000, - "Standard_E32a_v4": 2.787000, - "Standard_E32ads_v5": 2.891000, - "Standard_E32as_v4": 2.787000, - "Standard_E32as_v5": 2.517000, - "Standard_E32bds_v5": 3.692000, - "Standard_E32bs_v5": 3.318000, - "Standard_E32d_v4": 3.162000, - "Standard_E32d_v5": 3.162000, - "Standard_E32ds_v4": 3.162000, - "Standard_E32ds_v5": 3.162000, - "Standard_E32s_v3": 2.787000, - "Standard_E32s_v5": 2.787000, - "Standard_E4-2ads_v5": 0.361000, - "Standard_E4-2as_v4": 0.348000, - "Standard_E4-2as_v5": 0.315000, - "Standard_E4-2ds_v4": 0.395000, - "Standard_E4-2ds_v5": 0.395000, - "Standard_E4-2s_v3": 0.348000, - "Standard_E4-2s_v5": 0.348000, - "Standard_E48_v3": 4.181000, - "Standard_E48_v5": 4.181000, - "Standard_E48a_v4": 4.181000, - "Standard_E48ads_v5": 4.337000, - "Standard_E48as_v4": 4.181000, - "Standard_E48as_v5": 3.775000, - "Standard_E48bds_v5": 5.538000, - "Standard_E48bs_v5": 4.976000, - "Standard_E48d_v4": 4.742000, - "Standard_E48d_v5": 4.742000, - "Standard_E48ds_v4": 4.742000, - "Standard_E48ds_v5": 4.742000, - "Standard_E48s_v3": 4.181000, - "Standard_E48s_v5": 4.181000, - "Standard_E4_v3": 0.348000, - "Standard_E4_v5": 0.348000, - "Standard_E4a_v4": 0.348000, - "Standard_E4ads_v5": 0.361000, - "Standard_E4as_v4": 0.348000, - "Standard_E4as_v5": 0.315000, - "Standard_E4bds_v5": 0.462000, - "Standard_E4bs_v5": 0.415000, - "Standard_E4d_v4": 0.395000, - "Standard_E4d_v5": 0.395000, - "Standard_E4ds_v4": 0.395000, - "Standard_E4ds_v5": 0.395000, - "Standard_E4s_v3": 0.348000, - "Standard_E4s_v5": 0.348000, - "Standard_E64-16ads_v5": 5.782000, - "Standard_E64-16as_v4": 5.574000, - "Standard_E64-16as_v5": 5.034000, - "Standard_E64-16ds_v4": 6.323000, - "Standard_E64-16ds_v5": 6.323000, - "Standard_E64-16s_v3": 5.574000, - "Standard_E64-16s_v5": 5.574000, - "Standard_E64-32ads_v5": 5.782000, - "Standard_E64-32as_v4": 5.574000, - "Standard_E64-32as_v5": 5.034000, - "Standard_E64-32ds_v4": 6.323000, - "Standard_E64-32ds_v5": 6.323000, - "Standard_E64-32s_v3": 5.574000, - "Standard_E64-32s_v5": 5.574000, - "Standard_E64_v3": 5.574000, - "Standard_E64_v5": 5.574000, - "Standard_E64a_v4": 5.574000, - "Standard_E64ads_v5": 5.782000, - "Standard_E64as_v4": 5.574000, - "Standard_E64as_v5": 5.034000, - "Standard_E64bds_v5": 7.384000, - "Standard_E64bs_v5": 6.635000, - "Standard_E64d_v4": 6.323000, - "Standard_E64d_v5": 6.323000, - "Standard_E64ds_v4": 6.323000, - "Standard_E64ds_v5": 6.323000, - "Standard_E64i_v3": 5.574000, - "Standard_E64is_v3": 5.574000, - "Standard_E64s_v3": 5.574000, - "Standard_E64s_v5": 5.574000, - "Standard_E8-2ads_v5": 0.723000, - "Standard_E8-2as_v4": 0.697000, - "Standard_E8-2as_v5": 0.629000, - "Standard_E8-2ds_v4": 0.790000, - "Standard_E8-2ds_v5": 0.790000, - "Standard_E8-2s_v3": 0.697000, - "Standard_E8-2s_v5": 0.697000, - "Standard_E8-4ads_v5": 0.723000, - "Standard_E8-4as_v4": 0.697000, - "Standard_E8-4as_v5": 0.629000, - "Standard_E8-4ds_v4": 0.790000, - "Standard_E8-4ds_v5": 0.790000, - "Standard_E8-4s_v3": 0.697000, - "Standard_E8-4s_v5": 0.697000, - "Standard_E80ids_v4": 7.904000, - "Standard_E8_v3": 0.697000, - "Standard_E8_v5": 0.697000, - "Standard_E8a_v4": 0.697000, - "Standard_E8ads_v5": 0.723000, - "Standard_E8as_v4": 0.697000, - "Standard_E8as_v5": 0.629000, - "Standard_E8bds_v5": 0.923000, - "Standard_E8bs_v5": 0.829000, - "Standard_E8d_v4": 0.790000, - "Standard_E8d_v5": 0.790000, - "Standard_E8ds_v4": 0.790000, - "Standard_E8ds_v5": 0.790000, - "Standard_E8s_v3": 0.697000, - "Standard_E8s_v5": 0.697000, - "Standard_E96-24ads_v5": 8.674000, - "Standard_E96-24as_v4": 8.362000, - "Standard_E96-24as_v5": 7.550000, - "Standard_E96-24ds_v5": 9.485000, - "Standard_E96-24s_v5": 8.362000, - "Standard_E96-48ads_v5": 8.674000, - "Standard_E96-48as_v4": 8.362000, - "Standard_E96-48as_v5": 7.550000, - "Standard_E96-48ds_v5": 9.485000, - "Standard_E96-48s_v5": 8.362000, - "Standard_E96_v5": 8.362000, - "Standard_E96a_v4": 8.362000, - "Standard_E96ads_v5": 8.674000, - "Standard_E96as_v4": 8.362000, - "Standard_E96as_v5": 7.550000, - "Standard_E96bds_v5": 11.076000, - "Standard_E96bs_v5": 9.953000, - "Standard_E96d_v5": 9.485000, - "Standard_E96ds_v5": 9.485000, - "Standard_E96iads_v5": 9.541000, - "Standard_E96ias_v4": 8.362000, - "Standard_E96ias_v5": 8.305000, - "Standard_E96s_v5": 8.362000, - "Standard_F1": 0.073900, - "Standard_F16": 1.182000, - "Standard_F16s": 1.182000, - "Standard_F16s_v2": 0.952000, - "Standard_F1s": 0.073900, - "Standard_F2": 0.148000, - "Standard_F2s": 0.148000, - "Standard_F2s_v2": 0.119000, - "Standard_F32s_v2": 1.904000, - "Standard_F4": 0.295000, - "Standard_F48s_v2": 2.856000, - "Standard_F4s": 0.295000, - "Standard_F4s_v2": 0.238000, - "Standard_F64s_v2": 3.808000, - "Standard_F72s_v2": 4.284000, - "Standard_F8": 0.591000, - "Standard_F8s": 0.591000, - "Standard_F8s_v2": 0.476000, - "Standard_L16as_v3": 1.695000, - "Standard_L16s_v3": 1.893000, - "Standard_L32as_v3": 3.390000, - "Standard_L32s_v3": 3.786000, - "Standard_L48as_v3": 5.086000, - "Standard_L48s_v3": 5.678000, - "Standard_L64as_v3": 6.781000, - "Standard_L64s_v3": 7.571000, - "Standard_L80as_v3": 8.476000, - "Standard_L80s_v3": 9.464000, - "Standard_L8as_v3": 0.848000, - "Standard_L8s_v3": 0.946000, - } - // switzerlandnorth - initialOnDemandPrices["switzerlandnorth"] = map[string]float64{ - "DCdsv3 Type1": 8.950000, - "DCsv3 Type1": 7.603000, - "Dadsv5_Type1": 9.073000, - "Dasv4_Type1": 7.550000, - "Dasv4_Type2": 7.550000, - "Ddsv4_Type2": 7.085000, - "Ddsv5_Type1": 7.899000, - "Dsv3_Type3": 5.566000, - "Dsv3_Type4": 6.866000, - "Dsv4_Type2": 7.920000, - "Dsv5_Type1": 6.958000, - "Easv4_Type1": 9.514000, - "Easv4_Type2": 9.514000, - "Easv5_Type1": 8.532000, - "Ebdsv5-Type1": 8.406000, - "Ebsv5-Type1": 7.500000, - "Edsv4_Type 1": 6.699000, - "Edsv4_Type2": 9.029000, - "Edsv5_Type1": 10.032000, - "Esv3_Type3": 5.586000, - "Esv3_Type4": 7.568000, - "Esv4_Type1": 5.886100, - "Esv5_Type1": 8.818000, - "Fsv2 Type3": 4.929100, - "Fsv2_Type2": 4.225100, - "Fsv2_Type4": 6.078000, - "Lsv3_Type1": 10.980000, - "Mdsmv2MedMem _Type1": 45.213300, - "Mdsv2MedMem_Type1": 22.598400, - "Msmv2MedMem Type1": 44.500500, - "Msv2MedMem Type1": 21.885600, - "Msv2_Type1": 85.079000, - "NDamsrA100v4_Type1": 51.547000, - "Standard_A1_v2": 0.045100, - "Standard_A2_v2": 0.095700, - "Standard_A2m_v2": 0.136400, - "Standard_A4_v2": 0.197000, - "Standard_A4m_v2": 0.286000, - "Standard_A8_v2": 0.394000, - "Standard_A8m_v2": 0.595000, - "Standard_B12ms": 0.633600, - "Standard_B16als_v2": 0.747000, - "Standard_B16as_v2": 0.834000, - "Standard_B16ls_v2": 0.748000, - "Standard_B16ms": 0.844800, - "Standard_B16s_v2": 0.845000, - "Standard_B1ls": 0.006600, - "Standard_B1ms": 0.026400, - "Standard_B1s": 0.013200, - "Standard_B2als_v2": 0.047500, - "Standard_B2as_v2": 0.104000, - "Standard_B2ats_v2": 0.011900, - "Standard_B2ms": 0.105600, - "Standard_B2s": 0.052800, - "Standard_B2s_v2": 0.106000, - "Standard_B2ts_v2": 0.022400, - "Standard_B32als_v2": 1.494000, - "Standard_B32as_v2": 1.668000, - "Standard_B32ls_v2": 1.643000, - "Standard_B32s_v2": 1.837000, - "Standard_B4als_v2": 0.168000, - "Standard_B4as_v2": 0.208000, - "Standard_B4ls_v2": 0.187000, - "Standard_B4ms": 0.211200, - "Standard_B4s_v2": 0.230000, - "Standard_B8als_v2": 0.374000, - "Standard_B8as_v2": 0.417000, - "Standard_B8s_v2": 0.422000, - "Standard_D11_v2": 0.209000, - "Standard_D12_v2": 0.416900, - "Standard_D13_v2": 0.834900, - "Standard_D14_v2": 1.669800, - "Standard_D15_v2": 2.086700, - "Standard_D15i_v2": 2.086700, - "Standard_D16_v3": 1.056000, - "Standard_D16_v4": 1.012000, - "Standard_D16a_v4": 1.098000, - "Standard_D16ads_v5": 1.178000, - "Standard_D16as_v4": 1.098000, - "Standard_D16as_v5": 0.984000, - "Standard_D16d_v4": 1.196800, - "Standard_D16d_v5": 1.197000, - "Standard_D16ds_v4": 1.196800, - "Standard_D16ds_v5": 1.197000, - "Standard_D16lds_v5": 1.098000, - "Standard_D16ls_v5": 0.972000, - "Standard_D16s_v3": 1.056000, - "Standard_D16s_v4": 1.012000, - "Standard_D16s_v5": 1.012000, - "Standard_D1_v2": 0.074690, - "Standard_D2_v2": 0.149600, - "Standard_D2_v3": 0.132000, - "Standard_D2_v4": 0.126500, - "Standard_D2_v5": 0.127000, - "Standard_D2ads_v5": 0.147000, - "Standard_D2as_v4": 0.137000, - "Standard_D2d_v4": 0.149600, - "Standard_D2ds_v4": 0.149600, - "Standard_D2ds_v5": 0.150000, - "Standard_D2lds_v5": 0.137000, - "Standard_D2ls_v5": 0.122000, - "Standard_D2s_v3": 0.132000, - "Standard_D2s_v4": 0.126500, - "Standard_D2s_v5": 0.127000, - "Standard_D32-16s_v3": 2.112000, - "Standard_D32-8s_v3": 2.112000, - "Standard_D32_v3": 2.112000, - "Standard_D32_v4": 2.024000, - "Standard_D32_v5": 2.024000, - "Standard_D32ads_v5": 2.357000, - "Standard_D32as_v4": 2.196000, - "Standard_D32as_v5": 1.968000, - "Standard_D32ds_v4": 2.393600, - "Standard_D32ds_v5": 2.394000, - "Standard_D32lds_v5": 2.196000, - "Standard_D32s_v3": 2.112000, - "Standard_D32s_v4": 2.024000, - "Standard_D32s_v5": 2.024000, - "Standard_D48_v3": 3.168000, - "Standard_D48_v4": 3.036000, - "Standard_D48_v5": 3.036000, - "Standard_D48a_v4": 3.295000, - "Standard_D48ads_v5": 3.535000, - "Standard_D48as_v4": 3.295000, - "Standard_D48as_v5": 2.952000, - "Standard_D48d_v4": 3.590400, - "Standard_D48d_v5": 3.590000, - "Standard_D48ds_v4": 3.590400, - "Standard_D48ds_v5": 3.590000, - "Standard_D48ls_v5": 2.917000, - "Standard_D48s_v3": 3.168000, - "Standard_D48s_v4": 3.036000, - "Standard_D48s_v5": 3.036000, - "Standard_D4_v2": 0.598400, - "Standard_D4_v3": 0.264000, - "Standard_D4_v4": 0.253000, - "Standard_D4_v5": 0.253000, - "Standard_D4ads_v5": 0.295000, - "Standard_D4as_v5": 0.246000, - "Standard_D4d_v4": 0.299200, - "Standard_D4d_v5": 0.299000, - "Standard_D4ds_v4": 0.299200, - "Standard_D4ds_v5": 0.299000, - "Standard_D4lds_v5": 0.275000, - "Standard_D4ls_v5": 0.243000, - "Standard_D4s_v3": 0.264000, - "Standard_D4s_v4": 0.253000, - "Standard_D4s_v5": 0.253000, - "Standard_D5_v2": 1.195700, - "Standard_D64-16s_v3": 4.224000, - "Standard_D64-32s_v3": 4.224000, - "Standard_D64_v3": 4.224000, - "Standard_D64_v4": 4.048000, - "Standard_D64_v5": 4.048000, - "Standard_D64a_v4": 4.393000, - "Standard_D64ads_v5": 4.713000, - "Standard_D64as_v4": 4.393000, - "Standard_D64as_v5": 3.935000, - "Standard_D64d_v5": 4.787000, - "Standard_D64ds_v4": 4.787200, - "Standard_D64ds_v5": 4.787000, - "Standard_D64lds_v5": 4.393000, - "Standard_D64ls_v5": 3.890000, - "Standard_D64s_v3": 4.224000, - "Standard_D64s_v5": 4.048000, - "Standard_D8_v3": 0.528000, - "Standard_D8_v5": 0.506000, - "Standard_D8a_v4": 0.549000, - "Standard_D8ads_v5": 0.589000, - "Standard_D8as_v4": 0.549000, - "Standard_D8d_v4": 0.598400, - "Standard_D8d_v5": 0.598000, - "Standard_D8ds_v4": 0.598400, - "Standard_D8ds_v5": 0.598000, - "Standard_D8ls_v5": 0.486000, - "Standard_D8s_v3": 0.528000, - "Standard_D8s_v4": 0.506000, - "Standard_D8s_v5": 0.506000, - "Standard_D96_v5": 6.072000, - "Standard_D96a_v4": 6.589000, - "Standard_D96ads_v5": 7.070000, - "Standard_D96as_v5": 5.903000, - "Standard_D96d_v5": 7.181000, - "Standard_D96ds_v5": 7.181000, - "Standard_D96lds_v5": 6.589000, - "Standard_D96s_v5": 6.072000, - "Standard_DC16ads_v5": 1.178000, - "Standard_DC16as_v5": 0.984000, - "Standard_DC16ds_v3": 2.712000, - "Standard_DC16s_v3": 2.304000, - "Standard_DC1ds_v3": 0.170000, - "Standard_DC24ds_v3": 4.068000, - "Standard_DC2ads_v5": 0.147000, - "Standard_DC2ds_v3": 0.339000, - "Standard_DC2s_v3": 0.288000, - "Standard_DC32as_v5": 1.968000, - "Standard_DC32ds_v3": 5.424000, - "Standard_DC32s_v3": 4.608000, - "Standard_DC48as_v5": 2.952000, - "Standard_DC48ds_v3": 8.136000, - "Standard_DC48s_v3": 6.912000, - "Standard_DC4ads_v5": 0.295000, - "Standard_DC4as_v5": 0.246000, - "Standard_DC4ds_v3": 0.678000, - "Standard_DC4s_v3": 0.576000, - "Standard_DC64ads_v5": 4.713000, - "Standard_DC64as_v5": 3.935000, - "Standard_DC8ads_v5": 0.589000, - "Standard_DC8as_v5": 0.492000, - "Standard_DC8s_v3": 1.152000, - "Standard_DC96ads_v5": 7.070000, - "Standard_DC96as_v5": 5.903000, - "Standard_DS11-1_v2": 0.209000, - "Standard_DS11_v2": 0.209000, - "Standard_DS11_v2_Promo": 0.282125, - "Standard_DS12-1_v2": 0.416900, - "Standard_DS12-2_v2": 0.416900, - "Standard_DS12_v2": 0.416900, - "Standard_DS12_v2_Promo": 0.565775, - "Standard_DS13-2_v2": 0.834900, - "Standard_DS13-4_v2": 0.834900, - "Standard_DS13_v2_Promo": 1.130025, - "Standard_DS14-4_v2": 1.669800, - "Standard_DS14-8_v2": 1.669800, - "Standard_DS15_v2": 2.086700, - "Standard_DS15i_v2": 2.086700, - "Standard_DS1_v2": 0.074690, - "Standard_DS2_v2": 0.149600, - "Standard_DS2_v2_Promo": 0.208050, - "Standard_DS3_v2": 0.299200, - "Standard_DS3_v2_Promo": 0.343000, - "Standard_DS4_v2": 0.598400, - "Standard_DS5_v2": 1.195700, - "Standard_E104i_v5": 11.243000, - "Standard_E104ids_v5": 10.868000, - "Standard_E104is_v5": 9.552000, - "Standard_E112iads_v5": 11.540000, - "Standard_E112ias_v5": 9.954000, - "Standard_E112ibds_v5": 14.711000, - "Standard_E112ibs_v5": 13.125000, - "Standard_E16-4ads_v5": 1.499000, - "Standard_E16-4as_v4": 1.441000, - "Standard_E16-4as_v5": 1.293000, - "Standard_E16-4ds_v4": 1.522400, - "Standard_E16-4ds_v5": 1.520000, - "Standard_E16-4s_v3": 1.408000, - "Standard_E16-4s_v4": 1.337600, - "Standard_E16-8ads_v5": 1.499000, - "Standard_E16-8as_v5": 1.293000, - "Standard_E16-8ds_v4": 1.522400, - "Standard_E16-8ds_v5": 1.520000, - "Standard_E16-8s_v3": 1.408000, - "Standard_E16-8s_v4": 1.337600, - "Standard_E16-8s_v5": 1.336000, - "Standard_E16_v3": 1.408000, - "Standard_E16_v4": 1.337600, - "Standard_E16_v5": 1.338000, - "Standard_E16a_v4": 1.441000, - "Standard_E16ads_v5": 1.499000, - "Standard_E16as_v4": 1.441000, - "Standard_E16as_v5": 1.293000, - "Standard_E16bds_v5": 1.910000, - "Standard_E16bs_v5": 1.705000, - "Standard_E16d_v4": 1.522400, - "Standard_E16d_v5": 1.522000, - "Standard_E16ds_v4": 1.522400, - "Standard_E16ds_v5": 1.520000, - "Standard_E16s_v3": 1.408000, - "Standard_E16s_v4": 1.337600, - "Standard_E16s_v5": 1.336000, - "Standard_E20_v3": 1.760000, - "Standard_E20_v4": 1.672000, - "Standard_E20_v5": 1.672000, - "Standard_E20ads_v5": 1.873000, - "Standard_E20as_v4": 1.802000, - "Standard_E20as_v5": 1.616000, - "Standard_E20d_v4": 1.903000, - "Standard_E20d_v5": 1.903000, - "Standard_E20ds_v5": 1.900000, - "Standard_E20s_v3": 1.760000, - "Standard_E20s_v4": 1.672000, - "Standard_E20s_v5": 1.670000, - "Standard_E2_v4": 0.167200, - "Standard_E2_v5": 0.167000, - "Standard_E2a_v4": 0.180000, - "Standard_E2ads_v5": 0.187000, - "Standard_E2as_v4": 0.180000, - "Standard_E2as_v5": 0.162000, - "Standard_E2bs_v5": 0.213000, - "Standard_E2ds_v4": 0.190300, - "Standard_E2ds_v5": 0.190000, - "Standard_E2s_v4": 0.167200, - "Standard_E2s_v5": 0.167000, - "Standard_E32-16ads_v5": 2.997000, - "Standard_E32-16as_v4": 2.883000, - "Standard_E32-16ds_v4": 3.044800, - "Standard_E32-16ds_v5": 3.040000, - "Standard_E32-16s_v3": 2.816000, - "Standard_E32-16s_v4": 2.675200, - "Standard_E32-8ads_v5": 2.997000, - "Standard_E32-8as_v4": 2.883000, - "Standard_E32-8ds_v4": 3.044800, - "Standard_E32-8s_v3": 2.816000, - "Standard_E32-8s_v4": 2.675200, - "Standard_E32-8s_v5": 2.672000, - "Standard_E32_v3": 2.816000, - "Standard_E32_v4": 2.675200, - "Standard_E32_v5": 2.675000, - "Standard_E32a_v4": 2.883000, - "Standard_E32ads_v5": 2.997000, - "Standard_E32as_v4": 2.883000, - "Standard_E32as_v5": 2.585000, - "Standard_E32bds_v5": 3.821000, - "Standard_E32bs_v5": 3.409000, - "Standard_E32d_v5": 3.045000, - "Standard_E32ds_v5": 3.040000, - "Standard_E32s_v3": 2.816000, - "Standard_E32s_v4": 2.675200, - "Standard_E32s_v5": 2.672000, - "Standard_E4-2ads_v5": 0.375000, - "Standard_E4-2as_v4": 0.360000, - "Standard_E4-2as_v5": 0.323000, - "Standard_E4-2ds_v5": 0.380000, - "Standard_E4-2s_v3": 0.352000, - "Standard_E4-2s_v4": 0.334400, - "Standard_E4-2s_v5": 0.334000, - "Standard_E48_v3": 4.011700, - "Standard_E48_v4": 4.012800, - "Standard_E48_v5": 4.013000, - "Standard_E48a_v4": 4.324000, - "Standard_E48ads_v5": 4.496000, - "Standard_E48as_v4": 4.324000, - "Standard_E48as_v5": 3.878000, - "Standard_E48bds_v5": 5.731000, - "Standard_E48bs_v5": 5.114000, - "Standard_E48d_v4": 4.567200, - "Standard_E48d_v5": 4.567000, - "Standard_E48ds_v4": 4.567200, - "Standard_E48ds_v5": 4.560000, - "Standard_E48s_v3": 4.011700, - "Standard_E48s_v4": 4.012800, - "Standard_E48s_v5": 4.008000, - "Standard_E4_v3": 0.352000, - "Standard_E4_v4": 0.334400, - "Standard_E4_v5": 0.334000, - "Standard_E4a_v4": 0.360000, - "Standard_E4ads_v5": 0.375000, - "Standard_E4as_v5": 0.323000, - "Standard_E4bds_v5": 0.478000, - "Standard_E4bs_v5": 0.426000, - "Standard_E4d_v4": 0.380600, - "Standard_E4d_v5": 0.381000, - "Standard_E4ds_v4": 0.380600, - "Standard_E4ds_v5": 0.380000, - "Standard_E4s_v4": 0.334400, - "Standard_E4s_v5": 0.334000, - "Standard_E64-16ads_v5": 5.995000, - "Standard_E64-16as_v4": 5.766000, - "Standard_E64-16as_v5": 5.171000, - "Standard_E64-16ds_v4": 6.089600, - "Standard_E64-16ds_v5": 6.080000, - "Standard_E64-16s_v3": 4.813600, - "Standard_E64-32ads_v5": 5.995000, - "Standard_E64-32as_v4": 5.766000, - "Standard_E64-32as_v5": 5.171000, - "Standard_E64-32ds_v4": 6.089600, - "Standard_E64-32ds_v5": 6.080000, - "Standard_E64-32s_v3": 4.813600, - "Standard_E64-32s_v4": 5.350400, - "Standard_E64-32s_v5": 5.344000, - "Standard_E64_v5": 5.350000, - "Standard_E64a_v4": 5.766000, - "Standard_E64ads_v5": 5.995000, - "Standard_E64as_v4": 5.766000, - "Standard_E64as_v5": 5.171000, - "Standard_E64bds_v5": 7.642000, - "Standard_E64bs_v5": 6.818000, - "Standard_E64d_v5": 6.090000, - "Standard_E64ds_v4": 6.089600, - "Standard_E64ds_v5": 6.080000, - "Standard_E64is_v3": 4.813600, - "Standard_E64s_v3": 4.813600, - "Standard_E64s_v4": 5.350400, - "Standard_E64s_v5": 5.344000, - "Standard_E8-2ads_v5": 0.749000, - "Standard_E8-2as_v5": 0.646000, - "Standard_E8-2ds_v4": 0.761200, - "Standard_E8-2ds_v5": 0.760000, - "Standard_E8-2s_v3": 0.704000, - "Standard_E8-2s_v4": 0.668800, - "Standard_E8-2s_v5": 0.668000, - "Standard_E8-4ads_v5": 0.749000, - "Standard_E8-4as_v5": 0.646000, - "Standard_E8-4ds_v4": 0.761200, - "Standard_E8-4s_v3": 0.704000, - "Standard_E8-4s_v4": 0.668800, - "Standard_E8-4s_v5": 0.668000, - "Standard_E80ids_v4": 7.612000, - "Standard_E80is_v4": 6.688000, - "Standard_E8_v3": 0.704000, - "Standard_E8_v4": 0.668800, - "Standard_E8_v5": 0.669000, - "Standard_E8a_v4": 0.721000, - "Standard_E8ads_v5": 0.749000, - "Standard_E8as_v4": 0.721000, - "Standard_E8as_v5": 0.646000, - "Standard_E8bds_v5": 0.955000, - "Standard_E8bs_v5": 0.852000, - "Standard_E8d_v4": 0.761200, - "Standard_E8d_v5": 0.761000, - "Standard_E8ds_v4": 0.761200, - "Standard_E8ds_v5": 0.760000, - "Standard_E8s_v3": 0.704000, - "Standard_E8s_v4": 0.668800, - "Standard_E8s_v5": 0.668000, - "Standard_E96-24ads_v5": 8.992000, - "Standard_E96-24as_v4": 8.649000, - "Standard_E96-24as_v5": 7.756000, - "Standard_E96-24ds_v5": 9.120000, - "Standard_E96-48as_v4": 8.649000, - "Standard_E96-48ds_v5": 9.120000, - "Standard_E96-48s_v5": 8.016000, - "Standard_E96_v5": 8.026000, - "Standard_E96a_v4": 8.649000, - "Standard_E96ads_v5": 8.992000, - "Standard_E96as_v4": 8.649000, - "Standard_E96as_v5": 7.756000, - "Standard_E96bds_v5": 11.463000, - "Standard_E96bs_v5": 10.227000, - "Standard_E96d_v5": 9.134000, - "Standard_E96ds_v5": 9.120000, - "Standard_E96iads_v5": 9.891000, - "Standard_E96ias_v4": 8.649000, - "Standard_E96ias_v5": 8.532000, - "Standard_E96s_v5": 8.016000, - "Standard_EC16ads_v5": 1.499000, - "Standard_EC16as_v5": 1.293000, - "Standard_EC20ads_v5": 1.873000, - "Standard_EC20as_v5": 1.616000, - "Standard_EC2ads_v5": 0.187000, - "Standard_EC2as_v5": 0.162000, - "Standard_EC32ads_v5": 2.997000, - "Standard_EC32as_v5": 2.585000, - "Standard_EC48ads_v5": 4.496000, - "Standard_EC48as_v5": 3.878000, - "Standard_EC4ads_v5": 0.375000, - "Standard_EC4as_v5": 0.323000, - "Standard_EC64ads_v5": 5.995000, - "Standard_EC64as_v5": 5.171000, - "Standard_EC8ads_v5": 0.749000, - "Standard_EC8as_v5": 0.646000, - "Standard_EC96ads_v5": 8.992000, - "Standard_EC96as_v5": 7.756000, - "Standard_EC96iads_v5": 9.891000, - "Standard_EC96ias_v5": 8.532000, - "Standard_F1": 0.062480, - "Standard_F16": 0.999900, - "Standard_F16s_v2": 0.853600, - "Standard_F1s": 0.062480, - "Standard_F2": 0.125400, - "Standard_F2s_v2": 0.106700, - "Standard_F32s_v2": 1.707200, - "Standard_F4": 0.249700, - "Standard_F48s_v2": 2.560800, - "Standard_F4s": 0.249700, - "Standard_F4s_v2": 0.213400, - "Standard_F72s_v2": 3.841200, - "Standard_F8": 0.499400, - "Standard_L16as_v3": 1.785000, - "Standard_L16s_v3": 1.996000, - "Standard_L32as_v3": 3.569000, - "Standard_L32s_v3": 3.993000, - "Standard_L48as_v3": 5.354000, - "Standard_L48s_v3": 5.989000, - "Standard_L64as_v3": 7.139000, - "Standard_L64s_v3": 7.985000, - "Standard_L80s_v3": 9.981000, - "Standard_L8as_v3": 0.892000, - "Standard_L8s_v3": 0.998000, - "Standard_M128": 20.540300, - "Standard_M128-32ms": 41.099520, - "Standard_M128-64ms": 41.099520, - "Standard_M128dms_v2": 41.102600, - "Standard_M128ds_v2": 20.543600, - "Standard_M128ms": 41.099520, - "Standard_M128s_v2": 19.895700, - "Standard_M16-4ms": 4.732420, - "Standard_M16-8ms": 4.732420, - "Standard_M16ms": 4.732420, - "Standard_M16s": 3.675980, - "Standard_M192idms_v2": 49.377900, - "Standard_M192ids_v2": 24.689500, - "Standard_M192ims_v2": 48.730000, - "Standard_M192is_v2": 24.041600, - "Standard_M208-104ms_v2": 69.607000, - "Standard_M208-104s_v2": 34.804000, - "Standard_M208-52s_v2": 34.804000, - "Standard_M208ms_v2": 69.607000, - "Standard_M208s_v2": 34.804000, - "Standard_M32-16ms": 9.464840, - "Standard_M32-8ms": 9.464840, - "Standard_M32dms_v2": 9.464400, - "Standard_M32ls": 3.792360, - "Standard_M32ms": 9.464840, - "Standard_M32ms_v2": 9.302700, - "Standard_M32s": 5.135900, - "Standard_M416-104ms_v2": 154.670000, - "Standard_M416-104s_v2": 77.345000, - "Standard_M416-208s_v2": 77.345000, - "Standard_M416is_v2": 77.345000, - "Standard_M416s_8_v2": 94.540000, - "Standard_M416s_v2": 77.345000, - "Standard_M64": 10.270700, - "Standard_M64-16ms": 15.919200, - "Standard_M64-32ms": 15.919200, - "Standard_M64dms_v2": 15.923600, - "Standard_M64ds_v2": 10.270700, - "Standard_M64ls": 7.147800, - "Standard_M64m": 15.919200, - "Standard_M64ms": 15.919200, - "Standard_M64ms_v2": 15.599100, - "Standard_M64s": 10.270700, - "Standard_M64s_v2": 9.946200, - "Standard_M8-4ms": 2.366210, - "Standard_M8ms": 2.366210, - "Standard_NC12s_v3": 8.411000, - "Standard_NC24rs_v3": 18.503000, - "Standard_NC24s_v3": 16.821000, - "Standard_NC6s_v3": 4.205000, - "Standard_ND96ams_A100_v4": 46.861000, - "Standard_ND96amsr_A100_v4": 46.861000, - "Standard_NV12s_v3": 1.569000, - "Standard_NV48s_v3": 6.270000, - } - // switzerlandwest - initialOnDemandPrices["switzerlandwest"] = map[string]float64{ - "Dadsv5_Type1": 11.795000, - "Dasv4_Type1": 9.816000, - "Dasv4_Type2": 9.816000, - "Dasv5_Type1": 9.848000, - "Ddsv5_Type1": 10.276000, - "Dsv3_Type3": 5.915000, - "Dsv3_Type4": 7.394000, - "Dsv5_Type1": 9.035000, - "Eadsv5_Type1": 12.858000, - "Easv4_Type1": 12.368000, - "Easv4_Type2": 12.368000, - "Easv5_Type1": 11.092000, - "Ebdsv5-Type1": 10.928000, - "Ebsv5-Type1": 9.750000, - "Edsv5_Type1": 13.306000, - "Esv3_Type3": 6.016000, - "Esv3_Type4": 8.150000, - "Esv5_Type1": 11.669000, - "Fsv2_Type2": 4.549510, - "Lasv3_Type1": 12.760000, - "Lsv3_Type1": 14.273000, - "Ms_Type1": 32.037000, - "Msm_Type1": 64.129000, - "Msmv2_Type1": 221.400000, - "Msv2_Type1": 110.710000, - "Standard_A1_v2": 0.058670, - "Standard_A2_v2": 0.124490, - "Standard_A2m_v2": 0.176680, - "Standard_A4_v2": 0.256000, - "Standard_A4m_v2": 0.371420, - "Standard_A8_v2": 0.512000, - "Standard_A8m_v2": 0.774000, - "Standard_B12ms": 0.823130, - "Standard_B16als_v2": 0.875000, - "Standard_B16as_v2": 0.988000, - "Standard_B16ls_v2": 0.973000, - "Standard_B16ms": 1.097690, - "Standard_B16s_v2": 1.172000, - "Standard_B1ls": 0.008580, - "Standard_B1ms": 0.034280, - "Standard_B1s": 0.017140, - "Standard_B20ms": 1.371980, - "Standard_B2als_v2": 0.061800, - "Standard_B2as_v2": 0.133000, - "Standard_B2ats_v2": 0.024600, - "Standard_B2ls_v2": 0.068600, - "Standard_B2ms": 0.137740, - "Standard_B2s": 0.068660, - "Standard_B2s_v2": 0.146000, - "Standard_B2ts_v2": 0.026400, - "Standard_B32als_v2": 1.750000, - "Standard_B32as_v2": 2.124000, - "Standard_B32ls_v2": 2.092000, - "Standard_B32s_v2": 2.196000, - "Standard_B4als_v2": 0.237000, - "Standard_B4as_v2": 0.266000, - "Standard_B4ls_v2": 0.243000, - "Standard_B4ms": 0.275480, - "Standard_B4s_v2": 0.275000, - "Standard_B8als_v2": 0.475000, - "Standard_B8as_v2": 0.531000, - "Standard_B8ls_v2": 0.523000, - "Standard_B8ms": 0.548850, - "Standard_B8s_v2": 0.549000, - "Standard_D11_v2": 0.271330, - "Standard_D12_v2": 0.542150, - "Standard_D13_v2": 1.085740, - "Standard_D14_v2": 2.170560, - "Standard_D15_v2": 2.712710, - "Standard_D15i_v2": 2.712710, - "Standard_D16_v3": 1.373170, - "Standard_D16_v4": 1.315950, - "Standard_D16_v5": 1.314000, - "Standard_D16a_v4": 1.428000, - "Standard_D16ads_v5": 1.532000, - "Standard_D16as_v4": 1.428000, - "Standard_D16as_v5": 1.279000, - "Standard_D16as_v5_Promo": 1.145000, - "Standard_D16d_v4": 1.556020, - "Standard_D16d_v5": 1.557000, - "Standard_D16ds_v4": 1.556020, - "Standard_D16ds_v5": 1.557000, - "Standard_D16lds_v5": 1.428000, - "Standard_D16ls_v5": 1.264000, - "Standard_D16s_v3": 1.373170, - "Standard_D16s_v4": 1.315950, - "Standard_D16s_v5": 1.314000, - "Standard_D1_v2": 0.097020, - "Standard_D2_v2": 0.194570, - "Standard_D2_v3": 0.171420, - "Standard_D2_v4": 0.164270, - "Standard_D2_v5": 0.164000, - "Standard_D2a_v4": 0.178000, - "Standard_D2ads_v5": 0.191000, - "Standard_D2as_v4": 0.178000, - "Standard_D2as_v5": 0.160000, - "Standard_D2as_v5_Promo": 0.143000, - "Standard_D2d_v4": 0.193600, - "Standard_D2d_v5": 0.194000, - "Standard_D2ds_v4": 0.193600, - "Standard_D2ds_v5": 0.194000, - "Standard_D2lds_v5": 0.178000, - "Standard_D2ls_v5": 0.158000, - "Standard_D2s_v3": 0.171420, - "Standard_D2s_v4": 0.164270, - "Standard_D2s_v5": 0.164000, - "Standard_D32-16s_v3": 2.745420, - "Standard_D32-8s_v3": 2.745420, - "Standard_D32_v3": 2.745420, - "Standard_D32_v4": 2.631020, - "Standard_D32_v5": 2.628000, - "Standard_D32a_v4": 2.855000, - "Standard_D32ads_v5": 3.064000, - "Standard_D32as_v4": 2.855000, - "Standard_D32as_v5": 2.558000, - "Standard_D32as_v5_Promo": 2.290000, - "Standard_D32d_v4": 3.112030, - "Standard_D32d_v5": 3.114000, - "Standard_D32ds_v4": 3.112030, - "Standard_D32ds_v5": 3.114000, - "Standard_D32lds_v5": 2.855000, - "Standard_D32ls_v5": 2.528000, - "Standard_D32s_v3": 2.745420, - "Standard_D32s_v4": 2.631020, - "Standard_D32s_v5": 2.628000, - "Standard_D3_v2": 0.389140, - "Standard_D48_v3": 4.118580, - "Standard_D48_v4": 3.946980, - "Standard_D48_v5": 3.943000, - "Standard_D48a_v4": 4.283000, - "Standard_D48ads_v5": 4.595000, - "Standard_D48as_v4": 4.283000, - "Standard_D48as_v5": 3.837000, - "Standard_D48as_v5_Promo": 3.435000, - "Standard_D48d_v4": 4.667170, - "Standard_D48d_v5": 4.671000, - "Standard_D48ds_v4": 4.667170, - "Standard_D48ds_v5": 4.671000, - "Standard_D48lds_v5": 4.283000, - "Standard_D48ls_v5": 3.792000, - "Standard_D48s_v3": 4.118580, - "Standard_D48s_v4": 3.946980, - "Standard_D48s_v5": 3.943000, - "Standard_D4_v2": 0.778010, - "Standard_D4_v3": 0.342830, - "Standard_D4_v4": 0.328550, - "Standard_D4_v5": 0.329000, - "Standard_D4a_v4": 0.357000, - "Standard_D4ads_v5": 0.383000, - "Standard_D4as_v4": 0.357000, - "Standard_D4as_v5": 0.320000, - "Standard_D4as_v5_Promo": 0.286000, - "Standard_D4d_v4": 0.389220, - "Standard_D4d_v5": 0.389000, - "Standard_D4ds_v4": 0.389220, - "Standard_D4ds_v5": 0.389000, - "Standard_D4lds_v5": 0.357000, - "Standard_D4ls_v5": 0.316000, - "Standard_D4s_v3": 0.342830, - "Standard_D4s_v4": 0.328550, - "Standard_D4s_v5": 0.329000, - "Standard_D5_v2": 1.553680, - "Standard_D64-16s_v3": 5.490830, - "Standard_D64-32s_v3": 5.490830, - "Standard_D64_v3": 5.490830, - "Standard_D64_v4": 5.262050, - "Standard_D64_v5": 5.257000, - "Standard_D64a_v4": 5.711000, - "Standard_D64ads_v5": 6.127000, - "Standard_D64as_v4": 5.711000, - "Standard_D64as_v5": 5.116000, - "Standard_D64as_v5_Promo": 4.581000, - "Standard_D64d_v4": 6.223180, - "Standard_D64d_v5": 6.228000, - "Standard_D64ds_v4": 6.223180, - "Standard_D64ds_v5": 6.228000, - "Standard_D64lds_v5": 5.711000, - "Standard_D64ls_v5": 5.057000, - "Standard_D64s_v3": 5.490830, - "Standard_D64s_v4": 5.262050, - "Standard_D64s_v5": 5.257000, - "Standard_D8_v3": 0.686580, - "Standard_D8_v4": 0.657980, - "Standard_D8_v5": 0.657000, - "Standard_D8a_v4": 0.714000, - "Standard_D8ads_v5": 0.766000, - "Standard_D8as_v4": 0.714000, - "Standard_D8as_v5": 0.639000, - "Standard_D8as_v5_Promo": 0.573000, - "Standard_D8d_v4": 0.777570, - "Standard_D8d_v5": 0.778000, - "Standard_D8ds_v4": 0.777570, - "Standard_D8ds_v5": 0.778000, - "Standard_D8lds_v5": 0.714000, - "Standard_D8ls_v5": 0.632000, - "Standard_D8s_v3": 0.686580, - "Standard_D8s_v4": 0.657980, - "Standard_D8s_v5": 0.657000, - "Standard_D96_v5": 7.885000, - "Standard_D96a_v4": 8.566000, - "Standard_D96ads_v5": 9.191000, - "Standard_D96as_v4": 8.566000, - "Standard_D96as_v5": 7.674000, - "Standard_D96as_v5_Promo": 6.871000, - "Standard_D96d_v5": 9.341000, - "Standard_D96ds_v5": 9.341000, - "Standard_D96lds_v5": 8.566000, - "Standard_D96ls_v5": 7.585000, - "Standard_D96s_v5": 7.885000, - "Standard_DS11-1_v2": 0.271330, - "Standard_DS11_v2": 0.271330, - "Standard_DS12-1_v2": 0.542150, - "Standard_DS12-2_v2": 0.542150, - "Standard_DS12_v2": 0.542150, - "Standard_DS13-2_v2": 1.085740, - "Standard_DS13-4_v2": 1.085740, - "Standard_DS13_v2": 1.085740, - "Standard_DS14-4_v2": 2.170560, - "Standard_DS14-8_v2": 2.170560, - "Standard_DS14_v2": 2.170560, - "Standard_DS15_v2": 2.712710, - "Standard_DS15i_v2": 2.712710, - "Standard_DS1_v2": 0.097020, - "Standard_DS2_v2": 0.194570, - "Standard_DS3_v2": 0.389140, - "Standard_DS4_v2": 0.778010, - "Standard_DS5_v2": 1.553680, - "Standard_E104i_v5": 14.616000, - "Standard_E104id_v5": 16.704000, - "Standard_E104ids_v5": 14.414000, - "Standard_E104is_v5": 12.641000, - "Standard_E112iads_v5": 15.001000, - "Standard_E112ias_v5": 12.940000, - "Standard_E112ibds_v5": 19.124000, - "Standard_E112ibs_v5": 17.063000, - "Standard_E16-4ads_v5": 1.948000, - "Standard_E16-4as_v4": 1.874000, - "Standard_E16-4as_v5": 1.681000, - "Standard_E16-4ds_v4": 2.010480, - "Standard_E16-4ds_v5": 2.016000, - "Standard_E16-4s_v3": 1.830580, - "Standard_E16-4s_v4": 1.766660, - "Standard_E16-4s_v5": 1.768000, - "Standard_E16-8ads_v5": 1.948000, - "Standard_E16-8as_v4": 1.874000, - "Standard_E16-8as_v5": 1.681000, - "Standard_E16-8ds_v4": 2.010480, - "Standard_E16-8ds_v5": 2.016000, - "Standard_E16-8s_v3": 1.830580, - "Standard_E16-8s_v4": 1.766660, - "Standard_E16-8s_v5": 1.768000, - "Standard_E16_v3": 1.830580, - "Standard_E16_v4": 1.766660, - "Standard_E16_v5": 1.769000, - "Standard_E16a_v4": 1.874000, - "Standard_E16ads_v5": 1.948000, - "Standard_E16as_v4": 1.874000, - "Standard_E16as_v5": 1.681000, - "Standard_E16bds_v5": 2.484000, - "Standard_E16bs_v5": 2.216000, - "Standard_E16d_v4": 2.010480, - "Standard_E16d_v5": 2.016000, - "Standard_E16ds_v4": 2.010480, - "Standard_E16ds_v5": 2.016000, - "Standard_E16s_v3": 1.830580, - "Standard_E16s_v4": 1.766660, - "Standard_E16s_v5": 1.768000, - "Standard_E20_v3": 2.288000, - "Standard_E20_v4": 2.208100, - "Standard_E20_v5": 2.212000, - "Standard_E20a_v4": 2.342000, - "Standard_E20ads_v5": 2.435000, - "Standard_E20as_v4": 2.342000, - "Standard_E20as_v5": 2.101000, - "Standard_E20d_v4": 2.513550, - "Standard_E20d_v5": 2.520000, - "Standard_E20ds_v4": 2.513550, - "Standard_E20ds_v5": 2.520000, - "Standard_E20s_v3": 2.288000, - "Standard_E20s_v4": 2.208100, - "Standard_E20s_v5": 2.210000, - "Standard_E2_v3": 0.229170, - "Standard_E2_v4": 0.221160, - "Standard_E2_v5": 0.221000, - "Standard_E2a_v4": 0.234000, - "Standard_E2ads_v5": 0.244000, - "Standard_E2as_v4": 0.234000, - "Standard_E2as_v5": 0.210000, - "Standard_E2bds_v5": 0.310000, - "Standard_E2bs_v5": 0.277000, - "Standard_E2d_v4": 0.251090, - "Standard_E2d_v5": 0.252000, - "Standard_E2ds_v4": 0.251090, - "Standard_E2ds_v5": 0.252000, - "Standard_E2s_v3": 0.229170, - "Standard_E2s_v4": 0.221160, - "Standard_E2s_v5": 0.221000, - "Standard_E32-16ads_v5": 3.896000, - "Standard_E32-16as_v4": 3.748000, - "Standard_E32-16as_v5": 3.361000, - "Standard_E32-16ds_v4": 4.020970, - "Standard_E32-16ds_v5": 4.032000, - "Standard_E32-16s_v3": 3.661170, - "Standard_E32-16s_v4": 3.533320, - "Standard_E32-16s_v5": 3.536000, - "Standard_E32-8ads_v5": 3.896000, - "Standard_E32-8as_v4": 3.748000, - "Standard_E32-8as_v5": 3.361000, - "Standard_E32-8ds_v4": 4.020970, - "Standard_E32-8ds_v5": 4.032000, - "Standard_E32-8s_v3": 3.661170, - "Standard_E32-8s_v4": 3.533320, - "Standard_E32-8s_v5": 3.536000, - "Standard_E32_v3": 3.661170, - "Standard_E32_v4": 3.533320, - "Standard_E32_v5": 3.539000, - "Standard_E32a_v4": 3.748000, - "Standard_E32ads_v5": 3.896000, - "Standard_E32as_v4": 3.748000, - "Standard_E32as_v5": 3.361000, - "Standard_E32bds_v5": 4.967000, - "Standard_E32bs_v5": 4.432000, - "Standard_E32d_v4": 4.020970, - "Standard_E32d_v5": 4.032000, - "Standard_E32ds_v4": 4.020970, - "Standard_E32ds_v5": 4.032000, - "Standard_E32s_v3": 3.661170, - "Standard_E32s_v4": 3.533320, - "Standard_E32s_v5": 3.536000, - "Standard_E4-2ads_v5": 0.487000, - "Standard_E4-2as_v4": 0.468000, - "Standard_E4-2as_v5": 0.420000, - "Standard_E4-2ds_v4": 0.503060, - "Standard_E4-2ds_v5": 0.504000, - "Standard_E4-2s_v3": 0.457420, - "Standard_E4-2s_v4": 0.441440, - "Standard_E4-2s_v5": 0.442000, - "Standard_E48_v3": 5.215730, - "Standard_E48_v4": 5.299970, - "Standard_E48_v5": 5.308000, - "Standard_E48a_v4": 5.622000, - "Standard_E48ads_v5": 5.845000, - "Standard_E48as_v4": 5.622000, - "Standard_E48as_v5": 5.042000, - "Standard_E48bds_v5": 7.451000, - "Standard_E48bs_v5": 6.648000, - "Standard_E48d_v4": 6.031450, - "Standard_E48d_v5": 6.047000, - "Standard_E48ds_v4": 6.031450, - "Standard_E48ds_v5": 6.048000, - "Standard_E48s_v3": 5.215730, - "Standard_E48s_v4": 5.299970, - "Standard_E48s_v5": 5.304000, - "Standard_E4_v3": 0.457420, - "Standard_E4_v4": 0.441440, - "Standard_E4_v5": 0.442000, - "Standard_E4a_v4": 0.468000, - "Standard_E4ads_v5": 0.487000, - "Standard_E4as_v4": 0.468000, - "Standard_E4as_v5": 0.420000, - "Standard_E4bds_v5": 0.621000, - "Standard_E4bs_v5": 0.554000, - "Standard_E4d_v4": 0.503060, - "Standard_E4d_v5": 0.504000, - "Standard_E4ds_v4": 0.503060, - "Standard_E4ds_v5": 0.504000, - "Standard_E4s_v3": 0.457420, - "Standard_E4s_v4": 0.441440, - "Standard_E4s_v5": 0.442000, - "Standard_E64-16ads_v5": 7.793000, - "Standard_E64-16as_v4": 7.495000, - "Standard_E64-16as_v5": 6.722000, - "Standard_E64-16ds_v4": 8.041940, - "Standard_E64-16ds_v5": 8.064000, - "Standard_E64-16s_v3": 6.256810, - "Standard_E64-16s_v4": 7.065750, - "Standard_E64-16s_v5": 7.072000, - "Standard_E64-32ads_v5": 7.793000, - "Standard_E64-32as_v4": 7.495000, - "Standard_E64-32as_v5": 6.722000, - "Standard_E64-32ds_v4": 8.041940, - "Standard_E64-32ds_v5": 8.064000, - "Standard_E64-32s_v3": 6.256810, - "Standard_E64-32s_v4": 7.065750, - "Standard_E64-32s_v5": 7.072000, - "Standard_E64_v3": 6.256810, - "Standard_E64_v4": 7.065750, - "Standard_E64_v5": 7.077000, - "Standard_E64a_v4": 7.495000, - "Standard_E64ads_v5": 7.793000, - "Standard_E64as_v4": 7.495000, - "Standard_E64as_v5": 6.722000, - "Standard_E64bds_v5": 9.935000, - "Standard_E64bs_v5": 8.864000, - "Standard_E64d_v4": 8.041940, - "Standard_E64d_v5": 8.063000, - "Standard_E64ds_v4": 8.041940, - "Standard_E64ds_v5": 8.064000, - "Standard_E64i_v3": 6.256810, - "Standard_E64is_v3": 6.256810, - "Standard_E64s_v3": 6.256810, - "Standard_E64s_v4": 7.065750, - "Standard_E64s_v5": 7.072000, - "Standard_E8-2ads_v5": 0.974000, - "Standard_E8-2as_v4": 0.937000, - "Standard_E8-2as_v5": 0.840000, - "Standard_E8-2ds_v4": 1.005240, - "Standard_E8-2ds_v5": 1.008000, - "Standard_E8-2s_v3": 0.914830, - "Standard_E8-2s_v4": 0.882890, - "Standard_E8-2s_v5": 0.884000, - "Standard_E8-4ads_v5": 0.974000, - "Standard_E8-4as_v4": 0.937000, - "Standard_E8-4as_v5": 0.840000, - "Standard_E8-4ds_v4": 1.005240, - "Standard_E8-4ds_v5": 1.008000, - "Standard_E8-4s_v3": 0.914830, - "Standard_E8-4s_v4": 0.882890, - "Standard_E8-4s_v5": 0.884000, - "Standard_E80ids_v4": 10.053300, - "Standard_E80is_v4": 8.832410, - "Standard_E8_v3": 0.914830, - "Standard_E8_v4": 0.882890, - "Standard_E8_v5": 0.885000, - "Standard_E8a_v4": 0.937000, - "Standard_E8ads_v5": 0.974000, - "Standard_E8as_v4": 0.937000, - "Standard_E8as_v5": 0.840000, - "Standard_E8bds_v5": 1.242000, - "Standard_E8bs_v5": 1.108000, - "Standard_E8d_v4": 1.005240, - "Standard_E8d_v5": 1.008000, - "Standard_E8ds_v4": 1.005240, - "Standard_E8ds_v5": 1.008000, - "Standard_E8s_v3": 0.914830, - "Standard_E8s_v4": 0.882890, - "Standard_E8s_v5": 0.884000, - "Standard_E96-24ads_v5": 11.689000, - "Standard_E96-24as_v4": 11.243000, - "Standard_E96-24as_v5": 10.083000, - "Standard_E96-24ds_v5": 12.096000, - "Standard_E96-24s_v5": 10.608000, - "Standard_E96-48ads_v5": 11.689000, - "Standard_E96-48as_v4": 11.243000, - "Standard_E96-48as_v5": 10.083000, - "Standard_E96-48ds_v5": 12.096000, - "Standard_E96-48s_v5": 10.608000, - "Standard_E96_v5": 10.616000, - "Standard_E96a_v4": 11.243000, - "Standard_E96ads_v5": 11.689000, - "Standard_E96as_v4": 11.243000, - "Standard_E96as_v5": 10.083000, - "Standard_E96bds_v5": 14.902000, - "Standard_E96bs_v5": 13.296000, - "Standard_E96d_v5": 12.095000, - "Standard_E96ds_v5": 12.096000, - "Standard_E96iads_v5": 12.858000, - "Standard_E96ias_v4": 11.243000, - "Standard_E96ias_v5": 11.092000, - "Standard_E96s_v5": 10.608000, - "Standard_F1": 0.081170, - "Standard_F16": 1.300600, - "Standard_F16s": 1.300600, - "Standard_F16s_v2": 1.110320, - "Standard_F1s": 0.081170, - "Standard_F2": 0.162930, - "Standard_F2s": 0.162930, - "Standard_F2s_v2": 0.138890, - "Standard_F32s_v2": 2.219730, - "Standard_F4": 0.324430, - "Standard_F48s_v2": 3.330050, - "Standard_F4s": 0.324430, - "Standard_F4s_v2": 0.277510, - "Standard_F64s_v2": 4.438260, - "Standard_F72s_v2": 4.994480, - "Standard_F8": 0.649130, - "Standard_F8s": 0.649130, - "Standard_F8s_v2": 0.554110, - "Standard_L16as_v3": 2.320000, - "Standard_L16s_v3": 2.595000, - "Standard_L32as_v3": 4.640000, - "Standard_L32s_v3": 5.190000, - "Standard_L48as_v3": 6.960000, - "Standard_L48s_v3": 7.786000, - "Standard_L64as_v3": 9.280000, - "Standard_L64s_v3": 10.381000, - "Standard_L80as_v3": 11.600000, - "Standard_L80s_v3": 12.976000, - "Standard_L8as_v3": 1.160000, - "Standard_L8s_v3": 1.298000, - "Standard_M128": 26.702020, - "Standard_M128-32ms": 53.429560, - "Standard_M128-64ms": 53.429560, - "Standard_M128m": 53.429560, - "Standard_M128ms": 53.429560, - "Standard_M128s": 26.702020, - "Standard_M16-4ms": 6.152240, - "Standard_M16-8ms": 6.152240, - "Standard_M16ms": 6.152240, - "Standard_M16s": 4.778770, - "Standard_M208-104ms_v2": 90.579000, - "Standard_M208-104s_v2": 45.289000, - "Standard_M208-52ms_v2": 90.579000, - "Standard_M208-52s_v2": 45.289000, - "Standard_M208ms_v2": 90.579000, - "Standard_M208s_v2": 45.289000, - "Standard_M32-16ms": 12.304750, - "Standard_M32-8ms": 12.304750, - "Standard_M32ls": 4.929980, - "Standard_M32ms": 12.304750, - "Standard_M32s": 6.676760, - "Standard_M32ts": 4.644270, - "Standard_M416-104ms_v2": 201.270000, - "Standard_M416-104s_v2": 100.650000, - "Standard_M416-208ms_v2": 201.270000, - "Standard_M416-208s_v2": 100.650000, - "Standard_M416is_v2": 100.650000, - "Standard_M416ms_v2": 201.270000, - "Standard_M416s_8_v2": 122.900000, - "Standard_M416s_v2": 100.650000, - "Standard_M64": 13.351730, - "Standard_M64-16ms": 20.695140, - "Standard_M64-32ms": 20.695140, - "Standard_M64ls": 9.291770, - "Standard_M64m": 20.695140, - "Standard_M64ms": 20.695140, - "Standard_M64s": 13.351730, - "Standard_M8-2ms": 3.075800, - "Standard_M8-4ms": 3.075800, - "Standard_M8ms": 3.075800, - "Standard_ND96ams_A100_v4": 60.919000, - "Standard_ND96amsr_A100_v4": 60.919000, - } - // uaecentral - initialOnDemandPrices["uaecentral"] = map[string]float64{ - "Ddsv4_Type 1": 6.464000, - "Ddsv4_Type2": 7.676000, - "Ddsv5_Type1": 9.514000, - "Dsv3_Type3": 6.590000, - "Dsv3_Type4": 8.238000, - "Dsv4_Type1": 6.864000, - "Dsv4_Type2": 8.580000, - "Dsv5_Type1": 8.416000, - "Ebdsv5-Type1": 9.427000, - "Ebsv5-Type1": 8.466000, - "Edsv4_Type 1": 7.907000, - "Edsv4_Type2": 9.390000, - "Edsv5_Type1": 12.081000, - "Esv3_Type3": 6.703000, - "Esv3_Type4": 9.082000, - "Esv4_Type1": 6.919000, - "Esv4_Type2": 9.081000, - "Esv5_Type1": 10.646000, - "Fsv2_Type2": 5.251000, - "Lasv3_Type1": 10.811000, - "Lsv3_Type1": 12.069000, - "Mdsmv2MedMem _Type1": 45.800000, - "Mdsv2MedMem_Type1": 22.892000, - "Ms_Type1": 22.883000, - "Msm_Type1": 45.807000, - "Msmv2MedMem Type1": 45.078000, - "Msmv2_Type1": 170.140000, - "Msv2MedMem Type1": 22.169000, - "Msv2_Type1": 85.079000, - "Standard_A1_v2": 0.053300, - "Standard_A2_v2": 0.113000, - "Standard_A2m_v2": 0.154000, - "Standard_A4_v2": 0.238000, - "Standard_A4m_v2": 0.324000, - "Standard_A8_v2": 0.498000, - "Standard_A8m_v2": 0.682000, - "Standard_B12ms": 0.749000, - "Standard_B16als_v2": 0.905000, - "Standard_B16as_v2": 1.012000, - "Standard_B16ls_v2": 0.997000, - "Standard_B16ms": 0.998000, - "Standard_B16s_v2": 1.043000, - "Standard_B1ls": 0.007800, - "Standard_B1ms": 0.031200, - "Standard_B1s": 0.015600, - "Standard_B20ms": 1.248000, - "Standard_B2als_v2": 0.067900, - "Standard_B2as_v2": 0.127000, - "Standard_B2ats_v2": 0.023900, - "Standard_B2ls_v2": 0.065200, - "Standard_B2ms": 0.125000, - "Standard_B2s": 0.062400, - "Standard_B2s_v2": 0.130000, - "Standard_B2ts_v2": 0.025500, - "Standard_B32als_v2": 1.663000, - "Standard_B32as_v2": 2.025000, - "Standard_B32ls_v2": 1.995000, - "Standard_B32s_v2": 2.233000, - "Standard_B4als_v2": 0.226000, - "Standard_B4as_v2": 0.235000, - "Standard_B4ls_v2": 0.249000, - "Standard_B4ms": 0.250000, - "Standard_B4s_v2": 0.279000, - "Standard_B8als_v2": 0.453000, - "Standard_B8as_v2": 0.469000, - "Standard_B8ls_v2": 0.462000, - "Standard_B8ms": 0.499000, - "Standard_B8s_v2": 0.558000, - "Standard_D1": 0.105000, - "Standard_D11": 0.271000, - "Standard_D11_v2": 0.233000, - "Standard_D12": 0.541000, - "Standard_D12_v2": 0.466000, - "Standard_D13": 1.082000, - "Standard_D13_v2": 0.933000, - "Standard_D14": 2.164000, - "Standard_D14_v2": 1.866000, - "Standard_D15_v2": 2.332000, - "Standard_D15i_v2": 2.332000, - "Standard_D16_v3": 1.248000, - "Standard_D16_v4": 1.248000, - "Standard_D16_v5": 1.224000, - "Standard_D16d_v4": 1.469000, - "Standard_D16d_v5": 1.441000, - "Standard_D16ds_v4": 1.469000, - "Standard_D16ds_v5": 1.441000, - "Standard_D16lds_v5": 1.248000, - "Standard_D16ls_v5": 1.098000, - "Standard_D16s_v3": 1.248000, - "Standard_D16s_v4": 1.248000, - "Standard_D16s_v5": 1.224000, - "Standard_D1_v2": 0.089300, - "Standard_D2": 0.209000, - "Standard_D2_v2": 0.178000, - "Standard_D2_v3": 0.156000, - "Standard_D2_v4": 0.156000, - "Standard_D2_v5": 0.153000, - "Standard_D2d_v4": 0.184000, - "Standard_D2d_v5": 0.180000, - "Standard_D2ds_v4": 0.184000, - "Standard_D2ds_v5": 0.180000, - "Standard_D2lds_v5": 0.156000, - "Standard_D2ls_v5": 0.137000, - "Standard_D2s_v3": 0.156000, - "Standard_D2s_v4": 0.156000, - "Standard_D2s_v5": 0.153000, - "Standard_D3": 0.418000, - "Standard_D32-16s_v3": 2.496000, - "Standard_D32-8s_v3": 2.496000, - "Standard_D32_v3": 2.496000, - "Standard_D32_v4": 2.496000, - "Standard_D32_v5": 2.448000, - "Standard_D32d_v4": 2.938000, - "Standard_D32d_v5": 2.883000, - "Standard_D32ds_v4": 2.938000, - "Standard_D32ds_v5": 2.883000, - "Standard_D32lds_v5": 2.496000, - "Standard_D32ls_v5": 2.196000, - "Standard_D32s_v3": 2.496000, - "Standard_D32s_v4": 2.496000, - "Standard_D32s_v5": 2.448000, - "Standard_D3_v2": 0.357000, - "Standard_D4": 0.836000, - "Standard_D48_v3": 3.744000, - "Standard_D48_v4": 3.744000, - "Standard_D48_v5": 3.672000, - "Standard_D48d_v4": 4.407000, - "Standard_D48d_v5": 4.324000, - "Standard_D48ds_v4": 4.407000, - "Standard_D48ds_v5": 4.324000, - "Standard_D48lds_v5": 3.744000, - "Standard_D48ls_v5": 3.295000, - "Standard_D48s_v3": 3.744000, - "Standard_D48s_v4": 3.744000, - "Standard_D48s_v5": 3.672000, - "Standard_D4_v2": 0.714000, - "Standard_D4_v3": 0.312000, - "Standard_D4_v4": 0.312000, - "Standard_D4_v5": 0.306000, - "Standard_D4d_v4": 0.367000, - "Standard_D4d_v5": 0.360000, - "Standard_D4ds_v4": 0.367000, - "Standard_D4ds_v5": 0.360000, - "Standard_D4lds_v5": 0.312000, - "Standard_D4ls_v5": 0.275000, - "Standard_D4s_v3": 0.312000, - "Standard_D4s_v4": 0.312000, - "Standard_D4s_v5": 0.306000, - "Standard_D5_v2": 1.429000, - "Standard_D64-16s_v3": 4.992000, - "Standard_D64-32s_v3": 4.992000, - "Standard_D64_v3": 4.992000, - "Standard_D64_v4": 4.992000, - "Standard_D64_v5": 4.896000, - "Standard_D64d_v4": 5.876000, - "Standard_D64d_v5": 5.766000, - "Standard_D64ds_v4": 5.876000, - "Standard_D64ds_v5": 5.766000, - "Standard_D64lds_v5": 4.992000, - "Standard_D64ls_v5": 4.393000, - "Standard_D64s_v3": 4.992000, - "Standard_D64s_v4": 4.992000, - "Standard_D64s_v5": 4.896000, - "Standard_D8_v3": 0.624000, - "Standard_D8_v4": 0.624000, - "Standard_D8_v5": 0.612000, - "Standard_D8d_v4": 0.734000, - "Standard_D8d_v5": 0.721000, - "Standard_D8ds_v4": 0.734000, - "Standard_D8ds_v5": 0.721000, - "Standard_D8lds_v5": 0.624000, - "Standard_D8ls_v5": 0.549000, - "Standard_D8s_v3": 0.624000, - "Standard_D8s_v4": 0.624000, - "Standard_D8s_v5": 0.612000, - "Standard_D96_v5": 7.344000, - "Standard_D96d_v5": 8.649000, - "Standard_D96ds_v5": 8.649000, - "Standard_D96lds_v5": 7.488000, - "Standard_D96ls_v5": 6.589000, - "Standard_D96s_v5": 7.344000, - "Standard_DS1": 0.105000, - "Standard_DS11": 0.271000, - "Standard_DS11-1_v2": 0.233000, - "Standard_DS11_v2": 0.233000, - "Standard_DS12": 0.541000, - "Standard_DS12-1_v2": 0.466000, - "Standard_DS12-2_v2": 0.466000, - "Standard_DS12_v2": 0.466000, - "Standard_DS13": 1.082000, - "Standard_DS13-2_v2": 0.933000, - "Standard_DS13-4_v2": 0.933000, - "Standard_DS13_v2": 0.933000, - "Standard_DS14": 2.164000, - "Standard_DS14-4_v2": 1.866000, - "Standard_DS14-8_v2": 1.866000, - "Standard_DS14_v2": 1.866000, - "Standard_DS15_v2": 2.332000, - "Standard_DS15i_v2": 2.332000, - "Standard_DS1_v2": 0.089300, - "Standard_DS2": 0.209000, - "Standard_DS2_v2": 0.178000, - "Standard_DS3": 0.418000, - "Standard_DS3_v2": 0.357000, - "Standard_DS4": 0.836000, - "Standard_DS4_v2": 0.714000, - "Standard_DS5_v2": 1.429000, - "Standard_E104i_v5": 11.533000, - "Standard_E104id_v5": 13.087000, - "Standard_E104ids_v5": 13.087000, - "Standard_E104is_v5": 11.533000, - "Standard_E112ibds_v5": 16.496000, - "Standard_E112ibs_v5": 14.815000, - "Standard_E16-4ds_v4": 1.797000, - "Standard_E16-4ds_v5": 1.830000, - "Standard_E16-4s_v3": 1.572000, - "Standard_E16-4s_v4": 1.572000, - "Standard_E16-4s_v5": 1.613000, - "Standard_E16-8ds_v4": 1.797000, - "Standard_E16-8ds_v5": 1.830000, - "Standard_E16-8s_v3": 1.572000, - "Standard_E16-8s_v4": 1.572000, - "Standard_E16-8s_v5": 1.613000, - "Standard_E16_v3": 1.572000, - "Standard_E16_v4": 1.572000, - "Standard_E16_v5": 1.613000, - "Standard_E16bds_v5": 2.142000, - "Standard_E16bs_v5": 1.924000, - "Standard_E16d_v4": 1.797000, - "Standard_E16d_v5": 1.830000, - "Standard_E16ds_v4": 1.797000, - "Standard_E16ds_v5": 1.830000, - "Standard_E16s_v3": 1.572000, - "Standard_E16s_v4": 1.572000, - "Standard_E16s_v5": 1.613000, - "Standard_E20_v3": 2.080000, - "Standard_E20_v4": 1.966000, - "Standard_E20_v5": 2.016000, - "Standard_E20d_v4": 2.246000, - "Standard_E20d_v5": 2.288000, - "Standard_E20ds_v4": 2.246000, - "Standard_E20ds_v5": 2.288000, - "Standard_E20s_v3": 2.080000, - "Standard_E20s_v4": 1.966000, - "Standard_E20s_v5": 2.016000, - "Standard_E2_v3": 0.196000, - "Standard_E2_v4": 0.197000, - "Standard_E2_v5": 0.202000, - "Standard_E2bds_v5": 0.268000, - "Standard_E2bs_v5": 0.241000, - "Standard_E2d_v4": 0.225000, - "Standard_E2d_v5": 0.229000, - "Standard_E2ds_v4": 0.225000, - "Standard_E2ds_v5": 0.229000, - "Standard_E2s_v3": 0.196000, - "Standard_E2s_v4": 0.197000, - "Standard_E2s_v5": 0.202000, - "Standard_E32-16ds_v4": 3.594000, - "Standard_E32-16ds_v5": 3.661000, - "Standard_E32-16s_v3": 3.145000, - "Standard_E32-16s_v4": 3.145000, - "Standard_E32-16s_v5": 3.226000, - "Standard_E32-8ds_v4": 3.594000, - "Standard_E32-8ds_v5": 3.661000, - "Standard_E32-8s_v3": 3.145000, - "Standard_E32-8s_v4": 3.145000, - "Standard_E32-8s_v5": 3.226000, - "Standard_E32_v3": 3.145000, - "Standard_E32_v4": 3.145000, - "Standard_E32_v5": 3.226000, - "Standard_E32bds_v5": 4.285000, - "Standard_E32bs_v5": 3.848000, - "Standard_E32d_v4": 3.594000, - "Standard_E32d_v5": 3.661000, - "Standard_E32ds_v4": 3.594000, - "Standard_E32ds_v5": 3.661000, - "Standard_E32s_v3": 3.145000, - "Standard_E32s_v4": 3.145000, - "Standard_E32s_v5": 3.226000, - "Standard_E4-2ds_v4": 0.449000, - "Standard_E4-2ds_v5": 0.458000, - "Standard_E4-2s_v3": 0.393000, - "Standard_E4-2s_v4": 0.393000, - "Standard_E4-2s_v5": 0.403000, - "Standard_E48_v3": 4.717000, - "Standard_E48_v4": 4.717000, - "Standard_E48_v5": 4.839000, - "Standard_E48bds_v5": 6.427000, - "Standard_E48bs_v5": 5.772000, - "Standard_E48d_v4": 5.391000, - "Standard_E48d_v5": 5.491000, - "Standard_E48ds_v4": 5.391000, - "Standard_E48ds_v5": 5.491000, - "Standard_E48s_v3": 4.717000, - "Standard_E48s_v4": 4.717000, - "Standard_E48s_v5": 4.839000, - "Standard_E4_v3": 0.393000, - "Standard_E4_v4": 0.393000, - "Standard_E4_v5": 0.403000, - "Standard_E4bds_v5": 0.536000, - "Standard_E4bs_v5": 0.481000, - "Standard_E4d_v4": 0.449000, - "Standard_E4d_v5": 0.458000, - "Standard_E4ds_v4": 0.449000, - "Standard_E4ds_v5": 0.458000, - "Standard_E4s_v3": 0.393000, - "Standard_E4s_v4": 0.393000, - "Standard_E4s_v5": 0.403000, - "Standard_E64-16ds_v4": 7.188000, - "Standard_E64-16ds_v5": 7.322000, - "Standard_E64-16s_v3": 5.661000, - "Standard_E64-16s_v4": 6.290000, - "Standard_E64-16s_v5": 6.452000, - "Standard_E64-32ds_v4": 7.188000, - "Standard_E64-32ds_v5": 7.322000, - "Standard_E64-32s_v3": 5.661000, - "Standard_E64-32s_v4": 6.290000, - "Standard_E64-32s_v5": 6.452000, - "Standard_E64_v3": 5.661000, - "Standard_E64_v4": 6.290000, - "Standard_E64_v5": 6.452000, - "Standard_E64bds_v5": 8.570000, - "Standard_E64bs_v5": 7.696000, - "Standard_E64d_v4": 7.188000, - "Standard_E64d_v5": 7.322000, - "Standard_E64ds_v4": 7.188000, - "Standard_E64ds_v5": 7.322000, - "Standard_E64i_v3": 5.689000, - "Standard_E64is_v3": 5.689000, - "Standard_E64s_v3": 5.661000, - "Standard_E64s_v4": 6.290000, - "Standard_E64s_v5": 6.452000, - "Standard_E8-2ds_v4": 0.899000, - "Standard_E8-2ds_v5": 0.915000, - "Standard_E8-2s_v3": 0.786000, - "Standard_E8-2s_v4": 0.786000, - "Standard_E8-2s_v5": 0.807000, - "Standard_E8-4ds_v4": 0.899000, - "Standard_E8-4ds_v5": 0.915000, - "Standard_E8-4s_v3": 0.786000, - "Standard_E8-4s_v4": 0.786000, - "Standard_E8-4s_v5": 0.807000, - "Standard_E80ids_v4": 8.986000, - "Standard_E80is_v4": 7.862000, - "Standard_E8_v3": 0.786000, - "Standard_E8_v4": 0.786000, - "Standard_E8_v5": 0.807000, - "Standard_E8bds_v5": 1.071000, - "Standard_E8bs_v5": 0.962000, - "Standard_E8d_v4": 0.899000, - "Standard_E8d_v5": 0.915000, - "Standard_E8ds_v4": 0.899000, - "Standard_E8ds_v5": 0.915000, - "Standard_E8s_v3": 0.786000, - "Standard_E8s_v4": 0.786000, - "Standard_E8s_v5": 0.807000, - "Standard_E96-24ds_v5": 10.982000, - "Standard_E96-24s_v5": 9.678000, - "Standard_E96-48ds_v5": 10.982000, - "Standard_E96-48s_v5": 9.678000, - "Standard_E96_v5": 9.678000, - "Standard_E96bds_v5": 12.854000, - "Standard_E96bs_v5": 11.544000, - "Standard_E96d_v5": 10.982000, - "Standard_E96ds_v5": 10.982000, - "Standard_E96s_v5": 9.678000, - "Standard_F1": 0.073800, - "Standard_F16": 1.182000, - "Standard_F16s": 1.182000, - "Standard_F16s_v2": 1.009000, - "Standard_F1s": 0.073800, - "Standard_F2": 0.148000, - "Standard_F2s": 0.148000, - "Standard_F2s_v2": 0.126000, - "Standard_F32s_v2": 2.018000, - "Standard_F4": 0.295000, - "Standard_F48s_v2": 3.026000, - "Standard_F4s": 0.295000, - "Standard_F4s_v2": 0.252000, - "Standard_F64s_v2": 4.035000, - "Standard_F72s_v2": 4.540000, - "Standard_F8": 0.590000, - "Standard_F8s": 0.590000, - "Standard_F8s_v2": 0.504000, - "Standard_L16as_v3": 1.966000, - "Standard_L16s_v3": 2.194000, - "Standard_L32as_v3": 3.931000, - "Standard_L32s_v3": 4.389000, - "Standard_L48as_v3": 5.897000, - "Standard_L48s_v3": 6.583000, - "Standard_L64as_v3": 7.862000, - "Standard_L64s_v3": 8.778000, - "Standard_L80as_v3": 9.828000, - "Standard_L80s_v3": 10.972000, - "Standard_L8as_v3": 0.983000, - "Standard_L8s_v3": 1.097000, - "Standard_M128": 20.807000, - "Standard_M128-32ms": 41.633000, - "Standard_M128-64ms": 41.633000, - "Standard_M128dms_v2": 41.636000, - "Standard_M128ds_v2": 20.810000, - "Standard_M128m": 41.633000, - "Standard_M128ms": 41.633000, - "Standard_M128ms_v2": 40.980000, - "Standard_M128s": 20.807000, - "Standard_M128s_v2": 20.154000, - "Standard_M16-4ms": 4.794000, - "Standard_M16-8ms": 4.794000, - "Standard_M16ms": 4.794000, - "Standard_M16s": 3.724000, - "Standard_M192idms_v2": 50.020000, - "Standard_M192ids_v2": 25.010000, - "Standard_M192ims_v2": 49.363000, - "Standard_M192is_v2": 24.353000, - "Standard_M208-104ms_v2": 69.607000, - "Standard_M208-104s_v2": 34.804000, - "Standard_M208-52ms_v2": 69.607000, - "Standard_M208-52s_v2": 34.804000, - "Standard_M208ms_v2": 69.607000, - "Standard_M208s_v2": 34.804000, - "Standard_M32-16ms": 9.588000, - "Standard_M32-8ms": 9.588000, - "Standard_M32dms_v2": 9.588000, - "Standard_M32ls": 4.481880, - "Standard_M32ms": 9.588000, - "Standard_M32ms_v2": 9.424000, - "Standard_M32s": 5.202565, - "Standard_M32ts": 4.222920, - "Standard_M416-104ms_v2": 154.670000, - "Standard_M416-104s_v2": 77.345000, - "Standard_M416-208ms_v2": 154.670000, - "Standard_M416-208s_v2": 77.345000, - "Standard_M416is_v2": 77.345000, - "Standard_M416ms_v2": 154.670000, - "Standard_M416s_8_v2": 122.900000, - "Standard_M416s_v2": 77.345000, - "Standard_M64": 10.404000, - "Standard_M64-16ms": 16.125612, - "Standard_M64-32ms": 16.125612, - "Standard_M64dms_v2": 16.130000, - "Standard_M64ds_v2": 10.404000, - "Standard_M64ls": 8.447400, - "Standard_M64m": 16.125612, - "Standard_M64ms": 16.125612, - "Standard_M64ms_v2": 15.802000, - "Standard_M64s": 10.404000, - "Standard_M64s_v2": 10.075000, - "Standard_M8-2ms": 2.397000, - "Standard_M8-4ms": 2.397000, - "Standard_M8ms": 2.397000, - "Standard_ND96ams_A100_v4": 60.919000, - "Standard_ND96amsr_A100_v4": 60.919000, - } - // uaenorth - initialOnDemandPrices["uaenorth"] = map[string]float64{ - "Dadsv5_Type1": 7.817000, - "Dasv4_Type1": 6.474000, - "Dasv4_Type2": 6.474000, - "Dasv5_Type1": 6.530000, - "Ddsv4_Type 1": 4.875000, - "Ddsv4_Type2": 5.789000, - "Ddsv5_Type1": 7.318000, - "Dsv3_Type3": 5.069000, - "Dsv3_Type4": 6.336000, - "Dsv4_Type1": 5.170000, - "Dsv4_Type2": 6.217000, - "Dsv5_Type1": 6.474000, - "Eadsv5_Type1": 8.496000, - "Easv4_Type1": 8.189000, - "Easv4_Type2": 8.189000, - "Easv5_Type1": 7.392000, - "Ebdsv5-Type1": 7.251000, - "Ebsv5-Type1": 6.512000, - "Edsv4_Type 1": 6.195000, - "Edsv4_Type2": 7.942000, - "Edsv5_Type1": 9.293000, - "Esv3_Type3": 5.156000, - "Esv3_Type4": 6.986000, - "Esv4_Type1": 5.456000, - "Esv4_Type2": 7.161000, - "Esv5_Type1": 8.189000, - "Fsv2 Type3": 4.874000, - "Fsv2_Type2": 4.039000, - "Fsv2_Type4": 5.386000, - "Lasv3_Type1": 8.316000, - "Lsv3_Type1": 9.284000, - "Mdsmv2MedMem _Type1": 38.754000, - "Mdsv2MedMem_Type1": 19.370000, - "Ms_Type1": 19.363000, - "Msm_Type1": 38.759000, - "Msmv2MedMem Type1": 38.143000, - "Msmv2_Type1": 143.970000, - "Msv2MedMem Type1": 18.759000, - "Msv2_Type1": 71.990000, - "NVsv3_Type1": 6.120000, - "Standard_A1_v2": 0.043200, - "Standard_A2_v2": 0.091200, - "Standard_A2m_v2": 0.119000, - "Standard_A4_v2": 0.191000, - "Standard_A4m_v2": 0.250000, - "Standard_A8_v2": 0.400000, - "Standard_A8m_v2": 0.524000, - "Standard_B12ms": 0.599000, - "Standard_B16als_v2": 0.713000, - "Standard_B16as_v2": 0.796000, - "Standard_B16ls_v2": 0.784000, - "Standard_B16ms": 0.799000, - "Standard_B16s_v2": 0.802000, - "Standard_B1ls": 0.006240, - "Standard_B1ms": 0.025000, - "Standard_B1s": 0.012500, - "Standard_B20ms": 0.998000, - "Standard_B2als_v2": 0.054300, - "Standard_B2as_v2": 0.099500, - "Standard_B2ats_v2": 0.011300, - "Standard_B2ls_v2": 0.050200, - "Standard_B2ms": 0.099800, - "Standard_B2s": 0.049900, - "Standard_B2s_v2": 0.110000, - "Standard_B2ts_v2": 0.012500, - "Standard_B32als_v2": 1.279000, - "Standard_B32as_v2": 1.444000, - "Standard_B32ls_v2": 1.421000, - "Standard_B32s_v2": 1.752000, - "Standard_B4als_v2": 0.160000, - "Standard_B4as_v2": 0.199000, - "Standard_B4ls_v2": 0.196000, - "Standard_B4ms": 0.200000, - "Standard_B4s_v2": 0.219000, - "Standard_B8als_v2": 0.320000, - "Standard_B8as_v2": 0.398000, - "Standard_B8ls_v2": 0.355000, - "Standard_B8ms": 0.399000, - "Standard_B8s_v2": 0.401000, - "Standard_D1": 0.080400, - "Standard_D11": 0.208000, - "Standard_D11_v2": 0.179000, - "Standard_D12": 0.416000, - "Standard_D12_v2": 0.359000, - "Standard_D13": 0.832000, - "Standard_D13_v2": 0.718000, - "Standard_D14": 1.665000, - "Standard_D14_v2": 1.435000, - "Standard_D15_v2": 1.794000, - "Standard_D15i_v2": 1.794000, - "Standard_D16_v3": 0.960000, - "Standard_D16_v4": 0.942000, - "Standard_D16_v5": 0.942000, - "Standard_D16a_v4": 0.942000, - "Standard_D16ads_v5": 1.015000, - "Standard_D16as_v4": 0.942000, - "Standard_D16as_v5": 0.848000, - "Standard_D16d_v4": 1.109000, - "Standard_D16d_v5": 1.109000, - "Standard_D16ds_v4": 1.109000, - "Standard_D16ds_v5": 1.109000, - "Standard_D16lds_v5": 0.960000, - "Standard_D16ls_v5": 0.845000, - "Standard_D16s_v3": 0.960000, - "Standard_D16s_v4": 0.942000, - "Standard_D16s_v5": 0.942000, - "Standard_D1_v2": 0.068700, - "Standard_D2": 0.161000, - "Standard_D2_v2": 0.137000, - "Standard_D2_v3": 0.120000, - "Standard_D2_v4": 0.118000, - "Standard_D2_v5": 0.118000, - "Standard_D2a_v4": 0.118000, - "Standard_D2ads_v5": 0.127000, - "Standard_D2as_v4": 0.118000, - "Standard_D2as_v5": 0.106000, - "Standard_D2d_v4": 0.139000, - "Standard_D2d_v5": 0.139000, - "Standard_D2ds_v4": 0.139000, - "Standard_D2ds_v5": 0.139000, - "Standard_D2lds_v5": 0.120000, - "Standard_D2ls_v5": 0.106000, - "Standard_D2s_v3": 0.120000, - "Standard_D2s_v4": 0.118000, - "Standard_D2s_v5": 0.118000, - "Standard_D3": 0.322000, - "Standard_D32-16s_v3": 1.920000, - "Standard_D32-8s_v3": 1.920000, - "Standard_D32_v3": 1.920000, - "Standard_D32_v4": 1.883000, - "Standard_D32_v5": 1.883000, - "Standard_D32a_v4": 1.883000, - "Standard_D32ads_v5": 2.030000, - "Standard_D32as_v4": 1.883000, - "Standard_D32as_v5": 1.696000, - "Standard_D32d_v4": 2.218000, - "Standard_D32d_v5": 2.218000, - "Standard_D32ds_v4": 2.218000, - "Standard_D32ds_v5": 2.218000, - "Standard_D32lds_v5": 1.920000, - "Standard_D32ls_v5": 1.690000, - "Standard_D32s_v3": 1.920000, - "Standard_D32s_v4": 1.883000, - "Standard_D32s_v5": 1.883000, - "Standard_D3_v2": 0.275000, - "Standard_D4": 0.643000, - "Standard_D48_v3": 2.880000, - "Standard_D48_v4": 2.825000, - "Standard_D48_v5": 2.825000, - "Standard_D48a_v4": 2.825000, - "Standard_D48ads_v5": 3.046000, - "Standard_D48as_v4": 2.825000, - "Standard_D48as_v5": 2.544000, - "Standard_D48d_v4": 3.326000, - "Standard_D48d_v5": 3.326000, - "Standard_D48ds_v4": 3.326000, - "Standard_D48ds_v5": 3.326000, - "Standard_D48lds_v5": 2.880000, - "Standard_D48ls_v5": 2.534000, - "Standard_D48s_v3": 2.880000, - "Standard_D48s_v4": 2.825000, - "Standard_D48s_v5": 2.825000, - "Standard_D4_v2": 0.550000, - "Standard_D4_v3": 0.240000, - "Standard_D4_v4": 0.235000, - "Standard_D4_v5": 0.235000, - "Standard_D4a_v4": 0.235000, - "Standard_D4ads_v5": 0.254000, - "Standard_D4as_v4": 0.235000, - "Standard_D4as_v5": 0.212000, - "Standard_D4d_v4": 0.277000, - "Standard_D4d_v5": 0.277000, - "Standard_D4ds_v4": 0.277000, - "Standard_D4ds_v5": 0.277000, - "Standard_D4lds_v5": 0.240000, - "Standard_D4ls_v5": 0.211000, - "Standard_D4s_v3": 0.240000, - "Standard_D4s_v4": 0.235000, - "Standard_D4s_v5": 0.235000, - "Standard_D5_v2": 1.099000, - "Standard_D64-16s_v3": 3.840000, - "Standard_D64-32s_v3": 3.840000, - "Standard_D64_v3": 3.840000, - "Standard_D64_v4": 3.766000, - "Standard_D64_v5": 3.766000, - "Standard_D64a_v4": 3.766000, - "Standard_D64ads_v5": 4.061000, - "Standard_D64as_v4": 3.766000, - "Standard_D64as_v5": 3.392000, - "Standard_D64d_v4": 4.435000, - "Standard_D64d_v5": 4.435000, - "Standard_D64ds_v4": 4.435000, - "Standard_D64ds_v5": 4.435000, - "Standard_D64lds_v5": 3.840000, - "Standard_D64ls_v5": 3.379000, - "Standard_D64s_v3": 3.840000, - "Standard_D64s_v4": 3.766000, - "Standard_D64s_v5": 3.766000, - "Standard_D8_v3": 0.480000, - "Standard_D8_v4": 0.471000, - "Standard_D8_v5": 0.471000, - "Standard_D8a_v4": 0.471000, - "Standard_D8ads_v5": 0.508000, - "Standard_D8as_v4": 0.471000, - "Standard_D8as_v5": 0.424000, - "Standard_D8d_v4": 0.554000, - "Standard_D8d_v5": 0.554000, - "Standard_D8ds_v4": 0.554000, - "Standard_D8ds_v5": 0.554000, - "Standard_D8lds_v5": 0.480000, - "Standard_D8ls_v5": 0.422000, - "Standard_D8s_v3": 0.480000, - "Standard_D8s_v4": 0.471000, - "Standard_D8s_v5": 0.471000, - "Standard_D96_v5": 5.650000, - "Standard_D96a_v4": 5.650000, - "Standard_D96ads_v5": 6.091000, - "Standard_D96as_v4": 5.650000, - "Standard_D96as_v5": 5.088000, - "Standard_D96d_v5": 6.653000, - "Standard_D96ds_v5": 6.653000, - "Standard_D96lds_v5": 5.760000, - "Standard_D96ls_v5": 5.069000, - "Standard_D96s_v5": 5.650000, - "Standard_DC16ads_v5": 1.015000, - "Standard_DC16as_v5": 0.848000, - "Standard_DC2ads_v5": 0.127000, - "Standard_DC2as_v5": 0.106000, - "Standard_DC32ads_v5": 2.030000, - "Standard_DC32as_v5": 1.696000, - "Standard_DC48ads_v5": 3.046000, - "Standard_DC48as_v5": 2.544000, - "Standard_DC4ads_v5": 0.254000, - "Standard_DC4as_v5": 0.212000, - "Standard_DC64ads_v5": 4.061000, - "Standard_DC64as_v5": 3.392000, - "Standard_DC8ads_v5": 0.508000, - "Standard_DC8as_v5": 0.424000, - "Standard_DC96ads_v5": 6.091000, - "Standard_DC96as_v5": 5.088000, - "Standard_DS1": 0.080400, - "Standard_DS11": 0.208000, - "Standard_DS11-1_v2": 0.179000, - "Standard_DS11_v2": 0.179000, - "Standard_DS12": 0.416000, - "Standard_DS12-1_v2": 0.359000, - "Standard_DS12-2_v2": 0.359000, - "Standard_DS12_v2": 0.359000, - "Standard_DS13": 0.832000, - "Standard_DS13-2_v2": 0.718000, - "Standard_DS13-4_v2": 0.718000, - "Standard_DS13_v2": 0.718000, - "Standard_DS14": 1.665000, - "Standard_DS14-4_v2": 1.435000, - "Standard_DS14-8_v2": 1.435000, - "Standard_DS14_v2": 1.435000, - "Standard_DS15_v2": 1.794000, - "Standard_DS15i_v2": 1.794000, - "Standard_DS1_v2": 0.068700, - "Standard_DS2": 0.161000, - "Standard_DS2_v2": 0.137000, - "Standard_DS3": 0.322000, - "Standard_DS3_v2": 0.275000, - "Standard_DS4": 0.643000, - "Standard_DS4_v2": 0.550000, - "Standard_DS5_v2": 1.099000, - "Standard_E104i_v5": 8.872000, - "Standard_E104id_v5": 10.067000, - "Standard_E104ids_v5": 10.067000, - "Standard_E104is_v5": 8.872000, - "Standard_E112iads_v5": 9.911000, - "Standard_E112ias_v5": 8.624000, - "Standard_E112ibds_v5": 12.690000, - "Standard_E112ibs_v5": 11.396000, - "Standard_E16-4ads_v5": 1.287000, - "Standard_E16-4as_v4": 1.241000, - "Standard_E16-4as_v5": 1.120000, - "Standard_E16-4ds_v4": 1.408000, - "Standard_E16-4ds_v5": 1.408000, - "Standard_E16-4s_v3": 1.210000, - "Standard_E16-4s_v4": 1.241000, - "Standard_E16-4s_v5": 1.241000, - "Standard_E16-8ads_v5": 1.287000, - "Standard_E16-8as_v4": 1.241000, - "Standard_E16-8as_v5": 1.120000, - "Standard_E16-8ds_v4": 1.408000, - "Standard_E16-8ds_v5": 1.408000, - "Standard_E16-8s_v3": 1.210000, - "Standard_E16-8s_v4": 1.241000, - "Standard_E16-8s_v5": 1.241000, - "Standard_E16_v3": 1.210000, - "Standard_E16_v4": 1.241000, - "Standard_E16_v5": 1.241000, - "Standard_E16a_v4": 1.241000, - "Standard_E16ads_v5": 1.287000, - "Standard_E16as_v4": 1.241000, - "Standard_E16as_v5": 1.120000, - "Standard_E16bds_v5": 1.648000, - "Standard_E16bs_v5": 1.480000, - "Standard_E16d_v4": 1.408000, - "Standard_E16d_v5": 1.408000, - "Standard_E16ds_v4": 1.408000, - "Standard_E16ds_v5": 1.408000, - "Standard_E16s_v3": 1.210000, - "Standard_E16s_v4": 1.241000, - "Standard_E16s_v5": 1.241000, - "Standard_E20_v3": 1.600000, - "Standard_E20_v4": 1.550000, - "Standard_E20_v5": 1.551000, - "Standard_E20a_v4": 1.551000, - "Standard_E20ads_v5": 1.609000, - "Standard_E20as_v4": 1.551000, - "Standard_E20as_v5": 1.400000, - "Standard_E20d_v4": 1.760000, - "Standard_E20d_v5": 1.760000, - "Standard_E20ds_v4": 1.760000, - "Standard_E20ds_v5": 1.760000, - "Standard_E20s_v3": 1.600000, - "Standard_E20s_v4": 1.550000, - "Standard_E20s_v5": 1.551000, - "Standard_E2_v3": 0.151000, - "Standard_E2_v4": 0.155000, - "Standard_E2_v5": 0.155000, - "Standard_E2a_v4": 0.155000, - "Standard_E2ads_v5": 0.161000, - "Standard_E2as_v4": 0.155000, - "Standard_E2as_v5": 0.140000, - "Standard_E2bds_v5": 0.206000, - "Standard_E2bs_v5": 0.185000, - "Standard_E2d_v4": 0.176000, - "Standard_E2d_v5": 0.176000, - "Standard_E2ds_v4": 0.176000, - "Standard_E2ds_v5": 0.176000, - "Standard_E2s_v3": 0.151000, - "Standard_E2s_v4": 0.155000, - "Standard_E2s_v5": 0.155000, - "Standard_E32-16ads_v5": 2.574000, - "Standard_E32-16as_v4": 2.482000, - "Standard_E32-16as_v5": 2.240000, - "Standard_E32-16ds_v4": 2.816000, - "Standard_E32-16ds_v5": 2.816000, - "Standard_E32-16s_v3": 2.419000, - "Standard_E32-16s_v4": 2.482000, - "Standard_E32-16s_v5": 2.482000, - "Standard_E32-8ads_v5": 2.574000, - "Standard_E32-8as_v4": 2.482000, - "Standard_E32-8as_v5": 2.240000, - "Standard_E32-8ds_v4": 2.816000, - "Standard_E32-8ds_v5": 2.816000, - "Standard_E32-8s_v3": 2.419000, - "Standard_E32-8s_v4": 2.482000, - "Standard_E32-8s_v5": 2.482000, - "Standard_E32_v3": 2.419000, - "Standard_E32_v4": 2.482000, - "Standard_E32_v5": 2.482000, - "Standard_E32a_v4": 2.482000, - "Standard_E32ads_v5": 2.574000, - "Standard_E32as_v4": 2.482000, - "Standard_E32as_v5": 2.240000, - "Standard_E32bds_v5": 3.296000, - "Standard_E32bs_v5": 2.960000, - "Standard_E32d_v4": 2.816000, - "Standard_E32d_v5": 2.816000, - "Standard_E32ds_v4": 2.816000, - "Standard_E32ds_v5": 2.816000, - "Standard_E32s_v3": 2.419000, - "Standard_E32s_v4": 2.482000, - "Standard_E32s_v5": 2.482000, - "Standard_E4-2ads_v5": 0.322000, - "Standard_E4-2as_v4": 0.310000, - "Standard_E4-2as_v5": 0.280000, - "Standard_E4-2ds_v4": 0.352000, - "Standard_E4-2ds_v5": 0.352000, - "Standard_E4-2s_v3": 0.302000, - "Standard_E4-2s_v4": 0.310000, - "Standard_E4-2s_v5": 0.310000, - "Standard_E48_v3": 3.629000, - "Standard_E48_v4": 3.722000, - "Standard_E48_v5": 3.722000, - "Standard_E48a_v4": 3.722000, - "Standard_E48ads_v5": 3.862000, - "Standard_E48as_v4": 3.722000, - "Standard_E48as_v5": 3.360000, - "Standard_E48bds_v5": 4.944000, - "Standard_E48bs_v5": 4.440000, - "Standard_E48d_v4": 4.224000, - "Standard_E48d_v5": 4.224000, - "Standard_E48ds_v4": 4.224000, - "Standard_E48ds_v5": 4.224000, - "Standard_E48s_v3": 3.629000, - "Standard_E48s_v4": 3.722000, - "Standard_E48s_v5": 3.722000, - "Standard_E4_v3": 0.302000, - "Standard_E4_v4": 0.310000, - "Standard_E4_v5": 0.310000, - "Standard_E4a_v4": 0.310000, - "Standard_E4ads_v5": 0.322000, - "Standard_E4as_v4": 0.310000, - "Standard_E4as_v5": 0.280000, - "Standard_E4bds_v5": 0.412000, - "Standard_E4bs_v5": 0.370000, - "Standard_E4d_v4": 0.352000, - "Standard_E4d_v5": 0.352000, - "Standard_E4ds_v4": 0.352000, - "Standard_E4ds_v5": 0.352000, - "Standard_E4s_v3": 0.302000, - "Standard_E4s_v4": 0.310000, - "Standard_E4s_v5": 0.310000, - "Standard_E64-16ads_v5": 5.149000, - "Standard_E64-16as_v4": 4.963000, - "Standard_E64-16as_v5": 4.480000, - "Standard_E64-16ds_v4": 5.632000, - "Standard_E64-16ds_v5": 5.632000, - "Standard_E64-16s_v3": 4.355000, - "Standard_E64-16s_v4": 4.963000, - "Standard_E64-16s_v5": 4.963000, - "Standard_E64-32ads_v5": 5.149000, - "Standard_E64-32as_v4": 4.963000, - "Standard_E64-32as_v5": 4.480000, - "Standard_E64-32ds_v4": 5.632000, - "Standard_E64-32ds_v5": 5.632000, - "Standard_E64-32s_v3": 4.355000, - "Standard_E64-32s_v4": 4.963000, - "Standard_E64-32s_v5": 4.963000, - "Standard_E64_v3": 4.355000, - "Standard_E64_v4": 4.963000, - "Standard_E64_v5": 4.963000, - "Standard_E64a_v4": 4.963000, - "Standard_E64ads_v5": 5.149000, - "Standard_E64as_v4": 4.963000, - "Standard_E64as_v5": 4.480000, - "Standard_E64bds_v5": 6.592000, - "Standard_E64bs_v5": 5.920000, - "Standard_E64d_v4": 5.632000, - "Standard_E64d_v5": 5.632000, - "Standard_E64ds_v4": 5.632000, - "Standard_E64ds_v5": 5.632000, - "Standard_E64i_v3": 4.376000, - "Standard_E64is_v3": 4.376000, - "Standard_E64s_v3": 4.355000, - "Standard_E64s_v4": 4.963000, - "Standard_E64s_v5": 4.963000, - "Standard_E8-2ads_v5": 0.644000, - "Standard_E8-2as_v4": 0.620000, - "Standard_E8-2as_v5": 0.560000, - "Standard_E8-2ds_v4": 0.704000, - "Standard_E8-2ds_v5": 0.704000, - "Standard_E8-2s_v3": 0.605000, - "Standard_E8-2s_v4": 0.620000, - "Standard_E8-2s_v5": 0.620000, - "Standard_E8-4ads_v5": 0.644000, - "Standard_E8-4as_v4": 0.620000, - "Standard_E8-4as_v5": 0.560000, - "Standard_E8-4ds_v4": 0.704000, - "Standard_E8-4ds_v5": 0.704000, - "Standard_E8-4s_v3": 0.605000, - "Standard_E8-4s_v4": 0.620000, - "Standard_E8-4s_v5": 0.620000, - "Standard_E80ids_v4": 7.040000, - "Standard_E80is_v4": 6.200000, - "Standard_E8_v3": 0.605000, - "Standard_E8_v4": 0.620000, - "Standard_E8_v5": 0.620000, - "Standard_E8a_v4": 0.620000, - "Standard_E8ads_v5": 0.644000, - "Standard_E8as_v4": 0.620000, - "Standard_E8as_v5": 0.560000, - "Standard_E8bds_v5": 0.824000, - "Standard_E8bs_v5": 0.740000, - "Standard_E8d_v4": 0.704000, - "Standard_E8d_v5": 0.704000, - "Standard_E8ds_v4": 0.704000, - "Standard_E8ds_v5": 0.704000, - "Standard_E8s_v3": 0.605000, - "Standard_E8s_v4": 0.620000, - "Standard_E8s_v5": 0.620000, - "Standard_E96-24ads_v5": 7.723000, - "Standard_E96-24as_v4": 7.445000, - "Standard_E96-24as_v5": 6.720000, - "Standard_E96-24ds_v5": 8.448000, - "Standard_E96-24s_v5": 7.445000, - "Standard_E96-48ads_v5": 7.723000, - "Standard_E96-48as_v4": 7.445000, - "Standard_E96-48as_v5": 6.720000, - "Standard_E96-48ds_v5": 8.448000, - "Standard_E96-48s_v5": 7.445000, - "Standard_E96_v5": 7.445000, - "Standard_E96a_v4": 7.445000, - "Standard_E96ads_v5": 7.723000, - "Standard_E96as_v4": 7.445000, - "Standard_E96as_v5": 6.720000, - "Standard_E96bds_v5": 9.888000, - "Standard_E96bs_v5": 8.880000, - "Standard_E96d_v5": 8.448000, - "Standard_E96ds_v5": 8.448000, - "Standard_E96iads_v5": 8.496000, - "Standard_E96ias_v4": 7.445000, - "Standard_E96ias_v5": 7.392000, - "Standard_E96s_v5": 7.445000, - "Standard_EC16ads_v5": 1.287000, - "Standard_EC16as_v5": 1.120000, - "Standard_EC20ads_v5": 1.609000, - "Standard_EC20as_v5": 1.400000, - "Standard_EC2ads_v5": 0.161000, - "Standard_EC2as_v5": 0.140000, - "Standard_EC32ads_v5": 2.574000, - "Standard_EC32as_v5": 2.240000, - "Standard_EC48ads_v5": 3.862000, - "Standard_EC48as_v5": 3.360000, - "Standard_EC4ads_v5": 0.322000, - "Standard_EC4as_v5": 0.280000, - "Standard_EC64ads_v5": 5.149000, - "Standard_EC64as_v5": 4.480000, - "Standard_EC8ads_v5": 0.644000, - "Standard_EC8as_v5": 0.560000, - "Standard_EC96ads_v5": 7.723000, - "Standard_EC96as_v5": 6.720000, - "Standard_EC96iads_v5": 8.496000, - "Standard_EC96ias_v5": 7.392000, - "Standard_F1": 0.059700, - "Standard_F16": 0.955000, - "Standard_F16s": 0.955000, - "Standard_F16s_v2": 0.816000, - "Standard_F1s": 0.059700, - "Standard_F2": 0.119000, - "Standard_F2s": 0.119000, - "Standard_F2s_v2": 0.102000, - "Standard_F32s_v2": 1.632000, - "Standard_F4": 0.239000, - "Standard_F48s_v2": 2.448000, - "Standard_F4s": 0.239000, - "Standard_F4s_v2": 0.204000, - "Standard_F64s_v2": 3.264000, - "Standard_F72s_v2": 3.672000, - "Standard_F8": 0.478000, - "Standard_F8s": 0.478000, - "Standard_F8s_v2": 0.408000, - "Standard_HB120-16rs_v2": 4.752000, - "Standard_HB120-32rs_v2": 4.752000, - "Standard_HB120-64rs_v2": 4.752000, - "Standard_HB120-96rs_v2": 4.752000, - "Standard_HB120rs_v2": 4.752000, - "Standard_L16as_v3": 1.512000, - "Standard_L16s_v3": 1.688000, - "Standard_L32as_v3": 3.024000, - "Standard_L32s_v3": 3.376000, - "Standard_L48as_v3": 4.536000, - "Standard_L48s_v3": 5.064000, - "Standard_L64as_v3": 6.048000, - "Standard_L64s_v3": 6.752000, - "Standard_L80as_v3": 7.560000, - "Standard_L80s_v3": 8.440000, - "Standard_L8as_v3": 0.756000, - "Standard_L8s_v3": 0.844000, - "Standard_M128": 17.606000, - "Standard_M128-32ms": 35.228000, - "Standard_M128-64ms": 35.228000, - "Standard_M128dms_v2": 35.231000, - "Standard_M128ds_v2": 17.609000, - "Standard_M128m": 35.228000, - "Standard_M128ms": 35.228000, - "Standard_M128ms_v2": 34.675000, - "Standard_M128s": 17.606000, - "Standard_M128s_v2": 17.053000, - "Standard_M16-4ms": 4.056000, - "Standard_M16-8ms": 4.056000, - "Standard_M16ms": 4.056000, - "Standard_M16s": 3.151000, - "Standard_M192idms_v2": 42.324000, - "Standard_M192ids_v2": 21.162000, - "Standard_M192ims_v2": 41.769000, - "Standard_M192is_v2": 20.607000, - "Standard_M208-104ms_v2": 58.898000, - "Standard_M208-104s_v2": 29.449000, - "Standard_M208-52ms_v2": 58.898000, - "Standard_M208-52s_v2": 29.449000, - "Standard_M208ms_v2": 58.898000, - "Standard_M208s_v2": 29.449000, - "Standard_M32-16ms": 8.113000, - "Standard_M32-8ms": 8.113000, - "Standard_M32dms_v2": 8.113000, - "Standard_M32ls": 3.535000, - "Standard_M32ms": 8.113000, - "Standard_M32ms_v2": 7.974000, - "Standard_M32s": 4.402200, - "Standard_M32ts": 3.331000, - "Standard_M416-104ms_v2": 130.880000, - "Standard_M416-104s_v2": 65.446000, - "Standard_M416-208ms_v2": 130.880000, - "Standard_M416-208s_v2": 65.446000, - "Standard_M416is_v2": 65.446000, - "Standard_M416ms_v2": 130.880000, - "Standard_M416s_8_v2": 94.540000, - "Standard_M416s_v2": 65.446000, - "Standard_M64": 8.803000, - "Standard_M64-16ms": 13.645000, - "Standard_M64-32ms": 13.645000, - "Standard_M64dms_v2": 13.649000, - "Standard_M64ds_v2": 8.803000, - "Standard_M64ls": 6.664000, - "Standard_M64m": 13.645000, - "Standard_M64ms": 13.645000, - "Standard_M64ms_v2": 13.371000, - "Standard_M64s": 8.803000, - "Standard_M64s_v2": 8.525000, - "Standard_M8-2ms": 2.028000, - "Standard_M8-4ms": 2.028000, - "Standard_M8ms": 2.028000, - "Standard_ND96ams_A100_v4": 46.861000, - "Standard_ND96amsr_A100_v4": 46.861000, - "Standard_NV12ads_A10_v5": 1.298000, - "Standard_NV12s_v3": 1.391000, - "Standard_NV18ads_A10_v5": 2.288000, - "Standard_NV24s_v3": 2.782000, - "Standard_NV36adms_A10_v5": 6.464000, - "Standard_NV36ads_A10_v5": 4.576000, - "Standard_NV48s_v3": 5.563000, - "Standard_NV6ads_A10_v5": 0.649000, - "Standard_NV72ads_A10_v5": 9.324000, - } - // uksouth - initialOnDemandPrices["uksouth"] = map[string]float64{ - "Basic_A0": 0.020000, - "Basic_A1": 0.026000, - "Basic_A2": 0.101000, - "Basic_A3": 0.224000, - "Basic_A4": 0.449000, - "DCdsv3 Type1": 6.917000, - "DCsv2 Type 1": 0.977000, - "DCsv3 Type1": 5.861000, - "Dadsv5_Type1": 7.392000, - "Dasv4_Type1": 5.861000, - "Dasv4_Type2": 6.105000, - "Dasv5_Type1": 6.160000, - "Ddsv4_Type 1": 4.611000, - "Ddsv4_Type2": 5.476000, - "Ddsv5_Type1": 6.917000, - "Dsv3_Type3": 4.885000, - "Dsv3_Type4": 6.106000, - "Dsv4_Type1": 4.884000, - "Dsv4_Type2": 5.861000, - "Dsv5_Type1": 6.105000, - "Eadsv5_Type1": 8.131000, - "Easv4_Type1": 7.814000, - "Easv4_Type2": 7.814000, - "Easv5_Type1": 7.022000, - "Ebdsv5-Type1": 6.952000, - "Ebsv5-Type1": 6.213000, - "Edsv4_Type 1": 5.949000, - "Edsv4_Type2": 7.064000, - "Edsv5_Type1": 8.923000, - "Esv3_Type3": 5.043000, - "Esv3_Type4": 6.832000, - "Esv4_Type1": 5.209000, - "Esv4_Type2": 6.838000, - "Esv5_Type1": 7.814000, - "Fsv2 Type3": 4.666000, - "Fsv2_Type2": 4.000000, - "Fsv2_Type4": 5.333000, - "Lsv2_Type1": 7.962000, - "Lsv3_Type1": 8.888000, - "Mdsmv2MedMem _Type1": 36.992000, - "Mdsv2MedMem_Type1": 18.489000, - "Ms_Type1": 18.483000, - "Msm_Type1": 36.998000, - "Msmv2MedMem Type1": 36.409000, - "Msmv2_Type1": 136.330000, - "Msv2MedMem Type1": 17.906000, - "Msv2_Type1": 68.173000, - "NVasv4_Type1": 8.970000, - "NVsv3_Type1": 6.270000, - "Standard_A0": 0.022000, - "Standard_A1": 0.066000, - "Standard_A1_v2": 0.050000, - "Standard_A2": 0.132000, - "Standard_A2_v2": 0.106000, - "Standard_A2m_v2": 0.178000, - "Standard_A3": 0.264000, - "Standard_A4": 0.528000, - "Standard_A4_v2": 0.222000, - "Standard_A4m_v2": 0.374000, - "Standard_A5": 0.297000, - "Standard_A6": 0.594000, - "Standard_A7": 1.188000, - "Standard_A8_v2": 0.467000, - "Standard_A8m_v2": 0.786000, - "Standard_B12ms": 0.566000, - "Standard_B16als_v2": 0.676000, - "Standard_B16as_v2": 0.754000, - "Standard_B16ls_v2": 0.742000, - "Standard_B16ms": 0.755000, - "Standard_B16pls_v2": 0.533000, - "Standard_B16ps_v2": 0.675000, - "Standard_B16s_v2": 0.755000, - "Standard_B1ls": 0.005900, - "Standard_B1ms": 0.023600, - "Standard_B1s": 0.011800, - "Standard_B20ms": 0.944000, - "Standard_B2als_v2": 0.051700, - "Standard_B2as_v2": 0.094200, - "Standard_B2ats_v2": 0.019800, - "Standard_B2ls_v2": 0.056400, - "Standard_B2ms": 0.094400, - "Standard_B2pls_v2": 0.037600, - "Standard_B2ps_v2": 0.075200, - "Standard_B2pts_v2": 0.018600, - "Standard_B2s": 0.047200, - "Standard_B2s_v2": 0.094400, - "Standard_B2ts_v2": 0.011800, - "Standard_B32als_v2": 1.351000, - "Standard_B32as_v2": 1.507000, - "Standard_B32ls_v2": 1.337000, - "Standard_B32s_v2": 1.510000, - "Standard_B4als_v2": 0.151000, - "Standard_B4as_v2": 0.170000, - "Standard_B4ls_v2": 0.186000, - "Standard_B4ms": 0.189000, - "Standard_B4pls_v2": 0.133000, - "Standard_B4ps_v2": 0.150000, - "Standard_B4s_v2": 0.207000, - "Standard_B8als_v2": 0.301000, - "Standard_B8as_v2": 0.377000, - "Standard_B8ls_v2": 0.371000, - "Standard_B8ms": 0.378000, - "Standard_B8pls_v2": 0.303000, - "Standard_B8ps_v2": 0.301000, - "Standard_B8s_v2": 0.378000, - "Standard_D11_v2": 0.234000, - "Standard_D11_v2_Promo": 0.234000, - "Standard_D12_v2": 0.469000, - "Standard_D12_v2_Promo": 0.469000, - "Standard_D13_v2": 0.937000, - "Standard_D13_v2_Promo": 0.937000, - "Standard_D14_v2": 1.874000, - "Standard_D14_v2_Promo": 1.874000, - "Standard_D15_v2": 2.343000, - "Standard_D15i_v2": 2.343000, - "Standard_D16_v3": 0.928000, - "Standard_D16_v4": 0.888000, - "Standard_D16_v5": 0.888000, - "Standard_D16a_v4": 0.888000, - "Standard_D16ads_v5": 0.960000, - "Standard_D16as_v4": 0.888000, - "Standard_D16as_v5": 0.800000, - "Standard_D16d_v4": 1.048000, - "Standard_D16d_v5": 1.048000, - "Standard_D16ds_v4": 1.048000, - "Standard_D16ds_v5": 1.048000, - "Standard_D16lds_v5": 0.920000, - "Standard_D16ls_v5": 0.808000, - "Standard_D16pds_v5": 0.834000, - "Standard_D16plds_v5": 0.736000, - "Standard_D16pls_v5": 0.646000, - "Standard_D16ps_v5": 0.710000, - "Standard_D16s_v3": 0.928000, - "Standard_D16s_v4": 0.888000, - "Standard_D16s_v5": 0.888000, - "Standard_D1_v2": 0.087800, - "Standard_D2_v2": 0.176000, - "Standard_D2_v2_Promo": 0.176000, - "Standard_D2_v3": 0.116000, - "Standard_D2_v4": 0.111000, - "Standard_D2_v5": 0.111000, - "Standard_D2a_v4": 0.111000, - "Standard_D2ads_v5": 0.120000, - "Standard_D2as_v4": 0.111000, - "Standard_D2as_v5": 0.100000, - "Standard_D2d_v4": 0.131000, - "Standard_D2d_v5": 0.131000, - "Standard_D2ds_v4": 0.131000, - "Standard_D2ds_v5": 0.131000, - "Standard_D2lds_v5": 0.115000, - "Standard_D2ls_v5": 0.101000, - "Standard_D2pds_v5": 0.104000, - "Standard_D2plds_v5": 0.092000, - "Standard_D2pls_v5": 0.080800, - "Standard_D2ps_v5": 0.088800, - "Standard_D2s_v3": 0.116000, - "Standard_D2s_v4": 0.111000, - "Standard_D2s_v5": 0.111000, - "Standard_D32-16s_v3": 1.856000, - "Standard_D32-8s_v3": 1.856000, - "Standard_D32_v3": 1.856000, - "Standard_D32_v4": 1.776000, - "Standard_D32_v5": 1.776000, - "Standard_D32a_v4": 1.776000, - "Standard_D32ads_v5": 1.920000, - "Standard_D32as_v4": 1.776000, - "Standard_D32as_v5": 1.600000, - "Standard_D32d_v4": 2.096000, - "Standard_D32d_v5": 2.096000, - "Standard_D32ds_v4": 2.096000, - "Standard_D32ds_v5": 2.096000, - "Standard_D32lds_v5": 1.840000, - "Standard_D32ls_v5": 1.616000, - "Standard_D32pds_v5": 1.667000, - "Standard_D32plds_v5": 1.472000, - "Standard_D32pls_v5": 1.293000, - "Standard_D32ps_v5": 1.421000, - "Standard_D32s_v3": 1.856000, - "Standard_D32s_v4": 1.776000, - "Standard_D32s_v5": 1.776000, - "Standard_D3_v2": 0.351000, - "Standard_D3_v2_Promo": 0.351000, - "Standard_D48_v3": 2.784000, - "Standard_D48_v4": 2.664000, - "Standard_D48_v5": 2.664000, - "Standard_D48a_v4": 2.664000, - "Standard_D48ads_v5": 2.880000, - "Standard_D48as_v4": 2.664000, - "Standard_D48as_v5": 2.400000, - "Standard_D48d_v4": 3.144000, - "Standard_D48d_v5": 3.144000, - "Standard_D48ds_v4": 3.144000, - "Standard_D48ds_v5": 3.144000, - "Standard_D48lds_v5": 2.760000, - "Standard_D48ls_v5": 2.424000, - "Standard_D48pds_v5": 2.501000, - "Standard_D48plds_v5": 2.208000, - "Standard_D48pls_v5": 1.939000, - "Standard_D48ps_v5": 2.131000, - "Standard_D48s_v3": 2.784000, - "Standard_D48s_v4": 2.664000, - "Standard_D48s_v5": 2.664000, - "Standard_D4_v2": 0.702000, - "Standard_D4_v2_Promo": 0.702000, - "Standard_D4_v3": 0.232000, - "Standard_D4_v4": 0.222000, - "Standard_D4_v5": 0.222000, - "Standard_D4a_v4": 0.222000, - "Standard_D4ads_v5": 0.240000, - "Standard_D4as_v4": 0.222000, - "Standard_D4as_v5": 0.200000, - "Standard_D4d_v4": 0.262000, - "Standard_D4d_v5": 0.262000, - "Standard_D4ds_v4": 0.262000, - "Standard_D4ds_v5": 0.262000, - "Standard_D4lds_v5": 0.230000, - "Standard_D4ls_v5": 0.202000, - "Standard_D4pds_v5": 0.208000, - "Standard_D4plds_v5": 0.184000, - "Standard_D4pls_v5": 0.162000, - "Standard_D4ps_v5": 0.178000, - "Standard_D4s_v3": 0.232000, - "Standard_D4s_v4": 0.222000, - "Standard_D4s_v5": 0.222000, - "Standard_D5_v2": 1.405000, - "Standard_D5_v2_Promo": 1.405000, - "Standard_D64-16s_v3": 3.712000, - "Standard_D64-32s_v3": 3.712000, - "Standard_D64_v3": 3.712000, - "Standard_D64_v4": 3.552000, - "Standard_D64_v5": 3.552000, - "Standard_D64a_v4": 3.552000, - "Standard_D64ads_v5": 3.840000, - "Standard_D64as_v4": 3.552000, - "Standard_D64as_v5": 3.200000, - "Standard_D64d_v4": 4.192000, - "Standard_D64d_v5": 4.192000, - "Standard_D64ds_v4": 4.192000, - "Standard_D64ds_v5": 4.192000, - "Standard_D64lds_v5": 3.680000, - "Standard_D64ls_v5": 3.232000, - "Standard_D64pds_v5": 3.334000, - "Standard_D64plds_v5": 2.944000, - "Standard_D64pls_v5": 2.586000, - "Standard_D64ps_v5": 2.842000, - "Standard_D64s_v3": 3.712000, - "Standard_D64s_v4": 3.552000, - "Standard_D64s_v5": 3.552000, - "Standard_D8_v3": 0.464000, - "Standard_D8_v4": 0.444000, - "Standard_D8_v5": 0.444000, - "Standard_D8a_v4": 0.444000, - "Standard_D8ads_v5": 0.480000, - "Standard_D8as_v4": 0.444000, - "Standard_D8as_v5": 0.400000, - "Standard_D8d_v4": 0.524000, - "Standard_D8d_v5": 0.524000, - "Standard_D8ds_v4": 0.524000, - "Standard_D8ds_v5": 0.524000, - "Standard_D8lds_v5": 0.460000, - "Standard_D8ls_v5": 0.404000, - "Standard_D8pds_v5": 0.417000, - "Standard_D8plds_v5": 0.368000, - "Standard_D8pls_v5": 0.323000, - "Standard_D8ps_v5": 0.355000, - "Standard_D8s_v3": 0.464000, - "Standard_D8s_v4": 0.444000, - "Standard_D8s_v5": 0.444000, - "Standard_D96_v5": 5.328000, - "Standard_D96a_v4": 5.328000, - "Standard_D96ads_v5": 5.760000, - "Standard_D96as_v4": 5.328000, - "Standard_D96as_v5": 4.800000, - "Standard_D96d_v5": 6.288000, - "Standard_D96ds_v5": 6.288000, - "Standard_D96lds_v5": 5.520000, - "Standard_D96ls_v5": 4.848000, - "Standard_D96s_v5": 5.328000, - "Standard_DC16ads_v5": 0.960000, - "Standard_DC16as_v5": 0.800000, - "Standard_DC16ds_v3": 2.096000, - "Standard_DC16s_v3": 1.776000, - "Standard_DC1ds_v3": 0.131000, - "Standard_DC1s_v2": 0.111000, - "Standard_DC1s_v3": 0.111000, - "Standard_DC24ds_v3": 3.144000, - "Standard_DC24s_v3": 2.664000, - "Standard_DC2ads_v5": 0.120000, - "Standard_DC2as_v5": 0.100000, - "Standard_DC2ds_v3": 0.262000, - "Standard_DC2s_v2": 0.222000, - "Standard_DC2s_v3": 0.222000, - "Standard_DC32ads_v5": 1.920000, - "Standard_DC32as_v5": 1.600000, - "Standard_DC32ds_v3": 4.192000, - "Standard_DC32s_v3": 3.552000, - "Standard_DC48ads_v5": 2.880000, - "Standard_DC48as_v5": 2.400000, - "Standard_DC48ds_v3": 6.288000, - "Standard_DC48s_v3": 5.328000, - "Standard_DC4ads_v5": 0.240000, - "Standard_DC4as_v5": 0.200000, - "Standard_DC4ds_v3": 0.524000, - "Standard_DC4s_v2": 0.444000, - "Standard_DC4s_v3": 0.444000, - "Standard_DC64ads_v5": 3.840000, - "Standard_DC64as_v5": 3.200000, - "Standard_DC8_v2": 0.888000, - "Standard_DC8ads_v5": 0.480000, - "Standard_DC8as_v5": 0.400000, - "Standard_DC8ds_v3": 1.048000, - "Standard_DC8s_v3": 0.888000, - "Standard_DC96ads_v5": 5.760000, - "Standard_DC96as_v5": 4.800000, - "Standard_DS11-1_v2": 0.234000, - "Standard_DS11_v2": 0.234000, - "Standard_DS11_v2_Promo": 0.234000, - "Standard_DS12-1_v2": 0.469000, - "Standard_DS12-2_v2": 0.469000, - "Standard_DS12_v2": 0.469000, - "Standard_DS12_v2_Promo": 0.469000, - "Standard_DS13-2_v2": 0.937000, - "Standard_DS13-4_v2": 0.937000, - "Standard_DS13_v2": 0.937000, - "Standard_DS13_v2_Promo": 0.937000, - "Standard_DS14-4_v2": 1.874000, - "Standard_DS14-8_v2": 1.874000, - "Standard_DS14_v2": 1.874000, - "Standard_DS14_v2_Promo": 1.874000, - "Standard_DS15_v2": 2.343000, - "Standard_DS15i_v2": 2.343000, - "Standard_DS1_v2": 0.087800, - "Standard_DS2_v2": 0.176000, - "Standard_DS2_v2_Promo": 0.176000, - "Standard_DS3_v2": 0.351000, - "Standard_DS3_v2_Promo": 0.351000, - "Standard_DS4_v2": 0.702000, - "Standard_DS4_v2_Promo": 0.702000, - "Standard_DS5_v2": 1.405000, - "Standard_DS5_v2_Promo": 1.405000, - "Standard_E104i_v5": 8.466000, - "Standard_E104id_v5": 9.667000, - "Standard_E104ids_v5": 9.667000, - "Standard_E104is_v5": 8.466000, - "Standard_E112iads_v5": 9.486000, - "Standard_E112ias_v5": 8.193000, - "Standard_E112ibds_v5": 12.166000, - "Standard_E112ibs_v5": 10.872000, - "Standard_E16-4ads_v5": 1.232000, - "Standard_E16-4as_v4": 1.184000, - "Standard_E16-4as_v5": 1.064000, - "Standard_E16-4ds_v4": 1.352000, - "Standard_E16-4ds_v5": 1.352000, - "Standard_E16-4s_v3": 1.248000, - "Standard_E16-4s_v4": 1.184000, - "Standard_E16-4s_v5": 1.184000, - "Standard_E16-8ads_v5": 1.232000, - "Standard_E16-8as_v4": 1.184000, - "Standard_E16-8as_v5": 1.064000, - "Standard_E16-8ds_v4": 1.352000, - "Standard_E16-8ds_v5": 1.352000, - "Standard_E16-8s_v3": 1.248000, - "Standard_E16-8s_v4": 1.184000, - "Standard_E16-8s_v5": 1.184000, - "Standard_E16_v3": 1.248000, - "Standard_E16_v4": 1.184000, - "Standard_E16_v5": 1.184000, - "Standard_E16a_v4": 1.184000, - "Standard_E16ads_v5": 1.232000, - "Standard_E16as_v4": 1.184000, - "Standard_E16as_v5": 1.064000, - "Standard_E16bds_v5": 1.580000, - "Standard_E16bs_v5": 1.412000, - "Standard_E16d_v4": 1.352000, - "Standard_E16d_v5": 1.352000, - "Standard_E16ds_v4": 1.352000, - "Standard_E16ds_v5": 1.352000, - "Standard_E16pds_v5": 1.083000, - "Standard_E16ps_v5": 0.947000, - "Standard_E16s_v3": 1.248000, - "Standard_E16s_v4": 1.184000, - "Standard_E16s_v5": 1.184000, - "Standard_E20_v3": 1.560000, - "Standard_E20_v4": 1.480000, - "Standard_E20_v5": 1.480000, - "Standard_E20a_v4": 1.480000, - "Standard_E20ads_v5": 1.540000, - "Standard_E20as_v4": 1.480000, - "Standard_E20as_v5": 1.330000, - "Standard_E20d_v4": 1.690000, - "Standard_E20d_v5": 1.690000, - "Standard_E20ds_v4": 1.690000, - "Standard_E20ds_v5": 1.690000, - "Standard_E20pds_v5": 1.354000, - "Standard_E20ps_v5": 1.184000, - "Standard_E20s_v3": 1.560000, - "Standard_E20s_v4": 1.480000, - "Standard_E20s_v5": 1.480000, - "Standard_E2_v3": 0.156000, - "Standard_E2_v4": 0.148000, - "Standard_E2_v5": 0.148000, - "Standard_E2a_v4": 0.148000, - "Standard_E2ads_v5": 0.154000, - "Standard_E2as_v4": 0.148000, - "Standard_E2as_v5": 0.133000, - "Standard_E2bds_v5": 0.198000, - "Standard_E2bs_v5": 0.177000, - "Standard_E2d_v4": 0.169000, - "Standard_E2d_v5": 0.169000, - "Standard_E2ds_v4": 0.169000, - "Standard_E2ds_v5": 0.169000, - "Standard_E2pds_v5": 0.135000, - "Standard_E2ps_v5": 0.118000, - "Standard_E2s_v3": 0.156000, - "Standard_E2s_v4": 0.148000, - "Standard_E2s_v5": 0.148000, - "Standard_E32-16ads_v5": 2.464000, - "Standard_E32-16as_v4": 2.368000, - "Standard_E32-16as_v5": 2.128000, - "Standard_E32-16ds_v4": 2.704000, - "Standard_E32-16ds_v5": 2.704000, - "Standard_E32-16s_v3": 2.496000, - "Standard_E32-16s_v4": 2.368000, - "Standard_E32-16s_v5": 2.368000, - "Standard_E32-8ads_v5": 2.464000, - "Standard_E32-8as_v4": 2.368000, - "Standard_E32-8as_v5": 2.128000, - "Standard_E32-8ds_v4": 2.704000, - "Standard_E32-8ds_v5": 2.704000, - "Standard_E32-8s_v3": 2.496000, - "Standard_E32-8s_v4": 2.368000, - "Standard_E32-8s_v5": 2.368000, - "Standard_E32_v3": 2.496000, - "Standard_E32_v4": 2.368000, - "Standard_E32_v5": 2.368000, - "Standard_E32a_v4": 2.368000, - "Standard_E32ads_v5": 2.464000, - "Standard_E32as_v4": 2.368000, - "Standard_E32as_v5": 2.128000, - "Standard_E32bds_v5": 3.160000, - "Standard_E32bs_v5": 2.824000, - "Standard_E32d_v4": 2.704000, - "Standard_E32d_v5": 2.704000, - "Standard_E32ds_v4": 2.704000, - "Standard_E32ds_v5": 2.704000, - "Standard_E32pds_v5": 2.166000, - "Standard_E32ps_v5": 1.894000, - "Standard_E32s_v3": 2.496000, - "Standard_E32s_v4": 2.368000, - "Standard_E32s_v5": 2.368000, - "Standard_E4-2ads_v5": 0.308000, - "Standard_E4-2as_v4": 0.296000, - "Standard_E4-2as_v5": 0.266000, - "Standard_E4-2ds_v4": 0.338000, - "Standard_E4-2ds_v5": 0.338000, - "Standard_E4-2s_v3": 0.312000, - "Standard_E4-2s_v4": 0.296000, - "Standard_E4-2s_v5": 0.296000, - "Standard_E48_v3": 3.553000, - "Standard_E48_v4": 3.552000, - "Standard_E48_v5": 3.552000, - "Standard_E48a_v4": 3.552000, - "Standard_E48ads_v5": 3.696000, - "Standard_E48as_v4": 3.552000, - "Standard_E48as_v5": 3.192000, - "Standard_E48bds_v5": 4.740000, - "Standard_E48bs_v5": 4.236000, - "Standard_E48d_v4": 4.056000, - "Standard_E48d_v5": 4.056000, - "Standard_E48ds_v4": 4.056000, - "Standard_E48ds_v5": 4.056000, - "Standard_E48s_v3": 3.553000, - "Standard_E48s_v4": 3.552000, - "Standard_E48s_v5": 3.552000, - "Standard_E4_v3": 0.312000, - "Standard_E4_v4": 0.296000, - "Standard_E4_v5": 0.296000, - "Standard_E4a_v4": 0.296000, - "Standard_E4ads_v5": 0.308000, - "Standard_E4as_v4": 0.296000, - "Standard_E4as_v5": 0.266000, - "Standard_E4bds_v5": 0.395000, - "Standard_E4bs_v5": 0.353000, - "Standard_E4d_v4": 0.338000, - "Standard_E4d_v5": 0.338000, - "Standard_E4ds_v4": 0.338000, - "Standard_E4ds_v5": 0.338000, - "Standard_E4pds_v5": 0.271000, - "Standard_E4ps_v5": 0.237000, - "Standard_E4s_v3": 0.312000, - "Standard_E4s_v4": 0.296000, - "Standard_E4s_v5": 0.296000, - "Standard_E64-16ads_v5": 4.928000, - "Standard_E64-16as_v4": 4.736000, - "Standard_E64-16as_v5": 4.256000, - "Standard_E64-16ds_v4": 5.408000, - "Standard_E64-16ds_v5": 5.408000, - "Standard_E64-16s_v3": 4.264000, - "Standard_E64-16s_v4": 4.736000, - "Standard_E64-16s_v5": 4.736000, - "Standard_E64-32ads_v5": 4.928000, - "Standard_E64-32as_v4": 4.736000, - "Standard_E64-32as_v5": 4.256000, - "Standard_E64-32ds_v4": 5.408000, - "Standard_E64-32ds_v5": 5.408000, - "Standard_E64-32s_v3": 4.264000, - "Standard_E64-32s_v4": 4.736000, - "Standard_E64-32s_v5": 4.736000, - "Standard_E64_v3": 4.264000, - "Standard_E64_v4": 4.736000, - "Standard_E64_v5": 4.736000, - "Standard_E64a_v4": 4.736000, - "Standard_E64ads_v5": 4.928000, - "Standard_E64as_v4": 4.736000, - "Standard_E64as_v5": 4.256000, - "Standard_E64bds_v5": 6.320000, - "Standard_E64bs_v5": 5.648000, - "Standard_E64d_v4": 5.408000, - "Standard_E64d_v5": 5.408000, - "Standard_E64ds_v4": 5.408000, - "Standard_E64ds_v5": 5.408000, - "Standard_E64i_v3": 4.264000, - "Standard_E64is_v3": 4.264000, - "Standard_E64s_v3": 4.264000, - "Standard_E64s_v4": 4.736000, - "Standard_E64s_v5": 4.736000, - "Standard_E8-2ads_v5": 0.616000, - "Standard_E8-2as_v4": 0.592000, - "Standard_E8-2as_v5": 0.532000, - "Standard_E8-2ds_v4": 0.676000, - "Standard_E8-2ds_v5": 0.676000, - "Standard_E8-2s_v3": 0.624000, - "Standard_E8-2s_v4": 0.592000, - "Standard_E8-2s_v5": 0.592000, - "Standard_E8-4ads_v5": 0.616000, - "Standard_E8-4as_v4": 0.592000, - "Standard_E8-4as_v5": 0.532000, - "Standard_E8-4ds_v4": 0.676000, - "Standard_E8-4ds_v5": 0.676000, - "Standard_E8-4s_v3": 0.624000, - "Standard_E8-4s_v4": 0.592000, - "Standard_E8-4s_v5": 0.592000, - "Standard_E80ids_v4": 6.760000, - "Standard_E80is_v4": 5.920000, - "Standard_E8_v3": 0.624000, - "Standard_E8_v4": 0.592000, - "Standard_E8_v5": 0.592000, - "Standard_E8a_v4": 0.592000, - "Standard_E8ads_v5": 0.616000, - "Standard_E8as_v4": 0.592000, - "Standard_E8as_v5": 0.532000, - "Standard_E8bds_v5": 0.790000, - "Standard_E8bs_v5": 0.706000, - "Standard_E8d_v4": 0.676000, - "Standard_E8d_v5": 0.676000, - "Standard_E8ds_v4": 0.676000, - "Standard_E8ds_v5": 0.676000, - "Standard_E8pds_v5": 0.542000, - "Standard_E8ps_v5": 0.474000, - "Standard_E8s_v3": 0.624000, - "Standard_E8s_v4": 0.592000, - "Standard_E8s_v5": 0.592000, - "Standard_E96-24ads_v5": 7.392000, - "Standard_E96-24as_v4": 7.104000, - "Standard_E96-24as_v5": 6.384000, - "Standard_E96-24ds_v5": 8.112000, - "Standard_E96-24s_v5": 7.104000, - "Standard_E96-48ads_v5": 7.392000, - "Standard_E96-48as_v4": 7.104000, - "Standard_E96-48as_v5": 6.384000, - "Standard_E96-48ds_v5": 8.112000, - "Standard_E96-48s_v5": 7.104000, - "Standard_E96_v5": 7.104000, - "Standard_E96a_v4": 7.104000, - "Standard_E96ads_v5": 7.392000, - "Standard_E96as_v4": 7.104000, - "Standard_E96as_v5": 6.384000, - "Standard_E96bds_v5": 9.480000, - "Standard_E96bs_v5": 8.472000, - "Standard_E96d_v5": 8.112000, - "Standard_E96ds_v5": 8.112000, - "Standard_E96iads_v5": 8.131000, - "Standard_E96ias_v5": 7.022000, - "Standard_E96s_v5": 7.104000, - "Standard_EC16ads_v5": 1.232000, - "Standard_EC16as_v5": 1.064000, - "Standard_EC20ads_v5": 1.540000, - "Standard_EC20as_v5": 1.330000, - "Standard_EC2ads_v5": 0.154000, - "Standard_EC2as_v5": 0.133000, - "Standard_EC32ads_v5": 2.464000, - "Standard_EC32as_v5": 2.128000, - "Standard_EC48ads_v5": 3.696000, - "Standard_EC48as_v5": 3.192000, - "Standard_EC4ads_v5": 0.308000, - "Standard_EC4as_v5": 0.266000, - "Standard_EC64ads_v5": 4.928000, - "Standard_EC64as_v5": 4.256000, - "Standard_EC8ads_v5": 0.616000, - "Standard_EC8as_v5": 0.532000, - "Standard_EC96ads_v5": 7.392000, - "Standard_EC96as_v5": 6.384000, - "Standard_EC96iads_v5": 8.131000, - "Standard_EC96ias_v5": 7.022000, - "Standard_F1": 0.059000, - "Standard_F16": 0.950000, - "Standard_F16s": 0.950000, - "Standard_F16s_v2": 0.808000, - "Standard_F1s": 0.059000, - "Standard_F2": 0.119000, - "Standard_F2s": 0.119000, - "Standard_F2s_v2": 0.101000, - "Standard_F32s_v2": 1.616000, - "Standard_F4": 0.237000, - "Standard_F48s_v2": 2.424000, - "Standard_F4s": 0.237000, - "Standard_F4s_v2": 0.202000, - "Standard_F64s_v2": 3.232000, - "Standard_F72s_v2": 3.636000, - "Standard_F8": 0.475000, - "Standard_F8s": 0.475000, - "Standard_F8s_v2": 0.404000, - "Standard_FX12mds": 1.320000, - "Standard_FX24mds": 2.640000, - "Standard_FX36mds": 3.960000, - "Standard_FX48mds": 5.280000, - "Standard_FX4mds": 0.440000, - "Standard_G1": 0.439000, - "Standard_G2": 0.878000, - "Standard_G3": 1.757000, - "Standard_G4": 3.514000, - "Standard_G5": 7.027000, - "Standard_GS1": 0.439000, - "Standard_GS2": 0.878000, - "Standard_GS3": 1.757000, - "Standard_GS4": 3.514000, - "Standard_GS4-4": 3.514000, - "Standard_GS4-8": 3.514000, - "Standard_GS5": 7.027000, - "Standard_GS5-16": 7.027000, - "Standard_GS5-8": 7.027000, - "Standard_H16": 1.902000, - "Standard_H16m": 2.549000, - "Standard_H16mr": 2.803000, - "Standard_H16r": 2.092000, - "Standard_H8": 0.951000, - "Standard_H8m": 1.274000, - "Standard_HB120-16rs_v3": 4.500000, - "Standard_HB120-32rs_v3": 4.500000, - "Standard_HB120-64rs_v3": 4.500000, - "Standard_HB120-96rs_v3": 4.500000, - "Standard_HB120rs_v3": 4.500000, - "Standard_HC44-16rs": 3.960000, - "Standard_HC44-32rs": 3.960000, - "Standard_HC44rs": 3.960000, - "Standard_L112ias_v3": 11.150000, - "Standard_L16as_v3": 1.448000, - "Standard_L16s": 1.448000, - "Standard_L16s_v2": 1.448000, - "Standard_L16s_v3": 1.616000, - "Standard_L32as_v3": 2.896000, - "Standard_L32s": 2.895000, - "Standard_L32s_v2": 2.895000, - "Standard_L32s_v3": 3.232000, - "Standard_L48as_v3": 4.344000, - "Standard_L48s_v2": 4.343000, - "Standard_L48s_v3": 4.848000, - "Standard_L4s": 0.362000, - "Standard_L64as_v3": 5.792000, - "Standard_L64s_v2": 5.791000, - "Standard_L64s_v3": 6.464000, - "Standard_L80as_v3": 7.240000, - "Standard_L80s_v2": 7.238000, - "Standard_L80s_v3": 8.080000, - "Standard_L8as_v3": 0.724000, - "Standard_L8s": 0.724000, - "Standard_L8s_v2": 0.724000, - "Standard_L8s_v3": 0.808000, - "Standard_L96ias_v3": 9.557000, - "Standard_M128": 16.806000, - "Standard_M128-32ms": 33.624000, - "Standard_M128-64ms": 33.624000, - "Standard_M128dms_v2": 33.629000, - "Standard_M128ds_v2": 16.808000, - "Standard_M128m": 33.624000, - "Standard_M128ms": 33.624000, - "Standard_M128ms_v2": 33.099000, - "Standard_M128s": 16.806000, - "Standard_M128s_v2": 16.278000, - "Standard_M16-4ms": 3.872000, - "Standard_M16-8ms": 3.872000, - "Standard_M16ms": 3.872000, - "Standard_M16s": 3.007600, - "Standard_M192idms_v2": 40.400000, - "Standard_M192ids_v2": 20.200000, - "Standard_M192ims_v2": 39.870000, - "Standard_M192is_v2": 19.670000, - "Standard_M208-104ms_v2": 55.775000, - "Standard_M208-104s_v2": 27.888000, - "Standard_M208-52ms_v2": 55.775000, - "Standard_M208-52s_v2": 27.888000, - "Standard_M208ms_v2": 55.775000, - "Standard_M208s_v2": 27.888000, - "Standard_M32-16ms": 7.744000, - "Standard_M32-8ms": 7.744000, - "Standard_M32dms_v2": 7.744000, - "Standard_M32ls": 3.361000, - "Standard_M32ms": 7.744000, - "Standard_M32ms_v2": 7.611000, - "Standard_M32s": 4.202000, - "Standard_M32ts": 3.167000, - "Standard_M416-104ms_v2": 123.940000, - "Standard_M416-104s_v2": 61.975000, - "Standard_M416-208ms_v2": 123.940000, - "Standard_M416-208s_v2": 61.975000, - "Standard_M416is_v2": 61.975000, - "Standard_M416ms_v2": 123.940000, - "Standard_M416s_8_v2": 82.640000, - "Standard_M416s_v2": 61.975000, - "Standard_M64": 8.403000, - "Standard_M64-16ms": 13.024000, - "Standard_M64-32ms": 13.024000, - "Standard_M64dms_v2": 13.028000, - "Standard_M64ds_v2": 8.403000, - "Standard_M64ls": 6.335550, - "Standard_M64m": 13.024000, - "Standard_M64ms": 13.024000, - "Standard_M64ms_v2": 12.763000, - "Standard_M64s": 8.403000, - "Standard_M64s_v2": 8.138000, - "Standard_M8-2ms": 1.936000, - "Standard_M8-4ms": 1.936000, - "Standard_M8ms": 1.936000, - "Standard_NC12": 2.566000, - "Standard_NC12s_v3": 7.178000, - "Standard_NC16as_T4_v3": 1.409000, - "Standard_NC24": 5.132000, - "Standard_NC24ads_A100_v4": 4.591000, - "Standard_NC24r": 5.645000, - "Standard_NC24rs_v3": 15.792000, - "Standard_NC24s_v3": 14.356000, - "Standard_NC48ads_A100_v4": 9.183000, - "Standard_NC4as_T4_v3": 0.615000, - "Standard_NC6": 1.283000, - "Standard_NC64as_T4_v3": 5.092000, - "Standard_NC6s_v3": 3.589000, - "Standard_NC8as_T4_v3": 0.880000, - "Standard_NC96ads_A100_v4": 18.365000, - "Standard_ND96ams_A100_v4": 40.962000, - "Standard_ND96amsr_A100_v4": 40.962000, - "Standard_NV12": 3.003000, - "Standard_NV12ads_A10_v5": 1.135000, - "Standard_NV12s_v3": 1.425000, - "Standard_NV16as_v4": 1.165000, - "Standard_NV18ads_A10_v5": 2.000000, - "Standard_NV24": 6.006000, - "Standard_NV24s_v3": 2.850000, - "Standard_NV32as_v4": 2.330000, - "Standard_NV36adms_A10_v5": 5.650000, - "Standard_NV36ads_A10_v5": 4.000000, - "Standard_NV48s_v3": 5.700000, - "Standard_NV4as_v4": 0.291000, - "Standard_NV6": 1.502000, - "Standard_NV6ads_A10_v5": 0.567000, - "Standard_NV72ads_A10_v5": 8.150000, - "Standard_NV8as_v4": 0.582000, - } - // ukwest - initialOnDemandPrices["ukwest"] = map[string]float64{ - "Basic_A0": 0.020000, - "Basic_A1": 0.026000, - "Basic_A2": 0.101000, - "Basic_A3": 0.224000, - "Basic_A4": 0.449000, - "DCsv2 Type 1": 1.022000, - "Dadsv5_Type1": 7.677000, - "Dasv5_Type1": 6.410000, - "Ddsv4_Type 1": 4.813000, - "Ddsv4_Type2": 5.715000, - "Ddsv5_Type1": 7.219000, - "Dsv3_Type3": 4.885000, - "Dsv3_Type4": 6.106000, - "Dsv4_Type1": 5.111000, - "Dsv4_Type2": 6.389000, - "Dsv5_Type1": 6.389000, - "Eadsv5_Type1": 8.369000, - "Easv5_Type1": 7.219000, - "Ebdsv5-Type1": 7.113000, - "Ebsv5-Type1": 6.346000, - "Edsv4_Type 1": 6.133000, - "Edsv4_Type2": 7.283000, - "Edsv5_Type1": 9.200000, - "Esv3_Type3": 5.049000, - "Esv3_Type4": 6.841000, - "Esv4_Type1": 5.367000, - "Esv4_Type2": 7.044000, - "Esv5_Type1": 8.050000, - "Fsv2 Type3": 5.111000, - "Fsv2_Type2": 4.000000, - "Fsv2_Type4": 5.556000, - "Lasv3_Type1": 8.305000, - "Lsv3_Type1": 9.290000, - "Mdsmv2MedMem _Type1": 35.524000, - "Mdsv2MedMem_Type1": 17.756000, - "Msmv2MedMem Type1": 34.964000, - "Msmv2_Type1": 131.970000, - "Msv2MedMem Type1": 17.195000, - "Msv2_Type1": 65.991000, - "Standard_A0": 0.022000, - "Standard_A1": 0.066000, - "Standard_A1_v2": 0.050000, - "Standard_A2": 0.132000, - "Standard_A2_v2": 0.106000, - "Standard_A2m_v2": 0.158000, - "Standard_A3": 0.264000, - "Standard_A4": 0.528000, - "Standard_A4_v2": 0.222000, - "Standard_A4m_v2": 0.333000, - "Standard_A5": 0.297000, - "Standard_A6": 0.594000, - "Standard_A7": 1.188000, - "Standard_A8_v2": 0.467000, - "Standard_A8m_v2": 0.699000, - "Standard_B12ms": 0.564000, - "Standard_B16als_v2": 0.645000, - "Standard_B16as_v2": 0.802000, - "Standard_B16ls_v2": 0.713000, - "Standard_B16ms": 0.752000, - "Standard_B16s_v2": 0.805000, - "Standard_B1ls": 0.005880, - "Standard_B1ms": 0.023500, - "Standard_B1s": 0.011800, - "Standard_B20ms": 0.940000, - "Standard_B2als_v2": 0.054700, - "Standard_B2as_v2": 0.100000, - "Standard_B2ats_v2": 0.020600, - "Standard_B2ls_v2": 0.059500, - "Standard_B2ms": 0.094000, - "Standard_B2s": 0.047000, - "Standard_B2s_v2": 0.110000, - "Standard_B2ts_v2": 0.021800, - "Standard_B32als_v2": 1.289000, - "Standard_B32as_v2": 1.603000, - "Standard_B32ls_v2": 1.426000, - "Standard_B32s_v2": 1.611000, - "Standard_B4als_v2": 0.161000, - "Standard_B4as_v2": 0.182000, - "Standard_B4ls_v2": 0.197000, - "Standard_B4ms": 0.188000, - "Standard_B4s_v2": 0.220000, - "Standard_B8als_v2": 0.322000, - "Standard_B8as_v2": 0.401000, - "Standard_B8ls_v2": 0.357000, - "Standard_B8ms": 0.376000, - "Standard_B8s_v2": 0.439000, - "Standard_D11_v2": 0.234000, - "Standard_D11_v2_Promo": 0.234000, - "Standard_D12_v2": 0.469000, - "Standard_D12_v2_Promo": 0.469000, - "Standard_D13_v2": 0.937000, - "Standard_D13_v2_Promo": 0.937000, - "Standard_D14_v2": 1.874000, - "Standard_D14_v2_Promo": 1.874000, - "Standard_D15_v2": 2.343000, - "Standard_D15i_v2": 2.343000, - "Standard_D16_v3": 0.928000, - "Standard_D16_v4": 0.929000, - "Standard_D16_v5": 0.929000, - "Standard_D16a_v4": 0.929000, - "Standard_D16ads_v5": 0.997000, - "Standard_D16as_v4": 0.929000, - "Standard_D16as_v5": 0.832000, - "Standard_D16d_v4": 1.094000, - "Standard_D16d_v5": 1.094000, - "Standard_D16ds_v4": 1.094000, - "Standard_D16ds_v5": 1.094000, - "Standard_D16lds_v5": 0.929000, - "Standard_D16ls_v5": 0.823000, - "Standard_D16s_v3": 0.928000, - "Standard_D16s_v4": 0.929000, - "Standard_D16s_v5": 0.929000, - "Standard_D1_v2": 0.087700, - "Standard_D2_v2": 0.175000, - "Standard_D2_v2_Promo": 0.175000, - "Standard_D2_v3": 0.116000, - "Standard_D2_v4": 0.116000, - "Standard_D2_v5": 0.116000, - "Standard_D2a_v4": 0.116000, - "Standard_D2ads_v5": 0.125000, - "Standard_D2as_v4": 0.116000, - "Standard_D2as_v5": 0.104000, - "Standard_D2d_v4": 0.137000, - "Standard_D2d_v5": 0.137000, - "Standard_D2ds_v4": 0.137000, - "Standard_D2ds_v5": 0.137000, - "Standard_D2lds_v5": 0.116000, - "Standard_D2ls_v5": 0.103000, - "Standard_D2s_v3": 0.116000, - "Standard_D2s_v4": 0.116000, - "Standard_D2s_v5": 0.116000, - "Standard_D32-16s_v3": 1.856000, - "Standard_D32-8s_v3": 1.856000, - "Standard_D32_v3": 1.856000, - "Standard_D32_v4": 1.859000, - "Standard_D32_v5": 1.859000, - "Standard_D32a_v4": 1.859000, - "Standard_D32ads_v5": 1.994000, - "Standard_D32as_v4": 1.859000, - "Standard_D32as_v5": 1.665000, - "Standard_D32d_v4": 2.188000, - "Standard_D32d_v5": 2.188000, - "Standard_D32ds_v4": 2.188000, - "Standard_D32ds_v5": 2.188000, - "Standard_D32lds_v5": 1.859000, - "Standard_D32ls_v5": 1.646000, - "Standard_D32s_v3": 1.856000, - "Standard_D32s_v4": 1.859000, - "Standard_D32s_v5": 1.859000, - "Standard_D3_v2": 0.351000, - "Standard_D3_v2_Promo": 0.351000, - "Standard_D48_v3": 2.784000, - "Standard_D48_v4": 2.788000, - "Standard_D48_v5": 2.788000, - "Standard_D48a_v4": 2.788000, - "Standard_D48ads_v5": 2.991000, - "Standard_D48as_v4": 2.788000, - "Standard_D48as_v5": 2.497000, - "Standard_D48d_v4": 3.282000, - "Standard_D48d_v5": 3.282000, - "Standard_D48ds_v4": 3.282000, - "Standard_D48ds_v5": 3.282000, - "Standard_D48lds_v5": 2.788000, - "Standard_D48ls_v5": 2.468000, - "Standard_D48s_v3": 2.784000, - "Standard_D48s_v4": 2.788000, - "Standard_D48s_v5": 2.788000, - "Standard_D4_v2": 0.702000, - "Standard_D4_v2_Promo": 0.702000, - "Standard_D4_v3": 0.232000, - "Standard_D4_v4": 0.232000, - "Standard_D4_v5": 0.232000, - "Standard_D4a_v4": 0.232000, - "Standard_D4ads_v5": 0.249000, - "Standard_D4as_v4": 0.232000, - "Standard_D4as_v5": 0.208000, - "Standard_D4d_v4": 0.273000, - "Standard_D4d_v5": 0.273000, - "Standard_D4ds_v4": 0.273000, - "Standard_D4ds_v5": 0.273000, - "Standard_D4lds_v5": 0.232000, - "Standard_D4ls_v5": 0.206000, - "Standard_D4s_v3": 0.232000, - "Standard_D4s_v4": 0.232000, - "Standard_D4s_v5": 0.232000, - "Standard_D5_v2": 1.404000, - "Standard_D5_v2_Promo": 1.404000, - "Standard_D64-16s_v3": 3.712000, - "Standard_D64-32s_v3": 3.712000, - "Standard_D64_v3": 3.712000, - "Standard_D64_v4": 3.717000, - "Standard_D64_v5": 3.717000, - "Standard_D64a_v4": 3.717000, - "Standard_D64ads_v5": 3.988000, - "Standard_D64as_v4": 3.717000, - "Standard_D64as_v5": 3.330000, - "Standard_D64d_v4": 4.375000, - "Standard_D64d_v5": 4.375000, - "Standard_D64ds_v4": 4.375000, - "Standard_D64ds_v5": 4.375000, - "Standard_D64lds_v5": 3.717000, - "Standard_D64ls_v5": 3.291000, - "Standard_D64s_v3": 3.712000, - "Standard_D64s_v4": 3.717000, - "Standard_D64s_v5": 3.717000, - "Standard_D8_v3": 0.464000, - "Standard_D8_v4": 0.465000, - "Standard_D8_v5": 0.465000, - "Standard_D8a_v4": 0.465000, - "Standard_D8ads_v5": 0.499000, - "Standard_D8as_v4": 0.465000, - "Standard_D8as_v5": 0.416000, - "Standard_D8d_v4": 0.547000, - "Standard_D8d_v5": 0.547000, - "Standard_D8ds_v4": 0.547000, - "Standard_D8ds_v5": 0.547000, - "Standard_D8lds_v5": 0.465000, - "Standard_D8ls_v5": 0.411000, - "Standard_D8s_v3": 0.464000, - "Standard_D8s_v4": 0.465000, - "Standard_D8s_v5": 0.465000, - "Standard_D96_v5": 5.576000, - "Standard_D96a_v4": 5.576000, - "Standard_D96ads_v5": 5.982000, - "Standard_D96as_v4": 5.576000, - "Standard_D96as_v5": 4.995000, - "Standard_D96d_v5": 6.563000, - "Standard_D96ds_v5": 6.563000, - "Standard_D96lds_v5": 5.576000, - "Standard_D96ls_v5": 4.937000, - "Standard_D96s_v5": 5.576000, - "Standard_DC1s_v2": 0.116000, - "Standard_DC2s_v2": 0.232000, - "Standard_DC4s_v2": 0.465000, - "Standard_DC8_v2": 0.929000, - "Standard_DS11-1_v2": 0.234000, - "Standard_DS11_v2": 0.234000, - "Standard_DS11_v2_Promo": 0.234000, - "Standard_DS12-1_v2": 0.469000, - "Standard_DS12-2_v2": 0.469000, - "Standard_DS12_v2": 0.469000, - "Standard_DS12_v2_Promo": 0.469000, - "Standard_DS13-2_v2": 0.937000, - "Standard_DS13-4_v2": 0.937000, - "Standard_DS13_v2": 0.937000, - "Standard_DS13_v2_Promo": 0.937000, - "Standard_DS14-4_v2": 1.874000, - "Standard_DS14-8_v2": 1.874000, - "Standard_DS14_v2": 1.874000, - "Standard_DS14_v2_Promo": 1.874000, - "Standard_DS15_v2": 2.343000, - "Standard_DS15i_v2": 2.343000, - "Standard_DS1_v2": 0.087700, - "Standard_DS2_v2": 0.175000, - "Standard_DS2_v2_Promo": 0.175000, - "Standard_DS3_v2": 0.351000, - "Standard_DS3_v2_Promo": 0.351000, - "Standard_DS4_v2": 0.702000, - "Standard_DS4_v2_Promo": 0.702000, - "Standard_DS5_v2": 1.404000, - "Standard_DS5_v2_Promo": 1.404000, - "Standard_E104i_v5": 8.721000, - "Standard_E104id_v5": 9.967000, - "Standard_E104ids_v5": 9.967000, - "Standard_E104is_v5": 8.721000, - "Standard_E112iads_v5": 9.764000, - "Standard_E112ias_v5": 8.423000, - "Standard_E112ibds_v5": 12.448000, - "Standard_E112ibs_v5": 11.106000, - "Standard_E16-4ads_v5": 1.268000, - "Standard_E16-4as_v4": 1.220000, - "Standard_E16-4as_v5": 1.094000, - "Standard_E16-4ds_v4": 1.394000, - "Standard_E16-4ds_v5": 1.394000, - "Standard_E16-4s_v3": 1.248000, - "Standard_E16-4s_v4": 1.220000, - "Standard_E16-4s_v5": 1.220000, - "Standard_E16-8ads_v5": 1.268000, - "Standard_E16-8as_v4": 1.220000, - "Standard_E16-8as_v5": 1.094000, - "Standard_E16-8ds_v4": 1.394000, - "Standard_E16-8ds_v5": 1.394000, - "Standard_E16-8s_v3": 1.248000, - "Standard_E16-8s_v4": 1.220000, - "Standard_E16-8s_v5": 1.220000, - "Standard_E16_v3": 1.248000, - "Standard_E16_v4": 1.220000, - "Standard_E16_v5": 1.220000, - "Standard_E16a_v4": 1.220000, - "Standard_E16ads_v5": 1.268000, - "Standard_E16as_v4": 1.220000, - "Standard_E16as_v5": 1.094000, - "Standard_E16bds_v5": 1.617000, - "Standard_E16bs_v5": 1.442000, - "Standard_E16d_v4": 1.394000, - "Standard_E16d_v5": 1.394000, - "Standard_E16ds_v4": 1.394000, - "Standard_E16ds_v5": 1.394000, - "Standard_E16s_v3": 1.248000, - "Standard_E16s_v4": 1.220000, - "Standard_E16s_v5": 1.220000, - "Standard_E20_v3": 1.560000, - "Standard_E20_v4": 1.525000, - "Standard_E20_v5": 1.525000, - "Standard_E20a_v4": 1.525000, - "Standard_E20ads_v5": 1.585000, - "Standard_E20as_v4": 1.525000, - "Standard_E20as_v5": 1.367000, - "Standard_E20d_v4": 1.742000, - "Standard_E20d_v5": 1.742000, - "Standard_E20ds_v4": 1.742000, - "Standard_E20ds_v5": 1.742000, - "Standard_E20s_v3": 1.560000, - "Standard_E20s_v4": 1.525000, - "Standard_E20s_v5": 1.525000, - "Standard_E2_v3": 0.156000, - "Standard_E2_v4": 0.152000, - "Standard_E2_v5": 0.152000, - "Standard_E2a_v4": 0.152000, - "Standard_E2ads_v5": 0.159000, - "Standard_E2as_v4": 0.152000, - "Standard_E2as_v5": 0.137000, - "Standard_E2bds_v5": 0.202000, - "Standard_E2bs_v5": 0.180000, - "Standard_E2d_v4": 0.174000, - "Standard_E2d_v5": 0.174000, - "Standard_E2ds_v4": 0.174000, - "Standard_E2ds_v5": 0.174000, - "Standard_E2s_v3": 0.156000, - "Standard_E2s_v4": 0.152000, - "Standard_E2s_v5": 0.152000, - "Standard_E32-16ads_v5": 2.536000, - "Standard_E32-16as_v4": 2.439000, - "Standard_E32-16as_v5": 2.188000, - "Standard_E32-16ds_v4": 2.788000, - "Standard_E32-16ds_v5": 2.788000, - "Standard_E32-16s_v3": 2.496000, - "Standard_E32-16s_v4": 2.439000, - "Standard_E32-16s_v5": 2.439000, - "Standard_E32-8ads_v5": 2.536000, - "Standard_E32-8as_v4": 2.439000, - "Standard_E32-8as_v5": 2.188000, - "Standard_E32-8ds_v4": 2.788000, - "Standard_E32-8ds_v5": 2.788000, - "Standard_E32-8s_v3": 2.496000, - "Standard_E32-8s_v4": 2.439000, - "Standard_E32-8s_v5": 2.439000, - "Standard_E32_v3": 2.496000, - "Standard_E32_v4": 2.439000, - "Standard_E32_v5": 2.439000, - "Standard_E32a_v4": 2.439000, - "Standard_E32ads_v5": 2.536000, - "Standard_E32as_v4": 2.439000, - "Standard_E32as_v5": 2.188000, - "Standard_E32bds_v5": 3.233000, - "Standard_E32bs_v5": 2.885000, - "Standard_E32d_v4": 2.788000, - "Standard_E32d_v5": 2.788000, - "Standard_E32ds_v4": 2.788000, - "Standard_E32ds_v5": 2.788000, - "Standard_E32s_v3": 2.496000, - "Standard_E32s_v4": 2.439000, - "Standard_E32s_v5": 2.439000, - "Standard_E4-2ads_v5": 0.317000, - "Standard_E4-2as_v4": 0.305000, - "Standard_E4-2as_v5": 0.273000, - "Standard_E4-2ds_v4": 0.348000, - "Standard_E4-2ds_v5": 0.348000, - "Standard_E4-2s_v3": 0.312000, - "Standard_E4-2s_v4": 0.305000, - "Standard_E4-2s_v5": 0.305000, - "Standard_E48_v3": 3.553000, - "Standard_E48_v4": 3.659000, - "Standard_E48_v5": 3.659000, - "Standard_E48a_v4": 3.659000, - "Standard_E48ads_v5": 3.804000, - "Standard_E48as_v4": 3.659000, - "Standard_E48as_v5": 3.282000, - "Standard_E48bds_v5": 4.850000, - "Standard_E48bs_v5": 4.327000, - "Standard_E48d_v4": 4.182000, - "Standard_E48d_v5": 4.182000, - "Standard_E48ds_v4": 4.182000, - "Standard_E48ds_v5": 4.182000, - "Standard_E48s_v3": 3.553000, - "Standard_E48s_v4": 3.659000, - "Standard_E48s_v5": 3.659000, - "Standard_E4_v3": 0.312000, - "Standard_E4_v4": 0.305000, - "Standard_E4_v5": 0.305000, - "Standard_E4a_v4": 0.305000, - "Standard_E4ads_v5": 0.317000, - "Standard_E4as_v4": 0.305000, - "Standard_E4as_v5": 0.273000, - "Standard_E4bds_v5": 0.404000, - "Standard_E4bs_v5": 0.361000, - "Standard_E4d_v4": 0.348000, - "Standard_E4d_v5": 0.348000, - "Standard_E4ds_v4": 0.348000, - "Standard_E4ds_v5": 0.348000, - "Standard_E4s_v3": 0.312000, - "Standard_E4s_v4": 0.305000, - "Standard_E4s_v5": 0.305000, - "Standard_E64-16ads_v5": 5.072000, - "Standard_E64-16as_v4": 4.879000, - "Standard_E64-16as_v5": 4.375000, - "Standard_E64-16ds_v4": 5.576000, - "Standard_E64-16ds_v5": 5.576000, - "Standard_E64-16s_v3": 4.264000, - "Standard_E64-16s_v4": 4.879000, - "Standard_E64-16s_v5": 4.879000, - "Standard_E64-32ads_v5": 5.072000, - "Standard_E64-32as_v4": 4.879000, - "Standard_E64-32as_v5": 4.375000, - "Standard_E64-32ds_v4": 5.576000, - "Standard_E64-32ds_v5": 5.576000, - "Standard_E64-32s_v3": 4.264000, - "Standard_E64-32s_v4": 4.879000, - "Standard_E64-32s_v5": 4.879000, - "Standard_E64_v3": 4.264000, - "Standard_E64_v4": 4.879000, - "Standard_E64_v5": 4.879000, - "Standard_E64a_v4": 4.879000, - "Standard_E64ads_v5": 5.072000, - "Standard_E64as_v4": 4.879000, - "Standard_E64as_v5": 4.375000, - "Standard_E64bds_v5": 6.466000, - "Standard_E64bs_v5": 5.769000, - "Standard_E64d_v4": 5.576000, - "Standard_E64d_v5": 5.576000, - "Standard_E64ds_v4": 5.576000, - "Standard_E64ds_v5": 5.576000, - "Standard_E64i_v3": 4.264000, - "Standard_E64is_v3": 4.264000, - "Standard_E64s_v3": 4.264000, - "Standard_E64s_v4": 4.879000, - "Standard_E64s_v5": 4.879000, - "Standard_E8-2ads_v5": 0.634000, - "Standard_E8-2as_v4": 0.610000, - "Standard_E8-2as_v5": 0.547000, - "Standard_E8-2ds_v4": 0.697000, - "Standard_E8-2ds_v5": 0.697000, - "Standard_E8-2s_v3": 0.624000, - "Standard_E8-2s_v4": 0.610000, - "Standard_E8-2s_v5": 0.610000, - "Standard_E8-4ads_v5": 0.634000, - "Standard_E8-4as_v4": 0.610000, - "Standard_E8-4as_v5": 0.547000, - "Standard_E8-4ds_v4": 0.697000, - "Standard_E8-4ds_v5": 0.697000, - "Standard_E8-4s_v3": 0.624000, - "Standard_E8-4s_v4": 0.610000, - "Standard_E8-4s_v5": 0.610000, - "Standard_E80ids_v4": 6.970000, - "Standard_E80is_v4": 6.098000, - "Standard_E8_v3": 0.624000, - "Standard_E8_v4": 0.610000, - "Standard_E8_v5": 0.610000, - "Standard_E8a_v4": 0.610000, - "Standard_E8ads_v5": 0.634000, - "Standard_E8as_v4": 0.610000, - "Standard_E8as_v5": 0.547000, - "Standard_E8bds_v5": 0.808000, - "Standard_E8bs_v5": 0.721000, - "Standard_E8d_v4": 0.697000, - "Standard_E8d_v5": 0.697000, - "Standard_E8ds_v4": 0.697000, - "Standard_E8ds_v5": 0.697000, - "Standard_E8s_v3": 0.624000, - "Standard_E8s_v4": 0.610000, - "Standard_E8s_v5": 0.610000, - "Standard_E96-24ads_v5": 7.608000, - "Standard_E96-24as_v4": 7.318000, - "Standard_E96-24as_v5": 6.563000, - "Standard_E96-24ds_v5": 8.364000, - "Standard_E96-24s_v5": 7.318000, - "Standard_E96-48ads_v5": 7.608000, - "Standard_E96-48as_v4": 7.318000, - "Standard_E96-48as_v5": 6.563000, - "Standard_E96-48ds_v5": 8.364000, - "Standard_E96-48s_v5": 7.318000, - "Standard_E96_v5": 7.318000, - "Standard_E96a_v4": 7.318000, - "Standard_E96ads_v5": 7.608000, - "Standard_E96as_v4": 7.318000, - "Standard_E96as_v5": 6.563000, - "Standard_E96bds_v5": 9.699000, - "Standard_E96bs_v5": 8.654000, - "Standard_E96d_v5": 8.364000, - "Standard_E96ds_v5": 8.364000, - "Standard_E96iads_v5": 8.369000, - "Standard_E96ias_v4": 7.318000, - "Standard_E96ias_v5": 7.219000, - "Standard_E96s_v5": 7.318000, - "Standard_F1": 0.059000, - "Standard_F16": 0.950000, - "Standard_F16s": 0.950000, - "Standard_F16s_v2": 0.809000, - "Standard_F1s": 0.059000, - "Standard_F2": 0.119000, - "Standard_F2s": 0.119000, - "Standard_F2s_v2": 0.101000, - "Standard_F32s_v2": 1.618000, - "Standard_F4": 0.237000, - "Standard_F48s_v2": 2.428000, - "Standard_F4s": 0.237000, - "Standard_F4s_v2": 0.202000, - "Standard_F64s_v2": 3.237000, - "Standard_F72s_v2": 3.641000, - "Standard_F8": 0.475000, - "Standard_F8s": 0.475000, - "Standard_F8s_v2": 0.405000, - "Standard_L16as_v3": 1.510000, - "Standard_L16s_v3": 1.689000, - "Standard_L32as_v3": 3.020000, - "Standard_L32s_v3": 3.378000, - "Standard_L48as_v3": 4.530000, - "Standard_L48s_v3": 5.068000, - "Standard_L64as_v3": 6.040000, - "Standard_L64s_v3": 6.757000, - "Standard_L80as_v3": 7.550000, - "Standard_L80s_v3": 8.446000, - "Standard_L8as_v3": 0.755000, - "Standard_L8s_v3": 0.845000, - "Standard_M128": 16.806000, - "Standard_M128-32ms": 33.624000, - "Standard_M128-64ms": 33.624000, - "Standard_M128dms_v2": 32.295000, - "Standard_M128ds_v2": 16.141000, - "Standard_M128m": 33.624000, - "Standard_M128ms": 33.624000, - "Standard_M128ms_v2": 31.785000, - "Standard_M128s": 16.806000, - "Standard_M128s_v2": 15.632000, - "Standard_M16-4ms": 3.872000, - "Standard_M16-8ms": 3.872000, - "Standard_M16ms": 3.872000, - "Standard_M16s": 3.007600, - "Standard_M192idms_v2": 38.797000, - "Standard_M192ids_v2": 19.398000, - "Standard_M192ims_v2": 38.287000, - "Standard_M192is_v2": 18.888000, - "Standard_M208-104ms_v2": 53.990000, - "Standard_M208-104s_v2": 26.995000, - "Standard_M208-52ms_v2": 53.990000, - "Standard_M208-52s_v2": 26.995000, - "Standard_M208ms_v2": 53.990000, - "Standard_M208s_v2": 26.995000, - "Standard_M32-16ms": 7.744000, - "Standard_M32-8ms": 7.744000, - "Standard_M32dms_v2": 7.436000, - "Standard_M32ls": 3.361000, - "Standard_M32ms": 7.744000, - "Standard_M32ms_v2": 7.310000, - "Standard_M32s": 4.202000, - "Standard_M32ts": 3.167000, - "Standard_M416-104ms_v2": 119.970000, - "Standard_M416-104s_v2": 59.992000, - "Standard_M416-208ms_v2": 119.970000, - "Standard_M416-208s_v2": 59.992000, - "Standard_M416is_v2": 59.992000, - "Standard_M416ms_v2": 119.970000, - "Standard_M416s_8_v2": 86.600000, - "Standard_M416s_v2": 59.992000, - "Standard_M64": 8.403000, - "Standard_M64-16ms": 13.024000, - "Standard_M64-32ms": 13.024000, - "Standard_M64dms_v2": 12.511000, - "Standard_M64ds_v2": 8.069000, - "Standard_M64ls": 6.335550, - "Standard_M64m": 13.024000, - "Standard_M64ms": 13.024000, - "Standard_M64ms_v2": 12.257000, - "Standard_M64s": 8.403000, - "Standard_M64s_v2": 7.815000, - "Standard_M8-2ms": 1.936000, - "Standard_M8-4ms": 1.936000, - "Standard_M8ms": 1.936000, - "Standard_ND96ams_A100_v4": 42.929000, - "Standard_ND96amsr_A100_v4": 42.929000, - } - // westcentralus - initialOnDemandPrices["westcentralus"] = map[string]float64{ - "Basic_A0": 0.018000, - "Basic_A1": 0.025000, - "Basic_A2": 0.079000, - "Basic_A3": 0.176000, - "Basic_A4": 0.352000, - "Dadsv5_Type1": 7.614000, - "Dasv4_Type1": 6.083000, - "Dasv4_Type2": 6.083000, - "Dasv5_Type1": 6.357000, - "Ddsv4_Type 1": 4.773000, - "Ddsv4_Type2": 5.668000, - "Ddsv5_Type1": 7.160000, - "Dsv3_Type3": 5.069000, - "Dsv3_Type4": 6.336000, - "Dsv4_Type1": 5.069000, - "Dsv4_Type2": 6.336000, - "Dsv5_Type1": 6.336000, - "Eadsv5_Type1": 8.300000, - "Easv4_Type1": 7.983000, - "Easv4_Type2": 7.983000, - "Easv5_Type1": 7.160000, - "Ebdsv5-Type1": 7.054000, - "Ebsv5-Type1": 6.294000, - "Edsv4_Type 1": 6.083000, - "Edsv4_Type2": 7.223000, - "Edsv5_Type1": 9.124000, - "Esv3_Type3": 4.972000, - "Esv3_Type4": 6.736000, - "Esv4_Type1": 5.322000, - "Esv4_Type2": 6.985000, - "Esv5_Type1": 7.983000, - "Fsv2 Type3": 5.161000, - "Fsv2_Type2": 4.039000, - "Fsv2_Type4": 5.610000, - "Lsv3_Type1": 9.214000, - "Standard_A0": 0.020000, - "Standard_A1": 0.051000, - "Standard_A1_v2": 0.040000, - "Standard_A2": 0.101000, - "Standard_A2_v2": 0.083000, - "Standard_A2m_v2": 0.119000, - "Standard_A3": 0.202000, - "Standard_A4": 0.405000, - "Standard_A4_v2": 0.175000, - "Standard_A4m_v2": 0.249000, - "Standard_A5": 0.220000, - "Standard_A6": 0.440000, - "Standard_A7": 0.880000, - "Standard_A8_v2": 0.367000, - "Standard_A8m_v2": 0.524000, - "Standard_B12ms": 0.599000, - "Standard_B16als_v2": 0.713000, - "Standard_B16as_v2": 0.796000, - "Standard_B16ls_v2": 0.707000, - "Standard_B16ms": 0.799000, - "Standard_B16pls_v2": 0.645000, - "Standard_B16ps_v2": 0.719000, - "Standard_B16s_v2": 0.872000, - "Standard_B1ls": 0.006240, - "Standard_B1ms": 0.025000, - "Standard_B1s": 0.012500, - "Standard_B20ms": 0.998000, - "Standard_B2als_v2": 0.045100, - "Standard_B2as_v2": 0.090200, - "Standard_B2ats_v2": 0.020500, - "Standard_B2ls_v2": 0.049900, - "Standard_B2ms": 0.099800, - "Standard_B2pls_v2": 0.049500, - "Standard_B2ps_v2": 0.089800, - "Standard_B2pts_v2": 0.010100, - "Standard_B2s": 0.049900, - "Standard_B2s_v2": 0.099800, - "Standard_B2ts_v2": 0.021700, - "Standard_B32als_v2": 1.426000, - "Standard_B32as_v2": 1.444000, - "Standard_B32ls_v2": 1.415000, - "Standard_B32s_v2": 1.745000, - "Standard_B4als_v2": 0.160000, - "Standard_B4as_v2": 0.180000, - "Standard_B4ls_v2": 0.195000, - "Standard_B4ms": 0.200000, - "Standard_B4pls_v2": 0.161000, - "Standard_B4ps_v2": 0.161000, - "Standard_B4s_v2": 0.218000, - "Standard_B8als_v2": 0.357000, - "Standard_B8as_v2": 0.361000, - "Standard_B8ls_v2": 0.390000, - "Standard_B8ms": 0.399000, - "Standard_B8pls_v2": 0.286000, - "Standard_B8ps_v2": 0.323000, - "Standard_B8s_v2": 0.399000, - "Standard_D11_v2": 0.166000, - "Standard_D11_v2_Promo": 0.166000, - "Standard_D12_v2": 0.332000, - "Standard_D12_v2_Promo": 0.332000, - "Standard_D13_v2": 0.665000, - "Standard_D13_v2_Promo": 0.665000, - "Standard_D14_v2": 1.330000, - "Standard_D14_v2_Promo": 1.330000, - "Standard_D15_v2": 1.662000, - "Standard_D15i_v2": 1.662000, - "Standard_D16_v3": 0.880000, - "Standard_D16_v4": 0.922000, - "Standard_D16_v5": 0.922000, - "Standard_D16a_v4": 0.922000, - "Standard_D16ads_v5": 0.989000, - "Standard_D16as_v4": 0.922000, - "Standard_D16as_v5": 0.826000, - "Standard_D16as_v5_Promo": 0.739000, - "Standard_D16d_v4": 1.085000, - "Standard_D16d_v5": 1.085000, - "Standard_D16ds_v4": 1.085000, - "Standard_D16ds_v5": 1.085000, - "Standard_D16lds_v5": 0.922000, - "Standard_D16ls_v5": 0.816000, - "Standard_D16pds_v5": 0.868000, - "Standard_D16plds_v5": 0.737000, - "Standard_D16pls_v5": 0.653000, - "Standard_D16ps_v5": 0.739000, - "Standard_D16s_v3": 0.880000, - "Standard_D16s_v4": 0.922000, - "Standard_D16s_v5": 0.922000, - "Standard_D1_v2": 0.063600, - "Standard_D2_v2": 0.127000, - "Standard_D2_v2_Promo": 0.127000, - "Standard_D2_v3": 0.110000, - "Standard_D2_v4": 0.115000, - "Standard_D2_v5": 0.115000, - "Standard_D2a_v4": 0.115000, - "Standard_D2ads_v5": 0.124000, - "Standard_D2as_v4": 0.115000, - "Standard_D2as_v5": 0.103000, - "Standard_D2as_v5_Promo": 0.092400, - "Standard_D2d_v4": 0.136000, - "Standard_D2d_v5": 0.136000, - "Standard_D2ds_v4": 0.136000, - "Standard_D2ds_v5": 0.136000, - "Standard_D2lds_v5": 0.115000, - "Standard_D2ls_v5": 0.102000, - "Standard_D2pds_v5": 0.108000, - "Standard_D2plds_v5": 0.092200, - "Standard_D2pls_v5": 0.081600, - "Standard_D2ps_v5": 0.092400, - "Standard_D2s_v3": 0.110000, - "Standard_D2s_v4": 0.115000, - "Standard_D2s_v5": 0.115000, - "Standard_D32-16s_v3": 1.760000, - "Standard_D32-8s_v3": 1.760000, - "Standard_D32_v3": 1.760000, - "Standard_D32_v4": 1.843000, - "Standard_D32_v5": 1.843000, - "Standard_D32a_v4": 1.843000, - "Standard_D32ads_v5": 1.978000, - "Standard_D32as_v4": 1.843000, - "Standard_D32as_v5": 1.651000, - "Standard_D32as_v5_Promo": 1.478000, - "Standard_D32d_v4": 2.170000, - "Standard_D32d_v5": 2.170000, - "Standard_D32ds_v4": 2.170000, - "Standard_D32ds_v5": 2.170000, - "Standard_D32lds_v5": 1.843000, - "Standard_D32ls_v5": 1.632000, - "Standard_D32pds_v5": 1.736000, - "Standard_D32plds_v5": 1.475000, - "Standard_D32pls_v5": 1.306000, - "Standard_D32ps_v5": 1.478000, - "Standard_D32s_v3": 1.760000, - "Standard_D32s_v4": 1.843000, - "Standard_D32s_v5": 1.843000, - "Standard_D3_v2": 0.254000, - "Standard_D3_v2_Promo": 0.254000, - "Standard_D48_v3": 2.640000, - "Standard_D48_v4": 2.765000, - "Standard_D48_v5": 2.765000, - "Standard_D48a_v4": 2.765000, - "Standard_D48ads_v5": 2.966000, - "Standard_D48as_v4": 2.765000, - "Standard_D48as_v5": 2.477000, - "Standard_D48as_v5_Promo": 2.218000, - "Standard_D48d_v4": 3.254000, - "Standard_D48d_v5": 3.254000, - "Standard_D48ds_v4": 3.254000, - "Standard_D48ds_v5": 3.254000, - "Standard_D48lds_v5": 2.765000, - "Standard_D48ls_v5": 2.448000, - "Standard_D48pds_v5": 2.604000, - "Standard_D48plds_v5": 2.212000, - "Standard_D48pls_v5": 1.958000, - "Standard_D48ps_v5": 2.218000, - "Standard_D48s_v3": 2.640000, - "Standard_D48s_v4": 2.765000, - "Standard_D48s_v5": 2.765000, - "Standard_D4_v2": 0.509000, - "Standard_D4_v2_Promo": 0.509000, - "Standard_D4_v3": 0.220000, - "Standard_D4_v4": 0.230000, - "Standard_D4_v5": 0.230000, - "Standard_D4a_v4": 0.230000, - "Standard_D4ads_v5": 0.247000, - "Standard_D4as_v4": 0.230000, - "Standard_D4as_v5": 0.206000, - "Standard_D4as_v5_Promo": 0.185000, - "Standard_D4d_v4": 0.271000, - "Standard_D4d_v5": 0.271000, - "Standard_D4ds_v4": 0.271000, - "Standard_D4ds_v5": 0.271000, - "Standard_D4lds_v5": 0.230000, - "Standard_D4ls_v5": 0.204000, - "Standard_D4pds_v5": 0.217000, - "Standard_D4plds_v5": 0.184000, - "Standard_D4pls_v5": 0.163000, - "Standard_D4ps_v5": 0.185000, - "Standard_D4s_v3": 0.220000, - "Standard_D4s_v4": 0.230000, - "Standard_D4s_v5": 0.230000, - "Standard_D5_v2": 1.017000, - "Standard_D5_v2_Promo": 1.017000, - "Standard_D64-16s_v3": 3.520000, - "Standard_D64-32s_v3": 3.520000, - "Standard_D64_v3": 3.520000, - "Standard_D64_v4": 3.686000, - "Standard_D64_v5": 3.686000, - "Standard_D64a_v4": 3.686000, - "Standard_D64ads_v5": 3.955000, - "Standard_D64as_v4": 3.686000, - "Standard_D64as_v5": 3.302000, - "Standard_D64as_v5_Promo": 2.957000, - "Standard_D64d_v4": 4.339000, - "Standard_D64d_v5": 4.339000, - "Standard_D64ds_v4": 4.339000, - "Standard_D64ds_v5": 4.339000, - "Standard_D64lds_v5": 3.686000, - "Standard_D64ls_v5": 3.264000, - "Standard_D64pds_v5": 3.471000, - "Standard_D64plds_v5": 2.949000, - "Standard_D64pls_v5": 2.611000, - "Standard_D64ps_v5": 2.957000, - "Standard_D64s_v3": 3.520000, - "Standard_D64s_v4": 3.686000, - "Standard_D64s_v5": 3.686000, - "Standard_D8_v3": 0.440000, - "Standard_D8_v4": 0.461000, - "Standard_D8_v5": 0.461000, - "Standard_D8a_v4": 0.461000, - "Standard_D8ads_v5": 0.494000, - "Standard_D8as_v4": 0.461000, - "Standard_D8as_v5": 0.413000, - "Standard_D8as_v5_Promo": 0.370000, - "Standard_D8d_v4": 0.542000, - "Standard_D8d_v5": 0.542000, - "Standard_D8ds_v4": 0.542000, - "Standard_D8ds_v5": 0.542000, - "Standard_D8lds_v5": 0.461000, - "Standard_D8ls_v5": 0.408000, - "Standard_D8pds_v5": 0.434000, - "Standard_D8plds_v5": 0.369000, - "Standard_D8pls_v5": 0.326000, - "Standard_D8ps_v5": 0.370000, - "Standard_D8s_v3": 0.440000, - "Standard_D8s_v4": 0.461000, - "Standard_D8s_v5": 0.461000, - "Standard_D96_v5": 5.530000, - "Standard_D96a_v4": 5.530000, - "Standard_D96ads_v5": 5.933000, - "Standard_D96as_v4": 5.530000, - "Standard_D96as_v5": 4.954000, - "Standard_D96as_v5_Promo": 4.435000, - "Standard_D96d_v5": 6.509000, - "Standard_D96ds_v5": 6.509000, - "Standard_D96lds_v5": 5.530000, - "Standard_D96ls_v5": 4.896000, - "Standard_D96s_v5": 5.530000, - "Standard_DS11-1_v2": 0.166000, - "Standard_DS11_v2": 0.166000, - "Standard_DS11_v2_Promo": 0.166000, - "Standard_DS12-1_v2": 0.332000, - "Standard_DS12-2_v2": 0.332000, - "Standard_DS12_v2": 0.332000, - "Standard_DS12_v2_Promo": 0.332000, - "Standard_DS13-2_v2": 0.665000, - "Standard_DS13-4_v2": 0.665000, - "Standard_DS13_v2": 0.665000, - "Standard_DS13_v2_Promo": 0.665000, - "Standard_DS14-4_v2": 1.330000, - "Standard_DS14-8_v2": 1.330000, - "Standard_DS14_v2": 1.330000, - "Standard_DS14_v2_Promo": 1.330000, - "Standard_DS15_v2": 1.662000, - "Standard_DS15i_v2": 1.662000, - "Standard_DS1_v2": 0.063600, - "Standard_DS2_v2": 0.127000, - "Standard_DS2_v2_Promo": 0.127000, - "Standard_DS3_v2": 0.254000, - "Standard_DS3_v2_Promo": 0.254000, - "Standard_DS4_v2": 0.509000, - "Standard_DS4_v2_Promo": 0.509000, - "Standard_DS5_v2": 1.017000, - "Standard_DS5_v2_Promo": 1.017000, - "Standard_E104i_v5": 8.649000, - "Standard_E104id_v5": 9.884000, - "Standard_E104ids_v5": 9.884000, - "Standard_E104is_v5": 8.649000, - "Standard_E112iads_v5": 9.684000, - "Standard_E112ias_v5": 8.353000, - "Standard_E112ibds_v5": 12.345000, - "Standard_E112ibs_v5": 11.014000, - "Standard_E16-4ads_v5": 1.258000, - "Standard_E16-4as_v4": 1.210000, - "Standard_E16-4as_v5": 1.085000, - "Standard_E16-4ds_v4": 1.382000, - "Standard_E16-4ds_v5": 1.382000, - "Standard_E16-4s_v3": 1.166000, - "Standard_E16-4s_v4": 1.210000, - "Standard_E16-4s_v5": 1.210000, - "Standard_E16-8ads_v5": 1.258000, - "Standard_E16-8as_v4": 1.210000, - "Standard_E16-8as_v5": 1.085000, - "Standard_E16-8ds_v4": 1.382000, - "Standard_E16-8ds_v5": 1.382000, - "Standard_E16-8s_v3": 1.166000, - "Standard_E16-8s_v4": 1.210000, - "Standard_E16-8s_v5": 1.210000, - "Standard_E16_v3": 1.166000, - "Standard_E16_v4": 1.210000, - "Standard_E16_v5": 1.210000, - "Standard_E16a_v4": 1.210000, - "Standard_E16ads_v5": 1.258000, - "Standard_E16as_v4": 1.210000, - "Standard_E16as_v5": 1.085000, - "Standard_E16bds_v5": 1.603000, - "Standard_E16bs_v5": 1.430000, - "Standard_E16d_v4": 1.382000, - "Standard_E16d_v5": 1.382000, - "Standard_E16ds_v4": 1.382000, - "Standard_E16ds_v5": 1.382000, - "Standard_E16pds_v5": 1.106000, - "Standard_E16ps_v5": 0.968000, - "Standard_E16s_v3": 1.166000, - "Standard_E16s_v4": 1.210000, - "Standard_E16s_v5": 1.210000, - "Standard_E20_v3": 1.460000, - "Standard_E20_v4": 1.512000, - "Standard_E20_v5": 1.512000, - "Standard_E20a_v4": 1.512000, - "Standard_E20ads_v5": 1.572000, - "Standard_E20as_v4": 1.512000, - "Standard_E20as_v5": 1.356000, - "Standard_E20d_v4": 1.728000, - "Standard_E20d_v5": 1.728000, - "Standard_E20ds_v4": 1.728000, - "Standard_E20ds_v5": 1.728000, - "Standard_E20pds_v5": 1.382000, - "Standard_E20ps_v5": 1.210000, - "Standard_E20s_v3": 1.460000, - "Standard_E20s_v4": 1.512000, - "Standard_E20s_v5": 1.512000, - "Standard_E2_v3": 0.146000, - "Standard_E2_v4": 0.151000, - "Standard_E2_v5": 0.151000, - "Standard_E2a_v4": 0.151000, - "Standard_E2ads_v5": 0.157000, - "Standard_E2as_v4": 0.151000, - "Standard_E2as_v5": 0.136000, - "Standard_E2bds_v5": 0.200000, - "Standard_E2bs_v5": 0.179000, - "Standard_E2d_v4": 0.173000, - "Standard_E2d_v5": 0.173000, - "Standard_E2ds_v4": 0.173000, - "Standard_E2ds_v5": 0.173000, - "Standard_E2pds_v5": 0.138000, - "Standard_E2ps_v5": 0.121000, - "Standard_E2s_v3": 0.146000, - "Standard_E2s_v4": 0.151000, - "Standard_E2s_v5": 0.151000, - "Standard_E32-16ads_v5": 2.515000, - "Standard_E32-16as_v4": 2.419000, - "Standard_E32-16as_v5": 2.170000, - "Standard_E32-16ds_v4": 2.765000, - "Standard_E32-16ds_v5": 2.765000, - "Standard_E32-16s_v3": 2.333000, - "Standard_E32-16s_v4": 2.419000, - "Standard_E32-16s_v5": 2.419000, - "Standard_E32-8ads_v5": 2.515000, - "Standard_E32-8as_v4": 2.419000, - "Standard_E32-8as_v5": 2.170000, - "Standard_E32-8ds_v4": 2.765000, - "Standard_E32-8ds_v5": 2.765000, - "Standard_E32-8s_v3": 2.333000, - "Standard_E32-8s_v4": 2.419000, - "Standard_E32-8s_v5": 2.419000, - "Standard_E32_v3": 2.333000, - "Standard_E32_v4": 2.419000, - "Standard_E32_v5": 2.419000, - "Standard_E32a_v4": 2.419000, - "Standard_E32ads_v5": 2.515000, - "Standard_E32as_v4": 2.419000, - "Standard_E32as_v5": 2.170000, - "Standard_E32bds_v5": 3.206000, - "Standard_E32bs_v5": 2.861000, - "Standard_E32d_v4": 2.765000, - "Standard_E32d_v5": 2.765000, - "Standard_E32ds_v4": 2.765000, - "Standard_E32ds_v5": 2.765000, - "Standard_E32pds_v5": 2.212000, - "Standard_E32ps_v5": 1.935000, - "Standard_E32s_v3": 2.333000, - "Standard_E32s_v4": 2.419000, - "Standard_E32s_v5": 2.419000, - "Standard_E4-2ads_v5": 0.314000, - "Standard_E4-2as_v4": 0.302000, - "Standard_E4-2as_v5": 0.271000, - "Standard_E4-2ds_v4": 0.346000, - "Standard_E4-2ds_v5": 0.346000, - "Standard_E4-2s_v3": 0.292000, - "Standard_E4-2s_v4": 0.302000, - "Standard_E4-2s_v5": 0.302000, - "Standard_E48_v3": 3.499000, - "Standard_E48_v4": 3.629000, - "Standard_E48_v5": 3.629000, - "Standard_E48a_v4": 3.629000, - "Standard_E48ads_v5": 3.773000, - "Standard_E48as_v4": 3.629000, - "Standard_E48as_v5": 3.254000, - "Standard_E48bds_v5": 4.810000, - "Standard_E48bs_v5": 4.291000, - "Standard_E48d_v4": 4.147000, - "Standard_E48d_v5": 4.147000, - "Standard_E48ds_v4": 4.147000, - "Standard_E48ds_v5": 4.147000, - "Standard_E48s_v4": 3.629000, - "Standard_E48s_v5": 3.629000, - "Standard_E4_v3": 0.292000, - "Standard_E4_v4": 0.302000, - "Standard_E4_v5": 0.302000, - "Standard_E4a_v4": 0.302000, - "Standard_E4ads_v5": 0.314000, - "Standard_E4as_v4": 0.302000, - "Standard_E4as_v5": 0.271000, - "Standard_E4bds_v5": 0.401000, - "Standard_E4bs_v5": 0.358000, - "Standard_E4d_v4": 0.346000, - "Standard_E4d_v5": 0.346000, - "Standard_E4ds_v4": 0.346000, - "Standard_E4ds_v5": 0.346000, - "Standard_E4pds_v5": 0.276000, - "Standard_E4ps_v5": 0.242000, - "Standard_E4s_v3": 0.292000, - "Standard_E4s_v4": 0.302000, - "Standard_E4s_v5": 0.302000, - "Standard_E64-16ads_v5": 5.030000, - "Standard_E64-16as_v4": 4.838000, - "Standard_E64-16as_v5": 4.339000, - "Standard_E64-16ds_v4": 5.530000, - "Standard_E64-16ds_v5": 5.530000, - "Standard_E64-16s_v3": 4.199000, - "Standard_E64-16s_v4": 4.838000, - "Standard_E64-16s_v5": 4.838000, - "Standard_E64-32ads_v5": 5.030000, - "Standard_E64-32as_v4": 4.838000, - "Standard_E64-32as_v5": 4.339000, - "Standard_E64-32ds_v4": 5.530000, - "Standard_E64-32ds_v5": 5.530000, - "Standard_E64-32s_v3": 4.199000, - "Standard_E64-32s_v4": 4.838000, - "Standard_E64-32s_v5": 4.838000, - "Standard_E64_v3": 4.199000, - "Standard_E64_v4": 4.838000, - "Standard_E64_v5": 4.838000, - "Standard_E64a_v4": 4.838000, - "Standard_E64ads_v5": 5.030000, - "Standard_E64as_v4": 4.838000, - "Standard_E64as_v5": 4.339000, - "Standard_E64bds_v5": 6.413000, - "Standard_E64bs_v5": 5.722000, - "Standard_E64d_v4": 5.530000, - "Standard_E64d_v5": 5.530000, - "Standard_E64ds_v4": 5.530000, - "Standard_E64ds_v5": 5.530000, - "Standard_E64i_v3": 4.199000, - "Standard_E64is_v3": 4.199000, - "Standard_E64s_v3": 4.199000, - "Standard_E64s_v4": 4.838000, - "Standard_E64s_v5": 4.838000, - "Standard_E8-2ads_v5": 0.629000, - "Standard_E8-2as_v4": 0.605000, - "Standard_E8-2as_v5": 0.542000, - "Standard_E8-2ds_v4": 0.691000, - "Standard_E8-2ds_v5": 0.691000, - "Standard_E8-2s_v3": 0.583000, - "Standard_E8-2s_v4": 0.605000, - "Standard_E8-2s_v5": 0.605000, - "Standard_E8-4ads_v5": 0.629000, - "Standard_E8-4as_v4": 0.605000, - "Standard_E8-4as_v5": 0.542000, - "Standard_E8-4ds_v4": 0.691000, - "Standard_E8-4ds_v5": 0.691000, - "Standard_E8-4s_v3": 0.583000, - "Standard_E8-4s_v4": 0.605000, - "Standard_E8-4s_v5": 0.605000, - "Standard_E80ids_v4": 6.912000, - "Standard_E80is_v4": 6.048000, - "Standard_E8_v3": 0.583000, - "Standard_E8_v4": 0.605000, - "Standard_E8_v5": 0.605000, - "Standard_E8a_v4": 0.605000, - "Standard_E8ads_v5": 0.629000, - "Standard_E8as_v4": 0.605000, - "Standard_E8as_v5": 0.542000, - "Standard_E8bds_v5": 0.802000, - "Standard_E8bs_v5": 0.715000, - "Standard_E8d_v4": 0.691000, - "Standard_E8d_v5": 0.691000, - "Standard_E8ds_v4": 0.691000, - "Standard_E8ds_v5": 0.691000, - "Standard_E8pds_v5": 0.553000, - "Standard_E8ps_v5": 0.484000, - "Standard_E8s_v3": 0.583000, - "Standard_E8s_v4": 0.605000, - "Standard_E8s_v5": 0.605000, - "Standard_E96-24ads_v5": 7.546000, - "Standard_E96-24as_v4": 7.258000, - "Standard_E96-24as_v5": 6.509000, - "Standard_E96-24ds_v5": 8.294000, - "Standard_E96-24s_v5": 7.258000, - "Standard_E96-48ads_v5": 7.546000, - "Standard_E96-48as_v4": 7.258000, - "Standard_E96-48as_v5": 6.509000, - "Standard_E96-48ds_v5": 8.294000, - "Standard_E96-48s_v5": 7.258000, - "Standard_E96_v5": 7.258000, - "Standard_E96a_v4": 7.258000, - "Standard_E96ads_v5": 7.546000, - "Standard_E96as_v4": 7.258000, - "Standard_E96as_v5": 6.509000, - "Standard_E96bds_v5": 9.619000, - "Standard_E96bs_v5": 8.582000, - "Standard_E96d_v5": 8.294000, - "Standard_E96ds_v5": 8.294000, - "Standard_E96iads_v5": 8.300000, - "Standard_E96ias_v5": 7.160000, - "Standard_E96s_v5": 7.258000, - "Standard_F1": 0.054700, - "Standard_F16": 0.875000, - "Standard_F16s": 0.875000, - "Standard_F16s_v2": 0.816000, - "Standard_F1s": 0.054700, - "Standard_F2": 0.109000, - "Standard_F2s": 0.109000, - "Standard_F2s_v2": 0.102000, - "Standard_F32s_v2": 1.632000, - "Standard_F4": 0.219000, - "Standard_F48s_v2": 2.448000, - "Standard_F4s": 0.219000, - "Standard_F4s_v2": 0.204000, - "Standard_F64s_v2": 3.264000, - "Standard_F72s_v2": 3.672000, - "Standard_F8": 0.438000, - "Standard_F8s": 0.438000, - "Standard_F8s_v2": 0.408000, - "Standard_L16s_v3": 1.675000, - "Standard_L32s_v3": 3.350000, - "Standard_L48s_v3": 5.026000, - "Standard_L64s_v3": 6.701000, - "Standard_L80s_v3": 8.376000, - "Standard_L8s_v3": 0.838000, - } - // westeurope - initialOnDemandPrices["westeurope"] = map[string]float64{ - "Basic_A0": 0.018000, - "Basic_A1": 0.027000, - "Basic_A2": 0.078000, - "Basic_A3": 0.204000, - "Basic_A4": 0.408000, - "DCadsv5 Type 1": 7.700000, - "DCasv5 Type 1": 6.406000, - "DCdsv3 Type1": 7.181000, - "DCsv2 Type 1": 1.012000, - "DCsv3 Type1": 6.072000, - "Dadsv5_Type1": 7.700000, - "Dasv4_Type1": 6.101000, - "Dasv4_Type2": 6.101000, - "Dasv5_Type1": 6.406000, - "Ddsv4_Type 1": 4.787000, - "Ddsv4_Type2": 5.685000, - "Ddsv5_Type1": 7.181000, - "Dsv3_Type3": 5.060000, - "Dsv3_Type4": 6.325000, - "Dsv4_Type1": 5.060000, - "Dsv4_Type2": 6.325000, - "Dsv5_Type1": 6.325000, - "ECadsv5 Type 1": 8.596000, - "ECasv5 Type 1": 7.957000, - "Eadsv5_Type1": 8.342000, - "Easv4_Type1": 7.993000, - "Easv4_Type2": 7.993000, - "Easv5_Type1": 7.234000, - "Ebdsv5-Type1": 7.005000, - "Ebsv5-Type1": 6.266000, - "Edsv4_Type 1": 6.090000, - "Edsv4_Type2": 7.231000, - "Edsv5_Type1": 9.134000, - "Esv3_Type3": 5.162000, - "Esv3_Type4": 6.994000, - "Esv4_Type1": 5.351000, - "Esv4_Type2": 7.023000, - "Esv5_Type1": 8.026000, - "FXmds Type1": 5.940000, - "Fsv2 Type3": 4.908000, - "Fsv2_Type2": 3.841000, - "Fsv2_Type4": 5.334000, - "Lasv3_Type1": 8.184000, - "Lsv2_Type1": 8.184000, - "Lsv3_Type1": 9.152000, - "Mdsmv2MedMem _Type1": 41.103000, - "Mdsv2MedMem_Type1": 20.544000, - "Ms_Type1": 20.536000, - "Msm_Type1": 41.108000, - "Msmv2MedMem Type1": 40.455000, - "Msmv2_Type1": 141.780000, - "Msv2MedMem Type1": 19.896000, - "Msv2_Type1": 70.899000, - "NDamsrA100v4_Type1": 45.059000, - "NDasrA100v4_Type1": 38.893000, - "NVasv4_Type1": 8.970000, - "NVsv3_Type1": 6.270000, - "Standard_A0": 0.020000, - "Standard_A1": 0.060000, - "Standard_A1_v2": 0.041000, - "Standard_A2": 0.120000, - "Standard_A2_v2": 0.087000, - "Standard_A2m_v2": 0.124000, - "Standard_A3": 0.240000, - "Standard_A4": 0.480000, - "Standard_A4_v2": 0.183000, - "Standard_A4m_v2": 0.260000, - "Standard_A5": 0.270000, - "Standard_A6": 0.540000, - "Standard_A7": 1.080000, - "Standard_A8_v2": 0.383000, - "Standard_A8m_v2": 0.546000, - "Standard_B12ms": 0.576000, - "Standard_B16als_v2": 0.612000, - "Standard_B16as_v2": 0.691000, - "Standard_B16ls_v2": 0.754000, - "Standard_B16ms": 0.768000, - "Standard_B16pls_v2": 0.618000, - "Standard_B16ps_v2": 0.614000, - "Standard_B16s_v2": 0.768000, - "Standard_B1ls": 0.006000, - "Standard_B1ms": 0.024000, - "Standard_B1s": 0.012000, - "Standard_B20ms": 0.960000, - "Standard_B2als_v2": 0.043200, - "Standard_B2as_v2": 0.086400, - "Standard_B2ats_v2": 0.010800, - "Standard_B2ls_v2": 0.057200, - "Standard_B2ms": 0.096000, - "Standard_B2pls_v2": 0.047600, - "Standard_B2ps_v2": 0.086000, - "Standard_B2pts_v2": 0.018800, - "Standard_B2s": 0.048000, - "Standard_B2s_v2": 0.096000, - "Standard_B2ts_v2": 0.012000, - "Standard_B32als_v2": 1.371000, - "Standard_B32as_v2": 1.530000, - "Standard_B32ls_v2": 1.507000, - "Standard_B32s_v2": 1.683000, - "Standard_B4als_v2": 0.153000, - "Standard_B4as_v2": 0.173000, - "Standard_B4ls_v2": 0.170000, - "Standard_B4ms": 0.192000, - "Standard_B4pls_v2": 0.154000, - "Standard_B4ps_v2": 0.154000, - "Standard_B4s_v2": 0.192000, - "Standard_B8als_v2": 0.343000, - "Standard_B8as_v2": 0.382000, - "Standard_B8ls_v2": 0.340000, - "Standard_B8ms": 0.384000, - "Standard_B8pls_v2": 0.272000, - "Standard_B8ps_v2": 0.344000, - "Standard_B8s_v2": 0.421000, - "Standard_D1": 0.084000, - "Standard_D11": 0.221000, - "Standard_D11_v2": 0.190000, - "Standard_D11_v2_Promo": 0.190000, - "Standard_D12": 0.442000, - "Standard_D12_v2": 0.379000, - "Standard_D12_v2_Promo": 0.379000, - "Standard_D13": 0.885000, - "Standard_D13_v2": 0.759000, - "Standard_D13_v2_Promo": 0.759000, - "Standard_D14": 1.769000, - "Standard_D14_v2": 1.518000, - "Standard_D14_v2_Promo": 1.518000, - "Standard_D15_v2": 1.897000, - "Standard_D15i_v2": 1.897000, - "Standard_D16_v3": 0.960000, - "Standard_D16_v4": 0.920000, - "Standard_D16_v5": 0.920000, - "Standard_D16a_v4": 0.920000, - "Standard_D16ads_v5": 1.000000, - "Standard_D16as_v4": 0.920000, - "Standard_D16as_v5": 0.832000, - "Standard_D16d_v4": 1.088000, - "Standard_D16d_v5": 1.088000, - "Standard_D16ds_v4": 1.088000, - "Standard_D16ds_v5": 1.088000, - "Standard_D16lds_v5": 0.888000, - "Standard_D16ls_v5": 0.776000, - "Standard_D16pds_v5": 0.872000, - "Standard_D16plds_v5": 0.712000, - "Standard_D16pls_v5": 0.621000, - "Standard_D16ps_v5": 0.736000, - "Standard_D16s_v3": 0.960000, - "Standard_D16s_v4": 0.920000, - "Standard_D16s_v5": 0.920000, - "Standard_D1_v2": 0.067900, - "Standard_D2": 0.168000, - "Standard_D2_v2": 0.136000, - "Standard_D2_v2_Promo": 0.136000, - "Standard_D2_v3": 0.120000, - "Standard_D2_v4": 0.115000, - "Standard_D2_v5": 0.115000, - "Standard_D2a_v4": 0.115000, - "Standard_D2ads_v5": 0.125000, - "Standard_D2as_v4": 0.115000, - "Standard_D2as_v5": 0.104000, - "Standard_D2d_v4": 0.136000, - "Standard_D2d_v5": 0.136000, - "Standard_D2ds_v4": 0.136000, - "Standard_D2ds_v5": 0.136000, - "Standard_D2lds_v5": 0.111000, - "Standard_D2ls_v5": 0.097000, - "Standard_D2pds_v5": 0.109000, - "Standard_D2plds_v5": 0.089000, - "Standard_D2pls_v5": 0.077600, - "Standard_D2ps_v5": 0.092000, - "Standard_D2s_v3": 0.120000, - "Standard_D2s_v4": 0.115000, - "Standard_D2s_v5": 0.115000, - "Standard_D3": 0.336000, - "Standard_D32-16s_v3": 1.920000, - "Standard_D32-8s_v3": 1.920000, - "Standard_D32_v3": 1.920000, - "Standard_D32_v4": 1.840000, - "Standard_D32_v5": 1.840000, - "Standard_D32a_v4": 1.840000, - "Standard_D32ads_v5": 2.000000, - "Standard_D32as_v4": 1.840000, - "Standard_D32as_v5": 1.664000, - "Standard_D32d_v4": 2.176000, - "Standard_D32d_v5": 2.176000, - "Standard_D32ds_v4": 2.176000, - "Standard_D32ds_v5": 2.176000, - "Standard_D32lds_v5": 1.776000, - "Standard_D32ls_v5": 1.552000, - "Standard_D32pds_v5": 1.744000, - "Standard_D32plds_v5": 1.424000, - "Standard_D32pls_v5": 1.242000, - "Standard_D32ps_v5": 1.472000, - "Standard_D32s_v3": 1.920000, - "Standard_D32s_v4": 1.840000, - "Standard_D32s_v5": 1.840000, - "Standard_D3_v2": 0.272000, - "Standard_D3_v2_Promo": 0.272000, - "Standard_D4": 0.672000, - "Standard_D48_v3": 2.880000, - "Standard_D48_v4": 2.760000, - "Standard_D48_v5": 2.760000, - "Standard_D48a_v4": 2.760000, - "Standard_D48ads_v5": 3.000000, - "Standard_D48as_v4": 2.760000, - "Standard_D48as_v5": 2.496000, - "Standard_D48d_v4": 3.264000, - "Standard_D48d_v5": 3.264000, - "Standard_D48ds_v4": 3.264000, - "Standard_D48ds_v5": 3.264000, - "Standard_D48lds_v5": 2.664000, - "Standard_D48ls_v5": 2.328000, - "Standard_D48pds_v5": 2.616000, - "Standard_D48plds_v5": 2.136000, - "Standard_D48pls_v5": 1.862000, - "Standard_D48ps_v5": 2.208000, - "Standard_D48s_v3": 2.880000, - "Standard_D48s_v4": 2.760000, - "Standard_D48s_v5": 2.760000, - "Standard_D4_v2": 0.544000, - "Standard_D4_v2_Promo": 0.544000, - "Standard_D4_v3": 0.240000, - "Standard_D4_v4": 0.230000, - "Standard_D4_v5": 0.230000, - "Standard_D4a_v4": 0.230000, - "Standard_D4ads_v5": 0.250000, - "Standard_D4as_v4": 0.230000, - "Standard_D4as_v5": 0.208000, - "Standard_D4d_v4": 0.272000, - "Standard_D4d_v5": 0.272000, - "Standard_D4ds_v4": 0.272000, - "Standard_D4ds_v5": 0.272000, - "Standard_D4lds_v5": 0.222000, - "Standard_D4ls_v5": 0.194000, - "Standard_D4pds_v5": 0.218000, - "Standard_D4plds_v5": 0.178000, - "Standard_D4pls_v5": 0.155000, - "Standard_D4ps_v5": 0.184000, - "Standard_D4s_v3": 0.240000, - "Standard_D4s_v4": 0.230000, - "Standard_D4s_v5": 0.230000, - "Standard_D5_v2": 1.087000, - "Standard_D5_v2_Promo": 1.087000, - "Standard_D64-16s_v3": 3.840000, - "Standard_D64-32s_v3": 3.840000, - "Standard_D64_v3": 3.840000, - "Standard_D64_v4": 3.680000, - "Standard_D64_v5": 3.680000, - "Standard_D64a_v4": 3.680000, - "Standard_D64ads_v5": 4.000000, - "Standard_D64as_v4": 3.680000, - "Standard_D64as_v5": 3.328000, - "Standard_D64d_v4": 4.352000, - "Standard_D64d_v5": 4.352000, - "Standard_D64ds_v4": 4.352000, - "Standard_D64ds_v5": 4.352000, - "Standard_D64lds_v5": 3.552000, - "Standard_D64ls_v5": 3.104000, - "Standard_D64pds_v5": 3.488000, - "Standard_D64plds_v5": 2.848000, - "Standard_D64pls_v5": 2.483000, - "Standard_D64ps_v5": 2.944000, - "Standard_D64s_v3": 3.840000, - "Standard_D64s_v4": 3.680000, - "Standard_D64s_v5": 3.680000, - "Standard_D8_v3": 0.480000, - "Standard_D8_v4": 0.460000, - "Standard_D8_v5": 0.460000, - "Standard_D8a_v4": 0.460000, - "Standard_D8ads_v5": 0.500000, - "Standard_D8as_v4": 0.460000, - "Standard_D8as_v5": 0.416000, - "Standard_D8d_v4": 0.544000, - "Standard_D8d_v5": 0.544000, - "Standard_D8ds_v4": 0.544000, - "Standard_D8ds_v5": 0.544000, - "Standard_D8lds_v5": 0.444000, - "Standard_D8ls_v5": 0.388000, - "Standard_D8pds_v5": 0.436000, - "Standard_D8plds_v5": 0.356000, - "Standard_D8pls_v5": 0.310000, - "Standard_D8ps_v5": 0.368000, - "Standard_D8s_v3": 0.480000, - "Standard_D8s_v4": 0.460000, - "Standard_D8s_v5": 0.460000, - "Standard_D96_v5": 5.520000, - "Standard_D96a_v4": 5.520000, - "Standard_D96ads_v5": 6.000000, - "Standard_D96as_v4": 5.520000, - "Standard_D96as_v5": 4.992000, - "Standard_D96d_v5": 6.528000, - "Standard_D96ds_v5": 6.528000, - "Standard_D96lds_v5": 5.328000, - "Standard_D96ls_v5": 4.656000, - "Standard_D96s_v5": 5.520000, - "Standard_DC16ads_cc_v5": 1.000000, - "Standard_DC16ads_v5": 1.000000, - "Standard_DC16as_cc_v5": 0.832000, - "Standard_DC16as_v5": 0.832000, - "Standard_DC16ds_v3": 2.176000, - "Standard_DC16eds_v5": 1.088000, - "Standard_DC16es_v5": 0.920000, - "Standard_DC16s_v3": 1.840000, - "Standard_DC1ds_v3": 0.136000, - "Standard_DC1s_v2": 0.115000, - "Standard_DC1s_v3": 0.115000, - "Standard_DC24ds_v3": 3.264000, - "Standard_DC24s_v3": 2.760000, - "Standard_DC2ads_v5": 0.125000, - "Standard_DC2as_v5": 0.104000, - "Standard_DC2ds_v3": 0.272000, - "Standard_DC2eds_v5": 0.136000, - "Standard_DC2es_v5": 0.115000, - "Standard_DC2s": 0.257000, - "Standard_DC2s_v2": 0.230000, - "Standard_DC2s_v3": 0.230000, - "Standard_DC32ads_cc_v5": 2.000000, - "Standard_DC32ads_v5": 2.000000, - "Standard_DC32as_cc_v5": 1.664000, - "Standard_DC32as_v5": 1.664000, - "Standard_DC32ds_v3": 4.352000, - "Standard_DC32eds_v5": 2.176000, - "Standard_DC32es_v5": 1.840000, - "Standard_DC32s_v3": 3.680000, - "Standard_DC48ads_cc_v5": 3.000000, - "Standard_DC48ads_v5": 3.000000, - "Standard_DC48as_cc_v5": 2.496000, - "Standard_DC48as_v5": 2.496000, - "Standard_DC48ds_v3": 6.528000, - "Standard_DC48eds_v5": 3.264000, - "Standard_DC48es_v5": 2.760000, - "Standard_DC48s_v3": 5.520000, - "Standard_DC4ads_cc_v5": 0.250000, - "Standard_DC4ads_v5": 0.250000, - "Standard_DC4as_cc_v5": 0.208000, - "Standard_DC4as_v5": 0.208000, - "Standard_DC4ds_v3": 0.544000, - "Standard_DC4eds_v5": 0.272000, - "Standard_DC4es_v5": 0.230000, - "Standard_DC4s": 0.514000, - "Standard_DC4s_v2": 0.460000, - "Standard_DC4s_v3": 0.460000, - "Standard_DC64ads_cc_v5": 4.000000, - "Standard_DC64ads_v5": 4.000000, - "Standard_DC64as_cc_v5": 3.328000, - "Standard_DC64as_v5": 3.328000, - "Standard_DC64eds_v5": 4.352000, - "Standard_DC64es_v5": 3.680000, - "Standard_DC8_v2": 0.920000, - "Standard_DC8ads_cc_v5": 0.500000, - "Standard_DC8ads_v5": 0.500000, - "Standard_DC8as_cc_v5": 0.416000, - "Standard_DC8as_v5": 0.416000, - "Standard_DC8ds_v3": 1.088000, - "Standard_DC8eds_v5": 0.544000, - "Standard_DC8es_v5": 0.460000, - "Standard_DC8s_v3": 0.920000, - "Standard_DC96ads_cc_v5": 6.000000, - "Standard_DC96ads_v5": 6.000000, - "Standard_DC96as_cc_v5": 4.992000, - "Standard_DC96as_v5": 4.992000, - "Standard_DC96eds_v5": 6.528000, - "Standard_DC96es_v5": 5.520000, - "Standard_DS1": 0.084000, - "Standard_DS11": 0.221000, - "Standard_DS11-1_v2": 0.190000, - "Standard_DS11_v2": 0.190000, - "Standard_DS11_v2_Promo": 0.190000, - "Standard_DS12": 0.442000, - "Standard_DS12-1_v2": 0.379000, - "Standard_DS12-2_v2": 0.379000, - "Standard_DS12_v2": 0.379000, - "Standard_DS12_v2_Promo": 0.379000, - "Standard_DS13": 0.885000, - "Standard_DS13-2_v2": 0.759000, - "Standard_DS13-4_v2": 0.759000, - "Standard_DS13_v2": 0.759000, - "Standard_DS13_v2_Promo": 0.759000, - "Standard_DS14": 1.769000, - "Standard_DS14-4_v2": 1.518000, - "Standard_DS14-8_v2": 1.518000, - "Standard_DS14_v2": 1.518000, - "Standard_DS14_v2_Promo": 1.518000, - "Standard_DS15_v2": 1.897000, - "Standard_DS15i_v2": 1.897000, - "Standard_DS1_v2": 0.067900, - "Standard_DS2": 0.168000, - "Standard_DS2_v2": 0.136000, - "Standard_DS2_v2_Promo": 0.136000, - "Standard_DS3": 0.336000, - "Standard_DS3_v2": 0.272000, - "Standard_DS3_v2_Promo": 0.272000, - "Standard_DS4": 0.672000, - "Standard_DS4_v2": 0.544000, - "Standard_DS4_v2_Promo": 0.544000, - "Standard_DS5_v2": 1.087000, - "Standard_DS5_v2_Promo": 1.087000, - "Standard_E104i_v5": 8.694000, - "Standard_E104id_v5": 9.896000, - "Standard_E104ids_v5": 9.896000, - "Standard_E104is_v5": 8.694000, - "Standard_E112iads_v5": 9.733000, - "Standard_E112ias_v5": 8.439000, - "Standard_E112ibds_v5": 12.258000, - "Standard_E112ibs_v5": 10.965000, - "Standard_E16-4ads_v5": 1.264000, - "Standard_E16-4as_v4": 1.216000, - "Standard_E16-4as_v5": 1.096000, - "Standard_E16-4ds_v4": 1.384000, - "Standard_E16-4ds_v5": 1.384000, - "Standard_E16-4s_v3": 1.280000, - "Standard_E16-4s_v4": 1.216000, - "Standard_E16-4s_v5": 1.216000, - "Standard_E16-8ads_v5": 1.264000, - "Standard_E16-8as_v4": 1.216000, - "Standard_E16-8as_v5": 1.096000, - "Standard_E16-8ds_v4": 1.384000, - "Standard_E16-8ds_v5": 1.384000, - "Standard_E16-8s_v3": 1.280000, - "Standard_E16-8s_v4": 1.216000, - "Standard_E16-8s_v5": 1.216000, - "Standard_E16_v3": 1.280000, - "Standard_E16_v4": 1.216000, - "Standard_E16_v5": 1.216000, - "Standard_E16a_v4": 1.216000, - "Standard_E16ads_v5": 1.264000, - "Standard_E16as_v4": 1.216000, - "Standard_E16as_v5": 1.096000, - "Standard_E16bds_v5": 1.592000, - "Standard_E16bs_v5": 1.424000, - "Standard_E16d_v4": 1.384000, - "Standard_E16d_v5": 1.384000, - "Standard_E16ds_v4": 1.384000, - "Standard_E16ds_v5": 1.384000, - "Standard_E16pds_v5": 1.104000, - "Standard_E16ps_v5": 0.973000, - "Standard_E16s_v3": 1.280000, - "Standard_E16s_v4": 1.216000, - "Standard_E16s_v5": 1.216000, - "Standard_E20_v3": 1.600000, - "Standard_E20_v4": 1.520000, - "Standard_E20_v5": 1.520000, - "Standard_E20a_v4": 1.520000, - "Standard_E20ads_v5": 1.580000, - "Standard_E20as_v4": 1.520000, - "Standard_E20as_v5": 1.370000, - "Standard_E20d_v4": 1.730000, - "Standard_E20d_v5": 1.730000, - "Standard_E20ds_v4": 1.730000, - "Standard_E20ds_v5": 1.730000, - "Standard_E20pds_v5": 1.380000, - "Standard_E20ps_v5": 1.216000, - "Standard_E20s_v3": 1.600000, - "Standard_E20s_v4": 1.520000, - "Standard_E20s_v5": 1.520000, - "Standard_E2_v3": 0.160000, - "Standard_E2_v4": 0.152000, - "Standard_E2_v5": 0.152000, - "Standard_E2a_v4": 0.152000, - "Standard_E2ads_v5": 0.158000, - "Standard_E2as_v4": 0.152000, - "Standard_E2as_v5": 0.137000, - "Standard_E2bds_v5": 0.199000, - "Standard_E2bs_v5": 0.178000, - "Standard_E2d_v4": 0.173000, - "Standard_E2d_v5": 0.173000, - "Standard_E2ds_v4": 0.173000, - "Standard_E2ds_v5": 0.173000, - "Standard_E2pds_v5": 0.138000, - "Standard_E2ps_v5": 0.122000, - "Standard_E2s_v3": 0.160000, - "Standard_E2s_v4": 0.152000, - "Standard_E2s_v5": 0.152000, - "Standard_E32-16ads_v5": 2.528000, - "Standard_E32-16as_v4": 2.432000, - "Standard_E32-16as_v5": 2.192000, - "Standard_E32-16ds_v4": 2.768000, - "Standard_E32-16ds_v5": 2.768000, - "Standard_E32-16s_v3": 2.560000, - "Standard_E32-16s_v4": 2.432000, - "Standard_E32-16s_v5": 2.432000, - "Standard_E32-8ads_v5": 2.528000, - "Standard_E32-8as_v4": 2.432000, - "Standard_E32-8as_v5": 2.192000, - "Standard_E32-8ds_v4": 2.768000, - "Standard_E32-8ds_v5": 2.768000, - "Standard_E32-8s_v3": 2.560000, - "Standard_E32-8s_v4": 2.432000, - "Standard_E32-8s_v5": 2.432000, - "Standard_E32_v3": 2.560000, - "Standard_E32_v4": 2.432000, - "Standard_E32_v5": 2.432000, - "Standard_E32a_v4": 2.432000, - "Standard_E32ads_v5": 2.528000, - "Standard_E32as_v4": 2.432000, - "Standard_E32as_v5": 2.192000, - "Standard_E32bds_v5": 3.184000, - "Standard_E32bs_v5": 2.848000, - "Standard_E32d_v4": 2.768000, - "Standard_E32d_v5": 2.768000, - "Standard_E32ds_v4": 2.768000, - "Standard_E32ds_v5": 2.768000, - "Standard_E32pds_v5": 2.208000, - "Standard_E32ps_v5": 1.946000, - "Standard_E32s_v3": 2.560000, - "Standard_E32s_v4": 2.432000, - "Standard_E32s_v5": 2.432000, - "Standard_E4-2ads_v5": 0.316000, - "Standard_E4-2as_v4": 0.304000, - "Standard_E4-2as_v5": 0.274000, - "Standard_E4-2ds_v4": 0.346000, - "Standard_E4-2ds_v5": 0.346000, - "Standard_E4-2s_v3": 0.320000, - "Standard_E4-2s_v4": 0.304000, - "Standard_E4-2s_v5": 0.304000, - "Standard_E48_v3": 3.647000, - "Standard_E48_v4": 3.648000, - "Standard_E48_v5": 3.648000, - "Standard_E48a_v4": 3.648000, - "Standard_E48ads_v5": 3.792000, - "Standard_E48as_v4": 3.648000, - "Standard_E48as_v5": 3.288000, - "Standard_E48bds_v5": 4.776000, - "Standard_E48bs_v5": 4.272000, - "Standard_E48d_v4": 4.152000, - "Standard_E48d_v5": 4.152000, - "Standard_E48ds_v4": 4.152000, - "Standard_E48ds_v5": 4.152000, - "Standard_E48s_v3": 3.647000, - "Standard_E48s_v4": 3.648000, - "Standard_E48s_v5": 3.648000, - "Standard_E4_v3": 0.320000, - "Standard_E4_v4": 0.304000, - "Standard_E4_v5": 0.304000, - "Standard_E4a_v4": 0.304000, - "Standard_E4ads_v5": 0.316000, - "Standard_E4as_v4": 0.304000, - "Standard_E4as_v5": 0.274000, - "Standard_E4bds_v5": 0.398000, - "Standard_E4bs_v5": 0.356000, - "Standard_E4d_v4": 0.346000, - "Standard_E4d_v5": 0.346000, - "Standard_E4ds_v4": 0.346000, - "Standard_E4ds_v5": 0.346000, - "Standard_E4pds_v5": 0.276000, - "Standard_E4ps_v5": 0.243000, - "Standard_E4s_v3": 0.320000, - "Standard_E4s_v4": 0.304000, - "Standard_E4s_v5": 0.304000, - "Standard_E64-16ads_v5": 5.056000, - "Standard_E64-16as_v4": 4.864000, - "Standard_E64-16as_v5": 4.384000, - "Standard_E64-16ds_v4": 5.536000, - "Standard_E64-16ds_v5": 5.536000, - "Standard_E64-16s_v3": 4.376000, - "Standard_E64-16s_v4": 4.864000, - "Standard_E64-16s_v5": 4.864000, - "Standard_E64-32ads_v5": 5.056000, - "Standard_E64-32as_v4": 4.864000, - "Standard_E64-32as_v5": 4.384000, - "Standard_E64-32ds_v4": 5.536000, - "Standard_E64-32ds_v5": 5.536000, - "Standard_E64-32s_v3": 4.376000, - "Standard_E64-32s_v4": 4.864000, - "Standard_E64-32s_v5": 4.864000, - "Standard_E64_v3": 4.376000, - "Standard_E64_v4": 4.864000, - "Standard_E64_v5": 4.864000, - "Standard_E64a_v4": 4.864000, - "Standard_E64ads_v5": 5.056000, - "Standard_E64as_v4": 4.864000, - "Standard_E64as_v5": 4.384000, - "Standard_E64bds_v5": 6.368000, - "Standard_E64bs_v5": 5.696000, - "Standard_E64d_v4": 5.536000, - "Standard_E64d_v5": 5.536000, - "Standard_E64ds_v4": 5.536000, - "Standard_E64ds_v5": 5.536000, - "Standard_E64i_v3": 4.376000, - "Standard_E64is_v3": 4.376000, - "Standard_E64s_v3": 4.376000, - "Standard_E64s_v4": 4.864000, - "Standard_E64s_v5": 4.864000, - "Standard_E8-2ads_v5": 0.632000, - "Standard_E8-2as_v4": 0.608000, - "Standard_E8-2as_v5": 0.548000, - "Standard_E8-2ds_v4": 0.692000, - "Standard_E8-2ds_v5": 0.692000, - "Standard_E8-2s_v3": 0.640000, - "Standard_E8-2s_v4": 0.608000, - "Standard_E8-2s_v5": 0.608000, - "Standard_E8-4ads_v5": 0.632000, - "Standard_E8-4as_v4": 0.608000, - "Standard_E8-4as_v5": 0.548000, - "Standard_E8-4ds_v4": 0.692000, - "Standard_E8-4ds_v5": 0.692000, - "Standard_E8-4s_v3": 0.640000, - "Standard_E8-4s_v4": 0.608000, - "Standard_E8-4s_v5": 0.608000, - "Standard_E80ids_v4": 6.920000, - "Standard_E80is_v4": 6.080000, - "Standard_E8_v3": 0.640000, - "Standard_E8_v4": 0.608000, - "Standard_E8_v5": 0.608000, - "Standard_E8a_v4": 0.608000, - "Standard_E8ads_v5": 0.632000, - "Standard_E8as_v4": 0.608000, - "Standard_E8as_v5": 0.548000, - "Standard_E8bds_v5": 0.796000, - "Standard_E8bs_v5": 0.712000, - "Standard_E8d_v4": 0.692000, - "Standard_E8d_v5": 0.692000, - "Standard_E8ds_v4": 0.692000, - "Standard_E8ds_v5": 0.692000, - "Standard_E8pds_v5": 0.552000, - "Standard_E8ps_v5": 0.486000, - "Standard_E8s_v3": 0.640000, - "Standard_E8s_v4": 0.608000, - "Standard_E8s_v5": 0.608000, - "Standard_E96-24ads_v5": 7.584000, - "Standard_E96-24as_v4": 7.296000, - "Standard_E96-24as_v5": 6.576000, - "Standard_E96-24ds_v5": 8.304000, - "Standard_E96-24s_v5": 7.296000, - "Standard_E96-48ads_v5": 7.584000, - "Standard_E96-48as_v4": 7.296000, - "Standard_E96-48as_v5": 6.576000, - "Standard_E96-48ds_v5": 8.304000, - "Standard_E96-48s_v5": 7.296000, - "Standard_E96_v5": 7.296000, - "Standard_E96a_v4": 7.296000, - "Standard_E96ads_v5": 7.584000, - "Standard_E96as_v4": 7.296000, - "Standard_E96as_v5": 6.576000, - "Standard_E96bds_v5": 9.552000, - "Standard_E96bs_v5": 8.544000, - "Standard_E96d_v5": 8.304000, - "Standard_E96ds_v5": 8.304000, - "Standard_E96iads_v5": 8.342000, - "Standard_E96ias_v5": 7.234000, - "Standard_E96s_v5": 7.296000, - "Standard_EC16ads_cc_v5": 1.264000, - "Standard_EC16ads_v5": 1.184000, - "Standard_EC16as_cc_v5": 1.096000, - "Standard_EC16as_v5": 1.096000, - "Standard_EC16eds_v5": 1.384000, - "Standard_EC16es_v5": 1.216000, - "Standard_EC20ads_cc_v5": 1.580000, - "Standard_EC20ads_v5": 1.480000, - "Standard_EC20as_cc_v5": 1.370000, - "Standard_EC20as_v5": 1.370000, - "Standard_EC2ads_v5": 0.148000, - "Standard_EC2as_v5": 0.137000, - "Standard_EC2eds_v5": 0.173000, - "Standard_EC2es_v5": 0.152000, - "Standard_EC32ads_cc_v5": 2.528000, - "Standard_EC32ads_v5": 2.368000, - "Standard_EC32as_cc_v5": 2.192000, - "Standard_EC32as_v5": 2.192000, - "Standard_EC32eds_v5": 2.768000, - "Standard_EC32es_v5": 2.432000, - "Standard_EC48ads_cc_v5": 3.792000, - "Standard_EC48ads_v5": 3.552000, - "Standard_EC48as_cc_v5": 3.288000, - "Standard_EC48as_v5": 3.288000, - "Standard_EC48eds_v5": 4.152000, - "Standard_EC48es_v5": 3.648000, - "Standard_EC4ads_cc_v5": 0.316000, - "Standard_EC4ads_v5": 0.296000, - "Standard_EC4as_cc_v5": 0.274000, - "Standard_EC4as_v5": 0.274000, - "Standard_EC4eds_v5": 0.346000, - "Standard_EC4es_v5": 0.304000, - "Standard_EC64ads_cc_v5": 5.056000, - "Standard_EC64ads_v5": 4.736000, - "Standard_EC64as_cc_v5": 4.384000, - "Standard_EC64as_v5": 4.384000, - "Standard_EC64eds_v5": 5.536000, - "Standard_EC64es_v5": 4.864000, - "Standard_EC8ads_cc_v5": 0.632000, - "Standard_EC8ads_v5": 0.592000, - "Standard_EC8as_cc_v5": 0.548000, - "Standard_EC8as_v5": 0.548000, - "Standard_EC8eds_v5": 0.692000, - "Standard_EC8es_v5": 0.608000, - "Standard_EC96ads_cc_v5": 7.584000, - "Standard_EC96ads_v5": 7.104000, - "Standard_EC96as_cc_v5": 6.576000, - "Standard_EC96as_v5": 6.576000, - "Standard_EC96eds_v5": 8.304000, - "Standard_EC96es_v5": 7.296000, - "Standard_EC96iads_v5": 7.814000, - "Standard_EC96ias_v5": 7.234000, - "Standard_F1": 0.056800, - "Standard_F16": 0.909000, - "Standard_F16s": 0.909000, - "Standard_F16s_v2": 0.776000, - "Standard_F1s": 0.056800, - "Standard_F2": 0.114000, - "Standard_F2s": 0.114000, - "Standard_F2s_v2": 0.097000, - "Standard_F32s_v2": 1.552000, - "Standard_F4": 0.227000, - "Standard_F48s_v2": 2.328000, - "Standard_F4s": 0.227000, - "Standard_F4s_v2": 0.194000, - "Standard_F64s_v2": 3.104000, - "Standard_F72s_v2": 3.492000, - "Standard_F8": 0.454000, - "Standard_F8s": 0.454000, - "Standard_F8s_v2": 0.388000, - "Standard_FX12mds": 1.350000, - "Standard_FX24mds": 2.700000, - "Standard_FX36mds": 4.050000, - "Standard_FX48mds": 5.400000, - "Standard_FX4mds": 0.450000, - "Standard_G1": 0.700000, - "Standard_G2": 1.400000, - "Standard_G3": 2.800000, - "Standard_G4": 5.600000, - "Standard_G5": 9.990000, - "Standard_GS1": 0.700000, - "Standard_GS2": 1.400000, - "Standard_GS3": 2.800000, - "Standard_GS4": 5.600000, - "Standard_GS4-4": 5.600000, - "Standard_GS4-8": 5.600000, - "Standard_GS5": 9.990000, - "Standard_GS5-16": 9.990000, - "Standard_GS5-8": 9.990000, - "Standard_H16": 2.065000, - "Standard_H16m": 2.767000, - "Standard_H16mr": 3.043000, - "Standard_H16r": 2.271000, - "Standard_H8": 1.032000, - "Standard_H8m": 1.383000, - "Standard_HB120-16rs_v2": 4.680000, - "Standard_HB120-16rs_v3": 4.680000, - "Standard_HB120-32rs_v2": 4.680000, - "Standard_HB120-32rs_v3": 4.680000, - "Standard_HB120-64rs_v2": 4.680000, - "Standard_HB120-64rs_v3": 4.680000, - "Standard_HB120-96rs_v2": 4.680000, - "Standard_HB120-96rs_v3": 4.680000, - "Standard_HB120rs_v2": 4.680000, - "Standard_HB120rs_v3": 4.680000, - "Standard_HB176-144rs_v4": 9.360000, - "Standard_HB176-24rs_v4": 9.360000, - "Standard_HB176-48rs_v4": 9.360000, - "Standard_HB176-96rs_v4": 9.360000, - "Standard_HB176rs_v4": 9.360000, - "Standard_HB60-15rs": 2.964000, - "Standard_HB60-30rs": 2.964000, - "Standard_HB60-45rs": 2.964000, - "Standard_HB60rs": 2.964000, - "Standard_HC44-16rs": 4.118000, - "Standard_HC44-32rs": 4.118000, - "Standard_HC44rs": 4.118000, - "Standard_HX176-144rs": 11.232000, - "Standard_HX176-24rs": 11.232000, - "Standard_HX176-48rs": 11.232000, - "Standard_HX176-96rs": 11.232000, - "Standard_HX176rs": 11.232000, - "Standard_L16as_v3": 1.488000, - "Standard_L16s": 1.488000, - "Standard_L16s_v2": 1.488000, - "Standard_L16s_v3": 1.664000, - "Standard_L32as_v3": 2.976000, - "Standard_L32s": 2.976000, - "Standard_L32s_v2": 2.976000, - "Standard_L32s_v3": 3.328000, - "Standard_L48as_v3": 4.464000, - "Standard_L48s_v2": 4.464000, - "Standard_L48s_v3": 4.992000, - "Standard_L4s": 0.372000, - "Standard_L64as_v3": 5.952000, - "Standard_L64s_v2": 5.952000, - "Standard_L64s_v3": 6.656000, - "Standard_L80as_v3": 7.440000, - "Standard_L80s_v2": 7.440000, - "Standard_L80s_v3": 8.320000, - "Standard_L88is_v2": 8.184000, - "Standard_L8as_v3": 0.744000, - "Standard_L8s": 0.744000, - "Standard_L8s_v2": 0.744000, - "Standard_L8s_v3": 0.832000, - "Standard_M128": 18.673000, - "Standard_M128-32ms": 37.363200, - "Standard_M128-64ms": 37.363200, - "Standard_M128dms_v2": 37.366000, - "Standard_M128ds_v2": 18.676000, - "Standard_M128m": 37.363200, - "Standard_M128ms": 37.363200, - "Standard_M128ms_v2": 36.777000, - "Standard_M128s": 18.673000, - "Standard_M128s_v2": 18.087000, - "Standard_M12ds_v3": 0.000000, - "Standard_M12s_v3": 0.000000, - "Standard_M16-4ms": 4.302200, - "Standard_M16-8ms": 4.302200, - "Standard_M16ms": 4.302200, - "Standard_M16s": 3.341800, - "Standard_M176ds_3_v3": 0.000000, - "Standard_M176s_3_v3": 0.000000, - "Standard_M192idms_v2": 44.889000, - "Standard_M192ids_v2": 22.445000, - "Standard_M192ims_v2": 44.300000, - "Standard_M192is_v2": 21.856000, - "Standard_M208-104ms_v2": 53.544000, - "Standard_M208-104s_v2": 26.772000, - "Standard_M208-52ms_v2": 53.544000, - "Standard_M208-52s_v2": 26.772000, - "Standard_M208ms_v2": 53.544000, - "Standard_M208s_v2": 26.772000, - "Standard_M24ds_v3": 0.000000, - "Standard_M24s_v3": 0.000000, - "Standard_M32-16ms": 8.604400, - "Standard_M32-8ms": 8.604400, - "Standard_M32dms_v2": 8.604000, - "Standard_M32ls": 3.447600, - "Standard_M32ms": 8.604400, - "Standard_M32ms_v2": 8.457000, - "Standard_M32s": 4.669000, - "Standard_M32ts": 3.248000, - "Standard_M416-104ms_v2": 118.980000, - "Standard_M416-104s_v2": 59.496000, - "Standard_M416-208ms_v2": 118.980000, - "Standard_M416-208s_v2": 59.496000, - "Standard_M416is_v2": 59.496000, - "Standard_M416ms_v2": 118.980000, - "Standard_M416s_8_v2": 79.750000, - "Standard_M416s_v2": 59.496000, - "Standard_M48ds_1_v3": 0.000000, - "Standard_M48s_1_v3": 0.000000, - "Standard_M64": 9.337000, - "Standard_M64-16ms": 14.472000, - "Standard_M64-32ms": 14.472000, - "Standard_M64dms_v2": 14.476000, - "Standard_M64ds_v2": 9.337000, - "Standard_M64ls": 6.498000, - "Standard_M64m": 14.472000, - "Standard_M64ms": 14.472000, - "Standard_M64ms_v2": 14.181000, - "Standard_M64s": 9.337000, - "Standard_M64s_v2": 9.042000, - "Standard_M8-2ms": 2.151100, - "Standard_M8-4ms": 2.151100, - "Standard_M8ms": 2.151100, - "Standard_M96ds_1_v3": 0.000000, - "Standard_M96ds_2_v3": 0.000000, - "Standard_M96s_1_v3": 0.000000, - "Standard_M96s_2_v3": 0.000000, - "Standard_NC12": 2.333000, - "Standard_NC12s_v2": 5.364000, - "Standard_NC12s_v3": 7.646000, - "Standard_NC16ads_A10_v4": 2.860000, - "Standard_NC16as_T4_v3": 1.505000, - "Standard_NC24": 4.666000, - "Standard_NC24ads_A100_v4": 4.775000, - "Standard_NC24r": 5.132000, - "Standard_NC24rs_v2": 11.804000, - "Standard_NC24rs_v3": 16.821000, - "Standard_NC24s_v2": 10.728000, - "Standard_NC24s_v3": 15.292000, - "Standard_NC32ads_A10_v4": 5.720000, - "Standard_NC48ads_A100_v4": 9.550000, - "Standard_NC4as_T4_v3": 0.658000, - "Standard_NC6": 1.166000, - "Standard_NC64as_T4_v3": 5.440000, - "Standard_NC6s_v2": 2.682000, - "Standard_NC6s_v3": 3.823000, - "Standard_NC8ads_A10_v4": 1.430000, - "Standard_NC8as_T4_v3": 0.940000, - "Standard_NC96ads_A100_v4": 19.100000, - "Standard_ND12s": 5.363000, - "Standard_ND24rs": 11.804000, - "Standard_ND24s": 10.727000, - "Standard_ND40rs_v2": 27.526000, - "Standard_ND40s_v2": 18.030000, - "Standard_ND6s": 2.682000, - "Standard_ND96ams_A100_v4": 40.962000, - "Standard_ND96amsr_A100_v4": 40.962000, - "Standard_ND96asr_A100_v4": 35.357000, - "Standard_ND96asr_v4": 35.357000, - "Standard_NG16ads_V620_v1": 2.847000, - "Standard_NG32adms_V620": 7.402000, - "Standard_NG32ads_V620_v1": 5.694000, - "Standard_NG8ads_V620_v1": 1.424000, - "Standard_NP10s": 2.145000, - "Standard_NP20s": 4.290000, - "Standard_NP40s": 8.580000, - "Standard_NV12": 2.730000, - "Standard_NV12ads_A10_v5": 1.180000, - "Standard_NV12s_v3": 1.426000, - "Standard_NV16as_v4": 1.165000, - "Standard_NV18ads_A10_v5": 2.080000, - "Standard_NV24": 5.460000, - "Standard_NV24s_v3": 2.850000, - "Standard_NV32as_v4": 2.330000, - "Standard_NV36adms_A10_v5": 5.876000, - "Standard_NV36ads_A10_v5": 4.160000, - "Standard_NV48s_v3": 5.700000, - "Standard_NV4as_v4": 0.291000, - "Standard_NV6": 1.365000, - "Standard_NV6ads_A10_v5": 0.590000, - "Standard_NV72ads_A10_v5": 8.476000, - "Standard_NV8as_v4": 0.582000, - "Standard_PB12s": 2.158000, - "Standard_PB24s": 4.316000, - "Standard_PB6s": 1.079000, - } - // westindia - initialOnDemandPrices["westindia"] = map[string]float64{ - "Basic_A0": 0.018000, - "Basic_A1": 0.030000, - "Basic_A2": 0.096000, - "Basic_A3": 0.232000, - "Basic_A4": 0.464000, - "Dadsv5_Type1": 8.121000, - "Dasv4_Type1": 6.758000, - "Dasv4_Type2": 6.758000, - "Dasv5_Type1": 6.781000, - "Ddsv5_Type1": 7.637000, - "Dsv3_Type3": 4.445000, - "Dsv3_Type4": 5.556000, - "Dsv5_Type1": 6.758000, - "Eadsv5_Type1": 8.854000, - "Easv4_Type1": 8.516000, - "Easv4_Type2": 8.516000, - "Easv5_Type1": 7.637000, - "Ebdsv5-Type1": 7.524000, - "Ebsv5-Type1": 6.713000, - "Edsv5_Type1": 9.732000, - "Esv3_Type3": 5.172000, - "Esv3_Type4": 7.007000, - "Esv5_Type1": 8.516000, - "Fsv2_Type2": 3.366000, - "Lasv3_Type1": 8.786000, - "Lsv3_Type1": 9.828000, - "Standard_A0": 0.020000, - "Standard_A1": 0.066000, - "Standard_A1_v2": 0.047000, - "Standard_A2": 0.131000, - "Standard_A2_v2": 0.098000, - "Standard_A2m_v2": 0.158000, - "Standard_A3": 0.262000, - "Standard_A4": 0.524000, - "Standard_A4_v2": 0.206000, - "Standard_A4m_v2": 0.333000, - "Standard_A5": 0.260000, - "Standard_A6": 0.520000, - "Standard_A7": 1.040000, - "Standard_A8_v2": 0.433000, - "Standard_A8m_v2": 0.699000, - "Standard_B12ms": 0.714000, - "Standard_B16als_v2": 0.755000, - "Standard_B16as_v2": 0.770000, - "Standard_B16ls_v2": 0.755000, - "Standard_B16ms": 0.951000, - "Standard_B16s_v2": 0.926000, - "Standard_B1ls": 0.007800, - "Standard_B1ms": 0.030000, - "Standard_B1s": 0.014700, - "Standard_B20ms": 1.189000, - "Standard_B2als_v2": 0.048100, - "Standard_B2as_v2": 0.096300, - "Standard_B2ats_v2": 0.021200, - "Standard_B2ls_v2": 0.053200, - "Standard_B2ms": 0.119000, - "Standard_B2s": 0.059000, - "Standard_B2s_v2": 0.116000, - "Standard_B2ts_v2": 0.013300, - "Standard_B32als_v2": 1.511000, - "Standard_B32as_v2": 1.687000, - "Standard_B32ls_v2": 1.509000, - "Standard_B32s_v2": 1.851000, - "Standard_B4als_v2": 0.189000, - "Standard_B4as_v2": 0.211000, - "Standard_B4ls_v2": 0.189000, - "Standard_B4ms": 0.238000, - "Standard_B4s_v2": 0.213000, - "Standard_B8als_v2": 0.341000, - "Standard_B8as_v2": 0.422000, - "Standard_B8ls_v2": 0.414000, - "Standard_B8ms": 0.476000, - "Standard_B8s_v2": 0.426000, - "Standard_D1": 0.067900, - "Standard_D11": 0.176000, - "Standard_D11_v2": 0.189000, - "Standard_D11_v2_Promo": 0.189000, - "Standard_D12": 0.352000, - "Standard_D12_v2": 0.379000, - "Standard_D12_v2_Promo": 0.379000, - "Standard_D13": 0.704000, - "Standard_D13_v2": 0.758000, - "Standard_D13_v2_Promo": 0.758000, - "Standard_D14": 1.407000, - "Standard_D14_v2": 1.516000, - "Standard_D14_v2_Promo": 1.516000, - "Standard_D15_v2": 1.895000, - "Standard_D15i_v2": 1.895000, - "Standard_D16_v3": 0.984000, - "Standard_D16_v4": 0.944000, - "Standard_D16_v5": 0.983000, - "Standard_D16a_v4": 0.983000, - "Standard_D16ads_v5": 1.055000, - "Standard_D16as_v4": 0.983000, - "Standard_D16as_v5": 0.881000, - "Standard_D16d_v4": 1.112000, - "Standard_D16d_v5": 1.157000, - "Standard_D16ds_v4": 1.112000, - "Standard_D16ds_v5": 1.157000, - "Standard_D16lds_v5": 0.983000, - "Standard_D16ls_v5": 0.870000, - "Standard_D16s_v3": 0.984000, - "Standard_D16s_v4": 0.944000, - "Standard_D16s_v5": 0.983000, - "Standard_D1_v2": 0.084000, - "Standard_D2": 0.136000, - "Standard_D2_v2": 0.169000, - "Standard_D2_v2_Promo": 0.169000, - "Standard_D2_v3": 0.123000, - "Standard_D2_v4": 0.118000, - "Standard_D2_v5": 0.123000, - "Standard_D2a_v4": 0.123000, - "Standard_D2ads_v5": 0.132000, - "Standard_D2as_v4": 0.123000, - "Standard_D2as_v5": 0.110000, - "Standard_D2d_v4": 0.139000, - "Standard_D2d_v5": 0.145000, - "Standard_D2ds_v4": 0.139000, - "Standard_D2ds_v5": 0.145000, - "Standard_D2lds_v5": 0.123000, - "Standard_D2ls_v5": 0.109000, - "Standard_D2s_v3": 0.123000, - "Standard_D2s_v4": 0.118000, - "Standard_D2s_v5": 0.123000, - "Standard_D3": 0.272000, - "Standard_D32-16s_v3": 1.968000, - "Standard_D32-8s_v3": 1.968000, - "Standard_D32_v3": 1.968000, - "Standard_D32_v4": 1.888000, - "Standard_D32_v5": 1.966000, - "Standard_D32a_v4": 1.966000, - "Standard_D32ads_v5": 2.109000, - "Standard_D32as_v4": 1.966000, - "Standard_D32as_v5": 1.761000, - "Standard_D32d_v4": 2.224000, - "Standard_D32d_v5": 2.314000, - "Standard_D32ds_v4": 2.224000, - "Standard_D32ds_v5": 2.314000, - "Standard_D32lds_v5": 1.966000, - "Standard_D32ls_v5": 1.741000, - "Standard_D32s_v3": 1.968000, - "Standard_D32s_v4": 1.888000, - "Standard_D32s_v5": 1.966000, - "Standard_D3_v2": 0.337000, - "Standard_D3_v2_Promo": 0.337000, - "Standard_D4": 0.544000, - "Standard_D48_v3": 2.952000, - "Standard_D48_v4": 2.832000, - "Standard_D48_v5": 2.949000, - "Standard_D48a_v4": 2.949000, - "Standard_D48ads_v5": 3.164000, - "Standard_D48as_v4": 2.949000, - "Standard_D48as_v5": 2.642000, - "Standard_D48d_v4": 3.336000, - "Standard_D48d_v5": 3.471000, - "Standard_D48ds_v4": 3.336000, - "Standard_D48ds_v5": 3.471000, - "Standard_D48lds_v5": 2.949000, - "Standard_D48ls_v5": 2.611000, - "Standard_D48s_v3": 2.952000, - "Standard_D48s_v4": 2.832000, - "Standard_D48s_v5": 2.949000, - "Standard_D4_v2": 0.675000, - "Standard_D4_v2_Promo": 0.675000, - "Standard_D4_v3": 0.246000, - "Standard_D4_v4": 0.236000, - "Standard_D4_v5": 0.246000, - "Standard_D4a_v4": 0.246000, - "Standard_D4ads_v5": 0.264000, - "Standard_D4as_v4": 0.246000, - "Standard_D4as_v5": 0.220000, - "Standard_D4d_v4": 0.278000, - "Standard_D4d_v5": 0.289000, - "Standard_D4ds_v4": 0.278000, - "Standard_D4ds_v5": 0.289000, - "Standard_D4lds_v5": 0.246000, - "Standard_D4ls_v5": 0.218000, - "Standard_D4s_v3": 0.246000, - "Standard_D4s_v4": 0.236000, - "Standard_D4s_v5": 0.246000, - "Standard_D5_v2": 1.350000, - "Standard_D5_v2_Promo": 1.350000, - "Standard_D64-16s_v3": 3.936000, - "Standard_D64-32s_v3": 3.936000, - "Standard_D64_v3": 3.936000, - "Standard_D64_v4": 3.776000, - "Standard_D64_v5": 3.932000, - "Standard_D64a_v4": 3.932000, - "Standard_D64ads_v5": 4.219000, - "Standard_D64as_v4": 3.932000, - "Standard_D64as_v5": 3.523000, - "Standard_D64d_v4": 4.448000, - "Standard_D64d_v5": 4.628000, - "Standard_D64ds_v4": 4.448000, - "Standard_D64ds_v5": 4.628000, - "Standard_D64lds_v5": 3.932000, - "Standard_D64ls_v5": 3.482000, - "Standard_D64s_v3": 3.936000, - "Standard_D64s_v4": 3.776000, - "Standard_D64s_v5": 3.932000, - "Standard_D8_v3": 0.492000, - "Standard_D8_v4": 0.472000, - "Standard_D8_v5": 0.492000, - "Standard_D8a_v4": 0.492000, - "Standard_D8ads_v5": 0.527000, - "Standard_D8as_v4": 0.492000, - "Standard_D8as_v5": 0.440000, - "Standard_D8d_v4": 0.556000, - "Standard_D8d_v5": 0.579000, - "Standard_D8ds_v4": 0.556000, - "Standard_D8ds_v5": 0.579000, - "Standard_D8lds_v5": 0.492000, - "Standard_D8ls_v5": 0.435000, - "Standard_D8s_v3": 0.492000, - "Standard_D8s_v4": 0.472000, - "Standard_D8s_v5": 0.492000, - "Standard_D96_v5": 5.898000, - "Standard_D96a_v4": 5.898000, - "Standard_D96ads_v5": 6.328000, - "Standard_D96as_v4": 5.898000, - "Standard_D96as_v5": 5.284000, - "Standard_D96d_v5": 6.943000, - "Standard_D96ds_v5": 6.943000, - "Standard_D96lds_v5": 5.898000, - "Standard_D96ls_v5": 5.222000, - "Standard_D96s_v5": 5.898000, - "Standard_DS1": 0.067900, - "Standard_DS11": 0.176000, - "Standard_DS11-1_v2": 0.189000, - "Standard_DS11_v2": 0.189000, - "Standard_DS11_v2_Promo": 0.189000, - "Standard_DS12": 0.352000, - "Standard_DS12-1_v2": 0.379000, - "Standard_DS12-2_v2": 0.379000, - "Standard_DS12_v2": 0.379000, - "Standard_DS12_v2_Promo": 0.379000, - "Standard_DS13": 0.704000, - "Standard_DS13-2_v2": 0.758000, - "Standard_DS13-4_v2": 0.758000, - "Standard_DS13_v2": 0.758000, - "Standard_DS13_v2_Promo": 0.758000, - "Standard_DS14": 1.407000, - "Standard_DS14-4_v2": 1.516000, - "Standard_DS14-8_v2": 1.516000, - "Standard_DS14_v2": 1.516000, - "Standard_DS14_v2_Promo": 1.516000, - "Standard_DS15_v2": 1.895000, - "Standard_DS15i_v2": 1.895000, - "Standard_DS1_v2": 0.084000, - "Standard_DS2": 0.136000, - "Standard_DS2_v2": 0.169000, - "Standard_DS2_v2_Promo": 0.169000, - "Standard_DS3": 0.272000, - "Standard_DS3_v2": 0.337000, - "Standard_DS3_v2_Promo": 0.337000, - "Standard_DS4": 0.544000, - "Standard_DS4_v2": 0.675000, - "Standard_DS4_v2_Promo": 0.675000, - "Standard_DS5_v2": 1.350000, - "Standard_DS5_v2_Promo": 1.350000, - "Standard_E104i_v5": 9.225000, - "Standard_E104id_v5": 10.543000, - "Standard_E104ids_v5": 10.543000, - "Standard_E104is_v5": 9.225000, - "Standard_E112iads_v5": 10.329000, - "Standard_E112ias_v5": 8.910000, - "Standard_E112ibds_v5": 13.168000, - "Standard_E112ibs_v5": 11.748000, - "Standard_E16-4ads_v5": 1.341000, - "Standard_E16-4as_v4": 1.290000, - "Standard_E16-4as_v5": 1.157000, - "Standard_E16-4ds_v4": 1.390000, - "Standard_E16-4ds_v5": 1.475000, - "Standard_E16-4s_v3": 1.216000, - "Standard_E16-4s_v4": 1.216000, - "Standard_E16-4s_v5": 1.290000, - "Standard_E16-8ads_v5": 1.341000, - "Standard_E16-8as_v4": 1.290000, - "Standard_E16-8as_v5": 1.157000, - "Standard_E16-8ds_v4": 1.390000, - "Standard_E16-8ds_v5": 1.475000, - "Standard_E16-8s_v3": 1.216000, - "Standard_E16-8s_v4": 1.216000, - "Standard_E16-8s_v5": 1.290000, - "Standard_E16_v3": 1.216000, - "Standard_E16_v4": 1.216000, - "Standard_E16_v5": 1.290000, - "Standard_E16a_v4": 1.290000, - "Standard_E16ads_v5": 1.341000, - "Standard_E16as_v4": 1.290000, - "Standard_E16as_v5": 1.157000, - "Standard_E16bds_v5": 1.710000, - "Standard_E16bs_v5": 1.526000, - "Standard_E16d_v4": 1.390000, - "Standard_E16d_v5": 1.475000, - "Standard_E16ds_v4": 1.390000, - "Standard_E16ds_v5": 1.475000, - "Standard_E16s_v3": 1.216000, - "Standard_E16s_v4": 1.216000, - "Standard_E16s_v5": 1.290000, - "Standard_E20_v3": 1.520000, - "Standard_E20_v4": 1.520000, - "Standard_E20_v5": 1.613000, - "Standard_E20a_v4": 1.613000, - "Standard_E20ads_v5": 1.677000, - "Standard_E20as_v4": 1.613000, - "Standard_E20as_v5": 1.446000, - "Standard_E20d_v4": 1.737000, - "Standard_E20d_v5": 1.843000, - "Standard_E20ds_v4": 1.737000, - "Standard_E20ds_v5": 1.843000, - "Standard_E20s_v3": 1.520000, - "Standard_E20s_v4": 1.520000, - "Standard_E20s_v5": 1.613000, - "Standard_E2_v3": 0.152000, - "Standard_E2_v4": 0.152000, - "Standard_E2_v5": 0.161000, - "Standard_E2a_v4": 0.161000, - "Standard_E2ads_v5": 0.168000, - "Standard_E2as_v4": 0.161000, - "Standard_E2as_v5": 0.145000, - "Standard_E2bds_v5": 0.214000, - "Standard_E2bs_v5": 0.191000, - "Standard_E2d_v4": 0.174000, - "Standard_E2d_v5": 0.184000, - "Standard_E2ds_v4": 0.174000, - "Standard_E2ds_v5": 0.184000, - "Standard_E2s_v3": 0.152000, - "Standard_E2s_v4": 0.152000, - "Standard_E2s_v5": 0.161000, - "Standard_E32-16ads_v5": 2.683000, - "Standard_E32-16as_v4": 2.580000, - "Standard_E32-16as_v5": 2.314000, - "Standard_E32-16ds_v4": 2.779000, - "Standard_E32-16ds_v5": 2.949000, - "Standard_E32-16s_v3": 2.432000, - "Standard_E32-16s_v4": 2.432000, - "Standard_E32-16s_v5": 2.580000, - "Standard_E32-8ads_v5": 2.683000, - "Standard_E32-8as_v4": 2.580000, - "Standard_E32-8as_v5": 2.314000, - "Standard_E32-8ds_v4": 2.779000, - "Standard_E32-8ds_v5": 2.949000, - "Standard_E32-8s_v3": 2.432000, - "Standard_E32-8s_v4": 2.432000, - "Standard_E32-8s_v5": 2.580000, - "Standard_E32_v3": 2.432000, - "Standard_E32_v4": 2.432000, - "Standard_E32_v5": 2.580000, - "Standard_E32a_v4": 2.580000, - "Standard_E32ads_v5": 2.683000, - "Standard_E32as_v4": 2.580000, - "Standard_E32as_v5": 2.314000, - "Standard_E32bds_v5": 3.420000, - "Standard_E32bs_v5": 3.052000, - "Standard_E32d_v4": 2.779000, - "Standard_E32d_v5": 2.949000, - "Standard_E32ds_v4": 2.779000, - "Standard_E32ds_v5": 2.949000, - "Standard_E32s_v3": 2.432000, - "Standard_E32s_v4": 2.432000, - "Standard_E32s_v5": 2.580000, - "Standard_E4-2ads_v5": 0.335000, - "Standard_E4-2as_v4": 0.323000, - "Standard_E4-2as_v5": 0.289000, - "Standard_E4-2ds_v4": 0.347000, - "Standard_E4-2ds_v5": 0.369000, - "Standard_E4-2s_v3": 0.304000, - "Standard_E4-2s_v4": 0.304000, - "Standard_E4-2s_v5": 0.323000, - "Standard_E48_v3": 3.640000, - "Standard_E48_v4": 3.648000, - "Standard_E48_v5": 3.871000, - "Standard_E48a_v4": 3.871000, - "Standard_E48ads_v5": 4.024000, - "Standard_E48as_v4": 3.871000, - "Standard_E48as_v5": 3.471000, - "Standard_E48bds_v5": 5.130000, - "Standard_E48bs_v5": 4.577000, - "Standard_E48d_v4": 4.169000, - "Standard_E48d_v5": 4.424000, - "Standard_E48ds_v4": 4.169000, - "Standard_E48ds_v5": 4.424000, - "Standard_E48s_v3": 3.640000, - "Standard_E48s_v4": 3.648000, - "Standard_E48s_v5": 3.871000, - "Standard_E4_v3": 0.304000, - "Standard_E4_v4": 0.304000, - "Standard_E4_v5": 0.323000, - "Standard_E4a_v4": 0.323000, - "Standard_E4ads_v5": 0.335000, - "Standard_E4as_v4": 0.323000, - "Standard_E4as_v5": 0.289000, - "Standard_E4bds_v5": 0.428000, - "Standard_E4bs_v5": 0.381000, - "Standard_E4d_v4": 0.347000, - "Standard_E4d_v5": 0.369000, - "Standard_E4ds_v4": 0.347000, - "Standard_E4ds_v5": 0.369000, - "Standard_E4s_v3": 0.304000, - "Standard_E4s_v4": 0.304000, - "Standard_E4s_v5": 0.323000, - "Standard_E64-16ads_v5": 5.366000, - "Standard_E64-16as_v4": 5.161000, - "Standard_E64-16as_v5": 4.628000, - "Standard_E64-16ds_v4": 5.559000, - "Standard_E64-16ds_v5": 5.898000, - "Standard_E64-16s_v3": 4.368000, - "Standard_E64-16s_v4": 4.864000, - "Standard_E64-16s_v5": 5.161000, - "Standard_E64-32ads_v5": 5.366000, - "Standard_E64-32as_v4": 5.161000, - "Standard_E64-32as_v5": 4.628000, - "Standard_E64-32ds_v4": 5.559000, - "Standard_E64-32ds_v5": 5.898000, - "Standard_E64-32s_v3": 4.368000, - "Standard_E64-32s_v4": 4.864000, - "Standard_E64-32s_v5": 5.161000, - "Standard_E64_v3": 4.368000, - "Standard_E64_v4": 4.864000, - "Standard_E64_v5": 5.161000, - "Standard_E64a_v4": 5.161000, - "Standard_E64ads_v5": 5.366000, - "Standard_E64as_v4": 5.161000, - "Standard_E64as_v5": 4.628000, - "Standard_E64bds_v5": 6.840000, - "Standard_E64bs_v5": 6.103000, - "Standard_E64d_v4": 5.559000, - "Standard_E64d_v5": 5.898000, - "Standard_E64ds_v4": 5.559000, - "Standard_E64ds_v5": 5.898000, - "Standard_E64i_v3": 4.368000, - "Standard_E64is_v3": 4.368000, - "Standard_E64s_v3": 4.368000, - "Standard_E64s_v4": 4.864000, - "Standard_E64s_v5": 5.161000, - "Standard_E8-2ads_v5": 0.671000, - "Standard_E8-2as_v4": 0.645000, - "Standard_E8-2as_v5": 0.579000, - "Standard_E8-2ds_v4": 0.695000, - "Standard_E8-2ds_v5": 0.737000, - "Standard_E8-2s_v3": 0.608000, - "Standard_E8-2s_v4": 0.608000, - "Standard_E8-2s_v5": 0.645000, - "Standard_E8-4ads_v5": 0.671000, - "Standard_E8-4as_v4": 0.645000, - "Standard_E8-4as_v5": 0.579000, - "Standard_E8-4ds_v4": 0.695000, - "Standard_E8-4ds_v5": 0.737000, - "Standard_E8-4s_v3": 0.608000, - "Standard_E8-4s_v4": 0.608000, - "Standard_E8-4s_v5": 0.645000, - "Standard_E80ids_v4": 6.948000, - "Standard_E80is_v4": 6.080000, - "Standard_E8_v3": 0.608000, - "Standard_E8_v4": 0.608000, - "Standard_E8_v5": 0.645000, - "Standard_E8a_v4": 0.645000, - "Standard_E8ads_v5": 0.671000, - "Standard_E8as_v4": 0.645000, - "Standard_E8as_v5": 0.579000, - "Standard_E8bds_v5": 0.855000, - "Standard_E8bs_v5": 0.763000, - "Standard_E8d_v4": 0.695000, - "Standard_E8d_v5": 0.737000, - "Standard_E8ds_v4": 0.695000, - "Standard_E8ds_v5": 0.737000, - "Standard_E8s_v3": 0.608000, - "Standard_E8s_v4": 0.608000, - "Standard_E8s_v5": 0.645000, - "Standard_E96-24ads_v5": 8.049000, - "Standard_E96-24as_v4": 7.741000, - "Standard_E96-24as_v5": 6.943000, - "Standard_E96-24ds_v5": 8.847000, - "Standard_E96-24s_v5": 7.741000, - "Standard_E96-48ads_v5": 8.049000, - "Standard_E96-48as_v4": 7.741000, - "Standard_E96-48as_v5": 6.943000, - "Standard_E96-48ds_v5": 8.847000, - "Standard_E96-48s_v5": 7.741000, - "Standard_E96_v5": 7.741000, - "Standard_E96a_v4": 7.741000, - "Standard_E96ads_v5": 8.049000, - "Standard_E96as_v4": 7.741000, - "Standard_E96as_v5": 6.943000, - "Standard_E96bds_v5": 10.260000, - "Standard_E96bs_v5": 9.155000, - "Standard_E96d_v5": 8.847000, - "Standard_E96ds_v5": 8.847000, - "Standard_E96iads_v5": 8.854000, - "Standard_E96ias_v4": 7.741000, - "Standard_E96ias_v5": 7.637000, - "Standard_E96s_v5": 7.741000, - "Standard_F1": 0.054900, - "Standard_F16": 0.878000, - "Standard_F16s": 0.878000, - "Standard_F16s_v2": 0.680000, - "Standard_F1s": 0.054900, - "Standard_F2": 0.110000, - "Standard_F2s": 0.110000, - "Standard_F2s_v2": 0.085000, - "Standard_F32s_v2": 1.360000, - "Standard_F4": 0.219000, - "Standard_F48s_v2": 2.040000, - "Standard_F4s": 0.219000, - "Standard_F4s_v2": 0.170000, - "Standard_F64s_v2": 2.720000, - "Standard_F72s_v2": 3.060000, - "Standard_F8": 0.439000, - "Standard_F8s": 0.439000, - "Standard_F8s_v2": 0.340000, - "Standard_L16as_v3": 1.597000, - "Standard_L16s_v3": 1.787000, - "Standard_L32as_v3": 3.195000, - "Standard_L32s_v3": 3.574000, - "Standard_L48as_v3": 4.792000, - "Standard_L48s_v3": 5.361000, - "Standard_L64as_v3": 6.390000, - "Standard_L64s_v3": 7.148000, - "Standard_L80as_v3": 7.987000, - "Standard_L80s_v3": 8.934000, - "Standard_L8as_v3": 0.799000, - "Standard_L8s_v3": 0.893000, - } - // westus - initialOnDemandPrices["westus"] = map[string]float64{ - "Basic_A0": 0.018000, - "Basic_A1": 0.031000, - "Basic_A2": 0.081000, - "Basic_A3": 0.188000, - "Basic_A4": 0.376000, - "DCadsv5 Type 1": 7.515000, - "DCasv5 Type 1": 6.222000, - "DCdsv3 Type1": 7.022000, - "DCsv2 Type 1": 0.986000, - "DCsv3 Type1": 5.914000, - "Dadsv5_Type1": 7.515000, - "Dasv4_Type1": 5.914000, - "Dasv4_Type2": 6.160000, - "Dasv5_Type1": 6.222000, - "Ddsv4_Type 1": 4.682000, - "Ddsv4_Type2": 5.559000, - "Ddsv5_Type1": 7.022000, - "Dsv3_Type3": 4.929000, - "Dsv3_Type4": 6.161000, - "Dsv4_Type1": 4.928000, - "Dsv4_Type2": 5.914000, - "Dsv5_Type1": 6.160000, - "ECadsv5 Type 1": 8.596000, - "ECasv5 Type 1": 7.318000, - "Eadsv5_Type1": 7.814000, - "Easv4_Type1": 7.392000, - "Easv4_Type2": 7.392000, - "Easv5_Type1": 6.653000, - "Ebdsv5-Type1": 6.653000, - "Ebsv5-Type1": 5.878000, - "Edsv4_Type 1": 5.702000, - "Edsv4_Type2": 6.772000, - "Edsv5_Type1": 8.554000, - "Esv3_Type3": 4.774000, - "Esv3_Type4": 6.468000, - "Esv4_Type1": 4.928000, - "Esv4_Type2": 6.468000, - "Esv5_Type1": 7.392000, - "Fsv2 Type3": 4.897000, - "Fsv2_Type2": 4.198000, - "Fsv2_Type4": 5.597000, - "Lasv3_Type1": 7.568000, - "Lsv2_Type1": 7.568000, - "Lsv3_Type1": 8.448000, - "Mdsmv2MedMem _Type1": 38.167000, - "Mdsv2MedMem_Type1": 19.076000, - "Ms_Type1": 19.069000, - "Msm_Type1": 38.172000, - "Msmv2MedMem Type1": 37.565000, - "Msmv2_Type1": 141.780000, - "Msv2MedMem Type1": 18.474000, - "Msv2_Type1": 70.899000, - "NVsv3_Type1": 5.016000, - "Standard_A0": 0.020000, - "Standard_A1": 0.060000, - "Standard_A1_v2": 0.043000, - "Standard_A2": 0.120000, - "Standard_A2_v2": 0.091000, - "Standard_A2m_v2": 0.149000, - "Standard_A3": 0.240000, - "Standard_A4": 0.480000, - "Standard_A4_v2": 0.191000, - "Standard_A4m_v2": 0.297000, - "Standard_A5": 0.250000, - "Standard_A6": 0.500000, - "Standard_A7": 1.000000, - "Standard_A8_v2": 0.400000, - "Standard_A8m_v2": 0.594000, - "Standard_B12ms": 0.595000, - "Standard_B16als_v2": 0.632000, - "Standard_B16as_v2": 0.787000, - "Standard_B16ls_v2": 0.776000, - "Standard_B16ms": 0.794000, - "Standard_B16pls_v2": 0.640000, - "Standard_B16ps_v2": 0.714000, - "Standard_B16s_v2": 0.794000, - "Standard_B1ls": 0.006200, - "Standard_B1ms": 0.024800, - "Standard_B1s": 0.012400, - "Standard_B20ms": 0.992000, - "Standard_B2als_v2": 0.053800, - "Standard_B2as_v2": 0.089200, - "Standard_B2ats_v2": 0.011200, - "Standard_B2ls_v2": 0.049600, - "Standard_B2ms": 0.099200, - "Standard_B2pls_v2": 0.049200, - "Standard_B2ps_v2": 0.089200, - "Standard_B2pts_v2": 0.010000, - "Standard_B2s": 0.049600, - "Standard_B2s_v2": 0.099200, - "Standard_B2ts_v2": 0.021600, - "Standard_B32als_v2": 1.411000, - "Standard_B32as_v2": 1.574000, - "Standard_B32ls_v2": 1.405000, - "Standard_B32s_v2": 1.587000, - "Standard_B4als_v2": 0.158000, - "Standard_B4as_v2": 0.197000, - "Standard_B4ls_v2": 0.176000, - "Standard_B4ms": 0.198000, - "Standard_B4pls_v2": 0.142000, - "Standard_B4ps_v2": 0.178000, - "Standard_B4s_v2": 0.198000, - "Standard_B8als_v2": 0.316000, - "Standard_B8as_v2": 0.394000, - "Standard_B8ls_v2": 0.388000, - "Standard_B8ms": 0.397000, - "Standard_B8pls_v2": 0.283000, - "Standard_B8ps_v2": 0.320000, - "Standard_B8s_v2": 0.434000, - "Standard_D1": 0.077000, - "Standard_D11": 0.193000, - "Standard_D11_v2": 0.185000, - "Standard_D11_v2_Promo": 0.185000, - "Standard_D12": 0.386000, - "Standard_D12_v2": 0.370000, - "Standard_D12_v2_Promo": 0.370000, - "Standard_D13": 0.771000, - "Standard_D13_v2": 0.741000, - "Standard_D13_v2_Promo": 0.741000, - "Standard_D14": 1.542000, - "Standard_D14_v2": 1.482000, - "Standard_D14_v2_Promo": 1.482000, - "Standard_D15_v2": 1.852000, - "Standard_D15i_v2": 1.852000, - "Standard_D16_v3": 0.936000, - "Standard_D16_v4": 0.896000, - "Standard_D16_v5": 0.896000, - "Standard_D16a_v4": 0.896000, - "Standard_D16ads_v5": 0.976000, - "Standard_D16as_v4": 0.896000, - "Standard_D16as_v5": 0.808000, - "Standard_D16d_v4": 1.064000, - "Standard_D16d_v5": 1.064000, - "Standard_D16ds_v4": 1.064000, - "Standard_D16ds_v5": 1.064000, - "Standard_D16lds_v5": 0.960000, - "Standard_D16ls_v5": 0.848000, - "Standard_D16pds_v5": 0.848000, - "Standard_D16plds_v5": 0.768000, - "Standard_D16pls_v5": 0.678000, - "Standard_D16ps_v5": 0.717000, - "Standard_D16s_v3": 0.936000, - "Standard_D16s_v4": 0.896000, - "Standard_D16s_v5": 0.896000, - "Standard_D1_v2": 0.070000, - "Standard_D2": 0.154000, - "Standard_D2_v2": 0.140000, - "Standard_D2_v2_Promo": 0.140000, - "Standard_D2_v3": 0.117000, - "Standard_D2_v4": 0.112000, - "Standard_D2_v5": 0.112000, - "Standard_D2a_v4": 0.112000, - "Standard_D2ads_v5": 0.122000, - "Standard_D2as_v4": 0.112000, - "Standard_D2as_v5": 0.101000, - "Standard_D2d_v4": 0.133000, - "Standard_D2d_v5": 0.133000, - "Standard_D2ds_v4": 0.133000, - "Standard_D2ds_v5": 0.133000, - "Standard_D2lds_v5": 0.120000, - "Standard_D2ls_v5": 0.106000, - "Standard_D2pds_v5": 0.106000, - "Standard_D2plds_v5": 0.096000, - "Standard_D2pls_v5": 0.084800, - "Standard_D2ps_v5": 0.089600, - "Standard_D2s_v3": 0.117000, - "Standard_D2s_v4": 0.112000, - "Standard_D2s_v5": 0.112000, - "Standard_D3": 0.308000, - "Standard_D32-16s_v3": 1.872000, - "Standard_D32-8s_v3": 1.872000, - "Standard_D32_v3": 1.872000, - "Standard_D32_v4": 1.792000, - "Standard_D32_v5": 1.792000, - "Standard_D32a_v4": 1.792000, - "Standard_D32ads_v5": 1.952000, - "Standard_D32as_v4": 1.792000, - "Standard_D32as_v5": 1.616000, - "Standard_D32d_v4": 2.128000, - "Standard_D32d_v5": 2.128000, - "Standard_D32ds_v4": 2.128000, - "Standard_D32ds_v5": 2.128000, - "Standard_D32lds_v5": 1.920000, - "Standard_D32ls_v5": 1.696000, - "Standard_D32pds_v5": 1.696000, - "Standard_D32plds_v5": 1.536000, - "Standard_D32pls_v5": 1.357000, - "Standard_D32ps_v5": 1.434000, - "Standard_D32s_v3": 1.872000, - "Standard_D32s_v4": 1.792000, - "Standard_D32s_v5": 1.792000, - "Standard_D3_v2": 0.279000, - "Standard_D3_v2_Promo": 0.279000, - "Standard_D4": 0.616000, - "Standard_D48_v3": 2.808000, - "Standard_D48_v4": 2.688000, - "Standard_D48_v5": 2.688000, - "Standard_D48a_v4": 2.688000, - "Standard_D48ads_v5": 2.928000, - "Standard_D48as_v4": 2.688000, - "Standard_D48as_v5": 2.424000, - "Standard_D48d_v4": 3.192000, - "Standard_D48d_v5": 3.192000, - "Standard_D48ds_v4": 3.192000, - "Standard_D48ds_v5": 3.192000, - "Standard_D48lds_v5": 2.880000, - "Standard_D48ls_v5": 2.544000, - "Standard_D48pds_v5": 2.544000, - "Standard_D48plds_v5": 2.304000, - "Standard_D48pls_v5": 2.035000, - "Standard_D48ps_v5": 2.150000, - "Standard_D48s_v3": 2.808000, - "Standard_D48s_v4": 2.688000, - "Standard_D48s_v5": 2.688000, - "Standard_D4_v2": 0.559000, - "Standard_D4_v2_Promo": 0.559000, - "Standard_D4_v3": 0.234000, - "Standard_D4_v4": 0.224000, - "Standard_D4_v5": 0.224000, - "Standard_D4a_v4": 0.224000, - "Standard_D4ads_v5": 0.244000, - "Standard_D4as_v4": 0.224000, - "Standard_D4as_v5": 0.202000, - "Standard_D4d_v4": 0.266000, - "Standard_D4d_v5": 0.266000, - "Standard_D4ds_v4": 0.266000, - "Standard_D4ds_v5": 0.266000, - "Standard_D4lds_v5": 0.240000, - "Standard_D4ls_v5": 0.212000, - "Standard_D4pds_v5": 0.212000, - "Standard_D4plds_v5": 0.192000, - "Standard_D4pls_v5": 0.170000, - "Standard_D4ps_v5": 0.179000, - "Standard_D4s_v3": 0.234000, - "Standard_D4s_v4": 0.224000, - "Standard_D4s_v5": 0.224000, - "Standard_D5_v2": 1.117000, - "Standard_D5_v2_Promo": 1.117000, - "Standard_D64-16s_v3": 3.744000, - "Standard_D64-32s_v3": 3.744000, - "Standard_D64_v3": 3.744000, - "Standard_D64_v4": 3.584000, - "Standard_D64_v5": 3.584000, - "Standard_D64a_v4": 3.584000, - "Standard_D64ads_v5": 3.904000, - "Standard_D64as_v4": 3.584000, - "Standard_D64as_v5": 3.232000, - "Standard_D64d_v4": 4.256000, - "Standard_D64d_v5": 4.256000, - "Standard_D64ds_v4": 4.256000, - "Standard_D64ds_v5": 4.256000, - "Standard_D64lds_v5": 3.840000, - "Standard_D64ls_v5": 3.392000, - "Standard_D64pds_v5": 3.392000, - "Standard_D64plds_v5": 3.072000, - "Standard_D64pls_v5": 2.714000, - "Standard_D64ps_v5": 2.867000, - "Standard_D64s_v3": 3.744000, - "Standard_D64s_v4": 3.584000, - "Standard_D64s_v5": 3.584000, - "Standard_D8_v3": 0.468000, - "Standard_D8_v4": 0.448000, - "Standard_D8_v5": 0.448000, - "Standard_D8a_v4": 0.448000, - "Standard_D8ads_v5": 0.488000, - "Standard_D8as_v4": 0.448000, - "Standard_D8as_v5": 0.404000, - "Standard_D8d_v4": 0.532000, - "Standard_D8d_v5": 0.532000, - "Standard_D8ds_v4": 0.532000, - "Standard_D8ds_v5": 0.532000, - "Standard_D8lds_v5": 0.480000, - "Standard_D8ls_v5": 0.424000, - "Standard_D8pds_v5": 0.424000, - "Standard_D8plds_v5": 0.384000, - "Standard_D8pls_v5": 0.339000, - "Standard_D8ps_v5": 0.358000, - "Standard_D8s_v3": 0.468000, - "Standard_D8s_v4": 0.448000, - "Standard_D8s_v5": 0.448000, - "Standard_D96_v5": 5.376000, - "Standard_D96a_v4": 5.376000, - "Standard_D96ads_v5": 5.856000, - "Standard_D96as_v4": 5.376000, - "Standard_D96as_v5": 4.848000, - "Standard_D96d_v5": 6.384000, - "Standard_D96ds_v5": 6.384000, - "Standard_D96lds_v5": 5.760000, - "Standard_D96ls_v5": 5.088000, - "Standard_D96s_v5": 5.376000, - "Standard_DC16ads_cc_v5": 0.976000, - "Standard_DC16ads_v5": 0.976000, - "Standard_DC16as_cc_v5": 0.808000, - "Standard_DC16as_v5": 0.808000, - "Standard_DC16ds_v3": 2.128000, - "Standard_DC16s_v3": 1.792000, - "Standard_DC1ds_v3": 0.133000, - "Standard_DC1s_v2": 0.112000, - "Standard_DC1s_v3": 0.112000, - "Standard_DC24ds_v3": 3.192000, - "Standard_DC24s_v3": 2.688000, - "Standard_DC2ads_v5": 0.122000, - "Standard_DC2as_v5": 0.101000, - "Standard_DC2ds_v3": 0.266000, - "Standard_DC2s_v2": 0.224000, - "Standard_DC2s_v3": 0.224000, - "Standard_DC32ads_cc_v5": 1.952000, - "Standard_DC32ads_v5": 1.952000, - "Standard_DC32as_cc_v5": 1.616000, - "Standard_DC32as_v5": 1.616000, - "Standard_DC32ds_v3": 4.256000, - "Standard_DC32s_v3": 3.584000, - "Standard_DC48ads_cc_v5": 2.928000, - "Standard_DC48ads_v5": 2.928000, - "Standard_DC48as_cc_v5": 2.424000, - "Standard_DC48as_v5": 2.424000, - "Standard_DC48ds_v3": 6.384000, - "Standard_DC48s_v3": 5.376000, - "Standard_DC4ads_cc_v5": 0.244000, - "Standard_DC4ads_v5": 0.244000, - "Standard_DC4as_cc_v5": 0.202000, - "Standard_DC4as_v5": 0.202000, - "Standard_DC4ds_v3": 0.532000, - "Standard_DC4s_v2": 0.448000, - "Standard_DC4s_v3": 0.448000, - "Standard_DC64ads_cc_v5": 3.904000, - "Standard_DC64ads_v5": 3.904000, - "Standard_DC64as_cc_v5": 3.232000, - "Standard_DC64as_v5": 3.232000, - "Standard_DC8_v2": 0.896000, - "Standard_DC8ads_cc_v5": 0.488000, - "Standard_DC8ads_v5": 0.488000, - "Standard_DC8as_cc_v5": 0.404000, - "Standard_DC8as_v5": 0.404000, - "Standard_DC8ds_v3": 1.064000, - "Standard_DC8s_v3": 0.896000, - "Standard_DC96ads_cc_v5": 5.856000, - "Standard_DC96ads_v5": 5.856000, - "Standard_DC96as_cc_v5": 4.848000, - "Standard_DC96as_v5": 4.848000, - "Standard_DS1": 0.077000, - "Standard_DS11": 0.193000, - "Standard_DS11-1_v2": 0.185000, - "Standard_DS11_v2": 0.185000, - "Standard_DS11_v2_Promo": 0.185000, - "Standard_DS12": 0.386000, - "Standard_DS12-1_v2": 0.370000, - "Standard_DS12-2_v2": 0.370000, - "Standard_DS12_v2": 0.370000, - "Standard_DS12_v2_Promo": 0.370000, - "Standard_DS13": 0.771000, - "Standard_DS13-2_v2": 0.741000, - "Standard_DS13-4_v2": 0.741000, - "Standard_DS13_v2": 0.741000, - "Standard_DS13_v2_Promo": 0.741000, - "Standard_DS14": 1.542000, - "Standard_DS14-4_v2": 1.482000, - "Standard_DS14-8_v2": 1.482000, - "Standard_DS14_v2": 1.482000, - "Standard_DS14_v2_Promo": 1.482000, - "Standard_DS15_v2": 1.852000, - "Standard_DS15i_v2": 1.852000, - "Standard_DS1_v2": 0.070000, - "Standard_DS2": 0.154000, - "Standard_DS2_v2": 0.140000, - "Standard_DS2_v2_Promo": 0.140000, - "Standard_DS3": 0.308000, - "Standard_DS3_v2": 0.279000, - "Standard_DS3_v2_Promo": 0.279000, - "Standard_DS4": 0.616000, - "Standard_DS4_v2": 0.559000, - "Standard_DS4_v2_Promo": 0.559000, - "Standard_DS5_v2": 1.117000, - "Standard_DS5_v2_Promo": 1.117000, - "Standard_E104i_v5": 8.008000, - "Standard_E104id_v5": 9.266000, - "Standard_E104ids_v5": 9.266000, - "Standard_E104is_v5": 8.008000, - "Standard_E112iads_v5": 9.117000, - "Standard_E112ias_v5": 7.762000, - "Standard_E112ibds_v5": 11.642000, - "Standard_E112ibs_v5": 10.287000, - "Standard_E16-4ads_v5": 1.184000, - "Standard_E16-4as_v4": 1.120000, - "Standard_E16-4as_v5": 1.008000, - "Standard_E16-4ds_v4": 1.296000, - "Standard_E16-4ds_v5": 1.296000, - "Standard_E16-4s_v3": 1.120000, - "Standard_E16-4s_v4": 1.120000, - "Standard_E16-4s_v5": 1.120000, - "Standard_E16-8ads_v5": 1.184000, - "Standard_E16-8as_v4": 1.120000, - "Standard_E16-8as_v5": 1.008000, - "Standard_E16-8ds_v4": 1.296000, - "Standard_E16-8ds_v5": 1.296000, - "Standard_E16-8s_v3": 1.120000, - "Standard_E16-8s_v4": 1.120000, - "Standard_E16-8s_v5": 1.120000, - "Standard_E16_v3": 1.120000, - "Standard_E16_v4": 1.120000, - "Standard_E16_v5": 1.120000, - "Standard_E16a_v4": 1.120000, - "Standard_E16ads_v5": 1.184000, - "Standard_E16as_v4": 1.120000, - "Standard_E16as_v5": 1.008000, - "Standard_E16bds_v5": 1.512000, - "Standard_E16bs_v5": 1.336000, - "Standard_E16d_v4": 1.296000, - "Standard_E16d_v5": 1.296000, - "Standard_E16ds_v4": 1.296000, - "Standard_E16ds_v5": 1.296000, - "Standard_E16pds_v5": 1.040000, - "Standard_E16ps_v5": 0.896000, - "Standard_E16s_v3": 1.120000, - "Standard_E16s_v4": 1.120000, - "Standard_E16s_v5": 1.120000, - "Standard_E20_v3": 1.480000, - "Standard_E20_v4": 1.400000, - "Standard_E20_v5": 1.400000, - "Standard_E20a_v4": 1.400000, - "Standard_E20ads_v5": 1.480000, - "Standard_E20as_v4": 1.400000, - "Standard_E20as_v5": 1.260000, - "Standard_E20d_v4": 1.620000, - "Standard_E20d_v5": 1.620000, - "Standard_E20ds_v4": 1.620000, - "Standard_E20ds_v5": 1.620000, - "Standard_E20pds_v5": 1.300000, - "Standard_E20ps_v5": 1.120000, - "Standard_E20s_v3": 1.480000, - "Standard_E20s_v4": 1.400000, - "Standard_E20s_v5": 1.400000, - "Standard_E2_v3": 0.148000, - "Standard_E2_v4": 0.140000, - "Standard_E2_v5": 0.140000, - "Standard_E2a_v4": 0.140000, - "Standard_E2ads_v5": 0.148000, - "Standard_E2as_v4": 0.140000, - "Standard_E2as_v5": 0.126000, - "Standard_E2bds_v5": 0.189000, - "Standard_E2bs_v5": 0.167000, - "Standard_E2d_v4": 0.162000, - "Standard_E2d_v5": 0.162000, - "Standard_E2ds_v4": 0.162000, - "Standard_E2ds_v5": 0.162000, - "Standard_E2pds_v5": 0.130000, - "Standard_E2ps_v5": 0.112000, - "Standard_E2s_v3": 0.148000, - "Standard_E2s_v4": 0.140000, - "Standard_E2s_v5": 0.140000, - "Standard_E32-16ads_v5": 2.368000, - "Standard_E32-16as_v4": 2.240000, - "Standard_E32-16as_v5": 2.016000, - "Standard_E32-16ds_v4": 2.592000, - "Standard_E32-16ds_v5": 2.592000, - "Standard_E32-16s_v3": 2.240000, - "Standard_E32-16s_v4": 2.240000, - "Standard_E32-16s_v5": 2.240000, - "Standard_E32-8ads_v5": 2.368000, - "Standard_E32-8as_v4": 2.240000, - "Standard_E32-8as_v5": 2.016000, - "Standard_E32-8ds_v4": 2.592000, - "Standard_E32-8ds_v5": 2.592000, - "Standard_E32-8s_v3": 2.240000, - "Standard_E32-8s_v4": 2.240000, - "Standard_E32-8s_v5": 2.240000, - "Standard_E32_v3": 2.240000, - "Standard_E32_v4": 2.240000, - "Standard_E32_v5": 2.240000, - "Standard_E32a_v4": 2.240000, - "Standard_E32ads_v5": 2.368000, - "Standard_E32as_v4": 2.240000, - "Standard_E32as_v5": 2.016000, - "Standard_E32bds_v5": 3.024000, - "Standard_E32bs_v5": 2.672000, - "Standard_E32d_v4": 2.592000, - "Standard_E32d_v5": 2.592000, - "Standard_E32ds_v4": 2.592000, - "Standard_E32ds_v5": 2.592000, - "Standard_E32pds_v5": 2.080000, - "Standard_E32ps_v5": 1.792000, - "Standard_E32s_v3": 2.240000, - "Standard_E32s_v4": 2.240000, - "Standard_E32s_v5": 2.240000, - "Standard_E4-2ads_v5": 0.296000, - "Standard_E4-2as_v4": 0.280000, - "Standard_E4-2as_v5": 0.252000, - "Standard_E4-2ds_v4": 0.324000, - "Standard_E4-2ds_v5": 0.324000, - "Standard_E4-2s_v3": 0.296000, - "Standard_E4-2s_v4": 0.280000, - "Standard_E4-2s_v5": 0.280000, - "Standard_E48_v3": 3.360000, - "Standard_E48_v4": 3.360000, - "Standard_E48_v5": 3.360000, - "Standard_E48a_v4": 3.360000, - "Standard_E48ads_v5": 3.552000, - "Standard_E48as_v4": 3.360000, - "Standard_E48as_v5": 3.024000, - "Standard_E48bds_v5": 4.536000, - "Standard_E48bs_v5": 4.008000, - "Standard_E48d_v4": 3.888000, - "Standard_E48d_v5": 3.888000, - "Standard_E48ds_v4": 3.888000, - "Standard_E48ds_v5": 3.888000, - "Standard_E48s_v3": 3.360000, - "Standard_E48s_v4": 3.360000, - "Standard_E48s_v5": 3.360000, - "Standard_E4_v3": 0.296000, - "Standard_E4_v4": 0.280000, - "Standard_E4_v5": 0.280000, - "Standard_E4a_v4": 0.280000, - "Standard_E4ads_v5": 0.296000, - "Standard_E4as_v4": 0.280000, - "Standard_E4as_v5": 0.252000, - "Standard_E4bds_v5": 0.378000, - "Standard_E4bs_v5": 0.334000, - "Standard_E4d_v4": 0.324000, - "Standard_E4d_v5": 0.324000, - "Standard_E4ds_v4": 0.324000, - "Standard_E4ds_v5": 0.324000, - "Standard_E4pds_v5": 0.260000, - "Standard_E4ps_v5": 0.224000, - "Standard_E4s_v3": 0.296000, - "Standard_E4s_v4": 0.280000, - "Standard_E4s_v5": 0.280000, - "Standard_E64-16ads_v5": 4.736000, - "Standard_E64-16as_v4": 4.480000, - "Standard_E64-16as_v5": 4.032000, - "Standard_E64-16ds_v4": 5.184000, - "Standard_E64-16ds_v5": 5.184000, - "Standard_E64-16s_v3": 4.032000, - "Standard_E64-16s_v4": 4.480000, - "Standard_E64-16s_v5": 4.480000, - "Standard_E64-32ads_v5": 4.736000, - "Standard_E64-32as_v4": 4.480000, - "Standard_E64-32as_v5": 4.032000, - "Standard_E64-32ds_v4": 5.184000, - "Standard_E64-32ds_v5": 5.184000, - "Standard_E64-32s_v3": 4.032000, - "Standard_E64-32s_v4": 4.480000, - "Standard_E64-32s_v5": 4.480000, - "Standard_E64_v3": 4.032000, - "Standard_E64_v4": 4.480000, - "Standard_E64_v5": 4.480000, - "Standard_E64a_v4": 4.480000, - "Standard_E64ads_v5": 4.736000, - "Standard_E64as_v4": 4.480000, - "Standard_E64as_v5": 4.032000, - "Standard_E64bds_v5": 6.048000, - "Standard_E64bs_v5": 5.344000, - "Standard_E64d_v4": 5.184000, - "Standard_E64d_v5": 5.184000, - "Standard_E64ds_v4": 5.184000, - "Standard_E64ds_v5": 5.184000, - "Standard_E64i_v3": 4.032000, - "Standard_E64is_v3": 4.032000, - "Standard_E64s_v3": 4.032000, - "Standard_E64s_v4": 4.480000, - "Standard_E64s_v5": 4.480000, - "Standard_E8-2ads_v5": 0.592000, - "Standard_E8-2as_v4": 0.560000, - "Standard_E8-2as_v5": 0.504000, - "Standard_E8-2ds_v4": 0.648000, - "Standard_E8-2ds_v5": 0.648000, - "Standard_E8-2s_v3": 0.560000, - "Standard_E8-2s_v4": 0.560000, - "Standard_E8-2s_v5": 0.560000, - "Standard_E8-4ads_v5": 0.592000, - "Standard_E8-4as_v4": 0.560000, - "Standard_E8-4as_v5": 0.504000, - "Standard_E8-4ds_v4": 0.648000, - "Standard_E8-4ds_v5": 0.648000, - "Standard_E8-4s_v3": 0.560000, - "Standard_E8-4s_v4": 0.560000, - "Standard_E8-4s_v5": 0.560000, - "Standard_E80ids_v4": 6.480000, - "Standard_E80is_v4": 5.599000, - "Standard_E8_v3": 0.560000, - "Standard_E8_v4": 0.560000, - "Standard_E8_v5": 0.560000, - "Standard_E8a_v4": 0.560000, - "Standard_E8ads_v5": 0.592000, - "Standard_E8as_v4": 0.560000, - "Standard_E8as_v5": 0.504000, - "Standard_E8bds_v5": 0.756000, - "Standard_E8bs_v5": 0.668000, - "Standard_E8d_v4": 0.648000, - "Standard_E8d_v5": 0.648000, - "Standard_E8ds_v4": 0.648000, - "Standard_E8ds_v5": 0.648000, - "Standard_E8pds_v5": 0.520000, - "Standard_E8ps_v5": 0.448000, - "Standard_E8s_v3": 0.560000, - "Standard_E8s_v4": 0.560000, - "Standard_E8s_v5": 0.560000, - "Standard_E96-24ads_v5": 7.104000, - "Standard_E96-24as_v4": 6.720000, - "Standard_E96-24as_v5": 6.048000, - "Standard_E96-24ds_v5": 7.776000, - "Standard_E96-24s_v5": 6.720000, - "Standard_E96-48ads_v5": 7.104000, - "Standard_E96-48as_v4": 6.720000, - "Standard_E96-48as_v5": 6.048000, - "Standard_E96-48ds_v5": 7.776000, - "Standard_E96-48s_v5": 6.720000, - "Standard_E96_v5": 6.720000, - "Standard_E96a_v4": 6.720000, - "Standard_E96ads_v5": 7.104000, - "Standard_E96as_v4": 6.720000, - "Standard_E96as_v5": 6.048000, - "Standard_E96bds_v5": 9.072000, - "Standard_E96bs_v5": 8.016000, - "Standard_E96d_v5": 7.776000, - "Standard_E96ds_v5": 7.776000, - "Standard_E96iads_v5": 7.814000, - "Standard_E96ias_v5": 6.653000, - "Standard_E96s_v5": 6.720000, - "Standard_EC16ads_cc_v5": 1.184000, - "Standard_EC16ads_v5": 1.184000, - "Standard_EC16as_cc_v5": 1.008000, - "Standard_EC16as_v5": 1.008000, - "Standard_EC20ads_cc_v5": 1.480000, - "Standard_EC20ads_v5": 1.480000, - "Standard_EC20as_cc_v5": 1.260000, - "Standard_EC20as_v5": 1.260000, - "Standard_EC2ads_v5": 0.148000, - "Standard_EC2as_v5": 0.126000, - "Standard_EC32ads_cc_v5": 2.368000, - "Standard_EC32ads_v5": 2.368000, - "Standard_EC32as_cc_v5": 2.016000, - "Standard_EC32as_v5": 2.016000, - "Standard_EC48ads_cc_v5": 3.552000, - "Standard_EC48ads_v5": 3.552000, - "Standard_EC48as_cc_v5": 3.024000, - "Standard_EC48as_v5": 3.024000, - "Standard_EC4ads_cc_v5": 0.296000, - "Standard_EC4ads_v5": 0.296000, - "Standard_EC4as_cc_v5": 0.252000, - "Standard_EC4as_v5": 0.252000, - "Standard_EC64ads_cc_v5": 4.736000, - "Standard_EC64ads_v5": 4.736000, - "Standard_EC64as_cc_v5": 4.032000, - "Standard_EC64as_v5": 4.032000, - "Standard_EC8ads_cc_v5": 0.592000, - "Standard_EC8ads_v5": 0.592000, - "Standard_EC8as_cc_v5": 0.504000, - "Standard_EC8as_v5": 0.504000, - "Standard_EC96ads_cc_v5": 7.104000, - "Standard_EC96ads_v5": 7.104000, - "Standard_EC96as_cc_v5": 6.048000, - "Standard_EC96as_v5": 6.048000, - "Standard_EC96iads_v5": 7.814000, - "Standard_EC96ias_v5": 6.653000, - "Standard_F1": 0.062000, - "Standard_F16": 0.996000, - "Standard_F16s": 0.996000, - "Standard_F16s_v2": 0.848000, - "Standard_F1s": 0.062000, - "Standard_F2": 0.124000, - "Standard_F2s": 0.124000, - "Standard_F2s_v2": 0.106000, - "Standard_F32s_v2": 1.696000, - "Standard_F4": 0.249000, - "Standard_F48s_v2": 2.544000, - "Standard_F4s": 0.249000, - "Standard_F4s_v2": 0.212000, - "Standard_F64s_v2": 3.392000, - "Standard_F72s_v2": 3.816000, - "Standard_F8": 0.498000, - "Standard_F8s": 0.498000, - "Standard_F8s_v2": 0.424000, - "Standard_G1": 0.610000, - "Standard_G2": 1.220000, - "Standard_G3": 2.440000, - "Standard_G4": 4.880000, - "Standard_G5": 8.690000, - "Standard_GS1": 0.610000, - "Standard_GS2": 1.220000, - "Standard_GS3": 2.440000, - "Standard_GS4": 4.880000, - "Standard_GS4-4": 4.880000, - "Standard_GS4-8": 4.880000, - "Standard_GS5": 8.690000, - "Standard_GS5-16": 8.690000, - "Standard_GS5-8": 8.690000, - "Standard_H16": 1.941000, - "Standard_H16m": 2.601000, - "Standard_H16mr": 2.861000, - "Standard_H16r": 2.136000, - "Standard_H8": 0.971000, - "Standard_H8m": 1.301000, - "Standard_L16as_v3": 1.376000, - "Standard_L16s": 1.376000, - "Standard_L16s_v2": 1.376000, - "Standard_L16s_v3": 1.536000, - "Standard_L32as_v3": 2.752000, - "Standard_L32s": 2.752000, - "Standard_L32s_v2": 2.752000, - "Standard_L32s_v3": 3.072000, - "Standard_L48as_v3": 4.128000, - "Standard_L48s_v2": 4.128000, - "Standard_L48s_v3": 4.608000, - "Standard_L4s": 0.344000, - "Standard_L64as_v3": 5.504000, - "Standard_L64s_v2": 5.504000, - "Standard_L64s_v3": 6.144000, - "Standard_L80as_v3": 6.880000, - "Standard_L80s_v2": 6.880000, - "Standard_L80s_v3": 7.680000, - "Standard_L88is_v2": 7.568000, - "Standard_L8as_v3": 0.688000, - "Standard_L8s": 0.688000, - "Standard_L8s_v2": 0.688000, - "Standard_L8s_v3": 0.768000, - "Standard_L96s_v2": 8.256000, - "Standard_M128": 17.339000, - "Standard_M128-32ms": 34.694000, - "Standard_M128-64ms": 34.694000, - "Standard_M128dms_v2": 34.697000, - "Standard_M128ds_v2": 17.342000, - "Standard_M128m": 34.694000, - "Standard_M128ms": 34.694000, - "Standard_M128ms_v2": 34.150000, - "Standard_M128s": 17.339000, - "Standard_M128s_v2": 16.795000, - "Standard_M16-4ms": 3.995000, - "Standard_M16-8ms": 3.995000, - "Standard_M16ms": 3.995000, - "Standard_M16s": 3.103000, - "Standard_M192idms_v2": 41.683000, - "Standard_M192ids_v2": 20.841000, - "Standard_M192ims_v2": 41.136000, - "Standard_M192is_v2": 20.294000, - "Standard_M208-104ms_v2": 58.006000, - "Standard_M208-104s_v2": 29.003000, - "Standard_M208-52ms_v2": 58.006000, - "Standard_M208-52s_v2": 29.003000, - "Standard_M208ms_v2": 58.006000, - "Standard_M208s_v2": 29.003000, - "Standard_M32-16ms": 7.990000, - "Standard_M32-8ms": 7.990000, - "Standard_M32dms_v2": 7.990000, - "Standard_M32ls": 3.201000, - "Standard_M32ms": 7.990000, - "Standard_M32ms_v2": 7.853000, - "Standard_M32s": 6.206000, - "Standard_M32ts": 3.016000, - "Standard_M416-104ms_v2": 128.900000, - "Standard_M416-104s_v2": 64.454000, - "Standard_M416-208ms_v2": 128.900000, - "Standard_M416-208s_v2": 64.454000, - "Standard_M416is_v2": 64.454000, - "Standard_M416ms_v2": 128.900000, - "Standard_M416s_8_v2": 66.110000, - "Standard_M416s_v2": 64.454000, - "Standard_M64": 8.670000, - "Standard_M64-16ms": 17.347000, - "Standard_M64-32ms": 17.347000, - "Standard_M64dms_v2": 13.442000, - "Standard_M64ds_v2": 8.670000, - "Standard_M64ls": 6.403000, - "Standard_M64m": 17.347000, - "Standard_M64ms": 17.347000, - "Standard_M64ms_v2": 13.168000, - "Standard_M64s": 8.670000, - "Standard_M64s_v2": 8.396000, - "Standard_M8-2ms": 1.997000, - "Standard_M8-4ms": 1.997000, - "Standard_M8ms": 1.997000, - "Standard_NC12s_v3": 7.956000, - "Standard_NC16as_T4_v3": 1.445000, - "Standard_NC24ads_A100_v4": 4.775000, - "Standard_NC24rs_v3": 17.503000, - "Standard_NC24s_v3": 15.912000, - "Standard_NC48ads_A100_v4": 9.550000, - "Standard_NC4as_T4_v3": 0.631000, - "Standard_NC64as_T4_v3": 5.222000, - "Standard_NC6s_v3": 3.978000, - "Standard_NC8as_T4_v3": 0.902000, - "Standard_NC96ads_A100_v4": 19.100000, - "Standard_ND96ams_A100_v4": 42.601000, - "Standard_ND96amsr_A100_v4": 42.601000, - "Standard_NV12ads_A10_v5": 1.180000, - "Standard_NV12s_v2": 1.534000, - "Standard_NV12s_v3": 1.140000, - "Standard_NV18ads_A10_v5": 2.080000, - "Standard_NV24s_v2": 3.069000, - "Standard_NV24s_v3": 2.280000, - "Standard_NV36adms_A10_v5": 5.876000, - "Standard_NV36ads_A10_v5": 4.160000, - "Standard_NV48s_v3": 4.560000, - "Standard_NV6ads_A10_v5": 0.590000, - "Standard_NV6s_v2": 0.767000, - "Standard_NV72ads_A10_v5": 8.476000, - } - // westus2 - initialOnDemandPrices["westus2"] = map[string]float64{ - "Basic_A0": 0.018000, - "Basic_A1": 0.023000, - "Basic_A2": 0.068000, - "Basic_A3": 0.176000, - "Basic_A4": 0.352000, - "DCdsv3 Type1": 5.966000, - "DCsv2 Type 1": 0.845000, - "DCsv3 Type1": 5.069000, - "Dadsv5_Type1": 6.345000, - "Dasv4_Type1": 5.069000, - "Dasv4_Type2": 5.280000, - "Dasv5_Type1": 5.298000, - "Ddsv4_Type 1": 3.978000, - "Ddsv4_Type2": 4.723000, - "Ddsv5_Type1": 5.966000, - "Dsv3_Type3": 4.225000, - "Dsv3_Type4": 5.281000, - "Dsv4_Type1": 4.224000, - "Dsv4_Type2": 5.069000, - "Dsv5_Type1": 5.280000, - "Eadsv5_Type1": 6.917000, - "Easv4_Type1": 6.653000, - "Easv4_Type2": 6.653000, - "Easv5_Type1": 5.966000, - "Ebdsv5-Type1": 5.878000, - "Ebsv5-Type1": 5.245000, - "Edsv4_Type 1": 5.069000, - "Edsv4_Type2": 6.019000, - "Edsv5_Type1": 7.603000, - "Esv3_Type3": 4.297000, - "Esv3_Type4": 5.822000, - "Esv4_Type1": 4.435000, - "Esv4_Type2": 5.821000, - "Esv5_Type1": 6.653000, - "FXmds Type1": 4.910000, - "Fsv2 Type3": 3.927000, - "Fsv2_Type2": 3.366000, - "Fsv2_Type4": 4.468000, - "Lasv3_Type1": 6.864000, - "Lsv2_Type1": 6.864000, - "Lsv3_Type1": 7.678000, - "Mdsmv2MedMem _Type1": 29.359000, - "Mdsv2MedMem_Type1": 14.674000, - "Ms_Type1": 14.669000, - "Msm_Type1": 29.363000, - "Msmv2MedMem Type1": 28.896000, - "Msmv2_Type1": 109.060000, - "Msv2MedMem Type1": 14.211000, - "Msv2_Type1": 54.538000, - "NDasrA100v4_Type1": 29.917000, - "NVasv4_Type1": 7.176000, - "NVsv3_Type1": 5.016000, - "Standard_A0": 0.020000, - "Standard_A1": 0.051000, - "Standard_A1_v2": 0.036000, - "Standard_A2": 0.101000, - "Standard_A2_v2": 0.076000, - "Standard_A2m_v2": 0.099000, - "Standard_A3": 0.202000, - "Standard_A4": 0.405000, - "Standard_A4_v2": 0.159000, - "Standard_A4m_v2": 0.208000, - "Standard_A5": 0.220000, - "Standard_A6": 0.440000, - "Standard_A7": 0.880000, - "Standard_A8_v2": 0.333000, - "Standard_A8m_v2": 0.437000, - "Standard_B12ms": 0.499000, - "Standard_B16als_v2": 0.533000, - "Standard_B16as_v2": 0.675000, - "Standard_B16ls_v2": 0.663000, - "Standard_B16ms": 0.666000, - "Standard_B16pls_v2": 0.476000, - "Standard_B16ps_v2": 0.538000, - "Standard_B16s_v2": 0.739000, - "Standard_B1ls": 0.005200, - "Standard_B1ms": 0.020700, - "Standard_B1s": 0.010400, - "Standard_B20ms": 0.832000, - "Standard_B2als_v2": 0.046800, - "Standard_B2as_v2": 0.075200, - "Standard_B2ats_v2": 0.009400, - "Standard_B2ls_v2": 0.050800, - "Standard_B2ms": 0.083200, - "Standard_B2pls_v2": 0.033600, - "Standard_B2ps_v2": 0.067200, - "Standard_B2pts_v2": 0.008400, - "Standard_B2s": 0.041600, - "Standard_B2s_v2": 0.092400, - "Standard_B2ts_v2": 0.019600, - "Standard_B32als_v2": 1.213000, - "Standard_B32as_v2": 1.203000, - "Standard_B32ls_v2": 1.179000, - "Standard_B32s_v2": 1.478000, - "Standard_B4als_v2": 0.152000, - "Standard_B4as_v2": 0.169000, - "Standard_B4ls_v2": 0.147000, - "Standard_B4ms": 0.166000, - "Standard_B4pls_v2": 0.137000, - "Standard_B4ps_v2": 0.134000, - "Standard_B4s_v2": 0.185000, - "Standard_B8als_v2": 0.266000, - "Standard_B8as_v2": 0.301000, - "Standard_B8ls_v2": 0.332000, - "Standard_B8ms": 0.333000, - "Standard_B8pls_v2": 0.238000, - "Standard_B8ps_v2": 0.269000, - "Standard_B8s_v2": 0.370000, - "Standard_D11_v2": 0.149000, - "Standard_D11_v2_Promo": 0.149000, - "Standard_D12_v2": 0.299000, - "Standard_D12_v2_Promo": 0.299000, - "Standard_D13_v2": 0.598000, - "Standard_D13_v2_Promo": 0.598000, - "Standard_D14_v2": 1.196000, - "Standard_D14_v2_Promo": 1.196000, - "Standard_D15_v2": 1.495000, - "Standard_D15i_v2": 1.495000, - "Standard_D16_v3": 0.768000, - "Standard_D16_v4": 0.768000, - "Standard_D16_v5": 0.768000, - "Standard_D16a_v4": 0.768000, - "Standard_D16ads_v5": 0.824000, - "Standard_D16as_v4": 0.768000, - "Standard_D16as_v5": 0.688000, - "Standard_D16d_v4": 0.904000, - "Standard_D16d_v5": 0.904000, - "Standard_D16ds_v4": 0.904000, - "Standard_D16ds_v5": 0.904000, - "Standard_D16lds_v5": 0.768000, - "Standard_D16ls_v5": 0.680000, - "Standard_D16pds_v5": 0.723000, - "Standard_D16plds_v5": 0.614000, - "Standard_D16pls_v5": 0.544000, - "Standard_D16ps_v5": 0.616000, - "Standard_D16s_v3": 0.768000, - "Standard_D16s_v4": 0.768000, - "Standard_D16s_v5": 0.768000, - "Standard_D1_v2": 0.057000, - "Standard_D2_v2": 0.114000, - "Standard_D2_v2_Promo": 0.114000, - "Standard_D2_v3": 0.096000, - "Standard_D2_v4": 0.096000, - "Standard_D2_v5": 0.096000, - "Standard_D2a_v4": 0.096000, - "Standard_D2ads_v5": 0.103000, - "Standard_D2as_v4": 0.096000, - "Standard_D2as_v5": 0.086000, - "Standard_D2d_v4": 0.113000, - "Standard_D2d_v5": 0.113000, - "Standard_D2ds_v4": 0.113000, - "Standard_D2ds_v5": 0.113000, - "Standard_D2lds_v5": 0.096000, - "Standard_D2ls_v5": 0.085000, - "Standard_D2pds_v5": 0.090400, - "Standard_D2plds_v5": 0.076800, - "Standard_D2pls_v5": 0.068000, - "Standard_D2ps_v5": 0.077000, - "Standard_D2s_v3": 0.096000, - "Standard_D2s_v4": 0.096000, - "Standard_D2s_v5": 0.096000, - "Standard_D32-16s_v3": 1.536000, - "Standard_D32-8s_v3": 1.536000, - "Standard_D32_v3": 1.536000, - "Standard_D32_v4": 1.536000, - "Standard_D32_v5": 1.536000, - "Standard_D32a_v4": 1.536000, - "Standard_D32ads_v5": 1.648000, - "Standard_D32as_v4": 1.536000, - "Standard_D32as_v5": 1.376000, - "Standard_D32d_v4": 1.808000, - "Standard_D32d_v5": 1.808000, - "Standard_D32ds_v4": 1.808000, - "Standard_D32ds_v5": 1.808000, - "Standard_D32lds_v5": 1.536000, - "Standard_D32ls_v5": 1.360000, - "Standard_D32pds_v5": 1.446000, - "Standard_D32plds_v5": 1.229000, - "Standard_D32pls_v5": 1.088000, - "Standard_D32ps_v5": 1.232000, - "Standard_D32s_v3": 1.536000, - "Standard_D32s_v4": 1.536000, - "Standard_D32s_v5": 1.536000, - "Standard_D3_v2": 0.229000, - "Standard_D3_v2_Promo": 0.229000, - "Standard_D48_v3": 2.304000, - "Standard_D48_v4": 2.304000, - "Standard_D48_v5": 2.304000, - "Standard_D48a_v4": 2.304000, - "Standard_D48ads_v5": 2.472000, - "Standard_D48as_v4": 2.304000, - "Standard_D48as_v5": 2.064000, - "Standard_D48d_v4": 2.712000, - "Standard_D48d_v5": 2.712000, - "Standard_D48ds_v4": 2.712000, - "Standard_D48ds_v5": 2.712000, - "Standard_D48lds_v5": 2.304000, - "Standard_D48ls_v5": 2.040000, - "Standard_D48pds_v5": 2.170000, - "Standard_D48plds_v5": 1.843000, - "Standard_D48pls_v5": 1.632000, - "Standard_D48ps_v5": 1.848000, - "Standard_D48s_v3": 2.304000, - "Standard_D48s_v4": 2.304000, - "Standard_D48s_v5": 2.304000, - "Standard_D4_v2": 0.458000, - "Standard_D4_v2_Promo": 0.458000, - "Standard_D4_v3": 0.192000, - "Standard_D4_v4": 0.192000, - "Standard_D4_v5": 0.192000, - "Standard_D4a_v4": 0.192000, - "Standard_D4ads_v5": 0.206000, - "Standard_D4as_v4": 0.192000, - "Standard_D4as_v5": 0.172000, - "Standard_D4d_v4": 0.226000, - "Standard_D4d_v5": 0.226000, - "Standard_D4ds_v4": 0.226000, - "Standard_D4ds_v5": 0.226000, - "Standard_D4lds_v5": 0.192000, - "Standard_D4ls_v5": 0.170000, - "Standard_D4pds_v5": 0.181000, - "Standard_D4plds_v5": 0.154000, - "Standard_D4pls_v5": 0.136000, - "Standard_D4ps_v5": 0.154000, - "Standard_D4s_v3": 0.192000, - "Standard_D4s_v4": 0.192000, - "Standard_D4s_v5": 0.192000, - "Standard_D5_v2": 0.916000, - "Standard_D5_v2_Promo": 0.916000, - "Standard_D64-16s_v3": 3.072000, - "Standard_D64-32s_v3": 3.072000, - "Standard_D64_v3": 3.072000, - "Standard_D64_v4": 3.072000, - "Standard_D64_v5": 3.072000, - "Standard_D64a_v4": 3.072000, - "Standard_D64ads_v5": 3.296000, - "Standard_D64as_v4": 3.072000, - "Standard_D64as_v5": 2.752000, - "Standard_D64d_v4": 3.616000, - "Standard_D64d_v5": 3.616000, - "Standard_D64ds_v4": 3.616000, - "Standard_D64ds_v5": 3.616000, - "Standard_D64lds_v5": 3.072000, - "Standard_D64ls_v5": 2.720000, - "Standard_D64pds_v5": 2.893000, - "Standard_D64plds_v5": 2.458000, - "Standard_D64pls_v5": 2.176000, - "Standard_D64ps_v5": 2.464000, - "Standard_D64s_v3": 3.072000, - "Standard_D64s_v4": 3.072000, - "Standard_D64s_v5": 3.072000, - "Standard_D8_v3": 0.384000, - "Standard_D8_v4": 0.384000, - "Standard_D8_v5": 0.384000, - "Standard_D8a_v4": 0.384000, - "Standard_D8ads_v5": 0.412000, - "Standard_D8as_v4": 0.384000, - "Standard_D8as_v5": 0.344000, - "Standard_D8d_v4": 0.452000, - "Standard_D8d_v5": 0.452000, - "Standard_D8ds_v4": 0.452000, - "Standard_D8ds_v5": 0.452000, - "Standard_D8lds_v5": 0.384000, - "Standard_D8ls_v5": 0.340000, - "Standard_D8pds_v5": 0.362000, - "Standard_D8plds_v5": 0.307000, - "Standard_D8pls_v5": 0.272000, - "Standard_D8ps_v5": 0.308000, - "Standard_D8s_v3": 0.384000, - "Standard_D8s_v4": 0.384000, - "Standard_D8s_v5": 0.384000, - "Standard_D96_v5": 4.608000, - "Standard_D96a_v4": 4.608000, - "Standard_D96ads_v5": 4.944000, - "Standard_D96as_v4": 4.608000, - "Standard_D96as_v5": 4.128000, - "Standard_D96d_v5": 5.424000, - "Standard_D96ds_v5": 5.424000, - "Standard_D96lds_v5": 4.608000, - "Standard_D96ls_v5": 4.080000, - "Standard_D96s_v5": 4.608000, - "Standard_DC16ds_v3": 1.808000, - "Standard_DC16s_v3": 1.536000, - "Standard_DC1ds_v3": 0.113000, - "Standard_DC1s_v2": 0.096000, - "Standard_DC1s_v3": 0.096000, - "Standard_DC24ds_v3": 2.712000, - "Standard_DC24s_v3": 2.304000, - "Standard_DC2ds_v3": 0.226000, - "Standard_DC2s_v2": 0.192000, - "Standard_DC2s_v3": 0.192000, - "Standard_DC32ds_v3": 3.616000, - "Standard_DC32s_v3": 3.072000, - "Standard_DC48ds_v3": 5.424000, - "Standard_DC48s_v3": 4.608000, - "Standard_DC4ds_v3": 0.452000, - "Standard_DC4s_v2": 0.384000, - "Standard_DC4s_v3": 0.384000, - "Standard_DC8_v2": 0.768000, - "Standard_DC8ds_v3": 0.904000, - "Standard_DC8s_v3": 0.768000, - "Standard_DS11-1_v2": 0.149000, - "Standard_DS11_v2": 0.149000, - "Standard_DS11_v2_Promo": 0.149000, - "Standard_DS12-1_v2": 0.299000, - "Standard_DS12-2_v2": 0.299000, - "Standard_DS12_v2": 0.299000, - "Standard_DS12_v2_Promo": 0.299000, - "Standard_DS13-2_v2": 0.598000, - "Standard_DS13-4_v2": 0.598000, - "Standard_DS13_v2": 0.598000, - "Standard_DS13_v2_Promo": 0.598000, - "Standard_DS14-4_v2": 1.196000, - "Standard_DS14-8_v2": 1.196000, - "Standard_DS14_v2": 1.196000, - "Standard_DS14_v2_Promo": 1.196000, - "Standard_DS15_v2": 1.495000, - "Standard_DS15i_v2": 1.495000, - "Standard_DS1_v2": 0.057000, - "Standard_DS2_v2": 0.114000, - "Standard_DS2_v2_Promo": 0.114000, - "Standard_DS3_v2": 0.229000, - "Standard_DS3_v2_Promo": 0.229000, - "Standard_DS4_v2": 0.458000, - "Standard_DS4_v2_Promo": 0.458000, - "Standard_DS5_v2": 0.916000, - "Standard_DS5_v2_Promo": 0.916000, - "Standard_E104i_v5": 7.207000, - "Standard_E104id_v5": 8.237000, - "Standard_E104ids_v5": 8.237000, - "Standard_E104is_v5": 7.207000, - "Standard_E112iads_v5": 8.070000, - "Standard_E112ias_v5": 6.961000, - "Standard_E112ibds_v5": 10.287000, - "Standard_E112ibs_v5": 9.178000, - "Standard_E16-4ads_v5": 1.048000, - "Standard_E16-4as_v4": 1.008000, - "Standard_E16-4as_v5": 0.904000, - "Standard_E16-4ds_v4": 1.152000, - "Standard_E16-4ds_v5": 1.152000, - "Standard_E16-4s_v3": 1.008000, - "Standard_E16-4s_v4": 1.008000, - "Standard_E16-4s_v5": 1.008000, - "Standard_E16-8ads_v5": 1.048000, - "Standard_E16-8as_v4": 1.008000, - "Standard_E16-8as_v5": 0.904000, - "Standard_E16-8ds_v4": 1.152000, - "Standard_E16-8ds_v5": 1.152000, - "Standard_E16-8s_v3": 1.008000, - "Standard_E16-8s_v4": 1.008000, - "Standard_E16-8s_v5": 1.008000, - "Standard_E16_v3": 1.008000, - "Standard_E16_v4": 1.008000, - "Standard_E16_v5": 1.008000, - "Standard_E16a_v4": 1.008000, - "Standard_E16ads_v5": 1.048000, - "Standard_E16as_v4": 1.008000, - "Standard_E16as_v5": 0.904000, - "Standard_E16bds_v5": 1.336000, - "Standard_E16bs_v5": 1.192000, - "Standard_E16d_v4": 1.152000, - "Standard_E16d_v5": 1.152000, - "Standard_E16ds_v4": 1.152000, - "Standard_E16ds_v5": 1.152000, - "Standard_E16pds_v5": 0.922000, - "Standard_E16ps_v5": 0.806000, - "Standard_E16s_v3": 1.008000, - "Standard_E16s_v4": 1.008000, - "Standard_E16s_v5": 1.008000, - "Standard_E20_v3": 1.260000, - "Standard_E20_v4": 1.260000, - "Standard_E20_v5": 1.260000, - "Standard_E20a_v4": 1.260000, - "Standard_E20ads_v5": 1.310000, - "Standard_E20as_v4": 1.260000, - "Standard_E20as_v5": 1.130000, - "Standard_E20d_v4": 1.440000, - "Standard_E20d_v5": 1.440000, - "Standard_E20ds_v4": 1.440000, - "Standard_E20ds_v5": 1.440000, - "Standard_E20pds_v5": 1.152000, - "Standard_E20ps_v5": 1.008000, - "Standard_E20s_v3": 1.260000, - "Standard_E20s_v4": 1.260000, - "Standard_E20s_v5": 1.260000, - "Standard_E2_v3": 0.126000, - "Standard_E2_v4": 0.126000, - "Standard_E2_v5": 0.126000, - "Standard_E2a_v4": 0.126000, - "Standard_E2ads_v5": 0.131000, - "Standard_E2as_v4": 0.126000, - "Standard_E2as_v5": 0.113000, - "Standard_E2bds_v5": 0.167000, - "Standard_E2bs_v5": 0.149000, - "Standard_E2d_v4": 0.144000, - "Standard_E2d_v5": 0.144000, - "Standard_E2ds_v4": 0.144000, - "Standard_E2ds_v5": 0.144000, - "Standard_E2pds_v5": 0.115000, - "Standard_E2ps_v5": 0.101000, - "Standard_E2s_v3": 0.126000, - "Standard_E2s_v4": 0.126000, - "Standard_E2s_v5": 0.126000, - "Standard_E32-16ads_v5": 2.096000, - "Standard_E32-16as_v4": 2.016000, - "Standard_E32-16as_v5": 1.808000, - "Standard_E32-16ds_v4": 2.304000, - "Standard_E32-16ds_v5": 2.304000, - "Standard_E32-16s_v3": 2.016000, - "Standard_E32-16s_v4": 2.016000, - "Standard_E32-16s_v5": 2.016000, - "Standard_E32-8ads_v5": 2.096000, - "Standard_E32-8as_v4": 2.016000, - "Standard_E32-8as_v5": 1.808000, - "Standard_E32-8ds_v4": 2.304000, - "Standard_E32-8ds_v5": 2.304000, - "Standard_E32-8s_v3": 2.016000, - "Standard_E32-8s_v4": 2.016000, - "Standard_E32-8s_v5": 2.016000, - "Standard_E32_v3": 2.016000, - "Standard_E32_v4": 2.016000, - "Standard_E32_v5": 2.016000, - "Standard_E32a_v4": 2.016000, - "Standard_E32ads_v5": 2.096000, - "Standard_E32as_v4": 2.016000, - "Standard_E32as_v5": 1.808000, - "Standard_E32bds_v5": 2.672000, - "Standard_E32bs_v5": 2.384000, - "Standard_E32d_v4": 2.304000, - "Standard_E32d_v5": 2.304000, - "Standard_E32ds_v4": 2.304000, - "Standard_E32ds_v5": 2.304000, - "Standard_E32pds_v5": 1.843000, - "Standard_E32ps_v5": 1.613000, - "Standard_E32s_v3": 2.016000, - "Standard_E32s_v4": 2.016000, - "Standard_E32s_v5": 2.016000, - "Standard_E4-2ads_v5": 0.262000, - "Standard_E4-2as_v4": 0.252000, - "Standard_E4-2as_v5": 0.226000, - "Standard_E4-2ds_v4": 0.288000, - "Standard_E4-2ds_v5": 0.288000, - "Standard_E4-2s_v3": 0.252000, - "Standard_E4-2s_v4": 0.252000, - "Standard_E4-2s_v5": 0.252000, - "Standard_E48_v3": 3.024000, - "Standard_E48_v4": 3.024000, - "Standard_E48_v5": 3.024000, - "Standard_E48a_v4": 3.024000, - "Standard_E48ads_v5": 3.144000, - "Standard_E48as_v4": 3.024000, - "Standard_E48as_v5": 2.712000, - "Standard_E48bds_v5": 4.008000, - "Standard_E48bs_v5": 3.576000, - "Standard_E48d_v4": 3.456000, - "Standard_E48d_v5": 3.456000, - "Standard_E48ds_v4": 3.456000, - "Standard_E48ds_v5": 3.456000, - "Standard_E48s_v3": 3.024000, - "Standard_E48s_v4": 3.024000, - "Standard_E48s_v5": 3.024000, - "Standard_E4_v3": 0.252000, - "Standard_E4_v4": 0.252000, - "Standard_E4_v5": 0.252000, - "Standard_E4a_v4": 0.252000, - "Standard_E4ads_v5": 0.262000, - "Standard_E4as_v4": 0.252000, - "Standard_E4as_v5": 0.226000, - "Standard_E4bds_v5": 0.334000, - "Standard_E4bs_v5": 0.298000, - "Standard_E4d_v4": 0.288000, - "Standard_E4d_v5": 0.288000, - "Standard_E4ds_v4": 0.288000, - "Standard_E4ds_v5": 0.288000, - "Standard_E4pds_v5": 0.230000, - "Standard_E4ps_v5": 0.202000, - "Standard_E4s_v3": 0.252000, - "Standard_E4s_v4": 0.252000, - "Standard_E4s_v5": 0.252000, - "Standard_E64-16ads_v5": 4.192000, - "Standard_E64-16as_v4": 4.032000, - "Standard_E64-16as_v5": 3.616000, - "Standard_E64-16ds_v4": 4.608000, - "Standard_E64-16ds_v5": 4.608000, - "Standard_E64-16s_v3": 3.629000, - "Standard_E64-16s_v4": 4.032000, - "Standard_E64-16s_v5": 4.032000, - "Standard_E64-32ads_v5": 4.192000, - "Standard_E64-32as_v4": 4.032000, - "Standard_E64-32as_v5": 3.616000, - "Standard_E64-32ds_v4": 4.608000, - "Standard_E64-32ds_v5": 4.608000, - "Standard_E64-32s_v3": 3.629000, - "Standard_E64-32s_v4": 4.032000, - "Standard_E64-32s_v5": 4.032000, - "Standard_E64_v3": 3.629000, - "Standard_E64_v4": 4.032000, - "Standard_E64_v5": 4.032000, - "Standard_E64a_v4": 4.032000, - "Standard_E64ads_v5": 4.192000, - "Standard_E64as_v4": 4.032000, - "Standard_E64as_v5": 3.616000, - "Standard_E64bds_v5": 5.344000, - "Standard_E64bs_v5": 4.768000, - "Standard_E64d_v4": 4.608000, - "Standard_E64d_v5": 4.608000, - "Standard_E64ds_v4": 4.608000, - "Standard_E64ds_v5": 4.608000, - "Standard_E64i_v3": 3.629000, - "Standard_E64is_v3": 3.629000, - "Standard_E64s_v3": 3.629000, - "Standard_E64s_v4": 4.032000, - "Standard_E64s_v5": 4.032000, - "Standard_E8-2ads_v5": 0.524000, - "Standard_E8-2as_v4": 0.504000, - "Standard_E8-2as_v5": 0.452000, - "Standard_E8-2ds_v4": 0.576000, - "Standard_E8-2ds_v5": 0.576000, - "Standard_E8-2s_v3": 0.504000, - "Standard_E8-2s_v4": 0.504000, - "Standard_E8-2s_v5": 0.504000, - "Standard_E8-4ads_v5": 0.524000, - "Standard_E8-4as_v4": 0.504000, - "Standard_E8-4as_v5": 0.452000, - "Standard_E8-4ds_v4": 0.576000, - "Standard_E8-4ds_v5": 0.576000, - "Standard_E8-4s_v3": 0.504000, - "Standard_E8-4s_v4": 0.504000, - "Standard_E8-4s_v5": 0.504000, - "Standard_E80ids_v4": 5.760000, - "Standard_E80is_v4": 5.040000, - "Standard_E8_v3": 0.504000, - "Standard_E8_v4": 0.504000, - "Standard_E8_v5": 0.504000, - "Standard_E8a_v4": 0.504000, - "Standard_E8ads_v5": 0.524000, - "Standard_E8as_v4": 0.504000, - "Standard_E8as_v5": 0.452000, - "Standard_E8bds_v5": 0.668000, - "Standard_E8bs_v5": 0.596000, - "Standard_E8d_v4": 0.576000, - "Standard_E8d_v5": 0.576000, - "Standard_E8ds_v4": 0.576000, - "Standard_E8ds_v5": 0.576000, - "Standard_E8pds_v5": 0.461000, - "Standard_E8ps_v5": 0.403000, - "Standard_E8s_v3": 0.504000, - "Standard_E8s_v4": 0.504000, - "Standard_E8s_v5": 0.504000, - "Standard_E96-24ads_v5": 6.288000, - "Standard_E96-24as_v4": 6.048000, - "Standard_E96-24as_v5": 5.424000, - "Standard_E96-24ds_v5": 6.912000, - "Standard_E96-24s_v5": 6.048000, - "Standard_E96-48ads_v5": 6.288000, - "Standard_E96-48as_v4": 6.048000, - "Standard_E96-48as_v5": 5.424000, - "Standard_E96-48ds_v5": 6.912000, - "Standard_E96-48s_v5": 6.048000, - "Standard_E96_v5": 6.048000, - "Standard_E96a_v4": 6.048000, - "Standard_E96ads_v5": 6.288000, - "Standard_E96as_v4": 6.048000, - "Standard_E96as_v5": 5.424000, - "Standard_E96bds_v5": 8.016000, - "Standard_E96bs_v5": 7.152000, - "Standard_E96d_v5": 6.912000, - "Standard_E96ds_v5": 6.912000, - "Standard_E96iads_v5": 6.917000, - "Standard_E96ias_v5": 5.966000, - "Standard_E96s_v5": 6.048000, - "Standard_F1": 0.049700, - "Standard_F16": 0.796000, - "Standard_F16s": 0.796000, - "Standard_F16s_v2": 0.677000, - "Standard_F1s": 0.049700, - "Standard_F2": 0.099000, - "Standard_F2s": 0.099000, - "Standard_F2s_v2": 0.084600, - "Standard_F32s_v2": 1.353000, - "Standard_F4": 0.199000, - "Standard_F48s_v2": 2.030000, - "Standard_F4s": 0.199000, - "Standard_F4s_v2": 0.169000, - "Standard_F64s_v2": 2.706000, - "Standard_F72s_v2": 3.045000, - "Standard_F8": 0.398000, - "Standard_F8s": 0.398000, - "Standard_F8s_v2": 0.338000, - "Standard_FX12mds": 1.116000, - "Standard_FX24mds": 2.232000, - "Standard_FX36mds": 3.348000, - "Standard_FX48mds": 4.464000, - "Standard_FX4mds": 0.372000, - "Standard_G1": 0.490000, - "Standard_G2": 0.981000, - "Standard_G3": 1.961000, - "Standard_G4": 3.922000, - "Standard_G5": 7.820000, - "Standard_GS1": 0.490000, - "Standard_GS2": 0.981000, - "Standard_GS3": 1.961000, - "Standard_GS4": 3.922000, - "Standard_GS4-4": 3.922000, - "Standard_GS4-8": 3.922000, - "Standard_GS5": 7.820000, - "Standard_GS5-16": 7.820000, - "Standard_GS5-8": 7.820000, - "Standard_H16": 1.591000, - "Standard_H16m": 2.132000, - "Standard_H16mr": 2.345000, - "Standard_H16r": 1.750000, - "Standard_H8": 0.796000, - "Standard_H8m": 1.066000, - "Standard_HB120-16rs_v2": 3.600000, - "Standard_HB120-32rs_v2": 3.600000, - "Standard_HB120-64rs_v2": 3.600000, - "Standard_HB120-96rs_v2": 3.600000, - "Standard_HB120rs_v2": 3.600000, - "Standard_HC44-16rs": 3.168000, - "Standard_HC44-32rs": 3.168000, - "Standard_HC44rs": 3.168000, - "Standard_L16as_v3": 1.248000, - "Standard_L16s": 1.248000, - "Standard_L16s_v2": 1.248000, - "Standard_L16s_v3": 1.396000, - "Standard_L32as_v3": 2.496000, - "Standard_L32s": 2.496000, - "Standard_L32s_v2": 2.496000, - "Standard_L32s_v3": 2.792000, - "Standard_L48as_v3": 3.744000, - "Standard_L48s_v2": 3.744000, - "Standard_L48s_v3": 4.188000, - "Standard_L4s": 0.312000, - "Standard_L64as_v3": 4.992000, - "Standard_L64s_v2": 4.992000, - "Standard_L64s_v3": 5.584000, - "Standard_L80as_v3": 6.240000, - "Standard_L80s_v2": 6.240000, - "Standard_L80s_v3": 6.980000, - "Standard_L88is_v2": 6.864000, - "Standard_L8as_v3": 0.624000, - "Standard_L8s": 0.624000, - "Standard_L8s_v2": 0.624000, - "Standard_L8s_v3": 0.698000, - "Standard_M128": 13.338000, - "Standard_M128-32ms": 26.688000, - "Standard_M128-64ms": 26.688000, - "Standard_M128dms_v2": 26.690000, - "Standard_M128ds_v2": 13.340000, - "Standard_M128m": 26.688000, - "Standard_M128ms": 26.688000, - "Standard_M128ms_v2": 26.269000, - "Standard_M128s": 13.338000, - "Standard_M128s_v2": 12.919000, - "Standard_M16-4ms": 3.073000, - "Standard_M16-8ms": 3.073000, - "Standard_M16ms": 3.073000, - "Standard_M16s": 2.387000, - "Standard_M192idms_v2": 32.064000, - "Standard_M192ids_v2": 16.032000, - "Standard_M192ims_v2": 31.643000, - "Standard_M192is_v2": 15.611000, - "Standard_M208-104ms_v2": 44.620000, - "Standard_M208-104s_v2": 22.310000, - "Standard_M208-52ms_v2": 44.620000, - "Standard_M208-52s_v2": 22.310000, - "Standard_M208ms_v2": 44.620000, - "Standard_M208s_v2": 22.310000, - "Standard_M32-16ms": 6.146000, - "Standard_M32-8ms": 6.146000, - "Standard_M32dms_v2": 6.146000, - "Standard_M32ls": 2.873000, - "Standard_M32ms": 6.146000, - "Standard_M32ms_v2": 6.041000, - "Standard_M32s": 3.335000, - "Standard_M32ts": 2.707000, - "Standard_M416-104ms_v2": 99.150000, - "Standard_M416-104s_v2": 49.580000, - "Standard_M416-208ms_v2": 99.150000, - "Standard_M416-208s_v2": 49.580000, - "Standard_M416is_v2": 49.580000, - "Standard_M416ms_v2": 99.150000, - "Standard_M416s_8_v2": 66.110000, - "Standard_M416s_v2": 49.580000, - "Standard_M64": 6.669000, - "Standard_M64-16ms": 10.337000, - "Standard_M64-32ms": 10.337000, - "Standard_M64dms_v2": 10.340000, - "Standard_M64ds_v2": 6.669000, - "Standard_M64ls": 5.415000, - "Standard_M64m": 10.337000, - "Standard_M64ms": 10.337000, - "Standard_M64ms_v2": 10.130000, - "Standard_M64s": 6.669000, - "Standard_M64s_v2": 6.459000, - "Standard_M8-2ms": 1.536500, - "Standard_M8-4ms": 1.536500, - "Standard_M8ms": 1.536500, - "Standard_NC12": 1.800000, - "Standard_NC12s_v2": 4.140000, - "Standard_NC12s_v3": 6.120000, - "Standard_NC16as_T4_v3": 1.204000, - "Standard_NC24": 3.600000, - "Standard_NC24ads_A100_v4": 3.673000, - "Standard_NC24r": 3.960000, - "Standard_NC24rs_v2": 9.108000, - "Standard_NC24rs_v3": 13.460000, - "Standard_NC24s_v2": 8.280000, - "Standard_NC24s_v3": 12.240000, - "Standard_NC48ads_A100_v4": 7.346000, - "Standard_NC4as_T4_v3": 0.526000, - "Standard_NC6": 0.900000, - "Standard_NC64as_T4_v3": 4.352000, - "Standard_NC6s_v2": 2.070000, - "Standard_NC6s_v3": 3.060000, - "Standard_NC8as_T4_v3": 0.752000, - "Standard_NC96ads_A100_v4": 14.692000, - "Standard_ND12s": 4.140000, - "Standard_ND24rs": 9.108000, - "Standard_ND24s": 8.280000, - "Standard_ND40rs_v2": 22.032000, - "Standard_ND6s": 2.070000, - "Standard_ND96amsr_A100_v4": 32.770000, - "Standard_ND96asr_A100_v4": 27.197000, - "Standard_ND96asr_v4": 27.197000, - "Standard_NP10s": 1.650000, - "Standard_NP20s": 3.300000, - "Standard_NP40s": 6.600000, - "Standard_NV12": 2.185000, - "Standard_NV12ads_A10_v5": 0.908000, - "Standard_NV12s_v3": 1.140000, - "Standard_NV16as_v4": 0.932000, - "Standard_NV18ads_A10_v5": 1.600000, - "Standard_NV24": 4.370000, - "Standard_NV24s_v3": 2.280000, - "Standard_NV32as_v4": 1.864000, - "Standard_NV36adms_A10_v5": 4.520000, - "Standard_NV36ads_A10_v5": 3.200000, - "Standard_NV48s_v3": 4.560000, - "Standard_NV4as_v4": 0.233000, - "Standard_NV6": 1.092000, - "Standard_NV6ads_A10_v5": 0.454000, - "Standard_NV72ads_A10_v5": 6.520000, - "Standard_NV8as_v4": 0.466000, - "Standard_PB12s": 1.660000, - "Standard_PB24s": 3.320000, - "Standard_PB6s": 0.830000, - } - // westus3 - initialOnDemandPrices["westus3"] = map[string]float64{ - "Dadsv5_Type1": 6.345000, - "Dasv4_Type1": 5.280000, - "Dasv4_Type2": 5.280000, - "Dasv5_Type1": 5.298000, - "Ddsv4_Type 1": 3.978000, - "Ddsv4_Type2": 4.723000, - "Ddsv5_Type1": 5.966000, - "Dsv3_Type3": 4.225000, - "Dsv3_Type4": 5.281000, - "Dsv4_Type1": 4.224000, - "Dsv4_Type2": 5.069000, - "Dsv5_Type1": 5.280000, - "Eadsv5_Type1": 6.917000, - "Easv4_Type1": 6.653000, - "Easv4_Type2": 6.653000, - "Easv5_Type1": 5.966000, - "Ebdsv5-Type1": 5.878000, - "Ebsv5-Type1": 5.245000, - "Edsv4_Type 1": 5.069000, - "Edsv4_Type2": 6.019000, - "Edsv5_Type1": 7.603000, - "Esv3_Type3": 5.545000, - "Esv3_Type4": 5.822000, - "Esv4_Type1": 4.435000, - "Esv4_Type2": 5.821000, - "Esv5_Type1": 6.653000, - "FXmds Type1": 5.570000, - "Fsv2 Type3": 3.927000, - "Fsv2_Type2": 3.366000, - "Fsv2_Type4": 4.468000, - "Lasv3_Type1": 6.864000, - "Lsv2_Type1": 6.864000, - "Lsv3_Type1": 7.678000, - "Mdsmv2MedMem _Type1": 29.359000, - "Mdsv2MedMem_Type1": 14.674000, - "Msmv2MedMem Type1": 28.896000, - "Msmv2_Type1": 109.060000, - "Msv2MedMem Type1": 14.211000, - "Msv2_Type1": 54.538000, - "NDamsrA100v4_Type1": 36.047000, - "NDasrA100v4_Type1": 29.917000, - "NVasv4_Type1": 7.176000, - "Standard_A1_v2": 0.036000, - "Standard_A2_v2": 0.076000, - "Standard_A2m_v2": 0.099000, - "Standard_A4_v2": 0.159000, - "Standard_A4m_v2": 0.208000, - "Standard_A8_v2": 0.333000, - "Standard_A8m_v2": 0.437000, - "Standard_B12ms": 0.499000, - "Standard_B16als_v2": 0.533000, - "Standard_B16as_v2": 0.602000, - "Standard_B16ls_v2": 0.663000, - "Standard_B16ms": 0.666000, - "Standard_B16pls_v2": 0.425000, - "Standard_B16ps_v2": 0.554000, - "Standard_B16s_v2": 0.666000, - "Standard_B1ls": 0.005200, - "Standard_B1ms": 0.020700, - "Standard_B1s": 0.010400, - "Standard_B20ms": 0.832000, - "Standard_B2als_v2": 0.046800, - "Standard_B2as_v2": 0.075200, - "Standard_B2ats_v2": 0.018600, - "Standard_B2ls_v2": 0.050800, - "Standard_B2ms": 0.083200, - "Standard_B2pls_v2": 0.039200, - "Standard_B2ps_v2": 0.069200, - "Standard_B2pts_v2": 0.016700, - "Standard_B2s": 0.041600, - "Standard_B2s_v2": 0.092400, - "Standard_B2ts_v2": 0.010400, - "Standard_B32als_v2": 1.065000, - "Standard_B32as_v2": 1.203000, - "Standard_B32ls_v2": 1.326000, - "Standard_B32s_v2": 1.331000, - "Standard_B4als_v2": 0.133000, - "Standard_B4as_v2": 0.169000, - "Standard_B4ls_v2": 0.147000, - "Standard_B4ms": 0.166000, - "Standard_B4pls_v2": 0.106000, - "Standard_B4ps_v2": 0.138000, - "Standard_B4s_v2": 0.166000, - "Standard_B8als_v2": 0.266000, - "Standard_B8as_v2": 0.338000, - "Standard_B8ls_v2": 0.295000, - "Standard_B8ms": 0.333000, - "Standard_B8pls_v2": 0.213000, - "Standard_B8ps_v2": 0.277000, - "Standard_B8s_v2": 0.370000, - "Standard_D1": 0.077000, - "Standard_D11": 0.192000, - "Standard_D11_v2": 0.149000, - "Standard_D12": 0.385000, - "Standard_D12_v2": 0.299000, - "Standard_D13": 0.770000, - "Standard_D13_v2": 0.598000, - "Standard_D14": 1.540000, - "Standard_D14_v2": 1.196000, - "Standard_D15_v2": 1.495000, - "Standard_D15i_v2": 1.495000, - "Standard_D16_v3": 0.768000, - "Standard_D16_v4": 0.768000, - "Standard_D16_v5": 0.768000, - "Standard_D16a_v4": 0.768000, - "Standard_D16ads_v5": 0.824000, - "Standard_D16as_v4": 0.768000, - "Standard_D16as_v5": 0.688000, - "Standard_D16as_v5_Promo": 0.717000, - "Standard_D16d_v4": 0.904000, - "Standard_D16d_v5": 0.904000, - "Standard_D16ds_v4": 0.904000, - "Standard_D16ds_v5": 0.904000, - "Standard_D16lds_v5": 0.768000, - "Standard_D16ls_v5": 0.680000, - "Standard_D16pds_v5": 0.723000, - "Standard_D16plds_v5": 0.614000, - "Standard_D16pls_v5": 0.544000, - "Standard_D16ps_v5": 0.616000, - "Standard_D16s_v3": 0.768000, - "Standard_D16s_v4": 0.768000, - "Standard_D16s_v5": 0.768000, - "Standard_D1_v2": 0.057000, - "Standard_D2": 0.154000, - "Standard_D2_v2": 0.114000, - "Standard_D2_v3": 0.096000, - "Standard_D2_v4": 0.096000, - "Standard_D2_v5": 0.096000, - "Standard_D2a_v4": 0.096000, - "Standard_D2ads_v5": 0.103000, - "Standard_D2as_v4": 0.096000, - "Standard_D2as_v5": 0.086000, - "Standard_D2as_v5_Promo": 0.089600, - "Standard_D2d_v4": 0.113000, - "Standard_D2d_v5": 0.113000, - "Standard_D2ds_v4": 0.113000, - "Standard_D2ds_v5": 0.113000, - "Standard_D2lds_v5": 0.096000, - "Standard_D2ls_v5": 0.085000, - "Standard_D2pds_v5": 0.090400, - "Standard_D2plds_v5": 0.076800, - "Standard_D2pls_v5": 0.068000, - "Standard_D2ps_v5": 0.077000, - "Standard_D2s_v3": 0.096000, - "Standard_D2s_v4": 0.096000, - "Standard_D2s_v5": 0.096000, - "Standard_D3": 0.308000, - "Standard_D32-16s_v3": 1.536000, - "Standard_D32-8s_v3": 1.536000, - "Standard_D32_v3": 1.536000, - "Standard_D32_v4": 1.536000, - "Standard_D32_v5": 1.536000, - "Standard_D32a_v4": 1.536000, - "Standard_D32ads_v5": 1.648000, - "Standard_D32as_v4": 1.536000, - "Standard_D32as_v5": 1.376000, - "Standard_D32as_v5_Promo": 1.434000, - "Standard_D32d_v4": 1.808000, - "Standard_D32d_v5": 1.808000, - "Standard_D32ds_v4": 1.808000, - "Standard_D32ds_v5": 1.808000, - "Standard_D32lds_v5": 1.536000, - "Standard_D32ls_v5": 1.360000, - "Standard_D32pds_v5": 1.446000, - "Standard_D32plds_v5": 1.229000, - "Standard_D32pls_v5": 1.088000, - "Standard_D32ps_v5": 1.232000, - "Standard_D32s_v3": 1.536000, - "Standard_D32s_v4": 1.536000, - "Standard_D32s_v5": 1.536000, - "Standard_D3_v2": 0.229000, - "Standard_D4": 0.616000, - "Standard_D48_v3": 2.304000, - "Standard_D48_v4": 2.304000, - "Standard_D48_v5": 2.304000, - "Standard_D48a_v4": 2.304000, - "Standard_D48ads_v5": 2.472000, - "Standard_D48as_v4": 2.304000, - "Standard_D48as_v5": 2.064000, - "Standard_D48as_v5_Promo": 2.150000, - "Standard_D48d_v4": 2.712000, - "Standard_D48d_v5": 2.712000, - "Standard_D48ds_v4": 2.712000, - "Standard_D48ds_v5": 2.712000, - "Standard_D48lds_v5": 2.304000, - "Standard_D48ls_v5": 2.040000, - "Standard_D48pds_v5": 2.170000, - "Standard_D48plds_v5": 1.843000, - "Standard_D48pls_v5": 1.632000, - "Standard_D48ps_v5": 1.848000, - "Standard_D48s_v3": 2.304000, - "Standard_D48s_v4": 2.304000, - "Standard_D48s_v5": 2.304000, - "Standard_D4_v2": 0.458000, - "Standard_D4_v3": 0.192000, - "Standard_D4_v4": 0.192000, - "Standard_D4_v5": 0.192000, - "Standard_D4a_v4": 0.192000, - "Standard_D4ads_v5": 0.206000, - "Standard_D4as_v4": 0.192000, - "Standard_D4as_v5": 0.172000, - "Standard_D4as_v5_Promo": 0.179000, - "Standard_D4d_v4": 0.226000, - "Standard_D4d_v5": 0.226000, - "Standard_D4ds_v4": 0.226000, - "Standard_D4ds_v5": 0.226000, - "Standard_D4lds_v5": 0.192000, - "Standard_D4ls_v5": 0.170000, - "Standard_D4pds_v5": 0.181000, - "Standard_D4plds_v5": 0.154000, - "Standard_D4pls_v5": 0.136000, - "Standard_D4ps_v5": 0.154000, - "Standard_D4s_v3": 0.192000, - "Standard_D4s_v4": 0.192000, - "Standard_D4s_v5": 0.192000, - "Standard_D5_v2": 0.916000, - "Standard_D64-16s_v3": 3.072000, - "Standard_D64-32s_v3": 3.072000, - "Standard_D64_v3": 3.072000, - "Standard_D64_v4": 3.072000, - "Standard_D64_v5": 3.072000, - "Standard_D64a_v4": 3.072000, - "Standard_D64ads_v5": 3.296000, - "Standard_D64as_v4": 3.072000, - "Standard_D64as_v5": 2.752000, - "Standard_D64as_v5_Promo": 2.867000, - "Standard_D64d_v4": 3.616000, - "Standard_D64d_v5": 3.616000, - "Standard_D64ds_v4": 3.616000, - "Standard_D64ds_v5": 3.616000, - "Standard_D64lds_v5": 3.072000, - "Standard_D64ls_v5": 2.720000, - "Standard_D64pds_v5": 2.893000, - "Standard_D64plds_v5": 2.458000, - "Standard_D64pls_v5": 2.176000, - "Standard_D64ps_v5": 2.464000, - "Standard_D64s_v3": 3.072000, - "Standard_D64s_v4": 3.072000, - "Standard_D64s_v5": 3.072000, - "Standard_D8_v3": 0.384000, - "Standard_D8_v4": 0.384000, - "Standard_D8_v5": 0.384000, - "Standard_D8a_v4": 0.384000, - "Standard_D8ads_v5": 0.412000, - "Standard_D8as_v4": 0.384000, - "Standard_D8as_v5": 0.344000, - "Standard_D8as_v5_Promo": 0.358000, - "Standard_D8d_v4": 0.452000, - "Standard_D8d_v5": 0.452000, - "Standard_D8ds_v4": 0.452000, - "Standard_D8ds_v5": 0.452000, - "Standard_D8lds_v5": 0.384000, - "Standard_D8ls_v5": 0.340000, - "Standard_D8pds_v5": 0.362000, - "Standard_D8plds_v5": 0.307000, - "Standard_D8pls_v5": 0.272000, - "Standard_D8ps_v5": 0.308000, - "Standard_D8s_v3": 0.384000, - "Standard_D8s_v4": 0.384000, - "Standard_D8s_v5": 0.384000, - "Standard_D96_v5": 4.608000, - "Standard_D96a_v4": 4.608000, - "Standard_D96ads_v5": 4.944000, - "Standard_D96as_v4": 4.608000, - "Standard_D96as_v5": 4.128000, - "Standard_D96as_v5_Promo": 4.301000, - "Standard_D96d_v5": 5.424000, - "Standard_D96ds_v5": 5.424000, - "Standard_D96lds_v5": 4.608000, - "Standard_D96ls_v5": 4.080000, - "Standard_D96s_v5": 4.608000, - "Standard_DS1": 0.077000, - "Standard_DS11": 0.192000, - "Standard_DS11-1_v2": 0.149000, - "Standard_DS11_v2": 0.149000, - "Standard_DS11_v2_Promo": 0.149000, - "Standard_DS12": 0.385000, - "Standard_DS12-1_v2": 0.299000, - "Standard_DS12-2_v2": 0.299000, - "Standard_DS12_v2": 0.299000, - "Standard_DS12_v2_Promo": 0.299000, - "Standard_DS13": 0.770000, - "Standard_DS13-2_v2": 0.598000, - "Standard_DS13-4_v2": 0.598000, - "Standard_DS13_v2": 0.598000, - "Standard_DS13_v2_Promo": 0.598000, - "Standard_DS14": 1.540000, - "Standard_DS14-4_v2": 1.196000, - "Standard_DS14-8_v2": 1.196000, - "Standard_DS14_v2": 1.196000, - "Standard_DS14_v2_Promo": 1.196000, - "Standard_DS15_v2": 1.495000, - "Standard_DS15i_v2": 1.495000, - "Standard_DS1_v2": 0.057000, - "Standard_DS2": 0.154000, - "Standard_DS2_v2": 0.114000, - "Standard_DS2_v2_Promo": 0.114000, - "Standard_DS3": 0.308000, - "Standard_DS3_v2": 0.229000, - "Standard_DS3_v2_Promo": 0.229000, - "Standard_DS4": 0.616000, - "Standard_DS4_v2": 0.458000, - "Standard_DS4_v2_Promo": 0.458000, - "Standard_DS5_v2": 0.916000, - "Standard_DS5_v2_Promo": 0.916000, - "Standard_E104i_v5": 7.207000, - "Standard_E104id_v5": 8.237000, - "Standard_E104ids_v5": 8.237000, - "Standard_E104is_v5": 7.207000, - "Standard_E112iads_v5": 8.070000, - "Standard_E112ias_v5": 6.961000, - "Standard_E112ibds_v5": 10.287000, - "Standard_E112ibs_v5": 9.178000, - "Standard_E16-4ads_v5": 1.048000, - "Standard_E16-4as_v4": 1.008000, - "Standard_E16-4as_v5": 0.904000, - "Standard_E16-4ds_v4": 1.152000, - "Standard_E16-4ds_v5": 1.152000, - "Standard_E16-4s_v3": 1.008000, - "Standard_E16-4s_v4": 1.008000, - "Standard_E16-4s_v5": 1.008000, - "Standard_E16-8ads_v5": 1.048000, - "Standard_E16-8as_v4": 1.008000, - "Standard_E16-8as_v5": 0.904000, - "Standard_E16-8ds_v4": 1.152000, - "Standard_E16-8ds_v5": 1.152000, - "Standard_E16-8s_v3": 1.008000, - "Standard_E16-8s_v4": 1.008000, - "Standard_E16-8s_v5": 1.008000, - "Standard_E16_v3": 1.008000, - "Standard_E16_v4": 1.008000, - "Standard_E16_v5": 1.008000, - "Standard_E16a_v4": 1.008000, - "Standard_E16ads_v5": 1.048000, - "Standard_E16as_v4": 1.008000, - "Standard_E16as_v5": 0.904000, - "Standard_E16bds_v5": 1.336000, - "Standard_E16bs_v5": 1.192000, - "Standard_E16d_v4": 1.152000, - "Standard_E16d_v5": 1.152000, - "Standard_E16ds_v4": 1.152000, - "Standard_E16ds_v5": 1.152000, - "Standard_E16pds_v5": 0.922000, - "Standard_E16ps_v5": 0.806000, - "Standard_E16s_v3": 1.008000, - "Standard_E16s_v4": 1.008000, - "Standard_E16s_v5": 1.008000, - "Standard_E20_v3": 1.260000, - "Standard_E20_v4": 1.260000, - "Standard_E20_v5": 1.260000, - "Standard_E20a_v4": 1.260000, - "Standard_E20ads_v5": 1.310000, - "Standard_E20as_v4": 1.260000, - "Standard_E20as_v5": 1.130000, - "Standard_E20d_v4": 1.440000, - "Standard_E20d_v5": 1.440000, - "Standard_E20ds_v4": 1.440000, - "Standard_E20ds_v5": 1.440000, - "Standard_E20pds_v5": 1.152000, - "Standard_E20ps_v5": 1.008000, - "Standard_E20s_v3": 1.260000, - "Standard_E20s_v4": 1.260000, - "Standard_E20s_v5": 1.260000, - "Standard_E2_v3": 0.126000, - "Standard_E2_v4": 0.126000, - "Standard_E2_v5": 0.126000, - "Standard_E2a_v4": 0.126000, - "Standard_E2ads_v5": 0.131000, - "Standard_E2as_v4": 0.126000, - "Standard_E2as_v5": 0.113000, - "Standard_E2bds_v5": 0.167000, - "Standard_E2bs_v5": 0.149000, - "Standard_E2d_v4": 0.144000, - "Standard_E2d_v5": 0.144000, - "Standard_E2ds_v4": 0.144000, - "Standard_E2ds_v5": 0.144000, - "Standard_E2pds_v5": 0.115000, - "Standard_E2ps_v5": 0.101000, - "Standard_E2s_v3": 0.126000, - "Standard_E2s_v4": 0.126000, - "Standard_E2s_v5": 0.126000, - "Standard_E32-16ads_v5": 2.096000, - "Standard_E32-16as_v4": 2.016000, - "Standard_E32-16as_v5": 1.808000, - "Standard_E32-16ds_v4": 2.304000, - "Standard_E32-16ds_v5": 2.304000, - "Standard_E32-16s_v3": 2.016000, - "Standard_E32-16s_v4": 2.016000, - "Standard_E32-16s_v5": 2.016000, - "Standard_E32-8ads_v5": 2.096000, - "Standard_E32-8as_v4": 2.016000, - "Standard_E32-8as_v5": 1.808000, - "Standard_E32-8ds_v4": 2.304000, - "Standard_E32-8ds_v5": 2.304000, - "Standard_E32-8s_v3": 2.016000, - "Standard_E32-8s_v4": 2.016000, - "Standard_E32-8s_v5": 2.016000, - "Standard_E32_v3": 2.016000, - "Standard_E32_v4": 2.016000, - "Standard_E32_v5": 2.016000, - "Standard_E32a_v4": 2.016000, - "Standard_E32ads_v5": 2.096000, - "Standard_E32as_v4": 2.016000, - "Standard_E32as_v5": 1.808000, - "Standard_E32bds_v5": 2.672000, - "Standard_E32bs_v5": 2.384000, - "Standard_E32d_v4": 2.304000, - "Standard_E32d_v5": 2.304000, - "Standard_E32ds_v4": 2.304000, - "Standard_E32ds_v5": 2.304000, - "Standard_E32pds_v5": 1.843000, - "Standard_E32ps_v5": 1.613000, - "Standard_E32s_v3": 2.016000, - "Standard_E32s_v4": 2.016000, - "Standard_E32s_v5": 2.016000, - "Standard_E4-2ads_v5": 0.262000, - "Standard_E4-2as_v4": 0.252000, - "Standard_E4-2as_v5": 0.226000, - "Standard_E4-2ds_v4": 0.288000, - "Standard_E4-2ds_v5": 0.288000, - "Standard_E4-2s_v3": 0.252000, - "Standard_E4-2s_v4": 0.252000, - "Standard_E4-2s_v5": 0.252000, - "Standard_E48_v3": 3.024000, - "Standard_E48_v4": 3.024000, - "Standard_E48_v5": 3.024000, - "Standard_E48a_v4": 3.024000, - "Standard_E48ads_v5": 3.144000, - "Standard_E48as_v4": 3.024000, - "Standard_E48as_v5": 2.712000, - "Standard_E48bds_v5": 4.008000, - "Standard_E48bs_v5": 3.576000, - "Standard_E48d_v4": 3.456000, - "Standard_E48d_v5": 3.456000, - "Standard_E48ds_v4": 3.456000, - "Standard_E48ds_v5": 3.456000, - "Standard_E48s_v3": 3.024000, - "Standard_E48s_v4": 3.024000, - "Standard_E48s_v5": 3.024000, - "Standard_E4_v3": 0.252000, - "Standard_E4_v4": 0.252000, - "Standard_E4_v5": 0.252000, - "Standard_E4a_v4": 0.252000, - "Standard_E4ads_v5": 0.262000, - "Standard_E4as_v4": 0.252000, - "Standard_E4as_v5": 0.226000, - "Standard_E4bds_v5": 0.334000, - "Standard_E4bs_v5": 0.298000, - "Standard_E4d_v4": 0.288000, - "Standard_E4d_v5": 0.288000, - "Standard_E4ds_v4": 0.288000, - "Standard_E4ds_v5": 0.288000, - "Standard_E4pds_v5": 0.230000, - "Standard_E4ps_v5": 0.202000, - "Standard_E4s_v3": 0.252000, - "Standard_E4s_v4": 0.252000, - "Standard_E4s_v5": 0.252000, - "Standard_E64-16ads_v5": 4.192000, - "Standard_E64-16as_v4": 4.032000, - "Standard_E64-16as_v5": 3.616000, - "Standard_E64-16ds_v4": 4.608000, - "Standard_E64-16ds_v5": 4.608000, - "Standard_E64-16s_v3": 3.629000, - "Standard_E64-16s_v4": 4.032000, - "Standard_E64-16s_v5": 4.032000, - "Standard_E64-32ads_v5": 4.192000, - "Standard_E64-32as_v4": 4.032000, - "Standard_E64-32as_v5": 3.616000, - "Standard_E64-32ds_v4": 4.608000, - "Standard_E64-32ds_v5": 4.608000, - "Standard_E64-32s_v3": 3.629000, - "Standard_E64-32s_v4": 4.032000, - "Standard_E64-32s_v5": 4.032000, - "Standard_E64_v3": 3.629000, - "Standard_E64_v4": 4.032000, - "Standard_E64_v5": 4.032000, - "Standard_E64a_v4": 4.032000, - "Standard_E64ads_v5": 4.192000, - "Standard_E64as_v4": 4.032000, - "Standard_E64as_v5": 3.616000, - "Standard_E64bds_v5": 5.344000, - "Standard_E64bs_v5": 4.768000, - "Standard_E64d_v4": 4.608000, - "Standard_E64d_v5": 4.608000, - "Standard_E64ds_v4": 4.608000, - "Standard_E64ds_v5": 4.608000, - "Standard_E64i_v3": 3.629000, - "Standard_E64is_v3": 3.629000, - "Standard_E64s_v3": 3.629000, - "Standard_E64s_v4": 4.032000, - "Standard_E64s_v5": 4.032000, - "Standard_E8-2ads_v5": 0.524000, - "Standard_E8-2as_v4": 0.504000, - "Standard_E8-2as_v5": 0.452000, - "Standard_E8-2ds_v4": 0.576000, - "Standard_E8-2ds_v5": 0.576000, - "Standard_E8-2s_v3": 0.504000, - "Standard_E8-2s_v4": 0.504000, - "Standard_E8-2s_v5": 0.504000, - "Standard_E8-4ads_v5": 0.524000, - "Standard_E8-4as_v4": 0.504000, - "Standard_E8-4as_v5": 0.452000, - "Standard_E8-4ds_v4": 0.576000, - "Standard_E8-4ds_v5": 0.576000, - "Standard_E8-4s_v3": 0.504000, - "Standard_E8-4s_v4": 0.504000, - "Standard_E8-4s_v5": 0.504000, - "Standard_E80ids_v4": 5.760000, - "Standard_E80is_v4": 5.040000, - "Standard_E8_v3": 0.504000, - "Standard_E8_v4": 0.504000, - "Standard_E8_v5": 0.504000, - "Standard_E8a_v4": 0.504000, - "Standard_E8ads_v5": 0.524000, - "Standard_E8as_v4": 0.504000, - "Standard_E8as_v5": 0.452000, - "Standard_E8bds_v5": 0.668000, - "Standard_E8bs_v5": 0.596000, - "Standard_E8d_v4": 0.576000, - "Standard_E8d_v5": 0.576000, - "Standard_E8ds_v4": 0.576000, - "Standard_E8ds_v5": 0.576000, - "Standard_E8pds_v5": 0.461000, - "Standard_E8ps_v5": 0.403000, - "Standard_E8s_v3": 0.504000, - "Standard_E8s_v4": 0.504000, - "Standard_E8s_v5": 0.504000, - "Standard_E96-24ads_v5": 6.288000, - "Standard_E96-24as_v4": 6.048000, - "Standard_E96-24as_v5": 5.424000, - "Standard_E96-24ds_v5": 6.912000, - "Standard_E96-24s_v5": 6.048000, - "Standard_E96-48ads_v5": 6.288000, - "Standard_E96-48as_v4": 6.048000, - "Standard_E96-48as_v5": 5.424000, - "Standard_E96-48ds_v5": 6.912000, - "Standard_E96-48s_v5": 6.048000, - "Standard_E96_v5": 6.048000, - "Standard_E96a_v4": 6.048000, - "Standard_E96ads_v5": 6.288000, - "Standard_E96as_v4": 6.048000, - "Standard_E96as_v5": 5.424000, - "Standard_E96bds_v5": 8.016000, - "Standard_E96bs_v5": 7.152000, - "Standard_E96d_v5": 6.912000, - "Standard_E96ds_v5": 6.912000, - "Standard_E96iads_v5": 6.917000, - "Standard_E96ias_v4": 6.048000, - "Standard_E96ias_v5": 5.966000, - "Standard_E96s_v5": 6.048000, - "Standard_F1": 0.049700, - "Standard_F16": 0.796000, - "Standard_F16s": 0.796000, - "Standard_F16s_v2": 0.677000, - "Standard_F1s": 0.049700, - "Standard_F2": 0.099000, - "Standard_F2s": 0.099000, - "Standard_F2s_v2": 0.084600, - "Standard_F32s_v2": 1.353000, - "Standard_F4": 0.199000, - "Standard_F48s_v2": 2.030000, - "Standard_F4s": 0.199000, - "Standard_F4s_v2": 0.169000, - "Standard_F64s_v2": 2.706000, - "Standard_F72s_v2": 3.045000, - "Standard_F8": 0.398000, - "Standard_F8s": 0.398000, - "Standard_F8s_v2": 0.338000, - "Standard_FX12mds": 1.266000, - "Standard_FX24mds": 2.532000, - "Standard_FX36mds": 3.798000, - "Standard_FX48mds": 5.064000, - "Standard_FX4mds": 0.422000, - "Standard_HB120-16rs_v3": 3.600000, - "Standard_HB120-32rs_v3": 3.600000, - "Standard_HB120-64rs_v3": 3.600000, - "Standard_HB120-96rs_v3": 3.600000, - "Standard_HB120rs_v3": 3.600000, - "Standard_HB176-144rs_v4": 7.200000, - "Standard_HB176-24rs_v4": 7.200000, - "Standard_HB176-48rs_v4": 7.200000, - "Standard_HB176-96rs_v4": 7.200000, - "Standard_HB176rs_v4": 7.200000, - "Standard_HX176-144rs": 8.640000, - "Standard_HX176-24rs": 8.640000, - "Standard_HX176-48rs": 8.640000, - "Standard_HX176-96rs": 8.640000, - "Standard_HX176rs": 8.640000, - "Standard_L16as_v3": 1.248000, - "Standard_L16s_v2": 1.248000, - "Standard_L16s_v3": 1.396000, - "Standard_L32as_v3": 2.496000, - "Standard_L32s_v2": 2.496000, - "Standard_L32s_v3": 2.792000, - "Standard_L48as_v3": 3.744000, - "Standard_L48s_v2": 3.744000, - "Standard_L48s_v3": 4.188000, - "Standard_L64as_v3": 4.992000, - "Standard_L64s_v2": 4.992000, - "Standard_L64s_v3": 5.584000, - "Standard_L80as_v3": 6.240000, - "Standard_L80s_v2": 6.240000, - "Standard_L80s_v3": 6.980000, - "Standard_L88is_v2": 6.864000, - "Standard_L8as_v3": 0.624000, - "Standard_L8s_v2": 0.624000, - "Standard_L8s_v3": 0.698000, - "Standard_M128": 13.338000, - "Standard_M128-32ms": 26.688000, - "Standard_M128-64ms": 26.688000, - "Standard_M128dms_v2": 26.690000, - "Standard_M128ds_v2": 13.340000, - "Standard_M128m": 26.688000, - "Standard_M128ms": 26.688000, - "Standard_M128ms_v2": 26.269000, - "Standard_M128s": 13.338000, - "Standard_M128s_v2": 12.919000, - "Standard_M16-4ms": 3.073000, - "Standard_M16-8ms": 3.073000, - "Standard_M16ms": 3.073000, - "Standard_M16s": 2.387000, - "Standard_M192idms_v2": 32.064000, - "Standard_M192ids_v2": 16.032000, - "Standard_M192ims_v2": 31.643000, - "Standard_M192is_v2": 15.611000, - "Standard_M208-104ms_v2": 44.620000, - "Standard_M208-104s_v2": 22.310000, - "Standard_M208-52ms_v2": 44.620000, - "Standard_M208-52s_v2": 22.310000, - "Standard_M208ms_v2": 44.620000, - "Standard_M208s_v2": 22.310000, - "Standard_M32-16ms": 6.146000, - "Standard_M32-8ms": 6.146000, - "Standard_M32dms_v2": 6.146000, - "Standard_M32ls": 2.873000, - "Standard_M32ms": 6.146000, - "Standard_M32ms_v2": 6.041000, - "Standard_M32s": 3.335000, - "Standard_M32ts": 2.707000, - "Standard_M416-104ms_v2": 99.150000, - "Standard_M416-104s_v2": 49.580000, - "Standard_M416-208ms_v2": 99.150000, - "Standard_M416-208s_v2": 49.580000, - "Standard_M416is_v2": 49.580000, - "Standard_M416ms_v2": 99.150000, - "Standard_M416s_8_v2": 66.110000, - "Standard_M416s_v2": 49.580000, - "Standard_M64": 6.669000, - "Standard_M64-16ms": 10.337000, - "Standard_M64-32ms": 10.337000, - "Standard_M64dms_v2": 10.340000, - "Standard_M64ds_v2": 6.669000, - "Standard_M64ls": 5.415000, - "Standard_M64m": 10.337000, - "Standard_M64ms": 10.337000, - "Standard_M64ms_v2": 10.130000, - "Standard_M64s": 6.669000, - "Standard_M64s_v2": 6.459000, - "Standard_M8-2ms": 1.536000, - "Standard_M8-4ms": 1.536000, - "Standard_M8ms": 1.536000, - "Standard_NC12s_v3": 6.120000, - "Standard_NC16ads_A10_v4": 2.200000, - "Standard_NC16as_T4_v3": 1.204000, - "Standard_NC24ads_A100_v4": 3.673000, - "Standard_NC24rs_v3": 13.460000, - "Standard_NC24s_v3": 12.240000, - "Standard_NC32ads_A10_v4": 4.400000, - "Standard_NC48ads_A100_v4": 7.346000, - "Standard_NC4as_T4_v3": 0.526000, - "Standard_NC64as_T4_v3": 4.352000, - "Standard_NC6s_v3": 3.060000, - "Standard_NC8ads_A10_v4": 1.100000, - "Standard_NC8as_T4_v3": 0.752000, - "Standard_NC96ads_A100_v4": 14.692000, - "Standard_ND96ams_A100_v4": 32.770000, - "Standard_ND96amsr_A100_v4": 32.770000, - "Standard_ND96asr_A100_v4": 27.197000, - "Standard_NG16ads_V620_v1": 2.190000, - "Standard_NG32adms_V620": 5.694000, - "Standard_NG32ads_V620_v1": 4.380000, - "Standard_NG8ads_V620_v1": 1.095000, - "Standard_NV12ads_A10_v5": 0.908000, - "Standard_NV16as_v4": 0.932000, - "Standard_NV18ads_A10_v5": 1.600000, - "Standard_NV32as_v4": 1.864000, - "Standard_NV36adms_A10_v5": 4.520000, - "Standard_NV36ads_A10_v5": 3.200000, - "Standard_NV4as_v4": 0.233000, - "Standard_NV6ads_A10_v5": 0.454000, - "Standard_NV72ads_A10_v5": 6.520000, - "Standard_NV8as_v4": 0.466000, - } -} diff --git a/pkg/staticprovisioner/provisioner.go b/pkg/staticprovisioner/provisioner.go deleted file mode 100644 index 4d32f273..00000000 --- a/pkg/staticprovisioner/provisioner.go +++ /dev/null @@ -1,42 +0,0 @@ -/* - Copyright (c) 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. -*/ - -package staticprovisioner - -import ( - "github.com/Azure/go-autorest/autorest/to" - "github.com/aws/karpenter-core/pkg/apis/v1alpha5" - v1 "k8s.io/api/core/v1" -) - -var ( - Sp = &v1alpha5.Provisioner{ - Spec: v1alpha5.ProvisionerSpec{ - Consolidation: &v1alpha5.Consolidation{ - Enabled: to.BoolPtr(false), - }, - Taints: []v1.Taint{ - { - Key: "sku", - Value: "gpu", - Effect: v1.TaintEffectNoSchedule, - }, - }, - ProviderRef: &v1alpha5.MachineTemplateRef{ - Name: "default", - }, - }, - } -) diff --git a/pkg/tests/utils.go b/pkg/tests/utils.go deleted file mode 100644 index c7595c09..00000000 --- a/pkg/tests/utils.go +++ /dev/null @@ -1,103 +0,0 @@ -/* - Copyright (c) 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. -*/ - -package tests - -import ( - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4" - "github.com/aws/karpenter-core/pkg/apis/v1alpha5" - v1 "k8s.io/api/core/v1" - v12 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -func GetMachineObj(name string, labels map[string]string, taints []v1.Taint, resource v1alpha5.ResourceRequirements, req []v1.NodeSelectorRequirement) *v1alpha5.Machine { - return &v1alpha5.Machine{ - ObjectMeta: v12.ObjectMeta{ - Name: name, - Namespace: "machine-ns", - Labels: labels, - }, - Spec: v1alpha5.MachineSpec{ - Resources: resource, - Requirements: req, - MachineTemplateRef: &v1alpha5.MachineTemplateRef{}, - Taints: taints, - }, - } -} - -func GetAgentPoolObj(apType armcontainerservice.AgentPoolType, capacityType armcontainerservice.ScaleSetPriority, - labels map[string]*string, taints []*string, storage int32, vmSize string) armcontainerservice.AgentPool { - return armcontainerservice.AgentPool{ - Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{ - NodeLabels: labels, - NodeTaints: taints, - Type: to.Ptr(apType), - VMSize: to.Ptr(vmSize), - OSType: to.Ptr(armcontainerservice.OSTypeLinux), - Count: to.Ptr(int32(1)), - ScaleSetPriority: to.Ptr(capacityType), - OSDiskSizeGB: to.Ptr(storage), - }, - } -} - -func GetAgentPoolObjWithName(apName string, apId string, vmSize string) armcontainerservice.AgentPool { - return armcontainerservice.AgentPool{ - Name: &apName, - ID: &apId, - Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{ - VMSize: &vmSize, - NodeLabels: map[string]*string{ - "test": to.Ptr("test"), - "kaito.sh/workspace": to.Ptr("none"), - }, - }, - } -} -func GetNodeList(nodes []v1.Node) *v1.NodeList { - return &v1.NodeList{ - Items: nodes, - } -} - -var ( - ReadyNode = v1.Node{ - ObjectMeta: v12.ObjectMeta{ - Name: "aks-agentpool0-20562481-vmss_0", - Labels: map[string]string{ - "agentpool": "agentpool0", - "kubernetes.azure.com/agentpool": "agentpool0", - }, - }, - Spec: v1.NodeSpec{ - ProviderID: "azure:///subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/nodeRG/providers/Microsoft.Compute/virtualMachineScaleSets/aks-agentpool0-20562481-vmss/virtualMachines/0", - }, - Status: v1.NodeStatus{ - Conditions: []v1.NodeCondition{ - { - Type: v1.NodeReady, - Status: v1.ConditionTrue, - }, - }, - }, - } -) - -func NotFoundAzError() *azcore.ResponseError { - return &azcore.ResponseError{ErrorCode: "NotFound"} -} diff --git a/pkg/utils/gpu.go b/pkg/utils/gpu.go deleted file mode 100644 index d08051d0..00000000 --- a/pkg/utils/gpu.go +++ /dev/null @@ -1,111 +0,0 @@ -/* - Copyright (c) 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. -*/ - -package utils - -import ( - "strings" -) - -var ( - // NvidiaEnabledSKUs /* If a new GPU sku becomes available, add a key to this map, but only if you have a confirmation - NvidiaEnabledSKUs = map[string]bool{ - // K80 - "standard_nc6": true, - "standard_nc12": true, - "standard_nc24": true, - "standard_nc24r": true, - // M60 - "standard_nv6": true, - "standard_nv12": true, - "standard_nv12s_v3": true, - "standard_nv24": true, - "standard_nv24s_v3": true, - "standard_nv24r": true, - "standard_nv48s_v3": true, - // P40 - "standard_nd6s": true, - "standard_nd12s": true, - "standard_nd24s": true, - "standard_nd24rs": true, - // P100 - "standard_nc6s_v2": true, - "standard_nc12s_v2": true, - "standard_nc24s_v2": true, - "standard_nc24rs_v2": true, - // V100 - "standard_nc6s_v3": true, - "standard_nc12s_v3": true, - "standard_nc24s_v3": true, - "standard_nc24rs_v3": true, - "standard_nd40s_v3": true, - "standard_nd40rs_v2": true, - // T4 - "standard_nc4as_t4_v3": true, - "standard_nc8as_t4_v3": true, - "standard_nc16as_t4_v3": true, - "standard_nc64as_t4_v3": true, - // A100 40GB - "standard_nd96asr_v4": true, - "standard_nd112asr_a100_v4": true, - "standard_nd120asr_a100_v4": true, - // A100 80GB - "standard_nd96amsr_a100_v4": true, - "standard_nd112amsr_a100_v4": true, - "standard_nd120amsr_a100_v4": true, - // A100 PCIE 80GB - "standard_nc24ads_a100_v4": true, - "standard_nc48ads_a100_v4": true, - "standard_nc96ads_a100_v4": true, - "standard_ncads_a100_v4": true, - // A10 - "standard_nc8ads_a10_v4": true, - "standard_nc16ads_a10_v4": true, - "standard_nc32ads_a10_v4": true, - // A10, GRID only - "standard_nv6ads_a10_v5": true, - "standard_nv12ads_a10_v5": true, - "standard_nv18ads_a10_v5": true, - "standard_nv36ads_a10_v5": true, - "standard_nv36adms_a10_v5": true, - "standard_nv72ads_a10_v5": true, - // A100 - "standard_nd96ams_v4": true, - "standard_nd96ams_a100_v4": true, - } - - // MarinerNvidiaEnabledSKUs List of GPU SKUs currently enabled and validated for Mariner. Will expand the support - // to cover other SKUs available in Azure - MarinerNvidiaEnabledSKUs = map[string]bool{ - // V100 - "standard_nc6s_v3": true, - "standard_nc12s_v3": true, - "standard_nc24s_v3": true, - "standard_nc24rs_v3": true, - "standard_nd40s_v3": true, - "standard_nd40rs_v2": true, - // T4 - "standard_nc4as_t4_v3": true, - "standard_nc8as_t4_v3": true, - "standard_nc16as_t4_v3": true, - "standard_nc64as_t4_v3": true, - } -) - -// IsNvidiaEnabledSKU determines if an VM SKU has nvidia driver support -func IsNvidiaEnabledSKU(vmSize string) bool { - // Trim the optional _Promo suffix. - vmSize = strings.ToLower(vmSize) - vmSize = strings.TrimSuffix(vmSize, "_promo") - return NvidiaEnabledSKUs[vmSize] -} diff --git a/pkg/utils/utils.go b/pkg/utils/utils.go index 679ce419..73204ded 100644 --- a/pkg/utils/utils.go +++ b/pkg/utils/utils.go @@ -21,8 +21,6 @@ import ( "regexp" "strconv" "strings" - - "github.com/aws/karpenter-core/pkg/cloudprovider" ) // ParseAgentPoolNameFromID parses the id stored on the instance ID @@ -47,35 +45,6 @@ func ParseAgentPoolNameFromID(id string) (string, error) { return "", fmt.Errorf("error while parsing id %s", id) } -// ParseSubIDFromID parses the id stored on the instance ID -func ParseSubIDFromID(id string) (*string, error) { - r := regexp.MustCompile(`/subscriptions/(?P.*)/resourcegroups/.*/providers/.*`) - matches := r.FindStringSubmatch(id) - if matches == nil { - return nil, fmt.Errorf("id does not match the regxp for ParseSubIDFromID %s", id) - } - - for i, name := range r.SubexpNames() { - if name == "SubscriptionID" { - return &matches[i], nil - } - } - return nil, fmt.Errorf("error while parsing id %s", id) -} - -func GetAllSingleValuedRequirementLabels(instanceType *cloudprovider.InstanceType) map[string]string { - labels := map[string]string{} - if instanceType == nil { - return labels - } - for key, req := range instanceType.Requirements { - if req.Len() == 1 { - labels[key] = req.Values()[0] - } - } - return labels -} - // WithDefaultBool returns the boolean value of the supplied environment variable or, if not present, // the supplied default value. func WithDefaultBool(key string, def bool) bool { diff --git a/test/e2e/pkg/environment/common/environment.go b/test/e2e/pkg/environment/common/environment.go index 6ab27b94..ee8025f6 100644 --- a/test/e2e/pkg/environment/common/environment.go +++ b/test/e2e/pkg/environment/common/environment.go @@ -17,27 +17,24 @@ package common import ( "context" - "fmt" "os" + "strings" "testing" "time" "github.com/onsi/gomega" "github.com/samber/lo" - "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/client-go/kubernetes" - clientgoscheme "k8s.io/client-go/kubernetes/scheme" + "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/rest" loggingtesting "knative.dev/pkg/logging/testing" "knative.dev/pkg/system" controllerruntime "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" - - coreapis "github.com/aws/karpenter-core/pkg/apis" - "github.com/aws/karpenter-core/pkg/apis/v1alpha5" - "github.com/aws/karpenter-core/pkg/operator/injection" - "github.com/azure/gpu-provisioner/pkg/apis" - "github.com/azure/gpu-provisioner/pkg/utils/project" + _ "sigs.k8s.io/karpenter/pkg/apis/v1" + _ "sigs.k8s.io/karpenter/pkg/apis/v1beta1" + "sigs.k8s.io/karpenter/pkg/test/v1alpha1" ) type ContextKey string @@ -64,7 +61,6 @@ func NewEnvironment(t *testing.T) *Environment { lo.Must0(os.Setenv(system.NamespaceEnvKey, "gpu-provisioner")) kubernetesInterface := kubernetes.NewForConfigOrDie(config) - ctx = injection.WithSettingsOrDie(ctx, kubernetesInterface, apis.Settings...) if val, ok := os.LookupEnv("GIT_REF"); ok { ctx = context.WithValue(ctx, GitRefContextKey, val) } @@ -82,22 +78,12 @@ func NewEnvironment(t *testing.T) *Environment { func NewConfig() *rest.Config { config := controllerruntime.GetConfigOrDie() - config.UserAgent = fmt.Sprintf("%s-%s", v1alpha5.TestingGroup, project.Version) + config.UserAgent = strings.ReplaceAll(schema.GroupVersion{Group: v1alpha1.Group, Version: "v1alpha1"}.String(), "/", "-") config.QPS = 1e6 config.Burst = 1e6 return config } func NewClient(config *rest.Config) (client.Client, error) { - scheme := runtime.NewScheme() - if err := clientgoscheme.AddToScheme(scheme); err != nil { - return nil, err - } - if err := apis.AddToScheme(scheme); err != nil { - return nil, err - } - if err := coreapis.AddToScheme(scheme); err != nil { - return nil, err - } - return client.New(config, client.Options{Scheme: scheme}) + return client.New(config, client.Options{Scheme: scheme.Scheme}) } diff --git a/test/e2e/pkg/environment/common/expectation.go b/test/e2e/pkg/environment/common/expectation.go index 7be84309..df1c3d5b 100644 --- a/test/e2e/pkg/environment/common/expectation.go +++ b/test/e2e/pkg/environment/common/expectation.go @@ -38,9 +38,8 @@ import ( "knative.dev/pkg/logging" "knative.dev/pkg/ptr" "sigs.k8s.io/controller-runtime/pkg/client" - - "github.com/aws/karpenter-core/pkg/apis/v1alpha5" - "github.com/aws/karpenter-core/pkg/test" + karpenterv1 "sigs.k8s.io/karpenter/pkg/apis/v1" + "sigs.k8s.io/karpenter/pkg/test" ) func (env *Environment) ExpectCreatedWithOffset(offset int, objects ...client.Object) { @@ -315,31 +314,31 @@ func (env *Environment) EventuallyExpectInitializedNodeCount(comparator string, EventuallyWithOffset(1, func(g Gomega) { nodes = env.Monitor.CreatedNodes() nodes = lo.Filter(nodes, func(n *v1.Node, _ int) bool { - return n.Labels[v1alpha5.LabelNodeInitialized] == "true" + return n.Labels[karpenterv1.NodeInitializedLabelKey] == "true" }) g.Expect(len(nodes)).To(BeNumerically(comparator, count)) }).Should(Succeed()) return nodes } -func (env *Environment) EventuallyExpectCreatedMachineCount(comparator string, count int) []*v1alpha5.Machine { - By(fmt.Sprintf("waiting for created machines to be %s to %d", comparator, count)) - machineList := &v1alpha5.MachineList{} +func (env *Environment) EventuallyExpectCreatedNodeClaimCount(comparator string, count int) []*karpenterv1.NodeClaim { + By(fmt.Sprintf("waiting for created node claims to be %s to %d", comparator, count)) + nodeClaimList := &karpenterv1.NodeClaimList{} EventuallyWithOffset(1, func(g Gomega) { - g.Expect(env.Client.List(env.Context, machineList)).To(Succeed()) - g.Expect(len(machineList.Items)).To(BeNumerically(comparator, count)) + g.Expect(env.Client.List(env.Context, nodeClaimList)).To(Succeed()) + g.Expect(len(nodeClaimList.Items)).To(BeNumerically(comparator, count)) }).Should(Succeed()) - return lo.Map(machineList.Items, func(m v1alpha5.Machine, _ int) *v1alpha5.Machine { - return &m + return lo.Map(nodeClaimList.Items, func(nc karpenterv1.NodeClaim, _ int) *karpenterv1.NodeClaim { + return &nc }) } -func (env *Environment) EventuallyExpectMachinesReady(machines ...*v1alpha5.Machine) { +func (env *Environment) EventuallyExpectNodeClaimsReady(objects ...client.Object) { Eventually(func(g Gomega) { - for _, machine := range machines { - temp := &v1alpha5.Machine{} - g.Expect(env.Client.Get(env.Context, client.ObjectKeyFromObject(machine), temp)).Should(Succeed()) - g.Expect(temp.StatusConditions().IsHappy()).To(BeTrue()) + for _, object := range objects { + temp := &karpenterv1.NodeClaim{} + g.Expect(env.Client.Get(env.Context, client.ObjectKeyFromObject(object), temp)).Should(Succeed()) + g.Expect(temp.StatusConditions().Root().IsTrue()).To(BeTrue()) } }).Should(Succeed()) } diff --git a/test/e2e/pkg/environment/common/monitor.go b/test/e2e/pkg/environment/common/monitor.go index 730707ae..5f31b03f 100644 --- a/test/e2e/pkg/environment/common/monitor.go +++ b/test/e2e/pkg/environment/common/monitor.go @@ -20,15 +20,13 @@ import ( "fmt" "sync" + "github.com/samber/lo" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/util/sets" "knative.dev/pkg/logging" "sigs.k8s.io/controller-runtime/pkg/client" - - "github.com/samber/lo" - - "github.com/aws/karpenter-core/pkg/utils/resources" + "sigs.k8s.io/karpenter/pkg/utils/resources" ) // Monitor is used to monitor the cluster state during a running test @@ -190,6 +188,9 @@ func (m *Monitor) poll() state { if pod.Spec.NodeName == "" { continue } + if st.nodePods[pod.Spec.NodeName] == nil { + st.nodePods[pod.Spec.NodeName] = []*v1.Pod{} + } st.nodePods[pod.Spec.NodeName] = append(st.nodePods[pod.Spec.NodeName], pod) } diff --git a/test/e2e/pkg/environment/common/setup.go b/test/e2e/pkg/environment/common/setup.go index 548a94be..005a82f6 100644 --- a/test/e2e/pkg/environment/common/setup.go +++ b/test/e2e/pkg/environment/common/setup.go @@ -16,10 +16,10 @@ limitations under the License. package common import ( + "fmt" "sync" "time" - "github.com/aws/karpenter-core/pkg/test" . "github.com/onsi/ginkgo/v2" //nolint:revive,stylecheck . "github.com/onsi/gomega" //nolint:revive,stylecheck "github.com/samber/lo" @@ -29,24 +29,21 @@ import ( "k8s.io/client-go/util/workqueue" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/apiutil" - - "github.com/aws/karpenter-core/pkg/apis" - "github.com/aws/karpenter-core/pkg/apis/v1alpha5" - "github.com/aws/karpenter-core/pkg/operator/injection" + karpenterv1 "sigs.k8s.io/karpenter/pkg/apis/v1" + "sigs.k8s.io/karpenter/pkg/test" ) var ( CleanableObjects = []client.Object{ &v1.Pod{}, &appsv1.Deployment{}, - &v1alpha5.Machine{}, + &karpenterv1.NodeClaim{}, &v1.Node{}, } ) // nolint:gocyclo func (env *Environment) BeforeEach() { - env.Context = injection.WithSettingsOrDie(env.Context, env.KubeClient, apis.Settings...) env.StartingNodeCount = env.Monitor.NodeCount() } @@ -66,25 +63,25 @@ func (env *Environment) CleanupObjects(cleanableObjects ...client.Object) { defer wg.Done() defer GinkgoRecover() + gvk := lo.Must(apiutil.GVKForObject(obj, env.Client.Scheme())) // This only gets the metadata for the objects since we don't need all the details of the objects metaList := &metav1.PartialObjectMetadataList{} - metaList.SetGroupVersionKind(lo.Must(apiutil.GVKForObject(obj, env.Client.Scheme()))) + metaList.SetGroupVersionKind(gvk) Expect(env.Client.List(env, metaList, client.HasLabels([]string{test.DiscoveryLabel}))).To(Succeed()) // Limit the concurrency of these calls to 50 workers per object so that we try to limit how aggressively we // are deleting so that we avoid getting client-side throttled workqueue.ParallelizeUntil(env, 50, len(metaList.Items), func(i int) { defer GinkgoRecover() Eventually(func(g Gomega) { - metaList = &metav1.PartialObjectMetadataList{} - metaList.SetGroupVersionKind(lo.Must(apiutil.GVKForObject(obj, env.Client.Scheme()))) - g.Expect(env.Client.List(env, metaList, client.HasLabels([]string{test.DiscoveryLabel}))).To(Succeed()) g.Expect(client.IgnoreNotFound(env.Client.Delete(env, &metaList.Items[i], client.PropagationPolicy(metav1.DeletePropagationForeground)))).To(Succeed()) }).WithPolling(time.Second).Should(Succeed()) }) Eventually(func(g Gomega) { metaList = &metav1.PartialObjectMetadataList{} - metaList.SetGroupVersionKind(lo.Must(apiutil.GVKForObject(obj, env.Client.Scheme()))) - g.Expect(len(metaList.Items)).To(BeZero()) + metaList.SetGroupVersionKind(gvk) + err := env.Client.List(env, metaList, client.HasLabels([]string{test.DiscoveryLabel})) + g.Expect(err).To(Succeed()) + g.Expect(len(metaList.Items)).To(BeZero(), fmt.Sprintf("Not all objects(%s) are deleted", gvk.String())) }).WithPolling(time.Second * 10).Should(Succeed()) }(obj) } diff --git a/test/e2e/suites/suite_test.go b/test/e2e/suites/suite_test.go index a358ad85..e7794518 100644 --- a/test/e2e/suites/suite_test.go +++ b/test/e2e/suites/suite_test.go @@ -16,25 +16,28 @@ limitations under the License. package suites import ( + "fmt" "testing" - "github.com/aws/karpenter-core/pkg/apis/v1alpha5" - "github.com/aws/karpenter-core/pkg/test" "github.com/azure/gpu-provisioner/test/e2e/pkg/environment/common" + "github.com/imdario/mergo" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + karpenterv1 "sigs.k8s.io/karpenter/pkg/apis/v1" + karpenterv1beta1 "sigs.k8s.io/karpenter/pkg/apis/v1beta1" + "sigs.k8s.io/karpenter/pkg/test" ) var env *common.Environment -func TestGPUMachine(t *testing.T) { +func TestGPUNodeClaim(t *testing.T) { RegisterFailHandler(Fail) BeforeSuite(func() { env = common.NewEnvironment(t) }) - RunSpecs(t, "GPU Machine") + RunSpecs(t, "GPU NodeClaim") } var _ = BeforeEach(func() { env.BeforeEach() }) @@ -43,33 +46,45 @@ var _ = AfterEach(func() { env.AfterEach() }) -var _ = Describe("GPU Machine", func() { +var _ = Describe("GPU NodeClaim", func() { - It("should provision one GPU node ", func() { - machineLabels := map[string]string{ + It("should provision one GPU node for v1.NodeClaim", func() { + nodeClaimLabels := map[string]string{ "karpenter.sh/provisioner-name": "default", "kaito.sh/workspace": "none", } - machine := test.Machine(v1alpha5.Machine{ + nc := test.NodeClaim(karpenterv1.NodeClaim{ ObjectMeta: metav1.ObjectMeta{ - Name: "testmachine", - Labels: machineLabels, + Name: "testnodeclaim", + Labels: nodeClaimLabels, }, - Spec: v1alpha5.MachineSpec{ - MachineTemplateRef: &v1alpha5.MachineTemplateRef{ - Name: "test-machine", + Spec: karpenterv1.NodeClaimSpec{ + NodeClassRef: &karpenterv1.NodeClassReference{ + Name: "default", + Kind: "AKSNodeClass", }, - Requirements: []v1.NodeSelectorRequirement{ + Requirements: []karpenterv1.NodeSelectorRequirementWithMinValues{ { - Key: v1.LabelInstanceTypeStable, - Operator: v1.NodeSelectorOpIn, - Values: []string{"Standard_NC12s_v3"}, + NodeSelectorRequirement: v1.NodeSelectorRequirement{ + Key: v1.LabelInstanceTypeStable, + Operator: v1.NodeSelectorOpIn, + Values: []string{"Standard_NC12s_v3"}, + }, }, { - Key: "karpenter.sh/provisioner-name", - Operator: v1.NodeSelectorOpIn, - Values: []string{"default"}, + NodeSelectorRequirement: v1.NodeSelectorRequirement{ + Key: karpenterv1.NodePoolLabelKey, + Operator: v1.NodeSelectorOpIn, + Values: []string{"kaito"}, + }, + }, + { + NodeSelectorRequirement: v1.NodeSelectorRequirement{ + Key: v1.LabelOSStable, + Operator: v1.NodeSelectorOpIn, + Values: []string{"linux"}, + }, }, }, Taints: []v1.Taint{ @@ -83,43 +98,55 @@ var _ = Describe("GPU Machine", func() { }) DeferCleanup(func() { - env.ExpectDeleted(machine) - env.EventuallyExpectCreatedMachineCount("==", 0) + env.ExpectDeleted(nc) + env.EventuallyExpectCreatedNodeClaimCount("==", 0) env.EventuallyExpectNodeCount("==", 0) }) - env.ExpectCreated(machine) - env.EventuallyExpectCreatedMachineCount("==", 1) - env.EventuallyExpectMachinesReady(machine) + env.ExpectCreated(nc) + env.EventuallyExpectCreatedNodeClaimCount("==", 1) + env.EventuallyExpectNodeClaimsReady(nc) env.EventuallyExpectNodeCount("==", 1) _ = env.EventuallyExpectInitializedNodeCount("==", 1)[0] }) It("should provision one GPU node with RAGEngine label ", func() { - machineLabels := map[string]string{ + nodeClaimLabels := map[string]string{ "karpenter.sh/provisioner-name": "default", "kaito.sh/ragengine": "none", } - machine := test.Machine(v1alpha5.Machine{ + nc := test.NodeClaim(karpenterv1.NodeClaim{ ObjectMeta: metav1.ObjectMeta{ - Name: "testmachine", - Labels: machineLabels, + Name: "testnodeclaim", + Labels: nodeClaimLabels, }, - Spec: v1alpha5.MachineSpec{ - MachineTemplateRef: &v1alpha5.MachineTemplateRef{ - Name: "test-machine", + Spec: karpenterv1.NodeClaimSpec{ + NodeClassRef: &karpenterv1.NodeClassReference{ + Name: "default", + Kind: "AKSNodeClass", }, - Requirements: []v1.NodeSelectorRequirement{ + Requirements: []karpenterv1.NodeSelectorRequirementWithMinValues{ { - Key: v1.LabelInstanceTypeStable, - Operator: v1.NodeSelectorOpIn, - Values: []string{"Standard_NC12s_v3"}, + NodeSelectorRequirement: v1.NodeSelectorRequirement{ + Key: v1.LabelInstanceTypeStable, + Operator: v1.NodeSelectorOpIn, + Values: []string{"Standard_NC12s_v3"}, + }, }, { - Key: "karpenter.sh/provisioner-name", - Operator: v1.NodeSelectorOpIn, - Values: []string{"default"}, + NodeSelectorRequirement: v1.NodeSelectorRequirement{ + Key: karpenterv1.NodePoolLabelKey, + Operator: v1.NodeSelectorOpIn, + Values: []string{"kaito"}, + }, + }, + { + NodeSelectorRequirement: v1.NodeSelectorRequirement{ + Key: v1.LabelOSStable, + Operator: v1.NodeSelectorOpIn, + Values: []string{"linux"}, + }, }, }, Taints: []v1.Taint{ @@ -132,16 +159,107 @@ var _ = Describe("GPU Machine", func() { }, }) DeferCleanup(func() { - env.ExpectDeleted(machine) - env.EventuallyExpectCreatedMachineCount("==", 0) + env.ExpectDeleted(nc) + env.EventuallyExpectCreatedNodeClaimCount("==", 0) env.EventuallyExpectNodeCount("==", 0) }) - env.ExpectCreated(machine) - env.EventuallyExpectCreatedMachineCount("==", 1) - env.EventuallyExpectMachinesReady(machine) + env.ExpectCreated(nc) + env.EventuallyExpectCreatedNodeClaimCount("==", 1) + env.EventuallyExpectNodeClaimsReady(nc) env.EventuallyExpectNodeCount("==", 1) _ = env.EventuallyExpectInitializedNodeCount("==", 1)[0] }) + It("should provision one GPU node for v1beta1.NodeClaim", func() { + nodeClaimLabels := map[string]string{ + "karpenter.sh/provisioner-name": "default", + "kaito.sh/workspace": "none", + } + + nc := V1beta1NodeClaim(karpenterv1beta1.NodeClaim{ + ObjectMeta: metav1.ObjectMeta{ + Name: "testnodeclaim", + Labels: nodeClaimLabels, + }, + Spec: karpenterv1beta1.NodeClaimSpec{ + NodeClassRef: &karpenterv1beta1.NodeClassReference{ + Name: "default", + Kind: "AKSNodeClass", + }, + Requirements: []karpenterv1beta1.NodeSelectorRequirementWithMinValues{ + { + NodeSelectorRequirement: v1.NodeSelectorRequirement{ + Key: v1.LabelInstanceTypeStable, + Operator: v1.NodeSelectorOpIn, + Values: []string{"Standard_NC12s_v3"}, + }, + }, + { + NodeSelectorRequirement: v1.NodeSelectorRequirement{ + Key: karpenterv1.NodePoolLabelKey, + Operator: v1.NodeSelectorOpIn, + Values: []string{"kaito"}, + }, + }, + { + NodeSelectorRequirement: v1.NodeSelectorRequirement{ + Key: v1.LabelOSStable, + Operator: v1.NodeSelectorOpIn, + Values: []string{"linux"}, + }, + }, + }, + Taints: []v1.Taint{ + { + Key: "sku", + Value: "gpu", + Effect: v1.TaintEffectNoSchedule, + }, + }, + }, + }) + + DeferCleanup(func() { + env.ExpectDeleted(nc) + env.EventuallyExpectCreatedNodeClaimCount("==", 0) + env.EventuallyExpectNodeCount("==", 0) + }) + + env.ExpectCreated(nc) + env.EventuallyExpectCreatedNodeClaimCount("==", 1) + env.EventuallyExpectNodeClaimsReady(nc) + env.EventuallyExpectNodeCount("==", 1) + _ = env.EventuallyExpectInitializedNodeCount("==", 1)[0] + }) }) + +// V1beta1NodeClaim creates a test v1beta1.NodeClaim with defaults that can be overridden by overrides. +// Overrides are applied in order, with a last write wins semantic. +func V1beta1NodeClaim(overrides ...karpenterv1beta1.NodeClaim) *karpenterv1beta1.NodeClaim { + override := karpenterv1beta1.NodeClaim{} + for _, opts := range overrides { + if err := mergo.Merge(&override, opts, mergo.WithOverride); err != nil { + panic(fmt.Sprintf("failed to merge: %v", err)) + } + } + if override.Name == "" { + override.Name = test.RandomName() + } + if override.Status.ProviderID == "" { + override.Status.ProviderID = test.RandomProviderID() + } + if override.Spec.NodeClassRef == nil { + override.Spec.NodeClassRef = &karpenterv1beta1.NodeClassReference{ + Name: "default", + } + } + if override.Spec.Requirements == nil { + override.Spec.Requirements = []karpenterv1beta1.NodeSelectorRequirementWithMinValues{} + } + return &karpenterv1beta1.NodeClaim{ + ObjectMeta: test.ObjectMeta(override.ObjectMeta), + Spec: override.Spec, + Status: override.Status, + } +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go-extensions/pkg/errors/armerrors.go b/vendor/github.com/Azure/azure-sdk-for-go-extensions/pkg/errors/armerrors.go index cada7977..e9209162 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go-extensions/pkg/errors/armerrors.go +++ b/vendor/github.com/Azure/azure-sdk-for-go-extensions/pkg/errors/armerrors.go @@ -37,14 +37,46 @@ func IsNotFoundErr(err error) bool { return azErr != nil && azErr.ErrorCode == ResourceNotFound } +// ZonalAllocationFailureOccurred communicates if we have failed to allocate a resource in a zone, and should try another zone. +// To learn more about zonal allocation failures, visit: http://aka.ms/allocation-guidance +func ZonalAllocationFailureOccurred(err error) bool { + azErr := IsResponseError(err) + return azErr != nil && azErr.ErrorCode == ZoneAllocationFailed +} + +// SKUFamilyQuotaHasBeenReached tells us if we have exceeded our Quota. +func SKUFamilyQuotaHasBeenReached(err error) bool { + azErr := IsResponseError(err) + return azErr != nil && azErr.ErrorCode == OperationNotAllowed && strings.Contains(azErr.Error(), SKUFamilyQuotaExceededTerm) +} + // SubscriptionQuotaHasBeenReached tells us if we have exceeded our Quota. func SubscriptionQuotaHasBeenReached(err error) bool { azErr := IsResponseError(err) return azErr != nil && azErr.ErrorCode == OperationNotAllowed && strings.Contains(azErr.Error(), SubscriptionQuotaExceededTerm) } -// RegionalQuotaHasBeenReached communicates if we have reached the quota for a given region. + +// RegionalQuotaHasBeenReached communicates if we have reached the quota limit for a given region under a specific subscription func RegionalQuotaHasBeenReached(err error) bool { azErr := IsResponseError(err) return azErr != nil && azErr.ErrorCode == OperationNotAllowed && strings.Contains(azErr.Error(), RegionalQuotaExceededTerm) } + +// LowPriorityQuotaHasBeenReached communicates if we have reached the quota limit for low priority VMs under a specific subscription +// Low priority VMs are generally Spot VMs, but can also be low priority VMs created via the Azure CLI or Azure Portal +func LowPriorityQuotaHasBeenReached(err error) bool { + azErr := IsResponseError(err) + return azErr != nil && azErr.ErrorCode == OperationNotAllowed && strings.Contains(azErr.Error(), LowPriorityQuotaExceededTerm) +} +// IsNicReservedForAnotherVM occurs when a NIC is associated with another VM during deletion. See https://aka.ms/deletenic +func IsNicReservedForAnotherVM(err error) bool { + azErr := IsResponseError(err) + return azErr != nil && azErr.ErrorCode == NicReservedForAnotherVM +} + +// IsSKUNotAvailable https://aka.ms/azureskunotavailable: either not available for a location or zone, or out of capacity for Spot. +func IsSKUNotAvailable(err error) bool { + azErr := IsResponseError(err) + return azErr != nil && azErr.ErrorCode == SKUNotAvailableErrorCode +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go-extensions/pkg/errors/consts.go b/vendor/github.com/Azure/azure-sdk-for-go-extensions/pkg/errors/consts.go index 80317a22..c4e28674 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go-extensions/pkg/errors/consts.go +++ b/vendor/github.com/Azure/azure-sdk-for-go-extensions/pkg/errors/consts.go @@ -1,14 +1,18 @@ package errors const ( - // Azure Resource Errors - // ResourceNotFound is a const used to reference if we are missing a resource from azure - ResourceNotFound = "ResourceNotFound" - - OperationNotAllowed = "OperationNotAllowed" + // Error codes + ResourceNotFound = "ResourceNotFound" + OperationNotAllowed = "OperationNotAllowed" + ZoneAllocationFailed = "ZonalAllocationFailed" + NicReservedForAnotherVM = "NicReservedForAnotherVm" + SKUNotAvailableErrorCode = "SkuNotAvailable" + // Error search terms + LowPriorityQuotaExceededTerm = "LowPriorityCores" + SKUFamilyQuotaExceededTerm = "Family Cores quota" SubscriptionQuotaExceededTerm = "Submit a request for Quota increase" RegionalQuotaExceededTerm = "exceeding approved Total Regional Cores quota" ) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/CHANGELOG.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/CHANGELOG.md index a6675492..af095f1d 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/CHANGELOG.md +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/CHANGELOG.md @@ -1,5 +1,20 @@ # Release History +## 1.12.0 (2024-06-06) + +### Features Added + +* Added field `StatusCodes` to `runtime.FetcherForNextLinkOptions` allowing for additional HTTP status codes indicating success. +* Added func `NewUUID` to the `runtime` package for generating UUIDs. + +### Bugs Fixed + +* Fixed an issue that prevented pollers using the `Operation-Location` strategy from unmarshaling the final result in some cases. + +### Other Changes + +* Updated dependencies. + ## 1.11.1 (2024-04-02) ### Bugs Fixed diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/async/async.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/async/async.go index ccd4794e..a5346276 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/async/async.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/async/async.go @@ -155,5 +155,5 @@ func (p *Poller[T]) Result(ctx context.Context, out *T) error { p.resp = resp } - return pollers.ResultHelper(p.resp, poller.Failed(p.CurState), out) + return pollers.ResultHelper(p.resp, poller.Failed(p.CurState), "", out) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/body/body.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/body/body.go index 0d781b31..8751b051 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/body/body.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/body/body.go @@ -131,5 +131,5 @@ func (p *Poller[T]) Poll(ctx context.Context) (*http.Response, error) { } func (p *Poller[T]) Result(ctx context.Context, out *T) error { - return pollers.ResultHelper(p.resp, poller.Failed(p.CurState), out) + return pollers.ResultHelper(p.resp, poller.Failed(p.CurState), "", out) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/fake/fake.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/fake/fake.go index 51aede8a..7f8d11b8 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/fake/fake.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/fake/fake.go @@ -124,7 +124,7 @@ func (p *Poller[T]) Result(ctx context.Context, out *T) error { return exported.NewResponseError(p.resp) } - return pollers.ResultHelper(p.resp, poller.Failed(p.FakeStatus), out) + return pollers.ResultHelper(p.resp, poller.Failed(p.FakeStatus), "", out) } // SanitizePollerPath removes any fake-appended suffix from a URL's path. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/loc/loc.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/loc/loc.go index 7a56c521..04828527 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/loc/loc.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/loc/loc.go @@ -119,5 +119,5 @@ func (p *Poller[T]) Poll(ctx context.Context) (*http.Response, error) { } func (p *Poller[T]) Result(ctx context.Context, out *T) error { - return pollers.ResultHelper(p.resp, poller.Failed(p.CurState), out) + return pollers.ResultHelper(p.resp, poller.Failed(p.CurState), "", out) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/op/op.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/op/op.go index ac1c0efb..03699fd7 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/op/op.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/op/op.go @@ -115,10 +115,13 @@ func (p *Poller[T]) Poll(ctx context.Context) (*http.Response, error) { func (p *Poller[T]) Result(ctx context.Context, out *T) error { var req *exported.Request var err error + + // when the payload is included with the status monitor on + // terminal success it's in the "result" JSON property + payloadPath := "result" + if p.FinalState == pollers.FinalStateViaLocation && p.LocURL != "" { req, err = exported.NewRequest(ctx, http.MethodGet, p.LocURL) - } else if p.FinalState == pollers.FinalStateViaOpLocation && p.Method == http.MethodPost { - // no final GET required, terminal response should have it } else if rl, rlErr := poller.GetResourceLocation(p.resp); rlErr != nil && !errors.Is(rlErr, poller.ErrNoBody) { return rlErr } else if rl != "" { @@ -134,6 +137,8 @@ func (p *Poller[T]) Result(ctx context.Context, out *T) error { // if a final GET request has been created, execute it if req != nil { + // no JSON path when making a final GET request + payloadPath = "" resp, err := p.pl.Do(req) if err != nil { return err @@ -141,5 +146,5 @@ func (p *Poller[T]) Result(ctx context.Context, out *T) error { p.resp = resp } - return pollers.ResultHelper(p.resp, poller.Failed(p.CurState), out) + return pollers.ResultHelper(p.resp, poller.Failed(p.CurState), payloadPath, out) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/util.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/util.go index eb3cf651..6a7a32e0 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/util.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/util.go @@ -159,7 +159,7 @@ func PollHelper(ctx context.Context, endpoint string, pl azexported.Pipeline, up // ResultHelper processes the response as success or failure. // In the success case, it unmarshals the payload into either a new instance of T or out. // In the failure case, it creates an *azcore.Response error from the response. -func ResultHelper[T any](resp *http.Response, failed bool, out *T) error { +func ResultHelper[T any](resp *http.Response, failed bool, jsonPath string, out *T) error { // short-circuit the simple success case with no response body to unmarshal if resp.StatusCode == http.StatusNoContent { return nil @@ -176,6 +176,18 @@ func ResultHelper[T any](resp *http.Response, failed bool, out *T) error { if err != nil { return err } + + if jsonPath != "" && len(payload) > 0 { + // extract the payload from the specified JSON path. + // do this before the zero-length check in case there + // is no payload. + jsonBody := map[string]json.RawMessage{} + if err = json.Unmarshal(payload, &jsonBody); err != nil { + return err + } + payload = jsonBody[jsonPath] + } + if len(payload) == 0 { return nil } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared/constants.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared/constants.go index 03691cbf..79651fd9 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared/constants.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared/constants.go @@ -40,5 +40,5 @@ const ( Module = "azcore" // Version is the semantic version (see http://semver.org) of this module. - Version = "v1.11.1" + Version = "v1.12.0" ) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/pager.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/pager.go index cffe692d..b960cff0 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/pager.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/pager.go @@ -94,6 +94,10 @@ type FetcherForNextLinkOptions struct { // NextReq is the func to be called when requesting subsequent pages. // Used for paged operations that have a custom next link operation. NextReq func(context.Context, string) (*policy.Request, error) + + // StatusCodes contains additional HTTP status codes indicating success. + // The default value is http.StatusOK. + StatusCodes []int } // FetcherForNextLink is a helper containing boilerplate code to simplify creating a PagingHandler[T].Fetcher from a next link URL. @@ -105,10 +109,13 @@ type FetcherForNextLinkOptions struct { func FetcherForNextLink(ctx context.Context, pl Pipeline, nextLink string, firstReq func(context.Context) (*policy.Request, error), options *FetcherForNextLinkOptions) (*http.Response, error) { var req *policy.Request var err error + if options == nil { + options = &FetcherForNextLinkOptions{} + } if nextLink == "" { req, err = firstReq(ctx) } else if nextLink, err = EncodeQueryParams(nextLink); err == nil { - if options != nil && options.NextReq != nil { + if options.NextReq != nil { req, err = options.NextReq(ctx, nextLink) } else { req, err = NewRequest(ctx, http.MethodGet, nextLink) @@ -121,7 +128,9 @@ func FetcherForNextLink(ctx context.Context, pl Pipeline, nextLink string, first if err != nil { return nil, err } - if !HasStatusCode(resp, http.StatusOK) { + successCodes := []int{http.StatusOK} + successCodes = append(successCodes, options.StatusCodes...) + if !HasStatusCode(resp, successCodes...) { return nil, NewResponseError(resp) } return resp, nil diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/request.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/request.go index 06ac95b1..40ddc8d9 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/request.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/request.go @@ -24,6 +24,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/streaming" + "github.com/Azure/azure-sdk-for-go/sdk/internal/uuid" ) // Base64Encoding is usesd to specify which base-64 encoder/decoder to use when @@ -263,3 +264,12 @@ func SkipBodyDownload(req *policy.Request) { // CtxAPINameKey is used as a context key for adding/retrieving the API name. type CtxAPINameKey = shared.CtxAPINameKey + +// NewUUID returns a new UUID using the RFC4122 algorithm. +func NewUUID() (string, error) { + u, err := uuid.New() + if err != nil { + return "", err + } + return u.String(), nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/.gitignore b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/.gitignore deleted file mode 100644 index 8cdb9103..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# live test artifacts -Dockerfile -k8s.yaml -sshkey* diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/CHANGELOG.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/CHANGELOG.md deleted file mode 100644 index 6d4b6feb..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/CHANGELOG.md +++ /dev/null @@ -1,551 +0,0 @@ -# Release History - -## 1.6.0 (2024-06-10) - -### Features Added -* `NewOnBehalfOfCredentialWithClientAssertions` creates an on-behalf-of credential - that authenticates with client assertions such as federated credentials - -### Breaking Changes -> These changes affect only code written against a beta version such as v1.6.0-beta.4 -* Removed `AzurePipelinesCredential` and the persistent token caching API. - They will return in v1.7.0-beta.1 - -### Bugs Fixed -* Managed identity bug fixes - -## 1.6.0-beta.4 (2024-05-14) - -### Features Added -* `AzurePipelinesCredential` authenticates an Azure Pipeline service connection with - workload identity federation - -## 1.6.0-beta.3 (2024-04-09) - -### Breaking Changes -* `DefaultAzureCredential` now sends a probe request with no retries for IMDS managed identity - environments to avoid excessive retry delays when the IMDS endpoint is not available. This - should improve credential chain resolution for local development scenarios. - -### Bugs Fixed -* `ManagedIdentityCredential` now specifies resource IDs correctly for Azure Container Instances - -## 1.5.2 (2024-04-09) - -### Bugs Fixed -* `ManagedIdentityCredential` now specifies resource IDs correctly for Azure Container Instances - -### Other Changes -* Restored v1.4.0 error behavior for empty tenant IDs -* Upgraded dependencies - -## 1.6.0-beta.2 (2024-02-06) - -### Breaking Changes -> These changes affect only code written against a beta version such as v1.6.0-beta.1 -* Replaced `ErrAuthenticationRequired` with `AuthenticationRequiredError`, a struct - type that carries the `TokenRequestOptions` passed to the `GetToken` call which - returned the error. - -### Bugs Fixed -* Fixed more cases in which credential chains like `DefaultAzureCredential` - should try their next credential after attempting managed identity - authentication in a Docker Desktop container - -### Other Changes -* `AzureCLICredential` uses the CLI's `expires_on` value for token expiration - -## 1.6.0-beta.1 (2024-01-17) - -### Features Added -* Restored persistent token caching API first added in v1.5.0-beta.1 -* Added `AzureCLICredentialOptions.Subscription` - -## 1.5.1 (2024-01-17) - -### Bugs Fixed -* `InteractiveBrowserCredential` handles `AdditionallyAllowedTenants` correctly - -## 1.5.0 (2024-01-16) - -### Breaking Changes -> These changes affect only code written against a beta version such as v1.5.0-beta.1 -* Removed persistent token caching. It will return in v1.6.0-beta.1 - -### Bugs Fixed -* Credentials now preserve MSAL headers e.g. X-Client-Sku - -### Other Changes -* Upgraded dependencies - -## 1.5.0-beta.2 (2023-11-07) - -### Features Added -* `DefaultAzureCredential` and `ManagedIdentityCredential` support Azure ML managed identity -* Added spans for distributed tracing. - -## 1.5.0-beta.1 (2023-10-10) - -### Features Added -* Optional persistent token caching for most credentials. Set `TokenCachePersistenceOptions` - on a credential's options to enable and configure this. See the package documentation for - this version and [TOKEN_CACHING.md](https://aka.ms/azsdk/go/identity/caching) for more - details. -* `AzureDeveloperCLICredential` authenticates with the Azure Developer CLI (`azd`). This - credential is also part of the `DefaultAzureCredential` authentication flow. - -## 1.4.0 (2023-10-10) - -### Bugs Fixed -* `ManagedIdentityCredential` will now retry when IMDS responds 410 or 503 - -## 1.4.0-beta.5 (2023-09-12) - -### Features Added -* Service principal credentials can request CAE tokens - -### Breaking Changes -> These changes affect only code written against a beta version such as v1.4.0-beta.4 -* Whether `GetToken` requests a CAE token is now determined by `TokenRequestOptions.EnableCAE`. Azure - SDK clients which support CAE will set this option automatically. Credentials no longer request CAE - tokens by default or observe the environment variable "AZURE_IDENTITY_DISABLE_CP1". - -### Bugs Fixed -* Credential chains such as `DefaultAzureCredential` now try their next credential, if any, when - managed identity authentication fails in a Docker Desktop container - ([#21417](https://github.com/Azure/azure-sdk-for-go/issues/21417)) - -## 1.4.0-beta.4 (2023-08-16) - -### Other Changes -* Upgraded dependencies - -## 1.3.1 (2023-08-16) - -### Other Changes -* Upgraded dependencies - -## 1.4.0-beta.3 (2023-08-08) - -### Bugs Fixed -* One invocation of `AzureCLICredential.GetToken()` and `OnBehalfOfCredential.GetToken()` - can no longer make two authentication attempts - -## 1.4.0-beta.2 (2023-07-14) - -### Other Changes -* `DefaultAzureCredentialOptions.TenantID` applies to workload identity authentication -* Upgraded dependencies - -## 1.4.0-beta.1 (2023-06-06) - -### Other Changes -* Re-enabled CAE support as in v1.3.0-beta.3 - -## 1.3.0 (2023-05-09) - -### Breaking Changes -> These changes affect only code written against a beta version such as v1.3.0-beta.5 -* Renamed `NewOnBehalfOfCredentialFromCertificate` to `NewOnBehalfOfCredentialWithCertificate` -* Renamed `NewOnBehalfOfCredentialFromSecret` to `NewOnBehalfOfCredentialWithSecret` - -### Other Changes -* Upgraded to MSAL v1.0.0 - -## 1.3.0-beta.5 (2023-04-11) - -### Breaking Changes -> These changes affect only code written against a beta version such as v1.3.0-beta.4 -* Moved `NewWorkloadIdentityCredential()` parameters into `WorkloadIdentityCredentialOptions`. - The constructor now reads default configuration from environment variables set by the Azure - workload identity webhook by default. - ([#20478](https://github.com/Azure/azure-sdk-for-go/pull/20478)) -* Removed CAE support. It will return in v1.4.0-beta.1 - ([#20479](https://github.com/Azure/azure-sdk-for-go/pull/20479)) - -### Bugs Fixed -* Fixed an issue in `DefaultAzureCredential` that could cause the managed identity endpoint check to fail in rare circumstances. - -## 1.3.0-beta.4 (2023-03-08) - -### Features Added -* Added `WorkloadIdentityCredentialOptions.AdditionallyAllowedTenants` and `.DisableInstanceDiscovery` - -### Bugs Fixed -* Credentials now synchronize within `GetToken()` so a single instance can be shared among goroutines - ([#20044](https://github.com/Azure/azure-sdk-for-go/issues/20044)) - -### Other Changes -* Upgraded dependencies - -## 1.2.2 (2023-03-07) - -### Other Changes -* Upgraded dependencies - -## 1.3.0-beta.3 (2023-02-07) - -### Features Added -* By default, credentials set client capability "CP1" to enable support for - [Continuous Access Evaluation (CAE)](https://learn.microsoft.com/entra/identity-platform/app-resilience-continuous-access-evaluation). - This indicates to Microsoft Entra ID that your application can handle CAE claims challenges. - You can disable this behavior by setting the environment variable "AZURE_IDENTITY_DISABLE_CP1" to "true". -* `InteractiveBrowserCredentialOptions.LoginHint` enables pre-populating the login - prompt with a username ([#15599](https://github.com/Azure/azure-sdk-for-go/pull/15599)) -* Service principal and user credentials support ADFS authentication on Azure Stack. - Specify "adfs" as the credential's tenant. -* Applications running in private or disconnected clouds can prevent credentials from - requesting Microsoft Entra instance metadata by setting the `DisableInstanceDiscovery` - field on credential options. -* Many credentials can now be configured to authenticate in multiple tenants. The - options types for these credentials have an `AdditionallyAllowedTenants` field - that specifies additional tenants in which the credential may authenticate. - -## 1.3.0-beta.2 (2023-01-10) - -### Features Added -* Added `OnBehalfOfCredential` to support the on-behalf-of flow - ([#16642](https://github.com/Azure/azure-sdk-for-go/issues/16642)) - -### Bugs Fixed -* `AzureCLICredential` reports token expiration in local time (should be UTC) - -### Other Changes -* `AzureCLICredential` imposes its default timeout only when the `Context` - passed to `GetToken()` has no deadline -* Added `NewCredentialUnavailableError()`. This function constructs an error indicating - a credential can't authenticate and an encompassing `ChainedTokenCredential` should - try its next credential, if any. - -## 1.3.0-beta.1 (2022-12-13) - -### Features Added -* `WorkloadIdentityCredential` and `DefaultAzureCredential` support - Workload Identity Federation on Kubernetes. `DefaultAzureCredential` - support requires environment variable configuration as set by the - Workload Identity webhook. - ([#15615](https://github.com/Azure/azure-sdk-for-go/issues/15615)) - -## 1.2.0 (2022-11-08) - -### Other Changes -* This version includes all fixes and features from 1.2.0-beta.* - -## 1.2.0-beta.3 (2022-10-11) - -### Features Added -* `ManagedIdentityCredential` caches tokens in memory - -### Bugs Fixed -* `ClientCertificateCredential` sends only the leaf cert for SNI authentication - -## 1.2.0-beta.2 (2022-08-10) - -### Features Added -* Added `ClientAssertionCredential` to enable applications to authenticate - with custom client assertions - -### Other Changes -* Updated AuthenticationFailedError with links to TROUBLESHOOTING.md for relevant errors -* Upgraded `microsoft-authentication-library-for-go` requirement to v0.6.0 - -## 1.2.0-beta.1 (2022-06-07) - -### Features Added -* `EnvironmentCredential` reads certificate passwords from `AZURE_CLIENT_CERTIFICATE_PASSWORD` - ([#17099](https://github.com/Azure/azure-sdk-for-go/pull/17099)) - -## 1.1.0 (2022-06-07) - -### Features Added -* `ClientCertificateCredential` and `ClientSecretCredential` support ESTS-R. First-party - applications can set environment variable `AZURE_REGIONAL_AUTHORITY_NAME` with a - region name. - ([#15605](https://github.com/Azure/azure-sdk-for-go/issues/15605)) - -## 1.0.1 (2022-06-07) - -### Other Changes -* Upgrade `microsoft-authentication-library-for-go` requirement to v0.5.1 - ([#18176](https://github.com/Azure/azure-sdk-for-go/issues/18176)) - -## 1.0.0 (2022-05-12) - -### Features Added -* `DefaultAzureCredential` reads environment variable `AZURE_CLIENT_ID` for the - client ID of a user-assigned managed identity - ([#17293](https://github.com/Azure/azure-sdk-for-go/pull/17293)) - -### Breaking Changes -* Removed `AuthorizationCodeCredential`. Use `InteractiveBrowserCredential` instead - to authenticate a user with the authorization code flow. -* Instances of `AuthenticationFailedError` are now returned by pointer. -* `GetToken()` returns `azcore.AccessToken` by value - -### Bugs Fixed -* `AzureCLICredential` panics after receiving an unexpected error type - ([#17490](https://github.com/Azure/azure-sdk-for-go/issues/17490)) - -### Other Changes -* `GetToken()` returns an error when the caller specifies no scope -* Updated to the latest versions of `golang.org/x/crypto`, `azcore` and `internal` - -## 0.14.0 (2022-04-05) - -### Breaking Changes -* This module now requires Go 1.18 -* Removed `AuthorityHost`. Credentials are now configured for sovereign or private - clouds with the API in `azcore/cloud`, for example: - ```go - // before - opts := azidentity.ClientSecretCredentialOptions{AuthorityHost: azidentity.AzureGovernment} - cred, err := azidentity.NewClientSecretCredential(tenantID, clientID, secret, &opts) - - // after - import "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - - opts := azidentity.ClientSecretCredentialOptions{} - opts.Cloud = cloud.AzureGovernment - cred, err := azidentity.NewClientSecretCredential(tenantID, clientID, secret, &opts) - ``` - -## 0.13.2 (2022-03-08) - -### Bugs Fixed -* Prevented a data race in `DefaultAzureCredential` and `ChainedTokenCredential` - ([#17144](https://github.com/Azure/azure-sdk-for-go/issues/17144)) - -### Other Changes -* Upgraded App Service managed identity version from 2017-09-01 to 2019-08-01 - ([#17086](https://github.com/Azure/azure-sdk-for-go/pull/17086)) - -## 0.13.1 (2022-02-08) - -### Features Added -* `EnvironmentCredential` supports certificate SNI authentication when - `AZURE_CLIENT_SEND_CERTIFICATE_CHAIN` is "true". - ([#16851](https://github.com/Azure/azure-sdk-for-go/pull/16851)) - -### Bugs Fixed -* `ManagedIdentityCredential.GetToken()` now returns an error when configured for - a user assigned identity in Azure Cloud Shell (which doesn't support such identities) - ([#16946](https://github.com/Azure/azure-sdk-for-go/pull/16946)) - -### Other Changes -* `NewDefaultAzureCredential()` logs non-fatal errors. These errors are also included in the - error returned by `DefaultAzureCredential.GetToken()` when it's unable to acquire a token - from any source. ([#15923](https://github.com/Azure/azure-sdk-for-go/issues/15923)) - -## 0.13.0 (2022-01-11) - -### Breaking Changes -* Replaced `AuthenticationFailedError.RawResponse()` with a field having the same name -* Unexported `CredentialUnavailableError` -* Instances of `ChainedTokenCredential` will now skip looping through the list of source credentials and re-use the first successful credential on subsequent calls to `GetToken`. - * If `ChainedTokenCredentialOptions.RetrySources` is true, `ChainedTokenCredential` will continue to try all of the originally provided credentials each time the `GetToken` method is called. - * `ChainedTokenCredential.successfulCredential` will contain a reference to the last successful credential. - * `DefaultAzureCredenial` will also re-use the first successful credential on subsequent calls to `GetToken`. - * `DefaultAzureCredential.chain.successfulCredential` will also contain a reference to the last successful credential. - -### Other Changes -* `ManagedIdentityCredential` no longer probes IMDS before requesting a token - from it. Also, an error response from IMDS no longer disables a credential - instance. Following an error, a credential instance will continue to send - requests to IMDS as necessary. -* Adopted MSAL for user and service principal authentication -* Updated `azcore` requirement to 0.21.0 - -## 0.12.0 (2021-11-02) -### Breaking Changes -* Raised minimum go version to 1.16 -* Removed `NewAuthenticationPolicy()` from credentials. Clients should instead use azcore's - `runtime.NewBearerTokenPolicy()` to construct a bearer token authorization policy. -* The `AuthorityHost` field in credential options structs is now a custom type, - `AuthorityHost`, with underlying type `string` -* `NewChainedTokenCredential` has a new signature to accommodate a placeholder - options struct: - ```go - // before - cred, err := NewChainedTokenCredential(credA, credB) - - // after - cred, err := NewChainedTokenCredential([]azcore.TokenCredential{credA, credB}, nil) - ``` -* Removed `ExcludeAzureCLICredential`, `ExcludeEnvironmentCredential`, and `ExcludeMSICredential` - from `DefaultAzureCredentialOptions` -* `NewClientCertificateCredential` requires a `[]*x509.Certificate` and `crypto.PrivateKey` instead of - a path to a certificate file. Added `ParseCertificates` to simplify getting these in common cases: - ```go - // before - cred, err := NewClientCertificateCredential("tenant", "client-id", "/cert.pem", nil) - - // after - certData, err := os.ReadFile("/cert.pem") - certs, key, err := ParseCertificates(certData, password) - cred, err := NewClientCertificateCredential(tenantID, clientID, certs, key, nil) - ``` -* Removed `InteractiveBrowserCredentialOptions.ClientSecret` and `.Port` -* Removed `AADAuthenticationFailedError` -* Removed `id` parameter of `NewManagedIdentityCredential()`. User assigned identities are now - specified by `ManagedIdentityCredentialOptions.ID`: - ```go - // before - cred, err := NewManagedIdentityCredential("client-id", nil) - // or, for a resource ID - opts := &ManagedIdentityCredentialOptions{ID: ResourceID} - cred, err := NewManagedIdentityCredential("/subscriptions/...", opts) - - // after - clientID := ClientID("7cf7db0d-...") - opts := &ManagedIdentityCredentialOptions{ID: clientID} - // or, for a resource ID - resID: ResourceID("/subscriptions/...") - opts := &ManagedIdentityCredentialOptions{ID: resID} - cred, err := NewManagedIdentityCredential(opts) - ``` -* `DeviceCodeCredentialOptions.UserPrompt` has a new type: `func(context.Context, DeviceCodeMessage) error` -* Credential options structs now embed `azcore.ClientOptions`. In addition to changing literal initialization - syntax, this change renames `HTTPClient` fields to `Transport`. -* Renamed `LogCredential` to `EventCredential` -* `AzureCLICredential` no longer reads the environment variable `AZURE_CLI_PATH` -* `NewManagedIdentityCredential` no longer reads environment variables `AZURE_CLIENT_ID` and - `AZURE_RESOURCE_ID`. Use `ManagedIdentityCredentialOptions.ID` instead. -* Unexported `AuthenticationFailedError` and `CredentialUnavailableError` structs. In their place are two - interfaces having the same names. - -### Bugs Fixed -* `AzureCLICredential.GetToken` no longer mutates its `opts.Scopes` - -### Features Added -* Added connection configuration options to `DefaultAzureCredentialOptions` -* `AuthenticationFailedError.RawResponse()` returns the HTTP response motivating the error, - if available - -### Other Changes -* `NewDefaultAzureCredential()` returns `*DefaultAzureCredential` instead of `*ChainedTokenCredential` -* Added `TenantID` field to `DefaultAzureCredentialOptions` and `AzureCLICredentialOptions` - -## 0.11.0 (2021-09-08) -### Breaking Changes -* Unexported `AzureCLICredentialOptions.TokenProvider` and its type, - `AzureCLITokenProvider` - -### Bug Fixes -* `ManagedIdentityCredential.GetToken` returns `CredentialUnavailableError` - when IMDS has no assigned identity, signaling `DefaultAzureCredential` to - try other credentials - - -## 0.10.0 (2021-08-30) -### Breaking Changes -* Update based on `azcore` refactor [#15383](https://github.com/Azure/azure-sdk-for-go/pull/15383) - -## 0.9.3 (2021-08-20) - -### Bugs Fixed -* `ManagedIdentityCredential.GetToken` no longer mutates its `opts.Scopes` - -### Other Changes -* Bumps version of `azcore` to `v0.18.1` - - -## 0.9.2 (2021-07-23) -### Features Added -* Adding support for Service Fabric environment in `ManagedIdentityCredential` -* Adding an option for using a resource ID instead of client ID in `ManagedIdentityCredential` - - -## 0.9.1 (2021-05-24) -### Features Added -* Add LICENSE.txt and bump version information - - -## 0.9.0 (2021-05-21) -### Features Added -* Add support for authenticating in Azure Stack environments -* Enable user assigned identities for the IMDS scenario in `ManagedIdentityCredential` -* Add scope to resource conversion in `GetToken()` on `ManagedIdentityCredential` - - -## 0.8.0 (2021-01-20) -### Features Added -* Updating documentation - - -## 0.7.1 (2021-01-04) -### Features Added -* Adding port option to `InteractiveBrowserCredential` - - -## 0.7.0 (2020-12-11) -### Features Added -* Add `redirectURI` parameter back to authentication code flow - - -## 0.6.1 (2020-12-09) -### Features Added -* Updating query parameter in `ManagedIdentityCredential` and updating datetime string for parsing managed identity access tokens. - - -## 0.6.0 (2020-11-16) -### Features Added -* Remove `RedirectURL` parameter from auth code flow to align with the MSAL implementation which relies on the native client redirect URL. - - -## 0.5.0 (2020-10-30) -### Features Added -* Flattening credential options - - -## 0.4.3 (2020-10-21) -### Features Added -* Adding Azure Arc support in `ManagedIdentityCredential` - - -## 0.4.2 (2020-10-16) -### Features Added -* Typo fixes - - -## 0.4.1 (2020-10-16) -### Features Added -* Ensure authority hosts are only HTTPs - - -## 0.4.0 (2020-10-16) -### Features Added -* Adding options structs for credentials - - -## 0.3.0 (2020-10-09) -### Features Added -* Update `DeviceCodeCredential` callback - - -## 0.2.2 (2020-10-09) -### Features Added -* Add `AuthorizationCodeCredential` - - -## 0.2.1 (2020-10-06) -### Features Added -* Add `InteractiveBrowserCredential` - - -## 0.2.0 (2020-09-11) -### Features Added -* Refactor `azidentity` on top of `azcore` refactor -* Updated policies to conform to `policy.Policy` interface changes. -* Updated non-retriable errors to conform to `azcore.NonRetriableError`. -* Fixed calls to `Request.SetBody()` to include content type. -* Switched endpoints to string types and removed extra parsing code. - - -## 0.1.1 (2020-09-02) -### Features Added -* Add `AzureCLICredential` to `DefaultAzureCredential` chain - - -## 0.1.0 (2020-07-23) -### Features Added -* Initial Release. Azure Identity library that provides Microsoft Entra token authentication support for the SDK. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/LICENSE.txt b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/LICENSE.txt deleted file mode 100644 index 48ea6616..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/LICENSE.txt +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) Microsoft Corporation. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/MIGRATION.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/MIGRATION.md deleted file mode 100644 index 4404be82..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/MIGRATION.md +++ /dev/null @@ -1,307 +0,0 @@ -# Migrating from autorest/adal to azidentity - -`azidentity` provides Microsoft Entra ID ([formerly Azure Active Directory](https://learn.microsoft.com/entra/fundamentals/new-name)) authentication for the newest Azure SDK modules (`github.com/azure-sdk-for-go/sdk/...`). Older Azure SDK packages (`github.com/azure-sdk-for-go/services/...`) use types from `github.com/go-autorest/autorest/adal` instead. - -This guide shows common authentication code using `autorest/adal` and its equivalent using `azidentity`. - -## Table of contents - -- [Acquire a token](#acquire-a-token) -- [Client certificate authentication](#client-certificate-authentication) -- [Client secret authentication](#client-secret-authentication) -- [Configuration](#configuration) -- [Device code authentication](#device-code-authentication) -- [Managed identity](#managed-identity) -- [Use azidentity credentials with older packages](#use-azidentity-credentials-with-older-packages) - -## Configuration - -### `autorest/adal` - -Token providers require a token audience (resource identifier) and an instance of `adal.OAuthConfig`, which requires a Microsoft Entra endpoint and tenant: - -```go -import "github.com/Azure/go-autorest/autorest/adal" - -oauthCfg, err := adal.NewOAuthConfig("https://login.chinacloudapi.cn", tenantID) -handle(err) - -spt, err := adal.NewServicePrincipalTokenWithSecret( - *oauthCfg, clientID, "https://management.chinacloudapi.cn/", &adal.ServicePrincipalTokenSecret{ClientSecret: secret}, -) -``` - -### `azidentity` - -A credential instance can acquire tokens for any audience. The audience for each token is determined by the client requesting it. Credentials require endpoint configuration only for sovereign or private clouds. The `azcore/cloud` package has predefined configuration for sovereign clouds such as Azure China: - -```go -import ( - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" -) - -clientOpts := azcore.ClientOptions{Cloud: cloud.AzureChina} - -cred, err := azidentity.NewClientSecretCredential( - tenantID, clientID, secret, &azidentity.ClientSecretCredentialOptions{ClientOptions: clientOpts}, -) -handle(err) -``` - -## Client secret authentication - -### `autorest/adal` - -```go -import ( - "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-06-01/subscriptions" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/adal" -) - -oauthCfg, err := adal.NewOAuthConfig("https://login.microsoftonline.com", tenantID) -handle(err) -spt, err := adal.NewServicePrincipalTokenWithSecret( - *oauthCfg, clientID, "https://management.azure.com/", &adal.ServicePrincipalTokenSecret{ClientSecret: secret}, -) -handle(err) - -client := subscriptions.NewClient() -client.Authorizer = autorest.NewBearerAuthorizer(spt) -``` - -### `azidentity` - -```go -import ( - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armsubscriptions" -) - -cred, err := azidentity.NewClientSecretCredential(tenantID, clientID, secret, nil) -handle(err) - -client, err := armsubscriptions.NewClient(cred, nil) -handle(err) -``` - -## Client certificate authentication - -### `autorest/adal` - -```go -import ( - "os" - - "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-06-01/subscriptions" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/adal" -) -certData, err := os.ReadFile("./example.pfx") -handle(err) - -certificate, rsaPrivateKey, err := decodePkcs12(certData, "") -handle(err) - -oauthCfg, err := adal.NewOAuthConfig("https://login.microsoftonline.com", tenantID) -handle(err) - -spt, err := adal.NewServicePrincipalTokenFromCertificate( - *oauthConfig, clientID, certificate, rsaPrivateKey, "https://management.azure.com/", -) - -client := subscriptions.NewClient() -client.Authorizer = autorest.NewBearerAuthorizer(spt) -``` - -### `azidentity` - -```go -import ( - "os" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armsubscriptions" -) - -certData, err := os.ReadFile("./example.pfx") -handle(err) - -certs, key, err := azidentity.ParseCertificates(certData, nil) -handle(err) - -cred, err = azidentity.NewClientCertificateCredential(tenantID, clientID, certs, key, nil) -handle(err) - -client, err := armsubscriptions.NewClient(cred, nil) -handle(err) -``` - -## Managed identity - -### `autorest/adal` - -```go -import ( - "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-06-01/subscriptions" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/adal" -) - -spt, err := adal.NewServicePrincipalTokenFromManagedIdentity("https://management.azure.com/", nil) -handle(err) - -client := subscriptions.NewClient() -client.Authorizer = autorest.NewBearerAuthorizer(spt) -``` - -### `azidentity` - -```go -import ( - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armsubscriptions" -) - -cred, err := azidentity.NewManagedIdentityCredential(nil) -handle(err) - -client, err := armsubscriptions.NewClient(cred, nil) -handle(err) -``` - -### User-assigned identities - -`autorest/adal`: - -```go -import "github.com/Azure/go-autorest/autorest/adal" - -opts := &adal.ManagedIdentityOptions{ClientID: "..."} -spt, err := adal.NewServicePrincipalTokenFromManagedIdentity("https://management.azure.com/") -handle(err) -``` - -`azidentity`: - -```go -import "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - -opts := azidentity.ManagedIdentityCredentialOptions{ID: azidentity.ClientID("...")} -cred, err := azidentity.NewManagedIdentityCredential(&opts) -handle(err) -``` - -## Device code authentication - -### `autorest/adal` - -```go -import ( - "fmt" - "net/http" - - "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-06-01/subscriptions" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/adal" -) - -oauthClient := &http.Client{} -oauthCfg, err := adal.NewOAuthConfig("https://login.microsoftonline.com", tenantID) -handle(err) -resource := "https://management.azure.com/" -deviceCode, err := adal.InitiateDeviceAuth(oauthClient, *oauthCfg, clientID, resource) -handle(err) - -// display instructions, wait for the user to authenticate -fmt.Println(*deviceCode.Message) -token, err := adal.WaitForUserCompletion(oauthClient, deviceCode) -handle(err) - -spt, err := adal.NewServicePrincipalTokenFromManualToken(*oauthCfg, clientID, resource, *token) -handle(err) - -client := subscriptions.NewClient() -client.Authorizer = autorest.NewBearerAuthorizer(spt) -``` - -### `azidentity` - -```go -import ( - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armsubscriptions" -) - -cred, err := azidentity.NewDeviceCodeCredential(nil) -handle(err) - -client, err := armsubscriptions.NewSubscriptionsClient(cred, nil) -handle(err) -``` - -`azidentity.DeviceCodeCredential` will guide a user through authentication, printing instructions to the console by default. The user prompt is customizable. For more information, see the [package documentation](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#DeviceCodeCredential). - -## Acquire a token - -### `autorest/adal` - -```go -import "github.com/Azure/go-autorest/autorest/adal" - -oauthCfg, err := adal.NewOAuthConfig("https://login.microsoftonline.com", tenantID) -handle(err) - -spt, err := adal.NewServicePrincipalTokenWithSecret( - *oauthCfg, clientID, "https://vault.azure.net", &adal.ServicePrincipalTokenSecret{ClientSecret: secret}, -) - -err = spt.Refresh() -if err == nil { - token := spt.Token -} -``` - -### `azidentity` - -In ordinary usage, application code doesn't need to request tokens from credentials directly. Azure SDK clients handle token acquisition and refreshing internally. However, applications may call `GetToken()` to do so. All credential types have this method. - -```go -import ( - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" -) - -cred, err := azidentity.NewClientSecretCredential(tenantID, clientID, secret, nil) -handle(err) - -tk, err := cred.GetToken( - context.TODO(), policy.TokenRequestOptions{Scopes: []string{"https://vault.azure.net/.default"}}, -) -if err == nil { - token := tk.Token -} -``` - -Note that `azidentity` credentials use the Microsoft Entra endpoint, which requires OAuth 2 scopes instead of the resource identifiers `autorest/adal` expects. For more information, see [Microsoft Entra ID documentation](https://learn.microsoft.com/entra/identity-platform/permissions-consent-overview). - -## Use azidentity credentials with older packages - -The [azidext module](https://pkg.go.dev/github.com/jongio/azidext/go/azidext) provides an adapter for `azidentity` credential types. The adapter enables using the credential types with older Azure SDK clients. For example: - -```go -import ( - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-06-01/subscriptions" - "github.com/jongio/azidext/go/azidext" -) - -cred, err := azidentity.NewClientSecretCredential(tenantID, clientID, secret, nil) -handle(err) - -client := subscriptions.NewClient() -client.Authorizer = azidext.NewTokenCredentialAdapter(cred, []string{"https://management.azure.com//.default"}) -``` - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-go%2Fsdk%2Fazidentity%2FMIGRATION.png) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/README.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/README.md deleted file mode 100644 index b5acff0e..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/README.md +++ /dev/null @@ -1,257 +0,0 @@ -# Azure Identity Client Module for Go - -The Azure Identity module provides Microsoft Entra ID ([formerly Azure Active Directory](https://learn.microsoft.com/entra/fundamentals/new-name)) token authentication support across the Azure SDK. It includes a set of `TokenCredential` implementations, which can be used with Azure SDK clients supporting token authentication. - -[![PkgGoDev](https://pkg.go.dev/badge/github.com/Azure/azure-sdk-for-go/sdk/azidentity)](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity) -| [Microsoft Entra ID documentation](https://learn.microsoft.com/entra/identity/) -| [Source code](https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/azidentity) - -# Getting started - -## Install the module - -This project uses [Go modules](https://github.com/golang/go/wiki/Modules) for versioning and dependency management. - -Install the Azure Identity module: - -```sh -go get -u github.com/Azure/azure-sdk-for-go/sdk/azidentity -``` - -## Prerequisites - -- an [Azure subscription](https://azure.microsoft.com/free/) -- Go 1.18 - -### Authenticating during local development - -When debugging and executing code locally, developers typically use their own accounts to authenticate calls to Azure services. The `azidentity` module supports authenticating through developer tools to simplify local development. - -#### Authenticating via the Azure CLI - -`DefaultAzureCredential` and `AzureCLICredential` can authenticate as the user -signed in to the [Azure CLI](https://learn.microsoft.com/cli/azure). To sign in to the Azure CLI, run `az login`. On a system with a default web browser, the Azure CLI will launch the browser to authenticate a user. - -When no default browser is available, `az login` will use the device code -authentication flow. This can also be selected manually by running `az login --use-device-code`. - -#### Authenticate via the Azure Developer CLI - -Developers coding outside of an IDE can also use the [Azure Developer CLI](https://aka.ms/azure-dev) to authenticate. Applications using the `DefaultAzureCredential` or the `AzureDeveloperCLICredential` can use the account logged in to the Azure Developer CLI to authenticate calls in their application when running locally. - -To authenticate with the Azure Developer CLI, run `azd auth login`. On a system with a default web browser, `azd` will launch the browser to authenticate. On systems without a default web browser, run `azd auth login --use-device-code` to use the device code authentication flow. - -## Key concepts - -### Credentials - -A credential is a type which contains or can obtain the data needed for a -service client to authenticate requests. Service clients across the Azure SDK -accept a credential instance when they are constructed, and use that credential -to authenticate requests. - -The `azidentity` module focuses on OAuth authentication with Microsoft Entra ID. It offers a variety of credential types capable of acquiring a Microsoft Entra access token. See [Credential Types](#credential-types "Credential Types") for a list of this module's credential types. - -### DefaultAzureCredential - -`DefaultAzureCredential` is appropriate for most apps that will be deployed to Azure. It combines common production credentials with development credentials. It attempts to authenticate via the following mechanisms in this order, stopping when one succeeds: - -![DefaultAzureCredential authentication flow](img/mermaidjs/DefaultAzureCredentialAuthFlow.svg) - -1. **Environment** - `DefaultAzureCredential` will read account information specified via [environment variables](#environment-variables) and use it to authenticate. -1. **Workload Identity** - If the app is deployed on Kubernetes with environment variables set by the workload identity webhook, `DefaultAzureCredential` will authenticate the configured identity. -1. **Managed Identity** - If the app is deployed to an Azure host with managed identity enabled, `DefaultAzureCredential` will authenticate with it. -1. **Azure CLI** - If a user or service principal has authenticated via the Azure CLI `az login` command, `DefaultAzureCredential` will authenticate that identity. -1. **Azure Developer CLI** - If the developer has authenticated via the Azure Developer CLI `azd auth login` command, the `DefaultAzureCredential` will authenticate with that account. - -> Note: `DefaultAzureCredential` is intended to simplify getting started with the SDK by handling common scenarios with reasonable default behaviors. Developers who want more control or whose scenario isn't served by the default settings should use other credential types. - -## Managed Identity - -`DefaultAzureCredential` and `ManagedIdentityCredential` support -[managed identity authentication](https://learn.microsoft.com/entra/identity/managed-identities-azure-resources/overview) -in any hosting environment which supports managed identities, such as (this list is not exhaustive): -* [Azure App Service](https://learn.microsoft.com/azure/app-service/overview-managed-identity) -* [Azure Arc](https://learn.microsoft.com/azure/azure-arc/servers/managed-identity-authentication) -* [Azure Cloud Shell](https://learn.microsoft.com/azure/cloud-shell/msi-authorization) -* [Azure Kubernetes Service](https://learn.microsoft.com/azure/aks/use-managed-identity) -* [Azure Service Fabric](https://learn.microsoft.com/azure/service-fabric/concepts-managed-identity) -* [Azure Virtual Machines](https://learn.microsoft.com/entra/identity/managed-identities-azure-resources/how-to-use-vm-token) - -## Examples - -- [Authenticate with DefaultAzureCredential](#authenticate-with-defaultazurecredential "Authenticate with DefaultAzureCredential") -- [Define a custom authentication flow with ChainedTokenCredential](#define-a-custom-authentication-flow-with-chainedtokencredential "Define a custom authentication flow with ChainedTokenCredential") -- [Specify a user-assigned managed identity for DefaultAzureCredential](#specify-a-user-assigned-managed-identity-for-defaultazurecredential) - -### Authenticate with DefaultAzureCredential - -This example demonstrates authenticating a client from the `armresources` module with `DefaultAzureCredential`. - -```go -cred, err := azidentity.NewDefaultAzureCredential(nil) -if err != nil { - // handle error -} - -client := armresources.NewResourceGroupsClient("subscription ID", cred, nil) -``` - -### Specify a user-assigned managed identity for DefaultAzureCredential - -To configure `DefaultAzureCredential` to authenticate a user-assigned managed identity, set the environment variable `AZURE_CLIENT_ID` to the identity's client ID. - -### Define a custom authentication flow with `ChainedTokenCredential` - -`DefaultAzureCredential` is generally the quickest way to get started developing apps for Azure. For more advanced scenarios, `ChainedTokenCredential` links multiple credential instances to be tried sequentially when authenticating. It will try each chained credential in turn until one provides a token or fails to authenticate due to an error. - -The following example demonstrates creating a credential, which will attempt to authenticate using managed identity. It will fall back to authenticating via the Azure CLI when a managed identity is unavailable. - -```go -managed, err := azidentity.NewManagedIdentityCredential(nil) -if err != nil { - // handle error -} -azCLI, err := azidentity.NewAzureCLICredential(nil) -if err != nil { - // handle error -} -chain, err := azidentity.NewChainedTokenCredential([]azcore.TokenCredential{managed, azCLI}, nil) -if err != nil { - // handle error -} - -client := armresources.NewResourceGroupsClient("subscription ID", chain, nil) -``` - -## Credential Types - -### Authenticating Azure Hosted Applications - -|Credential|Usage -|-|- -|[DefaultAzureCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#DefaultAzureCredential)|Simplified authentication experience for getting started developing Azure apps -|[ChainedTokenCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#ChainedTokenCredential)|Define custom authentication flows, composing multiple credentials -|[EnvironmentCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#EnvironmentCredential)|Authenticate a service principal or user configured by environment variables -|[ManagedIdentityCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#ManagedIdentityCredential)|Authenticate the managed identity of an Azure resource -|[WorkloadIdentityCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#WorkloadIdentityCredential)|Authenticate a workload identity on Kubernetes - -### Authenticating Service Principals - -|Credential|Usage -|-|- -|[ClientAssertionCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#ClientAssertionCredential)|Authenticate a service principal with a signed client assertion -|[ClientCertificateCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#ClientCertificateCredential)|Authenticate a service principal with a certificate -|[ClientSecretCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#ClientSecretCredential)|Authenticate a service principal with a secret - -### Authenticating Users - -|Credential|Usage -|-|- -|[InteractiveBrowserCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#InteractiveBrowserCredential)|Interactively authenticate a user with the default web browser -|[DeviceCodeCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#DeviceCodeCredential)|Interactively authenticate a user on a device with limited UI -|[UsernamePasswordCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#UsernamePasswordCredential)|Authenticate a user with a username and password - -### Authenticating via Development Tools - -|Credential|Usage -|-|- -|[AzureCLICredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#AzureCLICredential)|Authenticate as the user signed in to the Azure CLI -|[`AzureDeveloperCLICredential`](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#AzureDeveloperCLICredential)|Authenticates as the user signed in to the Azure Developer CLI - -## Environment Variables - -`DefaultAzureCredential` and `EnvironmentCredential` can be configured with environment variables. Each type of authentication requires values for specific variables: - -#### Service principal with secret - -|variable name|value -|-|- -|`AZURE_CLIENT_ID`|ID of a Microsoft Entra application -|`AZURE_TENANT_ID`|ID of the application's Microsoft Entra tenant -|`AZURE_CLIENT_SECRET`|one of the application's client secrets - -#### Service principal with certificate - -|variable name|value -|-|- -|`AZURE_CLIENT_ID`|ID of a Microsoft Entra application -|`AZURE_TENANT_ID`|ID of the application's Microsoft Entra tenant -|`AZURE_CLIENT_CERTIFICATE_PATH`|path to a certificate file including private key -|`AZURE_CLIENT_CERTIFICATE_PASSWORD`|password of the certificate file, if any - -#### Username and password - -|variable name|value -|-|- -|`AZURE_CLIENT_ID`|ID of a Microsoft Entra application -|`AZURE_USERNAME`|a username (usually an email address) -|`AZURE_PASSWORD`|that user's password - -Configuration is attempted in the above order. For example, if values for a -client secret and certificate are both present, the client secret will be used. - -## Token caching - -Token caching is an `azidentity` feature that allows apps to: - -* Cache tokens in memory (default) or on disk (opt-in). -* Improve resilience and performance. -* Reduce the number of requests made to Microsoft Entra ID to obtain access tokens. - -For more details, see the [token caching documentation](https://aka.ms/azsdk/go/identity/caching). - -## Troubleshooting - -### Error Handling - -Credentials return an `error` when they fail to authenticate or lack data they require to authenticate. For guidance on resolving errors from specific credential types, see the [troubleshooting guide](https://aka.ms/azsdk/go/identity/troubleshoot). - -For more details on handling specific Microsoft Entra errors, see the Microsoft Entra [error code documentation](https://learn.microsoft.com/entra/identity-platform/reference-error-codes). - -### Logging - -This module uses the classification-based logging implementation in `azcore`. To enable console logging for all SDK modules, set `AZURE_SDK_GO_LOGGING` to `all`. Use the `azcore/log` package to control log event output or to enable logs for `azidentity` only. For example: -```go -import azlog "github.com/Azure/azure-sdk-for-go/sdk/azcore/log" - -// print log output to stdout -azlog.SetListener(func(event azlog.Event, s string) { - fmt.Println(s) -}) - -// include only azidentity credential logs -azlog.SetEvents(azidentity.EventAuthentication) -``` - -Credentials log basic information only, such as `GetToken` success or failure and errors. These log entries don't contain authentication secrets but may contain sensitive information. - -## Next steps - -Client and management modules listed on the [Azure SDK releases page](https://azure.github.io/azure-sdk/releases/latest/go.html) support authenticating with `azidentity` credential types. You can learn more about using these libraries in their documentation, which is linked from the release page. - -## Provide Feedback - -If you encounter bugs or have suggestions, please -[open an issue](https://github.com/Azure/azure-sdk-for-go/issues). - -## Contributing - -This project welcomes contributions and suggestions. Most contributions require -you to agree to a Contributor License Agreement (CLA) declaring that you have -the right to, and actually do, grant us the rights to use your contribution. -For details, visit [https://cla.microsoft.com](https://cla.microsoft.com). - -When you submit a pull request, a CLA-bot will automatically determine whether -you need to provide a CLA and decorate the PR appropriately (e.g., label, -comment). Simply follow the instructions provided by the bot. You will only -need to do this once across all repos using our CLA. - -This project has adopted the -[Microsoft Open Source Code of Conduct](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. - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-go%2Fsdk%2Fazidentity%2FREADME.png) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/TOKEN_CACHING.MD b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/TOKEN_CACHING.MD deleted file mode 100644 index f9cc4894..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/TOKEN_CACHING.MD +++ /dev/null @@ -1,70 +0,0 @@ -## Token caching in the Azure Identity client module - -*Token caching* is a feature provided by the Azure Identity library that allows apps to: - -- Improve their resilience and performance. -- Reduce the number of requests made to Microsoft Entra ID to obtain access tokens. -- Reduce the number of times the user is prompted to authenticate. - -When an app needs to access a protected Azure resource, it typically needs to obtain an access token from Entra ID. Obtaining that token involves sending a request to Entra ID and may also involve prompting the user. Entra ID then validates the credentials provided in the request and issues an access token. - -Token caching, via the Azure Identity library, allows the app to store this access token [in memory](#in-memory-token-caching), where it's accessible to the current process, or [on disk](#persistent-token-caching) where it can be accessed across application or process invocations. The token can then be retrieved quickly and easily the next time the app needs to access the same resource. The app can avoid making another request to Entra ID, which reduces network traffic and improves resilience. Additionally, in scenarios where the app is authenticating users, token caching also avoids prompting the user each time new tokens are requested. - -### In-memory token caching - -*In-memory token caching* is the default option provided by the Azure Identity library. This caching approach allows apps to store access tokens in memory. With in-memory token caching, the library first determines if a valid access token for the requested resource is already stored in memory. If a valid token is found, it's returned to the app without the need to make another request to Entra ID. If a valid token isn't found, the library will automatically acquire a token by sending a request to Entra ID. The in-memory token cache provided by the Azure Identity library is thread-safe. - -**Note:** When Azure Identity library credentials are used with Azure service libraries (for example, Azure Blob Storage), the in-memory token caching is active in the `Pipeline` layer as well. All `TokenCredential` implementations are supported there, including custom implementations external to the Azure Identity library. - -#### Caching cannot be disabled - -As there are many levels of caching, it's not possible disable in-memory caching. However, the in-memory cache may be cleared by creating a new credential instance. - -### Persistent token caching - -> Only azidentity v1.5.0-beta versions support persistent token caching - -*Persistent disk token caching* is an opt-in feature in the Azure Identity library. The feature allows apps to cache access tokens in an encrypted, persistent storage mechanism. As indicated in the following table, the storage mechanism differs across operating systems. - -| Operating system | Storage mechanism | -|------------------|---------------------------------------| -| Linux | kernel key retention service (keyctl) | -| macOS | Keychain | -| Windows | DPAPI | - -By default the token cache will protect any data which is persisted using the user data protection APIs available on the current platform. -However, there are cases where no data protection is available, and applications may choose to allow storing the token cache in an unencrypted state by setting `TokenCachePersistenceOptions.AllowUnencryptedStorage` to `true`. This allows a credential to fall back to unencrypted storage if it can't encrypt the cache. However, we do not recommend using this storage method due to its significantly lower security measures. In addition, tokens are not encrypted solely to the current user, which could potentially allow unauthorized access to the cache by individuals with machine access. - -With persistent disk token caching enabled, the library first determines if a valid access token for the requested resource is already stored in the persistent cache. If a valid token is found, it's returned to the app without the need to make another request to Entra ID. Additionally, the tokens are preserved across app runs, which: - -- Makes the app more resilient to failures. -- Ensures the app can continue to function during an Entra ID outage or disruption. -- Avoids having to prompt users to authenticate each time the process is restarted. - ->IMPORTANT! The token cache contains sensitive data and **MUST** be protected to prevent compromising accounts. All application decisions regarding the persistence of the token cache must consider that a breach of its content will fully compromise all the accounts it contains. - -#### Example code - -See the [package documentation](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity@v1.6.0-beta.2#pkg-overview) for example code demonstrating how to configure persistent caching and access cached data. - -### Credentials supporting token caching - -The following table indicates the state of in-memory and persistent caching in each credential type. - -**Note:** In-memory caching is activated by default. Persistent token caching needs to be enabled as shown in [this example](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity@v1.5.0-beta.1#example-package-PersistentCache). - -| Credential | In-memory token caching | Persistent token caching | -|--------------------------------|---------------------------------------------------------------------|--------------------------| -| `AzureCLICredential` | Not Supported | Not Supported | -| `AzureDeveloperCLICredential` | Not Supported | Not Supported | -| `ClientAssertionCredential` | Supported | Supported | -| `ClientCertificateCredential` | Supported | Supported | -| `ClientSecretCredential` | Supported | Supported | -| `DefaultAzureCredential` | Supported if the target credential in the default chain supports it | Not Supported | -| `DeviceCodeCredential` | Supported | Supported | -| `EnvironmentCredential` | Supported | Not Supported | -| `InteractiveBrowserCredential` | Supported | Supported | -| `ManagedIdentityCredential` | Supported | Not Supported | -| `OnBehalfOfCredential` | Supported | Supported | -| `UsernamePasswordCredential` | Supported | Supported | -| `WorkloadIdentityCredential` | Supported | Supported | diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/TROUBLESHOOTING.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/TROUBLESHOOTING.md deleted file mode 100644 index 3564e685..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/TROUBLESHOOTING.md +++ /dev/null @@ -1,231 +0,0 @@ -# Troubleshoot Azure Identity authentication issues - -This troubleshooting guide covers failure investigation techniques, common errors for the credential types in the `azidentity` module, and mitigation steps to resolve these errors. - -## Table of contents - -- [Handle azidentity errors](#handle-azidentity-errors) - - [Permission issues](#permission-issues) -- [Find relevant information in errors](#find-relevant-information-in-errors) -- [Enable and configure logging](#enable-and-configure-logging) -- [Troubleshoot AzureCLICredential authentication issues](#troubleshoot-azureclicredential-authentication-issues) -- [Troubleshoot AzureDeveloperCLICredential authentication issues](#troubleshoot-azuredeveloperclicredential-authentication-issues) -- [Troubleshoot ClientCertificateCredential authentication issues](#troubleshoot-clientcertificatecredential-authentication-issues) -- [Troubleshoot ClientSecretCredential authentication issues](#troubleshoot-clientsecretcredential-authentication-issues) -- [Troubleshoot DefaultAzureCredential authentication issues](#troubleshoot-defaultazurecredential-authentication-issues) -- [Troubleshoot EnvironmentCredential authentication issues](#troubleshoot-environmentcredential-authentication-issues) -- [Troubleshoot ManagedIdentityCredential authentication issues](#troubleshoot-managedidentitycredential-authentication-issues) - - [Azure App Service and Azure Functions managed identity](#azure-app-service-and-azure-functions-managed-identity) - - [Azure Kubernetes Service managed identity](#azure-kubernetes-service-managed-identity) - - [Azure Virtual Machine managed identity](#azure-virtual-machine-managed-identity) -- [Troubleshoot UsernamePasswordCredential authentication issues](#troubleshoot-usernamepasswordcredential-authentication-issues) -- [Troubleshoot WorkloadIdentityCredential authentication issues](#troubleshoot-workloadidentitycredential-authentication-issues) -- [Get additional help](#get-additional-help) - -## Handle azidentity errors - -Any service client method that makes a request to the service may return an error due to authentication failure. This is because the credential authenticates on the first call to the service and on any subsequent call that needs to refresh an access token. Authentication errors include a description of the failure and possibly an error message from Microsoft Entra ID. Depending on the application, these errors may or may not be recoverable. - -### Permission issues - -Service client errors with a status code of 401 or 403 often indicate that authentication succeeded but the caller doesn't have permission to access the specified API. Check the service documentation to determine which RBAC roles are needed for the request, and ensure the authenticated user or service principal has the appropriate role assignments. - -## Find relevant information in errors - -Authentication errors can include responses from Microsoft Entra ID and often contain information helpful in diagnosis. Consider the following error message: - -``` -ClientSecretCredential authentication failed -POST https://login.microsoftonline.com/3c631bb7-a9f7-4343-a5ba-a615913/oauth2/v2.0/token --------------------------------------------------------------------------------- -RESPONSE 401 Unauthorized --------------------------------------------------------------------------------- -{ - "error": "invalid_client", - "error_description": "AADSTS7000215: Invalid client secret provided. Ensure the secret being sent in the request is the client secret value, not the client secret ID, for a secret added to app '86be4c01-505b-45e9-bfc0-9b825fd84'.\r\nTrace ID: 03da4b8e-5ffe-48ca-9754-aff4276f0100\r\nCorrelation ID: 7b12f9bb-2eef-42e3-ad75-eee69ec9088d\r\nTimestamp: 2022-03-02 18:25:26Z", - "error_codes": [ - 7000215 - ], - "timestamp": "2022-03-02 18:25:26Z", - "trace_id": "03da4b8e-5ffe-48ca-9754-aff4276f0100", - "correlation_id": "7b12f9bb-2eef-42e3-ad75-eee69ec9088d", - "error_uri": "https://login.microsoftonline.com/error?code=7000215" -} --------------------------------------------------------------------------------- -``` - -This error contains several pieces of information: - -- __Failing Credential Type__: The type of credential that failed to authenticate. This can be helpful when diagnosing issues with chained credential types such as `DefaultAzureCredential` or `ChainedTokenCredential`. - -- __Microsoft Entra ID Error Code and Message__: The error code and message returned by Microsoft Entra ID. This can give insight into the specific reason the request failed. For instance, in this case authentication failed because the provided client secret is incorrect. [Microsoft Entra ID documentation](https://learn.microsoft.com/entra/identity-platform/reference-error-codes#aadsts-error-codes) has more information on AADSTS error codes. - -- __Correlation ID and Timestamp__: The correlation ID and timestamp identify the request in server-side logs. This information can be useful to support engineers diagnosing unexpected Microsoft Entra failures. - -### Enable and configure logging - -`azidentity` provides the same logging capabilities as the rest of the Azure SDK. The simplest way to see the logs to help debug authentication issues is to print credential logs to the console. -```go -import azlog "github.com/Azure/azure-sdk-for-go/sdk/azcore/log" - -// print log output to stdout -azlog.SetListener(func(event azlog.Event, s string) { - fmt.Println(s) -}) - -// include only azidentity credential logs -azlog.SetEvents(azidentity.EventAuthentication) -``` - - -## Troubleshoot DefaultAzureCredential authentication issues - -| Error |Description| Mitigation | -|---|---|---| -|"DefaultAzureCredential failed to acquire a token"|No credential in the `DefaultAzureCredential` chain provided a token|
  • [Enable logging](#enable-and-configure-logging) to get further diagnostic information.
  • Consult the troubleshooting guide for underlying credential types for more information.
    • [EnvironmentCredential](#troubleshoot-environmentcredential-authentication-issues)
    • [ManagedIdentityCredential](#troubleshoot-managedidentitycredential-authentication-issues)
    • [AzureCLICredential](#troubleshoot-azureclicredential-authentication-issues)
    | -|Error from the client with a status code of 401 or 403|Authentication succeeded but the authorizing Azure service responded with a 401 (Unauthorized), or 403 (Forbidden) status code|
    • [Enable logging](#enable-and-configure-logging) to determine which credential in the chain returned the authenticating token.
    • If an unexpected credential is returning a token, check application configuration such as environment variables.
    • Ensure the correct role is assigned to the authenticated identity. For example, a service specific role rather than the subscription Owner role.
    | -|"managed identity timed out"|`DefaultAzureCredential` sets a short timeout on its first managed identity authentication attempt to prevent very long timeouts during local development when no managed identity is available. That timeout causes this error in production when an application requests a token before the hosting environment is ready to provide one.|Use [ManagedIdentityCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#ManagedIdentityCredential) directly, at least in production. It doesn't set a timeout on its authentication attempts.| - -## Troubleshoot EnvironmentCredential authentication issues - -| Error Message |Description| Mitigation | -|---|---|---| -|Missing or incomplete environment variable configuration|A valid combination of environment variables wasn't set|Ensure the appropriate environment variables are set for the intended authentication method as described in the [module documentation](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#EnvironmentCredential)| - - -## Troubleshoot ClientSecretCredential authentication issues - -| Error Code | Issue | Mitigation | -|---|---|---| -|AADSTS7000215|An invalid client secret was provided.|Ensure the secret provided to the credential constructor is valid. If unsure, create a new client secret using the Azure portal. Details on creating a new client secret are in [Microsoft Entra ID documentation](https://learn.microsoft.com/entra/identity-platform/howto-create-service-principal-portal#option-2-create-a-new-application-secret).| -|AADSTS7000222|An expired client secret was provided.|Create a new client secret using the Azure portal. Details on creating a new client secret are in [Microsoft Entra ID documentation](https://learn.microsoft.com/entra/identity-platform/howto-create-service-principal-portal#option-2-create-a-new-application-secret).| -|AADSTS700016|The specified application wasn't found in the specified tenant.|Ensure the client and tenant IDs provided to the credential constructor are correct for your application registration. For multi-tenant apps, ensure the application has been added to the desired tenant by a tenant admin. To add a new application in the desired tenant, follow the [Microsoft Entra ID instructions](https://learn.microsoft.com/entra/identity-platform/howto-create-service-principal-portal).| - - -## Troubleshoot ClientCertificateCredential authentication issues - -| Error Code | Description | Mitigation | -|---|---|---| -|AADSTS700027|Client assertion contains an invalid signature.|Ensure the specified certificate has been uploaded to the application registration as described in [Microsoft Entra ID documentation](https://learn.microsoft.com/entra/identity-platform/howto-create-service-principal-portal#option-1-upload-a-certificate).| -|AADSTS700016|The specified application wasn't found in the specified tenant.|Ensure the client and tenant IDs provided to the credential constructor are correct for your application registration. For multi-tenant apps, ensure the application has been added to the desired tenant by a tenant admin. To add a new application in the desired tenant, follow the [Microsoft Entra ID instructions](https://learn.microsoft.com/entra/identity-platform/howto-create-service-principal-portal).| - - -## Troubleshoot UsernamePasswordCredential authentication issues - -| Error Code | Issue | Mitigation | -|---|---|---| -|AADSTS50126|The provided username or password is invalid.|Ensure the username and password provided to the credential constructor are valid.| - - -## Troubleshoot ManagedIdentityCredential authentication issues - -`ManagedIdentityCredential` is designed to work on a variety of Azure hosts support managed identity. Configuration and troubleshooting vary from host to host. The below table lists the Azure hosts that can be assigned a managed identity and are supported by `ManagedIdentityCredential`. - -|Host Environment| | | -|---|---|---| -|Azure Virtual Machines and Scale Sets|[Configuration](https://learn.microsoft.com/entra/identity/managed-identities-azure-resources/qs-configure-portal-windows-vm)|[Troubleshooting](#azure-virtual-machine-managed-identity)| -|Azure App Service and Azure Functions|[Configuration](https://learn.microsoft.com/azure/app-service/overview-managed-identity)|[Troubleshooting](#azure-app-service-and-azure-functions-managed-identity)| -|Azure Kubernetes Service|[Configuration](https://azure.github.io/aad-pod-identity/docs/)|[Troubleshooting](#azure-kubernetes-service-managed-identity)| -|Azure Arc|[Configuration](https://learn.microsoft.com/azure/azure-arc/servers/managed-identity-authentication)|| -|Azure Service Fabric|[Configuration](https://learn.microsoft.com/azure/service-fabric/concepts-managed-identity)|| - -### Azure Virtual Machine managed identity - -| Error Message |Description| Mitigation | -|---|---|---| -|The requested identity hasn’t been assigned to this resource.|The IMDS endpoint responded with a status code of 400, indicating the requested identity isn’t assigned to the VM.|If using a user assigned identity, ensure the specified ID is correct.

    If using a system assigned identity, make sure it has been enabled as described in [managed identity documentation](https://learn.microsoft.com/entra/identity/managed-identities-azure-resources/qs-configure-portal-windows-vm#enable-system-assigned-managed-identity-on-an-existing-vm).| -|The request failed due to a gateway error.|The request to the IMDS endpoint failed due to a gateway error, 502 or 504 status code.|IMDS doesn't support requests via proxy or gateway. Disable proxies or gateways running on the VM for requests to the IMDS endpoint `http://169.254.169.254`| -|No response received from the managed identity endpoint.|No response was received for the request to IMDS or the request timed out.|

    • Ensure the VM is configured for managed identity as described in [managed identity documentation](https://learn.microsoft.com/entra/identity/managed-identities-azure-resources/qs-configure-portal-windows-vm).
    • Verify the IMDS endpoint is reachable on the VM. See [below](#verify-imds-is-available-on-the-vm) for instructions.
    | -|Multiple attempts failed to obtain a token from the managed identity endpoint.|The credential has exhausted its retries for a token request.|
    • Refer to the error message for more details on specific failures.
    • Ensure the VM is configured for managed identity as described in [managed identity documentation](https://learn.microsoft.com/entra/identity/managed-identities-azure-resources/qs-configure-portal-windows-vm).
    • Verify the IMDS endpoint is reachable on the VM. See [below](#verify-imds-is-available-on-the-vm) for instructions.
    | - -#### Verify IMDS is available on the VM - -If you have access to the VM, you can use `curl` to verify the managed identity endpoint is available. - -```sh -curl 'http://169.254.169.254/metadata/identity/oauth2/token?resource=https://management.core.windows.net&api-version=2018-02-01' -H "Metadata: true" -``` - -> This command's output will contain an access token and SHOULD NOT BE SHARED, to avoid compromising account security. - -### Azure App Service and Azure Functions managed identity - -| Error Message |Description| Mitigation | -|---|---|---| -|Get "`http://169.254.169.254/...`" i/o timeout|The App Service host hasn't set environment variables for managed identity configuration.|
    • Ensure the App Service is configured for managed identity as described in [App Service documentation](https://learn.microsoft.com/azure/app-service/overview-managed-identity).
    • Verify the App Service environment is properly configured and the managed identity endpoint is available. See [below](#verify-the-app-service-managed-identity-endpoint-is-available) for instructions.
    | - -#### Verify the App Service managed identity endpoint is available - -If you can SSH into the App Service, you can verify managed identity is available in the environment. First ensure the environment variables `IDENTITY_ENDPOINT` and `IDENTITY_SECRET` are set. Then you can verify the managed identity endpoint is available using `curl`. - -```sh -curl "$IDENTITY_ENDPOINT?resource=https://management.core.windows.net&api-version=2019-08-01" -H "X-IDENTITY-HEADER: $IDENTITY_HEADER" -``` - -> This command's output will contain an access token and SHOULD NOT BE SHARED, to avoid compromising account security. - -### Azure Kubernetes Service managed identity - -#### Pod Identity - -| Error Message |Description| Mitigation | -|---|---|---| -|"no azure identity found for request clientID"|The application attempted to authenticate before an identity was assigned to its pod|Verify the pod is labeled correctly. This also occurs when a correctly labeled pod authenticates before the identity is ready. To prevent initialization races, configure NMI to set the Retry-After header in its responses as described in [Pod Identity documentation](https://azure.github.io/aad-pod-identity/docs/configure/feature_flags/#set-retry-after-header-in-nmi-response). - - -## Troubleshoot AzureCLICredential authentication issues - -| Error Message |Description| Mitigation | -|---|---|---| -|Azure CLI not found on path|The Azure CLI isn’t installed or isn't on the application's path.|
    • Ensure the Azure CLI is installed as described in [Azure CLI documentation](https://learn.microsoft.com/cli/azure/install-azure-cli).
    • Validate the installation location is in the application's `PATH` environment variable.
    | -|Please run 'az login' to set up account|No account is currently logged into the Azure CLI, or the login has expired.|
    • Run `az login` to log into the Azure CLI. More information about Azure CLI authentication is available in the [Azure CLI documentation](https://learn.microsoft.com/cli/azure/authenticate-azure-cli).
    • Verify that the Azure CLI can obtain tokens. See [below](#verify-the-azure-cli-can-obtain-tokens) for instructions.
    | - -#### Verify the Azure CLI can obtain tokens - -You can manually verify that the Azure CLI can authenticate and obtain tokens. First, use the `account` command to verify the logged in account. - -```azurecli -az account show -``` - -Once you've verified the Azure CLI is using the correct account, you can validate that it's able to obtain tokens for that account. - -```azurecli -az account get-access-token --output json --resource https://management.core.windows.net -``` - -> This command's output will contain an access token and SHOULD NOT BE SHARED, to avoid compromising account security. - - -## Troubleshoot AzureDeveloperCLICredential authentication issues - -| Error Message |Description| Mitigation | -|---|---|---| -|Azure Developer CLI not found on path|The Azure Developer CLI isn't installed or couldn't be found.|
    • Ensure the Azure Developer CLI is properly installed. See the installation instructions at [Install or update the Azure Developer CLI](https://learn.microsoft.com/azure/developer/azure-developer-cli/install-azd).
    • Validate the installation location has been added to the `PATH` environment variable.
    | -|Please run "azd auth login"|No account is logged into the Azure Developer CLI, or the login has expired.|
    • Log in to the Azure Developer CLI using the `azd login` command.
    • Validate that the Azure Developer CLI can obtain tokens. For instructions, see [Verify the Azure Developer CLI can obtain tokens](#verify-the-azure-developer-cli-can-obtain-tokens).
    | - -#### Verify the Azure Developer CLI can obtain tokens - -You can manually verify that the Azure Developer CLI is properly authenticated and can obtain tokens. First, use the `config` command to verify the account that is currently logged in to the Azure Developer CLI. - -```sh -azd config list -``` - -Once you've verified the Azure Developer CLI is using correct account, you can validate that it's able to obtain tokens for this account. - -```sh -azd auth token --output json --scope https://management.core.windows.net/.default -``` ->Note that output of this command will contain a valid access token, and SHOULD NOT BE SHARED to avoid compromising account security. - - -## Troubleshoot `WorkloadIdentityCredential` authentication issues - -| Error Message |Description| Mitigation | -|---|---|---| -|no client ID/tenant ID/token file specified|Incomplete configuration|In most cases these values are provided via environment variables set by Azure Workload Identity.
    • If your application runs on Azure Kubernetes Servide (AKS) or a cluster that has deployed the Azure Workload Identity admission webhook, check pod labels and service account configuration. See the [AKS documentation](https://learn.microsoft.com/azure/aks/workload-identity-deploy-cluster#disable-workload-identity) and [Azure Workload Identity troubleshooting guide](https://azure.github.io/azure-workload-identity/docs/troubleshooting.html) for more details.
    • If your application isn't running on AKS or your cluster hasn't deployed the Workload Identity admission webhook, set these values in `WorkloadIdentityCredentialOptions` - -## Get additional help - -Additional information on ways to reach out for support can be found in [SUPPORT.md](https://github.com/Azure/azure-sdk-for-go/blob/main/SUPPORT.md). diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/assets.json b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/assets.json deleted file mode 100644 index bff0c44d..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/assets.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "AssetsRepo": "Azure/azure-sdk-assets", - "AssetsRepoPrefixPath": "go", - "TagPrefix": "go/azidentity", - "Tag": "go/azidentity_087379b475" -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/authentication_record.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/authentication_record.go deleted file mode 100644 index ada4d650..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/authentication_record.go +++ /dev/null @@ -1,95 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package azidentity - -import ( - "encoding/json" - "errors" - "fmt" - "net/url" - "strings" - - "github.com/AzureAD/microsoft-authentication-library-for-go/apps/public" -) - -var supportedAuthRecordVersions = []string{"1.0"} - -// authenticationRecord is non-secret account information about an authenticated user that user credentials such as -// [DeviceCodeCredential] and [InteractiveBrowserCredential] can use to access previously cached authentication -// data. Call these credentials' Authenticate method to get an authenticationRecord for a user. -type authenticationRecord struct { - // Authority is the URL of the authority that issued the token. - Authority string `json:"authority"` - - // ClientID is the ID of the application that authenticated the user. - ClientID string `json:"clientId"` - - // HomeAccountID uniquely identifies the account. - HomeAccountID string `json:"homeAccountId"` - - // TenantID identifies the tenant in which the user authenticated. - TenantID string `json:"tenantId"` - - // Username is the user's preferred username. - Username string `json:"username"` - - // Version of the AuthenticationRecord. - Version string `json:"version"` -} - -// UnmarshalJSON implements json.Unmarshaler for AuthenticationRecord -func (a *authenticationRecord) UnmarshalJSON(b []byte) error { - // Default unmarshaling is fine but we want to return an error if the record's version isn't supported i.e., we - // want to inspect the unmarshalled values before deciding whether to return an error. Unmarshaling a formally - // different type enables this by assigning all the fields without recursing into this method. - type r authenticationRecord - err := json.Unmarshal(b, (*r)(a)) - if err != nil { - return err - } - if a.Version == "" { - return errors.New("AuthenticationRecord must have a version") - } - for _, v := range supportedAuthRecordVersions { - if a.Version == v { - return nil - } - } - return fmt.Errorf("unsupported AuthenticationRecord version %q. This module supports %v", a.Version, supportedAuthRecordVersions) -} - -// account returns the AuthenticationRecord as an MSAL Account. The account is zero-valued when the AuthenticationRecord is zero-valued. -func (a *authenticationRecord) account() public.Account { - return public.Account{ - Environment: a.Authority, - HomeAccountID: a.HomeAccountID, - PreferredUsername: a.Username, - } -} - -func newAuthenticationRecord(ar public.AuthResult) (authenticationRecord, error) { - u, err := url.Parse(ar.IDToken.Issuer) - if err != nil { - return authenticationRecord{}, fmt.Errorf("Authenticate expected a URL issuer but got %q", ar.IDToken.Issuer) - } - tenant := ar.IDToken.TenantID - if tenant == "" { - tenant = strings.Trim(u.Path, "/") - } - username := ar.IDToken.PreferredUsername - if username == "" { - username = ar.IDToken.UPN - } - return authenticationRecord{ - Authority: fmt.Sprintf("%s://%s", u.Scheme, u.Host), - ClientID: ar.IDToken.Audience, - HomeAccountID: ar.Account.HomeAccountID, - TenantID: tenant, - Username: username, - Version: "1.0", - }, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azidentity.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azidentity.go deleted file mode 100644 index b0965036..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azidentity.go +++ /dev/null @@ -1,190 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package azidentity - -import ( - "bytes" - "context" - "errors" - "fmt" - "io" - "net/http" - "net/url" - "os" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/streaming" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity/internal" - "github.com/AzureAD/microsoft-authentication-library-for-go/apps/confidential" - "github.com/AzureAD/microsoft-authentication-library-for-go/apps/public" -) - -const ( - azureAdditionallyAllowedTenants = "AZURE_ADDITIONALLY_ALLOWED_TENANTS" - azureAuthorityHost = "AZURE_AUTHORITY_HOST" - azureClientCertificatePassword = "AZURE_CLIENT_CERTIFICATE_PASSWORD" - azureClientCertificatePath = "AZURE_CLIENT_CERTIFICATE_PATH" - azureClientID = "AZURE_CLIENT_ID" - azureClientSecret = "AZURE_CLIENT_SECRET" - azureFederatedTokenFile = "AZURE_FEDERATED_TOKEN_FILE" - azurePassword = "AZURE_PASSWORD" - azureRegionalAuthorityName = "AZURE_REGIONAL_AUTHORITY_NAME" - azureTenantID = "AZURE_TENANT_ID" - azureUsername = "AZURE_USERNAME" - - organizationsTenantID = "organizations" - developerSignOnClientID = "04b07795-8ddb-461a-bbee-02f9e1bf7b46" - defaultSuffix = "/.default" - - traceNamespace = "Microsoft.Entra" - traceOpGetToken = "GetToken" - traceOpAuthenticate = "Authenticate" -) - -var ( - // capability CP1 indicates the client application is capable of handling CAE claims challenges - cp1 = []string{"CP1"} - errInvalidTenantID = errors.New("invalid tenantID. You can locate your tenantID by following the instructions listed here: https://learn.microsoft.com/partner-center/find-ids-and-domain-names") -) - -// tokenCachePersistenceOptions contains options for persistent token caching -type tokenCachePersistenceOptions = internal.TokenCachePersistenceOptions - -// setAuthorityHost initializes the authority host for credentials. Precedence is: -// 1. cloud.Configuration.ActiveDirectoryAuthorityHost value set by user -// 2. value of AZURE_AUTHORITY_HOST -// 3. default: Azure Public Cloud -func setAuthorityHost(cc cloud.Configuration) (string, error) { - host := cc.ActiveDirectoryAuthorityHost - if host == "" { - if len(cc.Services) > 0 { - return "", errors.New("missing ActiveDirectoryAuthorityHost for specified cloud") - } - host = cloud.AzurePublic.ActiveDirectoryAuthorityHost - if envAuthorityHost := os.Getenv(azureAuthorityHost); envAuthorityHost != "" { - host = envAuthorityHost - } - } - u, err := url.Parse(host) - if err != nil { - return "", err - } - if u.Scheme != "https" { - return "", errors.New("cannot use an authority host without https") - } - return host, nil -} - -// resolveAdditionalTenants returns a copy of tenants, simplified when tenants contains a wildcard -func resolveAdditionalTenants(tenants []string) []string { - if len(tenants) == 0 { - return nil - } - for _, t := range tenants { - // a wildcard makes all other values redundant - if t == "*" { - return []string{"*"} - } - } - cp := make([]string, len(tenants)) - copy(cp, tenants) - return cp -} - -// resolveTenant returns the correct tenant for a token request -func resolveTenant(defaultTenant, specified, credName string, additionalTenants []string) (string, error) { - if specified == "" || specified == defaultTenant { - return defaultTenant, nil - } - if defaultTenant == "adfs" { - return "", errors.New("ADFS doesn't support tenants") - } - if !validTenantID(specified) { - return "", errInvalidTenantID - } - for _, t := range additionalTenants { - if t == "*" || t == specified { - return specified, nil - } - } - return "", fmt.Errorf(`%s isn't configured to acquire tokens for tenant %q. To enable acquiring tokens for this tenant add it to the AdditionallyAllowedTenants on the credential options, or add "*" to allow acquiring tokens for any tenant`, credName, specified) -} - -func alphanumeric(r rune) bool { - return ('0' <= r && r <= '9') || ('a' <= r && r <= 'z') || ('A' <= r && r <= 'Z') -} - -func validTenantID(tenantID string) bool { - if len(tenantID) < 1 { - return false - } - for _, r := range tenantID { - if !(alphanumeric(r) || r == '.' || r == '-') { - return false - } - } - return true -} - -func doForClient(client *azcore.Client, r *http.Request) (*http.Response, error) { - req, err := runtime.NewRequest(r.Context(), r.Method, r.URL.String()) - if err != nil { - return nil, err - } - if r.Body != nil && r.Body != http.NoBody { - // create a rewindable body from the existing body as required - var body io.ReadSeekCloser - if rsc, ok := r.Body.(io.ReadSeekCloser); ok { - body = rsc - } else { - b, err := io.ReadAll(r.Body) - if err != nil { - return nil, err - } - body = streaming.NopCloser(bytes.NewReader(b)) - } - err = req.SetBody(body, r.Header.Get("Content-Type")) - if err != nil { - return nil, err - } - } - - // copy headers to the new request, ignoring any for which the new request has a value - h := req.Raw().Header - for key, vals := range r.Header { - if _, has := h[key]; !has { - for _, val := range vals { - h.Add(key, val) - } - } - } - - resp, err := client.Pipeline().Do(req) - if err != nil { - return nil, err - } - return resp, err -} - -// enables fakes for test scenarios -type msalConfidentialClient interface { - AcquireTokenSilent(ctx context.Context, scopes []string, options ...confidential.AcquireSilentOption) (confidential.AuthResult, error) - AcquireTokenByAuthCode(ctx context.Context, code string, redirectURI string, scopes []string, options ...confidential.AcquireByAuthCodeOption) (confidential.AuthResult, error) - AcquireTokenByCredential(ctx context.Context, scopes []string, options ...confidential.AcquireByCredentialOption) (confidential.AuthResult, error) - AcquireTokenOnBehalfOf(ctx context.Context, userAssertion string, scopes []string, options ...confidential.AcquireOnBehalfOfOption) (confidential.AuthResult, error) -} - -// enables fakes for test scenarios -type msalPublicClient interface { - AcquireTokenSilent(ctx context.Context, scopes []string, options ...public.AcquireSilentOption) (public.AuthResult, error) - AcquireTokenByUsernamePassword(ctx context.Context, scopes []string, username string, password string, options ...public.AcquireByUsernamePasswordOption) (public.AuthResult, error) - AcquireTokenByDeviceCode(ctx context.Context, scopes []string, options ...public.AcquireByDeviceCodeOption) (public.DeviceCode, error) - AcquireTokenByAuthCode(ctx context.Context, code string, redirectURI string, scopes []string, options ...public.AcquireByAuthCodeOption) (public.AuthResult, error) - AcquireTokenInteractive(ctx context.Context, scopes []string, options ...public.AcquireInteractiveOption) (public.AuthResult, error) -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azure_cli_credential.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azure_cli_credential.go deleted file mode 100644 index b9976f5f..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azure_cli_credential.go +++ /dev/null @@ -1,190 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package azidentity - -import ( - "bytes" - "context" - "encoding/json" - "errors" - "fmt" - "os" - "os/exec" - "runtime" - "strings" - "sync" - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/internal/log" -) - -const credNameAzureCLI = "AzureCLICredential" - -type azTokenProvider func(ctx context.Context, scopes []string, tenant, subscription string) ([]byte, error) - -// AzureCLICredentialOptions contains optional parameters for AzureCLICredential. -type AzureCLICredentialOptions struct { - // AdditionallyAllowedTenants specifies tenants for which the credential may acquire tokens, in addition - // to TenantID. Add the wildcard value "*" to allow the credential to acquire tokens for any tenant the - // logged in account can access. - AdditionallyAllowedTenants []string - - // Subscription is the name or ID of a subscription. Set this to acquire tokens for an account other - // than the Azure CLI's current account. - Subscription string - - // TenantID identifies the tenant the credential should authenticate in. - // Defaults to the CLI's default tenant, which is typically the home tenant of the logged in user. - TenantID string - - // inDefaultChain is true when the credential is part of DefaultAzureCredential - inDefaultChain bool - // tokenProvider is used by tests to fake invoking az - tokenProvider azTokenProvider -} - -// init returns an instance of AzureCLICredentialOptions initialized with default values. -func (o *AzureCLICredentialOptions) init() { - if o.tokenProvider == nil { - o.tokenProvider = defaultAzTokenProvider - } -} - -// AzureCLICredential authenticates as the identity logged in to the Azure CLI. -type AzureCLICredential struct { - mu *sync.Mutex - opts AzureCLICredentialOptions -} - -// NewAzureCLICredential constructs an AzureCLICredential. Pass nil to accept default options. -func NewAzureCLICredential(options *AzureCLICredentialOptions) (*AzureCLICredential, error) { - cp := AzureCLICredentialOptions{} - if options != nil { - cp = *options - } - for _, r := range cp.Subscription { - if !(alphanumeric(r) || r == '-' || r == '_' || r == ' ' || r == '.') { - return nil, fmt.Errorf("%s: invalid Subscription %q", credNameAzureCLI, cp.Subscription) - } - } - if cp.TenantID != "" && !validTenantID(cp.TenantID) { - return nil, errInvalidTenantID - } - cp.init() - cp.AdditionallyAllowedTenants = resolveAdditionalTenants(cp.AdditionallyAllowedTenants) - return &AzureCLICredential{mu: &sync.Mutex{}, opts: cp}, nil -} - -// GetToken requests a token from the Azure CLI. This credential doesn't cache tokens, so every call invokes the CLI. -// This method is called automatically by Azure SDK clients. -func (c *AzureCLICredential) GetToken(ctx context.Context, opts policy.TokenRequestOptions) (azcore.AccessToken, error) { - at := azcore.AccessToken{} - if len(opts.Scopes) != 1 { - return at, errors.New(credNameAzureCLI + ": GetToken() requires exactly one scope") - } - if !validScope(opts.Scopes[0]) { - return at, fmt.Errorf("%s.GetToken(): invalid scope %q", credNameAzureCLI, opts.Scopes[0]) - } - tenant, err := resolveTenant(c.opts.TenantID, opts.TenantID, credNameAzureCLI, c.opts.AdditionallyAllowedTenants) - if err != nil { - return at, err - } - c.mu.Lock() - defer c.mu.Unlock() - b, err := c.opts.tokenProvider(ctx, opts.Scopes, tenant, c.opts.Subscription) - if err == nil { - at, err = c.createAccessToken(b) - } - if err != nil { - err = unavailableIfInChain(err, c.opts.inDefaultChain) - return at, err - } - msg := fmt.Sprintf("%s.GetToken() acquired a token for scope %q", credNameAzureCLI, strings.Join(opts.Scopes, ", ")) - log.Write(EventAuthentication, msg) - return at, nil -} - -// defaultAzTokenProvider invokes the Azure CLI to acquire a token. It assumes -// callers have verified that all string arguments are safe to pass to the CLI. -var defaultAzTokenProvider azTokenProvider = func(ctx context.Context, scopes []string, tenantID, subscription string) ([]byte, error) { - // pass the CLI a Microsoft Entra ID v1 resource because we don't know which CLI version is installed and older ones don't support v2 scopes - resource := strings.TrimSuffix(scopes[0], defaultSuffix) - // set a default timeout for this authentication iff the application hasn't done so already - var cancel context.CancelFunc - if _, hasDeadline := ctx.Deadline(); !hasDeadline { - ctx, cancel = context.WithTimeout(ctx, cliTimeout) - defer cancel() - } - commandLine := "az account get-access-token -o json --resource " + resource - if tenantID != "" { - commandLine += " --tenant " + tenantID - } - if subscription != "" { - // subscription needs quotes because it may contain spaces - commandLine += ` --subscription "` + subscription + `"` - } - var cliCmd *exec.Cmd - if runtime.GOOS == "windows" { - dir := os.Getenv("SYSTEMROOT") - if dir == "" { - return nil, newCredentialUnavailableError(credNameAzureCLI, "environment variable 'SYSTEMROOT' has no value") - } - cliCmd = exec.CommandContext(ctx, "cmd.exe", "/c", commandLine) - cliCmd.Dir = dir - } else { - cliCmd = exec.CommandContext(ctx, "/bin/sh", "-c", commandLine) - cliCmd.Dir = "/bin" - } - cliCmd.Env = os.Environ() - var stderr bytes.Buffer - cliCmd.Stderr = &stderr - - output, err := cliCmd.Output() - if err != nil { - msg := stderr.String() - var exErr *exec.ExitError - if errors.As(err, &exErr) && exErr.ExitCode() == 127 || strings.HasPrefix(msg, "'az' is not recognized") { - msg = "Azure CLI not found on path" - } - if msg == "" { - msg = err.Error() - } - return nil, newCredentialUnavailableError(credNameAzureCLI, msg) - } - - return output, nil -} - -func (c *AzureCLICredential) createAccessToken(tk []byte) (azcore.AccessToken, error) { - t := struct { - AccessToken string `json:"accessToken"` - Expires_On int64 `json:"expires_on"` - ExpiresOn string `json:"expiresOn"` - }{} - err := json.Unmarshal(tk, &t) - if err != nil { - return azcore.AccessToken{}, err - } - - exp := time.Unix(t.Expires_On, 0) - if t.Expires_On == 0 { - exp, err = time.ParseInLocation("2006-01-02 15:04:05.999999", t.ExpiresOn, time.Local) - if err != nil { - return azcore.AccessToken{}, fmt.Errorf("%s: error parsing token expiration time %q: %v", credNameAzureCLI, t.ExpiresOn, err) - } - } - - converted := azcore.AccessToken{ - Token: t.AccessToken, - ExpiresOn: exp.UTC(), - } - return converted, nil -} - -var _ azcore.TokenCredential = (*AzureCLICredential)(nil) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azure_developer_cli_credential.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azure_developer_cli_credential.go deleted file mode 100644 index cbe7c4c2..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azure_developer_cli_credential.go +++ /dev/null @@ -1,169 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package azidentity - -import ( - "bytes" - "context" - "encoding/json" - "errors" - "fmt" - "os" - "os/exec" - "runtime" - "strings" - "sync" - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/internal/log" -) - -const credNameAzureDeveloperCLI = "AzureDeveloperCLICredential" - -type azdTokenProvider func(ctx context.Context, scopes []string, tenant string) ([]byte, error) - -// AzureDeveloperCLICredentialOptions contains optional parameters for AzureDeveloperCLICredential. -type AzureDeveloperCLICredentialOptions struct { - // AdditionallyAllowedTenants specifies tenants for which the credential may acquire tokens, in addition - // to TenantID. Add the wildcard value "*" to allow the credential to acquire tokens for any tenant the - // logged in account can access. - AdditionallyAllowedTenants []string - - // TenantID identifies the tenant the credential should authenticate in. Defaults to the azd environment, - // which is the tenant of the selected Azure subscription. - TenantID string - - // inDefaultChain is true when the credential is part of DefaultAzureCredential - inDefaultChain bool - // tokenProvider is used by tests to fake invoking azd - tokenProvider azdTokenProvider -} - -// AzureDeveloperCLICredential authenticates as the identity logged in to the [Azure Developer CLI]. -// -// [Azure Developer CLI]: https://learn.microsoft.com/azure/developer/azure-developer-cli/overview -type AzureDeveloperCLICredential struct { - mu *sync.Mutex - opts AzureDeveloperCLICredentialOptions -} - -// NewAzureDeveloperCLICredential constructs an AzureDeveloperCLICredential. Pass nil to accept default options. -func NewAzureDeveloperCLICredential(options *AzureDeveloperCLICredentialOptions) (*AzureDeveloperCLICredential, error) { - cp := AzureDeveloperCLICredentialOptions{} - if options != nil { - cp = *options - } - if cp.TenantID != "" && !validTenantID(cp.TenantID) { - return nil, errInvalidTenantID - } - if cp.tokenProvider == nil { - cp.tokenProvider = defaultAzdTokenProvider - } - return &AzureDeveloperCLICredential{mu: &sync.Mutex{}, opts: cp}, nil -} - -// GetToken requests a token from the Azure Developer CLI. This credential doesn't cache tokens, so every call invokes azd. -// This method is called automatically by Azure SDK clients. -func (c *AzureDeveloperCLICredential) GetToken(ctx context.Context, opts policy.TokenRequestOptions) (azcore.AccessToken, error) { - at := azcore.AccessToken{} - if len(opts.Scopes) == 0 { - return at, errors.New(credNameAzureDeveloperCLI + ": GetToken() requires at least one scope") - } - for _, scope := range opts.Scopes { - if !validScope(scope) { - return at, fmt.Errorf("%s.GetToken(): invalid scope %q", credNameAzureDeveloperCLI, scope) - } - } - tenant, err := resolveTenant(c.opts.TenantID, opts.TenantID, credNameAzureDeveloperCLI, c.opts.AdditionallyAllowedTenants) - if err != nil { - return at, err - } - c.mu.Lock() - defer c.mu.Unlock() - b, err := c.opts.tokenProvider(ctx, opts.Scopes, tenant) - if err == nil { - at, err = c.createAccessToken(b) - } - if err != nil { - err = unavailableIfInChain(err, c.opts.inDefaultChain) - return at, err - } - msg := fmt.Sprintf("%s.GetToken() acquired a token for scope %q", credNameAzureDeveloperCLI, strings.Join(opts.Scopes, ", ")) - log.Write(EventAuthentication, msg) - return at, nil -} - -// defaultAzTokenProvider invokes the Azure Developer CLI to acquire a token. It assumes -// callers have verified that all string arguments are safe to pass to the CLI. -var defaultAzdTokenProvider azdTokenProvider = func(ctx context.Context, scopes []string, tenant string) ([]byte, error) { - // set a default timeout for this authentication iff the application hasn't done so already - var cancel context.CancelFunc - if _, hasDeadline := ctx.Deadline(); !hasDeadline { - ctx, cancel = context.WithTimeout(ctx, cliTimeout) - defer cancel() - } - commandLine := "azd auth token -o json" - if tenant != "" { - commandLine += " --tenant-id " + tenant - } - for _, scope := range scopes { - commandLine += " --scope " + scope - } - var cliCmd *exec.Cmd - if runtime.GOOS == "windows" { - dir := os.Getenv("SYSTEMROOT") - if dir == "" { - return nil, newCredentialUnavailableError(credNameAzureDeveloperCLI, "environment variable 'SYSTEMROOT' has no value") - } - cliCmd = exec.CommandContext(ctx, "cmd.exe", "/c", commandLine) - cliCmd.Dir = dir - } else { - cliCmd = exec.CommandContext(ctx, "/bin/sh", "-c", commandLine) - cliCmd.Dir = "/bin" - } - cliCmd.Env = os.Environ() - var stderr bytes.Buffer - cliCmd.Stderr = &stderr - output, err := cliCmd.Output() - if err != nil { - msg := stderr.String() - var exErr *exec.ExitError - if errors.As(err, &exErr) && exErr.ExitCode() == 127 || strings.HasPrefix(msg, "'azd' is not recognized") { - msg = "Azure Developer CLI not found on path" - } else if strings.Contains(msg, "azd auth login") { - msg = `please run "azd auth login" from a command prompt to authenticate before using this credential` - } - if msg == "" { - msg = err.Error() - } - return nil, newCredentialUnavailableError(credNameAzureDeveloperCLI, msg) - } - return output, nil -} - -func (c *AzureDeveloperCLICredential) createAccessToken(tk []byte) (azcore.AccessToken, error) { - t := struct { - AccessToken string `json:"token"` - ExpiresOn string `json:"expiresOn"` - }{} - err := json.Unmarshal(tk, &t) - if err != nil { - return azcore.AccessToken{}, err - } - exp, err := time.Parse("2006-01-02T15:04:05Z", t.ExpiresOn) - if err != nil { - return azcore.AccessToken{}, fmt.Errorf("error parsing token expiration time %q: %v", t.ExpiresOn, err) - } - return azcore.AccessToken{ - ExpiresOn: exp.UTC(), - Token: t.AccessToken, - }, nil -} - -var _ azcore.TokenCredential = (*AzureDeveloperCLICredential)(nil) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azure_pipelines_credential.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azure_pipelines_credential.go deleted file mode 100644 index 2655543a..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azure_pipelines_credential.go +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package azidentity - -import ( - "context" - "encoding/json" - "errors" - "fmt" - "net/http" - "os" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" -) - -const ( - credNameAzurePipelines = "AzurePipelinesCredential" - oidcAPIVersion = "7.1" - systemAccessToken = "SYSTEM_ACCESSTOKEN" - systemOIDCRequestURI = "SYSTEM_OIDCREQUESTURI" -) - -// azurePipelinesCredential authenticates with workload identity federation in an Azure Pipeline. See -// [Azure Pipelines documentation] for more information. -// -// [Azure Pipelines documentation]: https://learn.microsoft.com/azure/devops/pipelines/library/connect-to-azure?view=azure-devops#create-an-azure-resource-manager-service-connection-that-uses-workload-identity-federation -type azurePipelinesCredential struct { - connectionID, oidcURI, systemAccessToken string - cred *ClientAssertionCredential -} - -// azurePipelinesCredentialOptions contains optional parameters for AzurePipelinesCredential. -type azurePipelinesCredentialOptions struct { - azcore.ClientOptions - - // AdditionallyAllowedTenants specifies additional tenants for which the credential may acquire tokens. - // Add the wildcard value "*" to allow the credential to acquire tokens for any tenant in which the - // application is registered. - AdditionallyAllowedTenants []string - - // DisableInstanceDiscovery should be set true only by applications authenticating in disconnected clouds, or - // private clouds such as Azure Stack. It determines whether the credential requests Microsoft Entra instance metadata - // from https://login.microsoft.com before authenticating. Setting this to true will skip this request, making - // the application responsible for ensuring the configured authority is valid and trustworthy. - DisableInstanceDiscovery bool -} - -// newAzurePipelinesCredential is the constructor for AzurePipelinesCredential. In addition to its required arguments, -// it reads a security token for the running build, which is required to authenticate the service connection, from the -// environment variable SYSTEM_ACCESSTOKEN. See the [Azure Pipelines documentation] for an example showing how to set -// this variable in build job YAML. -// -// [Azure Pipelines documentation]: https://learn.microsoft.com/azure/devops/pipelines/build/variables?view=azure-devops&tabs=yaml#systemaccesstoken -func newAzurePipelinesCredential(tenantID, clientID, serviceConnectionID string, options *azurePipelinesCredentialOptions) (*azurePipelinesCredential, error) { - if options == nil { - options = &azurePipelinesCredentialOptions{} - } - u := os.Getenv(systemOIDCRequestURI) - if u == "" { - return nil, fmt.Errorf("no value for environment variable %s. This should be set by Azure Pipelines", systemOIDCRequestURI) - } - sat := os.Getenv(systemAccessToken) - if sat == "" { - return nil, errors.New("no value for environment variable " + systemAccessToken) - } - a := azurePipelinesCredential{ - connectionID: serviceConnectionID, - oidcURI: u, - systemAccessToken: sat, - } - caco := ClientAssertionCredentialOptions{ - AdditionallyAllowedTenants: options.AdditionallyAllowedTenants, - ClientOptions: options.ClientOptions, - DisableInstanceDiscovery: options.DisableInstanceDiscovery, - } - cred, err := NewClientAssertionCredential(tenantID, clientID, a.getAssertion, &caco) - if err != nil { - return nil, err - } - cred.client.name = credNameAzurePipelines - a.cred = cred - return &a, nil -} - -// GetToken requests an access token from Microsoft Entra ID. Azure SDK clients call this method automatically. -func (a *azurePipelinesCredential) GetToken(ctx context.Context, opts policy.TokenRequestOptions) (azcore.AccessToken, error) { - var err error - ctx, endSpan := runtime.StartSpan(ctx, credNameAzurePipelines+"."+traceOpGetToken, a.cred.client.azClient.Tracer(), nil) - defer func() { endSpan(err) }() - tk, err := a.cred.GetToken(ctx, opts) - return tk, err -} - -func (a *azurePipelinesCredential) getAssertion(ctx context.Context) (string, error) { - url := a.oidcURI + "?api-version=" + oidcAPIVersion + "&serviceConnectionId=" + a.connectionID - url, err := runtime.EncodeQueryParams(url) - if err != nil { - return "", newAuthenticationFailedError(credNameAzurePipelines, "couldn't encode OIDC URL: "+err.Error(), nil, nil) - } - req, err := http.NewRequestWithContext(ctx, http.MethodPost, url, nil) - if err != nil { - return "", newAuthenticationFailedError(credNameAzurePipelines, "couldn't create OIDC token request: "+err.Error(), nil, nil) - } - req.Header.Set("Authorization", "Bearer "+a.systemAccessToken) - res, err := doForClient(a.cred.client.azClient, req) - if err != nil { - return "", newAuthenticationFailedError(credNameAzurePipelines, "couldn't send OIDC token request: "+err.Error(), nil, nil) - } - if res.StatusCode != http.StatusOK { - msg := res.Status + " response from the OIDC endpoint. Check service connection ID and Pipeline configuration" - // include the response because its body, if any, probably contains an error message. - // OK responses aren't included with errors because they probably contain secrets - return "", newAuthenticationFailedError(credNameAzurePipelines, msg, res, nil) - } - b, err := runtime.Payload(res) - if err != nil { - return "", newAuthenticationFailedError(credNameAzurePipelines, "couldn't read OIDC response content: "+err.Error(), nil, nil) - } - var r struct { - OIDCToken string `json:"oidcToken"` - } - err = json.Unmarshal(b, &r) - if err != nil { - return "", newAuthenticationFailedError(credNameAzurePipelines, "unexpected response from OIDC endpoint", nil, nil) - } - return r.OIDCToken, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/chained_token_credential.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/chained_token_credential.go deleted file mode 100644 index 6c35a941..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/chained_token_credential.go +++ /dev/null @@ -1,138 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package azidentity - -import ( - "context" - "errors" - "fmt" - "strings" - "sync" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/internal/log" -) - -// ChainedTokenCredentialOptions contains optional parameters for ChainedTokenCredential. -type ChainedTokenCredentialOptions struct { - // RetrySources configures how the credential uses its sources. When true, the credential always attempts to - // authenticate through each source in turn, stopping when one succeeds. When false, the credential authenticates - // only through this first successful source--it never again tries the sources which failed. - RetrySources bool -} - -// ChainedTokenCredential links together multiple credentials and tries them sequentially when authenticating. By default, -// it tries all the credentials until one authenticates, after which it always uses that credential. -type ChainedTokenCredential struct { - cond *sync.Cond - iterating bool - name string - retrySources bool - sources []azcore.TokenCredential - successfulCredential azcore.TokenCredential -} - -// NewChainedTokenCredential creates a ChainedTokenCredential. Pass nil for options to accept defaults. -func NewChainedTokenCredential(sources []azcore.TokenCredential, options *ChainedTokenCredentialOptions) (*ChainedTokenCredential, error) { - if len(sources) == 0 { - return nil, errors.New("sources must contain at least one TokenCredential") - } - for _, source := range sources { - if source == nil { // cannot have a nil credential in the chain or else the application will panic when GetToken() is called on nil - return nil, errors.New("sources cannot contain nil") - } - } - cp := make([]azcore.TokenCredential, len(sources)) - copy(cp, sources) - if options == nil { - options = &ChainedTokenCredentialOptions{} - } - return &ChainedTokenCredential{ - cond: sync.NewCond(&sync.Mutex{}), - name: "ChainedTokenCredential", - retrySources: options.RetrySources, - sources: cp, - }, nil -} - -// GetToken calls GetToken on the chained credentials in turn, stopping when one returns a token. -// This method is called automatically by Azure SDK clients. -func (c *ChainedTokenCredential) GetToken(ctx context.Context, opts policy.TokenRequestOptions) (azcore.AccessToken, error) { - if !c.retrySources { - // ensure only one goroutine at a time iterates the sources and perhaps sets c.successfulCredential - c.cond.L.Lock() - for { - if c.successfulCredential != nil { - c.cond.L.Unlock() - return c.successfulCredential.GetToken(ctx, opts) - } - if !c.iterating { - c.iterating = true - // allow other goroutines to wait while this one iterates - c.cond.L.Unlock() - break - } - c.cond.Wait() - } - } - - var ( - err error - errs []error - successfulCredential azcore.TokenCredential - token azcore.AccessToken - unavailableErr credentialUnavailable - ) - for _, cred := range c.sources { - token, err = cred.GetToken(ctx, opts) - if err == nil { - log.Writef(EventAuthentication, "%s authenticated with %s", c.name, extractCredentialName(cred)) - successfulCredential = cred - break - } - errs = append(errs, err) - // continue to the next source iff this one returned credentialUnavailableError - if !errors.As(err, &unavailableErr) { - break - } - } - if c.iterating { - c.cond.L.Lock() - // this is nil when all credentials returned an error - c.successfulCredential = successfulCredential - c.iterating = false - c.cond.L.Unlock() - c.cond.Broadcast() - } - // err is the error returned by the last GetToken call. It will be nil when that call succeeds - if err != nil { - // return credentialUnavailableError iff all sources did so; return AuthenticationFailedError otherwise - msg := createChainedErrorMessage(errs) - if errors.As(err, &unavailableErr) { - err = newCredentialUnavailableError(c.name, msg) - } else { - res := getResponseFromError(err) - err = newAuthenticationFailedError(c.name, msg, res, err) - } - } - return token, err -} - -func createChainedErrorMessage(errs []error) string { - msg := "failed to acquire a token.\nAttempted credentials:" - for _, err := range errs { - msg += fmt.Sprintf("\n\t%s", err.Error()) - } - return msg -} - -func extractCredentialName(credential azcore.TokenCredential) string { - return strings.TrimPrefix(fmt.Sprintf("%T", credential), "*azidentity.") -} - -var _ azcore.TokenCredential = (*ChainedTokenCredential)(nil) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/ci.yml b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/ci.yml deleted file mode 100644 index 4cd8c514..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/ci.yml +++ /dev/null @@ -1,46 +0,0 @@ -# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. -trigger: - branches: - include: - - main - - feature/* - - hotfix/* - - release/* - paths: - include: - - sdk/azidentity/ - -pr: - branches: - include: - - main - - feature/* - - hotfix/* - - release/* - paths: - include: - - sdk/azidentity/ - -extends: - template: /eng/pipelines/templates/jobs/archetype-sdk-client.yml - parameters: - CloudConfig: - Public: - SubscriptionConfigurations: - - $(sub-config-azure-cloud-test-resources) - - $(sub-config-identity-test-resources) - EnvVars: - SYSTEM_ACCESSTOKEN: $(System.AccessToken) - RunLiveTests: true - ServiceDirectory: azidentity - UsePipelineProxy: false - - ${{ if endsWith(variables['Build.DefinitionName'], 'weekly') }}: - MatrixConfigs: - - Name: managed_identity_matrix - GenerateVMJobs: true - Path: sdk/azidentity/managed-identity-matrix.json - Selection: sparse - MatrixReplace: - - Pool=.*LINUXPOOL.*/azsdk-pool-mms-ubuntu-2204-identitymsi - - OSVmImage=.*LINUXNEXTVMIMAGE.*/azsdk-pool-mms-ubuntu-2204-1espt diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/client_assertion_credential.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/client_assertion_credential.go deleted file mode 100644 index b588750e..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/client_assertion_credential.go +++ /dev/null @@ -1,85 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package azidentity - -import ( - "context" - "errors" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/AzureAD/microsoft-authentication-library-for-go/apps/confidential" -) - -const credNameAssertion = "ClientAssertionCredential" - -// ClientAssertionCredential authenticates an application with assertions provided by a callback function. -// This credential is for advanced scenarios. [ClientCertificateCredential] has a more convenient API for -// the most common assertion scenario, authenticating a service principal with a certificate. See -// [Microsoft Entra ID documentation] for details of the assertion format. -// -// [Microsoft Entra ID documentation]: https://learn.microsoft.com/entra/identity-platform/certificate-credentials#assertion-format -type ClientAssertionCredential struct { - client *confidentialClient -} - -// ClientAssertionCredentialOptions contains optional parameters for ClientAssertionCredential. -type ClientAssertionCredentialOptions struct { - azcore.ClientOptions - - // AdditionallyAllowedTenants specifies additional tenants for which the credential may acquire tokens. - // Add the wildcard value "*" to allow the credential to acquire tokens for any tenant in which the - // application is registered. - AdditionallyAllowedTenants []string - - // DisableInstanceDiscovery should be set true only by applications authenticating in disconnected clouds, or - // private clouds such as Azure Stack. It determines whether the credential requests Microsoft Entra instance metadata - // from https://login.microsoft.com before authenticating. Setting this to true will skip this request, making - // the application responsible for ensuring the configured authority is valid and trustworthy. - DisableInstanceDiscovery bool - - // tokenCachePersistenceOptions enables persistent token caching when not nil. - tokenCachePersistenceOptions *tokenCachePersistenceOptions -} - -// NewClientAssertionCredential constructs a ClientAssertionCredential. The getAssertion function must be thread safe. Pass nil for options to accept defaults. -func NewClientAssertionCredential(tenantID, clientID string, getAssertion func(context.Context) (string, error), options *ClientAssertionCredentialOptions) (*ClientAssertionCredential, error) { - if getAssertion == nil { - return nil, errors.New("getAssertion must be a function that returns assertions") - } - if options == nil { - options = &ClientAssertionCredentialOptions{} - } - cred := confidential.NewCredFromAssertionCallback( - func(ctx context.Context, _ confidential.AssertionRequestOptions) (string, error) { - return getAssertion(ctx) - }, - ) - msalOpts := confidentialClientOptions{ - AdditionallyAllowedTenants: options.AdditionallyAllowedTenants, - ClientOptions: options.ClientOptions, - DisableInstanceDiscovery: options.DisableInstanceDiscovery, - tokenCachePersistenceOptions: options.tokenCachePersistenceOptions, - } - c, err := newConfidentialClient(tenantID, clientID, credNameAssertion, cred, msalOpts) - if err != nil { - return nil, err - } - return &ClientAssertionCredential{client: c}, nil -} - -// GetToken requests an access token from Microsoft Entra ID. This method is called automatically by Azure SDK clients. -func (c *ClientAssertionCredential) GetToken(ctx context.Context, opts policy.TokenRequestOptions) (azcore.AccessToken, error) { - var err error - ctx, endSpan := runtime.StartSpan(ctx, credNameAssertion+"."+traceOpGetToken, c.client.azClient.Tracer(), nil) - defer func() { endSpan(err) }() - tk, err := c.client.GetToken(ctx, opts) - return tk, err -} - -var _ azcore.TokenCredential = (*ClientAssertionCredential)(nil) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/client_certificate_credential.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/client_certificate_credential.go deleted file mode 100644 index 80cd96b5..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/client_certificate_credential.go +++ /dev/null @@ -1,174 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package azidentity - -import ( - "context" - "crypto" - "crypto/x509" - "encoding/pem" - "errors" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/AzureAD/microsoft-authentication-library-for-go/apps/confidential" - "golang.org/x/crypto/pkcs12" -) - -const credNameCert = "ClientCertificateCredential" - -// ClientCertificateCredentialOptions contains optional parameters for ClientCertificateCredential. -type ClientCertificateCredentialOptions struct { - azcore.ClientOptions - - // AdditionallyAllowedTenants specifies additional tenants for which the credential may acquire tokens. - // Add the wildcard value "*" to allow the credential to acquire tokens for any tenant in which the - // application is registered. - AdditionallyAllowedTenants []string - - // DisableInstanceDiscovery should be set true only by applications authenticating in disconnected clouds, or - // private clouds such as Azure Stack. It determines whether the credential requests Microsoft Entra instance metadata - // from https://login.microsoft.com before authenticating. Setting this to true will skip this request, making - // the application responsible for ensuring the configured authority is valid and trustworthy. - DisableInstanceDiscovery bool - - // SendCertificateChain controls whether the credential sends the public certificate chain in the x5c - // header of each token request's JWT. This is required for Subject Name/Issuer (SNI) authentication. - // Defaults to False. - SendCertificateChain bool - - // tokenCachePersistenceOptions enables persistent token caching when not nil. - tokenCachePersistenceOptions *tokenCachePersistenceOptions -} - -// ClientCertificateCredential authenticates a service principal with a certificate. -type ClientCertificateCredential struct { - client *confidentialClient -} - -// NewClientCertificateCredential constructs a ClientCertificateCredential. Pass nil for options to accept defaults. See -// [ParseCertificates] for help loading a certificate. -func NewClientCertificateCredential(tenantID string, clientID string, certs []*x509.Certificate, key crypto.PrivateKey, options *ClientCertificateCredentialOptions) (*ClientCertificateCredential, error) { - if len(certs) == 0 { - return nil, errors.New("at least one certificate is required") - } - if options == nil { - options = &ClientCertificateCredentialOptions{} - } - cred, err := confidential.NewCredFromCert(certs, key) - if err != nil { - return nil, err - } - msalOpts := confidentialClientOptions{ - AdditionallyAllowedTenants: options.AdditionallyAllowedTenants, - ClientOptions: options.ClientOptions, - DisableInstanceDiscovery: options.DisableInstanceDiscovery, - SendX5C: options.SendCertificateChain, - tokenCachePersistenceOptions: options.tokenCachePersistenceOptions, - } - c, err := newConfidentialClient(tenantID, clientID, credNameCert, cred, msalOpts) - if err != nil { - return nil, err - } - return &ClientCertificateCredential{client: c}, nil -} - -// GetToken requests an access token from Microsoft Entra ID. This method is called automatically by Azure SDK clients. -func (c *ClientCertificateCredential) GetToken(ctx context.Context, opts policy.TokenRequestOptions) (azcore.AccessToken, error) { - var err error - ctx, endSpan := runtime.StartSpan(ctx, credNameCert+"."+traceOpGetToken, c.client.azClient.Tracer(), nil) - defer func() { endSpan(err) }() - tk, err := c.client.GetToken(ctx, opts) - return tk, err -} - -// ParseCertificates loads certificates and a private key, in PEM or PKCS#12 format, for use with [NewClientCertificateCredential]. -// Pass nil for password if the private key isn't encrypted. This function has limitations, for example it can't decrypt keys in -// PEM format or PKCS#12 certificates that use SHA256 for message authentication. If you encounter such limitations, consider -// using another module to load the certificate and private key. -func ParseCertificates(certData []byte, password []byte) ([]*x509.Certificate, crypto.PrivateKey, error) { - var blocks []*pem.Block - var err error - if len(password) == 0 { - blocks, err = loadPEMCert(certData) - } - if len(blocks) == 0 || err != nil { - blocks, err = loadPKCS12Cert(certData, string(password)) - } - if err != nil { - return nil, nil, err - } - var certs []*x509.Certificate - var pk crypto.PrivateKey - for _, block := range blocks { - switch block.Type { - case "CERTIFICATE": - c, err := x509.ParseCertificate(block.Bytes) - if err != nil { - return nil, nil, err - } - certs = append(certs, c) - case "PRIVATE KEY": - if pk != nil { - return nil, nil, errors.New("certData contains multiple private keys") - } - pk, err = x509.ParsePKCS8PrivateKey(block.Bytes) - if err != nil { - pk, err = x509.ParsePKCS1PrivateKey(block.Bytes) - } - if err != nil { - return nil, nil, err - } - case "RSA PRIVATE KEY": - if pk != nil { - return nil, nil, errors.New("certData contains multiple private keys") - } - pk, err = x509.ParsePKCS1PrivateKey(block.Bytes) - if err != nil { - return nil, nil, err - } - } - } - if len(certs) == 0 { - return nil, nil, errors.New("found no certificate") - } - if pk == nil { - return nil, nil, errors.New("found no private key") - } - return certs, pk, nil -} - -func loadPEMCert(certData []byte) ([]*pem.Block, error) { - blocks := []*pem.Block{} - for { - var block *pem.Block - block, certData = pem.Decode(certData) - if block == nil { - break - } - blocks = append(blocks, block) - } - if len(blocks) == 0 { - return nil, errors.New("didn't find any PEM blocks") - } - return blocks, nil -} - -func loadPKCS12Cert(certData []byte, password string) ([]*pem.Block, error) { - blocks, err := pkcs12.ToPEM(certData, password) - if err != nil { - return nil, err - } - if len(blocks) == 0 { - // not mentioning PKCS12 in this message because we end up here when certData is garbage - return nil, errors.New("didn't find any certificate content") - } - return blocks, err -} - -var _ azcore.TokenCredential = (*ClientCertificateCredential)(nil) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/client_secret_credential.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/client_secret_credential.go deleted file mode 100644 index 9e6772e9..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/client_secret_credential.go +++ /dev/null @@ -1,75 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package azidentity - -import ( - "context" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/AzureAD/microsoft-authentication-library-for-go/apps/confidential" -) - -const credNameSecret = "ClientSecretCredential" - -// ClientSecretCredentialOptions contains optional parameters for ClientSecretCredential. -type ClientSecretCredentialOptions struct { - azcore.ClientOptions - - // AdditionallyAllowedTenants specifies additional tenants for which the credential may acquire tokens. - // Add the wildcard value "*" to allow the credential to acquire tokens for any tenant in which the - // application is registered. - AdditionallyAllowedTenants []string - - // DisableInstanceDiscovery should be set true only by applications authenticating in disconnected clouds, or - // private clouds such as Azure Stack. It determines whether the credential requests Microsoft Entra instance metadata - // from https://login.microsoft.com before authenticating. Setting this to true will skip this request, making - // the application responsible for ensuring the configured authority is valid and trustworthy. - DisableInstanceDiscovery bool - - // tokenCachePersistenceOptions enables persistent token caching when not nil. - tokenCachePersistenceOptions *tokenCachePersistenceOptions -} - -// ClientSecretCredential authenticates an application with a client secret. -type ClientSecretCredential struct { - client *confidentialClient -} - -// NewClientSecretCredential constructs a ClientSecretCredential. Pass nil for options to accept defaults. -func NewClientSecretCredential(tenantID string, clientID string, clientSecret string, options *ClientSecretCredentialOptions) (*ClientSecretCredential, error) { - if options == nil { - options = &ClientSecretCredentialOptions{} - } - cred, err := confidential.NewCredFromSecret(clientSecret) - if err != nil { - return nil, err - } - msalOpts := confidentialClientOptions{ - AdditionallyAllowedTenants: options.AdditionallyAllowedTenants, - ClientOptions: options.ClientOptions, - DisableInstanceDiscovery: options.DisableInstanceDiscovery, - tokenCachePersistenceOptions: options.tokenCachePersistenceOptions, - } - c, err := newConfidentialClient(tenantID, clientID, credNameSecret, cred, msalOpts) - if err != nil { - return nil, err - } - return &ClientSecretCredential{client: c}, nil -} - -// GetToken requests an access token from Microsoft Entra ID. This method is called automatically by Azure SDK clients. -func (c *ClientSecretCredential) GetToken(ctx context.Context, opts policy.TokenRequestOptions) (azcore.AccessToken, error) { - var err error - ctx, endSpan := runtime.StartSpan(ctx, credNameSecret+"."+traceOpGetToken, c.client.azClient.Tracer(), nil) - defer func() { endSpan(err) }() - tk, err := c.client.GetToken(ctx, opts) - return tk, err -} - -var _ azcore.TokenCredential = (*ClientSecretCredential)(nil) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/confidential_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/confidential_client.go deleted file mode 100644 index 3bd08c68..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/confidential_client.go +++ /dev/null @@ -1,184 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package azidentity - -import ( - "context" - "errors" - "fmt" - "net/http" - "os" - "strings" - "sync" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity/internal" - "github.com/Azure/azure-sdk-for-go/sdk/internal/log" - "github.com/AzureAD/microsoft-authentication-library-for-go/apps/confidential" -) - -type confidentialClientOptions struct { - azcore.ClientOptions - - AdditionallyAllowedTenants []string - // Assertion for on-behalf-of authentication - Assertion string - DisableInstanceDiscovery, SendX5C bool - tokenCachePersistenceOptions *tokenCachePersistenceOptions -} - -// confidentialClient wraps the MSAL confidential client -type confidentialClient struct { - cae, noCAE msalConfidentialClient - caeMu, noCAEMu, clientMu *sync.Mutex - clientID, tenantID string - cred confidential.Credential - host string - name string - opts confidentialClientOptions - region string - azClient *azcore.Client -} - -func newConfidentialClient(tenantID, clientID, name string, cred confidential.Credential, opts confidentialClientOptions) (*confidentialClient, error) { - if !validTenantID(tenantID) { - return nil, errInvalidTenantID - } - host, err := setAuthorityHost(opts.Cloud) - if err != nil { - return nil, err - } - client, err := azcore.NewClient(module, version, runtime.PipelineOptions{ - Tracing: runtime.TracingOptions{ - Namespace: traceNamespace, - }, - }, &opts.ClientOptions) - if err != nil { - return nil, err - } - opts.AdditionallyAllowedTenants = resolveAdditionalTenants(opts.AdditionallyAllowedTenants) - return &confidentialClient{ - caeMu: &sync.Mutex{}, - clientID: clientID, - clientMu: &sync.Mutex{}, - cred: cred, - host: host, - name: name, - noCAEMu: &sync.Mutex{}, - opts: opts, - region: os.Getenv(azureRegionalAuthorityName), - tenantID: tenantID, - azClient: client, - }, nil -} - -// GetToken requests an access token from MSAL, checking the cache first. -func (c *confidentialClient) GetToken(ctx context.Context, tro policy.TokenRequestOptions) (azcore.AccessToken, error) { - if len(tro.Scopes) < 1 { - return azcore.AccessToken{}, fmt.Errorf("%s.GetToken() requires at least one scope", c.name) - } - // we don't resolve the tenant for managed identities because they acquire tokens only from their home tenants - if c.name != credNameManagedIdentity { - tenant, err := c.resolveTenant(tro.TenantID) - if err != nil { - return azcore.AccessToken{}, err - } - tro.TenantID = tenant - } - client, mu, err := c.client(tro) - if err != nil { - return azcore.AccessToken{}, err - } - mu.Lock() - defer mu.Unlock() - var ar confidential.AuthResult - if c.opts.Assertion != "" { - ar, err = client.AcquireTokenOnBehalfOf(ctx, c.opts.Assertion, tro.Scopes, confidential.WithClaims(tro.Claims), confidential.WithTenantID(tro.TenantID)) - } else { - ar, err = client.AcquireTokenSilent(ctx, tro.Scopes, confidential.WithClaims(tro.Claims), confidential.WithTenantID(tro.TenantID)) - if err != nil { - ar, err = client.AcquireTokenByCredential(ctx, tro.Scopes, confidential.WithClaims(tro.Claims), confidential.WithTenantID(tro.TenantID)) - } - } - if err != nil { - // We could get a credentialUnavailableError from managed identity authentication because in that case the error comes from our code. - // We return it directly because it affects the behavior of credential chains. Otherwise, we return AuthenticationFailedError. - var unavailableErr credentialUnavailable - if !errors.As(err, &unavailableErr) { - res := getResponseFromError(err) - err = newAuthenticationFailedError(c.name, err.Error(), res, err) - } - } else { - msg := fmt.Sprintf("%s.GetToken() acquired a token for scope %q", c.name, strings.Join(ar.GrantedScopes, ", ")) - log.Write(EventAuthentication, msg) - } - return azcore.AccessToken{Token: ar.AccessToken, ExpiresOn: ar.ExpiresOn.UTC()}, err -} - -func (c *confidentialClient) client(tro policy.TokenRequestOptions) (msalConfidentialClient, *sync.Mutex, error) { - c.clientMu.Lock() - defer c.clientMu.Unlock() - if tro.EnableCAE { - if c.cae == nil { - client, err := c.newMSALClient(true) - if err != nil { - return nil, nil, err - } - c.cae = client - } - return c.cae, c.caeMu, nil - } - if c.noCAE == nil { - client, err := c.newMSALClient(false) - if err != nil { - return nil, nil, err - } - c.noCAE = client - } - return c.noCAE, c.noCAEMu, nil -} - -func (c *confidentialClient) newMSALClient(enableCAE bool) (msalConfidentialClient, error) { - cache, err := internal.NewCache(c.opts.tokenCachePersistenceOptions, enableCAE) - if err != nil { - return nil, err - } - authority := runtime.JoinPaths(c.host, c.tenantID) - o := []confidential.Option{ - confidential.WithAzureRegion(c.region), - confidential.WithCache(cache), - confidential.WithHTTPClient(c), - } - if enableCAE { - o = append(o, confidential.WithClientCapabilities(cp1)) - } - if c.opts.SendX5C { - o = append(o, confidential.WithX5C()) - } - if c.opts.DisableInstanceDiscovery || strings.ToLower(c.tenantID) == "adfs" { - o = append(o, confidential.WithInstanceDiscovery(false)) - } - return confidential.New(authority, c.clientID, c.cred, o...) -} - -// resolveTenant returns the correct WithTenantID() argument for a token request given the client's -// configuration, or an error when that configuration doesn't allow the specified tenant -func (c *confidentialClient) resolveTenant(specified string) (string, error) { - return resolveTenant(c.tenantID, specified, c.name, c.opts.AdditionallyAllowedTenants) -} - -// these methods satisfy the MSAL ops.HTTPClient interface - -func (c *confidentialClient) CloseIdleConnections() { - // do nothing -} - -func (c *confidentialClient) Do(r *http.Request) (*http.Response, error) { - return doForClient(c.azClient, r) -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/default_azure_credential.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/default_azure_credential.go deleted file mode 100644 index 551d3199..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/default_azure_credential.go +++ /dev/null @@ -1,165 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package azidentity - -import ( - "context" - "os" - "strings" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/internal/log" -) - -// DefaultAzureCredentialOptions contains optional parameters for DefaultAzureCredential. -// These options may not apply to all credentials in the chain. -type DefaultAzureCredentialOptions struct { - // ClientOptions has additional options for credentials that use an Azure SDK HTTP pipeline. These options don't apply - // to credential types that authenticate via external tools such as the Azure CLI. - azcore.ClientOptions - - // AdditionallyAllowedTenants specifies additional tenants for which the credential may acquire tokens. Add - // the wildcard value "*" to allow the credential to acquire tokens for any tenant. This value can also be - // set as a semicolon delimited list of tenants in the environment variable AZURE_ADDITIONALLY_ALLOWED_TENANTS. - AdditionallyAllowedTenants []string - // DisableInstanceDiscovery should be set true only by applications authenticating in disconnected clouds, or - // private clouds such as Azure Stack. It determines whether the credential requests Microsoft Entra instance metadata - // from https://login.microsoft.com before authenticating. Setting this to true will skip this request, making - // the application responsible for ensuring the configured authority is valid and trustworthy. - DisableInstanceDiscovery bool - // TenantID sets the default tenant for authentication via the Azure CLI and workload identity. - TenantID string -} - -// DefaultAzureCredential is a default credential chain for applications that will deploy to Azure. -// It combines credentials suitable for deployment with credentials suitable for local development. -// It attempts to authenticate with each of these credential types, in the following order, stopping -// when one provides a token: -// -// - [EnvironmentCredential] -// - [WorkloadIdentityCredential], if environment variable configuration is set by the Azure workload -// identity webhook. Use [WorkloadIdentityCredential] directly when not using the webhook or needing -// more control over its configuration. -// - [ManagedIdentityCredential] -// - [AzureCLICredential] -// - [AzureDeveloperCLICredential] -// -// Consult the documentation for these credential types for more information on how they authenticate. -// Once a credential has successfully authenticated, DefaultAzureCredential will use that credential for -// every subsequent authentication. -type DefaultAzureCredential struct { - chain *ChainedTokenCredential -} - -// NewDefaultAzureCredential creates a DefaultAzureCredential. Pass nil for options to accept defaults. -func NewDefaultAzureCredential(options *DefaultAzureCredentialOptions) (*DefaultAzureCredential, error) { - var creds []azcore.TokenCredential - var errorMessages []string - - if options == nil { - options = &DefaultAzureCredentialOptions{} - } - additionalTenants := options.AdditionallyAllowedTenants - if len(additionalTenants) == 0 { - if tenants := os.Getenv(azureAdditionallyAllowedTenants); tenants != "" { - additionalTenants = strings.Split(tenants, ";") - } - } - - envCred, err := NewEnvironmentCredential(&EnvironmentCredentialOptions{ - ClientOptions: options.ClientOptions, - DisableInstanceDiscovery: options.DisableInstanceDiscovery, - additionallyAllowedTenants: additionalTenants, - }) - if err == nil { - creds = append(creds, envCred) - } else { - errorMessages = append(errorMessages, "EnvironmentCredential: "+err.Error()) - creds = append(creds, &defaultCredentialErrorReporter{credType: "EnvironmentCredential", err: err}) - } - - wic, err := NewWorkloadIdentityCredential(&WorkloadIdentityCredentialOptions{ - AdditionallyAllowedTenants: additionalTenants, - ClientOptions: options.ClientOptions, - DisableInstanceDiscovery: options.DisableInstanceDiscovery, - TenantID: options.TenantID, - }) - if err == nil { - creds = append(creds, wic) - } else { - errorMessages = append(errorMessages, credNameWorkloadIdentity+": "+err.Error()) - creds = append(creds, &defaultCredentialErrorReporter{credType: credNameWorkloadIdentity, err: err}) - } - - o := &ManagedIdentityCredentialOptions{ClientOptions: options.ClientOptions, dac: true} - if ID, ok := os.LookupEnv(azureClientID); ok { - o.ID = ClientID(ID) - } - miCred, err := NewManagedIdentityCredential(o) - if err == nil { - creds = append(creds, miCred) - } else { - errorMessages = append(errorMessages, credNameManagedIdentity+": "+err.Error()) - creds = append(creds, &defaultCredentialErrorReporter{credType: credNameManagedIdentity, err: err}) - } - - cliCred, err := NewAzureCLICredential(&AzureCLICredentialOptions{AdditionallyAllowedTenants: additionalTenants, TenantID: options.TenantID}) - if err == nil { - creds = append(creds, cliCred) - } else { - errorMessages = append(errorMessages, credNameAzureCLI+": "+err.Error()) - creds = append(creds, &defaultCredentialErrorReporter{credType: credNameAzureCLI, err: err}) - } - - azdCred, err := NewAzureDeveloperCLICredential(&AzureDeveloperCLICredentialOptions{ - AdditionallyAllowedTenants: additionalTenants, - TenantID: options.TenantID, - }) - if err == nil { - creds = append(creds, azdCred) - } else { - errorMessages = append(errorMessages, credNameAzureDeveloperCLI+": "+err.Error()) - creds = append(creds, &defaultCredentialErrorReporter{credType: credNameAzureDeveloperCLI, err: err}) - } - - if len(errorMessages) > 0 { - log.Writef(EventAuthentication, "NewDefaultAzureCredential failed to initialize some credentials:\n\t%s", strings.Join(errorMessages, "\n\t")) - } - - chain, err := NewChainedTokenCredential(creds, nil) - if err != nil { - return nil, err - } - chain.name = "DefaultAzureCredential" - return &DefaultAzureCredential{chain: chain}, nil -} - -// GetToken requests an access token from Microsoft Entra ID. This method is called automatically by Azure SDK clients. -func (c *DefaultAzureCredential) GetToken(ctx context.Context, opts policy.TokenRequestOptions) (azcore.AccessToken, error) { - return c.chain.GetToken(ctx, opts) -} - -var _ azcore.TokenCredential = (*DefaultAzureCredential)(nil) - -// defaultCredentialErrorReporter is a substitute for credentials that couldn't be constructed. -// Its GetToken method always returns a credentialUnavailableError having the same message as -// the error that prevented constructing the credential. This ensures the message is present -// in the error returned by ChainedTokenCredential.GetToken() -type defaultCredentialErrorReporter struct { - credType string - err error -} - -func (d *defaultCredentialErrorReporter) GetToken(ctx context.Context, opts policy.TokenRequestOptions) (azcore.AccessToken, error) { - if _, ok := d.err.(credentialUnavailable); ok { - return azcore.AccessToken{}, d.err - } - return azcore.AccessToken{}, newCredentialUnavailableError(d.credType, d.err.Error()) -} - -var _ azcore.TokenCredential = (*defaultCredentialErrorReporter)(nil) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/developer_credential_util.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/developer_credential_util.go deleted file mode 100644 index be963d3a..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/developer_credential_util.go +++ /dev/null @@ -1,38 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package azidentity - -import ( - "errors" - "time" -) - -// cliTimeout is the default timeout for authentication attempts via CLI tools -const cliTimeout = 10 * time.Second - -// unavailableIfInChain returns err or, if the credential was invoked by DefaultAzureCredential, a -// credentialUnavailableError having the same message. This ensures DefaultAzureCredential will try -// the next credential in its chain (another developer credential). -func unavailableIfInChain(err error, inDefaultChain bool) error { - if err != nil && inDefaultChain { - var unavailableErr credentialUnavailable - if !errors.As(err, &unavailableErr) { - err = newCredentialUnavailableError(credNameAzureDeveloperCLI, err.Error()) - } - } - return err -} - -// validScope is for credentials authenticating via external tools. The authority validates scopes for all other credentials. -func validScope(scope string) bool { - for _, r := range scope { - if !(alphanumeric(r) || r == '.' || r == '-' || r == '_' || r == '/' || r == ':') { - return false - } - } - return true -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/device_code_credential.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/device_code_credential.go deleted file mode 100644 index cd30bedd..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/device_code_credential.go +++ /dev/null @@ -1,138 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package azidentity - -import ( - "context" - "fmt" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" -) - -const credNameDeviceCode = "DeviceCodeCredential" - -// DeviceCodeCredentialOptions contains optional parameters for DeviceCodeCredential. -type DeviceCodeCredentialOptions struct { - azcore.ClientOptions - - // AdditionallyAllowedTenants specifies additional tenants for which the credential may acquire - // tokens. Add the wildcard value "*" to allow the credential to acquire tokens for any tenant. - AdditionallyAllowedTenants []string - - // authenticationRecord returned by a call to a credential's Authenticate method. Set this option - // to enable the credential to use data from a previous authentication. - authenticationRecord authenticationRecord - - // ClientID is the ID of the application users will authenticate to. - // Defaults to the ID of an Azure development application. - ClientID string - - // disableAutomaticAuthentication prevents the credential from automatically prompting the user to authenticate. - // When this option is true, GetToken will return authenticationRequiredError when user interaction is necessary - // to acquire a token. - disableAutomaticAuthentication bool - - // DisableInstanceDiscovery should be set true only by applications authenticating in disconnected clouds, or - // private clouds such as Azure Stack. It determines whether the credential requests Microsoft Entra instance metadata - // from https://login.microsoft.com before authenticating. Setting this to true will skip this request, making - // the application responsible for ensuring the configured authority is valid and trustworthy. - DisableInstanceDiscovery bool - - // TenantID is the Microsoft Entra tenant the credential authenticates in. Defaults to the - // "organizations" tenant, which can authenticate work and school accounts. Required for single-tenant - // applications. - TenantID string - - // tokenCachePersistenceOptions enables persistent token caching when not nil. - tokenCachePersistenceOptions *tokenCachePersistenceOptions - - // UserPrompt controls how the credential presents authentication instructions. The credential calls - // this function with authentication details when it receives a device code. By default, the credential - // prints these details to stdout. - UserPrompt func(context.Context, DeviceCodeMessage) error -} - -func (o *DeviceCodeCredentialOptions) init() { - if o.TenantID == "" { - o.TenantID = organizationsTenantID - } - if o.ClientID == "" { - o.ClientID = developerSignOnClientID - } - if o.UserPrompt == nil { - o.UserPrompt = func(ctx context.Context, dc DeviceCodeMessage) error { - fmt.Println(dc.Message) - return nil - } - } -} - -// DeviceCodeMessage contains the information a user needs to complete authentication. -type DeviceCodeMessage struct { - // UserCode is the user code returned by the service. - UserCode string `json:"user_code"` - // VerificationURL is the URL at which the user must authenticate. - VerificationURL string `json:"verification_uri"` - // Message is user instruction from Microsoft Entra ID. - Message string `json:"message"` -} - -// DeviceCodeCredential acquires tokens for a user via the device code flow, which has the -// user browse to a Microsoft Entra URL, enter a code, and authenticate. It's useful -// for authenticating a user in an environment without a web browser, such as an SSH session. -// If a web browser is available, [InteractiveBrowserCredential] is more convenient because it -// automatically opens a browser to the login page. -type DeviceCodeCredential struct { - client *publicClient -} - -// NewDeviceCodeCredential creates a DeviceCodeCredential. Pass nil to accept default options. -func NewDeviceCodeCredential(options *DeviceCodeCredentialOptions) (*DeviceCodeCredential, error) { - cp := DeviceCodeCredentialOptions{} - if options != nil { - cp = *options - } - cp.init() - msalOpts := publicClientOptions{ - AdditionallyAllowedTenants: cp.AdditionallyAllowedTenants, - ClientOptions: cp.ClientOptions, - DeviceCodePrompt: cp.UserPrompt, - DisableAutomaticAuthentication: cp.disableAutomaticAuthentication, - DisableInstanceDiscovery: cp.DisableInstanceDiscovery, - Record: cp.authenticationRecord, - TokenCachePersistenceOptions: cp.tokenCachePersistenceOptions, - } - c, err := newPublicClient(cp.TenantID, cp.ClientID, credNameDeviceCode, msalOpts) - if err != nil { - return nil, err - } - c.name = credNameDeviceCode - return &DeviceCodeCredential{client: c}, nil -} - -// Authenticate a user via the device code flow. Subsequent calls to GetToken will automatically use the returned AuthenticationRecord. -func (c *DeviceCodeCredential) authenticate(ctx context.Context, opts *policy.TokenRequestOptions) (authenticationRecord, error) { - var err error - ctx, endSpan := runtime.StartSpan(ctx, credNameDeviceCode+"."+traceOpAuthenticate, c.client.azClient.Tracer(), nil) - defer func() { endSpan(err) }() - tk, err := c.client.Authenticate(ctx, opts) - return tk, err -} - -// GetToken requests an access token from Microsoft Entra ID. It will begin the device code flow and poll until the user completes authentication. -// This method is called automatically by Azure SDK clients. -func (c *DeviceCodeCredential) GetToken(ctx context.Context, opts policy.TokenRequestOptions) (azcore.AccessToken, error) { - var err error - ctx, endSpan := runtime.StartSpan(ctx, credNameDeviceCode+"."+traceOpGetToken, c.client.azClient.Tracer(), nil) - defer func() { endSpan(err) }() - tk, err := c.client.GetToken(ctx, opts) - return tk, err -} - -var _ azcore.TokenCredential = (*DeviceCodeCredential)(nil) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/environment_credential.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/environment_credential.go deleted file mode 100644 index b30f5474..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/environment_credential.go +++ /dev/null @@ -1,167 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package azidentity - -import ( - "context" - "errors" - "fmt" - "os" - "strings" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/internal/log" -) - -const envVarSendCertChain = "AZURE_CLIENT_SEND_CERTIFICATE_CHAIN" - -// EnvironmentCredentialOptions contains optional parameters for EnvironmentCredential -type EnvironmentCredentialOptions struct { - azcore.ClientOptions - - // DisableInstanceDiscovery should be set true only by applications authenticating in disconnected clouds, or - // private clouds such as Azure Stack. It determines whether the credential requests Microsoft Entra instance metadata - // from https://login.microsoft.com before authenticating. Setting this to true will skip this request, making - // the application responsible for ensuring the configured authority is valid and trustworthy. - DisableInstanceDiscovery bool - // additionallyAllowedTenants is used only by NewDefaultAzureCredential() to enable that constructor's explicit - // option to override the value of AZURE_ADDITIONALLY_ALLOWED_TENANTS. Applications using EnvironmentCredential - // directly should set that variable instead. This field should remain unexported to preserve this credential's - // unambiguous "all configuration from environment variables" design. - additionallyAllowedTenants []string -} - -// EnvironmentCredential authenticates a service principal with a secret or certificate, or a user with a password, depending -// on environment variable configuration. It reads configuration from these variables, in the following order: -// -// # Service principal with client secret -// -// AZURE_TENANT_ID: ID of the service principal's tenant. Also called its "directory" ID. -// -// AZURE_CLIENT_ID: the service principal's client ID -// -// AZURE_CLIENT_SECRET: one of the service principal's client secrets -// -// # Service principal with certificate -// -// AZURE_TENANT_ID: ID of the service principal's tenant. Also called its "directory" ID. -// -// AZURE_CLIENT_ID: the service principal's client ID -// -// AZURE_CLIENT_CERTIFICATE_PATH: path to a PEM or PKCS12 certificate file including the private key. -// -// AZURE_CLIENT_CERTIFICATE_PASSWORD: (optional) password for the certificate file. -// -// Note that this credential uses [ParseCertificates] to load the certificate and key from the file. If this -// function isn't able to parse your certificate, use [ClientCertificateCredential] instead. -// -// # User with username and password -// -// AZURE_TENANT_ID: (optional) tenant to authenticate in. Defaults to "organizations". -// -// AZURE_CLIENT_ID: client ID of the application the user will authenticate to -// -// AZURE_USERNAME: a username (usually an email address) -// -// AZURE_PASSWORD: the user's password -// -// # Configuration for multitenant applications -// -// To enable multitenant authentication, set AZURE_ADDITIONALLY_ALLOWED_TENANTS with a semicolon delimited list of tenants -// the credential may request tokens from in addition to the tenant specified by AZURE_TENANT_ID. Set -// AZURE_ADDITIONALLY_ALLOWED_TENANTS to "*" to enable the credential to request a token from any tenant. -type EnvironmentCredential struct { - cred azcore.TokenCredential -} - -// NewEnvironmentCredential creates an EnvironmentCredential. Pass nil to accept default options. -func NewEnvironmentCredential(options *EnvironmentCredentialOptions) (*EnvironmentCredential, error) { - if options == nil { - options = &EnvironmentCredentialOptions{} - } - tenantID := os.Getenv(azureTenantID) - if tenantID == "" { - return nil, errors.New("missing environment variable AZURE_TENANT_ID") - } - clientID := os.Getenv(azureClientID) - if clientID == "" { - return nil, errors.New("missing environment variable " + azureClientID) - } - // tenants set by NewDefaultAzureCredential() override the value of AZURE_ADDITIONALLY_ALLOWED_TENANTS - additionalTenants := options.additionallyAllowedTenants - if len(additionalTenants) == 0 { - if tenants := os.Getenv(azureAdditionallyAllowedTenants); tenants != "" { - additionalTenants = strings.Split(tenants, ";") - } - } - if clientSecret := os.Getenv(azureClientSecret); clientSecret != "" { - log.Write(EventAuthentication, "EnvironmentCredential will authenticate with ClientSecretCredential") - o := &ClientSecretCredentialOptions{ - AdditionallyAllowedTenants: additionalTenants, - ClientOptions: options.ClientOptions, - DisableInstanceDiscovery: options.DisableInstanceDiscovery, - } - cred, err := NewClientSecretCredential(tenantID, clientID, clientSecret, o) - if err != nil { - return nil, err - } - return &EnvironmentCredential{cred: cred}, nil - } - if certPath := os.Getenv(azureClientCertificatePath); certPath != "" { - log.Write(EventAuthentication, "EnvironmentCredential will authenticate with ClientCertificateCredential") - certData, err := os.ReadFile(certPath) - if err != nil { - return nil, fmt.Errorf(`failed to read certificate file "%s": %v`, certPath, err) - } - var password []byte - if v := os.Getenv(azureClientCertificatePassword); v != "" { - password = []byte(v) - } - certs, key, err := ParseCertificates(certData, password) - if err != nil { - return nil, fmt.Errorf("failed to parse %q due to error %q. This may be due to a limitation of this module's certificate loader. Consider calling NewClientCertificateCredential instead", certPath, err.Error()) - } - o := &ClientCertificateCredentialOptions{ - AdditionallyAllowedTenants: additionalTenants, - ClientOptions: options.ClientOptions, - DisableInstanceDiscovery: options.DisableInstanceDiscovery, - } - if v, ok := os.LookupEnv(envVarSendCertChain); ok { - o.SendCertificateChain = v == "1" || strings.ToLower(v) == "true" - } - cred, err := NewClientCertificateCredential(tenantID, clientID, certs, key, o) - if err != nil { - return nil, err - } - return &EnvironmentCredential{cred: cred}, nil - } - if username := os.Getenv(azureUsername); username != "" { - if password := os.Getenv(azurePassword); password != "" { - log.Write(EventAuthentication, "EnvironmentCredential will authenticate with UsernamePasswordCredential") - o := &UsernamePasswordCredentialOptions{ - AdditionallyAllowedTenants: additionalTenants, - ClientOptions: options.ClientOptions, - DisableInstanceDiscovery: options.DisableInstanceDiscovery, - } - cred, err := NewUsernamePasswordCredential(tenantID, clientID, username, password, o) - if err != nil { - return nil, err - } - return &EnvironmentCredential{cred: cred}, nil - } - return nil, errors.New("no value for AZURE_PASSWORD") - } - return nil, errors.New("incomplete environment variable configuration. Only AZURE_TENANT_ID and AZURE_CLIENT_ID are set") -} - -// GetToken requests an access token from Microsoft Entra ID. This method is called automatically by Azure SDK clients. -func (c *EnvironmentCredential) GetToken(ctx context.Context, opts policy.TokenRequestOptions) (azcore.AccessToken, error) { - return c.cred.GetToken(ctx, opts) -} - -var _ azcore.TokenCredential = (*EnvironmentCredential)(nil) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/errors.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/errors.go deleted file mode 100644 index 698650bb..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/errors.go +++ /dev/null @@ -1,168 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package azidentity - -import ( - "bytes" - "encoding/json" - "errors" - "fmt" - "net/http" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/internal/errorinfo" - msal "github.com/AzureAD/microsoft-authentication-library-for-go/apps/errors" -) - -// getResponseFromError retrieves the response carried by -// an AuthenticationFailedError or MSAL CallErr, if any -func getResponseFromError(err error) *http.Response { - var a *AuthenticationFailedError - var c msal.CallErr - var res *http.Response - if errors.As(err, &c) { - res = c.Resp - } else if errors.As(err, &a) { - res = a.RawResponse - } - return res -} - -// AuthenticationFailedError indicates an authentication request has failed. -type AuthenticationFailedError struct { - // RawResponse is the HTTP response motivating the error, if available. - RawResponse *http.Response - - credType string - message string - err error -} - -func newAuthenticationFailedError(credType string, message string, resp *http.Response, err error) error { - return &AuthenticationFailedError{credType: credType, message: message, RawResponse: resp, err: err} -} - -// Error implements the error interface. Note that the message contents are not contractual and can change over time. -func (e *AuthenticationFailedError) Error() string { - if e.RawResponse == nil { - return e.credType + ": " + e.message - } - msg := &bytes.Buffer{} - fmt.Fprintf(msg, "%s authentication failed. %s\n", e.credType, e.message) - if e.RawResponse.Request != nil { - fmt.Fprintf(msg, "%s %s://%s%s\n", e.RawResponse.Request.Method, e.RawResponse.Request.URL.Scheme, e.RawResponse.Request.URL.Host, e.RawResponse.Request.URL.Path) - } else { - // this happens when the response is created from a custom HTTP transporter, - // which doesn't guarantee to bind the original request to the response - fmt.Fprintln(msg, "Request information not available") - } - fmt.Fprintln(msg, "--------------------------------------------------------------------------------") - fmt.Fprintf(msg, "RESPONSE %s\n", e.RawResponse.Status) - fmt.Fprintln(msg, "--------------------------------------------------------------------------------") - body, err := runtime.Payload(e.RawResponse) - switch { - case err != nil: - fmt.Fprintf(msg, "Error reading response body: %v", err) - case len(body) > 0: - if err := json.Indent(msg, body, "", " "); err != nil { - // failed to pretty-print so just dump it verbatim - fmt.Fprint(msg, string(body)) - } - default: - fmt.Fprint(msg, "Response contained no body") - } - fmt.Fprintln(msg, "\n--------------------------------------------------------------------------------") - var anchor string - switch e.credType { - case credNameAzureCLI: - anchor = "azure-cli" - case credNameAzureDeveloperCLI: - anchor = "azd" - case credNameCert: - anchor = "client-cert" - case credNameSecret: - anchor = "client-secret" - case credNameManagedIdentity: - anchor = "managed-id" - case credNameUserPassword: - anchor = "username-password" - case credNameWorkloadIdentity: - anchor = "workload" - } - if anchor != "" { - fmt.Fprintf(msg, "To troubleshoot, visit https://aka.ms/azsdk/go/identity/troubleshoot#%s", anchor) - } - return msg.String() -} - -// NonRetriable indicates the request which provoked this error shouldn't be retried. -func (*AuthenticationFailedError) NonRetriable() { - // marker method -} - -var _ errorinfo.NonRetriable = (*AuthenticationFailedError)(nil) - -// authenticationRequiredError indicates a credential's Authenticate method must be called to acquire a token -// because the credential requires user interaction and is configured not to request it automatically. -type authenticationRequiredError struct { - credentialUnavailableError - - // TokenRequestOptions for the required token. Pass this to the credential's Authenticate method. - TokenRequestOptions policy.TokenRequestOptions -} - -func newauthenticationRequiredError(credType string, tro policy.TokenRequestOptions) error { - return &authenticationRequiredError{ - credentialUnavailableError: credentialUnavailableError{ - credType + " can't acquire a token without user interaction. Call Authenticate to authenticate a user interactively", - }, - TokenRequestOptions: tro, - } -} - -var ( - _ credentialUnavailable = (*authenticationRequiredError)(nil) - _ errorinfo.NonRetriable = (*authenticationRequiredError)(nil) -) - -type credentialUnavailable interface { - error - credentialUnavailable() -} - -type credentialUnavailableError struct { - message string -} - -// newCredentialUnavailableError is an internal helper that ensures consistent error message formatting -func newCredentialUnavailableError(credType, message string) error { - msg := fmt.Sprintf("%s: %s", credType, message) - return &credentialUnavailableError{msg} -} - -// NewCredentialUnavailableError constructs an error indicating a credential can't attempt authentication -// because it lacks required data or state. When [ChainedTokenCredential] receives this error it will try -// its next credential, if any. -func NewCredentialUnavailableError(message string) error { - return &credentialUnavailableError{message} -} - -// Error implements the error interface. Note that the message contents are not contractual and can change over time. -func (e *credentialUnavailableError) Error() string { - return e.message -} - -// NonRetriable is a marker method indicating this error should not be retried. It has no implementation. -func (*credentialUnavailableError) NonRetriable() {} - -func (*credentialUnavailableError) credentialUnavailable() {} - -var ( - _ credentialUnavailable = (*credentialUnavailableError)(nil) - _ errorinfo.NonRetriable = (*credentialUnavailableError)(nil) -) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/go.work b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/go.work deleted file mode 100644 index 04ea962b..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/go.work +++ /dev/null @@ -1,6 +0,0 @@ -go 1.18 - -use ( - . - ./cache -) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/go.work.sum b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/go.work.sum deleted file mode 100644 index c592f283..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/go.work.sum +++ /dev/null @@ -1,60 +0,0 @@ -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.0-beta.1 h1:ODs3brnqQM99Tq1PffODpAViYv3Bf8zOg464MU7p5ew= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.0-beta.1/go.mod h1:3Ug6Qzto9anB6mGlEdgYMDF5zHQ+wwhEaYR4s17PHMw= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.0 h1:fb8kj/Dh4CSwgsOzHeZY4Xh68cFVbzXx+ONXGMY//4w= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.0/go.mod h1:uReU2sSxZExRPBAg3qKzmAucSi51+SP1OhohieR821Q= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0/go.mod h1:okt5dMMTOFjX/aovMlrjvvXoPMBVSPzk9185BT0+eZM= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.2/go.mod h1:yInRyqWXAuaPrgI7p70+lDDgh3mlBohis29jGMISnmc= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dnaeon/go-vcr v1.2.0 h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/keybase/dbus v0.0.0-20220506165403-5aa21ea2c23a/go.mod h1:YPNKjjE7Ubp9dTbnWvsP3HT+hYnY6TfXzubYTBeUxc8= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/montanaflynn/stats v0.7.0/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= -github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= -github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= -golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= -golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= -golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= -golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= -golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= -golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= -golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= -golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/term v0.10.0/go.mod h1:lpqdcUyK/oCiQxvxVrppt5ggO2KCZ5QblwqPnfZ6d5o= -golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= -golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= -golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= -golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= -golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= -golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk= -golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= -golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= -golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/interactive_browser_credential.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/interactive_browser_credential.go deleted file mode 100644 index 056785a8..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/interactive_browser_credential.go +++ /dev/null @@ -1,118 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package azidentity - -import ( - "context" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" -) - -const credNameBrowser = "InteractiveBrowserCredential" - -// InteractiveBrowserCredentialOptions contains optional parameters for InteractiveBrowserCredential. -type InteractiveBrowserCredentialOptions struct { - azcore.ClientOptions - - // AdditionallyAllowedTenants specifies additional tenants for which the credential may acquire - // tokens. Add the wildcard value "*" to allow the credential to acquire tokens for any tenant. - AdditionallyAllowedTenants []string - - // authenticationRecord returned by a call to a credential's Authenticate method. Set this option - // to enable the credential to use data from a previous authentication. - authenticationRecord authenticationRecord - - // ClientID is the ID of the application users will authenticate to. - // Defaults to the ID of an Azure development application. - ClientID string - - // disableAutomaticAuthentication prevents the credential from automatically prompting the user to authenticate. - // When this option is true, GetToken will return authenticationRequiredError when user interaction is necessary - // to acquire a token. - disableAutomaticAuthentication bool - - // DisableInstanceDiscovery should be set true only by applications authenticating in disconnected clouds, or - // private clouds such as Azure Stack. It determines whether the credential requests Microsoft Entra instance metadata - // from https://login.microsoft.com before authenticating. Setting this to true will skip this request, making - // the application responsible for ensuring the configured authority is valid and trustworthy. - DisableInstanceDiscovery bool - - // LoginHint pre-populates the account prompt with a username. Users may choose to authenticate a different account. - LoginHint string - - // RedirectURL is the URL Microsoft Entra ID will redirect to with the access token. This is required - // only when setting ClientID, and must match a redirect URI in the application's registration. - // Applications which have registered "http://localhost" as a redirect URI need not set this option. - RedirectURL string - - // TenantID is the Microsoft Entra tenant the credential authenticates in. Defaults to the - // "organizations" tenant, which can authenticate work and school accounts. - TenantID string - - // tokenCachePersistenceOptions enables persistent token caching when not nil. - tokenCachePersistenceOptions *tokenCachePersistenceOptions -} - -func (o *InteractiveBrowserCredentialOptions) init() { - if o.TenantID == "" { - o.TenantID = organizationsTenantID - } - if o.ClientID == "" { - o.ClientID = developerSignOnClientID - } -} - -// InteractiveBrowserCredential opens a browser to interactively authenticate a user. -type InteractiveBrowserCredential struct { - client *publicClient -} - -// NewInteractiveBrowserCredential constructs a new InteractiveBrowserCredential. Pass nil to accept default options. -func NewInteractiveBrowserCredential(options *InteractiveBrowserCredentialOptions) (*InteractiveBrowserCredential, error) { - cp := InteractiveBrowserCredentialOptions{} - if options != nil { - cp = *options - } - cp.init() - msalOpts := publicClientOptions{ - AdditionallyAllowedTenants: cp.AdditionallyAllowedTenants, - ClientOptions: cp.ClientOptions, - DisableAutomaticAuthentication: cp.disableAutomaticAuthentication, - DisableInstanceDiscovery: cp.DisableInstanceDiscovery, - LoginHint: cp.LoginHint, - Record: cp.authenticationRecord, - RedirectURL: cp.RedirectURL, - TokenCachePersistenceOptions: cp.tokenCachePersistenceOptions, - } - c, err := newPublicClient(cp.TenantID, cp.ClientID, credNameBrowser, msalOpts) - if err != nil { - return nil, err - } - return &InteractiveBrowserCredential{client: c}, nil -} - -// Authenticate a user via the default browser. Subsequent calls to GetToken will automatically use the returned AuthenticationRecord. -func (c *InteractiveBrowserCredential) authenticate(ctx context.Context, opts *policy.TokenRequestOptions) (authenticationRecord, error) { - var err error - ctx, endSpan := runtime.StartSpan(ctx, credNameBrowser+"."+traceOpAuthenticate, c.client.azClient.Tracer(), nil) - defer func() { endSpan(err) }() - tk, err := c.client.Authenticate(ctx, opts) - return tk, err -} - -// GetToken requests an access token from Microsoft Entra ID. This method is called automatically by Azure SDK clients. -func (c *InteractiveBrowserCredential) GetToken(ctx context.Context, opts policy.TokenRequestOptions) (azcore.AccessToken, error) { - var err error - ctx, endSpan := runtime.StartSpan(ctx, credNameBrowser+"."+traceOpGetToken, c.client.azClient.Tracer(), nil) - defer func() { endSpan(err) }() - tk, err := c.client.GetToken(ctx, opts) - return tk, err -} - -var _ azcore.TokenCredential = (*InteractiveBrowserCredential)(nil) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/internal/exported.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/internal/exported.go deleted file mode 100644 index b1b4d5c8..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/internal/exported.go +++ /dev/null @@ -1,18 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package internal - -// TokenCachePersistenceOptions contains options for persistent token caching -type TokenCachePersistenceOptions struct { - // AllowUnencryptedStorage controls whether the cache should fall back to storing its data in plain text - // when encryption isn't possible. Setting this true doesn't disable encryption. The cache always attempts - // encryption before falling back to plaintext storage. - AllowUnencryptedStorage bool - - // Name identifies the cache. Set this to isolate data from other applications. - Name string -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/internal/internal.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/internal/internal.go deleted file mode 100644 index c1498b46..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/internal/internal.go +++ /dev/null @@ -1,31 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package internal - -import ( - "errors" - - "github.com/AzureAD/microsoft-authentication-library-for-go/apps/cache" -) - -var errMissingImport = errors.New("import github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache to enable persistent caching") - -// NewCache constructs a persistent token cache when "o" isn't nil. Applications that intend to -// use a persistent cache must first import the cache module, which will replace this function -// with a platform-specific implementation. -var NewCache = func(o *TokenCachePersistenceOptions, enableCAE bool) (cache.ExportReplace, error) { - if o == nil { - return nil, nil - } - return nil, errMissingImport -} - -// CacheFilePath returns the path to the cache file for the given name. -// Defining it in this package makes it available to azidentity tests. -var CacheFilePath = func(name string) (string, error) { - return "", errMissingImport -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/logging.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/logging.go deleted file mode 100644 index 1aa1e0fc..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/logging.go +++ /dev/null @@ -1,14 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package azidentity - -import "github.com/Azure/azure-sdk-for-go/sdk/internal/log" - -// EventAuthentication entries contain information about authentication. -// This includes information like the names of environment variables -// used when obtaining credentials and the type of credential used. -const EventAuthentication log.Event = "Authentication" diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed-identity-matrix.json b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed-identity-matrix.json deleted file mode 100644 index 1c379177..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed-identity-matrix.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "include": [ - { - "Agent": { - "msi_image": { - "ArmTemplateParameters": "@{deployResources = $true}", - "OSVmImage": "env:LINUXNEXTVMIMAGE", - "Pool": "env:LINUXPOOL" - } - }, - "GoVersion": [ - "1.22.1" - ], - "IDENTITY_IMDS_AVAILABLE": "1" - } - ] -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed_identity_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed_identity_client.go deleted file mode 100644 index 6122cc70..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed_identity_client.go +++ /dev/null @@ -1,501 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package azidentity - -import ( - "context" - "encoding/json" - "errors" - "fmt" - "net/http" - "net/url" - "os" - "path/filepath" - "runtime" - "strconv" - "strings" - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - azruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/streaming" - "github.com/Azure/azure-sdk-for-go/sdk/internal/log" - "github.com/AzureAD/microsoft-authentication-library-for-go/apps/confidential" -) - -const ( - arcIMDSEndpoint = "IMDS_ENDPOINT" - defaultIdentityClientID = "DEFAULT_IDENTITY_CLIENT_ID" - identityEndpoint = "IDENTITY_ENDPOINT" - identityHeader = "IDENTITY_HEADER" - identityServerThumbprint = "IDENTITY_SERVER_THUMBPRINT" - headerMetadata = "Metadata" - imdsEndpoint = "http://169.254.169.254/metadata/identity/oauth2/token" - miResID = "mi_res_id" - msiEndpoint = "MSI_ENDPOINT" - msiResID = "msi_res_id" - msiSecret = "MSI_SECRET" - imdsAPIVersion = "2018-02-01" - azureArcAPIVersion = "2019-08-15" - qpClientID = "client_id" - serviceFabricAPIVersion = "2019-07-01-preview" -) - -var imdsProbeTimeout = time.Second - -type msiType int - -const ( - msiTypeAppService msiType = iota - msiTypeAzureArc - msiTypeAzureML - msiTypeCloudShell - msiTypeIMDS - msiTypeServiceFabric -) - -type managedIdentityClient struct { - azClient *azcore.Client - endpoint string - id ManagedIDKind - msiType msiType - probeIMDS bool -} - -// arcKeyDirectory returns the directory expected to contain Azure Arc keys -var arcKeyDirectory = func() (string, error) { - switch runtime.GOOS { - case "linux": - return "/var/opt/azcmagent/tokens", nil - case "windows": - pd := os.Getenv("ProgramData") - if pd == "" { - return "", errors.New("environment variable ProgramData has no value") - } - return filepath.Join(pd, "AzureConnectedMachineAgent", "Tokens"), nil - default: - return "", fmt.Errorf("unsupported OS %q", runtime.GOOS) - } -} - -type wrappedNumber json.Number - -func (n *wrappedNumber) UnmarshalJSON(b []byte) error { - c := string(b) - if c == "\"\"" { - return nil - } - return json.Unmarshal(b, (*json.Number)(n)) -} - -// setIMDSRetryOptionDefaults sets zero-valued fields to default values appropriate for IMDS -func setIMDSRetryOptionDefaults(o *policy.RetryOptions) { - if o.MaxRetries == 0 { - o.MaxRetries = 5 - } - if o.MaxRetryDelay == 0 { - o.MaxRetryDelay = 1 * time.Minute - } - if o.RetryDelay == 0 { - o.RetryDelay = 2 * time.Second - } - if o.StatusCodes == nil { - o.StatusCodes = []int{ - // IMDS docs recommend retrying 404, 410, 429 and 5xx - // https://learn.microsoft.com/entra/identity/managed-identities-azure-resources/how-to-use-vm-token#error-handling - http.StatusNotFound, // 404 - http.StatusGone, // 410 - http.StatusTooManyRequests, // 429 - http.StatusInternalServerError, // 500 - http.StatusNotImplemented, // 501 - http.StatusBadGateway, // 502 - http.StatusServiceUnavailable, // 503 - http.StatusGatewayTimeout, // 504 - http.StatusHTTPVersionNotSupported, // 505 - http.StatusVariantAlsoNegotiates, // 506 - http.StatusInsufficientStorage, // 507 - http.StatusLoopDetected, // 508 - http.StatusNotExtended, // 510 - http.StatusNetworkAuthenticationRequired, // 511 - } - } - if o.TryTimeout == 0 { - o.TryTimeout = 1 * time.Minute - } -} - -// newManagedIdentityClient creates a new instance of the ManagedIdentityClient with the ManagedIdentityCredentialOptions -// that are passed into it along with a default pipeline. -// options: ManagedIdentityCredentialOptions configure policies for the pipeline and the authority host that -// will be used to retrieve tokens and authenticate -func newManagedIdentityClient(options *ManagedIdentityCredentialOptions) (*managedIdentityClient, error) { - if options == nil { - options = &ManagedIdentityCredentialOptions{} - } - cp := options.ClientOptions - c := managedIdentityClient{id: options.ID, endpoint: imdsEndpoint, msiType: msiTypeIMDS} - env := "IMDS" - if endpoint, ok := os.LookupEnv(identityEndpoint); ok { - if _, ok := os.LookupEnv(identityHeader); ok { - if _, ok := os.LookupEnv(identityServerThumbprint); ok { - env = "Service Fabric" - c.endpoint = endpoint - c.msiType = msiTypeServiceFabric - } else { - env = "App Service" - c.endpoint = endpoint - c.msiType = msiTypeAppService - } - } else if _, ok := os.LookupEnv(arcIMDSEndpoint); ok { - env = "Azure Arc" - c.endpoint = endpoint - c.msiType = msiTypeAzureArc - } - } else if endpoint, ok := os.LookupEnv(msiEndpoint); ok { - c.endpoint = endpoint - if _, ok := os.LookupEnv(msiSecret); ok { - env = "Azure ML" - c.msiType = msiTypeAzureML - } else { - env = "Cloud Shell" - c.msiType = msiTypeCloudShell - } - } else { - c.probeIMDS = options.dac - setIMDSRetryOptionDefaults(&cp.Retry) - } - - client, err := azcore.NewClient(module, version, azruntime.PipelineOptions{ - Tracing: azruntime.TracingOptions{ - Namespace: traceNamespace, - }, - }, &cp) - if err != nil { - return nil, err - } - c.azClient = client - - if log.Should(EventAuthentication) { - log.Writef(EventAuthentication, "Managed Identity Credential will use %s managed identity", env) - } - - return &c, nil -} - -// provideToken acquires a token for MSAL's confidential.Client, which caches the token -func (c *managedIdentityClient) provideToken(ctx context.Context, params confidential.TokenProviderParameters) (confidential.TokenProviderResult, error) { - result := confidential.TokenProviderResult{} - tk, err := c.authenticate(ctx, c.id, params.Scopes) - if err == nil { - result.AccessToken = tk.Token - result.ExpiresInSeconds = int(time.Until(tk.ExpiresOn).Seconds()) - } - return result, err -} - -// authenticate acquires an access token -func (c *managedIdentityClient) authenticate(ctx context.Context, id ManagedIDKind, scopes []string) (azcore.AccessToken, error) { - // no need to synchronize around this value because it's true only when DefaultAzureCredential constructed the client, - // and in that case ChainedTokenCredential.GetToken synchronizes goroutines that would execute this block - if c.probeIMDS { - cx, cancel := context.WithTimeout(ctx, imdsProbeTimeout) - defer cancel() - cx = policy.WithRetryOptions(cx, policy.RetryOptions{MaxRetries: -1}) - req, err := azruntime.NewRequest(cx, http.MethodGet, c.endpoint) - if err == nil { - _, err = c.azClient.Pipeline().Do(req) - } - if err != nil { - msg := err.Error() - if errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded) { - msg = "managed identity timed out. See https://aka.ms/azsdk/go/identity/troubleshoot#dac for more information" - } - return azcore.AccessToken{}, newCredentialUnavailableError(credNameManagedIdentity, msg) - } - // send normal token requests from now on because something responded - c.probeIMDS = false - } - - msg, err := c.createAuthRequest(ctx, id, scopes) - if err != nil { - return azcore.AccessToken{}, err - } - - resp, err := c.azClient.Pipeline().Do(msg) - if err != nil { - return azcore.AccessToken{}, newAuthenticationFailedError(credNameManagedIdentity, err.Error(), nil, err) - } - - if azruntime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return c.createAccessToken(resp) - } - - if c.msiType == msiTypeIMDS { - switch resp.StatusCode { - case http.StatusBadRequest: - if id != nil { - return azcore.AccessToken{}, newAuthenticationFailedError(credNameManagedIdentity, "the requested identity isn't assigned to this resource", resp, nil) - } - msg := "failed to authenticate a system assigned identity" - if body, err := azruntime.Payload(resp); err == nil && len(body) > 0 { - msg += fmt.Sprintf(". The endpoint responded with %s", body) - } - return azcore.AccessToken{}, newCredentialUnavailableError(credNameManagedIdentity, msg) - case http.StatusForbidden: - // Docker Desktop runs a proxy that responds 403 to IMDS token requests. If we get that response, - // we return credentialUnavailableError so credential chains continue to their next credential - body, err := azruntime.Payload(resp) - if err == nil && strings.Contains(string(body), "unreachable") { - return azcore.AccessToken{}, newCredentialUnavailableError(credNameManagedIdentity, fmt.Sprintf("unexpected response %q", string(body))) - } - } - } - - return azcore.AccessToken{}, newAuthenticationFailedError(credNameManagedIdentity, "authentication failed", resp, nil) -} - -func (c *managedIdentityClient) createAccessToken(res *http.Response) (azcore.AccessToken, error) { - value := struct { - // these are the only fields that we use - Token string `json:"access_token,omitempty"` - RefreshToken string `json:"refresh_token,omitempty"` - ExpiresIn wrappedNumber `json:"expires_in,omitempty"` // this field should always return the number of seconds for which a token is valid - ExpiresOn interface{} `json:"expires_on,omitempty"` // the value returned in this field varies between a number and a date string - }{} - if err := azruntime.UnmarshalAsJSON(res, &value); err != nil { - return azcore.AccessToken{}, fmt.Errorf("internal AccessToken: %v", err) - } - if value.ExpiresIn != "" { - expiresIn, err := json.Number(value.ExpiresIn).Int64() - if err != nil { - return azcore.AccessToken{}, err - } - return azcore.AccessToken{Token: value.Token, ExpiresOn: time.Now().Add(time.Second * time.Duration(expiresIn)).UTC()}, nil - } - switch v := value.ExpiresOn.(type) { - case float64: - return azcore.AccessToken{Token: value.Token, ExpiresOn: time.Unix(int64(v), 0).UTC()}, nil - case string: - if expiresOn, err := strconv.Atoi(v); err == nil { - return azcore.AccessToken{Token: value.Token, ExpiresOn: time.Unix(int64(expiresOn), 0).UTC()}, nil - } - return azcore.AccessToken{}, newAuthenticationFailedError(credNameManagedIdentity, "unexpected expires_on value: "+v, res, nil) - default: - msg := fmt.Sprintf("unsupported type received in expires_on: %T, %v", v, v) - return azcore.AccessToken{}, newAuthenticationFailedError(credNameManagedIdentity, msg, res, nil) - } -} - -func (c *managedIdentityClient) createAuthRequest(ctx context.Context, id ManagedIDKind, scopes []string) (*policy.Request, error) { - switch c.msiType { - case msiTypeIMDS: - return c.createIMDSAuthRequest(ctx, id, scopes) - case msiTypeAppService: - return c.createAppServiceAuthRequest(ctx, id, scopes) - case msiTypeAzureArc: - // need to perform preliminary request to retreive the secret key challenge provided by the HIMDS service - key, err := c.getAzureArcSecretKey(ctx, scopes) - if err != nil { - msg := fmt.Sprintf("failed to retreive secret key from the identity endpoint: %v", err) - return nil, newAuthenticationFailedError(credNameManagedIdentity, msg, nil, err) - } - return c.createAzureArcAuthRequest(ctx, id, scopes, key) - case msiTypeAzureML: - return c.createAzureMLAuthRequest(ctx, id, scopes) - case msiTypeServiceFabric: - return c.createServiceFabricAuthRequest(ctx, id, scopes) - case msiTypeCloudShell: - return c.createCloudShellAuthRequest(ctx, id, scopes) - default: - return nil, newCredentialUnavailableError(credNameManagedIdentity, "managed identity isn't supported in this environment") - } -} - -func (c *managedIdentityClient) createIMDSAuthRequest(ctx context.Context, id ManagedIDKind, scopes []string) (*policy.Request, error) { - request, err := azruntime.NewRequest(ctx, http.MethodGet, c.endpoint) - if err != nil { - return nil, err - } - request.Raw().Header.Set(headerMetadata, "true") - q := request.Raw().URL.Query() - q.Add("api-version", imdsAPIVersion) - q.Add("resource", strings.Join(scopes, " ")) - if id != nil { - if id.idKind() == miResourceID { - q.Add(msiResID, id.String()) - } else { - q.Add(qpClientID, id.String()) - } - } - request.Raw().URL.RawQuery = q.Encode() - return request, nil -} - -func (c *managedIdentityClient) createAppServiceAuthRequest(ctx context.Context, id ManagedIDKind, scopes []string) (*policy.Request, error) { - request, err := azruntime.NewRequest(ctx, http.MethodGet, c.endpoint) - if err != nil { - return nil, err - } - request.Raw().Header.Set("X-IDENTITY-HEADER", os.Getenv(identityHeader)) - q := request.Raw().URL.Query() - q.Add("api-version", "2019-08-01") - q.Add("resource", scopes[0]) - if id != nil { - if id.idKind() == miResourceID { - q.Add(miResID, id.String()) - } else { - q.Add(qpClientID, id.String()) - } - } - request.Raw().URL.RawQuery = q.Encode() - return request, nil -} - -func (c *managedIdentityClient) createAzureMLAuthRequest(ctx context.Context, id ManagedIDKind, scopes []string) (*policy.Request, error) { - request, err := azruntime.NewRequest(ctx, http.MethodGet, c.endpoint) - if err != nil { - return nil, err - } - request.Raw().Header.Set("secret", os.Getenv(msiSecret)) - q := request.Raw().URL.Query() - q.Add("api-version", "2017-09-01") - q.Add("resource", strings.Join(scopes, " ")) - q.Add("clientid", os.Getenv(defaultIdentityClientID)) - if id != nil { - if id.idKind() == miResourceID { - log.Write(EventAuthentication, "WARNING: Azure ML doesn't support specifying a managed identity by resource ID") - q.Set("clientid", "") - q.Set(miResID, id.String()) - } else { - q.Set("clientid", id.String()) - } - } - request.Raw().URL.RawQuery = q.Encode() - return request, nil -} - -func (c *managedIdentityClient) createServiceFabricAuthRequest(ctx context.Context, id ManagedIDKind, scopes []string) (*policy.Request, error) { - request, err := azruntime.NewRequest(ctx, http.MethodGet, c.endpoint) - if err != nil { - return nil, err - } - q := request.Raw().URL.Query() - request.Raw().Header.Set("Accept", "application/json") - request.Raw().Header.Set("Secret", os.Getenv(identityHeader)) - q.Add("api-version", serviceFabricAPIVersion) - q.Add("resource", strings.Join(scopes, " ")) - if id != nil { - log.Write(EventAuthentication, "WARNING: Service Fabric doesn't support selecting a user-assigned identity at runtime") - if id.idKind() == miResourceID { - q.Add(miResID, id.String()) - } else { - q.Add(qpClientID, id.String()) - } - } - request.Raw().URL.RawQuery = q.Encode() - return request, nil -} - -func (c *managedIdentityClient) getAzureArcSecretKey(ctx context.Context, resources []string) (string, error) { - // create the request to retreive the secret key challenge provided by the HIMDS service - request, err := azruntime.NewRequest(ctx, http.MethodGet, c.endpoint) - if err != nil { - return "", err - } - request.Raw().Header.Set(headerMetadata, "true") - q := request.Raw().URL.Query() - q.Add("api-version", azureArcAPIVersion) - q.Add("resource", strings.Join(resources, " ")) - request.Raw().URL.RawQuery = q.Encode() - // send the initial request to get the short-lived secret key - response, err := c.azClient.Pipeline().Do(request) - if err != nil { - return "", err - } - // the endpoint is expected to return a 401 with the WWW-Authenticate header set to the location - // of the secret key file. Any other status code indicates an error in the request. - if response.StatusCode != 401 { - msg := fmt.Sprintf("expected a 401 response, received %d", response.StatusCode) - return "", newAuthenticationFailedError(credNameManagedIdentity, msg, response, nil) - } - header := response.Header.Get("WWW-Authenticate") - if len(header) == 0 { - return "", newAuthenticationFailedError(credNameManagedIdentity, "HIMDS response has no WWW-Authenticate header", nil, nil) - } - // the WWW-Authenticate header is expected in the following format: Basic realm=/some/file/path.key - _, p, found := strings.Cut(header, "=") - if !found { - return "", newAuthenticationFailedError(credNameManagedIdentity, "unexpected WWW-Authenticate header from HIMDS: "+header, nil, nil) - } - expected, err := arcKeyDirectory() - if err != nil { - return "", err - } - if filepath.Dir(p) != expected || !strings.HasSuffix(p, ".key") { - return "", newAuthenticationFailedError(credNameManagedIdentity, "unexpected file path from HIMDS service: "+p, nil, nil) - } - f, err := os.Stat(p) - if err != nil { - return "", newAuthenticationFailedError(credNameManagedIdentity, fmt.Sprintf("could not stat %q: %v", p, err), nil, nil) - } - if s := f.Size(); s > 4096 { - return "", newAuthenticationFailedError(credNameManagedIdentity, fmt.Sprintf("key is too large (%d bytes)", s), nil, nil) - } - key, err := os.ReadFile(p) - if err != nil { - return "", newAuthenticationFailedError(credNameManagedIdentity, fmt.Sprintf("could not read %q: %v", p, err), nil, nil) - } - return string(key), nil -} - -func (c *managedIdentityClient) createAzureArcAuthRequest(ctx context.Context, id ManagedIDKind, resources []string, key string) (*policy.Request, error) { - request, err := azruntime.NewRequest(ctx, http.MethodGet, c.endpoint) - if err != nil { - return nil, err - } - request.Raw().Header.Set(headerMetadata, "true") - request.Raw().Header.Set("Authorization", fmt.Sprintf("Basic %s", key)) - q := request.Raw().URL.Query() - q.Add("api-version", azureArcAPIVersion) - q.Add("resource", strings.Join(resources, " ")) - if id != nil { - log.Write(EventAuthentication, "WARNING: Azure Arc doesn't support user-assigned managed identities") - if id.idKind() == miResourceID { - q.Add(miResID, id.String()) - } else { - q.Add(qpClientID, id.String()) - } - } - request.Raw().URL.RawQuery = q.Encode() - return request, nil -} - -func (c *managedIdentityClient) createCloudShellAuthRequest(ctx context.Context, id ManagedIDKind, scopes []string) (*policy.Request, error) { - request, err := azruntime.NewRequest(ctx, http.MethodPost, c.endpoint) - if err != nil { - return nil, err - } - request.Raw().Header.Set(headerMetadata, "true") - data := url.Values{} - data.Set("resource", strings.Join(scopes, " ")) - dataEncoded := data.Encode() - body := streaming.NopCloser(strings.NewReader(dataEncoded)) - if err := request.SetBody(body, "application/x-www-form-urlencoded"); err != nil { - return nil, err - } - if id != nil { - log.Write(EventAuthentication, "WARNING: Cloud Shell doesn't support user-assigned managed identities") - q := request.Raw().URL.Query() - if id.idKind() == miResourceID { - q.Add(miResID, id.String()) - } else { - q.Add(qpClientID, id.String()) - } - } - return request, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed_identity_credential.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed_identity_credential.go deleted file mode 100644 index 13c043d8..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed_identity_credential.go +++ /dev/null @@ -1,128 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package azidentity - -import ( - "context" - "fmt" - "strings" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/AzureAD/microsoft-authentication-library-for-go/apps/confidential" -) - -const credNameManagedIdentity = "ManagedIdentityCredential" - -type managedIdentityIDKind int - -const ( - miClientID managedIdentityIDKind = 0 - miResourceID managedIdentityIDKind = 1 -) - -// ManagedIDKind identifies the ID of a managed identity as either a client or resource ID -type ManagedIDKind interface { - fmt.Stringer - idKind() managedIdentityIDKind -} - -// ClientID is the client ID of a user-assigned managed identity. -type ClientID string - -func (ClientID) idKind() managedIdentityIDKind { - return miClientID -} - -// String returns the string value of the ID. -func (c ClientID) String() string { - return string(c) -} - -// ResourceID is the resource ID of a user-assigned managed identity. -type ResourceID string - -func (ResourceID) idKind() managedIdentityIDKind { - return miResourceID -} - -// String returns the string value of the ID. -func (r ResourceID) String() string { - return string(r) -} - -// ManagedIdentityCredentialOptions contains optional parameters for ManagedIdentityCredential. -type ManagedIdentityCredentialOptions struct { - azcore.ClientOptions - - // ID is the ID of a managed identity the credential should authenticate. Set this field to use a specific identity - // instead of the hosting environment's default. The value may be the identity's client ID or resource ID, but note that - // some platforms don't accept resource IDs. - ID ManagedIDKind - - // dac indicates whether the credential is part of DefaultAzureCredential. When true, and the environment doesn't have - // configuration for a specific managed identity API, the credential tries to determine whether IMDS is available before - // sending its first token request. It does this by sending a malformed request with a short timeout. Any response to that - // request is taken to mean IMDS is available, in which case the credential will send ordinary token requests thereafter - // with no special timeout. The purpose of this behavior is to prevent a very long timeout when IMDS isn't available. - dac bool -} - -// ManagedIdentityCredential authenticates an Azure managed identity in any hosting environment supporting managed identities. -// This credential authenticates a system-assigned identity by default. Use ManagedIdentityCredentialOptions.ID to specify a -// user-assigned identity. See Microsoft Entra ID documentation for more information about managed identities: -// https://learn.microsoft.com/entra/identity/managed-identities-azure-resources/overview -type ManagedIdentityCredential struct { - client *confidentialClient - mic *managedIdentityClient -} - -// NewManagedIdentityCredential creates a ManagedIdentityCredential. Pass nil to accept default options. -func NewManagedIdentityCredential(options *ManagedIdentityCredentialOptions) (*ManagedIdentityCredential, error) { - if options == nil { - options = &ManagedIdentityCredentialOptions{} - } - mic, err := newManagedIdentityClient(options) - if err != nil { - return nil, err - } - cred := confidential.NewCredFromTokenProvider(mic.provideToken) - - // It's okay to give MSAL an invalid client ID because MSAL will use it only as part of a cache key. - // ManagedIdentityClient handles all the details of authentication and won't receive this value from MSAL. - clientID := "SYSTEM-ASSIGNED-MANAGED-IDENTITY" - if options.ID != nil { - clientID = options.ID.String() - } - // similarly, it's okay to give MSAL an incorrect tenant because MSAL won't use the value - c, err := newConfidentialClient("common", clientID, credNameManagedIdentity, cred, confidentialClientOptions{ - ClientOptions: options.ClientOptions, - }) - if err != nil { - return nil, err - } - return &ManagedIdentityCredential{client: c, mic: mic}, nil -} - -// GetToken requests an access token from the hosting environment. This method is called automatically by Azure SDK clients. -func (c *ManagedIdentityCredential) GetToken(ctx context.Context, opts policy.TokenRequestOptions) (azcore.AccessToken, error) { - var err error - ctx, endSpan := runtime.StartSpan(ctx, credNameManagedIdentity+"."+traceOpGetToken, c.client.azClient.Tracer(), nil) - defer func() { endSpan(err) }() - - if len(opts.Scopes) != 1 { - err = fmt.Errorf("%s.GetToken() requires exactly one scope", credNameManagedIdentity) - return azcore.AccessToken{}, err - } - // managed identity endpoints require a Microsoft Entra ID v1 resource (i.e. token audience), not a v2 scope, so we remove "/.default" here - opts.Scopes = []string{strings.TrimSuffix(opts.Scopes[0], defaultSuffix)} - tk, err := c.client.GetToken(ctx, opts) - return tk, err -} - -var _ azcore.TokenCredential = (*ManagedIdentityCredential)(nil) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/on_behalf_of_credential.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/on_behalf_of_credential.go deleted file mode 100644 index 9dcc82f0..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/on_behalf_of_credential.go +++ /dev/null @@ -1,113 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package azidentity - -import ( - "context" - "crypto" - "crypto/x509" - "errors" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/AzureAD/microsoft-authentication-library-for-go/apps/confidential" -) - -const credNameOBO = "OnBehalfOfCredential" - -// OnBehalfOfCredential authenticates a service principal via the on-behalf-of flow. This is typically used by -// middle-tier services that authorize requests to other services with a delegated user identity. Because this -// is not an interactive authentication flow, an application using it must have admin consent for any delegated -// permissions before requesting tokens for them. See [Microsoft Entra ID documentation] for more details. -// -// [Microsoft Entra ID documentation]: https://learn.microsoft.com/entra/identity-platform/v2-oauth2-on-behalf-of-flow -type OnBehalfOfCredential struct { - client *confidentialClient -} - -// OnBehalfOfCredentialOptions contains optional parameters for OnBehalfOfCredential -type OnBehalfOfCredentialOptions struct { - azcore.ClientOptions - - // AdditionallyAllowedTenants specifies additional tenants for which the credential may acquire tokens. - // Add the wildcard value "*" to allow the credential to acquire tokens for any tenant in which the - // application is registered. - AdditionallyAllowedTenants []string - - // DisableInstanceDiscovery should be set true only by applications authenticating in disconnected clouds, or - // private clouds such as Azure Stack. It determines whether the credential requests Microsoft Entra instance metadata - // from https://login.microsoft.com before authenticating. Setting this to true will skip this request, making - // the application responsible for ensuring the configured authority is valid and trustworthy. - DisableInstanceDiscovery bool - - // SendCertificateChain applies only when the credential is configured to authenticate with a certificate. - // This setting controls whether the credential sends the public certificate chain in the x5c header of each - // token request's JWT. This is required for, and only used in, Subject Name/Issuer (SNI) authentication. - SendCertificateChain bool -} - -// NewOnBehalfOfCredentialWithCertificate constructs an OnBehalfOfCredential that authenticates with a certificate. -// See [ParseCertificates] for help loading a certificate. -func NewOnBehalfOfCredentialWithCertificate(tenantID, clientID, userAssertion string, certs []*x509.Certificate, key crypto.PrivateKey, options *OnBehalfOfCredentialOptions) (*OnBehalfOfCredential, error) { - cred, err := confidential.NewCredFromCert(certs, key) - if err != nil { - return nil, err - } - return newOnBehalfOfCredential(tenantID, clientID, userAssertion, cred, options) -} - -// NewOnBehalfOfCredentialWithClientAssertions constructs an OnBehalfOfCredential that authenticates with client assertions. -// userAssertion is the user's access token for the application. The getAssertion function should return client assertions -// that authenticate the application to Microsoft Entra ID, such as federated credentials. -func NewOnBehalfOfCredentialWithClientAssertions(tenantID, clientID, userAssertion string, getAssertion func(context.Context) (string, error), options *OnBehalfOfCredentialOptions) (*OnBehalfOfCredential, error) { - if getAssertion == nil { - return nil, errors.New("getAssertion can't be nil. It must be a function that returns client assertions") - } - cred := confidential.NewCredFromAssertionCallback(func(ctx context.Context, _ confidential.AssertionRequestOptions) (string, error) { - return getAssertion(ctx) - }) - return newOnBehalfOfCredential(tenantID, clientID, userAssertion, cred, options) -} - -// NewOnBehalfOfCredentialWithSecret constructs an OnBehalfOfCredential that authenticates with a client secret. -func NewOnBehalfOfCredentialWithSecret(tenantID, clientID, userAssertion, clientSecret string, options *OnBehalfOfCredentialOptions) (*OnBehalfOfCredential, error) { - cred, err := confidential.NewCredFromSecret(clientSecret) - if err != nil { - return nil, err - } - return newOnBehalfOfCredential(tenantID, clientID, userAssertion, cred, options) -} - -func newOnBehalfOfCredential(tenantID, clientID, userAssertion string, cred confidential.Credential, options *OnBehalfOfCredentialOptions) (*OnBehalfOfCredential, error) { - if options == nil { - options = &OnBehalfOfCredentialOptions{} - } - opts := confidentialClientOptions{ - AdditionallyAllowedTenants: options.AdditionallyAllowedTenants, - Assertion: userAssertion, - ClientOptions: options.ClientOptions, - DisableInstanceDiscovery: options.DisableInstanceDiscovery, - SendX5C: options.SendCertificateChain, - } - c, err := newConfidentialClient(tenantID, clientID, credNameOBO, cred, opts) - if err != nil { - return nil, err - } - return &OnBehalfOfCredential{c}, nil -} - -// GetToken requests an access token from Microsoft Entra ID. This method is called automatically by Azure SDK clients. -func (o *OnBehalfOfCredential) GetToken(ctx context.Context, opts policy.TokenRequestOptions) (azcore.AccessToken, error) { - var err error - ctx, endSpan := runtime.StartSpan(ctx, credNameOBO+"."+traceOpGetToken, o.client.azClient.Tracer(), nil) - defer func() { endSpan(err) }() - tk, err := o.client.GetToken(ctx, opts) - return tk, err -} - -var _ azcore.TokenCredential = (*OnBehalfOfCredential)(nil) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/public_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/public_client.go deleted file mode 100644 index b3d22dbf..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/public_client.go +++ /dev/null @@ -1,273 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package azidentity - -import ( - "context" - "errors" - "fmt" - "net/http" - "strings" - "sync" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity/internal" - "github.com/Azure/azure-sdk-for-go/sdk/internal/log" - "github.com/AzureAD/microsoft-authentication-library-for-go/apps/public" - - // this import ensures well-known configurations in azcore/cloud have ARM audiences for Authenticate() - _ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" -) - -type publicClientOptions struct { - azcore.ClientOptions - - AdditionallyAllowedTenants []string - DeviceCodePrompt func(context.Context, DeviceCodeMessage) error - DisableAutomaticAuthentication bool - DisableInstanceDiscovery bool - LoginHint, RedirectURL string - Record authenticationRecord - TokenCachePersistenceOptions *tokenCachePersistenceOptions - Username, Password string -} - -// publicClient wraps the MSAL public client -type publicClient struct { - cae, noCAE msalPublicClient - caeMu, noCAEMu, clientMu *sync.Mutex - clientID, tenantID string - defaultScope []string - host string - name string - opts publicClientOptions - record authenticationRecord - azClient *azcore.Client -} - -var errScopeRequired = errors.New("authenticating in this environment requires specifying a scope in TokenRequestOptions") - -func newPublicClient(tenantID, clientID, name string, o publicClientOptions) (*publicClient, error) { - if !validTenantID(tenantID) { - return nil, errInvalidTenantID - } - host, err := setAuthorityHost(o.Cloud) - if err != nil { - return nil, err - } - // if the application specified a cloud configuration, use its ARM audience as the default scope for Authenticate() - audience := o.Cloud.Services[cloud.ResourceManager].Audience - if audience == "" { - // no cloud configuration, or no ARM audience, specified; try to map the host to a well-known one (all of which have a trailing slash) - if !strings.HasSuffix(host, "/") { - host += "/" - } - switch host { - case cloud.AzureChina.ActiveDirectoryAuthorityHost: - audience = cloud.AzureChina.Services[cloud.ResourceManager].Audience - case cloud.AzureGovernment.ActiveDirectoryAuthorityHost: - audience = cloud.AzureGovernment.Services[cloud.ResourceManager].Audience - case cloud.AzurePublic.ActiveDirectoryAuthorityHost: - audience = cloud.AzurePublic.Services[cloud.ResourceManager].Audience - } - } - // if we didn't come up with an audience, the application will have to specify a scope for Authenticate() - var defaultScope []string - if audience != "" { - defaultScope = []string{audience + defaultSuffix} - } - client, err := azcore.NewClient(module, version, runtime.PipelineOptions{ - Tracing: runtime.TracingOptions{ - Namespace: traceNamespace, - }, - }, &o.ClientOptions) - if err != nil { - return nil, err - } - o.AdditionallyAllowedTenants = resolveAdditionalTenants(o.AdditionallyAllowedTenants) - return &publicClient{ - caeMu: &sync.Mutex{}, - clientID: clientID, - clientMu: &sync.Mutex{}, - defaultScope: defaultScope, - host: host, - name: name, - noCAEMu: &sync.Mutex{}, - opts: o, - record: o.Record, - tenantID: tenantID, - azClient: client, - }, nil -} - -func (p *publicClient) Authenticate(ctx context.Context, tro *policy.TokenRequestOptions) (authenticationRecord, error) { - if tro == nil { - tro = &policy.TokenRequestOptions{} - } - if len(tro.Scopes) == 0 { - if p.defaultScope == nil { - return authenticationRecord{}, errScopeRequired - } - tro.Scopes = p.defaultScope - } - client, mu, err := p.client(*tro) - if err != nil { - return authenticationRecord{}, err - } - mu.Lock() - defer mu.Unlock() - _, err = p.reqToken(ctx, client, *tro) - if err == nil { - scope := strings.Join(tro.Scopes, ", ") - msg := fmt.Sprintf("%s.Authenticate() acquired a token for scope %q", p.name, scope) - log.Write(EventAuthentication, msg) - } - return p.record, err -} - -// GetToken requests an access token from MSAL, checking the cache first. -func (p *publicClient) GetToken(ctx context.Context, tro policy.TokenRequestOptions) (azcore.AccessToken, error) { - if len(tro.Scopes) < 1 { - return azcore.AccessToken{}, fmt.Errorf("%s.GetToken() requires at least one scope", p.name) - } - tenant, err := p.resolveTenant(tro.TenantID) - if err != nil { - return azcore.AccessToken{}, err - } - client, mu, err := p.client(tro) - if err != nil { - return azcore.AccessToken{}, err - } - mu.Lock() - defer mu.Unlock() - ar, err := client.AcquireTokenSilent(ctx, tro.Scopes, public.WithSilentAccount(p.record.account()), public.WithClaims(tro.Claims), public.WithTenantID(tenant)) - if err == nil { - return p.token(ar, err) - } - if p.opts.DisableAutomaticAuthentication { - return azcore.AccessToken{}, newauthenticationRequiredError(p.name, tro) - } - at, err := p.reqToken(ctx, client, tro) - if err == nil { - msg := fmt.Sprintf("%s.GetToken() acquired a token for scope %q", p.name, strings.Join(ar.GrantedScopes, ", ")) - log.Write(EventAuthentication, msg) - } - return at, err -} - -// reqToken requests a token from the MSAL public client. It's separate from GetToken() to enable Authenticate() to bypass the cache. -func (p *publicClient) reqToken(ctx context.Context, c msalPublicClient, tro policy.TokenRequestOptions) (azcore.AccessToken, error) { - tenant, err := p.resolveTenant(tro.TenantID) - if err != nil { - return azcore.AccessToken{}, err - } - var ar public.AuthResult - switch p.name { - case credNameBrowser: - ar, err = c.AcquireTokenInteractive(ctx, tro.Scopes, - public.WithClaims(tro.Claims), - public.WithLoginHint(p.opts.LoginHint), - public.WithRedirectURI(p.opts.RedirectURL), - public.WithTenantID(tenant), - ) - case credNameDeviceCode: - dc, e := c.AcquireTokenByDeviceCode(ctx, tro.Scopes, public.WithClaims(tro.Claims), public.WithTenantID(tenant)) - if e != nil { - return azcore.AccessToken{}, e - } - err = p.opts.DeviceCodePrompt(ctx, DeviceCodeMessage{ - Message: dc.Result.Message, - UserCode: dc.Result.UserCode, - VerificationURL: dc.Result.VerificationURL, - }) - if err == nil { - ar, err = dc.AuthenticationResult(ctx) - } - case credNameUserPassword: - ar, err = c.AcquireTokenByUsernamePassword(ctx, tro.Scopes, p.opts.Username, p.opts.Password, public.WithClaims(tro.Claims), public.WithTenantID(tenant)) - default: - return azcore.AccessToken{}, fmt.Errorf("unknown credential %q", p.name) - } - return p.token(ar, err) -} - -func (p *publicClient) client(tro policy.TokenRequestOptions) (msalPublicClient, *sync.Mutex, error) { - p.clientMu.Lock() - defer p.clientMu.Unlock() - if tro.EnableCAE { - if p.cae == nil { - client, err := p.newMSALClient(true) - if err != nil { - return nil, nil, err - } - p.cae = client - } - return p.cae, p.caeMu, nil - } - if p.noCAE == nil { - client, err := p.newMSALClient(false) - if err != nil { - return nil, nil, err - } - p.noCAE = client - } - return p.noCAE, p.noCAEMu, nil -} - -func (p *publicClient) newMSALClient(enableCAE bool) (msalPublicClient, error) { - cache, err := internal.NewCache(p.opts.TokenCachePersistenceOptions, enableCAE) - if err != nil { - return nil, err - } - o := []public.Option{ - public.WithAuthority(runtime.JoinPaths(p.host, p.tenantID)), - public.WithCache(cache), - public.WithHTTPClient(p), - } - if enableCAE { - o = append(o, public.WithClientCapabilities(cp1)) - } - if p.opts.DisableInstanceDiscovery || strings.ToLower(p.tenantID) == "adfs" { - o = append(o, public.WithInstanceDiscovery(false)) - } - return public.New(p.clientID, o...) -} - -func (p *publicClient) token(ar public.AuthResult, err error) (azcore.AccessToken, error) { - if err == nil { - p.record, err = newAuthenticationRecord(ar) - } else { - res := getResponseFromError(err) - err = newAuthenticationFailedError(p.name, err.Error(), res, err) - } - return azcore.AccessToken{Token: ar.AccessToken, ExpiresOn: ar.ExpiresOn.UTC()}, err -} - -// resolveTenant returns the correct WithTenantID() argument for a token request given the client's -// configuration, or an error when that configuration doesn't allow the specified tenant -func (p *publicClient) resolveTenant(specified string) (string, error) { - t, err := resolveTenant(p.tenantID, specified, p.name, p.opts.AdditionallyAllowedTenants) - if t == p.tenantID { - // callers pass this value to MSAL's WithTenantID(). There's no need to redundantly specify - // the client's default tenant and doing so is an error when that tenant is "organizations" - t = "" - } - return t, err -} - -// these methods satisfy the MSAL ops.HTTPClient interface - -func (p *publicClient) CloseIdleConnections() { - // do nothing -} - -func (p *publicClient) Do(r *http.Request) (*http.Response, error) { - return doForClient(p.azClient, r) -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/test-resources-post.ps1 b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/test-resources-post.ps1 deleted file mode 100644 index a69bbce3..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/test-resources-post.ps1 +++ /dev/null @@ -1,112 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - -# IMPORTANT: Do not invoke this file directly. Please instead run eng/common/TestResources/New-TestResources.ps1 from the repository root. - -param ( - [hashtable] $AdditionalParameters = @{}, - [hashtable] $DeploymentOutputs -) - -$ErrorActionPreference = 'Stop' -$PSNativeCommandUseErrorActionPreference = $true - -if ($CI) { - if (!$AdditionalParameters['deployResources']) { - Write-Host "Skipping post-provisioning script because resources weren't deployed" - return - } - az login --service-principal -u $DeploymentOutputs['AZIDENTITY_CLIENT_ID'] -p $DeploymentOutputs['AZIDENTITY_CLIENT_SECRET'] --tenant $DeploymentOutputs['AZIDENTITY_TENANT_ID'] - az account set --subscription $DeploymentOutputs['AZIDENTITY_SUBSCRIPTION_ID'] -} - -Write-Host "Building container" -$image = "$($DeploymentOutputs['AZIDENTITY_ACR_LOGIN_SERVER'])/azidentity-managed-id-test" -Set-Content -Path "$PSScriptRoot/Dockerfile" -Value @" -FROM mcr.microsoft.com/oss/go/microsoft/golang:latest as builder -ENV GOARCH=amd64 GOWORK=off -COPY . /azidentity -WORKDIR /azidentity/testdata/managed-id-test -RUN go mod tidy -RUN go build -o /build/managed-id-test . -RUN GOOS=windows go build -o /build/managed-id-test.exe . - -FROM mcr.microsoft.com/mirror/docker/library/alpine:3.16 -RUN apk add gcompat -COPY --from=builder /build/* . -RUN chmod +x managed-id-test -CMD ["./managed-id-test"] -"@ -# build from sdk/azidentity because we need that dir in the context (because the test app uses local azidentity) -docker build -t $image "$PSScriptRoot" -az acr login -n $DeploymentOutputs['AZIDENTITY_ACR_NAME'] -docker push $image - -$rg = $DeploymentOutputs['AZIDENTITY_RESOURCE_GROUP'] - -# ACI is easier to provision here than in the bicep file because the image isn't available before now -Write-Host "Deploying Azure Container Instance" -$aciName = "azidentity-test" -az container create -g $rg -n $aciName --image $image ` - --acr-identity $($DeploymentOutputs['AZIDENTITY_USER_ASSIGNED_IDENTITY']) ` - --assign-identity [system] $($DeploymentOutputs['AZIDENTITY_USER_ASSIGNED_IDENTITY']) ` - --role "Storage Blob Data Reader" ` - --scope $($DeploymentOutputs['AZIDENTITY_STORAGE_ID']) ` - -e AZIDENTITY_STORAGE_NAME=$($DeploymentOutputs['AZIDENTITY_STORAGE_NAME']) ` - AZIDENTITY_STORAGE_NAME_USER_ASSIGNED=$($DeploymentOutputs['AZIDENTITY_STORAGE_NAME_USER_ASSIGNED']) ` - AZIDENTITY_USER_ASSIGNED_IDENTITY=$($DeploymentOutputs['AZIDENTITY_USER_ASSIGNED_IDENTITY']) ` - FUNCTIONS_CUSTOMHANDLER_PORT=80 -Write-Host "##vso[task.setvariable variable=AZIDENTITY_ACI_NAME;]$aciName" - -# Azure Functions deployment: copy the Windows binary from the Docker image, deploy it in a zip -Write-Host "Deploying to Azure Functions" -$container = docker create $image -docker cp ${container}:managed-id-test.exe "$PSScriptRoot/testdata/managed-id-test/" -docker rm -v $container -Compress-Archive -Path "$PSScriptRoot/testdata/managed-id-test/*" -DestinationPath func.zip -Force -az functionapp deploy -g $rg -n $DeploymentOutputs['AZIDENTITY_FUNCTION_NAME'] --src-path func.zip --type zip - -Write-Host "Creating federated identity" -$aksName = $DeploymentOutputs['AZIDENTITY_AKS_NAME'] -$idName = $DeploymentOutputs['AZIDENTITY_USER_ASSIGNED_IDENTITY_NAME'] -$issuer = az aks show -g $rg -n $aksName --query "oidcIssuerProfile.issuerUrl" -otsv -$podName = "azidentity-test" -$serviceAccountName = "workload-identity-sa" -az identity federated-credential create -g $rg --identity-name $idName --issuer $issuer --name $idName --subject system:serviceaccount:default:$serviceAccountName -Write-Host "Deploying to AKS" -az aks get-credentials -g $rg -n $aksName -az aks update --attach-acr $DeploymentOutputs['AZIDENTITY_ACR_NAME'] -g $rg -n $aksName -Set-Content -Path "$PSScriptRoot/k8s.yaml" -Value @" -apiVersion: v1 -kind: ServiceAccount -metadata: - annotations: - azure.workload.identity/client-id: $($DeploymentOutputs['AZIDENTITY_USER_ASSIGNED_IDENTITY_CLIENT_ID']) - name: $serviceAccountName - namespace: default ---- -apiVersion: v1 -kind: Pod -metadata: - name: $podName - namespace: default - labels: - app: $podName - azure.workload.identity/use: "true" -spec: - serviceAccountName: $serviceAccountName - containers: - - name: $podName - image: $image - env: - - name: AZIDENTITY_STORAGE_NAME - value: $($DeploymentOutputs['AZIDENTITY_STORAGE_NAME_USER_ASSIGNED']) - - name: AZIDENTITY_USE_WORKLOAD_IDENTITY - value: "true" - - name: FUNCTIONS_CUSTOMHANDLER_PORT - value: "80" - nodeSelector: - kubernetes.io/os: linux -"@ -kubectl apply -f "$PSScriptRoot/k8s.yaml" -Write-Host "##vso[task.setvariable variable=AZIDENTITY_POD_NAME;]$podName" diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/test-resources-pre.ps1 b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/test-resources-pre.ps1 deleted file mode 100644 index 58766d0a..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/test-resources-pre.ps1 +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - -# IMPORTANT: Do not invoke this file directly. Please instead run eng/common/TestResources/New-TestResources.ps1 from the repository root. - -[CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = 'Medium')] -param ( - [hashtable] $AdditionalParameters = @{}, - - # Captures any arguments from eng/New-TestResources.ps1 not declared here (no parameter errors). - [Parameter(ValueFromRemainingArguments = $true)] - $RemainingArguments -) - -if (-not (Test-Path "$PSScriptRoot/sshkey.pub")) { - ssh-keygen -t rsa -b 4096 -f "$PSScriptRoot/sshkey" -N '' -C '' -} -$templateFileParameters['sshPubKey'] = Get-Content "$PSScriptRoot/sshkey.pub" - -if (!$CI) { - # TODO: Remove this once auto-cloud config downloads are supported locally - Write-Host "Skipping cert setup in local testing mode" - return -} - -if ($null -eq $EnvironmentVariables -or $EnvironmentVariables.Count -eq 0) { - throw "EnvironmentVariables must be set in the calling script New-TestResources.ps1" -} - -$tmp = $env:TEMP ? $env:TEMP : [System.IO.Path]::GetTempPath() -$pfxPath = Join-Path $tmp "test.pfx" -$pemPath = Join-Path $tmp "test.pem" - -Write-Host "Creating identity test files: $pfxPath $pemPath" - -[System.Convert]::FromBase64String($EnvironmentVariables['PFX_CONTENTS']) | Set-Content -Path $pfxPath -AsByteStream -Set-Content -Path $pemPath -Value $EnvironmentVariables['PEM_CONTENTS'] - -# Set for pipeline -Write-Host "##vso[task.setvariable variable=IDENTITY_SP_CERT_PFX;]$pfxPath" -Write-Host "##vso[task.setvariable variable=IDENTITY_SP_CERT_PEM;]$pemPath" -# Set for local -$env:IDENTITY_SP_CERT_PFX = $pfxPath -$env:IDENTITY_SP_CERT_PEM = $pemPath diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/test-resources.bicep b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/test-resources.bicep deleted file mode 100644 index 2a216529..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/test-resources.bicep +++ /dev/null @@ -1,219 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -@description('Kubernetes cluster admin user name.') -param adminUser string = 'azureuser' - -@minLength(6) -@maxLength(23) -@description('The base resource name.') -param baseName string = resourceGroup().name - -@description('Whether to deploy resources. When set to false, this file deploys nothing.') -param deployResources bool = false - -param sshPubKey string = '' - -@description('The location of the resource. By default, this is the same as the resource group.') -param location string = resourceGroup().location - -// https://learn.microsoft.com/azure/role-based-access-control/built-in-roles -var acrPull = subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '7f951dda-4ed3-4680-a7ca-43fe172d538d') -var blobReader = subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '2a2b9908-6ea1-4ae2-8e65-a410df84e7d1') - -resource sa 'Microsoft.Storage/storageAccounts@2021-08-01' = if (deployResources) { - kind: 'StorageV2' - location: location - name: 'sa${uniqueString(baseName)}' - properties: { - accessTier: 'Hot' - } - sku: { - name: 'Standard_LRS' - } -} - -resource saUserAssigned 'Microsoft.Storage/storageAccounts@2021-08-01' = if (deployResources) { - kind: 'StorageV2' - location: location - name: 'sa2${uniqueString(baseName)}' - properties: { - accessTier: 'Hot' - } - sku: { - name: 'Standard_LRS' - } -} - -resource usermgdid 'Microsoft.ManagedIdentity/userAssignedIdentities@2018-11-30' = if (deployResources) { - location: location - name: baseName -} - -resource acrPullContainerInstance 'Microsoft.Authorization/roleAssignments@2022-04-01' = if (deployResources) { - name: guid(resourceGroup().id, acrPull, 'containerInstance') - properties: { - principalId: deployResources ? usermgdid.properties.principalId : '' - principalType: 'ServicePrincipal' - roleDefinitionId: acrPull - } - scope: containerRegistry -} - -resource blobRoleUserAssigned 'Microsoft.Authorization/roleAssignments@2022-04-01' = if (deployResources) { - scope: saUserAssigned - name: guid(resourceGroup().id, blobReader, usermgdid.id) - properties: { - principalId: deployResources ? usermgdid.properties.principalId : '' - principalType: 'ServicePrincipal' - roleDefinitionId: blobReader - } -} - -resource blobRoleFunc 'Microsoft.Authorization/roleAssignments@2022-04-01' = if (deployResources) { - name: guid(resourceGroup().id, blobReader, 'azfunc') - properties: { - principalId: deployResources ? azfunc.identity.principalId : '' - roleDefinitionId: blobReader - principalType: 'ServicePrincipal' - } - scope: sa -} - -resource containerRegistry 'Microsoft.ContainerRegistry/registries@2023-01-01-preview' = if (deployResources) { - location: location - name: uniqueString(resourceGroup().id) - properties: { - adminUserEnabled: true - } - sku: { - name: 'Basic' - } -} - -resource farm 'Microsoft.Web/serverfarms@2021-03-01' = if (deployResources) { - kind: 'app' - location: location - name: '${baseName}_asp' - properties: {} - sku: { - capacity: 1 - family: 'B' - name: 'B1' - size: 'B1' - tier: 'Basic' - } -} - -resource azfunc 'Microsoft.Web/sites@2021-03-01' = if (deployResources) { - identity: { - type: 'SystemAssigned, UserAssigned' - userAssignedIdentities: { - '${deployResources ? usermgdid.id : ''}': {} - } - } - kind: 'functionapp' - location: location - name: '${baseName}func' - properties: { - enabled: true - httpsOnly: true - keyVaultReferenceIdentity: 'SystemAssigned' - serverFarmId: farm.id - siteConfig: { - alwaysOn: true - appSettings: [ - { - name: 'AZIDENTITY_STORAGE_NAME' - value: deployResources ? sa.name : null - } - { - name: 'AZIDENTITY_STORAGE_NAME_USER_ASSIGNED' - value: deployResources ? saUserAssigned.name : null - } - { - name: 'AZIDENTITY_USER_ASSIGNED_IDENTITY' - value: deployResources ? usermgdid.id : null - } - { - name: 'AzureWebJobsStorage' - value: 'DefaultEndpointsProtocol=https;AccountName=${deployResources ? sa.name : ''};EndpointSuffix=${deployResources ? environment().suffixes.storage : ''};AccountKey=${deployResources ? sa.listKeys().keys[0].value : ''}' - } - { - name: 'FUNCTIONS_EXTENSION_VERSION' - value: '~4' - } - { - name: 'FUNCTIONS_WORKER_RUNTIME' - value: 'custom' - } - { - name: 'WEBSITE_CONTENTAZUREFILECONNECTIONSTRING' - value: 'DefaultEndpointsProtocol=https;AccountName=${deployResources ? sa.name : ''};EndpointSuffix=${deployResources ? environment().suffixes.storage : ''};AccountKey=${deployResources ? sa.listKeys().keys[0].value : ''}' - } - { - name: 'WEBSITE_CONTENTSHARE' - value: toLower('${baseName}-func') - } - ] - http20Enabled: true - minTlsVersion: '1.2' - } - } -} - -resource aks 'Microsoft.ContainerService/managedClusters@2023-06-01' = if (deployResources) { - name: baseName - location: location - identity: { - type: 'SystemAssigned' - } - properties: { - agentPoolProfiles: [ - { - count: 1 - enableAutoScaling: false - kubeletDiskType: 'OS' - mode: 'System' - name: 'agentpool' - osDiskSizeGB: 128 - osDiskType: 'Managed' - osSKU: 'Ubuntu' - osType: 'Linux' - type: 'VirtualMachineScaleSets' - vmSize: 'Standard_D2s_v3' - } - ] - dnsPrefix: 'identitytest' - enableRBAC: true - linuxProfile: { - adminUsername: adminUser - ssh: { - publicKeys: [ - { - keyData: sshPubKey - } - ] - } - } - oidcIssuerProfile: { - enabled: true - } - securityProfile: { - workloadIdentity: { - enabled: true - } - } - } -} - -output AZIDENTITY_ACR_LOGIN_SERVER string = deployResources ? containerRegistry.properties.loginServer : '' -output AZIDENTITY_ACR_NAME string = deployResources ? containerRegistry.name : '' -output AZIDENTITY_AKS_NAME string = deployResources ? aks.name : '' -output AZIDENTITY_FUNCTION_NAME string = deployResources ? azfunc.name : '' -output AZIDENTITY_STORAGE_ID string = deployResources ? sa.id : '' -output AZIDENTITY_STORAGE_NAME string = deployResources ? sa.name : '' -output AZIDENTITY_STORAGE_NAME_USER_ASSIGNED string = deployResources ? saUserAssigned.name : '' -output AZIDENTITY_USER_ASSIGNED_IDENTITY string = deployResources ? usermgdid.id : '' -output AZIDENTITY_USER_ASSIGNED_IDENTITY_CLIENT_ID string = deployResources ? usermgdid.properties.clientId : '' -output AZIDENTITY_USER_ASSIGNED_IDENTITY_NAME string = deployResources ? usermgdid.name : '' diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/username_password_credential.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/username_password_credential.go deleted file mode 100644 index 294ed81e..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/username_password_credential.go +++ /dev/null @@ -1,90 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package azidentity - -import ( - "context" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" -) - -const credNameUserPassword = "UsernamePasswordCredential" - -// UsernamePasswordCredentialOptions contains optional parameters for UsernamePasswordCredential. -type UsernamePasswordCredentialOptions struct { - azcore.ClientOptions - - // AdditionallyAllowedTenants specifies additional tenants for which the credential may acquire tokens. - // Add the wildcard value "*" to allow the credential to acquire tokens for any tenant in which the - // application is registered. - AdditionallyAllowedTenants []string - - // authenticationRecord returned by a call to a credential's Authenticate method. Set this option - // to enable the credential to use data from a previous authentication. - authenticationRecord authenticationRecord - - // DisableInstanceDiscovery should be set true only by applications authenticating in disconnected clouds, or - // private clouds such as Azure Stack. It determines whether the credential requests Microsoft Entra instance metadata - // from https://login.microsoft.com before authenticating. Setting this to true will skip this request, making - // the application responsible for ensuring the configured authority is valid and trustworthy. - DisableInstanceDiscovery bool - - // tokenCachePersistenceOptions enables persistent token caching when not nil. - tokenCachePersistenceOptions *tokenCachePersistenceOptions -} - -// UsernamePasswordCredential authenticates a user with a password. Microsoft doesn't recommend this kind of authentication, -// because it's less secure than other authentication flows. This credential is not interactive, so it isn't compatible -// with any form of multi-factor authentication, and the application must already have user or admin consent. -// This credential can only authenticate work and school accounts; it can't authenticate Microsoft accounts. -type UsernamePasswordCredential struct { - client *publicClient -} - -// NewUsernamePasswordCredential creates a UsernamePasswordCredential. clientID is the ID of the application the user -// will authenticate to. Pass nil for options to accept defaults. -func NewUsernamePasswordCredential(tenantID string, clientID string, username string, password string, options *UsernamePasswordCredentialOptions) (*UsernamePasswordCredential, error) { - if options == nil { - options = &UsernamePasswordCredentialOptions{} - } - opts := publicClientOptions{ - AdditionallyAllowedTenants: options.AdditionallyAllowedTenants, - ClientOptions: options.ClientOptions, - DisableInstanceDiscovery: options.DisableInstanceDiscovery, - Password: password, - Record: options.authenticationRecord, - TokenCachePersistenceOptions: options.tokenCachePersistenceOptions, - Username: username, - } - c, err := newPublicClient(tenantID, clientID, credNameUserPassword, opts) - if err != nil { - return nil, err - } - return &UsernamePasswordCredential{client: c}, err -} - -// Authenticate the user. Subsequent calls to GetToken will automatically use the returned AuthenticationRecord. -func (c *UsernamePasswordCredential) authenticate(ctx context.Context, opts *policy.TokenRequestOptions) (authenticationRecord, error) { - var err error - ctx, endSpan := runtime.StartSpan(ctx, credNameUserPassword+"."+traceOpAuthenticate, c.client.azClient.Tracer(), nil) - defer func() { endSpan(err) }() - tk, err := c.client.Authenticate(ctx, opts) - return tk, err -} - -// GetToken requests an access token from Microsoft Entra ID. This method is called automatically by Azure SDK clients. -func (c *UsernamePasswordCredential) GetToken(ctx context.Context, opts policy.TokenRequestOptions) (azcore.AccessToken, error) { - var err error - ctx, endSpan := runtime.StartSpan(ctx, credNameUserPassword+"."+traceOpGetToken, c.client.azClient.Tracer(), nil) - defer func() { endSpan(err) }() - tk, err := c.client.GetToken(ctx, opts) - return tk, err -} - -var _ azcore.TokenCredential = (*UsernamePasswordCredential)(nil) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/version.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/version.go deleted file mode 100644 index 459ef64c..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/version.go +++ /dev/null @@ -1,18 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package azidentity - -const ( - // UserAgent is the string to be used in the user agent string when making requests. - component = "azidentity" - - // module is the fully qualified name of the module used in telemetry and distributed tracing. - module = "github.com/Azure/azure-sdk-for-go/sdk/" + component - - // Version is the semantic version (see http://semver.org) of this module. - version = "v1.6.0" -) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/workload_identity.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/workload_identity.go deleted file mode 100644 index 3e43e788..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/workload_identity.go +++ /dev/null @@ -1,131 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package azidentity - -import ( - "context" - "errors" - "os" - "sync" - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" -) - -const credNameWorkloadIdentity = "WorkloadIdentityCredential" - -// WorkloadIdentityCredential supports Azure workload identity on Kubernetes. -// See [Azure Kubernetes Service documentation] for more information. -// -// [Azure Kubernetes Service documentation]: https://learn.microsoft.com/azure/aks/workload-identity-overview -type WorkloadIdentityCredential struct { - assertion, file string - cred *ClientAssertionCredential - expires time.Time - mtx *sync.RWMutex -} - -// WorkloadIdentityCredentialOptions contains optional parameters for WorkloadIdentityCredential. -type WorkloadIdentityCredentialOptions struct { - azcore.ClientOptions - - // AdditionallyAllowedTenants specifies additional tenants for which the credential may acquire tokens. - // Add the wildcard value "*" to allow the credential to acquire tokens for any tenant in which the - // application is registered. - AdditionallyAllowedTenants []string - // ClientID of the service principal. Defaults to the value of the environment variable AZURE_CLIENT_ID. - ClientID string - // DisableInstanceDiscovery should be set true only by applications authenticating in disconnected clouds, or - // private clouds such as Azure Stack. It determines whether the credential requests Microsoft Entra instance metadata - // from https://login.microsoft.com before authenticating. Setting this to true will skip this request, making - // the application responsible for ensuring the configured authority is valid and trustworthy. - DisableInstanceDiscovery bool - // TenantID of the service principal. Defaults to the value of the environment variable AZURE_TENANT_ID. - TenantID string - // TokenFilePath is the path of a file containing a Kubernetes service account token. Defaults to the value of the - // environment variable AZURE_FEDERATED_TOKEN_FILE. - TokenFilePath string -} - -// NewWorkloadIdentityCredential constructs a WorkloadIdentityCredential. Service principal configuration is read -// from environment variables as set by the Azure workload identity webhook. Set options to override those values. -func NewWorkloadIdentityCredential(options *WorkloadIdentityCredentialOptions) (*WorkloadIdentityCredential, error) { - if options == nil { - options = &WorkloadIdentityCredentialOptions{} - } - ok := false - clientID := options.ClientID - if clientID == "" { - if clientID, ok = os.LookupEnv(azureClientID); !ok { - return nil, errors.New("no client ID specified. Check pod configuration or set ClientID in the options") - } - } - file := options.TokenFilePath - if file == "" { - if file, ok = os.LookupEnv(azureFederatedTokenFile); !ok { - return nil, errors.New("no token file specified. Check pod configuration or set TokenFilePath in the options") - } - } - tenantID := options.TenantID - if tenantID == "" { - if tenantID, ok = os.LookupEnv(azureTenantID); !ok { - return nil, errors.New("no tenant ID specified. Check pod configuration or set TenantID in the options") - } - } - w := WorkloadIdentityCredential{file: file, mtx: &sync.RWMutex{}} - caco := ClientAssertionCredentialOptions{ - AdditionallyAllowedTenants: options.AdditionallyAllowedTenants, - ClientOptions: options.ClientOptions, - DisableInstanceDiscovery: options.DisableInstanceDiscovery, - } - cred, err := NewClientAssertionCredential(tenantID, clientID, w.getAssertion, &caco) - if err != nil { - return nil, err - } - // we want "WorkloadIdentityCredential" in log messages, not "ClientAssertionCredential" - cred.client.name = credNameWorkloadIdentity - w.cred = cred - return &w, nil -} - -// GetToken requests an access token from Microsoft Entra ID. Azure SDK clients call this method automatically. -func (w *WorkloadIdentityCredential) GetToken(ctx context.Context, opts policy.TokenRequestOptions) (azcore.AccessToken, error) { - var err error - ctx, endSpan := runtime.StartSpan(ctx, credNameWorkloadIdentity+"."+traceOpGetToken, w.cred.client.azClient.Tracer(), nil) - defer func() { endSpan(err) }() - tk, err := w.cred.GetToken(ctx, opts) - return tk, err -} - -// getAssertion returns the specified file's content, which is expected to be a Kubernetes service account token. -// Kubernetes is responsible for updating the file as service account tokens expire. -func (w *WorkloadIdentityCredential) getAssertion(context.Context) (string, error) { - w.mtx.RLock() - if w.expires.Before(time.Now()) { - // ensure only one goroutine at a time updates the assertion - w.mtx.RUnlock() - w.mtx.Lock() - defer w.mtx.Unlock() - // double check because another goroutine may have acquired the write lock first and done the update - if now := time.Now(); w.expires.Before(now) { - content, err := os.ReadFile(w.file) - if err != nil { - return "", err - } - w.assertion = string(content) - // Kubernetes rotates service account tokens when they reach 80% of their total TTL. The shortest TTL - // is 1 hour. That implies the token we just read is valid for at least 12 minutes (20% of 1 hour), - // but we add some margin for safety. - w.expires = now.Add(10 * time.Minute) - } - } else { - defer w.mtx.RUnlock() - } - return w.assertion, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/CHANGELOG.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/CHANGELOG.md deleted file mode 100644 index 051813c3..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/CHANGELOG.md +++ /dev/null @@ -1,7980 +0,0 @@ -# Release History - -## 1.0.0 (2022-05-16) -### Breaking Changes - -- Function `*VirtualMachinesClient.BeginPowerOff` return value(s) have been changed from `(*armruntime.Poller[VirtualMachinesClientPowerOffResponse], error)` to `(*runtime.Poller[VirtualMachinesClientPowerOffResponse], error)` -- Function `*VirtualMachineScaleSetVMExtensionsClient.BeginDelete` return value(s) have been changed from `(*armruntime.Poller[VirtualMachineScaleSetVMExtensionsClientDeleteResponse], error)` to `(*runtime.Poller[VirtualMachineScaleSetVMExtensionsClientDeleteResponse], error)` -- Function `*VirtualMachineExtensionsClient.BeginUpdate` return value(s) have been changed from `(*armruntime.Poller[VirtualMachineExtensionsClientUpdateResponse], error)` to `(*runtime.Poller[VirtualMachineExtensionsClientUpdateResponse], error)` -- Function `*GalleryImagesClient.BeginDelete` return value(s) have been changed from `(*armruntime.Poller[GalleryImagesClientDeleteResponse], error)` to `(*runtime.Poller[GalleryImagesClientDeleteResponse], error)` -- Function `*VirtualMachinesClient.BeginPerformMaintenance` return value(s) have been changed from `(*armruntime.Poller[VirtualMachinesClientPerformMaintenanceResponse], error)` to `(*runtime.Poller[VirtualMachinesClientPerformMaintenanceResponse], error)` -- Function `*GalleryApplicationVersionsClient.BeginDelete` return value(s) have been changed from `(*armruntime.Poller[GalleryApplicationVersionsClientDeleteResponse], error)` to `(*runtime.Poller[GalleryApplicationVersionsClientDeleteResponse], error)` -- Function `*VirtualMachineExtensionsClient.BeginDelete` return value(s) have been changed from `(*armruntime.Poller[VirtualMachineExtensionsClientDeleteResponse], error)` to `(*runtime.Poller[VirtualMachineExtensionsClientDeleteResponse], error)` -- Function `*VirtualMachineScaleSetVMExtensionsClient.BeginCreateOrUpdate` return value(s) have been changed from `(*armruntime.Poller[VirtualMachineScaleSetVMExtensionsClientCreateOrUpdateResponse], error)` to `(*runtime.Poller[VirtualMachineScaleSetVMExtensionsClientCreateOrUpdateResponse], error)` -- Function `*CapacityReservationsClient.BeginDelete` return value(s) have been changed from `(*armruntime.Poller[CapacityReservationsClientDeleteResponse], error)` to `(*runtime.Poller[CapacityReservationsClientDeleteResponse], error)` -- Function `*CloudServicesClient.BeginPowerOff` return value(s) have been changed from `(*armruntime.Poller[CloudServicesClientPowerOffResponse], error)` to `(*runtime.Poller[CloudServicesClientPowerOffResponse], error)` -- Function `*CloudServicesClient.BeginDelete` return value(s) have been changed from `(*armruntime.Poller[CloudServicesClientDeleteResponse], error)` to `(*runtime.Poller[CloudServicesClientDeleteResponse], error)` -- Function `*DiskAccessesClient.BeginUpdate` return value(s) have been changed from `(*armruntime.Poller[DiskAccessesClientUpdateResponse], error)` to `(*runtime.Poller[DiskAccessesClientUpdateResponse], error)` -- Function `*GalleryImageVersionsClient.BeginUpdate` return value(s) have been changed from `(*armruntime.Poller[GalleryImageVersionsClientUpdateResponse], error)` to `(*runtime.Poller[GalleryImageVersionsClientUpdateResponse], error)` -- Function `*DiskAccessesClient.BeginUpdateAPrivateEndpointConnection` return value(s) have been changed from `(*armruntime.Poller[DiskAccessesClientUpdateAPrivateEndpointConnectionResponse], error)` to `(*runtime.Poller[DiskAccessesClientUpdateAPrivateEndpointConnectionResponse], error)` -- Function `*CloudServiceRoleInstancesClient.BeginRebuild` return value(s) have been changed from `(*armruntime.Poller[CloudServiceRoleInstancesClientRebuildResponse], error)` to `(*runtime.Poller[CloudServiceRoleInstancesClientRebuildResponse], error)` -- Function `*DiskAccessesClient.BeginDelete` return value(s) have been changed from `(*armruntime.Poller[DiskAccessesClientDeleteResponse], error)` to `(*runtime.Poller[DiskAccessesClientDeleteResponse], error)` -- Function `*VirtualMachinesClient.BeginDeallocate` return value(s) have been changed from `(*armruntime.Poller[VirtualMachinesClientDeallocateResponse], error)` to `(*runtime.Poller[VirtualMachinesClientDeallocateResponse], error)` -- Function `*RestorePointCollectionsClient.BeginDelete` return value(s) have been changed from `(*armruntime.Poller[RestorePointCollectionsClientDeleteResponse], error)` to `(*runtime.Poller[RestorePointCollectionsClientDeleteResponse], error)` -- Function `*DisksClient.BeginRevokeAccess` return value(s) have been changed from `(*armruntime.Poller[DisksClientRevokeAccessResponse], error)` to `(*runtime.Poller[DisksClientRevokeAccessResponse], error)` -- Function `*CapacityReservationsClient.BeginUpdate` return value(s) have been changed from `(*armruntime.Poller[CapacityReservationsClientUpdateResponse], error)` to `(*runtime.Poller[CapacityReservationsClientUpdateResponse], error)` -- Function `*DiskEncryptionSetsClient.BeginUpdate` return value(s) have been changed from `(*armruntime.Poller[DiskEncryptionSetsClientUpdateResponse], error)` to `(*runtime.Poller[DiskEncryptionSetsClientUpdateResponse], error)` -- Function `*GalleryImageVersionsClient.BeginDelete` return value(s) have been changed from `(*armruntime.Poller[GalleryImageVersionsClientDeleteResponse], error)` to `(*runtime.Poller[GalleryImageVersionsClientDeleteResponse], error)` -- Function `*DiskEncryptionSetsClient.BeginDelete` return value(s) have been changed from `(*armruntime.Poller[DiskEncryptionSetsClientDeleteResponse], error)` to `(*runtime.Poller[DiskEncryptionSetsClientDeleteResponse], error)` -- Function `*VirtualMachineScaleSetVMRunCommandsClient.BeginDelete` return value(s) have been changed from `(*armruntime.Poller[VirtualMachineScaleSetVMRunCommandsClientDeleteResponse], error)` to `(*runtime.Poller[VirtualMachineScaleSetVMRunCommandsClientDeleteResponse], error)` -- Function `*DisksClient.BeginCreateOrUpdate` return value(s) have been changed from `(*armruntime.Poller[DisksClientCreateOrUpdateResponse], error)` to `(*runtime.Poller[DisksClientCreateOrUpdateResponse], error)` -- Function `*VirtualMachineScaleSetVMRunCommandsClient.BeginUpdate` return value(s) have been changed from `(*armruntime.Poller[VirtualMachineScaleSetVMRunCommandsClientUpdateResponse], error)` to `(*runtime.Poller[VirtualMachineScaleSetVMRunCommandsClientUpdateResponse], error)` -- Function `*VirtualMachineRunCommandsClient.BeginCreateOrUpdate` return value(s) have been changed from `(*armruntime.Poller[VirtualMachineRunCommandsClientCreateOrUpdateResponse], error)` to `(*runtime.Poller[VirtualMachineRunCommandsClientCreateOrUpdateResponse], error)` -- Function `*VirtualMachineScaleSetVMsClient.BeginRedeploy` return value(s) have been changed from `(*armruntime.Poller[VirtualMachineScaleSetVMsClientRedeployResponse], error)` to `(*runtime.Poller[VirtualMachineScaleSetVMsClientRedeployResponse], error)` -- Function `*DisksClient.BeginUpdate` return value(s) have been changed from `(*armruntime.Poller[DisksClientUpdateResponse], error)` to `(*runtime.Poller[DisksClientUpdateResponse], error)` -- Function `*VirtualMachineScaleSetsClient.BeginRestart` return value(s) have been changed from `(*armruntime.Poller[VirtualMachineScaleSetsClientRestartResponse], error)` to `(*runtime.Poller[VirtualMachineScaleSetsClientRestartResponse], error)` -- Function `*GalleryImagesClient.BeginCreateOrUpdate` return value(s) have been changed from `(*armruntime.Poller[GalleryImagesClientCreateOrUpdateResponse], error)` to `(*runtime.Poller[GalleryImagesClientCreateOrUpdateResponse], error)` -- Function `*VirtualMachineScaleSetRollingUpgradesClient.BeginStartExtensionUpgrade` return value(s) have been changed from `(*armruntime.Poller[VirtualMachineScaleSetRollingUpgradesClientStartExtensionUpgradeResponse], error)` to `(*runtime.Poller[VirtualMachineScaleSetRollingUpgradesClientStartExtensionUpgradeResponse], error)` -- Function `*VirtualMachineScaleSetVMsClient.BeginDelete` return value(s) have been changed from `(*armruntime.Poller[VirtualMachineScaleSetVMsClientDeleteResponse], error)` to `(*runtime.Poller[VirtualMachineScaleSetVMsClientDeleteResponse], error)` -- Function `*VirtualMachineScaleSetVMsClient.BeginRunCommand` return value(s) have been changed from `(*armruntime.Poller[VirtualMachineScaleSetVMsClientRunCommandResponse], error)` to `(*runtime.Poller[VirtualMachineScaleSetVMsClientRunCommandResponse], error)` -- Function `*VirtualMachineScaleSetVMsClient.BeginReimageAll` return value(s) have been changed from `(*armruntime.Poller[VirtualMachineScaleSetVMsClientReimageAllResponse], error)` to `(*runtime.Poller[VirtualMachineScaleSetVMsClientReimageAllResponse], error)` -- Function `*GalleryImageVersionsClient.BeginCreateOrUpdate` return value(s) have been changed from `(*armruntime.Poller[GalleryImageVersionsClientCreateOrUpdateResponse], error)` to `(*runtime.Poller[GalleryImageVersionsClientCreateOrUpdateResponse], error)` -- Function `*VirtualMachineScaleSetsClient.BeginUpdate` return value(s) have been changed from `(*armruntime.Poller[VirtualMachineScaleSetsClientUpdateResponse], error)` to `(*runtime.Poller[VirtualMachineScaleSetsClientUpdateResponse], error)` -- Function `*RestorePointsClient.BeginDelete` return value(s) have been changed from `(*armruntime.Poller[RestorePointsClientDeleteResponse], error)` to `(*runtime.Poller[RestorePointsClientDeleteResponse], error)` -- Function `*VirtualMachineScaleSetVMsClient.BeginStart` return value(s) have been changed from `(*armruntime.Poller[VirtualMachineScaleSetVMsClientStartResponse], error)` to `(*runtime.Poller[VirtualMachineScaleSetVMsClientStartResponse], error)` -- Function `*GalleriesClient.BeginCreateOrUpdate` return value(s) have been changed from `(*armruntime.Poller[GalleriesClientCreateOrUpdateResponse], error)` to `(*runtime.Poller[GalleriesClientCreateOrUpdateResponse], error)` -- Function `*DiskAccessesClient.BeginCreateOrUpdate` return value(s) have been changed from `(*armruntime.Poller[DiskAccessesClientCreateOrUpdateResponse], error)` to `(*runtime.Poller[DiskAccessesClientCreateOrUpdateResponse], error)` -- Function `*GalleryApplicationVersionsClient.BeginCreateOrUpdate` return value(s) have been changed from `(*armruntime.Poller[GalleryApplicationVersionsClientCreateOrUpdateResponse], error)` to `(*runtime.Poller[GalleryApplicationVersionsClientCreateOrUpdateResponse], error)` -- Function `*DiskAccessesClient.BeginDeleteAPrivateEndpointConnection` return value(s) have been changed from `(*armruntime.Poller[DiskAccessesClientDeleteAPrivateEndpointConnectionResponse], error)` to `(*runtime.Poller[DiskAccessesClientDeleteAPrivateEndpointConnectionResponse], error)` -- Function `*CloudServicesUpdateDomainClient.BeginWalkUpdateDomain` return value(s) have been changed from `(*armruntime.Poller[CloudServicesUpdateDomainClientWalkUpdateDomainResponse], error)` to `(*runtime.Poller[CloudServicesUpdateDomainClientWalkUpdateDomainResponse], error)` -- Function `*DedicatedHostsClient.BeginRestart` return value(s) have been changed from `(*armruntime.Poller[DedicatedHostsClientRestartResponse], error)` to `(*runtime.Poller[DedicatedHostsClientRestartResponse], error)` -- Function `*GalleriesClient.BeginDelete` return value(s) have been changed from `(*armruntime.Poller[GalleriesClientDeleteResponse], error)` to `(*runtime.Poller[GalleriesClientDeleteResponse], error)` -- Function `*GalleryApplicationVersionsClient.BeginUpdate` return value(s) have been changed from `(*armruntime.Poller[GalleryApplicationVersionsClientUpdateResponse], error)` to `(*runtime.Poller[GalleryApplicationVersionsClientUpdateResponse], error)` -- Function `*GalleryImagesClient.BeginUpdate` return value(s) have been changed from `(*armruntime.Poller[GalleryImagesClientUpdateResponse], error)` to `(*runtime.Poller[GalleryImagesClientUpdateResponse], error)` -- Function `*CloudServicesClient.BeginCreateOrUpdate` return value(s) have been changed from `(*armruntime.Poller[CloudServicesClientCreateOrUpdateResponse], error)` to `(*runtime.Poller[CloudServicesClientCreateOrUpdateResponse], error)` -- Function `*SnapshotsClient.BeginRevokeAccess` return value(s) have been changed from `(*armruntime.Poller[SnapshotsClientRevokeAccessResponse], error)` to `(*runtime.Poller[SnapshotsClientRevokeAccessResponse], error)` -- Function `*SnapshotsClient.BeginGrantAccess` return value(s) have been changed from `(*armruntime.Poller[SnapshotsClientGrantAccessResponse], error)` to `(*runtime.Poller[SnapshotsClientGrantAccessResponse], error)` -- Function `*VirtualMachineScaleSetsClient.BeginCreateOrUpdate` return value(s) have been changed from `(*armruntime.Poller[VirtualMachineScaleSetsClientCreateOrUpdateResponse], error)` to `(*runtime.Poller[VirtualMachineScaleSetsClientCreateOrUpdateResponse], error)` -- Function `*LogAnalyticsClient.BeginExportThrottledRequests` return value(s) have been changed from `(*armruntime.Poller[LogAnalyticsClientExportThrottledRequestsResponse], error)` to `(*runtime.Poller[LogAnalyticsClientExportThrottledRequestsResponse], error)` -- Function `*VirtualMachineScaleSetVMsClient.BeginReimage` return value(s) have been changed from `(*armruntime.Poller[VirtualMachineScaleSetVMsClientReimageResponse], error)` to `(*runtime.Poller[VirtualMachineScaleSetVMsClientReimageResponse], error)` -- Function `*CapacityReservationsClient.BeginCreateOrUpdate` return value(s) have been changed from `(*armruntime.Poller[CapacityReservationsClientCreateOrUpdateResponse], error)` to `(*runtime.Poller[CapacityReservationsClientCreateOrUpdateResponse], error)` -- Function `*CloudServicesClient.BeginReimage` return value(s) have been changed from `(*armruntime.Poller[CloudServicesClientReimageResponse], error)` to `(*runtime.Poller[CloudServicesClientReimageResponse], error)` -- Function `*VirtualMachineScaleSetsClient.BeginDeallocate` return value(s) have been changed from `(*armruntime.Poller[VirtualMachineScaleSetsClientDeallocateResponse], error)` to `(*runtime.Poller[VirtualMachineScaleSetsClientDeallocateResponse], error)` -- Function `*VirtualMachinesClient.BeginConvertToManagedDisks` return value(s) have been changed from `(*armruntime.Poller[VirtualMachinesClientConvertToManagedDisksResponse], error)` to `(*runtime.Poller[VirtualMachinesClientConvertToManagedDisksResponse], error)` -- Function `*ImagesClient.BeginCreateOrUpdate` return value(s) have been changed from `(*armruntime.Poller[ImagesClientCreateOrUpdateResponse], error)` to `(*runtime.Poller[ImagesClientCreateOrUpdateResponse], error)` -- Function `*VirtualMachineScaleSetsClient.BeginReimage` return value(s) have been changed from `(*armruntime.Poller[VirtualMachineScaleSetsClientReimageResponse], error)` to `(*runtime.Poller[VirtualMachineScaleSetsClientReimageResponse], error)` -- Function `*VirtualMachinesClient.BeginCapture` return value(s) have been changed from `(*armruntime.Poller[VirtualMachinesClientCaptureResponse], error)` to `(*runtime.Poller[VirtualMachinesClientCaptureResponse], error)` -- Function `*VirtualMachinesClient.BeginDelete` return value(s) have been changed from `(*armruntime.Poller[VirtualMachinesClientDeleteResponse], error)` to `(*runtime.Poller[VirtualMachinesClientDeleteResponse], error)` -- Function `*VirtualMachineRunCommandsClient.BeginUpdate` return value(s) have been changed from `(*armruntime.Poller[VirtualMachineRunCommandsClientUpdateResponse], error)` to `(*runtime.Poller[VirtualMachineRunCommandsClientUpdateResponse], error)` -- Function `*DisksClient.BeginDelete` return value(s) have been changed from `(*armruntime.Poller[DisksClientDeleteResponse], error)` to `(*runtime.Poller[DisksClientDeleteResponse], error)` -- Function `*GalleryApplicationsClient.BeginCreateOrUpdate` return value(s) have been changed from `(*armruntime.Poller[GalleryApplicationsClientCreateOrUpdateResponse], error)` to `(*runtime.Poller[GalleryApplicationsClientCreateOrUpdateResponse], error)` -- Function `*VirtualMachinesClient.BeginReimage` return value(s) have been changed from `(*armruntime.Poller[VirtualMachinesClientReimageResponse], error)` to `(*runtime.Poller[VirtualMachinesClientReimageResponse], error)` -- Function `*DedicatedHostsClient.BeginUpdate` return value(s) have been changed from `(*armruntime.Poller[DedicatedHostsClientUpdateResponse], error)` to `(*runtime.Poller[DedicatedHostsClientUpdateResponse], error)` -- Function `*VirtualMachinesClient.BeginRunCommand` return value(s) have been changed from `(*armruntime.Poller[VirtualMachinesClientRunCommandResponse], error)` to `(*runtime.Poller[VirtualMachinesClientRunCommandResponse], error)` -- Function `*DisksClient.BeginGrantAccess` return value(s) have been changed from `(*armruntime.Poller[DisksClientGrantAccessResponse], error)` to `(*runtime.Poller[DisksClientGrantAccessResponse], error)` -- Function `*VirtualMachineScaleSetsClient.BeginReimageAll` return value(s) have been changed from `(*armruntime.Poller[VirtualMachineScaleSetsClientReimageAllResponse], error)` to `(*runtime.Poller[VirtualMachineScaleSetsClientReimageAllResponse], error)` -- Function `*VirtualMachineScaleSetsClient.BeginRedeploy` return value(s) have been changed from `(*armruntime.Poller[VirtualMachineScaleSetsClientRedeployResponse], error)` to `(*runtime.Poller[VirtualMachineScaleSetsClientRedeployResponse], error)` -- Function `*VirtualMachinesClient.BeginUpdate` return value(s) have been changed from `(*armruntime.Poller[VirtualMachinesClientUpdateResponse], error)` to `(*runtime.Poller[VirtualMachinesClientUpdateResponse], error)` -- Function `*CloudServicesClient.BeginUpdate` return value(s) have been changed from `(*armruntime.Poller[CloudServicesClientUpdateResponse], error)` to `(*runtime.Poller[CloudServicesClientUpdateResponse], error)` -- Function `*VirtualMachineScaleSetVMsClient.BeginDeallocate` return value(s) have been changed from `(*armruntime.Poller[VirtualMachineScaleSetVMsClientDeallocateResponse], error)` to `(*runtime.Poller[VirtualMachineScaleSetVMsClientDeallocateResponse], error)` -- Function `*CloudServicesClient.BeginRestart` return value(s) have been changed from `(*armruntime.Poller[CloudServicesClientRestartResponse], error)` to `(*runtime.Poller[CloudServicesClientRestartResponse], error)` -- Function `*VirtualMachinesClient.BeginStart` return value(s) have been changed from `(*armruntime.Poller[VirtualMachinesClientStartResponse], error)` to `(*runtime.Poller[VirtualMachinesClientStartResponse], error)` -- Function `*RestorePointsClient.BeginCreate` return value(s) have been changed from `(*armruntime.Poller[RestorePointsClientCreateResponse], error)` to `(*runtime.Poller[RestorePointsClientCreateResponse], error)` -- Function `*VirtualMachineScaleSetVMsClient.BeginRestart` return value(s) have been changed from `(*armruntime.Poller[VirtualMachineScaleSetVMsClientRestartResponse], error)` to `(*runtime.Poller[VirtualMachineScaleSetVMsClientRestartResponse], error)` -- Function `*GalleriesClient.BeginUpdate` return value(s) have been changed from `(*armruntime.Poller[GalleriesClientUpdateResponse], error)` to `(*runtime.Poller[GalleriesClientUpdateResponse], error)` -- Function `*VirtualMachineScaleSetsClient.BeginDelete` return value(s) have been changed from `(*armruntime.Poller[VirtualMachineScaleSetsClientDeleteResponse], error)` to `(*runtime.Poller[VirtualMachineScaleSetsClientDeleteResponse], error)` -- Function `*VirtualMachinesClient.BeginCreateOrUpdate` return value(s) have been changed from `(*armruntime.Poller[VirtualMachinesClientCreateOrUpdateResponse], error)` to `(*runtime.Poller[VirtualMachinesClientCreateOrUpdateResponse], error)` -- Function `*ImagesClient.BeginDelete` return value(s) have been changed from `(*armruntime.Poller[ImagesClientDeleteResponse], error)` to `(*runtime.Poller[ImagesClientDeleteResponse], error)` -- Function `*ImagesClient.BeginUpdate` return value(s) have been changed from `(*armruntime.Poller[ImagesClientUpdateResponse], error)` to `(*runtime.Poller[ImagesClientUpdateResponse], error)` -- Function `*VirtualMachineScaleSetVMRunCommandsClient.BeginCreateOrUpdate` return value(s) have been changed from `(*armruntime.Poller[VirtualMachineScaleSetVMRunCommandsClientCreateOrUpdateResponse], error)` to `(*runtime.Poller[VirtualMachineScaleSetVMRunCommandsClientCreateOrUpdateResponse], error)` -- Function `*VirtualMachinesClient.BeginReapply` return value(s) have been changed from `(*armruntime.Poller[VirtualMachinesClientReapplyResponse], error)` to `(*runtime.Poller[VirtualMachinesClientReapplyResponse], error)` -- Function `*DiskRestorePointClient.BeginGrantAccess` return value(s) have been changed from `(*armruntime.Poller[DiskRestorePointClientGrantAccessResponse], error)` to `(*runtime.Poller[DiskRestorePointClientGrantAccessResponse], error)` -- Function `*VirtualMachineRunCommandsClient.BeginDelete` return value(s) have been changed from `(*armruntime.Poller[VirtualMachineRunCommandsClientDeleteResponse], error)` to `(*runtime.Poller[VirtualMachineRunCommandsClientDeleteResponse], error)` -- Function `*CloudServicesClient.BeginRebuild` return value(s) have been changed from `(*armruntime.Poller[CloudServicesClientRebuildResponse], error)` to `(*runtime.Poller[CloudServicesClientRebuildResponse], error)` -- Function `*VirtualMachinesClient.BeginAssessPatches` return value(s) have been changed from `(*armruntime.Poller[VirtualMachinesClientAssessPatchesResponse], error)` to `(*runtime.Poller[VirtualMachinesClientAssessPatchesResponse], error)` -- Function `*VirtualMachineScaleSetsClient.BeginPerformMaintenance` return value(s) have been changed from `(*armruntime.Poller[VirtualMachineScaleSetsClientPerformMaintenanceResponse], error)` to `(*runtime.Poller[VirtualMachineScaleSetsClientPerformMaintenanceResponse], error)` -- Function `*VirtualMachinesClient.BeginRedeploy` return value(s) have been changed from `(*armruntime.Poller[VirtualMachinesClientRedeployResponse], error)` to `(*runtime.Poller[VirtualMachinesClientRedeployResponse], error)` -- Function `*SnapshotsClient.BeginUpdate` return value(s) have been changed from `(*armruntime.Poller[SnapshotsClientUpdateResponse], error)` to `(*runtime.Poller[SnapshotsClientUpdateResponse], error)` -- Function `*SnapshotsClient.BeginCreateOrUpdate` return value(s) have been changed from `(*armruntime.Poller[SnapshotsClientCreateOrUpdateResponse], error)` to `(*runtime.Poller[SnapshotsClientCreateOrUpdateResponse], error)` -- Function `*VirtualMachinesClient.BeginInstallPatches` return value(s) have been changed from `(*armruntime.Poller[VirtualMachinesClientInstallPatchesResponse], error)` to `(*runtime.Poller[VirtualMachinesClientInstallPatchesResponse], error)` -- Function `*VirtualMachineScaleSetVMExtensionsClient.BeginUpdate` return value(s) have been changed from `(*armruntime.Poller[VirtualMachineScaleSetVMExtensionsClientUpdateResponse], error)` to `(*runtime.Poller[VirtualMachineScaleSetVMExtensionsClientUpdateResponse], error)` -- Function `*CloudServicesClient.BeginDeleteInstances` return value(s) have been changed from `(*armruntime.Poller[CloudServicesClientDeleteInstancesResponse], error)` to `(*runtime.Poller[CloudServicesClientDeleteInstancesResponse], error)` -- Function `*CloudServiceRoleInstancesClient.BeginRestart` return value(s) have been changed from `(*armruntime.Poller[CloudServiceRoleInstancesClientRestartResponse], error)` to `(*runtime.Poller[CloudServiceRoleInstancesClientRestartResponse], error)` -- Function `*VirtualMachineScaleSetVMsClient.BeginPowerOff` return value(s) have been changed from `(*armruntime.Poller[VirtualMachineScaleSetVMsClientPowerOffResponse], error)` to `(*runtime.Poller[VirtualMachineScaleSetVMsClientPowerOffResponse], error)` -- Function `*VirtualMachineExtensionsClient.BeginCreateOrUpdate` return value(s) have been changed from `(*armruntime.Poller[VirtualMachineExtensionsClientCreateOrUpdateResponse], error)` to `(*runtime.Poller[VirtualMachineExtensionsClientCreateOrUpdateResponse], error)` -- Function `*VirtualMachineScaleSetsClient.BeginDeleteInstances` return value(s) have been changed from `(*armruntime.Poller[VirtualMachineScaleSetsClientDeleteInstancesResponse], error)` to `(*runtime.Poller[VirtualMachineScaleSetsClientDeleteInstancesResponse], error)` -- Function `*GalleryApplicationsClient.BeginUpdate` return value(s) have been changed from `(*armruntime.Poller[GalleryApplicationsClientUpdateResponse], error)` to `(*runtime.Poller[GalleryApplicationsClientUpdateResponse], error)` -- Function `*VirtualMachineScaleSetsClient.BeginUpdateInstances` return value(s) have been changed from `(*armruntime.Poller[VirtualMachineScaleSetsClientUpdateInstancesResponse], error)` to `(*runtime.Poller[VirtualMachineScaleSetsClientUpdateInstancesResponse], error)` -- Function `*CloudServiceRoleInstancesClient.BeginReimage` return value(s) have been changed from `(*armruntime.Poller[CloudServiceRoleInstancesClientReimageResponse], error)` to `(*runtime.Poller[CloudServiceRoleInstancesClientReimageResponse], error)` -- Function `*LogAnalyticsClient.BeginExportRequestRateByInterval` return value(s) have been changed from `(*armruntime.Poller[LogAnalyticsClientExportRequestRateByIntervalResponse], error)` to `(*runtime.Poller[LogAnalyticsClientExportRequestRateByIntervalResponse], error)` -- Function `*VirtualMachineScaleSetsClient.BeginPowerOff` return value(s) have been changed from `(*armruntime.Poller[VirtualMachineScaleSetsClientPowerOffResponse], error)` to `(*runtime.Poller[VirtualMachineScaleSetsClientPowerOffResponse], error)` -- Function `*VirtualMachineScaleSetVMsClient.BeginPerformMaintenance` return value(s) have been changed from `(*armruntime.Poller[VirtualMachineScaleSetVMsClientPerformMaintenanceResponse], error)` to `(*runtime.Poller[VirtualMachineScaleSetVMsClientPerformMaintenanceResponse], error)` -- Function `*DiskRestorePointClient.BeginRevokeAccess` return value(s) have been changed from `(*armruntime.Poller[DiskRestorePointClientRevokeAccessResponse], error)` to `(*runtime.Poller[DiskRestorePointClientRevokeAccessResponse], error)` -- Function `*VirtualMachineScaleSetsClient.BeginSetOrchestrationServiceState` return value(s) have been changed from `(*armruntime.Poller[VirtualMachineScaleSetsClientSetOrchestrationServiceStateResponse], error)` to `(*runtime.Poller[VirtualMachineScaleSetsClientSetOrchestrationServiceStateResponse], error)` -- Function `*VirtualMachineScaleSetExtensionsClient.BeginDelete` return value(s) have been changed from `(*armruntime.Poller[VirtualMachineScaleSetExtensionsClientDeleteResponse], error)` to `(*runtime.Poller[VirtualMachineScaleSetExtensionsClientDeleteResponse], error)` -- Function `*VirtualMachineScaleSetExtensionsClient.BeginCreateOrUpdate` return value(s) have been changed from `(*armruntime.Poller[VirtualMachineScaleSetExtensionsClientCreateOrUpdateResponse], error)` to `(*runtime.Poller[VirtualMachineScaleSetExtensionsClientCreateOrUpdateResponse], error)` -- Function `*SnapshotsClient.BeginDelete` return value(s) have been changed from `(*armruntime.Poller[SnapshotsClientDeleteResponse], error)` to `(*runtime.Poller[SnapshotsClientDeleteResponse], error)` -- Function `*GallerySharingProfileClient.BeginUpdate` return value(s) have been changed from `(*armruntime.Poller[GallerySharingProfileClientUpdateResponse], error)` to `(*runtime.Poller[GallerySharingProfileClientUpdateResponse], error)` -- Function `*GalleryApplicationsClient.BeginDelete` return value(s) have been changed from `(*armruntime.Poller[GalleryApplicationsClientDeleteResponse], error)` to `(*runtime.Poller[GalleryApplicationsClientDeleteResponse], error)` -- Function `*DedicatedHostsClient.BeginCreateOrUpdate` return value(s) have been changed from `(*armruntime.Poller[DedicatedHostsClientCreateOrUpdateResponse], error)` to `(*runtime.Poller[DedicatedHostsClientCreateOrUpdateResponse], error)` -- Function `*VirtualMachineScaleSetExtensionsClient.BeginUpdate` return value(s) have been changed from `(*armruntime.Poller[VirtualMachineScaleSetExtensionsClientUpdateResponse], error)` to `(*runtime.Poller[VirtualMachineScaleSetExtensionsClientUpdateResponse], error)` -- Function `*DiskEncryptionSetsClient.BeginCreateOrUpdate` return value(s) have been changed from `(*armruntime.Poller[DiskEncryptionSetsClientCreateOrUpdateResponse], error)` to `(*runtime.Poller[DiskEncryptionSetsClientCreateOrUpdateResponse], error)` -- Function `*VirtualMachinesClient.BeginRestart` return value(s) have been changed from `(*armruntime.Poller[VirtualMachinesClientRestartResponse], error)` to `(*runtime.Poller[VirtualMachinesClientRestartResponse], error)` -- Function `*VirtualMachineScaleSetRollingUpgradesClient.BeginStartOSUpgrade` return value(s) have been changed from `(*armruntime.Poller[VirtualMachineScaleSetRollingUpgradesClientStartOSUpgradeResponse], error)` to `(*runtime.Poller[VirtualMachineScaleSetRollingUpgradesClientStartOSUpgradeResponse], error)` -- Function `*CloudServicesClient.BeginStart` return value(s) have been changed from `(*armruntime.Poller[CloudServicesClientStartResponse], error)` to `(*runtime.Poller[CloudServicesClientStartResponse], error)` -- Function `*VirtualMachineScaleSetRollingUpgradesClient.BeginCancel` return value(s) have been changed from `(*armruntime.Poller[VirtualMachineScaleSetRollingUpgradesClientCancelResponse], error)` to `(*runtime.Poller[VirtualMachineScaleSetRollingUpgradesClientCancelResponse], error)` -- Function `*DedicatedHostsClient.BeginDelete` return value(s) have been changed from `(*armruntime.Poller[DedicatedHostsClientDeleteResponse], error)` to `(*runtime.Poller[DedicatedHostsClientDeleteResponse], error)` -- Function `*VirtualMachineScaleSetVMsClient.BeginUpdate` return value(s) have been changed from `(*armruntime.Poller[VirtualMachineScaleSetVMsClientUpdateResponse], error)` to `(*runtime.Poller[VirtualMachineScaleSetVMsClientUpdateResponse], error)` -- Function `*CloudServiceRoleInstancesClient.BeginDelete` return value(s) have been changed from `(*armruntime.Poller[CloudServiceRoleInstancesClientDeleteResponse], error)` to `(*runtime.Poller[CloudServiceRoleInstancesClientDeleteResponse], error)` -- Function `*VirtualMachineScaleSetsClient.BeginStart` return value(s) have been changed from `(*armruntime.Poller[VirtualMachineScaleSetsClientStartResponse], error)` to `(*runtime.Poller[VirtualMachineScaleSetsClientStartResponse], error)` -- Type of `DiskRestorePointInstanceView.ReplicationStatus` has been changed from `interface{}` to `*DiskRestorePointReplicationStatus` -- Type of `DiskRestorePointReplicationStatus.Status` has been changed from `interface{}` to `*InstanceViewStatus` -- Function `DedicatedHostGroupListResult.MarshalJSON` has been removed -- Function `ResourceSKURestrictions.MarshalJSON` has been removed -- Function `RunCommandListResult.MarshalJSON` has been removed -- Function `GalleryApplicationVersionList.MarshalJSON` has been removed -- Function `CommunityGalleryImageProperties.MarshalJSON` has been removed -- Function `VirtualMachineListResult.MarshalJSON` has been removed -- Function `VirtualMachineAssessPatchesResult.MarshalJSON` has been removed -- Function `VirtualMachineScaleSetListResult.MarshalJSON` has been removed -- Function `VirtualMachineExtensionsListResult.MarshalJSON` has been removed -- Function `GalleryImageList.MarshalJSON` has been removed -- Function `DiskRestorePointList.MarshalJSON` has been removed -- Function `VirtualMachineRunCommandsListResult.MarshalJSON` has been removed -- Function `DiskRestorePointProperties.MarshalJSON` has been removed -- Function `VirtualMachineScaleSetInstanceView.MarshalJSON` has been removed -- Function `ResourceSKUZoneDetails.MarshalJSON` has been removed -- Function `VirtualMachineSoftwarePatchProperties.MarshalJSON` has been removed -- Function `RoleInstance.MarshalJSON` has been removed -- Function `GalleryApplicationList.MarshalJSON` has been removed -- Function `GalleryList.MarshalJSON` has been removed -- Function `AvailabilitySetListResult.MarshalJSON` has been removed -- Function `DiskEncryptionSetList.MarshalJSON` has been removed -- Function `PrivateLinkResourceProperties.MarshalJSON` has been removed -- Function `RoleInstanceView.MarshalJSON` has been removed -- Function `RoleInstanceListResult.MarshalJSON` has been removed -- Function `SharedGalleryImageVersionProperties.MarshalJSON` has been removed -- Function `VirtualMachineSizeListResult.MarshalJSON` has been removed -- Function `ResourceSKUsResult.MarshalJSON` has been removed -- Function `SnapshotList.MarshalJSON` has been removed -- Function `RoleInstanceNetworkProfile.MarshalJSON` has been removed -- Function `ResourceSKURestrictionInfo.MarshalJSON` has been removed -- Function `VirtualMachineInstallPatchesResult.MarshalJSON` has been removed -- Function `SharedGalleryImageProperties.MarshalJSON` has been removed -- Function `CommunityGalleryImageVersionProperties.MarshalJSON` has been removed -- Function `VirtualMachineScaleSetVMListResult.MarshalJSON` has been removed -- Function `SharedGalleryImageVersionList.MarshalJSON` has been removed -- Function `ResourceURIList.MarshalJSON` has been removed -- Function `OSVersionListResult.MarshalJSON` has been removed -- Function `ResourceInstanceViewStatus.MarshalJSON` has been removed -- Function `RunCommandResult.MarshalJSON` has been removed -- Function `VirtualMachineScaleSetListOSUpgradeHistory.MarshalJSON` has been removed -- Function `VirtualMachineScaleSetListWithLinkResult.MarshalJSON` has been removed -- Function `PatchInstallationDetail.MarshalJSON` has been removed -- Function `UpgradeOperationHistoryStatus.MarshalJSON` has been removed -- Function `VirtualMachineScaleSetListSKUsResult.MarshalJSON` has been removed -- Function `CloudServiceInstanceView.MarshalJSON` has been removed -- Function `DedicatedHostListResult.MarshalJSON` has been removed -- Function `RestorePointCollectionListResult.MarshalJSON` has been removed -- Function `VirtualMachineScaleSetVMExtensionsSummary.MarshalJSON` has been removed -- Function `PrivateLinkResourceListResult.MarshalJSON` has been removed -- Function `SharedGalleryImageList.MarshalJSON` has been removed -- Function `OSFamilyProperties.MarshalJSON` has been removed -- Function `CapacityReservationGroupListResult.MarshalJSON` has been removed -- Function `ProximityPlacementGroupListResult.MarshalJSON` has been removed -- Function `PrivateEndpointConnectionListResult.MarshalJSON` has been removed -- Function `ResourceSKU.MarshalJSON` has been removed -- Function `OperationListResult.MarshalJSON` has been removed -- Function `CapacityReservationListResult.MarshalJSON` has been removed -- Function `OSFamilyListResult.MarshalJSON` has been removed -- Function `VirtualMachineScaleSetInstanceViewStatusesSummary.MarshalJSON` has been removed -- Function `VirtualMachineScaleSetExtensionListResult.MarshalJSON` has been removed -- Function `InstanceViewStatusesSummary.MarshalJSON` has been removed -- Function `CloudServiceRoleListResult.MarshalJSON` has been removed -- Function `ResourceSKULocationInfo.MarshalJSON` has been removed -- Function `CloudServiceListResult.MarshalJSON` has been removed -- Function `RunCommandDocument.MarshalJSON` has been removed -- Function `ListUsagesResult.MarshalJSON` has been removed -- Function `GalleryImageVersionList.MarshalJSON` has been removed -- Function `ImageListResult.MarshalJSON` has been removed -- Function `DiskList.MarshalJSON` has been removed -- Function `VirtualMachineScaleSetVMExtensionsListResult.MarshalJSON` has been removed -- Function `CommunityGalleryInfo.MarshalJSON` has been removed -- Function `DiskAccessList.MarshalJSON` has been removed -- Function `SharedGalleryList.MarshalJSON` has been removed -- Function `UpdateDomainListResult.MarshalJSON` has been removed -- Function `SSHPublicKeysGroupListResult.MarshalJSON` has been removed - -### Features Added - -- New const `LinuxVMGuestPatchAutomaticByPlatformRebootSettingUnknown` -- New const `LinuxVMGuestPatchAutomaticByPlatformRebootSettingNever` -- New const `WindowsVMGuestPatchAutomaticByPlatformRebootSettingIfRequired` -- New const `LinuxVMGuestPatchAutomaticByPlatformRebootSettingIfRequired` -- New const `WindowsVMGuestPatchAutomaticByPlatformRebootSettingNever` -- New const `LinuxVMGuestPatchAutomaticByPlatformRebootSettingAlways` -- New const `StorageAccountTypesPremiumV2LRS` -- New const `WindowsVMGuestPatchAutomaticByPlatformRebootSettingUnknown` -- New const `WindowsVMGuestPatchAutomaticByPlatformRebootSettingAlways` -- New function `ProximityPlacementGroupPropertiesIntent.MarshalJSON() ([]byte, error)` -- New function `PossibleLinuxVMGuestPatchAutomaticByPlatformRebootSettingValues() []LinuxVMGuestPatchAutomaticByPlatformRebootSetting` -- New function `PossibleWindowsVMGuestPatchAutomaticByPlatformRebootSettingValues() []WindowsVMGuestPatchAutomaticByPlatformRebootSetting` -- New function `ResourceWithOptionalLocation.MarshalJSON() ([]byte, error)` -- New struct `DedicatedHostGroupPropertiesAdditionalCapabilities` -- New struct `LinuxVMGuestPatchAutomaticByPlatformSettings` -- New struct `ProximityPlacementGroupPropertiesIntent` -- New struct `ResourceWithOptionalLocation` -- New struct `WindowsVMGuestPatchAutomaticByPlatformSettings` -- New field `Zones` in struct `ProximityPlacementGroup` -- New field `Intent` in struct `ProximityPlacementGroupProperties` -- New field `AutomaticByPlatformSettings` in struct `LinuxPatchSettings` -- New field `AdditionalCapabilities` in struct `DedicatedHostGroupProperties` -- New field `DeleteOption` in struct `VirtualMachineScaleSetDataDisk` -- New field `DeleteOption` in struct `VirtualMachineScaleSetOSDisk` -- New field `DeleteOption` in struct `VirtualMachineScaleSetUpdateOSDisk` -- New field `AutomaticByPlatformSettings` in struct `PatchSettings` -- New field `UseRollingUpgradePolicy` in struct `AutomaticOSUpgradePolicy` -- New field `Identity` in struct `VirtualMachineScaleSetVM` -- New field `TreatFailureAsDeploymentFailure` in struct `VMGalleryApplication` -- New field `EnableAutomaticUpgrade` in struct `VMGalleryApplication` -- New field `CompletionPercent` in struct `DiskRestorePointReplicationStatus` - - -## 0.7.0 (2022-04-15) -### Breaking Changes - -- Function `*DisksClient.ListByResourceGroup` has been removed -- Function `*VirtualMachinesClient.ListByLocation` has been removed -- Function `*VirtualMachinesClient.ListAvailableSizes` has been removed -- Function `*DiskAccessesClient.ListPrivateEndpointConnections` has been removed -- Function `*RestorePointCollectionsClient.ListAll` has been removed -- Function `*VirtualMachineScaleSetsClient.List` has been removed -- Function `*SharedGalleryImagesClient.List` has been removed -- Function `*CloudServicesUpdateDomainClient.ListUpdateDomains` has been removed -- Function `*SharedGalleriesClient.List` has been removed -- Function `*VirtualMachineScaleSetExtensionsClient.List` has been removed -- Function `*DiskEncryptionSetsClient.ListByResourceGroup` has been removed -- Function `*VirtualMachineScaleSetsClient.ListAll` has been removed -- Function `*ProximityPlacementGroupsClient.ListBySubscription` has been removed -- Function `*DiskEncryptionSetsClient.ListAssociatedResources` has been removed -- Function `*CloudServiceOperatingSystemsClient.ListOSVersions` has been removed -- Function `*GalleriesClient.ListByResourceGroup` has been removed -- Function `*UsageClient.List` has been removed -- Function `*GalleryImagesClient.ListByGallery` has been removed -- Function `*GalleriesClient.List` has been removed -- Function `*CloudServicesClient.List` has been removed -- Function `*SSHPublicKeysClient.ListByResourceGroup` has been removed -- Function `*RestorePointCollectionsClient.List` has been removed -- Function `*VirtualMachineRunCommandsClient.ListByVirtualMachine` has been removed -- Function `*SnapshotsClient.ListByResourceGroup` has been removed -- Function `*DiskEncryptionSetsClient.List` has been removed -- Function `*ResourceSKUsClient.List` has been removed -- Function `*CloudServiceRolesClient.List` has been removed -- Function `*DisksClient.List` has been removed -- Function `*DiskRestorePointClient.ListByRestorePoint` has been removed -- Function `*ProximityPlacementGroupsClient.ListByResourceGroup` has been removed -- Function `*CloudServiceOperatingSystemsClient.ListOSFamilies` has been removed -- Function `*VirtualMachinesClient.ListAll` has been removed -- Function `*VirtualMachineRunCommandsClient.List` has been removed -- Function `*DiskAccessesClient.List` has been removed -- Function `*GalleryApplicationVersionsClient.ListByGalleryApplication` has been removed -- Function `*AvailabilitySetsClient.List` has been removed -- Function `*AvailabilitySetsClient.ListBySubscription` has been removed -- Function `*DedicatedHostGroupsClient.ListByResourceGroup` has been removed -- Function `*VirtualMachinesClient.List` has been removed -- Function `*CloudServicesClient.ListAll` has been removed -- Function `*DedicatedHostsClient.ListByHostGroup` has been removed -- Function `*ImagesClient.ListByResourceGroup` has been removed -- Function `*VirtualMachineScaleSetsClient.ListByLocation` has been removed -- Function `*CapacityReservationsClient.ListByCapacityReservationGroup` has been removed -- Function `*AvailabilitySetsClient.ListAvailableSizes` has been removed -- Function `*CloudServiceRoleInstancesClient.List` has been removed -- Function `*DiskAccessesClient.ListByResourceGroup` has been removed -- Function `*SharedGalleryImageVersionsClient.List` has been removed -- Function `*GalleryImageVersionsClient.ListByGalleryImage` has been removed -- Function `*VirtualMachineScaleSetVMRunCommandsClient.List` has been removed -- Function `*SSHPublicKeysClient.ListBySubscription` has been removed -- Function `*GalleryApplicationsClient.ListByGallery` has been removed -- Function `*OperationsClient.List` has been removed -- Function `*CapacityReservationGroupsClient.ListBySubscription` has been removed -- Function `*CapacityReservationGroupsClient.ListByResourceGroup` has been removed -- Function `*ImagesClient.List` has been removed -- Function `*VirtualMachineSizesClient.List` has been removed -- Function `*DedicatedHostGroupsClient.ListBySubscription` has been removed -- Function `*SnapshotsClient.List` has been removed -- Function `*VirtualMachineScaleSetVMsClient.List` has been removed -- Function `*VirtualMachineScaleSetsClient.GetOSUpgradeHistory` has been removed -- Function `*VirtualMachineScaleSetsClient.ListSKUs` has been removed - -### Features Added - -- New function `*SharedGalleriesClient.NewListPager(string, *SharedGalleriesClientListOptions) *runtime.Pager[SharedGalleriesClientListResponse]` -- New function `*VirtualMachinesClient.NewListAvailableSizesPager(string, string, *VirtualMachinesClientListAvailableSizesOptions) *runtime.Pager[VirtualMachinesClientListAvailableSizesResponse]` -- New function `*VirtualMachineScaleSetsClient.NewListByLocationPager(string, *VirtualMachineScaleSetsClientListByLocationOptions) *runtime.Pager[VirtualMachineScaleSetsClientListByLocationResponse]` -- New function `*VirtualMachineScaleSetsClient.NewListAllPager(*VirtualMachineScaleSetsClientListAllOptions) *runtime.Pager[VirtualMachineScaleSetsClientListAllResponse]` -- New function `*VirtualMachineScaleSetsClient.NewListPager(string, *VirtualMachineScaleSetsClientListOptions) *runtime.Pager[VirtualMachineScaleSetsClientListResponse]` -- New function `*GalleryApplicationVersionsClient.NewListByGalleryApplicationPager(string, string, string, *GalleryApplicationVersionsClientListByGalleryApplicationOptions) *runtime.Pager[GalleryApplicationVersionsClientListByGalleryApplicationResponse]` -- New function `*GalleryImagesClient.NewListByGalleryPager(string, string, *GalleryImagesClientListByGalleryOptions) *runtime.Pager[GalleryImagesClientListByGalleryResponse]` -- New function `*ProximityPlacementGroupsClient.NewListBySubscriptionPager(*ProximityPlacementGroupsClientListBySubscriptionOptions) *runtime.Pager[ProximityPlacementGroupsClientListBySubscriptionResponse]` -- New function `*DiskAccessesClient.NewListPager(*DiskAccessesClientListOptions) *runtime.Pager[DiskAccessesClientListResponse]` -- New function `*SSHPublicKeysClient.NewListBySubscriptionPager(*SSHPublicKeysClientListBySubscriptionOptions) *runtime.Pager[SSHPublicKeysClientListBySubscriptionResponse]` -- New function `*DiskRestorePointClient.NewListByRestorePointPager(string, string, string, *DiskRestorePointClientListByRestorePointOptions) *runtime.Pager[DiskRestorePointClientListByRestorePointResponse]` -- New function `*CloudServicesClient.NewListAllPager(*CloudServicesClientListAllOptions) *runtime.Pager[CloudServicesClientListAllResponse]` -- New function `*DedicatedHostsClient.NewListByHostGroupPager(string, string, *DedicatedHostsClientListByHostGroupOptions) *runtime.Pager[DedicatedHostsClientListByHostGroupResponse]` -- New function `*VirtualMachinesClient.NewListByLocationPager(string, *VirtualMachinesClientListByLocationOptions) *runtime.Pager[VirtualMachinesClientListByLocationResponse]` -- New function `*GalleryApplicationsClient.NewListByGalleryPager(string, string, *GalleryApplicationsClientListByGalleryOptions) *runtime.Pager[GalleryApplicationsClientListByGalleryResponse]` -- New function `*VirtualMachineScaleSetExtensionsClient.NewListPager(string, string, *VirtualMachineScaleSetExtensionsClientListOptions) *runtime.Pager[VirtualMachineScaleSetExtensionsClientListResponse]` -- New function `*VirtualMachineSizesClient.NewListPager(string, *VirtualMachineSizesClientListOptions) *runtime.Pager[VirtualMachineSizesClientListResponse]` -- New function `*SharedGalleryImageVersionsClient.NewListPager(string, string, string, *SharedGalleryImageVersionsClientListOptions) *runtime.Pager[SharedGalleryImageVersionsClientListResponse]` -- New function `*ImagesClient.NewListByResourceGroupPager(string, *ImagesClientListByResourceGroupOptions) *runtime.Pager[ImagesClientListByResourceGroupResponse]` -- New function `*VirtualMachineRunCommandsClient.NewListPager(string, *VirtualMachineRunCommandsClientListOptions) *runtime.Pager[VirtualMachineRunCommandsClientListResponse]` -- New function `*DisksClient.NewListPager(*DisksClientListOptions) *runtime.Pager[DisksClientListResponse]` -- New function `*VirtualMachineScaleSetVMsClient.NewListPager(string, string, *VirtualMachineScaleSetVMsClientListOptions) *runtime.Pager[VirtualMachineScaleSetVMsClientListResponse]` -- New function `*CloudServiceRoleInstancesClient.NewListPager(string, string, *CloudServiceRoleInstancesClientListOptions) *runtime.Pager[CloudServiceRoleInstancesClientListResponse]` -- New function `*SnapshotsClient.NewListPager(*SnapshotsClientListOptions) *runtime.Pager[SnapshotsClientListResponse]` -- New function `*ImagesClient.NewListPager(*ImagesClientListOptions) *runtime.Pager[ImagesClientListResponse]` -- New function `*DiskAccessesClient.NewListByResourceGroupPager(string, *DiskAccessesClientListByResourceGroupOptions) *runtime.Pager[DiskAccessesClientListByResourceGroupResponse]` -- New function `*ResourceSKUsClient.NewListPager(*ResourceSKUsClientListOptions) *runtime.Pager[ResourceSKUsClientListResponse]` -- New function `*DisksClient.NewListByResourceGroupPager(string, *DisksClientListByResourceGroupOptions) *runtime.Pager[DisksClientListByResourceGroupResponse]` -- New function `*CloudServicesClient.NewListPager(string, *CloudServicesClientListOptions) *runtime.Pager[CloudServicesClientListResponse]` -- New function `*AvailabilitySetsClient.NewListAvailableSizesPager(string, string, *AvailabilitySetsClientListAvailableSizesOptions) *runtime.Pager[AvailabilitySetsClientListAvailableSizesResponse]` -- New function `*CloudServicesUpdateDomainClient.NewListUpdateDomainsPager(string, string, *CloudServicesUpdateDomainClientListUpdateDomainsOptions) *runtime.Pager[CloudServicesUpdateDomainClientListUpdateDomainsResponse]` -- New function `*ProximityPlacementGroupsClient.NewListByResourceGroupPager(string, *ProximityPlacementGroupsClientListByResourceGroupOptions) *runtime.Pager[ProximityPlacementGroupsClientListByResourceGroupResponse]` -- New function `*DiskEncryptionSetsClient.NewListPager(*DiskEncryptionSetsClientListOptions) *runtime.Pager[DiskEncryptionSetsClientListResponse]` -- New function `*OperationsClient.NewListPager(*OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse]` -- New function `*SnapshotsClient.NewListByResourceGroupPager(string, *SnapshotsClientListByResourceGroupOptions) *runtime.Pager[SnapshotsClientListByResourceGroupResponse]` -- New function `*DedicatedHostGroupsClient.NewListBySubscriptionPager(*DedicatedHostGroupsClientListBySubscriptionOptions) *runtime.Pager[DedicatedHostGroupsClientListBySubscriptionResponse]` -- New function `*CapacityReservationsClient.NewListByCapacityReservationGroupPager(string, string, *CapacityReservationsClientListByCapacityReservationGroupOptions) *runtime.Pager[CapacityReservationsClientListByCapacityReservationGroupResponse]` -- New function `*CapacityReservationGroupsClient.NewListByResourceGroupPager(string, *CapacityReservationGroupsClientListByResourceGroupOptions) *runtime.Pager[CapacityReservationGroupsClientListByResourceGroupResponse]` -- New function `*CloudServiceOperatingSystemsClient.NewListOSVersionsPager(string, *CloudServiceOperatingSystemsClientListOSVersionsOptions) *runtime.Pager[CloudServiceOperatingSystemsClientListOSVersionsResponse]` -- New function `*VirtualMachineScaleSetsClient.NewGetOSUpgradeHistoryPager(string, string, *VirtualMachineScaleSetsClientGetOSUpgradeHistoryOptions) *runtime.Pager[VirtualMachineScaleSetsClientGetOSUpgradeHistoryResponse]` -- New function `*GalleriesClient.NewListByResourceGroupPager(string, *GalleriesClientListByResourceGroupOptions) *runtime.Pager[GalleriesClientListByResourceGroupResponse]` -- New function `*CloudServiceRolesClient.NewListPager(string, string, *CloudServiceRolesClientListOptions) *runtime.Pager[CloudServiceRolesClientListResponse]` -- New function `*VirtualMachinesClient.NewListPager(string, *VirtualMachinesClientListOptions) *runtime.Pager[VirtualMachinesClientListResponse]` -- New function `*DedicatedHostGroupsClient.NewListByResourceGroupPager(string, *DedicatedHostGroupsClientListByResourceGroupOptions) *runtime.Pager[DedicatedHostGroupsClientListByResourceGroupResponse]` -- New function `*RestorePointCollectionsClient.NewListPager(string, *RestorePointCollectionsClientListOptions) *runtime.Pager[RestorePointCollectionsClientListResponse]` -- New function `*AvailabilitySetsClient.NewListBySubscriptionPager(*AvailabilitySetsClientListBySubscriptionOptions) *runtime.Pager[AvailabilitySetsClientListBySubscriptionResponse]` -- New function `*CapacityReservationGroupsClient.NewListBySubscriptionPager(*CapacityReservationGroupsClientListBySubscriptionOptions) *runtime.Pager[CapacityReservationGroupsClientListBySubscriptionResponse]` -- New function `*RestorePointCollectionsClient.NewListAllPager(*RestorePointCollectionsClientListAllOptions) *runtime.Pager[RestorePointCollectionsClientListAllResponse]` -- New function `*CloudServiceOperatingSystemsClient.NewListOSFamiliesPager(string, *CloudServiceOperatingSystemsClientListOSFamiliesOptions) *runtime.Pager[CloudServiceOperatingSystemsClientListOSFamiliesResponse]` -- New function `*SharedGalleryImagesClient.NewListPager(string, string, *SharedGalleryImagesClientListOptions) *runtime.Pager[SharedGalleryImagesClientListResponse]` -- New function `*GalleriesClient.NewListPager(*GalleriesClientListOptions) *runtime.Pager[GalleriesClientListResponse]` -- New function `*VirtualMachinesClient.NewListAllPager(*VirtualMachinesClientListAllOptions) *runtime.Pager[VirtualMachinesClientListAllResponse]` -- New function `*SSHPublicKeysClient.NewListByResourceGroupPager(string, *SSHPublicKeysClientListByResourceGroupOptions) *runtime.Pager[SSHPublicKeysClientListByResourceGroupResponse]` -- New function `*VirtualMachineScaleSetsClient.NewListSKUsPager(string, string, *VirtualMachineScaleSetsClientListSKUsOptions) *runtime.Pager[VirtualMachineScaleSetsClientListSKUsResponse]` -- New function `*DiskAccessesClient.NewListPrivateEndpointConnectionsPager(string, string, *DiskAccessesClientListPrivateEndpointConnectionsOptions) *runtime.Pager[DiskAccessesClientListPrivateEndpointConnectionsResponse]` -- New function `*VirtualMachineRunCommandsClient.NewListByVirtualMachinePager(string, string, *VirtualMachineRunCommandsClientListByVirtualMachineOptions) *runtime.Pager[VirtualMachineRunCommandsClientListByVirtualMachineResponse]` -- New function `*VirtualMachineScaleSetVMRunCommandsClient.NewListPager(string, string, string, *VirtualMachineScaleSetVMRunCommandsClientListOptions) *runtime.Pager[VirtualMachineScaleSetVMRunCommandsClientListResponse]` -- New function `*DiskEncryptionSetsClient.NewListByResourceGroupPager(string, *DiskEncryptionSetsClientListByResourceGroupOptions) *runtime.Pager[DiskEncryptionSetsClientListByResourceGroupResponse]` -- New function `*UsageClient.NewListPager(string, *UsageClientListOptions) *runtime.Pager[UsageClientListResponse]` -- New function `*DiskEncryptionSetsClient.NewListAssociatedResourcesPager(string, string, *DiskEncryptionSetsClientListAssociatedResourcesOptions) *runtime.Pager[DiskEncryptionSetsClientListAssociatedResourcesResponse]` -- New function `*GalleryImageVersionsClient.NewListByGalleryImagePager(string, string, string, *GalleryImageVersionsClientListByGalleryImageOptions) *runtime.Pager[GalleryImageVersionsClientListByGalleryImageResponse]` -- New function `*AvailabilitySetsClient.NewListPager(string, *AvailabilitySetsClientListOptions) *runtime.Pager[AvailabilitySetsClientListResponse]` - - -## 0.6.0 (2022-04-13) -### Breaking Changes - -- Function `*GalleryImagesClient.ListByGallery` return value(s) have been changed from `(*GalleryImagesClientListByGalleryPager)` to `(*runtime.Pager[GalleryImagesClientListByGalleryResponse])` -- Function `*CapacityReservationsClient.ListByCapacityReservationGroup` return value(s) have been changed from `(*CapacityReservationsClientListByCapacityReservationGroupPager)` to `(*runtime.Pager[CapacityReservationsClientListByCapacityReservationGroupResponse])` -- Function `NewVirtualMachineScaleSetsClient` return value(s) have been changed from `(*VirtualMachineScaleSetsClient)` to `(*VirtualMachineScaleSetsClient, error)` -- Function `*VirtualMachineScaleSetsClient.List` return value(s) have been changed from `(*VirtualMachineScaleSetsClientListPager)` to `(*runtime.Pager[VirtualMachineScaleSetsClientListResponse])` -- Function `*CapacityReservationsClient.BeginCreateOrUpdate` return value(s) have been changed from `(CapacityReservationsClientCreateOrUpdatePollerResponse, error)` to `(*armruntime.Poller[CapacityReservationsClientCreateOrUpdateResponse], error)` -- Function `*SharedGalleriesClient.List` return value(s) have been changed from `(*SharedGalleriesClientListPager)` to `(*runtime.Pager[SharedGalleriesClientListResponse])` -- Function `*VirtualMachinesClient.BeginDeallocate` return value(s) have been changed from `(VirtualMachinesClientDeallocatePollerResponse, error)` to `(*armruntime.Poller[VirtualMachinesClientDeallocateResponse], error)` -- Function `*LogAnalyticsClient.BeginExportThrottledRequests` return value(s) have been changed from `(LogAnalyticsClientExportThrottledRequestsPollerResponse, error)` to `(*armruntime.Poller[LogAnalyticsClientExportThrottledRequestsResponse], error)` -- Function `*VirtualMachineScaleSetsClient.BeginRestart` return value(s) have been changed from `(VirtualMachineScaleSetsClientRestartPollerResponse, error)` to `(*armruntime.Poller[VirtualMachineScaleSetsClientRestartResponse], error)` -- Function `*VirtualMachinesClient.BeginAssessPatches` return value(s) have been changed from `(VirtualMachinesClientAssessPatchesPollerResponse, error)` to `(*armruntime.Poller[VirtualMachinesClientAssessPatchesResponse], error)` -- Function `*RestorePointCollectionsClient.List` return value(s) have been changed from `(*RestorePointCollectionsClientListPager)` to `(*runtime.Pager[RestorePointCollectionsClientListResponse])` -- Function `*CloudServiceOperatingSystemsClient.ListOSVersions` return value(s) have been changed from `(*CloudServiceOperatingSystemsClientListOSVersionsPager)` to `(*runtime.Pager[CloudServiceOperatingSystemsClientListOSVersionsResponse])` -- Function `*VirtualMachineScaleSetsClient.ListAll` return value(s) have been changed from `(*VirtualMachineScaleSetsClientListAllPager)` to `(*runtime.Pager[VirtualMachineScaleSetsClientListAllResponse])` -- Function `NewDedicatedHostGroupsClient` return value(s) have been changed from `(*DedicatedHostGroupsClient)` to `(*DedicatedHostGroupsClient, error)` -- Function `*DisksClient.BeginCreateOrUpdate` return value(s) have been changed from `(DisksClientCreateOrUpdatePollerResponse, error)` to `(*armruntime.Poller[DisksClientCreateOrUpdateResponse], error)` -- Function `NewLogAnalyticsClient` return value(s) have been changed from `(*LogAnalyticsClient)` to `(*LogAnalyticsClient, error)` -- Function `*CloudServiceRoleInstancesClient.List` return value(s) have been changed from `(*CloudServiceRoleInstancesClientListPager)` to `(*runtime.Pager[CloudServiceRoleInstancesClientListResponse])` -- Function `*DiskEncryptionSetsClient.BeginDelete` return value(s) have been changed from `(DiskEncryptionSetsClientDeletePollerResponse, error)` to `(*armruntime.Poller[DiskEncryptionSetsClientDeleteResponse], error)` -- Function `*GalleryImageVersionsClient.ListByGalleryImage` return value(s) have been changed from `(*GalleryImageVersionsClientListByGalleryImagePager)` to `(*runtime.Pager[GalleryImageVersionsClientListByGalleryImageResponse])` -- Function `*DiskEncryptionSetsClient.BeginCreateOrUpdate` return value(s) have been changed from `(DiskEncryptionSetsClientCreateOrUpdatePollerResponse, error)` to `(*armruntime.Poller[DiskEncryptionSetsClientCreateOrUpdateResponse], error)` -- Function `*CloudServiceRoleInstancesClient.BeginDelete` return value(s) have been changed from `(CloudServiceRoleInstancesClientDeletePollerResponse, error)` to `(*armruntime.Poller[CloudServiceRoleInstancesClientDeleteResponse], error)` -- Function `*GalleryImageVersionsClient.BeginDelete` return value(s) have been changed from `(GalleryImageVersionsClientDeletePollerResponse, error)` to `(*armruntime.Poller[GalleryImageVersionsClientDeleteResponse], error)` -- Function `*VirtualMachinesClient.ListAvailableSizes` parameter(s) have been changed from `(context.Context, string, string, *VirtualMachinesClientListAvailableSizesOptions)` to `(string, string, *VirtualMachinesClientListAvailableSizesOptions)` -- Function `*VirtualMachinesClient.ListAvailableSizes` return value(s) have been changed from `(VirtualMachinesClientListAvailableSizesResponse, error)` to `(*runtime.Pager[VirtualMachinesClientListAvailableSizesResponse])` -- Function `*CloudServiceRolesClient.List` return value(s) have been changed from `(*CloudServiceRolesClientListPager)` to `(*runtime.Pager[CloudServiceRolesClientListResponse])` -- Function `*DedicatedHostGroupsClient.ListBySubscription` return value(s) have been changed from `(*DedicatedHostGroupsClientListBySubscriptionPager)` to `(*runtime.Pager[DedicatedHostGroupsClientListBySubscriptionResponse])` -- Function `*CloudServiceRoleInstancesClient.BeginRebuild` return value(s) have been changed from `(CloudServiceRoleInstancesClientRebuildPollerResponse, error)` to `(*armruntime.Poller[CloudServiceRoleInstancesClientRebuildResponse], error)` -- Function `NewSSHPublicKeysClient` return value(s) have been changed from `(*SSHPublicKeysClient)` to `(*SSHPublicKeysClient, error)` -- Function `*VirtualMachinesClient.BeginRedeploy` return value(s) have been changed from `(VirtualMachinesClientRedeployPollerResponse, error)` to `(*armruntime.Poller[VirtualMachinesClientRedeployResponse], error)` -- Function `*CloudServicesClient.BeginDelete` return value(s) have been changed from `(CloudServicesClientDeletePollerResponse, error)` to `(*armruntime.Poller[CloudServicesClientDeleteResponse], error)` -- Function `*AvailabilitySetsClient.ListAvailableSizes` parameter(s) have been changed from `(context.Context, string, string, *AvailabilitySetsClientListAvailableSizesOptions)` to `(string, string, *AvailabilitySetsClientListAvailableSizesOptions)` -- Function `*AvailabilitySetsClient.ListAvailableSizes` return value(s) have been changed from `(AvailabilitySetsClientListAvailableSizesResponse, error)` to `(*runtime.Pager[AvailabilitySetsClientListAvailableSizesResponse])` -- Function `*DiskAccessesClient.BeginDelete` return value(s) have been changed from `(DiskAccessesClientDeletePollerResponse, error)` to `(*armruntime.Poller[DiskAccessesClientDeleteResponse], error)` -- Function `*VirtualMachineScaleSetExtensionsClient.BeginCreateOrUpdate` return value(s) have been changed from `(VirtualMachineScaleSetExtensionsClientCreateOrUpdatePollerResponse, error)` to `(*armruntime.Poller[VirtualMachineScaleSetExtensionsClientCreateOrUpdateResponse], error)` -- Function `*CloudServicesClient.BeginStart` return value(s) have been changed from `(CloudServicesClientStartPollerResponse, error)` to `(*armruntime.Poller[CloudServicesClientStartResponse], error)` -- Function `NewGalleriesClient` return value(s) have been changed from `(*GalleriesClient)` to `(*GalleriesClient, error)` -- Function `NewCommunityGalleryImageVersionsClient` return value(s) have been changed from `(*CommunityGalleryImageVersionsClient)` to `(*CommunityGalleryImageVersionsClient, error)` -- Function `*RestorePointsClient.BeginCreate` return value(s) have been changed from `(RestorePointsClientCreatePollerResponse, error)` to `(*armruntime.Poller[RestorePointsClientCreateResponse], error)` -- Function `*GalleryImagesClient.BeginDelete` return value(s) have been changed from `(GalleryImagesClientDeletePollerResponse, error)` to `(*armruntime.Poller[GalleryImagesClientDeleteResponse], error)` -- Function `*VirtualMachinesClient.BeginRestart` return value(s) have been changed from `(VirtualMachinesClientRestartPollerResponse, error)` to `(*armruntime.Poller[VirtualMachinesClientRestartResponse], error)` -- Function `NewImagesClient` return value(s) have been changed from `(*ImagesClient)` to `(*ImagesClient, error)` -- Function `*VirtualMachineScaleSetRollingUpgradesClient.BeginStartExtensionUpgrade` return value(s) have been changed from `(VirtualMachineScaleSetRollingUpgradesClientStartExtensionUpgradePollerResponse, error)` to `(*armruntime.Poller[VirtualMachineScaleSetRollingUpgradesClientStartExtensionUpgradeResponse], error)` -- Function `*VirtualMachineScaleSetVMRunCommandsClient.BeginUpdate` return value(s) have been changed from `(VirtualMachineScaleSetVMRunCommandsClientUpdatePollerResponse, error)` to `(*armruntime.Poller[VirtualMachineScaleSetVMRunCommandsClientUpdateResponse], error)` -- Function `*VirtualMachinesClient.BeginReapply` return value(s) have been changed from `(VirtualMachinesClientReapplyPollerResponse, error)` to `(*armruntime.Poller[VirtualMachinesClientReapplyResponse], error)` -- Function `*VirtualMachineScaleSetsClient.ListByLocation` return value(s) have been changed from `(*VirtualMachineScaleSetsClientListByLocationPager)` to `(*runtime.Pager[VirtualMachineScaleSetsClientListByLocationResponse])` -- Function `*DiskRestorePointClient.BeginRevokeAccess` return value(s) have been changed from `(DiskRestorePointClientRevokeAccessPollerResponse, error)` to `(*armruntime.Poller[DiskRestorePointClientRevokeAccessResponse], error)` -- Function `NewCapacityReservationGroupsClient` return value(s) have been changed from `(*CapacityReservationGroupsClient)` to `(*CapacityReservationGroupsClient, error)` -- Function `*GalleryApplicationsClient.BeginUpdate` return value(s) have been changed from `(GalleryApplicationsClientUpdatePollerResponse, error)` to `(*armruntime.Poller[GalleryApplicationsClientUpdateResponse], error)` -- Function `NewUsageClient` return value(s) have been changed from `(*UsageClient)` to `(*UsageClient, error)` -- Function `*VirtualMachinesClient.BeginConvertToManagedDisks` return value(s) have been changed from `(VirtualMachinesClientConvertToManagedDisksPollerResponse, error)` to `(*armruntime.Poller[VirtualMachinesClientConvertToManagedDisksResponse], error)` -- Function `*SharedGalleryImagesClient.List` return value(s) have been changed from `(*SharedGalleryImagesClientListPager)` to `(*runtime.Pager[SharedGalleryImagesClientListResponse])` -- Function `*CapacityReservationGroupsClient.ListByResourceGroup` return value(s) have been changed from `(*CapacityReservationGroupsClientListByResourceGroupPager)` to `(*runtime.Pager[CapacityReservationGroupsClientListByResourceGroupResponse])` -- Function `*UsageClient.List` return value(s) have been changed from `(*UsageClientListPager)` to `(*runtime.Pager[UsageClientListResponse])` -- Function `NewSharedGalleryImagesClient` return value(s) have been changed from `(*SharedGalleryImagesClient)` to `(*SharedGalleryImagesClient, error)` -- Function `*DedicatedHostsClient.BeginUpdate` return value(s) have been changed from `(DedicatedHostsClientUpdatePollerResponse, error)` to `(*armruntime.Poller[DedicatedHostsClientUpdateResponse], error)` -- Function `*CloudServicesUpdateDomainClient.ListUpdateDomains` return value(s) have been changed from `(*CloudServicesUpdateDomainClientListUpdateDomainsPager)` to `(*runtime.Pager[CloudServicesUpdateDomainClientListUpdateDomainsResponse])` -- Function `*AvailabilitySetsClient.List` return value(s) have been changed from `(*AvailabilitySetsClientListPager)` to `(*runtime.Pager[AvailabilitySetsClientListResponse])` -- Function `*GalleryImageVersionsClient.BeginUpdate` return value(s) have been changed from `(GalleryImageVersionsClientUpdatePollerResponse, error)` to `(*armruntime.Poller[GalleryImageVersionsClientUpdateResponse], error)` -- Function `NewCloudServiceRolesClient` return value(s) have been changed from `(*CloudServiceRolesClient)` to `(*CloudServiceRolesClient, error)` -- Function `*DiskAccessesClient.BeginCreateOrUpdate` return value(s) have been changed from `(DiskAccessesClientCreateOrUpdatePollerResponse, error)` to `(*armruntime.Poller[DiskAccessesClientCreateOrUpdateResponse], error)` -- Function `NewVirtualMachinesClient` return value(s) have been changed from `(*VirtualMachinesClient)` to `(*VirtualMachinesClient, error)` -- Function `*RestorePointCollectionsClient.ListAll` return value(s) have been changed from `(*RestorePointCollectionsClientListAllPager)` to `(*runtime.Pager[RestorePointCollectionsClientListAllResponse])` -- Function `*VirtualMachineScaleSetsClient.BeginPowerOff` return value(s) have been changed from `(VirtualMachineScaleSetsClientPowerOffPollerResponse, error)` to `(*armruntime.Poller[VirtualMachineScaleSetsClientPowerOffResponse], error)` -- Function `NewDedicatedHostsClient` return value(s) have been changed from `(*DedicatedHostsClient)` to `(*DedicatedHostsClient, error)` -- Function `*VirtualMachineExtensionsClient.BeginDelete` return value(s) have been changed from `(VirtualMachineExtensionsClientDeletePollerResponse, error)` to `(*armruntime.Poller[VirtualMachineExtensionsClientDeleteResponse], error)` -- Function `NewVirtualMachineScaleSetExtensionsClient` return value(s) have been changed from `(*VirtualMachineScaleSetExtensionsClient)` to `(*VirtualMachineScaleSetExtensionsClient, error)` -- Function `*VirtualMachineRunCommandsClient.BeginUpdate` return value(s) have been changed from `(VirtualMachineRunCommandsClientUpdatePollerResponse, error)` to `(*armruntime.Poller[VirtualMachineRunCommandsClientUpdateResponse], error)` -- Function `*VirtualMachineScaleSetVMsClient.BeginRunCommand` return value(s) have been changed from `(VirtualMachineScaleSetVMsClientRunCommandPollerResponse, error)` to `(*armruntime.Poller[VirtualMachineScaleSetVMsClientRunCommandResponse], error)` -- Function `*DedicatedHostsClient.BeginRestart` return value(s) have been changed from `(DedicatedHostsClientRestartPollerResponse, error)` to `(*armruntime.Poller[DedicatedHostsClientRestartResponse], error)` -- Function `*VirtualMachineScaleSetVMRunCommandsClient.BeginCreateOrUpdate` return value(s) have been changed from `(VirtualMachineScaleSetVMRunCommandsClientCreateOrUpdatePollerResponse, error)` to `(*armruntime.Poller[VirtualMachineScaleSetVMRunCommandsClientCreateOrUpdateResponse], error)` -- Function `*GalleryApplicationVersionsClient.BeginUpdate` return value(s) have been changed from `(GalleryApplicationVersionsClientUpdatePollerResponse, error)` to `(*armruntime.Poller[GalleryApplicationVersionsClientUpdateResponse], error)` -- Function `NewDiskAccessesClient` return value(s) have been changed from `(*DiskAccessesClient)` to `(*DiskAccessesClient, error)` -- Function `NewGalleryApplicationVersionsClient` return value(s) have been changed from `(*GalleryApplicationVersionsClient)` to `(*GalleryApplicationVersionsClient, error)` -- Function `*DiskRestorePointClient.BeginGrantAccess` return value(s) have been changed from `(DiskRestorePointClientGrantAccessPollerResponse, error)` to `(*armruntime.Poller[DiskRestorePointClientGrantAccessResponse], error)` -- Function `*CloudServiceRoleInstancesClient.BeginRestart` return value(s) have been changed from `(CloudServiceRoleInstancesClientRestartPollerResponse, error)` to `(*armruntime.Poller[CloudServiceRoleInstancesClientRestartResponse], error)` -- Function `*VirtualMachineScaleSetVMsClient.BeginReimageAll` return value(s) have been changed from `(VirtualMachineScaleSetVMsClientReimageAllPollerResponse, error)` to `(*armruntime.Poller[VirtualMachineScaleSetVMsClientReimageAllResponse], error)` -- Function `*VirtualMachinesClient.BeginStart` return value(s) have been changed from `(VirtualMachinesClientStartPollerResponse, error)` to `(*armruntime.Poller[VirtualMachinesClientStartResponse], error)` -- Function `*VirtualMachineRunCommandsClient.BeginDelete` return value(s) have been changed from `(VirtualMachineRunCommandsClientDeletePollerResponse, error)` to `(*armruntime.Poller[VirtualMachineRunCommandsClientDeleteResponse], error)` -- Function `NewVirtualMachineScaleSetRollingUpgradesClient` return value(s) have been changed from `(*VirtualMachineScaleSetRollingUpgradesClient)` to `(*VirtualMachineScaleSetRollingUpgradesClient, error)` -- Function `*GallerySharingProfileClient.BeginUpdate` return value(s) have been changed from `(GallerySharingProfileClientUpdatePollerResponse, error)` to `(*armruntime.Poller[GallerySharingProfileClientUpdateResponse], error)` -- Function `NewCloudServiceRoleInstancesClient` return value(s) have been changed from `(*CloudServiceRoleInstancesClient)` to `(*CloudServiceRoleInstancesClient, error)` -- Function `NewSnapshotsClient` return value(s) have been changed from `(*SnapshotsClient)` to `(*SnapshotsClient, error)` -- Function `NewResourceSKUsClient` return value(s) have been changed from `(*ResourceSKUsClient)` to `(*ResourceSKUsClient, error)` -- Function `*VirtualMachineScaleSetVMExtensionsClient.BeginUpdate` return value(s) have been changed from `(VirtualMachineScaleSetVMExtensionsClientUpdatePollerResponse, error)` to `(*armruntime.Poller[VirtualMachineScaleSetVMExtensionsClientUpdateResponse], error)` -- Function `*VirtualMachineScaleSetsClient.BeginReimage` return value(s) have been changed from `(VirtualMachineScaleSetsClientReimagePollerResponse, error)` to `(*armruntime.Poller[VirtualMachineScaleSetsClientReimageResponse], error)` -- Function `*SnapshotsClient.BeginRevokeAccess` return value(s) have been changed from `(SnapshotsClientRevokeAccessPollerResponse, error)` to `(*armruntime.Poller[SnapshotsClientRevokeAccessResponse], error)` -- Function `*CloudServicesUpdateDomainClient.BeginWalkUpdateDomain` return value(s) have been changed from `(CloudServicesUpdateDomainClientWalkUpdateDomainPollerResponse, error)` to `(*armruntime.Poller[CloudServicesUpdateDomainClientWalkUpdateDomainResponse], error)` -- Function `*GalleryApplicationVersionsClient.BeginDelete` return value(s) have been changed from `(GalleryApplicationVersionsClientDeletePollerResponse, error)` to `(*armruntime.Poller[GalleryApplicationVersionsClientDeleteResponse], error)` -- Function `*DedicatedHostsClient.BeginDelete` return value(s) have been changed from `(DedicatedHostsClientDeletePollerResponse, error)` to `(*armruntime.Poller[DedicatedHostsClientDeleteResponse], error)` -- Function `*DiskEncryptionSetsClient.ListAssociatedResources` return value(s) have been changed from `(*DiskEncryptionSetsClientListAssociatedResourcesPager)` to `(*runtime.Pager[DiskEncryptionSetsClientListAssociatedResourcesResponse])` -- Function `*SSHPublicKeysClient.ListByResourceGroup` return value(s) have been changed from `(*SSHPublicKeysClientListByResourceGroupPager)` to `(*runtime.Pager[SSHPublicKeysClientListByResourceGroupResponse])` -- Function `*VirtualMachineScaleSetsClient.BeginReimageAll` return value(s) have been changed from `(VirtualMachineScaleSetsClientReimageAllPollerResponse, error)` to `(*armruntime.Poller[VirtualMachineScaleSetsClientReimageAllResponse], error)` -- Function `*VirtualMachinesClient.BeginInstallPatches` return value(s) have been changed from `(VirtualMachinesClientInstallPatchesPollerResponse, error)` to `(*armruntime.Poller[VirtualMachinesClientInstallPatchesResponse], error)` -- Function `*AvailabilitySetsClient.ListBySubscription` return value(s) have been changed from `(*AvailabilitySetsClientListBySubscriptionPager)` to `(*runtime.Pager[AvailabilitySetsClientListBySubscriptionResponse])` -- Function `*CloudServicesClient.BeginRebuild` return value(s) have been changed from `(CloudServicesClientRebuildPollerResponse, error)` to `(*armruntime.Poller[CloudServicesClientRebuildResponse], error)` -- Function `NewSharedGalleriesClient` return value(s) have been changed from `(*SharedGalleriesClient)` to `(*SharedGalleriesClient, error)` -- Function `*VirtualMachineScaleSetVMsClient.List` return value(s) have been changed from `(*VirtualMachineScaleSetVMsClientListPager)` to `(*runtime.Pager[VirtualMachineScaleSetVMsClientListResponse])` -- Function `*VirtualMachinesClient.List` return value(s) have been changed from `(*VirtualMachinesClientListPager)` to `(*runtime.Pager[VirtualMachinesClientListResponse])` -- Function `*GalleryApplicationsClient.ListByGallery` return value(s) have been changed from `(*GalleryApplicationsClientListByGalleryPager)` to `(*runtime.Pager[GalleryApplicationsClientListByGalleryResponse])` -- Function `*VirtualMachineExtensionsClient.BeginUpdate` return value(s) have been changed from `(VirtualMachineExtensionsClientUpdatePollerResponse, error)` to `(*armruntime.Poller[VirtualMachineExtensionsClientUpdateResponse], error)` -- Function `*VirtualMachineScaleSetVMExtensionsClient.BeginDelete` return value(s) have been changed from `(VirtualMachineScaleSetVMExtensionsClientDeletePollerResponse, error)` to `(*armruntime.Poller[VirtualMachineScaleSetVMExtensionsClientDeleteResponse], error)` -- Function `*VirtualMachineScaleSetVMsClient.BeginReimage` return value(s) have been changed from `(VirtualMachineScaleSetVMsClientReimagePollerResponse, error)` to `(*armruntime.Poller[VirtualMachineScaleSetVMsClientReimageResponse], error)` -- Function `*ResourceSKUsClient.List` return value(s) have been changed from `(*ResourceSKUsClientListPager)` to `(*runtime.Pager[ResourceSKUsClientListResponse])` -- Function `NewVirtualMachineScaleSetVMRunCommandsClient` return value(s) have been changed from `(*VirtualMachineScaleSetVMRunCommandsClient)` to `(*VirtualMachineScaleSetVMRunCommandsClient, error)` -- Function `*VirtualMachineScaleSetsClient.BeginPerformMaintenance` return value(s) have been changed from `(VirtualMachineScaleSetsClientPerformMaintenancePollerResponse, error)` to `(*armruntime.Poller[VirtualMachineScaleSetsClientPerformMaintenanceResponse], error)` -- Function `*VirtualMachineScaleSetsClient.BeginUpdateInstances` return value(s) have been changed from `(VirtualMachineScaleSetsClientUpdateInstancesPollerResponse, error)` to `(*armruntime.Poller[VirtualMachineScaleSetsClientUpdateInstancesResponse], error)` -- Function `*VirtualMachinesClient.BeginCapture` return value(s) have been changed from `(VirtualMachinesClientCapturePollerResponse, error)` to `(*armruntime.Poller[VirtualMachinesClientCaptureResponse], error)` -- Function `*DiskAccessesClient.BeginDeleteAPrivateEndpointConnection` return value(s) have been changed from `(DiskAccessesClientDeleteAPrivateEndpointConnectionPollerResponse, error)` to `(*armruntime.Poller[DiskAccessesClientDeleteAPrivateEndpointConnectionResponse], error)` -- Function `NewDiskEncryptionSetsClient` return value(s) have been changed from `(*DiskEncryptionSetsClient)` to `(*DiskEncryptionSetsClient, error)` -- Function `*SnapshotsClient.BeginCreateOrUpdate` return value(s) have been changed from `(SnapshotsClientCreateOrUpdatePollerResponse, error)` to `(*armruntime.Poller[SnapshotsClientCreateOrUpdateResponse], error)` -- Function `NewVirtualMachineRunCommandsClient` return value(s) have been changed from `(*VirtualMachineRunCommandsClient)` to `(*VirtualMachineRunCommandsClient, error)` -- Function `NewCapacityReservationsClient` return value(s) have been changed from `(*CapacityReservationsClient)` to `(*CapacityReservationsClient, error)` -- Function `NewCommunityGalleriesClient` return value(s) have been changed from `(*CommunityGalleriesClient)` to `(*CommunityGalleriesClient, error)` -- Function `*SnapshotsClient.ListByResourceGroup` return value(s) have been changed from `(*SnapshotsClientListByResourceGroupPager)` to `(*runtime.Pager[SnapshotsClientListByResourceGroupResponse])` -- Function `NewRestorePointCollectionsClient` return value(s) have been changed from `(*RestorePointCollectionsClient)` to `(*RestorePointCollectionsClient, error)` -- Function `*DiskAccessesClient.BeginUpdate` return value(s) have been changed from `(DiskAccessesClientUpdatePollerResponse, error)` to `(*armruntime.Poller[DiskAccessesClientUpdateResponse], error)` -- Function `*DedicatedHostsClient.ListByHostGroup` return value(s) have been changed from `(*DedicatedHostsClientListByHostGroupPager)` to `(*runtime.Pager[DedicatedHostsClientListByHostGroupResponse])` -- Function `*VirtualMachineScaleSetsClient.BeginDeleteInstances` return value(s) have been changed from `(VirtualMachineScaleSetsClientDeleteInstancesPollerResponse, error)` to `(*armruntime.Poller[VirtualMachineScaleSetsClientDeleteInstancesResponse], error)` -- Function `*VirtualMachinesClient.BeginRunCommand` return value(s) have been changed from `(VirtualMachinesClientRunCommandPollerResponse, error)` to `(*armruntime.Poller[VirtualMachinesClientRunCommandResponse], error)` -- Function `*GalleryApplicationVersionsClient.ListByGalleryApplication` return value(s) have been changed from `(*GalleryApplicationVersionsClientListByGalleryApplicationPager)` to `(*runtime.Pager[GalleryApplicationVersionsClientListByGalleryApplicationResponse])` -- Function `NewCloudServiceOperatingSystemsClient` return value(s) have been changed from `(*CloudServiceOperatingSystemsClient)` to `(*CloudServiceOperatingSystemsClient, error)` -- Function `*ImagesClient.List` return value(s) have been changed from `(*ImagesClientListPager)` to `(*runtime.Pager[ImagesClientListResponse])` -- Function `*GalleriesClient.BeginUpdate` return value(s) have been changed from `(GalleriesClientUpdatePollerResponse, error)` to `(*armruntime.Poller[GalleriesClientUpdateResponse], error)` -- Function `*VirtualMachineScaleSetVMsClient.BeginUpdate` return value(s) have been changed from `(VirtualMachineScaleSetVMsClientUpdatePollerResponse, error)` to `(*armruntime.Poller[VirtualMachineScaleSetVMsClientUpdateResponse], error)` -- Function `*DiskEncryptionSetsClient.List` return value(s) have been changed from `(*DiskEncryptionSetsClientListPager)` to `(*runtime.Pager[DiskEncryptionSetsClientListResponse])` -- Function `*DedicatedHostsClient.BeginCreateOrUpdate` return value(s) have been changed from `(DedicatedHostsClientCreateOrUpdatePollerResponse, error)` to `(*armruntime.Poller[DedicatedHostsClientCreateOrUpdateResponse], error)` -- Function `*DiskAccessesClient.ListByResourceGroup` return value(s) have been changed from `(*DiskAccessesClientListByResourceGroupPager)` to `(*runtime.Pager[DiskAccessesClientListByResourceGroupResponse])` -- Function `NewCloudServicesClient` return value(s) have been changed from `(*CloudServicesClient)` to `(*CloudServicesClient, error)` -- Function `*CloudServicesClient.ListAll` return value(s) have been changed from `(*CloudServicesClientListAllPager)` to `(*runtime.Pager[CloudServicesClientListAllResponse])` -- Function `*VirtualMachinesClient.BeginPerformMaintenance` return value(s) have been changed from `(VirtualMachinesClientPerformMaintenancePollerResponse, error)` to `(*armruntime.Poller[VirtualMachinesClientPerformMaintenanceResponse], error)` -- Function `*GalleriesClient.BeginCreateOrUpdate` return value(s) have been changed from `(GalleriesClientCreateOrUpdatePollerResponse, error)` to `(*armruntime.Poller[GalleriesClientCreateOrUpdateResponse], error)` -- Function `*VirtualMachinesClient.BeginReimage` return value(s) have been changed from `(VirtualMachinesClientReimagePollerResponse, error)` to `(*armruntime.Poller[VirtualMachinesClientReimageResponse], error)` -- Function `*SnapshotsClient.BeginGrantAccess` return value(s) have been changed from `(SnapshotsClientGrantAccessPollerResponse, error)` to `(*armruntime.Poller[SnapshotsClientGrantAccessResponse], error)` -- Function `*VirtualMachineScaleSetVMsClient.BeginDelete` return value(s) have been changed from `(VirtualMachineScaleSetVMsClientDeletePollerResponse, error)` to `(*armruntime.Poller[VirtualMachineScaleSetVMsClientDeleteResponse], error)` -- Function `*DiskAccessesClient.BeginUpdateAPrivateEndpointConnection` return value(s) have been changed from `(DiskAccessesClientUpdateAPrivateEndpointConnectionPollerResponse, error)` to `(*armruntime.Poller[DiskAccessesClientUpdateAPrivateEndpointConnectionResponse], error)` -- Function `*VirtualMachineRunCommandsClient.BeginCreateOrUpdate` return value(s) have been changed from `(VirtualMachineRunCommandsClientCreateOrUpdatePollerResponse, error)` to `(*armruntime.Poller[VirtualMachineRunCommandsClientCreateOrUpdateResponse], error)` -- Function `*CloudServicesClient.List` return value(s) have been changed from `(*CloudServicesClientListPager)` to `(*runtime.Pager[CloudServicesClientListResponse])` -- Function `NewProximityPlacementGroupsClient` return value(s) have been changed from `(*ProximityPlacementGroupsClient)` to `(*ProximityPlacementGroupsClient, error)` -- Function `*DiskAccessesClient.ListPrivateEndpointConnections` return value(s) have been changed from `(*DiskAccessesClientListPrivateEndpointConnectionsPager)` to `(*runtime.Pager[DiskAccessesClientListPrivateEndpointConnectionsResponse])` -- Function `NewVirtualMachineScaleSetVMsClient` return value(s) have been changed from `(*VirtualMachineScaleSetVMsClient)` to `(*VirtualMachineScaleSetVMsClient, error)` -- Function `*ProximityPlacementGroupsClient.ListBySubscription` return value(s) have been changed from `(*ProximityPlacementGroupsClientListBySubscriptionPager)` to `(*runtime.Pager[ProximityPlacementGroupsClientListBySubscriptionResponse])` -- Function `*VirtualMachineScaleSetVMsClient.BeginPowerOff` return value(s) have been changed from `(VirtualMachineScaleSetVMsClientPowerOffPollerResponse, error)` to `(*armruntime.Poller[VirtualMachineScaleSetVMsClientPowerOffResponse], error)` -- Function `*VirtualMachineScaleSetVMsClient.BeginDeallocate` return value(s) have been changed from `(VirtualMachineScaleSetVMsClientDeallocatePollerResponse, error)` to `(*armruntime.Poller[VirtualMachineScaleSetVMsClientDeallocateResponse], error)` -- Function `*RestorePointCollectionsClient.BeginDelete` return value(s) have been changed from `(RestorePointCollectionsClientDeletePollerResponse, error)` to `(*armruntime.Poller[RestorePointCollectionsClientDeleteResponse], error)` -- Function `*CloudServicesClient.BeginPowerOff` return value(s) have been changed from `(CloudServicesClientPowerOffPollerResponse, error)` to `(*armruntime.Poller[CloudServicesClientPowerOffResponse], error)` -- Function `*VirtualMachineScaleSetsClient.BeginDelete` return value(s) have been changed from `(VirtualMachineScaleSetsClientDeletePollerResponse, error)` to `(*armruntime.Poller[VirtualMachineScaleSetsClientDeleteResponse], error)` -- Function `*CapacityReservationsClient.BeginDelete` return value(s) have been changed from `(CapacityReservationsClientDeletePollerResponse, error)` to `(*armruntime.Poller[CapacityReservationsClientDeleteResponse], error)` -- Function `*VirtualMachineScaleSetVMsClient.BeginRedeploy` return value(s) have been changed from `(VirtualMachineScaleSetVMsClientRedeployPollerResponse, error)` to `(*armruntime.Poller[VirtualMachineScaleSetVMsClientRedeployResponse], error)` -- Function `NewVirtualMachineSizesClient` return value(s) have been changed from `(*VirtualMachineSizesClient)` to `(*VirtualMachineSizesClient, error)` -- Function `*VirtualMachinesClient.ListAll` return value(s) have been changed from `(*VirtualMachinesClientListAllPager)` to `(*runtime.Pager[VirtualMachinesClientListAllResponse])` -- Function `*CloudServicesClient.BeginDeleteInstances` return value(s) have been changed from `(CloudServicesClientDeleteInstancesPollerResponse, error)` to `(*armruntime.Poller[CloudServicesClientDeleteInstancesResponse], error)` -- Function `*VirtualMachineScaleSetRollingUpgradesClient.BeginCancel` return value(s) have been changed from `(VirtualMachineScaleSetRollingUpgradesClientCancelPollerResponse, error)` to `(*armruntime.Poller[VirtualMachineScaleSetRollingUpgradesClientCancelResponse], error)` -- Function `*CloudServiceOperatingSystemsClient.ListOSFamilies` return value(s) have been changed from `(*CloudServiceOperatingSystemsClientListOSFamiliesPager)` to `(*runtime.Pager[CloudServiceOperatingSystemsClientListOSFamiliesResponse])` -- Function `*VirtualMachinesClient.BeginUpdate` return value(s) have been changed from `(VirtualMachinesClientUpdatePollerResponse, error)` to `(*armruntime.Poller[VirtualMachinesClientUpdateResponse], error)` -- Function `*DiskEncryptionSetsClient.BeginUpdate` return value(s) have been changed from `(DiskEncryptionSetsClientUpdatePollerResponse, error)` to `(*armruntime.Poller[DiskEncryptionSetsClientUpdateResponse], error)` -- Function `NewDisksClient` return value(s) have been changed from `(*DisksClient)` to `(*DisksClient, error)` -- Function `*VirtualMachineScaleSetsClient.BeginUpdate` return value(s) have been changed from `(VirtualMachineScaleSetsClientUpdatePollerResponse, error)` to `(*armruntime.Poller[VirtualMachineScaleSetsClientUpdateResponse], error)` -- Function `*VirtualMachineScaleSetVMExtensionsClient.BeginCreateOrUpdate` return value(s) have been changed from `(VirtualMachineScaleSetVMExtensionsClientCreateOrUpdatePollerResponse, error)` to `(*armruntime.Poller[VirtualMachineScaleSetVMExtensionsClientCreateOrUpdateResponse], error)` -- Function `*VirtualMachineScaleSetsClient.GetOSUpgradeHistory` return value(s) have been changed from `(*VirtualMachineScaleSetsClientGetOSUpgradeHistoryPager)` to `(*runtime.Pager[VirtualMachineScaleSetsClientGetOSUpgradeHistoryResponse])` -- Function `NewDiskRestorePointClient` return value(s) have been changed from `(*DiskRestorePointClient)` to `(*DiskRestorePointClient, error)` -- Function `*SnapshotsClient.List` return value(s) have been changed from `(*SnapshotsClientListPager)` to `(*runtime.Pager[SnapshotsClientListResponse])` -- Function `*VirtualMachineScaleSetExtensionsClient.BeginDelete` return value(s) have been changed from `(VirtualMachineScaleSetExtensionsClientDeletePollerResponse, error)` to `(*armruntime.Poller[VirtualMachineScaleSetExtensionsClientDeleteResponse], error)` -- Function `*VirtualMachineScaleSetsClient.BeginStart` return value(s) have been changed from `(VirtualMachineScaleSetsClientStartPollerResponse, error)` to `(*armruntime.Poller[VirtualMachineScaleSetsClientStartResponse], error)` -- Function `NewAvailabilitySetsClient` return value(s) have been changed from `(*AvailabilitySetsClient)` to `(*AvailabilitySetsClient, error)` -- Function `*ImagesClient.BeginUpdate` return value(s) have been changed from `(ImagesClientUpdatePollerResponse, error)` to `(*armruntime.Poller[ImagesClientUpdateResponse], error)` -- Function `*ImagesClient.ListByResourceGroup` return value(s) have been changed from `(*ImagesClientListByResourceGroupPager)` to `(*runtime.Pager[ImagesClientListByResourceGroupResponse])` -- Function `*ImagesClient.BeginCreateOrUpdate` return value(s) have been changed from `(ImagesClientCreateOrUpdatePollerResponse, error)` to `(*armruntime.Poller[ImagesClientCreateOrUpdateResponse], error)` -- Function `*VirtualMachinesClient.BeginPowerOff` return value(s) have been changed from `(VirtualMachinesClientPowerOffPollerResponse, error)` to `(*armruntime.Poller[VirtualMachinesClientPowerOffResponse], error)` -- Function `NewCloudServicesUpdateDomainClient` return value(s) have been changed from `(*CloudServicesUpdateDomainClient)` to `(*CloudServicesUpdateDomainClient, error)` -- Function `NewGalleryApplicationsClient` return value(s) have been changed from `(*GalleryApplicationsClient)` to `(*GalleryApplicationsClient, error)` -- Function `*VirtualMachineSizesClient.List` parameter(s) have been changed from `(context.Context, string, *VirtualMachineSizesClientListOptions)` to `(string, *VirtualMachineSizesClientListOptions)` -- Function `*VirtualMachineSizesClient.List` return value(s) have been changed from `(VirtualMachineSizesClientListResponse, error)` to `(*runtime.Pager[VirtualMachineSizesClientListResponse])` -- Function `*RestorePointsClient.BeginDelete` return value(s) have been changed from `(RestorePointsClientDeletePollerResponse, error)` to `(*armruntime.Poller[RestorePointsClientDeleteResponse], error)` -- Function `*DiskEncryptionSetsClient.ListByResourceGroup` return value(s) have been changed from `(*DiskEncryptionSetsClientListByResourceGroupPager)` to `(*runtime.Pager[DiskEncryptionSetsClientListByResourceGroupResponse])` -- Function `NewGallerySharingProfileClient` return value(s) have been changed from `(*GallerySharingProfileClient)` to `(*GallerySharingProfileClient, error)` -- Function `*CloudServicesClient.BeginReimage` return value(s) have been changed from `(CloudServicesClientReimagePollerResponse, error)` to `(*armruntime.Poller[CloudServicesClientReimageResponse], error)` -- Function `NewGalleryImagesClient` return value(s) have been changed from `(*GalleryImagesClient)` to `(*GalleryImagesClient, error)` -- Function `*DisksClient.BeginRevokeAccess` return value(s) have been changed from `(DisksClientRevokeAccessPollerResponse, error)` to `(*armruntime.Poller[DisksClientRevokeAccessResponse], error)` -- Function `NewGalleryImageVersionsClient` return value(s) have been changed from `(*GalleryImageVersionsClient)` to `(*GalleryImageVersionsClient, error)` -- Function `*GalleryApplicationVersionsClient.BeginCreateOrUpdate` return value(s) have been changed from `(GalleryApplicationVersionsClientCreateOrUpdatePollerResponse, error)` to `(*armruntime.Poller[GalleryApplicationVersionsClientCreateOrUpdateResponse], error)` -- Function `NewVirtualMachineImagesClient` return value(s) have been changed from `(*VirtualMachineImagesClient)` to `(*VirtualMachineImagesClient, error)` -- Function `*DedicatedHostGroupsClient.ListByResourceGroup` return value(s) have been changed from `(*DedicatedHostGroupsClientListByResourceGroupPager)` to `(*runtime.Pager[DedicatedHostGroupsClientListByResourceGroupResponse])` -- Function `*DisksClient.BeginGrantAccess` return value(s) have been changed from `(DisksClientGrantAccessPollerResponse, error)` to `(*armruntime.Poller[DisksClientGrantAccessResponse], error)` -- Function `*OperationsClient.List` parameter(s) have been changed from `(context.Context, *OperationsClientListOptions)` to `(*OperationsClientListOptions)` -- Function `*OperationsClient.List` return value(s) have been changed from `(OperationsClientListResponse, error)` to `(*runtime.Pager[OperationsClientListResponse])` -- Function `NewVirtualMachineScaleSetVMExtensionsClient` return value(s) have been changed from `(*VirtualMachineScaleSetVMExtensionsClient)` to `(*VirtualMachineScaleSetVMExtensionsClient, error)` -- Function `*VirtualMachineExtensionsClient.BeginCreateOrUpdate` return value(s) have been changed from `(VirtualMachineExtensionsClientCreateOrUpdatePollerResponse, error)` to `(*armruntime.Poller[VirtualMachineExtensionsClientCreateOrUpdateResponse], error)` -- Function `*GalleriesClient.ListByResourceGroup` return value(s) have been changed from `(*GalleriesClientListByResourceGroupPager)` to `(*runtime.Pager[GalleriesClientListByResourceGroupResponse])` -- Function `*DisksClient.BeginUpdate` return value(s) have been changed from `(DisksClientUpdatePollerResponse, error)` to `(*armruntime.Poller[DisksClientUpdateResponse], error)` -- Function `*VirtualMachineRunCommandsClient.List` return value(s) have been changed from `(*VirtualMachineRunCommandsClientListPager)` to `(*runtime.Pager[VirtualMachineRunCommandsClientListResponse])` -- Function `*VirtualMachineScaleSetExtensionsClient.BeginUpdate` return value(s) have been changed from `(VirtualMachineScaleSetExtensionsClientUpdatePollerResponse, error)` to `(*armruntime.Poller[VirtualMachineScaleSetExtensionsClientUpdateResponse], error)` -- Function `*DisksClient.List` return value(s) have been changed from `(*DisksClientListPager)` to `(*runtime.Pager[DisksClientListResponse])` -- Function `*CapacityReservationsClient.BeginUpdate` return value(s) have been changed from `(CapacityReservationsClientUpdatePollerResponse, error)` to `(*armruntime.Poller[CapacityReservationsClientUpdateResponse], error)` -- Function `*SnapshotsClient.BeginUpdate` return value(s) have been changed from `(SnapshotsClientUpdatePollerResponse, error)` to `(*armruntime.Poller[SnapshotsClientUpdateResponse], error)` -- Function `*VirtualMachineScaleSetExtensionsClient.List` return value(s) have been changed from `(*VirtualMachineScaleSetExtensionsClientListPager)` to `(*runtime.Pager[VirtualMachineScaleSetExtensionsClientListResponse])` -- Function `*VirtualMachineScaleSetVMRunCommandsClient.List` return value(s) have been changed from `(*VirtualMachineScaleSetVMRunCommandsClientListPager)` to `(*runtime.Pager[VirtualMachineScaleSetVMRunCommandsClientListResponse])` -- Function `*VirtualMachineRunCommandsClient.ListByVirtualMachine` return value(s) have been changed from `(*VirtualMachineRunCommandsClientListByVirtualMachinePager)` to `(*runtime.Pager[VirtualMachineRunCommandsClientListByVirtualMachineResponse])` -- Function `*DiskAccessesClient.List` return value(s) have been changed from `(*DiskAccessesClientListPager)` to `(*runtime.Pager[DiskAccessesClientListResponse])` -- Function `*CloudServicesClient.BeginRestart` return value(s) have been changed from `(CloudServicesClientRestartPollerResponse, error)` to `(*armruntime.Poller[CloudServicesClientRestartResponse], error)` -- Function `*ProximityPlacementGroupsClient.ListByResourceGroup` return value(s) have been changed from `(*ProximityPlacementGroupsClientListByResourceGroupPager)` to `(*runtime.Pager[ProximityPlacementGroupsClientListByResourceGroupResponse])` -- Function `*GalleriesClient.List` return value(s) have been changed from `(*GalleriesClientListPager)` to `(*runtime.Pager[GalleriesClientListResponse])` -- Function `NewCommunityGalleryImagesClient` return value(s) have been changed from `(*CommunityGalleryImagesClient)` to `(*CommunityGalleryImagesClient, error)` -- Function `*VirtualMachineScaleSetVMRunCommandsClient.BeginDelete` return value(s) have been changed from `(VirtualMachineScaleSetVMRunCommandsClientDeletePollerResponse, error)` to `(*armruntime.Poller[VirtualMachineScaleSetVMRunCommandsClientDeleteResponse], error)` -- Function `*VirtualMachinesClient.BeginDelete` return value(s) have been changed from `(VirtualMachinesClientDeletePollerResponse, error)` to `(*armruntime.Poller[VirtualMachinesClientDeleteResponse], error)` -- Function `NewRestorePointsClient` return value(s) have been changed from `(*RestorePointsClient)` to `(*RestorePointsClient, error)` -- Function `*LogAnalyticsClient.BeginExportRequestRateByInterval` return value(s) have been changed from `(LogAnalyticsClientExportRequestRateByIntervalPollerResponse, error)` to `(*armruntime.Poller[LogAnalyticsClientExportRequestRateByIntervalResponse], error)` -- Function `*GalleryImagesClient.BeginUpdate` return value(s) have been changed from `(GalleryImagesClientUpdatePollerResponse, error)` to `(*armruntime.Poller[GalleryImagesClientUpdateResponse], error)` -- Function `*VirtualMachinesClient.ListByLocation` return value(s) have been changed from `(*VirtualMachinesClientListByLocationPager)` to `(*runtime.Pager[VirtualMachinesClientListByLocationResponse])` -- Function `*VirtualMachineScaleSetVMsClient.BeginRestart` return value(s) have been changed from `(VirtualMachineScaleSetVMsClientRestartPollerResponse, error)` to `(*armruntime.Poller[VirtualMachineScaleSetVMsClientRestartResponse], error)` -- Function `*DisksClient.ListByResourceGroup` return value(s) have been changed from `(*DisksClientListByResourceGroupPager)` to `(*runtime.Pager[DisksClientListByResourceGroupResponse])` -- Function `*GalleryApplicationsClient.BeginCreateOrUpdate` return value(s) have been changed from `(GalleryApplicationsClientCreateOrUpdatePollerResponse, error)` to `(*armruntime.Poller[GalleryApplicationsClientCreateOrUpdateResponse], error)` -- Function `*GalleryApplicationsClient.BeginDelete` return value(s) have been changed from `(GalleryApplicationsClientDeletePollerResponse, error)` to `(*armruntime.Poller[GalleryApplicationsClientDeleteResponse], error)` -- Function `*VirtualMachineScaleSetsClient.BeginRedeploy` return value(s) have been changed from `(VirtualMachineScaleSetsClientRedeployPollerResponse, error)` to `(*armruntime.Poller[VirtualMachineScaleSetsClientRedeployResponse], error)` -- Function `*GalleriesClient.BeginDelete` return value(s) have been changed from `(GalleriesClientDeletePollerResponse, error)` to `(*armruntime.Poller[GalleriesClientDeleteResponse], error)` -- Function `*VirtualMachineScaleSetsClient.BeginCreateOrUpdate` return value(s) have been changed from `(VirtualMachineScaleSetsClientCreateOrUpdatePollerResponse, error)` to `(*armruntime.Poller[VirtualMachineScaleSetsClientCreateOrUpdateResponse], error)` -- Function `*SharedGalleryImageVersionsClient.List` return value(s) have been changed from `(*SharedGalleryImageVersionsClientListPager)` to `(*runtime.Pager[SharedGalleryImageVersionsClientListResponse])` -- Function `NewVirtualMachineExtensionsClient` return value(s) have been changed from `(*VirtualMachineExtensionsClient)` to `(*VirtualMachineExtensionsClient, error)` -- Function `*VirtualMachineScaleSetsClient.ListSKUs` return value(s) have been changed from `(*VirtualMachineScaleSetsClientListSKUsPager)` to `(*runtime.Pager[VirtualMachineScaleSetsClientListSKUsResponse])` -- Function `*SSHPublicKeysClient.ListBySubscription` return value(s) have been changed from `(*SSHPublicKeysClientListBySubscriptionPager)` to `(*runtime.Pager[SSHPublicKeysClientListBySubscriptionResponse])` -- Function `*SnapshotsClient.BeginDelete` return value(s) have been changed from `(SnapshotsClientDeletePollerResponse, error)` to `(*armruntime.Poller[SnapshotsClientDeleteResponse], error)` -- Function `*VirtualMachineScaleSetsClient.BeginSetOrchestrationServiceState` return value(s) have been changed from `(VirtualMachineScaleSetsClientSetOrchestrationServiceStatePollerResponse, error)` to `(*armruntime.Poller[VirtualMachineScaleSetsClientSetOrchestrationServiceStateResponse], error)` -- Function `NewOperationsClient` return value(s) have been changed from `(*OperationsClient)` to `(*OperationsClient, error)` -- Function `NewSharedGalleryImageVersionsClient` return value(s) have been changed from `(*SharedGalleryImageVersionsClient)` to `(*SharedGalleryImageVersionsClient, error)` -- Function `*VirtualMachineScaleSetVMsClient.BeginStart` return value(s) have been changed from `(VirtualMachineScaleSetVMsClientStartPollerResponse, error)` to `(*armruntime.Poller[VirtualMachineScaleSetVMsClientStartResponse], error)` -- Function `*CloudServicesClient.BeginCreateOrUpdate` return value(s) have been changed from `(CloudServicesClientCreateOrUpdatePollerResponse, error)` to `(*armruntime.Poller[CloudServicesClientCreateOrUpdateResponse], error)` -- Function `*VirtualMachineScaleSetRollingUpgradesClient.BeginStartOSUpgrade` return value(s) have been changed from `(VirtualMachineScaleSetRollingUpgradesClientStartOSUpgradePollerResponse, error)` to `(*armruntime.Poller[VirtualMachineScaleSetRollingUpgradesClientStartOSUpgradeResponse], error)` -- Function `*DiskRestorePointClient.ListByRestorePoint` return value(s) have been changed from `(*DiskRestorePointClientListByRestorePointPager)` to `(*runtime.Pager[DiskRestorePointClientListByRestorePointResponse])` -- Function `*GalleryImageVersionsClient.BeginCreateOrUpdate` return value(s) have been changed from `(GalleryImageVersionsClientCreateOrUpdatePollerResponse, error)` to `(*armruntime.Poller[GalleryImageVersionsClientCreateOrUpdateResponse], error)` -- Function `*CloudServicesClient.BeginUpdate` return value(s) have been changed from `(CloudServicesClientUpdatePollerResponse, error)` to `(*armruntime.Poller[CloudServicesClientUpdateResponse], error)` -- Function `*DisksClient.BeginDelete` return value(s) have been changed from `(DisksClientDeletePollerResponse, error)` to `(*armruntime.Poller[DisksClientDeleteResponse], error)` -- Function `*VirtualMachineScaleSetsClient.BeginDeallocate` return value(s) have been changed from `(VirtualMachineScaleSetsClientDeallocatePollerResponse, error)` to `(*armruntime.Poller[VirtualMachineScaleSetsClientDeallocateResponse], error)` -- Function `*VirtualMachinesClient.BeginCreateOrUpdate` return value(s) have been changed from `(VirtualMachinesClientCreateOrUpdatePollerResponse, error)` to `(*armruntime.Poller[VirtualMachinesClientCreateOrUpdateResponse], error)` -- Function `NewVirtualMachineExtensionImagesClient` return value(s) have been changed from `(*VirtualMachineExtensionImagesClient)` to `(*VirtualMachineExtensionImagesClient, error)` -- Function `NewVirtualMachineImagesEdgeZoneClient` return value(s) have been changed from `(*VirtualMachineImagesEdgeZoneClient)` to `(*VirtualMachineImagesEdgeZoneClient, error)` -- Function `*GalleryImagesClient.BeginCreateOrUpdate` return value(s) have been changed from `(GalleryImagesClientCreateOrUpdatePollerResponse, error)` to `(*armruntime.Poller[GalleryImagesClientCreateOrUpdateResponse], error)` -- Function `*CloudServiceRoleInstancesClient.BeginReimage` return value(s) have been changed from `(CloudServiceRoleInstancesClientReimagePollerResponse, error)` to `(*armruntime.Poller[CloudServiceRoleInstancesClientReimageResponse], error)` -- Function `*ImagesClient.BeginDelete` return value(s) have been changed from `(ImagesClientDeletePollerResponse, error)` to `(*armruntime.Poller[ImagesClientDeleteResponse], error)` -- Function `*CapacityReservationGroupsClient.ListBySubscription` return value(s) have been changed from `(*CapacityReservationGroupsClientListBySubscriptionPager)` to `(*runtime.Pager[CapacityReservationGroupsClientListBySubscriptionResponse])` -- Function `*VirtualMachineScaleSetVMsClient.BeginPerformMaintenance` return value(s) have been changed from `(VirtualMachineScaleSetVMsClientPerformMaintenancePollerResponse, error)` to `(*armruntime.Poller[VirtualMachineScaleSetVMsClientPerformMaintenanceResponse], error)` -- Function `*SnapshotsClientListPager.NextPage` has been removed -- Function `*ImagesClientDeletePoller.FinalResponse` has been removed -- Function `*VirtualMachineExtensionsClientCreateOrUpdatePoller.Done` has been removed -- Function `*DiskAccessesClientDeletePoller.Poll` has been removed -- Function `*DiskEncryptionSetsClientListByResourceGroupPager.NextPage` has been removed -- Function `DedicatedHostsClientDeletePollerResponse.PollUntilDone` has been removed -- Function `*DedicatedHostsClientDeletePoller.FinalResponse` has been removed -- Function `*SnapshotsClientGrantAccessPollerResponse.Resume` has been removed -- Function `*GalleryImageVersionsClientUpdatePollerResponse.Resume` has been removed -- Function `*ImagesClientUpdatePoller.Done` has been removed -- Function `*VirtualMachineScaleSetVMRunCommandsClientCreateOrUpdatePollerResponse.Resume` has been removed -- Function `SharingState.ToPtr` has been removed -- Function `*VirtualMachineScaleSetsClientReimageAllPoller.Done` has been removed -- Function `*VirtualMachineScaleSetRollingUpgradesClientCancelPoller.ResumeToken` has been removed -- Function `GallerySharingPermissionTypes.ToPtr` has been removed -- Function `*CloudServiceOperatingSystemsClientListOSFamiliesPager.NextPage` has been removed -- Function `*VirtualMachineScaleSetsClientReimagePoller.ResumeToken` has been removed -- Function `DiskAccessesClientDeletePollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachinesClientRestartPollerResponse.Resume` has been removed -- Function `*VirtualMachineScaleSetVMExtensionsClientDeletePoller.ResumeToken` has been removed -- Function `*AvailabilitySetsClientListPager.Err` has been removed -- Function `*DiskEncryptionSetsClientCreateOrUpdatePoller.FinalResponse` has been removed -- Function `*VirtualMachineRunCommandsClientCreateOrUpdatePoller.Poll` has been removed -- Function `*DiskAccessesClientUpdateAPrivateEndpointConnectionPollerResponse.Resume` has been removed -- Function `*CapacityReservationGroupsClientListBySubscriptionPager.PageResponse` has been removed -- Function `ExpandTypesForGetCapacityReservationGroups.ToPtr` has been removed -- Function `*GalleriesClientCreateOrUpdatePoller.ResumeToken` has been removed -- Function `VirtualMachineExtensionsClientCreateOrUpdatePollerResponse.PollUntilDone` has been removed -- Function `*ImagesClientCreateOrUpdatePoller.ResumeToken` has been removed -- Function `*DiskEncryptionSetsClientUpdatePoller.Done` has been removed -- Function `*DiskEncryptionSetsClientUpdatePoller.FinalResponse` has been removed -- Function `*ImagesClientUpdatePoller.FinalResponse` has been removed -- Function `*CapacityReservationsClientListByCapacityReservationGroupPager.NextPage` has been removed -- Function `*CloudServicesClientPowerOffPoller.Done` has been removed -- Function `*GalleryImageVersionsClientDeletePoller.Done` has been removed -- Function `*DiskAccessesClientListPager.Err` has been removed -- Function `*DedicatedHostsClientDeletePoller.ResumeToken` has been removed -- Function `*VirtualMachineExtensionsClientCreateOrUpdatePoller.Poll` has been removed -- Function `*VirtualMachineScaleSetVMsClientListPager.NextPage` has been removed -- Function `VirtualMachineScaleSetVMsClientStartPollerResponse.PollUntilDone` has been removed -- Function `DiskEncryptionSetsClientDeletePollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachineScaleSetVMRunCommandsClientUpdatePoller.Done` has been removed -- Function `*VirtualMachineScaleSetsClientCreateOrUpdatePollerResponse.Resume` has been removed -- Function `*VirtualMachineScaleSetsClientGetOSUpgradeHistoryPager.PageResponse` has been removed -- Function `*DiskAccessesClientListPrivateEndpointConnectionsPager.NextPage` has been removed -- Function `VirtualMachineSizeTypes.ToPtr` has been removed -- Function `*VirtualMachineScaleSetsClientCreateOrUpdatePoller.ResumeToken` has been removed -- Function `*VirtualMachineExtensionsClientUpdatePoller.FinalResponse` has been removed -- Function `*ProximityPlacementGroupsClientListByResourceGroupPager.NextPage` has been removed -- Function `*SnapshotsClientListByResourceGroupPager.PageResponse` has been removed -- Function `*LogAnalyticsClientExportThrottledRequestsPollerResponse.Resume` has been removed -- Function `*GalleryApplicationsClientUpdatePoller.ResumeToken` has been removed -- Function `*DiskEncryptionSetsClientDeletePollerResponse.Resume` has been removed -- Function `EncryptionType.ToPtr` has been removed -- Function `DiskAccessesClientUpdateAPrivateEndpointConnectionPollerResponse.PollUntilDone` has been removed -- Function `*DiskAccessesClientUpdatePoller.Poll` has been removed -- Function `*DisksClientUpdatePoller.FinalResponse` has been removed -- Function `*VirtualMachinesClientStartPollerResponse.Resume` has been removed -- Function `*VirtualMachineScaleSetsClientUpdatePoller.Poll` has been removed -- Function `*DiskAccessesClientDeletePoller.ResumeToken` has been removed -- Function `*CloudServiceRoleInstancesClientRestartPoller.Done` has been removed -- Function `*VirtualMachineScaleSetsClientRestartPoller.FinalResponse` has been removed -- Function `*CloudServicesClientRebuildPollerResponse.Resume` has been removed -- Function `*LogAnalyticsClientExportThrottledRequestsPoller.Poll` has been removed -- Function `*VirtualMachineRunCommandsClientListByVirtualMachinePager.Err` has been removed -- Function `*VirtualMachinesClientPowerOffPollerResponse.Resume` has been removed -- Function `*VirtualMachineScaleSetVMsClientRunCommandPoller.Done` has been removed -- Function `VirtualMachineScaleSetsClientPerformMaintenancePollerResponse.PollUntilDone` has been removed -- Function `*CloudServiceOperatingSystemsClientListOSFamiliesPager.PageResponse` has been removed -- Function `*ImagesClientUpdatePollerResponse.Resume` has been removed -- Function `*VirtualMachineScaleSetVMsClientPowerOffPoller.ResumeToken` has been removed -- Function `*SnapshotsClientCreateOrUpdatePoller.ResumeToken` has been removed -- Function `*SharedGalleryImageVersionsClientListPager.PageResponse` has been removed -- Function `*GalleryImagesClientUpdatePoller.FinalResponse` has been removed -- Function `*VirtualMachineRunCommandsClientListByVirtualMachinePager.PageResponse` has been removed -- Function `*ProximityPlacementGroupsClientListBySubscriptionPager.Err` has been removed -- Function `*DedicatedHostsClientRestartPollerResponse.Resume` has been removed -- Function `*VirtualMachineExtensionsClientCreateOrUpdatePoller.ResumeToken` has been removed -- Function `*SSHPublicKeysClientListBySubscriptionPager.NextPage` has been removed -- Function `*CloudServicesClientPowerOffPollerResponse.Resume` has been removed -- Function `CachingTypes.ToPtr` has been removed -- Function `*ImagesClientListByResourceGroupPager.Err` has been removed -- Function `*ImagesClientListByResourceGroupPager.PageResponse` has been removed -- Function `*VirtualMachinesClientRunCommandPoller.ResumeToken` has been removed -- Function `VirtualMachineScaleSetExtensionsClientDeletePollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachineScaleSetsClientListByLocationPager.Err` has been removed -- Function `*DiskEncryptionSetsClientListByResourceGroupPager.Err` has been removed -- Function `*GalleriesClientDeletePoller.ResumeToken` has been removed -- Function `*VirtualMachineScaleSetsClientStartPoller.Poll` has been removed -- Function `*VirtualMachineScaleSetVMsClientRunCommandPoller.ResumeToken` has been removed -- Function `*DiskRestorePointClientGrantAccessPoller.FinalResponse` has been removed -- Function `*AvailabilitySetsClientListPager.PageResponse` has been removed -- Function `*VirtualMachinesClientRedeployPoller.FinalResponse` has been removed -- Function `*VirtualMachineScaleSetsClientStartPoller.FinalResponse` has been removed -- Function `*RestorePointsClientDeletePoller.FinalResponse` has been removed -- Function `DedicatedHostsClientUpdatePollerResponse.PollUntilDone` has been removed -- Function `ResourceSKURestrictionsType.ToPtr` has been removed -- Function `*DiskAccessesClientListPrivateEndpointConnectionsPager.Err` has been removed -- Function `IntervalInMins.ToPtr` has been removed -- Function `*SnapshotsClientRevokeAccessPollerResponse.Resume` has been removed -- Function `*VirtualMachineRunCommandsClientListPager.Err` has been removed -- Function `*VirtualMachineScaleSetVMRunCommandsClientListPager.NextPage` has been removed -- Function `VirtualMachineScaleSetVMExtensionsClientUpdatePollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachineRunCommandsClientCreateOrUpdatePollerResponse.Resume` has been removed -- Function `*VirtualMachineRunCommandsClientUpdatePoller.Poll` has been removed -- Function `*CloudServicesClientStartPoller.Done` has been removed -- Function `*VirtualMachinesClientStartPoller.ResumeToken` has been removed -- Function `VirtualMachineRunCommandsClientUpdatePollerResponse.PollUntilDone` has been removed -- Function `*CapacityReservationsClientCreateOrUpdatePoller.Done` has been removed -- Function `*VirtualMachineScaleSetExtensionsClientDeletePoller.FinalResponse` has been removed -- Function `*VirtualMachineScaleSetsClientUpdatePoller.Done` has been removed -- Function `ReplicationStatusTypes.ToPtr` has been removed -- Function `*DiskEncryptionSetsClientListPager.PageResponse` has been removed -- Function `*RestorePointsClientDeletePoller.Done` has been removed -- Function `VirtualMachineScaleSetsClientRestartPollerResponse.PollUntilDone` has been removed -- Function `*GalleryImagesClientCreateOrUpdatePoller.Done` has been removed -- Function `ImagesClientDeletePollerResponse.PollUntilDone` has been removed -- Function `PatchInstallationState.ToPtr` has been removed -- Function `*VirtualMachinesClientListByLocationPager.PageResponse` has been removed -- Function `*GalleryImagesClientUpdatePollerResponse.Resume` has been removed -- Function `*GalleryApplicationsClientListByGalleryPager.PageResponse` has been removed -- Function `*CloudServicesClientRebuildPoller.Done` has been removed -- Function `*DiskAccessesClientDeleteAPrivateEndpointConnectionPollerResponse.Resume` has been removed -- Function `*DiskAccessesClientCreateOrUpdatePoller.Poll` has been removed -- Function `*GalleryApplicationsClientUpdatePoller.Poll` has been removed -- Function `*ImagesClientListPager.NextPage` has been removed -- Function `VirtualMachinesClientStartPollerResponse.PollUntilDone` has been removed -- Function `*SSHPublicKeysClientListBySubscriptionPager.Err` has been removed -- Function `*GallerySharingProfileClientUpdatePollerResponse.Resume` has been removed -- Function `*SnapshotsClientRevokeAccessPoller.ResumeToken` has been removed -- Function `OrchestrationMode.ToPtr` has been removed -- Function `*GalleryImagesClientUpdatePoller.Poll` has been removed -- Function `NetworkAccessPolicy.ToPtr` has been removed -- Function `*VirtualMachinesClientReapplyPoller.Poll` has been removed -- Function `*DisksClientListByResourceGroupPager.PageResponse` has been removed -- Function `GalleryPropertiesProvisioningState.ToPtr` has been removed -- Function `*VirtualMachineRunCommandsClientListByVirtualMachinePager.NextPage` has been removed -- Function `VirtualMachineScaleSetVMsClientReimageAllPollerResponse.PollUntilDone` has been removed -- Function `*ProximityPlacementGroupsClientListByResourceGroupPager.Err` has been removed -- Function `*GalleryApplicationVersionsClientListByGalleryApplicationPager.Err` has been removed -- Function `PrivateEndpointServiceConnectionStatus.ToPtr` has been removed -- Function `*CloudServicesClientReimagePoller.FinalResponse` has been removed -- Function `*CloudServicesClientDeleteInstancesPoller.Poll` has been removed -- Function `DedicatedHostLicenseTypes.ToPtr` has been removed -- Function `*VirtualMachineExtensionsClientCreateOrUpdatePollerResponse.Resume` has been removed -- Function `*SharedGalleriesClientListPager.NextPage` has been removed -- Function `*VirtualMachineScaleSetsClientDeletePoller.ResumeToken` has been removed -- Function `CloudServicesClientReimagePollerResponse.PollUntilDone` has been removed -- Function `*CloudServiceRoleInstancesClientReimagePoller.Done` has been removed -- Function `*VirtualMachinesClientRestartPoller.ResumeToken` has been removed -- Function `*DiskEncryptionSetsClientUpdatePoller.Poll` has been removed -- Function `*VirtualMachineExtensionsClientUpdatePollerResponse.Resume` has been removed -- Function `*VirtualMachineScaleSetsClientStartPoller.ResumeToken` has been removed -- Function `OrchestrationServiceState.ToPtr` has been removed -- Function `*SSHPublicKeysClientListByResourceGroupPager.Err` has been removed -- Function `*CloudServicesUpdateDomainClientWalkUpdateDomainPollerResponse.Resume` has been removed -- Function `*DiskAccessesClientDeletePollerResponse.Resume` has been removed -- Function `*VirtualMachinesClientPowerOffPoller.FinalResponse` has been removed -- Function `*VirtualMachineScaleSetsClientDeletePollerResponse.Resume` has been removed -- Function `*VirtualMachineScaleSetVMsClientDeletePoller.Poll` has been removed -- Function `GalleryApplicationVersionsClientUpdatePollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachineScaleSetsClientRestartPoller.Done` has been removed -- Function `*SnapshotsClientListPager.PageResponse` has been removed -- Function `*DiskAccessesClientCreateOrUpdatePollerResponse.Resume` has been removed -- Function `*VirtualMachinesClientUpdatePollerResponse.Resume` has been removed -- Function `*VirtualMachineScaleSetVMsClientStartPoller.FinalResponse` has been removed -- Function `GalleryImagesClientCreateOrUpdatePollerResponse.PollUntilDone` has been removed -- Function `VirtualMachineScaleSetsClientDeleteInstancesPollerResponse.PollUntilDone` has been removed -- Function `*CloudServiceRoleInstancesClientDeletePollerResponse.Resume` has been removed -- Function `*VirtualMachineScaleSetsClientListAllPager.NextPage` has been removed -- Function `*SnapshotsClientDeletePoller.ResumeToken` has been removed -- Function `*VirtualMachineScaleSetVMsClientStartPoller.Poll` has been removed -- Function `HyperVGenerationType.ToPtr` has been removed -- Function `OperatingSystemType.ToPtr` has been removed -- Function `*VirtualMachineScaleSetVMsClientPerformMaintenancePoller.Poll` has been removed -- Function `*VirtualMachineScaleSetsClientDeletePoller.Poll` has been removed -- Function `*DedicatedHostsClientUpdatePollerResponse.Resume` has been removed -- Function `VirtualMachinesClientAssessPatchesPollerResponse.PollUntilDone` has been removed -- Function `*DiskAccessesClientDeletePoller.Done` has been removed -- Function `*VirtualMachineScaleSetVMsClientReimagePoller.FinalResponse` has been removed -- Function `VirtualMachineScaleSetVMRunCommandsClientDeletePollerResponse.PollUntilDone` has been removed -- Function `*CapacityReservationsClientDeletePoller.Done` has been removed -- Function `*VirtualMachinesClientCapturePoller.ResumeToken` has been removed -- Function `*VirtualMachinesClientReapplyPoller.Done` has been removed -- Function `*VirtualMachineScaleSetVMsClientDeallocatePoller.Poll` has been removed -- Function `*VirtualMachineScaleSetExtensionsClientCreateOrUpdatePollerResponse.Resume` has been removed -- Function `*GalleryImageVersionsClientUpdatePoller.Poll` has been removed -- Function `VirtualMachinesClientCreateOrUpdatePollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachineExtensionsClientDeletePollerResponse.Resume` has been removed -- Function `*VirtualMachinesClientCreateOrUpdatePoller.ResumeToken` has been removed -- Function `*VirtualMachineScaleSetExtensionsClientListPager.PageResponse` has been removed -- Function `*DiskEncryptionSetsClientUpdatePoller.ResumeToken` has been removed -- Function `ExtendedLocationType.ToPtr` has been removed -- Function `VirtualMachinesClientDeletePollerResponse.PollUntilDone` has been removed -- Function `*GalleryApplicationsClientCreateOrUpdatePoller.FinalResponse` has been removed -- Function `*VirtualMachineScaleSetsClientUpdateInstancesPoller.FinalResponse` has been removed -- Function `VirtualMachineScaleSetsClientUpdatePollerResponse.PollUntilDone` has been removed -- Function `*DedicatedHostGroupsClientListBySubscriptionPager.NextPage` has been removed -- Function `*GalleryApplicationVersionsClientDeletePoller.FinalResponse` has been removed -- Function `*VirtualMachineScaleSetVMsClientDeallocatePoller.ResumeToken` has been removed -- Function `OperatingSystemTypes.ToPtr` has been removed -- Function `*DisksClientRevokeAccessPoller.ResumeToken` has been removed -- Function `OrchestrationServiceNames.ToPtr` has been removed -- Function `*GalleryImagesClientListByGalleryPager.Err` has been removed -- Function `*VirtualMachineScaleSetsClientDeallocatePoller.Done` has been removed -- Function `*VirtualMachinesClientDeletePoller.FinalResponse` has been removed -- Function `*CloudServicesClientRestartPoller.FinalResponse` has been removed -- Function `*VirtualMachineScaleSetsClientRedeployPoller.Poll` has been removed -- Function `*DiskAccessesClientDeletePoller.FinalResponse` has been removed -- Function `*VirtualMachineScaleSetsClientDeletePoller.FinalResponse` has been removed -- Function `*VirtualMachineScaleSetVMsClientReimagePollerResponse.Resume` has been removed -- Function `*VirtualMachinesClientReapplyPoller.ResumeToken` has been removed -- Function `*GalleryImageVersionsClientCreateOrUpdatePoller.Poll` has been removed -- Function `*VirtualMachineScaleSetVMRunCommandsClientDeletePoller.Poll` has been removed -- Function `*DiskRestorePointClientRevokeAccessPoller.FinalResponse` has been removed -- Function `*CloudServicesClientDeleteInstancesPoller.ResumeToken` has been removed -- Function `*DedicatedHostsClientUpdatePoller.Poll` has been removed -- Function `*VirtualMachineScaleSetVMsClientReimageAllPoller.FinalResponse` has been removed -- Function `*DiskAccessesClientUpdatePollerResponse.Resume` has been removed -- Function `*DiskRestorePointClientRevokeAccessPoller.Poll` has been removed -- Function `CloudServiceRoleInstancesClientRestartPollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachineRunCommandsClientCreateOrUpdatePoller.FinalResponse` has been removed -- Function `*VirtualMachineScaleSetVMsClientUpdatePoller.Poll` has been removed -- Function `*VirtualMachineScaleSetVMsClientRedeployPoller.Done` has been removed -- Function `VirtualMachineScaleSetExtensionsClientCreateOrUpdatePollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachineScaleSetExtensionsClientCreateOrUpdatePoller.FinalResponse` has been removed -- Function `DiffDiskOptions.ToPtr` has been removed -- Function `*VirtualMachinesClientRedeployPoller.Poll` has been removed -- Function `*GalleryImageVersionsClientCreateOrUpdatePoller.ResumeToken` has been removed -- Function `*CloudServicesClientUpdatePoller.Poll` has been removed -- Function `*VirtualMachineScaleSetVMRunCommandsClientUpdatePoller.Poll` has been removed -- Function `*VirtualMachineScaleSetsClientDeallocatePoller.Poll` has been removed -- Function `*DiskRestorePointClientGrantAccessPollerResponse.Resume` has been removed -- Function `StorageAccountTypes.ToPtr` has been removed -- Function `CapacityReservationGroupInstanceViewTypes.ToPtr` has been removed -- Function `CapacityReservationsClientDeletePollerResponse.PollUntilDone` has been removed -- Function `HostCaching.ToPtr` has been removed -- Function `*VirtualMachineScaleSetsClientSetOrchestrationServiceStatePollerResponse.Resume` has been removed -- Function `VirtualMachineScaleSetVMsClientPowerOffPollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachineScaleSetVMExtensionsClientCreateOrUpdatePoller.Done` has been removed -- Function `*GallerySharingProfileClientUpdatePoller.Poll` has been removed -- Function `*VirtualMachineRunCommandsClientListPager.NextPage` has been removed -- Function `*VirtualMachineRunCommandsClientCreateOrUpdatePoller.ResumeToken` has been removed -- Function `*VirtualMachineScaleSetVMsClientUpdatePoller.ResumeToken` has been removed -- Function `*VirtualMachineScaleSetVMRunCommandsClientUpdatePollerResponse.Resume` has been removed -- Function `*VirtualMachineScaleSetVMsClientStartPoller.Done` has been removed -- Function `DedicatedHostsClientCreateOrUpdatePollerResponse.PollUntilDone` has been removed -- Function `*AvailabilitySetsClientListBySubscriptionPager.Err` has been removed -- Function `VirtualMachineScaleSetsClientRedeployPollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachinesClientConvertToManagedDisksPoller.Poll` has been removed -- Function `*CloudServicesUpdateDomainClientWalkUpdateDomainPoller.Done` has been removed -- Function `*VirtualMachineScaleSetVMsClientDeallocatePoller.Done` has been removed -- Function `*VirtualMachineScaleSetVMExtensionsClientUpdatePoller.FinalResponse` has been removed -- Function `*GalleryImagesClientCreateOrUpdatePoller.FinalResponse` has been removed -- Function `VirtualMachineExtensionsClientUpdatePollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachinesClientDeallocatePoller.Poll` has been removed -- Function `CapacityReservationsClientUpdatePollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachineScaleSetsClientReimagePoller.FinalResponse` has been removed -- Function `*SnapshotsClientRevokeAccessPoller.Done` has been removed -- Function `*CloudServicesClientCreateOrUpdatePoller.Done` has been removed -- Function `*CloudServiceRolesClientListPager.Err` has been removed -- Function `*VirtualMachineScaleSetVMRunCommandsClientUpdatePoller.FinalResponse` has been removed -- Function `*VirtualMachinesClientRestartPoller.FinalResponse` has been removed -- Function `*GalleryApplicationVersionsClientDeletePoller.ResumeToken` has been removed -- Function `*DedicatedHostsClientCreateOrUpdatePoller.FinalResponse` has been removed -- Function `DiskDeleteOptionTypes.ToPtr` has been removed -- Function `DeleteOptions.ToPtr` has been removed -- Function `*VirtualMachineScaleSetExtensionsClientCreateOrUpdatePoller.Done` has been removed -- Function `*VirtualMachineScaleSetsClientUpdateInstancesPoller.Poll` has been removed -- Function `*CapacityReservationGroupsClientListByResourceGroupPager.Err` has been removed -- Function `*VirtualMachineScaleSetRollingUpgradesClientStartExtensionUpgradePollerResponse.Resume` has been removed -- Function `*VirtualMachineScaleSetsClientReimagePoller.Poll` has been removed -- Function `NetworkAPIVersion.ToPtr` has been removed -- Function `InstanceViewTypes.ToPtr` has been removed -- Function `*CloudServiceOperatingSystemsClientListOSFamiliesPager.Err` has been removed -- Function `*GalleryApplicationVersionsClientCreateOrUpdatePoller.Poll` has been removed -- Function `SnapshotsClientGrantAccessPollerResponse.PollUntilDone` has been removed -- Function `*CapacityReservationsClientCreateOrUpdatePoller.Poll` has been removed -- Function `RestorePointsClientDeletePollerResponse.PollUntilDone` has been removed -- Function `*DiskAccessesClientUpdateAPrivateEndpointConnectionPoller.Done` has been removed -- Function `*VirtualMachineRunCommandsClientUpdatePoller.Done` has been removed -- Function `GalleryApplicationVersionsClientDeletePollerResponse.PollUntilDone` has been removed -- Function `DiskCreateOptionTypes.ToPtr` has been removed -- Function `VirtualMachinesClientRunCommandPollerResponse.PollUntilDone` has been removed -- Function `*CloudServicesClientRebuildPoller.ResumeToken` has been removed -- Function `RollingUpgradeActionType.ToPtr` has been removed -- Function `AggregatedReplicationState.ToPtr` has been removed -- Function `*CloudServicesClientStartPoller.Poll` has been removed -- Function `*VirtualMachineScaleSetsClientListByLocationPager.PageResponse` has been removed -- Function `*GalleryImageVersionsClientDeletePoller.ResumeToken` has been removed -- Function `*VirtualMachineScaleSetsClientListPager.Err` has been removed -- Function `*VirtualMachineScaleSetsClientCreateOrUpdatePoller.FinalResponse` has been removed -- Function `DiskEncryptionSetsClientUpdatePollerResponse.PollUntilDone` has been removed -- Function `*CloudServicesClientDeleteInstancesPoller.Done` has been removed -- Function `*DiskRestorePointClientGrantAccessPoller.Done` has been removed -- Function `VirtualMachinesClientDeallocatePollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachineScaleSetVMsClientRedeployPoller.Poll` has been removed -- Function `*CloudServicesClientCreateOrUpdatePoller.ResumeToken` has been removed -- Function `*VirtualMachineScaleSetVMsClientRedeployPoller.FinalResponse` has been removed -- Function `*DedicatedHostsClientRestartPoller.Done` has been removed -- Function `*VirtualMachineScaleSetVMsClientDeletePoller.ResumeToken` has been removed -- Function `*VirtualMachinesClientStartPoller.Poll` has been removed -- Function `*CapacityReservationsClientCreateOrUpdatePoller.ResumeToken` has been removed -- Function `*GalleriesClientCreateOrUpdatePoller.FinalResponse` has been removed -- Function `VirtualMachinesClientConvertToManagedDisksPollerResponse.PollUntilDone` has been removed -- Function `*DedicatedHostsClientUpdatePoller.Done` has been removed -- Function `*CloudServicesClientPowerOffPoller.ResumeToken` has been removed -- Function `*SnapshotsClientCreateOrUpdatePoller.Done` has been removed -- Function `*VirtualMachineScaleSetRollingUpgradesClientStartOSUpgradePoller.Poll` has been removed -- Function `*VirtualMachinesClientCreateOrUpdatePoller.Poll` has been removed -- Function `*DiskEncryptionSetsClientListAssociatedResourcesPager.NextPage` has been removed -- Function `*VirtualMachineScaleSetsClientPerformMaintenancePoller.Poll` has been removed -- Function `*VirtualMachineScaleSetVMExtensionsClientUpdatePollerResponse.Resume` has been removed -- Function `*VirtualMachineScaleSetsClientPowerOffPoller.Poll` has been removed -- Function `VirtualMachineScaleSetRollingUpgradesClientCancelPollerResponse.PollUntilDone` has been removed -- Function `*CapacityReservationsClientDeletePoller.Poll` has been removed -- Function `*DisksClientListByResourceGroupPager.NextPage` has been removed -- Function `ImagesClientCreateOrUpdatePollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachinesClientReapplyPoller.FinalResponse` has been removed -- Function `*VirtualMachineExtensionsClientUpdatePoller.Done` has been removed -- Function `*SnapshotsClientDeletePollerResponse.Resume` has been removed -- Function `*GalleryImageVersionsClientUpdatePoller.FinalResponse` has been removed -- Function `*DedicatedHostsClientListByHostGroupPager.Err` has been removed -- Function `*DiskEncryptionSetsClientCreateOrUpdatePoller.ResumeToken` has been removed -- Function `*VirtualMachineScaleSetRollingUpgradesClientStartExtensionUpgradePoller.ResumeToken` has been removed -- Function `*DiskRestorePointClientRevokeAccessPollerResponse.Resume` has been removed -- Function `*DiskRestorePointClientListByRestorePointPager.NextPage` has been removed -- Function `*RestorePointsClientDeletePollerResponse.Resume` has been removed -- Function `VirtualMachineScaleSetsClientStartPollerResponse.PollUntilDone` has been removed -- Function `*DisksClientCreateOrUpdatePoller.FinalResponse` has been removed -- Function `*VirtualMachineScaleSetsClientListPager.PageResponse` has been removed -- Function `*SnapshotsClientListByResourceGroupPager.NextPage` has been removed -- Function `*CloudServicesClientListAllPager.NextPage` has been removed -- Function `*RestorePointsClientCreatePollerResponse.Resume` has been removed -- Function `*GalleryApplicationsClientCreateOrUpdatePoller.Poll` has been removed -- Function `GalleriesClientUpdatePollerResponse.PollUntilDone` has been removed -- Function `*GalleriesClientCreateOrUpdatePollerResponse.Resume` has been removed -- Function `*VirtualMachineScaleSetVMsClientRedeployPollerResponse.Resume` has been removed -- Function `*VirtualMachineScaleSetVMsClientRestartPoller.Poll` has been removed -- Function `*GalleryApplicationVersionsClientUpdatePollerResponse.Resume` has been removed -- Function `*VirtualMachineExtensionsClientDeletePoller.Done` has been removed -- Function `*VirtualMachineScaleSetVMsClientRunCommandPoller.FinalResponse` has been removed -- Function `*SnapshotsClientCreateOrUpdatePollerResponse.Resume` has been removed -- Function `*CloudServicesUpdateDomainClientWalkUpdateDomainPoller.FinalResponse` has been removed -- Function `RepairAction.ToPtr` has been removed -- Function `DiskSecurityTypes.ToPtr` has been removed -- Function `VirtualMachinePriorityTypes.ToPtr` has been removed -- Function `VirtualMachineScaleSetsClientDeallocatePollerResponse.PollUntilDone` has been removed -- Function `*SnapshotsClientGrantAccessPoller.FinalResponse` has been removed -- Function `*VirtualMachineScaleSetsClientDeallocatePoller.FinalResponse` has been removed -- Function `*CloudServiceRoleInstancesClientListPager.PageResponse` has been removed -- Function `*CapacityReservationsClientDeletePoller.FinalResponse` has been removed -- Function `*DiskRestorePointClientGrantAccessPoller.ResumeToken` has been removed -- Function `VirtualMachineScaleSetsClientCreateOrUpdatePollerResponse.PollUntilDone` has been removed -- Function `MaintenanceOperationResultCodeTypes.ToPtr` has been removed -- Function `*SnapshotsClientUpdatePoller.ResumeToken` has been removed -- Function `*GalleriesClientListPager.NextPage` has been removed -- Function `*GalleriesClientDeletePollerResponse.Resume` has been removed -- Function `*VirtualMachinesClientDeallocatePollerResponse.Resume` has been removed -- Function `*VirtualMachineScaleSetsClientPerformMaintenancePoller.FinalResponse` has been removed -- Function `*DisksClientCreateOrUpdatePoller.Done` has been removed -- Function `*SnapshotsClientListPager.Err` has been removed -- Function `*CloudServicesClientStartPollerResponse.Resume` has been removed -- Function `SnapshotsClientDeletePollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachineScaleSetVMExtensionsClientCreateOrUpdatePollerResponse.Resume` has been removed -- Function `*CloudServicesClientCreateOrUpdatePoller.FinalResponse` has been removed -- Function `*DiskRestorePointClientListByRestorePointPager.Err` has been removed -- Function `VirtualMachineScaleSetsClientReimagePollerResponse.PollUntilDone` has been removed -- Function `*CloudServiceOperatingSystemsClientListOSVersionsPager.PageResponse` has been removed -- Function `CloudServicesClientDeleteInstancesPollerResponse.PollUntilDone` has been removed -- Function `IPVersion.ToPtr` has been removed -- Function `*VirtualMachineScaleSetsClientCreateOrUpdatePoller.Poll` has been removed -- Function `*VirtualMachineScaleSetsClientDeleteInstancesPoller.Poll` has been removed -- Function `CloudServicesUpdateDomainClientWalkUpdateDomainPollerResponse.PollUntilDone` has been removed -- Function `StatusLevelTypes.ToPtr` has been removed -- Function `*CloudServicesClientUpdatePollerResponse.Resume` has been removed -- Function `*CloudServicesUpdateDomainClientListUpdateDomainsPager.Err` has been removed -- Function `*DiskEncryptionSetsClientDeletePoller.ResumeToken` has been removed -- Function `*ImagesClientDeletePoller.Poll` has been removed -- Function `*VirtualMachineScaleSetVMsClientDeletePoller.Done` has been removed -- Function `*VirtualMachineScaleSetVMsClientPowerOffPoller.Done` has been removed -- Function `*VirtualMachineScaleSetRollingUpgradesClientCancelPollerResponse.Resume` has been removed -- Function `*CloudServicesUpdateDomainClientListUpdateDomainsPager.NextPage` has been removed -- Function `*VirtualMachinesClientAssessPatchesPoller.Done` has been removed -- Function `*DedicatedHostsClientUpdatePoller.FinalResponse` has been removed -- Function `*VirtualMachinesClientCreateOrUpdatePoller.Done` has been removed -- Function `GalleryExpandParams.ToPtr` has been removed -- Function `*VirtualMachineScaleSetVMsClientRestartPoller.ResumeToken` has been removed -- Function `*DisksClientGrantAccessPoller.Poll` has been removed -- Function `*VirtualMachineExtensionsClientDeletePoller.Poll` has been removed -- Function `*VirtualMachineScaleSetVMsClientPowerOffPollerResponse.Resume` has been removed -- Function `*VirtualMachineScaleSetVMsClientListPager.PageResponse` has been removed -- Function `*CloudServiceRoleInstancesClientRestartPollerResponse.Resume` has been removed -- Function `*CloudServiceRolesClientListPager.PageResponse` has been removed -- Function `*SharedGalleryImagesClientListPager.PageResponse` has been removed -- Function `*VirtualMachineScaleSetRollingUpgradesClientStartOSUpgradePoller.Done` has been removed -- Function `*VirtualMachinesClientAssessPatchesPoller.FinalResponse` has been removed -- Function `ExecutionState.ToPtr` has been removed -- Function `*CapacityReservationsClientCreateOrUpdatePoller.FinalResponse` has been removed -- Function `VirtualMachineScaleSetScaleInRules.ToPtr` has been removed -- Function `*CloudServicesClientListPager.PageResponse` has been removed -- Function `*GalleriesClientListPager.Err` has been removed -- Function `SharingUpdateOperationTypes.ToPtr` has been removed -- Function `*CapacityReservationsClientUpdatePoller.Done` has been removed -- Function `*VirtualMachinesClientInstallPatchesPoller.Poll` has been removed -- Function `*GalleryApplicationVersionsClientDeletePoller.Done` has been removed -- Function `*VirtualMachinesClientUpdatePoller.Done` has been removed -- Function `*VirtualMachinesClientRunCommandPoller.Done` has been removed -- Function `*DiskAccessesClientDeleteAPrivateEndpointConnectionPoller.Done` has been removed -- Function `*VirtualMachineScaleSetRollingUpgradesClientStartExtensionUpgradePoller.Done` has been removed -- Function `*DiskEncryptionSetsClientListAssociatedResourcesPager.PageResponse` has been removed -- Function `*CloudServicesClientDeleteInstancesPollerResponse.Resume` has been removed -- Function `*GalleryApplicationVersionsClientCreateOrUpdatePollerResponse.Resume` has been removed -- Function `*DiskRestorePointClientRevokeAccessPoller.Done` has been removed -- Function `*RestorePointCollectionsClientListAllPager.PageResponse` has been removed -- Function `*DisksClientDeletePoller.Done` has been removed -- Function `*VirtualMachineScaleSetVMsClientReimagePoller.ResumeToken` has been removed -- Function `*CloudServicesClientDeletePoller.Poll` has been removed -- Function `*VirtualMachineScaleSetVMRunCommandsClientUpdatePoller.ResumeToken` has been removed -- Function `GalleryApplicationsClientCreateOrUpdatePollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachineScaleSetsClientReimagePoller.Done` has been removed -- Function `*DisksClientRevokeAccessPoller.FinalResponse` has been removed -- Function `CloudServicesClientPowerOffPollerResponse.PollUntilDone` has been removed -- Function `DataAccessAuthMode.ToPtr` has been removed -- Function `*VirtualMachineScaleSetVMsClientDeletePollerResponse.Resume` has been removed -- Function `*SnapshotsClientGrantAccessPoller.Done` has been removed -- Function `*VirtualMachinesClientConvertToManagedDisksPollerResponse.Resume` has been removed -- Function `*CapacityReservationsClientUpdatePoller.FinalResponse` has been removed -- Function `*VirtualMachinesClientPerformMaintenancePoller.Poll` has been removed -- Function `*RestorePointsClientDeletePoller.ResumeToken` has been removed -- Function `AvailabilitySetSKUTypes.ToPtr` has been removed -- Function `*VirtualMachinesClientAssessPatchesPoller.ResumeToken` has been removed -- Function `*DiskAccessesClientListPrivateEndpointConnectionsPager.PageResponse` has been removed -- Function `*GalleryApplicationsClientCreateOrUpdatePoller.ResumeToken` has been removed -- Function `*DisksClientUpdatePoller.Done` has been removed -- Function `VirtualMachineScaleSetVMsClientDeletePollerResponse.PollUntilDone` has been removed -- Function `*GalleriesClientCreateOrUpdatePoller.Done` has been removed -- Function `*VirtualMachinesClientInstallPatchesPoller.FinalResponse` has been removed -- Function `*CapacityReservationsClientUpdatePoller.ResumeToken` has been removed -- Function `*DisksClientListPager.NextPage` has been removed -- Function `*CloudServiceRolesClientListPager.NextPage` has been removed -- Function `*CloudServiceRoleInstancesClientReimagePoller.FinalResponse` has been removed -- Function `*SnapshotsClientCreateOrUpdatePoller.Poll` has been removed -- Function `*GalleryImagesClientListByGalleryPager.NextPage` has been removed -- Function `*VirtualMachineScaleSetsClientPowerOffPollerResponse.Resume` has been removed -- Function `*CloudServicesClientListPager.NextPage` has been removed -- Function `SharedToValues.ToPtr` has been removed -- Function `*DiskEncryptionSetsClientDeletePoller.Poll` has been removed -- Function `GalleryApplicationsClientDeletePollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachineScaleSetsClientStartPollerResponse.Resume` has been removed -- Function `CloudServicesClientCreateOrUpdatePollerResponse.PollUntilDone` has been removed -- Function `VirtualMachineScaleSetVMExtensionsClientDeletePollerResponse.PollUntilDone` has been removed -- Function `*GalleryImagesClientCreateOrUpdatePoller.ResumeToken` has been removed -- Function `*DisksClientDeletePoller.Poll` has been removed -- Function `*DedicatedHostGroupsClientListBySubscriptionPager.Err` has been removed -- Function `VirtualMachineScaleSetsClientUpdateInstancesPollerResponse.PollUntilDone` has been removed -- Function `*AvailabilitySetsClientListBySubscriptionPager.PageResponse` has been removed -- Function `*VirtualMachineScaleSetsClientListSKUsPager.NextPage` has been removed -- Function `*VirtualMachinesClientInstallPatchesPollerResponse.Resume` has been removed -- Function `ExtendedLocationTypes.ToPtr` has been removed -- Function `*DiskEncryptionSetsClientListPager.Err` has been removed -- Function `*VirtualMachinesClientDeletePoller.Done` has been removed -- Function `*CloudServicesClientStartPoller.ResumeToken` has been removed -- Function `VMGuestPatchRebootSetting.ToPtr` has been removed -- Function `*ImagesClientDeletePoller.ResumeToken` has been removed -- Function `*DiskAccessesClientUpdatePoller.ResumeToken` has been removed -- Function `*VirtualMachineScaleSetVMExtensionsClientUpdatePoller.Done` has been removed -- Function `CloudServiceUpgradeMode.ToPtr` has been removed -- Function `*CloudServiceRoleInstancesClientReimagePoller.Poll` has been removed -- Function `*VirtualMachineScaleSetVMsClientRunCommandPollerResponse.Resume` has been removed -- Function `*ImagesClientUpdatePoller.ResumeToken` has been removed -- Function `VirtualMachinesClientRestartPollerResponse.PollUntilDone` has been removed -- Function `*GalleryApplicationsClientDeletePoller.Poll` has been removed -- Function `VirtualMachineScaleSetVMsClientRestartPollerResponse.PollUntilDone` has been removed -- Function `DisksClientRevokeAccessPollerResponse.PollUntilDone` has been removed -- Function `*CloudServicesClientStartPoller.FinalResponse` has been removed -- Function `*LogAnalyticsClientExportThrottledRequestsPoller.ResumeToken` has been removed -- Function `*VirtualMachineScaleSetVMsClientReimageAllPollerResponse.Resume` has been removed -- Function `*GalleryApplicationVersionsClientDeletePollerResponse.Resume` has been removed -- Function `*VirtualMachineScaleSetsClientListByLocationPager.NextPage` has been removed -- Function `*VirtualMachineScaleSetsClientDeletePoller.Done` has been removed -- Function `*CloudServicesClientUpdatePoller.FinalResponse` has been removed -- Function `CloudServicesClientRestartPollerResponse.PollUntilDone` has been removed -- Function `*DisksClientGrantAccessPoller.FinalResponse` has been removed -- Function `DiskEncryptionSetType.ToPtr` has been removed -- Function `*GalleryImagesClientDeletePoller.Poll` has been removed -- Function `*VirtualMachineScaleSetsClientDeallocatePollerResponse.Resume` has been removed -- Function `*LogAnalyticsClientExportRequestRateByIntervalPoller.FinalResponse` has been removed -- Function `HyperVGeneration.ToPtr` has been removed -- Function `*ResourceSKUsClientListPager.NextPage` has been removed -- Function `*DedicatedHostsClientCreateOrUpdatePoller.Poll` has been removed -- Function `*VirtualMachinesClientPerformMaintenancePollerResponse.Resume` has been removed -- Function `*GalleryApplicationsClientDeletePoller.Done` has been removed -- Function `*ImagesClientDeletePoller.Done` has been removed -- Function `*VirtualMachineScaleSetRollingUpgradesClientCancelPoller.Done` has been removed -- Function `*GalleryImagesClientListByGalleryPager.PageResponse` has been removed -- Function `VirtualMachineScaleSetsClientDeletePollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachineRunCommandsClientDeletePoller.ResumeToken` has been removed -- Function `*SnapshotsClientUpdatePollerResponse.Resume` has been removed -- Function `*CloudServicesClientUpdatePoller.ResumeToken` has been removed -- Function `*GalleryApplicationsClientUpdatePoller.FinalResponse` has been removed -- Function `*ImagesClientCreateOrUpdatePollerResponse.Resume` has been removed -- Function `*DisksClientListByResourceGroupPager.Err` has been removed -- Function `*VirtualMachinesClientReimagePollerResponse.Resume` has been removed -- Function `*CloudServicesClientRestartPollerResponse.Resume` has been removed -- Function `*CloudServicesClientListAllPager.Err` has been removed -- Function `CloudServiceRoleInstancesClientRebuildPollerResponse.PollUntilDone` has been removed -- Function `DiskRestorePointClientRevokeAccessPollerResponse.PollUntilDone` has been removed -- Function `*GalleryImageVersionsClientListByGalleryImagePager.PageResponse` has been removed -- Function `LinuxVMGuestPatchMode.ToPtr` has been removed -- Function `VMGuestPatchClassificationWindows.ToPtr` has been removed -- Function `VirtualMachinesClientUpdatePollerResponse.PollUntilDone` has been removed -- Function `DisksClientUpdatePollerResponse.PollUntilDone` has been removed -- Function `*CloudServiceRoleInstancesClientRebuildPoller.ResumeToken` has been removed -- Function `*GalleryImagesClientDeletePoller.ResumeToken` has been removed -- Function `ReplicationMode.ToPtr` has been removed -- Function `*AvailabilitySetsClientListBySubscriptionPager.NextPage` has been removed -- Function `*ProximityPlacementGroupsClientListBySubscriptionPager.PageResponse` has been removed -- Function `*CloudServiceRoleInstancesClientRebuildPoller.Done` has been removed -- Function `*RestorePointsClientCreatePoller.Done` has been removed -- Function `*VirtualMachineScaleSetsClientPerformMaintenancePoller.ResumeToken` has been removed -- Function `SnapshotsClientCreateOrUpdatePollerResponse.PollUntilDone` has been removed -- Function `RestorePointCollectionsClientDeletePollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachineScaleSetExtensionsClientListPager.Err` has been removed -- Function `*RestorePointCollectionsClientListPager.NextPage` has been removed -- Function `*VirtualMachinesClientAssessPatchesPollerResponse.Resume` has been removed -- Function `*VirtualMachineScaleSetVMsClientDeallocatePollerResponse.Resume` has been removed -- Function `*DedicatedHostsClientDeletePoller.Done` has been removed -- Function `*DisksClientDeletePoller.FinalResponse` has been removed -- Function `*SnapshotsClientListByResourceGroupPager.Err` has been removed -- Function `VirtualMachineExtensionsClientDeletePollerResponse.PollUntilDone` has been removed -- Function `*GalleriesClientUpdatePollerResponse.Resume` has been removed -- Function `SettingNames.ToPtr` has been removed -- Function `UpgradeMode.ToPtr` has been removed -- Function `*DisksClientUpdatePoller.ResumeToken` has been removed -- Function `*SharedGalleriesClientListPager.PageResponse` has been removed -- Function `*VirtualMachinesClientInstallPatchesPoller.ResumeToken` has been removed -- Function `*VirtualMachineScaleSetsClientReimageAllPoller.FinalResponse` has been removed -- Function `DiskEncryptionSetIdentityType.ToPtr` has been removed -- Function `*GalleriesClientCreateOrUpdatePoller.Poll` has been removed -- Function `*SnapshotsClientRevokeAccessPoller.FinalResponse` has been removed -- Function `*VirtualMachineScaleSetVMRunCommandsClientCreateOrUpdatePoller.FinalResponse` has been removed -- Function `*VirtualMachineScaleSetVMsClientDeallocatePoller.FinalResponse` has been removed -- Function `*VirtualMachineScaleSetVMRunCommandsClientDeletePoller.FinalResponse` has been removed -- Function `ResourceIdentityType.ToPtr` has been removed -- Function `PublicIPAddressSKUTier.ToPtr` has been removed -- Function `*CloudServicesUpdateDomainClientWalkUpdateDomainPoller.Poll` has been removed -- Function `CapacityReservationInstanceViewTypes.ToPtr` has been removed -- Function `*VirtualMachinesClientUpdatePoller.ResumeToken` has been removed -- Function `*CapacityReservationsClientCreateOrUpdatePollerResponse.Resume` has been removed -- Function `*VirtualMachineExtensionsClientUpdatePoller.ResumeToken` has been removed -- Function `*VirtualMachineScaleSetsClientPerformMaintenancePollerResponse.Resume` has been removed -- Function `*GalleryImageVersionsClientCreateOrUpdatePoller.Done` has been removed -- Function `*VirtualMachineRunCommandsClientDeletePollerResponse.Resume` has been removed -- Function `*VirtualMachineScaleSetVMExtensionsClientCreateOrUpdatePoller.FinalResponse` has been removed -- Function `*VirtualMachinesClientCapturePoller.Poll` has been removed -- Function `*VirtualMachineScaleSetVMsClientUpdatePoller.Done` has been removed -- Function `*SSHPublicKeysClientListBySubscriptionPager.PageResponse` has been removed -- Function `*VirtualMachineScaleSetsClientUpdatePoller.ResumeToken` has been removed -- Function `*DiskAccessesClientUpdateAPrivateEndpointConnectionPoller.ResumeToken` has been removed -- Function `*DiskRestorePointClientRevokeAccessPoller.ResumeToken` has been removed -- Function `*VirtualMachineScaleSetExtensionsClientCreateOrUpdatePoller.Poll` has been removed -- Function `*DiskAccessesClientDeleteAPrivateEndpointConnectionPoller.Poll` has been removed -- Function `*VirtualMachineScaleSetsClientRestartPoller.Poll` has been removed -- Function `*CloudServiceRoleInstancesClientRebuildPoller.Poll` has been removed -- Function `*ImagesClientListPager.Err` has been removed -- Function `*VirtualMachineScaleSetsClientRestartPoller.ResumeToken` has been removed -- Function `*CloudServicesClientDeletePollerResponse.Resume` has been removed -- Function `*DisksClientCreateOrUpdatePoller.Poll` has been removed -- Function `*SnapshotsClientUpdatePoller.Poll` has been removed -- Function `*CloudServicesUpdateDomainClientListUpdateDomainsPager.PageResponse` has been removed -- Function `ResourceSKUCapacityScaleType.ToPtr` has been removed -- Function `VirtualMachineScaleSetsClientSetOrchestrationServiceStatePollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachinesClientRedeployPoller.ResumeToken` has been removed -- Function `*SnapshotsClientUpdatePoller.FinalResponse` has been removed -- Function `*DedicatedHostsClientCreateOrUpdatePollerResponse.Resume` has been removed -- Function `*GalleryApplicationsClientDeletePoller.ResumeToken` has been removed -- Function `PrivateEndpointConnectionProvisioningState.ToPtr` has been removed -- Function `SecurityTypes.ToPtr` has been removed -- Function `*ImagesClientDeletePollerResponse.Resume` has been removed -- Function `*GalleryApplicationsClientCreateOrUpdatePollerResponse.Resume` has been removed -- Function `*GalleryApplicationsClientCreateOrUpdatePoller.Done` has been removed -- Function `*CloudServicesClientRebuildPoller.Poll` has been removed -- Function `*VirtualMachineScaleSetVMsClientPerformMaintenancePoller.Done` has been removed -- Function `*VirtualMachineScaleSetVMsClientListPager.Err` has been removed -- Function `*CloudServiceRoleInstancesClientRestartPoller.Poll` has been removed -- Function `*DedicatedHostsClientRestartPoller.FinalResponse` has been removed -- Function `*ImagesClientListByResourceGroupPager.NextPage` has been removed -- Function `*VirtualMachinesClientRedeployPoller.Done` has been removed -- Function `*VirtualMachineScaleSetExtensionsClientUpdatePoller.Done` has been removed -- Function `*VirtualMachinesClientDeallocatePoller.FinalResponse` has been removed -- Function `*VirtualMachinesClientUpdatePoller.FinalResponse` has been removed -- Function `*CloudServiceRoleInstancesClientDeletePoller.ResumeToken` has been removed -- Function `*DiskRestorePointClientGrantAccessPoller.Poll` has been removed -- Function `*GallerySharingProfileClientUpdatePoller.Done` has been removed -- Function `*VirtualMachinesClientListByLocationPager.Err` has been removed -- Function `*GalleriesClientUpdatePoller.ResumeToken` has been removed -- Function `*VirtualMachineScaleSetExtensionsClientUpdatePoller.ResumeToken` has been removed -- Function `VirtualMachinesClientCapturePollerResponse.PollUntilDone` has been removed -- Function `CloudServiceRoleInstancesClientReimagePollerResponse.PollUntilDone` has been removed -- Function `*DisksClientGrantAccessPoller.ResumeToken` has been removed -- Function `VirtualMachinesClientRedeployPollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachineScaleSetsClientListSKUsPager.Err` has been removed -- Function `*VirtualMachineScaleSetVMRunCommandsClientListPager.Err` has been removed -- Function `*VirtualMachineScaleSetVMExtensionsClientCreateOrUpdatePoller.ResumeToken` has been removed -- Function `*VirtualMachineScaleSetsClientUpdatePoller.FinalResponse` has been removed -- Function `*VirtualMachineScaleSetsClientUpdateInstancesPoller.Done` has been removed -- Function `ProximityPlacementGroupType.ToPtr` has been removed -- Function `*RestorePointCollectionsClientListPager.PageResponse` has been removed -- Function `*DiskAccessesClientCreateOrUpdatePoller.Done` has been removed -- Function `*VirtualMachineRunCommandsClientUpdatePoller.ResumeToken` has been removed -- Function `*DisksClientUpdatePollerResponse.Resume` has been removed -- Function `*DiskEncryptionSetsClientListAssociatedResourcesPager.Err` has been removed -- Function `*CloudServicesClientDeletePoller.FinalResponse` has been removed -- Function `*DisksClientListPager.PageResponse` has been removed -- Function `CapacityReservationsClientCreateOrUpdatePollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachineScaleSetExtensionsClientUpdatePoller.Poll` has been removed -- Function `*DiskEncryptionSetsClientCreateOrUpdatePoller.Poll` has been removed -- Function `*CloudServicesClientCreateOrUpdatePoller.Poll` has been removed -- Function `VirtualMachineScaleSetVMsClientRunCommandPollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachinesClientRestartPoller.Done` has been removed -- Function `GalleryApplicationsClientUpdatePollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachinesClientReapplyPollerResponse.Resume` has been removed -- Function `*VirtualMachinesClientConvertToManagedDisksPoller.ResumeToken` has been removed -- Function `*VirtualMachinesClientStartPoller.Done` has been removed -- Function `GalleryImageVersionsClientUpdatePollerResponse.PollUntilDone` has been removed -- Function `CloudServicesClientStartPollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachinesClientDeletePoller.ResumeToken` has been removed -- Function `VMGuestPatchRebootStatus.ToPtr` has been removed -- Function `*VirtualMachineScaleSetVMsClientPerformMaintenancePollerResponse.Resume` has been removed -- Function `*VirtualMachinesClientDeallocatePoller.Done` has been removed -- Function `*VirtualMachinesClientReimagePoller.FinalResponse` has been removed -- Function `*VirtualMachineExtensionsClientDeletePoller.ResumeToken` has been removed -- Function `*VirtualMachineScaleSetsClientListSKUsPager.PageResponse` has been removed -- Function `*CloudServiceRoleInstancesClientRebuildPollerResponse.Resume` has been removed -- Function `*DiskEncryptionSetsClientCreateOrUpdatePoller.Done` has been removed -- Function `*VirtualMachinesClientInstallPatchesPoller.Done` has been removed -- Function `*GalleryImageVersionsClientDeletePollerResponse.Resume` has been removed -- Function `VirtualMachinesClientPowerOffPollerResponse.PollUntilDone` has been removed -- Function `*CloudServicesClientRestartPoller.Poll` has been removed -- Function `OrchestrationServiceStateAction.ToPtr` has been removed -- Function `*VirtualMachineScaleSetVMsClientDeletePoller.FinalResponse` has been removed -- Function `*VirtualMachineScaleSetsClientPowerOffPoller.Done` has been removed -- Function `*LogAnalyticsClientExportRequestRateByIntervalPollerResponse.Resume` has been removed -- Function `OperatingSystemStateTypes.ToPtr` has been removed -- Function `CloudServicesClientDeletePollerResponse.PollUntilDone` has been removed -- Function `*SnapshotsClientCreateOrUpdatePoller.FinalResponse` has been removed -- Function `DiskStorageAccountTypes.ToPtr` has been removed -- Function `GalleryImageVersionsClientCreateOrUpdatePollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachinesClientPowerOffPoller.Poll` has been removed -- Function `*GalleryImageVersionsClientDeletePoller.Poll` has been removed -- Function `*CloudServiceRoleInstancesClientRestartPoller.FinalResponse` has been removed -- Function `*VirtualMachineScaleSetsClientReimageAllPoller.Poll` has been removed -- Function `WindowsVMGuestPatchMode.ToPtr` has been removed -- Function `*DisksClientGrantAccessPollerResponse.Resume` has been removed -- Function `ArchitectureTypes.ToPtr` has been removed -- Function `GalleryImageVersionsClientDeletePollerResponse.PollUntilDone` has been removed -- Function `*DedicatedHostsClientListByHostGroupPager.NextPage` has been removed -- Function `*CloudServicesClientReimagePoller.ResumeToken` has been removed -- Function `*DedicatedHostsClientCreateOrUpdatePoller.ResumeToken` has been removed -- Function `*DiskAccessesClientCreateOrUpdatePoller.ResumeToken` has been removed -- Function `*VirtualMachineRunCommandsClientListPager.PageResponse` has been removed -- Function `*GalleriesClientUpdatePoller.FinalResponse` has been removed -- Function `DiskAccessesClientCreateOrUpdatePollerResponse.PollUntilDone` has been removed -- Function `*DiskAccessesClientUpdateAPrivateEndpointConnectionPoller.Poll` has been removed -- Function `DiskDetachOptionTypes.ToPtr` has been removed -- Function `DiskState.ToPtr` has been removed -- Function `*DiskEncryptionSetsClientCreateOrUpdatePollerResponse.Resume` has been removed -- Function `PatchOperationStatus.ToPtr` has been removed -- Function `*CloudServiceRoleInstancesClientDeletePoller.Poll` has been removed -- Function `*VirtualMachinesClientCapturePoller.Done` has been removed -- Function `*DiskAccessesClientUpdatePoller.Done` has been removed -- Function `*CloudServiceRoleInstancesClientListPager.Err` has been removed -- Function `LinuxPatchAssessmentMode.ToPtr` has been removed -- Function `SharingProfileGroupTypes.ToPtr` has been removed -- Function `*GalleryImageVersionsClientCreateOrUpdatePollerResponse.Resume` has been removed -- Function `VirtualMachineScaleSetExtensionsClientUpdatePollerResponse.PollUntilDone` has been removed -- Function `VirtualMachineRunCommandsClientDeletePollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachineRunCommandsClientDeletePoller.Poll` has been removed -- Function `*DedicatedHostGroupsClientListBySubscriptionPager.PageResponse` has been removed -- Function `*RestorePointCollectionsClientDeletePoller.Done` has been removed -- Function `GallerySharingProfileClientUpdatePollerResponse.PollUntilDone` has been removed -- Function `*CloudServicesClientRestartPoller.ResumeToken` has been removed -- Function `VirtualMachinesClientReapplyPollerResponse.PollUntilDone` has been removed -- Function `DiskEncryptionSetsClientCreateOrUpdatePollerResponse.PollUntilDone` has been removed -- Function `RestorePointCollectionExpandOptions.ToPtr` has been removed -- Function `*VirtualMachineScaleSetVMExtensionsClientUpdatePoller.Poll` has been removed -- Function `*CloudServiceOperatingSystemsClientListOSVersionsPager.NextPage` has been removed -- Function `*VirtualMachineScaleSetExtensionsClientDeletePoller.Done` has been removed -- Function `*VirtualMachineScaleSetsClientUpdateInstancesPoller.ResumeToken` has been removed -- Function `*DiskAccessesClientCreateOrUpdatePoller.FinalResponse` has been removed -- Function `ImagesClientUpdatePollerResponse.PollUntilDone` has been removed -- Function `*DisksClientRevokeAccessPoller.Done` has been removed -- Function `*VirtualMachineScaleSetsClientReimageAllPollerResponse.Resume` has been removed -- Function `*GalleryApplicationsClientListByGalleryPager.NextPage` has been removed -- Function `*VirtualMachineScaleSetRollingUpgradesClientCancelPoller.FinalResponse` has been removed -- Function `*GalleryImagesClientCreateOrUpdatePoller.Poll` has been removed -- Function `*VirtualMachineScaleSetVMsClientReimagePoller.Poll` has been removed -- Function `ExpandTypesForGetVMScaleSets.ToPtr` has been removed -- Function `*VirtualMachineRunCommandsClientDeletePoller.FinalResponse` has been removed -- Function `*VirtualMachineScaleSetsClientStartPoller.Done` has been removed -- Function `*VirtualMachinesClientListByLocationPager.NextPage` has been removed -- Function `*VirtualMachineScaleSetsClientPerformMaintenancePoller.Done` has been removed -- Function `*VirtualMachineScaleSetExtensionsClientListPager.NextPage` has been removed -- Function `*VirtualMachineScaleSetsClientDeleteInstancesPollerResponse.Resume` has been removed -- Function `*VirtualMachineScaleSetsClientSetOrchestrationServiceStatePoller.Done` has been removed -- Function `LogAnalyticsClientExportRequestRateByIntervalPollerResponse.PollUntilDone` has been removed -- Function `*GalleryImageVersionsClientUpdatePoller.ResumeToken` has been removed -- Function `*VirtualMachineScaleSetVMsClientReimageAllPoller.ResumeToken` has been removed -- Function `*CloudServiceRoleInstancesClientReimagePoller.ResumeToken` has been removed -- Function `*VirtualMachineScaleSetsClientSetOrchestrationServiceStatePoller.ResumeToken` has been removed -- Function `*VirtualMachineScaleSetVMsClientPerformMaintenancePoller.FinalResponse` has been removed -- Function `*VirtualMachineScaleSetsClientSetOrchestrationServiceStatePoller.Poll` has been removed -- Function `HyperVGenerationTypes.ToPtr` has been removed -- Function `VirtualMachineScaleSetRollingUpgradesClientStartExtensionUpgradePollerResponse.PollUntilDone` has been removed -- Function `Architecture.ToPtr` has been removed -- Function `PublicIPAddressSKUName.ToPtr` has been removed -- Function `VirtualMachineScaleSetVMsClientDeallocatePollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachineScaleSetsClientCreateOrUpdatePoller.Done` has been removed -- Function `*CapacityReservationsClientListByCapacityReservationGroupPager.Err` has been removed -- Function `*VirtualMachinesClientListPager.Err` has been removed -- Function `*DedicatedHostsClientRestartPoller.Poll` has been removed -- Function `*VirtualMachineScaleSetExtensionsClientCreateOrUpdatePoller.ResumeToken` has been removed -- Function `*DisksClientDeletePoller.ResumeToken` has been removed -- Function `*VirtualMachineScaleSetExtensionsClientDeletePoller.ResumeToken` has been removed -- Function `*GalleryApplicationVersionsClientDeletePoller.Poll` has been removed -- Function `*DiskAccessesClientListPager.NextPage` has been removed -- Function `*DiskAccessesClientListByResourceGroupPager.Err` has been removed -- Function `*VirtualMachinesClientCreateOrUpdatePollerResponse.Resume` has been removed -- Function `*VirtualMachineScaleSetsClientRedeployPollerResponse.Resume` has been removed -- Function `*VirtualMachineScaleSetVMsClientPowerOffPoller.Poll` has been removed -- Function `*RestorePointsClientDeletePoller.Poll` has been removed -- Function `*ImagesClientCreateOrUpdatePoller.Poll` has been removed -- Function `*GalleryImageVersionsClientListByGalleryImagePager.Err` has been removed -- Function `*DiskEncryptionSetsClientListByResourceGroupPager.PageResponse` has been removed -- Function `*GalleryApplicationsClientDeletePollerResponse.Resume` has been removed -- Function `*GalleriesClientUpdatePoller.Done` has been removed -- Function `*CapacityReservationGroupsClientListByResourceGroupPager.NextPage` has been removed -- Function `*VirtualMachineScaleSetVMsClientReimageAllPoller.Done` has been removed -- Function `*VirtualMachineScaleSetsClientReimagePollerResponse.Resume` has been removed -- Function `*LogAnalyticsClientExportRequestRateByIntervalPoller.Poll` has been removed -- Function `*VirtualMachineScaleSetRollingUpgradesClientStartOSUpgradePoller.ResumeToken` has been removed -- Function `*DedicatedHostsClientRestartPoller.ResumeToken` has been removed -- Function `SnapshotStorageAccountTypes.ToPtr` has been removed -- Function `VirtualMachineRunCommandsClientCreateOrUpdatePollerResponse.PollUntilDone` has been removed -- Function `*RestorePointCollectionsClientDeletePoller.FinalResponse` has been removed -- Function `*CloudServiceRoleInstancesClientRestartPoller.ResumeToken` has been removed -- Function `DisksClientCreateOrUpdatePollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachineScaleSetVMsClientRedeployPoller.ResumeToken` has been removed -- Function `*VirtualMachineScaleSetsClientListAllPager.Err` has been removed -- Function `*GalleryApplicationVersionsClientUpdatePoller.Done` has been removed -- Function `*LogAnalyticsClientExportThrottledRequestsPoller.Done` has been removed -- Function `DisksClientDeletePollerResponse.PollUntilDone` has been removed -- Function `*CloudServicesClientPowerOffPoller.Poll` has been removed -- Function `*GalleryApplicationVersionsClientUpdatePoller.Poll` has been removed -- Function `*ImagesClientListPager.PageResponse` has been removed -- Function `AccessLevel.ToPtr` has been removed -- Function `*VirtualMachineScaleSetVMRunCommandsClientCreateOrUpdatePoller.Poll` has been removed -- Function `DiskCreateOption.ToPtr` has been removed -- Function `*DedicatedHostsClientCreateOrUpdatePoller.Done` has been removed -- Function `VirtualMachineScaleSetVMsClientPerformMaintenancePollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachineScaleSetsClientRedeployPoller.ResumeToken` has been removed -- Function `*LogAnalyticsClientExportRequestRateByIntervalPoller.ResumeToken` has been removed -- Function `VirtualMachineScaleSetVMRunCommandsClientUpdatePollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachineScaleSetVMRunCommandsClientDeletePoller.Done` has been removed -- Function `*LogAnalyticsClientExportRequestRateByIntervalPoller.Done` has been removed -- Function `*DiskAccessesClientUpdateAPrivateEndpointConnectionPoller.FinalResponse` has been removed -- Function `*CloudServicesClientListPager.Err` has been removed -- Function `*VirtualMachineScaleSetsClientListPager.NextPage` has been removed -- Function `*VirtualMachineScaleSetsClientPowerOffPoller.FinalResponse` has been removed -- Function `*RestorePointCollectionsClientListAllPager.Err` has been removed -- Function `VirtualMachineEvictionPolicyTypes.ToPtr` has been removed -- Function `*ProximityPlacementGroupsClientListBySubscriptionPager.NextPage` has been removed -- Function `*VirtualMachineScaleSetVMExtensionsClientUpdatePoller.ResumeToken` has been removed -- Function `*DisksClientListPager.Err` has been removed -- Function `*ProximityPlacementGroupsClientListByResourceGroupPager.PageResponse` has been removed -- Function `*DisksClientRevokeAccessPollerResponse.Resume` has been removed -- Function `*CloudServiceRoleInstancesClientReimagePollerResponse.Resume` has been removed -- Function `GalleryImagesClientUpdatePollerResponse.PollUntilDone` has been removed -- Function `*GalleriesClientDeletePoller.Poll` has been removed -- Function `*DiskAccessesClientListByResourceGroupPager.PageResponse` has been removed -- Function `SnapshotsClientUpdatePollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachineScaleSetsClientPowerOffPoller.ResumeToken` has been removed -- Function `*UsageClientListPager.Err` has been removed -- Function `PublicIPAllocationMethod.ToPtr` has been removed -- Function `*SharedGalleryImageVersionsClientListPager.Err` has been removed -- Function `*VirtualMachinesClientListAllPager.NextPage` has been removed -- Function `*VirtualMachinesClientRunCommandPollerResponse.Resume` has been removed -- Function `StorageAccountType.ToPtr` has been removed -- Function `*GalleryImageVersionsClientUpdatePoller.Done` has been removed -- Function `GalleryApplicationVersionPropertiesProvisioningState.ToPtr` has been removed -- Function `*RestorePointCollectionsClientListPager.Err` has been removed -- Function `*CapacityReservationGroupsClientListBySubscriptionPager.Err` has been removed -- Function `*RestorePointsClientCreatePoller.ResumeToken` has been removed -- Function `*CloudServicesClientCreateOrUpdatePollerResponse.Resume` has been removed -- Function `SnapshotsClientRevokeAccessPollerResponse.PollUntilDone` has been removed -- Function `*DedicatedHostsClientListByHostGroupPager.PageResponse` has been removed -- Function `*SnapshotsClientDeletePoller.Poll` has been removed -- Function `*VirtualMachineScaleSetsClientRestartPollerResponse.Resume` has been removed -- Function `IPVersions.ToPtr` has been removed -- Function `VirtualMachineScaleSetVMsClientReimagePollerResponse.PollUntilDone` has been removed -- Function `*DedicatedHostsClientDeletePoller.Poll` has been removed -- Function `PublicNetworkAccess.ToPtr` has been removed -- Function `CloudServiceRoleInstancesClientDeletePollerResponse.PollUntilDone` has been removed -- Function `VirtualMachineScaleSetVMRunCommandsClientCreateOrUpdatePollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachineScaleSetVMRunCommandsClientListPager.PageResponse` has been removed -- Function `PatchAssessmentState.ToPtr` has been removed -- Function `*GalleryApplicationsClientUpdatePollerResponse.Resume` has been removed -- Function `*VirtualMachineScaleSetsClientRedeployPoller.Done` has been removed -- Function `*GallerySharingProfileClientUpdatePoller.ResumeToken` has been removed -- Function `*CloudServicesClientReimagePoller.Done` has been removed -- Function `*VirtualMachineScaleSetVMsClientReimageAllPoller.Poll` has been removed -- Function `*CloudServicesClientListAllPager.PageResponse` has been removed -- Function `*VirtualMachinesClientReimagePoller.ResumeToken` has been removed -- Function `*VirtualMachinesClientListAllPager.Err` has been removed -- Function `ResourceSKURestrictionsReasonCode.ToPtr` has been removed -- Function `*VirtualMachineScaleSetRollingUpgradesClientStartOSUpgradePollerResponse.Resume` has been removed -- Function `UpgradeState.ToPtr` has been removed -- Function `*VirtualMachinesClientConvertToManagedDisksPoller.FinalResponse` has been removed -- Function `*VirtualMachinesClientCapturePoller.FinalResponse` has been removed -- Function `*GalleryApplicationVersionsClientListByGalleryApplicationPager.PageResponse` has been removed -- Function `*DedicatedHostsClientUpdatePoller.ResumeToken` has been removed -- Function `*VirtualMachineScaleSetVMsClientRestartPollerResponse.Resume` has been removed -- Function `*VirtualMachinesClientStartPoller.FinalResponse` has been removed -- Function `*RestorePointsClientCreatePoller.FinalResponse` has been removed -- Function `*DisksClientCreateOrUpdatePollerResponse.Resume` has been removed -- Function `*VirtualMachinesClientDeallocatePoller.ResumeToken` has been removed -- Function `*VirtualMachineScaleSetVMExtensionsClientDeletePoller.FinalResponse` has been removed -- Function `*GalleriesClientDeletePoller.FinalResponse` has been removed -- Function `*VirtualMachinesClientAssessPatchesPoller.Poll` has been removed -- Function `*DisksClientUpdatePoller.Poll` has been removed -- Function `*GalleryImagesClientDeletePollerResponse.Resume` has been removed -- Function `*UsageClientListPager.PageResponse` has been removed -- Function `VMDiskTypes.ToPtr` has been removed -- Function `CloudServicesClientRebuildPollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachinesClientConvertToManagedDisksPoller.Done` has been removed -- Function `*CloudServicesClientPowerOffPoller.FinalResponse` has been removed -- Function `*ImagesClientCreateOrUpdatePoller.Done` has been removed -- Function `*VirtualMachinesClientReimagePoller.Done` has been removed -- Function `*LogAnalyticsClientExportThrottledRequestsPoller.FinalResponse` has been removed -- Function `*CapacityReservationsClientUpdatePoller.Poll` has been removed -- Function `*AvailabilitySetsClientListPager.NextPage` has been removed -- Function `*VirtualMachinesClientPerformMaintenancePoller.FinalResponse` has been removed -- Function `*CapacityReservationsClientUpdatePollerResponse.Resume` has been removed -- Function `*CloudServicesClientReimagePoller.Poll` has been removed -- Function `*GalleryApplicationVersionsClientListByGalleryApplicationPager.NextPage` has been removed -- Function `*GalleryImagesClientUpdatePoller.Done` has been removed -- Function `*VirtualMachinesClientUpdatePoller.Poll` has been removed -- Function `DisksClientGrantAccessPollerResponse.PollUntilDone` has been removed -- Function `*GalleryApplicationVersionsClientUpdatePoller.FinalResponse` has been removed -- Function `*CloudServiceRoleInstancesClientDeletePoller.FinalResponse` has been removed -- Function `*VirtualMachinesClientPerformMaintenancePoller.Done` has been removed -- Function `*GalleriesClientListPager.PageResponse` has been removed -- Function `*VirtualMachinesClientPowerOffPoller.ResumeToken` has been removed -- Function `*GalleriesClientListByResourceGroupPager.NextPage` has been removed -- Function `*VirtualMachineScaleSetExtensionsClientDeletePoller.Poll` has been removed -- Function `*GalleryApplicationVersionsClientCreateOrUpdatePoller.ResumeToken` has been removed -- Function `RestorePointExpandOptions.ToPtr` has been removed -- Function `*DedicatedHostGroupsClientListByResourceGroupPager.PageResponse` has been removed -- Function `*VirtualMachineScaleSetExtensionsClientUpdatePoller.FinalResponse` has been removed -- Function `*UsageClientListPager.NextPage` has been removed -- Function `*VirtualMachinesClientListPager.NextPage` has been removed -- Function `*CapacityReservationGroupsClientListByResourceGroupPager.PageResponse` has been removed -- Function `*GalleryApplicationVersionsClientCreateOrUpdatePoller.Done` has been removed -- Function `*SSHPublicKeysClientListByResourceGroupPager.NextPage` has been removed -- Function `*VirtualMachineScaleSetVMsClientRestartPoller.Done` has been removed -- Function `*VirtualMachineScaleSetVMsClientStartPollerResponse.Resume` has been removed -- Function `*SnapshotsClientUpdatePoller.Done` has been removed -- Function `RestorePointsClientCreatePollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachineRunCommandsClientCreateOrUpdatePoller.Done` has been removed -- Function `*DiskAccessesClientDeleteAPrivateEndpointConnectionPoller.FinalResponse` has been removed -- Function `VirtualMachineScaleSetSKUScaleType.ToPtr` has been removed -- Function `*VirtualMachineScaleSetRollingUpgradesClientStartOSUpgradePoller.FinalResponse` has been removed -- Function `CloudServicesClientUpdatePollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachineExtensionsClientUpdatePoller.Poll` has been removed -- Function `*VirtualMachineScaleSetVMRunCommandsClientDeletePoller.ResumeToken` has been removed -- Function `*CloudServicesClientDeletePoller.ResumeToken` has been removed -- Function `*RestorePointCollectionsClientListAllPager.NextPage` has been removed -- Function `*ResourceSKUsClientListPager.PageResponse` has been removed -- Function `*VirtualMachineScaleSetVMsClientRunCommandPoller.Poll` has been removed -- Function `*VirtualMachineScaleSetsClientUpdateInstancesPollerResponse.Resume` has been removed -- Function `GalleryImagePropertiesProvisioningState.ToPtr` has been removed -- Function `*VirtualMachineScaleSetVMsClientStartPoller.ResumeToken` has been removed -- Function `*VirtualMachineRunCommandsClientUpdatePollerResponse.Resume` has been removed -- Function `*VirtualMachineScaleSetVMRunCommandsClientDeletePollerResponse.Resume` has been removed -- Function `*VirtualMachineScaleSetVMRunCommandsClientCreateOrUpdatePoller.Done` has been removed -- Function `GalleriesClientCreateOrUpdatePollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachineScaleSetRollingUpgradesClientStartExtensionUpgradePoller.Poll` has been removed -- Function `*VirtualMachineScaleSetVMsClientPowerOffPoller.FinalResponse` has been removed -- Function `*VirtualMachinesClientRunCommandPoller.FinalResponse` has been removed -- Function `*VirtualMachineScaleSetsClientUpdatePollerResponse.Resume` has been removed -- Function `*VirtualMachineScaleSetsClientDeleteInstancesPoller.ResumeToken` has been removed -- Function `*SharedGalleryImagesClientListPager.NextPage` has been removed -- Function `ConfidentialVMEncryptionType.ToPtr` has been removed -- Function `VirtualMachineScaleSetVMsClientUpdatePollerResponse.PollUntilDone` has been removed -- Function `*GalleryImagesClientUpdatePoller.ResumeToken` has been removed -- Function `*VirtualMachinesClientRedeployPollerResponse.Resume` has been removed -- Function `*VirtualMachineScaleSetsClientGetOSUpgradeHistoryPager.NextPage` has been removed -- Function `*CapacityReservationsClientDeletePoller.ResumeToken` has been removed -- Function `*DedicatedHostGroupsClientListByResourceGroupPager.NextPage` has been removed -- Function `*SnapshotsClientGrantAccessPoller.Poll` has been removed -- Function `*VirtualMachineScaleSetVMsClientReimagePoller.Done` has been removed -- Function `*CapacityReservationGroupsClientListBySubscriptionPager.NextPage` has been removed -- Function `*RestorePointCollectionsClientDeletePoller.Poll` has been removed -- Function `*DedicatedHostGroupsClientListByResourceGroupPager.Err` has been removed -- Function `*DiskRestorePointClientListByRestorePointPager.PageResponse` has been removed -- Function `*GalleryApplicationsClientListByGalleryPager.Err` has been removed -- Function `*CloudServiceRoleInstancesClientDeletePoller.Done` has been removed -- Function `*CloudServiceRoleInstancesClientRebuildPoller.FinalResponse` has been removed -- Function `*VirtualMachineScaleSetVMExtensionsClientCreateOrUpdatePoller.Poll` has been removed -- Function `*DisksClientDeletePollerResponse.Resume` has been removed -- Function `*VirtualMachineRunCommandsClientDeletePoller.Done` has been removed -- Function `*VirtualMachineScaleSetRollingUpgradesClientStartExtensionUpgradePoller.FinalResponse` has been removed -- Function `*VirtualMachineScaleSetExtensionsClientUpdatePollerResponse.Resume` has been removed -- Function `*ImagesClientCreateOrUpdatePoller.FinalResponse` has been removed -- Function `VirtualMachineScaleSetsClientPowerOffPollerResponse.PollUntilDone` has been removed -- Function `*CapacityReservationsClientDeletePollerResponse.Resume` has been removed -- Function `*DiskAccessesClientDeleteAPrivateEndpointConnectionPoller.ResumeToken` has been removed -- Function `*SharedGalleryImagesClientListPager.Err` has been removed -- Function `*GallerySharingProfileClientUpdatePoller.FinalResponse` has been removed -- Function `*VirtualMachinesClientDeletePollerResponse.Resume` has been removed -- Function `*VirtualMachineScaleSetVMsClientRestartPoller.FinalResponse` has been removed -- Function `*GalleryImagesClientDeletePoller.Done` has been removed -- Function `*VirtualMachinesClientCreateOrUpdatePoller.FinalResponse` has been removed -- Function `*DedicatedHostsClientDeletePollerResponse.Resume` has been removed -- Function `VirtualMachinesClientReimagePollerResponse.PollUntilDone` has been removed -- Function `*GalleryImageVersionsClientCreateOrUpdatePoller.FinalResponse` has been removed -- Function `*GalleryImagesClientCreateOrUpdatePollerResponse.Resume` has been removed -- Function `VirtualMachinesClientInstallPatchesPollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachineScaleSetsClientDeleteInstancesPoller.FinalResponse` has been removed -- Function `DiskAccessesClientDeleteAPrivateEndpointConnectionPollerResponse.PollUntilDone` has been removed -- Function `*SnapshotsClientDeletePoller.FinalResponse` has been removed -- Function `VMGuestPatchRebootBehavior.ToPtr` has been removed -- Function `*RestorePointCollectionsClientDeletePoller.ResumeToken` has been removed -- Function `*VirtualMachineRunCommandsClientUpdatePoller.FinalResponse` has been removed -- Function `DedicatedHostsClientRestartPollerResponse.PollUntilDone` has been removed -- Function `*DiskEncryptionSetsClientUpdatePollerResponse.Resume` has been removed -- Function `*VirtualMachinesClientListPager.PageResponse` has been removed -- Function `SelectPermissions.ToPtr` has been removed -- Function `GalleriesClientDeletePollerResponse.PollUntilDone` has been removed -- Function `*CloudServiceOperatingSystemsClientListOSVersionsPager.Err` has been removed -- Function `*ImagesClientUpdatePoller.Poll` has been removed -- Function `*RestorePointCollectionsClientDeletePollerResponse.Resume` has been removed -- Function `*CloudServicesUpdateDomainClientWalkUpdateDomainPoller.ResumeToken` has been removed -- Function `*VirtualMachinesClientCapturePollerResponse.Resume` has been removed -- Function `*DiskAccessesClientListByResourceGroupPager.NextPage` has been removed -- Function `VirtualMachineScaleSetVMExtensionsClientCreateOrUpdatePollerResponse.PollUntilDone` has been removed -- Function `GalleryApplicationVersionsClientCreateOrUpdatePollerResponse.PollUntilDone` has been removed -- Function `VMGuestPatchClassificationLinux.ToPtr` has been removed -- Function `*DiskEncryptionSetsClientDeletePoller.FinalResponse` has been removed -- Function `*VirtualMachinesClientListAllPager.PageResponse` has been removed -- Function `*VirtualMachineScaleSetExtensionsClientDeletePollerResponse.Resume` has been removed -- Function `*GalleryImageVersionsClientDeletePoller.FinalResponse` has been removed -- Function `*CloudServiceRoleInstancesClientListPager.NextPage` has been removed -- Function `*DisksClientGrantAccessPoller.Done` has been removed -- Function `*GalleryApplicationsClientUpdatePoller.Done` has been removed -- Function `*CloudServicesClientUpdatePoller.Done` has been removed -- Function `*SharedGalleriesClientListPager.Err` has been removed -- Function `UpgradeOperationInvoker.ToPtr` has been removed -- Function `SecurityEncryptionTypes.ToPtr` has been removed -- Function `*VirtualMachinesClientPowerOffPoller.Done` has been removed -- Function `*VirtualMachinesClientReimagePoller.Poll` has been removed -- Function `ReplicationState.ToPtr` has been removed -- Function `*VirtualMachineScaleSetsClientListAllPager.PageResponse` has been removed -- Function `*SnapshotsClientDeletePoller.Done` has been removed -- Function `*GalleryImageVersionsClientListByGalleryImagePager.NextPage` has been removed -- Function `*GalleriesClientListByResourceGroupPager.Err` has been removed -- Function `VirtualMachineScaleSetVMsClientRedeployPollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachineScaleSetVMExtensionsClientDeletePoller.Done` has been removed -- Function `*SharedGalleryImageVersionsClientListPager.NextPage` has been removed -- Function `VirtualMachineScaleSetRollingUpgradesClientStartOSUpgradePollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachineScaleSetsClientReimageAllPoller.ResumeToken` has been removed -- Function `*DiskEncryptionSetsClientDeletePoller.Done` has been removed -- Function `*VirtualMachinesClientDeletePoller.Poll` has been removed -- Function `*GalleryImagesClientDeletePoller.FinalResponse` has been removed -- Function `DiskAccessesClientUpdatePollerResponse.PollUntilDone` has been removed -- Function `*GalleryApplicationsClientDeletePoller.FinalResponse` has been removed -- Function `*VirtualMachineScaleSetsClientDeleteInstancesPoller.Done` has been removed -- Function `*VirtualMachineScaleSetVMExtensionsClientDeletePoller.Poll` has been removed -- Function `*GalleriesClientUpdatePoller.Poll` has been removed -- Function `DiskRestorePointClientGrantAccessPollerResponse.PollUntilDone` has been removed -- Function `*CloudServicesClientDeletePoller.Done` has been removed -- Function `*DisksClientRevokeAccessPoller.Poll` has been removed -- Function `*DisksClientCreateOrUpdatePoller.ResumeToken` has been removed -- Function `*CapacityReservationsClientListByCapacityReservationGroupPager.PageResponse` has been removed -- Function `*VirtualMachineScaleSetRollingUpgradesClientCancelPoller.Poll` has been removed -- Function `*SnapshotsClientGrantAccessPoller.ResumeToken` has been removed -- Function `ConsistencyModeTypes.ToPtr` has been removed -- Function `VirtualMachinesClientPerformMaintenancePollerResponse.PollUntilDone` has been removed -- Function `VirtualMachineScaleSetsClientReimageAllPollerResponse.PollUntilDone` has been removed -- Function `GalleryImagesClientDeletePollerResponse.PollUntilDone` has been removed -- Function `*DiskAccessesClientUpdatePoller.FinalResponse` has been removed -- Function `*VirtualMachineScaleSetsClientSetOrchestrationServiceStatePoller.FinalResponse` has been removed -- Function `*VirtualMachineScaleSetsClientDeallocatePoller.ResumeToken` has been removed -- Function `*VirtualMachineScaleSetVMsClientUpdatePoller.FinalResponse` has been removed -- Function `*RestorePointsClientCreatePoller.Poll` has been removed -- Function `DiffDiskPlacement.ToPtr` has been removed -- Function `WindowsPatchAssessmentMode.ToPtr` has been removed -- Function `*GalleriesClientDeletePoller.Done` has been removed -- Function `*ResourceSKUsClientListPager.Err` has been removed -- Function `*SSHPublicKeysClientListByResourceGroupPager.PageResponse` has been removed -- Function `*DiskEncryptionSetsClientListPager.NextPage` has been removed -- Function `*VirtualMachineScaleSetVMRunCommandsClientCreateOrUpdatePoller.ResumeToken` has been removed -- Function `*VirtualMachineExtensionsClientCreateOrUpdatePoller.FinalResponse` has been removed -- Function `*VirtualMachineScaleSetsClientGetOSUpgradeHistoryPager.Err` has been removed -- Function `GalleryImageVersionPropertiesProvisioningState.ToPtr` has been removed -- Function `GalleryExtendedLocationType.ToPtr` has been removed -- Function `*VirtualMachineScaleSetsClientRedeployPoller.FinalResponse` has been removed -- Function `*VirtualMachineScaleSetVMsClientUpdatePollerResponse.Resume` has been removed -- Function `*VirtualMachineScaleSetVMExtensionsClientDeletePollerResponse.Resume` has been removed -- Function `*VirtualMachinesClientRestartPoller.Poll` has been removed -- Function `*GalleryApplicationVersionsClientUpdatePoller.ResumeToken` has been removed -- Function `*DiskAccessesClientListPager.PageResponse` has been removed -- Function `*CloudServicesClientDeleteInstancesPoller.FinalResponse` has been removed -- Function `RollingUpgradeStatusCode.ToPtr` has been removed -- Function `*VirtualMachineScaleSetVMsClientPerformMaintenancePoller.ResumeToken` has been removed -- Function `ProtocolTypes.ToPtr` has been removed -- Function `*CloudServicesClientRestartPoller.Done` has been removed -- Function `*SnapshotsClientRevokeAccessPoller.Poll` has been removed -- Function `*GalleryApplicationVersionsClientCreateOrUpdatePoller.FinalResponse` has been removed -- Function `*GalleriesClientListByResourceGroupPager.PageResponse` has been removed -- Function `*CloudServicesClientReimagePollerResponse.Resume` has been removed -- Function `*VirtualMachinesClientRunCommandPoller.Poll` has been removed -- Function `*CloudServicesClientRebuildPoller.FinalResponse` has been removed -- Function `LogAnalyticsClientExportThrottledRequestsPollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachinesClientPerformMaintenancePoller.ResumeToken` has been removed -- Function `*VirtualMachineExtensionsClientDeletePoller.FinalResponse` has been removed -- Struct `AvailabilitySetsClientCreateOrUpdateResult` has been removed -- Struct `AvailabilitySetsClientGetResult` has been removed -- Struct `AvailabilitySetsClientListAvailableSizesResult` has been removed -- Struct `AvailabilitySetsClientListBySubscriptionPager` has been removed -- Struct `AvailabilitySetsClientListBySubscriptionResult` has been removed -- Struct `AvailabilitySetsClientListPager` has been removed -- Struct `AvailabilitySetsClientListResult` has been removed -- Struct `AvailabilitySetsClientUpdateResult` has been removed -- Struct `CapacityReservationGroupsClientCreateOrUpdateResult` has been removed -- Struct `CapacityReservationGroupsClientGetResult` has been removed -- Struct `CapacityReservationGroupsClientListByResourceGroupPager` has been removed -- Struct `CapacityReservationGroupsClientListByResourceGroupResult` has been removed -- Struct `CapacityReservationGroupsClientListBySubscriptionPager` has been removed -- Struct `CapacityReservationGroupsClientListBySubscriptionResult` has been removed -- Struct `CapacityReservationGroupsClientUpdateResult` has been removed -- Struct `CapacityReservationsClientCreateOrUpdatePoller` has been removed -- Struct `CapacityReservationsClientCreateOrUpdatePollerResponse` has been removed -- Struct `CapacityReservationsClientCreateOrUpdateResult` has been removed -- Struct `CapacityReservationsClientDeletePoller` has been removed -- Struct `CapacityReservationsClientDeletePollerResponse` has been removed -- Struct `CapacityReservationsClientGetResult` has been removed -- Struct `CapacityReservationsClientListByCapacityReservationGroupPager` has been removed -- Struct `CapacityReservationsClientListByCapacityReservationGroupResult` has been removed -- Struct `CapacityReservationsClientUpdatePoller` has been removed -- Struct `CapacityReservationsClientUpdatePollerResponse` has been removed -- Struct `CapacityReservationsClientUpdateResult` has been removed -- Struct `CloudServiceOperatingSystemsClientGetOSFamilyResult` has been removed -- Struct `CloudServiceOperatingSystemsClientGetOSVersionResult` has been removed -- Struct `CloudServiceOperatingSystemsClientListOSFamiliesPager` has been removed -- Struct `CloudServiceOperatingSystemsClientListOSFamiliesResult` has been removed -- Struct `CloudServiceOperatingSystemsClientListOSVersionsPager` has been removed -- Struct `CloudServiceOperatingSystemsClientListOSVersionsResult` has been removed -- Struct `CloudServiceRoleInstancesClientDeletePoller` has been removed -- Struct `CloudServiceRoleInstancesClientDeletePollerResponse` has been removed -- Struct `CloudServiceRoleInstancesClientGetInstanceViewResult` has been removed -- Struct `CloudServiceRoleInstancesClientGetResult` has been removed -- Struct `CloudServiceRoleInstancesClientListPager` has been removed -- Struct `CloudServiceRoleInstancesClientListResult` has been removed -- Struct `CloudServiceRoleInstancesClientRebuildPoller` has been removed -- Struct `CloudServiceRoleInstancesClientRebuildPollerResponse` has been removed -- Struct `CloudServiceRoleInstancesClientReimagePoller` has been removed -- Struct `CloudServiceRoleInstancesClientReimagePollerResponse` has been removed -- Struct `CloudServiceRoleInstancesClientRestartPoller` has been removed -- Struct `CloudServiceRoleInstancesClientRestartPollerResponse` has been removed -- Struct `CloudServiceRolesClientGetResult` has been removed -- Struct `CloudServiceRolesClientListPager` has been removed -- Struct `CloudServiceRolesClientListResult` has been removed -- Struct `CloudServicesClientCreateOrUpdatePoller` has been removed -- Struct `CloudServicesClientCreateOrUpdatePollerResponse` has been removed -- Struct `CloudServicesClientCreateOrUpdateResult` has been removed -- Struct `CloudServicesClientDeleteInstancesPoller` has been removed -- Struct `CloudServicesClientDeleteInstancesPollerResponse` has been removed -- Struct `CloudServicesClientDeletePoller` has been removed -- Struct `CloudServicesClientDeletePollerResponse` has been removed -- Struct `CloudServicesClientGetInstanceViewResult` has been removed -- Struct `CloudServicesClientGetResult` has been removed -- Struct `CloudServicesClientListAllPager` has been removed -- Struct `CloudServicesClientListAllResult` has been removed -- Struct `CloudServicesClientListPager` has been removed -- Struct `CloudServicesClientListResult` has been removed -- Struct `CloudServicesClientPowerOffPoller` has been removed -- Struct `CloudServicesClientPowerOffPollerResponse` has been removed -- Struct `CloudServicesClientRebuildPoller` has been removed -- Struct `CloudServicesClientRebuildPollerResponse` has been removed -- Struct `CloudServicesClientReimagePoller` has been removed -- Struct `CloudServicesClientReimagePollerResponse` has been removed -- Struct `CloudServicesClientRestartPoller` has been removed -- Struct `CloudServicesClientRestartPollerResponse` has been removed -- Struct `CloudServicesClientStartPoller` has been removed -- Struct `CloudServicesClientStartPollerResponse` has been removed -- Struct `CloudServicesClientUpdatePoller` has been removed -- Struct `CloudServicesClientUpdatePollerResponse` has been removed -- Struct `CloudServicesClientUpdateResult` has been removed -- Struct `CloudServicesUpdateDomainClientGetUpdateDomainResult` has been removed -- Struct `CloudServicesUpdateDomainClientListUpdateDomainsPager` has been removed -- Struct `CloudServicesUpdateDomainClientListUpdateDomainsResult` has been removed -- Struct `CloudServicesUpdateDomainClientWalkUpdateDomainPoller` has been removed -- Struct `CloudServicesUpdateDomainClientWalkUpdateDomainPollerResponse` has been removed -- Struct `CommunityGalleriesClientGetResult` has been removed -- Struct `CommunityGalleryImageVersionsClientGetResult` has been removed -- Struct `CommunityGalleryImagesClientGetResult` has been removed -- Struct `DedicatedHostGroupsClientCreateOrUpdateResult` has been removed -- Struct `DedicatedHostGroupsClientGetResult` has been removed -- Struct `DedicatedHostGroupsClientListByResourceGroupPager` has been removed -- Struct `DedicatedHostGroupsClientListByResourceGroupResult` has been removed -- Struct `DedicatedHostGroupsClientListBySubscriptionPager` has been removed -- Struct `DedicatedHostGroupsClientListBySubscriptionResult` has been removed -- Struct `DedicatedHostGroupsClientUpdateResult` has been removed -- Struct `DedicatedHostsClientCreateOrUpdatePoller` has been removed -- Struct `DedicatedHostsClientCreateOrUpdatePollerResponse` has been removed -- Struct `DedicatedHostsClientCreateOrUpdateResult` has been removed -- Struct `DedicatedHostsClientDeletePoller` has been removed -- Struct `DedicatedHostsClientDeletePollerResponse` has been removed -- Struct `DedicatedHostsClientGetResult` has been removed -- Struct `DedicatedHostsClientListByHostGroupPager` has been removed -- Struct `DedicatedHostsClientListByHostGroupResult` has been removed -- Struct `DedicatedHostsClientRestartPoller` has been removed -- Struct `DedicatedHostsClientRestartPollerResponse` has been removed -- Struct `DedicatedHostsClientUpdatePoller` has been removed -- Struct `DedicatedHostsClientUpdatePollerResponse` has been removed -- Struct `DedicatedHostsClientUpdateResult` has been removed -- Struct `DiskAccessesClientCreateOrUpdatePoller` has been removed -- Struct `DiskAccessesClientCreateOrUpdatePollerResponse` has been removed -- Struct `DiskAccessesClientCreateOrUpdateResult` has been removed -- Struct `DiskAccessesClientDeleteAPrivateEndpointConnectionPoller` has been removed -- Struct `DiskAccessesClientDeleteAPrivateEndpointConnectionPollerResponse` has been removed -- Struct `DiskAccessesClientDeletePoller` has been removed -- Struct `DiskAccessesClientDeletePollerResponse` has been removed -- Struct `DiskAccessesClientGetAPrivateEndpointConnectionResult` has been removed -- Struct `DiskAccessesClientGetPrivateLinkResourcesResult` has been removed -- Struct `DiskAccessesClientGetResult` has been removed -- Struct `DiskAccessesClientListByResourceGroupPager` has been removed -- Struct `DiskAccessesClientListByResourceGroupResult` has been removed -- Struct `DiskAccessesClientListPager` has been removed -- Struct `DiskAccessesClientListPrivateEndpointConnectionsPager` has been removed -- Struct `DiskAccessesClientListPrivateEndpointConnectionsResult` has been removed -- Struct `DiskAccessesClientListResult` has been removed -- Struct `DiskAccessesClientUpdateAPrivateEndpointConnectionPoller` has been removed -- Struct `DiskAccessesClientUpdateAPrivateEndpointConnectionPollerResponse` has been removed -- Struct `DiskAccessesClientUpdateAPrivateEndpointConnectionResult` has been removed -- Struct `DiskAccessesClientUpdatePoller` has been removed -- Struct `DiskAccessesClientUpdatePollerResponse` has been removed -- Struct `DiskAccessesClientUpdateResult` has been removed -- Struct `DiskEncryptionSetsClientCreateOrUpdatePoller` has been removed -- Struct `DiskEncryptionSetsClientCreateOrUpdatePollerResponse` has been removed -- Struct `DiskEncryptionSetsClientCreateOrUpdateResult` has been removed -- Struct `DiskEncryptionSetsClientDeletePoller` has been removed -- Struct `DiskEncryptionSetsClientDeletePollerResponse` has been removed -- Struct `DiskEncryptionSetsClientGetResult` has been removed -- Struct `DiskEncryptionSetsClientListAssociatedResourcesPager` has been removed -- Struct `DiskEncryptionSetsClientListAssociatedResourcesResult` has been removed -- Struct `DiskEncryptionSetsClientListByResourceGroupPager` has been removed -- Struct `DiskEncryptionSetsClientListByResourceGroupResult` has been removed -- Struct `DiskEncryptionSetsClientListPager` has been removed -- Struct `DiskEncryptionSetsClientListResult` has been removed -- Struct `DiskEncryptionSetsClientUpdatePoller` has been removed -- Struct `DiskEncryptionSetsClientUpdatePollerResponse` has been removed -- Struct `DiskEncryptionSetsClientUpdateResult` has been removed -- Struct `DiskRestorePointClientGetResult` has been removed -- Struct `DiskRestorePointClientGrantAccessPoller` has been removed -- Struct `DiskRestorePointClientGrantAccessPollerResponse` has been removed -- Struct `DiskRestorePointClientGrantAccessResult` has been removed -- Struct `DiskRestorePointClientListByRestorePointPager` has been removed -- Struct `DiskRestorePointClientListByRestorePointResult` has been removed -- Struct `DiskRestorePointClientRevokeAccessPoller` has been removed -- Struct `DiskRestorePointClientRevokeAccessPollerResponse` has been removed -- Struct `DisksClientCreateOrUpdatePoller` has been removed -- Struct `DisksClientCreateOrUpdatePollerResponse` has been removed -- Struct `DisksClientCreateOrUpdateResult` has been removed -- Struct `DisksClientDeletePoller` has been removed -- Struct `DisksClientDeletePollerResponse` has been removed -- Struct `DisksClientGetResult` has been removed -- Struct `DisksClientGrantAccessPoller` has been removed -- Struct `DisksClientGrantAccessPollerResponse` has been removed -- Struct `DisksClientGrantAccessResult` has been removed -- Struct `DisksClientListByResourceGroupPager` has been removed -- Struct `DisksClientListByResourceGroupResult` has been removed -- Struct `DisksClientListPager` has been removed -- Struct `DisksClientListResult` has been removed -- Struct `DisksClientRevokeAccessPoller` has been removed -- Struct `DisksClientRevokeAccessPollerResponse` has been removed -- Struct `DisksClientUpdatePoller` has been removed -- Struct `DisksClientUpdatePollerResponse` has been removed -- Struct `DisksClientUpdateResult` has been removed -- Struct `GalleriesClientCreateOrUpdatePoller` has been removed -- Struct `GalleriesClientCreateOrUpdatePollerResponse` has been removed -- Struct `GalleriesClientCreateOrUpdateResult` has been removed -- Struct `GalleriesClientDeletePoller` has been removed -- Struct `GalleriesClientDeletePollerResponse` has been removed -- Struct `GalleriesClientGetResult` has been removed -- Struct `GalleriesClientListByResourceGroupPager` has been removed -- Struct `GalleriesClientListByResourceGroupResult` has been removed -- Struct `GalleriesClientListPager` has been removed -- Struct `GalleriesClientListResult` has been removed -- Struct `GalleriesClientUpdatePoller` has been removed -- Struct `GalleriesClientUpdatePollerResponse` has been removed -- Struct `GalleriesClientUpdateResult` has been removed -- Struct `GalleryApplicationVersionsClientCreateOrUpdatePoller` has been removed -- Struct `GalleryApplicationVersionsClientCreateOrUpdatePollerResponse` has been removed -- Struct `GalleryApplicationVersionsClientCreateOrUpdateResult` has been removed -- Struct `GalleryApplicationVersionsClientDeletePoller` has been removed -- Struct `GalleryApplicationVersionsClientDeletePollerResponse` has been removed -- Struct `GalleryApplicationVersionsClientGetResult` has been removed -- Struct `GalleryApplicationVersionsClientListByGalleryApplicationPager` has been removed -- Struct `GalleryApplicationVersionsClientListByGalleryApplicationResult` has been removed -- Struct `GalleryApplicationVersionsClientUpdatePoller` has been removed -- Struct `GalleryApplicationVersionsClientUpdatePollerResponse` has been removed -- Struct `GalleryApplicationVersionsClientUpdateResult` has been removed -- Struct `GalleryApplicationsClientCreateOrUpdatePoller` has been removed -- Struct `GalleryApplicationsClientCreateOrUpdatePollerResponse` has been removed -- Struct `GalleryApplicationsClientCreateOrUpdateResult` has been removed -- Struct `GalleryApplicationsClientDeletePoller` has been removed -- Struct `GalleryApplicationsClientDeletePollerResponse` has been removed -- Struct `GalleryApplicationsClientGetResult` has been removed -- Struct `GalleryApplicationsClientListByGalleryPager` has been removed -- Struct `GalleryApplicationsClientListByGalleryResult` has been removed -- Struct `GalleryApplicationsClientUpdatePoller` has been removed -- Struct `GalleryApplicationsClientUpdatePollerResponse` has been removed -- Struct `GalleryApplicationsClientUpdateResult` has been removed -- Struct `GalleryImageVersionsClientCreateOrUpdatePoller` has been removed -- Struct `GalleryImageVersionsClientCreateOrUpdatePollerResponse` has been removed -- Struct `GalleryImageVersionsClientCreateOrUpdateResult` has been removed -- Struct `GalleryImageVersionsClientDeletePoller` has been removed -- Struct `GalleryImageVersionsClientDeletePollerResponse` has been removed -- Struct `GalleryImageVersionsClientGetResult` has been removed -- Struct `GalleryImageVersionsClientListByGalleryImagePager` has been removed -- Struct `GalleryImageVersionsClientListByGalleryImageResult` has been removed -- Struct `GalleryImageVersionsClientUpdatePoller` has been removed -- Struct `GalleryImageVersionsClientUpdatePollerResponse` has been removed -- Struct `GalleryImageVersionsClientUpdateResult` has been removed -- Struct `GalleryImagesClientCreateOrUpdatePoller` has been removed -- Struct `GalleryImagesClientCreateOrUpdatePollerResponse` has been removed -- Struct `GalleryImagesClientCreateOrUpdateResult` has been removed -- Struct `GalleryImagesClientDeletePoller` has been removed -- Struct `GalleryImagesClientDeletePollerResponse` has been removed -- Struct `GalleryImagesClientGetResult` has been removed -- Struct `GalleryImagesClientListByGalleryPager` has been removed -- Struct `GalleryImagesClientListByGalleryResult` has been removed -- Struct `GalleryImagesClientUpdatePoller` has been removed -- Struct `GalleryImagesClientUpdatePollerResponse` has been removed -- Struct `GalleryImagesClientUpdateResult` has been removed -- Struct `GallerySharingProfileClientUpdatePoller` has been removed -- Struct `GallerySharingProfileClientUpdatePollerResponse` has been removed -- Struct `GallerySharingProfileClientUpdateResult` has been removed -- Struct `ImagesClientCreateOrUpdatePoller` has been removed -- Struct `ImagesClientCreateOrUpdatePollerResponse` has been removed -- Struct `ImagesClientCreateOrUpdateResult` has been removed -- Struct `ImagesClientDeletePoller` has been removed -- Struct `ImagesClientDeletePollerResponse` has been removed -- Struct `ImagesClientGetResult` has been removed -- Struct `ImagesClientListByResourceGroupPager` has been removed -- Struct `ImagesClientListByResourceGroupResult` has been removed -- Struct `ImagesClientListPager` has been removed -- Struct `ImagesClientListResult` has been removed -- Struct `ImagesClientUpdatePoller` has been removed -- Struct `ImagesClientUpdatePollerResponse` has been removed -- Struct `ImagesClientUpdateResult` has been removed -- Struct `LogAnalyticsClientExportRequestRateByIntervalPoller` has been removed -- Struct `LogAnalyticsClientExportRequestRateByIntervalPollerResponse` has been removed -- Struct `LogAnalyticsClientExportRequestRateByIntervalResult` has been removed -- Struct `LogAnalyticsClientExportThrottledRequestsPoller` has been removed -- Struct `LogAnalyticsClientExportThrottledRequestsPollerResponse` has been removed -- Struct `LogAnalyticsClientExportThrottledRequestsResult` has been removed -- Struct `OperationsClientListResult` has been removed -- Struct `ProximityPlacementGroupsClientCreateOrUpdateResult` has been removed -- Struct `ProximityPlacementGroupsClientGetResult` has been removed -- Struct `ProximityPlacementGroupsClientListByResourceGroupPager` has been removed -- Struct `ProximityPlacementGroupsClientListByResourceGroupResult` has been removed -- Struct `ProximityPlacementGroupsClientListBySubscriptionPager` has been removed -- Struct `ProximityPlacementGroupsClientListBySubscriptionResult` has been removed -- Struct `ProximityPlacementGroupsClientUpdateResult` has been removed -- Struct `ResourceSKUsClientListPager` has been removed -- Struct `ResourceSKUsClientListResult` has been removed -- Struct `RestorePointCollectionsClientCreateOrUpdateResult` has been removed -- Struct `RestorePointCollectionsClientDeletePoller` has been removed -- Struct `RestorePointCollectionsClientDeletePollerResponse` has been removed -- Struct `RestorePointCollectionsClientGetResult` has been removed -- Struct `RestorePointCollectionsClientListAllPager` has been removed -- Struct `RestorePointCollectionsClientListAllResult` has been removed -- Struct `RestorePointCollectionsClientListPager` has been removed -- Struct `RestorePointCollectionsClientListResult` has been removed -- Struct `RestorePointCollectionsClientUpdateResult` has been removed -- Struct `RestorePointsClientCreatePoller` has been removed -- Struct `RestorePointsClientCreatePollerResponse` has been removed -- Struct `RestorePointsClientCreateResult` has been removed -- Struct `RestorePointsClientDeletePoller` has been removed -- Struct `RestorePointsClientDeletePollerResponse` has been removed -- Struct `RestorePointsClientGetResult` has been removed -- Struct `SSHPublicKeysClientCreateResult` has been removed -- Struct `SSHPublicKeysClientGenerateKeyPairResult` has been removed -- Struct `SSHPublicKeysClientGetResult` has been removed -- Struct `SSHPublicKeysClientListByResourceGroupPager` has been removed -- Struct `SSHPublicKeysClientListByResourceGroupResult` has been removed -- Struct `SSHPublicKeysClientListBySubscriptionPager` has been removed -- Struct `SSHPublicKeysClientListBySubscriptionResult` has been removed -- Struct `SSHPublicKeysClientUpdateResult` has been removed -- Struct `SharedGalleriesClientGetResult` has been removed -- Struct `SharedGalleriesClientListPager` has been removed -- Struct `SharedGalleriesClientListResult` has been removed -- Struct `SharedGalleryImageVersionsClientGetResult` has been removed -- Struct `SharedGalleryImageVersionsClientListPager` has been removed -- Struct `SharedGalleryImageVersionsClientListResult` has been removed -- Struct `SharedGalleryImagesClientGetResult` has been removed -- Struct `SharedGalleryImagesClientListPager` has been removed -- Struct `SharedGalleryImagesClientListResult` has been removed -- Struct `SnapshotsClientCreateOrUpdatePoller` has been removed -- Struct `SnapshotsClientCreateOrUpdatePollerResponse` has been removed -- Struct `SnapshotsClientCreateOrUpdateResult` has been removed -- Struct `SnapshotsClientDeletePoller` has been removed -- Struct `SnapshotsClientDeletePollerResponse` has been removed -- Struct `SnapshotsClientGetResult` has been removed -- Struct `SnapshotsClientGrantAccessPoller` has been removed -- Struct `SnapshotsClientGrantAccessPollerResponse` has been removed -- Struct `SnapshotsClientGrantAccessResult` has been removed -- Struct `SnapshotsClientListByResourceGroupPager` has been removed -- Struct `SnapshotsClientListByResourceGroupResult` has been removed -- Struct `SnapshotsClientListPager` has been removed -- Struct `SnapshotsClientListResult` has been removed -- Struct `SnapshotsClientRevokeAccessPoller` has been removed -- Struct `SnapshotsClientRevokeAccessPollerResponse` has been removed -- Struct `SnapshotsClientUpdatePoller` has been removed -- Struct `SnapshotsClientUpdatePollerResponse` has been removed -- Struct `SnapshotsClientUpdateResult` has been removed -- Struct `UsageClientListPager` has been removed -- Struct `UsageClientListResult` has been removed -- Struct `VirtualMachineExtensionImagesClientGetResult` has been removed -- Struct `VirtualMachineExtensionImagesClientListTypesResult` has been removed -- Struct `VirtualMachineExtensionImagesClientListVersionsResult` has been removed -- Struct `VirtualMachineExtensionsClientCreateOrUpdatePoller` has been removed -- Struct `VirtualMachineExtensionsClientCreateOrUpdatePollerResponse` has been removed -- Struct `VirtualMachineExtensionsClientCreateOrUpdateResult` has been removed -- Struct `VirtualMachineExtensionsClientDeletePoller` has been removed -- Struct `VirtualMachineExtensionsClientDeletePollerResponse` has been removed -- Struct `VirtualMachineExtensionsClientGetResult` has been removed -- Struct `VirtualMachineExtensionsClientListResult` has been removed -- Struct `VirtualMachineExtensionsClientUpdatePoller` has been removed -- Struct `VirtualMachineExtensionsClientUpdatePollerResponse` has been removed -- Struct `VirtualMachineExtensionsClientUpdateResult` has been removed -- Struct `VirtualMachineImagesClientGetResult` has been removed -- Struct `VirtualMachineImagesClientListOffersResult` has been removed -- Struct `VirtualMachineImagesClientListPublishersResult` has been removed -- Struct `VirtualMachineImagesClientListResult` has been removed -- Struct `VirtualMachineImagesClientListSKUsResult` has been removed -- Struct `VirtualMachineImagesEdgeZoneClientGetResult` has been removed -- Struct `VirtualMachineImagesEdgeZoneClientListOffersResult` has been removed -- Struct `VirtualMachineImagesEdgeZoneClientListPublishersResult` has been removed -- Struct `VirtualMachineImagesEdgeZoneClientListResult` has been removed -- Struct `VirtualMachineImagesEdgeZoneClientListSKUsResult` has been removed -- Struct `VirtualMachineRunCommandsClientCreateOrUpdatePoller` has been removed -- Struct `VirtualMachineRunCommandsClientCreateOrUpdatePollerResponse` has been removed -- Struct `VirtualMachineRunCommandsClientCreateOrUpdateResult` has been removed -- Struct `VirtualMachineRunCommandsClientDeletePoller` has been removed -- Struct `VirtualMachineRunCommandsClientDeletePollerResponse` has been removed -- Struct `VirtualMachineRunCommandsClientGetByVirtualMachineResult` has been removed -- Struct `VirtualMachineRunCommandsClientGetResult` has been removed -- Struct `VirtualMachineRunCommandsClientListByVirtualMachinePager` has been removed -- Struct `VirtualMachineRunCommandsClientListByVirtualMachineResult` has been removed -- Struct `VirtualMachineRunCommandsClientListPager` has been removed -- Struct `VirtualMachineRunCommandsClientListResult` has been removed -- Struct `VirtualMachineRunCommandsClientUpdatePoller` has been removed -- Struct `VirtualMachineRunCommandsClientUpdatePollerResponse` has been removed -- Struct `VirtualMachineRunCommandsClientUpdateResult` has been removed -- Struct `VirtualMachineScaleSetExtensionsClientCreateOrUpdatePoller` has been removed -- Struct `VirtualMachineScaleSetExtensionsClientCreateOrUpdatePollerResponse` has been removed -- Struct `VirtualMachineScaleSetExtensionsClientCreateOrUpdateResult` has been removed -- Struct `VirtualMachineScaleSetExtensionsClientDeletePoller` has been removed -- Struct `VirtualMachineScaleSetExtensionsClientDeletePollerResponse` has been removed -- Struct `VirtualMachineScaleSetExtensionsClientGetResult` has been removed -- Struct `VirtualMachineScaleSetExtensionsClientListPager` has been removed -- Struct `VirtualMachineScaleSetExtensionsClientListResult` has been removed -- Struct `VirtualMachineScaleSetExtensionsClientUpdatePoller` has been removed -- Struct `VirtualMachineScaleSetExtensionsClientUpdatePollerResponse` has been removed -- Struct `VirtualMachineScaleSetExtensionsClientUpdateResult` has been removed -- Struct `VirtualMachineScaleSetRollingUpgradesClientCancelPoller` has been removed -- Struct `VirtualMachineScaleSetRollingUpgradesClientCancelPollerResponse` has been removed -- Struct `VirtualMachineScaleSetRollingUpgradesClientGetLatestResult` has been removed -- Struct `VirtualMachineScaleSetRollingUpgradesClientStartExtensionUpgradePoller` has been removed -- Struct `VirtualMachineScaleSetRollingUpgradesClientStartExtensionUpgradePollerResponse` has been removed -- Struct `VirtualMachineScaleSetRollingUpgradesClientStartOSUpgradePoller` has been removed -- Struct `VirtualMachineScaleSetRollingUpgradesClientStartOSUpgradePollerResponse` has been removed -- Struct `VirtualMachineScaleSetVMExtensionsClientCreateOrUpdatePoller` has been removed -- Struct `VirtualMachineScaleSetVMExtensionsClientCreateOrUpdatePollerResponse` has been removed -- Struct `VirtualMachineScaleSetVMExtensionsClientCreateOrUpdateResult` has been removed -- Struct `VirtualMachineScaleSetVMExtensionsClientDeletePoller` has been removed -- Struct `VirtualMachineScaleSetVMExtensionsClientDeletePollerResponse` has been removed -- Struct `VirtualMachineScaleSetVMExtensionsClientGetResult` has been removed -- Struct `VirtualMachineScaleSetVMExtensionsClientListResult` has been removed -- Struct `VirtualMachineScaleSetVMExtensionsClientUpdatePoller` has been removed -- Struct `VirtualMachineScaleSetVMExtensionsClientUpdatePollerResponse` has been removed -- Struct `VirtualMachineScaleSetVMExtensionsClientUpdateResult` has been removed -- Struct `VirtualMachineScaleSetVMRunCommandsClientCreateOrUpdatePoller` has been removed -- Struct `VirtualMachineScaleSetVMRunCommandsClientCreateOrUpdatePollerResponse` has been removed -- Struct `VirtualMachineScaleSetVMRunCommandsClientCreateOrUpdateResult` has been removed -- Struct `VirtualMachineScaleSetVMRunCommandsClientDeletePoller` has been removed -- Struct `VirtualMachineScaleSetVMRunCommandsClientDeletePollerResponse` has been removed -- Struct `VirtualMachineScaleSetVMRunCommandsClientGetResult` has been removed -- Struct `VirtualMachineScaleSetVMRunCommandsClientListPager` has been removed -- Struct `VirtualMachineScaleSetVMRunCommandsClientListResult` has been removed -- Struct `VirtualMachineScaleSetVMRunCommandsClientUpdatePoller` has been removed -- Struct `VirtualMachineScaleSetVMRunCommandsClientUpdatePollerResponse` has been removed -- Struct `VirtualMachineScaleSetVMRunCommandsClientUpdateResult` has been removed -- Struct `VirtualMachineScaleSetVMsClientDeallocatePoller` has been removed -- Struct `VirtualMachineScaleSetVMsClientDeallocatePollerResponse` has been removed -- Struct `VirtualMachineScaleSetVMsClientDeletePoller` has been removed -- Struct `VirtualMachineScaleSetVMsClientDeletePollerResponse` has been removed -- Struct `VirtualMachineScaleSetVMsClientGetInstanceViewResult` has been removed -- Struct `VirtualMachineScaleSetVMsClientGetResult` has been removed -- Struct `VirtualMachineScaleSetVMsClientListPager` has been removed -- Struct `VirtualMachineScaleSetVMsClientListResult` has been removed -- Struct `VirtualMachineScaleSetVMsClientPerformMaintenancePoller` has been removed -- Struct `VirtualMachineScaleSetVMsClientPerformMaintenancePollerResponse` has been removed -- Struct `VirtualMachineScaleSetVMsClientPowerOffPoller` has been removed -- Struct `VirtualMachineScaleSetVMsClientPowerOffPollerResponse` has been removed -- Struct `VirtualMachineScaleSetVMsClientRedeployPoller` has been removed -- Struct `VirtualMachineScaleSetVMsClientRedeployPollerResponse` has been removed -- Struct `VirtualMachineScaleSetVMsClientReimageAllPoller` has been removed -- Struct `VirtualMachineScaleSetVMsClientReimageAllPollerResponse` has been removed -- Struct `VirtualMachineScaleSetVMsClientReimagePoller` has been removed -- Struct `VirtualMachineScaleSetVMsClientReimagePollerResponse` has been removed -- Struct `VirtualMachineScaleSetVMsClientRestartPoller` has been removed -- Struct `VirtualMachineScaleSetVMsClientRestartPollerResponse` has been removed -- Struct `VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataResult` has been removed -- Struct `VirtualMachineScaleSetVMsClientRunCommandPoller` has been removed -- Struct `VirtualMachineScaleSetVMsClientRunCommandPollerResponse` has been removed -- Struct `VirtualMachineScaleSetVMsClientRunCommandResult` has been removed -- Struct `VirtualMachineScaleSetVMsClientStartPoller` has been removed -- Struct `VirtualMachineScaleSetVMsClientStartPollerResponse` has been removed -- Struct `VirtualMachineScaleSetVMsClientUpdatePoller` has been removed -- Struct `VirtualMachineScaleSetVMsClientUpdatePollerResponse` has been removed -- Struct `VirtualMachineScaleSetVMsClientUpdateResult` has been removed -- Struct `VirtualMachineScaleSetsClientCreateOrUpdatePoller` has been removed -- Struct `VirtualMachineScaleSetsClientCreateOrUpdatePollerResponse` has been removed -- Struct `VirtualMachineScaleSetsClientCreateOrUpdateResult` has been removed -- Struct `VirtualMachineScaleSetsClientDeallocatePoller` has been removed -- Struct `VirtualMachineScaleSetsClientDeallocatePollerResponse` has been removed -- Struct `VirtualMachineScaleSetsClientDeleteInstancesPoller` has been removed -- Struct `VirtualMachineScaleSetsClientDeleteInstancesPollerResponse` has been removed -- Struct `VirtualMachineScaleSetsClientDeletePoller` has been removed -- Struct `VirtualMachineScaleSetsClientDeletePollerResponse` has been removed -- Struct `VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkResult` has been removed -- Struct `VirtualMachineScaleSetsClientGetInstanceViewResult` has been removed -- Struct `VirtualMachineScaleSetsClientGetOSUpgradeHistoryPager` has been removed -- Struct `VirtualMachineScaleSetsClientGetOSUpgradeHistoryResult` has been removed -- Struct `VirtualMachineScaleSetsClientGetResult` has been removed -- Struct `VirtualMachineScaleSetsClientListAllPager` has been removed -- Struct `VirtualMachineScaleSetsClientListAllResult` has been removed -- Struct `VirtualMachineScaleSetsClientListByLocationPager` has been removed -- Struct `VirtualMachineScaleSetsClientListByLocationResult` has been removed -- Struct `VirtualMachineScaleSetsClientListPager` has been removed -- Struct `VirtualMachineScaleSetsClientListResult` has been removed -- Struct `VirtualMachineScaleSetsClientListSKUsPager` has been removed -- Struct `VirtualMachineScaleSetsClientListSKUsResult` has been removed -- Struct `VirtualMachineScaleSetsClientPerformMaintenancePoller` has been removed -- Struct `VirtualMachineScaleSetsClientPerformMaintenancePollerResponse` has been removed -- Struct `VirtualMachineScaleSetsClientPowerOffPoller` has been removed -- Struct `VirtualMachineScaleSetsClientPowerOffPollerResponse` has been removed -- Struct `VirtualMachineScaleSetsClientRedeployPoller` has been removed -- Struct `VirtualMachineScaleSetsClientRedeployPollerResponse` has been removed -- Struct `VirtualMachineScaleSetsClientReimageAllPoller` has been removed -- Struct `VirtualMachineScaleSetsClientReimageAllPollerResponse` has been removed -- Struct `VirtualMachineScaleSetsClientReimagePoller` has been removed -- Struct `VirtualMachineScaleSetsClientReimagePollerResponse` has been removed -- Struct `VirtualMachineScaleSetsClientRestartPoller` has been removed -- Struct `VirtualMachineScaleSetsClientRestartPollerResponse` has been removed -- Struct `VirtualMachineScaleSetsClientSetOrchestrationServiceStatePoller` has been removed -- Struct `VirtualMachineScaleSetsClientSetOrchestrationServiceStatePollerResponse` has been removed -- Struct `VirtualMachineScaleSetsClientStartPoller` has been removed -- Struct `VirtualMachineScaleSetsClientStartPollerResponse` has been removed -- Struct `VirtualMachineScaleSetsClientUpdateInstancesPoller` has been removed -- Struct `VirtualMachineScaleSetsClientUpdateInstancesPollerResponse` has been removed -- Struct `VirtualMachineScaleSetsClientUpdatePoller` has been removed -- Struct `VirtualMachineScaleSetsClientUpdatePollerResponse` has been removed -- Struct `VirtualMachineScaleSetsClientUpdateResult` has been removed -- Struct `VirtualMachineSizesClientListResult` has been removed -- Struct `VirtualMachinesClientAssessPatchesPoller` has been removed -- Struct `VirtualMachinesClientAssessPatchesPollerResponse` has been removed -- Struct `VirtualMachinesClientAssessPatchesResult` has been removed -- Struct `VirtualMachinesClientCapturePoller` has been removed -- Struct `VirtualMachinesClientCapturePollerResponse` has been removed -- Struct `VirtualMachinesClientCaptureResult` has been removed -- Struct `VirtualMachinesClientConvertToManagedDisksPoller` has been removed -- Struct `VirtualMachinesClientConvertToManagedDisksPollerResponse` has been removed -- Struct `VirtualMachinesClientCreateOrUpdatePoller` has been removed -- Struct `VirtualMachinesClientCreateOrUpdatePollerResponse` has been removed -- Struct `VirtualMachinesClientCreateOrUpdateResult` has been removed -- Struct `VirtualMachinesClientDeallocatePoller` has been removed -- Struct `VirtualMachinesClientDeallocatePollerResponse` has been removed -- Struct `VirtualMachinesClientDeletePoller` has been removed -- Struct `VirtualMachinesClientDeletePollerResponse` has been removed -- Struct `VirtualMachinesClientGetResult` has been removed -- Struct `VirtualMachinesClientInstallPatchesPoller` has been removed -- Struct `VirtualMachinesClientInstallPatchesPollerResponse` has been removed -- Struct `VirtualMachinesClientInstallPatchesResult` has been removed -- Struct `VirtualMachinesClientInstanceViewResult` has been removed -- Struct `VirtualMachinesClientListAllPager` has been removed -- Struct `VirtualMachinesClientListAllResult` has been removed -- Struct `VirtualMachinesClientListAvailableSizesResult` has been removed -- Struct `VirtualMachinesClientListByLocationPager` has been removed -- Struct `VirtualMachinesClientListByLocationResult` has been removed -- Struct `VirtualMachinesClientListPager` has been removed -- Struct `VirtualMachinesClientListResult` has been removed -- Struct `VirtualMachinesClientPerformMaintenancePoller` has been removed -- Struct `VirtualMachinesClientPerformMaintenancePollerResponse` has been removed -- Struct `VirtualMachinesClientPowerOffPoller` has been removed -- Struct `VirtualMachinesClientPowerOffPollerResponse` has been removed -- Struct `VirtualMachinesClientReapplyPoller` has been removed -- Struct `VirtualMachinesClientReapplyPollerResponse` has been removed -- Struct `VirtualMachinesClientRedeployPoller` has been removed -- Struct `VirtualMachinesClientRedeployPollerResponse` has been removed -- Struct `VirtualMachinesClientReimagePoller` has been removed -- Struct `VirtualMachinesClientReimagePollerResponse` has been removed -- Struct `VirtualMachinesClientRestartPoller` has been removed -- Struct `VirtualMachinesClientRestartPollerResponse` has been removed -- Struct `VirtualMachinesClientRetrieveBootDiagnosticsDataResult` has been removed -- Struct `VirtualMachinesClientRunCommandPoller` has been removed -- Struct `VirtualMachinesClientRunCommandPollerResponse` has been removed -- Struct `VirtualMachinesClientRunCommandResult` has been removed -- Struct `VirtualMachinesClientStartPoller` has been removed -- Struct `VirtualMachinesClientStartPollerResponse` has been removed -- Struct `VirtualMachinesClientUpdatePoller` has been removed -- Struct `VirtualMachinesClientUpdatePollerResponse` has been removed -- Struct `VirtualMachinesClientUpdateResult` has been removed -- Field `RawResponse` of struct `CloudServicesClientReimageResponse` has been removed -- Field `RawResponse` of struct `CloudServiceRoleInstancesClientRestartResponse` has been removed -- Field `VirtualMachineRunCommandsClientUpdateResult` of struct `VirtualMachineRunCommandsClientUpdateResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineRunCommandsClientUpdateResponse` has been removed -- Field `CommunityGalleryImageVersionsClientGetResult` of struct `CommunityGalleryImageVersionsClientGetResponse` has been removed -- Field `RawResponse` of struct `CommunityGalleryImageVersionsClientGetResponse` has been removed -- Field `DiskAccessesClientGetResult` of struct `DiskAccessesClientGetResponse` has been removed -- Field `RawResponse` of struct `DiskAccessesClientGetResponse` has been removed -- Field `GalleryApplicationVersionsClientCreateOrUpdateResult` of struct `GalleryApplicationVersionsClientCreateOrUpdateResponse` has been removed -- Field `RawResponse` of struct `GalleryApplicationVersionsClientCreateOrUpdateResponse` has been removed -- Field `CloudServicesUpdateDomainClientGetUpdateDomainResult` of struct `CloudServicesUpdateDomainClientGetUpdateDomainResponse` has been removed -- Field `RawResponse` of struct `CloudServicesUpdateDomainClientGetUpdateDomainResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineScaleSetRollingUpgradesClientStartOSUpgradeResponse` has been removed -- Field `VirtualMachineScaleSetsClientCreateOrUpdateResult` of struct `VirtualMachineScaleSetsClientCreateOrUpdateResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineScaleSetsClientCreateOrUpdateResponse` has been removed -- Field `DiskRestorePointClientGrantAccessResult` of struct `DiskRestorePointClientGrantAccessResponse` has been removed -- Field `RawResponse` of struct `DiskRestorePointClientGrantAccessResponse` has been removed -- Field `ImagesClientListResult` of struct `ImagesClientListResponse` has been removed -- Field `RawResponse` of struct `ImagesClientListResponse` has been removed -- Field `SharedGalleriesClientListResult` of struct `SharedGalleriesClientListResponse` has been removed -- Field `RawResponse` of struct `SharedGalleriesClientListResponse` has been removed -- Field `VirtualMachineExtensionsClientUpdateResult` of struct `VirtualMachineExtensionsClientUpdateResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineExtensionsClientUpdateResponse` has been removed -- Field `RawResponse` of struct `SnapshotsClientDeleteResponse` has been removed -- Field `VirtualMachineScaleSetRollingUpgradesClientGetLatestResult` of struct `VirtualMachineScaleSetRollingUpgradesClientGetLatestResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineScaleSetRollingUpgradesClientGetLatestResponse` has been removed -- Field `RawResponse` of struct `DisksClientDeleteResponse` has been removed -- Field `DiskAccessesClientListResult` of struct `DiskAccessesClientListResponse` has been removed -- Field `RawResponse` of struct `DiskAccessesClientListResponse` has been removed -- Field `RawResponse` of struct `VirtualMachinesClientRestartResponse` has been removed -- Field `GallerySharingProfileClientUpdateResult` of struct `GallerySharingProfileClientUpdateResponse` has been removed -- Field `RawResponse` of struct `GallerySharingProfileClientUpdateResponse` has been removed -- Field `VirtualMachineExtensionsClientListResult` of struct `VirtualMachineExtensionsClientListResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineExtensionsClientListResponse` has been removed -- Field `GalleryImageVersionsClientListByGalleryImageResult` of struct `GalleryImageVersionsClientListByGalleryImageResponse` has been removed -- Field `RawResponse` of struct `GalleryImageVersionsClientListByGalleryImageResponse` has been removed -- Field `DedicatedHostGroupsClientListByResourceGroupResult` of struct `DedicatedHostGroupsClientListByResourceGroupResponse` has been removed -- Field `RawResponse` of struct `DedicatedHostGroupsClientListByResourceGroupResponse` has been removed -- Field `VirtualMachineRunCommandsClientGetByVirtualMachineResult` of struct `VirtualMachineRunCommandsClientGetByVirtualMachineResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineRunCommandsClientGetByVirtualMachineResponse` has been removed -- Field `CloudServicesClientGetInstanceViewResult` of struct `CloudServicesClientGetInstanceViewResponse` has been removed -- Field `RawResponse` of struct `CloudServicesClientGetInstanceViewResponse` has been removed -- Field `VirtualMachineImagesClientListPublishersResult` of struct `VirtualMachineImagesClientListPublishersResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineImagesClientListPublishersResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineScaleSetVMsClientPerformMaintenanceResponse` has been removed -- Field `VirtualMachineImagesClientListSKUsResult` of struct `VirtualMachineImagesClientListSKUsResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineImagesClientListSKUsResponse` has been removed -- Field `SSHPublicKeysClientCreateResult` of struct `SSHPublicKeysClientCreateResponse` has been removed -- Field `RawResponse` of struct `SSHPublicKeysClientCreateResponse` has been removed -- Field `CloudServiceOperatingSystemsClientGetOSVersionResult` of struct `CloudServiceOperatingSystemsClientGetOSVersionResponse` has been removed -- Field `RawResponse` of struct `CloudServiceOperatingSystemsClientGetOSVersionResponse` has been removed -- Field `VirtualMachineImagesEdgeZoneClientListResult` of struct `VirtualMachineImagesEdgeZoneClientListResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineImagesEdgeZoneClientListResponse` has been removed -- Field `VirtualMachineScaleSetVMsClientGetResult` of struct `VirtualMachineScaleSetVMsClientGetResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineScaleSetVMsClientGetResponse` has been removed -- Field `GalleriesClientListByResourceGroupResult` of struct `GalleriesClientListByResourceGroupResponse` has been removed -- Field `RawResponse` of struct `GalleriesClientListByResourceGroupResponse` has been removed -- Field `RawResponse` of struct `VirtualMachinesClientGeneralizeResponse` has been removed -- Field `RawResponse` of struct `CloudServiceRoleInstancesClientRebuildResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineScaleSetExtensionsClientDeleteResponse` has been removed -- Field `VirtualMachineScaleSetVMsClientListResult` of struct `VirtualMachineScaleSetVMsClientListResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineScaleSetVMsClientListResponse` has been removed -- Field `CapacityReservationGroupsClientListByResourceGroupResult` of struct `CapacityReservationGroupsClientListByResourceGroupResponse` has been removed -- Field `RawResponse` of struct `CapacityReservationGroupsClientListByResourceGroupResponse` has been removed -- Field `CloudServicesUpdateDomainClientListUpdateDomainsResult` of struct `CloudServicesUpdateDomainClientListUpdateDomainsResponse` has been removed -- Field `RawResponse` of struct `CloudServicesUpdateDomainClientListUpdateDomainsResponse` has been removed -- Field `VirtualMachineScaleSetsClientGetResult` of struct `VirtualMachineScaleSetsClientGetResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineScaleSetsClientGetResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineScaleSetVMExtensionsClientDeleteResponse` has been removed -- Field `CloudServiceRoleInstancesClientGetResult` of struct `CloudServiceRoleInstancesClientGetResponse` has been removed -- Field `RawResponse` of struct `CloudServiceRoleInstancesClientGetResponse` has been removed -- Field `AvailabilitySetsClientListResult` of struct `AvailabilitySetsClientListResponse` has been removed -- Field `RawResponse` of struct `AvailabilitySetsClientListResponse` has been removed -- Field `VirtualMachineExtensionsClientGetResult` of struct `VirtualMachineExtensionsClientGetResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineExtensionsClientGetResponse` has been removed -- Field `VirtualMachineScaleSetVMRunCommandsClientListResult` of struct `VirtualMachineScaleSetVMRunCommandsClientListResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineScaleSetVMRunCommandsClientListResponse` has been removed -- Field `VirtualMachinesClientAssessPatchesResult` of struct `VirtualMachinesClientAssessPatchesResponse` has been removed -- Field `RawResponse` of struct `VirtualMachinesClientAssessPatchesResponse` has been removed -- Field `DiskAccessesClientGetAPrivateEndpointConnectionResult` of struct `DiskAccessesClientGetAPrivateEndpointConnectionResponse` has been removed -- Field `RawResponse` of struct `DiskAccessesClientGetAPrivateEndpointConnectionResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineScaleSetsClientUpdateInstancesResponse` has been removed -- Field `CapacityReservationGroupsClientListBySubscriptionResult` of struct `CapacityReservationGroupsClientListBySubscriptionResponse` has been removed -- Field `RawResponse` of struct `CapacityReservationGroupsClientListBySubscriptionResponse` has been removed -- Field `SSHPublicKeysClientGenerateKeyPairResult` of struct `SSHPublicKeysClientGenerateKeyPairResponse` has been removed -- Field `RawResponse` of struct `SSHPublicKeysClientGenerateKeyPairResponse` has been removed -- Field `DiskEncryptionSetsClientListByResourceGroupResult` of struct `DiskEncryptionSetsClientListByResourceGroupResponse` has been removed -- Field `RawResponse` of struct `DiskEncryptionSetsClientListByResourceGroupResponse` has been removed -- Field `GalleryImageVersionsClientCreateOrUpdateResult` of struct `GalleryImageVersionsClientCreateOrUpdateResponse` has been removed -- Field `RawResponse` of struct `GalleryImageVersionsClientCreateOrUpdateResponse` has been removed -- Field `SharedGalleryImageVersionsClientListResult` of struct `SharedGalleryImageVersionsClientListResponse` has been removed -- Field `RawResponse` of struct `SharedGalleryImageVersionsClientListResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineScaleSetsClientPerformMaintenanceResponse` has been removed -- Field `VirtualMachinesClientRetrieveBootDiagnosticsDataResult` of struct `VirtualMachinesClientRetrieveBootDiagnosticsDataResponse` has been removed -- Field `RawResponse` of struct `VirtualMachinesClientRetrieveBootDiagnosticsDataResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineScaleSetVMsClientSimulateEvictionResponse` has been removed -- Field `VirtualMachineImagesEdgeZoneClientGetResult` of struct `VirtualMachineImagesEdgeZoneClientGetResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineImagesEdgeZoneClientGetResponse` has been removed -- Field `VirtualMachineImagesEdgeZoneClientListSKUsResult` of struct `VirtualMachineImagesEdgeZoneClientListSKUsResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineImagesEdgeZoneClientListSKUsResponse` has been removed -- Field `CommunityGalleriesClientGetResult` of struct `CommunityGalleriesClientGetResponse` has been removed -- Field `RawResponse` of struct `CommunityGalleriesClientGetResponse` has been removed -- Field `GalleryApplicationsClientCreateOrUpdateResult` of struct `GalleryApplicationsClientCreateOrUpdateResponse` has been removed -- Field `RawResponse` of struct `GalleryApplicationsClientCreateOrUpdateResponse` has been removed -- Field `VirtualMachinesClientInstanceViewResult` of struct `VirtualMachinesClientInstanceViewResponse` has been removed -- Field `RawResponse` of struct `VirtualMachinesClientInstanceViewResponse` has been removed -- Field `DiskRestorePointClientGetResult` of struct `DiskRestorePointClientGetResponse` has been removed -- Field `RawResponse` of struct `DiskRestorePointClientGetResponse` has been removed -- Field `SharedGalleriesClientGetResult` of struct `SharedGalleriesClientGetResponse` has been removed -- Field `RawResponse` of struct `SharedGalleriesClientGetResponse` has been removed -- Field `DiskAccessesClientGetPrivateLinkResourcesResult` of struct `DiskAccessesClientGetPrivateLinkResourcesResponse` has been removed -- Field `RawResponse` of struct `DiskAccessesClientGetPrivateLinkResourcesResponse` has been removed -- Field `CloudServiceOperatingSystemsClientListOSFamiliesResult` of struct `CloudServiceOperatingSystemsClientListOSFamiliesResponse` has been removed -- Field `RawResponse` of struct `CloudServiceOperatingSystemsClientListOSFamiliesResponse` has been removed -- Field `VirtualMachineScaleSetVMExtensionsClientGetResult` of struct `VirtualMachineScaleSetVMExtensionsClientGetResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineScaleSetVMExtensionsClientGetResponse` has been removed -- Field `RawResponse` of struct `VirtualMachinesClientSimulateEvictionResponse` has been removed -- Field `RawResponse` of struct `RestorePointCollectionsClientDeleteResponse` has been removed -- Field `VirtualMachinesClientCaptureResult` of struct `VirtualMachinesClientCaptureResponse` has been removed -- Field `RawResponse` of struct `VirtualMachinesClientCaptureResponse` has been removed -- Field `GalleryApplicationsClientListByGalleryResult` of struct `GalleryApplicationsClientListByGalleryResponse` has been removed -- Field `RawResponse` of struct `GalleryApplicationsClientListByGalleryResponse` has been removed -- Field `VirtualMachineScaleSetsClientListByLocationResult` of struct `VirtualMachineScaleSetsClientListByLocationResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineScaleSetsClientListByLocationResponse` has been removed -- Field `CloudServiceRolesClientGetResult` of struct `CloudServiceRolesClientGetResponse` has been removed -- Field `RawResponse` of struct `CloudServiceRolesClientGetResponse` has been removed -- Field `CommunityGalleryImagesClientGetResult` of struct `CommunityGalleryImagesClientGetResponse` has been removed -- Field `RawResponse` of struct `CommunityGalleryImagesClientGetResponse` has been removed -- Field `SharedGalleryImagesClientGetResult` of struct `SharedGalleryImagesClientGetResponse` has been removed -- Field `RawResponse` of struct `SharedGalleryImagesClientGetResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineScaleSetVMsClientReimageAllResponse` has been removed -- Field `VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkResult` of struct `VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkResponse` has been removed -- Field `RawResponse` of struct `VirtualMachinesClientConvertToManagedDisksResponse` has been removed -- Field `DisksClientGrantAccessResult` of struct `DisksClientGrantAccessResponse` has been removed -- Field `RawResponse` of struct `DisksClientGrantAccessResponse` has been removed -- Field `RestorePointCollectionsClientGetResult` of struct `RestorePointCollectionsClientGetResponse` has been removed -- Field `RawResponse` of struct `RestorePointCollectionsClientGetResponse` has been removed -- Field `VirtualMachineSizesClientListResult` of struct `VirtualMachineSizesClientListResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineSizesClientListResponse` has been removed -- Field `SSHPublicKeysClientListByResourceGroupResult` of struct `SSHPublicKeysClientListByResourceGroupResponse` has been removed -- Field `RawResponse` of struct `SSHPublicKeysClientListByResourceGroupResponse` has been removed -- Field `VirtualMachinesClientInstallPatchesResult` of struct `VirtualMachinesClientInstallPatchesResponse` has been removed -- Field `RawResponse` of struct `VirtualMachinesClientInstallPatchesResponse` has been removed -- Field `RawResponse` of struct `RestorePointsClientDeleteResponse` has been removed -- Field `VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataResult` of struct `VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataResponse` has been removed -- Field `GalleriesClientGetResult` of struct `GalleriesClientGetResponse` has been removed -- Field `RawResponse` of struct `GalleriesClientGetResponse` has been removed -- Field `CloudServiceRoleInstancesClientGetInstanceViewResult` of struct `CloudServiceRoleInstancesClientGetInstanceViewResponse` has been removed -- Field `RawResponse` of struct `CloudServiceRoleInstancesClientGetInstanceViewResponse` has been removed -- Field `RawResponse` of struct `DiskAccessesClientDeleteAPrivateEndpointConnectionResponse` has been removed -- Field `DisksClientGetResult` of struct `DisksClientGetResponse` has been removed -- Field `RawResponse` of struct `DisksClientGetResponse` has been removed -- Field `VirtualMachineScaleSetVMsClientGetInstanceViewResult` of struct `VirtualMachineScaleSetVMsClientGetInstanceViewResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineScaleSetVMsClientGetInstanceViewResponse` has been removed -- Field `RawResponse` of struct `CloudServicesClientDeleteInstancesResponse` has been removed -- Field `CapacityReservationGroupsClientUpdateResult` of struct `CapacityReservationGroupsClientUpdateResponse` has been removed -- Field `RawResponse` of struct `CapacityReservationGroupsClientUpdateResponse` has been removed -- Field `VirtualMachineScaleSetVMExtensionsClientUpdateResult` of struct `VirtualMachineScaleSetVMExtensionsClientUpdateResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineScaleSetVMExtensionsClientUpdateResponse` has been removed -- Field `DiskRestorePointClientListByRestorePointResult` of struct `DiskRestorePointClientListByRestorePointResponse` has been removed -- Field `RawResponse` of struct `DiskRestorePointClientListByRestorePointResponse` has been removed -- Field `RawResponse` of struct `CloudServicesClientRebuildResponse` has been removed -- Field `VirtualMachinesClientListByLocationResult` of struct `VirtualMachinesClientListByLocationResponse` has been removed -- Field `RawResponse` of struct `VirtualMachinesClientListByLocationResponse` has been removed -- Field `DedicatedHostGroupsClientUpdateResult` of struct `DedicatedHostGroupsClientUpdateResponse` has been removed -- Field `RawResponse` of struct `DedicatedHostGroupsClientUpdateResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineScaleSetsClientRedeployResponse` has been removed -- Field `VirtualMachineScaleSetExtensionsClientListResult` of struct `VirtualMachineScaleSetExtensionsClientListResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineScaleSetExtensionsClientListResponse` has been removed -- Field `RestorePointCollectionsClientUpdateResult` of struct `RestorePointCollectionsClientUpdateResponse` has been removed -- Field `RawResponse` of struct `RestorePointCollectionsClientUpdateResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineScaleSetVMRunCommandsClientDeleteResponse` has been removed -- Field `DisksClientCreateOrUpdateResult` of struct `DisksClientCreateOrUpdateResponse` has been removed -- Field `RawResponse` of struct `DisksClientCreateOrUpdateResponse` has been removed -- Field `AvailabilitySetsClientCreateOrUpdateResult` of struct `AvailabilitySetsClientCreateOrUpdateResponse` has been removed -- Field `RawResponse` of struct `AvailabilitySetsClientCreateOrUpdateResponse` has been removed -- Field `VirtualMachineScaleSetVMExtensionsClientCreateOrUpdateResult` of struct `VirtualMachineScaleSetVMExtensionsClientCreateOrUpdateResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineScaleSetVMExtensionsClientCreateOrUpdateResponse` has been removed -- Field `SharedGalleryImageVersionsClientGetResult` of struct `SharedGalleryImageVersionsClientGetResponse` has been removed -- Field `RawResponse` of struct `SharedGalleryImageVersionsClientGetResponse` has been removed -- Field `RawResponse` of struct `VirtualMachinesClientRedeployResponse` has been removed -- Field `CapacityReservationsClientListByCapacityReservationGroupResult` of struct `CapacityReservationsClientListByCapacityReservationGroupResponse` has been removed -- Field `RawResponse` of struct `CapacityReservationsClientListByCapacityReservationGroupResponse` has been removed -- Field `VirtualMachineScaleSetsClientListSKUsResult` of struct `VirtualMachineScaleSetsClientListSKUsResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineScaleSetsClientListSKUsResponse` has been removed -- Field `DiskEncryptionSetsClientListAssociatedResourcesResult` of struct `DiskEncryptionSetsClientListAssociatedResourcesResponse` has been removed -- Field `RawResponse` of struct `DiskEncryptionSetsClientListAssociatedResourcesResponse` has been removed -- Field `RawResponse` of struct `CloudServicesClientDeleteResponse` has been removed -- Field `VirtualMachineScaleSetsClientUpdateResult` of struct `VirtualMachineScaleSetsClientUpdateResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineScaleSetsClientUpdateResponse` has been removed -- Field `GalleriesClientListResult` of struct `GalleriesClientListResponse` has been removed -- Field `RawResponse` of struct `GalleriesClientListResponse` has been removed -- Field `RawResponse` of struct `ImagesClientDeleteResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineScaleSetsClientStartResponse` has been removed -- Field `CloudServicesClientUpdateResult` of struct `CloudServicesClientUpdateResponse` has been removed -- Field `RawResponse` of struct `CloudServicesClientUpdateResponse` has been removed -- Field `VirtualMachineScaleSetExtensionsClientCreateOrUpdateResult` of struct `VirtualMachineScaleSetExtensionsClientCreateOrUpdateResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineScaleSetExtensionsClientCreateOrUpdateResponse` has been removed -- Field `ResourceSKUsClientListResult` of struct `ResourceSKUsClientListResponse` has been removed -- Field `RawResponse` of struct `ResourceSKUsClientListResponse` has been removed -- Field `RestorePointCollectionsClientListAllResult` of struct `RestorePointCollectionsClientListAllResponse` has been removed -- Field `RawResponse` of struct `RestorePointCollectionsClientListAllResponse` has been removed -- Field `RawResponse` of struct `DedicatedHostsClientRestartResponse` has been removed -- Field `RestorePointCollectionsClientListResult` of struct `RestorePointCollectionsClientListResponse` has been removed -- Field `RawResponse` of struct `RestorePointCollectionsClientListResponse` has been removed -- Field `ImagesClientCreateOrUpdateResult` of struct `ImagesClientCreateOrUpdateResponse` has been removed -- Field `RawResponse` of struct `ImagesClientCreateOrUpdateResponse` has been removed -- Field `VirtualMachineRunCommandsClientListResult` of struct `VirtualMachineRunCommandsClientListResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineRunCommandsClientListResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineScaleSetsClientReimageResponse` has been removed -- Field `VirtualMachineScaleSetVMExtensionsClientListResult` of struct `VirtualMachineScaleSetVMExtensionsClientListResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineScaleSetVMExtensionsClientListResponse` has been removed -- Field `DiskAccessesClientUpdateResult` of struct `DiskAccessesClientUpdateResponse` has been removed -- Field `RawResponse` of struct `DiskAccessesClientUpdateResponse` has been removed -- Field `RawResponse` of struct `VirtualMachinesClientDeleteResponse` has been removed -- Field `VirtualMachineScaleSetVMRunCommandsClientGetResult` of struct `VirtualMachineScaleSetVMRunCommandsClientGetResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineScaleSetVMRunCommandsClientGetResponse` has been removed -- Field `VirtualMachinesClientListResult` of struct `VirtualMachinesClientListResponse` has been removed -- Field `RawResponse` of struct `VirtualMachinesClientListResponse` has been removed -- Field `GalleryApplicationsClientUpdateResult` of struct `GalleryApplicationsClientUpdateResponse` has been removed -- Field `RawResponse` of struct `GalleryApplicationsClientUpdateResponse` has been removed -- Field `RawResponse` of struct `GalleryApplicationsClientDeleteResponse` has been removed -- Field `RawResponse` of struct `DiskRestorePointClientRevokeAccessResponse` has been removed -- Field `GalleriesClientUpdateResult` of struct `GalleriesClientUpdateResponse` has been removed -- Field `RawResponse` of struct `GalleriesClientUpdateResponse` has been removed -- Field `RawResponse` of struct `DiskEncryptionSetsClientDeleteResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineScaleSetsClientConvertToSinglePlacementGroupResponse` has been removed -- Field `CloudServiceRolesClientListResult` of struct `CloudServiceRolesClientListResponse` has been removed -- Field `RawResponse` of struct `CloudServiceRolesClientListResponse` has been removed -- Field `RawResponse` of struct `GalleryImagesClientDeleteResponse` has been removed -- Field `RawResponse` of struct `VirtualMachinesClientReimageResponse` has been removed -- Field `DiskEncryptionSetsClientListResult` of struct `DiskEncryptionSetsClientListResponse` has been removed -- Field `RawResponse` of struct `DiskEncryptionSetsClientListResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineScaleSetsClientRestartResponse` has been removed -- Field `GalleryImagesClientUpdateResult` of struct `GalleryImagesClientUpdateResponse` has been removed -- Field `RawResponse` of struct `GalleryImagesClientUpdateResponse` has been removed -- Field `DiskEncryptionSetsClientCreateOrUpdateResult` of struct `DiskEncryptionSetsClientCreateOrUpdateResponse` has been removed -- Field `RawResponse` of struct `DiskEncryptionSetsClientCreateOrUpdateResponse` has been removed -- Field `DedicatedHostGroupsClientCreateOrUpdateResult` of struct `DedicatedHostGroupsClientCreateOrUpdateResponse` has been removed -- Field `RawResponse` of struct `DedicatedHostGroupsClientCreateOrUpdateResponse` has been removed -- Field `ProximityPlacementGroupsClientListByResourceGroupResult` of struct `ProximityPlacementGroupsClientListByResourceGroupResponse` has been removed -- Field `RawResponse` of struct `ProximityPlacementGroupsClientListByResourceGroupResponse` has been removed -- Field `VirtualMachinesClientListAllResult` of struct `VirtualMachinesClientListAllResponse` has been removed -- Field `RawResponse` of struct `VirtualMachinesClientListAllResponse` has been removed -- Field `SSHPublicKeysClientGetResult` of struct `SSHPublicKeysClientGetResponse` has been removed -- Field `RawResponse` of struct `SSHPublicKeysClientGetResponse` has been removed -- Field `RawResponse` of struct `CloudServicesClientRestartResponse` has been removed -- Field `VirtualMachineImagesEdgeZoneClientListOffersResult` of struct `VirtualMachineImagesEdgeZoneClientListOffersResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineImagesEdgeZoneClientListOffersResponse` has been removed -- Field `VirtualMachineImagesClientListResult` of struct `VirtualMachineImagesClientListResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineImagesClientListResponse` has been removed -- Field `RestorePointCollectionsClientCreateOrUpdateResult` of struct `RestorePointCollectionsClientCreateOrUpdateResponse` has been removed -- Field `RawResponse` of struct `RestorePointCollectionsClientCreateOrUpdateResponse` has been removed -- Field `CloudServicesClientListResult` of struct `CloudServicesClientListResponse` has been removed -- Field `RawResponse` of struct `CloudServicesClientListResponse` has been removed -- Field `VirtualMachinesClientRunCommandResult` of struct `VirtualMachinesClientRunCommandResponse` has been removed -- Field `RawResponse` of struct `VirtualMachinesClientRunCommandResponse` has been removed -- Field `CapacityReservationsClientCreateOrUpdateResult` of struct `CapacityReservationsClientCreateOrUpdateResponse` has been removed -- Field `RawResponse` of struct `CapacityReservationsClientCreateOrUpdateResponse` has been removed -- Field `VirtualMachineScaleSetsClientListAllResult` of struct `VirtualMachineScaleSetsClientListAllResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineScaleSetsClientListAllResponse` has been removed -- Field `RawResponse` of struct `SnapshotsClientRevokeAccessResponse` has been removed -- Field `VirtualMachinesClientCreateOrUpdateResult` of struct `VirtualMachinesClientCreateOrUpdateResponse` has been removed -- Field `RawResponse` of struct `VirtualMachinesClientCreateOrUpdateResponse` has been removed -- Field `RawResponse` of struct `DiskAccessesClientDeleteResponse` has been removed -- Field `CloudServiceRoleInstancesClientListResult` of struct `CloudServiceRoleInstancesClientListResponse` has been removed -- Field `RawResponse` of struct `CloudServiceRoleInstancesClientListResponse` has been removed -- Field `GalleryImageVersionsClientUpdateResult` of struct `GalleryImageVersionsClientUpdateResponse` has been removed -- Field `RawResponse` of struct `GalleryImageVersionsClientUpdateResponse` has been removed -- Field `RawResponse` of struct `VirtualMachinesClientStartResponse` has been removed -- Field `ImagesClientListByResourceGroupResult` of struct `ImagesClientListByResourceGroupResponse` has been removed -- Field `RawResponse` of struct `ImagesClientListByResourceGroupResponse` has been removed -- Field `SharedGalleryImagesClientListResult` of struct `SharedGalleryImagesClientListResponse` has been removed -- Field `RawResponse` of struct `SharedGalleryImagesClientListResponse` has been removed -- Field `ProximityPlacementGroupsClientGetResult` of struct `ProximityPlacementGroupsClientGetResponse` has been removed -- Field `RawResponse` of struct `ProximityPlacementGroupsClientGetResponse` has been removed -- Field `GalleryApplicationsClientGetResult` of struct `GalleryApplicationsClientGetResponse` has been removed -- Field `RawResponse` of struct `GalleryApplicationsClientGetResponse` has been removed -- Field `DiskEncryptionSetsClientGetResult` of struct `DiskEncryptionSetsClientGetResponse` has been removed -- Field `RawResponse` of struct `DiskEncryptionSetsClientGetResponse` has been removed -- Field `DedicatedHostsClientGetResult` of struct `DedicatedHostsClientGetResponse` has been removed -- Field `RawResponse` of struct `DedicatedHostsClientGetResponse` has been removed -- Field `VirtualMachinesClientUpdateResult` of struct `VirtualMachinesClientUpdateResponse` has been removed -- Field `RawResponse` of struct `VirtualMachinesClientUpdateResponse` has been removed -- Field `CapacityReservationsClientGetResult` of struct `CapacityReservationsClientGetResponse` has been removed -- Field `RawResponse` of struct `CapacityReservationsClientGetResponse` has been removed -- Field `RawResponse` of struct `CloudServiceRoleInstancesClientReimageResponse` has been removed -- Field `RawResponse` of struct `GalleryImageVersionsClientDeleteResponse` has been removed -- Field `CloudServiceOperatingSystemsClientGetOSFamilyResult` of struct `CloudServiceOperatingSystemsClientGetOSFamilyResponse` has been removed -- Field `RawResponse` of struct `CloudServiceOperatingSystemsClientGetOSFamilyResponse` has been removed -- Field `RawResponse` of struct `CloudServicesClientStartResponse` has been removed -- Field `SSHPublicKeysClientListBySubscriptionResult` of struct `SSHPublicKeysClientListBySubscriptionResponse` has been removed -- Field `RawResponse` of struct `SSHPublicKeysClientListBySubscriptionResponse` has been removed -- Field `VirtualMachinesClientGetResult` of struct `VirtualMachinesClientGetResponse` has been removed -- Field `RawResponse` of struct `VirtualMachinesClientGetResponse` has been removed -- Field `RawResponse` of struct `VirtualMachinesClientDeallocateResponse` has been removed -- Field `VirtualMachineRunCommandsClientCreateOrUpdateResult` of struct `VirtualMachineRunCommandsClientCreateOrUpdateResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineRunCommandsClientCreateOrUpdateResponse` has been removed -- Field `RawResponse` of struct `GalleryApplicationVersionsClientDeleteResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineScaleSetVMsClientDeleteResponse` has been removed -- Field `GalleryImagesClientCreateOrUpdateResult` of struct `GalleryImagesClientCreateOrUpdateResponse` has been removed -- Field `RawResponse` of struct `GalleryImagesClientCreateOrUpdateResponse` has been removed -- Field `DiskAccessesClientUpdateAPrivateEndpointConnectionResult` of struct `DiskAccessesClientUpdateAPrivateEndpointConnectionResponse` has been removed -- Field `RawResponse` of struct `DiskAccessesClientUpdateAPrivateEndpointConnectionResponse` has been removed -- Field `UsageClientListResult` of struct `UsageClientListResponse` has been removed -- Field `RawResponse` of struct `UsageClientListResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineScaleSetVMsClientRestartResponse` has been removed -- Field `AvailabilitySetsClientUpdateResult` of struct `AvailabilitySetsClientUpdateResponse` has been removed -- Field `RawResponse` of struct `AvailabilitySetsClientUpdateResponse` has been removed -- Field `RestorePointsClientCreateResult` of struct `RestorePointsClientCreateResponse` has been removed -- Field `RawResponse` of struct `RestorePointsClientCreateResponse` has been removed -- Field `ImagesClientGetResult` of struct `ImagesClientGetResponse` has been removed -- Field `RawResponse` of struct `ImagesClientGetResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineExtensionsClientDeleteResponse` has been removed -- Field `RawResponse` of struct `CloudServicesUpdateDomainClientWalkUpdateDomainResponse` has been removed -- Field `CapacityReservationGroupsClientGetResult` of struct `CapacityReservationGroupsClientGetResponse` has been removed -- Field `RawResponse` of struct `CapacityReservationGroupsClientGetResponse` has been removed -- Field `ProximityPlacementGroupsClientCreateOrUpdateResult` of struct `ProximityPlacementGroupsClientCreateOrUpdateResponse` has been removed -- Field `RawResponse` of struct `ProximityPlacementGroupsClientCreateOrUpdateResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineScaleSetRollingUpgradesClientCancelResponse` has been removed -- Field `VirtualMachineScaleSetExtensionsClientGetResult` of struct `VirtualMachineScaleSetExtensionsClientGetResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineScaleSetExtensionsClientGetResponse` has been removed -- Field `RawResponse` of struct `AvailabilitySetsClientDeleteResponse` has been removed -- Field `LogAnalyticsClientExportThrottledRequestsResult` of struct `LogAnalyticsClientExportThrottledRequestsResponse` has been removed -- Field `RawResponse` of struct `LogAnalyticsClientExportThrottledRequestsResponse` has been removed -- Field `OperationsClientListResult` of struct `OperationsClientListResponse` has been removed -- Field `RawResponse` of struct `OperationsClientListResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineScaleSetsClientSetOrchestrationServiceStateResponse` has been removed -- Field `SnapshotsClientGetResult` of struct `SnapshotsClientGetResponse` has been removed -- Field `RawResponse` of struct `SnapshotsClientGetResponse` has been removed -- Field `VirtualMachinesClientListAvailableSizesResult` of struct `VirtualMachinesClientListAvailableSizesResponse` has been removed -- Field `RawResponse` of struct `VirtualMachinesClientListAvailableSizesResponse` has been removed -- Field `CloudServicesClientCreateOrUpdateResult` of struct `CloudServicesClientCreateOrUpdateResponse` has been removed -- Field `RawResponse` of struct `CloudServicesClientCreateOrUpdateResponse` has been removed -- Field `DisksClientListResult` of struct `DisksClientListResponse` has been removed -- Field `RawResponse` of struct `DisksClientListResponse` has been removed -- Field `RawResponse` of struct `CloudServiceRoleInstancesClientDeleteResponse` has been removed -- Field `CloudServicesClientGetResult` of struct `CloudServicesClientGetResponse` has been removed -- Field `RawResponse` of struct `CloudServicesClientGetResponse` has been removed -- Field `VirtualMachineImagesClientGetResult` of struct `VirtualMachineImagesClientGetResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineImagesClientGetResponse` has been removed -- Field `DiskEncryptionSetsClientUpdateResult` of struct `DiskEncryptionSetsClientUpdateResponse` has been removed -- Field `RawResponse` of struct `DiskEncryptionSetsClientUpdateResponse` has been removed -- Field `VirtualMachineScaleSetVMRunCommandsClientUpdateResult` of struct `VirtualMachineScaleSetVMRunCommandsClientUpdateResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineScaleSetVMRunCommandsClientUpdateResponse` has been removed -- Field `DisksClientListByResourceGroupResult` of struct `DisksClientListByResourceGroupResponse` has been removed -- Field `RawResponse` of struct `DisksClientListByResourceGroupResponse` has been removed -- Field `VirtualMachineExtensionImagesClientGetResult` of struct `VirtualMachineExtensionImagesClientGetResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineExtensionImagesClientGetResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineRunCommandsClientDeleteResponse` has been removed -- Field `VirtualMachineScaleSetsClientListResult` of struct `VirtualMachineScaleSetsClientListResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineScaleSetsClientListResponse` has been removed -- Field `GalleryApplicationVersionsClientListByGalleryApplicationResult` of struct `GalleryApplicationVersionsClientListByGalleryApplicationResponse` has been removed -- Field `RawResponse` of struct `GalleryApplicationVersionsClientListByGalleryApplicationResponse` has been removed -- Field `RawResponse` of struct `ProximityPlacementGroupsClientDeleteResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineScaleSetsClientDeleteInstancesResponse` has been removed -- Field `GalleryApplicationVersionsClientGetResult` of struct `GalleryApplicationVersionsClientGetResponse` has been removed -- Field `RawResponse` of struct `GalleryApplicationVersionsClientGetResponse` has been removed -- Field `DiskAccessesClientListPrivateEndpointConnectionsResult` of struct `DiskAccessesClientListPrivateEndpointConnectionsResponse` has been removed -- Field `RawResponse` of struct `DiskAccessesClientListPrivateEndpointConnectionsResponse` has been removed -- Field `VirtualMachineScaleSetVMsClientUpdateResult` of struct `VirtualMachineScaleSetVMsClientUpdateResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineScaleSetVMsClientUpdateResponse` has been removed -- Field `DedicatedHostsClientUpdateResult` of struct `DedicatedHostsClientUpdateResponse` has been removed -- Field `RawResponse` of struct `DedicatedHostsClientUpdateResponse` has been removed -- Field `VirtualMachineScaleSetsClientGetInstanceViewResult` of struct `VirtualMachineScaleSetsClientGetInstanceViewResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineScaleSetsClientGetInstanceViewResponse` has been removed -- Field `DedicatedHostGroupsClientListBySubscriptionResult` of struct `DedicatedHostGroupsClientListBySubscriptionResponse` has been removed -- Field `RawResponse` of struct `DedicatedHostGroupsClientListBySubscriptionResponse` has been removed -- Field `DiskAccessesClientCreateOrUpdateResult` of struct `DiskAccessesClientCreateOrUpdateResponse` has been removed -- Field `RawResponse` of struct `DiskAccessesClientCreateOrUpdateResponse` has been removed -- Field `DiskAccessesClientListByResourceGroupResult` of struct `DiskAccessesClientListByResourceGroupResponse` has been removed -- Field `RawResponse` of struct `DiskAccessesClientListByResourceGroupResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineScaleSetVMsClientPowerOffResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineScaleSetVMsClientRedeployResponse` has been removed -- Field `RestorePointsClientGetResult` of struct `RestorePointsClientGetResponse` has been removed -- Field `RawResponse` of struct `RestorePointsClientGetResponse` has been removed -- Field `ProximityPlacementGroupsClientUpdateResult` of struct `ProximityPlacementGroupsClientUpdateResponse` has been removed -- Field `RawResponse` of struct `ProximityPlacementGroupsClientUpdateResponse` has been removed -- Field `VirtualMachineScaleSetsClientGetOSUpgradeHistoryResult` of struct `VirtualMachineScaleSetsClientGetOSUpgradeHistoryResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineScaleSetsClientGetOSUpgradeHistoryResponse` has been removed -- Field `RawResponse` of struct `VirtualMachinesClientPowerOffResponse` has been removed -- Field `VirtualMachineImagesClientListOffersResult` of struct `VirtualMachineImagesClientListOffersResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineImagesClientListOffersResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineScaleSetVMsClientDeallocateResponse` has been removed -- Field `RawResponse` of struct `CloudServiceRoleInstancesClientGetRemoteDesktopFileResponse` has been removed -- Field `SnapshotsClientListResult` of struct `SnapshotsClientListResponse` has been removed -- Field `RawResponse` of struct `SnapshotsClientListResponse` has been removed -- Field `CapacityReservationsClientUpdateResult` of struct `CapacityReservationsClientUpdateResponse` has been removed -- Field `RawResponse` of struct `CapacityReservationsClientUpdateResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineScaleSetsClientReimageAllResponse` has been removed -- Field `VirtualMachineExtensionImagesClientListVersionsResult` of struct `VirtualMachineExtensionImagesClientListVersionsResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineExtensionImagesClientListVersionsResponse` has been removed -- Field `VirtualMachineExtensionImagesClientListTypesResult` of struct `VirtualMachineExtensionImagesClientListTypesResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineExtensionImagesClientListTypesResponse` has been removed -- Field `VirtualMachineScaleSetVMRunCommandsClientCreateOrUpdateResult` of struct `VirtualMachineScaleSetVMRunCommandsClientCreateOrUpdateResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineScaleSetVMRunCommandsClientCreateOrUpdateResponse` has been removed -- Field `RawResponse` of struct `DedicatedHostsClientDeleteResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineScaleSetVMsClientStartResponse` has been removed -- Field `VirtualMachineScaleSetVMsClientRunCommandResult` of struct `VirtualMachineScaleSetVMsClientRunCommandResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineScaleSetVMsClientRunCommandResponse` has been removed -- Field `ProximityPlacementGroupsClientListBySubscriptionResult` of struct `ProximityPlacementGroupsClientListBySubscriptionResponse` has been removed -- Field `RawResponse` of struct `ProximityPlacementGroupsClientListBySubscriptionResponse` has been removed -- Field `SnapshotsClientGrantAccessResult` of struct `SnapshotsClientGrantAccessResponse` has been removed -- Field `RawResponse` of struct `SnapshotsClientGrantAccessResponse` has been removed -- Field `VirtualMachineRunCommandsClientGetResult` of struct `VirtualMachineRunCommandsClientGetResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineRunCommandsClientGetResponse` has been removed -- Field `RawResponse` of struct `CloudServicesClientPowerOffResponse` has been removed -- Field `GalleriesClientCreateOrUpdateResult` of struct `GalleriesClientCreateOrUpdateResponse` has been removed -- Field `RawResponse` of struct `GalleriesClientCreateOrUpdateResponse` has been removed -- Field `SnapshotsClientUpdateResult` of struct `SnapshotsClientUpdateResponse` has been removed -- Field `RawResponse` of struct `SnapshotsClientUpdateResponse` has been removed -- Field `GalleryImagesClientGetResult` of struct `GalleryImagesClientGetResponse` has been removed -- Field `RawResponse` of struct `GalleryImagesClientGetResponse` has been removed -- Field `CloudServiceOperatingSystemsClientListOSVersionsResult` of struct `CloudServiceOperatingSystemsClientListOSVersionsResponse` has been removed -- Field `RawResponse` of struct `CloudServiceOperatingSystemsClientListOSVersionsResponse` has been removed -- Field `DedicatedHostsClientCreateOrUpdateResult` of struct `DedicatedHostsClientCreateOrUpdateResponse` has been removed -- Field `RawResponse` of struct `DedicatedHostsClientCreateOrUpdateResponse` has been removed -- Field `LogAnalyticsClientExportRequestRateByIntervalResult` of struct `LogAnalyticsClientExportRequestRateByIntervalResponse` has been removed -- Field `RawResponse` of struct `LogAnalyticsClientExportRequestRateByIntervalResponse` has been removed -- Field `RawResponse` of struct `GalleriesClientDeleteResponse` has been removed -- Field `AvailabilitySetsClientListAvailableSizesResult` of struct `AvailabilitySetsClientListAvailableSizesResponse` has been removed -- Field `RawResponse` of struct `AvailabilitySetsClientListAvailableSizesResponse` has been removed -- Field `DedicatedHostsClientListByHostGroupResult` of struct `DedicatedHostsClientListByHostGroupResponse` has been removed -- Field `RawResponse` of struct `DedicatedHostsClientListByHostGroupResponse` has been removed -- Field `CloudServicesClientListAllResult` of struct `CloudServicesClientListAllResponse` has been removed -- Field `RawResponse` of struct `CloudServicesClientListAllResponse` has been removed -- Field `AvailabilitySetsClientGetResult` of struct `AvailabilitySetsClientGetResponse` has been removed -- Field `RawResponse` of struct `AvailabilitySetsClientGetResponse` has been removed -- Field `RawResponse` of struct `VirtualMachinesClientReapplyResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineScaleSetsClientDeallocateResponse` has been removed -- Field `RawResponse` of struct `CapacityReservationsClientDeleteResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineScaleSetRollingUpgradesClientStartExtensionUpgradeResponse` has been removed -- Field `VirtualMachineExtensionsClientCreateOrUpdateResult` of struct `VirtualMachineExtensionsClientCreateOrUpdateResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineExtensionsClientCreateOrUpdateResponse` has been removed -- Field `AvailabilitySetsClientListBySubscriptionResult` of struct `AvailabilitySetsClientListBySubscriptionResponse` has been removed -- Field `RawResponse` of struct `AvailabilitySetsClientListBySubscriptionResponse` has been removed -- Field `ImagesClientUpdateResult` of struct `ImagesClientUpdateResponse` has been removed -- Field `RawResponse` of struct `ImagesClientUpdateResponse` has been removed -- Field `VirtualMachineScaleSetExtensionsClientUpdateResult` of struct `VirtualMachineScaleSetExtensionsClientUpdateResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineScaleSetExtensionsClientUpdateResponse` has been removed -- Field `RawResponse` of struct `CapacityReservationGroupsClientDeleteResponse` has been removed -- Field `GalleryImagesClientListByGalleryResult` of struct `GalleryImagesClientListByGalleryResponse` has been removed -- Field `RawResponse` of struct `GalleryImagesClientListByGalleryResponse` has been removed -- Field `VirtualMachineRunCommandsClientListByVirtualMachineResult` of struct `VirtualMachineRunCommandsClientListByVirtualMachineResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineRunCommandsClientListByVirtualMachineResponse` has been removed -- Field `DisksClientUpdateResult` of struct `DisksClientUpdateResponse` has been removed -- Field `RawResponse` of struct `DisksClientUpdateResponse` has been removed -- Field `GalleryImageVersionsClientGetResult` of struct `GalleryImageVersionsClientGetResponse` has been removed -- Field `RawResponse` of struct `GalleryImageVersionsClientGetResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineScaleSetsClientDeleteResponse` has been removed -- Field `SnapshotsClientListByResourceGroupResult` of struct `SnapshotsClientListByResourceGroupResponse` has been removed -- Field `RawResponse` of struct `SnapshotsClientListByResourceGroupResponse` has been removed -- Field `RawResponse` of struct `DedicatedHostGroupsClientDeleteResponse` has been removed -- Field `DedicatedHostGroupsClientGetResult` of struct `DedicatedHostGroupsClientGetResponse` has been removed -- Field `RawResponse` of struct `DedicatedHostGroupsClientGetResponse` has been removed -- Field `SSHPublicKeysClientUpdateResult` of struct `SSHPublicKeysClientUpdateResponse` has been removed -- Field `RawResponse` of struct `SSHPublicKeysClientUpdateResponse` has been removed -- Field `VirtualMachineImagesEdgeZoneClientListPublishersResult` of struct `VirtualMachineImagesEdgeZoneClientListPublishersResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineImagesEdgeZoneClientListPublishersResponse` has been removed -- Field `RawResponse` of struct `SSHPublicKeysClientDeleteResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineScaleSetsClientPowerOffResponse` has been removed -- Field `SnapshotsClientCreateOrUpdateResult` of struct `SnapshotsClientCreateOrUpdateResponse` has been removed -- Field `RawResponse` of struct `SnapshotsClientCreateOrUpdateResponse` has been removed -- Field `CapacityReservationGroupsClientCreateOrUpdateResult` of struct `CapacityReservationGroupsClientCreateOrUpdateResponse` has been removed -- Field `RawResponse` of struct `CapacityReservationGroupsClientCreateOrUpdateResponse` has been removed -- Field `RawResponse` of struct `VirtualMachineScaleSetVMsClientReimageResponse` has been removed -- Field `RawResponse` of struct `DisksClientRevokeAccessResponse` has been removed -- Field `RawResponse` of struct `VirtualMachinesClientPerformMaintenanceResponse` has been removed -- Field `GalleryApplicationVersionsClientUpdateResult` of struct `GalleryApplicationVersionsClientUpdateResponse` has been removed -- Field `RawResponse` of struct `GalleryApplicationVersionsClientUpdateResponse` has been removed - -### Features Added - -- New function `CommunityGalleryInfo.MarshalJSON() ([]byte, error)` -- New struct `CloudError` -- New struct `CommunityGalleryInfo` -- New struct `DiskRestorePointReplicationStatus` -- New struct `GalleryArtifactSource` -- New struct `ManagedArtifact` -- New field `ResumeToken` in struct `DedicatedHostsClientBeginUpdateOptions` -- New anonymous field `VirtualMachine` in struct `VirtualMachinesClientUpdateResponse` -- New field `ResumeToken` in struct `VirtualMachineScaleSetVMRunCommandsClientBeginCreateOrUpdateOptions` -- New anonymous field `GalleryList` in struct `GalleriesClientListResponse` -- New field `ResumeToken` in struct `VirtualMachineRunCommandsClientBeginUpdateOptions` -- New field `ResumeToken` in struct `VirtualMachineScaleSetVMsClientBeginReimageOptions` -- New field `ResumeToken` in struct `VirtualMachineScaleSetsClientBeginReimageAllOptions` -- New anonymous field `VirtualMachineScaleSetListResult` in struct `VirtualMachineScaleSetsClientListResponse` -- New anonymous field `GalleryImage` in struct `GalleryImagesClientUpdateResponse` -- New anonymous field `AvailabilitySet` in struct `AvailabilitySetsClientCreateOrUpdateResponse` -- New anonymous field `VirtualMachineScaleSetListSKUsResult` in struct `VirtualMachineScaleSetsClientListSKUsResponse` -- New anonymous field `DiskAccessList` in struct `DiskAccessesClientListResponse` -- New field `ResumeToken` in struct `VirtualMachinesClientBeginStartOptions` -- New field `VirtualMachineExtensionImageArray` in struct `VirtualMachineExtensionImagesClientListVersionsResponse` -- New anonymous field `VirtualMachineScaleSetVMInstanceView` in struct `VirtualMachineScaleSetVMsClientGetInstanceViewResponse` -- New field `Body` in struct `CloudServiceRoleInstancesClientGetRemoteDesktopFileResponse` -- New field `ResumeToken` in struct `VirtualMachineScaleSetsClientBeginPerformMaintenanceOptions` -- New anonymous field `DiskAccess` in struct `DiskAccessesClientGetResponse` -- New field `ResumeToken` in struct `CloudServiceRoleInstancesClientBeginRestartOptions` -- New field `ResumeToken` in struct `RestorePointsClientBeginCreateOptions` -- New field `ResumeToken` in struct `DiskRestorePointClientBeginRevokeAccessOptions` -- New anonymous field `SSHPublicKeyGenerateKeyPairResult` in struct `SSHPublicKeysClientGenerateKeyPairResponse` -- New anonymous field `AvailabilitySetListResult` in struct `AvailabilitySetsClientListBySubscriptionResponse` -- New field `ResumeToken` in struct `CloudServicesUpdateDomainClientBeginWalkUpdateDomainOptions` -- New anonymous field `VirtualMachineRunCommand` in struct `VirtualMachineScaleSetVMRunCommandsClientGetResponse` -- New field `ResumeToken` in struct `CloudServicesClientBeginDeleteOptions` -- New field `ResumeToken` in struct `VirtualMachinesClientBeginConvertToManagedDisksOptions` -- New field `ResumeToken` in struct `CloudServicesClientBeginStartOptions` -- New field `ResumeToken` in struct `GalleryApplicationVersionsClientBeginDeleteOptions` -- New anonymous field `AccessURI` in struct `SnapshotsClientGrantAccessResponse` -- New anonymous field `Disk` in struct `DisksClientCreateOrUpdateResponse` -- New anonymous field `VirtualMachineListResult` in struct `VirtualMachinesClientListResponse` -- New field `ResumeToken` in struct `GalleryApplicationsClientBeginDeleteOptions` -- New anonymous field `VirtualMachineCaptureResult` in struct `VirtualMachinesClientCaptureResponse` -- New anonymous field `DiskEncryptionSetList` in struct `DiskEncryptionSetsClientListByResourceGroupResponse` -- New field `ResumeToken` in struct `CloudServicesClientBeginRebuildOptions` -- New anonymous field `VirtualMachineSizeListResult` in struct `VirtualMachineSizesClientListResponse` -- New anonymous field `RestorePointCollection` in struct `RestorePointCollectionsClientCreateOrUpdateResponse` -- New anonymous field `Snapshot` in struct `SnapshotsClientCreateOrUpdateResponse` -- New field `ResumeToken` in struct `GalleriesClientBeginCreateOrUpdateOptions` -- New anonymous field `ListUsagesResult` in struct `UsageClientListResponse` -- New field `ResumeToken` in struct `VirtualMachineScaleSetsClientBeginRestartOptions` -- New anonymous field `DiskList` in struct `DisksClientListResponse` -- New field `ResumeToken` in struct `GalleryApplicationVersionsClientBeginCreateOrUpdateOptions` -- New field `ResumeToken` in struct `VirtualMachinesClientBeginPerformMaintenanceOptions` -- New anonymous field `SharingUpdate` in struct `GallerySharingProfileClientUpdateResponse` -- New anonymous field `RetrieveBootDiagnosticsDataResult` in struct `VirtualMachinesClientRetrieveBootDiagnosticsDataResponse` -- New field `ResumeToken` in struct `LogAnalyticsClientBeginExportRequestRateByIntervalOptions` -- New field `ResumeToken` in struct `SnapshotsClientBeginGrantAccessOptions` -- New anonymous field `CloudServiceInstanceView` in struct `CloudServicesClientGetInstanceViewResponse` -- New anonymous field `CapacityReservation` in struct `CapacityReservationsClientGetResponse` -- New anonymous field `ProximityPlacementGroup` in struct `ProximityPlacementGroupsClientCreateOrUpdateResponse` -- New anonymous field `DedicatedHostListResult` in struct `DedicatedHostsClientListByHostGroupResponse` -- New anonymous field `Disk` in struct `DisksClientUpdateResponse` -- New anonymous field `OperationListResult` in struct `OperationsClientListResponse` -- New anonymous field `VirtualMachineScaleSetVMListResult` in struct `VirtualMachineScaleSetVMsClientListResponse` -- New anonymous field `Image` in struct `ImagesClientUpdateResponse` -- New field `VirtualMachineExtensionImageArray` in struct `VirtualMachineExtensionImagesClientListTypesResponse` -- New anonymous field `SharedGalleryImageVersion` in struct `SharedGalleryImageVersionsClientGetResponse` -- New field `ResumeToken` in struct `DisksClientBeginCreateOrUpdateOptions` -- New anonymous field `CapacityReservationGroup` in struct `CapacityReservationGroupsClientCreateOrUpdateResponse` -- New anonymous field `VirtualMachineRunCommand` in struct `VirtualMachineScaleSetVMRunCommandsClientUpdateResponse` -- New field `ResumeToken` in struct `DiskAccessesClientBeginUpdateAPrivateEndpointConnectionOptions` -- New anonymous field `DiskRestorePointList` in struct `DiskRestorePointClientListByRestorePointResponse` -- New anonymous field `VirtualMachineScaleSet` in struct `VirtualMachineScaleSetsClientCreateOrUpdateResponse` -- New anonymous field `VirtualMachineExtensionImage` in struct `VirtualMachineExtensionImagesClientGetResponse` -- New anonymous field `AccessURI` in struct `DisksClientGrantAccessResponse` -- New anonymous field `DedicatedHostGroupListResult` in struct `DedicatedHostGroupsClientListByResourceGroupResponse` -- New anonymous field `SSHPublicKeysGroupListResult` in struct `SSHPublicKeysClientListBySubscriptionResponse` -- New anonymous field `VirtualMachineImage` in struct `VirtualMachineImagesClientGetResponse` -- New anonymous field `RestorePointCollectionListResult` in struct `RestorePointCollectionsClientListAllResponse` -- New anonymous field `CapacityReservation` in struct `CapacityReservationsClientCreateOrUpdateResponse` -- New field `ResumeToken` in struct `RestorePointsClientBeginDeleteOptions` -- New anonymous field `VirtualMachineExtensionsListResult` in struct `VirtualMachineExtensionsClientListResponse` -- New anonymous field `RollingUpgradeStatusInfo` in struct `VirtualMachineScaleSetRollingUpgradesClientGetLatestResponse` -- New field `ResumeToken` in struct `VirtualMachineScaleSetRollingUpgradesClientBeginStartExtensionUpgradeOptions` -- New field `ResumeToken` in struct `GalleriesClientBeginUpdateOptions` -- New anonymous field `VirtualMachineListResult` in struct `VirtualMachinesClientListAllResponse` -- New anonymous field `Gallery` in struct `GalleriesClientUpdateResponse` -- New field `ResumeToken` in struct `CloudServicesClientBeginRestartOptions` -- New field `VirtualMachineImageResourceArray` in struct `VirtualMachineImagesEdgeZoneClientListSKUsResponse` -- New anonymous field `VirtualMachineScaleSet` in struct `VirtualMachineScaleSetsClientGetResponse` -- New field `ResumeToken` in struct `GalleryImagesClientBeginDeleteOptions` -- New anonymous field `CapacityReservationGroupListResult` in struct `CapacityReservationGroupsClientListByResourceGroupResponse` -- New anonymous field `ImageListResult` in struct `ImagesClientListResponse` -- New anonymous field `DedicatedHost` in struct `DedicatedHostsClientGetResponse` -- New field `ResumeToken` in struct `CloudServiceRoleInstancesClientBeginDeleteOptions` -- New anonymous field `VirtualMachineScaleSetExtension` in struct `VirtualMachineScaleSetExtensionsClientCreateOrUpdateResponse` -- New field `ResumeToken` in struct `CapacityReservationsClientBeginDeleteOptions` -- New anonymous field `VirtualMachineExtension` in struct `VirtualMachineExtensionsClientUpdateResponse` -- New field `ResumeToken` in struct `DisksClientBeginGrantAccessOptions` -- New field `VirtualMachineImageResourceArray` in struct `VirtualMachineImagesClientListSKUsResponse` -- New anonymous field `ResourceURIList` in struct `DiskEncryptionSetsClientListAssociatedResourcesResponse` -- New anonymous field `OSFamily` in struct `CloudServiceOperatingSystemsClientGetOSFamilyResponse` -- New anonymous field `GalleryApplicationVersion` in struct `GalleryApplicationVersionsClientCreateOrUpdateResponse` -- New anonymous field `RestorePoint` in struct `RestorePointsClientGetResponse` -- New field `ResumeToken` in struct `VirtualMachineScaleSetsClientBeginRedeployOptions` -- New field `ResumeToken` in struct `VirtualMachinesClientBeginUpdateOptions` -- New anonymous field `LogAnalyticsOperationResult` in struct `LogAnalyticsClientExportThrottledRequestsResponse` -- New anonymous field `UpdateDomain` in struct `CloudServicesUpdateDomainClientGetUpdateDomainResponse` -- New anonymous field `VirtualMachineScaleSetVMExtension` in struct `VirtualMachineScaleSetVMExtensionsClientCreateOrUpdateResponse` -- New anonymous field `CloudServiceRoleListResult` in struct `CloudServiceRolesClientListResponse` -- New field `ResumeToken` in struct `DiskEncryptionSetsClientBeginDeleteOptions` -- New anonymous field `DiskEncryptionSetList` in struct `DiskEncryptionSetsClientListResponse` -- New field `ResumeToken` in struct `VirtualMachinesClientBeginCreateOrUpdateOptions` -- New field `ResumeToken` in struct `VirtualMachinesClientBeginDeallocateOptions` -- New anonymous field `CommunityGalleryImage` in struct `CommunityGalleryImagesClientGetResponse` -- New anonymous field `ImageListResult` in struct `ImagesClientListByResourceGroupResponse` -- New field `VirtualMachineImageResourceArray` in struct `VirtualMachineImagesClientListPublishersResponse` -- New anonymous field `GalleryImageVersion` in struct `GalleryImageVersionsClientGetResponse` -- New anonymous field `VirtualMachineAssessPatchesResult` in struct `VirtualMachinesClientAssessPatchesResponse` -- New anonymous field `VirtualMachineScaleSetExtension` in struct `VirtualMachineScaleSetExtensionsClientGetResponse` -- New field `ResumeToken` in struct `VirtualMachinesClientBeginReimageOptions` -- New field `ResumeToken` in struct `DiskEncryptionSetsClientBeginUpdateOptions` -- New anonymous field `DiskRestorePoint` in struct `DiskRestorePointClientGetResponse` -- New field `ResumeToken` in struct `VirtualMachineScaleSetVMsClientBeginRunCommandOptions` -- New anonymous field `VirtualMachineSizeListResult` in struct `VirtualMachinesClientListAvailableSizesResponse` -- New anonymous field `OSVersion` in struct `CloudServiceOperatingSystemsClientGetOSVersionResponse` -- New anonymous field `PrivateLinkResourceListResult` in struct `DiskAccessesClientGetPrivateLinkResourcesResponse` -- New anonymous field `GalleryApplication` in struct `GalleryApplicationsClientUpdateResponse` -- New anonymous field `CapacityReservationGroupListResult` in struct `CapacityReservationGroupsClientListBySubscriptionResponse` -- New field `ResumeToken` in struct `GalleryApplicationVersionsClientBeginUpdateOptions` -- New field `ResumeToken` in struct `VirtualMachineScaleSetVMExtensionsClientBeginCreateOrUpdateOptions` -- New anonymous field `CloudService` in struct `CloudServicesClientUpdateResponse` -- New anonymous field `GalleryImageVersionList` in struct `GalleryImageVersionsClientListByGalleryImageResponse` -- New field `ResumeToken` in struct `SnapshotsClientBeginCreateOrUpdateOptions` -- New anonymous field `CloudService` in struct `CloudServicesClientCreateOrUpdateResponse` -- New anonymous field `CapacityReservation` in struct `CapacityReservationsClientUpdateResponse` -- New anonymous field `RestorePointCollection` in struct `RestorePointCollectionsClientGetResponse` -- New anonymous field `DiskAccessList` in struct `DiskAccessesClientListByResourceGroupResponse` -- New field `ResumeToken` in struct `GalleryImageVersionsClientBeginUpdateOptions` -- New anonymous field `SharedGallery` in struct `SharedGalleriesClientGetResponse` -- New field `ResumeToken` in struct `VirtualMachineScaleSetVMsClientBeginRestartOptions` -- New field `ResumeToken` in struct `SnapshotsClientBeginUpdateOptions` -- New anonymous field `RoleInstanceListResult` in struct `CloudServiceRoleInstancesClientListResponse` -- New anonymous field `CommunityGalleryImageVersion` in struct `CommunityGalleryImageVersionsClientGetResponse` -- New anonymous field `VirtualMachineScaleSetVMExtension` in struct `VirtualMachineScaleSetVMExtensionsClientGetResponse` -- New anonymous field `DiskEncryptionSet` in struct `DiskEncryptionSetsClientGetResponse` -- New anonymous field `VirtualMachineScaleSetVM` in struct `VirtualMachineScaleSetVMsClientGetResponse` -- New field `ResumeToken` in struct `CloudServicesClientBeginReimageOptions` -- New field `ResumeToken` in struct `GalleryApplicationsClientBeginCreateOrUpdateOptions` -- New anonymous field `GalleryApplicationList` in struct `GalleryApplicationsClientListByGalleryResponse` -- New field `ResumeToken` in struct `CloudServiceRoleInstancesClientBeginReimageOptions` -- New field `ResumeToken` in struct `CloudServicesClientBeginPowerOffOptions` -- New field `ResumeToken` in struct `VirtualMachineRunCommandsClientBeginCreateOrUpdateOptions` -- New anonymous field `DedicatedHost` in struct `DedicatedHostsClientCreateOrUpdateResponse` -- New anonymous field `GalleryList` in struct `GalleriesClientListByResourceGroupResponse` -- New anonymous field `RunCommandResult` in struct `VirtualMachineScaleSetVMsClientRunCommandResponse` -- New anonymous field `VirtualMachineRunCommandsListResult` in struct `VirtualMachineRunCommandsClientListByVirtualMachineResponse` -- New anonymous field `UpdateDomainListResult` in struct `CloudServicesUpdateDomainClientListUpdateDomainsResponse` -- New anonymous field `VirtualMachineScaleSet` in struct `VirtualMachineScaleSetsClientUpdateResponse` -- New anonymous field `SSHPublicKeyResource` in struct `SSHPublicKeysClientUpdateResponse` -- New field `ResumeToken` in struct `VirtualMachineScaleSetVMRunCommandsClientBeginDeleteOptions` -- New field `ResumeToken` in struct `VirtualMachineScaleSetsClientBeginReimageOptions` -- New anonymous field `RunCommandDocument` in struct `VirtualMachineRunCommandsClientGetResponse` -- New anonymous field `VirtualMachineInstallPatchesResult` in struct `VirtualMachinesClientInstallPatchesResponse` -- New anonymous field `SharedGalleryList` in struct `SharedGalleriesClientListResponse` -- New anonymous field `VirtualMachineScaleSetListResult` in struct `VirtualMachineScaleSetsClientListByLocationResponse` -- New field `ResumeToken` in struct `DiskRestorePointClientBeginGrantAccessOptions` -- New anonymous field `DedicatedHostGroup` in struct `DedicatedHostGroupsClientUpdateResponse` -- New anonymous field `ProximityPlacementGroup` in struct `ProximityPlacementGroupsClientGetResponse` -- New field `ResumeToken` in struct `GalleryImagesClientBeginUpdateOptions` -- New field `ResumeToken` in struct `DedicatedHostsClientBeginCreateOrUpdateOptions` -- New anonymous field `GalleryApplicationVersionList` in struct `GalleryApplicationVersionsClientListByGalleryApplicationResponse` -- New anonymous field `GalleryApplication` in struct `GalleryApplicationsClientCreateOrUpdateResponse` -- New field `ResumeToken` in struct `VirtualMachineScaleSetVMsClientBeginPerformMaintenanceOptions` -- New anonymous field `PrivateEndpointConnectionListResult` in struct `DiskAccessesClientListPrivateEndpointConnectionsResponse` -- New field `ResumeToken` in struct `CloudServicesClientBeginDeleteInstancesOptions` -- New field `ResumeToken` in struct `VirtualMachinesClientBeginAssessPatchesOptions` -- New field `ResumeToken` in struct `DiskAccessesClientBeginDeleteOptions` -- New anonymous field `VirtualMachineExtension` in struct `VirtualMachineExtensionsClientCreateOrUpdateResponse` -- New anonymous field `DedicatedHost` in struct `DedicatedHostsClientUpdateResponse` -- New field `ResumeToken` in struct `VirtualMachineScaleSetVMExtensionsClientBeginDeleteOptions` -- New anonymous field `VirtualMachineScaleSetVMExtensionsListResult` in struct `VirtualMachineScaleSetVMExtensionsClientListResponse` -- New field `ResumeToken` in struct `VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions` -- New field `ResumeToken` in struct `GalleriesClientBeginDeleteOptions` -- New field `ResumeToken` in struct `ImagesClientBeginUpdateOptions` -- New field `ResumeToken` in struct `DisksClientBeginRevokeAccessOptions` -- New field `ResumeToken` in struct `VirtualMachineScaleSetsClientBeginStartOptions` -- New anonymous field `SSHPublicKeysGroupListResult` in struct `SSHPublicKeysClientListByResourceGroupResponse` -- New field `ResumeToken` in struct `SnapshotsClientBeginRevokeAccessOptions` -- New field `ResumeToken` in struct `ImagesClientBeginDeleteOptions` -- New anonymous field `VirtualMachineScaleSetExtension` in struct `VirtualMachineScaleSetExtensionsClientUpdateResponse` -- New anonymous field `Disk` in struct `DisksClientGetResponse` -- New field `ResumeToken` in struct `GalleryImageVersionsClientBeginCreateOrUpdateOptions` -- New anonymous field `VirtualMachineSizeListResult` in struct `AvailabilitySetsClientListAvailableSizesResponse` -- New field `ResumeToken` in struct `VirtualMachinesClientBeginDeleteOptions` -- New anonymous field `SnapshotList` in struct `SnapshotsClientListResponse` -- New field `ResumeToken` in struct `VirtualMachineExtensionsClientBeginDeleteOptions` -- New field `ResumeToken` in struct `VirtualMachineExtensionsClientBeginUpdateOptions` -- New field `ResumeToken` in struct `GalleryApplicationsClientBeginUpdateOptions` -- New anonymous field `SharedGalleryImageList` in struct `SharedGalleryImagesClientListResponse` -- New field `VirtualMachineImageResourceArray` in struct `VirtualMachineImagesClientListResponse` -- New field `ResumeToken` in struct `CloudServiceRoleInstancesClientBeginRebuildOptions` -- New anonymous field `CapacityReservationGroup` in struct `CapacityReservationGroupsClientUpdateResponse` -- New field `ResumeToken` in struct `VirtualMachineScaleSetExtensionsClientBeginCreateOrUpdateOptions` -- New field `ResumeToken` in struct `DisksClientBeginUpdateOptions` -- New anonymous field `ProximityPlacementGroupListResult` in struct `ProximityPlacementGroupsClientListByResourceGroupResponse` -- New anonymous field `VirtualMachine` in struct `VirtualMachinesClientCreateOrUpdateResponse` -- New anonymous field `Gallery` in struct `GalleriesClientGetResponse` -- New anonymous field `GalleryImage` in struct `GalleryImagesClientCreateOrUpdateResponse` -- New field `VirtualMachineImageResourceArray` in struct `VirtualMachineImagesEdgeZoneClientListOffersResponse` -- New anonymous field `VirtualMachineRunCommand` in struct `VirtualMachineRunCommandsClientGetByVirtualMachineResponse` -- New anonymous field `VirtualMachineRunCommandsListResult` in struct `VirtualMachineScaleSetVMRunCommandsClientListResponse` -- New anonymous field `CapacityReservationGroup` in struct `CapacityReservationGroupsClientGetResponse` -- New field `ResumeToken` in struct `VirtualMachineScaleSetsClientBeginDeallocateOptions` -- New anonymous field `CloudServiceListResult` in struct `CloudServicesClientListResponse` -- New field `ResumeToken` in struct `VirtualMachinesClientBeginPowerOffOptions` -- New anonymous field `CapacityReservationListResult` in struct `CapacityReservationsClientListByCapacityReservationGroupResponse` -- New anonymous field `SharedGalleryImage` in struct `SharedGalleryImagesClientGetResponse` -- New anonymous field `VirtualMachineRunCommand` in struct `VirtualMachineRunCommandsClientCreateOrUpdateResponse` -- New anonymous field `RestorePointCollectionListResult` in struct `RestorePointCollectionsClientListResponse` -- New anonymous field `RoleInstance` in struct `CloudServiceRoleInstancesClientGetResponse` -- New anonymous field `VirtualMachineScaleSetExtensionListResult` in struct `VirtualMachineScaleSetExtensionsClientListResponse` -- New anonymous field `AvailabilitySet` in struct `AvailabilitySetsClientUpdateResponse` -- New field `ResumeToken` in struct `VirtualMachineScaleSetRollingUpgradesClientBeginCancelOptions` -- New field `ResumeToken` in struct `LogAnalyticsClientBeginExportThrottledRequestsOptions` -- New field `ResumeToken` in struct `DedicatedHostsClientBeginRestartOptions` -- New field `ResumeToken` in struct `ImagesClientBeginCreateOrUpdateOptions` -- New field `ResumeToken` in struct `VirtualMachineScaleSetVMsClientBeginDeallocateOptions` -- New field `VirtualMachineImageResourceArray` in struct `VirtualMachineImagesEdgeZoneClientListResponse` -- New anonymous field `GalleryImageList` in struct `GalleryImagesClientListByGalleryResponse` -- New anonymous field `AccessURI` in struct `DiskRestorePointClientGrantAccessResponse` -- New anonymous field `RunCommandResult` in struct `VirtualMachinesClientRunCommandResponse` -- New field `VirtualMachineImageResourceArray` in struct `VirtualMachineImagesClientListOffersResponse` -- New field `ResumeToken` in struct `DiskAccessesClientBeginCreateOrUpdateOptions` -- New anonymous field `CloudServiceListResult` in struct `CloudServicesClientListAllResponse` -- New anonymous field `RestorePoint` in struct `RestorePointsClientCreateResponse` -- New field `ResumeToken` in struct `VirtualMachinesClientBeginRunCommandOptions` -- New anonymous field `RunCommandListResult` in struct `VirtualMachineRunCommandsClientListResponse` -- New anonymous field `GalleryImageVersion` in struct `GalleryImageVersionsClientUpdateResponse` -- New anonymous field `Image` in struct `ImagesClientCreateOrUpdateResponse` -- New field `ResumeToken` in struct `SnapshotsClientBeginDeleteOptions` -- New anonymous field `LogAnalyticsOperationResult` in struct `LogAnalyticsClientExportRequestRateByIntervalResponse` -- New anonymous field `VirtualMachineInstanceView` in struct `VirtualMachinesClientInstanceViewResponse` -- New anonymous field `CloudServiceRole` in struct `CloudServiceRolesClientGetResponse` -- New field `ResumeToken` in struct `VirtualMachineScaleSetsClientBeginDeleteInstancesOptions` -- New field `VirtualMachineImageResourceArray` in struct `VirtualMachineImagesEdgeZoneClientListPublishersResponse` -- New anonymous field `RecoveryWalkResponse` in struct `VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkResponse` -- New anonymous field `DedicatedHostGroup` in struct `DedicatedHostGroupsClientCreateOrUpdateResponse` -- New field `ResumeToken` in struct `DiskEncryptionSetsClientBeginCreateOrUpdateOptions` -- New anonymous field `Snapshot` in struct `SnapshotsClientUpdateResponse` -- New anonymous field `ResourceSKUsResult` in struct `ResourceSKUsClientListResponse` -- New anonymous field `SnapshotList` in struct `SnapshotsClientListByResourceGroupResponse` -- New anonymous field `GalleryImageVersion` in struct `GalleryImageVersionsClientCreateOrUpdateResponse` -- New anonymous field `ProximityPlacementGroup` in struct `ProximityPlacementGroupsClientUpdateResponse` -- New field `ResumeToken` in struct `VirtualMachineScaleSetVMsClientBeginReimageAllOptions` -- New anonymous field `Gallery` in struct `GalleriesClientCreateOrUpdateResponse` -- New anonymous field `SharedGalleryImageVersionList` in struct `SharedGalleryImageVersionsClientListResponse` -- New field `ResumeToken` in struct `VirtualMachinesClientBeginCaptureOptions` -- New anonymous field `ProximityPlacementGroupListResult` in struct `ProximityPlacementGroupsClientListBySubscriptionResponse` -- New anonymous field `OSVersionListResult` in struct `CloudServiceOperatingSystemsClientListOSVersionsResponse` -- New anonymous field `GalleryImage` in struct `GalleryImagesClientGetResponse` -- New field `ResumeToken` in struct `DiskAccessesClientBeginUpdateOptions` -- New field `ResumeToken` in struct `DiskAccessesClientBeginDeleteAPrivateEndpointConnectionOptions` -- New field `ResumeToken` in struct `CapacityReservationsClientBeginUpdateOptions` -- New anonymous field `AvailabilitySetListResult` in struct `AvailabilitySetsClientListResponse` -- New field `ResumeToken` in struct `DedicatedHostsClientBeginDeleteOptions` -- New field `ResumeToken` in struct `VirtualMachineScaleSetVMRunCommandsClientBeginUpdateOptions` -- New anonymous field `VirtualMachineScaleSetListOSUpgradeHistory` in struct `VirtualMachineScaleSetsClientGetOSUpgradeHistoryResponse` -- New anonymous field `VirtualMachineScaleSetVM` in struct `VirtualMachineScaleSetVMsClientUpdateResponse` -- New field `ResumeToken` in struct `VirtualMachineScaleSetsClientBeginUpdateInstancesOptions` -- New anonymous field `GalleryApplicationVersion` in struct `GalleryApplicationVersionsClientGetResponse` -- New field `ResumeToken` in struct `VirtualMachineScaleSetVMsClientBeginUpdateOptions` -- New anonymous field `RetrieveBootDiagnosticsDataResult` in struct `VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataResponse` -- New field `ResumeToken` in struct `CloudServicesClientBeginUpdateOptions` -- New anonymous field `DiskList` in struct `DisksClientListByResourceGroupResponse` -- New anonymous field `GalleryApplication` in struct `GalleryApplicationsClientGetResponse` -- New field `ResumeToken` in struct `VirtualMachineScaleSetsClientBeginUpdateOptions` -- New anonymous field `Snapshot` in struct `SnapshotsClientGetResponse` -- New anonymous field `VirtualMachineListResult` in struct `VirtualMachinesClientListByLocationResponse` -- New field `ResumeToken` in struct `VirtualMachinesClientBeginReapplyOptions` -- New field `ResumeToken` in struct `VirtualMachineScaleSetVMsClientBeginDeleteOptions` -- New field `ResumeToken` in struct `VirtualMachineScaleSetsClientBeginSetOrchestrationServiceStateOptions` -- New anonymous field `RoleInstanceView` in struct `CloudServiceRoleInstancesClientGetInstanceViewResponse` -- New field `ResumeToken` in struct `RestorePointCollectionsClientBeginDeleteOptions` -- New field `ResumeToken` in struct `CapacityReservationsClientBeginCreateOrUpdateOptions` -- New anonymous field `DiskEncryptionSet` in struct `DiskEncryptionSetsClientCreateOrUpdateResponse` -- New anonymous field `SSHPublicKeyResource` in struct `SSHPublicKeysClientCreateResponse` -- New field `ResumeToken` in struct `VirtualMachineScaleSetVMsClientBeginPowerOffOptions` -- New anonymous field `DiskEncryptionSet` in struct `DiskEncryptionSetsClientUpdateResponse` -- New anonymous field `DedicatedHostGroup` in struct `DedicatedHostGroupsClientGetResponse` -- New field `ResumeToken` in struct `VirtualMachineScaleSetVMsClientBeginRedeployOptions` -- New field `ResumeToken` in struct `VirtualMachinesClientBeginRedeployOptions` -- New anonymous field `VirtualMachineScaleSetListWithLinkResult` in struct `VirtualMachineScaleSetsClientListAllResponse` -- New field `ResumeToken` in struct `GalleryImagesClientBeginCreateOrUpdateOptions` -- New anonymous field `VirtualMachineImage` in struct `VirtualMachineImagesEdgeZoneClientGetResponse` -- New field `ResumeToken` in struct `VirtualMachinesClientBeginInstallPatchesOptions` -- New field `ResumeToken` in struct `VirtualMachineScaleSetExtensionsClientBeginDeleteOptions` -- New field `ResumeToken` in struct `VirtualMachineScaleSetVMExtensionsClientBeginUpdateOptions` -- New field `ResumeToken` in struct `VirtualMachinesClientBeginRestartOptions` -- New anonymous field `DedicatedHostGroupListResult` in struct `DedicatedHostGroupsClientListBySubscriptionResponse` -- New field `ResumeToken` in struct `VirtualMachineScaleSetVMsClientBeginStartOptions` -- New anonymous field `VirtualMachineRunCommand` in struct `VirtualMachineScaleSetVMRunCommandsClientCreateOrUpdateResponse` -- New field `ResumeToken` in struct `GallerySharingProfileClientBeginUpdateOptions` -- New anonymous field `VirtualMachineRunCommand` in struct `VirtualMachineRunCommandsClientUpdateResponse` -- New field `ResumeToken` in struct `GalleryImageVersionsClientBeginDeleteOptions` -- New field `ResumeToken` in struct `VirtualMachineScaleSetExtensionsClientBeginUpdateOptions` -- New anonymous field `RestorePointCollection` in struct `RestorePointCollectionsClientUpdateResponse` -- New anonymous field `VirtualMachineExtension` in struct `VirtualMachineExtensionsClientGetResponse` -- New anonymous field `DiskAccess` in struct `DiskAccessesClientUpdateResponse` -- New field `ResumeToken` in struct `VirtualMachineScaleSetsClientBeginDeleteOptions` -- New field `ResumeToken` in struct `CloudServicesClientBeginCreateOrUpdateOptions` -- New anonymous field `Image` in struct `ImagesClientGetResponse` -- New anonymous field `GalleryApplicationVersion` in struct `GalleryApplicationVersionsClientUpdateResponse` -- New anonymous field `PrivateEndpointConnection` in struct `DiskAccessesClientGetAPrivateEndpointConnectionResponse` -- New anonymous field `VirtualMachineScaleSetInstanceView` in struct `VirtualMachineScaleSetsClientGetInstanceViewResponse` -- New field `ResumeToken` in struct `VirtualMachineScaleSetsClientBeginPowerOffOptions` -- New field `ResumeToken` in struct `DisksClientBeginDeleteOptions` -- New anonymous field `VirtualMachine` in struct `VirtualMachinesClientGetResponse` -- New anonymous field `DiskAccess` in struct `DiskAccessesClientCreateOrUpdateResponse` -- New anonymous field `OSFamilyListResult` in struct `CloudServiceOperatingSystemsClientListOSFamiliesResponse` -- New field `ResumeToken` in struct `VirtualMachineScaleSetRollingUpgradesClientBeginStartOSUpgradeOptions` -- New field `ResumeToken` in struct `VirtualMachineExtensionsClientBeginCreateOrUpdateOptions` -- New anonymous field `CommunityGallery` in struct `CommunityGalleriesClientGetResponse` -- New anonymous field `PrivateEndpointConnection` in struct `DiskAccessesClientUpdateAPrivateEndpointConnectionResponse` -- New anonymous field `AvailabilitySet` in struct `AvailabilitySetsClientGetResponse` -- New anonymous field `VirtualMachineScaleSetVMExtension` in struct `VirtualMachineScaleSetVMExtensionsClientUpdateResponse` -- New field `ResumeToken` in struct `VirtualMachineRunCommandsClientBeginDeleteOptions` -- New anonymous field `SSHPublicKeyResource` in struct `SSHPublicKeysClientGetResponse` -- New anonymous field `CloudService` in struct `CloudServicesClientGetResponse` - - -## 0.5.0 (2022-03-07) -### Features Added - -- New const `DataAccessAuthModeAzureActiveDirectory` -- New const `DataAccessAuthModeNone` -- New function `PossibleDataAccessAuthModeValues() []DataAccessAuthMode` -- New function `DataAccessAuthMode.ToPtr() *DataAccessAuthMode` -- New field `DataAccessAuthMode` in struct `SnapshotProperties` -- New field `DataAccessAuthMode` in struct `DiskProperties` -- New field `Architecture` in struct `SupportedCapabilities` -- New field `DataAccessAuthMode` in struct `SnapshotUpdateProperties` -- New field `DataAccessAuthMode` in struct `DiskUpdateProperties` - - -## 0.4.0 (2022-03-02) -### Breaking Changes - -- Type of `VirtualMachineExtensionProperties.ProtectedSettings` has been changed from `map[string]interface{}` to `interface{}` -- Type of `VirtualMachineExtensionProperties.Settings` has been changed from `map[string]interface{}` to `interface{}` -- Type of `VirtualMachineScaleSetExtensionProperties.ProtectedSettings` has been changed from `map[string]interface{}` to `interface{}` -- Type of `VirtualMachineScaleSetExtensionProperties.Settings` has been changed from `map[string]interface{}` to `interface{}` -- Type of `VirtualMachineCaptureResult.Parameters` has been changed from `map[string]interface{}` to `interface{}` -- Type of `VirtualMachineCaptureResult.Resources` has been changed from `[]map[string]interface{}` to `[]interface{}` -- Type of `VirtualMachineExtensionUpdateProperties.ProtectedSettings` has been changed from `map[string]interface{}` to `interface{}` -- Type of `VirtualMachineExtensionUpdateProperties.Settings` has been changed from `map[string]interface{}` to `interface{}` -- Struct `CloudError` has been removed -- Struct `GalleryArtifactSource` has been removed -- Struct `ManagedArtifact` has been removed - -### Features Added - -- New const `RepairActionReplace` -- New const `RestorePointExpandOptionsInstanceView` -- New const `GalleryExtendedLocationTypeEdgeZone` -- New const `ConfidentialVMEncryptionTypeEncryptedVMGuestStateOnlyWithPmk` -- New const `SharingProfileGroupTypesCommunity` -- New const `ArchitectureTypesArm64` -- New const `RepairActionReimage` -- New const `ArchitectureX64` -- New const `SecurityEncryptionTypesDiskWithVMGuestState` -- New const `SecurityTypesConfidentialVM` -- New const `SharingStateSucceeded` -- New const `RepairActionRestart` -- New const `SecurityEncryptionTypesVMGuestStateOnly` -- New const `SharingUpdateOperationTypesEnableCommunity` -- New const `SharingStateUnknown` -- New const `SharingStateInProgress` -- New const `ConfidentialVMEncryptionTypeEncryptedWithPmk` -- New const `SharingStateFailed` -- New const `ConfidentialVMEncryptionTypeEncryptedWithCmk` -- New const `ArchitectureTypesX64` -- New const `GalleryExtendedLocationTypeUnknown` -- New const `GalleryExpandParamsSharingProfileGroups` -- New const `ArchitectureArm64` -- New function `RestorePointExpandOptions.ToPtr() *RestorePointExpandOptions` -- New function `PossibleGalleryExtendedLocationTypeValues() []GalleryExtendedLocationType` -- New function `PossibleGalleryExpandParamsValues() []GalleryExpandParams` -- New function `PossibleSharingStateValues() []SharingState` -- New function `PossibleSecurityEncryptionTypesValues() []SecurityEncryptionTypes` -- New function `PossibleArchitectureTypesValues() []ArchitectureTypes` -- New function `*DedicatedHostsClientRestartPollerResponse.Resume(context.Context, *DedicatedHostsClient, string) error` -- New function `DedicatedHostsClientRestartPollerResponse.PollUntilDone(context.Context, time.Duration) (DedicatedHostsClientRestartResponse, error)` -- New function `ConfidentialVMEncryptionType.ToPtr() *ConfidentialVMEncryptionType` -- New function `SharingState.ToPtr() *SharingState` -- New function `PossibleConfidentialVMEncryptionTypeValues() []ConfidentialVMEncryptionType` -- New function `*DedicatedHostsClient.BeginRestart(context.Context, string, string, string, *DedicatedHostsClientBeginRestartOptions) (DedicatedHostsClientRestartPollerResponse, error)` -- New function `RestorePointInstanceView.MarshalJSON() ([]byte, error)` -- New function `*DedicatedHostsClientRestartPoller.ResumeToken() (string, error)` -- New function `*VirtualMachineProperties.UnmarshalJSON([]byte) error` -- New function `SharingStatus.MarshalJSON() ([]byte, error)` -- New function `SecurityEncryptionTypes.ToPtr() *SecurityEncryptionTypes` -- New function `PossibleArchitectureValues() []Architecture` -- New function `PossibleRestorePointExpandOptionsValues() []RestorePointExpandOptions` -- New function `GalleryExtendedLocationType.ToPtr() *GalleryExtendedLocationType` -- New function `ArchitectureTypes.ToPtr() *ArchitectureTypes` -- New function `GalleryExpandParams.ToPtr() *GalleryExpandParams` -- New function `*DedicatedHostsClientRestartPoller.Done() bool` -- New function `RepairAction.ToPtr() *RepairAction` -- New function `PossibleRepairActionValues() []RepairAction` -- New function `VirtualMachineScaleSetProperties.MarshalJSON() ([]byte, error)` -- New function `*VirtualMachineScaleSetProperties.UnmarshalJSON([]byte) error` -- New function `*DedicatedHostsClientRestartPoller.FinalResponse(context.Context) (DedicatedHostsClientRestartResponse, error)` -- New function `*DedicatedHostsClientRestartPoller.Poll(context.Context) (*http.Response, error)` -- New function `Architecture.ToPtr() *Architecture` -- New function `VirtualMachineProperties.MarshalJSON() ([]byte, error)` -- New struct `DedicatedHostsClientBeginRestartOptions` -- New struct `DedicatedHostsClientRestartPoller` -- New struct `DedicatedHostsClientRestartPollerResponse` -- New struct `DedicatedHostsClientRestartResponse` -- New struct `DiskRestorePointInstanceView` -- New struct `GalleryExtendedLocation` -- New struct `GalleryTargetExtendedLocation` -- New struct `OSDiskImageSecurityProfile` -- New struct `RegionalSharingStatus` -- New struct `RestorePointInstanceView` -- New struct `SharingStatus` -- New struct `VMDiskSecurityProfile` -- New struct `VirtualMachineScaleSetHardwareProfile` -- New field `SourceRestorePoint` in struct `RestorePointProperties` -- New field `InstanceView` in struct `RestorePointProperties` -- New field `SecurityProfile` in struct `VirtualMachineScaleSetManagedDiskParameters` -- New field `TimeCreated` in struct `VirtualMachineProperties` -- New field `ProtectedSettingsFromKeyVault` in struct `VirtualMachineExtensionUpdateProperties` -- New field `SecurityProfile` in struct `ManagedDiskParameters` -- New field `TimeCreated` in struct `CapacityReservationProperties` -- New field `Expand` in struct `RestorePointsClientGetOptions` -- New field `PlacementGroupID` in struct `VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkOptions` -- New field `Zone` in struct `VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkOptions` -- New field `TimeCreated` in struct `VirtualMachineScaleSetProperties` -- New field `CommunityGalleryImageID` in struct `ImageReference` -- New field `AllowExtensionOperations` in struct `VirtualMachineScaleSetOSProfile` -- New field `ProtectedSettingsFromKeyVault` in struct `VirtualMachineScaleSetExtensionProperties` -- New field `PublicIPPrefix` in struct `VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties` -- New field `Filter` in struct `VirtualMachinesClientListOptions` -- New field `TargetExtendedLocations` in struct `GalleryImageVersionPublishingProfile` -- New field `Architecture` in struct `VirtualMachineImageProperties` -- New field `HardwareProfile` in struct `VirtualMachineScaleSetVMProfile` -- New field `Architecture` in struct `GalleryImageProperties` -- New field `SecurityProfile` in struct `OSDiskImageEncryption` -- New field `TimeCreated` in struct `DedicatedHostProperties` -- New field `TargetExtendedLocations` in struct `GalleryArtifactPublishingProfileBase` -- New field `TargetExtendedLocations` in struct `GalleryApplicationVersionPublishingProfile` -- New field `Expand` in struct `GalleriesClientGetOptions` -- New field `Filter` in struct `VirtualMachinesClientListAllOptions` -- New field `RepairAction` in struct `AutomaticRepairsPolicy` -- New field `SharingStatus` in struct `GalleryProperties` -- New field `CommunityGalleryInfo` in struct `SharingProfile` -- New field `ProtectedSettingsFromKeyVault` in struct `VirtualMachineExtensionProperties` - - -## 0.3.1 (2022-02-22) - -### Other Changes - -- Remove the go_mod_tidy_hack.go file. - -## 0.3.0 (2022-01-13) -### Breaking Changes - -- Function `*VirtualMachineScaleSetsClient.ListAll` parameter(s) have been changed from `(*VirtualMachineScaleSetsListAllOptions)` to `(*VirtualMachineScaleSetsClientListAllOptions)` -- Function `*VirtualMachineScaleSetsClient.ListAll` return value(s) have been changed from `(*VirtualMachineScaleSetsListAllPager)` to `(*VirtualMachineScaleSetsClientListAllPager)` -- Function `*VirtualMachinesClient.Generalize` parameter(s) have been changed from `(context.Context, string, string, *VirtualMachinesGeneralizeOptions)` to `(context.Context, string, string, *VirtualMachinesClientGeneralizeOptions)` -- Function `*VirtualMachinesClient.Generalize` return value(s) have been changed from `(VirtualMachinesGeneralizeResponse, error)` to `(VirtualMachinesClientGeneralizeResponse, error)` -- Function `*DedicatedHostsClient.Get` parameter(s) have been changed from `(context.Context, string, string, string, *DedicatedHostsGetOptions)` to `(context.Context, string, string, string, *DedicatedHostsClientGetOptions)` -- Function `*DedicatedHostsClient.Get` return value(s) have been changed from `(DedicatedHostsGetResponse, error)` to `(DedicatedHostsClientGetResponse, error)` -- Function `*ProximityPlacementGroupsClient.Get` parameter(s) have been changed from `(context.Context, string, string, *ProximityPlacementGroupsGetOptions)` to `(context.Context, string, string, *ProximityPlacementGroupsClientGetOptions)` -- Function `*ProximityPlacementGroupsClient.Get` return value(s) have been changed from `(ProximityPlacementGroupsGetResponse, error)` to `(ProximityPlacementGroupsClientGetResponse, error)` -- Function `*VirtualMachinesClient.ListByLocation` parameter(s) have been changed from `(string, *VirtualMachinesListByLocationOptions)` to `(string, *VirtualMachinesClientListByLocationOptions)` -- Function `*VirtualMachinesClient.ListByLocation` return value(s) have been changed from `(*VirtualMachinesListByLocationPager)` to `(*VirtualMachinesClientListByLocationPager)` -- Function `*DiskEncryptionSetsClient.BeginDelete` parameter(s) have been changed from `(context.Context, string, string, *DiskEncryptionSetsBeginDeleteOptions)` to `(context.Context, string, string, *DiskEncryptionSetsClientBeginDeleteOptions)` -- Function `*DiskEncryptionSetsClient.BeginDelete` return value(s) have been changed from `(DiskEncryptionSetsDeletePollerResponse, error)` to `(DiskEncryptionSetsClientDeletePollerResponse, error)` -- Function `*AvailabilitySetsClient.List` parameter(s) have been changed from `(string, *AvailabilitySetsListOptions)` to `(string, *AvailabilitySetsClientListOptions)` -- Function `*AvailabilitySetsClient.List` return value(s) have been changed from `(*AvailabilitySetsListPager)` to `(*AvailabilitySetsClientListPager)` -- Function `*VirtualMachinesClient.SimulateEviction` parameter(s) have been changed from `(context.Context, string, string, *VirtualMachinesSimulateEvictionOptions)` to `(context.Context, string, string, *VirtualMachinesClientSimulateEvictionOptions)` -- Function `*VirtualMachinesClient.SimulateEviction` return value(s) have been changed from `(VirtualMachinesSimulateEvictionResponse, error)` to `(VirtualMachinesClientSimulateEvictionResponse, error)` -- Function `*VirtualMachineImagesClient.ListOffers` parameter(s) have been changed from `(context.Context, string, string, *VirtualMachineImagesListOffersOptions)` to `(context.Context, string, string, *VirtualMachineImagesClientListOffersOptions)` -- Function `*VirtualMachineImagesClient.ListOffers` return value(s) have been changed from `(VirtualMachineImagesListOffersResponse, error)` to `(VirtualMachineImagesClientListOffersResponse, error)` -- Function `*CloudServiceOperatingSystemsClient.GetOSVersion` parameter(s) have been changed from `(context.Context, string, string, *CloudServiceOperatingSystemsGetOSVersionOptions)` to `(context.Context, string, string, *CloudServiceOperatingSystemsClientGetOSVersionOptions)` -- Function `*CloudServiceOperatingSystemsClient.GetOSVersion` return value(s) have been changed from `(CloudServiceOperatingSystemsGetOSVersionResponse, error)` to `(CloudServiceOperatingSystemsClientGetOSVersionResponse, error)` -- Function `*VirtualMachinesClient.Get` parameter(s) have been changed from `(context.Context, string, string, *VirtualMachinesGetOptions)` to `(context.Context, string, string, *VirtualMachinesClientGetOptions)` -- Function `*VirtualMachinesClient.Get` return value(s) have been changed from `(VirtualMachinesGetResponse, error)` to `(VirtualMachinesClientGetResponse, error)` -- Function `*VirtualMachinesClient.BeginRestart` parameter(s) have been changed from `(context.Context, string, string, *VirtualMachinesBeginRestartOptions)` to `(context.Context, string, string, *VirtualMachinesClientBeginRestartOptions)` -- Function `*VirtualMachinesClient.BeginRestart` return value(s) have been changed from `(VirtualMachinesRestartPollerResponse, error)` to `(VirtualMachinesClientRestartPollerResponse, error)` -- Function `*DedicatedHostsClient.BeginCreateOrUpdate` parameter(s) have been changed from `(context.Context, string, string, string, DedicatedHost, *DedicatedHostsBeginCreateOrUpdateOptions)` to `(context.Context, string, string, string, DedicatedHost, *DedicatedHostsClientBeginCreateOrUpdateOptions)` -- Function `*DedicatedHostsClient.BeginCreateOrUpdate` return value(s) have been changed from `(DedicatedHostsCreateOrUpdatePollerResponse, error)` to `(DedicatedHostsClientCreateOrUpdatePollerResponse, error)` -- Function `*SharedGalleriesClient.List` parameter(s) have been changed from `(string, *SharedGalleriesListOptions)` to `(string, *SharedGalleriesClientListOptions)` -- Function `*SharedGalleriesClient.List` return value(s) have been changed from `(*SharedGalleriesListPager)` to `(*SharedGalleriesClientListPager)` -- Function `*VirtualMachinesClient.BeginRunCommand` parameter(s) have been changed from `(context.Context, string, string, RunCommandInput, *VirtualMachinesBeginRunCommandOptions)` to `(context.Context, string, string, RunCommandInput, *VirtualMachinesClientBeginRunCommandOptions)` -- Function `*VirtualMachinesClient.BeginRunCommand` return value(s) have been changed from `(VirtualMachinesRunCommandPollerResponse, error)` to `(VirtualMachinesClientRunCommandPollerResponse, error)` -- Function `*CloudServicesClient.BeginRestart` parameter(s) have been changed from `(context.Context, string, string, *CloudServicesBeginRestartOptions)` to `(context.Context, string, string, *CloudServicesClientBeginRestartOptions)` -- Function `*CloudServicesClient.BeginRestart` return value(s) have been changed from `(CloudServicesRestartPollerResponse, error)` to `(CloudServicesClientRestartPollerResponse, error)` -- Function `*DiskRestorePointClient.ListByRestorePoint` parameter(s) have been changed from `(string, string, string, *DiskRestorePointListByRestorePointOptions)` to `(string, string, string, *DiskRestorePointClientListByRestorePointOptions)` -- Function `*DiskRestorePointClient.ListByRestorePoint` return value(s) have been changed from `(*DiskRestorePointListByRestorePointPager)` to `(*DiskRestorePointClientListByRestorePointPager)` -- Function `*VirtualMachinesClient.BeginReapply` parameter(s) have been changed from `(context.Context, string, string, *VirtualMachinesBeginReapplyOptions)` to `(context.Context, string, string, *VirtualMachinesClientBeginReapplyOptions)` -- Function `*VirtualMachinesClient.BeginReapply` return value(s) have been changed from `(VirtualMachinesReapplyPollerResponse, error)` to `(VirtualMachinesClientReapplyPollerResponse, error)` -- Function `*SnapshotsClient.BeginGrantAccess` parameter(s) have been changed from `(context.Context, string, string, GrantAccessData, *SnapshotsBeginGrantAccessOptions)` to `(context.Context, string, string, GrantAccessData, *SnapshotsClientBeginGrantAccessOptions)` -- Function `*SnapshotsClient.BeginGrantAccess` return value(s) have been changed from `(SnapshotsGrantAccessPollerResponse, error)` to `(SnapshotsClientGrantAccessPollerResponse, error)` -- Function `*VirtualMachinesClient.ListAvailableSizes` parameter(s) have been changed from `(context.Context, string, string, *VirtualMachinesListAvailableSizesOptions)` to `(context.Context, string, string, *VirtualMachinesClientListAvailableSizesOptions)` -- Function `*VirtualMachinesClient.ListAvailableSizes` return value(s) have been changed from `(VirtualMachinesListAvailableSizesResponse, error)` to `(VirtualMachinesClientListAvailableSizesResponse, error)` -- Function `*CloudServicesClient.Get` parameter(s) have been changed from `(context.Context, string, string, *CloudServicesGetOptions)` to `(context.Context, string, string, *CloudServicesClientGetOptions)` -- Function `*CloudServicesClient.Get` return value(s) have been changed from `(CloudServicesGetResponse, error)` to `(CloudServicesClientGetResponse, error)` -- Function `*GalleryImageVersionsClient.BeginUpdate` parameter(s) have been changed from `(context.Context, string, string, string, string, GalleryImageVersionUpdate, *GalleryImageVersionsBeginUpdateOptions)` to `(context.Context, string, string, string, string, GalleryImageVersionUpdate, *GalleryImageVersionsClientBeginUpdateOptions)` -- Function `*GalleryImageVersionsClient.BeginUpdate` return value(s) have been changed from `(GalleryImageVersionsUpdatePollerResponse, error)` to `(GalleryImageVersionsClientUpdatePollerResponse, error)` -- Function `*CloudServicesClient.ListAll` parameter(s) have been changed from `(*CloudServicesListAllOptions)` to `(*CloudServicesClientListAllOptions)` -- Function `*CloudServicesClient.ListAll` return value(s) have been changed from `(*CloudServicesListAllPager)` to `(*CloudServicesClientListAllPager)` -- Function `*SharedGalleryImagesClient.Get` parameter(s) have been changed from `(context.Context, string, string, string, *SharedGalleryImagesGetOptions)` to `(context.Context, string, string, string, *SharedGalleryImagesClientGetOptions)` -- Function `*SharedGalleryImagesClient.Get` return value(s) have been changed from `(SharedGalleryImagesGetResponse, error)` to `(SharedGalleryImagesClientGetResponse, error)` -- Function `*CapacityReservationGroupsClient.ListBySubscription` parameter(s) have been changed from `(*CapacityReservationGroupsListBySubscriptionOptions)` to `(*CapacityReservationGroupsClientListBySubscriptionOptions)` -- Function `*CapacityReservationGroupsClient.ListBySubscription` return value(s) have been changed from `(*CapacityReservationGroupsListBySubscriptionPager)` to `(*CapacityReservationGroupsClientListBySubscriptionPager)` -- Function `*CloudServiceOperatingSystemsClient.ListOSFamilies` parameter(s) have been changed from `(string, *CloudServiceOperatingSystemsListOSFamiliesOptions)` to `(string, *CloudServiceOperatingSystemsClientListOSFamiliesOptions)` -- Function `*CloudServiceOperatingSystemsClient.ListOSFamilies` return value(s) have been changed from `(*CloudServiceOperatingSystemsListOSFamiliesPager)` to `(*CloudServiceOperatingSystemsClientListOSFamiliesPager)` -- Function `*VirtualMachinesClient.BeginCapture` parameter(s) have been changed from `(context.Context, string, string, VirtualMachineCaptureParameters, *VirtualMachinesBeginCaptureOptions)` to `(context.Context, string, string, VirtualMachineCaptureParameters, *VirtualMachinesClientBeginCaptureOptions)` -- Function `*VirtualMachinesClient.BeginCapture` return value(s) have been changed from `(VirtualMachinesCapturePollerResponse, error)` to `(VirtualMachinesClientCapturePollerResponse, error)` -- Function `*CapacityReservationGroupsClient.Delete` parameter(s) have been changed from `(context.Context, string, string, *CapacityReservationGroupsDeleteOptions)` to `(context.Context, string, string, *CapacityReservationGroupsClientDeleteOptions)` -- Function `*CapacityReservationGroupsClient.Delete` return value(s) have been changed from `(CapacityReservationGroupsDeleteResponse, error)` to `(CapacityReservationGroupsClientDeleteResponse, error)` -- Function `*VirtualMachineScaleSetVMsClient.BeginReimageAll` parameter(s) have been changed from `(context.Context, string, string, string, *VirtualMachineScaleSetVMsBeginReimageAllOptions)` to `(context.Context, string, string, string, *VirtualMachineScaleSetVMsClientBeginReimageAllOptions)` -- Function `*VirtualMachineScaleSetVMsClient.BeginReimageAll` return value(s) have been changed from `(VirtualMachineScaleSetVMsReimageAllPollerResponse, error)` to `(VirtualMachineScaleSetVMsClientReimageAllPollerResponse, error)` -- Function `*DisksClient.ListByResourceGroup` parameter(s) have been changed from `(string, *DisksListByResourceGroupOptions)` to `(string, *DisksClientListByResourceGroupOptions)` -- Function `*DisksClient.ListByResourceGroup` return value(s) have been changed from `(*DisksListByResourceGroupPager)` to `(*DisksClientListByResourceGroupPager)` -- Function `*VirtualMachinesClient.BeginUpdate` parameter(s) have been changed from `(context.Context, string, string, VirtualMachineUpdate, *VirtualMachinesBeginUpdateOptions)` to `(context.Context, string, string, VirtualMachineUpdate, *VirtualMachinesClientBeginUpdateOptions)` -- Function `*VirtualMachinesClient.BeginUpdate` return value(s) have been changed from `(VirtualMachinesUpdatePollerResponse, error)` to `(VirtualMachinesClientUpdatePollerResponse, error)` -- Function `*VirtualMachineScaleSetVMsClient.BeginRestart` parameter(s) have been changed from `(context.Context, string, string, string, *VirtualMachineScaleSetVMsBeginRestartOptions)` to `(context.Context, string, string, string, *VirtualMachineScaleSetVMsClientBeginRestartOptions)` -- Function `*VirtualMachineScaleSetVMsClient.BeginRestart` return value(s) have been changed from `(VirtualMachineScaleSetVMsRestartPollerResponse, error)` to `(VirtualMachineScaleSetVMsClientRestartPollerResponse, error)` -- Function `*VirtualMachineImagesEdgeZoneClient.List` parameter(s) have been changed from `(context.Context, string, string, string, string, string, *VirtualMachineImagesEdgeZoneListOptions)` to `(context.Context, string, string, string, string, string, *VirtualMachineImagesEdgeZoneClientListOptions)` -- Function `*VirtualMachineImagesEdgeZoneClient.List` return value(s) have been changed from `(VirtualMachineImagesEdgeZoneListResponse, error)` to `(VirtualMachineImagesEdgeZoneClientListResponse, error)` -- Function `*DisksClient.List` parameter(s) have been changed from `(*DisksListOptions)` to `(*DisksClientListOptions)` -- Function `*DisksClient.List` return value(s) have been changed from `(*DisksListPager)` to `(*DisksClientListPager)` -- Function `*VirtualMachineScaleSetsClient.GetOSUpgradeHistory` parameter(s) have been changed from `(string, string, *VirtualMachineScaleSetsGetOSUpgradeHistoryOptions)` to `(string, string, *VirtualMachineScaleSetsClientGetOSUpgradeHistoryOptions)` -- Function `*VirtualMachineScaleSetsClient.GetOSUpgradeHistory` return value(s) have been changed from `(*VirtualMachineScaleSetsGetOSUpgradeHistoryPager)` to `(*VirtualMachineScaleSetsClientGetOSUpgradeHistoryPager)` -- Function `*GalleryApplicationVersionsClient.Get` parameter(s) have been changed from `(context.Context, string, string, string, string, *GalleryApplicationVersionsGetOptions)` to `(context.Context, string, string, string, string, *GalleryApplicationVersionsClientGetOptions)` -- Function `*GalleryApplicationVersionsClient.Get` return value(s) have been changed from `(GalleryApplicationVersionsGetResponse, error)` to `(GalleryApplicationVersionsClientGetResponse, error)` -- Function `*VirtualMachineImagesEdgeZoneClient.Get` parameter(s) have been changed from `(context.Context, string, string, string, string, string, string, *VirtualMachineImagesEdgeZoneGetOptions)` to `(context.Context, string, string, string, string, string, string, *VirtualMachineImagesEdgeZoneClientGetOptions)` -- Function `*VirtualMachineImagesEdgeZoneClient.Get` return value(s) have been changed from `(VirtualMachineImagesEdgeZoneGetResponse, error)` to `(VirtualMachineImagesEdgeZoneClientGetResponse, error)` -- Function `*VirtualMachineScaleSetsClient.Get` parameter(s) have been changed from `(context.Context, string, string, *VirtualMachineScaleSetsGetOptions)` to `(context.Context, string, string, *VirtualMachineScaleSetsClientGetOptions)` -- Function `*VirtualMachineScaleSetsClient.Get` return value(s) have been changed from `(VirtualMachineScaleSetsGetResponse, error)` to `(VirtualMachineScaleSetsClientGetResponse, error)` -- Function `*LogAnalyticsClient.BeginExportThrottledRequests` parameter(s) have been changed from `(context.Context, string, ThrottledRequestsInput, *LogAnalyticsBeginExportThrottledRequestsOptions)` to `(context.Context, string, ThrottledRequestsInput, *LogAnalyticsClientBeginExportThrottledRequestsOptions)` -- Function `*LogAnalyticsClient.BeginExportThrottledRequests` return value(s) have been changed from `(LogAnalyticsExportThrottledRequestsPollerResponse, error)` to `(LogAnalyticsClientExportThrottledRequestsPollerResponse, error)` -- Function `*VirtualMachineImagesEdgeZoneClient.ListPublishers` parameter(s) have been changed from `(context.Context, string, string, *VirtualMachineImagesEdgeZoneListPublishersOptions)` to `(context.Context, string, string, *VirtualMachineImagesEdgeZoneClientListPublishersOptions)` -- Function `*VirtualMachineImagesEdgeZoneClient.ListPublishers` return value(s) have been changed from `(VirtualMachineImagesEdgeZoneListPublishersResponse, error)` to `(VirtualMachineImagesEdgeZoneClientListPublishersResponse, error)` -- Function `*CloudServicesClient.BeginCreateOrUpdate` parameter(s) have been changed from `(context.Context, string, string, *CloudServicesBeginCreateOrUpdateOptions)` to `(context.Context, string, string, *CloudServicesClientBeginCreateOrUpdateOptions)` -- Function `*CloudServicesClient.BeginCreateOrUpdate` return value(s) have been changed from `(CloudServicesCreateOrUpdatePollerResponse, error)` to `(CloudServicesClientCreateOrUpdatePollerResponse, error)` -- Function `*CapacityReservationGroupsClient.CreateOrUpdate` parameter(s) have been changed from `(context.Context, string, string, CapacityReservationGroup, *CapacityReservationGroupsCreateOrUpdateOptions)` to `(context.Context, string, string, CapacityReservationGroup, *CapacityReservationGroupsClientCreateOrUpdateOptions)` -- Function `*CapacityReservationGroupsClient.CreateOrUpdate` return value(s) have been changed from `(CapacityReservationGroupsCreateOrUpdateResponse, error)` to `(CapacityReservationGroupsClientCreateOrUpdateResponse, error)` -- Function `*VirtualMachinesClient.List` parameter(s) have been changed from `(string, *VirtualMachinesListOptions)` to `(string, *VirtualMachinesClientListOptions)` -- Function `*VirtualMachinesClient.List` return value(s) have been changed from `(*VirtualMachinesListPager)` to `(*VirtualMachinesClientListPager)` -- Function `*DiskAccessesClient.BeginDeleteAPrivateEndpointConnection` parameter(s) have been changed from `(context.Context, string, string, string, *DiskAccessesBeginDeleteAPrivateEndpointConnectionOptions)` to `(context.Context, string, string, string, *DiskAccessesClientBeginDeleteAPrivateEndpointConnectionOptions)` -- Function `*DiskAccessesClient.BeginDeleteAPrivateEndpointConnection` return value(s) have been changed from `(DiskAccessesDeleteAPrivateEndpointConnectionPollerResponse, error)` to `(DiskAccessesClientDeleteAPrivateEndpointConnectionPollerResponse, error)` -- Function `*LogAnalyticsClient.BeginExportRequestRateByInterval` parameter(s) have been changed from `(context.Context, string, RequestRateByIntervalInput, *LogAnalyticsBeginExportRequestRateByIntervalOptions)` to `(context.Context, string, RequestRateByIntervalInput, *LogAnalyticsClientBeginExportRequestRateByIntervalOptions)` -- Function `*LogAnalyticsClient.BeginExportRequestRateByInterval` return value(s) have been changed from `(LogAnalyticsExportRequestRateByIntervalPollerResponse, error)` to `(LogAnalyticsClientExportRequestRateByIntervalPollerResponse, error)` -- Function `*AvailabilitySetsClient.Delete` parameter(s) have been changed from `(context.Context, string, string, *AvailabilitySetsDeleteOptions)` to `(context.Context, string, string, *AvailabilitySetsClientDeleteOptions)` -- Function `*AvailabilitySetsClient.Delete` return value(s) have been changed from `(AvailabilitySetsDeleteResponse, error)` to `(AvailabilitySetsClientDeleteResponse, error)` -- Function `*VirtualMachineScaleSetVMExtensionsClient.BeginDelete` parameter(s) have been changed from `(context.Context, string, string, string, string, *VirtualMachineScaleSetVMExtensionsBeginDeleteOptions)` to `(context.Context, string, string, string, string, *VirtualMachineScaleSetVMExtensionsClientBeginDeleteOptions)` -- Function `*VirtualMachineScaleSetVMExtensionsClient.BeginDelete` return value(s) have been changed from `(VirtualMachineScaleSetVMExtensionsDeletePollerResponse, error)` to `(VirtualMachineScaleSetVMExtensionsClientDeletePollerResponse, error)` -- Function `*ImagesClient.BeginCreateOrUpdate` parameter(s) have been changed from `(context.Context, string, string, Image, *ImagesBeginCreateOrUpdateOptions)` to `(context.Context, string, string, Image, *ImagesClientBeginCreateOrUpdateOptions)` -- Function `*ImagesClient.BeginCreateOrUpdate` return value(s) have been changed from `(ImagesCreateOrUpdatePollerResponse, error)` to `(ImagesClientCreateOrUpdatePollerResponse, error)` -- Function `*ProximityPlacementGroupsClient.ListByResourceGroup` parameter(s) have been changed from `(string, *ProximityPlacementGroupsListByResourceGroupOptions)` to `(string, *ProximityPlacementGroupsClientListByResourceGroupOptions)` -- Function `*ProximityPlacementGroupsClient.ListByResourceGroup` return value(s) have been changed from `(*ProximityPlacementGroupsListByResourceGroupPager)` to `(*ProximityPlacementGroupsClientListByResourceGroupPager)` -- Function `*AvailabilitySetsClient.ListAvailableSizes` parameter(s) have been changed from `(context.Context, string, string, *AvailabilitySetsListAvailableSizesOptions)` to `(context.Context, string, string, *AvailabilitySetsClientListAvailableSizesOptions)` -- Function `*AvailabilitySetsClient.ListAvailableSizes` return value(s) have been changed from `(AvailabilitySetsListAvailableSizesResponse, error)` to `(AvailabilitySetsClientListAvailableSizesResponse, error)` -- Function `*VirtualMachineScaleSetsClient.BeginPowerOff` parameter(s) have been changed from `(context.Context, string, string, *VirtualMachineScaleSetsBeginPowerOffOptions)` to `(context.Context, string, string, *VirtualMachineScaleSetsClientBeginPowerOffOptions)` -- Function `*VirtualMachineScaleSetsClient.BeginPowerOff` return value(s) have been changed from `(VirtualMachineScaleSetsPowerOffPollerResponse, error)` to `(VirtualMachineScaleSetsClientPowerOffPollerResponse, error)` -- Function `*VirtualMachineScaleSetsClient.ConvertToSinglePlacementGroup` parameter(s) have been changed from `(context.Context, string, string, VMScaleSetConvertToSinglePlacementGroupInput, *VirtualMachineScaleSetsConvertToSinglePlacementGroupOptions)` to `(context.Context, string, string, VMScaleSetConvertToSinglePlacementGroupInput, *VirtualMachineScaleSetsClientConvertToSinglePlacementGroupOptions)` -- Function `*VirtualMachineScaleSetsClient.ConvertToSinglePlacementGroup` return value(s) have been changed from `(VirtualMachineScaleSetsConvertToSinglePlacementGroupResponse, error)` to `(VirtualMachineScaleSetsClientConvertToSinglePlacementGroupResponse, error)` -- Function `*CapacityReservationsClient.Get` parameter(s) have been changed from `(context.Context, string, string, string, *CapacityReservationsGetOptions)` to `(context.Context, string, string, string, *CapacityReservationsClientGetOptions)` -- Function `*CapacityReservationsClient.Get` return value(s) have been changed from `(CapacityReservationsGetResponse, error)` to `(CapacityReservationsClientGetResponse, error)` -- Function `*SnapshotsClient.Get` parameter(s) have been changed from `(context.Context, string, string, *SnapshotsGetOptions)` to `(context.Context, string, string, *SnapshotsClientGetOptions)` -- Function `*SnapshotsClient.Get` return value(s) have been changed from `(SnapshotsGetResponse, error)` to `(SnapshotsClientGetResponse, error)` -- Function `*GalleryImagesClient.BeginCreateOrUpdate` parameter(s) have been changed from `(context.Context, string, string, string, GalleryImage, *GalleryImagesBeginCreateOrUpdateOptions)` to `(context.Context, string, string, string, GalleryImage, *GalleryImagesClientBeginCreateOrUpdateOptions)` -- Function `*GalleryImagesClient.BeginCreateOrUpdate` return value(s) have been changed from `(GalleryImagesCreateOrUpdatePollerResponse, error)` to `(GalleryImagesClientCreateOrUpdatePollerResponse, error)` -- Function `*AvailabilitySetsClient.Get` parameter(s) have been changed from `(context.Context, string, string, *AvailabilitySetsGetOptions)` to `(context.Context, string, string, *AvailabilitySetsClientGetOptions)` -- Function `*AvailabilitySetsClient.Get` return value(s) have been changed from `(AvailabilitySetsGetResponse, error)` to `(AvailabilitySetsClientGetResponse, error)` -- Function `*CloudServicesClient.BeginUpdate` parameter(s) have been changed from `(context.Context, string, string, *CloudServicesBeginUpdateOptions)` to `(context.Context, string, string, *CloudServicesClientBeginUpdateOptions)` -- Function `*CloudServicesClient.BeginUpdate` return value(s) have been changed from `(CloudServicesUpdatePollerResponse, error)` to `(CloudServicesClientUpdatePollerResponse, error)` -- Function `*VirtualMachineScaleSetRollingUpgradesClient.BeginStartExtensionUpgrade` parameter(s) have been changed from `(context.Context, string, string, *VirtualMachineScaleSetRollingUpgradesBeginStartExtensionUpgradeOptions)` to `(context.Context, string, string, *VirtualMachineScaleSetRollingUpgradesClientBeginStartExtensionUpgradeOptions)` -- Function `*VirtualMachineScaleSetRollingUpgradesClient.BeginStartExtensionUpgrade` return value(s) have been changed from `(VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradePollerResponse, error)` to `(VirtualMachineScaleSetRollingUpgradesClientStartExtensionUpgradePollerResponse, error)` -- Function `*VirtualMachineExtensionsClient.List` parameter(s) have been changed from `(context.Context, string, string, *VirtualMachineExtensionsListOptions)` to `(context.Context, string, string, *VirtualMachineExtensionsClientListOptions)` -- Function `*VirtualMachineExtensionsClient.List` return value(s) have been changed from `(VirtualMachineExtensionsListResponse, error)` to `(VirtualMachineExtensionsClientListResponse, error)` -- Function `*GalleriesClient.List` parameter(s) have been changed from `(*GalleriesListOptions)` to `(*GalleriesClientListOptions)` -- Function `*GalleriesClient.List` return value(s) have been changed from `(*GalleriesListPager)` to `(*GalleriesClientListPager)` -- Function `*VirtualMachineScaleSetVMsClient.BeginReimage` parameter(s) have been changed from `(context.Context, string, string, string, *VirtualMachineScaleSetVMsBeginReimageOptions)` to `(context.Context, string, string, string, *VirtualMachineScaleSetVMsClientBeginReimageOptions)` -- Function `*VirtualMachineScaleSetVMsClient.BeginReimage` return value(s) have been changed from `(VirtualMachineScaleSetVMsReimagePollerResponse, error)` to `(VirtualMachineScaleSetVMsClientReimagePollerResponse, error)` -- Function `*ImagesClient.BeginUpdate` parameter(s) have been changed from `(context.Context, string, string, ImageUpdate, *ImagesBeginUpdateOptions)` to `(context.Context, string, string, ImageUpdate, *ImagesClientBeginUpdateOptions)` -- Function `*ImagesClient.BeginUpdate` return value(s) have been changed from `(ImagesUpdatePollerResponse, error)` to `(ImagesClientUpdatePollerResponse, error)` -- Function `*VirtualMachinesClient.BeginInstallPatches` parameter(s) have been changed from `(context.Context, string, string, VirtualMachineInstallPatchesParameters, *VirtualMachinesBeginInstallPatchesOptions)` to `(context.Context, string, string, VirtualMachineInstallPatchesParameters, *VirtualMachinesClientBeginInstallPatchesOptions)` -- Function `*VirtualMachinesClient.BeginInstallPatches` return value(s) have been changed from `(VirtualMachinesInstallPatchesPollerResponse, error)` to `(VirtualMachinesClientInstallPatchesPollerResponse, error)` -- Function `*VirtualMachineScaleSetsClient.ForceRecoveryServiceFabricPlatformUpdateDomainWalk` parameter(s) have been changed from `(context.Context, string, string, int32, *VirtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkOptions)` to `(context.Context, string, string, int32, *VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkOptions)` -- Function `*VirtualMachineScaleSetsClient.ForceRecoveryServiceFabricPlatformUpdateDomainWalk` return value(s) have been changed from `(VirtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkResponse, error)` to `(VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkResponse, error)` -- Function `*VirtualMachineScaleSetsClient.ListByLocation` parameter(s) have been changed from `(string, *VirtualMachineScaleSetsListByLocationOptions)` to `(string, *VirtualMachineScaleSetsClientListByLocationOptions)` -- Function `*VirtualMachineScaleSetsClient.ListByLocation` return value(s) have been changed from `(*VirtualMachineScaleSetsListByLocationPager)` to `(*VirtualMachineScaleSetsClientListByLocationPager)` -- Function `*VirtualMachineScaleSetVMsClient.List` parameter(s) have been changed from `(string, string, *VirtualMachineScaleSetVMsListOptions)` to `(string, string, *VirtualMachineScaleSetVMsClientListOptions)` -- Function `*VirtualMachineScaleSetVMsClient.List` return value(s) have been changed from `(*VirtualMachineScaleSetVMsListPager)` to `(*VirtualMachineScaleSetVMsClientListPager)` -- Function `*GalleryImagesClient.BeginDelete` parameter(s) have been changed from `(context.Context, string, string, string, *GalleryImagesBeginDeleteOptions)` to `(context.Context, string, string, string, *GalleryImagesClientBeginDeleteOptions)` -- Function `*GalleryImagesClient.BeginDelete` return value(s) have been changed from `(GalleryImagesDeletePollerResponse, error)` to `(GalleryImagesClientDeletePollerResponse, error)` -- Function `*GalleryImageVersionsClient.Get` parameter(s) have been changed from `(context.Context, string, string, string, string, *GalleryImageVersionsGetOptions)` to `(context.Context, string, string, string, string, *GalleryImageVersionsClientGetOptions)` -- Function `*GalleryImageVersionsClient.Get` return value(s) have been changed from `(GalleryImageVersionsGetResponse, error)` to `(GalleryImageVersionsClientGetResponse, error)` -- Function `*GalleryApplicationsClient.BeginCreateOrUpdate` parameter(s) have been changed from `(context.Context, string, string, string, GalleryApplication, *GalleryApplicationsBeginCreateOrUpdateOptions)` to `(context.Context, string, string, string, GalleryApplication, *GalleryApplicationsClientBeginCreateOrUpdateOptions)` -- Function `*GalleryApplicationsClient.BeginCreateOrUpdate` return value(s) have been changed from `(GalleryApplicationsCreateOrUpdatePollerResponse, error)` to `(GalleryApplicationsClientCreateOrUpdatePollerResponse, error)` -- Function `*CloudServiceRoleInstancesClient.BeginDelete` parameter(s) have been changed from `(context.Context, string, string, string, *CloudServiceRoleInstancesBeginDeleteOptions)` to `(context.Context, string, string, string, *CloudServiceRoleInstancesClientBeginDeleteOptions)` -- Function `*CloudServiceRoleInstancesClient.BeginDelete` return value(s) have been changed from `(CloudServiceRoleInstancesDeletePollerResponse, error)` to `(CloudServiceRoleInstancesClientDeletePollerResponse, error)` -- Function `*VirtualMachineScaleSetVMsClient.Get` parameter(s) have been changed from `(context.Context, string, string, string, *VirtualMachineScaleSetVMsGetOptions)` to `(context.Context, string, string, string, *VirtualMachineScaleSetVMsClientGetOptions)` -- Function `*VirtualMachineScaleSetVMsClient.Get` return value(s) have been changed from `(VirtualMachineScaleSetVMsGetResponse, error)` to `(VirtualMachineScaleSetVMsClientGetResponse, error)` -- Function `*GalleriesClient.Get` parameter(s) have been changed from `(context.Context, string, string, *GalleriesGetOptions)` to `(context.Context, string, string, *GalleriesClientGetOptions)` -- Function `*GalleriesClient.Get` return value(s) have been changed from `(GalleriesGetResponse, error)` to `(GalleriesClientGetResponse, error)` -- Function `*VirtualMachineRunCommandsClient.BeginDelete` parameter(s) have been changed from `(context.Context, string, string, string, *VirtualMachineRunCommandsBeginDeleteOptions)` to `(context.Context, string, string, string, *VirtualMachineRunCommandsClientBeginDeleteOptions)` -- Function `*VirtualMachineRunCommandsClient.BeginDelete` return value(s) have been changed from `(VirtualMachineRunCommandsDeletePollerResponse, error)` to `(VirtualMachineRunCommandsClientDeletePollerResponse, error)` -- Function `*GalleryApplicationVersionsClient.ListByGalleryApplication` parameter(s) have been changed from `(string, string, string, *GalleryApplicationVersionsListByGalleryApplicationOptions)` to `(string, string, string, *GalleryApplicationVersionsClientListByGalleryApplicationOptions)` -- Function `*GalleryApplicationVersionsClient.ListByGalleryApplication` return value(s) have been changed from `(*GalleryApplicationVersionsListByGalleryApplicationPager)` to `(*GalleryApplicationVersionsClientListByGalleryApplicationPager)` -- Function `*DedicatedHostGroupsClient.Update` parameter(s) have been changed from `(context.Context, string, string, DedicatedHostGroupUpdate, *DedicatedHostGroupsUpdateOptions)` to `(context.Context, string, string, DedicatedHostGroupUpdate, *DedicatedHostGroupsClientUpdateOptions)` -- Function `*DedicatedHostGroupsClient.Update` return value(s) have been changed from `(DedicatedHostGroupsUpdateResponse, error)` to `(DedicatedHostGroupsClientUpdateResponse, error)` -- Function `*VirtualMachineScaleSetVMExtensionsClient.List` parameter(s) have been changed from `(context.Context, string, string, string, *VirtualMachineScaleSetVMExtensionsListOptions)` to `(context.Context, string, string, string, *VirtualMachineScaleSetVMExtensionsClientListOptions)` -- Function `*VirtualMachineScaleSetVMExtensionsClient.List` return value(s) have been changed from `(VirtualMachineScaleSetVMExtensionsListResponse, error)` to `(VirtualMachineScaleSetVMExtensionsClientListResponse, error)` -- Function `*RestorePointsClient.Get` parameter(s) have been changed from `(context.Context, string, string, string, *RestorePointsGetOptions)` to `(context.Context, string, string, string, *RestorePointsClientGetOptions)` -- Function `*RestorePointsClient.Get` return value(s) have been changed from `(RestorePointsGetResponse, error)` to `(RestorePointsClientGetResponse, error)` -- Function `*GalleriesClient.BeginCreateOrUpdate` parameter(s) have been changed from `(context.Context, string, string, Gallery, *GalleriesBeginCreateOrUpdateOptions)` to `(context.Context, string, string, Gallery, *GalleriesClientBeginCreateOrUpdateOptions)` -- Function `*GalleriesClient.BeginCreateOrUpdate` return value(s) have been changed from `(GalleriesCreateOrUpdatePollerResponse, error)` to `(GalleriesClientCreateOrUpdatePollerResponse, error)` -- Function `*VirtualMachinesClient.BeginDeallocate` parameter(s) have been changed from `(context.Context, string, string, *VirtualMachinesBeginDeallocateOptions)` to `(context.Context, string, string, *VirtualMachinesClientBeginDeallocateOptions)` -- Function `*VirtualMachinesClient.BeginDeallocate` return value(s) have been changed from `(VirtualMachinesDeallocatePollerResponse, error)` to `(VirtualMachinesClientDeallocatePollerResponse, error)` -- Function `*VirtualMachineScaleSetVMRunCommandsClient.BeginCreateOrUpdate` parameter(s) have been changed from `(context.Context, string, string, string, string, VirtualMachineRunCommand, *VirtualMachineScaleSetVMRunCommandsBeginCreateOrUpdateOptions)` to `(context.Context, string, string, string, string, VirtualMachineRunCommand, *VirtualMachineScaleSetVMRunCommandsClientBeginCreateOrUpdateOptions)` -- Function `*VirtualMachineScaleSetVMRunCommandsClient.BeginCreateOrUpdate` return value(s) have been changed from `(VirtualMachineScaleSetVMRunCommandsCreateOrUpdatePollerResponse, error)` to `(VirtualMachineScaleSetVMRunCommandsClientCreateOrUpdatePollerResponse, error)` -- Function `*VirtualMachinesClient.BeginStart` parameter(s) have been changed from `(context.Context, string, string, *VirtualMachinesBeginStartOptions)` to `(context.Context, string, string, *VirtualMachinesClientBeginStartOptions)` -- Function `*VirtualMachinesClient.BeginStart` return value(s) have been changed from `(VirtualMachinesStartPollerResponse, error)` to `(VirtualMachinesClientStartPollerResponse, error)` -- Function `*SharedGalleryImageVersionsClient.List` parameter(s) have been changed from `(string, string, string, *SharedGalleryImageVersionsListOptions)` to `(string, string, string, *SharedGalleryImageVersionsClientListOptions)` -- Function `*SharedGalleryImageVersionsClient.List` return value(s) have been changed from `(*SharedGalleryImageVersionsListPager)` to `(*SharedGalleryImageVersionsClientListPager)` -- Function `*DiskEncryptionSetsClient.BeginUpdate` parameter(s) have been changed from `(context.Context, string, string, DiskEncryptionSetUpdate, *DiskEncryptionSetsBeginUpdateOptions)` to `(context.Context, string, string, DiskEncryptionSetUpdate, *DiskEncryptionSetsClientBeginUpdateOptions)` -- Function `*DiskEncryptionSetsClient.BeginUpdate` return value(s) have been changed from `(DiskEncryptionSetsUpdatePollerResponse, error)` to `(DiskEncryptionSetsClientUpdatePollerResponse, error)` -- Function `*DiskEncryptionSetsClient.ListAssociatedResources` parameter(s) have been changed from `(string, string, *DiskEncryptionSetsListAssociatedResourcesOptions)` to `(string, string, *DiskEncryptionSetsClientListAssociatedResourcesOptions)` -- Function `*DiskEncryptionSetsClient.ListAssociatedResources` return value(s) have been changed from `(*DiskEncryptionSetsListAssociatedResourcesPager)` to `(*DiskEncryptionSetsClientListAssociatedResourcesPager)` -- Function `*VirtualMachineScaleSetVMsClient.BeginDelete` parameter(s) have been changed from `(context.Context, string, string, string, *VirtualMachineScaleSetVMsBeginDeleteOptions)` to `(context.Context, string, string, string, *VirtualMachineScaleSetVMsClientBeginDeleteOptions)` -- Function `*VirtualMachineScaleSetVMsClient.BeginDelete` return value(s) have been changed from `(VirtualMachineScaleSetVMsDeletePollerResponse, error)` to `(VirtualMachineScaleSetVMsClientDeletePollerResponse, error)` -- Function `*SnapshotsClient.BeginUpdate` parameter(s) have been changed from `(context.Context, string, string, SnapshotUpdate, *SnapshotsBeginUpdateOptions)` to `(context.Context, string, string, SnapshotUpdate, *SnapshotsClientBeginUpdateOptions)` -- Function `*SnapshotsClient.BeginUpdate` return value(s) have been changed from `(SnapshotsUpdatePollerResponse, error)` to `(SnapshotsClientUpdatePollerResponse, error)` -- Function `*DedicatedHostsClient.BeginUpdate` parameter(s) have been changed from `(context.Context, string, string, string, DedicatedHostUpdate, *DedicatedHostsBeginUpdateOptions)` to `(context.Context, string, string, string, DedicatedHostUpdate, *DedicatedHostsClientBeginUpdateOptions)` -- Function `*DedicatedHostsClient.BeginUpdate` return value(s) have been changed from `(DedicatedHostsUpdatePollerResponse, error)` to `(DedicatedHostsClientUpdatePollerResponse, error)` -- Function `*VirtualMachinesClient.InstanceView` parameter(s) have been changed from `(context.Context, string, string, *VirtualMachinesInstanceViewOptions)` to `(context.Context, string, string, *VirtualMachinesClientInstanceViewOptions)` -- Function `*VirtualMachinesClient.InstanceView` return value(s) have been changed from `(VirtualMachinesInstanceViewResponse, error)` to `(VirtualMachinesClientInstanceViewResponse, error)` -- Function `*OperationsClient.List` parameter(s) have been changed from `(context.Context, *OperationsListOptions)` to `(context.Context, *OperationsClientListOptions)` -- Function `*OperationsClient.List` return value(s) have been changed from `(OperationsListResponse, error)` to `(OperationsClientListResponse, error)` -- Function `*VirtualMachineScaleSetVMExtensionsClient.BeginCreateOrUpdate` parameter(s) have been changed from `(context.Context, string, string, string, string, VirtualMachineScaleSetVMExtension, *VirtualMachineScaleSetVMExtensionsBeginCreateOrUpdateOptions)` to `(context.Context, string, string, string, string, VirtualMachineScaleSetVMExtension, *VirtualMachineScaleSetVMExtensionsClientBeginCreateOrUpdateOptions)` -- Function `*VirtualMachineScaleSetVMExtensionsClient.BeginCreateOrUpdate` return value(s) have been changed from `(VirtualMachineScaleSetVMExtensionsCreateOrUpdatePollerResponse, error)` to `(VirtualMachineScaleSetVMExtensionsClientCreateOrUpdatePollerResponse, error)` -- Function `*GalleryImageVersionsClient.BeginCreateOrUpdate` parameter(s) have been changed from `(context.Context, string, string, string, string, GalleryImageVersion, *GalleryImageVersionsBeginCreateOrUpdateOptions)` to `(context.Context, string, string, string, string, GalleryImageVersion, *GalleryImageVersionsClientBeginCreateOrUpdateOptions)` -- Function `*GalleryImageVersionsClient.BeginCreateOrUpdate` return value(s) have been changed from `(GalleryImageVersionsCreateOrUpdatePollerResponse, error)` to `(GalleryImageVersionsClientCreateOrUpdatePollerResponse, error)` -- Function `*DiskAccessesClient.GetAPrivateEndpointConnection` parameter(s) have been changed from `(context.Context, string, string, string, *DiskAccessesGetAPrivateEndpointConnectionOptions)` to `(context.Context, string, string, string, *DiskAccessesClientGetAPrivateEndpointConnectionOptions)` -- Function `*DiskAccessesClient.GetAPrivateEndpointConnection` return value(s) have been changed from `(DiskAccessesGetAPrivateEndpointConnectionResponse, error)` to `(DiskAccessesClientGetAPrivateEndpointConnectionResponse, error)` -- Function `*VirtualMachineScaleSetVMRunCommandsClient.BeginDelete` parameter(s) have been changed from `(context.Context, string, string, string, string, *VirtualMachineScaleSetVMRunCommandsBeginDeleteOptions)` to `(context.Context, string, string, string, string, *VirtualMachineScaleSetVMRunCommandsClientBeginDeleteOptions)` -- Function `*VirtualMachineScaleSetVMRunCommandsClient.BeginDelete` return value(s) have been changed from `(VirtualMachineScaleSetVMRunCommandsDeletePollerResponse, error)` to `(VirtualMachineScaleSetVMRunCommandsClientDeletePollerResponse, error)` -- Function `*VirtualMachineRunCommandsClient.GetByVirtualMachine` parameter(s) have been changed from `(context.Context, string, string, string, *VirtualMachineRunCommandsGetByVirtualMachineOptions)` to `(context.Context, string, string, string, *VirtualMachineRunCommandsClientGetByVirtualMachineOptions)` -- Function `*VirtualMachineRunCommandsClient.GetByVirtualMachine` return value(s) have been changed from `(VirtualMachineRunCommandsGetByVirtualMachineResponse, error)` to `(VirtualMachineRunCommandsClientGetByVirtualMachineResponse, error)` -- Function `*SnapshotsClient.BeginDelete` parameter(s) have been changed from `(context.Context, string, string, *SnapshotsBeginDeleteOptions)` to `(context.Context, string, string, *SnapshotsClientBeginDeleteOptions)` -- Function `*SnapshotsClient.BeginDelete` return value(s) have been changed from `(SnapshotsDeletePollerResponse, error)` to `(SnapshotsClientDeletePollerResponse, error)` -- Function `*VirtualMachineScaleSetRollingUpgradesClient.BeginCancel` parameter(s) have been changed from `(context.Context, string, string, *VirtualMachineScaleSetRollingUpgradesBeginCancelOptions)` to `(context.Context, string, string, *VirtualMachineScaleSetRollingUpgradesClientBeginCancelOptions)` -- Function `*VirtualMachineScaleSetRollingUpgradesClient.BeginCancel` return value(s) have been changed from `(VirtualMachineScaleSetRollingUpgradesCancelPollerResponse, error)` to `(VirtualMachineScaleSetRollingUpgradesClientCancelPollerResponse, error)` -- Function `*VirtualMachinesClient.BeginPowerOff` parameter(s) have been changed from `(context.Context, string, string, *VirtualMachinesBeginPowerOffOptions)` to `(context.Context, string, string, *VirtualMachinesClientBeginPowerOffOptions)` -- Function `*VirtualMachinesClient.BeginPowerOff` return value(s) have been changed from `(VirtualMachinesPowerOffPollerResponse, error)` to `(VirtualMachinesClientPowerOffPollerResponse, error)` -- Function `*VirtualMachineExtensionImagesClient.ListTypes` parameter(s) have been changed from `(context.Context, string, string, *VirtualMachineExtensionImagesListTypesOptions)` to `(context.Context, string, string, *VirtualMachineExtensionImagesClientListTypesOptions)` -- Function `*VirtualMachineExtensionImagesClient.ListTypes` return value(s) have been changed from `(VirtualMachineExtensionImagesListTypesResponse, error)` to `(VirtualMachineExtensionImagesClientListTypesResponse, error)` -- Function `*SSHPublicKeysClient.ListBySubscription` parameter(s) have been changed from `(*SSHPublicKeysListBySubscriptionOptions)` to `(*SSHPublicKeysClientListBySubscriptionOptions)` -- Function `*SSHPublicKeysClient.ListBySubscription` return value(s) have been changed from `(*SSHPublicKeysListBySubscriptionPager)` to `(*SSHPublicKeysClientListBySubscriptionPager)` -- Function `*VirtualMachineImagesClient.ListSKUs` parameter(s) have been changed from `(context.Context, string, string, string, *VirtualMachineImagesListSKUsOptions)` to `(context.Context, string, string, string, *VirtualMachineImagesClientListSKUsOptions)` -- Function `*VirtualMachineImagesClient.ListSKUs` return value(s) have been changed from `(VirtualMachineImagesListSKUsResponse, error)` to `(VirtualMachineImagesClientListSKUsResponse, error)` -- Function `*RestorePointCollectionsClient.BeginDelete` parameter(s) have been changed from `(context.Context, string, string, *RestorePointCollectionsBeginDeleteOptions)` to `(context.Context, string, string, *RestorePointCollectionsClientBeginDeleteOptions)` -- Function `*RestorePointCollectionsClient.BeginDelete` return value(s) have been changed from `(RestorePointCollectionsDeletePollerResponse, error)` to `(RestorePointCollectionsClientDeletePollerResponse, error)` -- Function `*VirtualMachineExtensionsClient.BeginUpdate` parameter(s) have been changed from `(context.Context, string, string, string, VirtualMachineExtensionUpdate, *VirtualMachineExtensionsBeginUpdateOptions)` to `(context.Context, string, string, string, VirtualMachineExtensionUpdate, *VirtualMachineExtensionsClientBeginUpdateOptions)` -- Function `*VirtualMachineExtensionsClient.BeginUpdate` return value(s) have been changed from `(VirtualMachineExtensionsUpdatePollerResponse, error)` to `(VirtualMachineExtensionsClientUpdatePollerResponse, error)` -- Function `*DisksClient.BeginGrantAccess` parameter(s) have been changed from `(context.Context, string, string, GrantAccessData, *DisksBeginGrantAccessOptions)` to `(context.Context, string, string, GrantAccessData, *DisksClientBeginGrantAccessOptions)` -- Function `*DisksClient.BeginGrantAccess` return value(s) have been changed from `(DisksGrantAccessPollerResponse, error)` to `(DisksClientGrantAccessPollerResponse, error)` -- Function `*SharedGalleriesClient.Get` parameter(s) have been changed from `(context.Context, string, string, *SharedGalleriesGetOptions)` to `(context.Context, string, string, *SharedGalleriesClientGetOptions)` -- Function `*SharedGalleriesClient.Get` return value(s) have been changed from `(SharedGalleriesGetResponse, error)` to `(SharedGalleriesClientGetResponse, error)` -- Function `*VirtualMachineExtensionsClient.BeginDelete` parameter(s) have been changed from `(context.Context, string, string, string, *VirtualMachineExtensionsBeginDeleteOptions)` to `(context.Context, string, string, string, *VirtualMachineExtensionsClientBeginDeleteOptions)` -- Function `*VirtualMachineExtensionsClient.BeginDelete` return value(s) have been changed from `(VirtualMachineExtensionsDeletePollerResponse, error)` to `(VirtualMachineExtensionsClientDeletePollerResponse, error)` -- Function `*CloudServiceRoleInstancesClient.GetInstanceView` parameter(s) have been changed from `(context.Context, string, string, string, *CloudServiceRoleInstancesGetInstanceViewOptions)` to `(context.Context, string, string, string, *CloudServiceRoleInstancesClientGetInstanceViewOptions)` -- Function `*CloudServiceRoleInstancesClient.GetInstanceView` return value(s) have been changed from `(CloudServiceRoleInstancesGetInstanceViewResponse, error)` to `(CloudServiceRoleInstancesClientGetInstanceViewResponse, error)` -- Function `*VirtualMachineScaleSetsClient.List` parameter(s) have been changed from `(string, *VirtualMachineScaleSetsListOptions)` to `(string, *VirtualMachineScaleSetsClientListOptions)` -- Function `*VirtualMachineScaleSetsClient.List` return value(s) have been changed from `(*VirtualMachineScaleSetsListPager)` to `(*VirtualMachineScaleSetsClientListPager)` -- Function `*VirtualMachineScaleSetVMRunCommandsClient.BeginUpdate` parameter(s) have been changed from `(context.Context, string, string, string, string, VirtualMachineRunCommandUpdate, *VirtualMachineScaleSetVMRunCommandsBeginUpdateOptions)` to `(context.Context, string, string, string, string, VirtualMachineRunCommandUpdate, *VirtualMachineScaleSetVMRunCommandsClientBeginUpdateOptions)` -- Function `*VirtualMachineScaleSetVMRunCommandsClient.BeginUpdate` return value(s) have been changed from `(VirtualMachineScaleSetVMRunCommandsUpdatePollerResponse, error)` to `(VirtualMachineScaleSetVMRunCommandsClientUpdatePollerResponse, error)` -- Function `*DedicatedHostGroupsClient.ListByResourceGroup` parameter(s) have been changed from `(string, *DedicatedHostGroupsListByResourceGroupOptions)` to `(string, *DedicatedHostGroupsClientListByResourceGroupOptions)` -- Function `*DedicatedHostGroupsClient.ListByResourceGroup` return value(s) have been changed from `(*DedicatedHostGroupsListByResourceGroupPager)` to `(*DedicatedHostGroupsClientListByResourceGroupPager)` -- Function `*CommunityGalleriesClient.Get` parameter(s) have been changed from `(context.Context, string, string, *CommunityGalleriesGetOptions)` to `(context.Context, string, string, *CommunityGalleriesClientGetOptions)` -- Function `*CommunityGalleriesClient.Get` return value(s) have been changed from `(CommunityGalleriesGetResponse, error)` to `(CommunityGalleriesClientGetResponse, error)` -- Function `*VirtualMachineScaleSetVMsClient.BeginRunCommand` parameter(s) have been changed from `(context.Context, string, string, string, RunCommandInput, *VirtualMachineScaleSetVMsBeginRunCommandOptions)` to `(context.Context, string, string, string, RunCommandInput, *VirtualMachineScaleSetVMsClientBeginRunCommandOptions)` -- Function `*VirtualMachineScaleSetVMsClient.BeginRunCommand` return value(s) have been changed from `(VirtualMachineScaleSetVMsRunCommandPollerResponse, error)` to `(VirtualMachineScaleSetVMsClientRunCommandPollerResponse, error)` -- Function `*CapacityReservationGroupsClient.Get` parameter(s) have been changed from `(context.Context, string, string, *CapacityReservationGroupsGetOptions)` to `(context.Context, string, string, *CapacityReservationGroupsClientGetOptions)` -- Function `*CapacityReservationGroupsClient.Get` return value(s) have been changed from `(CapacityReservationGroupsGetResponse, error)` to `(CapacityReservationGroupsClientGetResponse, error)` -- Function `*AvailabilitySetsClient.ListBySubscription` parameter(s) have been changed from `(*AvailabilitySetsListBySubscriptionOptions)` to `(*AvailabilitySetsClientListBySubscriptionOptions)` -- Function `*AvailabilitySetsClient.ListBySubscription` return value(s) have been changed from `(*AvailabilitySetsListBySubscriptionPager)` to `(*AvailabilitySetsClientListBySubscriptionPager)` -- Function `*VirtualMachineScaleSetsClient.BeginReimage` parameter(s) have been changed from `(context.Context, string, string, *VirtualMachineScaleSetsBeginReimageOptions)` to `(context.Context, string, string, *VirtualMachineScaleSetsClientBeginReimageOptions)` -- Function `*VirtualMachineScaleSetsClient.BeginReimage` return value(s) have been changed from `(VirtualMachineScaleSetsReimagePollerResponse, error)` to `(VirtualMachineScaleSetsClientReimagePollerResponse, error)` -- Function `*VirtualMachineScaleSetVMsClient.BeginRedeploy` parameter(s) have been changed from `(context.Context, string, string, string, *VirtualMachineScaleSetVMsBeginRedeployOptions)` to `(context.Context, string, string, string, *VirtualMachineScaleSetVMsClientBeginRedeployOptions)` -- Function `*VirtualMachineScaleSetVMsClient.BeginRedeploy` return value(s) have been changed from `(VirtualMachineScaleSetVMsRedeployPollerResponse, error)` to `(VirtualMachineScaleSetVMsClientRedeployPollerResponse, error)` -- Function `*VirtualMachineExtensionsClient.BeginCreateOrUpdate` parameter(s) have been changed from `(context.Context, string, string, string, VirtualMachineExtension, *VirtualMachineExtensionsBeginCreateOrUpdateOptions)` to `(context.Context, string, string, string, VirtualMachineExtension, *VirtualMachineExtensionsClientBeginCreateOrUpdateOptions)` -- Function `*VirtualMachineExtensionsClient.BeginCreateOrUpdate` return value(s) have been changed from `(VirtualMachineExtensionsCreateOrUpdatePollerResponse, error)` to `(VirtualMachineExtensionsClientCreateOrUpdatePollerResponse, error)` -- Function `*RestorePointCollectionsClient.Get` parameter(s) have been changed from `(context.Context, string, string, *RestorePointCollectionsGetOptions)` to `(context.Context, string, string, *RestorePointCollectionsClientGetOptions)` -- Function `*RestorePointCollectionsClient.Get` return value(s) have been changed from `(RestorePointCollectionsGetResponse, error)` to `(RestorePointCollectionsClientGetResponse, error)` -- Function `*VirtualMachinesClient.BeginAssessPatches` parameter(s) have been changed from `(context.Context, string, string, *VirtualMachinesBeginAssessPatchesOptions)` to `(context.Context, string, string, *VirtualMachinesClientBeginAssessPatchesOptions)` -- Function `*VirtualMachinesClient.BeginAssessPatches` return value(s) have been changed from `(VirtualMachinesAssessPatchesPollerResponse, error)` to `(VirtualMachinesClientAssessPatchesPollerResponse, error)` -- Function `*VirtualMachineScaleSetVMRunCommandsClient.List` parameter(s) have been changed from `(string, string, string, *VirtualMachineScaleSetVMRunCommandsListOptions)` to `(string, string, string, *VirtualMachineScaleSetVMRunCommandsClientListOptions)` -- Function `*VirtualMachineScaleSetVMRunCommandsClient.List` return value(s) have been changed from `(*VirtualMachineScaleSetVMRunCommandsListPager)` to `(*VirtualMachineScaleSetVMRunCommandsClientListPager)` -- Function `*VirtualMachineScaleSetExtensionsClient.BeginCreateOrUpdate` parameter(s) have been changed from `(context.Context, string, string, string, VirtualMachineScaleSetExtension, *VirtualMachineScaleSetExtensionsBeginCreateOrUpdateOptions)` to `(context.Context, string, string, string, VirtualMachineScaleSetExtension, *VirtualMachineScaleSetExtensionsClientBeginCreateOrUpdateOptions)` -- Function `*VirtualMachineScaleSetExtensionsClient.BeginCreateOrUpdate` return value(s) have been changed from `(VirtualMachineScaleSetExtensionsCreateOrUpdatePollerResponse, error)` to `(VirtualMachineScaleSetExtensionsClientCreateOrUpdatePollerResponse, error)` -- Function `*CloudServiceOperatingSystemsClient.ListOSVersions` parameter(s) have been changed from `(string, *CloudServiceOperatingSystemsListOSVersionsOptions)` to `(string, *CloudServiceOperatingSystemsClientListOSVersionsOptions)` -- Function `*CloudServiceOperatingSystemsClient.ListOSVersions` return value(s) have been changed from `(*CloudServiceOperatingSystemsListOSVersionsPager)` to `(*CloudServiceOperatingSystemsClientListOSVersionsPager)` -- Function `*VirtualMachinesClient.BeginPerformMaintenance` parameter(s) have been changed from `(context.Context, string, string, *VirtualMachinesBeginPerformMaintenanceOptions)` to `(context.Context, string, string, *VirtualMachinesClientBeginPerformMaintenanceOptions)` -- Function `*VirtualMachinesClient.BeginPerformMaintenance` return value(s) have been changed from `(VirtualMachinesPerformMaintenancePollerResponse, error)` to `(VirtualMachinesClientPerformMaintenancePollerResponse, error)` -- Function `*VirtualMachineScaleSetExtensionsClient.Get` parameter(s) have been changed from `(context.Context, string, string, string, *VirtualMachineScaleSetExtensionsGetOptions)` to `(context.Context, string, string, string, *VirtualMachineScaleSetExtensionsClientGetOptions)` -- Function `*VirtualMachineScaleSetExtensionsClient.Get` return value(s) have been changed from `(VirtualMachineScaleSetExtensionsGetResponse, error)` to `(VirtualMachineScaleSetExtensionsClientGetResponse, error)` -- Function `*CapacityReservationsClient.BeginDelete` parameter(s) have been changed from `(context.Context, string, string, string, *CapacityReservationsBeginDeleteOptions)` to `(context.Context, string, string, string, *CapacityReservationsClientBeginDeleteOptions)` -- Function `*CapacityReservationsClient.BeginDelete` return value(s) have been changed from `(CapacityReservationsDeletePollerResponse, error)` to `(CapacityReservationsClientDeletePollerResponse, error)` -- Function `*GalleryApplicationsClient.BeginUpdate` parameter(s) have been changed from `(context.Context, string, string, string, GalleryApplicationUpdate, *GalleryApplicationsBeginUpdateOptions)` to `(context.Context, string, string, string, GalleryApplicationUpdate, *GalleryApplicationsClientBeginUpdateOptions)` -- Function `*GalleryApplicationsClient.BeginUpdate` return value(s) have been changed from `(GalleryApplicationsUpdatePollerResponse, error)` to `(GalleryApplicationsClientUpdatePollerResponse, error)` -- Function `*VirtualMachineExtensionsClient.Get` parameter(s) have been changed from `(context.Context, string, string, string, *VirtualMachineExtensionsGetOptions)` to `(context.Context, string, string, string, *VirtualMachineExtensionsClientGetOptions)` -- Function `*VirtualMachineExtensionsClient.Get` return value(s) have been changed from `(VirtualMachineExtensionsGetResponse, error)` to `(VirtualMachineExtensionsClientGetResponse, error)` -- Function `*VirtualMachineScaleSetVMRunCommandsClient.Get` parameter(s) have been changed from `(context.Context, string, string, string, string, *VirtualMachineScaleSetVMRunCommandsGetOptions)` to `(context.Context, string, string, string, string, *VirtualMachineScaleSetVMRunCommandsClientGetOptions)` -- Function `*VirtualMachineScaleSetVMRunCommandsClient.Get` return value(s) have been changed from `(VirtualMachineScaleSetVMRunCommandsGetResponse, error)` to `(VirtualMachineScaleSetVMRunCommandsClientGetResponse, error)` -- Function `*DiskAccessesClient.BeginCreateOrUpdate` parameter(s) have been changed from `(context.Context, string, string, DiskAccess, *DiskAccessesBeginCreateOrUpdateOptions)` to `(context.Context, string, string, DiskAccess, *DiskAccessesClientBeginCreateOrUpdateOptions)` -- Function `*DiskAccessesClient.BeginCreateOrUpdate` return value(s) have been changed from `(DiskAccessesCreateOrUpdatePollerResponse, error)` to `(DiskAccessesClientCreateOrUpdatePollerResponse, error)` -- Function `*SSHPublicKeysClient.GenerateKeyPair` parameter(s) have been changed from `(context.Context, string, string, *SSHPublicKeysGenerateKeyPairOptions)` to `(context.Context, string, string, *SSHPublicKeysClientGenerateKeyPairOptions)` -- Function `*SSHPublicKeysClient.GenerateKeyPair` return value(s) have been changed from `(SSHPublicKeysGenerateKeyPairResponse, error)` to `(SSHPublicKeysClientGenerateKeyPairResponse, error)` -- Function `*VirtualMachineRunCommandsClient.ListByVirtualMachine` parameter(s) have been changed from `(string, string, *VirtualMachineRunCommandsListByVirtualMachineOptions)` to `(string, string, *VirtualMachineRunCommandsClientListByVirtualMachineOptions)` -- Function `*VirtualMachineRunCommandsClient.ListByVirtualMachine` return value(s) have been changed from `(*VirtualMachineRunCommandsListByVirtualMachinePager)` to `(*VirtualMachineRunCommandsClientListByVirtualMachinePager)` -- Function `*VirtualMachinesClient.ListAll` parameter(s) have been changed from `(*VirtualMachinesListAllOptions)` to `(*VirtualMachinesClientListAllOptions)` -- Function `*VirtualMachinesClient.ListAll` return value(s) have been changed from `(*VirtualMachinesListAllPager)` to `(*VirtualMachinesClientListAllPager)` -- Function `*SSHPublicKeysClient.Delete` parameter(s) have been changed from `(context.Context, string, string, *SSHPublicKeysDeleteOptions)` to `(context.Context, string, string, *SSHPublicKeysClientDeleteOptions)` -- Function `*SSHPublicKeysClient.Delete` return value(s) have been changed from `(SSHPublicKeysDeleteResponse, error)` to `(SSHPublicKeysClientDeleteResponse, error)` -- Function `*SnapshotsClient.List` parameter(s) have been changed from `(*SnapshotsListOptions)` to `(*SnapshotsClientListOptions)` -- Function `*SnapshotsClient.List` return value(s) have been changed from `(*SnapshotsListPager)` to `(*SnapshotsClientListPager)` -- Function `*SnapshotsClient.BeginRevokeAccess` parameter(s) have been changed from `(context.Context, string, string, *SnapshotsBeginRevokeAccessOptions)` to `(context.Context, string, string, *SnapshotsClientBeginRevokeAccessOptions)` -- Function `*SnapshotsClient.BeginRevokeAccess` return value(s) have been changed from `(SnapshotsRevokeAccessPollerResponse, error)` to `(SnapshotsClientRevokeAccessPollerResponse, error)` -- Function `*CapacityReservationsClient.BeginUpdate` parameter(s) have been changed from `(context.Context, string, string, string, CapacityReservationUpdate, *CapacityReservationsBeginUpdateOptions)` to `(context.Context, string, string, string, CapacityReservationUpdate, *CapacityReservationsClientBeginUpdateOptions)` -- Function `*CapacityReservationsClient.BeginUpdate` return value(s) have been changed from `(CapacityReservationsUpdatePollerResponse, error)` to `(CapacityReservationsClientUpdatePollerResponse, error)` -- Function `*CloudServiceRolesClient.Get` parameter(s) have been changed from `(context.Context, string, string, string, *CloudServiceRolesGetOptions)` to `(context.Context, string, string, string, *CloudServiceRolesClientGetOptions)` -- Function `*CloudServiceRolesClient.Get` return value(s) have been changed from `(CloudServiceRolesGetResponse, error)` to `(CloudServiceRolesClientGetResponse, error)` -- Function `*ImagesClient.List` parameter(s) have been changed from `(*ImagesListOptions)` to `(*ImagesClientListOptions)` -- Function `*ImagesClient.List` return value(s) have been changed from `(*ImagesListPager)` to `(*ImagesClientListPager)` -- Function `*RestorePointCollectionsClient.CreateOrUpdate` parameter(s) have been changed from `(context.Context, string, string, RestorePointCollection, *RestorePointCollectionsCreateOrUpdateOptions)` to `(context.Context, string, string, RestorePointCollection, *RestorePointCollectionsClientCreateOrUpdateOptions)` -- Function `*RestorePointCollectionsClient.CreateOrUpdate` return value(s) have been changed from `(RestorePointCollectionsCreateOrUpdateResponse, error)` to `(RestorePointCollectionsClientCreateOrUpdateResponse, error)` -- Function `*ProximityPlacementGroupsClient.Update` parameter(s) have been changed from `(context.Context, string, string, ProximityPlacementGroupUpdate, *ProximityPlacementGroupsUpdateOptions)` to `(context.Context, string, string, ProximityPlacementGroupUpdate, *ProximityPlacementGroupsClientUpdateOptions)` -- Function `*ProximityPlacementGroupsClient.Update` return value(s) have been changed from `(ProximityPlacementGroupsUpdateResponse, error)` to `(ProximityPlacementGroupsClientUpdateResponse, error)` -- Function `*RestorePointsClient.BeginDelete` parameter(s) have been changed from `(context.Context, string, string, string, *RestorePointsBeginDeleteOptions)` to `(context.Context, string, string, string, *RestorePointsClientBeginDeleteOptions)` -- Function `*RestorePointsClient.BeginDelete` return value(s) have been changed from `(RestorePointsDeletePollerResponse, error)` to `(RestorePointsClientDeletePollerResponse, error)` -- Function `*DiskAccessesClient.ListByResourceGroup` parameter(s) have been changed from `(string, *DiskAccessesListByResourceGroupOptions)` to `(string, *DiskAccessesClientListByResourceGroupOptions)` -- Function `*DiskAccessesClient.ListByResourceGroup` return value(s) have been changed from `(*DiskAccessesListByResourceGroupPager)` to `(*DiskAccessesClientListByResourceGroupPager)` -- Function `*GallerySharingProfileClient.BeginUpdate` parameter(s) have been changed from `(context.Context, string, string, SharingUpdate, *GallerySharingProfileBeginUpdateOptions)` to `(context.Context, string, string, SharingUpdate, *GallerySharingProfileClientBeginUpdateOptions)` -- Function `*GallerySharingProfileClient.BeginUpdate` return value(s) have been changed from `(GallerySharingProfileUpdatePollerResponse, error)` to `(GallerySharingProfileClientUpdatePollerResponse, error)` -- Function `*GalleryApplicationsClient.BeginDelete` parameter(s) have been changed from `(context.Context, string, string, string, *GalleryApplicationsBeginDeleteOptions)` to `(context.Context, string, string, string, *GalleryApplicationsClientBeginDeleteOptions)` -- Function `*GalleryApplicationsClient.BeginDelete` return value(s) have been changed from `(GalleryApplicationsDeletePollerResponse, error)` to `(GalleryApplicationsClientDeletePollerResponse, error)` -- Function `*ProximityPlacementGroupsClient.Delete` parameter(s) have been changed from `(context.Context, string, string, *ProximityPlacementGroupsDeleteOptions)` to `(context.Context, string, string, *ProximityPlacementGroupsClientDeleteOptions)` -- Function `*ProximityPlacementGroupsClient.Delete` return value(s) have been changed from `(ProximityPlacementGroupsDeleteResponse, error)` to `(ProximityPlacementGroupsClientDeleteResponse, error)` -- Function `*DiskAccessesClient.BeginUpdate` parameter(s) have been changed from `(context.Context, string, string, DiskAccessUpdate, *DiskAccessesBeginUpdateOptions)` to `(context.Context, string, string, DiskAccessUpdate, *DiskAccessesClientBeginUpdateOptions)` -- Function `*DiskAccessesClient.BeginUpdate` return value(s) have been changed from `(DiskAccessesUpdatePollerResponse, error)` to `(DiskAccessesClientUpdatePollerResponse, error)` -- Function `*DedicatedHostGroupsClient.CreateOrUpdate` parameter(s) have been changed from `(context.Context, string, string, DedicatedHostGroup, *DedicatedHostGroupsCreateOrUpdateOptions)` to `(context.Context, string, string, DedicatedHostGroup, *DedicatedHostGroupsClientCreateOrUpdateOptions)` -- Function `*DedicatedHostGroupsClient.CreateOrUpdate` return value(s) have been changed from `(DedicatedHostGroupsCreateOrUpdateResponse, error)` to `(DedicatedHostGroupsClientCreateOrUpdateResponse, error)` -- Function `*RestorePointCollectionsClient.ListAll` parameter(s) have been changed from `(*RestorePointCollectionsListAllOptions)` to `(*RestorePointCollectionsClientListAllOptions)` -- Function `*RestorePointCollectionsClient.ListAll` return value(s) have been changed from `(*RestorePointCollectionsListAllPager)` to `(*RestorePointCollectionsClientListAllPager)` -- Function `*VirtualMachineScaleSetExtensionsClient.List` parameter(s) have been changed from `(string, string, *VirtualMachineScaleSetExtensionsListOptions)` to `(string, string, *VirtualMachineScaleSetExtensionsClientListOptions)` -- Function `*VirtualMachineScaleSetExtensionsClient.List` return value(s) have been changed from `(*VirtualMachineScaleSetExtensionsListPager)` to `(*VirtualMachineScaleSetExtensionsClientListPager)` -- Function `*CloudServicesClient.BeginReimage` parameter(s) have been changed from `(context.Context, string, string, *CloudServicesBeginReimageOptions)` to `(context.Context, string, string, *CloudServicesClientBeginReimageOptions)` -- Function `*CloudServicesClient.BeginReimage` return value(s) have been changed from `(CloudServicesReimagePollerResponse, error)` to `(CloudServicesClientReimagePollerResponse, error)` -- Function `*GalleryApplicationsClient.Get` parameter(s) have been changed from `(context.Context, string, string, string, *GalleryApplicationsGetOptions)` to `(context.Context, string, string, string, *GalleryApplicationsClientGetOptions)` -- Function `*GalleryApplicationsClient.Get` return value(s) have been changed from `(GalleryApplicationsGetResponse, error)` to `(GalleryApplicationsClientGetResponse, error)` -- Function `*RestorePointsClient.BeginCreate` parameter(s) have been changed from `(context.Context, string, string, string, RestorePoint, *RestorePointsBeginCreateOptions)` to `(context.Context, string, string, string, RestorePoint, *RestorePointsClientBeginCreateOptions)` -- Function `*RestorePointsClient.BeginCreate` return value(s) have been changed from `(RestorePointsCreatePollerResponse, error)` to `(RestorePointsClientCreatePollerResponse, error)` -- Function `*DiskRestorePointClient.Get` parameter(s) have been changed from `(context.Context, string, string, string, string, *DiskRestorePointGetOptions)` to `(context.Context, string, string, string, string, *DiskRestorePointClientGetOptions)` -- Function `*DiskRestorePointClient.Get` return value(s) have been changed from `(DiskRestorePointGetResponse, error)` to `(DiskRestorePointClientGetResponse, error)` -- Function `*GalleryApplicationsClient.ListByGallery` parameter(s) have been changed from `(string, string, *GalleryApplicationsListByGalleryOptions)` to `(string, string, *GalleryApplicationsClientListByGalleryOptions)` -- Function `*GalleryApplicationsClient.ListByGallery` return value(s) have been changed from `(*GalleryApplicationsListByGalleryPager)` to `(*GalleryApplicationsClientListByGalleryPager)` -- Function `*DedicatedHostsClient.BeginDelete` parameter(s) have been changed from `(context.Context, string, string, string, *DedicatedHostsBeginDeleteOptions)` to `(context.Context, string, string, string, *DedicatedHostsClientBeginDeleteOptions)` -- Function `*DedicatedHostsClient.BeginDelete` return value(s) have been changed from `(DedicatedHostsDeletePollerResponse, error)` to `(DedicatedHostsClientDeletePollerResponse, error)` -- Function `*VirtualMachineImagesEdgeZoneClient.ListOffers` parameter(s) have been changed from `(context.Context, string, string, string, *VirtualMachineImagesEdgeZoneListOffersOptions)` to `(context.Context, string, string, string, *VirtualMachineImagesEdgeZoneClientListOffersOptions)` -- Function `*VirtualMachineImagesEdgeZoneClient.ListOffers` return value(s) have been changed from `(VirtualMachineImagesEdgeZoneListOffersResponse, error)` to `(VirtualMachineImagesEdgeZoneClientListOffersResponse, error)` -- Function `*CloudServicesUpdateDomainClient.ListUpdateDomains` parameter(s) have been changed from `(string, string, *CloudServicesUpdateDomainListUpdateDomainsOptions)` to `(string, string, *CloudServicesUpdateDomainClientListUpdateDomainsOptions)` -- Function `*CloudServicesUpdateDomainClient.ListUpdateDomains` return value(s) have been changed from `(*CloudServicesUpdateDomainListUpdateDomainsPager)` to `(*CloudServicesUpdateDomainClientListUpdateDomainsPager)` -- Function `*ResourceSKUsClient.List` parameter(s) have been changed from `(*ResourceSKUsListOptions)` to `(*ResourceSKUsClientListOptions)` -- Function `*ResourceSKUsClient.List` return value(s) have been changed from `(*ResourceSKUsListPager)` to `(*ResourceSKUsClientListPager)` -- Function `*VirtualMachineScaleSetVMsClient.GetInstanceView` parameter(s) have been changed from `(context.Context, string, string, string, *VirtualMachineScaleSetVMsGetInstanceViewOptions)` to `(context.Context, string, string, string, *VirtualMachineScaleSetVMsClientGetInstanceViewOptions)` -- Function `*VirtualMachineScaleSetVMsClient.GetInstanceView` return value(s) have been changed from `(VirtualMachineScaleSetVMsGetInstanceViewResponse, error)` to `(VirtualMachineScaleSetVMsClientGetInstanceViewResponse, error)` -- Function `*VirtualMachineScaleSetsClient.ListSKUs` parameter(s) have been changed from `(string, string, *VirtualMachineScaleSetsListSKUsOptions)` to `(string, string, *VirtualMachineScaleSetsClientListSKUsOptions)` -- Function `*VirtualMachineScaleSetsClient.ListSKUs` return value(s) have been changed from `(*VirtualMachineScaleSetsListSKUsPager)` to `(*VirtualMachineScaleSetsClientListSKUsPager)` -- Function `*SnapshotsClient.ListByResourceGroup` parameter(s) have been changed from `(string, *SnapshotsListByResourceGroupOptions)` to `(string, *SnapshotsClientListByResourceGroupOptions)` -- Function `*SnapshotsClient.ListByResourceGroup` return value(s) have been changed from `(*SnapshotsListByResourceGroupPager)` to `(*SnapshotsClientListByResourceGroupPager)` -- Function `*VirtualMachineScaleSetsClient.BeginUpdateInstances` parameter(s) have been changed from `(context.Context, string, string, VirtualMachineScaleSetVMInstanceRequiredIDs, *VirtualMachineScaleSetsBeginUpdateInstancesOptions)` to `(context.Context, string, string, VirtualMachineScaleSetVMInstanceRequiredIDs, *VirtualMachineScaleSetsClientBeginUpdateInstancesOptions)` -- Function `*VirtualMachineScaleSetsClient.BeginUpdateInstances` return value(s) have been changed from `(VirtualMachineScaleSetsUpdateInstancesPollerResponse, error)` to `(VirtualMachineScaleSetsClientUpdateInstancesPollerResponse, error)` -- Function `*VirtualMachineScaleSetsClient.BeginPerformMaintenance` parameter(s) have been changed from `(context.Context, string, string, *VirtualMachineScaleSetsBeginPerformMaintenanceOptions)` to `(context.Context, string, string, *VirtualMachineScaleSetsClientBeginPerformMaintenanceOptions)` -- Function `*VirtualMachineScaleSetsClient.BeginPerformMaintenance` return value(s) have been changed from `(VirtualMachineScaleSetsPerformMaintenancePollerResponse, error)` to `(VirtualMachineScaleSetsClientPerformMaintenancePollerResponse, error)` -- Function `*DiskAccessesClient.Get` parameter(s) have been changed from `(context.Context, string, string, *DiskAccessesGetOptions)` to `(context.Context, string, string, *DiskAccessesClientGetOptions)` -- Function `*DiskAccessesClient.Get` return value(s) have been changed from `(DiskAccessesGetResponse, error)` to `(DiskAccessesClientGetResponse, error)` -- Function `*CapacityReservationGroupsClient.Update` parameter(s) have been changed from `(context.Context, string, string, CapacityReservationGroupUpdate, *CapacityReservationGroupsUpdateOptions)` to `(context.Context, string, string, CapacityReservationGroupUpdate, *CapacityReservationGroupsClientUpdateOptions)` -- Function `*CapacityReservationGroupsClient.Update` return value(s) have been changed from `(CapacityReservationGroupsUpdateResponse, error)` to `(CapacityReservationGroupsClientUpdateResponse, error)` -- Function `*CloudServicesClient.GetInstanceView` parameter(s) have been changed from `(context.Context, string, string, *CloudServicesGetInstanceViewOptions)` to `(context.Context, string, string, *CloudServicesClientGetInstanceViewOptions)` -- Function `*CloudServicesClient.GetInstanceView` return value(s) have been changed from `(CloudServicesGetInstanceViewResponse, error)` to `(CloudServicesClientGetInstanceViewResponse, error)` -- Function `*VirtualMachinesClient.BeginRedeploy` parameter(s) have been changed from `(context.Context, string, string, *VirtualMachinesBeginRedeployOptions)` to `(context.Context, string, string, *VirtualMachinesClientBeginRedeployOptions)` -- Function `*VirtualMachinesClient.BeginRedeploy` return value(s) have been changed from `(VirtualMachinesRedeployPollerResponse, error)` to `(VirtualMachinesClientRedeployPollerResponse, error)` -- Function `*SSHPublicKeysClient.ListByResourceGroup` parameter(s) have been changed from `(string, *SSHPublicKeysListByResourceGroupOptions)` to `(string, *SSHPublicKeysClientListByResourceGroupOptions)` -- Function `*SSHPublicKeysClient.ListByResourceGroup` return value(s) have been changed from `(*SSHPublicKeysListByResourceGroupPager)` to `(*SSHPublicKeysClientListByResourceGroupPager)` -- Function `*VirtualMachineImagesClient.Get` parameter(s) have been changed from `(context.Context, string, string, string, string, string, *VirtualMachineImagesGetOptions)` to `(context.Context, string, string, string, string, string, *VirtualMachineImagesClientGetOptions)` -- Function `*VirtualMachineImagesClient.Get` return value(s) have been changed from `(VirtualMachineImagesGetResponse, error)` to `(VirtualMachineImagesClientGetResponse, error)` -- Function `*VirtualMachineScaleSetsClient.BeginDeleteInstances` parameter(s) have been changed from `(context.Context, string, string, VirtualMachineScaleSetVMInstanceRequiredIDs, *VirtualMachineScaleSetsBeginDeleteInstancesOptions)` to `(context.Context, string, string, VirtualMachineScaleSetVMInstanceRequiredIDs, *VirtualMachineScaleSetsClientBeginDeleteInstancesOptions)` -- Function `*VirtualMachineScaleSetsClient.BeginDeleteInstances` return value(s) have been changed from `(VirtualMachineScaleSetsDeleteInstancesPollerResponse, error)` to `(VirtualMachineScaleSetsClientDeleteInstancesPollerResponse, error)` -- Function `*VirtualMachineScaleSetsClient.BeginStart` parameter(s) have been changed from `(context.Context, string, string, *VirtualMachineScaleSetsBeginStartOptions)` to `(context.Context, string, string, *VirtualMachineScaleSetsClientBeginStartOptions)` -- Function `*VirtualMachineScaleSetsClient.BeginStart` return value(s) have been changed from `(VirtualMachineScaleSetsStartPollerResponse, error)` to `(VirtualMachineScaleSetsClientStartPollerResponse, error)` -- Function `*GalleryImagesClient.BeginUpdate` parameter(s) have been changed from `(context.Context, string, string, string, GalleryImageUpdate, *GalleryImagesBeginUpdateOptions)` to `(context.Context, string, string, string, GalleryImageUpdate, *GalleryImagesClientBeginUpdateOptions)` -- Function `*GalleryImagesClient.BeginUpdate` return value(s) have been changed from `(GalleryImagesUpdatePollerResponse, error)` to `(GalleryImagesClientUpdatePollerResponse, error)` -- Function `*DiskRestorePointClient.BeginRevokeAccess` parameter(s) have been changed from `(context.Context, string, string, string, string, *DiskRestorePointBeginRevokeAccessOptions)` to `(context.Context, string, string, string, string, *DiskRestorePointClientBeginRevokeAccessOptions)` -- Function `*DiskRestorePointClient.BeginRevokeAccess` return value(s) have been changed from `(DiskRestorePointRevokeAccessPollerResponse, error)` to `(DiskRestorePointClientRevokeAccessPollerResponse, error)` -- Function `*VirtualMachineExtensionImagesClient.ListVersions` parameter(s) have been changed from `(context.Context, string, string, string, *VirtualMachineExtensionImagesListVersionsOptions)` to `(context.Context, string, string, string, *VirtualMachineExtensionImagesClientListVersionsOptions)` -- Function `*VirtualMachineExtensionImagesClient.ListVersions` return value(s) have been changed from `(VirtualMachineExtensionImagesListVersionsResponse, error)` to `(VirtualMachineExtensionImagesClientListVersionsResponse, error)` -- Function `*DiskEncryptionSetsClient.Get` parameter(s) have been changed from `(context.Context, string, string, *DiskEncryptionSetsGetOptions)` to `(context.Context, string, string, *DiskEncryptionSetsClientGetOptions)` -- Function `*DiskEncryptionSetsClient.Get` return value(s) have been changed from `(DiskEncryptionSetsGetResponse, error)` to `(DiskEncryptionSetsClientGetResponse, error)` -- Function `*GalleriesClient.ListByResourceGroup` parameter(s) have been changed from `(string, *GalleriesListByResourceGroupOptions)` to `(string, *GalleriesClientListByResourceGroupOptions)` -- Function `*GalleriesClient.ListByResourceGroup` return value(s) have been changed from `(*GalleriesListByResourceGroupPager)` to `(*GalleriesClientListByResourceGroupPager)` -- Function `*VirtualMachineRunCommandsClient.Get` parameter(s) have been changed from `(context.Context, string, string, *VirtualMachineRunCommandsGetOptions)` to `(context.Context, string, string, *VirtualMachineRunCommandsClientGetOptions)` -- Function `*VirtualMachineRunCommandsClient.Get` return value(s) have been changed from `(VirtualMachineRunCommandsGetResponse, error)` to `(VirtualMachineRunCommandsClientGetResponse, error)` -- Function `*GalleriesClient.BeginDelete` parameter(s) have been changed from `(context.Context, string, string, *GalleriesBeginDeleteOptions)` to `(context.Context, string, string, *GalleriesClientBeginDeleteOptions)` -- Function `*GalleriesClient.BeginDelete` return value(s) have been changed from `(GalleriesDeletePollerResponse, error)` to `(GalleriesClientDeletePollerResponse, error)` -- Function `*SnapshotsClient.BeginCreateOrUpdate` parameter(s) have been changed from `(context.Context, string, string, Snapshot, *SnapshotsBeginCreateOrUpdateOptions)` to `(context.Context, string, string, Snapshot, *SnapshotsClientBeginCreateOrUpdateOptions)` -- Function `*SnapshotsClient.BeginCreateOrUpdate` return value(s) have been changed from `(SnapshotsCreateOrUpdatePollerResponse, error)` to `(SnapshotsClientCreateOrUpdatePollerResponse, error)` -- Function `*CapacityReservationsClient.ListByCapacityReservationGroup` parameter(s) have been changed from `(string, string, *CapacityReservationsListByCapacityReservationGroupOptions)` to `(string, string, *CapacityReservationsClientListByCapacityReservationGroupOptions)` -- Function `*CapacityReservationsClient.ListByCapacityReservationGroup` return value(s) have been changed from `(*CapacityReservationsListByCapacityReservationGroupPager)` to `(*CapacityReservationsClientListByCapacityReservationGroupPager)` -- Function `*VirtualMachinesClient.BeginReimage` parameter(s) have been changed from `(context.Context, string, string, *VirtualMachinesBeginReimageOptions)` to `(context.Context, string, string, *VirtualMachinesClientBeginReimageOptions)` -- Function `*VirtualMachinesClient.BeginReimage` return value(s) have been changed from `(VirtualMachinesReimagePollerResponse, error)` to `(VirtualMachinesClientReimagePollerResponse, error)` -- Function `*VirtualMachineExtensionImagesClient.Get` parameter(s) have been changed from `(context.Context, string, string, string, string, *VirtualMachineExtensionImagesGetOptions)` to `(context.Context, string, string, string, string, *VirtualMachineExtensionImagesClientGetOptions)` -- Function `*VirtualMachineExtensionImagesClient.Get` return value(s) have been changed from `(VirtualMachineExtensionImagesGetResponse, error)` to `(VirtualMachineExtensionImagesClientGetResponse, error)` -- Function `*CloudServiceRoleInstancesClient.BeginReimage` parameter(s) have been changed from `(context.Context, string, string, string, *CloudServiceRoleInstancesBeginReimageOptions)` to `(context.Context, string, string, string, *CloudServiceRoleInstancesClientBeginReimageOptions)` -- Function `*CloudServiceRoleInstancesClient.BeginReimage` return value(s) have been changed from `(CloudServiceRoleInstancesReimagePollerResponse, error)` to `(CloudServiceRoleInstancesClientReimagePollerResponse, error)` -- Function `*ImagesClient.BeginDelete` parameter(s) have been changed from `(context.Context, string, string, *ImagesBeginDeleteOptions)` to `(context.Context, string, string, *ImagesClientBeginDeleteOptions)` -- Function `*ImagesClient.BeginDelete` return value(s) have been changed from `(ImagesDeletePollerResponse, error)` to `(ImagesClientDeletePollerResponse, error)` -- Function `*GalleryImagesClient.ListByGallery` parameter(s) have been changed from `(string, string, *GalleryImagesListByGalleryOptions)` to `(string, string, *GalleryImagesClientListByGalleryOptions)` -- Function `*GalleryImagesClient.ListByGallery` return value(s) have been changed from `(*GalleryImagesListByGalleryPager)` to `(*GalleryImagesClientListByGalleryPager)` -- Function `*VirtualMachineScaleSetsClient.BeginCreateOrUpdate` parameter(s) have been changed from `(context.Context, string, string, VirtualMachineScaleSet, *VirtualMachineScaleSetsBeginCreateOrUpdateOptions)` to `(context.Context, string, string, VirtualMachineScaleSet, *VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions)` -- Function `*VirtualMachineScaleSetsClient.BeginCreateOrUpdate` return value(s) have been changed from `(VirtualMachineScaleSetsCreateOrUpdatePollerResponse, error)` to `(VirtualMachineScaleSetsClientCreateOrUpdatePollerResponse, error)` -- Function `*DiskEncryptionSetsClient.List` parameter(s) have been changed from `(*DiskEncryptionSetsListOptions)` to `(*DiskEncryptionSetsClientListOptions)` -- Function `*DiskEncryptionSetsClient.List` return value(s) have been changed from `(*DiskEncryptionSetsListPager)` to `(*DiskEncryptionSetsClientListPager)` -- Function `*VirtualMachineScaleSetsClient.BeginUpdate` parameter(s) have been changed from `(context.Context, string, string, VirtualMachineScaleSetUpdate, *VirtualMachineScaleSetsBeginUpdateOptions)` to `(context.Context, string, string, VirtualMachineScaleSetUpdate, *VirtualMachineScaleSetsClientBeginUpdateOptions)` -- Function `*VirtualMachineScaleSetsClient.BeginUpdate` return value(s) have been changed from `(VirtualMachineScaleSetsUpdatePollerResponse, error)` to `(VirtualMachineScaleSetsClientUpdatePollerResponse, error)` -- Function `*VirtualMachineScaleSetsClient.BeginReimageAll` parameter(s) have been changed from `(context.Context, string, string, *VirtualMachineScaleSetsBeginReimageAllOptions)` to `(context.Context, string, string, *VirtualMachineScaleSetsClientBeginReimageAllOptions)` -- Function `*VirtualMachineScaleSetsClient.BeginReimageAll` return value(s) have been changed from `(VirtualMachineScaleSetsReimageAllPollerResponse, error)` to `(VirtualMachineScaleSetsClientReimageAllPollerResponse, error)` -- Function `*VirtualMachineScaleSetVMsClient.BeginStart` parameter(s) have been changed from `(context.Context, string, string, string, *VirtualMachineScaleSetVMsBeginStartOptions)` to `(context.Context, string, string, string, *VirtualMachineScaleSetVMsClientBeginStartOptions)` -- Function `*VirtualMachineScaleSetVMsClient.BeginStart` return value(s) have been changed from `(VirtualMachineScaleSetVMsStartPollerResponse, error)` to `(VirtualMachineScaleSetVMsClientStartPollerResponse, error)` -- Function `*CloudServicesClient.BeginDelete` parameter(s) have been changed from `(context.Context, string, string, *CloudServicesBeginDeleteOptions)` to `(context.Context, string, string, *CloudServicesClientBeginDeleteOptions)` -- Function `*CloudServicesClient.BeginDelete` return value(s) have been changed from `(CloudServicesDeletePollerResponse, error)` to `(CloudServicesClientDeletePollerResponse, error)` -- Function `*CommunityGalleryImagesClient.Get` parameter(s) have been changed from `(context.Context, string, string, string, *CommunityGalleryImagesGetOptions)` to `(context.Context, string, string, string, *CommunityGalleryImagesClientGetOptions)` -- Function `*CommunityGalleryImagesClient.Get` return value(s) have been changed from `(CommunityGalleryImagesGetResponse, error)` to `(CommunityGalleryImagesClientGetResponse, error)` -- Function `*VirtualMachineScaleSetVMExtensionsClient.Get` parameter(s) have been changed from `(context.Context, string, string, string, string, *VirtualMachineScaleSetVMExtensionsGetOptions)` to `(context.Context, string, string, string, string, *VirtualMachineScaleSetVMExtensionsClientGetOptions)` -- Function `*VirtualMachineScaleSetVMExtensionsClient.Get` return value(s) have been changed from `(VirtualMachineScaleSetVMExtensionsGetResponse, error)` to `(VirtualMachineScaleSetVMExtensionsClientGetResponse, error)` -- Function `*VirtualMachineScaleSetVMsClient.SimulateEviction` parameter(s) have been changed from `(context.Context, string, string, string, *VirtualMachineScaleSetVMsSimulateEvictionOptions)` to `(context.Context, string, string, string, *VirtualMachineScaleSetVMsClientSimulateEvictionOptions)` -- Function `*VirtualMachineScaleSetVMsClient.SimulateEviction` return value(s) have been changed from `(VirtualMachineScaleSetVMsSimulateEvictionResponse, error)` to `(VirtualMachineScaleSetVMsClientSimulateEvictionResponse, error)` -- Function `*ProximityPlacementGroupsClient.CreateOrUpdate` parameter(s) have been changed from `(context.Context, string, string, ProximityPlacementGroup, *ProximityPlacementGroupsCreateOrUpdateOptions)` to `(context.Context, string, string, ProximityPlacementGroup, *ProximityPlacementGroupsClientCreateOrUpdateOptions)` -- Function `*ProximityPlacementGroupsClient.CreateOrUpdate` return value(s) have been changed from `(ProximityPlacementGroupsCreateOrUpdateResponse, error)` to `(ProximityPlacementGroupsClientCreateOrUpdateResponse, error)` -- Function `*VirtualMachineScaleSetsClient.GetInstanceView` parameter(s) have been changed from `(context.Context, string, string, *VirtualMachineScaleSetsGetInstanceViewOptions)` to `(context.Context, string, string, *VirtualMachineScaleSetsClientGetInstanceViewOptions)` -- Function `*VirtualMachineScaleSetsClient.GetInstanceView` return value(s) have been changed from `(VirtualMachineScaleSetsGetInstanceViewResponse, error)` to `(VirtualMachineScaleSetsClientGetInstanceViewResponse, error)` -- Function `*ProximityPlacementGroupsClient.ListBySubscription` parameter(s) have been changed from `(*ProximityPlacementGroupsListBySubscriptionOptions)` to `(*ProximityPlacementGroupsClientListBySubscriptionOptions)` -- Function `*ProximityPlacementGroupsClient.ListBySubscription` return value(s) have been changed from `(*ProximityPlacementGroupsListBySubscriptionPager)` to `(*ProximityPlacementGroupsClientListBySubscriptionPager)` -- Function `*DiskEncryptionSetsClient.BeginCreateOrUpdate` parameter(s) have been changed from `(context.Context, string, string, DiskEncryptionSet, *DiskEncryptionSetsBeginCreateOrUpdateOptions)` to `(context.Context, string, string, DiskEncryptionSet, *DiskEncryptionSetsClientBeginCreateOrUpdateOptions)` -- Function `*DiskEncryptionSetsClient.BeginCreateOrUpdate` return value(s) have been changed from `(DiskEncryptionSetsCreateOrUpdatePollerResponse, error)` to `(DiskEncryptionSetsClientCreateOrUpdatePollerResponse, error)` -- Function `*CloudServicesUpdateDomainClient.BeginWalkUpdateDomain` parameter(s) have been changed from `(context.Context, string, string, int32, *CloudServicesUpdateDomainBeginWalkUpdateDomainOptions)` to `(context.Context, string, string, int32, *CloudServicesUpdateDomainClientBeginWalkUpdateDomainOptions)` -- Function `*CloudServicesUpdateDomainClient.BeginWalkUpdateDomain` return value(s) have been changed from `(CloudServicesUpdateDomainWalkUpdateDomainPollerResponse, error)` to `(CloudServicesUpdateDomainClientWalkUpdateDomainPollerResponse, error)` -- Function `*VirtualMachinesClient.BeginDelete` parameter(s) have been changed from `(context.Context, string, string, *VirtualMachinesBeginDeleteOptions)` to `(context.Context, string, string, *VirtualMachinesClientBeginDeleteOptions)` -- Function `*VirtualMachinesClient.BeginDelete` return value(s) have been changed from `(VirtualMachinesDeletePollerResponse, error)` to `(VirtualMachinesClientDeletePollerResponse, error)` -- Function `*DiskAccessesClient.BeginUpdateAPrivateEndpointConnection` parameter(s) have been changed from `(context.Context, string, string, string, PrivateEndpointConnection, *DiskAccessesBeginUpdateAPrivateEndpointConnectionOptions)` to `(context.Context, string, string, string, PrivateEndpointConnection, *DiskAccessesClientBeginUpdateAPrivateEndpointConnectionOptions)` -- Function `*DiskAccessesClient.BeginUpdateAPrivateEndpointConnection` return value(s) have been changed from `(DiskAccessesUpdateAPrivateEndpointConnectionPollerResponse, error)` to `(DiskAccessesClientUpdateAPrivateEndpointConnectionPollerResponse, error)` -- Function `*CloudServiceRolesClient.List` parameter(s) have been changed from `(string, string, *CloudServiceRolesListOptions)` to `(string, string, *CloudServiceRolesClientListOptions)` -- Function `*CloudServiceRolesClient.List` return value(s) have been changed from `(*CloudServiceRolesListPager)` to `(*CloudServiceRolesClientListPager)` -- Function `*CloudServicesClient.BeginDeleteInstances` parameter(s) have been changed from `(context.Context, string, string, *CloudServicesBeginDeleteInstancesOptions)` to `(context.Context, string, string, *CloudServicesClientBeginDeleteInstancesOptions)` -- Function `*CloudServicesClient.BeginDeleteInstances` return value(s) have been changed from `(CloudServicesDeleteInstancesPollerResponse, error)` to `(CloudServicesClientDeleteInstancesPollerResponse, error)` -- Function `*VirtualMachineScaleSetVMExtensionsClient.BeginUpdate` parameter(s) have been changed from `(context.Context, string, string, string, string, VirtualMachineScaleSetVMExtensionUpdate, *VirtualMachineScaleSetVMExtensionsBeginUpdateOptions)` to `(context.Context, string, string, string, string, VirtualMachineScaleSetVMExtensionUpdate, *VirtualMachineScaleSetVMExtensionsClientBeginUpdateOptions)` -- Function `*VirtualMachineScaleSetVMExtensionsClient.BeginUpdate` return value(s) have been changed from `(VirtualMachineScaleSetVMExtensionsUpdatePollerResponse, error)` to `(VirtualMachineScaleSetVMExtensionsClientUpdatePollerResponse, error)` -- Function `*CommunityGalleryImageVersionsClient.Get` parameter(s) have been changed from `(context.Context, string, string, string, string, *CommunityGalleryImageVersionsGetOptions)` to `(context.Context, string, string, string, string, *CommunityGalleryImageVersionsClientGetOptions)` -- Function `*CommunityGalleryImageVersionsClient.Get` return value(s) have been changed from `(CommunityGalleryImageVersionsGetResponse, error)` to `(CommunityGalleryImageVersionsClientGetResponse, error)` -- Function `*GalleryApplicationVersionsClient.BeginCreateOrUpdate` parameter(s) have been changed from `(context.Context, string, string, string, string, GalleryApplicationVersion, *GalleryApplicationVersionsBeginCreateOrUpdateOptions)` to `(context.Context, string, string, string, string, GalleryApplicationVersion, *GalleryApplicationVersionsClientBeginCreateOrUpdateOptions)` -- Function `*GalleryApplicationVersionsClient.BeginCreateOrUpdate` return value(s) have been changed from `(GalleryApplicationVersionsCreateOrUpdatePollerResponse, error)` to `(GalleryApplicationVersionsClientCreateOrUpdatePollerResponse, error)` -- Function `*DisksClient.BeginRevokeAccess` parameter(s) have been changed from `(context.Context, string, string, *DisksBeginRevokeAccessOptions)` to `(context.Context, string, string, *DisksClientBeginRevokeAccessOptions)` -- Function `*DisksClient.BeginRevokeAccess` return value(s) have been changed from `(DisksRevokeAccessPollerResponse, error)` to `(DisksClientRevokeAccessPollerResponse, error)` -- Function `*CloudServiceOperatingSystemsClient.GetOSFamily` parameter(s) have been changed from `(context.Context, string, string, *CloudServiceOperatingSystemsGetOSFamilyOptions)` to `(context.Context, string, string, *CloudServiceOperatingSystemsClientGetOSFamilyOptions)` -- Function `*CloudServiceOperatingSystemsClient.GetOSFamily` return value(s) have been changed from `(CloudServiceOperatingSystemsGetOSFamilyResponse, error)` to `(CloudServiceOperatingSystemsClientGetOSFamilyResponse, error)` -- Function `*SSHPublicKeysClient.Create` parameter(s) have been changed from `(context.Context, string, string, SSHPublicKeyResource, *SSHPublicKeysCreateOptions)` to `(context.Context, string, string, SSHPublicKeyResource, *SSHPublicKeysClientCreateOptions)` -- Function `*SSHPublicKeysClient.Create` return value(s) have been changed from `(SSHPublicKeysCreateResponse, error)` to `(SSHPublicKeysClientCreateResponse, error)` -- Function `*DedicatedHostGroupsClient.Get` parameter(s) have been changed from `(context.Context, string, string, *DedicatedHostGroupsGetOptions)` to `(context.Context, string, string, *DedicatedHostGroupsClientGetOptions)` -- Function `*DedicatedHostGroupsClient.Get` return value(s) have been changed from `(DedicatedHostGroupsGetResponse, error)` to `(DedicatedHostGroupsClientGetResponse, error)` -- Function `*GalleryApplicationVersionsClient.BeginUpdate` parameter(s) have been changed from `(context.Context, string, string, string, string, GalleryApplicationVersionUpdate, *GalleryApplicationVersionsBeginUpdateOptions)` to `(context.Context, string, string, string, string, GalleryApplicationVersionUpdate, *GalleryApplicationVersionsClientBeginUpdateOptions)` -- Function `*GalleryApplicationVersionsClient.BeginUpdate` return value(s) have been changed from `(GalleryApplicationVersionsUpdatePollerResponse, error)` to `(GalleryApplicationVersionsClientUpdatePollerResponse, error)` -- Function `*VirtualMachineScaleSetVMsClient.BeginPerformMaintenance` parameter(s) have been changed from `(context.Context, string, string, string, *VirtualMachineScaleSetVMsBeginPerformMaintenanceOptions)` to `(context.Context, string, string, string, *VirtualMachineScaleSetVMsClientBeginPerformMaintenanceOptions)` -- Function `*VirtualMachineScaleSetVMsClient.BeginPerformMaintenance` return value(s) have been changed from `(VirtualMachineScaleSetVMsPerformMaintenancePollerResponse, error)` to `(VirtualMachineScaleSetVMsClientPerformMaintenancePollerResponse, error)` -- Function `*DedicatedHostsClient.ListByHostGroup` parameter(s) have been changed from `(string, string, *DedicatedHostsListByHostGroupOptions)` to `(string, string, *DedicatedHostsClientListByHostGroupOptions)` -- Function `*DedicatedHostsClient.ListByHostGroup` return value(s) have been changed from `(*DedicatedHostsListByHostGroupPager)` to `(*DedicatedHostsClientListByHostGroupPager)` -- Function `*VirtualMachineScaleSetRollingUpgradesClient.GetLatest` parameter(s) have been changed from `(context.Context, string, string, *VirtualMachineScaleSetRollingUpgradesGetLatestOptions)` to `(context.Context, string, string, *VirtualMachineScaleSetRollingUpgradesClientGetLatestOptions)` -- Function `*VirtualMachineScaleSetRollingUpgradesClient.GetLatest` return value(s) have been changed from `(VirtualMachineScaleSetRollingUpgradesGetLatestResponse, error)` to `(VirtualMachineScaleSetRollingUpgradesClientGetLatestResponse, error)` -- Function `*VirtualMachineScaleSetRollingUpgradesClient.BeginStartOSUpgrade` parameter(s) have been changed from `(context.Context, string, string, *VirtualMachineScaleSetRollingUpgradesBeginStartOSUpgradeOptions)` to `(context.Context, string, string, *VirtualMachineScaleSetRollingUpgradesClientBeginStartOSUpgradeOptions)` -- Function `*VirtualMachineScaleSetRollingUpgradesClient.BeginStartOSUpgrade` return value(s) have been changed from `(VirtualMachineScaleSetRollingUpgradesStartOSUpgradePollerResponse, error)` to `(VirtualMachineScaleSetRollingUpgradesClientStartOSUpgradePollerResponse, error)` -- Function `*VirtualMachineScaleSetVMsClient.RetrieveBootDiagnosticsData` parameter(s) have been changed from `(context.Context, string, string, string, *VirtualMachineScaleSetVMsRetrieveBootDiagnosticsDataOptions)` to `(context.Context, string, string, string, *VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataOptions)` -- Function `*VirtualMachineScaleSetVMsClient.RetrieveBootDiagnosticsData` return value(s) have been changed from `(VirtualMachineScaleSetVMsRetrieveBootDiagnosticsDataResponse, error)` to `(VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataResponse, error)` -- Function `*UsageClient.List` parameter(s) have been changed from `(string, *UsageListOptions)` to `(string, *UsageClientListOptions)` -- Function `*UsageClient.List` return value(s) have been changed from `(*UsageListPager)` to `(*UsageClientListPager)` -- Function `*VirtualMachineImagesClient.ListPublishers` parameter(s) have been changed from `(context.Context, string, *VirtualMachineImagesListPublishersOptions)` to `(context.Context, string, *VirtualMachineImagesClientListPublishersOptions)` -- Function `*VirtualMachineImagesClient.ListPublishers` return value(s) have been changed from `(VirtualMachineImagesListPublishersResponse, error)` to `(VirtualMachineImagesClientListPublishersResponse, error)` -- Function `*DisksClient.BeginUpdate` parameter(s) have been changed from `(context.Context, string, string, DiskUpdate, *DisksBeginUpdateOptions)` to `(context.Context, string, string, DiskUpdate, *DisksClientBeginUpdateOptions)` -- Function `*DisksClient.BeginUpdate` return value(s) have been changed from `(DisksUpdatePollerResponse, error)` to `(DisksClientUpdatePollerResponse, error)` -- Function `*CloudServiceRoleInstancesClient.BeginRestart` parameter(s) have been changed from `(context.Context, string, string, string, *CloudServiceRoleInstancesBeginRestartOptions)` to `(context.Context, string, string, string, *CloudServiceRoleInstancesClientBeginRestartOptions)` -- Function `*CloudServiceRoleInstancesClient.BeginRestart` return value(s) have been changed from `(CloudServiceRoleInstancesRestartPollerResponse, error)` to `(CloudServiceRoleInstancesClientRestartPollerResponse, error)` -- Function `*DiskEncryptionSetsClient.ListByResourceGroup` parameter(s) have been changed from `(string, *DiskEncryptionSetsListByResourceGroupOptions)` to `(string, *DiskEncryptionSetsClientListByResourceGroupOptions)` -- Function `*DiskEncryptionSetsClient.ListByResourceGroup` return value(s) have been changed from `(*DiskEncryptionSetsListByResourceGroupPager)` to `(*DiskEncryptionSetsClientListByResourceGroupPager)` -- Function `*VirtualMachineScaleSetsClient.BeginRestart` parameter(s) have been changed from `(context.Context, string, string, *VirtualMachineScaleSetsBeginRestartOptions)` to `(context.Context, string, string, *VirtualMachineScaleSetsClientBeginRestartOptions)` -- Function `*VirtualMachineScaleSetsClient.BeginRestart` return value(s) have been changed from `(VirtualMachineScaleSetsRestartPollerResponse, error)` to `(VirtualMachineScaleSetsClientRestartPollerResponse, error)` -- Function `*VirtualMachinesClient.BeginCreateOrUpdate` parameter(s) have been changed from `(context.Context, string, string, VirtualMachine, *VirtualMachinesBeginCreateOrUpdateOptions)` to `(context.Context, string, string, VirtualMachine, *VirtualMachinesClientBeginCreateOrUpdateOptions)` -- Function `*VirtualMachinesClient.BeginCreateOrUpdate` return value(s) have been changed from `(VirtualMachinesCreateOrUpdatePollerResponse, error)` to `(VirtualMachinesClientCreateOrUpdatePollerResponse, error)` -- Function `*CapacityReservationGroupsClient.ListByResourceGroup` parameter(s) have been changed from `(string, *CapacityReservationGroupsListByResourceGroupOptions)` to `(string, *CapacityReservationGroupsClientListByResourceGroupOptions)` -- Function `*CapacityReservationGroupsClient.ListByResourceGroup` return value(s) have been changed from `(*CapacityReservationGroupsListByResourceGroupPager)` to `(*CapacityReservationGroupsClientListByResourceGroupPager)` -- Function `*GalleryImagesClient.Get` parameter(s) have been changed from `(context.Context, string, string, string, *GalleryImagesGetOptions)` to `(context.Context, string, string, string, *GalleryImagesClientGetOptions)` -- Function `*GalleryImagesClient.Get` return value(s) have been changed from `(GalleryImagesGetResponse, error)` to `(GalleryImagesClientGetResponse, error)` -- Function `*CloudServicesClient.List` parameter(s) have been changed from `(string, *CloudServicesListOptions)` to `(string, *CloudServicesClientListOptions)` -- Function `*CloudServicesClient.List` return value(s) have been changed from `(*CloudServicesListPager)` to `(*CloudServicesClientListPager)` -- Function `*CloudServiceRoleInstancesClient.Get` parameter(s) have been changed from `(context.Context, string, string, string, *CloudServiceRoleInstancesGetOptions)` to `(context.Context, string, string, string, *CloudServiceRoleInstancesClientGetOptions)` -- Function `*CloudServiceRoleInstancesClient.Get` return value(s) have been changed from `(CloudServiceRoleInstancesGetResponse, error)` to `(CloudServiceRoleInstancesClientGetResponse, error)` -- Function `*DiskAccessesClient.GetPrivateLinkResources` parameter(s) have been changed from `(context.Context, string, string, *DiskAccessesGetPrivateLinkResourcesOptions)` to `(context.Context, string, string, *DiskAccessesClientGetPrivateLinkResourcesOptions)` -- Function `*DiskAccessesClient.GetPrivateLinkResources` return value(s) have been changed from `(DiskAccessesGetPrivateLinkResourcesResponse, error)` to `(DiskAccessesClientGetPrivateLinkResourcesResponse, error)` -- Function `*VirtualMachineScaleSetsClient.BeginRedeploy` parameter(s) have been changed from `(context.Context, string, string, *VirtualMachineScaleSetsBeginRedeployOptions)` to `(context.Context, string, string, *VirtualMachineScaleSetsClientBeginRedeployOptions)` -- Function `*VirtualMachineScaleSetsClient.BeginRedeploy` return value(s) have been changed from `(VirtualMachineScaleSetsRedeployPollerResponse, error)` to `(VirtualMachineScaleSetsClientRedeployPollerResponse, error)` -- Function `*DedicatedHostGroupsClient.ListBySubscription` parameter(s) have been changed from `(*DedicatedHostGroupsListBySubscriptionOptions)` to `(*DedicatedHostGroupsClientListBySubscriptionOptions)` -- Function `*DedicatedHostGroupsClient.ListBySubscription` return value(s) have been changed from `(*DedicatedHostGroupsListBySubscriptionPager)` to `(*DedicatedHostGroupsClientListBySubscriptionPager)` -- Function `*ImagesClient.ListByResourceGroup` parameter(s) have been changed from `(string, *ImagesListByResourceGroupOptions)` to `(string, *ImagesClientListByResourceGroupOptions)` -- Function `*ImagesClient.ListByResourceGroup` return value(s) have been changed from `(*ImagesListByResourceGroupPager)` to `(*ImagesClientListByResourceGroupPager)` -- Function `*DiskRestorePointClient.BeginGrantAccess` parameter(s) have been changed from `(context.Context, string, string, string, string, GrantAccessData, *DiskRestorePointBeginGrantAccessOptions)` to `(context.Context, string, string, string, string, GrantAccessData, *DiskRestorePointClientBeginGrantAccessOptions)` -- Function `*DiskRestorePointClient.BeginGrantAccess` return value(s) have been changed from `(DiskRestorePointGrantAccessPollerResponse, error)` to `(DiskRestorePointClientGrantAccessPollerResponse, error)` -- Function `*VirtualMachineScaleSetsClient.BeginDeallocate` parameter(s) have been changed from `(context.Context, string, string, *VirtualMachineScaleSetsBeginDeallocateOptions)` to `(context.Context, string, string, *VirtualMachineScaleSetsClientBeginDeallocateOptions)` -- Function `*VirtualMachineScaleSetsClient.BeginDeallocate` return value(s) have been changed from `(VirtualMachineScaleSetsDeallocatePollerResponse, error)` to `(VirtualMachineScaleSetsClientDeallocatePollerResponse, error)` -- Function `*ImagesClient.Get` parameter(s) have been changed from `(context.Context, string, string, *ImagesGetOptions)` to `(context.Context, string, string, *ImagesClientGetOptions)` -- Function `*ImagesClient.Get` return value(s) have been changed from `(ImagesGetResponse, error)` to `(ImagesClientGetResponse, error)` -- Function `*DisksClient.BeginCreateOrUpdate` parameter(s) have been changed from `(context.Context, string, string, Disk, *DisksBeginCreateOrUpdateOptions)` to `(context.Context, string, string, Disk, *DisksClientBeginCreateOrUpdateOptions)` -- Function `*DisksClient.BeginCreateOrUpdate` return value(s) have been changed from `(DisksCreateOrUpdatePollerResponse, error)` to `(DisksClientCreateOrUpdatePollerResponse, error)` -- Function `*CloudServiceRoleInstancesClient.BeginRebuild` parameter(s) have been changed from `(context.Context, string, string, string, *CloudServiceRoleInstancesBeginRebuildOptions)` to `(context.Context, string, string, string, *CloudServiceRoleInstancesClientBeginRebuildOptions)` -- Function `*CloudServiceRoleInstancesClient.BeginRebuild` return value(s) have been changed from `(CloudServiceRoleInstancesRebuildPollerResponse, error)` to `(CloudServiceRoleInstancesClientRebuildPollerResponse, error)` -- Function `*CloudServicesClient.BeginStart` parameter(s) have been changed from `(context.Context, string, string, *CloudServicesBeginStartOptions)` to `(context.Context, string, string, *CloudServicesClientBeginStartOptions)` -- Function `*CloudServicesClient.BeginStart` return value(s) have been changed from `(CloudServicesStartPollerResponse, error)` to `(CloudServicesClientStartPollerResponse, error)` -- Function `*DedicatedHostGroupsClient.Delete` parameter(s) have been changed from `(context.Context, string, string, *DedicatedHostGroupsDeleteOptions)` to `(context.Context, string, string, *DedicatedHostGroupsClientDeleteOptions)` -- Function `*DedicatedHostGroupsClient.Delete` return value(s) have been changed from `(DedicatedHostGroupsDeleteResponse, error)` to `(DedicatedHostGroupsClientDeleteResponse, error)` -- Function `*DiskAccessesClient.ListPrivateEndpointConnections` parameter(s) have been changed from `(string, string, *DiskAccessesListPrivateEndpointConnectionsOptions)` to `(string, string, *DiskAccessesClientListPrivateEndpointConnectionsOptions)` -- Function `*DiskAccessesClient.ListPrivateEndpointConnections` return value(s) have been changed from `(*DiskAccessesListPrivateEndpointConnectionsPager)` to `(*DiskAccessesClientListPrivateEndpointConnectionsPager)` -- Function `*GalleryImageVersionsClient.BeginDelete` parameter(s) have been changed from `(context.Context, string, string, string, string, *GalleryImageVersionsBeginDeleteOptions)` to `(context.Context, string, string, string, string, *GalleryImageVersionsClientBeginDeleteOptions)` -- Function `*GalleryImageVersionsClient.BeginDelete` return value(s) have been changed from `(GalleryImageVersionsDeletePollerResponse, error)` to `(GalleryImageVersionsClientDeletePollerResponse, error)` -- Function `*CloudServicesClient.BeginPowerOff` parameter(s) have been changed from `(context.Context, string, string, *CloudServicesBeginPowerOffOptions)` to `(context.Context, string, string, *CloudServicesClientBeginPowerOffOptions)` -- Function `*CloudServicesClient.BeginPowerOff` return value(s) have been changed from `(CloudServicesPowerOffPollerResponse, error)` to `(CloudServicesClientPowerOffPollerResponse, error)` -- Function `*GalleryApplicationVersionsClient.BeginDelete` parameter(s) have been changed from `(context.Context, string, string, string, string, *GalleryApplicationVersionsBeginDeleteOptions)` to `(context.Context, string, string, string, string, *GalleryApplicationVersionsClientBeginDeleteOptions)` -- Function `*GalleryApplicationVersionsClient.BeginDelete` return value(s) have been changed from `(GalleryApplicationVersionsDeletePollerResponse, error)` to `(GalleryApplicationVersionsClientDeletePollerResponse, error)` -- Function `*CapacityReservationsClient.BeginCreateOrUpdate` parameter(s) have been changed from `(context.Context, string, string, string, CapacityReservation, *CapacityReservationsBeginCreateOrUpdateOptions)` to `(context.Context, string, string, string, CapacityReservation, *CapacityReservationsClientBeginCreateOrUpdateOptions)` -- Function `*CapacityReservationsClient.BeginCreateOrUpdate` return value(s) have been changed from `(CapacityReservationsCreateOrUpdatePollerResponse, error)` to `(CapacityReservationsClientCreateOrUpdatePollerResponse, error)` -- Function `*DisksClient.BeginDelete` parameter(s) have been changed from `(context.Context, string, string, *DisksBeginDeleteOptions)` to `(context.Context, string, string, *DisksClientBeginDeleteOptions)` -- Function `*DisksClient.BeginDelete` return value(s) have been changed from `(DisksDeletePollerResponse, error)` to `(DisksClientDeletePollerResponse, error)` -- Function `*AvailabilitySetsClient.Update` parameter(s) have been changed from `(context.Context, string, string, AvailabilitySetUpdate, *AvailabilitySetsUpdateOptions)` to `(context.Context, string, string, AvailabilitySetUpdate, *AvailabilitySetsClientUpdateOptions)` -- Function `*AvailabilitySetsClient.Update` return value(s) have been changed from `(AvailabilitySetsUpdateResponse, error)` to `(AvailabilitySetsClientUpdateResponse, error)` -- Function `*SharedGalleryImageVersionsClient.Get` parameter(s) have been changed from `(context.Context, string, string, string, string, *SharedGalleryImageVersionsGetOptions)` to `(context.Context, string, string, string, string, *SharedGalleryImageVersionsClientGetOptions)` -- Function `*SharedGalleryImageVersionsClient.Get` return value(s) have been changed from `(SharedGalleryImageVersionsGetResponse, error)` to `(SharedGalleryImageVersionsClientGetResponse, error)` -- Function `*VirtualMachineSizesClient.List` parameter(s) have been changed from `(context.Context, string, *VirtualMachineSizesListOptions)` to `(context.Context, string, *VirtualMachineSizesClientListOptions)` -- Function `*VirtualMachineSizesClient.List` return value(s) have been changed from `(VirtualMachineSizesListResponse, error)` to `(VirtualMachineSizesClientListResponse, error)` -- Function `*VirtualMachineScaleSetsClient.BeginDelete` parameter(s) have been changed from `(context.Context, string, string, *VirtualMachineScaleSetsBeginDeleteOptions)` to `(context.Context, string, string, *VirtualMachineScaleSetsClientBeginDeleteOptions)` -- Function `*VirtualMachineScaleSetsClient.BeginDelete` return value(s) have been changed from `(VirtualMachineScaleSetsDeletePollerResponse, error)` to `(VirtualMachineScaleSetsClientDeletePollerResponse, error)` -- Function `*VirtualMachineRunCommandsClient.List` parameter(s) have been changed from `(string, *VirtualMachineRunCommandsListOptions)` to `(string, *VirtualMachineRunCommandsClientListOptions)` -- Function `*VirtualMachineRunCommandsClient.List` return value(s) have been changed from `(*VirtualMachineRunCommandsListPager)` to `(*VirtualMachineRunCommandsClientListPager)` -- Function `*VirtualMachineRunCommandsClient.BeginCreateOrUpdate` parameter(s) have been changed from `(context.Context, string, string, string, VirtualMachineRunCommand, *VirtualMachineRunCommandsBeginCreateOrUpdateOptions)` to `(context.Context, string, string, string, VirtualMachineRunCommand, *VirtualMachineRunCommandsClientBeginCreateOrUpdateOptions)` -- Function `*VirtualMachineRunCommandsClient.BeginCreateOrUpdate` return value(s) have been changed from `(VirtualMachineRunCommandsCreateOrUpdatePollerResponse, error)` to `(VirtualMachineRunCommandsClientCreateOrUpdatePollerResponse, error)` -- Function `*SSHPublicKeysClient.Update` parameter(s) have been changed from `(context.Context, string, string, SSHPublicKeyUpdateResource, *SSHPublicKeysUpdateOptions)` to `(context.Context, string, string, SSHPublicKeyUpdateResource, *SSHPublicKeysClientUpdateOptions)` -- Function `*SSHPublicKeysClient.Update` return value(s) have been changed from `(SSHPublicKeysUpdateResponse, error)` to `(SSHPublicKeysClientUpdateResponse, error)` -- Function `*VirtualMachineScaleSetsClient.BeginSetOrchestrationServiceState` parameter(s) have been changed from `(context.Context, string, string, OrchestrationServiceStateInput, *VirtualMachineScaleSetsBeginSetOrchestrationServiceStateOptions)` to `(context.Context, string, string, OrchestrationServiceStateInput, *VirtualMachineScaleSetsClientBeginSetOrchestrationServiceStateOptions)` -- Function `*VirtualMachineScaleSetsClient.BeginSetOrchestrationServiceState` return value(s) have been changed from `(VirtualMachineScaleSetsSetOrchestrationServiceStatePollerResponse, error)` to `(VirtualMachineScaleSetsClientSetOrchestrationServiceStatePollerResponse, error)` -- Function `*VirtualMachineScaleSetVMsClient.BeginPowerOff` parameter(s) have been changed from `(context.Context, string, string, string, *VirtualMachineScaleSetVMsBeginPowerOffOptions)` to `(context.Context, string, string, string, *VirtualMachineScaleSetVMsClientBeginPowerOffOptions)` -- Function `*VirtualMachineScaleSetVMsClient.BeginPowerOff` return value(s) have been changed from `(VirtualMachineScaleSetVMsPowerOffPollerResponse, error)` to `(VirtualMachineScaleSetVMsClientPowerOffPollerResponse, error)` -- Function `*AvailabilitySetsClient.CreateOrUpdate` parameter(s) have been changed from `(context.Context, string, string, AvailabilitySet, *AvailabilitySetsCreateOrUpdateOptions)` to `(context.Context, string, string, AvailabilitySet, *AvailabilitySetsClientCreateOrUpdateOptions)` -- Function `*AvailabilitySetsClient.CreateOrUpdate` return value(s) have been changed from `(AvailabilitySetsCreateOrUpdateResponse, error)` to `(AvailabilitySetsClientCreateOrUpdateResponse, error)` -- Function `*CloudServiceRoleInstancesClient.GetRemoteDesktopFile` parameter(s) have been changed from `(context.Context, string, string, string, *CloudServiceRoleInstancesGetRemoteDesktopFileOptions)` to `(context.Context, string, string, string, *CloudServiceRoleInstancesClientGetRemoteDesktopFileOptions)` -- Function `*CloudServiceRoleInstancesClient.GetRemoteDesktopFile` return value(s) have been changed from `(CloudServiceRoleInstancesGetRemoteDesktopFileResponse, error)` to `(CloudServiceRoleInstancesClientGetRemoteDesktopFileResponse, error)` -- Function `*CloudServicesUpdateDomainClient.GetUpdateDomain` parameter(s) have been changed from `(context.Context, string, string, int32, *CloudServicesUpdateDomainGetUpdateDomainOptions)` to `(context.Context, string, string, int32, *CloudServicesUpdateDomainClientGetUpdateDomainOptions)` -- Function `*CloudServicesUpdateDomainClient.GetUpdateDomain` return value(s) have been changed from `(CloudServicesUpdateDomainGetUpdateDomainResponse, error)` to `(CloudServicesUpdateDomainClientGetUpdateDomainResponse, error)` -- Function `*RestorePointCollectionsClient.List` parameter(s) have been changed from `(string, *RestorePointCollectionsListOptions)` to `(string, *RestorePointCollectionsClientListOptions)` -- Function `*RestorePointCollectionsClient.List` return value(s) have been changed from `(*RestorePointCollectionsListPager)` to `(*RestorePointCollectionsClientListPager)` -- Function `*CloudServicesClient.BeginRebuild` parameter(s) have been changed from `(context.Context, string, string, *CloudServicesBeginRebuildOptions)` to `(context.Context, string, string, *CloudServicesClientBeginRebuildOptions)` -- Function `*CloudServicesClient.BeginRebuild` return value(s) have been changed from `(CloudServicesRebuildPollerResponse, error)` to `(CloudServicesClientRebuildPollerResponse, error)` -- Function `*VirtualMachineScaleSetExtensionsClient.BeginUpdate` parameter(s) have been changed from `(context.Context, string, string, string, VirtualMachineScaleSetExtensionUpdate, *VirtualMachineScaleSetExtensionsBeginUpdateOptions)` to `(context.Context, string, string, string, VirtualMachineScaleSetExtensionUpdate, *VirtualMachineScaleSetExtensionsClientBeginUpdateOptions)` -- Function `*VirtualMachineScaleSetExtensionsClient.BeginUpdate` return value(s) have been changed from `(VirtualMachineScaleSetExtensionsUpdatePollerResponse, error)` to `(VirtualMachineScaleSetExtensionsClientUpdatePollerResponse, error)` -- Function `*VirtualMachinesClient.RetrieveBootDiagnosticsData` parameter(s) have been changed from `(context.Context, string, string, *VirtualMachinesRetrieveBootDiagnosticsDataOptions)` to `(context.Context, string, string, *VirtualMachinesClientRetrieveBootDiagnosticsDataOptions)` -- Function `*VirtualMachinesClient.RetrieveBootDiagnosticsData` return value(s) have been changed from `(VirtualMachinesRetrieveBootDiagnosticsDataResponse, error)` to `(VirtualMachinesClientRetrieveBootDiagnosticsDataResponse, error)` -- Function `*DiskAccessesClient.BeginDelete` parameter(s) have been changed from `(context.Context, string, string, *DiskAccessesBeginDeleteOptions)` to `(context.Context, string, string, *DiskAccessesClientBeginDeleteOptions)` -- Function `*DiskAccessesClient.BeginDelete` return value(s) have been changed from `(DiskAccessesDeletePollerResponse, error)` to `(DiskAccessesClientDeletePollerResponse, error)` -- Function `*VirtualMachinesClient.BeginConvertToManagedDisks` parameter(s) have been changed from `(context.Context, string, string, *VirtualMachinesBeginConvertToManagedDisksOptions)` to `(context.Context, string, string, *VirtualMachinesClientBeginConvertToManagedDisksOptions)` -- Function `*VirtualMachinesClient.BeginConvertToManagedDisks` return value(s) have been changed from `(VirtualMachinesConvertToManagedDisksPollerResponse, error)` to `(VirtualMachinesClientConvertToManagedDisksPollerResponse, error)` -- Function `*SSHPublicKeysClient.Get` parameter(s) have been changed from `(context.Context, string, string, *SSHPublicKeysGetOptions)` to `(context.Context, string, string, *SSHPublicKeysClientGetOptions)` -- Function `*SSHPublicKeysClient.Get` return value(s) have been changed from `(SSHPublicKeysGetResponse, error)` to `(SSHPublicKeysClientGetResponse, error)` -- Function `*DisksClient.Get` parameter(s) have been changed from `(context.Context, string, string, *DisksGetOptions)` to `(context.Context, string, string, *DisksClientGetOptions)` -- Function `*DisksClient.Get` return value(s) have been changed from `(DisksGetResponse, error)` to `(DisksClientGetResponse, error)` -- Function `*VirtualMachineImagesClient.List` parameter(s) have been changed from `(context.Context, string, string, string, string, *VirtualMachineImagesListOptions)` to `(context.Context, string, string, string, string, *VirtualMachineImagesClientListOptions)` -- Function `*VirtualMachineImagesClient.List` return value(s) have been changed from `(VirtualMachineImagesListResponse, error)` to `(VirtualMachineImagesClientListResponse, error)` -- Function `*SharedGalleryImagesClient.List` parameter(s) have been changed from `(string, string, *SharedGalleryImagesListOptions)` to `(string, string, *SharedGalleryImagesClientListOptions)` -- Function `*SharedGalleryImagesClient.List` return value(s) have been changed from `(*SharedGalleryImagesListPager)` to `(*SharedGalleryImagesClientListPager)` -- Function `*VirtualMachineRunCommandsClient.BeginUpdate` parameter(s) have been changed from `(context.Context, string, string, string, VirtualMachineRunCommandUpdate, *VirtualMachineRunCommandsBeginUpdateOptions)` to `(context.Context, string, string, string, VirtualMachineRunCommandUpdate, *VirtualMachineRunCommandsClientBeginUpdateOptions)` -- Function `*VirtualMachineRunCommandsClient.BeginUpdate` return value(s) have been changed from `(VirtualMachineRunCommandsUpdatePollerResponse, error)` to `(VirtualMachineRunCommandsClientUpdatePollerResponse, error)` -- Function `*VirtualMachineScaleSetVMsClient.BeginDeallocate` parameter(s) have been changed from `(context.Context, string, string, string, *VirtualMachineScaleSetVMsBeginDeallocateOptions)` to `(context.Context, string, string, string, *VirtualMachineScaleSetVMsClientBeginDeallocateOptions)` -- Function `*VirtualMachineScaleSetVMsClient.BeginDeallocate` return value(s) have been changed from `(VirtualMachineScaleSetVMsDeallocatePollerResponse, error)` to `(VirtualMachineScaleSetVMsClientDeallocatePollerResponse, error)` -- Function `*DiskAccessesClient.List` parameter(s) have been changed from `(*DiskAccessesListOptions)` to `(*DiskAccessesClientListOptions)` -- Function `*DiskAccessesClient.List` return value(s) have been changed from `(*DiskAccessesListPager)` to `(*DiskAccessesClientListPager)` -- Function `*CloudServiceRoleInstancesClient.List` parameter(s) have been changed from `(string, string, *CloudServiceRoleInstancesListOptions)` to `(string, string, *CloudServiceRoleInstancesClientListOptions)` -- Function `*CloudServiceRoleInstancesClient.List` return value(s) have been changed from `(*CloudServiceRoleInstancesListPager)` to `(*CloudServiceRoleInstancesClientListPager)` -- Function `*RestorePointCollectionsClient.Update` parameter(s) have been changed from `(context.Context, string, string, RestorePointCollectionUpdate, *RestorePointCollectionsUpdateOptions)` to `(context.Context, string, string, RestorePointCollectionUpdate, *RestorePointCollectionsClientUpdateOptions)` -- Function `*RestorePointCollectionsClient.Update` return value(s) have been changed from `(RestorePointCollectionsUpdateResponse, error)` to `(RestorePointCollectionsClientUpdateResponse, error)` -- Function `*GalleriesClient.BeginUpdate` parameter(s) have been changed from `(context.Context, string, string, GalleryUpdate, *GalleriesBeginUpdateOptions)` to `(context.Context, string, string, GalleryUpdate, *GalleriesClientBeginUpdateOptions)` -- Function `*GalleriesClient.BeginUpdate` return value(s) have been changed from `(GalleriesUpdatePollerResponse, error)` to `(GalleriesClientUpdatePollerResponse, error)` -- Function `*GalleryImageVersionsClient.ListByGalleryImage` parameter(s) have been changed from `(string, string, string, *GalleryImageVersionsListByGalleryImageOptions)` to `(string, string, string, *GalleryImageVersionsClientListByGalleryImageOptions)` -- Function `*GalleryImageVersionsClient.ListByGalleryImage` return value(s) have been changed from `(*GalleryImageVersionsListByGalleryImagePager)` to `(*GalleryImageVersionsClientListByGalleryImagePager)` -- Function `*VirtualMachineScaleSetExtensionsClient.BeginDelete` parameter(s) have been changed from `(context.Context, string, string, string, *VirtualMachineScaleSetExtensionsBeginDeleteOptions)` to `(context.Context, string, string, string, *VirtualMachineScaleSetExtensionsClientBeginDeleteOptions)` -- Function `*VirtualMachineScaleSetExtensionsClient.BeginDelete` return value(s) have been changed from `(VirtualMachineScaleSetExtensionsDeletePollerResponse, error)` to `(VirtualMachineScaleSetExtensionsClientDeletePollerResponse, error)` -- Function `*VirtualMachineScaleSetVMsClient.BeginUpdate` parameter(s) have been changed from `(context.Context, string, string, string, VirtualMachineScaleSetVM, *VirtualMachineScaleSetVMsBeginUpdateOptions)` to `(context.Context, string, string, string, VirtualMachineScaleSetVM, *VirtualMachineScaleSetVMsClientBeginUpdateOptions)` -- Function `*VirtualMachineScaleSetVMsClient.BeginUpdate` return value(s) have been changed from `(VirtualMachineScaleSetVMsUpdatePollerResponse, error)` to `(VirtualMachineScaleSetVMsClientUpdatePollerResponse, error)` -- Function `*VirtualMachineImagesEdgeZoneClient.ListSKUs` parameter(s) have been changed from `(context.Context, string, string, string, string, *VirtualMachineImagesEdgeZoneListSKUsOptions)` to `(context.Context, string, string, string, string, *VirtualMachineImagesEdgeZoneClientListSKUsOptions)` -- Function `*VirtualMachineImagesEdgeZoneClient.ListSKUs` return value(s) have been changed from `(VirtualMachineImagesEdgeZoneListSKUsResponse, error)` to `(VirtualMachineImagesEdgeZoneClientListSKUsResponse, error)` -- Function `VirtualMachinesPerformMaintenancePollerResponse.PollUntilDone` has been removed -- Function `*CapacityReservationsUpdatePoller.FinalResponse` has been removed -- Function `*VirtualMachineScaleSetVMsReimageAllPoller.Poll` has been removed -- Function `*DedicatedHostsUpdatePollerResponse.Resume` has been removed -- Function `*VirtualMachinesListPager.Err` has been removed -- Function `VirtualMachineScaleSetExtensionsCreateOrUpdatePollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachinesDeletePollerResponse.Resume` has been removed -- Function `*CloudServiceRoleInstancesReimagePoller.ResumeToken` has been removed -- Function `*SnapshotsUpdatePoller.ResumeToken` has been removed -- Function `VirtualMachineScaleSetsRestartPollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachinesConvertToManagedDisksPoller.Poll` has been removed -- Function `*GalleryImageVersionsListByGalleryImagePager.PageResponse` has been removed -- Function `VirtualMachineScaleSetVMExtensionsDeletePollerResponse.PollUntilDone` has been removed -- Function `*RestorePointCollectionsListPager.PageResponse` has been removed -- Function `*DedicatedHostsDeletePollerResponse.Resume` has been removed -- Function `*ImagesListPager.Err` has been removed -- Function `*VirtualMachinesReimagePoller.Poll` has been removed -- Function `*DedicatedHostsCreateOrUpdatePoller.Done` has been removed -- Function `VirtualMachinesReimagePollerResponse.PollUntilDone` has been removed -- Function `*CloudServicesReimagePoller.FinalResponse` has been removed -- Function `*CloudServicesRebuildPoller.Poll` has been removed -- Function `*VirtualMachineScaleSetsCreateOrUpdatePoller.ResumeToken` has been removed -- Function `*VirtualMachineScaleSetsRestartPollerResponse.Resume` has been removed -- Function `*VirtualMachineScaleSetVMsStartPoller.ResumeToken` has been removed -- Function `*VirtualMachineScaleSetsDeletePoller.Poll` has been removed -- Function `*VirtualMachinesListAllPager.PageResponse` has been removed -- Function `*VirtualMachineExtensionsCreateOrUpdatePoller.ResumeToken` has been removed -- Function `*VirtualMachineExtensionsUpdatePollerResponse.Resume` has been removed -- Function `*VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradePoller.Poll` has been removed -- Function `VirtualMachinesAssessPatchesPollerResponse.PollUntilDone` has been removed -- Function `*DiskAccessesUpdateAPrivateEndpointConnectionPoller.Done` has been removed -- Function `*VirtualMachineRunCommandsDeletePollerResponse.Resume` has been removed -- Function `ImagesUpdatePollerResponse.PollUntilDone` has been removed -- Function `*AvailabilitySetsListPager.PageResponse` has been removed -- Function `*GalleryApplicationVersionsUpdatePoller.ResumeToken` has been removed -- Function `*AvailabilitySetsListBySubscriptionPager.Err` has been removed -- Function `*VirtualMachineScaleSetsListByLocationPager.NextPage` has been removed -- Function `*CloudServicesRestartPoller.FinalResponse` has been removed -- Function `*VirtualMachineScaleSetsListAllPager.NextPage` has been removed -- Function `*VirtualMachineScaleSetsDeletePoller.ResumeToken` has been removed -- Function `*GalleryImageVersionsDeletePoller.Poll` has been removed -- Function `*VirtualMachineScaleSetRollingUpgradesStartOSUpgradePollerResponse.Resume` has been removed -- Function `*GalleriesUpdatePollerResponse.Resume` has been removed -- Function `*VirtualMachineScaleSetVMRunCommandsCreateOrUpdatePoller.Done` has been removed -- Function `*VirtualMachineRunCommandsUpdatePoller.ResumeToken` has been removed -- Function `*VirtualMachineScaleSetVMExtensionsCreateOrUpdatePoller.Poll` has been removed -- Function `*VirtualMachineScaleSetVMExtensionsUpdatePollerResponse.Resume` has been removed -- Function `*CapacityReservationGroupsListBySubscriptionPager.PageResponse` has been removed -- Function `VirtualMachineScaleSetsStartPollerResponse.PollUntilDone` has been removed -- Function `*SnapshotsListPager.NextPage` has been removed -- Function `VirtualMachineScaleSetRollingUpgradesStartOSUpgradePollerResponse.PollUntilDone` has been removed -- Function `GalleryApplicationVersionsCreateOrUpdatePollerResponse.PollUntilDone` has been removed -- Function `*CloudServicesReimagePoller.Done` has been removed -- Function `*CloudServicesCreateOrUpdatePoller.FinalResponse` has been removed -- Function `*CloudServicesRebuildPoller.FinalResponse` has been removed -- Function `*VirtualMachineExtensionsCreateOrUpdatePollerResponse.Resume` has been removed -- Function `*VirtualMachineScaleSetVMRunCommandsCreateOrUpdatePoller.ResumeToken` has been removed -- Function `*VirtualMachineScaleSetExtensionsListPager.NextPage` has been removed -- Function `*RestorePointsCreatePoller.ResumeToken` has been removed -- Function `*GalleryImagesUpdatePoller.Done` has been removed -- Function `*DisksGrantAccessPollerResponse.Resume` has been removed -- Function `*CloudServicesUpdateDomainWalkUpdateDomainPoller.ResumeToken` has been removed -- Function `*ImagesCreateOrUpdatePoller.FinalResponse` has been removed -- Function `*VirtualMachineScaleSetVMRunCommandsUpdatePoller.ResumeToken` has been removed -- Function `*RestorePointCollectionsListAllPager.Err` has been removed -- Function `*VirtualMachineScaleSetsSetOrchestrationServiceStatePoller.ResumeToken` has been removed -- Function `*DiskAccessesUpdatePollerResponse.Resume` has been removed -- Function `*VirtualMachinesStartPoller.FinalResponse` has been removed -- Function `*ImagesUpdatePoller.FinalResponse` has been removed -- Function `*GalleriesUpdatePoller.FinalResponse` has been removed -- Function `*SharedGalleryImageVersionsListPager.NextPage` has been removed -- Function `*SnapshotsListPager.PageResponse` has been removed -- Function `*GalleryImagesUpdatePoller.Poll` has been removed -- Function `*VirtualMachineRunCommandsListByVirtualMachinePager.Err` has been removed -- Function `*VirtualMachineScaleSetsCreateOrUpdatePoller.Poll` has been removed -- Function `*CloudServicesDeletePoller.ResumeToken` has been removed -- Function `*VirtualMachineScaleSetsCreateOrUpdatePoller.FinalResponse` has been removed -- Function `*GalleryImageVersionsCreateOrUpdatePoller.Done` has been removed -- Function `*VirtualMachinesRestartPoller.ResumeToken` has been removed -- Function `*GalleryApplicationVersionsDeletePoller.FinalResponse` has been removed -- Function `*RestorePointCollectionsListAllPager.PageResponse` has been removed -- Function `*CloudServiceRoleInstancesRestartPoller.ResumeToken` has been removed -- Function `*CloudServiceRoleInstancesRestartPollerResponse.Resume` has been removed -- Function `VirtualMachineScaleSetVMsDeallocatePollerResponse.PollUntilDone` has been removed -- Function `*DedicatedHostsUpdatePoller.Done` has been removed -- Function `*VirtualMachineScaleSetsListAllPager.PageResponse` has been removed -- Function `*DiskAccessesListPrivateEndpointConnectionsPager.PageResponse` has been removed -- Function `*VirtualMachinesCreateOrUpdatePollerResponse.Resume` has been removed -- Function `*ResourceSKUsListPager.PageResponse` has been removed -- Function `*CloudServiceRoleInstancesRebuildPoller.ResumeToken` has been removed -- Function `*GalleryImagesListByGalleryPager.Err` has been removed -- Function `*DedicatedHostGroupsListByResourceGroupPager.Err` has been removed -- Function `*SnapshotsListByResourceGroupPager.NextPage` has been removed -- Function `CloudError.Error` has been removed -- Function `VirtualMachineScaleSetUpdateNetworkConfiguration.MarshalJSON` has been removed -- Function `*CloudServicesDeleteInstancesPoller.FinalResponse` has been removed -- Function `*VirtualMachineScaleSetExtensionsUpdatePoller.Done` has been removed -- Function `*ImagesDeletePoller.ResumeToken` has been removed -- Function `*DiskAccessesCreateOrUpdatePoller.Done` has been removed -- Function `*VirtualMachinesListAllPager.Err` has been removed -- Function `VirtualMachinesStartPollerResponse.PollUntilDone` has been removed -- Function `*DiskAccessesUpdateAPrivateEndpointConnectionPoller.Poll` has been removed -- Function `*CloudServicesUpdateDomainWalkUpdateDomainPoller.Poll` has been removed -- Function `*VirtualMachineScaleSetVMsDeletePoller.FinalResponse` has been removed -- Function `VirtualMachineScaleSetsPowerOffPollerResponse.PollUntilDone` has been removed -- Function `VirtualMachineScaleSetUpdateIPConfiguration.MarshalJSON` has been removed -- Function `*VirtualMachineExtensionsUpdatePoller.Done` has been removed -- Function `*VirtualMachineRunCommandsDeletePoller.ResumeToken` has been removed -- Function `VirtualMachinesDeletePollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachineScaleSetsPowerOffPollerResponse.Resume` has been removed -- Function `*SnapshotsDeletePoller.Done` has been removed -- Function `VirtualMachineScaleSetNetworkConfiguration.MarshalJSON` has been removed -- Function `*CapacityReservationsUpdatePoller.ResumeToken` has been removed -- Function `*DedicatedHostsUpdatePoller.Poll` has been removed -- Function `*CapacityReservationsUpdatePoller.Poll` has been removed -- Function `*DiskEncryptionSetsCreateOrUpdatePoller.Done` has been removed -- Function `*DiskRestorePointListByRestorePointPager.Err` has been removed -- Function `VirtualMachineScaleSetsDeleteInstancesPollerResponse.PollUntilDone` has been removed -- Function `*GalleriesUpdatePoller.Poll` has been removed -- Function `VirtualMachineRunCommandsDeletePollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachinesDeallocatePoller.FinalResponse` has been removed -- Function `*GalleriesUpdatePoller.Done` has been removed -- Function `VirtualMachineScaleSetVMExtensionsUpdatePollerResponse.PollUntilDone` has been removed -- Function `CloudServiceRoleInstancesRestartPollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachineRunCommandsCreateOrUpdatePoller.Done` has been removed -- Function `*CapacityReservationsDeletePoller.Poll` has been removed -- Function `*GalleriesListPager.NextPage` has been removed -- Function `*DiskEncryptionSetsDeletePollerResponse.Resume` has been removed -- Function `*VirtualMachineRunCommandsDeletePoller.Done` has been removed -- Function `*VirtualMachinesPowerOffPoller.Poll` has been removed -- Function `*GalleryImagesCreateOrUpdatePoller.FinalResponse` has been removed -- Function `*VirtualMachineScaleSetVMRunCommandsCreateOrUpdatePoller.Poll` has been removed -- Function `*VirtualMachinesCreateOrUpdatePoller.Poll` has been removed -- Function `*ImagesDeletePoller.Poll` has been removed -- Function `*VirtualMachinesUpdatePoller.Poll` has been removed -- Function `*GalleryApplicationsDeletePoller.FinalResponse` has been removed -- Function `*VirtualMachineScaleSetsGetOSUpgradeHistoryPager.PageResponse` has been removed -- Function `*SharedGalleryImagesListPager.PageResponse` has been removed -- Function `*GalleryImagesUpdatePoller.ResumeToken` has been removed -- Function `*VirtualMachineScaleSetExtensionsUpdatePollerResponse.Resume` has been removed -- Function `*VirtualMachineScaleSetsReimageAllPollerResponse.Resume` has been removed -- Function `*CloudServiceRoleInstancesDeletePoller.Done` has been removed -- Function `CloudServicesPowerOffPollerResponse.PollUntilDone` has been removed -- Function `*CloudServicesReimagePoller.ResumeToken` has been removed -- Function `*CloudServicesUpdateDomainListUpdateDomainsPager.NextPage` has been removed -- Function `*DedicatedHostsUpdatePoller.FinalResponse` has been removed -- Function `ManagedDiskParameters.MarshalJSON` has been removed -- Function `VirtualMachineScaleSetVMsPowerOffPollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachinesRedeployPollerResponse.Resume` has been removed -- Function `*DiskAccessesUpdateAPrivateEndpointConnectionPollerResponse.Resume` has been removed -- Function `VirtualMachinesInstallPatchesPollerResponse.PollUntilDone` has been removed -- Function `*DiskEncryptionSetsCreateOrUpdatePoller.FinalResponse` has been removed -- Function `*VirtualMachinesCapturePollerResponse.Resume` has been removed -- Function `*DiskAccessesListPrivateEndpointConnectionsPager.Err` has been removed -- Function `*DiskAccessesDeletePoller.FinalResponse` has been removed -- Function `*VirtualMachineScaleSetExtensionsCreateOrUpdatePoller.Poll` has been removed -- Function `*VirtualMachineScaleSetsListSKUsPager.PageResponse` has been removed -- Function `VirtualMachineScaleSetsPerformMaintenancePollerResponse.PollUntilDone` has been removed -- Function `*CloudServicesDeletePollerResponse.Resume` has been removed -- Function `*CloudServicesListAllPager.NextPage` has been removed -- Function `*VirtualMachinesUpdatePoller.FinalResponse` has been removed -- Function `*DisksUpdatePoller.ResumeToken` has been removed -- Function `*VirtualMachineScaleSetVMsPowerOffPoller.ResumeToken` has been removed -- Function `*DedicatedHostsDeletePoller.Poll` has been removed -- Function `CapacityReservationsUpdatePollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachineScaleSetVMExtensionsUpdatePoller.ResumeToken` has been removed -- Function `*CloudServiceOperatingSystemsListOSFamiliesPager.Err` has been removed -- Function `*VirtualMachineScaleSetsRedeployPoller.ResumeToken` has been removed -- Function `*VirtualMachineScaleSetsDeletePoller.Done` has been removed -- Function `*LogAnalyticsExportThrottledRequestsPollerResponse.Resume` has been removed -- Function `*VirtualMachineScaleSetVMsRunCommandPoller.FinalResponse` has been removed -- Function `*VirtualMachinesRunCommandPollerResponse.Resume` has been removed -- Function `*ImagesListByResourceGroupPager.Err` has been removed -- Function `*DisksGrantAccessPoller.ResumeToken` has been removed -- Function `*DisksCreateOrUpdatePoller.FinalResponse` has been removed -- Function `*VirtualMachineExtensionsDeletePoller.FinalResponse` has been removed -- Function `*DiskEncryptionSetsListAssociatedResourcesPager.PageResponse` has been removed -- Function `*VirtualMachinesAssessPatchesPoller.ResumeToken` has been removed -- Function `*GalleryImageVersionsCreateOrUpdatePoller.Poll` has been removed -- Function `*DiskEncryptionSetsUpdatePollerResponse.Resume` has been removed -- Function `*VirtualMachineScaleSetVMsUpdatePollerResponse.Resume` has been removed -- Function `*DiskAccessesUpdatePoller.FinalResponse` has been removed -- Function `*DiskAccessesDeletePoller.Poll` has been removed -- Function `*VirtualMachineScaleSetVMsRestartPoller.Poll` has been removed -- Function `*CloudServicesDeleteInstancesPoller.ResumeToken` has been removed -- Function `CapacityReservationsDeletePollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachineScaleSetsGetOSUpgradeHistoryPager.NextPage` has been removed -- Function `*CloudServicesCreateOrUpdatePoller.ResumeToken` has been removed -- Function `LogAnalyticsExportThrottledRequestsPollerResponse.PollUntilDone` has been removed -- Function `*GalleriesCreateOrUpdatePoller.FinalResponse` has been removed -- Function `DiskAccessesCreateOrUpdatePollerResponse.PollUntilDone` has been removed -- Function `*CloudServicesDeletePoller.Done` has been removed -- Function `*VirtualMachineScaleSetsUpdateInstancesPoller.ResumeToken` has been removed -- Function `*VirtualMachineScaleSetVMsPowerOffPoller.Poll` has been removed -- Function `*DisksCreateOrUpdatePoller.Done` has been removed -- Function `*DisksUpdatePoller.Poll` has been removed -- Function `*RestorePointsDeletePoller.FinalResponse` has been removed -- Function `*CloudServicesStartPoller.ResumeToken` has been removed -- Function `*VirtualMachinesReapplyPoller.Poll` has been removed -- Function `*VirtualMachineScaleSetVMsReimagePoller.ResumeToken` has been removed -- Function `*CloudServicesUpdateDomainListUpdateDomainsPager.PageResponse` has been removed -- Function `*VirtualMachineScaleSetsUpdatePoller.Done` has been removed -- Function `*VirtualMachineScaleSetsDeletePoller.FinalResponse` has been removed -- Function `*VirtualMachinesRedeployPoller.ResumeToken` has been removed -- Function `*VirtualMachinesRedeployPoller.Done` has been removed -- Function `GalleryApplicationsDeletePollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachineScaleSetVMRunCommandsUpdatePoller.Poll` has been removed -- Function `DisksDeletePollerResponse.PollUntilDone` has been removed -- Function `*SnapshotsDeletePoller.ResumeToken` has been removed -- Function `*DisksListByResourceGroupPager.Err` has been removed -- Function `*VirtualMachinesConvertToManagedDisksPoller.ResumeToken` has been removed -- Function `*CloudServicesCreateOrUpdatePoller.Done` has been removed -- Function `*DisksCreateOrUpdatePoller.Poll` has been removed -- Function `*VirtualMachineScaleSetVMsPowerOffPollerResponse.Resume` has been removed -- Function `*VirtualMachineScaleSetsPowerOffPoller.FinalResponse` has been removed -- Function `GalleriesCreateOrUpdatePollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachineScaleSetVMRunCommandsUpdatePoller.Done` has been removed -- Function `*ImagesListByResourceGroupPager.NextPage` has been removed -- Function `*VirtualMachinesStartPoller.ResumeToken` has been removed -- Function `*VirtualMachineRunCommandsListByVirtualMachinePager.NextPage` has been removed -- Function `*DisksDeletePoller.FinalResponse` has been removed -- Function `*VirtualMachineScaleSetExtensionsDeletePollerResponse.Resume` has been removed -- Function `*VirtualMachineScaleSetVMsDeallocatePoller.Poll` has been removed -- Function `*VirtualMachinesCapturePoller.FinalResponse` has been removed -- Function `*CloudServiceRoleInstancesDeletePollerResponse.Resume` has been removed -- Function `*VirtualMachinesListByLocationPager.Err` has been removed -- Function `*CloudServiceOperatingSystemsListOSVersionsPager.PageResponse` has been removed -- Function `*SharedGalleryImageVersionsListPager.Err` has been removed -- Function `VirtualMachineScaleSetVMExtension.MarshalJSON` has been removed -- Function `*VirtualMachineScaleSetsSetOrchestrationServiceStatePoller.Done` has been removed -- Function `*GalleryApplicationVersionsListByGalleryApplicationPager.PageResponse` has been removed -- Function `*VirtualMachineScaleSetsReimagePoller.FinalResponse` has been removed -- Function `*VirtualMachineScaleSetVMsReimagePoller.Done` has been removed -- Function `*AvailabilitySetsListPager.Err` has been removed -- Function `VirtualMachineScaleSetVMRunCommandsDeletePollerResponse.PollUntilDone` has been removed -- Function `*DisksDeletePoller.Done` has been removed -- Function `VirtualMachineScaleSetExtensionsDeletePollerResponse.PollUntilDone` has been removed -- Function `*CloudServicesRestartPoller.Poll` has been removed -- Function `*VirtualMachineScaleSetExtensionsUpdatePoller.FinalResponse` has been removed -- Function `*VirtualMachineScaleSetVMsReimageAllPoller.Done` has been removed -- Function `NetworkInterfaceReference.MarshalJSON` has been removed -- Function `*CloudServicesDeletePoller.FinalResponse` has been removed -- Function `*DiskEncryptionSetsUpdatePoller.Poll` has been removed -- Function `*VirtualMachinesConvertToManagedDisksPollerResponse.Resume` has been removed -- Function `*VirtualMachineScaleSetExtensionsDeletePoller.Done` has been removed -- Function `GalleryApplicationsUpdatePollerResponse.PollUntilDone` has been removed -- Function `*DisksCreateOrUpdatePollerResponse.Resume` has been removed -- Function `*AvailabilitySetsListBySubscriptionPager.PageResponse` has been removed -- Function `*DiskEncryptionSetsListPager.PageResponse` has been removed -- Function `*VirtualMachineScaleSetVMsReimagePoller.Poll` has been removed -- Function `*VirtualMachineRunCommandsDeletePoller.Poll` has been removed -- Function `*DiskRestorePointListByRestorePointPager.PageResponse` has been removed -- Function `*VirtualMachineExtensionsCreateOrUpdatePoller.Done` has been removed -- Function `*CapacityReservationsCreateOrUpdatePollerResponse.Resume` has been removed -- Function `*VirtualMachinesPerformMaintenancePoller.FinalResponse` has been removed -- Function `*GalleryApplicationsCreateOrUpdatePoller.FinalResponse` has been removed -- Function `*CloudServiceRoleInstancesDeletePoller.Poll` has been removed -- Function `VirtualMachineExtensionsCreateOrUpdatePollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachineScaleSetExtensionsCreateOrUpdatePoller.ResumeToken` has been removed -- Function `*VirtualMachineScaleSetVMsRestartPoller.FinalResponse` has been removed -- Function `*CloudServicesRebuildPoller.ResumeToken` has been removed -- Function `GalleryApplicationVersionsUpdatePollerResponse.PollUntilDone` has been removed -- Function `VirtualMachineScaleSetVMRunCommandsCreateOrUpdatePollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachineScaleSetVMsRunCommandPoller.ResumeToken` has been removed -- Function `*DedicatedHostsListByHostGroupPager.Err` has been removed -- Function `*CloudServicesUpdatePoller.ResumeToken` has been removed -- Function `*SSHPublicKeysListByResourceGroupPager.PageResponse` has been removed -- Function `*DisksRevokeAccessPoller.FinalResponse` has been removed -- Function `*DisksDeletePoller.ResumeToken` has been removed -- Function `*DedicatedHostGroupsListBySubscriptionPager.PageResponse` has been removed -- Function `*DisksRevokeAccessPollerResponse.Resume` has been removed -- Function `*CapacityReservationGroupsListByResourceGroupPager.PageResponse` has been removed -- Function `*VirtualMachineScaleSetsListPager.Err` has been removed -- Function `*VirtualMachineScaleSetsDeleteInstancesPoller.Poll` has been removed -- Function `*VirtualMachineScaleSetsPerformMaintenancePoller.FinalResponse` has been removed -- Function `*VirtualMachinesAssessPatchesPoller.FinalResponse` has been removed -- Function `*VirtualMachinesRunCommandPoller.Done` has been removed -- Function `DedicatedHostsCreateOrUpdatePollerResponse.PollUntilDone` has been removed -- Function `GalleriesDeletePollerResponse.PollUntilDone` has been removed -- Function `DedicatedHostsDeletePollerResponse.PollUntilDone` has been removed -- Function `*GalleryImageVersionsDeletePoller.FinalResponse` has been removed -- Function `*VirtualMachinesListPager.NextPage` has been removed -- Function `*DiskRestorePointRevokeAccessPollerResponse.Resume` has been removed -- Function `*CloudServicesUpdateDomainWalkUpdateDomainPollerResponse.Resume` has been removed -- Function `*CapacityReservationsDeletePoller.Done` has been removed -- Function `*CapacityReservationsListByCapacityReservationGroupPager.Err` has been removed -- Function `*VirtualMachinesCapturePoller.Done` has been removed -- Function `*CloudServiceRoleInstancesRebuildPoller.Poll` has been removed -- Function `*VirtualMachineScaleSetsListByLocationPager.Err` has been removed -- Function `*GalleriesListByResourceGroupPager.NextPage` has been removed -- Function `*CloudServicesPowerOffPoller.FinalResponse` has been removed -- Function `*CloudServicesListAllPager.PageResponse` has been removed -- Function `*SharedGalleryImageVersionsListPager.PageResponse` has been removed -- Function `*VirtualMachineScaleSetsReimagePoller.Done` has been removed -- Function `VirtualMachineScaleSetRollingUpgradesCancelPollerResponse.PollUntilDone` has been removed -- Function `*CloudServicesCreateOrUpdatePoller.Poll` has been removed -- Function `*VirtualMachinesPerformMaintenancePoller.ResumeToken` has been removed -- Function `CapacityReservationsCreateOrUpdatePollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachinesConvertToManagedDisksPoller.FinalResponse` has been removed -- Function `*DisksGrantAccessPoller.FinalResponse` has been removed -- Function `*LogAnalyticsExportThrottledRequestsPoller.Done` has been removed -- Function `*VirtualMachineScaleSetsCreateOrUpdatePoller.Done` has been removed -- Function `*VirtualMachinesCapturePoller.ResumeToken` has been removed -- Function `*VirtualMachinesRunCommandPoller.FinalResponse` has been removed -- Function `*SharedGalleriesListPager.Err` has been removed -- Function `*DiskRestorePointRevokeAccessPoller.FinalResponse` has been removed -- Function `*VirtualMachineScaleSetsDeletePollerResponse.Resume` has been removed -- Function `*RestorePointCollectionsListAllPager.NextPage` has been removed -- Function `*VirtualMachineExtensionsUpdatePoller.Poll` has been removed -- Function `*LogAnalyticsExportRequestRateByIntervalPoller.ResumeToken` has been removed -- Function `*RestorePointCollectionsDeletePoller.FinalResponse` has been removed -- Function `*CapacityReservationsListByCapacityReservationGroupPager.NextPage` has been removed -- Function `CloudServiceRoleInstancesRebuildPollerResponse.PollUntilDone` has been removed -- Function `*DiskEncryptionSetsDeletePoller.ResumeToken` has been removed -- Function `*VirtualMachinesInstallPatchesPoller.FinalResponse` has been removed -- Function `*CloudServicesPowerOffPoller.Done` has been removed -- Function `*VirtualMachinesPerformMaintenancePoller.Done` has been removed -- Function `*VirtualMachinesPerformMaintenancePoller.Poll` has been removed -- Function `*ImagesDeletePoller.Done` has been removed -- Function `*CloudServicesRestartPoller.Done` has been removed -- Function `*VirtualMachineRunCommandsListPager.NextPage` has been removed -- Function `VirtualMachineScaleSetsRedeployPollerResponse.PollUntilDone` has been removed -- Function `*DedicatedHostsUpdatePoller.ResumeToken` has been removed -- Function `*CapacityReservationGroupsListByResourceGroupPager.Err` has been removed -- Function `*VirtualMachineScaleSetsPerformMaintenancePoller.Done` has been removed -- Function `*GalleryApplicationsDeletePollerResponse.Resume` has been removed -- Function `*GalleryApplicationVersionsListByGalleryApplicationPager.NextPage` has been removed -- Function `*VirtualMachineScaleSetsDeallocatePoller.Done` has been removed -- Function `*DiskEncryptionSetsUpdatePoller.FinalResponse` has been removed -- Function `LogAnalyticsExportRequestRateByIntervalPollerResponse.PollUntilDone` has been removed -- Function `*DiskRestorePointGrantAccessPoller.Done` has been removed -- Function `CloudServicesUpdateDomainWalkUpdateDomainPollerResponse.PollUntilDone` has been removed -- Function `DiskAccessesUpdatePollerResponse.PollUntilDone` has been removed -- Function `*DedicatedHostsCreateOrUpdatePollerResponse.Resume` has been removed -- Function `*SnapshotsRevokeAccessPoller.ResumeToken` has been removed -- Function `*VirtualMachineScaleSetVMsPerformMaintenancePoller.Done` has been removed -- Function `VirtualMachineExtensionsDeletePollerResponse.PollUntilDone` has been removed -- Function `*GalleryApplicationVersionsUpdatePollerResponse.Resume` has been removed -- Function `*AvailabilitySetsListPager.NextPage` has been removed -- Function `*VirtualMachineScaleSetsRedeployPoller.Done` has been removed -- Function `*VirtualMachineRunCommandsUpdatePoller.FinalResponse` has been removed -- Function `*GalleryApplicationVersionsDeletePollerResponse.Resume` has been removed -- Function `*CloudServicesReimagePoller.Poll` has been removed -- Function `*VirtualMachinesStartPoller.Poll` has been removed -- Function `*SSHPublicKeysListBySubscriptionPager.NextPage` has been removed -- Function `*CloudServicesRebuildPoller.Done` has been removed -- Function `*GalleryApplicationVersionsUpdatePoller.Poll` has been removed -- Function `*DedicatedHostsDeletePoller.ResumeToken` has been removed -- Function `*DiskAccessesCreateOrUpdatePoller.Poll` has been removed -- Function `*VirtualMachineScaleSetsPerformMaintenancePoller.Poll` has been removed -- Function `*GalleriesCreateOrUpdatePoller.ResumeToken` has been removed -- Function `*GalleryApplicationsListByGalleryPager.PageResponse` has been removed -- Function `*VirtualMachineScaleSetVMExtensionsUpdatePoller.Done` has been removed -- Function `*VirtualMachineScaleSetVMsStartPoller.Poll` has been removed -- Function `ImageReference.MarshalJSON` has been removed -- Function `DiskRestorePointGrantAccessPollerResponse.PollUntilDone` has been removed -- Function `*DisksRevokeAccessPoller.Poll` has been removed -- Function `*CloudServiceRoleInstancesRebuildPollerResponse.Resume` has been removed -- Function `*CloudServicesUpdateDomainWalkUpdateDomainPoller.Done` has been removed -- Function `*VirtualMachineRunCommandsCreateOrUpdatePoller.ResumeToken` has been removed -- Function `*VirtualMachinesRedeployPoller.FinalResponse` has been removed -- Function `*VirtualMachinesUpdatePoller.Done` has been removed -- Function `*SnapshotsRevokeAccessPoller.FinalResponse` has been removed -- Function `*GalleryImagesCreateOrUpdatePoller.ResumeToken` has been removed -- Function `*CapacityReservationGroupsListByResourceGroupPager.NextPage` has been removed -- Function `*VirtualMachinesUpdatePollerResponse.Resume` has been removed -- Function `*VirtualMachineScaleSetExtensionsDeletePoller.ResumeToken` has been removed -- Function `*VirtualMachinesListAllPager.NextPage` has been removed -- Function `*DiskEncryptionSetsDeletePoller.FinalResponse` has been removed -- Function `*CapacityReservationsUpdatePoller.Done` has been removed -- Function `VirtualMachinesUpdatePollerResponse.PollUntilDone` has been removed -- Function `*GalleryImageVersionsCreateOrUpdatePollerResponse.Resume` has been removed -- Function `*DiskEncryptionSetsListAssociatedResourcesPager.NextPage` has been removed -- Function `VirtualMachinesCreateOrUpdatePollerResponse.PollUntilDone` has been removed -- Function `*DisksUpdatePoller.Done` has been removed -- Function `*SnapshotsGrantAccessPoller.Done` has been removed -- Function `*CloudServiceRoleInstancesDeletePoller.ResumeToken` has been removed -- Function `*CloudServicesDeleteInstancesPoller.Poll` has been removed -- Function `*DiskAccessesDeletePollerResponse.Resume` has been removed -- Function `*GalleryImagesDeletePoller.ResumeToken` has been removed -- Function `*GalleryImageVersionsDeletePoller.Done` has been removed -- Function `*CapacityReservationsDeletePoller.ResumeToken` has been removed -- Function `*DiskEncryptionSetsListAssociatedResourcesPager.Err` has been removed -- Function `*CloudServiceRoleInstancesRebuildPoller.FinalResponse` has been removed -- Function `*VirtualMachinesCreateOrUpdatePoller.FinalResponse` has been removed -- Function `*VirtualMachineScaleSetExtensionsUpdatePoller.ResumeToken` has been removed -- Function `VirtualMachineScaleSetVMsRunCommandPollerResponse.PollUntilDone` has been removed -- Function `*GalleryApplicationsUpdatePoller.FinalResponse` has been removed -- Function `*DiskEncryptionSetsCreateOrUpdatePollerResponse.Resume` has been removed -- Function `*VirtualMachineScaleSetVMsReimageAllPoller.FinalResponse` has been removed -- Function `*GalleriesDeletePoller.FinalResponse` has been removed -- Function `*ImagesCreateOrUpdatePoller.Poll` has been removed -- Function `*GalleryApplicationVersionsListByGalleryApplicationPager.Err` has been removed -- Function `*CloudServicesUpdatePoller.Poll` has been removed -- Function `*GalleryImagesCreateOrUpdatePollerResponse.Resume` has been removed -- Function `*VirtualMachineScaleSetVMsRunCommandPollerResponse.Resume` has been removed -- Function `*CloudServiceRoleInstancesReimagePollerResponse.Resume` has been removed -- Function `*CapacityReservationsUpdatePollerResponse.Resume` has been removed -- Function `*VirtualMachinesPowerOffPollerResponse.Resume` has been removed -- Function `*DedicatedHostGroupsListByResourceGroupPager.NextPage` has been removed -- Function `*GalleryImagesListByGalleryPager.PageResponse` has been removed -- Function `*VirtualMachineRunCommandsCreateOrUpdatePoller.FinalResponse` has been removed -- Function `*VirtualMachineScaleSetVMExtensionsDeletePoller.Poll` has been removed -- Function `*DedicatedHostGroupsListBySubscriptionPager.Err` has been removed -- Function `*VirtualMachineScaleSetVMsRedeployPoller.Done` has been removed -- Function `*GalleriesDeletePollerResponse.Resume` has been removed -- Function `*DedicatedHostGroupsListByResourceGroupPager.PageResponse` has been removed -- Function `*DisksDeletePoller.Poll` has been removed -- Function `*DiskRestorePointRevokeAccessPoller.ResumeToken` has been removed -- Function `*ImagesDeletePoller.FinalResponse` has been removed -- Function `*VirtualMachineScaleSetVMExtensionsDeletePoller.Done` has been removed -- Function `*VirtualMachineScaleSetVMsPerformMaintenancePoller.FinalResponse` has been removed -- Function `*DiskRestorePointRevokeAccessPoller.Poll` has been removed -- Function `*DiskAccessesListPrivateEndpointConnectionsPager.NextPage` has been removed -- Function `*SnapshotsCreateOrUpdatePoller.Done` has been removed -- Function `*VirtualMachineScaleSetsCreateOrUpdatePollerResponse.Resume` has been removed -- Function `*VirtualMachineScaleSetsUpdateInstancesPoller.FinalResponse` has been removed -- Function `*RestorePointsDeletePollerResponse.Resume` has been removed -- Function `*CloudServiceOperatingSystemsListOSFamiliesPager.PageResponse` has been removed -- Function `*SnapshotsDeletePollerResponse.Resume` has been removed -- Function `*DedicatedHostsCreateOrUpdatePoller.FinalResponse` has been removed -- Function `*VirtualMachineScaleSetsReimageAllPoller.FinalResponse` has been removed -- Function `*CloudServiceRoleInstancesRestartPoller.Poll` has been removed -- Function `*VirtualMachinesRestartPoller.Poll` has been removed -- Function `CloudServicesDeleteInstancesPollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachineScaleSetVMRunCommandsUpdatePollerResponse.Resume` has been removed -- Function `*CapacityReservationGroupsListBySubscriptionPager.Err` has been removed -- Function `*GalleryApplicationsDeletePoller.Poll` has been removed -- Function `*GalleryImagesDeletePoller.Poll` has been removed -- Function `*CloudServicesUpdateDomainWalkUpdateDomainPoller.FinalResponse` has been removed -- Function `*CloudServiceRolesListPager.PageResponse` has been removed -- Function `*DiskEncryptionSetsUpdatePoller.Done` has been removed -- Function `*ImagesListPager.PageResponse` has been removed -- Function `*VirtualMachineScaleSetVMRunCommandsListPager.NextPage` has been removed -- Function `VirtualMachineScaleSetVMRunCommandsUpdatePollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachineRunCommandsDeletePoller.FinalResponse` has been removed -- Function `*VirtualMachinesReimagePoller.FinalResponse` has been removed -- Function `SnapshotsCreateOrUpdatePollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachineScaleSetVMsRunCommandPoller.Done` has been removed -- Function `GalleriesUpdatePollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachineRunCommandsUpdatePoller.Poll` has been removed -- Function `*ImagesCreateOrUpdatePoller.Done` has been removed -- Function `*VirtualMachinesRedeployPoller.Poll` has been removed -- Function `*GalleriesListByResourceGroupPager.Err` has been removed -- Function `*DiskEncryptionSetsDeletePoller.Poll` has been removed -- Function `*SnapshotsCreateOrUpdatePollerResponse.Resume` has been removed -- Function `*VirtualMachineScaleSetVMExtensionsUpdatePoller.FinalResponse` has been removed -- Function `*VirtualMachinesCreateOrUpdatePoller.ResumeToken` has been removed -- Function `*VirtualMachineScaleSetsUpdatePoller.FinalResponse` has been removed -- Function `*DiskEncryptionSetsListByResourceGroupPager.PageResponse` has been removed -- Function `*CloudServicesReimagePollerResponse.Resume` has been removed -- Function `VirtualMachineScaleSetVMsStartPollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachineScaleSetVMsUpdatePoller.Done` has been removed -- Function `*SnapshotsListPager.Err` has been removed -- Function `*VirtualMachineScaleSetsSetOrchestrationServiceStatePoller.Poll` has been removed -- Function `*DiskAccessesListPager.Err` has been removed -- Function `*DisksUpdatePoller.FinalResponse` has been removed -- Function `*CloudServiceRolesListPager.NextPage` has been removed -- Function `*CloudServiceRoleInstancesListPager.Err` has been removed -- Function `*VirtualMachineScaleSetVMExtensionsCreateOrUpdatePoller.ResumeToken` has been removed -- Function `*DiskRestorePointRevokeAccessPoller.Done` has been removed -- Function `*VirtualMachinesReimagePollerResponse.Resume` has been removed -- Function `*VirtualMachineScaleSetsDeleteInstancesPoller.Done` has been removed -- Function `*RestorePointsCreatePollerResponse.Resume` has been removed -- Function `*VirtualMachineScaleSetsDeallocatePoller.FinalResponse` has been removed -- Function `CloudServicesReimagePollerResponse.PollUntilDone` has been removed -- Function `*CloudServiceOperatingSystemsListOSVersionsPager.NextPage` has been removed -- Function `*RestorePointsDeletePoller.Done` has been removed -- Function `*VirtualMachineScaleSetVMsReimageAllPollerResponse.Resume` has been removed -- Function `*DisksUpdatePollerResponse.Resume` has been removed -- Function `*GalleryApplicationVersionsCreateOrUpdatePoller.Poll` has been removed -- Function `*GalleriesCreateOrUpdatePoller.Poll` has been removed -- Function `*SnapshotsDeletePoller.FinalResponse` has been removed -- Function `*GalleryImagesDeletePollerResponse.Resume` has been removed -- Function `*GallerySharingProfileUpdatePoller.ResumeToken` has been removed -- Function `*GallerySharingProfileUpdatePollerResponse.Resume` has been removed -- Function `*VirtualMachineScaleSetVMsStartPollerResponse.Resume` has been removed -- Function `VirtualMachinesRunCommandPollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachineScaleSetsStartPollerResponse.Resume` has been removed -- Function `*VirtualMachinesDeletePoller.FinalResponse` has been removed -- Function `*VirtualMachineScaleSetExtensionsListPager.PageResponse` has been removed -- Function `*DisksGrantAccessPoller.Poll` has been removed -- Function `*CloudServicesUpdatePoller.Done` has been removed -- Function `VirtualMachineScaleSetVMExtensionsCreateOrUpdatePollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachineScaleSetsDeallocatePoller.ResumeToken` has been removed -- Function `*VirtualMachineScaleSetVMExtensionsDeletePoller.FinalResponse` has been removed -- Function `*VirtualMachineExtensionsDeletePoller.Poll` has been removed -- Function `*VirtualMachineScaleSetVMsRedeployPoller.Poll` has been removed -- Function `*GalleryImageVersionsDeletePoller.ResumeToken` has been removed -- Function `SnapshotsRevokeAccessPollerResponse.PollUntilDone` has been removed -- Function `*ResourceSKUsListPager.NextPage` has been removed -- Function `*VirtualMachineScaleSetVMsListPager.NextPage` has been removed -- Function `*VirtualMachineScaleSetVMsReimagePollerResponse.Resume` has been removed -- Function `*VirtualMachineScaleSetsReimagePollerResponse.Resume` has been removed -- Function `VirtualMachinesPowerOffPollerResponse.PollUntilDone` has been removed -- Function `*GalleryApplicationsCreateOrUpdatePoller.Poll` has been removed -- Function `VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradePollerResponse.PollUntilDone` has been removed -- Function `*CloudServiceRoleInstancesListPager.NextPage` has been removed -- Function `*VirtualMachineScaleSetsSetOrchestrationServiceStatePoller.FinalResponse` has been removed -- Function `*VirtualMachineScaleSetsDeleteInstancesPollerResponse.Resume` has been removed -- Function `GalleryImagesDeletePollerResponse.PollUntilDone` has been removed -- Function `*SnapshotsGrantAccessPoller.Poll` has been removed -- Function `*GalleryImageVersionsListByGalleryImagePager.NextPage` has been removed -- Function `*VirtualMachineScaleSetVMsRedeployPoller.FinalResponse` has been removed -- Function `*VirtualMachineScaleSetsPerformMaintenancePoller.ResumeToken` has been removed -- Function `*RestorePointCollectionsListPager.NextPage` has been removed -- Function `*VirtualMachineScaleSetsListByLocationPager.PageResponse` has been removed -- Function `*GalleriesDeletePoller.Poll` has been removed -- Function `*SnapshotsListByResourceGroupPager.PageResponse` has been removed -- Function `*SharedGalleryImagesListPager.Err` has been removed -- Function `*CloudServicesListPager.Err` has been removed -- Function `*CloudServicesListPager.PageResponse` has been removed -- Function `*DiskAccessesCreateOrUpdatePollerResponse.Resume` has been removed -- Function `RunCommandDocumentBase.MarshalJSON` has been removed -- Function `*VirtualMachineScaleSetsPowerOffPoller.ResumeToken` has been removed -- Function `*VirtualMachineScaleSetsReimageAllPoller.ResumeToken` has been removed -- Function `SnapshotsDeletePollerResponse.PollUntilDone` has been removed -- Function `RestorePointsDeletePollerResponse.PollUntilDone` has been removed -- Function `VirtualMachineReimageParameters.MarshalJSON` has been removed -- Function `DiskAccessesUpdateAPrivateEndpointConnectionPollerResponse.PollUntilDone` has been removed -- Function `*CloudServiceRoleInstancesReimagePoller.Poll` has been removed -- Function `*VirtualMachineScaleSetExtensionsCreateOrUpdatePollerResponse.Resume` has been removed -- Function `*CapacityReservationsCreateOrUpdatePoller.Done` has been removed -- Function `*VirtualMachineScaleSetVMsReimagePoller.FinalResponse` has been removed -- Function `*VirtualMachineExtensionsUpdatePoller.ResumeToken` has been removed -- Function `*DisksListPager.NextPage` has been removed -- Function `*VirtualMachineScaleSetVMsDeallocatePollerResponse.Resume` has been removed -- Function `*SnapshotsCreateOrUpdatePoller.ResumeToken` has been removed -- Function `CloudServicesDeletePollerResponse.PollUntilDone` has been removed -- Function `VirtualMachineScaleSetVMsUpdatePollerResponse.PollUntilDone` has been removed -- Function `*RestorePointsCreatePoller.Poll` has been removed -- Function `*SnapshotsRevokeAccessPollerResponse.Resume` has been removed -- Function `*VirtualMachineScaleSetRollingUpgradesStartOSUpgradePoller.Poll` has been removed -- Function `*LogAnalyticsExportThrottledRequestsPoller.FinalResponse` has been removed -- Function `*VirtualMachinesReimagePoller.ResumeToken` has been removed -- Function `*VirtualMachineScaleSetsStartPoller.ResumeToken` has been removed -- Function `*CloudServiceRoleInstancesReimagePoller.Done` has been removed -- Function `*VirtualMachineRunCommandsUpdatePollerResponse.Resume` has been removed -- Function `*GalleryImageVersionsUpdatePollerResponse.Resume` has been removed -- Function `*VirtualMachinesListByLocationPager.NextPage` has been removed -- Function `*DiskAccessesListByResourceGroupPager.Err` has been removed -- Function `*GalleryApplicationVersionsUpdatePoller.Done` has been removed -- Function `*CloudServiceRoleInstancesDeletePoller.FinalResponse` has been removed -- Function `*VirtualMachineScaleSetVMExtensionsCreateOrUpdatePoller.Done` has been removed -- Function `*DiskEncryptionSetsListByResourceGroupPager.Err` has been removed -- Function `ImagesDeletePollerResponse.PollUntilDone` has been removed -- Function `*RestorePointCollectionsDeletePoller.Done` has been removed -- Function `*CloudServicesDeleteInstancesPollerResponse.Resume` has been removed -- Function `VirtualMachineScaleSetsUpdatePollerResponse.PollUntilDone` has been removed -- Function `*CapacityReservationsCreateOrUpdatePoller.FinalResponse` has been removed -- Function `*CloudServicesStartPollerResponse.Resume` has been removed -- Function `VirtualMachinesRestartPollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachineScaleSetVMExtensionsDeletePoller.ResumeToken` has been removed -- Function `RestorePointCollectionsDeletePollerResponse.PollUntilDone` has been removed -- Function `*RestorePointsCreatePoller.Done` has been removed -- Function `DisksCreateOrUpdatePollerResponse.PollUntilDone` has been removed -- Function `*ImagesCreateOrUpdatePollerResponse.Resume` has been removed -- Function `*GalleryApplicationVersionsDeletePoller.ResumeToken` has been removed -- Function `VirtualMachineScaleSetVMsReimageAllPollerResponse.PollUntilDone` has been removed -- Function `*SnapshotsListByResourceGroupPager.Err` has been removed -- Function `*CloudServiceRoleInstancesRestartPoller.FinalResponse` has been removed -- Function `*DiskRestorePointGrantAccessPoller.Poll` has been removed -- Function `*VirtualMachineScaleSetVMRunCommandsDeletePoller.Done` has been removed -- Function `*GalleryApplicationsUpdatePoller.ResumeToken` has been removed -- Function `*UsageListPager.NextPage` has been removed -- Function `*VirtualMachineScaleSetsDeleteInstancesPoller.FinalResponse` has been removed -- Function `*VirtualMachineScaleSetExtensionsDeletePoller.FinalResponse` has been removed -- Function `*SnapshotsDeletePoller.Poll` has been removed -- Function `*VirtualMachineScaleSetVMsDeallocatePoller.ResumeToken` has been removed -- Function `*SSHPublicKeysListByResourceGroupPager.Err` has been removed -- Function `*VirtualMachinesRestartPoller.FinalResponse` has been removed -- Function `*VirtualMachineScaleSetVMRunCommandsDeletePollerResponse.Resume` has been removed -- Function `*DisksCreateOrUpdatePoller.ResumeToken` has been removed -- Function `*ImagesDeletePollerResponse.Resume` has been removed -- Function `*ProximityPlacementGroupsListBySubscriptionPager.Err` has been removed -- Function `*VirtualMachinesDeletePoller.Done` has been removed -- Function `*CloudServicesRestartPollerResponse.Resume` has been removed -- Function `*LogAnalyticsExportRequestRateByIntervalPollerResponse.Resume` has been removed -- Function `*VirtualMachineScaleSetVMsUpdatePoller.ResumeToken` has been removed -- Function `*DiskRestorePointGrantAccessPoller.ResumeToken` has been removed -- Function `CloudServicesRebuildPollerResponse.PollUntilDone` has been removed -- Function `*DisksListByResourceGroupPager.NextPage` has been removed -- Function `*GalleryImageVersionsCreateOrUpdatePoller.ResumeToken` has been removed -- Function `*SSHPublicKeysListBySubscriptionPager.PageResponse` has been removed -- Function `*CapacityReservationsListByCapacityReservationGroupPager.PageResponse` has been removed -- Function `*VirtualMachineRunCommandsListByVirtualMachinePager.PageResponse` has been removed -- Function `*DiskRestorePointListByRestorePointPager.NextPage` has been removed -- Function `*VirtualMachinesConvertToManagedDisksPoller.Done` has been removed -- Function `*DisksRevokeAccessPoller.ResumeToken` has been removed -- Function `*CloudServicesUpdateDomainListUpdateDomainsPager.Err` has been removed -- Function `*AvailabilitySetsListBySubscriptionPager.NextPage` has been removed -- Function `*VirtualMachineScaleSetsSetOrchestrationServiceStatePollerResponse.Resume` has been removed -- Function `*VirtualMachineScaleSetsPowerOffPoller.Done` has been removed -- Function `*GalleryApplicationsListByGalleryPager.Err` has been removed -- Function `*ImagesUpdatePoller.Done` has been removed -- Function `*VirtualMachineScaleSetsRestartPoller.FinalResponse` has been removed -- Function `*GalleryImagesCreateOrUpdatePoller.Poll` has been removed -- Function `*CloudServiceRoleInstancesReimagePoller.FinalResponse` has been removed -- Function `*DiskAccessesUpdateAPrivateEndpointConnectionPoller.ResumeToken` has been removed -- Function `*VirtualMachineScaleSetRollingUpgradesStartOSUpgradePoller.FinalResponse` has been removed -- Function `*VirtualMachineScaleSetsUpdateInstancesPoller.Poll` has been removed -- Function `*DisksListPager.PageResponse` has been removed -- Function `*ProximityPlacementGroupsListBySubscriptionPager.PageResponse` has been removed -- Function `*VirtualMachineScaleSetExtensionsCreateOrUpdatePoller.Done` has been removed -- Function `*GalleryApplicationVersionsDeletePoller.Done` has been removed -- Function `*GalleryApplicationsCreateOrUpdatePoller.Done` has been removed -- Function `*DisksListPager.Err` has been removed -- Function `*VirtualMachineScaleSetExtensionsListPager.Err` has been removed -- Function `VirtualMachineScaleSetVMsRedeployPollerResponse.PollUntilDone` has been removed -- Function `DiskAccessesDeletePollerResponse.PollUntilDone` has been removed -- Function `*GalleryImageVersionsUpdatePoller.Done` has been removed -- Function `*DiskEncryptionSetsUpdatePoller.ResumeToken` has been removed -- Function `*GalleryApplicationsUpdatePoller.Done` has been removed -- Function `*SnapshotsRevokeAccessPoller.Poll` has been removed -- Function `*VirtualMachinesUpdatePoller.ResumeToken` has been removed -- Function `*VirtualMachineScaleSetsStartPoller.Poll` has been removed -- Function `*VirtualMachineScaleSetVMExtensionsUpdatePoller.Poll` has been removed -- Function `*VirtualMachinesRestartPollerResponse.Resume` has been removed -- Function `CloudServicesStartPollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachineScaleSetsRestartPoller.Done` has been removed -- Function `*GalleryImageVersionsDeletePollerResponse.Resume` has been removed -- Function `*DiskAccessesDeleteAPrivateEndpointConnectionPollerResponse.Resume` has been removed -- Function `*CloudServicesStartPoller.FinalResponse` has been removed -- Function `*VirtualMachineScaleSetRollingUpgradesCancelPoller.Poll` has been removed -- Function `*VirtualMachinesReimagePoller.Done` has been removed -- Function `*DiskAccessesCreateOrUpdatePoller.ResumeToken` has been removed -- Function `GalleryImageVersionsUpdatePollerResponse.PollUntilDone` has been removed -- Function `*ImagesUpdatePoller.ResumeToken` has been removed -- Function `*RestorePointCollectionsDeletePoller.Poll` has been removed -- Function `*DiskEncryptionSetsListByResourceGroupPager.NextPage` has been removed -- Function `DisksGrantAccessPollerResponse.PollUntilDone` has been removed -- Function `*CapacityReservationsCreateOrUpdatePoller.ResumeToken` has been removed -- Function `*VirtualMachineScaleSetVMsUpdatePoller.Poll` has been removed -- Function `*DiskAccessesListPager.PageResponse` has been removed -- Function `*CapacityReservationsDeletePoller.FinalResponse` has been removed -- Function `*SnapshotsUpdatePollerResponse.Resume` has been removed -- Function `*VirtualMachineScaleSetsListPager.NextPage` has been removed -- Function `GallerySharingProfileUpdatePollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachineScaleSetExtensionsCreateOrUpdatePoller.FinalResponse` has been removed -- Function `*GalleryImageVersionsUpdatePoller.FinalResponse` has been removed -- Function `VirtualMachineRunCommandsCreateOrUpdatePollerResponse.PollUntilDone` has been removed -- Function `VirtualMachineScaleSetIPConfiguration.MarshalJSON` has been removed -- Function `GalleryApplicationsCreateOrUpdatePollerResponse.PollUntilDone` has been removed -- Function `GalleryImageVersionsDeletePollerResponse.PollUntilDone` has been removed -- Function `*CloudServiceRoleInstancesRebuildPoller.Done` has been removed -- Function `VirtualMachinesRedeployPollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachinesRunCommandPoller.Poll` has been removed -- Function `*ProximityPlacementGroupsListByResourceGroupPager.NextPage` has been removed -- Function `*VirtualMachineScaleSetsListSKUsPager.NextPage` has been removed -- Function `*VirtualMachineScaleSetVMsListPager.Err` has been removed -- Function `*CloudServicesListAllPager.Err` has been removed -- Function `*VirtualMachineScaleSetVMRunCommandsListPager.Err` has been removed -- Function `*CloudServicesPowerOffPollerResponse.Resume` has been removed -- Function `*GalleriesListPager.PageResponse` has been removed -- Function `*DiskAccessesDeletePoller.ResumeToken` has been removed -- Function `*VirtualMachinesRestartPoller.Done` has been removed -- Function `*VirtualMachineScaleSetsUpdateInstancesPoller.Done` has been removed -- Function `*VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradePoller.ResumeToken` has been removed -- Function `*SnapshotsUpdatePoller.Poll` has been removed -- Function `*GalleryImagesListByGalleryPager.NextPage` has been removed -- Function `*SnapshotsUpdatePoller.Done` has been removed -- Function `*GalleryImagesUpdatePoller.FinalResponse` has been removed -- Function `*VirtualMachinesDeletePoller.ResumeToken` has been removed -- Function `*GalleryImageVersionsListByGalleryImagePager.Err` has been removed -- Function `*VirtualMachineScaleSetVMsDeallocatePoller.Done` has been removed -- Function `*DiskEncryptionSetsCreateOrUpdatePoller.ResumeToken` has been removed -- Function `*CloudServicesPowerOffPoller.ResumeToken` has been removed -- Function `*VirtualMachineScaleSetVMExtensionsCreateOrUpdatePoller.FinalResponse` has been removed -- Function `*DedicatedHostsCreateOrUpdatePoller.Poll` has been removed -- Function `*SSHPublicKeysListBySubscriptionPager.Err` has been removed -- Function `*VirtualMachineScaleSetsReimageAllPoller.Done` has been removed -- Function `DiskAccessesDeleteAPrivateEndpointConnectionPollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachineScaleSetVMsStartPoller.FinalResponse` has been removed -- Function `*DiskAccessesUpdatePoller.Done` has been removed -- Function `*VirtualMachinesInstallPatchesPollerResponse.Resume` has been removed -- Function `*VirtualMachineScaleSetVMsStartPoller.Done` has been removed -- Function `ComputeOperationListResult.MarshalJSON` has been removed -- Function `DisksUpdatePollerResponse.PollUntilDone` has been removed -- Function `*UsageListPager.PageResponse` has been removed -- Function `*VirtualMachineScaleSetVMsPowerOffPoller.Done` has been removed -- Function `*DisksGrantAccessPoller.Done` has been removed -- Function `*GallerySharingProfileUpdatePoller.Done` has been removed -- Function `*GalleryApplicationVersionsCreateOrUpdatePoller.Done` has been removed -- Function `*LogAnalyticsExportThrottledRequestsPoller.Poll` has been removed -- Function `*VirtualMachineScaleSetsStartPoller.Done` has been removed -- Function `*VirtualMachineScaleSetVMsRestartPoller.Done` has been removed -- Function `*DiskAccessesCreateOrUpdatePoller.FinalResponse` has been removed -- Function `VirtualMachineScaleSetExtension.MarshalJSON` has been removed -- Function `*CloudServicesPowerOffPoller.Poll` has been removed -- Function `*VirtualMachineScaleSetVMRunCommandsListPager.PageResponse` has been removed -- Function `*SnapshotsGrantAccessPoller.ResumeToken` has been removed -- Function `DiskEncryptionSetsCreateOrUpdatePollerResponse.PollUntilDone` has been removed -- Function `*DiskAccessesListByResourceGroupPager.NextPage` has been removed -- Function `*VirtualMachinesReapplyPoller.ResumeToken` has been removed -- Function `*CloudServicesDeletePoller.Poll` has been removed -- Function `*VirtualMachinesInstallPatchesPoller.Poll` has been removed -- Function `*LogAnalyticsExportRequestRateByIntervalPoller.FinalResponse` has been removed -- Function `*VirtualMachineRunCommandsUpdatePoller.Done` has been removed -- Function `VirtualMachineScaleSetsCreateOrUpdatePollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachinesPowerOffPoller.FinalResponse` has been removed -- Function `*VirtualMachineScaleSetVMRunCommandsCreateOrUpdatePoller.FinalResponse` has been removed -- Function `*VirtualMachineScaleSetVMsRestartPoller.ResumeToken` has been removed -- Function `*GalleriesDeletePoller.ResumeToken` has been removed -- Function `*VirtualMachineScaleSetsListSKUsPager.Err` has been removed -- Function `*VirtualMachinesAssessPatchesPoller.Done` has been removed -- Function `*DedicatedHostsDeletePoller.Done` has been removed -- Function `*VirtualMachineScaleSetsUpdatePollerResponse.Resume` has been removed -- Function `*LogAnalyticsExportRequestRateByIntervalPoller.Done` has been removed -- Function `*VirtualMachineScaleSetVMExtensionsDeletePollerResponse.Resume` has been removed -- Function `*VirtualMachineScaleSetsUpdatePoller.ResumeToken` has been removed -- Function `*VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradePollerResponse.Resume` has been removed -- Function `*VirtualMachineScaleSetsDeleteInstancesPoller.ResumeToken` has been removed -- Function `*VirtualMachinesReapplyPoller.Done` has been removed -- Function `*DiskAccessesUpdateAPrivateEndpointConnectionPoller.FinalResponse` has been removed -- Function `*GalleryApplicationVersionsCreateOrUpdatePoller.FinalResponse` has been removed -- Function `RestorePointsCreatePollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachineScaleSetVMsReimageAllPoller.ResumeToken` has been removed -- Function `*CapacityReservationsCreateOrUpdatePoller.Poll` has been removed -- Function `VirtualMachineScaleSetVMsDeletePollerResponse.PollUntilDone` has been removed -- Function `*GalleriesListPager.Err` has been removed -- Function `*RestorePointsDeletePoller.ResumeToken` has been removed -- Function `*SnapshotsCreateOrUpdatePoller.Poll` has been removed -- Function `SnapshotsUpdatePollerResponse.PollUntilDone` has been removed -- Function `*CloudServicesUpdatePollerResponse.Resume` has been removed -- Function `*GalleryImageVersionsUpdatePoller.ResumeToken` has been removed -- Function `*VirtualMachineScaleSetVMsRedeployPoller.ResumeToken` has been removed -- Function `*GalleryApplicationVersionsUpdatePoller.FinalResponse` has been removed -- Function `*VirtualMachinesRunCommandPoller.ResumeToken` has been removed -- Function `*CloudServicesListPager.NextPage` has been removed -- Function `*DiskAccessesListPager.NextPage` has been removed -- Function `*VirtualMachinesPerformMaintenancePollerResponse.Resume` has been removed -- Function `*DiskAccessesUpdatePoller.Poll` has been removed -- Function `*VirtualMachinesReapplyPollerResponse.Resume` has been removed -- Function `*GalleryApplicationsCreateOrUpdatePollerResponse.Resume` has been removed -- Function `*ResourceSKUsListPager.Err` has been removed -- Function `*VirtualMachineScaleSetVMsDeletePoller.Poll` has been removed -- Function `*VirtualMachinesReapplyPoller.FinalResponse` has been removed -- Function `*DedicatedHostsListByHostGroupPager.PageResponse` has been removed -- Function `DiskEncryptionSetsDeletePollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachinesListPager.PageResponse` has been removed -- Function `*DedicatedHostsListByHostGroupPager.NextPage` has been removed -- Function `*VirtualMachineScaleSetsRedeployPollerResponse.Resume` has been removed -- Function `*SnapshotsCreateOrUpdatePoller.FinalResponse` has been removed -- Function `*VirtualMachineScaleSetExtensionsDeletePoller.Poll` has been removed -- Function `*VirtualMachineScaleSetsPerformMaintenancePollerResponse.Resume` has been removed -- Function `*VirtualMachineScaleSetVMExtensionsCreateOrUpdatePollerResponse.Resume` has been removed -- Function `*VirtualMachineScaleSetsReimageAllPoller.Poll` has been removed -- Function `*ImagesUpdatePoller.Poll` has been removed -- Function `*RestorePointsCreatePoller.FinalResponse` has been removed -- Function `*GalleryApplicationsDeletePoller.ResumeToken` has been removed -- Function `*SharedGalleryImagesListPager.NextPage` has been removed -- Function `*SnapshotsGrantAccessPoller.FinalResponse` has been removed -- Function `*VirtualMachineScaleSetVMsRedeployPollerResponse.Resume` has been removed -- Function `*VirtualMachineScaleSetRollingUpgradesStartOSUpgradePoller.Done` has been removed -- Function `*VirtualMachineScaleSetRollingUpgradesCancelPollerResponse.Resume` has been removed -- Function `*CloudServicesStartPoller.Poll` has been removed -- Function `*VirtualMachineScaleSetsReimagePoller.ResumeToken` has been removed -- Function `CloudServicesUpdatePollerResponse.PollUntilDone` has been removed -- Function `*GalleryImagesDeletePoller.FinalResponse` has been removed -- Function `VirtualMachineScaleSetsUpdateInstancesPollerResponse.PollUntilDone` has been removed -- Function `*SSHPublicKeysListByResourceGroupPager.NextPage` has been removed -- Function `*VirtualMachineExtensionsDeletePoller.Done` has been removed -- Function `*VirtualMachineScaleSetsUpdateInstancesPollerResponse.Resume` has been removed -- Function `DiskRestorePointRevokeAccessPollerResponse.PollUntilDone` has been removed -- Function `*GalleryImagesUpdatePollerResponse.Resume` has been removed -- Function `VirtualMachineScaleSetsSetOrchestrationServiceStatePollerResponse.PollUntilDone` has been removed -- Function `*DiskAccessesDeleteAPrivateEndpointConnectionPoller.Poll` has been removed -- Function `*VirtualMachinesPowerOffPoller.Done` has been removed -- Function `CloudServicesCreateOrUpdatePollerResponse.PollUntilDone` has been removed -- Function `GalleryImagesUpdatePollerResponse.PollUntilDone` has been removed -- Function `DisksRevokeAccessPollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachineExtensionsCreateOrUpdatePoller.Poll` has been removed -- Function `*VirtualMachineScaleSetsGetOSUpgradeHistoryPager.Err` has been removed -- Function `*ProximityPlacementGroupsListByResourceGroupPager.PageResponse` has been removed -- Function `*DiskEncryptionSetsCreateOrUpdatePoller.Poll` has been removed -- Function `*GallerySharingProfileUpdatePoller.Poll` has been removed -- Function `*VirtualMachineScaleSetVMsDeletePollerResponse.Resume` has been removed -- Function `*VirtualMachineScaleSetsUpdatePoller.Poll` has been removed -- Function `*VirtualMachineScaleSetVMsPerformMaintenancePollerResponse.Resume` has been removed -- Function `*VirtualMachineScaleSetsRestartPoller.ResumeToken` has been removed -- Function `*ImagesCreateOrUpdatePoller.ResumeToken` has been removed -- Function `*CloudServiceRoleInstancesListPager.PageResponse` has been removed -- Function `*GalleryApplicationsDeletePoller.Done` has been removed -- Function `*DedicatedHostsCreateOrUpdatePoller.ResumeToken` has been removed -- Function `*UsageListPager.Err` has been removed -- Function `*VirtualMachinesDeallocatePoller.Poll` has been removed -- Function `*LogAnalyticsExportThrottledRequestsPoller.ResumeToken` has been removed -- Function `*DisksRevokeAccessPoller.Done` has been removed -- Function `*VirtualMachineRunCommandsCreateOrUpdatePollerResponse.Resume` has been removed -- Function `*DiskAccessesDeletePoller.Done` has been removed -- Function `*CloudServiceOperatingSystemsListOSFamiliesPager.NextPage` has been removed -- Function `*VirtualMachineScaleSetVMsPerformMaintenancePoller.ResumeToken` has been removed -- Function `VirtualMachinesConvertToManagedDisksPollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachineScaleSetRollingUpgradesStartOSUpgradePoller.ResumeToken` has been removed -- Function `*VirtualMachinesListByLocationPager.PageResponse` has been removed -- Function `VirtualMachinesCapturePollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradePoller.FinalResponse` has been removed -- Function `*GalleryApplicationsUpdatePollerResponse.Resume` has been removed -- Function `*SnapshotsUpdatePoller.FinalResponse` has been removed -- Function `*GalleryApplicationsCreateOrUpdatePoller.ResumeToken` has been removed -- Function `VirtualMachineScaleSetExtensionsUpdatePollerResponse.PollUntilDone` has been removed -- Function `*DiskAccessesDeleteAPrivateEndpointConnectionPoller.Done` has been removed -- Function `*LogAnalyticsExportRequestRateByIntervalPoller.Poll` has been removed -- Function `SubResource.MarshalJSON` has been removed -- Function `*VirtualMachineScaleSetVMsDeletePoller.ResumeToken` has been removed -- Function `VirtualMachineScaleSetsReimageAllPollerResponse.PollUntilDone` has been removed -- Function `*GalleryApplicationVersionsCreateOrUpdatePoller.ResumeToken` has been removed -- Function `*VirtualMachineScaleSetsRedeployPoller.FinalResponse` has been removed -- Function `*VirtualMachineScaleSetVMRunCommandsUpdatePoller.FinalResponse` has been removed -- Function `DedicatedHostsUpdatePollerResponse.PollUntilDone` has been removed -- Function `*CloudServicesDeleteInstancesPoller.Done` has been removed -- Function `*VirtualMachineExtensionsDeletePoller.ResumeToken` has been removed -- Function `*CapacityReservationsDeletePollerResponse.Resume` has been removed -- Function `*RestorePointCollectionsDeletePollerResponse.Resume` has been removed -- Function `*VirtualMachinesInstallPatchesPoller.ResumeToken` has been removed -- Function `*VirtualMachineScaleSetsDeallocatePollerResponse.Resume` has been removed -- Function `*VirtualMachinesAssessPatchesPoller.Poll` has been removed -- Function `*VirtualMachinesDeallocatePoller.Done` has been removed -- Function `VirtualMachineScaleSetVMsReimagePollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachineScaleSetVMsRunCommandPoller.Poll` has been removed -- Function `*VirtualMachinesCreateOrUpdatePoller.Done` has been removed -- Function `*DiskEncryptionSetsListPager.Err` has been removed -- Function `*GalleriesCreateOrUpdatePoller.Done` has been removed -- Function `DiskEncryptionSetsUpdatePollerResponse.PollUntilDone` has been removed -- Function `*GalleryImageVersionsUpdatePoller.Poll` has been removed -- Function `*VirtualMachineScaleSetVMsDeallocatePoller.FinalResponse` has been removed -- Function `VirtualMachinesDeallocatePollerResponse.PollUntilDone` has been removed -- Function `*GalleryApplicationsListByGalleryPager.NextPage` has been removed -- Function `*DiskAccessesDeleteAPrivateEndpointConnectionPoller.FinalResponse` has been removed -- Function `*GalleryImageVersionsCreateOrUpdatePoller.FinalResponse` has been removed -- Function `*VirtualMachineScaleSetVMsDeletePoller.Done` has been removed -- Function `*DiskEncryptionSetsListPager.NextPage` has been removed -- Function `*VirtualMachinesDeletePoller.Poll` has been removed -- Function `*VirtualMachineExtensionsUpdatePoller.FinalResponse` has been removed -- Function `*VirtualMachineScaleSetVMsListPager.PageResponse` has been removed -- Function `*CloudServicesUpdatePoller.FinalResponse` has been removed -- Function `*VirtualMachineScaleSetVMRunCommandsDeletePoller.Poll` has been removed -- Function `*CapacityReservationGroupsListBySubscriptionPager.NextPage` has been removed -- Function `*CloudServiceOperatingSystemsListOSVersionsPager.Err` has been removed -- Function `*VirtualMachinesStartPoller.Done` has been removed -- Function `*CloudServicesStartPoller.Done` has been removed -- Function `*VirtualMachineScaleSetVMRunCommandsCreateOrUpdatePollerResponse.Resume` has been removed -- Function `*SharedGalleriesListPager.NextPage` has been removed -- Function `*VirtualMachineScaleSetVMRunCommandsDeletePoller.FinalResponse` has been removed -- Function `*VirtualMachinesPowerOffPoller.ResumeToken` has been removed -- Function `*DisksDeletePollerResponse.Resume` has been removed -- Function `*GalleryImagesCreateOrUpdatePoller.Done` has been removed -- Function `SubResourceWithColocationStatus.MarshalJSON` has been removed -- Function `VirtualMachineScaleSetVMsRestartPollerResponse.PollUntilDone` has been removed -- Function `*GalleryApplicationVersionsCreateOrUpdatePollerResponse.Resume` has been removed -- Function `ImagesCreateOrUpdatePollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachineScaleSetsPowerOffPoller.Poll` has been removed -- Function `*VirtualMachineScaleSetRollingUpgradesCancelPoller.ResumeToken` has been removed -- Function `*ImagesListByResourceGroupPager.PageResponse` has been removed -- Function `*VirtualMachinesCapturePoller.Poll` has been removed -- Function `*ProximityPlacementGroupsListByResourceGroupPager.Err` has been removed -- Function `*VirtualMachineScaleSetsRedeployPoller.Poll` has been removed -- Function `*SnapshotsRevokeAccessPoller.Done` has been removed -- Function `CloudServicesRestartPollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachineScaleSetVMsUpdatePoller.FinalResponse` has been removed -- Function `*VirtualMachineScaleSetVMRunCommandsDeletePoller.ResumeToken` has been removed -- Function `*VirtualMachineRunCommandsListPager.PageResponse` has been removed -- Function `*GalleriesUpdatePoller.ResumeToken` has been removed -- Function `*VirtualMachineScaleSetVMsPerformMaintenancePoller.Poll` has been removed -- Function `CloudServiceRoleInstancesReimagePollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachineScaleSetExtensionsUpdatePoller.Poll` has been removed -- Function `*VirtualMachineScaleSetsReimagePoller.Poll` has been removed -- Function `*DedicatedHostsDeletePoller.FinalResponse` has been removed -- Function `*VirtualMachineScaleSetsListPager.PageResponse` has been removed -- Function `*DiskAccessesUpdatePoller.ResumeToken` has been removed -- Function `*SharedGalleriesListPager.PageResponse` has been removed -- Function `*VirtualMachineScaleSetRollingUpgradesCancelPoller.FinalResponse` has been removed -- Function `*DisksListByResourceGroupPager.PageResponse` has been removed -- Function `*VirtualMachineRunCommandsCreateOrUpdatePoller.Poll` has been removed -- Function `*ImagesUpdatePollerResponse.Resume` has been removed -- Function `*VirtualMachineExtensionsCreateOrUpdatePoller.FinalResponse` has been removed -- Function `*RestorePointsDeletePoller.Poll` has been removed -- Function `*DiskAccessesDeleteAPrivateEndpointConnectionPoller.ResumeToken` has been removed -- Function `VirtualMachineScaleSetVMsPerformMaintenancePollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachineScaleSetVMsRestartPollerResponse.Resume` has been removed -- Function `GalleryImagesCreateOrUpdatePollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachinesInstallPatchesPoller.Done` has been removed -- Function `*VirtualMachinesStartPollerResponse.Resume` has been removed -- Function `SnapshotsGrantAccessPollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachineScaleSetVMsPowerOffPoller.FinalResponse` has been removed -- Function `*DedicatedHostGroupsListBySubscriptionPager.NextPage` has been removed -- Function `*ImagesListPager.NextPage` has been removed -- Function `*VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradePoller.Done` has been removed -- Function `*DiskAccessesListByResourceGroupPager.PageResponse` has been removed -- Function `GalleryImageVersionsCreateOrUpdatePollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachinesAssessPatchesPollerResponse.Resume` has been removed -- Function `*CloudServiceRoleInstancesRestartPoller.Done` has been removed -- Function `*CloudServicesCreateOrUpdatePollerResponse.Resume` has been removed -- Function `*VirtualMachineRunCommandsListPager.Err` has been removed -- Function `*GalleriesListByResourceGroupPager.PageResponse` has been removed -- Function `*GalleriesCreateOrUpdatePollerResponse.Resume` has been removed -- Function `*GalleryApplicationVersionsDeletePoller.Poll` has been removed -- Function `*CloudServicesRestartPoller.ResumeToken` has been removed -- Function `*DiskRestorePointGrantAccessPoller.FinalResponse` has been removed -- Function `*GalleryApplicationsUpdatePoller.Poll` has been removed -- Function `*GalleryImagesDeletePoller.Done` has been removed -- Function `*SnapshotsGrantAccessPollerResponse.Resume` has been removed -- Function `*CloudServiceRolesListPager.Err` has been removed -- Function `*VirtualMachinesDeallocatePollerResponse.Resume` has been removed -- Function `*VirtualMachineScaleSetsRestartPoller.Poll` has been removed -- Function `*VirtualMachinesDeallocatePoller.ResumeToken` has been removed -- Function `*VirtualMachineScaleSetsListAllPager.Err` has been removed -- Function `VirtualMachineScaleSetsReimagePollerResponse.PollUntilDone` has been removed -- Function `CloudServiceRoleInstancesDeletePollerResponse.PollUntilDone` has been removed -- Function `*DiskEncryptionSetsDeletePoller.Done` has been removed -- Function `*RestorePointCollectionsDeletePoller.ResumeToken` has been removed -- Function `GalleryApplicationVersionsDeletePollerResponse.PollUntilDone` has been removed -- Function `VirtualMachineScaleSetsDeletePollerResponse.PollUntilDone` has been removed -- Function `VirtualMachinesReapplyPollerResponse.PollUntilDone` has been removed -- Function `VirtualMachineExtensionsUpdatePollerResponse.PollUntilDone` has been removed -- Function `VirtualMachineScaleSetsDeallocatePollerResponse.PollUntilDone` has been removed -- Function `*VirtualMachineExtensionsDeletePollerResponse.Resume` has been removed -- Function `*GalleriesDeletePoller.Done` has been removed -- Function `*CloudServicesRebuildPollerResponse.Resume` has been removed -- Function `*RestorePointCollectionsListPager.Err` has been removed -- Function `*VirtualMachineScaleSetsDeallocatePoller.Poll` has been removed -- Function `*DiskRestorePointGrantAccessPollerResponse.Resume` has been removed -- Function `*VirtualMachineScaleSetsStartPoller.FinalResponse` has been removed -- Function `*GallerySharingProfileUpdatePoller.FinalResponse` has been removed -- Function `*ProximityPlacementGroupsListBySubscriptionPager.NextPage` has been removed -- Function `VirtualMachineRunCommandsUpdatePollerResponse.PollUntilDone` has been removed -- Function `SubResourceReadOnly.MarshalJSON` has been removed -- Function `*VirtualMachineScaleSetRollingUpgradesCancelPoller.Done` has been removed -- Struct `AvailabilitySetsCreateOrUpdateOptions` has been removed -- Struct `AvailabilitySetsCreateOrUpdateResponse` has been removed -- Struct `AvailabilitySetsCreateOrUpdateResult` has been removed -- Struct `AvailabilitySetsDeleteOptions` has been removed -- Struct `AvailabilitySetsDeleteResponse` has been removed -- Struct `AvailabilitySetsGetOptions` has been removed -- Struct `AvailabilitySetsGetResponse` has been removed -- Struct `AvailabilitySetsGetResult` has been removed -- Struct `AvailabilitySetsListAvailableSizesOptions` has been removed -- Struct `AvailabilitySetsListAvailableSizesResponse` has been removed -- Struct `AvailabilitySetsListAvailableSizesResult` has been removed -- Struct `AvailabilitySetsListBySubscriptionOptions` has been removed -- Struct `AvailabilitySetsListBySubscriptionPager` has been removed -- Struct `AvailabilitySetsListBySubscriptionResponse` has been removed -- Struct `AvailabilitySetsListBySubscriptionResult` has been removed -- Struct `AvailabilitySetsListOptions` has been removed -- Struct `AvailabilitySetsListPager` has been removed -- Struct `AvailabilitySetsListResponse` has been removed -- Struct `AvailabilitySetsListResult` has been removed -- Struct `AvailabilitySetsUpdateOptions` has been removed -- Struct `AvailabilitySetsUpdateResponse` has been removed -- Struct `AvailabilitySetsUpdateResult` has been removed -- Struct `CapacityReservationGroupsCreateOrUpdateOptions` has been removed -- Struct `CapacityReservationGroupsCreateOrUpdateResponse` has been removed -- Struct `CapacityReservationGroupsCreateOrUpdateResult` has been removed -- Struct `CapacityReservationGroupsDeleteOptions` has been removed -- Struct `CapacityReservationGroupsDeleteResponse` has been removed -- Struct `CapacityReservationGroupsGetOptions` has been removed -- Struct `CapacityReservationGroupsGetResponse` has been removed -- Struct `CapacityReservationGroupsGetResult` has been removed -- Struct `CapacityReservationGroupsListByResourceGroupOptions` has been removed -- Struct `CapacityReservationGroupsListByResourceGroupPager` has been removed -- Struct `CapacityReservationGroupsListByResourceGroupResponse` has been removed -- Struct `CapacityReservationGroupsListByResourceGroupResult` has been removed -- Struct `CapacityReservationGroupsListBySubscriptionOptions` has been removed -- Struct `CapacityReservationGroupsListBySubscriptionPager` has been removed -- Struct `CapacityReservationGroupsListBySubscriptionResponse` has been removed -- Struct `CapacityReservationGroupsListBySubscriptionResult` has been removed -- Struct `CapacityReservationGroupsUpdateOptions` has been removed -- Struct `CapacityReservationGroupsUpdateResponse` has been removed -- Struct `CapacityReservationGroupsUpdateResult` has been removed -- Struct `CapacityReservationsBeginCreateOrUpdateOptions` has been removed -- Struct `CapacityReservationsBeginDeleteOptions` has been removed -- Struct `CapacityReservationsBeginUpdateOptions` has been removed -- Struct `CapacityReservationsCreateOrUpdatePoller` has been removed -- Struct `CapacityReservationsCreateOrUpdatePollerResponse` has been removed -- Struct `CapacityReservationsCreateOrUpdateResponse` has been removed -- Struct `CapacityReservationsCreateOrUpdateResult` has been removed -- Struct `CapacityReservationsDeletePoller` has been removed -- Struct `CapacityReservationsDeletePollerResponse` has been removed -- Struct `CapacityReservationsDeleteResponse` has been removed -- Struct `CapacityReservationsGetOptions` has been removed -- Struct `CapacityReservationsGetResponse` has been removed -- Struct `CapacityReservationsGetResult` has been removed -- Struct `CapacityReservationsListByCapacityReservationGroupOptions` has been removed -- Struct `CapacityReservationsListByCapacityReservationGroupPager` has been removed -- Struct `CapacityReservationsListByCapacityReservationGroupResponse` has been removed -- Struct `CapacityReservationsListByCapacityReservationGroupResult` has been removed -- Struct `CapacityReservationsUpdatePoller` has been removed -- Struct `CapacityReservationsUpdatePollerResponse` has been removed -- Struct `CapacityReservationsUpdateResponse` has been removed -- Struct `CapacityReservationsUpdateResult` has been removed -- Struct `CloudServiceOperatingSystemsGetOSFamilyOptions` has been removed -- Struct `CloudServiceOperatingSystemsGetOSFamilyResponse` has been removed -- Struct `CloudServiceOperatingSystemsGetOSFamilyResult` has been removed -- Struct `CloudServiceOperatingSystemsGetOSVersionOptions` has been removed -- Struct `CloudServiceOperatingSystemsGetOSVersionResponse` has been removed -- Struct `CloudServiceOperatingSystemsGetOSVersionResult` has been removed -- Struct `CloudServiceOperatingSystemsListOSFamiliesOptions` has been removed -- Struct `CloudServiceOperatingSystemsListOSFamiliesPager` has been removed -- Struct `CloudServiceOperatingSystemsListOSFamiliesResponse` has been removed -- Struct `CloudServiceOperatingSystemsListOSFamiliesResult` has been removed -- Struct `CloudServiceOperatingSystemsListOSVersionsOptions` has been removed -- Struct `CloudServiceOperatingSystemsListOSVersionsPager` has been removed -- Struct `CloudServiceOperatingSystemsListOSVersionsResponse` has been removed -- Struct `CloudServiceOperatingSystemsListOSVersionsResult` has been removed -- Struct `CloudServiceRoleInstancesBeginDeleteOptions` has been removed -- Struct `CloudServiceRoleInstancesBeginRebuildOptions` has been removed -- Struct `CloudServiceRoleInstancesBeginReimageOptions` has been removed -- Struct `CloudServiceRoleInstancesBeginRestartOptions` has been removed -- Struct `CloudServiceRoleInstancesDeletePoller` has been removed -- Struct `CloudServiceRoleInstancesDeletePollerResponse` has been removed -- Struct `CloudServiceRoleInstancesDeleteResponse` has been removed -- Struct `CloudServiceRoleInstancesGetInstanceViewOptions` has been removed -- Struct `CloudServiceRoleInstancesGetInstanceViewResponse` has been removed -- Struct `CloudServiceRoleInstancesGetInstanceViewResult` has been removed -- Struct `CloudServiceRoleInstancesGetOptions` has been removed -- Struct `CloudServiceRoleInstancesGetRemoteDesktopFileOptions` has been removed -- Struct `CloudServiceRoleInstancesGetRemoteDesktopFileResponse` has been removed -- Struct `CloudServiceRoleInstancesGetResponse` has been removed -- Struct `CloudServiceRoleInstancesGetResult` has been removed -- Struct `CloudServiceRoleInstancesListOptions` has been removed -- Struct `CloudServiceRoleInstancesListPager` has been removed -- Struct `CloudServiceRoleInstancesListResponse` has been removed -- Struct `CloudServiceRoleInstancesListResult` has been removed -- Struct `CloudServiceRoleInstancesRebuildPoller` has been removed -- Struct `CloudServiceRoleInstancesRebuildPollerResponse` has been removed -- Struct `CloudServiceRoleInstancesRebuildResponse` has been removed -- Struct `CloudServiceRoleInstancesReimagePoller` has been removed -- Struct `CloudServiceRoleInstancesReimagePollerResponse` has been removed -- Struct `CloudServiceRoleInstancesReimageResponse` has been removed -- Struct `CloudServiceRoleInstancesRestartPoller` has been removed -- Struct `CloudServiceRoleInstancesRestartPollerResponse` has been removed -- Struct `CloudServiceRoleInstancesRestartResponse` has been removed -- Struct `CloudServiceRolesGetOptions` has been removed -- Struct `CloudServiceRolesGetResponse` has been removed -- Struct `CloudServiceRolesGetResult` has been removed -- Struct `CloudServiceRolesListOptions` has been removed -- Struct `CloudServiceRolesListPager` has been removed -- Struct `CloudServiceRolesListResponse` has been removed -- Struct `CloudServiceRolesListResult` has been removed -- Struct `CloudServicesBeginCreateOrUpdateOptions` has been removed -- Struct `CloudServicesBeginDeleteInstancesOptions` has been removed -- Struct `CloudServicesBeginDeleteOptions` has been removed -- Struct `CloudServicesBeginPowerOffOptions` has been removed -- Struct `CloudServicesBeginRebuildOptions` has been removed -- Struct `CloudServicesBeginReimageOptions` has been removed -- Struct `CloudServicesBeginRestartOptions` has been removed -- Struct `CloudServicesBeginStartOptions` has been removed -- Struct `CloudServicesBeginUpdateOptions` has been removed -- Struct `CloudServicesCreateOrUpdatePoller` has been removed -- Struct `CloudServicesCreateOrUpdatePollerResponse` has been removed -- Struct `CloudServicesCreateOrUpdateResponse` has been removed -- Struct `CloudServicesCreateOrUpdateResult` has been removed -- Struct `CloudServicesDeleteInstancesPoller` has been removed -- Struct `CloudServicesDeleteInstancesPollerResponse` has been removed -- Struct `CloudServicesDeleteInstancesResponse` has been removed -- Struct `CloudServicesDeletePoller` has been removed -- Struct `CloudServicesDeletePollerResponse` has been removed -- Struct `CloudServicesDeleteResponse` has been removed -- Struct `CloudServicesGetInstanceViewOptions` has been removed -- Struct `CloudServicesGetInstanceViewResponse` has been removed -- Struct `CloudServicesGetInstanceViewResult` has been removed -- Struct `CloudServicesGetOptions` has been removed -- Struct `CloudServicesGetResponse` has been removed -- Struct `CloudServicesGetResult` has been removed -- Struct `CloudServicesListAllOptions` has been removed -- Struct `CloudServicesListAllPager` has been removed -- Struct `CloudServicesListAllResponse` has been removed -- Struct `CloudServicesListAllResult` has been removed -- Struct `CloudServicesListOptions` has been removed -- Struct `CloudServicesListPager` has been removed -- Struct `CloudServicesListResponse` has been removed -- Struct `CloudServicesListResult` has been removed -- Struct `CloudServicesPowerOffPoller` has been removed -- Struct `CloudServicesPowerOffPollerResponse` has been removed -- Struct `CloudServicesPowerOffResponse` has been removed -- Struct `CloudServicesRebuildPoller` has been removed -- Struct `CloudServicesRebuildPollerResponse` has been removed -- Struct `CloudServicesRebuildResponse` has been removed -- Struct `CloudServicesReimagePoller` has been removed -- Struct `CloudServicesReimagePollerResponse` has been removed -- Struct `CloudServicesReimageResponse` has been removed -- Struct `CloudServicesRestartPoller` has been removed -- Struct `CloudServicesRestartPollerResponse` has been removed -- Struct `CloudServicesRestartResponse` has been removed -- Struct `CloudServicesStartPoller` has been removed -- Struct `CloudServicesStartPollerResponse` has been removed -- Struct `CloudServicesStartResponse` has been removed -- Struct `CloudServicesUpdateDomainBeginWalkUpdateDomainOptions` has been removed -- Struct `CloudServicesUpdateDomainGetUpdateDomainOptions` has been removed -- Struct `CloudServicesUpdateDomainGetUpdateDomainResponse` has been removed -- Struct `CloudServicesUpdateDomainGetUpdateDomainResult` has been removed -- Struct `CloudServicesUpdateDomainListUpdateDomainsOptions` has been removed -- Struct `CloudServicesUpdateDomainListUpdateDomainsPager` has been removed -- Struct `CloudServicesUpdateDomainListUpdateDomainsResponse` has been removed -- Struct `CloudServicesUpdateDomainListUpdateDomainsResult` has been removed -- Struct `CloudServicesUpdateDomainWalkUpdateDomainPoller` has been removed -- Struct `CloudServicesUpdateDomainWalkUpdateDomainPollerResponse` has been removed -- Struct `CloudServicesUpdateDomainWalkUpdateDomainResponse` has been removed -- Struct `CloudServicesUpdatePoller` has been removed -- Struct `CloudServicesUpdatePollerResponse` has been removed -- Struct `CloudServicesUpdateResponse` has been removed -- Struct `CloudServicesUpdateResult` has been removed -- Struct `CommunityGalleriesGetOptions` has been removed -- Struct `CommunityGalleriesGetResponse` has been removed -- Struct `CommunityGalleriesGetResult` has been removed -- Struct `CommunityGalleryImageVersionsGetOptions` has been removed -- Struct `CommunityGalleryImageVersionsGetResponse` has been removed -- Struct `CommunityGalleryImageVersionsGetResult` has been removed -- Struct `CommunityGalleryImagesGetOptions` has been removed -- Struct `CommunityGalleryImagesGetResponse` has been removed -- Struct `CommunityGalleryImagesGetResult` has been removed -- Struct `ComputeOperationListResult` has been removed -- Struct `ComputeOperationValue` has been removed -- Struct `ComputeOperationValueDisplay` has been removed -- Struct `DedicatedHostGroupsCreateOrUpdateOptions` has been removed -- Struct `DedicatedHostGroupsCreateOrUpdateResponse` has been removed -- Struct `DedicatedHostGroupsCreateOrUpdateResult` has been removed -- Struct `DedicatedHostGroupsDeleteOptions` has been removed -- Struct `DedicatedHostGroupsDeleteResponse` has been removed -- Struct `DedicatedHostGroupsGetOptions` has been removed -- Struct `DedicatedHostGroupsGetResponse` has been removed -- Struct `DedicatedHostGroupsGetResult` has been removed -- Struct `DedicatedHostGroupsListByResourceGroupOptions` has been removed -- Struct `DedicatedHostGroupsListByResourceGroupPager` has been removed -- Struct `DedicatedHostGroupsListByResourceGroupResponse` has been removed -- Struct `DedicatedHostGroupsListByResourceGroupResult` has been removed -- Struct `DedicatedHostGroupsListBySubscriptionOptions` has been removed -- Struct `DedicatedHostGroupsListBySubscriptionPager` has been removed -- Struct `DedicatedHostGroupsListBySubscriptionResponse` has been removed -- Struct `DedicatedHostGroupsListBySubscriptionResult` has been removed -- Struct `DedicatedHostGroupsUpdateOptions` has been removed -- Struct `DedicatedHostGroupsUpdateResponse` has been removed -- Struct `DedicatedHostGroupsUpdateResult` has been removed -- Struct `DedicatedHostsBeginCreateOrUpdateOptions` has been removed -- Struct `DedicatedHostsBeginDeleteOptions` has been removed -- Struct `DedicatedHostsBeginUpdateOptions` has been removed -- Struct `DedicatedHostsCreateOrUpdatePoller` has been removed -- Struct `DedicatedHostsCreateOrUpdatePollerResponse` has been removed -- Struct `DedicatedHostsCreateOrUpdateResponse` has been removed -- Struct `DedicatedHostsCreateOrUpdateResult` has been removed -- Struct `DedicatedHostsDeletePoller` has been removed -- Struct `DedicatedHostsDeletePollerResponse` has been removed -- Struct `DedicatedHostsDeleteResponse` has been removed -- Struct `DedicatedHostsGetOptions` has been removed -- Struct `DedicatedHostsGetResponse` has been removed -- Struct `DedicatedHostsGetResult` has been removed -- Struct `DedicatedHostsListByHostGroupOptions` has been removed -- Struct `DedicatedHostsListByHostGroupPager` has been removed -- Struct `DedicatedHostsListByHostGroupResponse` has been removed -- Struct `DedicatedHostsListByHostGroupResult` has been removed -- Struct `DedicatedHostsUpdatePoller` has been removed -- Struct `DedicatedHostsUpdatePollerResponse` has been removed -- Struct `DedicatedHostsUpdateResponse` has been removed -- Struct `DedicatedHostsUpdateResult` has been removed -- Struct `DiskAccessesBeginCreateOrUpdateOptions` has been removed -- Struct `DiskAccessesBeginDeleteAPrivateEndpointConnectionOptions` has been removed -- Struct `DiskAccessesBeginDeleteOptions` has been removed -- Struct `DiskAccessesBeginUpdateAPrivateEndpointConnectionOptions` has been removed -- Struct `DiskAccessesBeginUpdateOptions` has been removed -- Struct `DiskAccessesCreateOrUpdatePoller` has been removed -- Struct `DiskAccessesCreateOrUpdatePollerResponse` has been removed -- Struct `DiskAccessesCreateOrUpdateResponse` has been removed -- Struct `DiskAccessesCreateOrUpdateResult` has been removed -- Struct `DiskAccessesDeleteAPrivateEndpointConnectionPoller` has been removed -- Struct `DiskAccessesDeleteAPrivateEndpointConnectionPollerResponse` has been removed -- Struct `DiskAccessesDeleteAPrivateEndpointConnectionResponse` has been removed -- Struct `DiskAccessesDeletePoller` has been removed -- Struct `DiskAccessesDeletePollerResponse` has been removed -- Struct `DiskAccessesDeleteResponse` has been removed -- Struct `DiskAccessesGetAPrivateEndpointConnectionOptions` has been removed -- Struct `DiskAccessesGetAPrivateEndpointConnectionResponse` has been removed -- Struct `DiskAccessesGetAPrivateEndpointConnectionResult` has been removed -- Struct `DiskAccessesGetOptions` has been removed -- Struct `DiskAccessesGetPrivateLinkResourcesOptions` has been removed -- Struct `DiskAccessesGetPrivateLinkResourcesResponse` has been removed -- Struct `DiskAccessesGetPrivateLinkResourcesResult` has been removed -- Struct `DiskAccessesGetResponse` has been removed -- Struct `DiskAccessesGetResult` has been removed -- Struct `DiskAccessesListByResourceGroupOptions` has been removed -- Struct `DiskAccessesListByResourceGroupPager` has been removed -- Struct `DiskAccessesListByResourceGroupResponse` has been removed -- Struct `DiskAccessesListByResourceGroupResult` has been removed -- Struct `DiskAccessesListOptions` has been removed -- Struct `DiskAccessesListPager` has been removed -- Struct `DiskAccessesListPrivateEndpointConnectionsOptions` has been removed -- Struct `DiskAccessesListPrivateEndpointConnectionsPager` has been removed -- Struct `DiskAccessesListPrivateEndpointConnectionsResponse` has been removed -- Struct `DiskAccessesListPrivateEndpointConnectionsResult` has been removed -- Struct `DiskAccessesListResponse` has been removed -- Struct `DiskAccessesListResult` has been removed -- Struct `DiskAccessesUpdateAPrivateEndpointConnectionPoller` has been removed -- Struct `DiskAccessesUpdateAPrivateEndpointConnectionPollerResponse` has been removed -- Struct `DiskAccessesUpdateAPrivateEndpointConnectionResponse` has been removed -- Struct `DiskAccessesUpdateAPrivateEndpointConnectionResult` has been removed -- Struct `DiskAccessesUpdatePoller` has been removed -- Struct `DiskAccessesUpdatePollerResponse` has been removed -- Struct `DiskAccessesUpdateResponse` has been removed -- Struct `DiskAccessesUpdateResult` has been removed -- Struct `DiskEncryptionSetsBeginCreateOrUpdateOptions` has been removed -- Struct `DiskEncryptionSetsBeginDeleteOptions` has been removed -- Struct `DiskEncryptionSetsBeginUpdateOptions` has been removed -- Struct `DiskEncryptionSetsCreateOrUpdatePoller` has been removed -- Struct `DiskEncryptionSetsCreateOrUpdatePollerResponse` has been removed -- Struct `DiskEncryptionSetsCreateOrUpdateResponse` has been removed -- Struct `DiskEncryptionSetsCreateOrUpdateResult` has been removed -- Struct `DiskEncryptionSetsDeletePoller` has been removed -- Struct `DiskEncryptionSetsDeletePollerResponse` has been removed -- Struct `DiskEncryptionSetsDeleteResponse` has been removed -- Struct `DiskEncryptionSetsGetOptions` has been removed -- Struct `DiskEncryptionSetsGetResponse` has been removed -- Struct `DiskEncryptionSetsGetResult` has been removed -- Struct `DiskEncryptionSetsListAssociatedResourcesOptions` has been removed -- Struct `DiskEncryptionSetsListAssociatedResourcesPager` has been removed -- Struct `DiskEncryptionSetsListAssociatedResourcesResponse` has been removed -- Struct `DiskEncryptionSetsListAssociatedResourcesResult` has been removed -- Struct `DiskEncryptionSetsListByResourceGroupOptions` has been removed -- Struct `DiskEncryptionSetsListByResourceGroupPager` has been removed -- Struct `DiskEncryptionSetsListByResourceGroupResponse` has been removed -- Struct `DiskEncryptionSetsListByResourceGroupResult` has been removed -- Struct `DiskEncryptionSetsListOptions` has been removed -- Struct `DiskEncryptionSetsListPager` has been removed -- Struct `DiskEncryptionSetsListResponse` has been removed -- Struct `DiskEncryptionSetsListResult` has been removed -- Struct `DiskEncryptionSetsUpdatePoller` has been removed -- Struct `DiskEncryptionSetsUpdatePollerResponse` has been removed -- Struct `DiskEncryptionSetsUpdateResponse` has been removed -- Struct `DiskEncryptionSetsUpdateResult` has been removed -- Struct `DiskRestorePointBeginGrantAccessOptions` has been removed -- Struct `DiskRestorePointBeginRevokeAccessOptions` has been removed -- Struct `DiskRestorePointGetOptions` has been removed -- Struct `DiskRestorePointGetResponse` has been removed -- Struct `DiskRestorePointGetResult` has been removed -- Struct `DiskRestorePointGrantAccessPoller` has been removed -- Struct `DiskRestorePointGrantAccessPollerResponse` has been removed -- Struct `DiskRestorePointGrantAccessResponse` has been removed -- Struct `DiskRestorePointGrantAccessResult` has been removed -- Struct `DiskRestorePointListByRestorePointOptions` has been removed -- Struct `DiskRestorePointListByRestorePointPager` has been removed -- Struct `DiskRestorePointListByRestorePointResponse` has been removed -- Struct `DiskRestorePointListByRestorePointResult` has been removed -- Struct `DiskRestorePointRevokeAccessPoller` has been removed -- Struct `DiskRestorePointRevokeAccessPollerResponse` has been removed -- Struct `DiskRestorePointRevokeAccessResponse` has been removed -- Struct `DisksBeginCreateOrUpdateOptions` has been removed -- Struct `DisksBeginDeleteOptions` has been removed -- Struct `DisksBeginGrantAccessOptions` has been removed -- Struct `DisksBeginRevokeAccessOptions` has been removed -- Struct `DisksBeginUpdateOptions` has been removed -- Struct `DisksCreateOrUpdatePoller` has been removed -- Struct `DisksCreateOrUpdatePollerResponse` has been removed -- Struct `DisksCreateOrUpdateResponse` has been removed -- Struct `DisksCreateOrUpdateResult` has been removed -- Struct `DisksDeletePoller` has been removed -- Struct `DisksDeletePollerResponse` has been removed -- Struct `DisksDeleteResponse` has been removed -- Struct `DisksGetOptions` has been removed -- Struct `DisksGetResponse` has been removed -- Struct `DisksGetResult` has been removed -- Struct `DisksGrantAccessPoller` has been removed -- Struct `DisksGrantAccessPollerResponse` has been removed -- Struct `DisksGrantAccessResponse` has been removed -- Struct `DisksGrantAccessResult` has been removed -- Struct `DisksListByResourceGroupOptions` has been removed -- Struct `DisksListByResourceGroupPager` has been removed -- Struct `DisksListByResourceGroupResponse` has been removed -- Struct `DisksListByResourceGroupResult` has been removed -- Struct `DisksListOptions` has been removed -- Struct `DisksListPager` has been removed -- Struct `DisksListResponse` has been removed -- Struct `DisksListResult` has been removed -- Struct `DisksRevokeAccessPoller` has been removed -- Struct `DisksRevokeAccessPollerResponse` has been removed -- Struct `DisksRevokeAccessResponse` has been removed -- Struct `DisksUpdatePoller` has been removed -- Struct `DisksUpdatePollerResponse` has been removed -- Struct `DisksUpdateResponse` has been removed -- Struct `DisksUpdateResult` has been removed -- Struct `GalleriesBeginCreateOrUpdateOptions` has been removed -- Struct `GalleriesBeginDeleteOptions` has been removed -- Struct `GalleriesBeginUpdateOptions` has been removed -- Struct `GalleriesCreateOrUpdatePoller` has been removed -- Struct `GalleriesCreateOrUpdatePollerResponse` has been removed -- Struct `GalleriesCreateOrUpdateResponse` has been removed -- Struct `GalleriesCreateOrUpdateResult` has been removed -- Struct `GalleriesDeletePoller` has been removed -- Struct `GalleriesDeletePollerResponse` has been removed -- Struct `GalleriesDeleteResponse` has been removed -- Struct `GalleriesGetOptions` has been removed -- Struct `GalleriesGetResponse` has been removed -- Struct `GalleriesGetResult` has been removed -- Struct `GalleriesListByResourceGroupOptions` has been removed -- Struct `GalleriesListByResourceGroupPager` has been removed -- Struct `GalleriesListByResourceGroupResponse` has been removed -- Struct `GalleriesListByResourceGroupResult` has been removed -- Struct `GalleriesListOptions` has been removed -- Struct `GalleriesListPager` has been removed -- Struct `GalleriesListResponse` has been removed -- Struct `GalleriesListResult` has been removed -- Struct `GalleriesUpdatePoller` has been removed -- Struct `GalleriesUpdatePollerResponse` has been removed -- Struct `GalleriesUpdateResponse` has been removed -- Struct `GalleriesUpdateResult` has been removed -- Struct `GalleryApplicationVersionsBeginCreateOrUpdateOptions` has been removed -- Struct `GalleryApplicationVersionsBeginDeleteOptions` has been removed -- Struct `GalleryApplicationVersionsBeginUpdateOptions` has been removed -- Struct `GalleryApplicationVersionsCreateOrUpdatePoller` has been removed -- Struct `GalleryApplicationVersionsCreateOrUpdatePollerResponse` has been removed -- Struct `GalleryApplicationVersionsCreateOrUpdateResponse` has been removed -- Struct `GalleryApplicationVersionsCreateOrUpdateResult` has been removed -- Struct `GalleryApplicationVersionsDeletePoller` has been removed -- Struct `GalleryApplicationVersionsDeletePollerResponse` has been removed -- Struct `GalleryApplicationVersionsDeleteResponse` has been removed -- Struct `GalleryApplicationVersionsGetOptions` has been removed -- Struct `GalleryApplicationVersionsGetResponse` has been removed -- Struct `GalleryApplicationVersionsGetResult` has been removed -- Struct `GalleryApplicationVersionsListByGalleryApplicationOptions` has been removed -- Struct `GalleryApplicationVersionsListByGalleryApplicationPager` has been removed -- Struct `GalleryApplicationVersionsListByGalleryApplicationResponse` has been removed -- Struct `GalleryApplicationVersionsListByGalleryApplicationResult` has been removed -- Struct `GalleryApplicationVersionsUpdatePoller` has been removed -- Struct `GalleryApplicationVersionsUpdatePollerResponse` has been removed -- Struct `GalleryApplicationVersionsUpdateResponse` has been removed -- Struct `GalleryApplicationVersionsUpdateResult` has been removed -- Struct `GalleryApplicationsBeginCreateOrUpdateOptions` has been removed -- Struct `GalleryApplicationsBeginDeleteOptions` has been removed -- Struct `GalleryApplicationsBeginUpdateOptions` has been removed -- Struct `GalleryApplicationsCreateOrUpdatePoller` has been removed -- Struct `GalleryApplicationsCreateOrUpdatePollerResponse` has been removed -- Struct `GalleryApplicationsCreateOrUpdateResponse` has been removed -- Struct `GalleryApplicationsCreateOrUpdateResult` has been removed -- Struct `GalleryApplicationsDeletePoller` has been removed -- Struct `GalleryApplicationsDeletePollerResponse` has been removed -- Struct `GalleryApplicationsDeleteResponse` has been removed -- Struct `GalleryApplicationsGetOptions` has been removed -- Struct `GalleryApplicationsGetResponse` has been removed -- Struct `GalleryApplicationsGetResult` has been removed -- Struct `GalleryApplicationsListByGalleryOptions` has been removed -- Struct `GalleryApplicationsListByGalleryPager` has been removed -- Struct `GalleryApplicationsListByGalleryResponse` has been removed -- Struct `GalleryApplicationsListByGalleryResult` has been removed -- Struct `GalleryApplicationsUpdatePoller` has been removed -- Struct `GalleryApplicationsUpdatePollerResponse` has been removed -- Struct `GalleryApplicationsUpdateResponse` has been removed -- Struct `GalleryApplicationsUpdateResult` has been removed -- Struct `GalleryImageVersionsBeginCreateOrUpdateOptions` has been removed -- Struct `GalleryImageVersionsBeginDeleteOptions` has been removed -- Struct `GalleryImageVersionsBeginUpdateOptions` has been removed -- Struct `GalleryImageVersionsCreateOrUpdatePoller` has been removed -- Struct `GalleryImageVersionsCreateOrUpdatePollerResponse` has been removed -- Struct `GalleryImageVersionsCreateOrUpdateResponse` has been removed -- Struct `GalleryImageVersionsCreateOrUpdateResult` has been removed -- Struct `GalleryImageVersionsDeletePoller` has been removed -- Struct `GalleryImageVersionsDeletePollerResponse` has been removed -- Struct `GalleryImageVersionsDeleteResponse` has been removed -- Struct `GalleryImageVersionsGetOptions` has been removed -- Struct `GalleryImageVersionsGetResponse` has been removed -- Struct `GalleryImageVersionsGetResult` has been removed -- Struct `GalleryImageVersionsListByGalleryImageOptions` has been removed -- Struct `GalleryImageVersionsListByGalleryImagePager` has been removed -- Struct `GalleryImageVersionsListByGalleryImageResponse` has been removed -- Struct `GalleryImageVersionsListByGalleryImageResult` has been removed -- Struct `GalleryImageVersionsUpdatePoller` has been removed -- Struct `GalleryImageVersionsUpdatePollerResponse` has been removed -- Struct `GalleryImageVersionsUpdateResponse` has been removed -- Struct `GalleryImageVersionsUpdateResult` has been removed -- Struct `GalleryImagesBeginCreateOrUpdateOptions` has been removed -- Struct `GalleryImagesBeginDeleteOptions` has been removed -- Struct `GalleryImagesBeginUpdateOptions` has been removed -- Struct `GalleryImagesCreateOrUpdatePoller` has been removed -- Struct `GalleryImagesCreateOrUpdatePollerResponse` has been removed -- Struct `GalleryImagesCreateOrUpdateResponse` has been removed -- Struct `GalleryImagesCreateOrUpdateResult` has been removed -- Struct `GalleryImagesDeletePoller` has been removed -- Struct `GalleryImagesDeletePollerResponse` has been removed -- Struct `GalleryImagesDeleteResponse` has been removed -- Struct `GalleryImagesGetOptions` has been removed -- Struct `GalleryImagesGetResponse` has been removed -- Struct `GalleryImagesGetResult` has been removed -- Struct `GalleryImagesListByGalleryOptions` has been removed -- Struct `GalleryImagesListByGalleryPager` has been removed -- Struct `GalleryImagesListByGalleryResponse` has been removed -- Struct `GalleryImagesListByGalleryResult` has been removed -- Struct `GalleryImagesUpdatePoller` has been removed -- Struct `GalleryImagesUpdatePollerResponse` has been removed -- Struct `GalleryImagesUpdateResponse` has been removed -- Struct `GalleryImagesUpdateResult` has been removed -- Struct `GallerySharingProfileBeginUpdateOptions` has been removed -- Struct `GallerySharingProfileUpdatePoller` has been removed -- Struct `GallerySharingProfileUpdatePollerResponse` has been removed -- Struct `GallerySharingProfileUpdateResponse` has been removed -- Struct `GallerySharingProfileUpdateResult` has been removed -- Struct `ImagesBeginCreateOrUpdateOptions` has been removed -- Struct `ImagesBeginDeleteOptions` has been removed -- Struct `ImagesBeginUpdateOptions` has been removed -- Struct `ImagesCreateOrUpdatePoller` has been removed -- Struct `ImagesCreateOrUpdatePollerResponse` has been removed -- Struct `ImagesCreateOrUpdateResponse` has been removed -- Struct `ImagesCreateOrUpdateResult` has been removed -- Struct `ImagesDeletePoller` has been removed -- Struct `ImagesDeletePollerResponse` has been removed -- Struct `ImagesDeleteResponse` has been removed -- Struct `ImagesGetOptions` has been removed -- Struct `ImagesGetResponse` has been removed -- Struct `ImagesGetResult` has been removed -- Struct `ImagesListByResourceGroupOptions` has been removed -- Struct `ImagesListByResourceGroupPager` has been removed -- Struct `ImagesListByResourceGroupResponse` has been removed -- Struct `ImagesListByResourceGroupResult` has been removed -- Struct `ImagesListOptions` has been removed -- Struct `ImagesListPager` has been removed -- Struct `ImagesListResponse` has been removed -- Struct `ImagesListResult` has been removed -- Struct `ImagesUpdatePoller` has been removed -- Struct `ImagesUpdatePollerResponse` has been removed -- Struct `ImagesUpdateResponse` has been removed -- Struct `ImagesUpdateResult` has been removed -- Struct `LogAnalyticsBeginExportRequestRateByIntervalOptions` has been removed -- Struct `LogAnalyticsBeginExportThrottledRequestsOptions` has been removed -- Struct `LogAnalyticsExportRequestRateByIntervalPoller` has been removed -- Struct `LogAnalyticsExportRequestRateByIntervalPollerResponse` has been removed -- Struct `LogAnalyticsExportRequestRateByIntervalResponse` has been removed -- Struct `LogAnalyticsExportRequestRateByIntervalResult` has been removed -- Struct `LogAnalyticsExportThrottledRequestsPoller` has been removed -- Struct `LogAnalyticsExportThrottledRequestsPollerResponse` has been removed -- Struct `LogAnalyticsExportThrottledRequestsResponse` has been removed -- Struct `LogAnalyticsExportThrottledRequestsResult` has been removed -- Struct `OperationsListOptions` has been removed -- Struct `OperationsListResponse` has been removed -- Struct `OperationsListResult` has been removed -- Struct `ProximityPlacementGroupsCreateOrUpdateOptions` has been removed -- Struct `ProximityPlacementGroupsCreateOrUpdateResponse` has been removed -- Struct `ProximityPlacementGroupsCreateOrUpdateResult` has been removed -- Struct `ProximityPlacementGroupsDeleteOptions` has been removed -- Struct `ProximityPlacementGroupsDeleteResponse` has been removed -- Struct `ProximityPlacementGroupsGetOptions` has been removed -- Struct `ProximityPlacementGroupsGetResponse` has been removed -- Struct `ProximityPlacementGroupsGetResult` has been removed -- Struct `ProximityPlacementGroupsListByResourceGroupOptions` has been removed -- Struct `ProximityPlacementGroupsListByResourceGroupPager` has been removed -- Struct `ProximityPlacementGroupsListByResourceGroupResponse` has been removed -- Struct `ProximityPlacementGroupsListByResourceGroupResult` has been removed -- Struct `ProximityPlacementGroupsListBySubscriptionOptions` has been removed -- Struct `ProximityPlacementGroupsListBySubscriptionPager` has been removed -- Struct `ProximityPlacementGroupsListBySubscriptionResponse` has been removed -- Struct `ProximityPlacementGroupsListBySubscriptionResult` has been removed -- Struct `ProximityPlacementGroupsUpdateOptions` has been removed -- Struct `ProximityPlacementGroupsUpdateResponse` has been removed -- Struct `ProximityPlacementGroupsUpdateResult` has been removed -- Struct `ResourceSKUsListOptions` has been removed -- Struct `ResourceSKUsListPager` has been removed -- Struct `ResourceSKUsListResponse` has been removed -- Struct `ResourceSKUsListResult` has been removed -- Struct `RestorePointCollectionsBeginDeleteOptions` has been removed -- Struct `RestorePointCollectionsCreateOrUpdateOptions` has been removed -- Struct `RestorePointCollectionsCreateOrUpdateResponse` has been removed -- Struct `RestorePointCollectionsCreateOrUpdateResult` has been removed -- Struct `RestorePointCollectionsDeletePoller` has been removed -- Struct `RestorePointCollectionsDeletePollerResponse` has been removed -- Struct `RestorePointCollectionsDeleteResponse` has been removed -- Struct `RestorePointCollectionsGetOptions` has been removed -- Struct `RestorePointCollectionsGetResponse` has been removed -- Struct `RestorePointCollectionsGetResult` has been removed -- Struct `RestorePointCollectionsListAllOptions` has been removed -- Struct `RestorePointCollectionsListAllPager` has been removed -- Struct `RestorePointCollectionsListAllResponse` has been removed -- Struct `RestorePointCollectionsListAllResult` has been removed -- Struct `RestorePointCollectionsListOptions` has been removed -- Struct `RestorePointCollectionsListPager` has been removed -- Struct `RestorePointCollectionsListResponse` has been removed -- Struct `RestorePointCollectionsListResult` has been removed -- Struct `RestorePointCollectionsUpdateOptions` has been removed -- Struct `RestorePointCollectionsUpdateResponse` has been removed -- Struct `RestorePointCollectionsUpdateResult` has been removed -- Struct `RestorePointsBeginCreateOptions` has been removed -- Struct `RestorePointsBeginDeleteOptions` has been removed -- Struct `RestorePointsCreatePoller` has been removed -- Struct `RestorePointsCreatePollerResponse` has been removed -- Struct `RestorePointsCreateResponse` has been removed -- Struct `RestorePointsCreateResult` has been removed -- Struct `RestorePointsDeletePoller` has been removed -- Struct `RestorePointsDeletePollerResponse` has been removed -- Struct `RestorePointsDeleteResponse` has been removed -- Struct `RestorePointsGetOptions` has been removed -- Struct `RestorePointsGetResponse` has been removed -- Struct `RestorePointsGetResult` has been removed -- Struct `SSHPublicKeysCreateOptions` has been removed -- Struct `SSHPublicKeysCreateResponse` has been removed -- Struct `SSHPublicKeysCreateResult` has been removed -- Struct `SSHPublicKeysDeleteOptions` has been removed -- Struct `SSHPublicKeysDeleteResponse` has been removed -- Struct `SSHPublicKeysGenerateKeyPairOptions` has been removed -- Struct `SSHPublicKeysGenerateKeyPairResponse` has been removed -- Struct `SSHPublicKeysGenerateKeyPairResult` has been removed -- Struct `SSHPublicKeysGetOptions` has been removed -- Struct `SSHPublicKeysGetResponse` has been removed -- Struct `SSHPublicKeysGetResult` has been removed -- Struct `SSHPublicKeysListByResourceGroupOptions` has been removed -- Struct `SSHPublicKeysListByResourceGroupPager` has been removed -- Struct `SSHPublicKeysListByResourceGroupResponse` has been removed -- Struct `SSHPublicKeysListByResourceGroupResult` has been removed -- Struct `SSHPublicKeysListBySubscriptionOptions` has been removed -- Struct `SSHPublicKeysListBySubscriptionPager` has been removed -- Struct `SSHPublicKeysListBySubscriptionResponse` has been removed -- Struct `SSHPublicKeysListBySubscriptionResult` has been removed -- Struct `SSHPublicKeysUpdateOptions` has been removed -- Struct `SSHPublicKeysUpdateResponse` has been removed -- Struct `SSHPublicKeysUpdateResult` has been removed -- Struct `SharedGalleriesGetOptions` has been removed -- Struct `SharedGalleriesGetResponse` has been removed -- Struct `SharedGalleriesGetResult` has been removed -- Struct `SharedGalleriesListOptions` has been removed -- Struct `SharedGalleriesListPager` has been removed -- Struct `SharedGalleriesListResponse` has been removed -- Struct `SharedGalleriesListResult` has been removed -- Struct `SharedGalleryImageVersionsGetOptions` has been removed -- Struct `SharedGalleryImageVersionsGetResponse` has been removed -- Struct `SharedGalleryImageVersionsGetResult` has been removed -- Struct `SharedGalleryImageVersionsListOptions` has been removed -- Struct `SharedGalleryImageVersionsListPager` has been removed -- Struct `SharedGalleryImageVersionsListResponse` has been removed -- Struct `SharedGalleryImageVersionsListResult` has been removed -- Struct `SharedGalleryImagesGetOptions` has been removed -- Struct `SharedGalleryImagesGetResponse` has been removed -- Struct `SharedGalleryImagesGetResult` has been removed -- Struct `SharedGalleryImagesListOptions` has been removed -- Struct `SharedGalleryImagesListPager` has been removed -- Struct `SharedGalleryImagesListResponse` has been removed -- Struct `SharedGalleryImagesListResult` has been removed -- Struct `SnapshotsBeginCreateOrUpdateOptions` has been removed -- Struct `SnapshotsBeginDeleteOptions` has been removed -- Struct `SnapshotsBeginGrantAccessOptions` has been removed -- Struct `SnapshotsBeginRevokeAccessOptions` has been removed -- Struct `SnapshotsBeginUpdateOptions` has been removed -- Struct `SnapshotsCreateOrUpdatePoller` has been removed -- Struct `SnapshotsCreateOrUpdatePollerResponse` has been removed -- Struct `SnapshotsCreateOrUpdateResponse` has been removed -- Struct `SnapshotsCreateOrUpdateResult` has been removed -- Struct `SnapshotsDeletePoller` has been removed -- Struct `SnapshotsDeletePollerResponse` has been removed -- Struct `SnapshotsDeleteResponse` has been removed -- Struct `SnapshotsGetOptions` has been removed -- Struct `SnapshotsGetResponse` has been removed -- Struct `SnapshotsGetResult` has been removed -- Struct `SnapshotsGrantAccessPoller` has been removed -- Struct `SnapshotsGrantAccessPollerResponse` has been removed -- Struct `SnapshotsGrantAccessResponse` has been removed -- Struct `SnapshotsGrantAccessResult` has been removed -- Struct `SnapshotsListByResourceGroupOptions` has been removed -- Struct `SnapshotsListByResourceGroupPager` has been removed -- Struct `SnapshotsListByResourceGroupResponse` has been removed -- Struct `SnapshotsListByResourceGroupResult` has been removed -- Struct `SnapshotsListOptions` has been removed -- Struct `SnapshotsListPager` has been removed -- Struct `SnapshotsListResponse` has been removed -- Struct `SnapshotsListResult` has been removed -- Struct `SnapshotsRevokeAccessPoller` has been removed -- Struct `SnapshotsRevokeAccessPollerResponse` has been removed -- Struct `SnapshotsRevokeAccessResponse` has been removed -- Struct `SnapshotsUpdatePoller` has been removed -- Struct `SnapshotsUpdatePollerResponse` has been removed -- Struct `SnapshotsUpdateResponse` has been removed -- Struct `SnapshotsUpdateResult` has been removed -- Struct `UsageListOptions` has been removed -- Struct `UsageListPager` has been removed -- Struct `UsageListResponse` has been removed -- Struct `UsageListResult` has been removed -- Struct `VirtualMachineExtensionImagesGetOptions` has been removed -- Struct `VirtualMachineExtensionImagesGetResponse` has been removed -- Struct `VirtualMachineExtensionImagesGetResult` has been removed -- Struct `VirtualMachineExtensionImagesListTypesOptions` has been removed -- Struct `VirtualMachineExtensionImagesListTypesResponse` has been removed -- Struct `VirtualMachineExtensionImagesListTypesResult` has been removed -- Struct `VirtualMachineExtensionImagesListVersionsOptions` has been removed -- Struct `VirtualMachineExtensionImagesListVersionsResponse` has been removed -- Struct `VirtualMachineExtensionImagesListVersionsResult` has been removed -- Struct `VirtualMachineExtensionsBeginCreateOrUpdateOptions` has been removed -- Struct `VirtualMachineExtensionsBeginDeleteOptions` has been removed -- Struct `VirtualMachineExtensionsBeginUpdateOptions` has been removed -- Struct `VirtualMachineExtensionsCreateOrUpdatePoller` has been removed -- Struct `VirtualMachineExtensionsCreateOrUpdatePollerResponse` has been removed -- Struct `VirtualMachineExtensionsCreateOrUpdateResponse` has been removed -- Struct `VirtualMachineExtensionsCreateOrUpdateResult` has been removed -- Struct `VirtualMachineExtensionsDeletePoller` has been removed -- Struct `VirtualMachineExtensionsDeletePollerResponse` has been removed -- Struct `VirtualMachineExtensionsDeleteResponse` has been removed -- Struct `VirtualMachineExtensionsGetOptions` has been removed -- Struct `VirtualMachineExtensionsGetResponse` has been removed -- Struct `VirtualMachineExtensionsGetResult` has been removed -- Struct `VirtualMachineExtensionsListOptions` has been removed -- Struct `VirtualMachineExtensionsListResponse` has been removed -- Struct `VirtualMachineExtensionsListResultEnvelope` has been removed -- Struct `VirtualMachineExtensionsUpdatePoller` has been removed -- Struct `VirtualMachineExtensionsUpdatePollerResponse` has been removed -- Struct `VirtualMachineExtensionsUpdateResponse` has been removed -- Struct `VirtualMachineExtensionsUpdateResult` has been removed -- Struct `VirtualMachineImagesEdgeZoneGetOptions` has been removed -- Struct `VirtualMachineImagesEdgeZoneGetResponse` has been removed -- Struct `VirtualMachineImagesEdgeZoneGetResult` has been removed -- Struct `VirtualMachineImagesEdgeZoneListOffersOptions` has been removed -- Struct `VirtualMachineImagesEdgeZoneListOffersResponse` has been removed -- Struct `VirtualMachineImagesEdgeZoneListOffersResult` has been removed -- Struct `VirtualMachineImagesEdgeZoneListOptions` has been removed -- Struct `VirtualMachineImagesEdgeZoneListPublishersOptions` has been removed -- Struct `VirtualMachineImagesEdgeZoneListPublishersResponse` has been removed -- Struct `VirtualMachineImagesEdgeZoneListPublishersResult` has been removed -- Struct `VirtualMachineImagesEdgeZoneListResponse` has been removed -- Struct `VirtualMachineImagesEdgeZoneListResult` has been removed -- Struct `VirtualMachineImagesEdgeZoneListSKUsOptions` has been removed -- Struct `VirtualMachineImagesEdgeZoneListSKUsResponse` has been removed -- Struct `VirtualMachineImagesEdgeZoneListSKUsResult` has been removed -- Struct `VirtualMachineImagesGetOptions` has been removed -- Struct `VirtualMachineImagesGetResponse` has been removed -- Struct `VirtualMachineImagesGetResult` has been removed -- Struct `VirtualMachineImagesListOffersOptions` has been removed -- Struct `VirtualMachineImagesListOffersResponse` has been removed -- Struct `VirtualMachineImagesListOffersResult` has been removed -- Struct `VirtualMachineImagesListOptions` has been removed -- Struct `VirtualMachineImagesListPublishersOptions` has been removed -- Struct `VirtualMachineImagesListPublishersResponse` has been removed -- Struct `VirtualMachineImagesListPublishersResult` has been removed -- Struct `VirtualMachineImagesListResponse` has been removed -- Struct `VirtualMachineImagesListResult` has been removed -- Struct `VirtualMachineImagesListSKUsOptions` has been removed -- Struct `VirtualMachineImagesListSKUsResponse` has been removed -- Struct `VirtualMachineImagesListSKUsResult` has been removed -- Struct `VirtualMachineRunCommandsBeginCreateOrUpdateOptions` has been removed -- Struct `VirtualMachineRunCommandsBeginDeleteOptions` has been removed -- Struct `VirtualMachineRunCommandsBeginUpdateOptions` has been removed -- Struct `VirtualMachineRunCommandsCreateOrUpdatePoller` has been removed -- Struct `VirtualMachineRunCommandsCreateOrUpdatePollerResponse` has been removed -- Struct `VirtualMachineRunCommandsCreateOrUpdateResponse` has been removed -- Struct `VirtualMachineRunCommandsCreateOrUpdateResult` has been removed -- Struct `VirtualMachineRunCommandsDeletePoller` has been removed -- Struct `VirtualMachineRunCommandsDeletePollerResponse` has been removed -- Struct `VirtualMachineRunCommandsDeleteResponse` has been removed -- Struct `VirtualMachineRunCommandsGetByVirtualMachineOptions` has been removed -- Struct `VirtualMachineRunCommandsGetByVirtualMachineResponse` has been removed -- Struct `VirtualMachineRunCommandsGetByVirtualMachineResult` has been removed -- Struct `VirtualMachineRunCommandsGetOptions` has been removed -- Struct `VirtualMachineRunCommandsGetResponse` has been removed -- Struct `VirtualMachineRunCommandsGetResult` has been removed -- Struct `VirtualMachineRunCommandsListByVirtualMachineOptions` has been removed -- Struct `VirtualMachineRunCommandsListByVirtualMachinePager` has been removed -- Struct `VirtualMachineRunCommandsListByVirtualMachineResponse` has been removed -- Struct `VirtualMachineRunCommandsListByVirtualMachineResult` has been removed -- Struct `VirtualMachineRunCommandsListOptions` has been removed -- Struct `VirtualMachineRunCommandsListPager` has been removed -- Struct `VirtualMachineRunCommandsListResponse` has been removed -- Struct `VirtualMachineRunCommandsListResultEnvelope` has been removed -- Struct `VirtualMachineRunCommandsUpdatePoller` has been removed -- Struct `VirtualMachineRunCommandsUpdatePollerResponse` has been removed -- Struct `VirtualMachineRunCommandsUpdateResponse` has been removed -- Struct `VirtualMachineRunCommandsUpdateResult` has been removed -- Struct `VirtualMachineScaleSetExtensionsBeginCreateOrUpdateOptions` has been removed -- Struct `VirtualMachineScaleSetExtensionsBeginDeleteOptions` has been removed -- Struct `VirtualMachineScaleSetExtensionsBeginUpdateOptions` has been removed -- Struct `VirtualMachineScaleSetExtensionsCreateOrUpdatePoller` has been removed -- Struct `VirtualMachineScaleSetExtensionsCreateOrUpdatePollerResponse` has been removed -- Struct `VirtualMachineScaleSetExtensionsCreateOrUpdateResponse` has been removed -- Struct `VirtualMachineScaleSetExtensionsCreateOrUpdateResult` has been removed -- Struct `VirtualMachineScaleSetExtensionsDeletePoller` has been removed -- Struct `VirtualMachineScaleSetExtensionsDeletePollerResponse` has been removed -- Struct `VirtualMachineScaleSetExtensionsDeleteResponse` has been removed -- Struct `VirtualMachineScaleSetExtensionsGetOptions` has been removed -- Struct `VirtualMachineScaleSetExtensionsGetResponse` has been removed -- Struct `VirtualMachineScaleSetExtensionsGetResult` has been removed -- Struct `VirtualMachineScaleSetExtensionsListOptions` has been removed -- Struct `VirtualMachineScaleSetExtensionsListPager` has been removed -- Struct `VirtualMachineScaleSetExtensionsListResponse` has been removed -- Struct `VirtualMachineScaleSetExtensionsListResult` has been removed -- Struct `VirtualMachineScaleSetExtensionsUpdatePoller` has been removed -- Struct `VirtualMachineScaleSetExtensionsUpdatePollerResponse` has been removed -- Struct `VirtualMachineScaleSetExtensionsUpdateResponse` has been removed -- Struct `VirtualMachineScaleSetExtensionsUpdateResult` has been removed -- Struct `VirtualMachineScaleSetRollingUpgradesBeginCancelOptions` has been removed -- Struct `VirtualMachineScaleSetRollingUpgradesBeginStartExtensionUpgradeOptions` has been removed -- Struct `VirtualMachineScaleSetRollingUpgradesBeginStartOSUpgradeOptions` has been removed -- Struct `VirtualMachineScaleSetRollingUpgradesCancelPoller` has been removed -- Struct `VirtualMachineScaleSetRollingUpgradesCancelPollerResponse` has been removed -- Struct `VirtualMachineScaleSetRollingUpgradesCancelResponse` has been removed -- Struct `VirtualMachineScaleSetRollingUpgradesGetLatestOptions` has been removed -- Struct `VirtualMachineScaleSetRollingUpgradesGetLatestResponse` has been removed -- Struct `VirtualMachineScaleSetRollingUpgradesGetLatestResult` has been removed -- Struct `VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradePoller` has been removed -- Struct `VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradePollerResponse` has been removed -- Struct `VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeResponse` has been removed -- Struct `VirtualMachineScaleSetRollingUpgradesStartOSUpgradePoller` has been removed -- Struct `VirtualMachineScaleSetRollingUpgradesStartOSUpgradePollerResponse` has been removed -- Struct `VirtualMachineScaleSetRollingUpgradesStartOSUpgradeResponse` has been removed -- Struct `VirtualMachineScaleSetVMExtensionsBeginCreateOrUpdateOptions` has been removed -- Struct `VirtualMachineScaleSetVMExtensionsBeginDeleteOptions` has been removed -- Struct `VirtualMachineScaleSetVMExtensionsBeginUpdateOptions` has been removed -- Struct `VirtualMachineScaleSetVMExtensionsCreateOrUpdatePoller` has been removed -- Struct `VirtualMachineScaleSetVMExtensionsCreateOrUpdatePollerResponse` has been removed -- Struct `VirtualMachineScaleSetVMExtensionsCreateOrUpdateResponse` has been removed -- Struct `VirtualMachineScaleSetVMExtensionsCreateOrUpdateResult` has been removed -- Struct `VirtualMachineScaleSetVMExtensionsDeletePoller` has been removed -- Struct `VirtualMachineScaleSetVMExtensionsDeletePollerResponse` has been removed -- Struct `VirtualMachineScaleSetVMExtensionsDeleteResponse` has been removed -- Struct `VirtualMachineScaleSetVMExtensionsGetOptions` has been removed -- Struct `VirtualMachineScaleSetVMExtensionsGetResponse` has been removed -- Struct `VirtualMachineScaleSetVMExtensionsGetResult` has been removed -- Struct `VirtualMachineScaleSetVMExtensionsListOptions` has been removed -- Struct `VirtualMachineScaleSetVMExtensionsListResponse` has been removed -- Struct `VirtualMachineScaleSetVMExtensionsListResultEnvelope` has been removed -- Struct `VirtualMachineScaleSetVMExtensionsUpdatePoller` has been removed -- Struct `VirtualMachineScaleSetVMExtensionsUpdatePollerResponse` has been removed -- Struct `VirtualMachineScaleSetVMExtensionsUpdateResponse` has been removed -- Struct `VirtualMachineScaleSetVMExtensionsUpdateResult` has been removed -- Struct `VirtualMachineScaleSetVMRunCommandsBeginCreateOrUpdateOptions` has been removed -- Struct `VirtualMachineScaleSetVMRunCommandsBeginDeleteOptions` has been removed -- Struct `VirtualMachineScaleSetVMRunCommandsBeginUpdateOptions` has been removed -- Struct `VirtualMachineScaleSetVMRunCommandsCreateOrUpdatePoller` has been removed -- Struct `VirtualMachineScaleSetVMRunCommandsCreateOrUpdatePollerResponse` has been removed -- Struct `VirtualMachineScaleSetVMRunCommandsCreateOrUpdateResponse` has been removed -- Struct `VirtualMachineScaleSetVMRunCommandsCreateOrUpdateResult` has been removed -- Struct `VirtualMachineScaleSetVMRunCommandsDeletePoller` has been removed -- Struct `VirtualMachineScaleSetVMRunCommandsDeletePollerResponse` has been removed -- Struct `VirtualMachineScaleSetVMRunCommandsDeleteResponse` has been removed -- Struct `VirtualMachineScaleSetVMRunCommandsGetOptions` has been removed -- Struct `VirtualMachineScaleSetVMRunCommandsGetResponse` has been removed -- Struct `VirtualMachineScaleSetVMRunCommandsGetResult` has been removed -- Struct `VirtualMachineScaleSetVMRunCommandsListOptions` has been removed -- Struct `VirtualMachineScaleSetVMRunCommandsListPager` has been removed -- Struct `VirtualMachineScaleSetVMRunCommandsListResponse` has been removed -- Struct `VirtualMachineScaleSetVMRunCommandsListResult` has been removed -- Struct `VirtualMachineScaleSetVMRunCommandsUpdatePoller` has been removed -- Struct `VirtualMachineScaleSetVMRunCommandsUpdatePollerResponse` has been removed -- Struct `VirtualMachineScaleSetVMRunCommandsUpdateResponse` has been removed -- Struct `VirtualMachineScaleSetVMRunCommandsUpdateResult` has been removed -- Struct `VirtualMachineScaleSetVMsBeginDeallocateOptions` has been removed -- Struct `VirtualMachineScaleSetVMsBeginDeleteOptions` has been removed -- Struct `VirtualMachineScaleSetVMsBeginPerformMaintenanceOptions` has been removed -- Struct `VirtualMachineScaleSetVMsBeginPowerOffOptions` has been removed -- Struct `VirtualMachineScaleSetVMsBeginRedeployOptions` has been removed -- Struct `VirtualMachineScaleSetVMsBeginReimageAllOptions` has been removed -- Struct `VirtualMachineScaleSetVMsBeginReimageOptions` has been removed -- Struct `VirtualMachineScaleSetVMsBeginRestartOptions` has been removed -- Struct `VirtualMachineScaleSetVMsBeginRunCommandOptions` has been removed -- Struct `VirtualMachineScaleSetVMsBeginStartOptions` has been removed -- Struct `VirtualMachineScaleSetVMsBeginUpdateOptions` has been removed -- Struct `VirtualMachineScaleSetVMsDeallocatePoller` has been removed -- Struct `VirtualMachineScaleSetVMsDeallocatePollerResponse` has been removed -- Struct `VirtualMachineScaleSetVMsDeallocateResponse` has been removed -- Struct `VirtualMachineScaleSetVMsDeletePoller` has been removed -- Struct `VirtualMachineScaleSetVMsDeletePollerResponse` has been removed -- Struct `VirtualMachineScaleSetVMsDeleteResponse` has been removed -- Struct `VirtualMachineScaleSetVMsGetInstanceViewOptions` has been removed -- Struct `VirtualMachineScaleSetVMsGetInstanceViewResponse` has been removed -- Struct `VirtualMachineScaleSetVMsGetInstanceViewResult` has been removed -- Struct `VirtualMachineScaleSetVMsGetOptions` has been removed -- Struct `VirtualMachineScaleSetVMsGetResponse` has been removed -- Struct `VirtualMachineScaleSetVMsGetResult` has been removed -- Struct `VirtualMachineScaleSetVMsListOptions` has been removed -- Struct `VirtualMachineScaleSetVMsListPager` has been removed -- Struct `VirtualMachineScaleSetVMsListResponse` has been removed -- Struct `VirtualMachineScaleSetVMsListResult` has been removed -- Struct `VirtualMachineScaleSetVMsPerformMaintenancePoller` has been removed -- Struct `VirtualMachineScaleSetVMsPerformMaintenancePollerResponse` has been removed -- Struct `VirtualMachineScaleSetVMsPerformMaintenanceResponse` has been removed -- Struct `VirtualMachineScaleSetVMsPowerOffPoller` has been removed -- Struct `VirtualMachineScaleSetVMsPowerOffPollerResponse` has been removed -- Struct `VirtualMachineScaleSetVMsPowerOffResponse` has been removed -- Struct `VirtualMachineScaleSetVMsRedeployPoller` has been removed -- Struct `VirtualMachineScaleSetVMsRedeployPollerResponse` has been removed -- Struct `VirtualMachineScaleSetVMsRedeployResponse` has been removed -- Struct `VirtualMachineScaleSetVMsReimageAllPoller` has been removed -- Struct `VirtualMachineScaleSetVMsReimageAllPollerResponse` has been removed -- Struct `VirtualMachineScaleSetVMsReimageAllResponse` has been removed -- Struct `VirtualMachineScaleSetVMsReimagePoller` has been removed -- Struct `VirtualMachineScaleSetVMsReimagePollerResponse` has been removed -- Struct `VirtualMachineScaleSetVMsReimageResponse` has been removed -- Struct `VirtualMachineScaleSetVMsRestartPoller` has been removed -- Struct `VirtualMachineScaleSetVMsRestartPollerResponse` has been removed -- Struct `VirtualMachineScaleSetVMsRestartResponse` has been removed -- Struct `VirtualMachineScaleSetVMsRetrieveBootDiagnosticsDataOptions` has been removed -- Struct `VirtualMachineScaleSetVMsRetrieveBootDiagnosticsDataResponse` has been removed -- Struct `VirtualMachineScaleSetVMsRetrieveBootDiagnosticsDataResult` has been removed -- Struct `VirtualMachineScaleSetVMsRunCommandPoller` has been removed -- Struct `VirtualMachineScaleSetVMsRunCommandPollerResponse` has been removed -- Struct `VirtualMachineScaleSetVMsRunCommandResponse` has been removed -- Struct `VirtualMachineScaleSetVMsRunCommandResult` has been removed -- Struct `VirtualMachineScaleSetVMsSimulateEvictionOptions` has been removed -- Struct `VirtualMachineScaleSetVMsSimulateEvictionResponse` has been removed -- Struct `VirtualMachineScaleSetVMsStartPoller` has been removed -- Struct `VirtualMachineScaleSetVMsStartPollerResponse` has been removed -- Struct `VirtualMachineScaleSetVMsStartResponse` has been removed -- Struct `VirtualMachineScaleSetVMsUpdatePoller` has been removed -- Struct `VirtualMachineScaleSetVMsUpdatePollerResponse` has been removed -- Struct `VirtualMachineScaleSetVMsUpdateResponse` has been removed -- Struct `VirtualMachineScaleSetVMsUpdateResult` has been removed -- Struct `VirtualMachineScaleSetsBeginCreateOrUpdateOptions` has been removed -- Struct `VirtualMachineScaleSetsBeginDeallocateOptions` has been removed -- Struct `VirtualMachineScaleSetsBeginDeleteInstancesOptions` has been removed -- Struct `VirtualMachineScaleSetsBeginDeleteOptions` has been removed -- Struct `VirtualMachineScaleSetsBeginPerformMaintenanceOptions` has been removed -- Struct `VirtualMachineScaleSetsBeginPowerOffOptions` has been removed -- Struct `VirtualMachineScaleSetsBeginRedeployOptions` has been removed -- Struct `VirtualMachineScaleSetsBeginReimageAllOptions` has been removed -- Struct `VirtualMachineScaleSetsBeginReimageOptions` has been removed -- Struct `VirtualMachineScaleSetsBeginRestartOptions` has been removed -- Struct `VirtualMachineScaleSetsBeginSetOrchestrationServiceStateOptions` has been removed -- Struct `VirtualMachineScaleSetsBeginStartOptions` has been removed -- Struct `VirtualMachineScaleSetsBeginUpdateInstancesOptions` has been removed -- Struct `VirtualMachineScaleSetsBeginUpdateOptions` has been removed -- Struct `VirtualMachineScaleSetsConvertToSinglePlacementGroupOptions` has been removed -- Struct `VirtualMachineScaleSetsConvertToSinglePlacementGroupResponse` has been removed -- Struct `VirtualMachineScaleSetsCreateOrUpdatePoller` has been removed -- Struct `VirtualMachineScaleSetsCreateOrUpdatePollerResponse` has been removed -- Struct `VirtualMachineScaleSetsCreateOrUpdateResponse` has been removed -- Struct `VirtualMachineScaleSetsCreateOrUpdateResult` has been removed -- Struct `VirtualMachineScaleSetsDeallocatePoller` has been removed -- Struct `VirtualMachineScaleSetsDeallocatePollerResponse` has been removed -- Struct `VirtualMachineScaleSetsDeallocateResponse` has been removed -- Struct `VirtualMachineScaleSetsDeleteInstancesPoller` has been removed -- Struct `VirtualMachineScaleSetsDeleteInstancesPollerResponse` has been removed -- Struct `VirtualMachineScaleSetsDeleteInstancesResponse` has been removed -- Struct `VirtualMachineScaleSetsDeletePoller` has been removed -- Struct `VirtualMachineScaleSetsDeletePollerResponse` has been removed -- Struct `VirtualMachineScaleSetsDeleteResponse` has been removed -- Struct `VirtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkOptions` has been removed -- Struct `VirtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkResponse` has been removed -- Struct `VirtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkResult` has been removed -- Struct `VirtualMachineScaleSetsGetInstanceViewOptions` has been removed -- Struct `VirtualMachineScaleSetsGetInstanceViewResponse` has been removed -- Struct `VirtualMachineScaleSetsGetInstanceViewResult` has been removed -- Struct `VirtualMachineScaleSetsGetOSUpgradeHistoryOptions` has been removed -- Struct `VirtualMachineScaleSetsGetOSUpgradeHistoryPager` has been removed -- Struct `VirtualMachineScaleSetsGetOSUpgradeHistoryResponse` has been removed -- Struct `VirtualMachineScaleSetsGetOSUpgradeHistoryResult` has been removed -- Struct `VirtualMachineScaleSetsGetOptions` has been removed -- Struct `VirtualMachineScaleSetsGetResponse` has been removed -- Struct `VirtualMachineScaleSetsGetResult` has been removed -- Struct `VirtualMachineScaleSetsListAllOptions` has been removed -- Struct `VirtualMachineScaleSetsListAllPager` has been removed -- Struct `VirtualMachineScaleSetsListAllResponse` has been removed -- Struct `VirtualMachineScaleSetsListAllResult` has been removed -- Struct `VirtualMachineScaleSetsListByLocationOptions` has been removed -- Struct `VirtualMachineScaleSetsListByLocationPager` has been removed -- Struct `VirtualMachineScaleSetsListByLocationResponse` has been removed -- Struct `VirtualMachineScaleSetsListByLocationResult` has been removed -- Struct `VirtualMachineScaleSetsListOptions` has been removed -- Struct `VirtualMachineScaleSetsListPager` has been removed -- Struct `VirtualMachineScaleSetsListResponse` has been removed -- Struct `VirtualMachineScaleSetsListResult` has been removed -- Struct `VirtualMachineScaleSetsListSKUsOptions` has been removed -- Struct `VirtualMachineScaleSetsListSKUsPager` has been removed -- Struct `VirtualMachineScaleSetsListSKUsResponse` has been removed -- Struct `VirtualMachineScaleSetsListSKUsResult` has been removed -- Struct `VirtualMachineScaleSetsPerformMaintenancePoller` has been removed -- Struct `VirtualMachineScaleSetsPerformMaintenancePollerResponse` has been removed -- Struct `VirtualMachineScaleSetsPerformMaintenanceResponse` has been removed -- Struct `VirtualMachineScaleSetsPowerOffPoller` has been removed -- Struct `VirtualMachineScaleSetsPowerOffPollerResponse` has been removed -- Struct `VirtualMachineScaleSetsPowerOffResponse` has been removed -- Struct `VirtualMachineScaleSetsRedeployPoller` has been removed -- Struct `VirtualMachineScaleSetsRedeployPollerResponse` has been removed -- Struct `VirtualMachineScaleSetsRedeployResponse` has been removed -- Struct `VirtualMachineScaleSetsReimageAllPoller` has been removed -- Struct `VirtualMachineScaleSetsReimageAllPollerResponse` has been removed -- Struct `VirtualMachineScaleSetsReimageAllResponse` has been removed -- Struct `VirtualMachineScaleSetsReimagePoller` has been removed -- Struct `VirtualMachineScaleSetsReimagePollerResponse` has been removed -- Struct `VirtualMachineScaleSetsReimageResponse` has been removed -- Struct `VirtualMachineScaleSetsRestartPoller` has been removed -- Struct `VirtualMachineScaleSetsRestartPollerResponse` has been removed -- Struct `VirtualMachineScaleSetsRestartResponse` has been removed -- Struct `VirtualMachineScaleSetsSetOrchestrationServiceStatePoller` has been removed -- Struct `VirtualMachineScaleSetsSetOrchestrationServiceStatePollerResponse` has been removed -- Struct `VirtualMachineScaleSetsSetOrchestrationServiceStateResponse` has been removed -- Struct `VirtualMachineScaleSetsStartPoller` has been removed -- Struct `VirtualMachineScaleSetsStartPollerResponse` has been removed -- Struct `VirtualMachineScaleSetsStartResponse` has been removed -- Struct `VirtualMachineScaleSetsUpdateInstancesPoller` has been removed -- Struct `VirtualMachineScaleSetsUpdateInstancesPollerResponse` has been removed -- Struct `VirtualMachineScaleSetsUpdateInstancesResponse` has been removed -- Struct `VirtualMachineScaleSetsUpdatePoller` has been removed -- Struct `VirtualMachineScaleSetsUpdatePollerResponse` has been removed -- Struct `VirtualMachineScaleSetsUpdateResponse` has been removed -- Struct `VirtualMachineScaleSetsUpdateResult` has been removed -- Struct `VirtualMachineSizesListOptions` has been removed -- Struct `VirtualMachineSizesListResponse` has been removed -- Struct `VirtualMachineSizesListResult` has been removed -- Struct `VirtualMachinesAssessPatchesPoller` has been removed -- Struct `VirtualMachinesAssessPatchesPollerResponse` has been removed -- Struct `VirtualMachinesAssessPatchesResponse` has been removed -- Struct `VirtualMachinesAssessPatchesResult` has been removed -- Struct `VirtualMachinesBeginAssessPatchesOptions` has been removed -- Struct `VirtualMachinesBeginCaptureOptions` has been removed -- Struct `VirtualMachinesBeginConvertToManagedDisksOptions` has been removed -- Struct `VirtualMachinesBeginCreateOrUpdateOptions` has been removed -- Struct `VirtualMachinesBeginDeallocateOptions` has been removed -- Struct `VirtualMachinesBeginDeleteOptions` has been removed -- Struct `VirtualMachinesBeginInstallPatchesOptions` has been removed -- Struct `VirtualMachinesBeginPerformMaintenanceOptions` has been removed -- Struct `VirtualMachinesBeginPowerOffOptions` has been removed -- Struct `VirtualMachinesBeginReapplyOptions` has been removed -- Struct `VirtualMachinesBeginRedeployOptions` has been removed -- Struct `VirtualMachinesBeginReimageOptions` has been removed -- Struct `VirtualMachinesBeginRestartOptions` has been removed -- Struct `VirtualMachinesBeginRunCommandOptions` has been removed -- Struct `VirtualMachinesBeginStartOptions` has been removed -- Struct `VirtualMachinesBeginUpdateOptions` has been removed -- Struct `VirtualMachinesCapturePoller` has been removed -- Struct `VirtualMachinesCapturePollerResponse` has been removed -- Struct `VirtualMachinesCaptureResponse` has been removed -- Struct `VirtualMachinesCaptureResult` has been removed -- Struct `VirtualMachinesConvertToManagedDisksPoller` has been removed -- Struct `VirtualMachinesConvertToManagedDisksPollerResponse` has been removed -- Struct `VirtualMachinesConvertToManagedDisksResponse` has been removed -- Struct `VirtualMachinesCreateOrUpdatePoller` has been removed -- Struct `VirtualMachinesCreateOrUpdatePollerResponse` has been removed -- Struct `VirtualMachinesCreateOrUpdateResponse` has been removed -- Struct `VirtualMachinesCreateOrUpdateResult` has been removed -- Struct `VirtualMachinesDeallocatePoller` has been removed -- Struct `VirtualMachinesDeallocatePollerResponse` has been removed -- Struct `VirtualMachinesDeallocateResponse` has been removed -- Struct `VirtualMachinesDeletePoller` has been removed -- Struct `VirtualMachinesDeletePollerResponse` has been removed -- Struct `VirtualMachinesDeleteResponse` has been removed -- Struct `VirtualMachinesGeneralizeOptions` has been removed -- Struct `VirtualMachinesGeneralizeResponse` has been removed -- Struct `VirtualMachinesGetOptions` has been removed -- Struct `VirtualMachinesGetResponse` has been removed -- Struct `VirtualMachinesGetResult` has been removed -- Struct `VirtualMachinesInstallPatchesPoller` has been removed -- Struct `VirtualMachinesInstallPatchesPollerResponse` has been removed -- Struct `VirtualMachinesInstallPatchesResponse` has been removed -- Struct `VirtualMachinesInstallPatchesResult` has been removed -- Struct `VirtualMachinesInstanceViewOptions` has been removed -- Struct `VirtualMachinesInstanceViewResponse` has been removed -- Struct `VirtualMachinesInstanceViewResult` has been removed -- Struct `VirtualMachinesListAllOptions` has been removed -- Struct `VirtualMachinesListAllPager` has been removed -- Struct `VirtualMachinesListAllResponse` has been removed -- Struct `VirtualMachinesListAllResult` has been removed -- Struct `VirtualMachinesListAvailableSizesOptions` has been removed -- Struct `VirtualMachinesListAvailableSizesResponse` has been removed -- Struct `VirtualMachinesListAvailableSizesResult` has been removed -- Struct `VirtualMachinesListByLocationOptions` has been removed -- Struct `VirtualMachinesListByLocationPager` has been removed -- Struct `VirtualMachinesListByLocationResponse` has been removed -- Struct `VirtualMachinesListByLocationResult` has been removed -- Struct `VirtualMachinesListOptions` has been removed -- Struct `VirtualMachinesListPager` has been removed -- Struct `VirtualMachinesListResponse` has been removed -- Struct `VirtualMachinesListResult` has been removed -- Struct `VirtualMachinesPerformMaintenancePoller` has been removed -- Struct `VirtualMachinesPerformMaintenancePollerResponse` has been removed -- Struct `VirtualMachinesPerformMaintenanceResponse` has been removed -- Struct `VirtualMachinesPowerOffPoller` has been removed -- Struct `VirtualMachinesPowerOffPollerResponse` has been removed -- Struct `VirtualMachinesPowerOffResponse` has been removed -- Struct `VirtualMachinesReapplyPoller` has been removed -- Struct `VirtualMachinesReapplyPollerResponse` has been removed -- Struct `VirtualMachinesReapplyResponse` has been removed -- Struct `VirtualMachinesRedeployPoller` has been removed -- Struct `VirtualMachinesRedeployPollerResponse` has been removed -- Struct `VirtualMachinesRedeployResponse` has been removed -- Struct `VirtualMachinesReimagePoller` has been removed -- Struct `VirtualMachinesReimagePollerResponse` has been removed -- Struct `VirtualMachinesReimageResponse` has been removed -- Struct `VirtualMachinesRestartPoller` has been removed -- Struct `VirtualMachinesRestartPollerResponse` has been removed -- Struct `VirtualMachinesRestartResponse` has been removed -- Struct `VirtualMachinesRetrieveBootDiagnosticsDataOptions` has been removed -- Struct `VirtualMachinesRetrieveBootDiagnosticsDataResponse` has been removed -- Struct `VirtualMachinesRetrieveBootDiagnosticsDataResult` has been removed -- Struct `VirtualMachinesRunCommandPoller` has been removed -- Struct `VirtualMachinesRunCommandPollerResponse` has been removed -- Struct `VirtualMachinesRunCommandResponse` has been removed -- Struct `VirtualMachinesRunCommandResult` has been removed -- Struct `VirtualMachinesSimulateEvictionOptions` has been removed -- Struct `VirtualMachinesSimulateEvictionResponse` has been removed -- Struct `VirtualMachinesStartPoller` has been removed -- Struct `VirtualMachinesStartPollerResponse` has been removed -- Struct `VirtualMachinesStartResponse` has been removed -- Struct `VirtualMachinesUpdatePoller` has been removed -- Struct `VirtualMachinesUpdatePollerResponse` has been removed -- Struct `VirtualMachinesUpdateResponse` has been removed -- Struct `VirtualMachinesUpdateResult` has been removed -- Field `GalleryDiskImage` of struct `GalleryDataDiskImage` has been removed -- Field `UpdateResource` of struct `DedicatedHostUpdate` has been removed -- Field `GalleryArtifactPublishingProfileBase` of struct `GalleryApplicationVersionPublishingProfile` has been removed -- Field `Resource` of struct `CapacityReservation` has been removed -- Field `SubResource` of struct `VirtualMachineScaleSetNetworkConfiguration` has been removed -- Field `Resource` of struct `Snapshot` has been removed -- Field `PirCommunityGalleryResource` of struct `CommunityGalleryImage` has been removed -- Field `UpdateResource` of struct `RestorePointCollectionUpdate` has been removed -- Field `DedicatedHostInstanceView` of struct `DedicatedHostInstanceViewWithName` has been removed -- Field `UpdateResource` of struct `AvailabilitySetUpdate` has been removed -- Field `Resource` of struct `SSHPublicKeyResource` has been removed -- Field `ProxyOnlyResource` of struct `DiskRestorePoint` has been removed -- Field `GalleryArtifactPublishingProfileBase` of struct `GalleryImageVersionPublishingProfile` has been removed -- Field `Resource` of struct `DedicatedHost` has been removed -- Field `PirCommunityGalleryResource` of struct `CommunityGallery` has been removed -- Field `Resource` of struct `Image` has been removed -- Field `UpdateResource` of struct `ProximityPlacementGroupUpdate` has been removed -- Field `Resource` of struct `GalleryImageVersion` has been removed -- Field `ImageDisk` of struct `ImageOSDisk` has been removed -- Field `UpdateResource` of struct `VirtualMachineRunCommandUpdate` has been removed -- Field `RunCommandDocumentBase` of struct `RunCommandDocument` has been removed -- Field `Resource` of struct `VirtualMachineRunCommand` has been removed -- Field `Resource` of struct `GalleryImage` has been removed -- Field `SubResource` of struct `SubResourceWithColocationStatus` has been removed -- Field `SubResource` of struct `VirtualMachineCaptureResult` has been removed -- Field `SubResource` of struct `ManagedDiskParameters` has been removed -- Field `UpdateResource` of struct `VirtualMachineUpdate` has been removed -- Field `UpdateResource` of struct `SSHPublicKeyUpdateResource` has been removed -- Field `Resource` of struct `DedicatedHostGroup` has been removed -- Field `VirtualMachineImageResource` of struct `VirtualMachineImage` has been removed -- Field `SubResource` of struct `DiskEncryptionSetParameters` has been removed -- Field `Resource` of struct `DiskEncryptionSet` has been removed -- Field `SubResourceReadOnly` of struct `VirtualMachineScaleSetExtensionUpdate` has been removed -- Field `UpdateResourceDefinition` of struct `GalleryUpdate` has been removed -- Field `Resource` of struct `VirtualMachineScaleSet` has been removed -- Field `UpdateResource` of struct `CapacityReservationGroupUpdate` has been removed -- Field `UpdateResourceDefinition` of struct `GalleryImageVersionUpdate` has been removed -- Field `ProxyResource` of struct `RestorePoint` has been removed -- Field `UpdateResourceDefinition` of struct `GalleryImageUpdate` has been removed -- Field `UpdateResource` of struct `VirtualMachineExtensionUpdate` has been removed -- Field `Resource` of struct `AvailabilitySet` has been removed -- Field `VirtualMachineReimageParameters` of struct `VirtualMachineScaleSetVMReimageParameters` has been removed -- Field `UpdateResource` of struct `VirtualMachineScaleSetUpdate` has been removed -- Field `Resource` of struct `RollingUpgradeStatusInfo` has been removed -- Field `DiskImageEncryption` of struct `OSDiskImageEncryption` has been removed -- Field `SubResource` of struct `ImageReference` has been removed -- Field `Resource` of struct `Gallery` has been removed -- Field `GalleryDiskImage` of struct `GalleryOSDiskImage` has been removed -- Field `PirResource` of struct `PirSharedGalleryResource` has been removed -- Field `Resource` of struct `GalleryApplicationVersion` has been removed -- Field `PirSharedGalleryResource` of struct `SharedGalleryImage` has been removed -- Field `UpdateResource` of struct `DedicatedHostGroupUpdate` has been removed -- Field `SubResourceReadOnly` of struct `VirtualMachineScaleSetVMExtension` has been removed -- Field `UpdateResource` of struct `ImageUpdate` has been removed -- Field `Resource` of struct `VirtualMachine` has been removed -- Field `Resource` of struct `CapacityReservationGroup` has been removed -- Field `UpdateResourceDefinition` of struct `GalleryApplicationVersionUpdate` has been removed -- Field `Resource` of struct `VirtualMachineExtensionImage` has been removed -- Field `UpdateResourceDefinition` of struct `GalleryApplicationUpdate` has been removed -- Field `SubResource` of struct `NetworkInterfaceReference` has been removed -- Field `SubResource` of struct `VirtualMachineScaleSetIPConfiguration` has been removed -- Field `InnerError` of struct `CloudError` has been removed -- Field `ImageDisk` of struct `ImageDataDisk` has been removed -- Field `Resource` of struct `RestorePointCollection` has been removed -- Field `Resource` of struct `DiskAccess` has been removed -- Field `Resource` of struct `VirtualMachineExtension` has been removed -- Field `Resource` of struct `VirtualMachineScaleSetVM` has been removed -- Field `LogAnalyticsInputBase` of struct `ThrottledRequestsInput` has been removed -- Field `SubResourceReadOnly` of struct `VirtualMachineScaleSetVMExtensionUpdate` has been removed -- Field `SubResource` of struct `VirtualMachineScaleSetUpdateNetworkConfiguration` has been removed -- Field `SubResource` of struct `VirtualMachineScaleSetUpdateIPConfiguration` has been removed -- Field `PirSharedGalleryResource` of struct `SharedGallery` has been removed -- Field `LogAnalyticsInputBase` of struct `RequestRateByIntervalInput` has been removed -- Field `DiskImageEncryption` of struct `DataDiskImageEncryption` has been removed -- Field `SubResource` of struct `VirtualMachineImageResource` has been removed -- Field `Resource` of struct `Disk` has been removed -- Field `PirSharedGalleryResource` of struct `SharedGalleryImageVersion` has been removed -- Field `PirCommunityGalleryResource` of struct `CommunityGalleryImageVersion` has been removed -- Field `VirtualMachineScaleSetVMReimageParameters` of struct `VirtualMachineScaleSetReimageParameters` has been removed -- Field `CapacityReservationInstanceView` of struct `CapacityReservationInstanceViewWithName` has been removed -- Field `Resource` of struct `ProximityPlacementGroup` has been removed -- Field `Resource` of struct `GalleryApplication` has been removed -- Field `SubResourceReadOnly` of struct `VirtualMachineScaleSetExtension` has been removed -- Field `UpdateResource` of struct `CapacityReservationUpdate` has been removed - -### Features Added - -- New const `DiskCreateOptionUploadPreparedSecure` -- New const `DiskSecurityTypesConfidentialVMVmguestStateOnlyEncryptedWithPlatformKey` -- New const `DiskEncryptionSetTypeConfidentialVMEncryptedWithCustomerKey` -- New const `DiskSecurityTypesConfidentialVMDiskEncryptedWithCustomerKey` -- New const `DiskSecurityTypesConfidentialVMDiskEncryptedWithPlatformKey` -- New const `DiskCreateOptionImportSecure` -- New function `*UsageClientListPager.PageResponse() UsageClientListResponse` -- New function `*VirtualMachineScaleSetRollingUpgradesClientStartExtensionUpgradePoller.FinalResponse(context.Context) (VirtualMachineScaleSetRollingUpgradesClientStartExtensionUpgradeResponse, error)` -- New function `*ProximityPlacementGroupsClientListBySubscriptionPager.NextPage(context.Context) bool` -- New function `*GalleryApplicationsClientCreateOrUpdatePoller.ResumeToken() (string, error)` -- New function `*DedicatedHostsClientListByHostGroupPager.PageResponse() DedicatedHostsClientListByHostGroupResponse` -- New function `*GallerySharingProfileClientUpdatePollerResponse.Resume(context.Context, *GallerySharingProfileClient, string) error` -- New function `*DiskEncryptionSetsClientDeletePollerResponse.Resume(context.Context, *DiskEncryptionSetsClient, string) error` -- New function `*VirtualMachineExtensionsClientDeletePoller.ResumeToken() (string, error)` -- New function `*GalleryImagesClientListByGalleryPager.NextPage(context.Context) bool` -- New function `*DisksClientGrantAccessPollerResponse.Resume(context.Context, *DisksClient, string) error` -- New function `*GalleryApplicationVersionsClientUpdatePoller.ResumeToken() (string, error)` -- New function `VirtualMachineScaleSetVMsClientPerformMaintenancePollerResponse.PollUntilDone(context.Context, time.Duration) (VirtualMachineScaleSetVMsClientPerformMaintenanceResponse, error)` -- New function `VirtualMachinesClientPowerOffPollerResponse.PollUntilDone(context.Context, time.Duration) (VirtualMachinesClientPowerOffResponse, error)` -- New function `*VirtualMachineScaleSetsClientListSKUsPager.NextPage(context.Context) bool` -- New function `*SnapshotsClientRevokeAccessPoller.Done() bool` -- New function `*VirtualMachineScaleSetExtensionsClientUpdatePollerResponse.Resume(context.Context, *VirtualMachineScaleSetExtensionsClient, string) error` -- New function `*GalleryApplicationsClientDeletePoller.ResumeToken() (string, error)` -- New function `*VirtualMachineScaleSetVMExtensionsClientUpdatePoller.ResumeToken() (string, error)` -- New function `*VirtualMachineRunCommandsClientListPager.NextPage(context.Context) bool` -- New function `*CloudServicesClientListAllPager.Err() error` -- New function `*UsageClientListPager.Err() error` -- New function `*ResourceSKUsClientListPager.Err() error` -- New function `*CloudServicesClientPowerOffPoller.ResumeToken() (string, error)` -- New function `*VirtualMachinesClientListByLocationPager.NextPage(context.Context) bool` -- New function `ImagesClientCreateOrUpdatePollerResponse.PollUntilDone(context.Context, time.Duration) (ImagesClientCreateOrUpdateResponse, error)` -- New function `*VirtualMachineScaleSetsClientListSKUsPager.PageResponse() VirtualMachineScaleSetsClientListSKUsResponse` -- New function `*VirtualMachineScaleSetRollingUpgradesClientStartOSUpgradePoller.FinalResponse(context.Context) (VirtualMachineScaleSetRollingUpgradesClientStartOSUpgradeResponse, error)` -- New function `*VirtualMachineScaleSetsClientUpdatePoller.ResumeToken() (string, error)` -- New function `*VirtualMachineScaleSetRollingUpgradesClientCancelPoller.Done() bool` -- New function `*UsageClientListPager.NextPage(context.Context) bool` -- New function `*VirtualMachinesClientCreateOrUpdatePoller.FinalResponse(context.Context) (VirtualMachinesClientCreateOrUpdateResponse, error)` -- New function `*CapacityReservationsClientUpdatePoller.Done() bool` -- New function `*GalleriesClientUpdatePoller.Poll(context.Context) (*http.Response, error)` -- New function `*CloudServicesClientUpdatePoller.Done() bool` -- New function `CloudServicesClientRebuildPollerResponse.PollUntilDone(context.Context, time.Duration) (CloudServicesClientRebuildResponse, error)` -- New function `*CloudServicesClientPowerOffPoller.Poll(context.Context) (*http.Response, error)` -- New function `*VirtualMachineScaleSetRollingUpgradesClientCancelPoller.ResumeToken() (string, error)` -- New function `*CloudServicesClientReimagePoller.ResumeToken() (string, error)` -- New function `*VirtualMachineScaleSetsClientPerformMaintenancePoller.Poll(context.Context) (*http.Response, error)` -- New function `*VirtualMachineScaleSetsClientListByLocationPager.Err() error` -- New function `*VirtualMachineScaleSetsClientCreateOrUpdatePoller.Done() bool` -- New function `*AvailabilitySetsClientListPager.PageResponse() AvailabilitySetsClientListResponse` -- New function `*GalleryImagesClientCreateOrUpdatePoller.FinalResponse(context.Context) (GalleryImagesClientCreateOrUpdateResponse, error)` -- New function `VirtualMachineScaleSetRollingUpgradesClientCancelPollerResponse.PollUntilDone(context.Context, time.Duration) (VirtualMachineScaleSetRollingUpgradesClientCancelResponse, error)` -- New function `*CapacityReservationsClientListByCapacityReservationGroupPager.PageResponse() CapacityReservationsClientListByCapacityReservationGroupResponse` -- New function `*CloudServiceRoleInstancesClientDeletePollerResponse.Resume(context.Context, *CloudServiceRoleInstancesClient, string) error` -- New function `CapacityReservationsClientDeletePollerResponse.PollUntilDone(context.Context, time.Duration) (CapacityReservationsClientDeleteResponse, error)` -- New function `*VirtualMachineScaleSetVMRunCommandsClientListPager.PageResponse() VirtualMachineScaleSetVMRunCommandsClientListResponse` -- New function `VirtualMachineScaleSetVMsClientRunCommandPollerResponse.PollUntilDone(context.Context, time.Duration) (VirtualMachineScaleSetVMsClientRunCommandResponse, error)` -- New function `*VirtualMachinesClientDeletePoller.FinalResponse(context.Context) (VirtualMachinesClientDeleteResponse, error)` -- New function `*DiskRestorePointClientGrantAccessPoller.FinalResponse(context.Context) (DiskRestorePointClientGrantAccessResponse, error)` -- New function `*CloudServicesUpdateDomainClientWalkUpdateDomainPollerResponse.Resume(context.Context, *CloudServicesUpdateDomainClient, string) error` -- New function `OperationListResult.MarshalJSON() ([]byte, error)` -- New function `*GalleriesClientUpdatePoller.ResumeToken() (string, error)` -- New function `*GallerySharingProfileClientUpdatePoller.Poll(context.Context) (*http.Response, error)` -- New function `*VirtualMachineScaleSetsClientDeleteInstancesPoller.FinalResponse(context.Context) (VirtualMachineScaleSetsClientDeleteInstancesResponse, error)` -- New function `*VirtualMachineExtensionsClientDeletePoller.Poll(context.Context) (*http.Response, error)` -- New function `*VirtualMachinesClientCapturePoller.Done() bool` -- New function `*CloudServicesClientCreateOrUpdatePoller.Poll(context.Context) (*http.Response, error)` -- New function `*VirtualMachineScaleSetVMExtensionsClientDeletePoller.Poll(context.Context) (*http.Response, error)` -- New function `*ImagesClientListByResourceGroupPager.Err() error` -- New function `*VirtualMachineScaleSetsClientSetOrchestrationServiceStatePollerResponse.Resume(context.Context, *VirtualMachineScaleSetsClient, string) error` -- New function `*DiskEncryptionSetsClientListAssociatedResourcesPager.PageResponse() DiskEncryptionSetsClientListAssociatedResourcesResponse` -- New function `*VirtualMachineScaleSetsClientGetOSUpgradeHistoryPager.PageResponse() VirtualMachineScaleSetsClientGetOSUpgradeHistoryResponse` -- New function `*ResourceSKUsClientListPager.NextPage(context.Context) bool` -- New function `*DiskAccessesClientUpdatePoller.Done() bool` -- New function `*CapacityReservationsClientDeletePoller.ResumeToken() (string, error)` -- New function `*GalleriesClientDeletePoller.Poll(context.Context) (*http.Response, error)` -- New function `DiskEncryptionSetsClientUpdatePollerResponse.PollUntilDone(context.Context, time.Duration) (DiskEncryptionSetsClientUpdateResponse, error)` -- New function `*DiskRestorePointClientRevokeAccessPoller.Done() bool` -- New function `VirtualMachinesClientRedeployPollerResponse.PollUntilDone(context.Context, time.Duration) (VirtualMachinesClientRedeployResponse, error)` -- New function `*VirtualMachinesClientRunCommandPoller.FinalResponse(context.Context) (VirtualMachinesClientRunCommandResponse, error)` -- New function `*SnapshotsClientDeletePoller.ResumeToken() (string, error)` -- New function `*DedicatedHostGroupsClientListBySubscriptionPager.PageResponse() DedicatedHostGroupsClientListBySubscriptionResponse` -- New function `*RestorePointCollectionsClientDeletePoller.Poll(context.Context) (*http.Response, error)` -- New function `VirtualMachineScaleSetVMExtensionsClientDeletePollerResponse.PollUntilDone(context.Context, time.Duration) (VirtualMachineScaleSetVMExtensionsClientDeleteResponse, error)` -- New function `*VirtualMachineScaleSetsClientStartPoller.Done() bool` -- New function `VirtualMachineScaleSetsClientReimageAllPollerResponse.PollUntilDone(context.Context, time.Duration) (VirtualMachineScaleSetsClientReimageAllResponse, error)` -- New function `*DedicatedHostsClientUpdatePoller.Poll(context.Context) (*http.Response, error)` -- New function `*VirtualMachineScaleSetsClientUpdateInstancesPollerResponse.Resume(context.Context, *VirtualMachineScaleSetsClient, string) error` -- New function `*RestorePointsClientCreatePoller.ResumeToken() (string, error)` -- New function `*VirtualMachineScaleSetsClientReimagePollerResponse.Resume(context.Context, *VirtualMachineScaleSetsClient, string) error` -- New function `*DiskEncryptionSetsClientUpdatePollerResponse.Resume(context.Context, *DiskEncryptionSetsClient, string) error` -- New function `*DisksClientDeletePoller.FinalResponse(context.Context) (DisksClientDeleteResponse, error)` -- New function `*GalleryApplicationsClientUpdatePoller.Done() bool` -- New function `*DedicatedHostGroupsClientListByResourceGroupPager.Err() error` -- New function `*CloudServicesClientStartPoller.Poll(context.Context) (*http.Response, error)` -- New function `*DiskEncryptionSetsClientListPager.PageResponse() DiskEncryptionSetsClientListResponse` -- New function `*DiskAccessesClientUpdatePoller.Poll(context.Context) (*http.Response, error)` -- New function `*VirtualMachineScaleSetVMsClientPowerOffPoller.FinalResponse(context.Context) (VirtualMachineScaleSetVMsClientPowerOffResponse, error)` -- New function `*VirtualMachineScaleSetsClientReimagePoller.Done() bool` -- New function `*DiskEncryptionSetsClientUpdatePoller.Poll(context.Context) (*http.Response, error)` -- New function `*DedicatedHostsClientCreateOrUpdatePoller.Done() bool` -- New function `*ImagesClientCreateOrUpdatePollerResponse.Resume(context.Context, *ImagesClient, string) error` -- New function `*VirtualMachineScaleSetExtensionsClientCreateOrUpdatePollerResponse.Resume(context.Context, *VirtualMachineScaleSetExtensionsClient, string) error` -- New function `*VirtualMachineScaleSetVMsClientRedeployPoller.FinalResponse(context.Context) (VirtualMachineScaleSetVMsClientRedeployResponse, error)` -- New function `*VirtualMachinesClientPerformMaintenancePollerResponse.Resume(context.Context, *VirtualMachinesClient, string) error` -- New function `*VirtualMachineScaleSetsClientGetOSUpgradeHistoryPager.Err() error` -- New function `*VirtualMachineScaleSetsClientUpdatePoller.Poll(context.Context) (*http.Response, error)` -- New function `*VirtualMachineScaleSetVMsClientStartPollerResponse.Resume(context.Context, *VirtualMachineScaleSetVMsClient, string) error` -- New function `VirtualMachinesClientRunCommandPollerResponse.PollUntilDone(context.Context, time.Duration) (VirtualMachinesClientRunCommandResponse, error)` -- New function `*RestorePointCollectionsClientDeletePollerResponse.Resume(context.Context, *RestorePointCollectionsClient, string) error` -- New function `VirtualMachineScaleSetVMsClientUpdatePollerResponse.PollUntilDone(context.Context, time.Duration) (VirtualMachineScaleSetVMsClientUpdateResponse, error)` -- New function `*DiskRestorePointClientGrantAccessPollerResponse.Resume(context.Context, *DiskRestorePointClient, string) error` -- New function `*GalleryApplicationsClientCreateOrUpdatePoller.Poll(context.Context) (*http.Response, error)` -- New function `VirtualMachinesClientDeallocatePollerResponse.PollUntilDone(context.Context, time.Duration) (VirtualMachinesClientDeallocateResponse, error)` -- New function `GalleryImagesClientCreateOrUpdatePollerResponse.PollUntilDone(context.Context, time.Duration) (GalleryImagesClientCreateOrUpdateResponse, error)` -- New function `*VirtualMachineRunCommandsClientDeletePoller.ResumeToken() (string, error)` -- New function `*VirtualMachinesClientReimagePollerResponse.Resume(context.Context, *VirtualMachinesClient, string) error` -- New function `*VirtualMachineScaleSetsClientPowerOffPoller.Poll(context.Context) (*http.Response, error)` -- New function `*DedicatedHostsClientUpdatePoller.Done() bool` -- New function `*VirtualMachineScaleSetsClientPerformMaintenancePollerResponse.Resume(context.Context, *VirtualMachineScaleSetsClient, string) error` -- New function `*CapacityReservationsClientUpdatePoller.FinalResponse(context.Context) (CapacityReservationsClientUpdateResponse, error)` -- New function `VirtualMachineRunCommandsClientDeletePollerResponse.PollUntilDone(context.Context, time.Duration) (VirtualMachineRunCommandsClientDeleteResponse, error)` -- New function `*CloudServiceRoleInstancesClientRebuildPoller.ResumeToken() (string, error)` -- New function `*VirtualMachinesClientDeletePoller.Poll(context.Context) (*http.Response, error)` -- New function `*VirtualMachineScaleSetVMsClientDeletePoller.ResumeToken() (string, error)` -- New function `*VirtualMachineScaleSetVMsClientListPager.PageResponse() VirtualMachineScaleSetVMsClientListResponse` -- New function `GalleryImageVersionPublishingProfile.MarshalJSON() ([]byte, error)` -- New function `*DedicatedHostsClientUpdatePollerResponse.Resume(context.Context, *DedicatedHostsClient, string) error` -- New function `*DiskRestorePointClientRevokeAccessPollerResponse.Resume(context.Context, *DiskRestorePointClient, string) error` -- New function `*ProximityPlacementGroupsClientListByResourceGroupPager.Err() error` -- New function `*GalleryImageVersionsClientListByGalleryImagePager.Err() error` -- New function `*DisksClientRevokeAccessPoller.ResumeToken() (string, error)` -- New function `*VirtualMachinesClientReapplyPollerResponse.Resume(context.Context, *VirtualMachinesClient, string) error` -- New function `*VirtualMachineScaleSetExtensionsClientDeletePollerResponse.Resume(context.Context, *VirtualMachineScaleSetExtensionsClient, string) error` -- New function `*VirtualMachineScaleSetVMExtensionsClientCreateOrUpdatePollerResponse.Resume(context.Context, *VirtualMachineScaleSetVMExtensionsClient, string) error` -- New function `*VirtualMachineRunCommandsClientUpdatePoller.Done() bool` -- New function `*DisksClientDeletePollerResponse.Resume(context.Context, *DisksClient, string) error` -- New function `*VirtualMachineScaleSetVMsClientUpdatePoller.ResumeToken() (string, error)` -- New function `*VirtualMachineScaleSetsClientPerformMaintenancePoller.Done() bool` -- New function `*VirtualMachineRunCommandsClientCreateOrUpdatePoller.FinalResponse(context.Context) (VirtualMachineRunCommandsClientCreateOrUpdateResponse, error)` -- New function `VirtualMachineScaleSetsClientUpdateInstancesPollerResponse.PollUntilDone(context.Context, time.Duration) (VirtualMachineScaleSetsClientUpdateInstancesResponse, error)` -- New function `*RestorePointCollectionsClientListPager.NextPage(context.Context) bool` -- New function `*CloudServiceOperatingSystemsClientListOSFamiliesPager.NextPage(context.Context) bool` -- New function `*VirtualMachineScaleSetsClientUpdatePollerResponse.Resume(context.Context, *VirtualMachineScaleSetsClient, string) error` -- New function `*VirtualMachinesClientCreateOrUpdatePoller.Done() bool` -- New function `DisksClientCreateOrUpdatePollerResponse.PollUntilDone(context.Context, time.Duration) (DisksClientCreateOrUpdateResponse, error)` -- New function `*DiskEncryptionSetsClientUpdatePoller.Done() bool` -- New function `*DiskEncryptionSetsClientUpdatePoller.ResumeToken() (string, error)` -- New function `*VirtualMachinesClientStartPoller.FinalResponse(context.Context) (VirtualMachinesClientStartResponse, error)` -- New function `*VirtualMachineScaleSetVMsClientRunCommandPoller.Poll(context.Context) (*http.Response, error)` -- New function `*RestorePointCollectionsClientListAllPager.PageResponse() RestorePointCollectionsClientListAllResponse` -- New function `*VirtualMachinesClientStartPollerResponse.Resume(context.Context, *VirtualMachinesClient, string) error` -- New function `*SnapshotsClientUpdatePoller.FinalResponse(context.Context) (SnapshotsClientUpdateResponse, error)` -- New function `*VirtualMachineScaleSetRollingUpgradesClientStartExtensionUpgradePollerResponse.Resume(context.Context, *VirtualMachineScaleSetRollingUpgradesClient, string) error` -- New function `DisksClientUpdatePollerResponse.PollUntilDone(context.Context, time.Duration) (DisksClientUpdateResponse, error)` -- New function `*GalleryApplicationVersionsClientListByGalleryApplicationPager.NextPage(context.Context) bool` -- New function `*VirtualMachineScaleSetVMsClientListPager.NextPage(context.Context) bool` -- New function `*AvailabilitySetsClientListBySubscriptionPager.Err() error` -- New function `*DiskRestorePointClientRevokeAccessPoller.ResumeToken() (string, error)` -- New function `*VirtualMachinesClientCapturePollerResponse.Resume(context.Context, *VirtualMachinesClient, string) error` -- New function `GalleryApplicationVersionsClientUpdatePollerResponse.PollUntilDone(context.Context, time.Duration) (GalleryApplicationVersionsClientUpdateResponse, error)` -- New function `*VirtualMachineExtensionsClientDeletePoller.FinalResponse(context.Context) (VirtualMachineExtensionsClientDeleteResponse, error)` -- New function `*VirtualMachineScaleSetsClientListPager.Err() error` -- New function `CloudServicesClientStartPollerResponse.PollUntilDone(context.Context, time.Duration) (CloudServicesClientStartResponse, error)` -- New function `*VirtualMachineScaleSetExtensionsClientUpdatePoller.Poll(context.Context) (*http.Response, error)` -- New function `*CloudServiceRoleInstancesClientReimagePoller.Done() bool` -- New function `*CloudServicesUpdateDomainClientWalkUpdateDomainPoller.Done() bool` -- New function `*ImagesClientCreateOrUpdatePoller.Poll(context.Context) (*http.Response, error)` -- New function `*VirtualMachineScaleSetsClientDeleteInstancesPoller.Done() bool` -- New function `*CloudServicesClientDeleteInstancesPoller.ResumeToken() (string, error)` -- New function `*GalleryApplicationVersionsClientListByGalleryApplicationPager.PageResponse() GalleryApplicationVersionsClientListByGalleryApplicationResponse` -- New function `*DisksClientUpdatePoller.ResumeToken() (string, error)` -- New function `*CloudServicesClientDeleteInstancesPoller.Done() bool` -- New function `*VirtualMachineScaleSetExtensionsClientCreateOrUpdatePoller.Poll(context.Context) (*http.Response, error)` -- New function `*CloudServicesClientListPager.PageResponse() CloudServicesClientListResponse` -- New function `*VirtualMachineRunCommandsClientDeletePollerResponse.Resume(context.Context, *VirtualMachineRunCommandsClient, string) error` -- New function `*CapacityReservationGroupsClientListByResourceGroupPager.PageResponse() CapacityReservationGroupsClientListByResourceGroupResponse` -- New function `*VirtualMachinesClientReimagePoller.FinalResponse(context.Context) (VirtualMachinesClientReimageResponse, error)` -- New function `*VirtualMachinesClientRestartPoller.Poll(context.Context) (*http.Response, error)` -- New function `*GalleriesClientDeletePoller.FinalResponse(context.Context) (GalleriesClientDeleteResponse, error)` -- New function `*CapacityReservationsClientCreateOrUpdatePollerResponse.Resume(context.Context, *CapacityReservationsClient, string) error` -- New function `*DiskRestorePointClientListByRestorePointPager.NextPage(context.Context) bool` -- New function `GalleryImagesClientDeletePollerResponse.PollUntilDone(context.Context, time.Duration) (GalleryImagesClientDeleteResponse, error)` -- New function `*GalleriesClientCreateOrUpdatePollerResponse.Resume(context.Context, *GalleriesClient, string) error` -- New function `*SharedGalleryImagesClientListPager.NextPage(context.Context) bool` -- New function `*VirtualMachineScaleSetVMExtensionsClientUpdatePollerResponse.Resume(context.Context, *VirtualMachineScaleSetVMExtensionsClient, string) error` -- New function `*ProximityPlacementGroupsClientListBySubscriptionPager.Err() error` -- New function `*GalleryImageVersionsClientUpdatePollerResponse.Resume(context.Context, *GalleryImageVersionsClient, string) error` -- New function `*DiskAccessesClientUpdateAPrivateEndpointConnectionPoller.ResumeToken() (string, error)` -- New function `*DisksClientListPager.Err() error` -- New function `*DisksClientListByResourceGroupPager.Err() error` -- New function `*VirtualMachineScaleSetsClientUpdateInstancesPoller.Done() bool` -- New function `*CloudServicesClientRestartPoller.Done() bool` -- New function `*GalleriesClientListByResourceGroupPager.NextPage(context.Context) bool` -- New function `VirtualMachineScaleSetVMsClientPowerOffPollerResponse.PollUntilDone(context.Context, time.Duration) (VirtualMachineScaleSetVMsClientPowerOffResponse, error)` -- New function `*VirtualMachinesClientCreateOrUpdatePoller.ResumeToken() (string, error)` -- New function `*ImagesClientDeletePollerResponse.Resume(context.Context, *ImagesClient, string) error` -- New function `*DiskAccessesClientCreateOrUpdatePoller.FinalResponse(context.Context) (DiskAccessesClientCreateOrUpdateResponse, error)` -- New function `*DiskAccessesClientDeleteAPrivateEndpointConnectionPoller.FinalResponse(context.Context) (DiskAccessesClientDeleteAPrivateEndpointConnectionResponse, error)` -- New function `*VirtualMachinesClientListAllPager.PageResponse() VirtualMachinesClientListAllResponse` -- New function `*DiskRestorePointClientGrantAccessPoller.Poll(context.Context) (*http.Response, error)` -- New function `*GalleryImageVersionsClientCreateOrUpdatePoller.Poll(context.Context) (*http.Response, error)` -- New function `*DisksClientGrantAccessPoller.Done() bool` -- New function `*GalleryImageVersionsClientDeletePoller.ResumeToken() (string, error)` -- New function `*VirtualMachineScaleSetRollingUpgradesClientStartOSUpgradePollerResponse.Resume(context.Context, *VirtualMachineScaleSetRollingUpgradesClient, string) error` -- New function `*VirtualMachineScaleSetVMsClientPowerOffPoller.ResumeToken() (string, error)` -- New function `*SnapshotsClientRevokeAccessPoller.FinalResponse(context.Context) (SnapshotsClientRevokeAccessResponse, error)` -- New function `*VirtualMachinesClientRunCommandPollerResponse.Resume(context.Context, *VirtualMachinesClient, string) error` -- New function `*CapacityReservationsClientListByCapacityReservationGroupPager.NextPage(context.Context) bool` -- New function `*GalleryApplicationVersionsClientDeletePollerResponse.Resume(context.Context, *GalleryApplicationVersionsClient, string) error` -- New function `*LogAnalyticsClientExportThrottledRequestsPoller.ResumeToken() (string, error)` -- New function `*CloudServiceRoleInstancesClientListPager.Err() error` -- New function `*CloudServicesUpdateDomainClientListUpdateDomainsPager.PageResponse() CloudServicesUpdateDomainClientListUpdateDomainsResponse` -- New function `*CloudServiceRoleInstancesClientRestartPoller.FinalResponse(context.Context) (CloudServiceRoleInstancesClientRestartResponse, error)` -- New function `*RestorePointsClientDeletePoller.Poll(context.Context) (*http.Response, error)` -- New function `*VirtualMachineScaleSetsClientUpdatePoller.Done() bool` -- New function `GalleriesClientDeletePollerResponse.PollUntilDone(context.Context, time.Duration) (GalleriesClientDeleteResponse, error)` -- New function `*VirtualMachineScaleSetVMsClientUpdatePoller.Poll(context.Context) (*http.Response, error)` -- New function `*CloudServicesClientListAllPager.PageResponse() CloudServicesClientListAllResponse` -- New function `VirtualMachineScaleSetVMRunCommandsClientDeletePollerResponse.PollUntilDone(context.Context, time.Duration) (VirtualMachineScaleSetVMRunCommandsClientDeleteResponse, error)` -- New function `*VirtualMachineScaleSetsClientStartPollerResponse.Resume(context.Context, *VirtualMachineScaleSetsClient, string) error` -- New function `*VirtualMachineScaleSetsClientDeallocatePoller.ResumeToken() (string, error)` -- New function `*VirtualMachineScaleSetsClientRedeployPoller.Done() bool` -- New function `*VirtualMachineScaleSetsClientReimageAllPoller.ResumeToken() (string, error)` -- New function `*VirtualMachineExtensionsClientUpdatePoller.Poll(context.Context) (*http.Response, error)` -- New function `*VirtualMachineRunCommandsClientDeletePoller.Done() bool` -- New function `*ImagesClientListByResourceGroupPager.NextPage(context.Context) bool` -- New function `*CloudServicesClientDeleteInstancesPoller.FinalResponse(context.Context) (CloudServicesClientDeleteInstancesResponse, error)` -- New function `GalleryImageVersionsClientDeletePollerResponse.PollUntilDone(context.Context, time.Duration) (GalleryImageVersionsClientDeleteResponse, error)` -- New function `*GalleryApplicationVersionsClientUpdatePoller.Done() bool` -- New function `*SSHPublicKeysClientListByResourceGroupPager.Err() error` -- New function `*SharedGalleryImageVersionsClientListPager.PageResponse() SharedGalleryImageVersionsClientListResponse` -- New function `*DiskAccessesClientUpdatePoller.ResumeToken() (string, error)` -- New function `*CloudServiceOperatingSystemsClientListOSVersionsPager.PageResponse() CloudServiceOperatingSystemsClientListOSVersionsResponse` -- New function `*VirtualMachinesClientPerformMaintenancePoller.ResumeToken() (string, error)` -- New function `*ImagesClientCreateOrUpdatePoller.Done() bool` -- New function `*ImagesClientListPager.NextPage(context.Context) bool` -- New function `*VirtualMachineScaleSetsClientUpdatePoller.FinalResponse(context.Context) (VirtualMachineScaleSetsClientUpdateResponse, error)` -- New function `*CloudServicesClientRestartPollerResponse.Resume(context.Context, *CloudServicesClient, string) error` -- New function `*DisksClientDeletePoller.Poll(context.Context) (*http.Response, error)` -- New function `*VirtualMachinesClientPowerOffPoller.FinalResponse(context.Context) (VirtualMachinesClientPowerOffResponse, error)` -- New function `*VirtualMachinesClientDeletePoller.Done() bool` -- New function `*VirtualMachineScaleSetVMRunCommandsClientDeletePollerResponse.Resume(context.Context, *VirtualMachineScaleSetVMRunCommandsClient, string) error` -- New function `*ProximityPlacementGroupsClientListBySubscriptionPager.PageResponse() ProximityPlacementGroupsClientListBySubscriptionResponse` -- New function `*DiskEncryptionSetsClientListByResourceGroupPager.Err() error` -- New function `*VirtualMachinesClientPerformMaintenancePoller.Poll(context.Context) (*http.Response, error)` -- New function `*CloudServiceRoleInstancesClientReimagePoller.Poll(context.Context) (*http.Response, error)` -- New function `*DiskRestorePointClientListByRestorePointPager.Err() error` -- New function `*GalleryImageVersionsClientDeletePoller.Done() bool` -- New function `*VirtualMachinesClientCreateOrUpdatePoller.Poll(context.Context) (*http.Response, error)` -- New function `*VirtualMachinesClientUpdatePoller.Poll(context.Context) (*http.Response, error)` -- New function `*CloudServicesClientDeleteInstancesPoller.Poll(context.Context) (*http.Response, error)` -- New function `*VirtualMachineScaleSetsClientRestartPoller.Done() bool` -- New function `*DisksClientUpdatePoller.FinalResponse(context.Context) (DisksClientUpdateResponse, error)` -- New function `*VirtualMachineScaleSetVMExtensionsClientCreateOrUpdatePoller.FinalResponse(context.Context) (VirtualMachineScaleSetVMExtensionsClientCreateOrUpdateResponse, error)` -- New function `*CloudServiceRoleInstancesClientRebuildPollerResponse.Resume(context.Context, *CloudServiceRoleInstancesClient, string) error` -- New function `DedicatedHostsClientDeletePollerResponse.PollUntilDone(context.Context, time.Duration) (DedicatedHostsClientDeleteResponse, error)` -- New function `*GalleryImageVersionsClientUpdatePoller.ResumeToken() (string, error)` -- New function `*GalleryApplicationVersionsClientUpdatePollerResponse.Resume(context.Context, *GalleryApplicationVersionsClient, string) error` -- New function `*DiskAccessesClientCreateOrUpdatePollerResponse.Resume(context.Context, *DiskAccessesClient, string) error` -- New function `*VirtualMachineRunCommandsClientDeletePoller.Poll(context.Context) (*http.Response, error)` -- New function `*SharedGalleriesClientListPager.NextPage(context.Context) bool` -- New function `*GalleryImagesClientCreateOrUpdatePoller.Poll(context.Context) (*http.Response, error)` -- New function `*SharedGalleriesClientListPager.PageResponse() SharedGalleriesClientListResponse` -- New function `*GalleryApplicationsClientListByGalleryPager.PageResponse() GalleryApplicationsClientListByGalleryResponse` -- New function `VirtualMachineScaleSetsClientStartPollerResponse.PollUntilDone(context.Context, time.Duration) (VirtualMachineScaleSetsClientStartResponse, error)` -- New function `*CapacityReservationsClientCreateOrUpdatePoller.FinalResponse(context.Context) (CapacityReservationsClientCreateOrUpdateResponse, error)` -- New function `*VirtualMachineScaleSetVMsClientPerformMaintenancePoller.FinalResponse(context.Context) (VirtualMachineScaleSetVMsClientPerformMaintenanceResponse, error)` -- New function `*GalleriesClientCreateOrUpdatePoller.ResumeToken() (string, error)` -- New function `*GalleriesClientCreateOrUpdatePoller.Poll(context.Context) (*http.Response, error)` -- New function `*DedicatedHostsClientCreateOrUpdatePoller.FinalResponse(context.Context) (DedicatedHostsClientCreateOrUpdateResponse, error)` -- New function `*CloudServiceRolesClientListPager.PageResponse() CloudServiceRolesClientListResponse` -- New function `VirtualMachineRunCommandsClientCreateOrUpdatePollerResponse.PollUntilDone(context.Context, time.Duration) (VirtualMachineRunCommandsClientCreateOrUpdateResponse, error)` -- New function `LogAnalyticsClientExportThrottledRequestsPollerResponse.PollUntilDone(context.Context, time.Duration) (LogAnalyticsClientExportThrottledRequestsResponse, error)` -- New function `*VirtualMachinesClientListPager.PageResponse() VirtualMachinesClientListResponse` -- New function `*VirtualMachineScaleSetVMsClientRunCommandPoller.Done() bool` -- New function `*CapacityReservationsClientUpdatePoller.ResumeToken() (string, error)` -- New function `*VirtualMachineScaleSetVMsClientReimagePoller.Poll(context.Context) (*http.Response, error)` -- New function `*GalleryApplicationVersionsClientDeletePoller.Poll(context.Context) (*http.Response, error)` -- New function `*GalleriesClientListByResourceGroupPager.Err() error` -- New function `RestorePointsClientDeletePollerResponse.PollUntilDone(context.Context, time.Duration) (RestorePointsClientDeleteResponse, error)` -- New function `*VirtualMachinesClientListByLocationPager.PageResponse() VirtualMachinesClientListByLocationResponse` -- New function `*SharedGalleriesClientListPager.Err() error` -- New function `*VirtualMachinesClientPowerOffPollerResponse.Resume(context.Context, *VirtualMachinesClient, string) error` -- New function `VirtualMachineScaleSetsClientSetOrchestrationServiceStatePollerResponse.PollUntilDone(context.Context, time.Duration) (VirtualMachineScaleSetsClientSetOrchestrationServiceStateResponse, error)` -- New function `*VirtualMachinesClientAssessPatchesPoller.FinalResponse(context.Context) (VirtualMachinesClientAssessPatchesResponse, error)` -- New function `*SnapshotsClientGrantAccessPoller.Done() bool` -- New function `*SSHPublicKeysClientListBySubscriptionPager.PageResponse() SSHPublicKeysClientListBySubscriptionResponse` -- New function `DiskAccessesClientCreateOrUpdatePollerResponse.PollUntilDone(context.Context, time.Duration) (DiskAccessesClientCreateOrUpdateResponse, error)` -- New function `*VirtualMachineScaleSetVMRunCommandsClientDeletePoller.FinalResponse(context.Context) (VirtualMachineScaleSetVMRunCommandsClientDeleteResponse, error)` -- New function `VirtualMachineScaleSetVMsClientDeallocatePollerResponse.PollUntilDone(context.Context, time.Duration) (VirtualMachineScaleSetVMsClientDeallocateResponse, error)` -- New function `*SnapshotsClientCreateOrUpdatePoller.FinalResponse(context.Context) (SnapshotsClientCreateOrUpdateResponse, error)` -- New function `*DiskAccessesClientCreateOrUpdatePoller.Poll(context.Context) (*http.Response, error)` -- New function `*VirtualMachinesClientReapplyPoller.ResumeToken() (string, error)` -- New function `*DisksClientRevokeAccessPoller.Done() bool` -- New function `*VirtualMachineRunCommandsClientCreateOrUpdatePoller.ResumeToken() (string, error)` -- New function `*VirtualMachinesClientUpdatePoller.ResumeToken() (string, error)` -- New function `*DiskAccessesClientUpdateAPrivateEndpointConnectionPoller.Poll(context.Context) (*http.Response, error)` -- New function `*SnapshotsClientCreateOrUpdatePoller.ResumeToken() (string, error)` -- New function `*GalleryApplicationsClientDeletePollerResponse.Resume(context.Context, *GalleryApplicationsClient, string) error` -- New function `*VirtualMachinesClientConvertToManagedDisksPoller.Poll(context.Context) (*http.Response, error)` -- New function `*CloudServicesClientRebuildPoller.ResumeToken() (string, error)` -- New function `*SnapshotsClientDeletePoller.Poll(context.Context) (*http.Response, error)` -- New function `*VirtualMachineScaleSetExtensionsClientCreateOrUpdatePoller.Done() bool` -- New function `*VirtualMachineRunCommandsClientUpdatePoller.FinalResponse(context.Context) (VirtualMachineRunCommandsClientUpdateResponse, error)` -- New function `*DiskAccessesClientListPager.Err() error` -- New function `*VirtualMachineScaleSetExtensionsClientCreateOrUpdatePoller.FinalResponse(context.Context) (VirtualMachineScaleSetExtensionsClientCreateOrUpdateResponse, error)` -- New function `*VirtualMachineRunCommandsClientListByVirtualMachinePager.PageResponse() VirtualMachineRunCommandsClientListByVirtualMachineResponse` -- New function `*VirtualMachinesClientCreateOrUpdatePollerResponse.Resume(context.Context, *VirtualMachinesClient, string) error` -- New function `VirtualMachineScaleSetVMRunCommandsClientUpdatePollerResponse.PollUntilDone(context.Context, time.Duration) (VirtualMachineScaleSetVMRunCommandsClientUpdateResponse, error)` -- New function `DedicatedHostsClientCreateOrUpdatePollerResponse.PollUntilDone(context.Context, time.Duration) (DedicatedHostsClientCreateOrUpdateResponse, error)` -- New function `*VirtualMachineScaleSetVMsClientUpdatePoller.Done() bool` -- New function `*GalleryImageVersionsClientCreateOrUpdatePoller.Done() bool` -- New function `*DisksClientCreateOrUpdatePoller.ResumeToken() (string, error)` -- New function `*VirtualMachineScaleSetExtensionsClientUpdatePoller.ResumeToken() (string, error)` -- New function `CloudServicesClientDeletePollerResponse.PollUntilDone(context.Context, time.Duration) (CloudServicesClientDeleteResponse, error)` -- New function `*VirtualMachineScaleSetsClientStartPoller.Poll(context.Context) (*http.Response, error)` -- New function `CloudServiceRoleInstancesClientDeletePollerResponse.PollUntilDone(context.Context, time.Duration) (CloudServiceRoleInstancesClientDeleteResponse, error)` -- New function `*VirtualMachineScaleSetsClientSetOrchestrationServiceStatePoller.Done() bool` -- New function `*ImagesClientUpdatePoller.Done() bool` -- New function `*VirtualMachinesClientListPager.Err() error` -- New function `*GalleryApplicationsClientCreateOrUpdatePollerResponse.Resume(context.Context, *GalleryApplicationsClient, string) error` -- New function `*CloudServicesClientRebuildPollerResponse.Resume(context.Context, *CloudServicesClient, string) error` -- New function `*DisksClientGrantAccessPoller.ResumeToken() (string, error)` -- New function `*VirtualMachineRunCommandsClientDeletePoller.FinalResponse(context.Context) (VirtualMachineRunCommandsClientDeleteResponse, error)` -- New function `*SnapshotsClientGrantAccessPoller.ResumeToken() (string, error)` -- New function `*CapacityReservationsClientListByCapacityReservationGroupPager.Err() error` -- New function `*VirtualMachineScaleSetVMsClientRestartPoller.FinalResponse(context.Context) (VirtualMachineScaleSetVMsClientRestartResponse, error)` -- New function `*CloudServiceRoleInstancesClientRestartPollerResponse.Resume(context.Context, *CloudServiceRoleInstancesClient, string) error` -- New function `*VirtualMachineScaleSetsClientRestartPoller.FinalResponse(context.Context) (VirtualMachineScaleSetsClientRestartResponse, error)` -- New function `*DiskAccessesClientDeleteAPrivateEndpointConnectionPoller.Poll(context.Context) (*http.Response, error)` -- New function `*DiskAccessesClientCreateOrUpdatePoller.Done() bool` -- New function `*GalleryImagesClientDeletePoller.Poll(context.Context) (*http.Response, error)` -- New function `*DiskAccessesClientDeletePoller.Done() bool` -- New function `*VirtualMachineScaleSetVMRunCommandsClientUpdatePoller.Done() bool` -- New function `CloudServiceRoleInstancesClientRestartPollerResponse.PollUntilDone(context.Context, time.Duration) (CloudServiceRoleInstancesClientRestartResponse, error)` -- New function `*VirtualMachineScaleSetsClientPerformMaintenancePoller.ResumeToken() (string, error)` -- New function `SnapshotsClientGrantAccessPollerResponse.PollUntilDone(context.Context, time.Duration) (SnapshotsClientGrantAccessResponse, error)` -- New function `*VirtualMachineScaleSetsClientStartPoller.FinalResponse(context.Context) (VirtualMachineScaleSetsClientStartResponse, error)` -- New function `*ImagesClientDeletePoller.Done() bool` -- New function `*GalleryApplicationsClientDeletePoller.FinalResponse(context.Context) (GalleryApplicationsClientDeleteResponse, error)` -- New function `*VirtualMachinesClientPerformMaintenancePoller.Done() bool` -- New function `*CapacityReservationGroupsClientListBySubscriptionPager.PageResponse() CapacityReservationGroupsClientListBySubscriptionResponse` -- New function `*RestorePointCollectionsClientListAllPager.Err() error` -- New function `*VirtualMachineExtensionsClientUpdatePollerResponse.Resume(context.Context, *VirtualMachineExtensionsClient, string) error` -- New function `*VirtualMachinesClientRunCommandPoller.Poll(context.Context) (*http.Response, error)` -- New function `*CapacityReservationsClientDeletePoller.Done() bool` -- New function `*DedicatedHostGroupsClientListByResourceGroupPager.NextPage(context.Context) bool` -- New function `*GalleryImagesClientUpdatePoller.FinalResponse(context.Context) (GalleryImagesClientUpdateResponse, error)` -- New function `*CloudServicesClientListPager.NextPage(context.Context) bool` -- New function `*DiskAccessesClientDeletePoller.ResumeToken() (string, error)` -- New function `*RestorePointsClientCreatePoller.Done() bool` -- New function `*DiskEncryptionSetsClientCreateOrUpdatePoller.Done() bool` -- New function `*VirtualMachineScaleSetVMsClientPerformMaintenancePollerResponse.Resume(context.Context, *VirtualMachineScaleSetVMsClient, string) error` -- New function `*VirtualMachineScaleSetVMRunCommandsClientUpdatePoller.ResumeToken() (string, error)` -- New function `*ProximityPlacementGroupsClientListByResourceGroupPager.NextPage(context.Context) bool` -- New function `*CloudServicesUpdateDomainClientWalkUpdateDomainPoller.FinalResponse(context.Context) (CloudServicesUpdateDomainClientWalkUpdateDomainResponse, error)` -- New function `VirtualMachineScaleSetsClientPerformMaintenancePollerResponse.PollUntilDone(context.Context, time.Duration) (VirtualMachineScaleSetsClientPerformMaintenanceResponse, error)` -- New function `*VirtualMachineScaleSetVMsClientRestartPollerResponse.Resume(context.Context, *VirtualMachineScaleSetVMsClient, string) error` -- New function `*DedicatedHostsClientUpdatePoller.ResumeToken() (string, error)` -- New function `*DiskEncryptionSetsClientDeletePoller.Done() bool` -- New function `*VirtualMachineScaleSetVMsClientReimagePoller.Done() bool` -- New function `VirtualMachineScaleSetsClientRedeployPollerResponse.PollUntilDone(context.Context, time.Duration) (VirtualMachineScaleSetsClientRedeployResponse, error)` -- New function `DiskAccessesClientUpdatePollerResponse.PollUntilDone(context.Context, time.Duration) (DiskAccessesClientUpdateResponse, error)` -- New function `*DiskAccessesClientDeletePoller.Poll(context.Context) (*http.Response, error)` -- New function `*DiskRestorePointClientRevokeAccessPoller.FinalResponse(context.Context) (DiskRestorePointClientRevokeAccessResponse, error)` -- New function `*VirtualMachineScaleSetVMExtensionsClientCreateOrUpdatePoller.ResumeToken() (string, error)` -- New function `*VirtualMachineScaleSetsClientDeletePoller.Poll(context.Context) (*http.Response, error)` -- New function `*VirtualMachineScaleSetVMsClientDeallocatePoller.Poll(context.Context) (*http.Response, error)` -- New function `*GalleryImagesClientUpdatePoller.Poll(context.Context) (*http.Response, error)` -- New function `*SSHPublicKeysClientListBySubscriptionPager.Err() error` -- New function `GalleryApplicationsClientCreateOrUpdatePollerResponse.PollUntilDone(context.Context, time.Duration) (GalleryApplicationsClientCreateOrUpdateResponse, error)` -- New function `*ImagesClientCreateOrUpdatePoller.ResumeToken() (string, error)` -- New function `*VirtualMachinesClientRestartPoller.ResumeToken() (string, error)` -- New function `*DisksClientRevokeAccessPollerResponse.Resume(context.Context, *DisksClient, string) error` -- New function `*VirtualMachinesClientDeletePollerResponse.Resume(context.Context, *VirtualMachinesClient, string) error` -- New function `VirtualMachineScaleSetsClientPowerOffPollerResponse.PollUntilDone(context.Context, time.Duration) (VirtualMachineScaleSetsClientPowerOffResponse, error)` -- New function `*VirtualMachineScaleSetVMsClientReimageAllPollerResponse.Resume(context.Context, *VirtualMachineScaleSetVMsClient, string) error` -- New function `*VirtualMachineScaleSetVMsClientPowerOffPollerResponse.Resume(context.Context, *VirtualMachineScaleSetVMsClient, string) error` -- New function `*RestorePointCollectionsClientListPager.Err() error` -- New function `*SnapshotsClientDeletePoller.FinalResponse(context.Context) (SnapshotsClientDeleteResponse, error)` -- New function `*LogAnalyticsClientExportRequestRateByIntervalPoller.Poll(context.Context) (*http.Response, error)` -- New function `*VirtualMachinesClientReimagePoller.Done() bool` -- New function `GalleryApplicationVersionsClientDeletePollerResponse.PollUntilDone(context.Context, time.Duration) (GalleryApplicationVersionsClientDeleteResponse, error)` -- New function `*GalleryImagesClientDeletePoller.ResumeToken() (string, error)` -- New function `*GalleryImageVersionsClientListByGalleryImagePager.NextPage(context.Context) bool` -- New function `*VirtualMachineScaleSetsClientRedeployPoller.FinalResponse(context.Context) (VirtualMachineScaleSetsClientRedeployResponse, error)` -- New function `*VirtualMachineScaleSetsClientDeleteInstancesPoller.ResumeToken() (string, error)` -- New function `*GalleryImageVersionsClientDeletePoller.FinalResponse(context.Context) (GalleryImageVersionsClientDeleteResponse, error)` -- New function `*VirtualMachineScaleSetExtensionsClientDeletePoller.FinalResponse(context.Context) (VirtualMachineScaleSetExtensionsClientDeleteResponse, error)` -- New function `*VirtualMachineScaleSetVMsClientStartPoller.Done() bool` -- New function `*VirtualMachineScaleSetsClientDeleteInstancesPoller.Poll(context.Context) (*http.Response, error)` -- New function `*GalleryImagesClientListByGalleryPager.PageResponse() GalleryImagesClientListByGalleryResponse` -- New function `*VirtualMachinesClientStartPoller.Done() bool` -- New function `VirtualMachinesClientRestartPollerResponse.PollUntilDone(context.Context, time.Duration) (VirtualMachinesClientRestartResponse, error)` -- New function `*SnapshotsClientGrantAccessPoller.FinalResponse(context.Context) (SnapshotsClientGrantAccessResponse, error)` -- New function `*VirtualMachineScaleSetVMRunCommandsClientListPager.Err() error` -- New function `*VirtualMachinesClientInstallPatchesPoller.Poll(context.Context) (*http.Response, error)` -- New function `*VirtualMachineScaleSetsClientRedeployPoller.Poll(context.Context) (*http.Response, error)` -- New function `*CloudServicesClientDeletePoller.FinalResponse(context.Context) (CloudServicesClientDeleteResponse, error)` -- New function `*VirtualMachineScaleSetVMExtensionsClientUpdatePoller.Poll(context.Context) (*http.Response, error)` -- New function `*CloudServicesClientRebuildPoller.Done() bool` -- New function `*GalleryApplicationsClientUpdatePoller.ResumeToken() (string, error)` -- New function `*CloudServicesClientRebuildPoller.Poll(context.Context) (*http.Response, error)` -- New function `*DiskAccessesClientDeleteAPrivateEndpointConnectionPoller.ResumeToken() (string, error)` -- New function `*VirtualMachineScaleSetVMsClientStartPoller.Poll(context.Context) (*http.Response, error)` -- New function `*DiskAccessesClientDeletePollerResponse.Resume(context.Context, *DiskAccessesClient, string) error` -- New function `*GallerySharingProfileClientUpdatePoller.FinalResponse(context.Context) (GallerySharingProfileClientUpdateResponse, error)` -- New function `*GalleryImagesClientListByGalleryPager.Err() error` -- New function `*VirtualMachineScaleSetVMExtensionsClientDeletePoller.FinalResponse(context.Context) (VirtualMachineScaleSetVMExtensionsClientDeleteResponse, error)` -- New function `DiskAccessesClientDeleteAPrivateEndpointConnectionPollerResponse.PollUntilDone(context.Context, time.Duration) (DiskAccessesClientDeleteAPrivateEndpointConnectionResponse, error)` -- New function `*VirtualMachineScaleSetsClientCreateOrUpdatePoller.Poll(context.Context) (*http.Response, error)` -- New function `*VirtualMachineScaleSetVMsClientRunCommandPoller.FinalResponse(context.Context) (VirtualMachineScaleSetVMsClientRunCommandResponse, error)` -- New function `*VirtualMachineScaleSetVMRunCommandsClientUpdatePollerResponse.Resume(context.Context, *VirtualMachineScaleSetVMRunCommandsClient, string) error` -- New function `*VirtualMachineScaleSetsClientDeletePoller.FinalResponse(context.Context) (VirtualMachineScaleSetsClientDeleteResponse, error)` -- New function `*GalleryImageVersionPublishingProfile.UnmarshalJSON([]byte) error` -- New function `*VirtualMachinesClientDeallocatePollerResponse.Resume(context.Context, *VirtualMachinesClient, string) error` -- New function `*GalleryImageVersionsClientDeletePollerResponse.Resume(context.Context, *GalleryImageVersionsClient, string) error` -- New function `*DedicatedHostsClientCreateOrUpdatePoller.ResumeToken() (string, error)` -- New function `*CloudServicesClientReimagePollerResponse.Resume(context.Context, *CloudServicesClient, string) error` -- New function `*GalleryImagesClientCreateOrUpdatePoller.ResumeToken() (string, error)` -- New function `*VirtualMachineScaleSetsClientUpdateInstancesPoller.Poll(context.Context) (*http.Response, error)` -- New function `*SnapshotsClientListByResourceGroupPager.NextPage(context.Context) bool` -- New function `*VirtualMachinesClientConvertToManagedDisksPoller.FinalResponse(context.Context) (VirtualMachinesClientConvertToManagedDisksResponse, error)` -- New function `*VirtualMachinesClientReapplyPoller.Poll(context.Context) (*http.Response, error)` -- New function `*DiskEncryptionSetsClientListByResourceGroupPager.NextPage(context.Context) bool` -- New function `*DiskRestorePointClientGrantAccessPoller.ResumeToken() (string, error)` -- New function `*VirtualMachinesClientReimagePoller.ResumeToken() (string, error)` -- New function `*DiskEncryptionSetsClientUpdatePoller.FinalResponse(context.Context) (DiskEncryptionSetsClientUpdateResponse, error)` -- New function `*VirtualMachineRunCommandsClientListPager.PageResponse() VirtualMachineRunCommandsClientListResponse` -- New function `*SSHPublicKeysClientListByResourceGroupPager.PageResponse() SSHPublicKeysClientListByResourceGroupResponse` -- New function `*GalleryApplicationVersionsClientDeletePoller.ResumeToken() (string, error)` -- New function `*DedicatedHostsClientDeletePoller.ResumeToken() (string, error)` -- New function `*VirtualMachineScaleSetsClientCreateOrUpdatePoller.FinalResponse(context.Context) (VirtualMachineScaleSetsClientCreateOrUpdateResponse, error)` -- New function `DiskAccessesClientDeletePollerResponse.PollUntilDone(context.Context, time.Duration) (DiskAccessesClientDeleteResponse, error)` -- New function `*VirtualMachineExtensionsClientCreateOrUpdatePoller.FinalResponse(context.Context) (VirtualMachineExtensionsClientCreateOrUpdateResponse, error)` -- New function `SnapshotsClientDeletePollerResponse.PollUntilDone(context.Context, time.Duration) (SnapshotsClientDeleteResponse, error)` -- New function `*ImagesClientCreateOrUpdatePoller.FinalResponse(context.Context) (ImagesClientCreateOrUpdateResponse, error)` -- New function `*LogAnalyticsClientExportThrottledRequestsPollerResponse.Resume(context.Context, *LogAnalyticsClient, string) error` -- New function `*GalleryImageVersionsClientCreateOrUpdatePoller.ResumeToken() (string, error)` -- New function `*LogAnalyticsClientExportThrottledRequestsPoller.Poll(context.Context) (*http.Response, error)` -- New function `*CloudServicesClientDeleteInstancesPollerResponse.Resume(context.Context, *CloudServicesClient, string) error` -- New function `*CapacityReservationGroupsClientListBySubscriptionPager.Err() error` -- New function `*GalleryApplicationVersionsClientDeletePoller.FinalResponse(context.Context) (GalleryApplicationVersionsClientDeleteResponse, error)` -- New function `*LogAnalyticsClientExportRequestRateByIntervalPoller.ResumeToken() (string, error)` -- New function `VirtualMachineExtensionsClientUpdatePollerResponse.PollUntilDone(context.Context, time.Duration) (VirtualMachineExtensionsClientUpdateResponse, error)` -- New function `*VirtualMachinesClientInstallPatchesPoller.ResumeToken() (string, error)` -- New function `*CapacityReservationsClientUpdatePollerResponse.Resume(context.Context, *CapacityReservationsClient, string) error` -- New function `*GalleriesClientDeletePollerResponse.Resume(context.Context, *GalleriesClient, string) error` -- New function `*GalleryImageVersionsClientUpdatePoller.Done() bool` -- New function `*CloudServicesClientRestartPoller.Poll(context.Context) (*http.Response, error)` -- New function `*ImagesClientListByResourceGroupPager.PageResponse() ImagesClientListByResourceGroupResponse` -- New function `*VirtualMachineScaleSetsClientPowerOffPollerResponse.Resume(context.Context, *VirtualMachineScaleSetsClient, string) error` -- New function `*CloudServicesClientRebuildPoller.FinalResponse(context.Context) (CloudServicesClientRebuildResponse, error)` -- New function `*VirtualMachinesClientDeallocatePoller.Poll(context.Context) (*http.Response, error)` -- New function `*VirtualMachineScaleSetVMExtensionsClientDeletePoller.Done() bool` -- New function `*VirtualMachineScaleSetVMsClientDeletePoller.Done() bool` -- New function `*GalleryImageVersionsClientDeletePoller.Poll(context.Context) (*http.Response, error)` -- New function `*VirtualMachineExtensionsClientDeletePoller.Done() bool` -- New function `*CloudServicesClientListAllPager.NextPage(context.Context) bool` -- New function `*SnapshotsClientListPager.NextPage(context.Context) bool` -- New function `RestorePointsClientCreatePollerResponse.PollUntilDone(context.Context, time.Duration) (RestorePointsClientCreateResponse, error)` -- New function `*DiskAccessesClientListByResourceGroupPager.NextPage(context.Context) bool` -- New function `*DedicatedHostGroupsClientListBySubscriptionPager.Err() error` -- New function `*DiskEncryptionSetsClientListAssociatedResourcesPager.Err() error` -- New function `*GalleryApplicationsClientUpdatePollerResponse.Resume(context.Context, *GalleryApplicationsClient, string) error` -- New function `*DedicatedHostsClientCreateOrUpdatePoller.Poll(context.Context) (*http.Response, error)` -- New function `*AvailabilitySetsClientListPager.NextPage(context.Context) bool` -- New function `*VirtualMachinesClientPowerOffPoller.Poll(context.Context) (*http.Response, error)` -- New function `*CloudServiceRoleInstancesClientRestartPoller.Poll(context.Context) (*http.Response, error)` -- New function `*VirtualMachineScaleSetsClientListSKUsPager.Err() error` -- New function `*DiskAccessesClientUpdateAPrivateEndpointConnectionPoller.Done() bool` -- New function `*GalleryApplicationVersionsClientCreateOrUpdatePoller.Done() bool` -- New function `VirtualMachineScaleSetExtensionsClientCreateOrUpdatePollerResponse.PollUntilDone(context.Context, time.Duration) (VirtualMachineScaleSetExtensionsClientCreateOrUpdateResponse, error)` -- New function `CapacityReservationsClientUpdatePollerResponse.PollUntilDone(context.Context, time.Duration) (CapacityReservationsClientUpdateResponse, error)` -- New function `*VirtualMachineScaleSetVMExtensionsClientDeletePollerResponse.Resume(context.Context, *VirtualMachineScaleSetVMExtensionsClient, string) error` -- New function `*DiskAccessesClientCreateOrUpdatePoller.ResumeToken() (string, error)` -- New function `*VirtualMachineScaleSetVMsClientDeletePoller.Poll(context.Context) (*http.Response, error)` -- New function `*VirtualMachinesClientPowerOffPoller.ResumeToken() (string, error)` -- New function `*VirtualMachinesClientAssessPatchesPollerResponse.Resume(context.Context, *VirtualMachinesClient, string) error` -- New function `*GalleryImagesClientCreateOrUpdatePollerResponse.Resume(context.Context, *GalleryImagesClient, string) error` -- New function `ImagesClientDeletePollerResponse.PollUntilDone(context.Context, time.Duration) (ImagesClientDeleteResponse, error)` -- New function `*VirtualMachineScaleSetVMRunCommandsClientCreateOrUpdatePoller.Done() bool` -- New function `*CapacityReservationsClientDeletePollerResponse.Resume(context.Context, *CapacityReservationsClient, string) error` -- New function `*VirtualMachineScaleSetsClientPowerOffPoller.ResumeToken() (string, error)` -- New function `*VirtualMachineScaleSetExtensionsClientDeletePoller.ResumeToken() (string, error)` -- New function `*RestorePointCollectionsClientListPager.PageResponse() RestorePointCollectionsClientListResponse` -- New function `*VirtualMachineScaleSetVMRunCommandsClientDeletePoller.Done() bool` -- New function `*SSHPublicKeysClientListByResourceGroupPager.NextPage(context.Context) bool` -- New function `*SnapshotsClientRevokeAccessPoller.Poll(context.Context) (*http.Response, error)` -- New function `*GalleryApplicationVersionsClientCreateOrUpdatePollerResponse.Resume(context.Context, *GalleryApplicationVersionsClient, string) error` -- New function `*GalleryImageVersionsClientUpdatePoller.Poll(context.Context) (*http.Response, error)` -- New function `*VirtualMachinesClientRedeployPoller.ResumeToken() (string, error)` -- New function `LogAnalyticsClientExportRequestRateByIntervalPollerResponse.PollUntilDone(context.Context, time.Duration) (LogAnalyticsClientExportRequestRateByIntervalResponse, error)` -- New function `*VirtualMachineRunCommandsClientCreateOrUpdatePoller.Done() bool` -- New function `*VirtualMachinesClientRunCommandPoller.ResumeToken() (string, error)` -- New function `*SnapshotsClientCreateOrUpdatePollerResponse.Resume(context.Context, *SnapshotsClient, string) error` -- New function `CapacityReservationsClientCreateOrUpdatePollerResponse.PollUntilDone(context.Context, time.Duration) (CapacityReservationsClientCreateOrUpdateResponse, error)` -- New function `*DisksClientRevokeAccessPoller.Poll(context.Context) (*http.Response, error)` -- New function `*VirtualMachineScaleSetVMsClientReimageAllPoller.FinalResponse(context.Context) (VirtualMachineScaleSetVMsClientReimageAllResponse, error)` -- New function `*GalleryApplicationsClientListByGalleryPager.Err() error` -- New function `*VirtualMachinesClientConvertToManagedDisksPoller.ResumeToken() (string, error)` -- New function `DisksClientGrantAccessPollerResponse.PollUntilDone(context.Context, time.Duration) (DisksClientGrantAccessResponse, error)` -- New function `*LogAnalyticsClientExportThrottledRequestsPoller.Done() bool` -- New function `*DedicatedHostsClientListByHostGroupPager.NextPage(context.Context) bool` -- New function `*DedicatedHostsClientCreateOrUpdatePollerResponse.Resume(context.Context, *DedicatedHostsClient, string) error` -- New function `*VirtualMachineScaleSetVMRunCommandsClientListPager.NextPage(context.Context) bool` -- New function `*LogAnalyticsClientExportRequestRateByIntervalPoller.Done() bool` -- New function `*VirtualMachineScaleSetExtensionsClientUpdatePoller.Done() bool` -- New function `*CloudServicesClientStartPoller.Done() bool` -- New function `*GalleriesClientCreateOrUpdatePoller.FinalResponse(context.Context) (GalleriesClientCreateOrUpdateResponse, error)` -- New function `*CloudServiceRoleInstancesClientReimagePoller.FinalResponse(context.Context) (CloudServiceRoleInstancesClientReimageResponse, error)` -- New function `*CloudServiceRoleInstancesClientRebuildPoller.Done() bool` -- New function `*VirtualMachineScaleSetsClientGetOSUpgradeHistoryPager.NextPage(context.Context) bool` -- New function `*DiskAccessesClientDeleteAPrivateEndpointConnectionPoller.Done() bool` -- New function `*SnapshotsClientDeletePoller.Done() bool` -- New function `*CloudServiceOperatingSystemsClientListOSFamiliesPager.Err() error` -- New function `*VirtualMachineRunCommandsClientUpdatePollerResponse.Resume(context.Context, *VirtualMachineRunCommandsClient, string) error` -- New function `*VirtualMachineScaleSetVMExtensionsClientUpdatePoller.Done() bool` -- New function `VirtualMachineScaleSetsClientDeallocatePollerResponse.PollUntilDone(context.Context, time.Duration) (VirtualMachineScaleSetsClientDeallocateResponse, error)` -- New function `*DiskEncryptionSetsClientDeletePoller.FinalResponse(context.Context) (DiskEncryptionSetsClientDeleteResponse, error)` -- New function `*SnapshotsClientRevokeAccessPoller.ResumeToken() (string, error)` -- New function `CloudServicesClientCreateOrUpdatePollerResponse.PollUntilDone(context.Context, time.Duration) (CloudServicesClientCreateOrUpdateResponse, error)` -- New function `*VirtualMachineExtensionsClientCreateOrUpdatePoller.ResumeToken() (string, error)` -- New function `*GalleryApplicationVersionsClientCreateOrUpdatePoller.FinalResponse(context.Context) (GalleryApplicationVersionsClientCreateOrUpdateResponse, error)` -- New function `*VirtualMachineScaleSetsClientReimageAllPoller.FinalResponse(context.Context) (VirtualMachineScaleSetsClientReimageAllResponse, error)` -- New function `*VirtualMachineScaleSetVMsClientRedeployPoller.Poll(context.Context) (*http.Response, error)` -- New function `*VirtualMachineScaleSetVMsClientPowerOffPoller.Done() bool` -- New function `VirtualMachineScaleSetVMExtensionsClientUpdatePollerResponse.PollUntilDone(context.Context, time.Duration) (VirtualMachineScaleSetVMExtensionsClientUpdateResponse, error)` -- New function `*DedicatedHostsClientUpdatePoller.FinalResponse(context.Context) (DedicatedHostsClientUpdateResponse, error)` -- New function `*VirtualMachineScaleSetsClientListByLocationPager.NextPage(context.Context) bool` -- New function `*ImagesClientListPager.PageResponse() ImagesClientListResponse` -- New function `*DedicatedHostsClientListByHostGroupPager.Err() error` -- New function `*VirtualMachinesClientDeallocatePoller.ResumeToken() (string, error)` -- New function `*CloudServicesClientUpdatePollerResponse.Resume(context.Context, *CloudServicesClient, string) error` -- New function `*RestorePointCollectionsClientDeletePoller.Done() bool` -- New function `*DisksClientGrantAccessPoller.Poll(context.Context) (*http.Response, error)` -- New function `*VirtualMachineScaleSetVMRunCommandsClientCreateOrUpdatePoller.Poll(context.Context) (*http.Response, error)` -- New function `*VirtualMachineScaleSetsClientStartPoller.ResumeToken() (string, error)` -- New function `*ImagesClientUpdatePoller.Poll(context.Context) (*http.Response, error)` -- New function `SnapshotsClientRevokeAccessPollerResponse.PollUntilDone(context.Context, time.Duration) (SnapshotsClientRevokeAccessResponse, error)` -- New function `*VirtualMachineScaleSetVMsClientReimageAllPoller.Poll(context.Context) (*http.Response, error)` -- New function `*DiskAccessesClientUpdateAPrivateEndpointConnectionPoller.FinalResponse(context.Context) (DiskAccessesClientUpdateAPrivateEndpointConnectionResponse, error)` -- New function `*VirtualMachinesClientReimagePoller.Poll(context.Context) (*http.Response, error)` -- New function `VirtualMachineScaleSetVMsClientRedeployPollerResponse.PollUntilDone(context.Context, time.Duration) (VirtualMachineScaleSetVMsClientRedeployResponse, error)` -- New function `RestorePointCollectionsClientDeletePollerResponse.PollUntilDone(context.Context, time.Duration) (RestorePointCollectionsClientDeleteResponse, error)` -- New function `VirtualMachineScaleSetExtensionsClientDeletePollerResponse.PollUntilDone(context.Context, time.Duration) (VirtualMachineScaleSetExtensionsClientDeleteResponse, error)` -- New function `*VirtualMachineScaleSetsClientReimageAllPoller.Poll(context.Context) (*http.Response, error)` -- New function `*VirtualMachineScaleSetsClientRestartPoller.Poll(context.Context) (*http.Response, error)` -- New function `DisksClientRevokeAccessPollerResponse.PollUntilDone(context.Context, time.Duration) (DisksClientRevokeAccessResponse, error)` -- New function `*VirtualMachineScaleSetsClientDeallocatePoller.Done() bool` -- New function `*VirtualMachineScaleSetsClientDeletePollerResponse.Resume(context.Context, *VirtualMachineScaleSetsClient, string) error` -- New function `*DisksClientCreateOrUpdatePoller.Poll(context.Context) (*http.Response, error)` -- New function `*SnapshotsClientCreateOrUpdatePoller.Poll(context.Context) (*http.Response, error)` -- New function `*GalleryApplicationVersionsClientListByGalleryApplicationPager.Err() error` -- New function `*CapacityReservationGroupsClientListBySubscriptionPager.NextPage(context.Context) bool` -- New function `*VirtualMachineScaleSetsClientReimagePoller.ResumeToken() (string, error)` -- New function `*CloudServicesClientCreateOrUpdatePoller.Done() bool` -- New function `*AvailabilitySetsClientListBySubscriptionPager.NextPage(context.Context) bool` -- New function `*VirtualMachineScaleSetVMsClientDeallocatePoller.ResumeToken() (string, error)` -- New function `*VirtualMachinesClientDeletePoller.ResumeToken() (string, error)` -- New function `*VirtualMachineScaleSetVMsClientRedeployPoller.Done() bool` -- New function `ProximityPlacementGroupUpdate.MarshalJSON() ([]byte, error)` -- New function `*SnapshotsClientGrantAccessPoller.Poll(context.Context) (*http.Response, error)` -- New function `*GallerySharingProfileClientUpdatePoller.Done() bool` -- New function `*VirtualMachinesClientReapplyPoller.Done() bool` -- New function `VirtualMachineScaleSetVMsClientRestartPollerResponse.PollUntilDone(context.Context, time.Duration) (VirtualMachineScaleSetVMsClientRestartResponse, error)` -- New function `*VirtualMachineScaleSetVMExtensionsClientCreateOrUpdatePoller.Done() bool` -- New function `*VirtualMachineScaleSetVMsClientReimagePoller.ResumeToken() (string, error)` -- New function `VirtualMachineScaleSetVMsClientReimagePollerResponse.PollUntilDone(context.Context, time.Duration) (VirtualMachineScaleSetVMsClientReimageResponse, error)` -- New function `*CloudServicesClientRestartPoller.FinalResponse(context.Context) (CloudServicesClientRestartResponse, error)` -- New function `*CloudServicesClientDeletePollerResponse.Resume(context.Context, *CloudServicesClient, string) error` -- New function `*VirtualMachineScaleSetVMsClientDeallocatePollerResponse.Resume(context.Context, *VirtualMachineScaleSetVMsClient, string) error` -- New function `*DiskEncryptionSetsClientListAssociatedResourcesPager.NextPage(context.Context) bool` -- New function `*VirtualMachineScaleSetVMsClientRestartPoller.Poll(context.Context) (*http.Response, error)` -- New function `*VirtualMachinesClientDeallocatePoller.Done() bool` -- New function `*GalleryApplicationsClientCreateOrUpdatePoller.Done() bool` -- New function `*VirtualMachineScaleSetVMExtensionsClientUpdatePoller.FinalResponse(context.Context) (VirtualMachineScaleSetVMExtensionsClientUpdateResponse, error)` -- New function `*SnapshotsClientListByResourceGroupPager.PageResponse() SnapshotsClientListByResourceGroupResponse` -- New function `*SnapshotsClientListPager.Err() error` -- New function `*VirtualMachineScaleSetVMsClientRestartPoller.ResumeToken() (string, error)` -- New function `*VirtualMachineRunCommandsClientUpdatePoller.ResumeToken() (string, error)` -- New function `*DiskAccessesClientUpdatePoller.FinalResponse(context.Context) (DiskAccessesClientUpdateResponse, error)` -- New function `*CloudServiceRoleInstancesClientListPager.PageResponse() CloudServiceRoleInstancesClientListResponse` -- New function `*VirtualMachineScaleSetVMsClientDeallocatePoller.Done() bool` -- New function `*SnapshotsClientUpdatePoller.Done() bool` -- New function `*GalleryApplicationsClientUpdatePoller.FinalResponse(context.Context) (GalleryApplicationsClientUpdateResponse, error)` -- New function `*DiskEncryptionSetsClientCreateOrUpdatePoller.FinalResponse(context.Context) (DiskEncryptionSetsClientCreateOrUpdateResponse, error)` -- New function `*SnapshotsClientListByResourceGroupPager.Err() error` -- New function `*VirtualMachineScaleSetRollingUpgradesClientStartExtensionUpgradePoller.Done() bool` -- New function `*CloudServicesClientDeletePoller.ResumeToken() (string, error)` -- New function `*GallerySharingProfileClientUpdatePoller.ResumeToken() (string, error)` -- New function `*DedicatedHostGroupsClientListBySubscriptionPager.NextPage(context.Context) bool` -- New function `*CloudServicesClientDeletePoller.Poll(context.Context) (*http.Response, error)` -- New function `*GalleryApplicationVersionsClientCreateOrUpdatePoller.Poll(context.Context) (*http.Response, error)` -- New function `*VirtualMachineScaleSetsClientDeletePoller.ResumeToken() (string, error)` -- New function `*VirtualMachinesClientPerformMaintenancePoller.FinalResponse(context.Context) (VirtualMachinesClientPerformMaintenanceResponse, error)` -- New function `*ProximityPlacementGroupsClientListByResourceGroupPager.PageResponse() ProximityPlacementGroupsClientListByResourceGroupResponse` -- New function `*GalleriesClientUpdatePollerResponse.Resume(context.Context, *GalleriesClient, string) error` -- New function `*VirtualMachineScaleSetExtensionsClientCreateOrUpdatePoller.ResumeToken() (string, error)` -- New function `VirtualMachineScaleSetsClientUpdatePollerResponse.PollUntilDone(context.Context, time.Duration) (VirtualMachineScaleSetsClientUpdateResponse, error)` -- New function `*DisksClientUpdatePollerResponse.Resume(context.Context, *DisksClient, string) error` -- New function `VirtualMachineScaleSetsClientDeleteInstancesPollerResponse.PollUntilDone(context.Context, time.Duration) (VirtualMachineScaleSetsClientDeleteInstancesResponse, error)` -- New function `VirtualMachineScaleSetsClientReimagePollerResponse.PollUntilDone(context.Context, time.Duration) (VirtualMachineScaleSetsClientReimageResponse, error)` -- New function `*ImagesClientDeletePoller.ResumeToken() (string, error)` -- New function `*VirtualMachinesClientRedeployPoller.Poll(context.Context) (*http.Response, error)` -- New function `*VirtualMachineScaleSetVMRunCommandsClientDeletePoller.ResumeToken() (string, error)` -- New function `*VirtualMachineScaleSetVMsClientStartPoller.ResumeToken() (string, error)` -- New function `*VirtualMachineScaleSetExtensionsClientDeletePoller.Done() bool` -- New function `*SnapshotsClientUpdatePoller.Poll(context.Context) (*http.Response, error)` -- New function `*VirtualMachineScaleSetsClientRestartPoller.ResumeToken() (string, error)` -- New function `*DiskAccessesClientListPager.NextPage(context.Context) bool` -- New function `*GalleriesClientListPager.Err() error` -- New function `*CapacityReservationsClientDeletePoller.FinalResponse(context.Context) (CapacityReservationsClientDeleteResponse, error)` -- New function `*VirtualMachineScaleSetRollingUpgradesClientStartOSUpgradePoller.ResumeToken() (string, error)` -- New function `*GalleryImageVersionsClientListByGalleryImagePager.PageResponse() GalleryImageVersionsClientListByGalleryImageResponse` -- New function `*VirtualMachinesClientRedeployPoller.Done() bool` -- New function `VirtualMachinesClientDeletePollerResponse.PollUntilDone(context.Context, time.Duration) (VirtualMachinesClientDeleteResponse, error)` -- New function `DiskRestorePointClientRevokeAccessPollerResponse.PollUntilDone(context.Context, time.Duration) (DiskRestorePointClientRevokeAccessResponse, error)` -- New function `*VirtualMachineScaleSetVMRunCommandsClientDeletePoller.Poll(context.Context) (*http.Response, error)` -- New function `*CloudServicesClientCreateOrUpdatePoller.FinalResponse(context.Context) (CloudServicesClientCreateOrUpdateResponse, error)` -- New function `*DiskAccessesClientListPrivateEndpointConnectionsPager.PageResponse() DiskAccessesClientListPrivateEndpointConnectionsResponse` -- New function `*CapacityReservationsClientCreateOrUpdatePoller.ResumeToken() (string, error)` -- New function `*ImagesClientDeletePoller.FinalResponse(context.Context) (ImagesClientDeleteResponse, error)` -- New function `*CapacityReservationGroupsClientListByResourceGroupPager.Err() error` -- New function `*CloudServiceOperatingSystemsClientListOSVersionsPager.Err() error` -- New function `*GalleryApplicationsClientUpdatePoller.Poll(context.Context) (*http.Response, error)` -- New function `*CloudServicesClientReimagePoller.Done() bool` -- New function `*VirtualMachinesClientRestartPollerResponse.Resume(context.Context, *VirtualMachinesClient, string) error` -- New function `ImagesClientUpdatePollerResponse.PollUntilDone(context.Context, time.Duration) (ImagesClientUpdateResponse, error)` -- New function `ThrottledRequestsInput.MarshalJSON() ([]byte, error)` -- New function `*VirtualMachinesClientConvertToManagedDisksPollerResponse.Resume(context.Context, *VirtualMachinesClient, string) error` -- New function `*SharedGalleryImagesClientListPager.PageResponse() SharedGalleryImagesClientListResponse` -- New function `*VirtualMachineScaleSetRollingUpgradesClientCancelPoller.FinalResponse(context.Context) (VirtualMachineScaleSetRollingUpgradesClientCancelResponse, error)` -- New function `*VirtualMachineScaleSetsClientPowerOffPoller.FinalResponse(context.Context) (VirtualMachineScaleSetsClientPowerOffResponse, error)` -- New function `*VirtualMachineScaleSetsClientSetOrchestrationServiceStatePoller.Poll(context.Context) (*http.Response, error)` -- New function `*VirtualMachineScaleSetsClientRedeployPoller.ResumeToken() (string, error)` -- New function `*DiskEncryptionSetsClientCreateOrUpdatePollerResponse.Resume(context.Context, *DiskEncryptionSetsClient, string) error` -- New function `*GalleryImageVersionsClientUpdatePoller.FinalResponse(context.Context) (GalleryImageVersionsClientUpdateResponse, error)` -- New function `*RestorePointCollectionsClientDeletePoller.FinalResponse(context.Context) (RestorePointCollectionsClientDeleteResponse, error)` -- New function `GalleryApplicationsClientUpdatePollerResponse.PollUntilDone(context.Context, time.Duration) (GalleryApplicationsClientUpdateResponse, error)` -- New function `*CapacityReservationsClientDeletePoller.Poll(context.Context) (*http.Response, error)` -- New function `*VirtualMachineScaleSetVMsClientReimagePoller.FinalResponse(context.Context) (VirtualMachineScaleSetVMsClientReimageResponse, error)` -- New function `*CloudServicesClientUpdatePoller.Poll(context.Context) (*http.Response, error)` -- New function `*CloudServicesUpdateDomainClientListUpdateDomainsPager.NextPage(context.Context) bool` -- New function `*VirtualMachineScaleSetVMExtensionsClientCreateOrUpdatePoller.Poll(context.Context) (*http.Response, error)` -- New function `*DiskRestorePointClientListByRestorePointPager.PageResponse() DiskRestorePointClientListByRestorePointResponse` -- New function `*VirtualMachinesClientInstallPatchesPoller.Done() bool` -- New function `*VirtualMachinesClientRedeployPollerResponse.Resume(context.Context, *VirtualMachinesClient, string) error` -- New function `*VirtualMachineScaleSetsClientDeleteInstancesPollerResponse.Resume(context.Context, *VirtualMachineScaleSetsClient, string) error` -- New function `*CloudServiceRoleInstancesClientRestartPoller.Done() bool` -- New function `*VirtualMachineScaleSetsClientCreateOrUpdatePollerResponse.Resume(context.Context, *VirtualMachineScaleSetsClient, string) error` -- New function `*SharedGalleryImageVersionsClientListPager.NextPage(context.Context) bool` -- New function `*CloudServiceRoleInstancesClientRebuildPoller.FinalResponse(context.Context) (CloudServiceRoleInstancesClientRebuildResponse, error)` -- New function `*GalleryImageVersionsClientCreateOrUpdatePoller.FinalResponse(context.Context) (GalleryImageVersionsClientCreateOrUpdateResponse, error)` -- New function `*VirtualMachineScaleSetsClientSetOrchestrationServiceStatePoller.ResumeToken() (string, error)` -- New function `*ImagesClientDeletePoller.Poll(context.Context) (*http.Response, error)` -- New function `*VirtualMachineScaleSetsClientListAllPager.NextPage(context.Context) bool` -- New function `*DiskEncryptionSetsClientCreateOrUpdatePoller.Poll(context.Context) (*http.Response, error)` -- New function `*VirtualMachinesClientListPager.NextPage(context.Context) bool` -- New function `*GalleryImagesClientUpdatePoller.ResumeToken() (string, error)` -- New function `*VirtualMachinesClientStartPoller.ResumeToken() (string, error)` -- New function `*CloudServiceRoleInstancesClientRestartPoller.ResumeToken() (string, error)` -- New function `VirtualMachinesClientAssessPatchesPollerResponse.PollUntilDone(context.Context, time.Duration) (VirtualMachinesClientAssessPatchesResponse, error)` -- New function `*RestorePointsClientCreatePollerResponse.Resume(context.Context, *RestorePointsClient, string) error` -- New function `CloudServicesUpdateDomainClientWalkUpdateDomainPollerResponse.PollUntilDone(context.Context, time.Duration) (CloudServicesUpdateDomainClientWalkUpdateDomainResponse, error)` -- New function `*SnapshotsClientDeletePollerResponse.Resume(context.Context, *SnapshotsClient, string) error` -- New function `*CapacityReservationsClientCreateOrUpdatePoller.Poll(context.Context) (*http.Response, error)` -- New function `*DedicatedHostsClientDeletePoller.Poll(context.Context) (*http.Response, error)` -- New function `*VirtualMachineScaleSetVMsClientRunCommandPollerResponse.Resume(context.Context, *VirtualMachineScaleSetVMsClient, string) error` -- New function `*DisksClientListByResourceGroupPager.NextPage(context.Context) bool` -- New function `*DisksClientCreateOrUpdatePoller.FinalResponse(context.Context) (DisksClientCreateOrUpdateResponse, error)` -- New function `*CloudServiceRoleInstancesClientDeletePoller.Poll(context.Context) (*http.Response, error)` -- New function `*VirtualMachineScaleSetVMsClientPowerOffPoller.Poll(context.Context) (*http.Response, error)` -- New function `*VirtualMachineRunCommandsClientCreateOrUpdatePollerResponse.Resume(context.Context, *VirtualMachineRunCommandsClient, string) error` -- New function `*CloudServiceOperatingSystemsClientListOSFamiliesPager.PageResponse() CloudServiceOperatingSystemsClientListOSFamiliesResponse` -- New function `SnapshotsClientUpdatePollerResponse.PollUntilDone(context.Context, time.Duration) (SnapshotsClientUpdateResponse, error)` -- New function `*CloudServicesClientCreateOrUpdatePollerResponse.Resume(context.Context, *CloudServicesClient, string) error` -- New function `DiskEncryptionSetsClientDeletePollerResponse.PollUntilDone(context.Context, time.Duration) (DiskEncryptionSetsClientDeleteResponse, error)` -- New function `*VirtualMachineScaleSetExtensionsClientDeletePoller.Poll(context.Context) (*http.Response, error)` -- New function `GalleryImageVersionsClientCreateOrUpdatePollerResponse.PollUntilDone(context.Context, time.Duration) (GalleryImageVersionsClientCreateOrUpdateResponse, error)` -- New function `*VirtualMachineScaleSetVMsClientReimageAllPoller.ResumeToken() (string, error)` -- New function `*VirtualMachinesClientRunCommandPoller.Done() bool` -- New function `*RestorePointsClientDeletePollerResponse.Resume(context.Context, *RestorePointsClient, string) error` -- New function `*DisksClientDeletePoller.Done() bool` -- New function `*VirtualMachineScaleSetRollingUpgradesClientStartOSUpgradePoller.Poll(context.Context) (*http.Response, error)` -- New function `*VirtualMachineScaleSetsClientDeallocatePoller.FinalResponse(context.Context) (VirtualMachineScaleSetsClientDeallocateResponse, error)` -- New function `*LogAnalyticsClientExportThrottledRequestsPoller.FinalResponse(context.Context) (LogAnalyticsClientExportThrottledRequestsResponse, error)` -- New function `*VirtualMachineExtensionsClientUpdatePoller.Done() bool` -- New function `*VirtualMachineScaleSetsClientDeallocatePoller.Poll(context.Context) (*http.Response, error)` -- New function `*DisksClientUpdatePoller.Done() bool` -- New function `*CloudServiceRoleInstancesClientDeletePoller.Done() bool` -- New function `*LogAnalyticsClientExportRequestRateByIntervalPoller.FinalResponse(context.Context) (LogAnalyticsClientExportRequestRateByIntervalResponse, error)` -- New function `VirtualMachineScaleSetsClientCreateOrUpdatePollerResponse.PollUntilDone(context.Context, time.Duration) (VirtualMachineScaleSetsClientCreateOrUpdateResponse, error)` -- New function `*CloudServicesClientReimagePoller.Poll(context.Context) (*http.Response, error)` -- New function `VirtualMachineScaleSetVMExtensionsClientCreateOrUpdatePollerResponse.PollUntilDone(context.Context, time.Duration) (VirtualMachineScaleSetVMExtensionsClientCreateOrUpdateResponse, error)` -- New function `*VirtualMachinesClientRestartPoller.FinalResponse(context.Context) (VirtualMachinesClientRestartResponse, error)` -- New function `*VirtualMachinesClientStartPoller.Poll(context.Context) (*http.Response, error)` -- New function `*CloudServiceRoleInstancesClientRebuildPoller.Poll(context.Context) (*http.Response, error)` -- New function `*VirtualMachineScaleSetsClientDeallocatePollerResponse.Resume(context.Context, *VirtualMachineScaleSetsClient, string) error` -- New function `*VirtualMachineScaleSetVMRunCommandsClientUpdatePoller.FinalResponse(context.Context) (VirtualMachineScaleSetVMRunCommandsClientUpdateResponse, error)` -- New function `*CloudServiceRolesClientListPager.Err() error` -- New function `*VirtualMachineScaleSetVMsClientRedeployPollerResponse.Resume(context.Context, *VirtualMachineScaleSetVMsClient, string) error` -- New function `*GalleryApplicationsClientDeletePoller.Done() bool` -- New function `*VirtualMachineRunCommandsClientListPager.Err() error` -- New function `*ImagesClientUpdatePoller.FinalResponse(context.Context) (ImagesClientUpdateResponse, error)` -- New function `*VirtualMachineExtensionsClientCreateOrUpdatePoller.Done() bool` -- New function `*GalleriesClientDeletePoller.ResumeToken() (string, error)` -- New function `*CloudServiceRolesClientListPager.NextPage(context.Context) bool` -- New function `*CloudServicesClientPowerOffPoller.Done() bool` -- New function `*GalleryImagesClientDeletePoller.Done() bool` -- New function `VirtualMachinesClientReapplyPollerResponse.PollUntilDone(context.Context, time.Duration) (VirtualMachinesClientReapplyResponse, error)` -- New function `*VirtualMachinesClientDeallocatePoller.FinalResponse(context.Context) (VirtualMachinesClientDeallocateResponse, error)` -- New function `*GalleryImagesClientCreateOrUpdatePoller.Done() bool` -- New function `*VirtualMachinesClientListAllPager.NextPage(context.Context) bool` -- New function `*GalleryApplicationsClientDeletePoller.Poll(context.Context) (*http.Response, error)` -- New function `*DedicatedHostGroupsClientListByResourceGroupPager.PageResponse() DedicatedHostGroupsClientListByResourceGroupResponse` -- New function `*VirtualMachineScaleSetVMRunCommandsClientCreateOrUpdatePoller.ResumeToken() (string, error)` -- New function `*VirtualMachineRunCommandsClientCreateOrUpdatePoller.Poll(context.Context) (*http.Response, error)` -- New function `VirtualMachinesClientConvertToManagedDisksPollerResponse.PollUntilDone(context.Context, time.Duration) (VirtualMachinesClientConvertToManagedDisksResponse, error)` -- New function `*CloudServiceRoleInstancesClientReimagePoller.ResumeToken() (string, error)` -- New function `VirtualMachinesClientPerformMaintenancePollerResponse.PollUntilDone(context.Context, time.Duration) (VirtualMachinesClientPerformMaintenanceResponse, error)` -- New function `*VirtualMachineScaleSetVMExtensionsClientDeletePoller.ResumeToken() (string, error)` -- New function `*DiskAccessesClientListPrivateEndpointConnectionsPager.Err() error` -- New function `VirtualMachinesClientReimagePollerResponse.PollUntilDone(context.Context, time.Duration) (VirtualMachinesClientReimageResponse, error)` -- New function `VirtualMachineScaleSetVMsClientDeletePollerResponse.PollUntilDone(context.Context, time.Duration) (VirtualMachineScaleSetVMsClientDeleteResponse, error)` -- New function `CloudServiceRoleInstancesClientRebuildPollerResponse.PollUntilDone(context.Context, time.Duration) (CloudServiceRoleInstancesClientRebuildResponse, error)` -- New function `*GalleryImagesClientUpdatePoller.Done() bool` -- New function `*VirtualMachineExtensionsClientUpdatePoller.ResumeToken() (string, error)` -- New function `DiskEncryptionSetsClientCreateOrUpdatePollerResponse.PollUntilDone(context.Context, time.Duration) (DiskEncryptionSetsClientCreateOrUpdateResponse, error)` -- New function `*DisksClientUpdatePoller.Poll(context.Context) (*http.Response, error)` -- New function `GallerySharingProfileClientUpdatePollerResponse.PollUntilDone(context.Context, time.Duration) (GallerySharingProfileClientUpdateResponse, error)` -- New function `*DiskAccessesClientUpdateAPrivateEndpointConnectionPollerResponse.Resume(context.Context, *DiskAccessesClient, string) error` -- New function `*VirtualMachinesClientCapturePoller.FinalResponse(context.Context) (VirtualMachinesClientCaptureResponse, error)` -- New function `*VirtualMachinesClientUpdatePollerResponse.Resume(context.Context, *VirtualMachinesClient, string) error` -- New function `*CloudServiceRoleInstancesClientListPager.NextPage(context.Context) bool` -- New function `VirtualMachineScaleSetVMsClientStartPollerResponse.PollUntilDone(context.Context, time.Duration) (VirtualMachineScaleSetVMsClientStartResponse, error)` -- New function `DiskAccessesClientUpdateAPrivateEndpointConnectionPollerResponse.PollUntilDone(context.Context, time.Duration) (DiskAccessesClientUpdateAPrivateEndpointConnectionResponse, error)` -- New function `*RestorePointsClientCreatePoller.Poll(context.Context) (*http.Response, error)` -- New function `*VirtualMachinesClientListByLocationPager.Err() error` -- New function `VirtualMachineScaleSetRollingUpgradesClientStartOSUpgradePollerResponse.PollUntilDone(context.Context, time.Duration) (VirtualMachineScaleSetRollingUpgradesClientStartOSUpgradeResponse, error)` -- New function `CloudServicesClientUpdatePollerResponse.PollUntilDone(context.Context, time.Duration) (CloudServicesClientUpdateResponse, error)` -- New function `*CloudServicesUpdateDomainClientWalkUpdateDomainPoller.ResumeToken() (string, error)` -- New function `*VirtualMachinesClientRestartPoller.Done() bool` -- New function `*DiskEncryptionSetsClientCreateOrUpdatePoller.ResumeToken() (string, error)` -- New function `*VirtualMachineScaleSetRollingUpgradesClientCancelPoller.Poll(context.Context) (*http.Response, error)` -- New function `*SnapshotsClientUpdatePollerResponse.Resume(context.Context, *SnapshotsClient, string) error` -- New function `*GalleriesClientListPager.PageResponse() GalleriesClientListResponse` -- New function `VirtualMachinesClientUpdatePollerResponse.PollUntilDone(context.Context, time.Duration) (VirtualMachinesClientUpdateResponse, error)` -- New function `*CloudServicesUpdateDomainClientWalkUpdateDomainPoller.Poll(context.Context) (*http.Response, error)` -- New function `VirtualMachinesClientCreateOrUpdatePollerResponse.PollUntilDone(context.Context, time.Duration) (VirtualMachinesClientCreateOrUpdateResponse, error)` -- New function `*CloudServicesClientPowerOffPollerResponse.Resume(context.Context, *CloudServicesClient, string) error` -- New function `*RestorePointCollectionsClientListAllPager.NextPage(context.Context) bool` -- New function `*VirtualMachineScaleSetsClientReimageAllPoller.Done() bool` -- New function `*VirtualMachineScaleSetVMsClientUpdatePollerResponse.Resume(context.Context, *VirtualMachineScaleSetVMsClient, string) error` -- New function `*VirtualMachinesClientRedeployPoller.FinalResponse(context.Context) (VirtualMachinesClientRedeployResponse, error)` -- New function `CloudServiceRoleInstancesClientReimagePollerResponse.PollUntilDone(context.Context, time.Duration) (CloudServiceRoleInstancesClientReimageResponse, error)` -- New function `VirtualMachinesClientInstallPatchesPollerResponse.PollUntilDone(context.Context, time.Duration) (VirtualMachinesClientInstallPatchesResponse, error)` -- New function `*GalleryImagesClientUpdatePollerResponse.Resume(context.Context, *GalleryImagesClient, string) error` -- New function `*CloudServicesClientListPager.Err() error` -- New function `*GalleryApplicationVersionsClientUpdatePoller.Poll(context.Context) (*http.Response, error)` -- New function `*VirtualMachinesClientReapplyPoller.FinalResponse(context.Context) (VirtualMachinesClientReapplyResponse, error)` -- New function `*GalleryApplicationVersionsClientDeletePoller.Done() bool` -- New function `*VirtualMachineScaleSetExtensionsClientListPager.PageResponse() VirtualMachineScaleSetExtensionsClientListResponse` -- New function `VirtualMachineRunCommandsClientUpdatePollerResponse.PollUntilDone(context.Context, time.Duration) (VirtualMachineRunCommandsClientUpdateResponse, error)` -- New function `*SSHPublicKeysClientListBySubscriptionPager.NextPage(context.Context) bool` -- New function `*VirtualMachineScaleSetsClientReimagePoller.FinalResponse(context.Context) (VirtualMachineScaleSetsClientReimageResponse, error)` -- New function `*CloudServicesUpdateDomainClientListUpdateDomainsPager.Err() error` -- New function `GalleryImageVersionsClientUpdatePollerResponse.PollUntilDone(context.Context, time.Duration) (GalleryImageVersionsClientUpdateResponse, error)` -- New function `*GalleriesClientListPager.NextPage(context.Context) bool` -- New function `*VirtualMachineScaleSetVMRunCommandsClientUpdatePoller.Poll(context.Context) (*http.Response, error)` -- New function `CloudServicesClientRestartPollerResponse.PollUntilDone(context.Context, time.Duration) (CloudServicesClientRestartResponse, error)` -- New function `*DiskEncryptionSetsClientListPager.NextPage(context.Context) bool` -- New function `*CapacityReservationsClientCreateOrUpdatePoller.Done() bool` -- New function `*VirtualMachineExtensionsClientCreateOrUpdatePollerResponse.Resume(context.Context, *VirtualMachineExtensionsClient, string) error` -- New function `*CloudServicesClientUpdatePoller.FinalResponse(context.Context) (CloudServicesClientUpdateResponse, error)` -- New function `*CloudServicesClientPowerOffPoller.FinalResponse(context.Context) (CloudServicesClientPowerOffResponse, error)` -- New function `*VirtualMachineScaleSetVMRunCommandsClientCreateOrUpdatePollerResponse.Resume(context.Context, *VirtualMachineScaleSetVMRunCommandsClient, string) error` -- New function `*DisksClientListPager.NextPage(context.Context) bool` -- New function `*VirtualMachineExtensionsClientUpdatePoller.FinalResponse(context.Context) (VirtualMachineExtensionsClientUpdateResponse, error)` -- New function `*VirtualMachineScaleSetVMsClientDeletePoller.FinalResponse(context.Context) (VirtualMachineScaleSetVMsClientDeleteResponse, error)` -- New function `*VirtualMachineScaleSetsClientUpdateInstancesPoller.FinalResponse(context.Context) (VirtualMachineScaleSetsClientUpdateInstancesResponse, error)` -- New function `*VirtualMachineScaleSetsClientSetOrchestrationServiceStatePoller.FinalResponse(context.Context) (VirtualMachineScaleSetsClientSetOrchestrationServiceStateResponse, error)` -- New function `*VirtualMachineScaleSetVMsClientReimagePollerResponse.Resume(context.Context, *VirtualMachineScaleSetVMsClient, string) error` -- New function `*SnapshotsClientRevokeAccessPollerResponse.Resume(context.Context, *SnapshotsClient, string) error` -- New function `*VirtualMachineScaleSetVMsClientListPager.Err() error` -- New function `*VirtualMachineScaleSetsClientListAllPager.Err() error` -- New function `*CloudServicesClientRestartPoller.ResumeToken() (string, error)` -- New function `*DisksClientListPager.PageResponse() DisksClientListResponse` -- New function `*DisksClientRevokeAccessPoller.FinalResponse(context.Context) (DisksClientRevokeAccessResponse, error)` -- New function `*VirtualMachineScaleSetsClientListByLocationPager.PageResponse() VirtualMachineScaleSetsClientListByLocationResponse` -- New function `*VirtualMachinesClientConvertToManagedDisksPoller.Done() bool` -- New function `*GalleryApplicationVersionsClientCreateOrUpdatePoller.ResumeToken() (string, error)` -- New function `*VirtualMachineScaleSetVMsClientRedeployPoller.ResumeToken() (string, error)` -- New function `GalleriesClientCreateOrUpdatePollerResponse.PollUntilDone(context.Context, time.Duration) (GalleriesClientCreateOrUpdateResponse, error)` -- New function `*VirtualMachineScaleSetsClientPowerOffPoller.Done() bool` -- New function `*GalleriesClientDeletePoller.Done() bool` -- New function `*VirtualMachineScaleSetVMsClientDeallocatePoller.FinalResponse(context.Context) (VirtualMachineScaleSetVMsClientDeallocateResponse, error)` -- New function `*VirtualMachineScaleSetsClientRedeployPollerResponse.Resume(context.Context, *VirtualMachineScaleSetsClient, string) error` -- New function `*VirtualMachineScaleSetVMsClientUpdatePoller.FinalResponse(context.Context) (VirtualMachineScaleSetVMsClientUpdateResponse, error)` -- New function `*GalleryImagesClientDeletePollerResponse.Resume(context.Context, *GalleryImagesClient, string) error` -- New function `*VirtualMachineScaleSetVMsClientRunCommandPoller.ResumeToken() (string, error)` -- New function `*VirtualMachineScaleSetsClientListPager.PageResponse() VirtualMachineScaleSetsClientListResponse` -- New function `*VirtualMachinesClientListAllPager.Err() error` -- New function `*VirtualMachineScaleSetVMsClientPerformMaintenancePoller.Done() bool` -- New function `GalleryImagesClientUpdatePollerResponse.PollUntilDone(context.Context, time.Duration) (GalleryImagesClientUpdateResponse, error)` -- New function `*VirtualMachinesClientInstallPatchesPoller.FinalResponse(context.Context) (VirtualMachinesClientInstallPatchesResponse, error)` -- New function `*VirtualMachineScaleSetsClientReimageAllPollerResponse.Resume(context.Context, *VirtualMachineScaleSetsClient, string) error` -- New function `*VirtualMachineScaleSetRollingUpgradesClientStartExtensionUpgradePoller.Poll(context.Context) (*http.Response, error)` -- New function `*VirtualMachineScaleSetVMsClientPerformMaintenancePoller.Poll(context.Context) (*http.Response, error)` -- New function `*DisksClientGrantAccessPoller.FinalResponse(context.Context) (DisksClientGrantAccessResponse, error)` -- New function `*VirtualMachineScaleSetRollingUpgradesClientStartExtensionUpgradePoller.ResumeToken() (string, error)` -- New function `*SnapshotsClientGrantAccessPollerResponse.Resume(context.Context, *SnapshotsClient, string) error` -- New function `*DiskEncryptionSetsClientListByResourceGroupPager.PageResponse() DiskEncryptionSetsClientListByResourceGroupResponse` -- New function `*CloudServicesClientCreateOrUpdatePoller.ResumeToken() (string, error)` -- New function `*DiskEncryptionSetsClientDeletePoller.ResumeToken() (string, error)` -- New function `*VirtualMachineScaleSetVMsClientPerformMaintenancePoller.ResumeToken() (string, error)` -- New function `*VirtualMachineScaleSetsClientRestartPollerResponse.Resume(context.Context, *VirtualMachineScaleSetsClient, string) error` -- New function `*DiskAccessesClientListPager.PageResponse() DiskAccessesClientListResponse` -- New function `*RestorePointsClientDeletePoller.Done() bool` -- New function `*DiskAccessesClientUpdatePollerResponse.Resume(context.Context, *DiskAccessesClient, string) error` -- New function `*RestorePointsClientDeletePoller.FinalResponse(context.Context) (RestorePointsClientDeleteResponse, error)` -- New function `GalleryApplicationVersionsClientCreateOrUpdatePollerResponse.PollUntilDone(context.Context, time.Duration) (GalleryApplicationVersionsClientCreateOrUpdateResponse, error)` -- New function `VirtualMachineScaleSetsClientRestartPollerResponse.PollUntilDone(context.Context, time.Duration) (VirtualMachineScaleSetsClientRestartResponse, error)` -- New function `*VirtualMachineScaleSetExtensionsClientUpdatePoller.FinalResponse(context.Context) (VirtualMachineScaleSetExtensionsClientUpdateResponse, error)` -- New function `*DiskAccessesClientDeletePoller.FinalResponse(context.Context) (DiskAccessesClientDeleteResponse, error)` -- New function `*VirtualMachinesClientAssessPatchesPoller.ResumeToken() (string, error)` -- New function `*VirtualMachinesClientAssessPatchesPoller.Poll(context.Context) (*http.Response, error)` -- New function `*VirtualMachineRunCommandsClientListByVirtualMachinePager.Err() error` -- New function `GalleriesClientUpdatePollerResponse.PollUntilDone(context.Context, time.Duration) (GalleriesClientUpdateResponse, error)` -- New function `*VirtualMachineScaleSetVMsClientRestartPoller.Done() bool` -- New function `*DisksClientDeletePoller.ResumeToken() (string, error)` -- New function `*GalleriesClientCreateOrUpdatePoller.Done() bool` -- New function `*DiskEncryptionSetsClientListPager.Err() error` -- New function `*ImagesClientListPager.Err() error` -- New function `*VirtualMachineScaleSetExtensionsClientListPager.NextPage(context.Context) bool` -- New function `*CloudServicesClientStartPollerResponse.Resume(context.Context, *CloudServicesClient, string) error` -- New function `*CloudServiceOperatingSystemsClientListOSVersionsPager.NextPage(context.Context) bool` -- New function `*VirtualMachineScaleSetsClientListAllPager.PageResponse() VirtualMachineScaleSetsClientListAllResponse` -- New function `*DedicatedHostsClientDeletePollerResponse.Resume(context.Context, *DedicatedHostsClient, string) error` -- New function `*VirtualMachineRunCommandsClientListByVirtualMachinePager.NextPage(context.Context) bool` -- New function `*ImagesClientUpdatePoller.ResumeToken() (string, error)` -- New function `*DiskAccessesClientListByResourceGroupPager.PageResponse() DiskAccessesClientListByResourceGroupResponse` -- New function `*VirtualMachineScaleSetVMsClientReimageAllPoller.Done() bool` -- New function `*ResourceSKUsClientListPager.PageResponse() ResourceSKUsClientListResponse` -- New function `*LogAnalyticsClientExportRequestRateByIntervalPollerResponse.Resume(context.Context, *LogAnalyticsClient, string) error` -- New function `VirtualMachineScaleSetsClientDeletePollerResponse.PollUntilDone(context.Context, time.Duration) (VirtualMachineScaleSetsClientDeleteResponse, error)` -- New function `*DiskRestorePointClientGrantAccessPoller.Done() bool` -- New function `*VirtualMachinesClientInstallPatchesPollerResponse.Resume(context.Context, *VirtualMachinesClient, string) error` -- New function `*AvailabilitySetsClientListBySubscriptionPager.PageResponse() AvailabilitySetsClientListBySubscriptionResponse` -- New function `VirtualMachineScaleSetExtensionsClientUpdatePollerResponse.PollUntilDone(context.Context, time.Duration) (VirtualMachineScaleSetExtensionsClientUpdateResponse, error)` -- New function `*VirtualMachinesClientCapturePoller.ResumeToken() (string, error)` -- New function `*VirtualMachinesClientUpdatePoller.Done() bool` -- New function `*ImagesClientUpdatePollerResponse.Resume(context.Context, *ImagesClient, string) error` -- New function `*VirtualMachineScaleSetsClientDeletePoller.Done() bool` -- New function `*DiskEncryptionSetsClientDeletePoller.Poll(context.Context) (*http.Response, error)` -- New function `*DedicatedHostsClientDeletePoller.FinalResponse(context.Context) (DedicatedHostsClientDeleteResponse, error)` -- New function `*CloudServiceRoleInstancesClientReimagePollerResponse.Resume(context.Context, *CloudServiceRoleInstancesClient, string) error` -- New function `*RestorePointsClientDeletePoller.ResumeToken() (string, error)` -- New function `*DisksClientCreateOrUpdatePollerResponse.Resume(context.Context, *DisksClient, string) error` -- New function `*VirtualMachineScaleSetVMsClientDeletePollerResponse.Resume(context.Context, *VirtualMachineScaleSetVMsClient, string) error` -- New function `*RestorePointsClientCreatePoller.FinalResponse(context.Context) (RestorePointsClientCreateResponse, error)` -- New function `*GalleryImageVersionsClientCreateOrUpdatePollerResponse.Resume(context.Context, *GalleryImageVersionsClient, string) error` -- New function `VirtualMachinesClientStartPollerResponse.PollUntilDone(context.Context, time.Duration) (VirtualMachinesClientStartResponse, error)` -- New function `DisksClientDeletePollerResponse.PollUntilDone(context.Context, time.Duration) (DisksClientDeleteResponse, error)` -- New function `*VirtualMachineScaleSetExtensionsClientListPager.Err() error` -- New function `*GalleriesClientUpdatePoller.FinalResponse(context.Context) (GalleriesClientUpdateResponse, error)` -- New function `*GalleriesClientListByResourceGroupPager.PageResponse() GalleriesClientListByResourceGroupResponse` -- New function `*SnapshotsClientUpdatePoller.ResumeToken() (string, error)` -- New function `*DedicatedHostsClientDeletePoller.Done() bool` -- New function `VirtualMachineExtensionsClientCreateOrUpdatePollerResponse.PollUntilDone(context.Context, time.Duration) (VirtualMachineExtensionsClientCreateOrUpdateResponse, error)` -- New function `*VirtualMachineExtensionsClientDeletePollerResponse.Resume(context.Context, *VirtualMachineExtensionsClient, string) error` -- New function `*SharedGalleryImagesClientListPager.Err() error` -- New function `*DisksClientCreateOrUpdatePoller.Done() bool` -- New function `VirtualMachineScaleSetRollingUpgradesClientStartExtensionUpgradePollerResponse.PollUntilDone(context.Context, time.Duration) (VirtualMachineScaleSetRollingUpgradesClientStartExtensionUpgradeResponse, error)` -- New function `VirtualMachineScaleSetVMRunCommandsClientCreateOrUpdatePollerResponse.PollUntilDone(context.Context, time.Duration) (VirtualMachineScaleSetVMRunCommandsClientCreateOrUpdateResponse, error)` -- New function `*VirtualMachineScaleSetsClientUpdateInstancesPoller.ResumeToken() (string, error)` -- New function `*CloudServicesClientUpdatePoller.ResumeToken() (string, error)` -- New function `DiskRestorePointClientGrantAccessPollerResponse.PollUntilDone(context.Context, time.Duration) (DiskRestorePointClientGrantAccessResponse, error)` -- New function `VirtualMachineScaleSetVMsClientReimageAllPollerResponse.PollUntilDone(context.Context, time.Duration) (VirtualMachineScaleSetVMsClientReimageAllResponse, error)` -- New function `VirtualMachinesClientCapturePollerResponse.PollUntilDone(context.Context, time.Duration) (VirtualMachinesClientCaptureResponse, error)` -- New function `*CloudServicesClientReimagePoller.FinalResponse(context.Context) (CloudServicesClientReimageResponse, error)` -- New function `SnapshotsClientCreateOrUpdatePollerResponse.PollUntilDone(context.Context, time.Duration) (SnapshotsClientCreateOrUpdateResponse, error)` -- New function `*VirtualMachinesClientCapturePoller.Poll(context.Context) (*http.Response, error)` -- New function `*VirtualMachineScaleSetsClientReimagePoller.Poll(context.Context) (*http.Response, error)` -- New function `*VirtualMachineScaleSetsClientListPager.NextPage(context.Context) bool` -- New function `*ThrottledRequestsInput.UnmarshalJSON([]byte) error` -- New function `*VirtualMachineScaleSetVMRunCommandsClientCreateOrUpdatePoller.FinalResponse(context.Context) (VirtualMachineScaleSetVMRunCommandsClientCreateOrUpdateResponse, error)` -- New function `*VirtualMachinesClientUpdatePoller.FinalResponse(context.Context) (VirtualMachinesClientUpdateResponse, error)` -- New function `*VirtualMachinesClientPowerOffPoller.Done() bool` -- New function `*VirtualMachineExtensionsClientCreateOrUpdatePoller.Poll(context.Context) (*http.Response, error)` -- New function `*DiskAccessesClientListPrivateEndpointConnectionsPager.NextPage(context.Context) bool` -- New function `CloudServicesClientDeleteInstancesPollerResponse.PollUntilDone(context.Context, time.Duration) (CloudServicesClientDeleteInstancesResponse, error)` -- New function `*GalleryApplicationsClientCreateOrUpdatePoller.FinalResponse(context.Context) (GalleryApplicationsClientCreateOrUpdateResponse, error)` -- New function `*SnapshotsClientCreateOrUpdatePoller.Done() bool` -- New function `*VirtualMachineScaleSetsClientCreateOrUpdatePoller.ResumeToken() (string, error)` -- New function `*GalleryApplicationVersionsClientUpdatePoller.FinalResponse(context.Context) (GalleryApplicationVersionsClientUpdateResponse, error)` -- New function `GalleryApplicationsClientDeletePollerResponse.PollUntilDone(context.Context, time.Duration) (GalleryApplicationsClientDeleteResponse, error)` -- New function `*DiskAccessesClientDeleteAPrivateEndpointConnectionPollerResponse.Resume(context.Context, *DiskAccessesClient, string) error` -- New function `*CloudServicesClientDeletePoller.Done() bool` -- New function `*VirtualMachinesClientAssessPatchesPoller.Done() bool` -- New function `*VirtualMachineScaleSetRollingUpgradesClientStartOSUpgradePoller.Done() bool` -- New function `*VirtualMachineRunCommandsClientUpdatePoller.Poll(context.Context) (*http.Response, error)` -- New function `*GalleryImagesClientDeletePoller.FinalResponse(context.Context) (GalleryImagesClientDeleteResponse, error)` -- New function `*CloudServiceRoleInstancesClientDeletePoller.FinalResponse(context.Context) (CloudServiceRoleInstancesClientDeleteResponse, error)` -- New function `CloudServicesClientPowerOffPollerResponse.PollUntilDone(context.Context, time.Duration) (CloudServicesClientPowerOffResponse, error)` -- New function `DedicatedHostsClientUpdatePollerResponse.PollUntilDone(context.Context, time.Duration) (DedicatedHostsClientUpdateResponse, error)` -- New function `*DisksClientListByResourceGroupPager.PageResponse() DisksClientListByResourceGroupResponse` -- New function `*AvailabilitySetsClientListPager.Err() error` -- New function `*CloudServicesClientStartPoller.FinalResponse(context.Context) (CloudServicesClientStartResponse, error)` -- New function `*CloudServiceRoleInstancesClientDeletePoller.ResumeToken() (string, error)` -- New function `*VirtualMachineScaleSetsClientPerformMaintenancePoller.FinalResponse(context.Context) (VirtualMachineScaleSetsClientPerformMaintenanceResponse, error)` -- New function `*VirtualMachineScaleSetVMsClientStartPoller.FinalResponse(context.Context) (VirtualMachineScaleSetVMsClientStartResponse, error)` -- New function `*DiskRestorePointClientRevokeAccessPoller.Poll(context.Context) (*http.Response, error)` -- New function `*CapacityReservationGroupsClientListByResourceGroupPager.NextPage(context.Context) bool` -- New function `*SharedGalleryImageVersionsClientListPager.Err() error` -- New function `CloudServicesClientReimagePollerResponse.PollUntilDone(context.Context, time.Duration) (CloudServicesClientReimageResponse, error)` -- New function `*GalleryApplicationsClientListByGalleryPager.NextPage(context.Context) bool` -- New function `*DiskAccessesClientListByResourceGroupPager.Err() error` -- New function `*SnapshotsClientListPager.PageResponse() SnapshotsClientListResponse` -- New function `VirtualMachineExtensionsClientDeletePollerResponse.PollUntilDone(context.Context, time.Duration) (VirtualMachineExtensionsClientDeleteResponse, error)` -- New function `*CapacityReservationsClientUpdatePoller.Poll(context.Context) (*http.Response, error)` -- New function `*VirtualMachineScaleSetRollingUpgradesClientCancelPollerResponse.Resume(context.Context, *VirtualMachineScaleSetRollingUpgradesClient, string) error` -- New function `*GalleriesClientUpdatePoller.Done() bool` -- New function `*CloudServicesClientStartPoller.ResumeToken() (string, error)` -- New function `*RestorePointCollectionsClientDeletePoller.ResumeToken() (string, error)` -- New struct `AvailabilitySetsClientCreateOrUpdateOptions` -- New struct `AvailabilitySetsClientCreateOrUpdateResponse` -- New struct `AvailabilitySetsClientCreateOrUpdateResult` -- New struct `AvailabilitySetsClientDeleteOptions` -- New struct `AvailabilitySetsClientDeleteResponse` -- New struct `AvailabilitySetsClientGetOptions` -- New struct `AvailabilitySetsClientGetResponse` -- New struct `AvailabilitySetsClientGetResult` -- New struct `AvailabilitySetsClientListAvailableSizesOptions` -- New struct `AvailabilitySetsClientListAvailableSizesResponse` -- New struct `AvailabilitySetsClientListAvailableSizesResult` -- New struct `AvailabilitySetsClientListBySubscriptionOptions` -- New struct `AvailabilitySetsClientListBySubscriptionPager` -- New struct `AvailabilitySetsClientListBySubscriptionResponse` -- New struct `AvailabilitySetsClientListBySubscriptionResult` -- New struct `AvailabilitySetsClientListOptions` -- New struct `AvailabilitySetsClientListPager` -- New struct `AvailabilitySetsClientListResponse` -- New struct `AvailabilitySetsClientListResult` -- New struct `AvailabilitySetsClientUpdateOptions` -- New struct `AvailabilitySetsClientUpdateResponse` -- New struct `AvailabilitySetsClientUpdateResult` -- New struct `CapacityReservationGroupsClientCreateOrUpdateOptions` -- New struct `CapacityReservationGroupsClientCreateOrUpdateResponse` -- New struct `CapacityReservationGroupsClientCreateOrUpdateResult` -- New struct `CapacityReservationGroupsClientDeleteOptions` -- New struct `CapacityReservationGroupsClientDeleteResponse` -- New struct `CapacityReservationGroupsClientGetOptions` -- New struct `CapacityReservationGroupsClientGetResponse` -- New struct `CapacityReservationGroupsClientGetResult` -- New struct `CapacityReservationGroupsClientListByResourceGroupOptions` -- New struct `CapacityReservationGroupsClientListByResourceGroupPager` -- New struct `CapacityReservationGroupsClientListByResourceGroupResponse` -- New struct `CapacityReservationGroupsClientListByResourceGroupResult` -- New struct `CapacityReservationGroupsClientListBySubscriptionOptions` -- New struct `CapacityReservationGroupsClientListBySubscriptionPager` -- New struct `CapacityReservationGroupsClientListBySubscriptionResponse` -- New struct `CapacityReservationGroupsClientListBySubscriptionResult` -- New struct `CapacityReservationGroupsClientUpdateOptions` -- New struct `CapacityReservationGroupsClientUpdateResponse` -- New struct `CapacityReservationGroupsClientUpdateResult` -- New struct `CapacityReservationsClientBeginCreateOrUpdateOptions` -- New struct `CapacityReservationsClientBeginDeleteOptions` -- New struct `CapacityReservationsClientBeginUpdateOptions` -- New struct `CapacityReservationsClientCreateOrUpdatePoller` -- New struct `CapacityReservationsClientCreateOrUpdatePollerResponse` -- New struct `CapacityReservationsClientCreateOrUpdateResponse` -- New struct `CapacityReservationsClientCreateOrUpdateResult` -- New struct `CapacityReservationsClientDeletePoller` -- New struct `CapacityReservationsClientDeletePollerResponse` -- New struct `CapacityReservationsClientDeleteResponse` -- New struct `CapacityReservationsClientGetOptions` -- New struct `CapacityReservationsClientGetResponse` -- New struct `CapacityReservationsClientGetResult` -- New struct `CapacityReservationsClientListByCapacityReservationGroupOptions` -- New struct `CapacityReservationsClientListByCapacityReservationGroupPager` -- New struct `CapacityReservationsClientListByCapacityReservationGroupResponse` -- New struct `CapacityReservationsClientListByCapacityReservationGroupResult` -- New struct `CapacityReservationsClientUpdatePoller` -- New struct `CapacityReservationsClientUpdatePollerResponse` -- New struct `CapacityReservationsClientUpdateResponse` -- New struct `CapacityReservationsClientUpdateResult` -- New struct `CloudServiceOperatingSystemsClientGetOSFamilyOptions` -- New struct `CloudServiceOperatingSystemsClientGetOSFamilyResponse` -- New struct `CloudServiceOperatingSystemsClientGetOSFamilyResult` -- New struct `CloudServiceOperatingSystemsClientGetOSVersionOptions` -- New struct `CloudServiceOperatingSystemsClientGetOSVersionResponse` -- New struct `CloudServiceOperatingSystemsClientGetOSVersionResult` -- New struct `CloudServiceOperatingSystemsClientListOSFamiliesOptions` -- New struct `CloudServiceOperatingSystemsClientListOSFamiliesPager` -- New struct `CloudServiceOperatingSystemsClientListOSFamiliesResponse` -- New struct `CloudServiceOperatingSystemsClientListOSFamiliesResult` -- New struct `CloudServiceOperatingSystemsClientListOSVersionsOptions` -- New struct `CloudServiceOperatingSystemsClientListOSVersionsPager` -- New struct `CloudServiceOperatingSystemsClientListOSVersionsResponse` -- New struct `CloudServiceOperatingSystemsClientListOSVersionsResult` -- New struct `CloudServiceRoleInstancesClientBeginDeleteOptions` -- New struct `CloudServiceRoleInstancesClientBeginRebuildOptions` -- New struct `CloudServiceRoleInstancesClientBeginReimageOptions` -- New struct `CloudServiceRoleInstancesClientBeginRestartOptions` -- New struct `CloudServiceRoleInstancesClientDeletePoller` -- New struct `CloudServiceRoleInstancesClientDeletePollerResponse` -- New struct `CloudServiceRoleInstancesClientDeleteResponse` -- New struct `CloudServiceRoleInstancesClientGetInstanceViewOptions` -- New struct `CloudServiceRoleInstancesClientGetInstanceViewResponse` -- New struct `CloudServiceRoleInstancesClientGetInstanceViewResult` -- New struct `CloudServiceRoleInstancesClientGetOptions` -- New struct `CloudServiceRoleInstancesClientGetRemoteDesktopFileOptions` -- New struct `CloudServiceRoleInstancesClientGetRemoteDesktopFileResponse` -- New struct `CloudServiceRoleInstancesClientGetResponse` -- New struct `CloudServiceRoleInstancesClientGetResult` -- New struct `CloudServiceRoleInstancesClientListOptions` -- New struct `CloudServiceRoleInstancesClientListPager` -- New struct `CloudServiceRoleInstancesClientListResponse` -- New struct `CloudServiceRoleInstancesClientListResult` -- New struct `CloudServiceRoleInstancesClientRebuildPoller` -- New struct `CloudServiceRoleInstancesClientRebuildPollerResponse` -- New struct `CloudServiceRoleInstancesClientRebuildResponse` -- New struct `CloudServiceRoleInstancesClientReimagePoller` -- New struct `CloudServiceRoleInstancesClientReimagePollerResponse` -- New struct `CloudServiceRoleInstancesClientReimageResponse` -- New struct `CloudServiceRoleInstancesClientRestartPoller` -- New struct `CloudServiceRoleInstancesClientRestartPollerResponse` -- New struct `CloudServiceRoleInstancesClientRestartResponse` -- New struct `CloudServiceRolesClientGetOptions` -- New struct `CloudServiceRolesClientGetResponse` -- New struct `CloudServiceRolesClientGetResult` -- New struct `CloudServiceRolesClientListOptions` -- New struct `CloudServiceRolesClientListPager` -- New struct `CloudServiceRolesClientListResponse` -- New struct `CloudServiceRolesClientListResult` -- New struct `CloudServicesClientBeginCreateOrUpdateOptions` -- New struct `CloudServicesClientBeginDeleteInstancesOptions` -- New struct `CloudServicesClientBeginDeleteOptions` -- New struct `CloudServicesClientBeginPowerOffOptions` -- New struct `CloudServicesClientBeginRebuildOptions` -- New struct `CloudServicesClientBeginReimageOptions` -- New struct `CloudServicesClientBeginRestartOptions` -- New struct `CloudServicesClientBeginStartOptions` -- New struct `CloudServicesClientBeginUpdateOptions` -- New struct `CloudServicesClientCreateOrUpdatePoller` -- New struct `CloudServicesClientCreateOrUpdatePollerResponse` -- New struct `CloudServicesClientCreateOrUpdateResponse` -- New struct `CloudServicesClientCreateOrUpdateResult` -- New struct `CloudServicesClientDeleteInstancesPoller` -- New struct `CloudServicesClientDeleteInstancesPollerResponse` -- New struct `CloudServicesClientDeleteInstancesResponse` -- New struct `CloudServicesClientDeletePoller` -- New struct `CloudServicesClientDeletePollerResponse` -- New struct `CloudServicesClientDeleteResponse` -- New struct `CloudServicesClientGetInstanceViewOptions` -- New struct `CloudServicesClientGetInstanceViewResponse` -- New struct `CloudServicesClientGetInstanceViewResult` -- New struct `CloudServicesClientGetOptions` -- New struct `CloudServicesClientGetResponse` -- New struct `CloudServicesClientGetResult` -- New struct `CloudServicesClientListAllOptions` -- New struct `CloudServicesClientListAllPager` -- New struct `CloudServicesClientListAllResponse` -- New struct `CloudServicesClientListAllResult` -- New struct `CloudServicesClientListOptions` -- New struct `CloudServicesClientListPager` -- New struct `CloudServicesClientListResponse` -- New struct `CloudServicesClientListResult` -- New struct `CloudServicesClientPowerOffPoller` -- New struct `CloudServicesClientPowerOffPollerResponse` -- New struct `CloudServicesClientPowerOffResponse` -- New struct `CloudServicesClientRebuildPoller` -- New struct `CloudServicesClientRebuildPollerResponse` -- New struct `CloudServicesClientRebuildResponse` -- New struct `CloudServicesClientReimagePoller` -- New struct `CloudServicesClientReimagePollerResponse` -- New struct `CloudServicesClientReimageResponse` -- New struct `CloudServicesClientRestartPoller` -- New struct `CloudServicesClientRestartPollerResponse` -- New struct `CloudServicesClientRestartResponse` -- New struct `CloudServicesClientStartPoller` -- New struct `CloudServicesClientStartPollerResponse` -- New struct `CloudServicesClientStartResponse` -- New struct `CloudServicesClientUpdatePoller` -- New struct `CloudServicesClientUpdatePollerResponse` -- New struct `CloudServicesClientUpdateResponse` -- New struct `CloudServicesClientUpdateResult` -- New struct `CloudServicesUpdateDomainClientBeginWalkUpdateDomainOptions` -- New struct `CloudServicesUpdateDomainClientGetUpdateDomainOptions` -- New struct `CloudServicesUpdateDomainClientGetUpdateDomainResponse` -- New struct `CloudServicesUpdateDomainClientGetUpdateDomainResult` -- New struct `CloudServicesUpdateDomainClientListUpdateDomainsOptions` -- New struct `CloudServicesUpdateDomainClientListUpdateDomainsPager` -- New struct `CloudServicesUpdateDomainClientListUpdateDomainsResponse` -- New struct `CloudServicesUpdateDomainClientListUpdateDomainsResult` -- New struct `CloudServicesUpdateDomainClientWalkUpdateDomainPoller` -- New struct `CloudServicesUpdateDomainClientWalkUpdateDomainPollerResponse` -- New struct `CloudServicesUpdateDomainClientWalkUpdateDomainResponse` -- New struct `CommunityGalleriesClientGetOptions` -- New struct `CommunityGalleriesClientGetResponse` -- New struct `CommunityGalleriesClientGetResult` -- New struct `CommunityGalleryImageVersionsClientGetOptions` -- New struct `CommunityGalleryImageVersionsClientGetResponse` -- New struct `CommunityGalleryImageVersionsClientGetResult` -- New struct `CommunityGalleryImagesClientGetOptions` -- New struct `CommunityGalleryImagesClientGetResponse` -- New struct `CommunityGalleryImagesClientGetResult` -- New struct `DedicatedHostGroupsClientCreateOrUpdateOptions` -- New struct `DedicatedHostGroupsClientCreateOrUpdateResponse` -- New struct `DedicatedHostGroupsClientCreateOrUpdateResult` -- New struct `DedicatedHostGroupsClientDeleteOptions` -- New struct `DedicatedHostGroupsClientDeleteResponse` -- New struct `DedicatedHostGroupsClientGetOptions` -- New struct `DedicatedHostGroupsClientGetResponse` -- New struct `DedicatedHostGroupsClientGetResult` -- New struct `DedicatedHostGroupsClientListByResourceGroupOptions` -- New struct `DedicatedHostGroupsClientListByResourceGroupPager` -- New struct `DedicatedHostGroupsClientListByResourceGroupResponse` -- New struct `DedicatedHostGroupsClientListByResourceGroupResult` -- New struct `DedicatedHostGroupsClientListBySubscriptionOptions` -- New struct `DedicatedHostGroupsClientListBySubscriptionPager` -- New struct `DedicatedHostGroupsClientListBySubscriptionResponse` -- New struct `DedicatedHostGroupsClientListBySubscriptionResult` -- New struct `DedicatedHostGroupsClientUpdateOptions` -- New struct `DedicatedHostGroupsClientUpdateResponse` -- New struct `DedicatedHostGroupsClientUpdateResult` -- New struct `DedicatedHostsClientBeginCreateOrUpdateOptions` -- New struct `DedicatedHostsClientBeginDeleteOptions` -- New struct `DedicatedHostsClientBeginUpdateOptions` -- New struct `DedicatedHostsClientCreateOrUpdatePoller` -- New struct `DedicatedHostsClientCreateOrUpdatePollerResponse` -- New struct `DedicatedHostsClientCreateOrUpdateResponse` -- New struct `DedicatedHostsClientCreateOrUpdateResult` -- New struct `DedicatedHostsClientDeletePoller` -- New struct `DedicatedHostsClientDeletePollerResponse` -- New struct `DedicatedHostsClientDeleteResponse` -- New struct `DedicatedHostsClientGetOptions` -- New struct `DedicatedHostsClientGetResponse` -- New struct `DedicatedHostsClientGetResult` -- New struct `DedicatedHostsClientListByHostGroupOptions` -- New struct `DedicatedHostsClientListByHostGroupPager` -- New struct `DedicatedHostsClientListByHostGroupResponse` -- New struct `DedicatedHostsClientListByHostGroupResult` -- New struct `DedicatedHostsClientUpdatePoller` -- New struct `DedicatedHostsClientUpdatePollerResponse` -- New struct `DedicatedHostsClientUpdateResponse` -- New struct `DedicatedHostsClientUpdateResult` -- New struct `DiskAccessesClientBeginCreateOrUpdateOptions` -- New struct `DiskAccessesClientBeginDeleteAPrivateEndpointConnectionOptions` -- New struct `DiskAccessesClientBeginDeleteOptions` -- New struct `DiskAccessesClientBeginUpdateAPrivateEndpointConnectionOptions` -- New struct `DiskAccessesClientBeginUpdateOptions` -- New struct `DiskAccessesClientCreateOrUpdatePoller` -- New struct `DiskAccessesClientCreateOrUpdatePollerResponse` -- New struct `DiskAccessesClientCreateOrUpdateResponse` -- New struct `DiskAccessesClientCreateOrUpdateResult` -- New struct `DiskAccessesClientDeleteAPrivateEndpointConnectionPoller` -- New struct `DiskAccessesClientDeleteAPrivateEndpointConnectionPollerResponse` -- New struct `DiskAccessesClientDeleteAPrivateEndpointConnectionResponse` -- New struct `DiskAccessesClientDeletePoller` -- New struct `DiskAccessesClientDeletePollerResponse` -- New struct `DiskAccessesClientDeleteResponse` -- New struct `DiskAccessesClientGetAPrivateEndpointConnectionOptions` -- New struct `DiskAccessesClientGetAPrivateEndpointConnectionResponse` -- New struct `DiskAccessesClientGetAPrivateEndpointConnectionResult` -- New struct `DiskAccessesClientGetOptions` -- New struct `DiskAccessesClientGetPrivateLinkResourcesOptions` -- New struct `DiskAccessesClientGetPrivateLinkResourcesResponse` -- New struct `DiskAccessesClientGetPrivateLinkResourcesResult` -- New struct `DiskAccessesClientGetResponse` -- New struct `DiskAccessesClientGetResult` -- New struct `DiskAccessesClientListByResourceGroupOptions` -- New struct `DiskAccessesClientListByResourceGroupPager` -- New struct `DiskAccessesClientListByResourceGroupResponse` -- New struct `DiskAccessesClientListByResourceGroupResult` -- New struct `DiskAccessesClientListOptions` -- New struct `DiskAccessesClientListPager` -- New struct `DiskAccessesClientListPrivateEndpointConnectionsOptions` -- New struct `DiskAccessesClientListPrivateEndpointConnectionsPager` -- New struct `DiskAccessesClientListPrivateEndpointConnectionsResponse` -- New struct `DiskAccessesClientListPrivateEndpointConnectionsResult` -- New struct `DiskAccessesClientListResponse` -- New struct `DiskAccessesClientListResult` -- New struct `DiskAccessesClientUpdateAPrivateEndpointConnectionPoller` -- New struct `DiskAccessesClientUpdateAPrivateEndpointConnectionPollerResponse` -- New struct `DiskAccessesClientUpdateAPrivateEndpointConnectionResponse` -- New struct `DiskAccessesClientUpdateAPrivateEndpointConnectionResult` -- New struct `DiskAccessesClientUpdatePoller` -- New struct `DiskAccessesClientUpdatePollerResponse` -- New struct `DiskAccessesClientUpdateResponse` -- New struct `DiskAccessesClientUpdateResult` -- New struct `DiskEncryptionSetsClientBeginCreateOrUpdateOptions` -- New struct `DiskEncryptionSetsClientBeginDeleteOptions` -- New struct `DiskEncryptionSetsClientBeginUpdateOptions` -- New struct `DiskEncryptionSetsClientCreateOrUpdatePoller` -- New struct `DiskEncryptionSetsClientCreateOrUpdatePollerResponse` -- New struct `DiskEncryptionSetsClientCreateOrUpdateResponse` -- New struct `DiskEncryptionSetsClientCreateOrUpdateResult` -- New struct `DiskEncryptionSetsClientDeletePoller` -- New struct `DiskEncryptionSetsClientDeletePollerResponse` -- New struct `DiskEncryptionSetsClientDeleteResponse` -- New struct `DiskEncryptionSetsClientGetOptions` -- New struct `DiskEncryptionSetsClientGetResponse` -- New struct `DiskEncryptionSetsClientGetResult` -- New struct `DiskEncryptionSetsClientListAssociatedResourcesOptions` -- New struct `DiskEncryptionSetsClientListAssociatedResourcesPager` -- New struct `DiskEncryptionSetsClientListAssociatedResourcesResponse` -- New struct `DiskEncryptionSetsClientListAssociatedResourcesResult` -- New struct `DiskEncryptionSetsClientListByResourceGroupOptions` -- New struct `DiskEncryptionSetsClientListByResourceGroupPager` -- New struct `DiskEncryptionSetsClientListByResourceGroupResponse` -- New struct `DiskEncryptionSetsClientListByResourceGroupResult` -- New struct `DiskEncryptionSetsClientListOptions` -- New struct `DiskEncryptionSetsClientListPager` -- New struct `DiskEncryptionSetsClientListResponse` -- New struct `DiskEncryptionSetsClientListResult` -- New struct `DiskEncryptionSetsClientUpdatePoller` -- New struct `DiskEncryptionSetsClientUpdatePollerResponse` -- New struct `DiskEncryptionSetsClientUpdateResponse` -- New struct `DiskEncryptionSetsClientUpdateResult` -- New struct `DiskRestorePointClientBeginGrantAccessOptions` -- New struct `DiskRestorePointClientBeginRevokeAccessOptions` -- New struct `DiskRestorePointClientGetOptions` -- New struct `DiskRestorePointClientGetResponse` -- New struct `DiskRestorePointClientGetResult` -- New struct `DiskRestorePointClientGrantAccessPoller` -- New struct `DiskRestorePointClientGrantAccessPollerResponse` -- New struct `DiskRestorePointClientGrantAccessResponse` -- New struct `DiskRestorePointClientGrantAccessResult` -- New struct `DiskRestorePointClientListByRestorePointOptions` -- New struct `DiskRestorePointClientListByRestorePointPager` -- New struct `DiskRestorePointClientListByRestorePointResponse` -- New struct `DiskRestorePointClientListByRestorePointResult` -- New struct `DiskRestorePointClientRevokeAccessPoller` -- New struct `DiskRestorePointClientRevokeAccessPollerResponse` -- New struct `DiskRestorePointClientRevokeAccessResponse` -- New struct `DisksClientBeginCreateOrUpdateOptions` -- New struct `DisksClientBeginDeleteOptions` -- New struct `DisksClientBeginGrantAccessOptions` -- New struct `DisksClientBeginRevokeAccessOptions` -- New struct `DisksClientBeginUpdateOptions` -- New struct `DisksClientCreateOrUpdatePoller` -- New struct `DisksClientCreateOrUpdatePollerResponse` -- New struct `DisksClientCreateOrUpdateResponse` -- New struct `DisksClientCreateOrUpdateResult` -- New struct `DisksClientDeletePoller` -- New struct `DisksClientDeletePollerResponse` -- New struct `DisksClientDeleteResponse` -- New struct `DisksClientGetOptions` -- New struct `DisksClientGetResponse` -- New struct `DisksClientGetResult` -- New struct `DisksClientGrantAccessPoller` -- New struct `DisksClientGrantAccessPollerResponse` -- New struct `DisksClientGrantAccessResponse` -- New struct `DisksClientGrantAccessResult` -- New struct `DisksClientListByResourceGroupOptions` -- New struct `DisksClientListByResourceGroupPager` -- New struct `DisksClientListByResourceGroupResponse` -- New struct `DisksClientListByResourceGroupResult` -- New struct `DisksClientListOptions` -- New struct `DisksClientListPager` -- New struct `DisksClientListResponse` -- New struct `DisksClientListResult` -- New struct `DisksClientRevokeAccessPoller` -- New struct `DisksClientRevokeAccessPollerResponse` -- New struct `DisksClientRevokeAccessResponse` -- New struct `DisksClientUpdatePoller` -- New struct `DisksClientUpdatePollerResponse` -- New struct `DisksClientUpdateResponse` -- New struct `DisksClientUpdateResult` -- New struct `GalleriesClientBeginCreateOrUpdateOptions` -- New struct `GalleriesClientBeginDeleteOptions` -- New struct `GalleriesClientBeginUpdateOptions` -- New struct `GalleriesClientCreateOrUpdatePoller` -- New struct `GalleriesClientCreateOrUpdatePollerResponse` -- New struct `GalleriesClientCreateOrUpdateResponse` -- New struct `GalleriesClientCreateOrUpdateResult` -- New struct `GalleriesClientDeletePoller` -- New struct `GalleriesClientDeletePollerResponse` -- New struct `GalleriesClientDeleteResponse` -- New struct `GalleriesClientGetOptions` -- New struct `GalleriesClientGetResponse` -- New struct `GalleriesClientGetResult` -- New struct `GalleriesClientListByResourceGroupOptions` -- New struct `GalleriesClientListByResourceGroupPager` -- New struct `GalleriesClientListByResourceGroupResponse` -- New struct `GalleriesClientListByResourceGroupResult` -- New struct `GalleriesClientListOptions` -- New struct `GalleriesClientListPager` -- New struct `GalleriesClientListResponse` -- New struct `GalleriesClientListResult` -- New struct `GalleriesClientUpdatePoller` -- New struct `GalleriesClientUpdatePollerResponse` -- New struct `GalleriesClientUpdateResponse` -- New struct `GalleriesClientUpdateResult` -- New struct `GalleryApplicationVersionsClientBeginCreateOrUpdateOptions` -- New struct `GalleryApplicationVersionsClientBeginDeleteOptions` -- New struct `GalleryApplicationVersionsClientBeginUpdateOptions` -- New struct `GalleryApplicationVersionsClientCreateOrUpdatePoller` -- New struct `GalleryApplicationVersionsClientCreateOrUpdatePollerResponse` -- New struct `GalleryApplicationVersionsClientCreateOrUpdateResponse` -- New struct `GalleryApplicationVersionsClientCreateOrUpdateResult` -- New struct `GalleryApplicationVersionsClientDeletePoller` -- New struct `GalleryApplicationVersionsClientDeletePollerResponse` -- New struct `GalleryApplicationVersionsClientDeleteResponse` -- New struct `GalleryApplicationVersionsClientGetOptions` -- New struct `GalleryApplicationVersionsClientGetResponse` -- New struct `GalleryApplicationVersionsClientGetResult` -- New struct `GalleryApplicationVersionsClientListByGalleryApplicationOptions` -- New struct `GalleryApplicationVersionsClientListByGalleryApplicationPager` -- New struct `GalleryApplicationVersionsClientListByGalleryApplicationResponse` -- New struct `GalleryApplicationVersionsClientListByGalleryApplicationResult` -- New struct `GalleryApplicationVersionsClientUpdatePoller` -- New struct `GalleryApplicationVersionsClientUpdatePollerResponse` -- New struct `GalleryApplicationVersionsClientUpdateResponse` -- New struct `GalleryApplicationVersionsClientUpdateResult` -- New struct `GalleryApplicationsClientBeginCreateOrUpdateOptions` -- New struct `GalleryApplicationsClientBeginDeleteOptions` -- New struct `GalleryApplicationsClientBeginUpdateOptions` -- New struct `GalleryApplicationsClientCreateOrUpdatePoller` -- New struct `GalleryApplicationsClientCreateOrUpdatePollerResponse` -- New struct `GalleryApplicationsClientCreateOrUpdateResponse` -- New struct `GalleryApplicationsClientCreateOrUpdateResult` -- New struct `GalleryApplicationsClientDeletePoller` -- New struct `GalleryApplicationsClientDeletePollerResponse` -- New struct `GalleryApplicationsClientDeleteResponse` -- New struct `GalleryApplicationsClientGetOptions` -- New struct `GalleryApplicationsClientGetResponse` -- New struct `GalleryApplicationsClientGetResult` -- New struct `GalleryApplicationsClientListByGalleryOptions` -- New struct `GalleryApplicationsClientListByGalleryPager` -- New struct `GalleryApplicationsClientListByGalleryResponse` -- New struct `GalleryApplicationsClientListByGalleryResult` -- New struct `GalleryApplicationsClientUpdatePoller` -- New struct `GalleryApplicationsClientUpdatePollerResponse` -- New struct `GalleryApplicationsClientUpdateResponse` -- New struct `GalleryApplicationsClientUpdateResult` -- New struct `GalleryImageVersionsClientBeginCreateOrUpdateOptions` -- New struct `GalleryImageVersionsClientBeginDeleteOptions` -- New struct `GalleryImageVersionsClientBeginUpdateOptions` -- New struct `GalleryImageVersionsClientCreateOrUpdatePoller` -- New struct `GalleryImageVersionsClientCreateOrUpdatePollerResponse` -- New struct `GalleryImageVersionsClientCreateOrUpdateResponse` -- New struct `GalleryImageVersionsClientCreateOrUpdateResult` -- New struct `GalleryImageVersionsClientDeletePoller` -- New struct `GalleryImageVersionsClientDeletePollerResponse` -- New struct `GalleryImageVersionsClientDeleteResponse` -- New struct `GalleryImageVersionsClientGetOptions` -- New struct `GalleryImageVersionsClientGetResponse` -- New struct `GalleryImageVersionsClientGetResult` -- New struct `GalleryImageVersionsClientListByGalleryImageOptions` -- New struct `GalleryImageVersionsClientListByGalleryImagePager` -- New struct `GalleryImageVersionsClientListByGalleryImageResponse` -- New struct `GalleryImageVersionsClientListByGalleryImageResult` -- New struct `GalleryImageVersionsClientUpdatePoller` -- New struct `GalleryImageVersionsClientUpdatePollerResponse` -- New struct `GalleryImageVersionsClientUpdateResponse` -- New struct `GalleryImageVersionsClientUpdateResult` -- New struct `GalleryImagesClientBeginCreateOrUpdateOptions` -- New struct `GalleryImagesClientBeginDeleteOptions` -- New struct `GalleryImagesClientBeginUpdateOptions` -- New struct `GalleryImagesClientCreateOrUpdatePoller` -- New struct `GalleryImagesClientCreateOrUpdatePollerResponse` -- New struct `GalleryImagesClientCreateOrUpdateResponse` -- New struct `GalleryImagesClientCreateOrUpdateResult` -- New struct `GalleryImagesClientDeletePoller` -- New struct `GalleryImagesClientDeletePollerResponse` -- New struct `GalleryImagesClientDeleteResponse` -- New struct `GalleryImagesClientGetOptions` -- New struct `GalleryImagesClientGetResponse` -- New struct `GalleryImagesClientGetResult` -- New struct `GalleryImagesClientListByGalleryOptions` -- New struct `GalleryImagesClientListByGalleryPager` -- New struct `GalleryImagesClientListByGalleryResponse` -- New struct `GalleryImagesClientListByGalleryResult` -- New struct `GalleryImagesClientUpdatePoller` -- New struct `GalleryImagesClientUpdatePollerResponse` -- New struct `GalleryImagesClientUpdateResponse` -- New struct `GalleryImagesClientUpdateResult` -- New struct `GallerySharingProfileClientBeginUpdateOptions` -- New struct `GallerySharingProfileClientUpdatePoller` -- New struct `GallerySharingProfileClientUpdatePollerResponse` -- New struct `GallerySharingProfileClientUpdateResponse` -- New struct `GallerySharingProfileClientUpdateResult` -- New struct `ImagesClientBeginCreateOrUpdateOptions` -- New struct `ImagesClientBeginDeleteOptions` -- New struct `ImagesClientBeginUpdateOptions` -- New struct `ImagesClientCreateOrUpdatePoller` -- New struct `ImagesClientCreateOrUpdatePollerResponse` -- New struct `ImagesClientCreateOrUpdateResponse` -- New struct `ImagesClientCreateOrUpdateResult` -- New struct `ImagesClientDeletePoller` -- New struct `ImagesClientDeletePollerResponse` -- New struct `ImagesClientDeleteResponse` -- New struct `ImagesClientGetOptions` -- New struct `ImagesClientGetResponse` -- New struct `ImagesClientGetResult` -- New struct `ImagesClientListByResourceGroupOptions` -- New struct `ImagesClientListByResourceGroupPager` -- New struct `ImagesClientListByResourceGroupResponse` -- New struct `ImagesClientListByResourceGroupResult` -- New struct `ImagesClientListOptions` -- New struct `ImagesClientListPager` -- New struct `ImagesClientListResponse` -- New struct `ImagesClientListResult` -- New struct `ImagesClientUpdatePoller` -- New struct `ImagesClientUpdatePollerResponse` -- New struct `ImagesClientUpdateResponse` -- New struct `ImagesClientUpdateResult` -- New struct `LogAnalyticsClientBeginExportRequestRateByIntervalOptions` -- New struct `LogAnalyticsClientBeginExportThrottledRequestsOptions` -- New struct `LogAnalyticsClientExportRequestRateByIntervalPoller` -- New struct `LogAnalyticsClientExportRequestRateByIntervalPollerResponse` -- New struct `LogAnalyticsClientExportRequestRateByIntervalResponse` -- New struct `LogAnalyticsClientExportRequestRateByIntervalResult` -- New struct `LogAnalyticsClientExportThrottledRequestsPoller` -- New struct `LogAnalyticsClientExportThrottledRequestsPollerResponse` -- New struct `LogAnalyticsClientExportThrottledRequestsResponse` -- New struct `LogAnalyticsClientExportThrottledRequestsResult` -- New struct `OperationListResult` -- New struct `OperationValue` -- New struct `OperationValueDisplay` -- New struct `OperationsClientListOptions` -- New struct `OperationsClientListResponse` -- New struct `OperationsClientListResult` -- New struct `ProximityPlacementGroupsClientCreateOrUpdateOptions` -- New struct `ProximityPlacementGroupsClientCreateOrUpdateResponse` -- New struct `ProximityPlacementGroupsClientCreateOrUpdateResult` -- New struct `ProximityPlacementGroupsClientDeleteOptions` -- New struct `ProximityPlacementGroupsClientDeleteResponse` -- New struct `ProximityPlacementGroupsClientGetOptions` -- New struct `ProximityPlacementGroupsClientGetResponse` -- New struct `ProximityPlacementGroupsClientGetResult` -- New struct `ProximityPlacementGroupsClientListByResourceGroupOptions` -- New struct `ProximityPlacementGroupsClientListByResourceGroupPager` -- New struct `ProximityPlacementGroupsClientListByResourceGroupResponse` -- New struct `ProximityPlacementGroupsClientListByResourceGroupResult` -- New struct `ProximityPlacementGroupsClientListBySubscriptionOptions` -- New struct `ProximityPlacementGroupsClientListBySubscriptionPager` -- New struct `ProximityPlacementGroupsClientListBySubscriptionResponse` -- New struct `ProximityPlacementGroupsClientListBySubscriptionResult` -- New struct `ProximityPlacementGroupsClientUpdateOptions` -- New struct `ProximityPlacementGroupsClientUpdateResponse` -- New struct `ProximityPlacementGroupsClientUpdateResult` -- New struct `ResourceSKUsClientListOptions` -- New struct `ResourceSKUsClientListPager` -- New struct `ResourceSKUsClientListResponse` -- New struct `ResourceSKUsClientListResult` -- New struct `RestorePointCollectionsClientBeginDeleteOptions` -- New struct `RestorePointCollectionsClientCreateOrUpdateOptions` -- New struct `RestorePointCollectionsClientCreateOrUpdateResponse` -- New struct `RestorePointCollectionsClientCreateOrUpdateResult` -- New struct `RestorePointCollectionsClientDeletePoller` -- New struct `RestorePointCollectionsClientDeletePollerResponse` -- New struct `RestorePointCollectionsClientDeleteResponse` -- New struct `RestorePointCollectionsClientGetOptions` -- New struct `RestorePointCollectionsClientGetResponse` -- New struct `RestorePointCollectionsClientGetResult` -- New struct `RestorePointCollectionsClientListAllOptions` -- New struct `RestorePointCollectionsClientListAllPager` -- New struct `RestorePointCollectionsClientListAllResponse` -- New struct `RestorePointCollectionsClientListAllResult` -- New struct `RestorePointCollectionsClientListOptions` -- New struct `RestorePointCollectionsClientListPager` -- New struct `RestorePointCollectionsClientListResponse` -- New struct `RestorePointCollectionsClientListResult` -- New struct `RestorePointCollectionsClientUpdateOptions` -- New struct `RestorePointCollectionsClientUpdateResponse` -- New struct `RestorePointCollectionsClientUpdateResult` -- New struct `RestorePointsClientBeginCreateOptions` -- New struct `RestorePointsClientBeginDeleteOptions` -- New struct `RestorePointsClientCreatePoller` -- New struct `RestorePointsClientCreatePollerResponse` -- New struct `RestorePointsClientCreateResponse` -- New struct `RestorePointsClientCreateResult` -- New struct `RestorePointsClientDeletePoller` -- New struct `RestorePointsClientDeletePollerResponse` -- New struct `RestorePointsClientDeleteResponse` -- New struct `RestorePointsClientGetOptions` -- New struct `RestorePointsClientGetResponse` -- New struct `RestorePointsClientGetResult` -- New struct `SSHPublicKeysClientCreateOptions` -- New struct `SSHPublicKeysClientCreateResponse` -- New struct `SSHPublicKeysClientCreateResult` -- New struct `SSHPublicKeysClientDeleteOptions` -- New struct `SSHPublicKeysClientDeleteResponse` -- New struct `SSHPublicKeysClientGenerateKeyPairOptions` -- New struct `SSHPublicKeysClientGenerateKeyPairResponse` -- New struct `SSHPublicKeysClientGenerateKeyPairResult` -- New struct `SSHPublicKeysClientGetOptions` -- New struct `SSHPublicKeysClientGetResponse` -- New struct `SSHPublicKeysClientGetResult` -- New struct `SSHPublicKeysClientListByResourceGroupOptions` -- New struct `SSHPublicKeysClientListByResourceGroupPager` -- New struct `SSHPublicKeysClientListByResourceGroupResponse` -- New struct `SSHPublicKeysClientListByResourceGroupResult` -- New struct `SSHPublicKeysClientListBySubscriptionOptions` -- New struct `SSHPublicKeysClientListBySubscriptionPager` -- New struct `SSHPublicKeysClientListBySubscriptionResponse` -- New struct `SSHPublicKeysClientListBySubscriptionResult` -- New struct `SSHPublicKeysClientUpdateOptions` -- New struct `SSHPublicKeysClientUpdateResponse` -- New struct `SSHPublicKeysClientUpdateResult` -- New struct `SharedGalleriesClientGetOptions` -- New struct `SharedGalleriesClientGetResponse` -- New struct `SharedGalleriesClientGetResult` -- New struct `SharedGalleriesClientListOptions` -- New struct `SharedGalleriesClientListPager` -- New struct `SharedGalleriesClientListResponse` -- New struct `SharedGalleriesClientListResult` -- New struct `SharedGalleryImageVersionsClientGetOptions` -- New struct `SharedGalleryImageVersionsClientGetResponse` -- New struct `SharedGalleryImageVersionsClientGetResult` -- New struct `SharedGalleryImageVersionsClientListOptions` -- New struct `SharedGalleryImageVersionsClientListPager` -- New struct `SharedGalleryImageVersionsClientListResponse` -- New struct `SharedGalleryImageVersionsClientListResult` -- New struct `SharedGalleryImagesClientGetOptions` -- New struct `SharedGalleryImagesClientGetResponse` -- New struct `SharedGalleryImagesClientGetResult` -- New struct `SharedGalleryImagesClientListOptions` -- New struct `SharedGalleryImagesClientListPager` -- New struct `SharedGalleryImagesClientListResponse` -- New struct `SharedGalleryImagesClientListResult` -- New struct `SnapshotsClientBeginCreateOrUpdateOptions` -- New struct `SnapshotsClientBeginDeleteOptions` -- New struct `SnapshotsClientBeginGrantAccessOptions` -- New struct `SnapshotsClientBeginRevokeAccessOptions` -- New struct `SnapshotsClientBeginUpdateOptions` -- New struct `SnapshotsClientCreateOrUpdatePoller` -- New struct `SnapshotsClientCreateOrUpdatePollerResponse` -- New struct `SnapshotsClientCreateOrUpdateResponse` -- New struct `SnapshotsClientCreateOrUpdateResult` -- New struct `SnapshotsClientDeletePoller` -- New struct `SnapshotsClientDeletePollerResponse` -- New struct `SnapshotsClientDeleteResponse` -- New struct `SnapshotsClientGetOptions` -- New struct `SnapshotsClientGetResponse` -- New struct `SnapshotsClientGetResult` -- New struct `SnapshotsClientGrantAccessPoller` -- New struct `SnapshotsClientGrantAccessPollerResponse` -- New struct `SnapshotsClientGrantAccessResponse` -- New struct `SnapshotsClientGrantAccessResult` -- New struct `SnapshotsClientListByResourceGroupOptions` -- New struct `SnapshotsClientListByResourceGroupPager` -- New struct `SnapshotsClientListByResourceGroupResponse` -- New struct `SnapshotsClientListByResourceGroupResult` -- New struct `SnapshotsClientListOptions` -- New struct `SnapshotsClientListPager` -- New struct `SnapshotsClientListResponse` -- New struct `SnapshotsClientListResult` -- New struct `SnapshotsClientRevokeAccessPoller` -- New struct `SnapshotsClientRevokeAccessPollerResponse` -- New struct `SnapshotsClientRevokeAccessResponse` -- New struct `SnapshotsClientUpdatePoller` -- New struct `SnapshotsClientUpdatePollerResponse` -- New struct `SnapshotsClientUpdateResponse` -- New struct `SnapshotsClientUpdateResult` -- New struct `UsageClientListOptions` -- New struct `UsageClientListPager` -- New struct `UsageClientListResponse` -- New struct `UsageClientListResult` -- New struct `VirtualMachineExtensionImagesClientGetOptions` -- New struct `VirtualMachineExtensionImagesClientGetResponse` -- New struct `VirtualMachineExtensionImagesClientGetResult` -- New struct `VirtualMachineExtensionImagesClientListTypesOptions` -- New struct `VirtualMachineExtensionImagesClientListTypesResponse` -- New struct `VirtualMachineExtensionImagesClientListTypesResult` -- New struct `VirtualMachineExtensionImagesClientListVersionsOptions` -- New struct `VirtualMachineExtensionImagesClientListVersionsResponse` -- New struct `VirtualMachineExtensionImagesClientListVersionsResult` -- New struct `VirtualMachineExtensionsClientBeginCreateOrUpdateOptions` -- New struct `VirtualMachineExtensionsClientBeginDeleteOptions` -- New struct `VirtualMachineExtensionsClientBeginUpdateOptions` -- New struct `VirtualMachineExtensionsClientCreateOrUpdatePoller` -- New struct `VirtualMachineExtensionsClientCreateOrUpdatePollerResponse` -- New struct `VirtualMachineExtensionsClientCreateOrUpdateResponse` -- New struct `VirtualMachineExtensionsClientCreateOrUpdateResult` -- New struct `VirtualMachineExtensionsClientDeletePoller` -- New struct `VirtualMachineExtensionsClientDeletePollerResponse` -- New struct `VirtualMachineExtensionsClientDeleteResponse` -- New struct `VirtualMachineExtensionsClientGetOptions` -- New struct `VirtualMachineExtensionsClientGetResponse` -- New struct `VirtualMachineExtensionsClientGetResult` -- New struct `VirtualMachineExtensionsClientListOptions` -- New struct `VirtualMachineExtensionsClientListResponse` -- New struct `VirtualMachineExtensionsClientListResult` -- New struct `VirtualMachineExtensionsClientUpdatePoller` -- New struct `VirtualMachineExtensionsClientUpdatePollerResponse` -- New struct `VirtualMachineExtensionsClientUpdateResponse` -- New struct `VirtualMachineExtensionsClientUpdateResult` -- New struct `VirtualMachineImagesClientGetOptions` -- New struct `VirtualMachineImagesClientGetResponse` -- New struct `VirtualMachineImagesClientGetResult` -- New struct `VirtualMachineImagesClientListOffersOptions` -- New struct `VirtualMachineImagesClientListOffersResponse` -- New struct `VirtualMachineImagesClientListOffersResult` -- New struct `VirtualMachineImagesClientListOptions` -- New struct `VirtualMachineImagesClientListPublishersOptions` -- New struct `VirtualMachineImagesClientListPublishersResponse` -- New struct `VirtualMachineImagesClientListPublishersResult` -- New struct `VirtualMachineImagesClientListResponse` -- New struct `VirtualMachineImagesClientListResult` -- New struct `VirtualMachineImagesClientListSKUsOptions` -- New struct `VirtualMachineImagesClientListSKUsResponse` -- New struct `VirtualMachineImagesClientListSKUsResult` -- New struct `VirtualMachineImagesEdgeZoneClientGetOptions` -- New struct `VirtualMachineImagesEdgeZoneClientGetResponse` -- New struct `VirtualMachineImagesEdgeZoneClientGetResult` -- New struct `VirtualMachineImagesEdgeZoneClientListOffersOptions` -- New struct `VirtualMachineImagesEdgeZoneClientListOffersResponse` -- New struct `VirtualMachineImagesEdgeZoneClientListOffersResult` -- New struct `VirtualMachineImagesEdgeZoneClientListOptions` -- New struct `VirtualMachineImagesEdgeZoneClientListPublishersOptions` -- New struct `VirtualMachineImagesEdgeZoneClientListPublishersResponse` -- New struct `VirtualMachineImagesEdgeZoneClientListPublishersResult` -- New struct `VirtualMachineImagesEdgeZoneClientListResponse` -- New struct `VirtualMachineImagesEdgeZoneClientListResult` -- New struct `VirtualMachineImagesEdgeZoneClientListSKUsOptions` -- New struct `VirtualMachineImagesEdgeZoneClientListSKUsResponse` -- New struct `VirtualMachineImagesEdgeZoneClientListSKUsResult` -- New struct `VirtualMachineRunCommandsClientBeginCreateOrUpdateOptions` -- New struct `VirtualMachineRunCommandsClientBeginDeleteOptions` -- New struct `VirtualMachineRunCommandsClientBeginUpdateOptions` -- New struct `VirtualMachineRunCommandsClientCreateOrUpdatePoller` -- New struct `VirtualMachineRunCommandsClientCreateOrUpdatePollerResponse` -- New struct `VirtualMachineRunCommandsClientCreateOrUpdateResponse` -- New struct `VirtualMachineRunCommandsClientCreateOrUpdateResult` -- New struct `VirtualMachineRunCommandsClientDeletePoller` -- New struct `VirtualMachineRunCommandsClientDeletePollerResponse` -- New struct `VirtualMachineRunCommandsClientDeleteResponse` -- New struct `VirtualMachineRunCommandsClientGetByVirtualMachineOptions` -- New struct `VirtualMachineRunCommandsClientGetByVirtualMachineResponse` -- New struct `VirtualMachineRunCommandsClientGetByVirtualMachineResult` -- New struct `VirtualMachineRunCommandsClientGetOptions` -- New struct `VirtualMachineRunCommandsClientGetResponse` -- New struct `VirtualMachineRunCommandsClientGetResult` -- New struct `VirtualMachineRunCommandsClientListByVirtualMachineOptions` -- New struct `VirtualMachineRunCommandsClientListByVirtualMachinePager` -- New struct `VirtualMachineRunCommandsClientListByVirtualMachineResponse` -- New struct `VirtualMachineRunCommandsClientListByVirtualMachineResult` -- New struct `VirtualMachineRunCommandsClientListOptions` -- New struct `VirtualMachineRunCommandsClientListPager` -- New struct `VirtualMachineRunCommandsClientListResponse` -- New struct `VirtualMachineRunCommandsClientListResult` -- New struct `VirtualMachineRunCommandsClientUpdatePoller` -- New struct `VirtualMachineRunCommandsClientUpdatePollerResponse` -- New struct `VirtualMachineRunCommandsClientUpdateResponse` -- New struct `VirtualMachineRunCommandsClientUpdateResult` -- New struct `VirtualMachineScaleSetExtensionsClientBeginCreateOrUpdateOptions` -- New struct `VirtualMachineScaleSetExtensionsClientBeginDeleteOptions` -- New struct `VirtualMachineScaleSetExtensionsClientBeginUpdateOptions` -- New struct `VirtualMachineScaleSetExtensionsClientCreateOrUpdatePoller` -- New struct `VirtualMachineScaleSetExtensionsClientCreateOrUpdatePollerResponse` -- New struct `VirtualMachineScaleSetExtensionsClientCreateOrUpdateResponse` -- New struct `VirtualMachineScaleSetExtensionsClientCreateOrUpdateResult` -- New struct `VirtualMachineScaleSetExtensionsClientDeletePoller` -- New struct `VirtualMachineScaleSetExtensionsClientDeletePollerResponse` -- New struct `VirtualMachineScaleSetExtensionsClientDeleteResponse` -- New struct `VirtualMachineScaleSetExtensionsClientGetOptions` -- New struct `VirtualMachineScaleSetExtensionsClientGetResponse` -- New struct `VirtualMachineScaleSetExtensionsClientGetResult` -- New struct `VirtualMachineScaleSetExtensionsClientListOptions` -- New struct `VirtualMachineScaleSetExtensionsClientListPager` -- New struct `VirtualMachineScaleSetExtensionsClientListResponse` -- New struct `VirtualMachineScaleSetExtensionsClientListResult` -- New struct `VirtualMachineScaleSetExtensionsClientUpdatePoller` -- New struct `VirtualMachineScaleSetExtensionsClientUpdatePollerResponse` -- New struct `VirtualMachineScaleSetExtensionsClientUpdateResponse` -- New struct `VirtualMachineScaleSetExtensionsClientUpdateResult` -- New struct `VirtualMachineScaleSetRollingUpgradesClientBeginCancelOptions` -- New struct `VirtualMachineScaleSetRollingUpgradesClientBeginStartExtensionUpgradeOptions` -- New struct `VirtualMachineScaleSetRollingUpgradesClientBeginStartOSUpgradeOptions` -- New struct `VirtualMachineScaleSetRollingUpgradesClientCancelPoller` -- New struct `VirtualMachineScaleSetRollingUpgradesClientCancelPollerResponse` -- New struct `VirtualMachineScaleSetRollingUpgradesClientCancelResponse` -- New struct `VirtualMachineScaleSetRollingUpgradesClientGetLatestOptions` -- New struct `VirtualMachineScaleSetRollingUpgradesClientGetLatestResponse` -- New struct `VirtualMachineScaleSetRollingUpgradesClientGetLatestResult` -- New struct `VirtualMachineScaleSetRollingUpgradesClientStartExtensionUpgradePoller` -- New struct `VirtualMachineScaleSetRollingUpgradesClientStartExtensionUpgradePollerResponse` -- New struct `VirtualMachineScaleSetRollingUpgradesClientStartExtensionUpgradeResponse` -- New struct `VirtualMachineScaleSetRollingUpgradesClientStartOSUpgradePoller` -- New struct `VirtualMachineScaleSetRollingUpgradesClientStartOSUpgradePollerResponse` -- New struct `VirtualMachineScaleSetRollingUpgradesClientStartOSUpgradeResponse` -- New struct `VirtualMachineScaleSetVMExtensionsClientBeginCreateOrUpdateOptions` -- New struct `VirtualMachineScaleSetVMExtensionsClientBeginDeleteOptions` -- New struct `VirtualMachineScaleSetVMExtensionsClientBeginUpdateOptions` -- New struct `VirtualMachineScaleSetVMExtensionsClientCreateOrUpdatePoller` -- New struct `VirtualMachineScaleSetVMExtensionsClientCreateOrUpdatePollerResponse` -- New struct `VirtualMachineScaleSetVMExtensionsClientCreateOrUpdateResponse` -- New struct `VirtualMachineScaleSetVMExtensionsClientCreateOrUpdateResult` -- New struct `VirtualMachineScaleSetVMExtensionsClientDeletePoller` -- New struct `VirtualMachineScaleSetVMExtensionsClientDeletePollerResponse` -- New struct `VirtualMachineScaleSetVMExtensionsClientDeleteResponse` -- New struct `VirtualMachineScaleSetVMExtensionsClientGetOptions` -- New struct `VirtualMachineScaleSetVMExtensionsClientGetResponse` -- New struct `VirtualMachineScaleSetVMExtensionsClientGetResult` -- New struct `VirtualMachineScaleSetVMExtensionsClientListOptions` -- New struct `VirtualMachineScaleSetVMExtensionsClientListResponse` -- New struct `VirtualMachineScaleSetVMExtensionsClientListResult` -- New struct `VirtualMachineScaleSetVMExtensionsClientUpdatePoller` -- New struct `VirtualMachineScaleSetVMExtensionsClientUpdatePollerResponse` -- New struct `VirtualMachineScaleSetVMExtensionsClientUpdateResponse` -- New struct `VirtualMachineScaleSetVMExtensionsClientUpdateResult` -- New struct `VirtualMachineScaleSetVMRunCommandsClientBeginCreateOrUpdateOptions` -- New struct `VirtualMachineScaleSetVMRunCommandsClientBeginDeleteOptions` -- New struct `VirtualMachineScaleSetVMRunCommandsClientBeginUpdateOptions` -- New struct `VirtualMachineScaleSetVMRunCommandsClientCreateOrUpdatePoller` -- New struct `VirtualMachineScaleSetVMRunCommandsClientCreateOrUpdatePollerResponse` -- New struct `VirtualMachineScaleSetVMRunCommandsClientCreateOrUpdateResponse` -- New struct `VirtualMachineScaleSetVMRunCommandsClientCreateOrUpdateResult` -- New struct `VirtualMachineScaleSetVMRunCommandsClientDeletePoller` -- New struct `VirtualMachineScaleSetVMRunCommandsClientDeletePollerResponse` -- New struct `VirtualMachineScaleSetVMRunCommandsClientDeleteResponse` -- New struct `VirtualMachineScaleSetVMRunCommandsClientGetOptions` -- New struct `VirtualMachineScaleSetVMRunCommandsClientGetResponse` -- New struct `VirtualMachineScaleSetVMRunCommandsClientGetResult` -- New struct `VirtualMachineScaleSetVMRunCommandsClientListOptions` -- New struct `VirtualMachineScaleSetVMRunCommandsClientListPager` -- New struct `VirtualMachineScaleSetVMRunCommandsClientListResponse` -- New struct `VirtualMachineScaleSetVMRunCommandsClientListResult` -- New struct `VirtualMachineScaleSetVMRunCommandsClientUpdatePoller` -- New struct `VirtualMachineScaleSetVMRunCommandsClientUpdatePollerResponse` -- New struct `VirtualMachineScaleSetVMRunCommandsClientUpdateResponse` -- New struct `VirtualMachineScaleSetVMRunCommandsClientUpdateResult` -- New struct `VirtualMachineScaleSetVMsClientBeginDeallocateOptions` -- New struct `VirtualMachineScaleSetVMsClientBeginDeleteOptions` -- New struct `VirtualMachineScaleSetVMsClientBeginPerformMaintenanceOptions` -- New struct `VirtualMachineScaleSetVMsClientBeginPowerOffOptions` -- New struct `VirtualMachineScaleSetVMsClientBeginRedeployOptions` -- New struct `VirtualMachineScaleSetVMsClientBeginReimageAllOptions` -- New struct `VirtualMachineScaleSetVMsClientBeginReimageOptions` -- New struct `VirtualMachineScaleSetVMsClientBeginRestartOptions` -- New struct `VirtualMachineScaleSetVMsClientBeginRunCommandOptions` -- New struct `VirtualMachineScaleSetVMsClientBeginStartOptions` -- New struct `VirtualMachineScaleSetVMsClientBeginUpdateOptions` -- New struct `VirtualMachineScaleSetVMsClientDeallocatePoller` -- New struct `VirtualMachineScaleSetVMsClientDeallocatePollerResponse` -- New struct `VirtualMachineScaleSetVMsClientDeallocateResponse` -- New struct `VirtualMachineScaleSetVMsClientDeletePoller` -- New struct `VirtualMachineScaleSetVMsClientDeletePollerResponse` -- New struct `VirtualMachineScaleSetVMsClientDeleteResponse` -- New struct `VirtualMachineScaleSetVMsClientGetInstanceViewOptions` -- New struct `VirtualMachineScaleSetVMsClientGetInstanceViewResponse` -- New struct `VirtualMachineScaleSetVMsClientGetInstanceViewResult` -- New struct `VirtualMachineScaleSetVMsClientGetOptions` -- New struct `VirtualMachineScaleSetVMsClientGetResponse` -- New struct `VirtualMachineScaleSetVMsClientGetResult` -- New struct `VirtualMachineScaleSetVMsClientListOptions` -- New struct `VirtualMachineScaleSetVMsClientListPager` -- New struct `VirtualMachineScaleSetVMsClientListResponse` -- New struct `VirtualMachineScaleSetVMsClientListResult` -- New struct `VirtualMachineScaleSetVMsClientPerformMaintenancePoller` -- New struct `VirtualMachineScaleSetVMsClientPerformMaintenancePollerResponse` -- New struct `VirtualMachineScaleSetVMsClientPerformMaintenanceResponse` -- New struct `VirtualMachineScaleSetVMsClientPowerOffPoller` -- New struct `VirtualMachineScaleSetVMsClientPowerOffPollerResponse` -- New struct `VirtualMachineScaleSetVMsClientPowerOffResponse` -- New struct `VirtualMachineScaleSetVMsClientRedeployPoller` -- New struct `VirtualMachineScaleSetVMsClientRedeployPollerResponse` -- New struct `VirtualMachineScaleSetVMsClientRedeployResponse` -- New struct `VirtualMachineScaleSetVMsClientReimageAllPoller` -- New struct `VirtualMachineScaleSetVMsClientReimageAllPollerResponse` -- New struct `VirtualMachineScaleSetVMsClientReimageAllResponse` -- New struct `VirtualMachineScaleSetVMsClientReimagePoller` -- New struct `VirtualMachineScaleSetVMsClientReimagePollerResponse` -- New struct `VirtualMachineScaleSetVMsClientReimageResponse` -- New struct `VirtualMachineScaleSetVMsClientRestartPoller` -- New struct `VirtualMachineScaleSetVMsClientRestartPollerResponse` -- New struct `VirtualMachineScaleSetVMsClientRestartResponse` -- New struct `VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataOptions` -- New struct `VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataResponse` -- New struct `VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataResult` -- New struct `VirtualMachineScaleSetVMsClientRunCommandPoller` -- New struct `VirtualMachineScaleSetVMsClientRunCommandPollerResponse` -- New struct `VirtualMachineScaleSetVMsClientRunCommandResponse` -- New struct `VirtualMachineScaleSetVMsClientRunCommandResult` -- New struct `VirtualMachineScaleSetVMsClientSimulateEvictionOptions` -- New struct `VirtualMachineScaleSetVMsClientSimulateEvictionResponse` -- New struct `VirtualMachineScaleSetVMsClientStartPoller` -- New struct `VirtualMachineScaleSetVMsClientStartPollerResponse` -- New struct `VirtualMachineScaleSetVMsClientStartResponse` -- New struct `VirtualMachineScaleSetVMsClientUpdatePoller` -- New struct `VirtualMachineScaleSetVMsClientUpdatePollerResponse` -- New struct `VirtualMachineScaleSetVMsClientUpdateResponse` -- New struct `VirtualMachineScaleSetVMsClientUpdateResult` -- New struct `VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions` -- New struct `VirtualMachineScaleSetsClientBeginDeallocateOptions` -- New struct `VirtualMachineScaleSetsClientBeginDeleteInstancesOptions` -- New struct `VirtualMachineScaleSetsClientBeginDeleteOptions` -- New struct `VirtualMachineScaleSetsClientBeginPerformMaintenanceOptions` -- New struct `VirtualMachineScaleSetsClientBeginPowerOffOptions` -- New struct `VirtualMachineScaleSetsClientBeginRedeployOptions` -- New struct `VirtualMachineScaleSetsClientBeginReimageAllOptions` -- New struct `VirtualMachineScaleSetsClientBeginReimageOptions` -- New struct `VirtualMachineScaleSetsClientBeginRestartOptions` -- New struct `VirtualMachineScaleSetsClientBeginSetOrchestrationServiceStateOptions` -- New struct `VirtualMachineScaleSetsClientBeginStartOptions` -- New struct `VirtualMachineScaleSetsClientBeginUpdateInstancesOptions` -- New struct `VirtualMachineScaleSetsClientBeginUpdateOptions` -- New struct `VirtualMachineScaleSetsClientConvertToSinglePlacementGroupOptions` -- New struct `VirtualMachineScaleSetsClientConvertToSinglePlacementGroupResponse` -- New struct `VirtualMachineScaleSetsClientCreateOrUpdatePoller` -- New struct `VirtualMachineScaleSetsClientCreateOrUpdatePollerResponse` -- New struct `VirtualMachineScaleSetsClientCreateOrUpdateResponse` -- New struct `VirtualMachineScaleSetsClientCreateOrUpdateResult` -- New struct `VirtualMachineScaleSetsClientDeallocatePoller` -- New struct `VirtualMachineScaleSetsClientDeallocatePollerResponse` -- New struct `VirtualMachineScaleSetsClientDeallocateResponse` -- New struct `VirtualMachineScaleSetsClientDeleteInstancesPoller` -- New struct `VirtualMachineScaleSetsClientDeleteInstancesPollerResponse` -- New struct `VirtualMachineScaleSetsClientDeleteInstancesResponse` -- New struct `VirtualMachineScaleSetsClientDeletePoller` -- New struct `VirtualMachineScaleSetsClientDeletePollerResponse` -- New struct `VirtualMachineScaleSetsClientDeleteResponse` -- New struct `VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkOptions` -- New struct `VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkResponse` -- New struct `VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkResult` -- New struct `VirtualMachineScaleSetsClientGetInstanceViewOptions` -- New struct `VirtualMachineScaleSetsClientGetInstanceViewResponse` -- New struct `VirtualMachineScaleSetsClientGetInstanceViewResult` -- New struct `VirtualMachineScaleSetsClientGetOSUpgradeHistoryOptions` -- New struct `VirtualMachineScaleSetsClientGetOSUpgradeHistoryPager` -- New struct `VirtualMachineScaleSetsClientGetOSUpgradeHistoryResponse` -- New struct `VirtualMachineScaleSetsClientGetOSUpgradeHistoryResult` -- New struct `VirtualMachineScaleSetsClientGetOptions` -- New struct `VirtualMachineScaleSetsClientGetResponse` -- New struct `VirtualMachineScaleSetsClientGetResult` -- New struct `VirtualMachineScaleSetsClientListAllOptions` -- New struct `VirtualMachineScaleSetsClientListAllPager` -- New struct `VirtualMachineScaleSetsClientListAllResponse` -- New struct `VirtualMachineScaleSetsClientListAllResult` -- New struct `VirtualMachineScaleSetsClientListByLocationOptions` -- New struct `VirtualMachineScaleSetsClientListByLocationPager` -- New struct `VirtualMachineScaleSetsClientListByLocationResponse` -- New struct `VirtualMachineScaleSetsClientListByLocationResult` -- New struct `VirtualMachineScaleSetsClientListOptions` -- New struct `VirtualMachineScaleSetsClientListPager` -- New struct `VirtualMachineScaleSetsClientListResponse` -- New struct `VirtualMachineScaleSetsClientListResult` -- New struct `VirtualMachineScaleSetsClientListSKUsOptions` -- New struct `VirtualMachineScaleSetsClientListSKUsPager` -- New struct `VirtualMachineScaleSetsClientListSKUsResponse` -- New struct `VirtualMachineScaleSetsClientListSKUsResult` -- New struct `VirtualMachineScaleSetsClientPerformMaintenancePoller` -- New struct `VirtualMachineScaleSetsClientPerformMaintenancePollerResponse` -- New struct `VirtualMachineScaleSetsClientPerformMaintenanceResponse` -- New struct `VirtualMachineScaleSetsClientPowerOffPoller` -- New struct `VirtualMachineScaleSetsClientPowerOffPollerResponse` -- New struct `VirtualMachineScaleSetsClientPowerOffResponse` -- New struct `VirtualMachineScaleSetsClientRedeployPoller` -- New struct `VirtualMachineScaleSetsClientRedeployPollerResponse` -- New struct `VirtualMachineScaleSetsClientRedeployResponse` -- New struct `VirtualMachineScaleSetsClientReimageAllPoller` -- New struct `VirtualMachineScaleSetsClientReimageAllPollerResponse` -- New struct `VirtualMachineScaleSetsClientReimageAllResponse` -- New struct `VirtualMachineScaleSetsClientReimagePoller` -- New struct `VirtualMachineScaleSetsClientReimagePollerResponse` -- New struct `VirtualMachineScaleSetsClientReimageResponse` -- New struct `VirtualMachineScaleSetsClientRestartPoller` -- New struct `VirtualMachineScaleSetsClientRestartPollerResponse` -- New struct `VirtualMachineScaleSetsClientRestartResponse` -- New struct `VirtualMachineScaleSetsClientSetOrchestrationServiceStatePoller` -- New struct `VirtualMachineScaleSetsClientSetOrchestrationServiceStatePollerResponse` -- New struct `VirtualMachineScaleSetsClientSetOrchestrationServiceStateResponse` -- New struct `VirtualMachineScaleSetsClientStartPoller` -- New struct `VirtualMachineScaleSetsClientStartPollerResponse` -- New struct `VirtualMachineScaleSetsClientStartResponse` -- New struct `VirtualMachineScaleSetsClientUpdateInstancesPoller` -- New struct `VirtualMachineScaleSetsClientUpdateInstancesPollerResponse` -- New struct `VirtualMachineScaleSetsClientUpdateInstancesResponse` -- New struct `VirtualMachineScaleSetsClientUpdatePoller` -- New struct `VirtualMachineScaleSetsClientUpdatePollerResponse` -- New struct `VirtualMachineScaleSetsClientUpdateResponse` -- New struct `VirtualMachineScaleSetsClientUpdateResult` -- New struct `VirtualMachineSizesClientListOptions` -- New struct `VirtualMachineSizesClientListResponse` -- New struct `VirtualMachineSizesClientListResult` -- New struct `VirtualMachinesClientAssessPatchesPoller` -- New struct `VirtualMachinesClientAssessPatchesPollerResponse` -- New struct `VirtualMachinesClientAssessPatchesResponse` -- New struct `VirtualMachinesClientAssessPatchesResult` -- New struct `VirtualMachinesClientBeginAssessPatchesOptions` -- New struct `VirtualMachinesClientBeginCaptureOptions` -- New struct `VirtualMachinesClientBeginConvertToManagedDisksOptions` -- New struct `VirtualMachinesClientBeginCreateOrUpdateOptions` -- New struct `VirtualMachinesClientBeginDeallocateOptions` -- New struct `VirtualMachinesClientBeginDeleteOptions` -- New struct `VirtualMachinesClientBeginInstallPatchesOptions` -- New struct `VirtualMachinesClientBeginPerformMaintenanceOptions` -- New struct `VirtualMachinesClientBeginPowerOffOptions` -- New struct `VirtualMachinesClientBeginReapplyOptions` -- New struct `VirtualMachinesClientBeginRedeployOptions` -- New struct `VirtualMachinesClientBeginReimageOptions` -- New struct `VirtualMachinesClientBeginRestartOptions` -- New struct `VirtualMachinesClientBeginRunCommandOptions` -- New struct `VirtualMachinesClientBeginStartOptions` -- New struct `VirtualMachinesClientBeginUpdateOptions` -- New struct `VirtualMachinesClientCapturePoller` -- New struct `VirtualMachinesClientCapturePollerResponse` -- New struct `VirtualMachinesClientCaptureResponse` -- New struct `VirtualMachinesClientCaptureResult` -- New struct `VirtualMachinesClientConvertToManagedDisksPoller` -- New struct `VirtualMachinesClientConvertToManagedDisksPollerResponse` -- New struct `VirtualMachinesClientConvertToManagedDisksResponse` -- New struct `VirtualMachinesClientCreateOrUpdatePoller` -- New struct `VirtualMachinesClientCreateOrUpdatePollerResponse` -- New struct `VirtualMachinesClientCreateOrUpdateResponse` -- New struct `VirtualMachinesClientCreateOrUpdateResult` -- New struct `VirtualMachinesClientDeallocatePoller` -- New struct `VirtualMachinesClientDeallocatePollerResponse` -- New struct `VirtualMachinesClientDeallocateResponse` -- New struct `VirtualMachinesClientDeletePoller` -- New struct `VirtualMachinesClientDeletePollerResponse` -- New struct `VirtualMachinesClientDeleteResponse` -- New struct `VirtualMachinesClientGeneralizeOptions` -- New struct `VirtualMachinesClientGeneralizeResponse` -- New struct `VirtualMachinesClientGetOptions` -- New struct `VirtualMachinesClientGetResponse` -- New struct `VirtualMachinesClientGetResult` -- New struct `VirtualMachinesClientInstallPatchesPoller` -- New struct `VirtualMachinesClientInstallPatchesPollerResponse` -- New struct `VirtualMachinesClientInstallPatchesResponse` -- New struct `VirtualMachinesClientInstallPatchesResult` -- New struct `VirtualMachinesClientInstanceViewOptions` -- New struct `VirtualMachinesClientInstanceViewResponse` -- New struct `VirtualMachinesClientInstanceViewResult` -- New struct `VirtualMachinesClientListAllOptions` -- New struct `VirtualMachinesClientListAllPager` -- New struct `VirtualMachinesClientListAllResponse` -- New struct `VirtualMachinesClientListAllResult` -- New struct `VirtualMachinesClientListAvailableSizesOptions` -- New struct `VirtualMachinesClientListAvailableSizesResponse` -- New struct `VirtualMachinesClientListAvailableSizesResult` -- New struct `VirtualMachinesClientListByLocationOptions` -- New struct `VirtualMachinesClientListByLocationPager` -- New struct `VirtualMachinesClientListByLocationResponse` -- New struct `VirtualMachinesClientListByLocationResult` -- New struct `VirtualMachinesClientListOptions` -- New struct `VirtualMachinesClientListPager` -- New struct `VirtualMachinesClientListResponse` -- New struct `VirtualMachinesClientListResult` -- New struct `VirtualMachinesClientPerformMaintenancePoller` -- New struct `VirtualMachinesClientPerformMaintenancePollerResponse` -- New struct `VirtualMachinesClientPerformMaintenanceResponse` -- New struct `VirtualMachinesClientPowerOffPoller` -- New struct `VirtualMachinesClientPowerOffPollerResponse` -- New struct `VirtualMachinesClientPowerOffResponse` -- New struct `VirtualMachinesClientReapplyPoller` -- New struct `VirtualMachinesClientReapplyPollerResponse` -- New struct `VirtualMachinesClientReapplyResponse` -- New struct `VirtualMachinesClientRedeployPoller` -- New struct `VirtualMachinesClientRedeployPollerResponse` -- New struct `VirtualMachinesClientRedeployResponse` -- New struct `VirtualMachinesClientReimagePoller` -- New struct `VirtualMachinesClientReimagePollerResponse` -- New struct `VirtualMachinesClientReimageResponse` -- New struct `VirtualMachinesClientRestartPoller` -- New struct `VirtualMachinesClientRestartPollerResponse` -- New struct `VirtualMachinesClientRestartResponse` -- New struct `VirtualMachinesClientRetrieveBootDiagnosticsDataOptions` -- New struct `VirtualMachinesClientRetrieveBootDiagnosticsDataResponse` -- New struct `VirtualMachinesClientRetrieveBootDiagnosticsDataResult` -- New struct `VirtualMachinesClientRunCommandPoller` -- New struct `VirtualMachinesClientRunCommandPollerResponse` -- New struct `VirtualMachinesClientRunCommandResponse` -- New struct `VirtualMachinesClientRunCommandResult` -- New struct `VirtualMachinesClientSimulateEvictionOptions` -- New struct `VirtualMachinesClientSimulateEvictionResponse` -- New struct `VirtualMachinesClientStartPoller` -- New struct `VirtualMachinesClientStartPollerResponse` -- New struct `VirtualMachinesClientStartResponse` -- New struct `VirtualMachinesClientUpdatePoller` -- New struct `VirtualMachinesClientUpdatePollerResponse` -- New struct `VirtualMachinesClientUpdateResponse` -- New struct `VirtualMachinesClientUpdateResult` -- New field `Tags` in struct `CapacityReservationUpdate` -- New field `SupportedCapabilities` in struct `SnapshotUpdateProperties` -- New field `Tags` in struct `AvailabilitySetUpdate` -- New field `Location` in struct `Image` -- New field `Tags` in struct `Image` -- New field `ID` in struct `Image` -- New field `Name` in struct `Image` -- New field `Type` in struct `Image` -- New field `Name` in struct `RestorePoint` -- New field `Type` in struct `RestorePoint` -- New field `ID` in struct `RestorePoint` -- New field `Location` in struct `SSHPublicKeyResource` -- New field `Tags` in struct `SSHPublicKeyResource` -- New field `ID` in struct `SSHPublicKeyResource` -- New field `Name` in struct `SSHPublicKeyResource` -- New field `Type` in struct `SSHPublicKeyResource` -- New field `Tags` in struct `SSHPublicKeyUpdateResource` -- New field `ID` in struct `VirtualMachineImageResource` -- New field `BlobContainerSasURI` in struct `RequestRateByIntervalInput` -- New field `FromTime` in struct `RequestRateByIntervalInput` -- New field `ToTime` in struct `RequestRateByIntervalInput` -- New field `GroupByOperationName` in struct `RequestRateByIntervalInput` -- New field `GroupByClientApplicationID` in struct `RequestRateByIntervalInput` -- New field `GroupByResourceName` in struct `RequestRateByIntervalInput` -- New field `GroupByThrottlePolicy` in struct `RequestRateByIntervalInput` -- New field `GroupByUserAgent` in struct `RequestRateByIntervalInput` -- New field `Tags` in struct `DedicatedHostGroupUpdate` -- New field `Name` in struct `VirtualMachineScaleSet` -- New field `Location` in struct `VirtualMachineScaleSet` -- New field `ID` in struct `VirtualMachineScaleSet` -- New field `Type` in struct `VirtualMachineScaleSet` -- New field `Tags` in struct `VirtualMachineScaleSet` -- New field `Location` in struct `Gallery` -- New field `Tags` in struct `Gallery` -- New field `ID` in struct `Gallery` -- New field `Name` in struct `Gallery` -- New field `Type` in struct `Gallery` -- New field `ID` in struct `SubResourceWithColocationStatus` -- New field `SecurityProfile` in struct `SnapshotProperties` -- New field `Tags` in struct `CapacityReservationGroupUpdate` -- New field `Name` in struct `CapacityReservationGroup` -- New field `Type` in struct `CapacityReservationGroup` -- New field `Location` in struct `CapacityReservationGroup` -- New field `Tags` in struct `CapacityReservationGroup` -- New field `ID` in struct `CapacityReservationGroup` -- New field `Tags` in struct `ProximityPlacementGroupUpdate` -- New field `Tags` in struct `VirtualMachineExtensionUpdate` -- New field `Tags` in struct `VirtualMachineRunCommandUpdate` -- New field `ID` in struct `VirtualMachineScaleSetExtension` -- New field `TempDisk` in struct `VirtualMachineScaleSetReimageParameters` -- New field `Type` in struct `RollingUpgradeStatusInfo` -- New field `Location` in struct `RollingUpgradeStatusInfo` -- New field `Tags` in struct `RollingUpgradeStatusInfo` -- New field `ID` in struct `RollingUpgradeStatusInfo` -- New field `Name` in struct `RollingUpgradeStatusInfo` -- New field `Tags` in struct `GalleryApplicationVersionUpdate` -- New field `ID` in struct `GalleryApplicationVersionUpdate` -- New field `Name` in struct `GalleryApplicationVersionUpdate` -- New field `Type` in struct `GalleryApplicationVersionUpdate` -- New field `SecurityDataURI` in struct `CreationData` -- New field `StorageAccountType` in struct `ImageOSDisk` -- New field `BlobURI` in struct `ImageOSDisk` -- New field `Caching` in struct `ImageOSDisk` -- New field `DiskEncryptionSet` in struct `ImageOSDisk` -- New field `DiskSizeGB` in struct `ImageOSDisk` -- New field `Snapshot` in struct `ImageOSDisk` -- New field `ManagedDisk` in struct `ImageOSDisk` -- New field `UtilizationInfo` in struct `CapacityReservationInstanceViewWithName` -- New field `Statuses` in struct `CapacityReservationInstanceViewWithName` -- New field `Location` in struct `Snapshot` -- New field `ID` in struct `Snapshot` -- New field `Type` in struct `Snapshot` -- New field `Tags` in struct `Snapshot` -- New field `Name` in struct `Snapshot` -- New field `HostCaching` in struct `GalleryDataDiskImage` -- New field `Source` in struct `GalleryDataDiskImage` -- New field `SizeInGB` in struct `GalleryDataDiskImage` -- New field `ID` in struct `GalleryImageVersion` -- New field `Name` in struct `GalleryImageVersion` -- New field `Type` in struct `GalleryImageVersion` -- New field `Location` in struct `GalleryImageVersion` -- New field `Tags` in struct `GalleryImageVersion` -- New field `Location` in struct `DedicatedHost` -- New field `Tags` in struct `DedicatedHost` -- New field `ID` in struct `DedicatedHost` -- New field `Name` in struct `DedicatedHost` -- New field `Type` in struct `DedicatedHost` -- New field `ID` in struct `VirtualMachineCaptureResult` -- New field `ID` in struct `GalleryApplicationUpdate` -- New field `Name` in struct `GalleryApplicationUpdate` -- New field `Type` in struct `GalleryApplicationUpdate` -- New field `Tags` in struct `GalleryApplicationUpdate` -- New field `ID` in struct `GalleryImageVersionUpdate` -- New field `Name` in struct `GalleryImageVersionUpdate` -- New field `Type` in struct `GalleryImageVersionUpdate` -- New field `Tags` in struct `GalleryImageVersionUpdate` -- New field `ID` in struct `VirtualMachineScaleSetVMExtensionUpdate` -- New field `ID` in struct `VirtualMachineScaleSetNetworkConfiguration` -- New field `Tags` in struct `RestorePointCollectionUpdate` -- New field `ID` in struct `DiskEncryptionSetParameters` -- New field `ID` in struct `VirtualMachineScaleSetVMExtension` -- New field `Type` in struct `VirtualMachine` -- New field `Tags` in struct `VirtualMachine` -- New field `Location` in struct `VirtualMachine` -- New field `ID` in struct `VirtualMachine` -- New field `Name` in struct `VirtualMachine` -- New field `ID` in struct `DiskEncryptionSet` -- New field `Name` in struct `DiskEncryptionSet` -- New field `Type` in struct `DiskEncryptionSet` -- New field `Location` in struct `DiskEncryptionSet` -- New field `Tags` in struct `DiskEncryptionSet` -- New field `Tags` in struct `ImageUpdate` -- New field `DiskEncryptionSetID` in struct `OSDiskImageEncryption` -- New field `Tags` in struct `GalleryUpdate` -- New field `ID` in struct `GalleryUpdate` -- New field `Name` in struct `GalleryUpdate` -- New field `Type` in struct `GalleryUpdate` -- New field `Name` in struct `CapacityReservation` -- New field `Type` in struct `CapacityReservation` -- New field `Location` in struct `CapacityReservation` -- New field `Tags` in struct `CapacityReservation` -- New field `ID` in struct `CapacityReservation` -- New field `Tags` in struct `VirtualMachineUpdate` -- New field `ID` in struct `ManagedDiskParameters` -- New field `Identifier` in struct `CommunityGallery` -- New field `Location` in struct `CommunityGallery` -- New field `Name` in struct `CommunityGallery` -- New field `Type` in struct `CommunityGallery` -- New field `DiskSizeGB` in struct `ImageDataDisk` -- New field `ManagedDisk` in struct `ImageDataDisk` -- New field `Snapshot` in struct `ImageDataDisk` -- New field `StorageAccountType` in struct `ImageDataDisk` -- New field `BlobURI` in struct `ImageDataDisk` -- New field `Caching` in struct `ImageDataDisk` -- New field `DiskEncryptionSet` in struct `ImageDataDisk` -- New field `HostCaching` in struct `GalleryOSDiskImage` -- New field `Source` in struct `GalleryOSDiskImage` -- New field `SizeInGB` in struct `GalleryOSDiskImage` -- New field `GetSecureVMGuestStateSAS` in struct `GrantAccessData` -- New field `ID` in struct `VirtualMachineScaleSetUpdateIPConfiguration` -- New field `Name` in struct `VirtualMachineExtensionImage` -- New field `Type` in struct `VirtualMachineExtensionImage` -- New field `Location` in struct `VirtualMachineExtensionImage` -- New field `Tags` in struct `VirtualMachineExtensionImage` -- New field `ID` in struct `VirtualMachineExtensionImage` -- New field `ID` in struct `VirtualMachineScaleSetIPConfiguration` -- New field `Location` in struct `PirSharedGalleryResource` -- New field `Name` in struct `PirSharedGalleryResource` -- New field `SecurityDataAccessSAS` in struct `AccessURI` -- New field `Tags` in struct `VirtualMachineExtension` -- New field `ID` in struct `VirtualMachineExtension` -- New field `Name` in struct `VirtualMachineExtension` -- New field `Type` in struct `VirtualMachineExtension` -- New field `Location` in struct `VirtualMachineExtension` -- New field `Name` in struct `DedicatedHostGroup` -- New field `Type` in struct `DedicatedHostGroup` -- New field `Location` in struct `DedicatedHostGroup` -- New field `Tags` in struct `DedicatedHostGroup` -- New field `ID` in struct `DedicatedHostGroup` -- New field `Tags` in struct `GalleryImageUpdate` -- New field `ID` in struct `GalleryImageUpdate` -- New field `Name` in struct `GalleryImageUpdate` -- New field `Type` in struct `GalleryImageUpdate` -- New field `Tags` in struct `VirtualMachineScaleSetVM` -- New field `ID` in struct `VirtualMachineScaleSetVM` -- New field `Location` in struct `VirtualMachineScaleSetVM` -- New field `Name` in struct `VirtualMachineScaleSetVM` -- New field `Type` in struct `VirtualMachineScaleSetVM` -- New field `ExtendedLocation` in struct `VirtualMachineImage` -- New field `ID` in struct `VirtualMachineImage` -- New field `Tags` in struct `VirtualMachineImage` -- New field `Location` in struct `VirtualMachineImage` -- New field `Name` in struct `VirtualMachineImage` -- New field `ID` in struct `ProximityPlacementGroup` -- New field `Name` in struct `ProximityPlacementGroup` -- New field `Type` in struct `ProximityPlacementGroup` -- New field `Location` in struct `ProximityPlacementGroup` -- New field `Tags` in struct `ProximityPlacementGroup` -- New field `Type` in struct `VirtualMachineRunCommand` -- New field `Location` in struct `VirtualMachineRunCommand` -- New field `Tags` in struct `VirtualMachineRunCommand` -- New field `ID` in struct `VirtualMachineRunCommand` -- New field `Name` in struct `VirtualMachineRunCommand` -- New field `ID` in struct `RunCommandDocument` -- New field `Label` in struct `RunCommandDocument` -- New field `OSType` in struct `RunCommandDocument` -- New field `Schema` in struct `RunCommandDocument` -- New field `Description` in struct `RunCommandDocument` -- New field `ReplicationMode` in struct `GalleryApplicationVersionPublishingProfile` -- New field `StorageAccountType` in struct `GalleryApplicationVersionPublishingProfile` -- New field `TargetRegions` in struct `GalleryApplicationVersionPublishingProfile` -- New field `ExcludeFromLatest` in struct `GalleryApplicationVersionPublishingProfile` -- New field `PublishedDate` in struct `GalleryApplicationVersionPublishingProfile` -- New field `EndOfLifeDate` in struct `GalleryApplicationVersionPublishingProfile` -- New field `ReplicaCount` in struct `GalleryApplicationVersionPublishingProfile` -- New field `ID` in struct `ImageReference` -- New field `Tags` in struct `DedicatedHostUpdate` -- New field `Location` in struct `AvailabilitySet` -- New field `Tags` in struct `AvailabilitySet` -- New field `ID` in struct `AvailabilitySet` -- New field `Name` in struct `AvailabilitySet` -- New field `Type` in struct `AvailabilitySet` -- New field `DiskEncryptionSetID` in struct `DataDiskImageEncryption` -- New field `Identifier` in struct `SharedGallery` -- New field `Location` in struct `SharedGallery` -- New field `Name` in struct `SharedGallery` -- New field `ID` in struct `DiskRestorePoint` -- New field `Name` in struct `DiskRestorePoint` -- New field `Type` in struct `DiskRestorePoint` -- New field `SourceResourceLocation` in struct `DiskRestorePointProperties` -- New field `ReplicationState` in struct `DiskRestorePointProperties` -- New field `Error` in struct `CloudError` -- New field `EndOfLifeDate` in struct `GalleryImageVersionPublishingProfile` -- New field `ExcludeFromLatest` in struct `GalleryImageVersionPublishingProfile` -- New field `ReplicaCount` in struct `GalleryImageVersionPublishingProfile` -- New field `ReplicationMode` in struct `GalleryImageVersionPublishingProfile` -- New field `StorageAccountType` in struct `GalleryImageVersionPublishingProfile` -- New field `TargetRegions` in struct `GalleryImageVersionPublishingProfile` -- New field `PublishedDate` in struct `GalleryImageVersionPublishingProfile` -- New field `ID` in struct `RestorePointCollection` -- New field `Name` in struct `RestorePointCollection` -- New field `Type` in struct `RestorePointCollection` -- New field `Location` in struct `RestorePointCollection` -- New field `Tags` in struct `RestorePointCollection` -- New field `SecureVMDiskEncryptionSetID` in struct `DiskSecurityProfile` -- New field `Tags` in struct `VirtualMachineScaleSetUpdate` -- New field `Identifier` in struct `SharedGalleryImage` -- New field `Location` in struct `SharedGalleryImage` -- New field `Name` in struct `SharedGalleryImage` -- New field `Location` in struct `GalleryApplication` -- New field `Tags` in struct `GalleryApplication` -- New field `ID` in struct `GalleryApplication` -- New field `Name` in struct `GalleryApplication` -- New field `Type` in struct `GalleryApplication` -- New field `Location` in struct `CommunityGalleryImage` -- New field `Name` in struct `CommunityGalleryImage` -- New field `Type` in struct `CommunityGalleryImage` -- New field `Identifier` in struct `CommunityGalleryImage` -- New field `ID` in struct `VirtualMachineScaleSetExtensionUpdate` -- New field `Location` in struct `DiskAccess` -- New field `Tags` in struct `DiskAccess` -- New field `ID` in struct `DiskAccess` -- New field `Name` in struct `DiskAccess` -- New field `Type` in struct `DiskAccess` -- New field `ToTime` in struct `ThrottledRequestsInput` -- New field `GroupByClientApplicationID` in struct `ThrottledRequestsInput` -- New field `GroupByOperationName` in struct `ThrottledRequestsInput` -- New field `GroupByResourceName` in struct `ThrottledRequestsInput` -- New field `GroupByThrottlePolicy` in struct `ThrottledRequestsInput` -- New field `GroupByUserAgent` in struct `ThrottledRequestsInput` -- New field `BlobContainerSasURI` in struct `ThrottledRequestsInput` -- New field `FromTime` in struct `ThrottledRequestsInput` -- New field `ID` in struct `NetworkInterfaceReference` -- New field `TempDisk` in struct `VirtualMachineScaleSetVMReimageParameters` -- New field `Identifier` in struct `SharedGalleryImageVersion` -- New field `Location` in struct `SharedGalleryImageVersion` -- New field `Name` in struct `SharedGalleryImageVersion` -- New field `AssetID` in struct `DedicatedHostInstanceViewWithName` -- New field `AvailableCapacity` in struct `DedicatedHostInstanceViewWithName` -- New field `Statuses` in struct `DedicatedHostInstanceViewWithName` -- New field `Tags` in struct `GalleryImage` -- New field `ID` in struct `GalleryImage` -- New field `Name` in struct `GalleryImage` -- New field `Type` in struct `GalleryImage` -- New field `Location` in struct `GalleryImage` -- New field `Type` in struct `GalleryApplicationVersion` -- New field `Location` in struct `GalleryApplicationVersion` -- New field `Tags` in struct `GalleryApplicationVersion` -- New field `ID` in struct `GalleryApplicationVersion` -- New field `Name` in struct `GalleryApplicationVersion` -- New field `Identifier` in struct `CommunityGalleryImageVersion` -- New field `Location` in struct `CommunityGalleryImageVersion` -- New field `Name` in struct `CommunityGalleryImageVersion` -- New field `Type` in struct `CommunityGalleryImageVersion` -- New field `Location` in struct `Disk` -- New field `ID` in struct `Disk` -- New field `Type` in struct `Disk` -- New field `Tags` in struct `Disk` -- New field `Name` in struct `Disk` -- New field `ID` in struct `VirtualMachineScaleSetUpdateNetworkConfiguration` - - -## 0.2.1 (2021-11-26) - -### Other Changes - -- Now use `github.com/Azure/azure-sdk-for-go/sdk/azidentity@v0.12.0` explicitly. - -## 0.2.0 (2021-10-29) - -### Breaking Changes - -- `arm.Connection` has been removed in `github.com/Azure/azure-sdk-for-go/sdk/azcore/v0.20.0` -- The parameters of `NewXXXClient` has been changed from `(con *arm.Connection, subscriptionID string)` to `(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions)` - -## 0.1.0 (2021-09-29) -- To better align with the Azure SDK guidelines (https://azure.github.io/azure-sdk/general_introduction.html), we have decided to change the module path to "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute". Therefore, we are deprecating the old module path (which is "github.com/Azure/azure-sdk-for-go/sdk/compute/armcompute") to avoid confusion. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/LICENSE.txt b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/LICENSE.txt deleted file mode 100644 index dc0c2ffb..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/LICENSE.txt +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) Microsoft Corporation. All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/README.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/README.md deleted file mode 100644 index 7ccd1f86..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/README.md +++ /dev/null @@ -1,88 +0,0 @@ -# Azure Compute Module for Go - -[![PkgGoDev](https://pkg.go.dev/badge/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute)](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute) - -The `armcompute` module provides operations for working with Azure Compute. - -[Source code](https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/resourcemanager/compute/armcompute) - -# Getting started - -## Prerequisites - -- an [Azure subscription](https://azure.microsoft.com/free/) -- Go 1.18 or above - -## Install the package - -This project uses [Go modules](https://github.com/golang/go/wiki/Modules) for versioning and dependency management. - -Install the Azure Compute module: - -```sh -go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute -``` - -## Authorization - -When creating a client, you will need to provide a credential for authenticating with Azure Compute. The `azidentity` module provides facilities for various ways of authenticating with Azure including client/secret, certificate, managed identity, and more. - -```go -cred, err := azidentity.NewDefaultAzureCredential(nil) -``` - -For more information on authentication, please see the documentation for `azidentity` at [pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity). - -## Clients - -Azure Compute modules consist of one or more clients. A client groups a set of related APIs, providing access to its functionality within the specified subscription. Create one or more clients to access the APIs you require using your credential. - -```go -client, err := armcompute.NewLogAnalyticsClient(, cred, nil) -``` - -You can use `ClientOptions` in package `github.com/Azure/azure-sdk-for-go/sdk/azcore/arm` to set endpoint to connect with public and sovereign clouds as well as Azure Stack. For more information, please see the documentation for `azcore` at [pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azcore](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azcore). - -```go -options := arm.ClientOptions { - ClientOptions: azcore.ClientOptions { - Cloud: cloud.AzureChina, - }, -} -client, err := armcompute.NewLogAnalyticsClient(, cred, &options) -``` - -## More sample code - -- [Availability Set](https://aka.ms/azsdk/go/mgmt/samples?path=sdk/resourcemanager/compute/availabilityset) -- [Virtual Machine](https://aka.ms/azsdk/go/mgmt/samples?path=sdk/resourcemanager/compute/createVM) -- [Dedicated Host](https://aka.ms/azsdk/go/mgmt/samples?path=sdk/resourcemanager/compute/dedicated_host) -- [Disk](https://aka.ms/azsdk/go/mgmt/samples?path=sdk/resourcemanager/compute/disk) -- [Gallery](https://aka.ms/azsdk/go/mgmt/samples?path=sdk/resourcemanager/compute/gallery) -- [Proximity Placement Group](https://aka.ms/azsdk/go/mgmt/samples?path=sdk/resourcemanager/compute/proximity) -- [Snapshot](https://aka.ms/azsdk/go/mgmt/samples?path=sdk/resourcemanager/compute/snapshot) -- [Virtual Machine Scale Set](https://aka.ms/azsdk/go/mgmt/samples?path=sdk/resourcemanager/compute/vmscaleset) - -## Provide Feedback - -If you encounter bugs or have suggestions, please -[open an issue](https://github.com/Azure/azure-sdk-for-go/issues) and assign the `Compute` label. - -# Contributing - -This project welcomes contributions and suggestions. Most contributions require -you to agree to a Contributor License Agreement (CLA) declaring that you have -the right to, and actually do, grant us the rights to use your contribution. -For details, visit [https://cla.microsoft.com](https://cla.microsoft.com). - -When you submit a pull request, a CLA-bot will automatically determine whether -you need to provide a CLA and decorate the PR appropriately (e.g., label, -comment). Simply follow the instructions provided by the bot. You will only -need to do this once across all repos using our CLA. - -This project has adopted the -[Microsoft Open Source Code of Conduct](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. \ No newline at end of file diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/autorest.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/autorest.md deleted file mode 100644 index 6586bd0d..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/autorest.md +++ /dev/null @@ -1,12 +0,0 @@ -### AutoRest Configuration - -> see https://aka.ms/autorest - -``` yaml -azure-arm: true -require: -- https://github.com/Azure/azure-rest-api-specs/blob/0cc5e2efd6ffccf30e80d1e150b488dd87198b94/specification/compute/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/0cc5e2efd6ffccf30e80d1e150b488dd87198b94/specification/compute/resource-manager/readme.go.md -license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.0.0 -``` \ No newline at end of file diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/build.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/build.go deleted file mode 100644 index 78362d44..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/build.go +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. - -// This file enables 'go generate' to regenerate this specific SDK -//go:generate pwsh.exe ../../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate resourcemanager/compute/armcompute - -package armcompute diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/ci.yml b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/ci.yml deleted file mode 100644 index 084ed1b4..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/ci.yml +++ /dev/null @@ -1,28 +0,0 @@ -# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. -trigger: - branches: - include: - - main - - feature/* - - hotfix/* - - release/* - paths: - include: - - sdk/resourcemanager/compute/armcompute/ - -pr: - branches: - include: - - main - - feature/* - - hotfix/* - - release/* - paths: - include: - - sdk/resourcemanager/compute/armcompute/ - -stages: -- template: /eng/pipelines/templates/jobs/archetype-sdk-client.yml - parameters: - IncludeRelease: true - ServiceDirectory: 'resourcemanager/compute/armcompute' diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_availabilitysets_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_availabilitysets_client.go deleted file mode 100644 index 595afa85..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_availabilitysets_client.go +++ /dev/null @@ -1,466 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// AvailabilitySetsClient contains the methods for the AvailabilitySets group. -// Don't use this type directly, use NewAvailabilitySetsClient() instead. -type AvailabilitySetsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewAvailabilitySetsClient creates a new instance of AvailabilitySetsClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewAvailabilitySetsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AvailabilitySetsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &AvailabilitySetsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// CreateOrUpdate - Create or update an availability set. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// availabilitySetName - The name of the availability set. -// parameters - Parameters supplied to the Create Availability Set operation. -// options - AvailabilitySetsClientCreateOrUpdateOptions contains the optional parameters for the AvailabilitySetsClient.CreateOrUpdate -// method. -func (client *AvailabilitySetsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, availabilitySetName string, parameters AvailabilitySet, options *AvailabilitySetsClientCreateOrUpdateOptions) (AvailabilitySetsClientCreateOrUpdateResponse, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, availabilitySetName, parameters, options) - if err != nil { - return AvailabilitySetsClientCreateOrUpdateResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return AvailabilitySetsClientCreateOrUpdateResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AvailabilitySetsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) - } - return client.createOrUpdateHandleResponse(resp) -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *AvailabilitySetsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, availabilitySetName string, parameters AvailabilitySet, options *AvailabilitySetsClientCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if availabilitySetName == "" { - return nil, errors.New("parameter availabilitySetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{availabilitySetName}", url.PathEscape(availabilitySetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// createOrUpdateHandleResponse handles the CreateOrUpdate response. -func (client *AvailabilitySetsClient) createOrUpdateHandleResponse(resp *http.Response) (AvailabilitySetsClientCreateOrUpdateResponse, error) { - result := AvailabilitySetsClientCreateOrUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.AvailabilitySet); err != nil { - return AvailabilitySetsClientCreateOrUpdateResponse{}, err - } - return result, nil -} - -// Delete - Delete an availability set. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// availabilitySetName - The name of the availability set. -// options - AvailabilitySetsClientDeleteOptions contains the optional parameters for the AvailabilitySetsClient.Delete method. -func (client *AvailabilitySetsClient) Delete(ctx context.Context, resourceGroupName string, availabilitySetName string, options *AvailabilitySetsClientDeleteOptions) (AvailabilitySetsClientDeleteResponse, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, availabilitySetName, options) - if err != nil { - return AvailabilitySetsClientDeleteResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return AvailabilitySetsClientDeleteResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return AvailabilitySetsClientDeleteResponse{}, runtime.NewResponseError(resp) - } - return AvailabilitySetsClientDeleteResponse{}, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *AvailabilitySetsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, availabilitySetName string, options *AvailabilitySetsClientDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if availabilitySetName == "" { - return nil, errors.New("parameter availabilitySetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{availabilitySetName}", url.PathEscape(availabilitySetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Retrieves information about an availability set. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// availabilitySetName - The name of the availability set. -// options - AvailabilitySetsClientGetOptions contains the optional parameters for the AvailabilitySetsClient.Get method. -func (client *AvailabilitySetsClient) Get(ctx context.Context, resourceGroupName string, availabilitySetName string, options *AvailabilitySetsClientGetOptions) (AvailabilitySetsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, availabilitySetName, options) - if err != nil { - return AvailabilitySetsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return AvailabilitySetsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AvailabilitySetsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *AvailabilitySetsClient) getCreateRequest(ctx context.Context, resourceGroupName string, availabilitySetName string, options *AvailabilitySetsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if availabilitySetName == "" { - return nil, errors.New("parameter availabilitySetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{availabilitySetName}", url.PathEscape(availabilitySetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *AvailabilitySetsClient) getHandleResponse(resp *http.Response) (AvailabilitySetsClientGetResponse, error) { - result := AvailabilitySetsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.AvailabilitySet); err != nil { - return AvailabilitySetsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Lists all availability sets in a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// options - AvailabilitySetsClientListOptions contains the optional parameters for the AvailabilitySetsClient.List method. -func (client *AvailabilitySetsClient) NewListPager(resourceGroupName string, options *AvailabilitySetsClientListOptions) *runtime.Pager[AvailabilitySetsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[AvailabilitySetsClientListResponse]{ - More: func(page AvailabilitySetsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *AvailabilitySetsClientListResponse) (AvailabilitySetsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return AvailabilitySetsClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return AvailabilitySetsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AvailabilitySetsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *AvailabilitySetsClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *AvailabilitySetsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *AvailabilitySetsClient) listHandleResponse(resp *http.Response) (AvailabilitySetsClientListResponse, error) { - result := AvailabilitySetsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.AvailabilitySetListResult); err != nil { - return AvailabilitySetsClientListResponse{}, err - } - return result, nil -} - -// NewListAvailableSizesPager - Lists all available virtual machine sizes that can be used to create a new virtual machine -// in an existing availability set. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// availabilitySetName - The name of the availability set. -// options - AvailabilitySetsClientListAvailableSizesOptions contains the optional parameters for the AvailabilitySetsClient.ListAvailableSizes -// method. -func (client *AvailabilitySetsClient) NewListAvailableSizesPager(resourceGroupName string, availabilitySetName string, options *AvailabilitySetsClientListAvailableSizesOptions) *runtime.Pager[AvailabilitySetsClientListAvailableSizesResponse] { - return runtime.NewPager(runtime.PagingHandler[AvailabilitySetsClientListAvailableSizesResponse]{ - More: func(page AvailabilitySetsClientListAvailableSizesResponse) bool { - return false - }, - Fetcher: func(ctx context.Context, page *AvailabilitySetsClientListAvailableSizesResponse) (AvailabilitySetsClientListAvailableSizesResponse, error) { - req, err := client.listAvailableSizesCreateRequest(ctx, resourceGroupName, availabilitySetName, options) - if err != nil { - return AvailabilitySetsClientListAvailableSizesResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return AvailabilitySetsClientListAvailableSizesResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AvailabilitySetsClientListAvailableSizesResponse{}, runtime.NewResponseError(resp) - } - return client.listAvailableSizesHandleResponse(resp) - }, - }) -} - -// listAvailableSizesCreateRequest creates the ListAvailableSizes request. -func (client *AvailabilitySetsClient) listAvailableSizesCreateRequest(ctx context.Context, resourceGroupName string, availabilitySetName string, options *AvailabilitySetsClientListAvailableSizesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}/vmSizes" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if availabilitySetName == "" { - return nil, errors.New("parameter availabilitySetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{availabilitySetName}", url.PathEscape(availabilitySetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listAvailableSizesHandleResponse handles the ListAvailableSizes response. -func (client *AvailabilitySetsClient) listAvailableSizesHandleResponse(resp *http.Response) (AvailabilitySetsClientListAvailableSizesResponse, error) { - result := AvailabilitySetsClientListAvailableSizesResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineSizeListResult); err != nil { - return AvailabilitySetsClientListAvailableSizesResponse{}, err - } - return result, nil -} - -// NewListBySubscriptionPager - Lists all availability sets in a subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// options - AvailabilitySetsClientListBySubscriptionOptions contains the optional parameters for the AvailabilitySetsClient.ListBySubscription -// method. -func (client *AvailabilitySetsClient) NewListBySubscriptionPager(options *AvailabilitySetsClientListBySubscriptionOptions) *runtime.Pager[AvailabilitySetsClientListBySubscriptionResponse] { - return runtime.NewPager(runtime.PagingHandler[AvailabilitySetsClientListBySubscriptionResponse]{ - More: func(page AvailabilitySetsClientListBySubscriptionResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *AvailabilitySetsClientListBySubscriptionResponse) (AvailabilitySetsClientListBySubscriptionResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listBySubscriptionCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return AvailabilitySetsClientListBySubscriptionResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return AvailabilitySetsClientListBySubscriptionResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AvailabilitySetsClientListBySubscriptionResponse{}, runtime.NewResponseError(resp) - } - return client.listBySubscriptionHandleResponse(resp) - }, - }) -} - -// listBySubscriptionCreateRequest creates the ListBySubscription request. -func (client *AvailabilitySetsClient) listBySubscriptionCreateRequest(ctx context.Context, options *AvailabilitySetsClientListBySubscriptionOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/availabilitySets" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listBySubscriptionHandleResponse handles the ListBySubscription response. -func (client *AvailabilitySetsClient) listBySubscriptionHandleResponse(resp *http.Response) (AvailabilitySetsClientListBySubscriptionResponse, error) { - result := AvailabilitySetsClientListBySubscriptionResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.AvailabilitySetListResult); err != nil { - return AvailabilitySetsClientListBySubscriptionResponse{}, err - } - return result, nil -} - -// Update - Update an availability set. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// availabilitySetName - The name of the availability set. -// parameters - Parameters supplied to the Update Availability Set operation. -// options - AvailabilitySetsClientUpdateOptions contains the optional parameters for the AvailabilitySetsClient.Update method. -func (client *AvailabilitySetsClient) Update(ctx context.Context, resourceGroupName string, availabilitySetName string, parameters AvailabilitySetUpdate, options *AvailabilitySetsClientUpdateOptions) (AvailabilitySetsClientUpdateResponse, error) { - req, err := client.updateCreateRequest(ctx, resourceGroupName, availabilitySetName, parameters, options) - if err != nil { - return AvailabilitySetsClientUpdateResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return AvailabilitySetsClientUpdateResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AvailabilitySetsClientUpdateResponse{}, runtime.NewResponseError(resp) - } - return client.updateHandleResponse(resp) -} - -// updateCreateRequest creates the Update request. -func (client *AvailabilitySetsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, availabilitySetName string, parameters AvailabilitySetUpdate, options *AvailabilitySetsClientUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if availabilitySetName == "" { - return nil, errors.New("parameter availabilitySetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{availabilitySetName}", url.PathEscape(availabilitySetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// updateHandleResponse handles the Update response. -func (client *AvailabilitySetsClient) updateHandleResponse(resp *http.Response) (AvailabilitySetsClientUpdateResponse, error) { - result := AvailabilitySetsClientUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.AvailabilitySet); err != nil { - return AvailabilitySetsClientUpdateResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_capacityreservationgroups_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_capacityreservationgroups_client.go deleted file mode 100644 index f698a3a5..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_capacityreservationgroups_client.go +++ /dev/null @@ -1,418 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// CapacityReservationGroupsClient contains the methods for the CapacityReservationGroups group. -// Don't use this type directly, use NewCapacityReservationGroupsClient() instead. -type CapacityReservationGroupsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewCapacityReservationGroupsClient creates a new instance of CapacityReservationGroupsClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewCapacityReservationGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CapacityReservationGroupsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &CapacityReservationGroupsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// CreateOrUpdate - The operation to create or update a capacity reservation group. When updating a capacity reservation group, -// only tags may be modified. Please refer to https://aka.ms/CapacityReservation for more -// details. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// capacityReservationGroupName - The name of the capacity reservation group. -// parameters - Parameters supplied to the Create capacity reservation Group. -// options - CapacityReservationGroupsClientCreateOrUpdateOptions contains the optional parameters for the CapacityReservationGroupsClient.CreateOrUpdate -// method. -func (client *CapacityReservationGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, parameters CapacityReservationGroup, options *CapacityReservationGroupsClientCreateOrUpdateOptions) (CapacityReservationGroupsClientCreateOrUpdateResponse, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, capacityReservationGroupName, parameters, options) - if err != nil { - return CapacityReservationGroupsClientCreateOrUpdateResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return CapacityReservationGroupsClientCreateOrUpdateResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return CapacityReservationGroupsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) - } - return client.createOrUpdateHandleResponse(resp) -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *CapacityReservationGroupsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, parameters CapacityReservationGroup, options *CapacityReservationGroupsClientCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if capacityReservationGroupName == "" { - return nil, errors.New("parameter capacityReservationGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{capacityReservationGroupName}", url.PathEscape(capacityReservationGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// createOrUpdateHandleResponse handles the CreateOrUpdate response. -func (client *CapacityReservationGroupsClient) createOrUpdateHandleResponse(resp *http.Response) (CapacityReservationGroupsClientCreateOrUpdateResponse, error) { - result := CapacityReservationGroupsClientCreateOrUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.CapacityReservationGroup); err != nil { - return CapacityReservationGroupsClientCreateOrUpdateResponse{}, err - } - return result, nil -} - -// Delete - The operation to delete a capacity reservation group. This operation is allowed only if all the associated resources -// are disassociated from the reservation group and all capacity reservations under -// the reservation group have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// capacityReservationGroupName - The name of the capacity reservation group. -// options - CapacityReservationGroupsClientDeleteOptions contains the optional parameters for the CapacityReservationGroupsClient.Delete -// method. -func (client *CapacityReservationGroupsClient) Delete(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, options *CapacityReservationGroupsClientDeleteOptions) (CapacityReservationGroupsClientDeleteResponse, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, capacityReservationGroupName, options) - if err != nil { - return CapacityReservationGroupsClientDeleteResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return CapacityReservationGroupsClientDeleteResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return CapacityReservationGroupsClientDeleteResponse{}, runtime.NewResponseError(resp) - } - return CapacityReservationGroupsClientDeleteResponse{}, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *CapacityReservationGroupsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, options *CapacityReservationGroupsClientDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if capacityReservationGroupName == "" { - return nil, errors.New("parameter capacityReservationGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{capacityReservationGroupName}", url.PathEscape(capacityReservationGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - The operation that retrieves information about a capacity reservation group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// capacityReservationGroupName - The name of the capacity reservation group. -// options - CapacityReservationGroupsClientGetOptions contains the optional parameters for the CapacityReservationGroupsClient.Get -// method. -func (client *CapacityReservationGroupsClient) Get(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, options *CapacityReservationGroupsClientGetOptions) (CapacityReservationGroupsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, capacityReservationGroupName, options) - if err != nil { - return CapacityReservationGroupsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return CapacityReservationGroupsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return CapacityReservationGroupsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *CapacityReservationGroupsClient) getCreateRequest(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, options *CapacityReservationGroupsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if capacityReservationGroupName == "" { - return nil, errors.New("parameter capacityReservationGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{capacityReservationGroupName}", url.PathEscape(capacityReservationGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", string(*options.Expand)) - } - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *CapacityReservationGroupsClient) getHandleResponse(resp *http.Response) (CapacityReservationGroupsClientGetResponse, error) { - result := CapacityReservationGroupsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.CapacityReservationGroup); err != nil { - return CapacityReservationGroupsClientGetResponse{}, err - } - return result, nil -} - -// NewListByResourceGroupPager - Lists all of the capacity reservation groups in the specified resource group. Use the nextLink -// property in the response to get the next page of capacity reservation groups. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// options - CapacityReservationGroupsClientListByResourceGroupOptions contains the optional parameters for the CapacityReservationGroupsClient.ListByResourceGroup -// method. -func (client *CapacityReservationGroupsClient) NewListByResourceGroupPager(resourceGroupName string, options *CapacityReservationGroupsClientListByResourceGroupOptions) *runtime.Pager[CapacityReservationGroupsClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[CapacityReservationGroupsClientListByResourceGroupResponse]{ - More: func(page CapacityReservationGroupsClientListByResourceGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *CapacityReservationGroupsClientListByResourceGroupResponse) (CapacityReservationGroupsClientListByResourceGroupResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return CapacityReservationGroupsClientListByResourceGroupResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return CapacityReservationGroupsClientListByResourceGroupResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return CapacityReservationGroupsClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) - } - return client.listByResourceGroupHandleResponse(resp) - }, - }) -} - -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *CapacityReservationGroupsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *CapacityReservationGroupsClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - if options != nil && options.Expand != nil { - reqQP.Set("$expand", string(*options.Expand)) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *CapacityReservationGroupsClient) listByResourceGroupHandleResponse(resp *http.Response) (CapacityReservationGroupsClientListByResourceGroupResponse, error) { - result := CapacityReservationGroupsClientListByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.CapacityReservationGroupListResult); err != nil { - return CapacityReservationGroupsClientListByResourceGroupResponse{}, err - } - return result, nil -} - -// NewListBySubscriptionPager - Lists all of the capacity reservation groups in the subscription. Use the nextLink property -// in the response to get the next page of capacity reservation groups. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// options - CapacityReservationGroupsClientListBySubscriptionOptions contains the optional parameters for the CapacityReservationGroupsClient.ListBySubscription -// method. -func (client *CapacityReservationGroupsClient) NewListBySubscriptionPager(options *CapacityReservationGroupsClientListBySubscriptionOptions) *runtime.Pager[CapacityReservationGroupsClientListBySubscriptionResponse] { - return runtime.NewPager(runtime.PagingHandler[CapacityReservationGroupsClientListBySubscriptionResponse]{ - More: func(page CapacityReservationGroupsClientListBySubscriptionResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *CapacityReservationGroupsClientListBySubscriptionResponse) (CapacityReservationGroupsClientListBySubscriptionResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listBySubscriptionCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return CapacityReservationGroupsClientListBySubscriptionResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return CapacityReservationGroupsClientListBySubscriptionResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return CapacityReservationGroupsClientListBySubscriptionResponse{}, runtime.NewResponseError(resp) - } - return client.listBySubscriptionHandleResponse(resp) - }, - }) -} - -// listBySubscriptionCreateRequest creates the ListBySubscription request. -func (client *CapacityReservationGroupsClient) listBySubscriptionCreateRequest(ctx context.Context, options *CapacityReservationGroupsClientListBySubscriptionOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/capacityReservationGroups" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - if options != nil && options.Expand != nil { - reqQP.Set("$expand", string(*options.Expand)) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listBySubscriptionHandleResponse handles the ListBySubscription response. -func (client *CapacityReservationGroupsClient) listBySubscriptionHandleResponse(resp *http.Response) (CapacityReservationGroupsClientListBySubscriptionResponse, error) { - result := CapacityReservationGroupsClientListBySubscriptionResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.CapacityReservationGroupListResult); err != nil { - return CapacityReservationGroupsClientListBySubscriptionResponse{}, err - } - return result, nil -} - -// Update - The operation to update a capacity reservation group. When updating a capacity reservation group, only tags may -// be modified. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// capacityReservationGroupName - The name of the capacity reservation group. -// parameters - Parameters supplied to the Update capacity reservation Group operation. -// options - CapacityReservationGroupsClientUpdateOptions contains the optional parameters for the CapacityReservationGroupsClient.Update -// method. -func (client *CapacityReservationGroupsClient) Update(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, parameters CapacityReservationGroupUpdate, options *CapacityReservationGroupsClientUpdateOptions) (CapacityReservationGroupsClientUpdateResponse, error) { - req, err := client.updateCreateRequest(ctx, resourceGroupName, capacityReservationGroupName, parameters, options) - if err != nil { - return CapacityReservationGroupsClientUpdateResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return CapacityReservationGroupsClientUpdateResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return CapacityReservationGroupsClientUpdateResponse{}, runtime.NewResponseError(resp) - } - return client.updateHandleResponse(resp) -} - -// updateCreateRequest creates the Update request. -func (client *CapacityReservationGroupsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, parameters CapacityReservationGroupUpdate, options *CapacityReservationGroupsClientUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if capacityReservationGroupName == "" { - return nil, errors.New("parameter capacityReservationGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{capacityReservationGroupName}", url.PathEscape(capacityReservationGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// updateHandleResponse handles the Update response. -func (client *CapacityReservationGroupsClient) updateHandleResponse(resp *http.Response) (CapacityReservationGroupsClientUpdateResponse, error) { - result := CapacityReservationGroupsClientUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.CapacityReservationGroup); err != nil { - return CapacityReservationGroupsClientUpdateResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_capacityreservations_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_capacityreservations_client.go deleted file mode 100644 index cc613b80..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_capacityreservations_client.go +++ /dev/null @@ -1,406 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// CapacityReservationsClient contains the methods for the CapacityReservations group. -// Don't use this type directly, use NewCapacityReservationsClient() instead. -type CapacityReservationsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewCapacityReservationsClient creates a new instance of CapacityReservationsClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewCapacityReservationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CapacityReservationsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &CapacityReservationsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - The operation to create or update a capacity reservation. Please note some properties can be set -// only during capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more -// details. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// capacityReservationGroupName - The name of the capacity reservation group. -// capacityReservationName - The name of the capacity reservation. -// parameters - Parameters supplied to the Create capacity reservation. -// options - CapacityReservationsClientBeginCreateOrUpdateOptions contains the optional parameters for the CapacityReservationsClient.BeginCreateOrUpdate -// method. -func (client *CapacityReservationsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, parameters CapacityReservation, options *CapacityReservationsClientBeginCreateOrUpdateOptions) (*runtime.Poller[CapacityReservationsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[CapacityReservationsClientCreateOrUpdateResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[CapacityReservationsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - The operation to create or update a capacity reservation. Please note some properties can be set only -// during capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more -// details. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *CapacityReservationsClient) createOrUpdate(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, parameters CapacityReservation, options *CapacityReservationsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *CapacityReservationsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, parameters CapacityReservation, options *CapacityReservationsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if capacityReservationGroupName == "" { - return nil, errors.New("parameter capacityReservationGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{capacityReservationGroupName}", url.PathEscape(capacityReservationGroupName)) - if capacityReservationName == "" { - return nil, errors.New("parameter capacityReservationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{capacityReservationName}", url.PathEscape(capacityReservationName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginDelete - The operation to delete a capacity reservation. This operation is allowed only when all the associated resources -// are disassociated from the capacity reservation. Please refer to -// https://aka.ms/CapacityReservation for more details. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// capacityReservationGroupName - The name of the capacity reservation group. -// capacityReservationName - The name of the capacity reservation. -// options - CapacityReservationsClientBeginDeleteOptions contains the optional parameters for the CapacityReservationsClient.BeginDelete -// method. -func (client *CapacityReservationsClient) BeginDelete(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, options *CapacityReservationsClientBeginDeleteOptions) (*runtime.Poller[CapacityReservationsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, capacityReservationGroupName, capacityReservationName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[CapacityReservationsClientDeleteResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[CapacityReservationsClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - The operation to delete a capacity reservation. This operation is allowed only when all the associated resources -// are disassociated from the capacity reservation. Please refer to -// https://aka.ms/CapacityReservation for more details. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *CapacityReservationsClient) deleteOperation(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, options *CapacityReservationsClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, capacityReservationGroupName, capacityReservationName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *CapacityReservationsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, options *CapacityReservationsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if capacityReservationGroupName == "" { - return nil, errors.New("parameter capacityReservationGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{capacityReservationGroupName}", url.PathEscape(capacityReservationGroupName)) - if capacityReservationName == "" { - return nil, errors.New("parameter capacityReservationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{capacityReservationName}", url.PathEscape(capacityReservationName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - The operation that retrieves information about the capacity reservation. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// capacityReservationGroupName - The name of the capacity reservation group. -// capacityReservationName - The name of the capacity reservation. -// options - CapacityReservationsClientGetOptions contains the optional parameters for the CapacityReservationsClient.Get -// method. -func (client *CapacityReservationsClient) Get(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, options *CapacityReservationsClientGetOptions) (CapacityReservationsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, capacityReservationGroupName, capacityReservationName, options) - if err != nil { - return CapacityReservationsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return CapacityReservationsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return CapacityReservationsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *CapacityReservationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, options *CapacityReservationsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if capacityReservationGroupName == "" { - return nil, errors.New("parameter capacityReservationGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{capacityReservationGroupName}", url.PathEscape(capacityReservationGroupName)) - if capacityReservationName == "" { - return nil, errors.New("parameter capacityReservationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{capacityReservationName}", url.PathEscape(capacityReservationName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", string(*options.Expand)) - } - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *CapacityReservationsClient) getHandleResponse(resp *http.Response) (CapacityReservationsClientGetResponse, error) { - result := CapacityReservationsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.CapacityReservation); err != nil { - return CapacityReservationsClientGetResponse{}, err - } - return result, nil -} - -// NewListByCapacityReservationGroupPager - Lists all of the capacity reservations in the specified capacity reservation group. -// Use the nextLink property in the response to get the next page of capacity reservations. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// capacityReservationGroupName - The name of the capacity reservation group. -// options - CapacityReservationsClientListByCapacityReservationGroupOptions contains the optional parameters for the CapacityReservationsClient.ListByCapacityReservationGroup -// method. -func (client *CapacityReservationsClient) NewListByCapacityReservationGroupPager(resourceGroupName string, capacityReservationGroupName string, options *CapacityReservationsClientListByCapacityReservationGroupOptions) *runtime.Pager[CapacityReservationsClientListByCapacityReservationGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[CapacityReservationsClientListByCapacityReservationGroupResponse]{ - More: func(page CapacityReservationsClientListByCapacityReservationGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *CapacityReservationsClientListByCapacityReservationGroupResponse) (CapacityReservationsClientListByCapacityReservationGroupResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByCapacityReservationGroupCreateRequest(ctx, resourceGroupName, capacityReservationGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return CapacityReservationsClientListByCapacityReservationGroupResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return CapacityReservationsClientListByCapacityReservationGroupResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return CapacityReservationsClientListByCapacityReservationGroupResponse{}, runtime.NewResponseError(resp) - } - return client.listByCapacityReservationGroupHandleResponse(resp) - }, - }) -} - -// listByCapacityReservationGroupCreateRequest creates the ListByCapacityReservationGroup request. -func (client *CapacityReservationsClient) listByCapacityReservationGroupCreateRequest(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, options *CapacityReservationsClientListByCapacityReservationGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if capacityReservationGroupName == "" { - return nil, errors.New("parameter capacityReservationGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{capacityReservationGroupName}", url.PathEscape(capacityReservationGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByCapacityReservationGroupHandleResponse handles the ListByCapacityReservationGroup response. -func (client *CapacityReservationsClient) listByCapacityReservationGroupHandleResponse(resp *http.Response) (CapacityReservationsClientListByCapacityReservationGroupResponse, error) { - result := CapacityReservationsClientListByCapacityReservationGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.CapacityReservationListResult); err != nil { - return CapacityReservationsClientListByCapacityReservationGroupResponse{}, err - } - return result, nil -} - -// BeginUpdate - The operation to update a capacity reservation. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// capacityReservationGroupName - The name of the capacity reservation group. -// capacityReservationName - The name of the capacity reservation. -// parameters - Parameters supplied to the Update capacity reservation operation. -// options - CapacityReservationsClientBeginUpdateOptions contains the optional parameters for the CapacityReservationsClient.BeginUpdate -// method. -func (client *CapacityReservationsClient) BeginUpdate(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, parameters CapacityReservationUpdate, options *CapacityReservationsClientBeginUpdateOptions) (*runtime.Poller[CapacityReservationsClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[CapacityReservationsClientUpdateResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[CapacityReservationsClientUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// Update - The operation to update a capacity reservation. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *CapacityReservationsClient) update(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, parameters CapacityReservationUpdate, options *CapacityReservationsClientBeginUpdateOptions) (*http.Response, error) { - req, err := client.updateCreateRequest(ctx, resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// updateCreateRequest creates the Update request. -func (client *CapacityReservationsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, parameters CapacityReservationUpdate, options *CapacityReservationsClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if capacityReservationGroupName == "" { - return nil, errors.New("parameter capacityReservationGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{capacityReservationGroupName}", url.PathEscape(capacityReservationGroupName)) - if capacityReservationName == "" { - return nil, errors.New("parameter capacityReservationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{capacityReservationName}", url.PathEscape(capacityReservationName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_cloudserviceoperatingsystems_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_cloudserviceoperatingsystems_client.go deleted file mode 100644 index 16515cff..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_cloudserviceoperatingsystems_client.go +++ /dev/null @@ -1,306 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// CloudServiceOperatingSystemsClient contains the methods for the CloudServiceOperatingSystems group. -// Don't use this type directly, use NewCloudServiceOperatingSystemsClient() instead. -type CloudServiceOperatingSystemsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewCloudServiceOperatingSystemsClient creates a new instance of CloudServiceOperatingSystemsClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewCloudServiceOperatingSystemsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CloudServiceOperatingSystemsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &CloudServiceOperatingSystemsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// GetOSFamily - Gets properties of a guest operating system family that can be specified in the XML service configuration -// (.cscfg) for a cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-03-01 -// location - Name of the location that the OS family pertains to. -// osFamilyName - Name of the OS family. -// options - CloudServiceOperatingSystemsClientGetOSFamilyOptions contains the optional parameters for the CloudServiceOperatingSystemsClient.GetOSFamily -// method. -func (client *CloudServiceOperatingSystemsClient) GetOSFamily(ctx context.Context, location string, osFamilyName string, options *CloudServiceOperatingSystemsClientGetOSFamilyOptions) (CloudServiceOperatingSystemsClientGetOSFamilyResponse, error) { - req, err := client.getOSFamilyCreateRequest(ctx, location, osFamilyName, options) - if err != nil { - return CloudServiceOperatingSystemsClientGetOSFamilyResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return CloudServiceOperatingSystemsClientGetOSFamilyResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return CloudServiceOperatingSystemsClientGetOSFamilyResponse{}, runtime.NewResponseError(resp) - } - return client.getOSFamilyHandleResponse(resp) -} - -// getOSFamilyCreateRequest creates the GetOSFamily request. -func (client *CloudServiceOperatingSystemsClient) getOSFamilyCreateRequest(ctx context.Context, location string, osFamilyName string, options *CloudServiceOperatingSystemsClientGetOSFamilyOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/cloudServiceOsFamilies/{osFamilyName}" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if osFamilyName == "" { - return nil, errors.New("parameter osFamilyName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{osFamilyName}", url.PathEscape(osFamilyName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getOSFamilyHandleResponse handles the GetOSFamily response. -func (client *CloudServiceOperatingSystemsClient) getOSFamilyHandleResponse(resp *http.Response) (CloudServiceOperatingSystemsClientGetOSFamilyResponse, error) { - result := CloudServiceOperatingSystemsClientGetOSFamilyResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.OSFamily); err != nil { - return CloudServiceOperatingSystemsClientGetOSFamilyResponse{}, err - } - return result, nil -} - -// GetOSVersion - Gets properties of a guest operating system version that can be specified in the XML service configuration -// (.cscfg) for a cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-03-01 -// location - Name of the location that the OS version pertains to. -// osVersionName - Name of the OS version. -// options - CloudServiceOperatingSystemsClientGetOSVersionOptions contains the optional parameters for the CloudServiceOperatingSystemsClient.GetOSVersion -// method. -func (client *CloudServiceOperatingSystemsClient) GetOSVersion(ctx context.Context, location string, osVersionName string, options *CloudServiceOperatingSystemsClientGetOSVersionOptions) (CloudServiceOperatingSystemsClientGetOSVersionResponse, error) { - req, err := client.getOSVersionCreateRequest(ctx, location, osVersionName, options) - if err != nil { - return CloudServiceOperatingSystemsClientGetOSVersionResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return CloudServiceOperatingSystemsClientGetOSVersionResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return CloudServiceOperatingSystemsClientGetOSVersionResponse{}, runtime.NewResponseError(resp) - } - return client.getOSVersionHandleResponse(resp) -} - -// getOSVersionCreateRequest creates the GetOSVersion request. -func (client *CloudServiceOperatingSystemsClient) getOSVersionCreateRequest(ctx context.Context, location string, osVersionName string, options *CloudServiceOperatingSystemsClientGetOSVersionOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/cloudServiceOsVersions/{osVersionName}" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if osVersionName == "" { - return nil, errors.New("parameter osVersionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{osVersionName}", url.PathEscape(osVersionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getOSVersionHandleResponse handles the GetOSVersion response. -func (client *CloudServiceOperatingSystemsClient) getOSVersionHandleResponse(resp *http.Response) (CloudServiceOperatingSystemsClientGetOSVersionResponse, error) { - result := CloudServiceOperatingSystemsClientGetOSVersionResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.OSVersion); err != nil { - return CloudServiceOperatingSystemsClientGetOSVersionResponse{}, err - } - return result, nil -} - -// NewListOSFamiliesPager - Gets a list of all guest operating system families available to be specified in the XML service -// configuration (.cscfg) for a cloud service. Use nextLink property in the response to get the next page -// of OS Families. Do this till nextLink is null to fetch all the OS Families. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-03-01 -// location - Name of the location that the OS families pertain to. -// options - CloudServiceOperatingSystemsClientListOSFamiliesOptions contains the optional parameters for the CloudServiceOperatingSystemsClient.ListOSFamilies -// method. -func (client *CloudServiceOperatingSystemsClient) NewListOSFamiliesPager(location string, options *CloudServiceOperatingSystemsClientListOSFamiliesOptions) *runtime.Pager[CloudServiceOperatingSystemsClientListOSFamiliesResponse] { - return runtime.NewPager(runtime.PagingHandler[CloudServiceOperatingSystemsClientListOSFamiliesResponse]{ - More: func(page CloudServiceOperatingSystemsClientListOSFamiliesResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *CloudServiceOperatingSystemsClientListOSFamiliesResponse) (CloudServiceOperatingSystemsClientListOSFamiliesResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listOSFamiliesCreateRequest(ctx, location, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return CloudServiceOperatingSystemsClientListOSFamiliesResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return CloudServiceOperatingSystemsClientListOSFamiliesResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return CloudServiceOperatingSystemsClientListOSFamiliesResponse{}, runtime.NewResponseError(resp) - } - return client.listOSFamiliesHandleResponse(resp) - }, - }) -} - -// listOSFamiliesCreateRequest creates the ListOSFamilies request. -func (client *CloudServiceOperatingSystemsClient) listOSFamiliesCreateRequest(ctx context.Context, location string, options *CloudServiceOperatingSystemsClientListOSFamiliesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/cloudServiceOsFamilies" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listOSFamiliesHandleResponse handles the ListOSFamilies response. -func (client *CloudServiceOperatingSystemsClient) listOSFamiliesHandleResponse(resp *http.Response) (CloudServiceOperatingSystemsClientListOSFamiliesResponse, error) { - result := CloudServiceOperatingSystemsClientListOSFamiliesResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.OSFamilyListResult); err != nil { - return CloudServiceOperatingSystemsClientListOSFamiliesResponse{}, err - } - return result, nil -} - -// NewListOSVersionsPager - Gets a list of all guest operating system versions available to be specified in the XML service -// configuration (.cscfg) for a cloud service. Use nextLink property in the response to get the next page -// of OS versions. Do this till nextLink is null to fetch all the OS versions. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-03-01 -// location - Name of the location that the OS versions pertain to. -// options - CloudServiceOperatingSystemsClientListOSVersionsOptions contains the optional parameters for the CloudServiceOperatingSystemsClient.ListOSVersions -// method. -func (client *CloudServiceOperatingSystemsClient) NewListOSVersionsPager(location string, options *CloudServiceOperatingSystemsClientListOSVersionsOptions) *runtime.Pager[CloudServiceOperatingSystemsClientListOSVersionsResponse] { - return runtime.NewPager(runtime.PagingHandler[CloudServiceOperatingSystemsClientListOSVersionsResponse]{ - More: func(page CloudServiceOperatingSystemsClientListOSVersionsResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *CloudServiceOperatingSystemsClientListOSVersionsResponse) (CloudServiceOperatingSystemsClientListOSVersionsResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listOSVersionsCreateRequest(ctx, location, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return CloudServiceOperatingSystemsClientListOSVersionsResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return CloudServiceOperatingSystemsClientListOSVersionsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return CloudServiceOperatingSystemsClientListOSVersionsResponse{}, runtime.NewResponseError(resp) - } - return client.listOSVersionsHandleResponse(resp) - }, - }) -} - -// listOSVersionsCreateRequest creates the ListOSVersions request. -func (client *CloudServiceOperatingSystemsClient) listOSVersionsCreateRequest(ctx context.Context, location string, options *CloudServiceOperatingSystemsClientListOSVersionsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/cloudServiceOsVersions" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listOSVersionsHandleResponse handles the ListOSVersions response. -func (client *CloudServiceOperatingSystemsClient) listOSVersionsHandleResponse(resp *http.Response) (CloudServiceOperatingSystemsClientListOSVersionsResponse, error) { - result := CloudServiceOperatingSystemsClientListOSVersionsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.OSVersionListResult); err != nil { - return CloudServiceOperatingSystemsClientListOSVersionsResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_cloudserviceroleinstances_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_cloudserviceroleinstances_client.go deleted file mode 100644 index a7b01de4..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_cloudserviceroleinstances_client.go +++ /dev/null @@ -1,573 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// CloudServiceRoleInstancesClient contains the methods for the CloudServiceRoleInstances group. -// Don't use this type directly, use NewCloudServiceRoleInstancesClient() instead. -type CloudServiceRoleInstancesClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewCloudServiceRoleInstancesClient creates a new instance of CloudServiceRoleInstancesClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewCloudServiceRoleInstancesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CloudServiceRoleInstancesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &CloudServiceRoleInstancesClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginDelete - Deletes a role instance from a cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-03-01 -// roleInstanceName - Name of the role instance. -// options - CloudServiceRoleInstancesClientBeginDeleteOptions contains the optional parameters for the CloudServiceRoleInstancesClient.BeginDelete -// method. -func (client *CloudServiceRoleInstancesClient) BeginDelete(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientBeginDeleteOptions) (*runtime.Poller[CloudServiceRoleInstancesClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, roleInstanceName, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[CloudServiceRoleInstancesClientDeleteResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[CloudServiceRoleInstancesClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes a role instance from a cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-03-01 -func (client *CloudServiceRoleInstancesClient) deleteOperation(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, roleInstanceName, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *CloudServiceRoleInstancesClient) deleteCreateRequest(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}" - if roleInstanceName == "" { - return nil, errors.New("parameter roleInstanceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{roleInstanceName}", url.PathEscape(roleInstanceName)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets a role instance from a cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-03-01 -// roleInstanceName - Name of the role instance. -// options - CloudServiceRoleInstancesClientGetOptions contains the optional parameters for the CloudServiceRoleInstancesClient.Get -// method. -func (client *CloudServiceRoleInstancesClient) Get(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientGetOptions) (CloudServiceRoleInstancesClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, roleInstanceName, resourceGroupName, cloudServiceName, options) - if err != nil { - return CloudServiceRoleInstancesClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return CloudServiceRoleInstancesClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return CloudServiceRoleInstancesClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *CloudServiceRoleInstancesClient) getCreateRequest(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}" - if roleInstanceName == "" { - return nil, errors.New("parameter roleInstanceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{roleInstanceName}", url.PathEscape(roleInstanceName)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-03-01") - if options != nil && options.Expand != nil { - reqQP.Set("$expand", string(*options.Expand)) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *CloudServiceRoleInstancesClient) getHandleResponse(resp *http.Response) (CloudServiceRoleInstancesClientGetResponse, error) { - result := CloudServiceRoleInstancesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RoleInstance); err != nil { - return CloudServiceRoleInstancesClientGetResponse{}, err - } - return result, nil -} - -// GetInstanceView - Retrieves information about the run-time state of a role instance in a cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-03-01 -// roleInstanceName - Name of the role instance. -// options - CloudServiceRoleInstancesClientGetInstanceViewOptions contains the optional parameters for the CloudServiceRoleInstancesClient.GetInstanceView -// method. -func (client *CloudServiceRoleInstancesClient) GetInstanceView(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientGetInstanceViewOptions) (CloudServiceRoleInstancesClientGetInstanceViewResponse, error) { - req, err := client.getInstanceViewCreateRequest(ctx, roleInstanceName, resourceGroupName, cloudServiceName, options) - if err != nil { - return CloudServiceRoleInstancesClientGetInstanceViewResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return CloudServiceRoleInstancesClientGetInstanceViewResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return CloudServiceRoleInstancesClientGetInstanceViewResponse{}, runtime.NewResponseError(resp) - } - return client.getInstanceViewHandleResponse(resp) -} - -// getInstanceViewCreateRequest creates the GetInstanceView request. -func (client *CloudServiceRoleInstancesClient) getInstanceViewCreateRequest(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientGetInstanceViewOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/instanceView" - if roleInstanceName == "" { - return nil, errors.New("parameter roleInstanceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{roleInstanceName}", url.PathEscape(roleInstanceName)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getInstanceViewHandleResponse handles the GetInstanceView response. -func (client *CloudServiceRoleInstancesClient) getInstanceViewHandleResponse(resp *http.Response) (CloudServiceRoleInstancesClientGetInstanceViewResponse, error) { - result := CloudServiceRoleInstancesClientGetInstanceViewResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RoleInstanceView); err != nil { - return CloudServiceRoleInstancesClientGetInstanceViewResponse{}, err - } - return result, nil -} - -// GetRemoteDesktopFile - Gets a remote desktop file for a role instance in a cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-03-01 -// roleInstanceName - Name of the role instance. -// options - CloudServiceRoleInstancesClientGetRemoteDesktopFileOptions contains the optional parameters for the CloudServiceRoleInstancesClient.GetRemoteDesktopFile -// method. -func (client *CloudServiceRoleInstancesClient) GetRemoteDesktopFile(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientGetRemoteDesktopFileOptions) (CloudServiceRoleInstancesClientGetRemoteDesktopFileResponse, error) { - req, err := client.getRemoteDesktopFileCreateRequest(ctx, roleInstanceName, resourceGroupName, cloudServiceName, options) - if err != nil { - return CloudServiceRoleInstancesClientGetRemoteDesktopFileResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return CloudServiceRoleInstancesClientGetRemoteDesktopFileResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return CloudServiceRoleInstancesClientGetRemoteDesktopFileResponse{}, runtime.NewResponseError(resp) - } - return CloudServiceRoleInstancesClientGetRemoteDesktopFileResponse{Body: resp.Body}, nil -} - -// getRemoteDesktopFileCreateRequest creates the GetRemoteDesktopFile request. -func (client *CloudServiceRoleInstancesClient) getRemoteDesktopFileCreateRequest(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientGetRemoteDesktopFileOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/remoteDesktopFile" - if roleInstanceName == "" { - return nil, errors.New("parameter roleInstanceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{roleInstanceName}", url.PathEscape(roleInstanceName)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - runtime.SkipBodyDownload(req) - req.Raw().Header["Accept"] = []string{"application/x-rdp"} - return req, nil -} - -// NewListPager - Gets the list of all role instances in a cloud service. Use nextLink property in the response to get the -// next page of role instances. Do this till nextLink is null to fetch all the role instances. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-03-01 -// options - CloudServiceRoleInstancesClientListOptions contains the optional parameters for the CloudServiceRoleInstancesClient.List -// method. -func (client *CloudServiceRoleInstancesClient) NewListPager(resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientListOptions) *runtime.Pager[CloudServiceRoleInstancesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[CloudServiceRoleInstancesClientListResponse]{ - More: func(page CloudServiceRoleInstancesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *CloudServiceRoleInstancesClientListResponse) (CloudServiceRoleInstancesClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, cloudServiceName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return CloudServiceRoleInstancesClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return CloudServiceRoleInstancesClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return CloudServiceRoleInstancesClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *CloudServiceRoleInstancesClient) listCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-03-01") - if options != nil && options.Expand != nil { - reqQP.Set("$expand", string(*options.Expand)) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *CloudServiceRoleInstancesClient) listHandleResponse(resp *http.Response) (CloudServiceRoleInstancesClientListResponse, error) { - result := CloudServiceRoleInstancesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RoleInstanceListResult); err != nil { - return CloudServiceRoleInstancesClientListResponse{}, err - } - return result, nil -} - -// BeginRebuild - The Rebuild Role Instance asynchronous operation reinstalls the operating system on instances of web roles -// or worker roles and initializes the storage resources that are used by them. If you do not -// want to initialize storage resources, you can use Reimage Role Instance. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-03-01 -// roleInstanceName - Name of the role instance. -// options - CloudServiceRoleInstancesClientBeginRebuildOptions contains the optional parameters for the CloudServiceRoleInstancesClient.BeginRebuild -// method. -func (client *CloudServiceRoleInstancesClient) BeginRebuild(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientBeginRebuildOptions) (*runtime.Poller[CloudServiceRoleInstancesClientRebuildResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.rebuild(ctx, roleInstanceName, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[CloudServiceRoleInstancesClientRebuildResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[CloudServiceRoleInstancesClientRebuildResponse](options.ResumeToken, client.pl, nil) - } -} - -// Rebuild - The Rebuild Role Instance asynchronous operation reinstalls the operating system on instances of web roles or -// worker roles and initializes the storage resources that are used by them. If you do not -// want to initialize storage resources, you can use Reimage Role Instance. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-03-01 -func (client *CloudServiceRoleInstancesClient) rebuild(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientBeginRebuildOptions) (*http.Response, error) { - req, err := client.rebuildCreateRequest(ctx, roleInstanceName, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// rebuildCreateRequest creates the Rebuild request. -func (client *CloudServiceRoleInstancesClient) rebuildCreateRequest(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientBeginRebuildOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/rebuild" - if roleInstanceName == "" { - return nil, errors.New("parameter roleInstanceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{roleInstanceName}", url.PathEscape(roleInstanceName)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginReimage - The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web roles -// or worker roles. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-03-01 -// roleInstanceName - Name of the role instance. -// options - CloudServiceRoleInstancesClientBeginReimageOptions contains the optional parameters for the CloudServiceRoleInstancesClient.BeginReimage -// method. -func (client *CloudServiceRoleInstancesClient) BeginReimage(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientBeginReimageOptions) (*runtime.Poller[CloudServiceRoleInstancesClientReimageResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.reimage(ctx, roleInstanceName, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[CloudServiceRoleInstancesClientReimageResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[CloudServiceRoleInstancesClientReimageResponse](options.ResumeToken, client.pl, nil) - } -} - -// Reimage - The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web roles or -// worker roles. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-03-01 -func (client *CloudServiceRoleInstancesClient) reimage(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientBeginReimageOptions) (*http.Response, error) { - req, err := client.reimageCreateRequest(ctx, roleInstanceName, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// reimageCreateRequest creates the Reimage request. -func (client *CloudServiceRoleInstancesClient) reimageCreateRequest(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientBeginReimageOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/reimage" - if roleInstanceName == "" { - return nil, errors.New("parameter roleInstanceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{roleInstanceName}", url.PathEscape(roleInstanceName)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginRestart - The Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-03-01 -// roleInstanceName - Name of the role instance. -// options - CloudServiceRoleInstancesClientBeginRestartOptions contains the optional parameters for the CloudServiceRoleInstancesClient.BeginRestart -// method. -func (client *CloudServiceRoleInstancesClient) BeginRestart(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientBeginRestartOptions) (*runtime.Poller[CloudServiceRoleInstancesClientRestartResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.restart(ctx, roleInstanceName, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[CloudServiceRoleInstancesClientRestartResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[CloudServiceRoleInstancesClientRestartResponse](options.ResumeToken, client.pl, nil) - } -} - -// Restart - The Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-03-01 -func (client *CloudServiceRoleInstancesClient) restart(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientBeginRestartOptions) (*http.Response, error) { - req, err := client.restartCreateRequest(ctx, roleInstanceName, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// restartCreateRequest creates the Restart request. -func (client *CloudServiceRoleInstancesClient) restartCreateRequest(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientBeginRestartOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/restart" - if roleInstanceName == "" { - return nil, errors.New("parameter roleInstanceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{roleInstanceName}", url.PathEscape(roleInstanceName)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_cloudserviceroles_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_cloudserviceroles_client.go deleted file mode 100644 index 19cec895..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_cloudserviceroles_client.go +++ /dev/null @@ -1,183 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// CloudServiceRolesClient contains the methods for the CloudServiceRoles group. -// Don't use this type directly, use NewCloudServiceRolesClient() instead. -type CloudServiceRolesClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewCloudServiceRolesClient creates a new instance of CloudServiceRolesClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewCloudServiceRolesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CloudServiceRolesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &CloudServiceRolesClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// Get - Gets a role from a cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-03-01 -// roleName - Name of the role. -// options - CloudServiceRolesClientGetOptions contains the optional parameters for the CloudServiceRolesClient.Get method. -func (client *CloudServiceRolesClient) Get(ctx context.Context, roleName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRolesClientGetOptions) (CloudServiceRolesClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, roleName, resourceGroupName, cloudServiceName, options) - if err != nil { - return CloudServiceRolesClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return CloudServiceRolesClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return CloudServiceRolesClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *CloudServiceRolesClient) getCreateRequest(ctx context.Context, roleName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRolesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roles/{roleName}" - if roleName == "" { - return nil, errors.New("parameter roleName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{roleName}", url.PathEscape(roleName)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *CloudServiceRolesClient) getHandleResponse(resp *http.Response) (CloudServiceRolesClientGetResponse, error) { - result := CloudServiceRolesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.CloudServiceRole); err != nil { - return CloudServiceRolesClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Gets a list of all roles in a cloud service. Use nextLink property in the response to get the next page -// of roles. Do this till nextLink is null to fetch all the roles. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-03-01 -// options - CloudServiceRolesClientListOptions contains the optional parameters for the CloudServiceRolesClient.List method. -func (client *CloudServiceRolesClient) NewListPager(resourceGroupName string, cloudServiceName string, options *CloudServiceRolesClientListOptions) *runtime.Pager[CloudServiceRolesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[CloudServiceRolesClientListResponse]{ - More: func(page CloudServiceRolesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *CloudServiceRolesClientListResponse) (CloudServiceRolesClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, cloudServiceName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return CloudServiceRolesClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return CloudServiceRolesClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return CloudServiceRolesClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *CloudServiceRolesClient) listCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServiceRolesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roles" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *CloudServiceRolesClient) listHandleResponse(resp *http.Response) (CloudServiceRolesClientListResponse, error) { - result := CloudServiceRolesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.CloudServiceRoleListResult); err != nil { - return CloudServiceRolesClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_cloudservices_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_cloudservices_client.go deleted file mode 100644 index 6923162c..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_cloudservices_client.go +++ /dev/null @@ -1,886 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// CloudServicesClient contains the methods for the CloudServices group. -// Don't use this type directly, use NewCloudServicesClient() instead. -type CloudServicesClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewCloudServicesClient creates a new instance of CloudServicesClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewCloudServicesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CloudServicesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &CloudServicesClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Create or update a cloud service. Please note some properties can be set only during cloud service -// creation. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-03-01 -// resourceGroupName - Name of the resource group. -// cloudServiceName - Name of the cloud service. -// options - CloudServicesClientBeginCreateOrUpdateOptions contains the optional parameters for the CloudServicesClient.BeginCreateOrUpdate -// method. -func (client *CloudServicesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginCreateOrUpdateOptions) (*runtime.Poller[CloudServicesClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[CloudServicesClientCreateOrUpdateResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[CloudServicesClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Create or update a cloud service. Please note some properties can be set only during cloud service creation. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-03-01 -func (client *CloudServicesClient) createOrUpdate(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *CloudServicesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.Parameters != nil { - return req, runtime.MarshalAsJSON(req, *options.Parameters) - } - return req, nil -} - -// BeginDelete - Deletes a cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-03-01 -// resourceGroupName - Name of the resource group. -// cloudServiceName - Name of the cloud service. -// options - CloudServicesClientBeginDeleteOptions contains the optional parameters for the CloudServicesClient.BeginDelete -// method. -func (client *CloudServicesClient) BeginDelete(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginDeleteOptions) (*runtime.Poller[CloudServicesClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[CloudServicesClientDeleteResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[CloudServicesClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes a cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-03-01 -func (client *CloudServicesClient) deleteOperation(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *CloudServicesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginDeleteInstances - Deletes role instances in a cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-03-01 -// resourceGroupName - Name of the resource group. -// cloudServiceName - Name of the cloud service. -// options - CloudServicesClientBeginDeleteInstancesOptions contains the optional parameters for the CloudServicesClient.BeginDeleteInstances -// method. -func (client *CloudServicesClient) BeginDeleteInstances(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginDeleteInstancesOptions) (*runtime.Poller[CloudServicesClientDeleteInstancesResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteInstances(ctx, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[CloudServicesClientDeleteInstancesResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[CloudServicesClientDeleteInstancesResponse](options.ResumeToken, client.pl, nil) - } -} - -// DeleteInstances - Deletes role instances in a cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-03-01 -func (client *CloudServicesClient) deleteInstances(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginDeleteInstancesOptions) (*http.Response, error) { - req, err := client.deleteInstancesCreateRequest(ctx, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteInstancesCreateRequest creates the DeleteInstances request. -func (client *CloudServicesClient) deleteInstancesCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginDeleteInstancesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/delete" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.Parameters != nil { - return req, runtime.MarshalAsJSON(req, *options.Parameters) - } - return req, nil -} - -// Get - Display information about a cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-03-01 -// resourceGroupName - Name of the resource group. -// cloudServiceName - Name of the cloud service. -// options - CloudServicesClientGetOptions contains the optional parameters for the CloudServicesClient.Get method. -func (client *CloudServicesClient) Get(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientGetOptions) (CloudServicesClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, cloudServiceName, options) - if err != nil { - return CloudServicesClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return CloudServicesClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return CloudServicesClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *CloudServicesClient) getCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *CloudServicesClient) getHandleResponse(resp *http.Response) (CloudServicesClientGetResponse, error) { - result := CloudServicesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.CloudService); err != nil { - return CloudServicesClientGetResponse{}, err - } - return result, nil -} - -// GetInstanceView - Gets the status of a cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-03-01 -// resourceGroupName - Name of the resource group. -// cloudServiceName - Name of the cloud service. -// options - CloudServicesClientGetInstanceViewOptions contains the optional parameters for the CloudServicesClient.GetInstanceView -// method. -func (client *CloudServicesClient) GetInstanceView(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientGetInstanceViewOptions) (CloudServicesClientGetInstanceViewResponse, error) { - req, err := client.getInstanceViewCreateRequest(ctx, resourceGroupName, cloudServiceName, options) - if err != nil { - return CloudServicesClientGetInstanceViewResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return CloudServicesClientGetInstanceViewResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return CloudServicesClientGetInstanceViewResponse{}, runtime.NewResponseError(resp) - } - return client.getInstanceViewHandleResponse(resp) -} - -// getInstanceViewCreateRequest creates the GetInstanceView request. -func (client *CloudServicesClient) getInstanceViewCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientGetInstanceViewOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/instanceView" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getInstanceViewHandleResponse handles the GetInstanceView response. -func (client *CloudServicesClient) getInstanceViewHandleResponse(resp *http.Response) (CloudServicesClientGetInstanceViewResponse, error) { - result := CloudServicesClientGetInstanceViewResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.CloudServiceInstanceView); err != nil { - return CloudServicesClientGetInstanceViewResponse{}, err - } - return result, nil -} - -// NewListPager - Gets a list of all cloud services under a resource group. Use nextLink property in the response to get the -// next page of Cloud Services. Do this till nextLink is null to fetch all the Cloud Services. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-03-01 -// resourceGroupName - Name of the resource group. -// options - CloudServicesClientListOptions contains the optional parameters for the CloudServicesClient.List method. -func (client *CloudServicesClient) NewListPager(resourceGroupName string, options *CloudServicesClientListOptions) *runtime.Pager[CloudServicesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[CloudServicesClientListResponse]{ - More: func(page CloudServicesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *CloudServicesClientListResponse) (CloudServicesClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return CloudServicesClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return CloudServicesClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return CloudServicesClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *CloudServicesClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *CloudServicesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *CloudServicesClient) listHandleResponse(resp *http.Response) (CloudServicesClientListResponse, error) { - result := CloudServicesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.CloudServiceListResult); err != nil { - return CloudServicesClientListResponse{}, err - } - return result, nil -} - -// NewListAllPager - Gets a list of all cloud services in the subscription, regardless of the associated resource group. Use -// nextLink property in the response to get the next page of Cloud Services. Do this till nextLink -// is null to fetch all the Cloud Services. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-03-01 -// options - CloudServicesClientListAllOptions contains the optional parameters for the CloudServicesClient.ListAll method. -func (client *CloudServicesClient) NewListAllPager(options *CloudServicesClientListAllOptions) *runtime.Pager[CloudServicesClientListAllResponse] { - return runtime.NewPager(runtime.PagingHandler[CloudServicesClientListAllResponse]{ - More: func(page CloudServicesClientListAllResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *CloudServicesClientListAllResponse) (CloudServicesClientListAllResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listAllCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return CloudServicesClientListAllResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return CloudServicesClientListAllResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return CloudServicesClientListAllResponse{}, runtime.NewResponseError(resp) - } - return client.listAllHandleResponse(resp) - }, - }) -} - -// listAllCreateRequest creates the ListAll request. -func (client *CloudServicesClient) listAllCreateRequest(ctx context.Context, options *CloudServicesClientListAllOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/cloudServices" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listAllHandleResponse handles the ListAll response. -func (client *CloudServicesClient) listAllHandleResponse(resp *http.Response) (CloudServicesClientListAllResponse, error) { - result := CloudServicesClientListAllResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.CloudServiceListResult); err != nil { - return CloudServicesClientListAllResponse{}, err - } - return result, nil -} - -// BeginPowerOff - Power off the cloud service. Note that resources are still attached and you are getting charged for the -// resources. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-03-01 -// resourceGroupName - Name of the resource group. -// cloudServiceName - Name of the cloud service. -// options - CloudServicesClientBeginPowerOffOptions contains the optional parameters for the CloudServicesClient.BeginPowerOff -// method. -func (client *CloudServicesClient) BeginPowerOff(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginPowerOffOptions) (*runtime.Poller[CloudServicesClientPowerOffResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.powerOff(ctx, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[CloudServicesClientPowerOffResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[CloudServicesClientPowerOffResponse](options.ResumeToken, client.pl, nil) - } -} - -// PowerOff - Power off the cloud service. Note that resources are still attached and you are getting charged for the resources. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-03-01 -func (client *CloudServicesClient) powerOff(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginPowerOffOptions) (*http.Response, error) { - req, err := client.powerOffCreateRequest(ctx, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// powerOffCreateRequest creates the PowerOff request. -func (client *CloudServicesClient) powerOffCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginPowerOffOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/poweroff" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginRebuild - Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes -// the storage resources that are used by them. If you do not want to initialize storage -// resources, you can use Reimage Role Instances. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-03-01 -// resourceGroupName - Name of the resource group. -// cloudServiceName - Name of the cloud service. -// options - CloudServicesClientBeginRebuildOptions contains the optional parameters for the CloudServicesClient.BeginRebuild -// method. -func (client *CloudServicesClient) BeginRebuild(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginRebuildOptions) (*runtime.Poller[CloudServicesClientRebuildResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.rebuild(ctx, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[CloudServicesClientRebuildResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[CloudServicesClientRebuildResponse](options.ResumeToken, client.pl, nil) - } -} - -// Rebuild - Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes -// the storage resources that are used by them. If you do not want to initialize storage -// resources, you can use Reimage Role Instances. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-03-01 -func (client *CloudServicesClient) rebuild(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginRebuildOptions) (*http.Response, error) { - req, err := client.rebuildCreateRequest(ctx, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// rebuildCreateRequest creates the Rebuild request. -func (client *CloudServicesClient) rebuildCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginRebuildOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/rebuild" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.Parameters != nil { - return req, runtime.MarshalAsJSON(req, *options.Parameters) - } - return req, nil -} - -// BeginReimage - Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-03-01 -// resourceGroupName - Name of the resource group. -// cloudServiceName - Name of the cloud service. -// options - CloudServicesClientBeginReimageOptions contains the optional parameters for the CloudServicesClient.BeginReimage -// method. -func (client *CloudServicesClient) BeginReimage(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginReimageOptions) (*runtime.Poller[CloudServicesClientReimageResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.reimage(ctx, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[CloudServicesClientReimageResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[CloudServicesClientReimageResponse](options.ResumeToken, client.pl, nil) - } -} - -// Reimage - Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-03-01 -func (client *CloudServicesClient) reimage(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginReimageOptions) (*http.Response, error) { - req, err := client.reimageCreateRequest(ctx, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// reimageCreateRequest creates the Reimage request. -func (client *CloudServicesClient) reimageCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginReimageOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/reimage" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.Parameters != nil { - return req, runtime.MarshalAsJSON(req, *options.Parameters) - } - return req, nil -} - -// BeginRestart - Restarts one or more role instances in a cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-03-01 -// resourceGroupName - Name of the resource group. -// cloudServiceName - Name of the cloud service. -// options - CloudServicesClientBeginRestartOptions contains the optional parameters for the CloudServicesClient.BeginRestart -// method. -func (client *CloudServicesClient) BeginRestart(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginRestartOptions) (*runtime.Poller[CloudServicesClientRestartResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.restart(ctx, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[CloudServicesClientRestartResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[CloudServicesClientRestartResponse](options.ResumeToken, client.pl, nil) - } -} - -// Restart - Restarts one or more role instances in a cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-03-01 -func (client *CloudServicesClient) restart(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginRestartOptions) (*http.Response, error) { - req, err := client.restartCreateRequest(ctx, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// restartCreateRequest creates the Restart request. -func (client *CloudServicesClient) restartCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginRestartOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/restart" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.Parameters != nil { - return req, runtime.MarshalAsJSON(req, *options.Parameters) - } - return req, nil -} - -// BeginStart - Starts the cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-03-01 -// resourceGroupName - Name of the resource group. -// cloudServiceName - Name of the cloud service. -// options - CloudServicesClientBeginStartOptions contains the optional parameters for the CloudServicesClient.BeginStart -// method. -func (client *CloudServicesClient) BeginStart(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginStartOptions) (*runtime.Poller[CloudServicesClientStartResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.start(ctx, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[CloudServicesClientStartResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[CloudServicesClientStartResponse](options.ResumeToken, client.pl, nil) - } -} - -// Start - Starts the cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-03-01 -func (client *CloudServicesClient) start(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginStartOptions) (*http.Response, error) { - req, err := client.startCreateRequest(ctx, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// startCreateRequest creates the Start request. -func (client *CloudServicesClient) startCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginStartOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/start" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginUpdate - Update a cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-03-01 -// resourceGroupName - Name of the resource group. -// cloudServiceName - Name of the cloud service. -// options - CloudServicesClientBeginUpdateOptions contains the optional parameters for the CloudServicesClient.BeginUpdate -// method. -func (client *CloudServicesClient) BeginUpdate(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginUpdateOptions) (*runtime.Poller[CloudServicesClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[CloudServicesClientUpdateResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[CloudServicesClientUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// Update - Update a cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-03-01 -func (client *CloudServicesClient) update(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginUpdateOptions) (*http.Response, error) { - req, err := client.updateCreateRequest(ctx, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// updateCreateRequest creates the Update request. -func (client *CloudServicesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.Parameters != nil { - return req, runtime.MarshalAsJSON(req, *options.Parameters) - } - return req, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_cloudservicesupdatedomain_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_cloudservicesupdatedomain_client.go deleted file mode 100644 index 85103704..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_cloudservicesupdatedomain_client.go +++ /dev/null @@ -1,257 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strconv" - "strings" -) - -// CloudServicesUpdateDomainClient contains the methods for the CloudServicesUpdateDomain group. -// Don't use this type directly, use NewCloudServicesUpdateDomainClient() instead. -type CloudServicesUpdateDomainClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewCloudServicesUpdateDomainClient creates a new instance of CloudServicesUpdateDomainClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewCloudServicesUpdateDomainClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CloudServicesUpdateDomainClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &CloudServicesUpdateDomainClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// GetUpdateDomain - Gets the specified update domain of a cloud service. Use nextLink property in the response to get the -// next page of update domains. Do this till nextLink is null to fetch all the update domains. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-03-01 -// resourceGroupName - Name of the resource group. -// cloudServiceName - Name of the cloud service. -// updateDomain - Specifies an integer value that identifies the update domain. Update domains are identified with a zero-based -// index: the first update domain has an ID of 0, the second has an ID of 1, and so on. -// options - CloudServicesUpdateDomainClientGetUpdateDomainOptions contains the optional parameters for the CloudServicesUpdateDomainClient.GetUpdateDomain -// method. -func (client *CloudServicesUpdateDomainClient) GetUpdateDomain(ctx context.Context, resourceGroupName string, cloudServiceName string, updateDomain int32, options *CloudServicesUpdateDomainClientGetUpdateDomainOptions) (CloudServicesUpdateDomainClientGetUpdateDomainResponse, error) { - req, err := client.getUpdateDomainCreateRequest(ctx, resourceGroupName, cloudServiceName, updateDomain, options) - if err != nil { - return CloudServicesUpdateDomainClientGetUpdateDomainResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return CloudServicesUpdateDomainClientGetUpdateDomainResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return CloudServicesUpdateDomainClientGetUpdateDomainResponse{}, runtime.NewResponseError(resp) - } - return client.getUpdateDomainHandleResponse(resp) -} - -// getUpdateDomainCreateRequest creates the GetUpdateDomain request. -func (client *CloudServicesUpdateDomainClient) getUpdateDomainCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, updateDomain int32, options *CloudServicesUpdateDomainClientGetUpdateDomainOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/updateDomains/{updateDomain}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - urlPath = strings.ReplaceAll(urlPath, "{updateDomain}", url.PathEscape(strconv.FormatInt(int64(updateDomain), 10))) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getUpdateDomainHandleResponse handles the GetUpdateDomain response. -func (client *CloudServicesUpdateDomainClient) getUpdateDomainHandleResponse(resp *http.Response) (CloudServicesUpdateDomainClientGetUpdateDomainResponse, error) { - result := CloudServicesUpdateDomainClientGetUpdateDomainResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.UpdateDomain); err != nil { - return CloudServicesUpdateDomainClientGetUpdateDomainResponse{}, err - } - return result, nil -} - -// NewListUpdateDomainsPager - Gets a list of all update domains in a cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-03-01 -// resourceGroupName - Name of the resource group. -// cloudServiceName - Name of the cloud service. -// options - CloudServicesUpdateDomainClientListUpdateDomainsOptions contains the optional parameters for the CloudServicesUpdateDomainClient.ListUpdateDomains -// method. -func (client *CloudServicesUpdateDomainClient) NewListUpdateDomainsPager(resourceGroupName string, cloudServiceName string, options *CloudServicesUpdateDomainClientListUpdateDomainsOptions) *runtime.Pager[CloudServicesUpdateDomainClientListUpdateDomainsResponse] { - return runtime.NewPager(runtime.PagingHandler[CloudServicesUpdateDomainClientListUpdateDomainsResponse]{ - More: func(page CloudServicesUpdateDomainClientListUpdateDomainsResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *CloudServicesUpdateDomainClientListUpdateDomainsResponse) (CloudServicesUpdateDomainClientListUpdateDomainsResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listUpdateDomainsCreateRequest(ctx, resourceGroupName, cloudServiceName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return CloudServicesUpdateDomainClientListUpdateDomainsResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return CloudServicesUpdateDomainClientListUpdateDomainsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return CloudServicesUpdateDomainClientListUpdateDomainsResponse{}, runtime.NewResponseError(resp) - } - return client.listUpdateDomainsHandleResponse(resp) - }, - }) -} - -// listUpdateDomainsCreateRequest creates the ListUpdateDomains request. -func (client *CloudServicesUpdateDomainClient) listUpdateDomainsCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesUpdateDomainClientListUpdateDomainsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/updateDomains" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listUpdateDomainsHandleResponse handles the ListUpdateDomains response. -func (client *CloudServicesUpdateDomainClient) listUpdateDomainsHandleResponse(resp *http.Response) (CloudServicesUpdateDomainClientListUpdateDomainsResponse, error) { - result := CloudServicesUpdateDomainClientListUpdateDomainsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.UpdateDomainListResult); err != nil { - return CloudServicesUpdateDomainClientListUpdateDomainsResponse{}, err - } - return result, nil -} - -// BeginWalkUpdateDomain - Updates the role instances in the specified update domain. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-03-01 -// resourceGroupName - Name of the resource group. -// cloudServiceName - Name of the cloud service. -// updateDomain - Specifies an integer value that identifies the update domain. Update domains are identified with a zero-based -// index: the first update domain has an ID of 0, the second has an ID of 1, and so on. -// options - CloudServicesUpdateDomainClientBeginWalkUpdateDomainOptions contains the optional parameters for the CloudServicesUpdateDomainClient.BeginWalkUpdateDomain -// method. -func (client *CloudServicesUpdateDomainClient) BeginWalkUpdateDomain(ctx context.Context, resourceGroupName string, cloudServiceName string, updateDomain int32, options *CloudServicesUpdateDomainClientBeginWalkUpdateDomainOptions) (*runtime.Poller[CloudServicesUpdateDomainClientWalkUpdateDomainResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.walkUpdateDomain(ctx, resourceGroupName, cloudServiceName, updateDomain, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[CloudServicesUpdateDomainClientWalkUpdateDomainResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[CloudServicesUpdateDomainClientWalkUpdateDomainResponse](options.ResumeToken, client.pl, nil) - } -} - -// WalkUpdateDomain - Updates the role instances in the specified update domain. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-03-01 -func (client *CloudServicesUpdateDomainClient) walkUpdateDomain(ctx context.Context, resourceGroupName string, cloudServiceName string, updateDomain int32, options *CloudServicesUpdateDomainClientBeginWalkUpdateDomainOptions) (*http.Response, error) { - req, err := client.walkUpdateDomainCreateRequest(ctx, resourceGroupName, cloudServiceName, updateDomain, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// walkUpdateDomainCreateRequest creates the WalkUpdateDomain request. -func (client *CloudServicesUpdateDomainClient) walkUpdateDomainCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, updateDomain int32, options *CloudServicesUpdateDomainClientBeginWalkUpdateDomainOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/updateDomains/{updateDomain}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - urlPath = strings.ReplaceAll(urlPath, "{updateDomain}", url.PathEscape(strconv.FormatInt(int64(updateDomain), 10))) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.Parameters != nil { - return req, runtime.MarshalAsJSON(req, *options.Parameters) - } - return req, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_communitygalleries_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_communitygalleries_client.go deleted file mode 100644 index 0c45e908..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_communitygalleries_client.go +++ /dev/null @@ -1,112 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// CommunityGalleriesClient contains the methods for the CommunityGalleries group. -// Don't use this type directly, use NewCommunityGalleriesClient() instead. -type CommunityGalleriesClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewCommunityGalleriesClient creates a new instance of CommunityGalleriesClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewCommunityGalleriesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CommunityGalleriesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &CommunityGalleriesClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// Get - Get a community gallery by gallery public name. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-01 -// location - Resource location. -// publicGalleryName - The public name of the community gallery. -// options - CommunityGalleriesClientGetOptions contains the optional parameters for the CommunityGalleriesClient.Get method. -func (client *CommunityGalleriesClient) Get(ctx context.Context, location string, publicGalleryName string, options *CommunityGalleriesClientGetOptions) (CommunityGalleriesClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, location, publicGalleryName, options) - if err != nil { - return CommunityGalleriesClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return CommunityGalleriesClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return CommunityGalleriesClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *CommunityGalleriesClient) getCreateRequest(ctx context.Context, location string, publicGalleryName string, options *CommunityGalleriesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if publicGalleryName == "" { - return nil, errors.New("parameter publicGalleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{publicGalleryName}", url.PathEscape(publicGalleryName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *CommunityGalleriesClient) getHandleResponse(resp *http.Response) (CommunityGalleriesClientGetResponse, error) { - result := CommunityGalleriesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.CommunityGallery); err != nil { - return CommunityGalleriesClientGetResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_communitygalleryimages_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_communitygalleryimages_client.go deleted file mode 100644 index cffc731a..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_communitygalleryimages_client.go +++ /dev/null @@ -1,118 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// CommunityGalleryImagesClient contains the methods for the CommunityGalleryImages group. -// Don't use this type directly, use NewCommunityGalleryImagesClient() instead. -type CommunityGalleryImagesClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewCommunityGalleryImagesClient creates a new instance of CommunityGalleryImagesClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewCommunityGalleryImagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CommunityGalleryImagesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &CommunityGalleryImagesClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// Get - Get a community gallery image. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-01 -// location - Resource location. -// publicGalleryName - The public name of the community gallery. -// galleryImageName - The name of the community gallery image definition. -// options - CommunityGalleryImagesClientGetOptions contains the optional parameters for the CommunityGalleryImagesClient.Get -// method. -func (client *CommunityGalleryImagesClient) Get(ctx context.Context, location string, publicGalleryName string, galleryImageName string, options *CommunityGalleryImagesClientGetOptions) (CommunityGalleryImagesClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, location, publicGalleryName, galleryImageName, options) - if err != nil { - return CommunityGalleryImagesClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return CommunityGalleryImagesClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return CommunityGalleryImagesClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *CommunityGalleryImagesClient) getCreateRequest(ctx context.Context, location string, publicGalleryName string, galleryImageName string, options *CommunityGalleryImagesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}/images/{galleryImageName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if publicGalleryName == "" { - return nil, errors.New("parameter publicGalleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{publicGalleryName}", url.PathEscape(publicGalleryName)) - if galleryImageName == "" { - return nil, errors.New("parameter galleryImageName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryImageName}", url.PathEscape(galleryImageName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *CommunityGalleryImagesClient) getHandleResponse(resp *http.Response) (CommunityGalleryImagesClientGetResponse, error) { - result := CommunityGalleryImagesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.CommunityGalleryImage); err != nil { - return CommunityGalleryImagesClientGetResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_communitygalleryimageversions_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_communitygalleryimageversions_client.go deleted file mode 100644 index d4287c90..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_communitygalleryimageversions_client.go +++ /dev/null @@ -1,125 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// CommunityGalleryImageVersionsClient contains the methods for the CommunityGalleryImageVersions group. -// Don't use this type directly, use NewCommunityGalleryImageVersionsClient() instead. -type CommunityGalleryImageVersionsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewCommunityGalleryImageVersionsClient creates a new instance of CommunityGalleryImageVersionsClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewCommunityGalleryImageVersionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CommunityGalleryImageVersionsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &CommunityGalleryImageVersionsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// Get - Get a community gallery image version. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-01 -// location - Resource location. -// publicGalleryName - The public name of the community gallery. -// galleryImageName - The name of the community gallery image definition. -// galleryImageVersionName - The name of the community gallery image version. Needs to follow semantic version name pattern: -// The allowed characters are digit and period. Digits must be within the range of a 32-bit integer. -// Format: .. -// options - CommunityGalleryImageVersionsClientGetOptions contains the optional parameters for the CommunityGalleryImageVersionsClient.Get -// method. -func (client *CommunityGalleryImageVersionsClient) Get(ctx context.Context, location string, publicGalleryName string, galleryImageName string, galleryImageVersionName string, options *CommunityGalleryImageVersionsClientGetOptions) (CommunityGalleryImageVersionsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, location, publicGalleryName, galleryImageName, galleryImageVersionName, options) - if err != nil { - return CommunityGalleryImageVersionsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return CommunityGalleryImageVersionsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return CommunityGalleryImageVersionsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *CommunityGalleryImageVersionsClient) getCreateRequest(ctx context.Context, location string, publicGalleryName string, galleryImageName string, galleryImageVersionName string, options *CommunityGalleryImageVersionsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if publicGalleryName == "" { - return nil, errors.New("parameter publicGalleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{publicGalleryName}", url.PathEscape(publicGalleryName)) - if galleryImageName == "" { - return nil, errors.New("parameter galleryImageName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryImageName}", url.PathEscape(galleryImageName)) - if galleryImageVersionName == "" { - return nil, errors.New("parameter galleryImageVersionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryImageVersionName}", url.PathEscape(galleryImageVersionName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *CommunityGalleryImageVersionsClient) getHandleResponse(resp *http.Response) (CommunityGalleryImageVersionsClientGetResponse, error) { - result := CommunityGalleryImageVersionsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.CommunityGalleryImageVersion); err != nil { - return CommunityGalleryImageVersionsClientGetResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_constants.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_constants.go deleted file mode 100644 index 024379ab..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_constants.go +++ /dev/null @@ -1,2495 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -const ( - moduleName = "armcompute" - moduleVersion = "v1.0.0" -) - -type AccessLevel string - -const ( - AccessLevelNone AccessLevel = "None" - AccessLevelRead AccessLevel = "Read" - AccessLevelWrite AccessLevel = "Write" -) - -// PossibleAccessLevelValues returns the possible values for the AccessLevel const type. -func PossibleAccessLevelValues() []AccessLevel { - return []AccessLevel{ - AccessLevelNone, - AccessLevelRead, - AccessLevelWrite, - } -} - -// AggregatedReplicationState - This is the aggregated replication status based on all the regional replication status flags. -type AggregatedReplicationState string - -const ( - AggregatedReplicationStateCompleted AggregatedReplicationState = "Completed" - AggregatedReplicationStateFailed AggregatedReplicationState = "Failed" - AggregatedReplicationStateInProgress AggregatedReplicationState = "InProgress" - AggregatedReplicationStateUnknown AggregatedReplicationState = "Unknown" -) - -// PossibleAggregatedReplicationStateValues returns the possible values for the AggregatedReplicationState const type. -func PossibleAggregatedReplicationStateValues() []AggregatedReplicationState { - return []AggregatedReplicationState{ - AggregatedReplicationStateCompleted, - AggregatedReplicationStateFailed, - AggregatedReplicationStateInProgress, - AggregatedReplicationStateUnknown, - } -} - -// Architecture - The architecture of the image. Applicable to OS disks only. -type Architecture string - -const ( - ArchitectureArm64 Architecture = "Arm64" - ArchitectureX64 Architecture = "x64" -) - -// PossibleArchitectureValues returns the possible values for the Architecture const type. -func PossibleArchitectureValues() []Architecture { - return []Architecture{ - ArchitectureArm64, - ArchitectureX64, - } -} - -// ArchitectureTypes - Specifies the Architecture Type -type ArchitectureTypes string - -const ( - ArchitectureTypesArm64 ArchitectureTypes = "Arm64" - ArchitectureTypesX64 ArchitectureTypes = "x64" -) - -// PossibleArchitectureTypesValues returns the possible values for the ArchitectureTypes const type. -func PossibleArchitectureTypesValues() []ArchitectureTypes { - return []ArchitectureTypes{ - ArchitectureTypesArm64, - ArchitectureTypesX64, - } -} - -// AvailabilitySetSKUTypes - Specifies the sku of an Availability Set. Use 'Aligned' for virtual machines with managed disks -// and 'Classic' for virtual machines with unmanaged disks. Default value is 'Classic'. -type AvailabilitySetSKUTypes string - -const ( - AvailabilitySetSKUTypesAligned AvailabilitySetSKUTypes = "Aligned" - AvailabilitySetSKUTypesClassic AvailabilitySetSKUTypes = "Classic" -) - -// PossibleAvailabilitySetSKUTypesValues returns the possible values for the AvailabilitySetSKUTypes const type. -func PossibleAvailabilitySetSKUTypesValues() []AvailabilitySetSKUTypes { - return []AvailabilitySetSKUTypes{ - AvailabilitySetSKUTypesAligned, - AvailabilitySetSKUTypesClassic, - } -} - -// CachingTypes - Specifies the caching requirements. -// Possible values are: -// None -// ReadOnly -// ReadWrite -// Default: None for Standard storage. ReadOnly for Premium storage -type CachingTypes string - -const ( - CachingTypesNone CachingTypes = "None" - CachingTypesReadOnly CachingTypes = "ReadOnly" - CachingTypesReadWrite CachingTypes = "ReadWrite" -) - -// PossibleCachingTypesValues returns the possible values for the CachingTypes const type. -func PossibleCachingTypesValues() []CachingTypes { - return []CachingTypes{ - CachingTypesNone, - CachingTypesReadOnly, - CachingTypesReadWrite, - } -} - -type CapacityReservationGroupInstanceViewTypes string - -const ( - CapacityReservationGroupInstanceViewTypesInstanceView CapacityReservationGroupInstanceViewTypes = "instanceView" -) - -// PossibleCapacityReservationGroupInstanceViewTypesValues returns the possible values for the CapacityReservationGroupInstanceViewTypes const type. -func PossibleCapacityReservationGroupInstanceViewTypesValues() []CapacityReservationGroupInstanceViewTypes { - return []CapacityReservationGroupInstanceViewTypes{ - CapacityReservationGroupInstanceViewTypesInstanceView, - } -} - -type CapacityReservationInstanceViewTypes string - -const ( - CapacityReservationInstanceViewTypesInstanceView CapacityReservationInstanceViewTypes = "instanceView" -) - -// PossibleCapacityReservationInstanceViewTypesValues returns the possible values for the CapacityReservationInstanceViewTypes const type. -func PossibleCapacityReservationInstanceViewTypesValues() []CapacityReservationInstanceViewTypes { - return []CapacityReservationInstanceViewTypes{ - CapacityReservationInstanceViewTypesInstanceView, - } -} - -// CloudServiceUpgradeMode - Update mode for the cloud service. Role instances are allocated to update domains when the service -// is deployed. Updates can be initiated manually in each update domain or initiated automatically in -// all update domains. Possible Values are -// Auto -// Manual -// Simultaneous -// If not specified, the default value is Auto. If set to Manual, PUT UpdateDomain must be called to apply the update. If -// set to Auto, the update is automatically applied to each update domain in -// sequence. -type CloudServiceUpgradeMode string - -const ( - CloudServiceUpgradeModeAuto CloudServiceUpgradeMode = "Auto" - CloudServiceUpgradeModeManual CloudServiceUpgradeMode = "Manual" - CloudServiceUpgradeModeSimultaneous CloudServiceUpgradeMode = "Simultaneous" -) - -// PossibleCloudServiceUpgradeModeValues returns the possible values for the CloudServiceUpgradeMode const type. -func PossibleCloudServiceUpgradeModeValues() []CloudServiceUpgradeMode { - return []CloudServiceUpgradeMode{ - CloudServiceUpgradeModeAuto, - CloudServiceUpgradeModeManual, - CloudServiceUpgradeModeSimultaneous, - } -} - -// ConfidentialVMEncryptionType - confidential VM encryption types -type ConfidentialVMEncryptionType string - -const ( - ConfidentialVMEncryptionTypeEncryptedVMGuestStateOnlyWithPmk ConfidentialVMEncryptionType = "EncryptedVMGuestStateOnlyWithPmk" - ConfidentialVMEncryptionTypeEncryptedWithCmk ConfidentialVMEncryptionType = "EncryptedWithCmk" - ConfidentialVMEncryptionTypeEncryptedWithPmk ConfidentialVMEncryptionType = "EncryptedWithPmk" -) - -// PossibleConfidentialVMEncryptionTypeValues returns the possible values for the ConfidentialVMEncryptionType const type. -func PossibleConfidentialVMEncryptionTypeValues() []ConfidentialVMEncryptionType { - return []ConfidentialVMEncryptionType{ - ConfidentialVMEncryptionTypeEncryptedVMGuestStateOnlyWithPmk, - ConfidentialVMEncryptionTypeEncryptedWithCmk, - ConfidentialVMEncryptionTypeEncryptedWithPmk, - } -} - -// ConsistencyModeTypes - ConsistencyMode of the RestorePoint. Can be specified in the input while creating a restore point. -// For now, only CrashConsistent is accepted as a valid input. Please refer to -// https://aka.ms/RestorePoints for more details. -type ConsistencyModeTypes string - -const ( - ConsistencyModeTypesApplicationConsistent ConsistencyModeTypes = "ApplicationConsistent" - ConsistencyModeTypesCrashConsistent ConsistencyModeTypes = "CrashConsistent" - ConsistencyModeTypesFileSystemConsistent ConsistencyModeTypes = "FileSystemConsistent" -) - -// PossibleConsistencyModeTypesValues returns the possible values for the ConsistencyModeTypes const type. -func PossibleConsistencyModeTypesValues() []ConsistencyModeTypes { - return []ConsistencyModeTypes{ - ConsistencyModeTypesApplicationConsistent, - ConsistencyModeTypesCrashConsistent, - ConsistencyModeTypesFileSystemConsistent, - } -} - -// DataAccessAuthMode - Additional authentication requirements when exporting or uploading to a disk or snapshot. -type DataAccessAuthMode string - -const ( - // DataAccessAuthModeAzureActiveDirectory - When export/upload URL is used, the system checks if the user has an identity - // in Azure Active Directory and has necessary permissions to export/upload the data. Please refer to aka.ms/DisksAzureADAuth. - DataAccessAuthModeAzureActiveDirectory DataAccessAuthMode = "AzureActiveDirectory" - // DataAccessAuthModeNone - No additional authentication would be performed when accessing export/upload URL. - DataAccessAuthModeNone DataAccessAuthMode = "None" -) - -// PossibleDataAccessAuthModeValues returns the possible values for the DataAccessAuthMode const type. -func PossibleDataAccessAuthModeValues() []DataAccessAuthMode { - return []DataAccessAuthMode{ - DataAccessAuthModeAzureActiveDirectory, - DataAccessAuthModeNone, - } -} - -// DedicatedHostLicenseTypes - Specifies the software license type that will be applied to the VMs deployed on the dedicated -// host. -// Possible values are: -// None -// WindowsServerHybrid -// WindowsServerPerpetual -// Default: None -type DedicatedHostLicenseTypes string - -const ( - DedicatedHostLicenseTypesNone DedicatedHostLicenseTypes = "None" - DedicatedHostLicenseTypesWindowsServerHybrid DedicatedHostLicenseTypes = "Windows_Server_Hybrid" - DedicatedHostLicenseTypesWindowsServerPerpetual DedicatedHostLicenseTypes = "Windows_Server_Perpetual" -) - -// PossibleDedicatedHostLicenseTypesValues returns the possible values for the DedicatedHostLicenseTypes const type. -func PossibleDedicatedHostLicenseTypesValues() []DedicatedHostLicenseTypes { - return []DedicatedHostLicenseTypes{ - DedicatedHostLicenseTypesNone, - DedicatedHostLicenseTypesWindowsServerHybrid, - DedicatedHostLicenseTypesWindowsServerPerpetual, - } -} - -// DeleteOptions - Specify what happens to the network interface when the VM is deleted -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -// PossibleDeleteOptionsValues returns the possible values for the DeleteOptions const type. -func PossibleDeleteOptionsValues() []DeleteOptions { - return []DeleteOptions{ - DeleteOptionsDelete, - DeleteOptionsDetach, - } -} - -// DiffDiskOptions - Specifies the ephemeral disk option for operating system disk. -type DiffDiskOptions string - -const ( - DiffDiskOptionsLocal DiffDiskOptions = "Local" -) - -// PossibleDiffDiskOptionsValues returns the possible values for the DiffDiskOptions const type. -func PossibleDiffDiskOptionsValues() []DiffDiskOptions { - return []DiffDiskOptions{ - DiffDiskOptionsLocal, - } -} - -// DiffDiskPlacement - Specifies the ephemeral disk placement for operating system disk. This property can be used by user -// in the request to choose the location i.e, cache disk or resource disk space for Ephemeral OS disk -// provisioning. For more information on Ephemeral OS disk size requirements, please refer Ephemeral OS disk size requirements -// for Windows VM at -// https://docs.microsoft.com/azure/virtual-machines/windows/ephemeral-os-disks#size-requirements and Linux VM at -// https://docs.microsoft.com/azure/virtual-machines/linux/ephemeral-os-disks#size-requirements -type DiffDiskPlacement string - -const ( - DiffDiskPlacementCacheDisk DiffDiskPlacement = "CacheDisk" - DiffDiskPlacementResourceDisk DiffDiskPlacement = "ResourceDisk" -) - -// PossibleDiffDiskPlacementValues returns the possible values for the DiffDiskPlacement const type. -func PossibleDiffDiskPlacementValues() []DiffDiskPlacement { - return []DiffDiskPlacement{ - DiffDiskPlacementCacheDisk, - DiffDiskPlacementResourceDisk, - } -} - -// DiskCreateOption - This enumerates the possible sources of a disk's creation. -type DiskCreateOption string - -const ( - // DiskCreateOptionAttach - Disk will be attached to a VM. - DiskCreateOptionAttach DiskCreateOption = "Attach" - // DiskCreateOptionCopy - Create a new disk or snapshot by copying from a disk or snapshot specified by the given sourceResourceId. - DiskCreateOptionCopy DiskCreateOption = "Copy" - // DiskCreateOptionCopyStart - Create a new disk by using a deep copy process, where the resource creation is considered complete - // only after all data has been copied from the source. - DiskCreateOptionCopyStart DiskCreateOption = "CopyStart" - // DiskCreateOptionEmpty - Create an empty data disk of a size given by diskSizeGB. - DiskCreateOptionEmpty DiskCreateOption = "Empty" - // DiskCreateOptionFromImage - Create a new disk from a platform image specified by the given imageReference or galleryImageReference. - DiskCreateOptionFromImage DiskCreateOption = "FromImage" - // DiskCreateOptionImport - Create a disk by importing from a blob specified by a sourceUri in a storage account specified - // by storageAccountId. - DiskCreateOptionImport DiskCreateOption = "Import" - // DiskCreateOptionImportSecure - Similar to Import create option. Create a new Trusted Launch VM or Confidential VM supported - // disk by importing additional blob for VM guest state specified by securityDataUri in storage account specified by storageAccountId - DiskCreateOptionImportSecure DiskCreateOption = "ImportSecure" - // DiskCreateOptionRestore - Create a new disk by copying from a backup recovery point. - DiskCreateOptionRestore DiskCreateOption = "Restore" - // DiskCreateOptionUpload - Create a new disk by obtaining a write token and using it to directly upload the contents of the - // disk. - DiskCreateOptionUpload DiskCreateOption = "Upload" - // DiskCreateOptionUploadPreparedSecure - Similar to Upload create option. Create a new Trusted Launch VM or Confidential - // VM supported disk and upload using write token in both disk and VM guest state - DiskCreateOptionUploadPreparedSecure DiskCreateOption = "UploadPreparedSecure" -) - -// PossibleDiskCreateOptionValues returns the possible values for the DiskCreateOption const type. -func PossibleDiskCreateOptionValues() []DiskCreateOption { - return []DiskCreateOption{ - DiskCreateOptionAttach, - DiskCreateOptionCopy, - DiskCreateOptionCopyStart, - DiskCreateOptionEmpty, - DiskCreateOptionFromImage, - DiskCreateOptionImport, - DiskCreateOptionImportSecure, - DiskCreateOptionRestore, - DiskCreateOptionUpload, - DiskCreateOptionUploadPreparedSecure, - } -} - -// DiskCreateOptionTypes - Specifies how the virtual machine should be created. -// Possible values are: -// Attach \u2013 This value is used when you are using a specialized disk to create the virtual machine. -// FromImage \u2013 This value is used when you are using an image to create the virtual machine. If you are using a platform -// image, you also use the imageReference element described above. If you are -// using a marketplace image, you also use the plan element previously described. -type DiskCreateOptionTypes string - -const ( - DiskCreateOptionTypesAttach DiskCreateOptionTypes = "Attach" - DiskCreateOptionTypesEmpty DiskCreateOptionTypes = "Empty" - DiskCreateOptionTypesFromImage DiskCreateOptionTypes = "FromImage" -) - -// PossibleDiskCreateOptionTypesValues returns the possible values for the DiskCreateOptionTypes const type. -func PossibleDiskCreateOptionTypesValues() []DiskCreateOptionTypes { - return []DiskCreateOptionTypes{ - DiskCreateOptionTypesAttach, - DiskCreateOptionTypesEmpty, - DiskCreateOptionTypesFromImage, - } -} - -// DiskDeleteOptionTypes - Specifies the behavior of the managed disk when the VM gets deleted i.e whether the managed disk -// is deleted or detached. Supported values: -// Delete If this value is used, the managed disk is deleted when VM gets deleted. -// Detach If this value is used, the managed disk is retained after VM gets deleted. -// Minimum api-version: 2021-03-01 -type DiskDeleteOptionTypes string - -const ( - DiskDeleteOptionTypesDelete DiskDeleteOptionTypes = "Delete" - DiskDeleteOptionTypesDetach DiskDeleteOptionTypes = "Detach" -) - -// PossibleDiskDeleteOptionTypesValues returns the possible values for the DiskDeleteOptionTypes const type. -func PossibleDiskDeleteOptionTypesValues() []DiskDeleteOptionTypes { - return []DiskDeleteOptionTypes{ - DiskDeleteOptionTypesDelete, - DiskDeleteOptionTypesDetach, - } -} - -// DiskDetachOptionTypes - Specifies the detach behavior to be used while detaching a disk or which is already in the process -// of detachment from the virtual machine. Supported values: ForceDetach. -// detachOption: ForceDetach is applicable only for managed data disks. If a previous detachment attempt of the data disk -// did not complete due to an unexpected failure from the virtual machine and the -// disk is still not released then use force-detach as a last resort option to detach the disk forcibly from the VM. All writes -// might not have been flushed when using this detach behavior. -// This feature is still in preview mode and is not supported for VirtualMachineScaleSet. To force-detach a data disk update -// toBeDetached to 'true' along with setting detachOption: 'ForceDetach'. -type DiskDetachOptionTypes string - -const ( - DiskDetachOptionTypesForceDetach DiskDetachOptionTypes = "ForceDetach" -) - -// PossibleDiskDetachOptionTypesValues returns the possible values for the DiskDetachOptionTypes const type. -func PossibleDiskDetachOptionTypesValues() []DiskDetachOptionTypes { - return []DiskDetachOptionTypes{ - DiskDetachOptionTypesForceDetach, - } -} - -// DiskEncryptionSetIdentityType - The type of Managed Identity used by the DiskEncryptionSet. Only SystemAssigned is supported -// for new creations. Disk Encryption Sets can be updated with Identity type None during migration of -// subscription to a new Azure Active Directory tenant; it will cause the encrypted resources to lose access to the keys. -type DiskEncryptionSetIdentityType string - -const ( - DiskEncryptionSetIdentityTypeNone DiskEncryptionSetIdentityType = "None" - DiskEncryptionSetIdentityTypeSystemAssigned DiskEncryptionSetIdentityType = "SystemAssigned" -) - -// PossibleDiskEncryptionSetIdentityTypeValues returns the possible values for the DiskEncryptionSetIdentityType const type. -func PossibleDiskEncryptionSetIdentityTypeValues() []DiskEncryptionSetIdentityType { - return []DiskEncryptionSetIdentityType{ - DiskEncryptionSetIdentityTypeNone, - DiskEncryptionSetIdentityTypeSystemAssigned, - } -} - -// DiskEncryptionSetType - The type of key used to encrypt the data of the disk. -type DiskEncryptionSetType string - -const ( - // DiskEncryptionSetTypeConfidentialVMEncryptedWithCustomerKey - Confidential VM supported disk and VM guest state would be - // encrypted with customer managed key. - DiskEncryptionSetTypeConfidentialVMEncryptedWithCustomerKey DiskEncryptionSetType = "ConfidentialVmEncryptedWithCustomerKey" - // DiskEncryptionSetTypeEncryptionAtRestWithCustomerKey - Resource using diskEncryptionSet would be encrypted at rest with - // Customer managed key that can be changed and revoked by a customer. - DiskEncryptionSetTypeEncryptionAtRestWithCustomerKey DiskEncryptionSetType = "EncryptionAtRestWithCustomerKey" - // DiskEncryptionSetTypeEncryptionAtRestWithPlatformAndCustomerKeys - Resource using diskEncryptionSet would be encrypted - // at rest with two layers of encryption. One of the keys is Customer managed and the other key is Platform managed. - DiskEncryptionSetTypeEncryptionAtRestWithPlatformAndCustomerKeys DiskEncryptionSetType = "EncryptionAtRestWithPlatformAndCustomerKeys" -) - -// PossibleDiskEncryptionSetTypeValues returns the possible values for the DiskEncryptionSetType const type. -func PossibleDiskEncryptionSetTypeValues() []DiskEncryptionSetType { - return []DiskEncryptionSetType{ - DiskEncryptionSetTypeConfidentialVMEncryptedWithCustomerKey, - DiskEncryptionSetTypeEncryptionAtRestWithCustomerKey, - DiskEncryptionSetTypeEncryptionAtRestWithPlatformAndCustomerKeys, - } -} - -// DiskSecurityTypes - Specifies the SecurityType of the VM. Applicable for OS disks only. -type DiskSecurityTypes string - -const ( - // DiskSecurityTypesConfidentialVMDiskEncryptedWithCustomerKey - Indicates Confidential VM disk with both OS disk and VM guest - // state encrypted with a customer managed key - DiskSecurityTypesConfidentialVMDiskEncryptedWithCustomerKey DiskSecurityTypes = "ConfidentialVM_DiskEncryptedWithCustomerKey" - // DiskSecurityTypesConfidentialVMDiskEncryptedWithPlatformKey - Indicates Confidential VM disk with both OS disk and VM guest - // state encrypted with a platform managed key - DiskSecurityTypesConfidentialVMDiskEncryptedWithPlatformKey DiskSecurityTypes = "ConfidentialVM_DiskEncryptedWithPlatformKey" - // DiskSecurityTypesConfidentialVMVmguestStateOnlyEncryptedWithPlatformKey - Indicates Confidential VM disk with only VM guest - // state encrypted - DiskSecurityTypesConfidentialVMVmguestStateOnlyEncryptedWithPlatformKey DiskSecurityTypes = "ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey" - // DiskSecurityTypesTrustedLaunch - Trusted Launch provides security features such as secure boot and virtual Trusted Platform - // Module (vTPM) - DiskSecurityTypesTrustedLaunch DiskSecurityTypes = "TrustedLaunch" -) - -// PossibleDiskSecurityTypesValues returns the possible values for the DiskSecurityTypes const type. -func PossibleDiskSecurityTypesValues() []DiskSecurityTypes { - return []DiskSecurityTypes{ - DiskSecurityTypesConfidentialVMDiskEncryptedWithCustomerKey, - DiskSecurityTypesConfidentialVMDiskEncryptedWithPlatformKey, - DiskSecurityTypesConfidentialVMVmguestStateOnlyEncryptedWithPlatformKey, - DiskSecurityTypesTrustedLaunch, - } -} - -// DiskState - This enumerates the possible state of the disk. -type DiskState string - -const ( - // DiskStateActiveSAS - The disk currently has an Active SAS Uri associated with it. - DiskStateActiveSAS DiskState = "ActiveSAS" - // DiskStateActiveSASFrozen - The disk is attached to a VM in hibernated state and has an active SAS URI associated with it. - DiskStateActiveSASFrozen DiskState = "ActiveSASFrozen" - // DiskStateActiveUpload - A disk is created for upload and a write token has been issued for uploading to it. - DiskStateActiveUpload DiskState = "ActiveUpload" - // DiskStateAttached - The disk is currently attached to a running VM. - DiskStateAttached DiskState = "Attached" - // DiskStateFrozen - The disk is attached to a VM which is in hibernated state. - DiskStateFrozen DiskState = "Frozen" - // DiskStateReadyToUpload - A disk is ready to be created by upload by requesting a write token. - DiskStateReadyToUpload DiskState = "ReadyToUpload" - // DiskStateReserved - The disk is attached to a stopped-deallocated VM. - DiskStateReserved DiskState = "Reserved" - // DiskStateUnattached - The disk is not being used and can be attached to a VM. - DiskStateUnattached DiskState = "Unattached" -) - -// PossibleDiskStateValues returns the possible values for the DiskState const type. -func PossibleDiskStateValues() []DiskState { - return []DiskState{ - DiskStateActiveSAS, - DiskStateActiveSASFrozen, - DiskStateActiveUpload, - DiskStateAttached, - DiskStateFrozen, - DiskStateReadyToUpload, - DiskStateReserved, - DiskStateUnattached, - } -} - -// DiskStorageAccountTypes - The sku name. -type DiskStorageAccountTypes string - -const ( - // DiskStorageAccountTypesPremiumLRS - Premium SSD locally redundant storage. Best for production and performance sensitive - // workloads. - DiskStorageAccountTypesPremiumLRS DiskStorageAccountTypes = "Premium_LRS" - // DiskStorageAccountTypesPremiumZRS - Premium SSD zone redundant storage. Best for the production workloads that need storage - // resiliency against zone failures. - DiskStorageAccountTypesPremiumZRS DiskStorageAccountTypes = "Premium_ZRS" - // DiskStorageAccountTypesStandardLRS - Standard HDD locally redundant storage. Best for backup, non-critical, and infrequent - // access. - DiskStorageAccountTypesStandardLRS DiskStorageAccountTypes = "Standard_LRS" - // DiskStorageAccountTypesStandardSSDLRS - Standard SSD locally redundant storage. Best for web servers, lightly used enterprise - // applications and dev/test. - DiskStorageAccountTypesStandardSSDLRS DiskStorageAccountTypes = "StandardSSD_LRS" - // DiskStorageAccountTypesStandardSSDZRS - Standard SSD zone redundant storage. Best for web servers, lightly used enterprise - // applications and dev/test that need storage resiliency against zone failures. - DiskStorageAccountTypesStandardSSDZRS DiskStorageAccountTypes = "StandardSSD_ZRS" - // DiskStorageAccountTypesUltraSSDLRS - Ultra SSD locally redundant storage. Best for IO-intensive workloads such as SAP HANA, - // top tier databases (for example, SQL, Oracle), and other transaction-heavy workloads. - DiskStorageAccountTypesUltraSSDLRS DiskStorageAccountTypes = "UltraSSD_LRS" -) - -// PossibleDiskStorageAccountTypesValues returns the possible values for the DiskStorageAccountTypes const type. -func PossibleDiskStorageAccountTypesValues() []DiskStorageAccountTypes { - return []DiskStorageAccountTypes{ - DiskStorageAccountTypesPremiumLRS, - DiskStorageAccountTypesPremiumZRS, - DiskStorageAccountTypesStandardLRS, - DiskStorageAccountTypesStandardSSDLRS, - DiskStorageAccountTypesStandardSSDZRS, - DiskStorageAccountTypesUltraSSDLRS, - } -} - -// EncryptionType - The type of key used to encrypt the data of the disk. -type EncryptionType string - -const ( - // EncryptionTypeEncryptionAtRestWithCustomerKey - Disk is encrypted at rest with Customer managed key that can be changed - // and revoked by a customer. - EncryptionTypeEncryptionAtRestWithCustomerKey EncryptionType = "EncryptionAtRestWithCustomerKey" - // EncryptionTypeEncryptionAtRestWithPlatformAndCustomerKeys - Disk is encrypted at rest with 2 layers of encryption. One - // of the keys is Customer managed and the other key is Platform managed. - EncryptionTypeEncryptionAtRestWithPlatformAndCustomerKeys EncryptionType = "EncryptionAtRestWithPlatformAndCustomerKeys" - // EncryptionTypeEncryptionAtRestWithPlatformKey - Disk is encrypted at rest with Platform managed key. It is the default - // encryption type. This is not a valid encryption type for disk encryption sets. - EncryptionTypeEncryptionAtRestWithPlatformKey EncryptionType = "EncryptionAtRestWithPlatformKey" -) - -// PossibleEncryptionTypeValues returns the possible values for the EncryptionType const type. -func PossibleEncryptionTypeValues() []EncryptionType { - return []EncryptionType{ - EncryptionTypeEncryptionAtRestWithCustomerKey, - EncryptionTypeEncryptionAtRestWithPlatformAndCustomerKeys, - EncryptionTypeEncryptionAtRestWithPlatformKey, - } -} - -// ExecutionState - Script execution status. -type ExecutionState string - -const ( - ExecutionStateCanceled ExecutionState = "Canceled" - ExecutionStateFailed ExecutionState = "Failed" - ExecutionStatePending ExecutionState = "Pending" - ExecutionStateRunning ExecutionState = "Running" - ExecutionStateSucceeded ExecutionState = "Succeeded" - ExecutionStateTimedOut ExecutionState = "TimedOut" - ExecutionStateUnknown ExecutionState = "Unknown" -) - -// PossibleExecutionStateValues returns the possible values for the ExecutionState const type. -func PossibleExecutionStateValues() []ExecutionState { - return []ExecutionState{ - ExecutionStateCanceled, - ExecutionStateFailed, - ExecutionStatePending, - ExecutionStateRunning, - ExecutionStateSucceeded, - ExecutionStateTimedOut, - ExecutionStateUnknown, - } -} - -type ExpandTypesForGetCapacityReservationGroups string - -const ( - ExpandTypesForGetCapacityReservationGroupsVirtualMachineScaleSetVMsRef ExpandTypesForGetCapacityReservationGroups = "virtualMachineScaleSetVMs/$ref" - ExpandTypesForGetCapacityReservationGroupsVirtualMachinesRef ExpandTypesForGetCapacityReservationGroups = "virtualMachines/$ref" -) - -// PossibleExpandTypesForGetCapacityReservationGroupsValues returns the possible values for the ExpandTypesForGetCapacityReservationGroups const type. -func PossibleExpandTypesForGetCapacityReservationGroupsValues() []ExpandTypesForGetCapacityReservationGroups { - return []ExpandTypesForGetCapacityReservationGroups{ - ExpandTypesForGetCapacityReservationGroupsVirtualMachineScaleSetVMsRef, - ExpandTypesForGetCapacityReservationGroupsVirtualMachinesRef, - } -} - -type ExpandTypesForGetVMScaleSets string - -const ( - ExpandTypesForGetVMScaleSetsUserData ExpandTypesForGetVMScaleSets = "userData" -) - -// PossibleExpandTypesForGetVMScaleSetsValues returns the possible values for the ExpandTypesForGetVMScaleSets const type. -func PossibleExpandTypesForGetVMScaleSetsValues() []ExpandTypesForGetVMScaleSets { - return []ExpandTypesForGetVMScaleSets{ - ExpandTypesForGetVMScaleSetsUserData, - } -} - -// ExtendedLocationType - The type of the extended location. -type ExtendedLocationType string - -const ( - ExtendedLocationTypeEdgeZone ExtendedLocationType = "EdgeZone" -) - -// PossibleExtendedLocationTypeValues returns the possible values for the ExtendedLocationType const type. -func PossibleExtendedLocationTypeValues() []ExtendedLocationType { - return []ExtendedLocationType{ - ExtendedLocationTypeEdgeZone, - } -} - -// ExtendedLocationTypes - The type of extendedLocation. -type ExtendedLocationTypes string - -const ( - ExtendedLocationTypesEdgeZone ExtendedLocationTypes = "EdgeZone" -) - -// PossibleExtendedLocationTypesValues returns the possible values for the ExtendedLocationTypes const type. -func PossibleExtendedLocationTypesValues() []ExtendedLocationTypes { - return []ExtendedLocationTypes{ - ExtendedLocationTypesEdgeZone, - } -} - -// GalleryApplicationVersionPropertiesProvisioningState - The provisioning state, which only appears in the response. -type GalleryApplicationVersionPropertiesProvisioningState string - -const ( - GalleryApplicationVersionPropertiesProvisioningStateCreating GalleryApplicationVersionPropertiesProvisioningState = "Creating" - GalleryApplicationVersionPropertiesProvisioningStateDeleting GalleryApplicationVersionPropertiesProvisioningState = "Deleting" - GalleryApplicationVersionPropertiesProvisioningStateFailed GalleryApplicationVersionPropertiesProvisioningState = "Failed" - GalleryApplicationVersionPropertiesProvisioningStateMigrating GalleryApplicationVersionPropertiesProvisioningState = "Migrating" - GalleryApplicationVersionPropertiesProvisioningStateSucceeded GalleryApplicationVersionPropertiesProvisioningState = "Succeeded" - GalleryApplicationVersionPropertiesProvisioningStateUpdating GalleryApplicationVersionPropertiesProvisioningState = "Updating" -) - -// PossibleGalleryApplicationVersionPropertiesProvisioningStateValues returns the possible values for the GalleryApplicationVersionPropertiesProvisioningState const type. -func PossibleGalleryApplicationVersionPropertiesProvisioningStateValues() []GalleryApplicationVersionPropertiesProvisioningState { - return []GalleryApplicationVersionPropertiesProvisioningState{ - GalleryApplicationVersionPropertiesProvisioningStateCreating, - GalleryApplicationVersionPropertiesProvisioningStateDeleting, - GalleryApplicationVersionPropertiesProvisioningStateFailed, - GalleryApplicationVersionPropertiesProvisioningStateMigrating, - GalleryApplicationVersionPropertiesProvisioningStateSucceeded, - GalleryApplicationVersionPropertiesProvisioningStateUpdating, - } -} - -type GalleryExpandParams string - -const ( - GalleryExpandParamsSharingProfileGroups GalleryExpandParams = "SharingProfile/Groups" -) - -// PossibleGalleryExpandParamsValues returns the possible values for the GalleryExpandParams const type. -func PossibleGalleryExpandParamsValues() []GalleryExpandParams { - return []GalleryExpandParams{ - GalleryExpandParamsSharingProfileGroups, - } -} - -// GalleryExtendedLocationType - It is type of the extended location. -type GalleryExtendedLocationType string - -const ( - GalleryExtendedLocationTypeEdgeZone GalleryExtendedLocationType = "EdgeZone" - GalleryExtendedLocationTypeUnknown GalleryExtendedLocationType = "Unknown" -) - -// PossibleGalleryExtendedLocationTypeValues returns the possible values for the GalleryExtendedLocationType const type. -func PossibleGalleryExtendedLocationTypeValues() []GalleryExtendedLocationType { - return []GalleryExtendedLocationType{ - GalleryExtendedLocationTypeEdgeZone, - GalleryExtendedLocationTypeUnknown, - } -} - -// GalleryImagePropertiesProvisioningState - The provisioning state, which only appears in the response. -type GalleryImagePropertiesProvisioningState string - -const ( - GalleryImagePropertiesProvisioningStateCreating GalleryImagePropertiesProvisioningState = "Creating" - GalleryImagePropertiesProvisioningStateDeleting GalleryImagePropertiesProvisioningState = "Deleting" - GalleryImagePropertiesProvisioningStateFailed GalleryImagePropertiesProvisioningState = "Failed" - GalleryImagePropertiesProvisioningStateMigrating GalleryImagePropertiesProvisioningState = "Migrating" - GalleryImagePropertiesProvisioningStateSucceeded GalleryImagePropertiesProvisioningState = "Succeeded" - GalleryImagePropertiesProvisioningStateUpdating GalleryImagePropertiesProvisioningState = "Updating" -) - -// PossibleGalleryImagePropertiesProvisioningStateValues returns the possible values for the GalleryImagePropertiesProvisioningState const type. -func PossibleGalleryImagePropertiesProvisioningStateValues() []GalleryImagePropertiesProvisioningState { - return []GalleryImagePropertiesProvisioningState{ - GalleryImagePropertiesProvisioningStateCreating, - GalleryImagePropertiesProvisioningStateDeleting, - GalleryImagePropertiesProvisioningStateFailed, - GalleryImagePropertiesProvisioningStateMigrating, - GalleryImagePropertiesProvisioningStateSucceeded, - GalleryImagePropertiesProvisioningStateUpdating, - } -} - -// GalleryImageVersionPropertiesProvisioningState - The provisioning state, which only appears in the response. -type GalleryImageVersionPropertiesProvisioningState string - -const ( - GalleryImageVersionPropertiesProvisioningStateCreating GalleryImageVersionPropertiesProvisioningState = "Creating" - GalleryImageVersionPropertiesProvisioningStateDeleting GalleryImageVersionPropertiesProvisioningState = "Deleting" - GalleryImageVersionPropertiesProvisioningStateFailed GalleryImageVersionPropertiesProvisioningState = "Failed" - GalleryImageVersionPropertiesProvisioningStateMigrating GalleryImageVersionPropertiesProvisioningState = "Migrating" - GalleryImageVersionPropertiesProvisioningStateSucceeded GalleryImageVersionPropertiesProvisioningState = "Succeeded" - GalleryImageVersionPropertiesProvisioningStateUpdating GalleryImageVersionPropertiesProvisioningState = "Updating" -) - -// PossibleGalleryImageVersionPropertiesProvisioningStateValues returns the possible values for the GalleryImageVersionPropertiesProvisioningState const type. -func PossibleGalleryImageVersionPropertiesProvisioningStateValues() []GalleryImageVersionPropertiesProvisioningState { - return []GalleryImageVersionPropertiesProvisioningState{ - GalleryImageVersionPropertiesProvisioningStateCreating, - GalleryImageVersionPropertiesProvisioningStateDeleting, - GalleryImageVersionPropertiesProvisioningStateFailed, - GalleryImageVersionPropertiesProvisioningStateMigrating, - GalleryImageVersionPropertiesProvisioningStateSucceeded, - GalleryImageVersionPropertiesProvisioningStateUpdating, - } -} - -// GalleryPropertiesProvisioningState - The provisioning state, which only appears in the response. -type GalleryPropertiesProvisioningState string - -const ( - GalleryPropertiesProvisioningStateCreating GalleryPropertiesProvisioningState = "Creating" - GalleryPropertiesProvisioningStateDeleting GalleryPropertiesProvisioningState = "Deleting" - GalleryPropertiesProvisioningStateFailed GalleryPropertiesProvisioningState = "Failed" - GalleryPropertiesProvisioningStateMigrating GalleryPropertiesProvisioningState = "Migrating" - GalleryPropertiesProvisioningStateSucceeded GalleryPropertiesProvisioningState = "Succeeded" - GalleryPropertiesProvisioningStateUpdating GalleryPropertiesProvisioningState = "Updating" -) - -// PossibleGalleryPropertiesProvisioningStateValues returns the possible values for the GalleryPropertiesProvisioningState const type. -func PossibleGalleryPropertiesProvisioningStateValues() []GalleryPropertiesProvisioningState { - return []GalleryPropertiesProvisioningState{ - GalleryPropertiesProvisioningStateCreating, - GalleryPropertiesProvisioningStateDeleting, - GalleryPropertiesProvisioningStateFailed, - GalleryPropertiesProvisioningStateMigrating, - GalleryPropertiesProvisioningStateSucceeded, - GalleryPropertiesProvisioningStateUpdating, - } -} - -// GallerySharingPermissionTypes - This property allows you to specify the permission of sharing gallery. -// Possible values are: -// Private -// Groups -type GallerySharingPermissionTypes string - -const ( - GallerySharingPermissionTypesGroups GallerySharingPermissionTypes = "Groups" - GallerySharingPermissionTypesPrivate GallerySharingPermissionTypes = "Private" -) - -// PossibleGallerySharingPermissionTypesValues returns the possible values for the GallerySharingPermissionTypes const type. -func PossibleGallerySharingPermissionTypesValues() []GallerySharingPermissionTypes { - return []GallerySharingPermissionTypes{ - GallerySharingPermissionTypesGroups, - GallerySharingPermissionTypesPrivate, - } -} - -// HostCaching - The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite' -type HostCaching string - -const ( - HostCachingNone HostCaching = "None" - HostCachingReadOnly HostCaching = "ReadOnly" - HostCachingReadWrite HostCaching = "ReadWrite" -) - -// PossibleHostCachingValues returns the possible values for the HostCaching const type. -func PossibleHostCachingValues() []HostCaching { - return []HostCaching{ - HostCachingNone, - HostCachingReadOnly, - HostCachingReadWrite, - } -} - -// HyperVGeneration - The hypervisor generation of the Virtual Machine. Applicable to OS disks only. -type HyperVGeneration string - -const ( - HyperVGenerationV1 HyperVGeneration = "V1" - HyperVGenerationV2 HyperVGeneration = "V2" -) - -// PossibleHyperVGenerationValues returns the possible values for the HyperVGeneration const type. -func PossibleHyperVGenerationValues() []HyperVGeneration { - return []HyperVGeneration{ - HyperVGenerationV1, - HyperVGenerationV2, - } -} - -// HyperVGenerationType - Specifies the HyperVGeneration Type associated with a resource -type HyperVGenerationType string - -const ( - HyperVGenerationTypeV1 HyperVGenerationType = "V1" - HyperVGenerationTypeV2 HyperVGenerationType = "V2" -) - -// PossibleHyperVGenerationTypeValues returns the possible values for the HyperVGenerationType const type. -func PossibleHyperVGenerationTypeValues() []HyperVGenerationType { - return []HyperVGenerationType{ - HyperVGenerationTypeV1, - HyperVGenerationTypeV2, - } -} - -// HyperVGenerationTypes - Specifies the HyperVGeneration Type -type HyperVGenerationTypes string - -const ( - HyperVGenerationTypesV1 HyperVGenerationTypes = "V1" - HyperVGenerationTypesV2 HyperVGenerationTypes = "V2" -) - -// PossibleHyperVGenerationTypesValues returns the possible values for the HyperVGenerationTypes const type. -func PossibleHyperVGenerationTypesValues() []HyperVGenerationTypes { - return []HyperVGenerationTypes{ - HyperVGenerationTypesV1, - HyperVGenerationTypesV2, - } -} - -// IPVersion - Available from Api-Version 2017-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or -// IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. -type IPVersion string - -const ( - IPVersionIPv4 IPVersion = "IPv4" - IPVersionIPv6 IPVersion = "IPv6" -) - -// PossibleIPVersionValues returns the possible values for the IPVersion const type. -func PossibleIPVersionValues() []IPVersion { - return []IPVersion{ - IPVersionIPv4, - IPVersionIPv6, - } -} - -// IPVersions - Available from Api-Version 2019-07-01 onwards, it represents whether the specific ipconfiguration is IPv4 -// or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. -type IPVersions string - -const ( - IPVersionsIPv4 IPVersions = "IPv4" - IPVersionsIPv6 IPVersions = "IPv6" -) - -// PossibleIPVersionsValues returns the possible values for the IPVersions const type. -func PossibleIPVersionsValues() []IPVersions { - return []IPVersions{ - IPVersionsIPv4, - IPVersionsIPv6, - } -} - -type InstanceViewTypes string - -const ( - InstanceViewTypesInstanceView InstanceViewTypes = "instanceView" - InstanceViewTypesUserData InstanceViewTypes = "userData" -) - -// PossibleInstanceViewTypesValues returns the possible values for the InstanceViewTypes const type. -func PossibleInstanceViewTypesValues() []InstanceViewTypes { - return []InstanceViewTypes{ - InstanceViewTypesInstanceView, - InstanceViewTypesUserData, - } -} - -// IntervalInMins - Interval value in minutes used to create LogAnalytics call rate logs. -type IntervalInMins string - -const ( - IntervalInMinsThreeMins IntervalInMins = "ThreeMins" - IntervalInMinsFiveMins IntervalInMins = "FiveMins" - IntervalInMinsThirtyMins IntervalInMins = "ThirtyMins" - IntervalInMinsSixtyMins IntervalInMins = "SixtyMins" -) - -// PossibleIntervalInMinsValues returns the possible values for the IntervalInMins const type. -func PossibleIntervalInMinsValues() []IntervalInMins { - return []IntervalInMins{ - IntervalInMinsThreeMins, - IntervalInMinsFiveMins, - IntervalInMinsThirtyMins, - IntervalInMinsSixtyMins, - } -} - -// LinuxPatchAssessmentMode - Specifies the mode of VM Guest Patch Assessment for the IaaS virtual machine. -// Possible values are: -// ImageDefault - You control the timing of patch assessments on a virtual machine. -// AutomaticByPlatform - The platform will trigger periodic patch assessments. The property provisionVMAgent must be true. -type LinuxPatchAssessmentMode string - -const ( - LinuxPatchAssessmentModeAutomaticByPlatform LinuxPatchAssessmentMode = "AutomaticByPlatform" - LinuxPatchAssessmentModeImageDefault LinuxPatchAssessmentMode = "ImageDefault" -) - -// PossibleLinuxPatchAssessmentModeValues returns the possible values for the LinuxPatchAssessmentMode const type. -func PossibleLinuxPatchAssessmentModeValues() []LinuxPatchAssessmentMode { - return []LinuxPatchAssessmentMode{ - LinuxPatchAssessmentModeAutomaticByPlatform, - LinuxPatchAssessmentModeImageDefault, - } -} - -// LinuxVMGuestPatchAutomaticByPlatformRebootSetting - Specifies the reboot setting for all AutomaticByPlatform patch installation -// operations. -type LinuxVMGuestPatchAutomaticByPlatformRebootSetting string - -const ( - LinuxVMGuestPatchAutomaticByPlatformRebootSettingAlways LinuxVMGuestPatchAutomaticByPlatformRebootSetting = "Always" - LinuxVMGuestPatchAutomaticByPlatformRebootSettingIfRequired LinuxVMGuestPatchAutomaticByPlatformRebootSetting = "IfRequired" - LinuxVMGuestPatchAutomaticByPlatformRebootSettingNever LinuxVMGuestPatchAutomaticByPlatformRebootSetting = "Never" - LinuxVMGuestPatchAutomaticByPlatformRebootSettingUnknown LinuxVMGuestPatchAutomaticByPlatformRebootSetting = "Unknown" -) - -// PossibleLinuxVMGuestPatchAutomaticByPlatformRebootSettingValues returns the possible values for the LinuxVMGuestPatchAutomaticByPlatformRebootSetting const type. -func PossibleLinuxVMGuestPatchAutomaticByPlatformRebootSettingValues() []LinuxVMGuestPatchAutomaticByPlatformRebootSetting { - return []LinuxVMGuestPatchAutomaticByPlatformRebootSetting{ - LinuxVMGuestPatchAutomaticByPlatformRebootSettingAlways, - LinuxVMGuestPatchAutomaticByPlatformRebootSettingIfRequired, - LinuxVMGuestPatchAutomaticByPlatformRebootSettingNever, - LinuxVMGuestPatchAutomaticByPlatformRebootSettingUnknown, - } -} - -// LinuxVMGuestPatchMode - Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual machines associated -// to virtual machine scale set with OrchestrationMode as Flexible. -// Possible values are: -// ImageDefault - The virtual machine's default patching configuration is used. -// AutomaticByPlatform - The virtual machine will be automatically updated by the platform. The property provisionVMAgent -// must be true -type LinuxVMGuestPatchMode string - -const ( - LinuxVMGuestPatchModeAutomaticByPlatform LinuxVMGuestPatchMode = "AutomaticByPlatform" - LinuxVMGuestPatchModeImageDefault LinuxVMGuestPatchMode = "ImageDefault" -) - -// PossibleLinuxVMGuestPatchModeValues returns the possible values for the LinuxVMGuestPatchMode const type. -func PossibleLinuxVMGuestPatchModeValues() []LinuxVMGuestPatchMode { - return []LinuxVMGuestPatchMode{ - LinuxVMGuestPatchModeAutomaticByPlatform, - LinuxVMGuestPatchModeImageDefault, - } -} - -// MaintenanceOperationResultCodeTypes - The Last Maintenance Operation Result Code. -type MaintenanceOperationResultCodeTypes string - -const ( - MaintenanceOperationResultCodeTypesNone MaintenanceOperationResultCodeTypes = "None" - MaintenanceOperationResultCodeTypesRetryLater MaintenanceOperationResultCodeTypes = "RetryLater" - MaintenanceOperationResultCodeTypesMaintenanceAborted MaintenanceOperationResultCodeTypes = "MaintenanceAborted" - MaintenanceOperationResultCodeTypesMaintenanceCompleted MaintenanceOperationResultCodeTypes = "MaintenanceCompleted" -) - -// PossibleMaintenanceOperationResultCodeTypesValues returns the possible values for the MaintenanceOperationResultCodeTypes const type. -func PossibleMaintenanceOperationResultCodeTypesValues() []MaintenanceOperationResultCodeTypes { - return []MaintenanceOperationResultCodeTypes{ - MaintenanceOperationResultCodeTypesNone, - MaintenanceOperationResultCodeTypesRetryLater, - MaintenanceOperationResultCodeTypesMaintenanceAborted, - MaintenanceOperationResultCodeTypesMaintenanceCompleted, - } -} - -// NetworkAPIVersion - specifies the Microsoft.Network API version used when creating networking resources in the Network -// Interface Configurations -type NetworkAPIVersion string - -const ( - NetworkAPIVersionTwoThousandTwenty1101 NetworkAPIVersion = "2020-11-01" -) - -// PossibleNetworkAPIVersionValues returns the possible values for the NetworkAPIVersion const type. -func PossibleNetworkAPIVersionValues() []NetworkAPIVersion { - return []NetworkAPIVersion{ - NetworkAPIVersionTwoThousandTwenty1101, - } -} - -// NetworkAccessPolicy - Policy for accessing the disk via network. -type NetworkAccessPolicy string - -const ( - // NetworkAccessPolicyAllowAll - The disk can be exported or uploaded to from any network. - NetworkAccessPolicyAllowAll NetworkAccessPolicy = "AllowAll" - // NetworkAccessPolicyAllowPrivate - The disk can be exported or uploaded to using a DiskAccess resource's private endpoints. - NetworkAccessPolicyAllowPrivate NetworkAccessPolicy = "AllowPrivate" - // NetworkAccessPolicyDenyAll - The disk cannot be exported. - NetworkAccessPolicyDenyAll NetworkAccessPolicy = "DenyAll" -) - -// PossibleNetworkAccessPolicyValues returns the possible values for the NetworkAccessPolicy const type. -func PossibleNetworkAccessPolicyValues() []NetworkAccessPolicy { - return []NetworkAccessPolicy{ - NetworkAccessPolicyAllowAll, - NetworkAccessPolicyAllowPrivate, - NetworkAccessPolicyDenyAll, - } -} - -// OperatingSystemStateTypes - This property allows the user to specify whether the virtual machines created under this image -// are 'Generalized' or 'Specialized'. -type OperatingSystemStateTypes string - -const ( - OperatingSystemStateTypesGeneralized OperatingSystemStateTypes = "Generalized" - OperatingSystemStateTypesSpecialized OperatingSystemStateTypes = "Specialized" -) - -// PossibleOperatingSystemStateTypesValues returns the possible values for the OperatingSystemStateTypes const type. -func PossibleOperatingSystemStateTypesValues() []OperatingSystemStateTypes { - return []OperatingSystemStateTypes{ - OperatingSystemStateTypesGeneralized, - OperatingSystemStateTypesSpecialized, - } -} - -// OperatingSystemType - Gets the Operating System type. -type OperatingSystemType string - -const ( - OperatingSystemTypeLinux OperatingSystemType = "Linux" - OperatingSystemTypeWindows OperatingSystemType = "Windows" -) - -// PossibleOperatingSystemTypeValues returns the possible values for the OperatingSystemType const type. -func PossibleOperatingSystemTypeValues() []OperatingSystemType { - return []OperatingSystemType{ - OperatingSystemTypeLinux, - OperatingSystemTypeWindows, - } -} - -// OperatingSystemTypes - This property allows you to specify the type of the OS that is included in the disk when creating -// a VM from a managed image. -// Possible values are: -// Windows -// Linux -type OperatingSystemTypes string - -const ( - OperatingSystemTypesWindows OperatingSystemTypes = "Windows" - OperatingSystemTypesLinux OperatingSystemTypes = "Linux" -) - -// PossibleOperatingSystemTypesValues returns the possible values for the OperatingSystemTypes const type. -func PossibleOperatingSystemTypesValues() []OperatingSystemTypes { - return []OperatingSystemTypes{ - OperatingSystemTypesWindows, - OperatingSystemTypesLinux, - } -} - -// OrchestrationMode - Specifies the orchestration mode for the virtual machine scale set. -type OrchestrationMode string - -const ( - OrchestrationModeFlexible OrchestrationMode = "Flexible" - OrchestrationModeUniform OrchestrationMode = "Uniform" -) - -// PossibleOrchestrationModeValues returns the possible values for the OrchestrationMode const type. -func PossibleOrchestrationModeValues() []OrchestrationMode { - return []OrchestrationMode{ - OrchestrationModeFlexible, - OrchestrationModeUniform, - } -} - -// OrchestrationServiceNames - The name of the service. -type OrchestrationServiceNames string - -const ( - OrchestrationServiceNamesAutomaticRepairs OrchestrationServiceNames = "AutomaticRepairs" -) - -// PossibleOrchestrationServiceNamesValues returns the possible values for the OrchestrationServiceNames const type. -func PossibleOrchestrationServiceNamesValues() []OrchestrationServiceNames { - return []OrchestrationServiceNames{ - OrchestrationServiceNamesAutomaticRepairs, - } -} - -// OrchestrationServiceState - The current state of the service. -type OrchestrationServiceState string - -const ( - OrchestrationServiceStateNotRunning OrchestrationServiceState = "NotRunning" - OrchestrationServiceStateRunning OrchestrationServiceState = "Running" - OrchestrationServiceStateSuspended OrchestrationServiceState = "Suspended" -) - -// PossibleOrchestrationServiceStateValues returns the possible values for the OrchestrationServiceState const type. -func PossibleOrchestrationServiceStateValues() []OrchestrationServiceState { - return []OrchestrationServiceState{ - OrchestrationServiceStateNotRunning, - OrchestrationServiceStateRunning, - OrchestrationServiceStateSuspended, - } -} - -// OrchestrationServiceStateAction - The action to be performed. -type OrchestrationServiceStateAction string - -const ( - OrchestrationServiceStateActionResume OrchestrationServiceStateAction = "Resume" - OrchestrationServiceStateActionSuspend OrchestrationServiceStateAction = "Suspend" -) - -// PossibleOrchestrationServiceStateActionValues returns the possible values for the OrchestrationServiceStateAction const type. -func PossibleOrchestrationServiceStateActionValues() []OrchestrationServiceStateAction { - return []OrchestrationServiceStateAction{ - OrchestrationServiceStateActionResume, - OrchestrationServiceStateActionSuspend, - } -} - -// PatchAssessmentState - Describes the availability of a given patch. -type PatchAssessmentState string - -const ( - PatchAssessmentStateAvailable PatchAssessmentState = "Available" - PatchAssessmentStateUnknown PatchAssessmentState = "Unknown" -) - -// PossiblePatchAssessmentStateValues returns the possible values for the PatchAssessmentState const type. -func PossiblePatchAssessmentStateValues() []PatchAssessmentState { - return []PatchAssessmentState{ - PatchAssessmentStateAvailable, - PatchAssessmentStateUnknown, - } -} - -// PatchInstallationState - The state of the patch after the installation operation completed. -type PatchInstallationState string - -const ( - PatchInstallationStateExcluded PatchInstallationState = "Excluded" - PatchInstallationStateFailed PatchInstallationState = "Failed" - PatchInstallationStateInstalled PatchInstallationState = "Installed" - PatchInstallationStateNotSelected PatchInstallationState = "NotSelected" - PatchInstallationStatePending PatchInstallationState = "Pending" - PatchInstallationStateUnknown PatchInstallationState = "Unknown" -) - -// PossiblePatchInstallationStateValues returns the possible values for the PatchInstallationState const type. -func PossiblePatchInstallationStateValues() []PatchInstallationState { - return []PatchInstallationState{ - PatchInstallationStateExcluded, - PatchInstallationStateFailed, - PatchInstallationStateInstalled, - PatchInstallationStateNotSelected, - PatchInstallationStatePending, - PatchInstallationStateUnknown, - } -} - -// PatchOperationStatus - The overall success or failure status of the operation. It remains "InProgress" until the operation -// completes. At that point it will become "Unknown", "Failed", "Succeeded", or -// "CompletedWithWarnings." -type PatchOperationStatus string - -const ( - PatchOperationStatusCompletedWithWarnings PatchOperationStatus = "CompletedWithWarnings" - PatchOperationStatusFailed PatchOperationStatus = "Failed" - PatchOperationStatusInProgress PatchOperationStatus = "InProgress" - PatchOperationStatusSucceeded PatchOperationStatus = "Succeeded" - PatchOperationStatusUnknown PatchOperationStatus = "Unknown" -) - -// PossiblePatchOperationStatusValues returns the possible values for the PatchOperationStatus const type. -func PossiblePatchOperationStatusValues() []PatchOperationStatus { - return []PatchOperationStatus{ - PatchOperationStatusCompletedWithWarnings, - PatchOperationStatusFailed, - PatchOperationStatusInProgress, - PatchOperationStatusSucceeded, - PatchOperationStatusUnknown, - } -} - -// PrivateEndpointConnectionProvisioningState - The current provisioning state. -type PrivateEndpointConnectionProvisioningState string - -const ( - PrivateEndpointConnectionProvisioningStateCreating PrivateEndpointConnectionProvisioningState = "Creating" - PrivateEndpointConnectionProvisioningStateDeleting PrivateEndpointConnectionProvisioningState = "Deleting" - PrivateEndpointConnectionProvisioningStateFailed PrivateEndpointConnectionProvisioningState = "Failed" - PrivateEndpointConnectionProvisioningStateSucceeded PrivateEndpointConnectionProvisioningState = "Succeeded" -) - -// PossiblePrivateEndpointConnectionProvisioningStateValues returns the possible values for the PrivateEndpointConnectionProvisioningState const type. -func PossiblePrivateEndpointConnectionProvisioningStateValues() []PrivateEndpointConnectionProvisioningState { - return []PrivateEndpointConnectionProvisioningState{ - PrivateEndpointConnectionProvisioningStateCreating, - PrivateEndpointConnectionProvisioningStateDeleting, - PrivateEndpointConnectionProvisioningStateFailed, - PrivateEndpointConnectionProvisioningStateSucceeded, - } -} - -// PrivateEndpointServiceConnectionStatus - The private endpoint connection status. -type PrivateEndpointServiceConnectionStatus string - -const ( - PrivateEndpointServiceConnectionStatusApproved PrivateEndpointServiceConnectionStatus = "Approved" - PrivateEndpointServiceConnectionStatusPending PrivateEndpointServiceConnectionStatus = "Pending" - PrivateEndpointServiceConnectionStatusRejected PrivateEndpointServiceConnectionStatus = "Rejected" -) - -// PossiblePrivateEndpointServiceConnectionStatusValues returns the possible values for the PrivateEndpointServiceConnectionStatus const type. -func PossiblePrivateEndpointServiceConnectionStatusValues() []PrivateEndpointServiceConnectionStatus { - return []PrivateEndpointServiceConnectionStatus{ - PrivateEndpointServiceConnectionStatusApproved, - PrivateEndpointServiceConnectionStatusPending, - PrivateEndpointServiceConnectionStatusRejected, - } -} - -// ProtocolTypes - Specifies the protocol of WinRM listener. -// Possible values are: -// http -// https -type ProtocolTypes string - -const ( - ProtocolTypesHTTP ProtocolTypes = "Http" - ProtocolTypesHTTPS ProtocolTypes = "Https" -) - -// PossibleProtocolTypesValues returns the possible values for the ProtocolTypes const type. -func PossibleProtocolTypesValues() []ProtocolTypes { - return []ProtocolTypes{ - ProtocolTypesHTTP, - ProtocolTypesHTTPS, - } -} - -// ProximityPlacementGroupType - Specifies the type of the proximity placement group. -// Possible values are: -// Standard : Co-locate resources within an Azure region or Availability Zone. -// Ultra : For future use. -type ProximityPlacementGroupType string - -const ( - ProximityPlacementGroupTypeStandard ProximityPlacementGroupType = "Standard" - ProximityPlacementGroupTypeUltra ProximityPlacementGroupType = "Ultra" -) - -// PossibleProximityPlacementGroupTypeValues returns the possible values for the ProximityPlacementGroupType const type. -func PossibleProximityPlacementGroupTypeValues() []ProximityPlacementGroupType { - return []ProximityPlacementGroupType{ - ProximityPlacementGroupTypeStandard, - ProximityPlacementGroupTypeUltra, - } -} - -// PublicIPAddressSKUName - Specify public IP sku name -type PublicIPAddressSKUName string - -const ( - PublicIPAddressSKUNameBasic PublicIPAddressSKUName = "Basic" - PublicIPAddressSKUNameStandard PublicIPAddressSKUName = "Standard" -) - -// PossiblePublicIPAddressSKUNameValues returns the possible values for the PublicIPAddressSKUName const type. -func PossiblePublicIPAddressSKUNameValues() []PublicIPAddressSKUName { - return []PublicIPAddressSKUName{ - PublicIPAddressSKUNameBasic, - PublicIPAddressSKUNameStandard, - } -} - -// PublicIPAddressSKUTier - Specify public IP sku tier -type PublicIPAddressSKUTier string - -const ( - PublicIPAddressSKUTierGlobal PublicIPAddressSKUTier = "Global" - PublicIPAddressSKUTierRegional PublicIPAddressSKUTier = "Regional" -) - -// PossiblePublicIPAddressSKUTierValues returns the possible values for the PublicIPAddressSKUTier const type. -func PossiblePublicIPAddressSKUTierValues() []PublicIPAddressSKUTier { - return []PublicIPAddressSKUTier{ - PublicIPAddressSKUTierGlobal, - PublicIPAddressSKUTierRegional, - } -} - -// PublicIPAllocationMethod - Specify the public IP allocation type -type PublicIPAllocationMethod string - -const ( - PublicIPAllocationMethodDynamic PublicIPAllocationMethod = "Dynamic" - PublicIPAllocationMethodStatic PublicIPAllocationMethod = "Static" -) - -// PossiblePublicIPAllocationMethodValues returns the possible values for the PublicIPAllocationMethod const type. -func PossiblePublicIPAllocationMethodValues() []PublicIPAllocationMethod { - return []PublicIPAllocationMethod{ - PublicIPAllocationMethodDynamic, - PublicIPAllocationMethodStatic, - } -} - -// PublicNetworkAccess - Policy for controlling export on the disk. -type PublicNetworkAccess string - -const ( - // PublicNetworkAccessDisabled - You cannot access the underlying data of the disk publicly on the internet even when NetworkAccessPolicy - // is set to AllowAll. You can access the data via the SAS URI only from your trusted Azure VNET when NetworkAccessPolicy - // is set to AllowPrivate. - PublicNetworkAccessDisabled PublicNetworkAccess = "Disabled" - // PublicNetworkAccessEnabled - You can generate a SAS URI to access the underlying data of the disk publicly on the internet - // when NetworkAccessPolicy is set to AllowAll. You can access the data via the SAS URI only from your trusted Azure VNET - // when NetworkAccessPolicy is set to AllowPrivate. - PublicNetworkAccessEnabled PublicNetworkAccess = "Enabled" -) - -// PossiblePublicNetworkAccessValues returns the possible values for the PublicNetworkAccess const type. -func PossiblePublicNetworkAccessValues() []PublicNetworkAccess { - return []PublicNetworkAccess{ - PublicNetworkAccessDisabled, - PublicNetworkAccessEnabled, - } -} - -// RepairAction - Type of repair action (replace, restart, reimage) that will be used for repairing unhealthy virtual machines -// in the scale set. Default value is replace. -type RepairAction string - -const ( - RepairActionReimage RepairAction = "Reimage" - RepairActionReplace RepairAction = "Replace" - RepairActionRestart RepairAction = "Restart" -) - -// PossibleRepairActionValues returns the possible values for the RepairAction const type. -func PossibleRepairActionValues() []RepairAction { - return []RepairAction{ - RepairActionReimage, - RepairActionReplace, - RepairActionRestart, - } -} - -// ReplicationMode - Optional parameter which specifies the mode to be used for replication. This property is not updatable. -type ReplicationMode string - -const ( - ReplicationModeFull ReplicationMode = "Full" - ReplicationModeShallow ReplicationMode = "Shallow" -) - -// PossibleReplicationModeValues returns the possible values for the ReplicationMode const type. -func PossibleReplicationModeValues() []ReplicationMode { - return []ReplicationMode{ - ReplicationModeFull, - ReplicationModeShallow, - } -} - -// ReplicationState - This is the regional replication state. -type ReplicationState string - -const ( - ReplicationStateCompleted ReplicationState = "Completed" - ReplicationStateFailed ReplicationState = "Failed" - ReplicationStateReplicating ReplicationState = "Replicating" - ReplicationStateUnknown ReplicationState = "Unknown" -) - -// PossibleReplicationStateValues returns the possible values for the ReplicationState const type. -func PossibleReplicationStateValues() []ReplicationState { - return []ReplicationState{ - ReplicationStateCompleted, - ReplicationStateFailed, - ReplicationStateReplicating, - ReplicationStateUnknown, - } -} - -type ReplicationStatusTypes string - -const ( - ReplicationStatusTypesReplicationStatus ReplicationStatusTypes = "ReplicationStatus" -) - -// PossibleReplicationStatusTypesValues returns the possible values for the ReplicationStatusTypes const type. -func PossibleReplicationStatusTypesValues() []ReplicationStatusTypes { - return []ReplicationStatusTypes{ - ReplicationStatusTypesReplicationStatus, - } -} - -// ResourceIdentityType - The type of identity used for the virtual machine scale set. The type 'SystemAssigned, UserAssigned' -// includes both an implicitly created identity and a set of user assigned identities. The type 'None' -// will remove any identities from the virtual machine scale set. -type ResourceIdentityType string - -const ( - ResourceIdentityTypeSystemAssigned ResourceIdentityType = "SystemAssigned" - ResourceIdentityTypeUserAssigned ResourceIdentityType = "UserAssigned" - ResourceIdentityTypeSystemAssignedUserAssigned ResourceIdentityType = "SystemAssigned, UserAssigned" - ResourceIdentityTypeNone ResourceIdentityType = "None" -) - -// PossibleResourceIdentityTypeValues returns the possible values for the ResourceIdentityType const type. -func PossibleResourceIdentityTypeValues() []ResourceIdentityType { - return []ResourceIdentityType{ - ResourceIdentityTypeSystemAssigned, - ResourceIdentityTypeUserAssigned, - ResourceIdentityTypeSystemAssignedUserAssigned, - ResourceIdentityTypeNone, - } -} - -// ResourceSKUCapacityScaleType - The scale type applicable to the sku. -type ResourceSKUCapacityScaleType string - -const ( - ResourceSKUCapacityScaleTypeAutomatic ResourceSKUCapacityScaleType = "Automatic" - ResourceSKUCapacityScaleTypeManual ResourceSKUCapacityScaleType = "Manual" - ResourceSKUCapacityScaleTypeNone ResourceSKUCapacityScaleType = "None" -) - -// PossibleResourceSKUCapacityScaleTypeValues returns the possible values for the ResourceSKUCapacityScaleType const type. -func PossibleResourceSKUCapacityScaleTypeValues() []ResourceSKUCapacityScaleType { - return []ResourceSKUCapacityScaleType{ - ResourceSKUCapacityScaleTypeAutomatic, - ResourceSKUCapacityScaleTypeManual, - ResourceSKUCapacityScaleTypeNone, - } -} - -// ResourceSKURestrictionsReasonCode - The reason for restriction. -type ResourceSKURestrictionsReasonCode string - -const ( - ResourceSKURestrictionsReasonCodeQuotaID ResourceSKURestrictionsReasonCode = "QuotaId" - ResourceSKURestrictionsReasonCodeNotAvailableForSubscription ResourceSKURestrictionsReasonCode = "NotAvailableForSubscription" -) - -// PossibleResourceSKURestrictionsReasonCodeValues returns the possible values for the ResourceSKURestrictionsReasonCode const type. -func PossibleResourceSKURestrictionsReasonCodeValues() []ResourceSKURestrictionsReasonCode { - return []ResourceSKURestrictionsReasonCode{ - ResourceSKURestrictionsReasonCodeQuotaID, - ResourceSKURestrictionsReasonCodeNotAvailableForSubscription, - } -} - -// ResourceSKURestrictionsType - The type of restrictions. -type ResourceSKURestrictionsType string - -const ( - ResourceSKURestrictionsTypeLocation ResourceSKURestrictionsType = "Location" - ResourceSKURestrictionsTypeZone ResourceSKURestrictionsType = "Zone" -) - -// PossibleResourceSKURestrictionsTypeValues returns the possible values for the ResourceSKURestrictionsType const type. -func PossibleResourceSKURestrictionsTypeValues() []ResourceSKURestrictionsType { - return []ResourceSKURestrictionsType{ - ResourceSKURestrictionsTypeLocation, - ResourceSKURestrictionsTypeZone, - } -} - -type RestorePointCollectionExpandOptions string - -const ( - RestorePointCollectionExpandOptionsRestorePoints RestorePointCollectionExpandOptions = "restorePoints" -) - -// PossibleRestorePointCollectionExpandOptionsValues returns the possible values for the RestorePointCollectionExpandOptions const type. -func PossibleRestorePointCollectionExpandOptionsValues() []RestorePointCollectionExpandOptions { - return []RestorePointCollectionExpandOptions{ - RestorePointCollectionExpandOptionsRestorePoints, - } -} - -type RestorePointExpandOptions string - -const ( - RestorePointExpandOptionsInstanceView RestorePointExpandOptions = "instanceView" -) - -// PossibleRestorePointExpandOptionsValues returns the possible values for the RestorePointExpandOptions const type. -func PossibleRestorePointExpandOptionsValues() []RestorePointExpandOptions { - return []RestorePointExpandOptions{ - RestorePointExpandOptionsInstanceView, - } -} - -// RollingUpgradeActionType - The last action performed on the rolling upgrade. -type RollingUpgradeActionType string - -const ( - RollingUpgradeActionTypeStart RollingUpgradeActionType = "Start" - RollingUpgradeActionTypeCancel RollingUpgradeActionType = "Cancel" -) - -// PossibleRollingUpgradeActionTypeValues returns the possible values for the RollingUpgradeActionType const type. -func PossibleRollingUpgradeActionTypeValues() []RollingUpgradeActionType { - return []RollingUpgradeActionType{ - RollingUpgradeActionTypeStart, - RollingUpgradeActionTypeCancel, - } -} - -// RollingUpgradeStatusCode - Code indicating the current status of the upgrade. -type RollingUpgradeStatusCode string - -const ( - RollingUpgradeStatusCodeRollingForward RollingUpgradeStatusCode = "RollingForward" - RollingUpgradeStatusCodeCancelled RollingUpgradeStatusCode = "Cancelled" - RollingUpgradeStatusCodeCompleted RollingUpgradeStatusCode = "Completed" - RollingUpgradeStatusCodeFaulted RollingUpgradeStatusCode = "Faulted" -) - -// PossibleRollingUpgradeStatusCodeValues returns the possible values for the RollingUpgradeStatusCode const type. -func PossibleRollingUpgradeStatusCodeValues() []RollingUpgradeStatusCode { - return []RollingUpgradeStatusCode{ - RollingUpgradeStatusCodeRollingForward, - RollingUpgradeStatusCodeCancelled, - RollingUpgradeStatusCodeCompleted, - RollingUpgradeStatusCodeFaulted, - } -} - -// SecurityEncryptionTypes - Specifies the EncryptionType of the managed disk. -// It is set to DiskWithVMGuestState for encryption of the managed disk along with VMGuestState blob, and VMGuestStateOnly -// for encryption of just the VMGuestState blob. -// NOTE: It can be set for only Confidential VMs. -type SecurityEncryptionTypes string - -const ( - SecurityEncryptionTypesDiskWithVMGuestState SecurityEncryptionTypes = "DiskWithVMGuestState" - SecurityEncryptionTypesVMGuestStateOnly SecurityEncryptionTypes = "VMGuestStateOnly" -) - -// PossibleSecurityEncryptionTypesValues returns the possible values for the SecurityEncryptionTypes const type. -func PossibleSecurityEncryptionTypesValues() []SecurityEncryptionTypes { - return []SecurityEncryptionTypes{ - SecurityEncryptionTypesDiskWithVMGuestState, - SecurityEncryptionTypesVMGuestStateOnly, - } -} - -// SecurityTypes - Specifies the SecurityType of the virtual machine. It has to be set to any specified value to enable UefiSettings. -// Default: UefiSettings will not be enabled unless this property is set. -type SecurityTypes string - -const ( - SecurityTypesConfidentialVM SecurityTypes = "ConfidentialVM" - SecurityTypesTrustedLaunch SecurityTypes = "TrustedLaunch" -) - -// PossibleSecurityTypesValues returns the possible values for the SecurityTypes const type. -func PossibleSecurityTypesValues() []SecurityTypes { - return []SecurityTypes{ - SecurityTypesConfidentialVM, - SecurityTypesTrustedLaunch, - } -} - -type SelectPermissions string - -const ( - SelectPermissionsPermissions SelectPermissions = "Permissions" -) - -// PossibleSelectPermissionsValues returns the possible values for the SelectPermissions const type. -func PossibleSelectPermissionsValues() []SelectPermissions { - return []SelectPermissions{ - SelectPermissionsPermissions, - } -} - -// SettingNames - Specifies the name of the setting to which the content applies. Possible values are: FirstLogonCommands -// and AutoLogon. -type SettingNames string - -const ( - SettingNamesAutoLogon SettingNames = "AutoLogon" - SettingNamesFirstLogonCommands SettingNames = "FirstLogonCommands" -) - -// PossibleSettingNamesValues returns the possible values for the SettingNames const type. -func PossibleSettingNamesValues() []SettingNames { - return []SettingNames{ - SettingNamesAutoLogon, - SettingNamesFirstLogonCommands, - } -} - -type SharedToValues string - -const ( - SharedToValuesTenant SharedToValues = "tenant" -) - -// PossibleSharedToValuesValues returns the possible values for the SharedToValues const type. -func PossibleSharedToValuesValues() []SharedToValues { - return []SharedToValues{ - SharedToValuesTenant, - } -} - -// SharingProfileGroupTypes - This property allows you to specify the type of sharing group. -// Possible values are: -// Subscriptions -// AADTenants -// Community -type SharingProfileGroupTypes string - -const ( - SharingProfileGroupTypesAADTenants SharingProfileGroupTypes = "AADTenants" - SharingProfileGroupTypesCommunity SharingProfileGroupTypes = "Community" - SharingProfileGroupTypesSubscriptions SharingProfileGroupTypes = "Subscriptions" -) - -// PossibleSharingProfileGroupTypesValues returns the possible values for the SharingProfileGroupTypes const type. -func PossibleSharingProfileGroupTypesValues() []SharingProfileGroupTypes { - return []SharingProfileGroupTypes{ - SharingProfileGroupTypesAADTenants, - SharingProfileGroupTypesCommunity, - SharingProfileGroupTypesSubscriptions, - } -} - -// SharingState - The sharing state of the gallery, which only appears in the response. -type SharingState string - -const ( - SharingStateFailed SharingState = "Failed" - SharingStateInProgress SharingState = "InProgress" - SharingStateSucceeded SharingState = "Succeeded" - SharingStateUnknown SharingState = "Unknown" -) - -// PossibleSharingStateValues returns the possible values for the SharingState const type. -func PossibleSharingStateValues() []SharingState { - return []SharingState{ - SharingStateFailed, - SharingStateInProgress, - SharingStateSucceeded, - SharingStateUnknown, - } -} - -// SharingUpdateOperationTypes - This property allows you to specify the operation type of gallery sharing update. -// Possible values are: -// Add -// Remove -// Reset -type SharingUpdateOperationTypes string - -const ( - SharingUpdateOperationTypesAdd SharingUpdateOperationTypes = "Add" - SharingUpdateOperationTypesEnableCommunity SharingUpdateOperationTypes = "EnableCommunity" - SharingUpdateOperationTypesRemove SharingUpdateOperationTypes = "Remove" - SharingUpdateOperationTypesReset SharingUpdateOperationTypes = "Reset" -) - -// PossibleSharingUpdateOperationTypesValues returns the possible values for the SharingUpdateOperationTypes const type. -func PossibleSharingUpdateOperationTypesValues() []SharingUpdateOperationTypes { - return []SharingUpdateOperationTypes{ - SharingUpdateOperationTypesAdd, - SharingUpdateOperationTypesEnableCommunity, - SharingUpdateOperationTypesRemove, - SharingUpdateOperationTypesReset, - } -} - -// SnapshotStorageAccountTypes - The sku name. -type SnapshotStorageAccountTypes string - -const ( - // SnapshotStorageAccountTypesPremiumLRS - Premium SSD locally redundant storage - SnapshotStorageAccountTypesPremiumLRS SnapshotStorageAccountTypes = "Premium_LRS" - // SnapshotStorageAccountTypesStandardLRS - Standard HDD locally redundant storage - SnapshotStorageAccountTypesStandardLRS SnapshotStorageAccountTypes = "Standard_LRS" - // SnapshotStorageAccountTypesStandardZRS - Standard zone redundant storage - SnapshotStorageAccountTypesStandardZRS SnapshotStorageAccountTypes = "Standard_ZRS" -) - -// PossibleSnapshotStorageAccountTypesValues returns the possible values for the SnapshotStorageAccountTypes const type. -func PossibleSnapshotStorageAccountTypesValues() []SnapshotStorageAccountTypes { - return []SnapshotStorageAccountTypes{ - SnapshotStorageAccountTypesPremiumLRS, - SnapshotStorageAccountTypesStandardLRS, - SnapshotStorageAccountTypesStandardZRS, - } -} - -// StatusLevelTypes - The level code. -type StatusLevelTypes string - -const ( - StatusLevelTypesInfo StatusLevelTypes = "Info" - StatusLevelTypesWarning StatusLevelTypes = "Warning" - StatusLevelTypesError StatusLevelTypes = "Error" -) - -// PossibleStatusLevelTypesValues returns the possible values for the StatusLevelTypes const type. -func PossibleStatusLevelTypesValues() []StatusLevelTypes { - return []StatusLevelTypes{ - StatusLevelTypesInfo, - StatusLevelTypesWarning, - StatusLevelTypesError, - } -} - -// StorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable. -type StorageAccountType string - -const ( - StorageAccountTypePremiumLRS StorageAccountType = "Premium_LRS" - StorageAccountTypeStandardLRS StorageAccountType = "Standard_LRS" - StorageAccountTypeStandardZRS StorageAccountType = "Standard_ZRS" -) - -// PossibleStorageAccountTypeValues returns the possible values for the StorageAccountType const type. -func PossibleStorageAccountTypeValues() []StorageAccountType { - return []StorageAccountType{ - StorageAccountTypePremiumLRS, - StorageAccountTypeStandardLRS, - StorageAccountTypeStandardZRS, - } -} - -// StorageAccountTypes - Specifies the storage account type for the managed disk. Managed OS disk storage account type can -// only be set when you create the scale set. NOTE: UltraSSDLRS can only be used with data disks. It -// cannot be used with OS Disk. StandardLRS uses Standard HDD. StandardSSDLRS uses Standard SSD. PremiumLRS uses Premium SSD. -// UltraSSDLRS uses Ultra disk. PremiumZRS uses Premium SSD zone redundant -// storage. StandardSSD_ZRS uses Standard SSD zone redundant storage. For more information regarding disks supported for Windows -// Virtual Machines, refer to -// https://docs.microsoft.com/azure/virtual-machines/windows/disks-types and, for Linux Virtual Machines, refer to https://docs.microsoft.com/azure/virtual-machines/linux/disks-types -type StorageAccountTypes string - -const ( - StorageAccountTypesPremiumLRS StorageAccountTypes = "Premium_LRS" - StorageAccountTypesPremiumV2LRS StorageAccountTypes = "PremiumV2_LRS" - StorageAccountTypesPremiumZRS StorageAccountTypes = "Premium_ZRS" - StorageAccountTypesStandardLRS StorageAccountTypes = "Standard_LRS" - StorageAccountTypesStandardSSDLRS StorageAccountTypes = "StandardSSD_LRS" - StorageAccountTypesStandardSSDZRS StorageAccountTypes = "StandardSSD_ZRS" - StorageAccountTypesUltraSSDLRS StorageAccountTypes = "UltraSSD_LRS" -) - -// PossibleStorageAccountTypesValues returns the possible values for the StorageAccountTypes const type. -func PossibleStorageAccountTypesValues() []StorageAccountTypes { - return []StorageAccountTypes{ - StorageAccountTypesPremiumLRS, - StorageAccountTypesPremiumV2LRS, - StorageAccountTypesPremiumZRS, - StorageAccountTypesStandardLRS, - StorageAccountTypesStandardSSDLRS, - StorageAccountTypesStandardSSDZRS, - StorageAccountTypesUltraSSDLRS, - } -} - -// UpgradeMode - Specifies the mode of an upgrade to virtual machines in the scale set. -// Possible values are: -// Manual - You control the application of updates to virtual machines in the scale set. You do this by using the manualUpgrade -// action. -// Automatic - All virtual machines in the scale set are automatically updated at the same time. -type UpgradeMode string - -const ( - UpgradeModeAutomatic UpgradeMode = "Automatic" - UpgradeModeManual UpgradeMode = "Manual" - UpgradeModeRolling UpgradeMode = "Rolling" -) - -// PossibleUpgradeModeValues returns the possible values for the UpgradeMode const type. -func PossibleUpgradeModeValues() []UpgradeMode { - return []UpgradeMode{ - UpgradeModeAutomatic, - UpgradeModeManual, - UpgradeModeRolling, - } -} - -// UpgradeOperationInvoker - Invoker of the Upgrade Operation -type UpgradeOperationInvoker string - -const ( - UpgradeOperationInvokerUnknown UpgradeOperationInvoker = "Unknown" - UpgradeOperationInvokerUser UpgradeOperationInvoker = "User" - UpgradeOperationInvokerPlatform UpgradeOperationInvoker = "Platform" -) - -// PossibleUpgradeOperationInvokerValues returns the possible values for the UpgradeOperationInvoker const type. -func PossibleUpgradeOperationInvokerValues() []UpgradeOperationInvoker { - return []UpgradeOperationInvoker{ - UpgradeOperationInvokerUnknown, - UpgradeOperationInvokerUser, - UpgradeOperationInvokerPlatform, - } -} - -// UpgradeState - Code indicating the current status of the upgrade. -type UpgradeState string - -const ( - UpgradeStateRollingForward UpgradeState = "RollingForward" - UpgradeStateCancelled UpgradeState = "Cancelled" - UpgradeStateCompleted UpgradeState = "Completed" - UpgradeStateFaulted UpgradeState = "Faulted" -) - -// PossibleUpgradeStateValues returns the possible values for the UpgradeState const type. -func PossibleUpgradeStateValues() []UpgradeState { - return []UpgradeState{ - UpgradeStateRollingForward, - UpgradeStateCancelled, - UpgradeStateCompleted, - UpgradeStateFaulted, - } -} - -// VMDiskTypes - VM disk types which are disallowed. -type VMDiskTypes string - -const ( - VMDiskTypesNone VMDiskTypes = "None" - VMDiskTypesUnmanaged VMDiskTypes = "Unmanaged" -) - -// PossibleVMDiskTypesValues returns the possible values for the VMDiskTypes const type. -func PossibleVMDiskTypesValues() []VMDiskTypes { - return []VMDiskTypes{ - VMDiskTypesNone, - VMDiskTypesUnmanaged, - } -} - -type VMGuestPatchClassificationLinux string - -const ( - VMGuestPatchClassificationLinuxCritical VMGuestPatchClassificationLinux = "Critical" - VMGuestPatchClassificationLinuxOther VMGuestPatchClassificationLinux = "Other" - VMGuestPatchClassificationLinuxSecurity VMGuestPatchClassificationLinux = "Security" -) - -// PossibleVMGuestPatchClassificationLinuxValues returns the possible values for the VMGuestPatchClassificationLinux const type. -func PossibleVMGuestPatchClassificationLinuxValues() []VMGuestPatchClassificationLinux { - return []VMGuestPatchClassificationLinux{ - VMGuestPatchClassificationLinuxCritical, - VMGuestPatchClassificationLinuxOther, - VMGuestPatchClassificationLinuxSecurity, - } -} - -type VMGuestPatchClassificationWindows string - -const ( - VMGuestPatchClassificationWindowsCritical VMGuestPatchClassificationWindows = "Critical" - VMGuestPatchClassificationWindowsDefinition VMGuestPatchClassificationWindows = "Definition" - VMGuestPatchClassificationWindowsFeaturePack VMGuestPatchClassificationWindows = "FeaturePack" - VMGuestPatchClassificationWindowsSecurity VMGuestPatchClassificationWindows = "Security" - VMGuestPatchClassificationWindowsServicePack VMGuestPatchClassificationWindows = "ServicePack" - VMGuestPatchClassificationWindowsTools VMGuestPatchClassificationWindows = "Tools" - VMGuestPatchClassificationWindowsUpdateRollUp VMGuestPatchClassificationWindows = "UpdateRollUp" - VMGuestPatchClassificationWindowsUpdates VMGuestPatchClassificationWindows = "Updates" -) - -// PossibleVMGuestPatchClassificationWindowsValues returns the possible values for the VMGuestPatchClassificationWindows const type. -func PossibleVMGuestPatchClassificationWindowsValues() []VMGuestPatchClassificationWindows { - return []VMGuestPatchClassificationWindows{ - VMGuestPatchClassificationWindowsCritical, - VMGuestPatchClassificationWindowsDefinition, - VMGuestPatchClassificationWindowsFeaturePack, - VMGuestPatchClassificationWindowsSecurity, - VMGuestPatchClassificationWindowsServicePack, - VMGuestPatchClassificationWindowsTools, - VMGuestPatchClassificationWindowsUpdateRollUp, - VMGuestPatchClassificationWindowsUpdates, - } -} - -// VMGuestPatchRebootBehavior - Describes the reboot requirements of the patch. -type VMGuestPatchRebootBehavior string - -const ( - VMGuestPatchRebootBehaviorAlwaysRequiresReboot VMGuestPatchRebootBehavior = "AlwaysRequiresReboot" - VMGuestPatchRebootBehaviorCanRequestReboot VMGuestPatchRebootBehavior = "CanRequestReboot" - VMGuestPatchRebootBehaviorNeverReboots VMGuestPatchRebootBehavior = "NeverReboots" - VMGuestPatchRebootBehaviorUnknown VMGuestPatchRebootBehavior = "Unknown" -) - -// PossibleVMGuestPatchRebootBehaviorValues returns the possible values for the VMGuestPatchRebootBehavior const type. -func PossibleVMGuestPatchRebootBehaviorValues() []VMGuestPatchRebootBehavior { - return []VMGuestPatchRebootBehavior{ - VMGuestPatchRebootBehaviorAlwaysRequiresReboot, - VMGuestPatchRebootBehaviorCanRequestReboot, - VMGuestPatchRebootBehaviorNeverReboots, - VMGuestPatchRebootBehaviorUnknown, - } -} - -// VMGuestPatchRebootSetting - Defines when it is acceptable to reboot a VM during a software update operation. -type VMGuestPatchRebootSetting string - -const ( - VMGuestPatchRebootSettingAlways VMGuestPatchRebootSetting = "Always" - VMGuestPatchRebootSettingIfRequired VMGuestPatchRebootSetting = "IfRequired" - VMGuestPatchRebootSettingNever VMGuestPatchRebootSetting = "Never" -) - -// PossibleVMGuestPatchRebootSettingValues returns the possible values for the VMGuestPatchRebootSetting const type. -func PossibleVMGuestPatchRebootSettingValues() []VMGuestPatchRebootSetting { - return []VMGuestPatchRebootSetting{ - VMGuestPatchRebootSettingAlways, - VMGuestPatchRebootSettingIfRequired, - VMGuestPatchRebootSettingNever, - } -} - -// VMGuestPatchRebootStatus - The reboot state of the VM following completion of the operation. -type VMGuestPatchRebootStatus string - -const ( - VMGuestPatchRebootStatusCompleted VMGuestPatchRebootStatus = "Completed" - VMGuestPatchRebootStatusFailed VMGuestPatchRebootStatus = "Failed" - VMGuestPatchRebootStatusNotNeeded VMGuestPatchRebootStatus = "NotNeeded" - VMGuestPatchRebootStatusRequired VMGuestPatchRebootStatus = "Required" - VMGuestPatchRebootStatusStarted VMGuestPatchRebootStatus = "Started" - VMGuestPatchRebootStatusUnknown VMGuestPatchRebootStatus = "Unknown" -) - -// PossibleVMGuestPatchRebootStatusValues returns the possible values for the VMGuestPatchRebootStatus const type. -func PossibleVMGuestPatchRebootStatusValues() []VMGuestPatchRebootStatus { - return []VMGuestPatchRebootStatus{ - VMGuestPatchRebootStatusCompleted, - VMGuestPatchRebootStatusFailed, - VMGuestPatchRebootStatusNotNeeded, - VMGuestPatchRebootStatusRequired, - VMGuestPatchRebootStatusStarted, - VMGuestPatchRebootStatusUnknown, - } -} - -// VirtualMachineEvictionPolicyTypes - Specifies the eviction policy for the Azure Spot VM/VMSS -type VirtualMachineEvictionPolicyTypes string - -const ( - VirtualMachineEvictionPolicyTypesDeallocate VirtualMachineEvictionPolicyTypes = "Deallocate" - VirtualMachineEvictionPolicyTypesDelete VirtualMachineEvictionPolicyTypes = "Delete" -) - -// PossibleVirtualMachineEvictionPolicyTypesValues returns the possible values for the VirtualMachineEvictionPolicyTypes const type. -func PossibleVirtualMachineEvictionPolicyTypesValues() []VirtualMachineEvictionPolicyTypes { - return []VirtualMachineEvictionPolicyTypes{ - VirtualMachineEvictionPolicyTypesDeallocate, - VirtualMachineEvictionPolicyTypesDelete, - } -} - -// VirtualMachinePriorityTypes - Specifies the priority for a standalone virtual machine or the virtual machines in the scale -// set. -// 'Low' enum will be deprecated in the future, please use 'Spot' as the enum to deploy Azure Spot VM/VMSS. -type VirtualMachinePriorityTypes string - -const ( - VirtualMachinePriorityTypesLow VirtualMachinePriorityTypes = "Low" - VirtualMachinePriorityTypesRegular VirtualMachinePriorityTypes = "Regular" - VirtualMachinePriorityTypesSpot VirtualMachinePriorityTypes = "Spot" -) - -// PossibleVirtualMachinePriorityTypesValues returns the possible values for the VirtualMachinePriorityTypes const type. -func PossibleVirtualMachinePriorityTypesValues() []VirtualMachinePriorityTypes { - return []VirtualMachinePriorityTypes{ - VirtualMachinePriorityTypesLow, - VirtualMachinePriorityTypesRegular, - VirtualMachinePriorityTypesSpot, - } -} - -// VirtualMachineScaleSetSKUScaleType - The scale type applicable to the sku. -type VirtualMachineScaleSetSKUScaleType string - -const ( - VirtualMachineScaleSetSKUScaleTypeAutomatic VirtualMachineScaleSetSKUScaleType = "Automatic" - VirtualMachineScaleSetSKUScaleTypeNone VirtualMachineScaleSetSKUScaleType = "None" -) - -// PossibleVirtualMachineScaleSetSKUScaleTypeValues returns the possible values for the VirtualMachineScaleSetSKUScaleType const type. -func PossibleVirtualMachineScaleSetSKUScaleTypeValues() []VirtualMachineScaleSetSKUScaleType { - return []VirtualMachineScaleSetSKUScaleType{ - VirtualMachineScaleSetSKUScaleTypeAutomatic, - VirtualMachineScaleSetSKUScaleTypeNone, - } -} - -type VirtualMachineScaleSetScaleInRules string - -const ( - VirtualMachineScaleSetScaleInRulesDefault VirtualMachineScaleSetScaleInRules = "Default" - VirtualMachineScaleSetScaleInRulesNewestVM VirtualMachineScaleSetScaleInRules = "NewestVM" - VirtualMachineScaleSetScaleInRulesOldestVM VirtualMachineScaleSetScaleInRules = "OldestVM" -) - -// PossibleVirtualMachineScaleSetScaleInRulesValues returns the possible values for the VirtualMachineScaleSetScaleInRules const type. -func PossibleVirtualMachineScaleSetScaleInRulesValues() []VirtualMachineScaleSetScaleInRules { - return []VirtualMachineScaleSetScaleInRules{ - VirtualMachineScaleSetScaleInRulesDefault, - VirtualMachineScaleSetScaleInRulesNewestVM, - VirtualMachineScaleSetScaleInRulesOldestVM, - } -} - -// VirtualMachineSizeTypes - Specifies the size of the virtual machine. -// The enum data type is currently deprecated and will be removed by December 23rd 2023. -// Recommended way to get the list of available sizes is using 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/resourceskus/list] -// List all available virtual machine sizes for resizing [https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes]. -// For more information about virtual machine sizes, see Sizes for -// virtual machines [https://docs.microsoft.com/azure/virtual-machines/sizes]. -// The available VM sizes depend on region and availability set. -type VirtualMachineSizeTypes string - -const ( - VirtualMachineSizeTypesBasicA0 VirtualMachineSizeTypes = "Basic_A0" - VirtualMachineSizeTypesBasicA1 VirtualMachineSizeTypes = "Basic_A1" - VirtualMachineSizeTypesBasicA2 VirtualMachineSizeTypes = "Basic_A2" - VirtualMachineSizeTypesBasicA3 VirtualMachineSizeTypes = "Basic_A3" - VirtualMachineSizeTypesBasicA4 VirtualMachineSizeTypes = "Basic_A4" - VirtualMachineSizeTypesStandardA0 VirtualMachineSizeTypes = "Standard_A0" - VirtualMachineSizeTypesStandardA1 VirtualMachineSizeTypes = "Standard_A1" - VirtualMachineSizeTypesStandardA10 VirtualMachineSizeTypes = "Standard_A10" - VirtualMachineSizeTypesStandardA11 VirtualMachineSizeTypes = "Standard_A11" - VirtualMachineSizeTypesStandardA1V2 VirtualMachineSizeTypes = "Standard_A1_v2" - VirtualMachineSizeTypesStandardA2 VirtualMachineSizeTypes = "Standard_A2" - VirtualMachineSizeTypesStandardA2MV2 VirtualMachineSizeTypes = "Standard_A2m_v2" - VirtualMachineSizeTypesStandardA2V2 VirtualMachineSizeTypes = "Standard_A2_v2" - VirtualMachineSizeTypesStandardA3 VirtualMachineSizeTypes = "Standard_A3" - VirtualMachineSizeTypesStandardA4 VirtualMachineSizeTypes = "Standard_A4" - VirtualMachineSizeTypesStandardA4MV2 VirtualMachineSizeTypes = "Standard_A4m_v2" - VirtualMachineSizeTypesStandardA4V2 VirtualMachineSizeTypes = "Standard_A4_v2" - VirtualMachineSizeTypesStandardA5 VirtualMachineSizeTypes = "Standard_A5" - VirtualMachineSizeTypesStandardA6 VirtualMachineSizeTypes = "Standard_A6" - VirtualMachineSizeTypesStandardA7 VirtualMachineSizeTypes = "Standard_A7" - VirtualMachineSizeTypesStandardA8 VirtualMachineSizeTypes = "Standard_A8" - VirtualMachineSizeTypesStandardA8MV2 VirtualMachineSizeTypes = "Standard_A8m_v2" - VirtualMachineSizeTypesStandardA8V2 VirtualMachineSizeTypes = "Standard_A8_v2" - VirtualMachineSizeTypesStandardA9 VirtualMachineSizeTypes = "Standard_A9" - VirtualMachineSizeTypesStandardB1Ms VirtualMachineSizeTypes = "Standard_B1ms" - VirtualMachineSizeTypesStandardB1S VirtualMachineSizeTypes = "Standard_B1s" - VirtualMachineSizeTypesStandardB2Ms VirtualMachineSizeTypes = "Standard_B2ms" - VirtualMachineSizeTypesStandardB2S VirtualMachineSizeTypes = "Standard_B2s" - VirtualMachineSizeTypesStandardB4Ms VirtualMachineSizeTypes = "Standard_B4ms" - VirtualMachineSizeTypesStandardB8Ms VirtualMachineSizeTypes = "Standard_B8ms" - VirtualMachineSizeTypesStandardD1 VirtualMachineSizeTypes = "Standard_D1" - VirtualMachineSizeTypesStandardD11 VirtualMachineSizeTypes = "Standard_D11" - VirtualMachineSizeTypesStandardD11V2 VirtualMachineSizeTypes = "Standard_D11_v2" - VirtualMachineSizeTypesStandardD12 VirtualMachineSizeTypes = "Standard_D12" - VirtualMachineSizeTypesStandardD12V2 VirtualMachineSizeTypes = "Standard_D12_v2" - VirtualMachineSizeTypesStandardD13 VirtualMachineSizeTypes = "Standard_D13" - VirtualMachineSizeTypesStandardD13V2 VirtualMachineSizeTypes = "Standard_D13_v2" - VirtualMachineSizeTypesStandardD14 VirtualMachineSizeTypes = "Standard_D14" - VirtualMachineSizeTypesStandardD14V2 VirtualMachineSizeTypes = "Standard_D14_v2" - VirtualMachineSizeTypesStandardD15V2 VirtualMachineSizeTypes = "Standard_D15_v2" - VirtualMachineSizeTypesStandardD16SV3 VirtualMachineSizeTypes = "Standard_D16s_v3" - VirtualMachineSizeTypesStandardD16V3 VirtualMachineSizeTypes = "Standard_D16_v3" - VirtualMachineSizeTypesStandardD1V2 VirtualMachineSizeTypes = "Standard_D1_v2" - VirtualMachineSizeTypesStandardD2 VirtualMachineSizeTypes = "Standard_D2" - VirtualMachineSizeTypesStandardD2SV3 VirtualMachineSizeTypes = "Standard_D2s_v3" - VirtualMachineSizeTypesStandardD2V2 VirtualMachineSizeTypes = "Standard_D2_v2" - VirtualMachineSizeTypesStandardD2V3 VirtualMachineSizeTypes = "Standard_D2_v3" - VirtualMachineSizeTypesStandardD3 VirtualMachineSizeTypes = "Standard_D3" - VirtualMachineSizeTypesStandardD32SV3 VirtualMachineSizeTypes = "Standard_D32s_v3" - VirtualMachineSizeTypesStandardD32V3 VirtualMachineSizeTypes = "Standard_D32_v3" - VirtualMachineSizeTypesStandardD3V2 VirtualMachineSizeTypes = "Standard_D3_v2" - VirtualMachineSizeTypesStandardD4 VirtualMachineSizeTypes = "Standard_D4" - VirtualMachineSizeTypesStandardD4SV3 VirtualMachineSizeTypes = "Standard_D4s_v3" - VirtualMachineSizeTypesStandardD4V2 VirtualMachineSizeTypes = "Standard_D4_v2" - VirtualMachineSizeTypesStandardD4V3 VirtualMachineSizeTypes = "Standard_D4_v3" - VirtualMachineSizeTypesStandardD5V2 VirtualMachineSizeTypes = "Standard_D5_v2" - VirtualMachineSizeTypesStandardD64SV3 VirtualMachineSizeTypes = "Standard_D64s_v3" - VirtualMachineSizeTypesStandardD64V3 VirtualMachineSizeTypes = "Standard_D64_v3" - VirtualMachineSizeTypesStandardD8SV3 VirtualMachineSizeTypes = "Standard_D8s_v3" - VirtualMachineSizeTypesStandardD8V3 VirtualMachineSizeTypes = "Standard_D8_v3" - VirtualMachineSizeTypesStandardDS1 VirtualMachineSizeTypes = "Standard_DS1" - VirtualMachineSizeTypesStandardDS11 VirtualMachineSizeTypes = "Standard_DS11" - VirtualMachineSizeTypesStandardDS11V2 VirtualMachineSizeTypes = "Standard_DS11_v2" - VirtualMachineSizeTypesStandardDS12 VirtualMachineSizeTypes = "Standard_DS12" - VirtualMachineSizeTypesStandardDS12V2 VirtualMachineSizeTypes = "Standard_DS12_v2" - VirtualMachineSizeTypesStandardDS13 VirtualMachineSizeTypes = "Standard_DS13" - VirtualMachineSizeTypesStandardDS132V2 VirtualMachineSizeTypes = "Standard_DS13-2_v2" - VirtualMachineSizeTypesStandardDS134V2 VirtualMachineSizeTypes = "Standard_DS13-4_v2" - VirtualMachineSizeTypesStandardDS13V2 VirtualMachineSizeTypes = "Standard_DS13_v2" - VirtualMachineSizeTypesStandardDS14 VirtualMachineSizeTypes = "Standard_DS14" - VirtualMachineSizeTypesStandardDS144V2 VirtualMachineSizeTypes = "Standard_DS14-4_v2" - VirtualMachineSizeTypesStandardDS148V2 VirtualMachineSizeTypes = "Standard_DS14-8_v2" - VirtualMachineSizeTypesStandardDS14V2 VirtualMachineSizeTypes = "Standard_DS14_v2" - VirtualMachineSizeTypesStandardDS15V2 VirtualMachineSizeTypes = "Standard_DS15_v2" - VirtualMachineSizeTypesStandardDS1V2 VirtualMachineSizeTypes = "Standard_DS1_v2" - VirtualMachineSizeTypesStandardDS2 VirtualMachineSizeTypes = "Standard_DS2" - VirtualMachineSizeTypesStandardDS2V2 VirtualMachineSizeTypes = "Standard_DS2_v2" - VirtualMachineSizeTypesStandardDS3 VirtualMachineSizeTypes = "Standard_DS3" - VirtualMachineSizeTypesStandardDS3V2 VirtualMachineSizeTypes = "Standard_DS3_v2" - VirtualMachineSizeTypesStandardDS4 VirtualMachineSizeTypes = "Standard_DS4" - VirtualMachineSizeTypesStandardDS4V2 VirtualMachineSizeTypes = "Standard_DS4_v2" - VirtualMachineSizeTypesStandardDS5V2 VirtualMachineSizeTypes = "Standard_DS5_v2" - VirtualMachineSizeTypesStandardE16SV3 VirtualMachineSizeTypes = "Standard_E16s_v3" - VirtualMachineSizeTypesStandardE16V3 VirtualMachineSizeTypes = "Standard_E16_v3" - VirtualMachineSizeTypesStandardE2SV3 VirtualMachineSizeTypes = "Standard_E2s_v3" - VirtualMachineSizeTypesStandardE2V3 VirtualMachineSizeTypes = "Standard_E2_v3" - VirtualMachineSizeTypesStandardE3216V3 VirtualMachineSizeTypes = "Standard_E32-16_v3" - VirtualMachineSizeTypesStandardE328SV3 VirtualMachineSizeTypes = "Standard_E32-8s_v3" - VirtualMachineSizeTypesStandardE32SV3 VirtualMachineSizeTypes = "Standard_E32s_v3" - VirtualMachineSizeTypesStandardE32V3 VirtualMachineSizeTypes = "Standard_E32_v3" - VirtualMachineSizeTypesStandardE4SV3 VirtualMachineSizeTypes = "Standard_E4s_v3" - VirtualMachineSizeTypesStandardE4V3 VirtualMachineSizeTypes = "Standard_E4_v3" - VirtualMachineSizeTypesStandardE6416SV3 VirtualMachineSizeTypes = "Standard_E64-16s_v3" - VirtualMachineSizeTypesStandardE6432SV3 VirtualMachineSizeTypes = "Standard_E64-32s_v3" - VirtualMachineSizeTypesStandardE64SV3 VirtualMachineSizeTypes = "Standard_E64s_v3" - VirtualMachineSizeTypesStandardE64V3 VirtualMachineSizeTypes = "Standard_E64_v3" - VirtualMachineSizeTypesStandardE8SV3 VirtualMachineSizeTypes = "Standard_E8s_v3" - VirtualMachineSizeTypesStandardE8V3 VirtualMachineSizeTypes = "Standard_E8_v3" - VirtualMachineSizeTypesStandardF1 VirtualMachineSizeTypes = "Standard_F1" - VirtualMachineSizeTypesStandardF16 VirtualMachineSizeTypes = "Standard_F16" - VirtualMachineSizeTypesStandardF16S VirtualMachineSizeTypes = "Standard_F16s" - VirtualMachineSizeTypesStandardF16SV2 VirtualMachineSizeTypes = "Standard_F16s_v2" - VirtualMachineSizeTypesStandardF1S VirtualMachineSizeTypes = "Standard_F1s" - VirtualMachineSizeTypesStandardF2 VirtualMachineSizeTypes = "Standard_F2" - VirtualMachineSizeTypesStandardF2S VirtualMachineSizeTypes = "Standard_F2s" - VirtualMachineSizeTypesStandardF2SV2 VirtualMachineSizeTypes = "Standard_F2s_v2" - VirtualMachineSizeTypesStandardF32SV2 VirtualMachineSizeTypes = "Standard_F32s_v2" - VirtualMachineSizeTypesStandardF4 VirtualMachineSizeTypes = "Standard_F4" - VirtualMachineSizeTypesStandardF4S VirtualMachineSizeTypes = "Standard_F4s" - VirtualMachineSizeTypesStandardF4SV2 VirtualMachineSizeTypes = "Standard_F4s_v2" - VirtualMachineSizeTypesStandardF64SV2 VirtualMachineSizeTypes = "Standard_F64s_v2" - VirtualMachineSizeTypesStandardF72SV2 VirtualMachineSizeTypes = "Standard_F72s_v2" - VirtualMachineSizeTypesStandardF8 VirtualMachineSizeTypes = "Standard_F8" - VirtualMachineSizeTypesStandardF8S VirtualMachineSizeTypes = "Standard_F8s" - VirtualMachineSizeTypesStandardF8SV2 VirtualMachineSizeTypes = "Standard_F8s_v2" - VirtualMachineSizeTypesStandardG1 VirtualMachineSizeTypes = "Standard_G1" - VirtualMachineSizeTypesStandardG2 VirtualMachineSizeTypes = "Standard_G2" - VirtualMachineSizeTypesStandardG3 VirtualMachineSizeTypes = "Standard_G3" - VirtualMachineSizeTypesStandardG4 VirtualMachineSizeTypes = "Standard_G4" - VirtualMachineSizeTypesStandardG5 VirtualMachineSizeTypes = "Standard_G5" - VirtualMachineSizeTypesStandardGS1 VirtualMachineSizeTypes = "Standard_GS1" - VirtualMachineSizeTypesStandardGS2 VirtualMachineSizeTypes = "Standard_GS2" - VirtualMachineSizeTypesStandardGS3 VirtualMachineSizeTypes = "Standard_GS3" - VirtualMachineSizeTypesStandardGS4 VirtualMachineSizeTypes = "Standard_GS4" - VirtualMachineSizeTypesStandardGS44 VirtualMachineSizeTypes = "Standard_GS4-4" - VirtualMachineSizeTypesStandardGS48 VirtualMachineSizeTypes = "Standard_GS4-8" - VirtualMachineSizeTypesStandardGS5 VirtualMachineSizeTypes = "Standard_GS5" - VirtualMachineSizeTypesStandardGS516 VirtualMachineSizeTypes = "Standard_GS5-16" - VirtualMachineSizeTypesStandardGS58 VirtualMachineSizeTypes = "Standard_GS5-8" - VirtualMachineSizeTypesStandardH16 VirtualMachineSizeTypes = "Standard_H16" - VirtualMachineSizeTypesStandardH16M VirtualMachineSizeTypes = "Standard_H16m" - VirtualMachineSizeTypesStandardH16Mr VirtualMachineSizeTypes = "Standard_H16mr" - VirtualMachineSizeTypesStandardH16R VirtualMachineSizeTypes = "Standard_H16r" - VirtualMachineSizeTypesStandardH8 VirtualMachineSizeTypes = "Standard_H8" - VirtualMachineSizeTypesStandardH8M VirtualMachineSizeTypes = "Standard_H8m" - VirtualMachineSizeTypesStandardL16S VirtualMachineSizeTypes = "Standard_L16s" - VirtualMachineSizeTypesStandardL32S VirtualMachineSizeTypes = "Standard_L32s" - VirtualMachineSizeTypesStandardL4S VirtualMachineSizeTypes = "Standard_L4s" - VirtualMachineSizeTypesStandardL8S VirtualMachineSizeTypes = "Standard_L8s" - VirtualMachineSizeTypesStandardM12832Ms VirtualMachineSizeTypes = "Standard_M128-32ms" - VirtualMachineSizeTypesStandardM12864Ms VirtualMachineSizeTypes = "Standard_M128-64ms" - VirtualMachineSizeTypesStandardM128Ms VirtualMachineSizeTypes = "Standard_M128ms" - VirtualMachineSizeTypesStandardM128S VirtualMachineSizeTypes = "Standard_M128s" - VirtualMachineSizeTypesStandardM6416Ms VirtualMachineSizeTypes = "Standard_M64-16ms" - VirtualMachineSizeTypesStandardM6432Ms VirtualMachineSizeTypes = "Standard_M64-32ms" - VirtualMachineSizeTypesStandardM64Ms VirtualMachineSizeTypes = "Standard_M64ms" - VirtualMachineSizeTypesStandardM64S VirtualMachineSizeTypes = "Standard_M64s" - VirtualMachineSizeTypesStandardNC12 VirtualMachineSizeTypes = "Standard_NC12" - VirtualMachineSizeTypesStandardNC12SV2 VirtualMachineSizeTypes = "Standard_NC12s_v2" - VirtualMachineSizeTypesStandardNC12SV3 VirtualMachineSizeTypes = "Standard_NC12s_v3" - VirtualMachineSizeTypesStandardNC24 VirtualMachineSizeTypes = "Standard_NC24" - VirtualMachineSizeTypesStandardNC24R VirtualMachineSizeTypes = "Standard_NC24r" - VirtualMachineSizeTypesStandardNC24RsV2 VirtualMachineSizeTypes = "Standard_NC24rs_v2" - VirtualMachineSizeTypesStandardNC24RsV3 VirtualMachineSizeTypes = "Standard_NC24rs_v3" - VirtualMachineSizeTypesStandardNC24SV2 VirtualMachineSizeTypes = "Standard_NC24s_v2" - VirtualMachineSizeTypesStandardNC24SV3 VirtualMachineSizeTypes = "Standard_NC24s_v3" - VirtualMachineSizeTypesStandardNC6 VirtualMachineSizeTypes = "Standard_NC6" - VirtualMachineSizeTypesStandardNC6SV2 VirtualMachineSizeTypes = "Standard_NC6s_v2" - VirtualMachineSizeTypesStandardNC6SV3 VirtualMachineSizeTypes = "Standard_NC6s_v3" - VirtualMachineSizeTypesStandardND12S VirtualMachineSizeTypes = "Standard_ND12s" - VirtualMachineSizeTypesStandardND24Rs VirtualMachineSizeTypes = "Standard_ND24rs" - VirtualMachineSizeTypesStandardND24S VirtualMachineSizeTypes = "Standard_ND24s" - VirtualMachineSizeTypesStandardND6S VirtualMachineSizeTypes = "Standard_ND6s" - VirtualMachineSizeTypesStandardNV12 VirtualMachineSizeTypes = "Standard_NV12" - VirtualMachineSizeTypesStandardNV24 VirtualMachineSizeTypes = "Standard_NV24" - VirtualMachineSizeTypesStandardNV6 VirtualMachineSizeTypes = "Standard_NV6" -) - -// PossibleVirtualMachineSizeTypesValues returns the 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, - } -} - -// WindowsPatchAssessmentMode - Specifies the mode of VM Guest patch assessment for the IaaS virtual machine. -// Possible values are: -// ImageDefault - You control the timing of patch assessments on a virtual machine. -// AutomaticByPlatform - The platform will trigger periodic patch assessments. The property provisionVMAgent must be true. -type WindowsPatchAssessmentMode string - -const ( - WindowsPatchAssessmentModeAutomaticByPlatform WindowsPatchAssessmentMode = "AutomaticByPlatform" - WindowsPatchAssessmentModeImageDefault WindowsPatchAssessmentMode = "ImageDefault" -) - -// PossibleWindowsPatchAssessmentModeValues returns the possible values for the WindowsPatchAssessmentMode const type. -func PossibleWindowsPatchAssessmentModeValues() []WindowsPatchAssessmentMode { - return []WindowsPatchAssessmentMode{ - WindowsPatchAssessmentModeAutomaticByPlatform, - WindowsPatchAssessmentModeImageDefault, - } -} - -// WindowsVMGuestPatchAutomaticByPlatformRebootSetting - Specifies the reboot setting for all AutomaticByPlatform patch installation -// operations. -type WindowsVMGuestPatchAutomaticByPlatformRebootSetting string - -const ( - WindowsVMGuestPatchAutomaticByPlatformRebootSettingAlways WindowsVMGuestPatchAutomaticByPlatformRebootSetting = "Always" - WindowsVMGuestPatchAutomaticByPlatformRebootSettingIfRequired WindowsVMGuestPatchAutomaticByPlatformRebootSetting = "IfRequired" - WindowsVMGuestPatchAutomaticByPlatformRebootSettingNever WindowsVMGuestPatchAutomaticByPlatformRebootSetting = "Never" - WindowsVMGuestPatchAutomaticByPlatformRebootSettingUnknown WindowsVMGuestPatchAutomaticByPlatformRebootSetting = "Unknown" -) - -// PossibleWindowsVMGuestPatchAutomaticByPlatformRebootSettingValues returns the possible values for the WindowsVMGuestPatchAutomaticByPlatformRebootSetting const type. -func PossibleWindowsVMGuestPatchAutomaticByPlatformRebootSettingValues() []WindowsVMGuestPatchAutomaticByPlatformRebootSetting { - return []WindowsVMGuestPatchAutomaticByPlatformRebootSetting{ - WindowsVMGuestPatchAutomaticByPlatformRebootSettingAlways, - WindowsVMGuestPatchAutomaticByPlatformRebootSettingIfRequired, - WindowsVMGuestPatchAutomaticByPlatformRebootSettingNever, - WindowsVMGuestPatchAutomaticByPlatformRebootSettingUnknown, - } -} - -// WindowsVMGuestPatchMode - Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual machines associated -// to virtual machine scale set with OrchestrationMode as Flexible. -// Possible values are: -// Manual - You control the application of patches to a virtual machine. You do this by applying patches manually inside the -// VM. In this mode, automatic updates are disabled; the property -// WindowsConfiguration.enableAutomaticUpdates must be false -// AutomaticByOS - The virtual machine will automatically be updated by the OS. The property WindowsConfiguration.enableAutomaticUpdates -// must be true. -// AutomaticByPlatform - the virtual machine will automatically updated by the platform. The properties provisionVMAgent and -// WindowsConfiguration.enableAutomaticUpdates must be true -type WindowsVMGuestPatchMode string - -const ( - WindowsVMGuestPatchModeAutomaticByOS WindowsVMGuestPatchMode = "AutomaticByOS" - WindowsVMGuestPatchModeAutomaticByPlatform WindowsVMGuestPatchMode = "AutomaticByPlatform" - WindowsVMGuestPatchModeManual WindowsVMGuestPatchMode = "Manual" -) - -// PossibleWindowsVMGuestPatchModeValues returns the possible values for the WindowsVMGuestPatchMode const type. -func PossibleWindowsVMGuestPatchModeValues() []WindowsVMGuestPatchMode { - return []WindowsVMGuestPatchMode{ - WindowsVMGuestPatchModeAutomaticByOS, - WindowsVMGuestPatchModeAutomaticByPlatform, - WindowsVMGuestPatchModeManual, - } -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_dedicatedhostgroups_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_dedicatedhostgroups_client.go deleted file mode 100644 index 0b8447c4..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_dedicatedhostgroups_client.go +++ /dev/null @@ -1,407 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// DedicatedHostGroupsClient contains the methods for the DedicatedHostGroups group. -// Don't use this type directly, use NewDedicatedHostGroupsClient() instead. -type DedicatedHostGroupsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewDedicatedHostGroupsClient creates a new instance of DedicatedHostGroupsClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewDedicatedHostGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DedicatedHostGroupsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &DedicatedHostGroupsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// CreateOrUpdate - Create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please -// see Dedicated Host Documentation [https://go.microsoft.com/fwlink/?linkid=2082596] -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// hostGroupName - The name of the dedicated host group. -// parameters - Parameters supplied to the Create Dedicated Host Group. -// options - DedicatedHostGroupsClientCreateOrUpdateOptions contains the optional parameters for the DedicatedHostGroupsClient.CreateOrUpdate -// method. -func (client *DedicatedHostGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, hostGroupName string, parameters DedicatedHostGroup, options *DedicatedHostGroupsClientCreateOrUpdateOptions) (DedicatedHostGroupsClientCreateOrUpdateResponse, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, hostGroupName, parameters, options) - if err != nil { - return DedicatedHostGroupsClientCreateOrUpdateResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return DedicatedHostGroupsClientCreateOrUpdateResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return DedicatedHostGroupsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) - } - return client.createOrUpdateHandleResponse(resp) -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *DedicatedHostGroupsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, hostGroupName string, parameters DedicatedHostGroup, options *DedicatedHostGroupsClientCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if hostGroupName == "" { - return nil, errors.New("parameter hostGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{hostGroupName}", url.PathEscape(hostGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// createOrUpdateHandleResponse handles the CreateOrUpdate response. -func (client *DedicatedHostGroupsClient) createOrUpdateHandleResponse(resp *http.Response) (DedicatedHostGroupsClientCreateOrUpdateResponse, error) { - result := DedicatedHostGroupsClientCreateOrUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DedicatedHostGroup); err != nil { - return DedicatedHostGroupsClientCreateOrUpdateResponse{}, err - } - return result, nil -} - -// Delete - Delete a dedicated host group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// hostGroupName - The name of the dedicated host group. -// options - DedicatedHostGroupsClientDeleteOptions contains the optional parameters for the DedicatedHostGroupsClient.Delete -// method. -func (client *DedicatedHostGroupsClient) Delete(ctx context.Context, resourceGroupName string, hostGroupName string, options *DedicatedHostGroupsClientDeleteOptions) (DedicatedHostGroupsClientDeleteResponse, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, hostGroupName, options) - if err != nil { - return DedicatedHostGroupsClientDeleteResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return DedicatedHostGroupsClientDeleteResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return DedicatedHostGroupsClientDeleteResponse{}, runtime.NewResponseError(resp) - } - return DedicatedHostGroupsClientDeleteResponse{}, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *DedicatedHostGroupsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, hostGroupName string, options *DedicatedHostGroupsClientDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if hostGroupName == "" { - return nil, errors.New("parameter hostGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{hostGroupName}", url.PathEscape(hostGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Retrieves information about a dedicated host group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// hostGroupName - The name of the dedicated host group. -// options - DedicatedHostGroupsClientGetOptions contains the optional parameters for the DedicatedHostGroupsClient.Get method. -func (client *DedicatedHostGroupsClient) Get(ctx context.Context, resourceGroupName string, hostGroupName string, options *DedicatedHostGroupsClientGetOptions) (DedicatedHostGroupsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, hostGroupName, options) - if err != nil { - return DedicatedHostGroupsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return DedicatedHostGroupsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DedicatedHostGroupsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *DedicatedHostGroupsClient) getCreateRequest(ctx context.Context, resourceGroupName string, hostGroupName string, options *DedicatedHostGroupsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if hostGroupName == "" { - return nil, errors.New("parameter hostGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{hostGroupName}", url.PathEscape(hostGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", string(*options.Expand)) - } - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *DedicatedHostGroupsClient) getHandleResponse(resp *http.Response) (DedicatedHostGroupsClientGetResponse, error) { - result := DedicatedHostGroupsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DedicatedHostGroup); err != nil { - return DedicatedHostGroupsClientGetResponse{}, err - } - return result, nil -} - -// NewListByResourceGroupPager - Lists all of the dedicated host groups in the specified resource group. Use the nextLink -// property in the response to get the next page of dedicated host groups. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// options - DedicatedHostGroupsClientListByResourceGroupOptions contains the optional parameters for the DedicatedHostGroupsClient.ListByResourceGroup -// method. -func (client *DedicatedHostGroupsClient) NewListByResourceGroupPager(resourceGroupName string, options *DedicatedHostGroupsClientListByResourceGroupOptions) *runtime.Pager[DedicatedHostGroupsClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[DedicatedHostGroupsClientListByResourceGroupResponse]{ - More: func(page DedicatedHostGroupsClientListByResourceGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *DedicatedHostGroupsClientListByResourceGroupResponse) (DedicatedHostGroupsClientListByResourceGroupResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return DedicatedHostGroupsClientListByResourceGroupResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return DedicatedHostGroupsClientListByResourceGroupResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DedicatedHostGroupsClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) - } - return client.listByResourceGroupHandleResponse(resp) - }, - }) -} - -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *DedicatedHostGroupsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *DedicatedHostGroupsClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *DedicatedHostGroupsClient) listByResourceGroupHandleResponse(resp *http.Response) (DedicatedHostGroupsClientListByResourceGroupResponse, error) { - result := DedicatedHostGroupsClientListByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DedicatedHostGroupListResult); err != nil { - return DedicatedHostGroupsClientListByResourceGroupResponse{}, err - } - return result, nil -} - -// NewListBySubscriptionPager - Lists all of the dedicated host groups in the subscription. Use the nextLink property in the -// response to get the next page of dedicated host groups. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// options - DedicatedHostGroupsClientListBySubscriptionOptions contains the optional parameters for the DedicatedHostGroupsClient.ListBySubscription -// method. -func (client *DedicatedHostGroupsClient) NewListBySubscriptionPager(options *DedicatedHostGroupsClientListBySubscriptionOptions) *runtime.Pager[DedicatedHostGroupsClientListBySubscriptionResponse] { - return runtime.NewPager(runtime.PagingHandler[DedicatedHostGroupsClientListBySubscriptionResponse]{ - More: func(page DedicatedHostGroupsClientListBySubscriptionResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *DedicatedHostGroupsClientListBySubscriptionResponse) (DedicatedHostGroupsClientListBySubscriptionResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listBySubscriptionCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return DedicatedHostGroupsClientListBySubscriptionResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return DedicatedHostGroupsClientListBySubscriptionResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DedicatedHostGroupsClientListBySubscriptionResponse{}, runtime.NewResponseError(resp) - } - return client.listBySubscriptionHandleResponse(resp) - }, - }) -} - -// listBySubscriptionCreateRequest creates the ListBySubscription request. -func (client *DedicatedHostGroupsClient) listBySubscriptionCreateRequest(ctx context.Context, options *DedicatedHostGroupsClientListBySubscriptionOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/hostGroups" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listBySubscriptionHandleResponse handles the ListBySubscription response. -func (client *DedicatedHostGroupsClient) listBySubscriptionHandleResponse(resp *http.Response) (DedicatedHostGroupsClientListBySubscriptionResponse, error) { - result := DedicatedHostGroupsClientListBySubscriptionResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DedicatedHostGroupListResult); err != nil { - return DedicatedHostGroupsClientListBySubscriptionResponse{}, err - } - return result, nil -} - -// Update - Update an dedicated host group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// hostGroupName - The name of the dedicated host group. -// parameters - Parameters supplied to the Update Dedicated Host Group operation. -// options - DedicatedHostGroupsClientUpdateOptions contains the optional parameters for the DedicatedHostGroupsClient.Update -// method. -func (client *DedicatedHostGroupsClient) Update(ctx context.Context, resourceGroupName string, hostGroupName string, parameters DedicatedHostGroupUpdate, options *DedicatedHostGroupsClientUpdateOptions) (DedicatedHostGroupsClientUpdateResponse, error) { - req, err := client.updateCreateRequest(ctx, resourceGroupName, hostGroupName, parameters, options) - if err != nil { - return DedicatedHostGroupsClientUpdateResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return DedicatedHostGroupsClientUpdateResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DedicatedHostGroupsClientUpdateResponse{}, runtime.NewResponseError(resp) - } - return client.updateHandleResponse(resp) -} - -// updateCreateRequest creates the Update request. -func (client *DedicatedHostGroupsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, hostGroupName string, parameters DedicatedHostGroupUpdate, options *DedicatedHostGroupsClientUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if hostGroupName == "" { - return nil, errors.New("parameter hostGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{hostGroupName}", url.PathEscape(hostGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// updateHandleResponse handles the Update response. -func (client *DedicatedHostGroupsClient) updateHandleResponse(resp *http.Response) (DedicatedHostGroupsClientUpdateResponse, error) { - result := DedicatedHostGroupsClientUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DedicatedHostGroup); err != nil { - return DedicatedHostGroupsClientUpdateResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_dedicatedhosts_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_dedicatedhosts_client.go deleted file mode 100644 index 25f0e294..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_dedicatedhosts_client.go +++ /dev/null @@ -1,471 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// DedicatedHostsClient contains the methods for the DedicatedHosts group. -// Don't use this type directly, use NewDedicatedHostsClient() instead. -type DedicatedHostsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewDedicatedHostsClient creates a new instance of DedicatedHostsClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewDedicatedHostsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DedicatedHostsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &DedicatedHostsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Create or update a dedicated host . -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// hostGroupName - The name of the dedicated host group. -// hostName - The name of the dedicated host . -// parameters - Parameters supplied to the Create Dedicated Host. -// options - DedicatedHostsClientBeginCreateOrUpdateOptions contains the optional parameters for the DedicatedHostsClient.BeginCreateOrUpdate -// method. -func (client *DedicatedHostsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, parameters DedicatedHost, options *DedicatedHostsClientBeginCreateOrUpdateOptions) (*runtime.Poller[DedicatedHostsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, hostGroupName, hostName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[DedicatedHostsClientCreateOrUpdateResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[DedicatedHostsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Create or update a dedicated host . -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *DedicatedHostsClient) createOrUpdate(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, parameters DedicatedHost, options *DedicatedHostsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, hostGroupName, hostName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *DedicatedHostsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, parameters DedicatedHost, options *DedicatedHostsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if hostGroupName == "" { - return nil, errors.New("parameter hostGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{hostGroupName}", url.PathEscape(hostGroupName)) - if hostName == "" { - return nil, errors.New("parameter hostName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{hostName}", url.PathEscape(hostName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginDelete - Delete a dedicated host. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// hostGroupName - The name of the dedicated host group. -// hostName - The name of the dedicated host. -// options - DedicatedHostsClientBeginDeleteOptions contains the optional parameters for the DedicatedHostsClient.BeginDelete -// method. -func (client *DedicatedHostsClient) BeginDelete(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, options *DedicatedHostsClientBeginDeleteOptions) (*runtime.Poller[DedicatedHostsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, hostGroupName, hostName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[DedicatedHostsClientDeleteResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[DedicatedHostsClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Delete a dedicated host. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *DedicatedHostsClient) deleteOperation(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, options *DedicatedHostsClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, hostGroupName, hostName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *DedicatedHostsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, options *DedicatedHostsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if hostGroupName == "" { - return nil, errors.New("parameter hostGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{hostGroupName}", url.PathEscape(hostGroupName)) - if hostName == "" { - return nil, errors.New("parameter hostName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{hostName}", url.PathEscape(hostName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Retrieves information about a dedicated host. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// hostGroupName - The name of the dedicated host group. -// hostName - The name of the dedicated host. -// options - DedicatedHostsClientGetOptions contains the optional parameters for the DedicatedHostsClient.Get method. -func (client *DedicatedHostsClient) Get(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, options *DedicatedHostsClientGetOptions) (DedicatedHostsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, hostGroupName, hostName, options) - if err != nil { - return DedicatedHostsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return DedicatedHostsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DedicatedHostsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *DedicatedHostsClient) getCreateRequest(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, options *DedicatedHostsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if hostGroupName == "" { - return nil, errors.New("parameter hostGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{hostGroupName}", url.PathEscape(hostGroupName)) - if hostName == "" { - return nil, errors.New("parameter hostName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{hostName}", url.PathEscape(hostName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", string(*options.Expand)) - } - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *DedicatedHostsClient) getHandleResponse(resp *http.Response) (DedicatedHostsClientGetResponse, error) { - result := DedicatedHostsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DedicatedHost); err != nil { - return DedicatedHostsClientGetResponse{}, err - } - return result, nil -} - -// NewListByHostGroupPager - Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property -// in the response to get the next page of dedicated hosts. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// hostGroupName - The name of the dedicated host group. -// options - DedicatedHostsClientListByHostGroupOptions contains the optional parameters for the DedicatedHostsClient.ListByHostGroup -// method. -func (client *DedicatedHostsClient) NewListByHostGroupPager(resourceGroupName string, hostGroupName string, options *DedicatedHostsClientListByHostGroupOptions) *runtime.Pager[DedicatedHostsClientListByHostGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[DedicatedHostsClientListByHostGroupResponse]{ - More: func(page DedicatedHostsClientListByHostGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *DedicatedHostsClientListByHostGroupResponse) (DedicatedHostsClientListByHostGroupResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByHostGroupCreateRequest(ctx, resourceGroupName, hostGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return DedicatedHostsClientListByHostGroupResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return DedicatedHostsClientListByHostGroupResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DedicatedHostsClientListByHostGroupResponse{}, runtime.NewResponseError(resp) - } - return client.listByHostGroupHandleResponse(resp) - }, - }) -} - -// listByHostGroupCreateRequest creates the ListByHostGroup request. -func (client *DedicatedHostsClient) listByHostGroupCreateRequest(ctx context.Context, resourceGroupName string, hostGroupName string, options *DedicatedHostsClientListByHostGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if hostGroupName == "" { - return nil, errors.New("parameter hostGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{hostGroupName}", url.PathEscape(hostGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByHostGroupHandleResponse handles the ListByHostGroup response. -func (client *DedicatedHostsClient) listByHostGroupHandleResponse(resp *http.Response) (DedicatedHostsClientListByHostGroupResponse, error) { - result := DedicatedHostsClientListByHostGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DedicatedHostListResult); err != nil { - return DedicatedHostsClientListByHostGroupResponse{}, err - } - return result, nil -} - -// BeginRestart - Restart the dedicated host. The operation will complete successfully once the dedicated host has restarted -// and is running. To determine the health of VMs deployed on the dedicated host after the -// restart check the Resource Health Center in the Azure Portal. Please refer to https://docs.microsoft.com/en-us/azure/service-health/resource-health-overview -// for more details. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// hostGroupName - The name of the dedicated host group. -// hostName - The name of the dedicated host. -// options - DedicatedHostsClientBeginRestartOptions contains the optional parameters for the DedicatedHostsClient.BeginRestart -// method. -func (client *DedicatedHostsClient) BeginRestart(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, options *DedicatedHostsClientBeginRestartOptions) (*runtime.Poller[DedicatedHostsClientRestartResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.restart(ctx, resourceGroupName, hostGroupName, hostName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[DedicatedHostsClientRestartResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[DedicatedHostsClientRestartResponse](options.ResumeToken, client.pl, nil) - } -} - -// Restart - Restart the dedicated host. The operation will complete successfully once the dedicated host has restarted and -// is running. To determine the health of VMs deployed on the dedicated host after the -// restart check the Resource Health Center in the Azure Portal. Please refer to https://docs.microsoft.com/en-us/azure/service-health/resource-health-overview -// for more details. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *DedicatedHostsClient) restart(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, options *DedicatedHostsClientBeginRestartOptions) (*http.Response, error) { - req, err := client.restartCreateRequest(ctx, resourceGroupName, hostGroupName, hostName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// restartCreateRequest creates the Restart request. -func (client *DedicatedHostsClient) restartCreateRequest(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, options *DedicatedHostsClientBeginRestartOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}/restart" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if hostGroupName == "" { - return nil, errors.New("parameter hostGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{hostGroupName}", url.PathEscape(hostGroupName)) - if hostName == "" { - return nil, errors.New("parameter hostName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{hostName}", url.PathEscape(hostName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginUpdate - Update an dedicated host . -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// hostGroupName - The name of the dedicated host group. -// hostName - The name of the dedicated host . -// parameters - Parameters supplied to the Update Dedicated Host operation. -// options - DedicatedHostsClientBeginUpdateOptions contains the optional parameters for the DedicatedHostsClient.BeginUpdate -// method. -func (client *DedicatedHostsClient) BeginUpdate(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, parameters DedicatedHostUpdate, options *DedicatedHostsClientBeginUpdateOptions) (*runtime.Poller[DedicatedHostsClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, hostGroupName, hostName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[DedicatedHostsClientUpdateResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[DedicatedHostsClientUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// Update - Update an dedicated host . -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *DedicatedHostsClient) update(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, parameters DedicatedHostUpdate, options *DedicatedHostsClientBeginUpdateOptions) (*http.Response, error) { - req, err := client.updateCreateRequest(ctx, resourceGroupName, hostGroupName, hostName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// updateCreateRequest creates the Update request. -func (client *DedicatedHostsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, parameters DedicatedHostUpdate, options *DedicatedHostsClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if hostGroupName == "" { - return nil, errors.New("parameter hostGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{hostGroupName}", url.PathEscape(hostGroupName)) - if hostName == "" { - return nil, errors.New("parameter hostName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{hostName}", url.PathEscape(hostName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_diskaccesses_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_diskaccesses_client.go deleted file mode 100644 index d0d85b5e..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_diskaccesses_client.go +++ /dev/null @@ -1,774 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// DiskAccessesClient contains the methods for the DiskAccesses group. -// Don't use this type directly, use NewDiskAccessesClient() instead. -type DiskAccessesClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewDiskAccessesClient creates a new instance of DiskAccessesClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewDiskAccessesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DiskAccessesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &DiskAccessesClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates a disk access resource -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 -// resourceGroupName - The name of the resource group. -// diskAccessName - The name of the disk access resource that is being created. The name can't be changed after the disk encryption -// set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The -// maximum name length is 80 characters. -// diskAccess - disk access object supplied in the body of the Put disk access operation. -// options - DiskAccessesClientBeginCreateOrUpdateOptions contains the optional parameters for the DiskAccessesClient.BeginCreateOrUpdate -// method. -func (client *DiskAccessesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, diskAccessName string, diskAccess DiskAccess, options *DiskAccessesClientBeginCreateOrUpdateOptions) (*runtime.Poller[DiskAccessesClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, diskAccessName, diskAccess, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[DiskAccessesClientCreateOrUpdateResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[DiskAccessesClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates or updates a disk access resource -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 -func (client *DiskAccessesClient) createOrUpdate(ctx context.Context, resourceGroupName string, diskAccessName string, diskAccess DiskAccess, options *DiskAccessesClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, diskAccessName, diskAccess, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *DiskAccessesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, diskAccessName string, diskAccess DiskAccess, options *DiskAccessesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if diskAccessName == "" { - return nil, errors.New("parameter diskAccessName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskAccessName}", url.PathEscape(diskAccessName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, diskAccess) -} - -// BeginDelete - Deletes a disk access resource. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 -// resourceGroupName - The name of the resource group. -// diskAccessName - The name of the disk access resource that is being created. The name can't be changed after the disk encryption -// set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The -// maximum name length is 80 characters. -// options - DiskAccessesClientBeginDeleteOptions contains the optional parameters for the DiskAccessesClient.BeginDelete -// method. -func (client *DiskAccessesClient) BeginDelete(ctx context.Context, resourceGroupName string, diskAccessName string, options *DiskAccessesClientBeginDeleteOptions) (*runtime.Poller[DiskAccessesClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, diskAccessName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[DiskAccessesClientDeleteResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[DiskAccessesClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes a disk access resource. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 -func (client *DiskAccessesClient) deleteOperation(ctx context.Context, resourceGroupName string, diskAccessName string, options *DiskAccessesClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, diskAccessName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *DiskAccessesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, diskAccessName string, options *DiskAccessesClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if diskAccessName == "" { - return nil, errors.New("parameter diskAccessName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskAccessName}", url.PathEscape(diskAccessName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginDeleteAPrivateEndpointConnection - Deletes a private endpoint connection under a disk access resource. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 -// resourceGroupName - The name of the resource group. -// diskAccessName - The name of the disk access resource that is being created. The name can't be changed after the disk encryption -// set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The -// maximum name length is 80 characters. -// privateEndpointConnectionName - The name of the private endpoint connection. -// options - DiskAccessesClientBeginDeleteAPrivateEndpointConnectionOptions contains the optional parameters for the DiskAccessesClient.BeginDeleteAPrivateEndpointConnection -// method. -func (client *DiskAccessesClient) BeginDeleteAPrivateEndpointConnection(ctx context.Context, resourceGroupName string, diskAccessName string, privateEndpointConnectionName string, options *DiskAccessesClientBeginDeleteAPrivateEndpointConnectionOptions) (*runtime.Poller[DiskAccessesClientDeleteAPrivateEndpointConnectionResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteAPrivateEndpointConnection(ctx, resourceGroupName, diskAccessName, privateEndpointConnectionName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[DiskAccessesClientDeleteAPrivateEndpointConnectionResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[DiskAccessesClientDeleteAPrivateEndpointConnectionResponse](options.ResumeToken, client.pl, nil) - } -} - -// DeleteAPrivateEndpointConnection - Deletes a private endpoint connection under a disk access resource. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 -func (client *DiskAccessesClient) deleteAPrivateEndpointConnection(ctx context.Context, resourceGroupName string, diskAccessName string, privateEndpointConnectionName string, options *DiskAccessesClientBeginDeleteAPrivateEndpointConnectionOptions) (*http.Response, error) { - req, err := client.deleteAPrivateEndpointConnectionCreateRequest(ctx, resourceGroupName, diskAccessName, privateEndpointConnectionName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteAPrivateEndpointConnectionCreateRequest creates the DeleteAPrivateEndpointConnection request. -func (client *DiskAccessesClient) deleteAPrivateEndpointConnectionCreateRequest(ctx context.Context, resourceGroupName string, diskAccessName string, privateEndpointConnectionName string, options *DiskAccessesClientBeginDeleteAPrivateEndpointConnectionOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections/{privateEndpointConnectionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if diskAccessName == "" { - return nil, errors.New("parameter diskAccessName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskAccessName}", url.PathEscape(diskAccessName)) - if privateEndpointConnectionName == "" { - return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets information about a disk access resource. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 -// resourceGroupName - The name of the resource group. -// diskAccessName - The name of the disk access resource that is being created. The name can't be changed after the disk encryption -// set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The -// maximum name length is 80 characters. -// options - DiskAccessesClientGetOptions contains the optional parameters for the DiskAccessesClient.Get method. -func (client *DiskAccessesClient) Get(ctx context.Context, resourceGroupName string, diskAccessName string, options *DiskAccessesClientGetOptions) (DiskAccessesClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, diskAccessName, options) - if err != nil { - return DiskAccessesClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return DiskAccessesClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DiskAccessesClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *DiskAccessesClient) getCreateRequest(ctx context.Context, resourceGroupName string, diskAccessName string, options *DiskAccessesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if diskAccessName == "" { - return nil, errors.New("parameter diskAccessName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskAccessName}", url.PathEscape(diskAccessName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *DiskAccessesClient) getHandleResponse(resp *http.Response) (DiskAccessesClientGetResponse, error) { - result := DiskAccessesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DiskAccess); err != nil { - return DiskAccessesClientGetResponse{}, err - } - return result, nil -} - -// GetAPrivateEndpointConnection - Gets information about a private endpoint connection under a disk access resource. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 -// resourceGroupName - The name of the resource group. -// diskAccessName - The name of the disk access resource that is being created. The name can't be changed after the disk encryption -// set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The -// maximum name length is 80 characters. -// privateEndpointConnectionName - The name of the private endpoint connection. -// options - DiskAccessesClientGetAPrivateEndpointConnectionOptions contains the optional parameters for the DiskAccessesClient.GetAPrivateEndpointConnection -// method. -func (client *DiskAccessesClient) GetAPrivateEndpointConnection(ctx context.Context, resourceGroupName string, diskAccessName string, privateEndpointConnectionName string, options *DiskAccessesClientGetAPrivateEndpointConnectionOptions) (DiskAccessesClientGetAPrivateEndpointConnectionResponse, error) { - req, err := client.getAPrivateEndpointConnectionCreateRequest(ctx, resourceGroupName, diskAccessName, privateEndpointConnectionName, options) - if err != nil { - return DiskAccessesClientGetAPrivateEndpointConnectionResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return DiskAccessesClientGetAPrivateEndpointConnectionResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DiskAccessesClientGetAPrivateEndpointConnectionResponse{}, runtime.NewResponseError(resp) - } - return client.getAPrivateEndpointConnectionHandleResponse(resp) -} - -// getAPrivateEndpointConnectionCreateRequest creates the GetAPrivateEndpointConnection request. -func (client *DiskAccessesClient) getAPrivateEndpointConnectionCreateRequest(ctx context.Context, resourceGroupName string, diskAccessName string, privateEndpointConnectionName string, options *DiskAccessesClientGetAPrivateEndpointConnectionOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections/{privateEndpointConnectionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if diskAccessName == "" { - return nil, errors.New("parameter diskAccessName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskAccessName}", url.PathEscape(diskAccessName)) - if privateEndpointConnectionName == "" { - return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getAPrivateEndpointConnectionHandleResponse handles the GetAPrivateEndpointConnection response. -func (client *DiskAccessesClient) getAPrivateEndpointConnectionHandleResponse(resp *http.Response) (DiskAccessesClientGetAPrivateEndpointConnectionResponse, error) { - result := DiskAccessesClientGetAPrivateEndpointConnectionResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnection); err != nil { - return DiskAccessesClientGetAPrivateEndpointConnectionResponse{}, err - } - return result, nil -} - -// GetPrivateLinkResources - Gets the private link resources possible under disk access resource -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 -// resourceGroupName - The name of the resource group. -// diskAccessName - The name of the disk access resource that is being created. The name can't be changed after the disk encryption -// set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The -// maximum name length is 80 characters. -// options - DiskAccessesClientGetPrivateLinkResourcesOptions contains the optional parameters for the DiskAccessesClient.GetPrivateLinkResources -// method. -func (client *DiskAccessesClient) GetPrivateLinkResources(ctx context.Context, resourceGroupName string, diskAccessName string, options *DiskAccessesClientGetPrivateLinkResourcesOptions) (DiskAccessesClientGetPrivateLinkResourcesResponse, error) { - req, err := client.getPrivateLinkResourcesCreateRequest(ctx, resourceGroupName, diskAccessName, options) - if err != nil { - return DiskAccessesClientGetPrivateLinkResourcesResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return DiskAccessesClientGetPrivateLinkResourcesResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DiskAccessesClientGetPrivateLinkResourcesResponse{}, runtime.NewResponseError(resp) - } - return client.getPrivateLinkResourcesHandleResponse(resp) -} - -// getPrivateLinkResourcesCreateRequest creates the GetPrivateLinkResources request. -func (client *DiskAccessesClient) getPrivateLinkResourcesCreateRequest(ctx context.Context, resourceGroupName string, diskAccessName string, options *DiskAccessesClientGetPrivateLinkResourcesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateLinkResources" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if diskAccessName == "" { - return nil, errors.New("parameter diskAccessName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskAccessName}", url.PathEscape(diskAccessName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getPrivateLinkResourcesHandleResponse handles the GetPrivateLinkResources response. -func (client *DiskAccessesClient) getPrivateLinkResourcesHandleResponse(resp *http.Response) (DiskAccessesClientGetPrivateLinkResourcesResponse, error) { - result := DiskAccessesClientGetPrivateLinkResourcesResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.PrivateLinkResourceListResult); err != nil { - return DiskAccessesClientGetPrivateLinkResourcesResponse{}, err - } - return result, nil -} - -// NewListPager - Lists all the disk access resources under a subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 -// options - DiskAccessesClientListOptions contains the optional parameters for the DiskAccessesClient.List method. -func (client *DiskAccessesClient) NewListPager(options *DiskAccessesClientListOptions) *runtime.Pager[DiskAccessesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[DiskAccessesClientListResponse]{ - More: func(page DiskAccessesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *DiskAccessesClientListResponse) (DiskAccessesClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return DiskAccessesClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return DiskAccessesClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DiskAccessesClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *DiskAccessesClient) listCreateRequest(ctx context.Context, options *DiskAccessesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/diskAccesses" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *DiskAccessesClient) listHandleResponse(resp *http.Response) (DiskAccessesClientListResponse, error) { - result := DiskAccessesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DiskAccessList); err != nil { - return DiskAccessesClientListResponse{}, err - } - return result, nil -} - -// NewListByResourceGroupPager - Lists all the disk access resources under a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 -// resourceGroupName - The name of the resource group. -// options - DiskAccessesClientListByResourceGroupOptions contains the optional parameters for the DiskAccessesClient.ListByResourceGroup -// method. -func (client *DiskAccessesClient) NewListByResourceGroupPager(resourceGroupName string, options *DiskAccessesClientListByResourceGroupOptions) *runtime.Pager[DiskAccessesClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[DiskAccessesClientListByResourceGroupResponse]{ - More: func(page DiskAccessesClientListByResourceGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *DiskAccessesClientListByResourceGroupResponse) (DiskAccessesClientListByResourceGroupResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return DiskAccessesClientListByResourceGroupResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return DiskAccessesClientListByResourceGroupResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DiskAccessesClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) - } - return client.listByResourceGroupHandleResponse(resp) - }, - }) -} - -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *DiskAccessesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *DiskAccessesClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *DiskAccessesClient) listByResourceGroupHandleResponse(resp *http.Response) (DiskAccessesClientListByResourceGroupResponse, error) { - result := DiskAccessesClientListByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DiskAccessList); err != nil { - return DiskAccessesClientListByResourceGroupResponse{}, err - } - return result, nil -} - -// NewListPrivateEndpointConnectionsPager - List information about private endpoint connections under a disk access resource -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 -// resourceGroupName - The name of the resource group. -// diskAccessName - The name of the disk access resource that is being created. The name can't be changed after the disk encryption -// set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The -// maximum name length is 80 characters. -// options - DiskAccessesClientListPrivateEndpointConnectionsOptions contains the optional parameters for the DiskAccessesClient.ListPrivateEndpointConnections -// method. -func (client *DiskAccessesClient) NewListPrivateEndpointConnectionsPager(resourceGroupName string, diskAccessName string, options *DiskAccessesClientListPrivateEndpointConnectionsOptions) *runtime.Pager[DiskAccessesClientListPrivateEndpointConnectionsResponse] { - return runtime.NewPager(runtime.PagingHandler[DiskAccessesClientListPrivateEndpointConnectionsResponse]{ - More: func(page DiskAccessesClientListPrivateEndpointConnectionsResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *DiskAccessesClientListPrivateEndpointConnectionsResponse) (DiskAccessesClientListPrivateEndpointConnectionsResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listPrivateEndpointConnectionsCreateRequest(ctx, resourceGroupName, diskAccessName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return DiskAccessesClientListPrivateEndpointConnectionsResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return DiskAccessesClientListPrivateEndpointConnectionsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DiskAccessesClientListPrivateEndpointConnectionsResponse{}, runtime.NewResponseError(resp) - } - return client.listPrivateEndpointConnectionsHandleResponse(resp) - }, - }) -} - -// listPrivateEndpointConnectionsCreateRequest creates the ListPrivateEndpointConnections request. -func (client *DiskAccessesClient) listPrivateEndpointConnectionsCreateRequest(ctx context.Context, resourceGroupName string, diskAccessName string, options *DiskAccessesClientListPrivateEndpointConnectionsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if diskAccessName == "" { - return nil, errors.New("parameter diskAccessName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskAccessName}", url.PathEscape(diskAccessName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listPrivateEndpointConnectionsHandleResponse handles the ListPrivateEndpointConnections response. -func (client *DiskAccessesClient) listPrivateEndpointConnectionsHandleResponse(resp *http.Response) (DiskAccessesClientListPrivateEndpointConnectionsResponse, error) { - result := DiskAccessesClientListPrivateEndpointConnectionsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnectionListResult); err != nil { - return DiskAccessesClientListPrivateEndpointConnectionsResponse{}, err - } - return result, nil -} - -// BeginUpdate - Updates (patches) a disk access resource. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 -// resourceGroupName - The name of the resource group. -// diskAccessName - The name of the disk access resource that is being created. The name can't be changed after the disk encryption -// set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The -// maximum name length is 80 characters. -// diskAccess - disk access object supplied in the body of the Patch disk access operation. -// options - DiskAccessesClientBeginUpdateOptions contains the optional parameters for the DiskAccessesClient.BeginUpdate -// method. -func (client *DiskAccessesClient) BeginUpdate(ctx context.Context, resourceGroupName string, diskAccessName string, diskAccess DiskAccessUpdate, options *DiskAccessesClientBeginUpdateOptions) (*runtime.Poller[DiskAccessesClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, diskAccessName, diskAccess, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[DiskAccessesClientUpdateResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[DiskAccessesClientUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// Update - Updates (patches) a disk access resource. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 -func (client *DiskAccessesClient) update(ctx context.Context, resourceGroupName string, diskAccessName string, diskAccess DiskAccessUpdate, options *DiskAccessesClientBeginUpdateOptions) (*http.Response, error) { - req, err := client.updateCreateRequest(ctx, resourceGroupName, diskAccessName, diskAccess, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// updateCreateRequest creates the Update request. -func (client *DiskAccessesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, diskAccessName string, diskAccess DiskAccessUpdate, options *DiskAccessesClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if diskAccessName == "" { - return nil, errors.New("parameter diskAccessName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskAccessName}", url.PathEscape(diskAccessName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, diskAccess) -} - -// BeginUpdateAPrivateEndpointConnection - Approve or reject a private endpoint connection under disk access resource, this -// can't be used to create a new private endpoint connection. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 -// resourceGroupName - The name of the resource group. -// diskAccessName - The name of the disk access resource that is being created. The name can't be changed after the disk encryption -// set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The -// maximum name length is 80 characters. -// privateEndpointConnectionName - The name of the private endpoint connection. -// privateEndpointConnection - private endpoint connection object supplied in the body of the Put private endpoint connection -// operation. -// options - DiskAccessesClientBeginUpdateAPrivateEndpointConnectionOptions contains the optional parameters for the DiskAccessesClient.BeginUpdateAPrivateEndpointConnection -// method. -func (client *DiskAccessesClient) BeginUpdateAPrivateEndpointConnection(ctx context.Context, resourceGroupName string, diskAccessName string, privateEndpointConnectionName string, privateEndpointConnection PrivateEndpointConnection, options *DiskAccessesClientBeginUpdateAPrivateEndpointConnectionOptions) (*runtime.Poller[DiskAccessesClientUpdateAPrivateEndpointConnectionResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.updateAPrivateEndpointConnection(ctx, resourceGroupName, diskAccessName, privateEndpointConnectionName, privateEndpointConnection, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[DiskAccessesClientUpdateAPrivateEndpointConnectionResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[DiskAccessesClientUpdateAPrivateEndpointConnectionResponse](options.ResumeToken, client.pl, nil) - } -} - -// UpdateAPrivateEndpointConnection - Approve or reject a private endpoint connection under disk access resource, this can't -// be used to create a new private endpoint connection. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 -func (client *DiskAccessesClient) updateAPrivateEndpointConnection(ctx context.Context, resourceGroupName string, diskAccessName string, privateEndpointConnectionName string, privateEndpointConnection PrivateEndpointConnection, options *DiskAccessesClientBeginUpdateAPrivateEndpointConnectionOptions) (*http.Response, error) { - req, err := client.updateAPrivateEndpointConnectionCreateRequest(ctx, resourceGroupName, diskAccessName, privateEndpointConnectionName, privateEndpointConnection, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// updateAPrivateEndpointConnectionCreateRequest creates the UpdateAPrivateEndpointConnection request. -func (client *DiskAccessesClient) updateAPrivateEndpointConnectionCreateRequest(ctx context.Context, resourceGroupName string, diskAccessName string, privateEndpointConnectionName string, privateEndpointConnection PrivateEndpointConnection, options *DiskAccessesClientBeginUpdateAPrivateEndpointConnectionOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections/{privateEndpointConnectionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if diskAccessName == "" { - return nil, errors.New("parameter diskAccessName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskAccessName}", url.PathEscape(diskAccessName)) - if privateEndpointConnectionName == "" { - return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, privateEndpointConnection) -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_diskencryptionsets_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_diskencryptionsets_client.go deleted file mode 100644 index 77c4430f..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_diskencryptionsets_client.go +++ /dev/null @@ -1,507 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// DiskEncryptionSetsClient contains the methods for the DiskEncryptionSets group. -// Don't use this type directly, use NewDiskEncryptionSetsClient() instead. -type DiskEncryptionSetsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewDiskEncryptionSetsClient creates a new instance of DiskEncryptionSetsClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewDiskEncryptionSetsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DiskEncryptionSetsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &DiskEncryptionSetsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates a disk encryption set -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 -// resourceGroupName - The name of the resource group. -// diskEncryptionSetName - The name of the disk encryption set that is being created. The name can't be changed after the -// disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum -// name length is 80 characters. -// diskEncryptionSet - disk encryption set object supplied in the body of the Put disk encryption set operation. -// options - DiskEncryptionSetsClientBeginCreateOrUpdateOptions contains the optional parameters for the DiskEncryptionSetsClient.BeginCreateOrUpdate -// method. -func (client *DiskEncryptionSetsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, diskEncryptionSet DiskEncryptionSet, options *DiskEncryptionSetsClientBeginCreateOrUpdateOptions) (*runtime.Poller[DiskEncryptionSetsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, diskEncryptionSetName, diskEncryptionSet, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[DiskEncryptionSetsClientCreateOrUpdateResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[DiskEncryptionSetsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates or updates a disk encryption set -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 -func (client *DiskEncryptionSetsClient) createOrUpdate(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, diskEncryptionSet DiskEncryptionSet, options *DiskEncryptionSetsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, diskEncryptionSetName, diskEncryptionSet, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *DiskEncryptionSetsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, diskEncryptionSet DiskEncryptionSet, options *DiskEncryptionSetsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if diskEncryptionSetName == "" { - return nil, errors.New("parameter diskEncryptionSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskEncryptionSetName}", url.PathEscape(diskEncryptionSetName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, diskEncryptionSet) -} - -// BeginDelete - Deletes a disk encryption set. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 -// resourceGroupName - The name of the resource group. -// diskEncryptionSetName - The name of the disk encryption set that is being created. The name can't be changed after the -// disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum -// name length is 80 characters. -// options - DiskEncryptionSetsClientBeginDeleteOptions contains the optional parameters for the DiskEncryptionSetsClient.BeginDelete -// method. -func (client *DiskEncryptionSetsClient) BeginDelete(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, options *DiskEncryptionSetsClientBeginDeleteOptions) (*runtime.Poller[DiskEncryptionSetsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, diskEncryptionSetName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[DiskEncryptionSetsClientDeleteResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[DiskEncryptionSetsClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes a disk encryption set. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 -func (client *DiskEncryptionSetsClient) deleteOperation(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, options *DiskEncryptionSetsClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, diskEncryptionSetName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *DiskEncryptionSetsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, options *DiskEncryptionSetsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if diskEncryptionSetName == "" { - return nil, errors.New("parameter diskEncryptionSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskEncryptionSetName}", url.PathEscape(diskEncryptionSetName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets information about a disk encryption set. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 -// resourceGroupName - The name of the resource group. -// diskEncryptionSetName - The name of the disk encryption set that is being created. The name can't be changed after the -// disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum -// name length is 80 characters. -// options - DiskEncryptionSetsClientGetOptions contains the optional parameters for the DiskEncryptionSetsClient.Get method. -func (client *DiskEncryptionSetsClient) Get(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, options *DiskEncryptionSetsClientGetOptions) (DiskEncryptionSetsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, diskEncryptionSetName, options) - if err != nil { - return DiskEncryptionSetsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return DiskEncryptionSetsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DiskEncryptionSetsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *DiskEncryptionSetsClient) getCreateRequest(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, options *DiskEncryptionSetsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if diskEncryptionSetName == "" { - return nil, errors.New("parameter diskEncryptionSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskEncryptionSetName}", url.PathEscape(diskEncryptionSetName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *DiskEncryptionSetsClient) getHandleResponse(resp *http.Response) (DiskEncryptionSetsClientGetResponse, error) { - result := DiskEncryptionSetsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DiskEncryptionSet); err != nil { - return DiskEncryptionSetsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Lists all the disk encryption sets under a subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 -// options - DiskEncryptionSetsClientListOptions contains the optional parameters for the DiskEncryptionSetsClient.List method. -func (client *DiskEncryptionSetsClient) NewListPager(options *DiskEncryptionSetsClientListOptions) *runtime.Pager[DiskEncryptionSetsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[DiskEncryptionSetsClientListResponse]{ - More: func(page DiskEncryptionSetsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *DiskEncryptionSetsClientListResponse) (DiskEncryptionSetsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return DiskEncryptionSetsClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return DiskEncryptionSetsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DiskEncryptionSetsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *DiskEncryptionSetsClient) listCreateRequest(ctx context.Context, options *DiskEncryptionSetsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/diskEncryptionSets" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *DiskEncryptionSetsClient) listHandleResponse(resp *http.Response) (DiskEncryptionSetsClientListResponse, error) { - result := DiskEncryptionSetsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DiskEncryptionSetList); err != nil { - return DiskEncryptionSetsClientListResponse{}, err - } - return result, nil -} - -// NewListAssociatedResourcesPager - Lists all resources that are encrypted with this disk encryption set. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 -// resourceGroupName - The name of the resource group. -// diskEncryptionSetName - The name of the disk encryption set that is being created. The name can't be changed after the -// disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum -// name length is 80 characters. -// options - DiskEncryptionSetsClientListAssociatedResourcesOptions contains the optional parameters for the DiskEncryptionSetsClient.ListAssociatedResources -// method. -func (client *DiskEncryptionSetsClient) NewListAssociatedResourcesPager(resourceGroupName string, diskEncryptionSetName string, options *DiskEncryptionSetsClientListAssociatedResourcesOptions) *runtime.Pager[DiskEncryptionSetsClientListAssociatedResourcesResponse] { - return runtime.NewPager(runtime.PagingHandler[DiskEncryptionSetsClientListAssociatedResourcesResponse]{ - More: func(page DiskEncryptionSetsClientListAssociatedResourcesResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *DiskEncryptionSetsClientListAssociatedResourcesResponse) (DiskEncryptionSetsClientListAssociatedResourcesResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listAssociatedResourcesCreateRequest(ctx, resourceGroupName, diskEncryptionSetName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return DiskEncryptionSetsClientListAssociatedResourcesResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return DiskEncryptionSetsClientListAssociatedResourcesResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DiskEncryptionSetsClientListAssociatedResourcesResponse{}, runtime.NewResponseError(resp) - } - return client.listAssociatedResourcesHandleResponse(resp) - }, - }) -} - -// listAssociatedResourcesCreateRequest creates the ListAssociatedResources request. -func (client *DiskEncryptionSetsClient) listAssociatedResourcesCreateRequest(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, options *DiskEncryptionSetsClientListAssociatedResourcesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}/associatedResources" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if diskEncryptionSetName == "" { - return nil, errors.New("parameter diskEncryptionSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskEncryptionSetName}", url.PathEscape(diskEncryptionSetName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listAssociatedResourcesHandleResponse handles the ListAssociatedResources response. -func (client *DiskEncryptionSetsClient) listAssociatedResourcesHandleResponse(resp *http.Response) (DiskEncryptionSetsClientListAssociatedResourcesResponse, error) { - result := DiskEncryptionSetsClientListAssociatedResourcesResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ResourceURIList); err != nil { - return DiskEncryptionSetsClientListAssociatedResourcesResponse{}, err - } - return result, nil -} - -// NewListByResourceGroupPager - Lists all the disk encryption sets under a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 -// resourceGroupName - The name of the resource group. -// options - DiskEncryptionSetsClientListByResourceGroupOptions contains the optional parameters for the DiskEncryptionSetsClient.ListByResourceGroup -// method. -func (client *DiskEncryptionSetsClient) NewListByResourceGroupPager(resourceGroupName string, options *DiskEncryptionSetsClientListByResourceGroupOptions) *runtime.Pager[DiskEncryptionSetsClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[DiskEncryptionSetsClientListByResourceGroupResponse]{ - More: func(page DiskEncryptionSetsClientListByResourceGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *DiskEncryptionSetsClientListByResourceGroupResponse) (DiskEncryptionSetsClientListByResourceGroupResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return DiskEncryptionSetsClientListByResourceGroupResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return DiskEncryptionSetsClientListByResourceGroupResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DiskEncryptionSetsClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) - } - return client.listByResourceGroupHandleResponse(resp) - }, - }) -} - -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *DiskEncryptionSetsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *DiskEncryptionSetsClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *DiskEncryptionSetsClient) listByResourceGroupHandleResponse(resp *http.Response) (DiskEncryptionSetsClientListByResourceGroupResponse, error) { - result := DiskEncryptionSetsClientListByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DiskEncryptionSetList); err != nil { - return DiskEncryptionSetsClientListByResourceGroupResponse{}, err - } - return result, nil -} - -// BeginUpdate - Updates (patches) a disk encryption set. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 -// resourceGroupName - The name of the resource group. -// diskEncryptionSetName - The name of the disk encryption set that is being created. The name can't be changed after the -// disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum -// name length is 80 characters. -// diskEncryptionSet - disk encryption set object supplied in the body of the Patch disk encryption set operation. -// options - DiskEncryptionSetsClientBeginUpdateOptions contains the optional parameters for the DiskEncryptionSetsClient.BeginUpdate -// method. -func (client *DiskEncryptionSetsClient) BeginUpdate(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, diskEncryptionSet DiskEncryptionSetUpdate, options *DiskEncryptionSetsClientBeginUpdateOptions) (*runtime.Poller[DiskEncryptionSetsClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, diskEncryptionSetName, diskEncryptionSet, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[DiskEncryptionSetsClientUpdateResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[DiskEncryptionSetsClientUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// Update - Updates (patches) a disk encryption set. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 -func (client *DiskEncryptionSetsClient) update(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, diskEncryptionSet DiskEncryptionSetUpdate, options *DiskEncryptionSetsClientBeginUpdateOptions) (*http.Response, error) { - req, err := client.updateCreateRequest(ctx, resourceGroupName, diskEncryptionSetName, diskEncryptionSet, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// updateCreateRequest creates the Update request. -func (client *DiskEncryptionSetsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, diskEncryptionSet DiskEncryptionSetUpdate, options *DiskEncryptionSetsClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if diskEncryptionSetName == "" { - return nil, errors.New("parameter diskEncryptionSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskEncryptionSetName}", url.PathEscape(diskEncryptionSetName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, diskEncryptionSet) -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_diskrestorepoint_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_diskrestorepoint_client.go deleted file mode 100644 index 82b47b22..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_diskrestorepoint_client.go +++ /dev/null @@ -1,348 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// DiskRestorePointClient contains the methods for the DiskRestorePoint group. -// Don't use this type directly, use NewDiskRestorePointClient() instead. -type DiskRestorePointClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewDiskRestorePointClient creates a new instance of DiskRestorePointClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewDiskRestorePointClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DiskRestorePointClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &DiskRestorePointClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// Get - Get disk restorePoint resource -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 -// resourceGroupName - The name of the resource group. -// restorePointCollectionName - The name of the restore point collection that the disk restore point belongs. -// vmRestorePointName - The name of the vm restore point that the disk disk restore point belongs. -// diskRestorePointName - The name of the disk restore point created. -// options - DiskRestorePointClientGetOptions contains the optional parameters for the DiskRestorePointClient.Get method. -func (client *DiskRestorePointClient) Get(ctx context.Context, resourceGroupName string, restorePointCollectionName string, vmRestorePointName string, diskRestorePointName string, options *DiskRestorePointClientGetOptions) (DiskRestorePointClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName, options) - if err != nil { - return DiskRestorePointClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return DiskRestorePointClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DiskRestorePointClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *DiskRestorePointClient) getCreateRequest(ctx context.Context, resourceGroupName string, restorePointCollectionName string, vmRestorePointName string, diskRestorePointName string, options *DiskRestorePointClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints/{diskRestorePointName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if restorePointCollectionName == "" { - return nil, errors.New("parameter restorePointCollectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{restorePointCollectionName}", url.PathEscape(restorePointCollectionName)) - if vmRestorePointName == "" { - return nil, errors.New("parameter vmRestorePointName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmRestorePointName}", url.PathEscape(vmRestorePointName)) - if diskRestorePointName == "" { - return nil, errors.New("parameter diskRestorePointName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskRestorePointName}", url.PathEscape(diskRestorePointName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *DiskRestorePointClient) getHandleResponse(resp *http.Response) (DiskRestorePointClientGetResponse, error) { - result := DiskRestorePointClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DiskRestorePoint); err != nil { - return DiskRestorePointClientGetResponse{}, err - } - return result, nil -} - -// BeginGrantAccess - Grants access to a diskRestorePoint. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 -// resourceGroupName - The name of the resource group. -// restorePointCollectionName - The name of the restore point collection that the disk restore point belongs. -// vmRestorePointName - The name of the vm restore point that the disk disk restore point belongs. -// diskRestorePointName - The name of the disk restore point created. -// grantAccessData - Access data object supplied in the body of the get disk access operation. -// options - DiskRestorePointClientBeginGrantAccessOptions contains the optional parameters for the DiskRestorePointClient.BeginGrantAccess -// method. -func (client *DiskRestorePointClient) BeginGrantAccess(ctx context.Context, resourceGroupName string, restorePointCollectionName string, vmRestorePointName string, diskRestorePointName string, grantAccessData GrantAccessData, options *DiskRestorePointClientBeginGrantAccessOptions) (*runtime.Poller[DiskRestorePointClientGrantAccessResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.grantAccess(ctx, resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName, grantAccessData, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[DiskRestorePointClientGrantAccessResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[DiskRestorePointClientGrantAccessResponse](options.ResumeToken, client.pl, nil) - } -} - -// GrantAccess - Grants access to a diskRestorePoint. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 -func (client *DiskRestorePointClient) grantAccess(ctx context.Context, resourceGroupName string, restorePointCollectionName string, vmRestorePointName string, diskRestorePointName string, grantAccessData GrantAccessData, options *DiskRestorePointClientBeginGrantAccessOptions) (*http.Response, error) { - req, err := client.grantAccessCreateRequest(ctx, resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName, grantAccessData, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// grantAccessCreateRequest creates the GrantAccess request. -func (client *DiskRestorePointClient) grantAccessCreateRequest(ctx context.Context, resourceGroupName string, restorePointCollectionName string, vmRestorePointName string, diskRestorePointName string, grantAccessData GrantAccessData, options *DiskRestorePointClientBeginGrantAccessOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints/{diskRestorePointName}/beginGetAccess" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if restorePointCollectionName == "" { - return nil, errors.New("parameter restorePointCollectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{restorePointCollectionName}", url.PathEscape(restorePointCollectionName)) - if vmRestorePointName == "" { - return nil, errors.New("parameter vmRestorePointName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmRestorePointName}", url.PathEscape(vmRestorePointName)) - if diskRestorePointName == "" { - return nil, errors.New("parameter diskRestorePointName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskRestorePointName}", url.PathEscape(diskRestorePointName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, grantAccessData) -} - -// NewListByRestorePointPager - Lists diskRestorePoints under a vmRestorePoint. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 -// resourceGroupName - The name of the resource group. -// restorePointCollectionName - The name of the restore point collection that the disk restore point belongs. -// vmRestorePointName - The name of the vm restore point that the disk disk restore point belongs. -// options - DiskRestorePointClientListByRestorePointOptions contains the optional parameters for the DiskRestorePointClient.ListByRestorePoint -// method. -func (client *DiskRestorePointClient) NewListByRestorePointPager(resourceGroupName string, restorePointCollectionName string, vmRestorePointName string, options *DiskRestorePointClientListByRestorePointOptions) *runtime.Pager[DiskRestorePointClientListByRestorePointResponse] { - return runtime.NewPager(runtime.PagingHandler[DiskRestorePointClientListByRestorePointResponse]{ - More: func(page DiskRestorePointClientListByRestorePointResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *DiskRestorePointClientListByRestorePointResponse) (DiskRestorePointClientListByRestorePointResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByRestorePointCreateRequest(ctx, resourceGroupName, restorePointCollectionName, vmRestorePointName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return DiskRestorePointClientListByRestorePointResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return DiskRestorePointClientListByRestorePointResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DiskRestorePointClientListByRestorePointResponse{}, runtime.NewResponseError(resp) - } - return client.listByRestorePointHandleResponse(resp) - }, - }) -} - -// listByRestorePointCreateRequest creates the ListByRestorePoint request. -func (client *DiskRestorePointClient) listByRestorePointCreateRequest(ctx context.Context, resourceGroupName string, restorePointCollectionName string, vmRestorePointName string, options *DiskRestorePointClientListByRestorePointOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if restorePointCollectionName == "" { - return nil, errors.New("parameter restorePointCollectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{restorePointCollectionName}", url.PathEscape(restorePointCollectionName)) - if vmRestorePointName == "" { - return nil, errors.New("parameter vmRestorePointName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmRestorePointName}", url.PathEscape(vmRestorePointName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByRestorePointHandleResponse handles the ListByRestorePoint response. -func (client *DiskRestorePointClient) listByRestorePointHandleResponse(resp *http.Response) (DiskRestorePointClientListByRestorePointResponse, error) { - result := DiskRestorePointClientListByRestorePointResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DiskRestorePointList); err != nil { - return DiskRestorePointClientListByRestorePointResponse{}, err - } - return result, nil -} - -// BeginRevokeAccess - Revokes access to a diskRestorePoint. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 -// resourceGroupName - The name of the resource group. -// restorePointCollectionName - The name of the restore point collection that the disk restore point belongs. -// vmRestorePointName - The name of the vm restore point that the disk disk restore point belongs. -// diskRestorePointName - The name of the disk restore point created. -// options - DiskRestorePointClientBeginRevokeAccessOptions contains the optional parameters for the DiskRestorePointClient.BeginRevokeAccess -// method. -func (client *DiskRestorePointClient) BeginRevokeAccess(ctx context.Context, resourceGroupName string, restorePointCollectionName string, vmRestorePointName string, diskRestorePointName string, options *DiskRestorePointClientBeginRevokeAccessOptions) (*runtime.Poller[DiskRestorePointClientRevokeAccessResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.revokeAccess(ctx, resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[DiskRestorePointClientRevokeAccessResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[DiskRestorePointClientRevokeAccessResponse](options.ResumeToken, client.pl, nil) - } -} - -// RevokeAccess - Revokes access to a diskRestorePoint. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 -func (client *DiskRestorePointClient) revokeAccess(ctx context.Context, resourceGroupName string, restorePointCollectionName string, vmRestorePointName string, diskRestorePointName string, options *DiskRestorePointClientBeginRevokeAccessOptions) (*http.Response, error) { - req, err := client.revokeAccessCreateRequest(ctx, resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// revokeAccessCreateRequest creates the RevokeAccess request. -func (client *DiskRestorePointClient) revokeAccessCreateRequest(ctx context.Context, resourceGroupName string, restorePointCollectionName string, vmRestorePointName string, diskRestorePointName string, options *DiskRestorePointClientBeginRevokeAccessOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints/{diskRestorePointName}/endGetAccess" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if restorePointCollectionName == "" { - return nil, errors.New("parameter restorePointCollectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{restorePointCollectionName}", url.PathEscape(restorePointCollectionName)) - if vmRestorePointName == "" { - return nil, errors.New("parameter vmRestorePointName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmRestorePointName}", url.PathEscape(vmRestorePointName)) - if diskRestorePointName == "" { - return nil, errors.New("parameter diskRestorePointName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskRestorePointName}", url.PathEscape(diskRestorePointName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_disks_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_disks_client.go deleted file mode 100644 index 37965463..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_disks_client.go +++ /dev/null @@ -1,564 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// DisksClient contains the methods for the Disks group. -// Don't use this type directly, use NewDisksClient() instead. -type DisksClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewDisksClient creates a new instance of DisksClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewDisksClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DisksClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &DisksClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates a disk. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 -// resourceGroupName - The name of the resource group. -// diskName - 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 - Disk object supplied in the body of the Put disk operation. -// options - DisksClientBeginCreateOrUpdateOptions contains the optional parameters for the DisksClient.BeginCreateOrUpdate -// method. -func (client *DisksClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, diskName string, disk Disk, options *DisksClientBeginCreateOrUpdateOptions) (*runtime.Poller[DisksClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, diskName, disk, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[DisksClientCreateOrUpdateResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[DisksClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates or updates a disk. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 -func (client *DisksClient) createOrUpdate(ctx context.Context, resourceGroupName string, diskName string, disk Disk, options *DisksClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, diskName, disk, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *DisksClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, diskName string, disk Disk, options *DisksClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if diskName == "" { - return nil, errors.New("parameter diskName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskName}", url.PathEscape(diskName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, disk) -} - -// BeginDelete - Deletes a disk. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 -// resourceGroupName - The name of the resource group. -// diskName - 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. -// options - DisksClientBeginDeleteOptions contains the optional parameters for the DisksClient.BeginDelete method. -func (client *DisksClient) BeginDelete(ctx context.Context, resourceGroupName string, diskName string, options *DisksClientBeginDeleteOptions) (*runtime.Poller[DisksClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, diskName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[DisksClientDeleteResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[DisksClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes a disk. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 -func (client *DisksClient) deleteOperation(ctx context.Context, resourceGroupName string, diskName string, options *DisksClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, diskName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *DisksClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, diskName string, options *DisksClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if diskName == "" { - return nil, errors.New("parameter diskName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskName}", url.PathEscape(diskName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") - req.Raw().URL.RawQuery = reqQP.Encode() - return req, nil -} - -// Get - Gets information about a disk. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 -// resourceGroupName - The name of the resource group. -// diskName - 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. -// options - DisksClientGetOptions contains the optional parameters for the DisksClient.Get method. -func (client *DisksClient) Get(ctx context.Context, resourceGroupName string, diskName string, options *DisksClientGetOptions) (DisksClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, diskName, options) - if err != nil { - return DisksClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return DisksClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DisksClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *DisksClient) getCreateRequest(ctx context.Context, resourceGroupName string, diskName string, options *DisksClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if diskName == "" { - return nil, errors.New("parameter diskName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskName}", url.PathEscape(diskName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *DisksClient) getHandleResponse(resp *http.Response) (DisksClientGetResponse, error) { - result := DisksClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.Disk); err != nil { - return DisksClientGetResponse{}, err - } - return result, nil -} - -// BeginGrantAccess - Grants access to a disk. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 -// resourceGroupName - The name of the resource group. -// diskName - 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 - Access data object supplied in the body of the get disk access operation. -// options - DisksClientBeginGrantAccessOptions contains the optional parameters for the DisksClient.BeginGrantAccess method. -func (client *DisksClient) BeginGrantAccess(ctx context.Context, resourceGroupName string, diskName string, grantAccessData GrantAccessData, options *DisksClientBeginGrantAccessOptions) (*runtime.Poller[DisksClientGrantAccessResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.grantAccess(ctx, resourceGroupName, diskName, grantAccessData, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[DisksClientGrantAccessResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[DisksClientGrantAccessResponse](options.ResumeToken, client.pl, nil) - } -} - -// GrantAccess - Grants access to a disk. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 -func (client *DisksClient) grantAccess(ctx context.Context, resourceGroupName string, diskName string, grantAccessData GrantAccessData, options *DisksClientBeginGrantAccessOptions) (*http.Response, error) { - req, err := client.grantAccessCreateRequest(ctx, resourceGroupName, diskName, grantAccessData, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// grantAccessCreateRequest creates the GrantAccess request. -func (client *DisksClient) grantAccessCreateRequest(ctx context.Context, resourceGroupName string, diskName string, grantAccessData GrantAccessData, options *DisksClientBeginGrantAccessOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/beginGetAccess" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if diskName == "" { - return nil, errors.New("parameter diskName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskName}", url.PathEscape(diskName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, grantAccessData) -} - -// NewListPager - Lists all the disks under a subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 -// options - DisksClientListOptions contains the optional parameters for the DisksClient.List method. -func (client *DisksClient) NewListPager(options *DisksClientListOptions) *runtime.Pager[DisksClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[DisksClientListResponse]{ - More: func(page DisksClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *DisksClientListResponse) (DisksClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return DisksClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return DisksClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DisksClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *DisksClient) listCreateRequest(ctx context.Context, options *DisksClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/disks" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *DisksClient) listHandleResponse(resp *http.Response) (DisksClientListResponse, error) { - result := DisksClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DiskList); err != nil { - return DisksClientListResponse{}, err - } - return result, nil -} - -// NewListByResourceGroupPager - Lists all the disks under a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 -// resourceGroupName - The name of the resource group. -// options - DisksClientListByResourceGroupOptions contains the optional parameters for the DisksClient.ListByResourceGroup -// method. -func (client *DisksClient) NewListByResourceGroupPager(resourceGroupName string, options *DisksClientListByResourceGroupOptions) *runtime.Pager[DisksClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[DisksClientListByResourceGroupResponse]{ - More: func(page DisksClientListByResourceGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *DisksClientListByResourceGroupResponse) (DisksClientListByResourceGroupResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return DisksClientListByResourceGroupResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return DisksClientListByResourceGroupResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DisksClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) - } - return client.listByResourceGroupHandleResponse(resp) - }, - }) -} - -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *DisksClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *DisksClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *DisksClient) listByResourceGroupHandleResponse(resp *http.Response) (DisksClientListByResourceGroupResponse, error) { - result := DisksClientListByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DiskList); err != nil { - return DisksClientListByResourceGroupResponse{}, err - } - return result, nil -} - -// BeginRevokeAccess - Revokes access to a disk. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 -// resourceGroupName - The name of the resource group. -// diskName - 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. -// options - DisksClientBeginRevokeAccessOptions contains the optional parameters for the DisksClient.BeginRevokeAccess method. -func (client *DisksClient) BeginRevokeAccess(ctx context.Context, resourceGroupName string, diskName string, options *DisksClientBeginRevokeAccessOptions) (*runtime.Poller[DisksClientRevokeAccessResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.revokeAccess(ctx, resourceGroupName, diskName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[DisksClientRevokeAccessResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[DisksClientRevokeAccessResponse](options.ResumeToken, client.pl, nil) - } -} - -// RevokeAccess - Revokes access to a disk. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 -func (client *DisksClient) revokeAccess(ctx context.Context, resourceGroupName string, diskName string, options *DisksClientBeginRevokeAccessOptions) (*http.Response, error) { - req, err := client.revokeAccessCreateRequest(ctx, resourceGroupName, diskName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// revokeAccessCreateRequest creates the RevokeAccess request. -func (client *DisksClient) revokeAccessCreateRequest(ctx context.Context, resourceGroupName string, diskName string, options *DisksClientBeginRevokeAccessOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/endGetAccess" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if diskName == "" { - return nil, errors.New("parameter diskName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskName}", url.PathEscape(diskName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") - req.Raw().URL.RawQuery = reqQP.Encode() - return req, nil -} - -// BeginUpdate - Updates (patches) a disk. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 -// resourceGroupName - The name of the resource group. -// diskName - 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 - Disk object supplied in the body of the Patch disk operation. -// options - DisksClientBeginUpdateOptions contains the optional parameters for the DisksClient.BeginUpdate method. -func (client *DisksClient) BeginUpdate(ctx context.Context, resourceGroupName string, diskName string, disk DiskUpdate, options *DisksClientBeginUpdateOptions) (*runtime.Poller[DisksClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, diskName, disk, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[DisksClientUpdateResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[DisksClientUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// Update - Updates (patches) a disk. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 -func (client *DisksClient) update(ctx context.Context, resourceGroupName string, diskName string, disk DiskUpdate, options *DisksClientBeginUpdateOptions) (*http.Response, error) { - req, err := client.updateCreateRequest(ctx, resourceGroupName, diskName, disk, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// updateCreateRequest creates the Update request. -func (client *DisksClient) updateCreateRequest(ctx context.Context, resourceGroupName string, diskName string, disk DiskUpdate, options *DisksClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if diskName == "" { - return nil, errors.New("parameter diskName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskName}", url.PathEscape(diskName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, disk) -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_galleries_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_galleries_client.go deleted file mode 100644 index f2c82893..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_galleries_client.go +++ /dev/null @@ -1,433 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// GalleriesClient contains the methods for the Galleries group. -// Don't use this type directly, use NewGalleriesClient() instead. -type GalleriesClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewGalleriesClient creates a new instance of GalleriesClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewGalleriesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GalleriesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &GalleriesClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Create or update a Shared Image Gallery. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 -// resourceGroupName - The name of the resource group. -// galleryName - The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with dots and periods -// allowed in the middle. The maximum length is 80 characters. -// gallery - Parameters supplied to the create or update Shared Image Gallery operation. -// options - GalleriesClientBeginCreateOrUpdateOptions contains the optional parameters for the GalleriesClient.BeginCreateOrUpdate -// method. -func (client *GalleriesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, gallery Gallery, options *GalleriesClientBeginCreateOrUpdateOptions) (*runtime.Poller[GalleriesClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, galleryName, gallery, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[GalleriesClientCreateOrUpdateResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[GalleriesClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Create or update a Shared Image Gallery. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 -func (client *GalleriesClient) createOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, gallery Gallery, options *GalleriesClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, galleryName, gallery, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *GalleriesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, gallery Gallery, options *GalleriesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, gallery) -} - -// BeginDelete - Delete a Shared Image Gallery. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 -// resourceGroupName - The name of the resource group. -// galleryName - The name of the Shared Image Gallery to be deleted. -// options - GalleriesClientBeginDeleteOptions contains the optional parameters for the GalleriesClient.BeginDelete method. -func (client *GalleriesClient) BeginDelete(ctx context.Context, resourceGroupName string, galleryName string, options *GalleriesClientBeginDeleteOptions) (*runtime.Poller[GalleriesClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, galleryName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[GalleriesClientDeleteResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[GalleriesClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Delete a Shared Image Gallery. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 -func (client *GalleriesClient) deleteOperation(ctx context.Context, resourceGroupName string, galleryName string, options *GalleriesClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, galleryName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *GalleriesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, options *GalleriesClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Retrieves information about a Shared Image Gallery. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 -// resourceGroupName - The name of the resource group. -// galleryName - The name of the Shared Image Gallery. -// options - GalleriesClientGetOptions contains the optional parameters for the GalleriesClient.Get method. -func (client *GalleriesClient) Get(ctx context.Context, resourceGroupName string, galleryName string, options *GalleriesClientGetOptions) (GalleriesClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, galleryName, options) - if err != nil { - return GalleriesClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return GalleriesClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return GalleriesClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *GalleriesClient) getCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, options *GalleriesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") - if options != nil && options.Select != nil { - reqQP.Set("$select", string(*options.Select)) - } - if options != nil && options.Expand != nil { - reqQP.Set("$expand", string(*options.Expand)) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *GalleriesClient) getHandleResponse(resp *http.Response) (GalleriesClientGetResponse, error) { - result := GalleriesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.Gallery); err != nil { - return GalleriesClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - List galleries under a subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 -// options - GalleriesClientListOptions contains the optional parameters for the GalleriesClient.List method. -func (client *GalleriesClient) NewListPager(options *GalleriesClientListOptions) *runtime.Pager[GalleriesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[GalleriesClientListResponse]{ - More: func(page GalleriesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *GalleriesClientListResponse) (GalleriesClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return GalleriesClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return GalleriesClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return GalleriesClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *GalleriesClient) listCreateRequest(ctx context.Context, options *GalleriesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/galleries" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *GalleriesClient) listHandleResponse(resp *http.Response) (GalleriesClientListResponse, error) { - result := GalleriesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.GalleryList); err != nil { - return GalleriesClientListResponse{}, err - } - return result, nil -} - -// NewListByResourceGroupPager - List galleries under a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 -// resourceGroupName - The name of the resource group. -// options - GalleriesClientListByResourceGroupOptions contains the optional parameters for the GalleriesClient.ListByResourceGroup -// method. -func (client *GalleriesClient) NewListByResourceGroupPager(resourceGroupName string, options *GalleriesClientListByResourceGroupOptions) *runtime.Pager[GalleriesClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[GalleriesClientListByResourceGroupResponse]{ - More: func(page GalleriesClientListByResourceGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *GalleriesClientListByResourceGroupResponse) (GalleriesClientListByResourceGroupResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return GalleriesClientListByResourceGroupResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return GalleriesClientListByResourceGroupResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return GalleriesClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) - } - return client.listByResourceGroupHandleResponse(resp) - }, - }) -} - -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *GalleriesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *GalleriesClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *GalleriesClient) listByResourceGroupHandleResponse(resp *http.Response) (GalleriesClientListByResourceGroupResponse, error) { - result := GalleriesClientListByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.GalleryList); err != nil { - return GalleriesClientListByResourceGroupResponse{}, err - } - return result, nil -} - -// BeginUpdate - Update a Shared Image Gallery. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 -// resourceGroupName - The name of the resource group. -// galleryName - The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with dots and periods -// allowed in the middle. The maximum length is 80 characters. -// gallery - Parameters supplied to the update Shared Image Gallery operation. -// options - GalleriesClientBeginUpdateOptions contains the optional parameters for the GalleriesClient.BeginUpdate method. -func (client *GalleriesClient) BeginUpdate(ctx context.Context, resourceGroupName string, galleryName string, gallery GalleryUpdate, options *GalleriesClientBeginUpdateOptions) (*runtime.Poller[GalleriesClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, galleryName, gallery, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[GalleriesClientUpdateResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[GalleriesClientUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// Update - Update a Shared Image Gallery. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 -func (client *GalleriesClient) update(ctx context.Context, resourceGroupName string, galleryName string, gallery GalleryUpdate, options *GalleriesClientBeginUpdateOptions) (*http.Response, error) { - req, err := client.updateCreateRequest(ctx, resourceGroupName, galleryName, gallery, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// updateCreateRequest creates the Update request. -func (client *GalleriesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, gallery GalleryUpdate, options *GalleriesClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, gallery) -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_galleryapplications_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_galleryapplications_client.go deleted file mode 100644 index 342e82b5..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_galleryapplications_client.go +++ /dev/null @@ -1,397 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// GalleryApplicationsClient contains the methods for the GalleryApplications group. -// Don't use this type directly, use NewGalleryApplicationsClient() instead. -type GalleryApplicationsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewGalleryApplicationsClient creates a new instance of GalleryApplicationsClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewGalleryApplicationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GalleryApplicationsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &GalleryApplicationsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Create or update a gallery Application Definition. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 -// resourceGroupName - The name of the resource group. -// galleryName - The name of the Shared Application Gallery in which the Application Definition is to be created. -// galleryApplicationName - The name of the gallery Application Definition to be created or updated. The allowed characters -// are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 -// characters. -// galleryApplication - Parameters supplied to the create or update gallery Application operation. -// options - GalleryApplicationsClientBeginCreateOrUpdateOptions contains the optional parameters for the GalleryApplicationsClient.BeginCreateOrUpdate -// method. -func (client *GalleryApplicationsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplication GalleryApplication, options *GalleryApplicationsClientBeginCreateOrUpdateOptions) (*runtime.Poller[GalleryApplicationsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplication, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[GalleryApplicationsClientCreateOrUpdateResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[GalleryApplicationsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Create or update a gallery Application Definition. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 -func (client *GalleryApplicationsClient) createOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplication GalleryApplication, options *GalleryApplicationsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplication, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *GalleryApplicationsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplication GalleryApplication, options *GalleryApplicationsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - if galleryApplicationName == "" { - return nil, errors.New("parameter galleryApplicationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryApplicationName}", url.PathEscape(galleryApplicationName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, galleryApplication) -} - -// BeginDelete - Delete a gallery Application. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 -// resourceGroupName - The name of the resource group. -// galleryName - The name of the Shared Application Gallery in which the Application Definition is to be deleted. -// galleryApplicationName - The name of the gallery Application Definition to be deleted. -// options - GalleryApplicationsClientBeginDeleteOptions contains the optional parameters for the GalleryApplicationsClient.BeginDelete -// method. -func (client *GalleryApplicationsClient) BeginDelete(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, options *GalleryApplicationsClientBeginDeleteOptions) (*runtime.Poller[GalleryApplicationsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, galleryName, galleryApplicationName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[GalleryApplicationsClientDeleteResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[GalleryApplicationsClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Delete a gallery Application. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 -func (client *GalleryApplicationsClient) deleteOperation(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, options *GalleryApplicationsClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, galleryName, galleryApplicationName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *GalleryApplicationsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, options *GalleryApplicationsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - if galleryApplicationName == "" { - return nil, errors.New("parameter galleryApplicationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryApplicationName}", url.PathEscape(galleryApplicationName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Retrieves information about a gallery Application Definition. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 -// resourceGroupName - The name of the resource group. -// galleryName - The name of the Shared Application Gallery from which the Application Definitions are to be retrieved. -// galleryApplicationName - The name of the gallery Application Definition to be retrieved. -// options - GalleryApplicationsClientGetOptions contains the optional parameters for the GalleryApplicationsClient.Get method. -func (client *GalleryApplicationsClient) Get(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, options *GalleryApplicationsClientGetOptions) (GalleryApplicationsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, galleryName, galleryApplicationName, options) - if err != nil { - return GalleryApplicationsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return GalleryApplicationsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return GalleryApplicationsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *GalleryApplicationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, options *GalleryApplicationsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - if galleryApplicationName == "" { - return nil, errors.New("parameter galleryApplicationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryApplicationName}", url.PathEscape(galleryApplicationName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *GalleryApplicationsClient) getHandleResponse(resp *http.Response) (GalleryApplicationsClientGetResponse, error) { - result := GalleryApplicationsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.GalleryApplication); err != nil { - return GalleryApplicationsClientGetResponse{}, err - } - return result, nil -} - -// NewListByGalleryPager - List gallery Application Definitions in a gallery. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 -// resourceGroupName - The name of the resource group. -// galleryName - The name of the Shared Application Gallery from which Application Definitions are to be listed. -// options - GalleryApplicationsClientListByGalleryOptions contains the optional parameters for the GalleryApplicationsClient.ListByGallery -// method. -func (client *GalleryApplicationsClient) NewListByGalleryPager(resourceGroupName string, galleryName string, options *GalleryApplicationsClientListByGalleryOptions) *runtime.Pager[GalleryApplicationsClientListByGalleryResponse] { - return runtime.NewPager(runtime.PagingHandler[GalleryApplicationsClientListByGalleryResponse]{ - More: func(page GalleryApplicationsClientListByGalleryResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *GalleryApplicationsClientListByGalleryResponse) (GalleryApplicationsClientListByGalleryResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByGalleryCreateRequest(ctx, resourceGroupName, galleryName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return GalleryApplicationsClientListByGalleryResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return GalleryApplicationsClientListByGalleryResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return GalleryApplicationsClientListByGalleryResponse{}, runtime.NewResponseError(resp) - } - return client.listByGalleryHandleResponse(resp) - }, - }) -} - -// listByGalleryCreateRequest creates the ListByGallery request. -func (client *GalleryApplicationsClient) listByGalleryCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, options *GalleryApplicationsClientListByGalleryOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByGalleryHandleResponse handles the ListByGallery response. -func (client *GalleryApplicationsClient) listByGalleryHandleResponse(resp *http.Response) (GalleryApplicationsClientListByGalleryResponse, error) { - result := GalleryApplicationsClientListByGalleryResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.GalleryApplicationList); err != nil { - return GalleryApplicationsClientListByGalleryResponse{}, err - } - return result, nil -} - -// BeginUpdate - Update a gallery Application Definition. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 -// resourceGroupName - The name of the resource group. -// galleryName - The name of the Shared Application Gallery in which the Application Definition is to be updated. -// galleryApplicationName - The name of the gallery Application Definition to be updated. The allowed characters are alphabets -// and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 -// characters. -// galleryApplication - Parameters supplied to the update gallery Application operation. -// options - GalleryApplicationsClientBeginUpdateOptions contains the optional parameters for the GalleryApplicationsClient.BeginUpdate -// method. -func (client *GalleryApplicationsClient) BeginUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplication GalleryApplicationUpdate, options *GalleryApplicationsClientBeginUpdateOptions) (*runtime.Poller[GalleryApplicationsClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplication, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[GalleryApplicationsClientUpdateResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[GalleryApplicationsClientUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// Update - Update a gallery Application Definition. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 -func (client *GalleryApplicationsClient) update(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplication GalleryApplicationUpdate, options *GalleryApplicationsClientBeginUpdateOptions) (*http.Response, error) { - req, err := client.updateCreateRequest(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplication, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// updateCreateRequest creates the Update request. -func (client *GalleryApplicationsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplication GalleryApplicationUpdate, options *GalleryApplicationsClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - if galleryApplicationName == "" { - return nil, errors.New("parameter galleryApplicationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryApplicationName}", url.PathEscape(galleryApplicationName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, galleryApplication) -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_galleryapplicationversions_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_galleryapplicationversions_client.go deleted file mode 100644 index 373f659c..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_galleryapplicationversions_client.go +++ /dev/null @@ -1,427 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// GalleryApplicationVersionsClient contains the methods for the GalleryApplicationVersions group. -// Don't use this type directly, use NewGalleryApplicationVersionsClient() instead. -type GalleryApplicationVersionsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewGalleryApplicationVersionsClient creates a new instance of GalleryApplicationVersionsClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewGalleryApplicationVersionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GalleryApplicationVersionsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &GalleryApplicationVersionsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Create or update a gallery Application Version. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 -// resourceGroupName - The name of the resource group. -// galleryName - The name of the Shared Application Gallery in which the Application Definition resides. -// galleryApplicationName - The name of the gallery Application Definition in which the Application Version is to be created. -// galleryApplicationVersionName - The name of the gallery Application Version to be created. Needs to follow semantic version -// name pattern: The allowed characters are digit and period. Digits must be within the range of a 32-bit -// integer. Format: .. -// galleryApplicationVersion - Parameters supplied to the create or update gallery Application Version operation. -// options - GalleryApplicationVersionsClientBeginCreateOrUpdateOptions contains the optional parameters for the GalleryApplicationVersionsClient.BeginCreateOrUpdate -// method. -func (client *GalleryApplicationVersionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, galleryApplicationVersion GalleryApplicationVersion, options *GalleryApplicationVersionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[GalleryApplicationVersionsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, galleryApplicationVersion, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[GalleryApplicationVersionsClientCreateOrUpdateResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[GalleryApplicationVersionsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Create or update a gallery Application Version. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 -func (client *GalleryApplicationVersionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, galleryApplicationVersion GalleryApplicationVersion, options *GalleryApplicationVersionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, galleryApplicationVersion, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *GalleryApplicationVersionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, galleryApplicationVersion GalleryApplicationVersion, options *GalleryApplicationVersionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - if galleryApplicationName == "" { - return nil, errors.New("parameter galleryApplicationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryApplicationName}", url.PathEscape(galleryApplicationName)) - if galleryApplicationVersionName == "" { - return nil, errors.New("parameter galleryApplicationVersionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryApplicationVersionName}", url.PathEscape(galleryApplicationVersionName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, galleryApplicationVersion) -} - -// BeginDelete - Delete a gallery Application Version. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 -// resourceGroupName - The name of the resource group. -// galleryName - The name of the Shared Application Gallery in which the Application Definition resides. -// galleryApplicationName - The name of the gallery Application Definition in which the Application Version resides. -// galleryApplicationVersionName - The name of the gallery Application Version to be deleted. -// options - GalleryApplicationVersionsClientBeginDeleteOptions contains the optional parameters for the GalleryApplicationVersionsClient.BeginDelete -// method. -func (client *GalleryApplicationVersionsClient) BeginDelete(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, options *GalleryApplicationVersionsClientBeginDeleteOptions) (*runtime.Poller[GalleryApplicationVersionsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[GalleryApplicationVersionsClientDeleteResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[GalleryApplicationVersionsClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Delete a gallery Application Version. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 -func (client *GalleryApplicationVersionsClient) deleteOperation(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, options *GalleryApplicationVersionsClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *GalleryApplicationVersionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, options *GalleryApplicationVersionsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - if galleryApplicationName == "" { - return nil, errors.New("parameter galleryApplicationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryApplicationName}", url.PathEscape(galleryApplicationName)) - if galleryApplicationVersionName == "" { - return nil, errors.New("parameter galleryApplicationVersionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryApplicationVersionName}", url.PathEscape(galleryApplicationVersionName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Retrieves information about a gallery Application Version. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 -// resourceGroupName - The name of the resource group. -// galleryName - The name of the Shared Application Gallery in which the Application Definition resides. -// galleryApplicationName - The name of the gallery Application Definition in which the Application Version resides. -// galleryApplicationVersionName - The name of the gallery Application Version to be retrieved. -// options - GalleryApplicationVersionsClientGetOptions contains the optional parameters for the GalleryApplicationVersionsClient.Get -// method. -func (client *GalleryApplicationVersionsClient) Get(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, options *GalleryApplicationVersionsClientGetOptions) (GalleryApplicationVersionsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, options) - if err != nil { - return GalleryApplicationVersionsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return GalleryApplicationVersionsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return GalleryApplicationVersionsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *GalleryApplicationVersionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, options *GalleryApplicationVersionsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - if galleryApplicationName == "" { - return nil, errors.New("parameter galleryApplicationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryApplicationName}", url.PathEscape(galleryApplicationName)) - if galleryApplicationVersionName == "" { - return nil, errors.New("parameter galleryApplicationVersionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryApplicationVersionName}", url.PathEscape(galleryApplicationVersionName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", string(*options.Expand)) - } - reqQP.Set("api-version", "2021-10-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *GalleryApplicationVersionsClient) getHandleResponse(resp *http.Response) (GalleryApplicationVersionsClientGetResponse, error) { - result := GalleryApplicationVersionsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.GalleryApplicationVersion); err != nil { - return GalleryApplicationVersionsClientGetResponse{}, err - } - return result, nil -} - -// NewListByGalleryApplicationPager - List gallery Application Versions in a gallery Application Definition. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 -// resourceGroupName - The name of the resource group. -// galleryName - The name of the Shared Application Gallery in which the Application Definition resides. -// galleryApplicationName - The name of the Shared Application Gallery Application Definition from which the Application Versions -// are to be listed. -// options - GalleryApplicationVersionsClientListByGalleryApplicationOptions contains the optional parameters for the GalleryApplicationVersionsClient.ListByGalleryApplication -// method. -func (client *GalleryApplicationVersionsClient) NewListByGalleryApplicationPager(resourceGroupName string, galleryName string, galleryApplicationName string, options *GalleryApplicationVersionsClientListByGalleryApplicationOptions) *runtime.Pager[GalleryApplicationVersionsClientListByGalleryApplicationResponse] { - return runtime.NewPager(runtime.PagingHandler[GalleryApplicationVersionsClientListByGalleryApplicationResponse]{ - More: func(page GalleryApplicationVersionsClientListByGalleryApplicationResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *GalleryApplicationVersionsClientListByGalleryApplicationResponse) (GalleryApplicationVersionsClientListByGalleryApplicationResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByGalleryApplicationCreateRequest(ctx, resourceGroupName, galleryName, galleryApplicationName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return GalleryApplicationVersionsClientListByGalleryApplicationResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return GalleryApplicationVersionsClientListByGalleryApplicationResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return GalleryApplicationVersionsClientListByGalleryApplicationResponse{}, runtime.NewResponseError(resp) - } - return client.listByGalleryApplicationHandleResponse(resp) - }, - }) -} - -// listByGalleryApplicationCreateRequest creates the ListByGalleryApplication request. -func (client *GalleryApplicationVersionsClient) listByGalleryApplicationCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, options *GalleryApplicationVersionsClientListByGalleryApplicationOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - if galleryApplicationName == "" { - return nil, errors.New("parameter galleryApplicationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryApplicationName}", url.PathEscape(galleryApplicationName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByGalleryApplicationHandleResponse handles the ListByGalleryApplication response. -func (client *GalleryApplicationVersionsClient) listByGalleryApplicationHandleResponse(resp *http.Response) (GalleryApplicationVersionsClientListByGalleryApplicationResponse, error) { - result := GalleryApplicationVersionsClientListByGalleryApplicationResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.GalleryApplicationVersionList); err != nil { - return GalleryApplicationVersionsClientListByGalleryApplicationResponse{}, err - } - return result, nil -} - -// BeginUpdate - Update a gallery Application Version. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 -// resourceGroupName - The name of the resource group. -// galleryName - The name of the Shared Application Gallery in which the Application Definition resides. -// galleryApplicationName - The name of the gallery Application Definition in which the Application Version is to be updated. -// galleryApplicationVersionName - The name of the gallery Application Version to be updated. Needs to follow semantic version -// name pattern: The allowed characters are digit and period. Digits must be within the range of a 32-bit -// integer. Format: .. -// galleryApplicationVersion - Parameters supplied to the update gallery Application Version operation. -// options - GalleryApplicationVersionsClientBeginUpdateOptions contains the optional parameters for the GalleryApplicationVersionsClient.BeginUpdate -// method. -func (client *GalleryApplicationVersionsClient) BeginUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, galleryApplicationVersion GalleryApplicationVersionUpdate, options *GalleryApplicationVersionsClientBeginUpdateOptions) (*runtime.Poller[GalleryApplicationVersionsClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, galleryApplicationVersion, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[GalleryApplicationVersionsClientUpdateResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[GalleryApplicationVersionsClientUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// Update - Update a gallery Application Version. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 -func (client *GalleryApplicationVersionsClient) update(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, galleryApplicationVersion GalleryApplicationVersionUpdate, options *GalleryApplicationVersionsClientBeginUpdateOptions) (*http.Response, error) { - req, err := client.updateCreateRequest(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, galleryApplicationVersion, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// updateCreateRequest creates the Update request. -func (client *GalleryApplicationVersionsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, galleryApplicationVersion GalleryApplicationVersionUpdate, options *GalleryApplicationVersionsClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - if galleryApplicationName == "" { - return nil, errors.New("parameter galleryApplicationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryApplicationName}", url.PathEscape(galleryApplicationName)) - if galleryApplicationVersionName == "" { - return nil, errors.New("parameter galleryApplicationVersionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryApplicationVersionName}", url.PathEscape(galleryApplicationVersionName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, galleryApplicationVersion) -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_galleryimages_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_galleryimages_client.go deleted file mode 100644 index 8427d5f4..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_galleryimages_client.go +++ /dev/null @@ -1,396 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// GalleryImagesClient contains the methods for the GalleryImages group. -// Don't use this type directly, use NewGalleryImagesClient() instead. -type GalleryImagesClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewGalleryImagesClient creates a new instance of GalleryImagesClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewGalleryImagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GalleryImagesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &GalleryImagesClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Create or update a gallery image definition. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 -// resourceGroupName - The name of the resource group. -// galleryName - The name of the Shared Image Gallery in which the Image Definition is to be created. -// galleryImageName - The name of the gallery image definition to be created or updated. The allowed characters are alphabets -// and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 -// characters. -// galleryImage - Parameters supplied to the create or update gallery image operation. -// options - GalleryImagesClientBeginCreateOrUpdateOptions contains the optional parameters for the GalleryImagesClient.BeginCreateOrUpdate -// method. -func (client *GalleryImagesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImage GalleryImage, options *GalleryImagesClientBeginCreateOrUpdateOptions) (*runtime.Poller[GalleryImagesClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, galleryName, galleryImageName, galleryImage, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[GalleryImagesClientCreateOrUpdateResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[GalleryImagesClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Create or update a gallery image definition. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 -func (client *GalleryImagesClient) createOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImage GalleryImage, options *GalleryImagesClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, galleryName, galleryImageName, galleryImage, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *GalleryImagesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImage GalleryImage, options *GalleryImagesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - if galleryImageName == "" { - return nil, errors.New("parameter galleryImageName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryImageName}", url.PathEscape(galleryImageName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, galleryImage) -} - -// BeginDelete - Delete a gallery image. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 -// resourceGroupName - The name of the resource group. -// galleryName - The name of the Shared Image Gallery in which the Image Definition is to be deleted. -// galleryImageName - The name of the gallery image definition to be deleted. -// options - GalleryImagesClientBeginDeleteOptions contains the optional parameters for the GalleryImagesClient.BeginDelete -// method. -func (client *GalleryImagesClient) BeginDelete(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, options *GalleryImagesClientBeginDeleteOptions) (*runtime.Poller[GalleryImagesClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, galleryName, galleryImageName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[GalleryImagesClientDeleteResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[GalleryImagesClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Delete a gallery image. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 -func (client *GalleryImagesClient) deleteOperation(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, options *GalleryImagesClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, galleryName, galleryImageName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *GalleryImagesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, options *GalleryImagesClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - if galleryImageName == "" { - return nil, errors.New("parameter galleryImageName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryImageName}", url.PathEscape(galleryImageName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Retrieves information about a gallery image definition. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 -// resourceGroupName - The name of the resource group. -// galleryName - The name of the Shared Image Gallery from which the Image Definitions are to be retrieved. -// galleryImageName - The name of the gallery image definition to be retrieved. -// options - GalleryImagesClientGetOptions contains the optional parameters for the GalleryImagesClient.Get method. -func (client *GalleryImagesClient) Get(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, options *GalleryImagesClientGetOptions) (GalleryImagesClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, galleryName, galleryImageName, options) - if err != nil { - return GalleryImagesClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return GalleryImagesClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return GalleryImagesClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *GalleryImagesClient) getCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, options *GalleryImagesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - if galleryImageName == "" { - return nil, errors.New("parameter galleryImageName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryImageName}", url.PathEscape(galleryImageName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *GalleryImagesClient) getHandleResponse(resp *http.Response) (GalleryImagesClientGetResponse, error) { - result := GalleryImagesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.GalleryImage); err != nil { - return GalleryImagesClientGetResponse{}, err - } - return result, nil -} - -// NewListByGalleryPager - List gallery image definitions in a gallery. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 -// resourceGroupName - The name of the resource group. -// galleryName - The name of the Shared Image Gallery from which Image Definitions are to be listed. -// options - GalleryImagesClientListByGalleryOptions contains the optional parameters for the GalleryImagesClient.ListByGallery -// method. -func (client *GalleryImagesClient) NewListByGalleryPager(resourceGroupName string, galleryName string, options *GalleryImagesClientListByGalleryOptions) *runtime.Pager[GalleryImagesClientListByGalleryResponse] { - return runtime.NewPager(runtime.PagingHandler[GalleryImagesClientListByGalleryResponse]{ - More: func(page GalleryImagesClientListByGalleryResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *GalleryImagesClientListByGalleryResponse) (GalleryImagesClientListByGalleryResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByGalleryCreateRequest(ctx, resourceGroupName, galleryName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return GalleryImagesClientListByGalleryResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return GalleryImagesClientListByGalleryResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return GalleryImagesClientListByGalleryResponse{}, runtime.NewResponseError(resp) - } - return client.listByGalleryHandleResponse(resp) - }, - }) -} - -// listByGalleryCreateRequest creates the ListByGallery request. -func (client *GalleryImagesClient) listByGalleryCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, options *GalleryImagesClientListByGalleryOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByGalleryHandleResponse handles the ListByGallery response. -func (client *GalleryImagesClient) listByGalleryHandleResponse(resp *http.Response) (GalleryImagesClientListByGalleryResponse, error) { - result := GalleryImagesClientListByGalleryResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.GalleryImageList); err != nil { - return GalleryImagesClientListByGalleryResponse{}, err - } - return result, nil -} - -// BeginUpdate - Update a gallery image definition. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 -// resourceGroupName - The name of the resource group. -// galleryName - The name of the Shared Image Gallery in which the Image Definition is to be updated. -// galleryImageName - The name of the gallery image definition to be updated. The allowed characters are alphabets and numbers -// with dots, dashes, and periods allowed in the middle. The maximum length is 80 characters. -// galleryImage - Parameters supplied to the update gallery image operation. -// options - GalleryImagesClientBeginUpdateOptions contains the optional parameters for the GalleryImagesClient.BeginUpdate -// method. -func (client *GalleryImagesClient) BeginUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImage GalleryImageUpdate, options *GalleryImagesClientBeginUpdateOptions) (*runtime.Poller[GalleryImagesClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, galleryName, galleryImageName, galleryImage, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[GalleryImagesClientUpdateResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[GalleryImagesClientUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// Update - Update a gallery image definition. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 -func (client *GalleryImagesClient) update(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImage GalleryImageUpdate, options *GalleryImagesClientBeginUpdateOptions) (*http.Response, error) { - req, err := client.updateCreateRequest(ctx, resourceGroupName, galleryName, galleryImageName, galleryImage, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// updateCreateRequest creates the Update request. -func (client *GalleryImagesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImage GalleryImageUpdate, options *GalleryImagesClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - if galleryImageName == "" { - return nil, errors.New("parameter galleryImageName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryImageName}", url.PathEscape(galleryImageName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, galleryImage) -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_galleryimageversions_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_galleryimageversions_client.go deleted file mode 100644 index df24c4d2..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_galleryimageversions_client.go +++ /dev/null @@ -1,426 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// GalleryImageVersionsClient contains the methods for the GalleryImageVersions group. -// Don't use this type directly, use NewGalleryImageVersionsClient() instead. -type GalleryImageVersionsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewGalleryImageVersionsClient creates a new instance of GalleryImageVersionsClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewGalleryImageVersionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GalleryImageVersionsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &GalleryImageVersionsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Create or update a gallery image version. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 -// resourceGroupName - The name of the resource group. -// galleryName - The name of the Shared Image Gallery in which the Image Definition resides. -// galleryImageName - The name of the gallery image definition in which the Image Version is to be created. -// galleryImageVersionName - The name of the gallery image version to be created. Needs to follow semantic version name pattern: -// The allowed characters are digit and period. Digits must be within the range of a 32-bit integer. -// Format: .. -// galleryImageVersion - Parameters supplied to the create or update gallery image version operation. -// options - GalleryImageVersionsClientBeginCreateOrUpdateOptions contains the optional parameters for the GalleryImageVersionsClient.BeginCreateOrUpdate -// method. -func (client *GalleryImageVersionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, galleryImageVersion GalleryImageVersion, options *GalleryImageVersionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[GalleryImageVersionsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[GalleryImageVersionsClientCreateOrUpdateResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[GalleryImageVersionsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Create or update a gallery image version. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 -func (client *GalleryImageVersionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, galleryImageVersion GalleryImageVersion, options *GalleryImageVersionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *GalleryImageVersionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, galleryImageVersion GalleryImageVersion, options *GalleryImageVersionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - if galleryImageName == "" { - return nil, errors.New("parameter galleryImageName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryImageName}", url.PathEscape(galleryImageName)) - if galleryImageVersionName == "" { - return nil, errors.New("parameter galleryImageVersionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryImageVersionName}", url.PathEscape(galleryImageVersionName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, galleryImageVersion) -} - -// BeginDelete - Delete a gallery image version. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 -// resourceGroupName - The name of the resource group. -// galleryName - The name of the Shared Image Gallery in which the Image Definition resides. -// galleryImageName - The name of the gallery image definition in which the Image Version resides. -// galleryImageVersionName - The name of the gallery image version to be deleted. -// options - GalleryImageVersionsClientBeginDeleteOptions contains the optional parameters for the GalleryImageVersionsClient.BeginDelete -// method. -func (client *GalleryImageVersionsClient) BeginDelete(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, options *GalleryImageVersionsClientBeginDeleteOptions) (*runtime.Poller[GalleryImageVersionsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[GalleryImageVersionsClientDeleteResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[GalleryImageVersionsClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Delete a gallery image version. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 -func (client *GalleryImageVersionsClient) deleteOperation(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, options *GalleryImageVersionsClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *GalleryImageVersionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, options *GalleryImageVersionsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - if galleryImageName == "" { - return nil, errors.New("parameter galleryImageName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryImageName}", url.PathEscape(galleryImageName)) - if galleryImageVersionName == "" { - return nil, errors.New("parameter galleryImageVersionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryImageVersionName}", url.PathEscape(galleryImageVersionName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Retrieves information about a gallery image version. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 -// resourceGroupName - The name of the resource group. -// galleryName - The name of the Shared Image Gallery in which the Image Definition resides. -// galleryImageName - The name of the gallery image definition in which the Image Version resides. -// galleryImageVersionName - The name of the gallery image version to be retrieved. -// options - GalleryImageVersionsClientGetOptions contains the optional parameters for the GalleryImageVersionsClient.Get -// method. -func (client *GalleryImageVersionsClient) Get(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, options *GalleryImageVersionsClientGetOptions) (GalleryImageVersionsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, options) - if err != nil { - return GalleryImageVersionsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return GalleryImageVersionsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return GalleryImageVersionsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *GalleryImageVersionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, options *GalleryImageVersionsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - if galleryImageName == "" { - return nil, errors.New("parameter galleryImageName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryImageName}", url.PathEscape(galleryImageName)) - if galleryImageVersionName == "" { - return nil, errors.New("parameter galleryImageVersionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryImageVersionName}", url.PathEscape(galleryImageVersionName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", string(*options.Expand)) - } - reqQP.Set("api-version", "2021-10-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *GalleryImageVersionsClient) getHandleResponse(resp *http.Response) (GalleryImageVersionsClientGetResponse, error) { - result := GalleryImageVersionsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.GalleryImageVersion); err != nil { - return GalleryImageVersionsClientGetResponse{}, err - } - return result, nil -} - -// NewListByGalleryImagePager - List gallery image versions in a gallery image definition. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 -// resourceGroupName - The name of the resource group. -// galleryName - The name of the Shared Image Gallery in which the Image Definition resides. -// galleryImageName - The name of the Shared Image Gallery Image Definition from which the Image Versions are to be listed. -// options - GalleryImageVersionsClientListByGalleryImageOptions contains the optional parameters for the GalleryImageVersionsClient.ListByGalleryImage -// method. -func (client *GalleryImageVersionsClient) NewListByGalleryImagePager(resourceGroupName string, galleryName string, galleryImageName string, options *GalleryImageVersionsClientListByGalleryImageOptions) *runtime.Pager[GalleryImageVersionsClientListByGalleryImageResponse] { - return runtime.NewPager(runtime.PagingHandler[GalleryImageVersionsClientListByGalleryImageResponse]{ - More: func(page GalleryImageVersionsClientListByGalleryImageResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *GalleryImageVersionsClientListByGalleryImageResponse) (GalleryImageVersionsClientListByGalleryImageResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByGalleryImageCreateRequest(ctx, resourceGroupName, galleryName, galleryImageName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return GalleryImageVersionsClientListByGalleryImageResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return GalleryImageVersionsClientListByGalleryImageResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return GalleryImageVersionsClientListByGalleryImageResponse{}, runtime.NewResponseError(resp) - } - return client.listByGalleryImageHandleResponse(resp) - }, - }) -} - -// listByGalleryImageCreateRequest creates the ListByGalleryImage request. -func (client *GalleryImageVersionsClient) listByGalleryImageCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, options *GalleryImageVersionsClientListByGalleryImageOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - if galleryImageName == "" { - return nil, errors.New("parameter galleryImageName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryImageName}", url.PathEscape(galleryImageName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByGalleryImageHandleResponse handles the ListByGalleryImage response. -func (client *GalleryImageVersionsClient) listByGalleryImageHandleResponse(resp *http.Response) (GalleryImageVersionsClientListByGalleryImageResponse, error) { - result := GalleryImageVersionsClientListByGalleryImageResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.GalleryImageVersionList); err != nil { - return GalleryImageVersionsClientListByGalleryImageResponse{}, err - } - return result, nil -} - -// BeginUpdate - Update a gallery image version. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 -// resourceGroupName - The name of the resource group. -// galleryName - The name of the Shared Image Gallery in which the Image Definition resides. -// galleryImageName - The name of the gallery image definition in which the Image Version is to be updated. -// galleryImageVersionName - The name of the gallery image version to be updated. Needs to follow semantic version name pattern: -// The allowed characters are digit and period. Digits must be within the range of a 32-bit integer. -// Format: .. -// galleryImageVersion - Parameters supplied to the update gallery image version operation. -// options - GalleryImageVersionsClientBeginUpdateOptions contains the optional parameters for the GalleryImageVersionsClient.BeginUpdate -// method. -func (client *GalleryImageVersionsClient) BeginUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, galleryImageVersion GalleryImageVersionUpdate, options *GalleryImageVersionsClientBeginUpdateOptions) (*runtime.Poller[GalleryImageVersionsClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[GalleryImageVersionsClientUpdateResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[GalleryImageVersionsClientUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// Update - Update a gallery image version. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 -func (client *GalleryImageVersionsClient) update(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, galleryImageVersion GalleryImageVersionUpdate, options *GalleryImageVersionsClientBeginUpdateOptions) (*http.Response, error) { - req, err := client.updateCreateRequest(ctx, resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// updateCreateRequest creates the Update request. -func (client *GalleryImageVersionsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, galleryImageVersion GalleryImageVersionUpdate, options *GalleryImageVersionsClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - if galleryImageName == "" { - return nil, errors.New("parameter galleryImageName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryImageName}", url.PathEscape(galleryImageName)) - if galleryImageVersionName == "" { - return nil, errors.New("parameter galleryImageVersionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryImageVersionName}", url.PathEscape(galleryImageVersionName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, galleryImageVersion) -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_gallerysharingprofile_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_gallerysharingprofile_client.go deleted file mode 100644 index 3ddc9614..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_gallerysharingprofile_client.go +++ /dev/null @@ -1,120 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// GallerySharingProfileClient contains the methods for the GallerySharingProfile group. -// Don't use this type directly, use NewGallerySharingProfileClient() instead. -type GallerySharingProfileClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewGallerySharingProfileClient creates a new instance of GallerySharingProfileClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewGallerySharingProfileClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GallerySharingProfileClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &GallerySharingProfileClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginUpdate - Update sharing profile of a gallery. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 -// resourceGroupName - The name of the resource group. -// galleryName - The name of the Shared Image Gallery. -// sharingUpdate - Parameters supplied to the update gallery sharing profile. -// options - GallerySharingProfileClientBeginUpdateOptions contains the optional parameters for the GallerySharingProfileClient.BeginUpdate -// method. -func (client *GallerySharingProfileClient) BeginUpdate(ctx context.Context, resourceGroupName string, galleryName string, sharingUpdate SharingUpdate, options *GallerySharingProfileClientBeginUpdateOptions) (*runtime.Poller[GallerySharingProfileClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, galleryName, sharingUpdate, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[GallerySharingProfileClientUpdateResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[GallerySharingProfileClientUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// Update - Update sharing profile of a gallery. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 -func (client *GallerySharingProfileClient) update(ctx context.Context, resourceGroupName string, galleryName string, sharingUpdate SharingUpdate, options *GallerySharingProfileClientBeginUpdateOptions) (*http.Response, error) { - req, err := client.updateCreateRequest(ctx, resourceGroupName, galleryName, sharingUpdate, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// updateCreateRequest creates the Update request. -func (client *GallerySharingProfileClient) updateCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, sharingUpdate SharingUpdate, options *GallerySharingProfileClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/share" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, sharingUpdate) -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_images_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_images_client.go deleted file mode 100644 index 1d09de1a..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_images_client.go +++ /dev/null @@ -1,429 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// ImagesClient contains the methods for the Images group. -// Don't use this type directly, use NewImagesClient() instead. -type ImagesClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewImagesClient creates a new instance of ImagesClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewImagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ImagesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &ImagesClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Create or update an image. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// imageName - The name of the image. -// parameters - Parameters supplied to the Create Image operation. -// options - ImagesClientBeginCreateOrUpdateOptions contains the optional parameters for the ImagesClient.BeginCreateOrUpdate -// method. -func (client *ImagesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, imageName string, parameters Image, options *ImagesClientBeginCreateOrUpdateOptions) (*runtime.Poller[ImagesClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, imageName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[ImagesClientCreateOrUpdateResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[ImagesClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Create or update an image. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *ImagesClient) createOrUpdate(ctx context.Context, resourceGroupName string, imageName string, parameters Image, options *ImagesClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, imageName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ImagesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, imageName string, parameters Image, options *ImagesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if imageName == "" { - return nil, errors.New("parameter imageName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{imageName}", url.PathEscape(imageName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginDelete - Deletes an Image. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// imageName - The name of the image. -// options - ImagesClientBeginDeleteOptions contains the optional parameters for the ImagesClient.BeginDelete method. -func (client *ImagesClient) BeginDelete(ctx context.Context, resourceGroupName string, imageName string, options *ImagesClientBeginDeleteOptions) (*runtime.Poller[ImagesClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, imageName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[ImagesClientDeleteResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[ImagesClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes an Image. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *ImagesClient) deleteOperation(ctx context.Context, resourceGroupName string, imageName string, options *ImagesClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, imageName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *ImagesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, imageName string, options *ImagesClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if imageName == "" { - return nil, errors.New("parameter imageName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{imageName}", url.PathEscape(imageName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets an image. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// imageName - The name of the image. -// options - ImagesClientGetOptions contains the optional parameters for the ImagesClient.Get method. -func (client *ImagesClient) Get(ctx context.Context, resourceGroupName string, imageName string, options *ImagesClientGetOptions) (ImagesClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, imageName, options) - if err != nil { - return ImagesClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ImagesClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ImagesClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *ImagesClient) getCreateRequest(ctx context.Context, resourceGroupName string, imageName string, options *ImagesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if imageName == "" { - return nil, errors.New("parameter imageName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{imageName}", url.PathEscape(imageName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *ImagesClient) getHandleResponse(resp *http.Response) (ImagesClientGetResponse, error) { - result := ImagesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.Image); err != nil { - return ImagesClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Gets the list of Images in the subscription. Use nextLink property in the response to get the next page -// of Images. Do this till nextLink is null to fetch all the Images. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// options - ImagesClientListOptions contains the optional parameters for the ImagesClient.List method. -func (client *ImagesClient) NewListPager(options *ImagesClientListOptions) *runtime.Pager[ImagesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[ImagesClientListResponse]{ - More: func(page ImagesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ImagesClientListResponse) (ImagesClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return ImagesClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ImagesClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ImagesClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *ImagesClient) listCreateRequest(ctx context.Context, options *ImagesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/images" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *ImagesClient) listHandleResponse(resp *http.Response) (ImagesClientListResponse, error) { - result := ImagesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ImageListResult); err != nil { - return ImagesClientListResponse{}, err - } - return result, nil -} - -// NewListByResourceGroupPager - Gets the list of images under a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// options - ImagesClientListByResourceGroupOptions contains the optional parameters for the ImagesClient.ListByResourceGroup -// method. -func (client *ImagesClient) NewListByResourceGroupPager(resourceGroupName string, options *ImagesClientListByResourceGroupOptions) *runtime.Pager[ImagesClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[ImagesClientListByResourceGroupResponse]{ - More: func(page ImagesClientListByResourceGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ImagesClientListByResourceGroupResponse) (ImagesClientListByResourceGroupResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return ImagesClientListByResourceGroupResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ImagesClientListByResourceGroupResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ImagesClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) - } - return client.listByResourceGroupHandleResponse(resp) - }, - }) -} - -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *ImagesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ImagesClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *ImagesClient) listByResourceGroupHandleResponse(resp *http.Response) (ImagesClientListByResourceGroupResponse, error) { - result := ImagesClientListByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ImageListResult); err != nil { - return ImagesClientListByResourceGroupResponse{}, err - } - return result, nil -} - -// BeginUpdate - Update an image. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// imageName - The name of the image. -// parameters - Parameters supplied to the Update Image operation. -// options - ImagesClientBeginUpdateOptions contains the optional parameters for the ImagesClient.BeginUpdate method. -func (client *ImagesClient) BeginUpdate(ctx context.Context, resourceGroupName string, imageName string, parameters ImageUpdate, options *ImagesClientBeginUpdateOptions) (*runtime.Poller[ImagesClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, imageName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[ImagesClientUpdateResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[ImagesClientUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// Update - Update an image. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *ImagesClient) update(ctx context.Context, resourceGroupName string, imageName string, parameters ImageUpdate, options *ImagesClientBeginUpdateOptions) (*http.Response, error) { - req, err := client.updateCreateRequest(ctx, resourceGroupName, imageName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// updateCreateRequest creates the Update request. -func (client *ImagesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, imageName string, parameters ImageUpdate, options *ImagesClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if imageName == "" { - return nil, errors.New("parameter imageName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{imageName}", url.PathEscape(imageName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_loganalytics_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_loganalytics_client.go deleted file mode 100644 index b0dd5efe..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_loganalytics_client.go +++ /dev/null @@ -1,181 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// LogAnalyticsClient contains the methods for the LogAnalytics group. -// Don't use this type directly, use NewLogAnalyticsClient() instead. -type LogAnalyticsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewLogAnalyticsClient creates a new instance of LogAnalyticsClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewLogAnalyticsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LogAnalyticsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &LogAnalyticsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginExportRequestRateByInterval - Export logs that show Api requests made by this subscription in the given time window -// to show throttling activities. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// location - The location upon which virtual-machine-sizes is queried. -// parameters - Parameters supplied to the LogAnalytics getRequestRateByInterval Api. -// options - LogAnalyticsClientBeginExportRequestRateByIntervalOptions contains the optional parameters for the LogAnalyticsClient.BeginExportRequestRateByInterval -// method. -func (client *LogAnalyticsClient) BeginExportRequestRateByInterval(ctx context.Context, location string, parameters RequestRateByIntervalInput, options *LogAnalyticsClientBeginExportRequestRateByIntervalOptions) (*runtime.Poller[LogAnalyticsClientExportRequestRateByIntervalResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.exportRequestRateByInterval(ctx, location, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[LogAnalyticsClientExportRequestRateByIntervalResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[LogAnalyticsClientExportRequestRateByIntervalResponse](options.ResumeToken, client.pl, nil) - } -} - -// ExportRequestRateByInterval - Export logs that show Api requests made by this subscription in the given time window to -// show throttling activities. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *LogAnalyticsClient) exportRequestRateByInterval(ctx context.Context, location string, parameters RequestRateByIntervalInput, options *LogAnalyticsClientBeginExportRequestRateByIntervalOptions) (*http.Response, error) { - req, err := client.exportRequestRateByIntervalCreateRequest(ctx, location, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// exportRequestRateByIntervalCreateRequest creates the ExportRequestRateByInterval request. -func (client *LogAnalyticsClient) exportRequestRateByIntervalCreateRequest(ctx context.Context, location string, parameters RequestRateByIntervalInput, options *LogAnalyticsClientBeginExportRequestRateByIntervalOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/logAnalytics/apiAccess/getRequestRateByInterval" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginExportThrottledRequests - Export logs that show total throttled Api requests for this subscription in the given time -// window. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// location - The location upon which virtual-machine-sizes is queried. -// parameters - Parameters supplied to the LogAnalytics getThrottledRequests Api. -// options - LogAnalyticsClientBeginExportThrottledRequestsOptions contains the optional parameters for the LogAnalyticsClient.BeginExportThrottledRequests -// method. -func (client *LogAnalyticsClient) BeginExportThrottledRequests(ctx context.Context, location string, parameters ThrottledRequestsInput, options *LogAnalyticsClientBeginExportThrottledRequestsOptions) (*runtime.Poller[LogAnalyticsClientExportThrottledRequestsResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.exportThrottledRequests(ctx, location, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[LogAnalyticsClientExportThrottledRequestsResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[LogAnalyticsClientExportThrottledRequestsResponse](options.ResumeToken, client.pl, nil) - } -} - -// ExportThrottledRequests - Export logs that show total throttled Api requests for this subscription in the given time window. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *LogAnalyticsClient) exportThrottledRequests(ctx context.Context, location string, parameters ThrottledRequestsInput, options *LogAnalyticsClientBeginExportThrottledRequestsOptions) (*http.Response, error) { - req, err := client.exportThrottledRequestsCreateRequest(ctx, location, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// exportThrottledRequestsCreateRequest creates the ExportThrottledRequests request. -func (client *LogAnalyticsClient) exportThrottledRequestsCreateRequest(ctx context.Context, location string, parameters ThrottledRequestsInput, options *LogAnalyticsClientBeginExportThrottledRequestsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/logAnalytics/apiAccess/getThrottledRequests" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_models.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_models.go deleted file mode 100644 index e74c02ba..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_models.go +++ /dev/null @@ -1,9540 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import "time" - -// APIEntityReference - The API entity reference. -type APIEntityReference struct { - // The ARM resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/… - ID *string `json:"id,omitempty"` -} - -// APIError - Api error. -type APIError struct { - // The error code. - Code *string `json:"code,omitempty"` - - // The Api error details - Details []*APIErrorBase `json:"details,omitempty"` - - // The Api inner error - Innererror *InnerError `json:"innererror,omitempty"` - - // The error message. - Message *string `json:"message,omitempty"` - - // The target of the particular error. - Target *string `json:"target,omitempty"` -} - -// APIErrorBase - Api error base. -type APIErrorBase struct { - // The error code. - Code *string `json:"code,omitempty"` - - // The error message. - Message *string `json:"message,omitempty"` - - // The target of the particular error. - Target *string `json:"target,omitempty"` -} - -// AccessURI - A disk access SAS uri. -type AccessURI struct { - // READ-ONLY; A SAS uri for accessing a disk. - AccessSAS *string `json:"accessSAS,omitempty" azure:"ro"` - - // READ-ONLY; A SAS uri for accessing a VM guest state. - SecurityDataAccessSAS *string `json:"securityDataAccessSAS,omitempty" azure:"ro"` -} - -// AdditionalCapabilities - Enables or disables a capability on the virtual machine or virtual machine scale set. -type AdditionalCapabilities struct { - // The flag that enables or disables hibernation capability on the VM. - HibernationEnabled *bool `json:"hibernationEnabled,omitempty"` - - // The flag that enables or disables a capability to have one or more managed data disks with UltraSSDLRS storage account - // type on the VM or VMSS. Managed disks with storage account type UltraSSDLRS can - // be added to a virtual machine or virtual machine scale set only if this property is enabled. - UltraSSDEnabled *bool `json:"ultraSSDEnabled,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. -type AdditionalUnattendContent struct { - // The component name. Currently, the only allowable value is Microsoft-Windows-Shell-Setup. - ComponentName *string `json:"componentName,omitempty"` - - // Specifies the XML formatted content that is added to the unattend.xml file for the specified path and component. The XML - // must be less than 4KB and must include the root element for the setting or - // feature that is being inserted. - Content *string `json:"content,omitempty"` - - // The pass name. Currently, the only allowable value is OobeSystem. - PassName *string `json:"passName,omitempty"` - - // Specifies the name of the setting to which the content applies. Possible values are: FirstLogonCommands and AutoLogon. - SettingName *SettingNames `json:"settingName,omitempty"` -} - -// ApplicationProfile - Contains the list of gallery applications that should be made available to the VM/VMSS -type ApplicationProfile struct { - // Specifies the gallery applications that should be made available to the VM/VMSS - GalleryApplications []*VMGalleryApplication `json:"galleryApplications,omitempty"` -} - -// AutomaticOSUpgradePolicy - The configuration parameters used for performing automatic OS upgrade. -type AutomaticOSUpgradePolicy struct { - // Whether OS image rollback feature should be disabled. Default value is false. - DisableAutomaticRollback *bool `json:"disableAutomaticRollback,omitempty"` - - // Indicates whether OS upgrades should automatically be applied to scale set instances in a rolling fashion when a newer - // version of the OS image becomes available. Default value is false. - // If this is set to true for Windows based scale sets, enableAutomaticUpdates - // [https://docs.microsoft.com/dotnet/api/microsoft.azure.management.compute.models.windowsconfiguration.enableautomaticupdates?view=azure-dotnet] - // is automatically set to false and cannot be set to true. - EnableAutomaticOSUpgrade *bool `json:"enableAutomaticOSUpgrade,omitempty"` - - // Indicates whether rolling upgrade policy should be used during Auto OS Upgrade. Default value is false. Auto OS Upgrade - // will fallback to the default policy if no policy is defined on the VMSS. - UseRollingUpgradePolicy *bool `json:"useRollingUpgradePolicy,omitempty"` -} - -// AutomaticOSUpgradeProperties - Describes automatic OS upgrade properties on the image. -type AutomaticOSUpgradeProperties struct { - // REQUIRED; Specifies whether automatic OS upgrade is supported on the image. - AutomaticOSUpgradeSupported *bool `json:"automaticOSUpgradeSupported,omitempty"` -} - -// AutomaticRepairsPolicy - Specifies the configuration parameters for automatic repairs on the virtual machine scale set. -type AutomaticRepairsPolicy struct { - // Specifies whether automatic repairs should be enabled on the virtual machine scale set. The default value is false. - Enabled *bool `json:"enabled,omitempty"` - - // The amount of time for which automatic repairs are suspended due to a state change on VM. The grace time starts after the - // state change has completed. This helps avoid premature or accidental repairs. - // The time duration should be specified in ISO 8601 format. The minimum allowed grace period is 10 minutes (PT10M), which - // is also the default value. The maximum allowed grace period is 90 minutes - // (PT90M). - GracePeriod *string `json:"gracePeriod,omitempty"` - - // Type of repair action (replace, restart, reimage) that will be used for repairing unhealthy virtual machines in the scale - // set. Default value is replace. - RepairAction *RepairAction `json:"repairAction,omitempty"` -} - -// 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 Availability sets overview [https://docs.microsoft.com/azure/virtual-machines/availability-set-overview]. -// For more information on Azure planned maintenance, see Maintenance and updates for Virtual Machines in Azure [https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates] -// 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 { - // REQUIRED; Resource location - Location *string `json:"location,omitempty"` - - // The instance view of a resource. - Properties *AvailabilitySetProperties `json:"properties,omitempty"` - - // Sku of the availability set, only name is required to be set. See AvailabilitySetSkuTypes for possible set of values. Use - // 'Aligned' for virtual machines with managed disks and 'Classic' for virtual - // machines with unmanaged disks. Default value is 'Classic'. - SKU *SKU `json:"sku,omitempty"` - - // Resource tags - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; Resource Id - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; Resource name - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type - Type *string `json:"type,omitempty" azure:"ro"` -} - -// AvailabilitySetListResult - The List Availability Set operation response. -type AvailabilitySetListResult struct { - // REQUIRED; The list of availability sets - Value []*AvailabilitySet `json:"value,omitempty"` - - // The URI to fetch the next page of AvailabilitySets. Call ListNext() with this URI to fetch the next page of AvailabilitySets. - NextLink *string `json:"nextLink,omitempty"` -} - -// AvailabilitySetProperties - The instance view of a resource. -type AvailabilitySetProperties struct { - // Fault Domain count. - PlatformFaultDomainCount *int32 `json:"platformFaultDomainCount,omitempty"` - - // Update Domain count. - PlatformUpdateDomainCount *int32 `json:"platformUpdateDomainCount,omitempty"` - - // Specifies information about the proximity placement group that the availability set should be assigned to. - // Minimum api-version: 2018-04-01. - ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` - - // A list of references to all virtual machines in the availability set. - VirtualMachines []*SubResource `json:"virtualMachines,omitempty"` - - // READ-ONLY; The resource status information. - Statuses []*InstanceViewStatus `json:"statuses,omitempty" azure:"ro"` -} - -// AvailabilitySetUpdate - Specifies information about the availability set that the virtual machine should be assigned to. -// Only tags may be updated. -type AvailabilitySetUpdate struct { - // The instance view of a resource. - Properties *AvailabilitySetProperties `json:"properties,omitempty"` - - // Sku of the availability set - SKU *SKU `json:"sku,omitempty"` - - // Resource tags - Tags map[string]*string `json:"tags,omitempty"` -} - -// AvailabilitySetsClientCreateOrUpdateOptions contains the optional parameters for the AvailabilitySetsClient.CreateOrUpdate -// method. -type AvailabilitySetsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// AvailabilitySetsClientDeleteOptions contains the optional parameters for the AvailabilitySetsClient.Delete method. -type AvailabilitySetsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// AvailabilitySetsClientGetOptions contains the optional parameters for the AvailabilitySetsClient.Get method. -type AvailabilitySetsClientGetOptions struct { - // placeholder for future optional parameters -} - -// AvailabilitySetsClientListAvailableSizesOptions contains the optional parameters for the AvailabilitySetsClient.ListAvailableSizes -// method. -type AvailabilitySetsClientListAvailableSizesOptions struct { - // placeholder for future optional parameters -} - -// AvailabilitySetsClientListBySubscriptionOptions contains the optional parameters for the AvailabilitySetsClient.ListBySubscription -// method. -type AvailabilitySetsClientListBySubscriptionOptions struct { - // The expand expression to apply to the operation. Allowed values are 'instanceView'. - Expand *string -} - -// AvailabilitySetsClientListOptions contains the optional parameters for the AvailabilitySetsClient.List method. -type AvailabilitySetsClientListOptions struct { - // placeholder for future optional parameters -} - -// AvailabilitySetsClientUpdateOptions contains the optional parameters for the AvailabilitySetsClient.Update method. -type AvailabilitySetsClientUpdateOptions struct { - // placeholder for future optional parameters -} - -// AvailablePatchSummary - Describes the properties of an virtual machine instance view for available patch summary. -type AvailablePatchSummary struct { - // READ-ONLY; The activity ID of the operation that produced this result. It is used to correlate across CRP and extension - // logs. - AssessmentActivityID *string `json:"assessmentActivityId,omitempty" azure:"ro"` - - // READ-ONLY; The number of critical or security patches that have been detected as available and not yet installed. - CriticalAndSecurityPatchCount *int32 `json:"criticalAndSecurityPatchCount,omitempty" azure:"ro"` - - // READ-ONLY; The errors that were encountered during execution of the operation. The details array contains the list of them. - Error *APIError `json:"error,omitempty" azure:"ro"` - - // READ-ONLY; The UTC timestamp when the operation began. - LastModifiedTime *time.Time `json:"lastModifiedTime,omitempty" azure:"ro"` - - // READ-ONLY; The number of all available patches excluding critical and security. - OtherPatchCount *int32 `json:"otherPatchCount,omitempty" azure:"ro"` - - // READ-ONLY; The overall reboot status of the VM. It will be true when partially installed patches require a reboot to complete - // installation but the reboot has not yet occurred. - RebootPending *bool `json:"rebootPending,omitempty" azure:"ro"` - - // READ-ONLY; The UTC timestamp when the operation began. - StartTime *time.Time `json:"startTime,omitempty" azure:"ro"` - - // READ-ONLY; The overall success or failure status of the operation. It remains "InProgress" until the operation completes. - // At that point it will become "Unknown", "Failed", "Succeeded", or - // "CompletedWithWarnings." - Status *PatchOperationStatus `json:"status,omitempty" azure:"ro"` -} - -// BillingProfile - Specifies the billing related details of a Azure Spot VM or VMSS. -// Minimum api-version: 2019-03-01. -type BillingProfile struct { - // Specifies the maximum price you are willing to pay for a Azure Spot VM/VMSS. This price is in US Dollars. - // This price will be compared with the current Azure Spot price for the VM size. Also, the prices are compared at the time - // of create/update of Azure Spot VM/VMSS and the operation will only succeed if - // the maxPrice is greater than the current Azure Spot price. - // The maxPrice will also be used for evicting a Azure Spot VM/VMSS if the current Azure Spot price goes beyond the maxPrice - // after creation of VM/VMSS. - // Possible values are: - // - Any decimal value greater than zero. Example: 0.01538 - // -1 – indicates default price to be up-to on-demand. - // You can set the maxPrice to -1 to indicate that the Azure Spot VM/VMSS should not be evicted for price reasons. Also, the - // default max price is -1 if it is not provided by you. - // Minimum api-version: 2019-03-01. - MaxPrice *float64 `json:"maxPrice,omitempty"` -} - -// BootDiagnostics - Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to diagnose -// VM status. -// You can easily view the output of your console log. -// Azure also enables you to see a screenshot of the VM from the hypervisor. -type BootDiagnostics struct { - // Whether boot diagnostics should be enabled on the Virtual Machine. - Enabled *bool `json:"enabled,omitempty"` - - // Uri of the storage account to use for placing the console output and screenshot. - // If storageUri is not specified while enabling boot diagnostics, managed storage will be used. - StorageURI *string `json:"storageUri,omitempty"` -} - -// BootDiagnosticsInstanceView - The instance view of a virtual machine boot diagnostics. -type BootDiagnosticsInstanceView struct { - // READ-ONLY; The console screenshot blob URI. - // NOTE: This will not be set if boot diagnostics is currently enabled with managed storage. - ConsoleScreenshotBlobURI *string `json:"consoleScreenshotBlobUri,omitempty" azure:"ro"` - - // READ-ONLY; The serial console log blob Uri. - // NOTE: This will not be set if boot diagnostics is currently enabled with managed storage. - SerialConsoleLogBlobURI *string `json:"serialConsoleLogBlobUri,omitempty" azure:"ro"` - - // READ-ONLY; The boot diagnostics status information for the VM. - // NOTE: It will be set only if there are errors encountered in enabling boot diagnostics. - Status *InstanceViewStatus `json:"status,omitempty" azure:"ro"` -} - -// CapacityReservation - Specifies information about the capacity reservation. -type CapacityReservation struct { - // REQUIRED; Resource location - Location *string `json:"location,omitempty"` - - // REQUIRED; SKU of the resource for which capacity needs be reserved. The SKU name and capacity is required to be set. Currently - // VM Skus with the capability called 'CapacityReservationSupported' set to true are - // supported. Refer to List Microsoft.Compute SKUs in a region (https://docs.microsoft.com/rest/api/compute/resourceskus/list) - // for supported values. - SKU *SKU `json:"sku,omitempty"` - - // Properties of the Capacity reservation. - Properties *CapacityReservationProperties `json:"properties,omitempty"` - - // Resource tags - Tags map[string]*string `json:"tags,omitempty"` - - // Availability Zone to use for this capacity reservation. The zone has to be single value and also should be part for the - // list of zones specified during the capacity reservation group creation. The zone - // can be assigned only during creation. If not provided, the reservation supports only non-zonal deployments. If provided, - // enforces VM/VMSS using this capacity reservation to be in same zone. - Zones []*string `json:"zones,omitempty"` - - // READ-ONLY; Resource Id - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; Resource name - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type - Type *string `json:"type,omitempty" azure:"ro"` -} - -// CapacityReservationGroup - Specifies information about the capacity reservation group that the capacity reservations should -// be assigned to. -// Currently, a capacity reservation can only be added to a capacity reservation group at creation time. An existing capacity -// reservation cannot be added or moved to another capacity reservation group. -type CapacityReservationGroup struct { - // REQUIRED; Resource location - Location *string `json:"location,omitempty"` - - // capacity reservation group Properties. - Properties *CapacityReservationGroupProperties `json:"properties,omitempty"` - - // Resource tags - Tags map[string]*string `json:"tags,omitempty"` - - // Availability Zones to use for this capacity reservation group. The zones can be assigned only during creation. If not provided, - // the group supports only regional resources in the region. If provided, - // enforces each capacity reservation in the group to be in one of the zones. - Zones []*string `json:"zones,omitempty"` - - // READ-ONLY; Resource Id - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; Resource name - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type - Type *string `json:"type,omitempty" azure:"ro"` -} - -type CapacityReservationGroupInstanceView struct { - // READ-ONLY; List of instance view of the capacity reservations under the capacity reservation group. - CapacityReservations []*CapacityReservationInstanceViewWithName `json:"capacityReservations,omitempty" azure:"ro"` -} - -// CapacityReservationGroupListResult - The List capacity reservation group with resource group response. -type CapacityReservationGroupListResult struct { - // REQUIRED; The list of capacity reservation groups - Value []*CapacityReservationGroup `json:"value,omitempty"` - - // The URI to fetch the next page of capacity reservation groups. Call ListNext() with this URI to fetch the next page of - // capacity reservation groups. - NextLink *string `json:"nextLink,omitempty"` -} - -// CapacityReservationGroupProperties - capacity reservation group Properties. -type CapacityReservationGroupProperties struct { - // READ-ONLY; A list of all capacity reservation resource ids that belong to capacity reservation group. - CapacityReservations []*SubResourceReadOnly `json:"capacityReservations,omitempty" azure:"ro"` - - // READ-ONLY; The capacity reservation group instance view which has the list of instance views for all the capacity reservations - // that belong to the capacity reservation group. - InstanceView *CapacityReservationGroupInstanceView `json:"instanceView,omitempty" azure:"ro"` - - // READ-ONLY; A list of references to all virtual machines associated to the capacity reservation group. - VirtualMachinesAssociated []*SubResourceReadOnly `json:"virtualMachinesAssociated,omitempty" azure:"ro"` -} - -// CapacityReservationGroupUpdate - Specifies information about the capacity reservation group. Only tags can be updated. -type CapacityReservationGroupUpdate struct { - // capacity reservation group Properties. - Properties *CapacityReservationGroupProperties `json:"properties,omitempty"` - - // Resource tags - Tags map[string]*string `json:"tags,omitempty"` -} - -// CapacityReservationGroupsClientCreateOrUpdateOptions contains the optional parameters for the CapacityReservationGroupsClient.CreateOrUpdate -// method. -type CapacityReservationGroupsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// CapacityReservationGroupsClientDeleteOptions contains the optional parameters for the CapacityReservationGroupsClient.Delete -// method. -type CapacityReservationGroupsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// CapacityReservationGroupsClientGetOptions contains the optional parameters for the CapacityReservationGroupsClient.Get -// method. -type CapacityReservationGroupsClientGetOptions struct { - // The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance views of the capacity - // reservations under the capacity reservation group which is a snapshot of the - // runtime properties of a capacity reservation that is managed by the platform and can change outside of control plane operations. - Expand *CapacityReservationGroupInstanceViewTypes -} - -// CapacityReservationGroupsClientListByResourceGroupOptions contains the optional parameters for the CapacityReservationGroupsClient.ListByResourceGroup -// method. -type CapacityReservationGroupsClientListByResourceGroupOptions struct { - // The expand expression to apply on the operation. Based on the expand param(s) specified we return Virtual Machine or ScaleSet - // VM Instance or both resource Ids which are associated to capacity - // reservation group in the response. - Expand *ExpandTypesForGetCapacityReservationGroups -} - -// CapacityReservationGroupsClientListBySubscriptionOptions contains the optional parameters for the CapacityReservationGroupsClient.ListBySubscription -// method. -type CapacityReservationGroupsClientListBySubscriptionOptions struct { - // The expand expression to apply on the operation. Based on the expand param(s) specified we return Virtual Machine or ScaleSet - // VM Instance or both resource Ids which are associated to capacity - // reservation group in the response. - Expand *ExpandTypesForGetCapacityReservationGroups -} - -// CapacityReservationGroupsClientUpdateOptions contains the optional parameters for the CapacityReservationGroupsClient.Update -// method. -type CapacityReservationGroupsClientUpdateOptions struct { - // placeholder for future optional parameters -} - -// CapacityReservationInstanceView - The instance view of a capacity reservation that provides as snapshot of the runtime -// properties of the capacity reservation that is managed by the platform and can change outside of control plane -// operations. -type CapacityReservationInstanceView struct { - // The resource status information. - Statuses []*InstanceViewStatus `json:"statuses,omitempty"` - - // Unutilized capacity of the capacity reservation. - UtilizationInfo *CapacityReservationUtilization `json:"utilizationInfo,omitempty"` -} - -// CapacityReservationInstanceViewWithName - The instance view of a capacity reservation that includes the name of the capacity -// reservation. It is used for the response to the instance view of a capacity reservation group. -type CapacityReservationInstanceViewWithName struct { - // The resource status information. - Statuses []*InstanceViewStatus `json:"statuses,omitempty"` - - // Unutilized capacity of the capacity reservation. - UtilizationInfo *CapacityReservationUtilization `json:"utilizationInfo,omitempty"` - - // READ-ONLY; The name of the capacity reservation. - Name *string `json:"name,omitempty" azure:"ro"` -} - -// CapacityReservationListResult - The list capacity reservation operation response. -type CapacityReservationListResult struct { - // REQUIRED; The list of capacity reservations - Value []*CapacityReservation `json:"value,omitempty"` - - // The URI to fetch the next page of capacity reservations. Call ListNext() with this URI to fetch the next page of capacity - // reservations. - NextLink *string `json:"nextLink,omitempty"` -} - -// CapacityReservationProfile - The parameters of a capacity reservation Profile. -type CapacityReservationProfile struct { - // Specifies the capacity reservation group resource id that should be used for allocating the virtual machine or scaleset - // vm instances provided enough capacity has been reserved. Please refer to - // https://aka.ms/CapacityReservation for more details. - CapacityReservationGroup *SubResource `json:"capacityReservationGroup,omitempty"` -} - -// CapacityReservationProperties - Properties of the Capacity reservation. -type CapacityReservationProperties struct { - // READ-ONLY; The Capacity reservation instance view. - InstanceView *CapacityReservationInstanceView `json:"instanceView,omitempty" azure:"ro"` - - // READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *string `json:"provisioningState,omitempty" azure:"ro"` - - // READ-ONLY; The date time when the capacity reservation was last updated. - ProvisioningTime *time.Time `json:"provisioningTime,omitempty" azure:"ro"` - - // READ-ONLY; A unique id generated and assigned to the capacity reservation by the platform which does not change throughout - // the lifetime of the resource. - ReservationID *string `json:"reservationId,omitempty" azure:"ro"` - - // READ-ONLY; Specifies the time at which the Capacity Reservation resource was created. - // Minimum api-version: 2022-03-01. - TimeCreated *time.Time `json:"timeCreated,omitempty" azure:"ro"` - - // READ-ONLY; A list of all virtual machine resource ids that are associated with the capacity reservation. - VirtualMachinesAssociated []*SubResourceReadOnly `json:"virtualMachinesAssociated,omitempty" azure:"ro"` -} - -// CapacityReservationUpdate - Specifies information about the capacity reservation. Only tags and sku.capacity can be updated. -type CapacityReservationUpdate struct { - // Properties of the Capacity reservation. - Properties *CapacityReservationProperties `json:"properties,omitempty"` - - // SKU of the resource for which capacity needs be reserved. The SKU name and capacity is required to be set. Currently VM - // Skus with the capability called 'CapacityReservationSupported' set to true are - // supported. Refer to List Microsoft.Compute SKUs in a region (https://docs.microsoft.com/rest/api/compute/resourceskus/list) - // for supported values. - SKU *SKU `json:"sku,omitempty"` - - // Resource tags - Tags map[string]*string `json:"tags,omitempty"` -} - -// CapacityReservationUtilization - Represents the capacity reservation utilization in terms of resources allocated. -type CapacityReservationUtilization struct { - // READ-ONLY; A list of all virtual machines resource ids allocated against the capacity reservation. - VirtualMachinesAllocated []*SubResourceReadOnly `json:"virtualMachinesAllocated,omitempty" azure:"ro"` -} - -// CapacityReservationsClientBeginCreateOrUpdateOptions contains the optional parameters for the CapacityReservationsClient.BeginCreateOrUpdate -// method. -type CapacityReservationsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CapacityReservationsClientBeginDeleteOptions contains the optional parameters for the CapacityReservationsClient.BeginDelete -// method. -type CapacityReservationsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CapacityReservationsClientBeginUpdateOptions contains the optional parameters for the CapacityReservationsClient.BeginUpdate -// method. -type CapacityReservationsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CapacityReservationsClientGetOptions contains the optional parameters for the CapacityReservationsClient.Get method. -type CapacityReservationsClientGetOptions struct { - // The expand expression to apply on the operation. 'InstanceView' retrieves a snapshot of the runtime properties of the capacity - // reservation that is managed by the platform and can change outside of - // control plane operations. - Expand *CapacityReservationInstanceViewTypes -} - -// CapacityReservationsClientListByCapacityReservationGroupOptions contains the optional parameters for the CapacityReservationsClient.ListByCapacityReservationGroup -// method. -type CapacityReservationsClientListByCapacityReservationGroupOptions struct { - // placeholder for future optional parameters -} - -// CloudError - An error response from the Compute service. -type CloudError struct { - // Api error. - Error *APIError `json:"error,omitempty"` -} - -// CloudService - Describes the cloud service. -type CloudService struct { - // REQUIRED; Resource location. - Location *string `json:"location,omitempty"` - - // Cloud service properties - Properties *CloudServiceProperties `json:"properties,omitempty"` - - // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; Resource Id. - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// CloudServiceExtensionProfile - Describes a cloud service extension profile. -type CloudServiceExtensionProfile struct { - // List of extensions for the cloud service. - Extensions []*Extension `json:"extensions,omitempty"` -} - -// CloudServiceExtensionProperties - Extension Properties. -type CloudServiceExtensionProperties struct { - // Explicitly specify whether platform can automatically upgrade typeHandlerVersion to higher minor versions when they become - // available. - AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` - - // Tag to force apply the provided public and protected settings. Changing the tag value allows for re-running the extension - // without changing any of the public or protected settings. If forceUpdateTag is - // not changed, updates to public or protected settings would still be applied by the handler. If neither forceUpdateTag nor - // any of public or protected settings change, extension would flow to the role - // instance with the same sequence-number, and it is up to handler implementation whether to re-run it or not - ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` - - // Protected settings for the extension which are encrypted before sent to the role instance. - ProtectedSettings *string `json:"protectedSettings,omitempty"` - ProtectedSettingsFromKeyVault *CloudServiceVaultAndSecretReference `json:"protectedSettingsFromKeyVault,omitempty"` - - // The name of the extension handler publisher. - Publisher *string `json:"publisher,omitempty"` - - // Optional list of roles to apply this extension. If property is not specified or '*' is specified, extension is applied - // to all roles in the cloud service. - RolesAppliedTo []*string `json:"rolesAppliedTo,omitempty"` - - // Public settings for the extension. For JSON extensions, this is the JSON settings for the extension. For XML Extension - // (like RDP), this is the XML setting for the extension. - Settings *string `json:"settings,omitempty"` - - // Specifies the type of the extension. - Type *string `json:"type,omitempty"` - - // Specifies the version of the extension. Specifies the version of the extension. If this element is not specified or an - // asterisk (*) is used as the value, the latest version of the extension is used. - // If the value is specified with a major version number and an asterisk as the minor version number (X.), the latest minor - // version of the specified major version is selected. If a major version number - // and a minor version number are specified (X.Y), the specific extension version is selected. If a version is specified, - // an auto-upgrade is performed on the role instance. - TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` - - // READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *string `json:"provisioningState,omitempty" azure:"ro"` -} - -// CloudServiceInstanceView - InstanceView of CloudService as a whole -type CloudServiceInstanceView struct { - // Instance view statuses. - RoleInstance *InstanceViewStatusesSummary `json:"roleInstance,omitempty"` - - // READ-ONLY; Specifies a list of unique identifiers generated internally for the cloud service. - // NOTE: If you are using Azure Diagnostics extension, this property can be used as 'DeploymentId' for querying details. - PrivateIDs []*string `json:"privateIds,omitempty" azure:"ro"` - - // READ-ONLY; The version of the SDK that was used to generate the package for the cloud service. - SdkVersion *string `json:"sdkVersion,omitempty" azure:"ro"` - - // READ-ONLY - Statuses []*ResourceInstanceViewStatus `json:"statuses,omitempty" azure:"ro"` -} - -type CloudServiceListResult struct { - // REQUIRED - Value []*CloudService `json:"value,omitempty"` - NextLink *string `json:"nextLink,omitempty"` -} - -// CloudServiceNetworkProfile - Network Profile for the cloud service. -type CloudServiceNetworkProfile struct { - // List of Load balancer configurations. Cloud service can have up to two load balancer configurations, corresponding to a - // Public Load Balancer and an Internal Load Balancer. - LoadBalancerConfigurations []*LoadBalancerConfiguration `json:"loadBalancerConfigurations,omitempty"` - - // The id reference of the cloud service containing the target IP with which the subject cloud service can perform a swap. - // This property cannot be updated once it is set. The swappable cloud service - // referred by this id must be present otherwise an error will be thrown. - SwappableCloudService *SubResource `json:"swappableCloudService,omitempty"` -} - -// CloudServiceOperatingSystemsClientGetOSFamilyOptions contains the optional parameters for the CloudServiceOperatingSystemsClient.GetOSFamily -// method. -type CloudServiceOperatingSystemsClientGetOSFamilyOptions struct { - // placeholder for future optional parameters -} - -// CloudServiceOperatingSystemsClientGetOSVersionOptions contains the optional parameters for the CloudServiceOperatingSystemsClient.GetOSVersion -// method. -type CloudServiceOperatingSystemsClientGetOSVersionOptions struct { - // placeholder for future optional parameters -} - -// CloudServiceOperatingSystemsClientListOSFamiliesOptions contains the optional parameters for the CloudServiceOperatingSystemsClient.ListOSFamilies -// method. -type CloudServiceOperatingSystemsClientListOSFamiliesOptions struct { - // placeholder for future optional parameters -} - -// CloudServiceOperatingSystemsClientListOSVersionsOptions contains the optional parameters for the CloudServiceOperatingSystemsClient.ListOSVersions -// method. -type CloudServiceOperatingSystemsClientListOSVersionsOptions struct { - // placeholder for future optional parameters -} - -// CloudServiceOsProfile - Describes the OS profile for the cloud service. -type CloudServiceOsProfile struct { - // Specifies set of certificates that should be installed onto the role instances. - Secrets []*CloudServiceVaultSecretGroup `json:"secrets,omitempty"` -} - -// CloudServiceProperties - Cloud service properties -type CloudServiceProperties struct { - // (Optional) Indicates whether the role sku properties (roleProfile.roles.sku) specified in the model/template should override - // the role instance count and vm size specified in the .cscfg and .csdef - // respectively. The default value is false. - AllowModelOverride *bool `json:"allowModelOverride,omitempty"` - - // Specifies the XML service configuration (.cscfg) for the cloud service. - Configuration *string `json:"configuration,omitempty"` - - // Specifies a URL that refers to the location of the service configuration in the Blob service. The service package URL can - // be Shared Access Signature (SAS) URI from any storage account. This is a - // write-only property and is not returned in GET calls. - ConfigurationURL *string `json:"configurationUrl,omitempty"` - - // Describes a cloud service extension profile. - ExtensionProfile *CloudServiceExtensionProfile `json:"extensionProfile,omitempty"` - - // Network Profile for the cloud service. - NetworkProfile *CloudServiceNetworkProfile `json:"networkProfile,omitempty"` - - // Describes the OS profile for the cloud service. - OSProfile *CloudServiceOsProfile `json:"osProfile,omitempty"` - - // Specifies a URL that refers to the location of the service package in the Blob service. The service package URL can be - // Shared Access Signature (SAS) URI from any storage account. This is a write-only - // property and is not returned in GET calls. - PackageURL *string `json:"packageUrl,omitempty"` - - // Describes the role profile for the cloud service. - RoleProfile *CloudServiceRoleProfile `json:"roleProfile,omitempty"` - - // (Optional) Indicates whether to start the cloud service immediately after it is created. The default value is true. If - // false, the service model is still deployed, but the code is not run immediately. - // Instead, the service is PoweredOff until you call Start, at which time the service will be started. A deployed service - // still incurs charges, even if it is poweredoff. - StartCloudService *bool `json:"startCloudService,omitempty"` - - // Update mode for the cloud service. Role instances are allocated to update domains when the service is deployed. Updates - // can be initiated manually in each update domain or initiated automatically in - // all update domains. Possible Values are - // Auto - // Manual - // Simultaneous - // If not specified, the default value is Auto. If set to Manual, PUT UpdateDomain must be called to apply the update. If - // set to Auto, the update is automatically applied to each update domain in - // sequence. - UpgradeMode *CloudServiceUpgradeMode `json:"upgradeMode,omitempty"` - - // READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *string `json:"provisioningState,omitempty" azure:"ro"` - - // READ-ONLY; The unique identifier for the cloud service. - UniqueID *string `json:"uniqueId,omitempty" azure:"ro"` -} - -// CloudServiceRole - Describes a role of the cloud service. -type CloudServiceRole struct { - Properties *CloudServiceRoleProperties `json:"properties,omitempty"` - - // Describes the cloud service role sku. - SKU *CloudServiceRoleSKU `json:"sku,omitempty"` - - // READ-ONLY; Resource id - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; Resource location - Location *string `json:"location,omitempty" azure:"ro"` - - // READ-ONLY; Resource name - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type - Type *string `json:"type,omitempty" azure:"ro"` -} - -// CloudServiceRoleInstancesClientBeginDeleteOptions contains the optional parameters for the CloudServiceRoleInstancesClient.BeginDelete -// method. -type CloudServiceRoleInstancesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CloudServiceRoleInstancesClientBeginRebuildOptions contains the optional parameters for the CloudServiceRoleInstancesClient.BeginRebuild -// method. -type CloudServiceRoleInstancesClientBeginRebuildOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CloudServiceRoleInstancesClientBeginReimageOptions contains the optional parameters for the CloudServiceRoleInstancesClient.BeginReimage -// method. -type CloudServiceRoleInstancesClientBeginReimageOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CloudServiceRoleInstancesClientBeginRestartOptions contains the optional parameters for the CloudServiceRoleInstancesClient.BeginRestart -// method. -type CloudServiceRoleInstancesClientBeginRestartOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CloudServiceRoleInstancesClientGetInstanceViewOptions contains the optional parameters for the CloudServiceRoleInstancesClient.GetInstanceView -// method. -type CloudServiceRoleInstancesClientGetInstanceViewOptions struct { - // placeholder for future optional parameters -} - -// CloudServiceRoleInstancesClientGetOptions contains the optional parameters for the CloudServiceRoleInstancesClient.Get -// method. -type CloudServiceRoleInstancesClientGetOptions struct { - // The expand expression to apply to the operation. 'UserData' is not supported for cloud services. - Expand *InstanceViewTypes -} - -// CloudServiceRoleInstancesClientGetRemoteDesktopFileOptions contains the optional parameters for the CloudServiceRoleInstancesClient.GetRemoteDesktopFile -// method. -type CloudServiceRoleInstancesClientGetRemoteDesktopFileOptions struct { - // placeholder for future optional parameters -} - -// CloudServiceRoleInstancesClientListOptions contains the optional parameters for the CloudServiceRoleInstancesClient.List -// method. -type CloudServiceRoleInstancesClientListOptions struct { - // The expand expression to apply to the operation. 'UserData' is not supported for cloud services. - Expand *InstanceViewTypes -} - -type CloudServiceRoleListResult struct { - // REQUIRED - Value []*CloudServiceRole `json:"value,omitempty"` - NextLink *string `json:"nextLink,omitempty"` -} - -// CloudServiceRoleProfile - Describes the role profile for the cloud service. -type CloudServiceRoleProfile struct { - // List of roles for the cloud service. - Roles []*CloudServiceRoleProfileProperties `json:"roles,omitempty"` -} - -// CloudServiceRoleProfileProperties - Describes the role properties. -type CloudServiceRoleProfileProperties struct { - // Resource name. - Name *string `json:"name,omitempty"` - - // Describes the cloud service role sku. - SKU *CloudServiceRoleSKU `json:"sku,omitempty"` -} - -type CloudServiceRoleProperties struct { - // READ-ONLY; Specifies the ID which uniquely identifies a cloud service role. - UniqueID *string `json:"uniqueId,omitempty" azure:"ro"` -} - -// CloudServiceRoleSKU - Describes the cloud service role sku. -type CloudServiceRoleSKU struct { - // Specifies the number of role instances in the cloud service. - Capacity *int64 `json:"capacity,omitempty"` - - // The sku name. NOTE: If the new SKU is not supported on the hardware the cloud service is currently on, you need to delete - // and recreate the cloud service or move back to the old sku. - Name *string `json:"name,omitempty"` - - // Specifies the tier of the cloud service. Possible Values are - // Standard - // Basic - Tier *string `json:"tier,omitempty"` -} - -// CloudServiceRolesClientGetOptions contains the optional parameters for the CloudServiceRolesClient.Get method. -type CloudServiceRolesClientGetOptions struct { - // placeholder for future optional parameters -} - -// CloudServiceRolesClientListOptions contains the optional parameters for the CloudServiceRolesClient.List method. -type CloudServiceRolesClientListOptions struct { - // placeholder for future optional parameters -} - -type CloudServiceUpdate struct { - // Resource tags - Tags map[string]*string `json:"tags,omitempty"` -} - -type CloudServiceVaultAndSecretReference struct { - SecretURL *string `json:"secretUrl,omitempty"` - SourceVault *SubResource `json:"sourceVault,omitempty"` -} - -// CloudServiceVaultCertificate - Describes a single certificate reference in a Key Vault, and where the certificate should -// reside on the role instance. -type CloudServiceVaultCertificate struct { - // This is the URL of a certificate that has been uploaded to Key Vault as a secret. - CertificateURL *string `json:"certificateUrl,omitempty"` -} - -// CloudServiceVaultSecretGroup - Describes a set of certificates which are all in the same Key Vault. -type CloudServiceVaultSecretGroup struct { - // The relative URL of the Key Vault containing all of the certificates in VaultCertificates. - SourceVault *SubResource `json:"sourceVault,omitempty"` - - // The list of key vault references in SourceVault which contain certificates. - VaultCertificates []*CloudServiceVaultCertificate `json:"vaultCertificates,omitempty"` -} - -// CloudServicesClientBeginCreateOrUpdateOptions contains the optional parameters for the CloudServicesClient.BeginCreateOrUpdate -// method. -type CloudServicesClientBeginCreateOrUpdateOptions struct { - // The cloud service object. - Parameters *CloudService - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CloudServicesClientBeginDeleteInstancesOptions contains the optional parameters for the CloudServicesClient.BeginDeleteInstances -// method. -type CloudServicesClientBeginDeleteInstancesOptions struct { - // List of cloud service role instance names. - Parameters *RoleInstances - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CloudServicesClientBeginDeleteOptions contains the optional parameters for the CloudServicesClient.BeginDelete method. -type CloudServicesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CloudServicesClientBeginPowerOffOptions contains the optional parameters for the CloudServicesClient.BeginPowerOff method. -type CloudServicesClientBeginPowerOffOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CloudServicesClientBeginRebuildOptions contains the optional parameters for the CloudServicesClient.BeginRebuild method. -type CloudServicesClientBeginRebuildOptions struct { - // List of cloud service role instance names. - Parameters *RoleInstances - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CloudServicesClientBeginReimageOptions contains the optional parameters for the CloudServicesClient.BeginReimage method. -type CloudServicesClientBeginReimageOptions struct { - // List of cloud service role instance names. - Parameters *RoleInstances - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CloudServicesClientBeginRestartOptions contains the optional parameters for the CloudServicesClient.BeginRestart method. -type CloudServicesClientBeginRestartOptions struct { - // List of cloud service role instance names. - Parameters *RoleInstances - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CloudServicesClientBeginStartOptions contains the optional parameters for the CloudServicesClient.BeginStart method. -type CloudServicesClientBeginStartOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CloudServicesClientBeginUpdateOptions contains the optional parameters for the CloudServicesClient.BeginUpdate method. -type CloudServicesClientBeginUpdateOptions struct { - // The cloud service object. - Parameters *CloudServiceUpdate - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CloudServicesClientGetInstanceViewOptions contains the optional parameters for the CloudServicesClient.GetInstanceView -// method. -type CloudServicesClientGetInstanceViewOptions struct { - // placeholder for future optional parameters -} - -// CloudServicesClientGetOptions contains the optional parameters for the CloudServicesClient.Get method. -type CloudServicesClientGetOptions struct { - // placeholder for future optional parameters -} - -// CloudServicesClientListAllOptions contains the optional parameters for the CloudServicesClient.ListAll method. -type CloudServicesClientListAllOptions struct { - // placeholder for future optional parameters -} - -// CloudServicesClientListOptions contains the optional parameters for the CloudServicesClient.List method. -type CloudServicesClientListOptions struct { - // placeholder for future optional parameters -} - -// CloudServicesUpdateDomainClientBeginWalkUpdateDomainOptions contains the optional parameters for the CloudServicesUpdateDomainClient.BeginWalkUpdateDomain -// method. -type CloudServicesUpdateDomainClientBeginWalkUpdateDomainOptions struct { - // The update domain object. - Parameters *UpdateDomain - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CloudServicesUpdateDomainClientGetUpdateDomainOptions contains the optional parameters for the CloudServicesUpdateDomainClient.GetUpdateDomain -// method. -type CloudServicesUpdateDomainClientGetUpdateDomainOptions struct { - // placeholder for future optional parameters -} - -// CloudServicesUpdateDomainClientListUpdateDomainsOptions contains the optional parameters for the CloudServicesUpdateDomainClient.ListUpdateDomains -// method. -type CloudServicesUpdateDomainClientListUpdateDomainsOptions struct { - // placeholder for future optional parameters -} - -// CommunityGalleriesClientGetOptions contains the optional parameters for the CommunityGalleriesClient.Get method. -type CommunityGalleriesClientGetOptions struct { - // placeholder for future optional parameters -} - -// CommunityGallery - Specifies information about the Community Gallery that you want to create or update. -type CommunityGallery struct { - // The identifier information of community gallery. - Identifier *CommunityGalleryIdentifier `json:"identifier,omitempty"` - - // READ-ONLY; Resource location - Location *string `json:"location,omitempty" azure:"ro"` - - // READ-ONLY; Resource name - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type - Type *string `json:"type,omitempty" azure:"ro"` -} - -// CommunityGalleryIdentifier - The identifier information of community gallery. -type CommunityGalleryIdentifier struct { - // The unique id of this community gallery. - UniqueID *string `json:"uniqueId,omitempty"` -} - -// CommunityGalleryImage - Specifies information about the gallery image definition that you want to create or update. -type CommunityGalleryImage struct { - // The identifier information of community gallery. - Identifier *CommunityGalleryIdentifier `json:"identifier,omitempty"` - - // Describes the properties of a gallery image definition. - Properties *CommunityGalleryImageProperties `json:"properties,omitempty"` - - // READ-ONLY; Resource location - Location *string `json:"location,omitempty" azure:"ro"` - - // READ-ONLY; Resource name - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type - Type *string `json:"type,omitempty" azure:"ro"` -} - -// CommunityGalleryImageProperties - Describes the properties of a gallery image definition. -type CommunityGalleryImageProperties struct { - // REQUIRED; This is the gallery image definition identifier. - Identifier *GalleryImageIdentifier `json:"identifier,omitempty"` - - // REQUIRED; This property allows the user to specify whether the virtual machines created under this image are 'Generalized' - // or 'Specialized'. - OSState *OperatingSystemStateTypes `json:"osState,omitempty"` - - // REQUIRED; This property allows you to specify the type of the OS that is included in the disk when creating a VM from a - // managed image. - // Possible values are: - // Windows - // Linux - OSType *OperatingSystemTypes `json:"osType,omitempty"` - - // Describes the disallowed disk types. - Disallowed *Disallowed `json:"disallowed,omitempty"` - - // The end of life date of the gallery image definition. This property can be used for decommissioning purposes. This property - // is updatable. - EndOfLifeDate *time.Time `json:"endOfLifeDate,omitempty"` - - // A list of gallery image features. - Features []*GalleryImageFeature `json:"features,omitempty"` - - // The hypervisor generation of the Virtual Machine. Applicable to OS disks only. - HyperVGeneration *HyperVGeneration `json:"hyperVGeneration,omitempty"` - - // Describes the gallery image definition purchase plan. This is used by marketplace images. - PurchasePlan *ImagePurchasePlan `json:"purchasePlan,omitempty"` - - // The properties describe the recommended machine configuration for this Image Definition. These properties are updatable. - Recommended *RecommendedMachineConfiguration `json:"recommended,omitempty"` -} - -// CommunityGalleryImageVersion - Specifies information about the gallery image version that you want to create or update. -type CommunityGalleryImageVersion struct { - // The identifier information of community gallery. - Identifier *CommunityGalleryIdentifier `json:"identifier,omitempty"` - - // Describes the properties of a gallery image version. - Properties *CommunityGalleryImageVersionProperties `json:"properties,omitempty"` - - // READ-ONLY; Resource location - Location *string `json:"location,omitempty" azure:"ro"` - - // READ-ONLY; Resource name - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type - Type *string `json:"type,omitempty" azure:"ro"` -} - -// CommunityGalleryImageVersionProperties - Describes the properties of a gallery image version. -type CommunityGalleryImageVersionProperties struct { - // The end of life date of the gallery image version Definition. This property can be used for decommissioning purposes. This - // property is updatable. - EndOfLifeDate *time.Time `json:"endOfLifeDate,omitempty"` - - // The published date of the gallery image version Definition. This property can be used for decommissioning purposes. This - // property is updatable. - PublishedDate *time.Time `json:"publishedDate,omitempty"` -} - -// CommunityGalleryImageVersionsClientGetOptions contains the optional parameters for the CommunityGalleryImageVersionsClient.Get -// method. -type CommunityGalleryImageVersionsClientGetOptions struct { - // placeholder for future optional parameters -} - -// CommunityGalleryImagesClientGetOptions contains the optional parameters for the CommunityGalleryImagesClient.Get method. -type CommunityGalleryImagesClientGetOptions struct { - // placeholder for future optional parameters -} - -// CommunityGalleryInfo - Information of community gallery if current gallery is shared to community -type CommunityGalleryInfo struct { - // Community gallery publisher eula - Eula *string `json:"eula,omitempty"` - - // Community gallery public name prefix - PublicNamePrefix *string `json:"publicNamePrefix,omitempty"` - - // Community gallery publisher contact email - PublisherContact *string `json:"publisherContact,omitempty"` - - // Community gallery publisher uri - PublisherURI *string `json:"publisherUri,omitempty"` - - // READ-ONLY; Contains info about whether community gallery sharing is enabled. - CommunityGalleryEnabled *bool `json:"communityGalleryEnabled,omitempty" azure:"ro"` - - // READ-ONLY; Community gallery public name list. - PublicNames []*string `json:"publicNames,omitempty" azure:"ro"` -} - -// CreationData - Data used when creating a disk. -type CreationData struct { - // REQUIRED; This enumerates the possible sources of a disk's creation. - CreateOption *DiskCreateOption `json:"createOption,omitempty"` - - // Required if creating from a Gallery Image. The id of the ImageDiskReference will be the ARM id of the shared galley image - // version from which to create a disk. - GalleryImageReference *ImageDiskReference `json:"galleryImageReference,omitempty"` - - // Disk source information. - ImageReference *ImageDiskReference `json:"imageReference,omitempty"` - - // Logical sector size in bytes for Ultra disks. Supported values are 512 ad 4096. 4096 is the default. - LogicalSectorSize *int32 `json:"logicalSectorSize,omitempty"` - - // If createOption is ImportSecure, this is the URI of a blob to be imported into VM guest state. - SecurityDataURI *string `json:"securityDataUri,omitempty"` - - // If createOption is Copy, this is the ARM id of the source snapshot or disk. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - - // If createOption is Import, this is the URI of a blob to be imported into a managed disk. - SourceURI *string `json:"sourceUri,omitempty"` - - // Required if createOption is Import. The Azure Resource Manager identifier of the storage account containing the blob to - // import as a disk. - StorageAccountID *string `json:"storageAccountId,omitempty"` - - // If createOption is Upload, this is the size of the contents of the upload including the VHD footer. This value should be - // between 20972032 (20 MiB + 512 bytes for the VHD footer) and 35183298347520 - // bytes (32 TiB + 512 bytes for the VHD footer). - UploadSizeBytes *int64 `json:"uploadSizeBytes,omitempty"` - - // READ-ONLY; If this field is set, this is the unique id identifying the source of this resource. - SourceUniqueID *string `json:"sourceUniqueId,omitempty" azure:"ro"` -} - -// DataDisk - Describes a data disk. -type DataDisk struct { - // REQUIRED; Specifies how the virtual machine should be created. - // Possible values are: - // Attach \u2013 This value is used when you are using a specialized disk to create the virtual machine. - // FromImage \u2013 This value is used when you are using an image to create the virtual machine. If you are using a platform - // image, you also use the imageReference element described above. If you are - // using a marketplace image, you also use the plan element previously described. - CreateOption *DiskCreateOptionTypes `json:"createOption,omitempty"` - - // REQUIRED; Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and - // therefore must be unique for each data disk attached to a VM. - Lun *int32 `json:"lun,omitempty"` - - // Specifies the caching requirements. - // Possible values are: - // None - // ReadOnly - // ReadWrite - // Default: None for Standard storage. ReadOnly for Premium storage - Caching *CachingTypes `json:"caching,omitempty"` - - // Specifies whether data disk should be deleted or detached upon VM deletion. - // Possible values: - // Delete If this value is used, the data disk is deleted when VM is deleted. - // Detach If this value is used, the data disk is retained after VM is deleted. - // The default value is set to detach - DeleteOption *DiskDeleteOptionTypes `json:"deleteOption,omitempty"` - - // Specifies the detach behavior to be used while detaching a disk or which is already in the process of detachment from the - // virtual machine. Supported values: ForceDetach. - // detachOption: ForceDetach is applicable only for managed data disks. If a previous detachment attempt of the data disk - // did not complete due to an unexpected failure from the virtual machine and the - // disk is still not released then use force-detach as a last resort option to detach the disk forcibly from the VM. All writes - // might not have been flushed when using this detach behavior. - // This feature is still in preview mode and is not supported for VirtualMachineScaleSet. To force-detach a data disk update - // toBeDetached to 'true' along with setting detachOption: 'ForceDetach'. - DetachOption *DiskDetachOptionTypes `json:"detachOption,omitempty"` - - // Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a - // virtual machine image. - // This value cannot be larger than 1023 GB - DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` - - // 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. - Image *VirtualHardDisk `json:"image,omitempty"` - - // The managed disk parameters. - ManagedDisk *ManagedDiskParameters `json:"managedDisk,omitempty"` - - // The disk name. - Name *string `json:"name,omitempty"` - - // Specifies whether the data disk is in process of detachment from the VirtualMachine/VirtualMachineScaleset - ToBeDetached *bool `json:"toBeDetached,omitempty"` - - // The virtual hard disk. - Vhd *VirtualHardDisk `json:"vhd,omitempty"` - - // Specifies whether writeAccelerator should be enabled or disabled on the disk. - WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` - - // READ-ONLY; Specifies the Read-Write IOPS for the managed disk when StorageAccountType is UltraSSD_LRS. Returned only for - // VirtualMachine ScaleSet VM disks. Can be updated only via updates to the VirtualMachine - // Scale Set. - DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty" azure:"ro"` - - // READ-ONLY; Specifies the bandwidth in MB per second for the managed disk when StorageAccountType is UltraSSD_LRS. Returned - // only for VirtualMachine ScaleSet VM disks. Can be updated only via updates to the - // VirtualMachine Scale Set. - DiskMBpsReadWrite *int64 `json:"diskMBpsReadWrite,omitempty" azure:"ro"` -} - -// DataDiskImage - Contains the data disk images information. -type DataDiskImage struct { - // READ-ONLY; Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM - // and therefore must be unique for each data disk attached to a VM. - Lun *int32 `json:"lun,omitempty" azure:"ro"` -} - -// DataDiskImageEncryption - Contains encryption settings for a data disk image. -type DataDiskImageEncryption struct { - // REQUIRED; This property specifies the logical unit number of the data disk. This value is used to identify data disks within - // the Virtual Machine and therefore must be unique for each data disk attached to the - // Virtual Machine. - Lun *int32 `json:"lun,omitempty"` - - // A relative URI containing the resource ID of the disk encryption set. - DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` -} - -// DedicatedHost - Specifies information about the Dedicated host. -type DedicatedHost struct { - // REQUIRED; Resource location - Location *string `json:"location,omitempty"` - - // REQUIRED; SKU of the dedicated host for Hardware Generation and VM family. Only name is required to be set. List Microsoft.Compute - // SKUs for a list of possible values. - SKU *SKU `json:"sku,omitempty"` - - // Properties of the dedicated host. - Properties *DedicatedHostProperties `json:"properties,omitempty"` - - // Resource tags - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; Resource Id - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; Resource name - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type - Type *string `json:"type,omitempty" azure:"ro"` -} - -// DedicatedHostAllocatableVM - Represents the dedicated host unutilized capacity in terms of a specific VM size. -type DedicatedHostAllocatableVM struct { - // Maximum number of VMs of size vmSize that can fit in the dedicated host's remaining capacity. - Count *float64 `json:"count,omitempty"` - - // VM size in terms of which the unutilized capacity is represented. - VMSize *string `json:"vmSize,omitempty"` -} - -// DedicatedHostAvailableCapacity - Dedicated host unutilized capacity. -type DedicatedHostAvailableCapacity struct { - // The unutilized capacity of the dedicated host represented in terms of each VM size that is allowed to be deployed to the - // dedicated host. - AllocatableVMs []*DedicatedHostAllocatableVM `json:"allocatableVMs,omitempty"` -} - -// DedicatedHostGroup - Specifies information about the dedicated host group that the dedicated hosts should be assigned to. -// Currently, a dedicated host can only be added to a dedicated host group at creation time. An existing dedicated host cannot -// be added to another dedicated host group. -type DedicatedHostGroup struct { - // REQUIRED; Resource location - Location *string `json:"location,omitempty"` - - // Dedicated Host Group Properties. - Properties *DedicatedHostGroupProperties `json:"properties,omitempty"` - - // Resource tags - Tags map[string]*string `json:"tags,omitempty"` - - // Availability Zone to use for this host group. Only single zone is supported. The zone can be assigned only during creation. - // If not provided, the group supports all zones in the region. If provided, - // enforces each host in the group to be in the same zone. - Zones []*string `json:"zones,omitempty"` - - // READ-ONLY; Resource Id - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; Resource name - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type - Type *string `json:"type,omitempty" azure:"ro"` -} - -type DedicatedHostGroupInstanceView struct { - // List of instance view of the dedicated hosts under the dedicated host group. - Hosts []*DedicatedHostInstanceViewWithName `json:"hosts,omitempty"` -} - -// DedicatedHostGroupListResult - The List Dedicated Host Group with resource group response. -type DedicatedHostGroupListResult struct { - // REQUIRED; The list of dedicated host groups - Value []*DedicatedHostGroup `json:"value,omitempty"` - - // The URI to fetch the next page of Dedicated Host Groups. Call ListNext() with this URI to fetch the next page of Dedicated - // Host Groups. - NextLink *string `json:"nextLink,omitempty"` -} - -// DedicatedHostGroupProperties - Dedicated Host Group Properties. -type DedicatedHostGroupProperties struct { - // REQUIRED; Number of fault domains that the host group can span. - PlatformFaultDomainCount *int32 `json:"platformFaultDomainCount,omitempty"` - - // Enables or disables a capability on the dedicated host group. - // Minimum api-version: 2022-03-01. - AdditionalCapabilities *DedicatedHostGroupPropertiesAdditionalCapabilities `json:"additionalCapabilities,omitempty"` - - // Specifies whether virtual machines or virtual machine scale sets can be placed automatically on the dedicated host group. - // Automatic placement means resources are allocated on dedicated hosts, that are - // chosen by Azure, under the dedicated host group. The value is defaulted to 'false' when not provided. - // Minimum api-version: 2020-06-01. - SupportAutomaticPlacement *bool `json:"supportAutomaticPlacement,omitempty"` - - // READ-ONLY; A list of references to all dedicated hosts in the dedicated host group. - Hosts []*SubResourceReadOnly `json:"hosts,omitempty" azure:"ro"` - - // READ-ONLY; The dedicated host group instance view, which has the list of instance view of the dedicated hosts under the - // dedicated host group. - InstanceView *DedicatedHostGroupInstanceView `json:"instanceView,omitempty" azure:"ro"` -} - -// DedicatedHostGroupPropertiesAdditionalCapabilities - Enables or disables a capability on the dedicated host group. -// Minimum api-version: 2022-03-01. -type DedicatedHostGroupPropertiesAdditionalCapabilities struct { - // The flag that enables or disables a capability to have UltraSSD Enabled Virtual Machines on Dedicated Hosts of the Dedicated - // Host Group. For the Virtual Machines to be UltraSSD Enabled, - // UltraSSDEnabled flag for the resource needs to be set true as well. The value is defaulted to 'false' when not provided. - // Please refer to - // https://docs.microsoft.com/en-us/azure/virtual-machines/disks-enable-ultra-ssd for more details on Ultra SSD feature. - // NOTE: The ultraSSDEnabled setting can only be enabled for Host Groups that are created as zonal. - // Minimum api-version: 2022-03-01. - UltraSSDEnabled *bool `json:"ultraSSDEnabled,omitempty"` -} - -// DedicatedHostGroupUpdate - Specifies information about the dedicated host group that the dedicated host should be assigned -// to. Only tags may be updated. -type DedicatedHostGroupUpdate struct { - // Dedicated Host Group Properties. - Properties *DedicatedHostGroupProperties `json:"properties,omitempty"` - - // Resource tags - Tags map[string]*string `json:"tags,omitempty"` - - // Availability Zone to use for this host group. Only single zone is supported. The zone can be assigned only during creation. - // If not provided, the group supports all zones in the region. If provided, - // enforces each host in the group to be in the same zone. - Zones []*string `json:"zones,omitempty"` -} - -// DedicatedHostGroupsClientCreateOrUpdateOptions contains the optional parameters for the DedicatedHostGroupsClient.CreateOrUpdate -// method. -type DedicatedHostGroupsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// DedicatedHostGroupsClientDeleteOptions contains the optional parameters for the DedicatedHostGroupsClient.Delete method. -type DedicatedHostGroupsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// DedicatedHostGroupsClientGetOptions contains the optional parameters for the DedicatedHostGroupsClient.Get method. -type DedicatedHostGroupsClientGetOptions struct { - // The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance views of the dedicated - // hosts under the dedicated host group. 'UserData' is not supported for - // dedicated host group. - Expand *InstanceViewTypes -} - -// DedicatedHostGroupsClientListByResourceGroupOptions contains the optional parameters for the DedicatedHostGroupsClient.ListByResourceGroup -// method. -type DedicatedHostGroupsClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// DedicatedHostGroupsClientListBySubscriptionOptions contains the optional parameters for the DedicatedHostGroupsClient.ListBySubscription -// method. -type DedicatedHostGroupsClientListBySubscriptionOptions struct { - // placeholder for future optional parameters -} - -// DedicatedHostGroupsClientUpdateOptions contains the optional parameters for the DedicatedHostGroupsClient.Update method. -type DedicatedHostGroupsClientUpdateOptions struct { - // placeholder for future optional parameters -} - -// DedicatedHostInstanceView - The instance view of a dedicated host. -type DedicatedHostInstanceView struct { - // Unutilized capacity of the dedicated host. - AvailableCapacity *DedicatedHostAvailableCapacity `json:"availableCapacity,omitempty"` - - // The resource status information. - Statuses []*InstanceViewStatus `json:"statuses,omitempty"` - - // READ-ONLY; Specifies the unique id of the dedicated physical machine on which the dedicated host resides. - AssetID *string `json:"assetId,omitempty" azure:"ro"` -} - -// DedicatedHostInstanceViewWithName - The instance view of a dedicated host that includes the name of the dedicated host. -// It is used for the response to the instance view of a dedicated host group. -type DedicatedHostInstanceViewWithName struct { - // Unutilized capacity of the dedicated host. - AvailableCapacity *DedicatedHostAvailableCapacity `json:"availableCapacity,omitempty"` - - // The resource status information. - Statuses []*InstanceViewStatus `json:"statuses,omitempty"` - - // READ-ONLY; Specifies the unique id of the dedicated physical machine on which the dedicated host resides. - AssetID *string `json:"assetId,omitempty" azure:"ro"` - - // READ-ONLY; The name of the dedicated host. - Name *string `json:"name,omitempty" azure:"ro"` -} - -// DedicatedHostListResult - The list dedicated host operation response. -type DedicatedHostListResult struct { - // REQUIRED; The list of dedicated hosts - Value []*DedicatedHost `json:"value,omitempty"` - - // The URI to fetch the next page of dedicated hosts. Call ListNext() with this URI to fetch the next page of dedicated hosts. - NextLink *string `json:"nextLink,omitempty"` -} - -// DedicatedHostProperties - Properties of the dedicated host. -type DedicatedHostProperties struct { - // Specifies whether the dedicated host should be replaced automatically in case of a failure. The value is defaulted to 'true' - // when not provided. - AutoReplaceOnFailure *bool `json:"autoReplaceOnFailure,omitempty"` - - // Specifies the software license type that will be applied to the VMs deployed on the dedicated host. - // Possible values are: - // None - // WindowsServerHybrid - // WindowsServerPerpetual - // Default: None - LicenseType *DedicatedHostLicenseTypes `json:"licenseType,omitempty"` - - // Fault domain of the dedicated host within a dedicated host group. - PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"` - - // READ-ONLY; A unique id generated and assigned to the dedicated host by the platform. - // Does not change throughout the lifetime of the host. - HostID *string `json:"hostId,omitempty" azure:"ro"` - - // READ-ONLY; The dedicated host instance view. - InstanceView *DedicatedHostInstanceView `json:"instanceView,omitempty" azure:"ro"` - - // READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *string `json:"provisioningState,omitempty" azure:"ro"` - - // READ-ONLY; The date when the host was first provisioned. - ProvisioningTime *time.Time `json:"provisioningTime,omitempty" azure:"ro"` - - // READ-ONLY; Specifies the time at which the Dedicated Host resource was created. - // Minimum api-version: 2022-03-01. - TimeCreated *time.Time `json:"timeCreated,omitempty" azure:"ro"` - - // READ-ONLY; A list of references to all virtual machines in the Dedicated Host. - VirtualMachines []*SubResourceReadOnly `json:"virtualMachines,omitempty" azure:"ro"` -} - -// DedicatedHostUpdate - Specifies information about the dedicated host. Only tags, autoReplaceOnFailure and licenseType may -// be updated. -type DedicatedHostUpdate struct { - // Properties of the dedicated host. - Properties *DedicatedHostProperties `json:"properties,omitempty"` - - // Resource tags - Tags map[string]*string `json:"tags,omitempty"` -} - -// DedicatedHostsClientBeginCreateOrUpdateOptions contains the optional parameters for the DedicatedHostsClient.BeginCreateOrUpdate -// method. -type DedicatedHostsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DedicatedHostsClientBeginDeleteOptions contains the optional parameters for the DedicatedHostsClient.BeginDelete method. -type DedicatedHostsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DedicatedHostsClientBeginRestartOptions contains the optional parameters for the DedicatedHostsClient.BeginRestart method. -type DedicatedHostsClientBeginRestartOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DedicatedHostsClientBeginUpdateOptions contains the optional parameters for the DedicatedHostsClient.BeginUpdate method. -type DedicatedHostsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DedicatedHostsClientGetOptions contains the optional parameters for the DedicatedHostsClient.Get method. -type DedicatedHostsClientGetOptions struct { - // The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance views of the dedicated - // host. 'UserData' is not supported for dedicated host. - Expand *InstanceViewTypes -} - -// DedicatedHostsClientListByHostGroupOptions contains the optional parameters for the DedicatedHostsClient.ListByHostGroup -// method. -type DedicatedHostsClientListByHostGroupOptions struct { - // placeholder for future optional parameters -} - -// DiagnosticsProfile - Specifies the boot diagnostic settings state. -// Minimum api-version: 2015-06-15. -type DiagnosticsProfile struct { - // Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to diagnose VM status. - // NOTE: If storageUri is being specified then ensure that the storage account is in the same region and subscription as the - // VM. - // You can easily view the output of your console log. - // Azure also enables you to see a screenshot of the VM from the hypervisor. - BootDiagnostics *BootDiagnostics `json:"bootDiagnostics,omitempty"` -} - -// DiffDiskSettings - Describes the parameters of ephemeral disk settings that can be specified for operating system disk. -// NOTE: The ephemeral disk settings can only be specified for managed disk. -type DiffDiskSettings struct { - // Specifies the ephemeral disk settings for operating system disk. - Option *DiffDiskOptions `json:"option,omitempty"` - - // Specifies the ephemeral disk placement for operating system disk. - // Possible values are: - // CacheDisk - // ResourceDisk - // Default: CacheDisk if one is configured for the VM size otherwise ResourceDisk is used. - // Refer to VM size documentation for Windows VM at https://docs.microsoft.com/azure/virtual-machines/windows/sizes and Linux - // VM at https://docs.microsoft.com/azure/virtual-machines/linux/sizes to check - // which VM sizes exposes a cache disk. - Placement *DiffDiskPlacement `json:"placement,omitempty"` -} - -// Disallowed - Describes the disallowed disk types. -type Disallowed struct { - // A list of disk types. - DiskTypes []*string `json:"diskTypes,omitempty"` -} - -// DisallowedConfiguration - Specifies the disallowed configuration for a virtual machine image. -type DisallowedConfiguration struct { - // VM disk types which are disallowed. - VMDiskType *VMDiskTypes `json:"vmDiskType,omitempty"` -} - -// Disk resource. -type Disk struct { - // REQUIRED; Resource location - Location *string `json:"location,omitempty"` - - // The extended location where the disk will be created. Extended location cannot be changed. - ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` - - // Disk resource properties. - Properties *DiskProperties `json:"properties,omitempty"` - - // The disks sku name. Can be StandardLRS, PremiumLRS, StandardSSDLRS, UltraSSDLRS, PremiumZRS, or StandardSSDZRS. - SKU *DiskSKU `json:"sku,omitempty"` - - // Resource tags - Tags map[string]*string `json:"tags,omitempty"` - - // The Logical zone list for Disk. - Zones []*string `json:"zones,omitempty"` - - // READ-ONLY; Resource Id - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; A relative URI containing the ID of the VM that has the disk attached. - ManagedBy *string `json:"managedBy,omitempty" azure:"ro"` - - // READ-ONLY; List of relative URIs containing the IDs of the VMs that have the disk attached. maxShares should be set to - // a value greater than one for disks to allow attaching them to multiple VMs. - ManagedByExtended []*string `json:"managedByExtended,omitempty" azure:"ro"` - - // READ-ONLY; Resource name - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type - Type *string `json:"type,omitempty" azure:"ro"` -} - -// DiskAccess - disk access resource. -type DiskAccess struct { - // REQUIRED; Resource location - Location *string `json:"location,omitempty"` - - // The extended location where the disk access will be created. Extended location cannot be changed. - ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` - Properties *DiskAccessProperties `json:"properties,omitempty"` - - // Resource tags - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; Resource Id - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; Resource name - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type - Type *string `json:"type,omitempty" azure:"ro"` -} - -// DiskAccessList - The List disk access operation response. -type DiskAccessList struct { - // REQUIRED; A list of disk access resources. - Value []*DiskAccess `json:"value,omitempty"` - - // The uri to fetch the next page of disk access resources. Call ListNext() with this to fetch the next page of disk access - // resources. - NextLink *string `json:"nextLink,omitempty"` -} - -type DiskAccessProperties struct { - // READ-ONLY; A readonly collection of private endpoint connections created on the disk. Currently only one endpoint connection - // is supported. - PrivateEndpointConnections []*PrivateEndpointConnection `json:"privateEndpointConnections,omitempty" azure:"ro"` - - // READ-ONLY; The disk access resource provisioning state. - ProvisioningState *string `json:"provisioningState,omitempty" azure:"ro"` - - // READ-ONLY; The time when the disk access was created. - TimeCreated *time.Time `json:"timeCreated,omitempty" azure:"ro"` -} - -// DiskAccessUpdate - Used for updating a disk access resource. -type DiskAccessUpdate struct { - // Resource tags - Tags map[string]*string `json:"tags,omitempty"` -} - -// DiskAccessesClientBeginCreateOrUpdateOptions contains the optional parameters for the DiskAccessesClient.BeginCreateOrUpdate -// method. -type DiskAccessesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DiskAccessesClientBeginDeleteAPrivateEndpointConnectionOptions contains the optional parameters for the DiskAccessesClient.BeginDeleteAPrivateEndpointConnection -// method. -type DiskAccessesClientBeginDeleteAPrivateEndpointConnectionOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DiskAccessesClientBeginDeleteOptions contains the optional parameters for the DiskAccessesClient.BeginDelete method. -type DiskAccessesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DiskAccessesClientBeginUpdateAPrivateEndpointConnectionOptions contains the optional parameters for the DiskAccessesClient.BeginUpdateAPrivateEndpointConnection -// method. -type DiskAccessesClientBeginUpdateAPrivateEndpointConnectionOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DiskAccessesClientBeginUpdateOptions contains the optional parameters for the DiskAccessesClient.BeginUpdate method. -type DiskAccessesClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DiskAccessesClientGetAPrivateEndpointConnectionOptions contains the optional parameters for the DiskAccessesClient.GetAPrivateEndpointConnection -// method. -type DiskAccessesClientGetAPrivateEndpointConnectionOptions struct { - // placeholder for future optional parameters -} - -// DiskAccessesClientGetOptions contains the optional parameters for the DiskAccessesClient.Get method. -type DiskAccessesClientGetOptions struct { - // placeholder for future optional parameters -} - -// DiskAccessesClientGetPrivateLinkResourcesOptions contains the optional parameters for the DiskAccessesClient.GetPrivateLinkResources -// method. -type DiskAccessesClientGetPrivateLinkResourcesOptions struct { - // placeholder for future optional parameters -} - -// DiskAccessesClientListByResourceGroupOptions contains the optional parameters for the DiskAccessesClient.ListByResourceGroup -// method. -type DiskAccessesClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// DiskAccessesClientListOptions contains the optional parameters for the DiskAccessesClient.List method. -type DiskAccessesClientListOptions struct { - // placeholder for future optional parameters -} - -// DiskAccessesClientListPrivateEndpointConnectionsOptions contains the optional parameters for the DiskAccessesClient.ListPrivateEndpointConnections -// method. -type DiskAccessesClientListPrivateEndpointConnectionsOptions struct { - // placeholder for future optional parameters -} - -// DiskEncryptionSet - disk encryption set resource. -type DiskEncryptionSet struct { - // REQUIRED; Resource location - Location *string `json:"location,omitempty"` - - // The managed identity for the disk encryption set. It should be given permission on the key vault before it can be used - // to encrypt disks. - Identity *EncryptionSetIdentity `json:"identity,omitempty"` - Properties *EncryptionSetProperties `json:"properties,omitempty"` - - // Resource tags - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; Resource Id - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; Resource name - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type - Type *string `json:"type,omitempty" azure:"ro"` -} - -// DiskEncryptionSetList - The List disk encryption set operation response. -type DiskEncryptionSetList struct { - // REQUIRED; A list of disk encryption sets. - Value []*DiskEncryptionSet `json:"value,omitempty"` - - // The uri to fetch the next page of disk encryption sets. Call ListNext() with this to fetch the next page of disk encryption - // sets. - NextLink *string `json:"nextLink,omitempty"` -} - -// DiskEncryptionSetParameters - Describes the parameter of customer managed disk encryption set resource id that can be specified -// for disk. -// NOTE: The disk encryption set resource id can only be specified for managed disk. Please refer https://aka.ms/mdssewithcmkoverview -// for more details. -type DiskEncryptionSetParameters struct { - // Resource Id - ID *string `json:"id,omitempty"` -} - -// DiskEncryptionSetUpdate - disk encryption set update resource. -type DiskEncryptionSetUpdate struct { - // The managed identity for the disk encryption set. It should be given permission on the key vault before it can be used - // to encrypt disks. - Identity *EncryptionSetIdentity `json:"identity,omitempty"` - - // disk encryption set resource update properties. - Properties *DiskEncryptionSetUpdateProperties `json:"properties,omitempty"` - - // Resource tags - Tags map[string]*string `json:"tags,omitempty"` -} - -// DiskEncryptionSetUpdateProperties - disk encryption set resource update properties. -type DiskEncryptionSetUpdateProperties struct { - // Key Vault Key Url to be used for server side encryption of Managed Disks and Snapshots - ActiveKey *KeyForDiskEncryptionSet `json:"activeKey,omitempty"` - - // The type of key used to encrypt the data of the disk. - EncryptionType *DiskEncryptionSetType `json:"encryptionType,omitempty"` - - // Set this flag to true to enable auto-updating of this disk encryption set to the latest key version. - RotationToLatestKeyVersionEnabled *bool `json:"rotationToLatestKeyVersionEnabled,omitempty"` -} - -// DiskEncryptionSetsClientBeginCreateOrUpdateOptions contains the optional parameters for the DiskEncryptionSetsClient.BeginCreateOrUpdate -// method. -type DiskEncryptionSetsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DiskEncryptionSetsClientBeginDeleteOptions contains the optional parameters for the DiskEncryptionSetsClient.BeginDelete -// method. -type DiskEncryptionSetsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DiskEncryptionSetsClientBeginUpdateOptions contains the optional parameters for the DiskEncryptionSetsClient.BeginUpdate -// method. -type DiskEncryptionSetsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DiskEncryptionSetsClientGetOptions contains the optional parameters for the DiskEncryptionSetsClient.Get method. -type DiskEncryptionSetsClientGetOptions struct { - // placeholder for future optional parameters -} - -// DiskEncryptionSetsClientListAssociatedResourcesOptions contains the optional parameters for the DiskEncryptionSetsClient.ListAssociatedResources -// method. -type DiskEncryptionSetsClientListAssociatedResourcesOptions struct { - // placeholder for future optional parameters -} - -// DiskEncryptionSetsClientListByResourceGroupOptions contains the optional parameters for the DiskEncryptionSetsClient.ListByResourceGroup -// method. -type DiskEncryptionSetsClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// DiskEncryptionSetsClientListOptions contains the optional parameters for the DiskEncryptionSetsClient.List method. -type DiskEncryptionSetsClientListOptions struct { - // placeholder for future optional parameters -} - -// DiskEncryptionSettings - Describes a Encryption Settings for a Disk -type DiskEncryptionSettings struct { - // Specifies the location of the disk encryption key, which is a Key Vault Secret. - DiskEncryptionKey *KeyVaultSecretReference `json:"diskEncryptionKey,omitempty"` - - // Specifies whether disk encryption should be enabled on the virtual machine. - Enabled *bool `json:"enabled,omitempty"` - - // Specifies the location of the key encryption key in Key Vault. - KeyEncryptionKey *KeyVaultKeyReference `json:"keyEncryptionKey,omitempty"` -} - -// DiskImageEncryption - This is the disk image encryption base class. -type DiskImageEncryption struct { - // A relative URI containing the resource ID of the disk encryption set. - DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` -} - -// DiskInstanceView - The instance view of the disk. -type DiskInstanceView struct { - // Specifies the encryption settings for the OS Disk. - // Minimum api-version: 2015-06-15 - EncryptionSettings []*DiskEncryptionSettings `json:"encryptionSettings,omitempty"` - - // The disk name. - Name *string `json:"name,omitempty"` - - // The resource status information. - Statuses []*InstanceViewStatus `json:"statuses,omitempty"` -} - -// DiskList - The List Disks operation response. -type DiskList struct { - // REQUIRED; A list of disks. - Value []*Disk `json:"value,omitempty"` - - // The uri to fetch the next page of disks. Call ListNext() with this to fetch the next page of disks. - NextLink *string `json:"nextLink,omitempty"` -} - -// DiskProperties - Disk resource properties. -type DiskProperties struct { - // REQUIRED; Disk source information. CreationData information cannot be changed after the disk has been created. - CreationData *CreationData `json:"creationData,omitempty"` - - // Set to true to enable bursting beyond the provisioned performance target of the disk. Bursting is disabled by default. - // Does not apply to Ultra disks. - BurstingEnabled *bool `json:"burstingEnabled,omitempty"` - - // Percentage complete for the background copy when a resource is created via the CopyStart operation. - CompletionPercent *float32 `json:"completionPercent,omitempty"` - - // Additional authentication requirements when exporting or uploading to a disk or snapshot. - DataAccessAuthMode *DataAccessAuthMode `json:"dataAccessAuthMode,omitempty"` - - // ARM id of the DiskAccess resource for using private endpoints on disks. - DiskAccessID *string `json:"diskAccessId,omitempty"` - - // The total number of IOPS that will be allowed across all VMs mounting the shared disk as ReadOnly. One operation can transfer - // between 4k and 256k bytes. - DiskIOPSReadOnly *int64 `json:"diskIOPSReadOnly,omitempty"` - - // The number of IOPS allowed for this disk; only settable for UltraSSD disks. One operation can transfer between 4k and 256k - // bytes. - DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` - - // The total throughput (MBps) that will be allowed across all VMs mounting the shared disk as ReadOnly. MBps means millions - // of bytes per second - MB here uses the ISO notation, of powers of 10. - DiskMBpsReadOnly *int64 `json:"diskMBpsReadOnly,omitempty"` - - // The bandwidth allowed for this disk; only settable for UltraSSD disks. MBps means millions of bytes per second - MB here - // uses the ISO notation, of powers of 10. - DiskMBpsReadWrite *int64 `json:"diskMBpsReadWrite,omitempty"` - - // If creationData.createOption is Empty, this field is mandatory and it indicates the size of the disk to create. If this - // field is present for updates or creation with other options, it indicates a - // resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size. - DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` - - // Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. - Encryption *Encryption `json:"encryption,omitempty"` - - // Encryption settings collection used for Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. - EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` - - // The hypervisor generation of the Virtual Machine. Applicable to OS disks only. - HyperVGeneration *HyperVGeneration `json:"hyperVGeneration,omitempty"` - - // The maximum number of VMs that can attach to the disk at the same time. Value greater than one indicates a disk that can - // be mounted on multiple VMs at the same time. - MaxShares *int32 `json:"maxShares,omitempty"` - - // Policy for accessing the disk via network. - NetworkAccessPolicy *NetworkAccessPolicy `json:"networkAccessPolicy,omitempty"` - - // The Operating System type. - OSType *OperatingSystemTypes `json:"osType,omitempty"` - - // Policy for controlling export on the disk. - PublicNetworkAccess *PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` - - // Purchase plan information for the the image from which the OS disk was created. E.g. - {name: 2019-Datacenter, publisher: - // MicrosoftWindowsServer, product: WindowsServer} - PurchasePlan *DiskPurchasePlan `json:"purchasePlan,omitempty"` - - // Contains the security related information for the resource. - SecurityProfile *DiskSecurityProfile `json:"securityProfile,omitempty"` - - // List of supported capabilities for the image from which the OS disk was created. - SupportedCapabilities *SupportedCapabilities `json:"supportedCapabilities,omitempty"` - - // Indicates the OS on a disk supports hibernation. - SupportsHibernation *bool `json:"supportsHibernation,omitempty"` - - // Performance tier of the disk (e.g, P4, S10) as described here: https://azure.microsoft.com/en-us/pricing/details/managed-disks/. - // Does not apply to Ultra disks. - Tier *string `json:"tier,omitempty"` - - // READ-ONLY; The size of the disk in bytes. This field is read only. - DiskSizeBytes *int64 `json:"diskSizeBytes,omitempty" azure:"ro"` - - // READ-ONLY; The state of the disk. - DiskState *DiskState `json:"diskState,omitempty" azure:"ro"` - - // READ-ONLY; Properties of the disk for which update is pending. - PropertyUpdatesInProgress *PropertyUpdatesInProgress `json:"propertyUpdatesInProgress,omitempty" azure:"ro"` - - // READ-ONLY; The disk provisioning state. - ProvisioningState *string `json:"provisioningState,omitempty" azure:"ro"` - - // READ-ONLY; Details of the list of all VMs that have the disk attached. maxShares should be set to a value greater than - // one for disks to allow attaching them to multiple VMs. - ShareInfo []*ShareInfoElement `json:"shareInfo,omitempty" azure:"ro"` - - // READ-ONLY; The time when the disk was created. - TimeCreated *time.Time `json:"timeCreated,omitempty" azure:"ro"` - - // READ-ONLY; Unique Guid identifying the resource. - UniqueID *string `json:"uniqueId,omitempty" azure:"ro"` -} - -// DiskPurchasePlan - Used for establishing the purchase context of any 3rd Party artifact through MarketPlace. -type DiskPurchasePlan struct { - // REQUIRED; The plan ID. - Name *string `json:"name,omitempty"` - - // REQUIRED; Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference - // element. - Product *string `json:"product,omitempty"` - - // REQUIRED; The publisher ID. - Publisher *string `json:"publisher,omitempty"` - - // The Offer Promotion Code. - PromotionCode *string `json:"promotionCode,omitempty"` -} - -// DiskRestorePoint - Properties of disk restore point -type DiskRestorePoint struct { - // Properties of an incremental disk restore point - Properties *DiskRestorePointProperties `json:"properties,omitempty"` - - // READ-ONLY; Resource Id - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; Resource name - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type - Type *string `json:"type,omitempty" azure:"ro"` -} - -// DiskRestorePointClientBeginGrantAccessOptions contains the optional parameters for the DiskRestorePointClient.BeginGrantAccess -// method. -type DiskRestorePointClientBeginGrantAccessOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DiskRestorePointClientBeginRevokeAccessOptions contains the optional parameters for the DiskRestorePointClient.BeginRevokeAccess -// method. -type DiskRestorePointClientBeginRevokeAccessOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DiskRestorePointClientGetOptions contains the optional parameters for the DiskRestorePointClient.Get method. -type DiskRestorePointClientGetOptions struct { - // placeholder for future optional parameters -} - -// DiskRestorePointClientListByRestorePointOptions contains the optional parameters for the DiskRestorePointClient.ListByRestorePoint -// method. -type DiskRestorePointClientListByRestorePointOptions struct { - // placeholder for future optional parameters -} - -// DiskRestorePointInstanceView - The instance view of a disk restore point. -type DiskRestorePointInstanceView struct { - // Disk restore point Id. - ID *string `json:"id,omitempty"` - - // The disk restore point replication status information. - ReplicationStatus *DiskRestorePointReplicationStatus `json:"replicationStatus,omitempty"` -} - -// DiskRestorePointList - The List Disk Restore Points operation response. -type DiskRestorePointList struct { - // REQUIRED; A list of disk restore points. - Value []*DiskRestorePoint `json:"value,omitempty"` - - // The uri to fetch the next page of disk restore points. Call ListNext() with this to fetch the next page of disk restore - // points. - NextLink *string `json:"nextLink,omitempty"` -} - -// DiskRestorePointProperties - Properties of an incremental disk restore point -type DiskRestorePointProperties struct { - // Percentage complete for the background copy of disk restore point when source resource is from a different region. - CompletionPercent *float32 `json:"completionPercent,omitempty"` - - // ARM id of the DiskAccess resource for using private endpoints on disks. - DiskAccessID *string `json:"diskAccessId,omitempty"` - - // The hypervisor generation of the Virtual Machine. Applicable to OS disks only. - HyperVGeneration *HyperVGeneration `json:"hyperVGeneration,omitempty"` - - // Policy for accessing the disk via network. - NetworkAccessPolicy *NetworkAccessPolicy `json:"networkAccessPolicy,omitempty"` - - // Policy for controlling export on the disk. - PublicNetworkAccess *PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` - - // Purchase plan information for the the image from which the OS disk was created. - PurchasePlan *DiskPurchasePlan `json:"purchasePlan,omitempty"` - - // List of supported capabilities for the image from which the OS disk was created. - SupportedCapabilities *SupportedCapabilities `json:"supportedCapabilities,omitempty"` - - // Indicates the OS on a disk supports hibernation. - SupportsHibernation *bool `json:"supportsHibernation,omitempty"` - - // READ-ONLY; Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. - Encryption *Encryption `json:"encryption,omitempty" azure:"ro"` - - // READ-ONLY; id of the backing snapshot's MIS family - FamilyID *string `json:"familyId,omitempty" azure:"ro"` - - // READ-ONLY; The Operating System type. - OSType *OperatingSystemTypes `json:"osType,omitempty" azure:"ro"` - - // READ-ONLY; Replication state of disk restore point when source resource is from a different region. - ReplicationState *string `json:"replicationState,omitempty" azure:"ro"` - - // READ-ONLY; arm id of source disk or source disk restore point. - SourceResourceID *string `json:"sourceResourceId,omitempty" azure:"ro"` - - // READ-ONLY; Location of source disk or source disk restore point when source resource is from a different region. - SourceResourceLocation *string `json:"sourceResourceLocation,omitempty" azure:"ro"` - - // READ-ONLY; unique incarnation id of the source disk - SourceUniqueID *string `json:"sourceUniqueId,omitempty" azure:"ro"` - - // READ-ONLY; The timestamp of restorePoint creation - TimeCreated *time.Time `json:"timeCreated,omitempty" azure:"ro"` -} - -// DiskRestorePointReplicationStatus - The instance view of a disk restore point. -type DiskRestorePointReplicationStatus struct { - // Replication completion percentage. - CompletionPercent *int32 `json:"completionPercent,omitempty"` - - // The resource status information. - Status *InstanceViewStatus `json:"status,omitempty"` -} - -// DiskSKU - The disks sku name. Can be StandardLRS, PremiumLRS, StandardSSDLRS, UltraSSDLRS, PremiumZRS, or StandardSSDZRS. -type DiskSKU struct { - // The sku name. - Name *DiskStorageAccountTypes `json:"name,omitempty"` - - // READ-ONLY; The sku tier. - Tier *string `json:"tier,omitempty" azure:"ro"` -} - -// DiskSecurityProfile - Contains the security related information for the resource. -type DiskSecurityProfile struct { - // ResourceId of the disk encryption set associated to Confidential VM supported disk encrypted with customer managed key - SecureVMDiskEncryptionSetID *string `json:"secureVMDiskEncryptionSetId,omitempty"` - - // Specifies the SecurityType of the VM. Applicable for OS disks only. - SecurityType *DiskSecurityTypes `json:"securityType,omitempty"` -} - -// DiskUpdate - Disk update resource. -type DiskUpdate struct { - // Disk resource update properties. - Properties *DiskUpdateProperties `json:"properties,omitempty"` - - // The disks sku name. Can be StandardLRS, PremiumLRS, StandardSSDLRS, UltraSSDLRS, PremiumZRS, or StandardSSDZRS. - SKU *DiskSKU `json:"sku,omitempty"` - - // Resource tags - Tags map[string]*string `json:"tags,omitempty"` -} - -// DiskUpdateProperties - Disk resource update properties. -type DiskUpdateProperties struct { - // Set to true to enable bursting beyond the provisioned performance target of the disk. Bursting is disabled by default. - // Does not apply to Ultra disks. - BurstingEnabled *bool `json:"burstingEnabled,omitempty"` - - // Additional authentication requirements when exporting or uploading to a disk or snapshot. - DataAccessAuthMode *DataAccessAuthMode `json:"dataAccessAuthMode,omitempty"` - - // ARM id of the DiskAccess resource for using private endpoints on disks. - DiskAccessID *string `json:"diskAccessId,omitempty"` - - // The total number of IOPS that will be allowed across all VMs mounting the shared disk as ReadOnly. One operation can transfer - // between 4k and 256k bytes. - DiskIOPSReadOnly *int64 `json:"diskIOPSReadOnly,omitempty"` - - // The number of IOPS allowed for this disk; only settable for UltraSSD disks. One operation can transfer between 4k and 256k - // bytes. - DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` - - // The total throughput (MBps) that will be allowed across all VMs mounting the shared disk as ReadOnly. MBps means millions - // of bytes per second - MB here uses the ISO notation, of powers of 10. - DiskMBpsReadOnly *int64 `json:"diskMBpsReadOnly,omitempty"` - - // The bandwidth allowed for this disk; only settable for UltraSSD disks. MBps means millions of bytes per second - MB here - // uses the ISO notation, of powers of 10. - DiskMBpsReadWrite *int64 `json:"diskMBpsReadWrite,omitempty"` - - // If creationData.createOption is Empty, this field is mandatory and it indicates the size of the disk to create. If this - // field is present for updates or creation with other options, it indicates a - // resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size. - DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` - - // Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. - Encryption *Encryption `json:"encryption,omitempty"` - - // Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. - EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` - - // The maximum number of VMs that can attach to the disk at the same time. Value greater than one indicates a disk that can - // be mounted on multiple VMs at the same time. - MaxShares *int32 `json:"maxShares,omitempty"` - - // Policy for accessing the disk via network. - NetworkAccessPolicy *NetworkAccessPolicy `json:"networkAccessPolicy,omitempty"` - - // the Operating System type. - OSType *OperatingSystemTypes `json:"osType,omitempty"` - - // Policy for controlling export on the disk. - PublicNetworkAccess *PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` - - // Purchase plan information to be added on the OS disk - PurchasePlan *DiskPurchasePlan `json:"purchasePlan,omitempty"` - - // List of supported capabilities to be added on the OS disk. - SupportedCapabilities *SupportedCapabilities `json:"supportedCapabilities,omitempty"` - - // Indicates the OS on a disk supports hibernation. - SupportsHibernation *bool `json:"supportsHibernation,omitempty"` - - // Performance tier of the disk (e.g, P4, S10) as described here: https://azure.microsoft.com/en-us/pricing/details/managed-disks/. - // Does not apply to Ultra disks. - Tier *string `json:"tier,omitempty"` - - // READ-ONLY; Properties of the disk for which update is pending. - PropertyUpdatesInProgress *PropertyUpdatesInProgress `json:"propertyUpdatesInProgress,omitempty" azure:"ro"` -} - -// DisksClientBeginCreateOrUpdateOptions contains the optional parameters for the DisksClient.BeginCreateOrUpdate method. -type DisksClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DisksClientBeginDeleteOptions contains the optional parameters for the DisksClient.BeginDelete method. -type DisksClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DisksClientBeginGrantAccessOptions contains the optional parameters for the DisksClient.BeginGrantAccess method. -type DisksClientBeginGrantAccessOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DisksClientBeginRevokeAccessOptions contains the optional parameters for the DisksClient.BeginRevokeAccess method. -type DisksClientBeginRevokeAccessOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DisksClientBeginUpdateOptions contains the optional parameters for the DisksClient.BeginUpdate method. -type DisksClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DisksClientGetOptions contains the optional parameters for the DisksClient.Get method. -type DisksClientGetOptions struct { - // placeholder for future optional parameters -} - -// DisksClientListByResourceGroupOptions contains the optional parameters for the DisksClient.ListByResourceGroup method. -type DisksClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// DisksClientListOptions contains the optional parameters for the DisksClient.List method. -type DisksClientListOptions struct { - // placeholder for future optional parameters -} - -// Encryption at rest settings for disk or snapshot -type Encryption struct { - // ResourceId of the disk encryption set to use for enabling encryption at rest. - DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` - - // The type of key used to encrypt the data of the disk. - Type *EncryptionType `json:"type,omitempty"` -} - -// EncryptionImages - Optional. Allows users to provide customer managed keys for encrypting the OS and data disks in the -// gallery artifact. -type EncryptionImages struct { - // A list of encryption specifications for data disk images. - DataDiskImages []*DataDiskImageEncryption `json:"dataDiskImages,omitempty"` - - // Contains encryption settings for an OS disk image. - OSDiskImage *OSDiskImageEncryption `json:"osDiskImage,omitempty"` -} - -// EncryptionSetIdentity - The managed identity for the disk encryption set. It should be given permission on the key vault -// before it can be used to encrypt disks. -type EncryptionSetIdentity struct { - // The type of Managed Identity used by the DiskEncryptionSet. Only SystemAssigned is supported for new creations. Disk Encryption - // Sets can be updated with Identity type None during migration of - // subscription to a new Azure Active Directory tenant; it will cause the encrypted resources to lose access to the keys. - Type *DiskEncryptionSetIdentityType `json:"type,omitempty"` - - // READ-ONLY; The object id of the Managed Identity Resource. This will be sent to the RP from ARM via the x-ms-identity-principal-id - // header in the PUT request if the resource has a systemAssigned(implicit) - // identity - PrincipalID *string `json:"principalId,omitempty" azure:"ro"` - - // READ-ONLY; The tenant id of the Managed Identity Resource. This will be sent to the RP from ARM via the x-ms-client-tenant-id - // header in the PUT request if the resource has a systemAssigned(implicit) identity - TenantID *string `json:"tenantId,omitempty" azure:"ro"` -} - -type EncryptionSetProperties struct { - // The key vault key which is currently used by this disk encryption set. - ActiveKey *KeyForDiskEncryptionSet `json:"activeKey,omitempty"` - - // The type of key used to encrypt the data of the disk. - EncryptionType *DiskEncryptionSetType `json:"encryptionType,omitempty"` - - // Set this flag to true to enable auto-updating of this disk encryption set to the latest key version. - RotationToLatestKeyVersionEnabled *bool `json:"rotationToLatestKeyVersionEnabled,omitempty"` - - // READ-ONLY; The error that was encountered during auto-key rotation. If an error is present, then auto-key rotation will - // not be attempted until the error on this disk encryption set is fixed. - AutoKeyRotationError *APIError `json:"autoKeyRotationError,omitempty" azure:"ro"` - - // READ-ONLY; The time when the active key of this disk encryption set was updated. - LastKeyRotationTimestamp *time.Time `json:"lastKeyRotationTimestamp,omitempty" azure:"ro"` - - // READ-ONLY; A readonly collection of key vault keys previously used by this disk encryption set while a key rotation is - // in progress. It will be empty if there is no ongoing key rotation. - PreviousKeys []*KeyForDiskEncryptionSet `json:"previousKeys,omitempty" azure:"ro"` - - // READ-ONLY; The disk encryption set provisioning state. - ProvisioningState *string `json:"provisioningState,omitempty" azure:"ro"` -} - -// EncryptionSettingsCollection - Encryption settings for disk or snapshot -type EncryptionSettingsCollection struct { - // REQUIRED; Set this flag to true and provide DiskEncryptionKey and optional KeyEncryptionKey to enable encryption. Set this - // flag to false and remove DiskEncryptionKey and KeyEncryptionKey to disable encryption. - // If EncryptionSettings is null in the request object, the existing settings remain unchanged. - Enabled *bool `json:"enabled,omitempty"` - - // A collection of encryption settings, one for each disk volume. - EncryptionSettings []*EncryptionSettingsElement `json:"encryptionSettings,omitempty"` - - // Describes what type of encryption is used for the disks. Once this field is set, it cannot be overwritten. '1.0' corresponds - // to Azure Disk Encryption with AAD app.'1.1' corresponds to Azure Disk - // Encryption. - EncryptionSettingsVersion *string `json:"encryptionSettingsVersion,omitempty"` -} - -// EncryptionSettingsElement - Encryption settings for one disk volume. -type EncryptionSettingsElement struct { - // Key Vault Secret Url and vault id of the disk encryption key - DiskEncryptionKey *KeyVaultAndSecretReference `json:"diskEncryptionKey,omitempty"` - - // Key Vault Key Url and vault id of the key encryption key. KeyEncryptionKey is optional and when provided is used to unwrap - // the disk encryption key. - KeyEncryptionKey *KeyVaultAndKeyReference `json:"keyEncryptionKey,omitempty"` -} - -// ExtendedLocation - The complex type of the extended location. -type ExtendedLocation struct { - // The name of the extended location. - Name *string `json:"name,omitempty"` - - // The type of the extended location. - Type *ExtendedLocationTypes `json:"type,omitempty"` -} - -// Extension - Describes a cloud service Extension. -type Extension struct { - // The name of the extension. - Name *string `json:"name,omitempty"` - - // Extension Properties. - Properties *CloudServiceExtensionProperties `json:"properties,omitempty"` -} - -// GalleriesClientBeginCreateOrUpdateOptions contains the optional parameters for the GalleriesClient.BeginCreateOrUpdate -// method. -type GalleriesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GalleriesClientBeginDeleteOptions contains the optional parameters for the GalleriesClient.BeginDelete method. -type GalleriesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GalleriesClientBeginUpdateOptions contains the optional parameters for the GalleriesClient.BeginUpdate method. -type GalleriesClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GalleriesClientGetOptions contains the optional parameters for the GalleriesClient.Get method. -type GalleriesClientGetOptions struct { - // The expand query option to apply on the operation. - Expand *GalleryExpandParams - // The select expression to apply on the operation. - Select *SelectPermissions -} - -// GalleriesClientListByResourceGroupOptions contains the optional parameters for the GalleriesClient.ListByResourceGroup -// method. -type GalleriesClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// GalleriesClientListOptions contains the optional parameters for the GalleriesClient.List method. -type GalleriesClientListOptions struct { - // placeholder for future optional parameters -} - -// Gallery - Specifies information about the Shared Image Gallery that you want to create or update. -type Gallery struct { - // REQUIRED; Resource location - Location *string `json:"location,omitempty"` - - // Describes the properties of a Shared Image Gallery. - Properties *GalleryProperties `json:"properties,omitempty"` - - // Resource tags - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; Resource Id - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; Resource name - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type - Type *string `json:"type,omitempty" azure:"ro"` -} - -// GalleryApplication - Specifies information about the gallery Application Definition that you want to create or update. -type GalleryApplication struct { - // REQUIRED; Resource location - Location *string `json:"location,omitempty"` - - // Describes the properties of a gallery Application Definition. - Properties *GalleryApplicationProperties `json:"properties,omitempty"` - - // Resource tags - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; Resource Id - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; Resource name - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type - Type *string `json:"type,omitempty" azure:"ro"` -} - -// GalleryApplicationList - The List Gallery Applications operation response. -type GalleryApplicationList struct { - // REQUIRED; A list of Gallery Applications. - Value []*GalleryApplication `json:"value,omitempty"` - - // The uri to fetch the next page of Application Definitions in the Application Gallery. Call ListNext() with this to fetch - // the next page of gallery Application Definitions. - NextLink *string `json:"nextLink,omitempty"` -} - -// GalleryApplicationProperties - Describes the properties of a gallery Application Definition. -type GalleryApplicationProperties struct { - // REQUIRED; This property allows you to specify the supported type of the OS that application is built for. - // Possible values are: - // Windows - // Linux - SupportedOSType *OperatingSystemTypes `json:"supportedOSType,omitempty"` - - // The description of this gallery Application Definition resource. This property is updatable. - Description *string `json:"description,omitempty"` - - // The end of life date of the gallery Application Definition. This property can be used for decommissioning purposes. This - // property is updatable. - EndOfLifeDate *time.Time `json:"endOfLifeDate,omitempty"` - - // The Eula agreement for the gallery Application Definition. - Eula *string `json:"eula,omitempty"` - - // The privacy statement uri. - PrivacyStatementURI *string `json:"privacyStatementUri,omitempty"` - - // The release note uri. - ReleaseNoteURI *string `json:"releaseNoteUri,omitempty"` -} - -// GalleryApplicationUpdate - Specifies information about the gallery Application Definition that you want to update. -type GalleryApplicationUpdate struct { - // Describes the properties of a gallery Application Definition. - Properties *GalleryApplicationProperties `json:"properties,omitempty"` - - // Resource tags - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; Resource Id - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; Resource name - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type - Type *string `json:"type,omitempty" azure:"ro"` -} - -// GalleryApplicationVersion - Specifies information about the gallery Application Version that you want to create or update. -type GalleryApplicationVersion struct { - // REQUIRED; Resource location - Location *string `json:"location,omitempty"` - - // Describes the properties of a gallery image version. - Properties *GalleryApplicationVersionProperties `json:"properties,omitempty"` - - // Resource tags - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; Resource Id - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; Resource name - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type - Type *string `json:"type,omitempty" azure:"ro"` -} - -// GalleryApplicationVersionList - The List Gallery Application version operation response. -type GalleryApplicationVersionList struct { - // REQUIRED; A list of gallery Application Versions. - Value []*GalleryApplicationVersion `json:"value,omitempty"` - - // The uri to fetch the next page of gallery Application Versions. Call ListNext() with this to fetch the next page of gallery - // Application Versions. - NextLink *string `json:"nextLink,omitempty"` -} - -// GalleryApplicationVersionProperties - Describes the properties of a gallery image version. -type GalleryApplicationVersionProperties struct { - // REQUIRED; The publishing profile of a gallery image version. - PublishingProfile *GalleryApplicationVersionPublishingProfile `json:"publishingProfile,omitempty"` - - // READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *GalleryApplicationVersionPropertiesProvisioningState `json:"provisioningState,omitempty" azure:"ro"` - - // READ-ONLY; This is the replication status of the gallery image version. - ReplicationStatus *ReplicationStatus `json:"replicationStatus,omitempty" azure:"ro"` -} - -// GalleryApplicationVersionPublishingProfile - The publishing profile of a gallery image version. -type GalleryApplicationVersionPublishingProfile struct { - // REQUIRED; The source image from which the Image Version is going to be created. - Source *UserArtifactSource `json:"source,omitempty"` - - // Optional. Whether or not this application reports health. - EnableHealthCheck *bool `json:"enableHealthCheck,omitempty"` - - // The end of life date of the gallery image version. This property can be used for decommissioning purposes. This property - // is updatable. - EndOfLifeDate *time.Time `json:"endOfLifeDate,omitempty"` - - // If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. - ExcludeFromLatest *bool `json:"excludeFromLatest,omitempty"` - ManageActions *UserArtifactManage `json:"manageActions,omitempty"` - - // The number of replicas of the Image Version to be created per region. This property would take effect for a region when - // regionalReplicaCount is not specified. This property is updatable. - ReplicaCount *int32 `json:"replicaCount,omitempty"` - - // Optional parameter which specifies the mode to be used for replication. This property is not updatable. - ReplicationMode *ReplicationMode `json:"replicationMode,omitempty"` - - // Specifies the storage account type to be used to store the image. This property is not updatable. - StorageAccountType *StorageAccountType `json:"storageAccountType,omitempty"` - - // The target extended locations where the Image Version is going to be replicated to. This property is updatable. - TargetExtendedLocations []*GalleryTargetExtendedLocation `json:"targetExtendedLocations,omitempty"` - - // The target regions where the Image Version is going to be replicated to. This property is updatable. - TargetRegions []*TargetRegion `json:"targetRegions,omitempty"` - - // READ-ONLY; The timestamp for when the gallery image version is published. - PublishedDate *time.Time `json:"publishedDate,omitempty" azure:"ro"` -} - -// GalleryApplicationVersionUpdate - Specifies information about the gallery Application Version that you want to update. -type GalleryApplicationVersionUpdate struct { - // Describes the properties of a gallery image version. - Properties *GalleryApplicationVersionProperties `json:"properties,omitempty"` - - // Resource tags - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; Resource Id - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; Resource name - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type - Type *string `json:"type,omitempty" azure:"ro"` -} - -// GalleryApplicationVersionsClientBeginCreateOrUpdateOptions contains the optional parameters for the GalleryApplicationVersionsClient.BeginCreateOrUpdate -// method. -type GalleryApplicationVersionsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GalleryApplicationVersionsClientBeginDeleteOptions contains the optional parameters for the GalleryApplicationVersionsClient.BeginDelete -// method. -type GalleryApplicationVersionsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GalleryApplicationVersionsClientBeginUpdateOptions contains the optional parameters for the GalleryApplicationVersionsClient.BeginUpdate -// method. -type GalleryApplicationVersionsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GalleryApplicationVersionsClientGetOptions contains the optional parameters for the GalleryApplicationVersionsClient.Get -// method. -type GalleryApplicationVersionsClientGetOptions struct { - // The expand expression to apply on the operation. - Expand *ReplicationStatusTypes -} - -// GalleryApplicationVersionsClientListByGalleryApplicationOptions contains the optional parameters for the GalleryApplicationVersionsClient.ListByGalleryApplication -// method. -type GalleryApplicationVersionsClientListByGalleryApplicationOptions struct { - // placeholder for future optional parameters -} - -// GalleryApplicationsClientBeginCreateOrUpdateOptions contains the optional parameters for the GalleryApplicationsClient.BeginCreateOrUpdate -// method. -type GalleryApplicationsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GalleryApplicationsClientBeginDeleteOptions contains the optional parameters for the GalleryApplicationsClient.BeginDelete -// method. -type GalleryApplicationsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GalleryApplicationsClientBeginUpdateOptions contains the optional parameters for the GalleryApplicationsClient.BeginUpdate -// method. -type GalleryApplicationsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GalleryApplicationsClientGetOptions contains the optional parameters for the GalleryApplicationsClient.Get method. -type GalleryApplicationsClientGetOptions struct { - // placeholder for future optional parameters -} - -// GalleryApplicationsClientListByGalleryOptions contains the optional parameters for the GalleryApplicationsClient.ListByGallery -// method. -type GalleryApplicationsClientListByGalleryOptions struct { - // placeholder for future optional parameters -} - -// GalleryArtifactPublishingProfileBase - Describes the basic gallery artifact publishing profile. -type GalleryArtifactPublishingProfileBase struct { - // The end of life date of the gallery image version. This property can be used for decommissioning purposes. This property - // is updatable. - EndOfLifeDate *time.Time `json:"endOfLifeDate,omitempty"` - - // If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. - ExcludeFromLatest *bool `json:"excludeFromLatest,omitempty"` - - // The number of replicas of the Image Version to be created per region. This property would take effect for a region when - // regionalReplicaCount is not specified. This property is updatable. - ReplicaCount *int32 `json:"replicaCount,omitempty"` - - // Optional parameter which specifies the mode to be used for replication. This property is not updatable. - ReplicationMode *ReplicationMode `json:"replicationMode,omitempty"` - - // Specifies the storage account type to be used to store the image. This property is not updatable. - StorageAccountType *StorageAccountType `json:"storageAccountType,omitempty"` - - // The target extended locations where the Image Version is going to be replicated to. This property is updatable. - TargetExtendedLocations []*GalleryTargetExtendedLocation `json:"targetExtendedLocations,omitempty"` - - // The target regions where the Image Version is going to be replicated to. This property is updatable. - TargetRegions []*TargetRegion `json:"targetRegions,omitempty"` - - // READ-ONLY; The timestamp for when the gallery image version is published. - PublishedDate *time.Time `json:"publishedDate,omitempty" azure:"ro"` -} - -// GalleryArtifactSource - The source image from which the Image Version is going to be created. -type GalleryArtifactSource struct { - // REQUIRED; The managed artifact. - ManagedImage *ManagedArtifact `json:"managedImage,omitempty"` -} - -// GalleryArtifactVersionSource - The gallery artifact version source. -type GalleryArtifactVersionSource struct { - // The id of the gallery artifact version source. Can specify a disk uri, snapshot uri, user image or storage account resource. - ID *string `json:"id,omitempty"` - - // The uri of the gallery artifact version source. Currently used to specify vhd/blob source. - URI *string `json:"uri,omitempty"` -} - -// GalleryDataDiskImage - This is the data disk image. -type GalleryDataDiskImage struct { - // REQUIRED; This property specifies the logical unit number of the data disk. This value is used to identify data disks within - // the Virtual Machine and therefore must be unique for each data disk attached to the - // Virtual Machine. - Lun *int32 `json:"lun,omitempty"` - - // The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite' - HostCaching *HostCaching `json:"hostCaching,omitempty"` - - // The gallery artifact version source. - Source *GalleryArtifactVersionSource `json:"source,omitempty"` - - // READ-ONLY; This property indicates the size of the VHD to be created. - SizeInGB *int32 `json:"sizeInGB,omitempty" azure:"ro"` -} - -// GalleryDiskImage - This is the disk image base class. -type GalleryDiskImage struct { - // The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite' - HostCaching *HostCaching `json:"hostCaching,omitempty"` - - // The gallery artifact version source. - Source *GalleryArtifactVersionSource `json:"source,omitempty"` - - // READ-ONLY; This property indicates the size of the VHD to be created. - SizeInGB *int32 `json:"sizeInGB,omitempty" azure:"ro"` -} - -// GalleryExtendedLocation - The name of the extended location. -type GalleryExtendedLocation struct { - Name *string `json:"name,omitempty"` - - // It is type of the extended location. - Type *GalleryExtendedLocationType `json:"type,omitempty"` -} - -// GalleryIdentifier - Describes the gallery unique name. -type GalleryIdentifier struct { - // READ-ONLY; The unique name of the Shared Image Gallery. This name is generated automatically by Azure. - UniqueName *string `json:"uniqueName,omitempty" azure:"ro"` -} - -// GalleryImage - Specifies information about the gallery image definition that you want to create or update. -type GalleryImage struct { - // REQUIRED; Resource location - Location *string `json:"location,omitempty"` - - // Describes the properties of a gallery image definition. - Properties *GalleryImageProperties `json:"properties,omitempty"` - - // Resource tags - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; Resource Id - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; Resource name - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type - Type *string `json:"type,omitempty" azure:"ro"` -} - -// GalleryImageFeature - A feature for gallery image. -type GalleryImageFeature struct { - // The name of the gallery image feature. - Name *string `json:"name,omitempty"` - - // The value of the gallery image feature. - Value *string `json:"value,omitempty"` -} - -// GalleryImageIdentifier - This is the gallery image definition identifier. -type GalleryImageIdentifier struct { - // REQUIRED; The name of the gallery image definition offer. - Offer *string `json:"offer,omitempty"` - - // REQUIRED; The name of the gallery image definition publisher. - Publisher *string `json:"publisher,omitempty"` - - // REQUIRED; The name of the gallery image definition SKU. - SKU *string `json:"sku,omitempty"` -} - -// GalleryImageList - The List Gallery Images operation response. -type GalleryImageList struct { - // REQUIRED; A list of Shared Image Gallery images. - Value []*GalleryImage `json:"value,omitempty"` - - // The uri to fetch the next page of Image Definitions in the Shared Image Gallery. Call ListNext() with this to fetch the - // next page of gallery image definitions. - NextLink *string `json:"nextLink,omitempty"` -} - -// GalleryImageProperties - Describes the properties of a gallery image definition. -type GalleryImageProperties struct { - // REQUIRED; This is the gallery image definition identifier. - Identifier *GalleryImageIdentifier `json:"identifier,omitempty"` - - // REQUIRED; This property allows the user to specify whether the virtual machines created under this image are 'Generalized' - // or 'Specialized'. - OSState *OperatingSystemStateTypes `json:"osState,omitempty"` - - // REQUIRED; This property allows you to specify the type of the OS that is included in the disk when creating a VM from a - // managed image. - // Possible values are: - // Windows - // Linux - OSType *OperatingSystemTypes `json:"osType,omitempty"` - - // The architecture of the image. Applicable to OS disks only. - Architecture *Architecture `json:"architecture,omitempty"` - - // The description of this gallery image definition resource. This property is updatable. - Description *string `json:"description,omitempty"` - - // Describes the disallowed disk types. - Disallowed *Disallowed `json:"disallowed,omitempty"` - - // The end of life date of the gallery image definition. This property can be used for decommissioning purposes. This property - // is updatable. - EndOfLifeDate *time.Time `json:"endOfLifeDate,omitempty"` - - // The Eula agreement for the gallery image definition. - Eula *string `json:"eula,omitempty"` - - // A list of gallery image features. - Features []*GalleryImageFeature `json:"features,omitempty"` - - // The hypervisor generation of the Virtual Machine. Applicable to OS disks only. - HyperVGeneration *HyperVGeneration `json:"hyperVGeneration,omitempty"` - - // The privacy statement uri. - PrivacyStatementURI *string `json:"privacyStatementUri,omitempty"` - - // Describes the gallery image definition purchase plan. This is used by marketplace images. - PurchasePlan *ImagePurchasePlan `json:"purchasePlan,omitempty"` - - // The properties describe the recommended machine configuration for this Image Definition. These properties are updatable. - Recommended *RecommendedMachineConfiguration `json:"recommended,omitempty"` - - // The release note uri. - ReleaseNoteURI *string `json:"releaseNoteUri,omitempty"` - - // READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *GalleryImagePropertiesProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// GalleryImageUpdate - Specifies information about the gallery image definition that you want to update. -type GalleryImageUpdate struct { - // Describes the properties of a gallery image definition. - Properties *GalleryImageProperties `json:"properties,omitempty"` - - // Resource tags - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; Resource Id - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; Resource name - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type - Type *string `json:"type,omitempty" azure:"ro"` -} - -// GalleryImageVersion - Specifies information about the gallery image version that you want to create or update. -type GalleryImageVersion struct { - // REQUIRED; Resource location - Location *string `json:"location,omitempty"` - - // Describes the properties of a gallery image version. - Properties *GalleryImageVersionProperties `json:"properties,omitempty"` - - // Resource tags - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; Resource Id - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; Resource name - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type - Type *string `json:"type,omitempty" azure:"ro"` -} - -// GalleryImageVersionList - The List Gallery Image version operation response. -type GalleryImageVersionList struct { - // REQUIRED; A list of gallery image versions. - Value []*GalleryImageVersion `json:"value,omitempty"` - - // The uri to fetch the next page of gallery image versions. Call ListNext() with this to fetch the next page of gallery image - // versions. - NextLink *string `json:"nextLink,omitempty"` -} - -// GalleryImageVersionProperties - Describes the properties of a gallery image version. -type GalleryImageVersionProperties struct { - // REQUIRED; This is the storage profile of a Gallery Image Version. - StorageProfile *GalleryImageVersionStorageProfile `json:"storageProfile,omitempty"` - - // The publishing profile of a gallery image Version. - PublishingProfile *GalleryImageVersionPublishingProfile `json:"publishingProfile,omitempty"` - - // READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *GalleryImageVersionPropertiesProvisioningState `json:"provisioningState,omitempty" azure:"ro"` - - // READ-ONLY; This is the replication status of the gallery image version. - ReplicationStatus *ReplicationStatus `json:"replicationStatus,omitempty" azure:"ro"` -} - -// GalleryImageVersionPublishingProfile - The publishing profile of a gallery image Version. -type GalleryImageVersionPublishingProfile struct { - // The end of life date of the gallery image version. This property can be used for decommissioning purposes. This property - // is updatable. - EndOfLifeDate *time.Time `json:"endOfLifeDate,omitempty"` - - // If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. - ExcludeFromLatest *bool `json:"excludeFromLatest,omitempty"` - - // The number of replicas of the Image Version to be created per region. This property would take effect for a region when - // regionalReplicaCount is not specified. This property is updatable. - ReplicaCount *int32 `json:"replicaCount,omitempty"` - - // Optional parameter which specifies the mode to be used for replication. This property is not updatable. - ReplicationMode *ReplicationMode `json:"replicationMode,omitempty"` - - // Specifies the storage account type to be used to store the image. This property is not updatable. - StorageAccountType *StorageAccountType `json:"storageAccountType,omitempty"` - - // The target extended locations where the Image Version is going to be replicated to. This property is updatable. - TargetExtendedLocations []*GalleryTargetExtendedLocation `json:"targetExtendedLocations,omitempty"` - - // The target regions where the Image Version is going to be replicated to. This property is updatable. - TargetRegions []*TargetRegion `json:"targetRegions,omitempty"` - - // READ-ONLY; The timestamp for when the gallery image version is published. - PublishedDate *time.Time `json:"publishedDate,omitempty" azure:"ro"` -} - -// GalleryImageVersionStorageProfile - This is the storage profile of a Gallery Image Version. -type GalleryImageVersionStorageProfile struct { - // A list of data disk images. - DataDiskImages []*GalleryDataDiskImage `json:"dataDiskImages,omitempty"` - - // This is the OS disk image. - OSDiskImage *GalleryOSDiskImage `json:"osDiskImage,omitempty"` - - // The gallery artifact version source. - Source *GalleryArtifactVersionSource `json:"source,omitempty"` -} - -// GalleryImageVersionUpdate - Specifies information about the gallery image version that you want to update. -type GalleryImageVersionUpdate struct { - // Describes the properties of a gallery image version. - Properties *GalleryImageVersionProperties `json:"properties,omitempty"` - - // Resource tags - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; Resource Id - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; Resource name - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type - Type *string `json:"type,omitempty" azure:"ro"` -} - -// GalleryImageVersionsClientBeginCreateOrUpdateOptions contains the optional parameters for the GalleryImageVersionsClient.BeginCreateOrUpdate -// method. -type GalleryImageVersionsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GalleryImageVersionsClientBeginDeleteOptions contains the optional parameters for the GalleryImageVersionsClient.BeginDelete -// method. -type GalleryImageVersionsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GalleryImageVersionsClientBeginUpdateOptions contains the optional parameters for the GalleryImageVersionsClient.BeginUpdate -// method. -type GalleryImageVersionsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GalleryImageVersionsClientGetOptions contains the optional parameters for the GalleryImageVersionsClient.Get method. -type GalleryImageVersionsClientGetOptions struct { - // The expand expression to apply on the operation. - Expand *ReplicationStatusTypes -} - -// GalleryImageVersionsClientListByGalleryImageOptions contains the optional parameters for the GalleryImageVersionsClient.ListByGalleryImage -// method. -type GalleryImageVersionsClientListByGalleryImageOptions struct { - // placeholder for future optional parameters -} - -// GalleryImagesClientBeginCreateOrUpdateOptions contains the optional parameters for the GalleryImagesClient.BeginCreateOrUpdate -// method. -type GalleryImagesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GalleryImagesClientBeginDeleteOptions contains the optional parameters for the GalleryImagesClient.BeginDelete method. -type GalleryImagesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GalleryImagesClientBeginUpdateOptions contains the optional parameters for the GalleryImagesClient.BeginUpdate method. -type GalleryImagesClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GalleryImagesClientGetOptions contains the optional parameters for the GalleryImagesClient.Get method. -type GalleryImagesClientGetOptions struct { - // placeholder for future optional parameters -} - -// GalleryImagesClientListByGalleryOptions contains the optional parameters for the GalleryImagesClient.ListByGallery method. -type GalleryImagesClientListByGalleryOptions struct { - // placeholder for future optional parameters -} - -// GalleryList - The List Galleries operation response. -type GalleryList struct { - // REQUIRED; A list of galleries. - Value []*Gallery `json:"value,omitempty"` - - // The uri to fetch the next page of galleries. Call ListNext() with this to fetch the next page of galleries. - NextLink *string `json:"nextLink,omitempty"` -} - -// GalleryOSDiskImage - This is the OS disk image. -type GalleryOSDiskImage struct { - // The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite' - HostCaching *HostCaching `json:"hostCaching,omitempty"` - - // The gallery artifact version source. - Source *GalleryArtifactVersionSource `json:"source,omitempty"` - - // READ-ONLY; This property indicates the size of the VHD to be created. - SizeInGB *int32 `json:"sizeInGB,omitempty" azure:"ro"` -} - -// GalleryProperties - Describes the properties of a Shared Image Gallery. -type GalleryProperties struct { - // The description of this Shared Image Gallery resource. This property is updatable. - Description *string `json:"description,omitempty"` - - // Describes the gallery unique name. - Identifier *GalleryIdentifier `json:"identifier,omitempty"` - - // Profile for gallery sharing to subscription or tenant - SharingProfile *SharingProfile `json:"sharingProfile,omitempty"` - - // Contains information about the soft deletion policy of the gallery. - SoftDeletePolicy *SoftDeletePolicy `json:"softDeletePolicy,omitempty"` - - // READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *GalleryPropertiesProvisioningState `json:"provisioningState,omitempty" azure:"ro"` - - // READ-ONLY; Sharing status of current gallery. - SharingStatus *SharingStatus `json:"sharingStatus,omitempty" azure:"ro"` -} - -// GallerySharingProfileClientBeginUpdateOptions contains the optional parameters for the GallerySharingProfileClient.BeginUpdate -// method. -type GallerySharingProfileClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -type GalleryTargetExtendedLocation struct { - // Optional. Allows users to provide customer managed keys for encrypting the OS and data disks in the gallery artifact. - Encryption *EncryptionImages `json:"encryption,omitempty"` - - // The name of the extended location. - ExtendedLocation *GalleryExtendedLocation `json:"extendedLocation,omitempty"` - - // The number of replicas of the Image Version to be created per extended location. This property is updatable. - ExtendedLocationReplicaCount *int32 `json:"extendedLocationReplicaCount,omitempty"` - - // The name of the region. - Name *string `json:"name,omitempty"` - - // Specifies the storage account type to be used to store the image. This property is not updatable. - StorageAccountType *StorageAccountType `json:"storageAccountType,omitempty"` -} - -// GalleryUpdate - Specifies information about the Shared Image Gallery that you want to update. -type GalleryUpdate struct { - // Describes the properties of a Shared Image Gallery. - Properties *GalleryProperties `json:"properties,omitempty"` - - // Resource tags - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; Resource Id - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; Resource name - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type - Type *string `json:"type,omitempty" azure:"ro"` -} - -// GrantAccessData - Data used for requesting a SAS. -type GrantAccessData struct { - // REQUIRED - Access *AccessLevel `json:"access,omitempty"` - - // REQUIRED; Time duration in seconds until the SAS access expires. - DurationInSeconds *int32 `json:"durationInSeconds,omitempty"` - - // Set this flag to true to get additional SAS for VM guest state - GetSecureVMGuestStateSAS *bool `json:"getSecureVMGuestStateSAS,omitempty"` -} - -// HardwareProfile - Specifies the hardware settings for the virtual machine. -type HardwareProfile struct { - // Specifies the size of the virtual machine. - // The enum data type is currently deprecated and will be removed by December 23rd 2023. - // Recommended way to get the list of available sizes is using 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/resourceskus/list] - // List all available virtual machine sizes for resizing [https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes]. - // For more information about virtual machine sizes, see Sizes for - // virtual machines [https://docs.microsoft.com/azure/virtual-machines/sizes]. - // The available VM sizes depend on region and availability set. - VMSize *VirtualMachineSizeTypes `json:"vmSize,omitempty"` - - // Specifies the properties for customizing the size of the virtual machine. Minimum api-version: 2021-07-01. - // This feature is still in preview mode and is not supported for VirtualMachineScaleSet. - // Please follow the instructions in VM Customization [https://aka.ms/vmcustomization] for more details. - VMSizeProperties *VMSizeProperties `json:"vmSizeProperties,omitempty"` -} - -// Image - 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 Image struct { - // REQUIRED; Resource location - Location *string `json:"location,omitempty"` - - // The extended location of the Image. - ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` - - // Describes the properties of an Image. - Properties *ImageProperties `json:"properties,omitempty"` - - // Resource tags - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; Resource Id - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; Resource name - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ImageDataDisk - Describes a data disk. -type ImageDataDisk struct { - // REQUIRED; Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and - // therefore must be unique for each data disk attached to a VM. - Lun *int32 `json:"lun,omitempty"` - - // The Virtual Hard Disk. - BlobURI *string `json:"blobUri,omitempty"` - - // Specifies the caching requirements. - // Possible values are: - // None - // ReadOnly - // ReadWrite - // Default: None for Standard storage. ReadOnly for Premium storage - Caching *CachingTypes `json:"caching,omitempty"` - - // Specifies the customer managed disk encryption set resource id for the managed image disk. - DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` - - // Specifies the size of empty data disks in gigabytes. This element can be used to overwrite the name of the disk in a virtual - // machine image. - // This value cannot be larger than 1023 GB - DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` - - // The managedDisk. - ManagedDisk *SubResource `json:"managedDisk,omitempty"` - - // The snapshot. - Snapshot *SubResource `json:"snapshot,omitempty"` - - // Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot - // be used with OS Disk. - StorageAccountType *StorageAccountTypes `json:"storageAccountType,omitempty"` -} - -// ImageDisk - Describes a image disk. -type ImageDisk struct { - // The Virtual Hard Disk. - BlobURI *string `json:"blobUri,omitempty"` - - // Specifies the caching requirements. - // Possible values are: - // None - // ReadOnly - // ReadWrite - // Default: None for Standard storage. ReadOnly for Premium storage - Caching *CachingTypes `json:"caching,omitempty"` - - // Specifies the customer managed disk encryption set resource id for the managed image disk. - DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` - - // Specifies the size of empty data disks in gigabytes. This element can be used to overwrite the name of the disk in a virtual - // machine image. - // This value cannot be larger than 1023 GB - DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` - - // The managedDisk. - ManagedDisk *SubResource `json:"managedDisk,omitempty"` - - // The snapshot. - Snapshot *SubResource `json:"snapshot,omitempty"` - - // Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot - // be used with OS Disk. - StorageAccountType *StorageAccountTypes `json:"storageAccountType,omitempty"` -} - -// ImageDiskReference - The source image used for creating the disk. -type ImageDiskReference struct { - // REQUIRED; A relative uri containing either a Platform Image Repository or user image reference. - ID *string `json:"id,omitempty"` - - // If the disk is created from an image's data disk, this is an index that indicates which of the data disks in the image - // to use. For OS disks, this field is null. - Lun *int32 `json:"lun,omitempty"` -} - -// ImageListResult - The List Image operation response. -type ImageListResult struct { - // REQUIRED; The list of Images. - Value []*Image `json:"value,omitempty"` - - // The uri to fetch the next page of Images. Call ListNext() with this to fetch the next page of Images. - NextLink *string `json:"nextLink,omitempty"` -} - -// ImageOSDisk - Describes an Operating System disk. -type ImageOSDisk struct { - // REQUIRED; The OS State. - OSState *OperatingSystemStateTypes `json:"osState,omitempty"` - - // REQUIRED; This property allows you to specify the type of the OS that is included in the disk if creating a VM from a custom - // image. - // Possible values are: - // Windows - // Linux - OSType *OperatingSystemTypes `json:"osType,omitempty"` - - // The Virtual Hard Disk. - BlobURI *string `json:"blobUri,omitempty"` - - // Specifies the caching requirements. - // Possible values are: - // None - // ReadOnly - // ReadWrite - // Default: None for Standard storage. ReadOnly for Premium storage - Caching *CachingTypes `json:"caching,omitempty"` - - // Specifies the customer managed disk encryption set resource id for the managed image disk. - DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` - - // Specifies the size of empty data disks in gigabytes. This element can be used to overwrite the name of the disk in a virtual - // machine image. - // This value cannot be larger than 1023 GB - DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` - - // The managedDisk. - ManagedDisk *SubResource `json:"managedDisk,omitempty"` - - // The snapshot. - Snapshot *SubResource `json:"snapshot,omitempty"` - - // Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot - // be used with OS Disk. - StorageAccountType *StorageAccountTypes `json:"storageAccountType,omitempty"` -} - -// ImageProperties - Describes the properties of an Image. -type ImageProperties struct { - // Specifies the HyperVGenerationType of the VirtualMachine created from the image. From API Version 2019-03-01 if the image - // source is a blob, then we need the user to specify the value, if the source is - // managed resource like disk or snapshot, we may require the user to specify the property if we cannot deduce it from the - // source managed resource. - HyperVGeneration *HyperVGenerationTypes `json:"hyperVGeneration,omitempty"` - - // The source virtual machine from which Image is created. - SourceVirtualMachine *SubResource `json:"sourceVirtualMachine,omitempty"` - - // Specifies the storage settings for the virtual machine disks. - StorageProfile *ImageStorageProfile `json:"storageProfile,omitempty"` - - // READ-ONLY; The provisioning state. - ProvisioningState *string `json:"provisioningState,omitempty" azure:"ro"` -} - -// ImagePurchasePlan - Describes the gallery image definition purchase plan. This is used by marketplace images. -type ImagePurchasePlan struct { - // The plan ID. - Name *string `json:"name,omitempty"` - - // The product ID. - Product *string `json:"product,omitempty"` - - // The publisher ID. - Publisher *string `json:"publisher,omitempty"` -} - -// ImageReference - Specifies information about the image to use. You can specify information about platform images, 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. NOTE: Image reference -// publisher and offer can only be set when you create the scale set. -type ImageReference struct { - // Specified the community gallery image unique id for vm deployment. This can be fetched from community gallery image GET - // call. - CommunityGalleryImageID *string `json:"communityGalleryImageId,omitempty"` - - // Resource Id - ID *string `json:"id,omitempty"` - - // Specifies the offer of the platform image or marketplace image used to create the virtual machine. - Offer *string `json:"offer,omitempty"` - - // The image publisher. - Publisher *string `json:"publisher,omitempty"` - - // The image SKU. - SKU *string `json:"sku,omitempty"` - - // Specified the shared gallery image unique id for vm deployment. This can be fetched from shared gallery image GET call. - SharedGalleryImageID *string `json:"sharedGalleryImageId,omitempty"` - - // 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. Please do not use field 'version' for gallery image deployment, gallery image should always use 'id' field for - // deployment, to use 'latest' version of gallery image, just set - // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageName}' - // in the 'id' field without version input. - Version *string `json:"version,omitempty"` - - // READ-ONLY; Specifies in decimal numbers, the version of platform image or marketplace image used to create the virtual - // machine. This readonly field differs from 'version', only if the value specified in - // 'version' field is 'latest'. - ExactVersion *string `json:"exactVersion,omitempty" azure:"ro"` -} - -// ImageStorageProfile - Describes a storage profile. -type ImageStorageProfile struct { - // Specifies the parameters that are used to add a data disk to a virtual machine. - // For more information about disks, see About disks and VHDs for Azure virtual machines [https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview]. - DataDisks []*ImageDataDisk `json:"dataDisks,omitempty"` - - // 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/managed-disks-overview]. - OSDisk *ImageOSDisk `json:"osDisk,omitempty"` - - // Specifies whether an image is zone resilient or not. Default is false. Zone resilient images can be created only in regions - // that provide Zone Redundant Storage (ZRS). - ZoneResilient *bool `json:"zoneResilient,omitempty"` -} - -// ImageUpdate - The source user image virtual hard disk. Only tags may be updated. -type ImageUpdate struct { - // Describes the properties of an Image. - Properties *ImageProperties `json:"properties,omitempty"` - - // Resource tags - Tags map[string]*string `json:"tags,omitempty"` -} - -// ImagesClientBeginCreateOrUpdateOptions contains the optional parameters for the ImagesClient.BeginCreateOrUpdate method. -type ImagesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ImagesClientBeginDeleteOptions contains the optional parameters for the ImagesClient.BeginDelete method. -type ImagesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ImagesClientBeginUpdateOptions contains the optional parameters for the ImagesClient.BeginUpdate method. -type ImagesClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ImagesClientGetOptions contains the optional parameters for the ImagesClient.Get method. -type ImagesClientGetOptions struct { - // The expand expression to apply on the operation. - Expand *string -} - -// ImagesClientListByResourceGroupOptions contains the optional parameters for the ImagesClient.ListByResourceGroup method. -type ImagesClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// ImagesClientListOptions contains the optional parameters for the ImagesClient.List method. -type ImagesClientListOptions struct { - // placeholder for future optional parameters -} - -// InnerError - Inner error details. -type InnerError struct { - // The internal error message or exception dump. - Errordetail *string `json:"errordetail,omitempty"` - - // The exception type. - Exceptiontype *string `json:"exceptiontype,omitempty"` -} - -type InstanceSKU struct { - // READ-ONLY; The sku name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; The tier of the cloud service role instance. - Tier *string `json:"tier,omitempty" azure:"ro"` -} - -// InstanceViewStatus - Instance view status. -type InstanceViewStatus struct { - // The status code. - Code *string `json:"code,omitempty"` - - // The short localizable label for the status. - DisplayStatus *string `json:"displayStatus,omitempty"` - - // The level code. - Level *StatusLevelTypes `json:"level,omitempty"` - - // The detailed status message, including for alerts and error messages. - Message *string `json:"message,omitempty"` - - // The time of the status. - Time *time.Time `json:"time,omitempty"` -} - -// InstanceViewStatusesSummary - Instance view statuses. -type InstanceViewStatusesSummary struct { - // READ-ONLY - StatusesSummary []*StatusCodeCount `json:"statusesSummary,omitempty" azure:"ro"` -} - -// KeyForDiskEncryptionSet - Key Vault Key Url to be used for server side encryption of Managed Disks and Snapshots -type KeyForDiskEncryptionSet struct { - // REQUIRED; Fully versioned Key Url pointing to a key in KeyVault. Version segment of the Url is required regardless of rotationToLatestKeyVersionEnabled - // value. - KeyURL *string `json:"keyUrl,omitempty"` - - // Resource id of the KeyVault containing the key or secret. This property is optional and cannot be used if the KeyVault - // subscription is not the same as the Disk Encryption Set subscription. - SourceVault *SourceVault `json:"sourceVault,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 { - // REQUIRED; Url pointing to a key or secret in KeyVault - KeyURL *string `json:"keyUrl,omitempty"` - - // REQUIRED; Resource id of the KeyVault containing the key or secret - SourceVault *SourceVault `json:"sourceVault,omitempty"` -} - -// KeyVaultAndSecretReference - Key Vault Secret Url and vault id of the encryption key -type KeyVaultAndSecretReference struct { - // REQUIRED; Url pointing to a key or secret in KeyVault - SecretURL *string `json:"secretUrl,omitempty"` - - // REQUIRED; Resource id of the KeyVault containing the key or secret - SourceVault *SourceVault `json:"sourceVault,omitempty"` -} - -// KeyVaultKeyReference - Describes a reference to Key Vault Key -type KeyVaultKeyReference struct { - // REQUIRED; The URL referencing a key encryption key in Key Vault. - KeyURL *string `json:"keyUrl,omitempty"` - - // REQUIRED; The relative URL of the Key Vault containing the key. - SourceVault *SubResource `json:"sourceVault,omitempty"` -} - -// KeyVaultSecretReference - Describes a reference to Key Vault Secret -type KeyVaultSecretReference struct { - // REQUIRED; The URL referencing a secret in a Key Vault. - SecretURL *string `json:"secretUrl,omitempty"` - - // REQUIRED; The relative URL of the Key Vault containing the secret. - SourceVault *SubResource `json:"sourceVault,omitempty"` -} - -// LastPatchInstallationSummary - Describes the properties of the last installed patch summary. -type LastPatchInstallationSummary struct { - // READ-ONLY; The errors that were encountered during execution of the operation. The details array contains the list of them. - Error *APIError `json:"error,omitempty" azure:"ro"` - - // READ-ONLY; The number of all available patches but excluded explicitly by a customer-specified exclusion list match. - ExcludedPatchCount *int32 `json:"excludedPatchCount,omitempty" azure:"ro"` - - // READ-ONLY; The count of patches that failed installation. - FailedPatchCount *int32 `json:"failedPatchCount,omitempty" azure:"ro"` - - // READ-ONLY; The activity ID of the operation that produced this result. It is used to correlate across CRP and extension - // logs. - InstallationActivityID *string `json:"installationActivityId,omitempty" azure:"ro"` - - // READ-ONLY; The count of patches that successfully installed. - InstalledPatchCount *int32 `json:"installedPatchCount,omitempty" azure:"ro"` - - // READ-ONLY; The UTC timestamp when the operation began. - LastModifiedTime *time.Time `json:"lastModifiedTime,omitempty" azure:"ro"` - - // READ-ONLY; Describes whether the operation ran out of time before it completed all its intended actions - MaintenanceWindowExceeded *bool `json:"maintenanceWindowExceeded,omitempty" azure:"ro"` - - // READ-ONLY; The number of all available patches but not going to be installed because it didn't match a classification or - // inclusion list entry. - NotSelectedPatchCount *int32 `json:"notSelectedPatchCount,omitempty" azure:"ro"` - - // READ-ONLY; The number of all available patches expected to be installed over the course of the patch installation operation. - PendingPatchCount *int32 `json:"pendingPatchCount,omitempty" azure:"ro"` - - // READ-ONLY; The UTC timestamp when the operation began. - StartTime *time.Time `json:"startTime,omitempty" azure:"ro"` - - // READ-ONLY; The overall success or failure status of the operation. It remains "InProgress" until the operation completes. - // At that point it will become "Unknown", "Failed", "Succeeded", or - // "CompletedWithWarnings." - Status *PatchOperationStatus `json:"status,omitempty" azure:"ro"` -} - -// LinuxConfiguration - Specifies the Linux operating system settings on the virtual machine. -// For a list of supported Linux distributions, see Linux on Azure-Endorsed Distributions [https://docs.microsoft.com/azure/virtual-machines/linux/endorsed-distros]. -type LinuxConfiguration struct { - // Specifies whether password authentication should be disabled. - DisablePasswordAuthentication *bool `json:"disablePasswordAuthentication,omitempty"` - - // [Preview Feature] Specifies settings related to VM Guest Patching on Linux. - PatchSettings *LinuxPatchSettings `json:"patchSettings,omitempty"` - - // 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. - ProvisionVMAgent *bool `json:"provisionVMAgent,omitempty"` - - // Specifies the ssh key configuration for a Linux OS. - SSH *SSHConfiguration `json:"ssh,omitempty"` -} - -// LinuxParameters - Input for InstallPatches on a Linux VM, as directly received by the API -type LinuxParameters struct { - // The update classifications to select when installing patches for Linux. - ClassificationsToInclude []*VMGuestPatchClassificationLinux `json:"classificationsToInclude,omitempty"` - - // This is used as a maintenance run identifier for Auto VM Guest Patching in Linux. - MaintenanceRunID *string `json:"maintenanceRunId,omitempty"` - - // packages to exclude in the patch operation. Format: packageName_packageVersion - PackageNameMasksToExclude []*string `json:"packageNameMasksToExclude,omitempty"` - - // packages to include in the patch operation. Format: packageName_packageVersion - PackageNameMasksToInclude []*string `json:"packageNameMasksToInclude,omitempty"` -} - -// LinuxPatchSettings - Specifies settings related to VM Guest Patching on Linux. -type LinuxPatchSettings struct { - // Specifies the mode of VM Guest Patch Assessment for the IaaS virtual machine. - // Possible values are: - // ImageDefault - You control the timing of patch assessments on a virtual machine. - // AutomaticByPlatform - The platform will trigger periodic patch assessments. The property provisionVMAgent must be true. - AssessmentMode *LinuxPatchAssessmentMode `json:"assessmentMode,omitempty"` - - // Specifies additional settings for patch mode AutomaticByPlatform in VM Guest Patching on Linux. - AutomaticByPlatformSettings *LinuxVMGuestPatchAutomaticByPlatformSettings `json:"automaticByPlatformSettings,omitempty"` - - // Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual machines associated to virtual machine scale - // set with OrchestrationMode as Flexible. - // Possible values are: - // ImageDefault - The virtual machine's default patching configuration is used. - // AutomaticByPlatform - The virtual machine will be automatically updated by the platform. The property provisionVMAgent - // must be true - PatchMode *LinuxVMGuestPatchMode `json:"patchMode,omitempty"` -} - -// LinuxVMGuestPatchAutomaticByPlatformSettings - Specifies additional settings to be applied when patch mode AutomaticByPlatform -// is selected in Linux patch settings. -type LinuxVMGuestPatchAutomaticByPlatformSettings struct { - // Specifies the reboot setting for all AutomaticByPlatform patch installation operations. - RebootSetting *LinuxVMGuestPatchAutomaticByPlatformRebootSetting `json:"rebootSetting,omitempty"` -} - -// ListUsagesResult - The List Usages operation response. -type ListUsagesResult struct { - // REQUIRED; The list of compute resource usages. - Value []*Usage `json:"value,omitempty"` - - // The URI to fetch the next page of compute resource usage information. Call ListNext() with this to fetch the next page - // of compute resource usage information. - NextLink *string `json:"nextLink,omitempty"` -} - -// LoadBalancerConfiguration - Describes the load balancer configuration. -type LoadBalancerConfiguration struct { - // REQUIRED; The name of the Load balancer - Name *string `json:"name,omitempty"` - - // REQUIRED; Properties of the load balancer configuration. - Properties *LoadBalancerConfigurationProperties `json:"properties,omitempty"` - - // Resource Id - ID *string `json:"id,omitempty"` -} - -type LoadBalancerConfigurationProperties struct { - // REQUIRED; Specifies the frontend IP to be used for the load balancer. Only IPv4 frontend IP address is supported. Each - // load balancer configuration must have exactly one frontend IP configuration. - FrontendIPConfigurations []*LoadBalancerFrontendIPConfiguration `json:"frontendIPConfigurations,omitempty"` -} - -type LoadBalancerFrontendIPConfiguration struct { - // REQUIRED; The name of the resource that is unique within the set of frontend IP configurations used by the load balancer. - // This name can be used to access the resource. - Name *string `json:"name,omitempty"` - - // REQUIRED; Properties of load balancer frontend ip configuration. - Properties *LoadBalancerFrontendIPConfigurationProperties `json:"properties,omitempty"` -} - -// LoadBalancerFrontendIPConfigurationProperties - Describes a cloud service IP Configuration -type LoadBalancerFrontendIPConfigurationProperties struct { - // The virtual network private IP address of the IP configuration. - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - - // The reference to the public ip address resource. - PublicIPAddress *SubResource `json:"publicIPAddress,omitempty"` - - // The reference to the virtual network subnet resource. - Subnet *SubResource `json:"subnet,omitempty"` -} - -// LogAnalyticsClientBeginExportRequestRateByIntervalOptions contains the optional parameters for the LogAnalyticsClient.BeginExportRequestRateByInterval -// method. -type LogAnalyticsClientBeginExportRequestRateByIntervalOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// LogAnalyticsClientBeginExportThrottledRequestsOptions contains the optional parameters for the LogAnalyticsClient.BeginExportThrottledRequests -// method. -type LogAnalyticsClientBeginExportThrottledRequestsOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// LogAnalyticsInputBase - Api input base class for LogAnalytics Api. -type LogAnalyticsInputBase struct { - // REQUIRED; SAS Uri of the logging blob container to which LogAnalytics Api writes output logs to. - BlobContainerSasURI *string `json:"blobContainerSasUri,omitempty"` - - // REQUIRED; From time of the query - FromTime *time.Time `json:"fromTime,omitempty"` - - // REQUIRED; To time of the query - ToTime *time.Time `json:"toTime,omitempty"` - - // Group query result by Client Application ID. - GroupByClientApplicationID *bool `json:"groupByClientApplicationId,omitempty"` - - // Group query result by Operation Name. - GroupByOperationName *bool `json:"groupByOperationName,omitempty"` - - // Group query result by Resource Name. - GroupByResourceName *bool `json:"groupByResourceName,omitempty"` - - // Group query result by Throttle Policy applied. - GroupByThrottlePolicy *bool `json:"groupByThrottlePolicy,omitempty"` - - // Group query result by User Agent. - GroupByUserAgent *bool `json:"groupByUserAgent,omitempty"` -} - -// LogAnalyticsOperationResult - LogAnalytics operation status response -type LogAnalyticsOperationResult struct { - // READ-ONLY; LogAnalyticsOutput - Properties *LogAnalyticsOutput `json:"properties,omitempty" azure:"ro"` -} - -// LogAnalyticsOutput - LogAnalytics output properties -type LogAnalyticsOutput struct { - // READ-ONLY; Output file Uri path to blob container. - Output *string `json:"output,omitempty" azure:"ro"` -} - -// MaintenanceRedeployStatus - Maintenance Operation Status. -type MaintenanceRedeployStatus struct { - // True, if customer is allowed to perform Maintenance. - IsCustomerInitiatedMaintenanceAllowed *bool `json:"isCustomerInitiatedMaintenanceAllowed,omitempty"` - - // Message returned for the last Maintenance Operation. - LastOperationMessage *string `json:"lastOperationMessage,omitempty"` - - // The Last Maintenance Operation Result Code. - LastOperationResultCode *MaintenanceOperationResultCodeTypes `json:"lastOperationResultCode,omitempty"` - - // End Time for the Maintenance Window. - MaintenanceWindowEndTime *time.Time `json:"maintenanceWindowEndTime,omitempty"` - - // Start Time for the Maintenance Window. - MaintenanceWindowStartTime *time.Time `json:"maintenanceWindowStartTime,omitempty"` - - // End Time for the Pre Maintenance Window. - PreMaintenanceWindowEndTime *time.Time `json:"preMaintenanceWindowEndTime,omitempty"` - - // Start Time for the Pre Maintenance Window. - PreMaintenanceWindowStartTime *time.Time `json:"preMaintenanceWindowStartTime,omitempty"` -} - -// ManagedArtifact - The managed artifact. -type ManagedArtifact struct { - // REQUIRED; The managed artifact id. - ID *string `json:"id,omitempty"` -} - -// ManagedDiskParameters - The parameters of a managed disk. -type ManagedDiskParameters struct { - // Specifies the customer managed disk encryption set resource id for the managed disk. - DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` - - // Resource Id - ID *string `json:"id,omitempty"` - - // Specifies the security profile for the managed disk. - SecurityProfile *VMDiskSecurityProfile `json:"securityProfile,omitempty"` - - // Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot - // be used with OS Disk. - StorageAccountType *StorageAccountTypes `json:"storageAccountType,omitempty"` -} - -// NetworkInterfaceReference - Describes a network interface reference. -type NetworkInterfaceReference struct { - // Resource Id - ID *string `json:"id,omitempty"` - - // Describes a network interface reference properties. - Properties *NetworkInterfaceReferenceProperties `json:"properties,omitempty"` -} - -// NetworkInterfaceReferenceProperties - Describes a network interface reference properties. -type NetworkInterfaceReferenceProperties struct { - // Specify what happens to the network interface when the VM is deleted - DeleteOption *DeleteOptions `json:"deleteOption,omitempty"` - - // Specifies the primary network interface in case the virtual machine has more than 1 network interface. - Primary *bool `json:"primary,omitempty"` -} - -// NetworkProfile - Specifies the network interfaces or the networking configuration of the virtual machine. -type NetworkProfile struct { - // specifies the Microsoft.Network API version used when creating networking resources in the Network Interface Configurations - NetworkAPIVersion *NetworkAPIVersion `json:"networkApiVersion,omitempty"` - - // Specifies the networking configurations that will be used to create the virtual machine networking resources. - NetworkInterfaceConfigurations []*VirtualMachineNetworkInterfaceConfiguration `json:"networkInterfaceConfigurations,omitempty"` - - // Specifies the list of resource Ids for the network interfaces associated with the virtual machine. - NetworkInterfaces []*NetworkInterfaceReference `json:"networkInterfaces,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/managed-disks-overview]. -type OSDisk struct { - // REQUIRED; Specifies how the virtual machine should be created. - // Possible values are: - // Attach \u2013 This value is used when you are using a specialized disk to create the virtual machine. - // FromImage \u2013 This value is used when you are using an image to create the virtual machine. If you are using a platform - // image, you also use the imageReference element described above. If you are - // using a marketplace image, you also use the plan element previously described. - CreateOption *DiskCreateOptionTypes `json:"createOption,omitempty"` - - // Specifies the caching requirements. - // Possible values are: - // None - // ReadOnly - // ReadWrite - // Default: None for Standard storage. ReadOnly for Premium storage. - Caching *CachingTypes `json:"caching,omitempty"` - - // Specifies whether OS Disk should be deleted or detached upon VM deletion. - // Possible values: - // Delete If this value is used, the OS disk is deleted when VM is deleted. - // Detach If this value is used, the os disk is retained after VM is deleted. - // The default value is set to detach. For an ephemeral OS Disk, the default value is set to Delete. User cannot change the - // delete option for ephemeral OS Disk. - DeleteOption *DiskDeleteOptionTypes `json:"deleteOption,omitempty"` - - // Specifies the ephemeral Disk Settings for the operating system disk used by the virtual machine. - DiffDiskSettings *DiffDiskSettings `json:"diffDiskSettings,omitempty"` - - // Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a - // virtual machine image. - // This value cannot be larger than 1023 GB - DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` - - // Specifies the encryption settings for the OS Disk. - // Minimum api-version: 2015-06-15 - EncryptionSettings *DiskEncryptionSettings `json:"encryptionSettings,omitempty"` - - // 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. - Image *VirtualHardDisk `json:"image,omitempty"` - - // The managed disk parameters. - ManagedDisk *ManagedDiskParameters `json:"managedDisk,omitempty"` - - // The disk name. - Name *string `json:"name,omitempty"` - - // This property allows you to specify the type of the OS that is included in the disk if creating a VM from user-image or - // a specialized VHD. - // Possible values are: - // Windows - // Linux - OSType *OperatingSystemTypes `json:"osType,omitempty"` - - // The virtual hard disk. - Vhd *VirtualHardDisk `json:"vhd,omitempty"` - - // Specifies whether writeAccelerator should be enabled or disabled on the disk. - WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` -} - -// OSDiskImage - Contains the os disk image information. -type OSDiskImage struct { - // REQUIRED; The operating system of the osDiskImage. - OperatingSystem *OperatingSystemTypes `json:"operatingSystem,omitempty"` -} - -// OSDiskImageEncryption - Contains encryption settings for an OS disk image. -type OSDiskImageEncryption struct { - // A relative URI containing the resource ID of the disk encryption set. - DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` - - // This property specifies the security profile of an OS disk image. - SecurityProfile *OSDiskImageSecurityProfile `json:"securityProfile,omitempty"` -} - -// OSDiskImageSecurityProfile - Contains security profile for an OS disk image. -type OSDiskImageSecurityProfile struct { - // confidential VM encryption types - ConfidentialVMEncryptionType *ConfidentialVMEncryptionType `json:"confidentialVMEncryptionType,omitempty"` - - // secure VM disk encryption set id - SecureVMDiskEncryptionSetID *string `json:"secureVMDiskEncryptionSetId,omitempty"` -} - -// OSFamily - Describes a cloud service OS family. -type OSFamily struct { - // OS family properties. - Properties *OSFamilyProperties `json:"properties,omitempty"` - - // READ-ONLY; Resource Id. - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; Resource location. - Location *string `json:"location,omitempty" azure:"ro"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -type OSFamilyListResult struct { - // REQUIRED - Value []*OSFamily `json:"value,omitempty"` - NextLink *string `json:"nextLink,omitempty"` -} - -// OSFamilyProperties - OS family properties. -type OSFamilyProperties struct { - // READ-ONLY; The OS family label. - Label *string `json:"label,omitempty" azure:"ro"` - - // READ-ONLY; The OS family name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; List of OS versions belonging to this family. - Versions []*OSVersionPropertiesBase `json:"versions,omitempty" azure:"ro"` -} - -// OSProfile - Specifies the operating system settings for the virtual machine. Some of the settings cannot be changed once -// VM is provisioned. -type OSProfile struct { - // Specifies the password of the administrator account. - // Minimum-length (Windows): 8 characters - // Minimum-length (Linux): 6 characters - // Max-length (Windows): 123 characters - // Max-length (Linux): 72 characters - // Complexity requirements: 3 out of 4 conditions below need to be fulfilled - // Has lower characters - // Has upper characters - // Has a digit - // Has a special character (Regex match [\W_]) - // Disallowed values: "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", - // "Password22", "iloveyou!" - // For resetting the password, see How to reset the Remote Desktop service or its login password in a Windows VM [https://docs.microsoft.com/troubleshoot/azure/virtual-machines/reset-rdp] - // For resetting root password, see Manage users, SSH, and check or repair disks on Azure Linux VMs using the VMAccess Extension - // [https://docs.microsoft.com/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection] - AdminPassword *string `json:"adminPassword,omitempty"` - - // Specifies the name of the administrator account. - // This property cannot be updated after the VM is created. - // Windows-only restriction: Cannot end in "." - // Disallowed values: "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", - // "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", - // "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5". - // Minimum-length (Linux): 1 character - // Max-length (Linux): 64 characters - // Max-length (Windows): 20 characters. - AdminUsername *string `json:"adminUsername,omitempty"` - - // Specifies whether extension operations should be allowed on the virtual machine. - // This may only be set to False when no extensions are present on the virtual machine. - AllowExtensionOperations *bool `json:"allowExtensionOperations,omitempty"` - - // Specifies the host OS name of the virtual machine. - // This name cannot be updated after the VM is created. - // Max-length (Windows): 15 characters - // Max-length (Linux): 64 characters. - // For naming conventions and restrictions see Azure infrastructure services implementation guidelines [https://docs.microsoft.com/azure/azure-resource-manager/management/resource-name-rules]. - ComputerName *string `json:"computerName,omitempty"` - - // Specifies a base-64 encoded string of custom data. The base-64 encoded string is decoded to a binary array that is saved - // as a file on the Virtual Machine. The maximum length of the binary array is - // 65535 bytes. - // Note: Do not pass any secrets or passwords in customData property - // This property cannot be updated after the VM is created. - // customData is passed to the VM to be saved as a file, for more information see Custom Data on Azure VMs [https://azure.microsoft.com/blog/custom-data-and-cloud-init-on-windows-azure/] - // For using cloud-init for your Linux VM, see Using cloud-init to customize a Linux VM during creation [https://docs.microsoft.com/azure/virtual-machines/linux/using-cloud-init] - CustomData *string `json:"customData,omitempty"` - - // Specifies the Linux operating system settings on the virtual machine. - // For a list of supported Linux distributions, see Linux on Azure-Endorsed Distributions [https://docs.microsoft.com/azure/virtual-machines/linux/endorsed-distros]. - LinuxConfiguration *LinuxConfiguration `json:"linuxConfiguration,omitempty"` - - // Optional property which must either be set to True or omitted. - RequireGuestProvisionSignal *bool `json:"requireGuestProvisionSignal,omitempty"` - - // Specifies set of certificates that should be installed onto the virtual machine. To install certificates on a virtual machine - // it is recommended to use the Azure Key Vault virtual machine extension for - // Linux [https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux] or the Azure Key Vault virtual machine - // extension for Windows - // [https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows]. - Secrets []*VaultSecretGroup `json:"secrets,omitempty"` - - // Specifies Windows operating system settings on the virtual machine. - WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"` -} - -// OSVersion - Describes a cloud service OS version. -type OSVersion struct { - // OS version properties. - Properties *OSVersionProperties `json:"properties,omitempty"` - - // READ-ONLY; Resource Id. - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; Resource location. - Location *string `json:"location,omitempty" azure:"ro"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -type OSVersionListResult struct { - // REQUIRED - Value []*OSVersion `json:"value,omitempty"` - NextLink *string `json:"nextLink,omitempty"` -} - -// OSVersionProperties - OS version properties. -type OSVersionProperties struct { - // READ-ONLY; The family of this OS version. - Family *string `json:"family,omitempty" azure:"ro"` - - // READ-ONLY; The family label of this OS version. - FamilyLabel *string `json:"familyLabel,omitempty" azure:"ro"` - - // READ-ONLY; Specifies whether this OS version is active. - IsActive *bool `json:"isActive,omitempty" azure:"ro"` - - // READ-ONLY; Specifies whether this is the default OS version for its family. - IsDefault *bool `json:"isDefault,omitempty" azure:"ro"` - - // READ-ONLY; The OS version label. - Label *string `json:"label,omitempty" azure:"ro"` - - // READ-ONLY; The OS version. - Version *string `json:"version,omitempty" azure:"ro"` -} - -// OSVersionPropertiesBase - Configuration view of an OS version. -type OSVersionPropertiesBase struct { - // READ-ONLY; Specifies whether this OS version is active. - IsActive *bool `json:"isActive,omitempty" azure:"ro"` - - // READ-ONLY; Specifies whether this is the default OS version for its family. - IsDefault *bool `json:"isDefault,omitempty" azure:"ro"` - - // READ-ONLY; The OS version label. - Label *string `json:"label,omitempty" azure:"ro"` - - // READ-ONLY; The OS version. - Version *string `json:"version,omitempty" azure:"ro"` -} - -// OperationListResult - The List Compute Operation operation response. -type OperationListResult struct { - // READ-ONLY; The list of compute operations - Value []*OperationValue `json:"value,omitempty" azure:"ro"` -} - -// OperationValue - Describes the properties of a Compute Operation value. -type OperationValue struct { - // Describes the properties of a Compute Operation Value Display. - Display *OperationValueDisplay `json:"display,omitempty"` - - // READ-ONLY; The name of the compute operation. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; The origin of the compute operation. - Origin *string `json:"origin,omitempty" azure:"ro"` -} - -// OperationValueDisplay - Describes the properties of a Compute Operation Value Display. -type OperationValueDisplay struct { - // READ-ONLY; The description of the operation. - Description *string `json:"description,omitempty" azure:"ro"` - - // READ-ONLY; The display name of the compute operation. - Operation *string `json:"operation,omitempty" azure:"ro"` - - // READ-ONLY; The resource provider for the operation. - Provider *string `json:"provider,omitempty" azure:"ro"` - - // READ-ONLY; The display name of the resource the operation applies to. - Resource *string `json:"resource,omitempty" azure:"ro"` -} - -// OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. -type OperationsClientListOptions struct { - // placeholder for future optional parameters -} - -// OrchestrationServiceStateInput - The input for OrchestrationServiceState -type OrchestrationServiceStateInput struct { - // REQUIRED; The action to be performed. - Action *OrchestrationServiceStateAction `json:"action,omitempty"` - - // REQUIRED; The name of the service. - ServiceName *OrchestrationServiceNames `json:"serviceName,omitempty"` -} - -// OrchestrationServiceSummary - Summary for an orchestration service of a virtual machine scale set. -type OrchestrationServiceSummary struct { - // READ-ONLY; The name of the service. - ServiceName *OrchestrationServiceNames `json:"serviceName,omitempty" azure:"ro"` - - // READ-ONLY; The current state of the service. - ServiceState *OrchestrationServiceState `json:"serviceState,omitempty" azure:"ro"` -} - -// PatchInstallationDetail - Information about a specific patch that was encountered during an installation action. -type PatchInstallationDetail struct { - // READ-ONLY; The classification(s) of the patch as provided by the patch publisher. - Classifications []*string `json:"classifications,omitempty" azure:"ro"` - - // READ-ONLY; The state of the patch after the installation operation completed. - InstallationState *PatchInstallationState `json:"installationState,omitempty" azure:"ro"` - - // READ-ONLY; The KBID of the patch. Only applies to Windows patches. - KbID *string `json:"kbId,omitempty" azure:"ro"` - - // READ-ONLY; The friendly name of the patch. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; A unique identifier for the patch. - PatchID *string `json:"patchId,omitempty" azure:"ro"` - - // READ-ONLY; The version string of the package. It may conform to Semantic Versioning. Only applies to Linux. - Version *string `json:"version,omitempty" azure:"ro"` -} - -// PatchSettings - Specifies settings related to VM Guest Patching on Windows. -type PatchSettings struct { - // Specifies the mode of VM Guest patch assessment for the IaaS virtual machine. - // Possible values are: - // ImageDefault - You control the timing of patch assessments on a virtual machine. - // AutomaticByPlatform - The platform will trigger periodic patch assessments. The property provisionVMAgent must be true. - AssessmentMode *WindowsPatchAssessmentMode `json:"assessmentMode,omitempty"` - - // Specifies additional settings for patch mode AutomaticByPlatform in VM Guest Patching on Windows. - AutomaticByPlatformSettings *WindowsVMGuestPatchAutomaticByPlatformSettings `json:"automaticByPlatformSettings,omitempty"` - - // Enables customers to patch their Azure VMs without requiring a reboot. For enableHotpatching, the 'provisionVMAgent' must - // be set to true and 'patchMode' must be set to 'AutomaticByPlatform'. - EnableHotpatching *bool `json:"enableHotpatching,omitempty"` - - // Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual machines associated to virtual machine scale - // set with OrchestrationMode as Flexible. - // Possible values are: - // Manual - You control the application of patches to a virtual machine. You do this by applying patches manually inside the - // VM. In this mode, automatic updates are disabled; the property - // WindowsConfiguration.enableAutomaticUpdates must be false - // AutomaticByOS - The virtual machine will automatically be updated by the OS. The property WindowsConfiguration.enableAutomaticUpdates - // must be true. - // AutomaticByPlatform - the virtual machine will automatically updated by the platform. The properties provisionVMAgent and - // WindowsConfiguration.enableAutomaticUpdates must be true - PatchMode *WindowsVMGuestPatchMode `json:"patchMode,omitempty"` -} - -// PirCommunityGalleryResource - Base information about the community gallery resource in pir. -type PirCommunityGalleryResource struct { - // The identifier information of community gallery. - Identifier *CommunityGalleryIdentifier `json:"identifier,omitempty"` - - // READ-ONLY; Resource location - Location *string `json:"location,omitempty" azure:"ro"` - - // READ-ONLY; Resource name - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type - Type *string `json:"type,omitempty" azure:"ro"` -} - -// PirResource - The Resource model definition. -type PirResource struct { - // READ-ONLY; Resource location - Location *string `json:"location,omitempty" azure:"ro"` - - // READ-ONLY; Resource name - Name *string `json:"name,omitempty" azure:"ro"` -} - -// PirSharedGalleryResource - Base information about the shared gallery resource in pir. -type PirSharedGalleryResource struct { - // The identifier information of shared gallery. - Identifier *SharedGalleryIdentifier `json:"identifier,omitempty"` - - // READ-ONLY; Resource location - Location *string `json:"location,omitempty" azure:"ro"` - - // READ-ONLY; Resource name - Name *string `json:"name,omitempty" azure:"ro"` -} - -// 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 { - // The plan ID. - Name *string `json:"name,omitempty"` - - // Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference element. - Product *string `json:"product,omitempty"` - - // The promotion code. - PromotionCode *string `json:"promotionCode,omitempty"` - - // The publisher ID. - Publisher *string `json:"publisher,omitempty"` -} - -// PrivateEndpoint - The Private Endpoint resource. -type PrivateEndpoint struct { - // READ-ONLY; The ARM identifier for Private Endpoint - ID *string `json:"id,omitempty" azure:"ro"` -} - -// PrivateEndpointConnection - The Private Endpoint Connection resource. -type PrivateEndpointConnection struct { - // Resource properties. - Properties *PrivateEndpointConnectionProperties `json:"properties,omitempty"` - - // READ-ONLY; private endpoint connection Id - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; private endpoint connection name - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; private endpoint connection type - Type *string `json:"type,omitempty" azure:"ro"` -} - -// PrivateEndpointConnectionListResult - A list of private link resources -type PrivateEndpointConnectionListResult struct { - // The uri to fetch the next page of snapshots. Call ListNext() with this to fetch the next page of snapshots. - NextLink *string `json:"nextLink,omitempty"` - - // Array of private endpoint connections - Value []*PrivateEndpointConnection `json:"value,omitempty"` -} - -// PrivateEndpointConnectionProperties - Properties of the PrivateEndpointConnectProperties. -type PrivateEndpointConnectionProperties struct { - // REQUIRED; A collection of information about the state of the connection between DiskAccess and Virtual Network. - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - - // READ-ONLY; The resource of private end point. - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty" azure:"ro"` - - // READ-ONLY; The provisioning state of the private endpoint connection resource. - ProvisioningState *PrivateEndpointConnectionProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// PrivateLinkResource - A private link resource -type PrivateLinkResource struct { - // Resource properties. - Properties *PrivateLinkResourceProperties `json:"properties,omitempty"` - - // READ-ONLY; private link resource Id - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; private link resource name - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; private link resource type - Type *string `json:"type,omitempty" azure:"ro"` -} - -// PrivateLinkResourceListResult - A list of private link resources -type PrivateLinkResourceListResult struct { - // Array of private link resources - Value []*PrivateLinkResource `json:"value,omitempty"` -} - -// PrivateLinkResourceProperties - Properties of a private link resource. -type PrivateLinkResourceProperties struct { - // The private link resource DNS zone name. - RequiredZoneNames []*string `json:"requiredZoneNames,omitempty"` - - // READ-ONLY; The private link resource group id. - GroupID *string `json:"groupId,omitempty" azure:"ro"` - - // READ-ONLY; The private link resource required member names. - RequiredMembers []*string `json:"requiredMembers,omitempty" azure:"ro"` -} - -// PrivateLinkServiceConnectionState - A collection of information about the state of the connection between service consumer -// and provider. -type PrivateLinkServiceConnectionState struct { - // A message indicating if changes on the service provider require any updates on the consumer. - ActionsRequired *string `json:"actionsRequired,omitempty"` - - // The reason for approval/rejection of the connection. - Description *string `json:"description,omitempty"` - - // Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. - Status *PrivateEndpointServiceConnectionStatus `json:"status,omitempty"` -} - -// PropertyUpdatesInProgress - Properties of the disk for which update is pending. -type PropertyUpdatesInProgress struct { - // The target performance tier of the disk if a tier change operation is in progress. - TargetTier *string `json:"targetTier,omitempty"` -} - -// ProximityPlacementGroup - Specifies information about the proximity placement group. -type ProximityPlacementGroup struct { - // REQUIRED; Resource location - Location *string `json:"location,omitempty"` - - // Describes the properties of a Proximity Placement Group. - Properties *ProximityPlacementGroupProperties `json:"properties,omitempty"` - - // Resource tags - Tags map[string]*string `json:"tags,omitempty"` - - // Specifies the Availability Zone where virtual machine, virtual machine scale set or availability set associated with the - // proximity placement group can be created. - Zones []*string `json:"zones,omitempty"` - - // READ-ONLY; Resource Id - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; Resource name - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ProximityPlacementGroupListResult - The List Proximity Placement Group operation response. -type ProximityPlacementGroupListResult struct { - // REQUIRED; The list of proximity placement groups - Value []*ProximityPlacementGroup `json:"value,omitempty"` - - // The URI to fetch the next page of proximity placement groups. - NextLink *string `json:"nextLink,omitempty"` -} - -// ProximityPlacementGroupProperties - Describes the properties of a Proximity Placement Group. -type ProximityPlacementGroupProperties struct { - // Describes colocation status of the Proximity Placement Group. - ColocationStatus *InstanceViewStatus `json:"colocationStatus,omitempty"` - - // Specifies the user intent of the proximity placement group. - Intent *ProximityPlacementGroupPropertiesIntent `json:"intent,omitempty"` - - // Specifies the type of the proximity placement group. - // Possible values are: - // Standard : Co-locate resources within an Azure region or Availability Zone. - // Ultra : For future use. - ProximityPlacementGroupType *ProximityPlacementGroupType `json:"proximityPlacementGroupType,omitempty"` - - // READ-ONLY; A list of references to all availability sets in the proximity placement group. - AvailabilitySets []*SubResourceWithColocationStatus `json:"availabilitySets,omitempty" azure:"ro"` - - // READ-ONLY; A list of references to all virtual machine scale sets in the proximity placement group. - VirtualMachineScaleSets []*SubResourceWithColocationStatus `json:"virtualMachineScaleSets,omitempty" azure:"ro"` - - // READ-ONLY; A list of references to all virtual machines in the proximity placement group. - VirtualMachines []*SubResourceWithColocationStatus `json:"virtualMachines,omitempty" azure:"ro"` -} - -// ProximityPlacementGroupPropertiesIntent - Specifies the user intent of the proximity placement group. -type ProximityPlacementGroupPropertiesIntent struct { - // Specifies possible sizes of virtual machines that can be created in the proximity placement group. - VMSizes []*string `json:"vmSizes,omitempty"` -} - -// ProximityPlacementGroupUpdate - Specifies information about the proximity placement group. -type ProximityPlacementGroupUpdate struct { - // Resource tags - Tags map[string]*string `json:"tags,omitempty"` -} - -// ProximityPlacementGroupsClientCreateOrUpdateOptions contains the optional parameters for the ProximityPlacementGroupsClient.CreateOrUpdate -// method. -type ProximityPlacementGroupsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// ProximityPlacementGroupsClientDeleteOptions contains the optional parameters for the ProximityPlacementGroupsClient.Delete -// method. -type ProximityPlacementGroupsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// ProximityPlacementGroupsClientGetOptions contains the optional parameters for the ProximityPlacementGroupsClient.Get method. -type ProximityPlacementGroupsClientGetOptions struct { - // includeColocationStatus=true enables fetching the colocation status of all the resources in the proximity placement group. - IncludeColocationStatus *string -} - -// ProximityPlacementGroupsClientListByResourceGroupOptions contains the optional parameters for the ProximityPlacementGroupsClient.ListByResourceGroup -// method. -type ProximityPlacementGroupsClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// ProximityPlacementGroupsClientListBySubscriptionOptions contains the optional parameters for the ProximityPlacementGroupsClient.ListBySubscription -// method. -type ProximityPlacementGroupsClientListBySubscriptionOptions struct { - // placeholder for future optional parameters -} - -// ProximityPlacementGroupsClientUpdateOptions contains the optional parameters for the ProximityPlacementGroupsClient.Update -// method. -type ProximityPlacementGroupsClientUpdateOptions struct { - // placeholder for future optional parameters -} - -// ProxyOnlyResource - The ProxyOnly Resource model definition. -type ProxyOnlyResource struct { - // READ-ONLY; Resource Id - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; Resource name - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ProxyResource - The resource model definition for an Azure Resource Manager proxy resource. It will not have tags and a -// location -type ProxyResource struct { - // READ-ONLY; Resource Id - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; Resource name - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type - Type *string `json:"type,omitempty" azure:"ro"` -} - -// PublicIPAddressSKU - Describes the public IP Sku. It can only be set with OrchestrationMode as Flexible. -type PublicIPAddressSKU struct { - // Specify public IP sku name - Name *PublicIPAddressSKUName `json:"name,omitempty"` - - // Specify public IP sku tier - Tier *PublicIPAddressSKUTier `json:"tier,omitempty"` -} - -// PurchasePlan - Used for establishing the purchase context of any 3rd Party artifact through MarketPlace. -type PurchasePlan struct { - // REQUIRED; The plan ID. - Name *string `json:"name,omitempty"` - - // REQUIRED; Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference - // element. - Product *string `json:"product,omitempty"` - - // REQUIRED; The publisher ID. - Publisher *string `json:"publisher,omitempty"` -} - -// RecommendedMachineConfiguration - The properties describe the recommended machine configuration for this Image Definition. -// These properties are updatable. -type RecommendedMachineConfiguration struct { - // Describes the resource range. - Memory *ResourceRange `json:"memory,omitempty"` - - // Describes the resource range. - VCPUs *ResourceRange `json:"vCPUs,omitempty"` -} - -// RecoveryWalkResponse - Response after calling a manual recovery walk -type RecoveryWalkResponse struct { - // READ-ONLY; The next update domain that needs to be walked. Null means walk spanning all update domains has been completed - NextPlatformUpdateDomain *int32 `json:"nextPlatformUpdateDomain,omitempty" azure:"ro"` - - // READ-ONLY; Whether the recovery walk was performed - WalkPerformed *bool `json:"walkPerformed,omitempty" azure:"ro"` -} - -// RegionalReplicationStatus - This is the regional replication status. -type RegionalReplicationStatus struct { - // READ-ONLY; The details of the replication status. - Details *string `json:"details,omitempty" azure:"ro"` - - // READ-ONLY; It indicates progress of the replication job. - Progress *int32 `json:"progress,omitempty" azure:"ro"` - - // READ-ONLY; The region to which the gallery image version is being replicated to. - Region *string `json:"region,omitempty" azure:"ro"` - - // READ-ONLY; This is the regional replication state. - State *ReplicationState `json:"state,omitempty" azure:"ro"` -} - -// RegionalSharingStatus - Gallery regional sharing status -type RegionalSharingStatus struct { - // Details of gallery regional sharing failure. - Details *string `json:"details,omitempty"` - - // Region name - Region *string `json:"region,omitempty"` - - // READ-ONLY; Gallery sharing state in current region - State *SharingState `json:"state,omitempty" azure:"ro"` -} - -// ReplicationStatus - This is the replication status of the gallery image version. -type ReplicationStatus struct { - // READ-ONLY; This is the aggregated replication status based on all the regional replication status flags. - AggregatedState *AggregatedReplicationState `json:"aggregatedState,omitempty" azure:"ro"` - - // READ-ONLY; This is a summary of replication status for each region. - Summary []*RegionalReplicationStatus `json:"summary,omitempty" azure:"ro"` -} - -// RequestRateByIntervalInput - Api request input for LogAnalytics getRequestRateByInterval Api. -type RequestRateByIntervalInput struct { - // REQUIRED; SAS Uri of the logging blob container to which LogAnalytics Api writes output logs to. - BlobContainerSasURI *string `json:"blobContainerSasUri,omitempty"` - - // REQUIRED; From time of the query - FromTime *time.Time `json:"fromTime,omitempty"` - - // REQUIRED; Interval value in minutes used to create LogAnalytics call rate logs. - IntervalLength *IntervalInMins `json:"intervalLength,omitempty"` - - // REQUIRED; To time of the query - ToTime *time.Time `json:"toTime,omitempty"` - - // Group query result by Client Application ID. - GroupByClientApplicationID *bool `json:"groupByClientApplicationId,omitempty"` - - // Group query result by Operation Name. - GroupByOperationName *bool `json:"groupByOperationName,omitempty"` - - // Group query result by Resource Name. - GroupByResourceName *bool `json:"groupByResourceName,omitempty"` - - // Group query result by Throttle Policy applied. - GroupByThrottlePolicy *bool `json:"groupByThrottlePolicy,omitempty"` - - // Group query result by User Agent. - GroupByUserAgent *bool `json:"groupByUserAgent,omitempty"` -} - -// Resource - The Resource model definition. -type Resource struct { - // REQUIRED; Resource location - Location *string `json:"location,omitempty"` - - // Resource tags - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; Resource Id - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; Resource name - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ResourceInstanceViewStatus - Instance view status. -type ResourceInstanceViewStatus struct { - // The level code. - Level *StatusLevelTypes `json:"level,omitempty"` - - // READ-ONLY; The status code. - Code *string `json:"code,omitempty" azure:"ro"` - - // READ-ONLY; The short localizable label for the status. - DisplayStatus *string `json:"displayStatus,omitempty" azure:"ro"` - - // READ-ONLY; The detailed status message, including for alerts and error messages. - Message *string `json:"message,omitempty" azure:"ro"` - - // READ-ONLY; The time of the status. - Time *time.Time `json:"time,omitempty" azure:"ro"` -} - -// ResourceRange - Describes the resource range. -type ResourceRange struct { - // The maximum number of the resource. - Max *int32 `json:"max,omitempty"` - - // The minimum number of the resource. - Min *int32 `json:"min,omitempty"` -} - -// ResourceSKU - Describes an available Compute SKU. -type ResourceSKU struct { - // READ-ONLY; The api versions that support this SKU. - APIVersions []*string `json:"apiVersions,omitempty" azure:"ro"` - - // READ-ONLY; A name value pair to describe the capability. - Capabilities []*ResourceSKUCapabilities `json:"capabilities,omitempty" azure:"ro"` - - // READ-ONLY; Specifies the number of virtual machines in the scale set. - Capacity *ResourceSKUCapacity `json:"capacity,omitempty" azure:"ro"` - - // READ-ONLY; Metadata for retrieving price info. - Costs []*ResourceSKUCosts `json:"costs,omitempty" azure:"ro"` - - // READ-ONLY; The Family of this particular SKU. - Family *string `json:"family,omitempty" azure:"ro"` - - // READ-ONLY; The Kind of resources that are supported in this SKU. - Kind *string `json:"kind,omitempty" azure:"ro"` - - // READ-ONLY; A list of locations and availability zones in those locations where the SKU is available. - LocationInfo []*ResourceSKULocationInfo `json:"locationInfo,omitempty" azure:"ro"` - - // READ-ONLY; The set of locations that the SKU is available. - Locations []*string `json:"locations,omitempty" azure:"ro"` - - // READ-ONLY; The name of SKU. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; The type of resource the SKU applies to. - ResourceType *string `json:"resourceType,omitempty" azure:"ro"` - - // READ-ONLY; The restrictions because of which SKU cannot be used. This is empty if there are no restrictions. - Restrictions []*ResourceSKURestrictions `json:"restrictions,omitempty" azure:"ro"` - - // READ-ONLY; The Size of the SKU. - Size *string `json:"size,omitempty" azure:"ro"` - - // READ-ONLY; Specifies the tier of virtual machines in a scale set. - // Possible Values: - // Standard - // Basic - Tier *string `json:"tier,omitempty" azure:"ro"` -} - -// ResourceSKUCapabilities - Describes The SKU capabilities object. -type ResourceSKUCapabilities struct { - // READ-ONLY; An invariant to describe the feature. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; An invariant if the feature is measured by quantity. - Value *string `json:"value,omitempty" azure:"ro"` -} - -// ResourceSKUCapacity - Describes scaling information of a SKU. -type ResourceSKUCapacity struct { - // READ-ONLY; The default capacity. - Default *int64 `json:"default,omitempty" azure:"ro"` - - // READ-ONLY; The maximum capacity that can be set. - Maximum *int64 `json:"maximum,omitempty" azure:"ro"` - - // READ-ONLY; The minimum capacity. - Minimum *int64 `json:"minimum,omitempty" azure:"ro"` - - // READ-ONLY; The scale type applicable to the sku. - ScaleType *ResourceSKUCapacityScaleType `json:"scaleType,omitempty" azure:"ro"` -} - -// ResourceSKUCosts - Describes metadata for retrieving price info. -type ResourceSKUCosts struct { - // READ-ONLY; An invariant to show the extended unit. - ExtendedUnit *string `json:"extendedUnit,omitempty" azure:"ro"` - - // READ-ONLY; Used for querying price from commerce. - MeterID *string `json:"meterID,omitempty" azure:"ro"` - - // READ-ONLY; The multiplier is needed to extend the base metered cost. - Quantity *int64 `json:"quantity,omitempty" azure:"ro"` -} - -// ResourceSKULocationInfo - Describes an available Compute SKU Location Information. -type ResourceSKULocationInfo struct { - // READ-ONLY; The names of extended locations. - ExtendedLocations []*string `json:"extendedLocations,omitempty" azure:"ro"` - - // READ-ONLY; Location of the SKU - Location *string `json:"location,omitempty" azure:"ro"` - - // READ-ONLY; The type of the extended location. - Type *ExtendedLocationType `json:"type,omitempty" azure:"ro"` - - // READ-ONLY; Details of capabilities available to a SKU in specific zones. - ZoneDetails []*ResourceSKUZoneDetails `json:"zoneDetails,omitempty" azure:"ro"` - - // READ-ONLY; List of availability zones where the SKU is supported. - Zones []*string `json:"zones,omitempty" azure:"ro"` -} - -// ResourceSKURestrictionInfo - Describes an available Compute SKU Restriction Information. -type ResourceSKURestrictionInfo struct { - // READ-ONLY; Locations where the SKU is restricted - Locations []*string `json:"locations,omitempty" azure:"ro"` - - // READ-ONLY; List of availability zones where the SKU is restricted. - Zones []*string `json:"zones,omitempty" azure:"ro"` -} - -// ResourceSKURestrictions - Describes scaling information of a SKU. -type ResourceSKURestrictions struct { - // READ-ONLY; The reason for restriction. - ReasonCode *ResourceSKURestrictionsReasonCode `json:"reasonCode,omitempty" azure:"ro"` - - // READ-ONLY; The information about the restriction where the SKU cannot be used. - RestrictionInfo *ResourceSKURestrictionInfo `json:"restrictionInfo,omitempty" azure:"ro"` - - // READ-ONLY; The type of restrictions. - Type *ResourceSKURestrictionsType `json:"type,omitempty" azure:"ro"` - - // READ-ONLY; 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" azure:"ro"` -} - -// ResourceSKUZoneDetails - Describes The zonal capabilities of a SKU. -type ResourceSKUZoneDetails struct { - // READ-ONLY; A list of capabilities that are available for the SKU in the specified list of zones. - Capabilities []*ResourceSKUCapabilities `json:"capabilities,omitempty" azure:"ro"` - - // READ-ONLY; The set of zones that the SKU is available in with the specified capabilities. - Name []*string `json:"name,omitempty" azure:"ro"` -} - -// ResourceSKUsClientListOptions contains the optional parameters for the ResourceSKUsClient.List method. -type ResourceSKUsClientListOptions struct { - // The filter to apply on the operation. Only location filter is supported currently. - Filter *string - // To Include Extended Locations information or not in the response. - IncludeExtendedLocations *string -} - -// ResourceSKUsResult - The List Resource Skus operation response. -type ResourceSKUsResult struct { - // REQUIRED; The list of skus available for the subscription. - Value []*ResourceSKU `json:"value,omitempty"` - - // The URI to fetch the next page of Resource Skus. Call ListNext() with this URI to fetch the next page of Resource Skus - NextLink *string `json:"nextLink,omitempty"` -} - -// ResourceURIList - The List resources which are encrypted with the disk encryption set. -type ResourceURIList struct { - // REQUIRED; A list of IDs or Owner IDs of resources which are encrypted with the disk encryption set. - Value []*string `json:"value,omitempty"` - - // The uri to fetch the next page of encrypted resources. Call ListNext() with this to fetch the next page of encrypted resources. - NextLink *string `json:"nextLink,omitempty"` -} - -// ResourceWithOptionalLocation - The Resource model definition with location property as optional. -type ResourceWithOptionalLocation struct { - // Resource location - Location *string `json:"location,omitempty"` - - // Resource tags - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; Resource Id - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; Resource name - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type - Type *string `json:"type,omitempty" azure:"ro"` -} - -// RestorePoint - Restore Point details. -type RestorePoint struct { - // The restore point properties. - Properties *RestorePointProperties `json:"properties,omitempty"` - - // READ-ONLY; Resource Id - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; Resource name - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type - Type *string `json:"type,omitempty" azure:"ro"` -} - -// RestorePointCollection - Create or update Restore Point collection parameters. -type RestorePointCollection struct { - // REQUIRED; Resource location - Location *string `json:"location,omitempty"` - - // The restore point collection properties. - Properties *RestorePointCollectionProperties `json:"properties,omitempty"` - - // Resource tags - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; Resource Id - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; Resource name - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type - Type *string `json:"type,omitempty" azure:"ro"` -} - -// RestorePointCollectionListResult - The List restore point collection operation response. -type RestorePointCollectionListResult struct { - // The uri to fetch the next page of RestorePointCollections. Call ListNext() with this to fetch the next page of RestorePointCollections - NextLink *string `json:"nextLink,omitempty"` - - // Gets the list of restore point collections. - Value []*RestorePointCollection `json:"value,omitempty"` -} - -// RestorePointCollectionProperties - The restore point collection properties. -type RestorePointCollectionProperties struct { - // The properties of the source resource that this restore point collection is created from. - Source *RestorePointCollectionSourceProperties `json:"source,omitempty"` - - // READ-ONLY; The provisioning state of the restore point collection. - ProvisioningState *string `json:"provisioningState,omitempty" azure:"ro"` - - // READ-ONLY; The unique id of the restore point collection. - RestorePointCollectionID *string `json:"restorePointCollectionId,omitempty" azure:"ro"` - - // READ-ONLY; A list containing all restore points created under this restore point collection. - RestorePoints []*RestorePoint `json:"restorePoints,omitempty" azure:"ro"` -} - -// RestorePointCollectionSourceProperties - The properties of the source resource that this restore point collection is created -// from. -type RestorePointCollectionSourceProperties struct { - // Resource Id of the source resource used to create this restore point collection - ID *string `json:"id,omitempty"` - - // READ-ONLY; Location of the source resource used to create this restore point collection. - Location *string `json:"location,omitempty" azure:"ro"` -} - -// RestorePointCollectionUpdate - Update Restore Point collection parameters. -type RestorePointCollectionUpdate struct { - // The restore point collection properties. - Properties *RestorePointCollectionProperties `json:"properties,omitempty"` - - // Resource tags - Tags map[string]*string `json:"tags,omitempty"` -} - -// RestorePointCollectionsClientBeginDeleteOptions contains the optional parameters for the RestorePointCollectionsClient.BeginDelete -// method. -type RestorePointCollectionsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// RestorePointCollectionsClientCreateOrUpdateOptions contains the optional parameters for the RestorePointCollectionsClient.CreateOrUpdate -// method. -type RestorePointCollectionsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// RestorePointCollectionsClientGetOptions contains the optional parameters for the RestorePointCollectionsClient.Get method. -type RestorePointCollectionsClientGetOptions struct { - // The expand expression to apply on the operation. If expand=restorePoints, server will return all contained restore points - // in the restorePointCollection. - Expand *RestorePointCollectionExpandOptions -} - -// RestorePointCollectionsClientListAllOptions contains the optional parameters for the RestorePointCollectionsClient.ListAll -// method. -type RestorePointCollectionsClientListAllOptions struct { - // placeholder for future optional parameters -} - -// RestorePointCollectionsClientListOptions contains the optional parameters for the RestorePointCollectionsClient.List method. -type RestorePointCollectionsClientListOptions struct { - // placeholder for future optional parameters -} - -// RestorePointCollectionsClientUpdateOptions contains the optional parameters for the RestorePointCollectionsClient.Update -// method. -type RestorePointCollectionsClientUpdateOptions struct { - // placeholder for future optional parameters -} - -// RestorePointInstanceView - The instance view of a restore point. -type RestorePointInstanceView struct { - // The disk restore points information. - DiskRestorePoints []*DiskRestorePointInstanceView `json:"diskRestorePoints,omitempty"` - - // The resource status information. - Statuses []*InstanceViewStatus `json:"statuses,omitempty"` -} - -// RestorePointProperties - The restore point properties. -type RestorePointProperties struct { - // ConsistencyMode of the RestorePoint. Can be specified in the input while creating a restore point. For now, only CrashConsistent - // is accepted as a valid input. Please refer to - // https://aka.ms/RestorePoints for more details. - ConsistencyMode *ConsistencyModeTypes `json:"consistencyMode,omitempty"` - - // List of disk resource ids that the customer wishes to exclude from the restore point. If no disks are specified, all disks - // will be included. - ExcludeDisks []*APIEntityReference `json:"excludeDisks,omitempty"` - - // Resource Id of the source restore point from which a copy needs to be created. - SourceRestorePoint *APIEntityReference `json:"sourceRestorePoint,omitempty"` - - // Gets the creation time of the restore point. - TimeCreated *time.Time `json:"timeCreated,omitempty"` - - // READ-ONLY; The restore point instance view. - InstanceView *RestorePointInstanceView `json:"instanceView,omitempty" azure:"ro"` - - // READ-ONLY; Gets the provisioning state of the restore point. - ProvisioningState *string `json:"provisioningState,omitempty" azure:"ro"` - - // READ-ONLY; Gets the details of the VM captured at the time of the restore point creation. - SourceMetadata *RestorePointSourceMetadata `json:"sourceMetadata,omitempty" azure:"ro"` -} - -// RestorePointSourceMetadata - Describes the properties of the Virtual Machine for which the restore point was created. The -// properties provided are a subset and the snapshot of the overall Virtual Machine properties captured at the -// time of the restore point creation. -type RestorePointSourceMetadata struct { - // Gets the diagnostics profile. - DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` - - // Gets the hardware profile. - HardwareProfile *HardwareProfile `json:"hardwareProfile,omitempty"` - - // Gets the license type, which is for bring your own license scenario. - LicenseType *string `json:"licenseType,omitempty"` - - // Location of the VM from which the restore point was created. - Location *string `json:"location,omitempty"` - - // Gets the OS profile. - OSProfile *OSProfile `json:"osProfile,omitempty"` - - // Gets the security profile. - SecurityProfile *SecurityProfile `json:"securityProfile,omitempty"` - - // Gets the storage profile. - StorageProfile *RestorePointSourceVMStorageProfile `json:"storageProfile,omitempty"` - - // Gets the virtual machine unique id. - VMID *string `json:"vmId,omitempty"` -} - -// RestorePointSourceVMDataDisk - Describes a data disk. -type RestorePointSourceVMDataDisk struct { - // Gets the caching type. - Caching *CachingTypes `json:"caching,omitempty"` - - // Gets the disk restore point Id. - DiskRestorePoint *APIEntityReference `json:"diskRestorePoint,omitempty"` - - // Gets the initial disk size in GB for blank data disks, and the new desired size for existing OS and Data disks. - DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` - - // Gets the logical unit number. - Lun *int32 `json:"lun,omitempty"` - - // Gets the managed disk details - ManagedDisk *ManagedDiskParameters `json:"managedDisk,omitempty"` - - // Gets the disk name. - Name *string `json:"name,omitempty"` -} - -// RestorePointSourceVMOSDisk - Describes an Operating System disk. -type RestorePointSourceVMOSDisk struct { - // Gets the caching type. - Caching *CachingTypes `json:"caching,omitempty"` - - // Gets the disk restore point Id. - DiskRestorePoint *APIEntityReference `json:"diskRestorePoint,omitempty"` - - // Gets the disk size in GB. - DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` - - // Gets the disk encryption settings. - EncryptionSettings *DiskEncryptionSettings `json:"encryptionSettings,omitempty"` - - // Gets the managed disk details - ManagedDisk *ManagedDiskParameters `json:"managedDisk,omitempty"` - - // Gets the disk name. - Name *string `json:"name,omitempty"` - - // Gets the Operating System type. - OSType *OperatingSystemType `json:"osType,omitempty"` -} - -// RestorePointSourceVMStorageProfile - Describes the storage profile. -type RestorePointSourceVMStorageProfile struct { - // Gets the data disks of the VM captured at the time of the restore point creation. - DataDisks []*RestorePointSourceVMDataDisk `json:"dataDisks,omitempty"` - - // Gets the OS disk of the VM captured at the time of the restore point creation. - OSDisk *RestorePointSourceVMOSDisk `json:"osDisk,omitempty"` -} - -// RestorePointsClientBeginCreateOptions contains the optional parameters for the RestorePointsClient.BeginCreate method. -type RestorePointsClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// RestorePointsClientBeginDeleteOptions contains the optional parameters for the RestorePointsClient.BeginDelete method. -type RestorePointsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// RestorePointsClientGetOptions contains the optional parameters for the RestorePointsClient.Get method. -type RestorePointsClientGetOptions struct { - // The expand expression to apply on the operation. 'InstanceView' retrieves information about the run-time state of a restore - // point. - Expand *RestorePointExpandOptions -} - -// RetrieveBootDiagnosticsDataResult - The SAS URIs of the console screenshot and serial log blobs. -type RetrieveBootDiagnosticsDataResult struct { - // READ-ONLY; The console screenshot blob URI - ConsoleScreenshotBlobURI *string `json:"consoleScreenshotBlobUri,omitempty" azure:"ro"` - - // READ-ONLY; The serial console log blob URI. - SerialConsoleLogBlobURI *string `json:"serialConsoleLogBlobUri,omitempty" azure:"ro"` -} - -type RoleInstance struct { - Properties *RoleInstanceProperties `json:"properties,omitempty"` - SKU *InstanceSKU `json:"sku,omitempty"` - - // READ-ONLY; Resource Id - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; Resource Location. - Location *string `json:"location,omitempty" azure:"ro"` - - // READ-ONLY; Resource Name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource tags. - Tags map[string]*string `json:"tags,omitempty" azure:"ro"` - - // READ-ONLY; Resource Type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -type RoleInstanceListResult struct { - // REQUIRED - Value []*RoleInstance `json:"value,omitempty"` - NextLink *string `json:"nextLink,omitempty"` -} - -// RoleInstanceNetworkProfile - Describes the network profile for the role instance. -type RoleInstanceNetworkProfile struct { - // READ-ONLY; Specifies the list of resource Ids for the network interfaces associated with the role instance. - NetworkInterfaces []*SubResource `json:"networkInterfaces,omitempty" azure:"ro"` -} - -type RoleInstanceProperties struct { - // The instance view of the role instance. - InstanceView *RoleInstanceView `json:"instanceView,omitempty"` - - // Describes the network profile for the role instance. - NetworkProfile *RoleInstanceNetworkProfile `json:"networkProfile,omitempty"` -} - -// RoleInstanceView - The instance view of the role instance. -type RoleInstanceView struct { - // READ-ONLY; The Fault Domain. - PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty" azure:"ro"` - - // READ-ONLY; The Update Domain. - PlatformUpdateDomain *int32 `json:"platformUpdateDomain,omitempty" azure:"ro"` - - // READ-ONLY; Specifies a unique identifier generated internally for the cloud service associated with this role instance. - // NOTE: If you are using Azure Diagnostics extension, this property can be used as 'DeploymentId' for querying details. - PrivateID *string `json:"privateId,omitempty" azure:"ro"` - - // READ-ONLY - Statuses []*ResourceInstanceViewStatus `json:"statuses,omitempty" azure:"ro"` -} - -// RoleInstances - Specifies a list of role instances from the cloud service. -type RoleInstances struct { - // REQUIRED; List of cloud service role instance names. Value of '*' will signify all role instances of the cloud service. - RoleInstances []*string `json:"roleInstances,omitempty"` -} - -// RollbackStatusInfo - Information about rollback on failed VM instances after a OS Upgrade operation. -type RollbackStatusInfo struct { - // READ-ONLY; The number of instances which failed to rollback. - FailedRolledbackInstanceCount *int32 `json:"failedRolledbackInstanceCount,omitempty" azure:"ro"` - - // READ-ONLY; Error details if OS rollback failed. - RollbackError *APIError `json:"rollbackError,omitempty" azure:"ro"` - - // READ-ONLY; The number of instances which have been successfully rolled back. - SuccessfullyRolledbackInstanceCount *int32 `json:"successfullyRolledbackInstanceCount,omitempty" azure:"ro"` -} - -// RollingUpgradePolicy - The configuration parameters used while performing a rolling upgrade. -type RollingUpgradePolicy struct { - // Allow VMSS to ignore AZ boundaries when constructing upgrade batches. Take into consideration the Update Domain and maxBatchInstancePercent - // to determine the batch size. - EnableCrossZoneUpgrade *bool `json:"enableCrossZoneUpgrade,omitempty"` - - // The maximum percent of total virtual machine instances that will be upgraded simultaneously by the rolling upgrade in one - // batch. As this is a maximum, unhealthy instances in previous or future batches - // can cause the percentage of instances in a batch to decrease to ensure higher reliability. The default value for this parameter - // is 20%. - MaxBatchInstancePercent *int32 `json:"maxBatchInstancePercent,omitempty"` - - // The maximum percentage of the total virtual machine instances in the scale set that can be simultaneously unhealthy, either - // as a result of being upgraded, or by being found in an unhealthy state by - // the virtual machine health checks before the rolling upgrade aborts. This constraint will be checked prior to starting - // any batch. The default value for this parameter is 20%. - MaxUnhealthyInstancePercent *int32 `json:"maxUnhealthyInstancePercent,omitempty"` - - // The maximum percentage of upgraded virtual machine instances that can be found to be in an unhealthy state. This check - // will happen after each batch is upgraded. If this percentage is ever exceeded, - // the rolling update aborts. The default value for this parameter is 20%. - MaxUnhealthyUpgradedInstancePercent *int32 `json:"maxUnhealthyUpgradedInstancePercent,omitempty"` - - // The wait time between completing the update for all virtual machines in one batch and starting the next batch. The time - // duration should be specified in ISO 8601 format. The default value is 0 seconds - // (PT0S). - PauseTimeBetweenBatches *string `json:"pauseTimeBetweenBatches,omitempty"` - - // Upgrade all unhealthy instances in a scale set before any healthy instances. - PrioritizeUnhealthyInstances *bool `json:"prioritizeUnhealthyInstances,omitempty"` -} - -// RollingUpgradeProgressInfo - Information about the number of virtual machine instances in each upgrade state. -type RollingUpgradeProgressInfo struct { - // READ-ONLY; The number of instances that have failed to be upgraded successfully. - FailedInstanceCount *int32 `json:"failedInstanceCount,omitempty" azure:"ro"` - - // READ-ONLY; The number of instances that are currently being upgraded. - InProgressInstanceCount *int32 `json:"inProgressInstanceCount,omitempty" azure:"ro"` - - // READ-ONLY; The number of instances that have not yet begun to be upgraded. - PendingInstanceCount *int32 `json:"pendingInstanceCount,omitempty" azure:"ro"` - - // READ-ONLY; The number of instances that have been successfully upgraded. - SuccessfulInstanceCount *int32 `json:"successfulInstanceCount,omitempty" azure:"ro"` -} - -// RollingUpgradeRunningStatus - Information about the current running state of the overall upgrade. -type RollingUpgradeRunningStatus struct { - // READ-ONLY; Code indicating the current status of the upgrade. - Code *RollingUpgradeStatusCode `json:"code,omitempty" azure:"ro"` - - // READ-ONLY; The last action performed on the rolling upgrade. - LastAction *RollingUpgradeActionType `json:"lastAction,omitempty" azure:"ro"` - - // READ-ONLY; Last action time of the upgrade. - LastActionTime *time.Time `json:"lastActionTime,omitempty" azure:"ro"` - - // READ-ONLY; Start time of the upgrade. - StartTime *time.Time `json:"startTime,omitempty" azure:"ro"` -} - -// RollingUpgradeStatusInfo - The status of the latest virtual machine scale set rolling upgrade. -type RollingUpgradeStatusInfo struct { - // REQUIRED; Resource location - Location *string `json:"location,omitempty"` - - // The status of the latest virtual machine scale set rolling upgrade. - Properties *RollingUpgradeStatusInfoProperties `json:"properties,omitempty"` - - // Resource tags - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; Resource Id - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; Resource name - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type - Type *string `json:"type,omitempty" azure:"ro"` -} - -// RollingUpgradeStatusInfoProperties - The status of the latest virtual machine scale set rolling upgrade. -type RollingUpgradeStatusInfoProperties struct { - // READ-ONLY; Error details for this upgrade, if there are any. - Error *APIError `json:"error,omitempty" azure:"ro"` - - // READ-ONLY; The rolling upgrade policies applied for this upgrade. - Policy *RollingUpgradePolicy `json:"policy,omitempty" azure:"ro"` - - // READ-ONLY; Information about the number of virtual machine instances in each upgrade state. - Progress *RollingUpgradeProgressInfo `json:"progress,omitempty" azure:"ro"` - - // READ-ONLY; Information about the current running state of the overall upgrade. - RunningStatus *RollingUpgradeRunningStatus `json:"runningStatus,omitempty" azure:"ro"` -} - -// RunCommandDocument - Describes the properties of a Run Command. -type RunCommandDocument struct { - // REQUIRED; The VM run command description. - Description *string `json:"description,omitempty"` - - // REQUIRED; The VM run command id. - ID *string `json:"id,omitempty"` - - // REQUIRED; The VM run command label. - Label *string `json:"label,omitempty"` - - // REQUIRED; The Operating System type. - OSType *OperatingSystemTypes `json:"osType,omitempty"` - - // REQUIRED; The VM run command schema. - Schema *string `json:"$schema,omitempty"` - - // REQUIRED; The script to be executed. - Script []*string `json:"script,omitempty"` - - // The parameters used by the script. - Parameters []*RunCommandParameterDefinition `json:"parameters,omitempty"` -} - -// RunCommandDocumentBase - Describes the properties of a Run Command metadata. -type RunCommandDocumentBase struct { - // REQUIRED; The VM run command description. - Description *string `json:"description,omitempty"` - - // REQUIRED; The VM run command id. - ID *string `json:"id,omitempty"` - - // REQUIRED; The VM run command label. - Label *string `json:"label,omitempty"` - - // REQUIRED; The Operating System type. - OSType *OperatingSystemTypes `json:"osType,omitempty"` - - // REQUIRED; The VM run command schema. - Schema *string `json:"$schema,omitempty"` -} - -// RunCommandInput - Capture Virtual Machine parameters. -type RunCommandInput struct { - // REQUIRED; The run command id. - CommandID *string `json:"commandId,omitempty"` - - // The run command parameters. - Parameters []*RunCommandInputParameter `json:"parameters,omitempty"` - - // Optional. The script to be executed. When this value is given, the given script will override the default script of the - // command. - Script []*string `json:"script,omitempty"` -} - -// RunCommandInputParameter - Describes the properties of a run command parameter. -type RunCommandInputParameter struct { - // REQUIRED; The run command parameter name. - Name *string `json:"name,omitempty"` - - // REQUIRED; The run command parameter value. - Value *string `json:"value,omitempty"` -} - -// RunCommandListResult - The List Virtual Machine operation response. -type RunCommandListResult struct { - // REQUIRED; The list of virtual machine run commands. - Value []*RunCommandDocumentBase `json:"value,omitempty"` - - // The uri to fetch the next page of run commands. Call ListNext() with this to fetch the next page of run commands. - NextLink *string `json:"nextLink,omitempty"` -} - -// RunCommandParameterDefinition - Describes the properties of a run command parameter. -type RunCommandParameterDefinition struct { - // REQUIRED; The run command parameter name. - Name *string `json:"name,omitempty"` - - // REQUIRED; The run command parameter type. - Type *string `json:"type,omitempty"` - - // The run command parameter default value. - DefaultValue *string `json:"defaultValue,omitempty"` - - // The run command parameter required. - Required *bool `json:"required,omitempty"` -} - -type RunCommandResult struct { - // Run command operation response. - Value []*InstanceViewStatus `json:"value,omitempty"` -} - -// SKU - Describes a virtual machine scale set sku. NOTE: If the new VM SKU is not supported on the hardware the scale set -// is currently on, you need to deallocate the VMs in the scale set before you modify the -// SKU name. -type SKU struct { - // Specifies the number of virtual machines in the scale set. - Capacity *int64 `json:"capacity,omitempty"` - - // The sku name. - Name *string `json:"name,omitempty"` - - // Specifies the tier of virtual machines in a scale set. - // Possible Values: - // Standard - // Basic - Tier *string `json:"tier,omitempty"` -} - -// SSHConfiguration - SSH configuration for Linux based VMs running on Azure -type SSHConfiguration struct { - // The list of SSH public keys used to authenticate with linux based VMs. - 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. -type SSHPublicKey struct { - // SSH public key certificate used to authenticate with the VM through ssh. The key needs to be at least 2048-bit and in ssh-rsa - // format. - // For creating ssh keys, see [Create SSH keys on Linux and Mac for Linux VMs in Azure]https://docs.microsoft.com/azure/virtual-machines/linux/create-ssh-keys-detailed). - KeyData *string `json:"keyData,omitempty"` - - // 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"` -} - -// SSHPublicKeyGenerateKeyPairResult - Response from generation of an SSH key pair. -type SSHPublicKeyGenerateKeyPairResult struct { - // REQUIRED; The ARM resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{SshPublicKeyName} - ID *string `json:"id,omitempty"` - - // REQUIRED; Private key portion of the key pair used to authenticate to a virtual machine through ssh. The private key is - // returned in RFC3447 format and should be treated as a secret. - PrivateKey *string `json:"privateKey,omitempty"` - - // REQUIRED; Public key portion of the key pair used to authenticate to a virtual machine through ssh. The public key is in - // ssh-rsa format. - PublicKey *string `json:"publicKey,omitempty"` -} - -// SSHPublicKeyResource - Specifies information about the SSH public key. -type SSHPublicKeyResource struct { - // REQUIRED; Resource location - Location *string `json:"location,omitempty"` - - // Properties of the SSH public key. - Properties *SSHPublicKeyResourceProperties `json:"properties,omitempty"` - - // Resource tags - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; Resource Id - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; Resource name - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type - Type *string `json:"type,omitempty" azure:"ro"` -} - -// SSHPublicKeyResourceProperties - Properties of the SSH public key. -type SSHPublicKeyResourceProperties struct { - // SSH public key used to authenticate to a virtual machine through ssh. If this property is not initially provided when the - // resource is created, the publicKey property will be populated when - // generateKeyPair is called. If the public key is provided upon resource creation, the provided public key needs to be at - // least 2048-bit and in ssh-rsa format. - PublicKey *string `json:"publicKey,omitempty"` -} - -// SSHPublicKeyUpdateResource - Specifies information about the SSH public key. -type SSHPublicKeyUpdateResource struct { - // Properties of the SSH public key. - Properties *SSHPublicKeyResourceProperties `json:"properties,omitempty"` - - // Resource tags - Tags map[string]*string `json:"tags,omitempty"` -} - -// SSHPublicKeysClientCreateOptions contains the optional parameters for the SSHPublicKeysClient.Create method. -type SSHPublicKeysClientCreateOptions struct { - // placeholder for future optional parameters -} - -// SSHPublicKeysClientDeleteOptions contains the optional parameters for the SSHPublicKeysClient.Delete method. -type SSHPublicKeysClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// SSHPublicKeysClientGenerateKeyPairOptions contains the optional parameters for the SSHPublicKeysClient.GenerateKeyPair -// method. -type SSHPublicKeysClientGenerateKeyPairOptions struct { - // placeholder for future optional parameters -} - -// SSHPublicKeysClientGetOptions contains the optional parameters for the SSHPublicKeysClient.Get method. -type SSHPublicKeysClientGetOptions struct { - // placeholder for future optional parameters -} - -// SSHPublicKeysClientListByResourceGroupOptions contains the optional parameters for the SSHPublicKeysClient.ListByResourceGroup -// method. -type SSHPublicKeysClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// SSHPublicKeysClientListBySubscriptionOptions contains the optional parameters for the SSHPublicKeysClient.ListBySubscription -// method. -type SSHPublicKeysClientListBySubscriptionOptions struct { - // placeholder for future optional parameters -} - -// SSHPublicKeysClientUpdateOptions contains the optional parameters for the SSHPublicKeysClient.Update method. -type SSHPublicKeysClientUpdateOptions struct { - // placeholder for future optional parameters -} - -// SSHPublicKeysGroupListResult - The list SSH public keys operation response. -type SSHPublicKeysGroupListResult struct { - // REQUIRED; The list of SSH public keys - Value []*SSHPublicKeyResource `json:"value,omitempty"` - - // The URI to fetch the next page of SSH public keys. Call ListNext() with this URI to fetch the next page of SSH public keys. - NextLink *string `json:"nextLink,omitempty"` -} - -// ScaleInPolicy - Describes a scale-in policy for a virtual machine scale set. -type ScaleInPolicy struct { - // This property allows you to specify if virtual machines chosen for removal have to be force deleted when a virtual machine - // scale set is being scaled-in.(Feature in Preview) - ForceDeletion *bool `json:"forceDeletion,omitempty"` - - // The rules to be followed when scaling-in a virtual machine scale set. - // Possible values are: - // Default When a virtual machine scale set is scaled in, the scale set will first be balanced across zones if it is a zonal - // scale set. Then, it will be balanced across Fault Domains as far as possible. - // Within each Fault Domain, the virtual machines chosen for removal will be the newest ones that are not protected from scale-in. - // OldestVM When a virtual machine scale set is being scaled-in, the oldest virtual machines that are not protected from scale-in - // will be chosen for removal. For zonal virtual machine scale sets, the - // scale set will first be balanced across zones. Within each zone, the oldest virtual machines that are not protected will - // be chosen for removal. - // NewestVM When a virtual machine scale set is being scaled-in, the newest virtual machines that are not protected from scale-in - // will be chosen for removal. For zonal virtual machine scale sets, the - // scale set will first be balanced across zones. Within each zone, the newest virtual machines that are not protected will - // be chosen for removal. - Rules []*VirtualMachineScaleSetScaleInRules `json:"rules,omitempty"` -} - -type ScheduledEventsProfile struct { - // Specifies Terminate Scheduled Event related configurations. - TerminateNotificationProfile *TerminateNotificationProfile `json:"terminateNotificationProfile,omitempty"` -} - -// SecurityProfile - Specifies the Security profile settings for the virtual machine or virtual machine scale set. -type SecurityProfile struct { - // This property can be used by user in the request to enable or disable the Host Encryption for the virtual machine or virtual - // machine scale set. This will enable the encryption for all the disks - // including Resource/Temp disk at host itself. - // Default: The Encryption at host will be disabled unless this property is set to true for the resource. - EncryptionAtHost *bool `json:"encryptionAtHost,omitempty"` - - // Specifies the SecurityType of the virtual machine. It has to be set to any specified value to enable UefiSettings. - // Default: UefiSettings will not be enabled unless this property is set. - SecurityType *SecurityTypes `json:"securityType,omitempty"` - - // Specifies the security settings like secure boot and vTPM used while creating the virtual machine. - // Minimum api-version: 2020-12-01 - UefiSettings *UefiSettings `json:"uefiSettings,omitempty"` -} - -type ShareInfoElement struct { - // READ-ONLY; A relative URI containing the ID of the VM that has the disk attached. - VMURI *string `json:"vmUri,omitempty" azure:"ro"` -} - -// SharedGalleriesClientGetOptions contains the optional parameters for the SharedGalleriesClient.Get method. -type SharedGalleriesClientGetOptions struct { - // placeholder for future optional parameters -} - -// SharedGalleriesClientListOptions contains the optional parameters for the SharedGalleriesClient.List method. -type SharedGalleriesClientListOptions struct { - // The query parameter to decide what shared galleries to fetch when doing listing operations. - SharedTo *SharedToValues -} - -// SharedGallery - Specifies information about the Shared Gallery that you want to create or update. -type SharedGallery struct { - // The identifier information of shared gallery. - Identifier *SharedGalleryIdentifier `json:"identifier,omitempty"` - - // READ-ONLY; Resource location - Location *string `json:"location,omitempty" azure:"ro"` - - // READ-ONLY; Resource name - Name *string `json:"name,omitempty" azure:"ro"` -} - -// SharedGalleryIdentifier - The identifier information of shared gallery. -type SharedGalleryIdentifier struct { - // The unique id of this shared gallery. - UniqueID *string `json:"uniqueId,omitempty"` -} - -// SharedGalleryImage - Specifies information about the gallery image definition that you want to create or update. -type SharedGalleryImage struct { - // The identifier information of shared gallery. - Identifier *SharedGalleryIdentifier `json:"identifier,omitempty"` - - // Describes the properties of a gallery image definition. - Properties *SharedGalleryImageProperties `json:"properties,omitempty"` - - // READ-ONLY; Resource location - Location *string `json:"location,omitempty" azure:"ro"` - - // READ-ONLY; Resource name - Name *string `json:"name,omitempty" azure:"ro"` -} - -// SharedGalleryImageList - The List Shared Gallery Images operation response. -type SharedGalleryImageList struct { - // REQUIRED; A list of shared gallery images. - Value []*SharedGalleryImage `json:"value,omitempty"` - - // The uri to fetch the next page of shared gallery images. Call ListNext() with this to fetch the next page of shared gallery - // images. - NextLink *string `json:"nextLink,omitempty"` -} - -// SharedGalleryImageProperties - Describes the properties of a gallery image definition. -type SharedGalleryImageProperties struct { - // REQUIRED; This is the gallery image definition identifier. - Identifier *GalleryImageIdentifier `json:"identifier,omitempty"` - - // REQUIRED; This property allows the user to specify whether the virtual machines created under this image are 'Generalized' - // or 'Specialized'. - OSState *OperatingSystemStateTypes `json:"osState,omitempty"` - - // REQUIRED; This property allows you to specify the type of the OS that is included in the disk when creating a VM from a - // managed image. - // Possible values are: - // Windows - // Linux - OSType *OperatingSystemTypes `json:"osType,omitempty"` - - // Describes the disallowed disk types. - Disallowed *Disallowed `json:"disallowed,omitempty"` - - // The end of life date of the gallery image definition. This property can be used for decommissioning purposes. This property - // is updatable. - EndOfLifeDate *time.Time `json:"endOfLifeDate,omitempty"` - - // A list of gallery image features. - Features []*GalleryImageFeature `json:"features,omitempty"` - - // The hypervisor generation of the Virtual Machine. Applicable to OS disks only. - HyperVGeneration *HyperVGeneration `json:"hyperVGeneration,omitempty"` - - // Describes the gallery image definition purchase plan. This is used by marketplace images. - PurchasePlan *ImagePurchasePlan `json:"purchasePlan,omitempty"` - - // The properties describe the recommended machine configuration for this Image Definition. These properties are updatable. - Recommended *RecommendedMachineConfiguration `json:"recommended,omitempty"` -} - -// SharedGalleryImageVersion - Specifies information about the gallery image version that you want to create or update. -type SharedGalleryImageVersion struct { - // The identifier information of shared gallery. - Identifier *SharedGalleryIdentifier `json:"identifier,omitempty"` - - // Describes the properties of a gallery image version. - Properties *SharedGalleryImageVersionProperties `json:"properties,omitempty"` - - // READ-ONLY; Resource location - Location *string `json:"location,omitempty" azure:"ro"` - - // READ-ONLY; Resource name - Name *string `json:"name,omitempty" azure:"ro"` -} - -// SharedGalleryImageVersionList - The List Shared Gallery Image versions operation response. -type SharedGalleryImageVersionList struct { - // REQUIRED; A list of shared gallery images versions. - Value []*SharedGalleryImageVersion `json:"value,omitempty"` - - // The uri to fetch the next page of shared gallery image versions. Call ListNext() with this to fetch the next page of shared - // gallery image versions. - NextLink *string `json:"nextLink,omitempty"` -} - -// SharedGalleryImageVersionProperties - Describes the properties of a gallery image version. -type SharedGalleryImageVersionProperties struct { - // The end of life date of the gallery image version Definition. This property can be used for decommissioning purposes. This - // property is updatable. - EndOfLifeDate *time.Time `json:"endOfLifeDate,omitempty"` - - // The published date of the gallery image version Definition. This property can be used for decommissioning purposes. This - // property is updatable. - PublishedDate *time.Time `json:"publishedDate,omitempty"` -} - -// SharedGalleryImageVersionsClientGetOptions contains the optional parameters for the SharedGalleryImageVersionsClient.Get -// method. -type SharedGalleryImageVersionsClientGetOptions struct { - // placeholder for future optional parameters -} - -// SharedGalleryImageVersionsClientListOptions contains the optional parameters for the SharedGalleryImageVersionsClient.List -// method. -type SharedGalleryImageVersionsClientListOptions struct { - // The query parameter to decide what shared galleries to fetch when doing listing operations. - SharedTo *SharedToValues -} - -// SharedGalleryImagesClientGetOptions contains the optional parameters for the SharedGalleryImagesClient.Get method. -type SharedGalleryImagesClientGetOptions struct { - // placeholder for future optional parameters -} - -// SharedGalleryImagesClientListOptions contains the optional parameters for the SharedGalleryImagesClient.List method. -type SharedGalleryImagesClientListOptions struct { - // The query parameter to decide what shared galleries to fetch when doing listing operations. - SharedTo *SharedToValues -} - -// SharedGalleryList - The List Shared Galleries operation response. -type SharedGalleryList struct { - // REQUIRED; A list of shared galleries. - Value []*SharedGallery `json:"value,omitempty"` - - // The uri to fetch the next page of shared galleries. Call ListNext() with this to fetch the next page of shared galleries. - NextLink *string `json:"nextLink,omitempty"` -} - -// SharingProfile - Profile for gallery sharing to subscription or tenant -type SharingProfile struct { - // Information of community gallery if current gallery is shared to community. - CommunityGalleryInfo interface{} `json:"communityGalleryInfo,omitempty"` - - // This property allows you to specify the permission of sharing gallery. - // Possible values are: - // Private - // Groups - Permissions *GallerySharingPermissionTypes `json:"permissions,omitempty"` - - // READ-ONLY; A list of sharing profile groups. - Groups []*SharingProfileGroup `json:"groups,omitempty" azure:"ro"` -} - -// SharingProfileGroup - Group of the gallery sharing profile -type SharingProfileGroup struct { - // A list of subscription/tenant ids the gallery is aimed to be shared to. - IDs []*string `json:"ids,omitempty"` - - // This property allows you to specify the type of sharing group. - // Possible values are: - // Subscriptions - // AADTenants - // Community - Type *SharingProfileGroupTypes `json:"type,omitempty"` -} - -// SharingStatus - Sharing status of current gallery. -type SharingStatus struct { - // Summary of all regional sharing status. - Summary []*RegionalSharingStatus `json:"summary,omitempty"` - - // READ-ONLY; Aggregated sharing state of current gallery. - AggregatedState *SharingState `json:"aggregatedState,omitempty" azure:"ro"` -} - -// SharingUpdate - Specifies information about the gallery sharing profile update. -type SharingUpdate struct { - // REQUIRED; This property allows you to specify the operation type of gallery sharing update. - // Possible values are: - // Add - // Remove - // Reset - OperationType *SharingUpdateOperationTypes `json:"operationType,omitempty"` - - // A list of sharing profile groups. - Groups []*SharingProfileGroup `json:"groups,omitempty"` -} - -// Snapshot resource. -type Snapshot struct { - // REQUIRED; Resource location - Location *string `json:"location,omitempty"` - - // The extended location where the snapshot will be created. Extended location cannot be changed. - ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` - - // Snapshot resource properties. - Properties *SnapshotProperties `json:"properties,omitempty"` - - // The snapshots sku name. Can be StandardLRS, PremiumLRS, or Standard_ZRS. This is an optional parameter for incremental - // snapshot and the default behavior is the SKU will be set to the same sku as the - // previous snapshot - SKU *SnapshotSKU `json:"sku,omitempty"` - - // Resource tags - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; Resource Id - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; Unused. Always Null. - ManagedBy *string `json:"managedBy,omitempty" azure:"ro"` - - // READ-ONLY; Resource name - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type - Type *string `json:"type,omitempty" azure:"ro"` -} - -// SnapshotList - The List Snapshots operation response. -type SnapshotList struct { - // REQUIRED; A list of snapshots. - Value []*Snapshot `json:"value,omitempty"` - - // The uri to fetch the next page of snapshots. Call ListNext() with this to fetch the next page of snapshots. - NextLink *string `json:"nextLink,omitempty"` -} - -// SnapshotProperties - Snapshot resource properties. -type SnapshotProperties struct { - // REQUIRED; Disk source information. CreationData information cannot be changed after the disk has been created. - CreationData *CreationData `json:"creationData,omitempty"` - - // Percentage complete for the background copy when a resource is created via the CopyStart operation. - CompletionPercent *float32 `json:"completionPercent,omitempty"` - - // Additional authentication requirements when exporting or uploading to a disk or snapshot. - DataAccessAuthMode *DataAccessAuthMode `json:"dataAccessAuthMode,omitempty"` - - // ARM id of the DiskAccess resource for using private endpoints on disks. - DiskAccessID *string `json:"diskAccessId,omitempty"` - - // If creationData.createOption is Empty, this field is mandatory and it indicates the size of the disk to create. If this - // field is present for updates or creation with other options, it indicates a - // resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size. - DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` - - // Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. - Encryption *Encryption `json:"encryption,omitempty"` - - // Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. - EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` - - // The hypervisor generation of the Virtual Machine. Applicable to OS disks only. - HyperVGeneration *HyperVGeneration `json:"hyperVGeneration,omitempty"` - - // Whether a snapshot is incremental. Incremental snapshots on the same disk occupy less space than full snapshots and can - // be diffed. - Incremental *bool `json:"incremental,omitempty"` - - // Policy for accessing the disk via network. - NetworkAccessPolicy *NetworkAccessPolicy `json:"networkAccessPolicy,omitempty"` - - // The Operating System type. - OSType *OperatingSystemTypes `json:"osType,omitempty"` - - // Policy for controlling export on the disk. - PublicNetworkAccess *PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` - - // Purchase plan information for the image from which the source disk for the snapshot was originally created. - PurchasePlan *DiskPurchasePlan `json:"purchasePlan,omitempty"` - - // Contains the security related information for the resource. - SecurityProfile *DiskSecurityProfile `json:"securityProfile,omitempty"` - - // List of supported capabilities for the image from which the source disk from the snapshot was originally created. - SupportedCapabilities *SupportedCapabilities `json:"supportedCapabilities,omitempty"` - - // Indicates the OS on a snapshot supports hibernation. - SupportsHibernation *bool `json:"supportsHibernation,omitempty"` - - // READ-ONLY; The size of the disk in bytes. This field is read only. - DiskSizeBytes *int64 `json:"diskSizeBytes,omitempty" azure:"ro"` - - // READ-ONLY; The state of the snapshot. - DiskState *DiskState `json:"diskState,omitempty" azure:"ro"` - - // READ-ONLY; The disk provisioning state. - ProvisioningState *string `json:"provisioningState,omitempty" azure:"ro"` - - // READ-ONLY; The time when the snapshot was created. - TimeCreated *time.Time `json:"timeCreated,omitempty" azure:"ro"` - - // READ-ONLY; Unique Guid identifying the resource. - UniqueID *string `json:"uniqueId,omitempty" azure:"ro"` -} - -// SnapshotSKU - The snapshots sku name. Can be StandardLRS, PremiumLRS, or Standard_ZRS. This is an optional parameter for -// incremental snapshot and the default behavior is the SKU will be set to the same sku as the -// previous snapshot -type SnapshotSKU struct { - // The sku name. - Name *SnapshotStorageAccountTypes `json:"name,omitempty"` - - // READ-ONLY; The sku tier. - Tier *string `json:"tier,omitempty" azure:"ro"` -} - -// SnapshotUpdate - Snapshot update resource. -type SnapshotUpdate struct { - // Snapshot resource update properties. - Properties *SnapshotUpdateProperties `json:"properties,omitempty"` - - // The snapshots sku name. Can be StandardLRS, PremiumLRS, or Standard_ZRS. This is an optional parameter for incremental - // snapshot and the default behavior is the SKU will be set to the same sku as the - // previous snapshot - SKU *SnapshotSKU `json:"sku,omitempty"` - - // Resource tags - Tags map[string]*string `json:"tags,omitempty"` -} - -// SnapshotUpdateProperties - Snapshot resource update properties. -type SnapshotUpdateProperties struct { - // Additional authentication requirements when exporting or uploading to a disk or snapshot. - DataAccessAuthMode *DataAccessAuthMode `json:"dataAccessAuthMode,omitempty"` - - // ARM id of the DiskAccess resource for using private endpoints on disks. - DiskAccessID *string `json:"diskAccessId,omitempty"` - - // If creationData.createOption is Empty, this field is mandatory and it indicates the size of the disk to create. If this - // field is present for updates or creation with other options, it indicates a - // resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size. - DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` - - // Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. - Encryption *Encryption `json:"encryption,omitempty"` - - // Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. - EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` - - // Policy for accessing the disk via network. - NetworkAccessPolicy *NetworkAccessPolicy `json:"networkAccessPolicy,omitempty"` - - // the Operating System type. - OSType *OperatingSystemTypes `json:"osType,omitempty"` - - // Policy for controlling export on the disk. - PublicNetworkAccess *PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` - - // List of supported capabilities for the image from which the OS disk was created. - SupportedCapabilities *SupportedCapabilities `json:"supportedCapabilities,omitempty"` - - // Indicates the OS on a snapshot supports hibernation. - SupportsHibernation *bool `json:"supportsHibernation,omitempty"` -} - -// SnapshotsClientBeginCreateOrUpdateOptions contains the optional parameters for the SnapshotsClient.BeginCreateOrUpdate -// method. -type SnapshotsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SnapshotsClientBeginDeleteOptions contains the optional parameters for the SnapshotsClient.BeginDelete method. -type SnapshotsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SnapshotsClientBeginGrantAccessOptions contains the optional parameters for the SnapshotsClient.BeginGrantAccess method. -type SnapshotsClientBeginGrantAccessOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SnapshotsClientBeginRevokeAccessOptions contains the optional parameters for the SnapshotsClient.BeginRevokeAccess method. -type SnapshotsClientBeginRevokeAccessOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SnapshotsClientBeginUpdateOptions contains the optional parameters for the SnapshotsClient.BeginUpdate method. -type SnapshotsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SnapshotsClientGetOptions contains the optional parameters for the SnapshotsClient.Get method. -type SnapshotsClientGetOptions struct { - // placeholder for future optional parameters -} - -// SnapshotsClientListByResourceGroupOptions contains the optional parameters for the SnapshotsClient.ListByResourceGroup -// method. -type SnapshotsClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// SnapshotsClientListOptions contains the optional parameters for the SnapshotsClient.List method. -type SnapshotsClientListOptions struct { - // placeholder for future optional parameters -} - -// SoftDeletePolicy - Contains information about the soft deletion policy of the gallery. -type SoftDeletePolicy struct { - // Enables soft-deletion for resources in this gallery, allowing them to be recovered within retention time. - IsSoftDeleteEnabled *bool `json:"isSoftDeleteEnabled,omitempty"` -} - -// SourceVault - The vault id is an Azure Resource Manager Resource id in the form /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName} -type SourceVault struct { - // Resource Id - ID *string `json:"id,omitempty"` -} - -// SpotRestorePolicy - Specifies the Spot-Try-Restore properties for the virtual machine scale set. -// With this property customer can enable or disable automatic restore of the evicted Spot VMSS VM instances opportunistically -// based on capacity availability and pricing constraint. -type SpotRestorePolicy struct { - // Enables the Spot-Try-Restore feature where evicted VMSS SPOT instances will be tried to be restored opportunistically based - // on capacity availability and pricing constraints - Enabled *bool `json:"enabled,omitempty"` - - // Timeout value expressed as an ISO 8601 time duration after which the platform will not try to restore the VMSS SPOT instances - RestoreTimeout *string `json:"restoreTimeout,omitempty"` -} - -type StatusCodeCount struct { - // READ-ONLY; The instance view status code - Code *string `json:"code,omitempty" azure:"ro"` - - // READ-ONLY; Number of instances having this status code - Count *int32 `json:"count,omitempty" azure:"ro"` -} - -// StorageProfile - Specifies the storage settings for the virtual machine disks. -type StorageProfile struct { - // Specifies the parameters that are used to add a data disk to a virtual machine. - // For more information about disks, see About disks and VHDs for Azure virtual machines [https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview]. - DataDisks []*DataDisk `json:"dataDisks,omitempty"` - - // Specifies information about the image to use. You can specify information about platform images, 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. - ImageReference *ImageReference `json:"imageReference,omitempty"` - - // 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/managed-disks-overview]. - OSDisk *OSDisk `json:"osDisk,omitempty"` -} - -type SubResource struct { - // Resource Id - ID *string `json:"id,omitempty"` -} - -type SubResourceReadOnly struct { - // READ-ONLY; Resource Id - ID *string `json:"id,omitempty" azure:"ro"` -} - -type SubResourceWithColocationStatus struct { - // Describes colocation status of a resource in the Proximity Placement Group. - ColocationStatus *InstanceViewStatus `json:"colocationStatus,omitempty"` - - // Resource Id - ID *string `json:"id,omitempty"` -} - -// SupportedCapabilities - List of supported capabilities persisted on the disk resource for VM use. -type SupportedCapabilities struct { - // True if the image from which the OS disk is created supports accelerated networking. - AcceleratedNetwork *bool `json:"acceleratedNetwork,omitempty"` - - // CPU architecture supported by an OS disk. - Architecture *Architecture `json:"architecture,omitempty"` -} - -// TargetRegion - Describes the target region information. -type TargetRegion struct { - // REQUIRED; The name of the region. - Name *string `json:"name,omitempty"` - - // Optional. Allows users to provide customer managed keys for encrypting the OS and data disks in the gallery artifact. - Encryption *EncryptionImages `json:"encryption,omitempty"` - - // The number of replicas of the Image Version to be created per region. This property is updatable. - RegionalReplicaCount *int32 `json:"regionalReplicaCount,omitempty"` - - // Specifies the storage account type to be used to store the image. This property is not updatable. - StorageAccountType *StorageAccountType `json:"storageAccountType,omitempty"` -} - -type TerminateNotificationProfile struct { - // Specifies whether the Terminate Scheduled event is enabled or disabled. - Enable *bool `json:"enable,omitempty"` - - // Configurable length of time a Virtual Machine being deleted will have to potentially approve the Terminate Scheduled Event - // before the event is auto approved (timed out). The configuration must be - // specified in ISO 8601 format, the default value is 5 minutes (PT5M) - NotBeforeTimeout *string `json:"notBeforeTimeout,omitempty"` -} - -// ThrottledRequestsInput - Api request input for LogAnalytics getThrottledRequests Api. -type ThrottledRequestsInput struct { - // REQUIRED; SAS Uri of the logging blob container to which LogAnalytics Api writes output logs to. - BlobContainerSasURI *string `json:"blobContainerSasUri,omitempty"` - - // REQUIRED; From time of the query - FromTime *time.Time `json:"fromTime,omitempty"` - - // REQUIRED; To time of the query - ToTime *time.Time `json:"toTime,omitempty"` - - // Group query result by Client Application ID. - GroupByClientApplicationID *bool `json:"groupByClientApplicationId,omitempty"` - - // Group query result by Operation Name. - GroupByOperationName *bool `json:"groupByOperationName,omitempty"` - - // Group query result by Resource Name. - GroupByResourceName *bool `json:"groupByResourceName,omitempty"` - - // Group query result by Throttle Policy applied. - GroupByThrottlePolicy *bool `json:"groupByThrottlePolicy,omitempty"` - - // Group query result by User Agent. - GroupByUserAgent *bool `json:"groupByUserAgent,omitempty"` -} - -// UefiSettings - Specifies the security settings like secure boot and vTPM used while creating the virtual machine. -// Minimum api-version: 2020-12-01 -type UefiSettings struct { - // Specifies whether secure boot should be enabled on the virtual machine. - // Minimum api-version: 2020-12-01 - SecureBootEnabled *bool `json:"secureBootEnabled,omitempty"` - - // Specifies whether vTPM should be enabled on the virtual machine. - // Minimum api-version: 2020-12-01 - VTpmEnabled *bool `json:"vTpmEnabled,omitempty"` -} - -// UpdateDomain - Defines an update domain for the cloud service. -type UpdateDomain struct { - // READ-ONLY; Resource Id - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; Resource Name - Name *string `json:"name,omitempty" azure:"ro"` -} - -type UpdateDomainListResult struct { - // REQUIRED - Value []*UpdateDomain `json:"value,omitempty"` - NextLink *string `json:"nextLink,omitempty"` -} - -// UpdateResource - The Update Resource model definition. -type UpdateResource struct { - // Resource tags - Tags map[string]*string `json:"tags,omitempty"` -} - -// UpdateResourceDefinition - The Update Resource model definition. -type UpdateResourceDefinition struct { - // Resource tags - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; Resource Id - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; Resource name - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type - Type *string `json:"type,omitempty" azure:"ro"` -} - -// UpgradeOperationHistoricalStatusInfo - Virtual Machine Scale Set OS Upgrade History operation response. -type UpgradeOperationHistoricalStatusInfo struct { - // READ-ONLY; Resource location - Location *string `json:"location,omitempty" azure:"ro"` - - // READ-ONLY; Information about the properties of the upgrade operation. - Properties *UpgradeOperationHistoricalStatusInfoProperties `json:"properties,omitempty" azure:"ro"` - - // READ-ONLY; Resource type - Type *string `json:"type,omitempty" azure:"ro"` -} - -// UpgradeOperationHistoricalStatusInfoProperties - Describes each OS upgrade on the Virtual Machine Scale Set. -type UpgradeOperationHistoricalStatusInfoProperties struct { - // READ-ONLY; Error Details for this upgrade if there are any. - Error *APIError `json:"error,omitempty" azure:"ro"` - - // READ-ONLY; Counts of the VMs in each state. - Progress *RollingUpgradeProgressInfo `json:"progress,omitempty" azure:"ro"` - - // READ-ONLY; Information about OS rollback if performed - RollbackInfo *RollbackStatusInfo `json:"rollbackInfo,omitempty" azure:"ro"` - - // READ-ONLY; Information about the overall status of the upgrade operation. - RunningStatus *UpgradeOperationHistoryStatus `json:"runningStatus,omitempty" azure:"ro"` - - // READ-ONLY; Invoker of the Upgrade Operation - StartedBy *UpgradeOperationInvoker `json:"startedBy,omitempty" azure:"ro"` - - // READ-ONLY; Image Reference details - TargetImageReference *ImageReference `json:"targetImageReference,omitempty" azure:"ro"` -} - -// UpgradeOperationHistoryStatus - Information about the current running state of the overall upgrade. -type UpgradeOperationHistoryStatus struct { - // READ-ONLY; Code indicating the current status of the upgrade. - Code *UpgradeState `json:"code,omitempty" azure:"ro"` - - // READ-ONLY; End time of the upgrade. - EndTime *time.Time `json:"endTime,omitempty" azure:"ro"` - - // READ-ONLY; Start time of the upgrade. - StartTime *time.Time `json:"startTime,omitempty" azure:"ro"` -} - -// UpgradePolicy - Describes an upgrade policy - automatic, manual, or rolling. -type UpgradePolicy struct { - // Configuration parameters used for performing automatic OS Upgrade. - AutomaticOSUpgradePolicy *AutomaticOSUpgradePolicy `json:"automaticOSUpgradePolicy,omitempty"` - - // Specifies the mode of an upgrade to virtual machines in the scale set. - // Possible values are: - // Manual - You control the application of updates to virtual machines in the scale set. You do this by using the manualUpgrade - // action. - // Automatic - All virtual machines in the scale set are automatically updated at the same time. - Mode *UpgradeMode `json:"mode,omitempty"` - - // The configuration parameters used while performing a rolling upgrade. - RollingUpgradePolicy *RollingUpgradePolicy `json:"rollingUpgradePolicy,omitempty"` -} - -// Usage - Describes Compute Resource Usage. -type Usage struct { - // REQUIRED; The current usage of the resource. - CurrentValue *int32 `json:"currentValue,omitempty"` - - // REQUIRED; The maximum permitted usage of the resource. - Limit *int64 `json:"limit,omitempty"` - - // REQUIRED; The name of the type of usage. - Name *UsageName `json:"name,omitempty"` - - // REQUIRED; An enum describing the unit of usage measurement. - Unit *string `json:"unit,omitempty"` -} - -// UsageClientListOptions contains the optional parameters for the UsageClient.List method. -type UsageClientListOptions struct { - // placeholder for future optional parameters -} - -// UsageName - The Usage Names. -type UsageName struct { - // The localized name of the resource. - LocalizedValue *string `json:"localizedValue,omitempty"` - - // The name of the resource. - Value *string `json:"value,omitempty"` -} - -type UserArtifactManage struct { - // REQUIRED; Required. The path and arguments to install the gallery application. This is limited to 4096 characters. - Install *string `json:"install,omitempty"` - - // REQUIRED; Required. The path and arguments to remove the gallery application. This is limited to 4096 characters. - Remove *string `json:"remove,omitempty"` - - // Optional. The path and arguments to update the gallery application. If not present, then update operation will invoke remove - // command on the previous version and install command on the current version - // of the gallery application. This is limited to 4096 characters. - Update *string `json:"update,omitempty"` -} - -// UserArtifactSource - The source image from which the Image Version is going to be created. -type UserArtifactSource struct { - // REQUIRED; Required. The mediaLink of the artifact, must be a readable storage page blob. - MediaLink *string `json:"mediaLink,omitempty"` - - // Optional. The defaultConfigurationLink of the artifact, must be a readable storage page blob. - DefaultConfigurationLink *string `json:"defaultConfigurationLink,omitempty"` -} - -type UserAssignedIdentitiesValue struct { - // READ-ONLY; The client id of user assigned identity. - ClientID *string `json:"clientId,omitempty" azure:"ro"` - - // READ-ONLY; The principal id of user assigned identity. - PrincipalID *string `json:"principalId,omitempty" azure:"ro"` -} - -// VMDiskSecurityProfile - Specifies the security profile settings for the managed disk. -// NOTE: It can only be set for Confidential VMs -type VMDiskSecurityProfile struct { - // Specifies the customer managed disk encryption set resource id for the managed disk that is used for Customer Managed Key - // encrypted ConfidentialVM OS Disk and VMGuest blob. - DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` - - // Specifies the EncryptionType of the managed disk. - // It is set to DiskWithVMGuestState for encryption of the managed disk along with VMGuestState blob, and VMGuestStateOnly - // for encryption of just the VMGuestState blob. - // NOTE: It can be set for only Confidential VMs. - SecurityEncryptionType *SecurityEncryptionTypes `json:"securityEncryptionType,omitempty"` -} - -// VMGalleryApplication - Specifies the required information to reference a compute gallery application version -type VMGalleryApplication struct { - // REQUIRED; Specifies the GalleryApplicationVersion resource id on the form of - // /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{application}/versions/{version} - PackageReferenceID *string `json:"packageReferenceId,omitempty"` - - // Optional, Specifies the uri to an azure blob that will replace the default configuration for the package if provided - ConfigurationReference *string `json:"configurationReference,omitempty"` - - // If set to true, when a new Gallery Application version is available in PIR/SIG, it will be automatically updated for the - // VM/VMSS - EnableAutomaticUpgrade *bool `json:"enableAutomaticUpgrade,omitempty"` - - // Optional, Specifies the order in which the packages have to be installed - Order *int32 `json:"order,omitempty"` - - // Optional, Specifies a passthrough value for more generic context. - Tags *string `json:"tags,omitempty"` - - // Optional, If true, any failure for any operation in the VmApplication will fail the deployment - TreatFailureAsDeploymentFailure *bool `json:"treatFailureAsDeploymentFailure,omitempty"` -} - -type VMScaleSetConvertToSinglePlacementGroupInput struct { - // Id of the placement group in which you want future virtual machine instances to be placed. To query placement group Id, - // please use Virtual Machine Scale Set VMs - Get API. If not provided, the - // platform will choose one with maximum number of virtual machine instances. - ActivePlacementGroupID *string `json:"activePlacementGroupId,omitempty"` -} - -// VMSizeProperties - Specifies VM Size Property settings on the virtual machine. -type VMSizeProperties struct { - // Specifies the number of vCPUs available for the VM. - // When this property is not specified in the request body the default behavior is to set it to the value of vCPUs available - // for that VM size exposed in api response of List all available virtual machine - // sizes in a region [https://docs.microsoft.com/en-us/rest/api/compute/resource-skus/list] . - VCPUsAvailable *int32 `json:"vCPUsAvailable,omitempty"` - - // Specifies the vCPU to physical core ratio. - // When this property is not specified in the request body the default behavior is set to the value of vCPUsPerCore for the - // VM Size exposed in api response of List all available virtual machine sizes in - // a region [https://docs.microsoft.com/en-us/rest/api/compute/resource-skus/list] - // Setting this property to 1 also means that hyper-threading is disabled. - VCPUsPerCore *int32 `json:"vCPUsPerCore,omitempty"` -} - -// VaultCertificate - Describes a single certificate reference in a Key Vault, and where the certificate should reside on -// the VM. -type VaultCertificate struct { - // For Windows VMs, specifies the certificate store on the Virtual Machine to which the certificate should be added. The specified - // certificate store is implicitly in the LocalMachine account. - // For Linux VMs, the certificate file is placed under the /var/lib/waagent directory, with the file name .crt - // for the X509 certificate file and .prv for private - // key. Both of these files are .pem formatted. - CertificateStore *string `json:"certificateStore,omitempty"` - - // 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":"" - // } - // To install certificates on a virtual machine it is recommended to use the Azure Key Vault virtual machine extension for - // Linux - // [https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux] or the Azure Key Vault virtual machine extension - // for Windows - // [https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows]. - CertificateURL *string `json:"certificateUrl,omitempty"` -} - -// VaultSecretGroup - Describes a set of certificates which are all in the same Key Vault. -type VaultSecretGroup struct { - // The relative URL of the Key Vault containing all of the certificates in VaultCertificates. - SourceVault *SubResource `json:"sourceVault,omitempty"` - - // The list of key vault references in SourceVault which contain certificates. - VaultCertificates []*VaultCertificate `json:"vaultCertificates,omitempty"` -} - -// VirtualHardDisk - Describes the uri of a disk. -type VirtualHardDisk struct { - // Specifies the virtual hard disk's uri. - URI *string `json:"uri,omitempty"` -} - -// VirtualMachine - Describes a Virtual Machine. -type VirtualMachine struct { - // REQUIRED; Resource location - Location *string `json:"location,omitempty"` - - // The extended location of the Virtual Machine. - ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` - - // The identity of the virtual machine, if configured. - Identity *VirtualMachineIdentity `json:"identity,omitempty"` - - // 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"` - - // Describes the properties of a Virtual Machine. - Properties *VirtualMachineProperties `json:"properties,omitempty"` - - // Resource tags - Tags map[string]*string `json:"tags,omitempty"` - - // The virtual machine zones. - Zones []*string `json:"zones,omitempty"` - - // READ-ONLY; Resource Id - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; Resource name - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; The virtual machine child extension resources. - Resources []*VirtualMachineExtension `json:"resources,omitempty" azure:"ro"` - - // READ-ONLY; Resource type - Type *string `json:"type,omitempty" azure:"ro"` -} - -// VirtualMachineAgentInstanceView - The instance view of the VM Agent running on the virtual machine. -type VirtualMachineAgentInstanceView struct { - // The virtual machine extension handler instance view. - ExtensionHandlers []*VirtualMachineExtensionHandlerInstanceView `json:"extensionHandlers,omitempty"` - - // The resource status information. - Statuses []*InstanceViewStatus `json:"statuses,omitempty"` - - // The VM Agent full version. - VMAgentVersion *string `json:"vmAgentVersion,omitempty"` -} - -// VirtualMachineAssessPatchesResult - Describes the properties of an AssessPatches result. -type VirtualMachineAssessPatchesResult struct { - // READ-ONLY; The activity ID of the operation that produced this result. It is used to correlate across CRP and extension - // logs. - AssessmentActivityID *string `json:"assessmentActivityId,omitempty" azure:"ro"` - - // READ-ONLY; The list of patches that have been detected as available for installation. - AvailablePatches []*VirtualMachineSoftwarePatchProperties `json:"availablePatches,omitempty" azure:"ro"` - - // READ-ONLY; The number of critical or security patches that have been detected as available and not yet installed. - CriticalAndSecurityPatchCount *int32 `json:"criticalAndSecurityPatchCount,omitempty" azure:"ro"` - - // READ-ONLY; The errors that were encountered during execution of the operation. The details array contains the list of them. - Error *APIError `json:"error,omitempty" azure:"ro"` - - // READ-ONLY; The number of all available patches excluding critical and security. - OtherPatchCount *int32 `json:"otherPatchCount,omitempty" azure:"ro"` - - // READ-ONLY; The overall reboot status of the VM. It will be true when partially installed patches require a reboot to complete - // installation but the reboot has not yet occurred. - RebootPending *bool `json:"rebootPending,omitempty" azure:"ro"` - - // READ-ONLY; The UTC timestamp when the operation began. - StartDateTime *time.Time `json:"startDateTime,omitempty" azure:"ro"` - - // READ-ONLY; The overall success or failure status of the operation. It remains "InProgress" until the operation completes. - // At that point it will become "Unknown", "Failed", "Succeeded", or - // "CompletedWithWarnings." - Status *PatchOperationStatus `json:"status,omitempty" azure:"ro"` -} - -// VirtualMachineCaptureParameters - Capture Virtual Machine parameters. -type VirtualMachineCaptureParameters struct { - // REQUIRED; The destination container name. - DestinationContainerName *string `json:"destinationContainerName,omitempty"` - - // REQUIRED; Specifies whether to overwrite the destination virtual hard disk, in case of conflict. - OverwriteVhds *bool `json:"overwriteVhds,omitempty"` - - // REQUIRED; The captured virtual hard disk's name prefix. - VhdPrefix *string `json:"vhdPrefix,omitempty"` -} - -// VirtualMachineCaptureResult - Output of virtual machine capture operation. -type VirtualMachineCaptureResult struct { - // Resource Id - ID *string `json:"id,omitempty"` - - // READ-ONLY; the version of the content - ContentVersion *string `json:"contentVersion,omitempty" azure:"ro"` - - // READ-ONLY; parameters of the captured virtual machine - Parameters interface{} `json:"parameters,omitempty" azure:"ro"` - - // READ-ONLY; a list of resource items of the captured virtual machine - Resources []interface{} `json:"resources,omitempty" azure:"ro"` - - // READ-ONLY; the schema of the captured virtual machine - Schema *string `json:"$schema,omitempty" azure:"ro"` -} - -// VirtualMachineExtension - Describes a Virtual Machine Extension. -type VirtualMachineExtension struct { - // Resource location - Location *string `json:"location,omitempty"` - - // Describes the properties of a Virtual Machine Extension. - Properties *VirtualMachineExtensionProperties `json:"properties,omitempty"` - - // Resource tags - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; Resource Id - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; Resource name - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type - Type *string `json:"type,omitempty" azure:"ro"` -} - -// VirtualMachineExtensionHandlerInstanceView - The instance view of a virtual machine extension handler. -type VirtualMachineExtensionHandlerInstanceView struct { - // The extension handler status. - Status *InstanceViewStatus `json:"status,omitempty"` - - // Specifies the type of the extension; an example is "CustomScriptExtension". - Type *string `json:"type,omitempty"` - - // Specifies the version of the script handler. - TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` -} - -// VirtualMachineExtensionImage - Describes a Virtual Machine Extension Image. -type VirtualMachineExtensionImage struct { - // REQUIRED; Resource location - Location *string `json:"location,omitempty"` - - // Describes the properties of a Virtual Machine Extension Image. - Properties *VirtualMachineExtensionImageProperties `json:"properties,omitempty"` - - // Resource tags - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; Resource Id - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; Resource name - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type - Type *string `json:"type,omitempty" azure:"ro"` -} - -// VirtualMachineExtensionImageProperties - Describes the properties of a Virtual Machine Extension Image. -type VirtualMachineExtensionImageProperties struct { - // REQUIRED; The type of role (IaaS or PaaS) this extension supports. - ComputeRole *string `json:"computeRole,omitempty"` - - // REQUIRED; The schema defined by publisher, where extension consumers should provide settings in a matching schema. - HandlerSchema *string `json:"handlerSchema,omitempty"` - - // REQUIRED; The operating system this extension supports. - OperatingSystem *string `json:"operatingSystem,omitempty"` - - // Whether the handler can support multiple extensions. - SupportsMultipleExtensions *bool `json:"supportsMultipleExtensions,omitempty"` - - // Whether the extension can be used on xRP VMScaleSets. By default existing extensions are usable on scalesets, but there - // might be cases where a publisher wants to explicitly indicate the extension is - // only enabled for CRP VMs but not VMSS. - VMScaleSetEnabled *bool `json:"vmScaleSetEnabled,omitempty"` -} - -// VirtualMachineExtensionImagesClientGetOptions contains the optional parameters for the VirtualMachineExtensionImagesClient.Get -// method. -type VirtualMachineExtensionImagesClientGetOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineExtensionImagesClientListTypesOptions contains the optional parameters for the VirtualMachineExtensionImagesClient.ListTypes -// method. -type VirtualMachineExtensionImagesClientListTypesOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineExtensionImagesClientListVersionsOptions contains the optional parameters for the VirtualMachineExtensionImagesClient.ListVersions -// method. -type VirtualMachineExtensionImagesClientListVersionsOptions struct { - // The filter to apply on the operation. - Filter *string - Orderby *string - Top *int32 -} - -// VirtualMachineExtensionInstanceView - The instance view of a virtual machine extension. -type VirtualMachineExtensionInstanceView struct { - // The virtual machine extension name. - Name *string `json:"name,omitempty"` - - // The resource status information. - Statuses []*InstanceViewStatus `json:"statuses,omitempty"` - - // The resource status information. - Substatuses []*InstanceViewStatus `json:"substatuses,omitempty"` - - // Specifies the type of the extension; an example is "CustomScriptExtension". - Type *string `json:"type,omitempty"` - - // Specifies the version of the script handler. - TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` -} - -// VirtualMachineExtensionProperties - Describes the properties of a Virtual Machine Extension. -type VirtualMachineExtensionProperties struct { - // 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"` - - // Indicates whether the extension should be automatically upgraded by the platform if there is a newer version of the extension - // available. - EnableAutomaticUpgrade *bool `json:"enableAutomaticUpgrade,omitempty"` - - // How the extension handler should be forced to update even if the extension configuration has not changed. - ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` - - // The virtual machine extension instance view. - InstanceView *VirtualMachineExtensionInstanceView `json:"instanceView,omitempty"` - - // The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. - ProtectedSettings interface{} `json:"protectedSettings,omitempty"` - - // The extensions protected settings that are passed by reference, and consumed from key vault - ProtectedSettingsFromKeyVault interface{} `json:"protectedSettingsFromKeyVault,omitempty"` - - // The name of the extension handler publisher. - Publisher *string `json:"publisher,omitempty"` - - // Json formatted public settings for the extension. - Settings interface{} `json:"settings,omitempty"` - - // Indicates whether failures stemming from the extension will be suppressed (Operational failures such as not connecting - // to the VM will not be suppressed regardless of this value). The default is false. - SuppressFailures *bool `json:"suppressFailures,omitempty"` - - // Specifies the type of the extension; an example is "CustomScriptExtension". - Type *string `json:"type,omitempty"` - - // Specifies the version of the script handler. - TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` - - // READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *string `json:"provisioningState,omitempty" azure:"ro"` -} - -// VirtualMachineExtensionUpdate - Describes a Virtual Machine Extension. -type VirtualMachineExtensionUpdate struct { - // Describes the properties of a Virtual Machine Extension. - Properties *VirtualMachineExtensionUpdateProperties `json:"properties,omitempty"` - - // Resource tags - Tags map[string]*string `json:"tags,omitempty"` -} - -// VirtualMachineExtensionUpdateProperties - Describes the properties of a Virtual Machine Extension. -type VirtualMachineExtensionUpdateProperties struct { - // 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"` - - // Indicates whether the extension should be automatically upgraded by the platform if there is a newer version of the extension - // available. - EnableAutomaticUpgrade *bool `json:"enableAutomaticUpgrade,omitempty"` - - // How the extension handler should be forced to update even if the extension configuration has not changed. - ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` - - // The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. - ProtectedSettings interface{} `json:"protectedSettings,omitempty"` - - // The extensions protected settings that are passed by reference, and consumed from key vault - ProtectedSettingsFromKeyVault interface{} `json:"protectedSettingsFromKeyVault,omitempty"` - - // The name of the extension handler publisher. - Publisher *string `json:"publisher,omitempty"` - - // Json formatted public settings for the extension. - Settings interface{} `json:"settings,omitempty"` - - // Indicates whether failures stemming from the extension will be suppressed (Operational failures such as not connecting - // to the VM will not be suppressed regardless of this value). The default is false. - SuppressFailures *bool `json:"suppressFailures,omitempty"` - - // Specifies the type of the extension; an example is "CustomScriptExtension". - Type *string `json:"type,omitempty"` - - // Specifies the version of the script handler. - TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` -} - -// VirtualMachineExtensionsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineExtensionsClient.BeginCreateOrUpdate -// method. -type VirtualMachineExtensionsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineExtensionsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineExtensionsClient.BeginDelete -// method. -type VirtualMachineExtensionsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineExtensionsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineExtensionsClient.BeginUpdate -// method. -type VirtualMachineExtensionsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineExtensionsClientGetOptions contains the optional parameters for the VirtualMachineExtensionsClient.Get method. -type VirtualMachineExtensionsClientGetOptions struct { - // The expand expression to apply on the operation. - Expand *string -} - -// VirtualMachineExtensionsClientListOptions contains the optional parameters for the VirtualMachineExtensionsClient.List -// method. -type VirtualMachineExtensionsClientListOptions struct { - // The expand expression to apply on the operation. - Expand *string -} - -// VirtualMachineExtensionsListResult - The List Extension operation response -type VirtualMachineExtensionsListResult struct { - // The list of extensions - Value []*VirtualMachineExtension `json:"value,omitempty"` -} - -// VirtualMachineHealthStatus - The health status of the VM. -type VirtualMachineHealthStatus struct { - // READ-ONLY; The health status information for the VM. - Status *InstanceViewStatus `json:"status,omitempty" azure:"ro"` -} - -// VirtualMachineIPTag - Contains the IP tag associated with the public IP address. -type VirtualMachineIPTag struct { - // IP tag type. Example: FirstPartyUsage. - IPTagType *string `json:"ipTagType,omitempty"` - - // IP tag associated with the public IP. Example: SQL, Storage etc. - Tag *string `json:"tag,omitempty"` -} - -// VirtualMachineIdentity - Identity for the virtual machine. -type VirtualMachineIdentity struct { - // The type of identity used for the virtual machine. The type 'SystemAssigned, UserAssigned' includes both an implicitly - // created identity and a set of user assigned identities. The type 'None' will - // remove any identities from the virtual machine. - Type *ResourceIdentityType `json:"type,omitempty"` - - // The list of user identities associated with the Virtual Machine. The user identity dictionary key references will be ARM - // resource ids in the form: - // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - UserAssignedIdentities map[string]*UserAssignedIdentitiesValue `json:"userAssignedIdentities,omitempty"` - - // READ-ONLY; The principal id of virtual machine identity. This property will only be provided for a system assigned identity. - PrincipalID *string `json:"principalId,omitempty" azure:"ro"` - - // READ-ONLY; The tenant id associated with the virtual machine. This property will only be provided for a system assigned - // identity. - TenantID *string `json:"tenantId,omitempty" azure:"ro"` -} - -// VirtualMachineImage - Describes a Virtual Machine Image. -type VirtualMachineImage struct { - // REQUIRED; The supported Azure location of the resource. - Location *string `json:"location,omitempty"` - - // REQUIRED; The name of the resource. - Name *string `json:"name,omitempty"` - - // The extended location of the Virtual Machine. - ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` - - // Resource Id - ID *string `json:"id,omitempty"` - - // Describes the properties of a Virtual Machine Image. - Properties *VirtualMachineImageProperties `json:"properties,omitempty"` - - // 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"` -} - -// VirtualMachineImageFeature - Specifies additional capabilities supported by the image -type VirtualMachineImageFeature struct { - // The name of the feature. - Name *string `json:"name,omitempty"` - - // The corresponding value for the feature. - Value *string `json:"value,omitempty"` -} - -// VirtualMachineImageProperties - Describes the properties of a Virtual Machine Image. -type VirtualMachineImageProperties struct { - // Specifies the Architecture Type - Architecture *ArchitectureTypes `json:"architecture,omitempty"` - - // Describes automatic OS upgrade properties on the image. - AutomaticOSUpgradeProperties *AutomaticOSUpgradeProperties `json:"automaticOSUpgradeProperties,omitempty"` - DataDiskImages []*DataDiskImage `json:"dataDiskImages,omitempty"` - - // Specifies disallowed configuration for the VirtualMachine created from the image - Disallowed *DisallowedConfiguration `json:"disallowed,omitempty"` - Features []*VirtualMachineImageFeature `json:"features,omitempty"` - - // Specifies the HyperVGeneration Type - HyperVGeneration *HyperVGenerationTypes `json:"hyperVGeneration,omitempty"` - - // Contains the os disk image information. - OSDiskImage *OSDiskImage `json:"osDiskImage,omitempty"` - - // Used for establishing the purchase context of any 3rd Party artifact through MarketPlace. - Plan *PurchasePlan `json:"plan,omitempty"` -} - -// VirtualMachineImageResource - Virtual machine image resource information. -type VirtualMachineImageResource struct { - // REQUIRED; The supported Azure location of the resource. - Location *string `json:"location,omitempty"` - - // REQUIRED; The name of the resource. - Name *string `json:"name,omitempty"` - - // The extended location of the Virtual Machine. - ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` - - // Resource Id - ID *string `json:"id,omitempty"` - - // 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"` -} - -// VirtualMachineImagesClientGetOptions contains the optional parameters for the VirtualMachineImagesClient.Get method. -type VirtualMachineImagesClientGetOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineImagesClientListOffersOptions contains the optional parameters for the VirtualMachineImagesClient.ListOffers -// method. -type VirtualMachineImagesClientListOffersOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineImagesClientListOptions contains the optional parameters for the VirtualMachineImagesClient.List method. -type VirtualMachineImagesClientListOptions struct { - // The expand expression to apply on the operation. - Expand *string - Orderby *string - Top *int32 -} - -// VirtualMachineImagesClientListPublishersOptions contains the optional parameters for the VirtualMachineImagesClient.ListPublishers -// method. -type VirtualMachineImagesClientListPublishersOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineImagesClientListSKUsOptions contains the optional parameters for the VirtualMachineImagesClient.ListSKUs -// method. -type VirtualMachineImagesClientListSKUsOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineImagesEdgeZoneClientGetOptions contains the optional parameters for the VirtualMachineImagesEdgeZoneClient.Get -// method. -type VirtualMachineImagesEdgeZoneClientGetOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineImagesEdgeZoneClientListOffersOptions contains the optional parameters for the VirtualMachineImagesEdgeZoneClient.ListOffers -// method. -type VirtualMachineImagesEdgeZoneClientListOffersOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineImagesEdgeZoneClientListOptions contains the optional parameters for the VirtualMachineImagesEdgeZoneClient.List -// method. -type VirtualMachineImagesEdgeZoneClientListOptions struct { - // The expand expression to apply on the operation. - Expand *string - // Specifies the order of the results returned. Formatted as an OData query. - Orderby *string - // An integer value specifying the number of images to return that matches supplied values. - Top *int32 -} - -// VirtualMachineImagesEdgeZoneClientListPublishersOptions contains the optional parameters for the VirtualMachineImagesEdgeZoneClient.ListPublishers -// method. -type VirtualMachineImagesEdgeZoneClientListPublishersOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineImagesEdgeZoneClientListSKUsOptions contains the optional parameters for the VirtualMachineImagesEdgeZoneClient.ListSKUs -// method. -type VirtualMachineImagesEdgeZoneClientListSKUsOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineInstallPatchesParameters - Input for InstallPatches as directly received by the API -type VirtualMachineInstallPatchesParameters struct { - // REQUIRED; Defines when it is acceptable to reboot a VM during a software update operation. - RebootSetting *VMGuestPatchRebootSetting `json:"rebootSetting,omitempty"` - - // Input for InstallPatches on a Linux VM, as directly received by the API - LinuxParameters *LinuxParameters `json:"linuxParameters,omitempty"` - - // Specifies the maximum amount of time that the operation will run. It must be an ISO 8601-compliant duration string such - // as PT4H (4 hours) - MaximumDuration *string `json:"maximumDuration,omitempty"` - - // Input for InstallPatches on a Windows VM, as directly received by the API - WindowsParameters *WindowsParameters `json:"windowsParameters,omitempty"` -} - -// VirtualMachineInstallPatchesResult - The result summary of an installation operation. -type VirtualMachineInstallPatchesResult struct { - // READ-ONLY; The errors that were encountered during execution of the operation. The details array contains the list of them. - Error *APIError `json:"error,omitempty" azure:"ro"` - - // READ-ONLY; The number of patches that were not installed due to the user blocking their installation. - ExcludedPatchCount *int32 `json:"excludedPatchCount,omitempty" azure:"ro"` - - // READ-ONLY; The number of patches that could not be installed due to some issue. See errors for details. - FailedPatchCount *int32 `json:"failedPatchCount,omitempty" azure:"ro"` - - // READ-ONLY; The activity ID of the operation that produced this result. It is used to correlate across CRP and extension - // logs. - InstallationActivityID *string `json:"installationActivityId,omitempty" azure:"ro"` - - // READ-ONLY; The number of patches successfully installed. - InstalledPatchCount *int32 `json:"installedPatchCount,omitempty" azure:"ro"` - - // READ-ONLY; Whether the operation ran out of time before it completed all its intended actions. - MaintenanceWindowExceeded *bool `json:"maintenanceWindowExceeded,omitempty" azure:"ro"` - - // READ-ONLY; The number of patches that were detected as available for install, but did not meet the operation's criteria. - NotSelectedPatchCount *int32 `json:"notSelectedPatchCount,omitempty" azure:"ro"` - - // READ-ONLY; The patches that were installed during the operation. - Patches []*PatchInstallationDetail `json:"patches,omitempty" azure:"ro"` - - // READ-ONLY; The number of patches that were identified as meeting the installation criteria, but were not able to be installed. - // Typically this happens when maintenanceWindowExceeded == true. - PendingPatchCount *int32 `json:"pendingPatchCount,omitempty" azure:"ro"` - - // READ-ONLY; The reboot state of the VM following completion of the operation. - RebootStatus *VMGuestPatchRebootStatus `json:"rebootStatus,omitempty" azure:"ro"` - - // READ-ONLY; The UTC timestamp when the operation began. - StartDateTime *time.Time `json:"startDateTime,omitempty" azure:"ro"` - - // READ-ONLY; The overall success or failure status of the operation. It remains "InProgress" until the operation completes. - // At that point it will become "Failed", "Succeeded", "Unknown" or "CompletedWithWarnings." - Status *PatchOperationStatus `json:"status,omitempty" azure:"ro"` -} - -// VirtualMachineInstanceView - The instance view of a virtual machine. -type VirtualMachineInstanceView struct { - // Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to diagnose VM status. - // You can easily view the output of your console log. - // Azure also enables you to see a screenshot of the VM from the hypervisor. - BootDiagnostics *BootDiagnosticsInstanceView `json:"bootDiagnostics,omitempty"` - - // The computer name assigned to the virtual machine. - ComputerName *string `json:"computerName,omitempty"` - - // The virtual machine disk information. - Disks []*DiskInstanceView `json:"disks,omitempty"` - - // The extensions information. - Extensions []*VirtualMachineExtensionInstanceView `json:"extensions,omitempty"` - - // Specifies the HyperVGeneration Type associated with a resource - HyperVGeneration *HyperVGenerationType `json:"hyperVGeneration,omitempty"` - - // The Maintenance Operation status on the virtual machine. - MaintenanceRedeployStatus *MaintenanceRedeployStatus `json:"maintenanceRedeployStatus,omitempty"` - - // The Operating System running on the virtual machine. - OSName *string `json:"osName,omitempty"` - - // The version of Operating System running on the virtual machine. - OSVersion *string `json:"osVersion,omitempty"` - - // [Preview Feature] The status of virtual machine patch operations. - PatchStatus *VirtualMachinePatchStatus `json:"patchStatus,omitempty"` - - // Specifies the fault domain of the virtual machine. - PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"` - - // Specifies the update domain of the virtual machine. - PlatformUpdateDomain *int32 `json:"platformUpdateDomain,omitempty"` - - // The Remote desktop certificate thumbprint. - RdpThumbPrint *string `json:"rdpThumbPrint,omitempty"` - - // The resource status information. - Statuses []*InstanceViewStatus `json:"statuses,omitempty"` - - // The VM Agent running on the virtual machine. - VMAgent *VirtualMachineAgentInstanceView `json:"vmAgent,omitempty"` - - // READ-ONLY; Resource id of the dedicated host, on which the virtual machine is allocated through automatic placement, when - // the virtual machine is associated with a dedicated host group that has automatic - // placement enabled. - // Minimum api-version: 2020-06-01. - AssignedHost *string `json:"assignedHost,omitempty" azure:"ro"` - - // READ-ONLY; The health status for the VM. - VMHealth *VirtualMachineHealthStatus `json:"vmHealth,omitempty" azure:"ro"` -} - -// VirtualMachineListResult - The List Virtual Machine operation response. -type VirtualMachineListResult struct { - // REQUIRED; The list of virtual machines. - Value []*VirtualMachine `json:"value,omitempty"` - - // The URI to fetch the next page of VMs. Call ListNext() with this URI to fetch the next page of Virtual Machines. - NextLink *string `json:"nextLink,omitempty"` -} - -// VirtualMachineNetworkInterfaceConfiguration - Describes a virtual machine network interface configurations. -type VirtualMachineNetworkInterfaceConfiguration struct { - // REQUIRED; The network interface configuration name. - Name *string `json:"name,omitempty"` - - // Describes a virtual machine network profile's IP configuration. - Properties *VirtualMachineNetworkInterfaceConfigurationProperties `json:"properties,omitempty"` -} - -// VirtualMachineNetworkInterfaceConfigurationProperties - Describes a virtual machine network profile's IP configuration. -type VirtualMachineNetworkInterfaceConfigurationProperties struct { - // REQUIRED; Specifies the IP configurations of the network interface. - IPConfigurations []*VirtualMachineNetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - - // The dns settings to be applied on the network interfaces. - DNSSettings *VirtualMachineNetworkInterfaceDNSSettingsConfiguration `json:"dnsSettings,omitempty"` - - // Specify what happens to the network interface when the VM is deleted - DeleteOption *DeleteOptions `json:"deleteOption,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` - - // Specifies whether the network interface is accelerated networking-enabled. - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - - // Specifies whether the network interface is FPGA networking-enabled. - EnableFpga *bool `json:"enableFpga,omitempty"` - - // Whether IP forwarding enabled on this NIC. - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - - // The network security group. - NetworkSecurityGroup *SubResource `json:"networkSecurityGroup,omitempty"` - - // Specifies the primary network interface in case the virtual machine has more than 1 network interface. - Primary *bool `json:"primary,omitempty"` -} - -// VirtualMachineNetworkInterfaceDNSSettingsConfiguration - Describes a virtual machines network configuration's DNS settings. -type VirtualMachineNetworkInterfaceDNSSettingsConfiguration struct { - // List of DNS servers IP addresses - DNSServers []*string `json:"dnsServers,omitempty"` -} - -// VirtualMachineNetworkInterfaceIPConfiguration - Describes a virtual machine network profile's IP configuration. -type VirtualMachineNetworkInterfaceIPConfiguration struct { - // REQUIRED; The IP configuration name. - Name *string `json:"name,omitempty"` - - // Describes a virtual machine network interface IP configuration properties. - Properties *VirtualMachineNetworkInterfaceIPConfigurationProperties `json:"properties,omitempty"` -} - -// VirtualMachineNetworkInterfaceIPConfigurationProperties - Describes a virtual machine network interface IP configuration -// properties. -type VirtualMachineNetworkInterfaceIPConfigurationProperties struct { - // Specifies an array of references to backend address pools of application gateways. A virtual machine can reference backend - // address pools of multiple application gateways. Multiple virtual machines - // cannot use the same application gateway. - ApplicationGatewayBackendAddressPools []*SubResource `json:"applicationGatewayBackendAddressPools,omitempty"` - - // Specifies an array of references to application security group. - ApplicationSecurityGroups []*SubResource `json:"applicationSecurityGroups,omitempty"` - - // Specifies an array of references to backend address pools of load balancers. A virtual machine can reference backend address - // pools of one public and one internal load balancer. [Multiple virtual - // machines cannot use the same basic sku load balancer]. - LoadBalancerBackendAddressPools []*SubResource `json:"loadBalancerBackendAddressPools,omitempty"` - - // Specifies the primary network interface in case the virtual machine has more than 1 network interface. - Primary *bool `json:"primary,omitempty"` - - // Available from Api-Version 2017-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default - // is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. - PrivateIPAddressVersion *IPVersions `json:"privateIPAddressVersion,omitempty"` - - // The publicIPAddressConfiguration. - PublicIPAddressConfiguration *VirtualMachinePublicIPAddressConfiguration `json:"publicIPAddressConfiguration,omitempty"` - - // Specifies the identifier of the subnet. - Subnet *SubResource `json:"subnet,omitempty"` -} - -// VirtualMachinePatchStatus - The status of virtual machine patch operations. -type VirtualMachinePatchStatus struct { - // The available patch summary of the latest assessment operation for the virtual machine. - AvailablePatchSummary *AvailablePatchSummary `json:"availablePatchSummary,omitempty"` - - // The installation summary of the latest installation operation for the virtual machine. - LastPatchInstallationSummary *LastPatchInstallationSummary `json:"lastPatchInstallationSummary,omitempty"` - - // READ-ONLY; The enablement status of the specified patchMode - ConfigurationStatuses []*InstanceViewStatus `json:"configurationStatuses,omitempty" azure:"ro"` -} - -// VirtualMachineProperties - Describes the properties of a Virtual Machine. -type VirtualMachineProperties struct { - // Specifies additional capabilities enabled or disabled on the virtual machine. - AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` - - // Specifies the gallery applications that should be made available to the VM/VMSS - ApplicationProfile *ApplicationProfile `json:"applicationProfile,omitempty"` - - // 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 Availability sets overview [https://docs.microsoft.com/azure/virtual-machines/availability-set-overview]. - // For more information on Azure planned maintenance, see Maintenance and updates for Virtual Machines in Azure [https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates] - // Currently, a VM can only be added to availability set at creation time. The availability set to which the VM is being added - // should be under the same resource group as the availability set resource. An - // existing VM cannot be added to an availability set. - // This property cannot exist along with a non-null properties.virtualMachineScaleSet reference. - AvailabilitySet *SubResource `json:"availabilitySet,omitempty"` - - // Specifies the billing related details of a Azure Spot virtual machine. - // Minimum api-version: 2019-03-01. - BillingProfile *BillingProfile `json:"billingProfile,omitempty"` - - // Specifies information about the capacity reservation that is used to allocate virtual machine. - // Minimum api-version: 2021-04-01. - CapacityReservation *CapacityReservationProfile `json:"capacityReservation,omitempty"` - - // Specifies the boot diagnostic settings state. - // Minimum api-version: 2015-06-15. - DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` - - // Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot scale set. - // For Azure Spot virtual machines, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2019-03-01. - // For Azure Spot scale sets, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2017-10-30-preview. - EvictionPolicy *VirtualMachineEvictionPolicyTypes `json:"evictionPolicy,omitempty"` - - // Specifies the time alloted for all extensions to start. The time duration should be between 15 minutes and 120 minutes - // (inclusive) and should be specified in ISO 8601 format. The default value is 90 - // minutes (PT1H30M). - // Minimum api-version: 2020-06-01 - ExtensionsTimeBudget *string `json:"extensionsTimeBudget,omitempty"` - - // Specifies the hardware settings for the virtual machine. - HardwareProfile *HardwareProfile `json:"hardwareProfile,omitempty"` - - // Specifies information about the dedicated host that the virtual machine resides in. - // Minimum api-version: 2018-10-01. - Host *SubResource `json:"host,omitempty"` - - // Specifies information about the dedicated host group that the virtual machine resides in. - // Minimum api-version: 2020-06-01. - // NOTE: User cannot specify both host and hostGroup properties. - HostGroup *SubResource `json:"hostGroup,omitempty"` - - // Specifies that the image or disk that is being used was licensed on-premises. - // Possible values for Windows Server operating system are: - // WindowsClient - // WindowsServer - // Possible values for Linux Server operating system are: - // RHELBYOS (for RHEL) - // SLESBYOS (for SUSE) - // For more information, see Azure Hybrid Use Benefit for Windows Server [https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing] - // Azure Hybrid Use Benefit for Linux Server [https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux] - // Minimum api-version: 2015-06-15 - LicenseType *string `json:"licenseType,omitempty"` - - // Specifies the network interfaces of the virtual machine. - NetworkProfile *NetworkProfile `json:"networkProfile,omitempty"` - - // Specifies the operating system settings used while creating the virtual machine. Some of the settings cannot be changed - // once VM is provisioned. - OSProfile *OSProfile `json:"osProfile,omitempty"` - - // Specifies the scale set logical fault domain into which the Virtual Machine will be created. By default, the Virtual Machine - // will by automatically assigned to a fault domain that best maintains - // balance across available fault domains. - // This is applicable only if the 'virtualMachineScaleSet' property of this Virtual Machine is set.The Virtual Machine Scale - // Set that is referenced, must have 'platformFaultDomainCount' > 1.This property - // cannot be updated once the Virtual Machine is created.Fault domain assignment can be viewed in the Virtual Machine Instance - // View. - // Minimum api‐version: 2020‐12‐01 - PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"` - - // Specifies the priority for the virtual machine. - // Minimum api-version: 2019-03-01 - Priority *VirtualMachinePriorityTypes `json:"priority,omitempty"` - - // Specifies information about the proximity placement group that the virtual machine should be assigned to. - // Minimum api-version: 2018-04-01. - ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` - - // Specifies Scheduled Event related configurations. - ScheduledEventsProfile *ScheduledEventsProfile `json:"scheduledEventsProfile,omitempty"` - - // Specifies the Security related profile settings for the virtual machine. - SecurityProfile *SecurityProfile `json:"securityProfile,omitempty"` - - // Specifies the storage settings for the virtual machine disks. - StorageProfile *StorageProfile `json:"storageProfile,omitempty"` - - // UserData for the VM, which must be base-64 encoded. Customer should not pass any secrets in here. - // Minimum api-version: 2021-03-01 - UserData *string `json:"userData,omitempty"` - - // Specifies information about the virtual machine scale set that the virtual machine should be assigned to. Virtual machines - // specified in the same virtual machine scale set are allocated to different - // nodes to maximize availability. Currently, a VM can only be added to virtual machine scale set at creation time. An existing - // VM cannot be added to a virtual machine scale set. - // This property cannot exist along with a non-null properties.availabilitySet reference. - // Minimum api‐version: 2019‐03‐01 - VirtualMachineScaleSet *SubResource `json:"virtualMachineScaleSet,omitempty"` - - // READ-ONLY; The virtual machine instance view. - InstanceView *VirtualMachineInstanceView `json:"instanceView,omitempty" azure:"ro"` - - // READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *string `json:"provisioningState,omitempty" azure:"ro"` - - // READ-ONLY; Specifies the time at which the Virtual Machine resource was created. - // Minimum api-version: 2022-03-01. - TimeCreated *time.Time `json:"timeCreated,omitempty" azure:"ro"` - - // READ-ONLY; Specifies the VM unique ID which is a 128-bits identifier that is encoded and stored in all Azure IaaS VMs SMBIOS - // and can be read using platform BIOS commands. - VMID *string `json:"vmId,omitempty" azure:"ro"` -} - -// VirtualMachinePublicIPAddressConfiguration - Describes a virtual machines IP Configuration's PublicIPAddress configuration -type VirtualMachinePublicIPAddressConfiguration struct { - // REQUIRED; The publicIP address configuration name. - Name *string `json:"name,omitempty"` - - // Describes a virtual machines IP Configuration's PublicIPAddress configuration - Properties *VirtualMachinePublicIPAddressConfigurationProperties `json:"properties,omitempty"` - - // Describes the public IP Sku. It can only be set with OrchestrationMode as Flexible. - SKU *PublicIPAddressSKU `json:"sku,omitempty"` -} - -// VirtualMachinePublicIPAddressConfigurationProperties - Describes a virtual machines IP Configuration's PublicIPAddress -// configuration -type VirtualMachinePublicIPAddressConfigurationProperties struct { - // The dns settings to be applied on the publicIP addresses . - DNSSettings *VirtualMachinePublicIPAddressDNSSettingsConfiguration `json:"dnsSettings,omitempty"` - - // Specify what happens to the public IP address when the VM is deleted - DeleteOption *DeleteOptions `json:"deleteOption,omitempty"` - - // The list of IP tags associated with the public IP address. - IPTags []*VirtualMachineIPTag `json:"ipTags,omitempty"` - - // The idle timeout of the public IP address. - IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` - - // Available from Api-Version 2019-07-01 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default - // is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. - PublicIPAddressVersion *IPVersions `json:"publicIPAddressVersion,omitempty"` - - // Specify the public IP allocation type - PublicIPAllocationMethod *PublicIPAllocationMethod `json:"publicIPAllocationMethod,omitempty"` - - // The PublicIPPrefix from which to allocate publicIP addresses. - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` -} - -// VirtualMachinePublicIPAddressDNSSettingsConfiguration - Describes a virtual machines network configuration's DNS settings. -type VirtualMachinePublicIPAddressDNSSettingsConfiguration struct { - // REQUIRED; The Domain name label prefix of the PublicIPAddress resources that will be created. The generated name label - // is the concatenation of the domain name label and vm network profile unique ID. - DomainNameLabel *string `json:"domainNameLabel,omitempty"` -} - -// VirtualMachineReimageParameters - Parameters for Reimaging Virtual Machine. NOTE: Virtual Machine OS disk will always be -// reimaged -type VirtualMachineReimageParameters struct { - // Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage parameter is only supported - // for VM/VMSS with Ephemeral OS disk. - TempDisk *bool `json:"tempDisk,omitempty"` -} - -// VirtualMachineRunCommand - Describes a Virtual Machine run command. -type VirtualMachineRunCommand struct { - // REQUIRED; Resource location - Location *string `json:"location,omitempty"` - - // Describes the properties of a Virtual Machine run command. - Properties *VirtualMachineRunCommandProperties `json:"properties,omitempty"` - - // Resource tags - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; Resource Id - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; Resource name - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type - Type *string `json:"type,omitempty" azure:"ro"` -} - -// VirtualMachineRunCommandInstanceView - The instance view of a virtual machine run command. -type VirtualMachineRunCommandInstanceView struct { - // Script end time. - EndTime *time.Time `json:"endTime,omitempty"` - - // Script error stream. - Error *string `json:"error,omitempty"` - - // Communicate script configuration errors or execution messages. - ExecutionMessage *string `json:"executionMessage,omitempty"` - - // Script execution status. - ExecutionState *ExecutionState `json:"executionState,omitempty"` - - // Exit code returned from script execution. - ExitCode *int32 `json:"exitCode,omitempty"` - - // Script output stream. - Output *string `json:"output,omitempty"` - - // Script start time. - StartTime *time.Time `json:"startTime,omitempty"` - - // The resource status information. - Statuses []*InstanceViewStatus `json:"statuses,omitempty"` -} - -// VirtualMachineRunCommandProperties - Describes the properties of a Virtual Machine run command. -type VirtualMachineRunCommandProperties struct { - // Optional. If set to true, provisioning will complete as soon as the script starts and will not wait for script to complete. - AsyncExecution *bool `json:"asyncExecution,omitempty"` - - // Specifies the Azure storage blob where script error stream will be uploaded. - ErrorBlobURI *string `json:"errorBlobUri,omitempty"` - - // Specifies the Azure storage blob where script output stream will be uploaded. - OutputBlobURI *string `json:"outputBlobUri,omitempty"` - - // The parameters used by the script. - Parameters []*RunCommandInputParameter `json:"parameters,omitempty"` - - // The parameters used by the script. - ProtectedParameters []*RunCommandInputParameter `json:"protectedParameters,omitempty"` - - // Specifies the user account password on the VM when executing the run command. - RunAsPassword *string `json:"runAsPassword,omitempty"` - - // Specifies the user account on the VM when executing the run command. - RunAsUser *string `json:"runAsUser,omitempty"` - - // The source of the run command script. - Source *VirtualMachineRunCommandScriptSource `json:"source,omitempty"` - - // The timeout in seconds to execute the run command. - TimeoutInSeconds *int32 `json:"timeoutInSeconds,omitempty"` - - // READ-ONLY; The virtual machine run command instance view. - InstanceView *VirtualMachineRunCommandInstanceView `json:"instanceView,omitempty" azure:"ro"` - - // READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *string `json:"provisioningState,omitempty" azure:"ro"` -} - -// VirtualMachineRunCommandScriptSource - Describes the script sources for run command. -type VirtualMachineRunCommandScriptSource struct { - // Specifies a commandId of predefined built-in script. - CommandID *string `json:"commandId,omitempty"` - - // Specifies the script content to be executed on the VM. - Script *string `json:"script,omitempty"` - - // Specifies the script download location. - ScriptURI *string `json:"scriptUri,omitempty"` -} - -// VirtualMachineRunCommandUpdate - Describes a Virtual Machine run command. -type VirtualMachineRunCommandUpdate struct { - // Describes the properties of a Virtual Machine run command. - Properties *VirtualMachineRunCommandProperties `json:"properties,omitempty"` - - // Resource tags - Tags map[string]*string `json:"tags,omitempty"` -} - -// VirtualMachineRunCommandsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineRunCommandsClient.BeginCreateOrUpdate -// method. -type VirtualMachineRunCommandsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineRunCommandsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineRunCommandsClient.BeginDelete -// method. -type VirtualMachineRunCommandsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineRunCommandsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineRunCommandsClient.BeginUpdate -// method. -type VirtualMachineRunCommandsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineRunCommandsClientGetByVirtualMachineOptions contains the optional parameters for the VirtualMachineRunCommandsClient.GetByVirtualMachine -// method. -type VirtualMachineRunCommandsClientGetByVirtualMachineOptions struct { - // The expand expression to apply on the operation. - Expand *string -} - -// VirtualMachineRunCommandsClientGetOptions contains the optional parameters for the VirtualMachineRunCommandsClient.Get -// method. -type VirtualMachineRunCommandsClientGetOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineRunCommandsClientListByVirtualMachineOptions contains the optional parameters for the VirtualMachineRunCommandsClient.ListByVirtualMachine -// method. -type VirtualMachineRunCommandsClientListByVirtualMachineOptions struct { - // The expand expression to apply on the operation. - Expand *string -} - -// VirtualMachineRunCommandsClientListOptions contains the optional parameters for the VirtualMachineRunCommandsClient.List -// method. -type VirtualMachineRunCommandsClientListOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineRunCommandsListResult - The List run command operation response -type VirtualMachineRunCommandsListResult struct { - // REQUIRED; The list of run commands - Value []*VirtualMachineRunCommand `json:"value,omitempty"` - - // The uri to fetch the next page of run commands. - NextLink *string `json:"nextLink,omitempty"` -} - -// VirtualMachineScaleSet - Describes a Virtual Machine Scale Set. -type VirtualMachineScaleSet struct { - // REQUIRED; Resource location - Location *string `json:"location,omitempty"` - - // The extended location of the Virtual Machine Scale Set. - ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` - - // The identity of the virtual machine scale set, if configured. - Identity *VirtualMachineScaleSetIdentity `json:"identity,omitempty"` - - // 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"` - - // Describes the properties of a Virtual Machine Scale Set. - Properties *VirtualMachineScaleSetProperties `json:"properties,omitempty"` - - // The virtual machine scale set sku. - SKU *SKU `json:"sku,omitempty"` - - // Resource tags - Tags map[string]*string `json:"tags,omitempty"` - - // The virtual machine scale set zones. NOTE: Availability zones can only be set when you create the scale set - Zones []*string `json:"zones,omitempty"` - - // READ-ONLY; Resource Id - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; Resource name - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type - Type *string `json:"type,omitempty" azure:"ro"` -} - -// VirtualMachineScaleSetDataDisk - Describes a virtual machine scale set data disk. -type VirtualMachineScaleSetDataDisk struct { - // REQUIRED; The create option. - CreateOption *DiskCreateOptionTypes `json:"createOption,omitempty"` - - // REQUIRED; Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and - // therefore must be unique for each data disk attached to a VM. - Lun *int32 `json:"lun,omitempty"` - - // Specifies the caching requirements. - // Possible values are: - // None - // ReadOnly - // ReadWrite - // Default: None for Standard storage. ReadOnly for Premium storage - Caching *CachingTypes `json:"caching,omitempty"` - - // Specifies whether data disk should be deleted or detached upon VMSS Flex deletion (This feature is available for VMSS with - // Flexible OrchestrationMode only). - // Possible values: - // Delete If this value is used, the data disk is deleted when the VMSS Flex VM is deleted. - // Detach If this value is used, the data disk is retained after VMSS Flex VM is deleted. - // The default value is set to Delete. - DeleteOption *DiskDeleteOptionTypes `json:"deleteOption,omitempty"` - - // Specifies the Read-Write IOPS for the managed disk. Should be used only when StorageAccountType is UltraSSD_LRS. If not - // specified, a default value would be assigned based on diskSizeGB. - DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` - - // Specifies the bandwidth in MB per second for the managed disk. Should be used only when StorageAccountType is UltraSSD_LRS. - // If not specified, a default value would be assigned based on diskSizeGB. - DiskMBpsReadWrite *int64 `json:"diskMBpsReadWrite,omitempty"` - - // Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a - // virtual machine image. - // This value cannot be larger than 1023 GB - DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` - - // The managed disk parameters. - ManagedDisk *VirtualMachineScaleSetManagedDiskParameters `json:"managedDisk,omitempty"` - - // The disk name. - Name *string `json:"name,omitempty"` - - // Specifies whether writeAccelerator should be enabled or disabled on the disk. - WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` -} - -// VirtualMachineScaleSetExtension - Describes a Virtual Machine Scale Set Extension. -type VirtualMachineScaleSetExtension struct { - // The name of the extension. - Name *string `json:"name,omitempty"` - - // Describes the properties of a Virtual Machine Scale Set Extension. - Properties *VirtualMachineScaleSetExtensionProperties `json:"properties,omitempty"` - - // READ-ONLY; Resource Id - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; Resource type - Type *string `json:"type,omitempty" azure:"ro"` -} - -// VirtualMachineScaleSetExtensionListResult - The List VM scale set extension operation response. -type VirtualMachineScaleSetExtensionListResult struct { - // REQUIRED; The list of VM scale set extensions. - Value []*VirtualMachineScaleSetExtension `json:"value,omitempty"` - - // The uri to fetch the next page of VM scale set extensions. Call ListNext() with this to fetch the next page of VM scale - // set extensions. - NextLink *string `json:"nextLink,omitempty"` -} - -// VirtualMachineScaleSetExtensionProfile - Describes a virtual machine scale set extension profile. -type VirtualMachineScaleSetExtensionProfile struct { - // The virtual machine scale set child extension resources. - Extensions []*VirtualMachineScaleSetExtension `json:"extensions,omitempty"` - - // Specifies the time alloted for all extensions to start. The time duration should be between 15 minutes and 120 minutes - // (inclusive) and should be specified in ISO 8601 format. The default value is 90 - // minutes (PT1H30M). - // Minimum api-version: 2020-06-01 - ExtensionsTimeBudget *string `json:"extensionsTimeBudget,omitempty"` -} - -// VirtualMachineScaleSetExtensionProperties - Describes the properties of a Virtual Machine Scale Set Extension. -type VirtualMachineScaleSetExtensionProperties struct { - // 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"` - - // Indicates whether the extension should be automatically upgraded by the platform if there is a newer version of the extension - // available. - EnableAutomaticUpgrade *bool `json:"enableAutomaticUpgrade,omitempty"` - - // If a value is provided and is different from the previous value, the extension handler will be forced to update even if - // the extension configuration has not changed. - ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` - - // The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. - ProtectedSettings interface{} `json:"protectedSettings,omitempty"` - - // The extensions protected settings that are passed by reference, and consumed from key vault - ProtectedSettingsFromKeyVault interface{} `json:"protectedSettingsFromKeyVault,omitempty"` - - // Collection of extension names after which this extension needs to be provisioned. - ProvisionAfterExtensions []*string `json:"provisionAfterExtensions,omitempty"` - - // The name of the extension handler publisher. - Publisher *string `json:"publisher,omitempty"` - - // Json formatted public settings for the extension. - Settings interface{} `json:"settings,omitempty"` - - // Indicates whether failures stemming from the extension will be suppressed (Operational failures such as not connecting - // to the VM will not be suppressed regardless of this value). The default is false. - SuppressFailures *bool `json:"suppressFailures,omitempty"` - - // Specifies the type of the extension; an example is "CustomScriptExtension". - Type *string `json:"type,omitempty"` - - // Specifies the version of the script handler. - TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` - - // READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *string `json:"provisioningState,omitempty" azure:"ro"` -} - -// VirtualMachineScaleSetExtensionUpdate - Describes a Virtual Machine Scale Set Extension. -type VirtualMachineScaleSetExtensionUpdate struct { - // Describes the properties of a Virtual Machine Scale Set Extension. - Properties *VirtualMachineScaleSetExtensionProperties `json:"properties,omitempty"` - - // READ-ONLY; Resource Id - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; The name of the extension. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type - Type *string `json:"type,omitempty" azure:"ro"` -} - -// VirtualMachineScaleSetExtensionsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineScaleSetExtensionsClient.BeginCreateOrUpdate -// method. -type VirtualMachineScaleSetExtensionsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetExtensionsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineScaleSetExtensionsClient.BeginDelete -// method. -type VirtualMachineScaleSetExtensionsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetExtensionsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineScaleSetExtensionsClient.BeginUpdate -// method. -type VirtualMachineScaleSetExtensionsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetExtensionsClientGetOptions contains the optional parameters for the VirtualMachineScaleSetExtensionsClient.Get -// method. -type VirtualMachineScaleSetExtensionsClientGetOptions struct { - // The expand expression to apply on the operation. - Expand *string -} - -// VirtualMachineScaleSetExtensionsClientListOptions contains the optional parameters for the VirtualMachineScaleSetExtensionsClient.List -// method. -type VirtualMachineScaleSetExtensionsClientListOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineScaleSetHardwareProfile - Specifies the hardware settings for the virtual machine scale set. -type VirtualMachineScaleSetHardwareProfile struct { - // Specifies the properties for customizing the size of the virtual machine. Minimum api-version: 2022-03-01. - // Please follow the instructions in VM Customization [https://aka.ms/vmcustomization] for more details. - VMSizeProperties *VMSizeProperties `json:"vmSizeProperties,omitempty"` -} - -// VirtualMachineScaleSetIPConfiguration - Describes a virtual machine scale set network profile's IP configuration. -type VirtualMachineScaleSetIPConfiguration struct { - // REQUIRED; The IP configuration name. - Name *string `json:"name,omitempty"` - - // Resource Id - ID *string `json:"id,omitempty"` - - // Describes a virtual machine scale set network profile's IP configuration properties. - Properties *VirtualMachineScaleSetIPConfigurationProperties `json:"properties,omitempty"` -} - -// VirtualMachineScaleSetIPConfigurationProperties - Describes a virtual machine scale set network profile's IP configuration -// properties. -type VirtualMachineScaleSetIPConfigurationProperties struct { - // Specifies an array of references to backend address pools of application gateways. A scale set can reference backend address - // pools of multiple application gateways. Multiple scale sets cannot use the - // same application gateway. - ApplicationGatewayBackendAddressPools []*SubResource `json:"applicationGatewayBackendAddressPools,omitempty"` - - // Specifies an array of references to application security group. - ApplicationSecurityGroups []*SubResource `json:"applicationSecurityGroups,omitempty"` - - // Specifies an array of references to backend address pools of load balancers. A scale set can reference backend address - // pools of one public and one internal load balancer. Multiple scale sets cannot - // use the same basic sku load balancer. - LoadBalancerBackendAddressPools []*SubResource `json:"loadBalancerBackendAddressPools,omitempty"` - - // Specifies an array of references to inbound Nat pools of the load balancers. A scale set can reference inbound nat pools - // of one public and one internal load balancer. Multiple scale sets cannot use - // the same basic sku load balancer. - LoadBalancerInboundNatPools []*SubResource `json:"loadBalancerInboundNatPools,omitempty"` - - // Specifies the primary network interface in case the virtual machine has more than 1 network interface. - Primary *bool `json:"primary,omitempty"` - - // Available from Api-Version 2017-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default - // is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - - // The publicIPAddressConfiguration. - PublicIPAddressConfiguration *VirtualMachineScaleSetPublicIPAddressConfiguration `json:"publicIPAddressConfiguration,omitempty"` - - // Specifies the identifier of the subnet. - Subnet *APIEntityReference `json:"subnet,omitempty"` -} - -// VirtualMachineScaleSetIPTag - Contains the IP tag associated with the public IP address. -type VirtualMachineScaleSetIPTag struct { - // IP tag type. Example: FirstPartyUsage. - IPTagType *string `json:"ipTagType,omitempty"` - - // IP tag associated with the public IP. Example: SQL, Storage etc. - Tag *string `json:"tag,omitempty"` -} - -// VirtualMachineScaleSetIdentity - Identity for the virtual machine scale set. -type VirtualMachineScaleSetIdentity struct { - // The type of identity used for the virtual machine scale set. The type 'SystemAssigned, UserAssigned' includes both an implicitly - // created identity and a set of user assigned identities. The type 'None' - // will remove any identities from the virtual machine scale set. - Type *ResourceIdentityType `json:"type,omitempty"` - - // The list of user identities associated with the virtual machine scale set. The user identity dictionary key references - // will be ARM resource ids in the form: - // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - UserAssignedIdentities map[string]*VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue `json:"userAssignedIdentities,omitempty"` - - // READ-ONLY; The principal id of virtual machine scale set identity. This property will only be provided for a system assigned - // identity. - PrincipalID *string `json:"principalId,omitempty" azure:"ro"` - - // READ-ONLY; The tenant id associated with the virtual machine scale set. This property will only be provided for a system - // assigned identity. - TenantID *string `json:"tenantId,omitempty" azure:"ro"` -} - -type VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue struct { - // READ-ONLY; The client id of user assigned identity. - ClientID *string `json:"clientId,omitempty" azure:"ro"` - - // READ-ONLY; The principal id of user assigned identity. - PrincipalID *string `json:"principalId,omitempty" azure:"ro"` -} - -// VirtualMachineScaleSetInstanceView - The instance view of a virtual machine scale set. -type VirtualMachineScaleSetInstanceView struct { - // The resource status information. - Statuses []*InstanceViewStatus `json:"statuses,omitempty"` - - // READ-ONLY; The extensions information. - Extensions []*VirtualMachineScaleSetVMExtensionsSummary `json:"extensions,omitempty" azure:"ro"` - - // READ-ONLY; The orchestration services information. - OrchestrationServices []*OrchestrationServiceSummary `json:"orchestrationServices,omitempty" azure:"ro"` - - // READ-ONLY; The instance view status summary for the virtual machine scale set. - VirtualMachine *VirtualMachineScaleSetInstanceViewStatusesSummary `json:"virtualMachine,omitempty" azure:"ro"` -} - -// VirtualMachineScaleSetInstanceViewStatusesSummary - Instance view statuses summary for virtual machines of a virtual machine -// scale set. -type VirtualMachineScaleSetInstanceViewStatusesSummary struct { - // READ-ONLY; The extensions information. - StatusesSummary []*VirtualMachineStatusCodeCount `json:"statusesSummary,omitempty" azure:"ro"` -} - -// VirtualMachineScaleSetListOSUpgradeHistory - List of Virtual Machine Scale Set OS Upgrade History operation response. -type VirtualMachineScaleSetListOSUpgradeHistory struct { - // REQUIRED; The list of OS upgrades performed on the virtual machine scale set. - Value []*UpgradeOperationHistoricalStatusInfo `json:"value,omitempty"` - - // The uri to fetch the next page of OS Upgrade History. Call ListNext() with this to fetch the next page of history of upgrades. - NextLink *string `json:"nextLink,omitempty"` -} - -// VirtualMachineScaleSetListResult - The List Virtual Machine operation response. -type VirtualMachineScaleSetListResult struct { - // REQUIRED; The list of virtual machine scale sets. - Value []*VirtualMachineScaleSet `json:"value,omitempty"` - - // The uri to fetch the next page of Virtual Machine Scale Sets. Call ListNext() with this to fetch the next page of VMSS. - NextLink *string `json:"nextLink,omitempty"` -} - -// VirtualMachineScaleSetListSKUsResult - The Virtual Machine Scale Set List Skus operation response. -type VirtualMachineScaleSetListSKUsResult struct { - // REQUIRED; The list of skus available for the virtual machine scale set. - Value []*VirtualMachineScaleSetSKU `json:"value,omitempty"` - - // The uri to fetch the next page of Virtual Machine Scale Set Skus. Call ListNext() with this to fetch the next page of VMSS - // Skus. - NextLink *string `json:"nextLink,omitempty"` -} - -// VirtualMachineScaleSetListWithLinkResult - The List Virtual Machine operation response. -type VirtualMachineScaleSetListWithLinkResult struct { - // REQUIRED; The list of virtual machine scale sets. - Value []*VirtualMachineScaleSet `json:"value,omitempty"` - - // The uri to fetch the next page of Virtual Machine Scale Sets. Call ListNext() with this to fetch the next page of Virtual - // Machine Scale Sets. - NextLink *string `json:"nextLink,omitempty"` -} - -// VirtualMachineScaleSetManagedDiskParameters - Describes the parameters of a ScaleSet managed disk. -type VirtualMachineScaleSetManagedDiskParameters struct { - // Specifies the customer managed disk encryption set resource id for the managed disk. - DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` - - // Specifies the security profile for the managed disk. - SecurityProfile *VMDiskSecurityProfile `json:"securityProfile,omitempty"` - - // Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot - // be used with OS Disk. - StorageAccountType *StorageAccountTypes `json:"storageAccountType,omitempty"` -} - -// VirtualMachineScaleSetNetworkConfiguration - Describes a virtual machine scale set network profile's network configurations. -type VirtualMachineScaleSetNetworkConfiguration struct { - // REQUIRED; The network configuration name. - Name *string `json:"name,omitempty"` - - // Resource Id - ID *string `json:"id,omitempty"` - - // Describes a virtual machine scale set network profile's IP configuration. - Properties *VirtualMachineScaleSetNetworkConfigurationProperties `json:"properties,omitempty"` -} - -// VirtualMachineScaleSetNetworkConfigurationDNSSettings - Describes a virtual machines scale sets network configuration's -// DNS settings. -type VirtualMachineScaleSetNetworkConfigurationDNSSettings struct { - // List of DNS servers IP addresses - DNSServers []*string `json:"dnsServers,omitempty"` -} - -// VirtualMachineScaleSetNetworkConfigurationProperties - Describes a virtual machine scale set network profile's IP configuration. -type VirtualMachineScaleSetNetworkConfigurationProperties struct { - // REQUIRED; Specifies the IP configurations of the network interface. - IPConfigurations []*VirtualMachineScaleSetIPConfiguration `json:"ipConfigurations,omitempty"` - - // The dns settings to be applied on the network interfaces. - DNSSettings *VirtualMachineScaleSetNetworkConfigurationDNSSettings `json:"dnsSettings,omitempty"` - - // Specify what happens to the network interface when the VM is deleted - DeleteOption *DeleteOptions `json:"deleteOption,omitempty"` - - // Specifies whether the network interface is accelerated networking-enabled. - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - - // Specifies whether the network interface is FPGA networking-enabled. - EnableFpga *bool `json:"enableFpga,omitempty"` - - // Whether IP forwarding enabled on this NIC. - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - - // The network security group. - NetworkSecurityGroup *SubResource `json:"networkSecurityGroup,omitempty"` - - // Specifies the primary network interface in case the virtual machine has more than 1 network interface. - Primary *bool `json:"primary,omitempty"` -} - -// VirtualMachineScaleSetNetworkProfile - Describes a virtual machine scale set network profile. -type VirtualMachineScaleSetNetworkProfile struct { - // A reference to a load balancer probe used to determine the health of an instance in the virtual machine scale set. The - // reference will be in the form: - // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. - HealthProbe *APIEntityReference `json:"healthProbe,omitempty"` - - // specifies the Microsoft.Network API version used when creating networking resources in the Network Interface Configurations - // for Virtual Machine Scale Set with orchestration mode 'Flexible' - NetworkAPIVersion *NetworkAPIVersion `json:"networkApiVersion,omitempty"` - - // The list of network configurations. - NetworkInterfaceConfigurations []*VirtualMachineScaleSetNetworkConfiguration `json:"networkInterfaceConfigurations,omitempty"` -} - -// VirtualMachineScaleSetOSDisk - Describes a virtual machine scale set operating system disk. -type VirtualMachineScaleSetOSDisk struct { - // REQUIRED; Specifies how the virtual machines in the scale set should be created. - // The only allowed value is: FromImage \u2013 This value is used when you are using an image to create the virtual machine. - // If you are using a platform image, you also use the imageReference element - // described above. If you are using a marketplace image, you also use the plan element previously described. - CreateOption *DiskCreateOptionTypes `json:"createOption,omitempty"` - - // Specifies the caching requirements. - // Possible values are: - // None - // ReadOnly - // ReadWrite - // Default: None for Standard storage. ReadOnly for Premium storage - Caching *CachingTypes `json:"caching,omitempty"` - - // Specifies whether OS Disk should be deleted or detached upon VMSS Flex deletion (This feature is available for VMSS with - // Flexible OrchestrationMode only). - // Possible values: - // Delete If this value is used, the OS disk is deleted when VMSS Flex VM is deleted. - // Detach If this value is used, the OS disk is retained after VMSS Flex VM is deleted. - // The default value is set to Delete. For an Ephemeral OS Disk, the default value is set to Delete. User cannot change the - // delete option for Ephemeral OS Disk. - DeleteOption *DiskDeleteOptionTypes `json:"deleteOption,omitempty"` - - // Specifies the ephemeral disk Settings for the operating system disk used by the virtual machine scale set. - DiffDiskSettings *DiffDiskSettings `json:"diffDiskSettings,omitempty"` - - // Specifies the size of the operating system disk in gigabytes. This element can be used to overwrite the size of the disk - // in a virtual machine image. - // This value cannot be larger than 1023 GB - DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` - - // Specifies information about the unmanaged user image to base the scale set on. - Image *VirtualHardDisk `json:"image,omitempty"` - - // The managed disk parameters. - ManagedDisk *VirtualMachineScaleSetManagedDiskParameters `json:"managedDisk,omitempty"` - - // The disk name. - Name *string `json:"name,omitempty"` - - // This property allows you to specify the type of the OS that is included in the disk if creating a VM from user-image or - // a specialized VHD. - // Possible values are: - // Windows - // Linux - OSType *OperatingSystemTypes `json:"osType,omitempty"` - - // Specifies the container urls that are used to store operating system disks for the scale set. - VhdContainers []*string `json:"vhdContainers,omitempty"` - - // Specifies whether writeAccelerator should be enabled or disabled on the disk. - WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` -} - -// VirtualMachineScaleSetOSProfile - Describes a virtual machine scale set OS profile. -type VirtualMachineScaleSetOSProfile struct { - // Specifies the password of the administrator account. - // Minimum-length (Windows): 8 characters - // Minimum-length (Linux): 6 characters - // Max-length (Windows): 123 characters - // Max-length (Linux): 72 characters - // Complexity requirements: 3 out of 4 conditions below need to be fulfilled - // Has lower characters - // Has upper characters - // Has a digit - // Has a special character (Regex match [\W_]) - // Disallowed values: "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", - // "Password22", "iloveyou!" - // For resetting the password, see How to reset the Remote Desktop service or its login password in a Windows VM [https://docs.microsoft.com/troubleshoot/azure/virtual-machines/reset-rdp] - // For resetting root password, see Manage users, SSH, and check or repair disks on Azure Linux VMs using the VMAccess Extension - // [https://docs.microsoft.com/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection] - AdminPassword *string `json:"adminPassword,omitempty"` - - // Specifies the name of the administrator account. - // Windows-only restriction: Cannot end in "." - // Disallowed values: "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", - // "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", - // "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5". - // Minimum-length (Linux): 1 character - // Max-length (Linux): 64 characters - // Max-length (Windows): 20 characters - AdminUsername *string `json:"adminUsername,omitempty"` - - // Specifies whether extension operations should be allowed on the virtual machine scale set. - // This may only be set to False when no extensions are present on the virtual machine scale set. - AllowExtensionOperations *bool `json:"allowExtensionOperations,omitempty"` - - // Specifies the computer name prefix for all of the virtual machines in the scale set. Computer name prefixes must be 1 to - // 15 characters long. - ComputerNamePrefix *string `json:"computerNamePrefix,omitempty"` - - // Specifies a base-64 encoded string of custom data. The base-64 encoded string is decoded to a binary array that is saved - // as a file on the Virtual Machine. The maximum length of the binary array is - // 65535 bytes. - // For using cloud-init for your VM, see Using cloud-init to customize a Linux VM during creation [https://docs.microsoft.com/azure/virtual-machines/linux/using-cloud-init] - CustomData *string `json:"customData,omitempty"` - - // Specifies the Linux operating system settings on the virtual machine. - // For a list of supported Linux distributions, see Linux on Azure-Endorsed Distributions [https://docs.microsoft.com/azure/virtual-machines/linux/endorsed-distros]. - LinuxConfiguration *LinuxConfiguration `json:"linuxConfiguration,omitempty"` - - // Specifies set of certificates that should be installed onto the virtual machines in the scale set. To install certificates - // on a virtual machine it is recommended to use the Azure Key Vault virtual - // machine extension for Linux [https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux] or the Azure - // Key Vault virtual machine extension for Windows - // [https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows]. - Secrets []*VaultSecretGroup `json:"secrets,omitempty"` - - // Specifies Windows operating system settings on the virtual machine. - WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"` -} - -// VirtualMachineScaleSetProperties - Describes the properties of a Virtual Machine Scale Set. -type VirtualMachineScaleSetProperties struct { - // Specifies additional capabilities enabled or disabled on the Virtual Machines in the Virtual Machine Scale Set. For instance: - // whether the Virtual Machines have the capability to support attaching - // managed data disks with UltraSSD_LRS storage account type. - AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` - - // Policy for automatic repairs. - AutomaticRepairsPolicy *AutomaticRepairsPolicy `json:"automaticRepairsPolicy,omitempty"` - - // When Overprovision is enabled, extensions are launched only on the requested number of VMs which are finally kept. This - // property will hence ensure that the extensions do not run on the extra - // overprovisioned VMs. - DoNotRunExtensionsOnOverprovisionedVMs *bool `json:"doNotRunExtensionsOnOverprovisionedVMs,omitempty"` - - // Specifies information about the dedicated host group that the virtual machine scale set resides in. - // Minimum api-version: 2020-06-01. - HostGroup *SubResource `json:"hostGroup,omitempty"` - - // Specifies the orchestration mode for the virtual machine scale set. - OrchestrationMode *OrchestrationMode `json:"orchestrationMode,omitempty"` - - // Specifies whether the Virtual Machine Scale Set should be overprovisioned. - Overprovision *bool `json:"overprovision,omitempty"` - - // Fault Domain count for each placement group. - PlatformFaultDomainCount *int32 `json:"platformFaultDomainCount,omitempty"` - - // Specifies information about the proximity placement group that the virtual machine scale set should be assigned to. - // Minimum api-version: 2018-04-01. - ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` - - // Specifies the policies applied when scaling in Virtual Machines in the Virtual Machine Scale Set. - ScaleInPolicy *ScaleInPolicy `json:"scaleInPolicy,omitempty"` - - // When true this limits the scale set to a single placement group, of max size 100 virtual machines. NOTE: If singlePlacementGroup - // is true, it may be modified to false. However, if singlePlacementGroup - // is false, it may not be modified to true. - SinglePlacementGroup *bool `json:"singlePlacementGroup,omitempty"` - - // Specifies the Spot Restore properties for the virtual machine scale set. - SpotRestorePolicy *SpotRestorePolicy `json:"spotRestorePolicy,omitempty"` - - // The upgrade policy. - UpgradePolicy *UpgradePolicy `json:"upgradePolicy,omitempty"` - - // The virtual machine profile. - VirtualMachineProfile *VirtualMachineScaleSetVMProfile `json:"virtualMachineProfile,omitempty"` - - // Whether to force strictly even Virtual Machine distribution cross x-zones in case there is zone outage. zoneBalance property - // can only be set if the zones property of the scale set contains more than - // one zone. If there are no zones or only one zone specified, then zoneBalance property should not be set. - ZoneBalance *bool `json:"zoneBalance,omitempty"` - - // READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *string `json:"provisioningState,omitempty" azure:"ro"` - - // READ-ONLY; Specifies the time at which the Virtual Machine Scale Set resource was created. - // Minimum api-version: 2022-03-01. - TimeCreated *time.Time `json:"timeCreated,omitempty" azure:"ro"` - - // READ-ONLY; Specifies the ID which uniquely identifies a Virtual Machine Scale Set. - UniqueID *string `json:"uniqueId,omitempty" azure:"ro"` -} - -// VirtualMachineScaleSetPublicIPAddressConfiguration - Describes a virtual machines scale set IP Configuration's PublicIPAddress -// configuration -type VirtualMachineScaleSetPublicIPAddressConfiguration struct { - // REQUIRED; The publicIP address configuration name. - Name *string `json:"name,omitempty"` - - // Describes a virtual machines scale set IP Configuration's PublicIPAddress configuration - Properties *VirtualMachineScaleSetPublicIPAddressConfigurationProperties `json:"properties,omitempty"` - - // Describes the public IP Sku. It can only be set with OrchestrationMode as Flexible. - SKU *PublicIPAddressSKU `json:"sku,omitempty"` -} - -// VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings - Describes a virtual machines scale sets network configuration's -// DNS settings. -type VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings struct { - // REQUIRED; The Domain name label.The concatenation of the domain name label and vm index will be the domain name labels - // of the PublicIPAddress resources that will be created - DomainNameLabel *string `json:"domainNameLabel,omitempty"` -} - -// VirtualMachineScaleSetPublicIPAddressConfigurationProperties - Describes a virtual machines scale set IP Configuration's -// PublicIPAddress configuration -type VirtualMachineScaleSetPublicIPAddressConfigurationProperties struct { - // The dns settings to be applied on the publicIP addresses . - DNSSettings *VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings `json:"dnsSettings,omitempty"` - - // Specify what happens to the public IP when the VM is deleted - DeleteOption *DeleteOptions `json:"deleteOption,omitempty"` - - // The list of IP tags associated with the public IP address. - IPTags []*VirtualMachineScaleSetIPTag `json:"ipTags,omitempty"` - - // The idle timeout of the public IP address. - IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` - - // Available from Api-Version 2019-07-01 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default - // is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. - PublicIPAddressVersion *IPVersion `json:"publicIPAddressVersion,omitempty"` - - // The PublicIPPrefix from which to allocate publicIP addresses. - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` -} - -// VirtualMachineScaleSetReimageParameters - Describes a Virtual Machine Scale Set VM Reimage Parameters. -type VirtualMachineScaleSetReimageParameters struct { - // The virtual machine scale set instance ids. Omitting the virtual machine scale set instance ids will result in the operation - // being performed on all virtual machines in the virtual machine scale set. - InstanceIDs []*string `json:"instanceIds,omitempty"` - - // Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage parameter is only supported - // for VM/VMSS with Ephemeral OS disk. - TempDisk *bool `json:"tempDisk,omitempty"` -} - -// VirtualMachineScaleSetRollingUpgradesClientBeginCancelOptions contains the optional parameters for the VirtualMachineScaleSetRollingUpgradesClient.BeginCancel -// method. -type VirtualMachineScaleSetRollingUpgradesClientBeginCancelOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetRollingUpgradesClientBeginStartExtensionUpgradeOptions contains the optional parameters for the VirtualMachineScaleSetRollingUpgradesClient.BeginStartExtensionUpgrade -// method. -type VirtualMachineScaleSetRollingUpgradesClientBeginStartExtensionUpgradeOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetRollingUpgradesClientBeginStartOSUpgradeOptions contains the optional parameters for the VirtualMachineScaleSetRollingUpgradesClient.BeginStartOSUpgrade -// method. -type VirtualMachineScaleSetRollingUpgradesClientBeginStartOSUpgradeOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetRollingUpgradesClientGetLatestOptions contains the optional parameters for the VirtualMachineScaleSetRollingUpgradesClient.GetLatest -// method. -type VirtualMachineScaleSetRollingUpgradesClientGetLatestOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineScaleSetSKU - Describes an available virtual machine scale set sku. -type VirtualMachineScaleSetSKU struct { - // READ-ONLY; Specifies the number of virtual machines in the scale set. - Capacity *VirtualMachineScaleSetSKUCapacity `json:"capacity,omitempty" azure:"ro"` - - // READ-ONLY; The type of resource the sku applies to. - ResourceType *string `json:"resourceType,omitempty" azure:"ro"` - - // READ-ONLY; The Sku. - SKU *SKU `json:"sku,omitempty" azure:"ro"` -} - -// VirtualMachineScaleSetSKUCapacity - Describes scaling information of a sku. -type VirtualMachineScaleSetSKUCapacity struct { - // READ-ONLY; The default capacity. - DefaultCapacity *int64 `json:"defaultCapacity,omitempty" azure:"ro"` - - // READ-ONLY; The maximum capacity that can be set. - Maximum *int64 `json:"maximum,omitempty" azure:"ro"` - - // READ-ONLY; The minimum capacity. - Minimum *int64 `json:"minimum,omitempty" azure:"ro"` - - // READ-ONLY; The scale type applicable to the sku. - ScaleType *VirtualMachineScaleSetSKUScaleType `json:"scaleType,omitempty" azure:"ro"` -} - -// VirtualMachineScaleSetStorageProfile - Describes a virtual machine scale set storage profile. -type VirtualMachineScaleSetStorageProfile struct { - // Specifies the parameters that are used to add data disks to the virtual machines in the scale set. - // For more information about disks, see About disks and VHDs for Azure virtual machines [https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview]. - DataDisks []*VirtualMachineScaleSetDataDisk `json:"dataDisks,omitempty"` - - // Specifies information about the image to use. You can specify information about platform images, 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. - ImageReference *ImageReference `json:"imageReference,omitempty"` - - // Specifies information about the operating system disk used by the virtual machines in the scale set. - // For more information about disks, see About disks and VHDs for Azure virtual machines [https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview]. - OSDisk *VirtualMachineScaleSetOSDisk `json:"osDisk,omitempty"` -} - -// VirtualMachineScaleSetUpdate - Describes a Virtual Machine Scale Set. -type VirtualMachineScaleSetUpdate struct { - // The identity of the virtual machine scale set, if configured. - Identity *VirtualMachineScaleSetIdentity `json:"identity,omitempty"` - - // The purchase plan when deploying a virtual machine scale set from VM Marketplace images. - Plan *Plan `json:"plan,omitempty"` - - // Describes the properties of a Virtual Machine Scale Set. - Properties *VirtualMachineScaleSetUpdateProperties `json:"properties,omitempty"` - - // The virtual machine scale set sku. - SKU *SKU `json:"sku,omitempty"` - - // Resource tags - Tags map[string]*string `json:"tags,omitempty"` -} - -// VirtualMachineScaleSetUpdateIPConfiguration - Describes a virtual machine scale set network profile's IP configuration. -// NOTE: The subnet of a scale set may be modified as long as the original subnet and the new subnet are in the same virtual -// network -type VirtualMachineScaleSetUpdateIPConfiguration struct { - // Resource Id - ID *string `json:"id,omitempty"` - - // The IP configuration name. - Name *string `json:"name,omitempty"` - - // Describes a virtual machine scale set network profile's IP configuration properties. - Properties *VirtualMachineScaleSetUpdateIPConfigurationProperties `json:"properties,omitempty"` -} - -// VirtualMachineScaleSetUpdateIPConfigurationProperties - Describes a virtual machine scale set network profile's IP configuration -// properties. -type VirtualMachineScaleSetUpdateIPConfigurationProperties struct { - // The application gateway backend address pools. - ApplicationGatewayBackendAddressPools []*SubResource `json:"applicationGatewayBackendAddressPools,omitempty"` - - // Specifies an array of references to application security group. - ApplicationSecurityGroups []*SubResource `json:"applicationSecurityGroups,omitempty"` - - // The load balancer backend address pools. - LoadBalancerBackendAddressPools []*SubResource `json:"loadBalancerBackendAddressPools,omitempty"` - - // The load balancer inbound nat pools. - LoadBalancerInboundNatPools []*SubResource `json:"loadBalancerInboundNatPools,omitempty"` - - // Specifies the primary IP Configuration in case the network interface has more than one IP Configuration. - Primary *bool `json:"primary,omitempty"` - - // Available from Api-Version 2017-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default - // is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - - // The publicIPAddressConfiguration. - PublicIPAddressConfiguration *VirtualMachineScaleSetUpdatePublicIPAddressConfiguration `json:"publicIPAddressConfiguration,omitempty"` - - // The subnet. - Subnet *APIEntityReference `json:"subnet,omitempty"` -} - -// VirtualMachineScaleSetUpdateNetworkConfiguration - Describes a virtual machine scale set network profile's network configurations. -type VirtualMachineScaleSetUpdateNetworkConfiguration struct { - // Resource Id - ID *string `json:"id,omitempty"` - - // The network configuration name. - Name *string `json:"name,omitempty"` - - // Describes a virtual machine scale set updatable network profile's IP configuration.Use this object for updating network - // profile's IP Configuration. - Properties *VirtualMachineScaleSetUpdateNetworkConfigurationProperties `json:"properties,omitempty"` -} - -// 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 { - // The dns settings to be applied on the network interfaces. - DNSSettings *VirtualMachineScaleSetNetworkConfigurationDNSSettings `json:"dnsSettings,omitempty"` - - // Specify what happens to the network interface when the VM is deleted - DeleteOption *DeleteOptions `json:"deleteOption,omitempty"` - - // Specifies whether the network interface is accelerated networking-enabled. - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - - // Specifies whether the network interface is FPGA networking-enabled. - EnableFpga *bool `json:"enableFpga,omitempty"` - - // Whether IP forwarding enabled on this NIC. - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - - // The virtual machine scale set IP Configuration. - IPConfigurations []*VirtualMachineScaleSetUpdateIPConfiguration `json:"ipConfigurations,omitempty"` - - // The network security group. - NetworkSecurityGroup *SubResource `json:"networkSecurityGroup,omitempty"` - - // Whether this is a primary NIC on a virtual machine. - Primary *bool `json:"primary,omitempty"` -} - -// VirtualMachineScaleSetUpdateNetworkProfile - Describes a virtual machine scale set network profile. -type VirtualMachineScaleSetUpdateNetworkProfile struct { - // A reference to a load balancer probe used to determine the health of an instance in the virtual machine scale set. The - // reference will be in the form: - // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. - HealthProbe *APIEntityReference `json:"healthProbe,omitempty"` - - // specifies the Microsoft.Network API version used when creating networking resources in the Network Interface Configurations - // for Virtual Machine Scale Set with orchestration mode 'Flexible' - NetworkAPIVersion *NetworkAPIVersion `json:"networkApiVersion,omitempty"` - - // The list of network configurations. - NetworkInterfaceConfigurations []*VirtualMachineScaleSetUpdateNetworkConfiguration `json:"networkInterfaceConfigurations,omitempty"` -} - -// VirtualMachineScaleSetUpdateOSDisk - Describes virtual machine scale set operating system disk Update Object. This should -// be used for Updating VMSS OS Disk. -type VirtualMachineScaleSetUpdateOSDisk struct { - // The caching type. - Caching *CachingTypes `json:"caching,omitempty"` - - // Specifies whether OS Disk should be deleted or detached upon VMSS Flex deletion (This feature is available for VMSS with - // Flexible OrchestrationMode only). - // Possible values: - // Delete If this value is used, the OS disk is deleted when VMSS Flex VM is deleted. - // Detach If this value is used, the OS disk is retained after VMSS Flex VM is deleted. - // The default value is set to Delete. For an Ephemeral OS Disk, the default value is set to Delete. User cannot change the - // delete option for Ephemeral OS Disk. - DeleteOption *DiskDeleteOptionTypes `json:"deleteOption,omitempty"` - - // Specifies the size of the operating system disk in gigabytes. This element can be used to overwrite the size of the disk - // in a virtual machine image. - // This value cannot be larger than 1023 GB - DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` - - // The Source User Image VirtualHardDisk. This VirtualHardDisk will be copied before using it to attach to the Virtual Machine. - // If SourceImage is provided, the destination VirtualHardDisk should not - // exist. - Image *VirtualHardDisk `json:"image,omitempty"` - - // The managed disk parameters. - ManagedDisk *VirtualMachineScaleSetManagedDiskParameters `json:"managedDisk,omitempty"` - - // The list of virtual hard disk container uris. - VhdContainers []*string `json:"vhdContainers,omitempty"` - - // Specifies whether writeAccelerator should be enabled or disabled on the disk. - WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` -} - -// VirtualMachineScaleSetUpdateOSProfile - Describes a virtual machine scale set OS profile. -type VirtualMachineScaleSetUpdateOSProfile struct { - // A base-64 encoded string of custom data. - CustomData *string `json:"customData,omitempty"` - - // The Linux Configuration of the OS profile. - LinuxConfiguration *LinuxConfiguration `json:"linuxConfiguration,omitempty"` - - // The List of certificates for addition to the VM. - Secrets []*VaultSecretGroup `json:"secrets,omitempty"` - - // The Windows Configuration of the OS profile. - WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"` -} - -// VirtualMachineScaleSetUpdateProperties - Describes the properties of a Virtual Machine Scale Set. -type VirtualMachineScaleSetUpdateProperties struct { - // Specifies additional capabilities enabled or disabled on the Virtual Machines in the Virtual Machine Scale Set. For instance: - // whether the Virtual Machines have the capability to support attaching - // managed data disks with UltraSSD_LRS storage account type. - AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` - - // Policy for automatic repairs. - AutomaticRepairsPolicy *AutomaticRepairsPolicy `json:"automaticRepairsPolicy,omitempty"` - - // When Overprovision is enabled, extensions are launched only on the requested number of VMs which are finally kept. This - // property will hence ensure that the extensions do not run on the extra - // overprovisioned VMs. - DoNotRunExtensionsOnOverprovisionedVMs *bool `json:"doNotRunExtensionsOnOverprovisionedVMs,omitempty"` - - // Specifies whether the Virtual Machine Scale Set should be overprovisioned. - Overprovision *bool `json:"overprovision,omitempty"` - - // Specifies information about the proximity placement group that the virtual machine scale set should be assigned to. - // Minimum api-version: 2018-04-01. - ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` - - // Specifies the policies applied when scaling in Virtual Machines in the Virtual Machine Scale Set. - ScaleInPolicy *ScaleInPolicy `json:"scaleInPolicy,omitempty"` - - // When true this limits the scale set to a single placement group, of max size 100 virtual machines. NOTE: If singlePlacementGroup - // is true, it may be modified to false. However, if singlePlacementGroup - // is false, it may not be modified to true. - SinglePlacementGroup *bool `json:"singlePlacementGroup,omitempty"` - - // The upgrade policy. - UpgradePolicy *UpgradePolicy `json:"upgradePolicy,omitempty"` - - // The virtual machine profile. - VirtualMachineProfile *VirtualMachineScaleSetUpdateVMProfile `json:"virtualMachineProfile,omitempty"` -} - -// VirtualMachineScaleSetUpdatePublicIPAddressConfiguration - Describes a virtual machines scale set IP Configuration's PublicIPAddress -// configuration -type VirtualMachineScaleSetUpdatePublicIPAddressConfiguration struct { - // The publicIP address configuration name. - Name *string `json:"name,omitempty"` - - // Describes a virtual machines scale set IP Configuration's PublicIPAddress configuration - Properties *VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties `json:"properties,omitempty"` -} - -// VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties - Describes a virtual machines scale set IP Configuration's -// PublicIPAddress configuration -type VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties struct { - // The dns settings to be applied on the publicIP addresses . - DNSSettings *VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings `json:"dnsSettings,omitempty"` - - // Specify what happens to the public IP when the VM is deleted - DeleteOption *DeleteOptions `json:"deleteOption,omitempty"` - - // The idle timeout of the public IP address. - IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` - - // The PublicIPPrefix from which to allocate publicIP addresses. - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` -} - -// VirtualMachineScaleSetUpdateStorageProfile - Describes a virtual machine scale set storage profile. -type VirtualMachineScaleSetUpdateStorageProfile struct { - // The data disks. - DataDisks []*VirtualMachineScaleSetDataDisk `json:"dataDisks,omitempty"` - - // The image reference. - ImageReference *ImageReference `json:"imageReference,omitempty"` - - // The OS disk. - OSDisk *VirtualMachineScaleSetUpdateOSDisk `json:"osDisk,omitempty"` -} - -// VirtualMachineScaleSetUpdateVMProfile - Describes a virtual machine scale set virtual machine profile. -type VirtualMachineScaleSetUpdateVMProfile struct { - // Specifies the billing related details of a Azure Spot VMSS. - // Minimum api-version: 2019-03-01. - BillingProfile *BillingProfile `json:"billingProfile,omitempty"` - - // The virtual machine scale set diagnostics profile. - DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` - - // The virtual machine scale set extension profile. - ExtensionProfile *VirtualMachineScaleSetExtensionProfile `json:"extensionProfile,omitempty"` - - // The license type, which is for bring your own license scenario. - LicenseType *string `json:"licenseType,omitempty"` - - // The virtual machine scale set network profile. - NetworkProfile *VirtualMachineScaleSetUpdateNetworkProfile `json:"networkProfile,omitempty"` - - // The virtual machine scale set OS profile. - OSProfile *VirtualMachineScaleSetUpdateOSProfile `json:"osProfile,omitempty"` - - // Specifies Scheduled Event related configurations. - ScheduledEventsProfile *ScheduledEventsProfile `json:"scheduledEventsProfile,omitempty"` - - // The virtual machine scale set Security profile - SecurityProfile *SecurityProfile `json:"securityProfile,omitempty"` - - // The virtual machine scale set storage profile. - StorageProfile *VirtualMachineScaleSetUpdateStorageProfile `json:"storageProfile,omitempty"` - - // UserData for the VM, which must be base-64 encoded. Customer should not pass any secrets in here. - // Minimum api-version: 2021-03-01 - UserData *string `json:"userData,omitempty"` -} - -// VirtualMachineScaleSetVM - Describes a virtual machine scale set virtual machine. -type VirtualMachineScaleSetVM struct { - // REQUIRED; Resource location - Location *string `json:"location,omitempty"` - - // The identity of the virtual machine, if configured. - Identity *VirtualMachineIdentity `json:"identity,omitempty"` - - // 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"` - - // Describes the properties of a virtual machine scale set virtual machine. - Properties *VirtualMachineScaleSetVMProperties `json:"properties,omitempty"` - - // Resource tags - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; Resource Id - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; The virtual machine instance ID. - InstanceID *string `json:"instanceId,omitempty" azure:"ro"` - - // READ-ONLY; Resource name - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; The virtual machine child extension resources. - Resources []*VirtualMachineExtension `json:"resources,omitempty" azure:"ro"` - - // READ-ONLY; The virtual machine SKU. - SKU *SKU `json:"sku,omitempty" azure:"ro"` - - // READ-ONLY; Resource type - Type *string `json:"type,omitempty" azure:"ro"` - - // READ-ONLY; The virtual machine zones. - Zones []*string `json:"zones,omitempty" azure:"ro"` -} - -// VirtualMachineScaleSetVMExtension - Describes a VMSS VM Extension. -type VirtualMachineScaleSetVMExtension struct { - // Describes the properties of a Virtual Machine Extension. - Properties *VirtualMachineExtensionProperties `json:"properties,omitempty"` - - // READ-ONLY; Resource Id - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; The name of the extension. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type - Type *string `json:"type,omitempty" azure:"ro"` -} - -// VirtualMachineScaleSetVMExtensionUpdate - Describes a VMSS VM Extension. -type VirtualMachineScaleSetVMExtensionUpdate struct { - // Describes the properties of a Virtual Machine Extension. - Properties *VirtualMachineExtensionUpdateProperties `json:"properties,omitempty"` - - // READ-ONLY; Resource Id - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; The name of the extension. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type - Type *string `json:"type,omitempty" azure:"ro"` -} - -// VirtualMachineScaleSetVMExtensionsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineScaleSetVMExtensionsClient.BeginCreateOrUpdate -// method. -type VirtualMachineScaleSetVMExtensionsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetVMExtensionsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineScaleSetVMExtensionsClient.BeginDelete -// method. -type VirtualMachineScaleSetVMExtensionsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetVMExtensionsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineScaleSetVMExtensionsClient.BeginUpdate -// method. -type VirtualMachineScaleSetVMExtensionsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetVMExtensionsClientGetOptions contains the optional parameters for the VirtualMachineScaleSetVMExtensionsClient.Get -// method. -type VirtualMachineScaleSetVMExtensionsClientGetOptions struct { - // The expand expression to apply on the operation. - Expand *string -} - -// VirtualMachineScaleSetVMExtensionsClientListOptions contains the optional parameters for the VirtualMachineScaleSetVMExtensionsClient.List -// method. -type VirtualMachineScaleSetVMExtensionsClientListOptions struct { - // The expand expression to apply on the operation. - Expand *string -} - -// VirtualMachineScaleSetVMExtensionsListResult - The List VMSS VM Extension operation response -type VirtualMachineScaleSetVMExtensionsListResult struct { - // The list of VMSS VM extensions - Value []*VirtualMachineScaleSetVMExtension `json:"value,omitempty"` -} - -// VirtualMachineScaleSetVMExtensionsSummary - Extensions summary for virtual machines of a virtual machine scale set. -type VirtualMachineScaleSetVMExtensionsSummary struct { - // READ-ONLY; The extension name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; The extensions information. - StatusesSummary []*VirtualMachineStatusCodeCount `json:"statusesSummary,omitempty" azure:"ro"` -} - -// VirtualMachineScaleSetVMInstanceIDs - Specifies a list of virtual machine instance IDs from the VM scale set. -type VirtualMachineScaleSetVMInstanceIDs struct { - // The virtual machine scale set instance ids. Omitting the virtual machine scale set instance ids will result in the operation - // being performed on all virtual machines in the virtual machine scale set. - InstanceIDs []*string `json:"instanceIds,omitempty"` -} - -// VirtualMachineScaleSetVMInstanceRequiredIDs - Specifies a list of virtual machine instance IDs from the VM scale set. -type VirtualMachineScaleSetVMInstanceRequiredIDs struct { - // REQUIRED; The virtual machine scale set instance ids. - InstanceIDs []*string `json:"instanceIds,omitempty"` -} - -// VirtualMachineScaleSetVMInstanceView - The instance view of a virtual machine scale set VM. -type VirtualMachineScaleSetVMInstanceView struct { - // Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to diagnose VM status. - // You can easily view the output of your console log. - // Azure also enables you to see a screenshot of the VM from the hypervisor. - BootDiagnostics *BootDiagnosticsInstanceView `json:"bootDiagnostics,omitempty"` - - // The disks information. - Disks []*DiskInstanceView `json:"disks,omitempty"` - - // The extensions information. - Extensions []*VirtualMachineExtensionInstanceView `json:"extensions,omitempty"` - - // The Maintenance Operation status on the virtual machine. - MaintenanceRedeployStatus *MaintenanceRedeployStatus `json:"maintenanceRedeployStatus,omitempty"` - - // The placement group in which the VM is running. If the VM is deallocated it will not have a placementGroupId. - PlacementGroupID *string `json:"placementGroupId,omitempty"` - - // The Fault Domain count. - PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"` - - // The Update Domain count. - PlatformUpdateDomain *int32 `json:"platformUpdateDomain,omitempty"` - - // The Remote desktop certificate thumbprint. - RdpThumbPrint *string `json:"rdpThumbPrint,omitempty"` - - // The resource status information. - Statuses []*InstanceViewStatus `json:"statuses,omitempty"` - - // The VM Agent running on the virtual machine. - VMAgent *VirtualMachineAgentInstanceView `json:"vmAgent,omitempty"` - - // READ-ONLY; Resource id of the dedicated host, on which the virtual machine is allocated through automatic placement, when - // the virtual machine is associated with a dedicated host group that has automatic - // placement enabled. - // Minimum api-version: 2020-06-01. - AssignedHost *string `json:"assignedHost,omitempty" azure:"ro"` - - // READ-ONLY; The health status for the VM. - VMHealth *VirtualMachineHealthStatus `json:"vmHealth,omitempty" azure:"ro"` -} - -// VirtualMachineScaleSetVMListResult - The List Virtual Machine Scale Set VMs operation response. -type VirtualMachineScaleSetVMListResult struct { - // REQUIRED; The list of virtual machine scale sets VMs. - Value []*VirtualMachineScaleSetVM `json:"value,omitempty"` - - // The uri to fetch the next page of Virtual Machine Scale Set VMs. Call ListNext() with this to fetch the next page of VMSS - // VMs - NextLink *string `json:"nextLink,omitempty"` -} - -// VirtualMachineScaleSetVMNetworkProfileConfiguration - Describes a virtual machine scale set VM network profile. -type VirtualMachineScaleSetVMNetworkProfileConfiguration struct { - // The list of network configurations. - NetworkInterfaceConfigurations []*VirtualMachineScaleSetNetworkConfiguration `json:"networkInterfaceConfigurations,omitempty"` -} - -// VirtualMachineScaleSetVMProfile - Describes a virtual machine scale set virtual machine profile. -type VirtualMachineScaleSetVMProfile struct { - // Specifies the gallery applications that should be made available to the VM/VMSS - ApplicationProfile *ApplicationProfile `json:"applicationProfile,omitempty"` - - // Specifies the billing related details of a Azure Spot VMSS. - // Minimum api-version: 2019-03-01. - BillingProfile *BillingProfile `json:"billingProfile,omitempty"` - - // Specifies the capacity reservation related details of a scale set. - // Minimum api-version: 2021-04-01. - CapacityReservation *CapacityReservationProfile `json:"capacityReservation,omitempty"` - - // Specifies the boot diagnostic settings state. - // Minimum api-version: 2015-06-15. - DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` - - // Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot scale set. - // For Azure Spot virtual machines, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2019-03-01. - // For Azure Spot scale sets, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2017-10-30-preview. - EvictionPolicy *VirtualMachineEvictionPolicyTypes `json:"evictionPolicy,omitempty"` - - // Specifies a collection of settings for extensions installed on virtual machines in the scale set. - ExtensionProfile *VirtualMachineScaleSetExtensionProfile `json:"extensionProfile,omitempty"` - - // Specifies the hardware profile related details of a scale set. - // Minimum api-version: 2022-03-01. - HardwareProfile *VirtualMachineScaleSetHardwareProfile `json:"hardwareProfile,omitempty"` - - // Specifies that the image or disk that is being used was licensed on-premises. - // Possible values for Windows Server operating system are: - // WindowsClient - // WindowsServer - // Possible values for Linux Server operating system are: - // RHELBYOS (for RHEL) - // SLESBYOS (for SUSE) - // For more information, see Azure Hybrid Use Benefit for Windows Server [https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing] - // Azure Hybrid Use Benefit for Linux Server [https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux] - // Minimum api-version: 2015-06-15 - LicenseType *string `json:"licenseType,omitempty"` - - // Specifies properties of the network interfaces of the virtual machines in the scale set. - NetworkProfile *VirtualMachineScaleSetNetworkProfile `json:"networkProfile,omitempty"` - - // Specifies the operating system settings for the virtual machines in the scale set. - OSProfile *VirtualMachineScaleSetOSProfile `json:"osProfile,omitempty"` - - // Specifies the priority for the virtual machines in the scale set. - // Minimum api-version: 2017-10-30-preview - Priority *VirtualMachinePriorityTypes `json:"priority,omitempty"` - - // Specifies Scheduled Event related configurations. - ScheduledEventsProfile *ScheduledEventsProfile `json:"scheduledEventsProfile,omitempty"` - - // Specifies the Security related profile settings for the virtual machines in the scale set. - SecurityProfile *SecurityProfile `json:"securityProfile,omitempty"` - - // Specifies the storage settings for the virtual machine disks. - StorageProfile *VirtualMachineScaleSetStorageProfile `json:"storageProfile,omitempty"` - - // UserData for the virtual machines in the scale set, which must be base-64 encoded. Customer should not pass any secrets - // in here. - // Minimum api-version: 2021-03-01 - UserData *string `json:"userData,omitempty"` -} - -// VirtualMachineScaleSetVMProperties - Describes the properties of a virtual machine scale set virtual machine. -type VirtualMachineScaleSetVMProperties struct { - // Specifies additional capabilities enabled or disabled on the virtual machine in the scale set. For instance: whether the - // virtual machine has the capability to support attaching managed data disks with - // UltraSSD_LRS storage account type. - AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` - - // 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 Availability sets overview [https://docs.microsoft.com/azure/virtual-machines/availability-set-overview]. - // For more information on Azure planned maintenance, see Maintenance and updates for Virtual Machines in Azure [https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates] - // Currently, a VM can only be added to availability set at creation time. An existing VM cannot be added to an availability - // set. - AvailabilitySet *SubResource `json:"availabilitySet,omitempty"` - - // Specifies the boot diagnostic settings state. - // Minimum api-version: 2015-06-15. - DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` - - // Specifies the hardware settings for the virtual machine. - HardwareProfile *HardwareProfile `json:"hardwareProfile,omitempty"` - - // Specifies that the image or disk that is being used was licensed on-premises. - // Possible values for Windows Server operating system are: - // WindowsClient - // WindowsServer - // Possible values for Linux Server operating system are: - // RHELBYOS (for RHEL) - // SLESBYOS (for SUSE) - // For more information, see Azure Hybrid Use Benefit for Windows Server [https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing] - // Azure Hybrid Use Benefit for Linux Server [https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux] - // Minimum api-version: 2015-06-15 - LicenseType *string `json:"licenseType,omitempty"` - - // Specifies the network interfaces of the virtual machine. - NetworkProfile *NetworkProfile `json:"networkProfile,omitempty"` - - // Specifies the network profile configuration of the virtual machine. - NetworkProfileConfiguration *VirtualMachineScaleSetVMNetworkProfileConfiguration `json:"networkProfileConfiguration,omitempty"` - - // Specifies the operating system settings for the virtual machine. - OSProfile *OSProfile `json:"osProfile,omitempty"` - - // Specifies the protection policy of the virtual machine. - ProtectionPolicy *VirtualMachineScaleSetVMProtectionPolicy `json:"protectionPolicy,omitempty"` - - // Specifies the Security related profile settings for the virtual machine. - SecurityProfile *SecurityProfile `json:"securityProfile,omitempty"` - - // Specifies the storage settings for the virtual machine disks. - StorageProfile *StorageProfile `json:"storageProfile,omitempty"` - - // UserData for the VM, which must be base-64 encoded. Customer should not pass any secrets in here. - // Minimum api-version: 2021-03-01 - UserData *string `json:"userData,omitempty"` - - // READ-ONLY; The virtual machine instance view. - InstanceView *VirtualMachineScaleSetVMInstanceView `json:"instanceView,omitempty" azure:"ro"` - - // READ-ONLY; Specifies whether the latest model has been applied to the virtual machine. - LatestModelApplied *bool `json:"latestModelApplied,omitempty" azure:"ro"` - - // READ-ONLY; Specifies whether the model applied to the virtual machine is the model of the virtual machine scale set or - // the customized model for the virtual machine. - ModelDefinitionApplied *string `json:"modelDefinitionApplied,omitempty" azure:"ro"` - - // READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *string `json:"provisioningState,omitempty" azure:"ro"` - - // READ-ONLY; Azure VM unique ID. - VMID *string `json:"vmId,omitempty" azure:"ro"` -} - -// VirtualMachineScaleSetVMProtectionPolicy - The protection policy of a virtual machine scale set VM. -type VirtualMachineScaleSetVMProtectionPolicy struct { - // Indicates that the virtual machine scale set VM shouldn't be considered for deletion during a scale-in operation. - ProtectFromScaleIn *bool `json:"protectFromScaleIn,omitempty"` - - // Indicates that model updates or actions (including scale-in) initiated on the virtual machine scale set should not be applied - // to the virtual machine scale set VM. - ProtectFromScaleSetActions *bool `json:"protectFromScaleSetActions,omitempty"` -} - -// VirtualMachineScaleSetVMReimageParameters - Describes a Virtual Machine Scale Set VM Reimage Parameters. -type VirtualMachineScaleSetVMReimageParameters struct { - // Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage parameter is only supported - // for VM/VMSS with Ephemeral OS disk. - TempDisk *bool `json:"tempDisk,omitempty"` -} - -// VirtualMachineScaleSetVMRunCommandsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineScaleSetVMRunCommandsClient.BeginCreateOrUpdate -// method. -type VirtualMachineScaleSetVMRunCommandsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetVMRunCommandsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineScaleSetVMRunCommandsClient.BeginDelete -// method. -type VirtualMachineScaleSetVMRunCommandsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetVMRunCommandsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineScaleSetVMRunCommandsClient.BeginUpdate -// method. -type VirtualMachineScaleSetVMRunCommandsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetVMRunCommandsClientGetOptions contains the optional parameters for the VirtualMachineScaleSetVMRunCommandsClient.Get -// method. -type VirtualMachineScaleSetVMRunCommandsClientGetOptions struct { - // The expand expression to apply on the operation. - Expand *string -} - -// VirtualMachineScaleSetVMRunCommandsClientListOptions contains the optional parameters for the VirtualMachineScaleSetVMRunCommandsClient.List -// method. -type VirtualMachineScaleSetVMRunCommandsClientListOptions struct { - // The expand expression to apply on the operation. - Expand *string -} - -// VirtualMachineScaleSetVMsClientBeginDeallocateOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginDeallocate -// method. -type VirtualMachineScaleSetVMsClientBeginDeallocateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetVMsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginDelete -// method. -type VirtualMachineScaleSetVMsClientBeginDeleteOptions struct { - // Optional parameter to force delete a virtual machine from a VM scale set. (Feature in Preview) - ForceDeletion *bool - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetVMsClientBeginPerformMaintenanceOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginPerformMaintenance -// method. -type VirtualMachineScaleSetVMsClientBeginPerformMaintenanceOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetVMsClientBeginPowerOffOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginPowerOff -// method. -type VirtualMachineScaleSetVMsClientBeginPowerOffOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string - // The parameter to request non-graceful VM shutdown. True value for this flag indicates non-graceful shutdown whereas false - // indicates otherwise. Default value for this flag is false if not specified - SkipShutdown *bool -} - -// VirtualMachineScaleSetVMsClientBeginRedeployOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginRedeploy -// method. -type VirtualMachineScaleSetVMsClientBeginRedeployOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetVMsClientBeginReimageAllOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginReimageAll -// method. -type VirtualMachineScaleSetVMsClientBeginReimageAllOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetVMsClientBeginReimageOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginReimage -// method. -type VirtualMachineScaleSetVMsClientBeginReimageOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string - // Parameters for the Reimaging Virtual machine in ScaleSet. - VMScaleSetVMReimageInput *VirtualMachineScaleSetVMReimageParameters -} - -// VirtualMachineScaleSetVMsClientBeginRestartOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginRestart -// method. -type VirtualMachineScaleSetVMsClientBeginRestartOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetVMsClientBeginRunCommandOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginRunCommand -// method. -type VirtualMachineScaleSetVMsClientBeginRunCommandOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetVMsClientBeginStartOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginStart -// method. -type VirtualMachineScaleSetVMsClientBeginStartOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetVMsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginUpdate -// method. -type VirtualMachineScaleSetVMsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetVMsClientGetInstanceViewOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.GetInstanceView -// method. -type VirtualMachineScaleSetVMsClientGetInstanceViewOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineScaleSetVMsClientGetOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.Get -// method. -type VirtualMachineScaleSetVMsClientGetOptions struct { - // The expand expression to apply on the operation. 'InstanceView' will retrieve the instance view of the virtual machine. - // 'UserData' will retrieve the UserData of the virtual machine. - Expand *InstanceViewTypes -} - -// VirtualMachineScaleSetVMsClientListOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.List -// method. -type VirtualMachineScaleSetVMsClientListOptions struct { - // The expand expression to apply to the operation. Allowed values are 'instanceView'. - Expand *string - // The filter to apply to the operation. Allowed values are 'startswith(instanceView/statuses/code, 'PowerState') eq true', - // 'properties/latestModelApplied eq true', 'properties/latestModelApplied eq - // false'. - Filter *string - // The list parameters. Allowed values are 'instanceView', 'instanceView/statuses'. - Select *string -} - -// VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.RetrieveBootDiagnosticsData -// method. -type VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataOptions struct { - // Expiration duration in minutes for the SAS URIs with a value between 1 to 1440 minutes. - // NOTE: If not specified, SAS URIs will be generated with a default expiration duration of 120 minutes. - SasURIExpirationTimeInMinutes *int32 -} - -// VirtualMachineScaleSetVMsClientSimulateEvictionOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.SimulateEviction -// method. -type VirtualMachineScaleSetVMsClientSimulateEvictionOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginCreateOrUpdate -// method. -type VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetsClientBeginDeallocateOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginDeallocate -// method. -type VirtualMachineScaleSetsClientBeginDeallocateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string - // A list of virtual machine instance IDs from the VM scale set. - VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs -} - -// VirtualMachineScaleSetsClientBeginDeleteInstancesOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginDeleteInstances -// method. -type VirtualMachineScaleSetsClientBeginDeleteInstancesOptions struct { - // Optional parameter to force delete virtual machines from the VM scale set. (Feature in Preview) - ForceDeletion *bool - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginDelete -// method. -type VirtualMachineScaleSetsClientBeginDeleteOptions struct { - // Optional parameter to force delete a VM scale set. (Feature in Preview) - ForceDeletion *bool - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetsClientBeginPerformMaintenanceOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginPerformMaintenance -// method. -type VirtualMachineScaleSetsClientBeginPerformMaintenanceOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string - // A list of virtual machine instance IDs from the VM scale set. - VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs -} - -// VirtualMachineScaleSetsClientBeginPowerOffOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginPowerOff -// method. -type VirtualMachineScaleSetsClientBeginPowerOffOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string - // The parameter to request non-graceful VM shutdown. True value for this flag indicates non-graceful shutdown whereas false - // indicates otherwise. Default value for this flag is false if not specified - SkipShutdown *bool - // A list of virtual machine instance IDs from the VM scale set. - VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs -} - -// VirtualMachineScaleSetsClientBeginRedeployOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginRedeploy -// method. -type VirtualMachineScaleSetsClientBeginRedeployOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string - // A list of virtual machine instance IDs from the VM scale set. - VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs -} - -// VirtualMachineScaleSetsClientBeginReimageAllOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginReimageAll -// method. -type VirtualMachineScaleSetsClientBeginReimageAllOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string - // A list of virtual machine instance IDs from the VM scale set. - VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs -} - -// VirtualMachineScaleSetsClientBeginReimageOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginReimage -// method. -type VirtualMachineScaleSetsClientBeginReimageOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string - // Parameters for Reimaging VM ScaleSet. - VMScaleSetReimageInput *VirtualMachineScaleSetReimageParameters -} - -// VirtualMachineScaleSetsClientBeginRestartOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginRestart -// method. -type VirtualMachineScaleSetsClientBeginRestartOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string - // A list of virtual machine instance IDs from the VM scale set. - VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs -} - -// VirtualMachineScaleSetsClientBeginSetOrchestrationServiceStateOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginSetOrchestrationServiceState -// method. -type VirtualMachineScaleSetsClientBeginSetOrchestrationServiceStateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetsClientBeginStartOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginStart -// method. -type VirtualMachineScaleSetsClientBeginStartOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string - // A list of virtual machine instance IDs from the VM scale set. - VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs -} - -// VirtualMachineScaleSetsClientBeginUpdateInstancesOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginUpdateInstances -// method. -type VirtualMachineScaleSetsClientBeginUpdateInstancesOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginUpdate -// method. -type VirtualMachineScaleSetsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetsClientConvertToSinglePlacementGroupOptions contains the optional parameters for the VirtualMachineScaleSetsClient.ConvertToSinglePlacementGroup -// method. -type VirtualMachineScaleSetsClientConvertToSinglePlacementGroupOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkOptions contains the optional parameters -// for the VirtualMachineScaleSetsClient.ForceRecoveryServiceFabricPlatformUpdateDomainWalk method. -type VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkOptions struct { - // The placement group id for which the manual recovery walk is requested. - PlacementGroupID *string - // The zone in which the manual recovery walk is requested for cross zone virtual machine scale set - Zone *string -} - -// VirtualMachineScaleSetsClientGetInstanceViewOptions contains the optional parameters for the VirtualMachineScaleSetsClient.GetInstanceView -// method. -type VirtualMachineScaleSetsClientGetInstanceViewOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineScaleSetsClientGetOSUpgradeHistoryOptions contains the optional parameters for the VirtualMachineScaleSetsClient.GetOSUpgradeHistory -// method. -type VirtualMachineScaleSetsClientGetOSUpgradeHistoryOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineScaleSetsClientGetOptions contains the optional parameters for the VirtualMachineScaleSetsClient.Get method. -type VirtualMachineScaleSetsClientGetOptions struct { - // The expand expression to apply on the operation. 'UserData' retrieves the UserData property of the VM scale set that was - // provided by the user during the VM scale set Create/Update operation - Expand *ExpandTypesForGetVMScaleSets -} - -// VirtualMachineScaleSetsClientListAllOptions contains the optional parameters for the VirtualMachineScaleSetsClient.ListAll -// method. -type VirtualMachineScaleSetsClientListAllOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineScaleSetsClientListByLocationOptions contains the optional parameters for the VirtualMachineScaleSetsClient.ListByLocation -// method. -type VirtualMachineScaleSetsClientListByLocationOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineScaleSetsClientListOptions contains the optional parameters for the VirtualMachineScaleSetsClient.List method. -type VirtualMachineScaleSetsClientListOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineScaleSetsClientListSKUsOptions contains the optional parameters for the VirtualMachineScaleSetsClient.ListSKUs -// method. -type VirtualMachineScaleSetsClientListSKUsOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineSize - Describes the properties of a VM size. -type VirtualMachineSize struct { - // The maximum number of data disks that can be attached to the virtual machine size. - MaxDataDiskCount *int32 `json:"maxDataDiskCount,omitempty"` - - // The amount of memory, in MB, supported by the virtual machine size. - MemoryInMB *int32 `json:"memoryInMB,omitempty"` - - // The name of the virtual machine size. - Name *string `json:"name,omitempty"` - - // The number of cores supported by the virtual machine size. For Constrained vCPU capable VM sizes, this number represents - // the total vCPUs of quota that the VM uses. For accurate vCPU count, please - // refer to https://docs.microsoft.com/azure/virtual-machines/constrained-vcpu or https://docs.microsoft.com/rest/api/compute/resourceskus/list - NumberOfCores *int32 `json:"numberOfCores,omitempty"` - - // The OS disk size, in MB, allowed by the virtual machine size. - OSDiskSizeInMB *int32 `json:"osDiskSizeInMB,omitempty"` - - // The resource disk size, in MB, allowed by the virtual machine size. - ResourceDiskSizeInMB *int32 `json:"resourceDiskSizeInMB,omitempty"` -} - -// VirtualMachineSizeListResult - The List Virtual Machine operation response. -type VirtualMachineSizeListResult struct { - // The list of virtual machine sizes. - Value []*VirtualMachineSize `json:"value,omitempty"` -} - -// VirtualMachineSizesClientListOptions contains the optional parameters for the VirtualMachineSizesClient.List method. -type VirtualMachineSizesClientListOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineSoftwarePatchProperties - Describes the properties of a Virtual Machine software patch. -type VirtualMachineSoftwarePatchProperties struct { - // READ-ONLY; The activity ID of the operation that produced this result. It is used to correlate across CRP and extension - // logs. - ActivityID *string `json:"activityId,omitempty" azure:"ro"` - - // READ-ONLY; Describes the availability of a given patch. - AssessmentState *PatchAssessmentState `json:"assessmentState,omitempty" azure:"ro"` - - // READ-ONLY; The classification(s) of the patch as provided by the patch publisher. - Classifications []*string `json:"classifications,omitempty" azure:"ro"` - - // READ-ONLY; The KBID of the patch. Only applies to Windows patches. - KbID *string `json:"kbId,omitempty" azure:"ro"` - - // READ-ONLY; The UTC timestamp of the last update to this patch record. - LastModifiedDateTime *time.Time `json:"lastModifiedDateTime,omitempty" azure:"ro"` - - // READ-ONLY; The friendly name of the patch. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; A unique identifier for the patch. - PatchID *string `json:"patchId,omitempty" azure:"ro"` - - // READ-ONLY; The UTC timestamp when the repository published this patch. - PublishedDate *time.Time `json:"publishedDate,omitempty" azure:"ro"` - - // READ-ONLY; Describes the reboot requirements of the patch. - RebootBehavior *VMGuestPatchRebootBehavior `json:"rebootBehavior,omitempty" azure:"ro"` - - // READ-ONLY; The version number of the patch. This property applies only to Linux patches. - Version *string `json:"version,omitempty" azure:"ro"` -} - -// VirtualMachineStatusCodeCount - The status code and count of the virtual machine scale set instance view status summary. -type VirtualMachineStatusCodeCount struct { - // READ-ONLY; The instance view status code. - Code *string `json:"code,omitempty" azure:"ro"` - - // READ-ONLY; The number of instances having a particular status code. - Count *int32 `json:"count,omitempty" azure:"ro"` -} - -// VirtualMachineUpdate - Describes a Virtual Machine Update. -type VirtualMachineUpdate struct { - // The identity of the virtual machine, if configured. - Identity *VirtualMachineIdentity `json:"identity,omitempty"` - - // 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"` - - // Describes the properties of a Virtual Machine. - Properties *VirtualMachineProperties `json:"properties,omitempty"` - - // Resource tags - Tags map[string]*string `json:"tags,omitempty"` - - // The virtual machine zones. - Zones []*string `json:"zones,omitempty"` -} - -// VirtualMachinesClientBeginAssessPatchesOptions contains the optional parameters for the VirtualMachinesClient.BeginAssessPatches -// method. -type VirtualMachinesClientBeginAssessPatchesOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachinesClientBeginCaptureOptions contains the optional parameters for the VirtualMachinesClient.BeginCapture method. -type VirtualMachinesClientBeginCaptureOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachinesClientBeginConvertToManagedDisksOptions contains the optional parameters for the VirtualMachinesClient.BeginConvertToManagedDisks -// method. -type VirtualMachinesClientBeginConvertToManagedDisksOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachinesClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachinesClient.BeginCreateOrUpdate -// method. -type VirtualMachinesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachinesClientBeginDeallocateOptions contains the optional parameters for the VirtualMachinesClient.BeginDeallocate -// method. -type VirtualMachinesClientBeginDeallocateOptions struct { - // Optional parameter to hibernate a virtual machine. (Feature in Preview) - Hibernate *bool - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachinesClientBeginDeleteOptions contains the optional parameters for the VirtualMachinesClient.BeginDelete method. -type VirtualMachinesClientBeginDeleteOptions struct { - // Optional parameter to force delete virtual machines. - ForceDeletion *bool - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachinesClientBeginInstallPatchesOptions contains the optional parameters for the VirtualMachinesClient.BeginInstallPatches -// method. -type VirtualMachinesClientBeginInstallPatchesOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachinesClientBeginPerformMaintenanceOptions contains the optional parameters for the VirtualMachinesClient.BeginPerformMaintenance -// method. -type VirtualMachinesClientBeginPerformMaintenanceOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachinesClientBeginPowerOffOptions contains the optional parameters for the VirtualMachinesClient.BeginPowerOff -// method. -type VirtualMachinesClientBeginPowerOffOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string - // The parameter to request non-graceful VM shutdown. True value for this flag indicates non-graceful shutdown whereas false - // indicates otherwise. Default value for this flag is false if not specified - SkipShutdown *bool -} - -// VirtualMachinesClientBeginReapplyOptions contains the optional parameters for the VirtualMachinesClient.BeginReapply method. -type VirtualMachinesClientBeginReapplyOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachinesClientBeginRedeployOptions contains the optional parameters for the VirtualMachinesClient.BeginRedeploy -// method. -type VirtualMachinesClientBeginRedeployOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachinesClientBeginReimageOptions contains the optional parameters for the VirtualMachinesClient.BeginReimage method. -type VirtualMachinesClientBeginReimageOptions struct { - // Parameters supplied to the Reimage Virtual Machine operation. - Parameters *VirtualMachineReimageParameters - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachinesClientBeginRestartOptions contains the optional parameters for the VirtualMachinesClient.BeginRestart method. -type VirtualMachinesClientBeginRestartOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachinesClientBeginRunCommandOptions contains the optional parameters for the VirtualMachinesClient.BeginRunCommand -// method. -type VirtualMachinesClientBeginRunCommandOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachinesClientBeginStartOptions contains the optional parameters for the VirtualMachinesClient.BeginStart method. -type VirtualMachinesClientBeginStartOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachinesClientBeginUpdateOptions contains the optional parameters for the VirtualMachinesClient.BeginUpdate method. -type VirtualMachinesClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachinesClientGeneralizeOptions contains the optional parameters for the VirtualMachinesClient.Generalize method. -type VirtualMachinesClientGeneralizeOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachinesClientGetOptions contains the optional parameters for the VirtualMachinesClient.Get method. -type VirtualMachinesClientGetOptions struct { - // The expand expression to apply on the operation. 'InstanceView' retrieves a snapshot of the runtime properties of the virtual - // machine that is managed by the platform and can change outside of control - // plane operations. 'UserData' retrieves the UserData property as part of the VM model view that was provided by the user - // during the VM Create/Update operation. - Expand *InstanceViewTypes -} - -// VirtualMachinesClientInstanceViewOptions contains the optional parameters for the VirtualMachinesClient.InstanceView method. -type VirtualMachinesClientInstanceViewOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachinesClientListAllOptions contains the optional parameters for the VirtualMachinesClient.ListAll method. -type VirtualMachinesClientListAllOptions struct { - // The system query option to filter VMs returned in the response. Allowed value is 'virtualMachineScaleSet/id' eq - // /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}' - Filter *string - // statusOnly=true enables fetching run time status of all Virtual Machines in the subscription. - StatusOnly *string -} - -// VirtualMachinesClientListAvailableSizesOptions contains the optional parameters for the VirtualMachinesClient.ListAvailableSizes -// method. -type VirtualMachinesClientListAvailableSizesOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachinesClientListByLocationOptions contains the optional parameters for the VirtualMachinesClient.ListByLocation -// method. -type VirtualMachinesClientListByLocationOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachinesClientListOptions contains the optional parameters for the VirtualMachinesClient.List method. -type VirtualMachinesClientListOptions struct { - // The system query option to filter VMs returned in the response. Allowed value is 'virtualMachineScaleSet/id' eq - // /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}' - Filter *string -} - -// VirtualMachinesClientRetrieveBootDiagnosticsDataOptions contains the optional parameters for the VirtualMachinesClient.RetrieveBootDiagnosticsData -// method. -type VirtualMachinesClientRetrieveBootDiagnosticsDataOptions struct { - // Expiration duration in minutes for the SAS URIs with a value between 1 to 1440 minutes. - // NOTE: If not specified, SAS URIs will be generated with a default expiration duration of 120 minutes. - SasURIExpirationTimeInMinutes *int32 -} - -// VirtualMachinesClientSimulateEvictionOptions contains the optional parameters for the VirtualMachinesClient.SimulateEviction -// method. -type VirtualMachinesClientSimulateEvictionOptions struct { - // placeholder for future optional parameters -} - -// WinRMConfiguration - Describes Windows Remote Management configuration of the VM -type WinRMConfiguration struct { - // The list of Windows Remote Management listeners - Listeners []*WinRMListener `json:"listeners,omitempty"` -} - -// WinRMListener - Describes Protocol and thumbprint of Windows Remote Management listener -type WinRMListener struct { - // 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":"" - // } - // To install certificates on a virtual machine it is recommended to use the Azure Key Vault virtual machine extension for - // Linux - // [https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux] or the Azure Key Vault virtual machine extension - // for Windows - // [https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows]. - CertificateURL *string `json:"certificateUrl,omitempty"` - - // Specifies the protocol of WinRM listener. - // Possible values are: - // http - // https - Protocol *ProtocolTypes `json:"protocol,omitempty"` -} - -// WindowsConfiguration - Specifies Windows operating system settings on the virtual machine. -type WindowsConfiguration struct { - // Specifies additional base-64 encoded XML formatted information that can be included in the Unattend.xml file, which is - // used by Windows Setup. - AdditionalUnattendContent []*AdditionalUnattendContent `json:"additionalUnattendContent,omitempty"` - - // Indicates whether Automatic Updates is enabled for the Windows virtual machine. Default value is true. - // For virtual machine scale sets, this property can be updated and updates will take effect on OS reprovisioning. - EnableAutomaticUpdates *bool `json:"enableAutomaticUpdates,omitempty"` - - // [Preview Feature] Specifies settings related to VM Guest Patching on Windows. - PatchSettings *PatchSettings `json:"patchSettings,omitempty"` - - // 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. - ProvisionVMAgent *bool `json:"provisionVMAgent,omitempty"` - - // Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time". - // Possible values can be TimeZoneInfo.Id [https://docs.microsoft.com/dotnet/api/system.timezoneinfo.id?#System_TimeZoneInfo_Id] - // value from time zones returned by TimeZoneInfo.GetSystemTimeZones - // [https://docs.microsoft.com/dotnet/api/system.timezoneinfo.getsystemtimezones]. - TimeZone *string `json:"timeZone,omitempty"` - - // Specifies the Windows Remote Management listeners. This enables remote Windows PowerShell. - WinRM *WinRMConfiguration `json:"winRM,omitempty"` -} - -// WindowsParameters - Input for InstallPatches on a Windows VM, as directly received by the API -type WindowsParameters struct { - // The update classifications to select when installing patches for Windows. - ClassificationsToInclude []*VMGuestPatchClassificationWindows `json:"classificationsToInclude,omitempty"` - - // Filters out Kbs that don't have an InstallationRebootBehavior of 'NeverReboots' when this is set to true. - ExcludeKbsRequiringReboot *bool `json:"excludeKbsRequiringReboot,omitempty"` - - // Kbs to exclude in the patch operation - KbNumbersToExclude []*string `json:"kbNumbersToExclude,omitempty"` - - // Kbs to include in the patch operation - KbNumbersToInclude []*string `json:"kbNumbersToInclude,omitempty"` - - // This is used to install patches that were published on or before this given max published date. - MaxPatchPublishDate *time.Time `json:"maxPatchPublishDate,omitempty"` -} - -// WindowsVMGuestPatchAutomaticByPlatformSettings - Specifies additional settings to be applied when patch mode AutomaticByPlatform -// is selected in Windows patch settings. -type WindowsVMGuestPatchAutomaticByPlatformSettings struct { - // Specifies the reboot setting for all AutomaticByPlatform patch installation operations. - RebootSetting *WindowsVMGuestPatchAutomaticByPlatformRebootSetting `json:"rebootSetting,omitempty"` -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_models_serde.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_models_serde.go deleted file mode 100644 index 3de39856..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_models_serde.go +++ /dev/null @@ -1,3416 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" -) - -// MarshalJSON implements the json.Marshaller interface for type APIError. -func (a APIError) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "code", a.Code) - populate(objectMap, "details", a.Details) - populate(objectMap, "innererror", a.Innererror) - populate(objectMap, "message", a.Message) - populate(objectMap, "target", a.Target) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationProfile. -func (a ApplicationProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "galleryApplications", a.GalleryApplications) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type AvailabilitySet. -func (a AvailabilitySet) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", a.ID) - populate(objectMap, "location", a.Location) - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "sku", a.SKU) - populate(objectMap, "tags", a.Tags) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type AvailabilitySetProperties. -func (a AvailabilitySetProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "platformFaultDomainCount", a.PlatformFaultDomainCount) - populate(objectMap, "platformUpdateDomainCount", a.PlatformUpdateDomainCount) - populate(objectMap, "proximityPlacementGroup", a.ProximityPlacementGroup) - populate(objectMap, "statuses", a.Statuses) - populate(objectMap, "virtualMachines", a.VirtualMachines) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type AvailabilitySetUpdate. -func (a AvailabilitySetUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "sku", a.SKU) - populate(objectMap, "tags", a.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type AvailablePatchSummary. -func (a AvailablePatchSummary) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "assessmentActivityId", a.AssessmentActivityID) - populate(objectMap, "criticalAndSecurityPatchCount", a.CriticalAndSecurityPatchCount) - populate(objectMap, "error", a.Error) - populateTimeRFC3339(objectMap, "lastModifiedTime", a.LastModifiedTime) - populate(objectMap, "otherPatchCount", a.OtherPatchCount) - populate(objectMap, "rebootPending", a.RebootPending) - populateTimeRFC3339(objectMap, "startTime", a.StartTime) - populate(objectMap, "status", a.Status) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AvailablePatchSummary. -func (a *AvailablePatchSummary) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "assessmentActivityId": - err = unpopulate(val, "AssessmentActivityID", &a.AssessmentActivityID) - delete(rawMsg, key) - case "criticalAndSecurityPatchCount": - err = unpopulate(val, "CriticalAndSecurityPatchCount", &a.CriticalAndSecurityPatchCount) - delete(rawMsg, key) - case "error": - err = unpopulate(val, "Error", &a.Error) - delete(rawMsg, key) - case "lastModifiedTime": - err = unpopulateTimeRFC3339(val, "LastModifiedTime", &a.LastModifiedTime) - delete(rawMsg, key) - case "otherPatchCount": - err = unpopulate(val, "OtherPatchCount", &a.OtherPatchCount) - delete(rawMsg, key) - case "rebootPending": - err = unpopulate(val, "RebootPending", &a.RebootPending) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &a.StartTime) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &a.Status) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CapacityReservation. -func (c CapacityReservation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", c.ID) - populate(objectMap, "location", c.Location) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "sku", c.SKU) - populate(objectMap, "tags", c.Tags) - populate(objectMap, "type", c.Type) - populate(objectMap, "zones", c.Zones) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type CapacityReservationGroup. -func (c CapacityReservationGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", c.ID) - populate(objectMap, "location", c.Location) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "tags", c.Tags) - populate(objectMap, "type", c.Type) - populate(objectMap, "zones", c.Zones) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type CapacityReservationGroupInstanceView. -func (c CapacityReservationGroupInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "capacityReservations", c.CapacityReservations) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type CapacityReservationGroupProperties. -func (c CapacityReservationGroupProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "capacityReservations", c.CapacityReservations) - populate(objectMap, "instanceView", c.InstanceView) - populate(objectMap, "virtualMachinesAssociated", c.VirtualMachinesAssociated) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type CapacityReservationGroupUpdate. -func (c CapacityReservationGroupUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "tags", c.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type CapacityReservationInstanceView. -func (c CapacityReservationInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "statuses", c.Statuses) - populate(objectMap, "utilizationInfo", c.UtilizationInfo) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type CapacityReservationInstanceViewWithName. -func (c CapacityReservationInstanceViewWithName) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "name", c.Name) - populate(objectMap, "statuses", c.Statuses) - populate(objectMap, "utilizationInfo", c.UtilizationInfo) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type CapacityReservationProperties. -func (c CapacityReservationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "instanceView", c.InstanceView) - populate(objectMap, "provisioningState", c.ProvisioningState) - populateTimeRFC3339(objectMap, "provisioningTime", c.ProvisioningTime) - populate(objectMap, "reservationId", c.ReservationID) - populateTimeRFC3339(objectMap, "timeCreated", c.TimeCreated) - populate(objectMap, "virtualMachinesAssociated", c.VirtualMachinesAssociated) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CapacityReservationProperties. -func (c *CapacityReservationProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "instanceView": - err = unpopulate(val, "InstanceView", &c.InstanceView) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) - delete(rawMsg, key) - case "provisioningTime": - err = unpopulateTimeRFC3339(val, "ProvisioningTime", &c.ProvisioningTime) - delete(rawMsg, key) - case "reservationId": - err = unpopulate(val, "ReservationID", &c.ReservationID) - delete(rawMsg, key) - case "timeCreated": - err = unpopulateTimeRFC3339(val, "TimeCreated", &c.TimeCreated) - delete(rawMsg, key) - case "virtualMachinesAssociated": - err = unpopulate(val, "VirtualMachinesAssociated", &c.VirtualMachinesAssociated) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CapacityReservationUpdate. -func (c CapacityReservationUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "sku", c.SKU) - populate(objectMap, "tags", c.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type CapacityReservationUtilization. -func (c CapacityReservationUtilization) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "virtualMachinesAllocated", c.VirtualMachinesAllocated) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type CloudService. -func (c CloudService) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", c.ID) - populate(objectMap, "location", c.Location) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "tags", c.Tags) - populate(objectMap, "type", c.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type CloudServiceExtensionProfile. -func (c CloudServiceExtensionProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "extensions", c.Extensions) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type CloudServiceExtensionProperties. -func (c CloudServiceExtensionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "autoUpgradeMinorVersion", c.AutoUpgradeMinorVersion) - populate(objectMap, "forceUpdateTag", c.ForceUpdateTag) - populate(objectMap, "protectedSettings", c.ProtectedSettings) - populate(objectMap, "protectedSettingsFromKeyVault", c.ProtectedSettingsFromKeyVault) - populate(objectMap, "provisioningState", c.ProvisioningState) - populate(objectMap, "publisher", c.Publisher) - populate(objectMap, "rolesAppliedTo", c.RolesAppliedTo) - populate(objectMap, "settings", c.Settings) - populate(objectMap, "type", c.Type) - populate(objectMap, "typeHandlerVersion", c.TypeHandlerVersion) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type CloudServiceNetworkProfile. -func (c CloudServiceNetworkProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "loadBalancerConfigurations", c.LoadBalancerConfigurations) - populate(objectMap, "swappableCloudService", c.SwappableCloudService) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type CloudServiceOsProfile. -func (c CloudServiceOsProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "secrets", c.Secrets) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type CloudServiceRoleProfile. -func (c CloudServiceRoleProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "roles", c.Roles) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type CloudServiceUpdate. -func (c CloudServiceUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "tags", c.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type CloudServiceVaultSecretGroup. -func (c CloudServiceVaultSecretGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "sourceVault", c.SourceVault) - populate(objectMap, "vaultCertificates", c.VaultCertificates) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CommunityGalleryImageProperties. -func (c *CommunityGalleryImageProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "disallowed": - err = unpopulate(val, "Disallowed", &c.Disallowed) - delete(rawMsg, key) - case "endOfLifeDate": - err = unpopulateTimeRFC3339(val, "EndOfLifeDate", &c.EndOfLifeDate) - delete(rawMsg, key) - case "features": - err = unpopulate(val, "Features", &c.Features) - delete(rawMsg, key) - case "hyperVGeneration": - err = unpopulate(val, "HyperVGeneration", &c.HyperVGeneration) - delete(rawMsg, key) - case "identifier": - err = unpopulate(val, "Identifier", &c.Identifier) - delete(rawMsg, key) - case "osState": - err = unpopulate(val, "OSState", &c.OSState) - delete(rawMsg, key) - case "osType": - err = unpopulate(val, "OSType", &c.OSType) - delete(rawMsg, key) - case "purchasePlan": - err = unpopulate(val, "PurchasePlan", &c.PurchasePlan) - delete(rawMsg, key) - case "recommended": - err = unpopulate(val, "Recommended", &c.Recommended) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CommunityGalleryImageVersionProperties. -func (c *CommunityGalleryImageVersionProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "endOfLifeDate": - err = unpopulateTimeRFC3339(val, "EndOfLifeDate", &c.EndOfLifeDate) - delete(rawMsg, key) - case "publishedDate": - err = unpopulateTimeRFC3339(val, "PublishedDate", &c.PublishedDate) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DedicatedHost. -func (d DedicatedHost) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", d.ID) - populate(objectMap, "location", d.Location) - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "sku", d.SKU) - populate(objectMap, "tags", d.Tags) - populate(objectMap, "type", d.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type DedicatedHostAvailableCapacity. -func (d DedicatedHostAvailableCapacity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "allocatableVMs", d.AllocatableVMs) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type DedicatedHostGroup. -func (d DedicatedHostGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", d.ID) - populate(objectMap, "location", d.Location) - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "tags", d.Tags) - populate(objectMap, "type", d.Type) - populate(objectMap, "zones", d.Zones) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type DedicatedHostGroupInstanceView. -func (d DedicatedHostGroupInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "hosts", d.Hosts) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type DedicatedHostGroupProperties. -func (d DedicatedHostGroupProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "additionalCapabilities", d.AdditionalCapabilities) - populate(objectMap, "hosts", d.Hosts) - populate(objectMap, "instanceView", d.InstanceView) - populate(objectMap, "platformFaultDomainCount", d.PlatformFaultDomainCount) - populate(objectMap, "supportAutomaticPlacement", d.SupportAutomaticPlacement) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type DedicatedHostGroupUpdate. -func (d DedicatedHostGroupUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "tags", d.Tags) - populate(objectMap, "zones", d.Zones) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type DedicatedHostInstanceView. -func (d DedicatedHostInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "assetId", d.AssetID) - populate(objectMap, "availableCapacity", d.AvailableCapacity) - populate(objectMap, "statuses", d.Statuses) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type DedicatedHostInstanceViewWithName. -func (d DedicatedHostInstanceViewWithName) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "assetId", d.AssetID) - populate(objectMap, "availableCapacity", d.AvailableCapacity) - populate(objectMap, "name", d.Name) - populate(objectMap, "statuses", d.Statuses) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type DedicatedHostProperties. -func (d DedicatedHostProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "autoReplaceOnFailure", d.AutoReplaceOnFailure) - populate(objectMap, "hostId", d.HostID) - populate(objectMap, "instanceView", d.InstanceView) - populate(objectMap, "licenseType", d.LicenseType) - populate(objectMap, "platformFaultDomain", d.PlatformFaultDomain) - populate(objectMap, "provisioningState", d.ProvisioningState) - populateTimeRFC3339(objectMap, "provisioningTime", d.ProvisioningTime) - populateTimeRFC3339(objectMap, "timeCreated", d.TimeCreated) - populate(objectMap, "virtualMachines", d.VirtualMachines) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHostProperties. -func (d *DedicatedHostProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "autoReplaceOnFailure": - err = unpopulate(val, "AutoReplaceOnFailure", &d.AutoReplaceOnFailure) - delete(rawMsg, key) - case "hostId": - err = unpopulate(val, "HostID", &d.HostID) - delete(rawMsg, key) - case "instanceView": - err = unpopulate(val, "InstanceView", &d.InstanceView) - delete(rawMsg, key) - case "licenseType": - err = unpopulate(val, "LicenseType", &d.LicenseType) - delete(rawMsg, key) - case "platformFaultDomain": - err = unpopulate(val, "PlatformFaultDomain", &d.PlatformFaultDomain) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) - delete(rawMsg, key) - case "provisioningTime": - err = unpopulateTimeRFC3339(val, "ProvisioningTime", &d.ProvisioningTime) - delete(rawMsg, key) - case "timeCreated": - err = unpopulateTimeRFC3339(val, "TimeCreated", &d.TimeCreated) - delete(rawMsg, key) - case "virtualMachines": - err = unpopulate(val, "VirtualMachines", &d.VirtualMachines) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DedicatedHostUpdate. -func (d DedicatedHostUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "tags", d.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type Disallowed. -func (d Disallowed) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "diskTypes", d.DiskTypes) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type Disk. -func (d Disk) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "extendedLocation", d.ExtendedLocation) - populate(objectMap, "id", d.ID) - populate(objectMap, "location", d.Location) - populate(objectMap, "managedBy", d.ManagedBy) - populate(objectMap, "managedByExtended", d.ManagedByExtended) - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "sku", d.SKU) - populate(objectMap, "tags", d.Tags) - populate(objectMap, "type", d.Type) - populate(objectMap, "zones", d.Zones) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type DiskAccess. -func (d DiskAccess) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "extendedLocation", d.ExtendedLocation) - populate(objectMap, "id", d.ID) - populate(objectMap, "location", d.Location) - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "tags", d.Tags) - populate(objectMap, "type", d.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type DiskAccessProperties. -func (d DiskAccessProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "privateEndpointConnections", d.PrivateEndpointConnections) - populate(objectMap, "provisioningState", d.ProvisioningState) - populateTimeRFC3339(objectMap, "timeCreated", d.TimeCreated) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiskAccessProperties. -func (d *DiskAccessProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "privateEndpointConnections": - err = unpopulate(val, "PrivateEndpointConnections", &d.PrivateEndpointConnections) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) - delete(rawMsg, key) - case "timeCreated": - err = unpopulateTimeRFC3339(val, "TimeCreated", &d.TimeCreated) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DiskAccessUpdate. -func (d DiskAccessUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "tags", d.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type DiskEncryptionSet. -func (d DiskEncryptionSet) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", d.ID) - populate(objectMap, "identity", d.Identity) - populate(objectMap, "location", d.Location) - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "tags", d.Tags) - populate(objectMap, "type", d.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type DiskEncryptionSetUpdate. -func (d DiskEncryptionSetUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "identity", d.Identity) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "tags", d.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type DiskInstanceView. -func (d DiskInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "encryptionSettings", d.EncryptionSettings) - populate(objectMap, "name", d.Name) - populate(objectMap, "statuses", d.Statuses) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type DiskProperties. -func (d DiskProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "burstingEnabled", d.BurstingEnabled) - populate(objectMap, "completionPercent", d.CompletionPercent) - populate(objectMap, "creationData", d.CreationData) - populate(objectMap, "dataAccessAuthMode", d.DataAccessAuthMode) - populate(objectMap, "diskAccessId", d.DiskAccessID) - populate(objectMap, "diskIOPSReadOnly", d.DiskIOPSReadOnly) - populate(objectMap, "diskIOPSReadWrite", d.DiskIOPSReadWrite) - populate(objectMap, "diskMBpsReadOnly", d.DiskMBpsReadOnly) - populate(objectMap, "diskMBpsReadWrite", d.DiskMBpsReadWrite) - populate(objectMap, "diskSizeBytes", d.DiskSizeBytes) - populate(objectMap, "diskSizeGB", d.DiskSizeGB) - populate(objectMap, "diskState", d.DiskState) - populate(objectMap, "encryption", d.Encryption) - populate(objectMap, "encryptionSettingsCollection", d.EncryptionSettingsCollection) - populate(objectMap, "hyperVGeneration", d.HyperVGeneration) - populate(objectMap, "maxShares", d.MaxShares) - populate(objectMap, "networkAccessPolicy", d.NetworkAccessPolicy) - populate(objectMap, "osType", d.OSType) - populate(objectMap, "propertyUpdatesInProgress", d.PropertyUpdatesInProgress) - populate(objectMap, "provisioningState", d.ProvisioningState) - populate(objectMap, "publicNetworkAccess", d.PublicNetworkAccess) - populate(objectMap, "purchasePlan", d.PurchasePlan) - populate(objectMap, "securityProfile", d.SecurityProfile) - populate(objectMap, "shareInfo", d.ShareInfo) - populate(objectMap, "supportedCapabilities", d.SupportedCapabilities) - populate(objectMap, "supportsHibernation", d.SupportsHibernation) - populate(objectMap, "tier", d.Tier) - populateTimeRFC3339(objectMap, "timeCreated", d.TimeCreated) - populate(objectMap, "uniqueId", d.UniqueID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiskProperties. -func (d *DiskProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "burstingEnabled": - err = unpopulate(val, "BurstingEnabled", &d.BurstingEnabled) - delete(rawMsg, key) - case "completionPercent": - err = unpopulate(val, "CompletionPercent", &d.CompletionPercent) - delete(rawMsg, key) - case "creationData": - err = unpopulate(val, "CreationData", &d.CreationData) - delete(rawMsg, key) - case "dataAccessAuthMode": - err = unpopulate(val, "DataAccessAuthMode", &d.DataAccessAuthMode) - delete(rawMsg, key) - case "diskAccessId": - err = unpopulate(val, "DiskAccessID", &d.DiskAccessID) - delete(rawMsg, key) - case "diskIOPSReadOnly": - err = unpopulate(val, "DiskIOPSReadOnly", &d.DiskIOPSReadOnly) - delete(rawMsg, key) - case "diskIOPSReadWrite": - err = unpopulate(val, "DiskIOPSReadWrite", &d.DiskIOPSReadWrite) - delete(rawMsg, key) - case "diskMBpsReadOnly": - err = unpopulate(val, "DiskMBpsReadOnly", &d.DiskMBpsReadOnly) - delete(rawMsg, key) - case "diskMBpsReadWrite": - err = unpopulate(val, "DiskMBpsReadWrite", &d.DiskMBpsReadWrite) - delete(rawMsg, key) - case "diskSizeBytes": - err = unpopulate(val, "DiskSizeBytes", &d.DiskSizeBytes) - delete(rawMsg, key) - case "diskSizeGB": - err = unpopulate(val, "DiskSizeGB", &d.DiskSizeGB) - delete(rawMsg, key) - case "diskState": - err = unpopulate(val, "DiskState", &d.DiskState) - delete(rawMsg, key) - case "encryption": - err = unpopulate(val, "Encryption", &d.Encryption) - delete(rawMsg, key) - case "encryptionSettingsCollection": - err = unpopulate(val, "EncryptionSettingsCollection", &d.EncryptionSettingsCollection) - delete(rawMsg, key) - case "hyperVGeneration": - err = unpopulate(val, "HyperVGeneration", &d.HyperVGeneration) - delete(rawMsg, key) - case "maxShares": - err = unpopulate(val, "MaxShares", &d.MaxShares) - delete(rawMsg, key) - case "networkAccessPolicy": - err = unpopulate(val, "NetworkAccessPolicy", &d.NetworkAccessPolicy) - delete(rawMsg, key) - case "osType": - err = unpopulate(val, "OSType", &d.OSType) - delete(rawMsg, key) - case "propertyUpdatesInProgress": - err = unpopulate(val, "PropertyUpdatesInProgress", &d.PropertyUpdatesInProgress) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) - delete(rawMsg, key) - case "publicNetworkAccess": - err = unpopulate(val, "PublicNetworkAccess", &d.PublicNetworkAccess) - delete(rawMsg, key) - case "purchasePlan": - err = unpopulate(val, "PurchasePlan", &d.PurchasePlan) - delete(rawMsg, key) - case "securityProfile": - err = unpopulate(val, "SecurityProfile", &d.SecurityProfile) - delete(rawMsg, key) - case "shareInfo": - err = unpopulate(val, "ShareInfo", &d.ShareInfo) - delete(rawMsg, key) - case "supportedCapabilities": - err = unpopulate(val, "SupportedCapabilities", &d.SupportedCapabilities) - delete(rawMsg, key) - case "supportsHibernation": - err = unpopulate(val, "SupportsHibernation", &d.SupportsHibernation) - delete(rawMsg, key) - case "tier": - err = unpopulate(val, "Tier", &d.Tier) - delete(rawMsg, key) - case "timeCreated": - err = unpopulateTimeRFC3339(val, "TimeCreated", &d.TimeCreated) - delete(rawMsg, key) - case "uniqueId": - err = unpopulate(val, "UniqueID", &d.UniqueID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiskRestorePointProperties. -func (d *DiskRestorePointProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "completionPercent": - err = unpopulate(val, "CompletionPercent", &d.CompletionPercent) - delete(rawMsg, key) - case "diskAccessId": - err = unpopulate(val, "DiskAccessID", &d.DiskAccessID) - delete(rawMsg, key) - case "encryption": - err = unpopulate(val, "Encryption", &d.Encryption) - delete(rawMsg, key) - case "familyId": - err = unpopulate(val, "FamilyID", &d.FamilyID) - delete(rawMsg, key) - case "hyperVGeneration": - err = unpopulate(val, "HyperVGeneration", &d.HyperVGeneration) - delete(rawMsg, key) - case "networkAccessPolicy": - err = unpopulate(val, "NetworkAccessPolicy", &d.NetworkAccessPolicy) - delete(rawMsg, key) - case "osType": - err = unpopulate(val, "OSType", &d.OSType) - delete(rawMsg, key) - case "publicNetworkAccess": - err = unpopulate(val, "PublicNetworkAccess", &d.PublicNetworkAccess) - delete(rawMsg, key) - case "purchasePlan": - err = unpopulate(val, "PurchasePlan", &d.PurchasePlan) - delete(rawMsg, key) - case "replicationState": - err = unpopulate(val, "ReplicationState", &d.ReplicationState) - delete(rawMsg, key) - case "sourceResourceId": - err = unpopulate(val, "SourceResourceID", &d.SourceResourceID) - delete(rawMsg, key) - case "sourceResourceLocation": - err = unpopulate(val, "SourceResourceLocation", &d.SourceResourceLocation) - delete(rawMsg, key) - case "sourceUniqueId": - err = unpopulate(val, "SourceUniqueID", &d.SourceUniqueID) - delete(rawMsg, key) - case "supportedCapabilities": - err = unpopulate(val, "SupportedCapabilities", &d.SupportedCapabilities) - delete(rawMsg, key) - case "supportsHibernation": - err = unpopulate(val, "SupportsHibernation", &d.SupportsHibernation) - delete(rawMsg, key) - case "timeCreated": - err = unpopulateTimeRFC3339(val, "TimeCreated", &d.TimeCreated) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DiskUpdate. -func (d DiskUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "sku", d.SKU) - populate(objectMap, "tags", d.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type EncryptionImages. -func (e EncryptionImages) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "dataDiskImages", e.DataDiskImages) - populate(objectMap, "osDiskImage", e.OSDiskImage) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type EncryptionSetProperties. -func (e EncryptionSetProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "activeKey", e.ActiveKey) - populate(objectMap, "autoKeyRotationError", e.AutoKeyRotationError) - populate(objectMap, "encryptionType", e.EncryptionType) - populateTimeRFC3339(objectMap, "lastKeyRotationTimestamp", e.LastKeyRotationTimestamp) - populate(objectMap, "previousKeys", e.PreviousKeys) - populate(objectMap, "provisioningState", e.ProvisioningState) - populate(objectMap, "rotationToLatestKeyVersionEnabled", e.RotationToLatestKeyVersionEnabled) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionSetProperties. -func (e *EncryptionSetProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "activeKey": - err = unpopulate(val, "ActiveKey", &e.ActiveKey) - delete(rawMsg, key) - case "autoKeyRotationError": - err = unpopulate(val, "AutoKeyRotationError", &e.AutoKeyRotationError) - delete(rawMsg, key) - case "encryptionType": - err = unpopulate(val, "EncryptionType", &e.EncryptionType) - delete(rawMsg, key) - case "lastKeyRotationTimestamp": - err = unpopulateTimeRFC3339(val, "LastKeyRotationTimestamp", &e.LastKeyRotationTimestamp) - delete(rawMsg, key) - case "previousKeys": - err = unpopulate(val, "PreviousKeys", &e.PreviousKeys) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &e.ProvisioningState) - delete(rawMsg, key) - case "rotationToLatestKeyVersionEnabled": - err = unpopulate(val, "RotationToLatestKeyVersionEnabled", &e.RotationToLatestKeyVersionEnabled) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type EncryptionSettingsCollection. -func (e EncryptionSettingsCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "enabled", e.Enabled) - populate(objectMap, "encryptionSettings", e.EncryptionSettings) - populate(objectMap, "encryptionSettingsVersion", e.EncryptionSettingsVersion) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type Gallery. -func (g Gallery) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", g.ID) - populate(objectMap, "location", g.Location) - populate(objectMap, "name", g.Name) - populate(objectMap, "properties", g.Properties) - populate(objectMap, "tags", g.Tags) - populate(objectMap, "type", g.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryApplication. -func (g GalleryApplication) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", g.ID) - populate(objectMap, "location", g.Location) - populate(objectMap, "name", g.Name) - populate(objectMap, "properties", g.Properties) - populate(objectMap, "tags", g.Tags) - populate(objectMap, "type", g.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryApplicationProperties. -func (g GalleryApplicationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "description", g.Description) - populateTimeRFC3339(objectMap, "endOfLifeDate", g.EndOfLifeDate) - populate(objectMap, "eula", g.Eula) - populate(objectMap, "privacyStatementUri", g.PrivacyStatementURI) - populate(objectMap, "releaseNoteUri", g.ReleaseNoteURI) - populate(objectMap, "supportedOSType", g.SupportedOSType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryApplicationProperties. -func (g *GalleryApplicationProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "description": - err = unpopulate(val, "Description", &g.Description) - delete(rawMsg, key) - case "endOfLifeDate": - err = unpopulateTimeRFC3339(val, "EndOfLifeDate", &g.EndOfLifeDate) - delete(rawMsg, key) - case "eula": - err = unpopulate(val, "Eula", &g.Eula) - delete(rawMsg, key) - case "privacyStatementUri": - err = unpopulate(val, "PrivacyStatementURI", &g.PrivacyStatementURI) - delete(rawMsg, key) - case "releaseNoteUri": - err = unpopulate(val, "ReleaseNoteURI", &g.ReleaseNoteURI) - delete(rawMsg, key) - case "supportedOSType": - err = unpopulate(val, "SupportedOSType", &g.SupportedOSType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryApplicationUpdate. -func (g GalleryApplicationUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", g.ID) - populate(objectMap, "name", g.Name) - populate(objectMap, "properties", g.Properties) - populate(objectMap, "tags", g.Tags) - populate(objectMap, "type", g.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryApplicationVersion. -func (g GalleryApplicationVersion) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", g.ID) - populate(objectMap, "location", g.Location) - populate(objectMap, "name", g.Name) - populate(objectMap, "properties", g.Properties) - populate(objectMap, "tags", g.Tags) - populate(objectMap, "type", g.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryApplicationVersionPublishingProfile. -func (g GalleryApplicationVersionPublishingProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "enableHealthCheck", g.EnableHealthCheck) - populateTimeRFC3339(objectMap, "endOfLifeDate", g.EndOfLifeDate) - populate(objectMap, "excludeFromLatest", g.ExcludeFromLatest) - populate(objectMap, "manageActions", g.ManageActions) - populateTimeRFC3339(objectMap, "publishedDate", g.PublishedDate) - populate(objectMap, "replicaCount", g.ReplicaCount) - populate(objectMap, "replicationMode", g.ReplicationMode) - populate(objectMap, "source", g.Source) - populate(objectMap, "storageAccountType", g.StorageAccountType) - populate(objectMap, "targetExtendedLocations", g.TargetExtendedLocations) - populate(objectMap, "targetRegions", g.TargetRegions) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryApplicationVersionPublishingProfile. -func (g *GalleryApplicationVersionPublishingProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "enableHealthCheck": - err = unpopulate(val, "EnableHealthCheck", &g.EnableHealthCheck) - delete(rawMsg, key) - case "endOfLifeDate": - err = unpopulateTimeRFC3339(val, "EndOfLifeDate", &g.EndOfLifeDate) - delete(rawMsg, key) - case "excludeFromLatest": - err = unpopulate(val, "ExcludeFromLatest", &g.ExcludeFromLatest) - delete(rawMsg, key) - case "manageActions": - err = unpopulate(val, "ManageActions", &g.ManageActions) - delete(rawMsg, key) - case "publishedDate": - err = unpopulateTimeRFC3339(val, "PublishedDate", &g.PublishedDate) - delete(rawMsg, key) - case "replicaCount": - err = unpopulate(val, "ReplicaCount", &g.ReplicaCount) - delete(rawMsg, key) - case "replicationMode": - err = unpopulate(val, "ReplicationMode", &g.ReplicationMode) - delete(rawMsg, key) - case "source": - err = unpopulate(val, "Source", &g.Source) - delete(rawMsg, key) - case "storageAccountType": - err = unpopulate(val, "StorageAccountType", &g.StorageAccountType) - delete(rawMsg, key) - case "targetExtendedLocations": - err = unpopulate(val, "TargetExtendedLocations", &g.TargetExtendedLocations) - delete(rawMsg, key) - case "targetRegions": - err = unpopulate(val, "TargetRegions", &g.TargetRegions) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryApplicationVersionUpdate. -func (g GalleryApplicationVersionUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", g.ID) - populate(objectMap, "name", g.Name) - populate(objectMap, "properties", g.Properties) - populate(objectMap, "tags", g.Tags) - populate(objectMap, "type", g.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryArtifactPublishingProfileBase. -func (g GalleryArtifactPublishingProfileBase) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "endOfLifeDate", g.EndOfLifeDate) - populate(objectMap, "excludeFromLatest", g.ExcludeFromLatest) - populateTimeRFC3339(objectMap, "publishedDate", g.PublishedDate) - populate(objectMap, "replicaCount", g.ReplicaCount) - populate(objectMap, "replicationMode", g.ReplicationMode) - populate(objectMap, "storageAccountType", g.StorageAccountType) - populate(objectMap, "targetExtendedLocations", g.TargetExtendedLocations) - populate(objectMap, "targetRegions", g.TargetRegions) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryArtifactPublishingProfileBase. -func (g *GalleryArtifactPublishingProfileBase) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "endOfLifeDate": - err = unpopulateTimeRFC3339(val, "EndOfLifeDate", &g.EndOfLifeDate) - delete(rawMsg, key) - case "excludeFromLatest": - err = unpopulate(val, "ExcludeFromLatest", &g.ExcludeFromLatest) - delete(rawMsg, key) - case "publishedDate": - err = unpopulateTimeRFC3339(val, "PublishedDate", &g.PublishedDate) - delete(rawMsg, key) - case "replicaCount": - err = unpopulate(val, "ReplicaCount", &g.ReplicaCount) - delete(rawMsg, key) - case "replicationMode": - err = unpopulate(val, "ReplicationMode", &g.ReplicationMode) - delete(rawMsg, key) - case "storageAccountType": - err = unpopulate(val, "StorageAccountType", &g.StorageAccountType) - delete(rawMsg, key) - case "targetExtendedLocations": - err = unpopulate(val, "TargetExtendedLocations", &g.TargetExtendedLocations) - delete(rawMsg, key) - case "targetRegions": - err = unpopulate(val, "TargetRegions", &g.TargetRegions) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryImage. -func (g GalleryImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", g.ID) - populate(objectMap, "location", g.Location) - populate(objectMap, "name", g.Name) - populate(objectMap, "properties", g.Properties) - populate(objectMap, "tags", g.Tags) - populate(objectMap, "type", g.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryImageProperties. -func (g GalleryImageProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "architecture", g.Architecture) - populate(objectMap, "description", g.Description) - populate(objectMap, "disallowed", g.Disallowed) - populateTimeRFC3339(objectMap, "endOfLifeDate", g.EndOfLifeDate) - populate(objectMap, "eula", g.Eula) - populate(objectMap, "features", g.Features) - populate(objectMap, "hyperVGeneration", g.HyperVGeneration) - populate(objectMap, "identifier", g.Identifier) - populate(objectMap, "osState", g.OSState) - populate(objectMap, "osType", g.OSType) - populate(objectMap, "privacyStatementUri", g.PrivacyStatementURI) - populate(objectMap, "provisioningState", g.ProvisioningState) - populate(objectMap, "purchasePlan", g.PurchasePlan) - populate(objectMap, "recommended", g.Recommended) - populate(objectMap, "releaseNoteUri", g.ReleaseNoteURI) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImageProperties. -func (g *GalleryImageProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "architecture": - err = unpopulate(val, "Architecture", &g.Architecture) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &g.Description) - delete(rawMsg, key) - case "disallowed": - err = unpopulate(val, "Disallowed", &g.Disallowed) - delete(rawMsg, key) - case "endOfLifeDate": - err = unpopulateTimeRFC3339(val, "EndOfLifeDate", &g.EndOfLifeDate) - delete(rawMsg, key) - case "eula": - err = unpopulate(val, "Eula", &g.Eula) - delete(rawMsg, key) - case "features": - err = unpopulate(val, "Features", &g.Features) - delete(rawMsg, key) - case "hyperVGeneration": - err = unpopulate(val, "HyperVGeneration", &g.HyperVGeneration) - delete(rawMsg, key) - case "identifier": - err = unpopulate(val, "Identifier", &g.Identifier) - delete(rawMsg, key) - case "osState": - err = unpopulate(val, "OSState", &g.OSState) - delete(rawMsg, key) - case "osType": - err = unpopulate(val, "OSType", &g.OSType) - delete(rawMsg, key) - case "privacyStatementUri": - err = unpopulate(val, "PrivacyStatementURI", &g.PrivacyStatementURI) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &g.ProvisioningState) - delete(rawMsg, key) - case "purchasePlan": - err = unpopulate(val, "PurchasePlan", &g.PurchasePlan) - delete(rawMsg, key) - case "recommended": - err = unpopulate(val, "Recommended", &g.Recommended) - delete(rawMsg, key) - case "releaseNoteUri": - err = unpopulate(val, "ReleaseNoteURI", &g.ReleaseNoteURI) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryImageUpdate. -func (g GalleryImageUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", g.ID) - populate(objectMap, "name", g.Name) - populate(objectMap, "properties", g.Properties) - populate(objectMap, "tags", g.Tags) - populate(objectMap, "type", g.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryImageVersion. -func (g GalleryImageVersion) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", g.ID) - populate(objectMap, "location", g.Location) - populate(objectMap, "name", g.Name) - populate(objectMap, "properties", g.Properties) - populate(objectMap, "tags", g.Tags) - populate(objectMap, "type", g.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryImageVersionPublishingProfile. -func (g GalleryImageVersionPublishingProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "endOfLifeDate", g.EndOfLifeDate) - populate(objectMap, "excludeFromLatest", g.ExcludeFromLatest) - populateTimeRFC3339(objectMap, "publishedDate", g.PublishedDate) - populate(objectMap, "replicaCount", g.ReplicaCount) - populate(objectMap, "replicationMode", g.ReplicationMode) - populate(objectMap, "storageAccountType", g.StorageAccountType) - populate(objectMap, "targetExtendedLocations", g.TargetExtendedLocations) - populate(objectMap, "targetRegions", g.TargetRegions) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImageVersionPublishingProfile. -func (g *GalleryImageVersionPublishingProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "endOfLifeDate": - err = unpopulateTimeRFC3339(val, "EndOfLifeDate", &g.EndOfLifeDate) - delete(rawMsg, key) - case "excludeFromLatest": - err = unpopulate(val, "ExcludeFromLatest", &g.ExcludeFromLatest) - delete(rawMsg, key) - case "publishedDate": - err = unpopulateTimeRFC3339(val, "PublishedDate", &g.PublishedDate) - delete(rawMsg, key) - case "replicaCount": - err = unpopulate(val, "ReplicaCount", &g.ReplicaCount) - delete(rawMsg, key) - case "replicationMode": - err = unpopulate(val, "ReplicationMode", &g.ReplicationMode) - delete(rawMsg, key) - case "storageAccountType": - err = unpopulate(val, "StorageAccountType", &g.StorageAccountType) - delete(rawMsg, key) - case "targetExtendedLocations": - err = unpopulate(val, "TargetExtendedLocations", &g.TargetExtendedLocations) - delete(rawMsg, key) - case "targetRegions": - err = unpopulate(val, "TargetRegions", &g.TargetRegions) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryImageVersionStorageProfile. -func (g GalleryImageVersionStorageProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "dataDiskImages", g.DataDiskImages) - populate(objectMap, "osDiskImage", g.OSDiskImage) - populate(objectMap, "source", g.Source) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryImageVersionUpdate. -func (g GalleryImageVersionUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", g.ID) - populate(objectMap, "name", g.Name) - populate(objectMap, "properties", g.Properties) - populate(objectMap, "tags", g.Tags) - populate(objectMap, "type", g.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryUpdate. -func (g GalleryUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", g.ID) - populate(objectMap, "name", g.Name) - populate(objectMap, "properties", g.Properties) - populate(objectMap, "tags", g.Tags) - populate(objectMap, "type", g.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type Image. -func (i Image) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "extendedLocation", i.ExtendedLocation) - populate(objectMap, "id", i.ID) - populate(objectMap, "location", i.Location) - populate(objectMap, "name", i.Name) - populate(objectMap, "properties", i.Properties) - populate(objectMap, "tags", i.Tags) - populate(objectMap, "type", i.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ImageStorageProfile. -func (i ImageStorageProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "dataDisks", i.DataDisks) - populate(objectMap, "osDisk", i.OSDisk) - populate(objectMap, "zoneResilient", i.ZoneResilient) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ImageUpdate. -func (i ImageUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", i.Properties) - populate(objectMap, "tags", i.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type InstanceViewStatus. -func (i InstanceViewStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "code", i.Code) - populate(objectMap, "displayStatus", i.DisplayStatus) - populate(objectMap, "level", i.Level) - populate(objectMap, "message", i.Message) - populateTimeRFC3339(objectMap, "time", i.Time) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type InstanceViewStatus. -func (i *InstanceViewStatus) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "code": - err = unpopulate(val, "Code", &i.Code) - delete(rawMsg, key) - case "displayStatus": - err = unpopulate(val, "DisplayStatus", &i.DisplayStatus) - delete(rawMsg, key) - case "level": - err = unpopulate(val, "Level", &i.Level) - delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &i.Message) - delete(rawMsg, key) - case "time": - err = unpopulateTimeRFC3339(val, "Time", &i.Time) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type LastPatchInstallationSummary. -func (l LastPatchInstallationSummary) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "error", l.Error) - populate(objectMap, "excludedPatchCount", l.ExcludedPatchCount) - populate(objectMap, "failedPatchCount", l.FailedPatchCount) - populate(objectMap, "installationActivityId", l.InstallationActivityID) - populate(objectMap, "installedPatchCount", l.InstalledPatchCount) - populateTimeRFC3339(objectMap, "lastModifiedTime", l.LastModifiedTime) - populate(objectMap, "maintenanceWindowExceeded", l.MaintenanceWindowExceeded) - populate(objectMap, "notSelectedPatchCount", l.NotSelectedPatchCount) - populate(objectMap, "pendingPatchCount", l.PendingPatchCount) - populateTimeRFC3339(objectMap, "startTime", l.StartTime) - populate(objectMap, "status", l.Status) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LastPatchInstallationSummary. -func (l *LastPatchInstallationSummary) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "error": - err = unpopulate(val, "Error", &l.Error) - delete(rawMsg, key) - case "excludedPatchCount": - err = unpopulate(val, "ExcludedPatchCount", &l.ExcludedPatchCount) - delete(rawMsg, key) - case "failedPatchCount": - err = unpopulate(val, "FailedPatchCount", &l.FailedPatchCount) - delete(rawMsg, key) - case "installationActivityId": - err = unpopulate(val, "InstallationActivityID", &l.InstallationActivityID) - delete(rawMsg, key) - case "installedPatchCount": - err = unpopulate(val, "InstalledPatchCount", &l.InstalledPatchCount) - delete(rawMsg, key) - case "lastModifiedTime": - err = unpopulateTimeRFC3339(val, "LastModifiedTime", &l.LastModifiedTime) - delete(rawMsg, key) - case "maintenanceWindowExceeded": - err = unpopulate(val, "MaintenanceWindowExceeded", &l.MaintenanceWindowExceeded) - delete(rawMsg, key) - case "notSelectedPatchCount": - err = unpopulate(val, "NotSelectedPatchCount", &l.NotSelectedPatchCount) - delete(rawMsg, key) - case "pendingPatchCount": - err = unpopulate(val, "PendingPatchCount", &l.PendingPatchCount) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &l.StartTime) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &l.Status) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type LinuxParameters. -func (l LinuxParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "classificationsToInclude", l.ClassificationsToInclude) - populate(objectMap, "maintenanceRunId", l.MaintenanceRunID) - populate(objectMap, "packageNameMasksToExclude", l.PackageNameMasksToExclude) - populate(objectMap, "packageNameMasksToInclude", l.PackageNameMasksToInclude) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type LoadBalancerConfigurationProperties. -func (l LoadBalancerConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "frontendIPConfigurations", l.FrontendIPConfigurations) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type LogAnalyticsInputBase. -func (l LogAnalyticsInputBase) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "blobContainerSasUri", l.BlobContainerSasURI) - populateTimeRFC3339(objectMap, "fromTime", l.FromTime) - populate(objectMap, "groupByClientApplicationId", l.GroupByClientApplicationID) - populate(objectMap, "groupByOperationName", l.GroupByOperationName) - populate(objectMap, "groupByResourceName", l.GroupByResourceName) - populate(objectMap, "groupByThrottlePolicy", l.GroupByThrottlePolicy) - populate(objectMap, "groupByUserAgent", l.GroupByUserAgent) - populateTimeRFC3339(objectMap, "toTime", l.ToTime) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LogAnalyticsInputBase. -func (l *LogAnalyticsInputBase) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "blobContainerSasUri": - err = unpopulate(val, "BlobContainerSasURI", &l.BlobContainerSasURI) - delete(rawMsg, key) - case "fromTime": - err = unpopulateTimeRFC3339(val, "FromTime", &l.FromTime) - delete(rawMsg, key) - case "groupByClientApplicationId": - err = unpopulate(val, "GroupByClientApplicationID", &l.GroupByClientApplicationID) - delete(rawMsg, key) - case "groupByOperationName": - err = unpopulate(val, "GroupByOperationName", &l.GroupByOperationName) - delete(rawMsg, key) - case "groupByResourceName": - err = unpopulate(val, "GroupByResourceName", &l.GroupByResourceName) - delete(rawMsg, key) - case "groupByThrottlePolicy": - err = unpopulate(val, "GroupByThrottlePolicy", &l.GroupByThrottlePolicy) - delete(rawMsg, key) - case "groupByUserAgent": - err = unpopulate(val, "GroupByUserAgent", &l.GroupByUserAgent) - delete(rawMsg, key) - case "toTime": - err = unpopulateTimeRFC3339(val, "ToTime", &l.ToTime) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type MaintenanceRedeployStatus. -func (m MaintenanceRedeployStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "isCustomerInitiatedMaintenanceAllowed", m.IsCustomerInitiatedMaintenanceAllowed) - populate(objectMap, "lastOperationMessage", m.LastOperationMessage) - populate(objectMap, "lastOperationResultCode", m.LastOperationResultCode) - populateTimeRFC3339(objectMap, "maintenanceWindowEndTime", m.MaintenanceWindowEndTime) - populateTimeRFC3339(objectMap, "maintenanceWindowStartTime", m.MaintenanceWindowStartTime) - populateTimeRFC3339(objectMap, "preMaintenanceWindowEndTime", m.PreMaintenanceWindowEndTime) - populateTimeRFC3339(objectMap, "preMaintenanceWindowStartTime", m.PreMaintenanceWindowStartTime) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type MaintenanceRedeployStatus. -func (m *MaintenanceRedeployStatus) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "isCustomerInitiatedMaintenanceAllowed": - err = unpopulate(val, "IsCustomerInitiatedMaintenanceAllowed", &m.IsCustomerInitiatedMaintenanceAllowed) - delete(rawMsg, key) - case "lastOperationMessage": - err = unpopulate(val, "LastOperationMessage", &m.LastOperationMessage) - delete(rawMsg, key) - case "lastOperationResultCode": - err = unpopulate(val, "LastOperationResultCode", &m.LastOperationResultCode) - delete(rawMsg, key) - case "maintenanceWindowEndTime": - err = unpopulateTimeRFC3339(val, "MaintenanceWindowEndTime", &m.MaintenanceWindowEndTime) - delete(rawMsg, key) - case "maintenanceWindowStartTime": - err = unpopulateTimeRFC3339(val, "MaintenanceWindowStartTime", &m.MaintenanceWindowStartTime) - delete(rawMsg, key) - case "preMaintenanceWindowEndTime": - err = unpopulateTimeRFC3339(val, "PreMaintenanceWindowEndTime", &m.PreMaintenanceWindowEndTime) - delete(rawMsg, key) - case "preMaintenanceWindowStartTime": - err = unpopulateTimeRFC3339(val, "PreMaintenanceWindowStartTime", &m.PreMaintenanceWindowStartTime) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type NetworkProfile. -func (n NetworkProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "networkApiVersion", n.NetworkAPIVersion) - populate(objectMap, "networkInterfaceConfigurations", n.NetworkInterfaceConfigurations) - populate(objectMap, "networkInterfaces", n.NetworkInterfaces) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type OSProfile. -func (o OSProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "adminPassword", o.AdminPassword) - populate(objectMap, "adminUsername", o.AdminUsername) - populate(objectMap, "allowExtensionOperations", o.AllowExtensionOperations) - populate(objectMap, "computerName", o.ComputerName) - populate(objectMap, "customData", o.CustomData) - populate(objectMap, "linuxConfiguration", o.LinuxConfiguration) - populate(objectMap, "requireGuestProvisionSignal", o.RequireGuestProvisionSignal) - populate(objectMap, "secrets", o.Secrets) - populate(objectMap, "windowsConfiguration", o.WindowsConfiguration) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ProximityPlacementGroup. -func (p ProximityPlacementGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", p.ID) - populate(objectMap, "location", p.Location) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "tags", p.Tags) - populate(objectMap, "type", p.Type) - populate(objectMap, "zones", p.Zones) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ProximityPlacementGroupProperties. -func (p ProximityPlacementGroupProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "availabilitySets", p.AvailabilitySets) - populate(objectMap, "colocationStatus", p.ColocationStatus) - populate(objectMap, "intent", p.Intent) - populate(objectMap, "proximityPlacementGroupType", p.ProximityPlacementGroupType) - populate(objectMap, "virtualMachineScaleSets", p.VirtualMachineScaleSets) - populate(objectMap, "virtualMachines", p.VirtualMachines) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ProximityPlacementGroupPropertiesIntent. -func (p ProximityPlacementGroupPropertiesIntent) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "vmSizes", p.VMSizes) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ProximityPlacementGroupUpdate. -func (p ProximityPlacementGroupUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "tags", p.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ReplicationStatus. -func (r ReplicationStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "aggregatedState", r.AggregatedState) - populate(objectMap, "summary", r.Summary) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type RequestRateByIntervalInput. -func (r RequestRateByIntervalInput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "blobContainerSasUri", r.BlobContainerSasURI) - populateTimeRFC3339(objectMap, "fromTime", r.FromTime) - populate(objectMap, "groupByClientApplicationId", r.GroupByClientApplicationID) - populate(objectMap, "groupByOperationName", r.GroupByOperationName) - populate(objectMap, "groupByResourceName", r.GroupByResourceName) - populate(objectMap, "groupByThrottlePolicy", r.GroupByThrottlePolicy) - populate(objectMap, "groupByUserAgent", r.GroupByUserAgent) - populate(objectMap, "intervalLength", r.IntervalLength) - populateTimeRFC3339(objectMap, "toTime", r.ToTime) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RequestRateByIntervalInput. -func (r *RequestRateByIntervalInput) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "blobContainerSasUri": - err = unpopulate(val, "BlobContainerSasURI", &r.BlobContainerSasURI) - delete(rawMsg, key) - case "fromTime": - err = unpopulateTimeRFC3339(val, "FromTime", &r.FromTime) - delete(rawMsg, key) - case "groupByClientApplicationId": - err = unpopulate(val, "GroupByClientApplicationID", &r.GroupByClientApplicationID) - delete(rawMsg, key) - case "groupByOperationName": - err = unpopulate(val, "GroupByOperationName", &r.GroupByOperationName) - delete(rawMsg, key) - case "groupByResourceName": - err = unpopulate(val, "GroupByResourceName", &r.GroupByResourceName) - delete(rawMsg, key) - case "groupByThrottlePolicy": - err = unpopulate(val, "GroupByThrottlePolicy", &r.GroupByThrottlePolicy) - delete(rawMsg, key) - case "groupByUserAgent": - err = unpopulate(val, "GroupByUserAgent", &r.GroupByUserAgent) - delete(rawMsg, key) - case "intervalLength": - err = unpopulate(val, "IntervalLength", &r.IntervalLength) - delete(rawMsg, key) - case "toTime": - err = unpopulateTimeRFC3339(val, "ToTime", &r.ToTime) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Resource. -func (r Resource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", r.ID) - populate(objectMap, "location", r.Location) - populate(objectMap, "name", r.Name) - populate(objectMap, "tags", r.Tags) - populate(objectMap, "type", r.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceInstanceViewStatus. -func (r *ResourceInstanceViewStatus) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "code": - err = unpopulate(val, "Code", &r.Code) - delete(rawMsg, key) - case "displayStatus": - err = unpopulate(val, "DisplayStatus", &r.DisplayStatus) - delete(rawMsg, key) - case "level": - err = unpopulate(val, "Level", &r.Level) - delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &r.Message) - delete(rawMsg, key) - case "time": - err = unpopulateTimeRFC3339(val, "Time", &r.Time) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ResourceWithOptionalLocation. -func (r ResourceWithOptionalLocation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", r.ID) - populate(objectMap, "location", r.Location) - populate(objectMap, "name", r.Name) - populate(objectMap, "tags", r.Tags) - populate(objectMap, "type", r.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type RestorePointCollection. -func (r RestorePointCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", r.ID) - populate(objectMap, "location", r.Location) - populate(objectMap, "name", r.Name) - populate(objectMap, "properties", r.Properties) - populate(objectMap, "tags", r.Tags) - populate(objectMap, "type", r.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type RestorePointCollectionProperties. -func (r RestorePointCollectionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "provisioningState", r.ProvisioningState) - populate(objectMap, "restorePointCollectionId", r.RestorePointCollectionID) - populate(objectMap, "restorePoints", r.RestorePoints) - populate(objectMap, "source", r.Source) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type RestorePointCollectionUpdate. -func (r RestorePointCollectionUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", r.Properties) - populate(objectMap, "tags", r.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type RestorePointInstanceView. -func (r RestorePointInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "diskRestorePoints", r.DiskRestorePoints) - populate(objectMap, "statuses", r.Statuses) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type RestorePointProperties. -func (r RestorePointProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "consistencyMode", r.ConsistencyMode) - populate(objectMap, "excludeDisks", r.ExcludeDisks) - populate(objectMap, "instanceView", r.InstanceView) - populate(objectMap, "provisioningState", r.ProvisioningState) - populate(objectMap, "sourceMetadata", r.SourceMetadata) - populate(objectMap, "sourceRestorePoint", r.SourceRestorePoint) - populateTimeRFC3339(objectMap, "timeCreated", r.TimeCreated) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorePointProperties. -func (r *RestorePointProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "consistencyMode": - err = unpopulate(val, "ConsistencyMode", &r.ConsistencyMode) - delete(rawMsg, key) - case "excludeDisks": - err = unpopulate(val, "ExcludeDisks", &r.ExcludeDisks) - delete(rawMsg, key) - case "instanceView": - err = unpopulate(val, "InstanceView", &r.InstanceView) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &r.ProvisioningState) - delete(rawMsg, key) - case "sourceMetadata": - err = unpopulate(val, "SourceMetadata", &r.SourceMetadata) - delete(rawMsg, key) - case "sourceRestorePoint": - err = unpopulate(val, "SourceRestorePoint", &r.SourceRestorePoint) - delete(rawMsg, key) - case "timeCreated": - err = unpopulateTimeRFC3339(val, "TimeCreated", &r.TimeCreated) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RestorePointSourceVMStorageProfile. -func (r RestorePointSourceVMStorageProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "dataDisks", r.DataDisks) - populate(objectMap, "osDisk", r.OSDisk) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type RoleInstances. -func (r RoleInstances) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "roleInstances", r.RoleInstances) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type RollingUpgradeRunningStatus. -func (r RollingUpgradeRunningStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "code", r.Code) - populate(objectMap, "lastAction", r.LastAction) - populateTimeRFC3339(objectMap, "lastActionTime", r.LastActionTime) - populateTimeRFC3339(objectMap, "startTime", r.StartTime) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RollingUpgradeRunningStatus. -func (r *RollingUpgradeRunningStatus) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "code": - err = unpopulate(val, "Code", &r.Code) - delete(rawMsg, key) - case "lastAction": - err = unpopulate(val, "LastAction", &r.LastAction) - delete(rawMsg, key) - case "lastActionTime": - err = unpopulateTimeRFC3339(val, "LastActionTime", &r.LastActionTime) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &r.StartTime) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RollingUpgradeStatusInfo. -func (r RollingUpgradeStatusInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", r.ID) - populate(objectMap, "location", r.Location) - populate(objectMap, "name", r.Name) - populate(objectMap, "properties", r.Properties) - populate(objectMap, "tags", r.Tags) - populate(objectMap, "type", r.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type RunCommandInput. -func (r RunCommandInput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "commandId", r.CommandID) - populate(objectMap, "parameters", r.Parameters) - populate(objectMap, "script", r.Script) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type SSHConfiguration. -func (s SSHConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "publicKeys", s.PublicKeys) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type SSHPublicKeyResource. -func (s SSHPublicKeyResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", s.ID) - populate(objectMap, "location", s.Location) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "tags", s.Tags) - populate(objectMap, "type", s.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type SSHPublicKeyUpdateResource. -func (s SSHPublicKeyUpdateResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "tags", s.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ScaleInPolicy. -func (s ScaleInPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "forceDeletion", s.ForceDeletion) - populate(objectMap, "rules", s.Rules) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SharedGalleryImageProperties. -func (s *SharedGalleryImageProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "disallowed": - err = unpopulate(val, "Disallowed", &s.Disallowed) - delete(rawMsg, key) - case "endOfLifeDate": - err = unpopulateTimeRFC3339(val, "EndOfLifeDate", &s.EndOfLifeDate) - delete(rawMsg, key) - case "features": - err = unpopulate(val, "Features", &s.Features) - delete(rawMsg, key) - case "hyperVGeneration": - err = unpopulate(val, "HyperVGeneration", &s.HyperVGeneration) - delete(rawMsg, key) - case "identifier": - err = unpopulate(val, "Identifier", &s.Identifier) - delete(rawMsg, key) - case "osState": - err = unpopulate(val, "OSState", &s.OSState) - delete(rawMsg, key) - case "osType": - err = unpopulate(val, "OSType", &s.OSType) - delete(rawMsg, key) - case "purchasePlan": - err = unpopulate(val, "PurchasePlan", &s.PurchasePlan) - delete(rawMsg, key) - case "recommended": - err = unpopulate(val, "Recommended", &s.Recommended) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SharedGalleryImageVersionProperties. -func (s *SharedGalleryImageVersionProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "endOfLifeDate": - err = unpopulateTimeRFC3339(val, "EndOfLifeDate", &s.EndOfLifeDate) - delete(rawMsg, key) - case "publishedDate": - err = unpopulateTimeRFC3339(val, "PublishedDate", &s.PublishedDate) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SharingProfile. -func (s SharingProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "communityGalleryInfo", &s.CommunityGalleryInfo) - populate(objectMap, "groups", s.Groups) - populate(objectMap, "permissions", s.Permissions) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type SharingProfileGroup. -func (s SharingProfileGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "ids", s.IDs) - populate(objectMap, "type", s.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type SharingStatus. -func (s SharingStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "aggregatedState", s.AggregatedState) - populate(objectMap, "summary", s.Summary) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type SharingUpdate. -func (s SharingUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "groups", s.Groups) - populate(objectMap, "operationType", s.OperationType) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type Snapshot. -func (s Snapshot) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "extendedLocation", s.ExtendedLocation) - populate(objectMap, "id", s.ID) - populate(objectMap, "location", s.Location) - populate(objectMap, "managedBy", s.ManagedBy) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "sku", s.SKU) - populate(objectMap, "tags", s.Tags) - populate(objectMap, "type", s.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type SnapshotProperties. -func (s SnapshotProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "completionPercent", s.CompletionPercent) - populate(objectMap, "creationData", s.CreationData) - populate(objectMap, "dataAccessAuthMode", s.DataAccessAuthMode) - populate(objectMap, "diskAccessId", s.DiskAccessID) - populate(objectMap, "diskSizeBytes", s.DiskSizeBytes) - populate(objectMap, "diskSizeGB", s.DiskSizeGB) - populate(objectMap, "diskState", s.DiskState) - populate(objectMap, "encryption", s.Encryption) - populate(objectMap, "encryptionSettingsCollection", s.EncryptionSettingsCollection) - populate(objectMap, "hyperVGeneration", s.HyperVGeneration) - populate(objectMap, "incremental", s.Incremental) - populate(objectMap, "networkAccessPolicy", s.NetworkAccessPolicy) - populate(objectMap, "osType", s.OSType) - populate(objectMap, "provisioningState", s.ProvisioningState) - populate(objectMap, "publicNetworkAccess", s.PublicNetworkAccess) - populate(objectMap, "purchasePlan", s.PurchasePlan) - populate(objectMap, "securityProfile", s.SecurityProfile) - populate(objectMap, "supportedCapabilities", s.SupportedCapabilities) - populate(objectMap, "supportsHibernation", s.SupportsHibernation) - populateTimeRFC3339(objectMap, "timeCreated", s.TimeCreated) - populate(objectMap, "uniqueId", s.UniqueID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SnapshotProperties. -func (s *SnapshotProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "completionPercent": - err = unpopulate(val, "CompletionPercent", &s.CompletionPercent) - delete(rawMsg, key) - case "creationData": - err = unpopulate(val, "CreationData", &s.CreationData) - delete(rawMsg, key) - case "dataAccessAuthMode": - err = unpopulate(val, "DataAccessAuthMode", &s.DataAccessAuthMode) - delete(rawMsg, key) - case "diskAccessId": - err = unpopulate(val, "DiskAccessID", &s.DiskAccessID) - delete(rawMsg, key) - case "diskSizeBytes": - err = unpopulate(val, "DiskSizeBytes", &s.DiskSizeBytes) - delete(rawMsg, key) - case "diskSizeGB": - err = unpopulate(val, "DiskSizeGB", &s.DiskSizeGB) - delete(rawMsg, key) - case "diskState": - err = unpopulate(val, "DiskState", &s.DiskState) - delete(rawMsg, key) - case "encryption": - err = unpopulate(val, "Encryption", &s.Encryption) - delete(rawMsg, key) - case "encryptionSettingsCollection": - err = unpopulate(val, "EncryptionSettingsCollection", &s.EncryptionSettingsCollection) - delete(rawMsg, key) - case "hyperVGeneration": - err = unpopulate(val, "HyperVGeneration", &s.HyperVGeneration) - delete(rawMsg, key) - case "incremental": - err = unpopulate(val, "Incremental", &s.Incremental) - delete(rawMsg, key) - case "networkAccessPolicy": - err = unpopulate(val, "NetworkAccessPolicy", &s.NetworkAccessPolicy) - delete(rawMsg, key) - case "osType": - err = unpopulate(val, "OSType", &s.OSType) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) - delete(rawMsg, key) - case "publicNetworkAccess": - err = unpopulate(val, "PublicNetworkAccess", &s.PublicNetworkAccess) - delete(rawMsg, key) - case "purchasePlan": - err = unpopulate(val, "PurchasePlan", &s.PurchasePlan) - delete(rawMsg, key) - case "securityProfile": - err = unpopulate(val, "SecurityProfile", &s.SecurityProfile) - delete(rawMsg, key) - case "supportedCapabilities": - err = unpopulate(val, "SupportedCapabilities", &s.SupportedCapabilities) - delete(rawMsg, key) - case "supportsHibernation": - err = unpopulate(val, "SupportsHibernation", &s.SupportsHibernation) - delete(rawMsg, key) - case "timeCreated": - err = unpopulateTimeRFC3339(val, "TimeCreated", &s.TimeCreated) - delete(rawMsg, key) - case "uniqueId": - err = unpopulate(val, "UniqueID", &s.UniqueID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SnapshotUpdate. -func (s SnapshotUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "sku", s.SKU) - populate(objectMap, "tags", s.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type StorageProfile. -func (s StorageProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "dataDisks", s.DataDisks) - populate(objectMap, "imageReference", s.ImageReference) - populate(objectMap, "osDisk", s.OSDisk) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ThrottledRequestsInput. -func (t ThrottledRequestsInput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "blobContainerSasUri", t.BlobContainerSasURI) - populateTimeRFC3339(objectMap, "fromTime", t.FromTime) - populate(objectMap, "groupByClientApplicationId", t.GroupByClientApplicationID) - populate(objectMap, "groupByOperationName", t.GroupByOperationName) - populate(objectMap, "groupByResourceName", t.GroupByResourceName) - populate(objectMap, "groupByThrottlePolicy", t.GroupByThrottlePolicy) - populate(objectMap, "groupByUserAgent", t.GroupByUserAgent) - populateTimeRFC3339(objectMap, "toTime", t.ToTime) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ThrottledRequestsInput. -func (t *ThrottledRequestsInput) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "blobContainerSasUri": - err = unpopulate(val, "BlobContainerSasURI", &t.BlobContainerSasURI) - delete(rawMsg, key) - case "fromTime": - err = unpopulateTimeRFC3339(val, "FromTime", &t.FromTime) - delete(rawMsg, key) - case "groupByClientApplicationId": - err = unpopulate(val, "GroupByClientApplicationID", &t.GroupByClientApplicationID) - delete(rawMsg, key) - case "groupByOperationName": - err = unpopulate(val, "GroupByOperationName", &t.GroupByOperationName) - delete(rawMsg, key) - case "groupByResourceName": - err = unpopulate(val, "GroupByResourceName", &t.GroupByResourceName) - delete(rawMsg, key) - case "groupByThrottlePolicy": - err = unpopulate(val, "GroupByThrottlePolicy", &t.GroupByThrottlePolicy) - delete(rawMsg, key) - case "groupByUserAgent": - err = unpopulate(val, "GroupByUserAgent", &t.GroupByUserAgent) - delete(rawMsg, key) - case "toTime": - err = unpopulateTimeRFC3339(val, "ToTime", &t.ToTime) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type UpdateResource. -func (u UpdateResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "tags", u.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type UpdateResourceDefinition. -func (u UpdateResourceDefinition) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", u.ID) - populate(objectMap, "name", u.Name) - populate(objectMap, "tags", u.Tags) - populate(objectMap, "type", u.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type UpgradeOperationHistoryStatus. -func (u *UpgradeOperationHistoryStatus) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "code": - err = unpopulate(val, "Code", &u.Code) - delete(rawMsg, key) - case "endTime": - err = unpopulateTimeRFC3339(val, "EndTime", &u.EndTime) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &u.StartTime) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VaultSecretGroup. -func (v VaultSecretGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "sourceVault", v.SourceVault) - populate(objectMap, "vaultCertificates", v.VaultCertificates) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachine. -func (v VirtualMachine) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "extendedLocation", v.ExtendedLocation) - populate(objectMap, "id", v.ID) - populate(objectMap, "identity", v.Identity) - populate(objectMap, "location", v.Location) - populate(objectMap, "name", v.Name) - populate(objectMap, "plan", v.Plan) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "resources", v.Resources) - populate(objectMap, "tags", v.Tags) - populate(objectMap, "type", v.Type) - populate(objectMap, "zones", v.Zones) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineAgentInstanceView. -func (v VirtualMachineAgentInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "extensionHandlers", v.ExtensionHandlers) - populate(objectMap, "statuses", v.Statuses) - populate(objectMap, "vmAgentVersion", v.VMAgentVersion) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineAssessPatchesResult. -func (v *VirtualMachineAssessPatchesResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "assessmentActivityId": - err = unpopulate(val, "AssessmentActivityID", &v.AssessmentActivityID) - delete(rawMsg, key) - case "availablePatches": - err = unpopulate(val, "AvailablePatches", &v.AvailablePatches) - delete(rawMsg, key) - case "criticalAndSecurityPatchCount": - err = unpopulate(val, "CriticalAndSecurityPatchCount", &v.CriticalAndSecurityPatchCount) - delete(rawMsg, key) - case "error": - err = unpopulate(val, "Error", &v.Error) - delete(rawMsg, key) - case "otherPatchCount": - err = unpopulate(val, "OtherPatchCount", &v.OtherPatchCount) - delete(rawMsg, key) - case "rebootPending": - err = unpopulate(val, "RebootPending", &v.RebootPending) - delete(rawMsg, key) - case "startDateTime": - err = unpopulateTimeRFC3339(val, "StartDateTime", &v.StartDateTime) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &v.Status) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineCaptureResult. -func (v VirtualMachineCaptureResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "contentVersion", v.ContentVersion) - populate(objectMap, "id", v.ID) - populate(objectMap, "parameters", &v.Parameters) - populate(objectMap, "resources", v.Resources) - populate(objectMap, "$schema", v.Schema) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineExtension. -func (v VirtualMachineExtension) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", v.ID) - populate(objectMap, "location", v.Location) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "tags", v.Tags) - populate(objectMap, "type", v.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineExtensionImage. -func (v VirtualMachineExtensionImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", v.ID) - populate(objectMap, "location", v.Location) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "tags", v.Tags) - populate(objectMap, "type", v.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineExtensionInstanceView. -func (v VirtualMachineExtensionInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "name", v.Name) - populate(objectMap, "statuses", v.Statuses) - populate(objectMap, "substatuses", v.Substatuses) - populate(objectMap, "type", v.Type) - populate(objectMap, "typeHandlerVersion", v.TypeHandlerVersion) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineExtensionUpdate. -func (v VirtualMachineExtensionUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "tags", v.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineIdentity. -func (v VirtualMachineIdentity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "principalId", v.PrincipalID) - populate(objectMap, "tenantId", v.TenantID) - populate(objectMap, "type", v.Type) - populate(objectMap, "userAssignedIdentities", v.UserAssignedIdentities) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineImage. -func (v VirtualMachineImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "extendedLocation", v.ExtendedLocation) - populate(objectMap, "id", v.ID) - populate(objectMap, "location", v.Location) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "tags", v.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineImageProperties. -func (v VirtualMachineImageProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "architecture", v.Architecture) - populate(objectMap, "automaticOSUpgradeProperties", v.AutomaticOSUpgradeProperties) - populate(objectMap, "dataDiskImages", v.DataDiskImages) - populate(objectMap, "disallowed", v.Disallowed) - populate(objectMap, "features", v.Features) - populate(objectMap, "hyperVGeneration", v.HyperVGeneration) - populate(objectMap, "osDiskImage", v.OSDiskImage) - populate(objectMap, "plan", v.Plan) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineImageResource. -func (v VirtualMachineImageResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "extendedLocation", v.ExtendedLocation) - populate(objectMap, "id", v.ID) - populate(objectMap, "location", v.Location) - populate(objectMap, "name", v.Name) - populate(objectMap, "tags", v.Tags) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineInstallPatchesResult. -func (v *VirtualMachineInstallPatchesResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "error": - err = unpopulate(val, "Error", &v.Error) - delete(rawMsg, key) - case "excludedPatchCount": - err = unpopulate(val, "ExcludedPatchCount", &v.ExcludedPatchCount) - delete(rawMsg, key) - case "failedPatchCount": - err = unpopulate(val, "FailedPatchCount", &v.FailedPatchCount) - delete(rawMsg, key) - case "installationActivityId": - err = unpopulate(val, "InstallationActivityID", &v.InstallationActivityID) - delete(rawMsg, key) - case "installedPatchCount": - err = unpopulate(val, "InstalledPatchCount", &v.InstalledPatchCount) - delete(rawMsg, key) - case "maintenanceWindowExceeded": - err = unpopulate(val, "MaintenanceWindowExceeded", &v.MaintenanceWindowExceeded) - delete(rawMsg, key) - case "notSelectedPatchCount": - err = unpopulate(val, "NotSelectedPatchCount", &v.NotSelectedPatchCount) - delete(rawMsg, key) - case "patches": - err = unpopulate(val, "Patches", &v.Patches) - delete(rawMsg, key) - case "pendingPatchCount": - err = unpopulate(val, "PendingPatchCount", &v.PendingPatchCount) - delete(rawMsg, key) - case "rebootStatus": - err = unpopulate(val, "RebootStatus", &v.RebootStatus) - delete(rawMsg, key) - case "startDateTime": - err = unpopulateTimeRFC3339(val, "StartDateTime", &v.StartDateTime) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &v.Status) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineInstanceView. -func (v VirtualMachineInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "assignedHost", v.AssignedHost) - populate(objectMap, "bootDiagnostics", v.BootDiagnostics) - populate(objectMap, "computerName", v.ComputerName) - populate(objectMap, "disks", v.Disks) - populate(objectMap, "extensions", v.Extensions) - populate(objectMap, "hyperVGeneration", v.HyperVGeneration) - populate(objectMap, "maintenanceRedeployStatus", v.MaintenanceRedeployStatus) - populate(objectMap, "osName", v.OSName) - populate(objectMap, "osVersion", v.OSVersion) - populate(objectMap, "patchStatus", v.PatchStatus) - populate(objectMap, "platformFaultDomain", v.PlatformFaultDomain) - populate(objectMap, "platformUpdateDomain", v.PlatformUpdateDomain) - populate(objectMap, "rdpThumbPrint", v.RdpThumbPrint) - populate(objectMap, "statuses", v.Statuses) - populate(objectMap, "vmAgent", v.VMAgent) - populate(objectMap, "vmHealth", v.VMHealth) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineNetworkInterfaceConfigurationProperties. -func (v VirtualMachineNetworkInterfaceConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "dnsSettings", v.DNSSettings) - populate(objectMap, "deleteOption", v.DeleteOption) - populate(objectMap, "dscpConfiguration", v.DscpConfiguration) - populate(objectMap, "enableAcceleratedNetworking", v.EnableAcceleratedNetworking) - populate(objectMap, "enableFpga", v.EnableFpga) - populate(objectMap, "enableIPForwarding", v.EnableIPForwarding) - populate(objectMap, "ipConfigurations", v.IPConfigurations) - populate(objectMap, "networkSecurityGroup", v.NetworkSecurityGroup) - populate(objectMap, "primary", v.Primary) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineNetworkInterfaceDNSSettingsConfiguration. -func (v VirtualMachineNetworkInterfaceDNSSettingsConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "dnsServers", v.DNSServers) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineNetworkInterfaceIPConfigurationProperties. -func (v VirtualMachineNetworkInterfaceIPConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "applicationGatewayBackendAddressPools", v.ApplicationGatewayBackendAddressPools) - populate(objectMap, "applicationSecurityGroups", v.ApplicationSecurityGroups) - populate(objectMap, "loadBalancerBackendAddressPools", v.LoadBalancerBackendAddressPools) - populate(objectMap, "primary", v.Primary) - populate(objectMap, "privateIPAddressVersion", v.PrivateIPAddressVersion) - populate(objectMap, "publicIPAddressConfiguration", v.PublicIPAddressConfiguration) - populate(objectMap, "subnet", v.Subnet) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachinePatchStatus. -func (v VirtualMachinePatchStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "availablePatchSummary", v.AvailablePatchSummary) - populate(objectMap, "configurationStatuses", v.ConfigurationStatuses) - populate(objectMap, "lastPatchInstallationSummary", v.LastPatchInstallationSummary) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineProperties. -func (v VirtualMachineProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "additionalCapabilities", v.AdditionalCapabilities) - populate(objectMap, "applicationProfile", v.ApplicationProfile) - populate(objectMap, "availabilitySet", v.AvailabilitySet) - populate(objectMap, "billingProfile", v.BillingProfile) - populate(objectMap, "capacityReservation", v.CapacityReservation) - populate(objectMap, "diagnosticsProfile", v.DiagnosticsProfile) - populate(objectMap, "evictionPolicy", v.EvictionPolicy) - populate(objectMap, "extensionsTimeBudget", v.ExtensionsTimeBudget) - populate(objectMap, "hardwareProfile", v.HardwareProfile) - populate(objectMap, "host", v.Host) - populate(objectMap, "hostGroup", v.HostGroup) - populate(objectMap, "instanceView", v.InstanceView) - populate(objectMap, "licenseType", v.LicenseType) - populate(objectMap, "networkProfile", v.NetworkProfile) - populate(objectMap, "osProfile", v.OSProfile) - populate(objectMap, "platformFaultDomain", v.PlatformFaultDomain) - populate(objectMap, "priority", v.Priority) - populate(objectMap, "provisioningState", v.ProvisioningState) - populate(objectMap, "proximityPlacementGroup", v.ProximityPlacementGroup) - populate(objectMap, "scheduledEventsProfile", v.ScheduledEventsProfile) - populate(objectMap, "securityProfile", v.SecurityProfile) - populate(objectMap, "storageProfile", v.StorageProfile) - populateTimeRFC3339(objectMap, "timeCreated", v.TimeCreated) - populate(objectMap, "userData", v.UserData) - populate(objectMap, "vmId", v.VMID) - populate(objectMap, "virtualMachineScaleSet", v.VirtualMachineScaleSet) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineProperties. -func (v *VirtualMachineProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "additionalCapabilities": - err = unpopulate(val, "AdditionalCapabilities", &v.AdditionalCapabilities) - delete(rawMsg, key) - case "applicationProfile": - err = unpopulate(val, "ApplicationProfile", &v.ApplicationProfile) - delete(rawMsg, key) - case "availabilitySet": - err = unpopulate(val, "AvailabilitySet", &v.AvailabilitySet) - delete(rawMsg, key) - case "billingProfile": - err = unpopulate(val, "BillingProfile", &v.BillingProfile) - delete(rawMsg, key) - case "capacityReservation": - err = unpopulate(val, "CapacityReservation", &v.CapacityReservation) - delete(rawMsg, key) - case "diagnosticsProfile": - err = unpopulate(val, "DiagnosticsProfile", &v.DiagnosticsProfile) - delete(rawMsg, key) - case "evictionPolicy": - err = unpopulate(val, "EvictionPolicy", &v.EvictionPolicy) - delete(rawMsg, key) - case "extensionsTimeBudget": - err = unpopulate(val, "ExtensionsTimeBudget", &v.ExtensionsTimeBudget) - delete(rawMsg, key) - case "hardwareProfile": - err = unpopulate(val, "HardwareProfile", &v.HardwareProfile) - delete(rawMsg, key) - case "host": - err = unpopulate(val, "Host", &v.Host) - delete(rawMsg, key) - case "hostGroup": - err = unpopulate(val, "HostGroup", &v.HostGroup) - delete(rawMsg, key) - case "instanceView": - err = unpopulate(val, "InstanceView", &v.InstanceView) - delete(rawMsg, key) - case "licenseType": - err = unpopulate(val, "LicenseType", &v.LicenseType) - delete(rawMsg, key) - case "networkProfile": - err = unpopulate(val, "NetworkProfile", &v.NetworkProfile) - delete(rawMsg, key) - case "osProfile": - err = unpopulate(val, "OSProfile", &v.OSProfile) - delete(rawMsg, key) - case "platformFaultDomain": - err = unpopulate(val, "PlatformFaultDomain", &v.PlatformFaultDomain) - delete(rawMsg, key) - case "priority": - err = unpopulate(val, "Priority", &v.Priority) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) - delete(rawMsg, key) - case "proximityPlacementGroup": - err = unpopulate(val, "ProximityPlacementGroup", &v.ProximityPlacementGroup) - delete(rawMsg, key) - case "scheduledEventsProfile": - err = unpopulate(val, "ScheduledEventsProfile", &v.ScheduledEventsProfile) - delete(rawMsg, key) - case "securityProfile": - err = unpopulate(val, "SecurityProfile", &v.SecurityProfile) - delete(rawMsg, key) - case "storageProfile": - err = unpopulate(val, "StorageProfile", &v.StorageProfile) - delete(rawMsg, key) - case "timeCreated": - err = unpopulateTimeRFC3339(val, "TimeCreated", &v.TimeCreated) - delete(rawMsg, key) - case "userData": - err = unpopulate(val, "UserData", &v.UserData) - delete(rawMsg, key) - case "vmId": - err = unpopulate(val, "VMID", &v.VMID) - delete(rawMsg, key) - case "virtualMachineScaleSet": - err = unpopulate(val, "VirtualMachineScaleSet", &v.VirtualMachineScaleSet) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachinePublicIPAddressConfigurationProperties. -func (v VirtualMachinePublicIPAddressConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "dnsSettings", v.DNSSettings) - populate(objectMap, "deleteOption", v.DeleteOption) - populate(objectMap, "ipTags", v.IPTags) - populate(objectMap, "idleTimeoutInMinutes", v.IdleTimeoutInMinutes) - populate(objectMap, "publicIPAddressVersion", v.PublicIPAddressVersion) - populate(objectMap, "publicIPAllocationMethod", v.PublicIPAllocationMethod) - populate(objectMap, "publicIPPrefix", v.PublicIPPrefix) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineRunCommand. -func (v VirtualMachineRunCommand) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", v.ID) - populate(objectMap, "location", v.Location) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "tags", v.Tags) - populate(objectMap, "type", v.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineRunCommandInstanceView. -func (v VirtualMachineRunCommandInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "endTime", v.EndTime) - populate(objectMap, "error", v.Error) - populate(objectMap, "executionMessage", v.ExecutionMessage) - populate(objectMap, "executionState", v.ExecutionState) - populate(objectMap, "exitCode", v.ExitCode) - populate(objectMap, "output", v.Output) - populateTimeRFC3339(objectMap, "startTime", v.StartTime) - populate(objectMap, "statuses", v.Statuses) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineRunCommandInstanceView. -func (v *VirtualMachineRunCommandInstanceView) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "endTime": - err = unpopulateTimeRFC3339(val, "EndTime", &v.EndTime) - delete(rawMsg, key) - case "error": - err = unpopulate(val, "Error", &v.Error) - delete(rawMsg, key) - case "executionMessage": - err = unpopulate(val, "ExecutionMessage", &v.ExecutionMessage) - delete(rawMsg, key) - case "executionState": - err = unpopulate(val, "ExecutionState", &v.ExecutionState) - delete(rawMsg, key) - case "exitCode": - err = unpopulate(val, "ExitCode", &v.ExitCode) - delete(rawMsg, key) - case "output": - err = unpopulate(val, "Output", &v.Output) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &v.StartTime) - delete(rawMsg, key) - case "statuses": - err = unpopulate(val, "Statuses", &v.Statuses) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineRunCommandProperties. -func (v VirtualMachineRunCommandProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "asyncExecution", v.AsyncExecution) - populate(objectMap, "errorBlobUri", v.ErrorBlobURI) - populate(objectMap, "instanceView", v.InstanceView) - populate(objectMap, "outputBlobUri", v.OutputBlobURI) - populate(objectMap, "parameters", v.Parameters) - populate(objectMap, "protectedParameters", v.ProtectedParameters) - populate(objectMap, "provisioningState", v.ProvisioningState) - populate(objectMap, "runAsPassword", v.RunAsPassword) - populate(objectMap, "runAsUser", v.RunAsUser) - populate(objectMap, "source", v.Source) - populate(objectMap, "timeoutInSeconds", v.TimeoutInSeconds) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineRunCommandUpdate. -func (v VirtualMachineRunCommandUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "tags", v.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSet. -func (v VirtualMachineScaleSet) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "extendedLocation", v.ExtendedLocation) - populate(objectMap, "id", v.ID) - populate(objectMap, "identity", v.Identity) - populate(objectMap, "location", v.Location) - populate(objectMap, "name", v.Name) - populate(objectMap, "plan", v.Plan) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "sku", v.SKU) - populate(objectMap, "tags", v.Tags) - populate(objectMap, "type", v.Type) - populate(objectMap, "zones", v.Zones) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetExtensionProfile. -func (v VirtualMachineScaleSetExtensionProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "extensions", v.Extensions) - populate(objectMap, "extensionsTimeBudget", v.ExtensionsTimeBudget) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetExtensionProperties. -func (v VirtualMachineScaleSetExtensionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "autoUpgradeMinorVersion", v.AutoUpgradeMinorVersion) - populate(objectMap, "enableAutomaticUpgrade", v.EnableAutomaticUpgrade) - populate(objectMap, "forceUpdateTag", v.ForceUpdateTag) - populate(objectMap, "protectedSettings", &v.ProtectedSettings) - populate(objectMap, "protectedSettingsFromKeyVault", &v.ProtectedSettingsFromKeyVault) - populate(objectMap, "provisionAfterExtensions", v.ProvisionAfterExtensions) - populate(objectMap, "provisioningState", v.ProvisioningState) - populate(objectMap, "publisher", v.Publisher) - populate(objectMap, "settings", &v.Settings) - populate(objectMap, "suppressFailures", v.SuppressFailures) - populate(objectMap, "type", v.Type) - populate(objectMap, "typeHandlerVersion", v.TypeHandlerVersion) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetExtensionUpdate. -func (v VirtualMachineScaleSetExtensionUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", v.ID) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "type", v.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetIPConfigurationProperties. -func (v VirtualMachineScaleSetIPConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "applicationGatewayBackendAddressPools", v.ApplicationGatewayBackendAddressPools) - populate(objectMap, "applicationSecurityGroups", v.ApplicationSecurityGroups) - populate(objectMap, "loadBalancerBackendAddressPools", v.LoadBalancerBackendAddressPools) - populate(objectMap, "loadBalancerInboundNatPools", v.LoadBalancerInboundNatPools) - populate(objectMap, "primary", v.Primary) - populate(objectMap, "privateIPAddressVersion", v.PrivateIPAddressVersion) - populate(objectMap, "publicIPAddressConfiguration", v.PublicIPAddressConfiguration) - populate(objectMap, "subnet", v.Subnet) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetIdentity. -func (v VirtualMachineScaleSetIdentity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "principalId", v.PrincipalID) - populate(objectMap, "tenantId", v.TenantID) - populate(objectMap, "type", v.Type) - populate(objectMap, "userAssignedIdentities", v.UserAssignedIdentities) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetNetworkConfigurationDNSSettings. -func (v VirtualMachineScaleSetNetworkConfigurationDNSSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "dnsServers", v.DNSServers) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetNetworkConfigurationProperties. -func (v VirtualMachineScaleSetNetworkConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "dnsSettings", v.DNSSettings) - populate(objectMap, "deleteOption", v.DeleteOption) - populate(objectMap, "enableAcceleratedNetworking", v.EnableAcceleratedNetworking) - populate(objectMap, "enableFpga", v.EnableFpga) - populate(objectMap, "enableIPForwarding", v.EnableIPForwarding) - populate(objectMap, "ipConfigurations", v.IPConfigurations) - populate(objectMap, "networkSecurityGroup", v.NetworkSecurityGroup) - populate(objectMap, "primary", v.Primary) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetNetworkProfile. -func (v VirtualMachineScaleSetNetworkProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "healthProbe", v.HealthProbe) - populate(objectMap, "networkApiVersion", v.NetworkAPIVersion) - populate(objectMap, "networkInterfaceConfigurations", v.NetworkInterfaceConfigurations) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetOSDisk. -func (v VirtualMachineScaleSetOSDisk) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "caching", v.Caching) - populate(objectMap, "createOption", v.CreateOption) - populate(objectMap, "deleteOption", v.DeleteOption) - populate(objectMap, "diffDiskSettings", v.DiffDiskSettings) - populate(objectMap, "diskSizeGB", v.DiskSizeGB) - populate(objectMap, "image", v.Image) - populate(objectMap, "managedDisk", v.ManagedDisk) - populate(objectMap, "name", v.Name) - populate(objectMap, "osType", v.OSType) - populate(objectMap, "vhdContainers", v.VhdContainers) - populate(objectMap, "writeAcceleratorEnabled", v.WriteAcceleratorEnabled) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetOSProfile. -func (v VirtualMachineScaleSetOSProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "adminPassword", v.AdminPassword) - populate(objectMap, "adminUsername", v.AdminUsername) - populate(objectMap, "allowExtensionOperations", v.AllowExtensionOperations) - populate(objectMap, "computerNamePrefix", v.ComputerNamePrefix) - populate(objectMap, "customData", v.CustomData) - populate(objectMap, "linuxConfiguration", v.LinuxConfiguration) - populate(objectMap, "secrets", v.Secrets) - populate(objectMap, "windowsConfiguration", v.WindowsConfiguration) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetProperties. -func (v VirtualMachineScaleSetProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "additionalCapabilities", v.AdditionalCapabilities) - populate(objectMap, "automaticRepairsPolicy", v.AutomaticRepairsPolicy) - populate(objectMap, "doNotRunExtensionsOnOverprovisionedVMs", v.DoNotRunExtensionsOnOverprovisionedVMs) - populate(objectMap, "hostGroup", v.HostGroup) - populate(objectMap, "orchestrationMode", v.OrchestrationMode) - populate(objectMap, "overprovision", v.Overprovision) - populate(objectMap, "platformFaultDomainCount", v.PlatformFaultDomainCount) - populate(objectMap, "provisioningState", v.ProvisioningState) - populate(objectMap, "proximityPlacementGroup", v.ProximityPlacementGroup) - populate(objectMap, "scaleInPolicy", v.ScaleInPolicy) - populate(objectMap, "singlePlacementGroup", v.SinglePlacementGroup) - populate(objectMap, "spotRestorePolicy", v.SpotRestorePolicy) - populateTimeRFC3339(objectMap, "timeCreated", v.TimeCreated) - populate(objectMap, "uniqueId", v.UniqueID) - populate(objectMap, "upgradePolicy", v.UpgradePolicy) - populate(objectMap, "virtualMachineProfile", v.VirtualMachineProfile) - populate(objectMap, "zoneBalance", v.ZoneBalance) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetProperties. -func (v *VirtualMachineScaleSetProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "additionalCapabilities": - err = unpopulate(val, "AdditionalCapabilities", &v.AdditionalCapabilities) - delete(rawMsg, key) - case "automaticRepairsPolicy": - err = unpopulate(val, "AutomaticRepairsPolicy", &v.AutomaticRepairsPolicy) - delete(rawMsg, key) - case "doNotRunExtensionsOnOverprovisionedVMs": - err = unpopulate(val, "DoNotRunExtensionsOnOverprovisionedVMs", &v.DoNotRunExtensionsOnOverprovisionedVMs) - delete(rawMsg, key) - case "hostGroup": - err = unpopulate(val, "HostGroup", &v.HostGroup) - delete(rawMsg, key) - case "orchestrationMode": - err = unpopulate(val, "OrchestrationMode", &v.OrchestrationMode) - delete(rawMsg, key) - case "overprovision": - err = unpopulate(val, "Overprovision", &v.Overprovision) - delete(rawMsg, key) - case "platformFaultDomainCount": - err = unpopulate(val, "PlatformFaultDomainCount", &v.PlatformFaultDomainCount) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) - delete(rawMsg, key) - case "proximityPlacementGroup": - err = unpopulate(val, "ProximityPlacementGroup", &v.ProximityPlacementGroup) - delete(rawMsg, key) - case "scaleInPolicy": - err = unpopulate(val, "ScaleInPolicy", &v.ScaleInPolicy) - delete(rawMsg, key) - case "singlePlacementGroup": - err = unpopulate(val, "SinglePlacementGroup", &v.SinglePlacementGroup) - delete(rawMsg, key) - case "spotRestorePolicy": - err = unpopulate(val, "SpotRestorePolicy", &v.SpotRestorePolicy) - delete(rawMsg, key) - case "timeCreated": - err = unpopulateTimeRFC3339(val, "TimeCreated", &v.TimeCreated) - delete(rawMsg, key) - case "uniqueId": - err = unpopulate(val, "UniqueID", &v.UniqueID) - delete(rawMsg, key) - case "upgradePolicy": - err = unpopulate(val, "UpgradePolicy", &v.UpgradePolicy) - delete(rawMsg, key) - case "virtualMachineProfile": - err = unpopulate(val, "VirtualMachineProfile", &v.VirtualMachineProfile) - delete(rawMsg, key) - case "zoneBalance": - err = unpopulate(val, "ZoneBalance", &v.ZoneBalance) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetPublicIPAddressConfigurationProperties. -func (v VirtualMachineScaleSetPublicIPAddressConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "dnsSettings", v.DNSSettings) - populate(objectMap, "deleteOption", v.DeleteOption) - populate(objectMap, "ipTags", v.IPTags) - populate(objectMap, "idleTimeoutInMinutes", v.IdleTimeoutInMinutes) - populate(objectMap, "publicIPAddressVersion", v.PublicIPAddressVersion) - populate(objectMap, "publicIPPrefix", v.PublicIPPrefix) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetReimageParameters. -func (v VirtualMachineScaleSetReimageParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "instanceIds", v.InstanceIDs) - populate(objectMap, "tempDisk", v.TempDisk) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetStorageProfile. -func (v VirtualMachineScaleSetStorageProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "dataDisks", v.DataDisks) - populate(objectMap, "imageReference", v.ImageReference) - populate(objectMap, "osDisk", v.OSDisk) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetUpdate. -func (v VirtualMachineScaleSetUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "identity", v.Identity) - populate(objectMap, "plan", v.Plan) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "sku", v.SKU) - populate(objectMap, "tags", v.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetUpdateIPConfigurationProperties. -func (v VirtualMachineScaleSetUpdateIPConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "applicationGatewayBackendAddressPools", v.ApplicationGatewayBackendAddressPools) - populate(objectMap, "applicationSecurityGroups", v.ApplicationSecurityGroups) - populate(objectMap, "loadBalancerBackendAddressPools", v.LoadBalancerBackendAddressPools) - populate(objectMap, "loadBalancerInboundNatPools", v.LoadBalancerInboundNatPools) - populate(objectMap, "primary", v.Primary) - populate(objectMap, "privateIPAddressVersion", v.PrivateIPAddressVersion) - populate(objectMap, "publicIPAddressConfiguration", v.PublicIPAddressConfiguration) - populate(objectMap, "subnet", v.Subnet) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetUpdateNetworkConfigurationProperties. -func (v VirtualMachineScaleSetUpdateNetworkConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "dnsSettings", v.DNSSettings) - populate(objectMap, "deleteOption", v.DeleteOption) - populate(objectMap, "enableAcceleratedNetworking", v.EnableAcceleratedNetworking) - populate(objectMap, "enableFpga", v.EnableFpga) - populate(objectMap, "enableIPForwarding", v.EnableIPForwarding) - populate(objectMap, "ipConfigurations", v.IPConfigurations) - populate(objectMap, "networkSecurityGroup", v.NetworkSecurityGroup) - populate(objectMap, "primary", v.Primary) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetUpdateNetworkProfile. -func (v VirtualMachineScaleSetUpdateNetworkProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "healthProbe", v.HealthProbe) - populate(objectMap, "networkApiVersion", v.NetworkAPIVersion) - populate(objectMap, "networkInterfaceConfigurations", v.NetworkInterfaceConfigurations) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetUpdateOSDisk. -func (v VirtualMachineScaleSetUpdateOSDisk) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "caching", v.Caching) - populate(objectMap, "deleteOption", v.DeleteOption) - populate(objectMap, "diskSizeGB", v.DiskSizeGB) - populate(objectMap, "image", v.Image) - populate(objectMap, "managedDisk", v.ManagedDisk) - populate(objectMap, "vhdContainers", v.VhdContainers) - populate(objectMap, "writeAcceleratorEnabled", v.WriteAcceleratorEnabled) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetUpdateOSProfile. -func (v VirtualMachineScaleSetUpdateOSProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "customData", v.CustomData) - populate(objectMap, "linuxConfiguration", v.LinuxConfiguration) - populate(objectMap, "secrets", v.Secrets) - populate(objectMap, "windowsConfiguration", v.WindowsConfiguration) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetUpdateStorageProfile. -func (v VirtualMachineScaleSetUpdateStorageProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "dataDisks", v.DataDisks) - populate(objectMap, "imageReference", v.ImageReference) - populate(objectMap, "osDisk", v.OSDisk) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetVM. -func (v VirtualMachineScaleSetVM) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", v.ID) - populate(objectMap, "identity", v.Identity) - populate(objectMap, "instanceId", v.InstanceID) - populate(objectMap, "location", v.Location) - populate(objectMap, "name", v.Name) - populate(objectMap, "plan", v.Plan) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "resources", v.Resources) - populate(objectMap, "sku", v.SKU) - populate(objectMap, "tags", v.Tags) - populate(objectMap, "type", v.Type) - populate(objectMap, "zones", v.Zones) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetVMExtensionUpdate. -func (v VirtualMachineScaleSetVMExtensionUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", v.ID) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "type", v.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetVMInstanceIDs. -func (v VirtualMachineScaleSetVMInstanceIDs) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "instanceIds", v.InstanceIDs) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetVMInstanceRequiredIDs. -func (v VirtualMachineScaleSetVMInstanceRequiredIDs) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "instanceIds", v.InstanceIDs) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetVMInstanceView. -func (v VirtualMachineScaleSetVMInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "assignedHost", v.AssignedHost) - populate(objectMap, "bootDiagnostics", v.BootDiagnostics) - populate(objectMap, "disks", v.Disks) - populate(objectMap, "extensions", v.Extensions) - populate(objectMap, "maintenanceRedeployStatus", v.MaintenanceRedeployStatus) - populate(objectMap, "placementGroupId", v.PlacementGroupID) - populate(objectMap, "platformFaultDomain", v.PlatformFaultDomain) - populate(objectMap, "platformUpdateDomain", v.PlatformUpdateDomain) - populate(objectMap, "rdpThumbPrint", v.RdpThumbPrint) - populate(objectMap, "statuses", v.Statuses) - populate(objectMap, "vmAgent", v.VMAgent) - populate(objectMap, "vmHealth", v.VMHealth) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetVMNetworkProfileConfiguration. -func (v VirtualMachineScaleSetVMNetworkProfileConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "networkInterfaceConfigurations", v.NetworkInterfaceConfigurations) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineSoftwarePatchProperties. -func (v *VirtualMachineSoftwarePatchProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "activityId": - err = unpopulate(val, "ActivityID", &v.ActivityID) - delete(rawMsg, key) - case "assessmentState": - err = unpopulate(val, "AssessmentState", &v.AssessmentState) - delete(rawMsg, key) - case "classifications": - err = unpopulate(val, "Classifications", &v.Classifications) - delete(rawMsg, key) - case "kbId": - err = unpopulate(val, "KbID", &v.KbID) - delete(rawMsg, key) - case "lastModifiedDateTime": - err = unpopulateTimeRFC3339(val, "LastModifiedDateTime", &v.LastModifiedDateTime) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "patchId": - err = unpopulate(val, "PatchID", &v.PatchID) - delete(rawMsg, key) - case "publishedDate": - err = unpopulateTimeRFC3339(val, "PublishedDate", &v.PublishedDate) - delete(rawMsg, key) - case "rebootBehavior": - err = unpopulate(val, "RebootBehavior", &v.RebootBehavior) - delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &v.Version) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineUpdate. -func (v VirtualMachineUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "identity", v.Identity) - populate(objectMap, "plan", v.Plan) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "tags", v.Tags) - populate(objectMap, "zones", v.Zones) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type WinRMConfiguration. -func (w WinRMConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "listeners", w.Listeners) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type WindowsConfiguration. -func (w WindowsConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "additionalUnattendContent", w.AdditionalUnattendContent) - populate(objectMap, "enableAutomaticUpdates", w.EnableAutomaticUpdates) - populate(objectMap, "patchSettings", w.PatchSettings) - populate(objectMap, "provisionVMAgent", w.ProvisionVMAgent) - populate(objectMap, "timeZone", w.TimeZone) - populate(objectMap, "winRM", w.WinRM) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type WindowsParameters. -func (w WindowsParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "classificationsToInclude", w.ClassificationsToInclude) - populate(objectMap, "excludeKbsRequiringReboot", w.ExcludeKbsRequiringReboot) - populate(objectMap, "kbNumbersToExclude", w.KbNumbersToExclude) - populate(objectMap, "kbNumbersToInclude", w.KbNumbersToInclude) - populateTimeRFC3339(objectMap, "maxPatchPublishDate", w.MaxPatchPublishDate) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type WindowsParameters. -func (w *WindowsParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", w, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "classificationsToInclude": - err = unpopulate(val, "ClassificationsToInclude", &w.ClassificationsToInclude) - delete(rawMsg, key) - case "excludeKbsRequiringReboot": - err = unpopulate(val, "ExcludeKbsRequiringReboot", &w.ExcludeKbsRequiringReboot) - delete(rawMsg, key) - case "kbNumbersToExclude": - err = unpopulate(val, "KbNumbersToExclude", &w.KbNumbersToExclude) - delete(rawMsg, key) - case "kbNumbersToInclude": - err = unpopulate(val, "KbNumbersToInclude", &w.KbNumbersToInclude) - delete(rawMsg, key) - case "maxPatchPublishDate": - err = unpopulateTimeRFC3339(val, "MaxPatchPublishDate", &w.MaxPatchPublishDate) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", w, err) - } - } - return nil -} - -func populate(m map[string]interface{}, k string, v interface{}) { - if v == nil { - return - } else if azcore.IsNullValue(v) { - m[k] = nil - } else if !reflect.ValueOf(v).IsNil() { - m[k] = v - } -} - -func unpopulate(data json.RawMessage, fn string, v interface{}) error { - if data == nil { - return nil - } - if err := json.Unmarshal(data, v); err != nil { - return fmt.Errorf("struct field %s: %v", fn, err) - } - return nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_operations_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_operations_client.go deleted file mode 100644 index 4bc14640..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_operations_client.go +++ /dev/null @@ -1,98 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" -) - -// OperationsClient contains the methods for the Operations group. -// Don't use this type directly, use NewOperationsClient() instead. -type OperationsClient struct { - host string - pl runtime.Pipeline -} - -// NewOperationsClient creates a new instance of OperationsClient with the specified values. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &OperationsClient{ - host: ep, - pl: pl, - } - return client, nil -} - -// NewListPager - Gets a list of compute operations. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. -func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ - More: func(page OperationsClientListResponse) bool { - return false - }, - Fetcher: func(ctx context.Context, page *OperationsClientListResponse) (OperationsClientListResponse, error) { - req, err := client.listCreateRequest(ctx, options) - if err != nil { - return OperationsClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return OperationsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return OperationsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *OperationsClient) listCreateRequest(ctx context.Context, options *OperationsClientListOptions) (*policy.Request, error) { - urlPath := "/providers/Microsoft.Compute/operations" - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *OperationsClient) listHandleResponse(resp *http.Response) (OperationsClientListResponse, error) { - result := OperationsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.OperationListResult); err != nil { - return OperationsClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_proximityplacementgroups_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_proximityplacementgroups_client.go deleted file mode 100644 index 4c1fa00c..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_proximityplacementgroups_client.go +++ /dev/null @@ -1,405 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// ProximityPlacementGroupsClient contains the methods for the ProximityPlacementGroups group. -// Don't use this type directly, use NewProximityPlacementGroupsClient() instead. -type ProximityPlacementGroupsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewProximityPlacementGroupsClient creates a new instance of ProximityPlacementGroupsClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewProximityPlacementGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ProximityPlacementGroupsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &ProximityPlacementGroupsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// CreateOrUpdate - Create or update a proximity placement group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// proximityPlacementGroupName - The name of the proximity placement group. -// parameters - Parameters supplied to the Create Proximity Placement Group operation. -// options - ProximityPlacementGroupsClientCreateOrUpdateOptions contains the optional parameters for the ProximityPlacementGroupsClient.CreateOrUpdate -// method. -func (client *ProximityPlacementGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, parameters ProximityPlacementGroup, options *ProximityPlacementGroupsClientCreateOrUpdateOptions) (ProximityPlacementGroupsClientCreateOrUpdateResponse, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, proximityPlacementGroupName, parameters, options) - if err != nil { - return ProximityPlacementGroupsClientCreateOrUpdateResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ProximityPlacementGroupsClientCreateOrUpdateResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return ProximityPlacementGroupsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) - } - return client.createOrUpdateHandleResponse(resp) -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ProximityPlacementGroupsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, parameters ProximityPlacementGroup, options *ProximityPlacementGroupsClientCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups/{proximityPlacementGroupName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if proximityPlacementGroupName == "" { - return nil, errors.New("parameter proximityPlacementGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{proximityPlacementGroupName}", url.PathEscape(proximityPlacementGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// createOrUpdateHandleResponse handles the CreateOrUpdate response. -func (client *ProximityPlacementGroupsClient) createOrUpdateHandleResponse(resp *http.Response) (ProximityPlacementGroupsClientCreateOrUpdateResponse, error) { - result := ProximityPlacementGroupsClientCreateOrUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ProximityPlacementGroup); err != nil { - return ProximityPlacementGroupsClientCreateOrUpdateResponse{}, err - } - return result, nil -} - -// Delete - Delete a proximity placement group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// proximityPlacementGroupName - The name of the proximity placement group. -// options - ProximityPlacementGroupsClientDeleteOptions contains the optional parameters for the ProximityPlacementGroupsClient.Delete -// method. -func (client *ProximityPlacementGroupsClient) Delete(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, options *ProximityPlacementGroupsClientDeleteOptions) (ProximityPlacementGroupsClientDeleteResponse, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, proximityPlacementGroupName, options) - if err != nil { - return ProximityPlacementGroupsClientDeleteResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ProximityPlacementGroupsClientDeleteResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ProximityPlacementGroupsClientDeleteResponse{}, runtime.NewResponseError(resp) - } - return ProximityPlacementGroupsClientDeleteResponse{}, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *ProximityPlacementGroupsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, options *ProximityPlacementGroupsClientDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups/{proximityPlacementGroupName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if proximityPlacementGroupName == "" { - return nil, errors.New("parameter proximityPlacementGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{proximityPlacementGroupName}", url.PathEscape(proximityPlacementGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Retrieves information about a proximity placement group . -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// proximityPlacementGroupName - The name of the proximity placement group. -// options - ProximityPlacementGroupsClientGetOptions contains the optional parameters for the ProximityPlacementGroupsClient.Get -// method. -func (client *ProximityPlacementGroupsClient) Get(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, options *ProximityPlacementGroupsClientGetOptions) (ProximityPlacementGroupsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, proximityPlacementGroupName, options) - if err != nil { - return ProximityPlacementGroupsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ProximityPlacementGroupsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ProximityPlacementGroupsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *ProximityPlacementGroupsClient) getCreateRequest(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, options *ProximityPlacementGroupsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups/{proximityPlacementGroupName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if proximityPlacementGroupName == "" { - return nil, errors.New("parameter proximityPlacementGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{proximityPlacementGroupName}", url.PathEscape(proximityPlacementGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.IncludeColocationStatus != nil { - reqQP.Set("includeColocationStatus", *options.IncludeColocationStatus) - } - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *ProximityPlacementGroupsClient) getHandleResponse(resp *http.Response) (ProximityPlacementGroupsClientGetResponse, error) { - result := ProximityPlacementGroupsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ProximityPlacementGroup); err != nil { - return ProximityPlacementGroupsClientGetResponse{}, err - } - return result, nil -} - -// NewListByResourceGroupPager - Lists all proximity placement groups in a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// options - ProximityPlacementGroupsClientListByResourceGroupOptions contains the optional parameters for the ProximityPlacementGroupsClient.ListByResourceGroup -// method. -func (client *ProximityPlacementGroupsClient) NewListByResourceGroupPager(resourceGroupName string, options *ProximityPlacementGroupsClientListByResourceGroupOptions) *runtime.Pager[ProximityPlacementGroupsClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[ProximityPlacementGroupsClientListByResourceGroupResponse]{ - More: func(page ProximityPlacementGroupsClientListByResourceGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ProximityPlacementGroupsClientListByResourceGroupResponse) (ProximityPlacementGroupsClientListByResourceGroupResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return ProximityPlacementGroupsClientListByResourceGroupResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ProximityPlacementGroupsClientListByResourceGroupResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ProximityPlacementGroupsClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) - } - return client.listByResourceGroupHandleResponse(resp) - }, - }) -} - -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *ProximityPlacementGroupsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ProximityPlacementGroupsClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *ProximityPlacementGroupsClient) listByResourceGroupHandleResponse(resp *http.Response) (ProximityPlacementGroupsClientListByResourceGroupResponse, error) { - result := ProximityPlacementGroupsClientListByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ProximityPlacementGroupListResult); err != nil { - return ProximityPlacementGroupsClientListByResourceGroupResponse{}, err - } - return result, nil -} - -// NewListBySubscriptionPager - Lists all proximity placement groups in a subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// options - ProximityPlacementGroupsClientListBySubscriptionOptions contains the optional parameters for the ProximityPlacementGroupsClient.ListBySubscription -// method. -func (client *ProximityPlacementGroupsClient) NewListBySubscriptionPager(options *ProximityPlacementGroupsClientListBySubscriptionOptions) *runtime.Pager[ProximityPlacementGroupsClientListBySubscriptionResponse] { - return runtime.NewPager(runtime.PagingHandler[ProximityPlacementGroupsClientListBySubscriptionResponse]{ - More: func(page ProximityPlacementGroupsClientListBySubscriptionResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ProximityPlacementGroupsClientListBySubscriptionResponse) (ProximityPlacementGroupsClientListBySubscriptionResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listBySubscriptionCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return ProximityPlacementGroupsClientListBySubscriptionResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ProximityPlacementGroupsClientListBySubscriptionResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ProximityPlacementGroupsClientListBySubscriptionResponse{}, runtime.NewResponseError(resp) - } - return client.listBySubscriptionHandleResponse(resp) - }, - }) -} - -// listBySubscriptionCreateRequest creates the ListBySubscription request. -func (client *ProximityPlacementGroupsClient) listBySubscriptionCreateRequest(ctx context.Context, options *ProximityPlacementGroupsClientListBySubscriptionOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/proximityPlacementGroups" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listBySubscriptionHandleResponse handles the ListBySubscription response. -func (client *ProximityPlacementGroupsClient) listBySubscriptionHandleResponse(resp *http.Response) (ProximityPlacementGroupsClientListBySubscriptionResponse, error) { - result := ProximityPlacementGroupsClientListBySubscriptionResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ProximityPlacementGroupListResult); err != nil { - return ProximityPlacementGroupsClientListBySubscriptionResponse{}, err - } - return result, nil -} - -// Update - Update a proximity placement group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// proximityPlacementGroupName - The name of the proximity placement group. -// parameters - Parameters supplied to the Update Proximity Placement Group operation. -// options - ProximityPlacementGroupsClientUpdateOptions contains the optional parameters for the ProximityPlacementGroupsClient.Update -// method. -func (client *ProximityPlacementGroupsClient) Update(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, parameters ProximityPlacementGroupUpdate, options *ProximityPlacementGroupsClientUpdateOptions) (ProximityPlacementGroupsClientUpdateResponse, error) { - req, err := client.updateCreateRequest(ctx, resourceGroupName, proximityPlacementGroupName, parameters, options) - if err != nil { - return ProximityPlacementGroupsClientUpdateResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ProximityPlacementGroupsClientUpdateResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ProximityPlacementGroupsClientUpdateResponse{}, runtime.NewResponseError(resp) - } - return client.updateHandleResponse(resp) -} - -// updateCreateRequest creates the Update request. -func (client *ProximityPlacementGroupsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, parameters ProximityPlacementGroupUpdate, options *ProximityPlacementGroupsClientUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups/{proximityPlacementGroupName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if proximityPlacementGroupName == "" { - return nil, errors.New("parameter proximityPlacementGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{proximityPlacementGroupName}", url.PathEscape(proximityPlacementGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// updateHandleResponse handles the Update response. -func (client *ProximityPlacementGroupsClient) updateHandleResponse(resp *http.Response) (ProximityPlacementGroupsClientUpdateResponse, error) { - result := ProximityPlacementGroupsClientUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ProximityPlacementGroup); err != nil { - return ProximityPlacementGroupsClientUpdateResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_resourceskus_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_resourceskus_client.go deleted file mode 100644 index b064dbdd..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_resourceskus_client.go +++ /dev/null @@ -1,121 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// ResourceSKUsClient contains the methods for the ResourceSKUs group. -// Don't use this type directly, use NewResourceSKUsClient() instead. -type ResourceSKUsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewResourceSKUsClient creates a new instance of ResourceSKUsClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewResourceSKUsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ResourceSKUsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &ResourceSKUsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// NewListPager - Gets the list of Microsoft.Compute SKUs available for your Subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-01 -// options - ResourceSKUsClientListOptions contains the optional parameters for the ResourceSKUsClient.List method. -func (client *ResourceSKUsClient) NewListPager(options *ResourceSKUsClientListOptions) *runtime.Pager[ResourceSKUsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[ResourceSKUsClientListResponse]{ - More: func(page ResourceSKUsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ResourceSKUsClientListResponse) (ResourceSKUsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return ResourceSKUsClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ResourceSKUsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ResourceSKUsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *ResourceSKUsClient) listCreateRequest(ctx context.Context, options *ResourceSKUsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/skus" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-01") - if options != nil && options.Filter != nil { - reqQP.Set("$filter", *options.Filter) - } - if options != nil && options.IncludeExtendedLocations != nil { - reqQP.Set("includeExtendedLocations", *options.IncludeExtendedLocations) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *ResourceSKUsClient) listHandleResponse(resp *http.Response) (ResourceSKUsClientListResponse, error) { - result := ResourceSKUsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ResourceSKUsResult); err != nil { - return ResourceSKUsClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_response_types.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_response_types.go deleted file mode 100644 index 4b95829d..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_response_types.go +++ /dev/null @@ -1,1403 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import "io" - -// AvailabilitySetsClientCreateOrUpdateResponse contains the response from method AvailabilitySetsClient.CreateOrUpdate. -type AvailabilitySetsClientCreateOrUpdateResponse struct { - AvailabilitySet -} - -// AvailabilitySetsClientDeleteResponse contains the response from method AvailabilitySetsClient.Delete. -type AvailabilitySetsClientDeleteResponse struct { - // placeholder for future response values -} - -// AvailabilitySetsClientGetResponse contains the response from method AvailabilitySetsClient.Get. -type AvailabilitySetsClientGetResponse struct { - AvailabilitySet -} - -// AvailabilitySetsClientListAvailableSizesResponse contains the response from method AvailabilitySetsClient.ListAvailableSizes. -type AvailabilitySetsClientListAvailableSizesResponse struct { - VirtualMachineSizeListResult -} - -// AvailabilitySetsClientListBySubscriptionResponse contains the response from method AvailabilitySetsClient.ListBySubscription. -type AvailabilitySetsClientListBySubscriptionResponse struct { - AvailabilitySetListResult -} - -// AvailabilitySetsClientListResponse contains the response from method AvailabilitySetsClient.List. -type AvailabilitySetsClientListResponse struct { - AvailabilitySetListResult -} - -// AvailabilitySetsClientUpdateResponse contains the response from method AvailabilitySetsClient.Update. -type AvailabilitySetsClientUpdateResponse struct { - AvailabilitySet -} - -// CapacityReservationGroupsClientCreateOrUpdateResponse contains the response from method CapacityReservationGroupsClient.CreateOrUpdate. -type CapacityReservationGroupsClientCreateOrUpdateResponse struct { - CapacityReservationGroup -} - -// CapacityReservationGroupsClientDeleteResponse contains the response from method CapacityReservationGroupsClient.Delete. -type CapacityReservationGroupsClientDeleteResponse struct { - // placeholder for future response values -} - -// CapacityReservationGroupsClientGetResponse contains the response from method CapacityReservationGroupsClient.Get. -type CapacityReservationGroupsClientGetResponse struct { - CapacityReservationGroup -} - -// CapacityReservationGroupsClientListByResourceGroupResponse contains the response from method CapacityReservationGroupsClient.ListByResourceGroup. -type CapacityReservationGroupsClientListByResourceGroupResponse struct { - CapacityReservationGroupListResult -} - -// CapacityReservationGroupsClientListBySubscriptionResponse contains the response from method CapacityReservationGroupsClient.ListBySubscription. -type CapacityReservationGroupsClientListBySubscriptionResponse struct { - CapacityReservationGroupListResult -} - -// CapacityReservationGroupsClientUpdateResponse contains the response from method CapacityReservationGroupsClient.Update. -type CapacityReservationGroupsClientUpdateResponse struct { - CapacityReservationGroup -} - -// CapacityReservationsClientCreateOrUpdateResponse contains the response from method CapacityReservationsClient.CreateOrUpdate. -type CapacityReservationsClientCreateOrUpdateResponse struct { - CapacityReservation -} - -// CapacityReservationsClientDeleteResponse contains the response from method CapacityReservationsClient.Delete. -type CapacityReservationsClientDeleteResponse struct { - // placeholder for future response values -} - -// CapacityReservationsClientGetResponse contains the response from method CapacityReservationsClient.Get. -type CapacityReservationsClientGetResponse struct { - CapacityReservation -} - -// CapacityReservationsClientListByCapacityReservationGroupResponse contains the response from method CapacityReservationsClient.ListByCapacityReservationGroup. -type CapacityReservationsClientListByCapacityReservationGroupResponse struct { - CapacityReservationListResult -} - -// CapacityReservationsClientUpdateResponse contains the response from method CapacityReservationsClient.Update. -type CapacityReservationsClientUpdateResponse struct { - CapacityReservation -} - -// CloudServiceOperatingSystemsClientGetOSFamilyResponse contains the response from method CloudServiceOperatingSystemsClient.GetOSFamily. -type CloudServiceOperatingSystemsClientGetOSFamilyResponse struct { - OSFamily -} - -// CloudServiceOperatingSystemsClientGetOSVersionResponse contains the response from method CloudServiceOperatingSystemsClient.GetOSVersion. -type CloudServiceOperatingSystemsClientGetOSVersionResponse struct { - OSVersion -} - -// CloudServiceOperatingSystemsClientListOSFamiliesResponse contains the response from method CloudServiceOperatingSystemsClient.ListOSFamilies. -type CloudServiceOperatingSystemsClientListOSFamiliesResponse struct { - OSFamilyListResult -} - -// CloudServiceOperatingSystemsClientListOSVersionsResponse contains the response from method CloudServiceOperatingSystemsClient.ListOSVersions. -type CloudServiceOperatingSystemsClientListOSVersionsResponse struct { - OSVersionListResult -} - -// CloudServiceRoleInstancesClientDeleteResponse contains the response from method CloudServiceRoleInstancesClient.Delete. -type CloudServiceRoleInstancesClientDeleteResponse struct { - // placeholder for future response values -} - -// CloudServiceRoleInstancesClientGetInstanceViewResponse contains the response from method CloudServiceRoleInstancesClient.GetInstanceView. -type CloudServiceRoleInstancesClientGetInstanceViewResponse struct { - RoleInstanceView -} - -// CloudServiceRoleInstancesClientGetRemoteDesktopFileResponse contains the response from method CloudServiceRoleInstancesClient.GetRemoteDesktopFile. -type CloudServiceRoleInstancesClientGetRemoteDesktopFileResponse struct { - // Body contains the streaming response. - Body io.ReadCloser -} - -// CloudServiceRoleInstancesClientGetResponse contains the response from method CloudServiceRoleInstancesClient.Get. -type CloudServiceRoleInstancesClientGetResponse struct { - RoleInstance -} - -// CloudServiceRoleInstancesClientListResponse contains the response from method CloudServiceRoleInstancesClient.List. -type CloudServiceRoleInstancesClientListResponse struct { - RoleInstanceListResult -} - -// CloudServiceRoleInstancesClientRebuildResponse contains the response from method CloudServiceRoleInstancesClient.Rebuild. -type CloudServiceRoleInstancesClientRebuildResponse struct { - // placeholder for future response values -} - -// CloudServiceRoleInstancesClientReimageResponse contains the response from method CloudServiceRoleInstancesClient.Reimage. -type CloudServiceRoleInstancesClientReimageResponse struct { - // placeholder for future response values -} - -// CloudServiceRoleInstancesClientRestartResponse contains the response from method CloudServiceRoleInstancesClient.Restart. -type CloudServiceRoleInstancesClientRestartResponse struct { - // placeholder for future response values -} - -// CloudServiceRolesClientGetResponse contains the response from method CloudServiceRolesClient.Get. -type CloudServiceRolesClientGetResponse struct { - CloudServiceRole -} - -// CloudServiceRolesClientListResponse contains the response from method CloudServiceRolesClient.List. -type CloudServiceRolesClientListResponse struct { - CloudServiceRoleListResult -} - -// CloudServicesClientCreateOrUpdateResponse contains the response from method CloudServicesClient.CreateOrUpdate. -type CloudServicesClientCreateOrUpdateResponse struct { - CloudService -} - -// CloudServicesClientDeleteInstancesResponse contains the response from method CloudServicesClient.DeleteInstances. -type CloudServicesClientDeleteInstancesResponse struct { - // placeholder for future response values -} - -// CloudServicesClientDeleteResponse contains the response from method CloudServicesClient.Delete. -type CloudServicesClientDeleteResponse struct { - // placeholder for future response values -} - -// CloudServicesClientGetInstanceViewResponse contains the response from method CloudServicesClient.GetInstanceView. -type CloudServicesClientGetInstanceViewResponse struct { - CloudServiceInstanceView -} - -// CloudServicesClientGetResponse contains the response from method CloudServicesClient.Get. -type CloudServicesClientGetResponse struct { - CloudService -} - -// CloudServicesClientListAllResponse contains the response from method CloudServicesClient.ListAll. -type CloudServicesClientListAllResponse struct { - CloudServiceListResult -} - -// CloudServicesClientListResponse contains the response from method CloudServicesClient.List. -type CloudServicesClientListResponse struct { - CloudServiceListResult -} - -// CloudServicesClientPowerOffResponse contains the response from method CloudServicesClient.PowerOff. -type CloudServicesClientPowerOffResponse struct { - // placeholder for future response values -} - -// CloudServicesClientRebuildResponse contains the response from method CloudServicesClient.Rebuild. -type CloudServicesClientRebuildResponse struct { - // placeholder for future response values -} - -// CloudServicesClientReimageResponse contains the response from method CloudServicesClient.Reimage. -type CloudServicesClientReimageResponse struct { - // placeholder for future response values -} - -// CloudServicesClientRestartResponse contains the response from method CloudServicesClient.Restart. -type CloudServicesClientRestartResponse struct { - // placeholder for future response values -} - -// CloudServicesClientStartResponse contains the response from method CloudServicesClient.Start. -type CloudServicesClientStartResponse struct { - // placeholder for future response values -} - -// CloudServicesClientUpdateResponse contains the response from method CloudServicesClient.Update. -type CloudServicesClientUpdateResponse struct { - CloudService -} - -// CloudServicesUpdateDomainClientGetUpdateDomainResponse contains the response from method CloudServicesUpdateDomainClient.GetUpdateDomain. -type CloudServicesUpdateDomainClientGetUpdateDomainResponse struct { - UpdateDomain -} - -// CloudServicesUpdateDomainClientListUpdateDomainsResponse contains the response from method CloudServicesUpdateDomainClient.ListUpdateDomains. -type CloudServicesUpdateDomainClientListUpdateDomainsResponse struct { - UpdateDomainListResult -} - -// CloudServicesUpdateDomainClientWalkUpdateDomainResponse contains the response from method CloudServicesUpdateDomainClient.WalkUpdateDomain. -type CloudServicesUpdateDomainClientWalkUpdateDomainResponse struct { - // placeholder for future response values -} - -// CommunityGalleriesClientGetResponse contains the response from method CommunityGalleriesClient.Get. -type CommunityGalleriesClientGetResponse struct { - CommunityGallery -} - -// CommunityGalleryImageVersionsClientGetResponse contains the response from method CommunityGalleryImageVersionsClient.Get. -type CommunityGalleryImageVersionsClientGetResponse struct { - CommunityGalleryImageVersion -} - -// CommunityGalleryImagesClientGetResponse contains the response from method CommunityGalleryImagesClient.Get. -type CommunityGalleryImagesClientGetResponse struct { - CommunityGalleryImage -} - -// DedicatedHostGroupsClientCreateOrUpdateResponse contains the response from method DedicatedHostGroupsClient.CreateOrUpdate. -type DedicatedHostGroupsClientCreateOrUpdateResponse struct { - DedicatedHostGroup -} - -// DedicatedHostGroupsClientDeleteResponse contains the response from method DedicatedHostGroupsClient.Delete. -type DedicatedHostGroupsClientDeleteResponse struct { - // placeholder for future response values -} - -// DedicatedHostGroupsClientGetResponse contains the response from method DedicatedHostGroupsClient.Get. -type DedicatedHostGroupsClientGetResponse struct { - DedicatedHostGroup -} - -// DedicatedHostGroupsClientListByResourceGroupResponse contains the response from method DedicatedHostGroupsClient.ListByResourceGroup. -type DedicatedHostGroupsClientListByResourceGroupResponse struct { - DedicatedHostGroupListResult -} - -// DedicatedHostGroupsClientListBySubscriptionResponse contains the response from method DedicatedHostGroupsClient.ListBySubscription. -type DedicatedHostGroupsClientListBySubscriptionResponse struct { - DedicatedHostGroupListResult -} - -// DedicatedHostGroupsClientUpdateResponse contains the response from method DedicatedHostGroupsClient.Update. -type DedicatedHostGroupsClientUpdateResponse struct { - DedicatedHostGroup -} - -// DedicatedHostsClientCreateOrUpdateResponse contains the response from method DedicatedHostsClient.CreateOrUpdate. -type DedicatedHostsClientCreateOrUpdateResponse struct { - DedicatedHost -} - -// DedicatedHostsClientDeleteResponse contains the response from method DedicatedHostsClient.Delete. -type DedicatedHostsClientDeleteResponse struct { - // placeholder for future response values -} - -// DedicatedHostsClientGetResponse contains the response from method DedicatedHostsClient.Get. -type DedicatedHostsClientGetResponse struct { - DedicatedHost -} - -// DedicatedHostsClientListByHostGroupResponse contains the response from method DedicatedHostsClient.ListByHostGroup. -type DedicatedHostsClientListByHostGroupResponse struct { - DedicatedHostListResult -} - -// DedicatedHostsClientRestartResponse contains the response from method DedicatedHostsClient.Restart. -type DedicatedHostsClientRestartResponse struct { - // placeholder for future response values -} - -// DedicatedHostsClientUpdateResponse contains the response from method DedicatedHostsClient.Update. -type DedicatedHostsClientUpdateResponse struct { - DedicatedHost -} - -// DiskAccessesClientCreateOrUpdateResponse contains the response from method DiskAccessesClient.CreateOrUpdate. -type DiskAccessesClientCreateOrUpdateResponse struct { - DiskAccess -} - -// DiskAccessesClientDeleteAPrivateEndpointConnectionResponse contains the response from method DiskAccessesClient.DeleteAPrivateEndpointConnection. -type DiskAccessesClientDeleteAPrivateEndpointConnectionResponse struct { - // placeholder for future response values -} - -// DiskAccessesClientDeleteResponse contains the response from method DiskAccessesClient.Delete. -type DiskAccessesClientDeleteResponse struct { - // placeholder for future response values -} - -// DiskAccessesClientGetAPrivateEndpointConnectionResponse contains the response from method DiskAccessesClient.GetAPrivateEndpointConnection. -type DiskAccessesClientGetAPrivateEndpointConnectionResponse struct { - PrivateEndpointConnection -} - -// DiskAccessesClientGetPrivateLinkResourcesResponse contains the response from method DiskAccessesClient.GetPrivateLinkResources. -type DiskAccessesClientGetPrivateLinkResourcesResponse struct { - PrivateLinkResourceListResult -} - -// DiskAccessesClientGetResponse contains the response from method DiskAccessesClient.Get. -type DiskAccessesClientGetResponse struct { - DiskAccess -} - -// DiskAccessesClientListByResourceGroupResponse contains the response from method DiskAccessesClient.ListByResourceGroup. -type DiskAccessesClientListByResourceGroupResponse struct { - DiskAccessList -} - -// DiskAccessesClientListPrivateEndpointConnectionsResponse contains the response from method DiskAccessesClient.ListPrivateEndpointConnections. -type DiskAccessesClientListPrivateEndpointConnectionsResponse struct { - PrivateEndpointConnectionListResult -} - -// DiskAccessesClientListResponse contains the response from method DiskAccessesClient.List. -type DiskAccessesClientListResponse struct { - DiskAccessList -} - -// DiskAccessesClientUpdateAPrivateEndpointConnectionResponse contains the response from method DiskAccessesClient.UpdateAPrivateEndpointConnection. -type DiskAccessesClientUpdateAPrivateEndpointConnectionResponse struct { - PrivateEndpointConnection -} - -// DiskAccessesClientUpdateResponse contains the response from method DiskAccessesClient.Update. -type DiskAccessesClientUpdateResponse struct { - DiskAccess -} - -// DiskEncryptionSetsClientCreateOrUpdateResponse contains the response from method DiskEncryptionSetsClient.CreateOrUpdate. -type DiskEncryptionSetsClientCreateOrUpdateResponse struct { - DiskEncryptionSet -} - -// DiskEncryptionSetsClientDeleteResponse contains the response from method DiskEncryptionSetsClient.Delete. -type DiskEncryptionSetsClientDeleteResponse struct { - // placeholder for future response values -} - -// DiskEncryptionSetsClientGetResponse contains the response from method DiskEncryptionSetsClient.Get. -type DiskEncryptionSetsClientGetResponse struct { - DiskEncryptionSet -} - -// DiskEncryptionSetsClientListAssociatedResourcesResponse contains the response from method DiskEncryptionSetsClient.ListAssociatedResources. -type DiskEncryptionSetsClientListAssociatedResourcesResponse struct { - ResourceURIList -} - -// DiskEncryptionSetsClientListByResourceGroupResponse contains the response from method DiskEncryptionSetsClient.ListByResourceGroup. -type DiskEncryptionSetsClientListByResourceGroupResponse struct { - DiskEncryptionSetList -} - -// DiskEncryptionSetsClientListResponse contains the response from method DiskEncryptionSetsClient.List. -type DiskEncryptionSetsClientListResponse struct { - DiskEncryptionSetList -} - -// DiskEncryptionSetsClientUpdateResponse contains the response from method DiskEncryptionSetsClient.Update. -type DiskEncryptionSetsClientUpdateResponse struct { - DiskEncryptionSet -} - -// DiskRestorePointClientGetResponse contains the response from method DiskRestorePointClient.Get. -type DiskRestorePointClientGetResponse struct { - DiskRestorePoint -} - -// DiskRestorePointClientGrantAccessResponse contains the response from method DiskRestorePointClient.GrantAccess. -type DiskRestorePointClientGrantAccessResponse struct { - AccessURI -} - -// DiskRestorePointClientListByRestorePointResponse contains the response from method DiskRestorePointClient.ListByRestorePoint. -type DiskRestorePointClientListByRestorePointResponse struct { - DiskRestorePointList -} - -// DiskRestorePointClientRevokeAccessResponse contains the response from method DiskRestorePointClient.RevokeAccess. -type DiskRestorePointClientRevokeAccessResponse struct { - // placeholder for future response values -} - -// DisksClientCreateOrUpdateResponse contains the response from method DisksClient.CreateOrUpdate. -type DisksClientCreateOrUpdateResponse struct { - Disk -} - -// DisksClientDeleteResponse contains the response from method DisksClient.Delete. -type DisksClientDeleteResponse struct { - // placeholder for future response values -} - -// DisksClientGetResponse contains the response from method DisksClient.Get. -type DisksClientGetResponse struct { - Disk -} - -// DisksClientGrantAccessResponse contains the response from method DisksClient.GrantAccess. -type DisksClientGrantAccessResponse struct { - AccessURI -} - -// DisksClientListByResourceGroupResponse contains the response from method DisksClient.ListByResourceGroup. -type DisksClientListByResourceGroupResponse struct { - DiskList -} - -// DisksClientListResponse contains the response from method DisksClient.List. -type DisksClientListResponse struct { - DiskList -} - -// DisksClientRevokeAccessResponse contains the response from method DisksClient.RevokeAccess. -type DisksClientRevokeAccessResponse struct { - // placeholder for future response values -} - -// DisksClientUpdateResponse contains the response from method DisksClient.Update. -type DisksClientUpdateResponse struct { - Disk -} - -// GalleriesClientCreateOrUpdateResponse contains the response from method GalleriesClient.CreateOrUpdate. -type GalleriesClientCreateOrUpdateResponse struct { - Gallery -} - -// GalleriesClientDeleteResponse contains the response from method GalleriesClient.Delete. -type GalleriesClientDeleteResponse struct { - // placeholder for future response values -} - -// GalleriesClientGetResponse contains the response from method GalleriesClient.Get. -type GalleriesClientGetResponse struct { - Gallery -} - -// GalleriesClientListByResourceGroupResponse contains the response from method GalleriesClient.ListByResourceGroup. -type GalleriesClientListByResourceGroupResponse struct { - GalleryList -} - -// GalleriesClientListResponse contains the response from method GalleriesClient.List. -type GalleriesClientListResponse struct { - GalleryList -} - -// GalleriesClientUpdateResponse contains the response from method GalleriesClient.Update. -type GalleriesClientUpdateResponse struct { - Gallery -} - -// GalleryApplicationVersionsClientCreateOrUpdateResponse contains the response from method GalleryApplicationVersionsClient.CreateOrUpdate. -type GalleryApplicationVersionsClientCreateOrUpdateResponse struct { - GalleryApplicationVersion -} - -// GalleryApplicationVersionsClientDeleteResponse contains the response from method GalleryApplicationVersionsClient.Delete. -type GalleryApplicationVersionsClientDeleteResponse struct { - // placeholder for future response values -} - -// GalleryApplicationVersionsClientGetResponse contains the response from method GalleryApplicationVersionsClient.Get. -type GalleryApplicationVersionsClientGetResponse struct { - GalleryApplicationVersion -} - -// GalleryApplicationVersionsClientListByGalleryApplicationResponse contains the response from method GalleryApplicationVersionsClient.ListByGalleryApplication. -type GalleryApplicationVersionsClientListByGalleryApplicationResponse struct { - GalleryApplicationVersionList -} - -// GalleryApplicationVersionsClientUpdateResponse contains the response from method GalleryApplicationVersionsClient.Update. -type GalleryApplicationVersionsClientUpdateResponse struct { - GalleryApplicationVersion -} - -// GalleryApplicationsClientCreateOrUpdateResponse contains the response from method GalleryApplicationsClient.CreateOrUpdate. -type GalleryApplicationsClientCreateOrUpdateResponse struct { - GalleryApplication -} - -// GalleryApplicationsClientDeleteResponse contains the response from method GalleryApplicationsClient.Delete. -type GalleryApplicationsClientDeleteResponse struct { - // placeholder for future response values -} - -// GalleryApplicationsClientGetResponse contains the response from method GalleryApplicationsClient.Get. -type GalleryApplicationsClientGetResponse struct { - GalleryApplication -} - -// GalleryApplicationsClientListByGalleryResponse contains the response from method GalleryApplicationsClient.ListByGallery. -type GalleryApplicationsClientListByGalleryResponse struct { - GalleryApplicationList -} - -// GalleryApplicationsClientUpdateResponse contains the response from method GalleryApplicationsClient.Update. -type GalleryApplicationsClientUpdateResponse struct { - GalleryApplication -} - -// GalleryImageVersionsClientCreateOrUpdateResponse contains the response from method GalleryImageVersionsClient.CreateOrUpdate. -type GalleryImageVersionsClientCreateOrUpdateResponse struct { - GalleryImageVersion -} - -// GalleryImageVersionsClientDeleteResponse contains the response from method GalleryImageVersionsClient.Delete. -type GalleryImageVersionsClientDeleteResponse struct { - // placeholder for future response values -} - -// GalleryImageVersionsClientGetResponse contains the response from method GalleryImageVersionsClient.Get. -type GalleryImageVersionsClientGetResponse struct { - GalleryImageVersion -} - -// GalleryImageVersionsClientListByGalleryImageResponse contains the response from method GalleryImageVersionsClient.ListByGalleryImage. -type GalleryImageVersionsClientListByGalleryImageResponse struct { - GalleryImageVersionList -} - -// GalleryImageVersionsClientUpdateResponse contains the response from method GalleryImageVersionsClient.Update. -type GalleryImageVersionsClientUpdateResponse struct { - GalleryImageVersion -} - -// GalleryImagesClientCreateOrUpdateResponse contains the response from method GalleryImagesClient.CreateOrUpdate. -type GalleryImagesClientCreateOrUpdateResponse struct { - GalleryImage -} - -// GalleryImagesClientDeleteResponse contains the response from method GalleryImagesClient.Delete. -type GalleryImagesClientDeleteResponse struct { - // placeholder for future response values -} - -// GalleryImagesClientGetResponse contains the response from method GalleryImagesClient.Get. -type GalleryImagesClientGetResponse struct { - GalleryImage -} - -// GalleryImagesClientListByGalleryResponse contains the response from method GalleryImagesClient.ListByGallery. -type GalleryImagesClientListByGalleryResponse struct { - GalleryImageList -} - -// GalleryImagesClientUpdateResponse contains the response from method GalleryImagesClient.Update. -type GalleryImagesClientUpdateResponse struct { - GalleryImage -} - -// GallerySharingProfileClientUpdateResponse contains the response from method GallerySharingProfileClient.Update. -type GallerySharingProfileClientUpdateResponse struct { - SharingUpdate -} - -// ImagesClientCreateOrUpdateResponse contains the response from method ImagesClient.CreateOrUpdate. -type ImagesClientCreateOrUpdateResponse struct { - Image -} - -// ImagesClientDeleteResponse contains the response from method ImagesClient.Delete. -type ImagesClientDeleteResponse struct { - // placeholder for future response values -} - -// ImagesClientGetResponse contains the response from method ImagesClient.Get. -type ImagesClientGetResponse struct { - Image -} - -// ImagesClientListByResourceGroupResponse contains the response from method ImagesClient.ListByResourceGroup. -type ImagesClientListByResourceGroupResponse struct { - ImageListResult -} - -// ImagesClientListResponse contains the response from method ImagesClient.List. -type ImagesClientListResponse struct { - ImageListResult -} - -// ImagesClientUpdateResponse contains the response from method ImagesClient.Update. -type ImagesClientUpdateResponse struct { - Image -} - -// LogAnalyticsClientExportRequestRateByIntervalResponse contains the response from method LogAnalyticsClient.ExportRequestRateByInterval. -type LogAnalyticsClientExportRequestRateByIntervalResponse struct { - LogAnalyticsOperationResult -} - -// LogAnalyticsClientExportThrottledRequestsResponse contains the response from method LogAnalyticsClient.ExportThrottledRequests. -type LogAnalyticsClientExportThrottledRequestsResponse struct { - LogAnalyticsOperationResult -} - -// OperationsClientListResponse contains the response from method OperationsClient.List. -type OperationsClientListResponse struct { - OperationListResult -} - -// ProximityPlacementGroupsClientCreateOrUpdateResponse contains the response from method ProximityPlacementGroupsClient.CreateOrUpdate. -type ProximityPlacementGroupsClientCreateOrUpdateResponse struct { - ProximityPlacementGroup -} - -// ProximityPlacementGroupsClientDeleteResponse contains the response from method ProximityPlacementGroupsClient.Delete. -type ProximityPlacementGroupsClientDeleteResponse struct { - // placeholder for future response values -} - -// ProximityPlacementGroupsClientGetResponse contains the response from method ProximityPlacementGroupsClient.Get. -type ProximityPlacementGroupsClientGetResponse struct { - ProximityPlacementGroup -} - -// ProximityPlacementGroupsClientListByResourceGroupResponse contains the response from method ProximityPlacementGroupsClient.ListByResourceGroup. -type ProximityPlacementGroupsClientListByResourceGroupResponse struct { - ProximityPlacementGroupListResult -} - -// ProximityPlacementGroupsClientListBySubscriptionResponse contains the response from method ProximityPlacementGroupsClient.ListBySubscription. -type ProximityPlacementGroupsClientListBySubscriptionResponse struct { - ProximityPlacementGroupListResult -} - -// ProximityPlacementGroupsClientUpdateResponse contains the response from method ProximityPlacementGroupsClient.Update. -type ProximityPlacementGroupsClientUpdateResponse struct { - ProximityPlacementGroup -} - -// ResourceSKUsClientListResponse contains the response from method ResourceSKUsClient.List. -type ResourceSKUsClientListResponse struct { - ResourceSKUsResult -} - -// RestorePointCollectionsClientCreateOrUpdateResponse contains the response from method RestorePointCollectionsClient.CreateOrUpdate. -type RestorePointCollectionsClientCreateOrUpdateResponse struct { - RestorePointCollection -} - -// RestorePointCollectionsClientDeleteResponse contains the response from method RestorePointCollectionsClient.Delete. -type RestorePointCollectionsClientDeleteResponse struct { - // placeholder for future response values -} - -// RestorePointCollectionsClientGetResponse contains the response from method RestorePointCollectionsClient.Get. -type RestorePointCollectionsClientGetResponse struct { - RestorePointCollection -} - -// RestorePointCollectionsClientListAllResponse contains the response from method RestorePointCollectionsClient.ListAll. -type RestorePointCollectionsClientListAllResponse struct { - RestorePointCollectionListResult -} - -// RestorePointCollectionsClientListResponse contains the response from method RestorePointCollectionsClient.List. -type RestorePointCollectionsClientListResponse struct { - RestorePointCollectionListResult -} - -// RestorePointCollectionsClientUpdateResponse contains the response from method RestorePointCollectionsClient.Update. -type RestorePointCollectionsClientUpdateResponse struct { - RestorePointCollection -} - -// RestorePointsClientCreateResponse contains the response from method RestorePointsClient.Create. -type RestorePointsClientCreateResponse struct { - RestorePoint -} - -// RestorePointsClientDeleteResponse contains the response from method RestorePointsClient.Delete. -type RestorePointsClientDeleteResponse struct { - // placeholder for future response values -} - -// RestorePointsClientGetResponse contains the response from method RestorePointsClient.Get. -type RestorePointsClientGetResponse struct { - RestorePoint -} - -// SSHPublicKeysClientCreateResponse contains the response from method SSHPublicKeysClient.Create. -type SSHPublicKeysClientCreateResponse struct { - SSHPublicKeyResource -} - -// SSHPublicKeysClientDeleteResponse contains the response from method SSHPublicKeysClient.Delete. -type SSHPublicKeysClientDeleteResponse struct { - // placeholder for future response values -} - -// SSHPublicKeysClientGenerateKeyPairResponse contains the response from method SSHPublicKeysClient.GenerateKeyPair. -type SSHPublicKeysClientGenerateKeyPairResponse struct { - SSHPublicKeyGenerateKeyPairResult -} - -// SSHPublicKeysClientGetResponse contains the response from method SSHPublicKeysClient.Get. -type SSHPublicKeysClientGetResponse struct { - SSHPublicKeyResource -} - -// SSHPublicKeysClientListByResourceGroupResponse contains the response from method SSHPublicKeysClient.ListByResourceGroup. -type SSHPublicKeysClientListByResourceGroupResponse struct { - SSHPublicKeysGroupListResult -} - -// SSHPublicKeysClientListBySubscriptionResponse contains the response from method SSHPublicKeysClient.ListBySubscription. -type SSHPublicKeysClientListBySubscriptionResponse struct { - SSHPublicKeysGroupListResult -} - -// SSHPublicKeysClientUpdateResponse contains the response from method SSHPublicKeysClient.Update. -type SSHPublicKeysClientUpdateResponse struct { - SSHPublicKeyResource -} - -// SharedGalleriesClientGetResponse contains the response from method SharedGalleriesClient.Get. -type SharedGalleriesClientGetResponse struct { - SharedGallery -} - -// SharedGalleriesClientListResponse contains the response from method SharedGalleriesClient.List. -type SharedGalleriesClientListResponse struct { - SharedGalleryList -} - -// SharedGalleryImageVersionsClientGetResponse contains the response from method SharedGalleryImageVersionsClient.Get. -type SharedGalleryImageVersionsClientGetResponse struct { - SharedGalleryImageVersion -} - -// SharedGalleryImageVersionsClientListResponse contains the response from method SharedGalleryImageVersionsClient.List. -type SharedGalleryImageVersionsClientListResponse struct { - SharedGalleryImageVersionList -} - -// SharedGalleryImagesClientGetResponse contains the response from method SharedGalleryImagesClient.Get. -type SharedGalleryImagesClientGetResponse struct { - SharedGalleryImage -} - -// SharedGalleryImagesClientListResponse contains the response from method SharedGalleryImagesClient.List. -type SharedGalleryImagesClientListResponse struct { - SharedGalleryImageList -} - -// SnapshotsClientCreateOrUpdateResponse contains the response from method SnapshotsClient.CreateOrUpdate. -type SnapshotsClientCreateOrUpdateResponse struct { - Snapshot -} - -// SnapshotsClientDeleteResponse contains the response from method SnapshotsClient.Delete. -type SnapshotsClientDeleteResponse struct { - // placeholder for future response values -} - -// SnapshotsClientGetResponse contains the response from method SnapshotsClient.Get. -type SnapshotsClientGetResponse struct { - Snapshot -} - -// SnapshotsClientGrantAccessResponse contains the response from method SnapshotsClient.GrantAccess. -type SnapshotsClientGrantAccessResponse struct { - AccessURI -} - -// SnapshotsClientListByResourceGroupResponse contains the response from method SnapshotsClient.ListByResourceGroup. -type SnapshotsClientListByResourceGroupResponse struct { - SnapshotList -} - -// SnapshotsClientListResponse contains the response from method SnapshotsClient.List. -type SnapshotsClientListResponse struct { - SnapshotList -} - -// SnapshotsClientRevokeAccessResponse contains the response from method SnapshotsClient.RevokeAccess. -type SnapshotsClientRevokeAccessResponse struct { - // placeholder for future response values -} - -// SnapshotsClientUpdateResponse contains the response from method SnapshotsClient.Update. -type SnapshotsClientUpdateResponse struct { - Snapshot -} - -// UsageClientListResponse contains the response from method UsageClient.List. -type UsageClientListResponse struct { - ListUsagesResult -} - -// VirtualMachineExtensionImagesClientGetResponse contains the response from method VirtualMachineExtensionImagesClient.Get. -type VirtualMachineExtensionImagesClientGetResponse struct { - VirtualMachineExtensionImage -} - -// VirtualMachineExtensionImagesClientListTypesResponse contains the response from method VirtualMachineExtensionImagesClient.ListTypes. -type VirtualMachineExtensionImagesClientListTypesResponse struct { - // Array of VirtualMachineExtensionImage - VirtualMachineExtensionImageArray []*VirtualMachineExtensionImage -} - -// VirtualMachineExtensionImagesClientListVersionsResponse contains the response from method VirtualMachineExtensionImagesClient.ListVersions. -type VirtualMachineExtensionImagesClientListVersionsResponse struct { - // Array of VirtualMachineExtensionImage - VirtualMachineExtensionImageArray []*VirtualMachineExtensionImage -} - -// VirtualMachineExtensionsClientCreateOrUpdateResponse contains the response from method VirtualMachineExtensionsClient.CreateOrUpdate. -type VirtualMachineExtensionsClientCreateOrUpdateResponse struct { - VirtualMachineExtension -} - -// VirtualMachineExtensionsClientDeleteResponse contains the response from method VirtualMachineExtensionsClient.Delete. -type VirtualMachineExtensionsClientDeleteResponse struct { - // placeholder for future response values -} - -// VirtualMachineExtensionsClientGetResponse contains the response from method VirtualMachineExtensionsClient.Get. -type VirtualMachineExtensionsClientGetResponse struct { - VirtualMachineExtension -} - -// VirtualMachineExtensionsClientListResponse contains the response from method VirtualMachineExtensionsClient.List. -type VirtualMachineExtensionsClientListResponse struct { - VirtualMachineExtensionsListResult -} - -// VirtualMachineExtensionsClientUpdateResponse contains the response from method VirtualMachineExtensionsClient.Update. -type VirtualMachineExtensionsClientUpdateResponse struct { - VirtualMachineExtension -} - -// VirtualMachineImagesClientGetResponse contains the response from method VirtualMachineImagesClient.Get. -type VirtualMachineImagesClientGetResponse struct { - VirtualMachineImage -} - -// VirtualMachineImagesClientListOffersResponse contains the response from method VirtualMachineImagesClient.ListOffers. -type VirtualMachineImagesClientListOffersResponse struct { - // Array of VirtualMachineImageResource - VirtualMachineImageResourceArray []*VirtualMachineImageResource -} - -// VirtualMachineImagesClientListPublishersResponse contains the response from method VirtualMachineImagesClient.ListPublishers. -type VirtualMachineImagesClientListPublishersResponse struct { - // Array of VirtualMachineImageResource - VirtualMachineImageResourceArray []*VirtualMachineImageResource -} - -// VirtualMachineImagesClientListResponse contains the response from method VirtualMachineImagesClient.List. -type VirtualMachineImagesClientListResponse struct { - // Array of VirtualMachineImageResource - VirtualMachineImageResourceArray []*VirtualMachineImageResource -} - -// VirtualMachineImagesClientListSKUsResponse contains the response from method VirtualMachineImagesClient.ListSKUs. -type VirtualMachineImagesClientListSKUsResponse struct { - // Array of VirtualMachineImageResource - VirtualMachineImageResourceArray []*VirtualMachineImageResource -} - -// VirtualMachineImagesEdgeZoneClientGetResponse contains the response from method VirtualMachineImagesEdgeZoneClient.Get. -type VirtualMachineImagesEdgeZoneClientGetResponse struct { - VirtualMachineImage -} - -// VirtualMachineImagesEdgeZoneClientListOffersResponse contains the response from method VirtualMachineImagesEdgeZoneClient.ListOffers. -type VirtualMachineImagesEdgeZoneClientListOffersResponse struct { - // Array of VirtualMachineImageResource - VirtualMachineImageResourceArray []*VirtualMachineImageResource -} - -// VirtualMachineImagesEdgeZoneClientListPublishersResponse contains the response from method VirtualMachineImagesEdgeZoneClient.ListPublishers. -type VirtualMachineImagesEdgeZoneClientListPublishersResponse struct { - // Array of VirtualMachineImageResource - VirtualMachineImageResourceArray []*VirtualMachineImageResource -} - -// VirtualMachineImagesEdgeZoneClientListResponse contains the response from method VirtualMachineImagesEdgeZoneClient.List. -type VirtualMachineImagesEdgeZoneClientListResponse struct { - // Array of VirtualMachineImageResource - VirtualMachineImageResourceArray []*VirtualMachineImageResource -} - -// VirtualMachineImagesEdgeZoneClientListSKUsResponse contains the response from method VirtualMachineImagesEdgeZoneClient.ListSKUs. -type VirtualMachineImagesEdgeZoneClientListSKUsResponse struct { - // Array of VirtualMachineImageResource - VirtualMachineImageResourceArray []*VirtualMachineImageResource -} - -// VirtualMachineRunCommandsClientCreateOrUpdateResponse contains the response from method VirtualMachineRunCommandsClient.CreateOrUpdate. -type VirtualMachineRunCommandsClientCreateOrUpdateResponse struct { - VirtualMachineRunCommand -} - -// VirtualMachineRunCommandsClientDeleteResponse contains the response from method VirtualMachineRunCommandsClient.Delete. -type VirtualMachineRunCommandsClientDeleteResponse struct { - // placeholder for future response values -} - -// VirtualMachineRunCommandsClientGetByVirtualMachineResponse contains the response from method VirtualMachineRunCommandsClient.GetByVirtualMachine. -type VirtualMachineRunCommandsClientGetByVirtualMachineResponse struct { - VirtualMachineRunCommand -} - -// VirtualMachineRunCommandsClientGetResponse contains the response from method VirtualMachineRunCommandsClient.Get. -type VirtualMachineRunCommandsClientGetResponse struct { - RunCommandDocument -} - -// VirtualMachineRunCommandsClientListByVirtualMachineResponse contains the response from method VirtualMachineRunCommandsClient.ListByVirtualMachine. -type VirtualMachineRunCommandsClientListByVirtualMachineResponse struct { - VirtualMachineRunCommandsListResult -} - -// VirtualMachineRunCommandsClientListResponse contains the response from method VirtualMachineRunCommandsClient.List. -type VirtualMachineRunCommandsClientListResponse struct { - RunCommandListResult -} - -// VirtualMachineRunCommandsClientUpdateResponse contains the response from method VirtualMachineRunCommandsClient.Update. -type VirtualMachineRunCommandsClientUpdateResponse struct { - VirtualMachineRunCommand -} - -// VirtualMachineScaleSetExtensionsClientCreateOrUpdateResponse contains the response from method VirtualMachineScaleSetExtensionsClient.CreateOrUpdate. -type VirtualMachineScaleSetExtensionsClientCreateOrUpdateResponse struct { - VirtualMachineScaleSetExtension -} - -// VirtualMachineScaleSetExtensionsClientDeleteResponse contains the response from method VirtualMachineScaleSetExtensionsClient.Delete. -type VirtualMachineScaleSetExtensionsClientDeleteResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetExtensionsClientGetResponse contains the response from method VirtualMachineScaleSetExtensionsClient.Get. -type VirtualMachineScaleSetExtensionsClientGetResponse struct { - VirtualMachineScaleSetExtension -} - -// VirtualMachineScaleSetExtensionsClientListResponse contains the response from method VirtualMachineScaleSetExtensionsClient.List. -type VirtualMachineScaleSetExtensionsClientListResponse struct { - VirtualMachineScaleSetExtensionListResult -} - -// VirtualMachineScaleSetExtensionsClientUpdateResponse contains the response from method VirtualMachineScaleSetExtensionsClient.Update. -type VirtualMachineScaleSetExtensionsClientUpdateResponse struct { - VirtualMachineScaleSetExtension -} - -// VirtualMachineScaleSetRollingUpgradesClientCancelResponse contains the response from method VirtualMachineScaleSetRollingUpgradesClient.Cancel. -type VirtualMachineScaleSetRollingUpgradesClientCancelResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetRollingUpgradesClientGetLatestResponse contains the response from method VirtualMachineScaleSetRollingUpgradesClient.GetLatest. -type VirtualMachineScaleSetRollingUpgradesClientGetLatestResponse struct { - RollingUpgradeStatusInfo -} - -// VirtualMachineScaleSetRollingUpgradesClientStartExtensionUpgradeResponse contains the response from method VirtualMachineScaleSetRollingUpgradesClient.StartExtensionUpgrade. -type VirtualMachineScaleSetRollingUpgradesClientStartExtensionUpgradeResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetRollingUpgradesClientStartOSUpgradeResponse contains the response from method VirtualMachineScaleSetRollingUpgradesClient.StartOSUpgrade. -type VirtualMachineScaleSetRollingUpgradesClientStartOSUpgradeResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetVMExtensionsClientCreateOrUpdateResponse contains the response from method VirtualMachineScaleSetVMExtensionsClient.CreateOrUpdate. -type VirtualMachineScaleSetVMExtensionsClientCreateOrUpdateResponse struct { - VirtualMachineScaleSetVMExtension -} - -// VirtualMachineScaleSetVMExtensionsClientDeleteResponse contains the response from method VirtualMachineScaleSetVMExtensionsClient.Delete. -type VirtualMachineScaleSetVMExtensionsClientDeleteResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetVMExtensionsClientGetResponse contains the response from method VirtualMachineScaleSetVMExtensionsClient.Get. -type VirtualMachineScaleSetVMExtensionsClientGetResponse struct { - VirtualMachineScaleSetVMExtension -} - -// VirtualMachineScaleSetVMExtensionsClientListResponse contains the response from method VirtualMachineScaleSetVMExtensionsClient.List. -type VirtualMachineScaleSetVMExtensionsClientListResponse struct { - VirtualMachineScaleSetVMExtensionsListResult -} - -// VirtualMachineScaleSetVMExtensionsClientUpdateResponse contains the response from method VirtualMachineScaleSetVMExtensionsClient.Update. -type VirtualMachineScaleSetVMExtensionsClientUpdateResponse struct { - VirtualMachineScaleSetVMExtension -} - -// VirtualMachineScaleSetVMRunCommandsClientCreateOrUpdateResponse contains the response from method VirtualMachineScaleSetVMRunCommandsClient.CreateOrUpdate. -type VirtualMachineScaleSetVMRunCommandsClientCreateOrUpdateResponse struct { - VirtualMachineRunCommand -} - -// VirtualMachineScaleSetVMRunCommandsClientDeleteResponse contains the response from method VirtualMachineScaleSetVMRunCommandsClient.Delete. -type VirtualMachineScaleSetVMRunCommandsClientDeleteResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetVMRunCommandsClientGetResponse contains the response from method VirtualMachineScaleSetVMRunCommandsClient.Get. -type VirtualMachineScaleSetVMRunCommandsClientGetResponse struct { - VirtualMachineRunCommand -} - -// VirtualMachineScaleSetVMRunCommandsClientListResponse contains the response from method VirtualMachineScaleSetVMRunCommandsClient.List. -type VirtualMachineScaleSetVMRunCommandsClientListResponse struct { - VirtualMachineRunCommandsListResult -} - -// VirtualMachineScaleSetVMRunCommandsClientUpdateResponse contains the response from method VirtualMachineScaleSetVMRunCommandsClient.Update. -type VirtualMachineScaleSetVMRunCommandsClientUpdateResponse struct { - VirtualMachineRunCommand -} - -// VirtualMachineScaleSetVMsClientDeallocateResponse contains the response from method VirtualMachineScaleSetVMsClient.Deallocate. -type VirtualMachineScaleSetVMsClientDeallocateResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetVMsClientDeleteResponse contains the response from method VirtualMachineScaleSetVMsClient.Delete. -type VirtualMachineScaleSetVMsClientDeleteResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetVMsClientGetInstanceViewResponse contains the response from method VirtualMachineScaleSetVMsClient.GetInstanceView. -type VirtualMachineScaleSetVMsClientGetInstanceViewResponse struct { - VirtualMachineScaleSetVMInstanceView -} - -// VirtualMachineScaleSetVMsClientGetResponse contains the response from method VirtualMachineScaleSetVMsClient.Get. -type VirtualMachineScaleSetVMsClientGetResponse struct { - VirtualMachineScaleSetVM -} - -// VirtualMachineScaleSetVMsClientListResponse contains the response from method VirtualMachineScaleSetVMsClient.List. -type VirtualMachineScaleSetVMsClientListResponse struct { - VirtualMachineScaleSetVMListResult -} - -// VirtualMachineScaleSetVMsClientPerformMaintenanceResponse contains the response from method VirtualMachineScaleSetVMsClient.PerformMaintenance. -type VirtualMachineScaleSetVMsClientPerformMaintenanceResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetVMsClientPowerOffResponse contains the response from method VirtualMachineScaleSetVMsClient.PowerOff. -type VirtualMachineScaleSetVMsClientPowerOffResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetVMsClientRedeployResponse contains the response from method VirtualMachineScaleSetVMsClient.Redeploy. -type VirtualMachineScaleSetVMsClientRedeployResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetVMsClientReimageAllResponse contains the response from method VirtualMachineScaleSetVMsClient.ReimageAll. -type VirtualMachineScaleSetVMsClientReimageAllResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetVMsClientReimageResponse contains the response from method VirtualMachineScaleSetVMsClient.Reimage. -type VirtualMachineScaleSetVMsClientReimageResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetVMsClientRestartResponse contains the response from method VirtualMachineScaleSetVMsClient.Restart. -type VirtualMachineScaleSetVMsClientRestartResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataResponse contains the response from method VirtualMachineScaleSetVMsClient.RetrieveBootDiagnosticsData. -type VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataResponse struct { - RetrieveBootDiagnosticsDataResult -} - -// VirtualMachineScaleSetVMsClientRunCommandResponse contains the response from method VirtualMachineScaleSetVMsClient.RunCommand. -type VirtualMachineScaleSetVMsClientRunCommandResponse struct { - RunCommandResult -} - -// VirtualMachineScaleSetVMsClientSimulateEvictionResponse contains the response from method VirtualMachineScaleSetVMsClient.SimulateEviction. -type VirtualMachineScaleSetVMsClientSimulateEvictionResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetVMsClientStartResponse contains the response from method VirtualMachineScaleSetVMsClient.Start. -type VirtualMachineScaleSetVMsClientStartResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetVMsClientUpdateResponse contains the response from method VirtualMachineScaleSetVMsClient.Update. -type VirtualMachineScaleSetVMsClientUpdateResponse struct { - VirtualMachineScaleSetVM -} - -// VirtualMachineScaleSetsClientConvertToSinglePlacementGroupResponse contains the response from method VirtualMachineScaleSetsClient.ConvertToSinglePlacementGroup. -type VirtualMachineScaleSetsClientConvertToSinglePlacementGroupResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetsClientCreateOrUpdateResponse contains the response from method VirtualMachineScaleSetsClient.CreateOrUpdate. -type VirtualMachineScaleSetsClientCreateOrUpdateResponse struct { - VirtualMachineScaleSet -} - -// VirtualMachineScaleSetsClientDeallocateResponse contains the response from method VirtualMachineScaleSetsClient.Deallocate. -type VirtualMachineScaleSetsClientDeallocateResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetsClientDeleteInstancesResponse contains the response from method VirtualMachineScaleSetsClient.DeleteInstances. -type VirtualMachineScaleSetsClientDeleteInstancesResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetsClientDeleteResponse contains the response from method VirtualMachineScaleSetsClient.Delete. -type VirtualMachineScaleSetsClientDeleteResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkResponse contains the response from method -// VirtualMachineScaleSetsClient.ForceRecoveryServiceFabricPlatformUpdateDomainWalk. -type VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkResponse struct { - RecoveryWalkResponse -} - -// VirtualMachineScaleSetsClientGetInstanceViewResponse contains the response from method VirtualMachineScaleSetsClient.GetInstanceView. -type VirtualMachineScaleSetsClientGetInstanceViewResponse struct { - VirtualMachineScaleSetInstanceView -} - -// VirtualMachineScaleSetsClientGetOSUpgradeHistoryResponse contains the response from method VirtualMachineScaleSetsClient.GetOSUpgradeHistory. -type VirtualMachineScaleSetsClientGetOSUpgradeHistoryResponse struct { - VirtualMachineScaleSetListOSUpgradeHistory -} - -// VirtualMachineScaleSetsClientGetResponse contains the response from method VirtualMachineScaleSetsClient.Get. -type VirtualMachineScaleSetsClientGetResponse struct { - VirtualMachineScaleSet -} - -// VirtualMachineScaleSetsClientListAllResponse contains the response from method VirtualMachineScaleSetsClient.ListAll. -type VirtualMachineScaleSetsClientListAllResponse struct { - VirtualMachineScaleSetListWithLinkResult -} - -// VirtualMachineScaleSetsClientListByLocationResponse contains the response from method VirtualMachineScaleSetsClient.ListByLocation. -type VirtualMachineScaleSetsClientListByLocationResponse struct { - VirtualMachineScaleSetListResult -} - -// VirtualMachineScaleSetsClientListResponse contains the response from method VirtualMachineScaleSetsClient.List. -type VirtualMachineScaleSetsClientListResponse struct { - VirtualMachineScaleSetListResult -} - -// VirtualMachineScaleSetsClientListSKUsResponse contains the response from method VirtualMachineScaleSetsClient.ListSKUs. -type VirtualMachineScaleSetsClientListSKUsResponse struct { - VirtualMachineScaleSetListSKUsResult -} - -// VirtualMachineScaleSetsClientPerformMaintenanceResponse contains the response from method VirtualMachineScaleSetsClient.PerformMaintenance. -type VirtualMachineScaleSetsClientPerformMaintenanceResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetsClientPowerOffResponse contains the response from method VirtualMachineScaleSetsClient.PowerOff. -type VirtualMachineScaleSetsClientPowerOffResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetsClientRedeployResponse contains the response from method VirtualMachineScaleSetsClient.Redeploy. -type VirtualMachineScaleSetsClientRedeployResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetsClientReimageAllResponse contains the response from method VirtualMachineScaleSetsClient.ReimageAll. -type VirtualMachineScaleSetsClientReimageAllResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetsClientReimageResponse contains the response from method VirtualMachineScaleSetsClient.Reimage. -type VirtualMachineScaleSetsClientReimageResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetsClientRestartResponse contains the response from method VirtualMachineScaleSetsClient.Restart. -type VirtualMachineScaleSetsClientRestartResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetsClientSetOrchestrationServiceStateResponse contains the response from method VirtualMachineScaleSetsClient.SetOrchestrationServiceState. -type VirtualMachineScaleSetsClientSetOrchestrationServiceStateResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetsClientStartResponse contains the response from method VirtualMachineScaleSetsClient.Start. -type VirtualMachineScaleSetsClientStartResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetsClientUpdateInstancesResponse contains the response from method VirtualMachineScaleSetsClient.UpdateInstances. -type VirtualMachineScaleSetsClientUpdateInstancesResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetsClientUpdateResponse contains the response from method VirtualMachineScaleSetsClient.Update. -type VirtualMachineScaleSetsClientUpdateResponse struct { - VirtualMachineScaleSet -} - -// VirtualMachineSizesClientListResponse contains the response from method VirtualMachineSizesClient.List. -type VirtualMachineSizesClientListResponse struct { - VirtualMachineSizeListResult -} - -// VirtualMachinesClientAssessPatchesResponse contains the response from method VirtualMachinesClient.AssessPatches. -type VirtualMachinesClientAssessPatchesResponse struct { - VirtualMachineAssessPatchesResult -} - -// VirtualMachinesClientCaptureResponse contains the response from method VirtualMachinesClient.Capture. -type VirtualMachinesClientCaptureResponse struct { - VirtualMachineCaptureResult -} - -// VirtualMachinesClientConvertToManagedDisksResponse contains the response from method VirtualMachinesClient.ConvertToManagedDisks. -type VirtualMachinesClientConvertToManagedDisksResponse struct { - // placeholder for future response values -} - -// VirtualMachinesClientCreateOrUpdateResponse contains the response from method VirtualMachinesClient.CreateOrUpdate. -type VirtualMachinesClientCreateOrUpdateResponse struct { - VirtualMachine -} - -// VirtualMachinesClientDeallocateResponse contains the response from method VirtualMachinesClient.Deallocate. -type VirtualMachinesClientDeallocateResponse struct { - // placeholder for future response values -} - -// VirtualMachinesClientDeleteResponse contains the response from method VirtualMachinesClient.Delete. -type VirtualMachinesClientDeleteResponse struct { - // placeholder for future response values -} - -// VirtualMachinesClientGeneralizeResponse contains the response from method VirtualMachinesClient.Generalize. -type VirtualMachinesClientGeneralizeResponse struct { - // placeholder for future response values -} - -// VirtualMachinesClientGetResponse contains the response from method VirtualMachinesClient.Get. -type VirtualMachinesClientGetResponse struct { - VirtualMachine -} - -// VirtualMachinesClientInstallPatchesResponse contains the response from method VirtualMachinesClient.InstallPatches. -type VirtualMachinesClientInstallPatchesResponse struct { - VirtualMachineInstallPatchesResult -} - -// VirtualMachinesClientInstanceViewResponse contains the response from method VirtualMachinesClient.InstanceView. -type VirtualMachinesClientInstanceViewResponse struct { - VirtualMachineInstanceView -} - -// VirtualMachinesClientListAllResponse contains the response from method VirtualMachinesClient.ListAll. -type VirtualMachinesClientListAllResponse struct { - VirtualMachineListResult -} - -// VirtualMachinesClientListAvailableSizesResponse contains the response from method VirtualMachinesClient.ListAvailableSizes. -type VirtualMachinesClientListAvailableSizesResponse struct { - VirtualMachineSizeListResult -} - -// VirtualMachinesClientListByLocationResponse contains the response from method VirtualMachinesClient.ListByLocation. -type VirtualMachinesClientListByLocationResponse struct { - VirtualMachineListResult -} - -// VirtualMachinesClientListResponse contains the response from method VirtualMachinesClient.List. -type VirtualMachinesClientListResponse struct { - VirtualMachineListResult -} - -// VirtualMachinesClientPerformMaintenanceResponse contains the response from method VirtualMachinesClient.PerformMaintenance. -type VirtualMachinesClientPerformMaintenanceResponse struct { - // placeholder for future response values -} - -// VirtualMachinesClientPowerOffResponse contains the response from method VirtualMachinesClient.PowerOff. -type VirtualMachinesClientPowerOffResponse struct { - // placeholder for future response values -} - -// VirtualMachinesClientReapplyResponse contains the response from method VirtualMachinesClient.Reapply. -type VirtualMachinesClientReapplyResponse struct { - // placeholder for future response values -} - -// VirtualMachinesClientRedeployResponse contains the response from method VirtualMachinesClient.Redeploy. -type VirtualMachinesClientRedeployResponse struct { - // placeholder for future response values -} - -// VirtualMachinesClientReimageResponse contains the response from method VirtualMachinesClient.Reimage. -type VirtualMachinesClientReimageResponse struct { - // placeholder for future response values -} - -// VirtualMachinesClientRestartResponse contains the response from method VirtualMachinesClient.Restart. -type VirtualMachinesClientRestartResponse struct { - // placeholder for future response values -} - -// VirtualMachinesClientRetrieveBootDiagnosticsDataResponse contains the response from method VirtualMachinesClient.RetrieveBootDiagnosticsData. -type VirtualMachinesClientRetrieveBootDiagnosticsDataResponse struct { - RetrieveBootDiagnosticsDataResult -} - -// VirtualMachinesClientRunCommandResponse contains the response from method VirtualMachinesClient.RunCommand. -type VirtualMachinesClientRunCommandResponse struct { - RunCommandResult -} - -// VirtualMachinesClientSimulateEvictionResponse contains the response from method VirtualMachinesClient.SimulateEviction. -type VirtualMachinesClientSimulateEvictionResponse struct { - // placeholder for future response values -} - -// VirtualMachinesClientStartResponse contains the response from method VirtualMachinesClient.Start. -type VirtualMachinesClientStartResponse struct { - // placeholder for future response values -} - -// VirtualMachinesClientUpdateResponse contains the response from method VirtualMachinesClient.Update. -type VirtualMachinesClientUpdateResponse struct { - VirtualMachine -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_restorepointcollections_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_restorepointcollections_client.go deleted file mode 100644 index b706d70f..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_restorepointcollections_client.go +++ /dev/null @@ -1,425 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// RestorePointCollectionsClient contains the methods for the RestorePointCollections group. -// Don't use this type directly, use NewRestorePointCollectionsClient() instead. -type RestorePointCollectionsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewRestorePointCollectionsClient creates a new instance of RestorePointCollectionsClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewRestorePointCollectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RestorePointCollectionsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &RestorePointCollectionsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// CreateOrUpdate - The operation to create or update the restore point collection. Please refer to https://aka.ms/RestorePoints -// for more details. When updating a restore point collection, only tags may be modified. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// restorePointCollectionName - The name of the restore point collection. -// parameters - Parameters supplied to the Create or Update restore point collection operation. -// options - RestorePointCollectionsClientCreateOrUpdateOptions contains the optional parameters for the RestorePointCollectionsClient.CreateOrUpdate -// method. -func (client *RestorePointCollectionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, restorePointCollectionName string, parameters RestorePointCollection, options *RestorePointCollectionsClientCreateOrUpdateOptions) (RestorePointCollectionsClientCreateOrUpdateResponse, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, restorePointCollectionName, parameters, options) - if err != nil { - return RestorePointCollectionsClientCreateOrUpdateResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return RestorePointCollectionsClientCreateOrUpdateResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return RestorePointCollectionsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) - } - return client.createOrUpdateHandleResponse(resp) -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *RestorePointCollectionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, restorePointCollectionName string, parameters RestorePointCollection, options *RestorePointCollectionsClientCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if restorePointCollectionName == "" { - return nil, errors.New("parameter restorePointCollectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{restorePointCollectionName}", url.PathEscape(restorePointCollectionName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// createOrUpdateHandleResponse handles the CreateOrUpdate response. -func (client *RestorePointCollectionsClient) createOrUpdateHandleResponse(resp *http.Response) (RestorePointCollectionsClientCreateOrUpdateResponse, error) { - result := RestorePointCollectionsClientCreateOrUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RestorePointCollection); err != nil { - return RestorePointCollectionsClientCreateOrUpdateResponse{}, err - } - return result, nil -} - -// BeginDelete - The operation to delete the restore point collection. This operation will also delete all the contained restore -// points. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// restorePointCollectionName - The name of the Restore Point Collection. -// options - RestorePointCollectionsClientBeginDeleteOptions contains the optional parameters for the RestorePointCollectionsClient.BeginDelete -// method. -func (client *RestorePointCollectionsClient) BeginDelete(ctx context.Context, resourceGroupName string, restorePointCollectionName string, options *RestorePointCollectionsClientBeginDeleteOptions) (*runtime.Poller[RestorePointCollectionsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, restorePointCollectionName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[RestorePointCollectionsClientDeleteResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[RestorePointCollectionsClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - The operation to delete the restore point collection. This operation will also delete all the contained restore -// points. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *RestorePointCollectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, restorePointCollectionName string, options *RestorePointCollectionsClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, restorePointCollectionName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *RestorePointCollectionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, restorePointCollectionName string, options *RestorePointCollectionsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if restorePointCollectionName == "" { - return nil, errors.New("parameter restorePointCollectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{restorePointCollectionName}", url.PathEscape(restorePointCollectionName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - The operation to get the restore point collection. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// restorePointCollectionName - The name of the restore point collection. -// options - RestorePointCollectionsClientGetOptions contains the optional parameters for the RestorePointCollectionsClient.Get -// method. -func (client *RestorePointCollectionsClient) Get(ctx context.Context, resourceGroupName string, restorePointCollectionName string, options *RestorePointCollectionsClientGetOptions) (RestorePointCollectionsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, restorePointCollectionName, options) - if err != nil { - return RestorePointCollectionsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return RestorePointCollectionsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return RestorePointCollectionsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *RestorePointCollectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, restorePointCollectionName string, options *RestorePointCollectionsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if restorePointCollectionName == "" { - return nil, errors.New("parameter restorePointCollectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{restorePointCollectionName}", url.PathEscape(restorePointCollectionName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", string(*options.Expand)) - } - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *RestorePointCollectionsClient) getHandleResponse(resp *http.Response) (RestorePointCollectionsClientGetResponse, error) { - result := RestorePointCollectionsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RestorePointCollection); err != nil { - return RestorePointCollectionsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Gets the list of restore point collections in a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// options - RestorePointCollectionsClientListOptions contains the optional parameters for the RestorePointCollectionsClient.List -// method. -func (client *RestorePointCollectionsClient) NewListPager(resourceGroupName string, options *RestorePointCollectionsClientListOptions) *runtime.Pager[RestorePointCollectionsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[RestorePointCollectionsClientListResponse]{ - More: func(page RestorePointCollectionsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *RestorePointCollectionsClientListResponse) (RestorePointCollectionsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return RestorePointCollectionsClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return RestorePointCollectionsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return RestorePointCollectionsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *RestorePointCollectionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *RestorePointCollectionsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *RestorePointCollectionsClient) listHandleResponse(resp *http.Response) (RestorePointCollectionsClientListResponse, error) { - result := RestorePointCollectionsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RestorePointCollectionListResult); err != nil { - return RestorePointCollectionsClientListResponse{}, err - } - return result, nil -} - -// NewListAllPager - Gets the list of restore point collections in the subscription. Use nextLink property in the response -// to get the next page of restore point collections. Do this till nextLink is not null to fetch all -// the restore point collections. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// options - RestorePointCollectionsClientListAllOptions contains the optional parameters for the RestorePointCollectionsClient.ListAll -// method. -func (client *RestorePointCollectionsClient) NewListAllPager(options *RestorePointCollectionsClientListAllOptions) *runtime.Pager[RestorePointCollectionsClientListAllResponse] { - return runtime.NewPager(runtime.PagingHandler[RestorePointCollectionsClientListAllResponse]{ - More: func(page RestorePointCollectionsClientListAllResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *RestorePointCollectionsClientListAllResponse) (RestorePointCollectionsClientListAllResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listAllCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return RestorePointCollectionsClientListAllResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return RestorePointCollectionsClientListAllResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return RestorePointCollectionsClientListAllResponse{}, runtime.NewResponseError(resp) - } - return client.listAllHandleResponse(resp) - }, - }) -} - -// listAllCreateRequest creates the ListAll request. -func (client *RestorePointCollectionsClient) listAllCreateRequest(ctx context.Context, options *RestorePointCollectionsClientListAllOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/restorePointCollections" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listAllHandleResponse handles the ListAll response. -func (client *RestorePointCollectionsClient) listAllHandleResponse(resp *http.Response) (RestorePointCollectionsClientListAllResponse, error) { - result := RestorePointCollectionsClientListAllResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RestorePointCollectionListResult); err != nil { - return RestorePointCollectionsClientListAllResponse{}, err - } - return result, nil -} - -// Update - The operation to update the restore point collection. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// restorePointCollectionName - The name of the restore point collection. -// parameters - Parameters supplied to the Update restore point collection operation. -// options - RestorePointCollectionsClientUpdateOptions contains the optional parameters for the RestorePointCollectionsClient.Update -// method. -func (client *RestorePointCollectionsClient) Update(ctx context.Context, resourceGroupName string, restorePointCollectionName string, parameters RestorePointCollectionUpdate, options *RestorePointCollectionsClientUpdateOptions) (RestorePointCollectionsClientUpdateResponse, error) { - req, err := client.updateCreateRequest(ctx, resourceGroupName, restorePointCollectionName, parameters, options) - if err != nil { - return RestorePointCollectionsClientUpdateResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return RestorePointCollectionsClientUpdateResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return RestorePointCollectionsClientUpdateResponse{}, runtime.NewResponseError(resp) - } - return client.updateHandleResponse(resp) -} - -// updateCreateRequest creates the Update request. -func (client *RestorePointCollectionsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, restorePointCollectionName string, parameters RestorePointCollectionUpdate, options *RestorePointCollectionsClientUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if restorePointCollectionName == "" { - return nil, errors.New("parameter restorePointCollectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{restorePointCollectionName}", url.PathEscape(restorePointCollectionName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// updateHandleResponse handles the Update response. -func (client *RestorePointCollectionsClient) updateHandleResponse(resp *http.Response) (RestorePointCollectionsClientUpdateResponse, error) { - result := RestorePointCollectionsClientUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RestorePointCollection); err != nil { - return RestorePointCollectionsClientUpdateResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_restorepoints_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_restorepoints_client.go deleted file mode 100644 index 11ec43cf..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_restorepoints_client.go +++ /dev/null @@ -1,257 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// RestorePointsClient contains the methods for the RestorePoints group. -// Don't use this type directly, use NewRestorePointsClient() instead. -type RestorePointsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewRestorePointsClient creates a new instance of RestorePointsClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewRestorePointsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RestorePointsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &RestorePointsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreate - The operation to create the restore point. Updating properties of an existing restore point is not allowed -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// restorePointCollectionName - The name of the restore point collection. -// restorePointName - The name of the restore point. -// parameters - Parameters supplied to the Create restore point operation. -// options - RestorePointsClientBeginCreateOptions contains the optional parameters for the RestorePointsClient.BeginCreate -// method. -func (client *RestorePointsClient) BeginCreate(ctx context.Context, resourceGroupName string, restorePointCollectionName string, restorePointName string, parameters RestorePoint, options *RestorePointsClientBeginCreateOptions) (*runtime.Poller[RestorePointsClientCreateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.create(ctx, resourceGroupName, restorePointCollectionName, restorePointName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[RestorePointsClientCreateResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[RestorePointsClientCreateResponse](options.ResumeToken, client.pl, nil) - } -} - -// Create - The operation to create the restore point. Updating properties of an existing restore point is not allowed -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *RestorePointsClient) create(ctx context.Context, resourceGroupName string, restorePointCollectionName string, restorePointName string, parameters RestorePoint, options *RestorePointsClientBeginCreateOptions) (*http.Response, error) { - req, err := client.createCreateRequest(ctx, resourceGroupName, restorePointCollectionName, restorePointName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createCreateRequest creates the Create request. -func (client *RestorePointsClient) createCreateRequest(ctx context.Context, resourceGroupName string, restorePointCollectionName string, restorePointName string, parameters RestorePoint, options *RestorePointsClientBeginCreateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{restorePointName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if restorePointCollectionName == "" { - return nil, errors.New("parameter restorePointCollectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{restorePointCollectionName}", url.PathEscape(restorePointCollectionName)) - if restorePointName == "" { - return nil, errors.New("parameter restorePointName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{restorePointName}", url.PathEscape(restorePointName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginDelete - The operation to delete the restore point. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// restorePointCollectionName - The name of the Restore Point Collection. -// restorePointName - The name of the restore point. -// options - RestorePointsClientBeginDeleteOptions contains the optional parameters for the RestorePointsClient.BeginDelete -// method. -func (client *RestorePointsClient) BeginDelete(ctx context.Context, resourceGroupName string, restorePointCollectionName string, restorePointName string, options *RestorePointsClientBeginDeleteOptions) (*runtime.Poller[RestorePointsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, restorePointCollectionName, restorePointName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[RestorePointsClientDeleteResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[RestorePointsClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - The operation to delete the restore point. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *RestorePointsClient) deleteOperation(ctx context.Context, resourceGroupName string, restorePointCollectionName string, restorePointName string, options *RestorePointsClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, restorePointCollectionName, restorePointName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *RestorePointsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, restorePointCollectionName string, restorePointName string, options *RestorePointsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{restorePointName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if restorePointCollectionName == "" { - return nil, errors.New("parameter restorePointCollectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{restorePointCollectionName}", url.PathEscape(restorePointCollectionName)) - if restorePointName == "" { - return nil, errors.New("parameter restorePointName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{restorePointName}", url.PathEscape(restorePointName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - The operation to get the restore point. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// restorePointCollectionName - The name of the restore point collection. -// restorePointName - The name of the restore point. -// options - RestorePointsClientGetOptions contains the optional parameters for the RestorePointsClient.Get method. -func (client *RestorePointsClient) Get(ctx context.Context, resourceGroupName string, restorePointCollectionName string, restorePointName string, options *RestorePointsClientGetOptions) (RestorePointsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, restorePointCollectionName, restorePointName, options) - if err != nil { - return RestorePointsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return RestorePointsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return RestorePointsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *RestorePointsClient) getCreateRequest(ctx context.Context, resourceGroupName string, restorePointCollectionName string, restorePointName string, options *RestorePointsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{restorePointName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if restorePointCollectionName == "" { - return nil, errors.New("parameter restorePointCollectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{restorePointCollectionName}", url.PathEscape(restorePointCollectionName)) - if restorePointName == "" { - return nil, errors.New("parameter restorePointName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{restorePointName}", url.PathEscape(restorePointName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", string(*options.Expand)) - } - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *RestorePointsClient) getHandleResponse(resp *http.Response) (RestorePointsClientGetResponse, error) { - result := RestorePointsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RestorePoint); err != nil { - return RestorePointsClientGetResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_sharedgalleries_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_sharedgalleries_client.go deleted file mode 100644 index 9f73e729..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_sharedgalleries_client.go +++ /dev/null @@ -1,179 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// SharedGalleriesClient contains the methods for the SharedGalleries group. -// Don't use this type directly, use NewSharedGalleriesClient() instead. -type SharedGalleriesClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewSharedGalleriesClient creates a new instance of SharedGalleriesClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewSharedGalleriesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SharedGalleriesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &SharedGalleriesClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// Get - Get a shared gallery by subscription id or tenant id. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-01 -// location - Resource location. -// galleryUniqueName - The unique name of the Shared Gallery. -// options - SharedGalleriesClientGetOptions contains the optional parameters for the SharedGalleriesClient.Get method. -func (client *SharedGalleriesClient) Get(ctx context.Context, location string, galleryUniqueName string, options *SharedGalleriesClientGetOptions) (SharedGalleriesClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, location, galleryUniqueName, options) - if err != nil { - return SharedGalleriesClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return SharedGalleriesClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SharedGalleriesClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *SharedGalleriesClient) getCreateRequest(ctx context.Context, location string, galleryUniqueName string, options *SharedGalleriesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if galleryUniqueName == "" { - return nil, errors.New("parameter galleryUniqueName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryUniqueName}", url.PathEscape(galleryUniqueName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *SharedGalleriesClient) getHandleResponse(resp *http.Response) (SharedGalleriesClientGetResponse, error) { - result := SharedGalleriesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SharedGallery); err != nil { - return SharedGalleriesClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - List shared galleries by subscription id or tenant id. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-01 -// location - Resource location. -// options - SharedGalleriesClientListOptions contains the optional parameters for the SharedGalleriesClient.List method. -func (client *SharedGalleriesClient) NewListPager(location string, options *SharedGalleriesClientListOptions) *runtime.Pager[SharedGalleriesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[SharedGalleriesClientListResponse]{ - More: func(page SharedGalleriesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *SharedGalleriesClientListResponse) (SharedGalleriesClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, location, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return SharedGalleriesClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return SharedGalleriesClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SharedGalleriesClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *SharedGalleriesClient) listCreateRequest(ctx context.Context, location string, options *SharedGalleriesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-01") - if options != nil && options.SharedTo != nil { - reqQP.Set("sharedTo", string(*options.SharedTo)) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *SharedGalleriesClient) listHandleResponse(resp *http.Response) (SharedGalleriesClientListResponse, error) { - result := SharedGalleriesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SharedGalleryList); err != nil { - return SharedGalleriesClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_sharedgalleryimages_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_sharedgalleryimages_client.go deleted file mode 100644 index fca3e47a..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_sharedgalleryimages_client.go +++ /dev/null @@ -1,190 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// SharedGalleryImagesClient contains the methods for the SharedGalleryImages group. -// Don't use this type directly, use NewSharedGalleryImagesClient() instead. -type SharedGalleryImagesClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewSharedGalleryImagesClient creates a new instance of SharedGalleryImagesClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewSharedGalleryImagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SharedGalleryImagesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &SharedGalleryImagesClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// Get - Get a shared gallery image by subscription id or tenant id. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-01 -// location - Resource location. -// galleryUniqueName - The unique name of the Shared Gallery. -// galleryImageName - The name of the Shared Gallery Image Definition from which the Image Versions are to be listed. -// options - SharedGalleryImagesClientGetOptions contains the optional parameters for the SharedGalleryImagesClient.Get method. -func (client *SharedGalleryImagesClient) Get(ctx context.Context, location string, galleryUniqueName string, galleryImageName string, options *SharedGalleryImagesClientGetOptions) (SharedGalleryImagesClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, location, galleryUniqueName, galleryImageName, options) - if err != nil { - return SharedGalleryImagesClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return SharedGalleryImagesClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SharedGalleryImagesClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *SharedGalleryImagesClient) getCreateRequest(ctx context.Context, location string, galleryUniqueName string, galleryImageName string, options *SharedGalleryImagesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}/images/{galleryImageName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if galleryUniqueName == "" { - return nil, errors.New("parameter galleryUniqueName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryUniqueName}", url.PathEscape(galleryUniqueName)) - if galleryImageName == "" { - return nil, errors.New("parameter galleryImageName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryImageName}", url.PathEscape(galleryImageName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *SharedGalleryImagesClient) getHandleResponse(resp *http.Response) (SharedGalleryImagesClientGetResponse, error) { - result := SharedGalleryImagesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SharedGalleryImage); err != nil { - return SharedGalleryImagesClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - List shared gallery images by subscription id or tenant id. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-01 -// location - Resource location. -// galleryUniqueName - The unique name of the Shared Gallery. -// options - SharedGalleryImagesClientListOptions contains the optional parameters for the SharedGalleryImagesClient.List -// method. -func (client *SharedGalleryImagesClient) NewListPager(location string, galleryUniqueName string, options *SharedGalleryImagesClientListOptions) *runtime.Pager[SharedGalleryImagesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[SharedGalleryImagesClientListResponse]{ - More: func(page SharedGalleryImagesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *SharedGalleryImagesClientListResponse) (SharedGalleryImagesClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, location, galleryUniqueName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return SharedGalleryImagesClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return SharedGalleryImagesClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SharedGalleryImagesClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *SharedGalleryImagesClient) listCreateRequest(ctx context.Context, location string, galleryUniqueName string, options *SharedGalleryImagesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}/images" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if galleryUniqueName == "" { - return nil, errors.New("parameter galleryUniqueName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryUniqueName}", url.PathEscape(galleryUniqueName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-01") - if options != nil && options.SharedTo != nil { - reqQP.Set("sharedTo", string(*options.SharedTo)) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *SharedGalleryImagesClient) listHandleResponse(resp *http.Response) (SharedGalleryImagesClientListResponse, error) { - result := SharedGalleryImagesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SharedGalleryImageList); err != nil { - return SharedGalleryImagesClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_sharedgalleryimageversions_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_sharedgalleryimageversions_client.go deleted file mode 100644 index d2257bf3..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_sharedgalleryimageversions_client.go +++ /dev/null @@ -1,203 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// SharedGalleryImageVersionsClient contains the methods for the SharedGalleryImageVersions group. -// Don't use this type directly, use NewSharedGalleryImageVersionsClient() instead. -type SharedGalleryImageVersionsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewSharedGalleryImageVersionsClient creates a new instance of SharedGalleryImageVersionsClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewSharedGalleryImageVersionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SharedGalleryImageVersionsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &SharedGalleryImageVersionsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// Get - Get a shared gallery image version by subscription id or tenant id. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-01 -// location - Resource location. -// galleryUniqueName - The unique name of the Shared Gallery. -// galleryImageName - The name of the Shared Gallery Image Definition from which the Image Versions are to be listed. -// galleryImageVersionName - The name of the gallery image version to be created. Needs to follow semantic version name pattern: -// The allowed characters are digit and period. Digits must be within the range of a 32-bit integer. -// Format: .. -// options - SharedGalleryImageVersionsClientGetOptions contains the optional parameters for the SharedGalleryImageVersionsClient.Get -// method. -func (client *SharedGalleryImageVersionsClient) Get(ctx context.Context, location string, galleryUniqueName string, galleryImageName string, galleryImageVersionName string, options *SharedGalleryImageVersionsClientGetOptions) (SharedGalleryImageVersionsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, location, galleryUniqueName, galleryImageName, galleryImageVersionName, options) - if err != nil { - return SharedGalleryImageVersionsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return SharedGalleryImageVersionsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SharedGalleryImageVersionsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *SharedGalleryImageVersionsClient) getCreateRequest(ctx context.Context, location string, galleryUniqueName string, galleryImageName string, galleryImageVersionName string, options *SharedGalleryImageVersionsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}/images/{galleryImageName}/versions/{galleryImageVersionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if galleryUniqueName == "" { - return nil, errors.New("parameter galleryUniqueName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryUniqueName}", url.PathEscape(galleryUniqueName)) - if galleryImageName == "" { - return nil, errors.New("parameter galleryImageName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryImageName}", url.PathEscape(galleryImageName)) - if galleryImageVersionName == "" { - return nil, errors.New("parameter galleryImageVersionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryImageVersionName}", url.PathEscape(galleryImageVersionName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *SharedGalleryImageVersionsClient) getHandleResponse(resp *http.Response) (SharedGalleryImageVersionsClientGetResponse, error) { - result := SharedGalleryImageVersionsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SharedGalleryImageVersion); err != nil { - return SharedGalleryImageVersionsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - List shared gallery image versions by subscription id or tenant id. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-01 -// location - Resource location. -// galleryUniqueName - The unique name of the Shared Gallery. -// galleryImageName - The name of the Shared Gallery Image Definition from which the Image Versions are to be listed. -// options - SharedGalleryImageVersionsClientListOptions contains the optional parameters for the SharedGalleryImageVersionsClient.List -// method. -func (client *SharedGalleryImageVersionsClient) NewListPager(location string, galleryUniqueName string, galleryImageName string, options *SharedGalleryImageVersionsClientListOptions) *runtime.Pager[SharedGalleryImageVersionsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[SharedGalleryImageVersionsClientListResponse]{ - More: func(page SharedGalleryImageVersionsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *SharedGalleryImageVersionsClientListResponse) (SharedGalleryImageVersionsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, location, galleryUniqueName, galleryImageName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return SharedGalleryImageVersionsClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return SharedGalleryImageVersionsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SharedGalleryImageVersionsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *SharedGalleryImageVersionsClient) listCreateRequest(ctx context.Context, location string, galleryUniqueName string, galleryImageName string, options *SharedGalleryImageVersionsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}/images/{galleryImageName}/versions" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if galleryUniqueName == "" { - return nil, errors.New("parameter galleryUniqueName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryUniqueName}", url.PathEscape(galleryUniqueName)) - if galleryImageName == "" { - return nil, errors.New("parameter galleryImageName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryImageName}", url.PathEscape(galleryImageName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-01") - if options != nil && options.SharedTo != nil { - reqQP.Set("sharedTo", string(*options.SharedTo)) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *SharedGalleryImageVersionsClient) listHandleResponse(resp *http.Response) (SharedGalleryImageVersionsClientListResponse, error) { - result := SharedGalleryImageVersionsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SharedGalleryImageVersionList); err != nil { - return SharedGalleryImageVersionsClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_snapshots_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_snapshots_client.go deleted file mode 100644 index 31ee6607..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_snapshots_client.go +++ /dev/null @@ -1,566 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// SnapshotsClient contains the methods for the Snapshots group. -// Don't use this type directly, use NewSnapshotsClient() instead. -type SnapshotsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewSnapshotsClient creates a new instance of SnapshotsClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewSnapshotsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SnapshotsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &SnapshotsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates a snapshot. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 -// resourceGroupName - The name of the resource group. -// snapshotName - 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 - Snapshot object supplied in the body of the Put disk operation. -// options - SnapshotsClientBeginCreateOrUpdateOptions contains the optional parameters for the SnapshotsClient.BeginCreateOrUpdate -// method. -func (client *SnapshotsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, snapshotName string, snapshot Snapshot, options *SnapshotsClientBeginCreateOrUpdateOptions) (*runtime.Poller[SnapshotsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, snapshotName, snapshot, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[SnapshotsClientCreateOrUpdateResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[SnapshotsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates or updates a snapshot. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 -func (client *SnapshotsClient) createOrUpdate(ctx context.Context, resourceGroupName string, snapshotName string, snapshot Snapshot, options *SnapshotsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, snapshotName, snapshot, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *SnapshotsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, snapshotName string, snapshot Snapshot, options *SnapshotsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if snapshotName == "" { - return nil, errors.New("parameter snapshotName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{snapshotName}", url.PathEscape(snapshotName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, snapshot) -} - -// BeginDelete - Deletes a snapshot. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 -// resourceGroupName - The name of the resource group. -// snapshotName - 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. -// options - SnapshotsClientBeginDeleteOptions contains the optional parameters for the SnapshotsClient.BeginDelete method. -func (client *SnapshotsClient) BeginDelete(ctx context.Context, resourceGroupName string, snapshotName string, options *SnapshotsClientBeginDeleteOptions) (*runtime.Poller[SnapshotsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, snapshotName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[SnapshotsClientDeleteResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[SnapshotsClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes a snapshot. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 -func (client *SnapshotsClient) deleteOperation(ctx context.Context, resourceGroupName string, snapshotName string, options *SnapshotsClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, snapshotName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *SnapshotsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, snapshotName string, options *SnapshotsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if snapshotName == "" { - return nil, errors.New("parameter snapshotName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{snapshotName}", url.PathEscape(snapshotName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") - req.Raw().URL.RawQuery = reqQP.Encode() - return req, nil -} - -// Get - Gets information about a snapshot. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 -// resourceGroupName - The name of the resource group. -// snapshotName - 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. -// options - SnapshotsClientGetOptions contains the optional parameters for the SnapshotsClient.Get method. -func (client *SnapshotsClient) Get(ctx context.Context, resourceGroupName string, snapshotName string, options *SnapshotsClientGetOptions) (SnapshotsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, snapshotName, options) - if err != nil { - return SnapshotsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return SnapshotsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SnapshotsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *SnapshotsClient) getCreateRequest(ctx context.Context, resourceGroupName string, snapshotName string, options *SnapshotsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if snapshotName == "" { - return nil, errors.New("parameter snapshotName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{snapshotName}", url.PathEscape(snapshotName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *SnapshotsClient) getHandleResponse(resp *http.Response) (SnapshotsClientGetResponse, error) { - result := SnapshotsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.Snapshot); err != nil { - return SnapshotsClientGetResponse{}, err - } - return result, nil -} - -// BeginGrantAccess - Grants access to a snapshot. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 -// resourceGroupName - The name of the resource group. -// snapshotName - 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 - Access data object supplied in the body of the get snapshot access operation. -// options - SnapshotsClientBeginGrantAccessOptions contains the optional parameters for the SnapshotsClient.BeginGrantAccess -// method. -func (client *SnapshotsClient) BeginGrantAccess(ctx context.Context, resourceGroupName string, snapshotName string, grantAccessData GrantAccessData, options *SnapshotsClientBeginGrantAccessOptions) (*runtime.Poller[SnapshotsClientGrantAccessResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.grantAccess(ctx, resourceGroupName, snapshotName, grantAccessData, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[SnapshotsClientGrantAccessResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[SnapshotsClientGrantAccessResponse](options.ResumeToken, client.pl, nil) - } -} - -// GrantAccess - Grants access to a snapshot. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 -func (client *SnapshotsClient) grantAccess(ctx context.Context, resourceGroupName string, snapshotName string, grantAccessData GrantAccessData, options *SnapshotsClientBeginGrantAccessOptions) (*http.Response, error) { - req, err := client.grantAccessCreateRequest(ctx, resourceGroupName, snapshotName, grantAccessData, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// grantAccessCreateRequest creates the GrantAccess request. -func (client *SnapshotsClient) grantAccessCreateRequest(ctx context.Context, resourceGroupName string, snapshotName string, grantAccessData GrantAccessData, options *SnapshotsClientBeginGrantAccessOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/beginGetAccess" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if snapshotName == "" { - return nil, errors.New("parameter snapshotName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{snapshotName}", url.PathEscape(snapshotName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, grantAccessData) -} - -// NewListPager - Lists snapshots under a subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 -// options - SnapshotsClientListOptions contains the optional parameters for the SnapshotsClient.List method. -func (client *SnapshotsClient) NewListPager(options *SnapshotsClientListOptions) *runtime.Pager[SnapshotsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[SnapshotsClientListResponse]{ - More: func(page SnapshotsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *SnapshotsClientListResponse) (SnapshotsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return SnapshotsClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return SnapshotsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SnapshotsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *SnapshotsClient) listCreateRequest(ctx context.Context, options *SnapshotsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/snapshots" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *SnapshotsClient) listHandleResponse(resp *http.Response) (SnapshotsClientListResponse, error) { - result := SnapshotsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SnapshotList); err != nil { - return SnapshotsClientListResponse{}, err - } - return result, nil -} - -// NewListByResourceGroupPager - Lists snapshots under a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 -// resourceGroupName - The name of the resource group. -// options - SnapshotsClientListByResourceGroupOptions contains the optional parameters for the SnapshotsClient.ListByResourceGroup -// method. -func (client *SnapshotsClient) NewListByResourceGroupPager(resourceGroupName string, options *SnapshotsClientListByResourceGroupOptions) *runtime.Pager[SnapshotsClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[SnapshotsClientListByResourceGroupResponse]{ - More: func(page SnapshotsClientListByResourceGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *SnapshotsClientListByResourceGroupResponse) (SnapshotsClientListByResourceGroupResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return SnapshotsClientListByResourceGroupResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return SnapshotsClientListByResourceGroupResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SnapshotsClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) - } - return client.listByResourceGroupHandleResponse(resp) - }, - }) -} - -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *SnapshotsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *SnapshotsClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *SnapshotsClient) listByResourceGroupHandleResponse(resp *http.Response) (SnapshotsClientListByResourceGroupResponse, error) { - result := SnapshotsClientListByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SnapshotList); err != nil { - return SnapshotsClientListByResourceGroupResponse{}, err - } - return result, nil -} - -// BeginRevokeAccess - Revokes access to a snapshot. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 -// resourceGroupName - The name of the resource group. -// snapshotName - 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. -// options - SnapshotsClientBeginRevokeAccessOptions contains the optional parameters for the SnapshotsClient.BeginRevokeAccess -// method. -func (client *SnapshotsClient) BeginRevokeAccess(ctx context.Context, resourceGroupName string, snapshotName string, options *SnapshotsClientBeginRevokeAccessOptions) (*runtime.Poller[SnapshotsClientRevokeAccessResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.revokeAccess(ctx, resourceGroupName, snapshotName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[SnapshotsClientRevokeAccessResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[SnapshotsClientRevokeAccessResponse](options.ResumeToken, client.pl, nil) - } -} - -// RevokeAccess - Revokes access to a snapshot. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 -func (client *SnapshotsClient) revokeAccess(ctx context.Context, resourceGroupName string, snapshotName string, options *SnapshotsClientBeginRevokeAccessOptions) (*http.Response, error) { - req, err := client.revokeAccessCreateRequest(ctx, resourceGroupName, snapshotName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// revokeAccessCreateRequest creates the RevokeAccess request. -func (client *SnapshotsClient) revokeAccessCreateRequest(ctx context.Context, resourceGroupName string, snapshotName string, options *SnapshotsClientBeginRevokeAccessOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/endGetAccess" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if snapshotName == "" { - return nil, errors.New("parameter snapshotName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{snapshotName}", url.PathEscape(snapshotName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") - req.Raw().URL.RawQuery = reqQP.Encode() - return req, nil -} - -// BeginUpdate - Updates (patches) a snapshot. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 -// resourceGroupName - The name of the resource group. -// snapshotName - 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 - Snapshot object supplied in the body of the Patch snapshot operation. -// options - SnapshotsClientBeginUpdateOptions contains the optional parameters for the SnapshotsClient.BeginUpdate method. -func (client *SnapshotsClient) BeginUpdate(ctx context.Context, resourceGroupName string, snapshotName string, snapshot SnapshotUpdate, options *SnapshotsClientBeginUpdateOptions) (*runtime.Poller[SnapshotsClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, snapshotName, snapshot, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[SnapshotsClientUpdateResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[SnapshotsClientUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// Update - Updates (patches) a snapshot. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 -func (client *SnapshotsClient) update(ctx context.Context, resourceGroupName string, snapshotName string, snapshot SnapshotUpdate, options *SnapshotsClientBeginUpdateOptions) (*http.Response, error) { - req, err := client.updateCreateRequest(ctx, resourceGroupName, snapshotName, snapshot, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// updateCreateRequest creates the Update request. -func (client *SnapshotsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, snapshotName string, snapshot SnapshotUpdate, options *SnapshotsClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if snapshotName == "" { - return nil, errors.New("parameter snapshotName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{snapshotName}", url.PathEscape(snapshotName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, snapshot) -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_sshpublickeys_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_sshpublickeys_client.go deleted file mode 100644 index c9e72985..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_sshpublickeys_client.go +++ /dev/null @@ -1,459 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// SSHPublicKeysClient contains the methods for the SSHPublicKeys group. -// Don't use this type directly, use NewSSHPublicKeysClient() instead. -type SSHPublicKeysClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewSSHPublicKeysClient creates a new instance of SSHPublicKeysClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewSSHPublicKeysClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SSHPublicKeysClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &SSHPublicKeysClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// Create - Creates a new SSH public key resource. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// sshPublicKeyName - The name of the SSH public key. -// parameters - Parameters supplied to create the SSH public key. -// options - SSHPublicKeysClientCreateOptions contains the optional parameters for the SSHPublicKeysClient.Create method. -func (client *SSHPublicKeysClient) Create(ctx context.Context, resourceGroupName string, sshPublicKeyName string, parameters SSHPublicKeyResource, options *SSHPublicKeysClientCreateOptions) (SSHPublicKeysClientCreateResponse, error) { - req, err := client.createCreateRequest(ctx, resourceGroupName, sshPublicKeyName, parameters, options) - if err != nil { - return SSHPublicKeysClientCreateResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return SSHPublicKeysClientCreateResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return SSHPublicKeysClientCreateResponse{}, runtime.NewResponseError(resp) - } - return client.createHandleResponse(resp) -} - -// createCreateRequest creates the Create request. -func (client *SSHPublicKeysClient) createCreateRequest(ctx context.Context, resourceGroupName string, sshPublicKeyName string, parameters SSHPublicKeyResource, options *SSHPublicKeysClientCreateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if sshPublicKeyName == "" { - return nil, errors.New("parameter sshPublicKeyName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{sshPublicKeyName}", url.PathEscape(sshPublicKeyName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// createHandleResponse handles the Create response. -func (client *SSHPublicKeysClient) createHandleResponse(resp *http.Response) (SSHPublicKeysClientCreateResponse, error) { - result := SSHPublicKeysClientCreateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SSHPublicKeyResource); err != nil { - return SSHPublicKeysClientCreateResponse{}, err - } - return result, nil -} - -// Delete - Delete an SSH public key. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// sshPublicKeyName - The name of the SSH public key. -// options - SSHPublicKeysClientDeleteOptions contains the optional parameters for the SSHPublicKeysClient.Delete method. -func (client *SSHPublicKeysClient) Delete(ctx context.Context, resourceGroupName string, sshPublicKeyName string, options *SSHPublicKeysClientDeleteOptions) (SSHPublicKeysClientDeleteResponse, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, sshPublicKeyName, options) - if err != nil { - return SSHPublicKeysClientDeleteResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return SSHPublicKeysClientDeleteResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return SSHPublicKeysClientDeleteResponse{}, runtime.NewResponseError(resp) - } - return SSHPublicKeysClientDeleteResponse{}, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *SSHPublicKeysClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, sshPublicKeyName string, options *SSHPublicKeysClientDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if sshPublicKeyName == "" { - return nil, errors.New("parameter sshPublicKeyName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{sshPublicKeyName}", url.PathEscape(sshPublicKeyName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// GenerateKeyPair - Generates and returns a public/private key pair and populates the SSH public key resource with the public -// key. The length of the key will be 3072 bits. This operation can only be performed once per -// SSH public key resource. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// sshPublicKeyName - The name of the SSH public key. -// options - SSHPublicKeysClientGenerateKeyPairOptions contains the optional parameters for the SSHPublicKeysClient.GenerateKeyPair -// method. -func (client *SSHPublicKeysClient) GenerateKeyPair(ctx context.Context, resourceGroupName string, sshPublicKeyName string, options *SSHPublicKeysClientGenerateKeyPairOptions) (SSHPublicKeysClientGenerateKeyPairResponse, error) { - req, err := client.generateKeyPairCreateRequest(ctx, resourceGroupName, sshPublicKeyName, options) - if err != nil { - return SSHPublicKeysClientGenerateKeyPairResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return SSHPublicKeysClientGenerateKeyPairResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SSHPublicKeysClientGenerateKeyPairResponse{}, runtime.NewResponseError(resp) - } - return client.generateKeyPairHandleResponse(resp) -} - -// generateKeyPairCreateRequest creates the GenerateKeyPair request. -func (client *SSHPublicKeysClient) generateKeyPairCreateRequest(ctx context.Context, resourceGroupName string, sshPublicKeyName string, options *SSHPublicKeysClientGenerateKeyPairOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName}/generateKeyPair" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if sshPublicKeyName == "" { - return nil, errors.New("parameter sshPublicKeyName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{sshPublicKeyName}", url.PathEscape(sshPublicKeyName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// generateKeyPairHandleResponse handles the GenerateKeyPair response. -func (client *SSHPublicKeysClient) generateKeyPairHandleResponse(resp *http.Response) (SSHPublicKeysClientGenerateKeyPairResponse, error) { - result := SSHPublicKeysClientGenerateKeyPairResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SSHPublicKeyGenerateKeyPairResult); err != nil { - return SSHPublicKeysClientGenerateKeyPairResponse{}, err - } - return result, nil -} - -// Get - Retrieves information about an SSH public key. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// sshPublicKeyName - The name of the SSH public key. -// options - SSHPublicKeysClientGetOptions contains the optional parameters for the SSHPublicKeysClient.Get method. -func (client *SSHPublicKeysClient) Get(ctx context.Context, resourceGroupName string, sshPublicKeyName string, options *SSHPublicKeysClientGetOptions) (SSHPublicKeysClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, sshPublicKeyName, options) - if err != nil { - return SSHPublicKeysClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return SSHPublicKeysClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SSHPublicKeysClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *SSHPublicKeysClient) getCreateRequest(ctx context.Context, resourceGroupName string, sshPublicKeyName string, options *SSHPublicKeysClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if sshPublicKeyName == "" { - return nil, errors.New("parameter sshPublicKeyName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{sshPublicKeyName}", url.PathEscape(sshPublicKeyName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *SSHPublicKeysClient) getHandleResponse(resp *http.Response) (SSHPublicKeysClientGetResponse, error) { - result := SSHPublicKeysClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SSHPublicKeyResource); err != nil { - return SSHPublicKeysClientGetResponse{}, err - } - return result, nil -} - -// NewListByResourceGroupPager - Lists all of the SSH public keys in the specified resource group. Use the nextLink property -// in the response to get the next page of SSH public keys. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// options - SSHPublicKeysClientListByResourceGroupOptions contains the optional parameters for the SSHPublicKeysClient.ListByResourceGroup -// method. -func (client *SSHPublicKeysClient) NewListByResourceGroupPager(resourceGroupName string, options *SSHPublicKeysClientListByResourceGroupOptions) *runtime.Pager[SSHPublicKeysClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[SSHPublicKeysClientListByResourceGroupResponse]{ - More: func(page SSHPublicKeysClientListByResourceGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *SSHPublicKeysClientListByResourceGroupResponse) (SSHPublicKeysClientListByResourceGroupResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return SSHPublicKeysClientListByResourceGroupResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return SSHPublicKeysClientListByResourceGroupResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SSHPublicKeysClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) - } - return client.listByResourceGroupHandleResponse(resp) - }, - }) -} - -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *SSHPublicKeysClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *SSHPublicKeysClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *SSHPublicKeysClient) listByResourceGroupHandleResponse(resp *http.Response) (SSHPublicKeysClientListByResourceGroupResponse, error) { - result := SSHPublicKeysClientListByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SSHPublicKeysGroupListResult); err != nil { - return SSHPublicKeysClientListByResourceGroupResponse{}, err - } - return result, nil -} - -// NewListBySubscriptionPager - Lists all of the SSH public keys in the subscription. Use the nextLink property in the response -// to get the next page of SSH public keys. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// options - SSHPublicKeysClientListBySubscriptionOptions contains the optional parameters for the SSHPublicKeysClient.ListBySubscription -// method. -func (client *SSHPublicKeysClient) NewListBySubscriptionPager(options *SSHPublicKeysClientListBySubscriptionOptions) *runtime.Pager[SSHPublicKeysClientListBySubscriptionResponse] { - return runtime.NewPager(runtime.PagingHandler[SSHPublicKeysClientListBySubscriptionResponse]{ - More: func(page SSHPublicKeysClientListBySubscriptionResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *SSHPublicKeysClientListBySubscriptionResponse) (SSHPublicKeysClientListBySubscriptionResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listBySubscriptionCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return SSHPublicKeysClientListBySubscriptionResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return SSHPublicKeysClientListBySubscriptionResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SSHPublicKeysClientListBySubscriptionResponse{}, runtime.NewResponseError(resp) - } - return client.listBySubscriptionHandleResponse(resp) - }, - }) -} - -// listBySubscriptionCreateRequest creates the ListBySubscription request. -func (client *SSHPublicKeysClient) listBySubscriptionCreateRequest(ctx context.Context, options *SSHPublicKeysClientListBySubscriptionOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/sshPublicKeys" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listBySubscriptionHandleResponse handles the ListBySubscription response. -func (client *SSHPublicKeysClient) listBySubscriptionHandleResponse(resp *http.Response) (SSHPublicKeysClientListBySubscriptionResponse, error) { - result := SSHPublicKeysClientListBySubscriptionResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SSHPublicKeysGroupListResult); err != nil { - return SSHPublicKeysClientListBySubscriptionResponse{}, err - } - return result, nil -} - -// Update - Updates a new SSH public key resource. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// sshPublicKeyName - The name of the SSH public key. -// parameters - Parameters supplied to update the SSH public key. -// options - SSHPublicKeysClientUpdateOptions contains the optional parameters for the SSHPublicKeysClient.Update method. -func (client *SSHPublicKeysClient) Update(ctx context.Context, resourceGroupName string, sshPublicKeyName string, parameters SSHPublicKeyUpdateResource, options *SSHPublicKeysClientUpdateOptions) (SSHPublicKeysClientUpdateResponse, error) { - req, err := client.updateCreateRequest(ctx, resourceGroupName, sshPublicKeyName, parameters, options) - if err != nil { - return SSHPublicKeysClientUpdateResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return SSHPublicKeysClientUpdateResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SSHPublicKeysClientUpdateResponse{}, runtime.NewResponseError(resp) - } - return client.updateHandleResponse(resp) -} - -// updateCreateRequest creates the Update request. -func (client *SSHPublicKeysClient) updateCreateRequest(ctx context.Context, resourceGroupName string, sshPublicKeyName string, parameters SSHPublicKeyUpdateResource, options *SSHPublicKeysClientUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if sshPublicKeyName == "" { - return nil, errors.New("parameter sshPublicKeyName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{sshPublicKeyName}", url.PathEscape(sshPublicKeyName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// updateHandleResponse handles the Update response. -func (client *SSHPublicKeysClient) updateHandleResponse(resp *http.Response) (SSHPublicKeysClientUpdateResponse, error) { - result := SSHPublicKeysClientUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SSHPublicKeyResource); err != nil { - return SSHPublicKeysClientUpdateResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_time_rfc3339.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_time_rfc3339.go deleted file mode 100644 index 06819587..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_time_rfc3339.go +++ /dev/null @@ -1,86 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" - "regexp" - "strings" - "time" -) - -const ( - utcLayoutJSON = `"2006-01-02T15:04:05.999999999"` - utcLayout = "2006-01-02T15:04:05.999999999" - rfc3339JSON = `"` + time.RFC3339Nano + `"` -) - -// Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. -var tzOffsetRegex = regexp.MustCompile(`(Z|z|\+|-)(\d+:\d+)*"*$`) - -type timeRFC3339 time.Time - -func (t timeRFC3339) MarshalJSON() (json []byte, err error) { - tt := time.Time(t) - return tt.MarshalJSON() -} - -func (t timeRFC3339) MarshalText() (text []byte, err error) { - tt := time.Time(t) - return tt.MarshalText() -} - -func (t *timeRFC3339) UnmarshalJSON(data []byte) error { - layout := utcLayoutJSON - if tzOffsetRegex.Match(data) { - layout = rfc3339JSON - } - return t.Parse(layout, string(data)) -} - -func (t *timeRFC3339) UnmarshalText(data []byte) (err error) { - layout := utcLayout - if tzOffsetRegex.Match(data) { - layout = time.RFC3339Nano - } - return t.Parse(layout, string(data)) -} - -func (t *timeRFC3339) Parse(layout, value string) error { - p, err := time.Parse(layout, strings.ToUpper(value)) - *t = timeRFC3339(p) - return err -} - -func populateTimeRFC3339(m map[string]interface{}, k string, t *time.Time) { - if t == nil { - return - } else if azcore.IsNullValue(t) { - m[k] = nil - return - } else if reflect.ValueOf(t).IsNil() { - return - } - m[k] = (*timeRFC3339)(t) -} - -func unpopulateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { - if data == nil || strings.EqualFold(string(data), "null") { - return nil - } - var aux timeRFC3339 - if err := json.Unmarshal(data, &aux); err != nil { - return fmt.Errorf("struct field %s: %v", fn, err) - } - *t = (*time.Time)(&aux) - return nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_usage_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_usage_client.go deleted file mode 100644 index 039ae899..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_usage_client.go +++ /dev/null @@ -1,121 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// UsageClient contains the methods for the Usage group. -// Don't use this type directly, use NewUsageClient() instead. -type UsageClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewUsageClient creates a new instance of UsageClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewUsageClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*UsageClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &UsageClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// NewListPager - Gets, for the specified location, the current compute resource usage information as well as the limits for -// compute resources under the subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// location - The location for which resource usage is queried. -// options - UsageClientListOptions contains the optional parameters for the UsageClient.List method. -func (client *UsageClient) NewListPager(location string, options *UsageClientListOptions) *runtime.Pager[UsageClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[UsageClientListResponse]{ - More: func(page UsageClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *UsageClientListResponse) (UsageClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, location, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return UsageClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return UsageClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return UsageClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *UsageClient) listCreateRequest(ctx context.Context, location string, options *UsageClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/usages" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *UsageClient) listHandleResponse(resp *http.Response) (UsageClientListResponse, error) { - result := UsageClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ListUsagesResult); err != nil { - return UsageClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_virtualmachineextensionimages_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_virtualmachineextensionimages_client.go deleted file mode 100644 index 6b17f3e6..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_virtualmachineextensionimages_client.go +++ /dev/null @@ -1,246 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strconv" - "strings" -) - -// VirtualMachineExtensionImagesClient contains the methods for the VirtualMachineExtensionImages group. -// Don't use this type directly, use NewVirtualMachineExtensionImagesClient() instead. -type VirtualMachineExtensionImagesClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewVirtualMachineExtensionImagesClient creates a new instance of VirtualMachineExtensionImagesClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewVirtualMachineExtensionImagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachineExtensionImagesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &VirtualMachineExtensionImagesClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// Get - Gets a virtual machine extension image. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// location - The name of a supported Azure region. -// options - VirtualMachineExtensionImagesClientGetOptions contains the optional parameters for the VirtualMachineExtensionImagesClient.Get -// method. -func (client *VirtualMachineExtensionImagesClient) Get(ctx context.Context, location string, publisherName string, typeParam string, version string, options *VirtualMachineExtensionImagesClientGetOptions) (VirtualMachineExtensionImagesClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, location, publisherName, typeParam, version, options) - if err != nil { - return VirtualMachineExtensionImagesClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualMachineExtensionImagesClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualMachineExtensionImagesClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *VirtualMachineExtensionImagesClient) getCreateRequest(ctx context.Context, location string, publisherName string, typeParam string, version string, options *VirtualMachineExtensionImagesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions/{version}" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if publisherName == "" { - return nil, errors.New("parameter publisherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) - if typeParam == "" { - return nil, errors.New("parameter typeParam cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{type}", url.PathEscape(typeParam)) - if version == "" { - return nil, errors.New("parameter version cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{version}", url.PathEscape(version)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *VirtualMachineExtensionImagesClient) getHandleResponse(resp *http.Response) (VirtualMachineExtensionImagesClientGetResponse, error) { - result := VirtualMachineExtensionImagesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineExtensionImage); err != nil { - return VirtualMachineExtensionImagesClientGetResponse{}, err - } - return result, nil -} - -// ListTypes - Gets a list of virtual machine extension image types. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// location - The name of a supported Azure region. -// options - VirtualMachineExtensionImagesClientListTypesOptions contains the optional parameters for the VirtualMachineExtensionImagesClient.ListTypes -// method. -func (client *VirtualMachineExtensionImagesClient) ListTypes(ctx context.Context, location string, publisherName string, options *VirtualMachineExtensionImagesClientListTypesOptions) (VirtualMachineExtensionImagesClientListTypesResponse, error) { - req, err := client.listTypesCreateRequest(ctx, location, publisherName, options) - if err != nil { - return VirtualMachineExtensionImagesClientListTypesResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualMachineExtensionImagesClientListTypesResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualMachineExtensionImagesClientListTypesResponse{}, runtime.NewResponseError(resp) - } - return client.listTypesHandleResponse(resp) -} - -// listTypesCreateRequest creates the ListTypes request. -func (client *VirtualMachineExtensionImagesClient) listTypesCreateRequest(ctx context.Context, location string, publisherName string, options *VirtualMachineExtensionImagesClientListTypesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if publisherName == "" { - return nil, errors.New("parameter publisherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listTypesHandleResponse handles the ListTypes response. -func (client *VirtualMachineExtensionImagesClient) listTypesHandleResponse(resp *http.Response) (VirtualMachineExtensionImagesClientListTypesResponse, error) { - result := VirtualMachineExtensionImagesClientListTypesResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineExtensionImageArray); err != nil { - return VirtualMachineExtensionImagesClientListTypesResponse{}, err - } - return result, nil -} - -// ListVersions - Gets a list of virtual machine extension image versions. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// location - The name of a supported Azure region. -// options - VirtualMachineExtensionImagesClientListVersionsOptions contains the optional parameters for the VirtualMachineExtensionImagesClient.ListVersions -// method. -func (client *VirtualMachineExtensionImagesClient) ListVersions(ctx context.Context, location string, publisherName string, typeParam string, options *VirtualMachineExtensionImagesClientListVersionsOptions) (VirtualMachineExtensionImagesClientListVersionsResponse, error) { - req, err := client.listVersionsCreateRequest(ctx, location, publisherName, typeParam, options) - if err != nil { - return VirtualMachineExtensionImagesClientListVersionsResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualMachineExtensionImagesClientListVersionsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualMachineExtensionImagesClientListVersionsResponse{}, runtime.NewResponseError(resp) - } - return client.listVersionsHandleResponse(resp) -} - -// listVersionsCreateRequest creates the ListVersions request. -func (client *VirtualMachineExtensionImagesClient) listVersionsCreateRequest(ctx context.Context, location string, publisherName string, typeParam string, options *VirtualMachineExtensionImagesClientListVersionsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if publisherName == "" { - return nil, errors.New("parameter publisherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) - if typeParam == "" { - return nil, errors.New("parameter typeParam cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{type}", url.PathEscape(typeParam)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Filter != nil { - reqQP.Set("$filter", *options.Filter) - } - if options != nil && options.Top != nil { - reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) - } - if options != nil && options.Orderby != nil { - reqQP.Set("$orderby", *options.Orderby) - } - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listVersionsHandleResponse handles the ListVersions response. -func (client *VirtualMachineExtensionImagesClient) listVersionsHandleResponse(resp *http.Response) (VirtualMachineExtensionImagesClientListVersionsResponse, error) { - result := VirtualMachineExtensionImagesClientListVersionsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineExtensionImageArray); err != nil { - return VirtualMachineExtensionImagesClientListVersionsResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_virtualmachineextensions_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_virtualmachineextensions_client.go deleted file mode 100644 index 63b1c5b3..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_virtualmachineextensions_client.go +++ /dev/null @@ -1,387 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// VirtualMachineExtensionsClient contains the methods for the VirtualMachineExtensions group. -// Don't use this type directly, use NewVirtualMachineExtensionsClient() instead. -type VirtualMachineExtensionsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewVirtualMachineExtensionsClient creates a new instance of VirtualMachineExtensionsClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewVirtualMachineExtensionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachineExtensionsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &VirtualMachineExtensionsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - The operation to create or update the extension. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmName - The name of the virtual machine where the extension should be created or updated. -// vmExtensionName - The name of the virtual machine extension. -// extensionParameters - Parameters supplied to the Create Virtual Machine Extension operation. -// options - VirtualMachineExtensionsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineExtensionsClient.BeginCreateOrUpdate -// method. -func (client *VirtualMachineExtensionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, vmName string, vmExtensionName string, extensionParameters VirtualMachineExtension, options *VirtualMachineExtensionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualMachineExtensionsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, vmName, vmExtensionName, extensionParameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[VirtualMachineExtensionsClientCreateOrUpdateResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[VirtualMachineExtensionsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - The operation to create or update the extension. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *VirtualMachineExtensionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, vmName string, vmExtensionName string, extensionParameters VirtualMachineExtension, options *VirtualMachineExtensionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, vmName, vmExtensionName, extensionParameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *VirtualMachineExtensionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, vmName string, vmExtensionName string, extensionParameters VirtualMachineExtension, options *VirtualMachineExtensionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if vmExtensionName == "" { - return nil, errors.New("parameter vmExtensionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmExtensionName}", url.PathEscape(vmExtensionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, extensionParameters) -} - -// BeginDelete - The operation to delete the extension. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmName - The name of the virtual machine where the extension should be deleted. -// vmExtensionName - The name of the virtual machine extension. -// options - VirtualMachineExtensionsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineExtensionsClient.BeginDelete -// method. -func (client *VirtualMachineExtensionsClient) BeginDelete(ctx context.Context, resourceGroupName string, vmName string, vmExtensionName string, options *VirtualMachineExtensionsClientBeginDeleteOptions) (*runtime.Poller[VirtualMachineExtensionsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, vmName, vmExtensionName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[VirtualMachineExtensionsClientDeleteResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[VirtualMachineExtensionsClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - The operation to delete the extension. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *VirtualMachineExtensionsClient) deleteOperation(ctx context.Context, resourceGroupName string, vmName string, vmExtensionName string, options *VirtualMachineExtensionsClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, vmName, vmExtensionName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *VirtualMachineExtensionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, vmName string, vmExtensionName string, options *VirtualMachineExtensionsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if vmExtensionName == "" { - return nil, errors.New("parameter vmExtensionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmExtensionName}", url.PathEscape(vmExtensionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - The operation to get the extension. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmName - The name of the virtual machine containing the extension. -// vmExtensionName - The name of the virtual machine extension. -// options - VirtualMachineExtensionsClientGetOptions contains the optional parameters for the VirtualMachineExtensionsClient.Get -// method. -func (client *VirtualMachineExtensionsClient) Get(ctx context.Context, resourceGroupName string, vmName string, vmExtensionName string, options *VirtualMachineExtensionsClientGetOptions) (VirtualMachineExtensionsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, vmName, vmExtensionName, options) - if err != nil { - return VirtualMachineExtensionsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualMachineExtensionsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualMachineExtensionsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *VirtualMachineExtensionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, vmName string, vmExtensionName string, options *VirtualMachineExtensionsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if vmExtensionName == "" { - return nil, errors.New("parameter vmExtensionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmExtensionName}", url.PathEscape(vmExtensionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *VirtualMachineExtensionsClient) getHandleResponse(resp *http.Response) (VirtualMachineExtensionsClientGetResponse, error) { - result := VirtualMachineExtensionsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineExtension); err != nil { - return VirtualMachineExtensionsClientGetResponse{}, err - } - return result, nil -} - -// List - The operation to get all extensions of a Virtual Machine. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmName - The name of the virtual machine containing the extension. -// options - VirtualMachineExtensionsClientListOptions contains the optional parameters for the VirtualMachineExtensionsClient.List -// method. -func (client *VirtualMachineExtensionsClient) List(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachineExtensionsClientListOptions) (VirtualMachineExtensionsClientListResponse, error) { - req, err := client.listCreateRequest(ctx, resourceGroupName, vmName, options) - if err != nil { - return VirtualMachineExtensionsClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualMachineExtensionsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualMachineExtensionsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) -} - -// listCreateRequest creates the List request. -func (client *VirtualMachineExtensionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachineExtensionsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *VirtualMachineExtensionsClient) listHandleResponse(resp *http.Response) (VirtualMachineExtensionsClientListResponse, error) { - result := VirtualMachineExtensionsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineExtensionsListResult); err != nil { - return VirtualMachineExtensionsClientListResponse{}, err - } - return result, nil -} - -// BeginUpdate - The operation to update the extension. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmName - The name of the virtual machine where the extension should be updated. -// vmExtensionName - The name of the virtual machine extension. -// extensionParameters - Parameters supplied to the Update Virtual Machine Extension operation. -// options - VirtualMachineExtensionsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineExtensionsClient.BeginUpdate -// method. -func (client *VirtualMachineExtensionsClient) BeginUpdate(ctx context.Context, resourceGroupName string, vmName string, vmExtensionName string, extensionParameters VirtualMachineExtensionUpdate, options *VirtualMachineExtensionsClientBeginUpdateOptions) (*runtime.Poller[VirtualMachineExtensionsClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, vmName, vmExtensionName, extensionParameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[VirtualMachineExtensionsClientUpdateResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[VirtualMachineExtensionsClientUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// Update - The operation to update the extension. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *VirtualMachineExtensionsClient) update(ctx context.Context, resourceGroupName string, vmName string, vmExtensionName string, extensionParameters VirtualMachineExtensionUpdate, options *VirtualMachineExtensionsClientBeginUpdateOptions) (*http.Response, error) { - req, err := client.updateCreateRequest(ctx, resourceGroupName, vmName, vmExtensionName, extensionParameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// updateCreateRequest creates the Update request. -func (client *VirtualMachineExtensionsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, vmName string, vmExtensionName string, extensionParameters VirtualMachineExtensionUpdate, options *VirtualMachineExtensionsClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if vmExtensionName == "" { - return nil, errors.New("parameter vmExtensionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmExtensionName}", url.PathEscape(vmExtensionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, extensionParameters) -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_virtualmachineimages_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_virtualmachineimages_client.go deleted file mode 100644 index 1a6000e7..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_virtualmachineimages_client.go +++ /dev/null @@ -1,376 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strconv" - "strings" -) - -// VirtualMachineImagesClient contains the methods for the VirtualMachineImages group. -// Don't use this type directly, use NewVirtualMachineImagesClient() instead. -type VirtualMachineImagesClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewVirtualMachineImagesClient creates a new instance of VirtualMachineImagesClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewVirtualMachineImagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachineImagesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &VirtualMachineImagesClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// Get - Gets a virtual machine image. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// location - The name of a supported Azure region. -// publisherName - A valid image publisher. -// offer - A valid image publisher offer. -// skus - A valid image SKU. -// version - A valid image SKU version. -// options - VirtualMachineImagesClientGetOptions contains the optional parameters for the VirtualMachineImagesClient.Get -// method. -func (client *VirtualMachineImagesClient) Get(ctx context.Context, location string, publisherName string, offer string, skus string, version string, options *VirtualMachineImagesClientGetOptions) (VirtualMachineImagesClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, location, publisherName, offer, skus, version, options) - if err != nil { - return VirtualMachineImagesClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualMachineImagesClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualMachineImagesClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *VirtualMachineImagesClient) getCreateRequest(ctx context.Context, location string, publisherName string, offer string, skus string, version string, options *VirtualMachineImagesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions/{version}" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if publisherName == "" { - return nil, errors.New("parameter publisherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) - if offer == "" { - return nil, errors.New("parameter offer cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{offer}", url.PathEscape(offer)) - if skus == "" { - return nil, errors.New("parameter skus cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{skus}", url.PathEscape(skus)) - if version == "" { - return nil, errors.New("parameter version cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{version}", url.PathEscape(version)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *VirtualMachineImagesClient) getHandleResponse(resp *http.Response) (VirtualMachineImagesClientGetResponse, error) { - result := VirtualMachineImagesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineImage); err != nil { - return VirtualMachineImagesClientGetResponse{}, err - } - return result, nil -} - -// List - Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// location - The name of a supported Azure region. -// publisherName - A valid image publisher. -// offer - A valid image publisher offer. -// skus - A valid image SKU. -// options - VirtualMachineImagesClientListOptions contains the optional parameters for the VirtualMachineImagesClient.List -// method. -func (client *VirtualMachineImagesClient) List(ctx context.Context, location string, publisherName string, offer string, skus string, options *VirtualMachineImagesClientListOptions) (VirtualMachineImagesClientListResponse, error) { - req, err := client.listCreateRequest(ctx, location, publisherName, offer, skus, options) - if err != nil { - return VirtualMachineImagesClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualMachineImagesClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualMachineImagesClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) -} - -// listCreateRequest creates the List request. -func (client *VirtualMachineImagesClient) listCreateRequest(ctx context.Context, location string, publisherName string, offer string, skus string, options *VirtualMachineImagesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if publisherName == "" { - return nil, errors.New("parameter publisherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) - if offer == "" { - return nil, errors.New("parameter offer cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{offer}", url.PathEscape(offer)) - if skus == "" { - return nil, errors.New("parameter skus cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{skus}", url.PathEscape(skus)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - if options != nil && options.Top != nil { - reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) - } - if options != nil && options.Orderby != nil { - reqQP.Set("$orderby", *options.Orderby) - } - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *VirtualMachineImagesClient) listHandleResponse(resp *http.Response) (VirtualMachineImagesClientListResponse, error) { - result := VirtualMachineImagesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineImageResourceArray); err != nil { - return VirtualMachineImagesClientListResponse{}, err - } - return result, nil -} - -// ListOffers - Gets a list of virtual machine image offers for the specified location and publisher. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// location - The name of a supported Azure region. -// publisherName - A valid image publisher. -// options - VirtualMachineImagesClientListOffersOptions contains the optional parameters for the VirtualMachineImagesClient.ListOffers -// method. -func (client *VirtualMachineImagesClient) ListOffers(ctx context.Context, location string, publisherName string, options *VirtualMachineImagesClientListOffersOptions) (VirtualMachineImagesClientListOffersResponse, error) { - req, err := client.listOffersCreateRequest(ctx, location, publisherName, options) - if err != nil { - return VirtualMachineImagesClientListOffersResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualMachineImagesClientListOffersResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualMachineImagesClientListOffersResponse{}, runtime.NewResponseError(resp) - } - return client.listOffersHandleResponse(resp) -} - -// listOffersCreateRequest creates the ListOffers request. -func (client *VirtualMachineImagesClient) listOffersCreateRequest(ctx context.Context, location string, publisherName string, options *VirtualMachineImagesClientListOffersOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if publisherName == "" { - return nil, errors.New("parameter publisherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listOffersHandleResponse handles the ListOffers response. -func (client *VirtualMachineImagesClient) listOffersHandleResponse(resp *http.Response) (VirtualMachineImagesClientListOffersResponse, error) { - result := VirtualMachineImagesClientListOffersResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineImageResourceArray); err != nil { - return VirtualMachineImagesClientListOffersResponse{}, err - } - return result, nil -} - -// ListPublishers - Gets a list of virtual machine image publishers for the specified Azure location. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// location - The name of a supported Azure region. -// options - VirtualMachineImagesClientListPublishersOptions contains the optional parameters for the VirtualMachineImagesClient.ListPublishers -// method. -func (client *VirtualMachineImagesClient) ListPublishers(ctx context.Context, location string, options *VirtualMachineImagesClientListPublishersOptions) (VirtualMachineImagesClientListPublishersResponse, error) { - req, err := client.listPublishersCreateRequest(ctx, location, options) - if err != nil { - return VirtualMachineImagesClientListPublishersResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualMachineImagesClientListPublishersResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualMachineImagesClientListPublishersResponse{}, runtime.NewResponseError(resp) - } - return client.listPublishersHandleResponse(resp) -} - -// listPublishersCreateRequest creates the ListPublishers request. -func (client *VirtualMachineImagesClient) listPublishersCreateRequest(ctx context.Context, location string, options *VirtualMachineImagesClientListPublishersOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listPublishersHandleResponse handles the ListPublishers response. -func (client *VirtualMachineImagesClient) listPublishersHandleResponse(resp *http.Response) (VirtualMachineImagesClientListPublishersResponse, error) { - result := VirtualMachineImagesClientListPublishersResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineImageResourceArray); err != nil { - return VirtualMachineImagesClientListPublishersResponse{}, err - } - return result, nil -} - -// ListSKUs - Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// location - The name of a supported Azure region. -// publisherName - A valid image publisher. -// offer - A valid image publisher offer. -// options - VirtualMachineImagesClientListSKUsOptions contains the optional parameters for the VirtualMachineImagesClient.ListSKUs -// method. -func (client *VirtualMachineImagesClient) ListSKUs(ctx context.Context, location string, publisherName string, offer string, options *VirtualMachineImagesClientListSKUsOptions) (VirtualMachineImagesClientListSKUsResponse, error) { - req, err := client.listSKUsCreateRequest(ctx, location, publisherName, offer, options) - if err != nil { - return VirtualMachineImagesClientListSKUsResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualMachineImagesClientListSKUsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualMachineImagesClientListSKUsResponse{}, runtime.NewResponseError(resp) - } - return client.listSKUsHandleResponse(resp) -} - -// listSKUsCreateRequest creates the ListSKUs request. -func (client *VirtualMachineImagesClient) listSKUsCreateRequest(ctx context.Context, location string, publisherName string, offer string, options *VirtualMachineImagesClientListSKUsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if publisherName == "" { - return nil, errors.New("parameter publisherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) - if offer == "" { - return nil, errors.New("parameter offer cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{offer}", url.PathEscape(offer)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listSKUsHandleResponse handles the ListSKUs response. -func (client *VirtualMachineImagesClient) listSKUsHandleResponse(resp *http.Response) (VirtualMachineImagesClientListSKUsResponse, error) { - result := VirtualMachineImagesClientListSKUsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineImageResourceArray); err != nil { - return VirtualMachineImagesClientListSKUsResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_virtualmachineimagesedgezone_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_virtualmachineimagesedgezone_client.go deleted file mode 100644 index 303bb09e..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_virtualmachineimagesedgezone_client.go +++ /dev/null @@ -1,401 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strconv" - "strings" -) - -// VirtualMachineImagesEdgeZoneClient contains the methods for the VirtualMachineImagesEdgeZone group. -// Don't use this type directly, use NewVirtualMachineImagesEdgeZoneClient() instead. -type VirtualMachineImagesEdgeZoneClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewVirtualMachineImagesEdgeZoneClient creates a new instance of VirtualMachineImagesEdgeZoneClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewVirtualMachineImagesEdgeZoneClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachineImagesEdgeZoneClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &VirtualMachineImagesEdgeZoneClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// Get - Gets a virtual machine image in an edge zone. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// location - The name of a supported Azure region. -// edgeZone - The name of the edge zone. -// publisherName - A valid image publisher. -// offer - A valid image publisher offer. -// skus - A valid image SKU. -// version - A valid image SKU version. -// options - VirtualMachineImagesEdgeZoneClientGetOptions contains the optional parameters for the VirtualMachineImagesEdgeZoneClient.Get -// method. -func (client *VirtualMachineImagesEdgeZoneClient) Get(ctx context.Context, location string, edgeZone string, publisherName string, offer string, skus string, version string, options *VirtualMachineImagesEdgeZoneClientGetOptions) (VirtualMachineImagesEdgeZoneClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, location, edgeZone, publisherName, offer, skus, version, options) - if err != nil { - return VirtualMachineImagesEdgeZoneClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualMachineImagesEdgeZoneClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualMachineImagesEdgeZoneClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *VirtualMachineImagesEdgeZoneClient) getCreateRequest(ctx context.Context, location string, edgeZone string, publisherName string, offer string, skus string, version string, options *VirtualMachineImagesEdgeZoneClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions/{version}" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if edgeZone == "" { - return nil, errors.New("parameter edgeZone cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{edgeZone}", url.PathEscape(edgeZone)) - if publisherName == "" { - return nil, errors.New("parameter publisherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) - if offer == "" { - return nil, errors.New("parameter offer cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{offer}", url.PathEscape(offer)) - if skus == "" { - return nil, errors.New("parameter skus cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{skus}", url.PathEscape(skus)) - if version == "" { - return nil, errors.New("parameter version cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{version}", url.PathEscape(version)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *VirtualMachineImagesEdgeZoneClient) getHandleResponse(resp *http.Response) (VirtualMachineImagesEdgeZoneClientGetResponse, error) { - result := VirtualMachineImagesEdgeZoneClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineImage); err != nil { - return VirtualMachineImagesEdgeZoneClientGetResponse{}, err - } - return result, nil -} - -// List - Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// location - The name of a supported Azure region. -// edgeZone - The name of the edge zone. -// publisherName - A valid image publisher. -// offer - A valid image publisher offer. -// skus - A valid image SKU. -// options - VirtualMachineImagesEdgeZoneClientListOptions contains the optional parameters for the VirtualMachineImagesEdgeZoneClient.List -// method. -func (client *VirtualMachineImagesEdgeZoneClient) List(ctx context.Context, location string, edgeZone string, publisherName string, offer string, skus string, options *VirtualMachineImagesEdgeZoneClientListOptions) (VirtualMachineImagesEdgeZoneClientListResponse, error) { - req, err := client.listCreateRequest(ctx, location, edgeZone, publisherName, offer, skus, options) - if err != nil { - return VirtualMachineImagesEdgeZoneClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualMachineImagesEdgeZoneClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualMachineImagesEdgeZoneClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) -} - -// listCreateRequest creates the List request. -func (client *VirtualMachineImagesEdgeZoneClient) listCreateRequest(ctx context.Context, location string, edgeZone string, publisherName string, offer string, skus string, options *VirtualMachineImagesEdgeZoneClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if edgeZone == "" { - return nil, errors.New("parameter edgeZone cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{edgeZone}", url.PathEscape(edgeZone)) - if publisherName == "" { - return nil, errors.New("parameter publisherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) - if offer == "" { - return nil, errors.New("parameter offer cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{offer}", url.PathEscape(offer)) - if skus == "" { - return nil, errors.New("parameter skus cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{skus}", url.PathEscape(skus)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - if options != nil && options.Top != nil { - reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) - } - if options != nil && options.Orderby != nil { - reqQP.Set("$orderby", *options.Orderby) - } - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *VirtualMachineImagesEdgeZoneClient) listHandleResponse(resp *http.Response) (VirtualMachineImagesEdgeZoneClientListResponse, error) { - result := VirtualMachineImagesEdgeZoneClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineImageResourceArray); err != nil { - return VirtualMachineImagesEdgeZoneClientListResponse{}, err - } - return result, nil -} - -// ListOffers - Gets a list of virtual machine image offers for the specified location, edge zone and publisher. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// location - The name of a supported Azure region. -// edgeZone - The name of the edge zone. -// publisherName - A valid image publisher. -// options - VirtualMachineImagesEdgeZoneClientListOffersOptions contains the optional parameters for the VirtualMachineImagesEdgeZoneClient.ListOffers -// method. -func (client *VirtualMachineImagesEdgeZoneClient) ListOffers(ctx context.Context, location string, edgeZone string, publisherName string, options *VirtualMachineImagesEdgeZoneClientListOffersOptions) (VirtualMachineImagesEdgeZoneClientListOffersResponse, error) { - req, err := client.listOffersCreateRequest(ctx, location, edgeZone, publisherName, options) - if err != nil { - return VirtualMachineImagesEdgeZoneClientListOffersResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualMachineImagesEdgeZoneClientListOffersResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualMachineImagesEdgeZoneClientListOffersResponse{}, runtime.NewResponseError(resp) - } - return client.listOffersHandleResponse(resp) -} - -// listOffersCreateRequest creates the ListOffers request. -func (client *VirtualMachineImagesEdgeZoneClient) listOffersCreateRequest(ctx context.Context, location string, edgeZone string, publisherName string, options *VirtualMachineImagesEdgeZoneClientListOffersOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/publishers/{publisherName}/artifacttypes/vmimage/offers" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if edgeZone == "" { - return nil, errors.New("parameter edgeZone cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{edgeZone}", url.PathEscape(edgeZone)) - if publisherName == "" { - return nil, errors.New("parameter publisherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listOffersHandleResponse handles the ListOffers response. -func (client *VirtualMachineImagesEdgeZoneClient) listOffersHandleResponse(resp *http.Response) (VirtualMachineImagesEdgeZoneClientListOffersResponse, error) { - result := VirtualMachineImagesEdgeZoneClientListOffersResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineImageResourceArray); err != nil { - return VirtualMachineImagesEdgeZoneClientListOffersResponse{}, err - } - return result, nil -} - -// ListPublishers - Gets a list of virtual machine image publishers for the specified Azure location and edge zone. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// location - The name of a supported Azure region. -// edgeZone - The name of the edge zone. -// options - VirtualMachineImagesEdgeZoneClientListPublishersOptions contains the optional parameters for the VirtualMachineImagesEdgeZoneClient.ListPublishers -// method. -func (client *VirtualMachineImagesEdgeZoneClient) ListPublishers(ctx context.Context, location string, edgeZone string, options *VirtualMachineImagesEdgeZoneClientListPublishersOptions) (VirtualMachineImagesEdgeZoneClientListPublishersResponse, error) { - req, err := client.listPublishersCreateRequest(ctx, location, edgeZone, options) - if err != nil { - return VirtualMachineImagesEdgeZoneClientListPublishersResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualMachineImagesEdgeZoneClientListPublishersResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualMachineImagesEdgeZoneClientListPublishersResponse{}, runtime.NewResponseError(resp) - } - return client.listPublishersHandleResponse(resp) -} - -// listPublishersCreateRequest creates the ListPublishers request. -func (client *VirtualMachineImagesEdgeZoneClient) listPublishersCreateRequest(ctx context.Context, location string, edgeZone string, options *VirtualMachineImagesEdgeZoneClientListPublishersOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/publishers" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if edgeZone == "" { - return nil, errors.New("parameter edgeZone cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{edgeZone}", url.PathEscape(edgeZone)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listPublishersHandleResponse handles the ListPublishers response. -func (client *VirtualMachineImagesEdgeZoneClient) listPublishersHandleResponse(resp *http.Response) (VirtualMachineImagesEdgeZoneClientListPublishersResponse, error) { - result := VirtualMachineImagesEdgeZoneClientListPublishersResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineImageResourceArray); err != nil { - return VirtualMachineImagesEdgeZoneClientListPublishersResponse{}, err - } - return result, nil -} - -// ListSKUs - Gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// location - The name of a supported Azure region. -// edgeZone - The name of the edge zone. -// publisherName - A valid image publisher. -// offer - A valid image publisher offer. -// options - VirtualMachineImagesEdgeZoneClientListSKUsOptions contains the optional parameters for the VirtualMachineImagesEdgeZoneClient.ListSKUs -// method. -func (client *VirtualMachineImagesEdgeZoneClient) ListSKUs(ctx context.Context, location string, edgeZone string, publisherName string, offer string, options *VirtualMachineImagesEdgeZoneClientListSKUsOptions) (VirtualMachineImagesEdgeZoneClientListSKUsResponse, error) { - req, err := client.listSKUsCreateRequest(ctx, location, edgeZone, publisherName, offer, options) - if err != nil { - return VirtualMachineImagesEdgeZoneClientListSKUsResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualMachineImagesEdgeZoneClientListSKUsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualMachineImagesEdgeZoneClientListSKUsResponse{}, runtime.NewResponseError(resp) - } - return client.listSKUsHandleResponse(resp) -} - -// listSKUsCreateRequest creates the ListSKUs request. -func (client *VirtualMachineImagesEdgeZoneClient) listSKUsCreateRequest(ctx context.Context, location string, edgeZone string, publisherName string, offer string, options *VirtualMachineImagesEdgeZoneClientListSKUsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if edgeZone == "" { - return nil, errors.New("parameter edgeZone cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{edgeZone}", url.PathEscape(edgeZone)) - if publisherName == "" { - return nil, errors.New("parameter publisherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) - if offer == "" { - return nil, errors.New("parameter offer cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{offer}", url.PathEscape(offer)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listSKUsHandleResponse handles the ListSKUs response. -func (client *VirtualMachineImagesEdgeZoneClient) listSKUsHandleResponse(resp *http.Response) (VirtualMachineImagesEdgeZoneClientListSKUsResponse, error) { - result := VirtualMachineImagesEdgeZoneClientListSKUsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineImageResourceArray); err != nil { - return VirtualMachineImagesEdgeZoneClientListSKUsResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_virtualmachineruncommands_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_virtualmachineruncommands_client.go deleted file mode 100644 index eb3408ad..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_virtualmachineruncommands_client.go +++ /dev/null @@ -1,522 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// VirtualMachineRunCommandsClient contains the methods for the VirtualMachineRunCommands group. -// Don't use this type directly, use NewVirtualMachineRunCommandsClient() instead. -type VirtualMachineRunCommandsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewVirtualMachineRunCommandsClient creates a new instance of VirtualMachineRunCommandsClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewVirtualMachineRunCommandsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachineRunCommandsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &VirtualMachineRunCommandsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - The operation to create or update the run command. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmName - The name of the virtual machine where the run command should be created or updated. -// runCommandName - The name of the virtual machine run command. -// runCommand - Parameters supplied to the Create Virtual Machine RunCommand operation. -// options - VirtualMachineRunCommandsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineRunCommandsClient.BeginCreateOrUpdate -// method. -func (client *VirtualMachineRunCommandsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, vmName string, runCommandName string, runCommand VirtualMachineRunCommand, options *VirtualMachineRunCommandsClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualMachineRunCommandsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, vmName, runCommandName, runCommand, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[VirtualMachineRunCommandsClientCreateOrUpdateResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[VirtualMachineRunCommandsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - The operation to create or update the run command. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *VirtualMachineRunCommandsClient) createOrUpdate(ctx context.Context, resourceGroupName string, vmName string, runCommandName string, runCommand VirtualMachineRunCommand, options *VirtualMachineRunCommandsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, vmName, runCommandName, runCommand, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *VirtualMachineRunCommandsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, vmName string, runCommandName string, runCommand VirtualMachineRunCommand, options *VirtualMachineRunCommandsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if runCommandName == "" { - return nil, errors.New("parameter runCommandName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{runCommandName}", url.PathEscape(runCommandName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json, text/json"} - return req, runtime.MarshalAsJSON(req, runCommand) -} - -// BeginDelete - The operation to delete the run command. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmName - The name of the virtual machine where the run command should be deleted. -// runCommandName - The name of the virtual machine run command. -// options - VirtualMachineRunCommandsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineRunCommandsClient.BeginDelete -// method. -func (client *VirtualMachineRunCommandsClient) BeginDelete(ctx context.Context, resourceGroupName string, vmName string, runCommandName string, options *VirtualMachineRunCommandsClientBeginDeleteOptions) (*runtime.Poller[VirtualMachineRunCommandsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, vmName, runCommandName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[VirtualMachineRunCommandsClientDeleteResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[VirtualMachineRunCommandsClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - The operation to delete the run command. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *VirtualMachineRunCommandsClient) deleteOperation(ctx context.Context, resourceGroupName string, vmName string, runCommandName string, options *VirtualMachineRunCommandsClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, vmName, runCommandName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *VirtualMachineRunCommandsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, vmName string, runCommandName string, options *VirtualMachineRunCommandsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if runCommandName == "" { - return nil, errors.New("parameter runCommandName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{runCommandName}", url.PathEscape(runCommandName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json, text/json"} - return req, nil -} - -// Get - Gets specific run command for a subscription in a location. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// location - The location upon which run commands is queried. -// commandID - The command id. -// options - VirtualMachineRunCommandsClientGetOptions contains the optional parameters for the VirtualMachineRunCommandsClient.Get -// method. -func (client *VirtualMachineRunCommandsClient) Get(ctx context.Context, location string, commandID string, options *VirtualMachineRunCommandsClientGetOptions) (VirtualMachineRunCommandsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, location, commandID, options) - if err != nil { - return VirtualMachineRunCommandsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualMachineRunCommandsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualMachineRunCommandsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *VirtualMachineRunCommandsClient) getCreateRequest(ctx context.Context, location string, commandID string, options *VirtualMachineRunCommandsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/runCommands/{commandId}" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if commandID == "" { - return nil, errors.New("parameter commandID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{commandId}", url.PathEscape(commandID)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json, text/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *VirtualMachineRunCommandsClient) getHandleResponse(resp *http.Response) (VirtualMachineRunCommandsClientGetResponse, error) { - result := VirtualMachineRunCommandsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RunCommandDocument); err != nil { - return VirtualMachineRunCommandsClientGetResponse{}, err - } - return result, nil -} - -// GetByVirtualMachine - The operation to get the run command. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmName - The name of the virtual machine containing the run command. -// runCommandName - The name of the virtual machine run command. -// options - VirtualMachineRunCommandsClientGetByVirtualMachineOptions contains the optional parameters for the VirtualMachineRunCommandsClient.GetByVirtualMachine -// method. -func (client *VirtualMachineRunCommandsClient) GetByVirtualMachine(ctx context.Context, resourceGroupName string, vmName string, runCommandName string, options *VirtualMachineRunCommandsClientGetByVirtualMachineOptions) (VirtualMachineRunCommandsClientGetByVirtualMachineResponse, error) { - req, err := client.getByVirtualMachineCreateRequest(ctx, resourceGroupName, vmName, runCommandName, options) - if err != nil { - return VirtualMachineRunCommandsClientGetByVirtualMachineResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualMachineRunCommandsClientGetByVirtualMachineResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualMachineRunCommandsClientGetByVirtualMachineResponse{}, runtime.NewResponseError(resp) - } - return client.getByVirtualMachineHandleResponse(resp) -} - -// getByVirtualMachineCreateRequest creates the GetByVirtualMachine request. -func (client *VirtualMachineRunCommandsClient) getByVirtualMachineCreateRequest(ctx context.Context, resourceGroupName string, vmName string, runCommandName string, options *VirtualMachineRunCommandsClientGetByVirtualMachineOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if runCommandName == "" { - return nil, errors.New("parameter runCommandName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{runCommandName}", url.PathEscape(runCommandName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json, text/json"} - return req, nil -} - -// getByVirtualMachineHandleResponse handles the GetByVirtualMachine response. -func (client *VirtualMachineRunCommandsClient) getByVirtualMachineHandleResponse(resp *http.Response) (VirtualMachineRunCommandsClientGetByVirtualMachineResponse, error) { - result := VirtualMachineRunCommandsClientGetByVirtualMachineResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineRunCommand); err != nil { - return VirtualMachineRunCommandsClientGetByVirtualMachineResponse{}, err - } - return result, nil -} - -// NewListPager - Lists all available run commands for a subscription in a location. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// location - The location upon which run commands is queried. -// options - VirtualMachineRunCommandsClientListOptions contains the optional parameters for the VirtualMachineRunCommandsClient.List -// method. -func (client *VirtualMachineRunCommandsClient) NewListPager(location string, options *VirtualMachineRunCommandsClientListOptions) *runtime.Pager[VirtualMachineRunCommandsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualMachineRunCommandsClientListResponse]{ - More: func(page VirtualMachineRunCommandsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VirtualMachineRunCommandsClientListResponse) (VirtualMachineRunCommandsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, location, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return VirtualMachineRunCommandsClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualMachineRunCommandsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualMachineRunCommandsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *VirtualMachineRunCommandsClient) listCreateRequest(ctx context.Context, location string, options *VirtualMachineRunCommandsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/runCommands" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json, text/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *VirtualMachineRunCommandsClient) listHandleResponse(resp *http.Response) (VirtualMachineRunCommandsClientListResponse, error) { - result := VirtualMachineRunCommandsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RunCommandListResult); err != nil { - return VirtualMachineRunCommandsClientListResponse{}, err - } - return result, nil -} - -// NewListByVirtualMachinePager - The operation to get all run commands of a Virtual Machine. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmName - The name of the virtual machine containing the run command. -// options - VirtualMachineRunCommandsClientListByVirtualMachineOptions contains the optional parameters for the VirtualMachineRunCommandsClient.ListByVirtualMachine -// method. -func (client *VirtualMachineRunCommandsClient) NewListByVirtualMachinePager(resourceGroupName string, vmName string, options *VirtualMachineRunCommandsClientListByVirtualMachineOptions) *runtime.Pager[VirtualMachineRunCommandsClientListByVirtualMachineResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualMachineRunCommandsClientListByVirtualMachineResponse]{ - More: func(page VirtualMachineRunCommandsClientListByVirtualMachineResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VirtualMachineRunCommandsClientListByVirtualMachineResponse) (VirtualMachineRunCommandsClientListByVirtualMachineResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByVirtualMachineCreateRequest(ctx, resourceGroupName, vmName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return VirtualMachineRunCommandsClientListByVirtualMachineResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualMachineRunCommandsClientListByVirtualMachineResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualMachineRunCommandsClientListByVirtualMachineResponse{}, runtime.NewResponseError(resp) - } - return client.listByVirtualMachineHandleResponse(resp) - }, - }) -} - -// listByVirtualMachineCreateRequest creates the ListByVirtualMachine request. -func (client *VirtualMachineRunCommandsClient) listByVirtualMachineCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachineRunCommandsClientListByVirtualMachineOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json, text/json"} - return req, nil -} - -// listByVirtualMachineHandleResponse handles the ListByVirtualMachine response. -func (client *VirtualMachineRunCommandsClient) listByVirtualMachineHandleResponse(resp *http.Response) (VirtualMachineRunCommandsClientListByVirtualMachineResponse, error) { - result := VirtualMachineRunCommandsClientListByVirtualMachineResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineRunCommandsListResult); err != nil { - return VirtualMachineRunCommandsClientListByVirtualMachineResponse{}, err - } - return result, nil -} - -// BeginUpdate - The operation to update the run command. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmName - The name of the virtual machine where the run command should be updated. -// runCommandName - The name of the virtual machine run command. -// runCommand - Parameters supplied to the Update Virtual Machine RunCommand operation. -// options - VirtualMachineRunCommandsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineRunCommandsClient.BeginUpdate -// method. -func (client *VirtualMachineRunCommandsClient) BeginUpdate(ctx context.Context, resourceGroupName string, vmName string, runCommandName string, runCommand VirtualMachineRunCommandUpdate, options *VirtualMachineRunCommandsClientBeginUpdateOptions) (*runtime.Poller[VirtualMachineRunCommandsClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, vmName, runCommandName, runCommand, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[VirtualMachineRunCommandsClientUpdateResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[VirtualMachineRunCommandsClientUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// Update - The operation to update the run command. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *VirtualMachineRunCommandsClient) update(ctx context.Context, resourceGroupName string, vmName string, runCommandName string, runCommand VirtualMachineRunCommandUpdate, options *VirtualMachineRunCommandsClientBeginUpdateOptions) (*http.Response, error) { - req, err := client.updateCreateRequest(ctx, resourceGroupName, vmName, runCommandName, runCommand, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// updateCreateRequest creates the Update request. -func (client *VirtualMachineRunCommandsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, vmName string, runCommandName string, runCommand VirtualMachineRunCommandUpdate, options *VirtualMachineRunCommandsClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if runCommandName == "" { - return nil, errors.New("parameter runCommandName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{runCommandName}", url.PathEscape(runCommandName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json, text/json"} - return req, runtime.MarshalAsJSON(req, runCommand) -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_virtualmachines_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_virtualmachines_client.go deleted file mode 100644 index 504deb60..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_virtualmachines_client.go +++ /dev/null @@ -1,1639 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strconv" - "strings" -) - -// VirtualMachinesClient contains the methods for the VirtualMachines group. -// Don't use this type directly, use NewVirtualMachinesClient() instead. -type VirtualMachinesClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewVirtualMachinesClient creates a new instance of VirtualMachinesClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewVirtualMachinesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachinesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &VirtualMachinesClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginAssessPatches - Assess patches on the VM. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmName - The name of the virtual machine. -// options - VirtualMachinesClientBeginAssessPatchesOptions contains the optional parameters for the VirtualMachinesClient.BeginAssessPatches -// method. -func (client *VirtualMachinesClient) BeginAssessPatches(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginAssessPatchesOptions) (*runtime.Poller[VirtualMachinesClientAssessPatchesResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.assessPatches(ctx, resourceGroupName, vmName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VirtualMachinesClientAssessPatchesResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[VirtualMachinesClientAssessPatchesResponse](options.ResumeToken, client.pl, nil) - } -} - -// AssessPatches - Assess patches on the VM. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *VirtualMachinesClient) assessPatches(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginAssessPatchesOptions) (*http.Response, error) { - req, err := client.assessPatchesCreateRequest(ctx, resourceGroupName, vmName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// assessPatchesCreateRequest creates the AssessPatches request. -func (client *VirtualMachinesClient) assessPatchesCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginAssessPatchesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/assessPatches" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginCapture - Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create -// similar VMs. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmName - The name of the virtual machine. -// parameters - Parameters supplied to the Capture Virtual Machine operation. -// options - VirtualMachinesClientBeginCaptureOptions contains the optional parameters for the VirtualMachinesClient.BeginCapture -// method. -func (client *VirtualMachinesClient) BeginCapture(ctx context.Context, resourceGroupName string, vmName string, parameters VirtualMachineCaptureParameters, options *VirtualMachinesClientBeginCaptureOptions) (*runtime.Poller[VirtualMachinesClientCaptureResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.capture(ctx, resourceGroupName, vmName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VirtualMachinesClientCaptureResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[VirtualMachinesClientCaptureResponse](options.ResumeToken, client.pl, nil) - } -} - -// Capture - Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar -// VMs. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *VirtualMachinesClient) capture(ctx context.Context, resourceGroupName string, vmName string, parameters VirtualMachineCaptureParameters, options *VirtualMachinesClientBeginCaptureOptions) (*http.Response, error) { - req, err := client.captureCreateRequest(ctx, resourceGroupName, vmName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// captureCreateRequest creates the Capture request. -func (client *VirtualMachinesClient) captureCreateRequest(ctx context.Context, resourceGroupName string, vmName string, parameters VirtualMachineCaptureParameters, options *VirtualMachinesClientBeginCaptureOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/capture" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginConvertToManagedDisks - Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated -// before invoking this operation. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmName - The name of the virtual machine. -// options - VirtualMachinesClientBeginConvertToManagedDisksOptions contains the optional parameters for the VirtualMachinesClient.BeginConvertToManagedDisks -// method. -func (client *VirtualMachinesClient) BeginConvertToManagedDisks(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginConvertToManagedDisksOptions) (*runtime.Poller[VirtualMachinesClientConvertToManagedDisksResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.convertToManagedDisks(ctx, resourceGroupName, vmName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[VirtualMachinesClientConvertToManagedDisksResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[VirtualMachinesClientConvertToManagedDisksResponse](options.ResumeToken, client.pl, nil) - } -} - -// ConvertToManagedDisks - Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated -// before invoking this operation. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *VirtualMachinesClient) convertToManagedDisks(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginConvertToManagedDisksOptions) (*http.Response, error) { - req, err := client.convertToManagedDisksCreateRequest(ctx, resourceGroupName, vmName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// convertToManagedDisksCreateRequest creates the ConvertToManagedDisks request. -func (client *VirtualMachinesClient) convertToManagedDisksCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginConvertToManagedDisksOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/convertToManagedDisks" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginCreateOrUpdate - The operation to create or update a virtual machine. Please note some properties can be set only -// during virtual machine creation. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmName - The name of the virtual machine. -// parameters - Parameters supplied to the Create Virtual Machine operation. -// options - VirtualMachinesClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachinesClient.BeginCreateOrUpdate -// method. -func (client *VirtualMachinesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, vmName string, parameters VirtualMachine, options *VirtualMachinesClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualMachinesClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, vmName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[VirtualMachinesClientCreateOrUpdateResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[VirtualMachinesClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - The operation to create or update a virtual machine. Please note some properties can be set only during -// virtual machine creation. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *VirtualMachinesClient) createOrUpdate(ctx context.Context, resourceGroupName string, vmName string, parameters VirtualMachine, options *VirtualMachinesClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, vmName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *VirtualMachinesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, vmName string, parameters VirtualMachine, options *VirtualMachinesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginDeallocate - Shuts down the virtual machine and releases the compute resources. You are not billed for the compute -// resources that this virtual machine uses. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmName - The name of the virtual machine. -// options - VirtualMachinesClientBeginDeallocateOptions contains the optional parameters for the VirtualMachinesClient.BeginDeallocate -// method. -func (client *VirtualMachinesClient) BeginDeallocate(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginDeallocateOptions) (*runtime.Poller[VirtualMachinesClientDeallocateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deallocate(ctx, resourceGroupName, vmName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[VirtualMachinesClientDeallocateResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[VirtualMachinesClientDeallocateResponse](options.ResumeToken, client.pl, nil) - } -} - -// Deallocate - Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources -// that this virtual machine uses. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *VirtualMachinesClient) deallocate(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginDeallocateOptions) (*http.Response, error) { - req, err := client.deallocateCreateRequest(ctx, resourceGroupName, vmName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deallocateCreateRequest creates the Deallocate request. -func (client *VirtualMachinesClient) deallocateCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginDeallocateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/deallocate" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Hibernate != nil { - reqQP.Set("hibernate", strconv.FormatBool(*options.Hibernate)) - } - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginDelete - The operation to delete a virtual machine. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmName - The name of the virtual machine. -// options - VirtualMachinesClientBeginDeleteOptions contains the optional parameters for the VirtualMachinesClient.BeginDelete -// method. -func (client *VirtualMachinesClient) BeginDelete(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginDeleteOptions) (*runtime.Poller[VirtualMachinesClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, vmName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[VirtualMachinesClientDeleteResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[VirtualMachinesClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - The operation to delete a virtual machine. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *VirtualMachinesClient) deleteOperation(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, vmName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *VirtualMachinesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.ForceDeletion != nil { - reqQP.Set("forceDeletion", strconv.FormatBool(*options.ForceDeletion)) - } - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Generalize - Sets the OS state of the virtual machine to generalized. It is recommended to sysprep the virtual machine -// before performing this operation. For Windows, please refer to Create a managed image of a -// generalized VM in Azure [https://docs.microsoft.com/azure/virtual-machines/windows/capture-image-resource]. For Linux, -// please refer to How to create an image of a virtual machine or VHD -// [https://docs.microsoft.com/azure/virtual-machines/linux/capture-image]. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmName - The name of the virtual machine. -// options - VirtualMachinesClientGeneralizeOptions contains the optional parameters for the VirtualMachinesClient.Generalize -// method. -func (client *VirtualMachinesClient) Generalize(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientGeneralizeOptions) (VirtualMachinesClientGeneralizeResponse, error) { - req, err := client.generalizeCreateRequest(ctx, resourceGroupName, vmName, options) - if err != nil { - return VirtualMachinesClientGeneralizeResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualMachinesClientGeneralizeResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualMachinesClientGeneralizeResponse{}, runtime.NewResponseError(resp) - } - return VirtualMachinesClientGeneralizeResponse{}, nil -} - -// generalizeCreateRequest creates the Generalize request. -func (client *VirtualMachinesClient) generalizeCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientGeneralizeOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/generalize" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Retrieves information about the model view or the instance view of a virtual machine. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmName - The name of the virtual machine. -// options - VirtualMachinesClientGetOptions contains the optional parameters for the VirtualMachinesClient.Get method. -func (client *VirtualMachinesClient) Get(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientGetOptions) (VirtualMachinesClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, vmName, options) - if err != nil { - return VirtualMachinesClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualMachinesClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualMachinesClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *VirtualMachinesClient) getCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", string(*options.Expand)) - } - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *VirtualMachinesClient) getHandleResponse(resp *http.Response) (VirtualMachinesClientGetResponse, error) { - result := VirtualMachinesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachine); err != nil { - return VirtualMachinesClientGetResponse{}, err - } - return result, nil -} - -// BeginInstallPatches - Installs patches on the VM. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmName - The name of the virtual machine. -// installPatchesInput - Input for InstallPatches as directly received by the API -// options - VirtualMachinesClientBeginInstallPatchesOptions contains the optional parameters for the VirtualMachinesClient.BeginInstallPatches -// method. -func (client *VirtualMachinesClient) BeginInstallPatches(ctx context.Context, resourceGroupName string, vmName string, installPatchesInput VirtualMachineInstallPatchesParameters, options *VirtualMachinesClientBeginInstallPatchesOptions) (*runtime.Poller[VirtualMachinesClientInstallPatchesResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.installPatches(ctx, resourceGroupName, vmName, installPatchesInput, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VirtualMachinesClientInstallPatchesResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[VirtualMachinesClientInstallPatchesResponse](options.ResumeToken, client.pl, nil) - } -} - -// InstallPatches - Installs patches on the VM. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *VirtualMachinesClient) installPatches(ctx context.Context, resourceGroupName string, vmName string, installPatchesInput VirtualMachineInstallPatchesParameters, options *VirtualMachinesClientBeginInstallPatchesOptions) (*http.Response, error) { - req, err := client.installPatchesCreateRequest(ctx, resourceGroupName, vmName, installPatchesInput, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// installPatchesCreateRequest creates the InstallPatches request. -func (client *VirtualMachinesClient) installPatchesCreateRequest(ctx context.Context, resourceGroupName string, vmName string, installPatchesInput VirtualMachineInstallPatchesParameters, options *VirtualMachinesClientBeginInstallPatchesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/installPatches" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, installPatchesInput) -} - -// InstanceView - Retrieves information about the run-time state of a virtual machine. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmName - The name of the virtual machine. -// options - VirtualMachinesClientInstanceViewOptions contains the optional parameters for the VirtualMachinesClient.InstanceView -// method. -func (client *VirtualMachinesClient) InstanceView(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientInstanceViewOptions) (VirtualMachinesClientInstanceViewResponse, error) { - req, err := client.instanceViewCreateRequest(ctx, resourceGroupName, vmName, options) - if err != nil { - return VirtualMachinesClientInstanceViewResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualMachinesClientInstanceViewResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualMachinesClientInstanceViewResponse{}, runtime.NewResponseError(resp) - } - return client.instanceViewHandleResponse(resp) -} - -// instanceViewCreateRequest creates the InstanceView request. -func (client *VirtualMachinesClient) instanceViewCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientInstanceViewOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/instanceView" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// instanceViewHandleResponse handles the InstanceView response. -func (client *VirtualMachinesClient) instanceViewHandleResponse(resp *http.Response) (VirtualMachinesClientInstanceViewResponse, error) { - result := VirtualMachinesClientInstanceViewResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineInstanceView); err != nil { - return VirtualMachinesClientInstanceViewResponse{}, err - } - return result, nil -} - -// NewListPager - Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response -// to get the next page of virtual machines. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// options - VirtualMachinesClientListOptions contains the optional parameters for the VirtualMachinesClient.List method. -func (client *VirtualMachinesClient) NewListPager(resourceGroupName string, options *VirtualMachinesClientListOptions) *runtime.Pager[VirtualMachinesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualMachinesClientListResponse]{ - More: func(page VirtualMachinesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VirtualMachinesClientListResponse) (VirtualMachinesClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return VirtualMachinesClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualMachinesClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualMachinesClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *VirtualMachinesClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *VirtualMachinesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Filter != nil { - reqQP.Set("$filter", *options.Filter) - } - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *VirtualMachinesClient) listHandleResponse(resp *http.Response) (VirtualMachinesClientListResponse, error) { - result := VirtualMachinesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineListResult); err != nil { - return VirtualMachinesClientListResponse{}, err - } - return result, nil -} - -// NewListAllPager - Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response -// to get the next page of virtual machines. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// options - VirtualMachinesClientListAllOptions contains the optional parameters for the VirtualMachinesClient.ListAll method. -func (client *VirtualMachinesClient) NewListAllPager(options *VirtualMachinesClientListAllOptions) *runtime.Pager[VirtualMachinesClientListAllResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualMachinesClientListAllResponse]{ - More: func(page VirtualMachinesClientListAllResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VirtualMachinesClientListAllResponse) (VirtualMachinesClientListAllResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listAllCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return VirtualMachinesClientListAllResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualMachinesClientListAllResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualMachinesClientListAllResponse{}, runtime.NewResponseError(resp) - } - return client.listAllHandleResponse(resp) - }, - }) -} - -// listAllCreateRequest creates the ListAll request. -func (client *VirtualMachinesClient) listAllCreateRequest(ctx context.Context, options *VirtualMachinesClientListAllOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachines" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - if options != nil && options.StatusOnly != nil { - reqQP.Set("statusOnly", *options.StatusOnly) - } - if options != nil && options.Filter != nil { - reqQP.Set("$filter", *options.Filter) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listAllHandleResponse handles the ListAll response. -func (client *VirtualMachinesClient) listAllHandleResponse(resp *http.Response) (VirtualMachinesClientListAllResponse, error) { - result := VirtualMachinesClientListAllResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineListResult); err != nil { - return VirtualMachinesClientListAllResponse{}, err - } - return result, nil -} - -// NewListAvailableSizesPager - Lists all available virtual machine sizes to which the specified virtual machine can be resized. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmName - The name of the virtual machine. -// options - VirtualMachinesClientListAvailableSizesOptions contains the optional parameters for the VirtualMachinesClient.ListAvailableSizes -// method. -func (client *VirtualMachinesClient) NewListAvailableSizesPager(resourceGroupName string, vmName string, options *VirtualMachinesClientListAvailableSizesOptions) *runtime.Pager[VirtualMachinesClientListAvailableSizesResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualMachinesClientListAvailableSizesResponse]{ - More: func(page VirtualMachinesClientListAvailableSizesResponse) bool { - return false - }, - Fetcher: func(ctx context.Context, page *VirtualMachinesClientListAvailableSizesResponse) (VirtualMachinesClientListAvailableSizesResponse, error) { - req, err := client.listAvailableSizesCreateRequest(ctx, resourceGroupName, vmName, options) - if err != nil { - return VirtualMachinesClientListAvailableSizesResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualMachinesClientListAvailableSizesResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualMachinesClientListAvailableSizesResponse{}, runtime.NewResponseError(resp) - } - return client.listAvailableSizesHandleResponse(resp) - }, - }) -} - -// listAvailableSizesCreateRequest creates the ListAvailableSizes request. -func (client *VirtualMachinesClient) listAvailableSizesCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientListAvailableSizesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/vmSizes" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listAvailableSizesHandleResponse handles the ListAvailableSizes response. -func (client *VirtualMachinesClient) listAvailableSizesHandleResponse(resp *http.Response) (VirtualMachinesClientListAvailableSizesResponse, error) { - result := VirtualMachinesClientListAvailableSizesResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineSizeListResult); err != nil { - return VirtualMachinesClientListAvailableSizesResponse{}, err - } - return result, nil -} - -// NewListByLocationPager - Gets all the virtual machines under the specified subscription for the specified location. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// location - The location for which virtual machines under the subscription are queried. -// options - VirtualMachinesClientListByLocationOptions contains the optional parameters for the VirtualMachinesClient.ListByLocation -// method. -func (client *VirtualMachinesClient) NewListByLocationPager(location string, options *VirtualMachinesClientListByLocationOptions) *runtime.Pager[VirtualMachinesClientListByLocationResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualMachinesClientListByLocationResponse]{ - More: func(page VirtualMachinesClientListByLocationResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VirtualMachinesClientListByLocationResponse) (VirtualMachinesClientListByLocationResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByLocationCreateRequest(ctx, location, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return VirtualMachinesClientListByLocationResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualMachinesClientListByLocationResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualMachinesClientListByLocationResponse{}, runtime.NewResponseError(resp) - } - return client.listByLocationHandleResponse(resp) - }, - }) -} - -// listByLocationCreateRequest creates the ListByLocation request. -func (client *VirtualMachinesClient) listByLocationCreateRequest(ctx context.Context, location string, options *VirtualMachinesClientListByLocationOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/virtualMachines" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByLocationHandleResponse handles the ListByLocation response. -func (client *VirtualMachinesClient) listByLocationHandleResponse(resp *http.Response) (VirtualMachinesClientListByLocationResponse, error) { - result := VirtualMachinesClientListByLocationResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineListResult); err != nil { - return VirtualMachinesClientListByLocationResponse{}, err - } - return result, nil -} - -// BeginPerformMaintenance - The operation to perform maintenance on a virtual machine. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmName - The name of the virtual machine. -// options - VirtualMachinesClientBeginPerformMaintenanceOptions contains the optional parameters for the VirtualMachinesClient.BeginPerformMaintenance -// method. -func (client *VirtualMachinesClient) BeginPerformMaintenance(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginPerformMaintenanceOptions) (*runtime.Poller[VirtualMachinesClientPerformMaintenanceResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.performMaintenance(ctx, resourceGroupName, vmName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[VirtualMachinesClientPerformMaintenanceResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[VirtualMachinesClientPerformMaintenanceResponse](options.ResumeToken, client.pl, nil) - } -} - -// PerformMaintenance - The operation to perform maintenance on a virtual machine. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *VirtualMachinesClient) performMaintenance(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginPerformMaintenanceOptions) (*http.Response, error) { - req, err := client.performMaintenanceCreateRequest(ctx, resourceGroupName, vmName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// performMaintenanceCreateRequest creates the PerformMaintenance request. -func (client *VirtualMachinesClient) performMaintenanceCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginPerformMaintenanceOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/performMaintenance" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginPowerOff - The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same -// provisioned resources. You are still charged for this virtual machine. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmName - The name of the virtual machine. -// options - VirtualMachinesClientBeginPowerOffOptions contains the optional parameters for the VirtualMachinesClient.BeginPowerOff -// method. -func (client *VirtualMachinesClient) BeginPowerOff(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginPowerOffOptions) (*runtime.Poller[VirtualMachinesClientPowerOffResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.powerOff(ctx, resourceGroupName, vmName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[VirtualMachinesClientPowerOffResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[VirtualMachinesClientPowerOffResponse](options.ResumeToken, client.pl, nil) - } -} - -// PowerOff - The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned -// resources. You are still charged for this virtual machine. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *VirtualMachinesClient) powerOff(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginPowerOffOptions) (*http.Response, error) { - req, err := client.powerOffCreateRequest(ctx, resourceGroupName, vmName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// powerOffCreateRequest creates the PowerOff request. -func (client *VirtualMachinesClient) powerOffCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginPowerOffOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/powerOff" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.SkipShutdown != nil { - reqQP.Set("skipShutdown", strconv.FormatBool(*options.SkipShutdown)) - } - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginReapply - The operation to reapply a virtual machine's state. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmName - The name of the virtual machine. -// options - VirtualMachinesClientBeginReapplyOptions contains the optional parameters for the VirtualMachinesClient.BeginReapply -// method. -func (client *VirtualMachinesClient) BeginReapply(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginReapplyOptions) (*runtime.Poller[VirtualMachinesClientReapplyResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.reapply(ctx, resourceGroupName, vmName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[VirtualMachinesClientReapplyResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[VirtualMachinesClientReapplyResponse](options.ResumeToken, client.pl, nil) - } -} - -// Reapply - The operation to reapply a virtual machine's state. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *VirtualMachinesClient) reapply(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginReapplyOptions) (*http.Response, error) { - req, err := client.reapplyCreateRequest(ctx, resourceGroupName, vmName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// reapplyCreateRequest creates the Reapply request. -func (client *VirtualMachinesClient) reapplyCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginReapplyOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/reapply" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginRedeploy - Shuts down the virtual machine, moves it to a new node, and powers it back on. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmName - The name of the virtual machine. -// options - VirtualMachinesClientBeginRedeployOptions contains the optional parameters for the VirtualMachinesClient.BeginRedeploy -// method. -func (client *VirtualMachinesClient) BeginRedeploy(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginRedeployOptions) (*runtime.Poller[VirtualMachinesClientRedeployResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.redeploy(ctx, resourceGroupName, vmName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[VirtualMachinesClientRedeployResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[VirtualMachinesClientRedeployResponse](options.ResumeToken, client.pl, nil) - } -} - -// Redeploy - Shuts down the virtual machine, moves it to a new node, and powers it back on. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *VirtualMachinesClient) redeploy(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginRedeployOptions) (*http.Response, error) { - req, err := client.redeployCreateRequest(ctx, resourceGroupName, vmName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// redeployCreateRequest creates the Redeploy request. -func (client *VirtualMachinesClient) redeployCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginRedeployOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/redeploy" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginReimage - Reimages the virtual machine which has an ephemeral OS disk back to its initial state. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmName - The name of the virtual machine. -// options - VirtualMachinesClientBeginReimageOptions contains the optional parameters for the VirtualMachinesClient.BeginReimage -// method. -func (client *VirtualMachinesClient) BeginReimage(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginReimageOptions) (*runtime.Poller[VirtualMachinesClientReimageResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.reimage(ctx, resourceGroupName, vmName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[VirtualMachinesClientReimageResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[VirtualMachinesClientReimageResponse](options.ResumeToken, client.pl, nil) - } -} - -// Reimage - Reimages the virtual machine which has an ephemeral OS disk back to its initial state. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *VirtualMachinesClient) reimage(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginReimageOptions) (*http.Response, error) { - req, err := client.reimageCreateRequest(ctx, resourceGroupName, vmName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// reimageCreateRequest creates the Reimage request. -func (client *VirtualMachinesClient) reimageCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginReimageOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/reimage" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.Parameters != nil { - return req, runtime.MarshalAsJSON(req, *options.Parameters) - } - return req, nil -} - -// BeginRestart - The operation to restart a virtual machine. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmName - The name of the virtual machine. -// options - VirtualMachinesClientBeginRestartOptions contains the optional parameters for the VirtualMachinesClient.BeginRestart -// method. -func (client *VirtualMachinesClient) BeginRestart(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginRestartOptions) (*runtime.Poller[VirtualMachinesClientRestartResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.restart(ctx, resourceGroupName, vmName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[VirtualMachinesClientRestartResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[VirtualMachinesClientRestartResponse](options.ResumeToken, client.pl, nil) - } -} - -// Restart - The operation to restart a virtual machine. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *VirtualMachinesClient) restart(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginRestartOptions) (*http.Response, error) { - req, err := client.restartCreateRequest(ctx, resourceGroupName, vmName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// restartCreateRequest creates the Restart request. -func (client *VirtualMachinesClient) restartCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginRestartOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/restart" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// RetrieveBootDiagnosticsData - The operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmName - The name of the virtual machine. -// options - VirtualMachinesClientRetrieveBootDiagnosticsDataOptions contains the optional parameters for the VirtualMachinesClient.RetrieveBootDiagnosticsData -// method. -func (client *VirtualMachinesClient) RetrieveBootDiagnosticsData(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientRetrieveBootDiagnosticsDataOptions) (VirtualMachinesClientRetrieveBootDiagnosticsDataResponse, error) { - req, err := client.retrieveBootDiagnosticsDataCreateRequest(ctx, resourceGroupName, vmName, options) - if err != nil { - return VirtualMachinesClientRetrieveBootDiagnosticsDataResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualMachinesClientRetrieveBootDiagnosticsDataResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualMachinesClientRetrieveBootDiagnosticsDataResponse{}, runtime.NewResponseError(resp) - } - return client.retrieveBootDiagnosticsDataHandleResponse(resp) -} - -// retrieveBootDiagnosticsDataCreateRequest creates the RetrieveBootDiagnosticsData request. -func (client *VirtualMachinesClient) retrieveBootDiagnosticsDataCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientRetrieveBootDiagnosticsDataOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/retrieveBootDiagnosticsData" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.SasURIExpirationTimeInMinutes != nil { - reqQP.Set("sasUriExpirationTimeInMinutes", strconv.FormatInt(int64(*options.SasURIExpirationTimeInMinutes), 10)) - } - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// retrieveBootDiagnosticsDataHandleResponse handles the RetrieveBootDiagnosticsData response. -func (client *VirtualMachinesClient) retrieveBootDiagnosticsDataHandleResponse(resp *http.Response) (VirtualMachinesClientRetrieveBootDiagnosticsDataResponse, error) { - result := VirtualMachinesClientRetrieveBootDiagnosticsDataResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RetrieveBootDiagnosticsDataResult); err != nil { - return VirtualMachinesClientRetrieveBootDiagnosticsDataResponse{}, err - } - return result, nil -} - -// BeginRunCommand - Run command on the VM. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmName - The name of the virtual machine. -// parameters - Parameters supplied to the Run command operation. -// options - VirtualMachinesClientBeginRunCommandOptions contains the optional parameters for the VirtualMachinesClient.BeginRunCommand -// method. -func (client *VirtualMachinesClient) BeginRunCommand(ctx context.Context, resourceGroupName string, vmName string, parameters RunCommandInput, options *VirtualMachinesClientBeginRunCommandOptions) (*runtime.Poller[VirtualMachinesClientRunCommandResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.runCommand(ctx, resourceGroupName, vmName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VirtualMachinesClientRunCommandResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[VirtualMachinesClientRunCommandResponse](options.ResumeToken, client.pl, nil) - } -} - -// RunCommand - Run command on the VM. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *VirtualMachinesClient) runCommand(ctx context.Context, resourceGroupName string, vmName string, parameters RunCommandInput, options *VirtualMachinesClientBeginRunCommandOptions) (*http.Response, error) { - req, err := client.runCommandCreateRequest(ctx, resourceGroupName, vmName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// runCommandCreateRequest creates the RunCommand request. -func (client *VirtualMachinesClient) runCommandCreateRequest(ctx context.Context, resourceGroupName string, vmName string, parameters RunCommandInput, options *VirtualMachinesClientBeginRunCommandOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommand" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json, text/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// SimulateEviction - The operation to simulate the eviction of spot virtual machine. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmName - The name of the virtual machine. -// options - VirtualMachinesClientSimulateEvictionOptions contains the optional parameters for the VirtualMachinesClient.SimulateEviction -// method. -func (client *VirtualMachinesClient) SimulateEviction(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientSimulateEvictionOptions) (VirtualMachinesClientSimulateEvictionResponse, error) { - req, err := client.simulateEvictionCreateRequest(ctx, resourceGroupName, vmName, options) - if err != nil { - return VirtualMachinesClientSimulateEvictionResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualMachinesClientSimulateEvictionResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusNoContent) { - return VirtualMachinesClientSimulateEvictionResponse{}, runtime.NewResponseError(resp) - } - return VirtualMachinesClientSimulateEvictionResponse{}, nil -} - -// simulateEvictionCreateRequest creates the SimulateEviction request. -func (client *VirtualMachinesClient) simulateEvictionCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientSimulateEvictionOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/simulateEviction" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginStart - The operation to start a virtual machine. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmName - The name of the virtual machine. -// options - VirtualMachinesClientBeginStartOptions contains the optional parameters for the VirtualMachinesClient.BeginStart -// method. -func (client *VirtualMachinesClient) BeginStart(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginStartOptions) (*runtime.Poller[VirtualMachinesClientStartResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.start(ctx, resourceGroupName, vmName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[VirtualMachinesClientStartResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[VirtualMachinesClientStartResponse](options.ResumeToken, client.pl, nil) - } -} - -// Start - The operation to start a virtual machine. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *VirtualMachinesClient) start(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginStartOptions) (*http.Response, error) { - req, err := client.startCreateRequest(ctx, resourceGroupName, vmName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// startCreateRequest creates the Start request. -func (client *VirtualMachinesClient) startCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginStartOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/start" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginUpdate - The operation to update a virtual machine. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmName - The name of the virtual machine. -// parameters - Parameters supplied to the Update Virtual Machine operation. -// options - VirtualMachinesClientBeginUpdateOptions contains the optional parameters for the VirtualMachinesClient.BeginUpdate -// method. -func (client *VirtualMachinesClient) BeginUpdate(ctx context.Context, resourceGroupName string, vmName string, parameters VirtualMachineUpdate, options *VirtualMachinesClientBeginUpdateOptions) (*runtime.Poller[VirtualMachinesClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, vmName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[VirtualMachinesClientUpdateResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[VirtualMachinesClientUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// Update - The operation to update a virtual machine. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *VirtualMachinesClient) update(ctx context.Context, resourceGroupName string, vmName string, parameters VirtualMachineUpdate, options *VirtualMachinesClientBeginUpdateOptions) (*http.Response, error) { - req, err := client.updateCreateRequest(ctx, resourceGroupName, vmName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// updateCreateRequest creates the Update request. -func (client *VirtualMachinesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, vmName string, parameters VirtualMachineUpdate, options *VirtualMachinesClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_virtualmachinescalesetextensions_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_virtualmachinescalesetextensions_client.go deleted file mode 100644 index 06b808c2..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_virtualmachinescalesetextensions_client.go +++ /dev/null @@ -1,397 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// VirtualMachineScaleSetExtensionsClient contains the methods for the VirtualMachineScaleSetExtensions group. -// Don't use this type directly, use NewVirtualMachineScaleSetExtensionsClient() instead. -type VirtualMachineScaleSetExtensionsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewVirtualMachineScaleSetExtensionsClient creates a new instance of VirtualMachineScaleSetExtensionsClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewVirtualMachineScaleSetExtensionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachineScaleSetExtensionsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &VirtualMachineScaleSetExtensionsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - The operation to create or update an extension. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmScaleSetName - The name of the VM scale set where the extension should be create or updated. -// vmssExtensionName - The name of the VM scale set extension. -// extensionParameters - Parameters supplied to the Create VM scale set Extension operation. -// options - VirtualMachineScaleSetExtensionsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineScaleSetExtensionsClient.BeginCreateOrUpdate -// method. -func (client *VirtualMachineScaleSetExtensionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmssExtensionName string, extensionParameters VirtualMachineScaleSetExtension, options *VirtualMachineScaleSetExtensionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualMachineScaleSetExtensionsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[VirtualMachineScaleSetExtensionsClientCreateOrUpdateResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[VirtualMachineScaleSetExtensionsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - The operation to create or update an extension. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *VirtualMachineScaleSetExtensionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmssExtensionName string, extensionParameters VirtualMachineScaleSetExtension, options *VirtualMachineScaleSetExtensionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *VirtualMachineScaleSetExtensionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmssExtensionName string, extensionParameters VirtualMachineScaleSetExtension, options *VirtualMachineScaleSetExtensionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if vmssExtensionName == "" { - return nil, errors.New("parameter vmssExtensionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmssExtensionName}", url.PathEscape(vmssExtensionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, extensionParameters) -} - -// BeginDelete - The operation to delete the extension. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmScaleSetName - The name of the VM scale set where the extension should be deleted. -// vmssExtensionName - The name of the VM scale set extension. -// options - VirtualMachineScaleSetExtensionsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineScaleSetExtensionsClient.BeginDelete -// method. -func (client *VirtualMachineScaleSetExtensionsClient) BeginDelete(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmssExtensionName string, options *VirtualMachineScaleSetExtensionsClientBeginDeleteOptions) (*runtime.Poller[VirtualMachineScaleSetExtensionsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, vmScaleSetName, vmssExtensionName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[VirtualMachineScaleSetExtensionsClientDeleteResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[VirtualMachineScaleSetExtensionsClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - The operation to delete the extension. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *VirtualMachineScaleSetExtensionsClient) deleteOperation(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmssExtensionName string, options *VirtualMachineScaleSetExtensionsClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, vmScaleSetName, vmssExtensionName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *VirtualMachineScaleSetExtensionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmssExtensionName string, options *VirtualMachineScaleSetExtensionsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if vmssExtensionName == "" { - return nil, errors.New("parameter vmssExtensionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmssExtensionName}", url.PathEscape(vmssExtensionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - The operation to get the extension. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmScaleSetName - The name of the VM scale set containing the extension. -// vmssExtensionName - The name of the VM scale set extension. -// options - VirtualMachineScaleSetExtensionsClientGetOptions contains the optional parameters for the VirtualMachineScaleSetExtensionsClient.Get -// method. -func (client *VirtualMachineScaleSetExtensionsClient) Get(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmssExtensionName string, options *VirtualMachineScaleSetExtensionsClientGetOptions) (VirtualMachineScaleSetExtensionsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, vmScaleSetName, vmssExtensionName, options) - if err != nil { - return VirtualMachineScaleSetExtensionsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualMachineScaleSetExtensionsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualMachineScaleSetExtensionsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *VirtualMachineScaleSetExtensionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmssExtensionName string, options *VirtualMachineScaleSetExtensionsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if vmssExtensionName == "" { - return nil, errors.New("parameter vmssExtensionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmssExtensionName}", url.PathEscape(vmssExtensionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *VirtualMachineScaleSetExtensionsClient) getHandleResponse(resp *http.Response) (VirtualMachineScaleSetExtensionsClientGetResponse, error) { - result := VirtualMachineScaleSetExtensionsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineScaleSetExtension); err != nil { - return VirtualMachineScaleSetExtensionsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Gets a list of all extensions in a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmScaleSetName - The name of the VM scale set containing the extension. -// options - VirtualMachineScaleSetExtensionsClientListOptions contains the optional parameters for the VirtualMachineScaleSetExtensionsClient.List -// method. -func (client *VirtualMachineScaleSetExtensionsClient) NewListPager(resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetExtensionsClientListOptions) *runtime.Pager[VirtualMachineScaleSetExtensionsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualMachineScaleSetExtensionsClientListResponse]{ - More: func(page VirtualMachineScaleSetExtensionsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VirtualMachineScaleSetExtensionsClientListResponse) (VirtualMachineScaleSetExtensionsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, vmScaleSetName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return VirtualMachineScaleSetExtensionsClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualMachineScaleSetExtensionsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualMachineScaleSetExtensionsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *VirtualMachineScaleSetExtensionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetExtensionsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *VirtualMachineScaleSetExtensionsClient) listHandleResponse(resp *http.Response) (VirtualMachineScaleSetExtensionsClientListResponse, error) { - result := VirtualMachineScaleSetExtensionsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineScaleSetExtensionListResult); err != nil { - return VirtualMachineScaleSetExtensionsClientListResponse{}, err - } - return result, nil -} - -// BeginUpdate - The operation to update an extension. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmScaleSetName - The name of the VM scale set where the extension should be updated. -// vmssExtensionName - The name of the VM scale set extension. -// extensionParameters - Parameters supplied to the Update VM scale set Extension operation. -// options - VirtualMachineScaleSetExtensionsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineScaleSetExtensionsClient.BeginUpdate -// method. -func (client *VirtualMachineScaleSetExtensionsClient) BeginUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmssExtensionName string, extensionParameters VirtualMachineScaleSetExtensionUpdate, options *VirtualMachineScaleSetExtensionsClientBeginUpdateOptions) (*runtime.Poller[VirtualMachineScaleSetExtensionsClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[VirtualMachineScaleSetExtensionsClientUpdateResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[VirtualMachineScaleSetExtensionsClientUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// Update - The operation to update an extension. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *VirtualMachineScaleSetExtensionsClient) update(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmssExtensionName string, extensionParameters VirtualMachineScaleSetExtensionUpdate, options *VirtualMachineScaleSetExtensionsClientBeginUpdateOptions) (*http.Response, error) { - req, err := client.updateCreateRequest(ctx, resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// updateCreateRequest creates the Update request. -func (client *VirtualMachineScaleSetExtensionsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmssExtensionName string, extensionParameters VirtualMachineScaleSetExtensionUpdate, options *VirtualMachineScaleSetExtensionsClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if vmssExtensionName == "" { - return nil, errors.New("parameter vmssExtensionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmssExtensionName}", url.PathEscape(vmssExtensionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, extensionParameters) -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_virtualmachinescalesetrollingupgrades_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_virtualmachinescalesetrollingupgrades_client.go deleted file mode 100644 index d86eeec8..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_virtualmachinescalesetrollingupgrades_client.go +++ /dev/null @@ -1,310 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// VirtualMachineScaleSetRollingUpgradesClient contains the methods for the VirtualMachineScaleSetRollingUpgrades group. -// Don't use this type directly, use NewVirtualMachineScaleSetRollingUpgradesClient() instead. -type VirtualMachineScaleSetRollingUpgradesClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewVirtualMachineScaleSetRollingUpgradesClient creates a new instance of VirtualMachineScaleSetRollingUpgradesClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewVirtualMachineScaleSetRollingUpgradesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachineScaleSetRollingUpgradesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &VirtualMachineScaleSetRollingUpgradesClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCancel - Cancels the current virtual machine scale set rolling upgrade. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmScaleSetName - The name of the VM scale set. -// options - VirtualMachineScaleSetRollingUpgradesClientBeginCancelOptions contains the optional parameters for the VirtualMachineScaleSetRollingUpgradesClient.BeginCancel -// method. -func (client *VirtualMachineScaleSetRollingUpgradesClient) BeginCancel(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetRollingUpgradesClientBeginCancelOptions) (*runtime.Poller[VirtualMachineScaleSetRollingUpgradesClientCancelResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.cancel(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[VirtualMachineScaleSetRollingUpgradesClientCancelResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[VirtualMachineScaleSetRollingUpgradesClientCancelResponse](options.ResumeToken, client.pl, nil) - } -} - -// Cancel - Cancels the current virtual machine scale set rolling upgrade. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *VirtualMachineScaleSetRollingUpgradesClient) cancel(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetRollingUpgradesClientBeginCancelOptions) (*http.Response, error) { - req, err := client.cancelCreateRequest(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// cancelCreateRequest creates the Cancel request. -func (client *VirtualMachineScaleSetRollingUpgradesClient) cancelCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetRollingUpgradesClientBeginCancelOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/rollingUpgrades/cancel" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// GetLatest - Gets the status of the latest virtual machine scale set rolling upgrade. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmScaleSetName - The name of the VM scale set. -// options - VirtualMachineScaleSetRollingUpgradesClientGetLatestOptions contains the optional parameters for the VirtualMachineScaleSetRollingUpgradesClient.GetLatest -// method. -func (client *VirtualMachineScaleSetRollingUpgradesClient) GetLatest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetRollingUpgradesClientGetLatestOptions) (VirtualMachineScaleSetRollingUpgradesClientGetLatestResponse, error) { - req, err := client.getLatestCreateRequest(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return VirtualMachineScaleSetRollingUpgradesClientGetLatestResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualMachineScaleSetRollingUpgradesClientGetLatestResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualMachineScaleSetRollingUpgradesClientGetLatestResponse{}, runtime.NewResponseError(resp) - } - return client.getLatestHandleResponse(resp) -} - -// getLatestCreateRequest creates the GetLatest request. -func (client *VirtualMachineScaleSetRollingUpgradesClient) getLatestCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetRollingUpgradesClientGetLatestOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/rollingUpgrades/latest" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getLatestHandleResponse handles the GetLatest response. -func (client *VirtualMachineScaleSetRollingUpgradesClient) getLatestHandleResponse(resp *http.Response) (VirtualMachineScaleSetRollingUpgradesClientGetLatestResponse, error) { - result := VirtualMachineScaleSetRollingUpgradesClientGetLatestResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RollingUpgradeStatusInfo); err != nil { - return VirtualMachineScaleSetRollingUpgradesClientGetLatestResponse{}, err - } - return result, nil -} - -// BeginStartExtensionUpgrade - Starts a rolling upgrade to move all extensions for all virtual machine scale set instances -// to the latest available extension version. Instances which are already running the latest extension versions -// are not affected. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmScaleSetName - The name of the VM scale set. -// options - VirtualMachineScaleSetRollingUpgradesClientBeginStartExtensionUpgradeOptions contains the optional parameters -// for the VirtualMachineScaleSetRollingUpgradesClient.BeginStartExtensionUpgrade method. -func (client *VirtualMachineScaleSetRollingUpgradesClient) BeginStartExtensionUpgrade(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetRollingUpgradesClientBeginStartExtensionUpgradeOptions) (*runtime.Poller[VirtualMachineScaleSetRollingUpgradesClientStartExtensionUpgradeResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.startExtensionUpgrade(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[VirtualMachineScaleSetRollingUpgradesClientStartExtensionUpgradeResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[VirtualMachineScaleSetRollingUpgradesClientStartExtensionUpgradeResponse](options.ResumeToken, client.pl, nil) - } -} - -// StartExtensionUpgrade - Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to -// the latest available extension version. Instances which are already running the latest extension versions -// are not affected. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *VirtualMachineScaleSetRollingUpgradesClient) startExtensionUpgrade(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetRollingUpgradesClientBeginStartExtensionUpgradeOptions) (*http.Response, error) { - req, err := client.startExtensionUpgradeCreateRequest(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// startExtensionUpgradeCreateRequest creates the StartExtensionUpgrade request. -func (client *VirtualMachineScaleSetRollingUpgradesClient) startExtensionUpgradeCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetRollingUpgradesClientBeginStartExtensionUpgradeOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensionRollingUpgrade" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginStartOSUpgrade - Starts a rolling upgrade to move all virtual machine scale set instances to the latest available -// Platform Image OS version. Instances which are already running the latest available OS version are not -// affected. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmScaleSetName - The name of the VM scale set. -// options - VirtualMachineScaleSetRollingUpgradesClientBeginStartOSUpgradeOptions contains the optional parameters for the -// VirtualMachineScaleSetRollingUpgradesClient.BeginStartOSUpgrade method. -func (client *VirtualMachineScaleSetRollingUpgradesClient) BeginStartOSUpgrade(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetRollingUpgradesClientBeginStartOSUpgradeOptions) (*runtime.Poller[VirtualMachineScaleSetRollingUpgradesClientStartOSUpgradeResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.startOSUpgrade(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[VirtualMachineScaleSetRollingUpgradesClientStartOSUpgradeResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[VirtualMachineScaleSetRollingUpgradesClientStartOSUpgradeResponse](options.ResumeToken, client.pl, nil) - } -} - -// StartOSUpgrade - Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform -// Image OS version. Instances which are already running the latest available OS version are not -// affected. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *VirtualMachineScaleSetRollingUpgradesClient) startOSUpgrade(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetRollingUpgradesClientBeginStartOSUpgradeOptions) (*http.Response, error) { - req, err := client.startOSUpgradeCreateRequest(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// startOSUpgradeCreateRequest creates the StartOSUpgrade request. -func (client *VirtualMachineScaleSetRollingUpgradesClient) startOSUpgradeCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetRollingUpgradesClientBeginStartOSUpgradeOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/osRollingUpgrade" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_virtualmachinescalesets_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_virtualmachinescalesets_client.go deleted file mode 100644 index 5a5d8a7e..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_virtualmachinescalesets_client.go +++ /dev/null @@ -1,1562 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strconv" - "strings" -) - -// VirtualMachineScaleSetsClient contains the methods for the VirtualMachineScaleSets group. -// Don't use this type directly, use NewVirtualMachineScaleSetsClient() instead. -type VirtualMachineScaleSetsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewVirtualMachineScaleSetsClient creates a new instance of VirtualMachineScaleSetsClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewVirtualMachineScaleSetsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachineScaleSetsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &VirtualMachineScaleSetsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// ConvertToSinglePlacementGroup - Converts SinglePlacementGroup property to false for a existing virtual machine scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmScaleSetName - The name of the virtual machine scale set to create or update. -// parameters - The input object for ConvertToSinglePlacementGroup API. -// options - VirtualMachineScaleSetsClientConvertToSinglePlacementGroupOptions contains the optional parameters for the VirtualMachineScaleSetsClient.ConvertToSinglePlacementGroup -// method. -func (client *VirtualMachineScaleSetsClient) ConvertToSinglePlacementGroup(ctx context.Context, resourceGroupName string, vmScaleSetName string, parameters VMScaleSetConvertToSinglePlacementGroupInput, options *VirtualMachineScaleSetsClientConvertToSinglePlacementGroupOptions) (VirtualMachineScaleSetsClientConvertToSinglePlacementGroupResponse, error) { - req, err := client.convertToSinglePlacementGroupCreateRequest(ctx, resourceGroupName, vmScaleSetName, parameters, options) - if err != nil { - return VirtualMachineScaleSetsClientConvertToSinglePlacementGroupResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualMachineScaleSetsClientConvertToSinglePlacementGroupResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualMachineScaleSetsClientConvertToSinglePlacementGroupResponse{}, runtime.NewResponseError(resp) - } - return VirtualMachineScaleSetsClientConvertToSinglePlacementGroupResponse{}, nil -} - -// convertToSinglePlacementGroupCreateRequest creates the ConvertToSinglePlacementGroup request. -func (client *VirtualMachineScaleSetsClient) convertToSinglePlacementGroupCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, parameters VMScaleSetConvertToSinglePlacementGroupInput, options *VirtualMachineScaleSetsClientConvertToSinglePlacementGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/convertToSinglePlacementGroup" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginCreateOrUpdate - Create or update a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmScaleSetName - The name of the VM scale set to create or update. -// parameters - The scale set object. -// options - VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginCreateOrUpdate -// method. -func (client *VirtualMachineScaleSetsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, parameters VirtualMachineScaleSet, options *VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualMachineScaleSetsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, vmScaleSetName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[VirtualMachineScaleSetsClientCreateOrUpdateResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[VirtualMachineScaleSetsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Create or update a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *VirtualMachineScaleSetsClient) createOrUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, parameters VirtualMachineScaleSet, options *VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, vmScaleSetName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *VirtualMachineScaleSetsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, parameters VirtualMachineScaleSet, options *VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginDeallocate - 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. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmScaleSetName - The name of the VM scale set. -// options - VirtualMachineScaleSetsClientBeginDeallocateOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginDeallocate -// method. -func (client *VirtualMachineScaleSetsClient) BeginDeallocate(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginDeallocateOptions) (*runtime.Poller[VirtualMachineScaleSetsClientDeallocateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deallocate(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[VirtualMachineScaleSetsClientDeallocateResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[VirtualMachineScaleSetsClientDeallocateResponse](options.ResumeToken, client.pl, nil) - } -} - -// 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. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *VirtualMachineScaleSetsClient) deallocate(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginDeallocateOptions) (*http.Response, error) { - req, err := client.deallocateCreateRequest(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deallocateCreateRequest creates the Deallocate request. -func (client *VirtualMachineScaleSetsClient) deallocateCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginDeallocateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/deallocate" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.VMInstanceIDs != nil { - return req, runtime.MarshalAsJSON(req, *options.VMInstanceIDs) - } - return req, nil -} - -// BeginDelete - Deletes a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmScaleSetName - The name of the VM scale set. -// options - VirtualMachineScaleSetsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginDelete -// method. -func (client *VirtualMachineScaleSetsClient) BeginDelete(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginDeleteOptions) (*runtime.Poller[VirtualMachineScaleSetsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[VirtualMachineScaleSetsClientDeleteResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[VirtualMachineScaleSetsClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *VirtualMachineScaleSetsClient) deleteOperation(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *VirtualMachineScaleSetsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.ForceDeletion != nil { - reqQP.Set("forceDeletion", strconv.FormatBool(*options.ForceDeletion)) - } - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginDeleteInstances - Deletes virtual machines in a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmScaleSetName - The name of the VM scale set. -// vmInstanceIDs - A list of virtual machine instance IDs from the VM scale set. -// options - VirtualMachineScaleSetsClientBeginDeleteInstancesOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginDeleteInstances -// method. -func (client *VirtualMachineScaleSetsClient) BeginDeleteInstances(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs, options *VirtualMachineScaleSetsClientBeginDeleteInstancesOptions) (*runtime.Poller[VirtualMachineScaleSetsClientDeleteInstancesResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteInstances(ctx, resourceGroupName, vmScaleSetName, vmInstanceIDs, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[VirtualMachineScaleSetsClientDeleteInstancesResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[VirtualMachineScaleSetsClientDeleteInstancesResponse](options.ResumeToken, client.pl, nil) - } -} - -// DeleteInstances - Deletes virtual machines in a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *VirtualMachineScaleSetsClient) deleteInstances(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs, options *VirtualMachineScaleSetsClientBeginDeleteInstancesOptions) (*http.Response, error) { - req, err := client.deleteInstancesCreateRequest(ctx, resourceGroupName, vmScaleSetName, vmInstanceIDs, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteInstancesCreateRequest creates the DeleteInstances request. -func (client *VirtualMachineScaleSetsClient) deleteInstancesCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs, options *VirtualMachineScaleSetsClientBeginDeleteInstancesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/delete" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.ForceDeletion != nil { - reqQP.Set("forceDeletion", strconv.FormatBool(*options.ForceDeletion)) - } - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, vmInstanceIDs) -} - -// ForceRecoveryServiceFabricPlatformUpdateDomainWalk - Manual platform update domain walk to update virtual machines in a -// service fabric virtual machine scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmScaleSetName - The name of the VM scale set. -// platformUpdateDomain - The platform update domain for which a manual recovery walk is requested -// options - VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkOptions contains the optional -// parameters for the VirtualMachineScaleSetsClient.ForceRecoveryServiceFabricPlatformUpdateDomainWalk method. -func (client *VirtualMachineScaleSetsClient) ForceRecoveryServiceFabricPlatformUpdateDomainWalk(ctx context.Context, resourceGroupName string, vmScaleSetName string, platformUpdateDomain int32, options *VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkOptions) (VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkResponse, error) { - req, err := client.forceRecoveryServiceFabricPlatformUpdateDomainWalkCreateRequest(ctx, resourceGroupName, vmScaleSetName, platformUpdateDomain, options) - if err != nil { - return VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkResponse{}, runtime.NewResponseError(resp) - } - return client.forceRecoveryServiceFabricPlatformUpdateDomainWalkHandleResponse(resp) -} - -// forceRecoveryServiceFabricPlatformUpdateDomainWalkCreateRequest creates the ForceRecoveryServiceFabricPlatformUpdateDomainWalk request. -func (client *VirtualMachineScaleSetsClient) forceRecoveryServiceFabricPlatformUpdateDomainWalkCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, platformUpdateDomain int32, options *VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/forceRecoveryServiceFabricPlatformUpdateDomainWalk" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - reqQP.Set("platformUpdateDomain", strconv.FormatInt(int64(platformUpdateDomain), 10)) - if options != nil && options.Zone != nil { - reqQP.Set("zone", *options.Zone) - } - if options != nil && options.PlacementGroupID != nil { - reqQP.Set("placementGroupId", *options.PlacementGroupID) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// forceRecoveryServiceFabricPlatformUpdateDomainWalkHandleResponse handles the ForceRecoveryServiceFabricPlatformUpdateDomainWalk response. -func (client *VirtualMachineScaleSetsClient) forceRecoveryServiceFabricPlatformUpdateDomainWalkHandleResponse(resp *http.Response) (VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkResponse, error) { - result := VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RecoveryWalkResponse); err != nil { - return VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkResponse{}, err - } - return result, nil -} - -// Get - Display information about a virtual machine scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmScaleSetName - The name of the VM scale set. -// options - VirtualMachineScaleSetsClientGetOptions contains the optional parameters for the VirtualMachineScaleSetsClient.Get -// method. -func (client *VirtualMachineScaleSetsClient) Get(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientGetOptions) (VirtualMachineScaleSetsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return VirtualMachineScaleSetsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualMachineScaleSetsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualMachineScaleSetsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *VirtualMachineScaleSetsClient) getCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - if options != nil && options.Expand != nil { - reqQP.Set("$expand", string(*options.Expand)) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *VirtualMachineScaleSetsClient) getHandleResponse(resp *http.Response) (VirtualMachineScaleSetsClientGetResponse, error) { - result := VirtualMachineScaleSetsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineScaleSet); err != nil { - return VirtualMachineScaleSetsClientGetResponse{}, err - } - return result, nil -} - -// GetInstanceView - Gets the status of a VM scale set instance. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmScaleSetName - The name of the VM scale set. -// options - VirtualMachineScaleSetsClientGetInstanceViewOptions contains the optional parameters for the VirtualMachineScaleSetsClient.GetInstanceView -// method. -func (client *VirtualMachineScaleSetsClient) GetInstanceView(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientGetInstanceViewOptions) (VirtualMachineScaleSetsClientGetInstanceViewResponse, error) { - req, err := client.getInstanceViewCreateRequest(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return VirtualMachineScaleSetsClientGetInstanceViewResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualMachineScaleSetsClientGetInstanceViewResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualMachineScaleSetsClientGetInstanceViewResponse{}, runtime.NewResponseError(resp) - } - return client.getInstanceViewHandleResponse(resp) -} - -// getInstanceViewCreateRequest creates the GetInstanceView request. -func (client *VirtualMachineScaleSetsClient) getInstanceViewCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientGetInstanceViewOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/instanceView" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getInstanceViewHandleResponse handles the GetInstanceView response. -func (client *VirtualMachineScaleSetsClient) getInstanceViewHandleResponse(resp *http.Response) (VirtualMachineScaleSetsClientGetInstanceViewResponse, error) { - result := VirtualMachineScaleSetsClientGetInstanceViewResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineScaleSetInstanceView); err != nil { - return VirtualMachineScaleSetsClientGetInstanceViewResponse{}, err - } - return result, nil -} - -// NewGetOSUpgradeHistoryPager - Gets list of OS upgrades on a VM scale set instance. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmScaleSetName - The name of the VM scale set. -// options - VirtualMachineScaleSetsClientGetOSUpgradeHistoryOptions contains the optional parameters for the VirtualMachineScaleSetsClient.GetOSUpgradeHistory -// method. -func (client *VirtualMachineScaleSetsClient) NewGetOSUpgradeHistoryPager(resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientGetOSUpgradeHistoryOptions) *runtime.Pager[VirtualMachineScaleSetsClientGetOSUpgradeHistoryResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualMachineScaleSetsClientGetOSUpgradeHistoryResponse]{ - More: func(page VirtualMachineScaleSetsClientGetOSUpgradeHistoryResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VirtualMachineScaleSetsClientGetOSUpgradeHistoryResponse) (VirtualMachineScaleSetsClientGetOSUpgradeHistoryResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.getOSUpgradeHistoryCreateRequest(ctx, resourceGroupName, vmScaleSetName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return VirtualMachineScaleSetsClientGetOSUpgradeHistoryResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualMachineScaleSetsClientGetOSUpgradeHistoryResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualMachineScaleSetsClientGetOSUpgradeHistoryResponse{}, runtime.NewResponseError(resp) - } - return client.getOSUpgradeHistoryHandleResponse(resp) - }, - }) -} - -// getOSUpgradeHistoryCreateRequest creates the GetOSUpgradeHistory request. -func (client *VirtualMachineScaleSetsClient) getOSUpgradeHistoryCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientGetOSUpgradeHistoryOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/osUpgradeHistory" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getOSUpgradeHistoryHandleResponse handles the GetOSUpgradeHistory response. -func (client *VirtualMachineScaleSetsClient) getOSUpgradeHistoryHandleResponse(resp *http.Response) (VirtualMachineScaleSetsClientGetOSUpgradeHistoryResponse, error) { - result := VirtualMachineScaleSetsClientGetOSUpgradeHistoryResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineScaleSetListOSUpgradeHistory); err != nil { - return VirtualMachineScaleSetsClientGetOSUpgradeHistoryResponse{}, err - } - return result, nil -} - -// NewListPager - Gets a list of all VM scale sets under a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// options - VirtualMachineScaleSetsClientListOptions contains the optional parameters for the VirtualMachineScaleSetsClient.List -// method. -func (client *VirtualMachineScaleSetsClient) NewListPager(resourceGroupName string, options *VirtualMachineScaleSetsClientListOptions) *runtime.Pager[VirtualMachineScaleSetsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualMachineScaleSetsClientListResponse]{ - More: func(page VirtualMachineScaleSetsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VirtualMachineScaleSetsClientListResponse) (VirtualMachineScaleSetsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return VirtualMachineScaleSetsClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualMachineScaleSetsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualMachineScaleSetsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *VirtualMachineScaleSetsClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *VirtualMachineScaleSetsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *VirtualMachineScaleSetsClient) listHandleResponse(resp *http.Response) (VirtualMachineScaleSetsClientListResponse, error) { - result := VirtualMachineScaleSetsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineScaleSetListResult); err != nil { - return VirtualMachineScaleSetsClientListResponse{}, err - } - return result, nil -} - -// NewListAllPager - Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use -// nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is -// null to fetch all the VM Scale Sets. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// options - VirtualMachineScaleSetsClientListAllOptions contains the optional parameters for the VirtualMachineScaleSetsClient.ListAll -// method. -func (client *VirtualMachineScaleSetsClient) NewListAllPager(options *VirtualMachineScaleSetsClientListAllOptions) *runtime.Pager[VirtualMachineScaleSetsClientListAllResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualMachineScaleSetsClientListAllResponse]{ - More: func(page VirtualMachineScaleSetsClientListAllResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VirtualMachineScaleSetsClientListAllResponse) (VirtualMachineScaleSetsClientListAllResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listAllCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return VirtualMachineScaleSetsClientListAllResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualMachineScaleSetsClientListAllResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualMachineScaleSetsClientListAllResponse{}, runtime.NewResponseError(resp) - } - return client.listAllHandleResponse(resp) - }, - }) -} - -// listAllCreateRequest creates the ListAll request. -func (client *VirtualMachineScaleSetsClient) listAllCreateRequest(ctx context.Context, options *VirtualMachineScaleSetsClientListAllOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachineScaleSets" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listAllHandleResponse handles the ListAll response. -func (client *VirtualMachineScaleSetsClient) listAllHandleResponse(resp *http.Response) (VirtualMachineScaleSetsClientListAllResponse, error) { - result := VirtualMachineScaleSetsClientListAllResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineScaleSetListWithLinkResult); err != nil { - return VirtualMachineScaleSetsClientListAllResponse{}, err - } - return result, nil -} - -// NewListByLocationPager - Gets all the VM scale sets under the specified subscription for the specified location. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// location - The location for which VM scale sets under the subscription are queried. -// options - VirtualMachineScaleSetsClientListByLocationOptions contains the optional parameters for the VirtualMachineScaleSetsClient.ListByLocation -// method. -func (client *VirtualMachineScaleSetsClient) NewListByLocationPager(location string, options *VirtualMachineScaleSetsClientListByLocationOptions) *runtime.Pager[VirtualMachineScaleSetsClientListByLocationResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualMachineScaleSetsClientListByLocationResponse]{ - More: func(page VirtualMachineScaleSetsClientListByLocationResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VirtualMachineScaleSetsClientListByLocationResponse) (VirtualMachineScaleSetsClientListByLocationResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByLocationCreateRequest(ctx, location, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return VirtualMachineScaleSetsClientListByLocationResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualMachineScaleSetsClientListByLocationResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualMachineScaleSetsClientListByLocationResponse{}, runtime.NewResponseError(resp) - } - return client.listByLocationHandleResponse(resp) - }, - }) -} - -// listByLocationCreateRequest creates the ListByLocation request. -func (client *VirtualMachineScaleSetsClient) listByLocationCreateRequest(ctx context.Context, location string, options *VirtualMachineScaleSetsClientListByLocationOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/virtualMachineScaleSets" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByLocationHandleResponse handles the ListByLocation response. -func (client *VirtualMachineScaleSetsClient) listByLocationHandleResponse(resp *http.Response) (VirtualMachineScaleSetsClientListByLocationResponse, error) { - result := VirtualMachineScaleSetsClientListByLocationResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineScaleSetListResult); err != nil { - return VirtualMachineScaleSetsClientListByLocationResponse{}, err - } - return result, nil -} - -// NewListSKUsPager - Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances -// allowed for each SKU. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmScaleSetName - The name of the VM scale set. -// options - VirtualMachineScaleSetsClientListSKUsOptions contains the optional parameters for the VirtualMachineScaleSetsClient.ListSKUs -// method. -func (client *VirtualMachineScaleSetsClient) NewListSKUsPager(resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientListSKUsOptions) *runtime.Pager[VirtualMachineScaleSetsClientListSKUsResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualMachineScaleSetsClientListSKUsResponse]{ - More: func(page VirtualMachineScaleSetsClientListSKUsResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VirtualMachineScaleSetsClientListSKUsResponse) (VirtualMachineScaleSetsClientListSKUsResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listSKUsCreateRequest(ctx, resourceGroupName, vmScaleSetName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return VirtualMachineScaleSetsClientListSKUsResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualMachineScaleSetsClientListSKUsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualMachineScaleSetsClientListSKUsResponse{}, runtime.NewResponseError(resp) - } - return client.listSKUsHandleResponse(resp) - }, - }) -} - -// listSKUsCreateRequest creates the ListSKUs request. -func (client *VirtualMachineScaleSetsClient) listSKUsCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientListSKUsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/skus" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listSKUsHandleResponse handles the ListSKUs response. -func (client *VirtualMachineScaleSetsClient) listSKUsHandleResponse(resp *http.Response) (VirtualMachineScaleSetsClientListSKUsResponse, error) { - result := VirtualMachineScaleSetsClientListSKUsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineScaleSetListSKUsResult); err != nil { - return VirtualMachineScaleSetsClientListSKUsResponse{}, err - } - return result, nil -} - -// BeginPerformMaintenance - Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances -// which are not eligible for perform maintenance will be failed. Please refer to best practices for more -// details: https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmScaleSetName - The name of the VM scale set. -// options - VirtualMachineScaleSetsClientBeginPerformMaintenanceOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginPerformMaintenance -// method. -func (client *VirtualMachineScaleSetsClient) BeginPerformMaintenance(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginPerformMaintenanceOptions) (*runtime.Poller[VirtualMachineScaleSetsClientPerformMaintenanceResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.performMaintenance(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[VirtualMachineScaleSetsClientPerformMaintenanceResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[VirtualMachineScaleSetsClientPerformMaintenanceResponse](options.ResumeToken, client.pl, nil) - } -} - -// PerformMaintenance - Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which -// are not eligible for perform maintenance will be failed. Please refer to best practices for more -// details: https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *VirtualMachineScaleSetsClient) performMaintenance(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginPerformMaintenanceOptions) (*http.Response, error) { - req, err := client.performMaintenanceCreateRequest(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// performMaintenanceCreateRequest creates the PerformMaintenance request. -func (client *VirtualMachineScaleSetsClient) performMaintenanceCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginPerformMaintenanceOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/performMaintenance" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.VMInstanceIDs != nil { - return req, runtime.MarshalAsJSON(req, *options.VMInstanceIDs) - } - return req, nil -} - -// BeginPowerOff - 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. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmScaleSetName - The name of the VM scale set. -// options - VirtualMachineScaleSetsClientBeginPowerOffOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginPowerOff -// method. -func (client *VirtualMachineScaleSetsClient) BeginPowerOff(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginPowerOffOptions) (*runtime.Poller[VirtualMachineScaleSetsClientPowerOffResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.powerOff(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[VirtualMachineScaleSetsClientPowerOffResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[VirtualMachineScaleSetsClientPowerOffResponse](options.ResumeToken, client.pl, nil) - } -} - -// 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. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *VirtualMachineScaleSetsClient) powerOff(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginPowerOffOptions) (*http.Response, error) { - req, err := client.powerOffCreateRequest(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// powerOffCreateRequest creates the PowerOff request. -func (client *VirtualMachineScaleSetsClient) powerOffCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginPowerOffOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/poweroff" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.SkipShutdown != nil { - reqQP.Set("skipShutdown", strconv.FormatBool(*options.SkipShutdown)) - } - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.VMInstanceIDs != nil { - return req, runtime.MarshalAsJSON(req, *options.VMInstanceIDs) - } - return req, nil -} - -// BeginRedeploy - Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers -// them back on. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmScaleSetName - The name of the VM scale set. -// options - VirtualMachineScaleSetsClientBeginRedeployOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginRedeploy -// method. -func (client *VirtualMachineScaleSetsClient) BeginRedeploy(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginRedeployOptions) (*runtime.Poller[VirtualMachineScaleSetsClientRedeployResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.redeploy(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[VirtualMachineScaleSetsClientRedeployResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[VirtualMachineScaleSetsClientRedeployResponse](options.ResumeToken, client.pl, nil) - } -} - -// Redeploy - Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them -// back on. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *VirtualMachineScaleSetsClient) redeploy(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginRedeployOptions) (*http.Response, error) { - req, err := client.redeployCreateRequest(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// redeployCreateRequest creates the Redeploy request. -func (client *VirtualMachineScaleSetsClient) redeployCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginRedeployOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/redeploy" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.VMInstanceIDs != nil { - return req, runtime.MarshalAsJSON(req, *options.VMInstanceIDs) - } - return req, nil -} - -// BeginReimage - Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have -// a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is -// reset to initial state. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmScaleSetName - The name of the VM scale set. -// options - VirtualMachineScaleSetsClientBeginReimageOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginReimage -// method. -func (client *VirtualMachineScaleSetsClient) BeginReimage(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginReimageOptions) (*runtime.Poller[VirtualMachineScaleSetsClientReimageResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.reimage(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[VirtualMachineScaleSetsClientReimageResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[VirtualMachineScaleSetsClientReimageResponse](options.ResumeToken, client.pl, nil) - } -} - -// Reimage - Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a ephemeral -// OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is -// reset to initial state. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *VirtualMachineScaleSetsClient) reimage(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginReimageOptions) (*http.Response, error) { - req, err := client.reimageCreateRequest(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// reimageCreateRequest creates the Reimage request. -func (client *VirtualMachineScaleSetsClient) reimageCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginReimageOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimage" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.VMScaleSetReimageInput != nil { - return req, runtime.MarshalAsJSON(req, *options.VMScaleSetReimageInput) - } - return req, nil -} - -// BeginReimageAll - Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation -// is only supported for managed disks. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmScaleSetName - The name of the VM scale set. -// options - VirtualMachineScaleSetsClientBeginReimageAllOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginReimageAll -// method. -func (client *VirtualMachineScaleSetsClient) BeginReimageAll(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginReimageAllOptions) (*runtime.Poller[VirtualMachineScaleSetsClientReimageAllResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.reimageAll(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[VirtualMachineScaleSetsClientReimageAllResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[VirtualMachineScaleSetsClientReimageAllResponse](options.ResumeToken, client.pl, nil) - } -} - -// 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. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *VirtualMachineScaleSetsClient) reimageAll(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginReimageAllOptions) (*http.Response, error) { - req, err := client.reimageAllCreateRequest(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// reimageAllCreateRequest creates the ReimageAll request. -func (client *VirtualMachineScaleSetsClient) reimageAllCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginReimageAllOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimageall" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.VMInstanceIDs != nil { - return req, runtime.MarshalAsJSON(req, *options.VMInstanceIDs) - } - return req, nil -} - -// BeginRestart - Restarts one or more virtual machines in a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmScaleSetName - The name of the VM scale set. -// options - VirtualMachineScaleSetsClientBeginRestartOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginRestart -// method. -func (client *VirtualMachineScaleSetsClient) BeginRestart(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginRestartOptions) (*runtime.Poller[VirtualMachineScaleSetsClientRestartResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.restart(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[VirtualMachineScaleSetsClientRestartResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[VirtualMachineScaleSetsClientRestartResponse](options.ResumeToken, client.pl, nil) - } -} - -// Restart - Restarts one or more virtual machines in a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *VirtualMachineScaleSetsClient) restart(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginRestartOptions) (*http.Response, error) { - req, err := client.restartCreateRequest(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// restartCreateRequest creates the Restart request. -func (client *VirtualMachineScaleSetsClient) restartCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginRestartOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/restart" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.VMInstanceIDs != nil { - return req, runtime.MarshalAsJSON(req, *options.VMInstanceIDs) - } - return req, nil -} - -// BeginSetOrchestrationServiceState - Changes ServiceState property for a given service -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmScaleSetName - The name of the virtual machine scale set to create or update. -// parameters - The input object for SetOrchestrationServiceState API. -// options - VirtualMachineScaleSetsClientBeginSetOrchestrationServiceStateOptions contains the optional parameters for the -// VirtualMachineScaleSetsClient.BeginSetOrchestrationServiceState method. -func (client *VirtualMachineScaleSetsClient) BeginSetOrchestrationServiceState(ctx context.Context, resourceGroupName string, vmScaleSetName string, parameters OrchestrationServiceStateInput, options *VirtualMachineScaleSetsClientBeginSetOrchestrationServiceStateOptions) (*runtime.Poller[VirtualMachineScaleSetsClientSetOrchestrationServiceStateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.setOrchestrationServiceState(ctx, resourceGroupName, vmScaleSetName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[VirtualMachineScaleSetsClientSetOrchestrationServiceStateResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[VirtualMachineScaleSetsClientSetOrchestrationServiceStateResponse](options.ResumeToken, client.pl, nil) - } -} - -// SetOrchestrationServiceState - Changes ServiceState property for a given service -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *VirtualMachineScaleSetsClient) setOrchestrationServiceState(ctx context.Context, resourceGroupName string, vmScaleSetName string, parameters OrchestrationServiceStateInput, options *VirtualMachineScaleSetsClientBeginSetOrchestrationServiceStateOptions) (*http.Response, error) { - req, err := client.setOrchestrationServiceStateCreateRequest(ctx, resourceGroupName, vmScaleSetName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// setOrchestrationServiceStateCreateRequest creates the SetOrchestrationServiceState request. -func (client *VirtualMachineScaleSetsClient) setOrchestrationServiceStateCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, parameters OrchestrationServiceStateInput, options *VirtualMachineScaleSetsClientBeginSetOrchestrationServiceStateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/setOrchestrationServiceState" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginStart - Starts one or more virtual machines in a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmScaleSetName - The name of the VM scale set. -// options - VirtualMachineScaleSetsClientBeginStartOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginStart -// method. -func (client *VirtualMachineScaleSetsClient) BeginStart(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginStartOptions) (*runtime.Poller[VirtualMachineScaleSetsClientStartResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.start(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[VirtualMachineScaleSetsClientStartResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[VirtualMachineScaleSetsClientStartResponse](options.ResumeToken, client.pl, nil) - } -} - -// Start - Starts one or more virtual machines in a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *VirtualMachineScaleSetsClient) start(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginStartOptions) (*http.Response, error) { - req, err := client.startCreateRequest(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// startCreateRequest creates the Start request. -func (client *VirtualMachineScaleSetsClient) startCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginStartOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/start" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.VMInstanceIDs != nil { - return req, runtime.MarshalAsJSON(req, *options.VMInstanceIDs) - } - return req, nil -} - -// BeginUpdate - Update a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmScaleSetName - The name of the VM scale set to create or update. -// parameters - The scale set object. -// options - VirtualMachineScaleSetsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginUpdate -// method. -func (client *VirtualMachineScaleSetsClient) BeginUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, parameters VirtualMachineScaleSetUpdate, options *VirtualMachineScaleSetsClientBeginUpdateOptions) (*runtime.Poller[VirtualMachineScaleSetsClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, vmScaleSetName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[VirtualMachineScaleSetsClientUpdateResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[VirtualMachineScaleSetsClientUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// Update - Update a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *VirtualMachineScaleSetsClient) update(ctx context.Context, resourceGroupName string, vmScaleSetName string, parameters VirtualMachineScaleSetUpdate, options *VirtualMachineScaleSetsClientBeginUpdateOptions) (*http.Response, error) { - req, err := client.updateCreateRequest(ctx, resourceGroupName, vmScaleSetName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// updateCreateRequest creates the Update request. -func (client *VirtualMachineScaleSetsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, parameters VirtualMachineScaleSetUpdate, options *VirtualMachineScaleSetsClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginUpdateInstances - Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmScaleSetName - The name of the VM scale set. -// vmInstanceIDs - A list of virtual machine instance IDs from the VM scale set. -// options - VirtualMachineScaleSetsClientBeginUpdateInstancesOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginUpdateInstances -// method. -func (client *VirtualMachineScaleSetsClient) BeginUpdateInstances(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs, options *VirtualMachineScaleSetsClientBeginUpdateInstancesOptions) (*runtime.Poller[VirtualMachineScaleSetsClientUpdateInstancesResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.updateInstances(ctx, resourceGroupName, vmScaleSetName, vmInstanceIDs, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[VirtualMachineScaleSetsClientUpdateInstancesResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[VirtualMachineScaleSetsClientUpdateInstancesResponse](options.ResumeToken, client.pl, nil) - } -} - -// UpdateInstances - Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *VirtualMachineScaleSetsClient) updateInstances(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs, options *VirtualMachineScaleSetsClientBeginUpdateInstancesOptions) (*http.Response, error) { - req, err := client.updateInstancesCreateRequest(ctx, resourceGroupName, vmScaleSetName, vmInstanceIDs, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// updateInstancesCreateRequest creates the UpdateInstances request. -func (client *VirtualMachineScaleSetsClient) updateInstancesCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs, options *VirtualMachineScaleSetsClientBeginUpdateInstancesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/manualupgrade" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, vmInstanceIDs) -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_virtualmachinescalesetvmextensions_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_virtualmachinescalesetvmextensions_client.go deleted file mode 100644 index eb3d4c83..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_virtualmachinescalesetvmextensions_client.go +++ /dev/null @@ -1,412 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// VirtualMachineScaleSetVMExtensionsClient contains the methods for the VirtualMachineScaleSetVMExtensions group. -// Don't use this type directly, use NewVirtualMachineScaleSetVMExtensionsClient() instead. -type VirtualMachineScaleSetVMExtensionsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewVirtualMachineScaleSetVMExtensionsClient creates a new instance of VirtualMachineScaleSetVMExtensionsClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewVirtualMachineScaleSetVMExtensionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachineScaleSetVMExtensionsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &VirtualMachineScaleSetVMExtensionsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - The operation to create or update the VMSS VM extension. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmScaleSetName - The name of the VM scale set. -// instanceID - The instance ID of the virtual machine. -// vmExtensionName - The name of the virtual machine extension. -// extensionParameters - Parameters supplied to the Create Virtual Machine Extension operation. -// options - VirtualMachineScaleSetVMExtensionsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineScaleSetVMExtensionsClient.BeginCreateOrUpdate -// method. -func (client *VirtualMachineScaleSetVMExtensionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, vmExtensionName string, extensionParameters VirtualMachineScaleSetVMExtension, options *VirtualMachineScaleSetVMExtensionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualMachineScaleSetVMExtensionsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, vmScaleSetName, instanceID, vmExtensionName, extensionParameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[VirtualMachineScaleSetVMExtensionsClientCreateOrUpdateResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[VirtualMachineScaleSetVMExtensionsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - The operation to create or update the VMSS VM extension. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *VirtualMachineScaleSetVMExtensionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, vmExtensionName string, extensionParameters VirtualMachineScaleSetVMExtension, options *VirtualMachineScaleSetVMExtensionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, vmExtensionName, extensionParameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *VirtualMachineScaleSetVMExtensionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, vmExtensionName string, extensionParameters VirtualMachineScaleSetVMExtension, options *VirtualMachineScaleSetVMExtensionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if vmExtensionName == "" { - return nil, errors.New("parameter vmExtensionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmExtensionName}", url.PathEscape(vmExtensionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, extensionParameters) -} - -// BeginDelete - The operation to delete the VMSS VM extension. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmScaleSetName - The name of the VM scale set. -// instanceID - The instance ID of the virtual machine. -// vmExtensionName - The name of the virtual machine extension. -// options - VirtualMachineScaleSetVMExtensionsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineScaleSetVMExtensionsClient.BeginDelete -// method. -func (client *VirtualMachineScaleSetVMExtensionsClient) BeginDelete(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, vmExtensionName string, options *VirtualMachineScaleSetVMExtensionsClientBeginDeleteOptions) (*runtime.Poller[VirtualMachineScaleSetVMExtensionsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, vmScaleSetName, instanceID, vmExtensionName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[VirtualMachineScaleSetVMExtensionsClientDeleteResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[VirtualMachineScaleSetVMExtensionsClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - The operation to delete the VMSS VM extension. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *VirtualMachineScaleSetVMExtensionsClient) deleteOperation(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, vmExtensionName string, options *VirtualMachineScaleSetVMExtensionsClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, vmExtensionName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *VirtualMachineScaleSetVMExtensionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, vmExtensionName string, options *VirtualMachineScaleSetVMExtensionsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if vmExtensionName == "" { - return nil, errors.New("parameter vmExtensionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmExtensionName}", url.PathEscape(vmExtensionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - The operation to get the VMSS VM extension. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmScaleSetName - The name of the VM scale set. -// instanceID - The instance ID of the virtual machine. -// vmExtensionName - The name of the virtual machine extension. -// options - VirtualMachineScaleSetVMExtensionsClientGetOptions contains the optional parameters for the VirtualMachineScaleSetVMExtensionsClient.Get -// method. -func (client *VirtualMachineScaleSetVMExtensionsClient) Get(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, vmExtensionName string, options *VirtualMachineScaleSetVMExtensionsClientGetOptions) (VirtualMachineScaleSetVMExtensionsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, vmExtensionName, options) - if err != nil { - return VirtualMachineScaleSetVMExtensionsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualMachineScaleSetVMExtensionsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualMachineScaleSetVMExtensionsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *VirtualMachineScaleSetVMExtensionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, vmExtensionName string, options *VirtualMachineScaleSetVMExtensionsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if vmExtensionName == "" { - return nil, errors.New("parameter vmExtensionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmExtensionName}", url.PathEscape(vmExtensionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *VirtualMachineScaleSetVMExtensionsClient) getHandleResponse(resp *http.Response) (VirtualMachineScaleSetVMExtensionsClientGetResponse, error) { - result := VirtualMachineScaleSetVMExtensionsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineScaleSetVMExtension); err != nil { - return VirtualMachineScaleSetVMExtensionsClientGetResponse{}, err - } - return result, nil -} - -// List - The operation to get all extensions of an instance in Virtual Machine Scaleset. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmScaleSetName - The name of the VM scale set. -// instanceID - The instance ID of the virtual machine. -// options - VirtualMachineScaleSetVMExtensionsClientListOptions contains the optional parameters for the VirtualMachineScaleSetVMExtensionsClient.List -// method. -func (client *VirtualMachineScaleSetVMExtensionsClient) List(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMExtensionsClientListOptions) (VirtualMachineScaleSetVMExtensionsClientListResponse, error) { - req, err := client.listCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return VirtualMachineScaleSetVMExtensionsClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualMachineScaleSetVMExtensionsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualMachineScaleSetVMExtensionsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) -} - -// listCreateRequest creates the List request. -func (client *VirtualMachineScaleSetVMExtensionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMExtensionsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *VirtualMachineScaleSetVMExtensionsClient) listHandleResponse(resp *http.Response) (VirtualMachineScaleSetVMExtensionsClientListResponse, error) { - result := VirtualMachineScaleSetVMExtensionsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineScaleSetVMExtensionsListResult); err != nil { - return VirtualMachineScaleSetVMExtensionsClientListResponse{}, err - } - return result, nil -} - -// BeginUpdate - The operation to update the VMSS VM extension. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmScaleSetName - The name of the VM scale set. -// instanceID - The instance ID of the virtual machine. -// vmExtensionName - The name of the virtual machine extension. -// extensionParameters - Parameters supplied to the Update Virtual Machine Extension operation. -// options - VirtualMachineScaleSetVMExtensionsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineScaleSetVMExtensionsClient.BeginUpdate -// method. -func (client *VirtualMachineScaleSetVMExtensionsClient) BeginUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, vmExtensionName string, extensionParameters VirtualMachineScaleSetVMExtensionUpdate, options *VirtualMachineScaleSetVMExtensionsClientBeginUpdateOptions) (*runtime.Poller[VirtualMachineScaleSetVMExtensionsClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, vmScaleSetName, instanceID, vmExtensionName, extensionParameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[VirtualMachineScaleSetVMExtensionsClientUpdateResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[VirtualMachineScaleSetVMExtensionsClientUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// Update - The operation to update the VMSS VM extension. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *VirtualMachineScaleSetVMExtensionsClient) update(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, vmExtensionName string, extensionParameters VirtualMachineScaleSetVMExtensionUpdate, options *VirtualMachineScaleSetVMExtensionsClientBeginUpdateOptions) (*http.Response, error) { - req, err := client.updateCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, vmExtensionName, extensionParameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// updateCreateRequest creates the Update request. -func (client *VirtualMachineScaleSetVMExtensionsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, vmExtensionName string, extensionParameters VirtualMachineScaleSetVMExtensionUpdate, options *VirtualMachineScaleSetVMExtensionsClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if vmExtensionName == "" { - return nil, errors.New("parameter vmExtensionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmExtensionName}", url.PathEscape(vmExtensionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, extensionParameters) -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_virtualmachinescalesetvmruncommands_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_virtualmachinescalesetvmruncommands_client.go deleted file mode 100644 index 0476b357..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_virtualmachinescalesetvmruncommands_client.go +++ /dev/null @@ -1,425 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// VirtualMachineScaleSetVMRunCommandsClient contains the methods for the VirtualMachineScaleSetVMRunCommands group. -// Don't use this type directly, use NewVirtualMachineScaleSetVMRunCommandsClient() instead. -type VirtualMachineScaleSetVMRunCommandsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewVirtualMachineScaleSetVMRunCommandsClient creates a new instance of VirtualMachineScaleSetVMRunCommandsClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewVirtualMachineScaleSetVMRunCommandsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachineScaleSetVMRunCommandsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &VirtualMachineScaleSetVMRunCommandsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - The operation to create or update the VMSS VM run command. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmScaleSetName - The name of the VM scale set. -// instanceID - The instance ID of the virtual machine. -// runCommandName - The name of the virtual machine run command. -// runCommand - Parameters supplied to the Create Virtual Machine RunCommand operation. -// options - VirtualMachineScaleSetVMRunCommandsClientBeginCreateOrUpdateOptions contains the optional parameters for the -// VirtualMachineScaleSetVMRunCommandsClient.BeginCreateOrUpdate method. -func (client *VirtualMachineScaleSetVMRunCommandsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, runCommandName string, runCommand VirtualMachineRunCommand, options *VirtualMachineScaleSetVMRunCommandsClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualMachineScaleSetVMRunCommandsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, vmScaleSetName, instanceID, runCommandName, runCommand, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[VirtualMachineScaleSetVMRunCommandsClientCreateOrUpdateResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[VirtualMachineScaleSetVMRunCommandsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - The operation to create or update the VMSS VM run command. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *VirtualMachineScaleSetVMRunCommandsClient) createOrUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, runCommandName string, runCommand VirtualMachineRunCommand, options *VirtualMachineScaleSetVMRunCommandsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, runCommandName, runCommand, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *VirtualMachineScaleSetVMRunCommandsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, runCommandName string, runCommand VirtualMachineRunCommand, options *VirtualMachineScaleSetVMRunCommandsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if runCommandName == "" { - return nil, errors.New("parameter runCommandName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{runCommandName}", url.PathEscape(runCommandName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json, text/json"} - return req, runtime.MarshalAsJSON(req, runCommand) -} - -// BeginDelete - The operation to delete the VMSS VM run command. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmScaleSetName - The name of the VM scale set. -// instanceID - The instance ID of the virtual machine. -// runCommandName - The name of the virtual machine run command. -// options - VirtualMachineScaleSetVMRunCommandsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineScaleSetVMRunCommandsClient.BeginDelete -// method. -func (client *VirtualMachineScaleSetVMRunCommandsClient) BeginDelete(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, runCommandName string, options *VirtualMachineScaleSetVMRunCommandsClientBeginDeleteOptions) (*runtime.Poller[VirtualMachineScaleSetVMRunCommandsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, vmScaleSetName, instanceID, runCommandName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[VirtualMachineScaleSetVMRunCommandsClientDeleteResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[VirtualMachineScaleSetVMRunCommandsClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - The operation to delete the VMSS VM run command. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *VirtualMachineScaleSetVMRunCommandsClient) deleteOperation(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, runCommandName string, options *VirtualMachineScaleSetVMRunCommandsClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, runCommandName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *VirtualMachineScaleSetVMRunCommandsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, runCommandName string, options *VirtualMachineScaleSetVMRunCommandsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if runCommandName == "" { - return nil, errors.New("parameter runCommandName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{runCommandName}", url.PathEscape(runCommandName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json, text/json"} - return req, nil -} - -// Get - The operation to get the VMSS VM run command. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmScaleSetName - The name of the VM scale set. -// instanceID - The instance ID of the virtual machine. -// runCommandName - The name of the virtual machine run command. -// options - VirtualMachineScaleSetVMRunCommandsClientGetOptions contains the optional parameters for the VirtualMachineScaleSetVMRunCommandsClient.Get -// method. -func (client *VirtualMachineScaleSetVMRunCommandsClient) Get(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, runCommandName string, options *VirtualMachineScaleSetVMRunCommandsClientGetOptions) (VirtualMachineScaleSetVMRunCommandsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, runCommandName, options) - if err != nil { - return VirtualMachineScaleSetVMRunCommandsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualMachineScaleSetVMRunCommandsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualMachineScaleSetVMRunCommandsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *VirtualMachineScaleSetVMRunCommandsClient) getCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, runCommandName string, options *VirtualMachineScaleSetVMRunCommandsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if runCommandName == "" { - return nil, errors.New("parameter runCommandName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{runCommandName}", url.PathEscape(runCommandName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json, text/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *VirtualMachineScaleSetVMRunCommandsClient) getHandleResponse(resp *http.Response) (VirtualMachineScaleSetVMRunCommandsClientGetResponse, error) { - result := VirtualMachineScaleSetVMRunCommandsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineRunCommand); err != nil { - return VirtualMachineScaleSetVMRunCommandsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - The operation to get all run commands of an instance in Virtual Machine Scaleset. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmScaleSetName - The name of the VM scale set. -// instanceID - The instance ID of the virtual machine. -// options - VirtualMachineScaleSetVMRunCommandsClientListOptions contains the optional parameters for the VirtualMachineScaleSetVMRunCommandsClient.List -// method. -func (client *VirtualMachineScaleSetVMRunCommandsClient) NewListPager(resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMRunCommandsClientListOptions) *runtime.Pager[VirtualMachineScaleSetVMRunCommandsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualMachineScaleSetVMRunCommandsClientListResponse]{ - More: func(page VirtualMachineScaleSetVMRunCommandsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VirtualMachineScaleSetVMRunCommandsClientListResponse) (VirtualMachineScaleSetVMRunCommandsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return VirtualMachineScaleSetVMRunCommandsClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualMachineScaleSetVMRunCommandsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualMachineScaleSetVMRunCommandsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *VirtualMachineScaleSetVMRunCommandsClient) listCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMRunCommandsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json, text/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *VirtualMachineScaleSetVMRunCommandsClient) listHandleResponse(resp *http.Response) (VirtualMachineScaleSetVMRunCommandsClientListResponse, error) { - result := VirtualMachineScaleSetVMRunCommandsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineRunCommandsListResult); err != nil { - return VirtualMachineScaleSetVMRunCommandsClientListResponse{}, err - } - return result, nil -} - -// BeginUpdate - The operation to update the VMSS VM run command. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmScaleSetName - The name of the VM scale set. -// instanceID - The instance ID of the virtual machine. -// runCommandName - The name of the virtual machine run command. -// runCommand - Parameters supplied to the Update Virtual Machine RunCommand operation. -// options - VirtualMachineScaleSetVMRunCommandsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineScaleSetVMRunCommandsClient.BeginUpdate -// method. -func (client *VirtualMachineScaleSetVMRunCommandsClient) BeginUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, runCommandName string, runCommand VirtualMachineRunCommandUpdate, options *VirtualMachineScaleSetVMRunCommandsClientBeginUpdateOptions) (*runtime.Poller[VirtualMachineScaleSetVMRunCommandsClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, vmScaleSetName, instanceID, runCommandName, runCommand, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[VirtualMachineScaleSetVMRunCommandsClientUpdateResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[VirtualMachineScaleSetVMRunCommandsClientUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// Update - The operation to update the VMSS VM run command. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *VirtualMachineScaleSetVMRunCommandsClient) update(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, runCommandName string, runCommand VirtualMachineRunCommandUpdate, options *VirtualMachineScaleSetVMRunCommandsClientBeginUpdateOptions) (*http.Response, error) { - req, err := client.updateCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, runCommandName, runCommand, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// updateCreateRequest creates the Update request. -func (client *VirtualMachineScaleSetVMRunCommandsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, runCommandName string, runCommand VirtualMachineRunCommandUpdate, options *VirtualMachineScaleSetVMRunCommandsClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if runCommandName == "" { - return nil, errors.New("parameter runCommandName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{runCommandName}", url.PathEscape(runCommandName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json, text/json"} - return req, runtime.MarshalAsJSON(req, runCommand) -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_virtualmachinescalesetvms_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_virtualmachinescalesetvms_client.go deleted file mode 100644 index 32b2b3a2..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_virtualmachinescalesetvms_client.go +++ /dev/null @@ -1,1155 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strconv" - "strings" -) - -// VirtualMachineScaleSetVMsClient contains the methods for the VirtualMachineScaleSetVMs group. -// Don't use this type directly, use NewVirtualMachineScaleSetVMsClient() instead. -type VirtualMachineScaleSetVMsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewVirtualMachineScaleSetVMsClient creates a new instance of VirtualMachineScaleSetVMsClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewVirtualMachineScaleSetVMsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachineScaleSetVMsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &VirtualMachineScaleSetVMsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginDeallocate - Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases -// the compute resources it uses. You are not billed for the compute resources of this virtual -// machine once it is deallocated. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmScaleSetName - The name of the VM scale set. -// instanceID - The instance ID of the virtual machine. -// options - VirtualMachineScaleSetVMsClientBeginDeallocateOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginDeallocate -// method. -func (client *VirtualMachineScaleSetVMsClient) BeginDeallocate(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginDeallocateOptions) (*runtime.Poller[VirtualMachineScaleSetVMsClientDeallocateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deallocate(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[VirtualMachineScaleSetVMsClientDeallocateResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[VirtualMachineScaleSetVMsClientDeallocateResponse](options.ResumeToken, client.pl, nil) - } -} - -// Deallocate - Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the -// compute resources it uses. You are not billed for the compute resources of this virtual -// machine once it is deallocated. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *VirtualMachineScaleSetVMsClient) deallocate(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginDeallocateOptions) (*http.Response, error) { - req, err := client.deallocateCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deallocateCreateRequest creates the Deallocate request. -func (client *VirtualMachineScaleSetVMsClient) deallocateCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginDeallocateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/deallocate" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginDelete - Deletes a virtual machine from a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmScaleSetName - The name of the VM scale set. -// instanceID - The instance ID of the virtual machine. -// options - VirtualMachineScaleSetVMsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginDelete -// method. -func (client *VirtualMachineScaleSetVMsClient) BeginDelete(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginDeleteOptions) (*runtime.Poller[VirtualMachineScaleSetVMsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[VirtualMachineScaleSetVMsClientDeleteResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[VirtualMachineScaleSetVMsClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes a virtual machine from a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *VirtualMachineScaleSetVMsClient) deleteOperation(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *VirtualMachineScaleSetVMsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.ForceDeletion != nil { - reqQP.Set("forceDeletion", strconv.FormatBool(*options.ForceDeletion)) - } - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets a virtual machine from a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmScaleSetName - The name of the VM scale set. -// instanceID - The instance ID of the virtual machine. -// options - VirtualMachineScaleSetVMsClientGetOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.Get -// method. -func (client *VirtualMachineScaleSetVMsClient) Get(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientGetOptions) (VirtualMachineScaleSetVMsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return VirtualMachineScaleSetVMsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualMachineScaleSetVMsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualMachineScaleSetVMsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *VirtualMachineScaleSetVMsClient) getCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", string(*options.Expand)) - } - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *VirtualMachineScaleSetVMsClient) getHandleResponse(resp *http.Response) (VirtualMachineScaleSetVMsClientGetResponse, error) { - result := VirtualMachineScaleSetVMsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineScaleSetVM); err != nil { - return VirtualMachineScaleSetVMsClientGetResponse{}, err - } - return result, nil -} - -// GetInstanceView - Gets the status of a virtual machine from a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmScaleSetName - The name of the VM scale set. -// instanceID - The instance ID of the virtual machine. -// options - VirtualMachineScaleSetVMsClientGetInstanceViewOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.GetInstanceView -// method. -func (client *VirtualMachineScaleSetVMsClient) GetInstanceView(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientGetInstanceViewOptions) (VirtualMachineScaleSetVMsClientGetInstanceViewResponse, error) { - req, err := client.getInstanceViewCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return VirtualMachineScaleSetVMsClientGetInstanceViewResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualMachineScaleSetVMsClientGetInstanceViewResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualMachineScaleSetVMsClientGetInstanceViewResponse{}, runtime.NewResponseError(resp) - } - return client.getInstanceViewHandleResponse(resp) -} - -// getInstanceViewCreateRequest creates the GetInstanceView request. -func (client *VirtualMachineScaleSetVMsClient) getInstanceViewCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientGetInstanceViewOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/instanceView" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getInstanceViewHandleResponse handles the GetInstanceView response. -func (client *VirtualMachineScaleSetVMsClient) getInstanceViewHandleResponse(resp *http.Response) (VirtualMachineScaleSetVMsClientGetInstanceViewResponse, error) { - result := VirtualMachineScaleSetVMsClientGetInstanceViewResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineScaleSetVMInstanceView); err != nil { - return VirtualMachineScaleSetVMsClientGetInstanceViewResponse{}, err - } - return result, nil -} - -// NewListPager - Gets a list of all virtual machines in a VM scale sets. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// virtualMachineScaleSetName - The name of the VM scale set. -// options - VirtualMachineScaleSetVMsClientListOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.List -// method. -func (client *VirtualMachineScaleSetVMsClient) NewListPager(resourceGroupName string, virtualMachineScaleSetName string, options *VirtualMachineScaleSetVMsClientListOptions) *runtime.Pager[VirtualMachineScaleSetVMsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualMachineScaleSetVMsClientListResponse]{ - More: func(page VirtualMachineScaleSetVMsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VirtualMachineScaleSetVMsClientListResponse) (VirtualMachineScaleSetVMsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, virtualMachineScaleSetName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return VirtualMachineScaleSetVMsClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualMachineScaleSetVMsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualMachineScaleSetVMsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *VirtualMachineScaleSetVMsClient) listCreateRequest(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, options *VirtualMachineScaleSetVMsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualMachineScaleSetName == "" { - return nil, errors.New("parameter virtualMachineScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualMachineScaleSetName}", url.PathEscape(virtualMachineScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Filter != nil { - reqQP.Set("$filter", *options.Filter) - } - if options != nil && options.Select != nil { - reqQP.Set("$select", *options.Select) - } - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *VirtualMachineScaleSetVMsClient) listHandleResponse(resp *http.Response) (VirtualMachineScaleSetVMsClientListResponse, error) { - result := VirtualMachineScaleSetVMsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineScaleSetVMListResult); err != nil { - return VirtualMachineScaleSetVMsClientListResponse{}, err - } - return result, nil -} - -// BeginPerformMaintenance - Performs maintenance on a virtual machine in a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmScaleSetName - The name of the VM scale set. -// instanceID - The instance ID of the virtual machine. -// options - VirtualMachineScaleSetVMsClientBeginPerformMaintenanceOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginPerformMaintenance -// method. -func (client *VirtualMachineScaleSetVMsClient) BeginPerformMaintenance(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginPerformMaintenanceOptions) (*runtime.Poller[VirtualMachineScaleSetVMsClientPerformMaintenanceResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.performMaintenance(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[VirtualMachineScaleSetVMsClientPerformMaintenanceResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[VirtualMachineScaleSetVMsClientPerformMaintenanceResponse](options.ResumeToken, client.pl, nil) - } -} - -// PerformMaintenance - Performs maintenance on a virtual machine in a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *VirtualMachineScaleSetVMsClient) performMaintenance(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginPerformMaintenanceOptions) (*http.Response, error) { - req, err := client.performMaintenanceCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// performMaintenanceCreateRequest creates the PerformMaintenance request. -func (client *VirtualMachineScaleSetVMsClient) performMaintenanceCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginPerformMaintenanceOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/performMaintenance" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginPowerOff - 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. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmScaleSetName - The name of the VM scale set. -// instanceID - The instance ID of the virtual machine. -// options - VirtualMachineScaleSetVMsClientBeginPowerOffOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginPowerOff -// method. -func (client *VirtualMachineScaleSetVMsClient) BeginPowerOff(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginPowerOffOptions) (*runtime.Poller[VirtualMachineScaleSetVMsClientPowerOffResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.powerOff(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[VirtualMachineScaleSetVMsClientPowerOffResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[VirtualMachineScaleSetVMsClientPowerOffResponse](options.ResumeToken, client.pl, nil) - } -} - -// 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. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *VirtualMachineScaleSetVMsClient) powerOff(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginPowerOffOptions) (*http.Response, error) { - req, err := client.powerOffCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// powerOffCreateRequest creates the PowerOff request. -func (client *VirtualMachineScaleSetVMsClient) powerOffCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginPowerOffOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/poweroff" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.SkipShutdown != nil { - reqQP.Set("skipShutdown", strconv.FormatBool(*options.SkipShutdown)) - } - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginRedeploy - Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it -// back on. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmScaleSetName - The name of the VM scale set. -// instanceID - The instance ID of the virtual machine. -// options - VirtualMachineScaleSetVMsClientBeginRedeployOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginRedeploy -// method. -func (client *VirtualMachineScaleSetVMsClient) BeginRedeploy(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginRedeployOptions) (*runtime.Poller[VirtualMachineScaleSetVMsClientRedeployResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.redeploy(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[VirtualMachineScaleSetVMsClientRedeployResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[VirtualMachineScaleSetVMsClientRedeployResponse](options.ResumeToken, client.pl, nil) - } -} - -// Redeploy - Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back -// on. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *VirtualMachineScaleSetVMsClient) redeploy(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginRedeployOptions) (*http.Response, error) { - req, err := client.redeployCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// redeployCreateRequest creates the Redeploy request. -func (client *VirtualMachineScaleSetVMsClient) redeployCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginRedeployOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/redeploy" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginReimage - Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmScaleSetName - The name of the VM scale set. -// instanceID - The instance ID of the virtual machine. -// options - VirtualMachineScaleSetVMsClientBeginReimageOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginReimage -// method. -func (client *VirtualMachineScaleSetVMsClient) BeginReimage(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginReimageOptions) (*runtime.Poller[VirtualMachineScaleSetVMsClientReimageResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.reimage(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[VirtualMachineScaleSetVMsClientReimageResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[VirtualMachineScaleSetVMsClientReimageResponse](options.ResumeToken, client.pl, nil) - } -} - -// Reimage - Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *VirtualMachineScaleSetVMsClient) reimage(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginReimageOptions) (*http.Response, error) { - req, err := client.reimageCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// reimageCreateRequest creates the Reimage request. -func (client *VirtualMachineScaleSetVMsClient) reimageCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginReimageOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/reimage" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.VMScaleSetVMReimageInput != nil { - return req, runtime.MarshalAsJSON(req, *options.VMScaleSetVMReimageInput) - } - return req, nil -} - -// BeginReimageAll - 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. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmScaleSetName - The name of the VM scale set. -// instanceID - The instance ID of the virtual machine. -// options - VirtualMachineScaleSetVMsClientBeginReimageAllOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginReimageAll -// method. -func (client *VirtualMachineScaleSetVMsClient) BeginReimageAll(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginReimageAllOptions) (*runtime.Poller[VirtualMachineScaleSetVMsClientReimageAllResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.reimageAll(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[VirtualMachineScaleSetVMsClientReimageAllResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[VirtualMachineScaleSetVMsClientReimageAllResponse](options.ResumeToken, client.pl, nil) - } -} - -// 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. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *VirtualMachineScaleSetVMsClient) reimageAll(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginReimageAllOptions) (*http.Response, error) { - req, err := client.reimageAllCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// reimageAllCreateRequest creates the ReimageAll request. -func (client *VirtualMachineScaleSetVMsClient) reimageAllCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginReimageAllOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/reimageall" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginRestart - Restarts a virtual machine in a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmScaleSetName - The name of the VM scale set. -// instanceID - The instance ID of the virtual machine. -// options - VirtualMachineScaleSetVMsClientBeginRestartOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginRestart -// method. -func (client *VirtualMachineScaleSetVMsClient) BeginRestart(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginRestartOptions) (*runtime.Poller[VirtualMachineScaleSetVMsClientRestartResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.restart(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[VirtualMachineScaleSetVMsClientRestartResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[VirtualMachineScaleSetVMsClientRestartResponse](options.ResumeToken, client.pl, nil) - } -} - -// Restart - Restarts a virtual machine in a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *VirtualMachineScaleSetVMsClient) restart(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginRestartOptions) (*http.Response, error) { - req, err := client.restartCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// restartCreateRequest creates the Restart request. -func (client *VirtualMachineScaleSetVMsClient) restartCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginRestartOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/restart" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// RetrieveBootDiagnosticsData - The operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM -// scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmScaleSetName - The name of the VM scale set. -// instanceID - The instance ID of the virtual machine. -// options - VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.RetrieveBootDiagnosticsData -// method. -func (client *VirtualMachineScaleSetVMsClient) RetrieveBootDiagnosticsData(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataOptions) (VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataResponse, error) { - req, err := client.retrieveBootDiagnosticsDataCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataResponse{}, runtime.NewResponseError(resp) - } - return client.retrieveBootDiagnosticsDataHandleResponse(resp) -} - -// retrieveBootDiagnosticsDataCreateRequest creates the RetrieveBootDiagnosticsData request. -func (client *VirtualMachineScaleSetVMsClient) retrieveBootDiagnosticsDataCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/retrieveBootDiagnosticsData" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.SasURIExpirationTimeInMinutes != nil { - reqQP.Set("sasUriExpirationTimeInMinutes", strconv.FormatInt(int64(*options.SasURIExpirationTimeInMinutes), 10)) - } - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// retrieveBootDiagnosticsDataHandleResponse handles the RetrieveBootDiagnosticsData response. -func (client *VirtualMachineScaleSetVMsClient) retrieveBootDiagnosticsDataHandleResponse(resp *http.Response) (VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataResponse, error) { - result := VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RetrieveBootDiagnosticsDataResult); err != nil { - return VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataResponse{}, err - } - return result, nil -} - -// BeginRunCommand - Run command on a virtual machine in a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmScaleSetName - The name of the VM scale set. -// instanceID - The instance ID of the virtual machine. -// parameters - Parameters supplied to the Run command operation. -// options - VirtualMachineScaleSetVMsClientBeginRunCommandOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginRunCommand -// method. -func (client *VirtualMachineScaleSetVMsClient) BeginRunCommand(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, parameters RunCommandInput, options *VirtualMachineScaleSetVMsClientBeginRunCommandOptions) (*runtime.Poller[VirtualMachineScaleSetVMsClientRunCommandResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.runCommand(ctx, resourceGroupName, vmScaleSetName, instanceID, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VirtualMachineScaleSetVMsClientRunCommandResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[VirtualMachineScaleSetVMsClientRunCommandResponse](options.ResumeToken, client.pl, nil) - } -} - -// RunCommand - Run command on a virtual machine in a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *VirtualMachineScaleSetVMsClient) runCommand(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, parameters RunCommandInput, options *VirtualMachineScaleSetVMsClientBeginRunCommandOptions) (*http.Response, error) { - req, err := client.runCommandCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// runCommandCreateRequest creates the RunCommand request. -func (client *VirtualMachineScaleSetVMsClient) runCommandCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, parameters RunCommandInput, options *VirtualMachineScaleSetVMsClientBeginRunCommandOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/runCommand" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json, text/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// SimulateEviction - The operation to simulate the eviction of spot virtual machine in a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmScaleSetName - The name of the VM scale set. -// instanceID - The instance ID of the virtual machine. -// options - VirtualMachineScaleSetVMsClientSimulateEvictionOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.SimulateEviction -// method. -func (client *VirtualMachineScaleSetVMsClient) SimulateEviction(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientSimulateEvictionOptions) (VirtualMachineScaleSetVMsClientSimulateEvictionResponse, error) { - req, err := client.simulateEvictionCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return VirtualMachineScaleSetVMsClientSimulateEvictionResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualMachineScaleSetVMsClientSimulateEvictionResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusNoContent) { - return VirtualMachineScaleSetVMsClientSimulateEvictionResponse{}, runtime.NewResponseError(resp) - } - return VirtualMachineScaleSetVMsClientSimulateEvictionResponse{}, nil -} - -// simulateEvictionCreateRequest creates the SimulateEviction request. -func (client *VirtualMachineScaleSetVMsClient) simulateEvictionCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientSimulateEvictionOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/simulateEviction" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginStart - Starts a virtual machine in a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmScaleSetName - The name of the VM scale set. -// instanceID - The instance ID of the virtual machine. -// options - VirtualMachineScaleSetVMsClientBeginStartOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginStart -// method. -func (client *VirtualMachineScaleSetVMsClient) BeginStart(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginStartOptions) (*runtime.Poller[VirtualMachineScaleSetVMsClientStartResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.start(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[VirtualMachineScaleSetVMsClientStartResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[VirtualMachineScaleSetVMsClientStartResponse](options.ResumeToken, client.pl, nil) - } -} - -// Start - Starts a virtual machine in a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *VirtualMachineScaleSetVMsClient) start(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginStartOptions) (*http.Response, error) { - req, err := client.startCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// startCreateRequest creates the Start request. -func (client *VirtualMachineScaleSetVMsClient) startCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginStartOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/start" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginUpdate - Updates a virtual machine of a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. -// vmScaleSetName - The name of the VM scale set where the extension should be create or updated. -// instanceID - The instance ID of the virtual machine. -// parameters - Parameters supplied to the Update Virtual Machine Scale Sets VM operation. -// options - VirtualMachineScaleSetVMsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginUpdate -// method. -func (client *VirtualMachineScaleSetVMsClient) BeginUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, parameters VirtualMachineScaleSetVM, options *VirtualMachineScaleSetVMsClientBeginUpdateOptions) (*runtime.Poller[VirtualMachineScaleSetVMsClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, vmScaleSetName, instanceID, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[VirtualMachineScaleSetVMsClientUpdateResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[VirtualMachineScaleSetVMsClientUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// Update - Updates a virtual machine of a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -func (client *VirtualMachineScaleSetVMsClient) update(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, parameters VirtualMachineScaleSetVM, options *VirtualMachineScaleSetVMsClientBeginUpdateOptions) (*http.Response, error) { - req, err := client.updateCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// updateCreateRequest creates the Update request. -func (client *VirtualMachineScaleSetVMsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, parameters VirtualMachineScaleSetVM, options *VirtualMachineScaleSetVMsClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_virtualmachinesizes_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_virtualmachinesizes_client.go deleted file mode 100644 index 8add0cc3..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/zz_generated_virtualmachinesizes_client.go +++ /dev/null @@ -1,115 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// VirtualMachineSizesClient contains the methods for the VirtualMachineSizes group. -// Don't use this type directly, use NewVirtualMachineSizesClient() instead. -type VirtualMachineSizesClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewVirtualMachineSizesClient creates a new instance of VirtualMachineSizesClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewVirtualMachineSizesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachineSizesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &VirtualMachineSizesClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// NewListPager - This API is deprecated. Use Resources Skus [https://docs.microsoft.com/rest/api/compute/resourceskus/list] -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// location - The location upon which virtual-machine-sizes is queried. -// options - VirtualMachineSizesClientListOptions contains the optional parameters for the VirtualMachineSizesClient.List -// method. -func (client *VirtualMachineSizesClient) NewListPager(location string, options *VirtualMachineSizesClientListOptions) *runtime.Pager[VirtualMachineSizesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualMachineSizesClientListResponse]{ - More: func(page VirtualMachineSizesClientListResponse) bool { - return false - }, - Fetcher: func(ctx context.Context, page *VirtualMachineSizesClientListResponse) (VirtualMachineSizesClientListResponse, error) { - req, err := client.listCreateRequest(ctx, location, options) - if err != nil { - return VirtualMachineSizesClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualMachineSizesClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualMachineSizesClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *VirtualMachineSizesClient) listCreateRequest(ctx context.Context, location string, options *VirtualMachineSizesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/vmSizes" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *VirtualMachineSizesClient) listHandleResponse(resp *http.Response) (VirtualMachineSizesClientListResponse, error) { - result := VirtualMachineSizesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineSizeListResult); err != nil { - return VirtualMachineSizesClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/CHANGELOG.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/CHANGELOG.md index b18a1230..1abd1ebf 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/CHANGELOG.md +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/CHANGELOG.md @@ -1,5 +1,594 @@ # Release History +## 4.8.0 (2024-03-22) +### Features Added + +- New struct `ManagedClusterIngressProfile` +- New struct `ManagedClusterIngressProfileWebAppRouting` +- New field `IngressProfile` in struct `ManagedClusterProperties` + + +## 4.8.0-beta.1 (2024-02-23) +### Features Added + +- New value `AgentPoolTypeVirtualMachines` added to enum type `AgentPoolType` +- New value `NetworkPolicyNone` added to enum type `NetworkPolicy` +- New value `NodeOSUpgradeChannelSecurityPatch` added to enum type `NodeOSUpgradeChannel` +- New value `OSSKUMariner`, `OSSKUWindowsAnnual` added to enum type `OSSKU` +- New value `PublicNetworkAccessSecuredByPerimeter` added to enum type `PublicNetworkAccess` +- New value `SnapshotTypeManagedCluster` added to enum type `SnapshotType` +- New value `WorkloadRuntimeKataMshvVMIsolation` added to enum type `WorkloadRuntime` +- New enum type `AddonAutoscaling` with values `AddonAutoscalingDisabled`, `AddonAutoscalingEnabled` +- New enum type `AgentPoolSSHAccess` with values `AgentPoolSSHAccessDisabled`, `AgentPoolSSHAccessLocalUser` +- New enum type `GuardrailsSupport` with values `GuardrailsSupportPreview`, `GuardrailsSupportStable` +- New enum type `IpvsScheduler` with values `IpvsSchedulerLeastConnection`, `IpvsSchedulerRoundRobin` +- New enum type `Level` with values `LevelEnforcement`, `LevelOff`, `LevelWarning` +- New enum type `Mode` with values `ModeIPTABLES`, `ModeIPVS` +- New enum type `NodeProvisioningMode` with values `NodeProvisioningModeAuto`, `NodeProvisioningModeManual` +- New enum type `RestrictionLevel` with values `RestrictionLevelReadOnly`, `RestrictionLevelUnrestricted` +- New enum type `SafeguardsSupport` with values `SafeguardsSupportPreview`, `SafeguardsSupportStable` +- New function `*AgentPoolsClient.BeginDeleteMachines(context.Context, string, string, string, AgentPoolDeleteMachinesParameter, *AgentPoolsClientBeginDeleteMachinesOptions) (*runtime.Poller[AgentPoolsClientDeleteMachinesResponse], error)` +- New function `*ClientFactory.NewMachinesClient() *MachinesClient` +- New function `*ClientFactory.NewManagedClusterSnapshotsClient() *ManagedClusterSnapshotsClient` +- New function `*ClientFactory.NewOperationStatusResultClient() *OperationStatusResultClient` +- New function `NewMachinesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*MachinesClient, error)` +- New function `*MachinesClient.Get(context.Context, string, string, string, string, *MachinesClientGetOptions) (MachinesClientGetResponse, error)` +- New function `*MachinesClient.NewListPager(string, string, string, *MachinesClientListOptions) *runtime.Pager[MachinesClientListResponse]` +- New function `NewManagedClusterSnapshotsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ManagedClusterSnapshotsClient, error)` +- New function `*ManagedClusterSnapshotsClient.CreateOrUpdate(context.Context, string, string, ManagedClusterSnapshot, *ManagedClusterSnapshotsClientCreateOrUpdateOptions) (ManagedClusterSnapshotsClientCreateOrUpdateResponse, error)` +- New function `*ManagedClusterSnapshotsClient.Delete(context.Context, string, string, *ManagedClusterSnapshotsClientDeleteOptions) (ManagedClusterSnapshotsClientDeleteResponse, error)` +- New function `*ManagedClusterSnapshotsClient.Get(context.Context, string, string, *ManagedClusterSnapshotsClientGetOptions) (ManagedClusterSnapshotsClientGetResponse, error)` +- New function `*ManagedClusterSnapshotsClient.NewListByResourceGroupPager(string, *ManagedClusterSnapshotsClientListByResourceGroupOptions) *runtime.Pager[ManagedClusterSnapshotsClientListByResourceGroupResponse]` +- New function `*ManagedClusterSnapshotsClient.NewListPager(*ManagedClusterSnapshotsClientListOptions) *runtime.Pager[ManagedClusterSnapshotsClientListResponse]` +- New function `*ManagedClusterSnapshotsClient.UpdateTags(context.Context, string, string, TagsObject, *ManagedClusterSnapshotsClientUpdateTagsOptions) (ManagedClusterSnapshotsClientUpdateTagsResponse, error)` +- New function `*ManagedClustersClient.GetGuardrailsVersions(context.Context, string, string, *ManagedClustersClientGetGuardrailsVersionsOptions) (ManagedClustersClientGetGuardrailsVersionsResponse, error)` +- New function `*ManagedClustersClient.GetSafeguardsVersions(context.Context, string, string, *ManagedClustersClientGetSafeguardsVersionsOptions) (ManagedClustersClientGetSafeguardsVersionsResponse, error)` +- New function `*ManagedClustersClient.NewListGuardrailsVersionsPager(string, *ManagedClustersClientListGuardrailsVersionsOptions) *runtime.Pager[ManagedClustersClientListGuardrailsVersionsResponse]` +- New function `*ManagedClustersClient.NewListSafeguardsVersionsPager(string, *ManagedClustersClientListSafeguardsVersionsOptions) *runtime.Pager[ManagedClustersClientListSafeguardsVersionsResponse]` +- New function `NewOperationStatusResultClient(string, azcore.TokenCredential, *arm.ClientOptions) (*OperationStatusResultClient, error)` +- New function `*OperationStatusResultClient.Get(context.Context, string, string, string, *OperationStatusResultClientGetOptions) (OperationStatusResultClientGetResponse, error)` +- New function `*OperationStatusResultClient.GetByAgentPool(context.Context, string, string, string, string, *OperationStatusResultClientGetByAgentPoolOptions) (OperationStatusResultClientGetByAgentPoolResponse, error)` +- New function `*OperationStatusResultClient.NewListPager(string, string, *OperationStatusResultClientListOptions) *runtime.Pager[OperationStatusResultClientListResponse]` +- New struct `AgentPoolArtifactStreamingProfile` +- New struct `AgentPoolDeleteMachinesParameter` +- New struct `AgentPoolGPUProfile` +- New struct `AgentPoolSecurityProfile` +- New struct `AgentPoolWindowsProfile` +- New struct `ErrorAdditionalInfo` +- New struct `ErrorDetail` +- New struct `GuardrailsAvailableVersion` +- New struct `GuardrailsAvailableVersionsList` +- New struct `GuardrailsAvailableVersionsProperties` +- New struct `Machine` +- New struct `MachineIPAddress` +- New struct `MachineListResult` +- New struct `MachineNetworkProperties` +- New struct `MachineProperties` +- New struct `ManagedClusterAIToolchainOperatorProfile` +- New struct `ManagedClusterAzureMonitorProfileAppMonitoring` +- New struct `ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics` +- New struct `ManagedClusterAzureMonitorProfileContainerInsights` +- New struct `ManagedClusterAzureMonitorProfileLogs` +- New struct `ManagedClusterAzureMonitorProfileWindowsHostLogs` +- New struct `ManagedClusterCostAnalysis` +- New struct `ManagedClusterIngressProfile` +- New struct `ManagedClusterIngressProfileWebAppRouting` +- New struct `ManagedClusterMetricsProfile` +- New struct `ManagedClusterNodeProvisioningProfile` +- New struct `ManagedClusterNodeResourceGroupProfile` +- New struct `ManagedClusterPropertiesForSnapshot` +- New struct `ManagedClusterSecurityProfileImageIntegrity` +- New struct `ManagedClusterSecurityProfileNodeRestriction` +- New struct `ManagedClusterSnapshot` +- New struct `ManagedClusterSnapshotListResult` +- New struct `ManagedClusterSnapshotProperties` +- New struct `ManualScaleProfile` +- New struct `NetworkMonitoring` +- New struct `NetworkProfileForSnapshot` +- New struct `NetworkProfileKubeProxyConfig` +- New struct `NetworkProfileKubeProxyConfigIpvsConfig` +- New struct `OperationStatusResult` +- New struct `OperationStatusResultList` +- New struct `SafeguardsAvailableVersion` +- New struct `SafeguardsAvailableVersionsList` +- New struct `SafeguardsAvailableVersionsProperties` +- New struct `SafeguardsProfile` +- New struct `ScaleProfile` +- New struct `VirtualMachineNodes` +- New struct `VirtualMachinesProfile` +- New field `IgnorePodDisruptionBudget` in struct `AgentPoolsClientBeginDeleteOptions` +- New field `EnableVnetIntegration`, `SubnetID` in struct `ManagedClusterAPIServerAccessProfile` +- New field `ArtifactStreamingProfile`, `EnableCustomCATrust`, `GpuProfile`, `MessageOfTheDay`, `NodeInitializationTaints`, `SecurityProfile`, `VirtualMachineNodesStatus`, `VirtualMachinesProfile`, `WindowsProfile` in struct `ManagedClusterAgentPoolProfile` +- New field `ArtifactStreamingProfile`, `EnableCustomCATrust`, `GpuProfile`, `MessageOfTheDay`, `NodeInitializationTaints`, `SecurityProfile`, `VirtualMachineNodesStatus`, `VirtualMachinesProfile`, `WindowsProfile` in struct `ManagedClusterAgentPoolProfileProperties` +- New field `Logs` in struct `ManagedClusterAzureMonitorProfile` +- New field `AppMonitoringOpenTelemetryMetrics` in struct `ManagedClusterAzureMonitorProfileMetrics` +- New field `EffectiveNoProxy` in struct `ManagedClusterHTTPProxyConfig` +- New field `AiToolchainOperatorProfile`, `CreationData`, `EnableNamespaceResources`, `IngressProfile`, `MetricsProfile`, `NodeProvisioningProfile`, `NodeResourceGroupProfile`, `SafeguardsProfile` in struct `ManagedClusterProperties` +- New field `DaemonsetEvictionForEmptyNodes`, `DaemonsetEvictionForOccupiedNodes`, `IgnoreDaemonsetsUtilization` in struct `ManagedClusterPropertiesAutoScalerProfile` +- New field `CustomCATrustCertificates`, `ImageIntegrity`, `NodeRestriction` in struct `ManagedClusterSecurityProfile` +- New field `Version` in struct `ManagedClusterStorageProfileDiskCSIDriver` +- New field `AddonAutoscaling` in struct `ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler` +- New field `IgnorePodDisruptionBudget` in struct `ManagedClustersClientBeginDeleteOptions` +- New field `KubeProxyConfig`, `Monitoring` in struct `NetworkProfile` + + +## 4.7.0 (2024-01-26) +### Features Added + +- New field `NodeSoakDurationInMinutes` in struct `AgentPoolUpgradeSettings` + + +## 4.7.0-beta.1 (2023-12-22) +### Features Added + +- New value `AgentPoolTypeVirtualMachines` added to enum type `AgentPoolType` +- New value `NetworkPolicyNone` added to enum type `NetworkPolicy` +- New value `NodeOSUpgradeChannelSecurityPatch` added to enum type `NodeOSUpgradeChannel` +- New value `OSSKUMariner`, `OSSKUWindowsAnnual` added to enum type `OSSKU` +- New value `PublicNetworkAccessSecuredByPerimeter` added to enum type `PublicNetworkAccess` +- New value `SnapshotTypeManagedCluster` added to enum type `SnapshotType` +- New value `WorkloadRuntimeKataMshvVMIsolation` added to enum type `WorkloadRuntime` +- New enum type `AddonAutoscaling` with values `AddonAutoscalingDisabled`, `AddonAutoscalingEnabled` +- New enum type `AgentPoolSSHAccess` with values `AgentPoolSSHAccessDisabled`, `AgentPoolSSHAccessLocalUser` +- New enum type `GuardrailsSupport` with values `GuardrailsSupportPreview`, `GuardrailsSupportStable` +- New enum type `IpvsScheduler` with values `IpvsSchedulerLeastConnection`, `IpvsSchedulerRoundRobin` +- New enum type `Level` with values `LevelEnforcement`, `LevelOff`, `LevelWarning` +- New enum type `Mode` with values `ModeIPTABLES`, `ModeIPVS` +- New enum type `NodeProvisioningMode` with values `NodeProvisioningModeAuto`, `NodeProvisioningModeManual` +- New enum type `RestrictionLevel` with values `RestrictionLevelReadOnly`, `RestrictionLevelUnrestricted` +- New function `*AgentPoolsClient.BeginDeleteMachines(context.Context, string, string, string, AgentPoolDeleteMachinesParameter, *AgentPoolsClientBeginDeleteMachinesOptions) (*runtime.Poller[AgentPoolsClientDeleteMachinesResponse], error)` +- New function `*ClientFactory.NewMachinesClient() *MachinesClient` +- New function `*ClientFactory.NewManagedClusterSnapshotsClient() *ManagedClusterSnapshotsClient` +- New function `*ClientFactory.NewOperationStatusResultClient() *OperationStatusResultClient` +- New function `NewMachinesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*MachinesClient, error)` +- New function `*MachinesClient.Get(context.Context, string, string, string, string, *MachinesClientGetOptions) (MachinesClientGetResponse, error)` +- New function `*MachinesClient.NewListPager(string, string, string, *MachinesClientListOptions) *runtime.Pager[MachinesClientListResponse]` +- New function `NewManagedClusterSnapshotsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ManagedClusterSnapshotsClient, error)` +- New function `*ManagedClusterSnapshotsClient.CreateOrUpdate(context.Context, string, string, ManagedClusterSnapshot, *ManagedClusterSnapshotsClientCreateOrUpdateOptions) (ManagedClusterSnapshotsClientCreateOrUpdateResponse, error)` +- New function `*ManagedClusterSnapshotsClient.Delete(context.Context, string, string, *ManagedClusterSnapshotsClientDeleteOptions) (ManagedClusterSnapshotsClientDeleteResponse, error)` +- New function `*ManagedClusterSnapshotsClient.Get(context.Context, string, string, *ManagedClusterSnapshotsClientGetOptions) (ManagedClusterSnapshotsClientGetResponse, error)` +- New function `*ManagedClusterSnapshotsClient.NewListByResourceGroupPager(string, *ManagedClusterSnapshotsClientListByResourceGroupOptions) *runtime.Pager[ManagedClusterSnapshotsClientListByResourceGroupResponse]` +- New function `*ManagedClusterSnapshotsClient.NewListPager(*ManagedClusterSnapshotsClientListOptions) *runtime.Pager[ManagedClusterSnapshotsClientListResponse]` +- New function `*ManagedClusterSnapshotsClient.UpdateTags(context.Context, string, string, TagsObject, *ManagedClusterSnapshotsClientUpdateTagsOptions) (ManagedClusterSnapshotsClientUpdateTagsResponse, error)` +- New function `*ManagedClustersClient.GetGuardrailsVersions(context.Context, string, string, *ManagedClustersClientGetGuardrailsVersionsOptions) (ManagedClustersClientGetGuardrailsVersionsResponse, error)` +- New function `*ManagedClustersClient.NewListGuardrailsVersionsPager(string, *ManagedClustersClientListGuardrailsVersionsOptions) *runtime.Pager[ManagedClustersClientListGuardrailsVersionsResponse]` +- New function `NewOperationStatusResultClient(string, azcore.TokenCredential, *arm.ClientOptions) (*OperationStatusResultClient, error)` +- New function `*OperationStatusResultClient.Get(context.Context, string, string, string, *OperationStatusResultClientGetOptions) (OperationStatusResultClientGetResponse, error)` +- New function `*OperationStatusResultClient.GetByAgentPool(context.Context, string, string, string, string, *OperationStatusResultClientGetByAgentPoolOptions) (OperationStatusResultClientGetByAgentPoolResponse, error)` +- New function `*OperationStatusResultClient.NewListPager(string, string, *OperationStatusResultClientListOptions) *runtime.Pager[OperationStatusResultClientListResponse]` +- New struct `AgentPoolArtifactStreamingProfile` +- New struct `AgentPoolDeleteMachinesParameter` +- New struct `AgentPoolGPUProfile` +- New struct `AgentPoolSecurityProfile` +- New struct `AgentPoolWindowsProfile` +- New struct `ErrorAdditionalInfo` +- New struct `ErrorDetail` +- New struct `GuardrailsAvailableVersion` +- New struct `GuardrailsAvailableVersionsList` +- New struct `GuardrailsAvailableVersionsProperties` +- New struct `GuardrailsProfile` +- New struct `Machine` +- New struct `MachineIPAddress` +- New struct `MachineListResult` +- New struct `MachineNetworkProperties` +- New struct `MachineProperties` +- New struct `ManagedClusterAIToolchainOperatorProfile` +- New struct `ManagedClusterAzureMonitorProfileAppMonitoring` +- New struct `ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics` +- New struct `ManagedClusterAzureMonitorProfileContainerInsights` +- New struct `ManagedClusterAzureMonitorProfileLogs` +- New struct `ManagedClusterAzureMonitorProfileWindowsHostLogs` +- New struct `ManagedClusterCostAnalysis` +- New struct `ManagedClusterIngressProfile` +- New struct `ManagedClusterIngressProfileWebAppRouting` +- New struct `ManagedClusterMetricsProfile` +- New struct `ManagedClusterNodeProvisioningProfile` +- New struct `ManagedClusterNodeResourceGroupProfile` +- New struct `ManagedClusterPropertiesForSnapshot` +- New struct `ManagedClusterSecurityProfileImageIntegrity` +- New struct `ManagedClusterSecurityProfileNodeRestriction` +- New struct `ManagedClusterSnapshot` +- New struct `ManagedClusterSnapshotListResult` +- New struct `ManagedClusterSnapshotProperties` +- New struct `ManualScaleProfile` +- New struct `NetworkMonitoring` +- New struct `NetworkProfileForSnapshot` +- New struct `NetworkProfileKubeProxyConfig` +- New struct `NetworkProfileKubeProxyConfigIpvsConfig` +- New struct `OperationStatusResult` +- New struct `OperationStatusResultList` +- New struct `ScaleProfile` +- New struct `VirtualMachineNodes` +- New struct `VirtualMachinesProfile` +- New field `NodeSoakDurationInMinutes` in struct `AgentPoolUpgradeSettings` +- New field `IgnorePodDisruptionBudget` in struct `AgentPoolsClientBeginDeleteOptions` +- New field `EnableVnetIntegration`, `SubnetID` in struct `ManagedClusterAPIServerAccessProfile` +- New field `ArtifactStreamingProfile`, `EnableCustomCATrust`, `GpuProfile`, `MessageOfTheDay`, `NodeInitializationTaints`, `SecurityProfile`, `VirtualMachineNodesStatus`, `VirtualMachinesProfile`, `WindowsProfile` in struct `ManagedClusterAgentPoolProfile` +- New field `ArtifactStreamingProfile`, `EnableCustomCATrust`, `GpuProfile`, `MessageOfTheDay`, `NodeInitializationTaints`, `SecurityProfile`, `VirtualMachineNodesStatus`, `VirtualMachinesProfile`, `WindowsProfile` in struct `ManagedClusterAgentPoolProfileProperties` +- New field `Logs` in struct `ManagedClusterAzureMonitorProfile` +- New field `AppMonitoringOpenTelemetryMetrics` in struct `ManagedClusterAzureMonitorProfileMetrics` +- New field `EffectiveNoProxy` in struct `ManagedClusterHTTPProxyConfig` +- New field `AiToolchainOperatorProfile`, `CreationData`, `EnableNamespaceResources`, `GuardrailsProfile`, `IngressProfile`, `MetricsProfile`, `NodeProvisioningProfile`, `NodeResourceGroupProfile` in struct `ManagedClusterProperties` +- New field `DaemonsetEvictionForEmptyNodes`, `DaemonsetEvictionForOccupiedNodes`, `IgnoreDaemonsetsUtilization` in struct `ManagedClusterPropertiesAutoScalerProfile` +- New field `CustomCATrustCertificates`, `ImageIntegrity`, `NodeRestriction` in struct `ManagedClusterSecurityProfile` +- New field `Version` in struct `ManagedClusterStorageProfileDiskCSIDriver` +- New field `AddonAutoscaling` in struct `ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler` +- New field `IgnorePodDisruptionBudget` in struct `ManagedClustersClientBeginDeleteOptions` +- New field `KubeProxyConfig`, `Monitoring` in struct `NetworkProfile` + + +## 4.6.0 (2023-11-24) +### Features Added + +- New enum type `BackendPoolType` with values `BackendPoolTypeNodeIP`, `BackendPoolTypeNodeIPConfiguration` +- New enum type `Protocol` with values `ProtocolTCP`, `ProtocolUDP` +- New struct `AgentPoolNetworkProfile` +- New struct `IPTag` +- New struct `PortRange` +- New field `CapacityReservationGroupID`, `NetworkProfile` in struct `ManagedClusterAgentPoolProfile` +- New field `CapacityReservationGroupID`, `NetworkProfile` in struct `ManagedClusterAgentPoolProfileProperties` +- New field `BackendPoolType` in struct `ManagedClusterLoadBalancerProfile` + + +## 4.6.0-beta.1 (2023-11-24) +### Features Added + +- New value `AgentPoolTypeVirtualMachines` added to enum type `AgentPoolType` +- New value `NetworkPolicyNone` added to enum type `NetworkPolicy` +- New value `NodeOSUpgradeChannelSecurityPatch` added to enum type `NodeOSUpgradeChannel` +- New value `OSSKUMariner`, `OSSKUWindowsAnnual` added to enum type `OSSKU` +- New value `PublicNetworkAccessSecuredByPerimeter` added to enum type `PublicNetworkAccess` +- New value `SnapshotTypeManagedCluster` added to enum type `SnapshotType` +- New value `WorkloadRuntimeKataMshvVMIsolation` added to enum type `WorkloadRuntime` +- New enum type `AddonAutoscaling` with values `AddonAutoscalingDisabled`, `AddonAutoscalingEnabled` +- New enum type `AgentPoolSSHAccess` with values `AgentPoolSSHAccessDisabled`, `AgentPoolSSHAccessLocalUser` +- New enum type `BackendPoolType` with values `BackendPoolTypeNodeIP`, `BackendPoolTypeNodeIPConfiguration` +- New enum type `GuardrailsSupport` with values `GuardrailsSupportPreview`, `GuardrailsSupportStable` +- New enum type `IpvsScheduler` with values `IpvsSchedulerLeastConnection`, `IpvsSchedulerRoundRobin` +- New enum type `Level` with values `LevelEnforcement`, `LevelOff`, `LevelWarning` +- New enum type `Mode` with values `ModeIPTABLES`, `ModeIPVS` +- New enum type `NodeProvisioningMode` with values `NodeProvisioningModeAuto`, `NodeProvisioningModeManual` +- New enum type `Protocol` with values `ProtocolTCP`, `ProtocolUDP` +- New enum type `RestrictionLevel` with values `RestrictionLevelReadOnly`, `RestrictionLevelUnrestricted` +- New function `*ClientFactory.NewMachinesClient() *MachinesClient` +- New function `*ClientFactory.NewManagedClusterSnapshotsClient() *ManagedClusterSnapshotsClient` +- New function `NewMachinesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*MachinesClient, error)` +- New function `*MachinesClient.Get(context.Context, string, string, string, string, *MachinesClientGetOptions) (MachinesClientGetResponse, error)` +- New function `*MachinesClient.NewListPager(string, string, string, *MachinesClientListOptions) *runtime.Pager[MachinesClientListResponse]` +- New function `NewManagedClusterSnapshotsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ManagedClusterSnapshotsClient, error)` +- New function `*ManagedClusterSnapshotsClient.CreateOrUpdate(context.Context, string, string, ManagedClusterSnapshot, *ManagedClusterSnapshotsClientCreateOrUpdateOptions) (ManagedClusterSnapshotsClientCreateOrUpdateResponse, error)` +- New function `*ManagedClusterSnapshotsClient.Delete(context.Context, string, string, *ManagedClusterSnapshotsClientDeleteOptions) (ManagedClusterSnapshotsClientDeleteResponse, error)` +- New function `*ManagedClusterSnapshotsClient.Get(context.Context, string, string, *ManagedClusterSnapshotsClientGetOptions) (ManagedClusterSnapshotsClientGetResponse, error)` +- New function `*ManagedClusterSnapshotsClient.NewListByResourceGroupPager(string, *ManagedClusterSnapshotsClientListByResourceGroupOptions) *runtime.Pager[ManagedClusterSnapshotsClientListByResourceGroupResponse]` +- New function `*ManagedClusterSnapshotsClient.NewListPager(*ManagedClusterSnapshotsClientListOptions) *runtime.Pager[ManagedClusterSnapshotsClientListResponse]` +- New function `*ManagedClusterSnapshotsClient.UpdateTags(context.Context, string, string, TagsObject, *ManagedClusterSnapshotsClientUpdateTagsOptions) (ManagedClusterSnapshotsClientUpdateTagsResponse, error)` +- New function `*ManagedClustersClient.GetGuardrailsVersions(context.Context, string, string, *ManagedClustersClientGetGuardrailsVersionsOptions) (ManagedClustersClientGetGuardrailsVersionsResponse, error)` +- New function `*ManagedClustersClient.NewListGuardrailsVersionsPager(string, *ManagedClustersClientListGuardrailsVersionsOptions) *runtime.Pager[ManagedClustersClientListGuardrailsVersionsResponse]` +- New struct `AgentPoolArtifactStreamingProfile` +- New struct `AgentPoolGPUProfile` +- New struct `AgentPoolNetworkProfile` +- New struct `AgentPoolSecurityProfile` +- New struct `AgentPoolWindowsProfile` +- New struct `GuardrailsAvailableVersion` +- New struct `GuardrailsAvailableVersionsList` +- New struct `GuardrailsAvailableVersionsProperties` +- New struct `GuardrailsProfile` +- New struct `IPTag` +- New struct `Machine` +- New struct `MachineIPAddress` +- New struct `MachineListResult` +- New struct `MachineNetworkProperties` +- New struct `MachineProperties` +- New struct `ManagedClusterAIToolchainOperatorProfile` +- New struct `ManagedClusterAzureMonitorProfileAppMonitoring` +- New struct `ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics` +- New struct `ManagedClusterAzureMonitorProfileContainerInsights` +- New struct `ManagedClusterAzureMonitorProfileLogs` +- New struct `ManagedClusterAzureMonitorProfileWindowsHostLogs` +- New struct `ManagedClusterCostAnalysis` +- New struct `ManagedClusterIngressProfile` +- New struct `ManagedClusterIngressProfileWebAppRouting` +- New struct `ManagedClusterMetricsProfile` +- New struct `ManagedClusterNodeProvisioningProfile` +- New struct `ManagedClusterNodeResourceGroupProfile` +- New struct `ManagedClusterPropertiesForSnapshot` +- New struct `ManagedClusterSecurityProfileImageIntegrity` +- New struct `ManagedClusterSecurityProfileNodeRestriction` +- New struct `ManagedClusterSnapshot` +- New struct `ManagedClusterSnapshotListResult` +- New struct `ManagedClusterSnapshotProperties` +- New struct `NetworkMonitoring` +- New struct `NetworkProfileForSnapshot` +- New struct `NetworkProfileKubeProxyConfig` +- New struct `NetworkProfileKubeProxyConfigIpvsConfig` +- New struct `PortRange` +- New field `NodeSoakDurationInMinutes` in struct `AgentPoolUpgradeSettings` +- New field `IgnorePodDisruptionBudget` in struct `AgentPoolsClientBeginDeleteOptions` +- New field `EnableVnetIntegration`, `SubnetID` in struct `ManagedClusterAPIServerAccessProfile` +- New field `ArtifactStreamingProfile`, `CapacityReservationGroupID`, `EnableCustomCATrust`, `GpuProfile`, `MessageOfTheDay`, `NetworkProfile`, `SecurityProfile`, `WindowsProfile` in struct `ManagedClusterAgentPoolProfile` +- New field `ArtifactStreamingProfile`, `CapacityReservationGroupID`, `EnableCustomCATrust`, `GpuProfile`, `MessageOfTheDay`, `NetworkProfile`, `SecurityProfile`, `WindowsProfile` in struct `ManagedClusterAgentPoolProfileProperties` +- New field `Logs` in struct `ManagedClusterAzureMonitorProfile` +- New field `AppMonitoringOpenTelemetryMetrics` in struct `ManagedClusterAzureMonitorProfileMetrics` +- New field `EffectiveNoProxy` in struct `ManagedClusterHTTPProxyConfig` +- New field `BackendPoolType` in struct `ManagedClusterLoadBalancerProfile` +- New field `AiToolchainOperatorProfile`, `CreationData`, `EnableNamespaceResources`, `GuardrailsProfile`, `IngressProfile`, `MetricsProfile`, `NodeProvisioningProfile`, `NodeResourceGroupProfile` in struct `ManagedClusterProperties` +- New field `DaemonsetEvictionForEmptyNodes`, `DaemonsetEvictionForOccupiedNodes`, `Expanders`, `IgnoreDaemonsetsUtilization` in struct `ManagedClusterPropertiesAutoScalerProfile` +- New field `CustomCATrustCertificates`, `ImageIntegrity`, `NodeRestriction` in struct `ManagedClusterSecurityProfile` +- New field `Version` in struct `ManagedClusterStorageProfileDiskCSIDriver` +- New field `AddonAutoscaling` in struct `ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler` +- New field `IgnorePodDisruptionBudget` in struct `ManagedClustersClientBeginDeleteOptions` +- New field `KubeProxyConfig`, `Monitoring` in struct `NetworkProfile` + + +## 4.5.0 (2023-11-24) +### Features Added + +- Support for test fakes and OpenTelemetry trace spans. +- New enum type `TrustedAccessRoleBindingProvisioningState` with values `TrustedAccessRoleBindingProvisioningStateCanceled`, `TrustedAccessRoleBindingProvisioningStateDeleting`, `TrustedAccessRoleBindingProvisioningStateFailed`, `TrustedAccessRoleBindingProvisioningStateSucceeded`, `TrustedAccessRoleBindingProvisioningStateUpdating` +- New function `*ClientFactory.NewTrustedAccessRoleBindingsClient() *TrustedAccessRoleBindingsClient` +- New function `*ClientFactory.NewTrustedAccessRolesClient() *TrustedAccessRolesClient` +- New function `NewTrustedAccessRoleBindingsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*TrustedAccessRoleBindingsClient, error)` +- New function `*TrustedAccessRoleBindingsClient.BeginCreateOrUpdate(context.Context, string, string, string, TrustedAccessRoleBinding, *TrustedAccessRoleBindingsClientBeginCreateOrUpdateOptions) (*runtime.Poller[TrustedAccessRoleBindingsClientCreateOrUpdateResponse], error)` +- New function `*TrustedAccessRoleBindingsClient.BeginDelete(context.Context, string, string, string, *TrustedAccessRoleBindingsClientBeginDeleteOptions) (*runtime.Poller[TrustedAccessRoleBindingsClientDeleteResponse], error)` +- New function `*TrustedAccessRoleBindingsClient.Get(context.Context, string, string, string, *TrustedAccessRoleBindingsClientGetOptions) (TrustedAccessRoleBindingsClientGetResponse, error)` +- New function `*TrustedAccessRoleBindingsClient.NewListPager(string, string, *TrustedAccessRoleBindingsClientListOptions) *runtime.Pager[TrustedAccessRoleBindingsClientListResponse]` +- New function `NewTrustedAccessRolesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*TrustedAccessRolesClient, error)` +- New function `*TrustedAccessRolesClient.NewListPager(string, *TrustedAccessRolesClientListOptions) *runtime.Pager[TrustedAccessRolesClientListResponse]` +- New struct `TrustedAccessRole` +- New struct `TrustedAccessRoleBinding` +- New struct `TrustedAccessRoleBindingListResult` +- New struct `TrustedAccessRoleBindingProperties` +- New struct `TrustedAccessRoleListResult` +- New struct `TrustedAccessRoleRule` + + +## 4.5.0-beta.1 (2023-10-27) +### Features Added + +- Support for test fakes and OpenTelemetry trace spans. +- New value `NetworkPolicyNone` added to enum type `NetworkPolicy` +- New value `NodeOSUpgradeChannelSecurityPatch` added to enum type `NodeOSUpgradeChannel` +- New value `OSSKUMariner` added to enum type `OSSKU` +- New value `PublicNetworkAccessSecuredByPerimeter` added to enum type `PublicNetworkAccess` +- New value `SnapshotTypeManagedCluster` added to enum type `SnapshotType` +- New value `WorkloadRuntimeKataMshvVMIsolation` added to enum type `WorkloadRuntime` +- New enum type `AddonAutoscaling` with values `AddonAutoscalingDisabled`, `AddonAutoscalingEnabled` +- New enum type `AgentPoolSSHAccess` with values `AgentPoolSSHAccessDisabled`, `AgentPoolSSHAccessLocalUser` +- New enum type `BackendPoolType` with values `BackendPoolTypeNodeIP`, `BackendPoolTypeNodeIPConfiguration` +- New enum type `GuardrailsSupport` with values `GuardrailsSupportPreview`, `GuardrailsSupportStable` +- New enum type `IpvsScheduler` with values `IpvsSchedulerLeastConnection`, `IpvsSchedulerRoundRobin` +- New enum type `Level` with values `LevelEnforcement`, `LevelOff`, `LevelWarning` +- New enum type `Mode` with values `ModeIPTABLES`, `ModeIPVS` +- New enum type `Protocol` with values `ProtocolTCP`, `ProtocolUDP` +- New enum type `RestrictionLevel` with values `RestrictionLevelReadOnly`, `RestrictionLevelUnrestricted` +- New enum type `TrustedAccessRoleBindingProvisioningState` with values `TrustedAccessRoleBindingProvisioningStateCanceled`, `TrustedAccessRoleBindingProvisioningStateDeleting`, `TrustedAccessRoleBindingProvisioningStateFailed`, `TrustedAccessRoleBindingProvisioningStateSucceeded`, `TrustedAccessRoleBindingProvisioningStateUpdating` +- New function `*ClientFactory.NewMachinesClient() *MachinesClient` +- New function `*ClientFactory.NewManagedClusterSnapshotsClient() *ManagedClusterSnapshotsClient` +- New function `*ClientFactory.NewTrustedAccessRoleBindingsClient() *TrustedAccessRoleBindingsClient` +- New function `*ClientFactory.NewTrustedAccessRolesClient() *TrustedAccessRolesClient` +- New function `NewMachinesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*MachinesClient, error)` +- New function `*MachinesClient.Get(context.Context, string, string, string, string, *MachinesClientGetOptions) (MachinesClientGetResponse, error)` +- New function `*MachinesClient.NewListPager(string, string, string, *MachinesClientListOptions) *runtime.Pager[MachinesClientListResponse]` +- New function `NewManagedClusterSnapshotsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ManagedClusterSnapshotsClient, error)` +- New function `*ManagedClusterSnapshotsClient.CreateOrUpdate(context.Context, string, string, ManagedClusterSnapshot, *ManagedClusterSnapshotsClientCreateOrUpdateOptions) (ManagedClusterSnapshotsClientCreateOrUpdateResponse, error)` +- New function `*ManagedClusterSnapshotsClient.Delete(context.Context, string, string, *ManagedClusterSnapshotsClientDeleteOptions) (ManagedClusterSnapshotsClientDeleteResponse, error)` +- New function `*ManagedClusterSnapshotsClient.Get(context.Context, string, string, *ManagedClusterSnapshotsClientGetOptions) (ManagedClusterSnapshotsClientGetResponse, error)` +- New function `*ManagedClusterSnapshotsClient.NewListByResourceGroupPager(string, *ManagedClusterSnapshotsClientListByResourceGroupOptions) *runtime.Pager[ManagedClusterSnapshotsClientListByResourceGroupResponse]` +- New function `*ManagedClusterSnapshotsClient.NewListPager(*ManagedClusterSnapshotsClientListOptions) *runtime.Pager[ManagedClusterSnapshotsClientListResponse]` +- New function `*ManagedClusterSnapshotsClient.UpdateTags(context.Context, string, string, TagsObject, *ManagedClusterSnapshotsClientUpdateTagsOptions) (ManagedClusterSnapshotsClientUpdateTagsResponse, error)` +- New function `*ManagedClustersClient.GetGuardrailsVersions(context.Context, string, string, *ManagedClustersClientGetGuardrailsVersionsOptions) (ManagedClustersClientGetGuardrailsVersionsResponse, error)` +- New function `*ManagedClustersClient.NewListGuardrailsVersionsPager(string, *ManagedClustersClientListGuardrailsVersionsOptions) *runtime.Pager[ManagedClustersClientListGuardrailsVersionsResponse]` +- New function `NewTrustedAccessRoleBindingsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*TrustedAccessRoleBindingsClient, error)` +- New function `*TrustedAccessRoleBindingsClient.BeginCreateOrUpdate(context.Context, string, string, string, TrustedAccessRoleBinding, *TrustedAccessRoleBindingsClientBeginCreateOrUpdateOptions) (*runtime.Poller[TrustedAccessRoleBindingsClientCreateOrUpdateResponse], error)` +- New function `*TrustedAccessRoleBindingsClient.BeginDelete(context.Context, string, string, string, *TrustedAccessRoleBindingsClientBeginDeleteOptions) (*runtime.Poller[TrustedAccessRoleBindingsClientDeleteResponse], error)` +- New function `*TrustedAccessRoleBindingsClient.Get(context.Context, string, string, string, *TrustedAccessRoleBindingsClientGetOptions) (TrustedAccessRoleBindingsClientGetResponse, error)` +- New function `*TrustedAccessRoleBindingsClient.NewListPager(string, string, *TrustedAccessRoleBindingsClientListOptions) *runtime.Pager[TrustedAccessRoleBindingsClientListResponse]` +- New function `NewTrustedAccessRolesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*TrustedAccessRolesClient, error)` +- New function `*TrustedAccessRolesClient.NewListPager(string, *TrustedAccessRolesClientListOptions) *runtime.Pager[TrustedAccessRolesClientListResponse]` +- New struct `AgentPoolNetworkProfile` +- New struct `AgentPoolSecurityProfile` +- New struct `AgentPoolWindowsProfile` +- New struct `GuardrailsAvailableVersion` +- New struct `GuardrailsAvailableVersionsList` +- New struct `GuardrailsAvailableVersionsProperties` +- New struct `GuardrailsProfile` +- New struct `IPTag` +- New struct `Machine` +- New struct `MachineIPAddress` +- New struct `MachineListResult` +- New struct `MachineNetworkProperties` +- New struct `MachineProperties` +- New struct `ManagedClusterAzureMonitorProfileAppMonitoring` +- New struct `ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics` +- New struct `ManagedClusterAzureMonitorProfileContainerInsights` +- New struct `ManagedClusterAzureMonitorProfileLogs` +- New struct `ManagedClusterAzureMonitorProfileWindowsHostLogs` +- New struct `ManagedClusterCostAnalysis` +- New struct `ManagedClusterIngressProfile` +- New struct `ManagedClusterIngressProfileWebAppRouting` +- New struct `ManagedClusterMetricsProfile` +- New struct `ManagedClusterNodeResourceGroupProfile` +- New struct `ManagedClusterPropertiesForSnapshot` +- New struct `ManagedClusterSecurityProfileImageIntegrity` +- New struct `ManagedClusterSecurityProfileNodeRestriction` +- New struct `ManagedClusterSnapshot` +- New struct `ManagedClusterSnapshotListResult` +- New struct `ManagedClusterSnapshotProperties` +- New struct `NetworkMonitoring` +- New struct `NetworkProfileForSnapshot` +- New struct `NetworkProfileKubeProxyConfig` +- New struct `NetworkProfileKubeProxyConfigIpvsConfig` +- New struct `PortRange` +- New struct `TrustedAccessRole` +- New struct `TrustedAccessRoleBinding` +- New struct `TrustedAccessRoleBindingListResult` +- New struct `TrustedAccessRoleBindingProperties` +- New struct `TrustedAccessRoleListResult` +- New struct `TrustedAccessRoleRule` +- New field `IgnorePodDisruptionBudget` in struct `AgentPoolsClientBeginDeleteOptions` +- New field `EnableVnetIntegration`, `SubnetID` in struct `ManagedClusterAPIServerAccessProfile` +- New field `CapacityReservationGroupID`, `EnableCustomCATrust`, `MessageOfTheDay`, `NetworkProfile`, `SecurityProfile`, `WindowsProfile` in struct `ManagedClusterAgentPoolProfile` +- New field `CapacityReservationGroupID`, `EnableCustomCATrust`, `MessageOfTheDay`, `NetworkProfile`, `SecurityProfile`, `WindowsProfile` in struct `ManagedClusterAgentPoolProfileProperties` +- New field `Logs` in struct `ManagedClusterAzureMonitorProfile` +- New field `AppMonitoringOpenTelemetryMetrics` in struct `ManagedClusterAzureMonitorProfileMetrics` +- New field `EffectiveNoProxy` in struct `ManagedClusterHTTPProxyConfig` +- New field `BackendPoolType` in struct `ManagedClusterLoadBalancerProfile` +- New field `CreationData`, `EnableNamespaceResources`, `GuardrailsProfile`, `IngressProfile`, `MetricsProfile`, `NodeResourceGroupProfile` in struct `ManagedClusterProperties` +- New field `DaemonsetEvictionForEmptyNodes`, `DaemonsetEvictionForOccupiedNodes`, `Expanders`, `IgnoreDaemonsetsUtilization` in struct `ManagedClusterPropertiesAutoScalerProfile` +- New field `CustomCATrustCertificates`, `ImageIntegrity`, `NodeRestriction` in struct `ManagedClusterSecurityProfile` +- New field `Version` in struct `ManagedClusterStorageProfileDiskCSIDriver` +- New field `AddonAutoscaling` in struct `ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler` +- New field `IgnorePodDisruptionBudget` in struct `ManagedClustersClientBeginDeleteOptions` +- New field `KubeProxyConfig`, `Monitoring` in struct `NetworkProfile` + + +## 4.4.0 (2023-10-27) +### Features Added + +- New enum type `IstioIngressGatewayMode` with values `IstioIngressGatewayModeExternal`, `IstioIngressGatewayModeInternal` +- New enum type `ServiceMeshMode` with values `ServiceMeshModeDisabled`, `ServiceMeshModeIstio` +- New function `*ManagedClustersClient.GetMeshRevisionProfile(context.Context, string, string, *ManagedClustersClientGetMeshRevisionProfileOptions) (ManagedClustersClientGetMeshRevisionProfileResponse, error)` +- New function `*ManagedClustersClient.GetMeshUpgradeProfile(context.Context, string, string, string, *ManagedClustersClientGetMeshUpgradeProfileOptions) (ManagedClustersClientGetMeshUpgradeProfileResponse, error)` +- New function `*ManagedClustersClient.NewListMeshRevisionProfilesPager(string, *ManagedClustersClientListMeshRevisionProfilesOptions) *runtime.Pager[ManagedClustersClientListMeshRevisionProfilesResponse]` +- New function `*ManagedClustersClient.NewListMeshUpgradeProfilesPager(string, string, *ManagedClustersClientListMeshUpgradeProfilesOptions) *runtime.Pager[ManagedClustersClientListMeshUpgradeProfilesResponse]` +- New struct `CompatibleVersions` +- New struct `IstioCertificateAuthority` +- New struct `IstioComponents` +- New struct `IstioEgressGateway` +- New struct `IstioIngressGateway` +- New struct `IstioPluginCertificateAuthority` +- New struct `IstioServiceMesh` +- New struct `MeshRevision` +- New struct `MeshRevisionProfile` +- New struct `MeshRevisionProfileList` +- New struct `MeshRevisionProfileProperties` +- New struct `MeshUpgradeProfile` +- New struct `MeshUpgradeProfileList` +- New struct `MeshUpgradeProfileProperties` +- New struct `ServiceMeshProfile` +- New field `ResourceUID`, `ServiceMeshProfile` in struct `ManagedClusterProperties` + + +## 4.4.0-beta.2 (2023-10-09) +### Features Added + +- Support for test fakes and OpenTelemetry trace spans. + +## 4.4.0-beta.1 (2023-09-22) +### Features Added + +- New value `NodeOSUpgradeChannelSecurityPatch` added to enum type `NodeOSUpgradeChannel` +- New value `OSSKUMariner` added to enum type `OSSKU` +- New value `PublicNetworkAccessSecuredByPerimeter` added to enum type `PublicNetworkAccess` +- New value `SnapshotTypeManagedCluster` added to enum type `SnapshotType` +- New value `WorkloadRuntimeKataMshvVMIsolation` added to enum type `WorkloadRuntime` +- New enum type `AgentPoolSSHAccess` with values `AgentPoolSSHAccessDisabled`, `AgentPoolSSHAccessLocalUser` +- New enum type `BackendPoolType` with values `BackendPoolTypeNodeIP`, `BackendPoolTypeNodeIPConfiguration` +- New enum type `GuardrailsSupport` with values `GuardrailsSupportPreview`, `GuardrailsSupportStable` +- New enum type `IpvsScheduler` with values `IpvsSchedulerLeastConnection`, `IpvsSchedulerRoundRobin` +- New enum type `IstioIngressGatewayMode` with values `IstioIngressGatewayModeExternal`, `IstioIngressGatewayModeInternal` +- New enum type `Level` with values `LevelEnforcement`, `LevelOff`, `LevelWarning` +- New enum type `Mode` with values `ModeIPTABLES`, `ModeIPVS` +- New enum type `Protocol` with values `ProtocolTCP`, `ProtocolUDP` +- New enum type `RestrictionLevel` with values `RestrictionLevelReadOnly`, `RestrictionLevelUnrestricted` +- New enum type `ServiceMeshMode` with values `ServiceMeshModeDisabled`, `ServiceMeshModeIstio` +- New enum type `TrustedAccessRoleBindingProvisioningState` with values `TrustedAccessRoleBindingProvisioningStateCanceled`, `TrustedAccessRoleBindingProvisioningStateDeleting`, `TrustedAccessRoleBindingProvisioningStateFailed`, `TrustedAccessRoleBindingProvisioningStateSucceeded`, `TrustedAccessRoleBindingProvisioningStateUpdating` +- New function `*ClientFactory.NewMachinesClient() *MachinesClient` +- New function `*ClientFactory.NewManagedClusterSnapshotsClient() *ManagedClusterSnapshotsClient` +- New function `*ClientFactory.NewTrustedAccessRoleBindingsClient() *TrustedAccessRoleBindingsClient` +- New function `*ClientFactory.NewTrustedAccessRolesClient() *TrustedAccessRolesClient` +- New function `NewMachinesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*MachinesClient, error)` +- New function `*MachinesClient.Get(context.Context, string, string, string, string, *MachinesClientGetOptions) (MachinesClientGetResponse, error)` +- New function `*MachinesClient.NewListPager(string, string, string, *MachinesClientListOptions) *runtime.Pager[MachinesClientListResponse]` +- New function `NewManagedClusterSnapshotsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ManagedClusterSnapshotsClient, error)` +- New function `*ManagedClusterSnapshotsClient.CreateOrUpdate(context.Context, string, string, ManagedClusterSnapshot, *ManagedClusterSnapshotsClientCreateOrUpdateOptions) (ManagedClusterSnapshotsClientCreateOrUpdateResponse, error)` +- New function `*ManagedClusterSnapshotsClient.Delete(context.Context, string, string, *ManagedClusterSnapshotsClientDeleteOptions) (ManagedClusterSnapshotsClientDeleteResponse, error)` +- New function `*ManagedClusterSnapshotsClient.Get(context.Context, string, string, *ManagedClusterSnapshotsClientGetOptions) (ManagedClusterSnapshotsClientGetResponse, error)` +- New function `*ManagedClusterSnapshotsClient.NewListByResourceGroupPager(string, *ManagedClusterSnapshotsClientListByResourceGroupOptions) *runtime.Pager[ManagedClusterSnapshotsClientListByResourceGroupResponse]` +- New function `*ManagedClusterSnapshotsClient.NewListPager(*ManagedClusterSnapshotsClientListOptions) *runtime.Pager[ManagedClusterSnapshotsClientListResponse]` +- New function `*ManagedClusterSnapshotsClient.UpdateTags(context.Context, string, string, TagsObject, *ManagedClusterSnapshotsClientUpdateTagsOptions) (ManagedClusterSnapshotsClientUpdateTagsResponse, error)` +- New function `*ManagedClustersClient.GetGuardrailsVersions(context.Context, string, string, *ManagedClustersClientGetGuardrailsVersionsOptions) (ManagedClustersClientGetGuardrailsVersionsResponse, error)` +- New function `*ManagedClustersClient.GetMeshRevisionProfile(context.Context, string, string, *ManagedClustersClientGetMeshRevisionProfileOptions) (ManagedClustersClientGetMeshRevisionProfileResponse, error)` +- New function `*ManagedClustersClient.GetMeshUpgradeProfile(context.Context, string, string, string, *ManagedClustersClientGetMeshUpgradeProfileOptions) (ManagedClustersClientGetMeshUpgradeProfileResponse, error)` +- New function `*ManagedClustersClient.NewListGuardrailsVersionsPager(string, *ManagedClustersClientListGuardrailsVersionsOptions) *runtime.Pager[ManagedClustersClientListGuardrailsVersionsResponse]` +- New function `*ManagedClustersClient.NewListMeshRevisionProfilesPager(string, *ManagedClustersClientListMeshRevisionProfilesOptions) *runtime.Pager[ManagedClustersClientListMeshRevisionProfilesResponse]` +- New function `*ManagedClustersClient.NewListMeshUpgradeProfilesPager(string, string, *ManagedClustersClientListMeshUpgradeProfilesOptions) *runtime.Pager[ManagedClustersClientListMeshUpgradeProfilesResponse]` +- New function `NewTrustedAccessRoleBindingsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*TrustedAccessRoleBindingsClient, error)` +- New function `*TrustedAccessRoleBindingsClient.CreateOrUpdate(context.Context, string, string, string, TrustedAccessRoleBinding, *TrustedAccessRoleBindingsClientCreateOrUpdateOptions) (TrustedAccessRoleBindingsClientCreateOrUpdateResponse, error)` +- New function `*TrustedAccessRoleBindingsClient.Delete(context.Context, string, string, string, *TrustedAccessRoleBindingsClientDeleteOptions) (TrustedAccessRoleBindingsClientDeleteResponse, error)` +- New function `*TrustedAccessRoleBindingsClient.Get(context.Context, string, string, string, *TrustedAccessRoleBindingsClientGetOptions) (TrustedAccessRoleBindingsClientGetResponse, error)` +- New function `*TrustedAccessRoleBindingsClient.NewListPager(string, string, *TrustedAccessRoleBindingsClientListOptions) *runtime.Pager[TrustedAccessRoleBindingsClientListResponse]` +- New function `NewTrustedAccessRolesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*TrustedAccessRolesClient, error)` +- New function `*TrustedAccessRolesClient.NewListPager(string, *TrustedAccessRolesClientListOptions) *runtime.Pager[TrustedAccessRolesClientListResponse]` +- New struct `AgentPoolNetworkProfile` +- New struct `AgentPoolSecurityProfile` +- New struct `AgentPoolWindowsProfile` +- New struct `CompatibleVersions` +- New struct `GuardrailsAvailableVersion` +- New struct `GuardrailsAvailableVersionsList` +- New struct `GuardrailsAvailableVersionsProperties` +- New struct `GuardrailsProfile` +- New struct `IPTag` +- New struct `IstioCertificateAuthority` +- New struct `IstioComponents` +- New struct `IstioIngressGateway` +- New struct `IstioPluginCertificateAuthority` +- New struct `IstioServiceMesh` +- New struct `Machine` +- New struct `MachineIPAddress` +- New struct `MachineListResult` +- New struct `MachineNetworkProperties` +- New struct `MachineProperties` +- New struct `ManagedClusterAzureMonitorProfileAppMonitoring` +- New struct `ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics` +- New struct `ManagedClusterAzureMonitorProfileContainerInsights` +- New struct `ManagedClusterAzureMonitorProfileLogs` +- New struct `ManagedClusterAzureMonitorProfileWindowsHostLogs` +- New struct `ManagedClusterCostAnalysis` +- New struct `ManagedClusterIngressProfile` +- New struct `ManagedClusterIngressProfileWebAppRouting` +- New struct `ManagedClusterMetricsProfile` +- New struct `ManagedClusterNodeResourceGroupProfile` +- New struct `ManagedClusterPropertiesForSnapshot` +- New struct `ManagedClusterSecurityProfileImageIntegrity` +- New struct `ManagedClusterSecurityProfileNodeRestriction` +- New struct `ManagedClusterSnapshot` +- New struct `ManagedClusterSnapshotListResult` +- New struct `ManagedClusterSnapshotProperties` +- New struct `MeshRevision` +- New struct `MeshRevisionProfile` +- New struct `MeshRevisionProfileList` +- New struct `MeshRevisionProfileProperties` +- New struct `MeshUpgradeProfile` +- New struct `MeshUpgradeProfileList` +- New struct `MeshUpgradeProfileProperties` +- New struct `NetworkMonitoring` +- New struct `NetworkProfileForSnapshot` +- New struct `NetworkProfileKubeProxyConfig` +- New struct `NetworkProfileKubeProxyConfigIpvsConfig` +- New struct `PortRange` +- New struct `ServiceMeshProfile` +- New struct `TrustedAccessRole` +- New struct `TrustedAccessRoleBinding` +- New struct `TrustedAccessRoleBindingListResult` +- New struct `TrustedAccessRoleBindingProperties` +- New struct `TrustedAccessRoleListResult` +- New struct `TrustedAccessRoleRule` +- New field `IgnorePodDisruptionBudget` in struct `AgentPoolsClientBeginDeleteOptions` +- New field `EnableVnetIntegration`, `SubnetID` in struct `ManagedClusterAPIServerAccessProfile` +- New field `CapacityReservationGroupID`, `EnableCustomCATrust`, `MessageOfTheDay`, `NetworkProfile`, `SecurityProfile`, `WindowsProfile` in struct `ManagedClusterAgentPoolProfile` +- New field `CapacityReservationGroupID`, `EnableCustomCATrust`, `MessageOfTheDay`, `NetworkProfile`, `SecurityProfile`, `WindowsProfile` in struct `ManagedClusterAgentPoolProfileProperties` +- New field `Logs` in struct `ManagedClusterAzureMonitorProfile` +- New field `AppMonitoringOpenTelemetryMetrics` in struct `ManagedClusterAzureMonitorProfileMetrics` +- New field `EffectiveNoProxy` in struct `ManagedClusterHTTPProxyConfig` +- New field `BackendPoolType` in struct `ManagedClusterLoadBalancerProfile` +- New field `CreationData`, `EnableNamespaceResources`, `GuardrailsProfile`, `IngressProfile`, `MetricsProfile`, `NodeResourceGroupProfile`, `ResourceUID`, `ServiceMeshProfile` in struct `ManagedClusterProperties` +- New field `CustomCATrustCertificates`, `ImageIntegrity`, `NodeRestriction` in struct `ManagedClusterSecurityProfile` +- New field `Version` in struct `ManagedClusterStorageProfileDiskCSIDriver` +- New field `IgnorePodDisruptionBudget` in struct `ManagedClustersClientBeginDeleteOptions` +- New field `KubeProxyConfig`, `Monitoring` in struct `NetworkProfile` + + ## 4.3.0 (2023-08-25) ### Features Added diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/README.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/README.md index e201a7d7..44d30708 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/README.md +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/README.md @@ -1,6 +1,6 @@ # Azure Container Service Module for Go -[![PkgGoDev](https://pkg.go.dev/badge/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v2)](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v2) +[![PkgGoDev](https://pkg.go.dev/badge/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4)](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4) The `armcontainerservice` module provides operations for working with Azure Container Service. @@ -20,7 +20,7 @@ This project uses [Go modules](https://github.com/golang/go/wiki/Modules) for ve Install the Azure Container Service module: ```sh -go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v2 +go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4 ``` ## Authorization @@ -57,37 +57,20 @@ clientFactory, err := armcontainerservice.NewClientFactory(, cr A client groups a set of related APIs, providing access to its functionality. Create one or more clients to access the APIs you require using client factory. ```go -client := clientFactory.NewSnapshotsClient() +client := clientFactory.NewAgentPoolsClient() ``` ## Fakes -The `fake` package provides implementations for fake servers that can be used for testing. -To create a fake server, declare an instance of the required fake server type(s). -```go -myFakeManagedClustersServer := fake.ManagedClustersServer{} -``` -Next, provide func implementations for the methods you wish to fake. -The named return variables can be used to simplify return value construction. -```go -myFakeManagedClustersServer.Get = func(ctx context.Context, resourceGroupName string, resourceName string, options *armcontainerservice.ManagedClustersClientGetOptions) (resp azfake.Responder[armcontainerservice.ManagedClustersClientGetResponse], errResp azfake.ErrorResponder) { - // TODO: resp.SetResponse(/* your fake armcontainerservice.ManagedClustersClientGetResponse response */) - return -} -``` -You connect the fake server to a client instance during construction through the optional transport. -Use `NewTokenCredential()` from `azcore/fake` to obtain a fake credential. -```go -import azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" -client, err := armcontainerservice.NewManagedClustersClient("subscriptionID", azfake.NewTokenCredential(), &arm.ClientOptions{ - ClientOptions: azcore.ClientOptions{ - Transport: fake.NewManagedClustersServerTransport(&myFakeManagedClustersServer), - }, -}) -``` + +The fake package contains types used for constructing in-memory fake servers used in unit tests. +This allows writing tests to cover various success/error conditions without the need for connecting to a live service. + +Please see https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/samples/fakes for details and examples on how to use fakes. ## More sample code - [Agent Pool](https://aka.ms/azsdk/go/mgmt/samples?path=sdk/resourcemanager/containerservice/agent_pool) +- [Creating a Fake](https://github.com/Azure/azure-sdk-for-go/blob/main/sdk/resourcemanager/containerservice/armcontainerservice/fake_example_test.go) - [Maintenance Configuration](https://aka.ms/azsdk/go/mgmt/samples?path=sdk/resourcemanager/containerservice/maintenance_configurations) - [Managed Clusters](https://aka.ms/azsdk/go/mgmt/samples?path=sdk/resourcemanager/containerservice/managed_clusters) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/agentpools_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/agentpools_client.go index 623e6fab..37ed7db8 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/agentpools_client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/agentpools_client.go @@ -28,11 +28,11 @@ type AgentPoolsClient struct { } // NewAgentPoolsClient creates a new instance of AgentPoolsClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewAgentPoolsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AgentPoolsClient, error) { - cl, err := arm.NewClient(moduleName+".AgentPoolsClient", moduleVersion, credential, options) + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { return nil, err } @@ -48,7 +48,7 @@ func NewAgentPoolsClient(subscriptionID string, credential azcore.TokenCredentia // before cancellation can take place, a 409 error code is returned. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - agentPoolName - The name of the agent pool. @@ -62,10 +62,13 @@ func (client *AgentPoolsClient) BeginAbortLatestOperation(ctx context.Context, r } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AgentPoolsClientAbortLatestOperationResponse]{ FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), }) return poller, err } else { - return runtime.NewPollerFromResumeToken[AgentPoolsClientAbortLatestOperationResponse](options.ResumeToken, client.internal.Pipeline(), nil) + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[AgentPoolsClientAbortLatestOperationResponse]{ + Tracer: client.internal.Tracer(), + }) } } @@ -74,9 +77,13 @@ func (client *AgentPoolsClient) BeginAbortLatestOperation(ctx context.Context, r // before cancellation can take place, a 409 error code is returned. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2024-01-01 func (client *AgentPoolsClient) abortLatestOperation(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, options *AgentPoolsClientBeginAbortLatestOperationOptions) (*http.Response, error) { var err error + const operationName = "AgentPoolsClient.BeginAbortLatestOperation" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.abortLatestOperationCreateRequest(ctx, resourceGroupName, resourceName, agentPoolName, options) if err != nil { return nil, err @@ -116,7 +123,7 @@ func (client *AgentPoolsClient) abortLatestOperationCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -125,7 +132,7 @@ func (client *AgentPoolsClient) abortLatestOperationCreateRequest(ctx context.Co // BeginCreateOrUpdate - Creates or updates an agent pool in the specified managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - agentPoolName - The name of the agent pool. @@ -138,19 +145,27 @@ func (client *AgentPoolsClient) BeginCreateOrUpdate(ctx context.Context, resourc if err != nil { return nil, err } - poller, err := runtime.NewPoller[AgentPoolsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AgentPoolsClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) return poller, err } else { - return runtime.NewPollerFromResumeToken[AgentPoolsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[AgentPoolsClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) } } // CreateOrUpdate - Creates or updates an agent pool in the specified managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2024-01-01 func (client *AgentPoolsClient) createOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, parameters AgentPool, options *AgentPoolsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error + const operationName = "AgentPoolsClient.BeginCreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, resourceName, agentPoolName, parameters, options) if err != nil { return nil, err @@ -190,7 +205,7 @@ func (client *AgentPoolsClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -202,7 +217,7 @@ func (client *AgentPoolsClient) createOrUpdateCreateRequest(ctx context.Context, // BeginDelete - Deletes an agent pool in the specified managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - agentPoolName - The name of the agent pool. @@ -213,19 +228,27 @@ func (client *AgentPoolsClient) BeginDelete(ctx context.Context, resourceGroupNa if err != nil { return nil, err } - poller, err := runtime.NewPoller[AgentPoolsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AgentPoolsClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) return poller, err } else { - return runtime.NewPollerFromResumeToken[AgentPoolsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[AgentPoolsClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) } } // Delete - Deletes an agent pool in the specified managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2024-01-01 func (client *AgentPoolsClient) deleteOperation(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, options *AgentPoolsClientBeginDeleteOptions) (*http.Response, error) { var err error + const operationName = "AgentPoolsClient.BeginDelete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.deleteCreateRequest(ctx, resourceGroupName, resourceName, agentPoolName, options) if err != nil { return nil, err @@ -265,7 +288,7 @@ func (client *AgentPoolsClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -274,13 +297,17 @@ func (client *AgentPoolsClient) deleteCreateRequest(ctx context.Context, resourc // Get - Gets the specified managed cluster agent pool. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - agentPoolName - The name of the agent pool. // - options - AgentPoolsClientGetOptions contains the optional parameters for the AgentPoolsClient.Get method. func (client *AgentPoolsClient) Get(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, options *AgentPoolsClientGetOptions) (AgentPoolsClientGetResponse, error) { var err error + const operationName = "AgentPoolsClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.getCreateRequest(ctx, resourceGroupName, resourceName, agentPoolName, options) if err != nil { return AgentPoolsClientGetResponse{}, err @@ -321,7 +348,7 @@ func (client *AgentPoolsClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -340,13 +367,17 @@ func (client *AgentPoolsClient) getHandleResponse(resp *http.Response) (AgentPoo // for more details about the version lifecycle. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - options - AgentPoolsClientGetAvailableAgentPoolVersionsOptions contains the optional parameters for the AgentPoolsClient.GetAvailableAgentPoolVersions // method. func (client *AgentPoolsClient) GetAvailableAgentPoolVersions(ctx context.Context, resourceGroupName string, resourceName string, options *AgentPoolsClientGetAvailableAgentPoolVersionsOptions) (AgentPoolsClientGetAvailableAgentPoolVersionsResponse, error) { var err error + const operationName = "AgentPoolsClient.GetAvailableAgentPoolVersions" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.getAvailableAgentPoolVersionsCreateRequest(ctx, resourceGroupName, resourceName, options) if err != nil { return AgentPoolsClientGetAvailableAgentPoolVersionsResponse{}, err @@ -383,7 +414,7 @@ func (client *AgentPoolsClient) getAvailableAgentPoolVersionsCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -401,7 +432,7 @@ func (client *AgentPoolsClient) getAvailableAgentPoolVersionsHandleResponse(resp // GetUpgradeProfile - Gets the upgrade profile for an agent pool. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - agentPoolName - The name of the agent pool. @@ -409,6 +440,10 @@ func (client *AgentPoolsClient) getAvailableAgentPoolVersionsHandleResponse(resp // method. func (client *AgentPoolsClient) GetUpgradeProfile(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, options *AgentPoolsClientGetUpgradeProfileOptions) (AgentPoolsClientGetUpgradeProfileResponse, error) { var err error + const operationName = "AgentPoolsClient.GetUpgradeProfile" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.getUpgradeProfileCreateRequest(ctx, resourceGroupName, resourceName, agentPoolName, options) if err != nil { return AgentPoolsClientGetUpgradeProfileResponse{}, err @@ -449,7 +484,7 @@ func (client *AgentPoolsClient) getUpgradeProfileCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -466,7 +501,7 @@ func (client *AgentPoolsClient) getUpgradeProfileHandleResponse(resp *http.Respo // NewListPager - Gets a list of agent pools in the specified managed cluster. // -// Generated from API version 2023-07-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - options - AgentPoolsClientListOptions contains the optional parameters for the AgentPoolsClient.NewListPager method. @@ -476,25 +511,20 @@ func (client *AgentPoolsClient) NewListPager(resourceGroupName string, resourceN return page.NextLink != nil && len(*page.NextLink) > 0 }, Fetcher: func(ctx context.Context, page *AgentPoolsClientListResponse) (AgentPoolsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, resourceName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "AgentPoolsClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, resourceName, options) + }, nil) if err != nil { return AgentPoolsClientListResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return AgentPoolsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AgentPoolsClientListResponse{}, runtime.NewResponseError(resp) - } return client.listHandleResponse(resp) }, + Tracer: client.internal.Tracer(), }) } @@ -518,7 +548,7 @@ func (client *AgentPoolsClient) listCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -538,7 +568,7 @@ func (client *AgentPoolsClient) listHandleResponse(resp *http.Response) (AgentPo // versions, see: https://docs.microsoft.com/azure/aks/node-image-upgrade // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - agentPoolName - The name of the agent pool. @@ -552,10 +582,13 @@ func (client *AgentPoolsClient) BeginUpgradeNodeImageVersion(ctx context.Context } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AgentPoolsClientUpgradeNodeImageVersionResponse]{ FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), }) return poller, err } else { - return runtime.NewPollerFromResumeToken[AgentPoolsClientUpgradeNodeImageVersionResponse](options.ResumeToken, client.internal.Pipeline(), nil) + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[AgentPoolsClientUpgradeNodeImageVersionResponse]{ + Tracer: client.internal.Tracer(), + }) } } @@ -564,9 +597,13 @@ func (client *AgentPoolsClient) BeginUpgradeNodeImageVersion(ctx context.Context // versions, see: https://docs.microsoft.com/azure/aks/node-image-upgrade // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2024-01-01 func (client *AgentPoolsClient) upgradeNodeImageVersion(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, options *AgentPoolsClientBeginUpgradeNodeImageVersionOptions) (*http.Response, error) { var err error + const operationName = "AgentPoolsClient.BeginUpgradeNodeImageVersion" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.upgradeNodeImageVersionCreateRequest(ctx, resourceGroupName, resourceName, agentPoolName, options) if err != nil { return nil, err @@ -606,7 +643,7 @@ func (client *AgentPoolsClient) upgradeNodeImageVersionCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/assets.json b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/assets.json index f2be3ff2..438b64f4 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/assets.json +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "go", "TagPrefix": "go/resourcemanager/containerservice/armcontainerservice", - "Tag": "go/resourcemanager/containerservice/armcontainerservice_7b6bc13370" + "Tag": "go/resourcemanager/containerservice/armcontainerservice_ca5abdb7bb" } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/autorest.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/autorest.md index 74b4e139..0fcac0bf 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/autorest.md +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/autorest.md @@ -5,9 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/1d2b8c05b55be5dd98ce94c835d7e96ee1ea7f5d/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/1d2b8c05b55be5dd98ce94c835d7e96ee1ea7f5d/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/readme.go.md +- https://github.com/Azure/azure-rest-api-specs/blob/c16ce913afbdaa073e8ca5e480f3b465db2de542/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/readme.md +- https://github.com/Azure/azure-rest-api-specs/blob/c16ce913afbdaa073e8ca5e480f3b465db2de542/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 4.3.0 -tag: package-2023-07 +module-version: 4.8.0 +tag: package-2024-01 ``` diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/build.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/build.go index 3449e1f5..70432c34 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/build.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/build.go @@ -2,6 +2,6 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // This file enables 'go generate' to regenerate this specific SDK -//go:generate pwsh ../../../../eng/scripts/build.ps1 -goExtension "@autorest/go@4.0.0-preview.54" -skipBuild -cleanGenerated -format -tidy -generate -removeUnreferencedTypes resourcemanager/containerservice/armcontainerservice +//go:generate pwsh ../../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate -removeUnreferencedTypes resourcemanager/containerservice/armcontainerservice package armcontainerservice diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/ci.yml b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/ci.yml index 1c361569..176c023b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/ci.yml +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/ci.yml @@ -21,8 +21,8 @@ pr: include: - sdk/resourcemanager/containerservice/armcontainerservice/ -stages: -- template: /eng/pipelines/templates/jobs/archetype-sdk-client.yml +extends: + template: /eng/pipelines/templates/jobs/archetype-sdk-client.yml parameters: IncludeRelease: true ServiceDirectory: 'resourcemanager/containerservice/armcontainerservice' diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/client_factory.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/client_factory.go index fdfb6107..629ced52 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/client_factory.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/client_factory.go @@ -17,62 +17,100 @@ import ( // Don't use this type directly, use NewClientFactory instead. type ClientFactory struct { subscriptionID string - credential azcore.TokenCredential - options *arm.ClientOptions + internal *arm.Client } // NewClientFactory creates a new instance of ClientFactory with the specified values. // The parameter values will be propagated to any client created from this factory. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error) { - _, err := arm.NewClient(moduleName+".ClientFactory", moduleVersion, credential, options) + internal, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { return nil, err } return &ClientFactory{ - subscriptionID: subscriptionID, credential: credential, - options: options.Clone(), + subscriptionID: subscriptionID, + internal: internal, }, nil } +// NewAgentPoolsClient creates a new instance of AgentPoolsClient. func (c *ClientFactory) NewAgentPoolsClient() *AgentPoolsClient { - subClient, _ := NewAgentPoolsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &AgentPoolsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } +// NewMaintenanceConfigurationsClient creates a new instance of MaintenanceConfigurationsClient. func (c *ClientFactory) NewMaintenanceConfigurationsClient() *MaintenanceConfigurationsClient { - subClient, _ := NewMaintenanceConfigurationsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &MaintenanceConfigurationsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } +// NewManagedClustersClient creates a new instance of ManagedClustersClient. func (c *ClientFactory) NewManagedClustersClient() *ManagedClustersClient { - subClient, _ := NewManagedClustersClient(c.subscriptionID, c.credential, c.options) - return subClient + return &ManagedClustersClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } +// NewOperationsClient creates a new instance of OperationsClient. func (c *ClientFactory) NewOperationsClient() *OperationsClient { - subClient, _ := NewOperationsClient(c.credential, c.options) - return subClient + return &OperationsClient{ + internal: c.internal, + } } +// NewPrivateEndpointConnectionsClient creates a new instance of PrivateEndpointConnectionsClient. func (c *ClientFactory) NewPrivateEndpointConnectionsClient() *PrivateEndpointConnectionsClient { - subClient, _ := NewPrivateEndpointConnectionsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &PrivateEndpointConnectionsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } +// NewPrivateLinkResourcesClient creates a new instance of PrivateLinkResourcesClient. func (c *ClientFactory) NewPrivateLinkResourcesClient() *PrivateLinkResourcesClient { - subClient, _ := NewPrivateLinkResourcesClient(c.subscriptionID, c.credential, c.options) - return subClient + return &PrivateLinkResourcesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } +// NewResolvePrivateLinkServiceIDClient creates a new instance of ResolvePrivateLinkServiceIDClient. func (c *ClientFactory) NewResolvePrivateLinkServiceIDClient() *ResolvePrivateLinkServiceIDClient { - subClient, _ := NewResolvePrivateLinkServiceIDClient(c.subscriptionID, c.credential, c.options) - return subClient + return &ResolvePrivateLinkServiceIDClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } +// NewSnapshotsClient creates a new instance of SnapshotsClient. func (c *ClientFactory) NewSnapshotsClient() *SnapshotsClient { - subClient, _ := NewSnapshotsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &SnapshotsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewTrustedAccessRoleBindingsClient creates a new instance of TrustedAccessRoleBindingsClient. +func (c *ClientFactory) NewTrustedAccessRoleBindingsClient() *TrustedAccessRoleBindingsClient { + return &TrustedAccessRoleBindingsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewTrustedAccessRolesClient creates a new instance of TrustedAccessRolesClient. +func (c *ClientFactory) NewTrustedAccessRolesClient() *TrustedAccessRolesClient { + return &TrustedAccessRolesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/constants.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/constants.go index 36e47bef..bc010893 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/constants.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/constants.go @@ -9,8 +9,8 @@ package armcontainerservice const ( - moduleName = "armcontainerservice" - moduleVersion = "v4.3.0" + moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice" + moduleVersion = "v4.8.0" ) // AgentPoolMode - A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent @@ -51,6 +51,24 @@ func PossibleAgentPoolTypeValues() []AgentPoolType { } } +// BackendPoolType - The type of the managed inbound Load Balancer BackendPool. +type BackendPoolType string + +const ( + // BackendPoolTypeNodeIP - The type of the managed inbound Load Balancer BackendPool. https://cloud-provider-azure.sigs.k8s.io/topics/loadbalancer/#configure-load-balancer-backend. + BackendPoolTypeNodeIP BackendPoolType = "NodeIP" + // BackendPoolTypeNodeIPConfiguration - The type of the managed inbound Load Balancer BackendPool. https://cloud-provider-azure.sigs.k8s.io/topics/loadbalancer/#configure-load-balancer-backend. + BackendPoolTypeNodeIPConfiguration BackendPoolType = "NodeIPConfiguration" +) + +// PossibleBackendPoolTypeValues returns the possible values for the BackendPoolType const type. +func PossibleBackendPoolTypeValues() []BackendPoolType { + return []BackendPoolType{ + BackendPoolTypeNodeIP, + BackendPoolTypeNodeIPConfiguration, + } +} + // Code - Tells whether the cluster is Running or Stopped type Code string @@ -209,6 +227,24 @@ func PossibleIPFamilyValues() []IPFamily { } } +// IstioIngressGatewayMode - Mode of an ingress gateway. +type IstioIngressGatewayMode string + +const ( + // IstioIngressGatewayModeExternal - The ingress gateway is assigned a public IP address and is publicly accessible. + IstioIngressGatewayModeExternal IstioIngressGatewayMode = "External" + // IstioIngressGatewayModeInternal - The ingress gateway is assigned an internal IP address and cannot is accessed publicly. + IstioIngressGatewayModeInternal IstioIngressGatewayMode = "Internal" +) + +// PossibleIstioIngressGatewayModeValues returns the possible values for the IstioIngressGatewayMode const type. +func PossibleIstioIngressGatewayModeValues() []IstioIngressGatewayMode { + return []IstioIngressGatewayMode{ + IstioIngressGatewayModeExternal, + IstioIngressGatewayModeInternal, + } +} + // KeyVaultNetworkAccessTypes - Network access of key vault. The possible values are Public and Private. Public means the // key vault allows public access from all networks. Private means the key vault disables public access and // enables private link. The default value is Public. @@ -623,6 +659,24 @@ func PossiblePrivateEndpointConnectionProvisioningStateValues() []PrivateEndpoin } } +// Protocol - The network protocol of the port. +type Protocol string + +const ( + // ProtocolTCP - TCP protocol. + ProtocolTCP Protocol = "TCP" + // ProtocolUDP - UDP protocol. + ProtocolUDP Protocol = "UDP" +) + +// PossibleProtocolValues returns the possible values for the Protocol const type. +func PossibleProtocolValues() []Protocol { + return []Protocol{ + ProtocolTCP, + ProtocolUDP, + } +} + // PublicNetworkAccess - Allow or deny public network access for AKS type PublicNetworkAccess string @@ -724,6 +778,24 @@ func PossibleScaleSetPriorityValues() []ScaleSetPriority { } } +// ServiceMeshMode - Mode of the service mesh. +type ServiceMeshMode string + +const ( + // ServiceMeshModeDisabled - Mesh is disabled. + ServiceMeshModeDisabled ServiceMeshMode = "Disabled" + // ServiceMeshModeIstio - Istio deployed as an AKS addon. + ServiceMeshModeIstio ServiceMeshMode = "Istio" +) + +// PossibleServiceMeshModeValues returns the possible values for the ServiceMeshMode const type. +func PossibleServiceMeshModeValues() []ServiceMeshMode { + return []ServiceMeshMode{ + ServiceMeshModeDisabled, + ServiceMeshModeIstio, + } +} + // SnapshotType - The type of a snapshot. The default is NodePool. type SnapshotType string @@ -739,6 +811,28 @@ func PossibleSnapshotTypeValues() []SnapshotType { } } +// TrustedAccessRoleBindingProvisioningState - The current provisioning state of trusted access role binding. +type TrustedAccessRoleBindingProvisioningState string + +const ( + TrustedAccessRoleBindingProvisioningStateCanceled TrustedAccessRoleBindingProvisioningState = "Canceled" + TrustedAccessRoleBindingProvisioningStateDeleting TrustedAccessRoleBindingProvisioningState = "Deleting" + TrustedAccessRoleBindingProvisioningStateFailed TrustedAccessRoleBindingProvisioningState = "Failed" + TrustedAccessRoleBindingProvisioningStateSucceeded TrustedAccessRoleBindingProvisioningState = "Succeeded" + TrustedAccessRoleBindingProvisioningStateUpdating TrustedAccessRoleBindingProvisioningState = "Updating" +) + +// PossibleTrustedAccessRoleBindingProvisioningStateValues returns the possible values for the TrustedAccessRoleBindingProvisioningState const type. +func PossibleTrustedAccessRoleBindingProvisioningStateValues() []TrustedAccessRoleBindingProvisioningState { + return []TrustedAccessRoleBindingProvisioningState{ + TrustedAccessRoleBindingProvisioningStateCanceled, + TrustedAccessRoleBindingProvisioningStateDeleting, + TrustedAccessRoleBindingProvisioningStateFailed, + TrustedAccessRoleBindingProvisioningStateSucceeded, + TrustedAccessRoleBindingProvisioningStateUpdating, + } +} + // Type - Specifies on which week of the month the dayOfWeek applies. type Type string diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/date_type.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/date_type.go index 64a96c1d..1345db0d 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/date_type.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/date_type.go @@ -13,7 +13,6 @@ import ( "fmt" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "reflect" - "strings" "time" ) @@ -47,7 +46,7 @@ func populateDateType(m map[string]any, k string, t *time.Time) { } func unpopulateDateType(data json.RawMessage, fn string, t **time.Time) error { - if data == nil || strings.EqualFold(string(data), "null") { + if data == nil || string(data) == "null" { return nil } var aux dateType diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/maintenanceconfigurations_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/maintenanceconfigurations_client.go index 8e14b59d..8dd64e67 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/maintenanceconfigurations_client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/maintenanceconfigurations_client.go @@ -28,11 +28,11 @@ type MaintenanceConfigurationsClient struct { } // NewMaintenanceConfigurationsClient creates a new instance of MaintenanceConfigurationsClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewMaintenanceConfigurationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*MaintenanceConfigurationsClient, error) { - cl, err := arm.NewClient(moduleName+".MaintenanceConfigurationsClient", moduleVersion, credential, options) + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { return nil, err } @@ -46,7 +46,7 @@ func NewMaintenanceConfigurationsClient(subscriptionID string, credential azcore // CreateOrUpdate - Creates or updates a maintenance configuration in the specified managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - configName - The name of the maintenance configuration. @@ -55,6 +55,10 @@ func NewMaintenanceConfigurationsClient(subscriptionID string, credential azcore // method. func (client *MaintenanceConfigurationsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, configName string, parameters MaintenanceConfiguration, options *MaintenanceConfigurationsClientCreateOrUpdateOptions) (MaintenanceConfigurationsClientCreateOrUpdateResponse, error) { var err error + const operationName = "MaintenanceConfigurationsClient.CreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, resourceName, configName, parameters, options) if err != nil { return MaintenanceConfigurationsClientCreateOrUpdateResponse{}, err @@ -95,7 +99,7 @@ func (client *MaintenanceConfigurationsClient) createOrUpdateCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -116,7 +120,7 @@ func (client *MaintenanceConfigurationsClient) createOrUpdateHandleResponse(resp // Delete - Deletes a maintenance configuration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - configName - The name of the maintenance configuration. @@ -124,6 +128,10 @@ func (client *MaintenanceConfigurationsClient) createOrUpdateHandleResponse(resp // method. func (client *MaintenanceConfigurationsClient) Delete(ctx context.Context, resourceGroupName string, resourceName string, configName string, options *MaintenanceConfigurationsClientDeleteOptions) (MaintenanceConfigurationsClientDeleteResponse, error) { var err error + const operationName = "MaintenanceConfigurationsClient.Delete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.deleteCreateRequest(ctx, resourceGroupName, resourceName, configName, options) if err != nil { return MaintenanceConfigurationsClientDeleteResponse{}, err @@ -163,7 +171,7 @@ func (client *MaintenanceConfigurationsClient) deleteCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -172,7 +180,7 @@ func (client *MaintenanceConfigurationsClient) deleteCreateRequest(ctx context.C // Get - Gets the specified maintenance configuration of a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - configName - The name of the maintenance configuration. @@ -180,6 +188,10 @@ func (client *MaintenanceConfigurationsClient) deleteCreateRequest(ctx context.C // method. func (client *MaintenanceConfigurationsClient) Get(ctx context.Context, resourceGroupName string, resourceName string, configName string, options *MaintenanceConfigurationsClientGetOptions) (MaintenanceConfigurationsClientGetResponse, error) { var err error + const operationName = "MaintenanceConfigurationsClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.getCreateRequest(ctx, resourceGroupName, resourceName, configName, options) if err != nil { return MaintenanceConfigurationsClientGetResponse{}, err @@ -220,7 +232,7 @@ func (client *MaintenanceConfigurationsClient) getCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -237,7 +249,7 @@ func (client *MaintenanceConfigurationsClient) getHandleResponse(resp *http.Resp // NewListByManagedClusterPager - Gets a list of maintenance configurations in the specified managed cluster. // -// Generated from API version 2023-07-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - options - MaintenanceConfigurationsClientListByManagedClusterOptions contains the optional parameters for the MaintenanceConfigurationsClient.NewListByManagedClusterPager @@ -248,25 +260,20 @@ func (client *MaintenanceConfigurationsClient) NewListByManagedClusterPager(reso return page.NextLink != nil && len(*page.NextLink) > 0 }, Fetcher: func(ctx context.Context, page *MaintenanceConfigurationsClientListByManagedClusterResponse) (MaintenanceConfigurationsClientListByManagedClusterResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByManagedClusterCreateRequest(ctx, resourceGroupName, resourceName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "MaintenanceConfigurationsClient.NewListByManagedClusterPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listByManagedClusterCreateRequest(ctx, resourceGroupName, resourceName, options) + }, nil) if err != nil { return MaintenanceConfigurationsClientListByManagedClusterResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return MaintenanceConfigurationsClientListByManagedClusterResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return MaintenanceConfigurationsClientListByManagedClusterResponse{}, runtime.NewResponseError(resp) - } return client.listByManagedClusterHandleResponse(resp) }, + Tracer: client.internal.Tracer(), }) } @@ -290,7 +297,7 @@ func (client *MaintenanceConfigurationsClient) listByManagedClusterCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/managedclusters_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/managedclusters_client.go index bf9f59c7..784c9765 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/managedclusters_client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/managedclusters_client.go @@ -28,11 +28,11 @@ type ManagedClustersClient struct { } // NewManagedClustersClient creates a new instance of ManagedClustersClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewManagedClustersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagedClustersClient, error) { - cl, err := arm.NewClient(moduleName+".ManagedClustersClient", moduleVersion, credential, options) + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { return nil, err } @@ -48,7 +48,7 @@ func NewManagedClustersClient(subscriptionID string, credential azcore.TokenCred // completes before cancellation can take place, a 409 error code is returned. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - options - ManagedClustersClientBeginAbortLatestOperationOptions contains the optional parameters for the ManagedClustersClient.BeginAbortLatestOperation @@ -61,10 +61,13 @@ func (client *ManagedClustersClient) BeginAbortLatestOperation(ctx context.Conte } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ManagedClustersClientAbortLatestOperationResponse]{ FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), }) return poller, err } else { - return runtime.NewPollerFromResumeToken[ManagedClustersClientAbortLatestOperationResponse](options.ResumeToken, client.internal.Pipeline(), nil) + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ManagedClustersClientAbortLatestOperationResponse]{ + Tracer: client.internal.Tracer(), + }) } } @@ -73,9 +76,13 @@ func (client *ManagedClustersClient) BeginAbortLatestOperation(ctx context.Conte // completes before cancellation can take place, a 409 error code is returned. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2024-01-01 func (client *ManagedClustersClient) abortLatestOperation(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersClientBeginAbortLatestOperationOptions) (*http.Response, error) { var err error + const operationName = "ManagedClustersClient.BeginAbortLatestOperation" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.abortLatestOperationCreateRequest(ctx, resourceGroupName, resourceName, options) if err != nil { return nil, err @@ -111,7 +118,7 @@ func (client *ManagedClustersClient) abortLatestOperationCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -120,7 +127,7 @@ func (client *ManagedClustersClient) abortLatestOperationCreateRequest(ctx conte // BeginCreateOrUpdate - Creates or updates a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - parameters - The managed cluster to create or update. @@ -132,19 +139,27 @@ func (client *ManagedClustersClient) BeginCreateOrUpdate(ctx context.Context, re if err != nil { return nil, err } - poller, err := runtime.NewPoller[ManagedClustersClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ManagedClustersClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) return poller, err } else { - return runtime.NewPollerFromResumeToken[ManagedClustersClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ManagedClustersClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) } } // CreateOrUpdate - Creates or updates a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2024-01-01 func (client *ManagedClustersClient) createOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, parameters ManagedCluster, options *ManagedClustersClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error + const operationName = "ManagedClustersClient.BeginCreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, resourceName, parameters, options) if err != nil { return nil, err @@ -180,7 +195,7 @@ func (client *ManagedClustersClient) createOrUpdateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -192,7 +207,7 @@ func (client *ManagedClustersClient) createOrUpdateCreateRequest(ctx context.Con // BeginDelete - Deletes a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - options - ManagedClustersClientBeginDeleteOptions contains the optional parameters for the ManagedClustersClient.BeginDelete @@ -203,19 +218,27 @@ func (client *ManagedClustersClient) BeginDelete(ctx context.Context, resourceGr if err != nil { return nil, err } - poller, err := runtime.NewPoller[ManagedClustersClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ManagedClustersClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) return poller, err } else { - return runtime.NewPollerFromResumeToken[ManagedClustersClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ManagedClustersClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) } } // Delete - Deletes a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2024-01-01 func (client *ManagedClustersClient) deleteOperation(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersClientBeginDeleteOptions) (*http.Response, error) { var err error + const operationName = "ManagedClustersClient.BeginDelete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.deleteCreateRequest(ctx, resourceGroupName, resourceName, options) if err != nil { return nil, err @@ -251,7 +274,7 @@ func (client *ManagedClustersClient) deleteCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -260,12 +283,16 @@ func (client *ManagedClustersClient) deleteCreateRequest(ctx context.Context, re // Get - Gets a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - options - ManagedClustersClientGetOptions contains the optional parameters for the ManagedClustersClient.Get method. func (client *ManagedClustersClient) Get(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersClientGetOptions) (ManagedClustersClientGetResponse, error) { var err error + const operationName = "ManagedClustersClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.getCreateRequest(ctx, resourceGroupName, resourceName, options) if err != nil { return ManagedClustersClientGetResponse{}, err @@ -302,7 +329,7 @@ func (client *ManagedClustersClient) getCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -322,7 +349,7 @@ func (client *ManagedClustersClient) getHandleResponse(resp *http.Response) (Man // [https://docs.microsoft.com/rest/api/aks/managedclusters/listclusteradmincredentials] . // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - roleName - The name of the role for managed cluster accessProfile resource. @@ -330,6 +357,10 @@ func (client *ManagedClustersClient) getHandleResponse(resp *http.Response) (Man // method. func (client *ManagedClustersClient) GetAccessProfile(ctx context.Context, resourceGroupName string, resourceName string, roleName string, options *ManagedClustersClientGetAccessProfileOptions) (ManagedClustersClientGetAccessProfileResponse, error) { var err error + const operationName = "ManagedClustersClient.GetAccessProfile" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.getAccessProfileCreateRequest(ctx, resourceGroupName, resourceName, roleName, options) if err != nil { return ManagedClustersClientGetAccessProfileResponse{}, err @@ -370,7 +401,7 @@ func (client *ManagedClustersClient) getAccessProfileCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -388,7 +419,7 @@ func (client *ManagedClustersClient) getAccessProfileHandleResponse(resp *http.R // GetCommandResult - Gets the results of a command which has been run on the Managed Cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - commandID - Id of the command. @@ -396,6 +427,10 @@ func (client *ManagedClustersClient) getAccessProfileHandleResponse(resp *http.R // method. func (client *ManagedClustersClient) GetCommandResult(ctx context.Context, resourceGroupName string, resourceName string, commandID string, options *ManagedClustersClientGetCommandResultOptions) (ManagedClustersClientGetCommandResultResponse, error) { var err error + const operationName = "ManagedClustersClient.GetCommandResult" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.getCommandResultCreateRequest(ctx, resourceGroupName, resourceName, commandID, options) if err != nil { return ManagedClustersClientGetCommandResultResponse{}, err @@ -436,7 +471,7 @@ func (client *ManagedClustersClient) getCommandResultCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -454,15 +489,155 @@ func (client *ManagedClustersClient) getCommandResultHandleResponse(resp *http.R return result, nil } +// GetMeshRevisionProfile - Contains extra metadata on the revision, including supported revisions, cluster compatibility +// and available upgrades +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01 +// - location - The name of the Azure region. +// - mode - The mode of the mesh. +// - options - ManagedClustersClientGetMeshRevisionProfileOptions contains the optional parameters for the ManagedClustersClient.GetMeshRevisionProfile +// method. +func (client *ManagedClustersClient) GetMeshRevisionProfile(ctx context.Context, location string, mode string, options *ManagedClustersClientGetMeshRevisionProfileOptions) (ManagedClustersClientGetMeshRevisionProfileResponse, error) { + var err error + const operationName = "ManagedClustersClient.GetMeshRevisionProfile" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getMeshRevisionProfileCreateRequest(ctx, location, mode, options) + if err != nil { + return ManagedClustersClientGetMeshRevisionProfileResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ManagedClustersClientGetMeshRevisionProfileResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ManagedClustersClientGetMeshRevisionProfileResponse{}, err + } + resp, err := client.getMeshRevisionProfileHandleResponse(httpResp) + return resp, err +} + +// getMeshRevisionProfileCreateRequest creates the GetMeshRevisionProfile request. +func (client *ManagedClustersClient) getMeshRevisionProfileCreateRequest(ctx context.Context, location string, mode string, options *ManagedClustersClientGetMeshRevisionProfileOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/meshRevisionProfiles/{mode}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if location == "" { + return nil, errors.New("parameter location cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) + if mode == "" { + return nil, errors.New("parameter mode cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{mode}", url.PathEscape(mode)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getMeshRevisionProfileHandleResponse handles the GetMeshRevisionProfile response. +func (client *ManagedClustersClient) getMeshRevisionProfileHandleResponse(resp *http.Response) (ManagedClustersClientGetMeshRevisionProfileResponse, error) { + result := ManagedClustersClientGetMeshRevisionProfileResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.MeshRevisionProfile); err != nil { + return ManagedClustersClientGetMeshRevisionProfileResponse{}, err + } + return result, nil +} + +// GetMeshUpgradeProfile - Gets available upgrades for a service mesh in a cluster. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - resourceName - The name of the managed cluster resource. +// - mode - The mode of the mesh. +// - options - ManagedClustersClientGetMeshUpgradeProfileOptions contains the optional parameters for the ManagedClustersClient.GetMeshUpgradeProfile +// method. +func (client *ManagedClustersClient) GetMeshUpgradeProfile(ctx context.Context, resourceGroupName string, resourceName string, mode string, options *ManagedClustersClientGetMeshUpgradeProfileOptions) (ManagedClustersClientGetMeshUpgradeProfileResponse, error) { + var err error + const operationName = "ManagedClustersClient.GetMeshUpgradeProfile" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getMeshUpgradeProfileCreateRequest(ctx, resourceGroupName, resourceName, mode, options) + if err != nil { + return ManagedClustersClientGetMeshUpgradeProfileResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ManagedClustersClientGetMeshUpgradeProfileResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ManagedClustersClientGetMeshUpgradeProfileResponse{}, err + } + resp, err := client.getMeshUpgradeProfileHandleResponse(httpResp) + return resp, err +} + +// getMeshUpgradeProfileCreateRequest creates the GetMeshUpgradeProfile request. +func (client *ManagedClustersClient) getMeshUpgradeProfileCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, mode string, options *ManagedClustersClientGetMeshUpgradeProfileOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/meshUpgradeProfiles/{mode}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + if mode == "" { + return nil, errors.New("parameter mode cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{mode}", url.PathEscape(mode)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getMeshUpgradeProfileHandleResponse handles the GetMeshUpgradeProfile response. +func (client *ManagedClustersClient) getMeshUpgradeProfileHandleResponse(resp *http.Response) (ManagedClustersClientGetMeshUpgradeProfileResponse, error) { + result := ManagedClustersClientGetMeshUpgradeProfileResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.MeshUpgradeProfile); err != nil { + return ManagedClustersClientGetMeshUpgradeProfileResponse{}, err + } + return result, nil +} + // GetOSOptions - Gets supported OS options in the specified subscription. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 -// - location - The name of Azure region. +// Generated from API version 2024-01-01 +// - location - The name of the Azure region. // - options - ManagedClustersClientGetOSOptionsOptions contains the optional parameters for the ManagedClustersClient.GetOSOptions // method. func (client *ManagedClustersClient) GetOSOptions(ctx context.Context, location string, options *ManagedClustersClientGetOSOptionsOptions) (ManagedClustersClientGetOSOptionsResponse, error) { var err error + const operationName = "ManagedClustersClient.GetOSOptions" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.getOSOptionsCreateRequest(ctx, location, options) if err != nil { return ManagedClustersClientGetOSOptionsResponse{}, err @@ -495,7 +670,7 @@ func (client *ManagedClustersClient) getOSOptionsCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2024-01-01") if options != nil && options.ResourceType != nil { reqQP.Set("resource-type", *options.ResourceType) } @@ -516,13 +691,17 @@ func (client *ManagedClustersClient) getOSOptionsHandleResponse(resp *http.Respo // GetUpgradeProfile - Gets the upgrade profile of a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - options - ManagedClustersClientGetUpgradeProfileOptions contains the optional parameters for the ManagedClustersClient.GetUpgradeProfile // method. func (client *ManagedClustersClient) GetUpgradeProfile(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersClientGetUpgradeProfileOptions) (ManagedClustersClientGetUpgradeProfileResponse, error) { var err error + const operationName = "ManagedClustersClient.GetUpgradeProfile" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.getUpgradeProfileCreateRequest(ctx, resourceGroupName, resourceName, options) if err != nil { return ManagedClustersClientGetUpgradeProfileResponse{}, err @@ -559,7 +738,7 @@ func (client *ManagedClustersClient) getUpgradeProfileCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -576,7 +755,7 @@ func (client *ManagedClustersClient) getUpgradeProfileHandleResponse(resp *http. // NewListPager - Gets a list of managed clusters in the specified subscription. // -// Generated from API version 2023-07-01 +// Generated from API version 2024-01-01 // - options - ManagedClustersClientListOptions contains the optional parameters for the ManagedClustersClient.NewListPager // method. func (client *ManagedClustersClient) NewListPager(options *ManagedClustersClientListOptions) *runtime.Pager[ManagedClustersClientListResponse] { @@ -585,25 +764,20 @@ func (client *ManagedClustersClient) NewListPager(options *ManagedClustersClient return page.NextLink != nil && len(*page.NextLink) > 0 }, Fetcher: func(ctx context.Context, page *ManagedClustersClientListResponse) (ManagedClustersClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ManagedClustersClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, options) + }, nil) if err != nil { return ManagedClustersClientListResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return ManagedClustersClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ManagedClustersClientListResponse{}, runtime.NewResponseError(resp) - } return client.listHandleResponse(resp) }, + Tracer: client.internal.Tracer(), }) } @@ -619,7 +793,7 @@ func (client *ManagedClustersClient) listCreateRequest(ctx context.Context, opti return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -636,7 +810,7 @@ func (client *ManagedClustersClient) listHandleResponse(resp *http.Response) (Ma // NewListByResourceGroupPager - Lists managed clusters in the specified subscription and resource group. // -// Generated from API version 2023-07-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - ManagedClustersClientListByResourceGroupOptions contains the optional parameters for the ManagedClustersClient.NewListByResourceGroupPager // method. @@ -646,25 +820,20 @@ func (client *ManagedClustersClient) NewListByResourceGroupPager(resourceGroupNa return page.NextLink != nil && len(*page.NextLink) > 0 }, Fetcher: func(ctx context.Context, page *ManagedClustersClientListByResourceGroupResponse) (ManagedClustersClientListByResourceGroupResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return ManagedClustersClientListByResourceGroupResponse{}, err + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ManagedClustersClient.NewListByResourceGroupPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink } - resp, err := client.internal.Pipeline().Do(req) + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + }, nil) if err != nil { return ManagedClustersClientListByResourceGroupResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ManagedClustersClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) - } return client.listByResourceGroupHandleResponse(resp) }, + Tracer: client.internal.Tracer(), }) } @@ -684,7 +853,7 @@ func (client *ManagedClustersClient) listByResourceGroupCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -702,13 +871,17 @@ func (client *ManagedClustersClient) listByResourceGroupHandleResponse(resp *htt // ListClusterAdminCredentials - Lists the admin credentials of a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - options - ManagedClustersClientListClusterAdminCredentialsOptions contains the optional parameters for the ManagedClustersClient.ListClusterAdminCredentials // method. func (client *ManagedClustersClient) ListClusterAdminCredentials(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersClientListClusterAdminCredentialsOptions) (ManagedClustersClientListClusterAdminCredentialsResponse, error) { var err error + const operationName = "ManagedClustersClient.ListClusterAdminCredentials" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.listClusterAdminCredentialsCreateRequest(ctx, resourceGroupName, resourceName, options) if err != nil { return ManagedClustersClientListClusterAdminCredentialsResponse{}, err @@ -745,7 +918,7 @@ func (client *ManagedClustersClient) listClusterAdminCredentialsCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2024-01-01") if options != nil && options.ServerFqdn != nil { reqQP.Set("server-fqdn", *options.ServerFqdn) } @@ -766,13 +939,17 @@ func (client *ManagedClustersClient) listClusterAdminCredentialsHandleResponse(r // ListClusterMonitoringUserCredentials - Lists the cluster monitoring user credentials of a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - options - ManagedClustersClientListClusterMonitoringUserCredentialsOptions contains the optional parameters for the ManagedClustersClient.ListClusterMonitoringUserCredentials // method. func (client *ManagedClustersClient) ListClusterMonitoringUserCredentials(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersClientListClusterMonitoringUserCredentialsOptions) (ManagedClustersClientListClusterMonitoringUserCredentialsResponse, error) { var err error + const operationName = "ManagedClustersClient.ListClusterMonitoringUserCredentials" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.listClusterMonitoringUserCredentialsCreateRequest(ctx, resourceGroupName, resourceName, options) if err != nil { return ManagedClustersClientListClusterMonitoringUserCredentialsResponse{}, err @@ -809,7 +986,7 @@ func (client *ManagedClustersClient) listClusterMonitoringUserCredentialsCreateR return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2024-01-01") if options != nil && options.ServerFqdn != nil { reqQP.Set("server-fqdn", *options.ServerFqdn) } @@ -830,13 +1007,17 @@ func (client *ManagedClustersClient) listClusterMonitoringUserCredentialsHandleR // ListClusterUserCredentials - Lists the user credentials of a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - options - ManagedClustersClientListClusterUserCredentialsOptions contains the optional parameters for the ManagedClustersClient.ListClusterUserCredentials // method. func (client *ManagedClustersClient) ListClusterUserCredentials(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersClientListClusterUserCredentialsOptions) (ManagedClustersClientListClusterUserCredentialsResponse, error) { var err error + const operationName = "ManagedClustersClient.ListClusterUserCredentials" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.listClusterUserCredentialsCreateRequest(ctx, resourceGroupName, resourceName, options) if err != nil { return ManagedClustersClientListClusterUserCredentialsResponse{}, err @@ -873,13 +1054,13 @@ func (client *ManagedClustersClient) listClusterUserCredentialsCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") - if options != nil && options.ServerFqdn != nil { - reqQP.Set("server-fqdn", *options.ServerFqdn) - } + reqQP.Set("api-version", "2024-01-01") if options != nil && options.Format != nil { reqQP.Set("format", string(*options.Format)) } + if options != nil && options.ServerFqdn != nil { + reqQP.Set("server-fqdn", *options.ServerFqdn) + } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -898,12 +1079,16 @@ func (client *ManagedClustersClient) listClusterUserCredentialsHandleResponse(re // upgrades, and details on preview status of the version // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 -// - location - The name of Azure region. +// Generated from API version 2024-01-01 +// - location - The name of the Azure region. // - options - ManagedClustersClientListKubernetesVersionsOptions contains the optional parameters for the ManagedClustersClient.ListKubernetesVersions // method. func (client *ManagedClustersClient) ListKubernetesVersions(ctx context.Context, location string, options *ManagedClustersClientListKubernetesVersionsOptions) (ManagedClustersClientListKubernetesVersionsResponse, error) { var err error + const operationName = "ManagedClustersClient.ListKubernetesVersions" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.listKubernetesVersionsCreateRequest(ctx, location, options) if err != nil { return ManagedClustersClientListKubernetesVersionsResponse{}, err @@ -936,7 +1121,7 @@ func (client *ManagedClustersClient) listKubernetesVersionsCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -951,10 +1136,136 @@ func (client *ManagedClustersClient) listKubernetesVersionsHandleResponse(resp * return result, nil } +// NewListMeshRevisionProfilesPager - Contains extra metadata on each revision, including supported revisions, cluster compatibility +// and available upgrades +// +// Generated from API version 2024-01-01 +// - location - The name of the Azure region. +// - options - ManagedClustersClientListMeshRevisionProfilesOptions contains the optional parameters for the ManagedClustersClient.NewListMeshRevisionProfilesPager +// method. +func (client *ManagedClustersClient) NewListMeshRevisionProfilesPager(location string, options *ManagedClustersClientListMeshRevisionProfilesOptions) *runtime.Pager[ManagedClustersClientListMeshRevisionProfilesResponse] { + return runtime.NewPager(runtime.PagingHandler[ManagedClustersClientListMeshRevisionProfilesResponse]{ + More: func(page ManagedClustersClientListMeshRevisionProfilesResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ManagedClustersClientListMeshRevisionProfilesResponse) (ManagedClustersClientListMeshRevisionProfilesResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ManagedClustersClient.NewListMeshRevisionProfilesPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listMeshRevisionProfilesCreateRequest(ctx, location, options) + }, nil) + if err != nil { + return ManagedClustersClientListMeshRevisionProfilesResponse{}, err + } + return client.listMeshRevisionProfilesHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listMeshRevisionProfilesCreateRequest creates the ListMeshRevisionProfiles request. +func (client *ManagedClustersClient) listMeshRevisionProfilesCreateRequest(ctx context.Context, location string, options *ManagedClustersClientListMeshRevisionProfilesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/meshRevisionProfiles" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if location == "" { + return nil, errors.New("parameter location cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listMeshRevisionProfilesHandleResponse handles the ListMeshRevisionProfiles response. +func (client *ManagedClustersClient) listMeshRevisionProfilesHandleResponse(resp *http.Response) (ManagedClustersClientListMeshRevisionProfilesResponse, error) { + result := ManagedClustersClientListMeshRevisionProfilesResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.MeshRevisionProfileList); err != nil { + return ManagedClustersClientListMeshRevisionProfilesResponse{}, err + } + return result, nil +} + +// NewListMeshUpgradeProfilesPager - Lists available upgrades for all service meshes in a specific cluster. +// +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - resourceName - The name of the managed cluster resource. +// - options - ManagedClustersClientListMeshUpgradeProfilesOptions contains the optional parameters for the ManagedClustersClient.NewListMeshUpgradeProfilesPager +// method. +func (client *ManagedClustersClient) NewListMeshUpgradeProfilesPager(resourceGroupName string, resourceName string, options *ManagedClustersClientListMeshUpgradeProfilesOptions) *runtime.Pager[ManagedClustersClientListMeshUpgradeProfilesResponse] { + return runtime.NewPager(runtime.PagingHandler[ManagedClustersClientListMeshUpgradeProfilesResponse]{ + More: func(page ManagedClustersClientListMeshUpgradeProfilesResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ManagedClustersClientListMeshUpgradeProfilesResponse) (ManagedClustersClientListMeshUpgradeProfilesResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ManagedClustersClient.NewListMeshUpgradeProfilesPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listMeshUpgradeProfilesCreateRequest(ctx, resourceGroupName, resourceName, options) + }, nil) + if err != nil { + return ManagedClustersClientListMeshUpgradeProfilesResponse{}, err + } + return client.listMeshUpgradeProfilesHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listMeshUpgradeProfilesCreateRequest creates the ListMeshUpgradeProfiles request. +func (client *ManagedClustersClient) listMeshUpgradeProfilesCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersClientListMeshUpgradeProfilesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/meshUpgradeProfiles" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listMeshUpgradeProfilesHandleResponse handles the ListMeshUpgradeProfiles response. +func (client *ManagedClustersClient) listMeshUpgradeProfilesHandleResponse(resp *http.Response) (ManagedClustersClientListMeshUpgradeProfilesResponse, error) { + result := ManagedClustersClientListMeshUpgradeProfilesResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.MeshUpgradeProfileList); err != nil { + return ManagedClustersClientListMeshUpgradeProfilesResponse{}, err + } + return result, nil +} + // NewListOutboundNetworkDependenciesEndpointsPager - Gets a list of egress endpoints (network endpoints of all outbound dependencies) // in the specified managed cluster. The operation returns properties of each egress endpoint. // -// Generated from API version 2023-07-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - options - ManagedClustersClientListOutboundNetworkDependenciesEndpointsOptions contains the optional parameters for the @@ -965,25 +1276,20 @@ func (client *ManagedClustersClient) NewListOutboundNetworkDependenciesEndpoints return page.NextLink != nil && len(*page.NextLink) > 0 }, Fetcher: func(ctx context.Context, page *ManagedClustersClientListOutboundNetworkDependenciesEndpointsResponse) (ManagedClustersClientListOutboundNetworkDependenciesEndpointsResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listOutboundNetworkDependenciesEndpointsCreateRequest(ctx, resourceGroupName, resourceName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ManagedClustersClient.NewListOutboundNetworkDependenciesEndpointsPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listOutboundNetworkDependenciesEndpointsCreateRequest(ctx, resourceGroupName, resourceName, options) + }, nil) if err != nil { return ManagedClustersClientListOutboundNetworkDependenciesEndpointsResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return ManagedClustersClientListOutboundNetworkDependenciesEndpointsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ManagedClustersClientListOutboundNetworkDependenciesEndpointsResponse{}, runtime.NewResponseError(resp) - } return client.listOutboundNetworkDependenciesEndpointsHandleResponse(resp) }, + Tracer: client.internal.Tracer(), }) } @@ -1007,7 +1313,7 @@ func (client *ManagedClustersClient) listOutboundNetworkDependenciesEndpointsCre return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1026,7 +1332,7 @@ func (client *ManagedClustersClient) listOutboundNetworkDependenciesEndpointsHan // [https://aka.ms/aks-managed-aad] to update your cluster with AKS-managed Azure AD. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - parameters - The AAD profile to set on the Managed Cluster @@ -1040,10 +1346,13 @@ func (client *ManagedClustersClient) BeginResetAADProfile(ctx context.Context, r } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ManagedClustersClientResetAADProfileResponse]{ FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), }) return poller, err } else { - return runtime.NewPollerFromResumeToken[ManagedClustersClientResetAADProfileResponse](options.ResumeToken, client.internal.Pipeline(), nil) + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ManagedClustersClientResetAADProfileResponse]{ + Tracer: client.internal.Tracer(), + }) } } @@ -1051,9 +1360,13 @@ func (client *ManagedClustersClient) BeginResetAADProfile(ctx context.Context, r // to update your cluster with AKS-managed Azure AD. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2024-01-01 func (client *ManagedClustersClient) resetAADProfile(ctx context.Context, resourceGroupName string, resourceName string, parameters ManagedClusterAADProfile, options *ManagedClustersClientBeginResetAADProfileOptions) (*http.Response, error) { var err error + const operationName = "ManagedClustersClient.BeginResetAADProfile" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.resetAADProfileCreateRequest(ctx, resourceGroupName, resourceName, parameters, options) if err != nil { return nil, err @@ -1089,7 +1402,7 @@ func (client *ManagedClustersClient) resetAADProfileCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -1101,7 +1414,7 @@ func (client *ManagedClustersClient) resetAADProfileCreateRequest(ctx context.Co // BeginResetServicePrincipalProfile - This action cannot be performed on a cluster that is not using a service principal // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - parameters - The service principal profile to set on the managed cluster. @@ -1115,19 +1428,26 @@ func (client *ManagedClustersClient) BeginResetServicePrincipalProfile(ctx conte } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ManagedClustersClientResetServicePrincipalProfileResponse]{ FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), }) return poller, err } else { - return runtime.NewPollerFromResumeToken[ManagedClustersClientResetServicePrincipalProfileResponse](options.ResumeToken, client.internal.Pipeline(), nil) + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ManagedClustersClientResetServicePrincipalProfileResponse]{ + Tracer: client.internal.Tracer(), + }) } } // ResetServicePrincipalProfile - This action cannot be performed on a cluster that is not using a service principal // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2024-01-01 func (client *ManagedClustersClient) resetServicePrincipalProfile(ctx context.Context, resourceGroupName string, resourceName string, parameters ManagedClusterServicePrincipalProfile, options *ManagedClustersClientBeginResetServicePrincipalProfileOptions) (*http.Response, error) { var err error + const operationName = "ManagedClustersClient.BeginResetServicePrincipalProfile" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.resetServicePrincipalProfileCreateRequest(ctx, resourceGroupName, resourceName, parameters, options) if err != nil { return nil, err @@ -1163,7 +1483,7 @@ func (client *ManagedClustersClient) resetServicePrincipalProfileCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -1176,7 +1496,7 @@ func (client *ManagedClustersClient) resetServicePrincipalProfileCreateRequest(c // more details about rotating managed cluster certificates. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - options - ManagedClustersClientBeginRotateClusterCertificatesOptions contains the optional parameters for the ManagedClustersClient.BeginRotateClusterCertificates @@ -1189,10 +1509,13 @@ func (client *ManagedClustersClient) BeginRotateClusterCertificates(ctx context. } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ManagedClustersClientRotateClusterCertificatesResponse]{ FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), }) return poller, err } else { - return runtime.NewPollerFromResumeToken[ManagedClustersClientRotateClusterCertificatesResponse](options.ResumeToken, client.internal.Pipeline(), nil) + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ManagedClustersClientRotateClusterCertificatesResponse]{ + Tracer: client.internal.Tracer(), + }) } } @@ -1200,9 +1523,13 @@ func (client *ManagedClustersClient) BeginRotateClusterCertificates(ctx context. // details about rotating managed cluster certificates. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2024-01-01 func (client *ManagedClustersClient) rotateClusterCertificates(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersClientBeginRotateClusterCertificatesOptions) (*http.Response, error) { var err error + const operationName = "ManagedClustersClient.BeginRotateClusterCertificates" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.rotateClusterCertificatesCreateRequest(ctx, resourceGroupName, resourceName, options) if err != nil { return nil, err @@ -1238,7 +1565,7 @@ func (client *ManagedClustersClient) rotateClusterCertificatesCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1247,7 +1574,7 @@ func (client *ManagedClustersClient) rotateClusterCertificatesCreateRequest(ctx // BeginRotateServiceAccountSigningKeys - Rotates the service account signing keys of a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - options - ManagedClustersClientBeginRotateServiceAccountSigningKeysOptions contains the optional parameters for the ManagedClustersClient.BeginRotateServiceAccountSigningKeys @@ -1260,19 +1587,26 @@ func (client *ManagedClustersClient) BeginRotateServiceAccountSigningKeys(ctx co } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ManagedClustersClientRotateServiceAccountSigningKeysResponse]{ FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), }) return poller, err } else { - return runtime.NewPollerFromResumeToken[ManagedClustersClientRotateServiceAccountSigningKeysResponse](options.ResumeToken, client.internal.Pipeline(), nil) + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ManagedClustersClientRotateServiceAccountSigningKeysResponse]{ + Tracer: client.internal.Tracer(), + }) } } // RotateServiceAccountSigningKeys - Rotates the service account signing keys of a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2024-01-01 func (client *ManagedClustersClient) rotateServiceAccountSigningKeys(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersClientBeginRotateServiceAccountSigningKeysOptions) (*http.Response, error) { var err error + const operationName = "ManagedClustersClient.BeginRotateServiceAccountSigningKeys" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.rotateServiceAccountSigningKeysCreateRequest(ctx, resourceGroupName, resourceName, options) if err != nil { return nil, err @@ -1308,7 +1642,7 @@ func (client *ManagedClustersClient) rotateServiceAccountSigningKeysCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1319,7 +1653,7 @@ func (client *ManagedClustersClient) rotateServiceAccountSigningKeysCreateReques // [https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview]. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - requestPayload - The run command request @@ -1333,10 +1667,13 @@ func (client *ManagedClustersClient) BeginRunCommand(ctx context.Context, resour } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ManagedClustersClientRunCommandResponse]{ FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), }) return poller, err } else { - return runtime.NewPollerFromResumeToken[ManagedClustersClientRunCommandResponse](options.ResumeToken, client.internal.Pipeline(), nil) + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ManagedClustersClientRunCommandResponse]{ + Tracer: client.internal.Tracer(), + }) } } @@ -1345,9 +1682,13 @@ func (client *ManagedClustersClient) BeginRunCommand(ctx context.Context, resour // [https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview]. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2024-01-01 func (client *ManagedClustersClient) runCommand(ctx context.Context, resourceGroupName string, resourceName string, requestPayload RunCommandRequest, options *ManagedClustersClientBeginRunCommandOptions) (*http.Response, error) { var err error + const operationName = "ManagedClustersClient.BeginRunCommand" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.runCommandCreateRequest(ctx, resourceGroupName, resourceName, requestPayload, options) if err != nil { return nil, err @@ -1383,7 +1724,7 @@ func (client *ManagedClustersClient) runCommandCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, requestPayload); err != nil { @@ -1396,7 +1737,7 @@ func (client *ManagedClustersClient) runCommandCreateRequest(ctx context.Context // a cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - options - ManagedClustersClientBeginStartOptions contains the optional parameters for the ManagedClustersClient.BeginStart @@ -1409,10 +1750,13 @@ func (client *ManagedClustersClient) BeginStart(ctx context.Context, resourceGro } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ManagedClustersClientStartResponse]{ FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), }) return poller, err } else { - return runtime.NewPollerFromResumeToken[ManagedClustersClientStartResponse](options.ResumeToken, client.internal.Pipeline(), nil) + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ManagedClustersClientStartResponse]{ + Tracer: client.internal.Tracer(), + }) } } @@ -1420,9 +1764,13 @@ func (client *ManagedClustersClient) BeginStart(ctx context.Context, resourceGro // a cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2024-01-01 func (client *ManagedClustersClient) start(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersClientBeginStartOptions) (*http.Response, error) { var err error + const operationName = "ManagedClustersClient.BeginStart" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.startCreateRequest(ctx, resourceGroupName, resourceName, options) if err != nil { return nil, err @@ -1458,7 +1806,7 @@ func (client *ManagedClustersClient) startCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1470,7 +1818,7 @@ func (client *ManagedClustersClient) startCreateRequest(ctx context.Context, res // for more details about stopping a cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - options - ManagedClustersClientBeginStopOptions contains the optional parameters for the ManagedClustersClient.BeginStop @@ -1483,10 +1831,13 @@ func (client *ManagedClustersClient) BeginStop(ctx context.Context, resourceGrou } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ManagedClustersClientStopResponse]{ FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), }) return poller, err } else { - return runtime.NewPollerFromResumeToken[ManagedClustersClientStopResponse](options.ResumeToken, client.internal.Pipeline(), nil) + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ManagedClustersClientStopResponse]{ + Tracer: client.internal.Tracer(), + }) } } @@ -1496,9 +1847,13 @@ func (client *ManagedClustersClient) BeginStop(ctx context.Context, resourceGrou // for more details about stopping a cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2024-01-01 func (client *ManagedClustersClient) stop(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersClientBeginStopOptions) (*http.Response, error) { var err error + const operationName = "ManagedClustersClient.BeginStop" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.stopCreateRequest(ctx, resourceGroupName, resourceName, options) if err != nil { return nil, err @@ -1534,7 +1889,7 @@ func (client *ManagedClustersClient) stopCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1543,7 +1898,7 @@ func (client *ManagedClustersClient) stopCreateRequest(ctx context.Context, reso // BeginUpdateTags - Updates tags on a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - parameters - Parameters supplied to the Update Managed Cluster Tags operation. @@ -1555,19 +1910,27 @@ func (client *ManagedClustersClient) BeginUpdateTags(ctx context.Context, resour if err != nil { return nil, err } - poller, err := runtime.NewPoller[ManagedClustersClientUpdateTagsResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ManagedClustersClientUpdateTagsResponse]{ + Tracer: client.internal.Tracer(), + }) return poller, err } else { - return runtime.NewPollerFromResumeToken[ManagedClustersClientUpdateTagsResponse](options.ResumeToken, client.internal.Pipeline(), nil) + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ManagedClustersClientUpdateTagsResponse]{ + Tracer: client.internal.Tracer(), + }) } } // UpdateTags - Updates tags on a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2024-01-01 func (client *ManagedClustersClient) updateTags(ctx context.Context, resourceGroupName string, resourceName string, parameters TagsObject, options *ManagedClustersClientBeginUpdateTagsOptions) (*http.Response, error) { var err error + const operationName = "ManagedClustersClient.BeginUpdateTags" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, resourceName, parameters, options) if err != nil { return nil, err @@ -1603,7 +1966,7 @@ func (client *ManagedClustersClient) updateTagsCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/models.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/models.go index 4c7940a3..6b146803 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/models.go @@ -81,6 +81,18 @@ type AgentPoolListResult struct { NextLink *string } +// AgentPoolNetworkProfile - Network settings of an agent pool. +type AgentPoolNetworkProfile struct { + // The port ranges that are allowed to access. The specified ranges are allowed to overlap. + AllowedHostPorts []*PortRange + + // The IDs of the application security groups which agent pool will associate when created. + ApplicationSecurityGroups []*string + + // IPTags of instance-level public IPs. + NodePublicIPTags []*IPTag +} + // AgentPoolUpgradeProfile - The list of available upgrades for an agent pool. type AgentPoolUpgradeProfile struct { // REQUIRED; The properties of the agent pool upgrade profile. @@ -132,6 +144,10 @@ type AgentPoolUpgradeSettings struct { // practices, see: // https://docs.microsoft.com/azure/aks/upgrade-cluster#customize-node-surge-upgrade MaxSurge *string + + // The amount of time (in minutes) to wait after draining a node and before reimaging it and moving on to next node. If not + // specified, the default is 0 minutes. + NodeSoakDurationInMinutes *int32 } // AzureKeyVaultKms - Azure Key Vault key management service settings for the security profile. @@ -182,6 +198,15 @@ type CommandResultProperties struct { StartedAt *time.Time } +// CompatibleVersions - Version information about a product/service that is compatible with a service mesh revision. +type CompatibleVersions struct { + // The product/service name. + Name *string + + // Product/service versions compatible with a service mesh add-on revision. + Versions []*string +} + // CreationData - Data used when creating a target resource from a source resource. type CreationData struct { // This is the ARM ID of the source object to be used to create the target object. @@ -266,6 +291,84 @@ type ExtendedLocation struct { Type *ExtendedLocationTypes } +// IPTag - Contains the IPTag associated with the object. +type IPTag struct { + // The IP tag type. Example: RoutingPreference. + IPTagType *string + + // The value of the IP tag associated with the public IP. Example: Internet. + Tag *string +} + +// IstioCertificateAuthority - Istio Service Mesh Certificate Authority (CA) configuration. For now, we only support plugin +// certificates as described here https://aka.ms/asm-plugin-ca +type IstioCertificateAuthority struct { + // Plugin certificates information for Service Mesh. + Plugin *IstioPluginCertificateAuthority +} + +// IstioComponents - Istio components configuration. +type IstioComponents struct { + // Istio egress gateways. + EgressGateways []*IstioEgressGateway + + // Istio ingress gateways. + IngressGateways []*IstioIngressGateway +} + +// IstioEgressGateway - Istio egress gateway configuration. +type IstioEgressGateway struct { + // REQUIRED; Whether to enable the egress gateway. + Enabled *bool + + // NodeSelector for scheduling the egress gateway. + NodeSelector map[string]*string +} + +// IstioIngressGateway - Istio ingress gateway configuration. For now, we support up to one external ingress gateway named +// aks-istio-ingressgateway-external and one internal ingress gateway named +// aks-istio-ingressgateway-internal. +type IstioIngressGateway struct { + // REQUIRED; Whether to enable the ingress gateway. + Enabled *bool + + // REQUIRED; Mode of an ingress gateway. + Mode *IstioIngressGatewayMode +} + +// IstioPluginCertificateAuthority - Plugin certificates information for Service Mesh. +type IstioPluginCertificateAuthority struct { + // Certificate chain object name in Azure Key Vault. + CertChainObjectName *string + + // Intermediate certificate object name in Azure Key Vault. + CertObjectName *string + + // Intermediate certificate private key object name in Azure Key Vault. + KeyObjectName *string + + // The resource ID of the Key Vault. + KeyVaultID *string + + // Root certificate object name in Azure Key Vault. + RootCertObjectName *string +} + +// IstioServiceMesh - Istio service mesh configuration. +type IstioServiceMesh struct { + // Istio Service Mesh Certificate Authority (CA) configuration. For now, we only support plugin certificates as described + // here https://aka.ms/asm-plugin-ca + CertificateAuthority *IstioCertificateAuthority + + // Istio components configuration. + Components *IstioComponents + + // The list of revisions of the Istio control plane. When an upgrade is not in progress, this holds one value. When canary + // upgrade is in progress, this can only hold two consecutive values. For more + // information, see: https://learn.microsoft.com/en-us/azure/aks/istio-upgrade + Revisions []*string +} + // KubeletConfig - See AKS custom node configuration [https://docs.microsoft.com/azure/aks/custom-node-configuration] for // more details. type KubeletConfig struct { @@ -456,7 +559,7 @@ type ManagedCluster struct { // Resource tags. Tags map[string]*string - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource @@ -525,7 +628,7 @@ type ManagedClusterAccessProfile struct { // Resource tags. Tags map[string]*string - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource @@ -570,6 +673,9 @@ type ManagedClusterAgentPoolProfile struct { // The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. AvailabilityZones []*string + // AKS will associate the specified agent pool with the Capacity Reservation Group. + CapacityReservationGroupID *string + // Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user // pools and in the range of 1 to 1000 (inclusive) for system pools. The default // value is 1. @@ -628,6 +734,9 @@ type ManagedClusterAgentPoolProfile struct { // and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools Mode *AgentPoolMode + // Network-related settings of an agent pool. + NetworkProfile *AgentPoolNetworkProfile + // The node labels to be persisted across all nodes in agent pool. NodeLabels map[string]*string @@ -726,6 +835,9 @@ type ManagedClusterAgentPoolProfileProperties struct { // The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. AvailabilityZones []*string + // AKS will associate the specified agent pool with the Capacity Reservation Group. + CapacityReservationGroupID *string + // Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user // pools and in the range of 1 to 1000 (inclusive) for system pools. The default // value is 1. @@ -784,6 +896,9 @@ type ManagedClusterAgentPoolProfileProperties struct { // and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools Mode *AgentPoolMode + // Network-related settings of an agent pool. + NetworkProfile *AgentPoolNetworkProfile + // The node labels to be persisted across all nodes in agent pool. NodeLabels map[string]*string @@ -958,6 +1073,31 @@ type ManagedClusterIdentity struct { TenantID *string } +// ManagedClusterIngressProfile - Ingress profile for the container service cluster. +type ManagedClusterIngressProfile struct { + // App Routing settings for the ingress profile. You can find an overview and onboarding guide for this feature at + // https://learn.microsoft.com/en-us/azure/aks/app-routing?tabs=default%2Cdeploy-app-default. + WebAppRouting *ManagedClusterIngressProfileWebAppRouting +} + +// ManagedClusterIngressProfileWebAppRouting - Application Routing add-on settings for the ingress profile. +type ManagedClusterIngressProfileWebAppRouting struct { + // Resource IDs of the DNS zones to be associated with the Application Routing add-on. Used only when Application Routing + // add-on is enabled. Public and private DNS zones can be in different resource + // groups, but all public DNS zones must be in the same resource group and all private DNS zones must be in the same resource + // group. + DNSZoneResourceIDs []*string + + // Whether to enable the Application Routing add-on. + Enabled *bool + + // READ-ONLY; Managed identity of the Application Routing add-on. This is the identity that should be granted permissions, + // for example, to manage the associated Azure DNS resource and get certificates from Azure + // Key Vault. See this overview of the add-on [https://learn.microsoft.com/en-us/azure/aks/web-app-routing?tabs=with-osm] + // for more instructions. + Identity *UserAssignedIdentity +} + // ManagedClusterListResult - The response from the List Managed Clusters operation. type ManagedClusterListResult struct { // The list of managed clusters. @@ -973,6 +1113,9 @@ type ManagedClusterLoadBalancerProfile struct { // value is 0 which results in Azure dynamically allocating ports. AllocatedOutboundPorts *int32 + // The type of the managed inbound Load Balancer BackendPool. + BackendPoolType *BackendPoolType + // The effective outbound IP resources of the cluster load balancer. EffectiveOutboundIPs []*ResourceReference @@ -1199,6 +1342,9 @@ type ManagedClusterProperties struct { // Identities associated with the cluster. IdentityProfile map[string]*UserAssignedIdentity + // Ingress profile for the managed cluster. + IngressProfile *ManagedClusterIngressProfile + // Both patch version (e.g. 1.20.13) and (e.g. 1.20) are supported. When is specified, the latest supported GA patch version // is chosen automatically. Updating the cluster with the same once it has been // created (e.g. 1.14.x -> 1.14) will not trigger an upgrade, even if a newer patch version is available. When you upgrade @@ -1233,6 +1379,9 @@ type ManagedClusterProperties struct { // Security profile for the managed cluster. SecurityProfile *ManagedClusterSecurityProfile + // Service mesh profile for a managed cluster. + ServiceMeshProfile *ServiceMeshProfile + // Information about a service principal identity for the cluster to use for manipulating Azure APIs. ServicePrincipalProfile *ManagedClusterServicePrincipalProfile @@ -1274,6 +1423,10 @@ type ManagedClusterProperties struct { // READ-ONLY; The current provisioning state. ProvisioningState *string + + // READ-ONLY; The resourceUID uniquely identifies ManagedClusters that reuse ARM ResourceIds (i.e: create, delete, create + // sequence) + ResourceUID *string } // ManagedClusterPropertiesAutoScalerProfile - Parameters to be applied to the cluster-autoscaler when enabled @@ -1534,6 +1687,89 @@ type ManagedServiceIdentityUserAssignedIdentitiesValue struct { PrincipalID *string } +// MeshRevision - Holds information on upgrades and compatibility for given major.minor mesh release. +type MeshRevision struct { + // List of items this revision of service mesh is compatible with, and their associated versions. + CompatibleWith []*CompatibleVersions + + // The revision of the mesh release. + Revision *string + + // List of revisions available for upgrade of a specific mesh revision + Upgrades []*string +} + +// MeshRevisionProfile - Mesh revision profile for a mesh. +type MeshRevisionProfile struct { + // Mesh revision profile properties for a mesh + Properties *MeshRevisionProfileProperties + + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// MeshRevisionProfileList - Holds an array of MeshRevisionsProfiles +type MeshRevisionProfileList struct { + // Array of service mesh add-on revision profiles for all supported mesh modes. + Value []*MeshRevisionProfile + + // READ-ONLY; The URL to get the next set of mesh revision profile. + NextLink *string +} + +// MeshRevisionProfileProperties - Mesh revision profile properties for a mesh +type MeshRevisionProfileProperties struct { + MeshRevisions []*MeshRevision +} + +// MeshUpgradeProfile - Upgrade profile for given mesh. +type MeshUpgradeProfile struct { + // Mesh upgrade profile properties for a major.minor release. + Properties *MeshUpgradeProfileProperties + + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// MeshUpgradeProfileList - Holds an array of MeshUpgradeProfiles +type MeshUpgradeProfileList struct { + // Array of supported service mesh add-on upgrade profiles. + Value []*MeshUpgradeProfile + + // READ-ONLY; The URL to get the next set of mesh upgrade profile. + NextLink *string +} + +// MeshUpgradeProfileProperties - Mesh upgrade profile properties for a major.minor release. +type MeshUpgradeProfileProperties struct { + // List of items this revision of service mesh is compatible with, and their associated versions. + CompatibleWith []*CompatibleVersions + + // The revision of the mesh release. + Revision *string + + // List of revisions available for upgrade of a specific mesh revision + Upgrades []*string +} + // NetworkProfile - Profile of network configuration. type NetworkProfile struct { // An IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified @@ -1669,6 +1905,18 @@ type OutboundEnvironmentEndpointCollection struct { NextLink *string } +// PortRange - The port range. +type PortRange struct { + // The maximum port that is included in the range. It should be ranged from 1 to 65535, and be greater than or equal to portStart. + PortEnd *int32 + + // The minimum port that is included in the range. It should be ranged from 1 to 65535, and be less than or equal to portEnd. + PortStart *int32 + + // The network protocol of the port. + Protocol *Protocol +} + // PowerState - Describes the Power State of the cluster type PowerState struct { // Tells whether the cluster is Running or Stopped @@ -1819,6 +2067,15 @@ type Schedule struct { Weekly *WeeklySchedule } +// ServiceMeshProfile - Service mesh profile for a managed cluster. +type ServiceMeshProfile struct { + // REQUIRED; Mode of the service mesh. + Mode *ServiceMeshMode + + // Istio service mesh configuration. + Istio *IstioServiceMesh +} + // Snapshot - A node pool snapshot resource. type Snapshot struct { // REQUIRED; The geo-location where the resource lives @@ -1830,7 +2087,7 @@ type Snapshot struct { // Resource tags. Tags map[string]*string - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource @@ -2014,6 +2271,84 @@ type TimeSpan struct { Start *time.Time } +// TrustedAccessRole - Trusted access role definition. +type TrustedAccessRole struct { + // READ-ONLY; Name of role, name is unique under a source resource type + Name *string + + // READ-ONLY; List of rules for the role. This maps to 'rules' property of Kubernetes Cluster Role [https://kubernetes.io/docs/reference/kubernetes-api/authorization-resources/cluster-role-v1/#ClusterRole]. + Rules []*TrustedAccessRoleRule + + // READ-ONLY; Resource type of Azure resource + SourceResourceType *string +} + +// TrustedAccessRoleBinding - Defines binding between a resource and role +type TrustedAccessRoleBinding struct { + // REQUIRED; Properties for trusted access role binding + Properties *TrustedAccessRoleBindingProperties + + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// TrustedAccessRoleBindingListResult - List of trusted access role bindings +type TrustedAccessRoleBindingListResult struct { + // Role binding list + Value []*TrustedAccessRoleBinding + + // READ-ONLY; Link to next page of resources. + NextLink *string +} + +// TrustedAccessRoleBindingProperties - Properties for trusted access role binding +type TrustedAccessRoleBindingProperties struct { + // REQUIRED; A list of roles to bind, each item is a resource type qualified role name. For example: 'Microsoft.MachineLearningServices/workspaces/reader'. + Roles []*string + + // REQUIRED; The ARM resource ID of source resource that trusted access is configured for. + SourceResourceID *string + + // READ-ONLY; The current provisioning state of trusted access role binding. + ProvisioningState *TrustedAccessRoleBindingProvisioningState +} + +// TrustedAccessRoleListResult - List of trusted access roles +type TrustedAccessRoleListResult struct { + // READ-ONLY; Link to next page of resources. + NextLink *string + + // READ-ONLY; Role list + Value []*TrustedAccessRole +} + +// TrustedAccessRoleRule - Rule for trusted access role +type TrustedAccessRoleRule struct { + // READ-ONLY; List of allowed apiGroups + APIGroups []*string + + // READ-ONLY; List of allowed nonResourceURLs + NonResourceURLs []*string + + // READ-ONLY; List of allowed names + ResourceNames []*string + + // READ-ONLY; List of allowed resources + Resources []*string + + // READ-ONLY; List of allowed verbs + Verbs []*string +} + // UpgradeOverrideSettings - Settings for overrides when upgrading a cluster. type UpgradeOverrideSettings struct { // Whether to force upgrade the cluster. Note that this option instructs upgrade operation to bypass upgrade protections such diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/models_serde.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/models_serde.go index 506fbd45..1c83c2ac 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/models_serde.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/models_serde.go @@ -50,7 +50,9 @@ func (a *AbsoluteMonthlySchedule) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AccessProfile. func (a AccessProfile) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateByteArray(objectMap, "kubeConfig", a.KubeConfig, runtime.Base64StdFormat) + populateByteArray(objectMap, "kubeConfig", a.KubeConfig, func() any { + return runtime.EncodeByteArray(a.KubeConfig, runtime.Base64StdFormat) + }) return json.Marshal(objectMap) } @@ -64,7 +66,9 @@ func (a *AccessProfile) UnmarshalJSON(data []byte) error { var err error switch key { case "kubeConfig": - err = runtime.DecodeByteArray(string(val), &a.KubeConfig, runtime.Base64StdFormat) + if val != nil && string(val) != "null" { + err = runtime.DecodeByteArray(string(val), &a.KubeConfig, runtime.Base64StdFormat) + } delete(rawMsg, key) } if err != nil { @@ -245,6 +249,41 @@ func (a *AgentPoolListResult) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type AgentPoolNetworkProfile. +func (a AgentPoolNetworkProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "allowedHostPorts", a.AllowedHostPorts) + populate(objectMap, "applicationSecurityGroups", a.ApplicationSecurityGroups) + populate(objectMap, "nodePublicIPTags", a.NodePublicIPTags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AgentPoolNetworkProfile. +func (a *AgentPoolNetworkProfile) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "allowedHostPorts": + err = unpopulate(val, "AllowedHostPorts", &a.AllowedHostPorts) + delete(rawMsg, key) + case "applicationSecurityGroups": + err = unpopulate(val, "ApplicationSecurityGroups", &a.ApplicationSecurityGroups) + delete(rawMsg, key) + case "nodePublicIPTags": + err = unpopulate(val, "NodePublicIPTags", &a.NodePublicIPTags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type AgentPoolUpgradeProfile. func (a AgentPoolUpgradeProfile) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -359,6 +398,7 @@ func (a AgentPoolUpgradeSettings) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "drainTimeoutInMinutes", a.DrainTimeoutInMinutes) populate(objectMap, "maxSurge", a.MaxSurge) + populate(objectMap, "nodeSoakDurationInMinutes", a.NodeSoakDurationInMinutes) return json.Marshal(objectMap) } @@ -377,6 +417,9 @@ func (a *AgentPoolUpgradeSettings) UnmarshalJSON(data []byte) error { case "maxSurge": err = unpopulate(val, "MaxSurge", &a.MaxSurge) delete(rawMsg, key) + case "nodeSoakDurationInMinutes": + err = unpopulate(val, "NodeSoakDurationInMinutes", &a.NodeSoakDurationInMinutes) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", a, err) @@ -455,11 +498,11 @@ func (c *ClusterUpgradeSettings) UnmarshalJSON(data []byte) error { func (c CommandResultProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "exitCode", c.ExitCode) - populateTimeRFC3339(objectMap, "finishedAt", c.FinishedAt) + populateDateTimeRFC3339(objectMap, "finishedAt", c.FinishedAt) populate(objectMap, "logs", c.Logs) populate(objectMap, "provisioningState", c.ProvisioningState) populate(objectMap, "reason", c.Reason) - populateTimeRFC3339(objectMap, "startedAt", c.StartedAt) + populateDateTimeRFC3339(objectMap, "startedAt", c.StartedAt) return json.Marshal(objectMap) } @@ -476,7 +519,7 @@ func (c *CommandResultProperties) UnmarshalJSON(data []byte) error { err = unpopulate(val, "ExitCode", &c.ExitCode) delete(rawMsg, key) case "finishedAt": - err = unpopulateTimeRFC3339(val, "FinishedAt", &c.FinishedAt) + err = unpopulateDateTimeRFC3339(val, "FinishedAt", &c.FinishedAt) delete(rawMsg, key) case "logs": err = unpopulate(val, "Logs", &c.Logs) @@ -488,7 +531,38 @@ func (c *CommandResultProperties) UnmarshalJSON(data []byte) error { err = unpopulate(val, "Reason", &c.Reason) delete(rawMsg, key) case "startedAt": - err = unpopulateTimeRFC3339(val, "StartedAt", &c.StartedAt) + err = unpopulateDateTimeRFC3339(val, "StartedAt", &c.StartedAt) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CompatibleVersions. +func (c CompatibleVersions) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", c.Name) + populate(objectMap, "versions", c.Versions) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CompatibleVersions. +func (c *CompatibleVersions) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "versions": + err = unpopulate(val, "Versions", &c.Versions) delete(rawMsg, key) } if err != nil { @@ -529,7 +603,9 @@ func (c *CreationData) UnmarshalJSON(data []byte) error { func (c CredentialResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "name", c.Name) - populateByteArray(objectMap, "value", c.Value, runtime.Base64StdFormat) + populateByteArray(objectMap, "value", c.Value, func() any { + return runtime.EncodeByteArray(c.Value, runtime.Base64StdFormat) + }) return json.Marshal(objectMap) } @@ -546,7 +622,9 @@ func (c *CredentialResult) UnmarshalJSON(data []byte) error { err = unpopulate(val, "Name", &c.Name) delete(rawMsg, key) case "value": - err = runtime.DecodeByteArray(string(val), &c.Value, runtime.Base64StdFormat) + if val != nil && string(val) != "null" { + err = runtime.DecodeByteArray(string(val), &c.Value, runtime.Base64StdFormat) + } delete(rawMsg, key) } if err != nil { @@ -781,6 +859,235 @@ func (e *ExtendedLocation) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type IPTag. +func (i IPTag) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "ipTagType", i.IPTagType) + populate(objectMap, "tag", i.Tag) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IPTag. +func (i *IPTag) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "ipTagType": + err = unpopulate(val, "IPTagType", &i.IPTagType) + delete(rawMsg, key) + case "tag": + err = unpopulate(val, "Tag", &i.Tag) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IstioCertificateAuthority. +func (i IstioCertificateAuthority) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "plugin", i.Plugin) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IstioCertificateAuthority. +func (i *IstioCertificateAuthority) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "plugin": + err = unpopulate(val, "Plugin", &i.Plugin) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IstioComponents. +func (i IstioComponents) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "egressGateways", i.EgressGateways) + populate(objectMap, "ingressGateways", i.IngressGateways) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IstioComponents. +func (i *IstioComponents) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "egressGateways": + err = unpopulate(val, "EgressGateways", &i.EgressGateways) + delete(rawMsg, key) + case "ingressGateways": + err = unpopulate(val, "IngressGateways", &i.IngressGateways) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IstioEgressGateway. +func (i IstioEgressGateway) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "enabled", i.Enabled) + populate(objectMap, "nodeSelector", i.NodeSelector) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IstioEgressGateway. +func (i *IstioEgressGateway) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "enabled": + err = unpopulate(val, "Enabled", &i.Enabled) + delete(rawMsg, key) + case "nodeSelector": + err = unpopulate(val, "NodeSelector", &i.NodeSelector) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IstioIngressGateway. +func (i IstioIngressGateway) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "enabled", i.Enabled) + populate(objectMap, "mode", i.Mode) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IstioIngressGateway. +func (i *IstioIngressGateway) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "enabled": + err = unpopulate(val, "Enabled", &i.Enabled) + delete(rawMsg, key) + case "mode": + err = unpopulate(val, "Mode", &i.Mode) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IstioPluginCertificateAuthority. +func (i IstioPluginCertificateAuthority) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "certChainObjectName", i.CertChainObjectName) + populate(objectMap, "certObjectName", i.CertObjectName) + populate(objectMap, "keyObjectName", i.KeyObjectName) + populate(objectMap, "keyVaultId", i.KeyVaultID) + populate(objectMap, "rootCertObjectName", i.RootCertObjectName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IstioPluginCertificateAuthority. +func (i *IstioPluginCertificateAuthority) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "certChainObjectName": + err = unpopulate(val, "CertChainObjectName", &i.CertChainObjectName) + delete(rawMsg, key) + case "certObjectName": + err = unpopulate(val, "CertObjectName", &i.CertObjectName) + delete(rawMsg, key) + case "keyObjectName": + err = unpopulate(val, "KeyObjectName", &i.KeyObjectName) + delete(rawMsg, key) + case "keyVaultId": + err = unpopulate(val, "KeyVaultID", &i.KeyVaultID) + delete(rawMsg, key) + case "rootCertObjectName": + err = unpopulate(val, "RootCertObjectName", &i.RootCertObjectName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IstioServiceMesh. +func (i IstioServiceMesh) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "certificateAuthority", i.CertificateAuthority) + populate(objectMap, "components", i.Components) + populate(objectMap, "revisions", i.Revisions) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IstioServiceMesh. +func (i *IstioServiceMesh) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "certificateAuthority": + err = unpopulate(val, "CertificateAuthority", &i.CertificateAuthority) + delete(rawMsg, key) + case "components": + err = unpopulate(val, "Components", &i.Components) + delete(rawMsg, key) + case "revisions": + err = unpopulate(val, "Revisions", &i.Revisions) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type KubeletConfig. func (k KubeletConfig) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -1476,6 +1783,7 @@ func (m *ManagedClusterAddonProfileIdentity) UnmarshalJSON(data []byte) error { func (m ManagedClusterAgentPoolProfile) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "availabilityZones", m.AvailabilityZones) + populate(objectMap, "capacityReservationGroupID", m.CapacityReservationGroupID) populate(objectMap, "count", m.Count) populate(objectMap, "creationData", m.CreationData) populate(objectMap, "currentOrchestratorVersion", m.CurrentOrchestratorVersion) @@ -1494,6 +1802,7 @@ func (m ManagedClusterAgentPoolProfile) MarshalJSON() ([]byte, error) { populate(objectMap, "minCount", m.MinCount) populate(objectMap, "mode", m.Mode) populate(objectMap, "name", m.Name) + populate(objectMap, "networkProfile", m.NetworkProfile) populate(objectMap, "nodeImageVersion", m.NodeImageVersion) populate(objectMap, "nodeLabels", m.NodeLabels) populate(objectMap, "nodePublicIPPrefixID", m.NodePublicIPPrefixID) @@ -1532,6 +1841,9 @@ func (m *ManagedClusterAgentPoolProfile) UnmarshalJSON(data []byte) error { case "availabilityZones": err = unpopulate(val, "AvailabilityZones", &m.AvailabilityZones) delete(rawMsg, key) + case "capacityReservationGroupID": + err = unpopulate(val, "CapacityReservationGroupID", &m.CapacityReservationGroupID) + delete(rawMsg, key) case "count": err = unpopulate(val, "Count", &m.Count) delete(rawMsg, key) @@ -1586,6 +1898,9 @@ func (m *ManagedClusterAgentPoolProfile) UnmarshalJSON(data []byte) error { case "name": err = unpopulate(val, "Name", &m.Name) delete(rawMsg, key) + case "networkProfile": + err = unpopulate(val, "NetworkProfile", &m.NetworkProfile) + delete(rawMsg, key) case "nodeImageVersion": err = unpopulate(val, "NodeImageVersion", &m.NodeImageVersion) delete(rawMsg, key) @@ -1667,6 +1982,7 @@ func (m *ManagedClusterAgentPoolProfile) UnmarshalJSON(data []byte) error { func (m ManagedClusterAgentPoolProfileProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "availabilityZones", m.AvailabilityZones) + populate(objectMap, "capacityReservationGroupID", m.CapacityReservationGroupID) populate(objectMap, "count", m.Count) populate(objectMap, "creationData", m.CreationData) populate(objectMap, "currentOrchestratorVersion", m.CurrentOrchestratorVersion) @@ -1684,6 +2000,7 @@ func (m ManagedClusterAgentPoolProfileProperties) MarshalJSON() ([]byte, error) populate(objectMap, "maxPods", m.MaxPods) populate(objectMap, "minCount", m.MinCount) populate(objectMap, "mode", m.Mode) + populate(objectMap, "networkProfile", m.NetworkProfile) populate(objectMap, "nodeImageVersion", m.NodeImageVersion) populate(objectMap, "nodeLabels", m.NodeLabels) populate(objectMap, "nodePublicIPPrefixID", m.NodePublicIPPrefixID) @@ -1722,6 +2039,9 @@ func (m *ManagedClusterAgentPoolProfileProperties) UnmarshalJSON(data []byte) er case "availabilityZones": err = unpopulate(val, "AvailabilityZones", &m.AvailabilityZones) delete(rawMsg, key) + case "capacityReservationGroupID": + err = unpopulate(val, "CapacityReservationGroupID", &m.CapacityReservationGroupID) + delete(rawMsg, key) case "count": err = unpopulate(val, "Count", &m.Count) delete(rawMsg, key) @@ -1773,6 +2093,9 @@ func (m *ManagedClusterAgentPoolProfileProperties) UnmarshalJSON(data []byte) er case "mode": err = unpopulate(val, "Mode", &m.Mode) delete(rawMsg, key) + case "networkProfile": + err = unpopulate(val, "NetworkProfile", &m.NetworkProfile) + delete(rawMsg, key) case "nodeImageVersion": err = unpopulate(val, "NodeImageVersion", &m.NodeImageVersion) delete(rawMsg, key) @@ -2052,6 +2375,68 @@ func (m *ManagedClusterIdentity) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ManagedClusterIngressProfile. +func (m ManagedClusterIngressProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "webAppRouting", m.WebAppRouting) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedClusterIngressProfile. +func (m *ManagedClusterIngressProfile) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "webAppRouting": + err = unpopulate(val, "WebAppRouting", &m.WebAppRouting) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedClusterIngressProfileWebAppRouting. +func (m ManagedClusterIngressProfileWebAppRouting) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "dnsZoneResourceIds", m.DNSZoneResourceIDs) + populate(objectMap, "enabled", m.Enabled) + populate(objectMap, "identity", m.Identity) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedClusterIngressProfileWebAppRouting. +func (m *ManagedClusterIngressProfileWebAppRouting) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "dnsZoneResourceIds": + err = unpopulate(val, "DNSZoneResourceIDs", &m.DNSZoneResourceIDs) + delete(rawMsg, key) + case "enabled": + err = unpopulate(val, "Enabled", &m.Enabled) + delete(rawMsg, key) + case "identity": + err = unpopulate(val, "Identity", &m.Identity) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ManagedClusterListResult. func (m ManagedClusterListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -2087,6 +2472,7 @@ func (m *ManagedClusterListResult) UnmarshalJSON(data []byte) error { func (m ManagedClusterLoadBalancerProfile) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "allocatedOutboundPorts", m.AllocatedOutboundPorts) + populate(objectMap, "backendPoolType", m.BackendPoolType) populate(objectMap, "effectiveOutboundIPs", m.EffectiveOutboundIPs) populate(objectMap, "enableMultipleStandardLoadBalancers", m.EnableMultipleStandardLoadBalancers) populate(objectMap, "idleTimeoutInMinutes", m.IdleTimeoutInMinutes) @@ -2108,6 +2494,9 @@ func (m *ManagedClusterLoadBalancerProfile) UnmarshalJSON(data []byte) error { case "allocatedOutboundPorts": err = unpopulate(val, "AllocatedOutboundPorts", &m.AllocatedOutboundPorts) delete(rawMsg, key) + case "backendPoolType": + err = unpopulate(val, "BackendPoolType", &m.BackendPoolType) + delete(rawMsg, key) case "effectiveOutboundIPs": err = unpopulate(val, "EffectiveOutboundIPs", &m.EffectiveOutboundIPs) delete(rawMsg, key) @@ -2617,6 +3006,7 @@ func (m ManagedClusterProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "fqdnSubdomain", m.FqdnSubdomain) populate(objectMap, "httpProxyConfig", m.HTTPProxyConfig) populate(objectMap, "identityProfile", m.IdentityProfile) + populate(objectMap, "ingressProfile", m.IngressProfile) populate(objectMap, "kubernetesVersion", m.KubernetesVersion) populate(objectMap, "linuxProfile", m.LinuxProfile) populate(objectMap, "maxAgentPools", m.MaxAgentPools) @@ -2629,7 +3019,9 @@ func (m ManagedClusterProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "privateLinkResources", m.PrivateLinkResources) populate(objectMap, "provisioningState", m.ProvisioningState) populate(objectMap, "publicNetworkAccess", m.PublicNetworkAccess) + populate(objectMap, "resourceUID", m.ResourceUID) populate(objectMap, "securityProfile", m.SecurityProfile) + populate(objectMap, "serviceMeshProfile", m.ServiceMeshProfile) populate(objectMap, "servicePrincipalProfile", m.ServicePrincipalProfile) populate(objectMap, "storageProfile", m.StorageProfile) populate(objectMap, "supportPlan", m.SupportPlan) @@ -2702,6 +3094,9 @@ func (m *ManagedClusterProperties) UnmarshalJSON(data []byte) error { case "identityProfile": err = unpopulate(val, "IdentityProfile", &m.IdentityProfile) delete(rawMsg, key) + case "ingressProfile": + err = unpopulate(val, "IngressProfile", &m.IngressProfile) + delete(rawMsg, key) case "kubernetesVersion": err = unpopulate(val, "KubernetesVersion", &m.KubernetesVersion) delete(rawMsg, key) @@ -2738,9 +3133,15 @@ func (m *ManagedClusterProperties) UnmarshalJSON(data []byte) error { case "publicNetworkAccess": err = unpopulate(val, "PublicNetworkAccess", &m.PublicNetworkAccess) delete(rawMsg, key) + case "resourceUID": + err = unpopulate(val, "ResourceUID", &m.ResourceUID) + delete(rawMsg, key) case "securityProfile": err = unpopulate(val, "SecurityProfile", &m.SecurityProfile) delete(rawMsg, key) + case "serviceMeshProfile": + err = unpopulate(val, "ServiceMeshProfile", &m.ServiceMeshProfile) + delete(rawMsg, key) case "servicePrincipalProfile": err = unpopulate(val, "ServicePrincipalProfile", &m.ServicePrincipalProfile) delete(rawMsg, key) @@ -3451,15 +3852,260 @@ func (m *ManagedServiceIdentityUserAssignedIdentitiesValue) UnmarshalJSON(data [ return nil } -// MarshalJSON implements the json.Marshaller interface for type NetworkProfile. -func (n NetworkProfile) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MeshRevision. +func (m MeshRevision) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "dnsServiceIP", n.DNSServiceIP) - populate(objectMap, "ipFamilies", n.IPFamilies) - populate(objectMap, "loadBalancerProfile", n.LoadBalancerProfile) - populate(objectMap, "loadBalancerSku", n.LoadBalancerSKU) - populate(objectMap, "natGatewayProfile", n.NatGatewayProfile) - populate(objectMap, "networkDataplane", n.NetworkDataplane) + populate(objectMap, "compatibleWith", m.CompatibleWith) + populate(objectMap, "revision", m.Revision) + populate(objectMap, "upgrades", m.Upgrades) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MeshRevision. +func (m *MeshRevision) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "compatibleWith": + err = unpopulate(val, "CompatibleWith", &m.CompatibleWith) + delete(rawMsg, key) + case "revision": + err = unpopulate(val, "Revision", &m.Revision) + delete(rawMsg, key) + case "upgrades": + err = unpopulate(val, "Upgrades", &m.Upgrades) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MeshRevisionProfile. +func (m MeshRevisionProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", m.ID) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "systemData", m.SystemData) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MeshRevisionProfile. +func (m *MeshRevisionProfile) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &m.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MeshRevisionProfileList. +func (m MeshRevisionProfileList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MeshRevisionProfileList. +func (m *MeshRevisionProfileList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MeshRevisionProfileProperties. +func (m MeshRevisionProfileProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "meshRevisions", m.MeshRevisions) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MeshRevisionProfileProperties. +func (m *MeshRevisionProfileProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "meshRevisions": + err = unpopulate(val, "MeshRevisions", &m.MeshRevisions) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MeshUpgradeProfile. +func (m MeshUpgradeProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", m.ID) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "systemData", m.SystemData) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MeshUpgradeProfile. +func (m *MeshUpgradeProfile) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &m.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MeshUpgradeProfileList. +func (m MeshUpgradeProfileList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MeshUpgradeProfileList. +func (m *MeshUpgradeProfileList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MeshUpgradeProfileProperties. +func (m MeshUpgradeProfileProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "compatibleWith", m.CompatibleWith) + populate(objectMap, "revision", m.Revision) + populate(objectMap, "upgrades", m.Upgrades) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MeshUpgradeProfileProperties. +func (m *MeshUpgradeProfileProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "compatibleWith": + err = unpopulate(val, "CompatibleWith", &m.CompatibleWith) + delete(rawMsg, key) + case "revision": + err = unpopulate(val, "Revision", &m.Revision) + delete(rawMsg, key) + case "upgrades": + err = unpopulate(val, "Upgrades", &m.Upgrades) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkProfile. +func (n NetworkProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "dnsServiceIP", n.DNSServiceIP) + populate(objectMap, "ipFamilies", n.IPFamilies) + populate(objectMap, "loadBalancerProfile", n.LoadBalancerProfile) + populate(objectMap, "loadBalancerSku", n.LoadBalancerSKU) + populate(objectMap, "natGatewayProfile", n.NatGatewayProfile) + populate(objectMap, "networkDataplane", n.NetworkDataplane) populate(objectMap, "networkMode", n.NetworkMode) populate(objectMap, "networkPlugin", n.NetworkPlugin) populate(objectMap, "networkPluginMode", n.NetworkPluginMode) @@ -3794,6 +4440,41 @@ func (o *OutboundEnvironmentEndpointCollection) UnmarshalJSON(data []byte) error return nil } +// MarshalJSON implements the json.Marshaller interface for type PortRange. +func (p PortRange) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "portEnd", p.PortEnd) + populate(objectMap, "portStart", p.PortStart) + populate(objectMap, "protocol", p.Protocol) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PortRange. +func (p *PortRange) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "portEnd": + err = unpopulate(val, "PortEnd", &p.PortEnd) + delete(rawMsg, key) + case "portStart": + err = unpopulate(val, "PortStart", &p.PortStart) + delete(rawMsg, key) + case "protocol": + err = unpopulate(val, "Protocol", &p.Protocol) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type PowerState. func (p PowerState) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -4275,6 +4956,37 @@ func (s *Schedule) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ServiceMeshProfile. +func (s ServiceMeshProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "istio", s.Istio) + populate(objectMap, "mode", s.Mode) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceMeshProfile. +func (s *ServiceMeshProfile) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "istio": + err = unpopulate(val, "Istio", &s.Istio) + delete(rawMsg, key) + case "mode": + err = unpopulate(val, "Mode", &s.Mode) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type Snapshot. func (s Snapshot) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -4550,10 +5262,10 @@ func (s *SysctlConfig) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SystemData. func (s SystemData) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) + populateDateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) populate(objectMap, "createdBy", s.CreatedBy) populate(objectMap, "createdByType", s.CreatedByType) - populateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) + populateDateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) populate(objectMap, "lastModifiedBy", s.LastModifiedBy) populate(objectMap, "lastModifiedByType", s.LastModifiedByType) return json.Marshal(objectMap) @@ -4569,7 +5281,7 @@ func (s *SystemData) UnmarshalJSON(data []byte) error { var err error switch key { case "createdAt": - err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) + err = unpopulateDateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) delete(rawMsg, key) case "createdBy": err = unpopulate(val, "CreatedBy", &s.CreatedBy) @@ -4578,7 +5290,7 @@ func (s *SystemData) UnmarshalJSON(data []byte) error { err = unpopulate(val, "CreatedByType", &s.CreatedByType) delete(rawMsg, key) case "lastModifiedAt": - err = unpopulateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) + err = unpopulateDateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) delete(rawMsg, key) case "lastModifiedBy": err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) @@ -4655,8 +5367,8 @@ func (t *TimeInWeek) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type TimeSpan. func (t TimeSpan) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateTimeRFC3339(objectMap, "end", t.End) - populateTimeRFC3339(objectMap, "start", t.Start) + populateDateTimeRFC3339(objectMap, "end", t.End) + populateDateTimeRFC3339(objectMap, "start", t.Start) return json.Marshal(objectMap) } @@ -4670,10 +5382,228 @@ func (t *TimeSpan) UnmarshalJSON(data []byte) error { var err error switch key { case "end": - err = unpopulateTimeRFC3339(val, "End", &t.End) + err = unpopulateDateTimeRFC3339(val, "End", &t.End) delete(rawMsg, key) case "start": - err = unpopulateTimeRFC3339(val, "Start", &t.Start) + err = unpopulateDateTimeRFC3339(val, "Start", &t.Start) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TrustedAccessRole. +func (t TrustedAccessRole) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", t.Name) + populate(objectMap, "rules", t.Rules) + populate(objectMap, "sourceResourceType", t.SourceResourceType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TrustedAccessRole. +func (t *TrustedAccessRole) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &t.Name) + delete(rawMsg, key) + case "rules": + err = unpopulate(val, "Rules", &t.Rules) + delete(rawMsg, key) + case "sourceResourceType": + err = unpopulate(val, "SourceResourceType", &t.SourceResourceType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TrustedAccessRoleBinding. +func (t TrustedAccessRoleBinding) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", t.ID) + populate(objectMap, "name", t.Name) + populate(objectMap, "properties", t.Properties) + populate(objectMap, "systemData", t.SystemData) + populate(objectMap, "type", t.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TrustedAccessRoleBinding. +func (t *TrustedAccessRoleBinding) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &t.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &t.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &t.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &t.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &t.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TrustedAccessRoleBindingListResult. +func (t TrustedAccessRoleBindingListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", t.NextLink) + populate(objectMap, "value", t.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TrustedAccessRoleBindingListResult. +func (t *TrustedAccessRoleBindingListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &t.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &t.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TrustedAccessRoleBindingProperties. +func (t TrustedAccessRoleBindingProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "provisioningState", t.ProvisioningState) + populate(objectMap, "roles", t.Roles) + populate(objectMap, "sourceResourceId", t.SourceResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TrustedAccessRoleBindingProperties. +func (t *TrustedAccessRoleBindingProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &t.ProvisioningState) + delete(rawMsg, key) + case "roles": + err = unpopulate(val, "Roles", &t.Roles) + delete(rawMsg, key) + case "sourceResourceId": + err = unpopulate(val, "SourceResourceID", &t.SourceResourceID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TrustedAccessRoleListResult. +func (t TrustedAccessRoleListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", t.NextLink) + populate(objectMap, "value", t.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TrustedAccessRoleListResult. +func (t *TrustedAccessRoleListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &t.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &t.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TrustedAccessRoleRule. +func (t TrustedAccessRoleRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "apiGroups", t.APIGroups) + populate(objectMap, "nonResourceURLs", t.NonResourceURLs) + populate(objectMap, "resourceNames", t.ResourceNames) + populate(objectMap, "resources", t.Resources) + populate(objectMap, "verbs", t.Verbs) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TrustedAccessRoleRule. +func (t *TrustedAccessRoleRule) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "apiGroups": + err = unpopulate(val, "APIGroups", &t.APIGroups) + delete(rawMsg, key) + case "nonResourceURLs": + err = unpopulate(val, "NonResourceURLs", &t.NonResourceURLs) + delete(rawMsg, key) + case "resourceNames": + err = unpopulate(val, "ResourceNames", &t.ResourceNames) + delete(rawMsg, key) + case "resources": + err = unpopulate(val, "Resources", &t.Resources) + delete(rawMsg, key) + case "verbs": + err = unpopulate(val, "Verbs", &t.Verbs) delete(rawMsg, key) } if err != nil { @@ -4687,7 +5617,7 @@ func (t *TimeSpan) UnmarshalJSON(data []byte) error { func (u UpgradeOverrideSettings) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "forceUpgrade", u.ForceUpgrade) - populateTimeRFC3339(objectMap, "until", u.Until) + populateDateTimeRFC3339(objectMap, "until", u.Until) return json.Marshal(objectMap) } @@ -4704,7 +5634,7 @@ func (u *UpgradeOverrideSettings) UnmarshalJSON(data []byte) error { err = unpopulate(val, "ForceUpgrade", &u.ForceUpgrade) delete(rawMsg, key) case "until": - err = unpopulateTimeRFC3339(val, "Until", &u.Until) + err = unpopulateDateTimeRFC3339(val, "Until", &u.Until) delete(rawMsg, key) } if err != nil { @@ -4825,18 +5755,18 @@ func populate(m map[string]any, k string, v any) { } } -func populateByteArray(m map[string]any, k string, b []byte, f runtime.Base64Encoding) { +func populateByteArray[T any](m map[string]any, k string, b []T, convert func() any) { if azcore.IsNullValue(b) { m[k] = nil } else if len(b) == 0 { return } else { - m[k] = runtime.EncodeByteArray(b, f) + m[k] = convert() } } func unpopulate(data json.RawMessage, fn string, v any) error { - if data == nil { + if data == nil || string(data) == "null" { return nil } if err := json.Unmarshal(data, v); err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/operations_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/operations_client.go index 6878e3fa..150abb35 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/operations_client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/operations_client.go @@ -27,7 +27,7 @@ type OperationsClient struct { // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error) { - cl, err := arm.NewClient(moduleName+".OperationsClient", moduleVersion, credential, options) + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { return nil, err } @@ -39,7 +39,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - Gets a list of operations. // -// Generated from API version 2023-07-01 +// Generated from API version 2024-01-01 // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -47,6 +47,7 @@ func (client *OperationsClient) NewListPager(options *OperationsClientListOption return false }, Fetcher: func(ctx context.Context, page *OperationsClientListResponse) (OperationsClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "OperationsClient.NewListPager") req, err := client.listCreateRequest(ctx, options) if err != nil { return OperationsClientListResponse{}, err @@ -60,6 +61,7 @@ func (client *OperationsClient) NewListPager(options *OperationsClientListOption } return client.listHandleResponse(resp) }, + Tracer: client.internal.Tracer(), }) } @@ -71,7 +73,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/options.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/options.go index 83203afc..061d3e76 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/options.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/options.go @@ -166,6 +166,18 @@ type ManagedClustersClientGetCommandResultOptions struct { // placeholder for future optional parameters } +// ManagedClustersClientGetMeshRevisionProfileOptions contains the optional parameters for the ManagedClustersClient.GetMeshRevisionProfile +// method. +type ManagedClustersClientGetMeshRevisionProfileOptions struct { + // placeholder for future optional parameters +} + +// ManagedClustersClientGetMeshUpgradeProfileOptions contains the optional parameters for the ManagedClustersClient.GetMeshUpgradeProfile +// method. +type ManagedClustersClientGetMeshUpgradeProfileOptions struct { + // placeholder for future optional parameters +} + // ManagedClustersClientGetOSOptionsOptions contains the optional parameters for the ManagedClustersClient.GetOSOptions method. type ManagedClustersClientGetOSOptionsOptions struct { // The resource type for which the OS options needs to be returned @@ -221,6 +233,18 @@ type ManagedClustersClientListKubernetesVersionsOptions struct { // placeholder for future optional parameters } +// ManagedClustersClientListMeshRevisionProfilesOptions contains the optional parameters for the ManagedClustersClient.NewListMeshRevisionProfilesPager +// method. +type ManagedClustersClientListMeshRevisionProfilesOptions struct { + // placeholder for future optional parameters +} + +// ManagedClustersClientListMeshUpgradeProfilesOptions contains the optional parameters for the ManagedClustersClient.NewListMeshUpgradeProfilesPager +// method. +type ManagedClustersClientListMeshUpgradeProfilesOptions struct { + // placeholder for future optional parameters +} + // ManagedClustersClientListOptions contains the optional parameters for the ManagedClustersClient.NewListPager method. type ManagedClustersClientListOptions struct { // placeholder for future optional parameters @@ -303,3 +327,34 @@ type SnapshotsClientListOptions struct { type SnapshotsClientUpdateTagsOptions struct { // placeholder for future optional parameters } + +// TrustedAccessRoleBindingsClientBeginCreateOrUpdateOptions contains the optional parameters for the TrustedAccessRoleBindingsClient.BeginCreateOrUpdate +// method. +type TrustedAccessRoleBindingsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// TrustedAccessRoleBindingsClientBeginDeleteOptions contains the optional parameters for the TrustedAccessRoleBindingsClient.BeginDelete +// method. +type TrustedAccessRoleBindingsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// TrustedAccessRoleBindingsClientGetOptions contains the optional parameters for the TrustedAccessRoleBindingsClient.Get +// method. +type TrustedAccessRoleBindingsClientGetOptions struct { + // placeholder for future optional parameters +} + +// TrustedAccessRoleBindingsClientListOptions contains the optional parameters for the TrustedAccessRoleBindingsClient.NewListPager +// method. +type TrustedAccessRoleBindingsClientListOptions struct { + // placeholder for future optional parameters +} + +// TrustedAccessRolesClientListOptions contains the optional parameters for the TrustedAccessRolesClient.NewListPager method. +type TrustedAccessRolesClientListOptions struct { + // placeholder for future optional parameters +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/privateendpointconnections_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/privateendpointconnections_client.go index 552efc5b..c232eaf4 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/privateendpointconnections_client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/privateendpointconnections_client.go @@ -28,11 +28,11 @@ type PrivateEndpointConnectionsClient struct { } // NewPrivateEndpointConnectionsClient creates a new instance of PrivateEndpointConnectionsClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateEndpointConnectionsClient, error) { - cl, err := arm.NewClient(moduleName+".PrivateEndpointConnectionsClient", moduleVersion, credential, options) + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { return nil, err } @@ -46,7 +46,7 @@ func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcor // BeginDelete - Deletes a private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - privateEndpointConnectionName - The name of the private endpoint connection. @@ -58,19 +58,27 @@ func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, if err != nil { return nil, err } - poller, err := runtime.NewPoller[PrivateEndpointConnectionsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PrivateEndpointConnectionsClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) return poller, err } else { - return runtime.NewPollerFromResumeToken[PrivateEndpointConnectionsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[PrivateEndpointConnectionsClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) } } // Delete - Deletes a private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2024-01-01 func (client *PrivateEndpointConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*http.Response, error) { var err error + const operationName = "PrivateEndpointConnectionsClient.BeginDelete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.deleteCreateRequest(ctx, resourceGroupName, resourceName, privateEndpointConnectionName, options) if err != nil { return nil, err @@ -110,7 +118,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -119,7 +127,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. // Get - To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - privateEndpointConnectionName - The name of the private endpoint connection. @@ -127,6 +135,10 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. // method. func (client *PrivateEndpointConnectionsClient) Get(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientGetOptions) (PrivateEndpointConnectionsClientGetResponse, error) { var err error + const operationName = "PrivateEndpointConnectionsClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.getCreateRequest(ctx, resourceGroupName, resourceName, privateEndpointConnectionName, options) if err != nil { return PrivateEndpointConnectionsClientGetResponse{}, err @@ -167,7 +179,7 @@ func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -185,13 +197,17 @@ func (client *PrivateEndpointConnectionsClient) getHandleResponse(resp *http.Res // List - To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - options - PrivateEndpointConnectionsClientListOptions contains the optional parameters for the PrivateEndpointConnectionsClient.List // method. func (client *PrivateEndpointConnectionsClient) List(ctx context.Context, resourceGroupName string, resourceName string, options *PrivateEndpointConnectionsClientListOptions) (PrivateEndpointConnectionsClientListResponse, error) { var err error + const operationName = "PrivateEndpointConnectionsClient.List" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.listCreateRequest(ctx, resourceGroupName, resourceName, options) if err != nil { return PrivateEndpointConnectionsClientListResponse{}, err @@ -228,7 +244,7 @@ func (client *PrivateEndpointConnectionsClient) listCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -246,7 +262,7 @@ func (client *PrivateEndpointConnectionsClient) listHandleResponse(resp *http.Re // Update - Updates a private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - privateEndpointConnectionName - The name of the private endpoint connection. @@ -255,6 +271,10 @@ func (client *PrivateEndpointConnectionsClient) listHandleResponse(resp *http.Re // method. func (client *PrivateEndpointConnectionsClient) Update(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string, parameters PrivateEndpointConnection, options *PrivateEndpointConnectionsClientUpdateOptions) (PrivateEndpointConnectionsClientUpdateResponse, error) { var err error + const operationName = "PrivateEndpointConnectionsClient.Update" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.updateCreateRequest(ctx, resourceGroupName, resourceName, privateEndpointConnectionName, parameters, options) if err != nil { return PrivateEndpointConnectionsClientUpdateResponse{}, err @@ -295,7 +315,7 @@ func (client *PrivateEndpointConnectionsClient) updateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/privatelinkresources_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/privatelinkresources_client.go index 3f5942c1..c8b35480 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/privatelinkresources_client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/privatelinkresources_client.go @@ -28,11 +28,11 @@ type PrivateLinkResourcesClient struct { } // NewPrivateLinkResourcesClient creates a new instance of PrivateLinkResourcesClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateLinkResourcesClient, error) { - cl, err := arm.NewClient(moduleName+".PrivateLinkResourcesClient", moduleVersion, credential, options) + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { return nil, err } @@ -46,13 +46,17 @@ func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.Toke // List - To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - options - PrivateLinkResourcesClientListOptions contains the optional parameters for the PrivateLinkResourcesClient.List // method. func (client *PrivateLinkResourcesClient) List(ctx context.Context, resourceGroupName string, resourceName string, options *PrivateLinkResourcesClientListOptions) (PrivateLinkResourcesClientListResponse, error) { var err error + const operationName = "PrivateLinkResourcesClient.List" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.listCreateRequest(ctx, resourceGroupName, resourceName, options) if err != nil { return PrivateLinkResourcesClientListResponse{}, err @@ -89,7 +93,7 @@ func (client *PrivateLinkResourcesClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/resolveprivatelinkserviceid_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/resolveprivatelinkserviceid_client.go index 3a85ee71..8d8ba014 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/resolveprivatelinkserviceid_client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/resolveprivatelinkserviceid_client.go @@ -28,11 +28,11 @@ type ResolvePrivateLinkServiceIDClient struct { } // NewResolvePrivateLinkServiceIDClient creates a new instance of ResolvePrivateLinkServiceIDClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewResolvePrivateLinkServiceIDClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ResolvePrivateLinkServiceIDClient, error) { - cl, err := arm.NewClient(moduleName+".ResolvePrivateLinkServiceIDClient", moduleVersion, credential, options) + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { return nil, err } @@ -46,7 +46,7 @@ func NewResolvePrivateLinkServiceIDClient(subscriptionID string, credential azco // POST - Gets the private link service ID for the specified managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - parameters - Parameters required in order to resolve a private link service ID. @@ -54,6 +54,10 @@ func NewResolvePrivateLinkServiceIDClient(subscriptionID string, credential azco // method. func (client *ResolvePrivateLinkServiceIDClient) POST(ctx context.Context, resourceGroupName string, resourceName string, parameters PrivateLinkResource, options *ResolvePrivateLinkServiceIDClientPOSTOptions) (ResolvePrivateLinkServiceIDClientPOSTResponse, error) { var err error + const operationName = "ResolvePrivateLinkServiceIDClient.POST" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.postCreateRequest(ctx, resourceGroupName, resourceName, parameters, options) if err != nil { return ResolvePrivateLinkServiceIDClientPOSTResponse{}, err @@ -90,7 +94,7 @@ func (client *ResolvePrivateLinkServiceIDClient) postCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/response_types.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/responses.go similarity index 83% rename from vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/response_types.go rename to vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/responses.go index cdf20508..ae19892e 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/response_types.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/responses.go @@ -110,6 +110,18 @@ type ManagedClustersClientGetCommandResultResponse struct { Location *string } +// ManagedClustersClientGetMeshRevisionProfileResponse contains the response from method ManagedClustersClient.GetMeshRevisionProfile. +type ManagedClustersClientGetMeshRevisionProfileResponse struct { + // Mesh revision profile for a mesh. + MeshRevisionProfile +} + +// ManagedClustersClientGetMeshUpgradeProfileResponse contains the response from method ManagedClustersClient.GetMeshUpgradeProfile. +type ManagedClustersClientGetMeshUpgradeProfileResponse struct { + // Upgrade profile for given mesh. + MeshUpgradeProfile +} + // ManagedClustersClientGetOSOptionsResponse contains the response from method ManagedClustersClient.GetOSOptions. type ManagedClustersClientGetOSOptionsResponse struct { // The OS option profile. @@ -158,6 +170,18 @@ type ManagedClustersClientListKubernetesVersionsResponse struct { KubernetesVersionListResult } +// ManagedClustersClientListMeshRevisionProfilesResponse contains the response from method ManagedClustersClient.NewListMeshRevisionProfilesPager. +type ManagedClustersClientListMeshRevisionProfilesResponse struct { + // Holds an array of MeshRevisionsProfiles + MeshRevisionProfileList +} + +// ManagedClustersClientListMeshUpgradeProfilesResponse contains the response from method ManagedClustersClient.NewListMeshUpgradeProfilesPager. +type ManagedClustersClientListMeshUpgradeProfilesResponse struct { + // Holds an array of MeshUpgradeProfiles + MeshUpgradeProfileList +} + // ManagedClustersClientListOutboundNetworkDependenciesEndpointsResponse contains the response from method ManagedClustersClient.NewListOutboundNetworkDependenciesEndpointsPager. type ManagedClustersClientListOutboundNetworkDependenciesEndpointsResponse struct { // Collection of OutboundEnvironmentEndpoint @@ -287,3 +311,32 @@ type SnapshotsClientUpdateTagsResponse struct { // A node pool snapshot resource. Snapshot } + +// TrustedAccessRoleBindingsClientCreateOrUpdateResponse contains the response from method TrustedAccessRoleBindingsClient.BeginCreateOrUpdate. +type TrustedAccessRoleBindingsClientCreateOrUpdateResponse struct { + // Defines binding between a resource and role + TrustedAccessRoleBinding +} + +// TrustedAccessRoleBindingsClientDeleteResponse contains the response from method TrustedAccessRoleBindingsClient.BeginDelete. +type TrustedAccessRoleBindingsClientDeleteResponse struct { + // placeholder for future response values +} + +// TrustedAccessRoleBindingsClientGetResponse contains the response from method TrustedAccessRoleBindingsClient.Get. +type TrustedAccessRoleBindingsClientGetResponse struct { + // Defines binding between a resource and role + TrustedAccessRoleBinding +} + +// TrustedAccessRoleBindingsClientListResponse contains the response from method TrustedAccessRoleBindingsClient.NewListPager. +type TrustedAccessRoleBindingsClientListResponse struct { + // List of trusted access role bindings + TrustedAccessRoleBindingListResult +} + +// TrustedAccessRolesClientListResponse contains the response from method TrustedAccessRolesClient.NewListPager. +type TrustedAccessRolesClientListResponse struct { + // List of trusted access roles + TrustedAccessRoleListResult +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/snapshots_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/snapshots_client.go index 77f874e4..dd160f7d 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/snapshots_client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/snapshots_client.go @@ -28,11 +28,11 @@ type SnapshotsClient struct { } // NewSnapshotsClient creates a new instance of SnapshotsClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewSnapshotsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SnapshotsClient, error) { - cl, err := arm.NewClient(moduleName+".SnapshotsClient", moduleVersion, credential, options) + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { return nil, err } @@ -46,7 +46,7 @@ func NewSnapshotsClient(subscriptionID string, credential azcore.TokenCredential // CreateOrUpdate - Creates or updates a snapshot. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - parameters - The snapshot to create or update. @@ -54,6 +54,10 @@ func NewSnapshotsClient(subscriptionID string, credential azcore.TokenCredential // method. func (client *SnapshotsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, parameters Snapshot, options *SnapshotsClientCreateOrUpdateOptions) (SnapshotsClientCreateOrUpdateResponse, error) { var err error + const operationName = "SnapshotsClient.CreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, resourceName, parameters, options) if err != nil { return SnapshotsClientCreateOrUpdateResponse{}, err @@ -90,7 +94,7 @@ func (client *SnapshotsClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -111,12 +115,16 @@ func (client *SnapshotsClient) createOrUpdateHandleResponse(resp *http.Response) // Delete - Deletes a snapshot. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - options - SnapshotsClientDeleteOptions contains the optional parameters for the SnapshotsClient.Delete method. func (client *SnapshotsClient) Delete(ctx context.Context, resourceGroupName string, resourceName string, options *SnapshotsClientDeleteOptions) (SnapshotsClientDeleteResponse, error) { var err error + const operationName = "SnapshotsClient.Delete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.deleteCreateRequest(ctx, resourceGroupName, resourceName, options) if err != nil { return SnapshotsClientDeleteResponse{}, err @@ -152,7 +160,7 @@ func (client *SnapshotsClient) deleteCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -161,12 +169,16 @@ func (client *SnapshotsClient) deleteCreateRequest(ctx context.Context, resource // Get - Gets a snapshot. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - options - SnapshotsClientGetOptions contains the optional parameters for the SnapshotsClient.Get method. func (client *SnapshotsClient) Get(ctx context.Context, resourceGroupName string, resourceName string, options *SnapshotsClientGetOptions) (SnapshotsClientGetResponse, error) { var err error + const operationName = "SnapshotsClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.getCreateRequest(ctx, resourceGroupName, resourceName, options) if err != nil { return SnapshotsClientGetResponse{}, err @@ -203,7 +215,7 @@ func (client *SnapshotsClient) getCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -220,7 +232,7 @@ func (client *SnapshotsClient) getHandleResponse(resp *http.Response) (Snapshots // NewListPager - Gets a list of snapshots in the specified subscription. // -// Generated from API version 2023-07-01 +// Generated from API version 2024-01-01 // - options - SnapshotsClientListOptions contains the optional parameters for the SnapshotsClient.NewListPager method. func (client *SnapshotsClient) NewListPager(options *SnapshotsClientListOptions) *runtime.Pager[SnapshotsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[SnapshotsClientListResponse]{ @@ -228,25 +240,20 @@ func (client *SnapshotsClient) NewListPager(options *SnapshotsClientListOptions) return page.NextLink != nil && len(*page.NextLink) > 0 }, Fetcher: func(ctx context.Context, page *SnapshotsClientListResponse) (SnapshotsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "SnapshotsClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, options) + }, nil) if err != nil { return SnapshotsClientListResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return SnapshotsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SnapshotsClientListResponse{}, runtime.NewResponseError(resp) - } return client.listHandleResponse(resp) }, + Tracer: client.internal.Tracer(), }) } @@ -262,7 +269,7 @@ func (client *SnapshotsClient) listCreateRequest(ctx context.Context, options *S return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -279,7 +286,7 @@ func (client *SnapshotsClient) listHandleResponse(resp *http.Response) (Snapshot // NewListByResourceGroupPager - Lists snapshots in the specified subscription and resource group. // -// Generated from API version 2023-07-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - SnapshotsClientListByResourceGroupOptions contains the optional parameters for the SnapshotsClient.NewListByResourceGroupPager // method. @@ -289,25 +296,20 @@ func (client *SnapshotsClient) NewListByResourceGroupPager(resourceGroupName str return page.NextLink != nil && len(*page.NextLink) > 0 }, Fetcher: func(ctx context.Context, page *SnapshotsClientListByResourceGroupResponse) (SnapshotsClientListByResourceGroupResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "SnapshotsClient.NewListByResourceGroupPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + }, nil) if err != nil { return SnapshotsClientListByResourceGroupResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return SnapshotsClientListByResourceGroupResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SnapshotsClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) - } return client.listByResourceGroupHandleResponse(resp) }, + Tracer: client.internal.Tracer(), }) } @@ -327,7 +329,7 @@ func (client *SnapshotsClient) listByResourceGroupCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -345,13 +347,17 @@ func (client *SnapshotsClient) listByResourceGroupHandleResponse(resp *http.Resp // UpdateTags - Updates tags on a snapshot. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - parameters - Parameters supplied to the Update snapshot Tags operation. // - options - SnapshotsClientUpdateTagsOptions contains the optional parameters for the SnapshotsClient.UpdateTags method. func (client *SnapshotsClient) UpdateTags(ctx context.Context, resourceGroupName string, resourceName string, parameters TagsObject, options *SnapshotsClientUpdateTagsOptions) (SnapshotsClientUpdateTagsResponse, error) { var err error + const operationName = "SnapshotsClient.UpdateTags" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, resourceName, parameters, options) if err != nil { return SnapshotsClientUpdateTagsResponse{}, err @@ -388,7 +394,7 @@ func (client *SnapshotsClient) updateTagsCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/time_rfc3339.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/time_rfc3339.go index 5618fba6..c671b41e 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/time_rfc3339.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/time_rfc3339.go @@ -18,50 +18,74 @@ import ( "time" ) +// Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. +var tzOffsetRegex = regexp.MustCompile(`(?:Z|z|\+|-)(?:\d+:\d+)*"*$`) + const ( - utcLayoutJSON = `"2006-01-02T15:04:05.999999999"` - utcLayout = "2006-01-02T15:04:05.999999999" - rfc3339JSON = `"` + time.RFC3339Nano + `"` + utcDateTime = "2006-01-02T15:04:05.999999999" + utcDateTimeJSON = `"` + utcDateTime + `"` + utcDateTimeNoT = "2006-01-02 15:04:05.999999999" + utcDateTimeJSONNoT = `"` + utcDateTimeNoT + `"` + dateTimeNoT = `2006-01-02 15:04:05.999999999Z07:00` + dateTimeJSON = `"` + time.RFC3339Nano + `"` + dateTimeJSONNoT = `"` + dateTimeNoT + `"` ) -// Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. -var tzOffsetRegex = regexp.MustCompile(`(Z|z|\+|-)(\d+:\d+)*"*$`) - -type timeRFC3339 time.Time +type dateTimeRFC3339 time.Time -func (t timeRFC3339) MarshalJSON() (json []byte, err error) { +func (t dateTimeRFC3339) MarshalJSON() ([]byte, error) { tt := time.Time(t) return tt.MarshalJSON() } -func (t timeRFC3339) MarshalText() (text []byte, err error) { +func (t dateTimeRFC3339) MarshalText() ([]byte, error) { tt := time.Time(t) return tt.MarshalText() } -func (t *timeRFC3339) UnmarshalJSON(data []byte) error { - layout := utcLayoutJSON - if tzOffsetRegex.Match(data) { - layout = rfc3339JSON +func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { + layout = dateTimeJSON + } else if tzOffset { + layout = dateTimeJSONNoT + } else if hasT { + layout = utcDateTimeJSON + } else { + layout = utcDateTimeJSONNoT } return t.Parse(layout, string(data)) } -func (t *timeRFC3339) UnmarshalText(data []byte) (err error) { - layout := utcLayout - if tzOffsetRegex.Match(data) { +func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { layout = time.RFC3339Nano + } else if tzOffset { + layout = dateTimeNoT + } else if hasT { + layout = utcDateTime + } else { + layout = utcDateTimeNoT } return t.Parse(layout, string(data)) } -func (t *timeRFC3339) Parse(layout, value string) error { +func (t *dateTimeRFC3339) Parse(layout, value string) error { p, err := time.Parse(layout, strings.ToUpper(value)) - *t = timeRFC3339(p) + *t = dateTimeRFC3339(p) return err } -func populateTimeRFC3339(m map[string]any, k string, t *time.Time) { +func (t dateTimeRFC3339) String() string { + return time.Time(t).Format(time.RFC3339Nano) +} + +func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { if t == nil { return } else if azcore.IsNullValue(t) { @@ -70,14 +94,14 @@ func populateTimeRFC3339(m map[string]any, k string, t *time.Time) { } else if reflect.ValueOf(t).IsNil() { return } - m[k] = (*timeRFC3339)(t) + m[k] = (*dateTimeRFC3339)(t) } -func unpopulateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { - if data == nil || strings.EqualFold(string(data), "null") { +func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { + if data == nil || string(data) == "null" { return nil } - var aux timeRFC3339 + var aux dateTimeRFC3339 if err := json.Unmarshal(data, &aux); err != nil { return fmt.Errorf("struct field %s: %v", fn, err) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/trustedaccessrolebindings_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/trustedaccessrolebindings_client.go new file mode 100644 index 00000000..2cb313e0 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/trustedaccessrolebindings_client.go @@ -0,0 +1,345 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armcontainerservice + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// TrustedAccessRoleBindingsClient contains the methods for the TrustedAccessRoleBindings group. +// Don't use this type directly, use NewTrustedAccessRoleBindingsClient() instead. +type TrustedAccessRoleBindingsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewTrustedAccessRoleBindingsClient creates a new instance of TrustedAccessRoleBindingsClient with the specified values. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewTrustedAccessRoleBindingsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TrustedAccessRoleBindingsClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &TrustedAccessRoleBindingsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Create or update a trusted access role binding +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - resourceName - The name of the managed cluster resource. +// - trustedAccessRoleBindingName - The name of trusted access role binding. +// - trustedAccessRoleBinding - A trusted access role binding +// - options - TrustedAccessRoleBindingsClientBeginCreateOrUpdateOptions contains the optional parameters for the TrustedAccessRoleBindingsClient.BeginCreateOrUpdate +// method. +func (client *TrustedAccessRoleBindingsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, trustedAccessRoleBindingName string, trustedAccessRoleBinding TrustedAccessRoleBinding, options *TrustedAccessRoleBindingsClientBeginCreateOrUpdateOptions) (*runtime.Poller[TrustedAccessRoleBindingsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, resourceName, trustedAccessRoleBindingName, trustedAccessRoleBinding, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[TrustedAccessRoleBindingsClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[TrustedAccessRoleBindingsClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// CreateOrUpdate - Create or update a trusted access role binding +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01 +func (client *TrustedAccessRoleBindingsClient) createOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, trustedAccessRoleBindingName string, trustedAccessRoleBinding TrustedAccessRoleBinding, options *TrustedAccessRoleBindingsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + const operationName = "TrustedAccessRoleBindingsClient.BeginCreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, resourceName, trustedAccessRoleBindingName, trustedAccessRoleBinding, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *TrustedAccessRoleBindingsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, trustedAccessRoleBindingName string, trustedAccessRoleBinding TrustedAccessRoleBinding, options *TrustedAccessRoleBindingsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + if trustedAccessRoleBindingName == "" { + return nil, errors.New("parameter trustedAccessRoleBindingName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{trustedAccessRoleBindingName}", url.PathEscape(trustedAccessRoleBindingName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, trustedAccessRoleBinding); err != nil { + return nil, err + } + return req, nil +} + +// BeginDelete - Delete a trusted access role binding. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - resourceName - The name of the managed cluster resource. +// - trustedAccessRoleBindingName - The name of trusted access role binding. +// - options - TrustedAccessRoleBindingsClientBeginDeleteOptions contains the optional parameters for the TrustedAccessRoleBindingsClient.BeginDelete +// method. +func (client *TrustedAccessRoleBindingsClient) BeginDelete(ctx context.Context, resourceGroupName string, resourceName string, trustedAccessRoleBindingName string, options *TrustedAccessRoleBindingsClientBeginDeleteOptions) (*runtime.Poller[TrustedAccessRoleBindingsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, resourceName, trustedAccessRoleBindingName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[TrustedAccessRoleBindingsClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[TrustedAccessRoleBindingsClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Delete - Delete a trusted access role binding. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01 +func (client *TrustedAccessRoleBindingsClient) deleteOperation(ctx context.Context, resourceGroupName string, resourceName string, trustedAccessRoleBindingName string, options *TrustedAccessRoleBindingsClientBeginDeleteOptions) (*http.Response, error) { + var err error + const operationName = "TrustedAccessRoleBindingsClient.BeginDelete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deleteCreateRequest(ctx, resourceGroupName, resourceName, trustedAccessRoleBindingName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *TrustedAccessRoleBindingsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, trustedAccessRoleBindingName string, options *TrustedAccessRoleBindingsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + if trustedAccessRoleBindingName == "" { + return nil, errors.New("parameter trustedAccessRoleBindingName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{trustedAccessRoleBindingName}", url.PathEscape(trustedAccessRoleBindingName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get a trusted access role binding. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - resourceName - The name of the managed cluster resource. +// - trustedAccessRoleBindingName - The name of trusted access role binding. +// - options - TrustedAccessRoleBindingsClientGetOptions contains the optional parameters for the TrustedAccessRoleBindingsClient.Get +// method. +func (client *TrustedAccessRoleBindingsClient) Get(ctx context.Context, resourceGroupName string, resourceName string, trustedAccessRoleBindingName string, options *TrustedAccessRoleBindingsClientGetOptions) (TrustedAccessRoleBindingsClientGetResponse, error) { + var err error + const operationName = "TrustedAccessRoleBindingsClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, resourceName, trustedAccessRoleBindingName, options) + if err != nil { + return TrustedAccessRoleBindingsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return TrustedAccessRoleBindingsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return TrustedAccessRoleBindingsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *TrustedAccessRoleBindingsClient) getCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, trustedAccessRoleBindingName string, options *TrustedAccessRoleBindingsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + if trustedAccessRoleBindingName == "" { + return nil, errors.New("parameter trustedAccessRoleBindingName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{trustedAccessRoleBindingName}", url.PathEscape(trustedAccessRoleBindingName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *TrustedAccessRoleBindingsClient) getHandleResponse(resp *http.Response) (TrustedAccessRoleBindingsClientGetResponse, error) { + result := TrustedAccessRoleBindingsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.TrustedAccessRoleBinding); err != nil { + return TrustedAccessRoleBindingsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - List trusted access role bindings. +// +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - resourceName - The name of the managed cluster resource. +// - options - TrustedAccessRoleBindingsClientListOptions contains the optional parameters for the TrustedAccessRoleBindingsClient.NewListPager +// method. +func (client *TrustedAccessRoleBindingsClient) NewListPager(resourceGroupName string, resourceName string, options *TrustedAccessRoleBindingsClientListOptions) *runtime.Pager[TrustedAccessRoleBindingsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[TrustedAccessRoleBindingsClientListResponse]{ + More: func(page TrustedAccessRoleBindingsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *TrustedAccessRoleBindingsClientListResponse) (TrustedAccessRoleBindingsClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "TrustedAccessRoleBindingsClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, resourceName, options) + }, nil) + if err != nil { + return TrustedAccessRoleBindingsClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *TrustedAccessRoleBindingsClient) listCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *TrustedAccessRoleBindingsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *TrustedAccessRoleBindingsClient) listHandleResponse(resp *http.Response) (TrustedAccessRoleBindingsClientListResponse, error) { + result := TrustedAccessRoleBindingsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.TrustedAccessRoleBindingListResult); err != nil { + return TrustedAccessRoleBindingsClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/trustedaccessroles_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/trustedaccessroles_client.go new file mode 100644 index 00000000..f5a65821 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/trustedaccessroles_client.go @@ -0,0 +1,104 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armcontainerservice + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// TrustedAccessRolesClient contains the methods for the TrustedAccessRoles group. +// Don't use this type directly, use NewTrustedAccessRolesClient() instead. +type TrustedAccessRolesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewTrustedAccessRolesClient creates a new instance of TrustedAccessRolesClient with the specified values. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewTrustedAccessRolesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TrustedAccessRolesClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &TrustedAccessRolesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// NewListPager - List supported trusted access roles. +// +// Generated from API version 2024-01-01 +// - location - The name of the Azure region. +// - options - TrustedAccessRolesClientListOptions contains the optional parameters for the TrustedAccessRolesClient.NewListPager +// method. +func (client *TrustedAccessRolesClient) NewListPager(location string, options *TrustedAccessRolesClientListOptions) *runtime.Pager[TrustedAccessRolesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[TrustedAccessRolesClientListResponse]{ + More: func(page TrustedAccessRolesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *TrustedAccessRolesClientListResponse) (TrustedAccessRolesClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "TrustedAccessRolesClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, location, options) + }, nil) + if err != nil { + return TrustedAccessRolesClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *TrustedAccessRolesClient) listCreateRequest(ctx context.Context, location string, options *TrustedAccessRolesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/trustedAccessRoles" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if location == "" { + return nil, errors.New("parameter location cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *TrustedAccessRolesClient) listHandleResponse(resp *http.Response) (TrustedAccessRolesClientListResponse, error) { + result := TrustedAccessRolesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.TrustedAccessRoleListResult); err != nil { + return TrustedAccessRolesClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/CHANGELOG.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/CHANGELOG.md deleted file mode 100644 index 9ee3cb2c..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/CHANGELOG.md +++ /dev/null @@ -1,350 +0,0 @@ -# Release History - -## 1.1.0 (2022-08-05) -### Features Added - -- New const `SecurityConfigurationRuleDirectionInbound` -- New const `IsGlobalFalse` -- New const `EndpointTypeAzureVMSS` -- New const `ScopeConnectionStateConflict` -- New const `SecurityConfigurationRuleDirectionOutbound` -- New const `GroupConnectivityDirectlyConnected` -- New const `ScopeConnectionStateRejected` -- New const `ConfigurationTypeConnectivity` -- New const `AutoLearnPrivateRangesModeEnabled` -- New const `UseHubGatewayFalse` -- New const `NetworkIntentPolicyBasedServiceNone` -- New const `DeleteExistingPeeringFalse` -- New const `EffectiveAdminRuleKindDefault` -- New const `DeploymentStatusFailed` -- New const `AddressPrefixTypeIPPrefix` -- New const `AddressPrefixTypeServiceTag` -- New const `UseHubGatewayTrue` -- New const `WebApplicationFirewallOperatorAny` -- New const `SecurityConfigurationRuleAccessAlwaysAllow` -- New const `CreatedByTypeUser` -- New const `EndpointTypeAzureArcVM` -- New const `DeploymentStatusNotStarted` -- New const `SecurityConfigurationRuleProtocolTCP` -- New const `SecurityConfigurationRuleAccessDeny` -- New const `SecurityConfigurationRuleProtocolEsp` -- New const `IsGlobalTrue` -- New const `DeploymentStatusDeployed` -- New const `NetworkIntentPolicyBasedServiceAll` -- New const `SecurityConfigurationRuleProtocolUDP` -- New const `CreatedByTypeKey` -- New const `PacketCaptureTargetTypeAzureVMSS` -- New const `ApplicationGatewaySSLPolicyTypeCustomV2` -- New const `DeleteExistingPeeringTrue` -- New const `ScopeConnectionStateConnected` -- New const `ApplicationGatewaySSLPolicyNameAppGwSSLPolicy20220101S` -- New const `ConnectivityTopologyMesh` -- New const `CreatedByTypeManagedIdentity` -- New const `AdminRuleKindCustom` -- New const `ApplicationGatewaySSLProtocolTLSv13` -- New const `ConnectivityTopologyHubAndSpoke` -- New const `ScopeConnectionStateRevoked` -- New const `ConfigurationTypeSecurityAdmin` -- New const `SecurityConfigurationRuleProtocolAh` -- New const `CommissionedStateCommissionedNoInternetAdvertise` -- New const `ScopeConnectionStatePending` -- New const `SecurityConfigurationRuleAccessAllow` -- New const `SecurityConfigurationRuleProtocolIcmp` -- New const `AutoLearnPrivateRangesModeDisabled` -- New const `SecurityConfigurationRuleProtocolAny` -- New const `ApplicationGatewaySSLPolicyNameAppGwSSLPolicy20220101` -- New const `CreatedByTypeApplication` -- New const `GroupConnectivityNone` -- New const `EffectiveAdminRuleKindCustom` -- New const `AdminRuleKindDefault` -- New const `DeploymentStatusDeploying` -- New const `PacketCaptureTargetTypeAzureVM` -- New function `*ManagementClient.ListActiveConnectivityConfigurations(context.Context, string, string, ActiveConfigurationParameter, *ManagementClientListActiveConnectivityConfigurationsOptions) (ManagementClientListActiveConnectivityConfigurationsResponse, error)` -- New function `*ManagersClient.NewListBySubscriptionPager(*ManagersClientListBySubscriptionOptions) *runtime.Pager[ManagersClientListBySubscriptionResponse]` -- New function `NewStaticMembersClient(string, azcore.TokenCredential, *arm.ClientOptions) (*StaticMembersClient, error)` -- New function `NewAdminRulesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*AdminRulesClient, error)` -- New function `*EffectiveDefaultSecurityAdminRule.GetEffectiveBaseSecurityAdminRule() *EffectiveBaseSecurityAdminRule` -- New function `PossibleAddressPrefixTypeValues() []AddressPrefixType` -- New function `PossibleUseHubGatewayValues() []UseHubGateway` -- New function `*ScopeConnectionsClient.Delete(context.Context, string, string, string, *ScopeConnectionsClientDeleteOptions) (ScopeConnectionsClientDeleteResponse, error)` -- New function `PossibleIsGlobalValues() []IsGlobal` -- New function `*ManagementClient.ListActiveSecurityAdminRules(context.Context, string, string, ActiveConfigurationParameter, *ManagementClientListActiveSecurityAdminRulesOptions) (ManagementClientListActiveSecurityAdminRulesResponse, error)` -- New function `*ManagersClient.NewListPager(string, *ManagersClientListOptions) *runtime.Pager[ManagersClientListResponse]` -- New function `NewConnectivityConfigurationsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ConnectivityConfigurationsClient, error)` -- New function `*GroupsClient.Get(context.Context, string, string, string, *GroupsClientGetOptions) (GroupsClientGetResponse, error)` -- New function `PossibleAdminRuleKindValues() []AdminRuleKind` -- New function `*ScopeConnectionsClient.Get(context.Context, string, string, string, *ScopeConnectionsClientGetOptions) (ScopeConnectionsClientGetResponse, error)` -- New function `*AdminRuleCollectionsClient.CreateOrUpdate(context.Context, string, string, string, string, AdminRuleCollection, *AdminRuleCollectionsClientCreateOrUpdateOptions) (AdminRuleCollectionsClientCreateOrUpdateResponse, error)` -- New function `PossibleScopeConnectionStateValues() []ScopeConnectionState` -- New function `*ConnectivityConfigurationsClient.NewListPager(string, string, *ConnectivityConfigurationsClientListOptions) *runtime.Pager[ConnectivityConfigurationsClientListResponse]` -- New function `*BaseAdminRule.GetBaseAdminRule() *BaseAdminRule` -- New function `PossibleSecurityConfigurationRuleProtocolValues() []SecurityConfigurationRuleProtocol` -- New function `*AdminRulesClient.CreateOrUpdate(context.Context, string, string, string, string, string, BaseAdminRuleClassification, *AdminRulesClientCreateOrUpdateOptions) (AdminRulesClientCreateOrUpdateResponse, error)` -- New function `PossibleNetworkIntentPolicyBasedServiceValues() []NetworkIntentPolicyBasedService` -- New function `*ManagementGroupNetworkManagerConnectionsClient.Delete(context.Context, string, string, *ManagementGroupNetworkManagerConnectionsClientDeleteOptions) (ManagementGroupNetworkManagerConnectionsClientDeleteResponse, error)` -- New function `PossibleSecurityConfigurationRuleAccessValues() []SecurityConfigurationRuleAccess` -- New function `*ManagersClient.BeginDelete(context.Context, string, string, *ManagersClientBeginDeleteOptions) (*runtime.Poller[ManagersClientDeleteResponse], error)` -- New function `*ManagementClient.ExpressRouteProviderPort(context.Context, string, *ManagementClientExpressRouteProviderPortOptions) (ManagementClientExpressRouteProviderPortResponse, error)` -- New function `*ActiveBaseSecurityAdminRule.GetActiveBaseSecurityAdminRule() *ActiveBaseSecurityAdminRule` -- New function `*ConnectivityConfigurationsClient.BeginDelete(context.Context, string, string, string, *ConnectivityConfigurationsClientBeginDeleteOptions) (*runtime.Poller[ConnectivityConfigurationsClientDeleteResponse], error)` -- New function `*AdminRuleCollectionsClient.BeginDelete(context.Context, string, string, string, string, *AdminRuleCollectionsClientBeginDeleteOptions) (*runtime.Poller[AdminRuleCollectionsClientDeleteResponse], error)` -- New function `*ConnectivityConfigurationsClient.CreateOrUpdate(context.Context, string, string, string, ConnectivityConfiguration, *ConnectivityConfigurationsClientCreateOrUpdateOptions) (ConnectivityConfigurationsClientCreateOrUpdateResponse, error)` -- New function `*SecurityAdminConfigurationsClient.Get(context.Context, string, string, string, *SecurityAdminConfigurationsClientGetOptions) (SecurityAdminConfigurationsClientGetResponse, error)` -- New function `*StaticMembersClient.Delete(context.Context, string, string, string, string, *StaticMembersClientDeleteOptions) (StaticMembersClientDeleteResponse, error)` -- New function `*ManagerDeploymentStatusClient.List(context.Context, string, string, ManagerDeploymentStatusParameter, *ManagerDeploymentStatusClientListOptions) (ManagerDeploymentStatusClientListResponse, error)` -- New function `*SubscriptionNetworkManagerConnectionsClient.Delete(context.Context, string, *SubscriptionNetworkManagerConnectionsClientDeleteOptions) (SubscriptionNetworkManagerConnectionsClientDeleteResponse, error)` -- New function `PossibleEffectiveAdminRuleKindValues() []EffectiveAdminRuleKind` -- New function `*AdminRulesClient.NewListPager(string, string, string, string, *AdminRulesClientListOptions) *runtime.Pager[AdminRulesClientListResponse]` -- New function `*GroupsClient.NewListPager(string, string, *GroupsClientListOptions) *runtime.Pager[GroupsClientListResponse]` -- New function `*GroupsClient.BeginDelete(context.Context, string, string, string, *GroupsClientBeginDeleteOptions) (*runtime.Poller[GroupsClientDeleteResponse], error)` -- New function `*StaticMembersClient.NewListPager(string, string, string, *StaticMembersClientListOptions) *runtime.Pager[StaticMembersClientListResponse]` -- New function `NewGroupsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*GroupsClient, error)` -- New function `PossibleCreatedByTypeValues() []CreatedByType` -- New function `PossibleAutoLearnPrivateRangesModeValues() []AutoLearnPrivateRangesMode` -- New function `*ManagementGroupNetworkManagerConnectionsClient.CreateOrUpdate(context.Context, string, string, ManagerConnection, *ManagementGroupNetworkManagerConnectionsClientCreateOrUpdateOptions) (ManagementGroupNetworkManagerConnectionsClientCreateOrUpdateResponse, error)` -- New function `*GroupsClient.CreateOrUpdate(context.Context, string, string, string, Group, *GroupsClientCreateOrUpdateOptions) (GroupsClientCreateOrUpdateResponse, error)` -- New function `*ActiveSecurityAdminRule.GetActiveBaseSecurityAdminRule() *ActiveBaseSecurityAdminRule` -- New function `*AdminRuleCollectionsClient.Get(context.Context, string, string, string, string, *AdminRuleCollectionsClientGetOptions) (AdminRuleCollectionsClientGetResponse, error)` -- New function `*ManagersClient.CreateOrUpdate(context.Context, string, string, Manager, *ManagersClientCreateOrUpdateOptions) (ManagersClientCreateOrUpdateResponse, error)` -- New function `*SubscriptionNetworkManagerConnectionsClient.NewListPager(*SubscriptionNetworkManagerConnectionsClientListOptions) *runtime.Pager[SubscriptionNetworkManagerConnectionsClientListResponse]` -- New function `*AdminRule.GetBaseAdminRule() *BaseAdminRule` -- New function `*AdminRulesClient.Get(context.Context, string, string, string, string, string, *AdminRulesClientGetOptions) (AdminRulesClientGetResponse, error)` -- New function `PossiblePacketCaptureTargetTypeValues() []PacketCaptureTargetType` -- New function `*ManagementClient.ListNetworkManagerEffectiveSecurityAdminRules(context.Context, string, string, QueryRequestOptions, *ManagementClientListNetworkManagerEffectiveSecurityAdminRulesOptions) (ManagementClientListNetworkManagerEffectiveSecurityAdminRulesResponse, error)` -- New function `*ManagementGroupNetworkManagerConnectionsClient.Get(context.Context, string, string, *ManagementGroupNetworkManagerConnectionsClientGetOptions) (ManagementGroupNetworkManagerConnectionsClientGetResponse, error)` -- New function `NewExpressRouteProviderPortsLocationClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ExpressRouteProviderPortsLocationClient, error)` -- New function `*DefaultAdminRule.GetBaseAdminRule() *BaseAdminRule` -- New function `*ConnectivityConfigurationsClient.Get(context.Context, string, string, string, *ConnectivityConfigurationsClientGetOptions) (ConnectivityConfigurationsClientGetResponse, error)` -- New function `NewManagersClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ManagersClient, error)` -- New function `*SubscriptionNetworkManagerConnectionsClient.Get(context.Context, string, *SubscriptionNetworkManagerConnectionsClientGetOptions) (SubscriptionNetworkManagerConnectionsClientGetResponse, error)` -- New function `*EffectiveSecurityAdminRule.GetEffectiveBaseSecurityAdminRule() *EffectiveBaseSecurityAdminRule` -- New function `*EffectiveBaseSecurityAdminRule.GetEffectiveBaseSecurityAdminRule() *EffectiveBaseSecurityAdminRule` -- New function `NewScopeConnectionsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ScopeConnectionsClient, error)` -- New function `NewAdminRuleCollectionsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*AdminRuleCollectionsClient, error)` -- New function `*ManagementClient.ListNetworkManagerEffectiveConnectivityConfigurations(context.Context, string, string, QueryRequestOptions, *ManagementClientListNetworkManagerEffectiveConnectivityConfigurationsOptions) (ManagementClientListNetworkManagerEffectiveConnectivityConfigurationsResponse, error)` -- New function `PossibleGroupConnectivityValues() []GroupConnectivity` -- New function `NewSubscriptionNetworkManagerConnectionsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*SubscriptionNetworkManagerConnectionsClient, error)` -- New function `*AzureFirewallsClient.BeginListLearnedPrefixes(context.Context, string, string, *AzureFirewallsClientBeginListLearnedPrefixesOptions) (*runtime.Poller[AzureFirewallsClientListLearnedPrefixesResponse], error)` -- New function `*ManagersClient.Patch(context.Context, string, string, PatchObject, *ManagersClientPatchOptions) (ManagersClientPatchResponse, error)` -- New function `*ManagersClient.Get(context.Context, string, string, *ManagersClientGetOptions) (ManagersClientGetResponse, error)` -- New function `*StaticMembersClient.CreateOrUpdate(context.Context, string, string, string, string, StaticMember, *StaticMembersClientCreateOrUpdateOptions) (StaticMembersClientCreateOrUpdateResponse, error)` -- New function `*AdminRuleCollectionsClient.NewListPager(string, string, string, *AdminRuleCollectionsClientListOptions) *runtime.Pager[AdminRuleCollectionsClientListResponse]` -- New function `*ScopeConnectionsClient.NewListPager(string, string, *ScopeConnectionsClientListOptions) *runtime.Pager[ScopeConnectionsClientListResponse]` -- New function `*ActiveDefaultSecurityAdminRule.GetActiveBaseSecurityAdminRule() *ActiveBaseSecurityAdminRule` -- New function `*ExpressRouteProviderPortsLocationClient.List(context.Context, *ExpressRouteProviderPortsLocationClientListOptions) (ExpressRouteProviderPortsLocationClientListResponse, error)` -- New function `*ManagerCommitsClient.BeginPost(context.Context, string, string, ManagerCommit, *ManagerCommitsClientBeginPostOptions) (*runtime.Poller[ManagerCommitsClientPostResponse], error)` -- New function `NewManagerCommitsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ManagerCommitsClient, error)` -- New function `PossibleConfigurationTypeValues() []ConfigurationType` -- New function `NewManagerDeploymentStatusClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ManagerDeploymentStatusClient, error)` -- New function `*ScopeConnectionsClient.CreateOrUpdate(context.Context, string, string, string, ScopeConnection, *ScopeConnectionsClientCreateOrUpdateOptions) (ScopeConnectionsClientCreateOrUpdateResponse, error)` -- New function `*SecurityAdminConfigurationsClient.CreateOrUpdate(context.Context, string, string, string, SecurityAdminConfiguration, *SecurityAdminConfigurationsClientCreateOrUpdateOptions) (SecurityAdminConfigurationsClientCreateOrUpdateResponse, error)` -- New function `NewManagementGroupNetworkManagerConnectionsClient(azcore.TokenCredential, *arm.ClientOptions) (*ManagementGroupNetworkManagerConnectionsClient, error)` -- New function `PossibleDeleteExistingPeeringValues() []DeleteExistingPeering` -- New function `PossibleDeploymentStatusValues() []DeploymentStatus` -- New function `*ManagementGroupNetworkManagerConnectionsClient.NewListPager(string, *ManagementGroupNetworkManagerConnectionsClientListOptions) *runtime.Pager[ManagementGroupNetworkManagerConnectionsClientListResponse]` -- New function `*SecurityAdminConfigurationsClient.NewListPager(string, string, *SecurityAdminConfigurationsClientListOptions) *runtime.Pager[SecurityAdminConfigurationsClientListResponse]` -- New function `PossibleConnectivityTopologyValues() []ConnectivityTopology` -- New function `*StaticMembersClient.Get(context.Context, string, string, string, string, *StaticMembersClientGetOptions) (StaticMembersClientGetResponse, error)` -- New function `PossibleSecurityConfigurationRuleDirectionValues() []SecurityConfigurationRuleDirection` -- New function `*SecurityAdminConfigurationsClient.BeginDelete(context.Context, string, string, string, *SecurityAdminConfigurationsClientBeginDeleteOptions) (*runtime.Poller[SecurityAdminConfigurationsClientDeleteResponse], error)` -- New function `NewSecurityAdminConfigurationsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*SecurityAdminConfigurationsClient, error)` -- New function `*AdminRulesClient.BeginDelete(context.Context, string, string, string, string, string, *AdminRulesClientBeginDeleteOptions) (*runtime.Poller[AdminRulesClientDeleteResponse], error)` -- New function `*SubscriptionNetworkManagerConnectionsClient.CreateOrUpdate(context.Context, string, ManagerConnection, *SubscriptionNetworkManagerConnectionsClientCreateOrUpdateOptions) (SubscriptionNetworkManagerConnectionsClientCreateOrUpdateResponse, error)` -- New struct `ActiveBaseSecurityAdminRule` -- New struct `ActiveConfigurationParameter` -- New struct `ActiveConnectivityConfiguration` -- New struct `ActiveConnectivityConfigurationsListResult` -- New struct `ActiveDefaultSecurityAdminRule` -- New struct `ActiveSecurityAdminRule` -- New struct `ActiveSecurityAdminRulesListResult` -- New struct `AddressPrefixItem` -- New struct `AdminPropertiesFormat` -- New struct `AdminRule` -- New struct `AdminRuleCollection` -- New struct `AdminRuleCollectionListResult` -- New struct `AdminRuleCollectionPropertiesFormat` -- New struct `AdminRuleCollectionsClient` -- New struct `AdminRuleCollectionsClientBeginDeleteOptions` -- New struct `AdminRuleCollectionsClientCreateOrUpdateOptions` -- New struct `AdminRuleCollectionsClientCreateOrUpdateResponse` -- New struct `AdminRuleCollectionsClientDeleteResponse` -- New struct `AdminRuleCollectionsClientGetOptions` -- New struct `AdminRuleCollectionsClientGetResponse` -- New struct `AdminRuleCollectionsClientListOptions` -- New struct `AdminRuleCollectionsClientListResponse` -- New struct `AdminRuleListResult` -- New struct `AdminRulesClient` -- New struct `AdminRulesClientBeginDeleteOptions` -- New struct `AdminRulesClientCreateOrUpdateOptions` -- New struct `AdminRulesClientCreateOrUpdateResponse` -- New struct `AdminRulesClientDeleteResponse` -- New struct `AdminRulesClientGetOptions` -- New struct `AdminRulesClientGetResponse` -- New struct `AdminRulesClientListOptions` -- New struct `AdminRulesClientListResponse` -- New struct `AzureFirewallsClientBeginListLearnedPrefixesOptions` -- New struct `AzureFirewallsClientListLearnedPrefixesResponse` -- New struct `BaseAdminRule` -- New struct `ChildResource` -- New struct `ConfigurationGroup` -- New struct `ConnectivityConfiguration` -- New struct `ConnectivityConfigurationListResult` -- New struct `ConnectivityConfigurationProperties` -- New struct `ConnectivityConfigurationsClient` -- New struct `ConnectivityConfigurationsClientBeginDeleteOptions` -- New struct `ConnectivityConfigurationsClientCreateOrUpdateOptions` -- New struct `ConnectivityConfigurationsClientCreateOrUpdateResponse` -- New struct `ConnectivityConfigurationsClientDeleteResponse` -- New struct `ConnectivityConfigurationsClientGetOptions` -- New struct `ConnectivityConfigurationsClientGetResponse` -- New struct `ConnectivityConfigurationsClientListOptions` -- New struct `ConnectivityConfigurationsClientListResponse` -- New struct `ConnectivityGroupItem` -- New struct `CrossTenantScopes` -- New struct `DefaultAdminPropertiesFormat` -- New struct `DefaultAdminRule` -- New struct `EffectiveBaseSecurityAdminRule` -- New struct `EffectiveConnectivityConfiguration` -- New struct `EffectiveDefaultSecurityAdminRule` -- New struct `EffectiveSecurityAdminRule` -- New struct `ExpressRouteProviderPort` -- New struct `ExpressRouteProviderPortListResult` -- New struct `ExpressRouteProviderPortProperties` -- New struct `ExpressRouteProviderPortsLocationClient` -- New struct `ExpressRouteProviderPortsLocationClientListOptions` -- New struct `ExpressRouteProviderPortsLocationClientListResponse` -- New struct `Group` -- New struct `GroupListResult` -- New struct `GroupProperties` -- New struct `GroupsClient` -- New struct `GroupsClientBeginDeleteOptions` -- New struct `GroupsClientCreateOrUpdateOptions` -- New struct `GroupsClientCreateOrUpdateResponse` -- New struct `GroupsClientDeleteResponse` -- New struct `GroupsClientGetOptions` -- New struct `GroupsClientGetResponse` -- New struct `GroupsClientListOptions` -- New struct `GroupsClientListResponse` -- New struct `Hub` -- New struct `IPPrefixesList` -- New struct `ManagementClientExpressRouteProviderPortOptions` -- New struct `ManagementClientExpressRouteProviderPortResponse` -- New struct `ManagementClientListActiveConnectivityConfigurationsOptions` -- New struct `ManagementClientListActiveConnectivityConfigurationsResponse` -- New struct `ManagementClientListActiveSecurityAdminRulesOptions` -- New struct `ManagementClientListActiveSecurityAdminRulesResponse` -- New struct `ManagementClientListNetworkManagerEffectiveConnectivityConfigurationsOptions` -- New struct `ManagementClientListNetworkManagerEffectiveConnectivityConfigurationsResponse` -- New struct `ManagementClientListNetworkManagerEffectiveSecurityAdminRulesOptions` -- New struct `ManagementClientListNetworkManagerEffectiveSecurityAdminRulesResponse` -- New struct `ManagementGroupNetworkManagerConnectionsClient` -- New struct `ManagementGroupNetworkManagerConnectionsClientCreateOrUpdateOptions` -- New struct `ManagementGroupNetworkManagerConnectionsClientCreateOrUpdateResponse` -- New struct `ManagementGroupNetworkManagerConnectionsClientDeleteOptions` -- New struct `ManagementGroupNetworkManagerConnectionsClientDeleteResponse` -- New struct `ManagementGroupNetworkManagerConnectionsClientGetOptions` -- New struct `ManagementGroupNetworkManagerConnectionsClientGetResponse` -- New struct `ManagementGroupNetworkManagerConnectionsClientListOptions` -- New struct `ManagementGroupNetworkManagerConnectionsClientListResponse` -- New struct `Manager` -- New struct `ManagerCommit` -- New struct `ManagerCommitsClient` -- New struct `ManagerCommitsClientBeginPostOptions` -- New struct `ManagerCommitsClientPostResponse` -- New struct `ManagerConnection` -- New struct `ManagerConnectionListResult` -- New struct `ManagerConnectionProperties` -- New struct `ManagerDeploymentStatus` -- New struct `ManagerDeploymentStatusClient` -- New struct `ManagerDeploymentStatusClientListOptions` -- New struct `ManagerDeploymentStatusClientListResponse` -- New struct `ManagerDeploymentStatusListResult` -- New struct `ManagerDeploymentStatusParameter` -- New struct `ManagerEffectiveConnectivityConfigurationListResult` -- New struct `ManagerEffectiveSecurityAdminRulesListResult` -- New struct `ManagerListResult` -- New struct `ManagerProperties` -- New struct `ManagerPropertiesNetworkManagerScopes` -- New struct `ManagerSecurityGroupItem` -- New struct `ManagersClient` -- New struct `ManagersClientBeginDeleteOptions` -- New struct `ManagersClientCreateOrUpdateOptions` -- New struct `ManagersClientCreateOrUpdateResponse` -- New struct `ManagersClientDeleteResponse` -- New struct `ManagersClientGetOptions` -- New struct `ManagersClientGetResponse` -- New struct `ManagersClientListBySubscriptionOptions` -- New struct `ManagersClientListBySubscriptionResponse` -- New struct `ManagersClientListOptions` -- New struct `ManagersClientListResponse` -- New struct `ManagersClientPatchOptions` -- New struct `ManagersClientPatchResponse` -- New struct `PacketCaptureMachineScope` -- New struct `PatchObject` -- New struct `QueryRequestOptions` -- New struct `ScopeConnection` -- New struct `ScopeConnectionListResult` -- New struct `ScopeConnectionProperties` -- New struct `ScopeConnectionsClient` -- New struct `ScopeConnectionsClientCreateOrUpdateOptions` -- New struct `ScopeConnectionsClientCreateOrUpdateResponse` -- New struct `ScopeConnectionsClientDeleteOptions` -- New struct `ScopeConnectionsClientDeleteResponse` -- New struct `ScopeConnectionsClientGetOptions` -- New struct `ScopeConnectionsClientGetResponse` -- New struct `ScopeConnectionsClientListOptions` -- New struct `ScopeConnectionsClientListResponse` -- New struct `SecurityAdminConfiguration` -- New struct `SecurityAdminConfigurationListResult` -- New struct `SecurityAdminConfigurationPropertiesFormat` -- New struct `SecurityAdminConfigurationsClient` -- New struct `SecurityAdminConfigurationsClientBeginDeleteOptions` -- New struct `SecurityAdminConfigurationsClientCreateOrUpdateOptions` -- New struct `SecurityAdminConfigurationsClientCreateOrUpdateResponse` -- New struct `SecurityAdminConfigurationsClientDeleteResponse` -- New struct `SecurityAdminConfigurationsClientGetOptions` -- New struct `SecurityAdminConfigurationsClientGetResponse` -- New struct `SecurityAdminConfigurationsClientListOptions` -- New struct `SecurityAdminConfigurationsClientListResponse` -- New struct `StaticMember` -- New struct `StaticMemberListResult` -- New struct `StaticMemberProperties` -- New struct `StaticMembersClient` -- New struct `StaticMembersClientCreateOrUpdateOptions` -- New struct `StaticMembersClientCreateOrUpdateResponse` -- New struct `StaticMembersClientDeleteOptions` -- New struct `StaticMembersClientDeleteResponse` -- New struct `StaticMembersClientGetOptions` -- New struct `StaticMembersClientGetResponse` -- New struct `StaticMembersClientListOptions` -- New struct `StaticMembersClientListResponse` -- New struct `SubscriptionNetworkManagerConnectionsClient` -- New struct `SubscriptionNetworkManagerConnectionsClientCreateOrUpdateOptions` -- New struct `SubscriptionNetworkManagerConnectionsClientCreateOrUpdateResponse` -- New struct `SubscriptionNetworkManagerConnectionsClientDeleteOptions` -- New struct `SubscriptionNetworkManagerConnectionsClientDeleteResponse` -- New struct `SubscriptionNetworkManagerConnectionsClientGetOptions` -- New struct `SubscriptionNetworkManagerConnectionsClientGetResponse` -- New struct `SubscriptionNetworkManagerConnectionsClientListOptions` -- New struct `SubscriptionNetworkManagerConnectionsClientListResponse` -- New struct `SystemData` -- New struct `VirtualRouterAutoScaleConfiguration` -- New field `NoInternetAdvertise` in struct `CustomIPPrefixPropertiesFormat` -- New field `FlushConnection` in struct `SecurityGroupPropertiesFormat` -- New field `EnablePacFile` in struct `ExplicitProxySettings` -- New field `Scope` in struct `PacketCaptureParameters` -- New field `TargetType` in struct `PacketCaptureParameters` -- New field `Scope` in struct `PacketCaptureResultProperties` -- New field `TargetType` in struct `PacketCaptureResultProperties` -- New field `AutoLearnPrivateRanges` in struct `FirewallPolicySNAT` -- New field `VirtualRouterAutoScaleConfiguration` in struct `VirtualHubProperties` -- New field `Priority` in struct `ApplicationGatewayRoutingRulePropertiesFormat` - - -## 1.0.0 (2022-05-16) - -The package of `github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork` is using our [next generation design principles](https://azure.github.io/azure-sdk/general_introduction.html) since version 1.0.0, which contains breaking changes. - -To migrate the existing applications to the latest version, please refer to [Migration Guide](https://aka.ms/azsdk/go/mgmt/migration). - -To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/go/mgmt). \ No newline at end of file diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/LICENSE.txt b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/LICENSE.txt deleted file mode 100644 index dc0c2ffb..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/LICENSE.txt +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) Microsoft Corporation. All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/README.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/README.md deleted file mode 100644 index a967c337..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/README.md +++ /dev/null @@ -1,86 +0,0 @@ -# Azure Network Module for Go - -[![PkgGoDev](https://pkg.go.dev/badge/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork)](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork) - -The `armnetwork` module provides operations for working with Azure Network. - -[Source code](https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/resourcemanager/network/armnetwork) - -# Getting started - -## Prerequisites - -- an [Azure subscription](https://azure.microsoft.com/free/) -- Go 1.18 or above - -## Install the package - -This project uses [Go modules](https://github.com/golang/go/wiki/Modules) for versioning and dependency management. - -Install the Azure Network module: - -```sh -go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork -``` - -## Authorization - -When creating a client, you will need to provide a credential for authenticating with Azure Network. The `azidentity` module provides facilities for various ways of authenticating with Azure including client/secret, certificate, managed identity, and more. - -```go -cred, err := azidentity.NewDefaultAzureCredential(nil) -``` - -For more information on authentication, please see the documentation for `azidentity` at [pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity). - -## Clients - -Azure Network modules consist of one or more clients. A client groups a set of related APIs, providing access to its functionality within the specified subscription. Create one or more clients to access the APIs you require using your credential. - -```go -client, err := armnetwork.NewVirtualHubBgpConnectionsClient(, cred, nil) -``` - -You can use `ClientOptions` in package `github.com/Azure/azure-sdk-for-go/sdk/azcore/arm` to set endpoint to connect with public and sovereign clouds as well as Azure Stack. For more information, please see the documentation for `azcore` at [pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azcore](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azcore). - -```go -options := arm.ClientOptions { - ClientOptions: azcore.ClientOptions { - Cloud: cloud.AzureChina, - }, -} -client, err := armnetwork.NewVirtualHubBgpConnectionsClient(, cred, &options) -``` - -## More sample code - -- [IP Address](https://aka.ms/azsdk/go/mgmt/samples?path=sdk/resourcemanager/network/ipaddress) -- [Load Balancer](https://aka.ms/azsdk/go/mgmt/samples?path=sdk/resourcemanager/network/loadbalancer) -- [Network Interface](https://aka.ms/azsdk/go/mgmt/samples?path=sdk/resourcemanager/network/networkInterface) -- [Security Group](https://aka.ms/azsdk/go/mgmt/samples?path=sdk/resourcemanager/network/securitygroups) -- [Subnet](https://aka.ms/azsdk/go/mgmt/samples?path=sdk/resourcemanager/network/subnets) -- [Virtual Network](https://aka.ms/azsdk/go/mgmt/samples?path=sdk/resourcemanager/network/virtualnetwork) - -## Provide Feedback - -If you encounter bugs or have suggestions, please -[open an issue](https://github.com/Azure/azure-sdk-for-go/issues) and assign the `Network` label. - -# Contributing - -This project welcomes contributions and suggestions. Most contributions require -you to agree to a Contributor License Agreement (CLA) declaring that you have -the right to, and actually do, grant us the rights to use your contribution. -For details, visit [https://cla.microsoft.com](https://cla.microsoft.com). - -When you submit a pull request, a CLA-bot will automatically determine whether -you need to provide a CLA and decorate the PR appropriately (e.g., label, -comment). Simply follow the instructions provided by the bot. You will only -need to do this once across all repos using our CLA. - -This project has adopted the -[Microsoft Open Source Code of Conduct](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. \ No newline at end of file diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/adminrulecollections_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/adminrulecollections_client.go deleted file mode 100644 index cad23d81..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/adminrulecollections_client.go +++ /dev/null @@ -1,352 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strconv" - "strings" -) - -// AdminRuleCollectionsClient contains the methods for the AdminRuleCollections group. -// Don't use this type directly, use NewAdminRuleCollectionsClient() instead. -type AdminRuleCollectionsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewAdminRuleCollectionsClient creates a new instance of AdminRuleCollectionsClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewAdminRuleCollectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AdminRuleCollectionsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &AdminRuleCollectionsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// CreateOrUpdate - Creates or updates an admin rule collection. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkManagerName - The name of the network manager. -// configurationName - The name of the network manager Security Configuration. -// ruleCollectionName - The name of the network manager security Configuration rule collection. -// ruleCollection - The Rule Collection to create or update -// options - AdminRuleCollectionsClientCreateOrUpdateOptions contains the optional parameters for the AdminRuleCollectionsClient.CreateOrUpdate -// method. -func (client *AdminRuleCollectionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, ruleCollection AdminRuleCollection, options *AdminRuleCollectionsClientCreateOrUpdateOptions) (AdminRuleCollectionsClientCreateOrUpdateResponse, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleCollection, options) - if err != nil { - return AdminRuleCollectionsClientCreateOrUpdateResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return AdminRuleCollectionsClientCreateOrUpdateResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return AdminRuleCollectionsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) - } - return client.createOrUpdateHandleResponse(resp) -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *AdminRuleCollectionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, ruleCollection AdminRuleCollection, options *AdminRuleCollectionsClientCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkManagerName == "" { - return nil, errors.New("parameter networkManagerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) - if configurationName == "" { - return nil, errors.New("parameter configurationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{configurationName}", url.PathEscape(configurationName)) - if ruleCollectionName == "" { - return nil, errors.New("parameter ruleCollectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{ruleCollectionName}", url.PathEscape(ruleCollectionName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, ruleCollection) -} - -// createOrUpdateHandleResponse handles the CreateOrUpdate response. -func (client *AdminRuleCollectionsClient) createOrUpdateHandleResponse(resp *http.Response) (AdminRuleCollectionsClientCreateOrUpdateResponse, error) { - result := AdminRuleCollectionsClientCreateOrUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.AdminRuleCollection); err != nil { - return AdminRuleCollectionsClientCreateOrUpdateResponse{}, err - } - return result, nil -} - -// BeginDelete - Deletes an admin rule collection. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkManagerName - The name of the network manager. -// configurationName - The name of the network manager Security Configuration. -// ruleCollectionName - The name of the network manager security Configuration rule collection. -// options - AdminRuleCollectionsClientBeginDeleteOptions contains the optional parameters for the AdminRuleCollectionsClient.BeginDelete -// method. -func (client *AdminRuleCollectionsClient) BeginDelete(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, options *AdminRuleCollectionsClientBeginDeleteOptions) (*runtime.Poller[AdminRuleCollectionsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, networkManagerName, configurationName, ruleCollectionName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[AdminRuleCollectionsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[AdminRuleCollectionsClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes an admin rule collection. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *AdminRuleCollectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, options *AdminRuleCollectionsClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, networkManagerName, configurationName, ruleCollectionName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *AdminRuleCollectionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, options *AdminRuleCollectionsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkManagerName == "" { - return nil, errors.New("parameter networkManagerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) - if configurationName == "" { - return nil, errors.New("parameter configurationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{configurationName}", url.PathEscape(configurationName)) - if ruleCollectionName == "" { - return nil, errors.New("parameter ruleCollectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{ruleCollectionName}", url.PathEscape(ruleCollectionName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - if options != nil && options.Force != nil { - reqQP.Set("force", strconv.FormatBool(*options.Force)) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets a network manager security admin configuration rule collection. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkManagerName - The name of the network manager. -// configurationName - The name of the network manager Security Configuration. -// ruleCollectionName - The name of the network manager security Configuration rule collection. -// options - AdminRuleCollectionsClientGetOptions contains the optional parameters for the AdminRuleCollectionsClient.Get -// method. -func (client *AdminRuleCollectionsClient) Get(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, options *AdminRuleCollectionsClientGetOptions) (AdminRuleCollectionsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, networkManagerName, configurationName, ruleCollectionName, options) - if err != nil { - return AdminRuleCollectionsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return AdminRuleCollectionsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AdminRuleCollectionsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *AdminRuleCollectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, options *AdminRuleCollectionsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkManagerName == "" { - return nil, errors.New("parameter networkManagerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) - if configurationName == "" { - return nil, errors.New("parameter configurationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{configurationName}", url.PathEscape(configurationName)) - if ruleCollectionName == "" { - return nil, errors.New("parameter ruleCollectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{ruleCollectionName}", url.PathEscape(ruleCollectionName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *AdminRuleCollectionsClient) getHandleResponse(resp *http.Response) (AdminRuleCollectionsClientGetResponse, error) { - result := AdminRuleCollectionsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.AdminRuleCollection); err != nil { - return AdminRuleCollectionsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Lists all the rule collections in a security admin configuration, in a paginated format. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkManagerName - The name of the network manager. -// configurationName - The name of the network manager Security Configuration. -// options - AdminRuleCollectionsClientListOptions contains the optional parameters for the AdminRuleCollectionsClient.List -// method. -func (client *AdminRuleCollectionsClient) NewListPager(resourceGroupName string, networkManagerName string, configurationName string, options *AdminRuleCollectionsClientListOptions) *runtime.Pager[AdminRuleCollectionsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[AdminRuleCollectionsClientListResponse]{ - More: func(page AdminRuleCollectionsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *AdminRuleCollectionsClientListResponse) (AdminRuleCollectionsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, networkManagerName, configurationName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return AdminRuleCollectionsClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return AdminRuleCollectionsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AdminRuleCollectionsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *AdminRuleCollectionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, options *AdminRuleCollectionsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}/ruleCollections" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkManagerName == "" { - return nil, errors.New("parameter networkManagerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) - if configurationName == "" { - return nil, errors.New("parameter configurationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{configurationName}", url.PathEscape(configurationName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - if options != nil && options.Top != nil { - reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) - } - if options != nil && options.SkipToken != nil { - reqQP.Set("$skipToken", *options.SkipToken) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *AdminRuleCollectionsClient) listHandleResponse(resp *http.Response) (AdminRuleCollectionsClientListResponse, error) { - result := AdminRuleCollectionsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.AdminRuleCollectionListResult); err != nil { - return AdminRuleCollectionsClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/adminrules_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/adminrules_client.go deleted file mode 100644 index e92cabbe..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/adminrules_client.go +++ /dev/null @@ -1,369 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strconv" - "strings" -) - -// AdminRulesClient contains the methods for the AdminRules group. -// Don't use this type directly, use NewAdminRulesClient() instead. -type AdminRulesClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewAdminRulesClient creates a new instance of AdminRulesClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewAdminRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AdminRulesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &AdminRulesClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// CreateOrUpdate - Creates or updates an admin rule. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkManagerName - The name of the network manager. -// configurationName - The name of the network manager Security Configuration. -// ruleCollectionName - The name of the network manager security Configuration rule collection. -// ruleName - The name of the rule. -// adminRule - The admin rule to create or update -// options - AdminRulesClientCreateOrUpdateOptions contains the optional parameters for the AdminRulesClient.CreateOrUpdate -// method. -func (client *AdminRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, ruleName string, adminRule BaseAdminRuleClassification, options *AdminRulesClientCreateOrUpdateOptions) (AdminRulesClientCreateOrUpdateResponse, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, adminRule, options) - if err != nil { - return AdminRulesClientCreateOrUpdateResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return AdminRulesClientCreateOrUpdateResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return AdminRulesClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) - } - return client.createOrUpdateHandleResponse(resp) -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *AdminRulesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, ruleName string, adminRule BaseAdminRuleClassification, options *AdminRulesClientCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}/rules/{ruleName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkManagerName == "" { - return nil, errors.New("parameter networkManagerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) - if configurationName == "" { - return nil, errors.New("parameter configurationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{configurationName}", url.PathEscape(configurationName)) - if ruleCollectionName == "" { - return nil, errors.New("parameter ruleCollectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{ruleCollectionName}", url.PathEscape(ruleCollectionName)) - if ruleName == "" { - return nil, errors.New("parameter ruleName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{ruleName}", url.PathEscape(ruleName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, adminRule) -} - -// createOrUpdateHandleResponse handles the CreateOrUpdate response. -func (client *AdminRulesClient) createOrUpdateHandleResponse(resp *http.Response) (AdminRulesClientCreateOrUpdateResponse, error) { - result := AdminRulesClientCreateOrUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result); err != nil { - return AdminRulesClientCreateOrUpdateResponse{}, err - } - return result, nil -} - -// BeginDelete - Deletes an admin rule. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkManagerName - The name of the network manager. -// configurationName - The name of the network manager Security Configuration. -// ruleCollectionName - The name of the network manager security Configuration rule collection. -// ruleName - The name of the rule. -// options - AdminRulesClientBeginDeleteOptions contains the optional parameters for the AdminRulesClient.BeginDelete method. -func (client *AdminRulesClient) BeginDelete(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, ruleName string, options *AdminRulesClientBeginDeleteOptions) (*runtime.Poller[AdminRulesClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[AdminRulesClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[AdminRulesClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes an admin rule. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *AdminRulesClient) deleteOperation(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, ruleName string, options *AdminRulesClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *AdminRulesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, ruleName string, options *AdminRulesClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}/rules/{ruleName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkManagerName == "" { - return nil, errors.New("parameter networkManagerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) - if configurationName == "" { - return nil, errors.New("parameter configurationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{configurationName}", url.PathEscape(configurationName)) - if ruleCollectionName == "" { - return nil, errors.New("parameter ruleCollectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{ruleCollectionName}", url.PathEscape(ruleCollectionName)) - if ruleName == "" { - return nil, errors.New("parameter ruleName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{ruleName}", url.PathEscape(ruleName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - if options != nil && options.Force != nil { - reqQP.Set("force", strconv.FormatBool(*options.Force)) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets a network manager security configuration admin rule. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkManagerName - The name of the network manager. -// configurationName - The name of the network manager Security Configuration. -// ruleCollectionName - The name of the network manager security Configuration rule collection. -// ruleName - The name of the rule. -// options - AdminRulesClientGetOptions contains the optional parameters for the AdminRulesClient.Get method. -func (client *AdminRulesClient) Get(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, ruleName string, options *AdminRulesClientGetOptions) (AdminRulesClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, options) - if err != nil { - return AdminRulesClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return AdminRulesClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AdminRulesClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *AdminRulesClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, ruleName string, options *AdminRulesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}/rules/{ruleName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkManagerName == "" { - return nil, errors.New("parameter networkManagerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) - if configurationName == "" { - return nil, errors.New("parameter configurationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{configurationName}", url.PathEscape(configurationName)) - if ruleCollectionName == "" { - return nil, errors.New("parameter ruleCollectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{ruleCollectionName}", url.PathEscape(ruleCollectionName)) - if ruleName == "" { - return nil, errors.New("parameter ruleName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{ruleName}", url.PathEscape(ruleName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *AdminRulesClient) getHandleResponse(resp *http.Response) (AdminRulesClientGetResponse, error) { - result := AdminRulesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result); err != nil { - return AdminRulesClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - List all network manager security configuration admin rules. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkManagerName - The name of the network manager. -// configurationName - The name of the network manager Security Configuration. -// ruleCollectionName - The name of the network manager security Configuration rule collection. -// options - AdminRulesClientListOptions contains the optional parameters for the AdminRulesClient.List method. -func (client *AdminRulesClient) NewListPager(resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, options *AdminRulesClientListOptions) *runtime.Pager[AdminRulesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[AdminRulesClientListResponse]{ - More: func(page AdminRulesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *AdminRulesClientListResponse) (AdminRulesClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, networkManagerName, configurationName, ruleCollectionName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return AdminRulesClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return AdminRulesClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AdminRulesClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *AdminRulesClient) listCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, options *AdminRulesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}/rules" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkManagerName == "" { - return nil, errors.New("parameter networkManagerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) - if configurationName == "" { - return nil, errors.New("parameter configurationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{configurationName}", url.PathEscape(configurationName)) - if ruleCollectionName == "" { - return nil, errors.New("parameter ruleCollectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{ruleCollectionName}", url.PathEscape(ruleCollectionName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - if options != nil && options.Top != nil { - reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) - } - if options != nil && options.SkipToken != nil { - reqQP.Set("$skipToken", *options.SkipToken) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *AdminRulesClient) listHandleResponse(resp *http.Response) (AdminRulesClientListResponse, error) { - result := AdminRulesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.AdminRuleListResult); err != nil { - return AdminRulesClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/applicationgatewayprivateendpointconnections_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/applicationgatewayprivateendpointconnections_client.go deleted file mode 100644 index 7904f565..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/applicationgatewayprivateendpointconnections_client.go +++ /dev/null @@ -1,330 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// ApplicationGatewayPrivateEndpointConnectionsClient contains the methods for the ApplicationGatewayPrivateEndpointConnections group. -// Don't use this type directly, use NewApplicationGatewayPrivateEndpointConnectionsClient() instead. -type ApplicationGatewayPrivateEndpointConnectionsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewApplicationGatewayPrivateEndpointConnectionsClient creates a new instance of ApplicationGatewayPrivateEndpointConnectionsClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewApplicationGatewayPrivateEndpointConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ApplicationGatewayPrivateEndpointConnectionsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &ApplicationGatewayPrivateEndpointConnectionsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginDelete - Deletes the specified private endpoint connection on application gateway. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// applicationGatewayName - The name of the application gateway. -// connectionName - The name of the application gateway private endpoint connection. -// options - ApplicationGatewayPrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the -// ApplicationGatewayPrivateEndpointConnectionsClient.BeginDelete method. -func (client *ApplicationGatewayPrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, resourceGroupName string, applicationGatewayName string, connectionName string, options *ApplicationGatewayPrivateEndpointConnectionsClientBeginDeleteOptions) (*runtime.Poller[ApplicationGatewayPrivateEndpointConnectionsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, applicationGatewayName, connectionName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ApplicationGatewayPrivateEndpointConnectionsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[ApplicationGatewayPrivateEndpointConnectionsClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes the specified private endpoint connection on application gateway. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *ApplicationGatewayPrivateEndpointConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, applicationGatewayName string, connectionName string, options *ApplicationGatewayPrivateEndpointConnectionsClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, applicationGatewayName, connectionName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *ApplicationGatewayPrivateEndpointConnectionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, applicationGatewayName string, connectionName string, options *ApplicationGatewayPrivateEndpointConnectionsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/privateEndpointConnections/{connectionName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if applicationGatewayName == "" { - return nil, errors.New("parameter applicationGatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{applicationGatewayName}", url.PathEscape(applicationGatewayName)) - if connectionName == "" { - return nil, errors.New("parameter connectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets the specified private endpoint connection on application gateway. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// applicationGatewayName - The name of the application gateway. -// connectionName - The name of the application gateway private endpoint connection. -// options - ApplicationGatewayPrivateEndpointConnectionsClientGetOptions contains the optional parameters for the ApplicationGatewayPrivateEndpointConnectionsClient.Get -// method. -func (client *ApplicationGatewayPrivateEndpointConnectionsClient) Get(ctx context.Context, resourceGroupName string, applicationGatewayName string, connectionName string, options *ApplicationGatewayPrivateEndpointConnectionsClientGetOptions) (ApplicationGatewayPrivateEndpointConnectionsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, applicationGatewayName, connectionName, options) - if err != nil { - return ApplicationGatewayPrivateEndpointConnectionsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ApplicationGatewayPrivateEndpointConnectionsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ApplicationGatewayPrivateEndpointConnectionsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *ApplicationGatewayPrivateEndpointConnectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, applicationGatewayName string, connectionName string, options *ApplicationGatewayPrivateEndpointConnectionsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/privateEndpointConnections/{connectionName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if applicationGatewayName == "" { - return nil, errors.New("parameter applicationGatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{applicationGatewayName}", url.PathEscape(applicationGatewayName)) - if connectionName == "" { - return nil, errors.New("parameter connectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *ApplicationGatewayPrivateEndpointConnectionsClient) getHandleResponse(resp *http.Response) (ApplicationGatewayPrivateEndpointConnectionsClientGetResponse, error) { - result := ApplicationGatewayPrivateEndpointConnectionsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ApplicationGatewayPrivateEndpointConnection); err != nil { - return ApplicationGatewayPrivateEndpointConnectionsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Lists all private endpoint connections on an application gateway. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// applicationGatewayName - The name of the application gateway. -// options - ApplicationGatewayPrivateEndpointConnectionsClientListOptions contains the optional parameters for the ApplicationGatewayPrivateEndpointConnectionsClient.List -// method. -func (client *ApplicationGatewayPrivateEndpointConnectionsClient) NewListPager(resourceGroupName string, applicationGatewayName string, options *ApplicationGatewayPrivateEndpointConnectionsClientListOptions) *runtime.Pager[ApplicationGatewayPrivateEndpointConnectionsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[ApplicationGatewayPrivateEndpointConnectionsClientListResponse]{ - More: func(page ApplicationGatewayPrivateEndpointConnectionsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ApplicationGatewayPrivateEndpointConnectionsClientListResponse) (ApplicationGatewayPrivateEndpointConnectionsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, applicationGatewayName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return ApplicationGatewayPrivateEndpointConnectionsClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ApplicationGatewayPrivateEndpointConnectionsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ApplicationGatewayPrivateEndpointConnectionsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *ApplicationGatewayPrivateEndpointConnectionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, applicationGatewayName string, options *ApplicationGatewayPrivateEndpointConnectionsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/privateEndpointConnections" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if applicationGatewayName == "" { - return nil, errors.New("parameter applicationGatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{applicationGatewayName}", url.PathEscape(applicationGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *ApplicationGatewayPrivateEndpointConnectionsClient) listHandleResponse(resp *http.Response) (ApplicationGatewayPrivateEndpointConnectionsClientListResponse, error) { - result := ApplicationGatewayPrivateEndpointConnectionsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ApplicationGatewayPrivateEndpointConnectionListResult); err != nil { - return ApplicationGatewayPrivateEndpointConnectionsClientListResponse{}, err - } - return result, nil -} - -// BeginUpdate - Updates the specified private endpoint connection on application gateway. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// applicationGatewayName - The name of the application gateway. -// connectionName - The name of the application gateway private endpoint connection. -// parameters - Parameters supplied to update application gateway private endpoint connection operation. -// options - ApplicationGatewayPrivateEndpointConnectionsClientBeginUpdateOptions contains the optional parameters for the -// ApplicationGatewayPrivateEndpointConnectionsClient.BeginUpdate method. -func (client *ApplicationGatewayPrivateEndpointConnectionsClient) BeginUpdate(ctx context.Context, resourceGroupName string, applicationGatewayName string, connectionName string, parameters ApplicationGatewayPrivateEndpointConnection, options *ApplicationGatewayPrivateEndpointConnectionsClientBeginUpdateOptions) (*runtime.Poller[ApplicationGatewayPrivateEndpointConnectionsClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, applicationGatewayName, connectionName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ApplicationGatewayPrivateEndpointConnectionsClientUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[ApplicationGatewayPrivateEndpointConnectionsClientUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// Update - Updates the specified private endpoint connection on application gateway. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *ApplicationGatewayPrivateEndpointConnectionsClient) update(ctx context.Context, resourceGroupName string, applicationGatewayName string, connectionName string, parameters ApplicationGatewayPrivateEndpointConnection, options *ApplicationGatewayPrivateEndpointConnectionsClientBeginUpdateOptions) (*http.Response, error) { - req, err := client.updateCreateRequest(ctx, resourceGroupName, applicationGatewayName, connectionName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// updateCreateRequest creates the Update request. -func (client *ApplicationGatewayPrivateEndpointConnectionsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, applicationGatewayName string, connectionName string, parameters ApplicationGatewayPrivateEndpointConnection, options *ApplicationGatewayPrivateEndpointConnectionsClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/privateEndpointConnections/{connectionName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if applicationGatewayName == "" { - return nil, errors.New("parameter applicationGatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{applicationGatewayName}", url.PathEscape(applicationGatewayName)) - if connectionName == "" { - return nil, errors.New("parameter connectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/applicationgatewayprivatelinkresources_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/applicationgatewayprivatelinkresources_client.go deleted file mode 100644 index a64ce25f..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/applicationgatewayprivatelinkresources_client.go +++ /dev/null @@ -1,127 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// ApplicationGatewayPrivateLinkResourcesClient contains the methods for the ApplicationGatewayPrivateLinkResources group. -// Don't use this type directly, use NewApplicationGatewayPrivateLinkResourcesClient() instead. -type ApplicationGatewayPrivateLinkResourcesClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewApplicationGatewayPrivateLinkResourcesClient creates a new instance of ApplicationGatewayPrivateLinkResourcesClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewApplicationGatewayPrivateLinkResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ApplicationGatewayPrivateLinkResourcesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &ApplicationGatewayPrivateLinkResourcesClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// NewListPager - Lists all private link resources on an application gateway. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// applicationGatewayName - The name of the application gateway. -// options - ApplicationGatewayPrivateLinkResourcesClientListOptions contains the optional parameters for the ApplicationGatewayPrivateLinkResourcesClient.List -// method. -func (client *ApplicationGatewayPrivateLinkResourcesClient) NewListPager(resourceGroupName string, applicationGatewayName string, options *ApplicationGatewayPrivateLinkResourcesClientListOptions) *runtime.Pager[ApplicationGatewayPrivateLinkResourcesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[ApplicationGatewayPrivateLinkResourcesClientListResponse]{ - More: func(page ApplicationGatewayPrivateLinkResourcesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ApplicationGatewayPrivateLinkResourcesClientListResponse) (ApplicationGatewayPrivateLinkResourcesClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, applicationGatewayName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return ApplicationGatewayPrivateLinkResourcesClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ApplicationGatewayPrivateLinkResourcesClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ApplicationGatewayPrivateLinkResourcesClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *ApplicationGatewayPrivateLinkResourcesClient) listCreateRequest(ctx context.Context, resourceGroupName string, applicationGatewayName string, options *ApplicationGatewayPrivateLinkResourcesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/privateLinkResources" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if applicationGatewayName == "" { - return nil, errors.New("parameter applicationGatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{applicationGatewayName}", url.PathEscape(applicationGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *ApplicationGatewayPrivateLinkResourcesClient) listHandleResponse(resp *http.Response) (ApplicationGatewayPrivateLinkResourcesClientListResponse, error) { - result := ApplicationGatewayPrivateLinkResourcesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ApplicationGatewayPrivateLinkResourceListResult); err != nil { - return ApplicationGatewayPrivateLinkResourcesClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/applicationgateways_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/applicationgateways_client.go deleted file mode 100644 index 464b5ffd..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/applicationgateways_client.go +++ /dev/null @@ -1,1043 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// ApplicationGatewaysClient contains the methods for the ApplicationGateways group. -// Don't use this type directly, use NewApplicationGatewaysClient() instead. -type ApplicationGatewaysClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewApplicationGatewaysClient creates a new instance of ApplicationGatewaysClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewApplicationGatewaysClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ApplicationGatewaysClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &ApplicationGatewaysClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginBackendHealth - Gets the backend health of the specified application gateway in a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// applicationGatewayName - The name of the application gateway. -// options - ApplicationGatewaysClientBeginBackendHealthOptions contains the optional parameters for the ApplicationGatewaysClient.BeginBackendHealth -// method. -func (client *ApplicationGatewaysClient) BeginBackendHealth(ctx context.Context, resourceGroupName string, applicationGatewayName string, options *ApplicationGatewaysClientBeginBackendHealthOptions) (*runtime.Poller[ApplicationGatewaysClientBackendHealthResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.backendHealth(ctx, resourceGroupName, applicationGatewayName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ApplicationGatewaysClientBackendHealthResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[ApplicationGatewaysClientBackendHealthResponse](options.ResumeToken, client.pl, nil) - } -} - -// BackendHealth - Gets the backend health of the specified application gateway in a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *ApplicationGatewaysClient) backendHealth(ctx context.Context, resourceGroupName string, applicationGatewayName string, options *ApplicationGatewaysClientBeginBackendHealthOptions) (*http.Response, error) { - req, err := client.backendHealthCreateRequest(ctx, resourceGroupName, applicationGatewayName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// backendHealthCreateRequest creates the BackendHealth request. -func (client *ApplicationGatewaysClient) backendHealthCreateRequest(ctx context.Context, resourceGroupName string, applicationGatewayName string, options *ApplicationGatewaysClientBeginBackendHealthOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendhealth" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if applicationGatewayName == "" { - return nil, errors.New("parameter applicationGatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{applicationGatewayName}", url.PathEscape(applicationGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginBackendHealthOnDemand - Gets the backend health for given combination of backend pool and http setting of the specified -// application gateway in a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// applicationGatewayName - The name of the application gateway. -// probeRequest - Request body for on-demand test probe operation. -// options - ApplicationGatewaysClientBeginBackendHealthOnDemandOptions contains the optional parameters for the ApplicationGatewaysClient.BeginBackendHealthOnDemand -// method. -func (client *ApplicationGatewaysClient) BeginBackendHealthOnDemand(ctx context.Context, resourceGroupName string, applicationGatewayName string, probeRequest ApplicationGatewayOnDemandProbe, options *ApplicationGatewaysClientBeginBackendHealthOnDemandOptions) (*runtime.Poller[ApplicationGatewaysClientBackendHealthOnDemandResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.backendHealthOnDemand(ctx, resourceGroupName, applicationGatewayName, probeRequest, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ApplicationGatewaysClientBackendHealthOnDemandResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[ApplicationGatewaysClientBackendHealthOnDemandResponse](options.ResumeToken, client.pl, nil) - } -} - -// BackendHealthOnDemand - Gets the backend health for given combination of backend pool and http setting of the specified -// application gateway in a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *ApplicationGatewaysClient) backendHealthOnDemand(ctx context.Context, resourceGroupName string, applicationGatewayName string, probeRequest ApplicationGatewayOnDemandProbe, options *ApplicationGatewaysClientBeginBackendHealthOnDemandOptions) (*http.Response, error) { - req, err := client.backendHealthOnDemandCreateRequest(ctx, resourceGroupName, applicationGatewayName, probeRequest, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// backendHealthOnDemandCreateRequest creates the BackendHealthOnDemand request. -func (client *ApplicationGatewaysClient) backendHealthOnDemandCreateRequest(ctx context.Context, resourceGroupName string, applicationGatewayName string, probeRequest ApplicationGatewayOnDemandProbe, options *ApplicationGatewaysClientBeginBackendHealthOnDemandOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/getBackendHealthOnDemand" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if applicationGatewayName == "" { - return nil, errors.New("parameter applicationGatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{applicationGatewayName}", url.PathEscape(applicationGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, probeRequest) -} - -// BeginCreateOrUpdate - Creates or updates the specified application gateway. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// applicationGatewayName - The name of the application gateway. -// parameters - Parameters supplied to the create or update application gateway operation. -// options - ApplicationGatewaysClientBeginCreateOrUpdateOptions contains the optional parameters for the ApplicationGatewaysClient.BeginCreateOrUpdate -// method. -func (client *ApplicationGatewaysClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, applicationGatewayName string, parameters ApplicationGateway, options *ApplicationGatewaysClientBeginCreateOrUpdateOptions) (*runtime.Poller[ApplicationGatewaysClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, applicationGatewayName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ApplicationGatewaysClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[ApplicationGatewaysClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates or updates the specified application gateway. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *ApplicationGatewaysClient) createOrUpdate(ctx context.Context, resourceGroupName string, applicationGatewayName string, parameters ApplicationGateway, options *ApplicationGatewaysClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, applicationGatewayName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ApplicationGatewaysClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, applicationGatewayName string, parameters ApplicationGateway, options *ApplicationGatewaysClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if applicationGatewayName == "" { - return nil, errors.New("parameter applicationGatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{applicationGatewayName}", url.PathEscape(applicationGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginDelete - Deletes the specified application gateway. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// applicationGatewayName - The name of the application gateway. -// options - ApplicationGatewaysClientBeginDeleteOptions contains the optional parameters for the ApplicationGatewaysClient.BeginDelete -// method. -func (client *ApplicationGatewaysClient) BeginDelete(ctx context.Context, resourceGroupName string, applicationGatewayName string, options *ApplicationGatewaysClientBeginDeleteOptions) (*runtime.Poller[ApplicationGatewaysClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, applicationGatewayName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ApplicationGatewaysClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[ApplicationGatewaysClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes the specified application gateway. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *ApplicationGatewaysClient) deleteOperation(ctx context.Context, resourceGroupName string, applicationGatewayName string, options *ApplicationGatewaysClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, applicationGatewayName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *ApplicationGatewaysClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, applicationGatewayName string, options *ApplicationGatewaysClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if applicationGatewayName == "" { - return nil, errors.New("parameter applicationGatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{applicationGatewayName}", url.PathEscape(applicationGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets the specified application gateway. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// applicationGatewayName - The name of the application gateway. -// options - ApplicationGatewaysClientGetOptions contains the optional parameters for the ApplicationGatewaysClient.Get method. -func (client *ApplicationGatewaysClient) Get(ctx context.Context, resourceGroupName string, applicationGatewayName string, options *ApplicationGatewaysClientGetOptions) (ApplicationGatewaysClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, applicationGatewayName, options) - if err != nil { - return ApplicationGatewaysClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ApplicationGatewaysClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ApplicationGatewaysClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *ApplicationGatewaysClient) getCreateRequest(ctx context.Context, resourceGroupName string, applicationGatewayName string, options *ApplicationGatewaysClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if applicationGatewayName == "" { - return nil, errors.New("parameter applicationGatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{applicationGatewayName}", url.PathEscape(applicationGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *ApplicationGatewaysClient) getHandleResponse(resp *http.Response) (ApplicationGatewaysClientGetResponse, error) { - result := ApplicationGatewaysClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ApplicationGateway); err != nil { - return ApplicationGatewaysClientGetResponse{}, err - } - return result, nil -} - -// GetSSLPredefinedPolicy - Gets Ssl predefined policy with the specified policy name. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// predefinedPolicyName - Name of Ssl predefined policy. -// options - ApplicationGatewaysClientGetSSLPredefinedPolicyOptions contains the optional parameters for the ApplicationGatewaysClient.GetSSLPredefinedPolicy -// method. -func (client *ApplicationGatewaysClient) GetSSLPredefinedPolicy(ctx context.Context, predefinedPolicyName string, options *ApplicationGatewaysClientGetSSLPredefinedPolicyOptions) (ApplicationGatewaysClientGetSSLPredefinedPolicyResponse, error) { - req, err := client.getSSLPredefinedPolicyCreateRequest(ctx, predefinedPolicyName, options) - if err != nil { - return ApplicationGatewaysClientGetSSLPredefinedPolicyResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ApplicationGatewaysClientGetSSLPredefinedPolicyResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ApplicationGatewaysClientGetSSLPredefinedPolicyResponse{}, runtime.NewResponseError(resp) - } - return client.getSSLPredefinedPolicyHandleResponse(resp) -} - -// getSSLPredefinedPolicyCreateRequest creates the GetSSLPredefinedPolicy request. -func (client *ApplicationGatewaysClient) getSSLPredefinedPolicyCreateRequest(ctx context.Context, predefinedPolicyName string, options *ApplicationGatewaysClientGetSSLPredefinedPolicyOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies/{predefinedPolicyName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if predefinedPolicyName == "" { - return nil, errors.New("parameter predefinedPolicyName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{predefinedPolicyName}", url.PathEscape(predefinedPolicyName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getSSLPredefinedPolicyHandleResponse handles the GetSSLPredefinedPolicy response. -func (client *ApplicationGatewaysClient) getSSLPredefinedPolicyHandleResponse(resp *http.Response) (ApplicationGatewaysClientGetSSLPredefinedPolicyResponse, error) { - result := ApplicationGatewaysClientGetSSLPredefinedPolicyResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ApplicationGatewaySSLPredefinedPolicy); err != nil { - return ApplicationGatewaysClientGetSSLPredefinedPolicyResponse{}, err - } - return result, nil -} - -// NewListPager - Lists all application gateways in a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// options - ApplicationGatewaysClientListOptions contains the optional parameters for the ApplicationGatewaysClient.List -// method. -func (client *ApplicationGatewaysClient) NewListPager(resourceGroupName string, options *ApplicationGatewaysClientListOptions) *runtime.Pager[ApplicationGatewaysClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[ApplicationGatewaysClientListResponse]{ - More: func(page ApplicationGatewaysClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ApplicationGatewaysClientListResponse) (ApplicationGatewaysClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return ApplicationGatewaysClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ApplicationGatewaysClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ApplicationGatewaysClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *ApplicationGatewaysClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *ApplicationGatewaysClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *ApplicationGatewaysClient) listHandleResponse(resp *http.Response) (ApplicationGatewaysClientListResponse, error) { - result := ApplicationGatewaysClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ApplicationGatewayListResult); err != nil { - return ApplicationGatewaysClientListResponse{}, err - } - return result, nil -} - -// NewListAllPager - Gets all the application gateways in a subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// options - ApplicationGatewaysClientListAllOptions contains the optional parameters for the ApplicationGatewaysClient.ListAll -// method. -func (client *ApplicationGatewaysClient) NewListAllPager(options *ApplicationGatewaysClientListAllOptions) *runtime.Pager[ApplicationGatewaysClientListAllResponse] { - return runtime.NewPager(runtime.PagingHandler[ApplicationGatewaysClientListAllResponse]{ - More: func(page ApplicationGatewaysClientListAllResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ApplicationGatewaysClientListAllResponse) (ApplicationGatewaysClientListAllResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listAllCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return ApplicationGatewaysClientListAllResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ApplicationGatewaysClientListAllResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ApplicationGatewaysClientListAllResponse{}, runtime.NewResponseError(resp) - } - return client.listAllHandleResponse(resp) - }, - }) -} - -// listAllCreateRequest creates the ListAll request. -func (client *ApplicationGatewaysClient) listAllCreateRequest(ctx context.Context, options *ApplicationGatewaysClientListAllOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGateways" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listAllHandleResponse handles the ListAll response. -func (client *ApplicationGatewaysClient) listAllHandleResponse(resp *http.Response) (ApplicationGatewaysClientListAllResponse, error) { - result := ApplicationGatewaysClientListAllResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ApplicationGatewayListResult); err != nil { - return ApplicationGatewaysClientListAllResponse{}, err - } - return result, nil -} - -// ListAvailableRequestHeaders - Lists all available request headers. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// options - ApplicationGatewaysClientListAvailableRequestHeadersOptions contains the optional parameters for the ApplicationGatewaysClient.ListAvailableRequestHeaders -// method. -func (client *ApplicationGatewaysClient) ListAvailableRequestHeaders(ctx context.Context, options *ApplicationGatewaysClientListAvailableRequestHeadersOptions) (ApplicationGatewaysClientListAvailableRequestHeadersResponse, error) { - req, err := client.listAvailableRequestHeadersCreateRequest(ctx, options) - if err != nil { - return ApplicationGatewaysClientListAvailableRequestHeadersResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ApplicationGatewaysClientListAvailableRequestHeadersResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ApplicationGatewaysClientListAvailableRequestHeadersResponse{}, runtime.NewResponseError(resp) - } - return client.listAvailableRequestHeadersHandleResponse(resp) -} - -// listAvailableRequestHeadersCreateRequest creates the ListAvailableRequestHeaders request. -func (client *ApplicationGatewaysClient) listAvailableRequestHeadersCreateRequest(ctx context.Context, options *ApplicationGatewaysClientListAvailableRequestHeadersOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableRequestHeaders" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listAvailableRequestHeadersHandleResponse handles the ListAvailableRequestHeaders response. -func (client *ApplicationGatewaysClient) listAvailableRequestHeadersHandleResponse(resp *http.Response) (ApplicationGatewaysClientListAvailableRequestHeadersResponse, error) { - result := ApplicationGatewaysClientListAvailableRequestHeadersResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.StringArray); err != nil { - return ApplicationGatewaysClientListAvailableRequestHeadersResponse{}, err - } - return result, nil -} - -// ListAvailableResponseHeaders - Lists all available response headers. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// options - ApplicationGatewaysClientListAvailableResponseHeadersOptions contains the optional parameters for the ApplicationGatewaysClient.ListAvailableResponseHeaders -// method. -func (client *ApplicationGatewaysClient) ListAvailableResponseHeaders(ctx context.Context, options *ApplicationGatewaysClientListAvailableResponseHeadersOptions) (ApplicationGatewaysClientListAvailableResponseHeadersResponse, error) { - req, err := client.listAvailableResponseHeadersCreateRequest(ctx, options) - if err != nil { - return ApplicationGatewaysClientListAvailableResponseHeadersResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ApplicationGatewaysClientListAvailableResponseHeadersResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ApplicationGatewaysClientListAvailableResponseHeadersResponse{}, runtime.NewResponseError(resp) - } - return client.listAvailableResponseHeadersHandleResponse(resp) -} - -// listAvailableResponseHeadersCreateRequest creates the ListAvailableResponseHeaders request. -func (client *ApplicationGatewaysClient) listAvailableResponseHeadersCreateRequest(ctx context.Context, options *ApplicationGatewaysClientListAvailableResponseHeadersOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableResponseHeaders" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listAvailableResponseHeadersHandleResponse handles the ListAvailableResponseHeaders response. -func (client *ApplicationGatewaysClient) listAvailableResponseHeadersHandleResponse(resp *http.Response) (ApplicationGatewaysClientListAvailableResponseHeadersResponse, error) { - result := ApplicationGatewaysClientListAvailableResponseHeadersResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.StringArray); err != nil { - return ApplicationGatewaysClientListAvailableResponseHeadersResponse{}, err - } - return result, nil -} - -// ListAvailableSSLOptions - Lists available Ssl options for configuring Ssl policy. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// options - ApplicationGatewaysClientListAvailableSSLOptionsOptions contains the optional parameters for the ApplicationGatewaysClient.ListAvailableSSLOptions -// method. -func (client *ApplicationGatewaysClient) ListAvailableSSLOptions(ctx context.Context, options *ApplicationGatewaysClientListAvailableSSLOptionsOptions) (ApplicationGatewaysClientListAvailableSSLOptionsResponse, error) { - req, err := client.listAvailableSSLOptionsCreateRequest(ctx, options) - if err != nil { - return ApplicationGatewaysClientListAvailableSSLOptionsResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ApplicationGatewaysClientListAvailableSSLOptionsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ApplicationGatewaysClientListAvailableSSLOptionsResponse{}, runtime.NewResponseError(resp) - } - return client.listAvailableSSLOptionsHandleResponse(resp) -} - -// listAvailableSSLOptionsCreateRequest creates the ListAvailableSSLOptions request. -func (client *ApplicationGatewaysClient) listAvailableSSLOptionsCreateRequest(ctx context.Context, options *ApplicationGatewaysClientListAvailableSSLOptionsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listAvailableSSLOptionsHandleResponse handles the ListAvailableSSLOptions response. -func (client *ApplicationGatewaysClient) listAvailableSSLOptionsHandleResponse(resp *http.Response) (ApplicationGatewaysClientListAvailableSSLOptionsResponse, error) { - result := ApplicationGatewaysClientListAvailableSSLOptionsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ApplicationGatewayAvailableSSLOptions); err != nil { - return ApplicationGatewaysClientListAvailableSSLOptionsResponse{}, err - } - return result, nil -} - -// NewListAvailableSSLPredefinedPoliciesPager - Lists all SSL predefined policies for configuring Ssl policy. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// options - ApplicationGatewaysClientListAvailableSSLPredefinedPoliciesOptions contains the optional parameters for the ApplicationGatewaysClient.ListAvailableSSLPredefinedPolicies -// method. -func (client *ApplicationGatewaysClient) NewListAvailableSSLPredefinedPoliciesPager(options *ApplicationGatewaysClientListAvailableSSLPredefinedPoliciesOptions) *runtime.Pager[ApplicationGatewaysClientListAvailableSSLPredefinedPoliciesResponse] { - return runtime.NewPager(runtime.PagingHandler[ApplicationGatewaysClientListAvailableSSLPredefinedPoliciesResponse]{ - More: func(page ApplicationGatewaysClientListAvailableSSLPredefinedPoliciesResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ApplicationGatewaysClientListAvailableSSLPredefinedPoliciesResponse) (ApplicationGatewaysClientListAvailableSSLPredefinedPoliciesResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listAvailableSSLPredefinedPoliciesCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return ApplicationGatewaysClientListAvailableSSLPredefinedPoliciesResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ApplicationGatewaysClientListAvailableSSLPredefinedPoliciesResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ApplicationGatewaysClientListAvailableSSLPredefinedPoliciesResponse{}, runtime.NewResponseError(resp) - } - return client.listAvailableSSLPredefinedPoliciesHandleResponse(resp) - }, - }) -} - -// listAvailableSSLPredefinedPoliciesCreateRequest creates the ListAvailableSSLPredefinedPolicies request. -func (client *ApplicationGatewaysClient) listAvailableSSLPredefinedPoliciesCreateRequest(ctx context.Context, options *ApplicationGatewaysClientListAvailableSSLPredefinedPoliciesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listAvailableSSLPredefinedPoliciesHandleResponse handles the ListAvailableSSLPredefinedPolicies response. -func (client *ApplicationGatewaysClient) listAvailableSSLPredefinedPoliciesHandleResponse(resp *http.Response) (ApplicationGatewaysClientListAvailableSSLPredefinedPoliciesResponse, error) { - result := ApplicationGatewaysClientListAvailableSSLPredefinedPoliciesResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ApplicationGatewayAvailableSSLPredefinedPolicies); err != nil { - return ApplicationGatewaysClientListAvailableSSLPredefinedPoliciesResponse{}, err - } - return result, nil -} - -// ListAvailableServerVariables - Lists all available server variables. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// options - ApplicationGatewaysClientListAvailableServerVariablesOptions contains the optional parameters for the ApplicationGatewaysClient.ListAvailableServerVariables -// method. -func (client *ApplicationGatewaysClient) ListAvailableServerVariables(ctx context.Context, options *ApplicationGatewaysClientListAvailableServerVariablesOptions) (ApplicationGatewaysClientListAvailableServerVariablesResponse, error) { - req, err := client.listAvailableServerVariablesCreateRequest(ctx, options) - if err != nil { - return ApplicationGatewaysClientListAvailableServerVariablesResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ApplicationGatewaysClientListAvailableServerVariablesResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ApplicationGatewaysClientListAvailableServerVariablesResponse{}, runtime.NewResponseError(resp) - } - return client.listAvailableServerVariablesHandleResponse(resp) -} - -// listAvailableServerVariablesCreateRequest creates the ListAvailableServerVariables request. -func (client *ApplicationGatewaysClient) listAvailableServerVariablesCreateRequest(ctx context.Context, options *ApplicationGatewaysClientListAvailableServerVariablesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableServerVariables" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listAvailableServerVariablesHandleResponse handles the ListAvailableServerVariables response. -func (client *ApplicationGatewaysClient) listAvailableServerVariablesHandleResponse(resp *http.Response) (ApplicationGatewaysClientListAvailableServerVariablesResponse, error) { - result := ApplicationGatewaysClientListAvailableServerVariablesResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.StringArray); err != nil { - return ApplicationGatewaysClientListAvailableServerVariablesResponse{}, err - } - return result, nil -} - -// ListAvailableWafRuleSets - Lists all available web application firewall rule sets. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// options - ApplicationGatewaysClientListAvailableWafRuleSetsOptions contains the optional parameters for the ApplicationGatewaysClient.ListAvailableWafRuleSets -// method. -func (client *ApplicationGatewaysClient) ListAvailableWafRuleSets(ctx context.Context, options *ApplicationGatewaysClientListAvailableWafRuleSetsOptions) (ApplicationGatewaysClientListAvailableWafRuleSetsResponse, error) { - req, err := client.listAvailableWafRuleSetsCreateRequest(ctx, options) - if err != nil { - return ApplicationGatewaysClientListAvailableWafRuleSetsResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ApplicationGatewaysClientListAvailableWafRuleSetsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ApplicationGatewaysClientListAvailableWafRuleSetsResponse{}, runtime.NewResponseError(resp) - } - return client.listAvailableWafRuleSetsHandleResponse(resp) -} - -// listAvailableWafRuleSetsCreateRequest creates the ListAvailableWafRuleSets request. -func (client *ApplicationGatewaysClient) listAvailableWafRuleSetsCreateRequest(ctx context.Context, options *ApplicationGatewaysClientListAvailableWafRuleSetsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableWafRuleSets" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listAvailableWafRuleSetsHandleResponse handles the ListAvailableWafRuleSets response. -func (client *ApplicationGatewaysClient) listAvailableWafRuleSetsHandleResponse(resp *http.Response) (ApplicationGatewaysClientListAvailableWafRuleSetsResponse, error) { - result := ApplicationGatewaysClientListAvailableWafRuleSetsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ApplicationGatewayAvailableWafRuleSetsResult); err != nil { - return ApplicationGatewaysClientListAvailableWafRuleSetsResponse{}, err - } - return result, nil -} - -// BeginStart - Starts the specified application gateway. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// applicationGatewayName - The name of the application gateway. -// options - ApplicationGatewaysClientBeginStartOptions contains the optional parameters for the ApplicationGatewaysClient.BeginStart -// method. -func (client *ApplicationGatewaysClient) BeginStart(ctx context.Context, resourceGroupName string, applicationGatewayName string, options *ApplicationGatewaysClientBeginStartOptions) (*runtime.Poller[ApplicationGatewaysClientStartResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.start(ctx, resourceGroupName, applicationGatewayName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ApplicationGatewaysClientStartResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[ApplicationGatewaysClientStartResponse](options.ResumeToken, client.pl, nil) - } -} - -// Start - Starts the specified application gateway. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *ApplicationGatewaysClient) start(ctx context.Context, resourceGroupName string, applicationGatewayName string, options *ApplicationGatewaysClientBeginStartOptions) (*http.Response, error) { - req, err := client.startCreateRequest(ctx, resourceGroupName, applicationGatewayName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// startCreateRequest creates the Start request. -func (client *ApplicationGatewaysClient) startCreateRequest(ctx context.Context, resourceGroupName string, applicationGatewayName string, options *ApplicationGatewaysClientBeginStartOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/start" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if applicationGatewayName == "" { - return nil, errors.New("parameter applicationGatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{applicationGatewayName}", url.PathEscape(applicationGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginStop - Stops the specified application gateway in a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// applicationGatewayName - The name of the application gateway. -// options - ApplicationGatewaysClientBeginStopOptions contains the optional parameters for the ApplicationGatewaysClient.BeginStop -// method. -func (client *ApplicationGatewaysClient) BeginStop(ctx context.Context, resourceGroupName string, applicationGatewayName string, options *ApplicationGatewaysClientBeginStopOptions) (*runtime.Poller[ApplicationGatewaysClientStopResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.stop(ctx, resourceGroupName, applicationGatewayName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ApplicationGatewaysClientStopResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[ApplicationGatewaysClientStopResponse](options.ResumeToken, client.pl, nil) - } -} - -// Stop - Stops the specified application gateway in a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *ApplicationGatewaysClient) stop(ctx context.Context, resourceGroupName string, applicationGatewayName string, options *ApplicationGatewaysClientBeginStopOptions) (*http.Response, error) { - req, err := client.stopCreateRequest(ctx, resourceGroupName, applicationGatewayName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// stopCreateRequest creates the Stop request. -func (client *ApplicationGatewaysClient) stopCreateRequest(ctx context.Context, resourceGroupName string, applicationGatewayName string, options *ApplicationGatewaysClientBeginStopOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/stop" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if applicationGatewayName == "" { - return nil, errors.New("parameter applicationGatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{applicationGatewayName}", url.PathEscape(applicationGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// UpdateTags - Updates the specified application gateway tags. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// applicationGatewayName - The name of the application gateway. -// parameters - Parameters supplied to update application gateway tags. -// options - ApplicationGatewaysClientUpdateTagsOptions contains the optional parameters for the ApplicationGatewaysClient.UpdateTags -// method. -func (client *ApplicationGatewaysClient) UpdateTags(ctx context.Context, resourceGroupName string, applicationGatewayName string, parameters TagsObject, options *ApplicationGatewaysClientUpdateTagsOptions) (ApplicationGatewaysClientUpdateTagsResponse, error) { - req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, applicationGatewayName, parameters, options) - if err != nil { - return ApplicationGatewaysClientUpdateTagsResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ApplicationGatewaysClientUpdateTagsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ApplicationGatewaysClientUpdateTagsResponse{}, runtime.NewResponseError(resp) - } - return client.updateTagsHandleResponse(resp) -} - -// updateTagsCreateRequest creates the UpdateTags request. -func (client *ApplicationGatewaysClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, applicationGatewayName string, parameters TagsObject, options *ApplicationGatewaysClientUpdateTagsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if applicationGatewayName == "" { - return nil, errors.New("parameter applicationGatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{applicationGatewayName}", url.PathEscape(applicationGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// updateTagsHandleResponse handles the UpdateTags response. -func (client *ApplicationGatewaysClient) updateTagsHandleResponse(resp *http.Response) (ApplicationGatewaysClientUpdateTagsResponse, error) { - result := ApplicationGatewaysClientUpdateTagsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ApplicationGateway); err != nil { - return ApplicationGatewaysClientUpdateTagsResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/applicationsecuritygroups_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/applicationsecuritygroups_client.go deleted file mode 100644 index 2310e13c..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/applicationsecuritygroups_client.go +++ /dev/null @@ -1,428 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// ApplicationSecurityGroupsClient contains the methods for the ApplicationSecurityGroups group. -// Don't use this type directly, use NewApplicationSecurityGroupsClient() instead. -type ApplicationSecurityGroupsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewApplicationSecurityGroupsClient creates a new instance of ApplicationSecurityGroupsClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewApplicationSecurityGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ApplicationSecurityGroupsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &ApplicationSecurityGroupsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates an application security group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// applicationSecurityGroupName - The name of the application security group. -// parameters - Parameters supplied to the create or update ApplicationSecurityGroup operation. -// options - ApplicationSecurityGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the ApplicationSecurityGroupsClient.BeginCreateOrUpdate -// method. -func (client *ApplicationSecurityGroupsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, applicationSecurityGroupName string, parameters ApplicationSecurityGroup, options *ApplicationSecurityGroupsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ApplicationSecurityGroupsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, applicationSecurityGroupName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ApplicationSecurityGroupsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[ApplicationSecurityGroupsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates or updates an application security group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *ApplicationSecurityGroupsClient) createOrUpdate(ctx context.Context, resourceGroupName string, applicationSecurityGroupName string, parameters ApplicationSecurityGroup, options *ApplicationSecurityGroupsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, applicationSecurityGroupName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ApplicationSecurityGroupsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, applicationSecurityGroupName string, parameters ApplicationSecurityGroup, options *ApplicationSecurityGroupsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if applicationSecurityGroupName == "" { - return nil, errors.New("parameter applicationSecurityGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{applicationSecurityGroupName}", url.PathEscape(applicationSecurityGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginDelete - Deletes the specified application security group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// applicationSecurityGroupName - The name of the application security group. -// options - ApplicationSecurityGroupsClientBeginDeleteOptions contains the optional parameters for the ApplicationSecurityGroupsClient.BeginDelete -// method. -func (client *ApplicationSecurityGroupsClient) BeginDelete(ctx context.Context, resourceGroupName string, applicationSecurityGroupName string, options *ApplicationSecurityGroupsClientBeginDeleteOptions) (*runtime.Poller[ApplicationSecurityGroupsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, applicationSecurityGroupName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ApplicationSecurityGroupsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[ApplicationSecurityGroupsClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes the specified application security group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *ApplicationSecurityGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, applicationSecurityGroupName string, options *ApplicationSecurityGroupsClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, applicationSecurityGroupName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *ApplicationSecurityGroupsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, applicationSecurityGroupName string, options *ApplicationSecurityGroupsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if applicationSecurityGroupName == "" { - return nil, errors.New("parameter applicationSecurityGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{applicationSecurityGroupName}", url.PathEscape(applicationSecurityGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets information about the specified application security group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// applicationSecurityGroupName - The name of the application security group. -// options - ApplicationSecurityGroupsClientGetOptions contains the optional parameters for the ApplicationSecurityGroupsClient.Get -// method. -func (client *ApplicationSecurityGroupsClient) Get(ctx context.Context, resourceGroupName string, applicationSecurityGroupName string, options *ApplicationSecurityGroupsClientGetOptions) (ApplicationSecurityGroupsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, applicationSecurityGroupName, options) - if err != nil { - return ApplicationSecurityGroupsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ApplicationSecurityGroupsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ApplicationSecurityGroupsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *ApplicationSecurityGroupsClient) getCreateRequest(ctx context.Context, resourceGroupName string, applicationSecurityGroupName string, options *ApplicationSecurityGroupsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if applicationSecurityGroupName == "" { - return nil, errors.New("parameter applicationSecurityGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{applicationSecurityGroupName}", url.PathEscape(applicationSecurityGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *ApplicationSecurityGroupsClient) getHandleResponse(resp *http.Response) (ApplicationSecurityGroupsClientGetResponse, error) { - result := ApplicationSecurityGroupsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ApplicationSecurityGroup); err != nil { - return ApplicationSecurityGroupsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Gets all the application security groups in a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// options - ApplicationSecurityGroupsClientListOptions contains the optional parameters for the ApplicationSecurityGroupsClient.List -// method. -func (client *ApplicationSecurityGroupsClient) NewListPager(resourceGroupName string, options *ApplicationSecurityGroupsClientListOptions) *runtime.Pager[ApplicationSecurityGroupsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[ApplicationSecurityGroupsClientListResponse]{ - More: func(page ApplicationSecurityGroupsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ApplicationSecurityGroupsClientListResponse) (ApplicationSecurityGroupsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return ApplicationSecurityGroupsClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ApplicationSecurityGroupsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ApplicationSecurityGroupsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *ApplicationSecurityGroupsClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *ApplicationSecurityGroupsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *ApplicationSecurityGroupsClient) listHandleResponse(resp *http.Response) (ApplicationSecurityGroupsClientListResponse, error) { - result := ApplicationSecurityGroupsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ApplicationSecurityGroupListResult); err != nil { - return ApplicationSecurityGroupsClientListResponse{}, err - } - return result, nil -} - -// NewListAllPager - Gets all application security groups in a subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// options - ApplicationSecurityGroupsClientListAllOptions contains the optional parameters for the ApplicationSecurityGroupsClient.ListAll -// method. -func (client *ApplicationSecurityGroupsClient) NewListAllPager(options *ApplicationSecurityGroupsClientListAllOptions) *runtime.Pager[ApplicationSecurityGroupsClientListAllResponse] { - return runtime.NewPager(runtime.PagingHandler[ApplicationSecurityGroupsClientListAllResponse]{ - More: func(page ApplicationSecurityGroupsClientListAllResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ApplicationSecurityGroupsClientListAllResponse) (ApplicationSecurityGroupsClientListAllResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listAllCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return ApplicationSecurityGroupsClientListAllResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ApplicationSecurityGroupsClientListAllResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ApplicationSecurityGroupsClientListAllResponse{}, runtime.NewResponseError(resp) - } - return client.listAllHandleResponse(resp) - }, - }) -} - -// listAllCreateRequest creates the ListAll request. -func (client *ApplicationSecurityGroupsClient) listAllCreateRequest(ctx context.Context, options *ApplicationSecurityGroupsClientListAllOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationSecurityGroups" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listAllHandleResponse handles the ListAll response. -func (client *ApplicationSecurityGroupsClient) listAllHandleResponse(resp *http.Response) (ApplicationSecurityGroupsClientListAllResponse, error) { - result := ApplicationSecurityGroupsClientListAllResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ApplicationSecurityGroupListResult); err != nil { - return ApplicationSecurityGroupsClientListAllResponse{}, err - } - return result, nil -} - -// UpdateTags - Updates an application security group's tags. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// applicationSecurityGroupName - The name of the application security group. -// parameters - Parameters supplied to update application security group tags. -// options - ApplicationSecurityGroupsClientUpdateTagsOptions contains the optional parameters for the ApplicationSecurityGroupsClient.UpdateTags -// method. -func (client *ApplicationSecurityGroupsClient) UpdateTags(ctx context.Context, resourceGroupName string, applicationSecurityGroupName string, parameters TagsObject, options *ApplicationSecurityGroupsClientUpdateTagsOptions) (ApplicationSecurityGroupsClientUpdateTagsResponse, error) { - req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, applicationSecurityGroupName, parameters, options) - if err != nil { - return ApplicationSecurityGroupsClientUpdateTagsResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ApplicationSecurityGroupsClientUpdateTagsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ApplicationSecurityGroupsClientUpdateTagsResponse{}, runtime.NewResponseError(resp) - } - return client.updateTagsHandleResponse(resp) -} - -// updateTagsCreateRequest creates the UpdateTags request. -func (client *ApplicationSecurityGroupsClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, applicationSecurityGroupName string, parameters TagsObject, options *ApplicationSecurityGroupsClientUpdateTagsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if applicationSecurityGroupName == "" { - return nil, errors.New("parameter applicationSecurityGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{applicationSecurityGroupName}", url.PathEscape(applicationSecurityGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// updateTagsHandleResponse handles the UpdateTags response. -func (client *ApplicationSecurityGroupsClient) updateTagsHandleResponse(resp *http.Response) (ApplicationSecurityGroupsClientUpdateTagsResponse, error) { - result := ApplicationSecurityGroupsClientUpdateTagsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ApplicationSecurityGroup); err != nil { - return ApplicationSecurityGroupsClientUpdateTagsResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/autorest.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/autorest.md deleted file mode 100644 index dadc1000..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/autorest.md +++ /dev/null @@ -1,12 +0,0 @@ -### AutoRest Configuration - -> see https://aka.ms/autorest - -``` yaml -azure-arm: true -require: -- https://github.com/Azure/azure-rest-api-specs/blob/2feaf7f24cc26a7274c9fd79015ae62b1d273986/specification/network/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/2feaf7f24cc26a7274c9fd79015ae62b1d273986/specification/network/resource-manager/readme.go.md -license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.1.0 -``` \ No newline at end of file diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/availabledelegations_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/availabledelegations_client.go deleted file mode 100644 index 5b757f20..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/availabledelegations_client.go +++ /dev/null @@ -1,122 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// AvailableDelegationsClient contains the methods for the AvailableDelegations group. -// Don't use this type directly, use NewAvailableDelegationsClient() instead. -type AvailableDelegationsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewAvailableDelegationsClient creates a new instance of AvailableDelegationsClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewAvailableDelegationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AvailableDelegationsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &AvailableDelegationsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// NewListPager - Gets all of the available subnet delegations for this subscription in this region. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// location - The location of the subnet. -// options - AvailableDelegationsClientListOptions contains the optional parameters for the AvailableDelegationsClient.List -// method. -func (client *AvailableDelegationsClient) NewListPager(location string, options *AvailableDelegationsClientListOptions) *runtime.Pager[AvailableDelegationsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[AvailableDelegationsClientListResponse]{ - More: func(page AvailableDelegationsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *AvailableDelegationsClientListResponse) (AvailableDelegationsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, location, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return AvailableDelegationsClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return AvailableDelegationsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AvailableDelegationsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *AvailableDelegationsClient) listCreateRequest(ctx context.Context, location string, options *AvailableDelegationsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/availableDelegations" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *AvailableDelegationsClient) listHandleResponse(resp *http.Response) (AvailableDelegationsClientListResponse, error) { - result := AvailableDelegationsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.AvailableDelegationsResult); err != nil { - return AvailableDelegationsClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/availableendpointservices_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/availableendpointservices_client.go deleted file mode 100644 index 8505fbbd..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/availableendpointservices_client.go +++ /dev/null @@ -1,122 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// AvailableEndpointServicesClient contains the methods for the AvailableEndpointServices group. -// Don't use this type directly, use NewAvailableEndpointServicesClient() instead. -type AvailableEndpointServicesClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewAvailableEndpointServicesClient creates a new instance of AvailableEndpointServicesClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewAvailableEndpointServicesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AvailableEndpointServicesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &AvailableEndpointServicesClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// NewListPager - List what values of endpoint services are available for use. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// location - The location to check available endpoint services. -// options - AvailableEndpointServicesClientListOptions contains the optional parameters for the AvailableEndpointServicesClient.List -// method. -func (client *AvailableEndpointServicesClient) NewListPager(location string, options *AvailableEndpointServicesClientListOptions) *runtime.Pager[AvailableEndpointServicesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[AvailableEndpointServicesClientListResponse]{ - More: func(page AvailableEndpointServicesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *AvailableEndpointServicesClientListResponse) (AvailableEndpointServicesClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, location, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return AvailableEndpointServicesClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return AvailableEndpointServicesClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AvailableEndpointServicesClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *AvailableEndpointServicesClient) listCreateRequest(ctx context.Context, location string, options *AvailableEndpointServicesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/virtualNetworkAvailableEndpointServices" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *AvailableEndpointServicesClient) listHandleResponse(resp *http.Response) (AvailableEndpointServicesClientListResponse, error) { - result := AvailableEndpointServicesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.EndpointServicesListResult); err != nil { - return AvailableEndpointServicesClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/availableprivateendpointtypes_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/availableprivateendpointtypes_client.go deleted file mode 100644 index fc500d41..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/availableprivateendpointtypes_client.go +++ /dev/null @@ -1,194 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// AvailablePrivateEndpointTypesClient contains the methods for the AvailablePrivateEndpointTypes group. -// Don't use this type directly, use NewAvailablePrivateEndpointTypesClient() instead. -type AvailablePrivateEndpointTypesClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewAvailablePrivateEndpointTypesClient creates a new instance of AvailablePrivateEndpointTypesClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewAvailablePrivateEndpointTypesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AvailablePrivateEndpointTypesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &AvailablePrivateEndpointTypesClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// NewListPager - Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this -// region. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// location - The location of the domain name. -// options - AvailablePrivateEndpointTypesClientListOptions contains the optional parameters for the AvailablePrivateEndpointTypesClient.List -// method. -func (client *AvailablePrivateEndpointTypesClient) NewListPager(location string, options *AvailablePrivateEndpointTypesClientListOptions) *runtime.Pager[AvailablePrivateEndpointTypesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[AvailablePrivateEndpointTypesClientListResponse]{ - More: func(page AvailablePrivateEndpointTypesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *AvailablePrivateEndpointTypesClientListResponse) (AvailablePrivateEndpointTypesClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, location, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return AvailablePrivateEndpointTypesClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return AvailablePrivateEndpointTypesClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AvailablePrivateEndpointTypesClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *AvailablePrivateEndpointTypesClient) listCreateRequest(ctx context.Context, location string, options *AvailablePrivateEndpointTypesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/availablePrivateEndpointTypes" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *AvailablePrivateEndpointTypesClient) listHandleResponse(resp *http.Response) (AvailablePrivateEndpointTypesClientListResponse, error) { - result := AvailablePrivateEndpointTypesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.AvailablePrivateEndpointTypesResult); err != nil { - return AvailablePrivateEndpointTypesClientListResponse{}, err - } - return result, nil -} - -// NewListByResourceGroupPager - Returns all of the resource types that can be linked to a Private Endpoint in this subscription -// in this region. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// location - The location of the domain name. -// resourceGroupName - The name of the resource group. -// options - AvailablePrivateEndpointTypesClientListByResourceGroupOptions contains the optional parameters for the AvailablePrivateEndpointTypesClient.ListByResourceGroup -// method. -func (client *AvailablePrivateEndpointTypesClient) NewListByResourceGroupPager(location string, resourceGroupName string, options *AvailablePrivateEndpointTypesClientListByResourceGroupOptions) *runtime.Pager[AvailablePrivateEndpointTypesClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[AvailablePrivateEndpointTypesClientListByResourceGroupResponse]{ - More: func(page AvailablePrivateEndpointTypesClientListByResourceGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *AvailablePrivateEndpointTypesClientListByResourceGroupResponse) (AvailablePrivateEndpointTypesClientListByResourceGroupResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByResourceGroupCreateRequest(ctx, location, resourceGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return AvailablePrivateEndpointTypesClientListByResourceGroupResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return AvailablePrivateEndpointTypesClientListByResourceGroupResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AvailablePrivateEndpointTypesClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) - } - return client.listByResourceGroupHandleResponse(resp) - }, - }) -} - -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *AvailablePrivateEndpointTypesClient) listByResourceGroupCreateRequest(ctx context.Context, location string, resourceGroupName string, options *AvailablePrivateEndpointTypesClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/availablePrivateEndpointTypes" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *AvailablePrivateEndpointTypesClient) listByResourceGroupHandleResponse(resp *http.Response) (AvailablePrivateEndpointTypesClientListByResourceGroupResponse, error) { - result := AvailablePrivateEndpointTypesClientListByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.AvailablePrivateEndpointTypesResult); err != nil { - return AvailablePrivateEndpointTypesClientListByResourceGroupResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/availableresourcegroupdelegations_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/availableresourcegroupdelegations_client.go deleted file mode 100644 index 56f813c9..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/availableresourcegroupdelegations_client.go +++ /dev/null @@ -1,127 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// AvailableResourceGroupDelegationsClient contains the methods for the AvailableResourceGroupDelegations group. -// Don't use this type directly, use NewAvailableResourceGroupDelegationsClient() instead. -type AvailableResourceGroupDelegationsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewAvailableResourceGroupDelegationsClient creates a new instance of AvailableResourceGroupDelegationsClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewAvailableResourceGroupDelegationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AvailableResourceGroupDelegationsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &AvailableResourceGroupDelegationsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// NewListPager - Gets all of the available subnet delegations for this resource group in this region. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// location - The location of the domain name. -// resourceGroupName - The name of the resource group. -// options - AvailableResourceGroupDelegationsClientListOptions contains the optional parameters for the AvailableResourceGroupDelegationsClient.List -// method. -func (client *AvailableResourceGroupDelegationsClient) NewListPager(location string, resourceGroupName string, options *AvailableResourceGroupDelegationsClientListOptions) *runtime.Pager[AvailableResourceGroupDelegationsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[AvailableResourceGroupDelegationsClientListResponse]{ - More: func(page AvailableResourceGroupDelegationsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *AvailableResourceGroupDelegationsClientListResponse) (AvailableResourceGroupDelegationsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, location, resourceGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return AvailableResourceGroupDelegationsClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return AvailableResourceGroupDelegationsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AvailableResourceGroupDelegationsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *AvailableResourceGroupDelegationsClient) listCreateRequest(ctx context.Context, location string, resourceGroupName string, options *AvailableResourceGroupDelegationsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/availableDelegations" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *AvailableResourceGroupDelegationsClient) listHandleResponse(resp *http.Response) (AvailableResourceGroupDelegationsClientListResponse, error) { - result := AvailableResourceGroupDelegationsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.AvailableDelegationsResult); err != nil { - return AvailableResourceGroupDelegationsClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/availableservicealiases_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/availableservicealiases_client.go deleted file mode 100644 index fd49aa0c..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/availableservicealiases_client.go +++ /dev/null @@ -1,192 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// AvailableServiceAliasesClient contains the methods for the AvailableServiceAliases group. -// Don't use this type directly, use NewAvailableServiceAliasesClient() instead. -type AvailableServiceAliasesClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewAvailableServiceAliasesClient creates a new instance of AvailableServiceAliasesClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewAvailableServiceAliasesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AvailableServiceAliasesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &AvailableServiceAliasesClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// NewListPager - Gets all available service aliases for this subscription in this region. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// location - The location. -// options - AvailableServiceAliasesClientListOptions contains the optional parameters for the AvailableServiceAliasesClient.List -// method. -func (client *AvailableServiceAliasesClient) NewListPager(location string, options *AvailableServiceAliasesClientListOptions) *runtime.Pager[AvailableServiceAliasesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[AvailableServiceAliasesClientListResponse]{ - More: func(page AvailableServiceAliasesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *AvailableServiceAliasesClientListResponse) (AvailableServiceAliasesClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, location, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return AvailableServiceAliasesClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return AvailableServiceAliasesClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AvailableServiceAliasesClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *AvailableServiceAliasesClient) listCreateRequest(ctx context.Context, location string, options *AvailableServiceAliasesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/availableServiceAliases" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *AvailableServiceAliasesClient) listHandleResponse(resp *http.Response) (AvailableServiceAliasesClientListResponse, error) { - result := AvailableServiceAliasesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.AvailableServiceAliasesResult); err != nil { - return AvailableServiceAliasesClientListResponse{}, err - } - return result, nil -} - -// NewListByResourceGroupPager - Gets all available service aliases for this resource group in this region. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// location - The location. -// options - AvailableServiceAliasesClientListByResourceGroupOptions contains the optional parameters for the AvailableServiceAliasesClient.ListByResourceGroup -// method. -func (client *AvailableServiceAliasesClient) NewListByResourceGroupPager(resourceGroupName string, location string, options *AvailableServiceAliasesClientListByResourceGroupOptions) *runtime.Pager[AvailableServiceAliasesClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[AvailableServiceAliasesClientListByResourceGroupResponse]{ - More: func(page AvailableServiceAliasesClientListByResourceGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *AvailableServiceAliasesClientListByResourceGroupResponse) (AvailableServiceAliasesClientListByResourceGroupResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, location, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return AvailableServiceAliasesClientListByResourceGroupResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return AvailableServiceAliasesClientListByResourceGroupResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AvailableServiceAliasesClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) - } - return client.listByResourceGroupHandleResponse(resp) - }, - }) -} - -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *AvailableServiceAliasesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, location string, options *AvailableServiceAliasesClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/availableServiceAliases" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *AvailableServiceAliasesClient) listByResourceGroupHandleResponse(resp *http.Response) (AvailableServiceAliasesClientListByResourceGroupResponse, error) { - result := AvailableServiceAliasesClientListByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.AvailableServiceAliasesResult); err != nil { - return AvailableServiceAliasesClientListByResourceGroupResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/azurefirewallfqdntags_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/azurefirewallfqdntags_client.go deleted file mode 100644 index 925a6784..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/azurefirewallfqdntags_client.go +++ /dev/null @@ -1,117 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// AzureFirewallFqdnTagsClient contains the methods for the AzureFirewallFqdnTags group. -// Don't use this type directly, use NewAzureFirewallFqdnTagsClient() instead. -type AzureFirewallFqdnTagsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewAzureFirewallFqdnTagsClient creates a new instance of AzureFirewallFqdnTagsClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewAzureFirewallFqdnTagsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AzureFirewallFqdnTagsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &AzureFirewallFqdnTagsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// NewListAllPager - Gets all the Azure Firewall FQDN Tags in a subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// options - AzureFirewallFqdnTagsClientListAllOptions contains the optional parameters for the AzureFirewallFqdnTagsClient.ListAll -// method. -func (client *AzureFirewallFqdnTagsClient) NewListAllPager(options *AzureFirewallFqdnTagsClientListAllOptions) *runtime.Pager[AzureFirewallFqdnTagsClientListAllResponse] { - return runtime.NewPager(runtime.PagingHandler[AzureFirewallFqdnTagsClientListAllResponse]{ - More: func(page AzureFirewallFqdnTagsClientListAllResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *AzureFirewallFqdnTagsClientListAllResponse) (AzureFirewallFqdnTagsClientListAllResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listAllCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return AzureFirewallFqdnTagsClientListAllResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return AzureFirewallFqdnTagsClientListAllResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AzureFirewallFqdnTagsClientListAllResponse{}, runtime.NewResponseError(resp) - } - return client.listAllHandleResponse(resp) - }, - }) -} - -// listAllCreateRequest creates the ListAll request. -func (client *AzureFirewallFqdnTagsClient) listAllCreateRequest(ctx context.Context, options *AzureFirewallFqdnTagsClientListAllOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/azureFirewallFqdnTags" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listAllHandleResponse handles the ListAll response. -func (client *AzureFirewallFqdnTagsClient) listAllHandleResponse(resp *http.Response) (AzureFirewallFqdnTagsClientListAllResponse, error) { - result := AzureFirewallFqdnTagsClientListAllResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.AzureFirewallFqdnTagListResult); err != nil { - return AzureFirewallFqdnTagsClientListAllResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/azurefirewalls_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/azurefirewalls_client.go deleted file mode 100644 index d7a8e613..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/azurefirewalls_client.go +++ /dev/null @@ -1,498 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// AzureFirewallsClient contains the methods for the AzureFirewalls group. -// Don't use this type directly, use NewAzureFirewallsClient() instead. -type AzureFirewallsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewAzureFirewallsClient creates a new instance of AzureFirewallsClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewAzureFirewallsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AzureFirewallsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &AzureFirewallsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates the specified Azure Firewall. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// azureFirewallName - The name of the Azure Firewall. -// parameters - Parameters supplied to the create or update Azure Firewall operation. -// options - AzureFirewallsClientBeginCreateOrUpdateOptions contains the optional parameters for the AzureFirewallsClient.BeginCreateOrUpdate -// method. -func (client *AzureFirewallsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, azureFirewallName string, parameters AzureFirewall, options *AzureFirewallsClientBeginCreateOrUpdateOptions) (*runtime.Poller[AzureFirewallsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, azureFirewallName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[AzureFirewallsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[AzureFirewallsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates or updates the specified Azure Firewall. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *AzureFirewallsClient) createOrUpdate(ctx context.Context, resourceGroupName string, azureFirewallName string, parameters AzureFirewall, options *AzureFirewallsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, azureFirewallName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *AzureFirewallsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, azureFirewallName string, parameters AzureFirewall, options *AzureFirewallsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if azureFirewallName == "" { - return nil, errors.New("parameter azureFirewallName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{azureFirewallName}", url.PathEscape(azureFirewallName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginDelete - Deletes the specified Azure Firewall. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// azureFirewallName - The name of the Azure Firewall. -// options - AzureFirewallsClientBeginDeleteOptions contains the optional parameters for the AzureFirewallsClient.BeginDelete -// method. -func (client *AzureFirewallsClient) BeginDelete(ctx context.Context, resourceGroupName string, azureFirewallName string, options *AzureFirewallsClientBeginDeleteOptions) (*runtime.Poller[AzureFirewallsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, azureFirewallName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[AzureFirewallsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[AzureFirewallsClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes the specified Azure Firewall. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *AzureFirewallsClient) deleteOperation(ctx context.Context, resourceGroupName string, azureFirewallName string, options *AzureFirewallsClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, azureFirewallName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *AzureFirewallsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, azureFirewallName string, options *AzureFirewallsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if azureFirewallName == "" { - return nil, errors.New("parameter azureFirewallName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{azureFirewallName}", url.PathEscape(azureFirewallName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets the specified Azure Firewall. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// azureFirewallName - The name of the Azure Firewall. -// options - AzureFirewallsClientGetOptions contains the optional parameters for the AzureFirewallsClient.Get method. -func (client *AzureFirewallsClient) Get(ctx context.Context, resourceGroupName string, azureFirewallName string, options *AzureFirewallsClientGetOptions) (AzureFirewallsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, azureFirewallName, options) - if err != nil { - return AzureFirewallsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return AzureFirewallsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AzureFirewallsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *AzureFirewallsClient) getCreateRequest(ctx context.Context, resourceGroupName string, azureFirewallName string, options *AzureFirewallsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if azureFirewallName == "" { - return nil, errors.New("parameter azureFirewallName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{azureFirewallName}", url.PathEscape(azureFirewallName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *AzureFirewallsClient) getHandleResponse(resp *http.Response) (AzureFirewallsClientGetResponse, error) { - result := AzureFirewallsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.AzureFirewall); err != nil { - return AzureFirewallsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Lists all Azure Firewalls in a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// options - AzureFirewallsClientListOptions contains the optional parameters for the AzureFirewallsClient.List method. -func (client *AzureFirewallsClient) NewListPager(resourceGroupName string, options *AzureFirewallsClientListOptions) *runtime.Pager[AzureFirewallsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[AzureFirewallsClientListResponse]{ - More: func(page AzureFirewallsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *AzureFirewallsClientListResponse) (AzureFirewallsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return AzureFirewallsClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return AzureFirewallsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AzureFirewallsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *AzureFirewallsClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *AzureFirewallsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *AzureFirewallsClient) listHandleResponse(resp *http.Response) (AzureFirewallsClientListResponse, error) { - result := AzureFirewallsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.AzureFirewallListResult); err != nil { - return AzureFirewallsClientListResponse{}, err - } - return result, nil -} - -// NewListAllPager - Gets all the Azure Firewalls in a subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// options - AzureFirewallsClientListAllOptions contains the optional parameters for the AzureFirewallsClient.ListAll method. -func (client *AzureFirewallsClient) NewListAllPager(options *AzureFirewallsClientListAllOptions) *runtime.Pager[AzureFirewallsClientListAllResponse] { - return runtime.NewPager(runtime.PagingHandler[AzureFirewallsClientListAllResponse]{ - More: func(page AzureFirewallsClientListAllResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *AzureFirewallsClientListAllResponse) (AzureFirewallsClientListAllResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listAllCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return AzureFirewallsClientListAllResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return AzureFirewallsClientListAllResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AzureFirewallsClientListAllResponse{}, runtime.NewResponseError(resp) - } - return client.listAllHandleResponse(resp) - }, - }) -} - -// listAllCreateRequest creates the ListAll request. -func (client *AzureFirewallsClient) listAllCreateRequest(ctx context.Context, options *AzureFirewallsClientListAllOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/azureFirewalls" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listAllHandleResponse handles the ListAll response. -func (client *AzureFirewallsClient) listAllHandleResponse(resp *http.Response) (AzureFirewallsClientListAllResponse, error) { - result := AzureFirewallsClientListAllResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.AzureFirewallListResult); err != nil { - return AzureFirewallsClientListAllResponse{}, err - } - return result, nil -} - -// BeginListLearnedPrefixes - Retrieves a list of all IP prefixes that azure firewall has learned to not SNAT. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// azureFirewallName - The name of the azure firewall. -// options - AzureFirewallsClientBeginListLearnedPrefixesOptions contains the optional parameters for the AzureFirewallsClient.BeginListLearnedPrefixes -// method. -func (client *AzureFirewallsClient) BeginListLearnedPrefixes(ctx context.Context, resourceGroupName string, azureFirewallName string, options *AzureFirewallsClientBeginListLearnedPrefixesOptions) (*runtime.Poller[AzureFirewallsClientListLearnedPrefixesResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.listLearnedPrefixes(ctx, resourceGroupName, azureFirewallName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[AzureFirewallsClientListLearnedPrefixesResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[AzureFirewallsClientListLearnedPrefixesResponse](options.ResumeToken, client.pl, nil) - } -} - -// ListLearnedPrefixes - Retrieves a list of all IP prefixes that azure firewall has learned to not SNAT. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *AzureFirewallsClient) listLearnedPrefixes(ctx context.Context, resourceGroupName string, azureFirewallName string, options *AzureFirewallsClientBeginListLearnedPrefixesOptions) (*http.Response, error) { - req, err := client.listLearnedPrefixesCreateRequest(ctx, resourceGroupName, azureFirewallName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// listLearnedPrefixesCreateRequest creates the ListLearnedPrefixes request. -func (client *AzureFirewallsClient) listLearnedPrefixesCreateRequest(ctx context.Context, resourceGroupName string, azureFirewallName string, options *AzureFirewallsClientBeginListLearnedPrefixesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}/learnedIPPrefixes" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if azureFirewallName == "" { - return nil, errors.New("parameter azureFirewallName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{azureFirewallName}", url.PathEscape(azureFirewallName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginUpdateTags - Updates tags of an Azure Firewall resource. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// azureFirewallName - The name of the Azure Firewall. -// parameters - Parameters supplied to update azure firewall tags. -// options - AzureFirewallsClientBeginUpdateTagsOptions contains the optional parameters for the AzureFirewallsClient.BeginUpdateTags -// method. -func (client *AzureFirewallsClient) BeginUpdateTags(ctx context.Context, resourceGroupName string, azureFirewallName string, parameters TagsObject, options *AzureFirewallsClientBeginUpdateTagsOptions) (*runtime.Poller[AzureFirewallsClientUpdateTagsResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.updateTags(ctx, resourceGroupName, azureFirewallName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[AzureFirewallsClientUpdateTagsResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[AzureFirewallsClientUpdateTagsResponse](options.ResumeToken, client.pl, nil) - } -} - -// UpdateTags - Updates tags of an Azure Firewall resource. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *AzureFirewallsClient) updateTags(ctx context.Context, resourceGroupName string, azureFirewallName string, parameters TagsObject, options *AzureFirewallsClientBeginUpdateTagsOptions) (*http.Response, error) { - req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, azureFirewallName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// updateTagsCreateRequest creates the UpdateTags request. -func (client *AzureFirewallsClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, azureFirewallName string, parameters TagsObject, options *AzureFirewallsClientBeginUpdateTagsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if azureFirewallName == "" { - return nil, errors.New("parameter azureFirewallName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{azureFirewallName}", url.PathEscape(azureFirewallName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/bastionhosts_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/bastionhosts_client.go deleted file mode 100644 index 1574c4ce..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/bastionhosts_client.go +++ /dev/null @@ -1,434 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// BastionHostsClient contains the methods for the BastionHosts group. -// Don't use this type directly, use NewBastionHostsClient() instead. -type BastionHostsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewBastionHostsClient creates a new instance of BastionHostsClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewBastionHostsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BastionHostsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &BastionHostsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates the specified Bastion Host. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// bastionHostName - The name of the Bastion Host. -// parameters - Parameters supplied to the create or update Bastion Host operation. -// options - BastionHostsClientBeginCreateOrUpdateOptions contains the optional parameters for the BastionHostsClient.BeginCreateOrUpdate -// method. -func (client *BastionHostsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, bastionHostName string, parameters BastionHost, options *BastionHostsClientBeginCreateOrUpdateOptions) (*runtime.Poller[BastionHostsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, bastionHostName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[BastionHostsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[BastionHostsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates or updates the specified Bastion Host. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *BastionHostsClient) createOrUpdate(ctx context.Context, resourceGroupName string, bastionHostName string, parameters BastionHost, options *BastionHostsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, bastionHostName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *BastionHostsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, bastionHostName string, parameters BastionHost, options *BastionHostsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if bastionHostName == "" { - return nil, errors.New("parameter bastionHostName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{bastionHostName}", url.PathEscape(bastionHostName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginDelete - Deletes the specified Bastion Host. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// bastionHostName - The name of the Bastion Host. -// options - BastionHostsClientBeginDeleteOptions contains the optional parameters for the BastionHostsClient.BeginDelete -// method. -func (client *BastionHostsClient) BeginDelete(ctx context.Context, resourceGroupName string, bastionHostName string, options *BastionHostsClientBeginDeleteOptions) (*runtime.Poller[BastionHostsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, bastionHostName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[BastionHostsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[BastionHostsClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes the specified Bastion Host. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *BastionHostsClient) deleteOperation(ctx context.Context, resourceGroupName string, bastionHostName string, options *BastionHostsClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, bastionHostName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *BastionHostsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, bastionHostName string, options *BastionHostsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if bastionHostName == "" { - return nil, errors.New("parameter bastionHostName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{bastionHostName}", url.PathEscape(bastionHostName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets the specified Bastion Host. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// bastionHostName - The name of the Bastion Host. -// options - BastionHostsClientGetOptions contains the optional parameters for the BastionHostsClient.Get method. -func (client *BastionHostsClient) Get(ctx context.Context, resourceGroupName string, bastionHostName string, options *BastionHostsClientGetOptions) (BastionHostsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, bastionHostName, options) - if err != nil { - return BastionHostsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return BastionHostsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return BastionHostsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *BastionHostsClient) getCreateRequest(ctx context.Context, resourceGroupName string, bastionHostName string, options *BastionHostsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if bastionHostName == "" { - return nil, errors.New("parameter bastionHostName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{bastionHostName}", url.PathEscape(bastionHostName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *BastionHostsClient) getHandleResponse(resp *http.Response) (BastionHostsClientGetResponse, error) { - result := BastionHostsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.BastionHost); err != nil { - return BastionHostsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Lists all Bastion Hosts in a subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// options - BastionHostsClientListOptions contains the optional parameters for the BastionHostsClient.List method. -func (client *BastionHostsClient) NewListPager(options *BastionHostsClientListOptions) *runtime.Pager[BastionHostsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[BastionHostsClientListResponse]{ - More: func(page BastionHostsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *BastionHostsClientListResponse) (BastionHostsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return BastionHostsClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return BastionHostsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return BastionHostsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *BastionHostsClient) listCreateRequest(ctx context.Context, options *BastionHostsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/bastionHosts" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *BastionHostsClient) listHandleResponse(resp *http.Response) (BastionHostsClientListResponse, error) { - result := BastionHostsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.BastionHostListResult); err != nil { - return BastionHostsClientListResponse{}, err - } - return result, nil -} - -// NewListByResourceGroupPager - Lists all Bastion Hosts in a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// options - BastionHostsClientListByResourceGroupOptions contains the optional parameters for the BastionHostsClient.ListByResourceGroup -// method. -func (client *BastionHostsClient) NewListByResourceGroupPager(resourceGroupName string, options *BastionHostsClientListByResourceGroupOptions) *runtime.Pager[BastionHostsClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[BastionHostsClientListByResourceGroupResponse]{ - More: func(page BastionHostsClientListByResourceGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *BastionHostsClientListByResourceGroupResponse) (BastionHostsClientListByResourceGroupResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return BastionHostsClientListByResourceGroupResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return BastionHostsClientListByResourceGroupResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return BastionHostsClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) - } - return client.listByResourceGroupHandleResponse(resp) - }, - }) -} - -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *BastionHostsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *BastionHostsClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *BastionHostsClient) listByResourceGroupHandleResponse(resp *http.Response) (BastionHostsClientListByResourceGroupResponse, error) { - result := BastionHostsClientListByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.BastionHostListResult); err != nil { - return BastionHostsClientListByResourceGroupResponse{}, err - } - return result, nil -} - -// BeginUpdateTags - Updates Tags for BastionHost resource -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// bastionHostName - The name of the Bastion Host. -// parameters - Parameters supplied to update BastionHost tags. -// options - BastionHostsClientBeginUpdateTagsOptions contains the optional parameters for the BastionHostsClient.BeginUpdateTags -// method. -func (client *BastionHostsClient) BeginUpdateTags(ctx context.Context, resourceGroupName string, bastionHostName string, parameters TagsObject, options *BastionHostsClientBeginUpdateTagsOptions) (*runtime.Poller[BastionHostsClientUpdateTagsResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.updateTags(ctx, resourceGroupName, bastionHostName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[BastionHostsClientUpdateTagsResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[BastionHostsClientUpdateTagsResponse](options.ResumeToken, client.pl, nil) - } -} - -// UpdateTags - Updates Tags for BastionHost resource -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *BastionHostsClient) updateTags(ctx context.Context, resourceGroupName string, bastionHostName string, parameters TagsObject, options *BastionHostsClientBeginUpdateTagsOptions) (*http.Response, error) { - req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, bastionHostName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// updateTagsCreateRequest creates the UpdateTags request. -func (client *BastionHostsClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, bastionHostName string, parameters TagsObject, options *BastionHostsClientBeginUpdateTagsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if bastionHostName == "" { - return nil, errors.New("parameter bastionHostName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{bastionHostName}", url.PathEscape(bastionHostName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/bgpservicecommunities_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/bgpservicecommunities_client.go deleted file mode 100644 index 1c5d2951..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/bgpservicecommunities_client.go +++ /dev/null @@ -1,117 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// BgpServiceCommunitiesClient contains the methods for the BgpServiceCommunities group. -// Don't use this type directly, use NewBgpServiceCommunitiesClient() instead. -type BgpServiceCommunitiesClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewBgpServiceCommunitiesClient creates a new instance of BgpServiceCommunitiesClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewBgpServiceCommunitiesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BgpServiceCommunitiesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &BgpServiceCommunitiesClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// NewListPager - Gets all the available bgp service communities. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// options - BgpServiceCommunitiesClientListOptions contains the optional parameters for the BgpServiceCommunitiesClient.List -// method. -func (client *BgpServiceCommunitiesClient) NewListPager(options *BgpServiceCommunitiesClientListOptions) *runtime.Pager[BgpServiceCommunitiesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[BgpServiceCommunitiesClientListResponse]{ - More: func(page BgpServiceCommunitiesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *BgpServiceCommunitiesClientListResponse) (BgpServiceCommunitiesClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return BgpServiceCommunitiesClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return BgpServiceCommunitiesClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return BgpServiceCommunitiesClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *BgpServiceCommunitiesClient) listCreateRequest(ctx context.Context, options *BgpServiceCommunitiesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/bgpServiceCommunities" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *BgpServiceCommunitiesClient) listHandleResponse(resp *http.Response) (BgpServiceCommunitiesClientListResponse, error) { - result := BgpServiceCommunitiesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.BgpServiceCommunityListResult); err != nil { - return BgpServiceCommunitiesClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/build.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/build.go deleted file mode 100644 index a2225010..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/build.go +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. - -// This file enables 'go generate' to regenerate this specific SDK -//go:generate pwsh ../../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate resourcemanager/network/armnetwork - -package armnetwork diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/ci.yml b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/ci.yml deleted file mode 100644 index d1d36edc..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/ci.yml +++ /dev/null @@ -1,28 +0,0 @@ -# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. -trigger: - branches: - include: - - main - - feature/* - - hotfix/* - - release/* - paths: - include: - - sdk/resourcemanager/network/armnetwork/ - -pr: - branches: - include: - - main - - feature/* - - hotfix/* - - release/* - paths: - include: - - sdk/resourcemanager/network/armnetwork/ - -stages: -- template: /eng/pipelines/templates/jobs/archetype-sdk-client.yml - parameters: - IncludeRelease: true - ServiceDirectory: 'resourcemanager/network/armnetwork' diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/configurationpolicygroups_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/configurationpolicygroups_client.go deleted file mode 100644 index da723bf1..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/configurationpolicygroups_client.go +++ /dev/null @@ -1,330 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// ConfigurationPolicyGroupsClient contains the methods for the ConfigurationPolicyGroups group. -// Don't use this type directly, use NewConfigurationPolicyGroupsClient() instead. -type ConfigurationPolicyGroupsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewConfigurationPolicyGroupsClient creates a new instance of ConfigurationPolicyGroupsClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewConfigurationPolicyGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ConfigurationPolicyGroupsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &ConfigurationPolicyGroupsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates a ConfigurationPolicyGroup if it doesn't exist else updates the existing one. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the ConfigurationPolicyGroup. -// vpnServerConfigurationName - The name of the VpnServerConfiguration. -// configurationPolicyGroupName - The name of the ConfigurationPolicyGroup. -// vpnServerConfigurationPolicyGroupParameters - Parameters supplied to create or update a VpnServerConfiguration PolicyGroup. -// options - ConfigurationPolicyGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the ConfigurationPolicyGroupsClient.BeginCreateOrUpdate -// method. -func (client *ConfigurationPolicyGroupsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, configurationPolicyGroupName string, vpnServerConfigurationPolicyGroupParameters VPNServerConfigurationPolicyGroup, options *ConfigurationPolicyGroupsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ConfigurationPolicyGroupsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName, vpnServerConfigurationPolicyGroupParameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ConfigurationPolicyGroupsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[ConfigurationPolicyGroupsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates a ConfigurationPolicyGroup if it doesn't exist else updates the existing one. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *ConfigurationPolicyGroupsClient) createOrUpdate(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, configurationPolicyGroupName string, vpnServerConfigurationPolicyGroupParameters VPNServerConfigurationPolicyGroup, options *ConfigurationPolicyGroupsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName, vpnServerConfigurationPolicyGroupParameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ConfigurationPolicyGroupsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, configurationPolicyGroupName string, vpnServerConfigurationPolicyGroupParameters VPNServerConfigurationPolicyGroup, options *ConfigurationPolicyGroupsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}/configurationPolicyGroups/{configurationPolicyGroupName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vpnServerConfigurationName == "" { - return nil, errors.New("parameter vpnServerConfigurationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vpnServerConfigurationName}", url.PathEscape(vpnServerConfigurationName)) - if configurationPolicyGroupName == "" { - return nil, errors.New("parameter configurationPolicyGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{configurationPolicyGroupName}", url.PathEscape(configurationPolicyGroupName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, vpnServerConfigurationPolicyGroupParameters) -} - -// BeginDelete - Deletes a ConfigurationPolicyGroup. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the ConfigurationPolicyGroup. -// vpnServerConfigurationName - The name of the VpnServerConfiguration. -// configurationPolicyGroupName - The name of the ConfigurationPolicyGroup. -// options - ConfigurationPolicyGroupsClientBeginDeleteOptions contains the optional parameters for the ConfigurationPolicyGroupsClient.BeginDelete -// method. -func (client *ConfigurationPolicyGroupsClient) BeginDelete(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, configurationPolicyGroupName string, options *ConfigurationPolicyGroupsClientBeginDeleteOptions) (*runtime.Poller[ConfigurationPolicyGroupsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ConfigurationPolicyGroupsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[ConfigurationPolicyGroupsClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes a ConfigurationPolicyGroup. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *ConfigurationPolicyGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, configurationPolicyGroupName string, options *ConfigurationPolicyGroupsClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *ConfigurationPolicyGroupsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, configurationPolicyGroupName string, options *ConfigurationPolicyGroupsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}/configurationPolicyGroups/{configurationPolicyGroupName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vpnServerConfigurationName == "" { - return nil, errors.New("parameter vpnServerConfigurationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vpnServerConfigurationName}", url.PathEscape(vpnServerConfigurationName)) - if configurationPolicyGroupName == "" { - return nil, errors.New("parameter configurationPolicyGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{configurationPolicyGroupName}", url.PathEscape(configurationPolicyGroupName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Retrieves the details of a ConfigurationPolicyGroup. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the VpnServerConfiguration. -// vpnServerConfigurationName - The name of the VpnServerConfiguration. -// configurationPolicyGroupName - The name of the ConfigurationPolicyGroup being retrieved. -// options - ConfigurationPolicyGroupsClientGetOptions contains the optional parameters for the ConfigurationPolicyGroupsClient.Get -// method. -func (client *ConfigurationPolicyGroupsClient) Get(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, configurationPolicyGroupName string, options *ConfigurationPolicyGroupsClientGetOptions) (ConfigurationPolicyGroupsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName, options) - if err != nil { - return ConfigurationPolicyGroupsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ConfigurationPolicyGroupsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ConfigurationPolicyGroupsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *ConfigurationPolicyGroupsClient) getCreateRequest(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, configurationPolicyGroupName string, options *ConfigurationPolicyGroupsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}/configurationPolicyGroups/{configurationPolicyGroupName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vpnServerConfigurationName == "" { - return nil, errors.New("parameter vpnServerConfigurationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vpnServerConfigurationName}", url.PathEscape(vpnServerConfigurationName)) - if configurationPolicyGroupName == "" { - return nil, errors.New("parameter configurationPolicyGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{configurationPolicyGroupName}", url.PathEscape(configurationPolicyGroupName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *ConfigurationPolicyGroupsClient) getHandleResponse(resp *http.Response) (ConfigurationPolicyGroupsClientGetResponse, error) { - result := ConfigurationPolicyGroupsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VPNServerConfigurationPolicyGroup); err != nil { - return ConfigurationPolicyGroupsClientGetResponse{}, err - } - return result, nil -} - -// NewListByVPNServerConfigurationPager - Lists all the configurationPolicyGroups in a resource group for a vpnServerConfiguration. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the VpnServerConfiguration. -// vpnServerConfigurationName - The name of the VpnServerConfiguration. -// options - ConfigurationPolicyGroupsClientListByVPNServerConfigurationOptions contains the optional parameters for the ConfigurationPolicyGroupsClient.ListByVPNServerConfiguration -// method. -func (client *ConfigurationPolicyGroupsClient) NewListByVPNServerConfigurationPager(resourceGroupName string, vpnServerConfigurationName string, options *ConfigurationPolicyGroupsClientListByVPNServerConfigurationOptions) *runtime.Pager[ConfigurationPolicyGroupsClientListByVPNServerConfigurationResponse] { - return runtime.NewPager(runtime.PagingHandler[ConfigurationPolicyGroupsClientListByVPNServerConfigurationResponse]{ - More: func(page ConfigurationPolicyGroupsClientListByVPNServerConfigurationResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ConfigurationPolicyGroupsClientListByVPNServerConfigurationResponse) (ConfigurationPolicyGroupsClientListByVPNServerConfigurationResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByVPNServerConfigurationCreateRequest(ctx, resourceGroupName, vpnServerConfigurationName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return ConfigurationPolicyGroupsClientListByVPNServerConfigurationResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ConfigurationPolicyGroupsClientListByVPNServerConfigurationResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ConfigurationPolicyGroupsClientListByVPNServerConfigurationResponse{}, runtime.NewResponseError(resp) - } - return client.listByVPNServerConfigurationHandleResponse(resp) - }, - }) -} - -// listByVPNServerConfigurationCreateRequest creates the ListByVPNServerConfiguration request. -func (client *ConfigurationPolicyGroupsClient) listByVPNServerConfigurationCreateRequest(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, options *ConfigurationPolicyGroupsClientListByVPNServerConfigurationOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}/configurationPolicyGroups" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vpnServerConfigurationName == "" { - return nil, errors.New("parameter vpnServerConfigurationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vpnServerConfigurationName}", url.PathEscape(vpnServerConfigurationName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByVPNServerConfigurationHandleResponse handles the ListByVPNServerConfiguration response. -func (client *ConfigurationPolicyGroupsClient) listByVPNServerConfigurationHandleResponse(resp *http.Response) (ConfigurationPolicyGroupsClientListByVPNServerConfigurationResponse, error) { - result := ConfigurationPolicyGroupsClientListByVPNServerConfigurationResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ListVPNServerConfigurationPolicyGroupsResult); err != nil { - return ConfigurationPolicyGroupsClientListByVPNServerConfigurationResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/connectionmonitors_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/connectionmonitors_client.go deleted file mode 100644 index 7c5598ef..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/connectionmonitors_client.go +++ /dev/null @@ -1,598 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// ConnectionMonitorsClient contains the methods for the ConnectionMonitors group. -// Don't use this type directly, use NewConnectionMonitorsClient() instead. -type ConnectionMonitorsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewConnectionMonitorsClient creates a new instance of ConnectionMonitorsClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewConnectionMonitorsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ConnectionMonitorsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &ConnectionMonitorsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Create or update a connection monitor. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group containing Network Watcher. -// networkWatcherName - The name of the Network Watcher resource. -// connectionMonitorName - The name of the connection monitor. -// parameters - Parameters that define the operation to create a connection monitor. -// options - ConnectionMonitorsClientBeginCreateOrUpdateOptions contains the optional parameters for the ConnectionMonitorsClient.BeginCreateOrUpdate -// method. -func (client *ConnectionMonitorsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, parameters ConnectionMonitor, options *ConnectionMonitorsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ConnectionMonitorsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, networkWatcherName, connectionMonitorName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ConnectionMonitorsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[ConnectionMonitorsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Create or update a connection monitor. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *ConnectionMonitorsClient) createOrUpdate(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, parameters ConnectionMonitor, options *ConnectionMonitorsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, networkWatcherName, connectionMonitorName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ConnectionMonitorsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, parameters ConnectionMonitor, options *ConnectionMonitorsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkWatcherName == "" { - return nil, errors.New("parameter networkWatcherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) - if connectionMonitorName == "" { - return nil, errors.New("parameter connectionMonitorName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{connectionMonitorName}", url.PathEscape(connectionMonitorName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - if options != nil && options.Migrate != nil { - reqQP.Set("migrate", *options.Migrate) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginDelete - Deletes the specified connection monitor. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group containing Network Watcher. -// networkWatcherName - The name of the Network Watcher resource. -// connectionMonitorName - The name of the connection monitor. -// options - ConnectionMonitorsClientBeginDeleteOptions contains the optional parameters for the ConnectionMonitorsClient.BeginDelete -// method. -func (client *ConnectionMonitorsClient) BeginDelete(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, options *ConnectionMonitorsClientBeginDeleteOptions) (*runtime.Poller[ConnectionMonitorsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, networkWatcherName, connectionMonitorName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ConnectionMonitorsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[ConnectionMonitorsClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes the specified connection monitor. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *ConnectionMonitorsClient) deleteOperation(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, options *ConnectionMonitorsClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, networkWatcherName, connectionMonitorName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *ConnectionMonitorsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, options *ConnectionMonitorsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkWatcherName == "" { - return nil, errors.New("parameter networkWatcherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) - if connectionMonitorName == "" { - return nil, errors.New("parameter connectionMonitorName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{connectionMonitorName}", url.PathEscape(connectionMonitorName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets a connection monitor by name. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group containing Network Watcher. -// networkWatcherName - The name of the Network Watcher resource. -// connectionMonitorName - The name of the connection monitor. -// options - ConnectionMonitorsClientGetOptions contains the optional parameters for the ConnectionMonitorsClient.Get method. -func (client *ConnectionMonitorsClient) Get(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, options *ConnectionMonitorsClientGetOptions) (ConnectionMonitorsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, networkWatcherName, connectionMonitorName, options) - if err != nil { - return ConnectionMonitorsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ConnectionMonitorsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ConnectionMonitorsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *ConnectionMonitorsClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, options *ConnectionMonitorsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkWatcherName == "" { - return nil, errors.New("parameter networkWatcherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) - if connectionMonitorName == "" { - return nil, errors.New("parameter connectionMonitorName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{connectionMonitorName}", url.PathEscape(connectionMonitorName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *ConnectionMonitorsClient) getHandleResponse(resp *http.Response) (ConnectionMonitorsClientGetResponse, error) { - result := ConnectionMonitorsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ConnectionMonitorResult); err != nil { - return ConnectionMonitorsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Lists all connection monitors for the specified Network Watcher. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group containing Network Watcher. -// networkWatcherName - The name of the Network Watcher resource. -// options - ConnectionMonitorsClientListOptions contains the optional parameters for the ConnectionMonitorsClient.List method. -func (client *ConnectionMonitorsClient) NewListPager(resourceGroupName string, networkWatcherName string, options *ConnectionMonitorsClientListOptions) *runtime.Pager[ConnectionMonitorsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[ConnectionMonitorsClientListResponse]{ - More: func(page ConnectionMonitorsClientListResponse) bool { - return false - }, - Fetcher: func(ctx context.Context, page *ConnectionMonitorsClientListResponse) (ConnectionMonitorsClientListResponse, error) { - req, err := client.listCreateRequest(ctx, resourceGroupName, networkWatcherName, options) - if err != nil { - return ConnectionMonitorsClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ConnectionMonitorsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ConnectionMonitorsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *ConnectionMonitorsClient) listCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, options *ConnectionMonitorsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkWatcherName == "" { - return nil, errors.New("parameter networkWatcherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *ConnectionMonitorsClient) listHandleResponse(resp *http.Response) (ConnectionMonitorsClientListResponse, error) { - result := ConnectionMonitorsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ConnectionMonitorListResult); err != nil { - return ConnectionMonitorsClientListResponse{}, err - } - return result, nil -} - -// BeginQuery - Query a snapshot of the most recent connection states. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group containing Network Watcher. -// networkWatcherName - The name of the Network Watcher resource. -// connectionMonitorName - The name given to the connection monitor. -// options - ConnectionMonitorsClientBeginQueryOptions contains the optional parameters for the ConnectionMonitorsClient.BeginQuery -// method. -func (client *ConnectionMonitorsClient) BeginQuery(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, options *ConnectionMonitorsClientBeginQueryOptions) (*runtime.Poller[ConnectionMonitorsClientQueryResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.query(ctx, resourceGroupName, networkWatcherName, connectionMonitorName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ConnectionMonitorsClientQueryResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[ConnectionMonitorsClientQueryResponse](options.ResumeToken, client.pl, nil) - } -} - -// Query - Query a snapshot of the most recent connection states. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *ConnectionMonitorsClient) query(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, options *ConnectionMonitorsClientBeginQueryOptions) (*http.Response, error) { - req, err := client.queryCreateRequest(ctx, resourceGroupName, networkWatcherName, connectionMonitorName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// queryCreateRequest creates the Query request. -func (client *ConnectionMonitorsClient) queryCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, options *ConnectionMonitorsClientBeginQueryOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/query" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkWatcherName == "" { - return nil, errors.New("parameter networkWatcherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) - if connectionMonitorName == "" { - return nil, errors.New("parameter connectionMonitorName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{connectionMonitorName}", url.PathEscape(connectionMonitorName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginStart - Starts the specified connection monitor. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group containing Network Watcher. -// networkWatcherName - The name of the Network Watcher resource. -// connectionMonitorName - The name of the connection monitor. -// options - ConnectionMonitorsClientBeginStartOptions contains the optional parameters for the ConnectionMonitorsClient.BeginStart -// method. -func (client *ConnectionMonitorsClient) BeginStart(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, options *ConnectionMonitorsClientBeginStartOptions) (*runtime.Poller[ConnectionMonitorsClientStartResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.start(ctx, resourceGroupName, networkWatcherName, connectionMonitorName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ConnectionMonitorsClientStartResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[ConnectionMonitorsClientStartResponse](options.ResumeToken, client.pl, nil) - } -} - -// Start - Starts the specified connection monitor. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *ConnectionMonitorsClient) start(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, options *ConnectionMonitorsClientBeginStartOptions) (*http.Response, error) { - req, err := client.startCreateRequest(ctx, resourceGroupName, networkWatcherName, connectionMonitorName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// startCreateRequest creates the Start request. -func (client *ConnectionMonitorsClient) startCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, options *ConnectionMonitorsClientBeginStartOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/start" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkWatcherName == "" { - return nil, errors.New("parameter networkWatcherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) - if connectionMonitorName == "" { - return nil, errors.New("parameter connectionMonitorName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{connectionMonitorName}", url.PathEscape(connectionMonitorName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginStop - Stops the specified connection monitor. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group containing Network Watcher. -// networkWatcherName - The name of the Network Watcher resource. -// connectionMonitorName - The name of the connection monitor. -// options - ConnectionMonitorsClientBeginStopOptions contains the optional parameters for the ConnectionMonitorsClient.BeginStop -// method. -func (client *ConnectionMonitorsClient) BeginStop(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, options *ConnectionMonitorsClientBeginStopOptions) (*runtime.Poller[ConnectionMonitorsClientStopResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.stop(ctx, resourceGroupName, networkWatcherName, connectionMonitorName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ConnectionMonitorsClientStopResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[ConnectionMonitorsClientStopResponse](options.ResumeToken, client.pl, nil) - } -} - -// Stop - Stops the specified connection monitor. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *ConnectionMonitorsClient) stop(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, options *ConnectionMonitorsClientBeginStopOptions) (*http.Response, error) { - req, err := client.stopCreateRequest(ctx, resourceGroupName, networkWatcherName, connectionMonitorName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// stopCreateRequest creates the Stop request. -func (client *ConnectionMonitorsClient) stopCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, options *ConnectionMonitorsClientBeginStopOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/stop" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkWatcherName == "" { - return nil, errors.New("parameter networkWatcherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) - if connectionMonitorName == "" { - return nil, errors.New("parameter connectionMonitorName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{connectionMonitorName}", url.PathEscape(connectionMonitorName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// UpdateTags - Update tags of the specified connection monitor. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkWatcherName - The name of the network watcher. -// connectionMonitorName - The name of the connection monitor. -// parameters - Parameters supplied to update connection monitor tags. -// options - ConnectionMonitorsClientUpdateTagsOptions contains the optional parameters for the ConnectionMonitorsClient.UpdateTags -// method. -func (client *ConnectionMonitorsClient) UpdateTags(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, parameters TagsObject, options *ConnectionMonitorsClientUpdateTagsOptions) (ConnectionMonitorsClientUpdateTagsResponse, error) { - req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, networkWatcherName, connectionMonitorName, parameters, options) - if err != nil { - return ConnectionMonitorsClientUpdateTagsResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ConnectionMonitorsClientUpdateTagsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ConnectionMonitorsClientUpdateTagsResponse{}, runtime.NewResponseError(resp) - } - return client.updateTagsHandleResponse(resp) -} - -// updateTagsCreateRequest creates the UpdateTags request. -func (client *ConnectionMonitorsClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, parameters TagsObject, options *ConnectionMonitorsClientUpdateTagsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkWatcherName == "" { - return nil, errors.New("parameter networkWatcherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) - if connectionMonitorName == "" { - return nil, errors.New("parameter connectionMonitorName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{connectionMonitorName}", url.PathEscape(connectionMonitorName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// updateTagsHandleResponse handles the UpdateTags response. -func (client *ConnectionMonitorsClient) updateTagsHandleResponse(resp *http.Response) (ConnectionMonitorsClientUpdateTagsResponse, error) { - result := ConnectionMonitorsClientUpdateTagsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ConnectionMonitorResult); err != nil { - return ConnectionMonitorsClientUpdateTagsResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/connectivityconfigurations_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/connectivityconfigurations_client.go deleted file mode 100644 index 264bc481..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/connectivityconfigurations_client.go +++ /dev/null @@ -1,335 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strconv" - "strings" -) - -// ConnectivityConfigurationsClient contains the methods for the ConnectivityConfigurations group. -// Don't use this type directly, use NewConnectivityConfigurationsClient() instead. -type ConnectivityConfigurationsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewConnectivityConfigurationsClient creates a new instance of ConnectivityConfigurationsClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewConnectivityConfigurationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ConnectivityConfigurationsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &ConnectivityConfigurationsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// CreateOrUpdate - Creates/Updates a new network manager connectivity configuration -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkManagerName - The name of the network manager. -// configurationName - The name of the network manager connectivity configuration. -// connectivityConfiguration - Parameters supplied to create/update a network manager connectivity configuration -// options - ConnectivityConfigurationsClientCreateOrUpdateOptions contains the optional parameters for the ConnectivityConfigurationsClient.CreateOrUpdate -// method. -func (client *ConnectivityConfigurationsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, connectivityConfiguration ConnectivityConfiguration, options *ConnectivityConfigurationsClientCreateOrUpdateOptions) (ConnectivityConfigurationsClientCreateOrUpdateResponse, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, networkManagerName, configurationName, connectivityConfiguration, options) - if err != nil { - return ConnectivityConfigurationsClientCreateOrUpdateResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ConnectivityConfigurationsClientCreateOrUpdateResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return ConnectivityConfigurationsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) - } - return client.createOrUpdateHandleResponse(resp) -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ConnectivityConfigurationsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, connectivityConfiguration ConnectivityConfiguration, options *ConnectivityConfigurationsClientCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/connectivityConfigurations/{configurationName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkManagerName == "" { - return nil, errors.New("parameter networkManagerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) - if configurationName == "" { - return nil, errors.New("parameter configurationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{configurationName}", url.PathEscape(configurationName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, connectivityConfiguration) -} - -// createOrUpdateHandleResponse handles the CreateOrUpdate response. -func (client *ConnectivityConfigurationsClient) createOrUpdateHandleResponse(resp *http.Response) (ConnectivityConfigurationsClientCreateOrUpdateResponse, error) { - result := ConnectivityConfigurationsClientCreateOrUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ConnectivityConfiguration); err != nil { - return ConnectivityConfigurationsClientCreateOrUpdateResponse{}, err - } - return result, nil -} - -// BeginDelete - Deletes a network manager connectivity configuration, specified by the resource group, network manager name, -// and connectivity configuration name -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkManagerName - The name of the network manager. -// configurationName - The name of the network manager connectivity configuration. -// options - ConnectivityConfigurationsClientBeginDeleteOptions contains the optional parameters for the ConnectivityConfigurationsClient.BeginDelete -// method. -func (client *ConnectivityConfigurationsClient) BeginDelete(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, options *ConnectivityConfigurationsClientBeginDeleteOptions) (*runtime.Poller[ConnectivityConfigurationsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, networkManagerName, configurationName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ConnectivityConfigurationsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[ConnectivityConfigurationsClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes a network manager connectivity configuration, specified by the resource group, network manager name, and -// connectivity configuration name -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *ConnectivityConfigurationsClient) deleteOperation(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, options *ConnectivityConfigurationsClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, networkManagerName, configurationName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *ConnectivityConfigurationsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, options *ConnectivityConfigurationsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/connectivityConfigurations/{configurationName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkManagerName == "" { - return nil, errors.New("parameter networkManagerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) - if configurationName == "" { - return nil, errors.New("parameter configurationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{configurationName}", url.PathEscape(configurationName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - if options != nil && options.Force != nil { - reqQP.Set("force", strconv.FormatBool(*options.Force)) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets a Network Connectivity Configuration, specified by the resource group, network manager name, and connectivity -// Configuration name -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkManagerName - The name of the network manager. -// configurationName - The name of the network manager connectivity configuration. -// options - ConnectivityConfigurationsClientGetOptions contains the optional parameters for the ConnectivityConfigurationsClient.Get -// method. -func (client *ConnectivityConfigurationsClient) Get(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, options *ConnectivityConfigurationsClientGetOptions) (ConnectivityConfigurationsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, networkManagerName, configurationName, options) - if err != nil { - return ConnectivityConfigurationsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ConnectivityConfigurationsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ConnectivityConfigurationsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *ConnectivityConfigurationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, options *ConnectivityConfigurationsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/connectivityConfigurations/{configurationName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkManagerName == "" { - return nil, errors.New("parameter networkManagerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) - if configurationName == "" { - return nil, errors.New("parameter configurationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{configurationName}", url.PathEscape(configurationName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *ConnectivityConfigurationsClient) getHandleResponse(resp *http.Response) (ConnectivityConfigurationsClientGetResponse, error) { - result := ConnectivityConfigurationsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ConnectivityConfiguration); err != nil { - return ConnectivityConfigurationsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Lists all the network manager connectivity configuration in a specified network manager. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkManagerName - The name of the network manager. -// options - ConnectivityConfigurationsClientListOptions contains the optional parameters for the ConnectivityConfigurationsClient.List -// method. -func (client *ConnectivityConfigurationsClient) NewListPager(resourceGroupName string, networkManagerName string, options *ConnectivityConfigurationsClientListOptions) *runtime.Pager[ConnectivityConfigurationsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[ConnectivityConfigurationsClientListResponse]{ - More: func(page ConnectivityConfigurationsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ConnectivityConfigurationsClientListResponse) (ConnectivityConfigurationsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, networkManagerName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return ConnectivityConfigurationsClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ConnectivityConfigurationsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ConnectivityConfigurationsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *ConnectivityConfigurationsClient) listCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, options *ConnectivityConfigurationsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/connectivityConfigurations" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkManagerName == "" { - return nil, errors.New("parameter networkManagerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - if options != nil && options.Top != nil { - reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) - } - if options != nil && options.SkipToken != nil { - reqQP.Set("$skipToken", *options.SkipToken) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *ConnectivityConfigurationsClient) listHandleResponse(resp *http.Response) (ConnectivityConfigurationsClientListResponse, error) { - result := ConnectivityConfigurationsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ConnectivityConfigurationListResult); err != nil { - return ConnectivityConfigurationsClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/constants.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/constants.go deleted file mode 100644 index 82fa85bb..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/constants.go +++ /dev/null @@ -1,3695 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -const ( - moduleName = "armnetwork" - moduleVersion = "v1.1.0" -) - -// Access - Access to be allowed or denied. -type Access string - -const ( - AccessAllow Access = "Allow" - AccessDeny Access = "Deny" -) - -// PossibleAccessValues returns the possible values for the Access const type. -func PossibleAccessValues() []Access { - return []Access{ - AccessAllow, - AccessDeny, - } -} - -// AddressPrefixType - Address prefix type. -type AddressPrefixType string - -const ( - AddressPrefixTypeIPPrefix AddressPrefixType = "IPPrefix" - AddressPrefixTypeServiceTag AddressPrefixType = "ServiceTag" -) - -// PossibleAddressPrefixTypeValues returns the possible values for the AddressPrefixType const type. -func PossibleAddressPrefixTypeValues() []AddressPrefixType { - return []AddressPrefixType{ - AddressPrefixTypeIPPrefix, - AddressPrefixTypeServiceTag, - } -} - -// AdminRuleKind - Whether the rule is custom or default. -type AdminRuleKind string - -const ( - AdminRuleKindCustom AdminRuleKind = "Custom" - AdminRuleKindDefault AdminRuleKind = "Default" -) - -// PossibleAdminRuleKindValues returns the possible values for the AdminRuleKind const type. -func PossibleAdminRuleKindValues() []AdminRuleKind { - return []AdminRuleKind{ - AdminRuleKindCustom, - AdminRuleKindDefault, - } -} - -// ApplicationGatewayBackendHealthServerHealth - Health of backend server. -type ApplicationGatewayBackendHealthServerHealth string - -const ( - ApplicationGatewayBackendHealthServerHealthDown ApplicationGatewayBackendHealthServerHealth = "Down" - ApplicationGatewayBackendHealthServerHealthDraining ApplicationGatewayBackendHealthServerHealth = "Draining" - ApplicationGatewayBackendHealthServerHealthPartial ApplicationGatewayBackendHealthServerHealth = "Partial" - ApplicationGatewayBackendHealthServerHealthUnknown ApplicationGatewayBackendHealthServerHealth = "Unknown" - ApplicationGatewayBackendHealthServerHealthUp ApplicationGatewayBackendHealthServerHealth = "Up" -) - -// PossibleApplicationGatewayBackendHealthServerHealthValues returns the possible values for the ApplicationGatewayBackendHealthServerHealth const type. -func PossibleApplicationGatewayBackendHealthServerHealthValues() []ApplicationGatewayBackendHealthServerHealth { - return []ApplicationGatewayBackendHealthServerHealth{ - ApplicationGatewayBackendHealthServerHealthDown, - ApplicationGatewayBackendHealthServerHealthDraining, - ApplicationGatewayBackendHealthServerHealthPartial, - ApplicationGatewayBackendHealthServerHealthUnknown, - ApplicationGatewayBackendHealthServerHealthUp, - } -} - -// ApplicationGatewayCookieBasedAffinity - Cookie based affinity. -type ApplicationGatewayCookieBasedAffinity string - -const ( - ApplicationGatewayCookieBasedAffinityDisabled ApplicationGatewayCookieBasedAffinity = "Disabled" - ApplicationGatewayCookieBasedAffinityEnabled ApplicationGatewayCookieBasedAffinity = "Enabled" -) - -// PossibleApplicationGatewayCookieBasedAffinityValues returns the possible values for the ApplicationGatewayCookieBasedAffinity const type. -func PossibleApplicationGatewayCookieBasedAffinityValues() []ApplicationGatewayCookieBasedAffinity { - return []ApplicationGatewayCookieBasedAffinity{ - ApplicationGatewayCookieBasedAffinityDisabled, - ApplicationGatewayCookieBasedAffinityEnabled, - } -} - -// ApplicationGatewayCustomErrorStatusCode - Status code of the application gateway customer error. -type ApplicationGatewayCustomErrorStatusCode string - -const ( - ApplicationGatewayCustomErrorStatusCodeHTTPStatus403 ApplicationGatewayCustomErrorStatusCode = "HttpStatus403" - ApplicationGatewayCustomErrorStatusCodeHTTPStatus502 ApplicationGatewayCustomErrorStatusCode = "HttpStatus502" -) - -// PossibleApplicationGatewayCustomErrorStatusCodeValues returns the possible values for the ApplicationGatewayCustomErrorStatusCode const type. -func PossibleApplicationGatewayCustomErrorStatusCodeValues() []ApplicationGatewayCustomErrorStatusCode { - return []ApplicationGatewayCustomErrorStatusCode{ - ApplicationGatewayCustomErrorStatusCodeHTTPStatus403, - ApplicationGatewayCustomErrorStatusCodeHTTPStatus502, - } -} - -// ApplicationGatewayFirewallMode - Web application firewall mode. -type ApplicationGatewayFirewallMode string - -const ( - ApplicationGatewayFirewallModeDetection ApplicationGatewayFirewallMode = "Detection" - ApplicationGatewayFirewallModePrevention ApplicationGatewayFirewallMode = "Prevention" -) - -// PossibleApplicationGatewayFirewallModeValues returns the possible values for the ApplicationGatewayFirewallMode const type. -func PossibleApplicationGatewayFirewallModeValues() []ApplicationGatewayFirewallMode { - return []ApplicationGatewayFirewallMode{ - ApplicationGatewayFirewallModeDetection, - ApplicationGatewayFirewallModePrevention, - } -} - -// ApplicationGatewayLoadDistributionAlgorithm - Load Distribution Algorithm enums. -type ApplicationGatewayLoadDistributionAlgorithm string - -const ( - ApplicationGatewayLoadDistributionAlgorithmIPHash ApplicationGatewayLoadDistributionAlgorithm = "IpHash" - ApplicationGatewayLoadDistributionAlgorithmLeastConnections ApplicationGatewayLoadDistributionAlgorithm = "LeastConnections" - ApplicationGatewayLoadDistributionAlgorithmRoundRobin ApplicationGatewayLoadDistributionAlgorithm = "RoundRobin" -) - -// PossibleApplicationGatewayLoadDistributionAlgorithmValues returns the possible values for the ApplicationGatewayLoadDistributionAlgorithm const type. -func PossibleApplicationGatewayLoadDistributionAlgorithmValues() []ApplicationGatewayLoadDistributionAlgorithm { - return []ApplicationGatewayLoadDistributionAlgorithm{ - ApplicationGatewayLoadDistributionAlgorithmIPHash, - ApplicationGatewayLoadDistributionAlgorithmLeastConnections, - ApplicationGatewayLoadDistributionAlgorithmRoundRobin, - } -} - -// ApplicationGatewayOperationalState - Operational state of the application gateway resource. -type ApplicationGatewayOperationalState string - -const ( - ApplicationGatewayOperationalStateRunning ApplicationGatewayOperationalState = "Running" - ApplicationGatewayOperationalStateStarting ApplicationGatewayOperationalState = "Starting" - ApplicationGatewayOperationalStateStopped ApplicationGatewayOperationalState = "Stopped" - ApplicationGatewayOperationalStateStopping ApplicationGatewayOperationalState = "Stopping" -) - -// PossibleApplicationGatewayOperationalStateValues returns the possible values for the ApplicationGatewayOperationalState const type. -func PossibleApplicationGatewayOperationalStateValues() []ApplicationGatewayOperationalState { - return []ApplicationGatewayOperationalState{ - ApplicationGatewayOperationalStateRunning, - ApplicationGatewayOperationalStateStarting, - ApplicationGatewayOperationalStateStopped, - ApplicationGatewayOperationalStateStopping, - } -} - -// ApplicationGatewayProtocol - Application Gateway protocol. -type ApplicationGatewayProtocol string - -const ( - ApplicationGatewayProtocolHTTP ApplicationGatewayProtocol = "Http" - ApplicationGatewayProtocolHTTPS ApplicationGatewayProtocol = "Https" - ApplicationGatewayProtocolTCP ApplicationGatewayProtocol = "Tcp" - ApplicationGatewayProtocolTLS ApplicationGatewayProtocol = "Tls" -) - -// PossibleApplicationGatewayProtocolValues returns the possible values for the ApplicationGatewayProtocol const type. -func PossibleApplicationGatewayProtocolValues() []ApplicationGatewayProtocol { - return []ApplicationGatewayProtocol{ - ApplicationGatewayProtocolHTTP, - ApplicationGatewayProtocolHTTPS, - ApplicationGatewayProtocolTCP, - ApplicationGatewayProtocolTLS, - } -} - -// ApplicationGatewayRedirectType - Redirect type enum. -type ApplicationGatewayRedirectType string - -const ( - ApplicationGatewayRedirectTypeFound ApplicationGatewayRedirectType = "Found" - ApplicationGatewayRedirectTypePermanent ApplicationGatewayRedirectType = "Permanent" - ApplicationGatewayRedirectTypeSeeOther ApplicationGatewayRedirectType = "SeeOther" - ApplicationGatewayRedirectTypeTemporary ApplicationGatewayRedirectType = "Temporary" -) - -// PossibleApplicationGatewayRedirectTypeValues returns the possible values for the ApplicationGatewayRedirectType const type. -func PossibleApplicationGatewayRedirectTypeValues() []ApplicationGatewayRedirectType { - return []ApplicationGatewayRedirectType{ - ApplicationGatewayRedirectTypeFound, - ApplicationGatewayRedirectTypePermanent, - ApplicationGatewayRedirectTypeSeeOther, - ApplicationGatewayRedirectTypeTemporary, - } -} - -// ApplicationGatewayRequestRoutingRuleType - Rule type. -type ApplicationGatewayRequestRoutingRuleType string - -const ( - ApplicationGatewayRequestRoutingRuleTypeBasic ApplicationGatewayRequestRoutingRuleType = "Basic" - ApplicationGatewayRequestRoutingRuleTypePathBasedRouting ApplicationGatewayRequestRoutingRuleType = "PathBasedRouting" -) - -// PossibleApplicationGatewayRequestRoutingRuleTypeValues returns the possible values for the ApplicationGatewayRequestRoutingRuleType const type. -func PossibleApplicationGatewayRequestRoutingRuleTypeValues() []ApplicationGatewayRequestRoutingRuleType { - return []ApplicationGatewayRequestRoutingRuleType{ - ApplicationGatewayRequestRoutingRuleTypeBasic, - ApplicationGatewayRequestRoutingRuleTypePathBasedRouting, - } -} - -// ApplicationGatewaySKUName - Name of an application gateway SKU. -type ApplicationGatewaySKUName string - -const ( - ApplicationGatewaySKUNameStandardLarge ApplicationGatewaySKUName = "Standard_Large" - ApplicationGatewaySKUNameStandardMedium ApplicationGatewaySKUName = "Standard_Medium" - ApplicationGatewaySKUNameStandardSmall ApplicationGatewaySKUName = "Standard_Small" - ApplicationGatewaySKUNameStandardV2 ApplicationGatewaySKUName = "Standard_v2" - ApplicationGatewaySKUNameWAFLarge ApplicationGatewaySKUName = "WAF_Large" - ApplicationGatewaySKUNameWAFMedium ApplicationGatewaySKUName = "WAF_Medium" - ApplicationGatewaySKUNameWAFV2 ApplicationGatewaySKUName = "WAF_v2" -) - -// PossibleApplicationGatewaySKUNameValues returns the possible values for the ApplicationGatewaySKUName const type. -func PossibleApplicationGatewaySKUNameValues() []ApplicationGatewaySKUName { - return []ApplicationGatewaySKUName{ - ApplicationGatewaySKUNameStandardLarge, - ApplicationGatewaySKUNameStandardMedium, - ApplicationGatewaySKUNameStandardSmall, - ApplicationGatewaySKUNameStandardV2, - ApplicationGatewaySKUNameWAFLarge, - ApplicationGatewaySKUNameWAFMedium, - ApplicationGatewaySKUNameWAFV2, - } -} - -// ApplicationGatewaySSLCipherSuite - Ssl cipher suites enums. -type ApplicationGatewaySSLCipherSuite string - -const ( - ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITH3DESEDECBCSHA ApplicationGatewaySSLCipherSuite = "TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA" - ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITHAES128CBCSHA ApplicationGatewaySSLCipherSuite = "TLS_DHE_DSS_WITH_AES_128_CBC_SHA" - ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITHAES128CBCSHA256 ApplicationGatewaySSLCipherSuite = "TLS_DHE_DSS_WITH_AES_128_CBC_SHA256" - ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITHAES256CBCSHA ApplicationGatewaySSLCipherSuite = "TLS_DHE_DSS_WITH_AES_256_CBC_SHA" - ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITHAES256CBCSHA256 ApplicationGatewaySSLCipherSuite = "TLS_DHE_DSS_WITH_AES_256_CBC_SHA256" - ApplicationGatewaySSLCipherSuiteTLSDHERSAWITHAES128CBCSHA ApplicationGatewaySSLCipherSuite = "TLS_DHE_RSA_WITH_AES_128_CBC_SHA" - ApplicationGatewaySSLCipherSuiteTLSDHERSAWITHAES128GCMSHA256 ApplicationGatewaySSLCipherSuite = "TLS_DHE_RSA_WITH_AES_128_GCM_SHA256" - ApplicationGatewaySSLCipherSuiteTLSDHERSAWITHAES256CBCSHA ApplicationGatewaySSLCipherSuite = "TLS_DHE_RSA_WITH_AES_256_CBC_SHA" - ApplicationGatewaySSLCipherSuiteTLSDHERSAWITHAES256GCMSHA384 ApplicationGatewaySSLCipherSuite = "TLS_DHE_RSA_WITH_AES_256_GCM_SHA384" - ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES128CBCSHA ApplicationGatewaySSLCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA" - ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES128CBCSHA256 ApplicationGatewaySSLCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256" - ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES128GCMSHA256 ApplicationGatewaySSLCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256" - ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES256CBCSHA ApplicationGatewaySSLCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA" - ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES256CBCSHA384 ApplicationGatewaySSLCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384" - ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES256GCMSHA384 ApplicationGatewaySSLCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384" - ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128CBCSHA ApplicationGatewaySSLCipherSuite = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA" - ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128CBCSHA256 ApplicationGatewaySSLCipherSuite = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256" - ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128GCMSHA256 ApplicationGatewaySSLCipherSuite = "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256" - ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES256CBCSHA ApplicationGatewaySSLCipherSuite = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA" - ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES256CBCSHA384 ApplicationGatewaySSLCipherSuite = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384" - ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES256GCMSHA384 ApplicationGatewaySSLCipherSuite = "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384" - ApplicationGatewaySSLCipherSuiteTLSRSAWITH3DESEDECBCSHA ApplicationGatewaySSLCipherSuite = "TLS_RSA_WITH_3DES_EDE_CBC_SHA" - ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES128CBCSHA ApplicationGatewaySSLCipherSuite = "TLS_RSA_WITH_AES_128_CBC_SHA" - ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES128CBCSHA256 ApplicationGatewaySSLCipherSuite = "TLS_RSA_WITH_AES_128_CBC_SHA256" - ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES128GCMSHA256 ApplicationGatewaySSLCipherSuite = "TLS_RSA_WITH_AES_128_GCM_SHA256" - ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES256CBCSHA ApplicationGatewaySSLCipherSuite = "TLS_RSA_WITH_AES_256_CBC_SHA" - ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES256CBCSHA256 ApplicationGatewaySSLCipherSuite = "TLS_RSA_WITH_AES_256_CBC_SHA256" - ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES256GCMSHA384 ApplicationGatewaySSLCipherSuite = "TLS_RSA_WITH_AES_256_GCM_SHA384" -) - -// PossibleApplicationGatewaySSLCipherSuiteValues returns the possible values for the ApplicationGatewaySSLCipherSuite const type. -func PossibleApplicationGatewaySSLCipherSuiteValues() []ApplicationGatewaySSLCipherSuite { - return []ApplicationGatewaySSLCipherSuite{ - ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITH3DESEDECBCSHA, - ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITHAES128CBCSHA, - ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITHAES128CBCSHA256, - ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITHAES256CBCSHA, - ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITHAES256CBCSHA256, - ApplicationGatewaySSLCipherSuiteTLSDHERSAWITHAES128CBCSHA, - ApplicationGatewaySSLCipherSuiteTLSDHERSAWITHAES128GCMSHA256, - ApplicationGatewaySSLCipherSuiteTLSDHERSAWITHAES256CBCSHA, - ApplicationGatewaySSLCipherSuiteTLSDHERSAWITHAES256GCMSHA384, - ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES128CBCSHA, - ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES128CBCSHA256, - ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES128GCMSHA256, - ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES256CBCSHA, - ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES256CBCSHA384, - ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES256GCMSHA384, - ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128CBCSHA, - ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128CBCSHA256, - ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128GCMSHA256, - ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES256CBCSHA, - ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES256CBCSHA384, - ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES256GCMSHA384, - ApplicationGatewaySSLCipherSuiteTLSRSAWITH3DESEDECBCSHA, - ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES128CBCSHA, - ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES128CBCSHA256, - ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES128GCMSHA256, - ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES256CBCSHA, - ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES256CBCSHA256, - ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES256GCMSHA384, - } -} - -// ApplicationGatewaySSLPolicyName - Ssl predefined policy name enums. -type ApplicationGatewaySSLPolicyName string - -const ( - ApplicationGatewaySSLPolicyNameAppGwSSLPolicy20150501 ApplicationGatewaySSLPolicyName = "AppGwSslPolicy20150501" - ApplicationGatewaySSLPolicyNameAppGwSSLPolicy20170401 ApplicationGatewaySSLPolicyName = "AppGwSslPolicy20170401" - ApplicationGatewaySSLPolicyNameAppGwSSLPolicy20170401S ApplicationGatewaySSLPolicyName = "AppGwSslPolicy20170401S" - ApplicationGatewaySSLPolicyNameAppGwSSLPolicy20220101 ApplicationGatewaySSLPolicyName = "AppGwSslPolicy20220101" - ApplicationGatewaySSLPolicyNameAppGwSSLPolicy20220101S ApplicationGatewaySSLPolicyName = "AppGwSslPolicy20220101S" -) - -// PossibleApplicationGatewaySSLPolicyNameValues returns the possible values for the ApplicationGatewaySSLPolicyName const type. -func PossibleApplicationGatewaySSLPolicyNameValues() []ApplicationGatewaySSLPolicyName { - return []ApplicationGatewaySSLPolicyName{ - ApplicationGatewaySSLPolicyNameAppGwSSLPolicy20150501, - ApplicationGatewaySSLPolicyNameAppGwSSLPolicy20170401, - ApplicationGatewaySSLPolicyNameAppGwSSLPolicy20170401S, - ApplicationGatewaySSLPolicyNameAppGwSSLPolicy20220101, - ApplicationGatewaySSLPolicyNameAppGwSSLPolicy20220101S, - } -} - -// ApplicationGatewaySSLPolicyType - Type of Ssl Policy. -type ApplicationGatewaySSLPolicyType string - -const ( - ApplicationGatewaySSLPolicyTypeCustom ApplicationGatewaySSLPolicyType = "Custom" - ApplicationGatewaySSLPolicyTypeCustomV2 ApplicationGatewaySSLPolicyType = "CustomV2" - ApplicationGatewaySSLPolicyTypePredefined ApplicationGatewaySSLPolicyType = "Predefined" -) - -// PossibleApplicationGatewaySSLPolicyTypeValues returns the possible values for the ApplicationGatewaySSLPolicyType const type. -func PossibleApplicationGatewaySSLPolicyTypeValues() []ApplicationGatewaySSLPolicyType { - return []ApplicationGatewaySSLPolicyType{ - ApplicationGatewaySSLPolicyTypeCustom, - ApplicationGatewaySSLPolicyTypeCustomV2, - ApplicationGatewaySSLPolicyTypePredefined, - } -} - -// ApplicationGatewaySSLProtocol - Ssl protocol enums. -type ApplicationGatewaySSLProtocol string - -const ( - ApplicationGatewaySSLProtocolTLSv10 ApplicationGatewaySSLProtocol = "TLSv1_0" - ApplicationGatewaySSLProtocolTLSv11 ApplicationGatewaySSLProtocol = "TLSv1_1" - ApplicationGatewaySSLProtocolTLSv12 ApplicationGatewaySSLProtocol = "TLSv1_2" - ApplicationGatewaySSLProtocolTLSv13 ApplicationGatewaySSLProtocol = "TLSv1_3" -) - -// PossibleApplicationGatewaySSLProtocolValues returns the possible values for the ApplicationGatewaySSLProtocol const type. -func PossibleApplicationGatewaySSLProtocolValues() []ApplicationGatewaySSLProtocol { - return []ApplicationGatewaySSLProtocol{ - ApplicationGatewaySSLProtocolTLSv10, - ApplicationGatewaySSLProtocolTLSv11, - ApplicationGatewaySSLProtocolTLSv12, - ApplicationGatewaySSLProtocolTLSv13, - } -} - -// ApplicationGatewayTier - Tier of an application gateway. -type ApplicationGatewayTier string - -const ( - ApplicationGatewayTierStandard ApplicationGatewayTier = "Standard" - ApplicationGatewayTierStandardV2 ApplicationGatewayTier = "Standard_v2" - ApplicationGatewayTierWAF ApplicationGatewayTier = "WAF" - ApplicationGatewayTierWAFV2 ApplicationGatewayTier = "WAF_v2" -) - -// PossibleApplicationGatewayTierValues returns the possible values for the ApplicationGatewayTier const type. -func PossibleApplicationGatewayTierValues() []ApplicationGatewayTier { - return []ApplicationGatewayTier{ - ApplicationGatewayTierStandard, - ApplicationGatewayTierStandardV2, - ApplicationGatewayTierWAF, - ApplicationGatewayTierWAFV2, - } -} - -// AssociationType - The association type of the child resource to the parent resource. -type AssociationType string - -const ( - AssociationTypeAssociated AssociationType = "Associated" - AssociationTypeContains AssociationType = "Contains" -) - -// PossibleAssociationTypeValues returns the possible values for the AssociationType const type. -func PossibleAssociationTypeValues() []AssociationType { - return []AssociationType{ - AssociationTypeAssociated, - AssociationTypeContains, - } -} - -// AuthenticationMethod - VPN client authentication method. -type AuthenticationMethod string - -const ( - AuthenticationMethodEAPMSCHAPv2 AuthenticationMethod = "EAPMSCHAPv2" - AuthenticationMethodEAPTLS AuthenticationMethod = "EAPTLS" -) - -// PossibleAuthenticationMethodValues returns the possible values for the AuthenticationMethod const type. -func PossibleAuthenticationMethodValues() []AuthenticationMethod { - return []AuthenticationMethod{ - AuthenticationMethodEAPMSCHAPv2, - AuthenticationMethodEAPTLS, - } -} - -// AuthorizationUseStatus - The authorization use status. -type AuthorizationUseStatus string - -const ( - AuthorizationUseStatusAvailable AuthorizationUseStatus = "Available" - AuthorizationUseStatusInUse AuthorizationUseStatus = "InUse" -) - -// PossibleAuthorizationUseStatusValues returns the possible values for the AuthorizationUseStatus const type. -func PossibleAuthorizationUseStatusValues() []AuthorizationUseStatus { - return []AuthorizationUseStatus{ - AuthorizationUseStatusAvailable, - AuthorizationUseStatusInUse, - } -} - -// AutoLearnPrivateRangesMode - The operation mode for automatically learning private ranges to not be SNAT -type AutoLearnPrivateRangesMode string - -const ( - AutoLearnPrivateRangesModeDisabled AutoLearnPrivateRangesMode = "Disabled" - AutoLearnPrivateRangesModeEnabled AutoLearnPrivateRangesMode = "Enabled" -) - -// PossibleAutoLearnPrivateRangesModeValues returns the possible values for the AutoLearnPrivateRangesMode const type. -func PossibleAutoLearnPrivateRangesModeValues() []AutoLearnPrivateRangesMode { - return []AutoLearnPrivateRangesMode{ - AutoLearnPrivateRangesModeDisabled, - AutoLearnPrivateRangesModeEnabled, - } -} - -// AzureFirewallApplicationRuleProtocolType - The protocol type of a Application Rule resource. -type AzureFirewallApplicationRuleProtocolType string - -const ( - AzureFirewallApplicationRuleProtocolTypeHTTP AzureFirewallApplicationRuleProtocolType = "Http" - AzureFirewallApplicationRuleProtocolTypeHTTPS AzureFirewallApplicationRuleProtocolType = "Https" - AzureFirewallApplicationRuleProtocolTypeMssql AzureFirewallApplicationRuleProtocolType = "Mssql" -) - -// PossibleAzureFirewallApplicationRuleProtocolTypeValues returns the possible values for the AzureFirewallApplicationRuleProtocolType const type. -func PossibleAzureFirewallApplicationRuleProtocolTypeValues() []AzureFirewallApplicationRuleProtocolType { - return []AzureFirewallApplicationRuleProtocolType{ - AzureFirewallApplicationRuleProtocolTypeHTTP, - AzureFirewallApplicationRuleProtocolTypeHTTPS, - AzureFirewallApplicationRuleProtocolTypeMssql, - } -} - -// AzureFirewallNatRCActionType - The action type of a NAT rule collection. -type AzureFirewallNatRCActionType string - -const ( - AzureFirewallNatRCActionTypeDnat AzureFirewallNatRCActionType = "Dnat" - AzureFirewallNatRCActionTypeSnat AzureFirewallNatRCActionType = "Snat" -) - -// PossibleAzureFirewallNatRCActionTypeValues returns the possible values for the AzureFirewallNatRCActionType const type. -func PossibleAzureFirewallNatRCActionTypeValues() []AzureFirewallNatRCActionType { - return []AzureFirewallNatRCActionType{ - AzureFirewallNatRCActionTypeDnat, - AzureFirewallNatRCActionTypeSnat, - } -} - -// AzureFirewallNetworkRuleProtocol - The protocol of a Network Rule resource. -type AzureFirewallNetworkRuleProtocol string - -const ( - AzureFirewallNetworkRuleProtocolAny AzureFirewallNetworkRuleProtocol = "Any" - AzureFirewallNetworkRuleProtocolICMP AzureFirewallNetworkRuleProtocol = "ICMP" - AzureFirewallNetworkRuleProtocolTCP AzureFirewallNetworkRuleProtocol = "TCP" - AzureFirewallNetworkRuleProtocolUDP AzureFirewallNetworkRuleProtocol = "UDP" -) - -// PossibleAzureFirewallNetworkRuleProtocolValues returns the possible values for the AzureFirewallNetworkRuleProtocol const type. -func PossibleAzureFirewallNetworkRuleProtocolValues() []AzureFirewallNetworkRuleProtocol { - return []AzureFirewallNetworkRuleProtocol{ - AzureFirewallNetworkRuleProtocolAny, - AzureFirewallNetworkRuleProtocolICMP, - AzureFirewallNetworkRuleProtocolTCP, - AzureFirewallNetworkRuleProtocolUDP, - } -} - -// AzureFirewallRCActionType - The action type of a rule collection. -type AzureFirewallRCActionType string - -const ( - AzureFirewallRCActionTypeAllow AzureFirewallRCActionType = "Allow" - AzureFirewallRCActionTypeDeny AzureFirewallRCActionType = "Deny" -) - -// PossibleAzureFirewallRCActionTypeValues returns the possible values for the AzureFirewallRCActionType const type. -func PossibleAzureFirewallRCActionTypeValues() []AzureFirewallRCActionType { - return []AzureFirewallRCActionType{ - AzureFirewallRCActionTypeAllow, - AzureFirewallRCActionTypeDeny, - } -} - -// AzureFirewallSKUName - Name of an Azure Firewall SKU. -type AzureFirewallSKUName string - -const ( - AzureFirewallSKUNameAZFWHub AzureFirewallSKUName = "AZFW_Hub" - AzureFirewallSKUNameAZFWVnet AzureFirewallSKUName = "AZFW_VNet" -) - -// PossibleAzureFirewallSKUNameValues returns the possible values for the AzureFirewallSKUName const type. -func PossibleAzureFirewallSKUNameValues() []AzureFirewallSKUName { - return []AzureFirewallSKUName{ - AzureFirewallSKUNameAZFWHub, - AzureFirewallSKUNameAZFWVnet, - } -} - -// AzureFirewallSKUTier - Tier of an Azure Firewall. -type AzureFirewallSKUTier string - -const ( - AzureFirewallSKUTierBasic AzureFirewallSKUTier = "Basic" - AzureFirewallSKUTierPremium AzureFirewallSKUTier = "Premium" - AzureFirewallSKUTierStandard AzureFirewallSKUTier = "Standard" -) - -// PossibleAzureFirewallSKUTierValues returns the possible values for the AzureFirewallSKUTier const type. -func PossibleAzureFirewallSKUTierValues() []AzureFirewallSKUTier { - return []AzureFirewallSKUTier{ - AzureFirewallSKUTierBasic, - AzureFirewallSKUTierPremium, - AzureFirewallSKUTierStandard, - } -} - -// AzureFirewallThreatIntelMode - The operation mode for Threat Intel. -type AzureFirewallThreatIntelMode string - -const ( - AzureFirewallThreatIntelModeAlert AzureFirewallThreatIntelMode = "Alert" - AzureFirewallThreatIntelModeDeny AzureFirewallThreatIntelMode = "Deny" - AzureFirewallThreatIntelModeOff AzureFirewallThreatIntelMode = "Off" -) - -// PossibleAzureFirewallThreatIntelModeValues returns the possible values for the AzureFirewallThreatIntelMode const type. -func PossibleAzureFirewallThreatIntelModeValues() []AzureFirewallThreatIntelMode { - return []AzureFirewallThreatIntelMode{ - AzureFirewallThreatIntelModeAlert, - AzureFirewallThreatIntelModeDeny, - AzureFirewallThreatIntelModeOff, - } -} - -// BastionConnectProtocol - The protocol used to connect to the target. -type BastionConnectProtocol string - -const ( - BastionConnectProtocolRDP BastionConnectProtocol = "RDP" - BastionConnectProtocolSSH BastionConnectProtocol = "SSH" -) - -// PossibleBastionConnectProtocolValues returns the possible values for the BastionConnectProtocol const type. -func PossibleBastionConnectProtocolValues() []BastionConnectProtocol { - return []BastionConnectProtocol{ - BastionConnectProtocolRDP, - BastionConnectProtocolSSH, - } -} - -// BastionHostSKUName - The name of this Bastion Host. -type BastionHostSKUName string - -const ( - BastionHostSKUNameBasic BastionHostSKUName = "Basic" - BastionHostSKUNameStandard BastionHostSKUName = "Standard" -) - -// PossibleBastionHostSKUNameValues returns the possible values for the BastionHostSKUName const type. -func PossibleBastionHostSKUNameValues() []BastionHostSKUName { - return []BastionHostSKUName{ - BastionHostSKUNameBasic, - BastionHostSKUNameStandard, - } -} - -// BgpPeerState - The BGP peer state. -type BgpPeerState string - -const ( - BgpPeerStateConnected BgpPeerState = "Connected" - BgpPeerStateConnecting BgpPeerState = "Connecting" - BgpPeerStateIdle BgpPeerState = "Idle" - BgpPeerStateStopped BgpPeerState = "Stopped" - BgpPeerStateUnknown BgpPeerState = "Unknown" -) - -// PossibleBgpPeerStateValues returns the possible values for the BgpPeerState const type. -func PossibleBgpPeerStateValues() []BgpPeerState { - return []BgpPeerState{ - BgpPeerStateConnected, - BgpPeerStateConnecting, - BgpPeerStateIdle, - BgpPeerStateStopped, - BgpPeerStateUnknown, - } -} - -// CircuitConnectionStatus - Express Route Circuit connection state. -type CircuitConnectionStatus string - -const ( - CircuitConnectionStatusConnected CircuitConnectionStatus = "Connected" - CircuitConnectionStatusConnecting CircuitConnectionStatus = "Connecting" - CircuitConnectionStatusDisconnected CircuitConnectionStatus = "Disconnected" -) - -// PossibleCircuitConnectionStatusValues returns the possible values for the CircuitConnectionStatus const type. -func PossibleCircuitConnectionStatusValues() []CircuitConnectionStatus { - return []CircuitConnectionStatus{ - CircuitConnectionStatusConnected, - CircuitConnectionStatusConnecting, - CircuitConnectionStatusDisconnected, - } -} - -// CommissionedState - The commissioned state of the Custom IP Prefix. -type CommissionedState string - -const ( - CommissionedStateCommissioned CommissionedState = "Commissioned" - CommissionedStateCommissionedNoInternetAdvertise CommissionedState = "CommissionedNoInternetAdvertise" - CommissionedStateCommissioning CommissionedState = "Commissioning" - CommissionedStateDecommissioning CommissionedState = "Decommissioning" - CommissionedStateDeprovisioning CommissionedState = "Deprovisioning" - CommissionedStateProvisioned CommissionedState = "Provisioned" - CommissionedStateProvisioning CommissionedState = "Provisioning" -) - -// PossibleCommissionedStateValues returns the possible values for the CommissionedState const type. -func PossibleCommissionedStateValues() []CommissionedState { - return []CommissionedState{ - CommissionedStateCommissioned, - CommissionedStateCommissionedNoInternetAdvertise, - CommissionedStateCommissioning, - CommissionedStateDecommissioning, - CommissionedStateDeprovisioning, - CommissionedStateProvisioned, - CommissionedStateProvisioning, - } -} - -// ConfigurationType - Configuration Deployment Type. -type ConfigurationType string - -const ( - ConfigurationTypeConnectivity ConfigurationType = "Connectivity" - ConfigurationTypeSecurityAdmin ConfigurationType = "SecurityAdmin" -) - -// PossibleConfigurationTypeValues returns the possible values for the ConfigurationType const type. -func PossibleConfigurationTypeValues() []ConfigurationType { - return []ConfigurationType{ - ConfigurationTypeConnectivity, - ConfigurationTypeSecurityAdmin, - } -} - -// ConnectionMonitorEndpointFilterItemType - The type of item included in the filter. Currently only 'AgentAddress' is supported. -type ConnectionMonitorEndpointFilterItemType string - -const ( - ConnectionMonitorEndpointFilterItemTypeAgentAddress ConnectionMonitorEndpointFilterItemType = "AgentAddress" -) - -// PossibleConnectionMonitorEndpointFilterItemTypeValues returns the possible values for the ConnectionMonitorEndpointFilterItemType const type. -func PossibleConnectionMonitorEndpointFilterItemTypeValues() []ConnectionMonitorEndpointFilterItemType { - return []ConnectionMonitorEndpointFilterItemType{ - ConnectionMonitorEndpointFilterItemTypeAgentAddress, - } -} - -// ConnectionMonitorEndpointFilterType - The behavior of the endpoint filter. Currently only 'Include' is supported. -type ConnectionMonitorEndpointFilterType string - -const ( - ConnectionMonitorEndpointFilterTypeInclude ConnectionMonitorEndpointFilterType = "Include" -) - -// PossibleConnectionMonitorEndpointFilterTypeValues returns the possible values for the ConnectionMonitorEndpointFilterType const type. -func PossibleConnectionMonitorEndpointFilterTypeValues() []ConnectionMonitorEndpointFilterType { - return []ConnectionMonitorEndpointFilterType{ - ConnectionMonitorEndpointFilterTypeInclude, - } -} - -// ConnectionMonitorSourceStatus - Status of connection monitor source. -type ConnectionMonitorSourceStatus string - -const ( - ConnectionMonitorSourceStatusActive ConnectionMonitorSourceStatus = "Active" - ConnectionMonitorSourceStatusInactive ConnectionMonitorSourceStatus = "Inactive" - ConnectionMonitorSourceStatusUnknown ConnectionMonitorSourceStatus = "Unknown" -) - -// PossibleConnectionMonitorSourceStatusValues returns the possible values for the ConnectionMonitorSourceStatus const type. -func PossibleConnectionMonitorSourceStatusValues() []ConnectionMonitorSourceStatus { - return []ConnectionMonitorSourceStatus{ - ConnectionMonitorSourceStatusActive, - ConnectionMonitorSourceStatusInactive, - ConnectionMonitorSourceStatusUnknown, - } -} - -// ConnectionMonitorTestConfigurationProtocol - The protocol to use in test evaluation. -type ConnectionMonitorTestConfigurationProtocol string - -const ( - ConnectionMonitorTestConfigurationProtocolHTTP ConnectionMonitorTestConfigurationProtocol = "Http" - ConnectionMonitorTestConfigurationProtocolIcmp ConnectionMonitorTestConfigurationProtocol = "Icmp" - ConnectionMonitorTestConfigurationProtocolTCP ConnectionMonitorTestConfigurationProtocol = "Tcp" -) - -// PossibleConnectionMonitorTestConfigurationProtocolValues returns the possible values for the ConnectionMonitorTestConfigurationProtocol const type. -func PossibleConnectionMonitorTestConfigurationProtocolValues() []ConnectionMonitorTestConfigurationProtocol { - return []ConnectionMonitorTestConfigurationProtocol{ - ConnectionMonitorTestConfigurationProtocolHTTP, - ConnectionMonitorTestConfigurationProtocolIcmp, - ConnectionMonitorTestConfigurationProtocolTCP, - } -} - -// ConnectionMonitorType - Type of connection monitor. -type ConnectionMonitorType string - -const ( - ConnectionMonitorTypeMultiEndpoint ConnectionMonitorType = "MultiEndpoint" - ConnectionMonitorTypeSingleSourceDestination ConnectionMonitorType = "SingleSourceDestination" -) - -// PossibleConnectionMonitorTypeValues returns the possible values for the ConnectionMonitorType const type. -func PossibleConnectionMonitorTypeValues() []ConnectionMonitorType { - return []ConnectionMonitorType{ - ConnectionMonitorTypeMultiEndpoint, - ConnectionMonitorTypeSingleSourceDestination, - } -} - -// ConnectionState - The connection state. -type ConnectionState string - -const ( - ConnectionStateReachable ConnectionState = "Reachable" - ConnectionStateUnknown ConnectionState = "Unknown" - ConnectionStateUnreachable ConnectionState = "Unreachable" -) - -// PossibleConnectionStateValues returns the possible values for the ConnectionState const type. -func PossibleConnectionStateValues() []ConnectionState { - return []ConnectionState{ - ConnectionStateReachable, - ConnectionStateUnknown, - ConnectionStateUnreachable, - } -} - -// ConnectionStatus - The connection status. -type ConnectionStatus string - -const ( - ConnectionStatusConnected ConnectionStatus = "Connected" - ConnectionStatusDegraded ConnectionStatus = "Degraded" - ConnectionStatusDisconnected ConnectionStatus = "Disconnected" - ConnectionStatusUnknown ConnectionStatus = "Unknown" -) - -// PossibleConnectionStatusValues returns the possible values for the ConnectionStatus const type. -func PossibleConnectionStatusValues() []ConnectionStatus { - return []ConnectionStatus{ - ConnectionStatusConnected, - ConnectionStatusDegraded, - ConnectionStatusDisconnected, - ConnectionStatusUnknown, - } -} - -// ConnectivityTopology - Connectivity topology type. -type ConnectivityTopology string - -const ( - ConnectivityTopologyHubAndSpoke ConnectivityTopology = "HubAndSpoke" - ConnectivityTopologyMesh ConnectivityTopology = "Mesh" -) - -// PossibleConnectivityTopologyValues returns the possible values for the ConnectivityTopology const type. -func PossibleConnectivityTopologyValues() []ConnectivityTopology { - return []ConnectivityTopology{ - ConnectivityTopologyHubAndSpoke, - ConnectivityTopologyMesh, - } -} - -// CoverageLevel - Test coverage for the endpoint. -type CoverageLevel string - -const ( - CoverageLevelAboveAverage CoverageLevel = "AboveAverage" - CoverageLevelAverage CoverageLevel = "Average" - CoverageLevelBelowAverage CoverageLevel = "BelowAverage" - CoverageLevelDefault CoverageLevel = "Default" - CoverageLevelFull CoverageLevel = "Full" - CoverageLevelLow CoverageLevel = "Low" -) - -// PossibleCoverageLevelValues returns the possible values for the CoverageLevel const type. -func PossibleCoverageLevelValues() []CoverageLevel { - return []CoverageLevel{ - CoverageLevelAboveAverage, - CoverageLevelAverage, - CoverageLevelBelowAverage, - CoverageLevelDefault, - CoverageLevelFull, - CoverageLevelLow, - } -} - -// CreatedByType - The type of identity that created the resource. -type CreatedByType string - -const ( - CreatedByTypeApplication CreatedByType = "Application" - CreatedByTypeKey CreatedByType = "Key" - CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity" - CreatedByTypeUser CreatedByType = "User" -) - -// PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type. -func PossibleCreatedByTypeValues() []CreatedByType { - return []CreatedByType{ - CreatedByTypeApplication, - CreatedByTypeKey, - CreatedByTypeManagedIdentity, - CreatedByTypeUser, - } -} - -// DdosCustomPolicyProtocol - The protocol for which the DDoS protection policy is being customized. -type DdosCustomPolicyProtocol string - -const ( - DdosCustomPolicyProtocolSyn DdosCustomPolicyProtocol = "Syn" - DdosCustomPolicyProtocolTCP DdosCustomPolicyProtocol = "Tcp" - DdosCustomPolicyProtocolUDP DdosCustomPolicyProtocol = "Udp" -) - -// PossibleDdosCustomPolicyProtocolValues returns the possible values for the DdosCustomPolicyProtocol const type. -func PossibleDdosCustomPolicyProtocolValues() []DdosCustomPolicyProtocol { - return []DdosCustomPolicyProtocol{ - DdosCustomPolicyProtocolSyn, - DdosCustomPolicyProtocolTCP, - DdosCustomPolicyProtocolUDP, - } -} - -// DdosCustomPolicyTriggerSensitivityOverride - The customized DDoS protection trigger rate sensitivity degrees. High: Trigger -// rate set with most sensitivity w.r.t. normal traffic. Default: Trigger rate set with moderate sensitivity w.r.t. normal -// traffic. Low: Trigger rate set with less sensitivity w.r.t. normal traffic. Relaxed: Trigger rate set with least sensitivity -// w.r.t. normal traffic. -type DdosCustomPolicyTriggerSensitivityOverride string - -const ( - DdosCustomPolicyTriggerSensitivityOverrideDefault DdosCustomPolicyTriggerSensitivityOverride = "Default" - DdosCustomPolicyTriggerSensitivityOverrideHigh DdosCustomPolicyTriggerSensitivityOverride = "High" - DdosCustomPolicyTriggerSensitivityOverrideLow DdosCustomPolicyTriggerSensitivityOverride = "Low" - DdosCustomPolicyTriggerSensitivityOverrideRelaxed DdosCustomPolicyTriggerSensitivityOverride = "Relaxed" -) - -// PossibleDdosCustomPolicyTriggerSensitivityOverrideValues returns the possible values for the DdosCustomPolicyTriggerSensitivityOverride const type. -func PossibleDdosCustomPolicyTriggerSensitivityOverrideValues() []DdosCustomPolicyTriggerSensitivityOverride { - return []DdosCustomPolicyTriggerSensitivityOverride{ - DdosCustomPolicyTriggerSensitivityOverrideDefault, - DdosCustomPolicyTriggerSensitivityOverrideHigh, - DdosCustomPolicyTriggerSensitivityOverrideLow, - DdosCustomPolicyTriggerSensitivityOverrideRelaxed, - } -} - -// DdosSettingsProtectionCoverage - The DDoS protection policy customizability of the public IP. Only standard coverage will -// have the ability to be customized. -type DdosSettingsProtectionCoverage string - -const ( - DdosSettingsProtectionCoverageBasic DdosSettingsProtectionCoverage = "Basic" - DdosSettingsProtectionCoverageStandard DdosSettingsProtectionCoverage = "Standard" -) - -// PossibleDdosSettingsProtectionCoverageValues returns the possible values for the DdosSettingsProtectionCoverage const type. -func PossibleDdosSettingsProtectionCoverageValues() []DdosSettingsProtectionCoverage { - return []DdosSettingsProtectionCoverage{ - DdosSettingsProtectionCoverageBasic, - DdosSettingsProtectionCoverageStandard, - } -} - -// DeleteExistingPeering - Flag if need to remove current existing peerings. -type DeleteExistingPeering string - -const ( - DeleteExistingPeeringFalse DeleteExistingPeering = "False" - DeleteExistingPeeringTrue DeleteExistingPeering = "True" -) - -// PossibleDeleteExistingPeeringValues returns the possible values for the DeleteExistingPeering const type. -func PossibleDeleteExistingPeeringValues() []DeleteExistingPeering { - return []DeleteExistingPeering{ - DeleteExistingPeeringFalse, - DeleteExistingPeeringTrue, - } -} - -// DeleteOptions - Specify what happens to the public IP address when the VM using it is deleted -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -// PossibleDeleteOptionsValues returns the possible values for the DeleteOptions const type. -func PossibleDeleteOptionsValues() []DeleteOptions { - return []DeleteOptions{ - DeleteOptionsDelete, - DeleteOptionsDetach, - } -} - -// DeploymentStatus - Deployment Status. -type DeploymentStatus string - -const ( - DeploymentStatusDeployed DeploymentStatus = "Deployed" - DeploymentStatusDeploying DeploymentStatus = "Deploying" - DeploymentStatusFailed DeploymentStatus = "Failed" - DeploymentStatusNotStarted DeploymentStatus = "NotStarted" -) - -// PossibleDeploymentStatusValues returns the possible values for the DeploymentStatus const type. -func PossibleDeploymentStatusValues() []DeploymentStatus { - return []DeploymentStatus{ - DeploymentStatusDeployed, - DeploymentStatusDeploying, - DeploymentStatusFailed, - DeploymentStatusNotStarted, - } -} - -// DestinationPortBehavior - Destination port behavior. -type DestinationPortBehavior string - -const ( - DestinationPortBehaviorListenIfAvailable DestinationPortBehavior = "ListenIfAvailable" - DestinationPortBehaviorNone DestinationPortBehavior = "None" -) - -// PossibleDestinationPortBehaviorValues returns the possible values for the DestinationPortBehavior const type. -func PossibleDestinationPortBehaviorValues() []DestinationPortBehavior { - return []DestinationPortBehavior{ - DestinationPortBehaviorListenIfAvailable, - DestinationPortBehaviorNone, - } -} - -// DhGroup - The DH Groups used in IKE Phase 1 for initial SA. -type DhGroup string - -const ( - DhGroupDHGroup1 DhGroup = "DHGroup1" - DhGroupDHGroup14 DhGroup = "DHGroup14" - DhGroupDHGroup2 DhGroup = "DHGroup2" - DhGroupDHGroup2048 DhGroup = "DHGroup2048" - DhGroupDHGroup24 DhGroup = "DHGroup24" - DhGroupECP256 DhGroup = "ECP256" - DhGroupECP384 DhGroup = "ECP384" - DhGroupNone DhGroup = "None" -) - -// PossibleDhGroupValues returns the possible values for the DhGroup const type. -func PossibleDhGroupValues() []DhGroup { - return []DhGroup{ - DhGroupDHGroup1, - DhGroupDHGroup14, - DhGroupDHGroup2, - DhGroupDHGroup2048, - DhGroupDHGroup24, - DhGroupECP256, - DhGroupECP384, - DhGroupNone, - } -} - -// Direction - The direction of the traffic. -type Direction string - -const ( - DirectionInbound Direction = "Inbound" - DirectionOutbound Direction = "Outbound" -) - -// PossibleDirectionValues returns the possible values for the Direction const type. -func PossibleDirectionValues() []Direction { - return []Direction{ - DirectionInbound, - DirectionOutbound, - } -} - -// EffectiveAdminRuleKind - Whether the rule is custom or default. -type EffectiveAdminRuleKind string - -const ( - EffectiveAdminRuleKindCustom EffectiveAdminRuleKind = "Custom" - EffectiveAdminRuleKindDefault EffectiveAdminRuleKind = "Default" -) - -// PossibleEffectiveAdminRuleKindValues returns the possible values for the EffectiveAdminRuleKind const type. -func PossibleEffectiveAdminRuleKindValues() []EffectiveAdminRuleKind { - return []EffectiveAdminRuleKind{ - EffectiveAdminRuleKindCustom, - EffectiveAdminRuleKindDefault, - } -} - -// EffectiveRouteSource - Who created the route. -type EffectiveRouteSource string - -const ( - EffectiveRouteSourceDefault EffectiveRouteSource = "Default" - EffectiveRouteSourceUnknown EffectiveRouteSource = "Unknown" - EffectiveRouteSourceUser EffectiveRouteSource = "User" - EffectiveRouteSourceVirtualNetworkGateway EffectiveRouteSource = "VirtualNetworkGateway" -) - -// PossibleEffectiveRouteSourceValues returns the possible values for the EffectiveRouteSource const type. -func PossibleEffectiveRouteSourceValues() []EffectiveRouteSource { - return []EffectiveRouteSource{ - EffectiveRouteSourceDefault, - EffectiveRouteSourceUnknown, - EffectiveRouteSourceUser, - EffectiveRouteSourceVirtualNetworkGateway, - } -} - -// EffectiveRouteState - The value of effective route. -type EffectiveRouteState string - -const ( - EffectiveRouteStateActive EffectiveRouteState = "Active" - EffectiveRouteStateInvalid EffectiveRouteState = "Invalid" -) - -// PossibleEffectiveRouteStateValues returns the possible values for the EffectiveRouteState const type. -func PossibleEffectiveRouteStateValues() []EffectiveRouteState { - return []EffectiveRouteState{ - EffectiveRouteStateActive, - EffectiveRouteStateInvalid, - } -} - -// EffectiveSecurityRuleProtocol - The network protocol this rule applies to. -type EffectiveSecurityRuleProtocol string - -const ( - EffectiveSecurityRuleProtocolAll EffectiveSecurityRuleProtocol = "All" - EffectiveSecurityRuleProtocolTCP EffectiveSecurityRuleProtocol = "Tcp" - EffectiveSecurityRuleProtocolUDP EffectiveSecurityRuleProtocol = "Udp" -) - -// PossibleEffectiveSecurityRuleProtocolValues returns the possible values for the EffectiveSecurityRuleProtocol const type. -func PossibleEffectiveSecurityRuleProtocolValues() []EffectiveSecurityRuleProtocol { - return []EffectiveSecurityRuleProtocol{ - EffectiveSecurityRuleProtocolAll, - EffectiveSecurityRuleProtocolTCP, - EffectiveSecurityRuleProtocolUDP, - } -} - -// EndpointType - The endpoint type. -type EndpointType string - -const ( - EndpointTypeAzureArcVM EndpointType = "AzureArcVM" - EndpointTypeAzureSubnet EndpointType = "AzureSubnet" - EndpointTypeAzureVM EndpointType = "AzureVM" - EndpointTypeAzureVMSS EndpointType = "AzureVMSS" - EndpointTypeAzureVNet EndpointType = "AzureVNet" - EndpointTypeExternalAddress EndpointType = "ExternalAddress" - EndpointTypeMMAWorkspaceMachine EndpointType = "MMAWorkspaceMachine" - EndpointTypeMMAWorkspaceNetwork EndpointType = "MMAWorkspaceNetwork" -) - -// PossibleEndpointTypeValues returns the possible values for the EndpointType const type. -func PossibleEndpointTypeValues() []EndpointType { - return []EndpointType{ - EndpointTypeAzureArcVM, - EndpointTypeAzureSubnet, - EndpointTypeAzureVM, - EndpointTypeAzureVMSS, - EndpointTypeAzureVNet, - EndpointTypeExternalAddress, - EndpointTypeMMAWorkspaceMachine, - EndpointTypeMMAWorkspaceNetwork, - } -} - -// EvaluationState - Connectivity analysis evaluation state. -type EvaluationState string - -const ( - EvaluationStateCompleted EvaluationState = "Completed" - EvaluationStateInProgress EvaluationState = "InProgress" - EvaluationStateNotStarted EvaluationState = "NotStarted" -) - -// PossibleEvaluationStateValues returns the possible values for the EvaluationState const type. -func PossibleEvaluationStateValues() []EvaluationState { - return []EvaluationState{ - EvaluationStateCompleted, - EvaluationStateInProgress, - EvaluationStateNotStarted, - } -} - -// ExpressRouteCircuitPeeringAdvertisedPublicPrefixState - The advertised public prefix state of the Peering resource. -type ExpressRouteCircuitPeeringAdvertisedPublicPrefixState string - -const ( - ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfigured ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "Configured" - ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfiguring ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "Configuring" - ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateNotConfigured ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "NotConfigured" - ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValidationNeeded ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "ValidationNeeded" -) - -// PossibleExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValues returns the possible values for the ExpressRouteCircuitPeeringAdvertisedPublicPrefixState const type. -func PossibleExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValues() []ExpressRouteCircuitPeeringAdvertisedPublicPrefixState { - return []ExpressRouteCircuitPeeringAdvertisedPublicPrefixState{ - ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfigured, - ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfiguring, - ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateNotConfigured, - ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValidationNeeded, - } -} - -// ExpressRouteCircuitPeeringState - The state of peering. -type ExpressRouteCircuitPeeringState string - -const ( - ExpressRouteCircuitPeeringStateDisabled ExpressRouteCircuitPeeringState = "Disabled" - ExpressRouteCircuitPeeringStateEnabled ExpressRouteCircuitPeeringState = "Enabled" -) - -// PossibleExpressRouteCircuitPeeringStateValues returns the possible values for the ExpressRouteCircuitPeeringState const type. -func PossibleExpressRouteCircuitPeeringStateValues() []ExpressRouteCircuitPeeringState { - return []ExpressRouteCircuitPeeringState{ - ExpressRouteCircuitPeeringStateDisabled, - ExpressRouteCircuitPeeringStateEnabled, - } -} - -// ExpressRouteCircuitSKUFamily - The family of the SKU. -type ExpressRouteCircuitSKUFamily string - -const ( - ExpressRouteCircuitSKUFamilyMeteredData ExpressRouteCircuitSKUFamily = "MeteredData" - ExpressRouteCircuitSKUFamilyUnlimitedData ExpressRouteCircuitSKUFamily = "UnlimitedData" -) - -// PossibleExpressRouteCircuitSKUFamilyValues returns the possible values for the ExpressRouteCircuitSKUFamily const type. -func PossibleExpressRouteCircuitSKUFamilyValues() []ExpressRouteCircuitSKUFamily { - return []ExpressRouteCircuitSKUFamily{ - ExpressRouteCircuitSKUFamilyMeteredData, - ExpressRouteCircuitSKUFamilyUnlimitedData, - } -} - -// ExpressRouteCircuitSKUTier - The tier of the SKU. -type ExpressRouteCircuitSKUTier string - -const ( - ExpressRouteCircuitSKUTierBasic ExpressRouteCircuitSKUTier = "Basic" - ExpressRouteCircuitSKUTierLocal ExpressRouteCircuitSKUTier = "Local" - ExpressRouteCircuitSKUTierPremium ExpressRouteCircuitSKUTier = "Premium" - ExpressRouteCircuitSKUTierStandard ExpressRouteCircuitSKUTier = "Standard" -) - -// PossibleExpressRouteCircuitSKUTierValues returns the possible values for the ExpressRouteCircuitSKUTier const type. -func PossibleExpressRouteCircuitSKUTierValues() []ExpressRouteCircuitSKUTier { - return []ExpressRouteCircuitSKUTier{ - ExpressRouteCircuitSKUTierBasic, - ExpressRouteCircuitSKUTierLocal, - ExpressRouteCircuitSKUTierPremium, - ExpressRouteCircuitSKUTierStandard, - } -} - -// ExpressRouteLinkAdminState - Administrative state of the physical port. -type ExpressRouteLinkAdminState string - -const ( - ExpressRouteLinkAdminStateDisabled ExpressRouteLinkAdminState = "Disabled" - ExpressRouteLinkAdminStateEnabled ExpressRouteLinkAdminState = "Enabled" -) - -// PossibleExpressRouteLinkAdminStateValues returns the possible values for the ExpressRouteLinkAdminState const type. -func PossibleExpressRouteLinkAdminStateValues() []ExpressRouteLinkAdminState { - return []ExpressRouteLinkAdminState{ - ExpressRouteLinkAdminStateDisabled, - ExpressRouteLinkAdminStateEnabled, - } -} - -// ExpressRouteLinkConnectorType - Physical fiber port type. -type ExpressRouteLinkConnectorType string - -const ( - ExpressRouteLinkConnectorTypeLC ExpressRouteLinkConnectorType = "LC" - ExpressRouteLinkConnectorTypeSC ExpressRouteLinkConnectorType = "SC" -) - -// PossibleExpressRouteLinkConnectorTypeValues returns the possible values for the ExpressRouteLinkConnectorType const type. -func PossibleExpressRouteLinkConnectorTypeValues() []ExpressRouteLinkConnectorType { - return []ExpressRouteLinkConnectorType{ - ExpressRouteLinkConnectorTypeLC, - ExpressRouteLinkConnectorTypeSC, - } -} - -// ExpressRouteLinkMacSecCipher - Mac security cipher. -type ExpressRouteLinkMacSecCipher string - -const ( - ExpressRouteLinkMacSecCipherGCMAES128 ExpressRouteLinkMacSecCipher = "GcmAes128" - ExpressRouteLinkMacSecCipherGCMAES256 ExpressRouteLinkMacSecCipher = "GcmAes256" - ExpressRouteLinkMacSecCipherGCMAesXpn128 ExpressRouteLinkMacSecCipher = "GcmAesXpn128" - ExpressRouteLinkMacSecCipherGCMAesXpn256 ExpressRouteLinkMacSecCipher = "GcmAesXpn256" -) - -// PossibleExpressRouteLinkMacSecCipherValues returns the possible values for the ExpressRouteLinkMacSecCipher const type. -func PossibleExpressRouteLinkMacSecCipherValues() []ExpressRouteLinkMacSecCipher { - return []ExpressRouteLinkMacSecCipher{ - ExpressRouteLinkMacSecCipherGCMAES128, - ExpressRouteLinkMacSecCipherGCMAES256, - ExpressRouteLinkMacSecCipherGCMAesXpn128, - ExpressRouteLinkMacSecCipherGCMAesXpn256, - } -} - -// ExpressRouteLinkMacSecSciState - Sci mode enabled/disabled. -type ExpressRouteLinkMacSecSciState string - -const ( - ExpressRouteLinkMacSecSciStateDisabled ExpressRouteLinkMacSecSciState = "Disabled" - ExpressRouteLinkMacSecSciStateEnabled ExpressRouteLinkMacSecSciState = "Enabled" -) - -// PossibleExpressRouteLinkMacSecSciStateValues returns the possible values for the ExpressRouteLinkMacSecSciState const type. -func PossibleExpressRouteLinkMacSecSciStateValues() []ExpressRouteLinkMacSecSciState { - return []ExpressRouteLinkMacSecSciState{ - ExpressRouteLinkMacSecSciStateDisabled, - ExpressRouteLinkMacSecSciStateEnabled, - } -} - -// ExpressRoutePeeringState - The state of peering. -type ExpressRoutePeeringState string - -const ( - ExpressRoutePeeringStateDisabled ExpressRoutePeeringState = "Disabled" - ExpressRoutePeeringStateEnabled ExpressRoutePeeringState = "Enabled" -) - -// PossibleExpressRoutePeeringStateValues returns the possible values for the ExpressRoutePeeringState const type. -func PossibleExpressRoutePeeringStateValues() []ExpressRoutePeeringState { - return []ExpressRoutePeeringState{ - ExpressRoutePeeringStateDisabled, - ExpressRoutePeeringStateEnabled, - } -} - -// ExpressRoutePeeringType - The peering type. -type ExpressRoutePeeringType string - -const ( - ExpressRoutePeeringTypeAzurePrivatePeering ExpressRoutePeeringType = "AzurePrivatePeering" - ExpressRoutePeeringTypeAzurePublicPeering ExpressRoutePeeringType = "AzurePublicPeering" - ExpressRoutePeeringTypeMicrosoftPeering ExpressRoutePeeringType = "MicrosoftPeering" -) - -// PossibleExpressRoutePeeringTypeValues returns the possible values for the ExpressRoutePeeringType const type. -func PossibleExpressRoutePeeringTypeValues() []ExpressRoutePeeringType { - return []ExpressRoutePeeringType{ - ExpressRoutePeeringTypeAzurePrivatePeering, - ExpressRoutePeeringTypeAzurePublicPeering, - ExpressRoutePeeringTypeMicrosoftPeering, - } -} - -// ExpressRoutePortAuthorizationUseStatus - The authorization use status. -type ExpressRoutePortAuthorizationUseStatus string - -const ( - ExpressRoutePortAuthorizationUseStatusAvailable ExpressRoutePortAuthorizationUseStatus = "Available" - ExpressRoutePortAuthorizationUseStatusInUse ExpressRoutePortAuthorizationUseStatus = "InUse" -) - -// PossibleExpressRoutePortAuthorizationUseStatusValues returns the possible values for the ExpressRoutePortAuthorizationUseStatus const type. -func PossibleExpressRoutePortAuthorizationUseStatusValues() []ExpressRoutePortAuthorizationUseStatus { - return []ExpressRoutePortAuthorizationUseStatus{ - ExpressRoutePortAuthorizationUseStatusAvailable, - ExpressRoutePortAuthorizationUseStatusInUse, - } -} - -// ExpressRoutePortsEncapsulation - Encapsulation method on physical ports. -type ExpressRoutePortsEncapsulation string - -const ( - ExpressRoutePortsEncapsulationDot1Q ExpressRoutePortsEncapsulation = "Dot1Q" - ExpressRoutePortsEncapsulationQinQ ExpressRoutePortsEncapsulation = "QinQ" -) - -// PossibleExpressRoutePortsEncapsulationValues returns the possible values for the ExpressRoutePortsEncapsulation const type. -func PossibleExpressRoutePortsEncapsulationValues() []ExpressRoutePortsEncapsulation { - return []ExpressRoutePortsEncapsulation{ - ExpressRoutePortsEncapsulationDot1Q, - ExpressRoutePortsEncapsulationQinQ, - } -} - -// ExtendedLocationTypes - The supported ExtendedLocation types. Currently only EdgeZone is supported in Microsoft.Network -// resources. -type ExtendedLocationTypes string - -const ( - ExtendedLocationTypesEdgeZone ExtendedLocationTypes = "EdgeZone" -) - -// PossibleExtendedLocationTypesValues returns the possible values for the ExtendedLocationTypes const type. -func PossibleExtendedLocationTypesValues() []ExtendedLocationTypes { - return []ExtendedLocationTypes{ - ExtendedLocationTypesEdgeZone, - } -} - -// FirewallPolicyFilterRuleCollectionActionType - The action type of a rule. -type FirewallPolicyFilterRuleCollectionActionType string - -const ( - FirewallPolicyFilterRuleCollectionActionTypeAllow FirewallPolicyFilterRuleCollectionActionType = "Allow" - FirewallPolicyFilterRuleCollectionActionTypeDeny FirewallPolicyFilterRuleCollectionActionType = "Deny" -) - -// PossibleFirewallPolicyFilterRuleCollectionActionTypeValues returns the possible values for the FirewallPolicyFilterRuleCollectionActionType const type. -func PossibleFirewallPolicyFilterRuleCollectionActionTypeValues() []FirewallPolicyFilterRuleCollectionActionType { - return []FirewallPolicyFilterRuleCollectionActionType{ - FirewallPolicyFilterRuleCollectionActionTypeAllow, - FirewallPolicyFilterRuleCollectionActionTypeDeny, - } -} - -// FirewallPolicyIDPSQuerySortOrder - Describes if results should be in ascending/descending order -type FirewallPolicyIDPSQuerySortOrder string - -const ( - FirewallPolicyIDPSQuerySortOrderAscending FirewallPolicyIDPSQuerySortOrder = "Ascending" - FirewallPolicyIDPSQuerySortOrderDescending FirewallPolicyIDPSQuerySortOrder = "Descending" -) - -// PossibleFirewallPolicyIDPSQuerySortOrderValues returns the possible values for the FirewallPolicyIDPSQuerySortOrder const type. -func PossibleFirewallPolicyIDPSQuerySortOrderValues() []FirewallPolicyIDPSQuerySortOrder { - return []FirewallPolicyIDPSQuerySortOrder{ - FirewallPolicyIDPSQuerySortOrderAscending, - FirewallPolicyIDPSQuerySortOrderDescending, - } -} - -// FirewallPolicyIDPSSignatureDirection - Describes in which direction signature is being enforced: 0 - Inbound, 1 - OutBound, -// 2 - Bidirectional -type FirewallPolicyIDPSSignatureDirection int32 - -const ( - FirewallPolicyIDPSSignatureDirectionZero FirewallPolicyIDPSSignatureDirection = 0 - FirewallPolicyIDPSSignatureDirectionOne FirewallPolicyIDPSSignatureDirection = 1 - FirewallPolicyIDPSSignatureDirectionTwo FirewallPolicyIDPSSignatureDirection = 2 -) - -// PossibleFirewallPolicyIDPSSignatureDirectionValues returns the possible values for the FirewallPolicyIDPSSignatureDirection const type. -func PossibleFirewallPolicyIDPSSignatureDirectionValues() []FirewallPolicyIDPSSignatureDirection { - return []FirewallPolicyIDPSSignatureDirection{ - FirewallPolicyIDPSSignatureDirectionZero, - FirewallPolicyIDPSSignatureDirectionOne, - FirewallPolicyIDPSSignatureDirectionTwo, - } -} - -// FirewallPolicyIDPSSignatureMode - The current mode enforced, 0 - Disabled, 1 - Alert, 2 -Deny -type FirewallPolicyIDPSSignatureMode int32 - -const ( - FirewallPolicyIDPSSignatureModeZero FirewallPolicyIDPSSignatureMode = 0 - FirewallPolicyIDPSSignatureModeOne FirewallPolicyIDPSSignatureMode = 1 - FirewallPolicyIDPSSignatureModeTwo FirewallPolicyIDPSSignatureMode = 2 -) - -// PossibleFirewallPolicyIDPSSignatureModeValues returns the possible values for the FirewallPolicyIDPSSignatureMode const type. -func PossibleFirewallPolicyIDPSSignatureModeValues() []FirewallPolicyIDPSSignatureMode { - return []FirewallPolicyIDPSSignatureMode{ - FirewallPolicyIDPSSignatureModeZero, - FirewallPolicyIDPSSignatureModeOne, - FirewallPolicyIDPSSignatureModeTwo, - } -} - -// FirewallPolicyIDPSSignatureSeverity - Describes the severity of signature: 1 - Low, 2 - Medium, 3 - High -type FirewallPolicyIDPSSignatureSeverity int32 - -const ( - FirewallPolicyIDPSSignatureSeverityOne FirewallPolicyIDPSSignatureSeverity = 1 - FirewallPolicyIDPSSignatureSeverityTwo FirewallPolicyIDPSSignatureSeverity = 2 - FirewallPolicyIDPSSignatureSeverityThree FirewallPolicyIDPSSignatureSeverity = 3 -) - -// PossibleFirewallPolicyIDPSSignatureSeverityValues returns the possible values for the FirewallPolicyIDPSSignatureSeverity const type. -func PossibleFirewallPolicyIDPSSignatureSeverityValues() []FirewallPolicyIDPSSignatureSeverity { - return []FirewallPolicyIDPSSignatureSeverity{ - FirewallPolicyIDPSSignatureSeverityOne, - FirewallPolicyIDPSSignatureSeverityTwo, - FirewallPolicyIDPSSignatureSeverityThree, - } -} - -// FirewallPolicyIntrusionDetectionProtocol - Possible intrusion detection bypass traffic protocols. -type FirewallPolicyIntrusionDetectionProtocol string - -const ( - FirewallPolicyIntrusionDetectionProtocolANY FirewallPolicyIntrusionDetectionProtocol = "ANY" - FirewallPolicyIntrusionDetectionProtocolICMP FirewallPolicyIntrusionDetectionProtocol = "ICMP" - FirewallPolicyIntrusionDetectionProtocolTCP FirewallPolicyIntrusionDetectionProtocol = "TCP" - FirewallPolicyIntrusionDetectionProtocolUDP FirewallPolicyIntrusionDetectionProtocol = "UDP" -) - -// PossibleFirewallPolicyIntrusionDetectionProtocolValues returns the possible values for the FirewallPolicyIntrusionDetectionProtocol const type. -func PossibleFirewallPolicyIntrusionDetectionProtocolValues() []FirewallPolicyIntrusionDetectionProtocol { - return []FirewallPolicyIntrusionDetectionProtocol{ - FirewallPolicyIntrusionDetectionProtocolANY, - FirewallPolicyIntrusionDetectionProtocolICMP, - FirewallPolicyIntrusionDetectionProtocolTCP, - FirewallPolicyIntrusionDetectionProtocolUDP, - } -} - -// FirewallPolicyIntrusionDetectionStateType - Possible state values. -type FirewallPolicyIntrusionDetectionStateType string - -const ( - FirewallPolicyIntrusionDetectionStateTypeAlert FirewallPolicyIntrusionDetectionStateType = "Alert" - FirewallPolicyIntrusionDetectionStateTypeDeny FirewallPolicyIntrusionDetectionStateType = "Deny" - FirewallPolicyIntrusionDetectionStateTypeOff FirewallPolicyIntrusionDetectionStateType = "Off" -) - -// PossibleFirewallPolicyIntrusionDetectionStateTypeValues returns the possible values for the FirewallPolicyIntrusionDetectionStateType const type. -func PossibleFirewallPolicyIntrusionDetectionStateTypeValues() []FirewallPolicyIntrusionDetectionStateType { - return []FirewallPolicyIntrusionDetectionStateType{ - FirewallPolicyIntrusionDetectionStateTypeAlert, - FirewallPolicyIntrusionDetectionStateTypeDeny, - FirewallPolicyIntrusionDetectionStateTypeOff, - } -} - -// FirewallPolicyNatRuleCollectionActionType - The action type of a rule. -type FirewallPolicyNatRuleCollectionActionType string - -const ( - FirewallPolicyNatRuleCollectionActionTypeDNAT FirewallPolicyNatRuleCollectionActionType = "DNAT" -) - -// PossibleFirewallPolicyNatRuleCollectionActionTypeValues returns the possible values for the FirewallPolicyNatRuleCollectionActionType const type. -func PossibleFirewallPolicyNatRuleCollectionActionTypeValues() []FirewallPolicyNatRuleCollectionActionType { - return []FirewallPolicyNatRuleCollectionActionType{ - FirewallPolicyNatRuleCollectionActionTypeDNAT, - } -} - -// FirewallPolicyRuleApplicationProtocolType - The application protocol type of a Rule. -type FirewallPolicyRuleApplicationProtocolType string - -const ( - FirewallPolicyRuleApplicationProtocolTypeHTTP FirewallPolicyRuleApplicationProtocolType = "Http" - FirewallPolicyRuleApplicationProtocolTypeHTTPS FirewallPolicyRuleApplicationProtocolType = "Https" -) - -// PossibleFirewallPolicyRuleApplicationProtocolTypeValues returns the possible values for the FirewallPolicyRuleApplicationProtocolType const type. -func PossibleFirewallPolicyRuleApplicationProtocolTypeValues() []FirewallPolicyRuleApplicationProtocolType { - return []FirewallPolicyRuleApplicationProtocolType{ - FirewallPolicyRuleApplicationProtocolTypeHTTP, - FirewallPolicyRuleApplicationProtocolTypeHTTPS, - } -} - -// FirewallPolicyRuleCollectionType - The type of the rule collection. -type FirewallPolicyRuleCollectionType string - -const ( - FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection FirewallPolicyRuleCollectionType = "FirewallPolicyFilterRuleCollection" - FirewallPolicyRuleCollectionTypeFirewallPolicyNatRuleCollection FirewallPolicyRuleCollectionType = "FirewallPolicyNatRuleCollection" -) - -// PossibleFirewallPolicyRuleCollectionTypeValues returns the possible values for the FirewallPolicyRuleCollectionType const type. -func PossibleFirewallPolicyRuleCollectionTypeValues() []FirewallPolicyRuleCollectionType { - return []FirewallPolicyRuleCollectionType{ - FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection, - FirewallPolicyRuleCollectionTypeFirewallPolicyNatRuleCollection, - } -} - -// FirewallPolicyRuleNetworkProtocol - The Network protocol of a Rule. -type FirewallPolicyRuleNetworkProtocol string - -const ( - FirewallPolicyRuleNetworkProtocolAny FirewallPolicyRuleNetworkProtocol = "Any" - FirewallPolicyRuleNetworkProtocolICMP FirewallPolicyRuleNetworkProtocol = "ICMP" - FirewallPolicyRuleNetworkProtocolTCP FirewallPolicyRuleNetworkProtocol = "TCP" - FirewallPolicyRuleNetworkProtocolUDP FirewallPolicyRuleNetworkProtocol = "UDP" -) - -// PossibleFirewallPolicyRuleNetworkProtocolValues returns the possible values for the FirewallPolicyRuleNetworkProtocol const type. -func PossibleFirewallPolicyRuleNetworkProtocolValues() []FirewallPolicyRuleNetworkProtocol { - return []FirewallPolicyRuleNetworkProtocol{ - FirewallPolicyRuleNetworkProtocolAny, - FirewallPolicyRuleNetworkProtocolICMP, - FirewallPolicyRuleNetworkProtocolTCP, - FirewallPolicyRuleNetworkProtocolUDP, - } -} - -// FirewallPolicyRuleType - Rule Type. -type FirewallPolicyRuleType string - -const ( - FirewallPolicyRuleTypeApplicationRule FirewallPolicyRuleType = "ApplicationRule" - FirewallPolicyRuleTypeNatRule FirewallPolicyRuleType = "NatRule" - FirewallPolicyRuleTypeNetworkRule FirewallPolicyRuleType = "NetworkRule" -) - -// PossibleFirewallPolicyRuleTypeValues returns the possible values for the FirewallPolicyRuleType const type. -func PossibleFirewallPolicyRuleTypeValues() []FirewallPolicyRuleType { - return []FirewallPolicyRuleType{ - FirewallPolicyRuleTypeApplicationRule, - FirewallPolicyRuleTypeNatRule, - FirewallPolicyRuleTypeNetworkRule, - } -} - -// FirewallPolicySKUTier - Tier of Firewall Policy. -type FirewallPolicySKUTier string - -const ( - FirewallPolicySKUTierBasic FirewallPolicySKUTier = "Basic" - FirewallPolicySKUTierPremium FirewallPolicySKUTier = "Premium" - FirewallPolicySKUTierStandard FirewallPolicySKUTier = "Standard" -) - -// PossibleFirewallPolicySKUTierValues returns the possible values for the FirewallPolicySKUTier const type. -func PossibleFirewallPolicySKUTierValues() []FirewallPolicySKUTier { - return []FirewallPolicySKUTier{ - FirewallPolicySKUTierBasic, - FirewallPolicySKUTierPremium, - FirewallPolicySKUTierStandard, - } -} - -// FlowLogFormatType - The file type of flow log. -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -// PossibleFlowLogFormatTypeValues returns the possible values for the FlowLogFormatType const type. -func PossibleFlowLogFormatTypeValues() []FlowLogFormatType { - return []FlowLogFormatType{ - FlowLogFormatTypeJSON, - } -} - -// GatewayLoadBalancerTunnelInterfaceType - Traffic type of gateway load balancer tunnel interface. -type GatewayLoadBalancerTunnelInterfaceType string - -const ( - GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" - GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" -) - -// PossibleGatewayLoadBalancerTunnelInterfaceTypeValues returns the possible values for the GatewayLoadBalancerTunnelInterfaceType const type. -func PossibleGatewayLoadBalancerTunnelInterfaceTypeValues() []GatewayLoadBalancerTunnelInterfaceType { - return []GatewayLoadBalancerTunnelInterfaceType{ - GatewayLoadBalancerTunnelInterfaceTypeExternal, - GatewayLoadBalancerTunnelInterfaceTypeInternal, - GatewayLoadBalancerTunnelInterfaceTypeNone, - } -} - -// GatewayLoadBalancerTunnelProtocol - Protocol of gateway load balancer tunnel interface. -type GatewayLoadBalancerTunnelProtocol string - -const ( - GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" -) - -// PossibleGatewayLoadBalancerTunnelProtocolValues returns the possible values for the GatewayLoadBalancerTunnelProtocol const type. -func PossibleGatewayLoadBalancerTunnelProtocolValues() []GatewayLoadBalancerTunnelProtocol { - return []GatewayLoadBalancerTunnelProtocol{ - GatewayLoadBalancerTunnelProtocolNative, - GatewayLoadBalancerTunnelProtocolNone, - GatewayLoadBalancerTunnelProtocolVXLAN, - } -} - -// GroupConnectivity - Group connectivity type. -type GroupConnectivity string - -const ( - GroupConnectivityDirectlyConnected GroupConnectivity = "DirectlyConnected" - GroupConnectivityNone GroupConnectivity = "None" -) - -// PossibleGroupConnectivityValues returns the possible values for the GroupConnectivity const type. -func PossibleGroupConnectivityValues() []GroupConnectivity { - return []GroupConnectivity{ - GroupConnectivityDirectlyConnected, - GroupConnectivityNone, - } -} - -// HTTPConfigurationMethod - The HTTP method to use. -type HTTPConfigurationMethod string - -const ( - HTTPConfigurationMethodGet HTTPConfigurationMethod = "Get" - HTTPConfigurationMethodPost HTTPConfigurationMethod = "Post" -) - -// PossibleHTTPConfigurationMethodValues returns the possible values for the HTTPConfigurationMethod const type. -func PossibleHTTPConfigurationMethodValues() []HTTPConfigurationMethod { - return []HTTPConfigurationMethod{ - HTTPConfigurationMethodGet, - HTTPConfigurationMethodPost, - } -} - -// HTTPMethod - HTTP method. -type HTTPMethod string - -const ( - HTTPMethodGet HTTPMethod = "Get" -) - -// PossibleHTTPMethodValues returns the possible values for the HTTPMethod const type. -func PossibleHTTPMethodValues() []HTTPMethod { - return []HTTPMethod{ - HTTPMethodGet, - } -} - -// HubBgpConnectionStatus - The current state of the VirtualHub to Peer. -type HubBgpConnectionStatus string - -const ( - HubBgpConnectionStatusConnected HubBgpConnectionStatus = "Connected" - HubBgpConnectionStatusConnecting HubBgpConnectionStatus = "Connecting" - HubBgpConnectionStatusNotConnected HubBgpConnectionStatus = "NotConnected" - HubBgpConnectionStatusUnknown HubBgpConnectionStatus = "Unknown" -) - -// PossibleHubBgpConnectionStatusValues returns the possible values for the HubBgpConnectionStatus const type. -func PossibleHubBgpConnectionStatusValues() []HubBgpConnectionStatus { - return []HubBgpConnectionStatus{ - HubBgpConnectionStatusConnected, - HubBgpConnectionStatusConnecting, - HubBgpConnectionStatusNotConnected, - HubBgpConnectionStatusUnknown, - } -} - -// HubRoutingPreference - The hub routing preference gateway types -type HubRoutingPreference string - -const ( - HubRoutingPreferenceASPath HubRoutingPreference = "ASPath" - HubRoutingPreferenceExpressRoute HubRoutingPreference = "ExpressRoute" - HubRoutingPreferenceVPNGateway HubRoutingPreference = "VpnGateway" -) - -// PossibleHubRoutingPreferenceValues returns the possible values for the HubRoutingPreference const type. -func PossibleHubRoutingPreferenceValues() []HubRoutingPreference { - return []HubRoutingPreference{ - HubRoutingPreferenceASPath, - HubRoutingPreferenceExpressRoute, - HubRoutingPreferenceVPNGateway, - } -} - -// HubVirtualNetworkConnectionStatus - The current state of the VirtualHub to vnet connection. -type HubVirtualNetworkConnectionStatus string - -const ( - HubVirtualNetworkConnectionStatusConnected HubVirtualNetworkConnectionStatus = "Connected" - HubVirtualNetworkConnectionStatusConnecting HubVirtualNetworkConnectionStatus = "Connecting" - HubVirtualNetworkConnectionStatusNotConnected HubVirtualNetworkConnectionStatus = "NotConnected" - HubVirtualNetworkConnectionStatusUnknown HubVirtualNetworkConnectionStatus = "Unknown" -) - -// PossibleHubVirtualNetworkConnectionStatusValues returns the possible values for the HubVirtualNetworkConnectionStatus const type. -func PossibleHubVirtualNetworkConnectionStatusValues() []HubVirtualNetworkConnectionStatus { - return []HubVirtualNetworkConnectionStatus{ - HubVirtualNetworkConnectionStatusConnected, - HubVirtualNetworkConnectionStatusConnecting, - HubVirtualNetworkConnectionStatusNotConnected, - HubVirtualNetworkConnectionStatusUnknown, - } -} - -// IPAllocationMethod - IP address allocation method. -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -// PossibleIPAllocationMethodValues returns the possible values for the IPAllocationMethod const type. -func PossibleIPAllocationMethodValues() []IPAllocationMethod { - return []IPAllocationMethod{ - IPAllocationMethodDynamic, - IPAllocationMethodStatic, - } -} - -// IPAllocationType - IpAllocation type. -type IPAllocationType string - -const ( - IPAllocationTypeHypernet IPAllocationType = "Hypernet" - IPAllocationTypeUndefined IPAllocationType = "Undefined" -) - -// PossibleIPAllocationTypeValues returns the possible values for the IPAllocationType const type. -func PossibleIPAllocationTypeValues() []IPAllocationType { - return []IPAllocationType{ - IPAllocationTypeHypernet, - IPAllocationTypeUndefined, - } -} - -// IPFlowProtocol - Protocol to be verified on. -type IPFlowProtocol string - -const ( - IPFlowProtocolTCP IPFlowProtocol = "TCP" - IPFlowProtocolUDP IPFlowProtocol = "UDP" -) - -// PossibleIPFlowProtocolValues returns the possible values for the IPFlowProtocol const type. -func PossibleIPFlowProtocolValues() []IPFlowProtocol { - return []IPFlowProtocol{ - IPFlowProtocolTCP, - IPFlowProtocolUDP, - } -} - -// IPSecEncryption - The IPSec encryption algorithm (IKE phase 1). -type IPSecEncryption string - -const ( - IPSecEncryptionAES128 IPSecEncryption = "AES128" - IPSecEncryptionAES192 IPSecEncryption = "AES192" - IPSecEncryptionAES256 IPSecEncryption = "AES256" - IPSecEncryptionDES IPSecEncryption = "DES" - IPSecEncryptionDES3 IPSecEncryption = "DES3" - IPSecEncryptionGCMAES128 IPSecEncryption = "GCMAES128" - IPSecEncryptionGCMAES192 IPSecEncryption = "GCMAES192" - IPSecEncryptionGCMAES256 IPSecEncryption = "GCMAES256" - IPSecEncryptionNone IPSecEncryption = "None" -) - -// PossibleIPSecEncryptionValues returns the possible values for the IPSecEncryption const type. -func PossibleIPSecEncryptionValues() []IPSecEncryption { - return []IPSecEncryption{ - IPSecEncryptionAES128, - IPSecEncryptionAES192, - IPSecEncryptionAES256, - IPSecEncryptionDES, - IPSecEncryptionDES3, - IPSecEncryptionGCMAES128, - IPSecEncryptionGCMAES192, - IPSecEncryptionGCMAES256, - IPSecEncryptionNone, - } -} - -// IPSecIntegrity - The IPSec integrity algorithm (IKE phase 1). -type IPSecIntegrity string - -const ( - IPSecIntegrityGCMAES128 IPSecIntegrity = "GCMAES128" - IPSecIntegrityGCMAES192 IPSecIntegrity = "GCMAES192" - IPSecIntegrityGCMAES256 IPSecIntegrity = "GCMAES256" - IPSecIntegrityMD5 IPSecIntegrity = "MD5" - IPSecIntegritySHA1 IPSecIntegrity = "SHA1" - IPSecIntegritySHA256 IPSecIntegrity = "SHA256" -) - -// PossibleIPSecIntegrityValues returns the possible values for the IPSecIntegrity const type. -func PossibleIPSecIntegrityValues() []IPSecIntegrity { - return []IPSecIntegrity{ - IPSecIntegrityGCMAES128, - IPSecIntegrityGCMAES192, - IPSecIntegrityGCMAES256, - IPSecIntegrityMD5, - IPSecIntegritySHA1, - IPSecIntegritySHA256, - } -} - -// IPVersion - IP address version. -type IPVersion string - -const ( - IPVersionIPv4 IPVersion = "IPv4" - IPVersionIPv6 IPVersion = "IPv6" -) - -// PossibleIPVersionValues returns the possible values for the IPVersion const type. -func PossibleIPVersionValues() []IPVersion { - return []IPVersion{ - IPVersionIPv4, - IPVersionIPv6, - } -} - -// IkeEncryption - The IKE encryption algorithm (IKE phase 2). -type IkeEncryption string - -const ( - IkeEncryptionAES128 IkeEncryption = "AES128" - IkeEncryptionAES192 IkeEncryption = "AES192" - IkeEncryptionAES256 IkeEncryption = "AES256" - IkeEncryptionDES IkeEncryption = "DES" - IkeEncryptionDES3 IkeEncryption = "DES3" - IkeEncryptionGCMAES128 IkeEncryption = "GCMAES128" - IkeEncryptionGCMAES256 IkeEncryption = "GCMAES256" -) - -// PossibleIkeEncryptionValues returns the possible values for the IkeEncryption const type. -func PossibleIkeEncryptionValues() []IkeEncryption { - return []IkeEncryption{ - IkeEncryptionAES128, - IkeEncryptionAES192, - IkeEncryptionAES256, - IkeEncryptionDES, - IkeEncryptionDES3, - IkeEncryptionGCMAES128, - IkeEncryptionGCMAES256, - } -} - -// IkeIntegrity - The IKE integrity algorithm (IKE phase 2). -type IkeIntegrity string - -const ( - IkeIntegrityGCMAES128 IkeIntegrity = "GCMAES128" - IkeIntegrityGCMAES256 IkeIntegrity = "GCMAES256" - IkeIntegrityMD5 IkeIntegrity = "MD5" - IkeIntegritySHA1 IkeIntegrity = "SHA1" - IkeIntegritySHA256 IkeIntegrity = "SHA256" - IkeIntegritySHA384 IkeIntegrity = "SHA384" -) - -// PossibleIkeIntegrityValues returns the possible values for the IkeIntegrity const type. -func PossibleIkeIntegrityValues() []IkeIntegrity { - return []IkeIntegrity{ - IkeIntegrityGCMAES128, - IkeIntegrityGCMAES256, - IkeIntegrityMD5, - IkeIntegritySHA1, - IkeIntegritySHA256, - IkeIntegritySHA384, - } -} - -// InboundSecurityRulesProtocol - Protocol. This should be either TCP or UDP. -type InboundSecurityRulesProtocol string - -const ( - InboundSecurityRulesProtocolTCP InboundSecurityRulesProtocol = "TCP" - InboundSecurityRulesProtocolUDP InboundSecurityRulesProtocol = "UDP" -) - -// PossibleInboundSecurityRulesProtocolValues returns the possible values for the InboundSecurityRulesProtocol const type. -func PossibleInboundSecurityRulesProtocolValues() []InboundSecurityRulesProtocol { - return []InboundSecurityRulesProtocol{ - InboundSecurityRulesProtocolTCP, - InboundSecurityRulesProtocolUDP, - } -} - -// IsGlobal - Flag if global mesh is supported. -type IsGlobal string - -const ( - IsGlobalFalse IsGlobal = "False" - IsGlobalTrue IsGlobal = "True" -) - -// PossibleIsGlobalValues returns the possible values for the IsGlobal const type. -func PossibleIsGlobalValues() []IsGlobal { - return []IsGlobal{ - IsGlobalFalse, - IsGlobalTrue, - } -} - -// IssueType - The type of issue. -type IssueType string - -const ( - IssueTypeAgentStopped IssueType = "AgentStopped" - IssueTypeDNSResolution IssueType = "DnsResolution" - IssueTypeGuestFirewall IssueType = "GuestFirewall" - IssueTypeNetworkSecurityRule IssueType = "NetworkSecurityRule" - IssueTypePlatform IssueType = "Platform" - IssueTypePortThrottled IssueType = "PortThrottled" - IssueTypeSocketBind IssueType = "SocketBind" - IssueTypeUnknown IssueType = "Unknown" - IssueTypeUserDefinedRoute IssueType = "UserDefinedRoute" -) - -// PossibleIssueTypeValues returns the possible values for the IssueType const type. -func PossibleIssueTypeValues() []IssueType { - return []IssueType{ - IssueTypeAgentStopped, - IssueTypeDNSResolution, - IssueTypeGuestFirewall, - IssueTypeNetworkSecurityRule, - IssueTypePlatform, - IssueTypePortThrottled, - IssueTypeSocketBind, - IssueTypeUnknown, - IssueTypeUserDefinedRoute, - } -} - -// LoadBalancerBackendAddressAdminState - A list of administrative states which once set can override health probe so that -// Load Balancer will always forward new connections to backend, or deny new connections and reset existing connections. -type LoadBalancerBackendAddressAdminState string - -const ( - LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" - LoadBalancerBackendAddressAdminStateDrain LoadBalancerBackendAddressAdminState = "Drain" - LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" -) - -// PossibleLoadBalancerBackendAddressAdminStateValues returns the possible values for the LoadBalancerBackendAddressAdminState const type. -func PossibleLoadBalancerBackendAddressAdminStateValues() []LoadBalancerBackendAddressAdminState { - return []LoadBalancerBackendAddressAdminState{ - LoadBalancerBackendAddressAdminStateDown, - LoadBalancerBackendAddressAdminStateDrain, - LoadBalancerBackendAddressAdminStateNone, - LoadBalancerBackendAddressAdminStateUp, - } -} - -// LoadBalancerOutboundRuleProtocol - The protocol for the outbound rule in load balancer. -type LoadBalancerOutboundRuleProtocol string - -const ( - LoadBalancerOutboundRuleProtocolAll LoadBalancerOutboundRuleProtocol = "All" - LoadBalancerOutboundRuleProtocolTCP LoadBalancerOutboundRuleProtocol = "Tcp" - LoadBalancerOutboundRuleProtocolUDP LoadBalancerOutboundRuleProtocol = "Udp" -) - -// PossibleLoadBalancerOutboundRuleProtocolValues returns the possible values for the LoadBalancerOutboundRuleProtocol const type. -func PossibleLoadBalancerOutboundRuleProtocolValues() []LoadBalancerOutboundRuleProtocol { - return []LoadBalancerOutboundRuleProtocol{ - LoadBalancerOutboundRuleProtocolAll, - LoadBalancerOutboundRuleProtocolTCP, - LoadBalancerOutboundRuleProtocolUDP, - } -} - -// LoadBalancerSKUName - Name of a load balancer SKU. -type LoadBalancerSKUName string - -const ( - LoadBalancerSKUNameBasic LoadBalancerSKUName = "Basic" - LoadBalancerSKUNameGateway LoadBalancerSKUName = "Gateway" - LoadBalancerSKUNameStandard LoadBalancerSKUName = "Standard" -) - -// PossibleLoadBalancerSKUNameValues returns the possible values for the LoadBalancerSKUName const type. -func PossibleLoadBalancerSKUNameValues() []LoadBalancerSKUName { - return []LoadBalancerSKUName{ - LoadBalancerSKUNameBasic, - LoadBalancerSKUNameGateway, - LoadBalancerSKUNameStandard, - } -} - -// LoadBalancerSKUTier - Tier of a load balancer SKU. -type LoadBalancerSKUTier string - -const ( - LoadBalancerSKUTierGlobal LoadBalancerSKUTier = "Global" - LoadBalancerSKUTierRegional LoadBalancerSKUTier = "Regional" -) - -// PossibleLoadBalancerSKUTierValues returns the possible values for the LoadBalancerSKUTier const type. -func PossibleLoadBalancerSKUTierValues() []LoadBalancerSKUTier { - return []LoadBalancerSKUTier{ - LoadBalancerSKUTierGlobal, - LoadBalancerSKUTierRegional, - } -} - -// LoadDistribution - The load distribution policy for this rule. -type LoadDistribution string - -const ( - LoadDistributionDefault LoadDistribution = "Default" - LoadDistributionSourceIP LoadDistribution = "SourceIP" - LoadDistributionSourceIPProtocol LoadDistribution = "SourceIPProtocol" -) - -// PossibleLoadDistributionValues returns the possible values for the LoadDistribution const type. -func PossibleLoadDistributionValues() []LoadDistribution { - return []LoadDistribution{ - LoadDistributionDefault, - LoadDistributionSourceIP, - LoadDistributionSourceIPProtocol, - } -} - -// ManagedRuleEnabledState - The state of the managed rule. Defaults to Disabled if not specified. -type ManagedRuleEnabledState string - -const ( - ManagedRuleEnabledStateDisabled ManagedRuleEnabledState = "Disabled" -) - -// PossibleManagedRuleEnabledStateValues returns the possible values for the ManagedRuleEnabledState const type. -func PossibleManagedRuleEnabledStateValues() []ManagedRuleEnabledState { - return []ManagedRuleEnabledState{ - ManagedRuleEnabledStateDisabled, - } -} - -// NatGatewaySKUName - Name of Nat Gateway SKU. -type NatGatewaySKUName string - -const ( - NatGatewaySKUNameStandard NatGatewaySKUName = "Standard" -) - -// PossibleNatGatewaySKUNameValues returns the possible values for the NatGatewaySKUName const type. -func PossibleNatGatewaySKUNameValues() []NatGatewaySKUName { - return []NatGatewaySKUName{ - NatGatewaySKUNameStandard, - } -} - -// NetworkIntentPolicyBasedService - Network intent policy based services. -type NetworkIntentPolicyBasedService string - -const ( - NetworkIntentPolicyBasedServiceAll NetworkIntentPolicyBasedService = "All" - NetworkIntentPolicyBasedServiceNone NetworkIntentPolicyBasedService = "None" -) - -// PossibleNetworkIntentPolicyBasedServiceValues returns the possible values for the NetworkIntentPolicyBasedService const type. -func PossibleNetworkIntentPolicyBasedServiceValues() []NetworkIntentPolicyBasedService { - return []NetworkIntentPolicyBasedService{ - NetworkIntentPolicyBasedServiceAll, - NetworkIntentPolicyBasedServiceNone, - } -} - -// NetworkInterfaceAuxiliaryMode - Auxiliary mode of Network Interface resource. -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -// PossibleNetworkInterfaceAuxiliaryModeValues returns the possible values for the NetworkInterfaceAuxiliaryMode const type. -func PossibleNetworkInterfaceAuxiliaryModeValues() []NetworkInterfaceAuxiliaryMode { - return []NetworkInterfaceAuxiliaryMode{ - NetworkInterfaceAuxiliaryModeFloating, - NetworkInterfaceAuxiliaryModeMaxConnections, - NetworkInterfaceAuxiliaryModeNone, - } -} - -// NetworkInterfaceMigrationPhase - Migration phase of Network Interface resource. -type NetworkInterfaceMigrationPhase string - -const ( - NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" - NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" - NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" - NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" - NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" -) - -// PossibleNetworkInterfaceMigrationPhaseValues returns the possible values for the NetworkInterfaceMigrationPhase const type. -func PossibleNetworkInterfaceMigrationPhaseValues() []NetworkInterfaceMigrationPhase { - return []NetworkInterfaceMigrationPhase{ - NetworkInterfaceMigrationPhaseAbort, - NetworkInterfaceMigrationPhaseCommit, - NetworkInterfaceMigrationPhaseCommitted, - NetworkInterfaceMigrationPhaseNone, - NetworkInterfaceMigrationPhasePrepare, - } -} - -// NetworkInterfaceNicType - Type of Network Interface resource. -type NetworkInterfaceNicType string - -const ( - NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" - NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" -) - -// PossibleNetworkInterfaceNicTypeValues returns the possible values for the NetworkInterfaceNicType const type. -func PossibleNetworkInterfaceNicTypeValues() []NetworkInterfaceNicType { - return []NetworkInterfaceNicType{ - NetworkInterfaceNicTypeElastic, - NetworkInterfaceNicTypeStandard, - } -} - -// NetworkOperationStatus - Status of the Azure async operation. -type NetworkOperationStatus string - -const ( - NetworkOperationStatusFailed NetworkOperationStatus = "Failed" - NetworkOperationStatusInProgress NetworkOperationStatus = "InProgress" - NetworkOperationStatusSucceeded NetworkOperationStatus = "Succeeded" -) - -// PossibleNetworkOperationStatusValues returns the possible values for the NetworkOperationStatus const type. -func PossibleNetworkOperationStatusValues() []NetworkOperationStatus { - return []NetworkOperationStatus{ - NetworkOperationStatusFailed, - NetworkOperationStatusInProgress, - NetworkOperationStatusSucceeded, - } -} - -// NextHopType - Next hop type. -type NextHopType string - -const ( - NextHopTypeHyperNetGateway NextHopType = "HyperNetGateway" - NextHopTypeInternet NextHopType = "Internet" - NextHopTypeNone NextHopType = "None" - NextHopTypeVirtualAppliance NextHopType = "VirtualAppliance" - NextHopTypeVirtualNetworkGateway NextHopType = "VirtualNetworkGateway" - NextHopTypeVnetLocal NextHopType = "VnetLocal" -) - -// PossibleNextHopTypeValues returns the possible values for the NextHopType const type. -func PossibleNextHopTypeValues() []NextHopType { - return []NextHopType{ - NextHopTypeHyperNetGateway, - NextHopTypeInternet, - NextHopTypeNone, - NextHopTypeVirtualAppliance, - NextHopTypeVirtualNetworkGateway, - NextHopTypeVnetLocal, - } -} - -// OfficeTrafficCategory - The office traffic category. -type OfficeTrafficCategory string - -const ( - OfficeTrafficCategoryAll OfficeTrafficCategory = "All" - OfficeTrafficCategoryNone OfficeTrafficCategory = "None" - OfficeTrafficCategoryOptimize OfficeTrafficCategory = "Optimize" - OfficeTrafficCategoryOptimizeAndAllow OfficeTrafficCategory = "OptimizeAndAllow" -) - -// PossibleOfficeTrafficCategoryValues returns the possible values for the OfficeTrafficCategory const type. -func PossibleOfficeTrafficCategoryValues() []OfficeTrafficCategory { - return []OfficeTrafficCategory{ - OfficeTrafficCategoryAll, - OfficeTrafficCategoryNone, - OfficeTrafficCategoryOptimize, - OfficeTrafficCategoryOptimizeAndAllow, - } -} - -// Origin - The origin of the issue. -type Origin string - -const ( - OriginInbound Origin = "Inbound" - OriginLocal Origin = "Local" - OriginOutbound Origin = "Outbound" -) - -// PossibleOriginValues returns the possible values for the Origin const type. -func PossibleOriginValues() []Origin { - return []Origin{ - OriginInbound, - OriginLocal, - OriginOutbound, - } -} - -// OutputType - Connection monitor output destination type. Currently, only "Workspace" is supported. -type OutputType string - -const ( - OutputTypeWorkspace OutputType = "Workspace" -) - -// PossibleOutputTypeValues returns the possible values for the OutputType const type. -func PossibleOutputTypeValues() []OutputType { - return []OutputType{ - OutputTypeWorkspace, - } -} - -// OwaspCrsExclusionEntryMatchVariable - The variable to be excluded. -type OwaspCrsExclusionEntryMatchVariable string - -const ( - OwaspCrsExclusionEntryMatchVariableRequestArgKeys OwaspCrsExclusionEntryMatchVariable = "RequestArgKeys" - OwaspCrsExclusionEntryMatchVariableRequestArgNames OwaspCrsExclusionEntryMatchVariable = "RequestArgNames" - OwaspCrsExclusionEntryMatchVariableRequestArgValues OwaspCrsExclusionEntryMatchVariable = "RequestArgValues" - OwaspCrsExclusionEntryMatchVariableRequestCookieKeys OwaspCrsExclusionEntryMatchVariable = "RequestCookieKeys" - OwaspCrsExclusionEntryMatchVariableRequestCookieNames OwaspCrsExclusionEntryMatchVariable = "RequestCookieNames" - OwaspCrsExclusionEntryMatchVariableRequestCookieValues OwaspCrsExclusionEntryMatchVariable = "RequestCookieValues" - OwaspCrsExclusionEntryMatchVariableRequestHeaderKeys OwaspCrsExclusionEntryMatchVariable = "RequestHeaderKeys" - OwaspCrsExclusionEntryMatchVariableRequestHeaderNames OwaspCrsExclusionEntryMatchVariable = "RequestHeaderNames" - OwaspCrsExclusionEntryMatchVariableRequestHeaderValues OwaspCrsExclusionEntryMatchVariable = "RequestHeaderValues" -) - -// PossibleOwaspCrsExclusionEntryMatchVariableValues returns the possible values for the OwaspCrsExclusionEntryMatchVariable const type. -func PossibleOwaspCrsExclusionEntryMatchVariableValues() []OwaspCrsExclusionEntryMatchVariable { - return []OwaspCrsExclusionEntryMatchVariable{ - OwaspCrsExclusionEntryMatchVariableRequestArgKeys, - OwaspCrsExclusionEntryMatchVariableRequestArgNames, - OwaspCrsExclusionEntryMatchVariableRequestArgValues, - OwaspCrsExclusionEntryMatchVariableRequestCookieKeys, - OwaspCrsExclusionEntryMatchVariableRequestCookieNames, - OwaspCrsExclusionEntryMatchVariableRequestCookieValues, - OwaspCrsExclusionEntryMatchVariableRequestHeaderKeys, - OwaspCrsExclusionEntryMatchVariableRequestHeaderNames, - OwaspCrsExclusionEntryMatchVariableRequestHeaderValues, - } -} - -// OwaspCrsExclusionEntrySelectorMatchOperator - When matchVariable is a collection, operate on the selector to specify which -// elements in the collection this exclusion applies to. -type OwaspCrsExclusionEntrySelectorMatchOperator string - -const ( - OwaspCrsExclusionEntrySelectorMatchOperatorContains OwaspCrsExclusionEntrySelectorMatchOperator = "Contains" - OwaspCrsExclusionEntrySelectorMatchOperatorEndsWith OwaspCrsExclusionEntrySelectorMatchOperator = "EndsWith" - OwaspCrsExclusionEntrySelectorMatchOperatorEquals OwaspCrsExclusionEntrySelectorMatchOperator = "Equals" - OwaspCrsExclusionEntrySelectorMatchOperatorEqualsAny OwaspCrsExclusionEntrySelectorMatchOperator = "EqualsAny" - OwaspCrsExclusionEntrySelectorMatchOperatorStartsWith OwaspCrsExclusionEntrySelectorMatchOperator = "StartsWith" -) - -// PossibleOwaspCrsExclusionEntrySelectorMatchOperatorValues returns the possible values for the OwaspCrsExclusionEntrySelectorMatchOperator const type. -func PossibleOwaspCrsExclusionEntrySelectorMatchOperatorValues() []OwaspCrsExclusionEntrySelectorMatchOperator { - return []OwaspCrsExclusionEntrySelectorMatchOperator{ - OwaspCrsExclusionEntrySelectorMatchOperatorContains, - OwaspCrsExclusionEntrySelectorMatchOperatorEndsWith, - OwaspCrsExclusionEntrySelectorMatchOperatorEquals, - OwaspCrsExclusionEntrySelectorMatchOperatorEqualsAny, - OwaspCrsExclusionEntrySelectorMatchOperatorStartsWith, - } -} - -// PacketCaptureTargetType - Target type of the resource provided. -type PacketCaptureTargetType string - -const ( - PacketCaptureTargetTypeAzureVM PacketCaptureTargetType = "AzureVM" - PacketCaptureTargetTypeAzureVMSS PacketCaptureTargetType = "AzureVMSS" -) - -// PossiblePacketCaptureTargetTypeValues returns the possible values for the PacketCaptureTargetType const type. -func PossiblePacketCaptureTargetTypeValues() []PacketCaptureTargetType { - return []PacketCaptureTargetType{ - PacketCaptureTargetTypeAzureVM, - PacketCaptureTargetTypeAzureVMSS, - } -} - -type PcError string - -const ( - PcErrorAgentStopped PcError = "AgentStopped" - PcErrorCaptureFailed PcError = "CaptureFailed" - PcErrorInternalError PcError = "InternalError" - PcErrorLocalFileFailed PcError = "LocalFileFailed" - PcErrorStorageFailed PcError = "StorageFailed" -) - -// PossiblePcErrorValues returns the possible values for the PcError const type. -func PossiblePcErrorValues() []PcError { - return []PcError{ - PcErrorAgentStopped, - PcErrorCaptureFailed, - PcErrorInternalError, - PcErrorLocalFileFailed, - PcErrorStorageFailed, - } -} - -// PcProtocol - Protocol to be filtered on. -type PcProtocol string - -const ( - PcProtocolAny PcProtocol = "Any" - PcProtocolTCP PcProtocol = "TCP" - PcProtocolUDP PcProtocol = "UDP" -) - -// PossiblePcProtocolValues returns the possible values for the PcProtocol const type. -func PossiblePcProtocolValues() []PcProtocol { - return []PcProtocol{ - PcProtocolAny, - PcProtocolTCP, - PcProtocolUDP, - } -} - -// PcStatus - The status of the packet capture session. -type PcStatus string - -const ( - PcStatusError PcStatus = "Error" - PcStatusNotStarted PcStatus = "NotStarted" - PcStatusRunning PcStatus = "Running" - PcStatusStopped PcStatus = "Stopped" - PcStatusUnknown PcStatus = "Unknown" -) - -// PossiblePcStatusValues returns the possible values for the PcStatus const type. -func PossiblePcStatusValues() []PcStatus { - return []PcStatus{ - PcStatusError, - PcStatusNotStarted, - PcStatusRunning, - PcStatusStopped, - PcStatusUnknown, - } -} - -// PfsGroup - The Pfs Groups used in IKE Phase 2 for new child SA. -type PfsGroup string - -const ( - PfsGroupECP256 PfsGroup = "ECP256" - PfsGroupECP384 PfsGroup = "ECP384" - PfsGroupNone PfsGroup = "None" - PfsGroupPFS1 PfsGroup = "PFS1" - PfsGroupPFS14 PfsGroup = "PFS14" - PfsGroupPFS2 PfsGroup = "PFS2" - PfsGroupPFS2048 PfsGroup = "PFS2048" - PfsGroupPFS24 PfsGroup = "PFS24" - PfsGroupPFSMM PfsGroup = "PFSMM" -) - -// PossiblePfsGroupValues returns the possible values for the PfsGroup const type. -func PossiblePfsGroupValues() []PfsGroup { - return []PfsGroup{ - PfsGroupECP256, - PfsGroupECP384, - PfsGroupNone, - PfsGroupPFS1, - PfsGroupPFS14, - PfsGroupPFS2, - PfsGroupPFS2048, - PfsGroupPFS24, - PfsGroupPFSMM, - } -} - -// PreferredIPVersion - The preferred IP version to use in test evaluation. The connection monitor may choose to use a different -// version depending on other parameters. -type PreferredIPVersion string - -const ( - PreferredIPVersionIPv4 PreferredIPVersion = "IPv4" - PreferredIPVersionIPv6 PreferredIPVersion = "IPv6" -) - -// PossiblePreferredIPVersionValues returns the possible values for the PreferredIPVersion const type. -func PossiblePreferredIPVersionValues() []PreferredIPVersion { - return []PreferredIPVersion{ - PreferredIPVersionIPv4, - PreferredIPVersionIPv6, - } -} - -// PreferredRoutingGateway - The preferred routing gateway types -type PreferredRoutingGateway string - -const ( - PreferredRoutingGatewayExpressRoute PreferredRoutingGateway = "ExpressRoute" - PreferredRoutingGatewayNone PreferredRoutingGateway = "None" - PreferredRoutingGatewayVPNGateway PreferredRoutingGateway = "VpnGateway" -) - -// PossiblePreferredRoutingGatewayValues returns the possible values for the PreferredRoutingGateway const type. -func PossiblePreferredRoutingGatewayValues() []PreferredRoutingGateway { - return []PreferredRoutingGateway{ - PreferredRoutingGatewayExpressRoute, - PreferredRoutingGatewayNone, - PreferredRoutingGatewayVPNGateway, - } -} - -// ProbeProtocol - The protocol of the end point. If 'Tcp' is specified, a received ACK is required for the probe to be successful. -// If 'Http' or 'Https' is specified, a 200 OK response from the specifies URI is required -// for the probe to be successful. -type ProbeProtocol string - -const ( - ProbeProtocolHTTP ProbeProtocol = "Http" - ProbeProtocolHTTPS ProbeProtocol = "Https" - ProbeProtocolTCP ProbeProtocol = "Tcp" -) - -// PossibleProbeProtocolValues returns the possible values for the ProbeProtocol const type. -func PossibleProbeProtocolValues() []ProbeProtocol { - return []ProbeProtocol{ - ProbeProtocolHTTP, - ProbeProtocolHTTPS, - ProbeProtocolTCP, - } -} - -// ProcessorArchitecture - VPN client Processor Architecture. -type ProcessorArchitecture string - -const ( - ProcessorArchitectureAmd64 ProcessorArchitecture = "Amd64" - ProcessorArchitectureX86 ProcessorArchitecture = "X86" -) - -// PossibleProcessorArchitectureValues returns the possible values for the ProcessorArchitecture const type. -func PossibleProcessorArchitectureValues() []ProcessorArchitecture { - return []ProcessorArchitecture{ - ProcessorArchitectureAmd64, - ProcessorArchitectureX86, - } -} - -// Protocol - Network protocol. -type Protocol string - -const ( - ProtocolHTTP Protocol = "Http" - ProtocolHTTPS Protocol = "Https" - ProtocolIcmp Protocol = "Icmp" - ProtocolTCP Protocol = "Tcp" -) - -// PossibleProtocolValues returns the possible values for the Protocol const type. -func PossibleProtocolValues() []Protocol { - return []Protocol{ - ProtocolHTTP, - ProtocolHTTPS, - ProtocolIcmp, - ProtocolTCP, - } -} - -// ProtocolType - RNM supported protocol types. -type ProtocolType string - -const ( - ProtocolTypeAh ProtocolType = "Ah" - ProtocolTypeAll ProtocolType = "All" - ProtocolTypeDoNotUse ProtocolType = "DoNotUse" - ProtocolTypeEsp ProtocolType = "Esp" - ProtocolTypeGre ProtocolType = "Gre" - ProtocolTypeIcmp ProtocolType = "Icmp" - ProtocolTypeTCP ProtocolType = "Tcp" - ProtocolTypeUDP ProtocolType = "Udp" - ProtocolTypeVxlan ProtocolType = "Vxlan" -) - -// PossibleProtocolTypeValues returns the possible values for the ProtocolType const type. -func PossibleProtocolTypeValues() []ProtocolType { - return []ProtocolType{ - ProtocolTypeAh, - ProtocolTypeAll, - ProtocolTypeDoNotUse, - ProtocolTypeEsp, - ProtocolTypeGre, - ProtocolTypeIcmp, - ProtocolTypeTCP, - ProtocolTypeUDP, - ProtocolTypeVxlan, - } -} - -// ProvisioningState - The current provisioning state. -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -// PossibleProvisioningStateValues returns the possible values for the ProvisioningState const type. -func PossibleProvisioningStateValues() []ProvisioningState { - return []ProvisioningState{ - ProvisioningStateDeleting, - ProvisioningStateFailed, - ProvisioningStateSucceeded, - ProvisioningStateUpdating, - } -} - -// PublicIPAddressMigrationPhase - Migration phase of Public IP Address. -type PublicIPAddressMigrationPhase string - -const ( - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" - PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" -) - -// PossiblePublicIPAddressMigrationPhaseValues returns the possible values for the PublicIPAddressMigrationPhase const type. -func PossiblePublicIPAddressMigrationPhaseValues() []PublicIPAddressMigrationPhase { - return []PublicIPAddressMigrationPhase{ - PublicIPAddressMigrationPhaseAbort, - PublicIPAddressMigrationPhaseCommit, - PublicIPAddressMigrationPhaseCommitted, - PublicIPAddressMigrationPhaseNone, - PublicIPAddressMigrationPhasePrepare, - } -} - -// PublicIPAddressSKUName - Name of a public IP address SKU. -type PublicIPAddressSKUName string - -const ( - PublicIPAddressSKUNameBasic PublicIPAddressSKUName = "Basic" - PublicIPAddressSKUNameStandard PublicIPAddressSKUName = "Standard" -) - -// PossiblePublicIPAddressSKUNameValues returns the possible values for the PublicIPAddressSKUName const type. -func PossiblePublicIPAddressSKUNameValues() []PublicIPAddressSKUName { - return []PublicIPAddressSKUName{ - PublicIPAddressSKUNameBasic, - PublicIPAddressSKUNameStandard, - } -} - -// PublicIPAddressSKUTier - Tier of a public IP address SKU. -type PublicIPAddressSKUTier string - -const ( - PublicIPAddressSKUTierGlobal PublicIPAddressSKUTier = "Global" - PublicIPAddressSKUTierRegional PublicIPAddressSKUTier = "Regional" -) - -// PossiblePublicIPAddressSKUTierValues returns the possible values for the PublicIPAddressSKUTier const type. -func PossiblePublicIPAddressSKUTierValues() []PublicIPAddressSKUTier { - return []PublicIPAddressSKUTier{ - PublicIPAddressSKUTierGlobal, - PublicIPAddressSKUTierRegional, - } -} - -// PublicIPPrefixSKUName - Name of a public IP prefix SKU. -type PublicIPPrefixSKUName string - -const ( - PublicIPPrefixSKUNameStandard PublicIPPrefixSKUName = "Standard" -) - -// PossiblePublicIPPrefixSKUNameValues returns the possible values for the PublicIPPrefixSKUName const type. -func PossiblePublicIPPrefixSKUNameValues() []PublicIPPrefixSKUName { - return []PublicIPPrefixSKUName{ - PublicIPPrefixSKUNameStandard, - } -} - -// PublicIPPrefixSKUTier - Tier of a public IP prefix SKU. -type PublicIPPrefixSKUTier string - -const ( - PublicIPPrefixSKUTierGlobal PublicIPPrefixSKUTier = "Global" - PublicIPPrefixSKUTierRegional PublicIPPrefixSKUTier = "Regional" -) - -// PossiblePublicIPPrefixSKUTierValues returns the possible values for the PublicIPPrefixSKUTier const type. -func PossiblePublicIPPrefixSKUTierValues() []PublicIPPrefixSKUTier { - return []PublicIPPrefixSKUTier{ - PublicIPPrefixSKUTierGlobal, - PublicIPPrefixSKUTierRegional, - } -} - -// ResourceIdentityType - The type of identity used for the resource. The type 'SystemAssigned, UserAssigned' includes both -// an implicitly created identity and a set of user assigned identities. The type 'None' will remove any -// identities from the virtual machine. -type ResourceIdentityType string - -const ( - ResourceIdentityTypeSystemAssigned ResourceIdentityType = "SystemAssigned" - ResourceIdentityTypeUserAssigned ResourceIdentityType = "UserAssigned" - ResourceIdentityTypeSystemAssignedUserAssigned ResourceIdentityType = "SystemAssigned, UserAssigned" - ResourceIdentityTypeNone ResourceIdentityType = "None" -) - -// PossibleResourceIdentityTypeValues returns the possible values for the ResourceIdentityType const type. -func PossibleResourceIdentityTypeValues() []ResourceIdentityType { - return []ResourceIdentityType{ - ResourceIdentityTypeSystemAssigned, - ResourceIdentityTypeUserAssigned, - ResourceIdentityTypeSystemAssignedUserAssigned, - ResourceIdentityTypeNone, - } -} - -// RouteFilterRuleType - The rule type of the rule. -type RouteFilterRuleType string - -const ( - RouteFilterRuleTypeCommunity RouteFilterRuleType = "Community" -) - -// PossibleRouteFilterRuleTypeValues returns the possible values for the RouteFilterRuleType const type. -func PossibleRouteFilterRuleTypeValues() []RouteFilterRuleType { - return []RouteFilterRuleType{ - RouteFilterRuleTypeCommunity, - } -} - -// RouteNextHopType - The type of Azure hop the packet should be sent to. -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -// PossibleRouteNextHopTypeValues returns the possible values for the RouteNextHopType const type. -func PossibleRouteNextHopTypeValues() []RouteNextHopType { - return []RouteNextHopType{ - RouteNextHopTypeInternet, - RouteNextHopTypeNone, - RouteNextHopTypeVirtualAppliance, - RouteNextHopTypeVirtualNetworkGateway, - RouteNextHopTypeVnetLocal, - } -} - -// RoutingState - The current routing state of the VirtualHub. -type RoutingState string - -const ( - RoutingStateFailed RoutingState = "Failed" - RoutingStateNone RoutingState = "None" - RoutingStateProvisioned RoutingState = "Provisioned" - RoutingStateProvisioning RoutingState = "Provisioning" -) - -// PossibleRoutingStateValues returns the possible values for the RoutingState const type. -func PossibleRoutingStateValues() []RoutingState { - return []RoutingState{ - RoutingStateFailed, - RoutingStateNone, - RoutingStateProvisioned, - RoutingStateProvisioning, - } -} - -// ScopeConnectionState - The current scope connection state. -type ScopeConnectionState string - -const ( - ScopeConnectionStateConflict ScopeConnectionState = "Conflict" - ScopeConnectionStateConnected ScopeConnectionState = "Connected" - ScopeConnectionStatePending ScopeConnectionState = "Pending" - ScopeConnectionStateRejected ScopeConnectionState = "Rejected" - ScopeConnectionStateRevoked ScopeConnectionState = "Revoked" -) - -// PossibleScopeConnectionStateValues returns the possible values for the ScopeConnectionState const type. -func PossibleScopeConnectionStateValues() []ScopeConnectionState { - return []ScopeConnectionState{ - ScopeConnectionStateConflict, - ScopeConnectionStateConnected, - ScopeConnectionStatePending, - ScopeConnectionStateRejected, - ScopeConnectionStateRevoked, - } -} - -// SecurityConfigurationRuleAccess - Whether network traffic is allowed or denied. -type SecurityConfigurationRuleAccess string - -const ( - SecurityConfigurationRuleAccessAllow SecurityConfigurationRuleAccess = "Allow" - SecurityConfigurationRuleAccessAlwaysAllow SecurityConfigurationRuleAccess = "AlwaysAllow" - SecurityConfigurationRuleAccessDeny SecurityConfigurationRuleAccess = "Deny" -) - -// PossibleSecurityConfigurationRuleAccessValues returns the possible values for the SecurityConfigurationRuleAccess const type. -func PossibleSecurityConfigurationRuleAccessValues() []SecurityConfigurationRuleAccess { - return []SecurityConfigurationRuleAccess{ - SecurityConfigurationRuleAccessAllow, - SecurityConfigurationRuleAccessAlwaysAllow, - SecurityConfigurationRuleAccessDeny, - } -} - -// SecurityConfigurationRuleDirection - The direction of the rule. The direction specifies if the rule will be evaluated on -// incoming or outgoing traffic. -type SecurityConfigurationRuleDirection string - -const ( - SecurityConfigurationRuleDirectionInbound SecurityConfigurationRuleDirection = "Inbound" - SecurityConfigurationRuleDirectionOutbound SecurityConfigurationRuleDirection = "Outbound" -) - -// PossibleSecurityConfigurationRuleDirectionValues returns the possible values for the SecurityConfigurationRuleDirection const type. -func PossibleSecurityConfigurationRuleDirectionValues() []SecurityConfigurationRuleDirection { - return []SecurityConfigurationRuleDirection{ - SecurityConfigurationRuleDirectionInbound, - SecurityConfigurationRuleDirectionOutbound, - } -} - -// SecurityConfigurationRuleProtocol - Network protocol this rule applies to. -type SecurityConfigurationRuleProtocol string - -const ( - SecurityConfigurationRuleProtocolAh SecurityConfigurationRuleProtocol = "Ah" - SecurityConfigurationRuleProtocolAny SecurityConfigurationRuleProtocol = "Any" - SecurityConfigurationRuleProtocolEsp SecurityConfigurationRuleProtocol = "Esp" - SecurityConfigurationRuleProtocolIcmp SecurityConfigurationRuleProtocol = "Icmp" - SecurityConfigurationRuleProtocolTCP SecurityConfigurationRuleProtocol = "Tcp" - SecurityConfigurationRuleProtocolUDP SecurityConfigurationRuleProtocol = "Udp" -) - -// PossibleSecurityConfigurationRuleProtocolValues returns the possible values for the SecurityConfigurationRuleProtocol const type. -func PossibleSecurityConfigurationRuleProtocolValues() []SecurityConfigurationRuleProtocol { - return []SecurityConfigurationRuleProtocol{ - SecurityConfigurationRuleProtocolAh, - SecurityConfigurationRuleProtocolAny, - SecurityConfigurationRuleProtocolEsp, - SecurityConfigurationRuleProtocolIcmp, - SecurityConfigurationRuleProtocolTCP, - SecurityConfigurationRuleProtocolUDP, - } -} - -// SecurityPartnerProviderConnectionStatus - The current state of the connection with Security Partner Provider. -type SecurityPartnerProviderConnectionStatus string - -const ( - SecurityPartnerProviderConnectionStatusConnected SecurityPartnerProviderConnectionStatus = "Connected" - SecurityPartnerProviderConnectionStatusNotConnected SecurityPartnerProviderConnectionStatus = "NotConnected" - SecurityPartnerProviderConnectionStatusPartiallyConnected SecurityPartnerProviderConnectionStatus = "PartiallyConnected" - SecurityPartnerProviderConnectionStatusUnknown SecurityPartnerProviderConnectionStatus = "Unknown" -) - -// PossibleSecurityPartnerProviderConnectionStatusValues returns the possible values for the SecurityPartnerProviderConnectionStatus const type. -func PossibleSecurityPartnerProviderConnectionStatusValues() []SecurityPartnerProviderConnectionStatus { - return []SecurityPartnerProviderConnectionStatus{ - SecurityPartnerProviderConnectionStatusConnected, - SecurityPartnerProviderConnectionStatusNotConnected, - SecurityPartnerProviderConnectionStatusPartiallyConnected, - SecurityPartnerProviderConnectionStatusUnknown, - } -} - -// SecurityProviderName - The Security Providers. -type SecurityProviderName string - -const ( - SecurityProviderNameCheckpoint SecurityProviderName = "Checkpoint" - SecurityProviderNameIBoss SecurityProviderName = "IBoss" - SecurityProviderNameZScaler SecurityProviderName = "ZScaler" -) - -// PossibleSecurityProviderNameValues returns the possible values for the SecurityProviderName const type. -func PossibleSecurityProviderNameValues() []SecurityProviderName { - return []SecurityProviderName{ - SecurityProviderNameCheckpoint, - SecurityProviderNameIBoss, - SecurityProviderNameZScaler, - } -} - -// SecurityRuleAccess - Whether network traffic is allowed or denied. -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -// PossibleSecurityRuleAccessValues returns the possible values for the SecurityRuleAccess const type. -func PossibleSecurityRuleAccessValues() []SecurityRuleAccess { - return []SecurityRuleAccess{ - SecurityRuleAccessAllow, - SecurityRuleAccessDeny, - } -} - -// SecurityRuleDirection - The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing -// traffic. -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -// PossibleSecurityRuleDirectionValues returns the possible values for the SecurityRuleDirection const type. -func PossibleSecurityRuleDirectionValues() []SecurityRuleDirection { - return []SecurityRuleDirection{ - SecurityRuleDirectionInbound, - SecurityRuleDirectionOutbound, - } -} - -// SecurityRuleProtocol - Network protocol this rule applies to. -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAsterisk SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTCP SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUDP SecurityRuleProtocol = "Udp" -) - -// PossibleSecurityRuleProtocolValues returns the possible values for the SecurityRuleProtocol const type. -func PossibleSecurityRuleProtocolValues() []SecurityRuleProtocol { - return []SecurityRuleProtocol{ - SecurityRuleProtocolAh, - SecurityRuleProtocolAsterisk, - SecurityRuleProtocolEsp, - SecurityRuleProtocolIcmp, - SecurityRuleProtocolTCP, - SecurityRuleProtocolUDP, - } -} - -// ServiceProviderProvisioningState - The ServiceProviderProvisioningState state of the resource. -type ServiceProviderProvisioningState string - -const ( - ServiceProviderProvisioningStateDeprovisioning ServiceProviderProvisioningState = "Deprovisioning" - ServiceProviderProvisioningStateNotProvisioned ServiceProviderProvisioningState = "NotProvisioned" - ServiceProviderProvisioningStateProvisioned ServiceProviderProvisioningState = "Provisioned" - ServiceProviderProvisioningStateProvisioning ServiceProviderProvisioningState = "Provisioning" -) - -// PossibleServiceProviderProvisioningStateValues returns the possible values for the ServiceProviderProvisioningState const type. -func PossibleServiceProviderProvisioningStateValues() []ServiceProviderProvisioningState { - return []ServiceProviderProvisioningState{ - ServiceProviderProvisioningStateDeprovisioning, - ServiceProviderProvisioningStateNotProvisioned, - ServiceProviderProvisioningStateProvisioned, - ServiceProviderProvisioningStateProvisioning, - } -} - -// Severity - The severity of the issue. -type Severity string - -const ( - SeverityError Severity = "Error" - SeverityWarning Severity = "Warning" -) - -// PossibleSeverityValues returns the possible values for the Severity const type. -func PossibleSeverityValues() []Severity { - return []Severity{ - SeverityError, - SeverityWarning, - } -} - -type SyncRemoteAddressSpace string - -const ( - SyncRemoteAddressSpaceTrue SyncRemoteAddressSpace = "true" -) - -// PossibleSyncRemoteAddressSpaceValues returns the possible values for the SyncRemoteAddressSpace const type. -func PossibleSyncRemoteAddressSpaceValues() []SyncRemoteAddressSpace { - return []SyncRemoteAddressSpace{ - SyncRemoteAddressSpaceTrue, - } -} - -// TransportProtocol - The transport protocol for the endpoint. -type TransportProtocol string - -const ( - TransportProtocolAll TransportProtocol = "All" - TransportProtocolTCP TransportProtocol = "Tcp" - TransportProtocolUDP TransportProtocol = "Udp" -) - -// PossibleTransportProtocolValues returns the possible values for the TransportProtocol const type. -func PossibleTransportProtocolValues() []TransportProtocol { - return []TransportProtocol{ - TransportProtocolAll, - TransportProtocolTCP, - TransportProtocolUDP, - } -} - -// TunnelConnectionStatus - The current state of the tunnel. -type TunnelConnectionStatus string - -const ( - TunnelConnectionStatusConnected TunnelConnectionStatus = "Connected" - TunnelConnectionStatusConnecting TunnelConnectionStatus = "Connecting" - TunnelConnectionStatusNotConnected TunnelConnectionStatus = "NotConnected" - TunnelConnectionStatusUnknown TunnelConnectionStatus = "Unknown" -) - -// PossibleTunnelConnectionStatusValues returns the possible values for the TunnelConnectionStatus const type. -func PossibleTunnelConnectionStatusValues() []TunnelConnectionStatus { - return []TunnelConnectionStatus{ - TunnelConnectionStatusConnected, - TunnelConnectionStatusConnecting, - TunnelConnectionStatusNotConnected, - TunnelConnectionStatusUnknown, - } -} - -// UsageUnit - An enum describing the unit of measurement. -type UsageUnit string - -const ( - UsageUnitCount UsageUnit = "Count" -) - -// PossibleUsageUnitValues returns the possible values for the UsageUnit const type. -func PossibleUsageUnitValues() []UsageUnit { - return []UsageUnit{ - UsageUnitCount, - } -} - -// UseHubGateway - Flag if need to use hub gateway. -type UseHubGateway string - -const ( - UseHubGatewayFalse UseHubGateway = "False" - UseHubGatewayTrue UseHubGateway = "True" -) - -// PossibleUseHubGatewayValues returns the possible values for the UseHubGateway const type. -func PossibleUseHubGatewayValues() []UseHubGateway { - return []UseHubGateway{ - UseHubGatewayFalse, - UseHubGatewayTrue, - } -} - -// VPNAuthenticationType - VPN authentication types enabled for the virtual network gateway. -type VPNAuthenticationType string - -const ( - VPNAuthenticationTypeAAD VPNAuthenticationType = "AAD" - VPNAuthenticationTypeCertificate VPNAuthenticationType = "Certificate" - VPNAuthenticationTypeRadius VPNAuthenticationType = "Radius" -) - -// PossibleVPNAuthenticationTypeValues returns the possible values for the VPNAuthenticationType const type. -func PossibleVPNAuthenticationTypeValues() []VPNAuthenticationType { - return []VPNAuthenticationType{ - VPNAuthenticationTypeAAD, - VPNAuthenticationTypeCertificate, - VPNAuthenticationTypeRadius, - } -} - -// VPNClientProtocol - VPN client protocol enabled for the virtual network gateway. -type VPNClientProtocol string - -const ( - VPNClientProtocolIkeV2 VPNClientProtocol = "IkeV2" - VPNClientProtocolOpenVPN VPNClientProtocol = "OpenVPN" - VPNClientProtocolSSTP VPNClientProtocol = "SSTP" -) - -// PossibleVPNClientProtocolValues returns the possible values for the VPNClientProtocol const type. -func PossibleVPNClientProtocolValues() []VPNClientProtocol { - return []VPNClientProtocol{ - VPNClientProtocolIkeV2, - VPNClientProtocolOpenVPN, - VPNClientProtocolSSTP, - } -} - -// VPNConnectionStatus - The current state of the vpn connection. -type VPNConnectionStatus string - -const ( - VPNConnectionStatusConnected VPNConnectionStatus = "Connected" - VPNConnectionStatusConnecting VPNConnectionStatus = "Connecting" - VPNConnectionStatusNotConnected VPNConnectionStatus = "NotConnected" - VPNConnectionStatusUnknown VPNConnectionStatus = "Unknown" -) - -// PossibleVPNConnectionStatusValues returns the possible values for the VPNConnectionStatus const type. -func PossibleVPNConnectionStatusValues() []VPNConnectionStatus { - return []VPNConnectionStatus{ - VPNConnectionStatusConnected, - VPNConnectionStatusConnecting, - VPNConnectionStatusNotConnected, - VPNConnectionStatusUnknown, - } -} - -// VPNGatewayGeneration - The generation for this VirtualNetworkGateway. Must be None if gatewayType is not VPN. -type VPNGatewayGeneration string - -const ( - VPNGatewayGenerationGeneration1 VPNGatewayGeneration = "Generation1" - VPNGatewayGenerationGeneration2 VPNGatewayGeneration = "Generation2" - VPNGatewayGenerationNone VPNGatewayGeneration = "None" -) - -// PossibleVPNGatewayGenerationValues returns the possible values for the VPNGatewayGeneration const type. -func PossibleVPNGatewayGenerationValues() []VPNGatewayGeneration { - return []VPNGatewayGeneration{ - VPNGatewayGenerationGeneration1, - VPNGatewayGenerationGeneration2, - VPNGatewayGenerationNone, - } -} - -// VPNGatewayTunnelingProtocol - VPN protocol enabled for the VpnServerConfiguration. -type VPNGatewayTunnelingProtocol string - -const ( - VPNGatewayTunnelingProtocolIkeV2 VPNGatewayTunnelingProtocol = "IkeV2" - VPNGatewayTunnelingProtocolOpenVPN VPNGatewayTunnelingProtocol = "OpenVPN" -) - -// PossibleVPNGatewayTunnelingProtocolValues returns the possible values for the VPNGatewayTunnelingProtocol const type. -func PossibleVPNGatewayTunnelingProtocolValues() []VPNGatewayTunnelingProtocol { - return []VPNGatewayTunnelingProtocol{ - VPNGatewayTunnelingProtocolIkeV2, - VPNGatewayTunnelingProtocolOpenVPN, - } -} - -// VPNLinkConnectionMode - Vpn link connection mode. -type VPNLinkConnectionMode string - -const ( - VPNLinkConnectionModeDefault VPNLinkConnectionMode = "Default" - VPNLinkConnectionModeInitiatorOnly VPNLinkConnectionMode = "InitiatorOnly" - VPNLinkConnectionModeResponderOnly VPNLinkConnectionMode = "ResponderOnly" -) - -// PossibleVPNLinkConnectionModeValues returns the possible values for the VPNLinkConnectionMode const type. -func PossibleVPNLinkConnectionModeValues() []VPNLinkConnectionMode { - return []VPNLinkConnectionMode{ - VPNLinkConnectionModeDefault, - VPNLinkConnectionModeInitiatorOnly, - VPNLinkConnectionModeResponderOnly, - } -} - -// VPNNatRuleMode - The Source NAT direction of a VPN NAT. -type VPNNatRuleMode string - -const ( - VPNNatRuleModeEgressSnat VPNNatRuleMode = "EgressSnat" - VPNNatRuleModeIngressSnat VPNNatRuleMode = "IngressSnat" -) - -// PossibleVPNNatRuleModeValues returns the possible values for the VPNNatRuleMode const type. -func PossibleVPNNatRuleModeValues() []VPNNatRuleMode { - return []VPNNatRuleMode{ - VPNNatRuleModeEgressSnat, - VPNNatRuleModeIngressSnat, - } -} - -// VPNNatRuleType - The type of NAT rule for VPN NAT. -type VPNNatRuleType string - -const ( - VPNNatRuleTypeDynamic VPNNatRuleType = "Dynamic" - VPNNatRuleTypeStatic VPNNatRuleType = "Static" -) - -// PossibleVPNNatRuleTypeValues returns the possible values for the VPNNatRuleType const type. -func PossibleVPNNatRuleTypeValues() []VPNNatRuleType { - return []VPNNatRuleType{ - VPNNatRuleTypeDynamic, - VPNNatRuleTypeStatic, - } -} - -// VPNPolicyMemberAttributeType - The Vpn Policy member attribute type. -type VPNPolicyMemberAttributeType string - -const ( - VPNPolicyMemberAttributeTypeAADGroupID VPNPolicyMemberAttributeType = "AADGroupId" - VPNPolicyMemberAttributeTypeCertificateGroupID VPNPolicyMemberAttributeType = "CertificateGroupId" - VPNPolicyMemberAttributeTypeRadiusAzureGroupID VPNPolicyMemberAttributeType = "RadiusAzureGroupId" -) - -// PossibleVPNPolicyMemberAttributeTypeValues returns the possible values for the VPNPolicyMemberAttributeType const type. -func PossibleVPNPolicyMemberAttributeTypeValues() []VPNPolicyMemberAttributeType { - return []VPNPolicyMemberAttributeType{ - VPNPolicyMemberAttributeTypeAADGroupID, - VPNPolicyMemberAttributeTypeCertificateGroupID, - VPNPolicyMemberAttributeTypeRadiusAzureGroupID, - } -} - -// VPNType - The type of this virtual network gateway. -type VPNType string - -const ( - VPNTypePolicyBased VPNType = "PolicyBased" - VPNTypeRouteBased VPNType = "RouteBased" -) - -// PossibleVPNTypeValues returns the possible values for the VPNType const type. -func PossibleVPNTypeValues() []VPNType { - return []VPNType{ - VPNTypePolicyBased, - VPNTypeRouteBased, - } -} - -// VerbosityLevel - Verbosity level. -type VerbosityLevel string - -const ( - VerbosityLevelFull VerbosityLevel = "Full" - VerbosityLevelMinimum VerbosityLevel = "Minimum" - VerbosityLevelNormal VerbosityLevel = "Normal" -) - -// PossibleVerbosityLevelValues returns the possible values for the VerbosityLevel const type. -func PossibleVerbosityLevelValues() []VerbosityLevel { - return []VerbosityLevel{ - VerbosityLevelFull, - VerbosityLevelMinimum, - VerbosityLevelNormal, - } -} - -// VirtualNetworkEncryptionEnforcement - If the encrypted VNet allows VM that does not support encryption -type VirtualNetworkEncryptionEnforcement string - -const ( - VirtualNetworkEncryptionEnforcementAllowUnencrypted VirtualNetworkEncryptionEnforcement = "AllowUnencrypted" - VirtualNetworkEncryptionEnforcementDropUnencrypted VirtualNetworkEncryptionEnforcement = "DropUnencrypted" -) - -// PossibleVirtualNetworkEncryptionEnforcementValues returns the possible values for the VirtualNetworkEncryptionEnforcement const type. -func PossibleVirtualNetworkEncryptionEnforcementValues() []VirtualNetworkEncryptionEnforcement { - return []VirtualNetworkEncryptionEnforcement{ - VirtualNetworkEncryptionEnforcementAllowUnencrypted, - VirtualNetworkEncryptionEnforcementDropUnencrypted, - } -} - -// VirtualNetworkGatewayConnectionMode - Gateway connection type. -type VirtualNetworkGatewayConnectionMode string - -const ( - VirtualNetworkGatewayConnectionModeDefault VirtualNetworkGatewayConnectionMode = "Default" - VirtualNetworkGatewayConnectionModeInitiatorOnly VirtualNetworkGatewayConnectionMode = "InitiatorOnly" - VirtualNetworkGatewayConnectionModeResponderOnly VirtualNetworkGatewayConnectionMode = "ResponderOnly" -) - -// PossibleVirtualNetworkGatewayConnectionModeValues returns the possible values for the VirtualNetworkGatewayConnectionMode const type. -func PossibleVirtualNetworkGatewayConnectionModeValues() []VirtualNetworkGatewayConnectionMode { - return []VirtualNetworkGatewayConnectionMode{ - VirtualNetworkGatewayConnectionModeDefault, - VirtualNetworkGatewayConnectionModeInitiatorOnly, - VirtualNetworkGatewayConnectionModeResponderOnly, - } -} - -// VirtualNetworkGatewayConnectionProtocol - Gateway connection protocol. -type VirtualNetworkGatewayConnectionProtocol string - -const ( - VirtualNetworkGatewayConnectionProtocolIKEv1 VirtualNetworkGatewayConnectionProtocol = "IKEv1" - VirtualNetworkGatewayConnectionProtocolIKEv2 VirtualNetworkGatewayConnectionProtocol = "IKEv2" -) - -// PossibleVirtualNetworkGatewayConnectionProtocolValues returns the possible values for the VirtualNetworkGatewayConnectionProtocol const type. -func PossibleVirtualNetworkGatewayConnectionProtocolValues() []VirtualNetworkGatewayConnectionProtocol { - return []VirtualNetworkGatewayConnectionProtocol{ - VirtualNetworkGatewayConnectionProtocolIKEv1, - VirtualNetworkGatewayConnectionProtocolIKEv2, - } -} - -// VirtualNetworkGatewayConnectionStatus - Virtual Network Gateway connection status. -type VirtualNetworkGatewayConnectionStatus string - -const ( - VirtualNetworkGatewayConnectionStatusConnected VirtualNetworkGatewayConnectionStatus = "Connected" - VirtualNetworkGatewayConnectionStatusConnecting VirtualNetworkGatewayConnectionStatus = "Connecting" - VirtualNetworkGatewayConnectionStatusNotConnected VirtualNetworkGatewayConnectionStatus = "NotConnected" - VirtualNetworkGatewayConnectionStatusUnknown VirtualNetworkGatewayConnectionStatus = "Unknown" -) - -// PossibleVirtualNetworkGatewayConnectionStatusValues returns the possible values for the VirtualNetworkGatewayConnectionStatus const type. -func PossibleVirtualNetworkGatewayConnectionStatusValues() []VirtualNetworkGatewayConnectionStatus { - return []VirtualNetworkGatewayConnectionStatus{ - VirtualNetworkGatewayConnectionStatusConnected, - VirtualNetworkGatewayConnectionStatusConnecting, - VirtualNetworkGatewayConnectionStatusNotConnected, - VirtualNetworkGatewayConnectionStatusUnknown, - } -} - -// VirtualNetworkGatewayConnectionType - Gateway connection type. -type VirtualNetworkGatewayConnectionType string - -const ( - VirtualNetworkGatewayConnectionTypeExpressRoute VirtualNetworkGatewayConnectionType = "ExpressRoute" - VirtualNetworkGatewayConnectionTypeIPsec VirtualNetworkGatewayConnectionType = "IPsec" - VirtualNetworkGatewayConnectionTypeVPNClient VirtualNetworkGatewayConnectionType = "VPNClient" - VirtualNetworkGatewayConnectionTypeVnet2Vnet VirtualNetworkGatewayConnectionType = "Vnet2Vnet" -) - -// PossibleVirtualNetworkGatewayConnectionTypeValues returns the possible values for the VirtualNetworkGatewayConnectionType const type. -func PossibleVirtualNetworkGatewayConnectionTypeValues() []VirtualNetworkGatewayConnectionType { - return []VirtualNetworkGatewayConnectionType{ - VirtualNetworkGatewayConnectionTypeExpressRoute, - VirtualNetworkGatewayConnectionTypeIPsec, - VirtualNetworkGatewayConnectionTypeVPNClient, - VirtualNetworkGatewayConnectionTypeVnet2Vnet, - } -} - -// VirtualNetworkGatewaySKUName - Gateway SKU name. -type VirtualNetworkGatewaySKUName string - -const ( - VirtualNetworkGatewaySKUNameBasic VirtualNetworkGatewaySKUName = "Basic" - VirtualNetworkGatewaySKUNameErGw1AZ VirtualNetworkGatewaySKUName = "ErGw1AZ" - VirtualNetworkGatewaySKUNameErGw2AZ VirtualNetworkGatewaySKUName = "ErGw2AZ" - VirtualNetworkGatewaySKUNameErGw3AZ VirtualNetworkGatewaySKUName = "ErGw3AZ" - VirtualNetworkGatewaySKUNameHighPerformance VirtualNetworkGatewaySKUName = "HighPerformance" - VirtualNetworkGatewaySKUNameStandard VirtualNetworkGatewaySKUName = "Standard" - VirtualNetworkGatewaySKUNameUltraPerformance VirtualNetworkGatewaySKUName = "UltraPerformance" - VirtualNetworkGatewaySKUNameVPNGw1 VirtualNetworkGatewaySKUName = "VpnGw1" - VirtualNetworkGatewaySKUNameVPNGw1AZ VirtualNetworkGatewaySKUName = "VpnGw1AZ" - VirtualNetworkGatewaySKUNameVPNGw2 VirtualNetworkGatewaySKUName = "VpnGw2" - VirtualNetworkGatewaySKUNameVPNGw2AZ VirtualNetworkGatewaySKUName = "VpnGw2AZ" - VirtualNetworkGatewaySKUNameVPNGw3 VirtualNetworkGatewaySKUName = "VpnGw3" - VirtualNetworkGatewaySKUNameVPNGw3AZ VirtualNetworkGatewaySKUName = "VpnGw3AZ" - VirtualNetworkGatewaySKUNameVPNGw4 VirtualNetworkGatewaySKUName = "VpnGw4" - VirtualNetworkGatewaySKUNameVPNGw4AZ VirtualNetworkGatewaySKUName = "VpnGw4AZ" - VirtualNetworkGatewaySKUNameVPNGw5 VirtualNetworkGatewaySKUName = "VpnGw5" - VirtualNetworkGatewaySKUNameVPNGw5AZ VirtualNetworkGatewaySKUName = "VpnGw5AZ" -) - -// PossibleVirtualNetworkGatewaySKUNameValues returns the possible values for the VirtualNetworkGatewaySKUName const type. -func PossibleVirtualNetworkGatewaySKUNameValues() []VirtualNetworkGatewaySKUName { - return []VirtualNetworkGatewaySKUName{ - VirtualNetworkGatewaySKUNameBasic, - VirtualNetworkGatewaySKUNameErGw1AZ, - VirtualNetworkGatewaySKUNameErGw2AZ, - VirtualNetworkGatewaySKUNameErGw3AZ, - VirtualNetworkGatewaySKUNameHighPerformance, - VirtualNetworkGatewaySKUNameStandard, - VirtualNetworkGatewaySKUNameUltraPerformance, - VirtualNetworkGatewaySKUNameVPNGw1, - VirtualNetworkGatewaySKUNameVPNGw1AZ, - VirtualNetworkGatewaySKUNameVPNGw2, - VirtualNetworkGatewaySKUNameVPNGw2AZ, - VirtualNetworkGatewaySKUNameVPNGw3, - VirtualNetworkGatewaySKUNameVPNGw3AZ, - VirtualNetworkGatewaySKUNameVPNGw4, - VirtualNetworkGatewaySKUNameVPNGw4AZ, - VirtualNetworkGatewaySKUNameVPNGw5, - VirtualNetworkGatewaySKUNameVPNGw5AZ, - } -} - -// VirtualNetworkGatewaySKUTier - Gateway SKU tier. -type VirtualNetworkGatewaySKUTier string - -const ( - VirtualNetworkGatewaySKUTierBasic VirtualNetworkGatewaySKUTier = "Basic" - VirtualNetworkGatewaySKUTierErGw1AZ VirtualNetworkGatewaySKUTier = "ErGw1AZ" - VirtualNetworkGatewaySKUTierErGw2AZ VirtualNetworkGatewaySKUTier = "ErGw2AZ" - VirtualNetworkGatewaySKUTierErGw3AZ VirtualNetworkGatewaySKUTier = "ErGw3AZ" - VirtualNetworkGatewaySKUTierHighPerformance VirtualNetworkGatewaySKUTier = "HighPerformance" - VirtualNetworkGatewaySKUTierStandard VirtualNetworkGatewaySKUTier = "Standard" - VirtualNetworkGatewaySKUTierUltraPerformance VirtualNetworkGatewaySKUTier = "UltraPerformance" - VirtualNetworkGatewaySKUTierVPNGw1 VirtualNetworkGatewaySKUTier = "VpnGw1" - VirtualNetworkGatewaySKUTierVPNGw1AZ VirtualNetworkGatewaySKUTier = "VpnGw1AZ" - VirtualNetworkGatewaySKUTierVPNGw2 VirtualNetworkGatewaySKUTier = "VpnGw2" - VirtualNetworkGatewaySKUTierVPNGw2AZ VirtualNetworkGatewaySKUTier = "VpnGw2AZ" - VirtualNetworkGatewaySKUTierVPNGw3 VirtualNetworkGatewaySKUTier = "VpnGw3" - VirtualNetworkGatewaySKUTierVPNGw3AZ VirtualNetworkGatewaySKUTier = "VpnGw3AZ" - VirtualNetworkGatewaySKUTierVPNGw4 VirtualNetworkGatewaySKUTier = "VpnGw4" - VirtualNetworkGatewaySKUTierVPNGw4AZ VirtualNetworkGatewaySKUTier = "VpnGw4AZ" - VirtualNetworkGatewaySKUTierVPNGw5 VirtualNetworkGatewaySKUTier = "VpnGw5" - VirtualNetworkGatewaySKUTierVPNGw5AZ VirtualNetworkGatewaySKUTier = "VpnGw5AZ" -) - -// PossibleVirtualNetworkGatewaySKUTierValues returns the possible values for the VirtualNetworkGatewaySKUTier const type. -func PossibleVirtualNetworkGatewaySKUTierValues() []VirtualNetworkGatewaySKUTier { - return []VirtualNetworkGatewaySKUTier{ - VirtualNetworkGatewaySKUTierBasic, - VirtualNetworkGatewaySKUTierErGw1AZ, - VirtualNetworkGatewaySKUTierErGw2AZ, - VirtualNetworkGatewaySKUTierErGw3AZ, - VirtualNetworkGatewaySKUTierHighPerformance, - VirtualNetworkGatewaySKUTierStandard, - VirtualNetworkGatewaySKUTierUltraPerformance, - VirtualNetworkGatewaySKUTierVPNGw1, - VirtualNetworkGatewaySKUTierVPNGw1AZ, - VirtualNetworkGatewaySKUTierVPNGw2, - VirtualNetworkGatewaySKUTierVPNGw2AZ, - VirtualNetworkGatewaySKUTierVPNGw3, - VirtualNetworkGatewaySKUTierVPNGw3AZ, - VirtualNetworkGatewaySKUTierVPNGw4, - VirtualNetworkGatewaySKUTierVPNGw4AZ, - VirtualNetworkGatewaySKUTierVPNGw5, - VirtualNetworkGatewaySKUTierVPNGw5AZ, - } -} - -// VirtualNetworkGatewayType - The type of this virtual network gateway. -type VirtualNetworkGatewayType string - -const ( - VirtualNetworkGatewayTypeExpressRoute VirtualNetworkGatewayType = "ExpressRoute" - VirtualNetworkGatewayTypeLocalGateway VirtualNetworkGatewayType = "LocalGateway" - VirtualNetworkGatewayTypeVPN VirtualNetworkGatewayType = "Vpn" -) - -// PossibleVirtualNetworkGatewayTypeValues returns the possible values for the VirtualNetworkGatewayType const type. -func PossibleVirtualNetworkGatewayTypeValues() []VirtualNetworkGatewayType { - return []VirtualNetworkGatewayType{ - VirtualNetworkGatewayTypeExpressRoute, - VirtualNetworkGatewayTypeLocalGateway, - VirtualNetworkGatewayTypeVPN, - } -} - -// VirtualNetworkPeeringLevel - The peering sync status of the virtual network peering. -type VirtualNetworkPeeringLevel string - -const ( - VirtualNetworkPeeringLevelFullyInSync VirtualNetworkPeeringLevel = "FullyInSync" - VirtualNetworkPeeringLevelLocalAndRemoteNotInSync VirtualNetworkPeeringLevel = "LocalAndRemoteNotInSync" - VirtualNetworkPeeringLevelLocalNotInSync VirtualNetworkPeeringLevel = "LocalNotInSync" - VirtualNetworkPeeringLevelRemoteNotInSync VirtualNetworkPeeringLevel = "RemoteNotInSync" -) - -// PossibleVirtualNetworkPeeringLevelValues returns the possible values for the VirtualNetworkPeeringLevel const type. -func PossibleVirtualNetworkPeeringLevelValues() []VirtualNetworkPeeringLevel { - return []VirtualNetworkPeeringLevel{ - VirtualNetworkPeeringLevelFullyInSync, - VirtualNetworkPeeringLevelLocalAndRemoteNotInSync, - VirtualNetworkPeeringLevelLocalNotInSync, - VirtualNetworkPeeringLevelRemoteNotInSync, - } -} - -// VirtualNetworkPeeringState - The status of the virtual network peering. -type VirtualNetworkPeeringState string - -const ( - VirtualNetworkPeeringStateConnected VirtualNetworkPeeringState = "Connected" - VirtualNetworkPeeringStateDisconnected VirtualNetworkPeeringState = "Disconnected" - VirtualNetworkPeeringStateInitiated VirtualNetworkPeeringState = "Initiated" -) - -// PossibleVirtualNetworkPeeringStateValues returns the possible values for the VirtualNetworkPeeringState const type. -func PossibleVirtualNetworkPeeringStateValues() []VirtualNetworkPeeringState { - return []VirtualNetworkPeeringState{ - VirtualNetworkPeeringStateConnected, - VirtualNetworkPeeringStateDisconnected, - VirtualNetworkPeeringStateInitiated, - } -} - -// VirtualNetworkPrivateEndpointNetworkPolicies - Enable or Disable apply network policies on private end point in the subnet. -type VirtualNetworkPrivateEndpointNetworkPolicies string - -const ( - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" -) - -// PossibleVirtualNetworkPrivateEndpointNetworkPoliciesValues returns the possible values for the VirtualNetworkPrivateEndpointNetworkPolicies const type. -func PossibleVirtualNetworkPrivateEndpointNetworkPoliciesValues() []VirtualNetworkPrivateEndpointNetworkPolicies { - return []VirtualNetworkPrivateEndpointNetworkPolicies{ - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, - } -} - -// VirtualNetworkPrivateLinkServiceNetworkPolicies - Enable or Disable apply network policies on private link service in the -// subnet. -type VirtualNetworkPrivateLinkServiceNetworkPolicies string - -const ( - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" -) - -// PossibleVirtualNetworkPrivateLinkServiceNetworkPoliciesValues returns the possible values for the VirtualNetworkPrivateLinkServiceNetworkPolicies const type. -func PossibleVirtualNetworkPrivateLinkServiceNetworkPoliciesValues() []VirtualNetworkPrivateLinkServiceNetworkPolicies { - return []VirtualNetworkPrivateLinkServiceNetworkPolicies{ - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, - } -} - -// VirtualWanSecurityProviderType - The virtual wan security provider type. -type VirtualWanSecurityProviderType string - -const ( - VirtualWanSecurityProviderTypeExternal VirtualWanSecurityProviderType = "External" - VirtualWanSecurityProviderTypeNative VirtualWanSecurityProviderType = "Native" -) - -// PossibleVirtualWanSecurityProviderTypeValues returns the possible values for the VirtualWanSecurityProviderType const type. -func PossibleVirtualWanSecurityProviderTypeValues() []VirtualWanSecurityProviderType { - return []VirtualWanSecurityProviderType{ - VirtualWanSecurityProviderTypeExternal, - VirtualWanSecurityProviderTypeNative, - } -} - -// WebApplicationFirewallAction - Type of Actions. -type WebApplicationFirewallAction string - -const ( - WebApplicationFirewallActionAllow WebApplicationFirewallAction = "Allow" - WebApplicationFirewallActionBlock WebApplicationFirewallAction = "Block" - WebApplicationFirewallActionLog WebApplicationFirewallAction = "Log" -) - -// PossibleWebApplicationFirewallActionValues returns the possible values for the WebApplicationFirewallAction const type. -func PossibleWebApplicationFirewallActionValues() []WebApplicationFirewallAction { - return []WebApplicationFirewallAction{ - WebApplicationFirewallActionAllow, - WebApplicationFirewallActionBlock, - WebApplicationFirewallActionLog, - } -} - -// WebApplicationFirewallEnabledState - The state of the policy. -type WebApplicationFirewallEnabledState string - -const ( - WebApplicationFirewallEnabledStateDisabled WebApplicationFirewallEnabledState = "Disabled" - WebApplicationFirewallEnabledStateEnabled WebApplicationFirewallEnabledState = "Enabled" -) - -// PossibleWebApplicationFirewallEnabledStateValues returns the possible values for the WebApplicationFirewallEnabledState const type. -func PossibleWebApplicationFirewallEnabledStateValues() []WebApplicationFirewallEnabledState { - return []WebApplicationFirewallEnabledState{ - WebApplicationFirewallEnabledStateDisabled, - WebApplicationFirewallEnabledStateEnabled, - } -} - -// WebApplicationFirewallMatchVariable - Match Variable. -type WebApplicationFirewallMatchVariable string - -const ( - WebApplicationFirewallMatchVariablePostArgs WebApplicationFirewallMatchVariable = "PostArgs" - WebApplicationFirewallMatchVariableQueryString WebApplicationFirewallMatchVariable = "QueryString" - WebApplicationFirewallMatchVariableRemoteAddr WebApplicationFirewallMatchVariable = "RemoteAddr" - WebApplicationFirewallMatchVariableRequestBody WebApplicationFirewallMatchVariable = "RequestBody" - WebApplicationFirewallMatchVariableRequestCookies WebApplicationFirewallMatchVariable = "RequestCookies" - WebApplicationFirewallMatchVariableRequestHeaders WebApplicationFirewallMatchVariable = "RequestHeaders" - WebApplicationFirewallMatchVariableRequestMethod WebApplicationFirewallMatchVariable = "RequestMethod" - WebApplicationFirewallMatchVariableRequestURI WebApplicationFirewallMatchVariable = "RequestUri" -) - -// PossibleWebApplicationFirewallMatchVariableValues returns the possible values for the WebApplicationFirewallMatchVariable const type. -func PossibleWebApplicationFirewallMatchVariableValues() []WebApplicationFirewallMatchVariable { - return []WebApplicationFirewallMatchVariable{ - WebApplicationFirewallMatchVariablePostArgs, - WebApplicationFirewallMatchVariableQueryString, - WebApplicationFirewallMatchVariableRemoteAddr, - WebApplicationFirewallMatchVariableRequestBody, - WebApplicationFirewallMatchVariableRequestCookies, - WebApplicationFirewallMatchVariableRequestHeaders, - WebApplicationFirewallMatchVariableRequestMethod, - WebApplicationFirewallMatchVariableRequestURI, - } -} - -// WebApplicationFirewallMode - The mode of the policy. -type WebApplicationFirewallMode string - -const ( - WebApplicationFirewallModeDetection WebApplicationFirewallMode = "Detection" - WebApplicationFirewallModePrevention WebApplicationFirewallMode = "Prevention" -) - -// PossibleWebApplicationFirewallModeValues returns the possible values for the WebApplicationFirewallMode const type. -func PossibleWebApplicationFirewallModeValues() []WebApplicationFirewallMode { - return []WebApplicationFirewallMode{ - WebApplicationFirewallModeDetection, - WebApplicationFirewallModePrevention, - } -} - -// WebApplicationFirewallOperator - The operator to be matched. -type WebApplicationFirewallOperator string - -const ( - WebApplicationFirewallOperatorAny WebApplicationFirewallOperator = "Any" - WebApplicationFirewallOperatorBeginsWith WebApplicationFirewallOperator = "BeginsWith" - WebApplicationFirewallOperatorContains WebApplicationFirewallOperator = "Contains" - WebApplicationFirewallOperatorEndsWith WebApplicationFirewallOperator = "EndsWith" - WebApplicationFirewallOperatorEqual WebApplicationFirewallOperator = "Equal" - WebApplicationFirewallOperatorGeoMatch WebApplicationFirewallOperator = "GeoMatch" - WebApplicationFirewallOperatorGreaterThan WebApplicationFirewallOperator = "GreaterThan" - WebApplicationFirewallOperatorGreaterThanOrEqual WebApplicationFirewallOperator = "GreaterThanOrEqual" - WebApplicationFirewallOperatorIPMatch WebApplicationFirewallOperator = "IPMatch" - WebApplicationFirewallOperatorLessThan WebApplicationFirewallOperator = "LessThan" - WebApplicationFirewallOperatorLessThanOrEqual WebApplicationFirewallOperator = "LessThanOrEqual" - WebApplicationFirewallOperatorRegex WebApplicationFirewallOperator = "Regex" -) - -// PossibleWebApplicationFirewallOperatorValues returns the possible values for the WebApplicationFirewallOperator const type. -func PossibleWebApplicationFirewallOperatorValues() []WebApplicationFirewallOperator { - return []WebApplicationFirewallOperator{ - WebApplicationFirewallOperatorAny, - WebApplicationFirewallOperatorBeginsWith, - WebApplicationFirewallOperatorContains, - WebApplicationFirewallOperatorEndsWith, - WebApplicationFirewallOperatorEqual, - WebApplicationFirewallOperatorGeoMatch, - WebApplicationFirewallOperatorGreaterThan, - WebApplicationFirewallOperatorGreaterThanOrEqual, - WebApplicationFirewallOperatorIPMatch, - WebApplicationFirewallOperatorLessThan, - WebApplicationFirewallOperatorLessThanOrEqual, - WebApplicationFirewallOperatorRegex, - } -} - -// WebApplicationFirewallPolicyResourceState - Resource status of the policy. -type WebApplicationFirewallPolicyResourceState string - -const ( - WebApplicationFirewallPolicyResourceStateCreating WebApplicationFirewallPolicyResourceState = "Creating" - WebApplicationFirewallPolicyResourceStateDeleting WebApplicationFirewallPolicyResourceState = "Deleting" - WebApplicationFirewallPolicyResourceStateDisabled WebApplicationFirewallPolicyResourceState = "Disabled" - WebApplicationFirewallPolicyResourceStateDisabling WebApplicationFirewallPolicyResourceState = "Disabling" - WebApplicationFirewallPolicyResourceStateEnabled WebApplicationFirewallPolicyResourceState = "Enabled" - WebApplicationFirewallPolicyResourceStateEnabling WebApplicationFirewallPolicyResourceState = "Enabling" -) - -// PossibleWebApplicationFirewallPolicyResourceStateValues returns the possible values for the WebApplicationFirewallPolicyResourceState const type. -func PossibleWebApplicationFirewallPolicyResourceStateValues() []WebApplicationFirewallPolicyResourceState { - return []WebApplicationFirewallPolicyResourceState{ - WebApplicationFirewallPolicyResourceStateCreating, - WebApplicationFirewallPolicyResourceStateDeleting, - WebApplicationFirewallPolicyResourceStateDisabled, - WebApplicationFirewallPolicyResourceStateDisabling, - WebApplicationFirewallPolicyResourceStateEnabled, - WebApplicationFirewallPolicyResourceStateEnabling, - } -} - -// WebApplicationFirewallRuleType - The rule type. -type WebApplicationFirewallRuleType string - -const ( - WebApplicationFirewallRuleTypeInvalid WebApplicationFirewallRuleType = "Invalid" - WebApplicationFirewallRuleTypeMatchRule WebApplicationFirewallRuleType = "MatchRule" -) - -// PossibleWebApplicationFirewallRuleTypeValues returns the possible values for the WebApplicationFirewallRuleType const type. -func PossibleWebApplicationFirewallRuleTypeValues() []WebApplicationFirewallRuleType { - return []WebApplicationFirewallRuleType{ - WebApplicationFirewallRuleTypeInvalid, - WebApplicationFirewallRuleTypeMatchRule, - } -} - -// WebApplicationFirewallTransform - Transforms applied before matching. -type WebApplicationFirewallTransform string - -const ( - WebApplicationFirewallTransformHTMLEntityDecode WebApplicationFirewallTransform = "HtmlEntityDecode" - WebApplicationFirewallTransformLowercase WebApplicationFirewallTransform = "Lowercase" - WebApplicationFirewallTransformRemoveNulls WebApplicationFirewallTransform = "RemoveNulls" - WebApplicationFirewallTransformTrim WebApplicationFirewallTransform = "Trim" - WebApplicationFirewallTransformURLDecode WebApplicationFirewallTransform = "UrlDecode" - WebApplicationFirewallTransformURLEncode WebApplicationFirewallTransform = "UrlEncode" -) - -// PossibleWebApplicationFirewallTransformValues returns the possible values for the WebApplicationFirewallTransform const type. -func PossibleWebApplicationFirewallTransformValues() []WebApplicationFirewallTransform { - return []WebApplicationFirewallTransform{ - WebApplicationFirewallTransformHTMLEntityDecode, - WebApplicationFirewallTransformLowercase, - WebApplicationFirewallTransformRemoveNulls, - WebApplicationFirewallTransformTrim, - WebApplicationFirewallTransformURLDecode, - WebApplicationFirewallTransformURLEncode, - } -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/customipprefixes_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/customipprefixes_client.go deleted file mode 100644 index 2edf1cda..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/customipprefixes_client.go +++ /dev/null @@ -1,429 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// CustomIPPrefixesClient contains the methods for the CustomIPPrefixes group. -// Don't use this type directly, use NewCustomIPPrefixesClient() instead. -type CustomIPPrefixesClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewCustomIPPrefixesClient creates a new instance of CustomIPPrefixesClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewCustomIPPrefixesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CustomIPPrefixesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &CustomIPPrefixesClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates a custom IP prefix. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// customIPPrefixName - The name of the custom IP prefix. -// parameters - Parameters supplied to the create or update custom IP prefix operation. -// options - CustomIPPrefixesClientBeginCreateOrUpdateOptions contains the optional parameters for the CustomIPPrefixesClient.BeginCreateOrUpdate -// method. -func (client *CustomIPPrefixesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, customIPPrefixName string, parameters CustomIPPrefix, options *CustomIPPrefixesClientBeginCreateOrUpdateOptions) (*runtime.Poller[CustomIPPrefixesClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, customIPPrefixName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[CustomIPPrefixesClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[CustomIPPrefixesClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates or updates a custom IP prefix. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *CustomIPPrefixesClient) createOrUpdate(ctx context.Context, resourceGroupName string, customIPPrefixName string, parameters CustomIPPrefix, options *CustomIPPrefixesClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, customIPPrefixName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *CustomIPPrefixesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, customIPPrefixName string, parameters CustomIPPrefix, options *CustomIPPrefixesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/customIpPrefixes/{customIpPrefixName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if customIPPrefixName == "" { - return nil, errors.New("parameter customIPPrefixName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{customIpPrefixName}", url.PathEscape(customIPPrefixName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginDelete - Deletes the specified custom IP prefix. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// customIPPrefixName - The name of the CustomIpPrefix. -// options - CustomIPPrefixesClientBeginDeleteOptions contains the optional parameters for the CustomIPPrefixesClient.BeginDelete -// method. -func (client *CustomIPPrefixesClient) BeginDelete(ctx context.Context, resourceGroupName string, customIPPrefixName string, options *CustomIPPrefixesClientBeginDeleteOptions) (*runtime.Poller[CustomIPPrefixesClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, customIPPrefixName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[CustomIPPrefixesClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[CustomIPPrefixesClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes the specified custom IP prefix. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *CustomIPPrefixesClient) deleteOperation(ctx context.Context, resourceGroupName string, customIPPrefixName string, options *CustomIPPrefixesClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, customIPPrefixName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *CustomIPPrefixesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, customIPPrefixName string, options *CustomIPPrefixesClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/customIpPrefixes/{customIpPrefixName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if customIPPrefixName == "" { - return nil, errors.New("parameter customIPPrefixName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{customIpPrefixName}", url.PathEscape(customIPPrefixName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets the specified custom IP prefix in a specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// customIPPrefixName - The name of the custom IP prefix. -// options - CustomIPPrefixesClientGetOptions contains the optional parameters for the CustomIPPrefixesClient.Get method. -func (client *CustomIPPrefixesClient) Get(ctx context.Context, resourceGroupName string, customIPPrefixName string, options *CustomIPPrefixesClientGetOptions) (CustomIPPrefixesClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, customIPPrefixName, options) - if err != nil { - return CustomIPPrefixesClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return CustomIPPrefixesClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return CustomIPPrefixesClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *CustomIPPrefixesClient) getCreateRequest(ctx context.Context, resourceGroupName string, customIPPrefixName string, options *CustomIPPrefixesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/customIpPrefixes/{customIpPrefixName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if customIPPrefixName == "" { - return nil, errors.New("parameter customIPPrefixName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{customIpPrefixName}", url.PathEscape(customIPPrefixName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *CustomIPPrefixesClient) getHandleResponse(resp *http.Response) (CustomIPPrefixesClientGetResponse, error) { - result := CustomIPPrefixesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.CustomIPPrefix); err != nil { - return CustomIPPrefixesClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Gets all custom IP prefixes in a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// options - CustomIPPrefixesClientListOptions contains the optional parameters for the CustomIPPrefixesClient.List method. -func (client *CustomIPPrefixesClient) NewListPager(resourceGroupName string, options *CustomIPPrefixesClientListOptions) *runtime.Pager[CustomIPPrefixesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[CustomIPPrefixesClientListResponse]{ - More: func(page CustomIPPrefixesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *CustomIPPrefixesClientListResponse) (CustomIPPrefixesClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return CustomIPPrefixesClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return CustomIPPrefixesClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return CustomIPPrefixesClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *CustomIPPrefixesClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *CustomIPPrefixesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/customIpPrefixes" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *CustomIPPrefixesClient) listHandleResponse(resp *http.Response) (CustomIPPrefixesClientListResponse, error) { - result := CustomIPPrefixesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.CustomIPPrefixListResult); err != nil { - return CustomIPPrefixesClientListResponse{}, err - } - return result, nil -} - -// NewListAllPager - Gets all the custom IP prefixes in a subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// options - CustomIPPrefixesClientListAllOptions contains the optional parameters for the CustomIPPrefixesClient.ListAll -// method. -func (client *CustomIPPrefixesClient) NewListAllPager(options *CustomIPPrefixesClientListAllOptions) *runtime.Pager[CustomIPPrefixesClientListAllResponse] { - return runtime.NewPager(runtime.PagingHandler[CustomIPPrefixesClientListAllResponse]{ - More: func(page CustomIPPrefixesClientListAllResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *CustomIPPrefixesClientListAllResponse) (CustomIPPrefixesClientListAllResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listAllCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return CustomIPPrefixesClientListAllResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return CustomIPPrefixesClientListAllResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return CustomIPPrefixesClientListAllResponse{}, runtime.NewResponseError(resp) - } - return client.listAllHandleResponse(resp) - }, - }) -} - -// listAllCreateRequest creates the ListAll request. -func (client *CustomIPPrefixesClient) listAllCreateRequest(ctx context.Context, options *CustomIPPrefixesClientListAllOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/customIpPrefixes" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listAllHandleResponse handles the ListAll response. -func (client *CustomIPPrefixesClient) listAllHandleResponse(resp *http.Response) (CustomIPPrefixesClientListAllResponse, error) { - result := CustomIPPrefixesClientListAllResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.CustomIPPrefixListResult); err != nil { - return CustomIPPrefixesClientListAllResponse{}, err - } - return result, nil -} - -// UpdateTags - Updates custom IP prefix tags. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// customIPPrefixName - The name of the custom IP prefix. -// parameters - Parameters supplied to update custom IP prefix tags. -// options - CustomIPPrefixesClientUpdateTagsOptions contains the optional parameters for the CustomIPPrefixesClient.UpdateTags -// method. -func (client *CustomIPPrefixesClient) UpdateTags(ctx context.Context, resourceGroupName string, customIPPrefixName string, parameters TagsObject, options *CustomIPPrefixesClientUpdateTagsOptions) (CustomIPPrefixesClientUpdateTagsResponse, error) { - req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, customIPPrefixName, parameters, options) - if err != nil { - return CustomIPPrefixesClientUpdateTagsResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return CustomIPPrefixesClientUpdateTagsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return CustomIPPrefixesClientUpdateTagsResponse{}, runtime.NewResponseError(resp) - } - return client.updateTagsHandleResponse(resp) -} - -// updateTagsCreateRequest creates the UpdateTags request. -func (client *CustomIPPrefixesClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, customIPPrefixName string, parameters TagsObject, options *CustomIPPrefixesClientUpdateTagsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/customIpPrefixes/{customIpPrefixName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if customIPPrefixName == "" { - return nil, errors.New("parameter customIPPrefixName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{customIpPrefixName}", url.PathEscape(customIPPrefixName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// updateTagsHandleResponse handles the UpdateTags response. -func (client *CustomIPPrefixesClient) updateTagsHandleResponse(resp *http.Response) (CustomIPPrefixesClientUpdateTagsResponse, error) { - result := CustomIPPrefixesClientUpdateTagsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.CustomIPPrefix); err != nil { - return CustomIPPrefixesClientUpdateTagsResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/ddoscustompolicies_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/ddoscustompolicies_client.go deleted file mode 100644 index 71abcb27..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/ddoscustompolicies_client.go +++ /dev/null @@ -1,302 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// DdosCustomPoliciesClient contains the methods for the DdosCustomPolicies group. -// Don't use this type directly, use NewDdosCustomPoliciesClient() instead. -type DdosCustomPoliciesClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewDdosCustomPoliciesClient creates a new instance of DdosCustomPoliciesClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewDdosCustomPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DdosCustomPoliciesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &DdosCustomPoliciesClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates a DDoS custom policy. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// ddosCustomPolicyName - The name of the DDoS custom policy. -// parameters - Parameters supplied to the create or update operation. -// options - DdosCustomPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the DdosCustomPoliciesClient.BeginCreateOrUpdate -// method. -func (client *DdosCustomPoliciesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, ddosCustomPolicyName string, parameters DdosCustomPolicy, options *DdosCustomPoliciesClientBeginCreateOrUpdateOptions) (*runtime.Poller[DdosCustomPoliciesClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, ddosCustomPolicyName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[DdosCustomPoliciesClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[DdosCustomPoliciesClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates or updates a DDoS custom policy. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *DdosCustomPoliciesClient) createOrUpdate(ctx context.Context, resourceGroupName string, ddosCustomPolicyName string, parameters DdosCustomPolicy, options *DdosCustomPoliciesClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, ddosCustomPolicyName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *DdosCustomPoliciesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, ddosCustomPolicyName string, parameters DdosCustomPolicy, options *DdosCustomPoliciesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosCustomPolicies/{ddosCustomPolicyName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if ddosCustomPolicyName == "" { - return nil, errors.New("parameter ddosCustomPolicyName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{ddosCustomPolicyName}", url.PathEscape(ddosCustomPolicyName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginDelete - Deletes the specified DDoS custom policy. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// ddosCustomPolicyName - The name of the DDoS custom policy. -// options - DdosCustomPoliciesClientBeginDeleteOptions contains the optional parameters for the DdosCustomPoliciesClient.BeginDelete -// method. -func (client *DdosCustomPoliciesClient) BeginDelete(ctx context.Context, resourceGroupName string, ddosCustomPolicyName string, options *DdosCustomPoliciesClientBeginDeleteOptions) (*runtime.Poller[DdosCustomPoliciesClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, ddosCustomPolicyName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[DdosCustomPoliciesClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[DdosCustomPoliciesClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes the specified DDoS custom policy. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *DdosCustomPoliciesClient) deleteOperation(ctx context.Context, resourceGroupName string, ddosCustomPolicyName string, options *DdosCustomPoliciesClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, ddosCustomPolicyName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *DdosCustomPoliciesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, ddosCustomPolicyName string, options *DdosCustomPoliciesClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosCustomPolicies/{ddosCustomPolicyName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if ddosCustomPolicyName == "" { - return nil, errors.New("parameter ddosCustomPolicyName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{ddosCustomPolicyName}", url.PathEscape(ddosCustomPolicyName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets information about the specified DDoS custom policy. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// ddosCustomPolicyName - The name of the DDoS custom policy. -// options - DdosCustomPoliciesClientGetOptions contains the optional parameters for the DdosCustomPoliciesClient.Get method. -func (client *DdosCustomPoliciesClient) Get(ctx context.Context, resourceGroupName string, ddosCustomPolicyName string, options *DdosCustomPoliciesClientGetOptions) (DdosCustomPoliciesClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, ddosCustomPolicyName, options) - if err != nil { - return DdosCustomPoliciesClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return DdosCustomPoliciesClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DdosCustomPoliciesClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *DdosCustomPoliciesClient) getCreateRequest(ctx context.Context, resourceGroupName string, ddosCustomPolicyName string, options *DdosCustomPoliciesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosCustomPolicies/{ddosCustomPolicyName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if ddosCustomPolicyName == "" { - return nil, errors.New("parameter ddosCustomPolicyName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{ddosCustomPolicyName}", url.PathEscape(ddosCustomPolicyName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *DdosCustomPoliciesClient) getHandleResponse(resp *http.Response) (DdosCustomPoliciesClientGetResponse, error) { - result := DdosCustomPoliciesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DdosCustomPolicy); err != nil { - return DdosCustomPoliciesClientGetResponse{}, err - } - return result, nil -} - -// UpdateTags - Update a DDoS custom policy tags. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// ddosCustomPolicyName - The name of the DDoS custom policy. -// parameters - Parameters supplied to update DDoS custom policy resource tags. -// options - DdosCustomPoliciesClientUpdateTagsOptions contains the optional parameters for the DdosCustomPoliciesClient.UpdateTags -// method. -func (client *DdosCustomPoliciesClient) UpdateTags(ctx context.Context, resourceGroupName string, ddosCustomPolicyName string, parameters TagsObject, options *DdosCustomPoliciesClientUpdateTagsOptions) (DdosCustomPoliciesClientUpdateTagsResponse, error) { - req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, ddosCustomPolicyName, parameters, options) - if err != nil { - return DdosCustomPoliciesClientUpdateTagsResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return DdosCustomPoliciesClientUpdateTagsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DdosCustomPoliciesClientUpdateTagsResponse{}, runtime.NewResponseError(resp) - } - return client.updateTagsHandleResponse(resp) -} - -// updateTagsCreateRequest creates the UpdateTags request. -func (client *DdosCustomPoliciesClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, ddosCustomPolicyName string, parameters TagsObject, options *DdosCustomPoliciesClientUpdateTagsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosCustomPolicies/{ddosCustomPolicyName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if ddosCustomPolicyName == "" { - return nil, errors.New("parameter ddosCustomPolicyName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{ddosCustomPolicyName}", url.PathEscape(ddosCustomPolicyName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// updateTagsHandleResponse handles the UpdateTags response. -func (client *DdosCustomPoliciesClient) updateTagsHandleResponse(resp *http.Response) (DdosCustomPoliciesClientUpdateTagsResponse, error) { - result := DdosCustomPoliciesClientUpdateTagsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DdosCustomPolicy); err != nil { - return DdosCustomPoliciesClientUpdateTagsResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/ddosprotectionplans_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/ddosprotectionplans_client.go deleted file mode 100644 index 123a897b..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/ddosprotectionplans_client.go +++ /dev/null @@ -1,427 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// DdosProtectionPlansClient contains the methods for the DdosProtectionPlans group. -// Don't use this type directly, use NewDdosProtectionPlansClient() instead. -type DdosProtectionPlansClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewDdosProtectionPlansClient creates a new instance of DdosProtectionPlansClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewDdosProtectionPlansClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DdosProtectionPlansClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &DdosProtectionPlansClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates a DDoS protection plan. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// ddosProtectionPlanName - The name of the DDoS protection plan. -// parameters - Parameters supplied to the create or update operation. -// options - DdosProtectionPlansClientBeginCreateOrUpdateOptions contains the optional parameters for the DdosProtectionPlansClient.BeginCreateOrUpdate -// method. -func (client *DdosProtectionPlansClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, ddosProtectionPlanName string, parameters DdosProtectionPlan, options *DdosProtectionPlansClientBeginCreateOrUpdateOptions) (*runtime.Poller[DdosProtectionPlansClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, ddosProtectionPlanName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[DdosProtectionPlansClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[DdosProtectionPlansClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates or updates a DDoS protection plan. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *DdosProtectionPlansClient) createOrUpdate(ctx context.Context, resourceGroupName string, ddosProtectionPlanName string, parameters DdosProtectionPlan, options *DdosProtectionPlansClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, ddosProtectionPlanName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *DdosProtectionPlansClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, ddosProtectionPlanName string, parameters DdosProtectionPlan, options *DdosProtectionPlansClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if ddosProtectionPlanName == "" { - return nil, errors.New("parameter ddosProtectionPlanName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{ddosProtectionPlanName}", url.PathEscape(ddosProtectionPlanName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginDelete - Deletes the specified DDoS protection plan. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// ddosProtectionPlanName - The name of the DDoS protection plan. -// options - DdosProtectionPlansClientBeginDeleteOptions contains the optional parameters for the DdosProtectionPlansClient.BeginDelete -// method. -func (client *DdosProtectionPlansClient) BeginDelete(ctx context.Context, resourceGroupName string, ddosProtectionPlanName string, options *DdosProtectionPlansClientBeginDeleteOptions) (*runtime.Poller[DdosProtectionPlansClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, ddosProtectionPlanName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[DdosProtectionPlansClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[DdosProtectionPlansClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes the specified DDoS protection plan. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *DdosProtectionPlansClient) deleteOperation(ctx context.Context, resourceGroupName string, ddosProtectionPlanName string, options *DdosProtectionPlansClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, ddosProtectionPlanName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *DdosProtectionPlansClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, ddosProtectionPlanName string, options *DdosProtectionPlansClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if ddosProtectionPlanName == "" { - return nil, errors.New("parameter ddosProtectionPlanName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{ddosProtectionPlanName}", url.PathEscape(ddosProtectionPlanName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets information about the specified DDoS protection plan. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// ddosProtectionPlanName - The name of the DDoS protection plan. -// options - DdosProtectionPlansClientGetOptions contains the optional parameters for the DdosProtectionPlansClient.Get method. -func (client *DdosProtectionPlansClient) Get(ctx context.Context, resourceGroupName string, ddosProtectionPlanName string, options *DdosProtectionPlansClientGetOptions) (DdosProtectionPlansClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, ddosProtectionPlanName, options) - if err != nil { - return DdosProtectionPlansClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return DdosProtectionPlansClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DdosProtectionPlansClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *DdosProtectionPlansClient) getCreateRequest(ctx context.Context, resourceGroupName string, ddosProtectionPlanName string, options *DdosProtectionPlansClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if ddosProtectionPlanName == "" { - return nil, errors.New("parameter ddosProtectionPlanName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{ddosProtectionPlanName}", url.PathEscape(ddosProtectionPlanName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *DdosProtectionPlansClient) getHandleResponse(resp *http.Response) (DdosProtectionPlansClientGetResponse, error) { - result := DdosProtectionPlansClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DdosProtectionPlan); err != nil { - return DdosProtectionPlansClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Gets all DDoS protection plans in a subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// options - DdosProtectionPlansClientListOptions contains the optional parameters for the DdosProtectionPlansClient.List -// method. -func (client *DdosProtectionPlansClient) NewListPager(options *DdosProtectionPlansClientListOptions) *runtime.Pager[DdosProtectionPlansClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[DdosProtectionPlansClientListResponse]{ - More: func(page DdosProtectionPlansClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *DdosProtectionPlansClientListResponse) (DdosProtectionPlansClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return DdosProtectionPlansClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return DdosProtectionPlansClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DdosProtectionPlansClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *DdosProtectionPlansClient) listCreateRequest(ctx context.Context, options *DdosProtectionPlansClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/ddosProtectionPlans" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *DdosProtectionPlansClient) listHandleResponse(resp *http.Response) (DdosProtectionPlansClientListResponse, error) { - result := DdosProtectionPlansClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DdosProtectionPlanListResult); err != nil { - return DdosProtectionPlansClientListResponse{}, err - } - return result, nil -} - -// NewListByResourceGroupPager - Gets all the DDoS protection plans in a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// options - DdosProtectionPlansClientListByResourceGroupOptions contains the optional parameters for the DdosProtectionPlansClient.ListByResourceGroup -// method. -func (client *DdosProtectionPlansClient) NewListByResourceGroupPager(resourceGroupName string, options *DdosProtectionPlansClientListByResourceGroupOptions) *runtime.Pager[DdosProtectionPlansClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[DdosProtectionPlansClientListByResourceGroupResponse]{ - More: func(page DdosProtectionPlansClientListByResourceGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *DdosProtectionPlansClientListByResourceGroupResponse) (DdosProtectionPlansClientListByResourceGroupResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return DdosProtectionPlansClientListByResourceGroupResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return DdosProtectionPlansClientListByResourceGroupResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DdosProtectionPlansClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) - } - return client.listByResourceGroupHandleResponse(resp) - }, - }) -} - -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *DdosProtectionPlansClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *DdosProtectionPlansClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *DdosProtectionPlansClient) listByResourceGroupHandleResponse(resp *http.Response) (DdosProtectionPlansClientListByResourceGroupResponse, error) { - result := DdosProtectionPlansClientListByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DdosProtectionPlanListResult); err != nil { - return DdosProtectionPlansClientListByResourceGroupResponse{}, err - } - return result, nil -} - -// UpdateTags - Update a DDoS protection plan tags. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// ddosProtectionPlanName - The name of the DDoS protection plan. -// parameters - Parameters supplied to the update DDoS protection plan resource tags. -// options - DdosProtectionPlansClientUpdateTagsOptions contains the optional parameters for the DdosProtectionPlansClient.UpdateTags -// method. -func (client *DdosProtectionPlansClient) UpdateTags(ctx context.Context, resourceGroupName string, ddosProtectionPlanName string, parameters TagsObject, options *DdosProtectionPlansClientUpdateTagsOptions) (DdosProtectionPlansClientUpdateTagsResponse, error) { - req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, ddosProtectionPlanName, parameters, options) - if err != nil { - return DdosProtectionPlansClientUpdateTagsResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return DdosProtectionPlansClientUpdateTagsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DdosProtectionPlansClientUpdateTagsResponse{}, runtime.NewResponseError(resp) - } - return client.updateTagsHandleResponse(resp) -} - -// updateTagsCreateRequest creates the UpdateTags request. -func (client *DdosProtectionPlansClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, ddosProtectionPlanName string, parameters TagsObject, options *DdosProtectionPlansClientUpdateTagsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if ddosProtectionPlanName == "" { - return nil, errors.New("parameter ddosProtectionPlanName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{ddosProtectionPlanName}", url.PathEscape(ddosProtectionPlanName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// updateTagsHandleResponse handles the UpdateTags response. -func (client *DdosProtectionPlansClient) updateTagsHandleResponse(resp *http.Response) (DdosProtectionPlansClientUpdateTagsResponse, error) { - result := DdosProtectionPlansClientUpdateTagsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DdosProtectionPlan); err != nil { - return DdosProtectionPlansClientUpdateTagsResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/defaultsecurityrules_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/defaultsecurityrules_client.go deleted file mode 100644 index fdda1e8c..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/defaultsecurityrules_client.go +++ /dev/null @@ -1,189 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// DefaultSecurityRulesClient contains the methods for the DefaultSecurityRules group. -// Don't use this type directly, use NewDefaultSecurityRulesClient() instead. -type DefaultSecurityRulesClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewDefaultSecurityRulesClient creates a new instance of DefaultSecurityRulesClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewDefaultSecurityRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DefaultSecurityRulesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &DefaultSecurityRulesClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// Get - Get the specified default network security rule. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkSecurityGroupName - The name of the network security group. -// defaultSecurityRuleName - The name of the default security rule. -// options - DefaultSecurityRulesClientGetOptions contains the optional parameters for the DefaultSecurityRulesClient.Get -// method. -func (client *DefaultSecurityRulesClient) Get(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, defaultSecurityRuleName string, options *DefaultSecurityRulesClientGetOptions) (DefaultSecurityRulesClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, networkSecurityGroupName, defaultSecurityRuleName, options) - if err != nil { - return DefaultSecurityRulesClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return DefaultSecurityRulesClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DefaultSecurityRulesClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *DefaultSecurityRulesClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, defaultSecurityRuleName string, options *DefaultSecurityRulesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules/{defaultSecurityRuleName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkSecurityGroupName == "" { - return nil, errors.New("parameter networkSecurityGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkSecurityGroupName}", url.PathEscape(networkSecurityGroupName)) - if defaultSecurityRuleName == "" { - return nil, errors.New("parameter defaultSecurityRuleName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{defaultSecurityRuleName}", url.PathEscape(defaultSecurityRuleName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *DefaultSecurityRulesClient) getHandleResponse(resp *http.Response) (DefaultSecurityRulesClientGetResponse, error) { - result := DefaultSecurityRulesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SecurityRule); err != nil { - return DefaultSecurityRulesClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Gets all default security rules in a network security group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkSecurityGroupName - The name of the network security group. -// options - DefaultSecurityRulesClientListOptions contains the optional parameters for the DefaultSecurityRulesClient.List -// method. -func (client *DefaultSecurityRulesClient) NewListPager(resourceGroupName string, networkSecurityGroupName string, options *DefaultSecurityRulesClientListOptions) *runtime.Pager[DefaultSecurityRulesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[DefaultSecurityRulesClientListResponse]{ - More: func(page DefaultSecurityRulesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *DefaultSecurityRulesClientListResponse) (DefaultSecurityRulesClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, networkSecurityGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return DefaultSecurityRulesClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return DefaultSecurityRulesClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DefaultSecurityRulesClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *DefaultSecurityRulesClient) listCreateRequest(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, options *DefaultSecurityRulesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkSecurityGroupName == "" { - return nil, errors.New("parameter networkSecurityGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkSecurityGroupName}", url.PathEscape(networkSecurityGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *DefaultSecurityRulesClient) listHandleResponse(resp *http.Response) (DefaultSecurityRulesClientListResponse, error) { - result := DefaultSecurityRulesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SecurityRuleListResult); err != nil { - return DefaultSecurityRulesClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/dscpconfiguration_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/dscpconfiguration_client.go deleted file mode 100644 index 5ebcee2f..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/dscpconfiguration_client.go +++ /dev/null @@ -1,368 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// DscpConfigurationClient contains the methods for the DscpConfiguration group. -// Don't use this type directly, use NewDscpConfigurationClient() instead. -type DscpConfigurationClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewDscpConfigurationClient creates a new instance of DscpConfigurationClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewDscpConfigurationClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DscpConfigurationClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &DscpConfigurationClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates a DSCP Configuration. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// dscpConfigurationName - The name of the resource. -// parameters - Parameters supplied to the create or update dscp configuration operation. -// options - DscpConfigurationClientBeginCreateOrUpdateOptions contains the optional parameters for the DscpConfigurationClient.BeginCreateOrUpdate -// method. -func (client *DscpConfigurationClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, dscpConfigurationName string, parameters DscpConfiguration, options *DscpConfigurationClientBeginCreateOrUpdateOptions) (*runtime.Poller[DscpConfigurationClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, dscpConfigurationName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[DscpConfigurationClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[DscpConfigurationClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates or updates a DSCP Configuration. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *DscpConfigurationClient) createOrUpdate(ctx context.Context, resourceGroupName string, dscpConfigurationName string, parameters DscpConfiguration, options *DscpConfigurationClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, dscpConfigurationName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *DscpConfigurationClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, dscpConfigurationName string, parameters DscpConfiguration, options *DscpConfigurationClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dscpConfigurations/{dscpConfigurationName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if dscpConfigurationName == "" { - return nil, errors.New("parameter dscpConfigurationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{dscpConfigurationName}", url.PathEscape(dscpConfigurationName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginDelete - Deletes a DSCP Configuration. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// dscpConfigurationName - The name of the resource. -// options - DscpConfigurationClientBeginDeleteOptions contains the optional parameters for the DscpConfigurationClient.BeginDelete -// method. -func (client *DscpConfigurationClient) BeginDelete(ctx context.Context, resourceGroupName string, dscpConfigurationName string, options *DscpConfigurationClientBeginDeleteOptions) (*runtime.Poller[DscpConfigurationClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, dscpConfigurationName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[DscpConfigurationClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[DscpConfigurationClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes a DSCP Configuration. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *DscpConfigurationClient) deleteOperation(ctx context.Context, resourceGroupName string, dscpConfigurationName string, options *DscpConfigurationClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, dscpConfigurationName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *DscpConfigurationClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, dscpConfigurationName string, options *DscpConfigurationClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dscpConfigurations/{dscpConfigurationName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if dscpConfigurationName == "" { - return nil, errors.New("parameter dscpConfigurationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{dscpConfigurationName}", url.PathEscape(dscpConfigurationName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets a DSCP Configuration. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// dscpConfigurationName - The name of the resource. -// options - DscpConfigurationClientGetOptions contains the optional parameters for the DscpConfigurationClient.Get method. -func (client *DscpConfigurationClient) Get(ctx context.Context, resourceGroupName string, dscpConfigurationName string, options *DscpConfigurationClientGetOptions) (DscpConfigurationClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, dscpConfigurationName, options) - if err != nil { - return DscpConfigurationClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return DscpConfigurationClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DscpConfigurationClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *DscpConfigurationClient) getCreateRequest(ctx context.Context, resourceGroupName string, dscpConfigurationName string, options *DscpConfigurationClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dscpConfigurations/{dscpConfigurationName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if dscpConfigurationName == "" { - return nil, errors.New("parameter dscpConfigurationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{dscpConfigurationName}", url.PathEscape(dscpConfigurationName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *DscpConfigurationClient) getHandleResponse(resp *http.Response) (DscpConfigurationClientGetResponse, error) { - result := DscpConfigurationClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DscpConfiguration); err != nil { - return DscpConfigurationClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Gets a DSCP Configuration. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// options - DscpConfigurationClientListOptions contains the optional parameters for the DscpConfigurationClient.List method. -func (client *DscpConfigurationClient) NewListPager(resourceGroupName string, options *DscpConfigurationClientListOptions) *runtime.Pager[DscpConfigurationClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[DscpConfigurationClientListResponse]{ - More: func(page DscpConfigurationClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *DscpConfigurationClientListResponse) (DscpConfigurationClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return DscpConfigurationClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return DscpConfigurationClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DscpConfigurationClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *DscpConfigurationClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *DscpConfigurationClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dscpConfigurations" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *DscpConfigurationClient) listHandleResponse(resp *http.Response) (DscpConfigurationClientListResponse, error) { - result := DscpConfigurationClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DscpConfigurationListResult); err != nil { - return DscpConfigurationClientListResponse{}, err - } - return result, nil -} - -// NewListAllPager - Gets all dscp configurations in a subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// options - DscpConfigurationClientListAllOptions contains the optional parameters for the DscpConfigurationClient.ListAll -// method. -func (client *DscpConfigurationClient) NewListAllPager(options *DscpConfigurationClientListAllOptions) *runtime.Pager[DscpConfigurationClientListAllResponse] { - return runtime.NewPager(runtime.PagingHandler[DscpConfigurationClientListAllResponse]{ - More: func(page DscpConfigurationClientListAllResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *DscpConfigurationClientListAllResponse) (DscpConfigurationClientListAllResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listAllCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return DscpConfigurationClientListAllResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return DscpConfigurationClientListAllResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DscpConfigurationClientListAllResponse{}, runtime.NewResponseError(resp) - } - return client.listAllHandleResponse(resp) - }, - }) -} - -// listAllCreateRequest creates the ListAll request. -func (client *DscpConfigurationClient) listAllCreateRequest(ctx context.Context, options *DscpConfigurationClientListAllOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/dscpConfigurations" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listAllHandleResponse handles the ListAll response. -func (client *DscpConfigurationClient) listAllHandleResponse(resp *http.Response) (DscpConfigurationClientListAllResponse, error) { - result := DscpConfigurationClientListAllResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DscpConfigurationListResult); err != nil { - return DscpConfigurationClientListAllResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/expressroutecircuitauthorizations_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/expressroutecircuitauthorizations_client.go deleted file mode 100644 index ca48a3f3..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/expressroutecircuitauthorizations_client.go +++ /dev/null @@ -1,330 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// ExpressRouteCircuitAuthorizationsClient contains the methods for the ExpressRouteCircuitAuthorizations group. -// Don't use this type directly, use NewExpressRouteCircuitAuthorizationsClient() instead. -type ExpressRouteCircuitAuthorizationsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewExpressRouteCircuitAuthorizationsClient creates a new instance of ExpressRouteCircuitAuthorizationsClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewExpressRouteCircuitAuthorizationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ExpressRouteCircuitAuthorizationsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &ExpressRouteCircuitAuthorizationsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates an authorization in the specified express route circuit. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// circuitName - The name of the express route circuit. -// authorizationName - The name of the authorization. -// authorizationParameters - Parameters supplied to the create or update express route circuit authorization operation. -// options - ExpressRouteCircuitAuthorizationsClientBeginCreateOrUpdateOptions contains the optional parameters for the ExpressRouteCircuitAuthorizationsClient.BeginCreateOrUpdate -// method. -func (client *ExpressRouteCircuitAuthorizationsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, circuitName string, authorizationName string, authorizationParameters ExpressRouteCircuitAuthorization, options *ExpressRouteCircuitAuthorizationsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ExpressRouteCircuitAuthorizationsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, circuitName, authorizationName, authorizationParameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ExpressRouteCircuitAuthorizationsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[ExpressRouteCircuitAuthorizationsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates or updates an authorization in the specified express route circuit. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *ExpressRouteCircuitAuthorizationsClient) createOrUpdate(ctx context.Context, resourceGroupName string, circuitName string, authorizationName string, authorizationParameters ExpressRouteCircuitAuthorization, options *ExpressRouteCircuitAuthorizationsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, circuitName, authorizationName, authorizationParameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ExpressRouteCircuitAuthorizationsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, authorizationName string, authorizationParameters ExpressRouteCircuitAuthorization, options *ExpressRouteCircuitAuthorizationsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if circuitName == "" { - return nil, errors.New("parameter circuitName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{circuitName}", url.PathEscape(circuitName)) - if authorizationName == "" { - return nil, errors.New("parameter authorizationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{authorizationName}", url.PathEscape(authorizationName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, authorizationParameters) -} - -// BeginDelete - Deletes the specified authorization from the specified express route circuit. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// circuitName - The name of the express route circuit. -// authorizationName - The name of the authorization. -// options - ExpressRouteCircuitAuthorizationsClientBeginDeleteOptions contains the optional parameters for the ExpressRouteCircuitAuthorizationsClient.BeginDelete -// method. -func (client *ExpressRouteCircuitAuthorizationsClient) BeginDelete(ctx context.Context, resourceGroupName string, circuitName string, authorizationName string, options *ExpressRouteCircuitAuthorizationsClientBeginDeleteOptions) (*runtime.Poller[ExpressRouteCircuitAuthorizationsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, circuitName, authorizationName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ExpressRouteCircuitAuthorizationsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[ExpressRouteCircuitAuthorizationsClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes the specified authorization from the specified express route circuit. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *ExpressRouteCircuitAuthorizationsClient) deleteOperation(ctx context.Context, resourceGroupName string, circuitName string, authorizationName string, options *ExpressRouteCircuitAuthorizationsClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, circuitName, authorizationName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *ExpressRouteCircuitAuthorizationsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, authorizationName string, options *ExpressRouteCircuitAuthorizationsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if circuitName == "" { - return nil, errors.New("parameter circuitName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{circuitName}", url.PathEscape(circuitName)) - if authorizationName == "" { - return nil, errors.New("parameter authorizationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{authorizationName}", url.PathEscape(authorizationName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets the specified authorization from the specified express route circuit. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// circuitName - The name of the express route circuit. -// authorizationName - The name of the authorization. -// options - ExpressRouteCircuitAuthorizationsClientGetOptions contains the optional parameters for the ExpressRouteCircuitAuthorizationsClient.Get -// method. -func (client *ExpressRouteCircuitAuthorizationsClient) Get(ctx context.Context, resourceGroupName string, circuitName string, authorizationName string, options *ExpressRouteCircuitAuthorizationsClientGetOptions) (ExpressRouteCircuitAuthorizationsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, circuitName, authorizationName, options) - if err != nil { - return ExpressRouteCircuitAuthorizationsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ExpressRouteCircuitAuthorizationsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ExpressRouteCircuitAuthorizationsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *ExpressRouteCircuitAuthorizationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, authorizationName string, options *ExpressRouteCircuitAuthorizationsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if circuitName == "" { - return nil, errors.New("parameter circuitName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{circuitName}", url.PathEscape(circuitName)) - if authorizationName == "" { - return nil, errors.New("parameter authorizationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{authorizationName}", url.PathEscape(authorizationName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *ExpressRouteCircuitAuthorizationsClient) getHandleResponse(resp *http.Response) (ExpressRouteCircuitAuthorizationsClientGetResponse, error) { - result := ExpressRouteCircuitAuthorizationsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRouteCircuitAuthorization); err != nil { - return ExpressRouteCircuitAuthorizationsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Gets all authorizations in an express route circuit. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// circuitName - The name of the circuit. -// options - ExpressRouteCircuitAuthorizationsClientListOptions contains the optional parameters for the ExpressRouteCircuitAuthorizationsClient.List -// method. -func (client *ExpressRouteCircuitAuthorizationsClient) NewListPager(resourceGroupName string, circuitName string, options *ExpressRouteCircuitAuthorizationsClientListOptions) *runtime.Pager[ExpressRouteCircuitAuthorizationsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[ExpressRouteCircuitAuthorizationsClientListResponse]{ - More: func(page ExpressRouteCircuitAuthorizationsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ExpressRouteCircuitAuthorizationsClientListResponse) (ExpressRouteCircuitAuthorizationsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, circuitName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return ExpressRouteCircuitAuthorizationsClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ExpressRouteCircuitAuthorizationsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ExpressRouteCircuitAuthorizationsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *ExpressRouteCircuitAuthorizationsClient) listCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, options *ExpressRouteCircuitAuthorizationsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if circuitName == "" { - return nil, errors.New("parameter circuitName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{circuitName}", url.PathEscape(circuitName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *ExpressRouteCircuitAuthorizationsClient) listHandleResponse(resp *http.Response) (ExpressRouteCircuitAuthorizationsClientListResponse, error) { - result := ExpressRouteCircuitAuthorizationsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.AuthorizationListResult); err != nil { - return ExpressRouteCircuitAuthorizationsClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/expressroutecircuitconnections_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/expressroutecircuitconnections_client.go deleted file mode 100644 index ade11515..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/expressroutecircuitconnections_client.go +++ /dev/null @@ -1,351 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// ExpressRouteCircuitConnectionsClient contains the methods for the ExpressRouteCircuitConnections group. -// Don't use this type directly, use NewExpressRouteCircuitConnectionsClient() instead. -type ExpressRouteCircuitConnectionsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewExpressRouteCircuitConnectionsClient creates a new instance of ExpressRouteCircuitConnectionsClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewExpressRouteCircuitConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ExpressRouteCircuitConnectionsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &ExpressRouteCircuitConnectionsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates a Express Route Circuit Connection in the specified express route circuits. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// circuitName - The name of the express route circuit. -// peeringName - The name of the peering. -// connectionName - The name of the express route circuit connection. -// expressRouteCircuitConnectionParameters - Parameters supplied to the create or update express route circuit connection -// operation. -// options - ExpressRouteCircuitConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the ExpressRouteCircuitConnectionsClient.BeginCreateOrUpdate -// method. -func (client *ExpressRouteCircuitConnectionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, connectionName string, expressRouteCircuitConnectionParameters ExpressRouteCircuitConnection, options *ExpressRouteCircuitConnectionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ExpressRouteCircuitConnectionsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ExpressRouteCircuitConnectionsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[ExpressRouteCircuitConnectionsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates or updates a Express Route Circuit Connection in the specified express route circuits. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *ExpressRouteCircuitConnectionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, connectionName string, expressRouteCircuitConnectionParameters ExpressRouteCircuitConnection, options *ExpressRouteCircuitConnectionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ExpressRouteCircuitConnectionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, connectionName string, expressRouteCircuitConnectionParameters ExpressRouteCircuitConnection, options *ExpressRouteCircuitConnectionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections/{connectionName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if circuitName == "" { - return nil, errors.New("parameter circuitName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{circuitName}", url.PathEscape(circuitName)) - if peeringName == "" { - return nil, errors.New("parameter peeringName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{peeringName}", url.PathEscape(peeringName)) - if connectionName == "" { - return nil, errors.New("parameter connectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, expressRouteCircuitConnectionParameters) -} - -// BeginDelete - Deletes the specified Express Route Circuit Connection from the specified express route circuit. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// circuitName - The name of the express route circuit. -// peeringName - The name of the peering. -// connectionName - The name of the express route circuit connection. -// options - ExpressRouteCircuitConnectionsClientBeginDeleteOptions contains the optional parameters for the ExpressRouteCircuitConnectionsClient.BeginDelete -// method. -func (client *ExpressRouteCircuitConnectionsClient) BeginDelete(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, connectionName string, options *ExpressRouteCircuitConnectionsClientBeginDeleteOptions) (*runtime.Poller[ExpressRouteCircuitConnectionsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, circuitName, peeringName, connectionName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ExpressRouteCircuitConnectionsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[ExpressRouteCircuitConnectionsClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes the specified Express Route Circuit Connection from the specified express route circuit. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *ExpressRouteCircuitConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, connectionName string, options *ExpressRouteCircuitConnectionsClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, circuitName, peeringName, connectionName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *ExpressRouteCircuitConnectionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, connectionName string, options *ExpressRouteCircuitConnectionsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections/{connectionName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if circuitName == "" { - return nil, errors.New("parameter circuitName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{circuitName}", url.PathEscape(circuitName)) - if peeringName == "" { - return nil, errors.New("parameter peeringName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{peeringName}", url.PathEscape(peeringName)) - if connectionName == "" { - return nil, errors.New("parameter connectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets the specified Express Route Circuit Connection from the specified express route circuit. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// circuitName - The name of the express route circuit. -// peeringName - The name of the peering. -// connectionName - The name of the express route circuit connection. -// options - ExpressRouteCircuitConnectionsClientGetOptions contains the optional parameters for the ExpressRouteCircuitConnectionsClient.Get -// method. -func (client *ExpressRouteCircuitConnectionsClient) Get(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, connectionName string, options *ExpressRouteCircuitConnectionsClientGetOptions) (ExpressRouteCircuitConnectionsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, circuitName, peeringName, connectionName, options) - if err != nil { - return ExpressRouteCircuitConnectionsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ExpressRouteCircuitConnectionsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ExpressRouteCircuitConnectionsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *ExpressRouteCircuitConnectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, connectionName string, options *ExpressRouteCircuitConnectionsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections/{connectionName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if circuitName == "" { - return nil, errors.New("parameter circuitName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{circuitName}", url.PathEscape(circuitName)) - if peeringName == "" { - return nil, errors.New("parameter peeringName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{peeringName}", url.PathEscape(peeringName)) - if connectionName == "" { - return nil, errors.New("parameter connectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *ExpressRouteCircuitConnectionsClient) getHandleResponse(resp *http.Response) (ExpressRouteCircuitConnectionsClientGetResponse, error) { - result := ExpressRouteCircuitConnectionsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRouteCircuitConnection); err != nil { - return ExpressRouteCircuitConnectionsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Gets all global reach connections associated with a private peering in an express route circuit. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// circuitName - The name of the circuit. -// peeringName - The name of the peering. -// options - ExpressRouteCircuitConnectionsClientListOptions contains the optional parameters for the ExpressRouteCircuitConnectionsClient.List -// method. -func (client *ExpressRouteCircuitConnectionsClient) NewListPager(resourceGroupName string, circuitName string, peeringName string, options *ExpressRouteCircuitConnectionsClientListOptions) *runtime.Pager[ExpressRouteCircuitConnectionsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[ExpressRouteCircuitConnectionsClientListResponse]{ - More: func(page ExpressRouteCircuitConnectionsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ExpressRouteCircuitConnectionsClientListResponse) (ExpressRouteCircuitConnectionsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, circuitName, peeringName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return ExpressRouteCircuitConnectionsClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ExpressRouteCircuitConnectionsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ExpressRouteCircuitConnectionsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *ExpressRouteCircuitConnectionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, options *ExpressRouteCircuitConnectionsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if circuitName == "" { - return nil, errors.New("parameter circuitName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{circuitName}", url.PathEscape(circuitName)) - if peeringName == "" { - return nil, errors.New("parameter peeringName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{peeringName}", url.PathEscape(peeringName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *ExpressRouteCircuitConnectionsClient) listHandleResponse(resp *http.Response) (ExpressRouteCircuitConnectionsClientListResponse, error) { - result := ExpressRouteCircuitConnectionsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRouteCircuitConnectionListResult); err != nil { - return ExpressRouteCircuitConnectionsClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/expressroutecircuitpeerings_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/expressroutecircuitpeerings_client.go deleted file mode 100644 index 68eab70f..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/expressroutecircuitpeerings_client.go +++ /dev/null @@ -1,330 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// ExpressRouteCircuitPeeringsClient contains the methods for the ExpressRouteCircuitPeerings group. -// Don't use this type directly, use NewExpressRouteCircuitPeeringsClient() instead. -type ExpressRouteCircuitPeeringsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewExpressRouteCircuitPeeringsClient creates a new instance of ExpressRouteCircuitPeeringsClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewExpressRouteCircuitPeeringsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ExpressRouteCircuitPeeringsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &ExpressRouteCircuitPeeringsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates a peering in the specified express route circuits. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// circuitName - The name of the express route circuit. -// peeringName - The name of the peering. -// peeringParameters - Parameters supplied to the create or update express route circuit peering operation. -// options - ExpressRouteCircuitPeeringsClientBeginCreateOrUpdateOptions contains the optional parameters for the ExpressRouteCircuitPeeringsClient.BeginCreateOrUpdate -// method. -func (client *ExpressRouteCircuitPeeringsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, peeringParameters ExpressRouteCircuitPeering, options *ExpressRouteCircuitPeeringsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ExpressRouteCircuitPeeringsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, circuitName, peeringName, peeringParameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ExpressRouteCircuitPeeringsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[ExpressRouteCircuitPeeringsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates or updates a peering in the specified express route circuits. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *ExpressRouteCircuitPeeringsClient) createOrUpdate(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, peeringParameters ExpressRouteCircuitPeering, options *ExpressRouteCircuitPeeringsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, circuitName, peeringName, peeringParameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ExpressRouteCircuitPeeringsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, peeringParameters ExpressRouteCircuitPeering, options *ExpressRouteCircuitPeeringsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if circuitName == "" { - return nil, errors.New("parameter circuitName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{circuitName}", url.PathEscape(circuitName)) - if peeringName == "" { - return nil, errors.New("parameter peeringName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{peeringName}", url.PathEscape(peeringName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, peeringParameters) -} - -// BeginDelete - Deletes the specified peering from the specified express route circuit. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// circuitName - The name of the express route circuit. -// peeringName - The name of the peering. -// options - ExpressRouteCircuitPeeringsClientBeginDeleteOptions contains the optional parameters for the ExpressRouteCircuitPeeringsClient.BeginDelete -// method. -func (client *ExpressRouteCircuitPeeringsClient) BeginDelete(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, options *ExpressRouteCircuitPeeringsClientBeginDeleteOptions) (*runtime.Poller[ExpressRouteCircuitPeeringsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, circuitName, peeringName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ExpressRouteCircuitPeeringsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[ExpressRouteCircuitPeeringsClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes the specified peering from the specified express route circuit. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *ExpressRouteCircuitPeeringsClient) deleteOperation(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, options *ExpressRouteCircuitPeeringsClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, circuitName, peeringName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *ExpressRouteCircuitPeeringsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, options *ExpressRouteCircuitPeeringsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if circuitName == "" { - return nil, errors.New("parameter circuitName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{circuitName}", url.PathEscape(circuitName)) - if peeringName == "" { - return nil, errors.New("parameter peeringName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{peeringName}", url.PathEscape(peeringName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets the specified peering for the express route circuit. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// circuitName - The name of the express route circuit. -// peeringName - The name of the peering. -// options - ExpressRouteCircuitPeeringsClientGetOptions contains the optional parameters for the ExpressRouteCircuitPeeringsClient.Get -// method. -func (client *ExpressRouteCircuitPeeringsClient) Get(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, options *ExpressRouteCircuitPeeringsClientGetOptions) (ExpressRouteCircuitPeeringsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, circuitName, peeringName, options) - if err != nil { - return ExpressRouteCircuitPeeringsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ExpressRouteCircuitPeeringsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ExpressRouteCircuitPeeringsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *ExpressRouteCircuitPeeringsClient) getCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, options *ExpressRouteCircuitPeeringsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if circuitName == "" { - return nil, errors.New("parameter circuitName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{circuitName}", url.PathEscape(circuitName)) - if peeringName == "" { - return nil, errors.New("parameter peeringName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{peeringName}", url.PathEscape(peeringName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *ExpressRouteCircuitPeeringsClient) getHandleResponse(resp *http.Response) (ExpressRouteCircuitPeeringsClientGetResponse, error) { - result := ExpressRouteCircuitPeeringsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRouteCircuitPeering); err != nil { - return ExpressRouteCircuitPeeringsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Gets all peerings in a specified express route circuit. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// circuitName - The name of the express route circuit. -// options - ExpressRouteCircuitPeeringsClientListOptions contains the optional parameters for the ExpressRouteCircuitPeeringsClient.List -// method. -func (client *ExpressRouteCircuitPeeringsClient) NewListPager(resourceGroupName string, circuitName string, options *ExpressRouteCircuitPeeringsClientListOptions) *runtime.Pager[ExpressRouteCircuitPeeringsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[ExpressRouteCircuitPeeringsClientListResponse]{ - More: func(page ExpressRouteCircuitPeeringsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ExpressRouteCircuitPeeringsClientListResponse) (ExpressRouteCircuitPeeringsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, circuitName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return ExpressRouteCircuitPeeringsClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ExpressRouteCircuitPeeringsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ExpressRouteCircuitPeeringsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *ExpressRouteCircuitPeeringsClient) listCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, options *ExpressRouteCircuitPeeringsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if circuitName == "" { - return nil, errors.New("parameter circuitName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{circuitName}", url.PathEscape(circuitName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *ExpressRouteCircuitPeeringsClient) listHandleResponse(resp *http.Response) (ExpressRouteCircuitPeeringsClientListResponse, error) { - result := ExpressRouteCircuitPeeringsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRouteCircuitPeeringListResult); err != nil { - return ExpressRouteCircuitPeeringsClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/expressroutecircuits_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/expressroutecircuits_client.go deleted file mode 100644 index 2d01459d..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/expressroutecircuits_client.go +++ /dev/null @@ -1,775 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// ExpressRouteCircuitsClient contains the methods for the ExpressRouteCircuits group. -// Don't use this type directly, use NewExpressRouteCircuitsClient() instead. -type ExpressRouteCircuitsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewExpressRouteCircuitsClient creates a new instance of ExpressRouteCircuitsClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewExpressRouteCircuitsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ExpressRouteCircuitsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &ExpressRouteCircuitsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates an express route circuit. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// circuitName - The name of the circuit. -// parameters - Parameters supplied to the create or update express route circuit operation. -// options - ExpressRouteCircuitsClientBeginCreateOrUpdateOptions contains the optional parameters for the ExpressRouteCircuitsClient.BeginCreateOrUpdate -// method. -func (client *ExpressRouteCircuitsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, circuitName string, parameters ExpressRouteCircuit, options *ExpressRouteCircuitsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ExpressRouteCircuitsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, circuitName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ExpressRouteCircuitsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[ExpressRouteCircuitsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates or updates an express route circuit. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *ExpressRouteCircuitsClient) createOrUpdate(ctx context.Context, resourceGroupName string, circuitName string, parameters ExpressRouteCircuit, options *ExpressRouteCircuitsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, circuitName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ExpressRouteCircuitsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, parameters ExpressRouteCircuit, options *ExpressRouteCircuitsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if circuitName == "" { - return nil, errors.New("parameter circuitName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{circuitName}", url.PathEscape(circuitName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginDelete - Deletes the specified express route circuit. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// circuitName - The name of the express route circuit. -// options - ExpressRouteCircuitsClientBeginDeleteOptions contains the optional parameters for the ExpressRouteCircuitsClient.BeginDelete -// method. -func (client *ExpressRouteCircuitsClient) BeginDelete(ctx context.Context, resourceGroupName string, circuitName string, options *ExpressRouteCircuitsClientBeginDeleteOptions) (*runtime.Poller[ExpressRouteCircuitsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, circuitName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ExpressRouteCircuitsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[ExpressRouteCircuitsClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes the specified express route circuit. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *ExpressRouteCircuitsClient) deleteOperation(ctx context.Context, resourceGroupName string, circuitName string, options *ExpressRouteCircuitsClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, circuitName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *ExpressRouteCircuitsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, options *ExpressRouteCircuitsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if circuitName == "" { - return nil, errors.New("parameter circuitName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{circuitName}", url.PathEscape(circuitName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets information about the specified express route circuit. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// circuitName - The name of express route circuit. -// options - ExpressRouteCircuitsClientGetOptions contains the optional parameters for the ExpressRouteCircuitsClient.Get -// method. -func (client *ExpressRouteCircuitsClient) Get(ctx context.Context, resourceGroupName string, circuitName string, options *ExpressRouteCircuitsClientGetOptions) (ExpressRouteCircuitsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, circuitName, options) - if err != nil { - return ExpressRouteCircuitsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ExpressRouteCircuitsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ExpressRouteCircuitsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *ExpressRouteCircuitsClient) getCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, options *ExpressRouteCircuitsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if circuitName == "" { - return nil, errors.New("parameter circuitName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{circuitName}", url.PathEscape(circuitName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *ExpressRouteCircuitsClient) getHandleResponse(resp *http.Response) (ExpressRouteCircuitsClientGetResponse, error) { - result := ExpressRouteCircuitsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRouteCircuit); err != nil { - return ExpressRouteCircuitsClientGetResponse{}, err - } - return result, nil -} - -// GetPeeringStats - Gets all stats from an express route circuit in a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// circuitName - The name of the express route circuit. -// peeringName - The name of the peering. -// options - ExpressRouteCircuitsClientGetPeeringStatsOptions contains the optional parameters for the ExpressRouteCircuitsClient.GetPeeringStats -// method. -func (client *ExpressRouteCircuitsClient) GetPeeringStats(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, options *ExpressRouteCircuitsClientGetPeeringStatsOptions) (ExpressRouteCircuitsClientGetPeeringStatsResponse, error) { - req, err := client.getPeeringStatsCreateRequest(ctx, resourceGroupName, circuitName, peeringName, options) - if err != nil { - return ExpressRouteCircuitsClientGetPeeringStatsResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ExpressRouteCircuitsClientGetPeeringStatsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ExpressRouteCircuitsClientGetPeeringStatsResponse{}, runtime.NewResponseError(resp) - } - return client.getPeeringStatsHandleResponse(resp) -} - -// getPeeringStatsCreateRequest creates the GetPeeringStats request. -func (client *ExpressRouteCircuitsClient) getPeeringStatsCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, options *ExpressRouteCircuitsClientGetPeeringStatsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/stats" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if circuitName == "" { - return nil, errors.New("parameter circuitName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{circuitName}", url.PathEscape(circuitName)) - if peeringName == "" { - return nil, errors.New("parameter peeringName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{peeringName}", url.PathEscape(peeringName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getPeeringStatsHandleResponse handles the GetPeeringStats response. -func (client *ExpressRouteCircuitsClient) getPeeringStatsHandleResponse(resp *http.Response) (ExpressRouteCircuitsClientGetPeeringStatsResponse, error) { - result := ExpressRouteCircuitsClientGetPeeringStatsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRouteCircuitStats); err != nil { - return ExpressRouteCircuitsClientGetPeeringStatsResponse{}, err - } - return result, nil -} - -// GetStats - Gets all the stats from an express route circuit in a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// circuitName - The name of the express route circuit. -// options - ExpressRouteCircuitsClientGetStatsOptions contains the optional parameters for the ExpressRouteCircuitsClient.GetStats -// method. -func (client *ExpressRouteCircuitsClient) GetStats(ctx context.Context, resourceGroupName string, circuitName string, options *ExpressRouteCircuitsClientGetStatsOptions) (ExpressRouteCircuitsClientGetStatsResponse, error) { - req, err := client.getStatsCreateRequest(ctx, resourceGroupName, circuitName, options) - if err != nil { - return ExpressRouteCircuitsClientGetStatsResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ExpressRouteCircuitsClientGetStatsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ExpressRouteCircuitsClientGetStatsResponse{}, runtime.NewResponseError(resp) - } - return client.getStatsHandleResponse(resp) -} - -// getStatsCreateRequest creates the GetStats request. -func (client *ExpressRouteCircuitsClient) getStatsCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, options *ExpressRouteCircuitsClientGetStatsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/stats" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if circuitName == "" { - return nil, errors.New("parameter circuitName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{circuitName}", url.PathEscape(circuitName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getStatsHandleResponse handles the GetStats response. -func (client *ExpressRouteCircuitsClient) getStatsHandleResponse(resp *http.Response) (ExpressRouteCircuitsClientGetStatsResponse, error) { - result := ExpressRouteCircuitsClientGetStatsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRouteCircuitStats); err != nil { - return ExpressRouteCircuitsClientGetStatsResponse{}, err - } - return result, nil -} - -// NewListPager - Gets all the express route circuits in a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// options - ExpressRouteCircuitsClientListOptions contains the optional parameters for the ExpressRouteCircuitsClient.List -// method. -func (client *ExpressRouteCircuitsClient) NewListPager(resourceGroupName string, options *ExpressRouteCircuitsClientListOptions) *runtime.Pager[ExpressRouteCircuitsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[ExpressRouteCircuitsClientListResponse]{ - More: func(page ExpressRouteCircuitsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ExpressRouteCircuitsClientListResponse) (ExpressRouteCircuitsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return ExpressRouteCircuitsClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ExpressRouteCircuitsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ExpressRouteCircuitsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *ExpressRouteCircuitsClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *ExpressRouteCircuitsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *ExpressRouteCircuitsClient) listHandleResponse(resp *http.Response) (ExpressRouteCircuitsClientListResponse, error) { - result := ExpressRouteCircuitsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRouteCircuitListResult); err != nil { - return ExpressRouteCircuitsClientListResponse{}, err - } - return result, nil -} - -// NewListAllPager - Gets all the express route circuits in a subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// options - ExpressRouteCircuitsClientListAllOptions contains the optional parameters for the ExpressRouteCircuitsClient.ListAll -// method. -func (client *ExpressRouteCircuitsClient) NewListAllPager(options *ExpressRouteCircuitsClientListAllOptions) *runtime.Pager[ExpressRouteCircuitsClientListAllResponse] { - return runtime.NewPager(runtime.PagingHandler[ExpressRouteCircuitsClientListAllResponse]{ - More: func(page ExpressRouteCircuitsClientListAllResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ExpressRouteCircuitsClientListAllResponse) (ExpressRouteCircuitsClientListAllResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listAllCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return ExpressRouteCircuitsClientListAllResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ExpressRouteCircuitsClientListAllResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ExpressRouteCircuitsClientListAllResponse{}, runtime.NewResponseError(resp) - } - return client.listAllHandleResponse(resp) - }, - }) -} - -// listAllCreateRequest creates the ListAll request. -func (client *ExpressRouteCircuitsClient) listAllCreateRequest(ctx context.Context, options *ExpressRouteCircuitsClientListAllOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCircuits" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listAllHandleResponse handles the ListAll response. -func (client *ExpressRouteCircuitsClient) listAllHandleResponse(resp *http.Response) (ExpressRouteCircuitsClientListAllResponse, error) { - result := ExpressRouteCircuitsClientListAllResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRouteCircuitListResult); err != nil { - return ExpressRouteCircuitsClientListAllResponse{}, err - } - return result, nil -} - -// BeginListArpTable - Gets the currently advertised ARP table associated with the express route circuit in a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// circuitName - The name of the express route circuit. -// peeringName - The name of the peering. -// devicePath - The path of the device. -// options - ExpressRouteCircuitsClientBeginListArpTableOptions contains the optional parameters for the ExpressRouteCircuitsClient.BeginListArpTable -// method. -func (client *ExpressRouteCircuitsClient) BeginListArpTable(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, devicePath string, options *ExpressRouteCircuitsClientBeginListArpTableOptions) (*runtime.Poller[ExpressRouteCircuitsClientListArpTableResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.listArpTable(ctx, resourceGroupName, circuitName, peeringName, devicePath, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ExpressRouteCircuitsClientListArpTableResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[ExpressRouteCircuitsClientListArpTableResponse](options.ResumeToken, client.pl, nil) - } -} - -// ListArpTable - Gets the currently advertised ARP table associated with the express route circuit in a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *ExpressRouteCircuitsClient) listArpTable(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, devicePath string, options *ExpressRouteCircuitsClientBeginListArpTableOptions) (*http.Response, error) { - req, err := client.listArpTableCreateRequest(ctx, resourceGroupName, circuitName, peeringName, devicePath, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// listArpTableCreateRequest creates the ListArpTable request. -func (client *ExpressRouteCircuitsClient) listArpTableCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, devicePath string, options *ExpressRouteCircuitsClientBeginListArpTableOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/arpTables/{devicePath}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if circuitName == "" { - return nil, errors.New("parameter circuitName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{circuitName}", url.PathEscape(circuitName)) - if peeringName == "" { - return nil, errors.New("parameter peeringName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{peeringName}", url.PathEscape(peeringName)) - if devicePath == "" { - return nil, errors.New("parameter devicePath cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{devicePath}", url.PathEscape(devicePath)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginListRoutesTable - Gets the currently advertised routes table associated with the express route circuit in a resource -// group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// circuitName - The name of the express route circuit. -// peeringName - The name of the peering. -// devicePath - The path of the device. -// options - ExpressRouteCircuitsClientBeginListRoutesTableOptions contains the optional parameters for the ExpressRouteCircuitsClient.BeginListRoutesTable -// method. -func (client *ExpressRouteCircuitsClient) BeginListRoutesTable(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, devicePath string, options *ExpressRouteCircuitsClientBeginListRoutesTableOptions) (*runtime.Poller[ExpressRouteCircuitsClientListRoutesTableResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.listRoutesTable(ctx, resourceGroupName, circuitName, peeringName, devicePath, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ExpressRouteCircuitsClientListRoutesTableResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[ExpressRouteCircuitsClientListRoutesTableResponse](options.ResumeToken, client.pl, nil) - } -} - -// ListRoutesTable - Gets the currently advertised routes table associated with the express route circuit in a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *ExpressRouteCircuitsClient) listRoutesTable(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, devicePath string, options *ExpressRouteCircuitsClientBeginListRoutesTableOptions) (*http.Response, error) { - req, err := client.listRoutesTableCreateRequest(ctx, resourceGroupName, circuitName, peeringName, devicePath, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// listRoutesTableCreateRequest creates the ListRoutesTable request. -func (client *ExpressRouteCircuitsClient) listRoutesTableCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, devicePath string, options *ExpressRouteCircuitsClientBeginListRoutesTableOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTables/{devicePath}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if circuitName == "" { - return nil, errors.New("parameter circuitName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{circuitName}", url.PathEscape(circuitName)) - if peeringName == "" { - return nil, errors.New("parameter peeringName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{peeringName}", url.PathEscape(peeringName)) - if devicePath == "" { - return nil, errors.New("parameter devicePath cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{devicePath}", url.PathEscape(devicePath)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginListRoutesTableSummary - Gets the currently advertised routes table summary associated with the express route circuit -// in a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// circuitName - The name of the express route circuit. -// peeringName - The name of the peering. -// devicePath - The path of the device. -// options - ExpressRouteCircuitsClientBeginListRoutesTableSummaryOptions contains the optional parameters for the ExpressRouteCircuitsClient.BeginListRoutesTableSummary -// method. -func (client *ExpressRouteCircuitsClient) BeginListRoutesTableSummary(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, devicePath string, options *ExpressRouteCircuitsClientBeginListRoutesTableSummaryOptions) (*runtime.Poller[ExpressRouteCircuitsClientListRoutesTableSummaryResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.listRoutesTableSummary(ctx, resourceGroupName, circuitName, peeringName, devicePath, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ExpressRouteCircuitsClientListRoutesTableSummaryResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[ExpressRouteCircuitsClientListRoutesTableSummaryResponse](options.ResumeToken, client.pl, nil) - } -} - -// ListRoutesTableSummary - Gets the currently advertised routes table summary associated with the express route circuit in -// a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *ExpressRouteCircuitsClient) listRoutesTableSummary(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, devicePath string, options *ExpressRouteCircuitsClientBeginListRoutesTableSummaryOptions) (*http.Response, error) { - req, err := client.listRoutesTableSummaryCreateRequest(ctx, resourceGroupName, circuitName, peeringName, devicePath, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// listRoutesTableSummaryCreateRequest creates the ListRoutesTableSummary request. -func (client *ExpressRouteCircuitsClient) listRoutesTableSummaryCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, devicePath string, options *ExpressRouteCircuitsClientBeginListRoutesTableSummaryOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTablesSummary/{devicePath}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if circuitName == "" { - return nil, errors.New("parameter circuitName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{circuitName}", url.PathEscape(circuitName)) - if peeringName == "" { - return nil, errors.New("parameter peeringName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{peeringName}", url.PathEscape(peeringName)) - if devicePath == "" { - return nil, errors.New("parameter devicePath cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{devicePath}", url.PathEscape(devicePath)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// UpdateTags - Updates an express route circuit tags. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// circuitName - The name of the circuit. -// parameters - Parameters supplied to update express route circuit tags. -// options - ExpressRouteCircuitsClientUpdateTagsOptions contains the optional parameters for the ExpressRouteCircuitsClient.UpdateTags -// method. -func (client *ExpressRouteCircuitsClient) UpdateTags(ctx context.Context, resourceGroupName string, circuitName string, parameters TagsObject, options *ExpressRouteCircuitsClientUpdateTagsOptions) (ExpressRouteCircuitsClientUpdateTagsResponse, error) { - req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, circuitName, parameters, options) - if err != nil { - return ExpressRouteCircuitsClientUpdateTagsResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ExpressRouteCircuitsClientUpdateTagsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ExpressRouteCircuitsClientUpdateTagsResponse{}, runtime.NewResponseError(resp) - } - return client.updateTagsHandleResponse(resp) -} - -// updateTagsCreateRequest creates the UpdateTags request. -func (client *ExpressRouteCircuitsClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, parameters TagsObject, options *ExpressRouteCircuitsClientUpdateTagsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if circuitName == "" { - return nil, errors.New("parameter circuitName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{circuitName}", url.PathEscape(circuitName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// updateTagsHandleResponse handles the UpdateTags response. -func (client *ExpressRouteCircuitsClient) updateTagsHandleResponse(resp *http.Response) (ExpressRouteCircuitsClientUpdateTagsResponse, error) { - result := ExpressRouteCircuitsClientUpdateTagsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRouteCircuit); err != nil { - return ExpressRouteCircuitsClientUpdateTagsResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/expressrouteconnections_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/expressrouteconnections_client.go deleted file mode 100644 index 17c9857b..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/expressrouteconnections_client.go +++ /dev/null @@ -1,317 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// ExpressRouteConnectionsClient contains the methods for the ExpressRouteConnections group. -// Don't use this type directly, use NewExpressRouteConnectionsClient() instead. -type ExpressRouteConnectionsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewExpressRouteConnectionsClient creates a new instance of ExpressRouteConnectionsClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewExpressRouteConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ExpressRouteConnectionsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &ExpressRouteConnectionsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// expressRouteGatewayName - The name of the ExpressRoute gateway. -// connectionName - The name of the connection subresource. -// putExpressRouteConnectionParameters - Parameters required in an ExpressRouteConnection PUT operation. -// options - ExpressRouteConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the ExpressRouteConnectionsClient.BeginCreateOrUpdate -// method. -func (client *ExpressRouteConnectionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, connectionName string, putExpressRouteConnectionParameters ExpressRouteConnection, options *ExpressRouteConnectionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ExpressRouteConnectionsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, expressRouteGatewayName, connectionName, putExpressRouteConnectionParameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ExpressRouteConnectionsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[ExpressRouteConnectionsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *ExpressRouteConnectionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, connectionName string, putExpressRouteConnectionParameters ExpressRouteConnection, options *ExpressRouteConnectionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, expressRouteGatewayName, connectionName, putExpressRouteConnectionParameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ExpressRouteConnectionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, connectionName string, putExpressRouteConnectionParameters ExpressRouteConnection, options *ExpressRouteConnectionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}/expressRouteConnections/{connectionName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if expressRouteGatewayName == "" { - return nil, errors.New("parameter expressRouteGatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{expressRouteGatewayName}", url.PathEscape(expressRouteGatewayName)) - if connectionName == "" { - return nil, errors.New("parameter connectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, putExpressRouteConnectionParameters) -} - -// BeginDelete - Deletes a connection to a ExpressRoute circuit. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// expressRouteGatewayName - The name of the ExpressRoute gateway. -// connectionName - The name of the connection subresource. -// options - ExpressRouteConnectionsClientBeginDeleteOptions contains the optional parameters for the ExpressRouteConnectionsClient.BeginDelete -// method. -func (client *ExpressRouteConnectionsClient) BeginDelete(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, connectionName string, options *ExpressRouteConnectionsClientBeginDeleteOptions) (*runtime.Poller[ExpressRouteConnectionsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, expressRouteGatewayName, connectionName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ExpressRouteConnectionsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[ExpressRouteConnectionsClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes a connection to a ExpressRoute circuit. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *ExpressRouteConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, connectionName string, options *ExpressRouteConnectionsClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, expressRouteGatewayName, connectionName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *ExpressRouteConnectionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, connectionName string, options *ExpressRouteConnectionsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}/expressRouteConnections/{connectionName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if expressRouteGatewayName == "" { - return nil, errors.New("parameter expressRouteGatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{expressRouteGatewayName}", url.PathEscape(expressRouteGatewayName)) - if connectionName == "" { - return nil, errors.New("parameter connectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets the specified ExpressRouteConnection. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// expressRouteGatewayName - The name of the ExpressRoute gateway. -// connectionName - The name of the ExpressRoute connection. -// options - ExpressRouteConnectionsClientGetOptions contains the optional parameters for the ExpressRouteConnectionsClient.Get -// method. -func (client *ExpressRouteConnectionsClient) Get(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, connectionName string, options *ExpressRouteConnectionsClientGetOptions) (ExpressRouteConnectionsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, expressRouteGatewayName, connectionName, options) - if err != nil { - return ExpressRouteConnectionsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ExpressRouteConnectionsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ExpressRouteConnectionsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *ExpressRouteConnectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, connectionName string, options *ExpressRouteConnectionsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}/expressRouteConnections/{connectionName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if expressRouteGatewayName == "" { - return nil, errors.New("parameter expressRouteGatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{expressRouteGatewayName}", url.PathEscape(expressRouteGatewayName)) - if connectionName == "" { - return nil, errors.New("parameter connectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *ExpressRouteConnectionsClient) getHandleResponse(resp *http.Response) (ExpressRouteConnectionsClientGetResponse, error) { - result := ExpressRouteConnectionsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRouteConnection); err != nil { - return ExpressRouteConnectionsClientGetResponse{}, err - } - return result, nil -} - -// List - Lists ExpressRouteConnections. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// expressRouteGatewayName - The name of the ExpressRoute gateway. -// options - ExpressRouteConnectionsClientListOptions contains the optional parameters for the ExpressRouteConnectionsClient.List -// method. -func (client *ExpressRouteConnectionsClient) List(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, options *ExpressRouteConnectionsClientListOptions) (ExpressRouteConnectionsClientListResponse, error) { - req, err := client.listCreateRequest(ctx, resourceGroupName, expressRouteGatewayName, options) - if err != nil { - return ExpressRouteConnectionsClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ExpressRouteConnectionsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ExpressRouteConnectionsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) -} - -// listCreateRequest creates the List request. -func (client *ExpressRouteConnectionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, options *ExpressRouteConnectionsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}/expressRouteConnections" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if expressRouteGatewayName == "" { - return nil, errors.New("parameter expressRouteGatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{expressRouteGatewayName}", url.PathEscape(expressRouteGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *ExpressRouteConnectionsClient) listHandleResponse(resp *http.Response) (ExpressRouteConnectionsClientListResponse, error) { - result := ExpressRouteConnectionsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRouteConnectionList); err != nil { - return ExpressRouteConnectionsClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/expressroutecrossconnectionpeerings_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/expressroutecrossconnectionpeerings_client.go deleted file mode 100644 index 2e0ddf3d..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/expressroutecrossconnectionpeerings_client.go +++ /dev/null @@ -1,330 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// ExpressRouteCrossConnectionPeeringsClient contains the methods for the ExpressRouteCrossConnectionPeerings group. -// Don't use this type directly, use NewExpressRouteCrossConnectionPeeringsClient() instead. -type ExpressRouteCrossConnectionPeeringsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewExpressRouteCrossConnectionPeeringsClient creates a new instance of ExpressRouteCrossConnectionPeeringsClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewExpressRouteCrossConnectionPeeringsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ExpressRouteCrossConnectionPeeringsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &ExpressRouteCrossConnectionPeeringsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates a peering in the specified ExpressRouteCrossConnection. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// crossConnectionName - The name of the ExpressRouteCrossConnection. -// peeringName - The name of the peering. -// peeringParameters - Parameters supplied to the create or update ExpressRouteCrossConnection peering operation. -// options - ExpressRouteCrossConnectionPeeringsClientBeginCreateOrUpdateOptions contains the optional parameters for the -// ExpressRouteCrossConnectionPeeringsClient.BeginCreateOrUpdate method. -func (client *ExpressRouteCrossConnectionPeeringsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string, peeringParameters ExpressRouteCrossConnectionPeering, options *ExpressRouteCrossConnectionPeeringsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ExpressRouteCrossConnectionPeeringsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, crossConnectionName, peeringName, peeringParameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ExpressRouteCrossConnectionPeeringsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[ExpressRouteCrossConnectionPeeringsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates or updates a peering in the specified ExpressRouteCrossConnection. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *ExpressRouteCrossConnectionPeeringsClient) createOrUpdate(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string, peeringParameters ExpressRouteCrossConnectionPeering, options *ExpressRouteCrossConnectionPeeringsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, crossConnectionName, peeringName, peeringParameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ExpressRouteCrossConnectionPeeringsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string, peeringParameters ExpressRouteCrossConnectionPeering, options *ExpressRouteCrossConnectionPeeringsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if crossConnectionName == "" { - return nil, errors.New("parameter crossConnectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{crossConnectionName}", url.PathEscape(crossConnectionName)) - if peeringName == "" { - return nil, errors.New("parameter peeringName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{peeringName}", url.PathEscape(peeringName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, peeringParameters) -} - -// BeginDelete - Deletes the specified peering from the ExpressRouteCrossConnection. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// crossConnectionName - The name of the ExpressRouteCrossConnection. -// peeringName - The name of the peering. -// options - ExpressRouteCrossConnectionPeeringsClientBeginDeleteOptions contains the optional parameters for the ExpressRouteCrossConnectionPeeringsClient.BeginDelete -// method. -func (client *ExpressRouteCrossConnectionPeeringsClient) BeginDelete(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string, options *ExpressRouteCrossConnectionPeeringsClientBeginDeleteOptions) (*runtime.Poller[ExpressRouteCrossConnectionPeeringsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, crossConnectionName, peeringName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ExpressRouteCrossConnectionPeeringsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[ExpressRouteCrossConnectionPeeringsClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes the specified peering from the ExpressRouteCrossConnection. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *ExpressRouteCrossConnectionPeeringsClient) deleteOperation(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string, options *ExpressRouteCrossConnectionPeeringsClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, crossConnectionName, peeringName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *ExpressRouteCrossConnectionPeeringsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string, options *ExpressRouteCrossConnectionPeeringsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if crossConnectionName == "" { - return nil, errors.New("parameter crossConnectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{crossConnectionName}", url.PathEscape(crossConnectionName)) - if peeringName == "" { - return nil, errors.New("parameter peeringName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{peeringName}", url.PathEscape(peeringName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets the specified peering for the ExpressRouteCrossConnection. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// crossConnectionName - The name of the ExpressRouteCrossConnection. -// peeringName - The name of the peering. -// options - ExpressRouteCrossConnectionPeeringsClientGetOptions contains the optional parameters for the ExpressRouteCrossConnectionPeeringsClient.Get -// method. -func (client *ExpressRouteCrossConnectionPeeringsClient) Get(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string, options *ExpressRouteCrossConnectionPeeringsClientGetOptions) (ExpressRouteCrossConnectionPeeringsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, crossConnectionName, peeringName, options) - if err != nil { - return ExpressRouteCrossConnectionPeeringsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ExpressRouteCrossConnectionPeeringsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ExpressRouteCrossConnectionPeeringsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *ExpressRouteCrossConnectionPeeringsClient) getCreateRequest(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string, options *ExpressRouteCrossConnectionPeeringsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if crossConnectionName == "" { - return nil, errors.New("parameter crossConnectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{crossConnectionName}", url.PathEscape(crossConnectionName)) - if peeringName == "" { - return nil, errors.New("parameter peeringName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{peeringName}", url.PathEscape(peeringName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *ExpressRouteCrossConnectionPeeringsClient) getHandleResponse(resp *http.Response) (ExpressRouteCrossConnectionPeeringsClientGetResponse, error) { - result := ExpressRouteCrossConnectionPeeringsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRouteCrossConnectionPeering); err != nil { - return ExpressRouteCrossConnectionPeeringsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Gets all peerings in a specified ExpressRouteCrossConnection. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// crossConnectionName - The name of the ExpressRouteCrossConnection. -// options - ExpressRouteCrossConnectionPeeringsClientListOptions contains the optional parameters for the ExpressRouteCrossConnectionPeeringsClient.List -// method. -func (client *ExpressRouteCrossConnectionPeeringsClient) NewListPager(resourceGroupName string, crossConnectionName string, options *ExpressRouteCrossConnectionPeeringsClientListOptions) *runtime.Pager[ExpressRouteCrossConnectionPeeringsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[ExpressRouteCrossConnectionPeeringsClientListResponse]{ - More: func(page ExpressRouteCrossConnectionPeeringsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ExpressRouteCrossConnectionPeeringsClientListResponse) (ExpressRouteCrossConnectionPeeringsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, crossConnectionName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return ExpressRouteCrossConnectionPeeringsClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ExpressRouteCrossConnectionPeeringsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ExpressRouteCrossConnectionPeeringsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *ExpressRouteCrossConnectionPeeringsClient) listCreateRequest(ctx context.Context, resourceGroupName string, crossConnectionName string, options *ExpressRouteCrossConnectionPeeringsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if crossConnectionName == "" { - return nil, errors.New("parameter crossConnectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{crossConnectionName}", url.PathEscape(crossConnectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *ExpressRouteCrossConnectionPeeringsClient) listHandleResponse(resp *http.Response) (ExpressRouteCrossConnectionPeeringsClientListResponse, error) { - result := ExpressRouteCrossConnectionPeeringsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRouteCrossConnectionPeeringList); err != nil { - return ExpressRouteCrossConnectionPeeringsClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/expressroutecrossconnections_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/expressroutecrossconnections_client.go deleted file mode 100644 index 6edbdd28..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/expressroutecrossconnections_client.go +++ /dev/null @@ -1,594 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// ExpressRouteCrossConnectionsClient contains the methods for the ExpressRouteCrossConnections group. -// Don't use this type directly, use NewExpressRouteCrossConnectionsClient() instead. -type ExpressRouteCrossConnectionsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewExpressRouteCrossConnectionsClient creates a new instance of ExpressRouteCrossConnectionsClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewExpressRouteCrossConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ExpressRouteCrossConnectionsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &ExpressRouteCrossConnectionsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Update the specified ExpressRouteCrossConnection. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// crossConnectionName - The name of the ExpressRouteCrossConnection. -// parameters - Parameters supplied to the update express route crossConnection operation. -// options - ExpressRouteCrossConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the ExpressRouteCrossConnectionsClient.BeginCreateOrUpdate -// method. -func (client *ExpressRouteCrossConnectionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, crossConnectionName string, parameters ExpressRouteCrossConnection, options *ExpressRouteCrossConnectionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ExpressRouteCrossConnectionsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, crossConnectionName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ExpressRouteCrossConnectionsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[ExpressRouteCrossConnectionsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Update the specified ExpressRouteCrossConnection. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *ExpressRouteCrossConnectionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, crossConnectionName string, parameters ExpressRouteCrossConnection, options *ExpressRouteCrossConnectionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, crossConnectionName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ExpressRouteCrossConnectionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, crossConnectionName string, parameters ExpressRouteCrossConnection, options *ExpressRouteCrossConnectionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if crossConnectionName == "" { - return nil, errors.New("parameter crossConnectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{crossConnectionName}", url.PathEscape(crossConnectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// Get - Gets details about the specified ExpressRouteCrossConnection. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group (peering location of the circuit). -// crossConnectionName - The name of the ExpressRouteCrossConnection (service key of the circuit). -// options - ExpressRouteCrossConnectionsClientGetOptions contains the optional parameters for the ExpressRouteCrossConnectionsClient.Get -// method. -func (client *ExpressRouteCrossConnectionsClient) Get(ctx context.Context, resourceGroupName string, crossConnectionName string, options *ExpressRouteCrossConnectionsClientGetOptions) (ExpressRouteCrossConnectionsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, crossConnectionName, options) - if err != nil { - return ExpressRouteCrossConnectionsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ExpressRouteCrossConnectionsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ExpressRouteCrossConnectionsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *ExpressRouteCrossConnectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, crossConnectionName string, options *ExpressRouteCrossConnectionsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if crossConnectionName == "" { - return nil, errors.New("parameter crossConnectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{crossConnectionName}", url.PathEscape(crossConnectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *ExpressRouteCrossConnectionsClient) getHandleResponse(resp *http.Response) (ExpressRouteCrossConnectionsClientGetResponse, error) { - result := ExpressRouteCrossConnectionsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRouteCrossConnection); err != nil { - return ExpressRouteCrossConnectionsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Retrieves all the ExpressRouteCrossConnections in a subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// options - ExpressRouteCrossConnectionsClientListOptions contains the optional parameters for the ExpressRouteCrossConnectionsClient.List -// method. -func (client *ExpressRouteCrossConnectionsClient) NewListPager(options *ExpressRouteCrossConnectionsClientListOptions) *runtime.Pager[ExpressRouteCrossConnectionsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[ExpressRouteCrossConnectionsClientListResponse]{ - More: func(page ExpressRouteCrossConnectionsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ExpressRouteCrossConnectionsClientListResponse) (ExpressRouteCrossConnectionsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return ExpressRouteCrossConnectionsClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ExpressRouteCrossConnectionsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ExpressRouteCrossConnectionsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *ExpressRouteCrossConnectionsClient) listCreateRequest(ctx context.Context, options *ExpressRouteCrossConnectionsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCrossConnections" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *ExpressRouteCrossConnectionsClient) listHandleResponse(resp *http.Response) (ExpressRouteCrossConnectionsClientListResponse, error) { - result := ExpressRouteCrossConnectionsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRouteCrossConnectionListResult); err != nil { - return ExpressRouteCrossConnectionsClientListResponse{}, err - } - return result, nil -} - -// BeginListArpTable - Gets the currently advertised ARP table associated with the express route cross connection in a resource -// group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// crossConnectionName - The name of the ExpressRouteCrossConnection. -// peeringName - The name of the peering. -// devicePath - The path of the device. -// options - ExpressRouteCrossConnectionsClientBeginListArpTableOptions contains the optional parameters for the ExpressRouteCrossConnectionsClient.BeginListArpTable -// method. -func (client *ExpressRouteCrossConnectionsClient) BeginListArpTable(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string, devicePath string, options *ExpressRouteCrossConnectionsClientBeginListArpTableOptions) (*runtime.Poller[ExpressRouteCrossConnectionsClientListArpTableResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.listArpTable(ctx, resourceGroupName, crossConnectionName, peeringName, devicePath, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ExpressRouteCrossConnectionsClientListArpTableResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[ExpressRouteCrossConnectionsClientListArpTableResponse](options.ResumeToken, client.pl, nil) - } -} - -// ListArpTable - Gets the currently advertised ARP table associated with the express route cross connection in a resource -// group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *ExpressRouteCrossConnectionsClient) listArpTable(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string, devicePath string, options *ExpressRouteCrossConnectionsClientBeginListArpTableOptions) (*http.Response, error) { - req, err := client.listArpTableCreateRequest(ctx, resourceGroupName, crossConnectionName, peeringName, devicePath, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// listArpTableCreateRequest creates the ListArpTable request. -func (client *ExpressRouteCrossConnectionsClient) listArpTableCreateRequest(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string, devicePath string, options *ExpressRouteCrossConnectionsClientBeginListArpTableOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/arpTables/{devicePath}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if crossConnectionName == "" { - return nil, errors.New("parameter crossConnectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{crossConnectionName}", url.PathEscape(crossConnectionName)) - if peeringName == "" { - return nil, errors.New("parameter peeringName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{peeringName}", url.PathEscape(peeringName)) - if devicePath == "" { - return nil, errors.New("parameter devicePath cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{devicePath}", url.PathEscape(devicePath)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// NewListByResourceGroupPager - Retrieves all the ExpressRouteCrossConnections in a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// options - ExpressRouteCrossConnectionsClientListByResourceGroupOptions contains the optional parameters for the ExpressRouteCrossConnectionsClient.ListByResourceGroup -// method. -func (client *ExpressRouteCrossConnectionsClient) NewListByResourceGroupPager(resourceGroupName string, options *ExpressRouteCrossConnectionsClientListByResourceGroupOptions) *runtime.Pager[ExpressRouteCrossConnectionsClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[ExpressRouteCrossConnectionsClientListByResourceGroupResponse]{ - More: func(page ExpressRouteCrossConnectionsClientListByResourceGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ExpressRouteCrossConnectionsClientListByResourceGroupResponse) (ExpressRouteCrossConnectionsClientListByResourceGroupResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return ExpressRouteCrossConnectionsClientListByResourceGroupResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ExpressRouteCrossConnectionsClientListByResourceGroupResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ExpressRouteCrossConnectionsClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) - } - return client.listByResourceGroupHandleResponse(resp) - }, - }) -} - -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *ExpressRouteCrossConnectionsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ExpressRouteCrossConnectionsClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *ExpressRouteCrossConnectionsClient) listByResourceGroupHandleResponse(resp *http.Response) (ExpressRouteCrossConnectionsClientListByResourceGroupResponse, error) { - result := ExpressRouteCrossConnectionsClientListByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRouteCrossConnectionListResult); err != nil { - return ExpressRouteCrossConnectionsClientListByResourceGroupResponse{}, err - } - return result, nil -} - -// BeginListRoutesTable - Gets the currently advertised routes table associated with the express route cross connection in -// a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// crossConnectionName - The name of the ExpressRouteCrossConnection. -// peeringName - The name of the peering. -// devicePath - The path of the device. -// options - ExpressRouteCrossConnectionsClientBeginListRoutesTableOptions contains the optional parameters for the ExpressRouteCrossConnectionsClient.BeginListRoutesTable -// method. -func (client *ExpressRouteCrossConnectionsClient) BeginListRoutesTable(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string, devicePath string, options *ExpressRouteCrossConnectionsClientBeginListRoutesTableOptions) (*runtime.Poller[ExpressRouteCrossConnectionsClientListRoutesTableResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.listRoutesTable(ctx, resourceGroupName, crossConnectionName, peeringName, devicePath, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ExpressRouteCrossConnectionsClientListRoutesTableResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[ExpressRouteCrossConnectionsClientListRoutesTableResponse](options.ResumeToken, client.pl, nil) - } -} - -// ListRoutesTable - Gets the currently advertised routes table associated with the express route cross connection in a resource -// group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *ExpressRouteCrossConnectionsClient) listRoutesTable(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string, devicePath string, options *ExpressRouteCrossConnectionsClientBeginListRoutesTableOptions) (*http.Response, error) { - req, err := client.listRoutesTableCreateRequest(ctx, resourceGroupName, crossConnectionName, peeringName, devicePath, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// listRoutesTableCreateRequest creates the ListRoutesTable request. -func (client *ExpressRouteCrossConnectionsClient) listRoutesTableCreateRequest(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string, devicePath string, options *ExpressRouteCrossConnectionsClientBeginListRoutesTableOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/routeTables/{devicePath}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if crossConnectionName == "" { - return nil, errors.New("parameter crossConnectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{crossConnectionName}", url.PathEscape(crossConnectionName)) - if peeringName == "" { - return nil, errors.New("parameter peeringName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{peeringName}", url.PathEscape(peeringName)) - if devicePath == "" { - return nil, errors.New("parameter devicePath cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{devicePath}", url.PathEscape(devicePath)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginListRoutesTableSummary - Gets the route table summary associated with the express route cross connection in a resource -// group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// crossConnectionName - The name of the ExpressRouteCrossConnection. -// peeringName - The name of the peering. -// devicePath - The path of the device. -// options - ExpressRouteCrossConnectionsClientBeginListRoutesTableSummaryOptions contains the optional parameters for the -// ExpressRouteCrossConnectionsClient.BeginListRoutesTableSummary method. -func (client *ExpressRouteCrossConnectionsClient) BeginListRoutesTableSummary(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string, devicePath string, options *ExpressRouteCrossConnectionsClientBeginListRoutesTableSummaryOptions) (*runtime.Poller[ExpressRouteCrossConnectionsClientListRoutesTableSummaryResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.listRoutesTableSummary(ctx, resourceGroupName, crossConnectionName, peeringName, devicePath, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ExpressRouteCrossConnectionsClientListRoutesTableSummaryResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[ExpressRouteCrossConnectionsClientListRoutesTableSummaryResponse](options.ResumeToken, client.pl, nil) - } -} - -// ListRoutesTableSummary - Gets the route table summary associated with the express route cross connection in a resource -// group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *ExpressRouteCrossConnectionsClient) listRoutesTableSummary(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string, devicePath string, options *ExpressRouteCrossConnectionsClientBeginListRoutesTableSummaryOptions) (*http.Response, error) { - req, err := client.listRoutesTableSummaryCreateRequest(ctx, resourceGroupName, crossConnectionName, peeringName, devicePath, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// listRoutesTableSummaryCreateRequest creates the ListRoutesTableSummary request. -func (client *ExpressRouteCrossConnectionsClient) listRoutesTableSummaryCreateRequest(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string, devicePath string, options *ExpressRouteCrossConnectionsClientBeginListRoutesTableSummaryOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/routeTablesSummary/{devicePath}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if crossConnectionName == "" { - return nil, errors.New("parameter crossConnectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{crossConnectionName}", url.PathEscape(crossConnectionName)) - if peeringName == "" { - return nil, errors.New("parameter peeringName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{peeringName}", url.PathEscape(peeringName)) - if devicePath == "" { - return nil, errors.New("parameter devicePath cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{devicePath}", url.PathEscape(devicePath)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// UpdateTags - Updates an express route cross connection tags. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// crossConnectionName - The name of the cross connection. -// crossConnectionParameters - Parameters supplied to update express route cross connection tags. -// options - ExpressRouteCrossConnectionsClientUpdateTagsOptions contains the optional parameters for the ExpressRouteCrossConnectionsClient.UpdateTags -// method. -func (client *ExpressRouteCrossConnectionsClient) UpdateTags(ctx context.Context, resourceGroupName string, crossConnectionName string, crossConnectionParameters TagsObject, options *ExpressRouteCrossConnectionsClientUpdateTagsOptions) (ExpressRouteCrossConnectionsClientUpdateTagsResponse, error) { - req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, crossConnectionName, crossConnectionParameters, options) - if err != nil { - return ExpressRouteCrossConnectionsClientUpdateTagsResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ExpressRouteCrossConnectionsClientUpdateTagsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ExpressRouteCrossConnectionsClientUpdateTagsResponse{}, runtime.NewResponseError(resp) - } - return client.updateTagsHandleResponse(resp) -} - -// updateTagsCreateRequest creates the UpdateTags request. -func (client *ExpressRouteCrossConnectionsClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, crossConnectionName string, crossConnectionParameters TagsObject, options *ExpressRouteCrossConnectionsClientUpdateTagsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if crossConnectionName == "" { - return nil, errors.New("parameter crossConnectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{crossConnectionName}", url.PathEscape(crossConnectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, crossConnectionParameters) -} - -// updateTagsHandleResponse handles the UpdateTags response. -func (client *ExpressRouteCrossConnectionsClient) updateTagsHandleResponse(resp *http.Response) (ExpressRouteCrossConnectionsClientUpdateTagsResponse, error) { - result := ExpressRouteCrossConnectionsClientUpdateTagsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRouteCrossConnection); err != nil { - return ExpressRouteCrossConnectionsClientUpdateTagsResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/expressroutegateways_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/expressroutegateways_client.go deleted file mode 100644 index 909b28a7..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/expressroutegateways_client.go +++ /dev/null @@ -1,412 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// ExpressRouteGatewaysClient contains the methods for the ExpressRouteGateways group. -// Don't use this type directly, use NewExpressRouteGatewaysClient() instead. -type ExpressRouteGatewaysClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewExpressRouteGatewaysClient creates a new instance of ExpressRouteGatewaysClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewExpressRouteGatewaysClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ExpressRouteGatewaysClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &ExpressRouteGatewaysClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates a ExpressRoute gateway in a specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// expressRouteGatewayName - The name of the ExpressRoute gateway. -// putExpressRouteGatewayParameters - Parameters required in an ExpressRoute gateway PUT operation. -// options - ExpressRouteGatewaysClientBeginCreateOrUpdateOptions contains the optional parameters for the ExpressRouteGatewaysClient.BeginCreateOrUpdate -// method. -func (client *ExpressRouteGatewaysClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, putExpressRouteGatewayParameters ExpressRouteGateway, options *ExpressRouteGatewaysClientBeginCreateOrUpdateOptions) (*runtime.Poller[ExpressRouteGatewaysClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, expressRouteGatewayName, putExpressRouteGatewayParameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ExpressRouteGatewaysClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[ExpressRouteGatewaysClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates or updates a ExpressRoute gateway in a specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *ExpressRouteGatewaysClient) createOrUpdate(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, putExpressRouteGatewayParameters ExpressRouteGateway, options *ExpressRouteGatewaysClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, expressRouteGatewayName, putExpressRouteGatewayParameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ExpressRouteGatewaysClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, putExpressRouteGatewayParameters ExpressRouteGateway, options *ExpressRouteGatewaysClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if expressRouteGatewayName == "" { - return nil, errors.New("parameter expressRouteGatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{expressRouteGatewayName}", url.PathEscape(expressRouteGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, putExpressRouteGatewayParameters) -} - -// BeginDelete - Deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway resource can only -// be deleted when there are no connection subresources. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// expressRouteGatewayName - The name of the ExpressRoute gateway. -// options - ExpressRouteGatewaysClientBeginDeleteOptions contains the optional parameters for the ExpressRouteGatewaysClient.BeginDelete -// method. -func (client *ExpressRouteGatewaysClient) BeginDelete(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, options *ExpressRouteGatewaysClientBeginDeleteOptions) (*runtime.Poller[ExpressRouteGatewaysClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, expressRouteGatewayName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ExpressRouteGatewaysClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[ExpressRouteGatewaysClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway resource can only be deleted -// when there are no connection subresources. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *ExpressRouteGatewaysClient) deleteOperation(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, options *ExpressRouteGatewaysClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, expressRouteGatewayName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *ExpressRouteGatewaysClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, options *ExpressRouteGatewaysClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if expressRouteGatewayName == "" { - return nil, errors.New("parameter expressRouteGatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{expressRouteGatewayName}", url.PathEscape(expressRouteGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Fetches the details of a ExpressRoute gateway in a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// expressRouteGatewayName - The name of the ExpressRoute gateway. -// options - ExpressRouteGatewaysClientGetOptions contains the optional parameters for the ExpressRouteGatewaysClient.Get -// method. -func (client *ExpressRouteGatewaysClient) Get(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, options *ExpressRouteGatewaysClientGetOptions) (ExpressRouteGatewaysClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, expressRouteGatewayName, options) - if err != nil { - return ExpressRouteGatewaysClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ExpressRouteGatewaysClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ExpressRouteGatewaysClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *ExpressRouteGatewaysClient) getCreateRequest(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, options *ExpressRouteGatewaysClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if expressRouteGatewayName == "" { - return nil, errors.New("parameter expressRouteGatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{expressRouteGatewayName}", url.PathEscape(expressRouteGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *ExpressRouteGatewaysClient) getHandleResponse(resp *http.Response) (ExpressRouteGatewaysClientGetResponse, error) { - result := ExpressRouteGatewaysClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRouteGateway); err != nil { - return ExpressRouteGatewaysClientGetResponse{}, err - } - return result, nil -} - -// ListByResourceGroup - Lists ExpressRoute gateways in a given resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// options - ExpressRouteGatewaysClientListByResourceGroupOptions contains the optional parameters for the ExpressRouteGatewaysClient.ListByResourceGroup -// method. -func (client *ExpressRouteGatewaysClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, options *ExpressRouteGatewaysClientListByResourceGroupOptions) (ExpressRouteGatewaysClientListByResourceGroupResponse, error) { - req, err := client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) - if err != nil { - return ExpressRouteGatewaysClientListByResourceGroupResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ExpressRouteGatewaysClientListByResourceGroupResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ExpressRouteGatewaysClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) - } - return client.listByResourceGroupHandleResponse(resp) -} - -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *ExpressRouteGatewaysClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ExpressRouteGatewaysClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *ExpressRouteGatewaysClient) listByResourceGroupHandleResponse(resp *http.Response) (ExpressRouteGatewaysClientListByResourceGroupResponse, error) { - result := ExpressRouteGatewaysClientListByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRouteGatewayList); err != nil { - return ExpressRouteGatewaysClientListByResourceGroupResponse{}, err - } - return result, nil -} - -// ListBySubscription - Lists ExpressRoute gateways under a given subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// options - ExpressRouteGatewaysClientListBySubscriptionOptions contains the optional parameters for the ExpressRouteGatewaysClient.ListBySubscription -// method. -func (client *ExpressRouteGatewaysClient) ListBySubscription(ctx context.Context, options *ExpressRouteGatewaysClientListBySubscriptionOptions) (ExpressRouteGatewaysClientListBySubscriptionResponse, error) { - req, err := client.listBySubscriptionCreateRequest(ctx, options) - if err != nil { - return ExpressRouteGatewaysClientListBySubscriptionResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ExpressRouteGatewaysClientListBySubscriptionResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ExpressRouteGatewaysClientListBySubscriptionResponse{}, runtime.NewResponseError(resp) - } - return client.listBySubscriptionHandleResponse(resp) -} - -// listBySubscriptionCreateRequest creates the ListBySubscription request. -func (client *ExpressRouteGatewaysClient) listBySubscriptionCreateRequest(ctx context.Context, options *ExpressRouteGatewaysClientListBySubscriptionOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteGateways" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listBySubscriptionHandleResponse handles the ListBySubscription response. -func (client *ExpressRouteGatewaysClient) listBySubscriptionHandleResponse(resp *http.Response) (ExpressRouteGatewaysClientListBySubscriptionResponse, error) { - result := ExpressRouteGatewaysClientListBySubscriptionResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRouteGatewayList); err != nil { - return ExpressRouteGatewaysClientListBySubscriptionResponse{}, err - } - return result, nil -} - -// BeginUpdateTags - Updates express route gateway tags. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the ExpressRouteGateway. -// expressRouteGatewayName - The name of the gateway. -// expressRouteGatewayParameters - Parameters supplied to update a virtual wan express route gateway tags. -// options - ExpressRouteGatewaysClientBeginUpdateTagsOptions contains the optional parameters for the ExpressRouteGatewaysClient.BeginUpdateTags -// method. -func (client *ExpressRouteGatewaysClient) BeginUpdateTags(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, expressRouteGatewayParameters TagsObject, options *ExpressRouteGatewaysClientBeginUpdateTagsOptions) (*runtime.Poller[ExpressRouteGatewaysClientUpdateTagsResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.updateTags(ctx, resourceGroupName, expressRouteGatewayName, expressRouteGatewayParameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ExpressRouteGatewaysClientUpdateTagsResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[ExpressRouteGatewaysClientUpdateTagsResponse](options.ResumeToken, client.pl, nil) - } -} - -// UpdateTags - Updates express route gateway tags. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *ExpressRouteGatewaysClient) updateTags(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, expressRouteGatewayParameters TagsObject, options *ExpressRouteGatewaysClientBeginUpdateTagsOptions) (*http.Response, error) { - req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, expressRouteGatewayName, expressRouteGatewayParameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// updateTagsCreateRequest creates the UpdateTags request. -func (client *ExpressRouteGatewaysClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, expressRouteGatewayParameters TagsObject, options *ExpressRouteGatewaysClientBeginUpdateTagsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if expressRouteGatewayName == "" { - return nil, errors.New("parameter expressRouteGatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{expressRouteGatewayName}", url.PathEscape(expressRouteGatewayName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, expressRouteGatewayParameters) -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/expressroutelinks_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/expressroutelinks_client.go deleted file mode 100644 index d1812abd..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/expressroutelinks_client.go +++ /dev/null @@ -1,187 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// ExpressRouteLinksClient contains the methods for the ExpressRouteLinks group. -// Don't use this type directly, use NewExpressRouteLinksClient() instead. -type ExpressRouteLinksClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewExpressRouteLinksClient creates a new instance of ExpressRouteLinksClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewExpressRouteLinksClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ExpressRouteLinksClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &ExpressRouteLinksClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// Get - Retrieves the specified ExpressRouteLink resource. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// expressRoutePortName - The name of the ExpressRoutePort resource. -// linkName - The name of the ExpressRouteLink resource. -// options - ExpressRouteLinksClientGetOptions contains the optional parameters for the ExpressRouteLinksClient.Get method. -func (client *ExpressRouteLinksClient) Get(ctx context.Context, resourceGroupName string, expressRoutePortName string, linkName string, options *ExpressRouteLinksClientGetOptions) (ExpressRouteLinksClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, expressRoutePortName, linkName, options) - if err != nil { - return ExpressRouteLinksClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ExpressRouteLinksClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ExpressRouteLinksClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *ExpressRouteLinksClient) getCreateRequest(ctx context.Context, resourceGroupName string, expressRoutePortName string, linkName string, options *ExpressRouteLinksClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}/links/{linkName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if expressRoutePortName == "" { - return nil, errors.New("parameter expressRoutePortName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{expressRoutePortName}", url.PathEscape(expressRoutePortName)) - if linkName == "" { - return nil, errors.New("parameter linkName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{linkName}", url.PathEscape(linkName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *ExpressRouteLinksClient) getHandleResponse(resp *http.Response) (ExpressRouteLinksClientGetResponse, error) { - result := ExpressRouteLinksClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRouteLink); err != nil { - return ExpressRouteLinksClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// expressRoutePortName - The name of the ExpressRoutePort resource. -// options - ExpressRouteLinksClientListOptions contains the optional parameters for the ExpressRouteLinksClient.List method. -func (client *ExpressRouteLinksClient) NewListPager(resourceGroupName string, expressRoutePortName string, options *ExpressRouteLinksClientListOptions) *runtime.Pager[ExpressRouteLinksClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[ExpressRouteLinksClientListResponse]{ - More: func(page ExpressRouteLinksClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ExpressRouteLinksClientListResponse) (ExpressRouteLinksClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, expressRoutePortName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return ExpressRouteLinksClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ExpressRouteLinksClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ExpressRouteLinksClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *ExpressRouteLinksClient) listCreateRequest(ctx context.Context, resourceGroupName string, expressRoutePortName string, options *ExpressRouteLinksClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}/links" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if expressRoutePortName == "" { - return nil, errors.New("parameter expressRoutePortName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{expressRoutePortName}", url.PathEscape(expressRoutePortName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *ExpressRouteLinksClient) listHandleResponse(resp *http.Response) (ExpressRouteLinksClientListResponse, error) { - result := ExpressRouteLinksClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRouteLinkListResult); err != nil { - return ExpressRouteLinksClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/expressrouteportauthorizations_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/expressrouteportauthorizations_client.go deleted file mode 100644 index 15aee2e0..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/expressrouteportauthorizations_client.go +++ /dev/null @@ -1,330 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// ExpressRoutePortAuthorizationsClient contains the methods for the ExpressRoutePortAuthorizations group. -// Don't use this type directly, use NewExpressRoutePortAuthorizationsClient() instead. -type ExpressRoutePortAuthorizationsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewExpressRoutePortAuthorizationsClient creates a new instance of ExpressRoutePortAuthorizationsClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewExpressRoutePortAuthorizationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ExpressRoutePortAuthorizationsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &ExpressRoutePortAuthorizationsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates an authorization in the specified express route port. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// expressRoutePortName - The name of the express route port. -// authorizationName - The name of the authorization. -// authorizationParameters - Parameters supplied to the create or update express route port authorization operation. -// options - ExpressRoutePortAuthorizationsClientBeginCreateOrUpdateOptions contains the optional parameters for the ExpressRoutePortAuthorizationsClient.BeginCreateOrUpdate -// method. -func (client *ExpressRoutePortAuthorizationsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, expressRoutePortName string, authorizationName string, authorizationParameters ExpressRoutePortAuthorization, options *ExpressRoutePortAuthorizationsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ExpressRoutePortAuthorizationsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, expressRoutePortName, authorizationName, authorizationParameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ExpressRoutePortAuthorizationsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[ExpressRoutePortAuthorizationsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates or updates an authorization in the specified express route port. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *ExpressRoutePortAuthorizationsClient) createOrUpdate(ctx context.Context, resourceGroupName string, expressRoutePortName string, authorizationName string, authorizationParameters ExpressRoutePortAuthorization, options *ExpressRoutePortAuthorizationsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, expressRoutePortName, authorizationName, authorizationParameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ExpressRoutePortAuthorizationsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, expressRoutePortName string, authorizationName string, authorizationParameters ExpressRoutePortAuthorization, options *ExpressRoutePortAuthorizationsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRoutePorts/{expressRoutePortName}/authorizations/{authorizationName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if expressRoutePortName == "" { - return nil, errors.New("parameter expressRoutePortName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{expressRoutePortName}", url.PathEscape(expressRoutePortName)) - if authorizationName == "" { - return nil, errors.New("parameter authorizationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{authorizationName}", url.PathEscape(authorizationName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, authorizationParameters) -} - -// BeginDelete - Deletes the specified authorization from the specified express route port. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// expressRoutePortName - The name of the express route port. -// authorizationName - The name of the authorization. -// options - ExpressRoutePortAuthorizationsClientBeginDeleteOptions contains the optional parameters for the ExpressRoutePortAuthorizationsClient.BeginDelete -// method. -func (client *ExpressRoutePortAuthorizationsClient) BeginDelete(ctx context.Context, resourceGroupName string, expressRoutePortName string, authorizationName string, options *ExpressRoutePortAuthorizationsClientBeginDeleteOptions) (*runtime.Poller[ExpressRoutePortAuthorizationsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, expressRoutePortName, authorizationName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ExpressRoutePortAuthorizationsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[ExpressRoutePortAuthorizationsClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes the specified authorization from the specified express route port. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *ExpressRoutePortAuthorizationsClient) deleteOperation(ctx context.Context, resourceGroupName string, expressRoutePortName string, authorizationName string, options *ExpressRoutePortAuthorizationsClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, expressRoutePortName, authorizationName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *ExpressRoutePortAuthorizationsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, expressRoutePortName string, authorizationName string, options *ExpressRoutePortAuthorizationsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRoutePorts/{expressRoutePortName}/authorizations/{authorizationName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if expressRoutePortName == "" { - return nil, errors.New("parameter expressRoutePortName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{expressRoutePortName}", url.PathEscape(expressRoutePortName)) - if authorizationName == "" { - return nil, errors.New("parameter authorizationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{authorizationName}", url.PathEscape(authorizationName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets the specified authorization from the specified express route port. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// expressRoutePortName - The name of the express route port. -// authorizationName - The name of the authorization. -// options - ExpressRoutePortAuthorizationsClientGetOptions contains the optional parameters for the ExpressRoutePortAuthorizationsClient.Get -// method. -func (client *ExpressRoutePortAuthorizationsClient) Get(ctx context.Context, resourceGroupName string, expressRoutePortName string, authorizationName string, options *ExpressRoutePortAuthorizationsClientGetOptions) (ExpressRoutePortAuthorizationsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, expressRoutePortName, authorizationName, options) - if err != nil { - return ExpressRoutePortAuthorizationsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ExpressRoutePortAuthorizationsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ExpressRoutePortAuthorizationsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *ExpressRoutePortAuthorizationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, expressRoutePortName string, authorizationName string, options *ExpressRoutePortAuthorizationsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRoutePorts/{expressRoutePortName}/authorizations/{authorizationName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if expressRoutePortName == "" { - return nil, errors.New("parameter expressRoutePortName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{expressRoutePortName}", url.PathEscape(expressRoutePortName)) - if authorizationName == "" { - return nil, errors.New("parameter authorizationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{authorizationName}", url.PathEscape(authorizationName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *ExpressRoutePortAuthorizationsClient) getHandleResponse(resp *http.Response) (ExpressRoutePortAuthorizationsClientGetResponse, error) { - result := ExpressRoutePortAuthorizationsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRoutePortAuthorization); err != nil { - return ExpressRoutePortAuthorizationsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Gets all authorizations in an express route port. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// expressRoutePortName - The name of the express route port. -// options - ExpressRoutePortAuthorizationsClientListOptions contains the optional parameters for the ExpressRoutePortAuthorizationsClient.List -// method. -func (client *ExpressRoutePortAuthorizationsClient) NewListPager(resourceGroupName string, expressRoutePortName string, options *ExpressRoutePortAuthorizationsClientListOptions) *runtime.Pager[ExpressRoutePortAuthorizationsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[ExpressRoutePortAuthorizationsClientListResponse]{ - More: func(page ExpressRoutePortAuthorizationsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ExpressRoutePortAuthorizationsClientListResponse) (ExpressRoutePortAuthorizationsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, expressRoutePortName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return ExpressRoutePortAuthorizationsClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ExpressRoutePortAuthorizationsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ExpressRoutePortAuthorizationsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *ExpressRoutePortAuthorizationsClient) listCreateRequest(ctx context.Context, resourceGroupName string, expressRoutePortName string, options *ExpressRoutePortAuthorizationsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRoutePorts/{expressRoutePortName}/authorizations" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if expressRoutePortName == "" { - return nil, errors.New("parameter expressRoutePortName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{expressRoutePortName}", url.PathEscape(expressRoutePortName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *ExpressRoutePortAuthorizationsClient) listHandleResponse(resp *http.Response) (ExpressRoutePortAuthorizationsClientListResponse, error) { - result := ExpressRoutePortAuthorizationsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRoutePortAuthorizationListResult); err != nil { - return ExpressRoutePortAuthorizationsClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/expressrouteports_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/expressrouteports_client.go deleted file mode 100644 index b51a5fa1..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/expressrouteports_client.go +++ /dev/null @@ -1,484 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// ExpressRoutePortsClient contains the methods for the ExpressRoutePorts group. -// Don't use this type directly, use NewExpressRoutePortsClient() instead. -type ExpressRoutePortsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewExpressRoutePortsClient creates a new instance of ExpressRoutePortsClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewExpressRoutePortsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ExpressRoutePortsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &ExpressRoutePortsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates the specified ExpressRoutePort resource. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// expressRoutePortName - The name of the ExpressRoutePort resource. -// parameters - Parameters supplied to the create ExpressRoutePort operation. -// options - ExpressRoutePortsClientBeginCreateOrUpdateOptions contains the optional parameters for the ExpressRoutePortsClient.BeginCreateOrUpdate -// method. -func (client *ExpressRoutePortsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, expressRoutePortName string, parameters ExpressRoutePort, options *ExpressRoutePortsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ExpressRoutePortsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, expressRoutePortName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ExpressRoutePortsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[ExpressRoutePortsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates or updates the specified ExpressRoutePort resource. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *ExpressRoutePortsClient) createOrUpdate(ctx context.Context, resourceGroupName string, expressRoutePortName string, parameters ExpressRoutePort, options *ExpressRoutePortsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, expressRoutePortName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ExpressRoutePortsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, expressRoutePortName string, parameters ExpressRoutePort, options *ExpressRoutePortsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if expressRoutePortName == "" { - return nil, errors.New("parameter expressRoutePortName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{expressRoutePortName}", url.PathEscape(expressRoutePortName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginDelete - Deletes the specified ExpressRoutePort resource. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// expressRoutePortName - The name of the ExpressRoutePort resource. -// options - ExpressRoutePortsClientBeginDeleteOptions contains the optional parameters for the ExpressRoutePortsClient.BeginDelete -// method. -func (client *ExpressRoutePortsClient) BeginDelete(ctx context.Context, resourceGroupName string, expressRoutePortName string, options *ExpressRoutePortsClientBeginDeleteOptions) (*runtime.Poller[ExpressRoutePortsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, expressRoutePortName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ExpressRoutePortsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[ExpressRoutePortsClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes the specified ExpressRoutePort resource. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *ExpressRoutePortsClient) deleteOperation(ctx context.Context, resourceGroupName string, expressRoutePortName string, options *ExpressRoutePortsClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, expressRoutePortName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *ExpressRoutePortsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, expressRoutePortName string, options *ExpressRoutePortsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if expressRoutePortName == "" { - return nil, errors.New("parameter expressRoutePortName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{expressRoutePortName}", url.PathEscape(expressRoutePortName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// GenerateLOA - Generate a letter of authorization for the requested ExpressRoutePort resource. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// expressRoutePortName - The name of ExpressRoutePort. -// request - Request parameters supplied to generate a letter of authorization. -// options - ExpressRoutePortsClientGenerateLOAOptions contains the optional parameters for the ExpressRoutePortsClient.GenerateLOA -// method. -func (client *ExpressRoutePortsClient) GenerateLOA(ctx context.Context, resourceGroupName string, expressRoutePortName string, request GenerateExpressRoutePortsLOARequest, options *ExpressRoutePortsClientGenerateLOAOptions) (ExpressRoutePortsClientGenerateLOAResponse, error) { - req, err := client.generateLOACreateRequest(ctx, resourceGroupName, expressRoutePortName, request, options) - if err != nil { - return ExpressRoutePortsClientGenerateLOAResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ExpressRoutePortsClientGenerateLOAResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ExpressRoutePortsClientGenerateLOAResponse{}, runtime.NewResponseError(resp) - } - return client.generateLOAHandleResponse(resp) -} - -// generateLOACreateRequest creates the GenerateLOA request. -func (client *ExpressRoutePortsClient) generateLOACreateRequest(ctx context.Context, resourceGroupName string, expressRoutePortName string, request GenerateExpressRoutePortsLOARequest, options *ExpressRoutePortsClientGenerateLOAOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRoutePorts/{expressRoutePortName}/generateLoa" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if expressRoutePortName == "" { - return nil, errors.New("parameter expressRoutePortName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{expressRoutePortName}", url.PathEscape(expressRoutePortName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, request) -} - -// generateLOAHandleResponse handles the GenerateLOA response. -func (client *ExpressRoutePortsClient) generateLOAHandleResponse(resp *http.Response) (ExpressRoutePortsClientGenerateLOAResponse, error) { - result := ExpressRoutePortsClientGenerateLOAResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.GenerateExpressRoutePortsLOAResult); err != nil { - return ExpressRoutePortsClientGenerateLOAResponse{}, err - } - return result, nil -} - -// Get - Retrieves the requested ExpressRoutePort resource. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// expressRoutePortName - The name of ExpressRoutePort. -// options - ExpressRoutePortsClientGetOptions contains the optional parameters for the ExpressRoutePortsClient.Get method. -func (client *ExpressRoutePortsClient) Get(ctx context.Context, resourceGroupName string, expressRoutePortName string, options *ExpressRoutePortsClientGetOptions) (ExpressRoutePortsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, expressRoutePortName, options) - if err != nil { - return ExpressRoutePortsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ExpressRoutePortsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ExpressRoutePortsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *ExpressRoutePortsClient) getCreateRequest(ctx context.Context, resourceGroupName string, expressRoutePortName string, options *ExpressRoutePortsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if expressRoutePortName == "" { - return nil, errors.New("parameter expressRoutePortName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{expressRoutePortName}", url.PathEscape(expressRoutePortName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *ExpressRoutePortsClient) getHandleResponse(resp *http.Response) (ExpressRoutePortsClientGetResponse, error) { - result := ExpressRoutePortsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRoutePort); err != nil { - return ExpressRoutePortsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - List all the ExpressRoutePort resources in the specified subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// options - ExpressRoutePortsClientListOptions contains the optional parameters for the ExpressRoutePortsClient.List method. -func (client *ExpressRoutePortsClient) NewListPager(options *ExpressRoutePortsClientListOptions) *runtime.Pager[ExpressRoutePortsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[ExpressRoutePortsClientListResponse]{ - More: func(page ExpressRoutePortsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ExpressRoutePortsClientListResponse) (ExpressRoutePortsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return ExpressRoutePortsClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ExpressRoutePortsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ExpressRoutePortsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *ExpressRoutePortsClient) listCreateRequest(ctx context.Context, options *ExpressRoutePortsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/ExpressRoutePorts" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *ExpressRoutePortsClient) listHandleResponse(resp *http.Response) (ExpressRoutePortsClientListResponse, error) { - result := ExpressRoutePortsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRoutePortListResult); err != nil { - return ExpressRoutePortsClientListResponse{}, err - } - return result, nil -} - -// NewListByResourceGroupPager - List all the ExpressRoutePort resources in the specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// options - ExpressRoutePortsClientListByResourceGroupOptions contains the optional parameters for the ExpressRoutePortsClient.ListByResourceGroup -// method. -func (client *ExpressRoutePortsClient) NewListByResourceGroupPager(resourceGroupName string, options *ExpressRoutePortsClientListByResourceGroupOptions) *runtime.Pager[ExpressRoutePortsClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[ExpressRoutePortsClientListByResourceGroupResponse]{ - More: func(page ExpressRoutePortsClientListByResourceGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ExpressRoutePortsClientListByResourceGroupResponse) (ExpressRoutePortsClientListByResourceGroupResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return ExpressRoutePortsClientListByResourceGroupResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ExpressRoutePortsClientListByResourceGroupResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ExpressRoutePortsClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) - } - return client.listByResourceGroupHandleResponse(resp) - }, - }) -} - -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *ExpressRoutePortsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ExpressRoutePortsClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *ExpressRoutePortsClient) listByResourceGroupHandleResponse(resp *http.Response) (ExpressRoutePortsClientListByResourceGroupResponse, error) { - result := ExpressRoutePortsClientListByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRoutePortListResult); err != nil { - return ExpressRoutePortsClientListByResourceGroupResponse{}, err - } - return result, nil -} - -// UpdateTags - Update ExpressRoutePort tags. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// expressRoutePortName - The name of the ExpressRoutePort resource. -// parameters - Parameters supplied to update ExpressRoutePort resource tags. -// options - ExpressRoutePortsClientUpdateTagsOptions contains the optional parameters for the ExpressRoutePortsClient.UpdateTags -// method. -func (client *ExpressRoutePortsClient) UpdateTags(ctx context.Context, resourceGroupName string, expressRoutePortName string, parameters TagsObject, options *ExpressRoutePortsClientUpdateTagsOptions) (ExpressRoutePortsClientUpdateTagsResponse, error) { - req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, expressRoutePortName, parameters, options) - if err != nil { - return ExpressRoutePortsClientUpdateTagsResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ExpressRoutePortsClientUpdateTagsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ExpressRoutePortsClientUpdateTagsResponse{}, runtime.NewResponseError(resp) - } - return client.updateTagsHandleResponse(resp) -} - -// updateTagsCreateRequest creates the UpdateTags request. -func (client *ExpressRoutePortsClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, expressRoutePortName string, parameters TagsObject, options *ExpressRoutePortsClientUpdateTagsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if expressRoutePortName == "" { - return nil, errors.New("parameter expressRoutePortName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{expressRoutePortName}", url.PathEscape(expressRoutePortName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// updateTagsHandleResponse handles the UpdateTags response. -func (client *ExpressRoutePortsClient) updateTagsHandleResponse(resp *http.Response) (ExpressRoutePortsClientUpdateTagsResponse, error) { - result := ExpressRoutePortsClientUpdateTagsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRoutePort); err != nil { - return ExpressRoutePortsClientUpdateTagsResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/expressrouteportslocations_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/expressrouteportslocations_client.go deleted file mode 100644 index 6310479c..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/expressrouteportslocations_client.go +++ /dev/null @@ -1,171 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// ExpressRoutePortsLocationsClient contains the methods for the ExpressRoutePortsLocations group. -// Don't use this type directly, use NewExpressRoutePortsLocationsClient() instead. -type ExpressRoutePortsLocationsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewExpressRoutePortsLocationsClient creates a new instance of ExpressRoutePortsLocationsClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewExpressRoutePortsLocationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ExpressRoutePortsLocationsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &ExpressRoutePortsLocationsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// Get - Retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at said -// peering location. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// locationName - Name of the requested ExpressRoutePort peering location. -// options - ExpressRoutePortsLocationsClientGetOptions contains the optional parameters for the ExpressRoutePortsLocationsClient.Get -// method. -func (client *ExpressRoutePortsLocationsClient) Get(ctx context.Context, locationName string, options *ExpressRoutePortsLocationsClientGetOptions) (ExpressRoutePortsLocationsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, locationName, options) - if err != nil { - return ExpressRoutePortsLocationsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ExpressRoutePortsLocationsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ExpressRoutePortsLocationsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *ExpressRoutePortsLocationsClient) getCreateRequest(ctx context.Context, locationName string, options *ExpressRoutePortsLocationsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/ExpressRoutePortsLocations/{locationName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if locationName == "" { - return nil, errors.New("parameter locationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{locationName}", url.PathEscape(locationName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *ExpressRoutePortsLocationsClient) getHandleResponse(resp *http.Response) (ExpressRoutePortsLocationsClientGetResponse, error) { - result := ExpressRoutePortsLocationsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRoutePortsLocation); err != nil { - return ExpressRoutePortsLocationsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. -// Available bandwidths can only be obtained when retrieving a specific peering location. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// options - ExpressRoutePortsLocationsClientListOptions contains the optional parameters for the ExpressRoutePortsLocationsClient.List -// method. -func (client *ExpressRoutePortsLocationsClient) NewListPager(options *ExpressRoutePortsLocationsClientListOptions) *runtime.Pager[ExpressRoutePortsLocationsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[ExpressRoutePortsLocationsClientListResponse]{ - More: func(page ExpressRoutePortsLocationsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ExpressRoutePortsLocationsClientListResponse) (ExpressRoutePortsLocationsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return ExpressRoutePortsLocationsClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ExpressRoutePortsLocationsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ExpressRoutePortsLocationsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *ExpressRoutePortsLocationsClient) listCreateRequest(ctx context.Context, options *ExpressRoutePortsLocationsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/ExpressRoutePortsLocations" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *ExpressRoutePortsLocationsClient) listHandleResponse(resp *http.Response) (ExpressRoutePortsLocationsClientListResponse, error) { - result := ExpressRoutePortsLocationsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRoutePortsLocationListResult); err != nil { - return ExpressRoutePortsLocationsClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/expressrouteproviderportslocation_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/expressrouteproviderportslocation_client.go deleted file mode 100644 index 2774ea08..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/expressrouteproviderportslocation_client.go +++ /dev/null @@ -1,107 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// ExpressRouteProviderPortsLocationClient contains the methods for the ExpressRouteProviderPortsLocation group. -// Don't use this type directly, use NewExpressRouteProviderPortsLocationClient() instead. -type ExpressRouteProviderPortsLocationClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewExpressRouteProviderPortsLocationClient creates a new instance of ExpressRouteProviderPortsLocationClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewExpressRouteProviderPortsLocationClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ExpressRouteProviderPortsLocationClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &ExpressRouteProviderPortsLocationClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// List - Retrieves all the ExpressRouteProviderPorts in a subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// options - ExpressRouteProviderPortsLocationClientListOptions contains the optional parameters for the ExpressRouteProviderPortsLocationClient.List -// method. -func (client *ExpressRouteProviderPortsLocationClient) List(ctx context.Context, options *ExpressRouteProviderPortsLocationClientListOptions) (ExpressRouteProviderPortsLocationClientListResponse, error) { - req, err := client.listCreateRequest(ctx, options) - if err != nil { - return ExpressRouteProviderPortsLocationClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ExpressRouteProviderPortsLocationClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ExpressRouteProviderPortsLocationClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) -} - -// listCreateRequest creates the List request. -func (client *ExpressRouteProviderPortsLocationClient) listCreateRequest(ctx context.Context, options *ExpressRouteProviderPortsLocationClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteProviderPorts" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - if options != nil && options.Filter != nil { - reqQP.Set("$filter", *options.Filter) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *ExpressRouteProviderPortsLocationClient) listHandleResponse(resp *http.Response) (ExpressRouteProviderPortsLocationClientListResponse, error) { - result := ExpressRouteProviderPortsLocationClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRouteProviderPortListResult); err != nil { - return ExpressRouteProviderPortsLocationClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/expressrouteserviceproviders_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/expressrouteserviceproviders_client.go deleted file mode 100644 index cc257630..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/expressrouteserviceproviders_client.go +++ /dev/null @@ -1,117 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// ExpressRouteServiceProvidersClient contains the methods for the ExpressRouteServiceProviders group. -// Don't use this type directly, use NewExpressRouteServiceProvidersClient() instead. -type ExpressRouteServiceProvidersClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewExpressRouteServiceProvidersClient creates a new instance of ExpressRouteServiceProvidersClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewExpressRouteServiceProvidersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ExpressRouteServiceProvidersClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &ExpressRouteServiceProvidersClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// NewListPager - Gets all the available express route service providers. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// options - ExpressRouteServiceProvidersClientListOptions contains the optional parameters for the ExpressRouteServiceProvidersClient.List -// method. -func (client *ExpressRouteServiceProvidersClient) NewListPager(options *ExpressRouteServiceProvidersClientListOptions) *runtime.Pager[ExpressRouteServiceProvidersClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[ExpressRouteServiceProvidersClientListResponse]{ - More: func(page ExpressRouteServiceProvidersClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ExpressRouteServiceProvidersClientListResponse) (ExpressRouteServiceProvidersClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return ExpressRouteServiceProvidersClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ExpressRouteServiceProvidersClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ExpressRouteServiceProvidersClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *ExpressRouteServiceProvidersClient) listCreateRequest(ctx context.Context, options *ExpressRouteServiceProvidersClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteServiceProviders" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *ExpressRouteServiceProvidersClient) listHandleResponse(resp *http.Response) (ExpressRouteServiceProvidersClientListResponse, error) { - result := ExpressRouteServiceProvidersClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRouteServiceProviderListResult); err != nil { - return ExpressRouteServiceProvidersClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/firewallpolicies_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/firewallpolicies_client.go deleted file mode 100644 index 6a7e0e81..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/firewallpolicies_client.go +++ /dev/null @@ -1,429 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// FirewallPoliciesClient contains the methods for the FirewallPolicies group. -// Don't use this type directly, use NewFirewallPoliciesClient() instead. -type FirewallPoliciesClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewFirewallPoliciesClient creates a new instance of FirewallPoliciesClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewFirewallPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*FirewallPoliciesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &FirewallPoliciesClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates the specified Firewall Policy. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// firewallPolicyName - The name of the Firewall Policy. -// parameters - Parameters supplied to the create or update Firewall Policy operation. -// options - FirewallPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the FirewallPoliciesClient.BeginCreateOrUpdate -// method. -func (client *FirewallPoliciesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, firewallPolicyName string, parameters FirewallPolicy, options *FirewallPoliciesClientBeginCreateOrUpdateOptions) (*runtime.Poller[FirewallPoliciesClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, firewallPolicyName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[FirewallPoliciesClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[FirewallPoliciesClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates or updates the specified Firewall Policy. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *FirewallPoliciesClient) createOrUpdate(ctx context.Context, resourceGroupName string, firewallPolicyName string, parameters FirewallPolicy, options *FirewallPoliciesClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, firewallPolicyName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *FirewallPoliciesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, firewallPolicyName string, parameters FirewallPolicy, options *FirewallPoliciesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if firewallPolicyName == "" { - return nil, errors.New("parameter firewallPolicyName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{firewallPolicyName}", url.PathEscape(firewallPolicyName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginDelete - Deletes the specified Firewall Policy. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// firewallPolicyName - The name of the Firewall Policy. -// options - FirewallPoliciesClientBeginDeleteOptions contains the optional parameters for the FirewallPoliciesClient.BeginDelete -// method. -func (client *FirewallPoliciesClient) BeginDelete(ctx context.Context, resourceGroupName string, firewallPolicyName string, options *FirewallPoliciesClientBeginDeleteOptions) (*runtime.Poller[FirewallPoliciesClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, firewallPolicyName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[FirewallPoliciesClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[FirewallPoliciesClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes the specified Firewall Policy. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *FirewallPoliciesClient) deleteOperation(ctx context.Context, resourceGroupName string, firewallPolicyName string, options *FirewallPoliciesClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, firewallPolicyName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *FirewallPoliciesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, firewallPolicyName string, options *FirewallPoliciesClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if firewallPolicyName == "" { - return nil, errors.New("parameter firewallPolicyName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{firewallPolicyName}", url.PathEscape(firewallPolicyName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets the specified Firewall Policy. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// firewallPolicyName - The name of the Firewall Policy. -// options - FirewallPoliciesClientGetOptions contains the optional parameters for the FirewallPoliciesClient.Get method. -func (client *FirewallPoliciesClient) Get(ctx context.Context, resourceGroupName string, firewallPolicyName string, options *FirewallPoliciesClientGetOptions) (FirewallPoliciesClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, firewallPolicyName, options) - if err != nil { - return FirewallPoliciesClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return FirewallPoliciesClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return FirewallPoliciesClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *FirewallPoliciesClient) getCreateRequest(ctx context.Context, resourceGroupName string, firewallPolicyName string, options *FirewallPoliciesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if firewallPolicyName == "" { - return nil, errors.New("parameter firewallPolicyName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{firewallPolicyName}", url.PathEscape(firewallPolicyName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *FirewallPoliciesClient) getHandleResponse(resp *http.Response) (FirewallPoliciesClientGetResponse, error) { - result := FirewallPoliciesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.FirewallPolicy); err != nil { - return FirewallPoliciesClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Lists all Firewall Policies in a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// options - FirewallPoliciesClientListOptions contains the optional parameters for the FirewallPoliciesClient.List method. -func (client *FirewallPoliciesClient) NewListPager(resourceGroupName string, options *FirewallPoliciesClientListOptions) *runtime.Pager[FirewallPoliciesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[FirewallPoliciesClientListResponse]{ - More: func(page FirewallPoliciesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *FirewallPoliciesClientListResponse) (FirewallPoliciesClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return FirewallPoliciesClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return FirewallPoliciesClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return FirewallPoliciesClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *FirewallPoliciesClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *FirewallPoliciesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *FirewallPoliciesClient) listHandleResponse(resp *http.Response) (FirewallPoliciesClientListResponse, error) { - result := FirewallPoliciesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.FirewallPolicyListResult); err != nil { - return FirewallPoliciesClientListResponse{}, err - } - return result, nil -} - -// NewListAllPager - Gets all the Firewall Policies in a subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// options - FirewallPoliciesClientListAllOptions contains the optional parameters for the FirewallPoliciesClient.ListAll -// method. -func (client *FirewallPoliciesClient) NewListAllPager(options *FirewallPoliciesClientListAllOptions) *runtime.Pager[FirewallPoliciesClientListAllResponse] { - return runtime.NewPager(runtime.PagingHandler[FirewallPoliciesClientListAllResponse]{ - More: func(page FirewallPoliciesClientListAllResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *FirewallPoliciesClientListAllResponse) (FirewallPoliciesClientListAllResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listAllCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return FirewallPoliciesClientListAllResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return FirewallPoliciesClientListAllResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return FirewallPoliciesClientListAllResponse{}, runtime.NewResponseError(resp) - } - return client.listAllHandleResponse(resp) - }, - }) -} - -// listAllCreateRequest creates the ListAll request. -func (client *FirewallPoliciesClient) listAllCreateRequest(ctx context.Context, options *FirewallPoliciesClientListAllOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/firewallPolicies" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listAllHandleResponse handles the ListAll response. -func (client *FirewallPoliciesClient) listAllHandleResponse(resp *http.Response) (FirewallPoliciesClientListAllResponse, error) { - result := FirewallPoliciesClientListAllResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.FirewallPolicyListResult); err != nil { - return FirewallPoliciesClientListAllResponse{}, err - } - return result, nil -} - -// UpdateTags - Updates tags of a Azure Firewall Policy resource. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// firewallPolicyName - The name of the Firewall Policy. -// parameters - Parameters supplied to update Azure Firewall Policy tags. -// options - FirewallPoliciesClientUpdateTagsOptions contains the optional parameters for the FirewallPoliciesClient.UpdateTags -// method. -func (client *FirewallPoliciesClient) UpdateTags(ctx context.Context, resourceGroupName string, firewallPolicyName string, parameters TagsObject, options *FirewallPoliciesClientUpdateTagsOptions) (FirewallPoliciesClientUpdateTagsResponse, error) { - req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, firewallPolicyName, parameters, options) - if err != nil { - return FirewallPoliciesClientUpdateTagsResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return FirewallPoliciesClientUpdateTagsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return FirewallPoliciesClientUpdateTagsResponse{}, runtime.NewResponseError(resp) - } - return client.updateTagsHandleResponse(resp) -} - -// updateTagsCreateRequest creates the UpdateTags request. -func (client *FirewallPoliciesClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, firewallPolicyName string, parameters TagsObject, options *FirewallPoliciesClientUpdateTagsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if firewallPolicyName == "" { - return nil, errors.New("parameter firewallPolicyName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{firewallPolicyName}", url.PathEscape(firewallPolicyName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// updateTagsHandleResponse handles the UpdateTags response. -func (client *FirewallPoliciesClient) updateTagsHandleResponse(resp *http.Response) (FirewallPoliciesClientUpdateTagsResponse, error) { - result := FirewallPoliciesClientUpdateTagsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.FirewallPolicy); err != nil { - return FirewallPoliciesClientUpdateTagsResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignatures_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignatures_client.go deleted file mode 100644 index 56901b4f..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignatures_client.go +++ /dev/null @@ -1,114 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// FirewallPolicyIdpsSignaturesClient contains the methods for the FirewallPolicyIdpsSignatures group. -// Don't use this type directly, use NewFirewallPolicyIdpsSignaturesClient() instead. -type FirewallPolicyIdpsSignaturesClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewFirewallPolicyIdpsSignaturesClient creates a new instance of FirewallPolicyIdpsSignaturesClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewFirewallPolicyIdpsSignaturesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*FirewallPolicyIdpsSignaturesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &FirewallPolicyIdpsSignaturesClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// List - Retrieves the current status of IDPS signatures for the relevant policy -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// firewallPolicyName - The name of the Firewall Policy. -// options - FirewallPolicyIdpsSignaturesClientListOptions contains the optional parameters for the FirewallPolicyIdpsSignaturesClient.List -// method. -func (client *FirewallPolicyIdpsSignaturesClient) List(ctx context.Context, resourceGroupName string, firewallPolicyName string, parameters IDPSQueryObject, options *FirewallPolicyIdpsSignaturesClientListOptions) (FirewallPolicyIdpsSignaturesClientListResponse, error) { - req, err := client.listCreateRequest(ctx, resourceGroupName, firewallPolicyName, parameters, options) - if err != nil { - return FirewallPolicyIdpsSignaturesClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return FirewallPolicyIdpsSignaturesClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return FirewallPolicyIdpsSignaturesClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) -} - -// listCreateRequest creates the List request. -func (client *FirewallPolicyIdpsSignaturesClient) listCreateRequest(ctx context.Context, resourceGroupName string, firewallPolicyName string, parameters IDPSQueryObject, options *FirewallPolicyIdpsSignaturesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/listIdpsSignatures" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if firewallPolicyName == "" { - return nil, errors.New("parameter firewallPolicyName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{firewallPolicyName}", url.PathEscape(firewallPolicyName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// listHandleResponse handles the List response. -func (client *FirewallPolicyIdpsSignaturesClient) listHandleResponse(resp *http.Response) (FirewallPolicyIdpsSignaturesClientListResponse, error) { - result := FirewallPolicyIdpsSignaturesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.QueryResults); err != nil { - return FirewallPolicyIdpsSignaturesClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignaturesfiltervalues_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignaturesfiltervalues_client.go deleted file mode 100644 index 23ea5dba..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignaturesfiltervalues_client.go +++ /dev/null @@ -1,114 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// FirewallPolicyIdpsSignaturesFilterValuesClient contains the methods for the FirewallPolicyIdpsSignaturesFilterValues group. -// Don't use this type directly, use NewFirewallPolicyIdpsSignaturesFilterValuesClient() instead. -type FirewallPolicyIdpsSignaturesFilterValuesClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewFirewallPolicyIdpsSignaturesFilterValuesClient creates a new instance of FirewallPolicyIdpsSignaturesFilterValuesClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewFirewallPolicyIdpsSignaturesFilterValuesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*FirewallPolicyIdpsSignaturesFilterValuesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &FirewallPolicyIdpsSignaturesFilterValuesClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// List - Retrieves the current filter values for the signatures overrides -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// firewallPolicyName - The name of the Firewall Policy. -// options - FirewallPolicyIdpsSignaturesFilterValuesClientListOptions contains the optional parameters for the FirewallPolicyIdpsSignaturesFilterValuesClient.List -// method. -func (client *FirewallPolicyIdpsSignaturesFilterValuesClient) List(ctx context.Context, resourceGroupName string, firewallPolicyName string, parameters SignatureOverridesFilterValuesQuery, options *FirewallPolicyIdpsSignaturesFilterValuesClientListOptions) (FirewallPolicyIdpsSignaturesFilterValuesClientListResponse, error) { - req, err := client.listCreateRequest(ctx, resourceGroupName, firewallPolicyName, parameters, options) - if err != nil { - return FirewallPolicyIdpsSignaturesFilterValuesClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return FirewallPolicyIdpsSignaturesFilterValuesClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return FirewallPolicyIdpsSignaturesFilterValuesClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) -} - -// listCreateRequest creates the List request. -func (client *FirewallPolicyIdpsSignaturesFilterValuesClient) listCreateRequest(ctx context.Context, resourceGroupName string, firewallPolicyName string, parameters SignatureOverridesFilterValuesQuery, options *FirewallPolicyIdpsSignaturesFilterValuesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/listIdpsFilterOptions" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if firewallPolicyName == "" { - return nil, errors.New("parameter firewallPolicyName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{firewallPolicyName}", url.PathEscape(firewallPolicyName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// listHandleResponse handles the List response. -func (client *FirewallPolicyIdpsSignaturesFilterValuesClient) listHandleResponse(resp *http.Response) (FirewallPolicyIdpsSignaturesFilterValuesClientListResponse, error) { - result := FirewallPolicyIdpsSignaturesFilterValuesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SignatureOverridesFilterValuesResponse); err != nil { - return FirewallPolicyIdpsSignaturesFilterValuesClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignaturesoverrides_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignaturesoverrides_client.go deleted file mode 100644 index 05fdd98d..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignaturesoverrides_client.go +++ /dev/null @@ -1,287 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// FirewallPolicyIdpsSignaturesOverridesClient contains the methods for the FirewallPolicyIdpsSignaturesOverrides group. -// Don't use this type directly, use NewFirewallPolicyIdpsSignaturesOverridesClient() instead. -type FirewallPolicyIdpsSignaturesOverridesClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewFirewallPolicyIdpsSignaturesOverridesClient creates a new instance of FirewallPolicyIdpsSignaturesOverridesClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewFirewallPolicyIdpsSignaturesOverridesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*FirewallPolicyIdpsSignaturesOverridesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &FirewallPolicyIdpsSignaturesOverridesClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// Get - Returns all signatures overrides for a specific policy. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// firewallPolicyName - The name of the Firewall Policy. -// options - FirewallPolicyIdpsSignaturesOverridesClientGetOptions contains the optional parameters for the FirewallPolicyIdpsSignaturesOverridesClient.Get -// method. -func (client *FirewallPolicyIdpsSignaturesOverridesClient) Get(ctx context.Context, resourceGroupName string, firewallPolicyName string, options *FirewallPolicyIdpsSignaturesOverridesClientGetOptions) (FirewallPolicyIdpsSignaturesOverridesClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, firewallPolicyName, options) - if err != nil { - return FirewallPolicyIdpsSignaturesOverridesClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return FirewallPolicyIdpsSignaturesOverridesClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return FirewallPolicyIdpsSignaturesOverridesClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *FirewallPolicyIdpsSignaturesOverridesClient) getCreateRequest(ctx context.Context, resourceGroupName string, firewallPolicyName string, options *FirewallPolicyIdpsSignaturesOverridesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/signatureOverrides/default" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if firewallPolicyName == "" { - return nil, errors.New("parameter firewallPolicyName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{firewallPolicyName}", url.PathEscape(firewallPolicyName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *FirewallPolicyIdpsSignaturesOverridesClient) getHandleResponse(resp *http.Response) (FirewallPolicyIdpsSignaturesOverridesClientGetResponse, error) { - result := FirewallPolicyIdpsSignaturesOverridesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SignaturesOverrides); err != nil { - return FirewallPolicyIdpsSignaturesOverridesClientGetResponse{}, err - } - return result, nil -} - -// List - Returns all signatures overrides objects for a specific policy as a list containing a single value. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// firewallPolicyName - The name of the Firewall Policy. -// options - FirewallPolicyIdpsSignaturesOverridesClientListOptions contains the optional parameters for the FirewallPolicyIdpsSignaturesOverridesClient.List -// method. -func (client *FirewallPolicyIdpsSignaturesOverridesClient) List(ctx context.Context, resourceGroupName string, firewallPolicyName string, options *FirewallPolicyIdpsSignaturesOverridesClientListOptions) (FirewallPolicyIdpsSignaturesOverridesClientListResponse, error) { - req, err := client.listCreateRequest(ctx, resourceGroupName, firewallPolicyName, options) - if err != nil { - return FirewallPolicyIdpsSignaturesOverridesClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return FirewallPolicyIdpsSignaturesOverridesClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return FirewallPolicyIdpsSignaturesOverridesClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) -} - -// listCreateRequest creates the List request. -func (client *FirewallPolicyIdpsSignaturesOverridesClient) listCreateRequest(ctx context.Context, resourceGroupName string, firewallPolicyName string, options *FirewallPolicyIdpsSignaturesOverridesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/signatureOverrides" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if firewallPolicyName == "" { - return nil, errors.New("parameter firewallPolicyName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{firewallPolicyName}", url.PathEscape(firewallPolicyName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *FirewallPolicyIdpsSignaturesOverridesClient) listHandleResponse(resp *http.Response) (FirewallPolicyIdpsSignaturesOverridesClientListResponse, error) { - result := FirewallPolicyIdpsSignaturesOverridesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SignaturesOverridesList); err != nil { - return FirewallPolicyIdpsSignaturesOverridesClientListResponse{}, err - } - return result, nil -} - -// Patch - Will update the status of policy's signature overrides for IDPS -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// firewallPolicyName - The name of the Firewall Policy. -// parameters - Will contain all properties of the object to put -// options - FirewallPolicyIdpsSignaturesOverridesClientPatchOptions contains the optional parameters for the FirewallPolicyIdpsSignaturesOverridesClient.Patch -// method. -func (client *FirewallPolicyIdpsSignaturesOverridesClient) Patch(ctx context.Context, resourceGroupName string, firewallPolicyName string, parameters SignaturesOverrides, options *FirewallPolicyIdpsSignaturesOverridesClientPatchOptions) (FirewallPolicyIdpsSignaturesOverridesClientPatchResponse, error) { - req, err := client.patchCreateRequest(ctx, resourceGroupName, firewallPolicyName, parameters, options) - if err != nil { - return FirewallPolicyIdpsSignaturesOverridesClientPatchResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return FirewallPolicyIdpsSignaturesOverridesClientPatchResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return FirewallPolicyIdpsSignaturesOverridesClientPatchResponse{}, runtime.NewResponseError(resp) - } - return client.patchHandleResponse(resp) -} - -// patchCreateRequest creates the Patch request. -func (client *FirewallPolicyIdpsSignaturesOverridesClient) patchCreateRequest(ctx context.Context, resourceGroupName string, firewallPolicyName string, parameters SignaturesOverrides, options *FirewallPolicyIdpsSignaturesOverridesClientPatchOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/signatureOverrides/default" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if firewallPolicyName == "" { - return nil, errors.New("parameter firewallPolicyName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{firewallPolicyName}", url.PathEscape(firewallPolicyName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// patchHandleResponse handles the Patch response. -func (client *FirewallPolicyIdpsSignaturesOverridesClient) patchHandleResponse(resp *http.Response) (FirewallPolicyIdpsSignaturesOverridesClientPatchResponse, error) { - result := FirewallPolicyIdpsSignaturesOverridesClientPatchResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SignaturesOverrides); err != nil { - return FirewallPolicyIdpsSignaturesOverridesClientPatchResponse{}, err - } - return result, nil -} - -// Put - Will override/create a new signature overrides for the policy's IDPS -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// firewallPolicyName - The name of the Firewall Policy. -// parameters - Will contain all properties of the object to put -// options - FirewallPolicyIdpsSignaturesOverridesClientPutOptions contains the optional parameters for the FirewallPolicyIdpsSignaturesOverridesClient.Put -// method. -func (client *FirewallPolicyIdpsSignaturesOverridesClient) Put(ctx context.Context, resourceGroupName string, firewallPolicyName string, parameters SignaturesOverrides, options *FirewallPolicyIdpsSignaturesOverridesClientPutOptions) (FirewallPolicyIdpsSignaturesOverridesClientPutResponse, error) { - req, err := client.putCreateRequest(ctx, resourceGroupName, firewallPolicyName, parameters, options) - if err != nil { - return FirewallPolicyIdpsSignaturesOverridesClientPutResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return FirewallPolicyIdpsSignaturesOverridesClientPutResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return FirewallPolicyIdpsSignaturesOverridesClientPutResponse{}, runtime.NewResponseError(resp) - } - return client.putHandleResponse(resp) -} - -// putCreateRequest creates the Put request. -func (client *FirewallPolicyIdpsSignaturesOverridesClient) putCreateRequest(ctx context.Context, resourceGroupName string, firewallPolicyName string, parameters SignaturesOverrides, options *FirewallPolicyIdpsSignaturesOverridesClientPutOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/signatureOverrides/default" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if firewallPolicyName == "" { - return nil, errors.New("parameter firewallPolicyName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{firewallPolicyName}", url.PathEscape(firewallPolicyName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// putHandleResponse handles the Put response. -func (client *FirewallPolicyIdpsSignaturesOverridesClient) putHandleResponse(resp *http.Response) (FirewallPolicyIdpsSignaturesOverridesClientPutResponse, error) { - result := FirewallPolicyIdpsSignaturesOverridesClientPutResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SignaturesOverrides); err != nil { - return FirewallPolicyIdpsSignaturesOverridesClientPutResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/firewallpolicyrulecollectiongroups_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/firewallpolicyrulecollectiongroups_client.go deleted file mode 100644 index f3cb915a..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/firewallpolicyrulecollectiongroups_client.go +++ /dev/null @@ -1,330 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// FirewallPolicyRuleCollectionGroupsClient contains the methods for the FirewallPolicyRuleCollectionGroups group. -// Don't use this type directly, use NewFirewallPolicyRuleCollectionGroupsClient() instead. -type FirewallPolicyRuleCollectionGroupsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewFirewallPolicyRuleCollectionGroupsClient creates a new instance of FirewallPolicyRuleCollectionGroupsClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewFirewallPolicyRuleCollectionGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*FirewallPolicyRuleCollectionGroupsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &FirewallPolicyRuleCollectionGroupsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates the specified FirewallPolicyRuleCollectionGroup. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// firewallPolicyName - The name of the Firewall Policy. -// ruleCollectionGroupName - The name of the FirewallPolicyRuleCollectionGroup. -// parameters - Parameters supplied to the create or update FirewallPolicyRuleCollectionGroup operation. -// options - FirewallPolicyRuleCollectionGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the FirewallPolicyRuleCollectionGroupsClient.BeginCreateOrUpdate -// method. -func (client *FirewallPolicyRuleCollectionGroupsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, firewallPolicyName string, ruleCollectionGroupName string, parameters FirewallPolicyRuleCollectionGroup, options *FirewallPolicyRuleCollectionGroupsClientBeginCreateOrUpdateOptions) (*runtime.Poller[FirewallPolicyRuleCollectionGroupsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, firewallPolicyName, ruleCollectionGroupName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[FirewallPolicyRuleCollectionGroupsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[FirewallPolicyRuleCollectionGroupsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates or updates the specified FirewallPolicyRuleCollectionGroup. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *FirewallPolicyRuleCollectionGroupsClient) createOrUpdate(ctx context.Context, resourceGroupName string, firewallPolicyName string, ruleCollectionGroupName string, parameters FirewallPolicyRuleCollectionGroup, options *FirewallPolicyRuleCollectionGroupsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, firewallPolicyName, ruleCollectionGroupName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *FirewallPolicyRuleCollectionGroupsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, firewallPolicyName string, ruleCollectionGroupName string, parameters FirewallPolicyRuleCollectionGroup, options *FirewallPolicyRuleCollectionGroupsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/ruleCollectionGroups/{ruleCollectionGroupName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if firewallPolicyName == "" { - return nil, errors.New("parameter firewallPolicyName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{firewallPolicyName}", url.PathEscape(firewallPolicyName)) - if ruleCollectionGroupName == "" { - return nil, errors.New("parameter ruleCollectionGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{ruleCollectionGroupName}", url.PathEscape(ruleCollectionGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginDelete - Deletes the specified FirewallPolicyRuleCollectionGroup. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// firewallPolicyName - The name of the Firewall Policy. -// ruleCollectionGroupName - The name of the FirewallPolicyRuleCollectionGroup. -// options - FirewallPolicyRuleCollectionGroupsClientBeginDeleteOptions contains the optional parameters for the FirewallPolicyRuleCollectionGroupsClient.BeginDelete -// method. -func (client *FirewallPolicyRuleCollectionGroupsClient) BeginDelete(ctx context.Context, resourceGroupName string, firewallPolicyName string, ruleCollectionGroupName string, options *FirewallPolicyRuleCollectionGroupsClientBeginDeleteOptions) (*runtime.Poller[FirewallPolicyRuleCollectionGroupsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, firewallPolicyName, ruleCollectionGroupName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[FirewallPolicyRuleCollectionGroupsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[FirewallPolicyRuleCollectionGroupsClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes the specified FirewallPolicyRuleCollectionGroup. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *FirewallPolicyRuleCollectionGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, firewallPolicyName string, ruleCollectionGroupName string, options *FirewallPolicyRuleCollectionGroupsClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, firewallPolicyName, ruleCollectionGroupName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *FirewallPolicyRuleCollectionGroupsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, firewallPolicyName string, ruleCollectionGroupName string, options *FirewallPolicyRuleCollectionGroupsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/ruleCollectionGroups/{ruleCollectionGroupName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if firewallPolicyName == "" { - return nil, errors.New("parameter firewallPolicyName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{firewallPolicyName}", url.PathEscape(firewallPolicyName)) - if ruleCollectionGroupName == "" { - return nil, errors.New("parameter ruleCollectionGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{ruleCollectionGroupName}", url.PathEscape(ruleCollectionGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets the specified FirewallPolicyRuleCollectionGroup. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// firewallPolicyName - The name of the Firewall Policy. -// ruleCollectionGroupName - The name of the FirewallPolicyRuleCollectionGroup. -// options - FirewallPolicyRuleCollectionGroupsClientGetOptions contains the optional parameters for the FirewallPolicyRuleCollectionGroupsClient.Get -// method. -func (client *FirewallPolicyRuleCollectionGroupsClient) Get(ctx context.Context, resourceGroupName string, firewallPolicyName string, ruleCollectionGroupName string, options *FirewallPolicyRuleCollectionGroupsClientGetOptions) (FirewallPolicyRuleCollectionGroupsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, firewallPolicyName, ruleCollectionGroupName, options) - if err != nil { - return FirewallPolicyRuleCollectionGroupsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return FirewallPolicyRuleCollectionGroupsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return FirewallPolicyRuleCollectionGroupsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *FirewallPolicyRuleCollectionGroupsClient) getCreateRequest(ctx context.Context, resourceGroupName string, firewallPolicyName string, ruleCollectionGroupName string, options *FirewallPolicyRuleCollectionGroupsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/ruleCollectionGroups/{ruleCollectionGroupName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if firewallPolicyName == "" { - return nil, errors.New("parameter firewallPolicyName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{firewallPolicyName}", url.PathEscape(firewallPolicyName)) - if ruleCollectionGroupName == "" { - return nil, errors.New("parameter ruleCollectionGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{ruleCollectionGroupName}", url.PathEscape(ruleCollectionGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *FirewallPolicyRuleCollectionGroupsClient) getHandleResponse(resp *http.Response) (FirewallPolicyRuleCollectionGroupsClientGetResponse, error) { - result := FirewallPolicyRuleCollectionGroupsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.FirewallPolicyRuleCollectionGroup); err != nil { - return FirewallPolicyRuleCollectionGroupsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Lists all FirewallPolicyRuleCollectionGroups in a FirewallPolicy resource. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// firewallPolicyName - The name of the Firewall Policy. -// options - FirewallPolicyRuleCollectionGroupsClientListOptions contains the optional parameters for the FirewallPolicyRuleCollectionGroupsClient.List -// method. -func (client *FirewallPolicyRuleCollectionGroupsClient) NewListPager(resourceGroupName string, firewallPolicyName string, options *FirewallPolicyRuleCollectionGroupsClientListOptions) *runtime.Pager[FirewallPolicyRuleCollectionGroupsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[FirewallPolicyRuleCollectionGroupsClientListResponse]{ - More: func(page FirewallPolicyRuleCollectionGroupsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *FirewallPolicyRuleCollectionGroupsClientListResponse) (FirewallPolicyRuleCollectionGroupsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, firewallPolicyName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return FirewallPolicyRuleCollectionGroupsClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return FirewallPolicyRuleCollectionGroupsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return FirewallPolicyRuleCollectionGroupsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *FirewallPolicyRuleCollectionGroupsClient) listCreateRequest(ctx context.Context, resourceGroupName string, firewallPolicyName string, options *FirewallPolicyRuleCollectionGroupsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/ruleCollectionGroups" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if firewallPolicyName == "" { - return nil, errors.New("parameter firewallPolicyName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{firewallPolicyName}", url.PathEscape(firewallPolicyName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *FirewallPolicyRuleCollectionGroupsClient) listHandleResponse(resp *http.Response) (FirewallPolicyRuleCollectionGroupsClientListResponse, error) { - result := FirewallPolicyRuleCollectionGroupsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.FirewallPolicyRuleCollectionGroupListResult); err != nil { - return FirewallPolicyRuleCollectionGroupsClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/flowlogs_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/flowlogs_client.go deleted file mode 100644 index 179cd512..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/flowlogs_client.go +++ /dev/null @@ -1,389 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// FlowLogsClient contains the methods for the FlowLogs group. -// Don't use this type directly, use NewFlowLogsClient() instead. -type FlowLogsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewFlowLogsClient creates a new instance of FlowLogsClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewFlowLogsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*FlowLogsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &FlowLogsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Create or update a flow log for the specified network security group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkWatcherName - The name of the network watcher. -// flowLogName - The name of the flow log. -// parameters - Parameters that define the create or update flow log resource. -// options - FlowLogsClientBeginCreateOrUpdateOptions contains the optional parameters for the FlowLogsClient.BeginCreateOrUpdate -// method. -func (client *FlowLogsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, networkWatcherName string, flowLogName string, parameters FlowLog, options *FlowLogsClientBeginCreateOrUpdateOptions) (*runtime.Poller[FlowLogsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, networkWatcherName, flowLogName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[FlowLogsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[FlowLogsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Create or update a flow log for the specified network security group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *FlowLogsClient) createOrUpdate(ctx context.Context, resourceGroupName string, networkWatcherName string, flowLogName string, parameters FlowLog, options *FlowLogsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, networkWatcherName, flowLogName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *FlowLogsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, flowLogName string, parameters FlowLog, options *FlowLogsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/flowLogs/{flowLogName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkWatcherName == "" { - return nil, errors.New("parameter networkWatcherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) - if flowLogName == "" { - return nil, errors.New("parameter flowLogName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{flowLogName}", url.PathEscape(flowLogName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginDelete - Deletes the specified flow log resource. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkWatcherName - The name of the network watcher. -// flowLogName - The name of the flow log resource. -// options - FlowLogsClientBeginDeleteOptions contains the optional parameters for the FlowLogsClient.BeginDelete method. -func (client *FlowLogsClient) BeginDelete(ctx context.Context, resourceGroupName string, networkWatcherName string, flowLogName string, options *FlowLogsClientBeginDeleteOptions) (*runtime.Poller[FlowLogsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, networkWatcherName, flowLogName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[FlowLogsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[FlowLogsClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes the specified flow log resource. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *FlowLogsClient) deleteOperation(ctx context.Context, resourceGroupName string, networkWatcherName string, flowLogName string, options *FlowLogsClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, networkWatcherName, flowLogName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *FlowLogsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, flowLogName string, options *FlowLogsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/flowLogs/{flowLogName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkWatcherName == "" { - return nil, errors.New("parameter networkWatcherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) - if flowLogName == "" { - return nil, errors.New("parameter flowLogName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{flowLogName}", url.PathEscape(flowLogName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets a flow log resource by name. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkWatcherName - The name of the network watcher. -// flowLogName - The name of the flow log resource. -// options - FlowLogsClientGetOptions contains the optional parameters for the FlowLogsClient.Get method. -func (client *FlowLogsClient) Get(ctx context.Context, resourceGroupName string, networkWatcherName string, flowLogName string, options *FlowLogsClientGetOptions) (FlowLogsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, networkWatcherName, flowLogName, options) - if err != nil { - return FlowLogsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return FlowLogsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return FlowLogsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *FlowLogsClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, flowLogName string, options *FlowLogsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/flowLogs/{flowLogName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkWatcherName == "" { - return nil, errors.New("parameter networkWatcherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) - if flowLogName == "" { - return nil, errors.New("parameter flowLogName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{flowLogName}", url.PathEscape(flowLogName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *FlowLogsClient) getHandleResponse(resp *http.Response) (FlowLogsClientGetResponse, error) { - result := FlowLogsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.FlowLog); err != nil { - return FlowLogsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Lists all flow log resources for the specified Network Watcher. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group containing Network Watcher. -// networkWatcherName - The name of the Network Watcher resource. -// options - FlowLogsClientListOptions contains the optional parameters for the FlowLogsClient.List method. -func (client *FlowLogsClient) NewListPager(resourceGroupName string, networkWatcherName string, options *FlowLogsClientListOptions) *runtime.Pager[FlowLogsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[FlowLogsClientListResponse]{ - More: func(page FlowLogsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *FlowLogsClientListResponse) (FlowLogsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, networkWatcherName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return FlowLogsClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return FlowLogsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return FlowLogsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *FlowLogsClient) listCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, options *FlowLogsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/flowLogs" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkWatcherName == "" { - return nil, errors.New("parameter networkWatcherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *FlowLogsClient) listHandleResponse(resp *http.Response) (FlowLogsClientListResponse, error) { - result := FlowLogsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.FlowLogListResult); err != nil { - return FlowLogsClientListResponse{}, err - } - return result, nil -} - -// UpdateTags - Update tags of the specified flow log. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkWatcherName - The name of the network watcher. -// flowLogName - The name of the flow log. -// parameters - Parameters supplied to update flow log tags. -// options - FlowLogsClientUpdateTagsOptions contains the optional parameters for the FlowLogsClient.UpdateTags method. -func (client *FlowLogsClient) UpdateTags(ctx context.Context, resourceGroupName string, networkWatcherName string, flowLogName string, parameters TagsObject, options *FlowLogsClientUpdateTagsOptions) (FlowLogsClientUpdateTagsResponse, error) { - req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, networkWatcherName, flowLogName, parameters, options) - if err != nil { - return FlowLogsClientUpdateTagsResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return FlowLogsClientUpdateTagsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return FlowLogsClientUpdateTagsResponse{}, runtime.NewResponseError(resp) - } - return client.updateTagsHandleResponse(resp) -} - -// updateTagsCreateRequest creates the UpdateTags request. -func (client *FlowLogsClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, flowLogName string, parameters TagsObject, options *FlowLogsClientUpdateTagsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/flowLogs/{flowLogName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkWatcherName == "" { - return nil, errors.New("parameter networkWatcherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) - if flowLogName == "" { - return nil, errors.New("parameter flowLogName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{flowLogName}", url.PathEscape(flowLogName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// updateTagsHandleResponse handles the UpdateTags response. -func (client *FlowLogsClient) updateTagsHandleResponse(resp *http.Response) (FlowLogsClientUpdateTagsResponse, error) { - result := FlowLogsClientUpdateTagsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.FlowLog); err != nil { - return FlowLogsClientUpdateTagsResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/groups_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/groups_client.go deleted file mode 100644 index 78f244a6..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/groups_client.go +++ /dev/null @@ -1,334 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strconv" - "strings" -) - -// GroupsClient contains the methods for the NetworkGroups group. -// Don't use this type directly, use NewGroupsClient() instead. -type GroupsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewGroupsClient creates a new instance of GroupsClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GroupsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &GroupsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// CreateOrUpdate - Creates or updates a network group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkManagerName - The name of the network manager. -// networkGroupName - The name of the network group. -// parameters - Parameters supplied to the specify which network group need to create -// options - GroupsClientCreateOrUpdateOptions contains the optional parameters for the GroupsClient.CreateOrUpdate method. -func (client *GroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, networkManagerName string, networkGroupName string, parameters Group, options *GroupsClientCreateOrUpdateOptions) (GroupsClientCreateOrUpdateResponse, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, networkManagerName, networkGroupName, parameters, options) - if err != nil { - return GroupsClientCreateOrUpdateResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return GroupsClientCreateOrUpdateResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return GroupsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) - } - return client.createOrUpdateHandleResponse(resp) -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *GroupsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, networkGroupName string, parameters Group, options *GroupsClientCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/networkGroups/{networkGroupName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkManagerName == "" { - return nil, errors.New("parameter networkManagerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) - if networkGroupName == "" { - return nil, errors.New("parameter networkGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkGroupName}", url.PathEscape(networkGroupName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - if options != nil && options.IfMatch != nil { - req.Raw().Header["If-Match"] = []string{*options.IfMatch} - } - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// createOrUpdateHandleResponse handles the CreateOrUpdate response. -func (client *GroupsClient) createOrUpdateHandleResponse(resp *http.Response) (GroupsClientCreateOrUpdateResponse, error) { - result := GroupsClientCreateOrUpdateResponse{} - if val := resp.Header.Get("ETag"); val != "" { - result.ETag = &val - } - if err := runtime.UnmarshalAsJSON(resp, &result.Group); err != nil { - return GroupsClientCreateOrUpdateResponse{}, err - } - return result, nil -} - -// BeginDelete - Deletes a network group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkManagerName - The name of the network manager. -// networkGroupName - The name of the network group. -// options - GroupsClientBeginDeleteOptions contains the optional parameters for the GroupsClient.BeginDelete method. -func (client *GroupsClient) BeginDelete(ctx context.Context, resourceGroupName string, networkManagerName string, networkGroupName string, options *GroupsClientBeginDeleteOptions) (*runtime.Poller[GroupsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, networkManagerName, networkGroupName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[GroupsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[GroupsClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes a network group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *GroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, networkManagerName string, networkGroupName string, options *GroupsClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, networkManagerName, networkGroupName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *GroupsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, networkGroupName string, options *GroupsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/networkGroups/{networkGroupName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkManagerName == "" { - return nil, errors.New("parameter networkManagerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) - if networkGroupName == "" { - return nil, errors.New("parameter networkGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkGroupName}", url.PathEscape(networkGroupName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - if options != nil && options.Force != nil { - reqQP.Set("force", strconv.FormatBool(*options.Force)) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets the specified network group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkManagerName - The name of the network manager. -// networkGroupName - The name of the network group. -// options - GroupsClientGetOptions contains the optional parameters for the GroupsClient.Get method. -func (client *GroupsClient) Get(ctx context.Context, resourceGroupName string, networkManagerName string, networkGroupName string, options *GroupsClientGetOptions) (GroupsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, networkManagerName, networkGroupName, options) - if err != nil { - return GroupsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return GroupsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return GroupsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *GroupsClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, networkGroupName string, options *GroupsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/networkGroups/{networkGroupName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkManagerName == "" { - return nil, errors.New("parameter networkManagerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) - if networkGroupName == "" { - return nil, errors.New("parameter networkGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkGroupName}", url.PathEscape(networkGroupName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *GroupsClient) getHandleResponse(resp *http.Response) (GroupsClientGetResponse, error) { - result := GroupsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.Group); err != nil { - return GroupsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Lists the specified network group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkManagerName - The name of the network manager. -// options - GroupsClientListOptions contains the optional parameters for the GroupsClient.List method. -func (client *GroupsClient) NewListPager(resourceGroupName string, networkManagerName string, options *GroupsClientListOptions) *runtime.Pager[GroupsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[GroupsClientListResponse]{ - More: func(page GroupsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *GroupsClientListResponse) (GroupsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, networkManagerName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return GroupsClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return GroupsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return GroupsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *GroupsClient) listCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, options *GroupsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/networkGroups" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkManagerName == "" { - return nil, errors.New("parameter networkManagerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - if options != nil && options.Top != nil { - reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) - } - if options != nil && options.SkipToken != nil { - reqQP.Set("$skipToken", *options.SkipToken) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *GroupsClient) listHandleResponse(resp *http.Response) (GroupsClientListResponse, error) { - result := GroupsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.GroupListResult); err != nil { - return GroupsClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/hubroutetables_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/hubroutetables_client.go deleted file mode 100644 index 9aac479e..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/hubroutetables_client.go +++ /dev/null @@ -1,328 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// HubRouteTablesClient contains the methods for the HubRouteTables group. -// Don't use this type directly, use NewHubRouteTablesClient() instead. -type HubRouteTablesClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewHubRouteTablesClient creates a new instance of HubRouteTablesClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewHubRouteTablesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*HubRouteTablesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &HubRouteTablesClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates a RouteTable resource if it doesn't exist else updates the existing RouteTable. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the VirtualHub. -// virtualHubName - The name of the VirtualHub. -// routeTableName - The name of the RouteTable. -// routeTableParameters - Parameters supplied to create or update RouteTable. -// options - HubRouteTablesClientBeginCreateOrUpdateOptions contains the optional parameters for the HubRouteTablesClient.BeginCreateOrUpdate -// method. -func (client *HubRouteTablesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string, routeTableParameters HubRouteTable, options *HubRouteTablesClientBeginCreateOrUpdateOptions) (*runtime.Poller[HubRouteTablesClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, virtualHubName, routeTableName, routeTableParameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[HubRouteTablesClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[HubRouteTablesClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates a RouteTable resource if it doesn't exist else updates the existing RouteTable. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *HubRouteTablesClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string, routeTableParameters HubRouteTable, options *HubRouteTablesClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, virtualHubName, routeTableName, routeTableParameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *HubRouteTablesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string, routeTableParameters HubRouteTable, options *HubRouteTablesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubRouteTables/{routeTableName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualHubName == "" { - return nil, errors.New("parameter virtualHubName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualHubName}", url.PathEscape(virtualHubName)) - if routeTableName == "" { - return nil, errors.New("parameter routeTableName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{routeTableName}", url.PathEscape(routeTableName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, routeTableParameters) -} - -// BeginDelete - Deletes a RouteTable. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the RouteTable. -// virtualHubName - The name of the VirtualHub. -// routeTableName - The name of the RouteTable. -// options - HubRouteTablesClientBeginDeleteOptions contains the optional parameters for the HubRouteTablesClient.BeginDelete -// method. -func (client *HubRouteTablesClient) BeginDelete(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string, options *HubRouteTablesClientBeginDeleteOptions) (*runtime.Poller[HubRouteTablesClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, virtualHubName, routeTableName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[HubRouteTablesClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[HubRouteTablesClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes a RouteTable. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *HubRouteTablesClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string, options *HubRouteTablesClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, virtualHubName, routeTableName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *HubRouteTablesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string, options *HubRouteTablesClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubRouteTables/{routeTableName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualHubName == "" { - return nil, errors.New("parameter virtualHubName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualHubName}", url.PathEscape(virtualHubName)) - if routeTableName == "" { - return nil, errors.New("parameter routeTableName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{routeTableName}", url.PathEscape(routeTableName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Retrieves the details of a RouteTable. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the VirtualHub. -// virtualHubName - The name of the VirtualHub. -// routeTableName - The name of the RouteTable. -// options - HubRouteTablesClientGetOptions contains the optional parameters for the HubRouteTablesClient.Get method. -func (client *HubRouteTablesClient) Get(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string, options *HubRouteTablesClientGetOptions) (HubRouteTablesClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, virtualHubName, routeTableName, options) - if err != nil { - return HubRouteTablesClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return HubRouteTablesClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return HubRouteTablesClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *HubRouteTablesClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string, options *HubRouteTablesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubRouteTables/{routeTableName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualHubName == "" { - return nil, errors.New("parameter virtualHubName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualHubName}", url.PathEscape(virtualHubName)) - if routeTableName == "" { - return nil, errors.New("parameter routeTableName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{routeTableName}", url.PathEscape(routeTableName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *HubRouteTablesClient) getHandleResponse(resp *http.Response) (HubRouteTablesClientGetResponse, error) { - result := HubRouteTablesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.HubRouteTable); err != nil { - return HubRouteTablesClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Retrieves the details of all RouteTables. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the VirtualHub. -// virtualHubName - The name of the VirtualHub. -// options - HubRouteTablesClientListOptions contains the optional parameters for the HubRouteTablesClient.List method. -func (client *HubRouteTablesClient) NewListPager(resourceGroupName string, virtualHubName string, options *HubRouteTablesClientListOptions) *runtime.Pager[HubRouteTablesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[HubRouteTablesClientListResponse]{ - More: func(page HubRouteTablesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *HubRouteTablesClientListResponse) (HubRouteTablesClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, virtualHubName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return HubRouteTablesClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return HubRouteTablesClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return HubRouteTablesClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *HubRouteTablesClient) listCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, options *HubRouteTablesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubRouteTables" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualHubName == "" { - return nil, errors.New("parameter virtualHubName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualHubName}", url.PathEscape(virtualHubName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *HubRouteTablesClient) listHandleResponse(resp *http.Response) (HubRouteTablesClientListResponse, error) { - result := HubRouteTablesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ListHubRouteTablesResult); err != nil { - return HubRouteTablesClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/hubvirtualnetworkconnections_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/hubvirtualnetworkconnections_client.go deleted file mode 100644 index 7a189455..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/hubvirtualnetworkconnections_client.go +++ /dev/null @@ -1,330 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// HubVirtualNetworkConnectionsClient contains the methods for the HubVirtualNetworkConnections group. -// Don't use this type directly, use NewHubVirtualNetworkConnectionsClient() instead. -type HubVirtualNetworkConnectionsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewHubVirtualNetworkConnectionsClient creates a new instance of HubVirtualNetworkConnectionsClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewHubVirtualNetworkConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*HubVirtualNetworkConnectionsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &HubVirtualNetworkConnectionsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates a hub virtual network connection if it doesn't exist else updates the existing one. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the HubVirtualNetworkConnection. -// virtualHubName - The name of the VirtualHub. -// connectionName - The name of the HubVirtualNetworkConnection. -// hubVirtualNetworkConnectionParameters - Parameters supplied to create or update a hub virtual network connection. -// options - HubVirtualNetworkConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the HubVirtualNetworkConnectionsClient.BeginCreateOrUpdate -// method. -func (client *HubVirtualNetworkConnectionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string, hubVirtualNetworkConnectionParameters HubVirtualNetworkConnection, options *HubVirtualNetworkConnectionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[HubVirtualNetworkConnectionsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, virtualHubName, connectionName, hubVirtualNetworkConnectionParameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[HubVirtualNetworkConnectionsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[HubVirtualNetworkConnectionsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates a hub virtual network connection if it doesn't exist else updates the existing one. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *HubVirtualNetworkConnectionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string, hubVirtualNetworkConnectionParameters HubVirtualNetworkConnection, options *HubVirtualNetworkConnectionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, virtualHubName, connectionName, hubVirtualNetworkConnectionParameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *HubVirtualNetworkConnectionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string, hubVirtualNetworkConnectionParameters HubVirtualNetworkConnection, options *HubVirtualNetworkConnectionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubVirtualNetworkConnections/{connectionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualHubName == "" { - return nil, errors.New("parameter virtualHubName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualHubName}", url.PathEscape(virtualHubName)) - if connectionName == "" { - return nil, errors.New("parameter connectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, hubVirtualNetworkConnectionParameters) -} - -// BeginDelete - Deletes a HubVirtualNetworkConnection. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the VirtualHub. -// virtualHubName - The name of the VirtualHub. -// connectionName - The name of the HubVirtualNetworkConnection. -// options - HubVirtualNetworkConnectionsClientBeginDeleteOptions contains the optional parameters for the HubVirtualNetworkConnectionsClient.BeginDelete -// method. -func (client *HubVirtualNetworkConnectionsClient) BeginDelete(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string, options *HubVirtualNetworkConnectionsClientBeginDeleteOptions) (*runtime.Poller[HubVirtualNetworkConnectionsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, virtualHubName, connectionName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[HubVirtualNetworkConnectionsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[HubVirtualNetworkConnectionsClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes a HubVirtualNetworkConnection. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *HubVirtualNetworkConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string, options *HubVirtualNetworkConnectionsClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, virtualHubName, connectionName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *HubVirtualNetworkConnectionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string, options *HubVirtualNetworkConnectionsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubVirtualNetworkConnections/{connectionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualHubName == "" { - return nil, errors.New("parameter virtualHubName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualHubName}", url.PathEscape(virtualHubName)) - if connectionName == "" { - return nil, errors.New("parameter connectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Retrieves the details of a HubVirtualNetworkConnection. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the VirtualHub. -// virtualHubName - The name of the VirtualHub. -// connectionName - The name of the vpn connection. -// options - HubVirtualNetworkConnectionsClientGetOptions contains the optional parameters for the HubVirtualNetworkConnectionsClient.Get -// method. -func (client *HubVirtualNetworkConnectionsClient) Get(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string, options *HubVirtualNetworkConnectionsClientGetOptions) (HubVirtualNetworkConnectionsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, virtualHubName, connectionName, options) - if err != nil { - return HubVirtualNetworkConnectionsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return HubVirtualNetworkConnectionsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return HubVirtualNetworkConnectionsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *HubVirtualNetworkConnectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string, options *HubVirtualNetworkConnectionsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubVirtualNetworkConnections/{connectionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualHubName == "" { - return nil, errors.New("parameter virtualHubName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualHubName}", url.PathEscape(virtualHubName)) - if connectionName == "" { - return nil, errors.New("parameter connectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *HubVirtualNetworkConnectionsClient) getHandleResponse(resp *http.Response) (HubVirtualNetworkConnectionsClientGetResponse, error) { - result := HubVirtualNetworkConnectionsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.HubVirtualNetworkConnection); err != nil { - return HubVirtualNetworkConnectionsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Retrieves the details of all HubVirtualNetworkConnections. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the VirtualHub. -// virtualHubName - The name of the VirtualHub. -// options - HubVirtualNetworkConnectionsClientListOptions contains the optional parameters for the HubVirtualNetworkConnectionsClient.List -// method. -func (client *HubVirtualNetworkConnectionsClient) NewListPager(resourceGroupName string, virtualHubName string, options *HubVirtualNetworkConnectionsClientListOptions) *runtime.Pager[HubVirtualNetworkConnectionsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[HubVirtualNetworkConnectionsClientListResponse]{ - More: func(page HubVirtualNetworkConnectionsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *HubVirtualNetworkConnectionsClientListResponse) (HubVirtualNetworkConnectionsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, virtualHubName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return HubVirtualNetworkConnectionsClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return HubVirtualNetworkConnectionsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return HubVirtualNetworkConnectionsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *HubVirtualNetworkConnectionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, options *HubVirtualNetworkConnectionsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubVirtualNetworkConnections" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualHubName == "" { - return nil, errors.New("parameter virtualHubName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualHubName}", url.PathEscape(virtualHubName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *HubVirtualNetworkConnectionsClient) listHandleResponse(resp *http.Response) (HubVirtualNetworkConnectionsClientListResponse, error) { - result := HubVirtualNetworkConnectionsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ListHubVirtualNetworkConnectionsResult); err != nil { - return HubVirtualNetworkConnectionsClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/inboundnatrules_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/inboundnatrules_client.go deleted file mode 100644 index 5a11d49c..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/inboundnatrules_client.go +++ /dev/null @@ -1,331 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// InboundNatRulesClient contains the methods for the InboundNatRules group. -// Don't use this type directly, use NewInboundNatRulesClient() instead. -type InboundNatRulesClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewInboundNatRulesClient creates a new instance of InboundNatRulesClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewInboundNatRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*InboundNatRulesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &InboundNatRulesClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates a load balancer inbound NAT rule. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// loadBalancerName - The name of the load balancer. -// inboundNatRuleName - The name of the inbound NAT rule. -// inboundNatRuleParameters - Parameters supplied to the create or update inbound NAT rule operation. -// options - InboundNatRulesClientBeginCreateOrUpdateOptions contains the optional parameters for the InboundNatRulesClient.BeginCreateOrUpdate -// method. -func (client *InboundNatRulesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, loadBalancerName string, inboundNatRuleName string, inboundNatRuleParameters InboundNatRule, options *InboundNatRulesClientBeginCreateOrUpdateOptions) (*runtime.Poller[InboundNatRulesClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[InboundNatRulesClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[InboundNatRulesClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates or updates a load balancer inbound NAT rule. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *InboundNatRulesClient) createOrUpdate(ctx context.Context, resourceGroupName string, loadBalancerName string, inboundNatRuleName string, inboundNatRuleParameters InboundNatRule, options *InboundNatRulesClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *InboundNatRulesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, inboundNatRuleName string, inboundNatRuleParameters InboundNatRule, options *InboundNatRulesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if loadBalancerName == "" { - return nil, errors.New("parameter loadBalancerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{loadBalancerName}", url.PathEscape(loadBalancerName)) - if inboundNatRuleName == "" { - return nil, errors.New("parameter inboundNatRuleName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{inboundNatRuleName}", url.PathEscape(inboundNatRuleName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, inboundNatRuleParameters) -} - -// BeginDelete - Deletes the specified load balancer inbound NAT rule. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// loadBalancerName - The name of the load balancer. -// inboundNatRuleName - The name of the inbound NAT rule. -// options - InboundNatRulesClientBeginDeleteOptions contains the optional parameters for the InboundNatRulesClient.BeginDelete -// method. -func (client *InboundNatRulesClient) BeginDelete(ctx context.Context, resourceGroupName string, loadBalancerName string, inboundNatRuleName string, options *InboundNatRulesClientBeginDeleteOptions) (*runtime.Poller[InboundNatRulesClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, loadBalancerName, inboundNatRuleName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[InboundNatRulesClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[InboundNatRulesClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes the specified load balancer inbound NAT rule. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *InboundNatRulesClient) deleteOperation(ctx context.Context, resourceGroupName string, loadBalancerName string, inboundNatRuleName string, options *InboundNatRulesClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, loadBalancerName, inboundNatRuleName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *InboundNatRulesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, inboundNatRuleName string, options *InboundNatRulesClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if loadBalancerName == "" { - return nil, errors.New("parameter loadBalancerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{loadBalancerName}", url.PathEscape(loadBalancerName)) - if inboundNatRuleName == "" { - return nil, errors.New("parameter inboundNatRuleName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{inboundNatRuleName}", url.PathEscape(inboundNatRuleName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets the specified load balancer inbound NAT rule. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// loadBalancerName - The name of the load balancer. -// inboundNatRuleName - The name of the inbound NAT rule. -// options - InboundNatRulesClientGetOptions contains the optional parameters for the InboundNatRulesClient.Get method. -func (client *InboundNatRulesClient) Get(ctx context.Context, resourceGroupName string, loadBalancerName string, inboundNatRuleName string, options *InboundNatRulesClientGetOptions) (InboundNatRulesClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, loadBalancerName, inboundNatRuleName, options) - if err != nil { - return InboundNatRulesClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return InboundNatRulesClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return InboundNatRulesClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *InboundNatRulesClient) getCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, inboundNatRuleName string, options *InboundNatRulesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if loadBalancerName == "" { - return nil, errors.New("parameter loadBalancerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{loadBalancerName}", url.PathEscape(loadBalancerName)) - if inboundNatRuleName == "" { - return nil, errors.New("parameter inboundNatRuleName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{inboundNatRuleName}", url.PathEscape(inboundNatRuleName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *InboundNatRulesClient) getHandleResponse(resp *http.Response) (InboundNatRulesClientGetResponse, error) { - result := InboundNatRulesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.InboundNatRule); err != nil { - return InboundNatRulesClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Gets all the inbound NAT rules in a load balancer. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// loadBalancerName - The name of the load balancer. -// options - InboundNatRulesClientListOptions contains the optional parameters for the InboundNatRulesClient.List method. -func (client *InboundNatRulesClient) NewListPager(resourceGroupName string, loadBalancerName string, options *InboundNatRulesClientListOptions) *runtime.Pager[InboundNatRulesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[InboundNatRulesClientListResponse]{ - More: func(page InboundNatRulesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *InboundNatRulesClientListResponse) (InboundNatRulesClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, loadBalancerName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return InboundNatRulesClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return InboundNatRulesClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return InboundNatRulesClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *InboundNatRulesClient) listCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, options *InboundNatRulesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if loadBalancerName == "" { - return nil, errors.New("parameter loadBalancerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{loadBalancerName}", url.PathEscape(loadBalancerName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *InboundNatRulesClient) listHandleResponse(resp *http.Response) (InboundNatRulesClientListResponse, error) { - result := InboundNatRulesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.InboundNatRuleListResult); err != nil { - return InboundNatRulesClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/inboundsecurityrule_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/inboundsecurityrule_client.go deleted file mode 100644 index b30ffbff..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/inboundsecurityrule_client.go +++ /dev/null @@ -1,128 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// InboundSecurityRuleClient contains the methods for the InboundSecurityRule group. -// Don't use this type directly, use NewInboundSecurityRuleClient() instead. -type InboundSecurityRuleClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewInboundSecurityRuleClient creates a new instance of InboundSecurityRuleClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewInboundSecurityRuleClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*InboundSecurityRuleClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &InboundSecurityRuleClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates the specified Network Virtual Appliance Inbound Security Rules. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkVirtualApplianceName - The name of the Network Virtual Appliance. -// ruleCollectionName - The name of security rule collection. -// parameters - Parameters supplied to the create or update Network Virtual Appliance Inbound Security Rules operation. -// options - InboundSecurityRuleClientBeginCreateOrUpdateOptions contains the optional parameters for the InboundSecurityRuleClient.BeginCreateOrUpdate -// method. -func (client *InboundSecurityRuleClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, ruleCollectionName string, parameters InboundSecurityRule, options *InboundSecurityRuleClientBeginCreateOrUpdateOptions) (*runtime.Poller[InboundSecurityRuleClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, networkVirtualApplianceName, ruleCollectionName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[InboundSecurityRuleClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[InboundSecurityRuleClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates or updates the specified Network Virtual Appliance Inbound Security Rules. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *InboundSecurityRuleClient) createOrUpdate(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, ruleCollectionName string, parameters InboundSecurityRule, options *InboundSecurityRuleClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, networkVirtualApplianceName, ruleCollectionName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *InboundSecurityRuleClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, ruleCollectionName string, parameters InboundSecurityRule, options *InboundSecurityRuleClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/inboundSecurityRules/{ruleCollectionName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkVirtualApplianceName == "" { - return nil, errors.New("parameter networkVirtualApplianceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkVirtualApplianceName}", url.PathEscape(networkVirtualApplianceName)) - if ruleCollectionName == "" { - return nil, errors.New("parameter ruleCollectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{ruleCollectionName}", url.PathEscape(ruleCollectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/interfaceipconfigurations_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/interfaceipconfigurations_client.go deleted file mode 100644 index 6f364b99..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/interfaceipconfigurations_client.go +++ /dev/null @@ -1,189 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// InterfaceIPConfigurationsClient contains the methods for the NetworkInterfaceIPConfigurations group. -// Don't use this type directly, use NewInterfaceIPConfigurationsClient() instead. -type InterfaceIPConfigurationsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewInterfaceIPConfigurationsClient creates a new instance of InterfaceIPConfigurationsClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewInterfaceIPConfigurationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*InterfaceIPConfigurationsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &InterfaceIPConfigurationsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// Get - Gets the specified network interface ip configuration. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkInterfaceName - The name of the network interface. -// ipConfigurationName - The name of the ip configuration name. -// options - InterfaceIPConfigurationsClientGetOptions contains the optional parameters for the InterfaceIPConfigurationsClient.Get -// method. -func (client *InterfaceIPConfigurationsClient) Get(ctx context.Context, resourceGroupName string, networkInterfaceName string, ipConfigurationName string, options *InterfaceIPConfigurationsClientGetOptions) (InterfaceIPConfigurationsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, networkInterfaceName, ipConfigurationName, options) - if err != nil { - return InterfaceIPConfigurationsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return InterfaceIPConfigurationsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return InterfaceIPConfigurationsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *InterfaceIPConfigurationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkInterfaceName string, ipConfigurationName string, options *InterfaceIPConfigurationsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/ipConfigurations/{ipConfigurationName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkInterfaceName == "" { - return nil, errors.New("parameter networkInterfaceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkInterfaceName}", url.PathEscape(networkInterfaceName)) - if ipConfigurationName == "" { - return nil, errors.New("parameter ipConfigurationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{ipConfigurationName}", url.PathEscape(ipConfigurationName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *InterfaceIPConfigurationsClient) getHandleResponse(resp *http.Response) (InterfaceIPConfigurationsClientGetResponse, error) { - result := InterfaceIPConfigurationsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.InterfaceIPConfiguration); err != nil { - return InterfaceIPConfigurationsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Get all ip configurations in a network interface. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkInterfaceName - The name of the network interface. -// options - InterfaceIPConfigurationsClientListOptions contains the optional parameters for the InterfaceIPConfigurationsClient.List -// method. -func (client *InterfaceIPConfigurationsClient) NewListPager(resourceGroupName string, networkInterfaceName string, options *InterfaceIPConfigurationsClientListOptions) *runtime.Pager[InterfaceIPConfigurationsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[InterfaceIPConfigurationsClientListResponse]{ - More: func(page InterfaceIPConfigurationsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *InterfaceIPConfigurationsClientListResponse) (InterfaceIPConfigurationsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, networkInterfaceName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return InterfaceIPConfigurationsClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return InterfaceIPConfigurationsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return InterfaceIPConfigurationsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *InterfaceIPConfigurationsClient) listCreateRequest(ctx context.Context, resourceGroupName string, networkInterfaceName string, options *InterfaceIPConfigurationsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/ipConfigurations" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkInterfaceName == "" { - return nil, errors.New("parameter networkInterfaceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkInterfaceName}", url.PathEscape(networkInterfaceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *InterfaceIPConfigurationsClient) listHandleResponse(resp *http.Response) (InterfaceIPConfigurationsClientListResponse, error) { - result := InterfaceIPConfigurationsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.InterfaceIPConfigurationListResult); err != nil { - return InterfaceIPConfigurationsClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/interfaceloadbalancers_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/interfaceloadbalancers_client.go deleted file mode 100644 index 25841beb..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/interfaceloadbalancers_client.go +++ /dev/null @@ -1,127 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// InterfaceLoadBalancersClient contains the methods for the NetworkInterfaceLoadBalancers group. -// Don't use this type directly, use NewInterfaceLoadBalancersClient() instead. -type InterfaceLoadBalancersClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewInterfaceLoadBalancersClient creates a new instance of InterfaceLoadBalancersClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewInterfaceLoadBalancersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*InterfaceLoadBalancersClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &InterfaceLoadBalancersClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// NewListPager - List all load balancers in a network interface. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkInterfaceName - The name of the network interface. -// options - InterfaceLoadBalancersClientListOptions contains the optional parameters for the InterfaceLoadBalancersClient.List -// method. -func (client *InterfaceLoadBalancersClient) NewListPager(resourceGroupName string, networkInterfaceName string, options *InterfaceLoadBalancersClientListOptions) *runtime.Pager[InterfaceLoadBalancersClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[InterfaceLoadBalancersClientListResponse]{ - More: func(page InterfaceLoadBalancersClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *InterfaceLoadBalancersClientListResponse) (InterfaceLoadBalancersClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, networkInterfaceName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return InterfaceLoadBalancersClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return InterfaceLoadBalancersClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return InterfaceLoadBalancersClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *InterfaceLoadBalancersClient) listCreateRequest(ctx context.Context, resourceGroupName string, networkInterfaceName string, options *InterfaceLoadBalancersClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/loadBalancers" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkInterfaceName == "" { - return nil, errors.New("parameter networkInterfaceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkInterfaceName}", url.PathEscape(networkInterfaceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *InterfaceLoadBalancersClient) listHandleResponse(resp *http.Response) (InterfaceLoadBalancersClientListResponse, error) { - result := InterfaceLoadBalancersClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.InterfaceLoadBalancerListResult); err != nil { - return InterfaceLoadBalancersClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/interfaces_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/interfaces_client.go deleted file mode 100644 index 2fcd6b5a..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/interfaces_client.go +++ /dev/null @@ -1,1148 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// InterfacesClient contains the methods for the NetworkInterfaces group. -// Don't use this type directly, use NewInterfacesClient() instead. -type InterfacesClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewInterfacesClient creates a new instance of InterfacesClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewInterfacesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*InterfacesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &InterfacesClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates a network interface. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkInterfaceName - The name of the network interface. -// parameters - Parameters supplied to the create or update network interface operation. -// options - InterfacesClientBeginCreateOrUpdateOptions contains the optional parameters for the InterfacesClient.BeginCreateOrUpdate -// method. -func (client *InterfacesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, networkInterfaceName string, parameters Interface, options *InterfacesClientBeginCreateOrUpdateOptions) (*runtime.Poller[InterfacesClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, networkInterfaceName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[InterfacesClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[InterfacesClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates or updates a network interface. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *InterfacesClient) createOrUpdate(ctx context.Context, resourceGroupName string, networkInterfaceName string, parameters Interface, options *InterfacesClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, networkInterfaceName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *InterfacesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkInterfaceName string, parameters Interface, options *InterfacesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkInterfaceName == "" { - return nil, errors.New("parameter networkInterfaceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkInterfaceName}", url.PathEscape(networkInterfaceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginDelete - Deletes the specified network interface. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkInterfaceName - The name of the network interface. -// options - InterfacesClientBeginDeleteOptions contains the optional parameters for the InterfacesClient.BeginDelete method. -func (client *InterfacesClient) BeginDelete(ctx context.Context, resourceGroupName string, networkInterfaceName string, options *InterfacesClientBeginDeleteOptions) (*runtime.Poller[InterfacesClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, networkInterfaceName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[InterfacesClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[InterfacesClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes the specified network interface. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *InterfacesClient) deleteOperation(ctx context.Context, resourceGroupName string, networkInterfaceName string, options *InterfacesClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, networkInterfaceName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *InterfacesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkInterfaceName string, options *InterfacesClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkInterfaceName == "" { - return nil, errors.New("parameter networkInterfaceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkInterfaceName}", url.PathEscape(networkInterfaceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets information about the specified network interface. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkInterfaceName - The name of the network interface. -// options - InterfacesClientGetOptions contains the optional parameters for the InterfacesClient.Get method. -func (client *InterfacesClient) Get(ctx context.Context, resourceGroupName string, networkInterfaceName string, options *InterfacesClientGetOptions) (InterfacesClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, networkInterfaceName, options) - if err != nil { - return InterfacesClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return InterfacesClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return InterfacesClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *InterfacesClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkInterfaceName string, options *InterfacesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkInterfaceName == "" { - return nil, errors.New("parameter networkInterfaceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkInterfaceName}", url.PathEscape(networkInterfaceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *InterfacesClient) getHandleResponse(resp *http.Response) (InterfacesClientGetResponse, error) { - result := InterfacesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.Interface); err != nil { - return InterfacesClientGetResponse{}, err - } - return result, nil -} - -// GetCloudServiceNetworkInterface - Get the specified network interface in a cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// cloudServiceName - The name of the cloud service. -// roleInstanceName - The name of role instance. -// networkInterfaceName - The name of the network interface. -// options - InterfacesClientGetCloudServiceNetworkInterfaceOptions contains the optional parameters for the InterfacesClient.GetCloudServiceNetworkInterface -// method. -func (client *InterfacesClient) GetCloudServiceNetworkInterface(ctx context.Context, resourceGroupName string, cloudServiceName string, roleInstanceName string, networkInterfaceName string, options *InterfacesClientGetCloudServiceNetworkInterfaceOptions) (InterfacesClientGetCloudServiceNetworkInterfaceResponse, error) { - req, err := client.getCloudServiceNetworkInterfaceCreateRequest(ctx, resourceGroupName, cloudServiceName, roleInstanceName, networkInterfaceName, options) - if err != nil { - return InterfacesClientGetCloudServiceNetworkInterfaceResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return InterfacesClientGetCloudServiceNetworkInterfaceResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return InterfacesClientGetCloudServiceNetworkInterfaceResponse{}, runtime.NewResponseError(resp) - } - return client.getCloudServiceNetworkInterfaceHandleResponse(resp) -} - -// getCloudServiceNetworkInterfaceCreateRequest creates the GetCloudServiceNetworkInterface request. -func (client *InterfacesClient) getCloudServiceNetworkInterfaceCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, roleInstanceName string, networkInterfaceName string, options *InterfacesClientGetCloudServiceNetworkInterfaceOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/networkInterfaces/{networkInterfaceName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if roleInstanceName == "" { - return nil, errors.New("parameter roleInstanceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{roleInstanceName}", url.PathEscape(roleInstanceName)) - if networkInterfaceName == "" { - return nil, errors.New("parameter networkInterfaceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkInterfaceName}", url.PathEscape(networkInterfaceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getCloudServiceNetworkInterfaceHandleResponse handles the GetCloudServiceNetworkInterface response. -func (client *InterfacesClient) getCloudServiceNetworkInterfaceHandleResponse(resp *http.Response) (InterfacesClientGetCloudServiceNetworkInterfaceResponse, error) { - result := InterfacesClientGetCloudServiceNetworkInterfaceResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.Interface); err != nil { - return InterfacesClientGetCloudServiceNetworkInterfaceResponse{}, err - } - return result, nil -} - -// BeginGetEffectiveRouteTable - Gets all route tables applied to a network interface. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkInterfaceName - The name of the network interface. -// options - InterfacesClientBeginGetEffectiveRouteTableOptions contains the optional parameters for the InterfacesClient.BeginGetEffectiveRouteTable -// method. -func (client *InterfacesClient) BeginGetEffectiveRouteTable(ctx context.Context, resourceGroupName string, networkInterfaceName string, options *InterfacesClientBeginGetEffectiveRouteTableOptions) (*runtime.Poller[InterfacesClientGetEffectiveRouteTableResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.getEffectiveRouteTable(ctx, resourceGroupName, networkInterfaceName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[InterfacesClientGetEffectiveRouteTableResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[InterfacesClientGetEffectiveRouteTableResponse](options.ResumeToken, client.pl, nil) - } -} - -// GetEffectiveRouteTable - Gets all route tables applied to a network interface. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *InterfacesClient) getEffectiveRouteTable(ctx context.Context, resourceGroupName string, networkInterfaceName string, options *InterfacesClientBeginGetEffectiveRouteTableOptions) (*http.Response, error) { - req, err := client.getEffectiveRouteTableCreateRequest(ctx, resourceGroupName, networkInterfaceName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// getEffectiveRouteTableCreateRequest creates the GetEffectiveRouteTable request. -func (client *InterfacesClient) getEffectiveRouteTableCreateRequest(ctx context.Context, resourceGroupName string, networkInterfaceName string, options *InterfacesClientBeginGetEffectiveRouteTableOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveRouteTable" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkInterfaceName == "" { - return nil, errors.New("parameter networkInterfaceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkInterfaceName}", url.PathEscape(networkInterfaceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// GetVirtualMachineScaleSetIPConfiguration - Get the specified network interface ip configuration in a virtual machine scale -// set. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-10-01 -// resourceGroupName - The name of the resource group. -// virtualMachineScaleSetName - The name of the virtual machine scale set. -// virtualmachineIndex - The virtual machine index. -// networkInterfaceName - The name of the network interface. -// ipConfigurationName - The name of the ip configuration. -// options - InterfacesClientGetVirtualMachineScaleSetIPConfigurationOptions contains the optional parameters for the InterfacesClient.GetVirtualMachineScaleSetIPConfiguration -// method. -func (client *InterfacesClient) GetVirtualMachineScaleSetIPConfiguration(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, ipConfigurationName string, options *InterfacesClientGetVirtualMachineScaleSetIPConfigurationOptions) (InterfacesClientGetVirtualMachineScaleSetIPConfigurationResponse, error) { - req, err := client.getVirtualMachineScaleSetIPConfigurationCreateRequest(ctx, resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, options) - if err != nil { - return InterfacesClientGetVirtualMachineScaleSetIPConfigurationResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return InterfacesClientGetVirtualMachineScaleSetIPConfigurationResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return InterfacesClientGetVirtualMachineScaleSetIPConfigurationResponse{}, runtime.NewResponseError(resp) - } - return client.getVirtualMachineScaleSetIPConfigurationHandleResponse(resp) -} - -// getVirtualMachineScaleSetIPConfigurationCreateRequest creates the GetVirtualMachineScaleSetIPConfiguration request. -func (client *InterfacesClient) getVirtualMachineScaleSetIPConfigurationCreateRequest(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, ipConfigurationName string, options *InterfacesClientGetVirtualMachineScaleSetIPConfigurationOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipConfigurations/{ipConfigurationName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualMachineScaleSetName == "" { - return nil, errors.New("parameter virtualMachineScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualMachineScaleSetName}", url.PathEscape(virtualMachineScaleSetName)) - if virtualmachineIndex == "" { - return nil, errors.New("parameter virtualmachineIndex cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualmachineIndex}", url.PathEscape(virtualmachineIndex)) - if networkInterfaceName == "" { - return nil, errors.New("parameter networkInterfaceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkInterfaceName}", url.PathEscape(networkInterfaceName)) - if ipConfigurationName == "" { - return nil, errors.New("parameter ipConfigurationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{ipConfigurationName}", url.PathEscape(ipConfigurationName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-10-01") - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getVirtualMachineScaleSetIPConfigurationHandleResponse handles the GetVirtualMachineScaleSetIPConfiguration response. -func (client *InterfacesClient) getVirtualMachineScaleSetIPConfigurationHandleResponse(resp *http.Response) (InterfacesClientGetVirtualMachineScaleSetIPConfigurationResponse, error) { - result := InterfacesClientGetVirtualMachineScaleSetIPConfigurationResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.InterfaceIPConfiguration); err != nil { - return InterfacesClientGetVirtualMachineScaleSetIPConfigurationResponse{}, err - } - return result, nil -} - -// GetVirtualMachineScaleSetNetworkInterface - Get the specified network interface in a virtual machine scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-10-01 -// resourceGroupName - The name of the resource group. -// virtualMachineScaleSetName - The name of the virtual machine scale set. -// virtualmachineIndex - The virtual machine index. -// networkInterfaceName - The name of the network interface. -// options - InterfacesClientGetVirtualMachineScaleSetNetworkInterfaceOptions contains the optional parameters for the InterfacesClient.GetVirtualMachineScaleSetNetworkInterface -// method. -func (client *InterfacesClient) GetVirtualMachineScaleSetNetworkInterface(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, options *InterfacesClientGetVirtualMachineScaleSetNetworkInterfaceOptions) (InterfacesClientGetVirtualMachineScaleSetNetworkInterfaceResponse, error) { - req, err := client.getVirtualMachineScaleSetNetworkInterfaceCreateRequest(ctx, resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, options) - if err != nil { - return InterfacesClientGetVirtualMachineScaleSetNetworkInterfaceResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return InterfacesClientGetVirtualMachineScaleSetNetworkInterfaceResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return InterfacesClientGetVirtualMachineScaleSetNetworkInterfaceResponse{}, runtime.NewResponseError(resp) - } - return client.getVirtualMachineScaleSetNetworkInterfaceHandleResponse(resp) -} - -// getVirtualMachineScaleSetNetworkInterfaceCreateRequest creates the GetVirtualMachineScaleSetNetworkInterface request. -func (client *InterfacesClient) getVirtualMachineScaleSetNetworkInterfaceCreateRequest(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, options *InterfacesClientGetVirtualMachineScaleSetNetworkInterfaceOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualMachineScaleSetName == "" { - return nil, errors.New("parameter virtualMachineScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualMachineScaleSetName}", url.PathEscape(virtualMachineScaleSetName)) - if virtualmachineIndex == "" { - return nil, errors.New("parameter virtualmachineIndex cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualmachineIndex}", url.PathEscape(virtualmachineIndex)) - if networkInterfaceName == "" { - return nil, errors.New("parameter networkInterfaceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkInterfaceName}", url.PathEscape(networkInterfaceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-10-01") - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getVirtualMachineScaleSetNetworkInterfaceHandleResponse handles the GetVirtualMachineScaleSetNetworkInterface response. -func (client *InterfacesClient) getVirtualMachineScaleSetNetworkInterfaceHandleResponse(resp *http.Response) (InterfacesClientGetVirtualMachineScaleSetNetworkInterfaceResponse, error) { - result := InterfacesClientGetVirtualMachineScaleSetNetworkInterfaceResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.Interface); err != nil { - return InterfacesClientGetVirtualMachineScaleSetNetworkInterfaceResponse{}, err - } - return result, nil -} - -// NewListPager - Gets all network interfaces in a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// options - InterfacesClientListOptions contains the optional parameters for the InterfacesClient.List method. -func (client *InterfacesClient) NewListPager(resourceGroupName string, options *InterfacesClientListOptions) *runtime.Pager[InterfacesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[InterfacesClientListResponse]{ - More: func(page InterfacesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *InterfacesClientListResponse) (InterfacesClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return InterfacesClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return InterfacesClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return InterfacesClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *InterfacesClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *InterfacesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *InterfacesClient) listHandleResponse(resp *http.Response) (InterfacesClientListResponse, error) { - result := InterfacesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.InterfaceListResult); err != nil { - return InterfacesClientListResponse{}, err - } - return result, nil -} - -// NewListAllPager - Gets all network interfaces in a subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// options - InterfacesClientListAllOptions contains the optional parameters for the InterfacesClient.ListAll method. -func (client *InterfacesClient) NewListAllPager(options *InterfacesClientListAllOptions) *runtime.Pager[InterfacesClientListAllResponse] { - return runtime.NewPager(runtime.PagingHandler[InterfacesClientListAllResponse]{ - More: func(page InterfacesClientListAllResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *InterfacesClientListAllResponse) (InterfacesClientListAllResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listAllCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return InterfacesClientListAllResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return InterfacesClientListAllResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return InterfacesClientListAllResponse{}, runtime.NewResponseError(resp) - } - return client.listAllHandleResponse(resp) - }, - }) -} - -// listAllCreateRequest creates the ListAll request. -func (client *InterfacesClient) listAllCreateRequest(ctx context.Context, options *InterfacesClientListAllOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkInterfaces" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listAllHandleResponse handles the ListAll response. -func (client *InterfacesClient) listAllHandleResponse(resp *http.Response) (InterfacesClientListAllResponse, error) { - result := InterfacesClientListAllResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.InterfaceListResult); err != nil { - return InterfacesClientListAllResponse{}, err - } - return result, nil -} - -// NewListCloudServiceNetworkInterfacesPager - Gets all network interfaces in a cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// cloudServiceName - The name of the cloud service. -// options - InterfacesClientListCloudServiceNetworkInterfacesOptions contains the optional parameters for the InterfacesClient.ListCloudServiceNetworkInterfaces -// method. -func (client *InterfacesClient) NewListCloudServiceNetworkInterfacesPager(resourceGroupName string, cloudServiceName string, options *InterfacesClientListCloudServiceNetworkInterfacesOptions) *runtime.Pager[InterfacesClientListCloudServiceNetworkInterfacesResponse] { - return runtime.NewPager(runtime.PagingHandler[InterfacesClientListCloudServiceNetworkInterfacesResponse]{ - More: func(page InterfacesClientListCloudServiceNetworkInterfacesResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *InterfacesClientListCloudServiceNetworkInterfacesResponse) (InterfacesClientListCloudServiceNetworkInterfacesResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCloudServiceNetworkInterfacesCreateRequest(ctx, resourceGroupName, cloudServiceName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return InterfacesClientListCloudServiceNetworkInterfacesResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return InterfacesClientListCloudServiceNetworkInterfacesResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return InterfacesClientListCloudServiceNetworkInterfacesResponse{}, runtime.NewResponseError(resp) - } - return client.listCloudServiceNetworkInterfacesHandleResponse(resp) - }, - }) -} - -// listCloudServiceNetworkInterfacesCreateRequest creates the ListCloudServiceNetworkInterfaces request. -func (client *InterfacesClient) listCloudServiceNetworkInterfacesCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, options *InterfacesClientListCloudServiceNetworkInterfacesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/networkInterfaces" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listCloudServiceNetworkInterfacesHandleResponse handles the ListCloudServiceNetworkInterfaces response. -func (client *InterfacesClient) listCloudServiceNetworkInterfacesHandleResponse(resp *http.Response) (InterfacesClientListCloudServiceNetworkInterfacesResponse, error) { - result := InterfacesClientListCloudServiceNetworkInterfacesResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.InterfaceListResult); err != nil { - return InterfacesClientListCloudServiceNetworkInterfacesResponse{}, err - } - return result, nil -} - -// NewListCloudServiceRoleInstanceNetworkInterfacesPager - Gets information about all network interfaces in a role instance -// in a cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// cloudServiceName - The name of the cloud service. -// roleInstanceName - The name of role instance. -// options - InterfacesClientListCloudServiceRoleInstanceNetworkInterfacesOptions contains the optional parameters for the -// InterfacesClient.ListCloudServiceRoleInstanceNetworkInterfaces method. -func (client *InterfacesClient) NewListCloudServiceRoleInstanceNetworkInterfacesPager(resourceGroupName string, cloudServiceName string, roleInstanceName string, options *InterfacesClientListCloudServiceRoleInstanceNetworkInterfacesOptions) *runtime.Pager[InterfacesClientListCloudServiceRoleInstanceNetworkInterfacesResponse] { - return runtime.NewPager(runtime.PagingHandler[InterfacesClientListCloudServiceRoleInstanceNetworkInterfacesResponse]{ - More: func(page InterfacesClientListCloudServiceRoleInstanceNetworkInterfacesResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *InterfacesClientListCloudServiceRoleInstanceNetworkInterfacesResponse) (InterfacesClientListCloudServiceRoleInstanceNetworkInterfacesResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCloudServiceRoleInstanceNetworkInterfacesCreateRequest(ctx, resourceGroupName, cloudServiceName, roleInstanceName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return InterfacesClientListCloudServiceRoleInstanceNetworkInterfacesResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return InterfacesClientListCloudServiceRoleInstanceNetworkInterfacesResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return InterfacesClientListCloudServiceRoleInstanceNetworkInterfacesResponse{}, runtime.NewResponseError(resp) - } - return client.listCloudServiceRoleInstanceNetworkInterfacesHandleResponse(resp) - }, - }) -} - -// listCloudServiceRoleInstanceNetworkInterfacesCreateRequest creates the ListCloudServiceRoleInstanceNetworkInterfaces request. -func (client *InterfacesClient) listCloudServiceRoleInstanceNetworkInterfacesCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, roleInstanceName string, options *InterfacesClientListCloudServiceRoleInstanceNetworkInterfacesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/networkInterfaces" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if roleInstanceName == "" { - return nil, errors.New("parameter roleInstanceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{roleInstanceName}", url.PathEscape(roleInstanceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listCloudServiceRoleInstanceNetworkInterfacesHandleResponse handles the ListCloudServiceRoleInstanceNetworkInterfaces response. -func (client *InterfacesClient) listCloudServiceRoleInstanceNetworkInterfacesHandleResponse(resp *http.Response) (InterfacesClientListCloudServiceRoleInstanceNetworkInterfacesResponse, error) { - result := InterfacesClientListCloudServiceRoleInstanceNetworkInterfacesResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.InterfaceListResult); err != nil { - return InterfacesClientListCloudServiceRoleInstanceNetworkInterfacesResponse{}, err - } - return result, nil -} - -// BeginListEffectiveNetworkSecurityGroups - Gets all network security groups applied to a network interface. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkInterfaceName - The name of the network interface. -// options - InterfacesClientBeginListEffectiveNetworkSecurityGroupsOptions contains the optional parameters for the InterfacesClient.BeginListEffectiveNetworkSecurityGroups -// method. -func (client *InterfacesClient) BeginListEffectiveNetworkSecurityGroups(ctx context.Context, resourceGroupName string, networkInterfaceName string, options *InterfacesClientBeginListEffectiveNetworkSecurityGroupsOptions) (*runtime.Poller[InterfacesClientListEffectiveNetworkSecurityGroupsResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.listEffectiveNetworkSecurityGroups(ctx, resourceGroupName, networkInterfaceName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[InterfacesClientListEffectiveNetworkSecurityGroupsResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[InterfacesClientListEffectiveNetworkSecurityGroupsResponse](options.ResumeToken, client.pl, nil) - } -} - -// ListEffectiveNetworkSecurityGroups - Gets all network security groups applied to a network interface. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *InterfacesClient) listEffectiveNetworkSecurityGroups(ctx context.Context, resourceGroupName string, networkInterfaceName string, options *InterfacesClientBeginListEffectiveNetworkSecurityGroupsOptions) (*http.Response, error) { - req, err := client.listEffectiveNetworkSecurityGroupsCreateRequest(ctx, resourceGroupName, networkInterfaceName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// listEffectiveNetworkSecurityGroupsCreateRequest creates the ListEffectiveNetworkSecurityGroups request. -func (client *InterfacesClient) listEffectiveNetworkSecurityGroupsCreateRequest(ctx context.Context, resourceGroupName string, networkInterfaceName string, options *InterfacesClientBeginListEffectiveNetworkSecurityGroupsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveNetworkSecurityGroups" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkInterfaceName == "" { - return nil, errors.New("parameter networkInterfaceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkInterfaceName}", url.PathEscape(networkInterfaceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// NewListVirtualMachineScaleSetIPConfigurationsPager - Get the specified network interface ip configuration in a virtual -// machine scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-10-01 -// resourceGroupName - The name of the resource group. -// virtualMachineScaleSetName - The name of the virtual machine scale set. -// virtualmachineIndex - The virtual machine index. -// networkInterfaceName - The name of the network interface. -// options - InterfacesClientListVirtualMachineScaleSetIPConfigurationsOptions contains the optional parameters for the InterfacesClient.ListVirtualMachineScaleSetIPConfigurations -// method. -func (client *InterfacesClient) NewListVirtualMachineScaleSetIPConfigurationsPager(resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, options *InterfacesClientListVirtualMachineScaleSetIPConfigurationsOptions) *runtime.Pager[InterfacesClientListVirtualMachineScaleSetIPConfigurationsResponse] { - return runtime.NewPager(runtime.PagingHandler[InterfacesClientListVirtualMachineScaleSetIPConfigurationsResponse]{ - More: func(page InterfacesClientListVirtualMachineScaleSetIPConfigurationsResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *InterfacesClientListVirtualMachineScaleSetIPConfigurationsResponse) (InterfacesClientListVirtualMachineScaleSetIPConfigurationsResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listVirtualMachineScaleSetIPConfigurationsCreateRequest(ctx, resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return InterfacesClientListVirtualMachineScaleSetIPConfigurationsResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return InterfacesClientListVirtualMachineScaleSetIPConfigurationsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return InterfacesClientListVirtualMachineScaleSetIPConfigurationsResponse{}, runtime.NewResponseError(resp) - } - return client.listVirtualMachineScaleSetIPConfigurationsHandleResponse(resp) - }, - }) -} - -// listVirtualMachineScaleSetIPConfigurationsCreateRequest creates the ListVirtualMachineScaleSetIPConfigurations request. -func (client *InterfacesClient) listVirtualMachineScaleSetIPConfigurationsCreateRequest(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, options *InterfacesClientListVirtualMachineScaleSetIPConfigurationsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipConfigurations" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualMachineScaleSetName == "" { - return nil, errors.New("parameter virtualMachineScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualMachineScaleSetName}", url.PathEscape(virtualMachineScaleSetName)) - if virtualmachineIndex == "" { - return nil, errors.New("parameter virtualmachineIndex cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualmachineIndex}", url.PathEscape(virtualmachineIndex)) - if networkInterfaceName == "" { - return nil, errors.New("parameter networkInterfaceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkInterfaceName}", url.PathEscape(networkInterfaceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-10-01") - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listVirtualMachineScaleSetIPConfigurationsHandleResponse handles the ListVirtualMachineScaleSetIPConfigurations response. -func (client *InterfacesClient) listVirtualMachineScaleSetIPConfigurationsHandleResponse(resp *http.Response) (InterfacesClientListVirtualMachineScaleSetIPConfigurationsResponse, error) { - result := InterfacesClientListVirtualMachineScaleSetIPConfigurationsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.InterfaceIPConfigurationListResult); err != nil { - return InterfacesClientListVirtualMachineScaleSetIPConfigurationsResponse{}, err - } - return result, nil -} - -// NewListVirtualMachineScaleSetNetworkInterfacesPager - Gets all network interfaces in a virtual machine scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-10-01 -// resourceGroupName - The name of the resource group. -// virtualMachineScaleSetName - The name of the virtual machine scale set. -// options - InterfacesClientListVirtualMachineScaleSetNetworkInterfacesOptions contains the optional parameters for the InterfacesClient.ListVirtualMachineScaleSetNetworkInterfaces -// method. -func (client *InterfacesClient) NewListVirtualMachineScaleSetNetworkInterfacesPager(resourceGroupName string, virtualMachineScaleSetName string, options *InterfacesClientListVirtualMachineScaleSetNetworkInterfacesOptions) *runtime.Pager[InterfacesClientListVirtualMachineScaleSetNetworkInterfacesResponse] { - return runtime.NewPager(runtime.PagingHandler[InterfacesClientListVirtualMachineScaleSetNetworkInterfacesResponse]{ - More: func(page InterfacesClientListVirtualMachineScaleSetNetworkInterfacesResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *InterfacesClientListVirtualMachineScaleSetNetworkInterfacesResponse) (InterfacesClientListVirtualMachineScaleSetNetworkInterfacesResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listVirtualMachineScaleSetNetworkInterfacesCreateRequest(ctx, resourceGroupName, virtualMachineScaleSetName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return InterfacesClientListVirtualMachineScaleSetNetworkInterfacesResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return InterfacesClientListVirtualMachineScaleSetNetworkInterfacesResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return InterfacesClientListVirtualMachineScaleSetNetworkInterfacesResponse{}, runtime.NewResponseError(resp) - } - return client.listVirtualMachineScaleSetNetworkInterfacesHandleResponse(resp) - }, - }) -} - -// listVirtualMachineScaleSetNetworkInterfacesCreateRequest creates the ListVirtualMachineScaleSetNetworkInterfaces request. -func (client *InterfacesClient) listVirtualMachineScaleSetNetworkInterfacesCreateRequest(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, options *InterfacesClientListVirtualMachineScaleSetNetworkInterfacesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/networkInterfaces" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualMachineScaleSetName == "" { - return nil, errors.New("parameter virtualMachineScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualMachineScaleSetName}", url.PathEscape(virtualMachineScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-10-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listVirtualMachineScaleSetNetworkInterfacesHandleResponse handles the ListVirtualMachineScaleSetNetworkInterfaces response. -func (client *InterfacesClient) listVirtualMachineScaleSetNetworkInterfacesHandleResponse(resp *http.Response) (InterfacesClientListVirtualMachineScaleSetNetworkInterfacesResponse, error) { - result := InterfacesClientListVirtualMachineScaleSetNetworkInterfacesResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.InterfaceListResult); err != nil { - return InterfacesClientListVirtualMachineScaleSetNetworkInterfacesResponse{}, err - } - return result, nil -} - -// NewListVirtualMachineScaleSetVMNetworkInterfacesPager - Gets information about all network interfaces in a virtual machine -// in a virtual machine scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-10-01 -// resourceGroupName - The name of the resource group. -// virtualMachineScaleSetName - The name of the virtual machine scale set. -// virtualmachineIndex - The virtual machine index. -// options - InterfacesClientListVirtualMachineScaleSetVMNetworkInterfacesOptions contains the optional parameters for the -// InterfacesClient.ListVirtualMachineScaleSetVMNetworkInterfaces method. -func (client *InterfacesClient) NewListVirtualMachineScaleSetVMNetworkInterfacesPager(resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, options *InterfacesClientListVirtualMachineScaleSetVMNetworkInterfacesOptions) *runtime.Pager[InterfacesClientListVirtualMachineScaleSetVMNetworkInterfacesResponse] { - return runtime.NewPager(runtime.PagingHandler[InterfacesClientListVirtualMachineScaleSetVMNetworkInterfacesResponse]{ - More: func(page InterfacesClientListVirtualMachineScaleSetVMNetworkInterfacesResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *InterfacesClientListVirtualMachineScaleSetVMNetworkInterfacesResponse) (InterfacesClientListVirtualMachineScaleSetVMNetworkInterfacesResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listVirtualMachineScaleSetVMNetworkInterfacesCreateRequest(ctx, resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return InterfacesClientListVirtualMachineScaleSetVMNetworkInterfacesResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return InterfacesClientListVirtualMachineScaleSetVMNetworkInterfacesResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return InterfacesClientListVirtualMachineScaleSetVMNetworkInterfacesResponse{}, runtime.NewResponseError(resp) - } - return client.listVirtualMachineScaleSetVMNetworkInterfacesHandleResponse(resp) - }, - }) -} - -// listVirtualMachineScaleSetVMNetworkInterfacesCreateRequest creates the ListVirtualMachineScaleSetVMNetworkInterfaces request. -func (client *InterfacesClient) listVirtualMachineScaleSetVMNetworkInterfacesCreateRequest(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, options *InterfacesClientListVirtualMachineScaleSetVMNetworkInterfacesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualMachineScaleSetName == "" { - return nil, errors.New("parameter virtualMachineScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualMachineScaleSetName}", url.PathEscape(virtualMachineScaleSetName)) - if virtualmachineIndex == "" { - return nil, errors.New("parameter virtualmachineIndex cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualmachineIndex}", url.PathEscape(virtualmachineIndex)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-10-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listVirtualMachineScaleSetVMNetworkInterfacesHandleResponse handles the ListVirtualMachineScaleSetVMNetworkInterfaces response. -func (client *InterfacesClient) listVirtualMachineScaleSetVMNetworkInterfacesHandleResponse(resp *http.Response) (InterfacesClientListVirtualMachineScaleSetVMNetworkInterfacesResponse, error) { - result := InterfacesClientListVirtualMachineScaleSetVMNetworkInterfacesResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.InterfaceListResult); err != nil { - return InterfacesClientListVirtualMachineScaleSetVMNetworkInterfacesResponse{}, err - } - return result, nil -} - -// UpdateTags - Updates a network interface tags. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkInterfaceName - The name of the network interface. -// parameters - Parameters supplied to update network interface tags. -// options - InterfacesClientUpdateTagsOptions contains the optional parameters for the InterfacesClient.UpdateTags method. -func (client *InterfacesClient) UpdateTags(ctx context.Context, resourceGroupName string, networkInterfaceName string, parameters TagsObject, options *InterfacesClientUpdateTagsOptions) (InterfacesClientUpdateTagsResponse, error) { - req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, networkInterfaceName, parameters, options) - if err != nil { - return InterfacesClientUpdateTagsResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return InterfacesClientUpdateTagsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return InterfacesClientUpdateTagsResponse{}, runtime.NewResponseError(resp) - } - return client.updateTagsHandleResponse(resp) -} - -// updateTagsCreateRequest creates the UpdateTags request. -func (client *InterfacesClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, networkInterfaceName string, parameters TagsObject, options *InterfacesClientUpdateTagsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkInterfaceName == "" { - return nil, errors.New("parameter networkInterfaceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkInterfaceName}", url.PathEscape(networkInterfaceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// updateTagsHandleResponse handles the UpdateTags response. -func (client *InterfacesClient) updateTagsHandleResponse(resp *http.Response) (InterfacesClientUpdateTagsResponse, error) { - result := InterfacesClientUpdateTagsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.Interface); err != nil { - return InterfacesClientUpdateTagsResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/interfacetapconfigurations_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/interfacetapconfigurations_client.go deleted file mode 100644 index 7a271e47..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/interfacetapconfigurations_client.go +++ /dev/null @@ -1,330 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// InterfaceTapConfigurationsClient contains the methods for the NetworkInterfaceTapConfigurations group. -// Don't use this type directly, use NewInterfaceTapConfigurationsClient() instead. -type InterfaceTapConfigurationsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewInterfaceTapConfigurationsClient creates a new instance of InterfaceTapConfigurationsClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewInterfaceTapConfigurationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*InterfaceTapConfigurationsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &InterfaceTapConfigurationsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates a Tap configuration in the specified NetworkInterface. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkInterfaceName - The name of the network interface. -// tapConfigurationName - The name of the tap configuration. -// tapConfigurationParameters - Parameters supplied to the create or update tap configuration operation. -// options - InterfaceTapConfigurationsClientBeginCreateOrUpdateOptions contains the optional parameters for the InterfaceTapConfigurationsClient.BeginCreateOrUpdate -// method. -func (client *InterfaceTapConfigurationsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, networkInterfaceName string, tapConfigurationName string, tapConfigurationParameters InterfaceTapConfiguration, options *InterfaceTapConfigurationsClientBeginCreateOrUpdateOptions) (*runtime.Poller[InterfaceTapConfigurationsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, networkInterfaceName, tapConfigurationName, tapConfigurationParameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[InterfaceTapConfigurationsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[InterfaceTapConfigurationsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates or updates a Tap configuration in the specified NetworkInterface. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *InterfaceTapConfigurationsClient) createOrUpdate(ctx context.Context, resourceGroupName string, networkInterfaceName string, tapConfigurationName string, tapConfigurationParameters InterfaceTapConfiguration, options *InterfaceTapConfigurationsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, networkInterfaceName, tapConfigurationName, tapConfigurationParameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *InterfaceTapConfigurationsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkInterfaceName string, tapConfigurationName string, tapConfigurationParameters InterfaceTapConfiguration, options *InterfaceTapConfigurationsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/tapConfigurations/{tapConfigurationName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkInterfaceName == "" { - return nil, errors.New("parameter networkInterfaceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkInterfaceName}", url.PathEscape(networkInterfaceName)) - if tapConfigurationName == "" { - return nil, errors.New("parameter tapConfigurationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{tapConfigurationName}", url.PathEscape(tapConfigurationName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, tapConfigurationParameters) -} - -// BeginDelete - Deletes the specified tap configuration from the NetworkInterface. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkInterfaceName - The name of the network interface. -// tapConfigurationName - The name of the tap configuration. -// options - InterfaceTapConfigurationsClientBeginDeleteOptions contains the optional parameters for the InterfaceTapConfigurationsClient.BeginDelete -// method. -func (client *InterfaceTapConfigurationsClient) BeginDelete(ctx context.Context, resourceGroupName string, networkInterfaceName string, tapConfigurationName string, options *InterfaceTapConfigurationsClientBeginDeleteOptions) (*runtime.Poller[InterfaceTapConfigurationsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, networkInterfaceName, tapConfigurationName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[InterfaceTapConfigurationsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[InterfaceTapConfigurationsClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes the specified tap configuration from the NetworkInterface. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *InterfaceTapConfigurationsClient) deleteOperation(ctx context.Context, resourceGroupName string, networkInterfaceName string, tapConfigurationName string, options *InterfaceTapConfigurationsClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, networkInterfaceName, tapConfigurationName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *InterfaceTapConfigurationsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkInterfaceName string, tapConfigurationName string, options *InterfaceTapConfigurationsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/tapConfigurations/{tapConfigurationName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkInterfaceName == "" { - return nil, errors.New("parameter networkInterfaceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkInterfaceName}", url.PathEscape(networkInterfaceName)) - if tapConfigurationName == "" { - return nil, errors.New("parameter tapConfigurationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{tapConfigurationName}", url.PathEscape(tapConfigurationName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Get the specified tap configuration on a network interface. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkInterfaceName - The name of the network interface. -// tapConfigurationName - The name of the tap configuration. -// options - InterfaceTapConfigurationsClientGetOptions contains the optional parameters for the InterfaceTapConfigurationsClient.Get -// method. -func (client *InterfaceTapConfigurationsClient) Get(ctx context.Context, resourceGroupName string, networkInterfaceName string, tapConfigurationName string, options *InterfaceTapConfigurationsClientGetOptions) (InterfaceTapConfigurationsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, networkInterfaceName, tapConfigurationName, options) - if err != nil { - return InterfaceTapConfigurationsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return InterfaceTapConfigurationsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return InterfaceTapConfigurationsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *InterfaceTapConfigurationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkInterfaceName string, tapConfigurationName string, options *InterfaceTapConfigurationsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/tapConfigurations/{tapConfigurationName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkInterfaceName == "" { - return nil, errors.New("parameter networkInterfaceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkInterfaceName}", url.PathEscape(networkInterfaceName)) - if tapConfigurationName == "" { - return nil, errors.New("parameter tapConfigurationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{tapConfigurationName}", url.PathEscape(tapConfigurationName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *InterfaceTapConfigurationsClient) getHandleResponse(resp *http.Response) (InterfaceTapConfigurationsClientGetResponse, error) { - result := InterfaceTapConfigurationsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.InterfaceTapConfiguration); err != nil { - return InterfaceTapConfigurationsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Get all Tap configurations in a network interface. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkInterfaceName - The name of the network interface. -// options - InterfaceTapConfigurationsClientListOptions contains the optional parameters for the InterfaceTapConfigurationsClient.List -// method. -func (client *InterfaceTapConfigurationsClient) NewListPager(resourceGroupName string, networkInterfaceName string, options *InterfaceTapConfigurationsClientListOptions) *runtime.Pager[InterfaceTapConfigurationsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[InterfaceTapConfigurationsClientListResponse]{ - More: func(page InterfaceTapConfigurationsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *InterfaceTapConfigurationsClientListResponse) (InterfaceTapConfigurationsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, networkInterfaceName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return InterfaceTapConfigurationsClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return InterfaceTapConfigurationsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return InterfaceTapConfigurationsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *InterfaceTapConfigurationsClient) listCreateRequest(ctx context.Context, resourceGroupName string, networkInterfaceName string, options *InterfaceTapConfigurationsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/tapConfigurations" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkInterfaceName == "" { - return nil, errors.New("parameter networkInterfaceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkInterfaceName}", url.PathEscape(networkInterfaceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *InterfaceTapConfigurationsClient) listHandleResponse(resp *http.Response) (InterfaceTapConfigurationsClientListResponse, error) { - result := InterfaceTapConfigurationsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.InterfaceTapConfigurationListResult); err != nil { - return InterfaceTapConfigurationsClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/ipallocations_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/ipallocations_client.go deleted file mode 100644 index bd4657c0..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/ipallocations_client.go +++ /dev/null @@ -1,429 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// IPAllocationsClient contains the methods for the IPAllocations group. -// Don't use this type directly, use NewIPAllocationsClient() instead. -type IPAllocationsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewIPAllocationsClient creates a new instance of IPAllocationsClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewIPAllocationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*IPAllocationsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &IPAllocationsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates an IpAllocation in the specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// ipAllocationName - The name of the IpAllocation. -// parameters - Parameters supplied to the create or update virtual network operation. -// options - IPAllocationsClientBeginCreateOrUpdateOptions contains the optional parameters for the IPAllocationsClient.BeginCreateOrUpdate -// method. -func (client *IPAllocationsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, ipAllocationName string, parameters IPAllocation, options *IPAllocationsClientBeginCreateOrUpdateOptions) (*runtime.Poller[IPAllocationsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, ipAllocationName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[IPAllocationsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[IPAllocationsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates or updates an IpAllocation in the specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *IPAllocationsClient) createOrUpdate(ctx context.Context, resourceGroupName string, ipAllocationName string, parameters IPAllocation, options *IPAllocationsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, ipAllocationName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *IPAllocationsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, ipAllocationName string, parameters IPAllocation, options *IPAllocationsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/IpAllocations/{ipAllocationName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if ipAllocationName == "" { - return nil, errors.New("parameter ipAllocationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{ipAllocationName}", url.PathEscape(ipAllocationName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginDelete - Deletes the specified IpAllocation. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// ipAllocationName - The name of the IpAllocation. -// options - IPAllocationsClientBeginDeleteOptions contains the optional parameters for the IPAllocationsClient.BeginDelete -// method. -func (client *IPAllocationsClient) BeginDelete(ctx context.Context, resourceGroupName string, ipAllocationName string, options *IPAllocationsClientBeginDeleteOptions) (*runtime.Poller[IPAllocationsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, ipAllocationName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[IPAllocationsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[IPAllocationsClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes the specified IpAllocation. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *IPAllocationsClient) deleteOperation(ctx context.Context, resourceGroupName string, ipAllocationName string, options *IPAllocationsClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, ipAllocationName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *IPAllocationsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, ipAllocationName string, options *IPAllocationsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/IpAllocations/{ipAllocationName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if ipAllocationName == "" { - return nil, errors.New("parameter ipAllocationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{ipAllocationName}", url.PathEscape(ipAllocationName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets the specified IpAllocation by resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// ipAllocationName - The name of the IpAllocation. -// options - IPAllocationsClientGetOptions contains the optional parameters for the IPAllocationsClient.Get method. -func (client *IPAllocationsClient) Get(ctx context.Context, resourceGroupName string, ipAllocationName string, options *IPAllocationsClientGetOptions) (IPAllocationsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, ipAllocationName, options) - if err != nil { - return IPAllocationsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return IPAllocationsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return IPAllocationsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *IPAllocationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, ipAllocationName string, options *IPAllocationsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/IpAllocations/{ipAllocationName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if ipAllocationName == "" { - return nil, errors.New("parameter ipAllocationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{ipAllocationName}", url.PathEscape(ipAllocationName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *IPAllocationsClient) getHandleResponse(resp *http.Response) (IPAllocationsClientGetResponse, error) { - result := IPAllocationsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.IPAllocation); err != nil { - return IPAllocationsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Gets all IpAllocations in a subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// options - IPAllocationsClientListOptions contains the optional parameters for the IPAllocationsClient.List method. -func (client *IPAllocationsClient) NewListPager(options *IPAllocationsClientListOptions) *runtime.Pager[IPAllocationsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[IPAllocationsClientListResponse]{ - More: func(page IPAllocationsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *IPAllocationsClientListResponse) (IPAllocationsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return IPAllocationsClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return IPAllocationsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return IPAllocationsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *IPAllocationsClient) listCreateRequest(ctx context.Context, options *IPAllocationsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/IpAllocations" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *IPAllocationsClient) listHandleResponse(resp *http.Response) (IPAllocationsClientListResponse, error) { - result := IPAllocationsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.IPAllocationListResult); err != nil { - return IPAllocationsClientListResponse{}, err - } - return result, nil -} - -// NewListByResourceGroupPager - Gets all IpAllocations in a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// options - IPAllocationsClientListByResourceGroupOptions contains the optional parameters for the IPAllocationsClient.ListByResourceGroup -// method. -func (client *IPAllocationsClient) NewListByResourceGroupPager(resourceGroupName string, options *IPAllocationsClientListByResourceGroupOptions) *runtime.Pager[IPAllocationsClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[IPAllocationsClientListByResourceGroupResponse]{ - More: func(page IPAllocationsClientListByResourceGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *IPAllocationsClientListByResourceGroupResponse) (IPAllocationsClientListByResourceGroupResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return IPAllocationsClientListByResourceGroupResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return IPAllocationsClientListByResourceGroupResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return IPAllocationsClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) - } - return client.listByResourceGroupHandleResponse(resp) - }, - }) -} - -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *IPAllocationsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *IPAllocationsClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/IpAllocations" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *IPAllocationsClient) listByResourceGroupHandleResponse(resp *http.Response) (IPAllocationsClientListByResourceGroupResponse, error) { - result := IPAllocationsClientListByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.IPAllocationListResult); err != nil { - return IPAllocationsClientListByResourceGroupResponse{}, err - } - return result, nil -} - -// UpdateTags - Updates a IpAllocation tags. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// ipAllocationName - The name of the IpAllocation. -// parameters - Parameters supplied to update IpAllocation tags. -// options - IPAllocationsClientUpdateTagsOptions contains the optional parameters for the IPAllocationsClient.UpdateTags -// method. -func (client *IPAllocationsClient) UpdateTags(ctx context.Context, resourceGroupName string, ipAllocationName string, parameters TagsObject, options *IPAllocationsClientUpdateTagsOptions) (IPAllocationsClientUpdateTagsResponse, error) { - req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, ipAllocationName, parameters, options) - if err != nil { - return IPAllocationsClientUpdateTagsResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return IPAllocationsClientUpdateTagsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return IPAllocationsClientUpdateTagsResponse{}, runtime.NewResponseError(resp) - } - return client.updateTagsHandleResponse(resp) -} - -// updateTagsCreateRequest creates the UpdateTags request. -func (client *IPAllocationsClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, ipAllocationName string, parameters TagsObject, options *IPAllocationsClientUpdateTagsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/IpAllocations/{ipAllocationName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if ipAllocationName == "" { - return nil, errors.New("parameter ipAllocationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{ipAllocationName}", url.PathEscape(ipAllocationName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// updateTagsHandleResponse handles the UpdateTags response. -func (client *IPAllocationsClient) updateTagsHandleResponse(resp *http.Response) (IPAllocationsClientUpdateTagsResponse, error) { - result := IPAllocationsClientUpdateTagsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.IPAllocation); err != nil { - return IPAllocationsClientUpdateTagsResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/ipgroups_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/ipgroups_client.go deleted file mode 100644 index 611fe436..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/ipgroups_client.go +++ /dev/null @@ -1,427 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// IPGroupsClient contains the methods for the IPGroups group. -// Don't use this type directly, use NewIPGroupsClient() instead. -type IPGroupsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewIPGroupsClient creates a new instance of IPGroupsClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewIPGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*IPGroupsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &IPGroupsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates an ipGroups in a specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// ipGroupsName - The name of the ipGroups. -// parameters - Parameters supplied to the create or update IpGroups operation. -// options - IPGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the IPGroupsClient.BeginCreateOrUpdate -// method. -func (client *IPGroupsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, ipGroupsName string, parameters IPGroup, options *IPGroupsClientBeginCreateOrUpdateOptions) (*runtime.Poller[IPGroupsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, ipGroupsName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[IPGroupsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[IPGroupsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates or updates an ipGroups in a specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *IPGroupsClient) createOrUpdate(ctx context.Context, resourceGroupName string, ipGroupsName string, parameters IPGroup, options *IPGroupsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, ipGroupsName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *IPGroupsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, ipGroupsName string, parameters IPGroup, options *IPGroupsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ipGroups/{ipGroupsName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if ipGroupsName == "" { - return nil, errors.New("parameter ipGroupsName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{ipGroupsName}", url.PathEscape(ipGroupsName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginDelete - Deletes the specified ipGroups. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// ipGroupsName - The name of the ipGroups. -// options - IPGroupsClientBeginDeleteOptions contains the optional parameters for the IPGroupsClient.BeginDelete method. -func (client *IPGroupsClient) BeginDelete(ctx context.Context, resourceGroupName string, ipGroupsName string, options *IPGroupsClientBeginDeleteOptions) (*runtime.Poller[IPGroupsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, ipGroupsName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[IPGroupsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[IPGroupsClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes the specified ipGroups. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *IPGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, ipGroupsName string, options *IPGroupsClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, ipGroupsName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *IPGroupsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, ipGroupsName string, options *IPGroupsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ipGroups/{ipGroupsName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if ipGroupsName == "" { - return nil, errors.New("parameter ipGroupsName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{ipGroupsName}", url.PathEscape(ipGroupsName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets the specified ipGroups. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// ipGroupsName - The name of the ipGroups. -// options - IPGroupsClientGetOptions contains the optional parameters for the IPGroupsClient.Get method. -func (client *IPGroupsClient) Get(ctx context.Context, resourceGroupName string, ipGroupsName string, options *IPGroupsClientGetOptions) (IPGroupsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, ipGroupsName, options) - if err != nil { - return IPGroupsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return IPGroupsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return IPGroupsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *IPGroupsClient) getCreateRequest(ctx context.Context, resourceGroupName string, ipGroupsName string, options *IPGroupsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ipGroups/{ipGroupsName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if ipGroupsName == "" { - return nil, errors.New("parameter ipGroupsName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{ipGroupsName}", url.PathEscape(ipGroupsName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *IPGroupsClient) getHandleResponse(resp *http.Response) (IPGroupsClientGetResponse, error) { - result := IPGroupsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.IPGroup); err != nil { - return IPGroupsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Gets all IpGroups in a subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// options - IPGroupsClientListOptions contains the optional parameters for the IPGroupsClient.List method. -func (client *IPGroupsClient) NewListPager(options *IPGroupsClientListOptions) *runtime.Pager[IPGroupsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[IPGroupsClientListResponse]{ - More: func(page IPGroupsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *IPGroupsClientListResponse) (IPGroupsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return IPGroupsClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return IPGroupsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return IPGroupsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *IPGroupsClient) listCreateRequest(ctx context.Context, options *IPGroupsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/ipGroups" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *IPGroupsClient) listHandleResponse(resp *http.Response) (IPGroupsClientListResponse, error) { - result := IPGroupsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.IPGroupListResult); err != nil { - return IPGroupsClientListResponse{}, err - } - return result, nil -} - -// NewListByResourceGroupPager - Gets all IpGroups in a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// options - IPGroupsClientListByResourceGroupOptions contains the optional parameters for the IPGroupsClient.ListByResourceGroup -// method. -func (client *IPGroupsClient) NewListByResourceGroupPager(resourceGroupName string, options *IPGroupsClientListByResourceGroupOptions) *runtime.Pager[IPGroupsClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[IPGroupsClientListByResourceGroupResponse]{ - More: func(page IPGroupsClientListByResourceGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *IPGroupsClientListByResourceGroupResponse) (IPGroupsClientListByResourceGroupResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return IPGroupsClientListByResourceGroupResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return IPGroupsClientListByResourceGroupResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return IPGroupsClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) - } - return client.listByResourceGroupHandleResponse(resp) - }, - }) -} - -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *IPGroupsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *IPGroupsClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ipGroups" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *IPGroupsClient) listByResourceGroupHandleResponse(resp *http.Response) (IPGroupsClientListByResourceGroupResponse, error) { - result := IPGroupsClientListByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.IPGroupListResult); err != nil { - return IPGroupsClientListByResourceGroupResponse{}, err - } - return result, nil -} - -// UpdateGroups - Updates tags of an IpGroups resource. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// ipGroupsName - The name of the ipGroups. -// parameters - Parameters supplied to the update ipGroups operation. -// options - IPGroupsClientUpdateGroupsOptions contains the optional parameters for the IPGroupsClient.UpdateGroups method. -func (client *IPGroupsClient) UpdateGroups(ctx context.Context, resourceGroupName string, ipGroupsName string, parameters TagsObject, options *IPGroupsClientUpdateGroupsOptions) (IPGroupsClientUpdateGroupsResponse, error) { - req, err := client.updateGroupsCreateRequest(ctx, resourceGroupName, ipGroupsName, parameters, options) - if err != nil { - return IPGroupsClientUpdateGroupsResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return IPGroupsClientUpdateGroupsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return IPGroupsClientUpdateGroupsResponse{}, runtime.NewResponseError(resp) - } - return client.updateGroupsHandleResponse(resp) -} - -// updateGroupsCreateRequest creates the UpdateGroups request. -func (client *IPGroupsClient) updateGroupsCreateRequest(ctx context.Context, resourceGroupName string, ipGroupsName string, parameters TagsObject, options *IPGroupsClientUpdateGroupsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ipGroups/{ipGroupsName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if ipGroupsName == "" { - return nil, errors.New("parameter ipGroupsName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{ipGroupsName}", url.PathEscape(ipGroupsName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// updateGroupsHandleResponse handles the UpdateGroups response. -func (client *IPGroupsClient) updateGroupsHandleResponse(resp *http.Response) (IPGroupsClientUpdateGroupsResponse, error) { - result := IPGroupsClientUpdateGroupsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.IPGroup); err != nil { - return IPGroupsClientUpdateGroupsResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/loadbalancerbackendaddresspools_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/loadbalancerbackendaddresspools_client.go deleted file mode 100644 index 70e19d6c..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/loadbalancerbackendaddresspools_client.go +++ /dev/null @@ -1,330 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// LoadBalancerBackendAddressPoolsClient contains the methods for the LoadBalancerBackendAddressPools group. -// Don't use this type directly, use NewLoadBalancerBackendAddressPoolsClient() instead. -type LoadBalancerBackendAddressPoolsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewLoadBalancerBackendAddressPoolsClient creates a new instance of LoadBalancerBackendAddressPoolsClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewLoadBalancerBackendAddressPoolsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LoadBalancerBackendAddressPoolsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &LoadBalancerBackendAddressPoolsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates a load balancer backend address pool. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// loadBalancerName - The name of the load balancer. -// backendAddressPoolName - The name of the backend address pool. -// parameters - Parameters supplied to the create or update load balancer backend address pool operation. -// options - LoadBalancerBackendAddressPoolsClientBeginCreateOrUpdateOptions contains the optional parameters for the LoadBalancerBackendAddressPoolsClient.BeginCreateOrUpdate -// method. -func (client *LoadBalancerBackendAddressPoolsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, loadBalancerName string, backendAddressPoolName string, parameters BackendAddressPool, options *LoadBalancerBackendAddressPoolsClientBeginCreateOrUpdateOptions) (*runtime.Poller[LoadBalancerBackendAddressPoolsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, loadBalancerName, backendAddressPoolName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[LoadBalancerBackendAddressPoolsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[LoadBalancerBackendAddressPoolsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates or updates a load balancer backend address pool. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *LoadBalancerBackendAddressPoolsClient) createOrUpdate(ctx context.Context, resourceGroupName string, loadBalancerName string, backendAddressPoolName string, parameters BackendAddressPool, options *LoadBalancerBackendAddressPoolsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, loadBalancerName, backendAddressPoolName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *LoadBalancerBackendAddressPoolsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, backendAddressPoolName string, parameters BackendAddressPool, options *LoadBalancerBackendAddressPoolsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if loadBalancerName == "" { - return nil, errors.New("parameter loadBalancerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{loadBalancerName}", url.PathEscape(loadBalancerName)) - if backendAddressPoolName == "" { - return nil, errors.New("parameter backendAddressPoolName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{backendAddressPoolName}", url.PathEscape(backendAddressPoolName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginDelete - Deletes the specified load balancer backend address pool. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// loadBalancerName - The name of the load balancer. -// backendAddressPoolName - The name of the backend address pool. -// options - LoadBalancerBackendAddressPoolsClientBeginDeleteOptions contains the optional parameters for the LoadBalancerBackendAddressPoolsClient.BeginDelete -// method. -func (client *LoadBalancerBackendAddressPoolsClient) BeginDelete(ctx context.Context, resourceGroupName string, loadBalancerName string, backendAddressPoolName string, options *LoadBalancerBackendAddressPoolsClientBeginDeleteOptions) (*runtime.Poller[LoadBalancerBackendAddressPoolsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, loadBalancerName, backendAddressPoolName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[LoadBalancerBackendAddressPoolsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[LoadBalancerBackendAddressPoolsClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes the specified load balancer backend address pool. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *LoadBalancerBackendAddressPoolsClient) deleteOperation(ctx context.Context, resourceGroupName string, loadBalancerName string, backendAddressPoolName string, options *LoadBalancerBackendAddressPoolsClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, loadBalancerName, backendAddressPoolName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *LoadBalancerBackendAddressPoolsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, backendAddressPoolName string, options *LoadBalancerBackendAddressPoolsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if loadBalancerName == "" { - return nil, errors.New("parameter loadBalancerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{loadBalancerName}", url.PathEscape(loadBalancerName)) - if backendAddressPoolName == "" { - return nil, errors.New("parameter backendAddressPoolName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{backendAddressPoolName}", url.PathEscape(backendAddressPoolName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets load balancer backend address pool. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// loadBalancerName - The name of the load balancer. -// backendAddressPoolName - The name of the backend address pool. -// options - LoadBalancerBackendAddressPoolsClientGetOptions contains the optional parameters for the LoadBalancerBackendAddressPoolsClient.Get -// method. -func (client *LoadBalancerBackendAddressPoolsClient) Get(ctx context.Context, resourceGroupName string, loadBalancerName string, backendAddressPoolName string, options *LoadBalancerBackendAddressPoolsClientGetOptions) (LoadBalancerBackendAddressPoolsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, loadBalancerName, backendAddressPoolName, options) - if err != nil { - return LoadBalancerBackendAddressPoolsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return LoadBalancerBackendAddressPoolsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return LoadBalancerBackendAddressPoolsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *LoadBalancerBackendAddressPoolsClient) getCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, backendAddressPoolName string, options *LoadBalancerBackendAddressPoolsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if loadBalancerName == "" { - return nil, errors.New("parameter loadBalancerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{loadBalancerName}", url.PathEscape(loadBalancerName)) - if backendAddressPoolName == "" { - return nil, errors.New("parameter backendAddressPoolName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{backendAddressPoolName}", url.PathEscape(backendAddressPoolName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *LoadBalancerBackendAddressPoolsClient) getHandleResponse(resp *http.Response) (LoadBalancerBackendAddressPoolsClientGetResponse, error) { - result := LoadBalancerBackendAddressPoolsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.BackendAddressPool); err != nil { - return LoadBalancerBackendAddressPoolsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Gets all the load balancer backed address pools. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// loadBalancerName - The name of the load balancer. -// options - LoadBalancerBackendAddressPoolsClientListOptions contains the optional parameters for the LoadBalancerBackendAddressPoolsClient.List -// method. -func (client *LoadBalancerBackendAddressPoolsClient) NewListPager(resourceGroupName string, loadBalancerName string, options *LoadBalancerBackendAddressPoolsClientListOptions) *runtime.Pager[LoadBalancerBackendAddressPoolsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[LoadBalancerBackendAddressPoolsClientListResponse]{ - More: func(page LoadBalancerBackendAddressPoolsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *LoadBalancerBackendAddressPoolsClientListResponse) (LoadBalancerBackendAddressPoolsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, loadBalancerName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return LoadBalancerBackendAddressPoolsClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return LoadBalancerBackendAddressPoolsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return LoadBalancerBackendAddressPoolsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *LoadBalancerBackendAddressPoolsClient) listCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, options *LoadBalancerBackendAddressPoolsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if loadBalancerName == "" { - return nil, errors.New("parameter loadBalancerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{loadBalancerName}", url.PathEscape(loadBalancerName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *LoadBalancerBackendAddressPoolsClient) listHandleResponse(resp *http.Response) (LoadBalancerBackendAddressPoolsClientListResponse, error) { - result := LoadBalancerBackendAddressPoolsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.LoadBalancerBackendAddressPoolListResult); err != nil { - return LoadBalancerBackendAddressPoolsClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/loadbalancerfrontendipconfigurations_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/loadbalancerfrontendipconfigurations_client.go deleted file mode 100644 index ac95bf3e..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/loadbalancerfrontendipconfigurations_client.go +++ /dev/null @@ -1,189 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// LoadBalancerFrontendIPConfigurationsClient contains the methods for the LoadBalancerFrontendIPConfigurations group. -// Don't use this type directly, use NewLoadBalancerFrontendIPConfigurationsClient() instead. -type LoadBalancerFrontendIPConfigurationsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewLoadBalancerFrontendIPConfigurationsClient creates a new instance of LoadBalancerFrontendIPConfigurationsClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewLoadBalancerFrontendIPConfigurationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LoadBalancerFrontendIPConfigurationsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &LoadBalancerFrontendIPConfigurationsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// Get - Gets load balancer frontend IP configuration. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// loadBalancerName - The name of the load balancer. -// frontendIPConfigurationName - The name of the frontend IP configuration. -// options - LoadBalancerFrontendIPConfigurationsClientGetOptions contains the optional parameters for the LoadBalancerFrontendIPConfigurationsClient.Get -// method. -func (client *LoadBalancerFrontendIPConfigurationsClient) Get(ctx context.Context, resourceGroupName string, loadBalancerName string, frontendIPConfigurationName string, options *LoadBalancerFrontendIPConfigurationsClientGetOptions) (LoadBalancerFrontendIPConfigurationsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, loadBalancerName, frontendIPConfigurationName, options) - if err != nil { - return LoadBalancerFrontendIPConfigurationsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return LoadBalancerFrontendIPConfigurationsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return LoadBalancerFrontendIPConfigurationsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *LoadBalancerFrontendIPConfigurationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, frontendIPConfigurationName string, options *LoadBalancerFrontendIPConfigurationsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/frontendIPConfigurations/{frontendIPConfigurationName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if loadBalancerName == "" { - return nil, errors.New("parameter loadBalancerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{loadBalancerName}", url.PathEscape(loadBalancerName)) - if frontendIPConfigurationName == "" { - return nil, errors.New("parameter frontendIPConfigurationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{frontendIPConfigurationName}", url.PathEscape(frontendIPConfigurationName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *LoadBalancerFrontendIPConfigurationsClient) getHandleResponse(resp *http.Response) (LoadBalancerFrontendIPConfigurationsClientGetResponse, error) { - result := LoadBalancerFrontendIPConfigurationsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.FrontendIPConfiguration); err != nil { - return LoadBalancerFrontendIPConfigurationsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Gets all the load balancer frontend IP configurations. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// loadBalancerName - The name of the load balancer. -// options - LoadBalancerFrontendIPConfigurationsClientListOptions contains the optional parameters for the LoadBalancerFrontendIPConfigurationsClient.List -// method. -func (client *LoadBalancerFrontendIPConfigurationsClient) NewListPager(resourceGroupName string, loadBalancerName string, options *LoadBalancerFrontendIPConfigurationsClientListOptions) *runtime.Pager[LoadBalancerFrontendIPConfigurationsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[LoadBalancerFrontendIPConfigurationsClientListResponse]{ - More: func(page LoadBalancerFrontendIPConfigurationsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *LoadBalancerFrontendIPConfigurationsClientListResponse) (LoadBalancerFrontendIPConfigurationsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, loadBalancerName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return LoadBalancerFrontendIPConfigurationsClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return LoadBalancerFrontendIPConfigurationsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return LoadBalancerFrontendIPConfigurationsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *LoadBalancerFrontendIPConfigurationsClient) listCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, options *LoadBalancerFrontendIPConfigurationsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/frontendIPConfigurations" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if loadBalancerName == "" { - return nil, errors.New("parameter loadBalancerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{loadBalancerName}", url.PathEscape(loadBalancerName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *LoadBalancerFrontendIPConfigurationsClient) listHandleResponse(resp *http.Response) (LoadBalancerFrontendIPConfigurationsClientListResponse, error) { - result := LoadBalancerFrontendIPConfigurationsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.LoadBalancerFrontendIPConfigurationListResult); err != nil { - return LoadBalancerFrontendIPConfigurationsClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/loadbalancerloadbalancingrules_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/loadbalancerloadbalancingrules_client.go deleted file mode 100644 index 134c009e..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/loadbalancerloadbalancingrules_client.go +++ /dev/null @@ -1,189 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// LoadBalancerLoadBalancingRulesClient contains the methods for the LoadBalancerLoadBalancingRules group. -// Don't use this type directly, use NewLoadBalancerLoadBalancingRulesClient() instead. -type LoadBalancerLoadBalancingRulesClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewLoadBalancerLoadBalancingRulesClient creates a new instance of LoadBalancerLoadBalancingRulesClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewLoadBalancerLoadBalancingRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LoadBalancerLoadBalancingRulesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &LoadBalancerLoadBalancingRulesClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// Get - Gets the specified load balancer load balancing rule. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// loadBalancerName - The name of the load balancer. -// loadBalancingRuleName - The name of the load balancing rule. -// options - LoadBalancerLoadBalancingRulesClientGetOptions contains the optional parameters for the LoadBalancerLoadBalancingRulesClient.Get -// method. -func (client *LoadBalancerLoadBalancingRulesClient) Get(ctx context.Context, resourceGroupName string, loadBalancerName string, loadBalancingRuleName string, options *LoadBalancerLoadBalancingRulesClientGetOptions) (LoadBalancerLoadBalancingRulesClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, loadBalancerName, loadBalancingRuleName, options) - if err != nil { - return LoadBalancerLoadBalancingRulesClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return LoadBalancerLoadBalancingRulesClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return LoadBalancerLoadBalancingRulesClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *LoadBalancerLoadBalancingRulesClient) getCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, loadBalancingRuleName string, options *LoadBalancerLoadBalancingRulesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/loadBalancingRules/{loadBalancingRuleName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if loadBalancerName == "" { - return nil, errors.New("parameter loadBalancerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{loadBalancerName}", url.PathEscape(loadBalancerName)) - if loadBalancingRuleName == "" { - return nil, errors.New("parameter loadBalancingRuleName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{loadBalancingRuleName}", url.PathEscape(loadBalancingRuleName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *LoadBalancerLoadBalancingRulesClient) getHandleResponse(resp *http.Response) (LoadBalancerLoadBalancingRulesClientGetResponse, error) { - result := LoadBalancerLoadBalancingRulesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.LoadBalancingRule); err != nil { - return LoadBalancerLoadBalancingRulesClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Gets all the load balancing rules in a load balancer. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// loadBalancerName - The name of the load balancer. -// options - LoadBalancerLoadBalancingRulesClientListOptions contains the optional parameters for the LoadBalancerLoadBalancingRulesClient.List -// method. -func (client *LoadBalancerLoadBalancingRulesClient) NewListPager(resourceGroupName string, loadBalancerName string, options *LoadBalancerLoadBalancingRulesClientListOptions) *runtime.Pager[LoadBalancerLoadBalancingRulesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[LoadBalancerLoadBalancingRulesClientListResponse]{ - More: func(page LoadBalancerLoadBalancingRulesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *LoadBalancerLoadBalancingRulesClientListResponse) (LoadBalancerLoadBalancingRulesClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, loadBalancerName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return LoadBalancerLoadBalancingRulesClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return LoadBalancerLoadBalancingRulesClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return LoadBalancerLoadBalancingRulesClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *LoadBalancerLoadBalancingRulesClient) listCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, options *LoadBalancerLoadBalancingRulesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/loadBalancingRules" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if loadBalancerName == "" { - return nil, errors.New("parameter loadBalancerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{loadBalancerName}", url.PathEscape(loadBalancerName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *LoadBalancerLoadBalancingRulesClient) listHandleResponse(resp *http.Response) (LoadBalancerLoadBalancingRulesClientListResponse, error) { - result := LoadBalancerLoadBalancingRulesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.LoadBalancerLoadBalancingRuleListResult); err != nil { - return LoadBalancerLoadBalancingRulesClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/loadbalancernetworkinterfaces_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/loadbalancernetworkinterfaces_client.go deleted file mode 100644 index 62faa653..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/loadbalancernetworkinterfaces_client.go +++ /dev/null @@ -1,127 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// LoadBalancerNetworkInterfacesClient contains the methods for the LoadBalancerNetworkInterfaces group. -// Don't use this type directly, use NewLoadBalancerNetworkInterfacesClient() instead. -type LoadBalancerNetworkInterfacesClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewLoadBalancerNetworkInterfacesClient creates a new instance of LoadBalancerNetworkInterfacesClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewLoadBalancerNetworkInterfacesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LoadBalancerNetworkInterfacesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &LoadBalancerNetworkInterfacesClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// NewListPager - Gets associated load balancer network interfaces. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// loadBalancerName - The name of the load balancer. -// options - LoadBalancerNetworkInterfacesClientListOptions contains the optional parameters for the LoadBalancerNetworkInterfacesClient.List -// method. -func (client *LoadBalancerNetworkInterfacesClient) NewListPager(resourceGroupName string, loadBalancerName string, options *LoadBalancerNetworkInterfacesClientListOptions) *runtime.Pager[LoadBalancerNetworkInterfacesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[LoadBalancerNetworkInterfacesClientListResponse]{ - More: func(page LoadBalancerNetworkInterfacesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *LoadBalancerNetworkInterfacesClientListResponse) (LoadBalancerNetworkInterfacesClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, loadBalancerName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return LoadBalancerNetworkInterfacesClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return LoadBalancerNetworkInterfacesClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return LoadBalancerNetworkInterfacesClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *LoadBalancerNetworkInterfacesClient) listCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, options *LoadBalancerNetworkInterfacesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/networkInterfaces" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if loadBalancerName == "" { - return nil, errors.New("parameter loadBalancerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{loadBalancerName}", url.PathEscape(loadBalancerName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *LoadBalancerNetworkInterfacesClient) listHandleResponse(resp *http.Response) (LoadBalancerNetworkInterfacesClientListResponse, error) { - result := LoadBalancerNetworkInterfacesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.InterfaceListResult); err != nil { - return LoadBalancerNetworkInterfacesClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/loadbalanceroutboundrules_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/loadbalanceroutboundrules_client.go deleted file mode 100644 index 4dda4d42..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/loadbalanceroutboundrules_client.go +++ /dev/null @@ -1,189 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// LoadBalancerOutboundRulesClient contains the methods for the LoadBalancerOutboundRules group. -// Don't use this type directly, use NewLoadBalancerOutboundRulesClient() instead. -type LoadBalancerOutboundRulesClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewLoadBalancerOutboundRulesClient creates a new instance of LoadBalancerOutboundRulesClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewLoadBalancerOutboundRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LoadBalancerOutboundRulesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &LoadBalancerOutboundRulesClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// Get - Gets the specified load balancer outbound rule. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// loadBalancerName - The name of the load balancer. -// outboundRuleName - The name of the outbound rule. -// options - LoadBalancerOutboundRulesClientGetOptions contains the optional parameters for the LoadBalancerOutboundRulesClient.Get -// method. -func (client *LoadBalancerOutboundRulesClient) Get(ctx context.Context, resourceGroupName string, loadBalancerName string, outboundRuleName string, options *LoadBalancerOutboundRulesClientGetOptions) (LoadBalancerOutboundRulesClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, loadBalancerName, outboundRuleName, options) - if err != nil { - return LoadBalancerOutboundRulesClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return LoadBalancerOutboundRulesClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return LoadBalancerOutboundRulesClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *LoadBalancerOutboundRulesClient) getCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, outboundRuleName string, options *LoadBalancerOutboundRulesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/outboundRules/{outboundRuleName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if loadBalancerName == "" { - return nil, errors.New("parameter loadBalancerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{loadBalancerName}", url.PathEscape(loadBalancerName)) - if outboundRuleName == "" { - return nil, errors.New("parameter outboundRuleName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{outboundRuleName}", url.PathEscape(outboundRuleName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *LoadBalancerOutboundRulesClient) getHandleResponse(resp *http.Response) (LoadBalancerOutboundRulesClientGetResponse, error) { - result := LoadBalancerOutboundRulesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.OutboundRule); err != nil { - return LoadBalancerOutboundRulesClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Gets all the outbound rules in a load balancer. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// loadBalancerName - The name of the load balancer. -// options - LoadBalancerOutboundRulesClientListOptions contains the optional parameters for the LoadBalancerOutboundRulesClient.List -// method. -func (client *LoadBalancerOutboundRulesClient) NewListPager(resourceGroupName string, loadBalancerName string, options *LoadBalancerOutboundRulesClientListOptions) *runtime.Pager[LoadBalancerOutboundRulesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[LoadBalancerOutboundRulesClientListResponse]{ - More: func(page LoadBalancerOutboundRulesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *LoadBalancerOutboundRulesClientListResponse) (LoadBalancerOutboundRulesClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, loadBalancerName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return LoadBalancerOutboundRulesClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return LoadBalancerOutboundRulesClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return LoadBalancerOutboundRulesClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *LoadBalancerOutboundRulesClient) listCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, options *LoadBalancerOutboundRulesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/outboundRules" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if loadBalancerName == "" { - return nil, errors.New("parameter loadBalancerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{loadBalancerName}", url.PathEscape(loadBalancerName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *LoadBalancerOutboundRulesClient) listHandleResponse(resp *http.Response) (LoadBalancerOutboundRulesClientListResponse, error) { - result := LoadBalancerOutboundRulesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.LoadBalancerOutboundRuleListResult); err != nil { - return LoadBalancerOutboundRulesClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/loadbalancerprobes_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/loadbalancerprobes_client.go deleted file mode 100644 index 86d7bb60..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/loadbalancerprobes_client.go +++ /dev/null @@ -1,187 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// LoadBalancerProbesClient contains the methods for the LoadBalancerProbes group. -// Don't use this type directly, use NewLoadBalancerProbesClient() instead. -type LoadBalancerProbesClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewLoadBalancerProbesClient creates a new instance of LoadBalancerProbesClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewLoadBalancerProbesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LoadBalancerProbesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &LoadBalancerProbesClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// Get - Gets load balancer probe. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// loadBalancerName - The name of the load balancer. -// probeName - The name of the probe. -// options - LoadBalancerProbesClientGetOptions contains the optional parameters for the LoadBalancerProbesClient.Get method. -func (client *LoadBalancerProbesClient) Get(ctx context.Context, resourceGroupName string, loadBalancerName string, probeName string, options *LoadBalancerProbesClientGetOptions) (LoadBalancerProbesClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, loadBalancerName, probeName, options) - if err != nil { - return LoadBalancerProbesClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return LoadBalancerProbesClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return LoadBalancerProbesClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *LoadBalancerProbesClient) getCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, probeName string, options *LoadBalancerProbesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if loadBalancerName == "" { - return nil, errors.New("parameter loadBalancerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{loadBalancerName}", url.PathEscape(loadBalancerName)) - if probeName == "" { - return nil, errors.New("parameter probeName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{probeName}", url.PathEscape(probeName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *LoadBalancerProbesClient) getHandleResponse(resp *http.Response) (LoadBalancerProbesClientGetResponse, error) { - result := LoadBalancerProbesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.Probe); err != nil { - return LoadBalancerProbesClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Gets all the load balancer probes. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// loadBalancerName - The name of the load balancer. -// options - LoadBalancerProbesClientListOptions contains the optional parameters for the LoadBalancerProbesClient.List method. -func (client *LoadBalancerProbesClient) NewListPager(resourceGroupName string, loadBalancerName string, options *LoadBalancerProbesClientListOptions) *runtime.Pager[LoadBalancerProbesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[LoadBalancerProbesClientListResponse]{ - More: func(page LoadBalancerProbesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *LoadBalancerProbesClientListResponse) (LoadBalancerProbesClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, loadBalancerName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return LoadBalancerProbesClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return LoadBalancerProbesClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return LoadBalancerProbesClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *LoadBalancerProbesClient) listCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, options *LoadBalancerProbesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if loadBalancerName == "" { - return nil, errors.New("parameter loadBalancerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{loadBalancerName}", url.PathEscape(loadBalancerName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *LoadBalancerProbesClient) listHandleResponse(resp *http.Response) (LoadBalancerProbesClientListResponse, error) { - result := LoadBalancerProbesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.LoadBalancerProbeListResult); err != nil { - return LoadBalancerProbesClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/loadbalancers_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/loadbalancers_client.go deleted file mode 100644 index a52fc786..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/loadbalancers_client.go +++ /dev/null @@ -1,560 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// LoadBalancersClient contains the methods for the LoadBalancers group. -// Don't use this type directly, use NewLoadBalancersClient() instead. -type LoadBalancersClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewLoadBalancersClient creates a new instance of LoadBalancersClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewLoadBalancersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LoadBalancersClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &LoadBalancersClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates a load balancer. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// loadBalancerName - The name of the load balancer. -// parameters - Parameters supplied to the create or update load balancer operation. -// options - LoadBalancersClientBeginCreateOrUpdateOptions contains the optional parameters for the LoadBalancersClient.BeginCreateOrUpdate -// method. -func (client *LoadBalancersClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, loadBalancerName string, parameters LoadBalancer, options *LoadBalancersClientBeginCreateOrUpdateOptions) (*runtime.Poller[LoadBalancersClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, loadBalancerName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[LoadBalancersClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[LoadBalancersClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates or updates a load balancer. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *LoadBalancersClient) createOrUpdate(ctx context.Context, resourceGroupName string, loadBalancerName string, parameters LoadBalancer, options *LoadBalancersClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, loadBalancerName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *LoadBalancersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, parameters LoadBalancer, options *LoadBalancersClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if loadBalancerName == "" { - return nil, errors.New("parameter loadBalancerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{loadBalancerName}", url.PathEscape(loadBalancerName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginDelete - Deletes the specified load balancer. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// loadBalancerName - The name of the load balancer. -// options - LoadBalancersClientBeginDeleteOptions contains the optional parameters for the LoadBalancersClient.BeginDelete -// method. -func (client *LoadBalancersClient) BeginDelete(ctx context.Context, resourceGroupName string, loadBalancerName string, options *LoadBalancersClientBeginDeleteOptions) (*runtime.Poller[LoadBalancersClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, loadBalancerName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[LoadBalancersClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[LoadBalancersClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes the specified load balancer. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *LoadBalancersClient) deleteOperation(ctx context.Context, resourceGroupName string, loadBalancerName string, options *LoadBalancersClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, loadBalancerName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *LoadBalancersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, options *LoadBalancersClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if loadBalancerName == "" { - return nil, errors.New("parameter loadBalancerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{loadBalancerName}", url.PathEscape(loadBalancerName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets the specified load balancer. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// loadBalancerName - The name of the load balancer. -// options - LoadBalancersClientGetOptions contains the optional parameters for the LoadBalancersClient.Get method. -func (client *LoadBalancersClient) Get(ctx context.Context, resourceGroupName string, loadBalancerName string, options *LoadBalancersClientGetOptions) (LoadBalancersClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, loadBalancerName, options) - if err != nil { - return LoadBalancersClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return LoadBalancersClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return LoadBalancersClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *LoadBalancersClient) getCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, options *LoadBalancersClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if loadBalancerName == "" { - return nil, errors.New("parameter loadBalancerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{loadBalancerName}", url.PathEscape(loadBalancerName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *LoadBalancersClient) getHandleResponse(resp *http.Response) (LoadBalancersClientGetResponse, error) { - result := LoadBalancersClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.LoadBalancer); err != nil { - return LoadBalancersClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Gets all the load balancers in a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// options - LoadBalancersClientListOptions contains the optional parameters for the LoadBalancersClient.List method. -func (client *LoadBalancersClient) NewListPager(resourceGroupName string, options *LoadBalancersClientListOptions) *runtime.Pager[LoadBalancersClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[LoadBalancersClientListResponse]{ - More: func(page LoadBalancersClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *LoadBalancersClientListResponse) (LoadBalancersClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return LoadBalancersClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return LoadBalancersClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return LoadBalancersClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *LoadBalancersClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *LoadBalancersClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *LoadBalancersClient) listHandleResponse(resp *http.Response) (LoadBalancersClientListResponse, error) { - result := LoadBalancersClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.LoadBalancerListResult); err != nil { - return LoadBalancersClientListResponse{}, err - } - return result, nil -} - -// NewListAllPager - Gets all the load balancers in a subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// options - LoadBalancersClientListAllOptions contains the optional parameters for the LoadBalancersClient.ListAll method. -func (client *LoadBalancersClient) NewListAllPager(options *LoadBalancersClientListAllOptions) *runtime.Pager[LoadBalancersClientListAllResponse] { - return runtime.NewPager(runtime.PagingHandler[LoadBalancersClientListAllResponse]{ - More: func(page LoadBalancersClientListAllResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *LoadBalancersClientListAllResponse) (LoadBalancersClientListAllResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listAllCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return LoadBalancersClientListAllResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return LoadBalancersClientListAllResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return LoadBalancersClientListAllResponse{}, runtime.NewResponseError(resp) - } - return client.listAllHandleResponse(resp) - }, - }) -} - -// listAllCreateRequest creates the ListAll request. -func (client *LoadBalancersClient) listAllCreateRequest(ctx context.Context, options *LoadBalancersClientListAllOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/loadBalancers" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listAllHandleResponse handles the ListAll response. -func (client *LoadBalancersClient) listAllHandleResponse(resp *http.Response) (LoadBalancersClientListAllResponse, error) { - result := LoadBalancersClientListAllResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.LoadBalancerListResult); err != nil { - return LoadBalancersClientListAllResponse{}, err - } - return result, nil -} - -// BeginListInboundNatRulePortMappings - List of inbound NAT rule port mappings. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// groupName - The name of the resource group. -// loadBalancerName - The name of the load balancer. -// backendPoolName - The name of the load balancer backend address pool. -// parameters - Query inbound NAT rule port mapping request. -// options - LoadBalancersClientBeginListInboundNatRulePortMappingsOptions contains the optional parameters for the LoadBalancersClient.BeginListInboundNatRulePortMappings -// method. -func (client *LoadBalancersClient) BeginListInboundNatRulePortMappings(ctx context.Context, groupName string, loadBalancerName string, backendPoolName string, parameters QueryInboundNatRulePortMappingRequest, options *LoadBalancersClientBeginListInboundNatRulePortMappingsOptions) (*runtime.Poller[LoadBalancersClientListInboundNatRulePortMappingsResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.listInboundNatRulePortMappings(ctx, groupName, loadBalancerName, backendPoolName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[LoadBalancersClientListInboundNatRulePortMappingsResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[LoadBalancersClientListInboundNatRulePortMappingsResponse](options.ResumeToken, client.pl, nil) - } -} - -// ListInboundNatRulePortMappings - List of inbound NAT rule port mappings. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *LoadBalancersClient) listInboundNatRulePortMappings(ctx context.Context, groupName string, loadBalancerName string, backendPoolName string, parameters QueryInboundNatRulePortMappingRequest, options *LoadBalancersClientBeginListInboundNatRulePortMappingsOptions) (*http.Response, error) { - req, err := client.listInboundNatRulePortMappingsCreateRequest(ctx, groupName, loadBalancerName, backendPoolName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// listInboundNatRulePortMappingsCreateRequest creates the ListInboundNatRulePortMappings request. -func (client *LoadBalancersClient) listInboundNatRulePortMappingsCreateRequest(ctx context.Context, groupName string, loadBalancerName string, backendPoolName string, parameters QueryInboundNatRulePortMappingRequest, options *LoadBalancersClientBeginListInboundNatRulePortMappingsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendPoolName}/queryInboundNatRulePortMapping" - if groupName == "" { - return nil, errors.New("parameter groupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{groupName}", url.PathEscape(groupName)) - if loadBalancerName == "" { - return nil, errors.New("parameter loadBalancerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{loadBalancerName}", url.PathEscape(loadBalancerName)) - if backendPoolName == "" { - return nil, errors.New("parameter backendPoolName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{backendPoolName}", url.PathEscape(backendPoolName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginSwapPublicIPAddresses - Swaps VIPs between two load balancers. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// location - The region where load balancers are located at. -// parameters - Parameters that define which VIPs should be swapped. -// options - LoadBalancersClientBeginSwapPublicIPAddressesOptions contains the optional parameters for the LoadBalancersClient.BeginSwapPublicIPAddresses -// method. -func (client *LoadBalancersClient) BeginSwapPublicIPAddresses(ctx context.Context, location string, parameters LoadBalancerVipSwapRequest, options *LoadBalancersClientBeginSwapPublicIPAddressesOptions) (*runtime.Poller[LoadBalancersClientSwapPublicIPAddressesResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.swapPublicIPAddresses(ctx, location, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[LoadBalancersClientSwapPublicIPAddressesResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[LoadBalancersClientSwapPublicIPAddressesResponse](options.ResumeToken, client.pl, nil) - } -} - -// SwapPublicIPAddresses - Swaps VIPs between two load balancers. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *LoadBalancersClient) swapPublicIPAddresses(ctx context.Context, location string, parameters LoadBalancerVipSwapRequest, options *LoadBalancersClientBeginSwapPublicIPAddressesOptions) (*http.Response, error) { - req, err := client.swapPublicIPAddressesCreateRequest(ctx, location, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// swapPublicIPAddressesCreateRequest creates the SwapPublicIPAddresses request. -func (client *LoadBalancersClient) swapPublicIPAddressesCreateRequest(ctx context.Context, location string, parameters LoadBalancerVipSwapRequest, options *LoadBalancersClientBeginSwapPublicIPAddressesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/setLoadBalancerFrontendPublicIpAddresses" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// UpdateTags - Updates a load balancer tags. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// loadBalancerName - The name of the load balancer. -// parameters - Parameters supplied to update load balancer tags. -// options - LoadBalancersClientUpdateTagsOptions contains the optional parameters for the LoadBalancersClient.UpdateTags -// method. -func (client *LoadBalancersClient) UpdateTags(ctx context.Context, resourceGroupName string, loadBalancerName string, parameters TagsObject, options *LoadBalancersClientUpdateTagsOptions) (LoadBalancersClientUpdateTagsResponse, error) { - req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, loadBalancerName, parameters, options) - if err != nil { - return LoadBalancersClientUpdateTagsResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return LoadBalancersClientUpdateTagsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return LoadBalancersClientUpdateTagsResponse{}, runtime.NewResponseError(resp) - } - return client.updateTagsHandleResponse(resp) -} - -// updateTagsCreateRequest creates the UpdateTags request. -func (client *LoadBalancersClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, parameters TagsObject, options *LoadBalancersClientUpdateTagsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if loadBalancerName == "" { - return nil, errors.New("parameter loadBalancerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{loadBalancerName}", url.PathEscape(loadBalancerName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// updateTagsHandleResponse handles the UpdateTags response. -func (client *LoadBalancersClient) updateTagsHandleResponse(resp *http.Response) (LoadBalancersClientUpdateTagsResponse, error) { - result := LoadBalancersClientUpdateTagsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.LoadBalancer); err != nil { - return LoadBalancersClientUpdateTagsResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/localnetworkgateways_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/localnetworkgateways_client.go deleted file mode 100644 index fbb94c9d..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/localnetworkgateways_client.go +++ /dev/null @@ -1,368 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// LocalNetworkGatewaysClient contains the methods for the LocalNetworkGateways group. -// Don't use this type directly, use NewLocalNetworkGatewaysClient() instead. -type LocalNetworkGatewaysClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewLocalNetworkGatewaysClient creates a new instance of LocalNetworkGatewaysClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewLocalNetworkGatewaysClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LocalNetworkGatewaysClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &LocalNetworkGatewaysClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates a local network gateway in the specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// localNetworkGatewayName - The name of the local network gateway. -// parameters - Parameters supplied to the create or update local network gateway operation. -// options - LocalNetworkGatewaysClientBeginCreateOrUpdateOptions contains the optional parameters for the LocalNetworkGatewaysClient.BeginCreateOrUpdate -// method. -func (client *LocalNetworkGatewaysClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, localNetworkGatewayName string, parameters LocalNetworkGateway, options *LocalNetworkGatewaysClientBeginCreateOrUpdateOptions) (*runtime.Poller[LocalNetworkGatewaysClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, localNetworkGatewayName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[LocalNetworkGatewaysClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[LocalNetworkGatewaysClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates or updates a local network gateway in the specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *LocalNetworkGatewaysClient) createOrUpdate(ctx context.Context, resourceGroupName string, localNetworkGatewayName string, parameters LocalNetworkGateway, options *LocalNetworkGatewaysClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, localNetworkGatewayName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *LocalNetworkGatewaysClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, localNetworkGatewayName string, parameters LocalNetworkGateway, options *LocalNetworkGatewaysClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if localNetworkGatewayName == "" { - return nil, errors.New("parameter localNetworkGatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{localNetworkGatewayName}", url.PathEscape(localNetworkGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginDelete - Deletes the specified local network gateway. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// localNetworkGatewayName - The name of the local network gateway. -// options - LocalNetworkGatewaysClientBeginDeleteOptions contains the optional parameters for the LocalNetworkGatewaysClient.BeginDelete -// method. -func (client *LocalNetworkGatewaysClient) BeginDelete(ctx context.Context, resourceGroupName string, localNetworkGatewayName string, options *LocalNetworkGatewaysClientBeginDeleteOptions) (*runtime.Poller[LocalNetworkGatewaysClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, localNetworkGatewayName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[LocalNetworkGatewaysClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[LocalNetworkGatewaysClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes the specified local network gateway. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *LocalNetworkGatewaysClient) deleteOperation(ctx context.Context, resourceGroupName string, localNetworkGatewayName string, options *LocalNetworkGatewaysClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, localNetworkGatewayName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *LocalNetworkGatewaysClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, localNetworkGatewayName string, options *LocalNetworkGatewaysClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if localNetworkGatewayName == "" { - return nil, errors.New("parameter localNetworkGatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{localNetworkGatewayName}", url.PathEscape(localNetworkGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets the specified local network gateway in a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// localNetworkGatewayName - The name of the local network gateway. -// options - LocalNetworkGatewaysClientGetOptions contains the optional parameters for the LocalNetworkGatewaysClient.Get -// method. -func (client *LocalNetworkGatewaysClient) Get(ctx context.Context, resourceGroupName string, localNetworkGatewayName string, options *LocalNetworkGatewaysClientGetOptions) (LocalNetworkGatewaysClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, localNetworkGatewayName, options) - if err != nil { - return LocalNetworkGatewaysClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return LocalNetworkGatewaysClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return LocalNetworkGatewaysClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *LocalNetworkGatewaysClient) getCreateRequest(ctx context.Context, resourceGroupName string, localNetworkGatewayName string, options *LocalNetworkGatewaysClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if localNetworkGatewayName == "" { - return nil, errors.New("parameter localNetworkGatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{localNetworkGatewayName}", url.PathEscape(localNetworkGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *LocalNetworkGatewaysClient) getHandleResponse(resp *http.Response) (LocalNetworkGatewaysClientGetResponse, error) { - result := LocalNetworkGatewaysClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.LocalNetworkGateway); err != nil { - return LocalNetworkGatewaysClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Gets all the local network gateways in a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// options - LocalNetworkGatewaysClientListOptions contains the optional parameters for the LocalNetworkGatewaysClient.List -// method. -func (client *LocalNetworkGatewaysClient) NewListPager(resourceGroupName string, options *LocalNetworkGatewaysClientListOptions) *runtime.Pager[LocalNetworkGatewaysClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[LocalNetworkGatewaysClientListResponse]{ - More: func(page LocalNetworkGatewaysClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *LocalNetworkGatewaysClientListResponse) (LocalNetworkGatewaysClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return LocalNetworkGatewaysClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return LocalNetworkGatewaysClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return LocalNetworkGatewaysClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *LocalNetworkGatewaysClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *LocalNetworkGatewaysClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *LocalNetworkGatewaysClient) listHandleResponse(resp *http.Response) (LocalNetworkGatewaysClientListResponse, error) { - result := LocalNetworkGatewaysClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.LocalNetworkGatewayListResult); err != nil { - return LocalNetworkGatewaysClientListResponse{}, err - } - return result, nil -} - -// UpdateTags - Updates a local network gateway tags. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// localNetworkGatewayName - The name of the local network gateway. -// parameters - Parameters supplied to update local network gateway tags. -// options - LocalNetworkGatewaysClientUpdateTagsOptions contains the optional parameters for the LocalNetworkGatewaysClient.UpdateTags -// method. -func (client *LocalNetworkGatewaysClient) UpdateTags(ctx context.Context, resourceGroupName string, localNetworkGatewayName string, parameters TagsObject, options *LocalNetworkGatewaysClientUpdateTagsOptions) (LocalNetworkGatewaysClientUpdateTagsResponse, error) { - req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, localNetworkGatewayName, parameters, options) - if err != nil { - return LocalNetworkGatewaysClientUpdateTagsResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return LocalNetworkGatewaysClientUpdateTagsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return LocalNetworkGatewaysClientUpdateTagsResponse{}, runtime.NewResponseError(resp) - } - return client.updateTagsHandleResponse(resp) -} - -// updateTagsCreateRequest creates the UpdateTags request. -func (client *LocalNetworkGatewaysClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, localNetworkGatewayName string, parameters TagsObject, options *LocalNetworkGatewaysClientUpdateTagsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if localNetworkGatewayName == "" { - return nil, errors.New("parameter localNetworkGatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{localNetworkGatewayName}", url.PathEscape(localNetworkGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// updateTagsHandleResponse handles the UpdateTags response. -func (client *LocalNetworkGatewaysClient) updateTagsHandleResponse(resp *http.Response) (LocalNetworkGatewaysClientUpdateTagsResponse, error) { - result := LocalNetworkGatewaysClientUpdateTagsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.LocalNetworkGateway); err != nil { - return LocalNetworkGatewaysClientUpdateTagsResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/management_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/management_client.go deleted file mode 100644 index 14b4772c..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/management_client.go +++ /dev/null @@ -1,922 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// ManagementClient contains the methods for the NetworkManagementClient group. -// Don't use this type directly, use NewManagementClient() instead. -type ManagementClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewManagementClient creates a new instance of ManagementClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewManagementClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagementClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &ManagementClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// CheckDNSNameAvailability - Checks whether a domain name in the cloudapp.azure.com zone is available for use. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// location - The location of the domain name. -// domainNameLabel - The domain name to be verified. It must conform to the following regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. -// options - ManagementClientCheckDNSNameAvailabilityOptions contains the optional parameters for the ManagementClient.CheckDNSNameAvailability -// method. -func (client *ManagementClient) CheckDNSNameAvailability(ctx context.Context, location string, domainNameLabel string, options *ManagementClientCheckDNSNameAvailabilityOptions) (ManagementClientCheckDNSNameAvailabilityResponse, error) { - req, err := client.checkDNSNameAvailabilityCreateRequest(ctx, location, domainNameLabel, options) - if err != nil { - return ManagementClientCheckDNSNameAvailabilityResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ManagementClientCheckDNSNameAvailabilityResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ManagementClientCheckDNSNameAvailabilityResponse{}, runtime.NewResponseError(resp) - } - return client.checkDNSNameAvailabilityHandleResponse(resp) -} - -// checkDNSNameAvailabilityCreateRequest creates the CheckDNSNameAvailability request. -func (client *ManagementClient) checkDNSNameAvailabilityCreateRequest(ctx context.Context, location string, domainNameLabel string, options *ManagementClientCheckDNSNameAvailabilityOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/CheckDnsNameAvailability" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("domainNameLabel", domainNameLabel) - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// checkDNSNameAvailabilityHandleResponse handles the CheckDNSNameAvailability response. -func (client *ManagementClient) checkDNSNameAvailabilityHandleResponse(resp *http.Response) (ManagementClientCheckDNSNameAvailabilityResponse, error) { - result := ManagementClientCheckDNSNameAvailabilityResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DNSNameAvailabilityResult); err != nil { - return ManagementClientCheckDNSNameAvailabilityResponse{}, err - } - return result, nil -} - -// BeginDeleteBastionShareableLink - Deletes the Bastion Shareable Links for all the VMs specified in the request. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// bastionHostName - The name of the Bastion Host. -// bslRequest - Post request for all the Bastion Shareable Link endpoints. -// options - ManagementClientBeginDeleteBastionShareableLinkOptions contains the optional parameters for the ManagementClient.BeginDeleteBastionShareableLink -// method. -func (client *ManagementClient) BeginDeleteBastionShareableLink(ctx context.Context, resourceGroupName string, bastionHostName string, bslRequest BastionShareableLinkListRequest, options *ManagementClientBeginDeleteBastionShareableLinkOptions) (*runtime.Poller[ManagementClientDeleteBastionShareableLinkResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteBastionShareableLink(ctx, resourceGroupName, bastionHostName, bslRequest, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ManagementClientDeleteBastionShareableLinkResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[ManagementClientDeleteBastionShareableLinkResponse](options.ResumeToken, client.pl, nil) - } -} - -// DeleteBastionShareableLink - Deletes the Bastion Shareable Links for all the VMs specified in the request. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *ManagementClient) deleteBastionShareableLink(ctx context.Context, resourceGroupName string, bastionHostName string, bslRequest BastionShareableLinkListRequest, options *ManagementClientBeginDeleteBastionShareableLinkOptions) (*http.Response, error) { - req, err := client.deleteBastionShareableLinkCreateRequest(ctx, resourceGroupName, bastionHostName, bslRequest, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteBastionShareableLinkCreateRequest creates the DeleteBastionShareableLink request. -func (client *ManagementClient) deleteBastionShareableLinkCreateRequest(ctx context.Context, resourceGroupName string, bastionHostName string, bslRequest BastionShareableLinkListRequest, options *ManagementClientBeginDeleteBastionShareableLinkOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/deleteShareableLinks" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if bastionHostName == "" { - return nil, errors.New("parameter bastionHostName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{bastionHostName}", url.PathEscape(bastionHostName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, bslRequest) -} - -// NewDisconnectActiveSessionsPager - Returns the list of currently active sessions on the Bastion. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// bastionHostName - The name of the Bastion Host. -// sessionIDs - The list of sessionids to disconnect. -// options - ManagementClientDisconnectActiveSessionsOptions contains the optional parameters for the ManagementClient.DisconnectActiveSessions -// method. -func (client *ManagementClient) NewDisconnectActiveSessionsPager(resourceGroupName string, bastionHostName string, sessionIDs SessionIDs, options *ManagementClientDisconnectActiveSessionsOptions) *runtime.Pager[ManagementClientDisconnectActiveSessionsResponse] { - return runtime.NewPager(runtime.PagingHandler[ManagementClientDisconnectActiveSessionsResponse]{ - More: func(page ManagementClientDisconnectActiveSessionsResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ManagementClientDisconnectActiveSessionsResponse) (ManagementClientDisconnectActiveSessionsResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.disconnectActiveSessionsCreateRequest(ctx, resourceGroupName, bastionHostName, sessionIDs, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return ManagementClientDisconnectActiveSessionsResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ManagementClientDisconnectActiveSessionsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ManagementClientDisconnectActiveSessionsResponse{}, runtime.NewResponseError(resp) - } - return client.disconnectActiveSessionsHandleResponse(resp) - }, - }) -} - -// disconnectActiveSessionsCreateRequest creates the DisconnectActiveSessions request. -func (client *ManagementClient) disconnectActiveSessionsCreateRequest(ctx context.Context, resourceGroupName string, bastionHostName string, sessionIDs SessionIDs, options *ManagementClientDisconnectActiveSessionsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/disconnectActiveSessions" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if bastionHostName == "" { - return nil, errors.New("parameter bastionHostName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{bastionHostName}", url.PathEscape(bastionHostName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, sessionIDs) -} - -// disconnectActiveSessionsHandleResponse handles the DisconnectActiveSessions response. -func (client *ManagementClient) disconnectActiveSessionsHandleResponse(resp *http.Response) (ManagementClientDisconnectActiveSessionsResponse, error) { - result := ManagementClientDisconnectActiveSessionsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.BastionSessionDeleteResult); err != nil { - return ManagementClientDisconnectActiveSessionsResponse{}, err - } - return result, nil -} - -// ExpressRouteProviderPort - Retrieves detail of a provider port. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// providerport - The name of the provider port. -// options - ManagementClientExpressRouteProviderPortOptions contains the optional parameters for the ManagementClient.ExpressRouteProviderPort -// method. -func (client *ManagementClient) ExpressRouteProviderPort(ctx context.Context, providerport string, options *ManagementClientExpressRouteProviderPortOptions) (ManagementClientExpressRouteProviderPortResponse, error) { - req, err := client.expressRouteProviderPortCreateRequest(ctx, providerport, options) - if err != nil { - return ManagementClientExpressRouteProviderPortResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ManagementClientExpressRouteProviderPortResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ManagementClientExpressRouteProviderPortResponse{}, runtime.NewResponseError(resp) - } - return client.expressRouteProviderPortHandleResponse(resp) -} - -// expressRouteProviderPortCreateRequest creates the ExpressRouteProviderPort request. -func (client *ManagementClient) expressRouteProviderPortCreateRequest(ctx context.Context, providerport string, options *ManagementClientExpressRouteProviderPortOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteProviderPorts/{providerport}" - if providerport == "" { - return nil, errors.New("parameter providerport cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{providerport}", url.PathEscape(providerport)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// expressRouteProviderPortHandleResponse handles the ExpressRouteProviderPort response. -func (client *ManagementClient) expressRouteProviderPortHandleResponse(resp *http.Response) (ManagementClientExpressRouteProviderPortResponse, error) { - result := ManagementClientExpressRouteProviderPortResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRouteProviderPort); err != nil { - return ManagementClientExpressRouteProviderPortResponse{}, err - } - return result, nil -} - -// BeginGeneratevirtualwanvpnserverconfigurationvpnprofile - Generates a unique VPN profile for P2S clients for VirtualWan -// and associated VpnServerConfiguration combination in the specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name. -// virtualWANName - The name of the VirtualWAN whose associated VpnServerConfigurations is needed. -// vpnClientParams - Parameters supplied to the generate VirtualWan VPN profile generation operation. -// options - ManagementClientBeginGeneratevirtualwanvpnserverconfigurationvpnprofileOptions contains the optional parameters -// for the ManagementClient.BeginGeneratevirtualwanvpnserverconfigurationvpnprofile method. -func (client *ManagementClient) BeginGeneratevirtualwanvpnserverconfigurationvpnprofile(ctx context.Context, resourceGroupName string, virtualWANName string, vpnClientParams VirtualWanVPNProfileParameters, options *ManagementClientBeginGeneratevirtualwanvpnserverconfigurationvpnprofileOptions) (*runtime.Poller[ManagementClientGeneratevirtualwanvpnserverconfigurationvpnprofileResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.generatevirtualwanvpnserverconfigurationvpnprofile(ctx, resourceGroupName, virtualWANName, vpnClientParams, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ManagementClientGeneratevirtualwanvpnserverconfigurationvpnprofileResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[ManagementClientGeneratevirtualwanvpnserverconfigurationvpnprofileResponse](options.ResumeToken, client.pl, nil) - } -} - -// Generatevirtualwanvpnserverconfigurationvpnprofile - Generates a unique VPN profile for P2S clients for VirtualWan and -// associated VpnServerConfiguration combination in the specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *ManagementClient) generatevirtualwanvpnserverconfigurationvpnprofile(ctx context.Context, resourceGroupName string, virtualWANName string, vpnClientParams VirtualWanVPNProfileParameters, options *ManagementClientBeginGeneratevirtualwanvpnserverconfigurationvpnprofileOptions) (*http.Response, error) { - req, err := client.generatevirtualwanvpnserverconfigurationvpnprofileCreateRequest(ctx, resourceGroupName, virtualWANName, vpnClientParams, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// generatevirtualwanvpnserverconfigurationvpnprofileCreateRequest creates the Generatevirtualwanvpnserverconfigurationvpnprofile request. -func (client *ManagementClient) generatevirtualwanvpnserverconfigurationvpnprofileCreateRequest(ctx context.Context, resourceGroupName string, virtualWANName string, vpnClientParams VirtualWanVPNProfileParameters, options *ManagementClientBeginGeneratevirtualwanvpnserverconfigurationvpnprofileOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWANName}/GenerateVpnProfile" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualWANName == "" { - return nil, errors.New("parameter virtualWANName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualWANName}", url.PathEscape(virtualWANName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, vpnClientParams) -} - -// BeginGetActiveSessions - Returns the list of currently active sessions on the Bastion. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// bastionHostName - The name of the Bastion Host. -// options - ManagementClientBeginGetActiveSessionsOptions contains the optional parameters for the ManagementClient.BeginGetActiveSessions -// method. -func (client *ManagementClient) BeginGetActiveSessions(ctx context.Context, resourceGroupName string, bastionHostName string, options *ManagementClientBeginGetActiveSessionsOptions) (*runtime.Poller[*runtime.Pager[ManagementClientGetActiveSessionsResponse]], error) { - pager := runtime.NewPager(runtime.PagingHandler[ManagementClientGetActiveSessionsResponse]{ - More: func(page ManagementClientGetActiveSessionsResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ManagementClientGetActiveSessionsResponse) (ManagementClientGetActiveSessionsResponse, error) { - req, err := runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - if err != nil { - return ManagementClientGetActiveSessionsResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ManagementClientGetActiveSessionsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ManagementClientGetActiveSessionsResponse{}, runtime.NewResponseError(resp) - } - return client.getActiveSessionsHandleResponse(resp) - }, - }) - if options == nil || options.ResumeToken == "" { - resp, err := client.getActiveSessions(ctx, resourceGroupName, bastionHostName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[*runtime.Pager[ManagementClientGetActiveSessionsResponse]]{ - FinalStateVia: runtime.FinalStateViaLocation, - Response: &pager, - }) - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.pl, &runtime.NewPollerFromResumeTokenOptions[*runtime.Pager[ManagementClientGetActiveSessionsResponse]]{ - Response: &pager, - }) - } -} - -// GetActiveSessions - Returns the list of currently active sessions on the Bastion. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *ManagementClient) getActiveSessions(ctx context.Context, resourceGroupName string, bastionHostName string, options *ManagementClientBeginGetActiveSessionsOptions) (*http.Response, error) { - req, err := client.getActiveSessionsCreateRequest(ctx, resourceGroupName, bastionHostName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// getActiveSessionsCreateRequest creates the GetActiveSessions request. -func (client *ManagementClient) getActiveSessionsCreateRequest(ctx context.Context, resourceGroupName string, bastionHostName string, options *ManagementClientBeginGetActiveSessionsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/getActiveSessions" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if bastionHostName == "" { - return nil, errors.New("parameter bastionHostName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{bastionHostName}", url.PathEscape(bastionHostName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getActiveSessionsHandleResponse handles the GetActiveSessions response. -func (client *ManagementClient) getActiveSessionsHandleResponse(resp *http.Response) (ManagementClientGetActiveSessionsResponse, error) { - result := ManagementClientGetActiveSessionsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.BastionActiveSessionListResult); err != nil { - return ManagementClientGetActiveSessionsResponse{}, err - } - return result, nil -} - -// NewGetBastionShareableLinkPager - Return the Bastion Shareable Links for all the VMs specified in the request. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// bastionHostName - The name of the Bastion Host. -// bslRequest - Post request for all the Bastion Shareable Link endpoints. -// options - ManagementClientGetBastionShareableLinkOptions contains the optional parameters for the ManagementClient.GetBastionShareableLink -// method. -func (client *ManagementClient) NewGetBastionShareableLinkPager(resourceGroupName string, bastionHostName string, bslRequest BastionShareableLinkListRequest, options *ManagementClientGetBastionShareableLinkOptions) *runtime.Pager[ManagementClientGetBastionShareableLinkResponse] { - return runtime.NewPager(runtime.PagingHandler[ManagementClientGetBastionShareableLinkResponse]{ - More: func(page ManagementClientGetBastionShareableLinkResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ManagementClientGetBastionShareableLinkResponse) (ManagementClientGetBastionShareableLinkResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.getBastionShareableLinkCreateRequest(ctx, resourceGroupName, bastionHostName, bslRequest, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return ManagementClientGetBastionShareableLinkResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ManagementClientGetBastionShareableLinkResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ManagementClientGetBastionShareableLinkResponse{}, runtime.NewResponseError(resp) - } - return client.getBastionShareableLinkHandleResponse(resp) - }, - }) -} - -// getBastionShareableLinkCreateRequest creates the GetBastionShareableLink request. -func (client *ManagementClient) getBastionShareableLinkCreateRequest(ctx context.Context, resourceGroupName string, bastionHostName string, bslRequest BastionShareableLinkListRequest, options *ManagementClientGetBastionShareableLinkOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/getShareableLinks" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if bastionHostName == "" { - return nil, errors.New("parameter bastionHostName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{bastionHostName}", url.PathEscape(bastionHostName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, bslRequest) -} - -// getBastionShareableLinkHandleResponse handles the GetBastionShareableLink response. -func (client *ManagementClient) getBastionShareableLinkHandleResponse(resp *http.Response) (ManagementClientGetBastionShareableLinkResponse, error) { - result := ManagementClientGetBastionShareableLinkResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.BastionShareableLinkListResult); err != nil { - return ManagementClientGetBastionShareableLinkResponse{}, err - } - return result, nil -} - -// ListActiveConnectivityConfigurations - Lists active connectivity configurations in a network manager. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkManagerName - The name of the network manager. -// parameters - Active Configuration Parameter. -// options - ManagementClientListActiveConnectivityConfigurationsOptions contains the optional parameters for the ManagementClient.ListActiveConnectivityConfigurations -// method. -func (client *ManagementClient) ListActiveConnectivityConfigurations(ctx context.Context, resourceGroupName string, networkManagerName string, parameters ActiveConfigurationParameter, options *ManagementClientListActiveConnectivityConfigurationsOptions) (ManagementClientListActiveConnectivityConfigurationsResponse, error) { - req, err := client.listActiveConnectivityConfigurationsCreateRequest(ctx, resourceGroupName, networkManagerName, parameters, options) - if err != nil { - return ManagementClientListActiveConnectivityConfigurationsResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ManagementClientListActiveConnectivityConfigurationsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ManagementClientListActiveConnectivityConfigurationsResponse{}, runtime.NewResponseError(resp) - } - return client.listActiveConnectivityConfigurationsHandleResponse(resp) -} - -// listActiveConnectivityConfigurationsCreateRequest creates the ListActiveConnectivityConfigurations request. -func (client *ManagementClient) listActiveConnectivityConfigurationsCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, parameters ActiveConfigurationParameter, options *ManagementClientListActiveConnectivityConfigurationsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/listActiveConnectivityConfigurations" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkManagerName == "" { - return nil, errors.New("parameter networkManagerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// listActiveConnectivityConfigurationsHandleResponse handles the ListActiveConnectivityConfigurations response. -func (client *ManagementClient) listActiveConnectivityConfigurationsHandleResponse(resp *http.Response) (ManagementClientListActiveConnectivityConfigurationsResponse, error) { - result := ManagementClientListActiveConnectivityConfigurationsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ActiveConnectivityConfigurationsListResult); err != nil { - return ManagementClientListActiveConnectivityConfigurationsResponse{}, err - } - return result, nil -} - -// ListActiveSecurityAdminRules - Lists active security admin rules in a network manager. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkManagerName - The name of the network manager. -// parameters - Active Configuration Parameter. -// options - ManagementClientListActiveSecurityAdminRulesOptions contains the optional parameters for the ManagementClient.ListActiveSecurityAdminRules -// method. -func (client *ManagementClient) ListActiveSecurityAdminRules(ctx context.Context, resourceGroupName string, networkManagerName string, parameters ActiveConfigurationParameter, options *ManagementClientListActiveSecurityAdminRulesOptions) (ManagementClientListActiveSecurityAdminRulesResponse, error) { - req, err := client.listActiveSecurityAdminRulesCreateRequest(ctx, resourceGroupName, networkManagerName, parameters, options) - if err != nil { - return ManagementClientListActiveSecurityAdminRulesResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ManagementClientListActiveSecurityAdminRulesResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ManagementClientListActiveSecurityAdminRulesResponse{}, runtime.NewResponseError(resp) - } - return client.listActiveSecurityAdminRulesHandleResponse(resp) -} - -// listActiveSecurityAdminRulesCreateRequest creates the ListActiveSecurityAdminRules request. -func (client *ManagementClient) listActiveSecurityAdminRulesCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, parameters ActiveConfigurationParameter, options *ManagementClientListActiveSecurityAdminRulesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/listActiveSecurityAdminRules" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkManagerName == "" { - return nil, errors.New("parameter networkManagerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// listActiveSecurityAdminRulesHandleResponse handles the ListActiveSecurityAdminRules response. -func (client *ManagementClient) listActiveSecurityAdminRulesHandleResponse(resp *http.Response) (ManagementClientListActiveSecurityAdminRulesResponse, error) { - result := ManagementClientListActiveSecurityAdminRulesResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ActiveSecurityAdminRulesListResult); err != nil { - return ManagementClientListActiveSecurityAdminRulesResponse{}, err - } - return result, nil -} - -// ListNetworkManagerEffectiveConnectivityConfigurations - List all effective connectivity configurations applied on a virtual -// network. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// virtualNetworkName - The name of the virtual network. -// parameters - Parameters supplied to list correct page. -// options - ManagementClientListNetworkManagerEffectiveConnectivityConfigurationsOptions contains the optional parameters -// for the ManagementClient.ListNetworkManagerEffectiveConnectivityConfigurations method. -func (client *ManagementClient) ListNetworkManagerEffectiveConnectivityConfigurations(ctx context.Context, resourceGroupName string, virtualNetworkName string, parameters QueryRequestOptions, options *ManagementClientListNetworkManagerEffectiveConnectivityConfigurationsOptions) (ManagementClientListNetworkManagerEffectiveConnectivityConfigurationsResponse, error) { - req, err := client.listNetworkManagerEffectiveConnectivityConfigurationsCreateRequest(ctx, resourceGroupName, virtualNetworkName, parameters, options) - if err != nil { - return ManagementClientListNetworkManagerEffectiveConnectivityConfigurationsResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ManagementClientListNetworkManagerEffectiveConnectivityConfigurationsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ManagementClientListNetworkManagerEffectiveConnectivityConfigurationsResponse{}, runtime.NewResponseError(resp) - } - return client.listNetworkManagerEffectiveConnectivityConfigurationsHandleResponse(resp) -} - -// listNetworkManagerEffectiveConnectivityConfigurationsCreateRequest creates the ListNetworkManagerEffectiveConnectivityConfigurations request. -func (client *ManagementClient) listNetworkManagerEffectiveConnectivityConfigurationsCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, parameters QueryRequestOptions, options *ManagementClientListNetworkManagerEffectiveConnectivityConfigurationsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/listNetworkManagerEffectiveConnectivityConfigurations" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualNetworkName == "" { - return nil, errors.New("parameter virtualNetworkName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkName}", url.PathEscape(virtualNetworkName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// listNetworkManagerEffectiveConnectivityConfigurationsHandleResponse handles the ListNetworkManagerEffectiveConnectivityConfigurations response. -func (client *ManagementClient) listNetworkManagerEffectiveConnectivityConfigurationsHandleResponse(resp *http.Response) (ManagementClientListNetworkManagerEffectiveConnectivityConfigurationsResponse, error) { - result := ManagementClientListNetworkManagerEffectiveConnectivityConfigurationsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ManagerEffectiveConnectivityConfigurationListResult); err != nil { - return ManagementClientListNetworkManagerEffectiveConnectivityConfigurationsResponse{}, err - } - return result, nil -} - -// ListNetworkManagerEffectiveSecurityAdminRules - List all effective security admin rules applied on a virtual network. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// virtualNetworkName - The name of the virtual network. -// parameters - Parameters supplied to list correct page. -// options - ManagementClientListNetworkManagerEffectiveSecurityAdminRulesOptions contains the optional parameters for the -// ManagementClient.ListNetworkManagerEffectiveSecurityAdminRules method. -func (client *ManagementClient) ListNetworkManagerEffectiveSecurityAdminRules(ctx context.Context, resourceGroupName string, virtualNetworkName string, parameters QueryRequestOptions, options *ManagementClientListNetworkManagerEffectiveSecurityAdminRulesOptions) (ManagementClientListNetworkManagerEffectiveSecurityAdminRulesResponse, error) { - req, err := client.listNetworkManagerEffectiveSecurityAdminRulesCreateRequest(ctx, resourceGroupName, virtualNetworkName, parameters, options) - if err != nil { - return ManagementClientListNetworkManagerEffectiveSecurityAdminRulesResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ManagementClientListNetworkManagerEffectiveSecurityAdminRulesResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ManagementClientListNetworkManagerEffectiveSecurityAdminRulesResponse{}, runtime.NewResponseError(resp) - } - return client.listNetworkManagerEffectiveSecurityAdminRulesHandleResponse(resp) -} - -// listNetworkManagerEffectiveSecurityAdminRulesCreateRequest creates the ListNetworkManagerEffectiveSecurityAdminRules request. -func (client *ManagementClient) listNetworkManagerEffectiveSecurityAdminRulesCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, parameters QueryRequestOptions, options *ManagementClientListNetworkManagerEffectiveSecurityAdminRulesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/listNetworkManagerEffectiveSecurityAdminRules" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualNetworkName == "" { - return nil, errors.New("parameter virtualNetworkName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkName}", url.PathEscape(virtualNetworkName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// listNetworkManagerEffectiveSecurityAdminRulesHandleResponse handles the ListNetworkManagerEffectiveSecurityAdminRules response. -func (client *ManagementClient) listNetworkManagerEffectiveSecurityAdminRulesHandleResponse(resp *http.Response) (ManagementClientListNetworkManagerEffectiveSecurityAdminRulesResponse, error) { - result := ManagementClientListNetworkManagerEffectiveSecurityAdminRulesResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ManagerEffectiveSecurityAdminRulesListResult); err != nil { - return ManagementClientListNetworkManagerEffectiveSecurityAdminRulesResponse{}, err - } - return result, nil -} - -// BeginPutBastionShareableLink - Creates a Bastion Shareable Links for all the VMs specified in the request. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// bastionHostName - The name of the Bastion Host. -// bslRequest - Post request for all the Bastion Shareable Link endpoints. -// options - ManagementClientBeginPutBastionShareableLinkOptions contains the optional parameters for the ManagementClient.BeginPutBastionShareableLink -// method. -func (client *ManagementClient) BeginPutBastionShareableLink(ctx context.Context, resourceGroupName string, bastionHostName string, bslRequest BastionShareableLinkListRequest, options *ManagementClientBeginPutBastionShareableLinkOptions) (*runtime.Poller[*runtime.Pager[ManagementClientPutBastionShareableLinkResponse]], error) { - pager := runtime.NewPager(runtime.PagingHandler[ManagementClientPutBastionShareableLinkResponse]{ - More: func(page ManagementClientPutBastionShareableLinkResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ManagementClientPutBastionShareableLinkResponse) (ManagementClientPutBastionShareableLinkResponse, error) { - req, err := runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - if err != nil { - return ManagementClientPutBastionShareableLinkResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ManagementClientPutBastionShareableLinkResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ManagementClientPutBastionShareableLinkResponse{}, runtime.NewResponseError(resp) - } - return client.putBastionShareableLinkHandleResponse(resp) - }, - }) - if options == nil || options.ResumeToken == "" { - resp, err := client.putBastionShareableLink(ctx, resourceGroupName, bastionHostName, bslRequest, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[*runtime.Pager[ManagementClientPutBastionShareableLinkResponse]]{ - FinalStateVia: runtime.FinalStateViaLocation, - Response: &pager, - }) - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.pl, &runtime.NewPollerFromResumeTokenOptions[*runtime.Pager[ManagementClientPutBastionShareableLinkResponse]]{ - Response: &pager, - }) - } -} - -// PutBastionShareableLink - Creates a Bastion Shareable Links for all the VMs specified in the request. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *ManagementClient) putBastionShareableLink(ctx context.Context, resourceGroupName string, bastionHostName string, bslRequest BastionShareableLinkListRequest, options *ManagementClientBeginPutBastionShareableLinkOptions) (*http.Response, error) { - req, err := client.putBastionShareableLinkCreateRequest(ctx, resourceGroupName, bastionHostName, bslRequest, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// putBastionShareableLinkCreateRequest creates the PutBastionShareableLink request. -func (client *ManagementClient) putBastionShareableLinkCreateRequest(ctx context.Context, resourceGroupName string, bastionHostName string, bslRequest BastionShareableLinkListRequest, options *ManagementClientBeginPutBastionShareableLinkOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/createShareableLinks" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if bastionHostName == "" { - return nil, errors.New("parameter bastionHostName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{bastionHostName}", url.PathEscape(bastionHostName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, bslRequest) -} - -// putBastionShareableLinkHandleResponse handles the PutBastionShareableLink response. -func (client *ManagementClient) putBastionShareableLinkHandleResponse(resp *http.Response) (ManagementClientPutBastionShareableLinkResponse, error) { - result := ManagementClientPutBastionShareableLinkResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.BastionShareableLinkListResult); err != nil { - return ManagementClientPutBastionShareableLinkResponse{}, err - } - return result, nil -} - -// SupportedSecurityProviders - Gives the supported security providers for the virtual wan. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name. -// virtualWANName - The name of the VirtualWAN for which supported security providers are needed. -// options - ManagementClientSupportedSecurityProvidersOptions contains the optional parameters for the ManagementClient.SupportedSecurityProviders -// method. -func (client *ManagementClient) SupportedSecurityProviders(ctx context.Context, resourceGroupName string, virtualWANName string, options *ManagementClientSupportedSecurityProvidersOptions) (ManagementClientSupportedSecurityProvidersResponse, error) { - req, err := client.supportedSecurityProvidersCreateRequest(ctx, resourceGroupName, virtualWANName, options) - if err != nil { - return ManagementClientSupportedSecurityProvidersResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ManagementClientSupportedSecurityProvidersResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ManagementClientSupportedSecurityProvidersResponse{}, runtime.NewResponseError(resp) - } - return client.supportedSecurityProvidersHandleResponse(resp) -} - -// supportedSecurityProvidersCreateRequest creates the SupportedSecurityProviders request. -func (client *ManagementClient) supportedSecurityProvidersCreateRequest(ctx context.Context, resourceGroupName string, virtualWANName string, options *ManagementClientSupportedSecurityProvidersOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWANName}/supportedSecurityProviders" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualWANName == "" { - return nil, errors.New("parameter virtualWANName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualWANName}", url.PathEscape(virtualWANName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// supportedSecurityProvidersHandleResponse handles the SupportedSecurityProviders response. -func (client *ManagementClient) supportedSecurityProvidersHandleResponse(resp *http.Response) (ManagementClientSupportedSecurityProvidersResponse, error) { - result := ManagementClientSupportedSecurityProvidersResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualWanSecurityProviders); err != nil { - return ManagementClientSupportedSecurityProvidersResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/managementgroupnetworkmanagerconnections_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/managementgroupnetworkmanagerconnections_client.go deleted file mode 100644 index 38807117..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/managementgroupnetworkmanagerconnections_client.go +++ /dev/null @@ -1,272 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strconv" - "strings" -) - -// ManagementGroupNetworkManagerConnectionsClient contains the methods for the ManagementGroupNetworkManagerConnections group. -// Don't use this type directly, use NewManagementGroupNetworkManagerConnectionsClient() instead. -type ManagementGroupNetworkManagerConnectionsClient struct { - host string - pl runtime.Pipeline -} - -// NewManagementGroupNetworkManagerConnectionsClient creates a new instance of ManagementGroupNetworkManagerConnectionsClient with the specified values. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewManagementGroupNetworkManagerConnectionsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagementGroupNetworkManagerConnectionsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &ManagementGroupNetworkManagerConnectionsClient{ - host: ep, - pl: pl, - } - return client, nil -} - -// CreateOrUpdate - Create a network manager connection on this management group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// managementGroupID - The management group Id which uniquely identify the Microsoft Azure management group. -// networkManagerConnectionName - Name for the network manager connection. -// parameters - Network manager connection to be created/updated. -// options - ManagementGroupNetworkManagerConnectionsClientCreateOrUpdateOptions contains the optional parameters for the -// ManagementGroupNetworkManagerConnectionsClient.CreateOrUpdate method. -func (client *ManagementGroupNetworkManagerConnectionsClient) CreateOrUpdate(ctx context.Context, managementGroupID string, networkManagerConnectionName string, parameters ManagerConnection, options *ManagementGroupNetworkManagerConnectionsClientCreateOrUpdateOptions) (ManagementGroupNetworkManagerConnectionsClientCreateOrUpdateResponse, error) { - req, err := client.createOrUpdateCreateRequest(ctx, managementGroupID, networkManagerConnectionName, parameters, options) - if err != nil { - return ManagementGroupNetworkManagerConnectionsClientCreateOrUpdateResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ManagementGroupNetworkManagerConnectionsClientCreateOrUpdateResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return ManagementGroupNetworkManagerConnectionsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) - } - return client.createOrUpdateHandleResponse(resp) -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ManagementGroupNetworkManagerConnectionsClient) createOrUpdateCreateRequest(ctx context.Context, managementGroupID string, networkManagerConnectionName string, parameters ManagerConnection, options *ManagementGroupNetworkManagerConnectionsClientCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Network/networkManagerConnections/{networkManagerConnectionName}" - if managementGroupID == "" { - return nil, errors.New("parameter managementGroupID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{managementGroupId}", url.PathEscape(managementGroupID)) - if networkManagerConnectionName == "" { - return nil, errors.New("parameter networkManagerConnectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkManagerConnectionName}", url.PathEscape(networkManagerConnectionName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// createOrUpdateHandleResponse handles the CreateOrUpdate response. -func (client *ManagementGroupNetworkManagerConnectionsClient) createOrUpdateHandleResponse(resp *http.Response) (ManagementGroupNetworkManagerConnectionsClientCreateOrUpdateResponse, error) { - result := ManagementGroupNetworkManagerConnectionsClientCreateOrUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ManagerConnection); err != nil { - return ManagementGroupNetworkManagerConnectionsClientCreateOrUpdateResponse{}, err - } - return result, nil -} - -// Delete - Delete specified pending connection created by this management group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// managementGroupID - The management group Id which uniquely identify the Microsoft Azure management group. -// networkManagerConnectionName - Name for the network manager connection. -// options - ManagementGroupNetworkManagerConnectionsClientDeleteOptions contains the optional parameters for the ManagementGroupNetworkManagerConnectionsClient.Delete -// method. -func (client *ManagementGroupNetworkManagerConnectionsClient) Delete(ctx context.Context, managementGroupID string, networkManagerConnectionName string, options *ManagementGroupNetworkManagerConnectionsClientDeleteOptions) (ManagementGroupNetworkManagerConnectionsClientDeleteResponse, error) { - req, err := client.deleteCreateRequest(ctx, managementGroupID, networkManagerConnectionName, options) - if err != nil { - return ManagementGroupNetworkManagerConnectionsClientDeleteResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ManagementGroupNetworkManagerConnectionsClientDeleteResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return ManagementGroupNetworkManagerConnectionsClientDeleteResponse{}, runtime.NewResponseError(resp) - } - return ManagementGroupNetworkManagerConnectionsClientDeleteResponse{}, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *ManagementGroupNetworkManagerConnectionsClient) deleteCreateRequest(ctx context.Context, managementGroupID string, networkManagerConnectionName string, options *ManagementGroupNetworkManagerConnectionsClientDeleteOptions) (*policy.Request, error) { - urlPath := "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Network/networkManagerConnections/{networkManagerConnectionName}" - if managementGroupID == "" { - return nil, errors.New("parameter managementGroupID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{managementGroupId}", url.PathEscape(managementGroupID)) - if networkManagerConnectionName == "" { - return nil, errors.New("parameter networkManagerConnectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkManagerConnectionName}", url.PathEscape(networkManagerConnectionName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Get a specified connection created by this management group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// managementGroupID - The management group Id which uniquely identify the Microsoft Azure management group. -// networkManagerConnectionName - Name for the network manager connection. -// options - ManagementGroupNetworkManagerConnectionsClientGetOptions contains the optional parameters for the ManagementGroupNetworkManagerConnectionsClient.Get -// method. -func (client *ManagementGroupNetworkManagerConnectionsClient) Get(ctx context.Context, managementGroupID string, networkManagerConnectionName string, options *ManagementGroupNetworkManagerConnectionsClientGetOptions) (ManagementGroupNetworkManagerConnectionsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, managementGroupID, networkManagerConnectionName, options) - if err != nil { - return ManagementGroupNetworkManagerConnectionsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ManagementGroupNetworkManagerConnectionsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ManagementGroupNetworkManagerConnectionsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *ManagementGroupNetworkManagerConnectionsClient) getCreateRequest(ctx context.Context, managementGroupID string, networkManagerConnectionName string, options *ManagementGroupNetworkManagerConnectionsClientGetOptions) (*policy.Request, error) { - urlPath := "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Network/networkManagerConnections/{networkManagerConnectionName}" - if managementGroupID == "" { - return nil, errors.New("parameter managementGroupID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{managementGroupId}", url.PathEscape(managementGroupID)) - if networkManagerConnectionName == "" { - return nil, errors.New("parameter networkManagerConnectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkManagerConnectionName}", url.PathEscape(networkManagerConnectionName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *ManagementGroupNetworkManagerConnectionsClient) getHandleResponse(resp *http.Response) (ManagementGroupNetworkManagerConnectionsClientGetResponse, error) { - result := ManagementGroupNetworkManagerConnectionsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ManagerConnection); err != nil { - return ManagementGroupNetworkManagerConnectionsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - List all network manager connections created by this management group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// managementGroupID - The management group Id which uniquely identify the Microsoft Azure management group. -// options - ManagementGroupNetworkManagerConnectionsClientListOptions contains the optional parameters for the ManagementGroupNetworkManagerConnectionsClient.List -// method. -func (client *ManagementGroupNetworkManagerConnectionsClient) NewListPager(managementGroupID string, options *ManagementGroupNetworkManagerConnectionsClientListOptions) *runtime.Pager[ManagementGroupNetworkManagerConnectionsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[ManagementGroupNetworkManagerConnectionsClientListResponse]{ - More: func(page ManagementGroupNetworkManagerConnectionsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ManagementGroupNetworkManagerConnectionsClientListResponse) (ManagementGroupNetworkManagerConnectionsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, managementGroupID, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return ManagementGroupNetworkManagerConnectionsClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ManagementGroupNetworkManagerConnectionsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ManagementGroupNetworkManagerConnectionsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *ManagementGroupNetworkManagerConnectionsClient) listCreateRequest(ctx context.Context, managementGroupID string, options *ManagementGroupNetworkManagerConnectionsClientListOptions) (*policy.Request, error) { - urlPath := "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Network/networkManagerConnections" - if managementGroupID == "" { - return nil, errors.New("parameter managementGroupID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{managementGroupId}", url.PathEscape(managementGroupID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - if options != nil && options.Top != nil { - reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) - } - if options != nil && options.SkipToken != nil { - reqQP.Set("$skipToken", *options.SkipToken) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *ManagementGroupNetworkManagerConnectionsClient) listHandleResponse(resp *http.Response) (ManagementGroupNetworkManagerConnectionsClientListResponse, error) { - result := ManagementGroupNetworkManagerConnectionsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ManagerConnectionListResult); err != nil { - return ManagementGroupNetworkManagerConnectionsClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/managercommits_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/managercommits_client.go deleted file mode 100644 index 4ba8cc48..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/managercommits_client.go +++ /dev/null @@ -1,123 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// ManagerCommitsClient contains the methods for the NetworkManagerCommits group. -// Don't use this type directly, use NewManagerCommitsClient() instead. -type ManagerCommitsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewManagerCommitsClient creates a new instance of ManagerCommitsClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewManagerCommitsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagerCommitsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &ManagerCommitsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginPost - Post a Network Manager Commit. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkManagerName - The name of the network manager. -// parameters - Parameters supplied to specify which Managed Network commit is. -// options - ManagerCommitsClientBeginPostOptions contains the optional parameters for the ManagerCommitsClient.BeginPost -// method. -func (client *ManagerCommitsClient) BeginPost(ctx context.Context, resourceGroupName string, networkManagerName string, parameters ManagerCommit, options *ManagerCommitsClientBeginPostOptions) (*runtime.Poller[ManagerCommitsClientPostResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.post(ctx, resourceGroupName, networkManagerName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ManagerCommitsClientPostResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[ManagerCommitsClientPostResponse](options.ResumeToken, client.pl, nil) - } -} - -// Post - Post a Network Manager Commit. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *ManagerCommitsClient) post(ctx context.Context, resourceGroupName string, networkManagerName string, parameters ManagerCommit, options *ManagerCommitsClientBeginPostOptions) (*http.Response, error) { - req, err := client.postCreateRequest(ctx, resourceGroupName, networkManagerName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// postCreateRequest creates the Post request. -func (client *ManagerCommitsClient) postCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, parameters ManagerCommit, options *ManagerCommitsClientBeginPostOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/commit" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkManagerName == "" { - return nil, errors.New("parameter networkManagerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/managerdeploymentstatus_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/managerdeploymentstatus_client.go deleted file mode 100644 index 72b63164..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/managerdeploymentstatus_client.go +++ /dev/null @@ -1,115 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// ManagerDeploymentStatusClient contains the methods for the NetworkManagerDeploymentStatus group. -// Don't use this type directly, use NewManagerDeploymentStatusClient() instead. -type ManagerDeploymentStatusClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewManagerDeploymentStatusClient creates a new instance of ManagerDeploymentStatusClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewManagerDeploymentStatusClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagerDeploymentStatusClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &ManagerDeploymentStatusClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// List - Post to List of Network Manager Deployment Status. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkManagerName - The name of the network manager. -// parameters - Parameters supplied to specify which Managed Network deployment status is. -// options - ManagerDeploymentStatusClientListOptions contains the optional parameters for the ManagerDeploymentStatusClient.List -// method. -func (client *ManagerDeploymentStatusClient) List(ctx context.Context, resourceGroupName string, networkManagerName string, parameters ManagerDeploymentStatusParameter, options *ManagerDeploymentStatusClientListOptions) (ManagerDeploymentStatusClientListResponse, error) { - req, err := client.listCreateRequest(ctx, resourceGroupName, networkManagerName, parameters, options) - if err != nil { - return ManagerDeploymentStatusClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ManagerDeploymentStatusClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ManagerDeploymentStatusClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) -} - -// listCreateRequest creates the List request. -func (client *ManagerDeploymentStatusClient) listCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, parameters ManagerDeploymentStatusParameter, options *ManagerDeploymentStatusClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/listDeploymentStatus" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkManagerName == "" { - return nil, errors.New("parameter networkManagerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// listHandleResponse handles the List response. -func (client *ManagerDeploymentStatusClient) listHandleResponse(resp *http.Response) (ManagerDeploymentStatusClientListResponse, error) { - result := ManagerDeploymentStatusClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ManagerDeploymentStatusListResult); err != nil { - return ManagerDeploymentStatusClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/managers_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/managers_client.go deleted file mode 100644 index b8a64c3e..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/managers_client.go +++ /dev/null @@ -1,431 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strconv" - "strings" -) - -// ManagersClient contains the methods for the NetworkManagers group. -// Don't use this type directly, use NewManagersClient() instead. -type ManagersClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewManagersClient creates a new instance of ManagersClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewManagersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagersClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &ManagersClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// CreateOrUpdate - Creates or updates a Network Manager. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkManagerName - The name of the network manager. -// parameters - Parameters supplied to specify which network manager is. -// options - ManagersClientCreateOrUpdateOptions contains the optional parameters for the ManagersClient.CreateOrUpdate method. -func (client *ManagersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, networkManagerName string, parameters Manager, options *ManagersClientCreateOrUpdateOptions) (ManagersClientCreateOrUpdateResponse, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, networkManagerName, parameters, options) - if err != nil { - return ManagersClientCreateOrUpdateResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ManagersClientCreateOrUpdateResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return ManagersClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) - } - return client.createOrUpdateHandleResponse(resp) -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ManagersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, parameters Manager, options *ManagersClientCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkManagerName == "" { - return nil, errors.New("parameter networkManagerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// createOrUpdateHandleResponse handles the CreateOrUpdate response. -func (client *ManagersClient) createOrUpdateHandleResponse(resp *http.Response) (ManagersClientCreateOrUpdateResponse, error) { - result := ManagersClientCreateOrUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.Manager); err != nil { - return ManagersClientCreateOrUpdateResponse{}, err - } - return result, nil -} - -// BeginDelete - Deletes a network manager. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkManagerName - The name of the network manager. -// options - ManagersClientBeginDeleteOptions contains the optional parameters for the ManagersClient.BeginDelete method. -func (client *ManagersClient) BeginDelete(ctx context.Context, resourceGroupName string, networkManagerName string, options *ManagersClientBeginDeleteOptions) (*runtime.Poller[ManagersClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, networkManagerName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ManagersClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[ManagersClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes a network manager. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *ManagersClient) deleteOperation(ctx context.Context, resourceGroupName string, networkManagerName string, options *ManagersClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, networkManagerName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *ManagersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, options *ManagersClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkManagerName == "" { - return nil, errors.New("parameter networkManagerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - if options != nil && options.Force != nil { - reqQP.Set("force", strconv.FormatBool(*options.Force)) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets the specified Network Manager. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkManagerName - The name of the network manager. -// options - ManagersClientGetOptions contains the optional parameters for the ManagersClient.Get method. -func (client *ManagersClient) Get(ctx context.Context, resourceGroupName string, networkManagerName string, options *ManagersClientGetOptions) (ManagersClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, networkManagerName, options) - if err != nil { - return ManagersClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ManagersClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ManagersClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *ManagersClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, options *ManagersClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkManagerName == "" { - return nil, errors.New("parameter networkManagerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *ManagersClient) getHandleResponse(resp *http.Response) (ManagersClientGetResponse, error) { - result := ManagersClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.Manager); err != nil { - return ManagersClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - List network managers in a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// options - ManagersClientListOptions contains the optional parameters for the ManagersClient.List method. -func (client *ManagersClient) NewListPager(resourceGroupName string, options *ManagersClientListOptions) *runtime.Pager[ManagersClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[ManagersClientListResponse]{ - More: func(page ManagersClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ManagersClientListResponse) (ManagersClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return ManagersClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ManagersClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ManagersClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *ManagersClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *ManagersClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - if options != nil && options.Top != nil { - reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) - } - if options != nil && options.SkipToken != nil { - reqQP.Set("$skipToken", *options.SkipToken) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *ManagersClient) listHandleResponse(resp *http.Response) (ManagersClientListResponse, error) { - result := ManagersClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ManagerListResult); err != nil { - return ManagersClientListResponse{}, err - } - return result, nil -} - -// NewListBySubscriptionPager - List all network managers in a subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// options - ManagersClientListBySubscriptionOptions contains the optional parameters for the ManagersClient.ListBySubscription -// method. -func (client *ManagersClient) NewListBySubscriptionPager(options *ManagersClientListBySubscriptionOptions) *runtime.Pager[ManagersClientListBySubscriptionResponse] { - return runtime.NewPager(runtime.PagingHandler[ManagersClientListBySubscriptionResponse]{ - More: func(page ManagersClientListBySubscriptionResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ManagersClientListBySubscriptionResponse) (ManagersClientListBySubscriptionResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listBySubscriptionCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return ManagersClientListBySubscriptionResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ManagersClientListBySubscriptionResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ManagersClientListBySubscriptionResponse{}, runtime.NewResponseError(resp) - } - return client.listBySubscriptionHandleResponse(resp) - }, - }) -} - -// listBySubscriptionCreateRequest creates the ListBySubscription request. -func (client *ManagersClient) listBySubscriptionCreateRequest(ctx context.Context, options *ManagersClientListBySubscriptionOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkManagers" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - if options != nil && options.Top != nil { - reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) - } - if options != nil && options.SkipToken != nil { - reqQP.Set("$skipToken", *options.SkipToken) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listBySubscriptionHandleResponse handles the ListBySubscription response. -func (client *ManagersClient) listBySubscriptionHandleResponse(resp *http.Response) (ManagersClientListBySubscriptionResponse, error) { - result := ManagersClientListBySubscriptionResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ManagerListResult); err != nil { - return ManagersClientListBySubscriptionResponse{}, err - } - return result, nil -} - -// Patch - Patch NetworkManager. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkManagerName - The name of the network manager. -// parameters - Parameters supplied to specify which network manager is. -// options - ManagersClientPatchOptions contains the optional parameters for the ManagersClient.Patch method. -func (client *ManagersClient) Patch(ctx context.Context, resourceGroupName string, networkManagerName string, parameters PatchObject, options *ManagersClientPatchOptions) (ManagersClientPatchResponse, error) { - req, err := client.patchCreateRequest(ctx, resourceGroupName, networkManagerName, parameters, options) - if err != nil { - return ManagersClientPatchResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ManagersClientPatchResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ManagersClientPatchResponse{}, runtime.NewResponseError(resp) - } - return client.patchHandleResponse(resp) -} - -// patchCreateRequest creates the Patch request. -func (client *ManagersClient) patchCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, parameters PatchObject, options *ManagersClientPatchOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkManagerName == "" { - return nil, errors.New("parameter networkManagerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// patchHandleResponse handles the Patch response. -func (client *ManagersClient) patchHandleResponse(resp *http.Response) (ManagersClientPatchResponse, error) { - result := ManagersClientPatchResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.Manager); err != nil { - return ManagersClientPatchResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/models.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/models.go deleted file mode 100644 index ce906452..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/models.go +++ /dev/null @@ -1,16991 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import "time" - -// AADAuthenticationParameters - AAD Vpn authentication type related parameters. -type AADAuthenticationParameters struct { - // AAD Vpn authentication parameter AAD audience. - AADAudience *string `json:"aadAudience,omitempty"` - - // AAD Vpn authentication parameter AAD issuer. - AADIssuer *string `json:"aadIssuer,omitempty"` - - // AAD Vpn authentication parameter AAD tenant. - AADTenant *string `json:"aadTenant,omitempty"` -} - -// ActiveBaseSecurityAdminRuleClassification provides polymorphic access to related types. -// Call the interface's GetActiveBaseSecurityAdminRule() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *ActiveBaseSecurityAdminRule, *ActiveDefaultSecurityAdminRule, *ActiveSecurityAdminRule -type ActiveBaseSecurityAdminRuleClassification interface { - // GetActiveBaseSecurityAdminRule returns the ActiveBaseSecurityAdminRule content of the underlying type. - GetActiveBaseSecurityAdminRule() *ActiveBaseSecurityAdminRule -} - -// ActiveBaseSecurityAdminRule - Network base admin rule. -type ActiveBaseSecurityAdminRule struct { - // REQUIRED; Whether the rule is custom or default. - Kind *EffectiveAdminRuleKind `json:"kind,omitempty"` - - // Deployment time string. - CommitTime *time.Time `json:"commitTime,omitempty"` - - // A description of the security admin configuration. - ConfigurationDescription *string `json:"configurationDescription,omitempty"` - - // Resource ID. - ID *string `json:"id,omitempty"` - - // Deployment region. - Region *string `json:"region,omitempty"` - - // Groups for rule collection - RuleCollectionAppliesToGroups []*ManagerSecurityGroupItem `json:"ruleCollectionAppliesToGroups,omitempty"` - - // A description of the rule collection. - RuleCollectionDescription *string `json:"ruleCollectionDescription,omitempty"` - - // Effective configuration groups. - RuleGroups []*ConfigurationGroup `json:"ruleGroups,omitempty"` -} - -// GetActiveBaseSecurityAdminRule implements the ActiveBaseSecurityAdminRuleClassification interface for type ActiveBaseSecurityAdminRule. -func (a *ActiveBaseSecurityAdminRule) GetActiveBaseSecurityAdminRule() *ActiveBaseSecurityAdminRule { - return a -} - -// ActiveConfigurationParameter - Effective Virtual Networks Parameter. -type ActiveConfigurationParameter struct { - // List of regions. - Regions []*string `json:"regions,omitempty"` - - // When present, the value can be passed to a subsequent query call (together with the same query and scopes used in the current - // request) to retrieve the next page of data. - SkipToken *string `json:"skipToken,omitempty"` -} - -// ActiveConnectivityConfiguration - Active connectivity configuration. -type ActiveConnectivityConfiguration struct { - // Deployment time string. - CommitTime *time.Time `json:"commitTime,omitempty"` - - // Effective configuration groups. - ConfigurationGroups []*ConfigurationGroup `json:"configurationGroups,omitempty"` - - // Connectivity configuration ID. - ID *string `json:"id,omitempty"` - - // Properties of a network manager connectivity configuration - Properties *ConnectivityConfigurationProperties `json:"properties,omitempty"` - - // Deployment region. - Region *string `json:"region,omitempty"` -} - -// ActiveConnectivityConfigurationsListResult - Result of the request to list active connectivity configurations. It contains -// a list of active connectivity configurations and a skiptoken to get the next set of results. -type ActiveConnectivityConfigurationsListResult struct { - // When present, the value can be passed to a subsequent query call (together with the same query and scopes used in the current - // request) to retrieve the next page of data. - SkipToken *string `json:"skipToken,omitempty"` - - // Gets a page of active connectivity configurations. - Value []*ActiveConnectivityConfiguration `json:"value,omitempty"` -} - -// ActiveDefaultSecurityAdminRule - Network default admin rule. -type ActiveDefaultSecurityAdminRule struct { - // REQUIRED; Whether the rule is custom or default. - Kind *EffectiveAdminRuleKind `json:"kind,omitempty"` - - // Deployment time string. - CommitTime *time.Time `json:"commitTime,omitempty"` - - // A description of the security admin configuration. - ConfigurationDescription *string `json:"configurationDescription,omitempty"` - - // Resource ID. - ID *string `json:"id,omitempty"` - - // Indicates the properties of the default security admin rule - Properties *DefaultAdminPropertiesFormat `json:"properties,omitempty"` - - // Deployment region. - Region *string `json:"region,omitempty"` - - // Groups for rule collection - RuleCollectionAppliesToGroups []*ManagerSecurityGroupItem `json:"ruleCollectionAppliesToGroups,omitempty"` - - // A description of the rule collection. - RuleCollectionDescription *string `json:"ruleCollectionDescription,omitempty"` - - // Effective configuration groups. - RuleGroups []*ConfigurationGroup `json:"ruleGroups,omitempty"` -} - -// GetActiveBaseSecurityAdminRule implements the ActiveBaseSecurityAdminRuleClassification interface for type ActiveDefaultSecurityAdminRule. -func (a *ActiveDefaultSecurityAdminRule) GetActiveBaseSecurityAdminRule() *ActiveBaseSecurityAdminRule { - return &ActiveBaseSecurityAdminRule{ - ID: a.ID, - CommitTime: a.CommitTime, - Region: a.Region, - ConfigurationDescription: a.ConfigurationDescription, - RuleCollectionDescription: a.RuleCollectionDescription, - RuleCollectionAppliesToGroups: a.RuleCollectionAppliesToGroups, - RuleGroups: a.RuleGroups, - Kind: a.Kind, - } -} - -// ActiveSecurityAdminRule - Network admin rule. -type ActiveSecurityAdminRule struct { - // REQUIRED; Whether the rule is custom or default. - Kind *EffectiveAdminRuleKind `json:"kind,omitempty"` - - // Deployment time string. - CommitTime *time.Time `json:"commitTime,omitempty"` - - // A description of the security admin configuration. - ConfigurationDescription *string `json:"configurationDescription,omitempty"` - - // Resource ID. - ID *string `json:"id,omitempty"` - - // Indicates the properties of the security admin rule - Properties *AdminPropertiesFormat `json:"properties,omitempty"` - - // Deployment region. - Region *string `json:"region,omitempty"` - - // Groups for rule collection - RuleCollectionAppliesToGroups []*ManagerSecurityGroupItem `json:"ruleCollectionAppliesToGroups,omitempty"` - - // A description of the rule collection. - RuleCollectionDescription *string `json:"ruleCollectionDescription,omitempty"` - - // Effective configuration groups. - RuleGroups []*ConfigurationGroup `json:"ruleGroups,omitempty"` -} - -// GetActiveBaseSecurityAdminRule implements the ActiveBaseSecurityAdminRuleClassification interface for type ActiveSecurityAdminRule. -func (a *ActiveSecurityAdminRule) GetActiveBaseSecurityAdminRule() *ActiveBaseSecurityAdminRule { - return &ActiveBaseSecurityAdminRule{ - ID: a.ID, - CommitTime: a.CommitTime, - Region: a.Region, - ConfigurationDescription: a.ConfigurationDescription, - RuleCollectionDescription: a.RuleCollectionDescription, - RuleCollectionAppliesToGroups: a.RuleCollectionAppliesToGroups, - RuleGroups: a.RuleGroups, - Kind: a.Kind, - } -} - -// ActiveSecurityAdminRulesListResult - Result of the request to list active security admin rules. It contains a list of active -// security admin rules and a skiptoken to get the next set of results. -type ActiveSecurityAdminRulesListResult struct { - // When present, the value can be passed to a subsequent query call (together with the same query and scopes used in the current - // request) to retrieve the next page of data. - SkipToken *string `json:"skipToken,omitempty"` - - // Gets a page of active security admin rules. - Value []ActiveBaseSecurityAdminRuleClassification `json:"value,omitempty"` -} - -// AddressPrefixItem - Address prefix item. -type AddressPrefixItem struct { - // Address prefix. - AddressPrefix *string `json:"addressPrefix,omitempty"` - - // Address prefix type. - AddressPrefixType *AddressPrefixType `json:"addressPrefixType,omitempty"` -} - -// AddressSpace contains an array of IP address ranges that can be used by subnets of the virtual network. -type AddressSpace struct { - // A list of address blocks reserved for this virtual network in CIDR notation. - AddressPrefixes []*string `json:"addressPrefixes,omitempty"` -} - -// AdminPropertiesFormat - Security admin rule resource. -type AdminPropertiesFormat struct { - // REQUIRED; Indicates the access allowed for this particular rule - Access *SecurityConfigurationRuleAccess `json:"access,omitempty"` - - // REQUIRED; Indicates if the traffic matched against the rule in inbound or outbound. - Direction *SecurityConfigurationRuleDirection `json:"direction,omitempty"` - - // REQUIRED; The priority of the rule. The value can be between 1 and 4096. The priority number must be unique for each rule - // in the collection. The lower the priority number, the higher the priority of the rule. - Priority *int32 `json:"priority,omitempty"` - - // REQUIRED; Network protocol this rule applies to. - Protocol *SecurityConfigurationRuleProtocol `json:"protocol,omitempty"` - - // A description for this rule. Restricted to 140 chars. - Description *string `json:"description,omitempty"` - - // The destination port ranges. - DestinationPortRanges []*string `json:"destinationPortRanges,omitempty"` - - // The destination address prefixes. CIDR or destination IP ranges. - Destinations []*AddressPrefixItem `json:"destinations,omitempty"` - - // The source port ranges. - SourcePortRanges []*string `json:"sourcePortRanges,omitempty"` - - // The CIDR or source IP ranges. - Sources []*AddressPrefixItem `json:"sources,omitempty"` - - // READ-ONLY; The provisioning state of the resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// AdminRule - Network admin rule. -type AdminRule struct { - // REQUIRED; Whether the rule is custom or default. - Kind *AdminRuleKind `json:"kind,omitempty"` - - // Indicates the properties of the security admin rule - Properties *AdminPropertiesFormat `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; The system metadata related to this resource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// GetBaseAdminRule implements the BaseAdminRuleClassification interface for type AdminRule. -func (a *AdminRule) GetBaseAdminRule() *BaseAdminRule { - return &BaseAdminRule{ - Kind: a.Kind, - SystemData: a.SystemData, - ID: a.ID, - Name: a.Name, - Type: a.Type, - Etag: a.Etag, - } -} - -// AdminRuleCollection - Defines the admin rule collection. -type AdminRuleCollection struct { - // Indicates the properties for the network manager admin rule collection. - Properties *AdminRuleCollectionPropertiesFormat `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; The system metadata related to this resource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// AdminRuleCollectionListResult - Security admin configuration rule collection list result. -type AdminRuleCollectionListResult struct { - // Gets the URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` - - // A list of network manager security admin configuration rule collections - Value []*AdminRuleCollection `json:"value,omitempty"` -} - -// AdminRuleCollectionPropertiesFormat - Defines the admin rule collection properties. -type AdminRuleCollectionPropertiesFormat struct { - // REQUIRED; Groups for configuration - AppliesToGroups []*ManagerSecurityGroupItem `json:"appliesToGroups,omitempty"` - - // A description of the admin rule collection. - Description *string `json:"description,omitempty"` - - // READ-ONLY; The provisioning state of the resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// AdminRuleCollectionsClientBeginDeleteOptions contains the optional parameters for the AdminRuleCollectionsClient.BeginDelete -// method. -type AdminRuleCollectionsClientBeginDeleteOptions struct { - // Deletes the resource even if it is part of a deployed configuration. If the configuration has been deployed, the service - // will do a cleanup deployment in the background, prior to the delete. - Force *bool - // Resumes the LRO from the provided token. - ResumeToken string -} - -// AdminRuleCollectionsClientCreateOrUpdateOptions contains the optional parameters for the AdminRuleCollectionsClient.CreateOrUpdate -// method. -type AdminRuleCollectionsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// AdminRuleCollectionsClientGetOptions contains the optional parameters for the AdminRuleCollectionsClient.Get method. -type AdminRuleCollectionsClientGetOptions struct { - // placeholder for future optional parameters -} - -// AdminRuleCollectionsClientListOptions contains the optional parameters for the AdminRuleCollectionsClient.List method. -type AdminRuleCollectionsClientListOptions struct { - // SkipToken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, - // the value of the nextLink element will include a skipToken parameter that - // specifies a starting point to use for subsequent calls. - SkipToken *string - // An optional query parameter which specifies the maximum number of records to be returned by the server. - Top *int32 -} - -// AdminRuleListResult - security configuration admin rule list result. -type AdminRuleListResult struct { - // The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` - - // A list of admin rules - Value []BaseAdminRuleClassification `json:"value,omitempty"` -} - -// AdminRulesClientBeginDeleteOptions contains the optional parameters for the AdminRulesClient.BeginDelete method. -type AdminRulesClientBeginDeleteOptions struct { - // Deletes the resource even if it is part of a deployed configuration. If the configuration has been deployed, the service - // will do a cleanup deployment in the background, prior to the delete. - Force *bool - // Resumes the LRO from the provided token. - ResumeToken string -} - -// AdminRulesClientCreateOrUpdateOptions contains the optional parameters for the AdminRulesClient.CreateOrUpdate method. -type AdminRulesClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// AdminRulesClientGetOptions contains the optional parameters for the AdminRulesClient.Get method. -type AdminRulesClientGetOptions struct { - // placeholder for future optional parameters -} - -// AdminRulesClientListOptions contains the optional parameters for the AdminRulesClient.List method. -type AdminRulesClientListOptions struct { - // SkipToken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, - // the value of the nextLink element will include a skipToken parameter that - // specifies a starting point to use for subsequent calls. - SkipToken *string - // An optional query parameter which specifies the maximum number of records to be returned by the server. - Top *int32 -} - -// ApplicationGateway - Application gateway resource. -type ApplicationGateway struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // The identity of the application gateway, if configured. - Identity *ManagedServiceIdentity `json:"identity,omitempty"` - - // Resource location. - Location *string `json:"location,omitempty"` - - // Properties of the application gateway. - Properties *ApplicationGatewayPropertiesFormat `json:"properties,omitempty"` - - // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` - - // A list of availability zones denoting where the resource needs to come from. - Zones []*string `json:"zones,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ApplicationGatewayAuthenticationCertificate - Authentication certificates of an application gateway. -type ApplicationGatewayAuthenticationCertificate struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Name of the authentication certificate that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - - // Properties of the application gateway authentication certificate. - Properties *ApplicationGatewayAuthenticationCertificatePropertiesFormat `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ApplicationGatewayAuthenticationCertificatePropertiesFormat - Authentication certificates properties of an application -// gateway. -type ApplicationGatewayAuthenticationCertificatePropertiesFormat struct { - // Certificate public data. - Data *string `json:"data,omitempty"` - - // READ-ONLY; The provisioning state of the authentication certificate resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// ApplicationGatewayAutoscaleConfiguration - Application Gateway autoscale configuration. -type ApplicationGatewayAutoscaleConfiguration struct { - // REQUIRED; Lower bound on number of Application Gateway capacity. - MinCapacity *int32 `json:"minCapacity,omitempty"` - - // Upper bound on number of Application Gateway capacity. - MaxCapacity *int32 `json:"maxCapacity,omitempty"` -} - -// ApplicationGatewayAvailableSSLOptions - Response for ApplicationGatewayAvailableSslOptions API service call. -type ApplicationGatewayAvailableSSLOptions struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Resource location. - Location *string `json:"location,omitempty"` - - // Properties of the application gateway available SSL options. - Properties *ApplicationGatewayAvailableSSLOptionsPropertiesFormat `json:"properties,omitempty"` - - // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ApplicationGatewayAvailableSSLOptionsPropertiesFormat - Properties of ApplicationGatewayAvailableSslOptions. -type ApplicationGatewayAvailableSSLOptionsPropertiesFormat struct { - // List of available Ssl cipher suites. - AvailableCipherSuites []*ApplicationGatewaySSLCipherSuite `json:"availableCipherSuites,omitempty"` - - // List of available Ssl protocols. - AvailableProtocols []*ApplicationGatewaySSLProtocol `json:"availableProtocols,omitempty"` - - // Name of the Ssl predefined policy applied by default to application gateway. - DefaultPolicy *ApplicationGatewaySSLPolicyName `json:"defaultPolicy,omitempty"` - - // List of available Ssl predefined policy. - PredefinedPolicies []*SubResource `json:"predefinedPolicies,omitempty"` -} - -// ApplicationGatewayAvailableSSLPredefinedPolicies - Response for ApplicationGatewayAvailableSslOptions API service call. -type ApplicationGatewayAvailableSSLPredefinedPolicies struct { - // URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` - - // List of available Ssl predefined policy. - Value []*ApplicationGatewaySSLPredefinedPolicy `json:"value,omitempty"` -} - -// ApplicationGatewayAvailableWafRuleSetsResult - Response for ApplicationGatewayAvailableWafRuleSets API service call. -type ApplicationGatewayAvailableWafRuleSetsResult struct { - // The list of application gateway rule sets. - Value []*ApplicationGatewayFirewallRuleSet `json:"value,omitempty"` -} - -// ApplicationGatewayBackendAddress - Backend address of an application gateway. -type ApplicationGatewayBackendAddress struct { - // Fully qualified domain name (FQDN). - Fqdn *string `json:"fqdn,omitempty"` - - // IP address. - IPAddress *string `json:"ipAddress,omitempty"` -} - -// ApplicationGatewayBackendAddressPool - Backend Address Pool of an application gateway. -type ApplicationGatewayBackendAddressPool struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Name of the backend address pool that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - - // Properties of the application gateway backend address pool. - Properties *ApplicationGatewayBackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ApplicationGatewayBackendAddressPoolPropertiesFormat - Properties of Backend Address Pool of an application gateway. -type ApplicationGatewayBackendAddressPoolPropertiesFormat struct { - // Backend addresses. - BackendAddresses []*ApplicationGatewayBackendAddress `json:"backendAddresses,omitempty"` - - // READ-ONLY; Collection of references to IPs defined in network interfaces. - BackendIPConfigurations []*InterfaceIPConfiguration `json:"backendIPConfigurations,omitempty" azure:"ro"` - - // READ-ONLY; The provisioning state of the backend address pool resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// ApplicationGatewayBackendHTTPSettings - Backend address pool settings of an application gateway. -type ApplicationGatewayBackendHTTPSettings struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Name of the backend http settings that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - - // Properties of the application gateway backend HTTP settings. - Properties *ApplicationGatewayBackendHTTPSettingsPropertiesFormat `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ApplicationGatewayBackendHTTPSettingsPropertiesFormat - Properties of Backend address pool settings of an application gateway. -type ApplicationGatewayBackendHTTPSettingsPropertiesFormat struct { - // Cookie name to use for the affinity cookie. - AffinityCookieName *string `json:"affinityCookieName,omitempty"` - - // Array of references to application gateway authentication certificates. - AuthenticationCertificates []*SubResource `json:"authenticationCertificates,omitempty"` - - // Connection draining of the backend http settings resource. - ConnectionDraining *ApplicationGatewayConnectionDraining `json:"connectionDraining,omitempty"` - - // Cookie based affinity. - CookieBasedAffinity *ApplicationGatewayCookieBasedAffinity `json:"cookieBasedAffinity,omitempty"` - - // Host header to be sent to the backend servers. - HostName *string `json:"hostName,omitempty"` - - // Path which should be used as a prefix for all HTTP requests. Null means no path will be prefixed. Default value is null. - Path *string `json:"path,omitempty"` - - // Whether to pick host header should be picked from the host name of the backend server. Default value is false. - PickHostNameFromBackendAddress *bool `json:"pickHostNameFromBackendAddress,omitempty"` - - // The destination port on the backend. - Port *int32 `json:"port,omitempty"` - - // Probe resource of an application gateway. - Probe *SubResource `json:"probe,omitempty"` - - // Whether the probe is enabled. Default value is false. - ProbeEnabled *bool `json:"probeEnabled,omitempty"` - - // The protocol used to communicate with the backend. - Protocol *ApplicationGatewayProtocol `json:"protocol,omitempty"` - - // Request timeout in seconds. Application Gateway will fail the request if response is not received within RequestTimeout. - // Acceptable values are from 1 second to 86400 seconds. - RequestTimeout *int32 `json:"requestTimeout,omitempty"` - - // Array of references to application gateway trusted root certificates. - TrustedRootCertificates []*SubResource `json:"trustedRootCertificates,omitempty"` - - // READ-ONLY; The provisioning state of the backend HTTP settings resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// ApplicationGatewayBackendHealth - Response for ApplicationGatewayBackendHealth API service call. -type ApplicationGatewayBackendHealth struct { - // A list of ApplicationGatewayBackendHealthPool resources. - BackendAddressPools []*ApplicationGatewayBackendHealthPool `json:"backendAddressPools,omitempty"` -} - -// ApplicationGatewayBackendHealthHTTPSettings - Application gateway BackendHealthHttp settings. -type ApplicationGatewayBackendHealthHTTPSettings struct { - // Reference to an ApplicationGatewayBackendHttpSettings resource. - BackendHTTPSettings *ApplicationGatewayBackendHTTPSettings `json:"backendHttpSettings,omitempty"` - - // List of ApplicationGatewayBackendHealthServer resources. - Servers []*ApplicationGatewayBackendHealthServer `json:"servers,omitempty"` -} - -// ApplicationGatewayBackendHealthOnDemand - Result of on demand test probe. -type ApplicationGatewayBackendHealthOnDemand struct { - // Reference to an ApplicationGatewayBackendAddressPool resource. - BackendAddressPool *ApplicationGatewayBackendAddressPool `json:"backendAddressPool,omitempty"` - - // Application gateway BackendHealthHttp settings. - BackendHealthHTTPSettings *ApplicationGatewayBackendHealthHTTPSettings `json:"backendHealthHttpSettings,omitempty"` -} - -// ApplicationGatewayBackendHealthPool - Application gateway BackendHealth pool. -type ApplicationGatewayBackendHealthPool struct { - // Reference to an ApplicationGatewayBackendAddressPool resource. - BackendAddressPool *ApplicationGatewayBackendAddressPool `json:"backendAddressPool,omitempty"` - - // List of ApplicationGatewayBackendHealthHttpSettings resources. - BackendHTTPSettingsCollection []*ApplicationGatewayBackendHealthHTTPSettings `json:"backendHttpSettingsCollection,omitempty"` -} - -// ApplicationGatewayBackendHealthServer - Application gateway backendhealth http settings. -type ApplicationGatewayBackendHealthServer struct { - // IP address or FQDN of backend server. - Address *string `json:"address,omitempty"` - - // Health of backend server. - Health *ApplicationGatewayBackendHealthServerHealth `json:"health,omitempty"` - - // Health Probe Log. - HealthProbeLog *string `json:"healthProbeLog,omitempty"` - - // Reference to IP configuration of backend server. - IPConfiguration *InterfaceIPConfiguration `json:"ipConfiguration,omitempty"` -} - -// ApplicationGatewayBackendSettings - Backend address pool settings of an application gateway. -type ApplicationGatewayBackendSettings struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Name of the backend settings that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - - // Properties of the application gateway backend settings. - Properties *ApplicationGatewayBackendSettingsPropertiesFormat `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ApplicationGatewayBackendSettingsPropertiesFormat - Properties of Backend address pool settings of an application gateway. -type ApplicationGatewayBackendSettingsPropertiesFormat struct { - // Server name indication to be sent to the backend servers for Tls protocol. - HostName *string `json:"hostName,omitempty"` - - // Whether to pick server name indication from the host name of the backend server for Tls protocol. Default value is false. - PickHostNameFromBackendAddress *bool `json:"pickHostNameFromBackendAddress,omitempty"` - - // The destination port on the backend. - Port *int32 `json:"port,omitempty"` - - // Probe resource of an application gateway. - Probe *SubResource `json:"probe,omitempty"` - - // The protocol used to communicate with the backend. - Protocol *ApplicationGatewayProtocol `json:"protocol,omitempty"` - - // Connection timeout in seconds. Application Gateway will fail the request if response is not received within ConnectionTimeout. - // Acceptable values are from 1 second to 86400 seconds. - Timeout *int32 `json:"timeout,omitempty"` - - // Array of references to application gateway trusted root certificates. - TrustedRootCertificates []*SubResource `json:"trustedRootCertificates,omitempty"` - - // READ-ONLY; The provisioning state of the backend HTTP settings resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// ApplicationGatewayClientAuthConfiguration - Application gateway client authentication configuration. -type ApplicationGatewayClientAuthConfiguration struct { - // Verify client certificate issuer name on the application gateway. - VerifyClientCertIssuerDN *bool `json:"verifyClientCertIssuerDN,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. -type ApplicationGatewayConnectionDraining struct { - // REQUIRED; The number of seconds connection draining is active. Acceptable values are from 1 second to 3600 seconds. - DrainTimeoutInSec *int32 `json:"drainTimeoutInSec,omitempty"` - - // REQUIRED; Whether connection draining is enabled or not. - Enabled *bool `json:"enabled,omitempty"` -} - -// ApplicationGatewayCustomError - Customer error of an application gateway. -type ApplicationGatewayCustomError struct { - // Error page URL of the application gateway customer error. - CustomErrorPageURL *string `json:"customErrorPageUrl,omitempty"` - - // Status code of the application gateway customer error. - StatusCode *ApplicationGatewayCustomErrorStatusCode `json:"statusCode,omitempty"` -} - -// ApplicationGatewayFirewallDisabledRuleGroup - Allows to disable rules within a rule group or an entire rule group. -type ApplicationGatewayFirewallDisabledRuleGroup struct { - // REQUIRED; The name of the rule group that will be disabled. - RuleGroupName *string `json:"ruleGroupName,omitempty"` - - // The list of rules that will be disabled. If null, all rules of the rule group will be disabled. - Rules []*int32 `json:"rules,omitempty"` -} - -// ApplicationGatewayFirewallExclusion - Allow to exclude some variable satisfy the condition for the WAF check. -type ApplicationGatewayFirewallExclusion struct { - // REQUIRED; The variable to be excluded. - MatchVariable *string `json:"matchVariable,omitempty"` - - // REQUIRED; When matchVariable is a collection, operator used to specify which elements in the collection this exclusion - // applies to. - Selector *string `json:"selector,omitempty"` - - // REQUIRED; When matchVariable is a collection, operate on the selector to specify which elements in the collection this - // exclusion applies to. - SelectorMatchOperator *string `json:"selectorMatchOperator,omitempty"` -} - -// ApplicationGatewayFirewallRule - A web application firewall rule. -type ApplicationGatewayFirewallRule struct { - // REQUIRED; The identifier of the web application firewall rule. - RuleID *int32 `json:"ruleId,omitempty"` - - // The description of the web application firewall rule. - Description *string `json:"description,omitempty"` -} - -// ApplicationGatewayFirewallRuleGroup - A web application firewall rule group. -type ApplicationGatewayFirewallRuleGroup struct { - // REQUIRED; The name of the web application firewall rule group. - RuleGroupName *string `json:"ruleGroupName,omitempty"` - - // REQUIRED; The rules of the web application firewall rule group. - Rules []*ApplicationGatewayFirewallRule `json:"rules,omitempty"` - - // The description of the web application firewall rule group. - Description *string `json:"description,omitempty"` -} - -// ApplicationGatewayFirewallRuleSet - A web application firewall rule set. -type ApplicationGatewayFirewallRuleSet struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Resource location. - Location *string `json:"location,omitempty"` - - // Properties of the application gateway firewall rule set. - Properties *ApplicationGatewayFirewallRuleSetPropertiesFormat `json:"properties,omitempty"` - - // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ApplicationGatewayFirewallRuleSetPropertiesFormat - Properties of the web application firewall rule set. -type ApplicationGatewayFirewallRuleSetPropertiesFormat struct { - // REQUIRED; The rule groups of the web application firewall rule set. - RuleGroups []*ApplicationGatewayFirewallRuleGroup `json:"ruleGroups,omitempty"` - - // REQUIRED; The type of the web application firewall rule set. - RuleSetType *string `json:"ruleSetType,omitempty"` - - // REQUIRED; The version of the web application firewall rule set type. - RuleSetVersion *string `json:"ruleSetVersion,omitempty"` - - // READ-ONLY; The provisioning state of the web application firewall rule set. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// ApplicationGatewayFrontendIPConfiguration - Frontend IP configuration of an application gateway. -type ApplicationGatewayFrontendIPConfiguration struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Name of the frontend IP configuration that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - - // Properties of the application gateway frontend IP configuration. - Properties *ApplicationGatewayFrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ApplicationGatewayFrontendIPConfigurationPropertiesFormat - Properties of Frontend IP configuration of an application gateway. -type ApplicationGatewayFrontendIPConfigurationPropertiesFormat struct { - // PrivateIPAddress of the network interface IP Configuration. - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - - // The private IP address allocation method. - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - - // Reference to the application gateway private link configuration. - PrivateLinkConfiguration *SubResource `json:"privateLinkConfiguration,omitempty"` - - // Reference to the PublicIP resource. - PublicIPAddress *SubResource `json:"publicIPAddress,omitempty"` - - // Reference to the subnet resource. - Subnet *SubResource `json:"subnet,omitempty"` - - // READ-ONLY; The provisioning state of the frontend IP configuration resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// ApplicationGatewayFrontendPort - Frontend port of an application gateway. -type ApplicationGatewayFrontendPort struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Name of the frontend port that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - - // Properties of the application gateway frontend port. - Properties *ApplicationGatewayFrontendPortPropertiesFormat `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ApplicationGatewayFrontendPortPropertiesFormat - Properties of Frontend port of an application gateway. -type ApplicationGatewayFrontendPortPropertiesFormat struct { - // Frontend port. - Port *int32 `json:"port,omitempty"` - - // READ-ONLY; The provisioning state of the frontend port resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// ApplicationGatewayGlobalConfiguration - Application Gateway global configuration. -type ApplicationGatewayGlobalConfiguration struct { - // Enable request buffering. - EnableRequestBuffering *bool `json:"enableRequestBuffering,omitempty"` - - // Enable response buffering. - EnableResponseBuffering *bool `json:"enableResponseBuffering,omitempty"` -} - -// ApplicationGatewayHTTPListener - Http listener of an application gateway. -type ApplicationGatewayHTTPListener struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Name of the HTTP listener that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - - // Properties of the application gateway HTTP listener. - Properties *ApplicationGatewayHTTPListenerPropertiesFormat `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ApplicationGatewayHTTPListenerPropertiesFormat - Properties of HTTP listener of an application gateway. -type ApplicationGatewayHTTPListenerPropertiesFormat struct { - // Custom error configurations of the HTTP listener. - CustomErrorConfigurations []*ApplicationGatewayCustomError `json:"customErrorConfigurations,omitempty"` - - // Reference to the FirewallPolicy resource. - FirewallPolicy *SubResource `json:"firewallPolicy,omitempty"` - - // Frontend IP configuration resource of an application gateway. - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - - // Frontend port resource of an application gateway. - FrontendPort *SubResource `json:"frontendPort,omitempty"` - - // Host name of HTTP listener. - HostName *string `json:"hostName,omitempty"` - - // List of Host names for HTTP Listener that allows special wildcard characters as well. - HostNames []*string `json:"hostNames,omitempty"` - - // Protocol of the HTTP listener. - Protocol *ApplicationGatewayProtocol `json:"protocol,omitempty"` - - // Applicable only if protocol is https. Enables SNI for multi-hosting. - RequireServerNameIndication *bool `json:"requireServerNameIndication,omitempty"` - - // SSL certificate resource of an application gateway. - SSLCertificate *SubResource `json:"sslCertificate,omitempty"` - - // SSL profile resource of the application gateway. - SSLProfile *SubResource `json:"sslProfile,omitempty"` - - // READ-ONLY; The provisioning state of the HTTP listener resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// ApplicationGatewayHeaderConfiguration - Header configuration of the Actions set in Application Gateway. -type ApplicationGatewayHeaderConfiguration struct { - // Header name of the header configuration. - HeaderName *string `json:"headerName,omitempty"` - - // Header value of the header configuration. - HeaderValue *string `json:"headerValue,omitempty"` -} - -// ApplicationGatewayIPConfiguration - IP configuration of an application gateway. Currently 1 public and 1 private IP configuration -// is allowed. -type ApplicationGatewayIPConfiguration struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Name of the IP configuration that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - - // Properties of the application gateway IP configuration. - Properties *ApplicationGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ApplicationGatewayIPConfigurationPropertiesFormat - Properties of IP configuration of an application gateway. -type ApplicationGatewayIPConfigurationPropertiesFormat struct { - // Reference to the subnet resource. A subnet from where application gateway gets its private address. - Subnet *SubResource `json:"subnet,omitempty"` - - // READ-ONLY; The provisioning state of the application gateway IP configuration resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// ApplicationGatewayListResult - Response for ListApplicationGateways API service call. -type ApplicationGatewayListResult struct { - // URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` - - // List of an application gateways in a resource group. - Value []*ApplicationGateway `json:"value,omitempty"` -} - -// ApplicationGatewayListener - Listener of an application gateway. -type ApplicationGatewayListener struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Name of the listener that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - - // Properties of the application gateway listener. - Properties *ApplicationGatewayListenerPropertiesFormat `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ApplicationGatewayListenerPropertiesFormat - Properties of listener of an application gateway. -type ApplicationGatewayListenerPropertiesFormat struct { - // Frontend IP configuration resource of an application gateway. - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - - // Frontend port resource of an application gateway. - FrontendPort *SubResource `json:"frontendPort,omitempty"` - - // Protocol of the listener. - Protocol *ApplicationGatewayProtocol `json:"protocol,omitempty"` - - // SSL certificate resource of an application gateway. - SSLCertificate *SubResource `json:"sslCertificate,omitempty"` - - // SSL profile resource of the application gateway. - SSLProfile *SubResource `json:"sslProfile,omitempty"` - - // READ-ONLY; The provisioning state of the listener resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// ApplicationGatewayLoadDistributionPolicy - Load Distribution Policy of an application gateway. -type ApplicationGatewayLoadDistributionPolicy struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Name of the load distribution policy that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - - // Properties of the application gateway load distribution policy. - Properties *ApplicationGatewayLoadDistributionPolicyPropertiesFormat `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ApplicationGatewayLoadDistributionPolicyPropertiesFormat - Properties of Load Distribution Policy of an application gateway. -type ApplicationGatewayLoadDistributionPolicyPropertiesFormat struct { - // Load Distribution Targets resource of an application gateway. - LoadDistributionAlgorithm *ApplicationGatewayLoadDistributionAlgorithm `json:"loadDistributionAlgorithm,omitempty"` - - // Load Distribution Targets resource of an application gateway. - LoadDistributionTargets []*ApplicationGatewayLoadDistributionTarget `json:"loadDistributionTargets,omitempty"` - - // READ-ONLY; The provisioning state of the Load Distribution Policy resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// ApplicationGatewayLoadDistributionTarget - Load Distribution Target of an application gateway. -type ApplicationGatewayLoadDistributionTarget struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Name of the load distribution policy that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - - // Properties of the application gateway load distribution target. - Properties *ApplicationGatewayLoadDistributionTargetPropertiesFormat `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` -} - -type ApplicationGatewayLoadDistributionTargetPropertiesFormat struct { - // Backend address pool resource of the application gateway. - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - - // Weight per server. Range between 1 and 100. - WeightPerServer *int32 `json:"weightPerServer,omitempty"` -} - -// ApplicationGatewayOnDemandProbe - Details of on demand test probe request. -type ApplicationGatewayOnDemandProbe struct { - // Reference to backend pool of application gateway to which probe request will be sent. - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - - // Reference to backend http setting of application gateway to be used for test probe. - BackendHTTPSettings *SubResource `json:"backendHttpSettings,omitempty"` - - // Host name to send the probe to. - Host *string `json:"host,omitempty"` - - // Criterion for classifying a healthy probe response. - Match *ApplicationGatewayProbeHealthResponseMatch `json:"match,omitempty"` - - // Relative path of probe. Valid path starts from '/'. Probe is sent to ://:. - Path *string `json:"path,omitempty"` - - // Whether the host header should be picked from the backend http settings. Default value is false. - PickHostNameFromBackendHTTPSettings *bool `json:"pickHostNameFromBackendHttpSettings,omitempty"` - - // The protocol used for the probe. - Protocol *ApplicationGatewayProtocol `json:"protocol,omitempty"` - - // The probe timeout in seconds. Probe marked as failed if valid response is not received with this timeout period. Acceptable - // values are from 1 second to 86400 seconds. - Timeout *int32 `json:"timeout,omitempty"` -} - -// ApplicationGatewayPathRule - Path rule of URL path map of an application gateway. -type ApplicationGatewayPathRule struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Name of the path rule that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - - // Properties of the application gateway path rule. - Properties *ApplicationGatewayPathRulePropertiesFormat `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ApplicationGatewayPathRulePropertiesFormat - Properties of path rule of an application gateway. -type ApplicationGatewayPathRulePropertiesFormat struct { - // Backend address pool resource of URL path map path rule. - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - - // Backend http settings resource of URL path map path rule. - BackendHTTPSettings *SubResource `json:"backendHttpSettings,omitempty"` - - // Reference to the FirewallPolicy resource. - FirewallPolicy *SubResource `json:"firewallPolicy,omitempty"` - - // Load Distribution Policy resource of URL path map path rule. - LoadDistributionPolicy *SubResource `json:"loadDistributionPolicy,omitempty"` - - // Path rules of URL path map. - Paths []*string `json:"paths,omitempty"` - - // Redirect configuration resource of URL path map path rule. - RedirectConfiguration *SubResource `json:"redirectConfiguration,omitempty"` - - // Rewrite rule set resource of URL path map path rule. - RewriteRuleSet *SubResource `json:"rewriteRuleSet,omitempty"` - - // READ-ONLY; The provisioning state of the path rule resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// ApplicationGatewayPrivateEndpointConnection - Private Endpoint connection on an application gateway. -type ApplicationGatewayPrivateEndpointConnection struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Name of the private endpoint connection on an application gateway. - Name *string `json:"name,omitempty"` - - // Properties of the application gateway private endpoint connection. - Properties *ApplicationGatewayPrivateEndpointConnectionProperties `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ApplicationGatewayPrivateEndpointConnectionListResult - Response for ListApplicationGatewayPrivateEndpointConnection API -// service call. Gets all private endpoint connections for an application gateway. -type ApplicationGatewayPrivateEndpointConnectionListResult struct { - // URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` - - // List of private endpoint connections on an application gateway. - Value []*ApplicationGatewayPrivateEndpointConnection `json:"value,omitempty"` -} - -// ApplicationGatewayPrivateEndpointConnectionProperties - Properties of Private Link Resource of an application gateway. -type ApplicationGatewayPrivateEndpointConnectionProperties struct { - // A collection of information about the state of the connection between service consumer and provider. - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - - // READ-ONLY; The consumer link id. - LinkIdentifier *string `json:"linkIdentifier,omitempty" azure:"ro"` - - // READ-ONLY; The resource of private end point. - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty" azure:"ro"` - - // READ-ONLY; The provisioning state of the application gateway private endpoint connection resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// ApplicationGatewayPrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the ApplicationGatewayPrivateEndpointConnectionsClient.BeginDelete -// method. -type ApplicationGatewayPrivateEndpointConnectionsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ApplicationGatewayPrivateEndpointConnectionsClientBeginUpdateOptions contains the optional parameters for the ApplicationGatewayPrivateEndpointConnectionsClient.BeginUpdate -// method. -type ApplicationGatewayPrivateEndpointConnectionsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ApplicationGatewayPrivateEndpointConnectionsClientGetOptions contains the optional parameters for the ApplicationGatewayPrivateEndpointConnectionsClient.Get -// method. -type ApplicationGatewayPrivateEndpointConnectionsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ApplicationGatewayPrivateEndpointConnectionsClientListOptions contains the optional parameters for the ApplicationGatewayPrivateEndpointConnectionsClient.List -// method. -type ApplicationGatewayPrivateEndpointConnectionsClientListOptions struct { - // placeholder for future optional parameters -} - -// ApplicationGatewayPrivateLinkConfiguration - Private Link Configuration on an application gateway. -type ApplicationGatewayPrivateLinkConfiguration struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Name of the private link configuration that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - - // Properties of the application gateway private link configuration. - Properties *ApplicationGatewayPrivateLinkConfigurationProperties `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ApplicationGatewayPrivateLinkConfigurationProperties - Properties of private link configuration on an application gateway. -type ApplicationGatewayPrivateLinkConfigurationProperties struct { - // An array of application gateway private link ip configurations. - IPConfigurations []*ApplicationGatewayPrivateLinkIPConfiguration `json:"ipConfigurations,omitempty"` - - // READ-ONLY; The provisioning state of the application gateway private link configuration. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// ApplicationGatewayPrivateLinkIPConfiguration - The application gateway private link ip configuration. -type ApplicationGatewayPrivateLinkIPConfiguration struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // The name of application gateway private link ip configuration. - Name *string `json:"name,omitempty"` - - // Properties of an application gateway private link ip configuration. - Properties *ApplicationGatewayPrivateLinkIPConfigurationProperties `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; The resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ApplicationGatewayPrivateLinkIPConfigurationProperties - Properties of an application gateway private link IP configuration. -type ApplicationGatewayPrivateLinkIPConfigurationProperties struct { - // Whether the ip configuration is primary or not. - Primary *bool `json:"primary,omitempty"` - - // The private IP address of the IP configuration. - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - - // The private IP address allocation method. - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - - // Reference to the subnet resource. - Subnet *SubResource `json:"subnet,omitempty"` - - // READ-ONLY; The provisioning state of the application gateway private link IP configuration. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// ApplicationGatewayPrivateLinkResource - PrivateLink Resource of an application gateway. -type ApplicationGatewayPrivateLinkResource struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Name of the private link resource that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - - // Properties of the application gateway private link resource. - Properties *ApplicationGatewayPrivateLinkResourceProperties `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ApplicationGatewayPrivateLinkResourceListResult - Response for ListApplicationGatewayPrivateLinkResources API service call. -// Gets all private link resources for an application gateway. -type ApplicationGatewayPrivateLinkResourceListResult struct { - // URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` - - // List of private link resources of an application gateway. - Value []*ApplicationGatewayPrivateLinkResource `json:"value,omitempty"` -} - -// ApplicationGatewayPrivateLinkResourceProperties - Properties of a private link resource. -type ApplicationGatewayPrivateLinkResourceProperties struct { - // Required DNS zone names of the the private link resource. - RequiredZoneNames []*string `json:"requiredZoneNames,omitempty"` - - // READ-ONLY; Group identifier of private link resource. - GroupID *string `json:"groupId,omitempty" azure:"ro"` - - // READ-ONLY; Required member names of private link resource. - RequiredMembers []*string `json:"requiredMembers,omitempty" azure:"ro"` -} - -// ApplicationGatewayPrivateLinkResourcesClientListOptions contains the optional parameters for the ApplicationGatewayPrivateLinkResourcesClient.List -// method. -type ApplicationGatewayPrivateLinkResourcesClientListOptions struct { - // placeholder for future optional parameters -} - -// ApplicationGatewayProbe - Probe of the application gateway. -type ApplicationGatewayProbe struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Name of the probe that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - - // Properties of the application gateway probe. - Properties *ApplicationGatewayProbePropertiesFormat `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ApplicationGatewayProbeHealthResponseMatch - Application gateway probe health response match. -type ApplicationGatewayProbeHealthResponseMatch struct { - // Body that must be contained in the health response. Default value is empty. - Body *string `json:"body,omitempty"` - - // Allowed ranges of healthy status codes. Default range of healthy status codes is 200-399. - StatusCodes []*string `json:"statusCodes,omitempty"` -} - -// ApplicationGatewayProbePropertiesFormat - Properties of probe of an application gateway. -type ApplicationGatewayProbePropertiesFormat struct { - // Host name to send the probe to. - Host *string `json:"host,omitempty"` - - // The probing interval in seconds. This is the time interval between two consecutive probes. Acceptable values are from 1 - // second to 86400 seconds. - Interval *int32 `json:"interval,omitempty"` - - // Criterion for classifying a healthy probe response. - Match *ApplicationGatewayProbeHealthResponseMatch `json:"match,omitempty"` - - // Minimum number of servers that are always marked healthy. Default value is 0. - MinServers *int32 `json:"minServers,omitempty"` - - // Relative path of probe. Valid path starts from '/'. Probe is sent to ://:. - Path *string `json:"path,omitempty"` - - // Whether the host header should be picked from the backend http settings. Default value is false. - PickHostNameFromBackendHTTPSettings *bool `json:"pickHostNameFromBackendHttpSettings,omitempty"` - - // Whether the server name indication should be picked from the backend settings for Tls protocol. Default value is false. - PickHostNameFromBackendSettings *bool `json:"pickHostNameFromBackendSettings,omitempty"` - - // Custom port which will be used for probing the backend servers. The valid value ranges from 1 to 65535. In case not set, - // port from http settings will be used. This property is valid for Standardv2 and - // WAFv2 only. - Port *int32 `json:"port,omitempty"` - - // The protocol used for the probe. - Protocol *ApplicationGatewayProtocol `json:"protocol,omitempty"` - - // The probe timeout in seconds. Probe marked as failed if valid response is not received with this timeout period. Acceptable - // values are from 1 second to 86400 seconds. - Timeout *int32 `json:"timeout,omitempty"` - - // The probe retry count. Backend server is marked down after consecutive probe failure count reaches UnhealthyThreshold. - // Acceptable values are from 1 second to 20. - UnhealthyThreshold *int32 `json:"unhealthyThreshold,omitempty"` - - // READ-ONLY; The provisioning state of the probe resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// ApplicationGatewayPropertiesFormat - Properties of the application gateway. -type ApplicationGatewayPropertiesFormat struct { - // Authentication certificates of the application gateway resource. For default limits, see Application Gateway limits - // [https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits]. - AuthenticationCertificates []*ApplicationGatewayAuthenticationCertificate `json:"authenticationCertificates,omitempty"` - - // Autoscale Configuration. - AutoscaleConfiguration *ApplicationGatewayAutoscaleConfiguration `json:"autoscaleConfiguration,omitempty"` - - // Backend address pool of the application gateway resource. For default limits, see Application Gateway limits - // [https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits]. - BackendAddressPools []*ApplicationGatewayBackendAddressPool `json:"backendAddressPools,omitempty"` - - // Backend http settings of the application gateway resource. For default limits, see Application Gateway limits - // [https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits]. - BackendHTTPSettingsCollection []*ApplicationGatewayBackendHTTPSettings `json:"backendHttpSettingsCollection,omitempty"` - - // Backend settings of the application gateway resource. For default limits, see Application Gateway limits [https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits] - // . - BackendSettingsCollection []*ApplicationGatewayBackendSettings `json:"backendSettingsCollection,omitempty"` - - // Custom error configurations of the application gateway resource. - CustomErrorConfigurations []*ApplicationGatewayCustomError `json:"customErrorConfigurations,omitempty"` - - // Whether FIPS is enabled on the application gateway resource. - EnableFips *bool `json:"enableFips,omitempty"` - - // Whether HTTP2 is enabled on the application gateway resource. - EnableHTTP2 *bool `json:"enableHttp2,omitempty"` - - // Reference to the FirewallPolicy resource. - FirewallPolicy *SubResource `json:"firewallPolicy,omitempty"` - - // If true, associates a firewall policy with an application gateway regardless whether the policy differs from the WAF Config. - ForceFirewallPolicyAssociation *bool `json:"forceFirewallPolicyAssociation,omitempty"` - - // Frontend IP addresses of the application gateway resource. For default limits, see Application Gateway limits - // [https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits]. - FrontendIPConfigurations []*ApplicationGatewayFrontendIPConfiguration `json:"frontendIPConfigurations,omitempty"` - - // Frontend ports of the application gateway resource. For default limits, see Application Gateway limits [https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits]. - FrontendPorts []*ApplicationGatewayFrontendPort `json:"frontendPorts,omitempty"` - - // Subnets of the application gateway resource. For default limits, see Application Gateway limits [https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits]. - GatewayIPConfigurations []*ApplicationGatewayIPConfiguration `json:"gatewayIPConfigurations,omitempty"` - - // Global Configuration. - GlobalConfiguration *ApplicationGatewayGlobalConfiguration `json:"globalConfiguration,omitempty"` - - // Http listeners of the application gateway resource. For default limits, see Application Gateway limits [https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits]. - HTTPListeners []*ApplicationGatewayHTTPListener `json:"httpListeners,omitempty"` - - // Listeners of the application gateway resource. For default limits, see Application Gateway limits [https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits]. - Listeners []*ApplicationGatewayListener `json:"listeners,omitempty"` - - // Load distribution policies of the application gateway resource. - LoadDistributionPolicies []*ApplicationGatewayLoadDistributionPolicy `json:"loadDistributionPolicies,omitempty"` - - // PrivateLink configurations on application gateway. - PrivateLinkConfigurations []*ApplicationGatewayPrivateLinkConfiguration `json:"privateLinkConfigurations,omitempty"` - - // Probes of the application gateway resource. - Probes []*ApplicationGatewayProbe `json:"probes,omitempty"` - - // Redirect configurations of the application gateway resource. For default limits, see Application Gateway limits - // [https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits]. - RedirectConfigurations []*ApplicationGatewayRedirectConfiguration `json:"redirectConfigurations,omitempty"` - - // Request routing rules of the application gateway resource. - RequestRoutingRules []*ApplicationGatewayRequestRoutingRule `json:"requestRoutingRules,omitempty"` - - // Rewrite rules for the application gateway resource. - RewriteRuleSets []*ApplicationGatewayRewriteRuleSet `json:"rewriteRuleSets,omitempty"` - - // Routing rules of the application gateway resource. - RoutingRules []*ApplicationGatewayRoutingRule `json:"routingRules,omitempty"` - - // SKU of the application gateway resource. - SKU *ApplicationGatewaySKU `json:"sku,omitempty"` - - // SSL certificates of the application gateway resource. For default limits, see Application Gateway limits [https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits] - // . - SSLCertificates []*ApplicationGatewaySSLCertificate `json:"sslCertificates,omitempty"` - - // SSL policy of the application gateway resource. - SSLPolicy *ApplicationGatewaySSLPolicy `json:"sslPolicy,omitempty"` - - // SSL profiles of the application gateway resource. For default limits, see Application Gateway limits [https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits]. - SSLProfiles []*ApplicationGatewaySSLProfile `json:"sslProfiles,omitempty"` - - // Trusted client certificates of the application gateway resource. For default limits, see Application Gateway limits - // [https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits]. - TrustedClientCertificates []*ApplicationGatewayTrustedClientCertificate `json:"trustedClientCertificates,omitempty"` - - // Trusted Root certificates of the application gateway resource. For default limits, see Application Gateway limits - // [https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits]. - TrustedRootCertificates []*ApplicationGatewayTrustedRootCertificate `json:"trustedRootCertificates,omitempty"` - - // URL path map of the application gateway resource. For default limits, see Application Gateway limits [https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits]. - URLPathMaps []*ApplicationGatewayURLPathMap `json:"urlPathMaps,omitempty"` - - // Web application firewall configuration. - WebApplicationFirewallConfiguration *ApplicationGatewayWebApplicationFirewallConfiguration `json:"webApplicationFirewallConfiguration,omitempty"` - - // READ-ONLY; Operational state of the application gateway resource. - OperationalState *ApplicationGatewayOperationalState `json:"operationalState,omitempty" azure:"ro"` - - // READ-ONLY; Private Endpoint connections on application gateway. - PrivateEndpointConnections []*ApplicationGatewayPrivateEndpointConnection `json:"privateEndpointConnections,omitempty" azure:"ro"` - - // READ-ONLY; The provisioning state of the application gateway resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` - - // READ-ONLY; The resource GUID property of the application gateway resource. - ResourceGUID *string `json:"resourceGuid,omitempty" azure:"ro"` -} - -// ApplicationGatewayRedirectConfiguration - Redirect configuration of an application gateway. -type ApplicationGatewayRedirectConfiguration struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Name of the redirect configuration that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - - // Properties of the application gateway redirect configuration. - Properties *ApplicationGatewayRedirectConfigurationPropertiesFormat `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ApplicationGatewayRedirectConfigurationPropertiesFormat - Properties of redirect configuration of the application gateway. -type ApplicationGatewayRedirectConfigurationPropertiesFormat struct { - // Include path in the redirected url. - IncludePath *bool `json:"includePath,omitempty"` - - // Include query string in the redirected url. - IncludeQueryString *bool `json:"includeQueryString,omitempty"` - - // Path rules specifying redirect configuration. - PathRules []*SubResource `json:"pathRules,omitempty"` - - // HTTP redirection type. - RedirectType *ApplicationGatewayRedirectType `json:"redirectType,omitempty"` - - // Request routing specifying redirect configuration. - RequestRoutingRules []*SubResource `json:"requestRoutingRules,omitempty"` - - // Reference to a listener to redirect the request to. - TargetListener *SubResource `json:"targetListener,omitempty"` - - // Url to redirect the request to. - TargetURL *string `json:"targetUrl,omitempty"` - - // Url path maps specifying default redirect configuration. - URLPathMaps []*SubResource `json:"urlPathMaps,omitempty"` -} - -// ApplicationGatewayRequestRoutingRule - Request routing rule of an application gateway. -type ApplicationGatewayRequestRoutingRule struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Name of the request routing rule that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - - // Properties of the application gateway request routing rule. - Properties *ApplicationGatewayRequestRoutingRulePropertiesFormat `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ApplicationGatewayRequestRoutingRulePropertiesFormat - Properties of request routing rule of the application gateway. -type ApplicationGatewayRequestRoutingRulePropertiesFormat struct { - // Backend address pool resource of the application gateway. - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - - // Backend http settings resource of the application gateway. - BackendHTTPSettings *SubResource `json:"backendHttpSettings,omitempty"` - - // Http listener resource of the application gateway. - HTTPListener *SubResource `json:"httpListener,omitempty"` - - // Load Distribution Policy resource of the application gateway. - LoadDistributionPolicy *SubResource `json:"loadDistributionPolicy,omitempty"` - - // Priority of the request routing rule. - Priority *int32 `json:"priority,omitempty"` - - // Redirect configuration resource of the application gateway. - RedirectConfiguration *SubResource `json:"redirectConfiguration,omitempty"` - - // Rewrite Rule Set resource in Basic rule of the application gateway. - RewriteRuleSet *SubResource `json:"rewriteRuleSet,omitempty"` - - // Rule type. - RuleType *ApplicationGatewayRequestRoutingRuleType `json:"ruleType,omitempty"` - - // URL path map resource of the application gateway. - URLPathMap *SubResource `json:"urlPathMap,omitempty"` - - // READ-ONLY; The provisioning state of the request routing rule resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// ApplicationGatewayRewriteRule - Rewrite rule of an application gateway. -type ApplicationGatewayRewriteRule struct { - // Set of actions to be done as part of the rewrite Rule. - ActionSet *ApplicationGatewayRewriteRuleActionSet `json:"actionSet,omitempty"` - - // Conditions based on which the action set execution will be evaluated. - Conditions []*ApplicationGatewayRewriteRuleCondition `json:"conditions,omitempty"` - - // Name of the rewrite rule that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - - // Rule Sequence of the rewrite rule that determines the order of execution of a particular rule in a RewriteRuleSet. - RuleSequence *int32 `json:"ruleSequence,omitempty"` -} - -// ApplicationGatewayRewriteRuleActionSet - Set of actions in the Rewrite Rule in Application Gateway. -type ApplicationGatewayRewriteRuleActionSet struct { - // Request Header Actions in the Action Set. - RequestHeaderConfigurations []*ApplicationGatewayHeaderConfiguration `json:"requestHeaderConfigurations,omitempty"` - - // Response Header Actions in the Action Set. - ResponseHeaderConfigurations []*ApplicationGatewayHeaderConfiguration `json:"responseHeaderConfigurations,omitempty"` - - // Url Configuration Action in the Action Set. - URLConfiguration *ApplicationGatewayURLConfiguration `json:"urlConfiguration,omitempty"` -} - -// ApplicationGatewayRewriteRuleCondition - Set of conditions in the Rewrite Rule in Application Gateway. -type ApplicationGatewayRewriteRuleCondition struct { - // Setting this parameter to truth value with force the pattern to do a case in-sensitive comparison. - IgnoreCase *bool `json:"ignoreCase,omitempty"` - - // Setting this value as truth will force to check the negation of the condition given by the user. - Negate *bool `json:"negate,omitempty"` - - // The pattern, either fixed string or regular expression, that evaluates the truthfulness of the condition. - Pattern *string `json:"pattern,omitempty"` - - // The condition parameter of the RewriteRuleCondition. - Variable *string `json:"variable,omitempty"` -} - -// ApplicationGatewayRewriteRuleSet - Rewrite rule set of an application gateway. -type ApplicationGatewayRewriteRuleSet struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Name of the rewrite rule set that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - - // Properties of the application gateway rewrite rule set. - Properties *ApplicationGatewayRewriteRuleSetPropertiesFormat `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` -} - -// ApplicationGatewayRewriteRuleSetPropertiesFormat - Properties of rewrite rule set of the application gateway. -type ApplicationGatewayRewriteRuleSetPropertiesFormat struct { - // Rewrite rules in the rewrite rule set. - RewriteRules []*ApplicationGatewayRewriteRule `json:"rewriteRules,omitempty"` - - // READ-ONLY; The provisioning state of the rewrite rule set resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// ApplicationGatewayRoutingRule - Routing rule of an application gateway. -type ApplicationGatewayRoutingRule struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Name of the routing rule that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - - // Properties of the application gateway routing rule. - Properties *ApplicationGatewayRoutingRulePropertiesFormat `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ApplicationGatewayRoutingRulePropertiesFormat - Properties of routing rule of the application gateway. -type ApplicationGatewayRoutingRulePropertiesFormat struct { - // REQUIRED; Priority of the routing rule. - Priority *int32 `json:"priority,omitempty"` - - // Backend address pool resource of the application gateway. - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - - // Backend settings resource of the application gateway. - BackendSettings *SubResource `json:"backendSettings,omitempty"` - - // Listener resource of the application gateway. - Listener *SubResource `json:"listener,omitempty"` - - // Rule type. - RuleType *ApplicationGatewayRequestRoutingRuleType `json:"ruleType,omitempty"` - - // READ-ONLY; The provisioning state of the request routing rule resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// ApplicationGatewaySKU - SKU of an application gateway. -type ApplicationGatewaySKU struct { - // Capacity (instance count) of an application gateway. - Capacity *int32 `json:"capacity,omitempty"` - - // Name of an application gateway SKU. - Name *ApplicationGatewaySKUName `json:"name,omitempty"` - - // Tier of an application gateway. - Tier *ApplicationGatewayTier `json:"tier,omitempty"` -} - -// ApplicationGatewaySSLCertificate - SSL certificates of an application gateway. -type ApplicationGatewaySSLCertificate struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Name of the SSL certificate that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - - // Properties of the application gateway SSL certificate. - Properties *ApplicationGatewaySSLCertificatePropertiesFormat `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ApplicationGatewaySSLCertificatePropertiesFormat - Properties of SSL certificates of an application gateway. -type ApplicationGatewaySSLCertificatePropertiesFormat struct { - // Base-64 encoded pfx certificate. Only applicable in PUT Request. - Data *string `json:"data,omitempty"` - - // Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or 'Certificate' object stored in KeyVault. - KeyVaultSecretID *string `json:"keyVaultSecretId,omitempty"` - - // Password for the pfx file specified in data. Only applicable in PUT request. - Password *string `json:"password,omitempty"` - - // READ-ONLY; The provisioning state of the SSL certificate resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` - - // READ-ONLY; Base-64 encoded Public cert data corresponding to pfx specified in data. Only applicable in GET request. - PublicCertData *string `json:"publicCertData,omitempty" azure:"ro"` -} - -// ApplicationGatewaySSLPolicy - Application Gateway Ssl policy. -type ApplicationGatewaySSLPolicy struct { - // Ssl cipher suites to be enabled in the specified order to application gateway. - CipherSuites []*ApplicationGatewaySSLCipherSuite `json:"cipherSuites,omitempty"` - - // Ssl protocols to be disabled on application gateway. - DisabledSSLProtocols []*ApplicationGatewaySSLProtocol `json:"disabledSslProtocols,omitempty"` - - // Minimum version of Ssl protocol to be supported on application gateway. - MinProtocolVersion *ApplicationGatewaySSLProtocol `json:"minProtocolVersion,omitempty"` - - // Name of Ssl predefined policy. - PolicyName *ApplicationGatewaySSLPolicyName `json:"policyName,omitempty"` - - // Type of Ssl Policy. - PolicyType *ApplicationGatewaySSLPolicyType `json:"policyType,omitempty"` -} - -// ApplicationGatewaySSLPredefinedPolicy - An Ssl predefined policy. -type ApplicationGatewaySSLPredefinedPolicy struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Name of the Ssl predefined policy. - Name *string `json:"name,omitempty"` - - // Properties of the application gateway SSL predefined policy. - Properties *ApplicationGatewaySSLPredefinedPolicyPropertiesFormat `json:"properties,omitempty"` -} - -// ApplicationGatewaySSLPredefinedPolicyPropertiesFormat - Properties of ApplicationGatewaySslPredefinedPolicy. -type ApplicationGatewaySSLPredefinedPolicyPropertiesFormat struct { - // Ssl cipher suites to be enabled in the specified order for application gateway. - CipherSuites []*ApplicationGatewaySSLCipherSuite `json:"cipherSuites,omitempty"` - - // Minimum version of Ssl protocol to be supported on application gateway. - MinProtocolVersion *ApplicationGatewaySSLProtocol `json:"minProtocolVersion,omitempty"` -} - -// ApplicationGatewaySSLProfile - SSL profile of an application gateway. -type ApplicationGatewaySSLProfile struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Name of the SSL profile that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - - // Properties of the application gateway SSL profile. - Properties *ApplicationGatewaySSLProfilePropertiesFormat `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ApplicationGatewaySSLProfilePropertiesFormat - Properties of SSL profile of an application gateway. -type ApplicationGatewaySSLProfilePropertiesFormat struct { - // Client authentication configuration of the application gateway resource. - ClientAuthConfiguration *ApplicationGatewayClientAuthConfiguration `json:"clientAuthConfiguration,omitempty"` - - // SSL policy of the application gateway resource. - SSLPolicy *ApplicationGatewaySSLPolicy `json:"sslPolicy,omitempty"` - - // Array of references to application gateway trusted client certificates. - TrustedClientCertificates []*SubResource `json:"trustedClientCertificates,omitempty"` - - // READ-ONLY; The provisioning state of the HTTP listener resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// ApplicationGatewayTrustedClientCertificate - Trusted client certificates of an application gateway. -type ApplicationGatewayTrustedClientCertificate struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Name of the trusted client certificate that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - - // Properties of the application gateway trusted client certificate. - Properties *ApplicationGatewayTrustedClientCertificatePropertiesFormat `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ApplicationGatewayTrustedClientCertificatePropertiesFormat - Trusted client certificates properties of an application gateway. -type ApplicationGatewayTrustedClientCertificatePropertiesFormat struct { - // Certificate public data. - Data *string `json:"data,omitempty"` - - // READ-ONLY; Distinguished name of client certificate issuer. - ClientCertIssuerDN *string `json:"clientCertIssuerDN,omitempty" azure:"ro"` - - // READ-ONLY; The provisioning state of the trusted client certificate resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` - - // READ-ONLY; Validated certificate data. - ValidatedCertData *string `json:"validatedCertData,omitempty" azure:"ro"` -} - -// ApplicationGatewayTrustedRootCertificate - Trusted Root certificates of an application gateway. -type ApplicationGatewayTrustedRootCertificate struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Name of the trusted root certificate that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - - // Properties of the application gateway trusted root certificate. - Properties *ApplicationGatewayTrustedRootCertificatePropertiesFormat `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ApplicationGatewayTrustedRootCertificatePropertiesFormat - Trusted Root certificates properties of an application gateway. -type ApplicationGatewayTrustedRootCertificatePropertiesFormat struct { - // Certificate public data. - Data *string `json:"data,omitempty"` - - // Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or 'Certificate' object stored in KeyVault. - KeyVaultSecretID *string `json:"keyVaultSecretId,omitempty"` - - // READ-ONLY; The provisioning state of the trusted root certificate resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// ApplicationGatewayURLConfiguration - Url configuration of the Actions set in Application Gateway. -type ApplicationGatewayURLConfiguration struct { - // Url path which user has provided for url rewrite. Null means no path will be updated. Default value is null. - ModifiedPath *string `json:"modifiedPath,omitempty"` - - // Query string which user has provided for url rewrite. Null means no query string will be updated. Default value is null. - ModifiedQueryString *string `json:"modifiedQueryString,omitempty"` - - // If set as true, it will re-evaluate the url path map provided in path based request routing rules using modified path. - // Default value is false. - Reroute *bool `json:"reroute,omitempty"` -} - -// ApplicationGatewayURLPathMap - UrlPathMaps give a url path to the backend mapping information for PathBasedRouting. -type ApplicationGatewayURLPathMap struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Name of the URL path map that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - - // Properties of the application gateway URL path map. - Properties *ApplicationGatewayURLPathMapPropertiesFormat `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ApplicationGatewayURLPathMapPropertiesFormat - Properties of UrlPathMap of the application gateway. -type ApplicationGatewayURLPathMapPropertiesFormat struct { - // Default backend address pool resource of URL path map. - DefaultBackendAddressPool *SubResource `json:"defaultBackendAddressPool,omitempty"` - - // Default backend http settings resource of URL path map. - DefaultBackendHTTPSettings *SubResource `json:"defaultBackendHttpSettings,omitempty"` - - // Default Load Distribution Policy resource of URL path map. - DefaultLoadDistributionPolicy *SubResource `json:"defaultLoadDistributionPolicy,omitempty"` - - // Default redirect configuration resource of URL path map. - DefaultRedirectConfiguration *SubResource `json:"defaultRedirectConfiguration,omitempty"` - - // Default Rewrite rule set resource of URL path map. - DefaultRewriteRuleSet *SubResource `json:"defaultRewriteRuleSet,omitempty"` - - // Path rule of URL path map resource. - PathRules []*ApplicationGatewayPathRule `json:"pathRules,omitempty"` - - // READ-ONLY; The provisioning state of the URL path map resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// ApplicationGatewayWebApplicationFirewallConfiguration - Application gateway web application firewall configuration. -type ApplicationGatewayWebApplicationFirewallConfiguration struct { - // REQUIRED; Whether the web application firewall is enabled or not. - Enabled *bool `json:"enabled,omitempty"` - - // REQUIRED; Web application firewall mode. - FirewallMode *ApplicationGatewayFirewallMode `json:"firewallMode,omitempty"` - - // REQUIRED; The type of the web application firewall rule set. Possible values are: 'OWASP'. - RuleSetType *string `json:"ruleSetType,omitempty"` - - // REQUIRED; The version of the rule set type. - RuleSetVersion *string `json:"ruleSetVersion,omitempty"` - - // The disabled rule groups. - DisabledRuleGroups []*ApplicationGatewayFirewallDisabledRuleGroup `json:"disabledRuleGroups,omitempty"` - - // The exclusion list. - Exclusions []*ApplicationGatewayFirewallExclusion `json:"exclusions,omitempty"` - - // Maximum file upload size in Mb for WAF. - FileUploadLimitInMb *int32 `json:"fileUploadLimitInMb,omitempty"` - - // Maximum request body size for WAF. - MaxRequestBodySize *int32 `json:"maxRequestBodySize,omitempty"` - - // Maximum request body size in Kb for WAF. - MaxRequestBodySizeInKb *int32 `json:"maxRequestBodySizeInKb,omitempty"` - - // Whether allow WAF to check request Body. - RequestBodyCheck *bool `json:"requestBodyCheck,omitempty"` -} - -// ApplicationGatewaysClientBeginBackendHealthOnDemandOptions contains the optional parameters for the ApplicationGatewaysClient.BeginBackendHealthOnDemand -// method. -type ApplicationGatewaysClientBeginBackendHealthOnDemandOptions struct { - // Expands BackendAddressPool and BackendHttpSettings referenced in backend health. - Expand *string - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ApplicationGatewaysClientBeginBackendHealthOptions contains the optional parameters for the ApplicationGatewaysClient.BeginBackendHealth -// method. -type ApplicationGatewaysClientBeginBackendHealthOptions struct { - // Expands BackendAddressPool and BackendHttpSettings referenced in backend health. - Expand *string - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ApplicationGatewaysClientBeginCreateOrUpdateOptions contains the optional parameters for the ApplicationGatewaysClient.BeginCreateOrUpdate -// method. -type ApplicationGatewaysClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ApplicationGatewaysClientBeginDeleteOptions contains the optional parameters for the ApplicationGatewaysClient.BeginDelete -// method. -type ApplicationGatewaysClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ApplicationGatewaysClientBeginStartOptions contains the optional parameters for the ApplicationGatewaysClient.BeginStart -// method. -type ApplicationGatewaysClientBeginStartOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ApplicationGatewaysClientBeginStopOptions contains the optional parameters for the ApplicationGatewaysClient.BeginStop -// method. -type ApplicationGatewaysClientBeginStopOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ApplicationGatewaysClientGetOptions contains the optional parameters for the ApplicationGatewaysClient.Get method. -type ApplicationGatewaysClientGetOptions struct { - // placeholder for future optional parameters -} - -// ApplicationGatewaysClientGetSSLPredefinedPolicyOptions contains the optional parameters for the ApplicationGatewaysClient.GetSSLPredefinedPolicy -// method. -type ApplicationGatewaysClientGetSSLPredefinedPolicyOptions struct { - // placeholder for future optional parameters -} - -// ApplicationGatewaysClientListAllOptions contains the optional parameters for the ApplicationGatewaysClient.ListAll method. -type ApplicationGatewaysClientListAllOptions struct { - // placeholder for future optional parameters -} - -// ApplicationGatewaysClientListAvailableRequestHeadersOptions contains the optional parameters for the ApplicationGatewaysClient.ListAvailableRequestHeaders -// method. -type ApplicationGatewaysClientListAvailableRequestHeadersOptions struct { - // placeholder for future optional parameters -} - -// ApplicationGatewaysClientListAvailableResponseHeadersOptions contains the optional parameters for the ApplicationGatewaysClient.ListAvailableResponseHeaders -// method. -type ApplicationGatewaysClientListAvailableResponseHeadersOptions struct { - // placeholder for future optional parameters -} - -// ApplicationGatewaysClientListAvailableSSLOptionsOptions contains the optional parameters for the ApplicationGatewaysClient.ListAvailableSSLOptions -// method. -type ApplicationGatewaysClientListAvailableSSLOptionsOptions struct { - // placeholder for future optional parameters -} - -// ApplicationGatewaysClientListAvailableSSLPredefinedPoliciesOptions contains the optional parameters for the ApplicationGatewaysClient.ListAvailableSSLPredefinedPolicies -// method. -type ApplicationGatewaysClientListAvailableSSLPredefinedPoliciesOptions struct { - // placeholder for future optional parameters -} - -// ApplicationGatewaysClientListAvailableServerVariablesOptions contains the optional parameters for the ApplicationGatewaysClient.ListAvailableServerVariables -// method. -type ApplicationGatewaysClientListAvailableServerVariablesOptions struct { - // placeholder for future optional parameters -} - -// ApplicationGatewaysClientListAvailableWafRuleSetsOptions contains the optional parameters for the ApplicationGatewaysClient.ListAvailableWafRuleSets -// method. -type ApplicationGatewaysClientListAvailableWafRuleSetsOptions struct { - // placeholder for future optional parameters -} - -// ApplicationGatewaysClientListOptions contains the optional parameters for the ApplicationGatewaysClient.List method. -type ApplicationGatewaysClientListOptions struct { - // placeholder for future optional parameters -} - -// ApplicationGatewaysClientUpdateTagsOptions contains the optional parameters for the ApplicationGatewaysClient.UpdateTags -// method. -type ApplicationGatewaysClientUpdateTagsOptions struct { - // placeholder for future optional parameters -} - -// ApplicationRule - Rule of type application. -type ApplicationRule struct { - // REQUIRED; Rule Type. - RuleType *FirewallPolicyRuleType `json:"ruleType,omitempty"` - - // Description of the rule. - Description *string `json:"description,omitempty"` - - // List of destination IP addresses or Service Tags. - DestinationAddresses []*string `json:"destinationAddresses,omitempty"` - - // List of FQDN Tags for this rule. - FqdnTags []*string `json:"fqdnTags,omitempty"` - - // Name of the rule. - Name *string `json:"name,omitempty"` - - // Array of Application Protocols. - Protocols []*FirewallPolicyRuleApplicationProtocol `json:"protocols,omitempty"` - - // List of source IP addresses for this rule. - SourceAddresses []*string `json:"sourceAddresses,omitempty"` - - // List of source IpGroups for this rule. - SourceIPGroups []*string `json:"sourceIpGroups,omitempty"` - - // List of FQDNs for this rule. - TargetFqdns []*string `json:"targetFqdns,omitempty"` - - // List of Urls for this rule condition. - TargetUrls []*string `json:"targetUrls,omitempty"` - - // Terminate TLS connections for this rule. - TerminateTLS *bool `json:"terminateTLS,omitempty"` - - // List of destination azure web categories. - WebCategories []*string `json:"webCategories,omitempty"` -} - -// GetFirewallPolicyRule implements the FirewallPolicyRuleClassification interface for type ApplicationRule. -func (a *ApplicationRule) GetFirewallPolicyRule() *FirewallPolicyRule { - return &FirewallPolicyRule{ - Name: a.Name, - Description: a.Description, - RuleType: a.RuleType, - } -} - -// ApplicationSecurityGroup - An application security group in a resource group. -type ApplicationSecurityGroup struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Resource location. - Location *string `json:"location,omitempty"` - - // Properties of the application security group. - Properties *ApplicationSecurityGroupPropertiesFormat `json:"properties,omitempty"` - - // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ApplicationSecurityGroupListResult - A list of application security groups. -type ApplicationSecurityGroupListResult struct { - // A list of application security groups. - Value []*ApplicationSecurityGroup `json:"value,omitempty"` - - // READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` -} - -// ApplicationSecurityGroupPropertiesFormat - Application security group properties. -type ApplicationSecurityGroupPropertiesFormat struct { - // READ-ONLY; The provisioning state of the application security group resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` - - // READ-ONLY; The resource GUID property of the application security group resource. It uniquely identifies a resource, even - // if the user changes its name or migrate the resource across subscriptions or resource - // groups. - ResourceGUID *string `json:"resourceGuid,omitempty" azure:"ro"` -} - -// ApplicationSecurityGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the ApplicationSecurityGroupsClient.BeginCreateOrUpdate -// method. -type ApplicationSecurityGroupsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ApplicationSecurityGroupsClientBeginDeleteOptions contains the optional parameters for the ApplicationSecurityGroupsClient.BeginDelete -// method. -type ApplicationSecurityGroupsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ApplicationSecurityGroupsClientGetOptions contains the optional parameters for the ApplicationSecurityGroupsClient.Get -// method. -type ApplicationSecurityGroupsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ApplicationSecurityGroupsClientListAllOptions contains the optional parameters for the ApplicationSecurityGroupsClient.ListAll -// method. -type ApplicationSecurityGroupsClientListAllOptions struct { - // placeholder for future optional parameters -} - -// ApplicationSecurityGroupsClientListOptions contains the optional parameters for the ApplicationSecurityGroupsClient.List -// method. -type ApplicationSecurityGroupsClientListOptions struct { - // placeholder for future optional parameters -} - -// ApplicationSecurityGroupsClientUpdateTagsOptions contains the optional parameters for the ApplicationSecurityGroupsClient.UpdateTags -// method. -type ApplicationSecurityGroupsClientUpdateTagsOptions struct { - // placeholder for future optional parameters -} - -// AuthorizationListResult - Response for ListAuthorizations API service call retrieves all authorizations that belongs to -// an ExpressRouteCircuit. -type AuthorizationListResult struct { - // The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` - - // The authorizations in an ExpressRoute Circuit. - Value []*ExpressRouteCircuitAuthorization `json:"value,omitempty"` -} - -// AuthorizationPropertiesFormat - Properties of ExpressRouteCircuitAuthorization. -type AuthorizationPropertiesFormat struct { - // The authorization key. - AuthorizationKey *string `json:"authorizationKey,omitempty"` - - // The authorization use status. - AuthorizationUseStatus *AuthorizationUseStatus `json:"authorizationUseStatus,omitempty"` - - // READ-ONLY; The provisioning state of the authorization resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// AutoApprovedPrivateLinkService - The information of an AutoApprovedPrivateLinkService. -type AutoApprovedPrivateLinkService struct { - // The id of the private link service resource. - PrivateLinkService *string `json:"privateLinkService,omitempty"` -} - -// AutoApprovedPrivateLinkServicesResult - An array of private link service id that can be linked to a private end point with -// auto approved. -type AutoApprovedPrivateLinkServicesResult struct { - // An array of auto approved private link service. - Value []*AutoApprovedPrivateLinkService `json:"value,omitempty"` - - // READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` -} - -// Availability of the metric. -type Availability struct { - // Duration of the availability blob. - BlobDuration *string `json:"blobDuration,omitempty"` - - // The retention of the availability. - Retention *string `json:"retention,omitempty"` - - // The time grain of the availability. - TimeGrain *string `json:"timeGrain,omitempty"` -} - -// AvailableDelegation - The serviceName of an AvailableDelegation indicates a possible delegation for a subnet. -type AvailableDelegation struct { - // The actions permitted to the service upon delegation. - Actions []*string `json:"actions,omitempty"` - - // A unique identifier of the AvailableDelegation resource. - ID *string `json:"id,omitempty"` - - // The name of the AvailableDelegation resource. - Name *string `json:"name,omitempty"` - - // The name of the service and resource. - ServiceName *string `json:"serviceName,omitempty"` - - // Resource type. - Type *string `json:"type,omitempty"` -} - -// AvailableDelegationsClientListOptions contains the optional parameters for the AvailableDelegationsClient.List method. -type AvailableDelegationsClientListOptions struct { - // placeholder for future optional parameters -} - -// AvailableDelegationsResult - An array of available delegations. -type AvailableDelegationsResult struct { - // An array of available delegations. - Value []*AvailableDelegation `json:"value,omitempty"` - - // READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` -} - -// AvailableEndpointServicesClientListOptions contains the optional parameters for the AvailableEndpointServicesClient.List -// method. -type AvailableEndpointServicesClientListOptions struct { - // placeholder for future optional parameters -} - -// AvailablePrivateEndpointType - The information of an AvailablePrivateEndpointType. -type AvailablePrivateEndpointType struct { - // Display name of the resource. - DisplayName *string `json:"displayName,omitempty"` - - // A unique identifier of the AvailablePrivateEndpoint Type resource. - ID *string `json:"id,omitempty"` - - // The name of the service and resource. - Name *string `json:"name,omitempty"` - - // The name of the service and resource. - ResourceName *string `json:"resourceName,omitempty"` - - // Resource type. - Type *string `json:"type,omitempty"` -} - -// AvailablePrivateEndpointTypesClientListByResourceGroupOptions contains the optional parameters for the AvailablePrivateEndpointTypesClient.ListByResourceGroup -// method. -type AvailablePrivateEndpointTypesClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// AvailablePrivateEndpointTypesClientListOptions contains the optional parameters for the AvailablePrivateEndpointTypesClient.List -// method. -type AvailablePrivateEndpointTypesClientListOptions struct { - // placeholder for future optional parameters -} - -// AvailablePrivateEndpointTypesResult - An array of available PrivateEndpoint types. -type AvailablePrivateEndpointTypesResult struct { - // An array of available privateEndpoint type. - Value []*AvailablePrivateEndpointType `json:"value,omitempty"` - - // READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` -} - -// AvailableProvidersList - List of available countries with details. -type AvailableProvidersList struct { - // REQUIRED; List of available countries. - Countries []*AvailableProvidersListCountry `json:"countries,omitempty"` -} - -// AvailableProvidersListCity - City or town details. -type AvailableProvidersListCity struct { - // The city or town name. - CityName *string `json:"cityName,omitempty"` - - // A list of Internet service providers. - Providers []*string `json:"providers,omitempty"` -} - -// AvailableProvidersListCountry - Country details. -type AvailableProvidersListCountry struct { - // The country name. - CountryName *string `json:"countryName,omitempty"` - - // A list of Internet service providers. - Providers []*string `json:"providers,omitempty"` - - // List of available states in the country. - States []*AvailableProvidersListState `json:"states,omitempty"` -} - -// AvailableProvidersListParameters - Constraints that determine the list of available Internet service providers. -type AvailableProvidersListParameters struct { - // A list of Azure regions. - AzureLocations []*string `json:"azureLocations,omitempty"` - - // The city or town for available providers list. - City *string `json:"city,omitempty"` - - // The country for available providers list. - Country *string `json:"country,omitempty"` - - // The state for available providers list. - State *string `json:"state,omitempty"` -} - -// AvailableProvidersListState - State details. -type AvailableProvidersListState struct { - // List of available cities or towns in the state. - Cities []*AvailableProvidersListCity `json:"cities,omitempty"` - - // A list of Internet service providers. - Providers []*string `json:"providers,omitempty"` - - // The state name. - StateName *string `json:"stateName,omitempty"` -} - -// AvailableResourceGroupDelegationsClientListOptions contains the optional parameters for the AvailableResourceGroupDelegationsClient.List -// method. -type AvailableResourceGroupDelegationsClientListOptions struct { - // placeholder for future optional parameters -} - -// AvailableServiceAlias - The available service alias. -type AvailableServiceAlias struct { - // The ID of the service alias. - ID *string `json:"id,omitempty"` - - // The name of the service alias. - Name *string `json:"name,omitempty"` - - // The resource name of the service alias. - ResourceName *string `json:"resourceName,omitempty"` - - // The type of the resource. - Type *string `json:"type,omitempty"` -} - -// AvailableServiceAliasesClientListByResourceGroupOptions contains the optional parameters for the AvailableServiceAliasesClient.ListByResourceGroup -// method. -type AvailableServiceAliasesClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// AvailableServiceAliasesClientListOptions contains the optional parameters for the AvailableServiceAliasesClient.List method. -type AvailableServiceAliasesClientListOptions struct { - // placeholder for future optional parameters -} - -// AvailableServiceAliasesResult - An array of available service aliases. -type AvailableServiceAliasesResult struct { - // An array of available service aliases. - Value []*AvailableServiceAlias `json:"value,omitempty"` - - // READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` -} - -// 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 { - // Details of the error occurred during specified asynchronous operation. - Error *Error `json:"error,omitempty"` - - // Status of the Azure async operation. - Status *NetworkOperationStatus `json:"status,omitempty"` -} - -// AzureFirewall - Azure Firewall resource. -type AzureFirewall struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Resource location. - Location *string `json:"location,omitempty"` - - // Properties of the azure firewall. - Properties *AzureFirewallPropertiesFormat `json:"properties,omitempty"` - - // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` - - // A list of availability zones denoting where the resource needs to come from. - Zones []*string `json:"zones,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// AzureFirewallApplicationRule - Properties of an application rule. -type AzureFirewallApplicationRule struct { - // Description of the rule. - Description *string `json:"description,omitempty"` - - // List of FQDN Tags for this rule. - FqdnTags []*string `json:"fqdnTags,omitempty"` - - // Name of the application rule. - Name *string `json:"name,omitempty"` - - // Array of ApplicationRuleProtocols. - Protocols []*AzureFirewallApplicationRuleProtocol `json:"protocols,omitempty"` - - // List of source IP addresses for this rule. - SourceAddresses []*string `json:"sourceAddresses,omitempty"` - - // List of source IpGroups for this rule. - SourceIPGroups []*string `json:"sourceIpGroups,omitempty"` - - // List of FQDNs for this rule. - TargetFqdns []*string `json:"targetFqdns,omitempty"` -} - -// AzureFirewallApplicationRuleCollection - Application rule collection resource. -type AzureFirewallApplicationRuleCollection struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // The name of the resource that is unique within the Azure firewall. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - - // Properties of the azure firewall application rule collection. - Properties *AzureFirewallApplicationRuleCollectionPropertiesFormat `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` -} - -// AzureFirewallApplicationRuleCollectionPropertiesFormat - Properties of the application rule collection. -type AzureFirewallApplicationRuleCollectionPropertiesFormat struct { - // The action type of a rule collection. - Action *AzureFirewallRCAction `json:"action,omitempty"` - - // Priority of the application rule collection resource. - Priority *int32 `json:"priority,omitempty"` - - // Collection of rules used by a application rule collection. - Rules []*AzureFirewallApplicationRule `json:"rules,omitempty"` - - // READ-ONLY; The provisioning state of the application rule collection resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// AzureFirewallApplicationRuleProtocol - Properties of the application rule protocol. -type AzureFirewallApplicationRuleProtocol struct { - // Port number for the protocol, cannot be greater than 64000. This field is optional. - Port *int32 `json:"port,omitempty"` - - // Protocol type. - ProtocolType *AzureFirewallApplicationRuleProtocolType `json:"protocolType,omitempty"` -} - -// AzureFirewallFqdnTag - Azure Firewall FQDN Tag Resource. -type AzureFirewallFqdnTag struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Resource location. - Location *string `json:"location,omitempty"` - - // Properties of the azure firewall FQDN tag. - Properties *AzureFirewallFqdnTagPropertiesFormat `json:"properties,omitempty"` - - // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// AzureFirewallFqdnTagListResult - Response for ListAzureFirewallFqdnTags API service call. -type AzureFirewallFqdnTagListResult struct { - // URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` - - // List of Azure Firewall FQDN Tags in a resource group. - Value []*AzureFirewallFqdnTag `json:"value,omitempty"` -} - -// AzureFirewallFqdnTagPropertiesFormat - Azure Firewall FQDN Tag Properties. -type AzureFirewallFqdnTagPropertiesFormat struct { - // READ-ONLY; The name of this FQDN Tag. - FqdnTagName *string `json:"fqdnTagName,omitempty" azure:"ro"` - - // READ-ONLY; The provisioning state of the Azure firewall FQDN tag resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// AzureFirewallFqdnTagsClientListAllOptions contains the optional parameters for the AzureFirewallFqdnTagsClient.ListAll -// method. -type AzureFirewallFqdnTagsClientListAllOptions struct { - // placeholder for future optional parameters -} - -// AzureFirewallIPConfiguration - IP configuration of an Azure Firewall. -type AzureFirewallIPConfiguration struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // 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"` - - // Properties of the azure firewall IP configuration. - Properties *AzureFirewallIPConfigurationPropertiesFormat `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// AzureFirewallIPConfigurationPropertiesFormat - Properties of IP configuration of an Azure Firewall. -type AzureFirewallIPConfigurationPropertiesFormat struct { - // Reference to the PublicIP resource. This field is a mandatory input if subnet is not null. - PublicIPAddress *SubResource `json:"publicIPAddress,omitempty"` - - // Reference to the subnet resource. This resource must be named 'AzureFirewallSubnet' or 'AzureFirewallManagementSubnet'. - Subnet *SubResource `json:"subnet,omitempty"` - - // READ-ONLY; The Firewall Internal Load Balancer IP to be used as the next hop in User Defined Routes. - PrivateIPAddress *string `json:"privateIPAddress,omitempty" azure:"ro"` - - // READ-ONLY; The provisioning state of the Azure firewall IP configuration resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// AzureFirewallIPGroups - IpGroups associated with azure firewall. -type AzureFirewallIPGroups struct { - // READ-ONLY; The iteration number. - ChangeNumber *string `json:"changeNumber,omitempty" azure:"ro"` - - // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` -} - -// AzureFirewallListResult - Response for ListAzureFirewalls API service call. -type AzureFirewallListResult struct { - // URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` - - // List of Azure Firewalls in a resource group. - Value []*AzureFirewall `json:"value,omitempty"` -} - -// AzureFirewallNatRCAction - AzureFirewall NAT Rule Collection Action. -type AzureFirewallNatRCAction struct { - // The type of action. - Type *AzureFirewallNatRCActionType `json:"type,omitempty"` -} - -// AzureFirewallNatRule - Properties of a NAT rule. -type AzureFirewallNatRule struct { - // Description of the rule. - Description *string `json:"description,omitempty"` - - // List of destination IP addresses for this rule. Supports IP ranges, prefixes, and service tags. - DestinationAddresses []*string `json:"destinationAddresses,omitempty"` - - // List of destination ports. - DestinationPorts []*string `json:"destinationPorts,omitempty"` - - // Name of the NAT rule. - Name *string `json:"name,omitempty"` - - // Array of AzureFirewallNetworkRuleProtocols applicable to this NAT rule. - Protocols []*AzureFirewallNetworkRuleProtocol `json:"protocols,omitempty"` - - // List of source IP addresses for this rule. - SourceAddresses []*string `json:"sourceAddresses,omitempty"` - - // List of source IpGroups for this rule. - SourceIPGroups []*string `json:"sourceIpGroups,omitempty"` - - // The translated address for this NAT rule. - TranslatedAddress *string `json:"translatedAddress,omitempty"` - - // The translated FQDN for this NAT rule. - TranslatedFqdn *string `json:"translatedFqdn,omitempty"` - - // The translated port for this NAT rule. - TranslatedPort *string `json:"translatedPort,omitempty"` -} - -// AzureFirewallNatRuleCollection - NAT rule collection resource. -type AzureFirewallNatRuleCollection struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // The name of the resource that is unique within the Azure firewall. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - - // Properties of the azure firewall NAT rule collection. - Properties *AzureFirewallNatRuleCollectionProperties `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` -} - -// AzureFirewallNatRuleCollectionProperties - Properties of the NAT rule collection. -type AzureFirewallNatRuleCollectionProperties struct { - // The action type of a NAT rule collection. - Action *AzureFirewallNatRCAction `json:"action,omitempty"` - - // Priority of the NAT rule collection resource. - Priority *int32 `json:"priority,omitempty"` - - // Collection of rules used by a NAT rule collection. - Rules []*AzureFirewallNatRule `json:"rules,omitempty"` - - // READ-ONLY; The provisioning state of the NAT rule collection resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// AzureFirewallNetworkRule - Properties of the network rule. -type AzureFirewallNetworkRule struct { - // Description of the rule. - Description *string `json:"description,omitempty"` - - // List of destination IP addresses. - DestinationAddresses []*string `json:"destinationAddresses,omitempty"` - - // List of destination FQDNs. - DestinationFqdns []*string `json:"destinationFqdns,omitempty"` - - // List of destination IpGroups for this rule. - DestinationIPGroups []*string `json:"destinationIpGroups,omitempty"` - - // List of destination ports. - DestinationPorts []*string `json:"destinationPorts,omitempty"` - - // Name of the network rule. - Name *string `json:"name,omitempty"` - - // Array of AzureFirewallNetworkRuleProtocols. - Protocols []*AzureFirewallNetworkRuleProtocol `json:"protocols,omitempty"` - - // List of source IP addresses for this rule. - SourceAddresses []*string `json:"sourceAddresses,omitempty"` - - // List of source IpGroups for this rule. - SourceIPGroups []*string `json:"sourceIpGroups,omitempty"` -} - -// AzureFirewallNetworkRuleCollection - Network rule collection resource. -type AzureFirewallNetworkRuleCollection struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // The name of the resource that is unique within the Azure firewall. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - - // Properties of the azure firewall network rule collection. - Properties *AzureFirewallNetworkRuleCollectionPropertiesFormat `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` -} - -// AzureFirewallNetworkRuleCollectionPropertiesFormat - Properties of the network rule collection. -type AzureFirewallNetworkRuleCollectionPropertiesFormat struct { - // The action type of a rule collection. - Action *AzureFirewallRCAction `json:"action,omitempty"` - - // Priority of the network rule collection resource. - Priority *int32 `json:"priority,omitempty"` - - // Collection of rules used by a network rule collection. - Rules []*AzureFirewallNetworkRule `json:"rules,omitempty"` - - // READ-ONLY; The provisioning state of the network rule collection resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// AzureFirewallPropertiesFormat - Properties of the Azure Firewall. -type AzureFirewallPropertiesFormat struct { - // The additional properties used to further config this azure firewall. - AdditionalProperties map[string]*string `json:"additionalProperties,omitempty"` - - // Collection of application rule collections used by Azure Firewall. - ApplicationRuleCollections []*AzureFirewallApplicationRuleCollection `json:"applicationRuleCollections,omitempty"` - - // The firewallPolicy associated with this azure firewall. - FirewallPolicy *SubResource `json:"firewallPolicy,omitempty"` - - // IP addresses associated with AzureFirewall. - HubIPAddresses *HubIPAddresses `json:"hubIPAddresses,omitempty"` - - // IP configuration of the Azure Firewall resource. - IPConfigurations []*AzureFirewallIPConfiguration `json:"ipConfigurations,omitempty"` - - // IP configuration of the Azure Firewall used for management traffic. - ManagementIPConfiguration *AzureFirewallIPConfiguration `json:"managementIpConfiguration,omitempty"` - - // Collection of NAT rule collections used by Azure Firewall. - NatRuleCollections []*AzureFirewallNatRuleCollection `json:"natRuleCollections,omitempty"` - - // Collection of network rule collections used by Azure Firewall. - NetworkRuleCollections []*AzureFirewallNetworkRuleCollection `json:"networkRuleCollections,omitempty"` - - // The Azure Firewall Resource SKU. - SKU *AzureFirewallSKU `json:"sku,omitempty"` - - // The operation mode for Threat Intelligence. - ThreatIntelMode *AzureFirewallThreatIntelMode `json:"threatIntelMode,omitempty"` - - // The virtualHub to which the firewall belongs. - VirtualHub *SubResource `json:"virtualHub,omitempty"` - - // READ-ONLY; IpGroups associated with AzureFirewall. - IPGroups []*AzureFirewallIPGroups `json:"ipGroups,omitempty" azure:"ro"` - - // READ-ONLY; The provisioning state of the Azure firewall resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// AzureFirewallPublicIPAddress - Public IP Address associated with azure firewall. -type AzureFirewallPublicIPAddress struct { - // Public IP Address value. - Address *string `json:"address,omitempty"` -} - -// AzureFirewallRCAction - Properties of the AzureFirewallRCAction. -type AzureFirewallRCAction struct { - // The type of action. - Type *AzureFirewallRCActionType `json:"type,omitempty"` -} - -// AzureFirewallSKU - SKU of an Azure Firewall. -type AzureFirewallSKU struct { - // Name of an Azure Firewall SKU. - Name *AzureFirewallSKUName `json:"name,omitempty"` - - // Tier of an Azure Firewall. - Tier *AzureFirewallSKUTier `json:"tier,omitempty"` -} - -// AzureFirewallsClientBeginCreateOrUpdateOptions contains the optional parameters for the AzureFirewallsClient.BeginCreateOrUpdate -// method. -type AzureFirewallsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// AzureFirewallsClientBeginDeleteOptions contains the optional parameters for the AzureFirewallsClient.BeginDelete method. -type AzureFirewallsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// AzureFirewallsClientBeginListLearnedPrefixesOptions contains the optional parameters for the AzureFirewallsClient.BeginListLearnedPrefixes -// method. -type AzureFirewallsClientBeginListLearnedPrefixesOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// AzureFirewallsClientBeginUpdateTagsOptions contains the optional parameters for the AzureFirewallsClient.BeginUpdateTags -// method. -type AzureFirewallsClientBeginUpdateTagsOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// AzureFirewallsClientGetOptions contains the optional parameters for the AzureFirewallsClient.Get method. -type AzureFirewallsClientGetOptions struct { - // placeholder for future optional parameters -} - -// AzureFirewallsClientListAllOptions contains the optional parameters for the AzureFirewallsClient.ListAll method. -type AzureFirewallsClientListAllOptions struct { - // placeholder for future optional parameters -} - -// AzureFirewallsClientListOptions contains the optional parameters for the AzureFirewallsClient.List method. -type AzureFirewallsClientListOptions struct { - // placeholder for future optional parameters -} - -// AzureReachabilityReport - Azure reachability report details. -type AzureReachabilityReport struct { - // REQUIRED; The aggregation level of Azure reachability report. Can be Country, State or City. - AggregationLevel *string `json:"aggregationLevel,omitempty"` - - // REQUIRED; Parameters that define a geographic location. - ProviderLocation *AzureReachabilityReportLocation `json:"providerLocation,omitempty"` - - // REQUIRED; List of Azure reachability report items. - ReachabilityReport []*AzureReachabilityReportItem `json:"reachabilityReport,omitempty"` -} - -// AzureReachabilityReportItem - Azure reachability report details for a given provider location. -type AzureReachabilityReportItem struct { - // The Azure region. - AzureLocation *string `json:"azureLocation,omitempty"` - - // List of latency details for each of the time series. - Latencies []*AzureReachabilityReportLatencyInfo `json:"latencies,omitempty"` - - // The Internet service provider. - Provider *string `json:"provider,omitempty"` -} - -// AzureReachabilityReportLatencyInfo - Details on latency for a time series. -type AzureReachabilityReportLatencyInfo struct { - // The relative latency score between 1 and 100, higher values indicating a faster connection. - Score *int32 `json:"score,omitempty"` - - // The time stamp. - TimeStamp *time.Time `json:"timeStamp,omitempty"` -} - -// AzureReachabilityReportLocation - Parameters that define a geographic location. -type AzureReachabilityReportLocation struct { - // REQUIRED; The name of the country. - Country *string `json:"country,omitempty"` - - // The name of the city or town. - City *string `json:"city,omitempty"` - - // The name of the state. - State *string `json:"state,omitempty"` -} - -// AzureReachabilityReportParameters - Geographic and time constraints for Azure reachability report. -type AzureReachabilityReportParameters struct { - // REQUIRED; The end time for the Azure reachability report. - EndTime *time.Time `json:"endTime,omitempty"` - - // REQUIRED; Parameters that define a geographic location. - ProviderLocation *AzureReachabilityReportLocation `json:"providerLocation,omitempty"` - - // REQUIRED; The start time for the Azure reachability report. - StartTime *time.Time `json:"startTime,omitempty"` - - // Optional Azure regions to scope the query to. - AzureLocations []*string `json:"azureLocations,omitempty"` - - // List of Internet service providers. - Providers []*string `json:"providers,omitempty"` -} - -// AzureWebCategory - Azure Web Category Resource. -type AzureWebCategory struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Properties of the Azure Web Category. - Properties *AzureWebCategoryPropertiesFormat `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// AzureWebCategoryListResult - Response for ListAzureWebCategories API service call. -type AzureWebCategoryListResult struct { - // URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` - - // List of Azure Web Categories for a given Subscription. - Value []*AzureWebCategory `json:"value,omitempty"` -} - -// AzureWebCategoryPropertiesFormat - Azure Web Category Properties. -type AzureWebCategoryPropertiesFormat struct { - // READ-ONLY; The name of the group that the category belongs to. - Group *string `json:"group,omitempty" azure:"ro"` -} - -// BGPCommunity - Contains bgp community information offered in Service Community resources. -type BGPCommunity struct { - // The name of the bgp community. e.g. Skype. - CommunityName *string `json:"communityName,omitempty"` - - // The prefixes that the bgp community contains. - CommunityPrefixes []*string `json:"communityPrefixes,omitempty"` - - // The value of the bgp community. For more information: https://docs.microsoft.com/en-us/azure/expressroute/expressroute-routing. - CommunityValue *string `json:"communityValue,omitempty"` - - // Customer is authorized to use bgp community or not. - IsAuthorizedToUse *bool `json:"isAuthorizedToUse,omitempty"` - - // The service group of the bgp community contains. - ServiceGroup *string `json:"serviceGroup,omitempty"` - - // The region which the service support. e.g. For O365, region is Global. - ServiceSupportedRegion *string `json:"serviceSupportedRegion,omitempty"` -} - -// BackendAddressInboundNatRulePortMappings - The response for a QueryInboundNatRulePortMapping API. -type BackendAddressInboundNatRulePortMappings struct { - // Collection of inbound NAT rule port mappings. - InboundNatRulePortMappings []*InboundNatRulePortMapping `json:"inboundNatRulePortMappings,omitempty"` -} - -// BackendAddressPool - Pool of backend IP addresses. -type BackendAddressPool struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // The name of the resource that is unique within the set of backend address pools used by the load balancer. This name can - // be used to access the resource. - Name *string `json:"name,omitempty"` - - // Properties of load balancer backend address pool. - Properties *BackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// BackendAddressPoolPropertiesFormat - Properties of the backend address pool. -type BackendAddressPoolPropertiesFormat struct { - // Amount of seconds Load Balancer waits for before sending RESET to client and backend address. - DrainPeriodInSeconds *int32 `json:"drainPeriodInSeconds,omitempty"` - - // An array of backend addresses. - LoadBalancerBackendAddresses []*LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - - // The location of the backend address pool. - Location *string `json:"location,omitempty"` - - // An array of gateway load balancer tunnel interfaces. - TunnelInterfaces []*GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` - - // READ-ONLY; An array of references to IP addresses defined in network interfaces. - BackendIPConfigurations []*InterfaceIPConfiguration `json:"backendIPConfigurations,omitempty" azure:"ro"` - - // READ-ONLY; An array of references to inbound NAT rules that use this backend address pool. - InboundNatRules []*SubResource `json:"inboundNatRules,omitempty" azure:"ro"` - - // READ-ONLY; An array of references to load balancing rules that use this backend address pool. - LoadBalancingRules []*SubResource `json:"loadBalancingRules,omitempty" azure:"ro"` - - // READ-ONLY; A reference to an outbound rule that uses this backend address pool. - OutboundRule *SubResource `json:"outboundRule,omitempty" azure:"ro"` - - // READ-ONLY; An array of references to outbound rules that use this backend address pool. - OutboundRules []*SubResource `json:"outboundRules,omitempty" azure:"ro"` - - // READ-ONLY; The provisioning state of the backend address pool resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// BaseAdminRuleClassification provides polymorphic access to related types. -// Call the interface's GetBaseAdminRule() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AdminRule, *BaseAdminRule, *DefaultAdminRule -type BaseAdminRuleClassification interface { - // GetBaseAdminRule returns the BaseAdminRule content of the underlying type. - GetBaseAdminRule() *BaseAdminRule -} - -// BaseAdminRule - Network base admin rule. -type BaseAdminRule struct { - // REQUIRED; Whether the rule is custom or default. - Kind *AdminRuleKind `json:"kind,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; The system metadata related to this resource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// GetBaseAdminRule implements the BaseAdminRuleClassification interface for type BaseAdminRule. -func (b *BaseAdminRule) GetBaseAdminRule() *BaseAdminRule { return b } - -// BastionActiveSession - The session detail for a target. -type BastionActiveSession struct { - // READ-ONLY; The protocol used to connect to the target. - Protocol *BastionConnectProtocol `json:"protocol,omitempty" azure:"ro"` - - // READ-ONLY; The type of the resource. - ResourceType *string `json:"resourceType,omitempty" azure:"ro"` - - // READ-ONLY; Duration in mins the session has been active. - SessionDurationInMins *float32 `json:"sessionDurationInMins,omitempty" azure:"ro"` - - // READ-ONLY; A unique id for the session. - SessionID *string `json:"sessionId,omitempty" azure:"ro"` - - // READ-ONLY; The time when the session started. - StartTime interface{} `json:"startTime,omitempty" azure:"ro"` - - // READ-ONLY; The host name of the target. - TargetHostName *string `json:"targetHostName,omitempty" azure:"ro"` - - // READ-ONLY; The IP Address of the target. - TargetIPAddress *string `json:"targetIpAddress,omitempty" azure:"ro"` - - // READ-ONLY; The resource group of the target. - TargetResourceGroup *string `json:"targetResourceGroup,omitempty" azure:"ro"` - - // READ-ONLY; The resource id of the target. - TargetResourceID *string `json:"targetResourceId,omitempty" azure:"ro"` - - // READ-ONLY; The subscription id for the target virtual machine. - TargetSubscriptionID *string `json:"targetSubscriptionId,omitempty" azure:"ro"` - - // READ-ONLY; The user name who is active on this session. - UserName *string `json:"userName,omitempty" azure:"ro"` -} - -// BastionActiveSessionListResult - Response for GetActiveSessions. -type BastionActiveSessionListResult struct { - // The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` - - // List of active sessions on the bastion. - Value []*BastionActiveSession `json:"value,omitempty"` -} - -// BastionHost - Bastion Host resource. -type BastionHost struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Resource location. - Location *string `json:"location,omitempty"` - - // Represents the bastion host resource. - Properties *BastionHostPropertiesFormat `json:"properties,omitempty"` - - // The sku of this Bastion Host. - SKU *SKU `json:"sku,omitempty"` - - // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// BastionHostIPConfiguration - IP configuration of an Bastion Host. -type BastionHostIPConfiguration struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // 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"` - - // Represents the ip configuration associated with the resource. - Properties *BastionHostIPConfigurationPropertiesFormat `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Ip configuration type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// BastionHostIPConfigurationPropertiesFormat - Properties of IP configuration of an Bastion Host. -type BastionHostIPConfigurationPropertiesFormat struct { - // REQUIRED; Reference of the PublicIP resource. - PublicIPAddress *SubResource `json:"publicIPAddress,omitempty"` - - // REQUIRED; Reference of the subnet resource. - Subnet *SubResource `json:"subnet,omitempty"` - - // Private IP allocation method. - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - - // READ-ONLY; The provisioning state of the bastion host IP configuration resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// BastionHostListResult - Response for ListBastionHosts API service call. -type BastionHostListResult struct { - // URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` - - // List of Bastion Hosts in a resource group. - Value []*BastionHost `json:"value,omitempty"` -} - -// BastionHostPropertiesFormat - Properties of the Bastion Host. -type BastionHostPropertiesFormat struct { - // FQDN for the endpoint on which bastion host is accessible. - DNSName *string `json:"dnsName,omitempty"` - - // Enable/Disable Copy/Paste feature of the Bastion Host resource. - DisableCopyPaste *bool `json:"disableCopyPaste,omitempty"` - - // Enable/Disable File Copy feature of the Bastion Host resource. - EnableFileCopy *bool `json:"enableFileCopy,omitempty"` - - // Enable/Disable IP Connect feature of the Bastion Host resource. - EnableIPConnect *bool `json:"enableIpConnect,omitempty"` - - // Enable/Disable Shareable Link of the Bastion Host resource. - EnableShareableLink *bool `json:"enableShareableLink,omitempty"` - - // Enable/Disable Tunneling feature of the Bastion Host resource. - EnableTunneling *bool `json:"enableTunneling,omitempty"` - - // IP configuration of the Bastion Host resource. - IPConfigurations []*BastionHostIPConfiguration `json:"ipConfigurations,omitempty"` - - // The scale units for the Bastion Host resource. - ScaleUnits *int32 `json:"scaleUnits,omitempty"` - - // READ-ONLY; The provisioning state of the bastion host resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// BastionHostsClientBeginCreateOrUpdateOptions contains the optional parameters for the BastionHostsClient.BeginCreateOrUpdate -// method. -type BastionHostsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// BastionHostsClientBeginDeleteOptions contains the optional parameters for the BastionHostsClient.BeginDelete method. -type BastionHostsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// BastionHostsClientBeginUpdateTagsOptions contains the optional parameters for the BastionHostsClient.BeginUpdateTags method. -type BastionHostsClientBeginUpdateTagsOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// BastionHostsClientGetOptions contains the optional parameters for the BastionHostsClient.Get method. -type BastionHostsClientGetOptions struct { - // placeholder for future optional parameters -} - -// BastionHostsClientListByResourceGroupOptions contains the optional parameters for the BastionHostsClient.ListByResourceGroup -// method. -type BastionHostsClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// BastionHostsClientListOptions contains the optional parameters for the BastionHostsClient.List method. -type BastionHostsClientListOptions struct { - // placeholder for future optional parameters -} - -// BastionSessionDeleteResult - Response for DisconnectActiveSessions. -type BastionSessionDeleteResult struct { - // The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` - - // List of sessions with their corresponding state. - Value []*BastionSessionState `json:"value,omitempty"` -} - -// BastionSessionState - The session state detail for a target. -type BastionSessionState struct { - // READ-ONLY; Used for extra information. - Message *string `json:"message,omitempty" azure:"ro"` - - // READ-ONLY; A unique id for the session. - SessionID *string `json:"sessionId,omitempty" azure:"ro"` - - // READ-ONLY; The state of the session. Disconnected/Failed/NotFound. - State *string `json:"state,omitempty" azure:"ro"` -} - -// BastionShareableLink - Bastion Shareable Link. -type BastionShareableLink struct { - // REQUIRED; Reference of the virtual machine resource. - VM *VM `json:"vm,omitempty"` - - // READ-ONLY; The unique Bastion Shareable Link to the virtual machine. - Bsl *string `json:"bsl,omitempty" azure:"ro"` - - // READ-ONLY; The time when the link was created. - CreatedAt *string `json:"createdAt,omitempty" azure:"ro"` - - // READ-ONLY; Optional field indicating the warning or error message related to the vm in case of partial failure. - Message *string `json:"message,omitempty" azure:"ro"` -} - -// BastionShareableLinkListRequest - Post request for all the Bastion Shareable Link endpoints. -type BastionShareableLinkListRequest struct { - // List of VM references. - VMs []*BastionShareableLink `json:"vms,omitempty"` -} - -// BastionShareableLinkListResult - Response for all the Bastion Shareable Link endpoints. -type BastionShareableLinkListResult struct { - // The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` - - // List of Bastion Shareable Links for the request. - Value []*BastionShareableLink `json:"value,omitempty"` -} - -// BgpConnection - Virtual Appliance Site resource. -type BgpConnection struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Name of the connection. - Name *string `json:"name,omitempty"` - - // The properties of the Bgp connections. - Properties *BgpConnectionProperties `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Connection type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// BgpConnectionProperties - Properties of the bgp connection. -type BgpConnectionProperties struct { - // The reference to the HubVirtualNetworkConnection resource. - HubVirtualNetworkConnection *SubResource `json:"hubVirtualNetworkConnection,omitempty"` - - // Peer ASN. - PeerAsn *int64 `json:"peerAsn,omitempty"` - - // Peer IP. - PeerIP *string `json:"peerIp,omitempty"` - - // READ-ONLY; The current state of the VirtualHub to Peer. - ConnectionState *HubBgpConnectionStatus `json:"connectionState,omitempty" azure:"ro"` - - // READ-ONLY; The provisioning state of the resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// BgpPeerStatus - BGP peer status details. -type BgpPeerStatus struct { - // READ-ONLY; The autonomous system number of the remote BGP peer. - Asn *int64 `json:"asn,omitempty" azure:"ro"` - - // READ-ONLY; For how long the peering has been up. - ConnectedDuration *string `json:"connectedDuration,omitempty" azure:"ro"` - - // READ-ONLY; The virtual network gateway's local address. - LocalAddress *string `json:"localAddress,omitempty" azure:"ro"` - - // READ-ONLY; The number of BGP messages received. - MessagesReceived *int64 `json:"messagesReceived,omitempty" azure:"ro"` - - // READ-ONLY; The number of BGP messages sent. - MessagesSent *int64 `json:"messagesSent,omitempty" azure:"ro"` - - // READ-ONLY; The remote BGP peer. - Neighbor *string `json:"neighbor,omitempty" azure:"ro"` - - // READ-ONLY; The number of routes learned from this peer. - RoutesReceived *int64 `json:"routesReceived,omitempty" azure:"ro"` - - // READ-ONLY; The BGP peer state. - State *BgpPeerState `json:"state,omitempty" azure:"ro"` -} - -// BgpPeerStatusListResult - Response for list BGP peer status API service call. -type BgpPeerStatusListResult struct { - // List of BGP peers. - Value []*BgpPeerStatus `json:"value,omitempty"` -} - -// BgpServiceCommunitiesClientListOptions contains the optional parameters for the BgpServiceCommunitiesClient.List method. -type BgpServiceCommunitiesClientListOptions struct { - // placeholder for future optional parameters -} - -// BgpServiceCommunity - Service Community Properties. -type BgpServiceCommunity struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Resource location. - Location *string `json:"location,omitempty"` - - // Properties of the BGP service community. - Properties *BgpServiceCommunityPropertiesFormat `json:"properties,omitempty"` - - // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// BgpServiceCommunityListResult - Response for the ListServiceCommunity API service call. -type BgpServiceCommunityListResult struct { - // The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` - - // A list of service community resources. - Value []*BgpServiceCommunity `json:"value,omitempty"` -} - -// BgpServiceCommunityPropertiesFormat - Properties of Service Community. -type BgpServiceCommunityPropertiesFormat struct { - // A list of bgp communities. - BgpCommunities []*BGPCommunity `json:"bgpCommunities,omitempty"` - - // The name of the bgp community. e.g. Skype. - ServiceName *string `json:"serviceName,omitempty"` -} - -// BgpSettings - BGP settings details. -type BgpSettings struct { - // The BGP speaker's ASN. - Asn *int64 `json:"asn,omitempty"` - - // The BGP peering address and BGP identifier of this BGP speaker. - BgpPeeringAddress *string `json:"bgpPeeringAddress,omitempty"` - - // BGP peering address with IP configuration ID for virtual network gateway. - BgpPeeringAddresses []*IPConfigurationBgpPeeringAddress `json:"bgpPeeringAddresses,omitempty"` - - // The weight added to routes learned from this BGP speaker. - PeerWeight *int32 `json:"peerWeight,omitempty"` -} - -// BreakOutCategoryPolicies - Network Virtual Appliance Sku Properties. -type BreakOutCategoryPolicies struct { - // Flag to control breakout of o365 allow category. - Allow *bool `json:"allow,omitempty"` - - // Flag to control breakout of o365 default category. - Default *bool `json:"default,omitempty"` - - // Flag to control breakout of o365 optimize category. - Optimize *bool `json:"optimize,omitempty"` -} - -// CheckPrivateLinkServiceVisibilityRequest - Request body of the CheckPrivateLinkServiceVisibility API service call. -type CheckPrivateLinkServiceVisibilityRequest struct { - // The alias of the private link service. - PrivateLinkServiceAlias *string `json:"privateLinkServiceAlias,omitempty"` -} - -// ChildResource - Proxy resource representation. -type ChildResource struct { - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// CloudError - An error response from the service. -type CloudError struct { - // Cloud error body. - Error *CloudErrorBody `json:"error,omitempty"` -} - -// CloudErrorBody - An error response from the service. -type CloudErrorBody struct { - // An identifier for the error. Codes are invariant and are intended to be consumed programmatically. - Code *string `json:"code,omitempty"` - - // A list of additional details about the error. - Details []*CloudErrorBody `json:"details,omitempty"` - - // A message describing the error, intended to be suitable for display in a user interface. - Message *string `json:"message,omitempty"` - - // The target of the particular error. For example, the name of the property in error. - Target *string `json:"target,omitempty"` -} - -type Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties struct { - // READ-ONLY; The client id of user assigned identity. - ClientID *string `json:"clientId,omitempty" azure:"ro"` - - // READ-ONLY; The principal id of user assigned identity. - PrincipalID *string `json:"principalId,omitempty" azure:"ro"` -} - -// ConfigurationDiagnosticParameters - Parameters to get network configuration diagnostic. -type ConfigurationDiagnosticParameters struct { - // REQUIRED; List of network configuration diagnostic profiles. - Profiles []*ConfigurationDiagnosticProfile `json:"profiles,omitempty"` - - // REQUIRED; The ID of the target resource to perform network configuration diagnostic. Valid options are VM, NetworkInterface, - // VMSS/NetworkInterface and Application Gateway. - TargetResourceID *string `json:"targetResourceId,omitempty"` - - // Verbosity level. - VerbosityLevel *VerbosityLevel `json:"verbosityLevel,omitempty"` -} - -// ConfigurationDiagnosticProfile - Parameters to compare with network configuration. -type ConfigurationDiagnosticProfile struct { - // REQUIRED; Traffic destination. Accepted values are: '*', IP Address/CIDR, Service Tag. - Destination *string `json:"destination,omitempty"` - - // REQUIRED; Traffic destination port. Accepted values are '*' and a single port in the range (0 - 65535). - DestinationPort *string `json:"destinationPort,omitempty"` - - // REQUIRED; The direction of the traffic. - Direction *Direction `json:"direction,omitempty"` - - // REQUIRED; Protocol to be verified on. Accepted values are '*', TCP, UDP. - Protocol *string `json:"protocol,omitempty"` - - // REQUIRED; Traffic source. Accepted values are '*', IP Address/CIDR, Service Tag. - Source *string `json:"source,omitempty"` -} - -// ConfigurationDiagnosticResponse - Results of network configuration diagnostic on the target resource. -type ConfigurationDiagnosticResponse struct { - // READ-ONLY; List of network configuration diagnostic results. - Results []*ConfigurationDiagnosticResult `json:"results,omitempty" azure:"ro"` -} - -// ConfigurationDiagnosticResult - Network configuration diagnostic result corresponded to provided traffic query. -type ConfigurationDiagnosticResult struct { - // Network security group result. - NetworkSecurityGroupResult *SecurityGroupResult `json:"networkSecurityGroupResult,omitempty"` - - // Network configuration diagnostic profile. - Profile *ConfigurationDiagnosticProfile `json:"profile,omitempty"` -} - -// ConfigurationGroup - The network configuration group resource -type ConfigurationGroup struct { - // Network group ID. - ID *string `json:"id,omitempty"` - - // The network configuration group properties - Properties *GroupProperties `json:"properties,omitempty"` -} - -// ConfigurationPolicyGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the ConfigurationPolicyGroupsClient.BeginCreateOrUpdate -// method. -type ConfigurationPolicyGroupsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ConfigurationPolicyGroupsClientBeginDeleteOptions contains the optional parameters for the ConfigurationPolicyGroupsClient.BeginDelete -// method. -type ConfigurationPolicyGroupsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ConfigurationPolicyGroupsClientGetOptions contains the optional parameters for the ConfigurationPolicyGroupsClient.Get -// method. -type ConfigurationPolicyGroupsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ConfigurationPolicyGroupsClientListByVPNServerConfigurationOptions contains the optional parameters for the ConfigurationPolicyGroupsClient.ListByVPNServerConfiguration -// method. -type ConfigurationPolicyGroupsClientListByVPNServerConfigurationOptions struct { - // placeholder for future optional parameters -} - -// ConnectionMonitor - Parameters that define the operation to create a connection monitor. -type ConnectionMonitor struct { - // REQUIRED; Properties of the connection monitor. - Properties *ConnectionMonitorParameters `json:"properties,omitempty"` - - // Connection monitor location. - Location *string `json:"location,omitempty"` - - // Connection monitor tags. - Tags map[string]*string `json:"tags,omitempty"` -} - -// ConnectionMonitorDestination - Describes the destination of connection monitor. -type ConnectionMonitorDestination struct { - // Address of the connection monitor destination (IP or domain name). - Address *string `json:"address,omitempty"` - - // The destination port used by connection monitor. - Port *int32 `json:"port,omitempty"` - - // The ID of the resource used as the destination by connection monitor. - ResourceID *string `json:"resourceId,omitempty"` -} - -// ConnectionMonitorEndpoint - Describes the connection monitor endpoint. -type ConnectionMonitorEndpoint struct { - // REQUIRED; The name of the connection monitor endpoint. - Name *string `json:"name,omitempty"` - - // Address of the connection monitor endpoint (IP or domain name). - Address *string `json:"address,omitempty"` - - // Test coverage for the endpoint. - CoverageLevel *CoverageLevel `json:"coverageLevel,omitempty"` - - // Filter for sub-items within the endpoint. - Filter *ConnectionMonitorEndpointFilter `json:"filter,omitempty"` - - // Resource ID of the connection monitor endpoint. - ResourceID *string `json:"resourceId,omitempty"` - - // Endpoint scope. - Scope *ConnectionMonitorEndpointScope `json:"scope,omitempty"` - - // The endpoint type. - Type *EndpointType `json:"type,omitempty"` -} - -// ConnectionMonitorEndpointFilter - Describes the connection monitor endpoint filter. -type ConnectionMonitorEndpointFilter struct { - // List of items in the filter. - Items []*ConnectionMonitorEndpointFilterItem `json:"items,omitempty"` - - // The behavior of the endpoint filter. Currently only 'Include' is supported. - Type *ConnectionMonitorEndpointFilterType `json:"type,omitempty"` -} - -// ConnectionMonitorEndpointFilterItem - Describes the connection monitor endpoint filter item. -type ConnectionMonitorEndpointFilterItem struct { - // The address of the filter item. - Address *string `json:"address,omitempty"` - - // The type of item included in the filter. Currently only 'AgentAddress' is supported. - Type *ConnectionMonitorEndpointFilterItemType `json:"type,omitempty"` -} - -// ConnectionMonitorEndpointScope - Describes the connection monitor endpoint scope. -type ConnectionMonitorEndpointScope struct { - // List of items which needs to be excluded from the endpoint scope. - Exclude []*ConnectionMonitorEndpointScopeItem `json:"exclude,omitempty"` - - // List of items which needs to be included to the endpoint scope. - Include []*ConnectionMonitorEndpointScopeItem `json:"include,omitempty"` -} - -// ConnectionMonitorEndpointScopeItem - Describes the connection monitor endpoint scope item. -type ConnectionMonitorEndpointScopeItem struct { - // The address of the endpoint item. Supported types are IPv4/IPv6 subnet mask or IPv4/IPv6 IP address. - Address *string `json:"address,omitempty"` -} - -// ConnectionMonitorHTTPConfiguration - Describes the HTTP configuration. -type ConnectionMonitorHTTPConfiguration struct { - // The HTTP method to use. - Method *HTTPConfigurationMethod `json:"method,omitempty"` - - // The path component of the URI. For instance, "/dir1/dir2". - Path *string `json:"path,omitempty"` - - // The port to connect to. - Port *int32 `json:"port,omitempty"` - - // Value indicating whether HTTPS is preferred over HTTP in cases where the choice is not explicit. - PreferHTTPS *bool `json:"preferHTTPS,omitempty"` - - // The HTTP headers to transmit with the request. - RequestHeaders []*HTTPHeader `json:"requestHeaders,omitempty"` - - // HTTP status codes to consider successful. For instance, "2xx,301-304,418". - ValidStatusCodeRanges []*string `json:"validStatusCodeRanges,omitempty"` -} - -// ConnectionMonitorIcmpConfiguration - Describes the ICMP configuration. -type ConnectionMonitorIcmpConfiguration struct { - // Value indicating whether path evaluation with trace route should be disabled. - DisableTraceRoute *bool `json:"disableTraceRoute,omitempty"` -} - -// ConnectionMonitorListResult - List of connection monitors. -type ConnectionMonitorListResult struct { - // Information about connection monitors. - Value []*ConnectionMonitorResult `json:"value,omitempty"` -} - -// ConnectionMonitorOutput - Describes a connection monitor output destination. -type ConnectionMonitorOutput struct { - // Connection monitor output destination type. Currently, only "Workspace" is supported. - Type *OutputType `json:"type,omitempty"` - - // Describes the settings for producing output into a log analytics workspace. - WorkspaceSettings *ConnectionMonitorWorkspaceSettings `json:"workspaceSettings,omitempty"` -} - -// ConnectionMonitorParameters - Parameters that define the operation to create a connection monitor. -type ConnectionMonitorParameters struct { - // Determines if the connection monitor will start automatically once created. - AutoStart *bool `json:"autoStart,omitempty"` - - // Describes the destination of connection monitor. - Destination *ConnectionMonitorDestination `json:"destination,omitempty"` - - // List of connection monitor endpoints. - Endpoints []*ConnectionMonitorEndpoint `json:"endpoints,omitempty"` - - // Monitoring interval in seconds. - MonitoringIntervalInSeconds *int32 `json:"monitoringIntervalInSeconds,omitempty"` - - // Optional notes to be associated with the connection monitor. - Notes *string `json:"notes,omitempty"` - - // List of connection monitor outputs. - Outputs []*ConnectionMonitorOutput `json:"outputs,omitempty"` - - // Describes the source of connection monitor. - Source *ConnectionMonitorSource `json:"source,omitempty"` - - // List of connection monitor test configurations. - TestConfigurations []*ConnectionMonitorTestConfiguration `json:"testConfigurations,omitempty"` - - // List of connection monitor test groups. - TestGroups []*ConnectionMonitorTestGroup `json:"testGroups,omitempty"` -} - -// ConnectionMonitorQueryResult - List of connection states snapshots. -type ConnectionMonitorQueryResult struct { - // Status of connection monitor source. - SourceStatus *ConnectionMonitorSourceStatus `json:"sourceStatus,omitempty"` - - // Information about connection states. - States []*ConnectionStateSnapshot `json:"states,omitempty"` -} - -// ConnectionMonitorResult - Information about the connection monitor. -type ConnectionMonitorResult struct { - // Connection monitor location. - Location *string `json:"location,omitempty"` - - // Properties of the connection monitor result. - Properties *ConnectionMonitorResultProperties `json:"properties,omitempty"` - - // Connection monitor tags. - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; ID of the connection monitor. - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; Name of the connection monitor. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Connection monitor type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ConnectionMonitorResultProperties - Describes the properties of a connection monitor. -type ConnectionMonitorResultProperties struct { - // Determines if the connection monitor will start automatically once created. - AutoStart *bool `json:"autoStart,omitempty"` - - // Describes the destination of connection monitor. - Destination *ConnectionMonitorDestination `json:"destination,omitempty"` - - // List of connection monitor endpoints. - Endpoints []*ConnectionMonitorEndpoint `json:"endpoints,omitempty"` - - // Monitoring interval in seconds. - MonitoringIntervalInSeconds *int32 `json:"monitoringIntervalInSeconds,omitempty"` - - // Optional notes to be associated with the connection monitor. - Notes *string `json:"notes,omitempty"` - - // List of connection monitor outputs. - Outputs []*ConnectionMonitorOutput `json:"outputs,omitempty"` - - // Describes the source of connection monitor. - Source *ConnectionMonitorSource `json:"source,omitempty"` - - // List of connection monitor test configurations. - TestConfigurations []*ConnectionMonitorTestConfiguration `json:"testConfigurations,omitempty"` - - // List of connection monitor test groups. - TestGroups []*ConnectionMonitorTestGroup `json:"testGroups,omitempty"` - - // READ-ONLY; Type of connection monitor. - ConnectionMonitorType *ConnectionMonitorType `json:"connectionMonitorType,omitempty" azure:"ro"` - - // READ-ONLY; The monitoring status of the connection monitor. - MonitoringStatus *string `json:"monitoringStatus,omitempty" azure:"ro"` - - // READ-ONLY; The provisioning state of the connection monitor. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` - - // READ-ONLY; The date and time when the connection monitor was started. - StartTime *time.Time `json:"startTime,omitempty" azure:"ro"` -} - -// ConnectionMonitorSource - Describes the source of connection monitor. -type ConnectionMonitorSource struct { - // REQUIRED; The ID of the resource used as the source by connection monitor. - ResourceID *string `json:"resourceId,omitempty"` - - // The source port used by connection monitor. - Port *int32 `json:"port,omitempty"` -} - -// ConnectionMonitorSuccessThreshold - Describes the threshold for declaring a test successful. -type ConnectionMonitorSuccessThreshold struct { - // The maximum percentage of failed checks permitted for a test to evaluate as successful. - ChecksFailedPercent *int32 `json:"checksFailedPercent,omitempty"` - - // The maximum round-trip time in milliseconds permitted for a test to evaluate as successful. - RoundTripTimeMs *float32 `json:"roundTripTimeMs,omitempty"` -} - -// ConnectionMonitorTCPConfiguration - Describes the TCP configuration. -type ConnectionMonitorTCPConfiguration struct { - // Destination port behavior. - DestinationPortBehavior *DestinationPortBehavior `json:"destinationPortBehavior,omitempty"` - - // Value indicating whether path evaluation with trace route should be disabled. - DisableTraceRoute *bool `json:"disableTraceRoute,omitempty"` - - // The port to connect to. - Port *int32 `json:"port,omitempty"` -} - -// ConnectionMonitorTestConfiguration - Describes a connection monitor test configuration. -type ConnectionMonitorTestConfiguration struct { - // REQUIRED; The name of the connection monitor test configuration. - Name *string `json:"name,omitempty"` - - // REQUIRED; The protocol to use in test evaluation. - Protocol *ConnectionMonitorTestConfigurationProtocol `json:"protocol,omitempty"` - - // The parameters used to perform test evaluation over HTTP. - HTTPConfiguration *ConnectionMonitorHTTPConfiguration `json:"httpConfiguration,omitempty"` - - // The parameters used to perform test evaluation over ICMP. - IcmpConfiguration *ConnectionMonitorIcmpConfiguration `json:"icmpConfiguration,omitempty"` - - // The preferred IP version to use in test evaluation. The connection monitor may choose to use a different version depending - // on other parameters. - PreferredIPVersion *PreferredIPVersion `json:"preferredIPVersion,omitempty"` - - // The threshold for declaring a test successful. - SuccessThreshold *ConnectionMonitorSuccessThreshold `json:"successThreshold,omitempty"` - - // The parameters used to perform test evaluation over TCP. - TCPConfiguration *ConnectionMonitorTCPConfiguration `json:"tcpConfiguration,omitempty"` - - // The frequency of test evaluation, in seconds. - TestFrequencySec *int32 `json:"testFrequencySec,omitempty"` -} - -// ConnectionMonitorTestGroup - Describes the connection monitor test group. -type ConnectionMonitorTestGroup struct { - // REQUIRED; List of destination endpoint names. - Destinations []*string `json:"destinations,omitempty"` - - // REQUIRED; The name of the connection monitor test group. - Name *string `json:"name,omitempty"` - - // REQUIRED; List of source endpoint names. - Sources []*string `json:"sources,omitempty"` - - // REQUIRED; List of test configuration names. - TestConfigurations []*string `json:"testConfigurations,omitempty"` - - // Value indicating whether test group is disabled. - Disable *bool `json:"disable,omitempty"` -} - -// ConnectionMonitorWorkspaceSettings - Describes the settings for producing output into a log analytics workspace. -type ConnectionMonitorWorkspaceSettings struct { - // Log analytics workspace resource ID. - WorkspaceResourceID *string `json:"workspaceResourceId,omitempty"` -} - -// ConnectionMonitorsClientBeginCreateOrUpdateOptions contains the optional parameters for the ConnectionMonitorsClient.BeginCreateOrUpdate -// method. -type ConnectionMonitorsClientBeginCreateOrUpdateOptions struct { - // Value indicating whether connection monitor V1 should be migrated to V2 format. - Migrate *string - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ConnectionMonitorsClientBeginDeleteOptions contains the optional parameters for the ConnectionMonitorsClient.BeginDelete -// method. -type ConnectionMonitorsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ConnectionMonitorsClientBeginQueryOptions contains the optional parameters for the ConnectionMonitorsClient.BeginQuery -// method. -type ConnectionMonitorsClientBeginQueryOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ConnectionMonitorsClientBeginStartOptions contains the optional parameters for the ConnectionMonitorsClient.BeginStart -// method. -type ConnectionMonitorsClientBeginStartOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ConnectionMonitorsClientBeginStopOptions contains the optional parameters for the ConnectionMonitorsClient.BeginStop method. -type ConnectionMonitorsClientBeginStopOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ConnectionMonitorsClientGetOptions contains the optional parameters for the ConnectionMonitorsClient.Get method. -type ConnectionMonitorsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ConnectionMonitorsClientListOptions contains the optional parameters for the ConnectionMonitorsClient.List method. -type ConnectionMonitorsClientListOptions struct { - // placeholder for future optional parameters -} - -// ConnectionMonitorsClientUpdateTagsOptions contains the optional parameters for the ConnectionMonitorsClient.UpdateTags -// method. -type ConnectionMonitorsClientUpdateTagsOptions struct { - // placeholder for future optional parameters -} - -// ConnectionResetSharedKey - The virtual network connection reset shared key. -type ConnectionResetSharedKey struct { - // REQUIRED; The virtual network connection reset shared key length, should between 1 and 128. - KeyLength *int32 `json:"keyLength,omitempty"` -} - -// ConnectionSharedKey - Response for GetConnectionSharedKey API service call. -type ConnectionSharedKey struct { - // REQUIRED; The virtual network connection shared key value. - Value *string `json:"value,omitempty"` - - // Resource ID. - ID *string `json:"id,omitempty"` -} - -// ConnectionStateSnapshot - Connection state snapshot. -type ConnectionStateSnapshot struct { - // Average latency in ms. - AvgLatencyInMs *int64 `json:"avgLatencyInMs,omitempty"` - - // The connection state. - ConnectionState *ConnectionState `json:"connectionState,omitempty"` - - // The end time of the connection snapshot. - EndTime *time.Time `json:"endTime,omitempty"` - - // Connectivity analysis evaluation state. - EvaluationState *EvaluationState `json:"evaluationState,omitempty"` - - // Maximum latency in ms. - MaxLatencyInMs *int64 `json:"maxLatencyInMs,omitempty"` - - // Minimum latency in ms. - MinLatencyInMs *int64 `json:"minLatencyInMs,omitempty"` - - // The number of failed probes. - ProbesFailed *int64 `json:"probesFailed,omitempty"` - - // The number of sent probes. - ProbesSent *int64 `json:"probesSent,omitempty"` - - // The start time of the connection snapshot. - StartTime *time.Time `json:"startTime,omitempty"` - - // READ-ONLY; List of hops between the source and the destination. - Hops []*ConnectivityHop `json:"hops,omitempty" azure:"ro"` -} - -// ConnectivityConfiguration - The network manager connectivity configuration resource -type ConnectivityConfiguration struct { - // Properties of a network manager connectivity configuration - Properties *ConnectivityConfigurationProperties `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; The system metadata related to this resource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ConnectivityConfigurationListResult - Result of the request to list network manager connectivity configurations. It contains -// a list of configurations and a link to get the next set of results. -type ConnectivityConfigurationListResult struct { - // Gets the URL to get the next page of results. - NextLink *string `json:"nextLink,omitempty"` - - // Gets a page of Connectivity Configurations - Value []*ConnectivityConfiguration `json:"value,omitempty"` -} - -// ConnectivityConfigurationProperties - Properties of network manager connectivity configuration -type ConnectivityConfigurationProperties struct { - // REQUIRED; Groups for configuration - AppliesToGroups []*ConnectivityGroupItem `json:"appliesToGroups,omitempty"` - - // REQUIRED; Connectivity topology type. - ConnectivityTopology *ConnectivityTopology `json:"connectivityTopology,omitempty"` - - // Flag if need to remove current existing peerings. - DeleteExistingPeering *DeleteExistingPeering `json:"deleteExistingPeering,omitempty"` - - // A description of the connectivity configuration. - Description *string `json:"description,omitempty"` - - // List of hubItems - Hubs []*Hub `json:"hubs,omitempty"` - - // Flag if global mesh is supported. - IsGlobal *IsGlobal `json:"isGlobal,omitempty"` - - // READ-ONLY; The provisioning state of the connectivity configuration resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// ConnectivityConfigurationsClientBeginDeleteOptions contains the optional parameters for the ConnectivityConfigurationsClient.BeginDelete -// method. -type ConnectivityConfigurationsClientBeginDeleteOptions struct { - // Deletes the resource even if it is part of a deployed configuration. If the configuration has been deployed, the service - // will do a cleanup deployment in the background, prior to the delete. - Force *bool - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ConnectivityConfigurationsClientCreateOrUpdateOptions contains the optional parameters for the ConnectivityConfigurationsClient.CreateOrUpdate -// method. -type ConnectivityConfigurationsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// ConnectivityConfigurationsClientGetOptions contains the optional parameters for the ConnectivityConfigurationsClient.Get -// method. -type ConnectivityConfigurationsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ConnectivityConfigurationsClientListOptions contains the optional parameters for the ConnectivityConfigurationsClient.List -// method. -type ConnectivityConfigurationsClientListOptions struct { - // SkipToken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, - // the value of the nextLink element will include a skipToken parameter that - // specifies a starting point to use for subsequent calls. - SkipToken *string - // An optional query parameter which specifies the maximum number of records to be returned by the server. - Top *int32 -} - -// ConnectivityDestination - Parameters that define destination of connection. -type ConnectivityDestination struct { - // The IP address or URI the resource to which a connection attempt will be made. - Address *string `json:"address,omitempty"` - - // Port on which check connectivity will be performed. - Port *int32 `json:"port,omitempty"` - - // The ID of the resource to which a connection attempt will be made. - ResourceID *string `json:"resourceId,omitempty"` -} - -// ConnectivityGroupItem - Connectivity group item. -type ConnectivityGroupItem struct { - // REQUIRED; Group connectivity type. - GroupConnectivity *GroupConnectivity `json:"groupConnectivity,omitempty"` - - // REQUIRED; Network group Id. - NetworkGroupID *string `json:"networkGroupId,omitempty"` - - // Flag if global is supported. - IsGlobal *IsGlobal `json:"isGlobal,omitempty"` - - // Flag if need to use hub gateway. - UseHubGateway *UseHubGateway `json:"useHubGateway,omitempty"` -} - -// ConnectivityHop - Information about a hop between the source and the destination. -type ConnectivityHop struct { - // READ-ONLY; The IP address of the hop. - Address *string `json:"address,omitempty" azure:"ro"` - - // READ-ONLY; The ID of the hop. - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; List of issues. - Issues []*ConnectivityIssue `json:"issues,omitempty" azure:"ro"` - - // READ-ONLY; List of hop links. - Links []*HopLink `json:"links,omitempty" azure:"ro"` - - // READ-ONLY; List of next hop identifiers. - NextHopIDs []*string `json:"nextHopIds,omitempty" azure:"ro"` - - // READ-ONLY; List of previous hop identifiers. - PreviousHopIDs []*string `json:"previousHopIds,omitempty" azure:"ro"` - - // READ-ONLY; List of previous hop links. - PreviousLinks []*HopLink `json:"previousLinks,omitempty" azure:"ro"` - - // READ-ONLY; The ID of the resource corresponding to this hop. - ResourceID *string `json:"resourceId,omitempty" azure:"ro"` - - // READ-ONLY; The type of the hop. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ConnectivityInformation - Information on the connectivity status. -type ConnectivityInformation struct { - // READ-ONLY; Average latency in milliseconds. - AvgLatencyInMs *int32 `json:"avgLatencyInMs,omitempty" azure:"ro"` - - // READ-ONLY; The connection status. - ConnectionStatus *ConnectionStatus `json:"connectionStatus,omitempty" azure:"ro"` - - // READ-ONLY; List of hops between the source and the destination. - Hops []*ConnectivityHop `json:"hops,omitempty" azure:"ro"` - - // READ-ONLY; Maximum latency in milliseconds. - MaxLatencyInMs *int32 `json:"maxLatencyInMs,omitempty" azure:"ro"` - - // READ-ONLY; Minimum latency in milliseconds. - MinLatencyInMs *int32 `json:"minLatencyInMs,omitempty" azure:"ro"` - - // READ-ONLY; Number of failed probes. - ProbesFailed *int32 `json:"probesFailed,omitempty" azure:"ro"` - - // READ-ONLY; Total number of probes sent. - ProbesSent *int32 `json:"probesSent,omitempty" azure:"ro"` -} - -// ConnectivityIssue - Information about an issue encountered in the process of checking for connectivity. -type ConnectivityIssue struct { - // READ-ONLY; Provides additional context on the issue. - Context []map[string]*string `json:"context,omitempty" azure:"ro"` - - // READ-ONLY; The origin of the issue. - Origin *Origin `json:"origin,omitempty" azure:"ro"` - - // READ-ONLY; The severity of the issue. - Severity *Severity `json:"severity,omitempty" azure:"ro"` - - // READ-ONLY; The type of issue. - Type *IssueType `json:"type,omitempty" azure:"ro"` -} - -// ConnectivityParameters - Parameters that determine how the connectivity check will be performed. -type ConnectivityParameters struct { - // REQUIRED; The destination of connection. - Destination *ConnectivityDestination `json:"destination,omitempty"` - - // REQUIRED; The source of the connection. - Source *ConnectivitySource `json:"source,omitempty"` - - // Preferred IP version of the connection. - PreferredIPVersion *IPVersion `json:"preferredIPVersion,omitempty"` - - // Network protocol. - Protocol *Protocol `json:"protocol,omitempty"` - - // Configuration of the protocol. - ProtocolConfiguration *ProtocolConfiguration `json:"protocolConfiguration,omitempty"` -} - -// ConnectivitySource - Parameters that define the source of the connection. -type ConnectivitySource struct { - // REQUIRED; The ID of the resource from which a connectivity check will be initiated. - ResourceID *string `json:"resourceId,omitempty"` - - // The source port from which a connectivity check will be performed. - Port *int32 `json:"port,omitempty"` -} - -// Container - Reference to container resource in remote resource provider. -type Container struct { - // Resource ID. - ID *string `json:"id,omitempty"` -} - -// ContainerNetworkInterface - Container network interface child resource. -type ContainerNetworkInterface struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // The name of the resource. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - - // Container network interface properties. - Properties *ContainerNetworkInterfacePropertiesFormat `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Sub Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ContainerNetworkInterfaceConfiguration - Container network interface configuration child resource. -type ContainerNetworkInterfaceConfiguration struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // The name of the resource. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - - // Container network interface configuration properties. - Properties *ContainerNetworkInterfaceConfigurationPropertiesFormat `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Sub Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ContainerNetworkInterfaceConfigurationPropertiesFormat - Container network interface configuration properties. -type ContainerNetworkInterfaceConfigurationPropertiesFormat struct { - // A list of container network interfaces created from this container network interface configuration. - ContainerNetworkInterfaces []*SubResource `json:"containerNetworkInterfaces,omitempty"` - - // A list of ip configurations of the container network interface configuration. - IPConfigurations []*IPConfigurationProfile `json:"ipConfigurations,omitempty"` - - // READ-ONLY; The provisioning state of the container network interface configuration resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// ContainerNetworkInterfaceIPConfiguration - The ip configuration for a container network interface. -type ContainerNetworkInterfaceIPConfiguration struct { - // The name of the resource. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - - // Properties of the container network interface IP configuration. - Properties *ContainerNetworkInterfaceIPConfigurationPropertiesFormat `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Sub Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ContainerNetworkInterfaceIPConfigurationPropertiesFormat - Properties of the container network interface IP configuration. -type ContainerNetworkInterfaceIPConfigurationPropertiesFormat struct { - // READ-ONLY; The provisioning state of the container network interface IP configuration resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// ContainerNetworkInterfacePropertiesFormat - Properties of container network interface. -type ContainerNetworkInterfacePropertiesFormat struct { - // Reference to the container to which this container network interface is attached. - Container *Container `json:"container,omitempty"` - - // READ-ONLY; Container network interface configuration from which this container network interface is created. - ContainerNetworkInterfaceConfiguration *ContainerNetworkInterfaceConfiguration `json:"containerNetworkInterfaceConfiguration,omitempty" azure:"ro"` - - // READ-ONLY; Reference to the ip configuration on this container nic. - IPConfigurations []*ContainerNetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty" azure:"ro"` - - // READ-ONLY; The provisioning state of the container network interface resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// CrossTenantScopes - Cross tenant scopes. -type CrossTenantScopes struct { - // READ-ONLY; List of management groups. - ManagementGroups []*string `json:"managementGroups,omitempty" azure:"ro"` - - // READ-ONLY; List of subscriptions. - Subscriptions []*string `json:"subscriptions,omitempty" azure:"ro"` - - // READ-ONLY; Tenant ID. - TenantID *string `json:"tenantId,omitempty" azure:"ro"` -} - -// CustomDNSConfigPropertiesFormat - Contains custom Dns resolution configuration from customer. -type CustomDNSConfigPropertiesFormat struct { - // Fqdn that resolves to private endpoint ip address. - Fqdn *string `json:"fqdn,omitempty"` - - // A list of private ip addresses of the private endpoint. - IPAddresses []*string `json:"ipAddresses,omitempty"` -} - -// CustomIPPrefix - Custom IP prefix resource. -type CustomIPPrefix struct { - // The extended location of the custom IP prefix. - ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` - - // Resource ID. - ID *string `json:"id,omitempty"` - - // Resource location. - Location *string `json:"location,omitempty"` - - // Custom IP prefix properties. - Properties *CustomIPPrefixPropertiesFormat `json:"properties,omitempty"` - - // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` - - // A list of availability zones denoting the IP allocated for the resource needs to come from. - Zones []*string `json:"zones,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// CustomIPPrefixListResult - Response for ListCustomIpPrefixes API service call. -type CustomIPPrefixListResult struct { - // The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` - - // A list of Custom IP prefixes that exists in a resource group. - Value []*CustomIPPrefix `json:"value,omitempty"` -} - -// CustomIPPrefixPropertiesFormat - Custom IP prefix properties. -type CustomIPPrefixPropertiesFormat struct { - // Authorization message for WAN validation. - AuthorizationMessage *string `json:"authorizationMessage,omitempty"` - - // The prefix range in CIDR notation. Should include the start address and the prefix length. - Cidr *string `json:"cidr,omitempty"` - - // The commissioned state of the Custom IP Prefix. - CommissionedState *CommissionedState `json:"commissionedState,omitempty"` - - // The Parent CustomIpPrefix for IPv6 /64 CustomIpPrefix. - CustomIPPrefixParent *SubResource `json:"customIpPrefixParent,omitempty"` - - // Whether to Advertise the range to Internet. - NoInternetAdvertise *bool `json:"noInternetAdvertise,omitempty"` - - // Signed message for WAN validation. - SignedMessage *string `json:"signedMessage,omitempty"` - - // READ-ONLY; The list of all Children for IPv6 /48 CustomIpPrefix. - ChildCustomIPPrefixes []*SubResource `json:"childCustomIpPrefixes,omitempty" azure:"ro"` - - // READ-ONLY; The reason why resource is in failed state. - FailedReason *string `json:"failedReason,omitempty" azure:"ro"` - - // READ-ONLY; The provisioning state of the custom IP prefix resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` - - // READ-ONLY; The list of all referenced PublicIpPrefixes. - PublicIPPrefixes []*SubResource `json:"publicIpPrefixes,omitempty" azure:"ro"` - - // READ-ONLY; The resource GUID property of the custom IP prefix resource. - ResourceGUID *string `json:"resourceGuid,omitempty" azure:"ro"` -} - -// CustomIPPrefixesClientBeginCreateOrUpdateOptions contains the optional parameters for the CustomIPPrefixesClient.BeginCreateOrUpdate -// method. -type CustomIPPrefixesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CustomIPPrefixesClientBeginDeleteOptions contains the optional parameters for the CustomIPPrefixesClient.BeginDelete method. -type CustomIPPrefixesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CustomIPPrefixesClientGetOptions contains the optional parameters for the CustomIPPrefixesClient.Get method. -type CustomIPPrefixesClientGetOptions struct { - // Expands referenced resources. - Expand *string -} - -// CustomIPPrefixesClientListAllOptions contains the optional parameters for the CustomIPPrefixesClient.ListAll method. -type CustomIPPrefixesClientListAllOptions struct { - // placeholder for future optional parameters -} - -// CustomIPPrefixesClientListOptions contains the optional parameters for the CustomIPPrefixesClient.List method. -type CustomIPPrefixesClientListOptions struct { - // placeholder for future optional parameters -} - -// CustomIPPrefixesClientUpdateTagsOptions contains the optional parameters for the CustomIPPrefixesClient.UpdateTags method. -type CustomIPPrefixesClientUpdateTagsOptions struct { - // placeholder for future optional parameters -} - -// DNSNameAvailabilityResult - Response for the CheckDnsNameAvailability API service call. -type DNSNameAvailabilityResult struct { - // Domain availability (True/False). - Available *bool `json:"available,omitempty"` -} - -// DNSSettings - DNS Proxy Settings in Firewall Policy. -type DNSSettings struct { - // Enable DNS Proxy on Firewalls attached to the Firewall Policy. - EnableProxy *bool `json:"enableProxy,omitempty"` - - // FQDNs in Network Rules are supported when set to true. - RequireProxyForNetworkRules *bool `json:"requireProxyForNetworkRules,omitempty"` - - // List of Custom DNS Servers. - Servers []*string `json:"servers,omitempty"` -} - -// DdosCustomPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the DdosCustomPoliciesClient.BeginCreateOrUpdate -// method. -type DdosCustomPoliciesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DdosCustomPoliciesClientBeginDeleteOptions contains the optional parameters for the DdosCustomPoliciesClient.BeginDelete -// method. -type DdosCustomPoliciesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DdosCustomPoliciesClientGetOptions contains the optional parameters for the DdosCustomPoliciesClient.Get method. -type DdosCustomPoliciesClientGetOptions struct { - // placeholder for future optional parameters -} - -// DdosCustomPoliciesClientUpdateTagsOptions contains the optional parameters for the DdosCustomPoliciesClient.UpdateTags -// method. -type DdosCustomPoliciesClientUpdateTagsOptions struct { - // placeholder for future optional parameters -} - -// DdosCustomPolicy - A DDoS custom policy in a resource group. -type DdosCustomPolicy struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Resource location. - Location *string `json:"location,omitempty"` - - // Properties of the DDoS custom policy. - Properties *DdosCustomPolicyPropertiesFormat `json:"properties,omitempty"` - - // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// DdosCustomPolicyPropertiesFormat - DDoS custom policy properties. -type DdosCustomPolicyPropertiesFormat struct { - // The protocol-specific DDoS policy customization parameters. - ProtocolCustomSettings []*ProtocolCustomSettingsFormat `json:"protocolCustomSettings,omitempty"` - - // READ-ONLY; The provisioning state of the DDoS custom policy resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` - - // READ-ONLY; The list of public IPs associated with the DDoS custom policy resource. This list is read-only. - PublicIPAddresses []*SubResource `json:"publicIPAddresses,omitempty" azure:"ro"` - - // READ-ONLY; The resource GUID property of the DDoS custom policy resource. It uniquely identifies the resource, even if - // the user changes its name or migrate the resource across subscriptions or resource groups. - ResourceGUID *string `json:"resourceGuid,omitempty" azure:"ro"` -} - -// DdosProtectionPlan - A DDoS protection plan in a resource group. -type DdosProtectionPlan struct { - // Resource location. - Location *string `json:"location,omitempty"` - - // Properties of the DDoS protection plan. - Properties *DdosProtectionPlanPropertiesFormat `json:"properties,omitempty"` - - // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// DdosProtectionPlanListResult - A list of DDoS protection plans. -type DdosProtectionPlanListResult struct { - // A list of DDoS protection plans. - Value []*DdosProtectionPlan `json:"value,omitempty"` - - // READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` -} - -// DdosProtectionPlanPropertiesFormat - DDoS protection plan properties. -type DdosProtectionPlanPropertiesFormat struct { - // READ-ONLY; The provisioning state of the DDoS protection plan resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` - - // READ-ONLY; The resource GUID property of the DDoS protection plan resource. It uniquely identifies the resource, even if - // the user changes its name or migrate the resource across subscriptions or resource groups. - ResourceGUID *string `json:"resourceGuid,omitempty" azure:"ro"` - - // READ-ONLY; The list of virtual networks associated with the DDoS protection plan resource. This list is read-only. - VirtualNetworks []*SubResource `json:"virtualNetworks,omitempty" azure:"ro"` -} - -// DdosProtectionPlansClientBeginCreateOrUpdateOptions contains the optional parameters for the DdosProtectionPlansClient.BeginCreateOrUpdate -// method. -type DdosProtectionPlansClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DdosProtectionPlansClientBeginDeleteOptions contains the optional parameters for the DdosProtectionPlansClient.BeginDelete -// method. -type DdosProtectionPlansClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DdosProtectionPlansClientGetOptions contains the optional parameters for the DdosProtectionPlansClient.Get method. -type DdosProtectionPlansClientGetOptions struct { - // placeholder for future optional parameters -} - -// DdosProtectionPlansClientListByResourceGroupOptions contains the optional parameters for the DdosProtectionPlansClient.ListByResourceGroup -// method. -type DdosProtectionPlansClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// DdosProtectionPlansClientListOptions contains the optional parameters for the DdosProtectionPlansClient.List method. -type DdosProtectionPlansClientListOptions struct { - // placeholder for future optional parameters -} - -// DdosProtectionPlansClientUpdateTagsOptions contains the optional parameters for the DdosProtectionPlansClient.UpdateTags -// method. -type DdosProtectionPlansClientUpdateTagsOptions struct { - // placeholder for future optional parameters -} - -// DdosSettings - Contains the DDoS protection settings of the public IP. -type DdosSettings struct { - // The DDoS custom policy associated with the public IP. - DdosCustomPolicy *SubResource `json:"ddosCustomPolicy,omitempty"` - - // Enables DDoS protection on the public IP. - ProtectedIP *bool `json:"protectedIP,omitempty"` - - // The DDoS protection policy customizability of the public IP. Only standard coverage will have the ability to be customized. - ProtectionCoverage *DdosSettingsProtectionCoverage `json:"protectionCoverage,omitempty"` -} - -// DefaultAdminPropertiesFormat - Security default admin rule resource. -type DefaultAdminPropertiesFormat struct { - // Default rule flag. - Flag *string `json:"flag,omitempty"` - - // READ-ONLY; Indicates the access allowed for this particular rule - Access *SecurityConfigurationRuleAccess `json:"access,omitempty" azure:"ro"` - - // READ-ONLY; A description for this rule. Restricted to 140 chars. - Description *string `json:"description,omitempty" azure:"ro"` - - // READ-ONLY; The destination port ranges. - DestinationPortRanges []*string `json:"destinationPortRanges,omitempty" azure:"ro"` - - // READ-ONLY; The destination address prefixes. CIDR or destination IP ranges. - Destinations []*AddressPrefixItem `json:"destinations,omitempty" azure:"ro"` - - // READ-ONLY; Indicates if the traffic matched against the rule in inbound or outbound. - Direction *SecurityConfigurationRuleDirection `json:"direction,omitempty" azure:"ro"` - - // READ-ONLY; The priority of the rule. The value can be between 1 and 4096. The priority number must be unique for each rule - // in the collection. The lower the priority number, the higher the priority of the rule. - Priority *int32 `json:"priority,omitempty" azure:"ro"` - - // READ-ONLY; Network protocol this rule applies to. - Protocol *SecurityConfigurationRuleProtocol `json:"protocol,omitempty" azure:"ro"` - - // READ-ONLY; The provisioning state of the resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` - - // READ-ONLY; The source port ranges. - SourcePortRanges []*string `json:"sourcePortRanges,omitempty" azure:"ro"` - - // READ-ONLY; The CIDR or source IP ranges. - Sources []*AddressPrefixItem `json:"sources,omitempty" azure:"ro"` -} - -// DefaultAdminRule - Network default admin rule. -type DefaultAdminRule struct { - // REQUIRED; Whether the rule is custom or default. - Kind *AdminRuleKind `json:"kind,omitempty"` - - // Indicates the properties of the security admin rule - Properties *DefaultAdminPropertiesFormat `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; The system metadata related to this resource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// GetBaseAdminRule implements the BaseAdminRuleClassification interface for type DefaultAdminRule. -func (d *DefaultAdminRule) GetBaseAdminRule() *BaseAdminRule { - return &BaseAdminRule{ - Kind: d.Kind, - SystemData: d.SystemData, - ID: d.ID, - Name: d.Name, - Type: d.Type, - Etag: d.Etag, - } -} - -// DefaultSecurityRulesClientGetOptions contains the optional parameters for the DefaultSecurityRulesClient.Get method. -type DefaultSecurityRulesClientGetOptions struct { - // placeholder for future optional parameters -} - -// DefaultSecurityRulesClientListOptions contains the optional parameters for the DefaultSecurityRulesClient.List method. -type DefaultSecurityRulesClientListOptions struct { - // placeholder for future optional parameters -} - -// Delegation - Details the service to which the subnet is delegated. -type Delegation struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // The name of the resource that is unique within a subnet. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - - // Properties of the subnet. - Properties *ServiceDelegationPropertiesFormat `json:"properties,omitempty"` - - // Resource type. - Type *string `json:"type,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` -} - -// DeviceProperties - List of properties of the device. -type DeviceProperties struct { - // Model of the device. - DeviceModel *string `json:"deviceModel,omitempty"` - - // Name of the device Vendor. - DeviceVendor *string `json:"deviceVendor,omitempty"` - - // Link speed. - LinkSpeedInMbps *int32 `json:"linkSpeedInMbps,omitempty"` -} - -// 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 { - // The list of DNS servers IP addresses. - DNSServers []*string `json:"dnsServers,omitempty"` -} - -// Dimension of the metric. -type Dimension struct { - // The display name of the dimension. - DisplayName *string `json:"displayName,omitempty"` - - // The internal name of the dimension. - InternalName *string `json:"internalName,omitempty"` - - // The name of the dimension. - Name *string `json:"name,omitempty"` -} - -// DscpConfiguration - Differentiated Services Code Point configuration for any given network interface -type DscpConfiguration struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Resource location. - Location *string `json:"location,omitempty"` - - // Properties of the network interface. - Properties *DscpConfigurationPropertiesFormat `json:"properties,omitempty"` - - // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// DscpConfigurationClientBeginCreateOrUpdateOptions contains the optional parameters for the DscpConfigurationClient.BeginCreateOrUpdate -// method. -type DscpConfigurationClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DscpConfigurationClientBeginDeleteOptions contains the optional parameters for the DscpConfigurationClient.BeginDelete -// method. -type DscpConfigurationClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DscpConfigurationClientGetOptions contains the optional parameters for the DscpConfigurationClient.Get method. -type DscpConfigurationClientGetOptions struct { - // placeholder for future optional parameters -} - -// DscpConfigurationClientListAllOptions contains the optional parameters for the DscpConfigurationClient.ListAll method. -type DscpConfigurationClientListAllOptions struct { - // placeholder for future optional parameters -} - -// DscpConfigurationClientListOptions contains the optional parameters for the DscpConfigurationClient.List method. -type DscpConfigurationClientListOptions struct { - // placeholder for future optional parameters -} - -// DscpConfigurationListResult - Response for the DscpConfigurationList API service call. -type DscpConfigurationListResult struct { - // A list of dscp configurations in a resource group. - Value []*DscpConfiguration `json:"value,omitempty"` - - // READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` -} - -// DscpConfigurationPropertiesFormat - Differentiated Services Code Point configuration properties. -type DscpConfigurationPropertiesFormat struct { - // Destination IP ranges. - DestinationIPRanges []*QosIPRange `json:"destinationIpRanges,omitempty"` - - // Destination port ranges. - DestinationPortRanges []*QosPortRange `json:"destinationPortRanges,omitempty"` - - // List of markings to be used in the configuration. - Markings []*int32 `json:"markings,omitempty"` - - // RNM supported protocol types. - Protocol *ProtocolType `json:"protocol,omitempty"` - - // QoS object definitions - QosDefinitionCollection []*QosDefinition `json:"qosDefinitionCollection,omitempty"` - - // Source IP ranges. - SourceIPRanges []*QosIPRange `json:"sourceIpRanges,omitempty"` - - // Sources port ranges. - SourcePortRanges []*QosPortRange `json:"sourcePortRanges,omitempty"` - - // READ-ONLY; Associated Network Interfaces to the DSCP Configuration. - AssociatedNetworkInterfaces []*Interface `json:"associatedNetworkInterfaces,omitempty" azure:"ro"` - - // READ-ONLY; The provisioning state of the DSCP Configuration resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` - - // READ-ONLY; Qos Collection ID generated by RNM. - QosCollectionID *string `json:"qosCollectionId,omitempty" azure:"ro"` - - // READ-ONLY; The resource GUID property of the DSCP Configuration resource. - ResourceGUID *string `json:"resourceGuid,omitempty" azure:"ro"` -} - -// EffectiveBaseSecurityAdminRuleClassification provides polymorphic access to related types. -// Call the interface's GetEffectiveBaseSecurityAdminRule() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *EffectiveBaseSecurityAdminRule, *EffectiveDefaultSecurityAdminRule, *EffectiveSecurityAdminRule -type EffectiveBaseSecurityAdminRuleClassification interface { - // GetEffectiveBaseSecurityAdminRule returns the EffectiveBaseSecurityAdminRule content of the underlying type. - GetEffectiveBaseSecurityAdminRule() *EffectiveBaseSecurityAdminRule -} - -// EffectiveBaseSecurityAdminRule - Network base admin rule. -type EffectiveBaseSecurityAdminRule struct { - // REQUIRED; Whether the rule is custom or default. - Kind *EffectiveAdminRuleKind `json:"kind,omitempty"` - - // A description of the security admin configuration. - ConfigurationDescription *string `json:"configurationDescription,omitempty"` - - // Resource ID. - ID *string `json:"id,omitempty"` - - // Groups for rule collection - RuleCollectionAppliesToGroups []*ManagerSecurityGroupItem `json:"ruleCollectionAppliesToGroups,omitempty"` - - // A description of the rule collection. - RuleCollectionDescription *string `json:"ruleCollectionDescription,omitempty"` - - // Effective configuration groups. - RuleGroups []*ConfigurationGroup `json:"ruleGroups,omitempty"` -} - -// GetEffectiveBaseSecurityAdminRule implements the EffectiveBaseSecurityAdminRuleClassification interface for type EffectiveBaseSecurityAdminRule. -func (e *EffectiveBaseSecurityAdminRule) GetEffectiveBaseSecurityAdminRule() *EffectiveBaseSecurityAdminRule { - return e -} - -// EffectiveConnectivityConfiguration - The network manager effective connectivity configuration -type EffectiveConnectivityConfiguration struct { - // Effective configuration groups. - ConfigurationGroups []*ConfigurationGroup `json:"configurationGroups,omitempty"` - - // Connectivity configuration ID. - ID *string `json:"id,omitempty"` - - // Properties of a network manager connectivity configuration - Properties *ConnectivityConfigurationProperties `json:"properties,omitempty"` -} - -// EffectiveDefaultSecurityAdminRule - Network default admin rule. -type EffectiveDefaultSecurityAdminRule struct { - // REQUIRED; Whether the rule is custom or default. - Kind *EffectiveAdminRuleKind `json:"kind,omitempty"` - - // A description of the security admin configuration. - ConfigurationDescription *string `json:"configurationDescription,omitempty"` - - // Resource ID. - ID *string `json:"id,omitempty"` - - // Indicates the properties of the default security admin rule - Properties *DefaultAdminPropertiesFormat `json:"properties,omitempty"` - - // Groups for rule collection - RuleCollectionAppliesToGroups []*ManagerSecurityGroupItem `json:"ruleCollectionAppliesToGroups,omitempty"` - - // A description of the rule collection. - RuleCollectionDescription *string `json:"ruleCollectionDescription,omitempty"` - - // Effective configuration groups. - RuleGroups []*ConfigurationGroup `json:"ruleGroups,omitempty"` -} - -// GetEffectiveBaseSecurityAdminRule implements the EffectiveBaseSecurityAdminRuleClassification interface for type EffectiveDefaultSecurityAdminRule. -func (e *EffectiveDefaultSecurityAdminRule) GetEffectiveBaseSecurityAdminRule() *EffectiveBaseSecurityAdminRule { - return &EffectiveBaseSecurityAdminRule{ - ID: e.ID, - ConfigurationDescription: e.ConfigurationDescription, - RuleCollectionDescription: e.RuleCollectionDescription, - RuleCollectionAppliesToGroups: e.RuleCollectionAppliesToGroups, - RuleGroups: e.RuleGroups, - Kind: e.Kind, - } -} - -// EffectiveNetworkSecurityGroup - Effective network security group. -type EffectiveNetworkSecurityGroup struct { - // Associated resources. - Association *EffectiveNetworkSecurityGroupAssociation `json:"association,omitempty"` - - // A collection of effective security rules. - EffectiveSecurityRules []*EffectiveNetworkSecurityRule `json:"effectiveSecurityRules,omitempty"` - - // The ID of network security group that is applied. - NetworkSecurityGroup *SubResource `json:"networkSecurityGroup,omitempty"` - - // Mapping of tags to list of IP Addresses included within the tag. - TagMap *string `json:"tagMap,omitempty"` -} - -// EffectiveNetworkSecurityGroupAssociation - The effective network security group association. -type EffectiveNetworkSecurityGroupAssociation struct { - // The ID of the network interface if assigned. - NetworkInterface *SubResource `json:"networkInterface,omitempty"` - - // The ID of the Azure network manager if assigned. - NetworkManager *SubResource `json:"networkManager,omitempty"` - - // The ID of the subnet if assigned. - Subnet *SubResource `json:"subnet,omitempty"` -} - -// EffectiveNetworkSecurityGroupListResult - Response for list effective network security groups API service call. -type EffectiveNetworkSecurityGroupListResult struct { - // A list of effective network security groups. - Value []*EffectiveNetworkSecurityGroup `json:"value,omitempty"` - - // READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` -} - -// EffectiveNetworkSecurityRule - Effective network security rules. -type EffectiveNetworkSecurityRule struct { - // Whether network traffic is allowed or denied. - Access *SecurityRuleAccess `json:"access,omitempty"` - - // The destination address prefix. - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - - // The destination address prefixes. Expected values include CIDR IP ranges, Default Tags (VirtualNetwork, AzureLoadBalancer, - // Internet), System Tags, and the asterisk (*). - DestinationAddressPrefixes []*string `json:"destinationAddressPrefixes,omitempty"` - - // The destination port or range. - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - - // The destination port ranges. Expected values include a single integer between 0 and 65535, a range using '-' as separator - // (e.g. 100-400), or an asterisk (*). - DestinationPortRanges []*string `json:"destinationPortRanges,omitempty"` - - // The direction of the rule. - Direction *SecurityRuleDirection `json:"direction,omitempty"` - - // Expanded destination address prefix. - ExpandedDestinationAddressPrefix []*string `json:"expandedDestinationAddressPrefix,omitempty"` - - // The expanded source address prefix. - ExpandedSourceAddressPrefix []*string `json:"expandedSourceAddressPrefix,omitempty"` - - // The name of the security rule specified by the user (if created by the user). - Name *string `json:"name,omitempty"` - - // The priority of the rule. - Priority *int32 `json:"priority,omitempty"` - - // The network protocol this rule applies to. - Protocol *EffectiveSecurityRuleProtocol `json:"protocol,omitempty"` - - // The source address prefix. - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - - // The source address prefixes. Expected values include CIDR IP ranges, Default Tags (VirtualNetwork, AzureLoadBalancer, Internet), - // System Tags, and the asterisk (*). - SourceAddressPrefixes []*string `json:"sourceAddressPrefixes,omitempty"` - - // The source port or range. - SourcePortRange *string `json:"sourcePortRange,omitempty"` - - // The source port ranges. Expected values include a single integer between 0 and 65535, a range using '-' as separator (e.g. - // 100-400), or an asterisk (*). - SourcePortRanges []*string `json:"sourcePortRanges,omitempty"` -} - -// EffectiveRoute - Effective Route. -type EffectiveRoute struct { - // The address prefixes of the effective routes in CIDR notation. - AddressPrefix []*string `json:"addressPrefix,omitempty"` - - // If true, on-premises routes are not propagated to the network interfaces in the subnet. - DisableBgpRoutePropagation *bool `json:"disableBgpRoutePropagation,omitempty"` - - // The name of the user defined route. This is optional. - Name *string `json:"name,omitempty"` - - // The IP address of the next hop of the effective route. - NextHopIPAddress []*string `json:"nextHopIpAddress,omitempty"` - - // The type of Azure hop the packet should be sent to. - NextHopType *RouteNextHopType `json:"nextHopType,omitempty"` - - // Who created the route. - Source *EffectiveRouteSource `json:"source,omitempty"` - - // The value of effective route. - State *EffectiveRouteState `json:"state,omitempty"` -} - -// EffectiveRouteListResult - Response for list effective route API service call. -type EffectiveRouteListResult struct { - // A list of effective routes. - Value []*EffectiveRoute `json:"value,omitempty"` - - // READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` -} - -// EffectiveRoutesParameters - The parameters specifying the resource whose effective routes are being requested. -type EffectiveRoutesParameters struct { - // The resource whose effective routes are being requested. - ResourceID *string `json:"resourceId,omitempty"` - - // The type of the specified resource like RouteTable, ExpressRouteConnection, HubVirtualNetworkConnection, VpnConnection - // and P2SConnection. - VirtualWanResourceType *string `json:"virtualWanResourceType,omitempty"` -} - -// EffectiveSecurityAdminRule - Network admin rule. -type EffectiveSecurityAdminRule struct { - // REQUIRED; Whether the rule is custom or default. - Kind *EffectiveAdminRuleKind `json:"kind,omitempty"` - - // A description of the security admin configuration. - ConfigurationDescription *string `json:"configurationDescription,omitempty"` - - // Resource ID. - ID *string `json:"id,omitempty"` - - // Indicates the properties of the security admin rule - Properties *AdminPropertiesFormat `json:"properties,omitempty"` - - // Groups for rule collection - RuleCollectionAppliesToGroups []*ManagerSecurityGroupItem `json:"ruleCollectionAppliesToGroups,omitempty"` - - // A description of the rule collection. - RuleCollectionDescription *string `json:"ruleCollectionDescription,omitempty"` - - // Effective configuration groups. - RuleGroups []*ConfigurationGroup `json:"ruleGroups,omitempty"` -} - -// GetEffectiveBaseSecurityAdminRule implements the EffectiveBaseSecurityAdminRuleClassification interface for type EffectiveSecurityAdminRule. -func (e *EffectiveSecurityAdminRule) GetEffectiveBaseSecurityAdminRule() *EffectiveBaseSecurityAdminRule { - return &EffectiveBaseSecurityAdminRule{ - ID: e.ID, - ConfigurationDescription: e.ConfigurationDescription, - RuleCollectionDescription: e.RuleCollectionDescription, - RuleCollectionAppliesToGroups: e.RuleCollectionAppliesToGroups, - RuleGroups: e.RuleGroups, - Kind: e.Kind, - } -} - -// EndpointServiceResult - Endpoint service. -type EndpointServiceResult struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // READ-ONLY; Name of the endpoint service. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Type of the endpoint service. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// EndpointServicesListResult - Response for the ListAvailableEndpointServices API service call. -type EndpointServicesListResult struct { - // The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` - - // List of available endpoint services in a region. - Value []*EndpointServiceResult `json:"value,omitempty"` -} - -// Error - Common error representation. -type Error struct { - // Error code. - Code *string `json:"code,omitempty"` - - // Error details. - Details []*ErrorDetails `json:"details,omitempty"` - - // Inner error message. - InnerError *string `json:"innerError,omitempty"` - - // Error message. - Message *string `json:"message,omitempty"` - - // Error target. - Target *string `json:"target,omitempty"` -} - -// ErrorDetails - Common error details representation. -type ErrorDetails struct { - // Error code. - Code *string `json:"code,omitempty"` - - // Error message. - Message *string `json:"message,omitempty"` - - // Error target. - Target *string `json:"target,omitempty"` -} - -// ErrorResponse - The error object. -type ErrorResponse struct { - // The error details object. - Error *ErrorDetails `json:"error,omitempty"` -} - -// EvaluatedNetworkSecurityGroup - Results of network security group evaluation. -type EvaluatedNetworkSecurityGroup struct { - // Resource ID of nic or subnet to which network security group is applied. - AppliedTo *string `json:"appliedTo,omitempty"` - - // Matched network security rule. - MatchedRule *MatchedRule `json:"matchedRule,omitempty"` - - // Network security group ID. - NetworkSecurityGroupID *string `json:"networkSecurityGroupId,omitempty"` - - // READ-ONLY; List of network security rules evaluation results. - RulesEvaluationResult []*SecurityRulesEvaluationResult `json:"rulesEvaluationResult,omitempty" azure:"ro"` -} - -// ExclusionManagedRule - Defines a managed rule to use for exclusion. -type ExclusionManagedRule struct { - // REQUIRED; Identifier for the managed rule. - RuleID *string `json:"ruleId,omitempty"` -} - -// ExclusionManagedRuleGroup - Defines a managed rule group to use for exclusion. -type ExclusionManagedRuleGroup struct { - // REQUIRED; The managed rule group for exclusion. - RuleGroupName *string `json:"ruleGroupName,omitempty"` - - // List of rules that will be excluded. If none specified, all rules in the group will be excluded. - Rules []*ExclusionManagedRule `json:"rules,omitempty"` -} - -// ExclusionManagedRuleSet - Defines a managed rule set for Exclusions. -type ExclusionManagedRuleSet struct { - // REQUIRED; Defines the rule set type to use. - RuleSetType *string `json:"ruleSetType,omitempty"` - - // REQUIRED; Defines the version of the rule set to use. - RuleSetVersion *string `json:"ruleSetVersion,omitempty"` - - // Defines the rule groups to apply to the rule set. - RuleGroups []*ExclusionManagedRuleGroup `json:"ruleGroups,omitempty"` -} - -// ExplicitProxySettings - Explicit Proxy Settings in Firewall Policy. -type ExplicitProxySettings struct { - // When set to true, explicit proxy mode is enabled. - EnableExplicitProxy *bool `json:"enableExplicitProxy,omitempty"` - - // When set to true, pac file port and url needs to be provided. - EnablePacFile *bool `json:"enablePacFile,omitempty"` - - // Port number for explicit proxy http protocol, cannot be greater than 64000. - HTTPPort *int32 `json:"httpPort,omitempty"` - - // Port number for explicit proxy https protocol, cannot be greater than 64000. - HTTPSPort *int32 `json:"httpsPort,omitempty"` - - // SAS URL for PAC file. - PacFile *string `json:"pacFile,omitempty"` - - // Port number for firewall to serve PAC file. - PacFilePort *int32 `json:"pacFilePort,omitempty"` -} - -// ExpressRouteCircuit resource. -type ExpressRouteCircuit struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Resource location. - Location *string `json:"location,omitempty"` - - // Properties of the express route circuit. - Properties *ExpressRouteCircuitPropertiesFormat `json:"properties,omitempty"` - - // The SKU. - SKU *ExpressRouteCircuitSKU `json:"sku,omitempty"` - - // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ExpressRouteCircuitArpTable - The ARP table associated with the ExpressRouteCircuit. -type ExpressRouteCircuitArpTable struct { - // Entry age in minutes. - Age *int32 `json:"age,omitempty"` - - // The IP address. - IPAddress *string `json:"ipAddress,omitempty"` - - // Interface address. - Interface *string `json:"interface,omitempty"` - - // The MAC address. - MacAddress *string `json:"macAddress,omitempty"` -} - -// ExpressRouteCircuitAuthorization - Authorization in an ExpressRouteCircuit resource. -type ExpressRouteCircuitAuthorization struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // 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"` - - // Properties of the express route circuit authorization. - Properties *AuthorizationPropertiesFormat `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ExpressRouteCircuitAuthorizationsClientBeginCreateOrUpdateOptions contains the optional parameters for the ExpressRouteCircuitAuthorizationsClient.BeginCreateOrUpdate -// method. -type ExpressRouteCircuitAuthorizationsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ExpressRouteCircuitAuthorizationsClientBeginDeleteOptions contains the optional parameters for the ExpressRouteCircuitAuthorizationsClient.BeginDelete -// method. -type ExpressRouteCircuitAuthorizationsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ExpressRouteCircuitAuthorizationsClientGetOptions contains the optional parameters for the ExpressRouteCircuitAuthorizationsClient.Get -// method. -type ExpressRouteCircuitAuthorizationsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ExpressRouteCircuitAuthorizationsClientListOptions contains the optional parameters for the ExpressRouteCircuitAuthorizationsClient.List -// method. -type ExpressRouteCircuitAuthorizationsClientListOptions struct { - // placeholder for future optional parameters -} - -// ExpressRouteCircuitConnection - Express Route Circuit Connection in an ExpressRouteCircuitPeering resource. -type ExpressRouteCircuitConnection struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // 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"` - - // Properties of the express route circuit connection. - Properties *ExpressRouteCircuitConnectionPropertiesFormat `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ExpressRouteCircuitConnectionListResult - Response for ListConnections API service call retrieves all global reach connections -// that belongs to a Private Peering for an ExpressRouteCircuit. -type ExpressRouteCircuitConnectionListResult struct { - // The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` - - // The global reach connection associated with Private Peering in an ExpressRoute Circuit. - Value []*ExpressRouteCircuitConnection `json:"value,omitempty"` -} - -// ExpressRouteCircuitConnectionPropertiesFormat - Properties of the express route circuit connection. -type ExpressRouteCircuitConnectionPropertiesFormat struct { - // /29 IP address space to carve out Customer addresses for tunnels. - AddressPrefix *string `json:"addressPrefix,omitempty"` - - // The authorization key. - AuthorizationKey *string `json:"authorizationKey,omitempty"` - - // Reference to Express Route Circuit Private Peering Resource of the circuit initiating connection. - ExpressRouteCircuitPeering *SubResource `json:"expressRouteCircuitPeering,omitempty"` - - // IPv6 Address PrefixProperties of the express route circuit connection. - IPv6CircuitConnectionConfig *IPv6CircuitConnectionConfig `json:"ipv6CircuitConnectionConfig,omitempty"` - - // Reference to Express Route Circuit Private Peering Resource of the peered circuit. - PeerExpressRouteCircuitPeering *SubResource `json:"peerExpressRouteCircuitPeering,omitempty"` - - // READ-ONLY; Express Route Circuit connection state. - CircuitConnectionStatus *CircuitConnectionStatus `json:"circuitConnectionStatus,omitempty" azure:"ro"` - - // READ-ONLY; The provisioning state of the express route circuit connection resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// ExpressRouteCircuitConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the ExpressRouteCircuitConnectionsClient.BeginCreateOrUpdate -// method. -type ExpressRouteCircuitConnectionsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ExpressRouteCircuitConnectionsClientBeginDeleteOptions contains the optional parameters for the ExpressRouteCircuitConnectionsClient.BeginDelete -// method. -type ExpressRouteCircuitConnectionsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ExpressRouteCircuitConnectionsClientGetOptions contains the optional parameters for the ExpressRouteCircuitConnectionsClient.Get -// method. -type ExpressRouteCircuitConnectionsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ExpressRouteCircuitConnectionsClientListOptions contains the optional parameters for the ExpressRouteCircuitConnectionsClient.List -// method. -type ExpressRouteCircuitConnectionsClientListOptions struct { - // placeholder for future optional parameters -} - -// ExpressRouteCircuitListResult - Response for ListExpressRouteCircuit API service call. -type ExpressRouteCircuitListResult struct { - // The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` - - // A list of ExpressRouteCircuits in a resource group. - Value []*ExpressRouteCircuit `json:"value,omitempty"` -} - -// ExpressRouteCircuitPeering - Peering in an ExpressRouteCircuit resource. -type ExpressRouteCircuitPeering struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // 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"` - - // Properties of the express route circuit peering. - Properties *ExpressRouteCircuitPeeringPropertiesFormat `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ExpressRouteCircuitPeeringConfig - Specifies the peering configuration. -type ExpressRouteCircuitPeeringConfig struct { - // The communities of bgp peering. Specified for microsoft peering. - AdvertisedCommunities []*string `json:"advertisedCommunities,omitempty"` - - // The reference to AdvertisedPublicPrefixes. - AdvertisedPublicPrefixes []*string `json:"advertisedPublicPrefixes,omitempty"` - - // The CustomerASN of the peering. - CustomerASN *int32 `json:"customerASN,omitempty"` - - // The legacy mode of the peering. - LegacyMode *int32 `json:"legacyMode,omitempty"` - - // The RoutingRegistryName of the configuration. - RoutingRegistryName *string `json:"routingRegistryName,omitempty"` - - // READ-ONLY; The advertised public prefix state of the Peering resource. - AdvertisedPublicPrefixesState *ExpressRouteCircuitPeeringAdvertisedPublicPrefixState `json:"advertisedPublicPrefixesState,omitempty" azure:"ro"` -} - -// ExpressRouteCircuitPeeringID - ExpressRoute circuit peering identifier. -type ExpressRouteCircuitPeeringID struct { - // The ID of the ExpressRoute circuit peering. - ID *string `json:"id,omitempty"` -} - -// ExpressRouteCircuitPeeringListResult - Response for ListPeering API service call retrieves all peerings that belong to -// an ExpressRouteCircuit. -type ExpressRouteCircuitPeeringListResult struct { - // The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` - - // The peerings in an express route circuit. - Value []*ExpressRouteCircuitPeering `json:"value,omitempty"` -} - -// ExpressRouteCircuitPeeringPropertiesFormat - Properties of the express route circuit peering. -type ExpressRouteCircuitPeeringPropertiesFormat struct { - // The Azure ASN. - AzureASN *int32 `json:"azureASN,omitempty"` - - // The list of circuit connections associated with Azure Private Peering for this circuit. - Connections []*ExpressRouteCircuitConnection `json:"connections,omitempty"` - - // The ExpressRoute connection. - ExpressRouteConnection *ExpressRouteConnectionID `json:"expressRouteConnection,omitempty"` - - // The GatewayManager Etag. - GatewayManagerEtag *string `json:"gatewayManagerEtag,omitempty"` - - // The IPv6 peering configuration. - IPv6PeeringConfig *IPv6ExpressRouteCircuitPeeringConfig `json:"ipv6PeeringConfig,omitempty"` - - // The Microsoft peering configuration. - MicrosoftPeeringConfig *ExpressRouteCircuitPeeringConfig `json:"microsoftPeeringConfig,omitempty"` - - // The peer ASN. - PeerASN *int64 `json:"peerASN,omitempty"` - - // The peering type. - PeeringType *ExpressRoutePeeringType `json:"peeringType,omitempty"` - - // The primary port. - PrimaryAzurePort *string `json:"primaryAzurePort,omitempty"` - - // The primary address prefix. - PrimaryPeerAddressPrefix *string `json:"primaryPeerAddressPrefix,omitempty"` - - // The reference to the RouteFilter resource. - RouteFilter *SubResource `json:"routeFilter,omitempty"` - - // The secondary port. - SecondaryAzurePort *string `json:"secondaryAzurePort,omitempty"` - - // The secondary address prefix. - SecondaryPeerAddressPrefix *string `json:"secondaryPeerAddressPrefix,omitempty"` - - // The shared key. - SharedKey *string `json:"sharedKey,omitempty"` - - // The peering state. - State *ExpressRoutePeeringState `json:"state,omitempty"` - - // The peering stats of express route circuit. - Stats *ExpressRouteCircuitStats `json:"stats,omitempty"` - - // The VLAN ID. - VlanID *int32 `json:"vlanId,omitempty"` - - // READ-ONLY; Who was the last to modify the peering. - LastModifiedBy *string `json:"lastModifiedBy,omitempty" azure:"ro"` - - // READ-ONLY; The list of peered circuit connections associated with Azure Private Peering for this circuit. - PeeredConnections []*PeerExpressRouteCircuitConnection `json:"peeredConnections,omitempty" azure:"ro"` - - // READ-ONLY; The provisioning state of the express route circuit peering resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// ExpressRouteCircuitPeeringsClientBeginCreateOrUpdateOptions contains the optional parameters for the ExpressRouteCircuitPeeringsClient.BeginCreateOrUpdate -// method. -type ExpressRouteCircuitPeeringsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ExpressRouteCircuitPeeringsClientBeginDeleteOptions contains the optional parameters for the ExpressRouteCircuitPeeringsClient.BeginDelete -// method. -type ExpressRouteCircuitPeeringsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ExpressRouteCircuitPeeringsClientGetOptions contains the optional parameters for the ExpressRouteCircuitPeeringsClient.Get -// method. -type ExpressRouteCircuitPeeringsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ExpressRouteCircuitPeeringsClientListOptions contains the optional parameters for the ExpressRouteCircuitPeeringsClient.List -// method. -type ExpressRouteCircuitPeeringsClientListOptions struct { - // placeholder for future optional parameters -} - -// ExpressRouteCircuitPropertiesFormat - Properties of ExpressRouteCircuit. -type ExpressRouteCircuitPropertiesFormat struct { - // Allow classic operations. - AllowClassicOperations *bool `json:"allowClassicOperations,omitempty"` - - // The authorizationKey. - AuthorizationKey *string `json:"authorizationKey,omitempty"` - - // The list of authorizations. - Authorizations []*ExpressRouteCircuitAuthorization `json:"authorizations,omitempty"` - - // The bandwidth of the circuit when the circuit is provisioned on an ExpressRoutePort resource. - BandwidthInGbps *float32 `json:"bandwidthInGbps,omitempty"` - - // The CircuitProvisioningState state of the resource. - CircuitProvisioningState *string `json:"circuitProvisioningState,omitempty"` - - // The reference to the ExpressRoutePort resource when the circuit is provisioned on an ExpressRoutePort resource. - ExpressRoutePort *SubResource `json:"expressRoutePort,omitempty"` - - // The GatewayManager Etag. - GatewayManagerEtag *string `json:"gatewayManagerEtag,omitempty"` - - // Flag denoting global reach status. - GlobalReachEnabled *bool `json:"globalReachEnabled,omitempty"` - - // The list of peerings. - Peerings []*ExpressRouteCircuitPeering `json:"peerings,omitempty"` - - // The ServiceKey. - ServiceKey *string `json:"serviceKey,omitempty"` - - // The ServiceProviderNotes. - ServiceProviderNotes *string `json:"serviceProviderNotes,omitempty"` - - // The ServiceProviderProperties. - ServiceProviderProperties *ExpressRouteCircuitServiceProviderProperties `json:"serviceProviderProperties,omitempty"` - - // The ServiceProviderProvisioningState state of the resource. - ServiceProviderProvisioningState *ServiceProviderProvisioningState `json:"serviceProviderProvisioningState,omitempty"` - - // READ-ONLY; The provisioning state of the express route circuit resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` - - // READ-ONLY; The identifier of the circuit traffic. Outer tag for QinQ encapsulation. - Stag *int32 `json:"stag,omitempty" azure:"ro"` -} - -// ExpressRouteCircuitReference - Reference to an express route circuit. -type ExpressRouteCircuitReference struct { - // Corresponding Express Route Circuit Id. - ID *string `json:"id,omitempty"` -} - -// ExpressRouteCircuitRoutesTable - The routes table associated with the ExpressRouteCircuit. -type ExpressRouteCircuitRoutesTable struct { - // Local preference value as set with the set local-preference route-map configuration command. - LocPrf *string `json:"locPrf,omitempty"` - - // IP address of a network entity. - Network *string `json:"network,omitempty"` - - // NextHop address. - NextHop *string `json:"nextHop,omitempty"` - - // Autonomous system paths to the destination network. - Path *string `json:"path,omitempty"` - - // Route Weight. - Weight *int32 `json:"weight,omitempty"` -} - -// ExpressRouteCircuitRoutesTableSummary - The routes table associated with the ExpressRouteCircuit. -type ExpressRouteCircuitRoutesTableSummary struct { - // Autonomous system number. - As *int32 `json:"as,omitempty"` - - // IP address of the neighbor. - Neighbor *string `json:"neighbor,omitempty"` - - // Current state of the BGP session, and the number of prefixes that have been received from a neighbor or peer group. - StatePfxRcd *string `json:"statePfxRcd,omitempty"` - - // The length of time that the BGP session has been in the Established state, or the current status if not in the Established - // state. - UpDown *string `json:"upDown,omitempty"` - - // BGP version number spoken to the neighbor. - V *int32 `json:"v,omitempty"` -} - -// ExpressRouteCircuitSKU - Contains SKU in an ExpressRouteCircuit. -type ExpressRouteCircuitSKU struct { - // The family of the SKU. - Family *ExpressRouteCircuitSKUFamily `json:"family,omitempty"` - - // The name of the SKU. - Name *string `json:"name,omitempty"` - - // The tier of the SKU. - Tier *ExpressRouteCircuitSKUTier `json:"tier,omitempty"` -} - -// ExpressRouteCircuitServiceProviderProperties - Contains ServiceProviderProperties in an ExpressRouteCircuit. -type ExpressRouteCircuitServiceProviderProperties struct { - // The BandwidthInMbps. - BandwidthInMbps *int32 `json:"bandwidthInMbps,omitempty"` - - // The peering location. - PeeringLocation *string `json:"peeringLocation,omitempty"` - - // The serviceProviderName. - ServiceProviderName *string `json:"serviceProviderName,omitempty"` -} - -// ExpressRouteCircuitStats - Contains stats associated with the peering. -type ExpressRouteCircuitStats struct { - // The Primary BytesIn of the peering. - PrimarybytesIn *int64 `json:"primarybytesIn,omitempty"` - - // The primary BytesOut of the peering. - PrimarybytesOut *int64 `json:"primarybytesOut,omitempty"` - - // The secondary BytesIn of the peering. - SecondarybytesIn *int64 `json:"secondarybytesIn,omitempty"` - - // The secondary BytesOut of the peering. - SecondarybytesOut *int64 `json:"secondarybytesOut,omitempty"` -} - -// ExpressRouteCircuitsArpTableListResult - Response for ListArpTable associated with the Express Route Circuits API. -type ExpressRouteCircuitsArpTableListResult struct { - // The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` - - // A list of the ARP tables. - Value []*ExpressRouteCircuitArpTable `json:"value,omitempty"` -} - -// ExpressRouteCircuitsClientBeginCreateOrUpdateOptions contains the optional parameters for the ExpressRouteCircuitsClient.BeginCreateOrUpdate -// method. -type ExpressRouteCircuitsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ExpressRouteCircuitsClientBeginDeleteOptions contains the optional parameters for the ExpressRouteCircuitsClient.BeginDelete -// method. -type ExpressRouteCircuitsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ExpressRouteCircuitsClientBeginListArpTableOptions contains the optional parameters for the ExpressRouteCircuitsClient.BeginListArpTable -// method. -type ExpressRouteCircuitsClientBeginListArpTableOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ExpressRouteCircuitsClientBeginListRoutesTableOptions contains the optional parameters for the ExpressRouteCircuitsClient.BeginListRoutesTable -// method. -type ExpressRouteCircuitsClientBeginListRoutesTableOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ExpressRouteCircuitsClientBeginListRoutesTableSummaryOptions contains the optional parameters for the ExpressRouteCircuitsClient.BeginListRoutesTableSummary -// method. -type ExpressRouteCircuitsClientBeginListRoutesTableSummaryOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ExpressRouteCircuitsClientGetOptions contains the optional parameters for the ExpressRouteCircuitsClient.Get method. -type ExpressRouteCircuitsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ExpressRouteCircuitsClientGetPeeringStatsOptions contains the optional parameters for the ExpressRouteCircuitsClient.GetPeeringStats -// method. -type ExpressRouteCircuitsClientGetPeeringStatsOptions struct { - // placeholder for future optional parameters -} - -// ExpressRouteCircuitsClientGetStatsOptions contains the optional parameters for the ExpressRouteCircuitsClient.GetStats -// method. -type ExpressRouteCircuitsClientGetStatsOptions struct { - // placeholder for future optional parameters -} - -// ExpressRouteCircuitsClientListAllOptions contains the optional parameters for the ExpressRouteCircuitsClient.ListAll method. -type ExpressRouteCircuitsClientListAllOptions struct { - // placeholder for future optional parameters -} - -// ExpressRouteCircuitsClientListOptions contains the optional parameters for the ExpressRouteCircuitsClient.List method. -type ExpressRouteCircuitsClientListOptions struct { - // placeholder for future optional parameters -} - -// ExpressRouteCircuitsClientUpdateTagsOptions contains the optional parameters for the ExpressRouteCircuitsClient.UpdateTags -// method. -type ExpressRouteCircuitsClientUpdateTagsOptions struct { - // placeholder for future optional parameters -} - -// ExpressRouteCircuitsRoutesTableListResult - Response for ListRoutesTable associated with the Express Route Circuits API. -type ExpressRouteCircuitsRoutesTableListResult struct { - // The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` - - // The list of routes table. - Value []*ExpressRouteCircuitRoutesTable `json:"value,omitempty"` -} - -// ExpressRouteCircuitsRoutesTableSummaryListResult - Response for ListRoutesTable associated with the Express Route Circuits -// API. -type ExpressRouteCircuitsRoutesTableSummaryListResult struct { - // The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` - - // A list of the routes table. - Value []*ExpressRouteCircuitRoutesTableSummary `json:"value,omitempty"` -} - -// ExpressRouteConnection resource. -type ExpressRouteConnection struct { - // REQUIRED; The name of the resource. - Name *string `json:"name,omitempty"` - - // Resource ID. - ID *string `json:"id,omitempty"` - - // Properties of the express route connection. - Properties *ExpressRouteConnectionProperties `json:"properties,omitempty"` -} - -// ExpressRouteConnectionID - The ID of the ExpressRouteConnection. -type ExpressRouteConnectionID struct { - // READ-ONLY; The ID of the ExpressRouteConnection. - ID *string `json:"id,omitempty" azure:"ro"` -} - -// ExpressRouteConnectionList - ExpressRouteConnection list. -type ExpressRouteConnectionList struct { - // The list of ExpressRoute connections. - Value []*ExpressRouteConnection `json:"value,omitempty"` -} - -// ExpressRouteConnectionProperties - Properties of the ExpressRouteConnection subresource. -type ExpressRouteConnectionProperties struct { - // REQUIRED; The ExpressRoute circuit peering. - ExpressRouteCircuitPeering *ExpressRouteCircuitPeeringID `json:"expressRouteCircuitPeering,omitempty"` - - // Authorization key to establish the connection. - AuthorizationKey *string `json:"authorizationKey,omitempty"` - - // Enable internet security. - EnableInternetSecurity *bool `json:"enableInternetSecurity,omitempty"` - - // Enable FastPath to vWan Firewall hub. - ExpressRouteGatewayBypass *bool `json:"expressRouteGatewayBypass,omitempty"` - - // The Routing Configuration indicating the associated and propagated route tables on this connection. - RoutingConfiguration *RoutingConfiguration `json:"routingConfiguration,omitempty"` - - // The routing weight associated to the connection. - RoutingWeight *int32 `json:"routingWeight,omitempty"` - - // READ-ONLY; The provisioning state of the express route connection resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// ExpressRouteConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the ExpressRouteConnectionsClient.BeginCreateOrUpdate -// method. -type ExpressRouteConnectionsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ExpressRouteConnectionsClientBeginDeleteOptions contains the optional parameters for the ExpressRouteConnectionsClient.BeginDelete -// method. -type ExpressRouteConnectionsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ExpressRouteConnectionsClientGetOptions contains the optional parameters for the ExpressRouteConnectionsClient.Get method. -type ExpressRouteConnectionsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ExpressRouteConnectionsClientListOptions contains the optional parameters for the ExpressRouteConnectionsClient.List method. -type ExpressRouteConnectionsClientListOptions struct { - // placeholder for future optional parameters -} - -// ExpressRouteCrossConnection resource. -type ExpressRouteCrossConnection struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Resource location. - Location *string `json:"location,omitempty"` - - // Properties of the express route cross connection. - Properties *ExpressRouteCrossConnectionProperties `json:"properties,omitempty"` - - // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ExpressRouteCrossConnectionListResult - Response for ListExpressRouteCrossConnection API service call. -type ExpressRouteCrossConnectionListResult struct { - // A list of ExpressRouteCrossConnection resources. - Value []*ExpressRouteCrossConnection `json:"value,omitempty"` - - // READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` -} - -// ExpressRouteCrossConnectionPeering - Peering in an ExpressRoute Cross Connection resource. -type ExpressRouteCrossConnectionPeering struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // 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"` - - // Properties of the express route cross connection peering. - Properties *ExpressRouteCrossConnectionPeeringProperties `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` -} - -// ExpressRouteCrossConnectionPeeringList - Response for ListPeering API service call retrieves all peerings that belong to -// an ExpressRouteCrossConnection. -type ExpressRouteCrossConnectionPeeringList struct { - // The peerings in an express route cross connection. - Value []*ExpressRouteCrossConnectionPeering `json:"value,omitempty"` - - // READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` -} - -// ExpressRouteCrossConnectionPeeringProperties - Properties of express route cross connection peering. -type ExpressRouteCrossConnectionPeeringProperties struct { - // The GatewayManager Etag. - GatewayManagerEtag *string `json:"gatewayManagerEtag,omitempty"` - - // The IPv6 peering configuration. - IPv6PeeringConfig *IPv6ExpressRouteCircuitPeeringConfig `json:"ipv6PeeringConfig,omitempty"` - - // The Microsoft peering configuration. - MicrosoftPeeringConfig *ExpressRouteCircuitPeeringConfig `json:"microsoftPeeringConfig,omitempty"` - - // The peer ASN. - PeerASN *int64 `json:"peerASN,omitempty"` - - // The peering type. - PeeringType *ExpressRoutePeeringType `json:"peeringType,omitempty"` - - // The primary address prefix. - PrimaryPeerAddressPrefix *string `json:"primaryPeerAddressPrefix,omitempty"` - - // The secondary address prefix. - SecondaryPeerAddressPrefix *string `json:"secondaryPeerAddressPrefix,omitempty"` - - // The shared key. - SharedKey *string `json:"sharedKey,omitempty"` - - // The peering state. - State *ExpressRoutePeeringState `json:"state,omitempty"` - - // The VLAN ID. - VlanID *int32 `json:"vlanId,omitempty"` - - // READ-ONLY; The Azure ASN. - AzureASN *int32 `json:"azureASN,omitempty" azure:"ro"` - - // READ-ONLY; Who was the last to modify the peering. - LastModifiedBy *string `json:"lastModifiedBy,omitempty" azure:"ro"` - - // READ-ONLY; The primary port. - PrimaryAzurePort *string `json:"primaryAzurePort,omitempty" azure:"ro"` - - // READ-ONLY; The provisioning state of the express route cross connection peering resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` - - // READ-ONLY; The secondary port. - SecondaryAzurePort *string `json:"secondaryAzurePort,omitempty" azure:"ro"` -} - -// ExpressRouteCrossConnectionPeeringsClientBeginCreateOrUpdateOptions contains the optional parameters for the ExpressRouteCrossConnectionPeeringsClient.BeginCreateOrUpdate -// method. -type ExpressRouteCrossConnectionPeeringsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ExpressRouteCrossConnectionPeeringsClientBeginDeleteOptions contains the optional parameters for the ExpressRouteCrossConnectionPeeringsClient.BeginDelete -// method. -type ExpressRouteCrossConnectionPeeringsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ExpressRouteCrossConnectionPeeringsClientGetOptions contains the optional parameters for the ExpressRouteCrossConnectionPeeringsClient.Get -// method. -type ExpressRouteCrossConnectionPeeringsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ExpressRouteCrossConnectionPeeringsClientListOptions contains the optional parameters for the ExpressRouteCrossConnectionPeeringsClient.List -// method. -type ExpressRouteCrossConnectionPeeringsClientListOptions struct { - // placeholder for future optional parameters -} - -// ExpressRouteCrossConnectionProperties - Properties of ExpressRouteCrossConnection. -type ExpressRouteCrossConnectionProperties struct { - // The ExpressRouteCircuit. - ExpressRouteCircuit *ExpressRouteCircuitReference `json:"expressRouteCircuit,omitempty"` - - // The list of peerings. - Peerings []*ExpressRouteCrossConnectionPeering `json:"peerings,omitempty"` - - // Additional read only notes set by the connectivity provider. - ServiceProviderNotes *string `json:"serviceProviderNotes,omitempty"` - - // The provisioning state of the circuit in the connectivity provider system. - ServiceProviderProvisioningState *ServiceProviderProvisioningState `json:"serviceProviderProvisioningState,omitempty"` - - // READ-ONLY; The circuit bandwidth In Mbps. - BandwidthInMbps *int32 `json:"bandwidthInMbps,omitempty" azure:"ro"` - - // READ-ONLY; The peering location of the ExpressRoute circuit. - PeeringLocation *string `json:"peeringLocation,omitempty" azure:"ro"` - - // READ-ONLY; The name of the primary port. - PrimaryAzurePort *string `json:"primaryAzurePort,omitempty" azure:"ro"` - - // READ-ONLY; The provisioning state of the express route cross connection resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` - - // READ-ONLY; The identifier of the circuit traffic. - STag *int32 `json:"sTag,omitempty" azure:"ro"` - - // READ-ONLY; The name of the secondary port. - SecondaryAzurePort *string `json:"secondaryAzurePort,omitempty" azure:"ro"` -} - -// ExpressRouteCrossConnectionRoutesTableSummary - The routes table associated with the ExpressRouteCircuit. -type ExpressRouteCrossConnectionRoutesTableSummary struct { - // Autonomous system number. - Asn *int32 `json:"asn,omitempty"` - - // IP address of Neighbor router. - Neighbor *string `json:"neighbor,omitempty"` - - // Current state of the BGP session, and the number of prefixes that have been received from a neighbor or peer group. - StateOrPrefixesReceived *string `json:"stateOrPrefixesReceived,omitempty"` - - // The length of time that the BGP session has been in the Established state, or the current status if not in the Established - // state. - UpDown *string `json:"upDown,omitempty"` -} - -// ExpressRouteCrossConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the ExpressRouteCrossConnectionsClient.BeginCreateOrUpdate -// method. -type ExpressRouteCrossConnectionsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ExpressRouteCrossConnectionsClientBeginListArpTableOptions contains the optional parameters for the ExpressRouteCrossConnectionsClient.BeginListArpTable -// method. -type ExpressRouteCrossConnectionsClientBeginListArpTableOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ExpressRouteCrossConnectionsClientBeginListRoutesTableOptions contains the optional parameters for the ExpressRouteCrossConnectionsClient.BeginListRoutesTable -// method. -type ExpressRouteCrossConnectionsClientBeginListRoutesTableOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ExpressRouteCrossConnectionsClientBeginListRoutesTableSummaryOptions contains the optional parameters for the ExpressRouteCrossConnectionsClient.BeginListRoutesTableSummary -// method. -type ExpressRouteCrossConnectionsClientBeginListRoutesTableSummaryOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ExpressRouteCrossConnectionsClientGetOptions contains the optional parameters for the ExpressRouteCrossConnectionsClient.Get -// method. -type ExpressRouteCrossConnectionsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ExpressRouteCrossConnectionsClientListByResourceGroupOptions contains the optional parameters for the ExpressRouteCrossConnectionsClient.ListByResourceGroup -// method. -type ExpressRouteCrossConnectionsClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// ExpressRouteCrossConnectionsClientListOptions contains the optional parameters for the ExpressRouteCrossConnectionsClient.List -// method. -type ExpressRouteCrossConnectionsClientListOptions struct { - // placeholder for future optional parameters -} - -// ExpressRouteCrossConnectionsClientUpdateTagsOptions contains the optional parameters for the ExpressRouteCrossConnectionsClient.UpdateTags -// method. -type ExpressRouteCrossConnectionsClientUpdateTagsOptions struct { - // placeholder for future optional parameters -} - -// ExpressRouteCrossConnectionsRoutesTableSummaryListResult - Response for ListRoutesTable associated with the Express Route -// Cross Connections. -type ExpressRouteCrossConnectionsRoutesTableSummaryListResult struct { - // A list of the routes table. - Value []*ExpressRouteCrossConnectionRoutesTableSummary `json:"value,omitempty"` - - // READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` -} - -// ExpressRouteGateway - ExpressRoute gateway resource. -type ExpressRouteGateway struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Resource location. - Location *string `json:"location,omitempty"` - - // Properties of the express route gateway. - Properties *ExpressRouteGatewayProperties `json:"properties,omitempty"` - - // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ExpressRouteGatewayList - List of ExpressRoute gateways. -type ExpressRouteGatewayList struct { - // List of ExpressRoute gateways. - Value []*ExpressRouteGateway `json:"value,omitempty"` -} - -// ExpressRouteGatewayProperties - ExpressRoute gateway resource properties. -type ExpressRouteGatewayProperties struct { - // REQUIRED; The Virtual Hub where the ExpressRoute gateway is or will be deployed. - VirtualHub *VirtualHubID `json:"virtualHub,omitempty"` - - // Configuration for auto scaling. - AutoScaleConfiguration *ExpressRouteGatewayPropertiesAutoScaleConfiguration `json:"autoScaleConfiguration,omitempty"` - - // List of ExpressRoute connections to the ExpressRoute gateway. - ExpressRouteConnections []*ExpressRouteConnection `json:"expressRouteConnections,omitempty"` - - // READ-ONLY; The provisioning state of the express route gateway resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// ExpressRouteGatewayPropertiesAutoScaleConfiguration - Configuration for auto scaling. -type ExpressRouteGatewayPropertiesAutoScaleConfiguration struct { - // Minimum and maximum number of scale units to deploy. - Bounds *ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds `json:"bounds,omitempty"` -} - -// ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds - Minimum and maximum number of scale units to deploy. -type ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds struct { - // Maximum number of scale units deployed for ExpressRoute gateway. - Max *int32 `json:"max,omitempty"` - - // Minimum number of scale units deployed for ExpressRoute gateway. - Min *int32 `json:"min,omitempty"` -} - -// ExpressRouteGatewaysClientBeginCreateOrUpdateOptions contains the optional parameters for the ExpressRouteGatewaysClient.BeginCreateOrUpdate -// method. -type ExpressRouteGatewaysClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ExpressRouteGatewaysClientBeginDeleteOptions contains the optional parameters for the ExpressRouteGatewaysClient.BeginDelete -// method. -type ExpressRouteGatewaysClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ExpressRouteGatewaysClientBeginUpdateTagsOptions contains the optional parameters for the ExpressRouteGatewaysClient.BeginUpdateTags -// method. -type ExpressRouteGatewaysClientBeginUpdateTagsOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ExpressRouteGatewaysClientGetOptions contains the optional parameters for the ExpressRouteGatewaysClient.Get method. -type ExpressRouteGatewaysClientGetOptions struct { - // placeholder for future optional parameters -} - -// ExpressRouteGatewaysClientListByResourceGroupOptions contains the optional parameters for the ExpressRouteGatewaysClient.ListByResourceGroup -// method. -type ExpressRouteGatewaysClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// ExpressRouteGatewaysClientListBySubscriptionOptions contains the optional parameters for the ExpressRouteGatewaysClient.ListBySubscription -// method. -type ExpressRouteGatewaysClientListBySubscriptionOptions struct { - // placeholder for future optional parameters -} - -// ExpressRouteLink child resource definition. -type ExpressRouteLink struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Name of child port resource that is unique among child port resources of the parent. - Name *string `json:"name,omitempty"` - - // ExpressRouteLink properties. - Properties *ExpressRouteLinkPropertiesFormat `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` -} - -// ExpressRouteLinkListResult - Response for ListExpressRouteLinks API service call. -type ExpressRouteLinkListResult struct { - // The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` - - // The list of ExpressRouteLink sub-resources. - Value []*ExpressRouteLink `json:"value,omitempty"` -} - -// ExpressRouteLinkMacSecConfig - ExpressRouteLink Mac Security Configuration. -type ExpressRouteLinkMacSecConfig struct { - // Keyvault Secret Identifier URL containing Mac security CAK key. - CakSecretIdentifier *string `json:"cakSecretIdentifier,omitempty"` - - // Mac security cipher. - Cipher *ExpressRouteLinkMacSecCipher `json:"cipher,omitempty"` - - // Keyvault Secret Identifier URL containing Mac security CKN key. - CknSecretIdentifier *string `json:"cknSecretIdentifier,omitempty"` - - // Sci mode enabled/disabled. - SciState *ExpressRouteLinkMacSecSciState `json:"sciState,omitempty"` -} - -// ExpressRouteLinkPropertiesFormat - Properties specific to ExpressRouteLink resources. -type ExpressRouteLinkPropertiesFormat struct { - // Administrative state of the physical port. - AdminState *ExpressRouteLinkAdminState `json:"adminState,omitempty"` - - // MacSec configuration. - MacSecConfig *ExpressRouteLinkMacSecConfig `json:"macSecConfig,omitempty"` - - // READ-ONLY; Physical fiber port type. - ConnectorType *ExpressRouteLinkConnectorType `json:"connectorType,omitempty" azure:"ro"` - - // READ-ONLY; Name of Azure router interface. - InterfaceName *string `json:"interfaceName,omitempty" azure:"ro"` - - // READ-ONLY; Mapping between physical port to patch panel port. - PatchPanelID *string `json:"patchPanelId,omitempty" azure:"ro"` - - // READ-ONLY; The provisioning state of the express route link resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` - - // READ-ONLY; Mapping of physical patch panel to rack. - RackID *string `json:"rackId,omitempty" azure:"ro"` - - // READ-ONLY; Name of Azure router associated with physical port. - RouterName *string `json:"routerName,omitempty" azure:"ro"` -} - -// ExpressRouteLinksClientGetOptions contains the optional parameters for the ExpressRouteLinksClient.Get method. -type ExpressRouteLinksClientGetOptions struct { - // placeholder for future optional parameters -} - -// ExpressRouteLinksClientListOptions contains the optional parameters for the ExpressRouteLinksClient.List method. -type ExpressRouteLinksClientListOptions struct { - // placeholder for future optional parameters -} - -// ExpressRoutePort resource definition. -type ExpressRoutePort struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // The identity of ExpressRoutePort, if configured. - Identity *ManagedServiceIdentity `json:"identity,omitempty"` - - // Resource location. - Location *string `json:"location,omitempty"` - - // ExpressRoutePort properties. - Properties *ExpressRoutePortPropertiesFormat `json:"properties,omitempty"` - - // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ExpressRoutePortAuthorization - ExpressRoutePort Authorization resource definition. -type ExpressRoutePortAuthorization struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // 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"` - - // ExpressRoutePort properties. - Properties *ExpressRoutePortAuthorizationPropertiesFormat `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ExpressRoutePortAuthorizationListResult - Response for ListExpressRoutePortAuthorizations API service call. -type ExpressRoutePortAuthorizationListResult struct { - // The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` - - // The authorizations in an ExpressRoute Port. - Value []*ExpressRoutePortAuthorization `json:"value,omitempty"` -} - -// ExpressRoutePortAuthorizationPropertiesFormat - Properties of ExpressRoutePort Authorization. -type ExpressRoutePortAuthorizationPropertiesFormat struct { - // READ-ONLY; The authorization key. - AuthorizationKey *string `json:"authorizationKey,omitempty" azure:"ro"` - - // READ-ONLY; The authorization use status. - AuthorizationUseStatus *ExpressRoutePortAuthorizationUseStatus `json:"authorizationUseStatus,omitempty" azure:"ro"` - - // READ-ONLY; The reference to the ExpressRoute circuit resource using the authorization. - CircuitResourceURI *string `json:"circuitResourceUri,omitempty" azure:"ro"` - - // READ-ONLY; The provisioning state of the authorization resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// ExpressRoutePortAuthorizationsClientBeginCreateOrUpdateOptions contains the optional parameters for the ExpressRoutePortAuthorizationsClient.BeginCreateOrUpdate -// method. -type ExpressRoutePortAuthorizationsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ExpressRoutePortAuthorizationsClientBeginDeleteOptions contains the optional parameters for the ExpressRoutePortAuthorizationsClient.BeginDelete -// method. -type ExpressRoutePortAuthorizationsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ExpressRoutePortAuthorizationsClientGetOptions contains the optional parameters for the ExpressRoutePortAuthorizationsClient.Get -// method. -type ExpressRoutePortAuthorizationsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ExpressRoutePortAuthorizationsClientListOptions contains the optional parameters for the ExpressRoutePortAuthorizationsClient.List -// method. -type ExpressRoutePortAuthorizationsClientListOptions struct { - // placeholder for future optional parameters -} - -// ExpressRoutePortListResult - Response for ListExpressRoutePorts API service call. -type ExpressRoutePortListResult struct { - // The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` - - // A list of ExpressRoutePort resources. - Value []*ExpressRoutePort `json:"value,omitempty"` -} - -// ExpressRoutePortPropertiesFormat - Properties specific to ExpressRoutePort resources. -type ExpressRoutePortPropertiesFormat struct { - // Bandwidth of procured ports in Gbps. - BandwidthInGbps *int32 `json:"bandwidthInGbps,omitempty"` - - // Encapsulation method on physical ports. - Encapsulation *ExpressRoutePortsEncapsulation `json:"encapsulation,omitempty"` - - // The set of physical links of the ExpressRoutePort resource. - Links []*ExpressRouteLink `json:"links,omitempty"` - - // The name of the peering location that the ExpressRoutePort is mapped to physically. - PeeringLocation *string `json:"peeringLocation,omitempty"` - - // READ-ONLY; Date of the physical port allocation to be used in Letter of Authorization. - AllocationDate *string `json:"allocationDate,omitempty" azure:"ro"` - - // READ-ONLY; Reference the ExpressRoute circuit(s) that are provisioned on this ExpressRoutePort resource. - Circuits []*SubResource `json:"circuits,omitempty" azure:"ro"` - - // READ-ONLY; Ether type of the physical port. - EtherType *string `json:"etherType,omitempty" azure:"ro"` - - // READ-ONLY; Maximum transmission unit of the physical port pair(s). - Mtu *string `json:"mtu,omitempty" azure:"ro"` - - // READ-ONLY; Aggregate Gbps of associated circuit bandwidths. - ProvisionedBandwidthInGbps *float32 `json:"provisionedBandwidthInGbps,omitempty" azure:"ro"` - - // READ-ONLY; The provisioning state of the express route port resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` - - // READ-ONLY; The resource GUID property of the express route port resource. - ResourceGUID *string `json:"resourceGuid,omitempty" azure:"ro"` -} - -// ExpressRoutePortsClientBeginCreateOrUpdateOptions contains the optional parameters for the ExpressRoutePortsClient.BeginCreateOrUpdate -// method. -type ExpressRoutePortsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ExpressRoutePortsClientBeginDeleteOptions contains the optional parameters for the ExpressRoutePortsClient.BeginDelete -// method. -type ExpressRoutePortsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ExpressRoutePortsClientGenerateLOAOptions contains the optional parameters for the ExpressRoutePortsClient.GenerateLOA -// method. -type ExpressRoutePortsClientGenerateLOAOptions struct { - // placeholder for future optional parameters -} - -// ExpressRoutePortsClientGetOptions contains the optional parameters for the ExpressRoutePortsClient.Get method. -type ExpressRoutePortsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ExpressRoutePortsClientListByResourceGroupOptions contains the optional parameters for the ExpressRoutePortsClient.ListByResourceGroup -// method. -type ExpressRoutePortsClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// ExpressRoutePortsClientListOptions contains the optional parameters for the ExpressRoutePortsClient.List method. -type ExpressRoutePortsClientListOptions struct { - // placeholder for future optional parameters -} - -// ExpressRoutePortsClientUpdateTagsOptions contains the optional parameters for the ExpressRoutePortsClient.UpdateTags method. -type ExpressRoutePortsClientUpdateTagsOptions struct { - // placeholder for future optional parameters -} - -// ExpressRoutePortsLocation - Definition of the ExpressRoutePorts peering location resource. -type ExpressRoutePortsLocation struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Resource location. - Location *string `json:"location,omitempty"` - - // ExpressRoutePort peering location properties. - Properties *ExpressRoutePortsLocationPropertiesFormat `json:"properties,omitempty"` - - // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ExpressRoutePortsLocationBandwidths - Real-time inventory of available ExpressRoute port bandwidths. -type ExpressRoutePortsLocationBandwidths struct { - // READ-ONLY; Bandwidth descriptive name. - OfferName *string `json:"offerName,omitempty" azure:"ro"` - - // READ-ONLY; Bandwidth value in Gbps. - ValueInGbps *int32 `json:"valueInGbps,omitempty" azure:"ro"` -} - -// ExpressRoutePortsLocationListResult - Response for ListExpressRoutePortsLocations API service call. -type ExpressRoutePortsLocationListResult struct { - // The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` - - // The list of all ExpressRoutePort peering locations. - Value []*ExpressRoutePortsLocation `json:"value,omitempty"` -} - -// ExpressRoutePortsLocationPropertiesFormat - Properties specific to ExpressRoutePorts peering location resources. -type ExpressRoutePortsLocationPropertiesFormat struct { - // The inventory of available ExpressRoutePort bandwidths. - AvailableBandwidths []*ExpressRoutePortsLocationBandwidths `json:"availableBandwidths,omitempty"` - - // READ-ONLY; Address of peering location. - Address *string `json:"address,omitempty" azure:"ro"` - - // READ-ONLY; Contact details of peering locations. - Contact *string `json:"contact,omitempty" azure:"ro"` - - // READ-ONLY; The provisioning state of the express route port location resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// ExpressRoutePortsLocationsClientGetOptions contains the optional parameters for the ExpressRoutePortsLocationsClient.Get -// method. -type ExpressRoutePortsLocationsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ExpressRoutePortsLocationsClientListOptions contains the optional parameters for the ExpressRoutePortsLocationsClient.List -// method. -type ExpressRoutePortsLocationsClientListOptions struct { - // placeholder for future optional parameters -} - -// ExpressRouteProviderPort resource. -type ExpressRouteProviderPort struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Resource location. - Location *string `json:"location,omitempty"` - - // Properties of the express route Service Provider Port. - Properties *ExpressRouteProviderPortProperties `json:"properties,omitempty"` - - // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ExpressRouteProviderPortListResult - Response for ListExpressRouteProviderPort API service call. -type ExpressRouteProviderPortListResult struct { - // A list of ExpressRouteProviderPort resources. - Value []*ExpressRouteProviderPort `json:"value,omitempty"` - - // READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` -} - -// ExpressRouteProviderPortProperties - Properties of ExpressRouteProviderPort. -type ExpressRouteProviderPortProperties struct { - // Overprovisioning factor for the port pair. - OverprovisionFactor *int32 `json:"overprovisionFactor,omitempty"` - - // The peering location of the port pair. - PeeringLocation *string `json:"peeringLocation,omitempty"` - - // Bandwidth of the port in Mbps - PortBandwidthInMbps *int32 `json:"portBandwidthInMbps,omitempty"` - - // Remaining Bandwidth of the port in Mbps - RemainingBandwidthInMbps *int32 `json:"remainingBandwidthInMbps,omitempty"` - - // Used Bandwidth of the port in Mbps - UsedBandwidthInMbps *int32 `json:"usedBandwidthInMbps,omitempty"` - - // READ-ONLY; The name of the port pair. - PortPairDescriptor *string `json:"portPairDescriptor,omitempty" azure:"ro"` - - // READ-ONLY; The name of the primary port. - PrimaryAzurePort *string `json:"primaryAzurePort,omitempty" azure:"ro"` - - // READ-ONLY; The name of the secondary port. - SecondaryAzurePort *string `json:"secondaryAzurePort,omitempty" azure:"ro"` -} - -// ExpressRouteProviderPortsLocationClientListOptions contains the optional parameters for the ExpressRouteProviderPortsLocationClient.List -// method. -type ExpressRouteProviderPortsLocationClientListOptions struct { - // The filter to apply on the operation. For example, you can use $filter=location eq '{state}'. - Filter *string -} - -// ExpressRouteServiceProvider - A ExpressRouteResourceProvider object. -type ExpressRouteServiceProvider struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Resource location. - Location *string `json:"location,omitempty"` - - // Properties of the express route service provider. - Properties *ExpressRouteServiceProviderPropertiesFormat `json:"properties,omitempty"` - - // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ExpressRouteServiceProviderBandwidthsOffered - Contains bandwidths offered in ExpressRouteServiceProvider resources. -type ExpressRouteServiceProviderBandwidthsOffered struct { - // The OfferName. - OfferName *string `json:"offerName,omitempty"` - - // The ValueInMbps. - ValueInMbps *int32 `json:"valueInMbps,omitempty"` -} - -// ExpressRouteServiceProviderListResult - Response for the ListExpressRouteServiceProvider API service call. -type ExpressRouteServiceProviderListResult struct { - // The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` - - // A list of ExpressRouteResourceProvider resources. - Value []*ExpressRouteServiceProvider `json:"value,omitempty"` -} - -// ExpressRouteServiceProviderPropertiesFormat - Properties of ExpressRouteServiceProvider. -type ExpressRouteServiceProviderPropertiesFormat struct { - // A list of bandwidths offered. - BandwidthsOffered []*ExpressRouteServiceProviderBandwidthsOffered `json:"bandwidthsOffered,omitempty"` - - // A list of peering locations. - PeeringLocations []*string `json:"peeringLocations,omitempty"` - - // READ-ONLY; The provisioning state of the express route service provider resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// ExpressRouteServiceProvidersClientListOptions contains the optional parameters for the ExpressRouteServiceProvidersClient.List -// method. -type ExpressRouteServiceProvidersClientListOptions struct { - // placeholder for future optional parameters -} - -// ExtendedLocation complex type. -type ExtendedLocation struct { - // The name of the extended location. - Name *string `json:"name,omitempty"` - - // The type of the extended location. - Type *ExtendedLocationTypes `json:"type,omitempty"` -} - -// FilterItems - Will contain the filter name and values to operate on -type FilterItems struct { - // The name of the field we would like to filter - Field *string `json:"field,omitempty"` - - // List of values to filter the current field by - Values []*string `json:"values,omitempty"` -} - -// FirewallPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the FirewallPoliciesClient.BeginCreateOrUpdate -// method. -type FirewallPoliciesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// FirewallPoliciesClientBeginDeleteOptions contains the optional parameters for the FirewallPoliciesClient.BeginDelete method. -type FirewallPoliciesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// FirewallPoliciesClientGetOptions contains the optional parameters for the FirewallPoliciesClient.Get method. -type FirewallPoliciesClientGetOptions struct { - // Expands referenced resources. - Expand *string -} - -// FirewallPoliciesClientListAllOptions contains the optional parameters for the FirewallPoliciesClient.ListAll method. -type FirewallPoliciesClientListAllOptions struct { - // placeholder for future optional parameters -} - -// FirewallPoliciesClientListOptions contains the optional parameters for the FirewallPoliciesClient.List method. -type FirewallPoliciesClientListOptions struct { - // placeholder for future optional parameters -} - -// FirewallPoliciesClientUpdateTagsOptions contains the optional parameters for the FirewallPoliciesClient.UpdateTags method. -type FirewallPoliciesClientUpdateTagsOptions struct { - // placeholder for future optional parameters -} - -// FirewallPolicy Resource. -type FirewallPolicy struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // The identity of the firewall policy. - Identity *ManagedServiceIdentity `json:"identity,omitempty"` - - // Resource location. - Location *string `json:"location,omitempty"` - - // Properties of the firewall policy. - Properties *FirewallPolicyPropertiesFormat `json:"properties,omitempty"` - - // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// FirewallPolicyCertificateAuthority - Trusted Root certificates properties for tls. -type FirewallPolicyCertificateAuthority struct { - // Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or 'Certificate' object stored in KeyVault. - KeyVaultSecretID *string `json:"keyVaultSecretId,omitempty"` - - // Name of the CA certificate. - Name *string `json:"name,omitempty"` -} - -// FirewallPolicyFilterRuleCollection - Firewall Policy Filter Rule Collection. -type FirewallPolicyFilterRuleCollection struct { - // REQUIRED; The type of the rule collection. - RuleCollectionType *FirewallPolicyRuleCollectionType `json:"ruleCollectionType,omitempty"` - - // The action type of a Filter rule collection. - Action *FirewallPolicyFilterRuleCollectionAction `json:"action,omitempty"` - - // The name of the rule collection. - Name *string `json:"name,omitempty"` - - // Priority of the Firewall Policy Rule Collection resource. - Priority *int32 `json:"priority,omitempty"` - - // List of rules included in a rule collection. - Rules []FirewallPolicyRuleClassification `json:"rules,omitempty"` -} - -// GetFirewallPolicyRuleCollection implements the FirewallPolicyRuleCollectionClassification interface for type FirewallPolicyFilterRuleCollection. -func (f *FirewallPolicyFilterRuleCollection) GetFirewallPolicyRuleCollection() *FirewallPolicyRuleCollection { - return &FirewallPolicyRuleCollection{ - RuleCollectionType: f.RuleCollectionType, - Name: f.Name, - Priority: f.Priority, - } -} - -// FirewallPolicyFilterRuleCollectionAction - Properties of the FirewallPolicyFilterRuleCollectionAction. -type FirewallPolicyFilterRuleCollectionAction struct { - // The type of action. - Type *FirewallPolicyFilterRuleCollectionActionType `json:"type,omitempty"` -} - -// FirewallPolicyIdpsSignaturesClientListOptions contains the optional parameters for the FirewallPolicyIdpsSignaturesClient.List -// method. -type FirewallPolicyIdpsSignaturesClientListOptions struct { - // placeholder for future optional parameters -} - -// FirewallPolicyIdpsSignaturesFilterValuesClientListOptions contains the optional parameters for the FirewallPolicyIdpsSignaturesFilterValuesClient.List -// method. -type FirewallPolicyIdpsSignaturesFilterValuesClientListOptions struct { - // placeholder for future optional parameters -} - -// FirewallPolicyIdpsSignaturesOverridesClientGetOptions contains the optional parameters for the FirewallPolicyIdpsSignaturesOverridesClient.Get -// method. -type FirewallPolicyIdpsSignaturesOverridesClientGetOptions struct { - // placeholder for future optional parameters -} - -// FirewallPolicyIdpsSignaturesOverridesClientListOptions contains the optional parameters for the FirewallPolicyIdpsSignaturesOverridesClient.List -// method. -type FirewallPolicyIdpsSignaturesOverridesClientListOptions struct { - // placeholder for future optional parameters -} - -// FirewallPolicyIdpsSignaturesOverridesClientPatchOptions contains the optional parameters for the FirewallPolicyIdpsSignaturesOverridesClient.Patch -// method. -type FirewallPolicyIdpsSignaturesOverridesClientPatchOptions struct { - // placeholder for future optional parameters -} - -// FirewallPolicyIdpsSignaturesOverridesClientPutOptions contains the optional parameters for the FirewallPolicyIdpsSignaturesOverridesClient.Put -// method. -type FirewallPolicyIdpsSignaturesOverridesClientPutOptions struct { - // placeholder for future optional parameters -} - -// FirewallPolicyInsights - Firewall Policy Insights. -type FirewallPolicyInsights struct { - // A flag to indicate if the insights are enabled on the policy. - IsEnabled *bool `json:"isEnabled,omitempty"` - - // Workspaces needed to configure the Firewall Policy Insights. - LogAnalyticsResources *FirewallPolicyLogAnalyticsResources `json:"logAnalyticsResources,omitempty"` - - // Number of days the insights should be enabled on the policy. - RetentionDays *int32 `json:"retentionDays,omitempty"` -} - -// FirewallPolicyIntrusionDetection - Configuration for intrusion detection mode and rules. -type FirewallPolicyIntrusionDetection struct { - // Intrusion detection configuration properties. - Configuration *FirewallPolicyIntrusionDetectionConfiguration `json:"configuration,omitempty"` - - // Intrusion detection general state. - Mode *FirewallPolicyIntrusionDetectionStateType `json:"mode,omitempty"` -} - -// FirewallPolicyIntrusionDetectionBypassTrafficSpecifications - Intrusion detection bypass traffic specification. -type FirewallPolicyIntrusionDetectionBypassTrafficSpecifications struct { - // Description of the bypass traffic rule. - Description *string `json:"description,omitempty"` - - // List of destination IP addresses or ranges for this rule. - DestinationAddresses []*string `json:"destinationAddresses,omitempty"` - - // List of destination IpGroups for this rule. - DestinationIPGroups []*string `json:"destinationIpGroups,omitempty"` - - // List of destination ports or ranges. - DestinationPorts []*string `json:"destinationPorts,omitempty"` - - // Name of the bypass traffic rule. - Name *string `json:"name,omitempty"` - - // The rule bypass protocol. - Protocol *FirewallPolicyIntrusionDetectionProtocol `json:"protocol,omitempty"` - - // List of source IP addresses or ranges for this rule. - SourceAddresses []*string `json:"sourceAddresses,omitempty"` - - // List of source IpGroups for this rule. - SourceIPGroups []*string `json:"sourceIpGroups,omitempty"` -} - -// FirewallPolicyIntrusionDetectionConfiguration - The operation for configuring intrusion detection. -type FirewallPolicyIntrusionDetectionConfiguration struct { - // List of rules for traffic to bypass. - BypassTrafficSettings []*FirewallPolicyIntrusionDetectionBypassTrafficSpecifications `json:"bypassTrafficSettings,omitempty"` - - // IDPS Private IP address ranges are used to identify traffic direction (i.e. inbound, outbound, etc.). By default, only - // ranges defined by IANA RFC 1918 are considered private IP addresses. To modify - // default ranges, specify your Private IP address ranges with this property - PrivateRanges []*string `json:"privateRanges,omitempty"` - - // List of specific signatures states. - SignatureOverrides []*FirewallPolicyIntrusionDetectionSignatureSpecification `json:"signatureOverrides,omitempty"` -} - -// FirewallPolicyIntrusionDetectionSignatureSpecification - Intrusion detection signatures specification states. -type FirewallPolicyIntrusionDetectionSignatureSpecification struct { - // Signature id. - ID *string `json:"id,omitempty"` - - // The signature state. - Mode *FirewallPolicyIntrusionDetectionStateType `json:"mode,omitempty"` -} - -// FirewallPolicyListResult - Response for ListFirewallPolicies API service call. -type FirewallPolicyListResult struct { - // URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` - - // List of Firewall Policies in a resource group. - Value []*FirewallPolicy `json:"value,omitempty"` -} - -// FirewallPolicyLogAnalyticsResources - Log Analytics Resources for Firewall Policy Insights. -type FirewallPolicyLogAnalyticsResources struct { - // The default workspace Id for Firewall Policy Insights. - DefaultWorkspaceID *SubResource `json:"defaultWorkspaceId,omitempty"` - - // List of workspaces for Firewall Policy Insights. - Workspaces []*FirewallPolicyLogAnalyticsWorkspace `json:"workspaces,omitempty"` -} - -// FirewallPolicyLogAnalyticsWorkspace - Log Analytics Workspace for Firewall Policy Insights. -type FirewallPolicyLogAnalyticsWorkspace struct { - // Region to configure the Workspace. - Region *string `json:"region,omitempty"` - - // The workspace Id for Firewall Policy Insights. - WorkspaceID *SubResource `json:"workspaceId,omitempty"` -} - -// FirewallPolicyNatRuleCollection - Firewall Policy NAT Rule Collection. -type FirewallPolicyNatRuleCollection struct { - // REQUIRED; The type of the rule collection. - RuleCollectionType *FirewallPolicyRuleCollectionType `json:"ruleCollectionType,omitempty"` - - // The action type of a Nat rule collection. - Action *FirewallPolicyNatRuleCollectionAction `json:"action,omitempty"` - - // The name of the rule collection. - Name *string `json:"name,omitempty"` - - // Priority of the Firewall Policy Rule Collection resource. - Priority *int32 `json:"priority,omitempty"` - - // List of rules included in a rule collection. - Rules []FirewallPolicyRuleClassification `json:"rules,omitempty"` -} - -// GetFirewallPolicyRuleCollection implements the FirewallPolicyRuleCollectionClassification interface for type FirewallPolicyNatRuleCollection. -func (f *FirewallPolicyNatRuleCollection) GetFirewallPolicyRuleCollection() *FirewallPolicyRuleCollection { - return &FirewallPolicyRuleCollection{ - RuleCollectionType: f.RuleCollectionType, - Name: f.Name, - Priority: f.Priority, - } -} - -// FirewallPolicyNatRuleCollectionAction - Properties of the FirewallPolicyNatRuleCollectionAction. -type FirewallPolicyNatRuleCollectionAction struct { - // The type of action. - Type *FirewallPolicyNatRuleCollectionActionType `json:"type,omitempty"` -} - -// FirewallPolicyPropertiesFormat - Firewall Policy definition. -type FirewallPolicyPropertiesFormat struct { - // The parent firewall policy from which rules are inherited. - BasePolicy *SubResource `json:"basePolicy,omitempty"` - - // DNS Proxy Settings definition. - DNSSettings *DNSSettings `json:"dnsSettings,omitempty"` - - // Explicit Proxy Settings definition. - ExplicitProxySettings *ExplicitProxySettings `json:"explicitProxySettings,omitempty"` - - // Insights on Firewall Policy. - Insights *FirewallPolicyInsights `json:"insights,omitempty"` - - // The configuration for Intrusion detection. - IntrusionDetection *FirewallPolicyIntrusionDetection `json:"intrusionDetection,omitempty"` - - // The Firewall Policy SKU. - SKU *FirewallPolicySKU `json:"sku,omitempty"` - - // SQL Settings definition. - SQL *FirewallPolicySQL `json:"sql,omitempty"` - - // The private IP addresses/IP ranges to which traffic will not be SNAT. - Snat *FirewallPolicySNAT `json:"snat,omitempty"` - - // The operation mode for Threat Intelligence. - ThreatIntelMode *AzureFirewallThreatIntelMode `json:"threatIntelMode,omitempty"` - - // ThreatIntel Whitelist for Firewall Policy. - ThreatIntelWhitelist *FirewallPolicyThreatIntelWhitelist `json:"threatIntelWhitelist,omitempty"` - - // TLS Configuration definition. - TransportSecurity *FirewallPolicyTransportSecurity `json:"transportSecurity,omitempty"` - - // READ-ONLY; List of references to Child Firewall Policies. - ChildPolicies []*SubResource `json:"childPolicies,omitempty" azure:"ro"` - - // READ-ONLY; List of references to Azure Firewalls that this Firewall Policy is associated with. - Firewalls []*SubResource `json:"firewalls,omitempty" azure:"ro"` - - // READ-ONLY; The provisioning state of the firewall policy resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` - - // READ-ONLY; List of references to FirewallPolicyRuleCollectionGroups. - RuleCollectionGroups []*SubResource `json:"ruleCollectionGroups,omitempty" azure:"ro"` -} - -// FirewallPolicyRuleClassification provides polymorphic access to related types. -// Call the interface's GetFirewallPolicyRule() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *ApplicationRule, *FirewallPolicyRule, *NatRule, *Rule -type FirewallPolicyRuleClassification interface { - // GetFirewallPolicyRule returns the FirewallPolicyRule content of the underlying type. - GetFirewallPolicyRule() *FirewallPolicyRule -} - -// FirewallPolicyRule - Properties of a rule. -type FirewallPolicyRule struct { - // REQUIRED; Rule Type. - RuleType *FirewallPolicyRuleType `json:"ruleType,omitempty"` - - // Description of the rule. - Description *string `json:"description,omitempty"` - - // Name of the rule. - Name *string `json:"name,omitempty"` -} - -// GetFirewallPolicyRule implements the FirewallPolicyRuleClassification interface for type FirewallPolicyRule. -func (f *FirewallPolicyRule) GetFirewallPolicyRule() *FirewallPolicyRule { return f } - -// FirewallPolicyRuleApplicationProtocol - Properties of the application rule protocol. -type FirewallPolicyRuleApplicationProtocol struct { - // Port number for the protocol, cannot be greater than 64000. - Port *int32 `json:"port,omitempty"` - - // Protocol type. - ProtocolType *FirewallPolicyRuleApplicationProtocolType `json:"protocolType,omitempty"` -} - -// FirewallPolicyRuleCollectionClassification provides polymorphic access to related types. -// Call the interface's GetFirewallPolicyRuleCollection() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *FirewallPolicyFilterRuleCollection, *FirewallPolicyNatRuleCollection, *FirewallPolicyRuleCollection -type FirewallPolicyRuleCollectionClassification interface { - // GetFirewallPolicyRuleCollection returns the FirewallPolicyRuleCollection content of the underlying type. - GetFirewallPolicyRuleCollection() *FirewallPolicyRuleCollection -} - -// FirewallPolicyRuleCollection - Properties of the rule collection. -type FirewallPolicyRuleCollection struct { - // REQUIRED; The type of the rule collection. - RuleCollectionType *FirewallPolicyRuleCollectionType `json:"ruleCollectionType,omitempty"` - - // The name of the rule collection. - Name *string `json:"name,omitempty"` - - // Priority of the Firewall Policy Rule Collection resource. - Priority *int32 `json:"priority,omitempty"` -} - -// GetFirewallPolicyRuleCollection implements the FirewallPolicyRuleCollectionClassification interface for type FirewallPolicyRuleCollection. -func (f *FirewallPolicyRuleCollection) GetFirewallPolicyRuleCollection() *FirewallPolicyRuleCollection { - return f -} - -// FirewallPolicyRuleCollectionGroup - Rule Collection Group resource. -type FirewallPolicyRuleCollectionGroup struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // 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"` - - // The properties of the firewall policy rule collection group. - Properties *FirewallPolicyRuleCollectionGroupProperties `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Rule Group type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// FirewallPolicyRuleCollectionGroupListResult - Response for ListFirewallPolicyRuleCollectionGroups API service call. -type FirewallPolicyRuleCollectionGroupListResult struct { - // URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` - - // List of FirewallPolicyRuleCollectionGroups in a FirewallPolicy. - Value []*FirewallPolicyRuleCollectionGroup `json:"value,omitempty"` -} - -// FirewallPolicyRuleCollectionGroupProperties - Properties of the rule collection group. -type FirewallPolicyRuleCollectionGroupProperties struct { - // Priority of the Firewall Policy Rule Collection Group resource. - Priority *int32 `json:"priority,omitempty"` - - // Group of Firewall Policy rule collections. - RuleCollections []FirewallPolicyRuleCollectionClassification `json:"ruleCollections,omitempty"` - - // READ-ONLY; The provisioning state of the firewall policy rule collection group resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// FirewallPolicyRuleCollectionGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the FirewallPolicyRuleCollectionGroupsClient.BeginCreateOrUpdate -// method. -type FirewallPolicyRuleCollectionGroupsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// FirewallPolicyRuleCollectionGroupsClientBeginDeleteOptions contains the optional parameters for the FirewallPolicyRuleCollectionGroupsClient.BeginDelete -// method. -type FirewallPolicyRuleCollectionGroupsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// FirewallPolicyRuleCollectionGroupsClientGetOptions contains the optional parameters for the FirewallPolicyRuleCollectionGroupsClient.Get -// method. -type FirewallPolicyRuleCollectionGroupsClientGetOptions struct { - // placeholder for future optional parameters -} - -// FirewallPolicyRuleCollectionGroupsClientListOptions contains the optional parameters for the FirewallPolicyRuleCollectionGroupsClient.List -// method. -type FirewallPolicyRuleCollectionGroupsClientListOptions struct { - // placeholder for future optional parameters -} - -// FirewallPolicySKU - SKU of Firewall policy. -type FirewallPolicySKU struct { - // Tier of Firewall Policy. - Tier *FirewallPolicySKUTier `json:"tier,omitempty"` -} - -// FirewallPolicySNAT - The private IP addresses/IP ranges to which traffic will not be SNAT. -type FirewallPolicySNAT struct { - // The operation mode for automatically learning private ranges to not be SNAT - AutoLearnPrivateRanges *AutoLearnPrivateRangesMode `json:"autoLearnPrivateRanges,omitempty"` - - // List of private IP addresses/IP address ranges to not be SNAT. - PrivateRanges []*string `json:"privateRanges,omitempty"` -} - -// FirewallPolicySQL - SQL Settings in Firewall Policy. -type FirewallPolicySQL struct { - // A flag to indicate if SQL Redirect traffic filtering is enabled. Turning on the flag requires no rule using port 11000-11999. - AllowSQLRedirect *bool `json:"allowSqlRedirect,omitempty"` -} - -// FirewallPolicyThreatIntelWhitelist - ThreatIntel Whitelist for Firewall Policy. -type FirewallPolicyThreatIntelWhitelist struct { - // List of FQDNs for the ThreatIntel Whitelist. - Fqdns []*string `json:"fqdns,omitempty"` - - // List of IP addresses for the ThreatIntel Whitelist. - IPAddresses []*string `json:"ipAddresses,omitempty"` -} - -// FirewallPolicyTransportSecurity - Configuration needed to perform TLS termination & initiation. -type FirewallPolicyTransportSecurity struct { - // The CA used for intermediate CA generation. - CertificateAuthority *FirewallPolicyCertificateAuthority `json:"certificateAuthority,omitempty"` -} - -// FlowLog - A flow log resource. -type FlowLog struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Resource location. - Location *string `json:"location,omitempty"` - - // Properties of the flow log. - Properties *FlowLogPropertiesFormat `json:"properties,omitempty"` - - // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// FlowLogFormatParameters - Parameters that define the flow log format. -type FlowLogFormatParameters struct { - // The file type of flow log. - Type *FlowLogFormatType `json:"type,omitempty"` - - // The version (revision) of the flow log. - Version *int32 `json:"version,omitempty"` -} - -// FlowLogInformation - Information on the configuration of flow log and traffic analytics (optional) . -type FlowLogInformation struct { - // REQUIRED; Properties of the flow log. - Properties *FlowLogProperties `json:"properties,omitempty"` - - // REQUIRED; The ID of the resource to configure for flow log and traffic analytics (optional) . - TargetResourceID *string `json:"targetResourceId,omitempty"` - - // Parameters that define the configuration of traffic analytics. - FlowAnalyticsConfiguration *TrafficAnalyticsProperties `json:"flowAnalyticsConfiguration,omitempty"` -} - -// FlowLogListResult - List of flow logs. -type FlowLogListResult struct { - // Information about flow log resource. - Value []*FlowLog `json:"value,omitempty"` - - // READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` -} - -// FlowLogProperties - Parameters that define the configuration of flow log. -type FlowLogProperties struct { - // REQUIRED; Flag to enable/disable flow logging. - Enabled *bool `json:"enabled,omitempty"` - - // REQUIRED; ID of the storage account which is used to store the flow log. - StorageID *string `json:"storageId,omitempty"` - - // Parameters that define the flow log format. - Format *FlowLogFormatParameters `json:"format,omitempty"` - - // Parameters that define the retention policy for flow log. - RetentionPolicy *RetentionPolicyParameters `json:"retentionPolicy,omitempty"` -} - -// FlowLogPropertiesFormat - Parameters that define the configuration of flow log. -type FlowLogPropertiesFormat struct { - // REQUIRED; ID of the storage account which is used to store the flow log. - StorageID *string `json:"storageId,omitempty"` - - // REQUIRED; ID of network security group to which flow log will be applied. - TargetResourceID *string `json:"targetResourceId,omitempty"` - - // Flag to enable/disable flow logging. - Enabled *bool `json:"enabled,omitempty"` - - // Parameters that define the configuration of traffic analytics. - FlowAnalyticsConfiguration *TrafficAnalyticsProperties `json:"flowAnalyticsConfiguration,omitempty"` - - // Parameters that define the flow log format. - Format *FlowLogFormatParameters `json:"format,omitempty"` - - // Parameters that define the retention policy for flow log. - RetentionPolicy *RetentionPolicyParameters `json:"retentionPolicy,omitempty"` - - // READ-ONLY; The provisioning state of the flow log. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` - - // READ-ONLY; Guid of network security group to which flow log will be applied. - TargetResourceGUID *string `json:"targetResourceGuid,omitempty" azure:"ro"` -} - -// FlowLogStatusParameters - Parameters that define a resource to query flow log and traffic analytics (optional) status. -type FlowLogStatusParameters struct { - // REQUIRED; The target resource where getting the flow log and traffic analytics (optional) status. - TargetResourceID *string `json:"targetResourceId,omitempty"` -} - -// FlowLogsClientBeginCreateOrUpdateOptions contains the optional parameters for the FlowLogsClient.BeginCreateOrUpdate method. -type FlowLogsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// FlowLogsClientBeginDeleteOptions contains the optional parameters for the FlowLogsClient.BeginDelete method. -type FlowLogsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// FlowLogsClientGetOptions contains the optional parameters for the FlowLogsClient.Get method. -type FlowLogsClientGetOptions struct { - // placeholder for future optional parameters -} - -// FlowLogsClientListOptions contains the optional parameters for the FlowLogsClient.List method. -type FlowLogsClientListOptions struct { - // placeholder for future optional parameters -} - -// FlowLogsClientUpdateTagsOptions contains the optional parameters for the FlowLogsClient.UpdateTags method. -type FlowLogsClientUpdateTagsOptions struct { - // placeholder for future optional parameters -} - -// FrontendIPConfiguration - Frontend IP address of the load balancer. -type FrontendIPConfiguration struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // The name of the resource that is unique within the set of frontend IP configurations used by the load balancer. This name - // can be used to access the resource. - Name *string `json:"name,omitempty"` - - // Properties of the load balancer probe. - Properties *FrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` - - // A list of availability zones denoting the IP allocated for the resource needs to come from. - Zones []*string `json:"zones,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// FrontendIPConfigurationPropertiesFormat - Properties of Frontend IP Configuration of the load balancer. -type FrontendIPConfigurationPropertiesFormat struct { - // The reference to gateway load balancer frontend IP. - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - - // The private IP address of the IP configuration. - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - - // Whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - - // The Private IP allocation method. - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - - // The reference to the Public IP resource. - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - - // The reference to the Public IP Prefix resource. - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - - // The reference to the subnet resource. - Subnet *Subnet `json:"subnet,omitempty"` - - // READ-ONLY; An array of references to inbound pools that use this frontend IP. - InboundNatPools []*SubResource `json:"inboundNatPools,omitempty" azure:"ro"` - - // READ-ONLY; An array of references to inbound rules that use this frontend IP. - InboundNatRules []*SubResource `json:"inboundNatRules,omitempty" azure:"ro"` - - // READ-ONLY; An array of references to load balancing rules that use this frontend IP. - LoadBalancingRules []*SubResource `json:"loadBalancingRules,omitempty" azure:"ro"` - - // READ-ONLY; An array of references to outbound rules that use this frontend IP. - OutboundRules []*SubResource `json:"outboundRules,omitempty" azure:"ro"` - - // READ-ONLY; The provisioning state of the frontend IP configuration resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// GatewayCustomBgpIPAddressIPConfiguration - GatewayCustomBgpIpAddressIpConfiguration for a virtual network gateway connection. -type GatewayCustomBgpIPAddressIPConfiguration struct { - // REQUIRED; The custom BgpPeeringAddress which belongs to IpconfigurationId. - CustomBgpIPAddress *string `json:"customBgpIpAddress,omitempty"` - - // REQUIRED; The IpconfigurationId of ipconfiguration which belongs to gateway. - IPConfigurationID *string `json:"ipConfigurationId,omitempty"` -} - -// GatewayLoadBalancerTunnelInterface - Gateway load balancer tunnel interface of a load balancer backend address pool. -type GatewayLoadBalancerTunnelInterface struct { - // Identifier of gateway load balancer tunnel interface. - Identifier *int32 `json:"identifier,omitempty"` - - // Port of gateway load balancer tunnel interface. - Port *int32 `json:"port,omitempty"` - - // Protocol of gateway load balancer tunnel interface. - Protocol *GatewayLoadBalancerTunnelProtocol `json:"protocol,omitempty"` - - // Traffic type of gateway load balancer tunnel interface. - Type *GatewayLoadBalancerTunnelInterfaceType `json:"type,omitempty"` -} - -// GatewayRoute - Gateway routing details. -type GatewayRoute struct { - // READ-ONLY; The route's AS path sequence. - AsPath *string `json:"asPath,omitempty" azure:"ro"` - - // READ-ONLY; The gateway's local address. - LocalAddress *string `json:"localAddress,omitempty" azure:"ro"` - - // READ-ONLY; The route's network prefix. - Network *string `json:"network,omitempty" azure:"ro"` - - // READ-ONLY; The route's next hop. - NextHop *string `json:"nextHop,omitempty" azure:"ro"` - - // READ-ONLY; The source this route was learned from. - Origin *string `json:"origin,omitempty" azure:"ro"` - - // READ-ONLY; The peer this route was learned from. - SourcePeer *string `json:"sourcePeer,omitempty" azure:"ro"` - - // READ-ONLY; The route's weight. - Weight *int32 `json:"weight,omitempty" azure:"ro"` -} - -// GatewayRouteListResult - List of virtual network gateway routes. -type GatewayRouteListResult struct { - // List of gateway routes. - Value []*GatewayRoute `json:"value,omitempty"` -} - -// GenerateExpressRoutePortsLOARequest - The customer name to be printed on a letter of authorization. -type GenerateExpressRoutePortsLOARequest struct { - // REQUIRED; The customer name. - CustomerName *string `json:"customerName,omitempty"` -} - -// GenerateExpressRoutePortsLOAResult - Response for GenerateExpressRoutePortsLOA API service call. -type GenerateExpressRoutePortsLOAResult struct { - // The content as a base64 encoded string. - EncodedContent *string `json:"encodedContent,omitempty"` -} - -// GetVPNSitesConfigurationRequest - List of Vpn-Sites. -type GetVPNSitesConfigurationRequest struct { - // REQUIRED; The sas-url to download the configurations for vpn-sites. - OutputBlobSasURL *string `json:"outputBlobSasUrl,omitempty"` - - // List of resource-ids of the vpn-sites for which config is to be downloaded. - VPNSites []*string `json:"vpnSites,omitempty"` -} - -// Group - The network group resource -type Group struct { - // The Network Group properties - Properties *GroupProperties `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; The system metadata related to this resource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// GroupListResult - Result of the request to list NetworkGroup. It contains a list of groups and a URL link to get the next -// set of results. -type GroupListResult struct { - // Gets the URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` - - // Gets a page of NetworkGroup - Value []*Group `json:"value,omitempty"` -} - -// GroupProperties - Properties of network group -type GroupProperties struct { - // A description of the network group. - Description *string `json:"description,omitempty"` - - // READ-ONLY; The provisioning state of the scope assignment resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// GroupsClientBeginDeleteOptions contains the optional parameters for the GroupsClient.BeginDelete method. -type GroupsClientBeginDeleteOptions struct { - // Deletes the resource even if it is part of a deployed configuration. If the configuration has been deployed, the service - // will do a cleanup deployment in the background, prior to the delete. - Force *bool - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GroupsClientCreateOrUpdateOptions contains the optional parameters for the GroupsClient.CreateOrUpdate method. -type GroupsClientCreateOrUpdateOptions struct { - // The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value - // to prevent accidentally overwriting concurrent changes. - IfMatch *string -} - -// GroupsClientGetOptions contains the optional parameters for the GroupsClient.Get method. -type GroupsClientGetOptions struct { - // placeholder for future optional parameters -} - -// GroupsClientListOptions contains the optional parameters for the GroupsClient.List method. -type GroupsClientListOptions struct { - // SkipToken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, - // the value of the nextLink element will include a skipToken parameter that - // specifies a starting point to use for subsequent calls. - SkipToken *string - // An optional query parameter which specifies the maximum number of records to be returned by the server. - Top *int32 -} - -// HTTPConfiguration - HTTP configuration of the connectivity check. -type HTTPConfiguration struct { - // List of HTTP headers. - Headers []*HTTPHeader `json:"headers,omitempty"` - - // HTTP method. - Method *HTTPMethod `json:"method,omitempty"` - - // Valid status codes. - ValidStatusCodes []*int32 `json:"validStatusCodes,omitempty"` -} - -// HTTPHeader - The HTTP header. -type HTTPHeader struct { - // The name in HTTP header. - Name *string `json:"name,omitempty"` - - // The value in HTTP header. - Value *string `json:"value,omitempty"` -} - -// HopLink - Hop link. -type HopLink struct { - // Hop link properties. - Properties *HopLinkProperties `json:"properties,omitempty"` - - // READ-ONLY; Provides additional context on links. - Context map[string]*string `json:"context,omitempty" azure:"ro"` - - // READ-ONLY; List of issues. - Issues []*ConnectivityIssue `json:"issues,omitempty" azure:"ro"` - - // READ-ONLY; Link type. - LinkType *string `json:"linkType,omitempty" azure:"ro"` - - // READ-ONLY; The ID of the next hop. - NextHopID *string `json:"nextHopId,omitempty" azure:"ro"` - - // READ-ONLY; Resource ID. - ResourceID *string `json:"resourceId,omitempty" azure:"ro"` -} - -// HopLinkProperties - Hop link properties. -type HopLinkProperties struct { - // READ-ONLY; Average roundtrip time in milliseconds. - RoundTripTimeAvg *int64 `json:"roundTripTimeAvg,omitempty" azure:"ro"` - - // READ-ONLY; Maximum roundtrip time in milliseconds. - RoundTripTimeMax *int64 `json:"roundTripTimeMax,omitempty" azure:"ro"` - - // READ-ONLY; Minimum roundtrip time in milliseconds. - RoundTripTimeMin *int64 `json:"roundTripTimeMin,omitempty" azure:"ro"` -} - -// Hub Item. -type Hub struct { - // Resource Id. - ResourceID *string `json:"resourceId,omitempty"` - - // Resource Type. - ResourceType *string `json:"resourceType,omitempty"` -} - -// HubIPAddresses - IP addresses associated with azure firewall. -type HubIPAddresses struct { - // Private IP Address associated with azure firewall. - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - - // Public IP addresses associated with azure firewall. - PublicIPs *HubPublicIPAddresses `json:"publicIPs,omitempty"` -} - -// HubIPConfiguration - IpConfigurations. -type HubIPConfiguration struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Name of the Ip Configuration. - Name *string `json:"name,omitempty"` - - // The properties of the Virtual Hub IPConfigurations. - Properties *HubIPConfigurationPropertiesFormat `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Ipconfiguration type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// HubIPConfigurationPropertiesFormat - Properties of IP configuration. -type HubIPConfigurationPropertiesFormat struct { - // The private IP address of the IP configuration. - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - - // The private IP address allocation method. - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - - // The reference to the public IP resource. - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - - // The reference to the subnet resource. - Subnet *Subnet `json:"subnet,omitempty"` - - // READ-ONLY; The provisioning state of the IP configuration resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// HubPublicIPAddresses - Public IP addresses associated with azure firewall. -type HubPublicIPAddresses struct { - // The list of Public IP addresses associated with azure firewall or IP addresses to be retained. - Addresses []*AzureFirewallPublicIPAddress `json:"addresses,omitempty"` - - // The number of Public IP addresses associated with azure firewall. - Count *int32 `json:"count,omitempty"` -} - -// HubRoute - RouteTable route. -type HubRoute struct { - // REQUIRED; The type of destinations (eg: CIDR, ResourceId, Service). - DestinationType *string `json:"destinationType,omitempty"` - - // REQUIRED; List of all destinations. - Destinations []*string `json:"destinations,omitempty"` - - // REQUIRED; The name of the Route that is unique within a RouteTable. This name can be used to access this route. - Name *string `json:"name,omitempty"` - - // REQUIRED; NextHop resource ID. - NextHop *string `json:"nextHop,omitempty"` - - // REQUIRED; The type of next hop (eg: ResourceId). - NextHopType *string `json:"nextHopType,omitempty"` -} - -// HubRouteTable - RouteTable resource in a virtual hub. -type HubRouteTable struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // 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"` - - // Properties of the RouteTable resource. - Properties *HubRouteTableProperties `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// HubRouteTableProperties - Parameters for RouteTable. -type HubRouteTableProperties struct { - // List of labels associated with this route table. - Labels []*string `json:"labels,omitempty"` - - // List of all routes. - Routes []*HubRoute `json:"routes,omitempty"` - - // READ-ONLY; List of all connections associated with this route table. - AssociatedConnections []*string `json:"associatedConnections,omitempty" azure:"ro"` - - // READ-ONLY; List of all connections that advertise to this route table. - PropagatingConnections []*string `json:"propagatingConnections,omitempty" azure:"ro"` - - // READ-ONLY; The provisioning state of the RouteTable resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// HubRouteTablesClientBeginCreateOrUpdateOptions contains the optional parameters for the HubRouteTablesClient.BeginCreateOrUpdate -// method. -type HubRouteTablesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// HubRouteTablesClientBeginDeleteOptions contains the optional parameters for the HubRouteTablesClient.BeginDelete method. -type HubRouteTablesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// HubRouteTablesClientGetOptions contains the optional parameters for the HubRouteTablesClient.Get method. -type HubRouteTablesClientGetOptions struct { - // placeholder for future optional parameters -} - -// HubRouteTablesClientListOptions contains the optional parameters for the HubRouteTablesClient.List method. -type HubRouteTablesClientListOptions struct { - // placeholder for future optional parameters -} - -// HubVirtualNetworkConnection Resource. -type HubVirtualNetworkConnection struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // 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"` - - // Properties of the hub virtual network connection. - Properties *HubVirtualNetworkConnectionProperties `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` -} - -// HubVirtualNetworkConnectionProperties - Parameters for HubVirtualNetworkConnection. -type HubVirtualNetworkConnectionProperties struct { - // Deprecated: VirtualHub to RemoteVnet transit to enabled or not. - AllowHubToRemoteVnetTransit *bool `json:"allowHubToRemoteVnetTransit,omitempty"` - - // Deprecated: Allow RemoteVnet to use Virtual Hub's gateways. - AllowRemoteVnetToUseHubVnetGateways *bool `json:"allowRemoteVnetToUseHubVnetGateways,omitempty"` - - // Enable internet security. - EnableInternetSecurity *bool `json:"enableInternetSecurity,omitempty"` - - // Reference to the remote virtual network. - RemoteVirtualNetwork *SubResource `json:"remoteVirtualNetwork,omitempty"` - - // The Routing Configuration indicating the associated and propagated route tables on this connection. - RoutingConfiguration *RoutingConfiguration `json:"routingConfiguration,omitempty"` - - // READ-ONLY; The provisioning state of the hub virtual network connection resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// HubVirtualNetworkConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the HubVirtualNetworkConnectionsClient.BeginCreateOrUpdate -// method. -type HubVirtualNetworkConnectionsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// HubVirtualNetworkConnectionsClientBeginDeleteOptions contains the optional parameters for the HubVirtualNetworkConnectionsClient.BeginDelete -// method. -type HubVirtualNetworkConnectionsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// HubVirtualNetworkConnectionsClientGetOptions contains the optional parameters for the HubVirtualNetworkConnectionsClient.Get -// method. -type HubVirtualNetworkConnectionsClientGetOptions struct { - // placeholder for future optional parameters -} - -// HubVirtualNetworkConnectionsClientListOptions contains the optional parameters for the HubVirtualNetworkConnectionsClient.List -// method. -type HubVirtualNetworkConnectionsClientListOptions struct { - // placeholder for future optional parameters -} - -// IDPSQueryObject - Will describe the query to run against the IDPS signatures DB -type IDPSQueryObject struct { - // Contain all filters names and values - Filters []*FilterItems `json:"filters,omitempty"` - - // Column to sort response by - OrderBy *OrderBy `json:"orderBy,omitempty"` - - // The number of the results to return in each page - ResultsPerPage *int32 `json:"resultsPerPage,omitempty"` - - // Search term in all columns - Search *string `json:"search,omitempty"` - - // The number of records matching the filter to skip - Skip *int32 `json:"skip,omitempty"` -} - -// IPAddressAvailabilityResult - Response for CheckIPAddressAvailability API service call. -type IPAddressAvailabilityResult struct { - // Private IP address availability. - Available *bool `json:"available,omitempty"` - - // Contains other available private IP addresses if the asked for address is taken. - AvailableIPAddresses []*string `json:"availableIPAddresses,omitempty"` - - // Private IP address platform reserved. - IsPlatformReserved *bool `json:"isPlatformReserved,omitempty"` -} - -// IPAllocation - IpAllocation resource. -type IPAllocation struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Resource location. - Location *string `json:"location,omitempty"` - - // Properties of the IpAllocation. - Properties *IPAllocationPropertiesFormat `json:"properties,omitempty"` - - // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// IPAllocationListResult - Response for the ListIpAllocations API service call. -type IPAllocationListResult struct { - // The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` - - // A list of IpAllocation resources. - Value []*IPAllocation `json:"value,omitempty"` -} - -// IPAllocationPropertiesFormat - Properties of the IpAllocation. -type IPAllocationPropertiesFormat struct { - // IpAllocation tags. - AllocationTags map[string]*string `json:"allocationTags,omitempty"` - - // The IPAM allocation ID. - IpamAllocationID *string `json:"ipamAllocationId,omitempty"` - - // The address prefix for the IpAllocation. - Prefix *string `json:"prefix,omitempty"` - - // The address prefix length for the IpAllocation. - PrefixLength *int32 `json:"prefixLength,omitempty"` - - // The address prefix Type for the IpAllocation. - PrefixType *IPVersion `json:"prefixType,omitempty"` - - // The type for the IpAllocation. - Type *IPAllocationType `json:"type,omitempty"` - - // READ-ONLY; The Subnet that using the prefix of this IpAllocation resource. - Subnet *SubResource `json:"subnet,omitempty" azure:"ro"` - - // READ-ONLY; The VirtualNetwork that using the prefix of this IpAllocation resource. - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty" azure:"ro"` -} - -// IPAllocationsClientBeginCreateOrUpdateOptions contains the optional parameters for the IPAllocationsClient.BeginCreateOrUpdate -// method. -type IPAllocationsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// IPAllocationsClientBeginDeleteOptions contains the optional parameters for the IPAllocationsClient.BeginDelete method. -type IPAllocationsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// IPAllocationsClientGetOptions contains the optional parameters for the IPAllocationsClient.Get method. -type IPAllocationsClientGetOptions struct { - // Expands referenced resources. - Expand *string -} - -// IPAllocationsClientListByResourceGroupOptions contains the optional parameters for the IPAllocationsClient.ListByResourceGroup -// method. -type IPAllocationsClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// IPAllocationsClientListOptions contains the optional parameters for the IPAllocationsClient.List method. -type IPAllocationsClientListOptions struct { - // placeholder for future optional parameters -} - -// IPAllocationsClientUpdateTagsOptions contains the optional parameters for the IPAllocationsClient.UpdateTags method. -type IPAllocationsClientUpdateTagsOptions struct { - // placeholder for future optional parameters -} - -// IPConfiguration - IP configuration. -type IPConfiguration struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // 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"` - - // Properties of the IP configuration. - Properties *IPConfigurationPropertiesFormat `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` -} - -// IPConfigurationBgpPeeringAddress - Properties of IPConfigurationBgpPeeringAddress. -type IPConfigurationBgpPeeringAddress struct { - // The list of custom BGP peering addresses which belong to IP configuration. - CustomBgpIPAddresses []*string `json:"customBgpIpAddresses,omitempty"` - - // The ID of IP configuration which belongs to gateway. - IPConfigurationID *string `json:"ipconfigurationId,omitempty"` - - // READ-ONLY; The list of default BGP peering addresses which belong to IP configuration. - DefaultBgpIPAddresses []*string `json:"defaultBgpIpAddresses,omitempty" azure:"ro"` - - // READ-ONLY; The list of tunnel public IP addresses which belong to IP configuration. - TunnelIPAddresses []*string `json:"tunnelIpAddresses,omitempty" azure:"ro"` -} - -// IPConfigurationProfile - IP configuration profile child resource. -type IPConfigurationProfile struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // The name of the resource. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - - // Properties of the IP configuration profile. - Properties *IPConfigurationProfilePropertiesFormat `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Sub Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// IPConfigurationProfilePropertiesFormat - IP configuration profile properties. -type IPConfigurationProfilePropertiesFormat struct { - // The reference to the subnet resource to create a container network interface ip configuration. - Subnet *Subnet `json:"subnet,omitempty"` - - // READ-ONLY; The provisioning state of the IP configuration profile resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// IPConfigurationPropertiesFormat - Properties of IP configuration. -type IPConfigurationPropertiesFormat struct { - // The private IP address of the IP configuration. - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - - // The private IP address allocation method. - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - - // The reference to the public IP resource. - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - - // The reference to the subnet resource. - Subnet *Subnet `json:"subnet,omitempty"` - - // READ-ONLY; The provisioning state of the IP configuration resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// IPGroup - The IpGroups resource information. -type IPGroup struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Resource location. - Location *string `json:"location,omitempty"` - - // Properties of the IpGroups. - Properties *IPGroupPropertiesFormat `json:"properties,omitempty"` - - // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// IPGroupListResult - Response for the ListIpGroups API service call. -type IPGroupListResult struct { - // URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` - - // The list of IpGroups information resources. - Value []*IPGroup `json:"value,omitempty"` -} - -// IPGroupPropertiesFormat - The IpGroups property information. -type IPGroupPropertiesFormat struct { - // IpAddresses/IpAddressPrefixes in the IpGroups resource. - IPAddresses []*string `json:"ipAddresses,omitempty"` - - // READ-ONLY; List of references to Firewall Policies resources that this IpGroups is associated with. - FirewallPolicies []*SubResource `json:"firewallPolicies,omitempty" azure:"ro"` - - // READ-ONLY; List of references to Firewall resources that this IpGroups is associated with. - Firewalls []*SubResource `json:"firewalls,omitempty" azure:"ro"` - - // READ-ONLY; The provisioning state of the IpGroups resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// IPGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the IPGroupsClient.BeginCreateOrUpdate method. -type IPGroupsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// IPGroupsClientBeginDeleteOptions contains the optional parameters for the IPGroupsClient.BeginDelete method. -type IPGroupsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// IPGroupsClientGetOptions contains the optional parameters for the IPGroupsClient.Get method. -type IPGroupsClientGetOptions struct { - // Expands resourceIds (of Firewalls/Network Security Groups etc.) back referenced by the IpGroups resource. - Expand *string -} - -// IPGroupsClientListByResourceGroupOptions contains the optional parameters for the IPGroupsClient.ListByResourceGroup method. -type IPGroupsClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// IPGroupsClientListOptions contains the optional parameters for the IPGroupsClient.List method. -type IPGroupsClientListOptions struct { - // placeholder for future optional parameters -} - -// IPGroupsClientUpdateGroupsOptions contains the optional parameters for the IPGroupsClient.UpdateGroups method. -type IPGroupsClientUpdateGroupsOptions struct { - // placeholder for future optional parameters -} - -// IPPrefixesList - List of SNAT IP Prefixes learnt by firewall to not SNAT -type IPPrefixesList struct { - // IP Prefix value. - IPPrefixes []*string `json:"ipPrefixes,omitempty"` -} - -// IPSecPolicy - An IPSec Policy configuration for a virtual network gateway connection. -type IPSecPolicy struct { - // REQUIRED; The DH Group used in IKE Phase 1 for initial SA. - DhGroup *DhGroup `json:"dhGroup,omitempty"` - - // REQUIRED; The IPSec encryption algorithm (IKE phase 1). - IPSecEncryption *IPSecEncryption `json:"ipsecEncryption,omitempty"` - - // REQUIRED; The IPSec integrity algorithm (IKE phase 1). - IPSecIntegrity *IPSecIntegrity `json:"ipsecIntegrity,omitempty"` - - // REQUIRED; The IKE encryption algorithm (IKE phase 2). - IkeEncryption *IkeEncryption `json:"ikeEncryption,omitempty"` - - // REQUIRED; The IKE integrity algorithm (IKE phase 2). - IkeIntegrity *IkeIntegrity `json:"ikeIntegrity,omitempty"` - - // REQUIRED; The Pfs Group used in IKE Phase 2 for new child SA. - PfsGroup *PfsGroup `json:"pfsGroup,omitempty"` - - // REQUIRED; The IPSec Security Association (also called Quick Mode or Phase 2 SA) payload size in KB for a site to site VPN - // tunnel. - SaDataSizeKilobytes *int32 `json:"saDataSizeKilobytes,omitempty"` - - // REQUIRED; The IPSec Security Association (also called Quick Mode or Phase 2 SA) lifetime in seconds for a site to site - // VPN tunnel. - SaLifeTimeSeconds *int32 `json:"saLifeTimeSeconds,omitempty"` -} - -// IPTag - Contains the IpTag associated with the object. -type IPTag struct { - // The IP tag type. Example: FirstPartyUsage. - IPTagType *string `json:"ipTagType,omitempty"` - - // The value of the IP tag associated with the public IP. Example: SQL. - Tag *string `json:"tag,omitempty"` -} - -// IPv6CircuitConnectionConfig - IPv6 Circuit Connection properties for global reach. -type IPv6CircuitConnectionConfig struct { - // /125 IP address space to carve out customer addresses for global reach. - AddressPrefix *string `json:"addressPrefix,omitempty"` - - // READ-ONLY; Express Route Circuit connection state. - CircuitConnectionStatus *CircuitConnectionStatus `json:"circuitConnectionStatus,omitempty" azure:"ro"` -} - -// IPv6ExpressRouteCircuitPeeringConfig - Contains IPv6 peering config. -type IPv6ExpressRouteCircuitPeeringConfig struct { - // The Microsoft peering configuration. - MicrosoftPeeringConfig *ExpressRouteCircuitPeeringConfig `json:"microsoftPeeringConfig,omitempty"` - - // The primary address prefix. - PrimaryPeerAddressPrefix *string `json:"primaryPeerAddressPrefix,omitempty"` - - // The reference to the RouteFilter resource. - RouteFilter *SubResource `json:"routeFilter,omitempty"` - - // The secondary address prefix. - SecondaryPeerAddressPrefix *string `json:"secondaryPeerAddressPrefix,omitempty"` - - // The state of peering. - State *ExpressRouteCircuitPeeringState `json:"state,omitempty"` -} - -// InboundNatPool - Inbound NAT pool of the load balancer. -type InboundNatPool struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // The name of the resource that is unique within the set of inbound NAT pools used by the load balancer. This name can be - // used to access the resource. - Name *string `json:"name,omitempty"` - - // Properties of load balancer inbound nat pool. - Properties *InboundNatPoolPropertiesFormat `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// InboundNatPoolPropertiesFormat - Properties of Inbound NAT pool. -type InboundNatPoolPropertiesFormat struct { - // REQUIRED; The port used for internal connections on the endpoint. Acceptable values are between 1 and 65535. - BackendPort *int32 `json:"backendPort,omitempty"` - - // REQUIRED; The last port number in the range of external ports that will be used to provide Inbound Nat to NICs associated - // with a load balancer. Acceptable values range between 1 and 65535. - FrontendPortRangeEnd *int32 `json:"frontendPortRangeEnd,omitempty"` - - // REQUIRED; The first port number in the range of external ports that will be used to provide Inbound Nat to NICs associated - // with a load balancer. Acceptable values range between 1 and 65534. - FrontendPortRangeStart *int32 `json:"frontendPortRangeStart,omitempty"` - - // REQUIRED; The reference to the transport protocol used by the inbound NAT pool. - Protocol *TransportProtocol `json:"protocol,omitempty"` - - // Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability - // Group. This setting is required when using the SQL AlwaysOn Availability Groups - // in SQL server. This setting can't be changed after you create the endpoint. - EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` - - // Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used - // when the protocol is set to TCP. - EnableTCPReset *bool `json:"enableTcpReset,omitempty"` - - // A reference to frontend IP addresses. - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - - // The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. - // This element is only used when the protocol is set to TCP. - IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` - - // READ-ONLY; The provisioning state of the inbound NAT pool resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// InboundNatRule - Inbound NAT rule of the load balancer. -type InboundNatRule struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // The name of the resource that is unique within the set of inbound NAT rules used by the load balancer. This name can be - // used to access the resource. - Name *string `json:"name,omitempty"` - - // Properties of load balancer inbound NAT rule. - Properties *InboundNatRulePropertiesFormat `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// InboundNatRuleListResult - Response for ListInboundNatRule API service call. -type InboundNatRuleListResult struct { - // A list of inbound NAT rules in a load balancer. - Value []*InboundNatRule `json:"value,omitempty"` - - // READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` -} - -// InboundNatRulePortMapping - Individual port mappings for inbound NAT rule created for backend pool. -type InboundNatRulePortMapping struct { - // READ-ONLY; Backend port. - BackendPort *int32 `json:"backendPort,omitempty" azure:"ro"` - - // READ-ONLY; Frontend port. - FrontendPort *int32 `json:"frontendPort,omitempty" azure:"ro"` - - // READ-ONLY; Name of inbound NAT rule. - InboundNatRuleName *string `json:"inboundNatRuleName,omitempty" azure:"ro"` - - // READ-ONLY; The reference to the transport protocol used by the inbound NAT rule. - Protocol *TransportProtocol `json:"protocol,omitempty" azure:"ro"` -} - -// InboundNatRulePropertiesFormat - Properties of the inbound NAT rule. -type InboundNatRulePropertiesFormat struct { - // A reference to backendAddressPool resource. - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - - // The port used for the internal endpoint. Acceptable values range from 1 to 65535. - BackendPort *int32 `json:"backendPort,omitempty"` - - // Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability - // Group. This setting is required when using the SQL AlwaysOn Availability Groups - // in SQL server. This setting can't be changed after you create the endpoint. - EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` - - // Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used - // when the protocol is set to TCP. - EnableTCPReset *bool `json:"enableTcpReset,omitempty"` - - // A reference to frontend IP addresses. - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - - // The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values - // range from 1 to 65534. - FrontendPort *int32 `json:"frontendPort,omitempty"` - - // The port range end for the external endpoint. This property is used together with BackendAddressPool and FrontendPortRangeStart. - // Individual inbound NAT rule port mappings will be created for each - // backend address from BackendAddressPool. Acceptable values range from 1 to 65534. - FrontendPortRangeEnd *int32 `json:"frontendPortRangeEnd,omitempty"` - - // The port range start for the external endpoint. This property is used together with BackendAddressPool and FrontendPortRangeEnd. - // Individual inbound NAT rule port mappings will be created for each - // backend address from BackendAddressPool. Acceptable values range from 1 to 65534. - FrontendPortRangeStart *int32 `json:"frontendPortRangeStart,omitempty"` - - // The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. - // This element is only used when the protocol is set to TCP. - IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` - - // The reference to the transport protocol used by the load balancing rule. - Protocol *TransportProtocol `json:"protocol,omitempty"` - - // READ-ONLY; A reference to a private IP address defined on a network interface of a VM. Traffic sent to the frontend port - // of each of the frontend IP configurations is forwarded to the backend IP. - BackendIPConfiguration *InterfaceIPConfiguration `json:"backendIPConfiguration,omitempty" azure:"ro"` - - // READ-ONLY; The provisioning state of the inbound NAT rule resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// InboundNatRulesClientBeginCreateOrUpdateOptions contains the optional parameters for the InboundNatRulesClient.BeginCreateOrUpdate -// method. -type InboundNatRulesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// InboundNatRulesClientBeginDeleteOptions contains the optional parameters for the InboundNatRulesClient.BeginDelete method. -type InboundNatRulesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// InboundNatRulesClientGetOptions contains the optional parameters for the InboundNatRulesClient.Get method. -type InboundNatRulesClientGetOptions struct { - // Expands referenced resources. - Expand *string -} - -// InboundNatRulesClientListOptions contains the optional parameters for the InboundNatRulesClient.List method. -type InboundNatRulesClientListOptions struct { - // placeholder for future optional parameters -} - -// InboundSecurityRule - NVA Inbound Security Rule resource. -type InboundSecurityRule struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Name of security rule collection. - Name *string `json:"name,omitempty"` - - // The properties of the Inbound Security Rules. - Properties *InboundSecurityRuleProperties `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; NVA inbound security rule type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// InboundSecurityRuleClientBeginCreateOrUpdateOptions contains the optional parameters for the InboundSecurityRuleClient.BeginCreateOrUpdate -// method. -type InboundSecurityRuleClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// InboundSecurityRuleProperties - Properties of the Inbound Security Rules resource. -type InboundSecurityRuleProperties struct { - // List of allowed rules. - Rules []*InboundSecurityRules `json:"rules,omitempty"` - - // READ-ONLY; The provisioning state of the resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// InboundSecurityRules - Properties of the Inbound Security Rules resource. -type InboundSecurityRules struct { - // NVA port ranges to be opened up. One needs to provide specific ports. - DestinationPortRange *int32 `json:"destinationPortRange,omitempty"` - - // Protocol. This should be either TCP or UDP. - Protocol *InboundSecurityRulesProtocol `json:"protocol,omitempty"` - - // The CIDR or source IP range. Only /30, /31 and /32 Ip ranges are allowed. - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` -} - -// IntentPolicy - Network Intent Policy resource. -type IntentPolicy struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Resource location. - Location *string `json:"location,omitempty"` - - // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// IntentPolicyConfiguration - Details of NetworkIntentPolicyConfiguration for PrepareNetworkPoliciesRequest. -type IntentPolicyConfiguration struct { - // The name of the Network Intent Policy for storing in target subscription. - NetworkIntentPolicyName *string `json:"networkIntentPolicyName,omitempty"` - - // Source network intent policy. - SourceNetworkIntentPolicy *IntentPolicy `json:"sourceNetworkIntentPolicy,omitempty"` -} - -// Interface - A network interface in a resource group. -type Interface struct { - // The extended location of the network interface. - ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` - - // Resource ID. - ID *string `json:"id,omitempty"` - - // Resource location. - Location *string `json:"location,omitempty"` - - // Properties of the network interface. - Properties *InterfacePropertiesFormat `json:"properties,omitempty"` - - // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// InterfaceAssociation - Network interface and its custom security rules. -type InterfaceAssociation struct { - // Collection of custom security rules. - SecurityRules []*SecurityRule `json:"securityRules,omitempty"` - - // READ-ONLY; Network interface ID. - ID *string `json:"id,omitempty" azure:"ro"` -} - -// InterfaceDNSSettings - DNS settings of a network interface. -type InterfaceDNSSettings struct { - // List of DNS servers IP addresses. Use 'AzureProvidedDNS' to switch to azure provided DNS resolution. 'AzureProvidedDNS' - // value cannot be combined with other IPs, it must be the only value in dnsServers - // collection. - DNSServers []*string `json:"dnsServers,omitempty"` - - // Relative DNS name for this NIC used for internal communications between VMs in the same virtual network. - InternalDNSNameLabel *string `json:"internalDnsNameLabel,omitempty"` - - // READ-ONLY; If the VM that uses this NIC is part of an Availability Set, then this list will have the union of all DNS servers - // from all NICs that are part of the Availability Set. This property is what is - // configured on each of those VMs. - AppliedDNSServers []*string `json:"appliedDnsServers,omitempty" azure:"ro"` - - // READ-ONLY; Even if internalDnsNameLabel is not specified, a DNS entry is created for the primary NIC of the VM. This DNS - // name can be constructed by concatenating the VM name with the value of - // internalDomainNameSuffix. - InternalDomainNameSuffix *string `json:"internalDomainNameSuffix,omitempty" azure:"ro"` - - // READ-ONLY; Fully qualified DNS name supporting internal communications between VMs in the same virtual network. - InternalFqdn *string `json:"internalFqdn,omitempty" azure:"ro"` -} - -// InterfaceIPConfiguration - IPConfiguration in a network interface. -type InterfaceIPConfiguration struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // 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"` - - // Network interface IP configuration properties. - Properties *InterfaceIPConfigurationPropertiesFormat `json:"properties,omitempty"` - - // Resource type. - Type *string `json:"type,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` -} - -// InterfaceIPConfigurationListResult - Response for list ip configurations API service call. -type InterfaceIPConfigurationListResult struct { - // A list of ip configurations. - Value []*InterfaceIPConfiguration `json:"value,omitempty"` - - // READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` -} - -// InterfaceIPConfigurationPrivateLinkConnectionProperties - PrivateLinkConnection properties for the network interface. -type InterfaceIPConfigurationPrivateLinkConnectionProperties struct { - // READ-ONLY; List of FQDNs for current private link connection. - Fqdns []*string `json:"fqdns,omitempty" azure:"ro"` - - // READ-ONLY; The group ID for current private link connection. - GroupID *string `json:"groupId,omitempty" azure:"ro"` - - // READ-ONLY; The required member name for current private link connection. - RequiredMemberName *string `json:"requiredMemberName,omitempty" azure:"ro"` -} - -// InterfaceIPConfigurationPropertiesFormat - Properties of IP configuration. -type InterfaceIPConfigurationPropertiesFormat struct { - // The reference to ApplicationGatewayBackendAddressPool resource. - ApplicationGatewayBackendAddressPools []*ApplicationGatewayBackendAddressPool `json:"applicationGatewayBackendAddressPools,omitempty"` - - // Application security groups in which the IP configuration is included. - ApplicationSecurityGroups []*ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - - // The reference to gateway load balancer frontend IP. - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - - // The reference to LoadBalancerBackendAddressPool resource. - LoadBalancerBackendAddressPools []*BackendAddressPool `json:"loadBalancerBackendAddressPools,omitempty"` - - // A list of references of LoadBalancerInboundNatRules. - LoadBalancerInboundNatRules []*InboundNatRule `json:"loadBalancerInboundNatRules,omitempty"` - - // Whether this is a primary customer address on the network interface. - Primary *bool `json:"primary,omitempty"` - - // Private IP address of the IP configuration. - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - - // Whether the specific IP configuration is IPv4 or IPv6. Default is IPv4. - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - - // The private IP address allocation method. - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - - // Public IP address bound to the IP configuration. - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - - // Subnet bound to the IP configuration. - Subnet *Subnet `json:"subnet,omitempty"` - - // The reference to Virtual Network Taps. - VirtualNetworkTaps []*VirtualNetworkTap `json:"virtualNetworkTaps,omitempty"` - - // READ-ONLY; PrivateLinkConnection properties for the network interface. - PrivateLinkConnectionProperties *InterfaceIPConfigurationPrivateLinkConnectionProperties `json:"privateLinkConnectionProperties,omitempty" azure:"ro"` - - // READ-ONLY; The provisioning state of the network interface IP configuration. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// InterfaceIPConfigurationsClientGetOptions contains the optional parameters for the InterfaceIPConfigurationsClient.Get -// method. -type InterfaceIPConfigurationsClientGetOptions struct { - // placeholder for future optional parameters -} - -// InterfaceIPConfigurationsClientListOptions contains the optional parameters for the InterfaceIPConfigurationsClient.List -// method. -type InterfaceIPConfigurationsClientListOptions struct { - // placeholder for future optional parameters -} - -// InterfaceListResult - Response for the ListNetworkInterface API service call. -type InterfaceListResult struct { - // A list of network interfaces in a resource group. - Value []*Interface `json:"value,omitempty"` - - // READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` -} - -// InterfaceLoadBalancerListResult - Response for list ip configurations API service call. -type InterfaceLoadBalancerListResult struct { - // A list of load balancers. - Value []*LoadBalancer `json:"value,omitempty"` - - // READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` -} - -// InterfaceLoadBalancersClientListOptions contains the optional parameters for the InterfaceLoadBalancersClient.List method. -type InterfaceLoadBalancersClientListOptions struct { - // placeholder for future optional parameters -} - -// InterfacePropertiesFormat - NetworkInterface properties. -type InterfacePropertiesFormat struct { - // Auxiliary mode of Network Interface resource. - AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` - - // The DNS settings in network interface. - DNSSettings *InterfaceDNSSettings `json:"dnsSettings,omitempty"` - - // If the network interface is configured for accelerated networking. Not applicable to VM sizes which require accelerated - // networking. - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - - // Indicates whether IP forwarding is enabled on this network interface. - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - - // A list of IPConfigurations of the network interface. - IPConfigurations []*InterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - - // Migration phase of Network Interface resource. - MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` - - // The reference to the NetworkSecurityGroup resource. - NetworkSecurityGroup *SecurityGroup `json:"networkSecurityGroup,omitempty"` - - // Type of Network Interface resource. - NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` - - // Privatelinkservice of the network interface resource. - PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` - - // WorkloadType of the NetworkInterface for BareMetal resources - WorkloadType *string `json:"workloadType,omitempty"` - - // READ-ONLY; A reference to the dscp configuration to which the network interface is linked. - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty" azure:"ro"` - - // READ-ONLY; A list of references to linked BareMetal resources. - HostedWorkloads []*string `json:"hostedWorkloads,omitempty" azure:"ro"` - - // READ-ONLY; The MAC address of the network interface. - MacAddress *string `json:"macAddress,omitempty" azure:"ro"` - - // READ-ONLY; Whether this is a primary network interface on a virtual machine. - Primary *bool `json:"primary,omitempty" azure:"ro"` - - // READ-ONLY; A reference to the private endpoint to which the network interface is linked. - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty" azure:"ro"` - - // READ-ONLY; The provisioning state of the network interface resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` - - // READ-ONLY; The resource GUID property of the network interface resource. - ResourceGUID *string `json:"resourceGuid,omitempty" azure:"ro"` - - // READ-ONLY; A list of TapConfigurations of the network interface. - TapConfigurations []*InterfaceTapConfiguration `json:"tapConfigurations,omitempty" azure:"ro"` - - // READ-ONLY; The reference to a virtual machine. - VirtualMachine *SubResource `json:"virtualMachine,omitempty" azure:"ro"` - - // READ-ONLY; Whether the virtual machine this nic is attached to supports encryption. - VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty" azure:"ro"` -} - -// InterfaceTapConfiguration - Tap configuration in a Network Interface. -type InterfaceTapConfiguration struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // 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"` - - // Properties of the Virtual Network Tap configuration. - Properties *InterfaceTapConfigurationPropertiesFormat `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Sub Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// InterfaceTapConfigurationListResult - Response for list tap configurations API service call. -type InterfaceTapConfigurationListResult struct { - // A list of tap configurations. - Value []*InterfaceTapConfiguration `json:"value,omitempty"` - - // READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` -} - -// InterfaceTapConfigurationPropertiesFormat - Properties of Virtual Network Tap configuration. -type InterfaceTapConfigurationPropertiesFormat struct { - // The reference to the Virtual Network Tap resource. - VirtualNetworkTap *VirtualNetworkTap `json:"virtualNetworkTap,omitempty"` - - // READ-ONLY; The provisioning state of the network interface tap configuration resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// InterfaceTapConfigurationsClientBeginCreateOrUpdateOptions contains the optional parameters for the InterfaceTapConfigurationsClient.BeginCreateOrUpdate -// method. -type InterfaceTapConfigurationsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// InterfaceTapConfigurationsClientBeginDeleteOptions contains the optional parameters for the InterfaceTapConfigurationsClient.BeginDelete -// method. -type InterfaceTapConfigurationsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// InterfaceTapConfigurationsClientGetOptions contains the optional parameters for the InterfaceTapConfigurationsClient.Get -// method. -type InterfaceTapConfigurationsClientGetOptions struct { - // placeholder for future optional parameters -} - -// InterfaceTapConfigurationsClientListOptions contains the optional parameters for the InterfaceTapConfigurationsClient.List -// method. -type InterfaceTapConfigurationsClientListOptions struct { - // placeholder for future optional parameters -} - -// InterfacesClientBeginCreateOrUpdateOptions contains the optional parameters for the InterfacesClient.BeginCreateOrUpdate -// method. -type InterfacesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// InterfacesClientBeginDeleteOptions contains the optional parameters for the InterfacesClient.BeginDelete method. -type InterfacesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// InterfacesClientBeginGetEffectiveRouteTableOptions contains the optional parameters for the InterfacesClient.BeginGetEffectiveRouteTable -// method. -type InterfacesClientBeginGetEffectiveRouteTableOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// InterfacesClientBeginListEffectiveNetworkSecurityGroupsOptions contains the optional parameters for the InterfacesClient.BeginListEffectiveNetworkSecurityGroups -// method. -type InterfacesClientBeginListEffectiveNetworkSecurityGroupsOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// InterfacesClientGetCloudServiceNetworkInterfaceOptions contains the optional parameters for the InterfacesClient.GetCloudServiceNetworkInterface -// method. -type InterfacesClientGetCloudServiceNetworkInterfaceOptions struct { - // Expands referenced resources. - Expand *string -} - -// InterfacesClientGetOptions contains the optional parameters for the InterfacesClient.Get method. -type InterfacesClientGetOptions struct { - // Expands referenced resources. - Expand *string -} - -// InterfacesClientGetVirtualMachineScaleSetIPConfigurationOptions contains the optional parameters for the InterfacesClient.GetVirtualMachineScaleSetIPConfiguration -// method. -type InterfacesClientGetVirtualMachineScaleSetIPConfigurationOptions struct { - // Expands referenced resources. - Expand *string -} - -// InterfacesClientGetVirtualMachineScaleSetNetworkInterfaceOptions contains the optional parameters for the InterfacesClient.GetVirtualMachineScaleSetNetworkInterface -// method. -type InterfacesClientGetVirtualMachineScaleSetNetworkInterfaceOptions struct { - // Expands referenced resources. - Expand *string -} - -// InterfacesClientListAllOptions contains the optional parameters for the InterfacesClient.ListAll method. -type InterfacesClientListAllOptions struct { - // placeholder for future optional parameters -} - -// InterfacesClientListCloudServiceNetworkInterfacesOptions contains the optional parameters for the InterfacesClient.ListCloudServiceNetworkInterfaces -// method. -type InterfacesClientListCloudServiceNetworkInterfacesOptions struct { - // placeholder for future optional parameters -} - -// InterfacesClientListCloudServiceRoleInstanceNetworkInterfacesOptions contains the optional parameters for the InterfacesClient.ListCloudServiceRoleInstanceNetworkInterfaces -// method. -type InterfacesClientListCloudServiceRoleInstanceNetworkInterfacesOptions struct { - // placeholder for future optional parameters -} - -// InterfacesClientListOptions contains the optional parameters for the InterfacesClient.List method. -type InterfacesClientListOptions struct { - // placeholder for future optional parameters -} - -// InterfacesClientListVirtualMachineScaleSetIPConfigurationsOptions contains the optional parameters for the InterfacesClient.ListVirtualMachineScaleSetIPConfigurations -// method. -type InterfacesClientListVirtualMachineScaleSetIPConfigurationsOptions struct { - // Expands referenced resources. - Expand *string -} - -// InterfacesClientListVirtualMachineScaleSetNetworkInterfacesOptions contains the optional parameters for the InterfacesClient.ListVirtualMachineScaleSetNetworkInterfaces -// method. -type InterfacesClientListVirtualMachineScaleSetNetworkInterfacesOptions struct { - // placeholder for future optional parameters -} - -// InterfacesClientListVirtualMachineScaleSetVMNetworkInterfacesOptions contains the optional parameters for the InterfacesClient.ListVirtualMachineScaleSetVMNetworkInterfaces -// method. -type InterfacesClientListVirtualMachineScaleSetVMNetworkInterfacesOptions struct { - // placeholder for future optional parameters -} - -// InterfacesClientUpdateTagsOptions contains the optional parameters for the InterfacesClient.UpdateTags method. -type InterfacesClientUpdateTagsOptions struct { - // placeholder for future optional parameters -} - -// ListHubRouteTablesResult - List of RouteTables and a URL nextLink to get the next set of results. -type ListHubRouteTablesResult struct { - // URL to get the next set of operation list results if there are any. - NextLink *string `json:"nextLink,omitempty"` - - // List of RouteTables. - Value []*HubRouteTable `json:"value,omitempty"` -} - -// ListHubVirtualNetworkConnectionsResult - List of HubVirtualNetworkConnections and a URL nextLink to get the next set of -// results. -type ListHubVirtualNetworkConnectionsResult struct { - // URL to get the next set of operation list results if there are any. - NextLink *string `json:"nextLink,omitempty"` - - // List of HubVirtualNetworkConnections. - Value []*HubVirtualNetworkConnection `json:"value,omitempty"` -} - -// ListP2SVPNGatewaysResult - Result of the request to list P2SVpnGateways. It contains a list of P2SVpnGateways and a URL -// nextLink to get the next set of results. -type ListP2SVPNGatewaysResult struct { - // URL to get the next set of operation list results if there are any. - NextLink *string `json:"nextLink,omitempty"` - - // List of P2SVpnGateways. - Value []*P2SVPNGateway `json:"value,omitempty"` -} - -// ListRoutingIntentResult - List of the routing intent result and a URL nextLink to get the next set of results. -type ListRoutingIntentResult struct { - // URL to get the next set of operation list results if there are any. - NextLink *string `json:"nextLink,omitempty"` - - // List of RoutingIntent resource. - Value []*RoutingIntent `json:"value,omitempty"` -} - -// ListVPNConnectionsResult - Result of the request to list all vpn connections to a virtual wan vpn gateway. It contains -// a list of Vpn Connections and a URL nextLink to get the next set of results. -type ListVPNConnectionsResult struct { - // URL to get the next set of operation list results if there are any. - NextLink *string `json:"nextLink,omitempty"` - - // List of Vpn Connections. - Value []*VPNConnection `json:"value,omitempty"` -} - -// ListVPNGatewayNatRulesResult - Result of the request to list all nat rules to a virtual wan vpn gateway. It contains a -// list of Nat rules and a URL nextLink to get the next set of results. -type ListVPNGatewayNatRulesResult struct { - // URL to get the next set of operation list results if there are any. - NextLink *string `json:"nextLink,omitempty"` - - // List of Nat Rules. - Value []*VPNGatewayNatRule `json:"value,omitempty"` -} - -// ListVPNGatewaysResult - Result of the request to list VpnGateways. It contains a list of VpnGateways and a URL nextLink -// to get the next set of results. -type ListVPNGatewaysResult struct { - // URL to get the next set of operation list results if there are any. - NextLink *string `json:"nextLink,omitempty"` - - // List of VpnGateways. - Value []*VPNGateway `json:"value,omitempty"` -} - -// ListVPNServerConfigurationPolicyGroupsResult - Result of the request to list VpnServerConfigurationPolicyGroups. It contains -// a list of VpnServerConfigurationPolicyGroups and a URL nextLink to get the next set of results. -type ListVPNServerConfigurationPolicyGroupsResult struct { - // URL to get the next set of operation list results if there are any. - NextLink *string `json:"nextLink,omitempty"` - - // List of VpnServerConfigurationPolicyGroups. - Value []*VPNServerConfigurationPolicyGroup `json:"value,omitempty"` -} - -// ListVPNServerConfigurationsResult - Result of the request to list all VpnServerConfigurations. It contains a list of VpnServerConfigurations -// and a URL nextLink to get the next set of results. -type ListVPNServerConfigurationsResult struct { - // URL to get the next set of operation list results if there are any. - NextLink *string `json:"nextLink,omitempty"` - - // List of VpnServerConfigurations. - Value []*VPNServerConfiguration `json:"value,omitempty"` -} - -// ListVPNSiteLinkConnectionsResult - Result of the request to list all vpn connections to a virtual wan vpn gateway. It contains -// a list of Vpn Connections and a URL nextLink to get the next set of results. -type ListVPNSiteLinkConnectionsResult struct { - // URL to get the next set of operation list results if there are any. - NextLink *string `json:"nextLink,omitempty"` - - // List of VpnSiteLinkConnections. - Value []*VPNSiteLinkConnection `json:"value,omitempty"` -} - -// ListVPNSiteLinksResult - Result of the request to list VpnSiteLinks. It contains a list of VpnSiteLinks and a URL nextLink -// to get the next set of results. -type ListVPNSiteLinksResult struct { - // URL to get the next set of operation list results if there are any. - NextLink *string `json:"nextLink,omitempty"` - - // List of VpnSitesLinks. - Value []*VPNSiteLink `json:"value,omitempty"` -} - -// ListVPNSitesResult - Result of the request to list VpnSites. It contains a list of VpnSites and a URL nextLink to get the -// next set of results. -type ListVPNSitesResult struct { - // URL to get the next set of operation list results if there are any. - NextLink *string `json:"nextLink,omitempty"` - - // List of VpnSites. - Value []*VPNSite `json:"value,omitempty"` -} - -// ListVirtualHubBgpConnectionResults - VirtualHubBgpConnections list. -type ListVirtualHubBgpConnectionResults struct { - // URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` - - // The list of VirtualHubBgpConnections. - Value []*BgpConnection `json:"value,omitempty"` -} - -// ListVirtualHubIPConfigurationResults - VirtualHubIpConfigurations list. -type ListVirtualHubIPConfigurationResults struct { - // URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` - - // The list of VirtualHubIpConfigurations. - Value []*HubIPConfiguration `json:"value,omitempty"` -} - -// ListVirtualHubRouteTableV2SResult - List of VirtualHubRouteTableV2s and a URL nextLink to get the next set of results. -type ListVirtualHubRouteTableV2SResult struct { - // URL to get the next set of operation list results if there are any. - NextLink *string `json:"nextLink,omitempty"` - - // List of VirtualHubRouteTableV2s. - Value []*VirtualHubRouteTableV2 `json:"value,omitempty"` -} - -// ListVirtualHubsResult - Result of the request to list VirtualHubs. It contains a list of VirtualHubs and a URL nextLink -// to get the next set of results. -type ListVirtualHubsResult struct { - // URL to get the next set of operation list results if there are any. - NextLink *string `json:"nextLink,omitempty"` - - // List of VirtualHubs. - Value []*VirtualHub `json:"value,omitempty"` -} - -// ListVirtualNetworkGatewayNatRulesResult - Result of the request to list all nat rules to a virtual network gateway. It -// contains a list of Nat rules and a URL nextLink to get the next set of results. -type ListVirtualNetworkGatewayNatRulesResult struct { - // URL to get the next set of operation list results if there are any. - NextLink *string `json:"nextLink,omitempty"` - - // List of Nat Rules. - Value []*VirtualNetworkGatewayNatRule `json:"value,omitempty"` -} - -// ListVirtualWANsResult - Result of the request to list VirtualWANs. It contains a list of VirtualWANs and a URL nextLink -// to get the next set of results. -type ListVirtualWANsResult struct { - // URL to get the next set of operation list results if there are any. - NextLink *string `json:"nextLink,omitempty"` - - // List of VirtualWANs. - Value []*VirtualWAN `json:"value,omitempty"` -} - -// LoadBalancer resource. -type LoadBalancer struct { - // The extended location of the load balancer. - ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` - - // Resource ID. - ID *string `json:"id,omitempty"` - - // Resource location. - Location *string `json:"location,omitempty"` - - // Properties of load balancer. - Properties *LoadBalancerPropertiesFormat `json:"properties,omitempty"` - - // The load balancer SKU. - SKU *LoadBalancerSKU `json:"sku,omitempty"` - - // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// LoadBalancerBackendAddress - Load balancer backend addresses. -type LoadBalancerBackendAddress struct { - // Name of the backend address. - Name *string `json:"name,omitempty"` - - // Properties of load balancer backend address pool. - Properties *LoadBalancerBackendAddressPropertiesFormat `json:"properties,omitempty"` -} - -// LoadBalancerBackendAddressPoolListResult - Response for ListBackendAddressPool API service call. -type LoadBalancerBackendAddressPoolListResult struct { - // A list of backend address pools in a load balancer. - Value []*BackendAddressPool `json:"value,omitempty"` - - // READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` -} - -// LoadBalancerBackendAddressPoolsClientBeginCreateOrUpdateOptions contains the optional parameters for the LoadBalancerBackendAddressPoolsClient.BeginCreateOrUpdate -// method. -type LoadBalancerBackendAddressPoolsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// LoadBalancerBackendAddressPoolsClientBeginDeleteOptions contains the optional parameters for the LoadBalancerBackendAddressPoolsClient.BeginDelete -// method. -type LoadBalancerBackendAddressPoolsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// LoadBalancerBackendAddressPoolsClientGetOptions contains the optional parameters for the LoadBalancerBackendAddressPoolsClient.Get -// method. -type LoadBalancerBackendAddressPoolsClientGetOptions struct { - // placeholder for future optional parameters -} - -// LoadBalancerBackendAddressPoolsClientListOptions contains the optional parameters for the LoadBalancerBackendAddressPoolsClient.List -// method. -type LoadBalancerBackendAddressPoolsClientListOptions struct { - // placeholder for future optional parameters -} - -// LoadBalancerBackendAddressPropertiesFormat - Properties of the load balancer backend addresses. -type LoadBalancerBackendAddressPropertiesFormat struct { - // A list of administrative states which once set can override health probe so that Load Balancer will always forward new - // connections to backend, or deny new connections and reset existing connections. - AdminState *LoadBalancerBackendAddressAdminState `json:"adminState,omitempty"` - - // IP Address belonging to the referenced virtual network. - IPAddress *string `json:"ipAddress,omitempty"` - - // Reference to the frontend ip address configuration defined in regional loadbalancer. - LoadBalancerFrontendIPConfiguration *SubResource `json:"loadBalancerFrontendIPConfiguration,omitempty"` - - // Reference to an existing subnet. - Subnet *SubResource `json:"subnet,omitempty"` - - // Reference to an existing virtual network. - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` - - // READ-ONLY; Collection of inbound NAT rule port mappings. - InboundNatRulesPortMapping []*NatRulePortMapping `json:"inboundNatRulesPortMapping,omitempty" azure:"ro"` - - // READ-ONLY; Reference to IP address defined in network interfaces. - NetworkInterfaceIPConfiguration *SubResource `json:"networkInterfaceIPConfiguration,omitempty" azure:"ro"` -} - -// LoadBalancerFrontendIPConfigurationListResult - Response for ListFrontendIPConfiguration API service call. -type LoadBalancerFrontendIPConfigurationListResult struct { - // A list of frontend IP configurations in a load balancer. - Value []*FrontendIPConfiguration `json:"value,omitempty"` - - // READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` -} - -// LoadBalancerFrontendIPConfigurationsClientGetOptions contains the optional parameters for the LoadBalancerFrontendIPConfigurationsClient.Get -// method. -type LoadBalancerFrontendIPConfigurationsClientGetOptions struct { - // placeholder for future optional parameters -} - -// LoadBalancerFrontendIPConfigurationsClientListOptions contains the optional parameters for the LoadBalancerFrontendIPConfigurationsClient.List -// method. -type LoadBalancerFrontendIPConfigurationsClientListOptions struct { - // placeholder for future optional parameters -} - -// LoadBalancerListResult - Response for ListLoadBalancers API service call. -type LoadBalancerListResult struct { - // A list of load balancers in a resource group. - Value []*LoadBalancer `json:"value,omitempty"` - - // READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` -} - -// LoadBalancerLoadBalancingRuleListResult - Response for ListLoadBalancingRule API service call. -type LoadBalancerLoadBalancingRuleListResult struct { - // A list of load balancing rules in a load balancer. - Value []*LoadBalancingRule `json:"value,omitempty"` - - // READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` -} - -// LoadBalancerLoadBalancingRulesClientGetOptions contains the optional parameters for the LoadBalancerLoadBalancingRulesClient.Get -// method. -type LoadBalancerLoadBalancingRulesClientGetOptions struct { - // placeholder for future optional parameters -} - -// LoadBalancerLoadBalancingRulesClientListOptions contains the optional parameters for the LoadBalancerLoadBalancingRulesClient.List -// method. -type LoadBalancerLoadBalancingRulesClientListOptions struct { - // placeholder for future optional parameters -} - -// LoadBalancerNetworkInterfacesClientListOptions contains the optional parameters for the LoadBalancerNetworkInterfacesClient.List -// method. -type LoadBalancerNetworkInterfacesClientListOptions struct { - // placeholder for future optional parameters -} - -// LoadBalancerOutboundRuleListResult - Response for ListOutboundRule API service call. -type LoadBalancerOutboundRuleListResult struct { - // A list of outbound rules in a load balancer. - Value []*OutboundRule `json:"value,omitempty"` - - // READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` -} - -// LoadBalancerOutboundRulesClientGetOptions contains the optional parameters for the LoadBalancerOutboundRulesClient.Get -// method. -type LoadBalancerOutboundRulesClientGetOptions struct { - // placeholder for future optional parameters -} - -// LoadBalancerOutboundRulesClientListOptions contains the optional parameters for the LoadBalancerOutboundRulesClient.List -// method. -type LoadBalancerOutboundRulesClientListOptions struct { - // placeholder for future optional parameters -} - -// LoadBalancerProbeListResult - Response for ListProbe API service call. -type LoadBalancerProbeListResult struct { - // A list of probes in a load balancer. - Value []*Probe `json:"value,omitempty"` - - // READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` -} - -// LoadBalancerProbesClientGetOptions contains the optional parameters for the LoadBalancerProbesClient.Get method. -type LoadBalancerProbesClientGetOptions struct { - // placeholder for future optional parameters -} - -// LoadBalancerProbesClientListOptions contains the optional parameters for the LoadBalancerProbesClient.List method. -type LoadBalancerProbesClientListOptions struct { - // placeholder for future optional parameters -} - -// LoadBalancerPropertiesFormat - Properties of the load balancer. -type LoadBalancerPropertiesFormat struct { - // Collection of backend address pools used by a load balancer. - BackendAddressPools []*BackendAddressPool `json:"backendAddressPools,omitempty"` - - // Object representing the frontend IPs to be used for the load balancer. - FrontendIPConfigurations []*FrontendIPConfiguration `json:"frontendIPConfigurations,omitempty"` - - // Defines an external port range for inbound NAT to a single backend port on NICs associated with a load balancer. Inbound - // NAT rules are created automatically for each NIC associated with the Load - // Balancer using an external port from this range. Defining an Inbound NAT pool on your Load Balancer is mutually exclusive - // with defining inbound NAT rules. Inbound NAT pools are referenced from virtual - // machine scale sets. NICs that are associated with individual virtual machines cannot reference an inbound NAT pool. They - // have to reference individual inbound NAT rules. - InboundNatPools []*InboundNatPool `json:"inboundNatPools,omitempty"` - - // Collection of inbound NAT Rules used by a load balancer. Defining inbound NAT rules on your load balancer is mutually exclusive - // with defining an inbound NAT pool. Inbound NAT pools are referenced from - // virtual machine scale sets. NICs that are associated with individual virtual machines cannot reference an Inbound NAT pool. - // They have to reference individual inbound NAT rules. - InboundNatRules []*InboundNatRule `json:"inboundNatRules,omitempty"` - - // Object collection representing the load balancing rules Gets the provisioning. - LoadBalancingRules []*LoadBalancingRule `json:"loadBalancingRules,omitempty"` - - // The outbound rules. - OutboundRules []*OutboundRule `json:"outboundRules,omitempty"` - - // Collection of probe objects used in the load balancer. - Probes []*Probe `json:"probes,omitempty"` - - // READ-ONLY; The provisioning state of the load balancer resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` - - // READ-ONLY; The resource GUID property of the load balancer resource. - ResourceGUID *string `json:"resourceGuid,omitempty" azure:"ro"` -} - -// LoadBalancerSKU - SKU of a load balancer. -type LoadBalancerSKU struct { - // Name of a load balancer SKU. - Name *LoadBalancerSKUName `json:"name,omitempty"` - - // Tier of a load balancer SKU. - Tier *LoadBalancerSKUTier `json:"tier,omitempty"` -} - -// LoadBalancerVipSwapRequest - The request for a VIP swap. -type LoadBalancerVipSwapRequest struct { - // A list of frontend IP configuration resources that should swap VIPs. - FrontendIPConfigurations []*LoadBalancerVipSwapRequestFrontendIPConfiguration `json:"frontendIPConfigurations,omitempty"` -} - -// LoadBalancerVipSwapRequestFrontendIPConfiguration - VIP swap request's frontend IP configuration object. -type LoadBalancerVipSwapRequestFrontendIPConfiguration struct { - // The ID of frontend IP configuration resource. - ID *string `json:"id,omitempty"` - - // The properties of VIP swap request's frontend IP configuration object. - Properties *LoadBalancerVipSwapRequestFrontendIPConfigurationProperties `json:"properties,omitempty"` -} - -// LoadBalancerVipSwapRequestFrontendIPConfigurationProperties - The properties of VIP swap request's frontend IP configuration -// object. -type LoadBalancerVipSwapRequestFrontendIPConfigurationProperties struct { - // A reference to public IP address resource. - PublicIPAddress *SubResource `json:"publicIPAddress,omitempty"` -} - -// LoadBalancersClientBeginCreateOrUpdateOptions contains the optional parameters for the LoadBalancersClient.BeginCreateOrUpdate -// method. -type LoadBalancersClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// LoadBalancersClientBeginDeleteOptions contains the optional parameters for the LoadBalancersClient.BeginDelete method. -type LoadBalancersClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// LoadBalancersClientBeginListInboundNatRulePortMappingsOptions contains the optional parameters for the LoadBalancersClient.BeginListInboundNatRulePortMappings -// method. -type LoadBalancersClientBeginListInboundNatRulePortMappingsOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// LoadBalancersClientBeginSwapPublicIPAddressesOptions contains the optional parameters for the LoadBalancersClient.BeginSwapPublicIPAddresses -// method. -type LoadBalancersClientBeginSwapPublicIPAddressesOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// LoadBalancersClientGetOptions contains the optional parameters for the LoadBalancersClient.Get method. -type LoadBalancersClientGetOptions struct { - // Expands referenced resources. - Expand *string -} - -// LoadBalancersClientListAllOptions contains the optional parameters for the LoadBalancersClient.ListAll method. -type LoadBalancersClientListAllOptions struct { - // placeholder for future optional parameters -} - -// LoadBalancersClientListOptions contains the optional parameters for the LoadBalancersClient.List method. -type LoadBalancersClientListOptions struct { - // placeholder for future optional parameters -} - -// LoadBalancersClientUpdateTagsOptions contains the optional parameters for the LoadBalancersClient.UpdateTags method. -type LoadBalancersClientUpdateTagsOptions struct { - // placeholder for future optional parameters -} - -// LoadBalancingRule - A load balancing rule for a load balancer. -type LoadBalancingRule struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // The name of the resource that is unique within the set of load balancing rules used by the load balancer. This name can - // be used to access the resource. - Name *string `json:"name,omitempty"` - - // Properties of load balancer load balancing rule. - Properties *LoadBalancingRulePropertiesFormat `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// LoadBalancingRulePropertiesFormat - Properties of the load balancer. -type LoadBalancingRulePropertiesFormat struct { - // REQUIRED; The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable - // values are between 0 and 65534. Note that value 0 enables "Any Port". - FrontendPort *int32 `json:"frontendPort,omitempty"` - - // REQUIRED; The reference to the transport protocol used by the load balancing rule. - Protocol *TransportProtocol `json:"protocol,omitempty"` - - // A reference to a pool of DIPs. Inbound traffic is randomly load balanced across IPs in the backend IPs. - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - - // An array of references to pool of DIPs. - BackendAddressPools []*SubResource `json:"backendAddressPools,omitempty"` - - // The port used for internal connections on the endpoint. Acceptable values are between 0 and 65535. Note that value 0 enables - // "Any Port". - BackendPort *int32 `json:"backendPort,omitempty"` - - // Configures SNAT for the VMs in the backend pool to use the publicIP address specified in the frontend of the load balancing - // rule. - DisableOutboundSnat *bool `json:"disableOutboundSnat,omitempty"` - - // Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability - // Group. This setting is required when using the SQL AlwaysOn Availability Groups - // in SQL server. This setting can't be changed after you create the endpoint. - EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` - - // Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used - // when the protocol is set to TCP. - EnableTCPReset *bool `json:"enableTcpReset,omitempty"` - - // A reference to frontend IP addresses. - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - - // The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. - // This element is only used when the protocol is set to TCP. - IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` - - // The load distribution policy for this rule. - LoadDistribution *LoadDistribution `json:"loadDistribution,omitempty"` - - // The reference to the load balancer probe used by the load balancing rule. - Probe *SubResource `json:"probe,omitempty"` - - // READ-ONLY; The provisioning state of the load balancing rule resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// LocalNetworkGateway - A common class for general resource information. -type LocalNetworkGateway struct { - // REQUIRED; Properties of the local network gateway. - Properties *LocalNetworkGatewayPropertiesFormat `json:"properties,omitempty"` - - // Resource ID. - ID *string `json:"id,omitempty"` - - // Resource location. - Location *string `json:"location,omitempty"` - - // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// LocalNetworkGatewayListResult - Response for ListLocalNetworkGateways API service call. -type LocalNetworkGatewayListResult struct { - // A list of local network gateways that exists in a resource group. - Value []*LocalNetworkGateway `json:"value,omitempty"` - - // READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` -} - -// LocalNetworkGatewayPropertiesFormat - LocalNetworkGateway properties. -type LocalNetworkGatewayPropertiesFormat struct { - // Local network gateway's BGP speaker settings. - BgpSettings *BgpSettings `json:"bgpSettings,omitempty"` - - // FQDN of local network gateway. - Fqdn *string `json:"fqdn,omitempty"` - - // IP address of local network gateway. - GatewayIPAddress *string `json:"gatewayIpAddress,omitempty"` - - // Local network site address space. - LocalNetworkAddressSpace *AddressSpace `json:"localNetworkAddressSpace,omitempty"` - - // READ-ONLY; The provisioning state of the local network gateway resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` - - // READ-ONLY; The resource GUID property of the local network gateway resource. - ResourceGUID *string `json:"resourceGuid,omitempty" azure:"ro"` -} - -// LocalNetworkGatewaysClientBeginCreateOrUpdateOptions contains the optional parameters for the LocalNetworkGatewaysClient.BeginCreateOrUpdate -// method. -type LocalNetworkGatewaysClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// LocalNetworkGatewaysClientBeginDeleteOptions contains the optional parameters for the LocalNetworkGatewaysClient.BeginDelete -// method. -type LocalNetworkGatewaysClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// LocalNetworkGatewaysClientGetOptions contains the optional parameters for the LocalNetworkGatewaysClient.Get method. -type LocalNetworkGatewaysClientGetOptions struct { - // placeholder for future optional parameters -} - -// LocalNetworkGatewaysClientListOptions contains the optional parameters for the LocalNetworkGatewaysClient.List method. -type LocalNetworkGatewaysClientListOptions struct { - // placeholder for future optional parameters -} - -// LocalNetworkGatewaysClientUpdateTagsOptions contains the optional parameters for the LocalNetworkGatewaysClient.UpdateTags -// method. -type LocalNetworkGatewaysClientUpdateTagsOptions struct { - // placeholder for future optional parameters -} - -// LogSpecification - Description of logging specification. -type LogSpecification struct { - // Duration of the blob. - BlobDuration *string `json:"blobDuration,omitempty"` - - // The display name of the specification. - DisplayName *string `json:"displayName,omitempty"` - - // The name of the specification. - Name *string `json:"name,omitempty"` -} - -// ManagedRuleGroupOverride - Defines a managed rule group override setting. -type ManagedRuleGroupOverride struct { - // REQUIRED; The managed rule group to override. - RuleGroupName *string `json:"ruleGroupName,omitempty"` - - // List of rules that will be disabled. If none specified, all rules in the group will be disabled. - Rules []*ManagedRuleOverride `json:"rules,omitempty"` -} - -// ManagedRuleOverride - Defines a managed rule group override setting. -type ManagedRuleOverride struct { - // REQUIRED; Identifier for the managed rule. - RuleID *string `json:"ruleId,omitempty"` - - // The state of the managed rule. Defaults to Disabled if not specified. - State *ManagedRuleEnabledState `json:"state,omitempty"` -} - -// ManagedRuleSet - Defines a managed rule set. -type ManagedRuleSet struct { - // REQUIRED; Defines the rule set type to use. - RuleSetType *string `json:"ruleSetType,omitempty"` - - // REQUIRED; Defines the version of the rule set to use. - RuleSetVersion *string `json:"ruleSetVersion,omitempty"` - - // Defines the rule group overrides to apply to the rule set. - RuleGroupOverrides []*ManagedRuleGroupOverride `json:"ruleGroupOverrides,omitempty"` -} - -// ManagedRulesDefinition - Allow to exclude some variable satisfy the condition for the WAF check. -type ManagedRulesDefinition struct { - // REQUIRED; The managed rule sets that are associated with the policy. - ManagedRuleSets []*ManagedRuleSet `json:"managedRuleSets,omitempty"` - - // The Exclusions that are applied on the policy. - Exclusions []*OwaspCrsExclusionEntry `json:"exclusions,omitempty"` -} - -// ManagedServiceIdentity - Identity for the resource. -type ManagedServiceIdentity struct { - // The type of identity used for the resource. The type 'SystemAssigned, UserAssigned' includes both an implicitly created - // identity and a set of user assigned identities. The type 'None' will remove any - // identities from the virtual machine. - Type *ResourceIdentityType `json:"type,omitempty"` - - // The list of user identities associated with resource. The user identity dictionary key references will be ARM resource - // ids in the form: - // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - UserAssignedIdentities map[string]*Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties `json:"userAssignedIdentities,omitempty"` - - // READ-ONLY; The principal id of the system assigned identity. This property will only be provided for a system assigned - // identity. - PrincipalID *string `json:"principalId,omitempty" azure:"ro"` - - // READ-ONLY; The tenant id of the system assigned identity. This property will only be provided for a system assigned identity. - TenantID *string `json:"tenantId,omitempty" azure:"ro"` -} - -// ManagementClientBeginDeleteBastionShareableLinkOptions contains the optional parameters for the ManagementClient.BeginDeleteBastionShareableLink -// method. -type ManagementClientBeginDeleteBastionShareableLinkOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ManagementClientBeginGeneratevirtualwanvpnserverconfigurationvpnprofileOptions contains the optional parameters for the -// ManagementClient.BeginGeneratevirtualwanvpnserverconfigurationvpnprofile method. -type ManagementClientBeginGeneratevirtualwanvpnserverconfigurationvpnprofileOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ManagementClientBeginGetActiveSessionsOptions contains the optional parameters for the ManagementClient.BeginGetActiveSessions -// method. -type ManagementClientBeginGetActiveSessionsOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ManagementClientBeginPutBastionShareableLinkOptions contains the optional parameters for the ManagementClient.BeginPutBastionShareableLink -// method. -type ManagementClientBeginPutBastionShareableLinkOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ManagementClientCheckDNSNameAvailabilityOptions contains the optional parameters for the ManagementClient.CheckDNSNameAvailability -// method. -type ManagementClientCheckDNSNameAvailabilityOptions struct { - // placeholder for future optional parameters -} - -// ManagementClientDisconnectActiveSessionsOptions contains the optional parameters for the ManagementClient.DisconnectActiveSessions -// method. -type ManagementClientDisconnectActiveSessionsOptions struct { - // placeholder for future optional parameters -} - -// ManagementClientExpressRouteProviderPortOptions contains the optional parameters for the ManagementClient.ExpressRouteProviderPort -// method. -type ManagementClientExpressRouteProviderPortOptions struct { - // placeholder for future optional parameters -} - -// ManagementClientGetBastionShareableLinkOptions contains the optional parameters for the ManagementClient.GetBastionShareableLink -// method. -type ManagementClientGetBastionShareableLinkOptions struct { - // placeholder for future optional parameters -} - -// ManagementClientListActiveConnectivityConfigurationsOptions contains the optional parameters for the ManagementClient.ListActiveConnectivityConfigurations -// method. -type ManagementClientListActiveConnectivityConfigurationsOptions struct { - // placeholder for future optional parameters -} - -// ManagementClientListActiveSecurityAdminRulesOptions contains the optional parameters for the ManagementClient.ListActiveSecurityAdminRules -// method. -type ManagementClientListActiveSecurityAdminRulesOptions struct { - // placeholder for future optional parameters -} - -// ManagementClientListNetworkManagerEffectiveConnectivityConfigurationsOptions contains the optional parameters for the ManagementClient.ListNetworkManagerEffectiveConnectivityConfigurations -// method. -type ManagementClientListNetworkManagerEffectiveConnectivityConfigurationsOptions struct { - // placeholder for future optional parameters -} - -// ManagementClientListNetworkManagerEffectiveSecurityAdminRulesOptions contains the optional parameters for the ManagementClient.ListNetworkManagerEffectiveSecurityAdminRules -// method. -type ManagementClientListNetworkManagerEffectiveSecurityAdminRulesOptions struct { - // placeholder for future optional parameters -} - -// ManagementClientSupportedSecurityProvidersOptions contains the optional parameters for the ManagementClient.SupportedSecurityProviders -// method. -type ManagementClientSupportedSecurityProvidersOptions struct { - // placeholder for future optional parameters -} - -// ManagementGroupNetworkManagerConnectionsClientCreateOrUpdateOptions contains the optional parameters for the ManagementGroupNetworkManagerConnectionsClient.CreateOrUpdate -// method. -type ManagementGroupNetworkManagerConnectionsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// ManagementGroupNetworkManagerConnectionsClientDeleteOptions contains the optional parameters for the ManagementGroupNetworkManagerConnectionsClient.Delete -// method. -type ManagementGroupNetworkManagerConnectionsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// ManagementGroupNetworkManagerConnectionsClientGetOptions contains the optional parameters for the ManagementGroupNetworkManagerConnectionsClient.Get -// method. -type ManagementGroupNetworkManagerConnectionsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ManagementGroupNetworkManagerConnectionsClientListOptions contains the optional parameters for the ManagementGroupNetworkManagerConnectionsClient.List -// method. -type ManagementGroupNetworkManagerConnectionsClientListOptions struct { - // SkipToken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, - // the value of the nextLink element will include a skipToken parameter that - // specifies a starting point to use for subsequent calls. - SkipToken *string - // An optional query parameter which specifies the maximum number of records to be returned by the server. - Top *int32 -} - -// Manager - The Managed Network resource -type Manager struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Resource location. - Location *string `json:"location,omitempty"` - - // The network manager properties - Properties *ManagerProperties `json:"properties,omitempty"` - - // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; The system metadata related to this resource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ManagerCommit - Network Manager Commit. -type ManagerCommit struct { - // REQUIRED; Commit Type. - CommitType *ConfigurationType `json:"commitType,omitempty"` - - // REQUIRED; List of target locations. - TargetLocations []*string `json:"targetLocations,omitempty"` - - // List of configuration ids. - ConfigurationIDs []*string `json:"configurationIds,omitempty"` - - // READ-ONLY; Commit Id. - CommitID *string `json:"commitId,omitempty" azure:"ro"` -} - -// ManagerCommitsClientBeginPostOptions contains the optional parameters for the ManagerCommitsClient.BeginPost method. -type ManagerCommitsClientBeginPostOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ManagerConnection - The Network Manager Connection resource -type ManagerConnection struct { - // The scope connection properties - Properties *ManagerConnectionProperties `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; The system metadata related to this resource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ManagerConnectionListResult - List of network manager connections. -type ManagerConnectionListResult struct { - // Gets the URL to get the next page of results. - NextLink *string `json:"nextLink,omitempty"` - - // List of network manager connections. - Value []*ManagerConnection `json:"value,omitempty"` -} - -// ManagerConnectionProperties - Information about the network manager connection. -type ManagerConnectionProperties struct { - // A description of the network manager connection. - Description *string `json:"description,omitempty"` - - // Network Manager Id. - NetworkManagerID *string `json:"networkManagerId,omitempty"` - - // READ-ONLY; Connection state. - ConnectionState *ScopeConnectionState `json:"connectionState,omitempty" azure:"ro"` -} - -// ManagerDeploymentStatus - Network Manager Deployment Status. -type ManagerDeploymentStatus struct { - // Commit Time. - CommitTime *time.Time `json:"commitTime,omitempty"` - - // List of configuration ids. - ConfigurationIDs []*string `json:"configurationIds,omitempty"` - - // Deployment Status. - DeploymentStatus *DeploymentStatus `json:"deploymentStatus,omitempty"` - - // Configuration Deployment Type. - DeploymentType *ConfigurationType `json:"deploymentType,omitempty"` - - // Error Message. - ErrorMessage *string `json:"errorMessage,omitempty"` - - // Region Name. - Region *string `json:"region,omitempty"` -} - -// ManagerDeploymentStatusClientListOptions contains the optional parameters for the ManagerDeploymentStatusClient.List method. -type ManagerDeploymentStatusClientListOptions struct { - // placeholder for future optional parameters -} - -// ManagerDeploymentStatusListResult - A list of Network Manager Deployment Status -type ManagerDeploymentStatusListResult struct { - // When present, the value can be passed to a subsequent query call (together with the same query and scopes used in the current - // request) to retrieve the next page of data. - SkipToken *string `json:"skipToken,omitempty"` - - // Gets a page of Network Manager Deployment Status - Value []*ManagerDeploymentStatus `json:"value,omitempty"` -} - -// ManagerDeploymentStatusParameter - Network Manager Deployment Status Parameter. -type ManagerDeploymentStatusParameter struct { - // List of deployment types. - DeploymentTypes []*ConfigurationType `json:"deploymentTypes,omitempty"` - - // List of locations. - Regions []*string `json:"regions,omitempty"` - - // Continuation token for pagination, capturing the next page size and offset, as well as the context of the query. - SkipToken *string `json:"skipToken,omitempty"` -} - -// ManagerEffectiveConnectivityConfigurationListResult - Result of the request to list networkManagerEffectiveConnectivityConfiguration. -// It contains a list of groups and a skiptoken to get the next set of results. -type ManagerEffectiveConnectivityConfigurationListResult struct { - // When present, the value can be passed to a subsequent query call (together with the same query and scopes used in the current - // request) to retrieve the next page of data. - SkipToken *string `json:"skipToken,omitempty"` - - // Gets a page of NetworkManagerEffectiveConnectivityConfiguration - Value []*EffectiveConnectivityConfiguration `json:"value,omitempty"` -} - -// ManagerEffectiveSecurityAdminRulesListResult - Result of the request to list networkManagerEffectiveSecurityAdminRules. -// It contains a list of groups and a skiptoken to get the next set of results. -type ManagerEffectiveSecurityAdminRulesListResult struct { - // When present, the value can be passed to a subsequent query call (together with the same query and scopes used in the current - // request) to retrieve the next page of data. - SkipToken *string `json:"skipToken,omitempty"` - - // Gets a page of NetworkManagerEffectiveSecurityAdminRules - Value []EffectiveBaseSecurityAdminRuleClassification `json:"value,omitempty"` -} - -// ManagerListResult - Result of the request to list NetworkManager. It contains a list of network managers and a URL link -// to get the next set of results. -type ManagerListResult struct { - // Gets the URL to get the next page of results. - NextLink *string `json:"nextLink,omitempty"` - - // Gets a page of NetworkManager - Value []*Manager `json:"value,omitempty"` -} - -// ManagerProperties - Properties of Managed Network -type ManagerProperties struct { - // REQUIRED; Scope Access. - NetworkManagerScopeAccesses []*ConfigurationType `json:"networkManagerScopeAccesses,omitempty"` - - // REQUIRED; Scope of Network Manager. - NetworkManagerScopes *ManagerPropertiesNetworkManagerScopes `json:"networkManagerScopes,omitempty"` - - // A description of the network manager. - Description *string `json:"description,omitempty"` - - // READ-ONLY; The provisioning state of the network manager resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// ManagerPropertiesNetworkManagerScopes - Scope of Network Manager. -type ManagerPropertiesNetworkManagerScopes struct { - // List of management groups. - ManagementGroups []*string `json:"managementGroups,omitempty"` - - // List of subscriptions. - Subscriptions []*string `json:"subscriptions,omitempty"` - - // READ-ONLY; List of cross tenant scopes. - CrossTenantScopes []*CrossTenantScopes `json:"crossTenantScopes,omitempty" azure:"ro"` -} - -// ManagerSecurityGroupItem - Network manager security group item. -type ManagerSecurityGroupItem struct { - // REQUIRED; Network manager group Id. - NetworkGroupID *string `json:"networkGroupId,omitempty"` -} - -// ManagersClientBeginDeleteOptions contains the optional parameters for the ManagersClient.BeginDelete method. -type ManagersClientBeginDeleteOptions struct { - // Deletes the resource even if it is part of a deployed configuration. If the configuration has been deployed, the service - // will do a cleanup deployment in the background, prior to the delete. - Force *bool - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ManagersClientCreateOrUpdateOptions contains the optional parameters for the ManagersClient.CreateOrUpdate method. -type ManagersClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// ManagersClientGetOptions contains the optional parameters for the ManagersClient.Get method. -type ManagersClientGetOptions struct { - // placeholder for future optional parameters -} - -// ManagersClientListBySubscriptionOptions contains the optional parameters for the ManagersClient.ListBySubscription method. -type ManagersClientListBySubscriptionOptions struct { - // SkipToken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, - // the value of the nextLink element will include a skipToken parameter that - // specifies a starting point to use for subsequent calls. - SkipToken *string - // An optional query parameter which specifies the maximum number of records to be returned by the server. - Top *int32 -} - -// ManagersClientListOptions contains the optional parameters for the ManagersClient.List method. -type ManagersClientListOptions struct { - // SkipToken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, - // the value of the nextLink element will include a skipToken parameter that - // specifies a starting point to use for subsequent calls. - SkipToken *string - // An optional query parameter which specifies the maximum number of records to be returned by the server. - Top *int32 -} - -// ManagersClientPatchOptions contains the optional parameters for the ManagersClient.Patch method. -type ManagersClientPatchOptions struct { - // placeholder for future optional parameters -} - -// MatchCondition - Define match conditions. -type MatchCondition struct { - // REQUIRED; Match value. - MatchValues []*string `json:"matchValues,omitempty"` - - // REQUIRED; List of match variables. - MatchVariables []*MatchVariable `json:"matchVariables,omitempty"` - - // REQUIRED; The operator to be matched. - Operator *WebApplicationFirewallOperator `json:"operator,omitempty"` - - // Whether this is negate condition or not. - NegationConditon *bool `json:"negationConditon,omitempty"` - - // List of transforms. - Transforms []*WebApplicationFirewallTransform `json:"transforms,omitempty"` -} - -// MatchVariable - Define match variables. -type MatchVariable struct { - // REQUIRED; Match Variable. - VariableName *WebApplicationFirewallMatchVariable `json:"variableName,omitempty"` - - // The selector of match variable. - Selector *string `json:"selector,omitempty"` -} - -// MatchedRule - Matched rule. -type MatchedRule struct { - // The network traffic is allowed or denied. Possible values are 'Allow' and 'Deny'. - Action *string `json:"action,omitempty"` - - // Name of the matched network security rule. - RuleName *string `json:"ruleName,omitempty"` -} - -// MetricSpecification - Description of metrics specification. -type MetricSpecification struct { - // The aggregation type. - AggregationType *string `json:"aggregationType,omitempty"` - - // List of availability. - Availabilities []*Availability `json:"availabilities,omitempty"` - - // List of dimensions. - Dimensions []*Dimension `json:"dimensions,omitempty"` - - // The description of the metric. - DisplayDescription *string `json:"displayDescription,omitempty"` - - // The display name of the metric. - DisplayName *string `json:"displayName,omitempty"` - - // Whether regional MDM account enabled. - EnableRegionalMdmAccount *bool `json:"enableRegionalMdmAccount,omitempty"` - - // Whether gaps would be filled with zeros. - FillGapWithZero *bool `json:"fillGapWithZero,omitempty"` - - // Whether the metric is internal. - IsInternal *bool `json:"isInternal,omitempty"` - - // Pattern for the filter of the metric. - MetricFilterPattern *string `json:"metricFilterPattern,omitempty"` - - // The name of the metric. - Name *string `json:"name,omitempty"` - - // The resource Id dimension name override. - ResourceIDDimensionNameOverride *string `json:"resourceIdDimensionNameOverride,omitempty"` - - // The source MDM account. - SourceMdmAccount *string `json:"sourceMdmAccount,omitempty"` - - // The source MDM namespace. - SourceMdmNamespace *string `json:"sourceMdmNamespace,omitempty"` - - // Units the metric to be displayed in. - Unit *string `json:"unit,omitempty"` -} - -// NatGateway - Nat Gateway resource. -type NatGateway struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Resource location. - Location *string `json:"location,omitempty"` - - // Nat Gateway properties. - Properties *NatGatewayPropertiesFormat `json:"properties,omitempty"` - - // The nat gateway SKU. - SKU *NatGatewaySKU `json:"sku,omitempty"` - - // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` - - // A list of availability zones denoting the zone in which Nat Gateway should be deployed. - Zones []*string `json:"zones,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// NatGatewayListResult - Response for ListNatGateways API service call. -type NatGatewayListResult struct { - // The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` - - // A list of Nat Gateways that exists in a resource group. - Value []*NatGateway `json:"value,omitempty"` -} - -// NatGatewayPropertiesFormat - Nat Gateway properties. -type NatGatewayPropertiesFormat struct { - // The idle timeout of the nat gateway. - IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` - - // An array of public ip addresses associated with the nat gateway resource. - PublicIPAddresses []*SubResource `json:"publicIpAddresses,omitempty"` - - // An array of public ip prefixes associated with the nat gateway resource. - PublicIPPrefixes []*SubResource `json:"publicIpPrefixes,omitempty"` - - // READ-ONLY; The provisioning state of the NAT gateway resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` - - // READ-ONLY; The resource GUID property of the NAT gateway resource. - ResourceGUID *string `json:"resourceGuid,omitempty" azure:"ro"` - - // READ-ONLY; An array of references to the subnets using this nat gateway resource. - Subnets []*SubResource `json:"subnets,omitempty" azure:"ro"` -} - -// NatGatewaySKU - SKU of nat gateway. -type NatGatewaySKU struct { - // Name of Nat Gateway SKU. - Name *NatGatewaySKUName `json:"name,omitempty"` -} - -// NatGatewaysClientBeginCreateOrUpdateOptions contains the optional parameters for the NatGatewaysClient.BeginCreateOrUpdate -// method. -type NatGatewaysClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// NatGatewaysClientBeginDeleteOptions contains the optional parameters for the NatGatewaysClient.BeginDelete method. -type NatGatewaysClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// NatGatewaysClientGetOptions contains the optional parameters for the NatGatewaysClient.Get method. -type NatGatewaysClientGetOptions struct { - // Expands referenced resources. - Expand *string -} - -// NatGatewaysClientListAllOptions contains the optional parameters for the NatGatewaysClient.ListAll method. -type NatGatewaysClientListAllOptions struct { - // placeholder for future optional parameters -} - -// NatGatewaysClientListOptions contains the optional parameters for the NatGatewaysClient.List method. -type NatGatewaysClientListOptions struct { - // placeholder for future optional parameters -} - -// NatGatewaysClientUpdateTagsOptions contains the optional parameters for the NatGatewaysClient.UpdateTags method. -type NatGatewaysClientUpdateTagsOptions struct { - // placeholder for future optional parameters -} - -// NatRule - Rule of type nat. -type NatRule struct { - // REQUIRED; Rule Type. - RuleType *FirewallPolicyRuleType `json:"ruleType,omitempty"` - - // Description of the rule. - Description *string `json:"description,omitempty"` - - // List of destination IP addresses or Service Tags. - DestinationAddresses []*string `json:"destinationAddresses,omitempty"` - - // List of destination ports. - DestinationPorts []*string `json:"destinationPorts,omitempty"` - - // Array of FirewallPolicyRuleNetworkProtocols. - IPProtocols []*FirewallPolicyRuleNetworkProtocol `json:"ipProtocols,omitempty"` - - // Name of the rule. - Name *string `json:"name,omitempty"` - - // List of source IP addresses for this rule. - SourceAddresses []*string `json:"sourceAddresses,omitempty"` - - // List of source IpGroups for this rule. - SourceIPGroups []*string `json:"sourceIpGroups,omitempty"` - - // The translated address for this NAT rule. - TranslatedAddress *string `json:"translatedAddress,omitempty"` - - // The translated FQDN for this NAT rule. - TranslatedFqdn *string `json:"translatedFqdn,omitempty"` - - // The translated port for this NAT rule. - TranslatedPort *string `json:"translatedPort,omitempty"` -} - -// GetFirewallPolicyRule implements the FirewallPolicyRuleClassification interface for type NatRule. -func (n *NatRule) GetFirewallPolicyRule() *FirewallPolicyRule { - return &FirewallPolicyRule{ - Name: n.Name, - Description: n.Description, - RuleType: n.RuleType, - } -} - -// NatRulePortMapping - Individual port mappings for inbound NAT rule created for backend pool. -type NatRulePortMapping struct { - // Backend port. - BackendPort *int32 `json:"backendPort,omitempty"` - - // Frontend port. - FrontendPort *int32 `json:"frontendPort,omitempty"` - - // Name of inbound NAT rule. - InboundNatRuleName *string `json:"inboundNatRuleName,omitempty"` -} - -// NatRulesClientBeginCreateOrUpdateOptions contains the optional parameters for the NatRulesClient.BeginCreateOrUpdate method. -type NatRulesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// NatRulesClientBeginDeleteOptions contains the optional parameters for the NatRulesClient.BeginDelete method. -type NatRulesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// NatRulesClientGetOptions contains the optional parameters for the NatRulesClient.Get method. -type NatRulesClientGetOptions struct { - // placeholder for future optional parameters -} - -// NatRulesClientListByVPNGatewayOptions contains the optional parameters for the NatRulesClient.ListByVPNGateway method. -type NatRulesClientListByVPNGatewayOptions struct { - // placeholder for future optional parameters -} - -// NextHopParameters - Parameters that define the source and destination endpoint. -type NextHopParameters struct { - // REQUIRED; The destination IP address. - DestinationIPAddress *string `json:"destinationIPAddress,omitempty"` - - // REQUIRED; The source IP address. - SourceIPAddress *string `json:"sourceIPAddress,omitempty"` - - // REQUIRED; The resource identifier of the target resource against which the action is to be performed. - TargetResourceID *string `json:"targetResourceId,omitempty"` - - // The NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any of the nics, then this parameter must be specified. - // Otherwise optional). - TargetNicResourceID *string `json:"targetNicResourceId,omitempty"` -} - -// NextHopResult - The information about next hop from the specified VM. -type NextHopResult struct { - // Next hop IP Address. - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` - - // Next hop type. - NextHopType *NextHopType `json:"nextHopType,omitempty"` - - // The resource identifier for the route table associated with the route being returned. If the route being returned does - // not correspond to any user created routes then this field will be the string - // 'System Route'. - RouteTableID *string `json:"routeTableId,omitempty"` -} - -// O365BreakOutCategoryPolicies - Office365 breakout categories. -type O365BreakOutCategoryPolicies struct { - // Flag to control allow category. - Allow *bool `json:"allow,omitempty"` - - // Flag to control default category. - Default *bool `json:"default,omitempty"` - - // Flag to control optimize category. - Optimize *bool `json:"optimize,omitempty"` -} - -// O365PolicyProperties - The Office365 breakout policy. -type O365PolicyProperties struct { - // Office365 breakout categories. - BreakOutCategories *O365BreakOutCategoryPolicies `json:"breakOutCategories,omitempty"` -} - -// Office365PolicyProperties - Network Virtual Appliance Sku Properties. -type Office365PolicyProperties struct { - // Office 365 breakout categories. - BreakOutCategories *BreakOutCategoryPolicies `json:"breakOutCategories,omitempty"` -} - -// Operation - Network REST API operation definition. -type Operation struct { - // Display metadata associated with the operation. - Display *OperationDisplay `json:"display,omitempty"` - - // Operation name: {provider}/{resource}/{operation}. - Name *string `json:"name,omitempty"` - - // Origin of the operation. - Origin *string `json:"origin,omitempty"` - - // Operation properties format. - Properties *OperationPropertiesFormat `json:"properties,omitempty"` -} - -// OperationDisplay - Display metadata associated with the operation. -type OperationDisplay struct { - // Description of the operation. - Description *string `json:"description,omitempty"` - - // Type of the operation: get, read, delete, etc. - Operation *string `json:"operation,omitempty"` - - // Service provider: Microsoft Network. - Provider *string `json:"provider,omitempty"` - - // Resource on which the operation is performed. - Resource *string `json:"resource,omitempty"` -} - -// OperationListResult - Result of the request to list Network operations. It contains a list of operations and a URL link -// to get the next set of results. -type OperationListResult struct { - // URL to get the next set of operation list results if there are any. - NextLink *string `json:"nextLink,omitempty"` - - // List of Network operations supported by the Network resource provider. - Value []*Operation `json:"value,omitempty"` -} - -// OperationPropertiesFormat - Description of operation properties format. -type OperationPropertiesFormat struct { - // Specification of the service. - ServiceSpecification *OperationPropertiesFormatServiceSpecification `json:"serviceSpecification,omitempty"` -} - -// OperationPropertiesFormatServiceSpecification - Specification of the service. -type OperationPropertiesFormatServiceSpecification struct { - // Operation log specification. - LogSpecifications []*LogSpecification `json:"logSpecifications,omitempty"` - - // Operation service specification. - MetricSpecifications []*MetricSpecification `json:"metricSpecifications,omitempty"` -} - -// OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. -type OperationsClientListOptions struct { - // placeholder for future optional parameters -} - -// OrderBy - Describes a column to sort -type OrderBy struct { - // Describes the actual column name to sort by - Field *string `json:"field,omitempty"` - - // Describes if results should be in ascending/descending order - Order *FirewallPolicyIDPSQuerySortOrder `json:"order,omitempty"` -} - -// OutboundRule - Outbound rule of the load balancer. -type OutboundRule struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // The name of the resource that is unique within the set of outbound rules used by the load balancer. This name can be used - // to access the resource. - Name *string `json:"name,omitempty"` - - // Properties of load balancer outbound rule. - Properties *OutboundRulePropertiesFormat `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// OutboundRulePropertiesFormat - Outbound rule of the load balancer. -type OutboundRulePropertiesFormat struct { - // REQUIRED; A reference to a pool of DIPs. Outbound traffic is randomly load balanced across IPs in the backend IPs. - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - - // REQUIRED; The Frontend IP addresses of the load balancer. - FrontendIPConfigurations []*SubResource `json:"frontendIPConfigurations,omitempty"` - - // REQUIRED; The protocol for the outbound rule in load balancer. - Protocol *LoadBalancerOutboundRuleProtocol `json:"protocol,omitempty"` - - // The number of outbound ports to be used for NAT. - AllocatedOutboundPorts *int32 `json:"allocatedOutboundPorts,omitempty"` - - // Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used - // when the protocol is set to TCP. - EnableTCPReset *bool `json:"enableTcpReset,omitempty"` - - // The timeout for the TCP idle connection. - IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` - - // READ-ONLY; The provisioning state of the outbound rule resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// OwaspCrsExclusionEntry - Allow to exclude some variable satisfy the condition for the WAF check. -type OwaspCrsExclusionEntry struct { - // REQUIRED; The variable to be excluded. - MatchVariable *OwaspCrsExclusionEntryMatchVariable `json:"matchVariable,omitempty"` - - // REQUIRED; When matchVariable is a collection, operator used to specify which elements in the collection this exclusion - // applies to. - Selector *string `json:"selector,omitempty"` - - // REQUIRED; When matchVariable is a collection, operate on the selector to specify which elements in the collection this - // exclusion applies to. - SelectorMatchOperator *OwaspCrsExclusionEntrySelectorMatchOperator `json:"selectorMatchOperator,omitempty"` - - // The managed rule sets that are associated with the exclusion. - ExclusionManagedRuleSets []*ExclusionManagedRuleSet `json:"exclusionManagedRuleSets,omitempty"` -} - -// P2SConnectionConfiguration Resource. -type P2SConnectionConfiguration struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // 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"` - - // Properties of the P2S connection configuration. - Properties *P2SConnectionConfigurationProperties `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` -} - -// P2SConnectionConfigurationProperties - Parameters for P2SConnectionConfiguration. -type P2SConnectionConfigurationProperties struct { - // Flag indicating whether the enable internet security flag is turned on for the P2S Connections or not. - EnableInternetSecurity *bool `json:"enableInternetSecurity,omitempty"` - - // The Routing Configuration indicating the associated and propagated route tables on this connection. - RoutingConfiguration *RoutingConfiguration `json:"routingConfiguration,omitempty"` - - // The reference to the address space resource which represents Address space for P2S VpnClient. - VPNClientAddressPool *AddressSpace `json:"vpnClientAddressPool,omitempty"` - - // READ-ONLY; List of Configuration Policy Groups that this P2SConnectionConfiguration is attached to. - ConfigurationPolicyGroupAssociations []*SubResource `json:"configurationPolicyGroupAssociations,omitempty" azure:"ro"` - - // READ-ONLY; List of previous Configuration Policy Groups that this P2SConnectionConfiguration was attached to. - PreviousConfigurationPolicyGroupAssociations []*VPNServerConfigurationPolicyGroup `json:"previousConfigurationPolicyGroupAssociations,omitempty" azure:"ro"` - - // READ-ONLY; The provisioning state of the P2SConnectionConfiguration resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// P2SVPNConnectionHealth - P2S Vpn connection detailed health written to sas url. -type P2SVPNConnectionHealth struct { - // Returned sas url of the blob to which the p2s vpn connection detailed health will be written. - SasURL *string `json:"sasUrl,omitempty"` -} - -// P2SVPNConnectionHealthRequest - List of P2S Vpn connection health request. -type P2SVPNConnectionHealthRequest struct { - // The sas-url to download the P2S Vpn connection health detail. - OutputBlobSasURL *string `json:"outputBlobSasUrl,omitempty"` - - // The list of p2s vpn user names whose p2s vpn connection detailed health to retrieve for. - VPNUserNamesFilter []*string `json:"vpnUserNamesFilter,omitempty"` -} - -// P2SVPNConnectionRequest - List of p2s vpn connections to be disconnected. -type P2SVPNConnectionRequest struct { - // List of p2s vpn connection Ids. - VPNConnectionIDs []*string `json:"vpnConnectionIds,omitempty"` -} - -// P2SVPNGateway - P2SVpnGateway Resource. -type P2SVPNGateway struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Resource location. - Location *string `json:"location,omitempty"` - - // Properties of the P2SVpnGateway. - Properties *P2SVPNGatewayProperties `json:"properties,omitempty"` - - // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// P2SVPNGatewayProperties - Parameters for P2SVpnGateway. -type P2SVPNGatewayProperties struct { - // List of all customer specified DNS servers IP addresses. - CustomDNSServers []*string `json:"customDnsServers,omitempty"` - - // Enable Routing Preference property for the Public IP Interface of the P2SVpnGateway. - IsRoutingPreferenceInternet *bool `json:"isRoutingPreferenceInternet,omitempty"` - - // List of all p2s connection configurations of the gateway. - P2SConnectionConfigurations []*P2SConnectionConfiguration `json:"p2SConnectionConfigurations,omitempty"` - - // The scale unit for this p2s vpn gateway. - VPNGatewayScaleUnit *int32 `json:"vpnGatewayScaleUnit,omitempty"` - - // The VpnServerConfiguration to which the p2sVpnGateway is attached to. - VPNServerConfiguration *SubResource `json:"vpnServerConfiguration,omitempty"` - - // The VirtualHub to which the gateway belongs. - VirtualHub *SubResource `json:"virtualHub,omitempty"` - - // READ-ONLY; The provisioning state of the P2S VPN gateway resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` - - // READ-ONLY; All P2S VPN clients' connection health status. - VPNClientConnectionHealth *VPNClientConnectionHealth `json:"vpnClientConnectionHealth,omitempty" azure:"ro"` -} - -// P2SVPNGatewaysClientBeginCreateOrUpdateOptions contains the optional parameters for the P2SVPNGatewaysClient.BeginCreateOrUpdate -// method. -type P2SVPNGatewaysClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// P2SVPNGatewaysClientBeginDeleteOptions contains the optional parameters for the P2SVPNGatewaysClient.BeginDelete method. -type P2SVPNGatewaysClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// P2SVPNGatewaysClientBeginDisconnectP2SVPNConnectionsOptions contains the optional parameters for the P2SVPNGatewaysClient.BeginDisconnectP2SVPNConnections -// method. -type P2SVPNGatewaysClientBeginDisconnectP2SVPNConnectionsOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// P2SVPNGatewaysClientBeginGenerateVPNProfileOptions contains the optional parameters for the P2SVPNGatewaysClient.BeginGenerateVPNProfile -// method. -type P2SVPNGatewaysClientBeginGenerateVPNProfileOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// P2SVPNGatewaysClientBeginGetP2SVPNConnectionHealthDetailedOptions contains the optional parameters for the P2SVPNGatewaysClient.BeginGetP2SVPNConnectionHealthDetailed -// method. -type P2SVPNGatewaysClientBeginGetP2SVPNConnectionHealthDetailedOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// P2SVPNGatewaysClientBeginGetP2SVPNConnectionHealthOptions contains the optional parameters for the P2SVPNGatewaysClient.BeginGetP2SVPNConnectionHealth -// method. -type P2SVPNGatewaysClientBeginGetP2SVPNConnectionHealthOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// P2SVPNGatewaysClientBeginResetOptions contains the optional parameters for the P2SVPNGatewaysClient.BeginReset method. -type P2SVPNGatewaysClientBeginResetOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// P2SVPNGatewaysClientBeginUpdateTagsOptions contains the optional parameters for the P2SVPNGatewaysClient.BeginUpdateTags -// method. -type P2SVPNGatewaysClientBeginUpdateTagsOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// P2SVPNGatewaysClientGetOptions contains the optional parameters for the P2SVPNGatewaysClient.Get method. -type P2SVPNGatewaysClientGetOptions struct { - // placeholder for future optional parameters -} - -// P2SVPNGatewaysClientListByResourceGroupOptions contains the optional parameters for the P2SVPNGatewaysClient.ListByResourceGroup -// method. -type P2SVPNGatewaysClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// P2SVPNGatewaysClientListOptions contains the optional parameters for the P2SVPNGatewaysClient.List method. -type P2SVPNGatewaysClientListOptions struct { - // placeholder for future optional parameters -} - -// P2SVPNProfileParameters - Vpn Client Parameters for package generation. -type P2SVPNProfileParameters struct { - // VPN client authentication method. - AuthenticationMethod *AuthenticationMethod `json:"authenticationMethod,omitempty"` -} - -// PacketCapture - Parameters that define the create packet capture operation. -type PacketCapture struct { - // REQUIRED; Properties of the packet capture. - Properties *PacketCaptureParameters `json:"properties,omitempty"` -} - -// PacketCaptureFilter - Filter that is applied to packet capture request. Multiple filters can be applied. -type PacketCaptureFilter struct { - // Local IP Address to be filtered on. Notation: "127.0.0.1" for single address entry. "127.0.0.1-127.0.0.255" for range. - // "127.0.0.1;127.0.0.5"? for multiple entries. Multiple ranges not currently - // supported. Mixing ranges with multiple entries not currently supported. Default = null. - LocalIPAddress *string `json:"localIPAddress,omitempty"` - - // Local port to be filtered on. Notation: "80" for single port entry."80-85" for range. "80;443;" for multiple entries. Multiple - // ranges not currently supported. Mixing ranges with multiple entries not - // currently supported. Default = null. - LocalPort *string `json:"localPort,omitempty"` - - // Protocol to be filtered on. - Protocol *PcProtocol `json:"protocol,omitempty"` - - // Local IP Address to be filtered on. Notation: "127.0.0.1" for single address entry. "127.0.0.1-127.0.0.255" for range. - // "127.0.0.1;127.0.0.5;" for multiple entries. Multiple ranges not currently - // supported. Mixing ranges with multiple entries not currently supported. Default = null. - RemoteIPAddress *string `json:"remoteIPAddress,omitempty"` - - // Remote port to be filtered on. Notation: "80" for single port entry."80-85" for range. "80;443;" for multiple entries. - // Multiple ranges not currently supported. Mixing ranges with multiple entries not - // currently supported. Default = null. - RemotePort *string `json:"remotePort,omitempty"` -} - -// PacketCaptureListResult - List of packet capture sessions. -type PacketCaptureListResult struct { - // Information about packet capture sessions. - Value []*PacketCaptureResult `json:"value,omitempty"` -} - -// PacketCaptureMachineScope - A list of AzureVMSS instances which can be included or excluded to run packet capture. If both -// included and excluded are empty, then the packet capture will run on all instances of AzureVMSS. -type PacketCaptureMachineScope struct { - // List of AzureVMSS instances which has to be excluded from the AzureVMSS from running packet capture. - Exclude []*string `json:"exclude,omitempty"` - - // List of AzureVMSS instances to run packet capture on. - Include []*string `json:"include,omitempty"` -} - -// PacketCaptureParameters - Parameters that define the create packet capture operation. -type PacketCaptureParameters struct { - // REQUIRED; The storage location for a packet capture session. - StorageLocation *PacketCaptureStorageLocation `json:"storageLocation,omitempty"` - - // REQUIRED; The ID of the targeted resource, only AzureVM and AzureVMSS as target type are currently supported. - Target *string `json:"target,omitempty"` - - // Number of bytes captured per packet, the remaining bytes are truncated. - BytesToCapturePerPacket *int64 `json:"bytesToCapturePerPacket,omitempty"` - - // A list of packet capture filters. - Filters []*PacketCaptureFilter `json:"filters,omitempty"` - - // A list of AzureVMSS instances which can be included or excluded to run packet capture. If both included and excluded are - // empty, then the packet capture will run on all instances of AzureVMSS. - Scope *PacketCaptureMachineScope `json:"scope,omitempty"` - - // Target type of the resource provided. - TargetType *PacketCaptureTargetType `json:"targetType,omitempty"` - - // Maximum duration of the capture session in seconds. - TimeLimitInSeconds *int32 `json:"timeLimitInSeconds,omitempty"` - - // Maximum size of the capture output. - TotalBytesPerSession *int64 `json:"totalBytesPerSession,omitempty"` -} - -// PacketCaptureQueryStatusResult - Status of packet capture session. -type PacketCaptureQueryStatusResult struct { - // The start time of the packet capture session. - CaptureStartTime *time.Time `json:"captureStartTime,omitempty"` - - // The ID of the packet capture resource. - ID *string `json:"id,omitempty"` - - // The name of the packet capture resource. - Name *string `json:"name,omitempty"` - - // List of errors of packet capture session. - PacketCaptureError []*PcError `json:"packetCaptureError,omitempty"` - - // The status of the packet capture session. - PacketCaptureStatus *PcStatus `json:"packetCaptureStatus,omitempty"` - - // The reason the current packet capture session was stopped. - StopReason *string `json:"stopReason,omitempty"` -} - -// PacketCaptureResult - Information about packet capture session. -type PacketCaptureResult struct { - // Properties of the packet capture result. - Properties *PacketCaptureResultProperties `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; ID of the packet capture operation. - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; Name of the packet capture session. - Name *string `json:"name,omitempty" azure:"ro"` -} - -// PacketCaptureResultProperties - The properties of a packet capture session. -type PacketCaptureResultProperties struct { - // REQUIRED; The storage location for a packet capture session. - StorageLocation *PacketCaptureStorageLocation `json:"storageLocation,omitempty"` - - // REQUIRED; The ID of the targeted resource, only AzureVM and AzureVMSS as target type are currently supported. - Target *string `json:"target,omitempty"` - - // Number of bytes captured per packet, the remaining bytes are truncated. - BytesToCapturePerPacket *int64 `json:"bytesToCapturePerPacket,omitempty"` - - // A list of packet capture filters. - Filters []*PacketCaptureFilter `json:"filters,omitempty"` - - // A list of AzureVMSS instances which can be included or excluded to run packet capture. If both included and excluded are - // empty, then the packet capture will run on all instances of AzureVMSS. - Scope *PacketCaptureMachineScope `json:"scope,omitempty"` - - // Target type of the resource provided. - TargetType *PacketCaptureTargetType `json:"targetType,omitempty"` - - // Maximum duration of the capture session in seconds. - TimeLimitInSeconds *int32 `json:"timeLimitInSeconds,omitempty"` - - // Maximum size of the capture output. - TotalBytesPerSession *int64 `json:"totalBytesPerSession,omitempty"` - - // READ-ONLY; The provisioning state of the packet capture session. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// PacketCaptureStorageLocation - The storage location for a packet capture session. -type PacketCaptureStorageLocation struct { - // A valid local path on the targeting VM. Must include the name of the capture file (*.cap). For linux virtual machine it - // must start with /var/captures. Required if no storage ID is provided, otherwise - // optional. - FilePath *string `json:"filePath,omitempty"` - - // The ID of the storage account to save the packet capture session. Required if no local file path is provided. - StorageID *string `json:"storageId,omitempty"` - - // The URI of the storage path to save the packet capture. Must be a well-formed URI describing the location to save the packet - // capture. - StoragePath *string `json:"storagePath,omitempty"` -} - -// PacketCapturesClientBeginCreateOptions contains the optional parameters for the PacketCapturesClient.BeginCreate method. -type PacketCapturesClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// PacketCapturesClientBeginDeleteOptions contains the optional parameters for the PacketCapturesClient.BeginDelete method. -type PacketCapturesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// PacketCapturesClientBeginGetStatusOptions contains the optional parameters for the PacketCapturesClient.BeginGetStatus -// method. -type PacketCapturesClientBeginGetStatusOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// PacketCapturesClientBeginStopOptions contains the optional parameters for the PacketCapturesClient.BeginStop method. -type PacketCapturesClientBeginStopOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// PacketCapturesClientGetOptions contains the optional parameters for the PacketCapturesClient.Get method. -type PacketCapturesClientGetOptions struct { - // placeholder for future optional parameters -} - -// PacketCapturesClientListOptions contains the optional parameters for the PacketCapturesClient.List method. -type PacketCapturesClientListOptions struct { - // placeholder for future optional parameters -} - -// PatchObject - Object for patch operations. -type PatchObject struct { - // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` -} - -// PatchRouteFilter - Route Filter Resource. -type PatchRouteFilter struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Properties of the route filter. - Properties *RouteFilterPropertiesFormat `json:"properties,omitempty"` - - // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; 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" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// PatchRouteFilterRule - Route Filter Rule Resource. -type PatchRouteFilterRule struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Properties of the route filter rule. - Properties *RouteFilterRulePropertiesFormat `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; 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" azure:"ro"` -} - -// PeerExpressRouteCircuitConnection - Peer Express Route Circuit Connection in an ExpressRouteCircuitPeering resource. -type PeerExpressRouteCircuitConnection struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // 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"` - - // Properties of the peer express route circuit connection. - Properties *PeerExpressRouteCircuitConnectionPropertiesFormat `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// PeerExpressRouteCircuitConnectionListResult - Response for ListPeeredConnections API service call retrieves all global -// reach peer circuit connections that belongs to a Private Peering for an ExpressRouteCircuit. -type PeerExpressRouteCircuitConnectionListResult struct { - // The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` - - // The global reach peer circuit connection associated with Private Peering in an ExpressRoute Circuit. - Value []*PeerExpressRouteCircuitConnection `json:"value,omitempty"` -} - -// PeerExpressRouteCircuitConnectionPropertiesFormat - Properties of the peer express route circuit connection. -type PeerExpressRouteCircuitConnectionPropertiesFormat struct { - // /29 IP address space to carve out Customer addresses for tunnels. - AddressPrefix *string `json:"addressPrefix,omitempty"` - - // The resource guid of the authorization used for the express route circuit connection. - AuthResourceGUID *string `json:"authResourceGuid,omitempty"` - - // The name of the express route circuit connection resource. - ConnectionName *string `json:"connectionName,omitempty"` - - // Reference to Express Route Circuit Private Peering Resource of the circuit. - ExpressRouteCircuitPeering *SubResource `json:"expressRouteCircuitPeering,omitempty"` - - // Reference to Express Route Circuit Private Peering Resource of the peered circuit. - PeerExpressRouteCircuitPeering *SubResource `json:"peerExpressRouteCircuitPeering,omitempty"` - - // READ-ONLY; Express Route Circuit connection state. - CircuitConnectionStatus *CircuitConnectionStatus `json:"circuitConnectionStatus,omitempty" azure:"ro"` - - // READ-ONLY; The provisioning state of the peer express route circuit connection resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// PeerExpressRouteCircuitConnectionsClientGetOptions contains the optional parameters for the PeerExpressRouteCircuitConnectionsClient.Get -// method. -type PeerExpressRouteCircuitConnectionsClientGetOptions struct { - // placeholder for future optional parameters -} - -// PeerExpressRouteCircuitConnectionsClientListOptions contains the optional parameters for the PeerExpressRouteCircuitConnectionsClient.List -// method. -type PeerExpressRouteCircuitConnectionsClientListOptions struct { - // placeholder for future optional parameters -} - -// PeerRoute - Peer routing details. -type PeerRoute struct { - // READ-ONLY; The route's AS path sequence. - AsPath *string `json:"asPath,omitempty" azure:"ro"` - - // READ-ONLY; The peer's local address. - LocalAddress *string `json:"localAddress,omitempty" azure:"ro"` - - // READ-ONLY; The route's network prefix. - Network *string `json:"network,omitempty" azure:"ro"` - - // READ-ONLY; The route's next hop. - NextHop *string `json:"nextHop,omitempty" azure:"ro"` - - // READ-ONLY; The source this route was learned from. - Origin *string `json:"origin,omitempty" azure:"ro"` - - // READ-ONLY; The peer this route was learned from. - SourcePeer *string `json:"sourcePeer,omitempty" azure:"ro"` - - // READ-ONLY; The route's weight. - Weight *int32 `json:"weight,omitempty" azure:"ro"` -} - -// PeerRouteList - List of virtual router peer routes. -type PeerRouteList struct { - // List of peer routes. - Value []*PeerRoute `json:"value,omitempty"` -} - -// PolicySettings - Defines contents of a web application firewall global configuration. -type PolicySettings struct { - // Maximum file upload size in Mb for WAF. - FileUploadLimitInMb *int32 `json:"fileUploadLimitInMb,omitempty"` - - // Maximum request body size in Kb for WAF. - MaxRequestBodySizeInKb *int32 `json:"maxRequestBodySizeInKb,omitempty"` - - // The mode of the policy. - Mode *WebApplicationFirewallMode `json:"mode,omitempty"` - - // Whether to allow WAF to check request Body. - RequestBodyCheck *bool `json:"requestBodyCheck,omitempty"` - - // The state of the policy. - State *WebApplicationFirewallEnabledState `json:"state,omitempty"` -} - -// PrepareNetworkPoliciesRequest - Details of PrepareNetworkPolicies for Subnet. -type PrepareNetworkPoliciesRequest struct { - // A list of NetworkIntentPolicyConfiguration. - NetworkIntentPolicyConfigurations []*IntentPolicyConfiguration `json:"networkIntentPolicyConfigurations,omitempty"` - - // The name of the service for which subnet is being prepared for. - ServiceName *string `json:"serviceName,omitempty"` -} - -// PrivateDNSZoneConfig - PrivateDnsZoneConfig resource. -type PrivateDNSZoneConfig struct { - // 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"` - - // Properties of the private dns zone configuration. - Properties *PrivateDNSZonePropertiesFormat `json:"properties,omitempty"` -} - -// PrivateDNSZoneGroup - Private dns zone group resource. -type PrivateDNSZoneGroup struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // 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"` - - // Properties of the private dns zone group. - Properties *PrivateDNSZoneGroupPropertiesFormat `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` -} - -// PrivateDNSZoneGroupListResult - Response for the ListPrivateDnsZoneGroups API service call. -type PrivateDNSZoneGroupListResult struct { - // A list of private dns zone group resources in a private endpoint. - Value []*PrivateDNSZoneGroup `json:"value,omitempty"` - - // READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` -} - -// PrivateDNSZoneGroupPropertiesFormat - Properties of the private dns zone group. -type PrivateDNSZoneGroupPropertiesFormat struct { - // A collection of private dns zone configurations of the private dns zone group. - PrivateDNSZoneConfigs []*PrivateDNSZoneConfig `json:"privateDnsZoneConfigs,omitempty"` - - // READ-ONLY; The provisioning state of the private dns zone group resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// PrivateDNSZoneGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateDNSZoneGroupsClient.BeginCreateOrUpdate -// method. -type PrivateDNSZoneGroupsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// PrivateDNSZoneGroupsClientBeginDeleteOptions contains the optional parameters for the PrivateDNSZoneGroupsClient.BeginDelete -// method. -type PrivateDNSZoneGroupsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// PrivateDNSZoneGroupsClientGetOptions contains the optional parameters for the PrivateDNSZoneGroupsClient.Get method. -type PrivateDNSZoneGroupsClientGetOptions struct { - // placeholder for future optional parameters -} - -// PrivateDNSZoneGroupsClientListOptions contains the optional parameters for the PrivateDNSZoneGroupsClient.List method. -type PrivateDNSZoneGroupsClientListOptions struct { - // placeholder for future optional parameters -} - -// PrivateDNSZonePropertiesFormat - Properties of the private dns zone configuration resource. -type PrivateDNSZonePropertiesFormat struct { - // The resource id of the private dns zone. - PrivateDNSZoneID *string `json:"privateDnsZoneId,omitempty"` - - // READ-ONLY; A collection of information regarding a recordSet, holding information to identify private resources. - RecordSets []*RecordSet `json:"recordSets,omitempty" azure:"ro"` -} - -// PrivateEndpoint - Private endpoint resource. -type PrivateEndpoint struct { - // The extended location of the load balancer. - ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` - - // Resource ID. - ID *string `json:"id,omitempty"` - - // Resource location. - Location *string `json:"location,omitempty"` - - // Properties of the private endpoint. - Properties *PrivateEndpointProperties `json:"properties,omitempty"` - - // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// PrivateEndpointConnection resource. -type PrivateEndpointConnection struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // 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"` - - // Properties of the private end point connection. - Properties *PrivateEndpointConnectionProperties `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; The resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// PrivateEndpointConnectionListResult - Response for the ListPrivateEndpointConnection API service call. -type PrivateEndpointConnectionListResult struct { - // A list of PrivateEndpointConnection resources for a specific private link service. - Value []*PrivateEndpointConnection `json:"value,omitempty"` - - // READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` -} - -// PrivateEndpointConnectionProperties - Properties of the PrivateEndpointConnectProperties. -type PrivateEndpointConnectionProperties struct { - // A collection of information about the state of the connection between service consumer and provider. - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - - // READ-ONLY; The consumer link id. - LinkIdentifier *string `json:"linkIdentifier,omitempty" azure:"ro"` - - // READ-ONLY; The resource of private end point. - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty" azure:"ro"` - - // READ-ONLY; The provisioning state of the private endpoint connection resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// PrivateEndpointIPConfiguration - An IP Configuration of the private endpoint. -type PrivateEndpointIPConfiguration struct { - // The name of the resource that is unique within a resource group. - Name *string `json:"name,omitempty"` - - // Properties of private endpoint IP configurations. - Properties *PrivateEndpointIPConfigurationProperties `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; The resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// PrivateEndpointIPConfigurationProperties - Properties of an IP Configuration of the private endpoint. -type PrivateEndpointIPConfigurationProperties struct { - // The ID of a group obtained from the remote resource that this private endpoint should connect to. - GroupID *string `json:"groupId,omitempty"` - - // The member name of a group obtained from the remote resource that this private endpoint should connect to. - MemberName *string `json:"memberName,omitempty"` - - // A private ip address obtained from the private endpoint's subnet. - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` -} - -// PrivateEndpointListResult - Response for the ListPrivateEndpoints API service call. -type PrivateEndpointListResult struct { - // A list of private endpoint resources in a resource group. - Value []*PrivateEndpoint `json:"value,omitempty"` - - // READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` -} - -// PrivateEndpointProperties - Properties of the private endpoint. -type PrivateEndpointProperties struct { - // Application security groups in which the private endpoint IP configuration is included. - ApplicationSecurityGroups []*ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - - // An array of custom dns configurations. - CustomDNSConfigs []*CustomDNSConfigPropertiesFormat `json:"customDnsConfigs,omitempty"` - - // The custom name of the network interface attached to the private endpoint. - CustomNetworkInterfaceName *string `json:"customNetworkInterfaceName,omitempty"` - - // A list of IP configurations of the private endpoint. This will be used to map to the First Party Service's endpoints. - IPConfigurations []*PrivateEndpointIPConfiguration `json:"ipConfigurations,omitempty"` - - // A grouping of information about the connection to the remote resource. Used when the network admin does not have access - // to approve connections to the remote resource. - ManualPrivateLinkServiceConnections []*PrivateLinkServiceConnection `json:"manualPrivateLinkServiceConnections,omitempty"` - - // A grouping of information about the connection to the remote resource. - PrivateLinkServiceConnections []*PrivateLinkServiceConnection `json:"privateLinkServiceConnections,omitempty"` - - // The ID of the subnet from which the private IP will be allocated. - Subnet *Subnet `json:"subnet,omitempty"` - - // READ-ONLY; An array of references to the network interfaces created for this private endpoint. - NetworkInterfaces []*Interface `json:"networkInterfaces,omitempty" azure:"ro"` - - // READ-ONLY; The provisioning state of the private endpoint resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// PrivateEndpointsClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateEndpointsClient.BeginCreateOrUpdate -// method. -type PrivateEndpointsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// PrivateEndpointsClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointsClient.BeginDelete method. -type PrivateEndpointsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// PrivateEndpointsClientGetOptions contains the optional parameters for the PrivateEndpointsClient.Get method. -type PrivateEndpointsClientGetOptions struct { - // Expands referenced resources. - Expand *string -} - -// PrivateEndpointsClientListBySubscriptionOptions contains the optional parameters for the PrivateEndpointsClient.ListBySubscription -// method. -type PrivateEndpointsClientListBySubscriptionOptions struct { - // placeholder for future optional parameters -} - -// PrivateEndpointsClientListOptions contains the optional parameters for the PrivateEndpointsClient.List method. -type PrivateEndpointsClientListOptions struct { - // placeholder for future optional parameters -} - -// PrivateLinkService - Private link service resource. -type PrivateLinkService struct { - // The extended location of the load balancer. - ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` - - // Resource ID. - ID *string `json:"id,omitempty"` - - // Resource location. - Location *string `json:"location,omitempty"` - - // Properties of the private link service. - Properties *PrivateLinkServiceProperties `json:"properties,omitempty"` - - // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// PrivateLinkServiceConnection resource. -type PrivateLinkServiceConnection struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // 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"` - - // Properties of the private link service connection. - Properties *PrivateLinkServiceConnectionProperties `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; The resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// PrivateLinkServiceConnectionProperties - Properties of the PrivateLinkServiceConnection. -type PrivateLinkServiceConnectionProperties struct { - // The ID(s) of the group(s) obtained from the remote resource that this private endpoint should connect to. - GroupIDs []*string `json:"groupIds,omitempty"` - - // A collection of read-only information about the state of the connection to the remote resource. - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - - // The resource id of private link service. - PrivateLinkServiceID *string `json:"privateLinkServiceId,omitempty"` - - // A message passed to the owner of the remote resource with this connection request. Restricted to 140 chars. - RequestMessage *string `json:"requestMessage,omitempty"` - - // READ-ONLY; The provisioning state of the private link service connection resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// PrivateLinkServiceConnectionState - A collection of information about the state of the connection between service consumer -// and provider. -type PrivateLinkServiceConnectionState struct { - // A message indicating if changes on the service provider require any updates on the consumer. - ActionsRequired *string `json:"actionsRequired,omitempty"` - - // The reason for approval/rejection of the connection. - Description *string `json:"description,omitempty"` - - // Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. - Status *string `json:"status,omitempty"` -} - -// PrivateLinkServiceIPConfiguration - The private link service ip configuration. -type PrivateLinkServiceIPConfiguration struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // The name of private link service ip configuration. - Name *string `json:"name,omitempty"` - - // Properties of the private link service ip configuration. - Properties *PrivateLinkServiceIPConfigurationProperties `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; The resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// PrivateLinkServiceIPConfigurationProperties - Properties of private link service IP configuration. -type PrivateLinkServiceIPConfigurationProperties struct { - // Whether the ip configuration is primary or not. - Primary *bool `json:"primary,omitempty"` - - // The private IP address of the IP configuration. - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - - // Whether the specific IP configuration is IPv4 or IPv6. Default is IPv4. - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - - // The private IP address allocation method. - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - - // The reference to the subnet resource. - Subnet *Subnet `json:"subnet,omitempty"` - - // READ-ONLY; The provisioning state of the private link service IP configuration resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// PrivateLinkServiceListResult - Response for the ListPrivateLinkService API service call. -type PrivateLinkServiceListResult struct { - // A list of PrivateLinkService resources in a resource group. - Value []*PrivateLinkService `json:"value,omitempty"` - - // READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` -} - -// PrivateLinkServiceProperties - Properties of the private link service. -type PrivateLinkServiceProperties struct { - // The auto-approval list of the private link service. - AutoApproval *PrivateLinkServicePropertiesAutoApproval `json:"autoApproval,omitempty"` - - // Whether the private link service is enabled for proxy protocol or not. - EnableProxyProtocol *bool `json:"enableProxyProtocol,omitempty"` - - // The list of Fqdn. - Fqdns []*string `json:"fqdns,omitempty"` - - // An array of private link service IP configurations. - IPConfigurations []*PrivateLinkServiceIPConfiguration `json:"ipConfigurations,omitempty"` - - // An array of references to the load balancer IP configurations. - LoadBalancerFrontendIPConfigurations []*FrontendIPConfiguration `json:"loadBalancerFrontendIpConfigurations,omitempty"` - - // The visibility list of the private link service. - Visibility *PrivateLinkServicePropertiesVisibility `json:"visibility,omitempty"` - - // READ-ONLY; The alias of the private link service. - Alias *string `json:"alias,omitempty" azure:"ro"` - - // READ-ONLY; An array of references to the network interfaces created for this private link service. - NetworkInterfaces []*Interface `json:"networkInterfaces,omitempty" azure:"ro"` - - // READ-ONLY; An array of list about connections to the private endpoint. - PrivateEndpointConnections []*PrivateEndpointConnection `json:"privateEndpointConnections,omitempty" azure:"ro"` - - // READ-ONLY; The provisioning state of the private link service resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// PrivateLinkServicePropertiesAutoApproval - The auto-approval list of the private link service. -type PrivateLinkServicePropertiesAutoApproval struct { - // The list of subscriptions. - Subscriptions []*string `json:"subscriptions,omitempty"` -} - -// PrivateLinkServicePropertiesVisibility - The visibility list of the private link service. -type PrivateLinkServicePropertiesVisibility struct { - // The list of subscriptions. - Subscriptions []*string `json:"subscriptions,omitempty"` -} - -// PrivateLinkServiceVisibility - Response for the CheckPrivateLinkServiceVisibility API service call. -type PrivateLinkServiceVisibility struct { - // Private Link Service Visibility (True/False). - Visible *bool `json:"visible,omitempty"` -} - -// PrivateLinkServicesClientBeginCheckPrivateLinkServiceVisibilityByResourceGroupOptions contains the optional parameters -// for the PrivateLinkServicesClient.BeginCheckPrivateLinkServiceVisibilityByResourceGroup method. -type PrivateLinkServicesClientBeginCheckPrivateLinkServiceVisibilityByResourceGroupOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// PrivateLinkServicesClientBeginCheckPrivateLinkServiceVisibilityOptions contains the optional parameters for the PrivateLinkServicesClient.BeginCheckPrivateLinkServiceVisibility -// method. -type PrivateLinkServicesClientBeginCheckPrivateLinkServiceVisibilityOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// PrivateLinkServicesClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateLinkServicesClient.BeginCreateOrUpdate -// method. -type PrivateLinkServicesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// PrivateLinkServicesClientBeginDeleteOptions contains the optional parameters for the PrivateLinkServicesClient.BeginDelete -// method. -type PrivateLinkServicesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// PrivateLinkServicesClientBeginDeletePrivateEndpointConnectionOptions contains the optional parameters for the PrivateLinkServicesClient.BeginDeletePrivateEndpointConnection -// method. -type PrivateLinkServicesClientBeginDeletePrivateEndpointConnectionOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// PrivateLinkServicesClientGetOptions contains the optional parameters for the PrivateLinkServicesClient.Get method. -type PrivateLinkServicesClientGetOptions struct { - // Expands referenced resources. - Expand *string -} - -// PrivateLinkServicesClientGetPrivateEndpointConnectionOptions contains the optional parameters for the PrivateLinkServicesClient.GetPrivateEndpointConnection -// method. -type PrivateLinkServicesClientGetPrivateEndpointConnectionOptions struct { - // Expands referenced resources. - Expand *string -} - -// PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesByResourceGroupOptions contains the optional parameters for -// the PrivateLinkServicesClient.ListAutoApprovedPrivateLinkServicesByResourceGroup method. -type PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesOptions contains the optional parameters for the PrivateLinkServicesClient.ListAutoApprovedPrivateLinkServices -// method. -type PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesOptions struct { - // placeholder for future optional parameters -} - -// PrivateLinkServicesClientListBySubscriptionOptions contains the optional parameters for the PrivateLinkServicesClient.ListBySubscription -// method. -type PrivateLinkServicesClientListBySubscriptionOptions struct { - // placeholder for future optional parameters -} - -// PrivateLinkServicesClientListOptions contains the optional parameters for the PrivateLinkServicesClient.List method. -type PrivateLinkServicesClientListOptions struct { - // placeholder for future optional parameters -} - -// PrivateLinkServicesClientListPrivateEndpointConnectionsOptions contains the optional parameters for the PrivateLinkServicesClient.ListPrivateEndpointConnections -// method. -type PrivateLinkServicesClientListPrivateEndpointConnectionsOptions struct { - // placeholder for future optional parameters -} - -// PrivateLinkServicesClientUpdatePrivateEndpointConnectionOptions contains the optional parameters for the PrivateLinkServicesClient.UpdatePrivateEndpointConnection -// method. -type PrivateLinkServicesClientUpdatePrivateEndpointConnectionOptions struct { - // placeholder for future optional parameters -} - -// Probe - A load balancer probe. -type Probe struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // The name of the resource that is unique within the set of probes used by the load balancer. This name can be used to access - // the resource. - Name *string `json:"name,omitempty"` - - // Properties of load balancer probe. - Properties *ProbePropertiesFormat `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ProbePropertiesFormat - Load balancer probe resource. -type ProbePropertiesFormat struct { - // REQUIRED; The port for communicating the probe. Possible values range from 1 to 65535, inclusive. - Port *int32 `json:"port,omitempty"` - - // REQUIRED; The protocol of the end point. If 'Tcp' is specified, a received ACK is required for the probe to be successful. - // If 'Http' or 'Https' is specified, a 200 OK response from the specifies URI is required - // for the probe to be successful. - Protocol *ProbeProtocol `json:"protocol,omitempty"` - - // The interval, in seconds, for how frequently to probe the endpoint for health status. Typically, the interval is slightly - // less than half the allocated timeout period (in seconds) which allows two full - // probes before taking the instance out of rotation. The default value is 15, the minimum value is 5. - IntervalInSeconds *int32 `json:"intervalInSeconds,omitempty"` - - // The number of probes where if no response, will result in stopping further traffic from being delivered to the endpoint. - // This values allows endpoints to be taken out of rotation faster or slower than - // the typical times used in Azure. - NumberOfProbes *int32 `json:"numberOfProbes,omitempty"` - - // The URI used for requesting health status from the VM. Path is required if a protocol is set to http. Otherwise, it is - // not allowed. There is no default value. - RequestPath *string `json:"requestPath,omitempty"` - - // READ-ONLY; The load balancer rules that use this probe. - LoadBalancingRules []*SubResource `json:"loadBalancingRules,omitempty" azure:"ro"` - - // READ-ONLY; The provisioning state of the probe resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// Profile - Network profile resource. -type Profile struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Resource location. - Location *string `json:"location,omitempty"` - - // Network profile properties. - Properties *ProfilePropertiesFormat `json:"properties,omitempty"` - - // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ProfileListResult - Response for ListNetworkProfiles API service call. -type ProfileListResult struct { - // The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` - - // A list of network profiles that exist in a resource group. - Value []*Profile `json:"value,omitempty"` -} - -// ProfilePropertiesFormat - Network profile properties. -type ProfilePropertiesFormat struct { - // List of chid container network interface configurations. - ContainerNetworkInterfaceConfigurations []*ContainerNetworkInterfaceConfiguration `json:"containerNetworkInterfaceConfigurations,omitempty"` - - // READ-ONLY; List of child container network interfaces. - ContainerNetworkInterfaces []*ContainerNetworkInterface `json:"containerNetworkInterfaces,omitempty" azure:"ro"` - - // READ-ONLY; The provisioning state of the network profile resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` - - // READ-ONLY; The resource GUID property of the network profile resource. - ResourceGUID *string `json:"resourceGuid,omitempty" azure:"ro"` -} - -// ProfilesClientBeginDeleteOptions contains the optional parameters for the ProfilesClient.BeginDelete method. -type ProfilesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ProfilesClientCreateOrUpdateOptions contains the optional parameters for the ProfilesClient.CreateOrUpdate method. -type ProfilesClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// ProfilesClientGetOptions contains the optional parameters for the ProfilesClient.Get method. -type ProfilesClientGetOptions struct { - // Expands referenced resources. - Expand *string -} - -// ProfilesClientListAllOptions contains the optional parameters for the ProfilesClient.ListAll method. -type ProfilesClientListAllOptions struct { - // placeholder for future optional parameters -} - -// ProfilesClientListOptions contains the optional parameters for the ProfilesClient.List method. -type ProfilesClientListOptions struct { - // placeholder for future optional parameters -} - -// ProfilesClientUpdateTagsOptions contains the optional parameters for the ProfilesClient.UpdateTags method. -type ProfilesClientUpdateTagsOptions struct { - // placeholder for future optional parameters -} - -// PropagatedRouteTable - The list of RouteTables to advertise the routes to. -type PropagatedRouteTable struct { - // The list of resource ids of all the RouteTables. - IDs []*SubResource `json:"ids,omitempty"` - - // The list of labels. - Labels []*string `json:"labels,omitempty"` -} - -// ProtocolConfiguration - Configuration of the protocol. -type ProtocolConfiguration struct { - // HTTP configuration of the connectivity check. - HTTPConfiguration *HTTPConfiguration `json:"HTTPConfiguration,omitempty"` -} - -// ProtocolCustomSettingsFormat - DDoS custom policy properties. -type ProtocolCustomSettingsFormat struct { - // The protocol for which the DDoS protection policy is being customized. - Protocol *DdosCustomPolicyProtocol `json:"protocol,omitempty"` - - // The customized DDoS protection source rate. - SourceRateOverride *string `json:"sourceRateOverride,omitempty"` - - // The customized DDoS protection trigger rate. - TriggerRateOverride *string `json:"triggerRateOverride,omitempty"` - - // The customized DDoS protection trigger rate sensitivity degrees. High: Trigger rate set with most sensitivity w.r.t. normal - // traffic. Default: Trigger rate set with moderate sensitivity w.r.t. normal - // traffic. Low: Trigger rate set with less sensitivity w.r.t. normal traffic. Relaxed: Trigger rate set with least sensitivity - // w.r.t. normal traffic. - TriggerSensitivityOverride *DdosCustomPolicyTriggerSensitivityOverride `json:"triggerSensitivityOverride,omitempty"` -} - -// PublicIPAddress - Public IP address resource. -type PublicIPAddress struct { - // The extended location of the public ip address. - ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` - - // Resource ID. - ID *string `json:"id,omitempty"` - - // Resource location. - Location *string `json:"location,omitempty"` - - // Public IP address properties. - Properties *PublicIPAddressPropertiesFormat `json:"properties,omitempty"` - - // The public IP address SKU. - SKU *PublicIPAddressSKU `json:"sku,omitempty"` - - // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` - - // A list of availability zones denoting the IP allocated for the resource needs to come from. - Zones []*string `json:"zones,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// PublicIPAddressDNSSettings - Contains FQDN of the DNS record associated with the public IP address. -type PublicIPAddressDNSSettings struct { - // The domain name label. The concatenation of the domain name label and the regionalized DNS zone make up the fully qualified - // domain name associated with the public IP address. If a domain name label is - // specified, an A DNS record is created for the public IP in the Microsoft Azure DNS system. - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - - // The Fully Qualified Domain Name of the A DNS record associated with the public IP. This is the concatenation of the domainNameLabel - // and the regionalized DNS zone. - Fqdn *string `json:"fqdn,omitempty"` - - // The reverse FQDN. A user-visible, fully qualified domain name that resolves to this public IP address. If the reverseFqdn - // is specified, then a PTR DNS record is created pointing from the IP address in - // the in-addr.arpa domain to the reverse FQDN. - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} - -// PublicIPAddressListResult - Response for ListPublicIpAddresses API service call. -type PublicIPAddressListResult struct { - // The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` - - // A list of public IP addresses that exists in a resource group. - Value []*PublicIPAddress `json:"value,omitempty"` -} - -// PublicIPAddressPropertiesFormat - Public IP address properties. -type PublicIPAddressPropertiesFormat struct { - // The FQDN of the DNS record associated with the public IP address. - DNSSettings *PublicIPAddressDNSSettings `json:"dnsSettings,omitempty"` - - // The DDoS protection custom policy associated with the public IP address. - DdosSettings *DdosSettings `json:"ddosSettings,omitempty"` - - // Specify what happens to the public IP address when the VM using it is deleted - DeleteOption *DeleteOptions `json:"deleteOption,omitempty"` - - // The IP address associated with the public IP address resource. - IPAddress *string `json:"ipAddress,omitempty"` - - // The list of tags associated with the public IP address. - IPTags []*IPTag `json:"ipTags,omitempty"` - - // The idle timeout of the public IP address. - IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` - - // The linked public IP address of the public IP address resource. - LinkedPublicIPAddress *PublicIPAddress `json:"linkedPublicIPAddress,omitempty"` - - // Migration phase of Public IP Address. - MigrationPhase *PublicIPAddressMigrationPhase `json:"migrationPhase,omitempty"` - - // The NatGateway for the Public IP address. - NatGateway *NatGateway `json:"natGateway,omitempty"` - - // The public IP address version. - PublicIPAddressVersion *IPVersion `json:"publicIPAddressVersion,omitempty"` - - // The public IP address allocation method. - PublicIPAllocationMethod *IPAllocationMethod `json:"publicIPAllocationMethod,omitempty"` - - // The Public IP Prefix this Public IP Address should be allocated from. - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - - // The service public IP address of the public IP address resource. - ServicePublicIPAddress *PublicIPAddress `json:"servicePublicIPAddress,omitempty"` - - // READ-ONLY; The IP configuration associated with the public IP address. - IPConfiguration *IPConfiguration `json:"ipConfiguration,omitempty" azure:"ro"` - - // READ-ONLY; The provisioning state of the public IP address resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` - - // READ-ONLY; The resource GUID property of the public IP address resource. - ResourceGUID *string `json:"resourceGuid,omitempty" azure:"ro"` -} - -// PublicIPAddressSKU - SKU of a public IP address. -type PublicIPAddressSKU struct { - // Name of a public IP address SKU. - Name *PublicIPAddressSKUName `json:"name,omitempty"` - - // Tier of a public IP address SKU. - Tier *PublicIPAddressSKUTier `json:"tier,omitempty"` -} - -// PublicIPAddressesClientBeginCreateOrUpdateOptions contains the optional parameters for the PublicIPAddressesClient.BeginCreateOrUpdate -// method. -type PublicIPAddressesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// PublicIPAddressesClientBeginDeleteOptions contains the optional parameters for the PublicIPAddressesClient.BeginDelete -// method. -type PublicIPAddressesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// PublicIPAddressesClientGetCloudServicePublicIPAddressOptions contains the optional parameters for the PublicIPAddressesClient.GetCloudServicePublicIPAddress -// method. -type PublicIPAddressesClientGetCloudServicePublicIPAddressOptions struct { - // Expands referenced resources. - Expand *string -} - -// PublicIPAddressesClientGetOptions contains the optional parameters for the PublicIPAddressesClient.Get method. -type PublicIPAddressesClientGetOptions struct { - // Expands referenced resources. - Expand *string -} - -// PublicIPAddressesClientGetVirtualMachineScaleSetPublicIPAddressOptions contains the optional parameters for the PublicIPAddressesClient.GetVirtualMachineScaleSetPublicIPAddress -// method. -type PublicIPAddressesClientGetVirtualMachineScaleSetPublicIPAddressOptions struct { - // Expands referenced resources. - Expand *string -} - -// PublicIPAddressesClientListAllOptions contains the optional parameters for the PublicIPAddressesClient.ListAll method. -type PublicIPAddressesClientListAllOptions struct { - // placeholder for future optional parameters -} - -// PublicIPAddressesClientListCloudServicePublicIPAddressesOptions contains the optional parameters for the PublicIPAddressesClient.ListCloudServicePublicIPAddresses -// method. -type PublicIPAddressesClientListCloudServicePublicIPAddressesOptions struct { - // placeholder for future optional parameters -} - -// PublicIPAddressesClientListCloudServiceRoleInstancePublicIPAddressesOptions contains the optional parameters for the PublicIPAddressesClient.ListCloudServiceRoleInstancePublicIPAddresses -// method. -type PublicIPAddressesClientListCloudServiceRoleInstancePublicIPAddressesOptions struct { - // placeholder for future optional parameters -} - -// PublicIPAddressesClientListOptions contains the optional parameters for the PublicIPAddressesClient.List method. -type PublicIPAddressesClientListOptions struct { - // placeholder for future optional parameters -} - -// PublicIPAddressesClientListVirtualMachineScaleSetPublicIPAddressesOptions contains the optional parameters for the PublicIPAddressesClient.ListVirtualMachineScaleSetPublicIPAddresses -// method. -type PublicIPAddressesClientListVirtualMachineScaleSetPublicIPAddressesOptions struct { - // placeholder for future optional parameters -} - -// PublicIPAddressesClientListVirtualMachineScaleSetVMPublicIPAddressesOptions contains the optional parameters for the PublicIPAddressesClient.ListVirtualMachineScaleSetVMPublicIPAddresses -// method. -type PublicIPAddressesClientListVirtualMachineScaleSetVMPublicIPAddressesOptions struct { - // placeholder for future optional parameters -} - -// PublicIPAddressesClientUpdateTagsOptions contains the optional parameters for the PublicIPAddressesClient.UpdateTags method. -type PublicIPAddressesClientUpdateTagsOptions struct { - // placeholder for future optional parameters -} - -// PublicIPPrefix - Public IP prefix resource. -type PublicIPPrefix struct { - // The extended location of the public ip address. - ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` - - // Resource ID. - ID *string `json:"id,omitempty"` - - // Resource location. - Location *string `json:"location,omitempty"` - - // Public IP prefix properties. - Properties *PublicIPPrefixPropertiesFormat `json:"properties,omitempty"` - - // The public IP prefix SKU. - SKU *PublicIPPrefixSKU `json:"sku,omitempty"` - - // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` - - // A list of availability zones denoting the IP allocated for the resource needs to come from. - Zones []*string `json:"zones,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// PublicIPPrefixListResult - Response for ListPublicIpPrefixes API service call. -type PublicIPPrefixListResult struct { - // The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` - - // A list of public IP prefixes that exists in a resource group. - Value []*PublicIPPrefix `json:"value,omitempty"` -} - -// PublicIPPrefixPropertiesFormat - Public IP prefix properties. -type PublicIPPrefixPropertiesFormat struct { - // The customIpPrefix that this prefix is associated with. - CustomIPPrefix *SubResource `json:"customIPPrefix,omitempty"` - - // The list of tags associated with the public IP prefix. - IPTags []*IPTag `json:"ipTags,omitempty"` - - // NatGateway of Public IP Prefix. - NatGateway *NatGateway `json:"natGateway,omitempty"` - - // The Length of the Public IP Prefix. - PrefixLength *int32 `json:"prefixLength,omitempty"` - - // The public IP address version. - PublicIPAddressVersion *IPVersion `json:"publicIPAddressVersion,omitempty"` - - // READ-ONLY; The allocated Prefix. - IPPrefix *string `json:"ipPrefix,omitempty" azure:"ro"` - - // READ-ONLY; The reference to load balancer frontend IP configuration associated with the public IP prefix. - LoadBalancerFrontendIPConfiguration *SubResource `json:"loadBalancerFrontendIpConfiguration,omitempty" azure:"ro"` - - // READ-ONLY; The provisioning state of the public IP prefix resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` - - // READ-ONLY; The list of all referenced PublicIPAddresses. - PublicIPAddresses []*ReferencedPublicIPAddress `json:"publicIPAddresses,omitempty" azure:"ro"` - - // READ-ONLY; The resource GUID property of the public IP prefix resource. - ResourceGUID *string `json:"resourceGuid,omitempty" azure:"ro"` -} - -// PublicIPPrefixSKU - SKU of a public IP prefix. -type PublicIPPrefixSKU struct { - // Name of a public IP prefix SKU. - Name *PublicIPPrefixSKUName `json:"name,omitempty"` - - // Tier of a public IP prefix SKU. - Tier *PublicIPPrefixSKUTier `json:"tier,omitempty"` -} - -// PublicIPPrefixesClientBeginCreateOrUpdateOptions contains the optional parameters for the PublicIPPrefixesClient.BeginCreateOrUpdate -// method. -type PublicIPPrefixesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// PublicIPPrefixesClientBeginDeleteOptions contains the optional parameters for the PublicIPPrefixesClient.BeginDelete method. -type PublicIPPrefixesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// PublicIPPrefixesClientGetOptions contains the optional parameters for the PublicIPPrefixesClient.Get method. -type PublicIPPrefixesClientGetOptions struct { - // Expands referenced resources. - Expand *string -} - -// PublicIPPrefixesClientListAllOptions contains the optional parameters for the PublicIPPrefixesClient.ListAll method. -type PublicIPPrefixesClientListAllOptions struct { - // placeholder for future optional parameters -} - -// PublicIPPrefixesClientListOptions contains the optional parameters for the PublicIPPrefixesClient.List method. -type PublicIPPrefixesClientListOptions struct { - // placeholder for future optional parameters -} - -// PublicIPPrefixesClientUpdateTagsOptions contains the optional parameters for the PublicIPPrefixesClient.UpdateTags method. -type PublicIPPrefixesClientUpdateTagsOptions struct { - // placeholder for future optional parameters -} - -// QosDefinition - Quality of Service defines the traffic configuration between endpoints. Mandatory to have one marking. -type QosDefinition struct { - // Destination IP ranges. - DestinationIPRanges []*QosIPRange `json:"destinationIpRanges,omitempty"` - - // Destination port ranges. - DestinationPortRanges []*QosPortRange `json:"destinationPortRanges,omitempty"` - - // List of markings to be used in the configuration. - Markings []*int32 `json:"markings,omitempty"` - - // RNM supported protocol types. - Protocol *ProtocolType `json:"protocol,omitempty"` - - // Source IP ranges. - SourceIPRanges []*QosIPRange `json:"sourceIpRanges,omitempty"` - - // Sources port ranges. - SourcePortRanges []*QosPortRange `json:"sourcePortRanges,omitempty"` -} - -// QosIPRange - Qos Traffic Profiler IP Range properties. -type QosIPRange struct { - // End IP Address. - EndIP *string `json:"endIP,omitempty"` - - // Start IP Address. - StartIP *string `json:"startIP,omitempty"` -} - -// QosPortRange - Qos Traffic Profiler Port range properties. -type QosPortRange struct { - // Qos Port Range end. - End *int32 `json:"end,omitempty"` - - // Qos Port Range start. - Start *int32 `json:"start,omitempty"` -} - -// QueryInboundNatRulePortMappingRequest - The request for a QueryInboundNatRulePortMapping API. Either IpConfiguration or -// IpAddress should be set -type QueryInboundNatRulePortMappingRequest struct { - // IP address set in load balancer backend address. - IPAddress *string `json:"ipAddress,omitempty"` - - // NetworkInterfaceIPConfiguration set in load balancer backend address. - IPConfiguration *SubResource `json:"ipConfiguration,omitempty"` -} - -// QueryRequestOptions - Query Request Options -type QueryRequestOptions struct { - // When present, the value can be passed to a subsequent query call (together with the same query and scopes used in the current - // request) to retrieve the next page of data. - SkipToken *string `json:"skipToken,omitempty"` -} - -// QueryResults - Query result -type QueryResults struct { - // Number of total records matching the query. - MatchingRecordsCount *int64 `json:"matchingRecordsCount,omitempty"` - - // Array containing the results of the query - Signatures []*SingleQueryResult `json:"signatures,omitempty"` -} - -// QueryTroubleshootingParameters - Parameters that define the resource to query the troubleshooting result. -type QueryTroubleshootingParameters struct { - // REQUIRED; The target resource ID to query the troubleshooting result. - TargetResourceID *string `json:"targetResourceId,omitempty"` -} - -// RadiusServer - Radius Server Settings. -type RadiusServer struct { - // REQUIRED; The address of this radius server. - RadiusServerAddress *string `json:"radiusServerAddress,omitempty"` - - // The initial score assigned to this radius server. - RadiusServerScore *int64 `json:"radiusServerScore,omitempty"` - - // The secret used for this radius server. - RadiusServerSecret *string `json:"radiusServerSecret,omitempty"` -} - -// RecordSet - A collective group of information about the record set information. -type RecordSet struct { - // Fqdn that resolves to private endpoint ip address. - Fqdn *string `json:"fqdn,omitempty"` - - // The private ip address of the private endpoint. - IPAddresses []*string `json:"ipAddresses,omitempty"` - - // Recordset name. - RecordSetName *string `json:"recordSetName,omitempty"` - - // Resource record type. - RecordType *string `json:"recordType,omitempty"` - - // Recordset time to live. - TTL *int32 `json:"ttl,omitempty"` - - // READ-ONLY; The provisioning state of the recordset. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// ReferencedPublicIPAddress - Reference to a public IP address. -type ReferencedPublicIPAddress struct { - // The PublicIPAddress Reference. - ID *string `json:"id,omitempty"` -} - -// Resource - Common resource representation. -type Resource struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Resource location. - Location *string `json:"location,omitempty"` - - // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ResourceNavigationLink resource. -type ResourceNavigationLink struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // 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"` - - // Resource navigation link properties format. - Properties *ResourceNavigationLinkFormat `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ResourceNavigationLinkFormat - Properties of ResourceNavigationLink. -type ResourceNavigationLinkFormat struct { - // Link to the external resource. - Link *string `json:"link,omitempty"` - - // Resource type of the linked resource. - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - - // READ-ONLY; The provisioning state of the resource navigation link resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// ResourceNavigationLinksClientListOptions contains the optional parameters for the ResourceNavigationLinksClient.List method. -type ResourceNavigationLinksClientListOptions struct { - // placeholder for future optional parameters -} - -// ResourceNavigationLinksListResult - Response for ResourceNavigationLinks_List operation. -type ResourceNavigationLinksListResult struct { - // The resource navigation links in a subnet. - Value []*ResourceNavigationLink `json:"value,omitempty"` - - // READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` -} - -// ResourceSet - The base resource set for visibility and auto-approval. -type ResourceSet struct { - // The list of subscriptions. - Subscriptions []*string `json:"subscriptions,omitempty"` -} - -// RetentionPolicyParameters - Parameters that define the retention policy for flow log. -type RetentionPolicyParameters struct { - // Number of days to retain flow log records. - Days *int32 `json:"days,omitempty"` - - // Flag to enable/disable retention. - Enabled *bool `json:"enabled,omitempty"` -} - -// Route resource. -type Route struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // 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"` - - // Properties of the route. - Properties *RoutePropertiesFormat `json:"properties,omitempty"` - - // The type of the resource. - Type *string `json:"type,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` -} - -// RouteFilter - Route Filter Resource. -type RouteFilter struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Resource location. - Location *string `json:"location,omitempty"` - - // Properties of the route filter. - Properties *RouteFilterPropertiesFormat `json:"properties,omitempty"` - - // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// RouteFilterListResult - Response for the ListRouteFilters API service call. -type RouteFilterListResult struct { - // The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` - - // A list of route filters in a resource group. - Value []*RouteFilter `json:"value,omitempty"` -} - -// RouteFilterPropertiesFormat - Route Filter Resource. -type RouteFilterPropertiesFormat struct { - // Collection of RouteFilterRules contained within a route filter. - Rules []*RouteFilterRule `json:"rules,omitempty"` - - // READ-ONLY; A collection of references to express route circuit ipv6 peerings. - IPv6Peerings []*ExpressRouteCircuitPeering `json:"ipv6Peerings,omitempty" azure:"ro"` - - // READ-ONLY; A collection of references to express route circuit peerings. - Peerings []*ExpressRouteCircuitPeering `json:"peerings,omitempty" azure:"ro"` - - // READ-ONLY; The provisioning state of the route filter resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// RouteFilterRule - Route Filter Rule Resource. -type RouteFilterRule struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Resource location. - Location *string `json:"location,omitempty"` - - // 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"` - - // Properties of the route filter rule. - Properties *RouteFilterRulePropertiesFormat `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` -} - -// RouteFilterRuleListResult - Response for the ListRouteFilterRules API service call. -type RouteFilterRuleListResult struct { - // The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` - - // A list of RouteFilterRules in a resource group. - Value []*RouteFilterRule `json:"value,omitempty"` -} - -// RouteFilterRulePropertiesFormat - Route Filter Rule Resource. -type RouteFilterRulePropertiesFormat struct { - // REQUIRED; The access type of the rule. - Access *Access `json:"access,omitempty"` - - // REQUIRED; The collection for bgp community values to filter on. e.g. ['12076:5010','12076:5020']. - Communities []*string `json:"communities,omitempty"` - - // REQUIRED; The rule type of the rule. - RouteFilterRuleType *RouteFilterRuleType `json:"routeFilterRuleType,omitempty"` - - // READ-ONLY; The provisioning state of the route filter rule resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// RouteFilterRulesClientBeginCreateOrUpdateOptions contains the optional parameters for the RouteFilterRulesClient.BeginCreateOrUpdate -// method. -type RouteFilterRulesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// RouteFilterRulesClientBeginDeleteOptions contains the optional parameters for the RouteFilterRulesClient.BeginDelete method. -type RouteFilterRulesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// RouteFilterRulesClientGetOptions contains the optional parameters for the RouteFilterRulesClient.Get method. -type RouteFilterRulesClientGetOptions struct { - // placeholder for future optional parameters -} - -// RouteFilterRulesClientListByRouteFilterOptions contains the optional parameters for the RouteFilterRulesClient.ListByRouteFilter -// method. -type RouteFilterRulesClientListByRouteFilterOptions struct { - // placeholder for future optional parameters -} - -// RouteFiltersClientBeginCreateOrUpdateOptions contains the optional parameters for the RouteFiltersClient.BeginCreateOrUpdate -// method. -type RouteFiltersClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// RouteFiltersClientBeginDeleteOptions contains the optional parameters for the RouteFiltersClient.BeginDelete method. -type RouteFiltersClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// RouteFiltersClientGetOptions contains the optional parameters for the RouteFiltersClient.Get method. -type RouteFiltersClientGetOptions struct { - // Expands referenced express route bgp peering resources. - Expand *string -} - -// RouteFiltersClientListByResourceGroupOptions contains the optional parameters for the RouteFiltersClient.ListByResourceGroup -// method. -type RouteFiltersClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// RouteFiltersClientListOptions contains the optional parameters for the RouteFiltersClient.List method. -type RouteFiltersClientListOptions struct { - // placeholder for future optional parameters -} - -// RouteFiltersClientUpdateTagsOptions contains the optional parameters for the RouteFiltersClient.UpdateTags method. -type RouteFiltersClientUpdateTagsOptions struct { - // placeholder for future optional parameters -} - -// RouteListResult - Response for the ListRoute API service call. -type RouteListResult struct { - // The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` - - // A list of routes in a resource group. - Value []*Route `json:"value,omitempty"` -} - -// RoutePropertiesFormat - Route resource. -type RoutePropertiesFormat struct { - // REQUIRED; The type of Azure hop the packet should be sent to. - NextHopType *RouteNextHopType `json:"nextHopType,omitempty"` - - // The destination CIDR to which the route applies. - AddressPrefix *string `json:"addressPrefix,omitempty"` - - // A value indicating whether this route overrides overlapping BGP routes regardless of LPM. - HasBgpOverride *bool `json:"hasBgpOverride,omitempty"` - - // The IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is VirtualAppliance. - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` - - // READ-ONLY; The provisioning state of the route resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// RouteTable - Route table resource. -type RouteTable struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Resource location. - Location *string `json:"location,omitempty"` - - // Properties of the route table. - Properties *RouteTablePropertiesFormat `json:"properties,omitempty"` - - // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// RouteTableListResult - Response for the ListRouteTable API service call. -type RouteTableListResult struct { - // The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` - - // A list of route tables in a resource group. - Value []*RouteTable `json:"value,omitempty"` -} - -// RouteTablePropertiesFormat - Route Table resource. -type RouteTablePropertiesFormat struct { - // Whether to disable the routes learned by BGP on that route table. True means disable. - DisableBgpRoutePropagation *bool `json:"disableBgpRoutePropagation,omitempty"` - - // Collection of routes contained within a route table. - Routes []*Route `json:"routes,omitempty"` - - // READ-ONLY; The provisioning state of the route table resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` - - // READ-ONLY; The resource GUID property of the route table. - ResourceGUID *string `json:"resourceGuid,omitempty" azure:"ro"` - - // READ-ONLY; A collection of references to subnets. - Subnets []*Subnet `json:"subnets,omitempty" azure:"ro"` -} - -// RouteTablesClientBeginCreateOrUpdateOptions contains the optional parameters for the RouteTablesClient.BeginCreateOrUpdate -// method. -type RouteTablesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// RouteTablesClientBeginDeleteOptions contains the optional parameters for the RouteTablesClient.BeginDelete method. -type RouteTablesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// RouteTablesClientGetOptions contains the optional parameters for the RouteTablesClient.Get method. -type RouteTablesClientGetOptions struct { - // Expands referenced resources. - Expand *string -} - -// RouteTablesClientListAllOptions contains the optional parameters for the RouteTablesClient.ListAll method. -type RouteTablesClientListAllOptions struct { - // placeholder for future optional parameters -} - -// RouteTablesClientListOptions contains the optional parameters for the RouteTablesClient.List method. -type RouteTablesClientListOptions struct { - // placeholder for future optional parameters -} - -// RouteTablesClientUpdateTagsOptions contains the optional parameters for the RouteTablesClient.UpdateTags method. -type RouteTablesClientUpdateTagsOptions struct { - // placeholder for future optional parameters -} - -// RoutesClientBeginCreateOrUpdateOptions contains the optional parameters for the RoutesClient.BeginCreateOrUpdate method. -type RoutesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// RoutesClientBeginDeleteOptions contains the optional parameters for the RoutesClient.BeginDelete method. -type RoutesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// RoutesClientGetOptions contains the optional parameters for the RoutesClient.Get method. -type RoutesClientGetOptions struct { - // placeholder for future optional parameters -} - -// RoutesClientListOptions contains the optional parameters for the RoutesClient.List method. -type RoutesClientListOptions struct { - // placeholder for future optional parameters -} - -// RoutingConfiguration - Routing Configuration indicating the associated and propagated route tables for this connection. -type RoutingConfiguration struct { - // The resource id RouteTable associated with this RoutingConfiguration. - AssociatedRouteTable *SubResource `json:"associatedRouteTable,omitempty"` - - // The list of RouteTables to advertise the routes to. - PropagatedRouteTables *PropagatedRouteTable `json:"propagatedRouteTables,omitempty"` - - // List of routes that control routing from VirtualHub into a virtual network connection. - VnetRoutes *VnetRoute `json:"vnetRoutes,omitempty"` -} - -// RoutingIntent - The routing intent child resource of a Virtual hub. -type RoutingIntent struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // 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"` - - // Properties of the RoutingIntent resource. - Properties *RoutingIntentProperties `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// RoutingIntentClientBeginCreateOrUpdateOptions contains the optional parameters for the RoutingIntentClient.BeginCreateOrUpdate -// method. -type RoutingIntentClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// RoutingIntentClientBeginDeleteOptions contains the optional parameters for the RoutingIntentClient.BeginDelete method. -type RoutingIntentClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// RoutingIntentClientGetOptions contains the optional parameters for the RoutingIntentClient.Get method. -type RoutingIntentClientGetOptions struct { - // placeholder for future optional parameters -} - -// RoutingIntentClientListOptions contains the optional parameters for the RoutingIntentClient.List method. -type RoutingIntentClientListOptions struct { - // placeholder for future optional parameters -} - -// RoutingIntentProperties - The properties of a RoutingIntent resource. -type RoutingIntentProperties struct { - // List of routing policies. - RoutingPolicies []*RoutingPolicy `json:"routingPolicies,omitempty"` - - // READ-ONLY; The provisioning state of the RoutingIntent resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// RoutingPolicy - The routing policy object used in a RoutingIntent resource. -type RoutingPolicy struct { - // REQUIRED; List of all destinations which this routing policy is applicable to (for example: Internet, PrivateTraffic). - Destinations []*string `json:"destinations,omitempty"` - - // REQUIRED; The unique name for the routing policy. - Name *string `json:"name,omitempty"` - - // REQUIRED; The next hop resource id on which this routing policy is applicable to. - NextHop *string `json:"nextHop,omitempty"` -} - -// Rule of type network. -type Rule struct { - // REQUIRED; Rule Type. - RuleType *FirewallPolicyRuleType `json:"ruleType,omitempty"` - - // Description of the rule. - Description *string `json:"description,omitempty"` - - // List of destination IP addresses or Service Tags. - DestinationAddresses []*string `json:"destinationAddresses,omitempty"` - - // List of destination FQDNs. - DestinationFqdns []*string `json:"destinationFqdns,omitempty"` - - // List of destination IpGroups for this rule. - DestinationIPGroups []*string `json:"destinationIpGroups,omitempty"` - - // List of destination ports. - DestinationPorts []*string `json:"destinationPorts,omitempty"` - - // Array of FirewallPolicyRuleNetworkProtocols. - IPProtocols []*FirewallPolicyRuleNetworkProtocol `json:"ipProtocols,omitempty"` - - // Name of the rule. - Name *string `json:"name,omitempty"` - - // List of source IP addresses for this rule. - SourceAddresses []*string `json:"sourceAddresses,omitempty"` - - // List of source IpGroups for this rule. - SourceIPGroups []*string `json:"sourceIpGroups,omitempty"` -} - -// GetFirewallPolicyRule implements the FirewallPolicyRuleClassification interface for type Rule. -func (r *Rule) GetFirewallPolicyRule() *FirewallPolicyRule { - return &FirewallPolicyRule{ - Name: r.Name, - Description: r.Description, - RuleType: r.RuleType, - } -} - -// SKU - The sku of this Bastion Host. -type SKU struct { - // The name of this Bastion Host. - Name *BastionHostSKUName `json:"name,omitempty"` -} - -// ScopeConnection - The Scope Connections resource -type ScopeConnection struct { - // The scope connection properties - Properties *ScopeConnectionProperties `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; The system metadata related to this resource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ScopeConnectionListResult - List of scope connections. -type ScopeConnectionListResult struct { - // Gets the URL to get the next page of results. - NextLink *string `json:"nextLink,omitempty"` - - // List of scope connections. - Value []*ScopeConnection `json:"value,omitempty"` -} - -// ScopeConnectionProperties - Scope connection. -type ScopeConnectionProperties struct { - // A description of the scope connection. - Description *string `json:"description,omitempty"` - - // Resource ID. - ResourceID *string `json:"resourceId,omitempty"` - - // Tenant ID. - TenantID *string `json:"tenantId,omitempty"` - - // READ-ONLY; Connection State - ConnectionState *ScopeConnectionState `json:"connectionState,omitempty" azure:"ro"` -} - -// ScopeConnectionsClientCreateOrUpdateOptions contains the optional parameters for the ScopeConnectionsClient.CreateOrUpdate -// method. -type ScopeConnectionsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// ScopeConnectionsClientDeleteOptions contains the optional parameters for the ScopeConnectionsClient.Delete method. -type ScopeConnectionsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// ScopeConnectionsClientGetOptions contains the optional parameters for the ScopeConnectionsClient.Get method. -type ScopeConnectionsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ScopeConnectionsClientListOptions contains the optional parameters for the ScopeConnectionsClient.List method. -type ScopeConnectionsClientListOptions struct { - // SkipToken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, - // the value of the nextLink element will include a skipToken parameter that - // specifies a starting point to use for subsequent calls. - SkipToken *string - // An optional query parameter which specifies the maximum number of records to be returned by the server. - Top *int32 -} - -// SecurityAdminConfiguration - Defines the security admin configuration -type SecurityAdminConfiguration struct { - // Indicates the properties for the network manager security admin configuration. - Properties *SecurityAdminConfigurationPropertiesFormat `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; The system metadata related to this resource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// SecurityAdminConfigurationListResult - A list of network manager security admin configurations -type SecurityAdminConfigurationListResult struct { - // Gets the URL to get the next page of results. - NextLink *string `json:"nextLink,omitempty"` - - // Gets a page of security admin configurations - Value []*SecurityAdminConfiguration `json:"value,omitempty"` -} - -// SecurityAdminConfigurationPropertiesFormat - Defines the security admin configuration properties. -type SecurityAdminConfigurationPropertiesFormat struct { - // Enum list of network intent policy based services. - ApplyOnNetworkIntentPolicyBasedServices []*NetworkIntentPolicyBasedService `json:"applyOnNetworkIntentPolicyBasedServices,omitempty"` - - // A description of the security configuration. - Description *string `json:"description,omitempty"` - - // READ-ONLY; The provisioning state of the resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// SecurityAdminConfigurationsClientBeginDeleteOptions contains the optional parameters for the SecurityAdminConfigurationsClient.BeginDelete -// method. -type SecurityAdminConfigurationsClientBeginDeleteOptions struct { - // Deletes the resource even if it is part of a deployed configuration. If the configuration has been deployed, the service - // will do a cleanup deployment in the background, prior to the delete. - Force *bool - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SecurityAdminConfigurationsClientCreateOrUpdateOptions contains the optional parameters for the SecurityAdminConfigurationsClient.CreateOrUpdate -// method. -type SecurityAdminConfigurationsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// SecurityAdminConfigurationsClientGetOptions contains the optional parameters for the SecurityAdminConfigurationsClient.Get -// method. -type SecurityAdminConfigurationsClientGetOptions struct { - // placeholder for future optional parameters -} - -// SecurityAdminConfigurationsClientListOptions contains the optional parameters for the SecurityAdminConfigurationsClient.List -// method. -type SecurityAdminConfigurationsClientListOptions struct { - // SkipToken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, - // the value of the nextLink element will include a skipToken parameter that - // specifies a starting point to use for subsequent calls. - SkipToken *string - // An optional query parameter which specifies the maximum number of records to be returned by the server. - Top *int32 -} - -// SecurityGroup - NetworkSecurityGroup resource. -type SecurityGroup struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Resource location. - Location *string `json:"location,omitempty"` - - // Properties of the network security group. - Properties *SecurityGroupPropertiesFormat `json:"properties,omitempty"` - - // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// SecurityGroupListResult - Response for ListNetworkSecurityGroups API service call. -type SecurityGroupListResult struct { - // The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` - - // A list of NetworkSecurityGroup resources. - Value []*SecurityGroup `json:"value,omitempty"` -} - -// SecurityGroupNetworkInterface - Network interface and all its associated security rules. -type SecurityGroupNetworkInterface struct { - // ID of the network interface. - ID *string `json:"id,omitempty"` - - // All security rules associated with the network interface. - SecurityRuleAssociations *SecurityRuleAssociations `json:"securityRuleAssociations,omitempty"` -} - -// SecurityGroupPropertiesFormat - Network Security Group resource. -type SecurityGroupPropertiesFormat struct { - // When enabled, flows created from Network Security Group connections will be re-evaluated when rules are updates. Initial - // enablement will trigger re-evaluation. - FlushConnection *bool `json:"flushConnection,omitempty"` - - // A collection of security rules of the network security group. - SecurityRules []*SecurityRule `json:"securityRules,omitempty"` - - // READ-ONLY; The default security rules of network security group. - DefaultSecurityRules []*SecurityRule `json:"defaultSecurityRules,omitempty" azure:"ro"` - - // READ-ONLY; A collection of references to flow log resources. - FlowLogs []*FlowLog `json:"flowLogs,omitempty" azure:"ro"` - - // READ-ONLY; A collection of references to network interfaces. - NetworkInterfaces []*Interface `json:"networkInterfaces,omitempty" azure:"ro"` - - // READ-ONLY; The provisioning state of the network security group resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` - - // READ-ONLY; The resource GUID property of the network security group resource. - ResourceGUID *string `json:"resourceGuid,omitempty" azure:"ro"` - - // READ-ONLY; A collection of references to subnets. - Subnets []*Subnet `json:"subnets,omitempty" azure:"ro"` -} - -// SecurityGroupResult - Network configuration diagnostic result corresponded provided traffic query. -type SecurityGroupResult struct { - // The network traffic is allowed or denied. - SecurityRuleAccessResult *SecurityRuleAccess `json:"securityRuleAccessResult,omitempty"` - - // READ-ONLY; List of results network security groups diagnostic. - EvaluatedNetworkSecurityGroups []*EvaluatedNetworkSecurityGroup `json:"evaluatedNetworkSecurityGroups,omitempty" azure:"ro"` -} - -// SecurityGroupViewParameters - Parameters that define the VM to check security groups for. -type SecurityGroupViewParameters struct { - // REQUIRED; ID of the target VM. - TargetResourceID *string `json:"targetResourceId,omitempty"` -} - -// SecurityGroupViewResult - The information about security rules applied to the specified VM. -type SecurityGroupViewResult struct { - // List of network interfaces on the specified VM. - NetworkInterfaces []*SecurityGroupNetworkInterface `json:"networkInterfaces,omitempty"` -} - -// SecurityGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the SecurityGroupsClient.BeginCreateOrUpdate -// method. -type SecurityGroupsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SecurityGroupsClientBeginDeleteOptions contains the optional parameters for the SecurityGroupsClient.BeginDelete method. -type SecurityGroupsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SecurityGroupsClientGetOptions contains the optional parameters for the SecurityGroupsClient.Get method. -type SecurityGroupsClientGetOptions struct { - // Expands referenced resources. - Expand *string -} - -// SecurityGroupsClientListAllOptions contains the optional parameters for the SecurityGroupsClient.ListAll method. -type SecurityGroupsClientListAllOptions struct { - // placeholder for future optional parameters -} - -// SecurityGroupsClientListOptions contains the optional parameters for the SecurityGroupsClient.List method. -type SecurityGroupsClientListOptions struct { - // placeholder for future optional parameters -} - -// SecurityGroupsClientUpdateTagsOptions contains the optional parameters for the SecurityGroupsClient.UpdateTags method. -type SecurityGroupsClientUpdateTagsOptions struct { - // placeholder for future optional parameters -} - -// SecurityPartnerProvider - Security Partner Provider resource. -type SecurityPartnerProvider struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Resource location. - Location *string `json:"location,omitempty"` - - // Properties of the Security Partner Provider. - Properties *SecurityPartnerProviderPropertiesFormat `json:"properties,omitempty"` - - // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// SecurityPartnerProviderListResult - Response for ListSecurityPartnerProviders API service call. -type SecurityPartnerProviderListResult struct { - // URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` - - // List of Security Partner Providers in a resource group. - Value []*SecurityPartnerProvider `json:"value,omitempty"` -} - -// SecurityPartnerProviderPropertiesFormat - Properties of the Security Partner Provider. -type SecurityPartnerProviderPropertiesFormat struct { - // The security provider name. - SecurityProviderName *SecurityProviderName `json:"securityProviderName,omitempty"` - - // The virtualHub to which the Security Partner Provider belongs. - VirtualHub *SubResource `json:"virtualHub,omitempty"` - - // READ-ONLY; The connection status with the Security Partner Provider. - ConnectionStatus *SecurityPartnerProviderConnectionStatus `json:"connectionStatus,omitempty" azure:"ro"` - - // READ-ONLY; The provisioning state of the Security Partner Provider resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// SecurityPartnerProvidersClientBeginCreateOrUpdateOptions contains the optional parameters for the SecurityPartnerProvidersClient.BeginCreateOrUpdate -// method. -type SecurityPartnerProvidersClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SecurityPartnerProvidersClientBeginDeleteOptions contains the optional parameters for the SecurityPartnerProvidersClient.BeginDelete -// method. -type SecurityPartnerProvidersClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SecurityPartnerProvidersClientGetOptions contains the optional parameters for the SecurityPartnerProvidersClient.Get method. -type SecurityPartnerProvidersClientGetOptions struct { - // placeholder for future optional parameters -} - -// SecurityPartnerProvidersClientListByResourceGroupOptions contains the optional parameters for the SecurityPartnerProvidersClient.ListByResourceGroup -// method. -type SecurityPartnerProvidersClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// SecurityPartnerProvidersClientListOptions contains the optional parameters for the SecurityPartnerProvidersClient.List -// method. -type SecurityPartnerProvidersClientListOptions struct { - // placeholder for future optional parameters -} - -// SecurityPartnerProvidersClientUpdateTagsOptions contains the optional parameters for the SecurityPartnerProvidersClient.UpdateTags -// method. -type SecurityPartnerProvidersClientUpdateTagsOptions struct { - // placeholder for future optional parameters -} - -// SecurityRule - Network security rule. -type SecurityRule struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // 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"` - - // Properties of the security rule. - Properties *SecurityRulePropertiesFormat `json:"properties,omitempty"` - - // The type of the resource. - Type *string `json:"type,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` -} - -// SecurityRuleAssociations - All security rules associated with the network interface. -type SecurityRuleAssociations struct { - // Collection of default security rules of the network security group. - DefaultSecurityRules []*SecurityRule `json:"defaultSecurityRules,omitempty"` - - // Collection of effective security rules. - EffectiveSecurityRules []*EffectiveNetworkSecurityRule `json:"effectiveSecurityRules,omitempty"` - - // Network interface and it's custom security rules. - NetworkInterfaceAssociation *InterfaceAssociation `json:"networkInterfaceAssociation,omitempty"` - - // Subnet and it's custom security rules. - SubnetAssociation *SubnetAssociation `json:"subnetAssociation,omitempty"` -} - -// SecurityRuleListResult - Response for ListSecurityRule API service call. Retrieves all security rules that belongs to a -// network security group. -type SecurityRuleListResult struct { - // The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` - - // The security rules in a network security group. - Value []*SecurityRule `json:"value,omitempty"` -} - -// SecurityRulePropertiesFormat - Security rule resource. -type SecurityRulePropertiesFormat struct { - // REQUIRED; The network traffic is allowed or denied. - Access *SecurityRuleAccess `json:"access,omitempty"` - - // REQUIRED; The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. - Direction *SecurityRuleDirection `json:"direction,omitempty"` - - // REQUIRED; Network protocol this rule applies to. - Protocol *SecurityRuleProtocol `json:"protocol,omitempty"` - - // A description for this rule. Restricted to 140 chars. - Description *string `json:"description,omitempty"` - - // The destination address prefix. CIDR or destination IP range. Asterisk '*' can also be used to match all source IPs. Default - // tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also - // be used. - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - - // The destination address prefixes. CIDR or destination IP ranges. - DestinationAddressPrefixes []*string `json:"destinationAddressPrefixes,omitempty"` - - // The application security group specified as destination. - DestinationApplicationSecurityGroups []*ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - - // The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports. - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - - // The destination port ranges. - DestinationPortRanges []*string `json:"destinationPortRanges,omitempty"` - - // The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the - // collection. The lower the priority number, the higher the priority of the rule. - Priority *int32 `json:"priority,omitempty"` - - // The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', - // 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress - // rule, specifies where network traffic originates from. - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - - // The CIDR or source IP ranges. - SourceAddressPrefixes []*string `json:"sourceAddressPrefixes,omitempty"` - - // The application security group specified as source. - SourceApplicationSecurityGroups []*ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - - // The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports. - SourcePortRange *string `json:"sourcePortRange,omitempty"` - - // The source port ranges. - SourcePortRanges []*string `json:"sourcePortRanges,omitempty"` - - // READ-ONLY; The provisioning state of the security rule resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// SecurityRulesClientBeginCreateOrUpdateOptions contains the optional parameters for the SecurityRulesClient.BeginCreateOrUpdate -// method. -type SecurityRulesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SecurityRulesClientBeginDeleteOptions contains the optional parameters for the SecurityRulesClient.BeginDelete method. -type SecurityRulesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SecurityRulesClientGetOptions contains the optional parameters for the SecurityRulesClient.Get method. -type SecurityRulesClientGetOptions struct { - // placeholder for future optional parameters -} - -// SecurityRulesClientListOptions contains the optional parameters for the SecurityRulesClient.List method. -type SecurityRulesClientListOptions struct { - // placeholder for future optional parameters -} - -// SecurityRulesEvaluationResult - Network security rules evaluation result. -type SecurityRulesEvaluationResult struct { - // Value indicating whether destination is matched. - DestinationMatched *bool `json:"destinationMatched,omitempty"` - - // Value indicating whether destination port is matched. - DestinationPortMatched *bool `json:"destinationPortMatched,omitempty"` - - // Name of the network security rule. - Name *string `json:"name,omitempty"` - - // Value indicating whether protocol is matched. - ProtocolMatched *bool `json:"protocolMatched,omitempty"` - - // Value indicating whether source is matched. - SourceMatched *bool `json:"sourceMatched,omitempty"` - - // Value indicating whether source port is matched. - SourcePortMatched *bool `json:"sourcePortMatched,omitempty"` -} - -// ServiceAssociationLink resource. -type ServiceAssociationLink struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // 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"` - - // Resource navigation link properties format. - Properties *ServiceAssociationLinkPropertiesFormat `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ServiceAssociationLinkPropertiesFormat - Properties of ServiceAssociationLink. -type ServiceAssociationLinkPropertiesFormat struct { - // If true, the resource can be deleted. - AllowDelete *bool `json:"allowDelete,omitempty"` - - // Link to the external resource. - Link *string `json:"link,omitempty"` - - // Resource type of the linked resource. - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - - // A list of locations. - Locations []*string `json:"locations,omitempty"` - - // READ-ONLY; The provisioning state of the service association link resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// ServiceAssociationLinksClientListOptions contains the optional parameters for the ServiceAssociationLinksClient.List method. -type ServiceAssociationLinksClientListOptions struct { - // placeholder for future optional parameters -} - -// ServiceAssociationLinksListResult - Response for ServiceAssociationLinks_List operation. -type ServiceAssociationLinksListResult struct { - // The service association links in a subnet. - Value []*ServiceAssociationLink `json:"value,omitempty"` - - // READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` -} - -// ServiceDelegationPropertiesFormat - Properties of a service delegation. -type ServiceDelegationPropertiesFormat struct { - // The name of the service to whom the subnet should be delegated (e.g. Microsoft.Sql/servers). - ServiceName *string `json:"serviceName,omitempty"` - - // READ-ONLY; The actions permitted to the service upon delegation. - Actions []*string `json:"actions,omitempty" azure:"ro"` - - // READ-ONLY; The provisioning state of the service delegation resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// ServiceEndpointPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the ServiceEndpointPoliciesClient.BeginCreateOrUpdate -// method. -type ServiceEndpointPoliciesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ServiceEndpointPoliciesClientBeginDeleteOptions contains the optional parameters for the ServiceEndpointPoliciesClient.BeginDelete -// method. -type ServiceEndpointPoliciesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ServiceEndpointPoliciesClientGetOptions contains the optional parameters for the ServiceEndpointPoliciesClient.Get method. -type ServiceEndpointPoliciesClientGetOptions struct { - // Expands referenced resources. - Expand *string -} - -// ServiceEndpointPoliciesClientListByResourceGroupOptions contains the optional parameters for the ServiceEndpointPoliciesClient.ListByResourceGroup -// method. -type ServiceEndpointPoliciesClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// ServiceEndpointPoliciesClientListOptions contains the optional parameters for the ServiceEndpointPoliciesClient.List method. -type ServiceEndpointPoliciesClientListOptions struct { - // placeholder for future optional parameters -} - -// ServiceEndpointPoliciesClientUpdateTagsOptions contains the optional parameters for the ServiceEndpointPoliciesClient.UpdateTags -// method. -type ServiceEndpointPoliciesClientUpdateTagsOptions struct { - // placeholder for future optional parameters -} - -// ServiceEndpointPolicy - Service End point policy resource. -type ServiceEndpointPolicy struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Resource location. - Location *string `json:"location,omitempty"` - - // Properties of the service end point policy. - Properties *ServiceEndpointPolicyPropertiesFormat `json:"properties,omitempty"` - - // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Kind of service endpoint policy. This is metadata used for the Azure portal experience. - Kind *string `json:"kind,omitempty" azure:"ro"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ServiceEndpointPolicyDefinition - Service Endpoint policy definitions. -type ServiceEndpointPolicyDefinition struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // 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"` - - // Properties of the service endpoint policy definition. - Properties *ServiceEndpointPolicyDefinitionPropertiesFormat `json:"properties,omitempty"` - - // The type of the resource. - Type *string `json:"type,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` -} - -// ServiceEndpointPolicyDefinitionListResult - Response for ListServiceEndpointPolicyDefinition API service call. Retrieves -// all service endpoint policy definition that belongs to a service endpoint policy. -type ServiceEndpointPolicyDefinitionListResult struct { - // The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` - - // The service endpoint policy definition in a service endpoint policy. - Value []*ServiceEndpointPolicyDefinition `json:"value,omitempty"` -} - -// ServiceEndpointPolicyDefinitionPropertiesFormat - Service Endpoint policy definition resource. -type ServiceEndpointPolicyDefinitionPropertiesFormat struct { - // A description for this rule. Restricted to 140 chars. - Description *string `json:"description,omitempty"` - - // Service endpoint name. - Service *string `json:"service,omitempty"` - - // A list of service resources. - ServiceResources []*string `json:"serviceResources,omitempty"` - - // READ-ONLY; The provisioning state of the service endpoint policy definition resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// ServiceEndpointPolicyDefinitionsClientBeginCreateOrUpdateOptions contains the optional parameters for the ServiceEndpointPolicyDefinitionsClient.BeginCreateOrUpdate -// method. -type ServiceEndpointPolicyDefinitionsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ServiceEndpointPolicyDefinitionsClientBeginDeleteOptions contains the optional parameters for the ServiceEndpointPolicyDefinitionsClient.BeginDelete -// method. -type ServiceEndpointPolicyDefinitionsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ServiceEndpointPolicyDefinitionsClientGetOptions contains the optional parameters for the ServiceEndpointPolicyDefinitionsClient.Get -// method. -type ServiceEndpointPolicyDefinitionsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ServiceEndpointPolicyDefinitionsClientListByResourceGroupOptions contains the optional parameters for the ServiceEndpointPolicyDefinitionsClient.ListByResourceGroup -// method. -type ServiceEndpointPolicyDefinitionsClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// ServiceEndpointPolicyListResult - Response for ListServiceEndpointPolicies API service call. -type ServiceEndpointPolicyListResult struct { - // A list of ServiceEndpointPolicy resources. - Value []*ServiceEndpointPolicy `json:"value,omitempty"` - - // READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` -} - -// ServiceEndpointPolicyPropertiesFormat - Service Endpoint Policy resource. -type ServiceEndpointPolicyPropertiesFormat struct { - // A collection of contextual service endpoint policy. - ContextualServiceEndpointPolicies []*string `json:"contextualServiceEndpointPolicies,omitempty"` - - // The alias indicating if the policy belongs to a service - ServiceAlias *string `json:"serviceAlias,omitempty"` - - // A collection of service endpoint policy definitions of the service endpoint policy. - ServiceEndpointPolicyDefinitions []*ServiceEndpointPolicyDefinition `json:"serviceEndpointPolicyDefinitions,omitempty"` - - // READ-ONLY; The provisioning state of the service endpoint policy resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` - - // READ-ONLY; The resource GUID property of the service endpoint policy resource. - ResourceGUID *string `json:"resourceGuid,omitempty" azure:"ro"` - - // READ-ONLY; A collection of references to subnets. - Subnets []*Subnet `json:"subnets,omitempty" azure:"ro"` -} - -// ServiceEndpointPropertiesFormat - The service endpoint properties. -type ServiceEndpointPropertiesFormat struct { - // A list of locations. - Locations []*string `json:"locations,omitempty"` - - // The type of the endpoint service. - Service *string `json:"service,omitempty"` - - // READ-ONLY; The provisioning state of the service endpoint resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// ServiceTagInformation - The service tag information. -type ServiceTagInformation struct { - // READ-ONLY; The ID of service tag. - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; The name of service tag. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Properties of the service tag information. - Properties *ServiceTagInformationPropertiesFormat `json:"properties,omitempty" azure:"ro"` - - // READ-ONLY; The iteration number of service tag object for region. - ServiceTagChangeNumber *string `json:"serviceTagChangeNumber,omitempty" azure:"ro"` -} - -// ServiceTagInformationClientListOptions contains the optional parameters for the ServiceTagInformationClient.List method. -type ServiceTagInformationClientListOptions struct { - // Do not return address prefixes for the tag(s). - NoAddressPrefixes *bool - // Return tag information for a particular tag. - TagName *string -} - -// ServiceTagInformationListResult - Response for Get ServiceTagInformation API service call. Retrieves the list of service -// tag information resources. -type ServiceTagInformationListResult struct { - // The list of service tag information resources. - Value []*ServiceTagInformation `json:"value,omitempty"` - - // READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` -} - -// ServiceTagInformationPropertiesFormat - Properties of the service tag information. -type ServiceTagInformationPropertiesFormat struct { - // READ-ONLY; The list of IP address prefixes. - AddressPrefixes []*string `json:"addressPrefixes,omitempty" azure:"ro"` - - // READ-ONLY; The iteration number of service tag. - ChangeNumber *string `json:"changeNumber,omitempty" azure:"ro"` - - // READ-ONLY; The region of service tag. - Region *string `json:"region,omitempty" azure:"ro"` - - // READ-ONLY; The state of the service tag. - State *string `json:"state,omitempty" azure:"ro"` - - // READ-ONLY; The name of system service. - SystemService *string `json:"systemService,omitempty" azure:"ro"` -} - -// ServiceTagsClientListOptions contains the optional parameters for the ServiceTagsClient.List method. -type ServiceTagsClientListOptions struct { - // placeholder for future optional parameters -} - -// ServiceTagsListResult - Response for the ListServiceTags API service call. -type ServiceTagsListResult struct { - // READ-ONLY; The iteration number. - ChangeNumber *string `json:"changeNumber,omitempty" azure:"ro"` - - // READ-ONLY; The name of the cloud. - Cloud *string `json:"cloud,omitempty" azure:"ro"` - - // READ-ONLY; The ID of the cloud. - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; The name of the cloud. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; The URL to get next page of service tag information resources. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` - - // READ-ONLY; The azure resource type. - Type *string `json:"type,omitempty" azure:"ro"` - - // READ-ONLY; The list of service tag information resources. - Values []*ServiceTagInformation `json:"values,omitempty" azure:"ro"` -} - -// SessionIDs - List of session IDs. -type SessionIDs struct { - // List of session IDs. - SessionIDs []*string `json:"sessionIds,omitempty"` -} - -// SignatureOverridesFilterValuesQuery - Describes the filter values possibles for a given column -type SignatureOverridesFilterValuesQuery struct { - // Describes the name of the column which values will be returned - FilterName *string `json:"filterName,omitempty"` -} - -// SignatureOverridesFilterValuesResponse - Describes the list of all possible values for a specific filter value -type SignatureOverridesFilterValuesResponse struct { - // Describes the possible values - FilterValues []*string `json:"filterValues,omitempty"` -} - -// SignaturesOverrides - Contains all specific policy signatures overrides for the IDPS -type SignaturesOverrides struct { - // Will contain the resource id of the signature override resource - ID *string `json:"id,omitempty"` - - // Contains the name of the resource (default) - Name *string `json:"name,omitempty"` - - // Will contain the properties of the resource (the actual signature overrides) - Properties *SignaturesOverridesProperties `json:"properties,omitempty"` - - // Will contain the type of the resource: Microsoft.Network/firewallPolicies/intrusionDetectionSignaturesOverrides - Type *string `json:"type,omitempty"` -} - -// SignaturesOverridesList - Describes an object containing an array with a single item -type SignaturesOverridesList struct { - // Describes a list consisting exactly one item describing the policy's signature override status - Value []*SignaturesOverrides `json:"value,omitempty"` -} - -// SignaturesOverridesProperties - Will contain the properties of the resource (the actual signature overrides) -type SignaturesOverridesProperties struct { - // Dictionary of - Signatures map[string]*string `json:"signatures,omitempty"` -} - -type SingleQueryResult struct { - // Describes what is the signature enforces - Description *string `json:"description,omitempty"` - - // Describes the list of destination ports related to this signature - DestinationPorts []*string `json:"destinationPorts,omitempty"` - - // Describes in which direction signature is being enforced: 0 - Inbound, 1 - OutBound, 2 - Bidirectional - Direction *FirewallPolicyIDPSSignatureDirection `json:"direction,omitempty"` - - // Describes the groups the signature belongs to - Group *string `json:"group,omitempty"` - - // Describes if this override is inherited from base policy or not - InheritedFromParentPolicy *bool `json:"inheritedFromParentPolicy,omitempty"` - - // Describes the last updated time of the signature (provided from 3rd party vendor) - LastUpdated *string `json:"lastUpdated,omitempty"` - - // The current mode enforced, 0 - Disabled, 1 - Alert, 2 -Deny - Mode *FirewallPolicyIDPSSignatureMode `json:"mode,omitempty"` - - // Describes the protocol the signatures is being enforced in - Protocol *string `json:"protocol,omitempty"` - - // Describes the severity of signature: 1 - Low, 2 - Medium, 3 - High - Severity *FirewallPolicyIDPSSignatureSeverity `json:"severity,omitempty"` - - // The ID of the signature - SignatureID *int32 `json:"signatureId,omitempty"` - - // Describes the list of source ports related to this signature - SourcePorts []*string `json:"sourcePorts,omitempty"` -} - -// StaticMember Item. -type StaticMember struct { - // The Static Member properties - Properties *StaticMemberProperties `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; The system metadata related to this resource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// StaticMemberListResult - Result of the request to list StaticMember. It contains a list of groups and a URL link to get -// the next set of results. -type StaticMemberListResult struct { - // Gets the URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` - - // Gets a page of StaticMember - Value []*StaticMember `json:"value,omitempty"` -} - -// StaticMemberProperties - Properties of static member. -type StaticMemberProperties struct { - // Resource Id. - ResourceID *string `json:"resourceId,omitempty"` - - // READ-ONLY; The provisioning state of the scope assignment resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` - - // READ-ONLY; Resource region. - Region *string `json:"region,omitempty" azure:"ro"` -} - -// StaticMembersClientCreateOrUpdateOptions contains the optional parameters for the StaticMembersClient.CreateOrUpdate method. -type StaticMembersClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// StaticMembersClientDeleteOptions contains the optional parameters for the StaticMembersClient.Delete method. -type StaticMembersClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// StaticMembersClientGetOptions contains the optional parameters for the StaticMembersClient.Get method. -type StaticMembersClientGetOptions struct { - // placeholder for future optional parameters -} - -// StaticMembersClientListOptions contains the optional parameters for the StaticMembersClient.List method. -type StaticMembersClientListOptions struct { - // SkipToken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, - // the value of the nextLink element will include a skipToken parameter that - // specifies a starting point to use for subsequent calls. - SkipToken *string - // An optional query parameter which specifies the maximum number of records to be returned by the server. - Top *int32 -} - -// StaticRoute - List of all Static Routes. -type StaticRoute struct { - // List of all address prefixes. - AddressPrefixes []*string `json:"addressPrefixes,omitempty"` - - // The name of the StaticRoute that is unique within a VnetRoute. - Name *string `json:"name,omitempty"` - - // The ip address of the next hop. - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` -} - -// SubResource - Reference to another subresource. -type SubResource struct { - // Resource ID. - ID *string `json:"id,omitempty"` -} - -// Subnet in a virtual network resource. -type Subnet struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // 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"` - - // Properties of the subnet. - Properties *SubnetPropertiesFormat `json:"properties,omitempty"` - - // Resource type. - Type *string `json:"type,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` -} - -// SubnetAssociation - Subnet and it's custom security rules. -type SubnetAssociation struct { - // Collection of custom security rules. - SecurityRules []*SecurityRule `json:"securityRules,omitempty"` - - // READ-ONLY; Subnet ID. - ID *string `json:"id,omitempty" azure:"ro"` -} - -// SubnetListResult - Response for ListSubnets API service callRetrieves all subnet that belongs to a virtual network. -type SubnetListResult struct { - // The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` - - // The subnets in a virtual network. - Value []*Subnet `json:"value,omitempty"` -} - -// SubnetPropertiesFormat - Properties of the subnet. -type SubnetPropertiesFormat struct { - // The address prefix for the subnet. - AddressPrefix *string `json:"addressPrefix,omitempty"` - - // List of address prefixes for the subnet. - AddressPrefixes []*string `json:"addressPrefixes,omitempty"` - - // Application gateway IP configurations of virtual network resource. - ApplicationGatewayIPConfigurations []*ApplicationGatewayIPConfiguration `json:"applicationGatewayIpConfigurations,omitempty"` - - // An array of references to the delegations on the subnet. - Delegations []*Delegation `json:"delegations,omitempty"` - - // Array of IpAllocation which reference this subnet. - IPAllocations []*SubResource `json:"ipAllocations,omitempty"` - - // Nat gateway associated with this subnet. - NatGateway *SubResource `json:"natGateway,omitempty"` - - // The reference to the NetworkSecurityGroup resource. - NetworkSecurityGroup *SecurityGroup `json:"networkSecurityGroup,omitempty"` - - // Enable or Disable apply network policies on private end point in the subnet. - PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` - - // Enable or Disable apply network policies on private link service in the subnet. - PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` - - // The reference to the RouteTable resource. - RouteTable *RouteTable `json:"routeTable,omitempty"` - - // An array of service endpoint policies. - ServiceEndpointPolicies []*ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - - // An array of service endpoints. - ServiceEndpoints []*ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` - - // READ-ONLY; Array of IP configuration profiles which reference this subnet. - IPConfigurationProfiles []*IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty" azure:"ro"` - - // READ-ONLY; An array of references to the network interface IP configurations using subnet. - IPConfigurations []*IPConfiguration `json:"ipConfigurations,omitempty" azure:"ro"` - - // READ-ONLY; An array of references to private endpoints. - PrivateEndpoints []*PrivateEndpoint `json:"privateEndpoints,omitempty" azure:"ro"` - - // READ-ONLY; The provisioning state of the subnet resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` - - // READ-ONLY; A read-only string identifying the intention of use for this subnet based on delegations and other user-defined - // properties. - Purpose *string `json:"purpose,omitempty" azure:"ro"` - - // READ-ONLY; An array of references to the external resources using subnet. - ResourceNavigationLinks []*ResourceNavigationLink `json:"resourceNavigationLinks,omitempty" azure:"ro"` - - // READ-ONLY; An array of references to services injecting into this subnet. - ServiceAssociationLinks []*ServiceAssociationLink `json:"serviceAssociationLinks,omitempty" azure:"ro"` -} - -// SubnetsClientBeginCreateOrUpdateOptions contains the optional parameters for the SubnetsClient.BeginCreateOrUpdate method. -type SubnetsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SubnetsClientBeginDeleteOptions contains the optional parameters for the SubnetsClient.BeginDelete method. -type SubnetsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SubnetsClientBeginPrepareNetworkPoliciesOptions contains the optional parameters for the SubnetsClient.BeginPrepareNetworkPolicies -// method. -type SubnetsClientBeginPrepareNetworkPoliciesOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SubnetsClientBeginUnprepareNetworkPoliciesOptions contains the optional parameters for the SubnetsClient.BeginUnprepareNetworkPolicies -// method. -type SubnetsClientBeginUnprepareNetworkPoliciesOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SubnetsClientGetOptions contains the optional parameters for the SubnetsClient.Get method. -type SubnetsClientGetOptions struct { - // Expands referenced resources. - Expand *string -} - -// SubnetsClientListOptions contains the optional parameters for the SubnetsClient.List method. -type SubnetsClientListOptions struct { - // placeholder for future optional parameters -} - -// SubscriptionNetworkManagerConnectionsClientCreateOrUpdateOptions contains the optional parameters for the SubscriptionNetworkManagerConnectionsClient.CreateOrUpdate -// method. -type SubscriptionNetworkManagerConnectionsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// SubscriptionNetworkManagerConnectionsClientDeleteOptions contains the optional parameters for the SubscriptionNetworkManagerConnectionsClient.Delete -// method. -type SubscriptionNetworkManagerConnectionsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// SubscriptionNetworkManagerConnectionsClientGetOptions contains the optional parameters for the SubscriptionNetworkManagerConnectionsClient.Get -// method. -type SubscriptionNetworkManagerConnectionsClientGetOptions struct { - // placeholder for future optional parameters -} - -// SubscriptionNetworkManagerConnectionsClientListOptions contains the optional parameters for the SubscriptionNetworkManagerConnectionsClient.List -// method. -type SubscriptionNetworkManagerConnectionsClientListOptions struct { - // SkipToken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, - // the value of the nextLink element will include a skipToken parameter that - // specifies a starting point to use for subsequent calls. - SkipToken *string - // An optional query parameter which specifies the maximum number of records to be returned by the server. - Top *int32 -} - -// SystemData - Metadata pertaining to creation and last modification of the resource. -type SystemData struct { - // The timestamp of resource creation (UTC). - CreatedAt *time.Time `json:"createdAt,omitempty"` - - // The identity that created the resource. - CreatedBy *string `json:"createdBy,omitempty"` - - // The type of identity that created the resource. - CreatedByType *CreatedByType `json:"createdByType,omitempty"` - - // The type of identity that last modified the resource. - LastModifiedAt *time.Time `json:"lastModifiedAt,omitempty"` - - // The identity that last modified the resource. - LastModifiedBy *string `json:"lastModifiedBy,omitempty"` - - // The type of identity that last modified the resource. - LastModifiedByType *CreatedByType `json:"lastModifiedByType,omitempty"` -} - -// TagsObject - Tags object for patch operations. -type TagsObject struct { - // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` -} - -// Topology of the specified resource group. -type Topology struct { - // A list of topology resources. - Resources []*TopologyResource `json:"resources,omitempty"` - - // READ-ONLY; The datetime when the topology was initially created for the resource group. - CreatedDateTime *time.Time `json:"createdDateTime,omitempty" azure:"ro"` - - // READ-ONLY; GUID representing the operation id. - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; The datetime when the topology was last modified. - LastModified *time.Time `json:"lastModified,omitempty" azure:"ro"` -} - -// TopologyAssociation - Resources that have an association with the parent resource. -type TopologyAssociation struct { - // The association type of the child resource to the parent resource. - AssociationType *AssociationType `json:"associationType,omitempty"` - - // The name of the resource that is associated with the parent resource. - Name *string `json:"name,omitempty"` - - // The ID of the resource that is associated with the parent resource. - ResourceID *string `json:"resourceId,omitempty"` -} - -// TopologyParameters - Parameters that define the representation of topology. -type TopologyParameters struct { - // The name of the target resource group to perform topology on. - TargetResourceGroupName *string `json:"targetResourceGroupName,omitempty"` - - // The reference to the Subnet resource. - TargetSubnet *SubResource `json:"targetSubnet,omitempty"` - - // The reference to the Virtual Network resource. - TargetVirtualNetwork *SubResource `json:"targetVirtualNetwork,omitempty"` -} - -// TopologyResource - The network resource topology information for the given resource group. -type TopologyResource struct { - // Holds the associations the resource has with other resources in the resource group. - Associations []*TopologyAssociation `json:"associations,omitempty"` - - // ID of the resource. - ID *string `json:"id,omitempty"` - - // Resource location. - Location *string `json:"location,omitempty"` - - // Name of the resource. - Name *string `json:"name,omitempty"` -} - -// TrafficAnalyticsConfigurationProperties - Parameters that define the configuration of traffic analytics. -type TrafficAnalyticsConfigurationProperties struct { - // Flag to enable/disable traffic analytics. - Enabled *bool `json:"enabled,omitempty"` - - // The interval in minutes which would decide how frequently TA service should do flow analytics. - TrafficAnalyticsInterval *int32 `json:"trafficAnalyticsInterval,omitempty"` - - // The resource guid of the attached workspace. - WorkspaceID *string `json:"workspaceId,omitempty"` - - // The location of the attached workspace. - WorkspaceRegion *string `json:"workspaceRegion,omitempty"` - - // Resource Id of the attached workspace. - WorkspaceResourceID *string `json:"workspaceResourceId,omitempty"` -} - -// TrafficAnalyticsProperties - Parameters that define the configuration of traffic analytics. -type TrafficAnalyticsProperties struct { - // Parameters that define the configuration of traffic analytics. - NetworkWatcherFlowAnalyticsConfiguration *TrafficAnalyticsConfigurationProperties `json:"networkWatcherFlowAnalyticsConfiguration,omitempty"` -} - -// TrafficSelectorPolicy - An traffic selector policy for a virtual network gateway connection. -type TrafficSelectorPolicy struct { - // REQUIRED; A collection of local address spaces in CIDR format. - LocalAddressRanges []*string `json:"localAddressRanges,omitempty"` - - // REQUIRED; A collection of remote address spaces in CIDR format. - RemoteAddressRanges []*string `json:"remoteAddressRanges,omitempty"` -} - -// TroubleshootingDetails - Information gained from troubleshooting of specified resource. -type TroubleshootingDetails struct { - // Details on troubleshooting results. - Detail *string `json:"detail,omitempty"` - - // The id of the get troubleshoot operation. - ID *string `json:"id,omitempty"` - - // Reason type of failure. - ReasonType *string `json:"reasonType,omitempty"` - - // List of recommended actions. - RecommendedActions []*TroubleshootingRecommendedActions `json:"recommendedActions,omitempty"` - - // A summary of troubleshooting. - Summary *string `json:"summary,omitempty"` -} - -// TroubleshootingParameters - Parameters that define the resource to troubleshoot. -type TroubleshootingParameters struct { - // REQUIRED; Properties of the troubleshooting resource. - Properties *TroubleshootingProperties `json:"properties,omitempty"` - - // REQUIRED; The target resource to troubleshoot. - TargetResourceID *string `json:"targetResourceId,omitempty"` -} - -// TroubleshootingProperties - Storage location provided for troubleshoot. -type TroubleshootingProperties struct { - // REQUIRED; The ID for the storage account to save the troubleshoot result. - StorageID *string `json:"storageId,omitempty"` - - // REQUIRED; The path to the blob to save the troubleshoot result in. - StoragePath *string `json:"storagePath,omitempty"` -} - -// TroubleshootingRecommendedActions - Recommended actions based on discovered issues. -type TroubleshootingRecommendedActions struct { - // ID of the recommended action. - ActionID *string `json:"actionId,omitempty"` - - // Description of recommended actions. - ActionText *string `json:"actionText,omitempty"` - - // The uri linking to a documentation for the recommended troubleshooting actions. - ActionURI *string `json:"actionUri,omitempty"` - - // The information from the URI for the recommended troubleshooting actions. - ActionURIText *string `json:"actionUriText,omitempty"` -} - -// TroubleshootingResult - Troubleshooting information gained from specified resource. -type TroubleshootingResult struct { - // The result code of the troubleshooting. - Code *string `json:"code,omitempty"` - - // The end time of the troubleshooting. - EndTime *time.Time `json:"endTime,omitempty"` - - // Information from troubleshooting. - Results []*TroubleshootingDetails `json:"results,omitempty"` - - // The start time of the troubleshooting. - StartTime *time.Time `json:"startTime,omitempty"` -} - -// TunnelConnectionHealth - VirtualNetworkGatewayConnection properties. -type TunnelConnectionHealth struct { - // READ-ONLY; Virtual Network Gateway connection status. - ConnectionStatus *VirtualNetworkGatewayConnectionStatus `json:"connectionStatus,omitempty" azure:"ro"` - - // READ-ONLY; The Egress Bytes Transferred in this connection. - EgressBytesTransferred *int64 `json:"egressBytesTransferred,omitempty" azure:"ro"` - - // READ-ONLY; The Ingress Bytes Transferred in this connection. - IngressBytesTransferred *int64 `json:"ingressBytesTransferred,omitempty" azure:"ro"` - - // READ-ONLY; The time at which connection was established in Utc format. - LastConnectionEstablishedUTCTime *string `json:"lastConnectionEstablishedUtcTime,omitempty" azure:"ro"` - - // READ-ONLY; Tunnel name. - Tunnel *string `json:"tunnel,omitempty" azure:"ro"` -} - -// UnprepareNetworkPoliciesRequest - Details of UnprepareNetworkPolicies for Subnet. -type UnprepareNetworkPoliciesRequest struct { - // The name of the service for which subnet is being unprepared for. - ServiceName *string `json:"serviceName,omitempty"` -} - -// Usage - The network resource usage. -type Usage struct { - // REQUIRED; The current value of the usage. - CurrentValue *int64 `json:"currentValue,omitempty"` - - // REQUIRED; The limit of usage. - Limit *int64 `json:"limit,omitempty"` - - // REQUIRED; The name of the type of usage. - Name *UsageName `json:"name,omitempty"` - - // REQUIRED; An enum describing the unit of measurement. - Unit *UsageUnit `json:"unit,omitempty"` - - // READ-ONLY; Resource identifier. - ID *string `json:"id,omitempty" azure:"ro"` -} - -// UsageName - The usage names. -type UsageName struct { - // A localized string describing the resource name. - LocalizedValue *string `json:"localizedValue,omitempty"` - - // A string describing the resource name. - Value *string `json:"value,omitempty"` -} - -// UsagesClientListOptions contains the optional parameters for the UsagesClient.List method. -type UsagesClientListOptions struct { - // placeholder for future optional parameters -} - -// UsagesListResult - The list usages operation response. -type UsagesListResult struct { - // URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` - - // The list network resource usages. - Value []*Usage `json:"value,omitempty"` -} - -// VM - Describes a Virtual Machine. -type VM struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Resource location. - Location *string `json:"location,omitempty"` - - // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// VPNClientConfiguration - VpnClientConfiguration for P2S client. -type VPNClientConfiguration struct { - // The AADAudience property of the VirtualNetworkGateway resource for vpn client connection used for AAD authentication. - AADAudience *string `json:"aadAudience,omitempty"` - - // The AADIssuer property of the VirtualNetworkGateway resource for vpn client connection used for AAD authentication. - AADIssuer *string `json:"aadIssuer,omitempty"` - - // The AADTenant property of the VirtualNetworkGateway resource for vpn client connection used for AAD authentication. - AADTenant *string `json:"aadTenant,omitempty"` - - // The radius server address property of the VirtualNetworkGateway resource for vpn client connection. - RadiusServerAddress *string `json:"radiusServerAddress,omitempty"` - - // The radius secret property of the VirtualNetworkGateway resource for vpn client connection. - RadiusServerSecret *string `json:"radiusServerSecret,omitempty"` - - // The radiusServers property for multiple radius server configuration. - RadiusServers []*RadiusServer `json:"radiusServers,omitempty"` - - // VPN authentication types for the virtual network gateway.. - VPNAuthenticationTypes []*VPNAuthenticationType `json:"vpnAuthenticationTypes,omitempty"` - - // The reference to the address space resource which represents Address space for P2S VpnClient. - VPNClientAddressPool *AddressSpace `json:"vpnClientAddressPool,omitempty"` - - // VpnClientIpsecPolicies for virtual network gateway P2S client. - VPNClientIPSecPolicies []*IPSecPolicy `json:"vpnClientIpsecPolicies,omitempty"` - - // VpnClientProtocols for Virtual network gateway. - VPNClientProtocols []*VPNClientProtocol `json:"vpnClientProtocols,omitempty"` - - // VpnClientRevokedCertificate for Virtual network gateway. - VPNClientRevokedCertificates []*VPNClientRevokedCertificate `json:"vpnClientRevokedCertificates,omitempty"` - - // VpnClientRootCertificate for virtual network gateway. - VPNClientRootCertificates []*VPNClientRootCertificate `json:"vpnClientRootCertificates,omitempty"` -} - -// VPNClientConnectionHealth - VpnClientConnectionHealth properties. -type VPNClientConnectionHealth struct { - // List of allocated ip addresses to the connected p2s vpn clients. - AllocatedIPAddresses []*string `json:"allocatedIpAddresses,omitempty"` - - // The total of p2s vpn clients connected at this time to this P2SVpnGateway. - VPNClientConnectionsCount *int32 `json:"vpnClientConnectionsCount,omitempty"` - - // READ-ONLY; Total of the Egress Bytes Transferred in this connection. - TotalEgressBytesTransferred *int64 `json:"totalEgressBytesTransferred,omitempty" azure:"ro"` - - // READ-ONLY; Total of the Ingress Bytes Transferred in this P2S Vpn connection. - TotalIngressBytesTransferred *int64 `json:"totalIngressBytesTransferred,omitempty" azure:"ro"` -} - -// VPNClientConnectionHealthDetail - VPN client connection health detail. -type VPNClientConnectionHealthDetail struct { - // READ-ONLY; The egress bytes per second. - EgressBytesTransferred *int64 `json:"egressBytesTransferred,omitempty" azure:"ro"` - - // READ-ONLY; The egress packets per second. - EgressPacketsTransferred *int64 `json:"egressPacketsTransferred,omitempty" azure:"ro"` - - // READ-ONLY; The ingress bytes per second. - IngressBytesTransferred *int64 `json:"ingressBytesTransferred,omitempty" azure:"ro"` - - // READ-ONLY; The ingress packets per second. - IngressPacketsTransferred *int64 `json:"ingressPacketsTransferred,omitempty" azure:"ro"` - - // READ-ONLY; The max band width. - MaxBandwidth *int64 `json:"maxBandwidth,omitempty" azure:"ro"` - - // READ-ONLY; The max packets transferred per second. - MaxPacketsPerSecond *int64 `json:"maxPacketsPerSecond,omitempty" azure:"ro"` - - // READ-ONLY; The assigned private Ip of a connected vpn client. - PrivateIPAddress *string `json:"privateIpAddress,omitempty" azure:"ro"` - - // READ-ONLY; The public Ip of a connected vpn client. - PublicIPAddress *string `json:"publicIpAddress,omitempty" azure:"ro"` - - // READ-ONLY; The duration time of a connected vpn client. - VPNConnectionDuration *int64 `json:"vpnConnectionDuration,omitempty" azure:"ro"` - - // READ-ONLY; The vpn client Id. - VPNConnectionID *string `json:"vpnConnectionId,omitempty" azure:"ro"` - - // READ-ONLY; The start time of a connected vpn client. - VPNConnectionTime *string `json:"vpnConnectionTime,omitempty" azure:"ro"` - - // READ-ONLY; The user name of a connected vpn client. - VPNUserName *string `json:"vpnUserName,omitempty" azure:"ro"` -} - -// VPNClientConnectionHealthDetailListResult - List of virtual network gateway vpn client connection health. -type VPNClientConnectionHealthDetailListResult struct { - // List of vpn client connection health. - Value []*VPNClientConnectionHealthDetail `json:"value,omitempty"` -} - -// VPNClientIPsecParameters - An IPSec parameters for a virtual network gateway P2S connection. -type VPNClientIPsecParameters struct { - // REQUIRED; The DH Group used in IKE Phase 1 for initial SA. - DhGroup *DhGroup `json:"dhGroup,omitempty"` - - // REQUIRED; The IPSec encryption algorithm (IKE phase 1). - IPSecEncryption *IPSecEncryption `json:"ipsecEncryption,omitempty"` - - // REQUIRED; The IPSec integrity algorithm (IKE phase 1). - IPSecIntegrity *IPSecIntegrity `json:"ipsecIntegrity,omitempty"` - - // REQUIRED; The IKE encryption algorithm (IKE phase 2). - IkeEncryption *IkeEncryption `json:"ikeEncryption,omitempty"` - - // REQUIRED; The IKE integrity algorithm (IKE phase 2). - IkeIntegrity *IkeIntegrity `json:"ikeIntegrity,omitempty"` - - // REQUIRED; The Pfs Group used in IKE Phase 2 for new child SA. - PfsGroup *PfsGroup `json:"pfsGroup,omitempty"` - - // REQUIRED; The IPSec Security Association (also called Quick Mode or Phase 2 SA) payload size in KB for P2S client.. - SaDataSizeKilobytes *int32 `json:"saDataSizeKilobytes,omitempty"` - - // REQUIRED; The IPSec Security Association (also called Quick Mode or Phase 2 SA) lifetime in seconds for P2S client. - SaLifeTimeSeconds *int32 `json:"saLifeTimeSeconds,omitempty"` -} - -// VPNClientParameters - Vpn Client Parameters for package generation. -type VPNClientParameters struct { - // VPN client authentication method. - AuthenticationMethod *AuthenticationMethod `json:"authenticationMethod,omitempty"` - - // A list of client root certificates public certificate data encoded as Base-64 strings. Optional parameter for external - // radius based authentication with EAPTLS. - ClientRootCertificates []*string `json:"clientRootCertificates,omitempty"` - - // VPN client Processor Architecture. - ProcessorArchitecture *ProcessorArchitecture `json:"processorArchitecture,omitempty"` - - // The public certificate data for the radius server authentication certificate as a Base-64 encoded string. Required only - // if external radius authentication has been configured with EAPTLS - // authentication. - RadiusServerAuthCertificate *string `json:"radiusServerAuthCertificate,omitempty"` -} - -// VPNClientRevokedCertificate - VPN client revoked certificate of virtual network gateway. -type VPNClientRevokedCertificate struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // 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"` - - // Properties of the vpn client revoked certificate. - Properties *VPNClientRevokedCertificatePropertiesFormat `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` -} - -// VPNClientRevokedCertificatePropertiesFormat - Properties of the revoked VPN client certificate of virtual network gateway. -type VPNClientRevokedCertificatePropertiesFormat struct { - // The revoked VPN client certificate thumbprint. - Thumbprint *string `json:"thumbprint,omitempty"` - - // READ-ONLY; The provisioning state of the VPN client revoked certificate resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// VPNClientRootCertificate - VPN client root certificate of virtual network gateway. -type VPNClientRootCertificate struct { - // REQUIRED; Properties of the vpn client root certificate. - Properties *VPNClientRootCertificatePropertiesFormat `json:"properties,omitempty"` - - // Resource ID. - ID *string `json:"id,omitempty"` - - // 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"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` -} - -// VPNClientRootCertificatePropertiesFormat - Properties of SSL certificates of application gateway. -type VPNClientRootCertificatePropertiesFormat struct { - // REQUIRED; The certificate public data. - PublicCertData *string `json:"publicCertData,omitempty"` - - // READ-ONLY; The provisioning state of the VPN client root certificate resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// VPNConnection - VpnConnection Resource. -type VPNConnection struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // 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"` - - // Properties of the VPN connection. - Properties *VPNConnectionProperties `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` -} - -// VPNConnectionPacketCaptureStartParameters - Vpn Connection packet capture parameters supplied to start packet capture on -// gateway connection. -type VPNConnectionPacketCaptureStartParameters struct { - // Start Packet capture parameters on vpn connection. - FilterData *string `json:"filterData,omitempty"` - - // List of site link connection names. - LinkConnectionNames []*string `json:"linkConnectionNames,omitempty"` -} - -// VPNConnectionPacketCaptureStopParameters - Vpn Connection packet capture parameters supplied to stop packet capture on -// gateway connection. -type VPNConnectionPacketCaptureStopParameters struct { - // List of site link connection names. - LinkConnectionNames []*string `json:"linkConnectionNames,omitempty"` - - // SAS url for packet capture on vpn connection. - SasURL *string `json:"sasUrl,omitempty"` -} - -// VPNConnectionProperties - Parameters for VpnConnection. -type VPNConnectionProperties struct { - // Expected bandwidth in MBPS. - ConnectionBandwidth *int32 `json:"connectionBandwidth,omitempty"` - - // DPD timeout in seconds for vpn connection. - DpdTimeoutSeconds *int32 `json:"dpdTimeoutSeconds,omitempty"` - - // EnableBgp flag. - EnableBgp *bool `json:"enableBgp,omitempty"` - - // Enable internet security. - EnableInternetSecurity *bool `json:"enableInternetSecurity,omitempty"` - - // EnableBgp flag. - EnableRateLimiting *bool `json:"enableRateLimiting,omitempty"` - - // The IPSec Policies to be considered by this connection. - IPSecPolicies []*IPSecPolicy `json:"ipsecPolicies,omitempty"` - - // Id of the connected vpn site. - RemoteVPNSite *SubResource `json:"remoteVpnSite,omitempty"` - - // The Routing Configuration indicating the associated and propagated route tables on this connection. - RoutingConfiguration *RoutingConfiguration `json:"routingConfiguration,omitempty"` - - // Routing weight for vpn connection. - RoutingWeight *int32 `json:"routingWeight,omitempty"` - - // SharedKey for the vpn connection. - SharedKey *string `json:"sharedKey,omitempty"` - - // The Traffic Selector Policies to be considered by this connection. - TrafficSelectorPolicies []*TrafficSelectorPolicy `json:"trafficSelectorPolicies,omitempty"` - - // Use local azure ip to initiate connection. - UseLocalAzureIPAddress *bool `json:"useLocalAzureIpAddress,omitempty"` - - // Enable policy-based traffic selectors. - UsePolicyBasedTrafficSelectors *bool `json:"usePolicyBasedTrafficSelectors,omitempty"` - - // Connection protocol used for this connection. - VPNConnectionProtocolType *VirtualNetworkGatewayConnectionProtocol `json:"vpnConnectionProtocolType,omitempty"` - - // List of all vpn site link connections to the gateway. - VPNLinkConnections []*VPNSiteLinkConnection `json:"vpnLinkConnections,omitempty"` - - // READ-ONLY; The connection status. - ConnectionStatus *VPNConnectionStatus `json:"connectionStatus,omitempty" azure:"ro"` - - // READ-ONLY; Egress bytes transferred. - EgressBytesTransferred *int64 `json:"egressBytesTransferred,omitempty" azure:"ro"` - - // READ-ONLY; Ingress bytes transferred. - IngressBytesTransferred *int64 `json:"ingressBytesTransferred,omitempty" azure:"ro"` - - // READ-ONLY; The provisioning state of the VPN connection resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// VPNConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the VPNConnectionsClient.BeginCreateOrUpdate -// method. -type VPNConnectionsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VPNConnectionsClientBeginDeleteOptions contains the optional parameters for the VPNConnectionsClient.BeginDelete method. -type VPNConnectionsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VPNConnectionsClientBeginStartPacketCaptureOptions contains the optional parameters for the VPNConnectionsClient.BeginStartPacketCapture -// method. -type VPNConnectionsClientBeginStartPacketCaptureOptions struct { - // Vpn Connection packet capture parameters supplied to start packet capture on gateway connection. - Parameters *VPNConnectionPacketCaptureStartParameters - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VPNConnectionsClientBeginStopPacketCaptureOptions contains the optional parameters for the VPNConnectionsClient.BeginStopPacketCapture -// method. -type VPNConnectionsClientBeginStopPacketCaptureOptions struct { - // Vpn Connection packet capture parameters supplied to stop packet capture on gateway connection. - Parameters *VPNConnectionPacketCaptureStopParameters - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VPNConnectionsClientGetOptions contains the optional parameters for the VPNConnectionsClient.Get method. -type VPNConnectionsClientGetOptions struct { - // placeholder for future optional parameters -} - -// VPNConnectionsClientListByVPNGatewayOptions contains the optional parameters for the VPNConnectionsClient.ListByVPNGateway -// method. -type VPNConnectionsClientListByVPNGatewayOptions struct { - // placeholder for future optional parameters -} - -// VPNDeviceScriptParameters - Vpn device configuration script generation parameters. -type VPNDeviceScriptParameters struct { - // The device family for the vpn device. - DeviceFamily *string `json:"deviceFamily,omitempty"` - - // The firmware version for the vpn device. - FirmwareVersion *string `json:"firmwareVersion,omitempty"` - - // The vendor for the vpn device. - Vendor *string `json:"vendor,omitempty"` -} - -// VPNGateway - VpnGateway Resource. -type VPNGateway struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Resource location. - Location *string `json:"location,omitempty"` - - // Properties of the VPN gateway. - Properties *VPNGatewayProperties `json:"properties,omitempty"` - - // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// VPNGatewayIPConfiguration - IP Configuration of a VPN Gateway Resource. -type VPNGatewayIPConfiguration struct { - // The identifier of the IP configuration for a VPN Gateway. - ID *string `json:"id,omitempty"` - - // The private IP address of this IP configuration. - PrivateIPAddress *string `json:"privateIpAddress,omitempty"` - - // The public IP address of this IP configuration. - PublicIPAddress *string `json:"publicIpAddress,omitempty"` -} - -// VPNGatewayNatRule - VpnGatewayNatRule Resource. -type VPNGatewayNatRule struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // 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"` - - // Properties of the VpnGateway NAT rule. - Properties *VPNGatewayNatRuleProperties `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// VPNGatewayNatRuleProperties - Parameters for VpnGatewayNatRule. -type VPNGatewayNatRuleProperties struct { - // The private IP address external mapping for NAT. - ExternalMappings []*VPNNatRuleMapping `json:"externalMappings,omitempty"` - - // The IP Configuration ID this NAT rule applies to. - IPConfigurationID *string `json:"ipConfigurationId,omitempty"` - - // The private IP address internal mapping for NAT. - InternalMappings []*VPNNatRuleMapping `json:"internalMappings,omitempty"` - - // The Source NAT direction of a VPN NAT. - Mode *VPNNatRuleMode `json:"mode,omitempty"` - - // The type of NAT rule for VPN NAT. - Type *VPNNatRuleType `json:"type,omitempty"` - - // READ-ONLY; List of egress VpnSiteLinkConnections. - EgressVPNSiteLinkConnections []*SubResource `json:"egressVpnSiteLinkConnections,omitempty" azure:"ro"` - - // READ-ONLY; List of ingress VpnSiteLinkConnections. - IngressVPNSiteLinkConnections []*SubResource `json:"ingressVpnSiteLinkConnections,omitempty" azure:"ro"` - - // READ-ONLY; The provisioning state of the NAT Rule resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// VPNGatewayPacketCaptureStartParameters - Start packet capture parameters. -type VPNGatewayPacketCaptureStartParameters struct { - // Start Packet capture parameters on vpn gateway. - FilterData *string `json:"filterData,omitempty"` -} - -// VPNGatewayPacketCaptureStopParameters - Stop packet capture parameters. -type VPNGatewayPacketCaptureStopParameters struct { - // SAS url for packet capture on vpn gateway. - SasURL *string `json:"sasUrl,omitempty"` -} - -// VPNGatewayProperties - Parameters for VpnGateway. -type VPNGatewayProperties struct { - // Local network gateway's BGP speaker settings. - BgpSettings *BgpSettings `json:"bgpSettings,omitempty"` - - // List of all vpn connections to the gateway. - Connections []*VPNConnection `json:"connections,omitempty"` - - // Enable BGP routes translation for NAT on this VpnGateway. - EnableBgpRouteTranslationForNat *bool `json:"enableBgpRouteTranslationForNat,omitempty"` - - // Enable Routing Preference property for the Public IP Interface of the VpnGateway. - IsRoutingPreferenceInternet *bool `json:"isRoutingPreferenceInternet,omitempty"` - - // List of all the nat Rules associated with the gateway. - NatRules []*VPNGatewayNatRule `json:"natRules,omitempty"` - - // The scale unit for this vpn gateway. - VPNGatewayScaleUnit *int32 `json:"vpnGatewayScaleUnit,omitempty"` - - // The VirtualHub to which the gateway belongs. - VirtualHub *SubResource `json:"virtualHub,omitempty"` - - // READ-ONLY; List of all IPs configured on the gateway. - IPConfigurations []*VPNGatewayIPConfiguration `json:"ipConfigurations,omitempty" azure:"ro"` - - // READ-ONLY; The provisioning state of the VPN gateway resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// VPNGatewaysClientBeginCreateOrUpdateOptions contains the optional parameters for the VPNGatewaysClient.BeginCreateOrUpdate -// method. -type VPNGatewaysClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VPNGatewaysClientBeginDeleteOptions contains the optional parameters for the VPNGatewaysClient.BeginDelete method. -type VPNGatewaysClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VPNGatewaysClientBeginResetOptions contains the optional parameters for the VPNGatewaysClient.BeginReset method. -type VPNGatewaysClientBeginResetOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VPNGatewaysClientBeginStartPacketCaptureOptions contains the optional parameters for the VPNGatewaysClient.BeginStartPacketCapture -// method. -type VPNGatewaysClientBeginStartPacketCaptureOptions struct { - // Vpn gateway packet capture parameters supplied to start packet capture on vpn gateway. - Parameters *VPNGatewayPacketCaptureStartParameters - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VPNGatewaysClientBeginStopPacketCaptureOptions contains the optional parameters for the VPNGatewaysClient.BeginStopPacketCapture -// method. -type VPNGatewaysClientBeginStopPacketCaptureOptions struct { - // Vpn gateway packet capture parameters supplied to stop packet capture on vpn gateway. - Parameters *VPNGatewayPacketCaptureStopParameters - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VPNGatewaysClientBeginUpdateTagsOptions contains the optional parameters for the VPNGatewaysClient.BeginUpdateTags method. -type VPNGatewaysClientBeginUpdateTagsOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VPNGatewaysClientGetOptions contains the optional parameters for the VPNGatewaysClient.Get method. -type VPNGatewaysClientGetOptions struct { - // placeholder for future optional parameters -} - -// VPNGatewaysClientListByResourceGroupOptions contains the optional parameters for the VPNGatewaysClient.ListByResourceGroup -// method. -type VPNGatewaysClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// VPNGatewaysClientListOptions contains the optional parameters for the VPNGatewaysClient.List method. -type VPNGatewaysClientListOptions struct { - // placeholder for future optional parameters -} - -// VPNLinkBgpSettings - BGP settings details for a link. -type VPNLinkBgpSettings struct { - // The BGP speaker's ASN. - Asn *int64 `json:"asn,omitempty"` - - // The BGP peering address and BGP identifier of this BGP speaker. - BgpPeeringAddress *string `json:"bgpPeeringAddress,omitempty"` -} - -// VPNLinkConnectionsClientBeginGetIkeSasOptions contains the optional parameters for the VPNLinkConnectionsClient.BeginGetIkeSas -// method. -type VPNLinkConnectionsClientBeginGetIkeSasOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VPNLinkConnectionsClientBeginResetConnectionOptions contains the optional parameters for the VPNLinkConnectionsClient.BeginResetConnection -// method. -type VPNLinkConnectionsClientBeginResetConnectionOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VPNLinkConnectionsClientListByVPNConnectionOptions contains the optional parameters for the VPNLinkConnectionsClient.ListByVPNConnection -// method. -type VPNLinkConnectionsClientListByVPNConnectionOptions struct { - // placeholder for future optional parameters -} - -// VPNLinkProviderProperties - List of properties of a link provider. -type VPNLinkProviderProperties struct { - // Name of the link provider. - LinkProviderName *string `json:"linkProviderName,omitempty"` - - // Link speed. - LinkSpeedInMbps *int32 `json:"linkSpeedInMbps,omitempty"` -} - -// VPNNatRuleMapping - Vpn NatRule mapping. -type VPNNatRuleMapping struct { - // Address space for Vpn NatRule mapping. - AddressSpace *string `json:"addressSpace,omitempty"` - - // Port range for Vpn NatRule mapping. - PortRange *string `json:"portRange,omitempty"` -} - -// VPNPacketCaptureStartParameters - Start packet capture parameters on virtual network gateway. -type VPNPacketCaptureStartParameters struct { - // Start Packet capture parameters. - FilterData *string `json:"filterData,omitempty"` -} - -// VPNPacketCaptureStopParameters - Stop packet capture parameters. -type VPNPacketCaptureStopParameters struct { - // SAS url for packet capture on virtual network gateway. - SasURL *string `json:"sasUrl,omitempty"` -} - -// VPNProfileResponse - Vpn Profile Response for package generation. -type VPNProfileResponse struct { - // URL to the VPN profile. - ProfileURL *string `json:"profileUrl,omitempty"` -} - -// VPNServerConfigRadiusClientRootCertificate - Properties of the Radius client root certificate of VpnServerConfiguration. -type VPNServerConfigRadiusClientRootCertificate struct { - // The certificate name. - Name *string `json:"name,omitempty"` - - // The Radius client root certificate thumbprint. - Thumbprint *string `json:"thumbprint,omitempty"` -} - -// VPNServerConfigRadiusServerRootCertificate - Properties of Radius Server root certificate of VpnServerConfiguration. -type VPNServerConfigRadiusServerRootCertificate struct { - // The certificate name. - Name *string `json:"name,omitempty"` - - // The certificate public data. - PublicCertData *string `json:"publicCertData,omitempty"` -} - -// VPNServerConfigVPNClientRevokedCertificate - Properties of the revoked VPN client certificate of VpnServerConfiguration. -type VPNServerConfigVPNClientRevokedCertificate struct { - // The certificate name. - Name *string `json:"name,omitempty"` - - // The revoked VPN client certificate thumbprint. - Thumbprint *string `json:"thumbprint,omitempty"` -} - -// VPNServerConfigVPNClientRootCertificate - Properties of VPN client root certificate of VpnServerConfiguration. -type VPNServerConfigVPNClientRootCertificate struct { - // The certificate name. - Name *string `json:"name,omitempty"` - - // The certificate public data. - PublicCertData *string `json:"publicCertData,omitempty"` -} - -// VPNServerConfiguration - VpnServerConfiguration Resource. -type VPNServerConfiguration struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Resource location. - Location *string `json:"location,omitempty"` - - // Properties of the P2SVpnServer configuration. - Properties *VPNServerConfigurationProperties `json:"properties,omitempty"` - - // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// VPNServerConfigurationPolicyGroup - VpnServerConfigurationPolicyGroup Resource. -type VPNServerConfigurationPolicyGroup struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // 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"` - - // Properties of the VpnServerConfigurationPolicyGroup. - Properties *VPNServerConfigurationPolicyGroupProperties `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// VPNServerConfigurationPolicyGroupMember - VpnServerConfiguration PolicyGroup member -type VPNServerConfigurationPolicyGroupMember struct { - // The Vpn Policy member attribute type. - AttributeType *VPNPolicyMemberAttributeType `json:"attributeType,omitempty"` - - // The value of Attribute used for this VpnServerConfigurationPolicyGroupMember. - AttributeValue *string `json:"attributeValue,omitempty"` - - // Name of the VpnServerConfigurationPolicyGroupMember. - Name *string `json:"name,omitempty"` -} - -// VPNServerConfigurationPolicyGroupProperties - Parameters for VpnServerConfigurationPolicyGroup. -type VPNServerConfigurationPolicyGroupProperties struct { - // Shows if this is a Default VpnServerConfigurationPolicyGroup or not. - IsDefault *bool `json:"isDefault,omitempty"` - - // Multiple PolicyMembers for VpnServerConfigurationPolicyGroup. - PolicyMembers []*VPNServerConfigurationPolicyGroupMember `json:"policyMembers,omitempty"` - - // Priority for VpnServerConfigurationPolicyGroup. - Priority *int32 `json:"priority,omitempty"` - - // READ-ONLY; List of references to P2SConnectionConfigurations. - P2SConnectionConfigurations []*SubResource `json:"p2SConnectionConfigurations,omitempty" azure:"ro"` - - // READ-ONLY; The provisioning state of the VpnServerConfigurationPolicyGroup resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// VPNServerConfigurationProperties - Parameters for VpnServerConfiguration. -type VPNServerConfigurationProperties struct { - // The set of aad vpn authentication parameters. - AADAuthenticationParameters *AADAuthenticationParameters `json:"aadAuthenticationParameters,omitempty"` - - // List of all VpnServerConfigurationPolicyGroups. - ConfigurationPolicyGroups []*VPNServerConfigurationPolicyGroup `json:"configurationPolicyGroups,omitempty"` - - // The name of the VpnServerConfiguration that is unique within a resource group. - Name *string `json:"name,omitempty"` - - // Radius client root certificate of VpnServerConfiguration. - RadiusClientRootCertificates []*VPNServerConfigRadiusClientRootCertificate `json:"radiusClientRootCertificates,omitempty"` - - // The radius server address property of the VpnServerConfiguration resource for point to site client connection. - RadiusServerAddress *string `json:"radiusServerAddress,omitempty"` - - // Radius Server root certificate of VpnServerConfiguration. - RadiusServerRootCertificates []*VPNServerConfigRadiusServerRootCertificate `json:"radiusServerRootCertificates,omitempty"` - - // The radius secret property of the VpnServerConfiguration resource for point to site client connection. - RadiusServerSecret *string `json:"radiusServerSecret,omitempty"` - - // Multiple Radius Server configuration for VpnServerConfiguration. - RadiusServers []*RadiusServer `json:"radiusServers,omitempty"` - - // VPN authentication types for the VpnServerConfiguration. - VPNAuthenticationTypes []*VPNAuthenticationType `json:"vpnAuthenticationTypes,omitempty"` - - // VpnClientIpsecPolicies for VpnServerConfiguration. - VPNClientIPSecPolicies []*IPSecPolicy `json:"vpnClientIpsecPolicies,omitempty"` - - // VPN client revoked certificate of VpnServerConfiguration. - VPNClientRevokedCertificates []*VPNServerConfigVPNClientRevokedCertificate `json:"vpnClientRevokedCertificates,omitempty"` - - // VPN client root certificate of VpnServerConfiguration. - VPNClientRootCertificates []*VPNServerConfigVPNClientRootCertificate `json:"vpnClientRootCertificates,omitempty"` - - // VPN protocols for the VpnServerConfiguration. - VPNProtocols []*VPNGatewayTunnelingProtocol `json:"vpnProtocols,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; List of references to P2SVpnGateways. - P2SVPNGateways []*P2SVPNGateway `json:"p2SVpnGateways,omitempty" azure:"ro"` - - // READ-ONLY; The provisioning state of the VpnServerConfiguration resource. Possible values are: 'Updating', 'Deleting', - // and 'Failed'. - ProvisioningState *string `json:"provisioningState,omitempty" azure:"ro"` -} - -// VPNServerConfigurationsAssociatedWithVirtualWanClientBeginListOptions contains the optional parameters for the VPNServerConfigurationsAssociatedWithVirtualWanClient.BeginList -// method. -type VPNServerConfigurationsAssociatedWithVirtualWanClientBeginListOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VPNServerConfigurationsClientBeginCreateOrUpdateOptions contains the optional parameters for the VPNServerConfigurationsClient.BeginCreateOrUpdate -// method. -type VPNServerConfigurationsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VPNServerConfigurationsClientBeginDeleteOptions contains the optional parameters for the VPNServerConfigurationsClient.BeginDelete -// method. -type VPNServerConfigurationsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VPNServerConfigurationsClientGetOptions contains the optional parameters for the VPNServerConfigurationsClient.Get method. -type VPNServerConfigurationsClientGetOptions struct { - // placeholder for future optional parameters -} - -// VPNServerConfigurationsClientListByResourceGroupOptions contains the optional parameters for the VPNServerConfigurationsClient.ListByResourceGroup -// method. -type VPNServerConfigurationsClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// VPNServerConfigurationsClientListOptions contains the optional parameters for the VPNServerConfigurationsClient.List method. -type VPNServerConfigurationsClientListOptions struct { - // placeholder for future optional parameters -} - -// VPNServerConfigurationsClientUpdateTagsOptions contains the optional parameters for the VPNServerConfigurationsClient.UpdateTags -// method. -type VPNServerConfigurationsClientUpdateTagsOptions struct { - // placeholder for future optional parameters -} - -// VPNServerConfigurationsResponse - VpnServerConfigurations list associated with VirtualWan Response. -type VPNServerConfigurationsResponse struct { - // List of VpnServerConfigurations associated with VirtualWan. - VPNServerConfigurationResourceIDs []*string `json:"vpnServerConfigurationResourceIds,omitempty"` -} - -// VPNSite - VpnSite Resource. -type VPNSite struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Resource location. - Location *string `json:"location,omitempty"` - - // Properties of the VPN site. - Properties *VPNSiteProperties `json:"properties,omitempty"` - - // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// VPNSiteID - VpnSite Resource. -type VPNSiteID struct { - // READ-ONLY; The resource-uri of the vpn-site for which config is to be fetched. - VPNSite *string `json:"vpnSite,omitempty" azure:"ro"` -} - -// VPNSiteLink - VpnSiteLink Resource. -type VPNSiteLink struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // 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"` - - // Properties of the VPN site link. - Properties *VPNSiteLinkProperties `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// VPNSiteLinkConnection - VpnSiteLinkConnection Resource. -type VPNSiteLinkConnection struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // 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"` - - // Properties of the VPN site link connection. - Properties *VPNSiteLinkConnectionProperties `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// VPNSiteLinkConnectionProperties - Parameters for VpnConnection. -type VPNSiteLinkConnectionProperties struct { - // Expected bandwidth in MBPS. - ConnectionBandwidth *int32 `json:"connectionBandwidth,omitempty"` - - // List of egress NatRules. - EgressNatRules []*SubResource `json:"egressNatRules,omitempty"` - - // EnableBgp flag. - EnableBgp *bool `json:"enableBgp,omitempty"` - - // EnableBgp flag. - EnableRateLimiting *bool `json:"enableRateLimiting,omitempty"` - - // The IPSec Policies to be considered by this connection. - IPSecPolicies []*IPSecPolicy `json:"ipsecPolicies,omitempty"` - - // List of ingress NatRules. - IngressNatRules []*SubResource `json:"ingressNatRules,omitempty"` - - // Routing weight for vpn connection. - RoutingWeight *int32 `json:"routingWeight,omitempty"` - - // SharedKey for the vpn connection. - SharedKey *string `json:"sharedKey,omitempty"` - - // Use local azure ip to initiate connection. - UseLocalAzureIPAddress *bool `json:"useLocalAzureIpAddress,omitempty"` - - // Enable policy-based traffic selectors. - UsePolicyBasedTrafficSelectors *bool `json:"usePolicyBasedTrafficSelectors,omitempty"` - - // Connection protocol used for this connection. - VPNConnectionProtocolType *VirtualNetworkGatewayConnectionProtocol `json:"vpnConnectionProtocolType,omitempty"` - - // vpnGatewayCustomBgpAddresses used by this connection. - VPNGatewayCustomBgpAddresses []*GatewayCustomBgpIPAddressIPConfiguration `json:"vpnGatewayCustomBgpAddresses,omitempty"` - - // Vpn link connection mode. - VPNLinkConnectionMode *VPNLinkConnectionMode `json:"vpnLinkConnectionMode,omitempty"` - - // Id of the connected vpn site link. - VPNSiteLink *SubResource `json:"vpnSiteLink,omitempty"` - - // READ-ONLY; The connection status. - ConnectionStatus *VPNConnectionStatus `json:"connectionStatus,omitempty" azure:"ro"` - - // READ-ONLY; Egress bytes transferred. - EgressBytesTransferred *int64 `json:"egressBytesTransferred,omitempty" azure:"ro"` - - // READ-ONLY; Ingress bytes transferred. - IngressBytesTransferred *int64 `json:"ingressBytesTransferred,omitempty" azure:"ro"` - - // READ-ONLY; The provisioning state of the VPN site link connection resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// VPNSiteLinkConnectionsClientGetOptions contains the optional parameters for the VPNSiteLinkConnectionsClient.Get method. -type VPNSiteLinkConnectionsClientGetOptions struct { - // placeholder for future optional parameters -} - -// VPNSiteLinkProperties - Parameters for VpnSite. -type VPNSiteLinkProperties struct { - // The set of bgp properties. - BgpProperties *VPNLinkBgpSettings `json:"bgpProperties,omitempty"` - - // FQDN of vpn-site-link. - Fqdn *string `json:"fqdn,omitempty"` - - // The ip-address for the vpn-site-link. - IPAddress *string `json:"ipAddress,omitempty"` - - // The link provider properties. - LinkProperties *VPNLinkProviderProperties `json:"linkProperties,omitempty"` - - // READ-ONLY; The provisioning state of the VPN site link resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// VPNSiteLinksClientGetOptions contains the optional parameters for the VPNSiteLinksClient.Get method. -type VPNSiteLinksClientGetOptions struct { - // placeholder for future optional parameters -} - -// VPNSiteLinksClientListByVPNSiteOptions contains the optional parameters for the VPNSiteLinksClient.ListByVPNSite method. -type VPNSiteLinksClientListByVPNSiteOptions struct { - // placeholder for future optional parameters -} - -// VPNSiteProperties - Parameters for VpnSite. -type VPNSiteProperties struct { - // The AddressSpace that contains an array of IP address ranges. - AddressSpace *AddressSpace `json:"addressSpace,omitempty"` - - // The set of bgp properties. - BgpProperties *BgpSettings `json:"bgpProperties,omitempty"` - - // The device properties. - DeviceProperties *DeviceProperties `json:"deviceProperties,omitempty"` - - // The ip-address for the vpn-site. - IPAddress *string `json:"ipAddress,omitempty"` - - // IsSecuritySite flag. - IsSecuritySite *bool `json:"isSecuritySite,omitempty"` - - // Office365 Policy. - O365Policy *O365PolicyProperties `json:"o365Policy,omitempty"` - - // The key for vpn-site that can be used for connections. - SiteKey *string `json:"siteKey,omitempty"` - - // List of all vpn site links. - VPNSiteLinks []*VPNSiteLink `json:"vpnSiteLinks,omitempty"` - - // The VirtualWAN to which the vpnSite belongs. - VirtualWan *SubResource `json:"virtualWan,omitempty"` - - // READ-ONLY; The provisioning state of the VPN site resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// VPNSitesClientBeginCreateOrUpdateOptions contains the optional parameters for the VPNSitesClient.BeginCreateOrUpdate method. -type VPNSitesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VPNSitesClientBeginDeleteOptions contains the optional parameters for the VPNSitesClient.BeginDelete method. -type VPNSitesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VPNSitesClientGetOptions contains the optional parameters for the VPNSitesClient.Get method. -type VPNSitesClientGetOptions struct { - // placeholder for future optional parameters -} - -// VPNSitesClientListByResourceGroupOptions contains the optional parameters for the VPNSitesClient.ListByResourceGroup method. -type VPNSitesClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// VPNSitesClientListOptions contains the optional parameters for the VPNSitesClient.List method. -type VPNSitesClientListOptions struct { - // placeholder for future optional parameters -} - -// VPNSitesClientUpdateTagsOptions contains the optional parameters for the VPNSitesClient.UpdateTags method. -type VPNSitesClientUpdateTagsOptions struct { - // placeholder for future optional parameters -} - -// VPNSitesConfigurationClientBeginDownloadOptions contains the optional parameters for the VPNSitesConfigurationClient.BeginDownload -// method. -type VPNSitesConfigurationClientBeginDownloadOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VerificationIPFlowParameters - Parameters that define the IP flow to be verified. -type VerificationIPFlowParameters struct { - // REQUIRED; The direction of the packet represented as a 5-tuple. - Direction *Direction `json:"direction,omitempty"` - - // REQUIRED; The local IP address. Acceptable values are valid IPv4 addresses. - LocalIPAddress *string `json:"localIPAddress,omitempty"` - - // REQUIRED; The local port. Acceptable values are a single integer in the range (0-65535). Support for * for the source port, - // which depends on the direction. - LocalPort *string `json:"localPort,omitempty"` - - // REQUIRED; Protocol to be verified on. - Protocol *IPFlowProtocol `json:"protocol,omitempty"` - - // REQUIRED; The remote IP address. Acceptable values are valid IPv4 addresses. - RemoteIPAddress *string `json:"remoteIPAddress,omitempty"` - - // REQUIRED; The remote port. Acceptable values are a single integer in the range (0-65535). Support for * for the source - // port, which depends on the direction. - RemotePort *string `json:"remotePort,omitempty"` - - // REQUIRED; The ID of the target resource to perform next-hop on. - TargetResourceID *string `json:"targetResourceId,omitempty"` - - // The NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any of them, then this parameter must be specified. - // Otherwise optional). - TargetNicResourceID *string `json:"targetNicResourceId,omitempty"` -} - -// VerificationIPFlowResult - Results of IP flow verification on the target resource. -type VerificationIPFlowResult struct { - // Indicates whether the traffic is allowed or denied. - Access *Access `json:"access,omitempty"` - - // Name of the rule. If input is not matched against any security rule, it is not displayed. - RuleName *string `json:"ruleName,omitempty"` -} - -// VirtualAppliance - NetworkVirtualAppliance Resource. -type VirtualAppliance struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // The service principal that has read access to cloud-init and config blob. - Identity *ManagedServiceIdentity `json:"identity,omitempty"` - - // Resource location. - Location *string `json:"location,omitempty"` - - // Properties of the Network Virtual Appliance. - Properties *VirtualAppliancePropertiesFormat `json:"properties,omitempty"` - - // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// VirtualApplianceListResult - Response for ListNetworkVirtualAppliances API service call. -type VirtualApplianceListResult struct { - // URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` - - // List of Network Virtual Appliances. - Value []*VirtualAppliance `json:"value,omitempty"` -} - -// VirtualApplianceNicProperties - Network Virtual Appliance NIC properties. -type VirtualApplianceNicProperties struct { - // READ-ONLY; NIC name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Private IP address. - PrivateIPAddress *string `json:"privateIpAddress,omitempty" azure:"ro"` - - // READ-ONLY; Public IP address. - PublicIPAddress *string `json:"publicIpAddress,omitempty" azure:"ro"` -} - -// VirtualAppliancePropertiesFormat - Network Virtual Appliance definition. -type VirtualAppliancePropertiesFormat struct { - // BootStrapConfigurationBlobs storage URLs. - BootStrapConfigurationBlobs []*string `json:"bootStrapConfigurationBlobs,omitempty"` - - // CloudInitConfiguration string in plain text. - CloudInitConfiguration *string `json:"cloudInitConfiguration,omitempty"` - - // CloudInitConfigurationBlob storage URLs. - CloudInitConfigurationBlobs []*string `json:"cloudInitConfigurationBlobs,omitempty"` - - // Network Virtual Appliance SKU. - NvaSKU *VirtualApplianceSKUProperties `json:"nvaSku,omitempty"` - - // Public key for SSH login. - SSHPublicKey *string `json:"sshPublicKey,omitempty"` - - // VirtualAppliance ASN. - VirtualApplianceAsn *int64 `json:"virtualApplianceAsn,omitempty"` - - // The Virtual Hub where Network Virtual Appliance is being deployed. - VirtualHub *SubResource `json:"virtualHub,omitempty"` - - // READ-ONLY; Address Prefix. - AddressPrefix *string `json:"addressPrefix,omitempty" azure:"ro"` - - // READ-ONLY; List of references to InboundSecurityRules. - InboundSecurityRules []*SubResource `json:"inboundSecurityRules,omitempty" azure:"ro"` - - // READ-ONLY; The provisioning state of the resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` - - // READ-ONLY; List of Virtual Appliance Network Interfaces. - VirtualApplianceNics []*VirtualApplianceNicProperties `json:"virtualApplianceNics,omitempty" azure:"ro"` - - // READ-ONLY; List of references to VirtualApplianceSite. - VirtualApplianceSites []*SubResource `json:"virtualApplianceSites,omitempty" azure:"ro"` -} - -// VirtualApplianceSKU - Definition of the NetworkVirtualApplianceSkus resource. -type VirtualApplianceSKU struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Resource location. - Location *string `json:"location,omitempty"` - - // NetworkVirtualApplianceSku properties. - Properties *VirtualApplianceSKUPropertiesFormat `json:"properties,omitempty"` - - // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// VirtualApplianceSKUInstances - List of available Sku and instances. -type VirtualApplianceSKUInstances struct { - // READ-ONLY; Instance Count. - InstanceCount *int32 `json:"instanceCount,omitempty" azure:"ro"` - - // READ-ONLY; Scale Unit. - ScaleUnit *string `json:"scaleUnit,omitempty" azure:"ro"` -} - -// VirtualApplianceSKUListResult - Response for ListNetworkVirtualApplianceSkus API service call. -type VirtualApplianceSKUListResult struct { - // URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` - - // List of Network Virtual Appliance Skus that are available. - Value []*VirtualApplianceSKU `json:"value,omitempty"` -} - -// VirtualApplianceSKUProperties - Network Virtual Appliance Sku Properties. -type VirtualApplianceSKUProperties struct { - // Virtual Appliance Scale Unit. - BundledScaleUnit *string `json:"bundledScaleUnit,omitempty"` - - // Virtual Appliance Version. - MarketPlaceVersion *string `json:"marketPlaceVersion,omitempty"` - - // Virtual Appliance Vendor. - Vendor *string `json:"vendor,omitempty"` -} - -// VirtualApplianceSKUPropertiesFormat - Properties specific to NetworkVirtualApplianceSkus. -type VirtualApplianceSKUPropertiesFormat struct { - // The list of scale units available. - AvailableScaleUnits []*VirtualApplianceSKUInstances `json:"availableScaleUnits,omitempty"` - - // READ-ONLY; Available Network Virtual Appliance versions. - AvailableVersions []*string `json:"availableVersions,omitempty" azure:"ro"` - - // READ-ONLY; Network Virtual Appliance Sku vendor. - Vendor *string `json:"vendor,omitempty" azure:"ro"` -} - -// VirtualApplianceSKUsClientGetOptions contains the optional parameters for the VirtualApplianceSKUsClient.Get method. -type VirtualApplianceSKUsClientGetOptions struct { - // placeholder for future optional parameters -} - -// VirtualApplianceSKUsClientListOptions contains the optional parameters for the VirtualApplianceSKUsClient.List method. -type VirtualApplianceSKUsClientListOptions struct { - // placeholder for future optional parameters -} - -// VirtualApplianceSite - Virtual Appliance Site resource. -type VirtualApplianceSite struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Name of the virtual appliance site. - Name *string `json:"name,omitempty"` - - // The properties of the Virtual Appliance Sites. - Properties *VirtualApplianceSiteProperties `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Site type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// VirtualApplianceSiteListResult - Response for ListNetworkVirtualApplianceSites API service call. -type VirtualApplianceSiteListResult struct { - // URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` - - // List of Network Virtual Appliance sites. - Value []*VirtualApplianceSite `json:"value,omitempty"` -} - -// VirtualApplianceSiteProperties - Properties of the rule group. -type VirtualApplianceSiteProperties struct { - // Address Prefix. - AddressPrefix *string `json:"addressPrefix,omitempty"` - - // Office 365 Policy. - O365Policy *Office365PolicyProperties `json:"o365Policy,omitempty"` - - // READ-ONLY; The provisioning state of the resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// VirtualApplianceSitesClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualApplianceSitesClient.BeginCreateOrUpdate -// method. -type VirtualApplianceSitesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualApplianceSitesClientBeginDeleteOptions contains the optional parameters for the VirtualApplianceSitesClient.BeginDelete -// method. -type VirtualApplianceSitesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualApplianceSitesClientGetOptions contains the optional parameters for the VirtualApplianceSitesClient.Get method. -type VirtualApplianceSitesClientGetOptions struct { - // placeholder for future optional parameters -} - -// VirtualApplianceSitesClientListOptions contains the optional parameters for the VirtualApplianceSitesClient.List method. -type VirtualApplianceSitesClientListOptions struct { - // placeholder for future optional parameters -} - -// VirtualAppliancesClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualAppliancesClient.BeginCreateOrUpdate -// method. -type VirtualAppliancesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualAppliancesClientBeginDeleteOptions contains the optional parameters for the VirtualAppliancesClient.BeginDelete -// method. -type VirtualAppliancesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualAppliancesClientGetOptions contains the optional parameters for the VirtualAppliancesClient.Get method. -type VirtualAppliancesClientGetOptions struct { - // Expands referenced resources. - Expand *string -} - -// VirtualAppliancesClientListByResourceGroupOptions contains the optional parameters for the VirtualAppliancesClient.ListByResourceGroup -// method. -type VirtualAppliancesClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// VirtualAppliancesClientListOptions contains the optional parameters for the VirtualAppliancesClient.List method. -type VirtualAppliancesClientListOptions struct { - // placeholder for future optional parameters -} - -// VirtualAppliancesClientUpdateTagsOptions contains the optional parameters for the VirtualAppliancesClient.UpdateTags method. -type VirtualAppliancesClientUpdateTagsOptions struct { - // placeholder for future optional parameters -} - -// VirtualHub Resource. -type VirtualHub struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Resource location. - Location *string `json:"location,omitempty"` - - // Properties of the virtual hub. - Properties *VirtualHubProperties `json:"properties,omitempty"` - - // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Kind of service virtual hub. This is metadata used for the Azure portal experience for Route Server. - Kind *string `json:"kind,omitempty" azure:"ro"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// VirtualHubBgpConnectionClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualHubBgpConnectionClient.BeginCreateOrUpdate -// method. -type VirtualHubBgpConnectionClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualHubBgpConnectionClientBeginDeleteOptions contains the optional parameters for the VirtualHubBgpConnectionClient.BeginDelete -// method. -type VirtualHubBgpConnectionClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualHubBgpConnectionClientGetOptions contains the optional parameters for the VirtualHubBgpConnectionClient.Get method. -type VirtualHubBgpConnectionClientGetOptions struct { - // placeholder for future optional parameters -} - -// VirtualHubBgpConnectionsClientBeginListAdvertisedRoutesOptions contains the optional parameters for the VirtualHubBgpConnectionsClient.BeginListAdvertisedRoutes -// method. -type VirtualHubBgpConnectionsClientBeginListAdvertisedRoutesOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualHubBgpConnectionsClientBeginListLearnedRoutesOptions contains the optional parameters for the VirtualHubBgpConnectionsClient.BeginListLearnedRoutes -// method. -type VirtualHubBgpConnectionsClientBeginListLearnedRoutesOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualHubBgpConnectionsClientListOptions contains the optional parameters for the VirtualHubBgpConnectionsClient.List -// method. -type VirtualHubBgpConnectionsClientListOptions struct { - // placeholder for future optional parameters -} - -// VirtualHubEffectiveRoute - The effective route configured on the virtual hub or specified resource. -type VirtualHubEffectiveRoute struct { - // The list of address prefixes. - AddressPrefixes []*string `json:"addressPrefixes,omitempty"` - - // The ASPath of this route. - AsPath *string `json:"asPath,omitempty"` - - // The type of the next hop. - NextHopType *string `json:"nextHopType,omitempty"` - - // The list of next hops. - NextHops []*string `json:"nextHops,omitempty"` - - // The origin of this route. - RouteOrigin *string `json:"routeOrigin,omitempty"` -} - -// VirtualHubEffectiveRouteList - EffectiveRoutes List. -type VirtualHubEffectiveRouteList struct { - // The list of effective routes configured on the virtual hub or the specified resource. - Value []*VirtualHubEffectiveRoute `json:"value,omitempty"` -} - -// VirtualHubID - Virtual Hub identifier. -type VirtualHubID struct { - // The resource URI for the Virtual Hub where the ExpressRoute gateway is or will be deployed. The Virtual Hub resource and - // the ExpressRoute gateway resource reside in the same subscription. - ID *string `json:"id,omitempty"` -} - -// VirtualHubIPConfigurationClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualHubIPConfigurationClient.BeginCreateOrUpdate -// method. -type VirtualHubIPConfigurationClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualHubIPConfigurationClientBeginDeleteOptions contains the optional parameters for the VirtualHubIPConfigurationClient.BeginDelete -// method. -type VirtualHubIPConfigurationClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualHubIPConfigurationClientGetOptions contains the optional parameters for the VirtualHubIPConfigurationClient.Get -// method. -type VirtualHubIPConfigurationClientGetOptions struct { - // placeholder for future optional parameters -} - -// VirtualHubIPConfigurationClientListOptions contains the optional parameters for the VirtualHubIPConfigurationClient.List -// method. -type VirtualHubIPConfigurationClientListOptions struct { - // placeholder for future optional parameters -} - -// VirtualHubProperties - Parameters for VirtualHub. -type VirtualHubProperties struct { - // Address-prefix for this VirtualHub. - AddressPrefix *string `json:"addressPrefix,omitempty"` - - // Flag to control transit for VirtualRouter hub. - AllowBranchToBranchTraffic *bool `json:"allowBranchToBranchTraffic,omitempty"` - - // The azureFirewall associated with this VirtualHub. - AzureFirewall *SubResource `json:"azureFirewall,omitempty"` - - // The expressRouteGateway associated with this VirtualHub. - ExpressRouteGateway *SubResource `json:"expressRouteGateway,omitempty"` - - // The hubRoutingPreference of this VirtualHub. - HubRoutingPreference *HubRoutingPreference `json:"hubRoutingPreference,omitempty"` - - // The P2SVpnGateway associated with this VirtualHub. - P2SVPNGateway *SubResource `json:"p2SVpnGateway,omitempty"` - - // The preferred gateway to route on-prem traffic - PreferredRoutingGateway *PreferredRoutingGateway `json:"preferredRoutingGateway,omitempty"` - - // The routeTable associated with this virtual hub. - RouteTable *VirtualHubRouteTable `json:"routeTable,omitempty"` - - // The sku of this VirtualHub. - SKU *string `json:"sku,omitempty"` - - // The securityPartnerProvider associated with this VirtualHub. - SecurityPartnerProvider *SubResource `json:"securityPartnerProvider,omitempty"` - - // The Security Provider name. - SecurityProviderName *string `json:"securityProviderName,omitempty"` - - // The VpnGateway associated with this VirtualHub. - VPNGateway *SubResource `json:"vpnGateway,omitempty"` - - // List of all virtual hub route table v2s associated with this VirtualHub. - VirtualHubRouteTableV2S []*VirtualHubRouteTableV2 `json:"virtualHubRouteTableV2s,omitempty"` - - // VirtualRouter ASN. - VirtualRouterAsn *int64 `json:"virtualRouterAsn,omitempty"` - - // The VirtualHub Router autoscale configuration. - VirtualRouterAutoScaleConfiguration *VirtualRouterAutoScaleConfiguration `json:"virtualRouterAutoScaleConfiguration,omitempty"` - - // VirtualRouter IPs. - VirtualRouterIPs []*string `json:"virtualRouterIps,omitempty"` - - // The VirtualWAN to which the VirtualHub belongs. - VirtualWan *SubResource `json:"virtualWan,omitempty"` - - // READ-ONLY; List of references to Bgp Connections. - BgpConnections []*SubResource `json:"bgpConnections,omitempty" azure:"ro"` - - // READ-ONLY; List of references to IpConfigurations. - IPConfigurations []*SubResource `json:"ipConfigurations,omitempty" azure:"ro"` - - // READ-ONLY; The provisioning state of the virtual hub resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` - - // READ-ONLY; The routing state. - RoutingState *RoutingState `json:"routingState,omitempty" azure:"ro"` -} - -// VirtualHubRoute - VirtualHub route. -type VirtualHubRoute struct { - // List of all addressPrefixes. - AddressPrefixes []*string `json:"addressPrefixes,omitempty"` - - // NextHop ip address. - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` -} - -// VirtualHubRouteTable - VirtualHub route table. -type VirtualHubRouteTable struct { - // List of all routes. - Routes []*VirtualHubRoute `json:"routes,omitempty"` -} - -// VirtualHubRouteTableV2 Resource. -type VirtualHubRouteTableV2 struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // 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"` - - // Properties of the virtual hub route table v2. - Properties *VirtualHubRouteTableV2Properties `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` -} - -// VirtualHubRouteTableV2Properties - Parameters for VirtualHubRouteTableV2. -type VirtualHubRouteTableV2Properties struct { - // List of all connections attached to this route table v2. - AttachedConnections []*string `json:"attachedConnections,omitempty"` - - // List of all routes. - Routes []*VirtualHubRouteV2 `json:"routes,omitempty"` - - // READ-ONLY; The provisioning state of the virtual hub route table v2 resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// VirtualHubRouteTableV2SClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualHubRouteTableV2SClient.BeginCreateOrUpdate -// method. -type VirtualHubRouteTableV2SClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualHubRouteTableV2SClientBeginDeleteOptions contains the optional parameters for the VirtualHubRouteTableV2SClient.BeginDelete -// method. -type VirtualHubRouteTableV2SClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualHubRouteTableV2SClientGetOptions contains the optional parameters for the VirtualHubRouteTableV2SClient.Get method. -type VirtualHubRouteTableV2SClientGetOptions struct { - // placeholder for future optional parameters -} - -// VirtualHubRouteTableV2SClientListOptions contains the optional parameters for the VirtualHubRouteTableV2SClient.List method. -type VirtualHubRouteTableV2SClientListOptions struct { - // placeholder for future optional parameters -} - -// VirtualHubRouteV2 - VirtualHubRouteTableV2 route. -type VirtualHubRouteV2 struct { - // The type of destinations. - DestinationType *string `json:"destinationType,omitempty"` - - // List of all destinations. - Destinations []*string `json:"destinations,omitempty"` - - // The type of next hops. - NextHopType *string `json:"nextHopType,omitempty"` - - // NextHops ip address. - NextHops []*string `json:"nextHops,omitempty"` -} - -// VirtualHubsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualHubsClient.BeginCreateOrUpdate -// method. -type VirtualHubsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualHubsClientBeginDeleteOptions contains the optional parameters for the VirtualHubsClient.BeginDelete method. -type VirtualHubsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualHubsClientBeginGetEffectiveVirtualHubRoutesOptions contains the optional parameters for the VirtualHubsClient.BeginGetEffectiveVirtualHubRoutes -// method. -type VirtualHubsClientBeginGetEffectiveVirtualHubRoutesOptions struct { - // Parameters supplied to get the effective routes for a specific resource. - EffectiveRoutesParameters *EffectiveRoutesParameters - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualHubsClientGetOptions contains the optional parameters for the VirtualHubsClient.Get method. -type VirtualHubsClientGetOptions struct { - // placeholder for future optional parameters -} - -// VirtualHubsClientListByResourceGroupOptions contains the optional parameters for the VirtualHubsClient.ListByResourceGroup -// method. -type VirtualHubsClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// VirtualHubsClientListOptions contains the optional parameters for the VirtualHubsClient.List method. -type VirtualHubsClientListOptions struct { - // placeholder for future optional parameters -} - -// VirtualHubsClientUpdateTagsOptions contains the optional parameters for the VirtualHubsClient.UpdateTags method. -type VirtualHubsClientUpdateTagsOptions struct { - // placeholder for future optional parameters -} - -// VirtualNetwork - Virtual Network resource. -type VirtualNetwork struct { - // The extended location of the virtual network. - ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` - - // Resource ID. - ID *string `json:"id,omitempty"` - - // Resource location. - Location *string `json:"location,omitempty"` - - // Properties of the virtual network. - Properties *VirtualNetworkPropertiesFormat `json:"properties,omitempty"` - - // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// VirtualNetworkBgpCommunities - Bgp Communities sent over ExpressRoute with each route corresponding to a prefix in this -// VNET. -type VirtualNetworkBgpCommunities struct { - // REQUIRED; The BGP community associated with the virtual network. - VirtualNetworkCommunity *string `json:"virtualNetworkCommunity,omitempty"` - - // READ-ONLY; The BGP community associated with the region of the virtual network. - RegionalCommunity *string `json:"regionalCommunity,omitempty" azure:"ro"` -} - -// VirtualNetworkConnectionGatewayReference - A reference to VirtualNetworkGateway or LocalNetworkGateway resource. -type VirtualNetworkConnectionGatewayReference struct { - // REQUIRED; The ID of VirtualNetworkGateway or LocalNetworkGateway resource. - ID *string `json:"id,omitempty"` -} - -// VirtualNetworkEncryption - Indicates if encryption is enabled on virtual network and if VM without encryption is allowed -// in encrypted VNet. -type VirtualNetworkEncryption struct { - // REQUIRED; Indicates if encryption is enabled on the virtual network. - Enabled *bool `json:"enabled,omitempty"` - - // If the encrypted VNet allows VM that does not support encryption - Enforcement *VirtualNetworkEncryptionEnforcement `json:"enforcement,omitempty"` -} - -// VirtualNetworkGateway - A common class for general resource information. -type VirtualNetworkGateway struct { - // REQUIRED; Properties of the virtual network gateway. - Properties *VirtualNetworkGatewayPropertiesFormat `json:"properties,omitempty"` - - // The extended location of type local virtual network gateway. - ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` - - // Resource ID. - ID *string `json:"id,omitempty"` - - // Resource location. - Location *string `json:"location,omitempty"` - - // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// VirtualNetworkGatewayConnection - A common class for general resource information. -type VirtualNetworkGatewayConnection struct { - // REQUIRED; Properties of the virtual network gateway connection. - Properties *VirtualNetworkGatewayConnectionPropertiesFormat `json:"properties,omitempty"` - - // Resource ID. - ID *string `json:"id,omitempty"` - - // Resource location. - Location *string `json:"location,omitempty"` - - // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// VirtualNetworkGatewayConnectionListEntity - A common class for general resource information. -type VirtualNetworkGatewayConnectionListEntity struct { - // REQUIRED; Properties of the virtual network gateway connection. - Properties *VirtualNetworkGatewayConnectionListEntityPropertiesFormat `json:"properties,omitempty"` - - // Resource ID. - ID *string `json:"id,omitempty"` - - // Resource location. - Location *string `json:"location,omitempty"` - - // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// VirtualNetworkGatewayConnectionListEntityPropertiesFormat - VirtualNetworkGatewayConnection properties. -type VirtualNetworkGatewayConnectionListEntityPropertiesFormat struct { - // REQUIRED; Gateway connection type. - ConnectionType *VirtualNetworkGatewayConnectionType `json:"connectionType,omitempty"` - - // REQUIRED; The reference to virtual network gateway resource. - VirtualNetworkGateway1 *VirtualNetworkConnectionGatewayReference `json:"virtualNetworkGateway1,omitempty"` - - // The authorizationKey. - AuthorizationKey *string `json:"authorizationKey,omitempty"` - - // The connection mode for this connection. - ConnectionMode *VirtualNetworkGatewayConnectionMode `json:"connectionMode,omitempty"` - - // Connection protocol used for this connection. - ConnectionProtocol *VirtualNetworkGatewayConnectionProtocol `json:"connectionProtocol,omitempty"` - - // EnableBgp flag. - EnableBgp *bool `json:"enableBgp,omitempty"` - - // Bypass ExpressRoute Gateway for data forwarding. - ExpressRouteGatewayBypass *bool `json:"expressRouteGatewayBypass,omitempty"` - - // GatewayCustomBgpIpAddresses to be used for virtual network gateway Connection. - GatewayCustomBgpIPAddresses []*GatewayCustomBgpIPAddressIPConfiguration `json:"gatewayCustomBgpIpAddresses,omitempty"` - - // The IPSec Policies to be considered by this connection. - IPSecPolicies []*IPSecPolicy `json:"ipsecPolicies,omitempty"` - - // The reference to local network gateway resource. - LocalNetworkGateway2 *VirtualNetworkConnectionGatewayReference `json:"localNetworkGateway2,omitempty"` - - // The reference to peerings resource. - Peer *SubResource `json:"peer,omitempty"` - - // The routing weight. - RoutingWeight *int32 `json:"routingWeight,omitempty"` - - // The IPSec shared key. - SharedKey *string `json:"sharedKey,omitempty"` - - // The Traffic Selector Policies to be considered by this connection. - TrafficSelectorPolicies []*TrafficSelectorPolicy `json:"trafficSelectorPolicies,omitempty"` - - // Enable policy-based traffic selectors. - UsePolicyBasedTrafficSelectors *bool `json:"usePolicyBasedTrafficSelectors,omitempty"` - - // The reference to virtual network gateway resource. - VirtualNetworkGateway2 *VirtualNetworkConnectionGatewayReference `json:"virtualNetworkGateway2,omitempty"` - - // READ-ONLY; Virtual Network Gateway connection status. - ConnectionStatus *VirtualNetworkGatewayConnectionStatus `json:"connectionStatus,omitempty" azure:"ro"` - - // READ-ONLY; The egress bytes transferred in this connection. - EgressBytesTransferred *int64 `json:"egressBytesTransferred,omitempty" azure:"ro"` - - // READ-ONLY; The ingress bytes transferred in this connection. - IngressBytesTransferred *int64 `json:"ingressBytesTransferred,omitempty" azure:"ro"` - - // READ-ONLY; The provisioning state of the virtual network gateway connection resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` - - // READ-ONLY; The resource GUID property of the virtual network gateway connection resource. - ResourceGUID *string `json:"resourceGuid,omitempty" azure:"ro"` - - // READ-ONLY; Collection of all tunnels' connection health status. - TunnelConnectionStatus []*TunnelConnectionHealth `json:"tunnelConnectionStatus,omitempty" azure:"ro"` -} - -// VirtualNetworkGatewayConnectionListResult - Response for the ListVirtualNetworkGatewayConnections API service call. -type VirtualNetworkGatewayConnectionListResult struct { - // A list of VirtualNetworkGatewayConnection resources that exists in a resource group. - Value []*VirtualNetworkGatewayConnection `json:"value,omitempty"` - - // READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` -} - -// VirtualNetworkGatewayConnectionPropertiesFormat - VirtualNetworkGatewayConnection properties. -type VirtualNetworkGatewayConnectionPropertiesFormat struct { - // REQUIRED; Gateway connection type. - ConnectionType *VirtualNetworkGatewayConnectionType `json:"connectionType,omitempty"` - - // REQUIRED; The reference to virtual network gateway resource. - VirtualNetworkGateway1 *VirtualNetworkGateway `json:"virtualNetworkGateway1,omitempty"` - - // The authorizationKey. - AuthorizationKey *string `json:"authorizationKey,omitempty"` - - // The connection mode for this connection. - ConnectionMode *VirtualNetworkGatewayConnectionMode `json:"connectionMode,omitempty"` - - // Connection protocol used for this connection. - ConnectionProtocol *VirtualNetworkGatewayConnectionProtocol `json:"connectionProtocol,omitempty"` - - // The dead peer detection timeout of this connection in seconds. - DpdTimeoutSeconds *int32 `json:"dpdTimeoutSeconds,omitempty"` - - // List of egress NatRules. - EgressNatRules []*SubResource `json:"egressNatRules,omitempty"` - - // EnableBgp flag. - EnableBgp *bool `json:"enableBgp,omitempty"` - - // Bypass ExpressRoute Gateway for data forwarding. - ExpressRouteGatewayBypass *bool `json:"expressRouteGatewayBypass,omitempty"` - - // GatewayCustomBgpIpAddresses to be used for virtual network gateway Connection. - GatewayCustomBgpIPAddresses []*GatewayCustomBgpIPAddressIPConfiguration `json:"gatewayCustomBgpIpAddresses,omitempty"` - - // The IPSec Policies to be considered by this connection. - IPSecPolicies []*IPSecPolicy `json:"ipsecPolicies,omitempty"` - - // List of ingress NatRules. - IngressNatRules []*SubResource `json:"ingressNatRules,omitempty"` - - // The reference to local network gateway resource. - LocalNetworkGateway2 *LocalNetworkGateway `json:"localNetworkGateway2,omitempty"` - - // The reference to peerings resource. - Peer *SubResource `json:"peer,omitempty"` - - // The routing weight. - RoutingWeight *int32 `json:"routingWeight,omitempty"` - - // The IPSec shared key. - SharedKey *string `json:"sharedKey,omitempty"` - - // The Traffic Selector Policies to be considered by this connection. - TrafficSelectorPolicies []*TrafficSelectorPolicy `json:"trafficSelectorPolicies,omitempty"` - - // Use private local Azure IP for the connection. - UseLocalAzureIPAddress *bool `json:"useLocalAzureIpAddress,omitempty"` - - // Enable policy-based traffic selectors. - UsePolicyBasedTrafficSelectors *bool `json:"usePolicyBasedTrafficSelectors,omitempty"` - - // The reference to virtual network gateway resource. - VirtualNetworkGateway2 *VirtualNetworkGateway `json:"virtualNetworkGateway2,omitempty"` - - // READ-ONLY; Virtual Network Gateway connection status. - ConnectionStatus *VirtualNetworkGatewayConnectionStatus `json:"connectionStatus,omitempty" azure:"ro"` - - // READ-ONLY; The egress bytes transferred in this connection. - EgressBytesTransferred *int64 `json:"egressBytesTransferred,omitempty" azure:"ro"` - - // READ-ONLY; The ingress bytes transferred in this connection. - IngressBytesTransferred *int64 `json:"ingressBytesTransferred,omitempty" azure:"ro"` - - // READ-ONLY; The provisioning state of the virtual network gateway connection resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` - - // READ-ONLY; The resource GUID property of the virtual network gateway connection resource. - ResourceGUID *string `json:"resourceGuid,omitempty" azure:"ro"` - - // READ-ONLY; Collection of all tunnels' connection health status. - TunnelConnectionStatus []*TunnelConnectionHealth `json:"tunnelConnectionStatus,omitempty" azure:"ro"` -} - -// VirtualNetworkGatewayConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.BeginCreateOrUpdate -// method. -type VirtualNetworkGatewayConnectionsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualNetworkGatewayConnectionsClientBeginDeleteOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.BeginDelete -// method. -type VirtualNetworkGatewayConnectionsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualNetworkGatewayConnectionsClientBeginGetIkeSasOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.BeginGetIkeSas -// method. -type VirtualNetworkGatewayConnectionsClientBeginGetIkeSasOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualNetworkGatewayConnectionsClientBeginResetConnectionOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.BeginResetConnection -// method. -type VirtualNetworkGatewayConnectionsClientBeginResetConnectionOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualNetworkGatewayConnectionsClientBeginResetSharedKeyOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.BeginResetSharedKey -// method. -type VirtualNetworkGatewayConnectionsClientBeginResetSharedKeyOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualNetworkGatewayConnectionsClientBeginSetSharedKeyOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.BeginSetSharedKey -// method. -type VirtualNetworkGatewayConnectionsClientBeginSetSharedKeyOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualNetworkGatewayConnectionsClientBeginStartPacketCaptureOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.BeginStartPacketCapture -// method. -type VirtualNetworkGatewayConnectionsClientBeginStartPacketCaptureOptions struct { - // Virtual network gateway packet capture parameters supplied to start packet capture on gateway connection. - Parameters *VPNPacketCaptureStartParameters - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualNetworkGatewayConnectionsClientBeginStopPacketCaptureOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.BeginStopPacketCapture -// method. -type VirtualNetworkGatewayConnectionsClientBeginStopPacketCaptureOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualNetworkGatewayConnectionsClientBeginUpdateTagsOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.BeginUpdateTags -// method. -type VirtualNetworkGatewayConnectionsClientBeginUpdateTagsOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualNetworkGatewayConnectionsClientGetOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.Get -// method. -type VirtualNetworkGatewayConnectionsClientGetOptions struct { - // placeholder for future optional parameters -} - -// VirtualNetworkGatewayConnectionsClientGetSharedKeyOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.GetSharedKey -// method. -type VirtualNetworkGatewayConnectionsClientGetSharedKeyOptions struct { - // placeholder for future optional parameters -} - -// VirtualNetworkGatewayConnectionsClientListOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.List -// method. -type VirtualNetworkGatewayConnectionsClientListOptions struct { - // placeholder for future optional parameters -} - -// VirtualNetworkGatewayIPConfiguration - IP configuration for virtual network gateway. -type VirtualNetworkGatewayIPConfiguration struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // 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"` - - // Properties of the virtual network gateway ip configuration. - Properties *VirtualNetworkGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` -} - -// VirtualNetworkGatewayIPConfigurationPropertiesFormat - Properties of VirtualNetworkGatewayIPConfiguration. -type VirtualNetworkGatewayIPConfigurationPropertiesFormat struct { - // The private IP address allocation method. - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - - // The reference to the public IP resource. - PublicIPAddress *SubResource `json:"publicIPAddress,omitempty"` - - // The reference to the subnet resource. - Subnet *SubResource `json:"subnet,omitempty"` - - // READ-ONLY; Private IP Address for this gateway. - PrivateIPAddress *string `json:"privateIPAddress,omitempty" azure:"ro"` - - // READ-ONLY; The provisioning state of the virtual network gateway IP configuration resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// VirtualNetworkGatewayListConnectionsResult - Response for the VirtualNetworkGatewayListConnections API service call. -type VirtualNetworkGatewayListConnectionsResult struct { - // A list of VirtualNetworkGatewayConnection resources that exists in a resource group. - Value []*VirtualNetworkGatewayConnectionListEntity `json:"value,omitempty"` - - // READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` -} - -// VirtualNetworkGatewayListResult - Response for the ListVirtualNetworkGateways API service call. -type VirtualNetworkGatewayListResult struct { - // A list of VirtualNetworkGateway resources that exists in a resource group. - Value []*VirtualNetworkGateway `json:"value,omitempty"` - - // READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` -} - -// VirtualNetworkGatewayNatRule Resource. -type VirtualNetworkGatewayNatRule struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // 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"` - - // Properties of the Virtual Network Gateway NAT rule. - Properties *VirtualNetworkGatewayNatRuleProperties `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// VirtualNetworkGatewayNatRuleProperties - Parameters for VirtualNetworkGatewayNatRule. -type VirtualNetworkGatewayNatRuleProperties struct { - // The private IP address external mapping for NAT. - ExternalMappings []*VPNNatRuleMapping `json:"externalMappings,omitempty"` - - // The IP Configuration ID this NAT rule applies to. - IPConfigurationID *string `json:"ipConfigurationId,omitempty"` - - // The private IP address internal mapping for NAT. - InternalMappings []*VPNNatRuleMapping `json:"internalMappings,omitempty"` - - // The Source NAT direction of a VPN NAT. - Mode *VPNNatRuleMode `json:"mode,omitempty"` - - // The type of NAT rule for VPN NAT. - Type *VPNNatRuleType `json:"type,omitempty"` - - // READ-ONLY; The provisioning state of the NAT Rule resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// VirtualNetworkGatewayNatRulesClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualNetworkGatewayNatRulesClient.BeginCreateOrUpdate -// method. -type VirtualNetworkGatewayNatRulesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualNetworkGatewayNatRulesClientBeginDeleteOptions contains the optional parameters for the VirtualNetworkGatewayNatRulesClient.BeginDelete -// method. -type VirtualNetworkGatewayNatRulesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualNetworkGatewayNatRulesClientGetOptions contains the optional parameters for the VirtualNetworkGatewayNatRulesClient.Get -// method. -type VirtualNetworkGatewayNatRulesClientGetOptions struct { - // placeholder for future optional parameters -} - -// VirtualNetworkGatewayNatRulesClientListByVirtualNetworkGatewayOptions contains the optional parameters for the VirtualNetworkGatewayNatRulesClient.ListByVirtualNetworkGateway -// method. -type VirtualNetworkGatewayNatRulesClientListByVirtualNetworkGatewayOptions struct { - // placeholder for future optional parameters -} - -// VirtualNetworkGatewayPropertiesFormat - VirtualNetworkGateway properties. -type VirtualNetworkGatewayPropertiesFormat struct { - // ActiveActive flag. - Active *bool `json:"activeActive,omitempty"` - - // Virtual network gateway's BGP speaker settings. - BgpSettings *BgpSettings `json:"bgpSettings,omitempty"` - - // The reference to the address space resource which represents the custom routes address space specified by the customer - // for virtual network gateway and VpnClient. - CustomRoutes *AddressSpace `json:"customRoutes,omitempty"` - - // disableIPSecReplayProtection flag. - DisableIPSecReplayProtection *bool `json:"disableIPSecReplayProtection,omitempty"` - - // Whether BGP is enabled for this virtual network gateway or not. - EnableBgp *bool `json:"enableBgp,omitempty"` - - // EnableBgpRouteTranslationForNat flag. - EnableBgpRouteTranslationForNat *bool `json:"enableBgpRouteTranslationForNat,omitempty"` - - // Whether dns forwarding is enabled or not. - EnableDNSForwarding *bool `json:"enableDnsForwarding,omitempty"` - - // Whether private IP needs to be enabled on this gateway for connections or not. - EnablePrivateIPAddress *bool `json:"enablePrivateIpAddress,omitempty"` - - // The reference to the LocalNetworkGateway resource which represents local network site having default routes. Assign Null - // value in case of removing existing default site setting. - GatewayDefaultSite *SubResource `json:"gatewayDefaultSite,omitempty"` - - // The type of this virtual network gateway. - GatewayType *VirtualNetworkGatewayType `json:"gatewayType,omitempty"` - - // IP configurations for virtual network gateway. - IPConfigurations []*VirtualNetworkGatewayIPConfiguration `json:"ipConfigurations,omitempty"` - - // NatRules for virtual network gateway. - NatRules []*VirtualNetworkGatewayNatRule `json:"natRules,omitempty"` - - // The reference to the VirtualNetworkGatewaySku resource which represents the SKU selected for Virtual network gateway. - SKU *VirtualNetworkGatewaySKU `json:"sku,omitempty"` - - // Customer vnet resource id. VirtualNetworkGateway of type local gateway is associated with the customer vnet. - VNetExtendedLocationResourceID *string `json:"vNetExtendedLocationResourceId,omitempty"` - - // The reference to the VpnClientConfiguration resource which represents the P2S VpnClient configurations. - VPNClientConfiguration *VPNClientConfiguration `json:"vpnClientConfiguration,omitempty"` - - // The generation for this VirtualNetworkGateway. Must be None if gatewayType is not VPN. - VPNGatewayGeneration *VPNGatewayGeneration `json:"vpnGatewayGeneration,omitempty"` - - // The type of this virtual network gateway. - VPNType *VPNType `json:"vpnType,omitempty"` - - // READ-ONLY; The IP address allocated by the gateway to which dns requests can be sent. - InboundDNSForwardingEndpoint *string `json:"inboundDnsForwardingEndpoint,omitempty" azure:"ro"` - - // READ-ONLY; The provisioning state of the virtual network gateway resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` - - // READ-ONLY; The resource GUID property of the virtual network gateway resource. - ResourceGUID *string `json:"resourceGuid,omitempty" azure:"ro"` -} - -// VirtualNetworkGatewaySKU - VirtualNetworkGatewaySku details. -type VirtualNetworkGatewaySKU struct { - // Gateway SKU name. - Name *VirtualNetworkGatewaySKUName `json:"name,omitempty"` - - // Gateway SKU tier. - Tier *VirtualNetworkGatewaySKUTier `json:"tier,omitempty"` - - // READ-ONLY; The capacity. - Capacity *int32 `json:"capacity,omitempty" azure:"ro"` -} - -// VirtualNetworkGatewaysClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginCreateOrUpdate -// method. -type VirtualNetworkGatewaysClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualNetworkGatewaysClientBeginDeleteOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginDelete -// method. -type VirtualNetworkGatewaysClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualNetworkGatewaysClientBeginDisconnectVirtualNetworkGatewayVPNConnectionsOptions contains the optional parameters -// for the VirtualNetworkGatewaysClient.BeginDisconnectVirtualNetworkGatewayVPNConnections method. -type VirtualNetworkGatewaysClientBeginDisconnectVirtualNetworkGatewayVPNConnectionsOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualNetworkGatewaysClientBeginGenerateVPNProfileOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginGenerateVPNProfile -// method. -type VirtualNetworkGatewaysClientBeginGenerateVPNProfileOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualNetworkGatewaysClientBeginGeneratevpnclientpackageOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginGeneratevpnclientpackage -// method. -type VirtualNetworkGatewaysClientBeginGeneratevpnclientpackageOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualNetworkGatewaysClientBeginGetAdvertisedRoutesOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginGetAdvertisedRoutes -// method. -type VirtualNetworkGatewaysClientBeginGetAdvertisedRoutesOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualNetworkGatewaysClientBeginGetBgpPeerStatusOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginGetBgpPeerStatus -// method. -type VirtualNetworkGatewaysClientBeginGetBgpPeerStatusOptions struct { - // The IP address of the peer to retrieve the status of. - Peer *string - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualNetworkGatewaysClientBeginGetLearnedRoutesOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginGetLearnedRoutes -// method. -type VirtualNetworkGatewaysClientBeginGetLearnedRoutesOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualNetworkGatewaysClientBeginGetVPNProfilePackageURLOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginGetVPNProfilePackageURL -// method. -type VirtualNetworkGatewaysClientBeginGetVPNProfilePackageURLOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualNetworkGatewaysClientBeginGetVpnclientConnectionHealthOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginGetVpnclientConnectionHealth -// method. -type VirtualNetworkGatewaysClientBeginGetVpnclientConnectionHealthOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualNetworkGatewaysClientBeginGetVpnclientIPSecParametersOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginGetVpnclientIPSecParameters -// method. -type VirtualNetworkGatewaysClientBeginGetVpnclientIPSecParametersOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualNetworkGatewaysClientBeginResetOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginReset -// method. -type VirtualNetworkGatewaysClientBeginResetOptions struct { - // Virtual network gateway vip address supplied to the begin reset of the active-active feature enabled gateway. - GatewayVip *string - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualNetworkGatewaysClientBeginResetVPNClientSharedKeyOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginResetVPNClientSharedKey -// method. -type VirtualNetworkGatewaysClientBeginResetVPNClientSharedKeyOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualNetworkGatewaysClientBeginSetVpnclientIPSecParametersOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginSetVpnclientIPSecParameters -// method. -type VirtualNetworkGatewaysClientBeginSetVpnclientIPSecParametersOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualNetworkGatewaysClientBeginStartPacketCaptureOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginStartPacketCapture -// method. -type VirtualNetworkGatewaysClientBeginStartPacketCaptureOptions struct { - // Virtual network gateway packet capture parameters supplied to start packet capture on gateway. - Parameters *VPNPacketCaptureStartParameters - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualNetworkGatewaysClientBeginStopPacketCaptureOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginStopPacketCapture -// method. -type VirtualNetworkGatewaysClientBeginStopPacketCaptureOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualNetworkGatewaysClientBeginUpdateTagsOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginUpdateTags -// method. -type VirtualNetworkGatewaysClientBeginUpdateTagsOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualNetworkGatewaysClientGetOptions contains the optional parameters for the VirtualNetworkGatewaysClient.Get method. -type VirtualNetworkGatewaysClientGetOptions struct { - // placeholder for future optional parameters -} - -// VirtualNetworkGatewaysClientListConnectionsOptions contains the optional parameters for the VirtualNetworkGatewaysClient.ListConnections -// method. -type VirtualNetworkGatewaysClientListConnectionsOptions struct { - // placeholder for future optional parameters -} - -// VirtualNetworkGatewaysClientListOptions contains the optional parameters for the VirtualNetworkGatewaysClient.List method. -type VirtualNetworkGatewaysClientListOptions struct { - // placeholder for future optional parameters -} - -// VirtualNetworkGatewaysClientSupportedVPNDevicesOptions contains the optional parameters for the VirtualNetworkGatewaysClient.SupportedVPNDevices -// method. -type VirtualNetworkGatewaysClientSupportedVPNDevicesOptions struct { - // placeholder for future optional parameters -} - -// VirtualNetworkGatewaysClientVPNDeviceConfigurationScriptOptions contains the optional parameters for the VirtualNetworkGatewaysClient.VPNDeviceConfigurationScript -// method. -type VirtualNetworkGatewaysClientVPNDeviceConfigurationScriptOptions struct { - // placeholder for future optional parameters -} - -// VirtualNetworkListResult - Response for the ListVirtualNetworks API service call. -type VirtualNetworkListResult struct { - // The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` - - // A list of VirtualNetwork resources in a resource group. - Value []*VirtualNetwork `json:"value,omitempty"` -} - -// VirtualNetworkListUsageResult - Response for the virtual networks GetUsage API service call. -type VirtualNetworkListUsageResult struct { - // The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` - - // READ-ONLY; VirtualNetwork usage stats. - Value []*VirtualNetworkUsage `json:"value,omitempty" azure:"ro"` -} - -// VirtualNetworkPeering - Peerings in a virtual network resource. -type VirtualNetworkPeering struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // 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"` - - // Properties of the virtual network peering. - Properties *VirtualNetworkPeeringPropertiesFormat `json:"properties,omitempty"` - - // Resource type. - Type *string `json:"type,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` -} - -// VirtualNetworkPeeringListResult - Response for ListSubnets API service call. Retrieves all subnets that belong to a virtual -// network. -type VirtualNetworkPeeringListResult struct { - // The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` - - // The peerings in a virtual network. - Value []*VirtualNetworkPeering `json:"value,omitempty"` -} - -// VirtualNetworkPeeringPropertiesFormat - Properties of the virtual network peering. -type VirtualNetworkPeeringPropertiesFormat struct { - // Whether the forwarded traffic from the VMs in the local virtual network will be allowed/disallowed in remote virtual network. - AllowForwardedTraffic *bool `json:"allowForwardedTraffic,omitempty"` - - // If gateway links can be used in remote virtual networking to link to this virtual network. - AllowGatewayTransit *bool `json:"allowGatewayTransit,omitempty"` - - // Whether the VMs in the local virtual network space would be able to access the VMs in remote virtual network space. - AllowVirtualNetworkAccess *bool `json:"allowVirtualNetworkAccess,omitempty"` - - // If we need to verify the provisioning state of the remote gateway. - DoNotVerifyRemoteGateways *bool `json:"doNotVerifyRemoteGateways,omitempty"` - - // The status of the virtual network peering. - PeeringState *VirtualNetworkPeeringState `json:"peeringState,omitempty"` - - // The peering sync status of the virtual network peering. - PeeringSyncLevel *VirtualNetworkPeeringLevel `json:"peeringSyncLevel,omitempty"` - - // The reference to the address space peered with the remote virtual network. - RemoteAddressSpace *AddressSpace `json:"remoteAddressSpace,omitempty"` - - // The reference to the remote virtual network's Bgp Communities. - RemoteBgpCommunities *VirtualNetworkBgpCommunities `json:"remoteBgpCommunities,omitempty"` - - // The reference to the remote virtual network. The remote virtual network can be in the same or different region (preview). - // See here to register for the preview and learn more - // (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). - RemoteVirtualNetwork *SubResource `json:"remoteVirtualNetwork,omitempty"` - - // The reference to the current address space of the remote virtual network. - RemoteVirtualNetworkAddressSpace *AddressSpace `json:"remoteVirtualNetworkAddressSpace,omitempty"` - - // If remote gateways can be used on this virtual network. If the flag is set to true, and allowGatewayTransit on remote peering - // is also true, virtual network will use gateways of remote virtual network - // for transit. Only one peering can have this flag set to true. This flag cannot be set if virtual network already has a - // gateway. - UseRemoteGateways *bool `json:"useRemoteGateways,omitempty"` - - // READ-ONLY; The provisioning state of the virtual network peering resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` - - // READ-ONLY; The reference to the remote virtual network's encryption - RemoteVirtualNetworkEncryption *VirtualNetworkEncryption `json:"remoteVirtualNetworkEncryption,omitempty" azure:"ro"` - - // READ-ONLY; The resourceGuid property of the Virtual Network peering resource. - ResourceGUID *string `json:"resourceGuid,omitempty" azure:"ro"` -} - -// VirtualNetworkPeeringsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualNetworkPeeringsClient.BeginCreateOrUpdate -// method. -type VirtualNetworkPeeringsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string - // Parameter indicates the intention to sync the peering with the current address space on the remote vNet after it's updated. - SyncRemoteAddressSpace *SyncRemoteAddressSpace -} - -// VirtualNetworkPeeringsClientBeginDeleteOptions contains the optional parameters for the VirtualNetworkPeeringsClient.BeginDelete -// method. -type VirtualNetworkPeeringsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualNetworkPeeringsClientGetOptions contains the optional parameters for the VirtualNetworkPeeringsClient.Get method. -type VirtualNetworkPeeringsClientGetOptions struct { - // placeholder for future optional parameters -} - -// VirtualNetworkPeeringsClientListOptions contains the optional parameters for the VirtualNetworkPeeringsClient.List method. -type VirtualNetworkPeeringsClientListOptions struct { - // placeholder for future optional parameters -} - -// VirtualNetworkPropertiesFormat - Properties of the virtual network. -type VirtualNetworkPropertiesFormat struct { - // The AddressSpace that contains an array of IP address ranges that can be used by subnets. - AddressSpace *AddressSpace `json:"addressSpace,omitempty"` - - // Bgp Communities sent over ExpressRoute with each route corresponding to a prefix in this VNET. - BgpCommunities *VirtualNetworkBgpCommunities `json:"bgpCommunities,omitempty"` - - // The DDoS protection plan associated with the virtual network. - DdosProtectionPlan *SubResource `json:"ddosProtectionPlan,omitempty"` - - // The dhcpOptions that contains an array of DNS servers available to VMs deployed in the virtual network. - DhcpOptions *DhcpOptions `json:"dhcpOptions,omitempty"` - - // Indicates if DDoS protection is enabled for all the protected resources in the virtual network. It requires a DDoS protection - // plan associated with the resource. - EnableDdosProtection *bool `json:"enableDdosProtection,omitempty"` - - // Indicates if VM protection is enabled for all the subnets in the virtual network. - EnableVMProtection *bool `json:"enableVmProtection,omitempty"` - - // Indicates if encryption is enabled on virtual network and if VM without encryption is allowed in encrypted VNet. - Encryption *VirtualNetworkEncryption `json:"encryption,omitempty"` - - // The FlowTimeout value (in minutes) for the Virtual Network - FlowTimeoutInMinutes *int32 `json:"flowTimeoutInMinutes,omitempty"` - - // Array of IpAllocation which reference this VNET. - IPAllocations []*SubResource `json:"ipAllocations,omitempty"` - - // A list of subnets in a Virtual Network. - Subnets []*Subnet `json:"subnets,omitempty"` - - // A list of peerings in a Virtual Network. - VirtualNetworkPeerings []*VirtualNetworkPeering `json:"virtualNetworkPeerings,omitempty"` - - // READ-ONLY; The provisioning state of the virtual network resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` - - // READ-ONLY; The resourceGuid property of the Virtual Network resource. - ResourceGUID *string `json:"resourceGuid,omitempty" azure:"ro"` -} - -// VirtualNetworkTap - Virtual Network Tap resource. -type VirtualNetworkTap struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Resource location. - Location *string `json:"location,omitempty"` - - // Virtual Network Tap Properties. - Properties *VirtualNetworkTapPropertiesFormat `json:"properties,omitempty"` - - // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// VirtualNetworkTapListResult - Response for ListVirtualNetworkTap API service call. -type VirtualNetworkTapListResult struct { - // The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` - - // A list of VirtualNetworkTaps in a resource group. - Value []*VirtualNetworkTap `json:"value,omitempty"` -} - -// VirtualNetworkTapPropertiesFormat - Virtual Network Tap properties. -type VirtualNetworkTapPropertiesFormat struct { - // The reference to the private IP address on the internal Load Balancer that will receive the tap. - DestinationLoadBalancerFrontEndIPConfiguration *FrontendIPConfiguration `json:"destinationLoadBalancerFrontEndIPConfiguration,omitempty"` - - // The reference to the private IP Address of the collector nic that will receive the tap. - DestinationNetworkInterfaceIPConfiguration *InterfaceIPConfiguration `json:"destinationNetworkInterfaceIPConfiguration,omitempty"` - - // The VXLAN destination port that will receive the tapped traffic. - DestinationPort *int32 `json:"destinationPort,omitempty"` - - // READ-ONLY; Specifies the list of resource IDs for the network interface IP configuration that needs to be tapped. - NetworkInterfaceTapConfigurations []*InterfaceTapConfiguration `json:"networkInterfaceTapConfigurations,omitempty" azure:"ro"` - - // READ-ONLY; The provisioning state of the virtual network tap resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` - - // READ-ONLY; The resource GUID property of the virtual network tap resource. - ResourceGUID *string `json:"resourceGuid,omitempty" azure:"ro"` -} - -// VirtualNetworkTapsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualNetworkTapsClient.BeginCreateOrUpdate -// method. -type VirtualNetworkTapsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualNetworkTapsClientBeginDeleteOptions contains the optional parameters for the VirtualNetworkTapsClient.BeginDelete -// method. -type VirtualNetworkTapsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualNetworkTapsClientGetOptions contains the optional parameters for the VirtualNetworkTapsClient.Get method. -type VirtualNetworkTapsClientGetOptions struct { - // placeholder for future optional parameters -} - -// VirtualNetworkTapsClientListAllOptions contains the optional parameters for the VirtualNetworkTapsClient.ListAll method. -type VirtualNetworkTapsClientListAllOptions struct { - // placeholder for future optional parameters -} - -// VirtualNetworkTapsClientListByResourceGroupOptions contains the optional parameters for the VirtualNetworkTapsClient.ListByResourceGroup -// method. -type VirtualNetworkTapsClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// VirtualNetworkTapsClientUpdateTagsOptions contains the optional parameters for the VirtualNetworkTapsClient.UpdateTags -// method. -type VirtualNetworkTapsClientUpdateTagsOptions struct { - // placeholder for future optional parameters -} - -// VirtualNetworkUsage - Usage details for subnet. -type VirtualNetworkUsage struct { - // READ-ONLY; Indicates number of IPs used from the Subnet. - CurrentValue *float64 `json:"currentValue,omitempty" azure:"ro"` - - // READ-ONLY; Subnet identifier. - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; Indicates the size of the subnet. - Limit *float64 `json:"limit,omitempty" azure:"ro"` - - // READ-ONLY; The name containing common and localized value for usage. - Name *VirtualNetworkUsageName `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Usage units. Returns 'Count'. - Unit *string `json:"unit,omitempty" azure:"ro"` -} - -// VirtualNetworkUsageName - Usage strings container. -type VirtualNetworkUsageName struct { - // READ-ONLY; Localized subnet size and usage string. - LocalizedValue *string `json:"localizedValue,omitempty" azure:"ro"` - - // READ-ONLY; Subnet size and usage string. - Value *string `json:"value,omitempty" azure:"ro"` -} - -// VirtualNetworksClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualNetworksClient.BeginCreateOrUpdate -// method. -type VirtualNetworksClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualNetworksClientBeginDeleteOptions contains the optional parameters for the VirtualNetworksClient.BeginDelete method. -type VirtualNetworksClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualNetworksClientCheckIPAddressAvailabilityOptions contains the optional parameters for the VirtualNetworksClient.CheckIPAddressAvailability -// method. -type VirtualNetworksClientCheckIPAddressAvailabilityOptions struct { - // placeholder for future optional parameters -} - -// VirtualNetworksClientGetOptions contains the optional parameters for the VirtualNetworksClient.Get method. -type VirtualNetworksClientGetOptions struct { - // Expands referenced resources. - Expand *string -} - -// VirtualNetworksClientListAllOptions contains the optional parameters for the VirtualNetworksClient.ListAll method. -type VirtualNetworksClientListAllOptions struct { - // placeholder for future optional parameters -} - -// VirtualNetworksClientListOptions contains the optional parameters for the VirtualNetworksClient.List method. -type VirtualNetworksClientListOptions struct { - // placeholder for future optional parameters -} - -// VirtualNetworksClientListUsageOptions contains the optional parameters for the VirtualNetworksClient.ListUsage method. -type VirtualNetworksClientListUsageOptions struct { - // placeholder for future optional parameters -} - -// VirtualNetworksClientUpdateTagsOptions contains the optional parameters for the VirtualNetworksClient.UpdateTags method. -type VirtualNetworksClientUpdateTagsOptions struct { - // placeholder for future optional parameters -} - -// VirtualRouter Resource. -type VirtualRouter struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Resource location. - Location *string `json:"location,omitempty"` - - // Properties of the Virtual Router. - Properties *VirtualRouterPropertiesFormat `json:"properties,omitempty"` - - // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// VirtualRouterAutoScaleConfiguration - The VirtualHub Router autoscale configuration. -type VirtualRouterAutoScaleConfiguration struct { - // The minimum number of scale units for VirtualHub Router. - MinCapacity *int32 `json:"minCapacity,omitempty"` -} - -// VirtualRouterListResult - Response for ListVirtualRouters API service call. -type VirtualRouterListResult struct { - // URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` - - // List of Virtual Routers. - Value []*VirtualRouter `json:"value,omitempty"` -} - -// VirtualRouterPeering - Virtual Router Peering resource. -type VirtualRouterPeering struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Name of the virtual router peering that is unique within a virtual router. - Name *string `json:"name,omitempty"` - - // The properties of the Virtual Router Peering. - Properties *VirtualRouterPeeringProperties `json:"properties,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Peering type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// VirtualRouterPeeringListResult - Response for ListVirtualRouterPeerings API service call. -type VirtualRouterPeeringListResult struct { - // URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` - - // List of VirtualRouterPeerings in a VirtualRouter. - Value []*VirtualRouterPeering `json:"value,omitempty"` -} - -// VirtualRouterPeeringProperties - Properties of the rule group. -type VirtualRouterPeeringProperties struct { - // Peer ASN. - PeerAsn *int64 `json:"peerAsn,omitempty"` - - // Peer IP. - PeerIP *string `json:"peerIp,omitempty"` - - // READ-ONLY; The provisioning state of the resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// VirtualRouterPeeringsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualRouterPeeringsClient.BeginCreateOrUpdate -// method. -type VirtualRouterPeeringsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualRouterPeeringsClientBeginDeleteOptions contains the optional parameters for the VirtualRouterPeeringsClient.BeginDelete -// method. -type VirtualRouterPeeringsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualRouterPeeringsClientGetOptions contains the optional parameters for the VirtualRouterPeeringsClient.Get method. -type VirtualRouterPeeringsClientGetOptions struct { - // placeholder for future optional parameters -} - -// VirtualRouterPeeringsClientListOptions contains the optional parameters for the VirtualRouterPeeringsClient.List method. -type VirtualRouterPeeringsClientListOptions struct { - // placeholder for future optional parameters -} - -// VirtualRouterPropertiesFormat - Virtual Router definition. -type VirtualRouterPropertiesFormat struct { - // The Gateway on which VirtualRouter is hosted. - HostedGateway *SubResource `json:"hostedGateway,omitempty"` - - // The Subnet on which VirtualRouter is hosted. - HostedSubnet *SubResource `json:"hostedSubnet,omitempty"` - - // VirtualRouter ASN. - VirtualRouterAsn *int64 `json:"virtualRouterAsn,omitempty"` - - // VirtualRouter IPs. - VirtualRouterIPs []*string `json:"virtualRouterIps,omitempty"` - - // READ-ONLY; List of references to VirtualRouterPeerings. - Peerings []*SubResource `json:"peerings,omitempty" azure:"ro"` - - // READ-ONLY; The provisioning state of the resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// VirtualRoutersClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualRoutersClient.BeginCreateOrUpdate -// method. -type VirtualRoutersClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualRoutersClientBeginDeleteOptions contains the optional parameters for the VirtualRoutersClient.BeginDelete method. -type VirtualRoutersClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualRoutersClientGetOptions contains the optional parameters for the VirtualRoutersClient.Get method. -type VirtualRoutersClientGetOptions struct { - // Expands referenced resources. - Expand *string -} - -// VirtualRoutersClientListByResourceGroupOptions contains the optional parameters for the VirtualRoutersClient.ListByResourceGroup -// method. -type VirtualRoutersClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// VirtualRoutersClientListOptions contains the optional parameters for the VirtualRoutersClient.List method. -type VirtualRoutersClientListOptions struct { - // placeholder for future optional parameters -} - -// VirtualWAN Resource. -type VirtualWAN struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Resource location. - Location *string `json:"location,omitempty"` - - // Properties of the virtual WAN. - Properties *VirtualWanProperties `json:"properties,omitempty"` - - // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// VirtualWanProperties - Parameters for VirtualWAN. -type VirtualWanProperties struct { - // True if branch to branch traffic is allowed. - AllowBranchToBranchTraffic *bool `json:"allowBranchToBranchTraffic,omitempty"` - - // True if Vnet to Vnet traffic is allowed. - AllowVnetToVnetTraffic *bool `json:"allowVnetToVnetTraffic,omitempty"` - - // Vpn encryption to be disabled or not. - DisableVPNEncryption *bool `json:"disableVpnEncryption,omitempty"` - - // The type of the VirtualWAN. - Type *string `json:"type,omitempty"` - - // READ-ONLY; The office local breakout category. - Office365LocalBreakoutCategory *OfficeTrafficCategory `json:"office365LocalBreakoutCategory,omitempty" azure:"ro"` - - // READ-ONLY; The provisioning state of the virtual WAN resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` - - // READ-ONLY; List of VpnSites in the VirtualWAN. - VPNSites []*SubResource `json:"vpnSites,omitempty" azure:"ro"` - - // READ-ONLY; List of VirtualHubs in the VirtualWAN. - VirtualHubs []*SubResource `json:"virtualHubs,omitempty" azure:"ro"` -} - -// VirtualWanSecurityProvider - Collection of SecurityProviders. -type VirtualWanSecurityProvider struct { - // Name of the security provider. - Name *string `json:"name,omitempty"` - - // Url of the security provider. - URL *string `json:"url,omitempty"` - - // READ-ONLY; Name of the security provider. - Type *VirtualWanSecurityProviderType `json:"type,omitempty" azure:"ro"` -} - -// VirtualWanSecurityProviders - Collection of SecurityProviders. -type VirtualWanSecurityProviders struct { - // List of VirtualWAN security providers. - SupportedProviders []*VirtualWanSecurityProvider `json:"supportedProviders,omitempty"` -} - -// VirtualWanVPNProfileParameters - Virtual Wan Vpn profile parameters Vpn profile generation. -type VirtualWanVPNProfileParameters struct { - // VPN client authentication method. - AuthenticationMethod *AuthenticationMethod `json:"authenticationMethod,omitempty"` - - // VpnServerConfiguration partial resource uri with which VirtualWan is associated to. - VPNServerConfigurationResourceID *string `json:"vpnServerConfigurationResourceId,omitempty"` -} - -// VirtualWansClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualWansClient.BeginCreateOrUpdate -// method. -type VirtualWansClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualWansClientBeginDeleteOptions contains the optional parameters for the VirtualWansClient.BeginDelete method. -type VirtualWansClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualWansClientGetOptions contains the optional parameters for the VirtualWansClient.Get method. -type VirtualWansClientGetOptions struct { - // placeholder for future optional parameters -} - -// VirtualWansClientListByResourceGroupOptions contains the optional parameters for the VirtualWansClient.ListByResourceGroup -// method. -type VirtualWansClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// VirtualWansClientListOptions contains the optional parameters for the VirtualWansClient.List method. -type VirtualWansClientListOptions struct { - // placeholder for future optional parameters -} - -// VirtualWansClientUpdateTagsOptions contains the optional parameters for the VirtualWansClient.UpdateTags method. -type VirtualWansClientUpdateTagsOptions struct { - // placeholder for future optional parameters -} - -// VnetRoute - List of routes that control routing from VirtualHub into a virtual network connection. -type VnetRoute struct { - // List of all Static Routes. - StaticRoutes []*StaticRoute `json:"staticRoutes,omitempty"` - - // READ-ONLY; The list of references to HubBgpConnection objects. - BgpConnections []*SubResource `json:"bgpConnections,omitempty" azure:"ro"` -} - -// Watcher - Network watcher in a resource group. -type Watcher struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Resource location. - Location *string `json:"location,omitempty"` - - // Properties of the network watcher. - Properties *WatcherPropertiesFormat `json:"properties,omitempty"` - - // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// WatcherListResult - Response for ListNetworkWatchers API service call. -type WatcherListResult struct { - // List of network watcher resources. - Value []*Watcher `json:"value,omitempty"` -} - -// WatcherPropertiesFormat - The network watcher properties. -type WatcherPropertiesFormat struct { - // READ-ONLY; The provisioning state of the network watcher resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// WatchersClientBeginCheckConnectivityOptions contains the optional parameters for the WatchersClient.BeginCheckConnectivity -// method. -type WatchersClientBeginCheckConnectivityOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// WatchersClientBeginDeleteOptions contains the optional parameters for the WatchersClient.BeginDelete method. -type WatchersClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// WatchersClientBeginGetAzureReachabilityReportOptions contains the optional parameters for the WatchersClient.BeginGetAzureReachabilityReport -// method. -type WatchersClientBeginGetAzureReachabilityReportOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// WatchersClientBeginGetFlowLogStatusOptions contains the optional parameters for the WatchersClient.BeginGetFlowLogStatus -// method. -type WatchersClientBeginGetFlowLogStatusOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// WatchersClientBeginGetNetworkConfigurationDiagnosticOptions contains the optional parameters for the WatchersClient.BeginGetNetworkConfigurationDiagnostic -// method. -type WatchersClientBeginGetNetworkConfigurationDiagnosticOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// WatchersClientBeginGetNextHopOptions contains the optional parameters for the WatchersClient.BeginGetNextHop method. -type WatchersClientBeginGetNextHopOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// WatchersClientBeginGetTroubleshootingOptions contains the optional parameters for the WatchersClient.BeginGetTroubleshooting -// method. -type WatchersClientBeginGetTroubleshootingOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// WatchersClientBeginGetTroubleshootingResultOptions contains the optional parameters for the WatchersClient.BeginGetTroubleshootingResult -// method. -type WatchersClientBeginGetTroubleshootingResultOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// WatchersClientBeginGetVMSecurityRulesOptions contains the optional parameters for the WatchersClient.BeginGetVMSecurityRules -// method. -type WatchersClientBeginGetVMSecurityRulesOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// WatchersClientBeginListAvailableProvidersOptions contains the optional parameters for the WatchersClient.BeginListAvailableProviders -// method. -type WatchersClientBeginListAvailableProvidersOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// WatchersClientBeginSetFlowLogConfigurationOptions contains the optional parameters for the WatchersClient.BeginSetFlowLogConfiguration -// method. -type WatchersClientBeginSetFlowLogConfigurationOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// WatchersClientBeginVerifyIPFlowOptions contains the optional parameters for the WatchersClient.BeginVerifyIPFlow method. -type WatchersClientBeginVerifyIPFlowOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// WatchersClientCreateOrUpdateOptions contains the optional parameters for the WatchersClient.CreateOrUpdate method. -type WatchersClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// WatchersClientGetOptions contains the optional parameters for the WatchersClient.Get method. -type WatchersClientGetOptions struct { - // placeholder for future optional parameters -} - -// WatchersClientGetTopologyOptions contains the optional parameters for the WatchersClient.GetTopology method. -type WatchersClientGetTopologyOptions struct { - // placeholder for future optional parameters -} - -// WatchersClientListAllOptions contains the optional parameters for the WatchersClient.ListAll method. -type WatchersClientListAllOptions struct { - // placeholder for future optional parameters -} - -// WatchersClientListOptions contains the optional parameters for the WatchersClient.List method. -type WatchersClientListOptions struct { - // placeholder for future optional parameters -} - -// WatchersClientUpdateTagsOptions contains the optional parameters for the WatchersClient.UpdateTags method. -type WatchersClientUpdateTagsOptions struct { - // placeholder for future optional parameters -} - -// WebApplicationFirewallCustomRule - Defines contents of a web application rule. -type WebApplicationFirewallCustomRule struct { - // REQUIRED; Type of Actions. - Action *WebApplicationFirewallAction `json:"action,omitempty"` - - // REQUIRED; List of match conditions. - MatchConditions []*MatchCondition `json:"matchConditions,omitempty"` - - // REQUIRED; Priority of the rule. Rules with a lower value will be evaluated before rules with a higher value. - Priority *int32 `json:"priority,omitempty"` - - // REQUIRED; The rule type. - RuleType *WebApplicationFirewallRuleType `json:"ruleType,omitempty"` - - // The name of the resource that is unique within a policy. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` -} - -// WebApplicationFirewallPoliciesClientBeginDeleteOptions contains the optional parameters for the WebApplicationFirewallPoliciesClient.BeginDelete -// method. -type WebApplicationFirewallPoliciesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// WebApplicationFirewallPoliciesClientCreateOrUpdateOptions contains the optional parameters for the WebApplicationFirewallPoliciesClient.CreateOrUpdate -// method. -type WebApplicationFirewallPoliciesClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// WebApplicationFirewallPoliciesClientGetOptions contains the optional parameters for the WebApplicationFirewallPoliciesClient.Get -// method. -type WebApplicationFirewallPoliciesClientGetOptions struct { - // placeholder for future optional parameters -} - -// WebApplicationFirewallPoliciesClientListAllOptions contains the optional parameters for the WebApplicationFirewallPoliciesClient.ListAll -// method. -type WebApplicationFirewallPoliciesClientListAllOptions struct { - // placeholder for future optional parameters -} - -// WebApplicationFirewallPoliciesClientListOptions contains the optional parameters for the WebApplicationFirewallPoliciesClient.List -// method. -type WebApplicationFirewallPoliciesClientListOptions struct { - // placeholder for future optional parameters -} - -// WebApplicationFirewallPolicy - Defines web application firewall policy. -type WebApplicationFirewallPolicy struct { - // Resource ID. - ID *string `json:"id,omitempty"` - - // Resource location. - Location *string `json:"location,omitempty"` - - // Properties of the web application firewall policy. - Properties *WebApplicationFirewallPolicyPropertiesFormat `json:"properties,omitempty"` - - // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// WebApplicationFirewallPolicyListResult - Result of the request to list WebApplicationFirewallPolicies. It contains a list -// of WebApplicationFirewallPolicy objects and a URL link to get the next set of results. -type WebApplicationFirewallPolicyListResult struct { - // READ-ONLY; URL to get the next set of WebApplicationFirewallPolicy objects if there are any. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` - - // READ-ONLY; List of WebApplicationFirewallPolicies within a resource group. - Value []*WebApplicationFirewallPolicy `json:"value,omitempty" azure:"ro"` -} - -// WebApplicationFirewallPolicyPropertiesFormat - Defines web application firewall policy properties. -type WebApplicationFirewallPolicyPropertiesFormat struct { - // REQUIRED; Describes the managedRules structure. - ManagedRules *ManagedRulesDefinition `json:"managedRules,omitempty"` - - // The custom rules inside the policy. - CustomRules []*WebApplicationFirewallCustomRule `json:"customRules,omitempty"` - - // The PolicySettings for policy. - PolicySettings *PolicySettings `json:"policySettings,omitempty"` - - // READ-ONLY; A collection of references to application gateways. - ApplicationGateways []*ApplicationGateway `json:"applicationGateways,omitempty" azure:"ro"` - - // READ-ONLY; A collection of references to application gateway http listeners. - HTTPListeners []*SubResource `json:"httpListeners,omitempty" azure:"ro"` - - // READ-ONLY; A collection of references to application gateway path rules. - PathBasedRules []*SubResource `json:"pathBasedRules,omitempty" azure:"ro"` - - // READ-ONLY; The provisioning state of the web application firewall policy resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` - - // READ-ONLY; Resource status of the policy. - ResourceState *WebApplicationFirewallPolicyResourceState `json:"resourceState,omitempty" azure:"ro"` -} - -// WebCategoriesClientGetOptions contains the optional parameters for the WebCategoriesClient.Get method. -type WebCategoriesClientGetOptions struct { - // Expands resourceIds back referenced by the azureWebCategory resource. - Expand *string -} - -// WebCategoriesClientListBySubscriptionOptions contains the optional parameters for the WebCategoriesClient.ListBySubscription -// method. -type WebCategoriesClientListBySubscriptionOptions struct { - // placeholder for future optional parameters -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/models_serde.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/models_serde.go deleted file mode 100644 index 3702a5a7..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/models_serde.go +++ /dev/null @@ -1,32651 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" -) - -// MarshalJSON implements the json.Marshaller interface for type AADAuthenticationParameters. -func (a AADAuthenticationParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "aadAudience", a.AADAudience) - populate(objectMap, "aadIssuer", a.AADIssuer) - populate(objectMap, "aadTenant", a.AADTenant) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AADAuthenticationParameters. -func (a *AADAuthenticationParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "aadAudience": - err = unpopulate(val, "AADAudience", &a.AADAudience) - delete(rawMsg, key) - case "aadIssuer": - err = unpopulate(val, "AADIssuer", &a.AADIssuer) - delete(rawMsg, key) - case "aadTenant": - err = unpopulate(val, "AADTenant", &a.AADTenant) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ActiveBaseSecurityAdminRule. -func (a ActiveBaseSecurityAdminRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "commitTime", a.CommitTime) - populate(objectMap, "configurationDescription", a.ConfigurationDescription) - populate(objectMap, "id", a.ID) - objectMap["kind"] = a.Kind - populate(objectMap, "region", a.Region) - populate(objectMap, "ruleCollectionAppliesToGroups", a.RuleCollectionAppliesToGroups) - populate(objectMap, "ruleCollectionDescription", a.RuleCollectionDescription) - populate(objectMap, "ruleGroups", a.RuleGroups) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ActiveBaseSecurityAdminRule. -func (a *ActiveBaseSecurityAdminRule) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "commitTime": - err = unpopulateTimeRFC3339(val, "CommitTime", &a.CommitTime) - delete(rawMsg, key) - case "configurationDescription": - err = unpopulate(val, "ConfigurationDescription", &a.ConfigurationDescription) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &a.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &a.Kind) - delete(rawMsg, key) - case "region": - err = unpopulate(val, "Region", &a.Region) - delete(rawMsg, key) - case "ruleCollectionAppliesToGroups": - err = unpopulate(val, "RuleCollectionAppliesToGroups", &a.RuleCollectionAppliesToGroups) - delete(rawMsg, key) - case "ruleCollectionDescription": - err = unpopulate(val, "RuleCollectionDescription", &a.RuleCollectionDescription) - delete(rawMsg, key) - case "ruleGroups": - err = unpopulate(val, "RuleGroups", &a.RuleGroups) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ActiveConfigurationParameter. -func (a ActiveConfigurationParameter) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "regions", a.Regions) - populate(objectMap, "skipToken", a.SkipToken) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ActiveConfigurationParameter. -func (a *ActiveConfigurationParameter) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "regions": - err = unpopulate(val, "Regions", &a.Regions) - delete(rawMsg, key) - case "skipToken": - err = unpopulate(val, "SkipToken", &a.SkipToken) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ActiveConnectivityConfiguration. -func (a ActiveConnectivityConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "commitTime", a.CommitTime) - populate(objectMap, "configurationGroups", a.ConfigurationGroups) - populate(objectMap, "id", a.ID) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "region", a.Region) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ActiveConnectivityConfiguration. -func (a *ActiveConnectivityConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "commitTime": - err = unpopulateTimeRFC3339(val, "CommitTime", &a.CommitTime) - delete(rawMsg, key) - case "configurationGroups": - err = unpopulate(val, "ConfigurationGroups", &a.ConfigurationGroups) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &a.ID) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - case "region": - err = unpopulate(val, "Region", &a.Region) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ActiveConnectivityConfigurationsListResult. -func (a ActiveConnectivityConfigurationsListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "skipToken", a.SkipToken) - populate(objectMap, "value", a.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ActiveConnectivityConfigurationsListResult. -func (a *ActiveConnectivityConfigurationsListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "skipToken": - err = unpopulate(val, "SkipToken", &a.SkipToken) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &a.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ActiveDefaultSecurityAdminRule. -func (a ActiveDefaultSecurityAdminRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "commitTime", a.CommitTime) - populate(objectMap, "configurationDescription", a.ConfigurationDescription) - populate(objectMap, "id", a.ID) - objectMap["kind"] = EffectiveAdminRuleKindDefault - populate(objectMap, "properties", a.Properties) - populate(objectMap, "region", a.Region) - populate(objectMap, "ruleCollectionAppliesToGroups", a.RuleCollectionAppliesToGroups) - populate(objectMap, "ruleCollectionDescription", a.RuleCollectionDescription) - populate(objectMap, "ruleGroups", a.RuleGroups) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ActiveDefaultSecurityAdminRule. -func (a *ActiveDefaultSecurityAdminRule) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "commitTime": - err = unpopulateTimeRFC3339(val, "CommitTime", &a.CommitTime) - delete(rawMsg, key) - case "configurationDescription": - err = unpopulate(val, "ConfigurationDescription", &a.ConfigurationDescription) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &a.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &a.Kind) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - case "region": - err = unpopulate(val, "Region", &a.Region) - delete(rawMsg, key) - case "ruleCollectionAppliesToGroups": - err = unpopulate(val, "RuleCollectionAppliesToGroups", &a.RuleCollectionAppliesToGroups) - delete(rawMsg, key) - case "ruleCollectionDescription": - err = unpopulate(val, "RuleCollectionDescription", &a.RuleCollectionDescription) - delete(rawMsg, key) - case "ruleGroups": - err = unpopulate(val, "RuleGroups", &a.RuleGroups) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ActiveSecurityAdminRule. -func (a ActiveSecurityAdminRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "commitTime", a.CommitTime) - populate(objectMap, "configurationDescription", a.ConfigurationDescription) - populate(objectMap, "id", a.ID) - objectMap["kind"] = EffectiveAdminRuleKindCustom - populate(objectMap, "properties", a.Properties) - populate(objectMap, "region", a.Region) - populate(objectMap, "ruleCollectionAppliesToGroups", a.RuleCollectionAppliesToGroups) - populate(objectMap, "ruleCollectionDescription", a.RuleCollectionDescription) - populate(objectMap, "ruleGroups", a.RuleGroups) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ActiveSecurityAdminRule. -func (a *ActiveSecurityAdminRule) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "commitTime": - err = unpopulateTimeRFC3339(val, "CommitTime", &a.CommitTime) - delete(rawMsg, key) - case "configurationDescription": - err = unpopulate(val, "ConfigurationDescription", &a.ConfigurationDescription) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &a.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &a.Kind) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - case "region": - err = unpopulate(val, "Region", &a.Region) - delete(rawMsg, key) - case "ruleCollectionAppliesToGroups": - err = unpopulate(val, "RuleCollectionAppliesToGroups", &a.RuleCollectionAppliesToGroups) - delete(rawMsg, key) - case "ruleCollectionDescription": - err = unpopulate(val, "RuleCollectionDescription", &a.RuleCollectionDescription) - delete(rawMsg, key) - case "ruleGroups": - err = unpopulate(val, "RuleGroups", &a.RuleGroups) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ActiveSecurityAdminRulesListResult. -func (a ActiveSecurityAdminRulesListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "skipToken", a.SkipToken) - populate(objectMap, "value", a.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ActiveSecurityAdminRulesListResult. -func (a *ActiveSecurityAdminRulesListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "skipToken": - err = unpopulate(val, "SkipToken", &a.SkipToken) - delete(rawMsg, key) - case "value": - a.Value, err = unmarshalActiveBaseSecurityAdminRuleClassificationArray(val) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AddressPrefixItem. -func (a AddressPrefixItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "addressPrefix", a.AddressPrefix) - populate(objectMap, "addressPrefixType", a.AddressPrefixType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AddressPrefixItem. -func (a *AddressPrefixItem) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "addressPrefix": - err = unpopulate(val, "AddressPrefix", &a.AddressPrefix) - delete(rawMsg, key) - case "addressPrefixType": - err = unpopulate(val, "AddressPrefixType", &a.AddressPrefixType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AddressSpace. -func (a AddressSpace) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "addressPrefixes", a.AddressPrefixes) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AddressSpace. -func (a *AddressSpace) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "addressPrefixes": - err = unpopulate(val, "AddressPrefixes", &a.AddressPrefixes) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AdminPropertiesFormat. -func (a AdminPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "access", a.Access) - populate(objectMap, "description", a.Description) - populate(objectMap, "destinationPortRanges", a.DestinationPortRanges) - populate(objectMap, "destinations", a.Destinations) - populate(objectMap, "direction", a.Direction) - populate(objectMap, "priority", a.Priority) - populate(objectMap, "protocol", a.Protocol) - populate(objectMap, "provisioningState", a.ProvisioningState) - populate(objectMap, "sourcePortRanges", a.SourcePortRanges) - populate(objectMap, "sources", a.Sources) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AdminPropertiesFormat. -func (a *AdminPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "access": - err = unpopulate(val, "Access", &a.Access) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &a.Description) - delete(rawMsg, key) - case "destinationPortRanges": - err = unpopulate(val, "DestinationPortRanges", &a.DestinationPortRanges) - delete(rawMsg, key) - case "destinations": - err = unpopulate(val, "Destinations", &a.Destinations) - delete(rawMsg, key) - case "direction": - err = unpopulate(val, "Direction", &a.Direction) - delete(rawMsg, key) - case "priority": - err = unpopulate(val, "Priority", &a.Priority) - delete(rawMsg, key) - case "protocol": - err = unpopulate(val, "Protocol", &a.Protocol) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) - delete(rawMsg, key) - case "sourcePortRanges": - err = unpopulate(val, "SourcePortRanges", &a.SourcePortRanges) - delete(rawMsg, key) - case "sources": - err = unpopulate(val, "Sources", &a.Sources) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AdminRule. -func (a AdminRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", a.Etag) - populate(objectMap, "id", a.ID) - objectMap["kind"] = AdminRuleKindCustom - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "systemData", a.SystemData) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AdminRule. -func (a *AdminRule) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &a.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &a.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &a.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &a.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AdminRuleCollection. -func (a AdminRuleCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", a.Etag) - populate(objectMap, "id", a.ID) - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "systemData", a.SystemData) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AdminRuleCollection. -func (a *AdminRuleCollection) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &a.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &a.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &a.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AdminRuleCollectionListResult. -func (a AdminRuleCollectionListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", a.NextLink) - populate(objectMap, "value", a.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AdminRuleCollectionListResult. -func (a *AdminRuleCollectionListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &a.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &a.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AdminRuleCollectionPropertiesFormat. -func (a AdminRuleCollectionPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "appliesToGroups", a.AppliesToGroups) - populate(objectMap, "description", a.Description) - populate(objectMap, "provisioningState", a.ProvisioningState) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AdminRuleCollectionPropertiesFormat. -func (a *AdminRuleCollectionPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "appliesToGroups": - err = unpopulate(val, "AppliesToGroups", &a.AppliesToGroups) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &a.Description) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AdminRuleListResult. -func (a AdminRuleListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", a.NextLink) - populate(objectMap, "value", a.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AdminRuleListResult. -func (a *AdminRuleListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &a.NextLink) - delete(rawMsg, key) - case "value": - a.Value, err = unmarshalBaseAdminRuleClassificationArray(val) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGateway. -func (a ApplicationGateway) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", a.Etag) - populate(objectMap, "id", a.ID) - populate(objectMap, "identity", a.Identity) - populate(objectMap, "location", a.Location) - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "tags", a.Tags) - populate(objectMap, "type", a.Type) - populate(objectMap, "zones", a.Zones) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGateway. -func (a *ApplicationGateway) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &a.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &a.ID) - delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &a.Identity) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &a.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &a.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) - delete(rawMsg, key) - case "zones": - err = unpopulate(val, "Zones", &a.Zones) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayAuthenticationCertificate. -func (a ApplicationGatewayAuthenticationCertificate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", a.Etag) - populate(objectMap, "id", a.ID) - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayAuthenticationCertificate. -func (a *ApplicationGatewayAuthenticationCertificate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &a.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &a.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayAuthenticationCertificatePropertiesFormat. -func (a ApplicationGatewayAuthenticationCertificatePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "data", a.Data) - populate(objectMap, "provisioningState", a.ProvisioningState) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayAuthenticationCertificatePropertiesFormat. -func (a *ApplicationGatewayAuthenticationCertificatePropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "data": - err = unpopulate(val, "Data", &a.Data) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayAutoscaleConfiguration. -func (a ApplicationGatewayAutoscaleConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "maxCapacity", a.MaxCapacity) - populate(objectMap, "minCapacity", a.MinCapacity) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayAutoscaleConfiguration. -func (a *ApplicationGatewayAutoscaleConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "maxCapacity": - err = unpopulate(val, "MaxCapacity", &a.MaxCapacity) - delete(rawMsg, key) - case "minCapacity": - err = unpopulate(val, "MinCapacity", &a.MinCapacity) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayAvailableSSLOptions. -func (a ApplicationGatewayAvailableSSLOptions) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", a.ID) - populate(objectMap, "location", a.Location) - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "tags", a.Tags) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayAvailableSSLOptions. -func (a *ApplicationGatewayAvailableSSLOptions) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &a.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &a.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &a.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayAvailableSSLOptionsPropertiesFormat. -func (a ApplicationGatewayAvailableSSLOptionsPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "availableCipherSuites", a.AvailableCipherSuites) - populate(objectMap, "availableProtocols", a.AvailableProtocols) - populate(objectMap, "defaultPolicy", a.DefaultPolicy) - populate(objectMap, "predefinedPolicies", a.PredefinedPolicies) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayAvailableSSLOptionsPropertiesFormat. -func (a *ApplicationGatewayAvailableSSLOptionsPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "availableCipherSuites": - err = unpopulate(val, "AvailableCipherSuites", &a.AvailableCipherSuites) - delete(rawMsg, key) - case "availableProtocols": - err = unpopulate(val, "AvailableProtocols", &a.AvailableProtocols) - delete(rawMsg, key) - case "defaultPolicy": - err = unpopulate(val, "DefaultPolicy", &a.DefaultPolicy) - delete(rawMsg, key) - case "predefinedPolicies": - err = unpopulate(val, "PredefinedPolicies", &a.PredefinedPolicies) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayAvailableSSLPredefinedPolicies. -func (a ApplicationGatewayAvailableSSLPredefinedPolicies) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", a.NextLink) - populate(objectMap, "value", a.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayAvailableSSLPredefinedPolicies. -func (a *ApplicationGatewayAvailableSSLPredefinedPolicies) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &a.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &a.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayAvailableWafRuleSetsResult. -func (a ApplicationGatewayAvailableWafRuleSetsResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "value", a.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayAvailableWafRuleSetsResult. -func (a *ApplicationGatewayAvailableWafRuleSetsResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "value": - err = unpopulate(val, "Value", &a.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayBackendAddress. -func (a ApplicationGatewayBackendAddress) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "fqdn", a.Fqdn) - populate(objectMap, "ipAddress", a.IPAddress) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayBackendAddress. -func (a *ApplicationGatewayBackendAddress) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "fqdn": - err = unpopulate(val, "Fqdn", &a.Fqdn) - delete(rawMsg, key) - case "ipAddress": - err = unpopulate(val, "IPAddress", &a.IPAddress) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayBackendAddressPool. -func (a ApplicationGatewayBackendAddressPool) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", a.Etag) - populate(objectMap, "id", a.ID) - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayBackendAddressPool. -func (a *ApplicationGatewayBackendAddressPool) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &a.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &a.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayBackendAddressPoolPropertiesFormat. -func (a ApplicationGatewayBackendAddressPoolPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "backendAddresses", a.BackendAddresses) - populate(objectMap, "backendIPConfigurations", a.BackendIPConfigurations) - populate(objectMap, "provisioningState", a.ProvisioningState) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayBackendAddressPoolPropertiesFormat. -func (a *ApplicationGatewayBackendAddressPoolPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "backendAddresses": - err = unpopulate(val, "BackendAddresses", &a.BackendAddresses) - delete(rawMsg, key) - case "backendIPConfigurations": - err = unpopulate(val, "BackendIPConfigurations", &a.BackendIPConfigurations) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayBackendHTTPSettings. -func (a ApplicationGatewayBackendHTTPSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", a.Etag) - populate(objectMap, "id", a.ID) - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayBackendHTTPSettings. -func (a *ApplicationGatewayBackendHTTPSettings) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &a.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &a.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayBackendHTTPSettingsPropertiesFormat. -func (a ApplicationGatewayBackendHTTPSettingsPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "affinityCookieName", a.AffinityCookieName) - populate(objectMap, "authenticationCertificates", a.AuthenticationCertificates) - populate(objectMap, "connectionDraining", a.ConnectionDraining) - populate(objectMap, "cookieBasedAffinity", a.CookieBasedAffinity) - populate(objectMap, "hostName", a.HostName) - populate(objectMap, "path", a.Path) - populate(objectMap, "pickHostNameFromBackendAddress", a.PickHostNameFromBackendAddress) - populate(objectMap, "port", a.Port) - populate(objectMap, "probe", a.Probe) - populate(objectMap, "probeEnabled", a.ProbeEnabled) - populate(objectMap, "protocol", a.Protocol) - populate(objectMap, "provisioningState", a.ProvisioningState) - populate(objectMap, "requestTimeout", a.RequestTimeout) - populate(objectMap, "trustedRootCertificates", a.TrustedRootCertificates) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayBackendHTTPSettingsPropertiesFormat. -func (a *ApplicationGatewayBackendHTTPSettingsPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "affinityCookieName": - err = unpopulate(val, "AffinityCookieName", &a.AffinityCookieName) - delete(rawMsg, key) - case "authenticationCertificates": - err = unpopulate(val, "AuthenticationCertificates", &a.AuthenticationCertificates) - delete(rawMsg, key) - case "connectionDraining": - err = unpopulate(val, "ConnectionDraining", &a.ConnectionDraining) - delete(rawMsg, key) - case "cookieBasedAffinity": - err = unpopulate(val, "CookieBasedAffinity", &a.CookieBasedAffinity) - delete(rawMsg, key) - case "hostName": - err = unpopulate(val, "HostName", &a.HostName) - delete(rawMsg, key) - case "path": - err = unpopulate(val, "Path", &a.Path) - delete(rawMsg, key) - case "pickHostNameFromBackendAddress": - err = unpopulate(val, "PickHostNameFromBackendAddress", &a.PickHostNameFromBackendAddress) - delete(rawMsg, key) - case "port": - err = unpopulate(val, "Port", &a.Port) - delete(rawMsg, key) - case "probe": - err = unpopulate(val, "Probe", &a.Probe) - delete(rawMsg, key) - case "probeEnabled": - err = unpopulate(val, "ProbeEnabled", &a.ProbeEnabled) - delete(rawMsg, key) - case "protocol": - err = unpopulate(val, "Protocol", &a.Protocol) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) - delete(rawMsg, key) - case "requestTimeout": - err = unpopulate(val, "RequestTimeout", &a.RequestTimeout) - delete(rawMsg, key) - case "trustedRootCertificates": - err = unpopulate(val, "TrustedRootCertificates", &a.TrustedRootCertificates) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayBackendHealth. -func (a ApplicationGatewayBackendHealth) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "backendAddressPools", a.BackendAddressPools) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayBackendHealth. -func (a *ApplicationGatewayBackendHealth) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "backendAddressPools": - err = unpopulate(val, "BackendAddressPools", &a.BackendAddressPools) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayBackendHealthHTTPSettings. -func (a ApplicationGatewayBackendHealthHTTPSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "backendHttpSettings", a.BackendHTTPSettings) - populate(objectMap, "servers", a.Servers) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayBackendHealthHTTPSettings. -func (a *ApplicationGatewayBackendHealthHTTPSettings) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "backendHttpSettings": - err = unpopulate(val, "BackendHTTPSettings", &a.BackendHTTPSettings) - delete(rawMsg, key) - case "servers": - err = unpopulate(val, "Servers", &a.Servers) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayBackendHealthOnDemand. -func (a ApplicationGatewayBackendHealthOnDemand) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "backendAddressPool", a.BackendAddressPool) - populate(objectMap, "backendHealthHttpSettings", a.BackendHealthHTTPSettings) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayBackendHealthOnDemand. -func (a *ApplicationGatewayBackendHealthOnDemand) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "backendAddressPool": - err = unpopulate(val, "BackendAddressPool", &a.BackendAddressPool) - delete(rawMsg, key) - case "backendHealthHttpSettings": - err = unpopulate(val, "BackendHealthHTTPSettings", &a.BackendHealthHTTPSettings) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayBackendHealthPool. -func (a ApplicationGatewayBackendHealthPool) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "backendAddressPool", a.BackendAddressPool) - populate(objectMap, "backendHttpSettingsCollection", a.BackendHTTPSettingsCollection) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayBackendHealthPool. -func (a *ApplicationGatewayBackendHealthPool) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "backendAddressPool": - err = unpopulate(val, "BackendAddressPool", &a.BackendAddressPool) - delete(rawMsg, key) - case "backendHttpSettingsCollection": - err = unpopulate(val, "BackendHTTPSettingsCollection", &a.BackendHTTPSettingsCollection) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayBackendHealthServer. -func (a ApplicationGatewayBackendHealthServer) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "address", a.Address) - populate(objectMap, "health", a.Health) - populate(objectMap, "healthProbeLog", a.HealthProbeLog) - populate(objectMap, "ipConfiguration", a.IPConfiguration) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayBackendHealthServer. -func (a *ApplicationGatewayBackendHealthServer) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "address": - err = unpopulate(val, "Address", &a.Address) - delete(rawMsg, key) - case "health": - err = unpopulate(val, "Health", &a.Health) - delete(rawMsg, key) - case "healthProbeLog": - err = unpopulate(val, "HealthProbeLog", &a.HealthProbeLog) - delete(rawMsg, key) - case "ipConfiguration": - err = unpopulate(val, "IPConfiguration", &a.IPConfiguration) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayBackendSettings. -func (a ApplicationGatewayBackendSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", a.Etag) - populate(objectMap, "id", a.ID) - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayBackendSettings. -func (a *ApplicationGatewayBackendSettings) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &a.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &a.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayBackendSettingsPropertiesFormat. -func (a ApplicationGatewayBackendSettingsPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "hostName", a.HostName) - populate(objectMap, "pickHostNameFromBackendAddress", a.PickHostNameFromBackendAddress) - populate(objectMap, "port", a.Port) - populate(objectMap, "probe", a.Probe) - populate(objectMap, "protocol", a.Protocol) - populate(objectMap, "provisioningState", a.ProvisioningState) - populate(objectMap, "timeout", a.Timeout) - populate(objectMap, "trustedRootCertificates", a.TrustedRootCertificates) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayBackendSettingsPropertiesFormat. -func (a *ApplicationGatewayBackendSettingsPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "hostName": - err = unpopulate(val, "HostName", &a.HostName) - delete(rawMsg, key) - case "pickHostNameFromBackendAddress": - err = unpopulate(val, "PickHostNameFromBackendAddress", &a.PickHostNameFromBackendAddress) - delete(rawMsg, key) - case "port": - err = unpopulate(val, "Port", &a.Port) - delete(rawMsg, key) - case "probe": - err = unpopulate(val, "Probe", &a.Probe) - delete(rawMsg, key) - case "protocol": - err = unpopulate(val, "Protocol", &a.Protocol) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) - delete(rawMsg, key) - case "timeout": - err = unpopulate(val, "Timeout", &a.Timeout) - delete(rawMsg, key) - case "trustedRootCertificates": - err = unpopulate(val, "TrustedRootCertificates", &a.TrustedRootCertificates) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayClientAuthConfiguration. -func (a ApplicationGatewayClientAuthConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "verifyClientCertIssuerDN", a.VerifyClientCertIssuerDN) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayClientAuthConfiguration. -func (a *ApplicationGatewayClientAuthConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "verifyClientCertIssuerDN": - err = unpopulate(val, "VerifyClientCertIssuerDN", &a.VerifyClientCertIssuerDN) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayConnectionDraining. -func (a ApplicationGatewayConnectionDraining) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "drainTimeoutInSec", a.DrainTimeoutInSec) - populate(objectMap, "enabled", a.Enabled) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayConnectionDraining. -func (a *ApplicationGatewayConnectionDraining) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "drainTimeoutInSec": - err = unpopulate(val, "DrainTimeoutInSec", &a.DrainTimeoutInSec) - delete(rawMsg, key) - case "enabled": - err = unpopulate(val, "Enabled", &a.Enabled) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayCustomError. -func (a ApplicationGatewayCustomError) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "customErrorPageUrl", a.CustomErrorPageURL) - populate(objectMap, "statusCode", a.StatusCode) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayCustomError. -func (a *ApplicationGatewayCustomError) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "customErrorPageUrl": - err = unpopulate(val, "CustomErrorPageURL", &a.CustomErrorPageURL) - delete(rawMsg, key) - case "statusCode": - err = unpopulate(val, "StatusCode", &a.StatusCode) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayFirewallDisabledRuleGroup. -func (a ApplicationGatewayFirewallDisabledRuleGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "ruleGroupName", a.RuleGroupName) - populate(objectMap, "rules", a.Rules) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayFirewallDisabledRuleGroup. -func (a *ApplicationGatewayFirewallDisabledRuleGroup) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "ruleGroupName": - err = unpopulate(val, "RuleGroupName", &a.RuleGroupName) - delete(rawMsg, key) - case "rules": - err = unpopulate(val, "Rules", &a.Rules) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayFirewallExclusion. -func (a ApplicationGatewayFirewallExclusion) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "matchVariable", a.MatchVariable) - populate(objectMap, "selector", a.Selector) - populate(objectMap, "selectorMatchOperator", a.SelectorMatchOperator) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayFirewallExclusion. -func (a *ApplicationGatewayFirewallExclusion) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "matchVariable": - err = unpopulate(val, "MatchVariable", &a.MatchVariable) - delete(rawMsg, key) - case "selector": - err = unpopulate(val, "Selector", &a.Selector) - delete(rawMsg, key) - case "selectorMatchOperator": - err = unpopulate(val, "SelectorMatchOperator", &a.SelectorMatchOperator) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayFirewallRule. -func (a ApplicationGatewayFirewallRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "description", a.Description) - populate(objectMap, "ruleId", a.RuleID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayFirewallRule. -func (a *ApplicationGatewayFirewallRule) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "description": - err = unpopulate(val, "Description", &a.Description) - delete(rawMsg, key) - case "ruleId": - err = unpopulate(val, "RuleID", &a.RuleID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayFirewallRuleGroup. -func (a ApplicationGatewayFirewallRuleGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "description", a.Description) - populate(objectMap, "ruleGroupName", a.RuleGroupName) - populate(objectMap, "rules", a.Rules) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayFirewallRuleGroup. -func (a *ApplicationGatewayFirewallRuleGroup) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "description": - err = unpopulate(val, "Description", &a.Description) - delete(rawMsg, key) - case "ruleGroupName": - err = unpopulate(val, "RuleGroupName", &a.RuleGroupName) - delete(rawMsg, key) - case "rules": - err = unpopulate(val, "Rules", &a.Rules) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayFirewallRuleSet. -func (a ApplicationGatewayFirewallRuleSet) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", a.ID) - populate(objectMap, "location", a.Location) - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "tags", a.Tags) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayFirewallRuleSet. -func (a *ApplicationGatewayFirewallRuleSet) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &a.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &a.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &a.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayFirewallRuleSetPropertiesFormat. -func (a ApplicationGatewayFirewallRuleSetPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "provisioningState", a.ProvisioningState) - populate(objectMap, "ruleGroups", a.RuleGroups) - populate(objectMap, "ruleSetType", a.RuleSetType) - populate(objectMap, "ruleSetVersion", a.RuleSetVersion) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayFirewallRuleSetPropertiesFormat. -func (a *ApplicationGatewayFirewallRuleSetPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) - delete(rawMsg, key) - case "ruleGroups": - err = unpopulate(val, "RuleGroups", &a.RuleGroups) - delete(rawMsg, key) - case "ruleSetType": - err = unpopulate(val, "RuleSetType", &a.RuleSetType) - delete(rawMsg, key) - case "ruleSetVersion": - err = unpopulate(val, "RuleSetVersion", &a.RuleSetVersion) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayFrontendIPConfiguration. -func (a ApplicationGatewayFrontendIPConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", a.Etag) - populate(objectMap, "id", a.ID) - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayFrontendIPConfiguration. -func (a *ApplicationGatewayFrontendIPConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &a.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &a.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayFrontendIPConfigurationPropertiesFormat. -func (a ApplicationGatewayFrontendIPConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "privateIPAddress", a.PrivateIPAddress) - populate(objectMap, "privateIPAllocationMethod", a.PrivateIPAllocationMethod) - populate(objectMap, "privateLinkConfiguration", a.PrivateLinkConfiguration) - populate(objectMap, "provisioningState", a.ProvisioningState) - populate(objectMap, "publicIPAddress", a.PublicIPAddress) - populate(objectMap, "subnet", a.Subnet) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayFrontendIPConfigurationPropertiesFormat. -func (a *ApplicationGatewayFrontendIPConfigurationPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "privateIPAddress": - err = unpopulate(val, "PrivateIPAddress", &a.PrivateIPAddress) - delete(rawMsg, key) - case "privateIPAllocationMethod": - err = unpopulate(val, "PrivateIPAllocationMethod", &a.PrivateIPAllocationMethod) - delete(rawMsg, key) - case "privateLinkConfiguration": - err = unpopulate(val, "PrivateLinkConfiguration", &a.PrivateLinkConfiguration) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) - delete(rawMsg, key) - case "publicIPAddress": - err = unpopulate(val, "PublicIPAddress", &a.PublicIPAddress) - delete(rawMsg, key) - case "subnet": - err = unpopulate(val, "Subnet", &a.Subnet) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayFrontendPort. -func (a ApplicationGatewayFrontendPort) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", a.Etag) - populate(objectMap, "id", a.ID) - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayFrontendPort. -func (a *ApplicationGatewayFrontendPort) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &a.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &a.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayFrontendPortPropertiesFormat. -func (a ApplicationGatewayFrontendPortPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "port", a.Port) - populate(objectMap, "provisioningState", a.ProvisioningState) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayFrontendPortPropertiesFormat. -func (a *ApplicationGatewayFrontendPortPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "port": - err = unpopulate(val, "Port", &a.Port) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayGlobalConfiguration. -func (a ApplicationGatewayGlobalConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "enableRequestBuffering", a.EnableRequestBuffering) - populate(objectMap, "enableResponseBuffering", a.EnableResponseBuffering) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayGlobalConfiguration. -func (a *ApplicationGatewayGlobalConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "enableRequestBuffering": - err = unpopulate(val, "EnableRequestBuffering", &a.EnableRequestBuffering) - delete(rawMsg, key) - case "enableResponseBuffering": - err = unpopulate(val, "EnableResponseBuffering", &a.EnableResponseBuffering) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayHTTPListener. -func (a ApplicationGatewayHTTPListener) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", a.Etag) - populate(objectMap, "id", a.ID) - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayHTTPListener. -func (a *ApplicationGatewayHTTPListener) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &a.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &a.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayHTTPListenerPropertiesFormat. -func (a ApplicationGatewayHTTPListenerPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "customErrorConfigurations", a.CustomErrorConfigurations) - populate(objectMap, "firewallPolicy", a.FirewallPolicy) - populate(objectMap, "frontendIPConfiguration", a.FrontendIPConfiguration) - populate(objectMap, "frontendPort", a.FrontendPort) - populate(objectMap, "hostName", a.HostName) - populate(objectMap, "hostNames", a.HostNames) - populate(objectMap, "protocol", a.Protocol) - populate(objectMap, "provisioningState", a.ProvisioningState) - populate(objectMap, "requireServerNameIndication", a.RequireServerNameIndication) - populate(objectMap, "sslCertificate", a.SSLCertificate) - populate(objectMap, "sslProfile", a.SSLProfile) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayHTTPListenerPropertiesFormat. -func (a *ApplicationGatewayHTTPListenerPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "customErrorConfigurations": - err = unpopulate(val, "CustomErrorConfigurations", &a.CustomErrorConfigurations) - delete(rawMsg, key) - case "firewallPolicy": - err = unpopulate(val, "FirewallPolicy", &a.FirewallPolicy) - delete(rawMsg, key) - case "frontendIPConfiguration": - err = unpopulate(val, "FrontendIPConfiguration", &a.FrontendIPConfiguration) - delete(rawMsg, key) - case "frontendPort": - err = unpopulate(val, "FrontendPort", &a.FrontendPort) - delete(rawMsg, key) - case "hostName": - err = unpopulate(val, "HostName", &a.HostName) - delete(rawMsg, key) - case "hostNames": - err = unpopulate(val, "HostNames", &a.HostNames) - delete(rawMsg, key) - case "protocol": - err = unpopulate(val, "Protocol", &a.Protocol) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) - delete(rawMsg, key) - case "requireServerNameIndication": - err = unpopulate(val, "RequireServerNameIndication", &a.RequireServerNameIndication) - delete(rawMsg, key) - case "sslCertificate": - err = unpopulate(val, "SSLCertificate", &a.SSLCertificate) - delete(rawMsg, key) - case "sslProfile": - err = unpopulate(val, "SSLProfile", &a.SSLProfile) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayHeaderConfiguration. -func (a ApplicationGatewayHeaderConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "headerName", a.HeaderName) - populate(objectMap, "headerValue", a.HeaderValue) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayHeaderConfiguration. -func (a *ApplicationGatewayHeaderConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "headerName": - err = unpopulate(val, "HeaderName", &a.HeaderName) - delete(rawMsg, key) - case "headerValue": - err = unpopulate(val, "HeaderValue", &a.HeaderValue) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayIPConfiguration. -func (a ApplicationGatewayIPConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", a.Etag) - populate(objectMap, "id", a.ID) - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayIPConfiguration. -func (a *ApplicationGatewayIPConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &a.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &a.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayIPConfigurationPropertiesFormat. -func (a ApplicationGatewayIPConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "provisioningState", a.ProvisioningState) - populate(objectMap, "subnet", a.Subnet) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayIPConfigurationPropertiesFormat. -func (a *ApplicationGatewayIPConfigurationPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) - delete(rawMsg, key) - case "subnet": - err = unpopulate(val, "Subnet", &a.Subnet) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayListResult. -func (a ApplicationGatewayListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", a.NextLink) - populate(objectMap, "value", a.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayListResult. -func (a *ApplicationGatewayListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &a.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &a.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayListener. -func (a ApplicationGatewayListener) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", a.Etag) - populate(objectMap, "id", a.ID) - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayListener. -func (a *ApplicationGatewayListener) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &a.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &a.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayListenerPropertiesFormat. -func (a ApplicationGatewayListenerPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "frontendIPConfiguration", a.FrontendIPConfiguration) - populate(objectMap, "frontendPort", a.FrontendPort) - populate(objectMap, "protocol", a.Protocol) - populate(objectMap, "provisioningState", a.ProvisioningState) - populate(objectMap, "sslCertificate", a.SSLCertificate) - populate(objectMap, "sslProfile", a.SSLProfile) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayListenerPropertiesFormat. -func (a *ApplicationGatewayListenerPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "frontendIPConfiguration": - err = unpopulate(val, "FrontendIPConfiguration", &a.FrontendIPConfiguration) - delete(rawMsg, key) - case "frontendPort": - err = unpopulate(val, "FrontendPort", &a.FrontendPort) - delete(rawMsg, key) - case "protocol": - err = unpopulate(val, "Protocol", &a.Protocol) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) - delete(rawMsg, key) - case "sslCertificate": - err = unpopulate(val, "SSLCertificate", &a.SSLCertificate) - delete(rawMsg, key) - case "sslProfile": - err = unpopulate(val, "SSLProfile", &a.SSLProfile) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayLoadDistributionPolicy. -func (a ApplicationGatewayLoadDistributionPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", a.Etag) - populate(objectMap, "id", a.ID) - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayLoadDistributionPolicy. -func (a *ApplicationGatewayLoadDistributionPolicy) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &a.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &a.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayLoadDistributionPolicyPropertiesFormat. -func (a ApplicationGatewayLoadDistributionPolicyPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "loadDistributionAlgorithm", a.LoadDistributionAlgorithm) - populate(objectMap, "loadDistributionTargets", a.LoadDistributionTargets) - populate(objectMap, "provisioningState", a.ProvisioningState) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayLoadDistributionPolicyPropertiesFormat. -func (a *ApplicationGatewayLoadDistributionPolicyPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "loadDistributionAlgorithm": - err = unpopulate(val, "LoadDistributionAlgorithm", &a.LoadDistributionAlgorithm) - delete(rawMsg, key) - case "loadDistributionTargets": - err = unpopulate(val, "LoadDistributionTargets", &a.LoadDistributionTargets) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayLoadDistributionTarget. -func (a ApplicationGatewayLoadDistributionTarget) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", a.Etag) - populate(objectMap, "id", a.ID) - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayLoadDistributionTarget. -func (a *ApplicationGatewayLoadDistributionTarget) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &a.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &a.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayLoadDistributionTargetPropertiesFormat. -func (a ApplicationGatewayLoadDistributionTargetPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "backendAddressPool", a.BackendAddressPool) - populate(objectMap, "weightPerServer", a.WeightPerServer) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayLoadDistributionTargetPropertiesFormat. -func (a *ApplicationGatewayLoadDistributionTargetPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "backendAddressPool": - err = unpopulate(val, "BackendAddressPool", &a.BackendAddressPool) - delete(rawMsg, key) - case "weightPerServer": - err = unpopulate(val, "WeightPerServer", &a.WeightPerServer) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayOnDemandProbe. -func (a ApplicationGatewayOnDemandProbe) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "backendAddressPool", a.BackendAddressPool) - populate(objectMap, "backendHttpSettings", a.BackendHTTPSettings) - populate(objectMap, "host", a.Host) - populate(objectMap, "match", a.Match) - populate(objectMap, "path", a.Path) - populate(objectMap, "pickHostNameFromBackendHttpSettings", a.PickHostNameFromBackendHTTPSettings) - populate(objectMap, "protocol", a.Protocol) - populate(objectMap, "timeout", a.Timeout) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayOnDemandProbe. -func (a *ApplicationGatewayOnDemandProbe) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "backendAddressPool": - err = unpopulate(val, "BackendAddressPool", &a.BackendAddressPool) - delete(rawMsg, key) - case "backendHttpSettings": - err = unpopulate(val, "BackendHTTPSettings", &a.BackendHTTPSettings) - delete(rawMsg, key) - case "host": - err = unpopulate(val, "Host", &a.Host) - delete(rawMsg, key) - case "match": - err = unpopulate(val, "Match", &a.Match) - delete(rawMsg, key) - case "path": - err = unpopulate(val, "Path", &a.Path) - delete(rawMsg, key) - case "pickHostNameFromBackendHttpSettings": - err = unpopulate(val, "PickHostNameFromBackendHTTPSettings", &a.PickHostNameFromBackendHTTPSettings) - delete(rawMsg, key) - case "protocol": - err = unpopulate(val, "Protocol", &a.Protocol) - delete(rawMsg, key) - case "timeout": - err = unpopulate(val, "Timeout", &a.Timeout) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayPathRule. -func (a ApplicationGatewayPathRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", a.Etag) - populate(objectMap, "id", a.ID) - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayPathRule. -func (a *ApplicationGatewayPathRule) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &a.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &a.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayPathRulePropertiesFormat. -func (a ApplicationGatewayPathRulePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "backendAddressPool", a.BackendAddressPool) - populate(objectMap, "backendHttpSettings", a.BackendHTTPSettings) - populate(objectMap, "firewallPolicy", a.FirewallPolicy) - populate(objectMap, "loadDistributionPolicy", a.LoadDistributionPolicy) - populate(objectMap, "paths", a.Paths) - populate(objectMap, "provisioningState", a.ProvisioningState) - populate(objectMap, "redirectConfiguration", a.RedirectConfiguration) - populate(objectMap, "rewriteRuleSet", a.RewriteRuleSet) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayPathRulePropertiesFormat. -func (a *ApplicationGatewayPathRulePropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "backendAddressPool": - err = unpopulate(val, "BackendAddressPool", &a.BackendAddressPool) - delete(rawMsg, key) - case "backendHttpSettings": - err = unpopulate(val, "BackendHTTPSettings", &a.BackendHTTPSettings) - delete(rawMsg, key) - case "firewallPolicy": - err = unpopulate(val, "FirewallPolicy", &a.FirewallPolicy) - delete(rawMsg, key) - case "loadDistributionPolicy": - err = unpopulate(val, "LoadDistributionPolicy", &a.LoadDistributionPolicy) - delete(rawMsg, key) - case "paths": - err = unpopulate(val, "Paths", &a.Paths) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) - delete(rawMsg, key) - case "redirectConfiguration": - err = unpopulate(val, "RedirectConfiguration", &a.RedirectConfiguration) - delete(rawMsg, key) - case "rewriteRuleSet": - err = unpopulate(val, "RewriteRuleSet", &a.RewriteRuleSet) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayPrivateEndpointConnection. -func (a ApplicationGatewayPrivateEndpointConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", a.Etag) - populate(objectMap, "id", a.ID) - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayPrivateEndpointConnection. -func (a *ApplicationGatewayPrivateEndpointConnection) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &a.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &a.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayPrivateEndpointConnectionListResult. -func (a ApplicationGatewayPrivateEndpointConnectionListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", a.NextLink) - populate(objectMap, "value", a.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayPrivateEndpointConnectionListResult. -func (a *ApplicationGatewayPrivateEndpointConnectionListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &a.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &a.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayPrivateEndpointConnectionProperties. -func (a ApplicationGatewayPrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "linkIdentifier", a.LinkIdentifier) - populate(objectMap, "privateEndpoint", a.PrivateEndpoint) - populate(objectMap, "privateLinkServiceConnectionState", a.PrivateLinkServiceConnectionState) - populate(objectMap, "provisioningState", a.ProvisioningState) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayPrivateEndpointConnectionProperties. -func (a *ApplicationGatewayPrivateEndpointConnectionProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "linkIdentifier": - err = unpopulate(val, "LinkIdentifier", &a.LinkIdentifier) - delete(rawMsg, key) - case "privateEndpoint": - err = unpopulate(val, "PrivateEndpoint", &a.PrivateEndpoint) - delete(rawMsg, key) - case "privateLinkServiceConnectionState": - err = unpopulate(val, "PrivateLinkServiceConnectionState", &a.PrivateLinkServiceConnectionState) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayPrivateLinkConfiguration. -func (a ApplicationGatewayPrivateLinkConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", a.Etag) - populate(objectMap, "id", a.ID) - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayPrivateLinkConfiguration. -func (a *ApplicationGatewayPrivateLinkConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &a.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &a.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayPrivateLinkConfigurationProperties. -func (a ApplicationGatewayPrivateLinkConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "ipConfigurations", a.IPConfigurations) - populate(objectMap, "provisioningState", a.ProvisioningState) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayPrivateLinkConfigurationProperties. -func (a *ApplicationGatewayPrivateLinkConfigurationProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "ipConfigurations": - err = unpopulate(val, "IPConfigurations", &a.IPConfigurations) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayPrivateLinkIPConfiguration. -func (a ApplicationGatewayPrivateLinkIPConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", a.Etag) - populate(objectMap, "id", a.ID) - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayPrivateLinkIPConfiguration. -func (a *ApplicationGatewayPrivateLinkIPConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &a.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &a.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayPrivateLinkIPConfigurationProperties. -func (a ApplicationGatewayPrivateLinkIPConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "primary", a.Primary) - populate(objectMap, "privateIPAddress", a.PrivateIPAddress) - populate(objectMap, "privateIPAllocationMethod", a.PrivateIPAllocationMethod) - populate(objectMap, "provisioningState", a.ProvisioningState) - populate(objectMap, "subnet", a.Subnet) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayPrivateLinkIPConfigurationProperties. -func (a *ApplicationGatewayPrivateLinkIPConfigurationProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "primary": - err = unpopulate(val, "Primary", &a.Primary) - delete(rawMsg, key) - case "privateIPAddress": - err = unpopulate(val, "PrivateIPAddress", &a.PrivateIPAddress) - delete(rawMsg, key) - case "privateIPAllocationMethod": - err = unpopulate(val, "PrivateIPAllocationMethod", &a.PrivateIPAllocationMethod) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) - delete(rawMsg, key) - case "subnet": - err = unpopulate(val, "Subnet", &a.Subnet) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayPrivateLinkResource. -func (a ApplicationGatewayPrivateLinkResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", a.Etag) - populate(objectMap, "id", a.ID) - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayPrivateLinkResource. -func (a *ApplicationGatewayPrivateLinkResource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &a.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &a.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayPrivateLinkResourceListResult. -func (a ApplicationGatewayPrivateLinkResourceListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", a.NextLink) - populate(objectMap, "value", a.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayPrivateLinkResourceListResult. -func (a *ApplicationGatewayPrivateLinkResourceListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &a.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &a.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayPrivateLinkResourceProperties. -func (a ApplicationGatewayPrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "groupId", a.GroupID) - populate(objectMap, "requiredMembers", a.RequiredMembers) - populate(objectMap, "requiredZoneNames", a.RequiredZoneNames) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayPrivateLinkResourceProperties. -func (a *ApplicationGatewayPrivateLinkResourceProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "groupId": - err = unpopulate(val, "GroupID", &a.GroupID) - delete(rawMsg, key) - case "requiredMembers": - err = unpopulate(val, "RequiredMembers", &a.RequiredMembers) - delete(rawMsg, key) - case "requiredZoneNames": - err = unpopulate(val, "RequiredZoneNames", &a.RequiredZoneNames) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayProbe. -func (a ApplicationGatewayProbe) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", a.Etag) - populate(objectMap, "id", a.ID) - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayProbe. -func (a *ApplicationGatewayProbe) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &a.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &a.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayProbeHealthResponseMatch. -func (a ApplicationGatewayProbeHealthResponseMatch) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "body", a.Body) - populate(objectMap, "statusCodes", a.StatusCodes) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayProbeHealthResponseMatch. -func (a *ApplicationGatewayProbeHealthResponseMatch) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "body": - err = unpopulate(val, "Body", &a.Body) - delete(rawMsg, key) - case "statusCodes": - err = unpopulate(val, "StatusCodes", &a.StatusCodes) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayProbePropertiesFormat. -func (a ApplicationGatewayProbePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "host", a.Host) - populate(objectMap, "interval", a.Interval) - populate(objectMap, "match", a.Match) - populate(objectMap, "minServers", a.MinServers) - populate(objectMap, "path", a.Path) - populate(objectMap, "pickHostNameFromBackendHttpSettings", a.PickHostNameFromBackendHTTPSettings) - populate(objectMap, "pickHostNameFromBackendSettings", a.PickHostNameFromBackendSettings) - populate(objectMap, "port", a.Port) - populate(objectMap, "protocol", a.Protocol) - populate(objectMap, "provisioningState", a.ProvisioningState) - populate(objectMap, "timeout", a.Timeout) - populate(objectMap, "unhealthyThreshold", a.UnhealthyThreshold) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayProbePropertiesFormat. -func (a *ApplicationGatewayProbePropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "host": - err = unpopulate(val, "Host", &a.Host) - delete(rawMsg, key) - case "interval": - err = unpopulate(val, "Interval", &a.Interval) - delete(rawMsg, key) - case "match": - err = unpopulate(val, "Match", &a.Match) - delete(rawMsg, key) - case "minServers": - err = unpopulate(val, "MinServers", &a.MinServers) - delete(rawMsg, key) - case "path": - err = unpopulate(val, "Path", &a.Path) - delete(rawMsg, key) - case "pickHostNameFromBackendHttpSettings": - err = unpopulate(val, "PickHostNameFromBackendHTTPSettings", &a.PickHostNameFromBackendHTTPSettings) - delete(rawMsg, key) - case "pickHostNameFromBackendSettings": - err = unpopulate(val, "PickHostNameFromBackendSettings", &a.PickHostNameFromBackendSettings) - delete(rawMsg, key) - case "port": - err = unpopulate(val, "Port", &a.Port) - delete(rawMsg, key) - case "protocol": - err = unpopulate(val, "Protocol", &a.Protocol) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) - delete(rawMsg, key) - case "timeout": - err = unpopulate(val, "Timeout", &a.Timeout) - delete(rawMsg, key) - case "unhealthyThreshold": - err = unpopulate(val, "UnhealthyThreshold", &a.UnhealthyThreshold) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayPropertiesFormat. -func (a ApplicationGatewayPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "authenticationCertificates", a.AuthenticationCertificates) - populate(objectMap, "autoscaleConfiguration", a.AutoscaleConfiguration) - populate(objectMap, "backendAddressPools", a.BackendAddressPools) - populate(objectMap, "backendHttpSettingsCollection", a.BackendHTTPSettingsCollection) - populate(objectMap, "backendSettingsCollection", a.BackendSettingsCollection) - populate(objectMap, "customErrorConfigurations", a.CustomErrorConfigurations) - populate(objectMap, "enableFips", a.EnableFips) - populate(objectMap, "enableHttp2", a.EnableHTTP2) - populate(objectMap, "firewallPolicy", a.FirewallPolicy) - populate(objectMap, "forceFirewallPolicyAssociation", a.ForceFirewallPolicyAssociation) - populate(objectMap, "frontendIPConfigurations", a.FrontendIPConfigurations) - populate(objectMap, "frontendPorts", a.FrontendPorts) - populate(objectMap, "gatewayIPConfigurations", a.GatewayIPConfigurations) - populate(objectMap, "globalConfiguration", a.GlobalConfiguration) - populate(objectMap, "httpListeners", a.HTTPListeners) - populate(objectMap, "listeners", a.Listeners) - populate(objectMap, "loadDistributionPolicies", a.LoadDistributionPolicies) - populate(objectMap, "operationalState", a.OperationalState) - populate(objectMap, "privateEndpointConnections", a.PrivateEndpointConnections) - populate(objectMap, "privateLinkConfigurations", a.PrivateLinkConfigurations) - populate(objectMap, "probes", a.Probes) - populate(objectMap, "provisioningState", a.ProvisioningState) - populate(objectMap, "redirectConfigurations", a.RedirectConfigurations) - populate(objectMap, "requestRoutingRules", a.RequestRoutingRules) - populate(objectMap, "resourceGuid", a.ResourceGUID) - populate(objectMap, "rewriteRuleSets", a.RewriteRuleSets) - populate(objectMap, "routingRules", a.RoutingRules) - populate(objectMap, "sku", a.SKU) - populate(objectMap, "sslCertificates", a.SSLCertificates) - populate(objectMap, "sslPolicy", a.SSLPolicy) - populate(objectMap, "sslProfiles", a.SSLProfiles) - populate(objectMap, "trustedClientCertificates", a.TrustedClientCertificates) - populate(objectMap, "trustedRootCertificates", a.TrustedRootCertificates) - populate(objectMap, "urlPathMaps", a.URLPathMaps) - populate(objectMap, "webApplicationFirewallConfiguration", a.WebApplicationFirewallConfiguration) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayPropertiesFormat. -func (a *ApplicationGatewayPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "authenticationCertificates": - err = unpopulate(val, "AuthenticationCertificates", &a.AuthenticationCertificates) - delete(rawMsg, key) - case "autoscaleConfiguration": - err = unpopulate(val, "AutoscaleConfiguration", &a.AutoscaleConfiguration) - delete(rawMsg, key) - case "backendAddressPools": - err = unpopulate(val, "BackendAddressPools", &a.BackendAddressPools) - delete(rawMsg, key) - case "backendHttpSettingsCollection": - err = unpopulate(val, "BackendHTTPSettingsCollection", &a.BackendHTTPSettingsCollection) - delete(rawMsg, key) - case "backendSettingsCollection": - err = unpopulate(val, "BackendSettingsCollection", &a.BackendSettingsCollection) - delete(rawMsg, key) - case "customErrorConfigurations": - err = unpopulate(val, "CustomErrorConfigurations", &a.CustomErrorConfigurations) - delete(rawMsg, key) - case "enableFips": - err = unpopulate(val, "EnableFips", &a.EnableFips) - delete(rawMsg, key) - case "enableHttp2": - err = unpopulate(val, "EnableHTTP2", &a.EnableHTTP2) - delete(rawMsg, key) - case "firewallPolicy": - err = unpopulate(val, "FirewallPolicy", &a.FirewallPolicy) - delete(rawMsg, key) - case "forceFirewallPolicyAssociation": - err = unpopulate(val, "ForceFirewallPolicyAssociation", &a.ForceFirewallPolicyAssociation) - delete(rawMsg, key) - case "frontendIPConfigurations": - err = unpopulate(val, "FrontendIPConfigurations", &a.FrontendIPConfigurations) - delete(rawMsg, key) - case "frontendPorts": - err = unpopulate(val, "FrontendPorts", &a.FrontendPorts) - delete(rawMsg, key) - case "gatewayIPConfigurations": - err = unpopulate(val, "GatewayIPConfigurations", &a.GatewayIPConfigurations) - delete(rawMsg, key) - case "globalConfiguration": - err = unpopulate(val, "GlobalConfiguration", &a.GlobalConfiguration) - delete(rawMsg, key) - case "httpListeners": - err = unpopulate(val, "HTTPListeners", &a.HTTPListeners) - delete(rawMsg, key) - case "listeners": - err = unpopulate(val, "Listeners", &a.Listeners) - delete(rawMsg, key) - case "loadDistributionPolicies": - err = unpopulate(val, "LoadDistributionPolicies", &a.LoadDistributionPolicies) - delete(rawMsg, key) - case "operationalState": - err = unpopulate(val, "OperationalState", &a.OperationalState) - delete(rawMsg, key) - case "privateEndpointConnections": - err = unpopulate(val, "PrivateEndpointConnections", &a.PrivateEndpointConnections) - delete(rawMsg, key) - case "privateLinkConfigurations": - err = unpopulate(val, "PrivateLinkConfigurations", &a.PrivateLinkConfigurations) - delete(rawMsg, key) - case "probes": - err = unpopulate(val, "Probes", &a.Probes) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) - delete(rawMsg, key) - case "redirectConfigurations": - err = unpopulate(val, "RedirectConfigurations", &a.RedirectConfigurations) - delete(rawMsg, key) - case "requestRoutingRules": - err = unpopulate(val, "RequestRoutingRules", &a.RequestRoutingRules) - delete(rawMsg, key) - case "resourceGuid": - err = unpopulate(val, "ResourceGUID", &a.ResourceGUID) - delete(rawMsg, key) - case "rewriteRuleSets": - err = unpopulate(val, "RewriteRuleSets", &a.RewriteRuleSets) - delete(rawMsg, key) - case "routingRules": - err = unpopulate(val, "RoutingRules", &a.RoutingRules) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &a.SKU) - delete(rawMsg, key) - case "sslCertificates": - err = unpopulate(val, "SSLCertificates", &a.SSLCertificates) - delete(rawMsg, key) - case "sslPolicy": - err = unpopulate(val, "SSLPolicy", &a.SSLPolicy) - delete(rawMsg, key) - case "sslProfiles": - err = unpopulate(val, "SSLProfiles", &a.SSLProfiles) - delete(rawMsg, key) - case "trustedClientCertificates": - err = unpopulate(val, "TrustedClientCertificates", &a.TrustedClientCertificates) - delete(rawMsg, key) - case "trustedRootCertificates": - err = unpopulate(val, "TrustedRootCertificates", &a.TrustedRootCertificates) - delete(rawMsg, key) - case "urlPathMaps": - err = unpopulate(val, "URLPathMaps", &a.URLPathMaps) - delete(rawMsg, key) - case "webApplicationFirewallConfiguration": - err = unpopulate(val, "WebApplicationFirewallConfiguration", &a.WebApplicationFirewallConfiguration) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayRedirectConfiguration. -func (a ApplicationGatewayRedirectConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", a.Etag) - populate(objectMap, "id", a.ID) - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayRedirectConfiguration. -func (a *ApplicationGatewayRedirectConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &a.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &a.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayRedirectConfigurationPropertiesFormat. -func (a ApplicationGatewayRedirectConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "includePath", a.IncludePath) - populate(objectMap, "includeQueryString", a.IncludeQueryString) - populate(objectMap, "pathRules", a.PathRules) - populate(objectMap, "redirectType", a.RedirectType) - populate(objectMap, "requestRoutingRules", a.RequestRoutingRules) - populate(objectMap, "targetListener", a.TargetListener) - populate(objectMap, "targetUrl", a.TargetURL) - populate(objectMap, "urlPathMaps", a.URLPathMaps) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayRedirectConfigurationPropertiesFormat. -func (a *ApplicationGatewayRedirectConfigurationPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "includePath": - err = unpopulate(val, "IncludePath", &a.IncludePath) - delete(rawMsg, key) - case "includeQueryString": - err = unpopulate(val, "IncludeQueryString", &a.IncludeQueryString) - delete(rawMsg, key) - case "pathRules": - err = unpopulate(val, "PathRules", &a.PathRules) - delete(rawMsg, key) - case "redirectType": - err = unpopulate(val, "RedirectType", &a.RedirectType) - delete(rawMsg, key) - case "requestRoutingRules": - err = unpopulate(val, "RequestRoutingRules", &a.RequestRoutingRules) - delete(rawMsg, key) - case "targetListener": - err = unpopulate(val, "TargetListener", &a.TargetListener) - delete(rawMsg, key) - case "targetUrl": - err = unpopulate(val, "TargetURL", &a.TargetURL) - delete(rawMsg, key) - case "urlPathMaps": - err = unpopulate(val, "URLPathMaps", &a.URLPathMaps) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayRequestRoutingRule. -func (a ApplicationGatewayRequestRoutingRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", a.Etag) - populate(objectMap, "id", a.ID) - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayRequestRoutingRule. -func (a *ApplicationGatewayRequestRoutingRule) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &a.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &a.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayRequestRoutingRulePropertiesFormat. -func (a ApplicationGatewayRequestRoutingRulePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "backendAddressPool", a.BackendAddressPool) - populate(objectMap, "backendHttpSettings", a.BackendHTTPSettings) - populate(objectMap, "httpListener", a.HTTPListener) - populate(objectMap, "loadDistributionPolicy", a.LoadDistributionPolicy) - populate(objectMap, "priority", a.Priority) - populate(objectMap, "provisioningState", a.ProvisioningState) - populate(objectMap, "redirectConfiguration", a.RedirectConfiguration) - populate(objectMap, "rewriteRuleSet", a.RewriteRuleSet) - populate(objectMap, "ruleType", a.RuleType) - populate(objectMap, "urlPathMap", a.URLPathMap) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayRequestRoutingRulePropertiesFormat. -func (a *ApplicationGatewayRequestRoutingRulePropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "backendAddressPool": - err = unpopulate(val, "BackendAddressPool", &a.BackendAddressPool) - delete(rawMsg, key) - case "backendHttpSettings": - err = unpopulate(val, "BackendHTTPSettings", &a.BackendHTTPSettings) - delete(rawMsg, key) - case "httpListener": - err = unpopulate(val, "HTTPListener", &a.HTTPListener) - delete(rawMsg, key) - case "loadDistributionPolicy": - err = unpopulate(val, "LoadDistributionPolicy", &a.LoadDistributionPolicy) - delete(rawMsg, key) - case "priority": - err = unpopulate(val, "Priority", &a.Priority) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) - delete(rawMsg, key) - case "redirectConfiguration": - err = unpopulate(val, "RedirectConfiguration", &a.RedirectConfiguration) - delete(rawMsg, key) - case "rewriteRuleSet": - err = unpopulate(val, "RewriteRuleSet", &a.RewriteRuleSet) - delete(rawMsg, key) - case "ruleType": - err = unpopulate(val, "RuleType", &a.RuleType) - delete(rawMsg, key) - case "urlPathMap": - err = unpopulate(val, "URLPathMap", &a.URLPathMap) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayRewriteRule. -func (a ApplicationGatewayRewriteRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "actionSet", a.ActionSet) - populate(objectMap, "conditions", a.Conditions) - populate(objectMap, "name", a.Name) - populate(objectMap, "ruleSequence", a.RuleSequence) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayRewriteRule. -func (a *ApplicationGatewayRewriteRule) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "actionSet": - err = unpopulate(val, "ActionSet", &a.ActionSet) - delete(rawMsg, key) - case "conditions": - err = unpopulate(val, "Conditions", &a.Conditions) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) - delete(rawMsg, key) - case "ruleSequence": - err = unpopulate(val, "RuleSequence", &a.RuleSequence) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayRewriteRuleActionSet. -func (a ApplicationGatewayRewriteRuleActionSet) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "requestHeaderConfigurations", a.RequestHeaderConfigurations) - populate(objectMap, "responseHeaderConfigurations", a.ResponseHeaderConfigurations) - populate(objectMap, "urlConfiguration", a.URLConfiguration) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayRewriteRuleActionSet. -func (a *ApplicationGatewayRewriteRuleActionSet) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "requestHeaderConfigurations": - err = unpopulate(val, "RequestHeaderConfigurations", &a.RequestHeaderConfigurations) - delete(rawMsg, key) - case "responseHeaderConfigurations": - err = unpopulate(val, "ResponseHeaderConfigurations", &a.ResponseHeaderConfigurations) - delete(rawMsg, key) - case "urlConfiguration": - err = unpopulate(val, "URLConfiguration", &a.URLConfiguration) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayRewriteRuleCondition. -func (a ApplicationGatewayRewriteRuleCondition) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "ignoreCase", a.IgnoreCase) - populate(objectMap, "negate", a.Negate) - populate(objectMap, "pattern", a.Pattern) - populate(objectMap, "variable", a.Variable) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayRewriteRuleCondition. -func (a *ApplicationGatewayRewriteRuleCondition) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "ignoreCase": - err = unpopulate(val, "IgnoreCase", &a.IgnoreCase) - delete(rawMsg, key) - case "negate": - err = unpopulate(val, "Negate", &a.Negate) - delete(rawMsg, key) - case "pattern": - err = unpopulate(val, "Pattern", &a.Pattern) - delete(rawMsg, key) - case "variable": - err = unpopulate(val, "Variable", &a.Variable) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayRewriteRuleSet. -func (a ApplicationGatewayRewriteRuleSet) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", a.Etag) - populate(objectMap, "id", a.ID) - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayRewriteRuleSet. -func (a *ApplicationGatewayRewriteRuleSet) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &a.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &a.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayRewriteRuleSetPropertiesFormat. -func (a ApplicationGatewayRewriteRuleSetPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "provisioningState", a.ProvisioningState) - populate(objectMap, "rewriteRules", a.RewriteRules) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayRewriteRuleSetPropertiesFormat. -func (a *ApplicationGatewayRewriteRuleSetPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) - delete(rawMsg, key) - case "rewriteRules": - err = unpopulate(val, "RewriteRules", &a.RewriteRules) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayRoutingRule. -func (a ApplicationGatewayRoutingRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", a.Etag) - populate(objectMap, "id", a.ID) - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayRoutingRule. -func (a *ApplicationGatewayRoutingRule) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &a.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &a.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayRoutingRulePropertiesFormat. -func (a ApplicationGatewayRoutingRulePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "backendAddressPool", a.BackendAddressPool) - populate(objectMap, "backendSettings", a.BackendSettings) - populate(objectMap, "listener", a.Listener) - populate(objectMap, "priority", a.Priority) - populate(objectMap, "provisioningState", a.ProvisioningState) - populate(objectMap, "ruleType", a.RuleType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayRoutingRulePropertiesFormat. -func (a *ApplicationGatewayRoutingRulePropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "backendAddressPool": - err = unpopulate(val, "BackendAddressPool", &a.BackendAddressPool) - delete(rawMsg, key) - case "backendSettings": - err = unpopulate(val, "BackendSettings", &a.BackendSettings) - delete(rawMsg, key) - case "listener": - err = unpopulate(val, "Listener", &a.Listener) - delete(rawMsg, key) - case "priority": - err = unpopulate(val, "Priority", &a.Priority) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) - delete(rawMsg, key) - case "ruleType": - err = unpopulate(val, "RuleType", &a.RuleType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewaySKU. -func (a ApplicationGatewaySKU) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "capacity", a.Capacity) - populate(objectMap, "name", a.Name) - populate(objectMap, "tier", a.Tier) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewaySKU. -func (a *ApplicationGatewaySKU) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "capacity": - err = unpopulate(val, "Capacity", &a.Capacity) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) - delete(rawMsg, key) - case "tier": - err = unpopulate(val, "Tier", &a.Tier) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewaySSLCertificate. -func (a ApplicationGatewaySSLCertificate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", a.Etag) - populate(objectMap, "id", a.ID) - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewaySSLCertificate. -func (a *ApplicationGatewaySSLCertificate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &a.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &a.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewaySSLCertificatePropertiesFormat. -func (a ApplicationGatewaySSLCertificatePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "data", a.Data) - populate(objectMap, "keyVaultSecretId", a.KeyVaultSecretID) - populate(objectMap, "password", a.Password) - populate(objectMap, "provisioningState", a.ProvisioningState) - populate(objectMap, "publicCertData", a.PublicCertData) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewaySSLCertificatePropertiesFormat. -func (a *ApplicationGatewaySSLCertificatePropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "data": - err = unpopulate(val, "Data", &a.Data) - delete(rawMsg, key) - case "keyVaultSecretId": - err = unpopulate(val, "KeyVaultSecretID", &a.KeyVaultSecretID) - delete(rawMsg, key) - case "password": - err = unpopulate(val, "Password", &a.Password) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) - delete(rawMsg, key) - case "publicCertData": - err = unpopulate(val, "PublicCertData", &a.PublicCertData) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewaySSLPolicy. -func (a ApplicationGatewaySSLPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "cipherSuites", a.CipherSuites) - populate(objectMap, "disabledSslProtocols", a.DisabledSSLProtocols) - populate(objectMap, "minProtocolVersion", a.MinProtocolVersion) - populate(objectMap, "policyName", a.PolicyName) - populate(objectMap, "policyType", a.PolicyType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewaySSLPolicy. -func (a *ApplicationGatewaySSLPolicy) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "cipherSuites": - err = unpopulate(val, "CipherSuites", &a.CipherSuites) - delete(rawMsg, key) - case "disabledSslProtocols": - err = unpopulate(val, "DisabledSSLProtocols", &a.DisabledSSLProtocols) - delete(rawMsg, key) - case "minProtocolVersion": - err = unpopulate(val, "MinProtocolVersion", &a.MinProtocolVersion) - delete(rawMsg, key) - case "policyName": - err = unpopulate(val, "PolicyName", &a.PolicyName) - delete(rawMsg, key) - case "policyType": - err = unpopulate(val, "PolicyType", &a.PolicyType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewaySSLPredefinedPolicy. -func (a ApplicationGatewaySSLPredefinedPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", a.ID) - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewaySSLPredefinedPolicy. -func (a *ApplicationGatewaySSLPredefinedPolicy) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &a.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewaySSLPredefinedPolicyPropertiesFormat. -func (a ApplicationGatewaySSLPredefinedPolicyPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "cipherSuites", a.CipherSuites) - populate(objectMap, "minProtocolVersion", a.MinProtocolVersion) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewaySSLPredefinedPolicyPropertiesFormat. -func (a *ApplicationGatewaySSLPredefinedPolicyPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "cipherSuites": - err = unpopulate(val, "CipherSuites", &a.CipherSuites) - delete(rawMsg, key) - case "minProtocolVersion": - err = unpopulate(val, "MinProtocolVersion", &a.MinProtocolVersion) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewaySSLProfile. -func (a ApplicationGatewaySSLProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", a.Etag) - populate(objectMap, "id", a.ID) - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewaySSLProfile. -func (a *ApplicationGatewaySSLProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &a.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &a.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewaySSLProfilePropertiesFormat. -func (a ApplicationGatewaySSLProfilePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "clientAuthConfiguration", a.ClientAuthConfiguration) - populate(objectMap, "provisioningState", a.ProvisioningState) - populate(objectMap, "sslPolicy", a.SSLPolicy) - populate(objectMap, "trustedClientCertificates", a.TrustedClientCertificates) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewaySSLProfilePropertiesFormat. -func (a *ApplicationGatewaySSLProfilePropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "clientAuthConfiguration": - err = unpopulate(val, "ClientAuthConfiguration", &a.ClientAuthConfiguration) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) - delete(rawMsg, key) - case "sslPolicy": - err = unpopulate(val, "SSLPolicy", &a.SSLPolicy) - delete(rawMsg, key) - case "trustedClientCertificates": - err = unpopulate(val, "TrustedClientCertificates", &a.TrustedClientCertificates) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayTrustedClientCertificate. -func (a ApplicationGatewayTrustedClientCertificate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", a.Etag) - populate(objectMap, "id", a.ID) - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayTrustedClientCertificate. -func (a *ApplicationGatewayTrustedClientCertificate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &a.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &a.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayTrustedClientCertificatePropertiesFormat. -func (a ApplicationGatewayTrustedClientCertificatePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "clientCertIssuerDN", a.ClientCertIssuerDN) - populate(objectMap, "data", a.Data) - populate(objectMap, "provisioningState", a.ProvisioningState) - populate(objectMap, "validatedCertData", a.ValidatedCertData) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayTrustedClientCertificatePropertiesFormat. -func (a *ApplicationGatewayTrustedClientCertificatePropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "clientCertIssuerDN": - err = unpopulate(val, "ClientCertIssuerDN", &a.ClientCertIssuerDN) - delete(rawMsg, key) - case "data": - err = unpopulate(val, "Data", &a.Data) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) - delete(rawMsg, key) - case "validatedCertData": - err = unpopulate(val, "ValidatedCertData", &a.ValidatedCertData) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayTrustedRootCertificate. -func (a ApplicationGatewayTrustedRootCertificate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", a.Etag) - populate(objectMap, "id", a.ID) - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayTrustedRootCertificate. -func (a *ApplicationGatewayTrustedRootCertificate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &a.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &a.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayTrustedRootCertificatePropertiesFormat. -func (a ApplicationGatewayTrustedRootCertificatePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "data", a.Data) - populate(objectMap, "keyVaultSecretId", a.KeyVaultSecretID) - populate(objectMap, "provisioningState", a.ProvisioningState) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayTrustedRootCertificatePropertiesFormat. -func (a *ApplicationGatewayTrustedRootCertificatePropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "data": - err = unpopulate(val, "Data", &a.Data) - delete(rawMsg, key) - case "keyVaultSecretId": - err = unpopulate(val, "KeyVaultSecretID", &a.KeyVaultSecretID) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayURLConfiguration. -func (a ApplicationGatewayURLConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "modifiedPath", a.ModifiedPath) - populate(objectMap, "modifiedQueryString", a.ModifiedQueryString) - populate(objectMap, "reroute", a.Reroute) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayURLConfiguration. -func (a *ApplicationGatewayURLConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "modifiedPath": - err = unpopulate(val, "ModifiedPath", &a.ModifiedPath) - delete(rawMsg, key) - case "modifiedQueryString": - err = unpopulate(val, "ModifiedQueryString", &a.ModifiedQueryString) - delete(rawMsg, key) - case "reroute": - err = unpopulate(val, "Reroute", &a.Reroute) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayURLPathMap. -func (a ApplicationGatewayURLPathMap) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", a.Etag) - populate(objectMap, "id", a.ID) - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayURLPathMap. -func (a *ApplicationGatewayURLPathMap) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &a.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &a.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayURLPathMapPropertiesFormat. -func (a ApplicationGatewayURLPathMapPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "defaultBackendAddressPool", a.DefaultBackendAddressPool) - populate(objectMap, "defaultBackendHttpSettings", a.DefaultBackendHTTPSettings) - populate(objectMap, "defaultLoadDistributionPolicy", a.DefaultLoadDistributionPolicy) - populate(objectMap, "defaultRedirectConfiguration", a.DefaultRedirectConfiguration) - populate(objectMap, "defaultRewriteRuleSet", a.DefaultRewriteRuleSet) - populate(objectMap, "pathRules", a.PathRules) - populate(objectMap, "provisioningState", a.ProvisioningState) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayURLPathMapPropertiesFormat. -func (a *ApplicationGatewayURLPathMapPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "defaultBackendAddressPool": - err = unpopulate(val, "DefaultBackendAddressPool", &a.DefaultBackendAddressPool) - delete(rawMsg, key) - case "defaultBackendHttpSettings": - err = unpopulate(val, "DefaultBackendHTTPSettings", &a.DefaultBackendHTTPSettings) - delete(rawMsg, key) - case "defaultLoadDistributionPolicy": - err = unpopulate(val, "DefaultLoadDistributionPolicy", &a.DefaultLoadDistributionPolicy) - delete(rawMsg, key) - case "defaultRedirectConfiguration": - err = unpopulate(val, "DefaultRedirectConfiguration", &a.DefaultRedirectConfiguration) - delete(rawMsg, key) - case "defaultRewriteRuleSet": - err = unpopulate(val, "DefaultRewriteRuleSet", &a.DefaultRewriteRuleSet) - delete(rawMsg, key) - case "pathRules": - err = unpopulate(val, "PathRules", &a.PathRules) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayWebApplicationFirewallConfiguration. -func (a ApplicationGatewayWebApplicationFirewallConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "disabledRuleGroups", a.DisabledRuleGroups) - populate(objectMap, "enabled", a.Enabled) - populate(objectMap, "exclusions", a.Exclusions) - populate(objectMap, "fileUploadLimitInMb", a.FileUploadLimitInMb) - populate(objectMap, "firewallMode", a.FirewallMode) - populate(objectMap, "maxRequestBodySize", a.MaxRequestBodySize) - populate(objectMap, "maxRequestBodySizeInKb", a.MaxRequestBodySizeInKb) - populate(objectMap, "requestBodyCheck", a.RequestBodyCheck) - populate(objectMap, "ruleSetType", a.RuleSetType) - populate(objectMap, "ruleSetVersion", a.RuleSetVersion) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayWebApplicationFirewallConfiguration. -func (a *ApplicationGatewayWebApplicationFirewallConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "disabledRuleGroups": - err = unpopulate(val, "DisabledRuleGroups", &a.DisabledRuleGroups) - delete(rawMsg, key) - case "enabled": - err = unpopulate(val, "Enabled", &a.Enabled) - delete(rawMsg, key) - case "exclusions": - err = unpopulate(val, "Exclusions", &a.Exclusions) - delete(rawMsg, key) - case "fileUploadLimitInMb": - err = unpopulate(val, "FileUploadLimitInMb", &a.FileUploadLimitInMb) - delete(rawMsg, key) - case "firewallMode": - err = unpopulate(val, "FirewallMode", &a.FirewallMode) - delete(rawMsg, key) - case "maxRequestBodySize": - err = unpopulate(val, "MaxRequestBodySize", &a.MaxRequestBodySize) - delete(rawMsg, key) - case "maxRequestBodySizeInKb": - err = unpopulate(val, "MaxRequestBodySizeInKb", &a.MaxRequestBodySizeInKb) - delete(rawMsg, key) - case "requestBodyCheck": - err = unpopulate(val, "RequestBodyCheck", &a.RequestBodyCheck) - delete(rawMsg, key) - case "ruleSetType": - err = unpopulate(val, "RuleSetType", &a.RuleSetType) - delete(rawMsg, key) - case "ruleSetVersion": - err = unpopulate(val, "RuleSetVersion", &a.RuleSetVersion) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationRule. -func (a ApplicationRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "description", a.Description) - populate(objectMap, "destinationAddresses", a.DestinationAddresses) - populate(objectMap, "fqdnTags", a.FqdnTags) - populate(objectMap, "name", a.Name) - populate(objectMap, "protocols", a.Protocols) - objectMap["ruleType"] = FirewallPolicyRuleTypeApplicationRule - populate(objectMap, "sourceAddresses", a.SourceAddresses) - populate(objectMap, "sourceIpGroups", a.SourceIPGroups) - populate(objectMap, "targetFqdns", a.TargetFqdns) - populate(objectMap, "targetUrls", a.TargetUrls) - populate(objectMap, "terminateTLS", a.TerminateTLS) - populate(objectMap, "webCategories", a.WebCategories) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationRule. -func (a *ApplicationRule) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "description": - err = unpopulate(val, "Description", &a.Description) - delete(rawMsg, key) - case "destinationAddresses": - err = unpopulate(val, "DestinationAddresses", &a.DestinationAddresses) - delete(rawMsg, key) - case "fqdnTags": - err = unpopulate(val, "FqdnTags", &a.FqdnTags) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) - delete(rawMsg, key) - case "protocols": - err = unpopulate(val, "Protocols", &a.Protocols) - delete(rawMsg, key) - case "ruleType": - err = unpopulate(val, "RuleType", &a.RuleType) - delete(rawMsg, key) - case "sourceAddresses": - err = unpopulate(val, "SourceAddresses", &a.SourceAddresses) - delete(rawMsg, key) - case "sourceIpGroups": - err = unpopulate(val, "SourceIPGroups", &a.SourceIPGroups) - delete(rawMsg, key) - case "targetFqdns": - err = unpopulate(val, "TargetFqdns", &a.TargetFqdns) - delete(rawMsg, key) - case "targetUrls": - err = unpopulate(val, "TargetUrls", &a.TargetUrls) - delete(rawMsg, key) - case "terminateTLS": - err = unpopulate(val, "TerminateTLS", &a.TerminateTLS) - delete(rawMsg, key) - case "webCategories": - err = unpopulate(val, "WebCategories", &a.WebCategories) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationSecurityGroup. -func (a ApplicationSecurityGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", a.Etag) - populate(objectMap, "id", a.ID) - populate(objectMap, "location", a.Location) - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "tags", a.Tags) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationSecurityGroup. -func (a *ApplicationSecurityGroup) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &a.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &a.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &a.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &a.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationSecurityGroupListResult. -func (a ApplicationSecurityGroupListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", a.NextLink) - populate(objectMap, "value", a.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationSecurityGroupListResult. -func (a *ApplicationSecurityGroupListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &a.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &a.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationSecurityGroupPropertiesFormat. -func (a ApplicationSecurityGroupPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "provisioningState", a.ProvisioningState) - populate(objectMap, "resourceGuid", a.ResourceGUID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationSecurityGroupPropertiesFormat. -func (a *ApplicationSecurityGroupPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) - delete(rawMsg, key) - case "resourceGuid": - err = unpopulate(val, "ResourceGUID", &a.ResourceGUID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AuthorizationListResult. -func (a AuthorizationListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", a.NextLink) - populate(objectMap, "value", a.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizationListResult. -func (a *AuthorizationListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &a.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &a.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AuthorizationPropertiesFormat. -func (a AuthorizationPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "authorizationKey", a.AuthorizationKey) - populate(objectMap, "authorizationUseStatus", a.AuthorizationUseStatus) - populate(objectMap, "provisioningState", a.ProvisioningState) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizationPropertiesFormat. -func (a *AuthorizationPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "authorizationKey": - err = unpopulate(val, "AuthorizationKey", &a.AuthorizationKey) - delete(rawMsg, key) - case "authorizationUseStatus": - err = unpopulate(val, "AuthorizationUseStatus", &a.AuthorizationUseStatus) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AutoApprovedPrivateLinkService. -func (a AutoApprovedPrivateLinkService) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "privateLinkService", a.PrivateLinkService) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AutoApprovedPrivateLinkService. -func (a *AutoApprovedPrivateLinkService) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "privateLinkService": - err = unpopulate(val, "PrivateLinkService", &a.PrivateLinkService) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AutoApprovedPrivateLinkServicesResult. -func (a AutoApprovedPrivateLinkServicesResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", a.NextLink) - populate(objectMap, "value", a.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AutoApprovedPrivateLinkServicesResult. -func (a *AutoApprovedPrivateLinkServicesResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &a.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &a.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Availability. -func (a Availability) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "blobDuration", a.BlobDuration) - populate(objectMap, "retention", a.Retention) - populate(objectMap, "timeGrain", a.TimeGrain) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Availability. -func (a *Availability) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "blobDuration": - err = unpopulate(val, "BlobDuration", &a.BlobDuration) - delete(rawMsg, key) - case "retention": - err = unpopulate(val, "Retention", &a.Retention) - delete(rawMsg, key) - case "timeGrain": - err = unpopulate(val, "TimeGrain", &a.TimeGrain) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AvailableDelegation. -func (a AvailableDelegation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "actions", a.Actions) - populate(objectMap, "id", a.ID) - populate(objectMap, "name", a.Name) - populate(objectMap, "serviceName", a.ServiceName) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AvailableDelegation. -func (a *AvailableDelegation) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "actions": - err = unpopulate(val, "Actions", &a.Actions) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &a.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) - delete(rawMsg, key) - case "serviceName": - err = unpopulate(val, "ServiceName", &a.ServiceName) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AvailableDelegationsResult. -func (a AvailableDelegationsResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", a.NextLink) - populate(objectMap, "value", a.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AvailableDelegationsResult. -func (a *AvailableDelegationsResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &a.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &a.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AvailablePrivateEndpointType. -func (a AvailablePrivateEndpointType) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "displayName", a.DisplayName) - populate(objectMap, "id", a.ID) - populate(objectMap, "name", a.Name) - populate(objectMap, "resourceName", a.ResourceName) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AvailablePrivateEndpointType. -func (a *AvailablePrivateEndpointType) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "displayName": - err = unpopulate(val, "DisplayName", &a.DisplayName) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &a.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) - delete(rawMsg, key) - case "resourceName": - err = unpopulate(val, "ResourceName", &a.ResourceName) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AvailablePrivateEndpointTypesResult. -func (a AvailablePrivateEndpointTypesResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", a.NextLink) - populate(objectMap, "value", a.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AvailablePrivateEndpointTypesResult. -func (a *AvailablePrivateEndpointTypesResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &a.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &a.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AvailableProvidersList. -func (a AvailableProvidersList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "countries", a.Countries) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AvailableProvidersList. -func (a *AvailableProvidersList) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "countries": - err = unpopulate(val, "Countries", &a.Countries) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AvailableProvidersListCity. -func (a AvailableProvidersListCity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "cityName", a.CityName) - populate(objectMap, "providers", a.Providers) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AvailableProvidersListCity. -func (a *AvailableProvidersListCity) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "cityName": - err = unpopulate(val, "CityName", &a.CityName) - delete(rawMsg, key) - case "providers": - err = unpopulate(val, "Providers", &a.Providers) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AvailableProvidersListCountry. -func (a AvailableProvidersListCountry) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "countryName", a.CountryName) - populate(objectMap, "providers", a.Providers) - populate(objectMap, "states", a.States) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AvailableProvidersListCountry. -func (a *AvailableProvidersListCountry) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "countryName": - err = unpopulate(val, "CountryName", &a.CountryName) - delete(rawMsg, key) - case "providers": - err = unpopulate(val, "Providers", &a.Providers) - delete(rawMsg, key) - case "states": - err = unpopulate(val, "States", &a.States) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AvailableProvidersListParameters. -func (a AvailableProvidersListParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "azureLocations", a.AzureLocations) - populate(objectMap, "city", a.City) - populate(objectMap, "country", a.Country) - populate(objectMap, "state", a.State) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AvailableProvidersListParameters. -func (a *AvailableProvidersListParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "azureLocations": - err = unpopulate(val, "AzureLocations", &a.AzureLocations) - delete(rawMsg, key) - case "city": - err = unpopulate(val, "City", &a.City) - delete(rawMsg, key) - case "country": - err = unpopulate(val, "Country", &a.Country) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &a.State) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AvailableProvidersListState. -func (a AvailableProvidersListState) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "cities", a.Cities) - populate(objectMap, "providers", a.Providers) - populate(objectMap, "stateName", a.StateName) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AvailableProvidersListState. -func (a *AvailableProvidersListState) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "cities": - err = unpopulate(val, "Cities", &a.Cities) - delete(rawMsg, key) - case "providers": - err = unpopulate(val, "Providers", &a.Providers) - delete(rawMsg, key) - case "stateName": - err = unpopulate(val, "StateName", &a.StateName) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AvailableServiceAlias. -func (a AvailableServiceAlias) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", a.ID) - populate(objectMap, "name", a.Name) - populate(objectMap, "resourceName", a.ResourceName) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AvailableServiceAlias. -func (a *AvailableServiceAlias) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &a.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) - delete(rawMsg, key) - case "resourceName": - err = unpopulate(val, "ResourceName", &a.ResourceName) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AvailableServiceAliasesResult. -func (a AvailableServiceAliasesResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", a.NextLink) - populate(objectMap, "value", a.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AvailableServiceAliasesResult. -func (a *AvailableServiceAliasesResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &a.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &a.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AzureAsyncOperationResult. -func (a AzureAsyncOperationResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "error", a.Error) - populate(objectMap, "status", a.Status) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureAsyncOperationResult. -func (a *AzureAsyncOperationResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "error": - err = unpopulate(val, "Error", &a.Error) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &a.Status) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AzureFirewall. -func (a AzureFirewall) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", a.Etag) - populate(objectMap, "id", a.ID) - populate(objectMap, "location", a.Location) - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "tags", a.Tags) - populate(objectMap, "type", a.Type) - populate(objectMap, "zones", a.Zones) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureFirewall. -func (a *AzureFirewall) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &a.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &a.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &a.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &a.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) - delete(rawMsg, key) - case "zones": - err = unpopulate(val, "Zones", &a.Zones) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AzureFirewallApplicationRule. -func (a AzureFirewallApplicationRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "description", a.Description) - populate(objectMap, "fqdnTags", a.FqdnTags) - populate(objectMap, "name", a.Name) - populate(objectMap, "protocols", a.Protocols) - populate(objectMap, "sourceAddresses", a.SourceAddresses) - populate(objectMap, "sourceIpGroups", a.SourceIPGroups) - populate(objectMap, "targetFqdns", a.TargetFqdns) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureFirewallApplicationRule. -func (a *AzureFirewallApplicationRule) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "description": - err = unpopulate(val, "Description", &a.Description) - delete(rawMsg, key) - case "fqdnTags": - err = unpopulate(val, "FqdnTags", &a.FqdnTags) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) - delete(rawMsg, key) - case "protocols": - err = unpopulate(val, "Protocols", &a.Protocols) - delete(rawMsg, key) - case "sourceAddresses": - err = unpopulate(val, "SourceAddresses", &a.SourceAddresses) - delete(rawMsg, key) - case "sourceIpGroups": - err = unpopulate(val, "SourceIPGroups", &a.SourceIPGroups) - delete(rawMsg, key) - case "targetFqdns": - err = unpopulate(val, "TargetFqdns", &a.TargetFqdns) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AzureFirewallApplicationRuleCollection. -func (a AzureFirewallApplicationRuleCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", a.Etag) - populate(objectMap, "id", a.ID) - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureFirewallApplicationRuleCollection. -func (a *AzureFirewallApplicationRuleCollection) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &a.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &a.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AzureFirewallApplicationRuleCollectionPropertiesFormat. -func (a AzureFirewallApplicationRuleCollectionPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "action", a.Action) - populate(objectMap, "priority", a.Priority) - populate(objectMap, "provisioningState", a.ProvisioningState) - populate(objectMap, "rules", a.Rules) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureFirewallApplicationRuleCollectionPropertiesFormat. -func (a *AzureFirewallApplicationRuleCollectionPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "action": - err = unpopulate(val, "Action", &a.Action) - delete(rawMsg, key) - case "priority": - err = unpopulate(val, "Priority", &a.Priority) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) - delete(rawMsg, key) - case "rules": - err = unpopulate(val, "Rules", &a.Rules) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AzureFirewallApplicationRuleProtocol. -func (a AzureFirewallApplicationRuleProtocol) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "port", a.Port) - populate(objectMap, "protocolType", a.ProtocolType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureFirewallApplicationRuleProtocol. -func (a *AzureFirewallApplicationRuleProtocol) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "port": - err = unpopulate(val, "Port", &a.Port) - delete(rawMsg, key) - case "protocolType": - err = unpopulate(val, "ProtocolType", &a.ProtocolType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AzureFirewallFqdnTag. -func (a AzureFirewallFqdnTag) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", a.Etag) - populate(objectMap, "id", a.ID) - populate(objectMap, "location", a.Location) - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "tags", a.Tags) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureFirewallFqdnTag. -func (a *AzureFirewallFqdnTag) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &a.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &a.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &a.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &a.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AzureFirewallFqdnTagListResult. -func (a AzureFirewallFqdnTagListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", a.NextLink) - populate(objectMap, "value", a.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureFirewallFqdnTagListResult. -func (a *AzureFirewallFqdnTagListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &a.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &a.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AzureFirewallFqdnTagPropertiesFormat. -func (a AzureFirewallFqdnTagPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "fqdnTagName", a.FqdnTagName) - populate(objectMap, "provisioningState", a.ProvisioningState) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureFirewallFqdnTagPropertiesFormat. -func (a *AzureFirewallFqdnTagPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "fqdnTagName": - err = unpopulate(val, "FqdnTagName", &a.FqdnTagName) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AzureFirewallIPConfiguration. -func (a AzureFirewallIPConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", a.Etag) - populate(objectMap, "id", a.ID) - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureFirewallIPConfiguration. -func (a *AzureFirewallIPConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &a.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &a.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AzureFirewallIPConfigurationPropertiesFormat. -func (a AzureFirewallIPConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "privateIPAddress", a.PrivateIPAddress) - populate(objectMap, "provisioningState", a.ProvisioningState) - populate(objectMap, "publicIPAddress", a.PublicIPAddress) - populate(objectMap, "subnet", a.Subnet) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureFirewallIPConfigurationPropertiesFormat. -func (a *AzureFirewallIPConfigurationPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "privateIPAddress": - err = unpopulate(val, "PrivateIPAddress", &a.PrivateIPAddress) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) - delete(rawMsg, key) - case "publicIPAddress": - err = unpopulate(val, "PublicIPAddress", &a.PublicIPAddress) - delete(rawMsg, key) - case "subnet": - err = unpopulate(val, "Subnet", &a.Subnet) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AzureFirewallIPGroups. -func (a AzureFirewallIPGroups) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "changeNumber", a.ChangeNumber) - populate(objectMap, "id", a.ID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureFirewallIPGroups. -func (a *AzureFirewallIPGroups) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "changeNumber": - err = unpopulate(val, "ChangeNumber", &a.ChangeNumber) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &a.ID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AzureFirewallListResult. -func (a AzureFirewallListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", a.NextLink) - populate(objectMap, "value", a.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureFirewallListResult. -func (a *AzureFirewallListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &a.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &a.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AzureFirewallNatRCAction. -func (a AzureFirewallNatRCAction) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureFirewallNatRCAction. -func (a *AzureFirewallNatRCAction) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "type": - err = unpopulate(val, "Type", &a.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AzureFirewallNatRule. -func (a AzureFirewallNatRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "description", a.Description) - populate(objectMap, "destinationAddresses", a.DestinationAddresses) - populate(objectMap, "destinationPorts", a.DestinationPorts) - populate(objectMap, "name", a.Name) - populate(objectMap, "protocols", a.Protocols) - populate(objectMap, "sourceAddresses", a.SourceAddresses) - populate(objectMap, "sourceIpGroups", a.SourceIPGroups) - populate(objectMap, "translatedAddress", a.TranslatedAddress) - populate(objectMap, "translatedFqdn", a.TranslatedFqdn) - populate(objectMap, "translatedPort", a.TranslatedPort) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureFirewallNatRule. -func (a *AzureFirewallNatRule) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "description": - err = unpopulate(val, "Description", &a.Description) - delete(rawMsg, key) - case "destinationAddresses": - err = unpopulate(val, "DestinationAddresses", &a.DestinationAddresses) - delete(rawMsg, key) - case "destinationPorts": - err = unpopulate(val, "DestinationPorts", &a.DestinationPorts) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) - delete(rawMsg, key) - case "protocols": - err = unpopulate(val, "Protocols", &a.Protocols) - delete(rawMsg, key) - case "sourceAddresses": - err = unpopulate(val, "SourceAddresses", &a.SourceAddresses) - delete(rawMsg, key) - case "sourceIpGroups": - err = unpopulate(val, "SourceIPGroups", &a.SourceIPGroups) - delete(rawMsg, key) - case "translatedAddress": - err = unpopulate(val, "TranslatedAddress", &a.TranslatedAddress) - delete(rawMsg, key) - case "translatedFqdn": - err = unpopulate(val, "TranslatedFqdn", &a.TranslatedFqdn) - delete(rawMsg, key) - case "translatedPort": - err = unpopulate(val, "TranslatedPort", &a.TranslatedPort) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AzureFirewallNatRuleCollection. -func (a AzureFirewallNatRuleCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", a.Etag) - populate(objectMap, "id", a.ID) - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureFirewallNatRuleCollection. -func (a *AzureFirewallNatRuleCollection) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &a.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &a.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AzureFirewallNatRuleCollectionProperties. -func (a AzureFirewallNatRuleCollectionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "action", a.Action) - populate(objectMap, "priority", a.Priority) - populate(objectMap, "provisioningState", a.ProvisioningState) - populate(objectMap, "rules", a.Rules) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureFirewallNatRuleCollectionProperties. -func (a *AzureFirewallNatRuleCollectionProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "action": - err = unpopulate(val, "Action", &a.Action) - delete(rawMsg, key) - case "priority": - err = unpopulate(val, "Priority", &a.Priority) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) - delete(rawMsg, key) - case "rules": - err = unpopulate(val, "Rules", &a.Rules) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AzureFirewallNetworkRule. -func (a AzureFirewallNetworkRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "description", a.Description) - populate(objectMap, "destinationAddresses", a.DestinationAddresses) - populate(objectMap, "destinationFqdns", a.DestinationFqdns) - populate(objectMap, "destinationIpGroups", a.DestinationIPGroups) - populate(objectMap, "destinationPorts", a.DestinationPorts) - populate(objectMap, "name", a.Name) - populate(objectMap, "protocols", a.Protocols) - populate(objectMap, "sourceAddresses", a.SourceAddresses) - populate(objectMap, "sourceIpGroups", a.SourceIPGroups) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureFirewallNetworkRule. -func (a *AzureFirewallNetworkRule) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "description": - err = unpopulate(val, "Description", &a.Description) - delete(rawMsg, key) - case "destinationAddresses": - err = unpopulate(val, "DestinationAddresses", &a.DestinationAddresses) - delete(rawMsg, key) - case "destinationFqdns": - err = unpopulate(val, "DestinationFqdns", &a.DestinationFqdns) - delete(rawMsg, key) - case "destinationIpGroups": - err = unpopulate(val, "DestinationIPGroups", &a.DestinationIPGroups) - delete(rawMsg, key) - case "destinationPorts": - err = unpopulate(val, "DestinationPorts", &a.DestinationPorts) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) - delete(rawMsg, key) - case "protocols": - err = unpopulate(val, "Protocols", &a.Protocols) - delete(rawMsg, key) - case "sourceAddresses": - err = unpopulate(val, "SourceAddresses", &a.SourceAddresses) - delete(rawMsg, key) - case "sourceIpGroups": - err = unpopulate(val, "SourceIPGroups", &a.SourceIPGroups) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AzureFirewallNetworkRuleCollection. -func (a AzureFirewallNetworkRuleCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", a.Etag) - populate(objectMap, "id", a.ID) - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureFirewallNetworkRuleCollection. -func (a *AzureFirewallNetworkRuleCollection) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &a.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &a.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AzureFirewallNetworkRuleCollectionPropertiesFormat. -func (a AzureFirewallNetworkRuleCollectionPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "action", a.Action) - populate(objectMap, "priority", a.Priority) - populate(objectMap, "provisioningState", a.ProvisioningState) - populate(objectMap, "rules", a.Rules) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureFirewallNetworkRuleCollectionPropertiesFormat. -func (a *AzureFirewallNetworkRuleCollectionPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "action": - err = unpopulate(val, "Action", &a.Action) - delete(rawMsg, key) - case "priority": - err = unpopulate(val, "Priority", &a.Priority) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) - delete(rawMsg, key) - case "rules": - err = unpopulate(val, "Rules", &a.Rules) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AzureFirewallPropertiesFormat. -func (a AzureFirewallPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "additionalProperties", a.AdditionalProperties) - populate(objectMap, "applicationRuleCollections", a.ApplicationRuleCollections) - populate(objectMap, "firewallPolicy", a.FirewallPolicy) - populate(objectMap, "hubIPAddresses", a.HubIPAddresses) - populate(objectMap, "ipConfigurations", a.IPConfigurations) - populate(objectMap, "ipGroups", a.IPGroups) - populate(objectMap, "managementIpConfiguration", a.ManagementIPConfiguration) - populate(objectMap, "natRuleCollections", a.NatRuleCollections) - populate(objectMap, "networkRuleCollections", a.NetworkRuleCollections) - populate(objectMap, "provisioningState", a.ProvisioningState) - populate(objectMap, "sku", a.SKU) - populate(objectMap, "threatIntelMode", a.ThreatIntelMode) - populate(objectMap, "virtualHub", a.VirtualHub) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureFirewallPropertiesFormat. -func (a *AzureFirewallPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "additionalProperties": - err = unpopulate(val, "AdditionalProperties", &a.AdditionalProperties) - delete(rawMsg, key) - case "applicationRuleCollections": - err = unpopulate(val, "ApplicationRuleCollections", &a.ApplicationRuleCollections) - delete(rawMsg, key) - case "firewallPolicy": - err = unpopulate(val, "FirewallPolicy", &a.FirewallPolicy) - delete(rawMsg, key) - case "hubIPAddresses": - err = unpopulate(val, "HubIPAddresses", &a.HubIPAddresses) - delete(rawMsg, key) - case "ipConfigurations": - err = unpopulate(val, "IPConfigurations", &a.IPConfigurations) - delete(rawMsg, key) - case "ipGroups": - err = unpopulate(val, "IPGroups", &a.IPGroups) - delete(rawMsg, key) - case "managementIpConfiguration": - err = unpopulate(val, "ManagementIPConfiguration", &a.ManagementIPConfiguration) - delete(rawMsg, key) - case "natRuleCollections": - err = unpopulate(val, "NatRuleCollections", &a.NatRuleCollections) - delete(rawMsg, key) - case "networkRuleCollections": - err = unpopulate(val, "NetworkRuleCollections", &a.NetworkRuleCollections) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &a.SKU) - delete(rawMsg, key) - case "threatIntelMode": - err = unpopulate(val, "ThreatIntelMode", &a.ThreatIntelMode) - delete(rawMsg, key) - case "virtualHub": - err = unpopulate(val, "VirtualHub", &a.VirtualHub) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AzureFirewallPublicIPAddress. -func (a AzureFirewallPublicIPAddress) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "address", a.Address) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureFirewallPublicIPAddress. -func (a *AzureFirewallPublicIPAddress) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "address": - err = unpopulate(val, "Address", &a.Address) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AzureFirewallRCAction. -func (a AzureFirewallRCAction) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureFirewallRCAction. -func (a *AzureFirewallRCAction) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "type": - err = unpopulate(val, "Type", &a.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AzureFirewallSKU. -func (a AzureFirewallSKU) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "name", a.Name) - populate(objectMap, "tier", a.Tier) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureFirewallSKU. -func (a *AzureFirewallSKU) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &a.Name) - delete(rawMsg, key) - case "tier": - err = unpopulate(val, "Tier", &a.Tier) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AzureReachabilityReport. -func (a AzureReachabilityReport) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "aggregationLevel", a.AggregationLevel) - populate(objectMap, "providerLocation", a.ProviderLocation) - populate(objectMap, "reachabilityReport", a.ReachabilityReport) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureReachabilityReport. -func (a *AzureReachabilityReport) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "aggregationLevel": - err = unpopulate(val, "AggregationLevel", &a.AggregationLevel) - delete(rawMsg, key) - case "providerLocation": - err = unpopulate(val, "ProviderLocation", &a.ProviderLocation) - delete(rawMsg, key) - case "reachabilityReport": - err = unpopulate(val, "ReachabilityReport", &a.ReachabilityReport) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AzureReachabilityReportItem. -func (a AzureReachabilityReportItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "azureLocation", a.AzureLocation) - populate(objectMap, "latencies", a.Latencies) - populate(objectMap, "provider", a.Provider) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureReachabilityReportItem. -func (a *AzureReachabilityReportItem) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "azureLocation": - err = unpopulate(val, "AzureLocation", &a.AzureLocation) - delete(rawMsg, key) - case "latencies": - err = unpopulate(val, "Latencies", &a.Latencies) - delete(rawMsg, key) - case "provider": - err = unpopulate(val, "Provider", &a.Provider) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AzureReachabilityReportLatencyInfo. -func (a AzureReachabilityReportLatencyInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "score", a.Score) - populateTimeRFC3339(objectMap, "timeStamp", a.TimeStamp) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureReachabilityReportLatencyInfo. -func (a *AzureReachabilityReportLatencyInfo) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "score": - err = unpopulate(val, "Score", &a.Score) - delete(rawMsg, key) - case "timeStamp": - err = unpopulateTimeRFC3339(val, "TimeStamp", &a.TimeStamp) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AzureReachabilityReportLocation. -func (a AzureReachabilityReportLocation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "city", a.City) - populate(objectMap, "country", a.Country) - populate(objectMap, "state", a.State) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureReachabilityReportLocation. -func (a *AzureReachabilityReportLocation) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "city": - err = unpopulate(val, "City", &a.City) - delete(rawMsg, key) - case "country": - err = unpopulate(val, "Country", &a.Country) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &a.State) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AzureReachabilityReportParameters. -func (a AzureReachabilityReportParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "azureLocations", a.AzureLocations) - populateTimeRFC3339(objectMap, "endTime", a.EndTime) - populate(objectMap, "providerLocation", a.ProviderLocation) - populate(objectMap, "providers", a.Providers) - populateTimeRFC3339(objectMap, "startTime", a.StartTime) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureReachabilityReportParameters. -func (a *AzureReachabilityReportParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "azureLocations": - err = unpopulate(val, "AzureLocations", &a.AzureLocations) - delete(rawMsg, key) - case "endTime": - err = unpopulateTimeRFC3339(val, "EndTime", &a.EndTime) - delete(rawMsg, key) - case "providerLocation": - err = unpopulate(val, "ProviderLocation", &a.ProviderLocation) - delete(rawMsg, key) - case "providers": - err = unpopulate(val, "Providers", &a.Providers) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &a.StartTime) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AzureWebCategory. -func (a AzureWebCategory) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", a.Etag) - populate(objectMap, "id", a.ID) - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWebCategory. -func (a *AzureWebCategory) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &a.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &a.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AzureWebCategoryListResult. -func (a AzureWebCategoryListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", a.NextLink) - populate(objectMap, "value", a.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWebCategoryListResult. -func (a *AzureWebCategoryListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &a.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &a.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AzureWebCategoryPropertiesFormat. -func (a AzureWebCategoryPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "group", a.Group) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWebCategoryPropertiesFormat. -func (a *AzureWebCategoryPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "group": - err = unpopulate(val, "Group", &a.Group) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type BGPCommunity. -func (b BGPCommunity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "communityName", b.CommunityName) - populate(objectMap, "communityPrefixes", b.CommunityPrefixes) - populate(objectMap, "communityValue", b.CommunityValue) - populate(objectMap, "isAuthorizedToUse", b.IsAuthorizedToUse) - populate(objectMap, "serviceGroup", b.ServiceGroup) - populate(objectMap, "serviceSupportedRegion", b.ServiceSupportedRegion) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type BGPCommunity. -func (b *BGPCommunity) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "communityName": - err = unpopulate(val, "CommunityName", &b.CommunityName) - delete(rawMsg, key) - case "communityPrefixes": - err = unpopulate(val, "CommunityPrefixes", &b.CommunityPrefixes) - delete(rawMsg, key) - case "communityValue": - err = unpopulate(val, "CommunityValue", &b.CommunityValue) - delete(rawMsg, key) - case "isAuthorizedToUse": - err = unpopulate(val, "IsAuthorizedToUse", &b.IsAuthorizedToUse) - delete(rawMsg, key) - case "serviceGroup": - err = unpopulate(val, "ServiceGroup", &b.ServiceGroup) - delete(rawMsg, key) - case "serviceSupportedRegion": - err = unpopulate(val, "ServiceSupportedRegion", &b.ServiceSupportedRegion) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type BackendAddressInboundNatRulePortMappings. -func (b BackendAddressInboundNatRulePortMappings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "inboundNatRulePortMappings", b.InboundNatRulePortMappings) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type BackendAddressInboundNatRulePortMappings. -func (b *BackendAddressInboundNatRulePortMappings) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "inboundNatRulePortMappings": - err = unpopulate(val, "InboundNatRulePortMappings", &b.InboundNatRulePortMappings) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type BackendAddressPool. -func (b BackendAddressPool) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", b.Etag) - populate(objectMap, "id", b.ID) - populate(objectMap, "name", b.Name) - populate(objectMap, "properties", b.Properties) - populate(objectMap, "type", b.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type BackendAddressPool. -func (b *BackendAddressPool) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &b.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &b.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &b.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &b.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &b.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type BackendAddressPoolPropertiesFormat. -func (b BackendAddressPoolPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "backendIPConfigurations", b.BackendIPConfigurations) - populate(objectMap, "drainPeriodInSeconds", b.DrainPeriodInSeconds) - populate(objectMap, "inboundNatRules", b.InboundNatRules) - populate(objectMap, "loadBalancerBackendAddresses", b.LoadBalancerBackendAddresses) - populate(objectMap, "loadBalancingRules", b.LoadBalancingRules) - populate(objectMap, "location", b.Location) - populate(objectMap, "outboundRule", b.OutboundRule) - populate(objectMap, "outboundRules", b.OutboundRules) - populate(objectMap, "provisioningState", b.ProvisioningState) - populate(objectMap, "tunnelInterfaces", b.TunnelInterfaces) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type BackendAddressPoolPropertiesFormat. -func (b *BackendAddressPoolPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "backendIPConfigurations": - err = unpopulate(val, "BackendIPConfigurations", &b.BackendIPConfigurations) - delete(rawMsg, key) - case "drainPeriodInSeconds": - err = unpopulate(val, "DrainPeriodInSeconds", &b.DrainPeriodInSeconds) - delete(rawMsg, key) - case "inboundNatRules": - err = unpopulate(val, "InboundNatRules", &b.InboundNatRules) - delete(rawMsg, key) - case "loadBalancerBackendAddresses": - err = unpopulate(val, "LoadBalancerBackendAddresses", &b.LoadBalancerBackendAddresses) - delete(rawMsg, key) - case "loadBalancingRules": - err = unpopulate(val, "LoadBalancingRules", &b.LoadBalancingRules) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &b.Location) - delete(rawMsg, key) - case "outboundRule": - err = unpopulate(val, "OutboundRule", &b.OutboundRule) - delete(rawMsg, key) - case "outboundRules": - err = unpopulate(val, "OutboundRules", &b.OutboundRules) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &b.ProvisioningState) - delete(rawMsg, key) - case "tunnelInterfaces": - err = unpopulate(val, "TunnelInterfaces", &b.TunnelInterfaces) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type BaseAdminRule. -func (b BaseAdminRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", b.Etag) - populate(objectMap, "id", b.ID) - objectMap["kind"] = b.Kind - populate(objectMap, "name", b.Name) - populate(objectMap, "systemData", b.SystemData) - populate(objectMap, "type", b.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type BaseAdminRule. -func (b *BaseAdminRule) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &b.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &b.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &b.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &b.Name) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &b.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &b.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type BastionActiveSession. -func (b BastionActiveSession) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "protocol", b.Protocol) - populate(objectMap, "resourceType", b.ResourceType) - populate(objectMap, "sessionDurationInMins", b.SessionDurationInMins) - populate(objectMap, "sessionId", b.SessionID) - populate(objectMap, "startTime", &b.StartTime) - populate(objectMap, "targetHostName", b.TargetHostName) - populate(objectMap, "targetIpAddress", b.TargetIPAddress) - populate(objectMap, "targetResourceGroup", b.TargetResourceGroup) - populate(objectMap, "targetResourceId", b.TargetResourceID) - populate(objectMap, "targetSubscriptionId", b.TargetSubscriptionID) - populate(objectMap, "userName", b.UserName) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type BastionActiveSession. -func (b *BastionActiveSession) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "protocol": - err = unpopulate(val, "Protocol", &b.Protocol) - delete(rawMsg, key) - case "resourceType": - err = unpopulate(val, "ResourceType", &b.ResourceType) - delete(rawMsg, key) - case "sessionDurationInMins": - err = unpopulate(val, "SessionDurationInMins", &b.SessionDurationInMins) - delete(rawMsg, key) - case "sessionId": - err = unpopulate(val, "SessionID", &b.SessionID) - delete(rawMsg, key) - case "startTime": - err = unpopulate(val, "StartTime", &b.StartTime) - delete(rawMsg, key) - case "targetHostName": - err = unpopulate(val, "TargetHostName", &b.TargetHostName) - delete(rawMsg, key) - case "targetIpAddress": - err = unpopulate(val, "TargetIPAddress", &b.TargetIPAddress) - delete(rawMsg, key) - case "targetResourceGroup": - err = unpopulate(val, "TargetResourceGroup", &b.TargetResourceGroup) - delete(rawMsg, key) - case "targetResourceId": - err = unpopulate(val, "TargetResourceID", &b.TargetResourceID) - delete(rawMsg, key) - case "targetSubscriptionId": - err = unpopulate(val, "TargetSubscriptionID", &b.TargetSubscriptionID) - delete(rawMsg, key) - case "userName": - err = unpopulate(val, "UserName", &b.UserName) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type BastionActiveSessionListResult. -func (b BastionActiveSessionListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", b.NextLink) - populate(objectMap, "value", b.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type BastionActiveSessionListResult. -func (b *BastionActiveSessionListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &b.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &b.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type BastionHost. -func (b BastionHost) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", b.Etag) - populate(objectMap, "id", b.ID) - populate(objectMap, "location", b.Location) - populate(objectMap, "name", b.Name) - populate(objectMap, "properties", b.Properties) - populate(objectMap, "sku", b.SKU) - populate(objectMap, "tags", b.Tags) - populate(objectMap, "type", b.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type BastionHost. -func (b *BastionHost) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &b.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &b.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &b.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &b.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &b.Properties) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &b.SKU) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &b.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &b.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type BastionHostIPConfiguration. -func (b BastionHostIPConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", b.Etag) - populate(objectMap, "id", b.ID) - populate(objectMap, "name", b.Name) - populate(objectMap, "properties", b.Properties) - populate(objectMap, "type", b.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type BastionHostIPConfiguration. -func (b *BastionHostIPConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &b.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &b.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &b.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &b.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &b.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type BastionHostIPConfigurationPropertiesFormat. -func (b BastionHostIPConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "privateIPAllocationMethod", b.PrivateIPAllocationMethod) - populate(objectMap, "provisioningState", b.ProvisioningState) - populate(objectMap, "publicIPAddress", b.PublicIPAddress) - populate(objectMap, "subnet", b.Subnet) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type BastionHostIPConfigurationPropertiesFormat. -func (b *BastionHostIPConfigurationPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "privateIPAllocationMethod": - err = unpopulate(val, "PrivateIPAllocationMethod", &b.PrivateIPAllocationMethod) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &b.ProvisioningState) - delete(rawMsg, key) - case "publicIPAddress": - err = unpopulate(val, "PublicIPAddress", &b.PublicIPAddress) - delete(rawMsg, key) - case "subnet": - err = unpopulate(val, "Subnet", &b.Subnet) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type BastionHostListResult. -func (b BastionHostListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", b.NextLink) - populate(objectMap, "value", b.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type BastionHostListResult. -func (b *BastionHostListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &b.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &b.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type BastionHostPropertiesFormat. -func (b BastionHostPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "dnsName", b.DNSName) - populate(objectMap, "disableCopyPaste", b.DisableCopyPaste) - populate(objectMap, "enableFileCopy", b.EnableFileCopy) - populate(objectMap, "enableIpConnect", b.EnableIPConnect) - populate(objectMap, "enableShareableLink", b.EnableShareableLink) - populate(objectMap, "enableTunneling", b.EnableTunneling) - populate(objectMap, "ipConfigurations", b.IPConfigurations) - populate(objectMap, "provisioningState", b.ProvisioningState) - populate(objectMap, "scaleUnits", b.ScaleUnits) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type BastionHostPropertiesFormat. -func (b *BastionHostPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "dnsName": - err = unpopulate(val, "DNSName", &b.DNSName) - delete(rawMsg, key) - case "disableCopyPaste": - err = unpopulate(val, "DisableCopyPaste", &b.DisableCopyPaste) - delete(rawMsg, key) - case "enableFileCopy": - err = unpopulate(val, "EnableFileCopy", &b.EnableFileCopy) - delete(rawMsg, key) - case "enableIpConnect": - err = unpopulate(val, "EnableIPConnect", &b.EnableIPConnect) - delete(rawMsg, key) - case "enableShareableLink": - err = unpopulate(val, "EnableShareableLink", &b.EnableShareableLink) - delete(rawMsg, key) - case "enableTunneling": - err = unpopulate(val, "EnableTunneling", &b.EnableTunneling) - delete(rawMsg, key) - case "ipConfigurations": - err = unpopulate(val, "IPConfigurations", &b.IPConfigurations) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &b.ProvisioningState) - delete(rawMsg, key) - case "scaleUnits": - err = unpopulate(val, "ScaleUnits", &b.ScaleUnits) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type BastionSessionDeleteResult. -func (b BastionSessionDeleteResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", b.NextLink) - populate(objectMap, "value", b.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type BastionSessionDeleteResult. -func (b *BastionSessionDeleteResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &b.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &b.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type BastionSessionState. -func (b BastionSessionState) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "message", b.Message) - populate(objectMap, "sessionId", b.SessionID) - populate(objectMap, "state", b.State) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type BastionSessionState. -func (b *BastionSessionState) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "message": - err = unpopulate(val, "Message", &b.Message) - delete(rawMsg, key) - case "sessionId": - err = unpopulate(val, "SessionID", &b.SessionID) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &b.State) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type BastionShareableLink. -func (b BastionShareableLink) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "bsl", b.Bsl) - populate(objectMap, "createdAt", b.CreatedAt) - populate(objectMap, "message", b.Message) - populate(objectMap, "vm", b.VM) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type BastionShareableLink. -func (b *BastionShareableLink) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "bsl": - err = unpopulate(val, "Bsl", &b.Bsl) - delete(rawMsg, key) - case "createdAt": - err = unpopulate(val, "CreatedAt", &b.CreatedAt) - delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &b.Message) - delete(rawMsg, key) - case "vm": - err = unpopulate(val, "VM", &b.VM) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type BastionShareableLinkListRequest. -func (b BastionShareableLinkListRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "vms", b.VMs) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type BastionShareableLinkListRequest. -func (b *BastionShareableLinkListRequest) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "vms": - err = unpopulate(val, "VMs", &b.VMs) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type BastionShareableLinkListResult. -func (b BastionShareableLinkListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", b.NextLink) - populate(objectMap, "value", b.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type BastionShareableLinkListResult. -func (b *BastionShareableLinkListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &b.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &b.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type BgpConnection. -func (b BgpConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", b.Etag) - populate(objectMap, "id", b.ID) - populate(objectMap, "name", b.Name) - populate(objectMap, "properties", b.Properties) - populate(objectMap, "type", b.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type BgpConnection. -func (b *BgpConnection) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &b.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &b.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &b.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &b.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &b.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type BgpConnectionProperties. -func (b BgpConnectionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "connectionState", b.ConnectionState) - populate(objectMap, "hubVirtualNetworkConnection", b.HubVirtualNetworkConnection) - populate(objectMap, "peerAsn", b.PeerAsn) - populate(objectMap, "peerIp", b.PeerIP) - populate(objectMap, "provisioningState", b.ProvisioningState) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type BgpConnectionProperties. -func (b *BgpConnectionProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "connectionState": - err = unpopulate(val, "ConnectionState", &b.ConnectionState) - delete(rawMsg, key) - case "hubVirtualNetworkConnection": - err = unpopulate(val, "HubVirtualNetworkConnection", &b.HubVirtualNetworkConnection) - delete(rawMsg, key) - case "peerAsn": - err = unpopulate(val, "PeerAsn", &b.PeerAsn) - delete(rawMsg, key) - case "peerIp": - err = unpopulate(val, "PeerIP", &b.PeerIP) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &b.ProvisioningState) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type BgpPeerStatus. -func (b BgpPeerStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "asn", b.Asn) - populate(objectMap, "connectedDuration", b.ConnectedDuration) - populate(objectMap, "localAddress", b.LocalAddress) - populate(objectMap, "messagesReceived", b.MessagesReceived) - populate(objectMap, "messagesSent", b.MessagesSent) - populate(objectMap, "neighbor", b.Neighbor) - populate(objectMap, "routesReceived", b.RoutesReceived) - populate(objectMap, "state", b.State) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type BgpPeerStatus. -func (b *BgpPeerStatus) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "asn": - err = unpopulate(val, "Asn", &b.Asn) - delete(rawMsg, key) - case "connectedDuration": - err = unpopulate(val, "ConnectedDuration", &b.ConnectedDuration) - delete(rawMsg, key) - case "localAddress": - err = unpopulate(val, "LocalAddress", &b.LocalAddress) - delete(rawMsg, key) - case "messagesReceived": - err = unpopulate(val, "MessagesReceived", &b.MessagesReceived) - delete(rawMsg, key) - case "messagesSent": - err = unpopulate(val, "MessagesSent", &b.MessagesSent) - delete(rawMsg, key) - case "neighbor": - err = unpopulate(val, "Neighbor", &b.Neighbor) - delete(rawMsg, key) - case "routesReceived": - err = unpopulate(val, "RoutesReceived", &b.RoutesReceived) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &b.State) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type BgpPeerStatusListResult. -func (b BgpPeerStatusListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "value", b.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type BgpPeerStatusListResult. -func (b *BgpPeerStatusListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "value": - err = unpopulate(val, "Value", &b.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type BgpServiceCommunity. -func (b BgpServiceCommunity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", b.ID) - populate(objectMap, "location", b.Location) - populate(objectMap, "name", b.Name) - populate(objectMap, "properties", b.Properties) - populate(objectMap, "tags", b.Tags) - populate(objectMap, "type", b.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type BgpServiceCommunity. -func (b *BgpServiceCommunity) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &b.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &b.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &b.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &b.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &b.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &b.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type BgpServiceCommunityListResult. -func (b BgpServiceCommunityListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", b.NextLink) - populate(objectMap, "value", b.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type BgpServiceCommunityListResult. -func (b *BgpServiceCommunityListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &b.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &b.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type BgpServiceCommunityPropertiesFormat. -func (b BgpServiceCommunityPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "bgpCommunities", b.BgpCommunities) - populate(objectMap, "serviceName", b.ServiceName) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type BgpServiceCommunityPropertiesFormat. -func (b *BgpServiceCommunityPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "bgpCommunities": - err = unpopulate(val, "BgpCommunities", &b.BgpCommunities) - delete(rawMsg, key) - case "serviceName": - err = unpopulate(val, "ServiceName", &b.ServiceName) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type BgpSettings. -func (b BgpSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "asn", b.Asn) - populate(objectMap, "bgpPeeringAddress", b.BgpPeeringAddress) - populate(objectMap, "bgpPeeringAddresses", b.BgpPeeringAddresses) - populate(objectMap, "peerWeight", b.PeerWeight) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type BgpSettings. -func (b *BgpSettings) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "asn": - err = unpopulate(val, "Asn", &b.Asn) - delete(rawMsg, key) - case "bgpPeeringAddress": - err = unpopulate(val, "BgpPeeringAddress", &b.BgpPeeringAddress) - delete(rawMsg, key) - case "bgpPeeringAddresses": - err = unpopulate(val, "BgpPeeringAddresses", &b.BgpPeeringAddresses) - delete(rawMsg, key) - case "peerWeight": - err = unpopulate(val, "PeerWeight", &b.PeerWeight) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type BreakOutCategoryPolicies. -func (b BreakOutCategoryPolicies) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "allow", b.Allow) - populate(objectMap, "default", b.Default) - populate(objectMap, "optimize", b.Optimize) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type BreakOutCategoryPolicies. -func (b *BreakOutCategoryPolicies) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "allow": - err = unpopulate(val, "Allow", &b.Allow) - delete(rawMsg, key) - case "default": - err = unpopulate(val, "Default", &b.Default) - delete(rawMsg, key) - case "optimize": - err = unpopulate(val, "Optimize", &b.Optimize) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CheckPrivateLinkServiceVisibilityRequest. -func (c CheckPrivateLinkServiceVisibilityRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "privateLinkServiceAlias", c.PrivateLinkServiceAlias) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CheckPrivateLinkServiceVisibilityRequest. -func (c *CheckPrivateLinkServiceVisibilityRequest) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "privateLinkServiceAlias": - err = unpopulate(val, "PrivateLinkServiceAlias", &c.PrivateLinkServiceAlias) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ChildResource. -func (c ChildResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", c.Etag) - populate(objectMap, "id", c.ID) - populate(objectMap, "name", c.Name) - populate(objectMap, "type", c.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ChildResource. -func (c *ChildResource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &c.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &c.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CloudError. -func (c CloudError) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "error", c.Error) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CloudError. -func (c *CloudError) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "error": - err = unpopulate(val, "Error", &c.Error) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CloudErrorBody. -func (c CloudErrorBody) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "code", c.Code) - populate(objectMap, "details", c.Details) - populate(objectMap, "message", c.Message) - populate(objectMap, "target", c.Target) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CloudErrorBody. -func (c *CloudErrorBody) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "code": - err = unpopulate(val, "Code", &c.Code) - delete(rawMsg, key) - case "details": - err = unpopulate(val, "Details", &c.Details) - delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &c.Message) - delete(rawMsg, key) - case "target": - err = unpopulate(val, "Target", &c.Target) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties. -func (c Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "clientId", c.ClientID) - populate(objectMap, "principalId", c.PrincipalID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties. -func (c *Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "clientId": - err = unpopulate(val, "ClientID", &c.ClientID) - delete(rawMsg, key) - case "principalId": - err = unpopulate(val, "PrincipalID", &c.PrincipalID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ConfigurationDiagnosticParameters. -func (c ConfigurationDiagnosticParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "profiles", c.Profiles) - populate(objectMap, "targetResourceId", c.TargetResourceID) - populate(objectMap, "verbosityLevel", c.VerbosityLevel) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationDiagnosticParameters. -func (c *ConfigurationDiagnosticParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "profiles": - err = unpopulate(val, "Profiles", &c.Profiles) - delete(rawMsg, key) - case "targetResourceId": - err = unpopulate(val, "TargetResourceID", &c.TargetResourceID) - delete(rawMsg, key) - case "verbosityLevel": - err = unpopulate(val, "VerbosityLevel", &c.VerbosityLevel) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ConfigurationDiagnosticProfile. -func (c ConfigurationDiagnosticProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "destination", c.Destination) - populate(objectMap, "destinationPort", c.DestinationPort) - populate(objectMap, "direction", c.Direction) - populate(objectMap, "protocol", c.Protocol) - populate(objectMap, "source", c.Source) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationDiagnosticProfile. -func (c *ConfigurationDiagnosticProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "destination": - err = unpopulate(val, "Destination", &c.Destination) - delete(rawMsg, key) - case "destinationPort": - err = unpopulate(val, "DestinationPort", &c.DestinationPort) - delete(rawMsg, key) - case "direction": - err = unpopulate(val, "Direction", &c.Direction) - delete(rawMsg, key) - case "protocol": - err = unpopulate(val, "Protocol", &c.Protocol) - delete(rawMsg, key) - case "source": - err = unpopulate(val, "Source", &c.Source) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ConfigurationDiagnosticResponse. -func (c ConfigurationDiagnosticResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "results", c.Results) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationDiagnosticResponse. -func (c *ConfigurationDiagnosticResponse) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "results": - err = unpopulate(val, "Results", &c.Results) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ConfigurationDiagnosticResult. -func (c ConfigurationDiagnosticResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "networkSecurityGroupResult", c.NetworkSecurityGroupResult) - populate(objectMap, "profile", c.Profile) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationDiagnosticResult. -func (c *ConfigurationDiagnosticResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "networkSecurityGroupResult": - err = unpopulate(val, "NetworkSecurityGroupResult", &c.NetworkSecurityGroupResult) - delete(rawMsg, key) - case "profile": - err = unpopulate(val, "Profile", &c.Profile) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ConfigurationGroup. -func (c ConfigurationGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", c.ID) - populate(objectMap, "properties", c.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationGroup. -func (c *ConfigurationGroup) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &c.ID) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &c.Properties) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ConnectionMonitor. -func (c ConnectionMonitor) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "location", c.Location) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "tags", c.Tags) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionMonitor. -func (c *ConnectionMonitor) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "location": - err = unpopulate(val, "Location", &c.Location) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &c.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &c.Tags) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ConnectionMonitorDestination. -func (c ConnectionMonitorDestination) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "address", c.Address) - populate(objectMap, "port", c.Port) - populate(objectMap, "resourceId", c.ResourceID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionMonitorDestination. -func (c *ConnectionMonitorDestination) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "address": - err = unpopulate(val, "Address", &c.Address) - delete(rawMsg, key) - case "port": - err = unpopulate(val, "Port", &c.Port) - delete(rawMsg, key) - case "resourceId": - err = unpopulate(val, "ResourceID", &c.ResourceID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ConnectionMonitorEndpoint. -func (c ConnectionMonitorEndpoint) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "address", c.Address) - populate(objectMap, "coverageLevel", c.CoverageLevel) - populate(objectMap, "filter", c.Filter) - populate(objectMap, "name", c.Name) - populate(objectMap, "resourceId", c.ResourceID) - populate(objectMap, "scope", c.Scope) - populate(objectMap, "type", c.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionMonitorEndpoint. -func (c *ConnectionMonitorEndpoint) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "address": - err = unpopulate(val, "Address", &c.Address) - delete(rawMsg, key) - case "coverageLevel": - err = unpopulate(val, "CoverageLevel", &c.CoverageLevel) - delete(rawMsg, key) - case "filter": - err = unpopulate(val, "Filter", &c.Filter) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) - delete(rawMsg, key) - case "resourceId": - err = unpopulate(val, "ResourceID", &c.ResourceID) - delete(rawMsg, key) - case "scope": - err = unpopulate(val, "Scope", &c.Scope) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ConnectionMonitorEndpointFilter. -func (c ConnectionMonitorEndpointFilter) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "items", c.Items) - populate(objectMap, "type", c.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionMonitorEndpointFilter. -func (c *ConnectionMonitorEndpointFilter) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "items": - err = unpopulate(val, "Items", &c.Items) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ConnectionMonitorEndpointFilterItem. -func (c ConnectionMonitorEndpointFilterItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "address", c.Address) - populate(objectMap, "type", c.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionMonitorEndpointFilterItem. -func (c *ConnectionMonitorEndpointFilterItem) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "address": - err = unpopulate(val, "Address", &c.Address) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ConnectionMonitorEndpointScope. -func (c ConnectionMonitorEndpointScope) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "exclude", c.Exclude) - populate(objectMap, "include", c.Include) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionMonitorEndpointScope. -func (c *ConnectionMonitorEndpointScope) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "exclude": - err = unpopulate(val, "Exclude", &c.Exclude) - delete(rawMsg, key) - case "include": - err = unpopulate(val, "Include", &c.Include) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ConnectionMonitorEndpointScopeItem. -func (c ConnectionMonitorEndpointScopeItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "address", c.Address) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionMonitorEndpointScopeItem. -func (c *ConnectionMonitorEndpointScopeItem) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "address": - err = unpopulate(val, "Address", &c.Address) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ConnectionMonitorHTTPConfiguration. -func (c ConnectionMonitorHTTPConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "method", c.Method) - populate(objectMap, "path", c.Path) - populate(objectMap, "port", c.Port) - populate(objectMap, "preferHTTPS", c.PreferHTTPS) - populate(objectMap, "requestHeaders", c.RequestHeaders) - populate(objectMap, "validStatusCodeRanges", c.ValidStatusCodeRanges) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionMonitorHTTPConfiguration. -func (c *ConnectionMonitorHTTPConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "method": - err = unpopulate(val, "Method", &c.Method) - delete(rawMsg, key) - case "path": - err = unpopulate(val, "Path", &c.Path) - delete(rawMsg, key) - case "port": - err = unpopulate(val, "Port", &c.Port) - delete(rawMsg, key) - case "preferHTTPS": - err = unpopulate(val, "PreferHTTPS", &c.PreferHTTPS) - delete(rawMsg, key) - case "requestHeaders": - err = unpopulate(val, "RequestHeaders", &c.RequestHeaders) - delete(rawMsg, key) - case "validStatusCodeRanges": - err = unpopulate(val, "ValidStatusCodeRanges", &c.ValidStatusCodeRanges) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ConnectionMonitorIcmpConfiguration. -func (c ConnectionMonitorIcmpConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "disableTraceRoute", c.DisableTraceRoute) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionMonitorIcmpConfiguration. -func (c *ConnectionMonitorIcmpConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "disableTraceRoute": - err = unpopulate(val, "DisableTraceRoute", &c.DisableTraceRoute) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ConnectionMonitorListResult. -func (c ConnectionMonitorListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "value", c.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionMonitorListResult. -func (c *ConnectionMonitorListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "value": - err = unpopulate(val, "Value", &c.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ConnectionMonitorOutput. -func (c ConnectionMonitorOutput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "type", c.Type) - populate(objectMap, "workspaceSettings", c.WorkspaceSettings) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionMonitorOutput. -func (c *ConnectionMonitorOutput) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "type": - err = unpopulate(val, "Type", &c.Type) - delete(rawMsg, key) - case "workspaceSettings": - err = unpopulate(val, "WorkspaceSettings", &c.WorkspaceSettings) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ConnectionMonitorParameters. -func (c ConnectionMonitorParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "autoStart", c.AutoStart) - populate(objectMap, "destination", c.Destination) - populate(objectMap, "endpoints", c.Endpoints) - populate(objectMap, "monitoringIntervalInSeconds", c.MonitoringIntervalInSeconds) - populate(objectMap, "notes", c.Notes) - populate(objectMap, "outputs", c.Outputs) - populate(objectMap, "source", c.Source) - populate(objectMap, "testConfigurations", c.TestConfigurations) - populate(objectMap, "testGroups", c.TestGroups) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionMonitorParameters. -func (c *ConnectionMonitorParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "autoStart": - err = unpopulate(val, "AutoStart", &c.AutoStart) - delete(rawMsg, key) - case "destination": - err = unpopulate(val, "Destination", &c.Destination) - delete(rawMsg, key) - case "endpoints": - err = unpopulate(val, "Endpoints", &c.Endpoints) - delete(rawMsg, key) - case "monitoringIntervalInSeconds": - err = unpopulate(val, "MonitoringIntervalInSeconds", &c.MonitoringIntervalInSeconds) - delete(rawMsg, key) - case "notes": - err = unpopulate(val, "Notes", &c.Notes) - delete(rawMsg, key) - case "outputs": - err = unpopulate(val, "Outputs", &c.Outputs) - delete(rawMsg, key) - case "source": - err = unpopulate(val, "Source", &c.Source) - delete(rawMsg, key) - case "testConfigurations": - err = unpopulate(val, "TestConfigurations", &c.TestConfigurations) - delete(rawMsg, key) - case "testGroups": - err = unpopulate(val, "TestGroups", &c.TestGroups) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ConnectionMonitorQueryResult. -func (c ConnectionMonitorQueryResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "sourceStatus", c.SourceStatus) - populate(objectMap, "states", c.States) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionMonitorQueryResult. -func (c *ConnectionMonitorQueryResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "sourceStatus": - err = unpopulate(val, "SourceStatus", &c.SourceStatus) - delete(rawMsg, key) - case "states": - err = unpopulate(val, "States", &c.States) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ConnectionMonitorResult. -func (c ConnectionMonitorResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", c.Etag) - populate(objectMap, "id", c.ID) - populate(objectMap, "location", c.Location) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "tags", c.Tags) - populate(objectMap, "type", c.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionMonitorResult. -func (c *ConnectionMonitorResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &c.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &c.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &c.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &c.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &c.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ConnectionMonitorResultProperties. -func (c ConnectionMonitorResultProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "autoStart", c.AutoStart) - populate(objectMap, "connectionMonitorType", c.ConnectionMonitorType) - populate(objectMap, "destination", c.Destination) - populate(objectMap, "endpoints", c.Endpoints) - populate(objectMap, "monitoringIntervalInSeconds", c.MonitoringIntervalInSeconds) - populate(objectMap, "monitoringStatus", c.MonitoringStatus) - populate(objectMap, "notes", c.Notes) - populate(objectMap, "outputs", c.Outputs) - populate(objectMap, "provisioningState", c.ProvisioningState) - populate(objectMap, "source", c.Source) - populateTimeRFC3339(objectMap, "startTime", c.StartTime) - populate(objectMap, "testConfigurations", c.TestConfigurations) - populate(objectMap, "testGroups", c.TestGroups) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionMonitorResultProperties. -func (c *ConnectionMonitorResultProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "autoStart": - err = unpopulate(val, "AutoStart", &c.AutoStart) - delete(rawMsg, key) - case "connectionMonitorType": - err = unpopulate(val, "ConnectionMonitorType", &c.ConnectionMonitorType) - delete(rawMsg, key) - case "destination": - err = unpopulate(val, "Destination", &c.Destination) - delete(rawMsg, key) - case "endpoints": - err = unpopulate(val, "Endpoints", &c.Endpoints) - delete(rawMsg, key) - case "monitoringIntervalInSeconds": - err = unpopulate(val, "MonitoringIntervalInSeconds", &c.MonitoringIntervalInSeconds) - delete(rawMsg, key) - case "monitoringStatus": - err = unpopulate(val, "MonitoringStatus", &c.MonitoringStatus) - delete(rawMsg, key) - case "notes": - err = unpopulate(val, "Notes", &c.Notes) - delete(rawMsg, key) - case "outputs": - err = unpopulate(val, "Outputs", &c.Outputs) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) - delete(rawMsg, key) - case "source": - err = unpopulate(val, "Source", &c.Source) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &c.StartTime) - delete(rawMsg, key) - case "testConfigurations": - err = unpopulate(val, "TestConfigurations", &c.TestConfigurations) - delete(rawMsg, key) - case "testGroups": - err = unpopulate(val, "TestGroups", &c.TestGroups) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ConnectionMonitorSource. -func (c ConnectionMonitorSource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "port", c.Port) - populate(objectMap, "resourceId", c.ResourceID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionMonitorSource. -func (c *ConnectionMonitorSource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "port": - err = unpopulate(val, "Port", &c.Port) - delete(rawMsg, key) - case "resourceId": - err = unpopulate(val, "ResourceID", &c.ResourceID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ConnectionMonitorSuccessThreshold. -func (c ConnectionMonitorSuccessThreshold) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "checksFailedPercent", c.ChecksFailedPercent) - populate(objectMap, "roundTripTimeMs", c.RoundTripTimeMs) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionMonitorSuccessThreshold. -func (c *ConnectionMonitorSuccessThreshold) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "checksFailedPercent": - err = unpopulate(val, "ChecksFailedPercent", &c.ChecksFailedPercent) - delete(rawMsg, key) - case "roundTripTimeMs": - err = unpopulate(val, "RoundTripTimeMs", &c.RoundTripTimeMs) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ConnectionMonitorTCPConfiguration. -func (c ConnectionMonitorTCPConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "destinationPortBehavior", c.DestinationPortBehavior) - populate(objectMap, "disableTraceRoute", c.DisableTraceRoute) - populate(objectMap, "port", c.Port) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionMonitorTCPConfiguration. -func (c *ConnectionMonitorTCPConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "destinationPortBehavior": - err = unpopulate(val, "DestinationPortBehavior", &c.DestinationPortBehavior) - delete(rawMsg, key) - case "disableTraceRoute": - err = unpopulate(val, "DisableTraceRoute", &c.DisableTraceRoute) - delete(rawMsg, key) - case "port": - err = unpopulate(val, "Port", &c.Port) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ConnectionMonitorTestConfiguration. -func (c ConnectionMonitorTestConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "httpConfiguration", c.HTTPConfiguration) - populate(objectMap, "icmpConfiguration", c.IcmpConfiguration) - populate(objectMap, "name", c.Name) - populate(objectMap, "preferredIPVersion", c.PreferredIPVersion) - populate(objectMap, "protocol", c.Protocol) - populate(objectMap, "successThreshold", c.SuccessThreshold) - populate(objectMap, "tcpConfiguration", c.TCPConfiguration) - populate(objectMap, "testFrequencySec", c.TestFrequencySec) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionMonitorTestConfiguration. -func (c *ConnectionMonitorTestConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "httpConfiguration": - err = unpopulate(val, "HTTPConfiguration", &c.HTTPConfiguration) - delete(rawMsg, key) - case "icmpConfiguration": - err = unpopulate(val, "IcmpConfiguration", &c.IcmpConfiguration) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) - delete(rawMsg, key) - case "preferredIPVersion": - err = unpopulate(val, "PreferredIPVersion", &c.PreferredIPVersion) - delete(rawMsg, key) - case "protocol": - err = unpopulate(val, "Protocol", &c.Protocol) - delete(rawMsg, key) - case "successThreshold": - err = unpopulate(val, "SuccessThreshold", &c.SuccessThreshold) - delete(rawMsg, key) - case "tcpConfiguration": - err = unpopulate(val, "TCPConfiguration", &c.TCPConfiguration) - delete(rawMsg, key) - case "testFrequencySec": - err = unpopulate(val, "TestFrequencySec", &c.TestFrequencySec) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ConnectionMonitorTestGroup. -func (c ConnectionMonitorTestGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "destinations", c.Destinations) - populate(objectMap, "disable", c.Disable) - populate(objectMap, "name", c.Name) - populate(objectMap, "sources", c.Sources) - populate(objectMap, "testConfigurations", c.TestConfigurations) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionMonitorTestGroup. -func (c *ConnectionMonitorTestGroup) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "destinations": - err = unpopulate(val, "Destinations", &c.Destinations) - delete(rawMsg, key) - case "disable": - err = unpopulate(val, "Disable", &c.Disable) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) - delete(rawMsg, key) - case "sources": - err = unpopulate(val, "Sources", &c.Sources) - delete(rawMsg, key) - case "testConfigurations": - err = unpopulate(val, "TestConfigurations", &c.TestConfigurations) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ConnectionMonitorWorkspaceSettings. -func (c ConnectionMonitorWorkspaceSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "workspaceResourceId", c.WorkspaceResourceID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionMonitorWorkspaceSettings. -func (c *ConnectionMonitorWorkspaceSettings) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "workspaceResourceId": - err = unpopulate(val, "WorkspaceResourceID", &c.WorkspaceResourceID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ConnectionResetSharedKey. -func (c ConnectionResetSharedKey) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "keyLength", c.KeyLength) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionResetSharedKey. -func (c *ConnectionResetSharedKey) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "keyLength": - err = unpopulate(val, "KeyLength", &c.KeyLength) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ConnectionSharedKey. -func (c ConnectionSharedKey) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", c.ID) - populate(objectMap, "value", c.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionSharedKey. -func (c *ConnectionSharedKey) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &c.ID) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &c.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ConnectionStateSnapshot. -func (c ConnectionStateSnapshot) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "avgLatencyInMs", c.AvgLatencyInMs) - populate(objectMap, "connectionState", c.ConnectionState) - populateTimeRFC3339(objectMap, "endTime", c.EndTime) - populate(objectMap, "evaluationState", c.EvaluationState) - populate(objectMap, "hops", c.Hops) - populate(objectMap, "maxLatencyInMs", c.MaxLatencyInMs) - populate(objectMap, "minLatencyInMs", c.MinLatencyInMs) - populate(objectMap, "probesFailed", c.ProbesFailed) - populate(objectMap, "probesSent", c.ProbesSent) - populateTimeRFC3339(objectMap, "startTime", c.StartTime) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionStateSnapshot. -func (c *ConnectionStateSnapshot) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "avgLatencyInMs": - err = unpopulate(val, "AvgLatencyInMs", &c.AvgLatencyInMs) - delete(rawMsg, key) - case "connectionState": - err = unpopulate(val, "ConnectionState", &c.ConnectionState) - delete(rawMsg, key) - case "endTime": - err = unpopulateTimeRFC3339(val, "EndTime", &c.EndTime) - delete(rawMsg, key) - case "evaluationState": - err = unpopulate(val, "EvaluationState", &c.EvaluationState) - delete(rawMsg, key) - case "hops": - err = unpopulate(val, "Hops", &c.Hops) - delete(rawMsg, key) - case "maxLatencyInMs": - err = unpopulate(val, "MaxLatencyInMs", &c.MaxLatencyInMs) - delete(rawMsg, key) - case "minLatencyInMs": - err = unpopulate(val, "MinLatencyInMs", &c.MinLatencyInMs) - delete(rawMsg, key) - case "probesFailed": - err = unpopulate(val, "ProbesFailed", &c.ProbesFailed) - delete(rawMsg, key) - case "probesSent": - err = unpopulate(val, "ProbesSent", &c.ProbesSent) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &c.StartTime) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ConnectivityConfiguration. -func (c ConnectivityConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", c.Etag) - populate(objectMap, "id", c.ID) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "systemData", c.SystemData) - populate(objectMap, "type", c.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectivityConfiguration. -func (c *ConnectivityConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &c.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &c.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &c.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &c.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ConnectivityConfigurationListResult. -func (c ConnectivityConfigurationListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", c.NextLink) - populate(objectMap, "value", c.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectivityConfigurationListResult. -func (c *ConnectivityConfigurationListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &c.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &c.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ConnectivityConfigurationProperties. -func (c ConnectivityConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "appliesToGroups", c.AppliesToGroups) - populate(objectMap, "connectivityTopology", c.ConnectivityTopology) - populate(objectMap, "deleteExistingPeering", c.DeleteExistingPeering) - populate(objectMap, "description", c.Description) - populate(objectMap, "hubs", c.Hubs) - populate(objectMap, "isGlobal", c.IsGlobal) - populate(objectMap, "provisioningState", c.ProvisioningState) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectivityConfigurationProperties. -func (c *ConnectivityConfigurationProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "appliesToGroups": - err = unpopulate(val, "AppliesToGroups", &c.AppliesToGroups) - delete(rawMsg, key) - case "connectivityTopology": - err = unpopulate(val, "ConnectivityTopology", &c.ConnectivityTopology) - delete(rawMsg, key) - case "deleteExistingPeering": - err = unpopulate(val, "DeleteExistingPeering", &c.DeleteExistingPeering) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &c.Description) - delete(rawMsg, key) - case "hubs": - err = unpopulate(val, "Hubs", &c.Hubs) - delete(rawMsg, key) - case "isGlobal": - err = unpopulate(val, "IsGlobal", &c.IsGlobal) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ConnectivityDestination. -func (c ConnectivityDestination) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "address", c.Address) - populate(objectMap, "port", c.Port) - populate(objectMap, "resourceId", c.ResourceID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectivityDestination. -func (c *ConnectivityDestination) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "address": - err = unpopulate(val, "Address", &c.Address) - delete(rawMsg, key) - case "port": - err = unpopulate(val, "Port", &c.Port) - delete(rawMsg, key) - case "resourceId": - err = unpopulate(val, "ResourceID", &c.ResourceID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ConnectivityGroupItem. -func (c ConnectivityGroupItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "groupConnectivity", c.GroupConnectivity) - populate(objectMap, "isGlobal", c.IsGlobal) - populate(objectMap, "networkGroupId", c.NetworkGroupID) - populate(objectMap, "useHubGateway", c.UseHubGateway) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectivityGroupItem. -func (c *ConnectivityGroupItem) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "groupConnectivity": - err = unpopulate(val, "GroupConnectivity", &c.GroupConnectivity) - delete(rawMsg, key) - case "isGlobal": - err = unpopulate(val, "IsGlobal", &c.IsGlobal) - delete(rawMsg, key) - case "networkGroupId": - err = unpopulate(val, "NetworkGroupID", &c.NetworkGroupID) - delete(rawMsg, key) - case "useHubGateway": - err = unpopulate(val, "UseHubGateway", &c.UseHubGateway) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ConnectivityHop. -func (c ConnectivityHop) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "address", c.Address) - populate(objectMap, "id", c.ID) - populate(objectMap, "issues", c.Issues) - populate(objectMap, "links", c.Links) - populate(objectMap, "nextHopIds", c.NextHopIDs) - populate(objectMap, "previousHopIds", c.PreviousHopIDs) - populate(objectMap, "previousLinks", c.PreviousLinks) - populate(objectMap, "resourceId", c.ResourceID) - populate(objectMap, "type", c.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectivityHop. -func (c *ConnectivityHop) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "address": - err = unpopulate(val, "Address", &c.Address) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &c.ID) - delete(rawMsg, key) - case "issues": - err = unpopulate(val, "Issues", &c.Issues) - delete(rawMsg, key) - case "links": - err = unpopulate(val, "Links", &c.Links) - delete(rawMsg, key) - case "nextHopIds": - err = unpopulate(val, "NextHopIDs", &c.NextHopIDs) - delete(rawMsg, key) - case "previousHopIds": - err = unpopulate(val, "PreviousHopIDs", &c.PreviousHopIDs) - delete(rawMsg, key) - case "previousLinks": - err = unpopulate(val, "PreviousLinks", &c.PreviousLinks) - delete(rawMsg, key) - case "resourceId": - err = unpopulate(val, "ResourceID", &c.ResourceID) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ConnectivityInformation. -func (c ConnectivityInformation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "avgLatencyInMs", c.AvgLatencyInMs) - populate(objectMap, "connectionStatus", c.ConnectionStatus) - populate(objectMap, "hops", c.Hops) - populate(objectMap, "maxLatencyInMs", c.MaxLatencyInMs) - populate(objectMap, "minLatencyInMs", c.MinLatencyInMs) - populate(objectMap, "probesFailed", c.ProbesFailed) - populate(objectMap, "probesSent", c.ProbesSent) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectivityInformation. -func (c *ConnectivityInformation) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "avgLatencyInMs": - err = unpopulate(val, "AvgLatencyInMs", &c.AvgLatencyInMs) - delete(rawMsg, key) - case "connectionStatus": - err = unpopulate(val, "ConnectionStatus", &c.ConnectionStatus) - delete(rawMsg, key) - case "hops": - err = unpopulate(val, "Hops", &c.Hops) - delete(rawMsg, key) - case "maxLatencyInMs": - err = unpopulate(val, "MaxLatencyInMs", &c.MaxLatencyInMs) - delete(rawMsg, key) - case "minLatencyInMs": - err = unpopulate(val, "MinLatencyInMs", &c.MinLatencyInMs) - delete(rawMsg, key) - case "probesFailed": - err = unpopulate(val, "ProbesFailed", &c.ProbesFailed) - delete(rawMsg, key) - case "probesSent": - err = unpopulate(val, "ProbesSent", &c.ProbesSent) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ConnectivityIssue. -func (c ConnectivityIssue) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "context", c.Context) - populate(objectMap, "origin", c.Origin) - populate(objectMap, "severity", c.Severity) - populate(objectMap, "type", c.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectivityIssue. -func (c *ConnectivityIssue) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "context": - err = unpopulate(val, "Context", &c.Context) - delete(rawMsg, key) - case "origin": - err = unpopulate(val, "Origin", &c.Origin) - delete(rawMsg, key) - case "severity": - err = unpopulate(val, "Severity", &c.Severity) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ConnectivityParameters. -func (c ConnectivityParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "destination", c.Destination) - populate(objectMap, "preferredIPVersion", c.PreferredIPVersion) - populate(objectMap, "protocol", c.Protocol) - populate(objectMap, "protocolConfiguration", c.ProtocolConfiguration) - populate(objectMap, "source", c.Source) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectivityParameters. -func (c *ConnectivityParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "destination": - err = unpopulate(val, "Destination", &c.Destination) - delete(rawMsg, key) - case "preferredIPVersion": - err = unpopulate(val, "PreferredIPVersion", &c.PreferredIPVersion) - delete(rawMsg, key) - case "protocol": - err = unpopulate(val, "Protocol", &c.Protocol) - delete(rawMsg, key) - case "protocolConfiguration": - err = unpopulate(val, "ProtocolConfiguration", &c.ProtocolConfiguration) - delete(rawMsg, key) - case "source": - err = unpopulate(val, "Source", &c.Source) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ConnectivitySource. -func (c ConnectivitySource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "port", c.Port) - populate(objectMap, "resourceId", c.ResourceID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectivitySource. -func (c *ConnectivitySource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "port": - err = unpopulate(val, "Port", &c.Port) - delete(rawMsg, key) - case "resourceId": - err = unpopulate(val, "ResourceID", &c.ResourceID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Container. -func (c Container) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", c.ID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Container. -func (c *Container) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &c.ID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ContainerNetworkInterface. -func (c ContainerNetworkInterface) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", c.Etag) - populate(objectMap, "id", c.ID) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "type", c.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerNetworkInterface. -func (c *ContainerNetworkInterface) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &c.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &c.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &c.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ContainerNetworkInterfaceConfiguration. -func (c ContainerNetworkInterfaceConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", c.Etag) - populate(objectMap, "id", c.ID) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "type", c.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerNetworkInterfaceConfiguration. -func (c *ContainerNetworkInterfaceConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &c.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &c.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &c.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ContainerNetworkInterfaceConfigurationPropertiesFormat. -func (c ContainerNetworkInterfaceConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "containerNetworkInterfaces", c.ContainerNetworkInterfaces) - populate(objectMap, "ipConfigurations", c.IPConfigurations) - populate(objectMap, "provisioningState", c.ProvisioningState) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerNetworkInterfaceConfigurationPropertiesFormat. -func (c *ContainerNetworkInterfaceConfigurationPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "containerNetworkInterfaces": - err = unpopulate(val, "ContainerNetworkInterfaces", &c.ContainerNetworkInterfaces) - delete(rawMsg, key) - case "ipConfigurations": - err = unpopulate(val, "IPConfigurations", &c.IPConfigurations) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ContainerNetworkInterfaceIPConfiguration. -func (c ContainerNetworkInterfaceIPConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", c.Etag) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "type", c.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerNetworkInterfaceIPConfiguration. -func (c *ContainerNetworkInterfaceIPConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &c.Etag) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &c.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ContainerNetworkInterfaceIPConfigurationPropertiesFormat. -func (c ContainerNetworkInterfaceIPConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "provisioningState", c.ProvisioningState) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerNetworkInterfaceIPConfigurationPropertiesFormat. -func (c *ContainerNetworkInterfaceIPConfigurationPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ContainerNetworkInterfacePropertiesFormat. -func (c ContainerNetworkInterfacePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "container", c.Container) - populate(objectMap, "containerNetworkInterfaceConfiguration", c.ContainerNetworkInterfaceConfiguration) - populate(objectMap, "ipConfigurations", c.IPConfigurations) - populate(objectMap, "provisioningState", c.ProvisioningState) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerNetworkInterfacePropertiesFormat. -func (c *ContainerNetworkInterfacePropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "container": - err = unpopulate(val, "Container", &c.Container) - delete(rawMsg, key) - case "containerNetworkInterfaceConfiguration": - err = unpopulate(val, "ContainerNetworkInterfaceConfiguration", &c.ContainerNetworkInterfaceConfiguration) - delete(rawMsg, key) - case "ipConfigurations": - err = unpopulate(val, "IPConfigurations", &c.IPConfigurations) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CrossTenantScopes. -func (c CrossTenantScopes) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "managementGroups", c.ManagementGroups) - populate(objectMap, "subscriptions", c.Subscriptions) - populate(objectMap, "tenantId", c.TenantID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CrossTenantScopes. -func (c *CrossTenantScopes) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "managementGroups": - err = unpopulate(val, "ManagementGroups", &c.ManagementGroups) - delete(rawMsg, key) - case "subscriptions": - err = unpopulate(val, "Subscriptions", &c.Subscriptions) - delete(rawMsg, key) - case "tenantId": - err = unpopulate(val, "TenantID", &c.TenantID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CustomDNSConfigPropertiesFormat. -func (c CustomDNSConfigPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "fqdn", c.Fqdn) - populate(objectMap, "ipAddresses", c.IPAddresses) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CustomDNSConfigPropertiesFormat. -func (c *CustomDNSConfigPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "fqdn": - err = unpopulate(val, "Fqdn", &c.Fqdn) - delete(rawMsg, key) - case "ipAddresses": - err = unpopulate(val, "IPAddresses", &c.IPAddresses) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CustomIPPrefix. -func (c CustomIPPrefix) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", c.Etag) - populate(objectMap, "extendedLocation", c.ExtendedLocation) - populate(objectMap, "id", c.ID) - populate(objectMap, "location", c.Location) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "tags", c.Tags) - populate(objectMap, "type", c.Type) - populate(objectMap, "zones", c.Zones) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CustomIPPrefix. -func (c *CustomIPPrefix) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &c.Etag) - delete(rawMsg, key) - case "extendedLocation": - err = unpopulate(val, "ExtendedLocation", &c.ExtendedLocation) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &c.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &c.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &c.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &c.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) - delete(rawMsg, key) - case "zones": - err = unpopulate(val, "Zones", &c.Zones) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CustomIPPrefixListResult. -func (c CustomIPPrefixListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", c.NextLink) - populate(objectMap, "value", c.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CustomIPPrefixListResult. -func (c *CustomIPPrefixListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &c.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &c.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CustomIPPrefixPropertiesFormat. -func (c CustomIPPrefixPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "authorizationMessage", c.AuthorizationMessage) - populate(objectMap, "childCustomIpPrefixes", c.ChildCustomIPPrefixes) - populate(objectMap, "cidr", c.Cidr) - populate(objectMap, "commissionedState", c.CommissionedState) - populate(objectMap, "customIpPrefixParent", c.CustomIPPrefixParent) - populate(objectMap, "failedReason", c.FailedReason) - populate(objectMap, "noInternetAdvertise", c.NoInternetAdvertise) - populate(objectMap, "provisioningState", c.ProvisioningState) - populate(objectMap, "publicIpPrefixes", c.PublicIPPrefixes) - populate(objectMap, "resourceGuid", c.ResourceGUID) - populate(objectMap, "signedMessage", c.SignedMessage) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CustomIPPrefixPropertiesFormat. -func (c *CustomIPPrefixPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "authorizationMessage": - err = unpopulate(val, "AuthorizationMessage", &c.AuthorizationMessage) - delete(rawMsg, key) - case "childCustomIpPrefixes": - err = unpopulate(val, "ChildCustomIPPrefixes", &c.ChildCustomIPPrefixes) - delete(rawMsg, key) - case "cidr": - err = unpopulate(val, "Cidr", &c.Cidr) - delete(rawMsg, key) - case "commissionedState": - err = unpopulate(val, "CommissionedState", &c.CommissionedState) - delete(rawMsg, key) - case "customIpPrefixParent": - err = unpopulate(val, "CustomIPPrefixParent", &c.CustomIPPrefixParent) - delete(rawMsg, key) - case "failedReason": - err = unpopulate(val, "FailedReason", &c.FailedReason) - delete(rawMsg, key) - case "noInternetAdvertise": - err = unpopulate(val, "NoInternetAdvertise", &c.NoInternetAdvertise) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) - delete(rawMsg, key) - case "publicIpPrefixes": - err = unpopulate(val, "PublicIPPrefixes", &c.PublicIPPrefixes) - delete(rawMsg, key) - case "resourceGuid": - err = unpopulate(val, "ResourceGUID", &c.ResourceGUID) - delete(rawMsg, key) - case "signedMessage": - err = unpopulate(val, "SignedMessage", &c.SignedMessage) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DNSNameAvailabilityResult. -func (d DNSNameAvailabilityResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "available", d.Available) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DNSNameAvailabilityResult. -func (d *DNSNameAvailabilityResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "available": - err = unpopulate(val, "Available", &d.Available) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DNSSettings. -func (d DNSSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "enableProxy", d.EnableProxy) - populate(objectMap, "requireProxyForNetworkRules", d.RequireProxyForNetworkRules) - populate(objectMap, "servers", d.Servers) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DNSSettings. -func (d *DNSSettings) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "enableProxy": - err = unpopulate(val, "EnableProxy", &d.EnableProxy) - delete(rawMsg, key) - case "requireProxyForNetworkRules": - err = unpopulate(val, "RequireProxyForNetworkRules", &d.RequireProxyForNetworkRules) - delete(rawMsg, key) - case "servers": - err = unpopulate(val, "Servers", &d.Servers) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DdosCustomPolicy. -func (d DdosCustomPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", d.Etag) - populate(objectMap, "id", d.ID) - populate(objectMap, "location", d.Location) - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "tags", d.Tags) - populate(objectMap, "type", d.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DdosCustomPolicy. -func (d *DdosCustomPolicy) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &d.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &d.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &d.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &d.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &d.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &d.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DdosCustomPolicyPropertiesFormat. -func (d DdosCustomPolicyPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "protocolCustomSettings", d.ProtocolCustomSettings) - populate(objectMap, "provisioningState", d.ProvisioningState) - populate(objectMap, "publicIPAddresses", d.PublicIPAddresses) - populate(objectMap, "resourceGuid", d.ResourceGUID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DdosCustomPolicyPropertiesFormat. -func (d *DdosCustomPolicyPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "protocolCustomSettings": - err = unpopulate(val, "ProtocolCustomSettings", &d.ProtocolCustomSettings) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) - delete(rawMsg, key) - case "publicIPAddresses": - err = unpopulate(val, "PublicIPAddresses", &d.PublicIPAddresses) - delete(rawMsg, key) - case "resourceGuid": - err = unpopulate(val, "ResourceGUID", &d.ResourceGUID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DdosProtectionPlan. -func (d DdosProtectionPlan) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", d.Etag) - populate(objectMap, "id", d.ID) - populate(objectMap, "location", d.Location) - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "tags", d.Tags) - populate(objectMap, "type", d.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DdosProtectionPlan. -func (d *DdosProtectionPlan) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &d.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &d.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &d.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &d.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &d.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &d.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DdosProtectionPlanListResult. -func (d DdosProtectionPlanListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", d.NextLink) - populate(objectMap, "value", d.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DdosProtectionPlanListResult. -func (d *DdosProtectionPlanListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &d.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &d.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DdosProtectionPlanPropertiesFormat. -func (d DdosProtectionPlanPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "provisioningState", d.ProvisioningState) - populate(objectMap, "resourceGuid", d.ResourceGUID) - populate(objectMap, "virtualNetworks", d.VirtualNetworks) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DdosProtectionPlanPropertiesFormat. -func (d *DdosProtectionPlanPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) - delete(rawMsg, key) - case "resourceGuid": - err = unpopulate(val, "ResourceGUID", &d.ResourceGUID) - delete(rawMsg, key) - case "virtualNetworks": - err = unpopulate(val, "VirtualNetworks", &d.VirtualNetworks) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DdosSettings. -func (d DdosSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "ddosCustomPolicy", d.DdosCustomPolicy) - populate(objectMap, "protectedIP", d.ProtectedIP) - populate(objectMap, "protectionCoverage", d.ProtectionCoverage) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DdosSettings. -func (d *DdosSettings) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "ddosCustomPolicy": - err = unpopulate(val, "DdosCustomPolicy", &d.DdosCustomPolicy) - delete(rawMsg, key) - case "protectedIP": - err = unpopulate(val, "ProtectedIP", &d.ProtectedIP) - delete(rawMsg, key) - case "protectionCoverage": - err = unpopulate(val, "ProtectionCoverage", &d.ProtectionCoverage) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DefaultAdminPropertiesFormat. -func (d DefaultAdminPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "access", d.Access) - populate(objectMap, "description", d.Description) - populate(objectMap, "destinationPortRanges", d.DestinationPortRanges) - populate(objectMap, "destinations", d.Destinations) - populate(objectMap, "direction", d.Direction) - populate(objectMap, "flag", d.Flag) - populate(objectMap, "priority", d.Priority) - populate(objectMap, "protocol", d.Protocol) - populate(objectMap, "provisioningState", d.ProvisioningState) - populate(objectMap, "sourcePortRanges", d.SourcePortRanges) - populate(objectMap, "sources", d.Sources) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DefaultAdminPropertiesFormat. -func (d *DefaultAdminPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "access": - err = unpopulate(val, "Access", &d.Access) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &d.Description) - delete(rawMsg, key) - case "destinationPortRanges": - err = unpopulate(val, "DestinationPortRanges", &d.DestinationPortRanges) - delete(rawMsg, key) - case "destinations": - err = unpopulate(val, "Destinations", &d.Destinations) - delete(rawMsg, key) - case "direction": - err = unpopulate(val, "Direction", &d.Direction) - delete(rawMsg, key) - case "flag": - err = unpopulate(val, "Flag", &d.Flag) - delete(rawMsg, key) - case "priority": - err = unpopulate(val, "Priority", &d.Priority) - delete(rawMsg, key) - case "protocol": - err = unpopulate(val, "Protocol", &d.Protocol) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) - delete(rawMsg, key) - case "sourcePortRanges": - err = unpopulate(val, "SourcePortRanges", &d.SourcePortRanges) - delete(rawMsg, key) - case "sources": - err = unpopulate(val, "Sources", &d.Sources) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DefaultAdminRule. -func (d DefaultAdminRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", d.Etag) - populate(objectMap, "id", d.ID) - objectMap["kind"] = AdminRuleKindDefault - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "systemData", d.SystemData) - populate(objectMap, "type", d.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DefaultAdminRule. -func (d *DefaultAdminRule) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &d.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &d.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &d.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &d.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &d.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &d.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Delegation. -func (d Delegation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", d.Etag) - populate(objectMap, "id", d.ID) - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "type", d.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Delegation. -func (d *Delegation) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &d.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &d.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &d.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &d.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DeviceProperties. -func (d DeviceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "deviceModel", d.DeviceModel) - populate(objectMap, "deviceVendor", d.DeviceVendor) - populate(objectMap, "linkSpeedInMbps", d.LinkSpeedInMbps) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DeviceProperties. -func (d *DeviceProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "deviceModel": - err = unpopulate(val, "DeviceModel", &d.DeviceModel) - delete(rawMsg, key) - case "deviceVendor": - err = unpopulate(val, "DeviceVendor", &d.DeviceVendor) - delete(rawMsg, key) - case "linkSpeedInMbps": - err = unpopulate(val, "LinkSpeedInMbps", &d.LinkSpeedInMbps) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DhcpOptions. -func (d DhcpOptions) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "dnsServers", d.DNSServers) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DhcpOptions. -func (d *DhcpOptions) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "dnsServers": - err = unpopulate(val, "DNSServers", &d.DNSServers) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Dimension. -func (d Dimension) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "displayName", d.DisplayName) - populate(objectMap, "internalName", d.InternalName) - populate(objectMap, "name", d.Name) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Dimension. -func (d *Dimension) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "displayName": - err = unpopulate(val, "DisplayName", &d.DisplayName) - delete(rawMsg, key) - case "internalName": - err = unpopulate(val, "InternalName", &d.InternalName) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DscpConfiguration. -func (d DscpConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", d.Etag) - populate(objectMap, "id", d.ID) - populate(objectMap, "location", d.Location) - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "tags", d.Tags) - populate(objectMap, "type", d.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DscpConfiguration. -func (d *DscpConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &d.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &d.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &d.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &d.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &d.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &d.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DscpConfigurationListResult. -func (d DscpConfigurationListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", d.NextLink) - populate(objectMap, "value", d.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DscpConfigurationListResult. -func (d *DscpConfigurationListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &d.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &d.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DscpConfigurationPropertiesFormat. -func (d DscpConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "associatedNetworkInterfaces", d.AssociatedNetworkInterfaces) - populate(objectMap, "destinationIpRanges", d.DestinationIPRanges) - populate(objectMap, "destinationPortRanges", d.DestinationPortRanges) - populate(objectMap, "markings", d.Markings) - populate(objectMap, "protocol", d.Protocol) - populate(objectMap, "provisioningState", d.ProvisioningState) - populate(objectMap, "qosCollectionId", d.QosCollectionID) - populate(objectMap, "qosDefinitionCollection", d.QosDefinitionCollection) - populate(objectMap, "resourceGuid", d.ResourceGUID) - populate(objectMap, "sourceIpRanges", d.SourceIPRanges) - populate(objectMap, "sourcePortRanges", d.SourcePortRanges) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DscpConfigurationPropertiesFormat. -func (d *DscpConfigurationPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "associatedNetworkInterfaces": - err = unpopulate(val, "AssociatedNetworkInterfaces", &d.AssociatedNetworkInterfaces) - delete(rawMsg, key) - case "destinationIpRanges": - err = unpopulate(val, "DestinationIPRanges", &d.DestinationIPRanges) - delete(rawMsg, key) - case "destinationPortRanges": - err = unpopulate(val, "DestinationPortRanges", &d.DestinationPortRanges) - delete(rawMsg, key) - case "markings": - err = unpopulate(val, "Markings", &d.Markings) - delete(rawMsg, key) - case "protocol": - err = unpopulate(val, "Protocol", &d.Protocol) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) - delete(rawMsg, key) - case "qosCollectionId": - err = unpopulate(val, "QosCollectionID", &d.QosCollectionID) - delete(rawMsg, key) - case "qosDefinitionCollection": - err = unpopulate(val, "QosDefinitionCollection", &d.QosDefinitionCollection) - delete(rawMsg, key) - case "resourceGuid": - err = unpopulate(val, "ResourceGUID", &d.ResourceGUID) - delete(rawMsg, key) - case "sourceIpRanges": - err = unpopulate(val, "SourceIPRanges", &d.SourceIPRanges) - delete(rawMsg, key) - case "sourcePortRanges": - err = unpopulate(val, "SourcePortRanges", &d.SourcePortRanges) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type EffectiveBaseSecurityAdminRule. -func (e EffectiveBaseSecurityAdminRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "configurationDescription", e.ConfigurationDescription) - populate(objectMap, "id", e.ID) - objectMap["kind"] = e.Kind - populate(objectMap, "ruleCollectionAppliesToGroups", e.RuleCollectionAppliesToGroups) - populate(objectMap, "ruleCollectionDescription", e.RuleCollectionDescription) - populate(objectMap, "ruleGroups", e.RuleGroups) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EffectiveBaseSecurityAdminRule. -func (e *EffectiveBaseSecurityAdminRule) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "configurationDescription": - err = unpopulate(val, "ConfigurationDescription", &e.ConfigurationDescription) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &e.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &e.Kind) - delete(rawMsg, key) - case "ruleCollectionAppliesToGroups": - err = unpopulate(val, "RuleCollectionAppliesToGroups", &e.RuleCollectionAppliesToGroups) - delete(rawMsg, key) - case "ruleCollectionDescription": - err = unpopulate(val, "RuleCollectionDescription", &e.RuleCollectionDescription) - delete(rawMsg, key) - case "ruleGroups": - err = unpopulate(val, "RuleGroups", &e.RuleGroups) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type EffectiveConnectivityConfiguration. -func (e EffectiveConnectivityConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "configurationGroups", e.ConfigurationGroups) - populate(objectMap, "id", e.ID) - populate(objectMap, "properties", e.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EffectiveConnectivityConfiguration. -func (e *EffectiveConnectivityConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "configurationGroups": - err = unpopulate(val, "ConfigurationGroups", &e.ConfigurationGroups) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &e.ID) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &e.Properties) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type EffectiveDefaultSecurityAdminRule. -func (e EffectiveDefaultSecurityAdminRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "configurationDescription", e.ConfigurationDescription) - populate(objectMap, "id", e.ID) - objectMap["kind"] = EffectiveAdminRuleKindDefault - populate(objectMap, "properties", e.Properties) - populate(objectMap, "ruleCollectionAppliesToGroups", e.RuleCollectionAppliesToGroups) - populate(objectMap, "ruleCollectionDescription", e.RuleCollectionDescription) - populate(objectMap, "ruleGroups", e.RuleGroups) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EffectiveDefaultSecurityAdminRule. -func (e *EffectiveDefaultSecurityAdminRule) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "configurationDescription": - err = unpopulate(val, "ConfigurationDescription", &e.ConfigurationDescription) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &e.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &e.Kind) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &e.Properties) - delete(rawMsg, key) - case "ruleCollectionAppliesToGroups": - err = unpopulate(val, "RuleCollectionAppliesToGroups", &e.RuleCollectionAppliesToGroups) - delete(rawMsg, key) - case "ruleCollectionDescription": - err = unpopulate(val, "RuleCollectionDescription", &e.RuleCollectionDescription) - delete(rawMsg, key) - case "ruleGroups": - err = unpopulate(val, "RuleGroups", &e.RuleGroups) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type EffectiveNetworkSecurityGroup. -func (e EffectiveNetworkSecurityGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "association", e.Association) - populate(objectMap, "effectiveSecurityRules", e.EffectiveSecurityRules) - populate(objectMap, "networkSecurityGroup", e.NetworkSecurityGroup) - populate(objectMap, "tagMap", e.TagMap) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EffectiveNetworkSecurityGroup. -func (e *EffectiveNetworkSecurityGroup) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "association": - err = unpopulate(val, "Association", &e.Association) - delete(rawMsg, key) - case "effectiveSecurityRules": - err = unpopulate(val, "EffectiveSecurityRules", &e.EffectiveSecurityRules) - delete(rawMsg, key) - case "networkSecurityGroup": - err = unpopulate(val, "NetworkSecurityGroup", &e.NetworkSecurityGroup) - delete(rawMsg, key) - case "tagMap": - err = unpopulate(val, "TagMap", &e.TagMap) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type EffectiveNetworkSecurityGroupAssociation. -func (e EffectiveNetworkSecurityGroupAssociation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "networkInterface", e.NetworkInterface) - populate(objectMap, "networkManager", e.NetworkManager) - populate(objectMap, "subnet", e.Subnet) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EffectiveNetworkSecurityGroupAssociation. -func (e *EffectiveNetworkSecurityGroupAssociation) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "networkInterface": - err = unpopulate(val, "NetworkInterface", &e.NetworkInterface) - delete(rawMsg, key) - case "networkManager": - err = unpopulate(val, "NetworkManager", &e.NetworkManager) - delete(rawMsg, key) - case "subnet": - err = unpopulate(val, "Subnet", &e.Subnet) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type EffectiveNetworkSecurityGroupListResult. -func (e EffectiveNetworkSecurityGroupListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", e.NextLink) - populate(objectMap, "value", e.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EffectiveNetworkSecurityGroupListResult. -func (e *EffectiveNetworkSecurityGroupListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &e.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &e.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type EffectiveNetworkSecurityRule. -func (e EffectiveNetworkSecurityRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "access", e.Access) - populate(objectMap, "destinationAddressPrefix", e.DestinationAddressPrefix) - populate(objectMap, "destinationAddressPrefixes", e.DestinationAddressPrefixes) - populate(objectMap, "destinationPortRange", e.DestinationPortRange) - populate(objectMap, "destinationPortRanges", e.DestinationPortRanges) - populate(objectMap, "direction", e.Direction) - populate(objectMap, "expandedDestinationAddressPrefix", e.ExpandedDestinationAddressPrefix) - populate(objectMap, "expandedSourceAddressPrefix", e.ExpandedSourceAddressPrefix) - populate(objectMap, "name", e.Name) - populate(objectMap, "priority", e.Priority) - populate(objectMap, "protocol", e.Protocol) - populate(objectMap, "sourceAddressPrefix", e.SourceAddressPrefix) - populate(objectMap, "sourceAddressPrefixes", e.SourceAddressPrefixes) - populate(objectMap, "sourcePortRange", e.SourcePortRange) - populate(objectMap, "sourcePortRanges", e.SourcePortRanges) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EffectiveNetworkSecurityRule. -func (e *EffectiveNetworkSecurityRule) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "access": - err = unpopulate(val, "Access", &e.Access) - delete(rawMsg, key) - case "destinationAddressPrefix": - err = unpopulate(val, "DestinationAddressPrefix", &e.DestinationAddressPrefix) - delete(rawMsg, key) - case "destinationAddressPrefixes": - err = unpopulate(val, "DestinationAddressPrefixes", &e.DestinationAddressPrefixes) - delete(rawMsg, key) - case "destinationPortRange": - err = unpopulate(val, "DestinationPortRange", &e.DestinationPortRange) - delete(rawMsg, key) - case "destinationPortRanges": - err = unpopulate(val, "DestinationPortRanges", &e.DestinationPortRanges) - delete(rawMsg, key) - case "direction": - err = unpopulate(val, "Direction", &e.Direction) - delete(rawMsg, key) - case "expandedDestinationAddressPrefix": - err = unpopulate(val, "ExpandedDestinationAddressPrefix", &e.ExpandedDestinationAddressPrefix) - delete(rawMsg, key) - case "expandedSourceAddressPrefix": - err = unpopulate(val, "ExpandedSourceAddressPrefix", &e.ExpandedSourceAddressPrefix) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &e.Name) - delete(rawMsg, key) - case "priority": - err = unpopulate(val, "Priority", &e.Priority) - delete(rawMsg, key) - case "protocol": - err = unpopulate(val, "Protocol", &e.Protocol) - delete(rawMsg, key) - case "sourceAddressPrefix": - err = unpopulate(val, "SourceAddressPrefix", &e.SourceAddressPrefix) - delete(rawMsg, key) - case "sourceAddressPrefixes": - err = unpopulate(val, "SourceAddressPrefixes", &e.SourceAddressPrefixes) - delete(rawMsg, key) - case "sourcePortRange": - err = unpopulate(val, "SourcePortRange", &e.SourcePortRange) - delete(rawMsg, key) - case "sourcePortRanges": - err = unpopulate(val, "SourcePortRanges", &e.SourcePortRanges) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type EffectiveRoute. -func (e EffectiveRoute) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "addressPrefix", e.AddressPrefix) - populate(objectMap, "disableBgpRoutePropagation", e.DisableBgpRoutePropagation) - populate(objectMap, "name", e.Name) - populate(objectMap, "nextHopIpAddress", e.NextHopIPAddress) - populate(objectMap, "nextHopType", e.NextHopType) - populate(objectMap, "source", e.Source) - populate(objectMap, "state", e.State) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EffectiveRoute. -func (e *EffectiveRoute) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "addressPrefix": - err = unpopulate(val, "AddressPrefix", &e.AddressPrefix) - delete(rawMsg, key) - case "disableBgpRoutePropagation": - err = unpopulate(val, "DisableBgpRoutePropagation", &e.DisableBgpRoutePropagation) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &e.Name) - delete(rawMsg, key) - case "nextHopIpAddress": - err = unpopulate(val, "NextHopIPAddress", &e.NextHopIPAddress) - delete(rawMsg, key) - case "nextHopType": - err = unpopulate(val, "NextHopType", &e.NextHopType) - delete(rawMsg, key) - case "source": - err = unpopulate(val, "Source", &e.Source) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &e.State) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type EffectiveRouteListResult. -func (e EffectiveRouteListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", e.NextLink) - populate(objectMap, "value", e.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EffectiveRouteListResult. -func (e *EffectiveRouteListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &e.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &e.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type EffectiveRoutesParameters. -func (e EffectiveRoutesParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "resourceId", e.ResourceID) - populate(objectMap, "virtualWanResourceType", e.VirtualWanResourceType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EffectiveRoutesParameters. -func (e *EffectiveRoutesParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "resourceId": - err = unpopulate(val, "ResourceID", &e.ResourceID) - delete(rawMsg, key) - case "virtualWanResourceType": - err = unpopulate(val, "VirtualWanResourceType", &e.VirtualWanResourceType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type EffectiveSecurityAdminRule. -func (e EffectiveSecurityAdminRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "configurationDescription", e.ConfigurationDescription) - populate(objectMap, "id", e.ID) - objectMap["kind"] = EffectiveAdminRuleKindCustom - populate(objectMap, "properties", e.Properties) - populate(objectMap, "ruleCollectionAppliesToGroups", e.RuleCollectionAppliesToGroups) - populate(objectMap, "ruleCollectionDescription", e.RuleCollectionDescription) - populate(objectMap, "ruleGroups", e.RuleGroups) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EffectiveSecurityAdminRule. -func (e *EffectiveSecurityAdminRule) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "configurationDescription": - err = unpopulate(val, "ConfigurationDescription", &e.ConfigurationDescription) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &e.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &e.Kind) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &e.Properties) - delete(rawMsg, key) - case "ruleCollectionAppliesToGroups": - err = unpopulate(val, "RuleCollectionAppliesToGroups", &e.RuleCollectionAppliesToGroups) - delete(rawMsg, key) - case "ruleCollectionDescription": - err = unpopulate(val, "RuleCollectionDescription", &e.RuleCollectionDescription) - delete(rawMsg, key) - case "ruleGroups": - err = unpopulate(val, "RuleGroups", &e.RuleGroups) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type EndpointServiceResult. -func (e EndpointServiceResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", e.ID) - populate(objectMap, "name", e.Name) - populate(objectMap, "type", e.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EndpointServiceResult. -func (e *EndpointServiceResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &e.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &e.Name) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &e.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type EndpointServicesListResult. -func (e EndpointServicesListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", e.NextLink) - populate(objectMap, "value", e.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EndpointServicesListResult. -func (e *EndpointServicesListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &e.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &e.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Error. -func (e Error) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "code", e.Code) - populate(objectMap, "details", e.Details) - populate(objectMap, "innerError", e.InnerError) - populate(objectMap, "message", e.Message) - populate(objectMap, "target", e.Target) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Error. -func (e *Error) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "code": - err = unpopulate(val, "Code", &e.Code) - delete(rawMsg, key) - case "details": - err = unpopulate(val, "Details", &e.Details) - delete(rawMsg, key) - case "innerError": - err = unpopulate(val, "InnerError", &e.InnerError) - delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &e.Message) - delete(rawMsg, key) - case "target": - err = unpopulate(val, "Target", &e.Target) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ErrorDetails. -func (e ErrorDetails) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "code", e.Code) - populate(objectMap, "message", e.Message) - populate(objectMap, "target", e.Target) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetails. -func (e *ErrorDetails) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "code": - err = unpopulate(val, "Code", &e.Code) - delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &e.Message) - delete(rawMsg, key) - case "target": - err = unpopulate(val, "Target", &e.Target) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ErrorResponse. -func (e ErrorResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "error", e.Error) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponse. -func (e *ErrorResponse) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "error": - err = unpopulate(val, "Error", &e.Error) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type EvaluatedNetworkSecurityGroup. -func (e EvaluatedNetworkSecurityGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "appliedTo", e.AppliedTo) - populate(objectMap, "matchedRule", e.MatchedRule) - populate(objectMap, "networkSecurityGroupId", e.NetworkSecurityGroupID) - populate(objectMap, "rulesEvaluationResult", e.RulesEvaluationResult) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EvaluatedNetworkSecurityGroup. -func (e *EvaluatedNetworkSecurityGroup) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "appliedTo": - err = unpopulate(val, "AppliedTo", &e.AppliedTo) - delete(rawMsg, key) - case "matchedRule": - err = unpopulate(val, "MatchedRule", &e.MatchedRule) - delete(rawMsg, key) - case "networkSecurityGroupId": - err = unpopulate(val, "NetworkSecurityGroupID", &e.NetworkSecurityGroupID) - delete(rawMsg, key) - case "rulesEvaluationResult": - err = unpopulate(val, "RulesEvaluationResult", &e.RulesEvaluationResult) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExclusionManagedRule. -func (e ExclusionManagedRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "ruleId", e.RuleID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExclusionManagedRule. -func (e *ExclusionManagedRule) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "ruleId": - err = unpopulate(val, "RuleID", &e.RuleID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExclusionManagedRuleGroup. -func (e ExclusionManagedRuleGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "ruleGroupName", e.RuleGroupName) - populate(objectMap, "rules", e.Rules) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExclusionManagedRuleGroup. -func (e *ExclusionManagedRuleGroup) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "ruleGroupName": - err = unpopulate(val, "RuleGroupName", &e.RuleGroupName) - delete(rawMsg, key) - case "rules": - err = unpopulate(val, "Rules", &e.Rules) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExclusionManagedRuleSet. -func (e ExclusionManagedRuleSet) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "ruleGroups", e.RuleGroups) - populate(objectMap, "ruleSetType", e.RuleSetType) - populate(objectMap, "ruleSetVersion", e.RuleSetVersion) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExclusionManagedRuleSet. -func (e *ExclusionManagedRuleSet) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "ruleGroups": - err = unpopulate(val, "RuleGroups", &e.RuleGroups) - delete(rawMsg, key) - case "ruleSetType": - err = unpopulate(val, "RuleSetType", &e.RuleSetType) - delete(rawMsg, key) - case "ruleSetVersion": - err = unpopulate(val, "RuleSetVersion", &e.RuleSetVersion) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExplicitProxySettings. -func (e ExplicitProxySettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "enableExplicitProxy", e.EnableExplicitProxy) - populate(objectMap, "enablePacFile", e.EnablePacFile) - populate(objectMap, "httpPort", e.HTTPPort) - populate(objectMap, "httpsPort", e.HTTPSPort) - populate(objectMap, "pacFile", e.PacFile) - populate(objectMap, "pacFilePort", e.PacFilePort) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExplicitProxySettings. -func (e *ExplicitProxySettings) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "enableExplicitProxy": - err = unpopulate(val, "EnableExplicitProxy", &e.EnableExplicitProxy) - delete(rawMsg, key) - case "enablePacFile": - err = unpopulate(val, "EnablePacFile", &e.EnablePacFile) - delete(rawMsg, key) - case "httpPort": - err = unpopulate(val, "HTTPPort", &e.HTTPPort) - delete(rawMsg, key) - case "httpsPort": - err = unpopulate(val, "HTTPSPort", &e.HTTPSPort) - delete(rawMsg, key) - case "pacFile": - err = unpopulate(val, "PacFile", &e.PacFile) - delete(rawMsg, key) - case "pacFilePort": - err = unpopulate(val, "PacFilePort", &e.PacFilePort) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExpressRouteCircuit. -func (e ExpressRouteCircuit) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", e.Etag) - populate(objectMap, "id", e.ID) - populate(objectMap, "location", e.Location) - populate(objectMap, "name", e.Name) - populate(objectMap, "properties", e.Properties) - populate(objectMap, "sku", e.SKU) - populate(objectMap, "tags", e.Tags) - populate(objectMap, "type", e.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteCircuit. -func (e *ExpressRouteCircuit) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &e.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &e.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &e.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &e.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &e.Properties) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &e.SKU) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &e.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &e.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExpressRouteCircuitArpTable. -func (e ExpressRouteCircuitArpTable) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "age", e.Age) - populate(objectMap, "ipAddress", e.IPAddress) - populate(objectMap, "interface", e.Interface) - populate(objectMap, "macAddress", e.MacAddress) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteCircuitArpTable. -func (e *ExpressRouteCircuitArpTable) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "age": - err = unpopulate(val, "Age", &e.Age) - delete(rawMsg, key) - case "ipAddress": - err = unpopulate(val, "IPAddress", &e.IPAddress) - delete(rawMsg, key) - case "interface": - err = unpopulate(val, "Interface", &e.Interface) - delete(rawMsg, key) - case "macAddress": - err = unpopulate(val, "MacAddress", &e.MacAddress) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExpressRouteCircuitAuthorization. -func (e ExpressRouteCircuitAuthorization) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", e.Etag) - populate(objectMap, "id", e.ID) - populate(objectMap, "name", e.Name) - populate(objectMap, "properties", e.Properties) - populate(objectMap, "type", e.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteCircuitAuthorization. -func (e *ExpressRouteCircuitAuthorization) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &e.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &e.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &e.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &e.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &e.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExpressRouteCircuitConnection. -func (e ExpressRouteCircuitConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", e.Etag) - populate(objectMap, "id", e.ID) - populate(objectMap, "name", e.Name) - populate(objectMap, "properties", e.Properties) - populate(objectMap, "type", e.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteCircuitConnection. -func (e *ExpressRouteCircuitConnection) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &e.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &e.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &e.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &e.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &e.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExpressRouteCircuitConnectionListResult. -func (e ExpressRouteCircuitConnectionListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", e.NextLink) - populate(objectMap, "value", e.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteCircuitConnectionListResult. -func (e *ExpressRouteCircuitConnectionListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &e.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &e.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExpressRouteCircuitConnectionPropertiesFormat. -func (e ExpressRouteCircuitConnectionPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "addressPrefix", e.AddressPrefix) - populate(objectMap, "authorizationKey", e.AuthorizationKey) - populate(objectMap, "circuitConnectionStatus", e.CircuitConnectionStatus) - populate(objectMap, "expressRouteCircuitPeering", e.ExpressRouteCircuitPeering) - populate(objectMap, "ipv6CircuitConnectionConfig", e.IPv6CircuitConnectionConfig) - populate(objectMap, "peerExpressRouteCircuitPeering", e.PeerExpressRouteCircuitPeering) - populate(objectMap, "provisioningState", e.ProvisioningState) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteCircuitConnectionPropertiesFormat. -func (e *ExpressRouteCircuitConnectionPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "addressPrefix": - err = unpopulate(val, "AddressPrefix", &e.AddressPrefix) - delete(rawMsg, key) - case "authorizationKey": - err = unpopulate(val, "AuthorizationKey", &e.AuthorizationKey) - delete(rawMsg, key) - case "circuitConnectionStatus": - err = unpopulate(val, "CircuitConnectionStatus", &e.CircuitConnectionStatus) - delete(rawMsg, key) - case "expressRouteCircuitPeering": - err = unpopulate(val, "ExpressRouteCircuitPeering", &e.ExpressRouteCircuitPeering) - delete(rawMsg, key) - case "ipv6CircuitConnectionConfig": - err = unpopulate(val, "IPv6CircuitConnectionConfig", &e.IPv6CircuitConnectionConfig) - delete(rawMsg, key) - case "peerExpressRouteCircuitPeering": - err = unpopulate(val, "PeerExpressRouteCircuitPeering", &e.PeerExpressRouteCircuitPeering) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &e.ProvisioningState) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExpressRouteCircuitListResult. -func (e ExpressRouteCircuitListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", e.NextLink) - populate(objectMap, "value", e.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteCircuitListResult. -func (e *ExpressRouteCircuitListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &e.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &e.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExpressRouteCircuitPeering. -func (e ExpressRouteCircuitPeering) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", e.Etag) - populate(objectMap, "id", e.ID) - populate(objectMap, "name", e.Name) - populate(objectMap, "properties", e.Properties) - populate(objectMap, "type", e.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteCircuitPeering. -func (e *ExpressRouteCircuitPeering) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &e.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &e.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &e.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &e.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &e.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExpressRouteCircuitPeeringConfig. -func (e ExpressRouteCircuitPeeringConfig) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "advertisedCommunities", e.AdvertisedCommunities) - populate(objectMap, "advertisedPublicPrefixes", e.AdvertisedPublicPrefixes) - populate(objectMap, "advertisedPublicPrefixesState", e.AdvertisedPublicPrefixesState) - populate(objectMap, "customerASN", e.CustomerASN) - populate(objectMap, "legacyMode", e.LegacyMode) - populate(objectMap, "routingRegistryName", e.RoutingRegistryName) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteCircuitPeeringConfig. -func (e *ExpressRouteCircuitPeeringConfig) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "advertisedCommunities": - err = unpopulate(val, "AdvertisedCommunities", &e.AdvertisedCommunities) - delete(rawMsg, key) - case "advertisedPublicPrefixes": - err = unpopulate(val, "AdvertisedPublicPrefixes", &e.AdvertisedPublicPrefixes) - delete(rawMsg, key) - case "advertisedPublicPrefixesState": - err = unpopulate(val, "AdvertisedPublicPrefixesState", &e.AdvertisedPublicPrefixesState) - delete(rawMsg, key) - case "customerASN": - err = unpopulate(val, "CustomerASN", &e.CustomerASN) - delete(rawMsg, key) - case "legacyMode": - err = unpopulate(val, "LegacyMode", &e.LegacyMode) - delete(rawMsg, key) - case "routingRegistryName": - err = unpopulate(val, "RoutingRegistryName", &e.RoutingRegistryName) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExpressRouteCircuitPeeringID. -func (e ExpressRouteCircuitPeeringID) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", e.ID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteCircuitPeeringID. -func (e *ExpressRouteCircuitPeeringID) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &e.ID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExpressRouteCircuitPeeringListResult. -func (e ExpressRouteCircuitPeeringListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", e.NextLink) - populate(objectMap, "value", e.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteCircuitPeeringListResult. -func (e *ExpressRouteCircuitPeeringListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &e.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &e.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExpressRouteCircuitPeeringPropertiesFormat. -func (e ExpressRouteCircuitPeeringPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "azureASN", e.AzureASN) - populate(objectMap, "connections", e.Connections) - populate(objectMap, "expressRouteConnection", e.ExpressRouteConnection) - populate(objectMap, "gatewayManagerEtag", e.GatewayManagerEtag) - populate(objectMap, "ipv6PeeringConfig", e.IPv6PeeringConfig) - populate(objectMap, "lastModifiedBy", e.LastModifiedBy) - populate(objectMap, "microsoftPeeringConfig", e.MicrosoftPeeringConfig) - populate(objectMap, "peerASN", e.PeerASN) - populate(objectMap, "peeredConnections", e.PeeredConnections) - populate(objectMap, "peeringType", e.PeeringType) - populate(objectMap, "primaryAzurePort", e.PrimaryAzurePort) - populate(objectMap, "primaryPeerAddressPrefix", e.PrimaryPeerAddressPrefix) - populate(objectMap, "provisioningState", e.ProvisioningState) - populate(objectMap, "routeFilter", e.RouteFilter) - populate(objectMap, "secondaryAzurePort", e.SecondaryAzurePort) - populate(objectMap, "secondaryPeerAddressPrefix", e.SecondaryPeerAddressPrefix) - populate(objectMap, "sharedKey", e.SharedKey) - populate(objectMap, "state", e.State) - populate(objectMap, "stats", e.Stats) - populate(objectMap, "vlanId", e.VlanID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteCircuitPeeringPropertiesFormat. -func (e *ExpressRouteCircuitPeeringPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "azureASN": - err = unpopulate(val, "AzureASN", &e.AzureASN) - delete(rawMsg, key) - case "connections": - err = unpopulate(val, "Connections", &e.Connections) - delete(rawMsg, key) - case "expressRouteConnection": - err = unpopulate(val, "ExpressRouteConnection", &e.ExpressRouteConnection) - delete(rawMsg, key) - case "gatewayManagerEtag": - err = unpopulate(val, "GatewayManagerEtag", &e.GatewayManagerEtag) - delete(rawMsg, key) - case "ipv6PeeringConfig": - err = unpopulate(val, "IPv6PeeringConfig", &e.IPv6PeeringConfig) - delete(rawMsg, key) - case "lastModifiedBy": - err = unpopulate(val, "LastModifiedBy", &e.LastModifiedBy) - delete(rawMsg, key) - case "microsoftPeeringConfig": - err = unpopulate(val, "MicrosoftPeeringConfig", &e.MicrosoftPeeringConfig) - delete(rawMsg, key) - case "peerASN": - err = unpopulate(val, "PeerASN", &e.PeerASN) - delete(rawMsg, key) - case "peeredConnections": - err = unpopulate(val, "PeeredConnections", &e.PeeredConnections) - delete(rawMsg, key) - case "peeringType": - err = unpopulate(val, "PeeringType", &e.PeeringType) - delete(rawMsg, key) - case "primaryAzurePort": - err = unpopulate(val, "PrimaryAzurePort", &e.PrimaryAzurePort) - delete(rawMsg, key) - case "primaryPeerAddressPrefix": - err = unpopulate(val, "PrimaryPeerAddressPrefix", &e.PrimaryPeerAddressPrefix) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &e.ProvisioningState) - delete(rawMsg, key) - case "routeFilter": - err = unpopulate(val, "RouteFilter", &e.RouteFilter) - delete(rawMsg, key) - case "secondaryAzurePort": - err = unpopulate(val, "SecondaryAzurePort", &e.SecondaryAzurePort) - delete(rawMsg, key) - case "secondaryPeerAddressPrefix": - err = unpopulate(val, "SecondaryPeerAddressPrefix", &e.SecondaryPeerAddressPrefix) - delete(rawMsg, key) - case "sharedKey": - err = unpopulate(val, "SharedKey", &e.SharedKey) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &e.State) - delete(rawMsg, key) - case "stats": - err = unpopulate(val, "Stats", &e.Stats) - delete(rawMsg, key) - case "vlanId": - err = unpopulate(val, "VlanID", &e.VlanID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExpressRouteCircuitPropertiesFormat. -func (e ExpressRouteCircuitPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "allowClassicOperations", e.AllowClassicOperations) - populate(objectMap, "authorizationKey", e.AuthorizationKey) - populate(objectMap, "authorizations", e.Authorizations) - populate(objectMap, "bandwidthInGbps", e.BandwidthInGbps) - populate(objectMap, "circuitProvisioningState", e.CircuitProvisioningState) - populate(objectMap, "expressRoutePort", e.ExpressRoutePort) - populate(objectMap, "gatewayManagerEtag", e.GatewayManagerEtag) - populate(objectMap, "globalReachEnabled", e.GlobalReachEnabled) - populate(objectMap, "peerings", e.Peerings) - populate(objectMap, "provisioningState", e.ProvisioningState) - populate(objectMap, "serviceKey", e.ServiceKey) - populate(objectMap, "serviceProviderNotes", e.ServiceProviderNotes) - populate(objectMap, "serviceProviderProperties", e.ServiceProviderProperties) - populate(objectMap, "serviceProviderProvisioningState", e.ServiceProviderProvisioningState) - populate(objectMap, "stag", e.Stag) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteCircuitPropertiesFormat. -func (e *ExpressRouteCircuitPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "allowClassicOperations": - err = unpopulate(val, "AllowClassicOperations", &e.AllowClassicOperations) - delete(rawMsg, key) - case "authorizationKey": - err = unpopulate(val, "AuthorizationKey", &e.AuthorizationKey) - delete(rawMsg, key) - case "authorizations": - err = unpopulate(val, "Authorizations", &e.Authorizations) - delete(rawMsg, key) - case "bandwidthInGbps": - err = unpopulate(val, "BandwidthInGbps", &e.BandwidthInGbps) - delete(rawMsg, key) - case "circuitProvisioningState": - err = unpopulate(val, "CircuitProvisioningState", &e.CircuitProvisioningState) - delete(rawMsg, key) - case "expressRoutePort": - err = unpopulate(val, "ExpressRoutePort", &e.ExpressRoutePort) - delete(rawMsg, key) - case "gatewayManagerEtag": - err = unpopulate(val, "GatewayManagerEtag", &e.GatewayManagerEtag) - delete(rawMsg, key) - case "globalReachEnabled": - err = unpopulate(val, "GlobalReachEnabled", &e.GlobalReachEnabled) - delete(rawMsg, key) - case "peerings": - err = unpopulate(val, "Peerings", &e.Peerings) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &e.ProvisioningState) - delete(rawMsg, key) - case "serviceKey": - err = unpopulate(val, "ServiceKey", &e.ServiceKey) - delete(rawMsg, key) - case "serviceProviderNotes": - err = unpopulate(val, "ServiceProviderNotes", &e.ServiceProviderNotes) - delete(rawMsg, key) - case "serviceProviderProperties": - err = unpopulate(val, "ServiceProviderProperties", &e.ServiceProviderProperties) - delete(rawMsg, key) - case "serviceProviderProvisioningState": - err = unpopulate(val, "ServiceProviderProvisioningState", &e.ServiceProviderProvisioningState) - delete(rawMsg, key) - case "stag": - err = unpopulate(val, "Stag", &e.Stag) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExpressRouteCircuitReference. -func (e ExpressRouteCircuitReference) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", e.ID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteCircuitReference. -func (e *ExpressRouteCircuitReference) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &e.ID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExpressRouteCircuitRoutesTable. -func (e ExpressRouteCircuitRoutesTable) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "locPrf", e.LocPrf) - populate(objectMap, "network", e.Network) - populate(objectMap, "nextHop", e.NextHop) - populate(objectMap, "path", e.Path) - populate(objectMap, "weight", e.Weight) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteCircuitRoutesTable. -func (e *ExpressRouteCircuitRoutesTable) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "locPrf": - err = unpopulate(val, "LocPrf", &e.LocPrf) - delete(rawMsg, key) - case "network": - err = unpopulate(val, "Network", &e.Network) - delete(rawMsg, key) - case "nextHop": - err = unpopulate(val, "NextHop", &e.NextHop) - delete(rawMsg, key) - case "path": - err = unpopulate(val, "Path", &e.Path) - delete(rawMsg, key) - case "weight": - err = unpopulate(val, "Weight", &e.Weight) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExpressRouteCircuitRoutesTableSummary. -func (e ExpressRouteCircuitRoutesTableSummary) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "as", e.As) - populate(objectMap, "neighbor", e.Neighbor) - populate(objectMap, "statePfxRcd", e.StatePfxRcd) - populate(objectMap, "upDown", e.UpDown) - populate(objectMap, "v", e.V) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteCircuitRoutesTableSummary. -func (e *ExpressRouteCircuitRoutesTableSummary) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "as": - err = unpopulate(val, "As", &e.As) - delete(rawMsg, key) - case "neighbor": - err = unpopulate(val, "Neighbor", &e.Neighbor) - delete(rawMsg, key) - case "statePfxRcd": - err = unpopulate(val, "StatePfxRcd", &e.StatePfxRcd) - delete(rawMsg, key) - case "upDown": - err = unpopulate(val, "UpDown", &e.UpDown) - delete(rawMsg, key) - case "v": - err = unpopulate(val, "V", &e.V) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExpressRouteCircuitSKU. -func (e ExpressRouteCircuitSKU) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "family", e.Family) - populate(objectMap, "name", e.Name) - populate(objectMap, "tier", e.Tier) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteCircuitSKU. -func (e *ExpressRouteCircuitSKU) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "family": - err = unpopulate(val, "Family", &e.Family) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &e.Name) - delete(rawMsg, key) - case "tier": - err = unpopulate(val, "Tier", &e.Tier) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExpressRouteCircuitServiceProviderProperties. -func (e ExpressRouteCircuitServiceProviderProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "bandwidthInMbps", e.BandwidthInMbps) - populate(objectMap, "peeringLocation", e.PeeringLocation) - populate(objectMap, "serviceProviderName", e.ServiceProviderName) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteCircuitServiceProviderProperties. -func (e *ExpressRouteCircuitServiceProviderProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "bandwidthInMbps": - err = unpopulate(val, "BandwidthInMbps", &e.BandwidthInMbps) - delete(rawMsg, key) - case "peeringLocation": - err = unpopulate(val, "PeeringLocation", &e.PeeringLocation) - delete(rawMsg, key) - case "serviceProviderName": - err = unpopulate(val, "ServiceProviderName", &e.ServiceProviderName) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExpressRouteCircuitStats. -func (e ExpressRouteCircuitStats) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "primarybytesIn", e.PrimarybytesIn) - populate(objectMap, "primarybytesOut", e.PrimarybytesOut) - populate(objectMap, "secondarybytesIn", e.SecondarybytesIn) - populate(objectMap, "secondarybytesOut", e.SecondarybytesOut) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteCircuitStats. -func (e *ExpressRouteCircuitStats) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "primarybytesIn": - err = unpopulate(val, "PrimarybytesIn", &e.PrimarybytesIn) - delete(rawMsg, key) - case "primarybytesOut": - err = unpopulate(val, "PrimarybytesOut", &e.PrimarybytesOut) - delete(rawMsg, key) - case "secondarybytesIn": - err = unpopulate(val, "SecondarybytesIn", &e.SecondarybytesIn) - delete(rawMsg, key) - case "secondarybytesOut": - err = unpopulate(val, "SecondarybytesOut", &e.SecondarybytesOut) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExpressRouteCircuitsArpTableListResult. -func (e ExpressRouteCircuitsArpTableListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", e.NextLink) - populate(objectMap, "value", e.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteCircuitsArpTableListResult. -func (e *ExpressRouteCircuitsArpTableListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &e.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &e.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExpressRouteCircuitsRoutesTableListResult. -func (e ExpressRouteCircuitsRoutesTableListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", e.NextLink) - populate(objectMap, "value", e.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteCircuitsRoutesTableListResult. -func (e *ExpressRouteCircuitsRoutesTableListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &e.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &e.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExpressRouteCircuitsRoutesTableSummaryListResult. -func (e ExpressRouteCircuitsRoutesTableSummaryListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", e.NextLink) - populate(objectMap, "value", e.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteCircuitsRoutesTableSummaryListResult. -func (e *ExpressRouteCircuitsRoutesTableSummaryListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &e.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &e.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExpressRouteConnection. -func (e ExpressRouteConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", e.ID) - populate(objectMap, "name", e.Name) - populate(objectMap, "properties", e.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteConnection. -func (e *ExpressRouteConnection) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &e.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &e.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &e.Properties) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExpressRouteConnectionID. -func (e ExpressRouteConnectionID) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", e.ID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteConnectionID. -func (e *ExpressRouteConnectionID) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &e.ID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExpressRouteConnectionList. -func (e ExpressRouteConnectionList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "value", e.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteConnectionList. -func (e *ExpressRouteConnectionList) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "value": - err = unpopulate(val, "Value", &e.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExpressRouteConnectionProperties. -func (e ExpressRouteConnectionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "authorizationKey", e.AuthorizationKey) - populate(objectMap, "enableInternetSecurity", e.EnableInternetSecurity) - populate(objectMap, "expressRouteCircuitPeering", e.ExpressRouteCircuitPeering) - populate(objectMap, "expressRouteGatewayBypass", e.ExpressRouteGatewayBypass) - populate(objectMap, "provisioningState", e.ProvisioningState) - populate(objectMap, "routingConfiguration", e.RoutingConfiguration) - populate(objectMap, "routingWeight", e.RoutingWeight) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteConnectionProperties. -func (e *ExpressRouteConnectionProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "authorizationKey": - err = unpopulate(val, "AuthorizationKey", &e.AuthorizationKey) - delete(rawMsg, key) - case "enableInternetSecurity": - err = unpopulate(val, "EnableInternetSecurity", &e.EnableInternetSecurity) - delete(rawMsg, key) - case "expressRouteCircuitPeering": - err = unpopulate(val, "ExpressRouteCircuitPeering", &e.ExpressRouteCircuitPeering) - delete(rawMsg, key) - case "expressRouteGatewayBypass": - err = unpopulate(val, "ExpressRouteGatewayBypass", &e.ExpressRouteGatewayBypass) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &e.ProvisioningState) - delete(rawMsg, key) - case "routingConfiguration": - err = unpopulate(val, "RoutingConfiguration", &e.RoutingConfiguration) - delete(rawMsg, key) - case "routingWeight": - err = unpopulate(val, "RoutingWeight", &e.RoutingWeight) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExpressRouteCrossConnection. -func (e ExpressRouteCrossConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", e.Etag) - populate(objectMap, "id", e.ID) - populate(objectMap, "location", e.Location) - populate(objectMap, "name", e.Name) - populate(objectMap, "properties", e.Properties) - populate(objectMap, "tags", e.Tags) - populate(objectMap, "type", e.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteCrossConnection. -func (e *ExpressRouteCrossConnection) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &e.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &e.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &e.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &e.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &e.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &e.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &e.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExpressRouteCrossConnectionListResult. -func (e ExpressRouteCrossConnectionListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", e.NextLink) - populate(objectMap, "value", e.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteCrossConnectionListResult. -func (e *ExpressRouteCrossConnectionListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &e.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &e.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExpressRouteCrossConnectionPeering. -func (e ExpressRouteCrossConnectionPeering) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", e.Etag) - populate(objectMap, "id", e.ID) - populate(objectMap, "name", e.Name) - populate(objectMap, "properties", e.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteCrossConnectionPeering. -func (e *ExpressRouteCrossConnectionPeering) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &e.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &e.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &e.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &e.Properties) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExpressRouteCrossConnectionPeeringList. -func (e ExpressRouteCrossConnectionPeeringList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", e.NextLink) - populate(objectMap, "value", e.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteCrossConnectionPeeringList. -func (e *ExpressRouteCrossConnectionPeeringList) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &e.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &e.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExpressRouteCrossConnectionPeeringProperties. -func (e ExpressRouteCrossConnectionPeeringProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "azureASN", e.AzureASN) - populate(objectMap, "gatewayManagerEtag", e.GatewayManagerEtag) - populate(objectMap, "ipv6PeeringConfig", e.IPv6PeeringConfig) - populate(objectMap, "lastModifiedBy", e.LastModifiedBy) - populate(objectMap, "microsoftPeeringConfig", e.MicrosoftPeeringConfig) - populate(objectMap, "peerASN", e.PeerASN) - populate(objectMap, "peeringType", e.PeeringType) - populate(objectMap, "primaryAzurePort", e.PrimaryAzurePort) - populate(objectMap, "primaryPeerAddressPrefix", e.PrimaryPeerAddressPrefix) - populate(objectMap, "provisioningState", e.ProvisioningState) - populate(objectMap, "secondaryAzurePort", e.SecondaryAzurePort) - populate(objectMap, "secondaryPeerAddressPrefix", e.SecondaryPeerAddressPrefix) - populate(objectMap, "sharedKey", e.SharedKey) - populate(objectMap, "state", e.State) - populate(objectMap, "vlanId", e.VlanID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteCrossConnectionPeeringProperties. -func (e *ExpressRouteCrossConnectionPeeringProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "azureASN": - err = unpopulate(val, "AzureASN", &e.AzureASN) - delete(rawMsg, key) - case "gatewayManagerEtag": - err = unpopulate(val, "GatewayManagerEtag", &e.GatewayManagerEtag) - delete(rawMsg, key) - case "ipv6PeeringConfig": - err = unpopulate(val, "IPv6PeeringConfig", &e.IPv6PeeringConfig) - delete(rawMsg, key) - case "lastModifiedBy": - err = unpopulate(val, "LastModifiedBy", &e.LastModifiedBy) - delete(rawMsg, key) - case "microsoftPeeringConfig": - err = unpopulate(val, "MicrosoftPeeringConfig", &e.MicrosoftPeeringConfig) - delete(rawMsg, key) - case "peerASN": - err = unpopulate(val, "PeerASN", &e.PeerASN) - delete(rawMsg, key) - case "peeringType": - err = unpopulate(val, "PeeringType", &e.PeeringType) - delete(rawMsg, key) - case "primaryAzurePort": - err = unpopulate(val, "PrimaryAzurePort", &e.PrimaryAzurePort) - delete(rawMsg, key) - case "primaryPeerAddressPrefix": - err = unpopulate(val, "PrimaryPeerAddressPrefix", &e.PrimaryPeerAddressPrefix) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &e.ProvisioningState) - delete(rawMsg, key) - case "secondaryAzurePort": - err = unpopulate(val, "SecondaryAzurePort", &e.SecondaryAzurePort) - delete(rawMsg, key) - case "secondaryPeerAddressPrefix": - err = unpopulate(val, "SecondaryPeerAddressPrefix", &e.SecondaryPeerAddressPrefix) - delete(rawMsg, key) - case "sharedKey": - err = unpopulate(val, "SharedKey", &e.SharedKey) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &e.State) - delete(rawMsg, key) - case "vlanId": - err = unpopulate(val, "VlanID", &e.VlanID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExpressRouteCrossConnectionProperties. -func (e ExpressRouteCrossConnectionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "bandwidthInMbps", e.BandwidthInMbps) - populate(objectMap, "expressRouteCircuit", e.ExpressRouteCircuit) - populate(objectMap, "peeringLocation", e.PeeringLocation) - populate(objectMap, "peerings", e.Peerings) - populate(objectMap, "primaryAzurePort", e.PrimaryAzurePort) - populate(objectMap, "provisioningState", e.ProvisioningState) - populate(objectMap, "sTag", e.STag) - populate(objectMap, "secondaryAzurePort", e.SecondaryAzurePort) - populate(objectMap, "serviceProviderNotes", e.ServiceProviderNotes) - populate(objectMap, "serviceProviderProvisioningState", e.ServiceProviderProvisioningState) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteCrossConnectionProperties. -func (e *ExpressRouteCrossConnectionProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "bandwidthInMbps": - err = unpopulate(val, "BandwidthInMbps", &e.BandwidthInMbps) - delete(rawMsg, key) - case "expressRouteCircuit": - err = unpopulate(val, "ExpressRouteCircuit", &e.ExpressRouteCircuit) - delete(rawMsg, key) - case "peeringLocation": - err = unpopulate(val, "PeeringLocation", &e.PeeringLocation) - delete(rawMsg, key) - case "peerings": - err = unpopulate(val, "Peerings", &e.Peerings) - delete(rawMsg, key) - case "primaryAzurePort": - err = unpopulate(val, "PrimaryAzurePort", &e.PrimaryAzurePort) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &e.ProvisioningState) - delete(rawMsg, key) - case "sTag": - err = unpopulate(val, "STag", &e.STag) - delete(rawMsg, key) - case "secondaryAzurePort": - err = unpopulate(val, "SecondaryAzurePort", &e.SecondaryAzurePort) - delete(rawMsg, key) - case "serviceProviderNotes": - err = unpopulate(val, "ServiceProviderNotes", &e.ServiceProviderNotes) - delete(rawMsg, key) - case "serviceProviderProvisioningState": - err = unpopulate(val, "ServiceProviderProvisioningState", &e.ServiceProviderProvisioningState) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExpressRouteCrossConnectionRoutesTableSummary. -func (e ExpressRouteCrossConnectionRoutesTableSummary) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "asn", e.Asn) - populate(objectMap, "neighbor", e.Neighbor) - populate(objectMap, "stateOrPrefixesReceived", e.StateOrPrefixesReceived) - populate(objectMap, "upDown", e.UpDown) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteCrossConnectionRoutesTableSummary. -func (e *ExpressRouteCrossConnectionRoutesTableSummary) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "asn": - err = unpopulate(val, "Asn", &e.Asn) - delete(rawMsg, key) - case "neighbor": - err = unpopulate(val, "Neighbor", &e.Neighbor) - delete(rawMsg, key) - case "stateOrPrefixesReceived": - err = unpopulate(val, "StateOrPrefixesReceived", &e.StateOrPrefixesReceived) - delete(rawMsg, key) - case "upDown": - err = unpopulate(val, "UpDown", &e.UpDown) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExpressRouteCrossConnectionsRoutesTableSummaryListResult. -func (e ExpressRouteCrossConnectionsRoutesTableSummaryListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", e.NextLink) - populate(objectMap, "value", e.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteCrossConnectionsRoutesTableSummaryListResult. -func (e *ExpressRouteCrossConnectionsRoutesTableSummaryListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &e.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &e.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExpressRouteGateway. -func (e ExpressRouteGateway) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", e.Etag) - populate(objectMap, "id", e.ID) - populate(objectMap, "location", e.Location) - populate(objectMap, "name", e.Name) - populate(objectMap, "properties", e.Properties) - populate(objectMap, "tags", e.Tags) - populate(objectMap, "type", e.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteGateway. -func (e *ExpressRouteGateway) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &e.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &e.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &e.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &e.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &e.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &e.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &e.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExpressRouteGatewayList. -func (e ExpressRouteGatewayList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "value", e.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteGatewayList. -func (e *ExpressRouteGatewayList) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "value": - err = unpopulate(val, "Value", &e.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExpressRouteGatewayProperties. -func (e ExpressRouteGatewayProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "autoScaleConfiguration", e.AutoScaleConfiguration) - populate(objectMap, "expressRouteConnections", e.ExpressRouteConnections) - populate(objectMap, "provisioningState", e.ProvisioningState) - populate(objectMap, "virtualHub", e.VirtualHub) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteGatewayProperties. -func (e *ExpressRouteGatewayProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "autoScaleConfiguration": - err = unpopulate(val, "AutoScaleConfiguration", &e.AutoScaleConfiguration) - delete(rawMsg, key) - case "expressRouteConnections": - err = unpopulate(val, "ExpressRouteConnections", &e.ExpressRouteConnections) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &e.ProvisioningState) - delete(rawMsg, key) - case "virtualHub": - err = unpopulate(val, "VirtualHub", &e.VirtualHub) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExpressRouteGatewayPropertiesAutoScaleConfiguration. -func (e ExpressRouteGatewayPropertiesAutoScaleConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "bounds", e.Bounds) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteGatewayPropertiesAutoScaleConfiguration. -func (e *ExpressRouteGatewayPropertiesAutoScaleConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "bounds": - err = unpopulate(val, "Bounds", &e.Bounds) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds. -func (e ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "max", e.Max) - populate(objectMap, "min", e.Min) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds. -func (e *ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "max": - err = unpopulate(val, "Max", &e.Max) - delete(rawMsg, key) - case "min": - err = unpopulate(val, "Min", &e.Min) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExpressRouteLink. -func (e ExpressRouteLink) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", e.Etag) - populate(objectMap, "id", e.ID) - populate(objectMap, "name", e.Name) - populate(objectMap, "properties", e.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteLink. -func (e *ExpressRouteLink) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &e.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &e.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &e.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &e.Properties) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExpressRouteLinkListResult. -func (e ExpressRouteLinkListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", e.NextLink) - populate(objectMap, "value", e.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteLinkListResult. -func (e *ExpressRouteLinkListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &e.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &e.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExpressRouteLinkMacSecConfig. -func (e ExpressRouteLinkMacSecConfig) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "cakSecretIdentifier", e.CakSecretIdentifier) - populate(objectMap, "cipher", e.Cipher) - populate(objectMap, "cknSecretIdentifier", e.CknSecretIdentifier) - populate(objectMap, "sciState", e.SciState) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteLinkMacSecConfig. -func (e *ExpressRouteLinkMacSecConfig) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "cakSecretIdentifier": - err = unpopulate(val, "CakSecretIdentifier", &e.CakSecretIdentifier) - delete(rawMsg, key) - case "cipher": - err = unpopulate(val, "Cipher", &e.Cipher) - delete(rawMsg, key) - case "cknSecretIdentifier": - err = unpopulate(val, "CknSecretIdentifier", &e.CknSecretIdentifier) - delete(rawMsg, key) - case "sciState": - err = unpopulate(val, "SciState", &e.SciState) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExpressRouteLinkPropertiesFormat. -func (e ExpressRouteLinkPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "adminState", e.AdminState) - populate(objectMap, "connectorType", e.ConnectorType) - populate(objectMap, "interfaceName", e.InterfaceName) - populate(objectMap, "macSecConfig", e.MacSecConfig) - populate(objectMap, "patchPanelId", e.PatchPanelID) - populate(objectMap, "provisioningState", e.ProvisioningState) - populate(objectMap, "rackId", e.RackID) - populate(objectMap, "routerName", e.RouterName) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteLinkPropertiesFormat. -func (e *ExpressRouteLinkPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "adminState": - err = unpopulate(val, "AdminState", &e.AdminState) - delete(rawMsg, key) - case "connectorType": - err = unpopulate(val, "ConnectorType", &e.ConnectorType) - delete(rawMsg, key) - case "interfaceName": - err = unpopulate(val, "InterfaceName", &e.InterfaceName) - delete(rawMsg, key) - case "macSecConfig": - err = unpopulate(val, "MacSecConfig", &e.MacSecConfig) - delete(rawMsg, key) - case "patchPanelId": - err = unpopulate(val, "PatchPanelID", &e.PatchPanelID) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &e.ProvisioningState) - delete(rawMsg, key) - case "rackId": - err = unpopulate(val, "RackID", &e.RackID) - delete(rawMsg, key) - case "routerName": - err = unpopulate(val, "RouterName", &e.RouterName) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExpressRoutePort. -func (e ExpressRoutePort) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", e.Etag) - populate(objectMap, "id", e.ID) - populate(objectMap, "identity", e.Identity) - populate(objectMap, "location", e.Location) - populate(objectMap, "name", e.Name) - populate(objectMap, "properties", e.Properties) - populate(objectMap, "tags", e.Tags) - populate(objectMap, "type", e.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRoutePort. -func (e *ExpressRoutePort) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &e.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &e.ID) - delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &e.Identity) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &e.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &e.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &e.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &e.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &e.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExpressRoutePortAuthorization. -func (e ExpressRoutePortAuthorization) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", e.Etag) - populate(objectMap, "id", e.ID) - populate(objectMap, "name", e.Name) - populate(objectMap, "properties", e.Properties) - populate(objectMap, "type", e.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRoutePortAuthorization. -func (e *ExpressRoutePortAuthorization) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &e.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &e.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &e.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &e.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &e.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExpressRoutePortAuthorizationListResult. -func (e ExpressRoutePortAuthorizationListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", e.NextLink) - populate(objectMap, "value", e.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRoutePortAuthorizationListResult. -func (e *ExpressRoutePortAuthorizationListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &e.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &e.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExpressRoutePortAuthorizationPropertiesFormat. -func (e ExpressRoutePortAuthorizationPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "authorizationKey", e.AuthorizationKey) - populate(objectMap, "authorizationUseStatus", e.AuthorizationUseStatus) - populate(objectMap, "circuitResourceUri", e.CircuitResourceURI) - populate(objectMap, "provisioningState", e.ProvisioningState) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRoutePortAuthorizationPropertiesFormat. -func (e *ExpressRoutePortAuthorizationPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "authorizationKey": - err = unpopulate(val, "AuthorizationKey", &e.AuthorizationKey) - delete(rawMsg, key) - case "authorizationUseStatus": - err = unpopulate(val, "AuthorizationUseStatus", &e.AuthorizationUseStatus) - delete(rawMsg, key) - case "circuitResourceUri": - err = unpopulate(val, "CircuitResourceURI", &e.CircuitResourceURI) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &e.ProvisioningState) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExpressRoutePortListResult. -func (e ExpressRoutePortListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", e.NextLink) - populate(objectMap, "value", e.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRoutePortListResult. -func (e *ExpressRoutePortListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &e.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &e.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExpressRoutePortPropertiesFormat. -func (e ExpressRoutePortPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "allocationDate", e.AllocationDate) - populate(objectMap, "bandwidthInGbps", e.BandwidthInGbps) - populate(objectMap, "circuits", e.Circuits) - populate(objectMap, "encapsulation", e.Encapsulation) - populate(objectMap, "etherType", e.EtherType) - populate(objectMap, "links", e.Links) - populate(objectMap, "mtu", e.Mtu) - populate(objectMap, "peeringLocation", e.PeeringLocation) - populate(objectMap, "provisionedBandwidthInGbps", e.ProvisionedBandwidthInGbps) - populate(objectMap, "provisioningState", e.ProvisioningState) - populate(objectMap, "resourceGuid", e.ResourceGUID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRoutePortPropertiesFormat. -func (e *ExpressRoutePortPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "allocationDate": - err = unpopulate(val, "AllocationDate", &e.AllocationDate) - delete(rawMsg, key) - case "bandwidthInGbps": - err = unpopulate(val, "BandwidthInGbps", &e.BandwidthInGbps) - delete(rawMsg, key) - case "circuits": - err = unpopulate(val, "Circuits", &e.Circuits) - delete(rawMsg, key) - case "encapsulation": - err = unpopulate(val, "Encapsulation", &e.Encapsulation) - delete(rawMsg, key) - case "etherType": - err = unpopulate(val, "EtherType", &e.EtherType) - delete(rawMsg, key) - case "links": - err = unpopulate(val, "Links", &e.Links) - delete(rawMsg, key) - case "mtu": - err = unpopulate(val, "Mtu", &e.Mtu) - delete(rawMsg, key) - case "peeringLocation": - err = unpopulate(val, "PeeringLocation", &e.PeeringLocation) - delete(rawMsg, key) - case "provisionedBandwidthInGbps": - err = unpopulate(val, "ProvisionedBandwidthInGbps", &e.ProvisionedBandwidthInGbps) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &e.ProvisioningState) - delete(rawMsg, key) - case "resourceGuid": - err = unpopulate(val, "ResourceGUID", &e.ResourceGUID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExpressRoutePortsLocation. -func (e ExpressRoutePortsLocation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", e.ID) - populate(objectMap, "location", e.Location) - populate(objectMap, "name", e.Name) - populate(objectMap, "properties", e.Properties) - populate(objectMap, "tags", e.Tags) - populate(objectMap, "type", e.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRoutePortsLocation. -func (e *ExpressRoutePortsLocation) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &e.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &e.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &e.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &e.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &e.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &e.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExpressRoutePortsLocationBandwidths. -func (e ExpressRoutePortsLocationBandwidths) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "offerName", e.OfferName) - populate(objectMap, "valueInGbps", e.ValueInGbps) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRoutePortsLocationBandwidths. -func (e *ExpressRoutePortsLocationBandwidths) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "offerName": - err = unpopulate(val, "OfferName", &e.OfferName) - delete(rawMsg, key) - case "valueInGbps": - err = unpopulate(val, "ValueInGbps", &e.ValueInGbps) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExpressRoutePortsLocationListResult. -func (e ExpressRoutePortsLocationListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", e.NextLink) - populate(objectMap, "value", e.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRoutePortsLocationListResult. -func (e *ExpressRoutePortsLocationListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &e.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &e.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExpressRoutePortsLocationPropertiesFormat. -func (e ExpressRoutePortsLocationPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "address", e.Address) - populate(objectMap, "availableBandwidths", e.AvailableBandwidths) - populate(objectMap, "contact", e.Contact) - populate(objectMap, "provisioningState", e.ProvisioningState) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRoutePortsLocationPropertiesFormat. -func (e *ExpressRoutePortsLocationPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "address": - err = unpopulate(val, "Address", &e.Address) - delete(rawMsg, key) - case "availableBandwidths": - err = unpopulate(val, "AvailableBandwidths", &e.AvailableBandwidths) - delete(rawMsg, key) - case "contact": - err = unpopulate(val, "Contact", &e.Contact) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &e.ProvisioningState) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExpressRouteProviderPort. -func (e ExpressRouteProviderPort) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", e.Etag) - populate(objectMap, "id", e.ID) - populate(objectMap, "location", e.Location) - populate(objectMap, "name", e.Name) - populate(objectMap, "properties", e.Properties) - populate(objectMap, "tags", e.Tags) - populate(objectMap, "type", e.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteProviderPort. -func (e *ExpressRouteProviderPort) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &e.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &e.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &e.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &e.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &e.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &e.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &e.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExpressRouteProviderPortListResult. -func (e ExpressRouteProviderPortListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", e.NextLink) - populate(objectMap, "value", e.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteProviderPortListResult. -func (e *ExpressRouteProviderPortListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &e.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &e.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExpressRouteProviderPortProperties. -func (e ExpressRouteProviderPortProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "overprovisionFactor", e.OverprovisionFactor) - populate(objectMap, "peeringLocation", e.PeeringLocation) - populate(objectMap, "portBandwidthInMbps", e.PortBandwidthInMbps) - populate(objectMap, "portPairDescriptor", e.PortPairDescriptor) - populate(objectMap, "primaryAzurePort", e.PrimaryAzurePort) - populate(objectMap, "remainingBandwidthInMbps", e.RemainingBandwidthInMbps) - populate(objectMap, "secondaryAzurePort", e.SecondaryAzurePort) - populate(objectMap, "usedBandwidthInMbps", e.UsedBandwidthInMbps) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteProviderPortProperties. -func (e *ExpressRouteProviderPortProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "overprovisionFactor": - err = unpopulate(val, "OverprovisionFactor", &e.OverprovisionFactor) - delete(rawMsg, key) - case "peeringLocation": - err = unpopulate(val, "PeeringLocation", &e.PeeringLocation) - delete(rawMsg, key) - case "portBandwidthInMbps": - err = unpopulate(val, "PortBandwidthInMbps", &e.PortBandwidthInMbps) - delete(rawMsg, key) - case "portPairDescriptor": - err = unpopulate(val, "PortPairDescriptor", &e.PortPairDescriptor) - delete(rawMsg, key) - case "primaryAzurePort": - err = unpopulate(val, "PrimaryAzurePort", &e.PrimaryAzurePort) - delete(rawMsg, key) - case "remainingBandwidthInMbps": - err = unpopulate(val, "RemainingBandwidthInMbps", &e.RemainingBandwidthInMbps) - delete(rawMsg, key) - case "secondaryAzurePort": - err = unpopulate(val, "SecondaryAzurePort", &e.SecondaryAzurePort) - delete(rawMsg, key) - case "usedBandwidthInMbps": - err = unpopulate(val, "UsedBandwidthInMbps", &e.UsedBandwidthInMbps) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExpressRouteServiceProvider. -func (e ExpressRouteServiceProvider) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", e.ID) - populate(objectMap, "location", e.Location) - populate(objectMap, "name", e.Name) - populate(objectMap, "properties", e.Properties) - populate(objectMap, "tags", e.Tags) - populate(objectMap, "type", e.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteServiceProvider. -func (e *ExpressRouteServiceProvider) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &e.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &e.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &e.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &e.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &e.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &e.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExpressRouteServiceProviderBandwidthsOffered. -func (e ExpressRouteServiceProviderBandwidthsOffered) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "offerName", e.OfferName) - populate(objectMap, "valueInMbps", e.ValueInMbps) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteServiceProviderBandwidthsOffered. -func (e *ExpressRouteServiceProviderBandwidthsOffered) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "offerName": - err = unpopulate(val, "OfferName", &e.OfferName) - delete(rawMsg, key) - case "valueInMbps": - err = unpopulate(val, "ValueInMbps", &e.ValueInMbps) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExpressRouteServiceProviderListResult. -func (e ExpressRouteServiceProviderListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", e.NextLink) - populate(objectMap, "value", e.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteServiceProviderListResult. -func (e *ExpressRouteServiceProviderListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &e.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &e.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExpressRouteServiceProviderPropertiesFormat. -func (e ExpressRouteServiceProviderPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "bandwidthsOffered", e.BandwidthsOffered) - populate(objectMap, "peeringLocations", e.PeeringLocations) - populate(objectMap, "provisioningState", e.ProvisioningState) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteServiceProviderPropertiesFormat. -func (e *ExpressRouteServiceProviderPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "bandwidthsOffered": - err = unpopulate(val, "BandwidthsOffered", &e.BandwidthsOffered) - delete(rawMsg, key) - case "peeringLocations": - err = unpopulate(val, "PeeringLocations", &e.PeeringLocations) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &e.ProvisioningState) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExtendedLocation. -func (e ExtendedLocation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "name", e.Name) - populate(objectMap, "type", e.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExtendedLocation. -func (e *ExtendedLocation) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &e.Name) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &e.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type FilterItems. -func (f FilterItems) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "field", f.Field) - populate(objectMap, "values", f.Values) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type FilterItems. -func (f *FilterItems) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "field": - err = unpopulate(val, "Field", &f.Field) - delete(rawMsg, key) - case "values": - err = unpopulate(val, "Values", &f.Values) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type FirewallPolicy. -func (f FirewallPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", f.Etag) - populate(objectMap, "id", f.ID) - populate(objectMap, "identity", f.Identity) - populate(objectMap, "location", f.Location) - populate(objectMap, "name", f.Name) - populate(objectMap, "properties", f.Properties) - populate(objectMap, "tags", f.Tags) - populate(objectMap, "type", f.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallPolicy. -func (f *FirewallPolicy) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &f.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &f.ID) - delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &f.Identity) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &f.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &f.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &f.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &f.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &f.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type FirewallPolicyCertificateAuthority. -func (f FirewallPolicyCertificateAuthority) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "keyVaultSecretId", f.KeyVaultSecretID) - populate(objectMap, "name", f.Name) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallPolicyCertificateAuthority. -func (f *FirewallPolicyCertificateAuthority) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "keyVaultSecretId": - err = unpopulate(val, "KeyVaultSecretID", &f.KeyVaultSecretID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &f.Name) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type FirewallPolicyFilterRuleCollection. -func (f FirewallPolicyFilterRuleCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "action", f.Action) - populate(objectMap, "name", f.Name) - populate(objectMap, "priority", f.Priority) - objectMap["ruleCollectionType"] = FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection - populate(objectMap, "rules", f.Rules) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallPolicyFilterRuleCollection. -func (f *FirewallPolicyFilterRuleCollection) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "action": - err = unpopulate(val, "Action", &f.Action) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &f.Name) - delete(rawMsg, key) - case "priority": - err = unpopulate(val, "Priority", &f.Priority) - delete(rawMsg, key) - case "ruleCollectionType": - err = unpopulate(val, "RuleCollectionType", &f.RuleCollectionType) - delete(rawMsg, key) - case "rules": - f.Rules, err = unmarshalFirewallPolicyRuleClassificationArray(val) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type FirewallPolicyFilterRuleCollectionAction. -func (f FirewallPolicyFilterRuleCollectionAction) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "type", f.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallPolicyFilterRuleCollectionAction. -func (f *FirewallPolicyFilterRuleCollectionAction) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "type": - err = unpopulate(val, "Type", &f.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type FirewallPolicyInsights. -func (f FirewallPolicyInsights) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "isEnabled", f.IsEnabled) - populate(objectMap, "logAnalyticsResources", f.LogAnalyticsResources) - populate(objectMap, "retentionDays", f.RetentionDays) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallPolicyInsights. -func (f *FirewallPolicyInsights) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "isEnabled": - err = unpopulate(val, "IsEnabled", &f.IsEnabled) - delete(rawMsg, key) - case "logAnalyticsResources": - err = unpopulate(val, "LogAnalyticsResources", &f.LogAnalyticsResources) - delete(rawMsg, key) - case "retentionDays": - err = unpopulate(val, "RetentionDays", &f.RetentionDays) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type FirewallPolicyIntrusionDetection. -func (f FirewallPolicyIntrusionDetection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "configuration", f.Configuration) - populate(objectMap, "mode", f.Mode) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallPolicyIntrusionDetection. -func (f *FirewallPolicyIntrusionDetection) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "configuration": - err = unpopulate(val, "Configuration", &f.Configuration) - delete(rawMsg, key) - case "mode": - err = unpopulate(val, "Mode", &f.Mode) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type FirewallPolicyIntrusionDetectionBypassTrafficSpecifications. -func (f FirewallPolicyIntrusionDetectionBypassTrafficSpecifications) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "description", f.Description) - populate(objectMap, "destinationAddresses", f.DestinationAddresses) - populate(objectMap, "destinationIpGroups", f.DestinationIPGroups) - populate(objectMap, "destinationPorts", f.DestinationPorts) - populate(objectMap, "name", f.Name) - populate(objectMap, "protocol", f.Protocol) - populate(objectMap, "sourceAddresses", f.SourceAddresses) - populate(objectMap, "sourceIpGroups", f.SourceIPGroups) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallPolicyIntrusionDetectionBypassTrafficSpecifications. -func (f *FirewallPolicyIntrusionDetectionBypassTrafficSpecifications) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "description": - err = unpopulate(val, "Description", &f.Description) - delete(rawMsg, key) - case "destinationAddresses": - err = unpopulate(val, "DestinationAddresses", &f.DestinationAddresses) - delete(rawMsg, key) - case "destinationIpGroups": - err = unpopulate(val, "DestinationIPGroups", &f.DestinationIPGroups) - delete(rawMsg, key) - case "destinationPorts": - err = unpopulate(val, "DestinationPorts", &f.DestinationPorts) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &f.Name) - delete(rawMsg, key) - case "protocol": - err = unpopulate(val, "Protocol", &f.Protocol) - delete(rawMsg, key) - case "sourceAddresses": - err = unpopulate(val, "SourceAddresses", &f.SourceAddresses) - delete(rawMsg, key) - case "sourceIpGroups": - err = unpopulate(val, "SourceIPGroups", &f.SourceIPGroups) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type FirewallPolicyIntrusionDetectionConfiguration. -func (f FirewallPolicyIntrusionDetectionConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "bypassTrafficSettings", f.BypassTrafficSettings) - populate(objectMap, "privateRanges", f.PrivateRanges) - populate(objectMap, "signatureOverrides", f.SignatureOverrides) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallPolicyIntrusionDetectionConfiguration. -func (f *FirewallPolicyIntrusionDetectionConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "bypassTrafficSettings": - err = unpopulate(val, "BypassTrafficSettings", &f.BypassTrafficSettings) - delete(rawMsg, key) - case "privateRanges": - err = unpopulate(val, "PrivateRanges", &f.PrivateRanges) - delete(rawMsg, key) - case "signatureOverrides": - err = unpopulate(val, "SignatureOverrides", &f.SignatureOverrides) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type FirewallPolicyIntrusionDetectionSignatureSpecification. -func (f FirewallPolicyIntrusionDetectionSignatureSpecification) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", f.ID) - populate(objectMap, "mode", f.Mode) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallPolicyIntrusionDetectionSignatureSpecification. -func (f *FirewallPolicyIntrusionDetectionSignatureSpecification) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &f.ID) - delete(rawMsg, key) - case "mode": - err = unpopulate(val, "Mode", &f.Mode) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type FirewallPolicyListResult. -func (f FirewallPolicyListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", f.NextLink) - populate(objectMap, "value", f.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallPolicyListResult. -func (f *FirewallPolicyListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &f.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &f.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type FirewallPolicyLogAnalyticsResources. -func (f FirewallPolicyLogAnalyticsResources) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "defaultWorkspaceId", f.DefaultWorkspaceID) - populate(objectMap, "workspaces", f.Workspaces) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallPolicyLogAnalyticsResources. -func (f *FirewallPolicyLogAnalyticsResources) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "defaultWorkspaceId": - err = unpopulate(val, "DefaultWorkspaceID", &f.DefaultWorkspaceID) - delete(rawMsg, key) - case "workspaces": - err = unpopulate(val, "Workspaces", &f.Workspaces) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type FirewallPolicyLogAnalyticsWorkspace. -func (f FirewallPolicyLogAnalyticsWorkspace) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "region", f.Region) - populate(objectMap, "workspaceId", f.WorkspaceID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallPolicyLogAnalyticsWorkspace. -func (f *FirewallPolicyLogAnalyticsWorkspace) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "region": - err = unpopulate(val, "Region", &f.Region) - delete(rawMsg, key) - case "workspaceId": - err = unpopulate(val, "WorkspaceID", &f.WorkspaceID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type FirewallPolicyNatRuleCollection. -func (f FirewallPolicyNatRuleCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "action", f.Action) - populate(objectMap, "name", f.Name) - populate(objectMap, "priority", f.Priority) - objectMap["ruleCollectionType"] = FirewallPolicyRuleCollectionTypeFirewallPolicyNatRuleCollection - populate(objectMap, "rules", f.Rules) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallPolicyNatRuleCollection. -func (f *FirewallPolicyNatRuleCollection) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "action": - err = unpopulate(val, "Action", &f.Action) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &f.Name) - delete(rawMsg, key) - case "priority": - err = unpopulate(val, "Priority", &f.Priority) - delete(rawMsg, key) - case "ruleCollectionType": - err = unpopulate(val, "RuleCollectionType", &f.RuleCollectionType) - delete(rawMsg, key) - case "rules": - f.Rules, err = unmarshalFirewallPolicyRuleClassificationArray(val) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type FirewallPolicyNatRuleCollectionAction. -func (f FirewallPolicyNatRuleCollectionAction) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "type", f.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallPolicyNatRuleCollectionAction. -func (f *FirewallPolicyNatRuleCollectionAction) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "type": - err = unpopulate(val, "Type", &f.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type FirewallPolicyPropertiesFormat. -func (f FirewallPolicyPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "basePolicy", f.BasePolicy) - populate(objectMap, "childPolicies", f.ChildPolicies) - populate(objectMap, "dnsSettings", f.DNSSettings) - populate(objectMap, "explicitProxySettings", f.ExplicitProxySettings) - populate(objectMap, "firewalls", f.Firewalls) - populate(objectMap, "insights", f.Insights) - populate(objectMap, "intrusionDetection", f.IntrusionDetection) - populate(objectMap, "provisioningState", f.ProvisioningState) - populate(objectMap, "ruleCollectionGroups", f.RuleCollectionGroups) - populate(objectMap, "sku", f.SKU) - populate(objectMap, "sql", f.SQL) - populate(objectMap, "snat", f.Snat) - populate(objectMap, "threatIntelMode", f.ThreatIntelMode) - populate(objectMap, "threatIntelWhitelist", f.ThreatIntelWhitelist) - populate(objectMap, "transportSecurity", f.TransportSecurity) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallPolicyPropertiesFormat. -func (f *FirewallPolicyPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "basePolicy": - err = unpopulate(val, "BasePolicy", &f.BasePolicy) - delete(rawMsg, key) - case "childPolicies": - err = unpopulate(val, "ChildPolicies", &f.ChildPolicies) - delete(rawMsg, key) - case "dnsSettings": - err = unpopulate(val, "DNSSettings", &f.DNSSettings) - delete(rawMsg, key) - case "explicitProxySettings": - err = unpopulate(val, "ExplicitProxySettings", &f.ExplicitProxySettings) - delete(rawMsg, key) - case "firewalls": - err = unpopulate(val, "Firewalls", &f.Firewalls) - delete(rawMsg, key) - case "insights": - err = unpopulate(val, "Insights", &f.Insights) - delete(rawMsg, key) - case "intrusionDetection": - err = unpopulate(val, "IntrusionDetection", &f.IntrusionDetection) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &f.ProvisioningState) - delete(rawMsg, key) - case "ruleCollectionGroups": - err = unpopulate(val, "RuleCollectionGroups", &f.RuleCollectionGroups) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &f.SKU) - delete(rawMsg, key) - case "sql": - err = unpopulate(val, "SQL", &f.SQL) - delete(rawMsg, key) - case "snat": - err = unpopulate(val, "Snat", &f.Snat) - delete(rawMsg, key) - case "threatIntelMode": - err = unpopulate(val, "ThreatIntelMode", &f.ThreatIntelMode) - delete(rawMsg, key) - case "threatIntelWhitelist": - err = unpopulate(val, "ThreatIntelWhitelist", &f.ThreatIntelWhitelist) - delete(rawMsg, key) - case "transportSecurity": - err = unpopulate(val, "TransportSecurity", &f.TransportSecurity) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type FirewallPolicyRule. -func (f FirewallPolicyRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "description", f.Description) - populate(objectMap, "name", f.Name) - objectMap["ruleType"] = f.RuleType - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallPolicyRule. -func (f *FirewallPolicyRule) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "description": - err = unpopulate(val, "Description", &f.Description) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &f.Name) - delete(rawMsg, key) - case "ruleType": - err = unpopulate(val, "RuleType", &f.RuleType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type FirewallPolicyRuleApplicationProtocol. -func (f FirewallPolicyRuleApplicationProtocol) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "port", f.Port) - populate(objectMap, "protocolType", f.ProtocolType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallPolicyRuleApplicationProtocol. -func (f *FirewallPolicyRuleApplicationProtocol) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "port": - err = unpopulate(val, "Port", &f.Port) - delete(rawMsg, key) - case "protocolType": - err = unpopulate(val, "ProtocolType", &f.ProtocolType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type FirewallPolicyRuleCollection. -func (f FirewallPolicyRuleCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "name", f.Name) - populate(objectMap, "priority", f.Priority) - objectMap["ruleCollectionType"] = f.RuleCollectionType - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallPolicyRuleCollection. -func (f *FirewallPolicyRuleCollection) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &f.Name) - delete(rawMsg, key) - case "priority": - err = unpopulate(val, "Priority", &f.Priority) - delete(rawMsg, key) - case "ruleCollectionType": - err = unpopulate(val, "RuleCollectionType", &f.RuleCollectionType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type FirewallPolicyRuleCollectionGroup. -func (f FirewallPolicyRuleCollectionGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", f.Etag) - populate(objectMap, "id", f.ID) - populate(objectMap, "name", f.Name) - populate(objectMap, "properties", f.Properties) - populate(objectMap, "type", f.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallPolicyRuleCollectionGroup. -func (f *FirewallPolicyRuleCollectionGroup) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &f.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &f.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &f.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &f.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &f.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type FirewallPolicyRuleCollectionGroupListResult. -func (f FirewallPolicyRuleCollectionGroupListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", f.NextLink) - populate(objectMap, "value", f.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallPolicyRuleCollectionGroupListResult. -func (f *FirewallPolicyRuleCollectionGroupListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &f.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &f.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type FirewallPolicyRuleCollectionGroupProperties. -func (f FirewallPolicyRuleCollectionGroupProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "priority", f.Priority) - populate(objectMap, "provisioningState", f.ProvisioningState) - populate(objectMap, "ruleCollections", f.RuleCollections) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallPolicyRuleCollectionGroupProperties. -func (f *FirewallPolicyRuleCollectionGroupProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "priority": - err = unpopulate(val, "Priority", &f.Priority) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &f.ProvisioningState) - delete(rawMsg, key) - case "ruleCollections": - f.RuleCollections, err = unmarshalFirewallPolicyRuleCollectionClassificationArray(val) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type FirewallPolicySKU. -func (f FirewallPolicySKU) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "tier", f.Tier) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallPolicySKU. -func (f *FirewallPolicySKU) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "tier": - err = unpopulate(val, "Tier", &f.Tier) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type FirewallPolicySNAT. -func (f FirewallPolicySNAT) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "autoLearnPrivateRanges", f.AutoLearnPrivateRanges) - populate(objectMap, "privateRanges", f.PrivateRanges) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallPolicySNAT. -func (f *FirewallPolicySNAT) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "autoLearnPrivateRanges": - err = unpopulate(val, "AutoLearnPrivateRanges", &f.AutoLearnPrivateRanges) - delete(rawMsg, key) - case "privateRanges": - err = unpopulate(val, "PrivateRanges", &f.PrivateRanges) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type FirewallPolicySQL. -func (f FirewallPolicySQL) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "allowSqlRedirect", f.AllowSQLRedirect) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallPolicySQL. -func (f *FirewallPolicySQL) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "allowSqlRedirect": - err = unpopulate(val, "AllowSQLRedirect", &f.AllowSQLRedirect) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type FirewallPolicyThreatIntelWhitelist. -func (f FirewallPolicyThreatIntelWhitelist) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "fqdns", f.Fqdns) - populate(objectMap, "ipAddresses", f.IPAddresses) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallPolicyThreatIntelWhitelist. -func (f *FirewallPolicyThreatIntelWhitelist) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "fqdns": - err = unpopulate(val, "Fqdns", &f.Fqdns) - delete(rawMsg, key) - case "ipAddresses": - err = unpopulate(val, "IPAddresses", &f.IPAddresses) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type FirewallPolicyTransportSecurity. -func (f FirewallPolicyTransportSecurity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "certificateAuthority", f.CertificateAuthority) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallPolicyTransportSecurity. -func (f *FirewallPolicyTransportSecurity) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "certificateAuthority": - err = unpopulate(val, "CertificateAuthority", &f.CertificateAuthority) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type FlowLog. -func (f FlowLog) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", f.Etag) - populate(objectMap, "id", f.ID) - populate(objectMap, "location", f.Location) - populate(objectMap, "name", f.Name) - populate(objectMap, "properties", f.Properties) - populate(objectMap, "tags", f.Tags) - populate(objectMap, "type", f.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type FlowLog. -func (f *FlowLog) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &f.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &f.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &f.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &f.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &f.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &f.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &f.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type FlowLogFormatParameters. -func (f FlowLogFormatParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "type", f.Type) - populate(objectMap, "version", f.Version) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type FlowLogFormatParameters. -func (f *FlowLogFormatParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "type": - err = unpopulate(val, "Type", &f.Type) - delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &f.Version) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type FlowLogInformation. -func (f FlowLogInformation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "flowAnalyticsConfiguration", f.FlowAnalyticsConfiguration) - populate(objectMap, "properties", f.Properties) - populate(objectMap, "targetResourceId", f.TargetResourceID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type FlowLogInformation. -func (f *FlowLogInformation) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "flowAnalyticsConfiguration": - err = unpopulate(val, "FlowAnalyticsConfiguration", &f.FlowAnalyticsConfiguration) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &f.Properties) - delete(rawMsg, key) - case "targetResourceId": - err = unpopulate(val, "TargetResourceID", &f.TargetResourceID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type FlowLogListResult. -func (f FlowLogListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", f.NextLink) - populate(objectMap, "value", f.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type FlowLogListResult. -func (f *FlowLogListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &f.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &f.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type FlowLogProperties. -func (f FlowLogProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "enabled", f.Enabled) - populate(objectMap, "format", f.Format) - populate(objectMap, "retentionPolicy", f.RetentionPolicy) - populate(objectMap, "storageId", f.StorageID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type FlowLogProperties. -func (f *FlowLogProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "enabled": - err = unpopulate(val, "Enabled", &f.Enabled) - delete(rawMsg, key) - case "format": - err = unpopulate(val, "Format", &f.Format) - delete(rawMsg, key) - case "retentionPolicy": - err = unpopulate(val, "RetentionPolicy", &f.RetentionPolicy) - delete(rawMsg, key) - case "storageId": - err = unpopulate(val, "StorageID", &f.StorageID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type FlowLogPropertiesFormat. -func (f FlowLogPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "enabled", f.Enabled) - populate(objectMap, "flowAnalyticsConfiguration", f.FlowAnalyticsConfiguration) - populate(objectMap, "format", f.Format) - populate(objectMap, "provisioningState", f.ProvisioningState) - populate(objectMap, "retentionPolicy", f.RetentionPolicy) - populate(objectMap, "storageId", f.StorageID) - populate(objectMap, "targetResourceGuid", f.TargetResourceGUID) - populate(objectMap, "targetResourceId", f.TargetResourceID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type FlowLogPropertiesFormat. -func (f *FlowLogPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "enabled": - err = unpopulate(val, "Enabled", &f.Enabled) - delete(rawMsg, key) - case "flowAnalyticsConfiguration": - err = unpopulate(val, "FlowAnalyticsConfiguration", &f.FlowAnalyticsConfiguration) - delete(rawMsg, key) - case "format": - err = unpopulate(val, "Format", &f.Format) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &f.ProvisioningState) - delete(rawMsg, key) - case "retentionPolicy": - err = unpopulate(val, "RetentionPolicy", &f.RetentionPolicy) - delete(rawMsg, key) - case "storageId": - err = unpopulate(val, "StorageID", &f.StorageID) - delete(rawMsg, key) - case "targetResourceGuid": - err = unpopulate(val, "TargetResourceGUID", &f.TargetResourceGUID) - delete(rawMsg, key) - case "targetResourceId": - err = unpopulate(val, "TargetResourceID", &f.TargetResourceID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type FlowLogStatusParameters. -func (f FlowLogStatusParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "targetResourceId", f.TargetResourceID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type FlowLogStatusParameters. -func (f *FlowLogStatusParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "targetResourceId": - err = unpopulate(val, "TargetResourceID", &f.TargetResourceID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type FrontendIPConfiguration. -func (f FrontendIPConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", f.Etag) - populate(objectMap, "id", f.ID) - populate(objectMap, "name", f.Name) - populate(objectMap, "properties", f.Properties) - populate(objectMap, "type", f.Type) - populate(objectMap, "zones", f.Zones) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type FrontendIPConfiguration. -func (f *FrontendIPConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &f.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &f.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &f.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &f.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &f.Type) - delete(rawMsg, key) - case "zones": - err = unpopulate(val, "Zones", &f.Zones) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type FrontendIPConfigurationPropertiesFormat. -func (f FrontendIPConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "gatewayLoadBalancer", f.GatewayLoadBalancer) - populate(objectMap, "inboundNatPools", f.InboundNatPools) - populate(objectMap, "inboundNatRules", f.InboundNatRules) - populate(objectMap, "loadBalancingRules", f.LoadBalancingRules) - populate(objectMap, "outboundRules", f.OutboundRules) - populate(objectMap, "privateIPAddress", f.PrivateIPAddress) - populate(objectMap, "privateIPAddressVersion", f.PrivateIPAddressVersion) - populate(objectMap, "privateIPAllocationMethod", f.PrivateIPAllocationMethod) - populate(objectMap, "provisioningState", f.ProvisioningState) - populate(objectMap, "publicIPAddress", f.PublicIPAddress) - populate(objectMap, "publicIPPrefix", f.PublicIPPrefix) - populate(objectMap, "subnet", f.Subnet) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type FrontendIPConfigurationPropertiesFormat. -func (f *FrontendIPConfigurationPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "gatewayLoadBalancer": - err = unpopulate(val, "GatewayLoadBalancer", &f.GatewayLoadBalancer) - delete(rawMsg, key) - case "inboundNatPools": - err = unpopulate(val, "InboundNatPools", &f.InboundNatPools) - delete(rawMsg, key) - case "inboundNatRules": - err = unpopulate(val, "InboundNatRules", &f.InboundNatRules) - delete(rawMsg, key) - case "loadBalancingRules": - err = unpopulate(val, "LoadBalancingRules", &f.LoadBalancingRules) - delete(rawMsg, key) - case "outboundRules": - err = unpopulate(val, "OutboundRules", &f.OutboundRules) - delete(rawMsg, key) - case "privateIPAddress": - err = unpopulate(val, "PrivateIPAddress", &f.PrivateIPAddress) - delete(rawMsg, key) - case "privateIPAddressVersion": - err = unpopulate(val, "PrivateIPAddressVersion", &f.PrivateIPAddressVersion) - delete(rawMsg, key) - case "privateIPAllocationMethod": - err = unpopulate(val, "PrivateIPAllocationMethod", &f.PrivateIPAllocationMethod) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &f.ProvisioningState) - delete(rawMsg, key) - case "publicIPAddress": - err = unpopulate(val, "PublicIPAddress", &f.PublicIPAddress) - delete(rawMsg, key) - case "publicIPPrefix": - err = unpopulate(val, "PublicIPPrefix", &f.PublicIPPrefix) - delete(rawMsg, key) - case "subnet": - err = unpopulate(val, "Subnet", &f.Subnet) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GatewayCustomBgpIPAddressIPConfiguration. -func (g GatewayCustomBgpIPAddressIPConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "customBgpIpAddress", g.CustomBgpIPAddress) - populate(objectMap, "ipConfigurationId", g.IPConfigurationID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayCustomBgpIPAddressIPConfiguration. -func (g *GatewayCustomBgpIPAddressIPConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "customBgpIpAddress": - err = unpopulate(val, "CustomBgpIPAddress", &g.CustomBgpIPAddress) - delete(rawMsg, key) - case "ipConfigurationId": - err = unpopulate(val, "IPConfigurationID", &g.IPConfigurationID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GatewayLoadBalancerTunnelInterface. -func (g GatewayLoadBalancerTunnelInterface) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "identifier", g.Identifier) - populate(objectMap, "port", g.Port) - populate(objectMap, "protocol", g.Protocol) - populate(objectMap, "type", g.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayLoadBalancerTunnelInterface. -func (g *GatewayLoadBalancerTunnelInterface) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "identifier": - err = unpopulate(val, "Identifier", &g.Identifier) - delete(rawMsg, key) - case "port": - err = unpopulate(val, "Port", &g.Port) - delete(rawMsg, key) - case "protocol": - err = unpopulate(val, "Protocol", &g.Protocol) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &g.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GatewayRoute. -func (g GatewayRoute) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "asPath", g.AsPath) - populate(objectMap, "localAddress", g.LocalAddress) - populate(objectMap, "network", g.Network) - populate(objectMap, "nextHop", g.NextHop) - populate(objectMap, "origin", g.Origin) - populate(objectMap, "sourcePeer", g.SourcePeer) - populate(objectMap, "weight", g.Weight) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayRoute. -func (g *GatewayRoute) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "asPath": - err = unpopulate(val, "AsPath", &g.AsPath) - delete(rawMsg, key) - case "localAddress": - err = unpopulate(val, "LocalAddress", &g.LocalAddress) - delete(rawMsg, key) - case "network": - err = unpopulate(val, "Network", &g.Network) - delete(rawMsg, key) - case "nextHop": - err = unpopulate(val, "NextHop", &g.NextHop) - delete(rawMsg, key) - case "origin": - err = unpopulate(val, "Origin", &g.Origin) - delete(rawMsg, key) - case "sourcePeer": - err = unpopulate(val, "SourcePeer", &g.SourcePeer) - delete(rawMsg, key) - case "weight": - err = unpopulate(val, "Weight", &g.Weight) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GatewayRouteListResult. -func (g GatewayRouteListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "value", g.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayRouteListResult. -func (g *GatewayRouteListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "value": - err = unpopulate(val, "Value", &g.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GenerateExpressRoutePortsLOARequest. -func (g GenerateExpressRoutePortsLOARequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "customerName", g.CustomerName) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GenerateExpressRoutePortsLOARequest. -func (g *GenerateExpressRoutePortsLOARequest) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "customerName": - err = unpopulate(val, "CustomerName", &g.CustomerName) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GenerateExpressRoutePortsLOAResult. -func (g GenerateExpressRoutePortsLOAResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "encodedContent", g.EncodedContent) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GenerateExpressRoutePortsLOAResult. -func (g *GenerateExpressRoutePortsLOAResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "encodedContent": - err = unpopulate(val, "EncodedContent", &g.EncodedContent) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GetVPNSitesConfigurationRequest. -func (g GetVPNSitesConfigurationRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "outputBlobSasUrl", g.OutputBlobSasURL) - populate(objectMap, "vpnSites", g.VPNSites) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GetVPNSitesConfigurationRequest. -func (g *GetVPNSitesConfigurationRequest) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "outputBlobSasUrl": - err = unpopulate(val, "OutputBlobSasURL", &g.OutputBlobSasURL) - delete(rawMsg, key) - case "vpnSites": - err = unpopulate(val, "VPNSites", &g.VPNSites) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Group. -func (g Group) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", g.Etag) - populate(objectMap, "id", g.ID) - populate(objectMap, "name", g.Name) - populate(objectMap, "properties", g.Properties) - populate(objectMap, "systemData", g.SystemData) - populate(objectMap, "type", g.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Group. -func (g *Group) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &g.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &g.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &g.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &g.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &g.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &g.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GroupListResult. -func (g GroupListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", g.NextLink) - populate(objectMap, "value", g.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GroupListResult. -func (g *GroupListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &g.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &g.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GroupProperties. -func (g GroupProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "description", g.Description) - populate(objectMap, "provisioningState", g.ProvisioningState) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GroupProperties. -func (g *GroupProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "description": - err = unpopulate(val, "Description", &g.Description) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &g.ProvisioningState) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type HTTPConfiguration. -func (h HTTPConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "headers", h.Headers) - populate(objectMap, "method", h.Method) - populate(objectMap, "validStatusCodes", h.ValidStatusCodes) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type HTTPConfiguration. -func (h *HTTPConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "headers": - err = unpopulate(val, "Headers", &h.Headers) - delete(rawMsg, key) - case "method": - err = unpopulate(val, "Method", &h.Method) - delete(rawMsg, key) - case "validStatusCodes": - err = unpopulate(val, "ValidStatusCodes", &h.ValidStatusCodes) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type HTTPHeader. -func (h HTTPHeader) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "name", h.Name) - populate(objectMap, "value", h.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type HTTPHeader. -func (h *HTTPHeader) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &h.Name) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &h.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type HopLink. -func (h HopLink) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "context", h.Context) - populate(objectMap, "issues", h.Issues) - populate(objectMap, "linkType", h.LinkType) - populate(objectMap, "nextHopId", h.NextHopID) - populate(objectMap, "properties", h.Properties) - populate(objectMap, "resourceId", h.ResourceID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type HopLink. -func (h *HopLink) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "context": - err = unpopulate(val, "Context", &h.Context) - delete(rawMsg, key) - case "issues": - err = unpopulate(val, "Issues", &h.Issues) - delete(rawMsg, key) - case "linkType": - err = unpopulate(val, "LinkType", &h.LinkType) - delete(rawMsg, key) - case "nextHopId": - err = unpopulate(val, "NextHopID", &h.NextHopID) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &h.Properties) - delete(rawMsg, key) - case "resourceId": - err = unpopulate(val, "ResourceID", &h.ResourceID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type HopLinkProperties. -func (h HopLinkProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "roundTripTimeAvg", h.RoundTripTimeAvg) - populate(objectMap, "roundTripTimeMax", h.RoundTripTimeMax) - populate(objectMap, "roundTripTimeMin", h.RoundTripTimeMin) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type HopLinkProperties. -func (h *HopLinkProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "roundTripTimeAvg": - err = unpopulate(val, "RoundTripTimeAvg", &h.RoundTripTimeAvg) - delete(rawMsg, key) - case "roundTripTimeMax": - err = unpopulate(val, "RoundTripTimeMax", &h.RoundTripTimeMax) - delete(rawMsg, key) - case "roundTripTimeMin": - err = unpopulate(val, "RoundTripTimeMin", &h.RoundTripTimeMin) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Hub. -func (h Hub) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "resourceId", h.ResourceID) - populate(objectMap, "resourceType", h.ResourceType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Hub. -func (h *Hub) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "resourceId": - err = unpopulate(val, "ResourceID", &h.ResourceID) - delete(rawMsg, key) - case "resourceType": - err = unpopulate(val, "ResourceType", &h.ResourceType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type HubIPAddresses. -func (h HubIPAddresses) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "privateIPAddress", h.PrivateIPAddress) - populate(objectMap, "publicIPs", h.PublicIPs) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type HubIPAddresses. -func (h *HubIPAddresses) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "privateIPAddress": - err = unpopulate(val, "PrivateIPAddress", &h.PrivateIPAddress) - delete(rawMsg, key) - case "publicIPs": - err = unpopulate(val, "PublicIPs", &h.PublicIPs) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type HubIPConfiguration. -func (h HubIPConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", h.Etag) - populate(objectMap, "id", h.ID) - populate(objectMap, "name", h.Name) - populate(objectMap, "properties", h.Properties) - populate(objectMap, "type", h.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type HubIPConfiguration. -func (h *HubIPConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &h.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &h.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &h.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &h.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &h.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type HubIPConfigurationPropertiesFormat. -func (h HubIPConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "privateIPAddress", h.PrivateIPAddress) - populate(objectMap, "privateIPAllocationMethod", h.PrivateIPAllocationMethod) - populate(objectMap, "provisioningState", h.ProvisioningState) - populate(objectMap, "publicIPAddress", h.PublicIPAddress) - populate(objectMap, "subnet", h.Subnet) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type HubIPConfigurationPropertiesFormat. -func (h *HubIPConfigurationPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "privateIPAddress": - err = unpopulate(val, "PrivateIPAddress", &h.PrivateIPAddress) - delete(rawMsg, key) - case "privateIPAllocationMethod": - err = unpopulate(val, "PrivateIPAllocationMethod", &h.PrivateIPAllocationMethod) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &h.ProvisioningState) - delete(rawMsg, key) - case "publicIPAddress": - err = unpopulate(val, "PublicIPAddress", &h.PublicIPAddress) - delete(rawMsg, key) - case "subnet": - err = unpopulate(val, "Subnet", &h.Subnet) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type HubPublicIPAddresses. -func (h HubPublicIPAddresses) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "addresses", h.Addresses) - populate(objectMap, "count", h.Count) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type HubPublicIPAddresses. -func (h *HubPublicIPAddresses) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "addresses": - err = unpopulate(val, "Addresses", &h.Addresses) - delete(rawMsg, key) - case "count": - err = unpopulate(val, "Count", &h.Count) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type HubRoute. -func (h HubRoute) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "destinationType", h.DestinationType) - populate(objectMap, "destinations", h.Destinations) - populate(objectMap, "name", h.Name) - populate(objectMap, "nextHop", h.NextHop) - populate(objectMap, "nextHopType", h.NextHopType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type HubRoute. -func (h *HubRoute) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "destinationType": - err = unpopulate(val, "DestinationType", &h.DestinationType) - delete(rawMsg, key) - case "destinations": - err = unpopulate(val, "Destinations", &h.Destinations) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &h.Name) - delete(rawMsg, key) - case "nextHop": - err = unpopulate(val, "NextHop", &h.NextHop) - delete(rawMsg, key) - case "nextHopType": - err = unpopulate(val, "NextHopType", &h.NextHopType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type HubRouteTable. -func (h HubRouteTable) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", h.Etag) - populate(objectMap, "id", h.ID) - populate(objectMap, "name", h.Name) - populate(objectMap, "properties", h.Properties) - populate(objectMap, "type", h.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type HubRouteTable. -func (h *HubRouteTable) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &h.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &h.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &h.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &h.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &h.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type HubRouteTableProperties. -func (h HubRouteTableProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "associatedConnections", h.AssociatedConnections) - populate(objectMap, "labels", h.Labels) - populate(objectMap, "propagatingConnections", h.PropagatingConnections) - populate(objectMap, "provisioningState", h.ProvisioningState) - populate(objectMap, "routes", h.Routes) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type HubRouteTableProperties. -func (h *HubRouteTableProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "associatedConnections": - err = unpopulate(val, "AssociatedConnections", &h.AssociatedConnections) - delete(rawMsg, key) - case "labels": - err = unpopulate(val, "Labels", &h.Labels) - delete(rawMsg, key) - case "propagatingConnections": - err = unpopulate(val, "PropagatingConnections", &h.PropagatingConnections) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &h.ProvisioningState) - delete(rawMsg, key) - case "routes": - err = unpopulate(val, "Routes", &h.Routes) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type HubVirtualNetworkConnection. -func (h HubVirtualNetworkConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", h.Etag) - populate(objectMap, "id", h.ID) - populate(objectMap, "name", h.Name) - populate(objectMap, "properties", h.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type HubVirtualNetworkConnection. -func (h *HubVirtualNetworkConnection) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &h.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &h.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &h.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &h.Properties) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type HubVirtualNetworkConnectionProperties. -func (h HubVirtualNetworkConnectionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "allowHubToRemoteVnetTransit", h.AllowHubToRemoteVnetTransit) - populate(objectMap, "allowRemoteVnetToUseHubVnetGateways", h.AllowRemoteVnetToUseHubVnetGateways) - populate(objectMap, "enableInternetSecurity", h.EnableInternetSecurity) - populate(objectMap, "provisioningState", h.ProvisioningState) - populate(objectMap, "remoteVirtualNetwork", h.RemoteVirtualNetwork) - populate(objectMap, "routingConfiguration", h.RoutingConfiguration) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type HubVirtualNetworkConnectionProperties. -func (h *HubVirtualNetworkConnectionProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "allowHubToRemoteVnetTransit": - err = unpopulate(val, "AllowHubToRemoteVnetTransit", &h.AllowHubToRemoteVnetTransit) - delete(rawMsg, key) - case "allowRemoteVnetToUseHubVnetGateways": - err = unpopulate(val, "AllowRemoteVnetToUseHubVnetGateways", &h.AllowRemoteVnetToUseHubVnetGateways) - delete(rawMsg, key) - case "enableInternetSecurity": - err = unpopulate(val, "EnableInternetSecurity", &h.EnableInternetSecurity) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &h.ProvisioningState) - delete(rawMsg, key) - case "remoteVirtualNetwork": - err = unpopulate(val, "RemoteVirtualNetwork", &h.RemoteVirtualNetwork) - delete(rawMsg, key) - case "routingConfiguration": - err = unpopulate(val, "RoutingConfiguration", &h.RoutingConfiguration) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type IDPSQueryObject. -func (i IDPSQueryObject) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "filters", i.Filters) - populate(objectMap, "orderBy", i.OrderBy) - populate(objectMap, "resultsPerPage", i.ResultsPerPage) - populate(objectMap, "search", i.Search) - populate(objectMap, "skip", i.Skip) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type IDPSQueryObject. -func (i *IDPSQueryObject) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "filters": - err = unpopulate(val, "Filters", &i.Filters) - delete(rawMsg, key) - case "orderBy": - err = unpopulate(val, "OrderBy", &i.OrderBy) - delete(rawMsg, key) - case "resultsPerPage": - err = unpopulate(val, "ResultsPerPage", &i.ResultsPerPage) - delete(rawMsg, key) - case "search": - err = unpopulate(val, "Search", &i.Search) - delete(rawMsg, key) - case "skip": - err = unpopulate(val, "Skip", &i.Skip) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type IPAddressAvailabilityResult. -func (i IPAddressAvailabilityResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "available", i.Available) - populate(objectMap, "availableIPAddresses", i.AvailableIPAddresses) - populate(objectMap, "isPlatformReserved", i.IsPlatformReserved) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type IPAddressAvailabilityResult. -func (i *IPAddressAvailabilityResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "available": - err = unpopulate(val, "Available", &i.Available) - delete(rawMsg, key) - case "availableIPAddresses": - err = unpopulate(val, "AvailableIPAddresses", &i.AvailableIPAddresses) - delete(rawMsg, key) - case "isPlatformReserved": - err = unpopulate(val, "IsPlatformReserved", &i.IsPlatformReserved) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type IPAllocation. -func (i IPAllocation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", i.Etag) - populate(objectMap, "id", i.ID) - populate(objectMap, "location", i.Location) - populate(objectMap, "name", i.Name) - populate(objectMap, "properties", i.Properties) - populate(objectMap, "tags", i.Tags) - populate(objectMap, "type", i.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type IPAllocation. -func (i *IPAllocation) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &i.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &i.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &i.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &i.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &i.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &i.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &i.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type IPAllocationListResult. -func (i IPAllocationListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", i.NextLink) - populate(objectMap, "value", i.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type IPAllocationListResult. -func (i *IPAllocationListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &i.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &i.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type IPAllocationPropertiesFormat. -func (i IPAllocationPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "allocationTags", i.AllocationTags) - populate(objectMap, "ipamAllocationId", i.IpamAllocationID) - populate(objectMap, "prefix", i.Prefix) - populate(objectMap, "prefixLength", i.PrefixLength) - populate(objectMap, "prefixType", i.PrefixType) - populate(objectMap, "subnet", i.Subnet) - populate(objectMap, "type", i.Type) - populate(objectMap, "virtualNetwork", i.VirtualNetwork) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type IPAllocationPropertiesFormat. -func (i *IPAllocationPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "allocationTags": - err = unpopulate(val, "AllocationTags", &i.AllocationTags) - delete(rawMsg, key) - case "ipamAllocationId": - err = unpopulate(val, "IpamAllocationID", &i.IpamAllocationID) - delete(rawMsg, key) - case "prefix": - err = unpopulate(val, "Prefix", &i.Prefix) - delete(rawMsg, key) - case "prefixLength": - err = unpopulate(val, "PrefixLength", &i.PrefixLength) - delete(rawMsg, key) - case "prefixType": - err = unpopulate(val, "PrefixType", &i.PrefixType) - delete(rawMsg, key) - case "subnet": - err = unpopulate(val, "Subnet", &i.Subnet) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &i.Type) - delete(rawMsg, key) - case "virtualNetwork": - err = unpopulate(val, "VirtualNetwork", &i.VirtualNetwork) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type IPConfiguration. -func (i IPConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", i.Etag) - populate(objectMap, "id", i.ID) - populate(objectMap, "name", i.Name) - populate(objectMap, "properties", i.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type IPConfiguration. -func (i *IPConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &i.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &i.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &i.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &i.Properties) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type IPConfigurationBgpPeeringAddress. -func (i IPConfigurationBgpPeeringAddress) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "customBgpIpAddresses", i.CustomBgpIPAddresses) - populate(objectMap, "defaultBgpIpAddresses", i.DefaultBgpIPAddresses) - populate(objectMap, "ipconfigurationId", i.IPConfigurationID) - populate(objectMap, "tunnelIpAddresses", i.TunnelIPAddresses) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type IPConfigurationBgpPeeringAddress. -func (i *IPConfigurationBgpPeeringAddress) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "customBgpIpAddresses": - err = unpopulate(val, "CustomBgpIPAddresses", &i.CustomBgpIPAddresses) - delete(rawMsg, key) - case "defaultBgpIpAddresses": - err = unpopulate(val, "DefaultBgpIPAddresses", &i.DefaultBgpIPAddresses) - delete(rawMsg, key) - case "ipconfigurationId": - err = unpopulate(val, "IPConfigurationID", &i.IPConfigurationID) - delete(rawMsg, key) - case "tunnelIpAddresses": - err = unpopulate(val, "TunnelIPAddresses", &i.TunnelIPAddresses) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type IPConfigurationProfile. -func (i IPConfigurationProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", i.Etag) - populate(objectMap, "id", i.ID) - populate(objectMap, "name", i.Name) - populate(objectMap, "properties", i.Properties) - populate(objectMap, "type", i.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type IPConfigurationProfile. -func (i *IPConfigurationProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &i.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &i.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &i.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &i.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &i.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type IPConfigurationProfilePropertiesFormat. -func (i IPConfigurationProfilePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "provisioningState", i.ProvisioningState) - populate(objectMap, "subnet", i.Subnet) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type IPConfigurationProfilePropertiesFormat. -func (i *IPConfigurationProfilePropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &i.ProvisioningState) - delete(rawMsg, key) - case "subnet": - err = unpopulate(val, "Subnet", &i.Subnet) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type IPConfigurationPropertiesFormat. -func (i IPConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "privateIPAddress", i.PrivateIPAddress) - populate(objectMap, "privateIPAllocationMethod", i.PrivateIPAllocationMethod) - populate(objectMap, "provisioningState", i.ProvisioningState) - populate(objectMap, "publicIPAddress", i.PublicIPAddress) - populate(objectMap, "subnet", i.Subnet) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type IPConfigurationPropertiesFormat. -func (i *IPConfigurationPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "privateIPAddress": - err = unpopulate(val, "PrivateIPAddress", &i.PrivateIPAddress) - delete(rawMsg, key) - case "privateIPAllocationMethod": - err = unpopulate(val, "PrivateIPAllocationMethod", &i.PrivateIPAllocationMethod) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &i.ProvisioningState) - delete(rawMsg, key) - case "publicIPAddress": - err = unpopulate(val, "PublicIPAddress", &i.PublicIPAddress) - delete(rawMsg, key) - case "subnet": - err = unpopulate(val, "Subnet", &i.Subnet) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type IPGroup. -func (i IPGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", i.Etag) - populate(objectMap, "id", i.ID) - populate(objectMap, "location", i.Location) - populate(objectMap, "name", i.Name) - populate(objectMap, "properties", i.Properties) - populate(objectMap, "tags", i.Tags) - populate(objectMap, "type", i.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type IPGroup. -func (i *IPGroup) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &i.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &i.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &i.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &i.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &i.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &i.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &i.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type IPGroupListResult. -func (i IPGroupListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", i.NextLink) - populate(objectMap, "value", i.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type IPGroupListResult. -func (i *IPGroupListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &i.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &i.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type IPGroupPropertiesFormat. -func (i IPGroupPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "firewallPolicies", i.FirewallPolicies) - populate(objectMap, "firewalls", i.Firewalls) - populate(objectMap, "ipAddresses", i.IPAddresses) - populate(objectMap, "provisioningState", i.ProvisioningState) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type IPGroupPropertiesFormat. -func (i *IPGroupPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "firewallPolicies": - err = unpopulate(val, "FirewallPolicies", &i.FirewallPolicies) - delete(rawMsg, key) - case "firewalls": - err = unpopulate(val, "Firewalls", &i.Firewalls) - delete(rawMsg, key) - case "ipAddresses": - err = unpopulate(val, "IPAddresses", &i.IPAddresses) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &i.ProvisioningState) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type IPPrefixesList. -func (i IPPrefixesList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "ipPrefixes", i.IPPrefixes) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type IPPrefixesList. -func (i *IPPrefixesList) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "ipPrefixes": - err = unpopulate(val, "IPPrefixes", &i.IPPrefixes) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type IPSecPolicy. -func (i IPSecPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "dhGroup", i.DhGroup) - populate(objectMap, "ipsecEncryption", i.IPSecEncryption) - populate(objectMap, "ipsecIntegrity", i.IPSecIntegrity) - populate(objectMap, "ikeEncryption", i.IkeEncryption) - populate(objectMap, "ikeIntegrity", i.IkeIntegrity) - populate(objectMap, "pfsGroup", i.PfsGroup) - populate(objectMap, "saDataSizeKilobytes", i.SaDataSizeKilobytes) - populate(objectMap, "saLifeTimeSeconds", i.SaLifeTimeSeconds) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type IPSecPolicy. -func (i *IPSecPolicy) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "dhGroup": - err = unpopulate(val, "DhGroup", &i.DhGroup) - delete(rawMsg, key) - case "ipsecEncryption": - err = unpopulate(val, "IPSecEncryption", &i.IPSecEncryption) - delete(rawMsg, key) - case "ipsecIntegrity": - err = unpopulate(val, "IPSecIntegrity", &i.IPSecIntegrity) - delete(rawMsg, key) - case "ikeEncryption": - err = unpopulate(val, "IkeEncryption", &i.IkeEncryption) - delete(rawMsg, key) - case "ikeIntegrity": - err = unpopulate(val, "IkeIntegrity", &i.IkeIntegrity) - delete(rawMsg, key) - case "pfsGroup": - err = unpopulate(val, "PfsGroup", &i.PfsGroup) - delete(rawMsg, key) - case "saDataSizeKilobytes": - err = unpopulate(val, "SaDataSizeKilobytes", &i.SaDataSizeKilobytes) - delete(rawMsg, key) - case "saLifeTimeSeconds": - err = unpopulate(val, "SaLifeTimeSeconds", &i.SaLifeTimeSeconds) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type IPTag. -func (i IPTag) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "ipTagType", i.IPTagType) - populate(objectMap, "tag", i.Tag) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type IPTag. -func (i *IPTag) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "ipTagType": - err = unpopulate(val, "IPTagType", &i.IPTagType) - delete(rawMsg, key) - case "tag": - err = unpopulate(val, "Tag", &i.Tag) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type IPv6CircuitConnectionConfig. -func (i IPv6CircuitConnectionConfig) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "addressPrefix", i.AddressPrefix) - populate(objectMap, "circuitConnectionStatus", i.CircuitConnectionStatus) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type IPv6CircuitConnectionConfig. -func (i *IPv6CircuitConnectionConfig) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "addressPrefix": - err = unpopulate(val, "AddressPrefix", &i.AddressPrefix) - delete(rawMsg, key) - case "circuitConnectionStatus": - err = unpopulate(val, "CircuitConnectionStatus", &i.CircuitConnectionStatus) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type IPv6ExpressRouteCircuitPeeringConfig. -func (i IPv6ExpressRouteCircuitPeeringConfig) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "microsoftPeeringConfig", i.MicrosoftPeeringConfig) - populate(objectMap, "primaryPeerAddressPrefix", i.PrimaryPeerAddressPrefix) - populate(objectMap, "routeFilter", i.RouteFilter) - populate(objectMap, "secondaryPeerAddressPrefix", i.SecondaryPeerAddressPrefix) - populate(objectMap, "state", i.State) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type IPv6ExpressRouteCircuitPeeringConfig. -func (i *IPv6ExpressRouteCircuitPeeringConfig) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "microsoftPeeringConfig": - err = unpopulate(val, "MicrosoftPeeringConfig", &i.MicrosoftPeeringConfig) - delete(rawMsg, key) - case "primaryPeerAddressPrefix": - err = unpopulate(val, "PrimaryPeerAddressPrefix", &i.PrimaryPeerAddressPrefix) - delete(rawMsg, key) - case "routeFilter": - err = unpopulate(val, "RouteFilter", &i.RouteFilter) - delete(rawMsg, key) - case "secondaryPeerAddressPrefix": - err = unpopulate(val, "SecondaryPeerAddressPrefix", &i.SecondaryPeerAddressPrefix) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &i.State) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type InboundNatPool. -func (i InboundNatPool) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", i.Etag) - populate(objectMap, "id", i.ID) - populate(objectMap, "name", i.Name) - populate(objectMap, "properties", i.Properties) - populate(objectMap, "type", i.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type InboundNatPool. -func (i *InboundNatPool) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &i.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &i.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &i.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &i.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &i.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type InboundNatPoolPropertiesFormat. -func (i InboundNatPoolPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "backendPort", i.BackendPort) - populate(objectMap, "enableFloatingIP", i.EnableFloatingIP) - populate(objectMap, "enableTcpReset", i.EnableTCPReset) - populate(objectMap, "frontendIPConfiguration", i.FrontendIPConfiguration) - populate(objectMap, "frontendPortRangeEnd", i.FrontendPortRangeEnd) - populate(objectMap, "frontendPortRangeStart", i.FrontendPortRangeStart) - populate(objectMap, "idleTimeoutInMinutes", i.IdleTimeoutInMinutes) - populate(objectMap, "protocol", i.Protocol) - populate(objectMap, "provisioningState", i.ProvisioningState) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type InboundNatPoolPropertiesFormat. -func (i *InboundNatPoolPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "backendPort": - err = unpopulate(val, "BackendPort", &i.BackendPort) - delete(rawMsg, key) - case "enableFloatingIP": - err = unpopulate(val, "EnableFloatingIP", &i.EnableFloatingIP) - delete(rawMsg, key) - case "enableTcpReset": - err = unpopulate(val, "EnableTCPReset", &i.EnableTCPReset) - delete(rawMsg, key) - case "frontendIPConfiguration": - err = unpopulate(val, "FrontendIPConfiguration", &i.FrontendIPConfiguration) - delete(rawMsg, key) - case "frontendPortRangeEnd": - err = unpopulate(val, "FrontendPortRangeEnd", &i.FrontendPortRangeEnd) - delete(rawMsg, key) - case "frontendPortRangeStart": - err = unpopulate(val, "FrontendPortRangeStart", &i.FrontendPortRangeStart) - delete(rawMsg, key) - case "idleTimeoutInMinutes": - err = unpopulate(val, "IdleTimeoutInMinutes", &i.IdleTimeoutInMinutes) - delete(rawMsg, key) - case "protocol": - err = unpopulate(val, "Protocol", &i.Protocol) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &i.ProvisioningState) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type InboundNatRule. -func (i InboundNatRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", i.Etag) - populate(objectMap, "id", i.ID) - populate(objectMap, "name", i.Name) - populate(objectMap, "properties", i.Properties) - populate(objectMap, "type", i.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type InboundNatRule. -func (i *InboundNatRule) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &i.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &i.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &i.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &i.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &i.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type InboundNatRuleListResult. -func (i InboundNatRuleListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", i.NextLink) - populate(objectMap, "value", i.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type InboundNatRuleListResult. -func (i *InboundNatRuleListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &i.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &i.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type InboundNatRulePortMapping. -func (i InboundNatRulePortMapping) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "backendPort", i.BackendPort) - populate(objectMap, "frontendPort", i.FrontendPort) - populate(objectMap, "inboundNatRuleName", i.InboundNatRuleName) - populate(objectMap, "protocol", i.Protocol) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type InboundNatRulePortMapping. -func (i *InboundNatRulePortMapping) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "backendPort": - err = unpopulate(val, "BackendPort", &i.BackendPort) - delete(rawMsg, key) - case "frontendPort": - err = unpopulate(val, "FrontendPort", &i.FrontendPort) - delete(rawMsg, key) - case "inboundNatRuleName": - err = unpopulate(val, "InboundNatRuleName", &i.InboundNatRuleName) - delete(rawMsg, key) - case "protocol": - err = unpopulate(val, "Protocol", &i.Protocol) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type InboundNatRulePropertiesFormat. -func (i InboundNatRulePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "backendAddressPool", i.BackendAddressPool) - populate(objectMap, "backendIPConfiguration", i.BackendIPConfiguration) - populate(objectMap, "backendPort", i.BackendPort) - populate(objectMap, "enableFloatingIP", i.EnableFloatingIP) - populate(objectMap, "enableTcpReset", i.EnableTCPReset) - populate(objectMap, "frontendIPConfiguration", i.FrontendIPConfiguration) - populate(objectMap, "frontendPort", i.FrontendPort) - populate(objectMap, "frontendPortRangeEnd", i.FrontendPortRangeEnd) - populate(objectMap, "frontendPortRangeStart", i.FrontendPortRangeStart) - populate(objectMap, "idleTimeoutInMinutes", i.IdleTimeoutInMinutes) - populate(objectMap, "protocol", i.Protocol) - populate(objectMap, "provisioningState", i.ProvisioningState) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type InboundNatRulePropertiesFormat. -func (i *InboundNatRulePropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "backendAddressPool": - err = unpopulate(val, "BackendAddressPool", &i.BackendAddressPool) - delete(rawMsg, key) - case "backendIPConfiguration": - err = unpopulate(val, "BackendIPConfiguration", &i.BackendIPConfiguration) - delete(rawMsg, key) - case "backendPort": - err = unpopulate(val, "BackendPort", &i.BackendPort) - delete(rawMsg, key) - case "enableFloatingIP": - err = unpopulate(val, "EnableFloatingIP", &i.EnableFloatingIP) - delete(rawMsg, key) - case "enableTcpReset": - err = unpopulate(val, "EnableTCPReset", &i.EnableTCPReset) - delete(rawMsg, key) - case "frontendIPConfiguration": - err = unpopulate(val, "FrontendIPConfiguration", &i.FrontendIPConfiguration) - delete(rawMsg, key) - case "frontendPort": - err = unpopulate(val, "FrontendPort", &i.FrontendPort) - delete(rawMsg, key) - case "frontendPortRangeEnd": - err = unpopulate(val, "FrontendPortRangeEnd", &i.FrontendPortRangeEnd) - delete(rawMsg, key) - case "frontendPortRangeStart": - err = unpopulate(val, "FrontendPortRangeStart", &i.FrontendPortRangeStart) - delete(rawMsg, key) - case "idleTimeoutInMinutes": - err = unpopulate(val, "IdleTimeoutInMinutes", &i.IdleTimeoutInMinutes) - delete(rawMsg, key) - case "protocol": - err = unpopulate(val, "Protocol", &i.Protocol) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &i.ProvisioningState) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type InboundSecurityRule. -func (i InboundSecurityRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", i.Etag) - populate(objectMap, "id", i.ID) - populate(objectMap, "name", i.Name) - populate(objectMap, "properties", i.Properties) - populate(objectMap, "type", i.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type InboundSecurityRule. -func (i *InboundSecurityRule) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &i.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &i.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &i.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &i.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &i.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type InboundSecurityRuleProperties. -func (i InboundSecurityRuleProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "provisioningState", i.ProvisioningState) - populate(objectMap, "rules", i.Rules) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type InboundSecurityRuleProperties. -func (i *InboundSecurityRuleProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &i.ProvisioningState) - delete(rawMsg, key) - case "rules": - err = unpopulate(val, "Rules", &i.Rules) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type InboundSecurityRules. -func (i InboundSecurityRules) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "destinationPortRange", i.DestinationPortRange) - populate(objectMap, "protocol", i.Protocol) - populate(objectMap, "sourceAddressPrefix", i.SourceAddressPrefix) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type InboundSecurityRules. -func (i *InboundSecurityRules) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "destinationPortRange": - err = unpopulate(val, "DestinationPortRange", &i.DestinationPortRange) - delete(rawMsg, key) - case "protocol": - err = unpopulate(val, "Protocol", &i.Protocol) - delete(rawMsg, key) - case "sourceAddressPrefix": - err = unpopulate(val, "SourceAddressPrefix", &i.SourceAddressPrefix) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type IntentPolicy. -func (i IntentPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", i.Etag) - populate(objectMap, "id", i.ID) - populate(objectMap, "location", i.Location) - populate(objectMap, "name", i.Name) - populate(objectMap, "tags", i.Tags) - populate(objectMap, "type", i.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type IntentPolicy. -func (i *IntentPolicy) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &i.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &i.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &i.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &i.Name) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &i.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &i.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type IntentPolicyConfiguration. -func (i IntentPolicyConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "networkIntentPolicyName", i.NetworkIntentPolicyName) - populate(objectMap, "sourceNetworkIntentPolicy", i.SourceNetworkIntentPolicy) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type IntentPolicyConfiguration. -func (i *IntentPolicyConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "networkIntentPolicyName": - err = unpopulate(val, "NetworkIntentPolicyName", &i.NetworkIntentPolicyName) - delete(rawMsg, key) - case "sourceNetworkIntentPolicy": - err = unpopulate(val, "SourceNetworkIntentPolicy", &i.SourceNetworkIntentPolicy) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Interface. -func (i Interface) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", i.Etag) - populate(objectMap, "extendedLocation", i.ExtendedLocation) - populate(objectMap, "id", i.ID) - populate(objectMap, "location", i.Location) - populate(objectMap, "name", i.Name) - populate(objectMap, "properties", i.Properties) - populate(objectMap, "tags", i.Tags) - populate(objectMap, "type", i.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Interface. -func (i *Interface) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &i.Etag) - delete(rawMsg, key) - case "extendedLocation": - err = unpopulate(val, "ExtendedLocation", &i.ExtendedLocation) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &i.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &i.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &i.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &i.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &i.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &i.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type InterfaceAssociation. -func (i InterfaceAssociation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", i.ID) - populate(objectMap, "securityRules", i.SecurityRules) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type InterfaceAssociation. -func (i *InterfaceAssociation) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &i.ID) - delete(rawMsg, key) - case "securityRules": - err = unpopulate(val, "SecurityRules", &i.SecurityRules) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type InterfaceDNSSettings. -func (i InterfaceDNSSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "appliedDnsServers", i.AppliedDNSServers) - populate(objectMap, "dnsServers", i.DNSServers) - populate(objectMap, "internalDnsNameLabel", i.InternalDNSNameLabel) - populate(objectMap, "internalDomainNameSuffix", i.InternalDomainNameSuffix) - populate(objectMap, "internalFqdn", i.InternalFqdn) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type InterfaceDNSSettings. -func (i *InterfaceDNSSettings) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "appliedDnsServers": - err = unpopulate(val, "AppliedDNSServers", &i.AppliedDNSServers) - delete(rawMsg, key) - case "dnsServers": - err = unpopulate(val, "DNSServers", &i.DNSServers) - delete(rawMsg, key) - case "internalDnsNameLabel": - err = unpopulate(val, "InternalDNSNameLabel", &i.InternalDNSNameLabel) - delete(rawMsg, key) - case "internalDomainNameSuffix": - err = unpopulate(val, "InternalDomainNameSuffix", &i.InternalDomainNameSuffix) - delete(rawMsg, key) - case "internalFqdn": - err = unpopulate(val, "InternalFqdn", &i.InternalFqdn) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type InterfaceIPConfiguration. -func (i InterfaceIPConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", i.Etag) - populate(objectMap, "id", i.ID) - populate(objectMap, "name", i.Name) - populate(objectMap, "properties", i.Properties) - populate(objectMap, "type", i.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type InterfaceIPConfiguration. -func (i *InterfaceIPConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &i.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &i.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &i.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &i.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &i.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type InterfaceIPConfigurationListResult. -func (i InterfaceIPConfigurationListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", i.NextLink) - populate(objectMap, "value", i.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type InterfaceIPConfigurationListResult. -func (i *InterfaceIPConfigurationListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &i.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &i.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type InterfaceIPConfigurationPrivateLinkConnectionProperties. -func (i InterfaceIPConfigurationPrivateLinkConnectionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "fqdns", i.Fqdns) - populate(objectMap, "groupId", i.GroupID) - populate(objectMap, "requiredMemberName", i.RequiredMemberName) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type InterfaceIPConfigurationPrivateLinkConnectionProperties. -func (i *InterfaceIPConfigurationPrivateLinkConnectionProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "fqdns": - err = unpopulate(val, "Fqdns", &i.Fqdns) - delete(rawMsg, key) - case "groupId": - err = unpopulate(val, "GroupID", &i.GroupID) - delete(rawMsg, key) - case "requiredMemberName": - err = unpopulate(val, "RequiredMemberName", &i.RequiredMemberName) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type InterfaceIPConfigurationPropertiesFormat. -func (i InterfaceIPConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "applicationGatewayBackendAddressPools", i.ApplicationGatewayBackendAddressPools) - populate(objectMap, "applicationSecurityGroups", i.ApplicationSecurityGroups) - populate(objectMap, "gatewayLoadBalancer", i.GatewayLoadBalancer) - populate(objectMap, "loadBalancerBackendAddressPools", i.LoadBalancerBackendAddressPools) - populate(objectMap, "loadBalancerInboundNatRules", i.LoadBalancerInboundNatRules) - populate(objectMap, "primary", i.Primary) - populate(objectMap, "privateIPAddress", i.PrivateIPAddress) - populate(objectMap, "privateIPAddressVersion", i.PrivateIPAddressVersion) - populate(objectMap, "privateIPAllocationMethod", i.PrivateIPAllocationMethod) - populate(objectMap, "privateLinkConnectionProperties", i.PrivateLinkConnectionProperties) - populate(objectMap, "provisioningState", i.ProvisioningState) - populate(objectMap, "publicIPAddress", i.PublicIPAddress) - populate(objectMap, "subnet", i.Subnet) - populate(objectMap, "virtualNetworkTaps", i.VirtualNetworkTaps) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type InterfaceIPConfigurationPropertiesFormat. -func (i *InterfaceIPConfigurationPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "applicationGatewayBackendAddressPools": - err = unpopulate(val, "ApplicationGatewayBackendAddressPools", &i.ApplicationGatewayBackendAddressPools) - delete(rawMsg, key) - case "applicationSecurityGroups": - err = unpopulate(val, "ApplicationSecurityGroups", &i.ApplicationSecurityGroups) - delete(rawMsg, key) - case "gatewayLoadBalancer": - err = unpopulate(val, "GatewayLoadBalancer", &i.GatewayLoadBalancer) - delete(rawMsg, key) - case "loadBalancerBackendAddressPools": - err = unpopulate(val, "LoadBalancerBackendAddressPools", &i.LoadBalancerBackendAddressPools) - delete(rawMsg, key) - case "loadBalancerInboundNatRules": - err = unpopulate(val, "LoadBalancerInboundNatRules", &i.LoadBalancerInboundNatRules) - delete(rawMsg, key) - case "primary": - err = unpopulate(val, "Primary", &i.Primary) - delete(rawMsg, key) - case "privateIPAddress": - err = unpopulate(val, "PrivateIPAddress", &i.PrivateIPAddress) - delete(rawMsg, key) - case "privateIPAddressVersion": - err = unpopulate(val, "PrivateIPAddressVersion", &i.PrivateIPAddressVersion) - delete(rawMsg, key) - case "privateIPAllocationMethod": - err = unpopulate(val, "PrivateIPAllocationMethod", &i.PrivateIPAllocationMethod) - delete(rawMsg, key) - case "privateLinkConnectionProperties": - err = unpopulate(val, "PrivateLinkConnectionProperties", &i.PrivateLinkConnectionProperties) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &i.ProvisioningState) - delete(rawMsg, key) - case "publicIPAddress": - err = unpopulate(val, "PublicIPAddress", &i.PublicIPAddress) - delete(rawMsg, key) - case "subnet": - err = unpopulate(val, "Subnet", &i.Subnet) - delete(rawMsg, key) - case "virtualNetworkTaps": - err = unpopulate(val, "VirtualNetworkTaps", &i.VirtualNetworkTaps) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type InterfaceListResult. -func (i InterfaceListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", i.NextLink) - populate(objectMap, "value", i.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type InterfaceListResult. -func (i *InterfaceListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &i.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &i.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type InterfaceLoadBalancerListResult. -func (i InterfaceLoadBalancerListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", i.NextLink) - populate(objectMap, "value", i.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type InterfaceLoadBalancerListResult. -func (i *InterfaceLoadBalancerListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &i.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &i.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type InterfacePropertiesFormat. -func (i InterfacePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "auxiliaryMode", i.AuxiliaryMode) - populate(objectMap, "dnsSettings", i.DNSSettings) - populate(objectMap, "dscpConfiguration", i.DscpConfiguration) - populate(objectMap, "enableAcceleratedNetworking", i.EnableAcceleratedNetworking) - populate(objectMap, "enableIPForwarding", i.EnableIPForwarding) - populate(objectMap, "hostedWorkloads", i.HostedWorkloads) - populate(objectMap, "ipConfigurations", i.IPConfigurations) - populate(objectMap, "macAddress", i.MacAddress) - populate(objectMap, "migrationPhase", i.MigrationPhase) - populate(objectMap, "networkSecurityGroup", i.NetworkSecurityGroup) - populate(objectMap, "nicType", i.NicType) - populate(objectMap, "primary", i.Primary) - populate(objectMap, "privateEndpoint", i.PrivateEndpoint) - populate(objectMap, "privateLinkService", i.PrivateLinkService) - populate(objectMap, "provisioningState", i.ProvisioningState) - populate(objectMap, "resourceGuid", i.ResourceGUID) - populate(objectMap, "tapConfigurations", i.TapConfigurations) - populate(objectMap, "virtualMachine", i.VirtualMachine) - populate(objectMap, "vnetEncryptionSupported", i.VnetEncryptionSupported) - populate(objectMap, "workloadType", i.WorkloadType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type InterfacePropertiesFormat. -func (i *InterfacePropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "auxiliaryMode": - err = unpopulate(val, "AuxiliaryMode", &i.AuxiliaryMode) - delete(rawMsg, key) - case "dnsSettings": - err = unpopulate(val, "DNSSettings", &i.DNSSettings) - delete(rawMsg, key) - case "dscpConfiguration": - err = unpopulate(val, "DscpConfiguration", &i.DscpConfiguration) - delete(rawMsg, key) - case "enableAcceleratedNetworking": - err = unpopulate(val, "EnableAcceleratedNetworking", &i.EnableAcceleratedNetworking) - delete(rawMsg, key) - case "enableIPForwarding": - err = unpopulate(val, "EnableIPForwarding", &i.EnableIPForwarding) - delete(rawMsg, key) - case "hostedWorkloads": - err = unpopulate(val, "HostedWorkloads", &i.HostedWorkloads) - delete(rawMsg, key) - case "ipConfigurations": - err = unpopulate(val, "IPConfigurations", &i.IPConfigurations) - delete(rawMsg, key) - case "macAddress": - err = unpopulate(val, "MacAddress", &i.MacAddress) - delete(rawMsg, key) - case "migrationPhase": - err = unpopulate(val, "MigrationPhase", &i.MigrationPhase) - delete(rawMsg, key) - case "networkSecurityGroup": - err = unpopulate(val, "NetworkSecurityGroup", &i.NetworkSecurityGroup) - delete(rawMsg, key) - case "nicType": - err = unpopulate(val, "NicType", &i.NicType) - delete(rawMsg, key) - case "primary": - err = unpopulate(val, "Primary", &i.Primary) - delete(rawMsg, key) - case "privateEndpoint": - err = unpopulate(val, "PrivateEndpoint", &i.PrivateEndpoint) - delete(rawMsg, key) - case "privateLinkService": - err = unpopulate(val, "PrivateLinkService", &i.PrivateLinkService) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &i.ProvisioningState) - delete(rawMsg, key) - case "resourceGuid": - err = unpopulate(val, "ResourceGUID", &i.ResourceGUID) - delete(rawMsg, key) - case "tapConfigurations": - err = unpopulate(val, "TapConfigurations", &i.TapConfigurations) - delete(rawMsg, key) - case "virtualMachine": - err = unpopulate(val, "VirtualMachine", &i.VirtualMachine) - delete(rawMsg, key) - case "vnetEncryptionSupported": - err = unpopulate(val, "VnetEncryptionSupported", &i.VnetEncryptionSupported) - delete(rawMsg, key) - case "workloadType": - err = unpopulate(val, "WorkloadType", &i.WorkloadType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type InterfaceTapConfiguration. -func (i InterfaceTapConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", i.Etag) - populate(objectMap, "id", i.ID) - populate(objectMap, "name", i.Name) - populate(objectMap, "properties", i.Properties) - populate(objectMap, "type", i.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type InterfaceTapConfiguration. -func (i *InterfaceTapConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &i.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &i.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &i.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &i.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &i.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type InterfaceTapConfigurationListResult. -func (i InterfaceTapConfigurationListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", i.NextLink) - populate(objectMap, "value", i.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type InterfaceTapConfigurationListResult. -func (i *InterfaceTapConfigurationListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &i.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &i.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type InterfaceTapConfigurationPropertiesFormat. -func (i InterfaceTapConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "provisioningState", i.ProvisioningState) - populate(objectMap, "virtualNetworkTap", i.VirtualNetworkTap) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type InterfaceTapConfigurationPropertiesFormat. -func (i *InterfaceTapConfigurationPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &i.ProvisioningState) - delete(rawMsg, key) - case "virtualNetworkTap": - err = unpopulate(val, "VirtualNetworkTap", &i.VirtualNetworkTap) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ListHubRouteTablesResult. -func (l ListHubRouteTablesResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", l.NextLink) - populate(objectMap, "value", l.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ListHubRouteTablesResult. -func (l *ListHubRouteTablesResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &l.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &l.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ListHubVirtualNetworkConnectionsResult. -func (l ListHubVirtualNetworkConnectionsResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", l.NextLink) - populate(objectMap, "value", l.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ListHubVirtualNetworkConnectionsResult. -func (l *ListHubVirtualNetworkConnectionsResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &l.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &l.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ListP2SVPNGatewaysResult. -func (l ListP2SVPNGatewaysResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", l.NextLink) - populate(objectMap, "value", l.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ListP2SVPNGatewaysResult. -func (l *ListP2SVPNGatewaysResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &l.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &l.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ListRoutingIntentResult. -func (l ListRoutingIntentResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", l.NextLink) - populate(objectMap, "value", l.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ListRoutingIntentResult. -func (l *ListRoutingIntentResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &l.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &l.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ListVPNConnectionsResult. -func (l ListVPNConnectionsResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", l.NextLink) - populate(objectMap, "value", l.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ListVPNConnectionsResult. -func (l *ListVPNConnectionsResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &l.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &l.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ListVPNGatewayNatRulesResult. -func (l ListVPNGatewayNatRulesResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", l.NextLink) - populate(objectMap, "value", l.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ListVPNGatewayNatRulesResult. -func (l *ListVPNGatewayNatRulesResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &l.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &l.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ListVPNGatewaysResult. -func (l ListVPNGatewaysResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", l.NextLink) - populate(objectMap, "value", l.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ListVPNGatewaysResult. -func (l *ListVPNGatewaysResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &l.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &l.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ListVPNServerConfigurationPolicyGroupsResult. -func (l ListVPNServerConfigurationPolicyGroupsResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", l.NextLink) - populate(objectMap, "value", l.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ListVPNServerConfigurationPolicyGroupsResult. -func (l *ListVPNServerConfigurationPolicyGroupsResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &l.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &l.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ListVPNServerConfigurationsResult. -func (l ListVPNServerConfigurationsResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", l.NextLink) - populate(objectMap, "value", l.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ListVPNServerConfigurationsResult. -func (l *ListVPNServerConfigurationsResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &l.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &l.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ListVPNSiteLinkConnectionsResult. -func (l ListVPNSiteLinkConnectionsResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", l.NextLink) - populate(objectMap, "value", l.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ListVPNSiteLinkConnectionsResult. -func (l *ListVPNSiteLinkConnectionsResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &l.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &l.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ListVPNSiteLinksResult. -func (l ListVPNSiteLinksResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", l.NextLink) - populate(objectMap, "value", l.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ListVPNSiteLinksResult. -func (l *ListVPNSiteLinksResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &l.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &l.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ListVPNSitesResult. -func (l ListVPNSitesResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", l.NextLink) - populate(objectMap, "value", l.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ListVPNSitesResult. -func (l *ListVPNSitesResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &l.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &l.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ListVirtualHubBgpConnectionResults. -func (l ListVirtualHubBgpConnectionResults) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", l.NextLink) - populate(objectMap, "value", l.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ListVirtualHubBgpConnectionResults. -func (l *ListVirtualHubBgpConnectionResults) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &l.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &l.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ListVirtualHubIPConfigurationResults. -func (l ListVirtualHubIPConfigurationResults) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", l.NextLink) - populate(objectMap, "value", l.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ListVirtualHubIPConfigurationResults. -func (l *ListVirtualHubIPConfigurationResults) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &l.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &l.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ListVirtualHubRouteTableV2SResult. -func (l ListVirtualHubRouteTableV2SResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", l.NextLink) - populate(objectMap, "value", l.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ListVirtualHubRouteTableV2SResult. -func (l *ListVirtualHubRouteTableV2SResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &l.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &l.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ListVirtualHubsResult. -func (l ListVirtualHubsResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", l.NextLink) - populate(objectMap, "value", l.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ListVirtualHubsResult. -func (l *ListVirtualHubsResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &l.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &l.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ListVirtualNetworkGatewayNatRulesResult. -func (l ListVirtualNetworkGatewayNatRulesResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", l.NextLink) - populate(objectMap, "value", l.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ListVirtualNetworkGatewayNatRulesResult. -func (l *ListVirtualNetworkGatewayNatRulesResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &l.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &l.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ListVirtualWANsResult. -func (l ListVirtualWANsResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", l.NextLink) - populate(objectMap, "value", l.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ListVirtualWANsResult. -func (l *ListVirtualWANsResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &l.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &l.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type LoadBalancer. -func (l LoadBalancer) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", l.Etag) - populate(objectMap, "extendedLocation", l.ExtendedLocation) - populate(objectMap, "id", l.ID) - populate(objectMap, "location", l.Location) - populate(objectMap, "name", l.Name) - populate(objectMap, "properties", l.Properties) - populate(objectMap, "sku", l.SKU) - populate(objectMap, "tags", l.Tags) - populate(objectMap, "type", l.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LoadBalancer. -func (l *LoadBalancer) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &l.Etag) - delete(rawMsg, key) - case "extendedLocation": - err = unpopulate(val, "ExtendedLocation", &l.ExtendedLocation) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &l.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &l.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &l.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &l.Properties) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &l.SKU) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &l.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &l.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type LoadBalancerBackendAddress. -func (l LoadBalancerBackendAddress) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "name", l.Name) - populate(objectMap, "properties", l.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LoadBalancerBackendAddress. -func (l *LoadBalancerBackendAddress) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &l.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &l.Properties) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type LoadBalancerBackendAddressPoolListResult. -func (l LoadBalancerBackendAddressPoolListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", l.NextLink) - populate(objectMap, "value", l.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LoadBalancerBackendAddressPoolListResult. -func (l *LoadBalancerBackendAddressPoolListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &l.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &l.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type LoadBalancerBackendAddressPropertiesFormat. -func (l LoadBalancerBackendAddressPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "adminState", l.AdminState) - populate(objectMap, "ipAddress", l.IPAddress) - populate(objectMap, "inboundNatRulesPortMapping", l.InboundNatRulesPortMapping) - populate(objectMap, "loadBalancerFrontendIPConfiguration", l.LoadBalancerFrontendIPConfiguration) - populate(objectMap, "networkInterfaceIPConfiguration", l.NetworkInterfaceIPConfiguration) - populate(objectMap, "subnet", l.Subnet) - populate(objectMap, "virtualNetwork", l.VirtualNetwork) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LoadBalancerBackendAddressPropertiesFormat. -func (l *LoadBalancerBackendAddressPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "adminState": - err = unpopulate(val, "AdminState", &l.AdminState) - delete(rawMsg, key) - case "ipAddress": - err = unpopulate(val, "IPAddress", &l.IPAddress) - delete(rawMsg, key) - case "inboundNatRulesPortMapping": - err = unpopulate(val, "InboundNatRulesPortMapping", &l.InboundNatRulesPortMapping) - delete(rawMsg, key) - case "loadBalancerFrontendIPConfiguration": - err = unpopulate(val, "LoadBalancerFrontendIPConfiguration", &l.LoadBalancerFrontendIPConfiguration) - delete(rawMsg, key) - case "networkInterfaceIPConfiguration": - err = unpopulate(val, "NetworkInterfaceIPConfiguration", &l.NetworkInterfaceIPConfiguration) - delete(rawMsg, key) - case "subnet": - err = unpopulate(val, "Subnet", &l.Subnet) - delete(rawMsg, key) - case "virtualNetwork": - err = unpopulate(val, "VirtualNetwork", &l.VirtualNetwork) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type LoadBalancerFrontendIPConfigurationListResult. -func (l LoadBalancerFrontendIPConfigurationListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", l.NextLink) - populate(objectMap, "value", l.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LoadBalancerFrontendIPConfigurationListResult. -func (l *LoadBalancerFrontendIPConfigurationListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &l.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &l.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type LoadBalancerListResult. -func (l LoadBalancerListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", l.NextLink) - populate(objectMap, "value", l.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LoadBalancerListResult. -func (l *LoadBalancerListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &l.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &l.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type LoadBalancerLoadBalancingRuleListResult. -func (l LoadBalancerLoadBalancingRuleListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", l.NextLink) - populate(objectMap, "value", l.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LoadBalancerLoadBalancingRuleListResult. -func (l *LoadBalancerLoadBalancingRuleListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &l.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &l.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type LoadBalancerOutboundRuleListResult. -func (l LoadBalancerOutboundRuleListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", l.NextLink) - populate(objectMap, "value", l.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LoadBalancerOutboundRuleListResult. -func (l *LoadBalancerOutboundRuleListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &l.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &l.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type LoadBalancerProbeListResult. -func (l LoadBalancerProbeListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", l.NextLink) - populate(objectMap, "value", l.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LoadBalancerProbeListResult. -func (l *LoadBalancerProbeListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &l.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &l.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type LoadBalancerPropertiesFormat. -func (l LoadBalancerPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "backendAddressPools", l.BackendAddressPools) - populate(objectMap, "frontendIPConfigurations", l.FrontendIPConfigurations) - populate(objectMap, "inboundNatPools", l.InboundNatPools) - populate(objectMap, "inboundNatRules", l.InboundNatRules) - populate(objectMap, "loadBalancingRules", l.LoadBalancingRules) - populate(objectMap, "outboundRules", l.OutboundRules) - populate(objectMap, "probes", l.Probes) - populate(objectMap, "provisioningState", l.ProvisioningState) - populate(objectMap, "resourceGuid", l.ResourceGUID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LoadBalancerPropertiesFormat. -func (l *LoadBalancerPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "backendAddressPools": - err = unpopulate(val, "BackendAddressPools", &l.BackendAddressPools) - delete(rawMsg, key) - case "frontendIPConfigurations": - err = unpopulate(val, "FrontendIPConfigurations", &l.FrontendIPConfigurations) - delete(rawMsg, key) - case "inboundNatPools": - err = unpopulate(val, "InboundNatPools", &l.InboundNatPools) - delete(rawMsg, key) - case "inboundNatRules": - err = unpopulate(val, "InboundNatRules", &l.InboundNatRules) - delete(rawMsg, key) - case "loadBalancingRules": - err = unpopulate(val, "LoadBalancingRules", &l.LoadBalancingRules) - delete(rawMsg, key) - case "outboundRules": - err = unpopulate(val, "OutboundRules", &l.OutboundRules) - delete(rawMsg, key) - case "probes": - err = unpopulate(val, "Probes", &l.Probes) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &l.ProvisioningState) - delete(rawMsg, key) - case "resourceGuid": - err = unpopulate(val, "ResourceGUID", &l.ResourceGUID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type LoadBalancerSKU. -func (l LoadBalancerSKU) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "name", l.Name) - populate(objectMap, "tier", l.Tier) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LoadBalancerSKU. -func (l *LoadBalancerSKU) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &l.Name) - delete(rawMsg, key) - case "tier": - err = unpopulate(val, "Tier", &l.Tier) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type LoadBalancerVipSwapRequest. -func (l LoadBalancerVipSwapRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "frontendIPConfigurations", l.FrontendIPConfigurations) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LoadBalancerVipSwapRequest. -func (l *LoadBalancerVipSwapRequest) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "frontendIPConfigurations": - err = unpopulate(val, "FrontendIPConfigurations", &l.FrontendIPConfigurations) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type LoadBalancerVipSwapRequestFrontendIPConfiguration. -func (l LoadBalancerVipSwapRequestFrontendIPConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", l.ID) - populate(objectMap, "properties", l.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LoadBalancerVipSwapRequestFrontendIPConfiguration. -func (l *LoadBalancerVipSwapRequestFrontendIPConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &l.ID) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &l.Properties) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type LoadBalancerVipSwapRequestFrontendIPConfigurationProperties. -func (l LoadBalancerVipSwapRequestFrontendIPConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "publicIPAddress", l.PublicIPAddress) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LoadBalancerVipSwapRequestFrontendIPConfigurationProperties. -func (l *LoadBalancerVipSwapRequestFrontendIPConfigurationProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "publicIPAddress": - err = unpopulate(val, "PublicIPAddress", &l.PublicIPAddress) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type LoadBalancingRule. -func (l LoadBalancingRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", l.Etag) - populate(objectMap, "id", l.ID) - populate(objectMap, "name", l.Name) - populate(objectMap, "properties", l.Properties) - populate(objectMap, "type", l.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LoadBalancingRule. -func (l *LoadBalancingRule) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &l.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &l.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &l.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &l.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &l.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type LoadBalancingRulePropertiesFormat. -func (l LoadBalancingRulePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "backendAddressPool", l.BackendAddressPool) - populate(objectMap, "backendAddressPools", l.BackendAddressPools) - populate(objectMap, "backendPort", l.BackendPort) - populate(objectMap, "disableOutboundSnat", l.DisableOutboundSnat) - populate(objectMap, "enableFloatingIP", l.EnableFloatingIP) - populate(objectMap, "enableTcpReset", l.EnableTCPReset) - populate(objectMap, "frontendIPConfiguration", l.FrontendIPConfiguration) - populate(objectMap, "frontendPort", l.FrontendPort) - populate(objectMap, "idleTimeoutInMinutes", l.IdleTimeoutInMinutes) - populate(objectMap, "loadDistribution", l.LoadDistribution) - populate(objectMap, "probe", l.Probe) - populate(objectMap, "protocol", l.Protocol) - populate(objectMap, "provisioningState", l.ProvisioningState) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LoadBalancingRulePropertiesFormat. -func (l *LoadBalancingRulePropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "backendAddressPool": - err = unpopulate(val, "BackendAddressPool", &l.BackendAddressPool) - delete(rawMsg, key) - case "backendAddressPools": - err = unpopulate(val, "BackendAddressPools", &l.BackendAddressPools) - delete(rawMsg, key) - case "backendPort": - err = unpopulate(val, "BackendPort", &l.BackendPort) - delete(rawMsg, key) - case "disableOutboundSnat": - err = unpopulate(val, "DisableOutboundSnat", &l.DisableOutboundSnat) - delete(rawMsg, key) - case "enableFloatingIP": - err = unpopulate(val, "EnableFloatingIP", &l.EnableFloatingIP) - delete(rawMsg, key) - case "enableTcpReset": - err = unpopulate(val, "EnableTCPReset", &l.EnableTCPReset) - delete(rawMsg, key) - case "frontendIPConfiguration": - err = unpopulate(val, "FrontendIPConfiguration", &l.FrontendIPConfiguration) - delete(rawMsg, key) - case "frontendPort": - err = unpopulate(val, "FrontendPort", &l.FrontendPort) - delete(rawMsg, key) - case "idleTimeoutInMinutes": - err = unpopulate(val, "IdleTimeoutInMinutes", &l.IdleTimeoutInMinutes) - delete(rawMsg, key) - case "loadDistribution": - err = unpopulate(val, "LoadDistribution", &l.LoadDistribution) - delete(rawMsg, key) - case "probe": - err = unpopulate(val, "Probe", &l.Probe) - delete(rawMsg, key) - case "protocol": - err = unpopulate(val, "Protocol", &l.Protocol) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &l.ProvisioningState) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type LocalNetworkGateway. -func (l LocalNetworkGateway) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", l.Etag) - populate(objectMap, "id", l.ID) - populate(objectMap, "location", l.Location) - populate(objectMap, "name", l.Name) - populate(objectMap, "properties", l.Properties) - populate(objectMap, "tags", l.Tags) - populate(objectMap, "type", l.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LocalNetworkGateway. -func (l *LocalNetworkGateway) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &l.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &l.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &l.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &l.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &l.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &l.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &l.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type LocalNetworkGatewayListResult. -func (l LocalNetworkGatewayListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", l.NextLink) - populate(objectMap, "value", l.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LocalNetworkGatewayListResult. -func (l *LocalNetworkGatewayListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &l.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &l.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type LocalNetworkGatewayPropertiesFormat. -func (l LocalNetworkGatewayPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "bgpSettings", l.BgpSettings) - populate(objectMap, "fqdn", l.Fqdn) - populate(objectMap, "gatewayIpAddress", l.GatewayIPAddress) - populate(objectMap, "localNetworkAddressSpace", l.LocalNetworkAddressSpace) - populate(objectMap, "provisioningState", l.ProvisioningState) - populate(objectMap, "resourceGuid", l.ResourceGUID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LocalNetworkGatewayPropertiesFormat. -func (l *LocalNetworkGatewayPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "bgpSettings": - err = unpopulate(val, "BgpSettings", &l.BgpSettings) - delete(rawMsg, key) - case "fqdn": - err = unpopulate(val, "Fqdn", &l.Fqdn) - delete(rawMsg, key) - case "gatewayIpAddress": - err = unpopulate(val, "GatewayIPAddress", &l.GatewayIPAddress) - delete(rawMsg, key) - case "localNetworkAddressSpace": - err = unpopulate(val, "LocalNetworkAddressSpace", &l.LocalNetworkAddressSpace) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &l.ProvisioningState) - delete(rawMsg, key) - case "resourceGuid": - err = unpopulate(val, "ResourceGUID", &l.ResourceGUID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type LogSpecification. -func (l LogSpecification) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "blobDuration", l.BlobDuration) - populate(objectMap, "displayName", l.DisplayName) - populate(objectMap, "name", l.Name) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LogSpecification. -func (l *LogSpecification) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "blobDuration": - err = unpopulate(val, "BlobDuration", &l.BlobDuration) - delete(rawMsg, key) - case "displayName": - err = unpopulate(val, "DisplayName", &l.DisplayName) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &l.Name) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ManagedRuleGroupOverride. -func (m ManagedRuleGroupOverride) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "ruleGroupName", m.RuleGroupName) - populate(objectMap, "rules", m.Rules) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedRuleGroupOverride. -func (m *ManagedRuleGroupOverride) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "ruleGroupName": - err = unpopulate(val, "RuleGroupName", &m.RuleGroupName) - delete(rawMsg, key) - case "rules": - err = unpopulate(val, "Rules", &m.Rules) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ManagedRuleOverride. -func (m ManagedRuleOverride) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "ruleId", m.RuleID) - populate(objectMap, "state", m.State) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedRuleOverride. -func (m *ManagedRuleOverride) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "ruleId": - err = unpopulate(val, "RuleID", &m.RuleID) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &m.State) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ManagedRuleSet. -func (m ManagedRuleSet) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "ruleGroupOverrides", m.RuleGroupOverrides) - populate(objectMap, "ruleSetType", m.RuleSetType) - populate(objectMap, "ruleSetVersion", m.RuleSetVersion) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedRuleSet. -func (m *ManagedRuleSet) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "ruleGroupOverrides": - err = unpopulate(val, "RuleGroupOverrides", &m.RuleGroupOverrides) - delete(rawMsg, key) - case "ruleSetType": - err = unpopulate(val, "RuleSetType", &m.RuleSetType) - delete(rawMsg, key) - case "ruleSetVersion": - err = unpopulate(val, "RuleSetVersion", &m.RuleSetVersion) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ManagedRulesDefinition. -func (m ManagedRulesDefinition) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "exclusions", m.Exclusions) - populate(objectMap, "managedRuleSets", m.ManagedRuleSets) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedRulesDefinition. -func (m *ManagedRulesDefinition) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "exclusions": - err = unpopulate(val, "Exclusions", &m.Exclusions) - delete(rawMsg, key) - case "managedRuleSets": - err = unpopulate(val, "ManagedRuleSets", &m.ManagedRuleSets) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ManagedServiceIdentity. -func (m ManagedServiceIdentity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "principalId", m.PrincipalID) - populate(objectMap, "tenantId", m.TenantID) - populate(objectMap, "type", m.Type) - populate(objectMap, "userAssignedIdentities", m.UserAssignedIdentities) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedServiceIdentity. -func (m *ManagedServiceIdentity) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "principalId": - err = unpopulate(val, "PrincipalID", &m.PrincipalID) - delete(rawMsg, key) - case "tenantId": - err = unpopulate(val, "TenantID", &m.TenantID) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &m.Type) - delete(rawMsg, key) - case "userAssignedIdentities": - err = unpopulate(val, "UserAssignedIdentities", &m.UserAssignedIdentities) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Manager. -func (m Manager) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", m.Etag) - populate(objectMap, "id", m.ID) - populate(objectMap, "location", m.Location) - populate(objectMap, "name", m.Name) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "systemData", m.SystemData) - populate(objectMap, "tags", m.Tags) - populate(objectMap, "type", m.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Manager. -func (m *Manager) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &m.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &m.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &m.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &m.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &m.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &m.SystemData) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &m.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &m.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ManagerCommit. -func (m ManagerCommit) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "commitId", m.CommitID) - populate(objectMap, "commitType", m.CommitType) - populate(objectMap, "configurationIds", m.ConfigurationIDs) - populate(objectMap, "targetLocations", m.TargetLocations) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagerCommit. -func (m *ManagerCommit) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "commitId": - err = unpopulate(val, "CommitID", &m.CommitID) - delete(rawMsg, key) - case "commitType": - err = unpopulate(val, "CommitType", &m.CommitType) - delete(rawMsg, key) - case "configurationIds": - err = unpopulate(val, "ConfigurationIDs", &m.ConfigurationIDs) - delete(rawMsg, key) - case "targetLocations": - err = unpopulate(val, "TargetLocations", &m.TargetLocations) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ManagerConnection. -func (m ManagerConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", m.Etag) - populate(objectMap, "id", m.ID) - populate(objectMap, "name", m.Name) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "systemData", m.SystemData) - populate(objectMap, "type", m.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagerConnection. -func (m *ManagerConnection) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &m.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &m.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &m.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &m.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &m.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &m.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ManagerConnectionListResult. -func (m ManagerConnectionListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", m.NextLink) - populate(objectMap, "value", m.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagerConnectionListResult. -func (m *ManagerConnectionListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &m.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &m.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ManagerConnectionProperties. -func (m ManagerConnectionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "connectionState", m.ConnectionState) - populate(objectMap, "description", m.Description) - populate(objectMap, "networkManagerId", m.NetworkManagerID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagerConnectionProperties. -func (m *ManagerConnectionProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "connectionState": - err = unpopulate(val, "ConnectionState", &m.ConnectionState) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &m.Description) - delete(rawMsg, key) - case "networkManagerId": - err = unpopulate(val, "NetworkManagerID", &m.NetworkManagerID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ManagerDeploymentStatus. -func (m ManagerDeploymentStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "commitTime", m.CommitTime) - populate(objectMap, "configurationIds", m.ConfigurationIDs) - populate(objectMap, "deploymentStatus", m.DeploymentStatus) - populate(objectMap, "deploymentType", m.DeploymentType) - populate(objectMap, "errorMessage", m.ErrorMessage) - populate(objectMap, "region", m.Region) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagerDeploymentStatus. -func (m *ManagerDeploymentStatus) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "commitTime": - err = unpopulateTimeRFC3339(val, "CommitTime", &m.CommitTime) - delete(rawMsg, key) - case "configurationIds": - err = unpopulate(val, "ConfigurationIDs", &m.ConfigurationIDs) - delete(rawMsg, key) - case "deploymentStatus": - err = unpopulate(val, "DeploymentStatus", &m.DeploymentStatus) - delete(rawMsg, key) - case "deploymentType": - err = unpopulate(val, "DeploymentType", &m.DeploymentType) - delete(rawMsg, key) - case "errorMessage": - err = unpopulate(val, "ErrorMessage", &m.ErrorMessage) - delete(rawMsg, key) - case "region": - err = unpopulate(val, "Region", &m.Region) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ManagerDeploymentStatusListResult. -func (m ManagerDeploymentStatusListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "skipToken", m.SkipToken) - populate(objectMap, "value", m.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagerDeploymentStatusListResult. -func (m *ManagerDeploymentStatusListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "skipToken": - err = unpopulate(val, "SkipToken", &m.SkipToken) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &m.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ManagerDeploymentStatusParameter. -func (m ManagerDeploymentStatusParameter) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "deploymentTypes", m.DeploymentTypes) - populate(objectMap, "regions", m.Regions) - populate(objectMap, "skipToken", m.SkipToken) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagerDeploymentStatusParameter. -func (m *ManagerDeploymentStatusParameter) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "deploymentTypes": - err = unpopulate(val, "DeploymentTypes", &m.DeploymentTypes) - delete(rawMsg, key) - case "regions": - err = unpopulate(val, "Regions", &m.Regions) - delete(rawMsg, key) - case "skipToken": - err = unpopulate(val, "SkipToken", &m.SkipToken) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ManagerEffectiveConnectivityConfigurationListResult. -func (m ManagerEffectiveConnectivityConfigurationListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "skipToken", m.SkipToken) - populate(objectMap, "value", m.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagerEffectiveConnectivityConfigurationListResult. -func (m *ManagerEffectiveConnectivityConfigurationListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "skipToken": - err = unpopulate(val, "SkipToken", &m.SkipToken) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &m.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ManagerEffectiveSecurityAdminRulesListResult. -func (m ManagerEffectiveSecurityAdminRulesListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "skipToken", m.SkipToken) - populate(objectMap, "value", m.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagerEffectiveSecurityAdminRulesListResult. -func (m *ManagerEffectiveSecurityAdminRulesListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "skipToken": - err = unpopulate(val, "SkipToken", &m.SkipToken) - delete(rawMsg, key) - case "value": - m.Value, err = unmarshalEffectiveBaseSecurityAdminRuleClassificationArray(val) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ManagerListResult. -func (m ManagerListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", m.NextLink) - populate(objectMap, "value", m.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagerListResult. -func (m *ManagerListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &m.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &m.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ManagerProperties. -func (m ManagerProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "description", m.Description) - populate(objectMap, "networkManagerScopeAccesses", m.NetworkManagerScopeAccesses) - populate(objectMap, "networkManagerScopes", m.NetworkManagerScopes) - populate(objectMap, "provisioningState", m.ProvisioningState) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagerProperties. -func (m *ManagerProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "description": - err = unpopulate(val, "Description", &m.Description) - delete(rawMsg, key) - case "networkManagerScopeAccesses": - err = unpopulate(val, "NetworkManagerScopeAccesses", &m.NetworkManagerScopeAccesses) - delete(rawMsg, key) - case "networkManagerScopes": - err = unpopulate(val, "NetworkManagerScopes", &m.NetworkManagerScopes) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &m.ProvisioningState) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ManagerPropertiesNetworkManagerScopes. -func (m ManagerPropertiesNetworkManagerScopes) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "crossTenantScopes", m.CrossTenantScopes) - populate(objectMap, "managementGroups", m.ManagementGroups) - populate(objectMap, "subscriptions", m.Subscriptions) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagerPropertiesNetworkManagerScopes. -func (m *ManagerPropertiesNetworkManagerScopes) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "crossTenantScopes": - err = unpopulate(val, "CrossTenantScopes", &m.CrossTenantScopes) - delete(rawMsg, key) - case "managementGroups": - err = unpopulate(val, "ManagementGroups", &m.ManagementGroups) - delete(rawMsg, key) - case "subscriptions": - err = unpopulate(val, "Subscriptions", &m.Subscriptions) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ManagerSecurityGroupItem. -func (m ManagerSecurityGroupItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "networkGroupId", m.NetworkGroupID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagerSecurityGroupItem. -func (m *ManagerSecurityGroupItem) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "networkGroupId": - err = unpopulate(val, "NetworkGroupID", &m.NetworkGroupID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type MatchCondition. -func (m MatchCondition) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "matchValues", m.MatchValues) - populate(objectMap, "matchVariables", m.MatchVariables) - populate(objectMap, "negationConditon", m.NegationConditon) - populate(objectMap, "operator", m.Operator) - populate(objectMap, "transforms", m.Transforms) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type MatchCondition. -func (m *MatchCondition) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "matchValues": - err = unpopulate(val, "MatchValues", &m.MatchValues) - delete(rawMsg, key) - case "matchVariables": - err = unpopulate(val, "MatchVariables", &m.MatchVariables) - delete(rawMsg, key) - case "negationConditon": - err = unpopulate(val, "NegationConditon", &m.NegationConditon) - delete(rawMsg, key) - case "operator": - err = unpopulate(val, "Operator", &m.Operator) - delete(rawMsg, key) - case "transforms": - err = unpopulate(val, "Transforms", &m.Transforms) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type MatchVariable. -func (m MatchVariable) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "selector", m.Selector) - populate(objectMap, "variableName", m.VariableName) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type MatchVariable. -func (m *MatchVariable) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "selector": - err = unpopulate(val, "Selector", &m.Selector) - delete(rawMsg, key) - case "variableName": - err = unpopulate(val, "VariableName", &m.VariableName) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type MatchedRule. -func (m MatchedRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "action", m.Action) - populate(objectMap, "ruleName", m.RuleName) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type MatchedRule. -func (m *MatchedRule) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "action": - err = unpopulate(val, "Action", &m.Action) - delete(rawMsg, key) - case "ruleName": - err = unpopulate(val, "RuleName", &m.RuleName) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type MetricSpecification. -func (m MetricSpecification) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "aggregationType", m.AggregationType) - populate(objectMap, "availabilities", m.Availabilities) - populate(objectMap, "dimensions", m.Dimensions) - populate(objectMap, "displayDescription", m.DisplayDescription) - populate(objectMap, "displayName", m.DisplayName) - populate(objectMap, "enableRegionalMdmAccount", m.EnableRegionalMdmAccount) - populate(objectMap, "fillGapWithZero", m.FillGapWithZero) - populate(objectMap, "isInternal", m.IsInternal) - populate(objectMap, "metricFilterPattern", m.MetricFilterPattern) - populate(objectMap, "name", m.Name) - populate(objectMap, "resourceIdDimensionNameOverride", m.ResourceIDDimensionNameOverride) - populate(objectMap, "sourceMdmAccount", m.SourceMdmAccount) - populate(objectMap, "sourceMdmNamespace", m.SourceMdmNamespace) - populate(objectMap, "unit", m.Unit) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type MetricSpecification. -func (m *MetricSpecification) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "aggregationType": - err = unpopulate(val, "AggregationType", &m.AggregationType) - delete(rawMsg, key) - case "availabilities": - err = unpopulate(val, "Availabilities", &m.Availabilities) - delete(rawMsg, key) - case "dimensions": - err = unpopulate(val, "Dimensions", &m.Dimensions) - delete(rawMsg, key) - case "displayDescription": - err = unpopulate(val, "DisplayDescription", &m.DisplayDescription) - delete(rawMsg, key) - case "displayName": - err = unpopulate(val, "DisplayName", &m.DisplayName) - delete(rawMsg, key) - case "enableRegionalMdmAccount": - err = unpopulate(val, "EnableRegionalMdmAccount", &m.EnableRegionalMdmAccount) - delete(rawMsg, key) - case "fillGapWithZero": - err = unpopulate(val, "FillGapWithZero", &m.FillGapWithZero) - delete(rawMsg, key) - case "isInternal": - err = unpopulate(val, "IsInternal", &m.IsInternal) - delete(rawMsg, key) - case "metricFilterPattern": - err = unpopulate(val, "MetricFilterPattern", &m.MetricFilterPattern) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &m.Name) - delete(rawMsg, key) - case "resourceIdDimensionNameOverride": - err = unpopulate(val, "ResourceIDDimensionNameOverride", &m.ResourceIDDimensionNameOverride) - delete(rawMsg, key) - case "sourceMdmAccount": - err = unpopulate(val, "SourceMdmAccount", &m.SourceMdmAccount) - delete(rawMsg, key) - case "sourceMdmNamespace": - err = unpopulate(val, "SourceMdmNamespace", &m.SourceMdmNamespace) - delete(rawMsg, key) - case "unit": - err = unpopulate(val, "Unit", &m.Unit) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type NatGateway. -func (n NatGateway) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", n.Etag) - populate(objectMap, "id", n.ID) - populate(objectMap, "location", n.Location) - populate(objectMap, "name", n.Name) - populate(objectMap, "properties", n.Properties) - populate(objectMap, "sku", n.SKU) - populate(objectMap, "tags", n.Tags) - populate(objectMap, "type", n.Type) - populate(objectMap, "zones", n.Zones) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type NatGateway. -func (n *NatGateway) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &n.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &n.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &n.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &n.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &n.Properties) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &n.SKU) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &n.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &n.Type) - delete(rawMsg, key) - case "zones": - err = unpopulate(val, "Zones", &n.Zones) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type NatGatewayListResult. -func (n NatGatewayListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", n.NextLink) - populate(objectMap, "value", n.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type NatGatewayListResult. -func (n *NatGatewayListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &n.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &n.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type NatGatewayPropertiesFormat. -func (n NatGatewayPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "idleTimeoutInMinutes", n.IdleTimeoutInMinutes) - populate(objectMap, "provisioningState", n.ProvisioningState) - populate(objectMap, "publicIpAddresses", n.PublicIPAddresses) - populate(objectMap, "publicIpPrefixes", n.PublicIPPrefixes) - populate(objectMap, "resourceGuid", n.ResourceGUID) - populate(objectMap, "subnets", n.Subnets) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type NatGatewayPropertiesFormat. -func (n *NatGatewayPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "idleTimeoutInMinutes": - err = unpopulate(val, "IdleTimeoutInMinutes", &n.IdleTimeoutInMinutes) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &n.ProvisioningState) - delete(rawMsg, key) - case "publicIpAddresses": - err = unpopulate(val, "PublicIPAddresses", &n.PublicIPAddresses) - delete(rawMsg, key) - case "publicIpPrefixes": - err = unpopulate(val, "PublicIPPrefixes", &n.PublicIPPrefixes) - delete(rawMsg, key) - case "resourceGuid": - err = unpopulate(val, "ResourceGUID", &n.ResourceGUID) - delete(rawMsg, key) - case "subnets": - err = unpopulate(val, "Subnets", &n.Subnets) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type NatGatewaySKU. -func (n NatGatewaySKU) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "name", n.Name) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type NatGatewaySKU. -func (n *NatGatewaySKU) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &n.Name) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type NatRule. -func (n NatRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "description", n.Description) - populate(objectMap, "destinationAddresses", n.DestinationAddresses) - populate(objectMap, "destinationPorts", n.DestinationPorts) - populate(objectMap, "ipProtocols", n.IPProtocols) - populate(objectMap, "name", n.Name) - objectMap["ruleType"] = FirewallPolicyRuleTypeNatRule - populate(objectMap, "sourceAddresses", n.SourceAddresses) - populate(objectMap, "sourceIpGroups", n.SourceIPGroups) - populate(objectMap, "translatedAddress", n.TranslatedAddress) - populate(objectMap, "translatedFqdn", n.TranslatedFqdn) - populate(objectMap, "translatedPort", n.TranslatedPort) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type NatRule. -func (n *NatRule) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "description": - err = unpopulate(val, "Description", &n.Description) - delete(rawMsg, key) - case "destinationAddresses": - err = unpopulate(val, "DestinationAddresses", &n.DestinationAddresses) - delete(rawMsg, key) - case "destinationPorts": - err = unpopulate(val, "DestinationPorts", &n.DestinationPorts) - delete(rawMsg, key) - case "ipProtocols": - err = unpopulate(val, "IPProtocols", &n.IPProtocols) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &n.Name) - delete(rawMsg, key) - case "ruleType": - err = unpopulate(val, "RuleType", &n.RuleType) - delete(rawMsg, key) - case "sourceAddresses": - err = unpopulate(val, "SourceAddresses", &n.SourceAddresses) - delete(rawMsg, key) - case "sourceIpGroups": - err = unpopulate(val, "SourceIPGroups", &n.SourceIPGroups) - delete(rawMsg, key) - case "translatedAddress": - err = unpopulate(val, "TranslatedAddress", &n.TranslatedAddress) - delete(rawMsg, key) - case "translatedFqdn": - err = unpopulate(val, "TranslatedFqdn", &n.TranslatedFqdn) - delete(rawMsg, key) - case "translatedPort": - err = unpopulate(val, "TranslatedPort", &n.TranslatedPort) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type NatRulePortMapping. -func (n NatRulePortMapping) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "backendPort", n.BackendPort) - populate(objectMap, "frontendPort", n.FrontendPort) - populate(objectMap, "inboundNatRuleName", n.InboundNatRuleName) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type NatRulePortMapping. -func (n *NatRulePortMapping) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "backendPort": - err = unpopulate(val, "BackendPort", &n.BackendPort) - delete(rawMsg, key) - case "frontendPort": - err = unpopulate(val, "FrontendPort", &n.FrontendPort) - delete(rawMsg, key) - case "inboundNatRuleName": - err = unpopulate(val, "InboundNatRuleName", &n.InboundNatRuleName) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type NextHopParameters. -func (n NextHopParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "destinationIPAddress", n.DestinationIPAddress) - populate(objectMap, "sourceIPAddress", n.SourceIPAddress) - populate(objectMap, "targetNicResourceId", n.TargetNicResourceID) - populate(objectMap, "targetResourceId", n.TargetResourceID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type NextHopParameters. -func (n *NextHopParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "destinationIPAddress": - err = unpopulate(val, "DestinationIPAddress", &n.DestinationIPAddress) - delete(rawMsg, key) - case "sourceIPAddress": - err = unpopulate(val, "SourceIPAddress", &n.SourceIPAddress) - delete(rawMsg, key) - case "targetNicResourceId": - err = unpopulate(val, "TargetNicResourceID", &n.TargetNicResourceID) - delete(rawMsg, key) - case "targetResourceId": - err = unpopulate(val, "TargetResourceID", &n.TargetResourceID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type NextHopResult. -func (n NextHopResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextHopIpAddress", n.NextHopIPAddress) - populate(objectMap, "nextHopType", n.NextHopType) - populate(objectMap, "routeTableId", n.RouteTableID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type NextHopResult. -func (n *NextHopResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextHopIpAddress": - err = unpopulate(val, "NextHopIPAddress", &n.NextHopIPAddress) - delete(rawMsg, key) - case "nextHopType": - err = unpopulate(val, "NextHopType", &n.NextHopType) - delete(rawMsg, key) - case "routeTableId": - err = unpopulate(val, "RouteTableID", &n.RouteTableID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type O365BreakOutCategoryPolicies. -func (o O365BreakOutCategoryPolicies) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "allow", o.Allow) - populate(objectMap, "default", o.Default) - populate(objectMap, "optimize", o.Optimize) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type O365BreakOutCategoryPolicies. -func (o *O365BreakOutCategoryPolicies) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "allow": - err = unpopulate(val, "Allow", &o.Allow) - delete(rawMsg, key) - case "default": - err = unpopulate(val, "Default", &o.Default) - delete(rawMsg, key) - case "optimize": - err = unpopulate(val, "Optimize", &o.Optimize) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type O365PolicyProperties. -func (o O365PolicyProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "breakOutCategories", o.BreakOutCategories) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type O365PolicyProperties. -func (o *O365PolicyProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "breakOutCategories": - err = unpopulate(val, "BreakOutCategories", &o.BreakOutCategories) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Office365PolicyProperties. -func (o Office365PolicyProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "breakOutCategories", o.BreakOutCategories) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Office365PolicyProperties. -func (o *Office365PolicyProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "breakOutCategories": - err = unpopulate(val, "BreakOutCategories", &o.BreakOutCategories) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Operation. -func (o Operation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "display", o.Display) - populate(objectMap, "name", o.Name) - populate(objectMap, "origin", o.Origin) - populate(objectMap, "properties", o.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Operation. -func (o *Operation) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "display": - err = unpopulate(val, "Display", &o.Display) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &o.Name) - delete(rawMsg, key) - case "origin": - err = unpopulate(val, "Origin", &o.Origin) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &o.Properties) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type OperationDisplay. -func (o OperationDisplay) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "description", o.Description) - populate(objectMap, "operation", o.Operation) - populate(objectMap, "provider", o.Provider) - populate(objectMap, "resource", o.Resource) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay. -func (o *OperationDisplay) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "description": - err = unpopulate(val, "Description", &o.Description) - delete(rawMsg, key) - case "operation": - err = unpopulate(val, "Operation", &o.Operation) - delete(rawMsg, key) - case "provider": - err = unpopulate(val, "Provider", &o.Provider) - delete(rawMsg, key) - case "resource": - err = unpopulate(val, "Resource", &o.Resource) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type OperationListResult. -func (o OperationListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", o.NextLink) - populate(objectMap, "value", o.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult. -func (o *OperationListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &o.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &o.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type OperationPropertiesFormat. -func (o OperationPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "serviceSpecification", o.ServiceSpecification) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationPropertiesFormat. -func (o *OperationPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "serviceSpecification": - err = unpopulate(val, "ServiceSpecification", &o.ServiceSpecification) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type OperationPropertiesFormatServiceSpecification. -func (o OperationPropertiesFormatServiceSpecification) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "logSpecifications", o.LogSpecifications) - populate(objectMap, "metricSpecifications", o.MetricSpecifications) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationPropertiesFormatServiceSpecification. -func (o *OperationPropertiesFormatServiceSpecification) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "logSpecifications": - err = unpopulate(val, "LogSpecifications", &o.LogSpecifications) - delete(rawMsg, key) - case "metricSpecifications": - err = unpopulate(val, "MetricSpecifications", &o.MetricSpecifications) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type OrderBy. -func (o OrderBy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "field", o.Field) - populate(objectMap, "order", o.Order) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OrderBy. -func (o *OrderBy) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "field": - err = unpopulate(val, "Field", &o.Field) - delete(rawMsg, key) - case "order": - err = unpopulate(val, "Order", &o.Order) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type OutboundRule. -func (o OutboundRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", o.Etag) - populate(objectMap, "id", o.ID) - populate(objectMap, "name", o.Name) - populate(objectMap, "properties", o.Properties) - populate(objectMap, "type", o.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OutboundRule. -func (o *OutboundRule) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &o.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &o.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &o.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &o.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &o.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type OutboundRulePropertiesFormat. -func (o OutboundRulePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "allocatedOutboundPorts", o.AllocatedOutboundPorts) - populate(objectMap, "backendAddressPool", o.BackendAddressPool) - populate(objectMap, "enableTcpReset", o.EnableTCPReset) - populate(objectMap, "frontendIPConfigurations", o.FrontendIPConfigurations) - populate(objectMap, "idleTimeoutInMinutes", o.IdleTimeoutInMinutes) - populate(objectMap, "protocol", o.Protocol) - populate(objectMap, "provisioningState", o.ProvisioningState) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OutboundRulePropertiesFormat. -func (o *OutboundRulePropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "allocatedOutboundPorts": - err = unpopulate(val, "AllocatedOutboundPorts", &o.AllocatedOutboundPorts) - delete(rawMsg, key) - case "backendAddressPool": - err = unpopulate(val, "BackendAddressPool", &o.BackendAddressPool) - delete(rawMsg, key) - case "enableTcpReset": - err = unpopulate(val, "EnableTCPReset", &o.EnableTCPReset) - delete(rawMsg, key) - case "frontendIPConfigurations": - err = unpopulate(val, "FrontendIPConfigurations", &o.FrontendIPConfigurations) - delete(rawMsg, key) - case "idleTimeoutInMinutes": - err = unpopulate(val, "IdleTimeoutInMinutes", &o.IdleTimeoutInMinutes) - delete(rawMsg, key) - case "protocol": - err = unpopulate(val, "Protocol", &o.Protocol) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &o.ProvisioningState) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type OwaspCrsExclusionEntry. -func (o OwaspCrsExclusionEntry) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "exclusionManagedRuleSets", o.ExclusionManagedRuleSets) - populate(objectMap, "matchVariable", o.MatchVariable) - populate(objectMap, "selector", o.Selector) - populate(objectMap, "selectorMatchOperator", o.SelectorMatchOperator) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OwaspCrsExclusionEntry. -func (o *OwaspCrsExclusionEntry) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "exclusionManagedRuleSets": - err = unpopulate(val, "ExclusionManagedRuleSets", &o.ExclusionManagedRuleSets) - delete(rawMsg, key) - case "matchVariable": - err = unpopulate(val, "MatchVariable", &o.MatchVariable) - delete(rawMsg, key) - case "selector": - err = unpopulate(val, "Selector", &o.Selector) - delete(rawMsg, key) - case "selectorMatchOperator": - err = unpopulate(val, "SelectorMatchOperator", &o.SelectorMatchOperator) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type P2SConnectionConfiguration. -func (p P2SConnectionConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", p.Etag) - populate(objectMap, "id", p.ID) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type P2SConnectionConfiguration. -func (p *P2SConnectionConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &p.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &p.Properties) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type P2SConnectionConfigurationProperties. -func (p P2SConnectionConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "configurationPolicyGroupAssociations", p.ConfigurationPolicyGroupAssociations) - populate(objectMap, "enableInternetSecurity", p.EnableInternetSecurity) - populate(objectMap, "previousConfigurationPolicyGroupAssociations", p.PreviousConfigurationPolicyGroupAssociations) - populate(objectMap, "provisioningState", p.ProvisioningState) - populate(objectMap, "routingConfiguration", p.RoutingConfiguration) - populate(objectMap, "vpnClientAddressPool", p.VPNClientAddressPool) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type P2SConnectionConfigurationProperties. -func (p *P2SConnectionConfigurationProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "configurationPolicyGroupAssociations": - err = unpopulate(val, "ConfigurationPolicyGroupAssociations", &p.ConfigurationPolicyGroupAssociations) - delete(rawMsg, key) - case "enableInternetSecurity": - err = unpopulate(val, "EnableInternetSecurity", &p.EnableInternetSecurity) - delete(rawMsg, key) - case "previousConfigurationPolicyGroupAssociations": - err = unpopulate(val, "PreviousConfigurationPolicyGroupAssociations", &p.PreviousConfigurationPolicyGroupAssociations) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) - delete(rawMsg, key) - case "routingConfiguration": - err = unpopulate(val, "RoutingConfiguration", &p.RoutingConfiguration) - delete(rawMsg, key) - case "vpnClientAddressPool": - err = unpopulate(val, "VPNClientAddressPool", &p.VPNClientAddressPool) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type P2SVPNConnectionHealth. -func (p P2SVPNConnectionHealth) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "sasUrl", p.SasURL) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type P2SVPNConnectionHealth. -func (p *P2SVPNConnectionHealth) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "sasUrl": - err = unpopulate(val, "SasURL", &p.SasURL) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type P2SVPNConnectionHealthRequest. -func (p P2SVPNConnectionHealthRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "outputBlobSasUrl", p.OutputBlobSasURL) - populate(objectMap, "vpnUserNamesFilter", p.VPNUserNamesFilter) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type P2SVPNConnectionHealthRequest. -func (p *P2SVPNConnectionHealthRequest) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "outputBlobSasUrl": - err = unpopulate(val, "OutputBlobSasURL", &p.OutputBlobSasURL) - delete(rawMsg, key) - case "vpnUserNamesFilter": - err = unpopulate(val, "VPNUserNamesFilter", &p.VPNUserNamesFilter) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type P2SVPNConnectionRequest. -func (p P2SVPNConnectionRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "vpnConnectionIds", p.VPNConnectionIDs) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type P2SVPNConnectionRequest. -func (p *P2SVPNConnectionRequest) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "vpnConnectionIds": - err = unpopulate(val, "VPNConnectionIDs", &p.VPNConnectionIDs) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type P2SVPNGateway. -func (p P2SVPNGateway) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", p.Etag) - populate(objectMap, "id", p.ID) - populate(objectMap, "location", p.Location) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "tags", p.Tags) - populate(objectMap, "type", p.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type P2SVPNGateway. -func (p *P2SVPNGateway) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &p.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &p.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &p.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &p.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type P2SVPNGatewayProperties. -func (p P2SVPNGatewayProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "customDnsServers", p.CustomDNSServers) - populate(objectMap, "isRoutingPreferenceInternet", p.IsRoutingPreferenceInternet) - populate(objectMap, "p2SConnectionConfigurations", p.P2SConnectionConfigurations) - populate(objectMap, "provisioningState", p.ProvisioningState) - populate(objectMap, "vpnClientConnectionHealth", p.VPNClientConnectionHealth) - populate(objectMap, "vpnGatewayScaleUnit", p.VPNGatewayScaleUnit) - populate(objectMap, "vpnServerConfiguration", p.VPNServerConfiguration) - populate(objectMap, "virtualHub", p.VirtualHub) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type P2SVPNGatewayProperties. -func (p *P2SVPNGatewayProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "customDnsServers": - err = unpopulate(val, "CustomDNSServers", &p.CustomDNSServers) - delete(rawMsg, key) - case "isRoutingPreferenceInternet": - err = unpopulate(val, "IsRoutingPreferenceInternet", &p.IsRoutingPreferenceInternet) - delete(rawMsg, key) - case "p2SConnectionConfigurations": - err = unpopulate(val, "P2SConnectionConfigurations", &p.P2SConnectionConfigurations) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) - delete(rawMsg, key) - case "vpnClientConnectionHealth": - err = unpopulate(val, "VPNClientConnectionHealth", &p.VPNClientConnectionHealth) - delete(rawMsg, key) - case "vpnGatewayScaleUnit": - err = unpopulate(val, "VPNGatewayScaleUnit", &p.VPNGatewayScaleUnit) - delete(rawMsg, key) - case "vpnServerConfiguration": - err = unpopulate(val, "VPNServerConfiguration", &p.VPNServerConfiguration) - delete(rawMsg, key) - case "virtualHub": - err = unpopulate(val, "VirtualHub", &p.VirtualHub) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type P2SVPNProfileParameters. -func (p P2SVPNProfileParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "authenticationMethod", p.AuthenticationMethod) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type P2SVPNProfileParameters. -func (p *P2SVPNProfileParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "authenticationMethod": - err = unpopulate(val, "AuthenticationMethod", &p.AuthenticationMethod) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PacketCapture. -func (p PacketCapture) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", p.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PacketCapture. -func (p *PacketCapture) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "properties": - err = unpopulate(val, "Properties", &p.Properties) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PacketCaptureFilter. -func (p PacketCaptureFilter) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "localIPAddress", p.LocalIPAddress) - populate(objectMap, "localPort", p.LocalPort) - populate(objectMap, "protocol", p.Protocol) - populate(objectMap, "remoteIPAddress", p.RemoteIPAddress) - populate(objectMap, "remotePort", p.RemotePort) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PacketCaptureFilter. -func (p *PacketCaptureFilter) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "localIPAddress": - err = unpopulate(val, "LocalIPAddress", &p.LocalIPAddress) - delete(rawMsg, key) - case "localPort": - err = unpopulate(val, "LocalPort", &p.LocalPort) - delete(rawMsg, key) - case "protocol": - err = unpopulate(val, "Protocol", &p.Protocol) - delete(rawMsg, key) - case "remoteIPAddress": - err = unpopulate(val, "RemoteIPAddress", &p.RemoteIPAddress) - delete(rawMsg, key) - case "remotePort": - err = unpopulate(val, "RemotePort", &p.RemotePort) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PacketCaptureListResult. -func (p PacketCaptureListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "value", p.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PacketCaptureListResult. -func (p *PacketCaptureListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "value": - err = unpopulate(val, "Value", &p.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PacketCaptureMachineScope. -func (p PacketCaptureMachineScope) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "exclude", p.Exclude) - populate(objectMap, "include", p.Include) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PacketCaptureMachineScope. -func (p *PacketCaptureMachineScope) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "exclude": - err = unpopulate(val, "Exclude", &p.Exclude) - delete(rawMsg, key) - case "include": - err = unpopulate(val, "Include", &p.Include) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PacketCaptureParameters. -func (p PacketCaptureParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "bytesToCapturePerPacket", p.BytesToCapturePerPacket) - populate(objectMap, "filters", p.Filters) - populate(objectMap, "scope", p.Scope) - populate(objectMap, "storageLocation", p.StorageLocation) - populate(objectMap, "target", p.Target) - populate(objectMap, "targetType", p.TargetType) - populate(objectMap, "timeLimitInSeconds", p.TimeLimitInSeconds) - populate(objectMap, "totalBytesPerSession", p.TotalBytesPerSession) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PacketCaptureParameters. -func (p *PacketCaptureParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "bytesToCapturePerPacket": - err = unpopulate(val, "BytesToCapturePerPacket", &p.BytesToCapturePerPacket) - delete(rawMsg, key) - case "filters": - err = unpopulate(val, "Filters", &p.Filters) - delete(rawMsg, key) - case "scope": - err = unpopulate(val, "Scope", &p.Scope) - delete(rawMsg, key) - case "storageLocation": - err = unpopulate(val, "StorageLocation", &p.StorageLocation) - delete(rawMsg, key) - case "target": - err = unpopulate(val, "Target", &p.Target) - delete(rawMsg, key) - case "targetType": - err = unpopulate(val, "TargetType", &p.TargetType) - delete(rawMsg, key) - case "timeLimitInSeconds": - err = unpopulate(val, "TimeLimitInSeconds", &p.TimeLimitInSeconds) - delete(rawMsg, key) - case "totalBytesPerSession": - err = unpopulate(val, "TotalBytesPerSession", &p.TotalBytesPerSession) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PacketCaptureQueryStatusResult. -func (p PacketCaptureQueryStatusResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "captureStartTime", p.CaptureStartTime) - populate(objectMap, "id", p.ID) - populate(objectMap, "name", p.Name) - populate(objectMap, "packetCaptureError", p.PacketCaptureError) - populate(objectMap, "packetCaptureStatus", p.PacketCaptureStatus) - populate(objectMap, "stopReason", p.StopReason) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PacketCaptureQueryStatusResult. -func (p *PacketCaptureQueryStatusResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "captureStartTime": - err = unpopulateTimeRFC3339(val, "CaptureStartTime", &p.CaptureStartTime) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "packetCaptureError": - err = unpopulate(val, "PacketCaptureError", &p.PacketCaptureError) - delete(rawMsg, key) - case "packetCaptureStatus": - err = unpopulate(val, "PacketCaptureStatus", &p.PacketCaptureStatus) - delete(rawMsg, key) - case "stopReason": - err = unpopulate(val, "StopReason", &p.StopReason) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PacketCaptureResult. -func (p PacketCaptureResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", p.Etag) - populate(objectMap, "id", p.ID) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PacketCaptureResult. -func (p *PacketCaptureResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &p.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &p.Properties) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PacketCaptureResultProperties. -func (p PacketCaptureResultProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "bytesToCapturePerPacket", p.BytesToCapturePerPacket) - populate(objectMap, "filters", p.Filters) - populate(objectMap, "provisioningState", p.ProvisioningState) - populate(objectMap, "scope", p.Scope) - populate(objectMap, "storageLocation", p.StorageLocation) - populate(objectMap, "target", p.Target) - populate(objectMap, "targetType", p.TargetType) - populate(objectMap, "timeLimitInSeconds", p.TimeLimitInSeconds) - populate(objectMap, "totalBytesPerSession", p.TotalBytesPerSession) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PacketCaptureResultProperties. -func (p *PacketCaptureResultProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "bytesToCapturePerPacket": - err = unpopulate(val, "BytesToCapturePerPacket", &p.BytesToCapturePerPacket) - delete(rawMsg, key) - case "filters": - err = unpopulate(val, "Filters", &p.Filters) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) - delete(rawMsg, key) - case "scope": - err = unpopulate(val, "Scope", &p.Scope) - delete(rawMsg, key) - case "storageLocation": - err = unpopulate(val, "StorageLocation", &p.StorageLocation) - delete(rawMsg, key) - case "target": - err = unpopulate(val, "Target", &p.Target) - delete(rawMsg, key) - case "targetType": - err = unpopulate(val, "TargetType", &p.TargetType) - delete(rawMsg, key) - case "timeLimitInSeconds": - err = unpopulate(val, "TimeLimitInSeconds", &p.TimeLimitInSeconds) - delete(rawMsg, key) - case "totalBytesPerSession": - err = unpopulate(val, "TotalBytesPerSession", &p.TotalBytesPerSession) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PacketCaptureStorageLocation. -func (p PacketCaptureStorageLocation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "filePath", p.FilePath) - populate(objectMap, "storageId", p.StorageID) - populate(objectMap, "storagePath", p.StoragePath) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PacketCaptureStorageLocation. -func (p *PacketCaptureStorageLocation) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "filePath": - err = unpopulate(val, "FilePath", &p.FilePath) - delete(rawMsg, key) - case "storageId": - err = unpopulate(val, "StorageID", &p.StorageID) - delete(rawMsg, key) - case "storagePath": - err = unpopulate(val, "StoragePath", &p.StoragePath) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PatchObject. -func (p PatchObject) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "tags", p.Tags) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PatchObject. -func (p *PatchObject) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "tags": - err = unpopulate(val, "Tags", &p.Tags) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PatchRouteFilter. -func (p PatchRouteFilter) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", p.Etag) - populate(objectMap, "id", p.ID) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "tags", p.Tags) - populate(objectMap, "type", p.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PatchRouteFilter. -func (p *PatchRouteFilter) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &p.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &p.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &p.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PatchRouteFilterRule. -func (p PatchRouteFilterRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", p.Etag) - populate(objectMap, "id", p.ID) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PatchRouteFilterRule. -func (p *PatchRouteFilterRule) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &p.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &p.Properties) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PeerExpressRouteCircuitConnection. -func (p PeerExpressRouteCircuitConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", p.Etag) - populate(objectMap, "id", p.ID) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "type", p.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PeerExpressRouteCircuitConnection. -func (p *PeerExpressRouteCircuitConnection) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &p.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &p.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PeerExpressRouteCircuitConnectionListResult. -func (p PeerExpressRouteCircuitConnectionListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", p.NextLink) - populate(objectMap, "value", p.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PeerExpressRouteCircuitConnectionListResult. -func (p *PeerExpressRouteCircuitConnectionListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &p.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &p.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PeerExpressRouteCircuitConnectionPropertiesFormat. -func (p PeerExpressRouteCircuitConnectionPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "addressPrefix", p.AddressPrefix) - populate(objectMap, "authResourceGuid", p.AuthResourceGUID) - populate(objectMap, "circuitConnectionStatus", p.CircuitConnectionStatus) - populate(objectMap, "connectionName", p.ConnectionName) - populate(objectMap, "expressRouteCircuitPeering", p.ExpressRouteCircuitPeering) - populate(objectMap, "peerExpressRouteCircuitPeering", p.PeerExpressRouteCircuitPeering) - populate(objectMap, "provisioningState", p.ProvisioningState) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PeerExpressRouteCircuitConnectionPropertiesFormat. -func (p *PeerExpressRouteCircuitConnectionPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "addressPrefix": - err = unpopulate(val, "AddressPrefix", &p.AddressPrefix) - delete(rawMsg, key) - case "authResourceGuid": - err = unpopulate(val, "AuthResourceGUID", &p.AuthResourceGUID) - delete(rawMsg, key) - case "circuitConnectionStatus": - err = unpopulate(val, "CircuitConnectionStatus", &p.CircuitConnectionStatus) - delete(rawMsg, key) - case "connectionName": - err = unpopulate(val, "ConnectionName", &p.ConnectionName) - delete(rawMsg, key) - case "expressRouteCircuitPeering": - err = unpopulate(val, "ExpressRouteCircuitPeering", &p.ExpressRouteCircuitPeering) - delete(rawMsg, key) - case "peerExpressRouteCircuitPeering": - err = unpopulate(val, "PeerExpressRouteCircuitPeering", &p.PeerExpressRouteCircuitPeering) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PeerRoute. -func (p PeerRoute) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "asPath", p.AsPath) - populate(objectMap, "localAddress", p.LocalAddress) - populate(objectMap, "network", p.Network) - populate(objectMap, "nextHop", p.NextHop) - populate(objectMap, "origin", p.Origin) - populate(objectMap, "sourcePeer", p.SourcePeer) - populate(objectMap, "weight", p.Weight) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PeerRoute. -func (p *PeerRoute) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "asPath": - err = unpopulate(val, "AsPath", &p.AsPath) - delete(rawMsg, key) - case "localAddress": - err = unpopulate(val, "LocalAddress", &p.LocalAddress) - delete(rawMsg, key) - case "network": - err = unpopulate(val, "Network", &p.Network) - delete(rawMsg, key) - case "nextHop": - err = unpopulate(val, "NextHop", &p.NextHop) - delete(rawMsg, key) - case "origin": - err = unpopulate(val, "Origin", &p.Origin) - delete(rawMsg, key) - case "sourcePeer": - err = unpopulate(val, "SourcePeer", &p.SourcePeer) - delete(rawMsg, key) - case "weight": - err = unpopulate(val, "Weight", &p.Weight) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PeerRouteList. -func (p PeerRouteList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "value", p.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PeerRouteList. -func (p *PeerRouteList) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "value": - err = unpopulate(val, "Value", &p.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PolicySettings. -func (p PolicySettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "fileUploadLimitInMb", p.FileUploadLimitInMb) - populate(objectMap, "maxRequestBodySizeInKb", p.MaxRequestBodySizeInKb) - populate(objectMap, "mode", p.Mode) - populate(objectMap, "requestBodyCheck", p.RequestBodyCheck) - populate(objectMap, "state", p.State) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PolicySettings. -func (p *PolicySettings) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "fileUploadLimitInMb": - err = unpopulate(val, "FileUploadLimitInMb", &p.FileUploadLimitInMb) - delete(rawMsg, key) - case "maxRequestBodySizeInKb": - err = unpopulate(val, "MaxRequestBodySizeInKb", &p.MaxRequestBodySizeInKb) - delete(rawMsg, key) - case "mode": - err = unpopulate(val, "Mode", &p.Mode) - delete(rawMsg, key) - case "requestBodyCheck": - err = unpopulate(val, "RequestBodyCheck", &p.RequestBodyCheck) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &p.State) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PrepareNetworkPoliciesRequest. -func (p PrepareNetworkPoliciesRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "networkIntentPolicyConfigurations", p.NetworkIntentPolicyConfigurations) - populate(objectMap, "serviceName", p.ServiceName) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PrepareNetworkPoliciesRequest. -func (p *PrepareNetworkPoliciesRequest) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "networkIntentPolicyConfigurations": - err = unpopulate(val, "NetworkIntentPolicyConfigurations", &p.NetworkIntentPolicyConfigurations) - delete(rawMsg, key) - case "serviceName": - err = unpopulate(val, "ServiceName", &p.ServiceName) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PrivateDNSZoneConfig. -func (p PrivateDNSZoneConfig) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateDNSZoneConfig. -func (p *PrivateDNSZoneConfig) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &p.Properties) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PrivateDNSZoneGroup. -func (p PrivateDNSZoneGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", p.Etag) - populate(objectMap, "id", p.ID) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateDNSZoneGroup. -func (p *PrivateDNSZoneGroup) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &p.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &p.Properties) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PrivateDNSZoneGroupListResult. -func (p PrivateDNSZoneGroupListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", p.NextLink) - populate(objectMap, "value", p.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateDNSZoneGroupListResult. -func (p *PrivateDNSZoneGroupListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &p.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &p.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PrivateDNSZoneGroupPropertiesFormat. -func (p PrivateDNSZoneGroupPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "privateDnsZoneConfigs", p.PrivateDNSZoneConfigs) - populate(objectMap, "provisioningState", p.ProvisioningState) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateDNSZoneGroupPropertiesFormat. -func (p *PrivateDNSZoneGroupPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "privateDnsZoneConfigs": - err = unpopulate(val, "PrivateDNSZoneConfigs", &p.PrivateDNSZoneConfigs) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PrivateDNSZonePropertiesFormat. -func (p PrivateDNSZonePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "privateDnsZoneId", p.PrivateDNSZoneID) - populate(objectMap, "recordSets", p.RecordSets) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateDNSZonePropertiesFormat. -func (p *PrivateDNSZonePropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "privateDnsZoneId": - err = unpopulate(val, "PrivateDNSZoneID", &p.PrivateDNSZoneID) - delete(rawMsg, key) - case "recordSets": - err = unpopulate(val, "RecordSets", &p.RecordSets) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PrivateEndpoint. -func (p PrivateEndpoint) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", p.Etag) - populate(objectMap, "extendedLocation", p.ExtendedLocation) - populate(objectMap, "id", p.ID) - populate(objectMap, "location", p.Location) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "tags", p.Tags) - populate(objectMap, "type", p.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpoint. -func (p *PrivateEndpoint) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &p.Etag) - delete(rawMsg, key) - case "extendedLocation": - err = unpopulate(val, "ExtendedLocation", &p.ExtendedLocation) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &p.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &p.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &p.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnection. -func (p PrivateEndpointConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", p.Etag) - populate(objectMap, "id", p.ID) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "type", p.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnection. -func (p *PrivateEndpointConnection) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &p.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &p.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionListResult. -func (p PrivateEndpointConnectionListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", p.NextLink) - populate(objectMap, "value", p.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionListResult. -func (p *PrivateEndpointConnectionListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &p.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &p.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionProperties. -func (p PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "linkIdentifier", p.LinkIdentifier) - populate(objectMap, "privateEndpoint", p.PrivateEndpoint) - populate(objectMap, "privateLinkServiceConnectionState", p.PrivateLinkServiceConnectionState) - populate(objectMap, "provisioningState", p.ProvisioningState) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionProperties. -func (p *PrivateEndpointConnectionProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "linkIdentifier": - err = unpopulate(val, "LinkIdentifier", &p.LinkIdentifier) - delete(rawMsg, key) - case "privateEndpoint": - err = unpopulate(val, "PrivateEndpoint", &p.PrivateEndpoint) - delete(rawMsg, key) - case "privateLinkServiceConnectionState": - err = unpopulate(val, "PrivateLinkServiceConnectionState", &p.PrivateLinkServiceConnectionState) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointIPConfiguration. -func (p PrivateEndpointIPConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", p.Etag) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "type", p.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointIPConfiguration. -func (p *PrivateEndpointIPConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &p.Etag) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &p.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointIPConfigurationProperties. -func (p PrivateEndpointIPConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "groupId", p.GroupID) - populate(objectMap, "memberName", p.MemberName) - populate(objectMap, "privateIPAddress", p.PrivateIPAddress) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointIPConfigurationProperties. -func (p *PrivateEndpointIPConfigurationProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "groupId": - err = unpopulate(val, "GroupID", &p.GroupID) - delete(rawMsg, key) - case "memberName": - err = unpopulate(val, "MemberName", &p.MemberName) - delete(rawMsg, key) - case "privateIPAddress": - err = unpopulate(val, "PrivateIPAddress", &p.PrivateIPAddress) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointListResult. -func (p PrivateEndpointListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", p.NextLink) - populate(objectMap, "value", p.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointListResult. -func (p *PrivateEndpointListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &p.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &p.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointProperties. -func (p PrivateEndpointProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "applicationSecurityGroups", p.ApplicationSecurityGroups) - populate(objectMap, "customDnsConfigs", p.CustomDNSConfigs) - populate(objectMap, "customNetworkInterfaceName", p.CustomNetworkInterfaceName) - populate(objectMap, "ipConfigurations", p.IPConfigurations) - populate(objectMap, "manualPrivateLinkServiceConnections", p.ManualPrivateLinkServiceConnections) - populate(objectMap, "networkInterfaces", p.NetworkInterfaces) - populate(objectMap, "privateLinkServiceConnections", p.PrivateLinkServiceConnections) - populate(objectMap, "provisioningState", p.ProvisioningState) - populate(objectMap, "subnet", p.Subnet) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointProperties. -func (p *PrivateEndpointProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "applicationSecurityGroups": - err = unpopulate(val, "ApplicationSecurityGroups", &p.ApplicationSecurityGroups) - delete(rawMsg, key) - case "customDnsConfigs": - err = unpopulate(val, "CustomDNSConfigs", &p.CustomDNSConfigs) - delete(rawMsg, key) - case "customNetworkInterfaceName": - err = unpopulate(val, "CustomNetworkInterfaceName", &p.CustomNetworkInterfaceName) - delete(rawMsg, key) - case "ipConfigurations": - err = unpopulate(val, "IPConfigurations", &p.IPConfigurations) - delete(rawMsg, key) - case "manualPrivateLinkServiceConnections": - err = unpopulate(val, "ManualPrivateLinkServiceConnections", &p.ManualPrivateLinkServiceConnections) - delete(rawMsg, key) - case "networkInterfaces": - err = unpopulate(val, "NetworkInterfaces", &p.NetworkInterfaces) - delete(rawMsg, key) - case "privateLinkServiceConnections": - err = unpopulate(val, "PrivateLinkServiceConnections", &p.PrivateLinkServiceConnections) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) - delete(rawMsg, key) - case "subnet": - err = unpopulate(val, "Subnet", &p.Subnet) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkService. -func (p PrivateLinkService) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", p.Etag) - populate(objectMap, "extendedLocation", p.ExtendedLocation) - populate(objectMap, "id", p.ID) - populate(objectMap, "location", p.Location) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "tags", p.Tags) - populate(objectMap, "type", p.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkService. -func (p *PrivateLinkService) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &p.Etag) - delete(rawMsg, key) - case "extendedLocation": - err = unpopulate(val, "ExtendedLocation", &p.ExtendedLocation) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &p.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &p.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &p.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkServiceConnection. -func (p PrivateLinkServiceConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", p.Etag) - populate(objectMap, "id", p.ID) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "type", p.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkServiceConnection. -func (p *PrivateLinkServiceConnection) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &p.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &p.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkServiceConnectionProperties. -func (p PrivateLinkServiceConnectionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "groupIds", p.GroupIDs) - populate(objectMap, "privateLinkServiceConnectionState", p.PrivateLinkServiceConnectionState) - populate(objectMap, "privateLinkServiceId", p.PrivateLinkServiceID) - populate(objectMap, "provisioningState", p.ProvisioningState) - populate(objectMap, "requestMessage", p.RequestMessage) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkServiceConnectionProperties. -func (p *PrivateLinkServiceConnectionProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "groupIds": - err = unpopulate(val, "GroupIDs", &p.GroupIDs) - delete(rawMsg, key) - case "privateLinkServiceConnectionState": - err = unpopulate(val, "PrivateLinkServiceConnectionState", &p.PrivateLinkServiceConnectionState) - delete(rawMsg, key) - case "privateLinkServiceId": - err = unpopulate(val, "PrivateLinkServiceID", &p.PrivateLinkServiceID) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) - delete(rawMsg, key) - case "requestMessage": - err = unpopulate(val, "RequestMessage", &p.RequestMessage) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkServiceConnectionState. -func (p PrivateLinkServiceConnectionState) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "actionsRequired", p.ActionsRequired) - populate(objectMap, "description", p.Description) - populate(objectMap, "status", p.Status) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkServiceConnectionState. -func (p *PrivateLinkServiceConnectionState) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "actionsRequired": - err = unpopulate(val, "ActionsRequired", &p.ActionsRequired) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &p.Description) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &p.Status) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkServiceIPConfiguration. -func (p PrivateLinkServiceIPConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", p.Etag) - populate(objectMap, "id", p.ID) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "type", p.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkServiceIPConfiguration. -func (p *PrivateLinkServiceIPConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &p.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &p.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkServiceIPConfigurationProperties. -func (p PrivateLinkServiceIPConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "primary", p.Primary) - populate(objectMap, "privateIPAddress", p.PrivateIPAddress) - populate(objectMap, "privateIPAddressVersion", p.PrivateIPAddressVersion) - populate(objectMap, "privateIPAllocationMethod", p.PrivateIPAllocationMethod) - populate(objectMap, "provisioningState", p.ProvisioningState) - populate(objectMap, "subnet", p.Subnet) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkServiceIPConfigurationProperties. -func (p *PrivateLinkServiceIPConfigurationProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "primary": - err = unpopulate(val, "Primary", &p.Primary) - delete(rawMsg, key) - case "privateIPAddress": - err = unpopulate(val, "PrivateIPAddress", &p.PrivateIPAddress) - delete(rawMsg, key) - case "privateIPAddressVersion": - err = unpopulate(val, "PrivateIPAddressVersion", &p.PrivateIPAddressVersion) - delete(rawMsg, key) - case "privateIPAllocationMethod": - err = unpopulate(val, "PrivateIPAllocationMethod", &p.PrivateIPAllocationMethod) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) - delete(rawMsg, key) - case "subnet": - err = unpopulate(val, "Subnet", &p.Subnet) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkServiceListResult. -func (p PrivateLinkServiceListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", p.NextLink) - populate(objectMap, "value", p.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkServiceListResult. -func (p *PrivateLinkServiceListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &p.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &p.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkServiceProperties. -func (p PrivateLinkServiceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "alias", p.Alias) - populate(objectMap, "autoApproval", p.AutoApproval) - populate(objectMap, "enableProxyProtocol", p.EnableProxyProtocol) - populate(objectMap, "fqdns", p.Fqdns) - populate(objectMap, "ipConfigurations", p.IPConfigurations) - populate(objectMap, "loadBalancerFrontendIpConfigurations", p.LoadBalancerFrontendIPConfigurations) - populate(objectMap, "networkInterfaces", p.NetworkInterfaces) - populate(objectMap, "privateEndpointConnections", p.PrivateEndpointConnections) - populate(objectMap, "provisioningState", p.ProvisioningState) - populate(objectMap, "visibility", p.Visibility) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkServiceProperties. -func (p *PrivateLinkServiceProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "alias": - err = unpopulate(val, "Alias", &p.Alias) - delete(rawMsg, key) - case "autoApproval": - err = unpopulate(val, "AutoApproval", &p.AutoApproval) - delete(rawMsg, key) - case "enableProxyProtocol": - err = unpopulate(val, "EnableProxyProtocol", &p.EnableProxyProtocol) - delete(rawMsg, key) - case "fqdns": - err = unpopulate(val, "Fqdns", &p.Fqdns) - delete(rawMsg, key) - case "ipConfigurations": - err = unpopulate(val, "IPConfigurations", &p.IPConfigurations) - delete(rawMsg, key) - case "loadBalancerFrontendIpConfigurations": - err = unpopulate(val, "LoadBalancerFrontendIPConfigurations", &p.LoadBalancerFrontendIPConfigurations) - delete(rawMsg, key) - case "networkInterfaces": - err = unpopulate(val, "NetworkInterfaces", &p.NetworkInterfaces) - delete(rawMsg, key) - case "privateEndpointConnections": - err = unpopulate(val, "PrivateEndpointConnections", &p.PrivateEndpointConnections) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) - delete(rawMsg, key) - case "visibility": - err = unpopulate(val, "Visibility", &p.Visibility) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkServicePropertiesAutoApproval. -func (p PrivateLinkServicePropertiesAutoApproval) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "subscriptions", p.Subscriptions) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkServicePropertiesAutoApproval. -func (p *PrivateLinkServicePropertiesAutoApproval) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "subscriptions": - err = unpopulate(val, "Subscriptions", &p.Subscriptions) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkServicePropertiesVisibility. -func (p PrivateLinkServicePropertiesVisibility) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "subscriptions", p.Subscriptions) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkServicePropertiesVisibility. -func (p *PrivateLinkServicePropertiesVisibility) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "subscriptions": - err = unpopulate(val, "Subscriptions", &p.Subscriptions) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkServiceVisibility. -func (p PrivateLinkServiceVisibility) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "visible", p.Visible) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkServiceVisibility. -func (p *PrivateLinkServiceVisibility) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "visible": - err = unpopulate(val, "Visible", &p.Visible) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Probe. -func (p Probe) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", p.Etag) - populate(objectMap, "id", p.ID) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "type", p.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Probe. -func (p *Probe) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &p.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &p.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ProbePropertiesFormat. -func (p ProbePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "intervalInSeconds", p.IntervalInSeconds) - populate(objectMap, "loadBalancingRules", p.LoadBalancingRules) - populate(objectMap, "numberOfProbes", p.NumberOfProbes) - populate(objectMap, "port", p.Port) - populate(objectMap, "protocol", p.Protocol) - populate(objectMap, "provisioningState", p.ProvisioningState) - populate(objectMap, "requestPath", p.RequestPath) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ProbePropertiesFormat. -func (p *ProbePropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "intervalInSeconds": - err = unpopulate(val, "IntervalInSeconds", &p.IntervalInSeconds) - delete(rawMsg, key) - case "loadBalancingRules": - err = unpopulate(val, "LoadBalancingRules", &p.LoadBalancingRules) - delete(rawMsg, key) - case "numberOfProbes": - err = unpopulate(val, "NumberOfProbes", &p.NumberOfProbes) - delete(rawMsg, key) - case "port": - err = unpopulate(val, "Port", &p.Port) - delete(rawMsg, key) - case "protocol": - err = unpopulate(val, "Protocol", &p.Protocol) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) - delete(rawMsg, key) - case "requestPath": - err = unpopulate(val, "RequestPath", &p.RequestPath) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Profile. -func (p Profile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", p.Etag) - populate(objectMap, "id", p.ID) - populate(objectMap, "location", p.Location) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "tags", p.Tags) - populate(objectMap, "type", p.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Profile. -func (p *Profile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &p.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &p.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &p.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &p.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ProfileListResult. -func (p ProfileListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", p.NextLink) - populate(objectMap, "value", p.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ProfileListResult. -func (p *ProfileListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &p.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &p.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ProfilePropertiesFormat. -func (p ProfilePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "containerNetworkInterfaceConfigurations", p.ContainerNetworkInterfaceConfigurations) - populate(objectMap, "containerNetworkInterfaces", p.ContainerNetworkInterfaces) - populate(objectMap, "provisioningState", p.ProvisioningState) - populate(objectMap, "resourceGuid", p.ResourceGUID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ProfilePropertiesFormat. -func (p *ProfilePropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "containerNetworkInterfaceConfigurations": - err = unpopulate(val, "ContainerNetworkInterfaceConfigurations", &p.ContainerNetworkInterfaceConfigurations) - delete(rawMsg, key) - case "containerNetworkInterfaces": - err = unpopulate(val, "ContainerNetworkInterfaces", &p.ContainerNetworkInterfaces) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) - delete(rawMsg, key) - case "resourceGuid": - err = unpopulate(val, "ResourceGUID", &p.ResourceGUID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PropagatedRouteTable. -func (p PropagatedRouteTable) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "ids", p.IDs) - populate(objectMap, "labels", p.Labels) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PropagatedRouteTable. -func (p *PropagatedRouteTable) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "ids": - err = unpopulate(val, "IDs", &p.IDs) - delete(rawMsg, key) - case "labels": - err = unpopulate(val, "Labels", &p.Labels) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ProtocolConfiguration. -func (p ProtocolConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "HTTPConfiguration", p.HTTPConfiguration) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ProtocolConfiguration. -func (p *ProtocolConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "HTTPConfiguration": - err = unpopulate(val, "HTTPConfiguration", &p.HTTPConfiguration) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ProtocolCustomSettingsFormat. -func (p ProtocolCustomSettingsFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "protocol", p.Protocol) - populate(objectMap, "sourceRateOverride", p.SourceRateOverride) - populate(objectMap, "triggerRateOverride", p.TriggerRateOverride) - populate(objectMap, "triggerSensitivityOverride", p.TriggerSensitivityOverride) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ProtocolCustomSettingsFormat. -func (p *ProtocolCustomSettingsFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "protocol": - err = unpopulate(val, "Protocol", &p.Protocol) - delete(rawMsg, key) - case "sourceRateOverride": - err = unpopulate(val, "SourceRateOverride", &p.SourceRateOverride) - delete(rawMsg, key) - case "triggerRateOverride": - err = unpopulate(val, "TriggerRateOverride", &p.TriggerRateOverride) - delete(rawMsg, key) - case "triggerSensitivityOverride": - err = unpopulate(val, "TriggerSensitivityOverride", &p.TriggerSensitivityOverride) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PublicIPAddress. -func (p PublicIPAddress) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", p.Etag) - populate(objectMap, "extendedLocation", p.ExtendedLocation) - populate(objectMap, "id", p.ID) - populate(objectMap, "location", p.Location) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "sku", p.SKU) - populate(objectMap, "tags", p.Tags) - populate(objectMap, "type", p.Type) - populate(objectMap, "zones", p.Zones) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PublicIPAddress. -func (p *PublicIPAddress) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &p.Etag) - delete(rawMsg, key) - case "extendedLocation": - err = unpopulate(val, "ExtendedLocation", &p.ExtendedLocation) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &p.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &p.Properties) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &p.SKU) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &p.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) - delete(rawMsg, key) - case "zones": - err = unpopulate(val, "Zones", &p.Zones) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PublicIPAddressDNSSettings. -func (p PublicIPAddressDNSSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "domainNameLabel", p.DomainNameLabel) - populate(objectMap, "fqdn", p.Fqdn) - populate(objectMap, "reverseFqdn", p.ReverseFqdn) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PublicIPAddressDNSSettings. -func (p *PublicIPAddressDNSSettings) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "domainNameLabel": - err = unpopulate(val, "DomainNameLabel", &p.DomainNameLabel) - delete(rawMsg, key) - case "fqdn": - err = unpopulate(val, "Fqdn", &p.Fqdn) - delete(rawMsg, key) - case "reverseFqdn": - err = unpopulate(val, "ReverseFqdn", &p.ReverseFqdn) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PublicIPAddressListResult. -func (p PublicIPAddressListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", p.NextLink) - populate(objectMap, "value", p.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PublicIPAddressListResult. -func (p *PublicIPAddressListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &p.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &p.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PublicIPAddressPropertiesFormat. -func (p PublicIPAddressPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "dnsSettings", p.DNSSettings) - populate(objectMap, "ddosSettings", p.DdosSettings) - populate(objectMap, "deleteOption", p.DeleteOption) - populate(objectMap, "ipAddress", p.IPAddress) - populate(objectMap, "ipConfiguration", p.IPConfiguration) - populate(objectMap, "ipTags", p.IPTags) - populate(objectMap, "idleTimeoutInMinutes", p.IdleTimeoutInMinutes) - populate(objectMap, "linkedPublicIPAddress", p.LinkedPublicIPAddress) - populate(objectMap, "migrationPhase", p.MigrationPhase) - populate(objectMap, "natGateway", p.NatGateway) - populate(objectMap, "provisioningState", p.ProvisioningState) - populate(objectMap, "publicIPAddressVersion", p.PublicIPAddressVersion) - populate(objectMap, "publicIPAllocationMethod", p.PublicIPAllocationMethod) - populate(objectMap, "publicIPPrefix", p.PublicIPPrefix) - populate(objectMap, "resourceGuid", p.ResourceGUID) - populate(objectMap, "servicePublicIPAddress", p.ServicePublicIPAddress) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PublicIPAddressPropertiesFormat. -func (p *PublicIPAddressPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "dnsSettings": - err = unpopulate(val, "DNSSettings", &p.DNSSettings) - delete(rawMsg, key) - case "ddosSettings": - err = unpopulate(val, "DdosSettings", &p.DdosSettings) - delete(rawMsg, key) - case "deleteOption": - err = unpopulate(val, "DeleteOption", &p.DeleteOption) - delete(rawMsg, key) - case "ipAddress": - err = unpopulate(val, "IPAddress", &p.IPAddress) - delete(rawMsg, key) - case "ipConfiguration": - err = unpopulate(val, "IPConfiguration", &p.IPConfiguration) - delete(rawMsg, key) - case "ipTags": - err = unpopulate(val, "IPTags", &p.IPTags) - delete(rawMsg, key) - case "idleTimeoutInMinutes": - err = unpopulate(val, "IdleTimeoutInMinutes", &p.IdleTimeoutInMinutes) - delete(rawMsg, key) - case "linkedPublicIPAddress": - err = unpopulate(val, "LinkedPublicIPAddress", &p.LinkedPublicIPAddress) - delete(rawMsg, key) - case "migrationPhase": - err = unpopulate(val, "MigrationPhase", &p.MigrationPhase) - delete(rawMsg, key) - case "natGateway": - err = unpopulate(val, "NatGateway", &p.NatGateway) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) - delete(rawMsg, key) - case "publicIPAddressVersion": - err = unpopulate(val, "PublicIPAddressVersion", &p.PublicIPAddressVersion) - delete(rawMsg, key) - case "publicIPAllocationMethod": - err = unpopulate(val, "PublicIPAllocationMethod", &p.PublicIPAllocationMethod) - delete(rawMsg, key) - case "publicIPPrefix": - err = unpopulate(val, "PublicIPPrefix", &p.PublicIPPrefix) - delete(rawMsg, key) - case "resourceGuid": - err = unpopulate(val, "ResourceGUID", &p.ResourceGUID) - delete(rawMsg, key) - case "servicePublicIPAddress": - err = unpopulate(val, "ServicePublicIPAddress", &p.ServicePublicIPAddress) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PublicIPAddressSKU. -func (p PublicIPAddressSKU) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "name", p.Name) - populate(objectMap, "tier", p.Tier) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PublicIPAddressSKU. -func (p *PublicIPAddressSKU) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "tier": - err = unpopulate(val, "Tier", &p.Tier) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PublicIPPrefix. -func (p PublicIPPrefix) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", p.Etag) - populate(objectMap, "extendedLocation", p.ExtendedLocation) - populate(objectMap, "id", p.ID) - populate(objectMap, "location", p.Location) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "sku", p.SKU) - populate(objectMap, "tags", p.Tags) - populate(objectMap, "type", p.Type) - populate(objectMap, "zones", p.Zones) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PublicIPPrefix. -func (p *PublicIPPrefix) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &p.Etag) - delete(rawMsg, key) - case "extendedLocation": - err = unpopulate(val, "ExtendedLocation", &p.ExtendedLocation) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &p.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &p.Properties) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &p.SKU) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &p.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) - delete(rawMsg, key) - case "zones": - err = unpopulate(val, "Zones", &p.Zones) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PublicIPPrefixListResult. -func (p PublicIPPrefixListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", p.NextLink) - populate(objectMap, "value", p.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PublicIPPrefixListResult. -func (p *PublicIPPrefixListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &p.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &p.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PublicIPPrefixPropertiesFormat. -func (p PublicIPPrefixPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "customIPPrefix", p.CustomIPPrefix) - populate(objectMap, "ipPrefix", p.IPPrefix) - populate(objectMap, "ipTags", p.IPTags) - populate(objectMap, "loadBalancerFrontendIpConfiguration", p.LoadBalancerFrontendIPConfiguration) - populate(objectMap, "natGateway", p.NatGateway) - populate(objectMap, "prefixLength", p.PrefixLength) - populate(objectMap, "provisioningState", p.ProvisioningState) - populate(objectMap, "publicIPAddressVersion", p.PublicIPAddressVersion) - populate(objectMap, "publicIPAddresses", p.PublicIPAddresses) - populate(objectMap, "resourceGuid", p.ResourceGUID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PublicIPPrefixPropertiesFormat. -func (p *PublicIPPrefixPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "customIPPrefix": - err = unpopulate(val, "CustomIPPrefix", &p.CustomIPPrefix) - delete(rawMsg, key) - case "ipPrefix": - err = unpopulate(val, "IPPrefix", &p.IPPrefix) - delete(rawMsg, key) - case "ipTags": - err = unpopulate(val, "IPTags", &p.IPTags) - delete(rawMsg, key) - case "loadBalancerFrontendIpConfiguration": - err = unpopulate(val, "LoadBalancerFrontendIPConfiguration", &p.LoadBalancerFrontendIPConfiguration) - delete(rawMsg, key) - case "natGateway": - err = unpopulate(val, "NatGateway", &p.NatGateway) - delete(rawMsg, key) - case "prefixLength": - err = unpopulate(val, "PrefixLength", &p.PrefixLength) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) - delete(rawMsg, key) - case "publicIPAddressVersion": - err = unpopulate(val, "PublicIPAddressVersion", &p.PublicIPAddressVersion) - delete(rawMsg, key) - case "publicIPAddresses": - err = unpopulate(val, "PublicIPAddresses", &p.PublicIPAddresses) - delete(rawMsg, key) - case "resourceGuid": - err = unpopulate(val, "ResourceGUID", &p.ResourceGUID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PublicIPPrefixSKU. -func (p PublicIPPrefixSKU) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "name", p.Name) - populate(objectMap, "tier", p.Tier) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PublicIPPrefixSKU. -func (p *PublicIPPrefixSKU) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "tier": - err = unpopulate(val, "Tier", &p.Tier) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type QosDefinition. -func (q QosDefinition) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "destinationIpRanges", q.DestinationIPRanges) - populate(objectMap, "destinationPortRanges", q.DestinationPortRanges) - populate(objectMap, "markings", q.Markings) - populate(objectMap, "protocol", q.Protocol) - populate(objectMap, "sourceIpRanges", q.SourceIPRanges) - populate(objectMap, "sourcePortRanges", q.SourcePortRanges) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type QosDefinition. -func (q *QosDefinition) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", q, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "destinationIpRanges": - err = unpopulate(val, "DestinationIPRanges", &q.DestinationIPRanges) - delete(rawMsg, key) - case "destinationPortRanges": - err = unpopulate(val, "DestinationPortRanges", &q.DestinationPortRanges) - delete(rawMsg, key) - case "markings": - err = unpopulate(val, "Markings", &q.Markings) - delete(rawMsg, key) - case "protocol": - err = unpopulate(val, "Protocol", &q.Protocol) - delete(rawMsg, key) - case "sourceIpRanges": - err = unpopulate(val, "SourceIPRanges", &q.SourceIPRanges) - delete(rawMsg, key) - case "sourcePortRanges": - err = unpopulate(val, "SourcePortRanges", &q.SourcePortRanges) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", q, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type QosIPRange. -func (q QosIPRange) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "endIP", q.EndIP) - populate(objectMap, "startIP", q.StartIP) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type QosIPRange. -func (q *QosIPRange) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", q, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "endIP": - err = unpopulate(val, "EndIP", &q.EndIP) - delete(rawMsg, key) - case "startIP": - err = unpopulate(val, "StartIP", &q.StartIP) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", q, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type QosPortRange. -func (q QosPortRange) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "end", q.End) - populate(objectMap, "start", q.Start) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type QosPortRange. -func (q *QosPortRange) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", q, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "end": - err = unpopulate(val, "End", &q.End) - delete(rawMsg, key) - case "start": - err = unpopulate(val, "Start", &q.Start) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", q, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type QueryInboundNatRulePortMappingRequest. -func (q QueryInboundNatRulePortMappingRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "ipAddress", q.IPAddress) - populate(objectMap, "ipConfiguration", q.IPConfiguration) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type QueryInboundNatRulePortMappingRequest. -func (q *QueryInboundNatRulePortMappingRequest) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", q, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "ipAddress": - err = unpopulate(val, "IPAddress", &q.IPAddress) - delete(rawMsg, key) - case "ipConfiguration": - err = unpopulate(val, "IPConfiguration", &q.IPConfiguration) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", q, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type QueryRequestOptions. -func (q QueryRequestOptions) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "skipToken", q.SkipToken) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type QueryRequestOptions. -func (q *QueryRequestOptions) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", q, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "skipToken": - err = unpopulate(val, "SkipToken", &q.SkipToken) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", q, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type QueryResults. -func (q QueryResults) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "matchingRecordsCount", q.MatchingRecordsCount) - populate(objectMap, "signatures", q.Signatures) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type QueryResults. -func (q *QueryResults) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", q, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "matchingRecordsCount": - err = unpopulate(val, "MatchingRecordsCount", &q.MatchingRecordsCount) - delete(rawMsg, key) - case "signatures": - err = unpopulate(val, "Signatures", &q.Signatures) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", q, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type QueryTroubleshootingParameters. -func (q QueryTroubleshootingParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "targetResourceId", q.TargetResourceID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type QueryTroubleshootingParameters. -func (q *QueryTroubleshootingParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", q, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "targetResourceId": - err = unpopulate(val, "TargetResourceID", &q.TargetResourceID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", q, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RadiusServer. -func (r RadiusServer) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "radiusServerAddress", r.RadiusServerAddress) - populate(objectMap, "radiusServerScore", r.RadiusServerScore) - populate(objectMap, "radiusServerSecret", r.RadiusServerSecret) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RadiusServer. -func (r *RadiusServer) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "radiusServerAddress": - err = unpopulate(val, "RadiusServerAddress", &r.RadiusServerAddress) - delete(rawMsg, key) - case "radiusServerScore": - err = unpopulate(val, "RadiusServerScore", &r.RadiusServerScore) - delete(rawMsg, key) - case "radiusServerSecret": - err = unpopulate(val, "RadiusServerSecret", &r.RadiusServerSecret) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RecordSet. -func (r RecordSet) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "fqdn", r.Fqdn) - populate(objectMap, "ipAddresses", r.IPAddresses) - populate(objectMap, "provisioningState", r.ProvisioningState) - populate(objectMap, "recordSetName", r.RecordSetName) - populate(objectMap, "recordType", r.RecordType) - populate(objectMap, "ttl", r.TTL) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RecordSet. -func (r *RecordSet) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "fqdn": - err = unpopulate(val, "Fqdn", &r.Fqdn) - delete(rawMsg, key) - case "ipAddresses": - err = unpopulate(val, "IPAddresses", &r.IPAddresses) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &r.ProvisioningState) - delete(rawMsg, key) - case "recordSetName": - err = unpopulate(val, "RecordSetName", &r.RecordSetName) - delete(rawMsg, key) - case "recordType": - err = unpopulate(val, "RecordType", &r.RecordType) - delete(rawMsg, key) - case "ttl": - err = unpopulate(val, "TTL", &r.TTL) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ReferencedPublicIPAddress. -func (r ReferencedPublicIPAddress) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", r.ID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ReferencedPublicIPAddress. -func (r *ReferencedPublicIPAddress) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &r.ID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Resource. -func (r Resource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", r.ID) - populate(objectMap, "location", r.Location) - populate(objectMap, "name", r.Name) - populate(objectMap, "tags", r.Tags) - populate(objectMap, "type", r.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Resource. -func (r *Resource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &r.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &r.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &r.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ResourceNavigationLink. -func (r ResourceNavigationLink) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", r.Etag) - populate(objectMap, "id", r.ID) - populate(objectMap, "name", r.Name) - populate(objectMap, "properties", r.Properties) - populate(objectMap, "type", r.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceNavigationLink. -func (r *ResourceNavigationLink) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &r.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &r.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &r.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ResourceNavigationLinkFormat. -func (r ResourceNavigationLinkFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "link", r.Link) - populate(objectMap, "linkedResourceType", r.LinkedResourceType) - populate(objectMap, "provisioningState", r.ProvisioningState) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceNavigationLinkFormat. -func (r *ResourceNavigationLinkFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "link": - err = unpopulate(val, "Link", &r.Link) - delete(rawMsg, key) - case "linkedResourceType": - err = unpopulate(val, "LinkedResourceType", &r.LinkedResourceType) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &r.ProvisioningState) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ResourceNavigationLinksListResult. -func (r ResourceNavigationLinksListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", r.NextLink) - populate(objectMap, "value", r.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceNavigationLinksListResult. -func (r *ResourceNavigationLinksListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &r.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &r.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ResourceSet. -func (r ResourceSet) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "subscriptions", r.Subscriptions) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSet. -func (r *ResourceSet) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "subscriptions": - err = unpopulate(val, "Subscriptions", &r.Subscriptions) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RetentionPolicyParameters. -func (r RetentionPolicyParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "days", r.Days) - populate(objectMap, "enabled", r.Enabled) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RetentionPolicyParameters. -func (r *RetentionPolicyParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "days": - err = unpopulate(val, "Days", &r.Days) - delete(rawMsg, key) - case "enabled": - err = unpopulate(val, "Enabled", &r.Enabled) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Route. -func (r Route) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", r.Etag) - populate(objectMap, "id", r.ID) - populate(objectMap, "name", r.Name) - populate(objectMap, "properties", r.Properties) - populate(objectMap, "type", r.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Route. -func (r *Route) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &r.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &r.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &r.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RouteFilter. -func (r RouteFilter) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", r.Etag) - populate(objectMap, "id", r.ID) - populate(objectMap, "location", r.Location) - populate(objectMap, "name", r.Name) - populate(objectMap, "properties", r.Properties) - populate(objectMap, "tags", r.Tags) - populate(objectMap, "type", r.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RouteFilter. -func (r *RouteFilter) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &r.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &r.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &r.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &r.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &r.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RouteFilterListResult. -func (r RouteFilterListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", r.NextLink) - populate(objectMap, "value", r.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RouteFilterListResult. -func (r *RouteFilterListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &r.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &r.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RouteFilterPropertiesFormat. -func (r RouteFilterPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "ipv6Peerings", r.IPv6Peerings) - populate(objectMap, "peerings", r.Peerings) - populate(objectMap, "provisioningState", r.ProvisioningState) - populate(objectMap, "rules", r.Rules) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RouteFilterPropertiesFormat. -func (r *RouteFilterPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "ipv6Peerings": - err = unpopulate(val, "IPv6Peerings", &r.IPv6Peerings) - delete(rawMsg, key) - case "peerings": - err = unpopulate(val, "Peerings", &r.Peerings) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &r.ProvisioningState) - delete(rawMsg, key) - case "rules": - err = unpopulate(val, "Rules", &r.Rules) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RouteFilterRule. -func (r RouteFilterRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", r.Etag) - populate(objectMap, "id", r.ID) - populate(objectMap, "location", r.Location) - populate(objectMap, "name", r.Name) - populate(objectMap, "properties", r.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RouteFilterRule. -func (r *RouteFilterRule) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &r.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &r.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &r.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &r.Properties) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RouteFilterRuleListResult. -func (r RouteFilterRuleListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", r.NextLink) - populate(objectMap, "value", r.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RouteFilterRuleListResult. -func (r *RouteFilterRuleListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &r.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &r.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RouteFilterRulePropertiesFormat. -func (r RouteFilterRulePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "access", r.Access) - populate(objectMap, "communities", r.Communities) - populate(objectMap, "provisioningState", r.ProvisioningState) - populate(objectMap, "routeFilterRuleType", r.RouteFilterRuleType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RouteFilterRulePropertiesFormat. -func (r *RouteFilterRulePropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "access": - err = unpopulate(val, "Access", &r.Access) - delete(rawMsg, key) - case "communities": - err = unpopulate(val, "Communities", &r.Communities) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &r.ProvisioningState) - delete(rawMsg, key) - case "routeFilterRuleType": - err = unpopulate(val, "RouteFilterRuleType", &r.RouteFilterRuleType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RouteListResult. -func (r RouteListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", r.NextLink) - populate(objectMap, "value", r.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RouteListResult. -func (r *RouteListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &r.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &r.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RoutePropertiesFormat. -func (r RoutePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "addressPrefix", r.AddressPrefix) - populate(objectMap, "hasBgpOverride", r.HasBgpOverride) - populate(objectMap, "nextHopIpAddress", r.NextHopIPAddress) - populate(objectMap, "nextHopType", r.NextHopType) - populate(objectMap, "provisioningState", r.ProvisioningState) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RoutePropertiesFormat. -func (r *RoutePropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "addressPrefix": - err = unpopulate(val, "AddressPrefix", &r.AddressPrefix) - delete(rawMsg, key) - case "hasBgpOverride": - err = unpopulate(val, "HasBgpOverride", &r.HasBgpOverride) - delete(rawMsg, key) - case "nextHopIpAddress": - err = unpopulate(val, "NextHopIPAddress", &r.NextHopIPAddress) - delete(rawMsg, key) - case "nextHopType": - err = unpopulate(val, "NextHopType", &r.NextHopType) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &r.ProvisioningState) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RouteTable. -func (r RouteTable) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", r.Etag) - populate(objectMap, "id", r.ID) - populate(objectMap, "location", r.Location) - populate(objectMap, "name", r.Name) - populate(objectMap, "properties", r.Properties) - populate(objectMap, "tags", r.Tags) - populate(objectMap, "type", r.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RouteTable. -func (r *RouteTable) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &r.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &r.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &r.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &r.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &r.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RouteTableListResult. -func (r RouteTableListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", r.NextLink) - populate(objectMap, "value", r.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RouteTableListResult. -func (r *RouteTableListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &r.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &r.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RouteTablePropertiesFormat. -func (r RouteTablePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "disableBgpRoutePropagation", r.DisableBgpRoutePropagation) - populate(objectMap, "provisioningState", r.ProvisioningState) - populate(objectMap, "resourceGuid", r.ResourceGUID) - populate(objectMap, "routes", r.Routes) - populate(objectMap, "subnets", r.Subnets) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RouteTablePropertiesFormat. -func (r *RouteTablePropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "disableBgpRoutePropagation": - err = unpopulate(val, "DisableBgpRoutePropagation", &r.DisableBgpRoutePropagation) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &r.ProvisioningState) - delete(rawMsg, key) - case "resourceGuid": - err = unpopulate(val, "ResourceGUID", &r.ResourceGUID) - delete(rawMsg, key) - case "routes": - err = unpopulate(val, "Routes", &r.Routes) - delete(rawMsg, key) - case "subnets": - err = unpopulate(val, "Subnets", &r.Subnets) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RoutingConfiguration. -func (r RoutingConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "associatedRouteTable", r.AssociatedRouteTable) - populate(objectMap, "propagatedRouteTables", r.PropagatedRouteTables) - populate(objectMap, "vnetRoutes", r.VnetRoutes) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RoutingConfiguration. -func (r *RoutingConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "associatedRouteTable": - err = unpopulate(val, "AssociatedRouteTable", &r.AssociatedRouteTable) - delete(rawMsg, key) - case "propagatedRouteTables": - err = unpopulate(val, "PropagatedRouteTables", &r.PropagatedRouteTables) - delete(rawMsg, key) - case "vnetRoutes": - err = unpopulate(val, "VnetRoutes", &r.VnetRoutes) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RoutingIntent. -func (r RoutingIntent) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", r.Etag) - populate(objectMap, "id", r.ID) - populate(objectMap, "name", r.Name) - populate(objectMap, "properties", r.Properties) - populate(objectMap, "type", r.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RoutingIntent. -func (r *RoutingIntent) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &r.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &r.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &r.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RoutingIntentProperties. -func (r RoutingIntentProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "provisioningState", r.ProvisioningState) - populate(objectMap, "routingPolicies", r.RoutingPolicies) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RoutingIntentProperties. -func (r *RoutingIntentProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &r.ProvisioningState) - delete(rawMsg, key) - case "routingPolicies": - err = unpopulate(val, "RoutingPolicies", &r.RoutingPolicies) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RoutingPolicy. -func (r RoutingPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "destinations", r.Destinations) - populate(objectMap, "name", r.Name) - populate(objectMap, "nextHop", r.NextHop) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RoutingPolicy. -func (r *RoutingPolicy) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "destinations": - err = unpopulate(val, "Destinations", &r.Destinations) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - case "nextHop": - err = unpopulate(val, "NextHop", &r.NextHop) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Rule. -func (r Rule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "description", r.Description) - populate(objectMap, "destinationAddresses", r.DestinationAddresses) - populate(objectMap, "destinationFqdns", r.DestinationFqdns) - populate(objectMap, "destinationIpGroups", r.DestinationIPGroups) - populate(objectMap, "destinationPorts", r.DestinationPorts) - populate(objectMap, "ipProtocols", r.IPProtocols) - populate(objectMap, "name", r.Name) - objectMap["ruleType"] = FirewallPolicyRuleTypeNetworkRule - populate(objectMap, "sourceAddresses", r.SourceAddresses) - populate(objectMap, "sourceIpGroups", r.SourceIPGroups) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Rule. -func (r *Rule) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "description": - err = unpopulate(val, "Description", &r.Description) - delete(rawMsg, key) - case "destinationAddresses": - err = unpopulate(val, "DestinationAddresses", &r.DestinationAddresses) - delete(rawMsg, key) - case "destinationFqdns": - err = unpopulate(val, "DestinationFqdns", &r.DestinationFqdns) - delete(rawMsg, key) - case "destinationIpGroups": - err = unpopulate(val, "DestinationIPGroups", &r.DestinationIPGroups) - delete(rawMsg, key) - case "destinationPorts": - err = unpopulate(val, "DestinationPorts", &r.DestinationPorts) - delete(rawMsg, key) - case "ipProtocols": - err = unpopulate(val, "IPProtocols", &r.IPProtocols) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - case "ruleType": - err = unpopulate(val, "RuleType", &r.RuleType) - delete(rawMsg, key) - case "sourceAddresses": - err = unpopulate(val, "SourceAddresses", &r.SourceAddresses) - delete(rawMsg, key) - case "sourceIpGroups": - err = unpopulate(val, "SourceIPGroups", &r.SourceIPGroups) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SKU. -func (s SKU) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "name", s.Name) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SKU. -func (s *SKU) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &s.Name) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ScopeConnection. -func (s ScopeConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", s.Etag) - populate(objectMap, "id", s.ID) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "systemData", s.SystemData) - populate(objectMap, "type", s.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ScopeConnection. -func (s *ScopeConnection) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &s.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &s.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &s.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &s.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &s.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &s.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ScopeConnectionListResult. -func (s ScopeConnectionListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", s.NextLink) - populate(objectMap, "value", s.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ScopeConnectionListResult. -func (s *ScopeConnectionListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &s.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &s.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ScopeConnectionProperties. -func (s ScopeConnectionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "connectionState", s.ConnectionState) - populate(objectMap, "description", s.Description) - populate(objectMap, "resourceId", s.ResourceID) - populate(objectMap, "tenantId", s.TenantID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ScopeConnectionProperties. -func (s *ScopeConnectionProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "connectionState": - err = unpopulate(val, "ConnectionState", &s.ConnectionState) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &s.Description) - delete(rawMsg, key) - case "resourceId": - err = unpopulate(val, "ResourceID", &s.ResourceID) - delete(rawMsg, key) - case "tenantId": - err = unpopulate(val, "TenantID", &s.TenantID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SecurityAdminConfiguration. -func (s SecurityAdminConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", s.Etag) - populate(objectMap, "id", s.ID) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "systemData", s.SystemData) - populate(objectMap, "type", s.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityAdminConfiguration. -func (s *SecurityAdminConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &s.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &s.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &s.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &s.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &s.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &s.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SecurityAdminConfigurationListResult. -func (s SecurityAdminConfigurationListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", s.NextLink) - populate(objectMap, "value", s.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityAdminConfigurationListResult. -func (s *SecurityAdminConfigurationListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &s.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &s.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SecurityAdminConfigurationPropertiesFormat. -func (s SecurityAdminConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "applyOnNetworkIntentPolicyBasedServices", s.ApplyOnNetworkIntentPolicyBasedServices) - populate(objectMap, "description", s.Description) - populate(objectMap, "provisioningState", s.ProvisioningState) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityAdminConfigurationPropertiesFormat. -func (s *SecurityAdminConfigurationPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "applyOnNetworkIntentPolicyBasedServices": - err = unpopulate(val, "ApplyOnNetworkIntentPolicyBasedServices", &s.ApplyOnNetworkIntentPolicyBasedServices) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &s.Description) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SecurityGroup. -func (s SecurityGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", s.Etag) - populate(objectMap, "id", s.ID) - populate(objectMap, "location", s.Location) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "tags", s.Tags) - populate(objectMap, "type", s.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityGroup. -func (s *SecurityGroup) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &s.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &s.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &s.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &s.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &s.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &s.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &s.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SecurityGroupListResult. -func (s SecurityGroupListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", s.NextLink) - populate(objectMap, "value", s.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityGroupListResult. -func (s *SecurityGroupListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &s.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &s.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SecurityGroupNetworkInterface. -func (s SecurityGroupNetworkInterface) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", s.ID) - populate(objectMap, "securityRuleAssociations", s.SecurityRuleAssociations) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityGroupNetworkInterface. -func (s *SecurityGroupNetworkInterface) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &s.ID) - delete(rawMsg, key) - case "securityRuleAssociations": - err = unpopulate(val, "SecurityRuleAssociations", &s.SecurityRuleAssociations) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SecurityGroupPropertiesFormat. -func (s SecurityGroupPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "defaultSecurityRules", s.DefaultSecurityRules) - populate(objectMap, "flowLogs", s.FlowLogs) - populate(objectMap, "flushConnection", s.FlushConnection) - populate(objectMap, "networkInterfaces", s.NetworkInterfaces) - populate(objectMap, "provisioningState", s.ProvisioningState) - populate(objectMap, "resourceGuid", s.ResourceGUID) - populate(objectMap, "securityRules", s.SecurityRules) - populate(objectMap, "subnets", s.Subnets) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityGroupPropertiesFormat. -func (s *SecurityGroupPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "defaultSecurityRules": - err = unpopulate(val, "DefaultSecurityRules", &s.DefaultSecurityRules) - delete(rawMsg, key) - case "flowLogs": - err = unpopulate(val, "FlowLogs", &s.FlowLogs) - delete(rawMsg, key) - case "flushConnection": - err = unpopulate(val, "FlushConnection", &s.FlushConnection) - delete(rawMsg, key) - case "networkInterfaces": - err = unpopulate(val, "NetworkInterfaces", &s.NetworkInterfaces) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) - delete(rawMsg, key) - case "resourceGuid": - err = unpopulate(val, "ResourceGUID", &s.ResourceGUID) - delete(rawMsg, key) - case "securityRules": - err = unpopulate(val, "SecurityRules", &s.SecurityRules) - delete(rawMsg, key) - case "subnets": - err = unpopulate(val, "Subnets", &s.Subnets) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SecurityGroupResult. -func (s SecurityGroupResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "evaluatedNetworkSecurityGroups", s.EvaluatedNetworkSecurityGroups) - populate(objectMap, "securityRuleAccessResult", s.SecurityRuleAccessResult) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityGroupResult. -func (s *SecurityGroupResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "evaluatedNetworkSecurityGroups": - err = unpopulate(val, "EvaluatedNetworkSecurityGroups", &s.EvaluatedNetworkSecurityGroups) - delete(rawMsg, key) - case "securityRuleAccessResult": - err = unpopulate(val, "SecurityRuleAccessResult", &s.SecurityRuleAccessResult) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SecurityGroupViewParameters. -func (s SecurityGroupViewParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "targetResourceId", s.TargetResourceID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityGroupViewParameters. -func (s *SecurityGroupViewParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "targetResourceId": - err = unpopulate(val, "TargetResourceID", &s.TargetResourceID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SecurityGroupViewResult. -func (s SecurityGroupViewResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "networkInterfaces", s.NetworkInterfaces) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityGroupViewResult. -func (s *SecurityGroupViewResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "networkInterfaces": - err = unpopulate(val, "NetworkInterfaces", &s.NetworkInterfaces) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SecurityPartnerProvider. -func (s SecurityPartnerProvider) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", s.Etag) - populate(objectMap, "id", s.ID) - populate(objectMap, "location", s.Location) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "tags", s.Tags) - populate(objectMap, "type", s.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityPartnerProvider. -func (s *SecurityPartnerProvider) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &s.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &s.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &s.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &s.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &s.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &s.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &s.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SecurityPartnerProviderListResult. -func (s SecurityPartnerProviderListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", s.NextLink) - populate(objectMap, "value", s.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityPartnerProviderListResult. -func (s *SecurityPartnerProviderListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &s.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &s.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SecurityPartnerProviderPropertiesFormat. -func (s SecurityPartnerProviderPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "connectionStatus", s.ConnectionStatus) - populate(objectMap, "provisioningState", s.ProvisioningState) - populate(objectMap, "securityProviderName", s.SecurityProviderName) - populate(objectMap, "virtualHub", s.VirtualHub) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityPartnerProviderPropertiesFormat. -func (s *SecurityPartnerProviderPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "connectionStatus": - err = unpopulate(val, "ConnectionStatus", &s.ConnectionStatus) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) - delete(rawMsg, key) - case "securityProviderName": - err = unpopulate(val, "SecurityProviderName", &s.SecurityProviderName) - delete(rawMsg, key) - case "virtualHub": - err = unpopulate(val, "VirtualHub", &s.VirtualHub) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SecurityRule. -func (s SecurityRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", s.Etag) - populate(objectMap, "id", s.ID) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "type", s.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityRule. -func (s *SecurityRule) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &s.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &s.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &s.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &s.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &s.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SecurityRuleAssociations. -func (s SecurityRuleAssociations) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "defaultSecurityRules", s.DefaultSecurityRules) - populate(objectMap, "effectiveSecurityRules", s.EffectiveSecurityRules) - populate(objectMap, "networkInterfaceAssociation", s.NetworkInterfaceAssociation) - populate(objectMap, "subnetAssociation", s.SubnetAssociation) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityRuleAssociations. -func (s *SecurityRuleAssociations) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "defaultSecurityRules": - err = unpopulate(val, "DefaultSecurityRules", &s.DefaultSecurityRules) - delete(rawMsg, key) - case "effectiveSecurityRules": - err = unpopulate(val, "EffectiveSecurityRules", &s.EffectiveSecurityRules) - delete(rawMsg, key) - case "networkInterfaceAssociation": - err = unpopulate(val, "NetworkInterfaceAssociation", &s.NetworkInterfaceAssociation) - delete(rawMsg, key) - case "subnetAssociation": - err = unpopulate(val, "SubnetAssociation", &s.SubnetAssociation) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SecurityRuleListResult. -func (s SecurityRuleListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", s.NextLink) - populate(objectMap, "value", s.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityRuleListResult. -func (s *SecurityRuleListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &s.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &s.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SecurityRulePropertiesFormat. -func (s SecurityRulePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "access", s.Access) - populate(objectMap, "description", s.Description) - populate(objectMap, "destinationAddressPrefix", s.DestinationAddressPrefix) - populate(objectMap, "destinationAddressPrefixes", s.DestinationAddressPrefixes) - populate(objectMap, "destinationApplicationSecurityGroups", s.DestinationApplicationSecurityGroups) - populate(objectMap, "destinationPortRange", s.DestinationPortRange) - populate(objectMap, "destinationPortRanges", s.DestinationPortRanges) - populate(objectMap, "direction", s.Direction) - populate(objectMap, "priority", s.Priority) - populate(objectMap, "protocol", s.Protocol) - populate(objectMap, "provisioningState", s.ProvisioningState) - populate(objectMap, "sourceAddressPrefix", s.SourceAddressPrefix) - populate(objectMap, "sourceAddressPrefixes", s.SourceAddressPrefixes) - populate(objectMap, "sourceApplicationSecurityGroups", s.SourceApplicationSecurityGroups) - populate(objectMap, "sourcePortRange", s.SourcePortRange) - populate(objectMap, "sourcePortRanges", s.SourcePortRanges) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityRulePropertiesFormat. -func (s *SecurityRulePropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "access": - err = unpopulate(val, "Access", &s.Access) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &s.Description) - delete(rawMsg, key) - case "destinationAddressPrefix": - err = unpopulate(val, "DestinationAddressPrefix", &s.DestinationAddressPrefix) - delete(rawMsg, key) - case "destinationAddressPrefixes": - err = unpopulate(val, "DestinationAddressPrefixes", &s.DestinationAddressPrefixes) - delete(rawMsg, key) - case "destinationApplicationSecurityGroups": - err = unpopulate(val, "DestinationApplicationSecurityGroups", &s.DestinationApplicationSecurityGroups) - delete(rawMsg, key) - case "destinationPortRange": - err = unpopulate(val, "DestinationPortRange", &s.DestinationPortRange) - delete(rawMsg, key) - case "destinationPortRanges": - err = unpopulate(val, "DestinationPortRanges", &s.DestinationPortRanges) - delete(rawMsg, key) - case "direction": - err = unpopulate(val, "Direction", &s.Direction) - delete(rawMsg, key) - case "priority": - err = unpopulate(val, "Priority", &s.Priority) - delete(rawMsg, key) - case "protocol": - err = unpopulate(val, "Protocol", &s.Protocol) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) - delete(rawMsg, key) - case "sourceAddressPrefix": - err = unpopulate(val, "SourceAddressPrefix", &s.SourceAddressPrefix) - delete(rawMsg, key) - case "sourceAddressPrefixes": - err = unpopulate(val, "SourceAddressPrefixes", &s.SourceAddressPrefixes) - delete(rawMsg, key) - case "sourceApplicationSecurityGroups": - err = unpopulate(val, "SourceApplicationSecurityGroups", &s.SourceApplicationSecurityGroups) - delete(rawMsg, key) - case "sourcePortRange": - err = unpopulate(val, "SourcePortRange", &s.SourcePortRange) - delete(rawMsg, key) - case "sourcePortRanges": - err = unpopulate(val, "SourcePortRanges", &s.SourcePortRanges) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SecurityRulesEvaluationResult. -func (s SecurityRulesEvaluationResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "destinationMatched", s.DestinationMatched) - populate(objectMap, "destinationPortMatched", s.DestinationPortMatched) - populate(objectMap, "name", s.Name) - populate(objectMap, "protocolMatched", s.ProtocolMatched) - populate(objectMap, "sourceMatched", s.SourceMatched) - populate(objectMap, "sourcePortMatched", s.SourcePortMatched) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityRulesEvaluationResult. -func (s *SecurityRulesEvaluationResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "destinationMatched": - err = unpopulate(val, "DestinationMatched", &s.DestinationMatched) - delete(rawMsg, key) - case "destinationPortMatched": - err = unpopulate(val, "DestinationPortMatched", &s.DestinationPortMatched) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &s.Name) - delete(rawMsg, key) - case "protocolMatched": - err = unpopulate(val, "ProtocolMatched", &s.ProtocolMatched) - delete(rawMsg, key) - case "sourceMatched": - err = unpopulate(val, "SourceMatched", &s.SourceMatched) - delete(rawMsg, key) - case "sourcePortMatched": - err = unpopulate(val, "SourcePortMatched", &s.SourcePortMatched) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ServiceAssociationLink. -func (s ServiceAssociationLink) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", s.Etag) - populate(objectMap, "id", s.ID) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "type", s.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceAssociationLink. -func (s *ServiceAssociationLink) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &s.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &s.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &s.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &s.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &s.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ServiceAssociationLinkPropertiesFormat. -func (s ServiceAssociationLinkPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "allowDelete", s.AllowDelete) - populate(objectMap, "link", s.Link) - populate(objectMap, "linkedResourceType", s.LinkedResourceType) - populate(objectMap, "locations", s.Locations) - populate(objectMap, "provisioningState", s.ProvisioningState) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceAssociationLinkPropertiesFormat. -func (s *ServiceAssociationLinkPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "allowDelete": - err = unpopulate(val, "AllowDelete", &s.AllowDelete) - delete(rawMsg, key) - case "link": - err = unpopulate(val, "Link", &s.Link) - delete(rawMsg, key) - case "linkedResourceType": - err = unpopulate(val, "LinkedResourceType", &s.LinkedResourceType) - delete(rawMsg, key) - case "locations": - err = unpopulate(val, "Locations", &s.Locations) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ServiceAssociationLinksListResult. -func (s ServiceAssociationLinksListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", s.NextLink) - populate(objectMap, "value", s.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceAssociationLinksListResult. -func (s *ServiceAssociationLinksListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &s.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &s.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ServiceDelegationPropertiesFormat. -func (s ServiceDelegationPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "actions", s.Actions) - populate(objectMap, "provisioningState", s.ProvisioningState) - populate(objectMap, "serviceName", s.ServiceName) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceDelegationPropertiesFormat. -func (s *ServiceDelegationPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "actions": - err = unpopulate(val, "Actions", &s.Actions) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) - delete(rawMsg, key) - case "serviceName": - err = unpopulate(val, "ServiceName", &s.ServiceName) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ServiceEndpointPolicy. -func (s ServiceEndpointPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", s.Etag) - populate(objectMap, "id", s.ID) - populate(objectMap, "kind", s.Kind) - populate(objectMap, "location", s.Location) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "tags", s.Tags) - populate(objectMap, "type", s.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceEndpointPolicy. -func (s *ServiceEndpointPolicy) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &s.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &s.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &s.Kind) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &s.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &s.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &s.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &s.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &s.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ServiceEndpointPolicyDefinition. -func (s ServiceEndpointPolicyDefinition) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", s.Etag) - populate(objectMap, "id", s.ID) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "type", s.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceEndpointPolicyDefinition. -func (s *ServiceEndpointPolicyDefinition) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &s.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &s.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &s.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &s.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &s.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ServiceEndpointPolicyDefinitionListResult. -func (s ServiceEndpointPolicyDefinitionListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", s.NextLink) - populate(objectMap, "value", s.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceEndpointPolicyDefinitionListResult. -func (s *ServiceEndpointPolicyDefinitionListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &s.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &s.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ServiceEndpointPolicyDefinitionPropertiesFormat. -func (s ServiceEndpointPolicyDefinitionPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "description", s.Description) - populate(objectMap, "provisioningState", s.ProvisioningState) - populate(objectMap, "service", s.Service) - populate(objectMap, "serviceResources", s.ServiceResources) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceEndpointPolicyDefinitionPropertiesFormat. -func (s *ServiceEndpointPolicyDefinitionPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "description": - err = unpopulate(val, "Description", &s.Description) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) - delete(rawMsg, key) - case "service": - err = unpopulate(val, "Service", &s.Service) - delete(rawMsg, key) - case "serviceResources": - err = unpopulate(val, "ServiceResources", &s.ServiceResources) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ServiceEndpointPolicyListResult. -func (s ServiceEndpointPolicyListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", s.NextLink) - populate(objectMap, "value", s.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceEndpointPolicyListResult. -func (s *ServiceEndpointPolicyListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &s.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &s.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ServiceEndpointPolicyPropertiesFormat. -func (s ServiceEndpointPolicyPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "contextualServiceEndpointPolicies", s.ContextualServiceEndpointPolicies) - populate(objectMap, "provisioningState", s.ProvisioningState) - populate(objectMap, "resourceGuid", s.ResourceGUID) - populate(objectMap, "serviceAlias", s.ServiceAlias) - populate(objectMap, "serviceEndpointPolicyDefinitions", s.ServiceEndpointPolicyDefinitions) - populate(objectMap, "subnets", s.Subnets) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceEndpointPolicyPropertiesFormat. -func (s *ServiceEndpointPolicyPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "contextualServiceEndpointPolicies": - err = unpopulate(val, "ContextualServiceEndpointPolicies", &s.ContextualServiceEndpointPolicies) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) - delete(rawMsg, key) - case "resourceGuid": - err = unpopulate(val, "ResourceGUID", &s.ResourceGUID) - delete(rawMsg, key) - case "serviceAlias": - err = unpopulate(val, "ServiceAlias", &s.ServiceAlias) - delete(rawMsg, key) - case "serviceEndpointPolicyDefinitions": - err = unpopulate(val, "ServiceEndpointPolicyDefinitions", &s.ServiceEndpointPolicyDefinitions) - delete(rawMsg, key) - case "subnets": - err = unpopulate(val, "Subnets", &s.Subnets) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ServiceEndpointPropertiesFormat. -func (s ServiceEndpointPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "locations", s.Locations) - populate(objectMap, "provisioningState", s.ProvisioningState) - populate(objectMap, "service", s.Service) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceEndpointPropertiesFormat. -func (s *ServiceEndpointPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "locations": - err = unpopulate(val, "Locations", &s.Locations) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) - delete(rawMsg, key) - case "service": - err = unpopulate(val, "Service", &s.Service) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ServiceTagInformation. -func (s ServiceTagInformation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", s.ID) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "serviceTagChangeNumber", s.ServiceTagChangeNumber) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceTagInformation. -func (s *ServiceTagInformation) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &s.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &s.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &s.Properties) - delete(rawMsg, key) - case "serviceTagChangeNumber": - err = unpopulate(val, "ServiceTagChangeNumber", &s.ServiceTagChangeNumber) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ServiceTagInformationListResult. -func (s ServiceTagInformationListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", s.NextLink) - populate(objectMap, "value", s.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceTagInformationListResult. -func (s *ServiceTagInformationListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &s.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &s.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ServiceTagInformationPropertiesFormat. -func (s ServiceTagInformationPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "addressPrefixes", s.AddressPrefixes) - populate(objectMap, "changeNumber", s.ChangeNumber) - populate(objectMap, "region", s.Region) - populate(objectMap, "state", s.State) - populate(objectMap, "systemService", s.SystemService) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceTagInformationPropertiesFormat. -func (s *ServiceTagInformationPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "addressPrefixes": - err = unpopulate(val, "AddressPrefixes", &s.AddressPrefixes) - delete(rawMsg, key) - case "changeNumber": - err = unpopulate(val, "ChangeNumber", &s.ChangeNumber) - delete(rawMsg, key) - case "region": - err = unpopulate(val, "Region", &s.Region) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &s.State) - delete(rawMsg, key) - case "systemService": - err = unpopulate(val, "SystemService", &s.SystemService) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ServiceTagsListResult. -func (s ServiceTagsListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "changeNumber", s.ChangeNumber) - populate(objectMap, "cloud", s.Cloud) - populate(objectMap, "id", s.ID) - populate(objectMap, "name", s.Name) - populate(objectMap, "nextLink", s.NextLink) - populate(objectMap, "type", s.Type) - populate(objectMap, "values", s.Values) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceTagsListResult. -func (s *ServiceTagsListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "changeNumber": - err = unpopulate(val, "ChangeNumber", &s.ChangeNumber) - delete(rawMsg, key) - case "cloud": - err = unpopulate(val, "Cloud", &s.Cloud) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &s.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &s.Name) - delete(rawMsg, key) - case "nextLink": - err = unpopulate(val, "NextLink", &s.NextLink) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &s.Type) - delete(rawMsg, key) - case "values": - err = unpopulate(val, "Values", &s.Values) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SessionIDs. -func (s SessionIDs) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "sessionIds", s.SessionIDs) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SessionIDs. -func (s *SessionIDs) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "sessionIds": - err = unpopulate(val, "SessionIDs", &s.SessionIDs) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SignatureOverridesFilterValuesQuery. -func (s SignatureOverridesFilterValuesQuery) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "filterName", s.FilterName) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SignatureOverridesFilterValuesQuery. -func (s *SignatureOverridesFilterValuesQuery) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "filterName": - err = unpopulate(val, "FilterName", &s.FilterName) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SignatureOverridesFilterValuesResponse. -func (s SignatureOverridesFilterValuesResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "filterValues", s.FilterValues) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SignatureOverridesFilterValuesResponse. -func (s *SignatureOverridesFilterValuesResponse) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "filterValues": - err = unpopulate(val, "FilterValues", &s.FilterValues) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SignaturesOverrides. -func (s SignaturesOverrides) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", s.ID) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "type", s.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SignaturesOverrides. -func (s *SignaturesOverrides) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &s.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &s.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &s.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &s.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SignaturesOverridesList. -func (s SignaturesOverridesList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "value", s.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SignaturesOverridesList. -func (s *SignaturesOverridesList) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "value": - err = unpopulate(val, "Value", &s.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SignaturesOverridesProperties. -func (s SignaturesOverridesProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "signatures", s.Signatures) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SignaturesOverridesProperties. -func (s *SignaturesOverridesProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "signatures": - err = unpopulate(val, "Signatures", &s.Signatures) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SingleQueryResult. -func (s SingleQueryResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "description", s.Description) - populate(objectMap, "destinationPorts", s.DestinationPorts) - populate(objectMap, "direction", s.Direction) - populate(objectMap, "group", s.Group) - populate(objectMap, "inheritedFromParentPolicy", s.InheritedFromParentPolicy) - populate(objectMap, "lastUpdated", s.LastUpdated) - populate(objectMap, "mode", s.Mode) - populate(objectMap, "protocol", s.Protocol) - populate(objectMap, "severity", s.Severity) - populate(objectMap, "signatureId", s.SignatureID) - populate(objectMap, "sourcePorts", s.SourcePorts) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SingleQueryResult. -func (s *SingleQueryResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "description": - err = unpopulate(val, "Description", &s.Description) - delete(rawMsg, key) - case "destinationPorts": - err = unpopulate(val, "DestinationPorts", &s.DestinationPorts) - delete(rawMsg, key) - case "direction": - err = unpopulate(val, "Direction", &s.Direction) - delete(rawMsg, key) - case "group": - err = unpopulate(val, "Group", &s.Group) - delete(rawMsg, key) - case "inheritedFromParentPolicy": - err = unpopulate(val, "InheritedFromParentPolicy", &s.InheritedFromParentPolicy) - delete(rawMsg, key) - case "lastUpdated": - err = unpopulate(val, "LastUpdated", &s.LastUpdated) - delete(rawMsg, key) - case "mode": - err = unpopulate(val, "Mode", &s.Mode) - delete(rawMsg, key) - case "protocol": - err = unpopulate(val, "Protocol", &s.Protocol) - delete(rawMsg, key) - case "severity": - err = unpopulate(val, "Severity", &s.Severity) - delete(rawMsg, key) - case "signatureId": - err = unpopulate(val, "SignatureID", &s.SignatureID) - delete(rawMsg, key) - case "sourcePorts": - err = unpopulate(val, "SourcePorts", &s.SourcePorts) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type StaticMember. -func (s StaticMember) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", s.Etag) - populate(objectMap, "id", s.ID) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "systemData", s.SystemData) - populate(objectMap, "type", s.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type StaticMember. -func (s *StaticMember) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &s.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &s.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &s.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &s.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &s.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &s.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type StaticMemberListResult. -func (s StaticMemberListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", s.NextLink) - populate(objectMap, "value", s.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type StaticMemberListResult. -func (s *StaticMemberListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &s.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &s.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type StaticMemberProperties. -func (s StaticMemberProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "provisioningState", s.ProvisioningState) - populate(objectMap, "region", s.Region) - populate(objectMap, "resourceId", s.ResourceID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type StaticMemberProperties. -func (s *StaticMemberProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) - delete(rawMsg, key) - case "region": - err = unpopulate(val, "Region", &s.Region) - delete(rawMsg, key) - case "resourceId": - err = unpopulate(val, "ResourceID", &s.ResourceID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type StaticRoute. -func (s StaticRoute) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "addressPrefixes", s.AddressPrefixes) - populate(objectMap, "name", s.Name) - populate(objectMap, "nextHopIpAddress", s.NextHopIPAddress) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type StaticRoute. -func (s *StaticRoute) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "addressPrefixes": - err = unpopulate(val, "AddressPrefixes", &s.AddressPrefixes) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &s.Name) - delete(rawMsg, key) - case "nextHopIpAddress": - err = unpopulate(val, "NextHopIPAddress", &s.NextHopIPAddress) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SubResource. -func (s SubResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", s.ID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SubResource. -func (s *SubResource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &s.ID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Subnet. -func (s Subnet) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", s.Etag) - populate(objectMap, "id", s.ID) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "type", s.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Subnet. -func (s *Subnet) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &s.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &s.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &s.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &s.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &s.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SubnetAssociation. -func (s SubnetAssociation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", s.ID) - populate(objectMap, "securityRules", s.SecurityRules) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SubnetAssociation. -func (s *SubnetAssociation) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &s.ID) - delete(rawMsg, key) - case "securityRules": - err = unpopulate(val, "SecurityRules", &s.SecurityRules) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SubnetListResult. -func (s SubnetListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", s.NextLink) - populate(objectMap, "value", s.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SubnetListResult. -func (s *SubnetListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &s.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &s.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SubnetPropertiesFormat. -func (s SubnetPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "addressPrefix", s.AddressPrefix) - populate(objectMap, "addressPrefixes", s.AddressPrefixes) - populate(objectMap, "applicationGatewayIpConfigurations", s.ApplicationGatewayIPConfigurations) - populate(objectMap, "delegations", s.Delegations) - populate(objectMap, "ipAllocations", s.IPAllocations) - populate(objectMap, "ipConfigurationProfiles", s.IPConfigurationProfiles) - populate(objectMap, "ipConfigurations", s.IPConfigurations) - populate(objectMap, "natGateway", s.NatGateway) - populate(objectMap, "networkSecurityGroup", s.NetworkSecurityGroup) - populate(objectMap, "privateEndpointNetworkPolicies", s.PrivateEndpointNetworkPolicies) - populate(objectMap, "privateEndpoints", s.PrivateEndpoints) - populate(objectMap, "privateLinkServiceNetworkPolicies", s.PrivateLinkServiceNetworkPolicies) - populate(objectMap, "provisioningState", s.ProvisioningState) - populate(objectMap, "purpose", s.Purpose) - populate(objectMap, "resourceNavigationLinks", s.ResourceNavigationLinks) - populate(objectMap, "routeTable", s.RouteTable) - populate(objectMap, "serviceAssociationLinks", s.ServiceAssociationLinks) - populate(objectMap, "serviceEndpointPolicies", s.ServiceEndpointPolicies) - populate(objectMap, "serviceEndpoints", s.ServiceEndpoints) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SubnetPropertiesFormat. -func (s *SubnetPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "addressPrefix": - err = unpopulate(val, "AddressPrefix", &s.AddressPrefix) - delete(rawMsg, key) - case "addressPrefixes": - err = unpopulate(val, "AddressPrefixes", &s.AddressPrefixes) - delete(rawMsg, key) - case "applicationGatewayIpConfigurations": - err = unpopulate(val, "ApplicationGatewayIPConfigurations", &s.ApplicationGatewayIPConfigurations) - delete(rawMsg, key) - case "delegations": - err = unpopulate(val, "Delegations", &s.Delegations) - delete(rawMsg, key) - case "ipAllocations": - err = unpopulate(val, "IPAllocations", &s.IPAllocations) - delete(rawMsg, key) - case "ipConfigurationProfiles": - err = unpopulate(val, "IPConfigurationProfiles", &s.IPConfigurationProfiles) - delete(rawMsg, key) - case "ipConfigurations": - err = unpopulate(val, "IPConfigurations", &s.IPConfigurations) - delete(rawMsg, key) - case "natGateway": - err = unpopulate(val, "NatGateway", &s.NatGateway) - delete(rawMsg, key) - case "networkSecurityGroup": - err = unpopulate(val, "NetworkSecurityGroup", &s.NetworkSecurityGroup) - delete(rawMsg, key) - case "privateEndpointNetworkPolicies": - err = unpopulate(val, "PrivateEndpointNetworkPolicies", &s.PrivateEndpointNetworkPolicies) - delete(rawMsg, key) - case "privateEndpoints": - err = unpopulate(val, "PrivateEndpoints", &s.PrivateEndpoints) - delete(rawMsg, key) - case "privateLinkServiceNetworkPolicies": - err = unpopulate(val, "PrivateLinkServiceNetworkPolicies", &s.PrivateLinkServiceNetworkPolicies) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) - delete(rawMsg, key) - case "purpose": - err = unpopulate(val, "Purpose", &s.Purpose) - delete(rawMsg, key) - case "resourceNavigationLinks": - err = unpopulate(val, "ResourceNavigationLinks", &s.ResourceNavigationLinks) - delete(rawMsg, key) - case "routeTable": - err = unpopulate(val, "RouteTable", &s.RouteTable) - delete(rawMsg, key) - case "serviceAssociationLinks": - err = unpopulate(val, "ServiceAssociationLinks", &s.ServiceAssociationLinks) - delete(rawMsg, key) - case "serviceEndpointPolicies": - err = unpopulate(val, "ServiceEndpointPolicies", &s.ServiceEndpointPolicies) - delete(rawMsg, key) - case "serviceEndpoints": - err = unpopulate(val, "ServiceEndpoints", &s.ServiceEndpoints) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SystemData. -func (s SystemData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) - populate(objectMap, "createdBy", s.CreatedBy) - populate(objectMap, "createdByType", s.CreatedByType) - populateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) - populate(objectMap, "lastModifiedBy", s.LastModifiedBy) - populate(objectMap, "lastModifiedByType", s.LastModifiedByType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. -func (s *SystemData) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "createdAt": - err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) - delete(rawMsg, key) - case "createdBy": - err = unpopulate(val, "CreatedBy", &s.CreatedBy) - delete(rawMsg, key) - case "createdByType": - err = unpopulate(val, "CreatedByType", &s.CreatedByType) - delete(rawMsg, key) - case "lastModifiedAt": - err = unpopulateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) - delete(rawMsg, key) - case "lastModifiedBy": - err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) - delete(rawMsg, key) - case "lastModifiedByType": - err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type TagsObject. -func (t TagsObject) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "tags", t.Tags) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type TagsObject. -func (t *TagsObject) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "tags": - err = unpopulate(val, "Tags", &t.Tags) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Topology. -func (t Topology) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "createdDateTime", t.CreatedDateTime) - populate(objectMap, "id", t.ID) - populateTimeRFC3339(objectMap, "lastModified", t.LastModified) - populate(objectMap, "resources", t.Resources) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Topology. -func (t *Topology) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "createdDateTime": - err = unpopulateTimeRFC3339(val, "CreatedDateTime", &t.CreatedDateTime) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &t.ID) - delete(rawMsg, key) - case "lastModified": - err = unpopulateTimeRFC3339(val, "LastModified", &t.LastModified) - delete(rawMsg, key) - case "resources": - err = unpopulate(val, "Resources", &t.Resources) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type TopologyAssociation. -func (t TopologyAssociation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "associationType", t.AssociationType) - populate(objectMap, "name", t.Name) - populate(objectMap, "resourceId", t.ResourceID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type TopologyAssociation. -func (t *TopologyAssociation) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "associationType": - err = unpopulate(val, "AssociationType", &t.AssociationType) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &t.Name) - delete(rawMsg, key) - case "resourceId": - err = unpopulate(val, "ResourceID", &t.ResourceID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type TopologyParameters. -func (t TopologyParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "targetResourceGroupName", t.TargetResourceGroupName) - populate(objectMap, "targetSubnet", t.TargetSubnet) - populate(objectMap, "targetVirtualNetwork", t.TargetVirtualNetwork) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type TopologyParameters. -func (t *TopologyParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "targetResourceGroupName": - err = unpopulate(val, "TargetResourceGroupName", &t.TargetResourceGroupName) - delete(rawMsg, key) - case "targetSubnet": - err = unpopulate(val, "TargetSubnet", &t.TargetSubnet) - delete(rawMsg, key) - case "targetVirtualNetwork": - err = unpopulate(val, "TargetVirtualNetwork", &t.TargetVirtualNetwork) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type TopologyResource. -func (t TopologyResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "associations", t.Associations) - populate(objectMap, "id", t.ID) - populate(objectMap, "location", t.Location) - populate(objectMap, "name", t.Name) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type TopologyResource. -func (t *TopologyResource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "associations": - err = unpopulate(val, "Associations", &t.Associations) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &t.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &t.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &t.Name) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type TrafficAnalyticsConfigurationProperties. -func (t TrafficAnalyticsConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "enabled", t.Enabled) - populate(objectMap, "trafficAnalyticsInterval", t.TrafficAnalyticsInterval) - populate(objectMap, "workspaceId", t.WorkspaceID) - populate(objectMap, "workspaceRegion", t.WorkspaceRegion) - populate(objectMap, "workspaceResourceId", t.WorkspaceResourceID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type TrafficAnalyticsConfigurationProperties. -func (t *TrafficAnalyticsConfigurationProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "enabled": - err = unpopulate(val, "Enabled", &t.Enabled) - delete(rawMsg, key) - case "trafficAnalyticsInterval": - err = unpopulate(val, "TrafficAnalyticsInterval", &t.TrafficAnalyticsInterval) - delete(rawMsg, key) - case "workspaceId": - err = unpopulate(val, "WorkspaceID", &t.WorkspaceID) - delete(rawMsg, key) - case "workspaceRegion": - err = unpopulate(val, "WorkspaceRegion", &t.WorkspaceRegion) - delete(rawMsg, key) - case "workspaceResourceId": - err = unpopulate(val, "WorkspaceResourceID", &t.WorkspaceResourceID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type TrafficAnalyticsProperties. -func (t TrafficAnalyticsProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "networkWatcherFlowAnalyticsConfiguration", t.NetworkWatcherFlowAnalyticsConfiguration) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type TrafficAnalyticsProperties. -func (t *TrafficAnalyticsProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "networkWatcherFlowAnalyticsConfiguration": - err = unpopulate(val, "NetworkWatcherFlowAnalyticsConfiguration", &t.NetworkWatcherFlowAnalyticsConfiguration) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type TrafficSelectorPolicy. -func (t TrafficSelectorPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "localAddressRanges", t.LocalAddressRanges) - populate(objectMap, "remoteAddressRanges", t.RemoteAddressRanges) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type TrafficSelectorPolicy. -func (t *TrafficSelectorPolicy) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "localAddressRanges": - err = unpopulate(val, "LocalAddressRanges", &t.LocalAddressRanges) - delete(rawMsg, key) - case "remoteAddressRanges": - err = unpopulate(val, "RemoteAddressRanges", &t.RemoteAddressRanges) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type TroubleshootingDetails. -func (t TroubleshootingDetails) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "detail", t.Detail) - populate(objectMap, "id", t.ID) - populate(objectMap, "reasonType", t.ReasonType) - populate(objectMap, "recommendedActions", t.RecommendedActions) - populate(objectMap, "summary", t.Summary) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type TroubleshootingDetails. -func (t *TroubleshootingDetails) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "detail": - err = unpopulate(val, "Detail", &t.Detail) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &t.ID) - delete(rawMsg, key) - case "reasonType": - err = unpopulate(val, "ReasonType", &t.ReasonType) - delete(rawMsg, key) - case "recommendedActions": - err = unpopulate(val, "RecommendedActions", &t.RecommendedActions) - delete(rawMsg, key) - case "summary": - err = unpopulate(val, "Summary", &t.Summary) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type TroubleshootingParameters. -func (t TroubleshootingParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", t.Properties) - populate(objectMap, "targetResourceId", t.TargetResourceID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type TroubleshootingParameters. -func (t *TroubleshootingParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "properties": - err = unpopulate(val, "Properties", &t.Properties) - delete(rawMsg, key) - case "targetResourceId": - err = unpopulate(val, "TargetResourceID", &t.TargetResourceID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type TroubleshootingProperties. -func (t TroubleshootingProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "storageId", t.StorageID) - populate(objectMap, "storagePath", t.StoragePath) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type TroubleshootingProperties. -func (t *TroubleshootingProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "storageId": - err = unpopulate(val, "StorageID", &t.StorageID) - delete(rawMsg, key) - case "storagePath": - err = unpopulate(val, "StoragePath", &t.StoragePath) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type TroubleshootingRecommendedActions. -func (t TroubleshootingRecommendedActions) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "actionId", t.ActionID) - populate(objectMap, "actionText", t.ActionText) - populate(objectMap, "actionUri", t.ActionURI) - populate(objectMap, "actionUriText", t.ActionURIText) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type TroubleshootingRecommendedActions. -func (t *TroubleshootingRecommendedActions) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "actionId": - err = unpopulate(val, "ActionID", &t.ActionID) - delete(rawMsg, key) - case "actionText": - err = unpopulate(val, "ActionText", &t.ActionText) - delete(rawMsg, key) - case "actionUri": - err = unpopulate(val, "ActionURI", &t.ActionURI) - delete(rawMsg, key) - case "actionUriText": - err = unpopulate(val, "ActionURIText", &t.ActionURIText) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type TroubleshootingResult. -func (t TroubleshootingResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "code", t.Code) - populateTimeRFC3339(objectMap, "endTime", t.EndTime) - populate(objectMap, "results", t.Results) - populateTimeRFC3339(objectMap, "startTime", t.StartTime) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type TroubleshootingResult. -func (t *TroubleshootingResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "code": - err = unpopulate(val, "Code", &t.Code) - delete(rawMsg, key) - case "endTime": - err = unpopulateTimeRFC3339(val, "EndTime", &t.EndTime) - delete(rawMsg, key) - case "results": - err = unpopulate(val, "Results", &t.Results) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &t.StartTime) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type TunnelConnectionHealth. -func (t TunnelConnectionHealth) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "connectionStatus", t.ConnectionStatus) - populate(objectMap, "egressBytesTransferred", t.EgressBytesTransferred) - populate(objectMap, "ingressBytesTransferred", t.IngressBytesTransferred) - populate(objectMap, "lastConnectionEstablishedUtcTime", t.LastConnectionEstablishedUTCTime) - populate(objectMap, "tunnel", t.Tunnel) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type TunnelConnectionHealth. -func (t *TunnelConnectionHealth) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "connectionStatus": - err = unpopulate(val, "ConnectionStatus", &t.ConnectionStatus) - delete(rawMsg, key) - case "egressBytesTransferred": - err = unpopulate(val, "EgressBytesTransferred", &t.EgressBytesTransferred) - delete(rawMsg, key) - case "ingressBytesTransferred": - err = unpopulate(val, "IngressBytesTransferred", &t.IngressBytesTransferred) - delete(rawMsg, key) - case "lastConnectionEstablishedUtcTime": - err = unpopulate(val, "LastConnectionEstablishedUTCTime", &t.LastConnectionEstablishedUTCTime) - delete(rawMsg, key) - case "tunnel": - err = unpopulate(val, "Tunnel", &t.Tunnel) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type UnprepareNetworkPoliciesRequest. -func (u UnprepareNetworkPoliciesRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "serviceName", u.ServiceName) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type UnprepareNetworkPoliciesRequest. -func (u *UnprepareNetworkPoliciesRequest) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "serviceName": - err = unpopulate(val, "ServiceName", &u.ServiceName) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Usage. -func (u Usage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "currentValue", u.CurrentValue) - populate(objectMap, "id", u.ID) - populate(objectMap, "limit", u.Limit) - populate(objectMap, "name", u.Name) - populate(objectMap, "unit", u.Unit) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Usage. -func (u *Usage) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "currentValue": - err = unpopulate(val, "CurrentValue", &u.CurrentValue) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &u.ID) - delete(rawMsg, key) - case "limit": - err = unpopulate(val, "Limit", &u.Limit) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &u.Name) - delete(rawMsg, key) - case "unit": - err = unpopulate(val, "Unit", &u.Unit) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type UsageName. -func (u UsageName) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "localizedValue", u.LocalizedValue) - populate(objectMap, "value", u.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type UsageName. -func (u *UsageName) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "localizedValue": - err = unpopulate(val, "LocalizedValue", &u.LocalizedValue) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &u.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type UsagesListResult. -func (u UsagesListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", u.NextLink) - populate(objectMap, "value", u.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type UsagesListResult. -func (u *UsagesListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &u.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &u.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VM. -func (v VM) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", v.ID) - populate(objectMap, "location", v.Location) - populate(objectMap, "name", v.Name) - populate(objectMap, "tags", v.Tags) - populate(objectMap, "type", v.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VM. -func (v *VM) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &v.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &v.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &v.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &v.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VPNClientConfiguration. -func (v VPNClientConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "aadAudience", v.AADAudience) - populate(objectMap, "aadIssuer", v.AADIssuer) - populate(objectMap, "aadTenant", v.AADTenant) - populate(objectMap, "radiusServerAddress", v.RadiusServerAddress) - populate(objectMap, "radiusServerSecret", v.RadiusServerSecret) - populate(objectMap, "radiusServers", v.RadiusServers) - populate(objectMap, "vpnAuthenticationTypes", v.VPNAuthenticationTypes) - populate(objectMap, "vpnClientAddressPool", v.VPNClientAddressPool) - populate(objectMap, "vpnClientIpsecPolicies", v.VPNClientIPSecPolicies) - populate(objectMap, "vpnClientProtocols", v.VPNClientProtocols) - populate(objectMap, "vpnClientRevokedCertificates", v.VPNClientRevokedCertificates) - populate(objectMap, "vpnClientRootCertificates", v.VPNClientRootCertificates) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VPNClientConfiguration. -func (v *VPNClientConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "aadAudience": - err = unpopulate(val, "AADAudience", &v.AADAudience) - delete(rawMsg, key) - case "aadIssuer": - err = unpopulate(val, "AADIssuer", &v.AADIssuer) - delete(rawMsg, key) - case "aadTenant": - err = unpopulate(val, "AADTenant", &v.AADTenant) - delete(rawMsg, key) - case "radiusServerAddress": - err = unpopulate(val, "RadiusServerAddress", &v.RadiusServerAddress) - delete(rawMsg, key) - case "radiusServerSecret": - err = unpopulate(val, "RadiusServerSecret", &v.RadiusServerSecret) - delete(rawMsg, key) - case "radiusServers": - err = unpopulate(val, "RadiusServers", &v.RadiusServers) - delete(rawMsg, key) - case "vpnAuthenticationTypes": - err = unpopulate(val, "VPNAuthenticationTypes", &v.VPNAuthenticationTypes) - delete(rawMsg, key) - case "vpnClientAddressPool": - err = unpopulate(val, "VPNClientAddressPool", &v.VPNClientAddressPool) - delete(rawMsg, key) - case "vpnClientIpsecPolicies": - err = unpopulate(val, "VPNClientIPSecPolicies", &v.VPNClientIPSecPolicies) - delete(rawMsg, key) - case "vpnClientProtocols": - err = unpopulate(val, "VPNClientProtocols", &v.VPNClientProtocols) - delete(rawMsg, key) - case "vpnClientRevokedCertificates": - err = unpopulate(val, "VPNClientRevokedCertificates", &v.VPNClientRevokedCertificates) - delete(rawMsg, key) - case "vpnClientRootCertificates": - err = unpopulate(val, "VPNClientRootCertificates", &v.VPNClientRootCertificates) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VPNClientConnectionHealth. -func (v VPNClientConnectionHealth) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "allocatedIpAddresses", v.AllocatedIPAddresses) - populate(objectMap, "totalEgressBytesTransferred", v.TotalEgressBytesTransferred) - populate(objectMap, "totalIngressBytesTransferred", v.TotalIngressBytesTransferred) - populate(objectMap, "vpnClientConnectionsCount", v.VPNClientConnectionsCount) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VPNClientConnectionHealth. -func (v *VPNClientConnectionHealth) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "allocatedIpAddresses": - err = unpopulate(val, "AllocatedIPAddresses", &v.AllocatedIPAddresses) - delete(rawMsg, key) - case "totalEgressBytesTransferred": - err = unpopulate(val, "TotalEgressBytesTransferred", &v.TotalEgressBytesTransferred) - delete(rawMsg, key) - case "totalIngressBytesTransferred": - err = unpopulate(val, "TotalIngressBytesTransferred", &v.TotalIngressBytesTransferred) - delete(rawMsg, key) - case "vpnClientConnectionsCount": - err = unpopulate(val, "VPNClientConnectionsCount", &v.VPNClientConnectionsCount) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VPNClientConnectionHealthDetail. -func (v VPNClientConnectionHealthDetail) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "egressBytesTransferred", v.EgressBytesTransferred) - populate(objectMap, "egressPacketsTransferred", v.EgressPacketsTransferred) - populate(objectMap, "ingressBytesTransferred", v.IngressBytesTransferred) - populate(objectMap, "ingressPacketsTransferred", v.IngressPacketsTransferred) - populate(objectMap, "maxBandwidth", v.MaxBandwidth) - populate(objectMap, "maxPacketsPerSecond", v.MaxPacketsPerSecond) - populate(objectMap, "privateIpAddress", v.PrivateIPAddress) - populate(objectMap, "publicIpAddress", v.PublicIPAddress) - populate(objectMap, "vpnConnectionDuration", v.VPNConnectionDuration) - populate(objectMap, "vpnConnectionId", v.VPNConnectionID) - populate(objectMap, "vpnConnectionTime", v.VPNConnectionTime) - populate(objectMap, "vpnUserName", v.VPNUserName) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VPNClientConnectionHealthDetail. -func (v *VPNClientConnectionHealthDetail) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "egressBytesTransferred": - err = unpopulate(val, "EgressBytesTransferred", &v.EgressBytesTransferred) - delete(rawMsg, key) - case "egressPacketsTransferred": - err = unpopulate(val, "EgressPacketsTransferred", &v.EgressPacketsTransferred) - delete(rawMsg, key) - case "ingressBytesTransferred": - err = unpopulate(val, "IngressBytesTransferred", &v.IngressBytesTransferred) - delete(rawMsg, key) - case "ingressPacketsTransferred": - err = unpopulate(val, "IngressPacketsTransferred", &v.IngressPacketsTransferred) - delete(rawMsg, key) - case "maxBandwidth": - err = unpopulate(val, "MaxBandwidth", &v.MaxBandwidth) - delete(rawMsg, key) - case "maxPacketsPerSecond": - err = unpopulate(val, "MaxPacketsPerSecond", &v.MaxPacketsPerSecond) - delete(rawMsg, key) - case "privateIpAddress": - err = unpopulate(val, "PrivateIPAddress", &v.PrivateIPAddress) - delete(rawMsg, key) - case "publicIpAddress": - err = unpopulate(val, "PublicIPAddress", &v.PublicIPAddress) - delete(rawMsg, key) - case "vpnConnectionDuration": - err = unpopulate(val, "VPNConnectionDuration", &v.VPNConnectionDuration) - delete(rawMsg, key) - case "vpnConnectionId": - err = unpopulate(val, "VPNConnectionID", &v.VPNConnectionID) - delete(rawMsg, key) - case "vpnConnectionTime": - err = unpopulate(val, "VPNConnectionTime", &v.VPNConnectionTime) - delete(rawMsg, key) - case "vpnUserName": - err = unpopulate(val, "VPNUserName", &v.VPNUserName) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VPNClientConnectionHealthDetailListResult. -func (v VPNClientConnectionHealthDetailListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "value", v.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VPNClientConnectionHealthDetailListResult. -func (v *VPNClientConnectionHealthDetailListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "value": - err = unpopulate(val, "Value", &v.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VPNClientIPsecParameters. -func (v VPNClientIPsecParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "dhGroup", v.DhGroup) - populate(objectMap, "ipsecEncryption", v.IPSecEncryption) - populate(objectMap, "ipsecIntegrity", v.IPSecIntegrity) - populate(objectMap, "ikeEncryption", v.IkeEncryption) - populate(objectMap, "ikeIntegrity", v.IkeIntegrity) - populate(objectMap, "pfsGroup", v.PfsGroup) - populate(objectMap, "saDataSizeKilobytes", v.SaDataSizeKilobytes) - populate(objectMap, "saLifeTimeSeconds", v.SaLifeTimeSeconds) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VPNClientIPsecParameters. -func (v *VPNClientIPsecParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "dhGroup": - err = unpopulate(val, "DhGroup", &v.DhGroup) - delete(rawMsg, key) - case "ipsecEncryption": - err = unpopulate(val, "IPSecEncryption", &v.IPSecEncryption) - delete(rawMsg, key) - case "ipsecIntegrity": - err = unpopulate(val, "IPSecIntegrity", &v.IPSecIntegrity) - delete(rawMsg, key) - case "ikeEncryption": - err = unpopulate(val, "IkeEncryption", &v.IkeEncryption) - delete(rawMsg, key) - case "ikeIntegrity": - err = unpopulate(val, "IkeIntegrity", &v.IkeIntegrity) - delete(rawMsg, key) - case "pfsGroup": - err = unpopulate(val, "PfsGroup", &v.PfsGroup) - delete(rawMsg, key) - case "saDataSizeKilobytes": - err = unpopulate(val, "SaDataSizeKilobytes", &v.SaDataSizeKilobytes) - delete(rawMsg, key) - case "saLifeTimeSeconds": - err = unpopulate(val, "SaLifeTimeSeconds", &v.SaLifeTimeSeconds) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VPNClientParameters. -func (v VPNClientParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "authenticationMethod", v.AuthenticationMethod) - populate(objectMap, "clientRootCertificates", v.ClientRootCertificates) - populate(objectMap, "processorArchitecture", v.ProcessorArchitecture) - populate(objectMap, "radiusServerAuthCertificate", v.RadiusServerAuthCertificate) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VPNClientParameters. -func (v *VPNClientParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "authenticationMethod": - err = unpopulate(val, "AuthenticationMethod", &v.AuthenticationMethod) - delete(rawMsg, key) - case "clientRootCertificates": - err = unpopulate(val, "ClientRootCertificates", &v.ClientRootCertificates) - delete(rawMsg, key) - case "processorArchitecture": - err = unpopulate(val, "ProcessorArchitecture", &v.ProcessorArchitecture) - delete(rawMsg, key) - case "radiusServerAuthCertificate": - err = unpopulate(val, "RadiusServerAuthCertificate", &v.RadiusServerAuthCertificate) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VPNClientRevokedCertificate. -func (v VPNClientRevokedCertificate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", v.Etag) - populate(objectMap, "id", v.ID) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VPNClientRevokedCertificate. -func (v *VPNClientRevokedCertificate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &v.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &v.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VPNClientRevokedCertificatePropertiesFormat. -func (v VPNClientRevokedCertificatePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "provisioningState", v.ProvisioningState) - populate(objectMap, "thumbprint", v.Thumbprint) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VPNClientRevokedCertificatePropertiesFormat. -func (v *VPNClientRevokedCertificatePropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) - delete(rawMsg, key) - case "thumbprint": - err = unpopulate(val, "Thumbprint", &v.Thumbprint) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VPNClientRootCertificate. -func (v VPNClientRootCertificate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", v.Etag) - populate(objectMap, "id", v.ID) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VPNClientRootCertificate. -func (v *VPNClientRootCertificate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &v.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &v.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VPNClientRootCertificatePropertiesFormat. -func (v VPNClientRootCertificatePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "provisioningState", v.ProvisioningState) - populate(objectMap, "publicCertData", v.PublicCertData) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VPNClientRootCertificatePropertiesFormat. -func (v *VPNClientRootCertificatePropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) - delete(rawMsg, key) - case "publicCertData": - err = unpopulate(val, "PublicCertData", &v.PublicCertData) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VPNConnection. -func (v VPNConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", v.Etag) - populate(objectMap, "id", v.ID) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VPNConnection. -func (v *VPNConnection) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &v.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &v.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VPNConnectionPacketCaptureStartParameters. -func (v VPNConnectionPacketCaptureStartParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "filterData", v.FilterData) - populate(objectMap, "linkConnectionNames", v.LinkConnectionNames) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VPNConnectionPacketCaptureStartParameters. -func (v *VPNConnectionPacketCaptureStartParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "filterData": - err = unpopulate(val, "FilterData", &v.FilterData) - delete(rawMsg, key) - case "linkConnectionNames": - err = unpopulate(val, "LinkConnectionNames", &v.LinkConnectionNames) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VPNConnectionPacketCaptureStopParameters. -func (v VPNConnectionPacketCaptureStopParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "linkConnectionNames", v.LinkConnectionNames) - populate(objectMap, "sasUrl", v.SasURL) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VPNConnectionPacketCaptureStopParameters. -func (v *VPNConnectionPacketCaptureStopParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "linkConnectionNames": - err = unpopulate(val, "LinkConnectionNames", &v.LinkConnectionNames) - delete(rawMsg, key) - case "sasUrl": - err = unpopulate(val, "SasURL", &v.SasURL) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VPNConnectionProperties. -func (v VPNConnectionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "connectionBandwidth", v.ConnectionBandwidth) - populate(objectMap, "connectionStatus", v.ConnectionStatus) - populate(objectMap, "dpdTimeoutSeconds", v.DpdTimeoutSeconds) - populate(objectMap, "egressBytesTransferred", v.EgressBytesTransferred) - populate(objectMap, "enableBgp", v.EnableBgp) - populate(objectMap, "enableInternetSecurity", v.EnableInternetSecurity) - populate(objectMap, "enableRateLimiting", v.EnableRateLimiting) - populate(objectMap, "ipsecPolicies", v.IPSecPolicies) - populate(objectMap, "ingressBytesTransferred", v.IngressBytesTransferred) - populate(objectMap, "provisioningState", v.ProvisioningState) - populate(objectMap, "remoteVpnSite", v.RemoteVPNSite) - populate(objectMap, "routingConfiguration", v.RoutingConfiguration) - populate(objectMap, "routingWeight", v.RoutingWeight) - populate(objectMap, "sharedKey", v.SharedKey) - populate(objectMap, "trafficSelectorPolicies", v.TrafficSelectorPolicies) - populate(objectMap, "useLocalAzureIpAddress", v.UseLocalAzureIPAddress) - populate(objectMap, "usePolicyBasedTrafficSelectors", v.UsePolicyBasedTrafficSelectors) - populate(objectMap, "vpnConnectionProtocolType", v.VPNConnectionProtocolType) - populate(objectMap, "vpnLinkConnections", v.VPNLinkConnections) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VPNConnectionProperties. -func (v *VPNConnectionProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "connectionBandwidth": - err = unpopulate(val, "ConnectionBandwidth", &v.ConnectionBandwidth) - delete(rawMsg, key) - case "connectionStatus": - err = unpopulate(val, "ConnectionStatus", &v.ConnectionStatus) - delete(rawMsg, key) - case "dpdTimeoutSeconds": - err = unpopulate(val, "DpdTimeoutSeconds", &v.DpdTimeoutSeconds) - delete(rawMsg, key) - case "egressBytesTransferred": - err = unpopulate(val, "EgressBytesTransferred", &v.EgressBytesTransferred) - delete(rawMsg, key) - case "enableBgp": - err = unpopulate(val, "EnableBgp", &v.EnableBgp) - delete(rawMsg, key) - case "enableInternetSecurity": - err = unpopulate(val, "EnableInternetSecurity", &v.EnableInternetSecurity) - delete(rawMsg, key) - case "enableRateLimiting": - err = unpopulate(val, "EnableRateLimiting", &v.EnableRateLimiting) - delete(rawMsg, key) - case "ipsecPolicies": - err = unpopulate(val, "IPSecPolicies", &v.IPSecPolicies) - delete(rawMsg, key) - case "ingressBytesTransferred": - err = unpopulate(val, "IngressBytesTransferred", &v.IngressBytesTransferred) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) - delete(rawMsg, key) - case "remoteVpnSite": - err = unpopulate(val, "RemoteVPNSite", &v.RemoteVPNSite) - delete(rawMsg, key) - case "routingConfiguration": - err = unpopulate(val, "RoutingConfiguration", &v.RoutingConfiguration) - delete(rawMsg, key) - case "routingWeight": - err = unpopulate(val, "RoutingWeight", &v.RoutingWeight) - delete(rawMsg, key) - case "sharedKey": - err = unpopulate(val, "SharedKey", &v.SharedKey) - delete(rawMsg, key) - case "trafficSelectorPolicies": - err = unpopulate(val, "TrafficSelectorPolicies", &v.TrafficSelectorPolicies) - delete(rawMsg, key) - case "useLocalAzureIpAddress": - err = unpopulate(val, "UseLocalAzureIPAddress", &v.UseLocalAzureIPAddress) - delete(rawMsg, key) - case "usePolicyBasedTrafficSelectors": - err = unpopulate(val, "UsePolicyBasedTrafficSelectors", &v.UsePolicyBasedTrafficSelectors) - delete(rawMsg, key) - case "vpnConnectionProtocolType": - err = unpopulate(val, "VPNConnectionProtocolType", &v.VPNConnectionProtocolType) - delete(rawMsg, key) - case "vpnLinkConnections": - err = unpopulate(val, "VPNLinkConnections", &v.VPNLinkConnections) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VPNDeviceScriptParameters. -func (v VPNDeviceScriptParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "deviceFamily", v.DeviceFamily) - populate(objectMap, "firmwareVersion", v.FirmwareVersion) - populate(objectMap, "vendor", v.Vendor) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VPNDeviceScriptParameters. -func (v *VPNDeviceScriptParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "deviceFamily": - err = unpopulate(val, "DeviceFamily", &v.DeviceFamily) - delete(rawMsg, key) - case "firmwareVersion": - err = unpopulate(val, "FirmwareVersion", &v.FirmwareVersion) - delete(rawMsg, key) - case "vendor": - err = unpopulate(val, "Vendor", &v.Vendor) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VPNGateway. -func (v VPNGateway) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", v.Etag) - populate(objectMap, "id", v.ID) - populate(objectMap, "location", v.Location) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "tags", v.Tags) - populate(objectMap, "type", v.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VPNGateway. -func (v *VPNGateway) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &v.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &v.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &v.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &v.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &v.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VPNGatewayIPConfiguration. -func (v VPNGatewayIPConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", v.ID) - populate(objectMap, "privateIpAddress", v.PrivateIPAddress) - populate(objectMap, "publicIpAddress", v.PublicIPAddress) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VPNGatewayIPConfiguration. -func (v *VPNGatewayIPConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &v.ID) - delete(rawMsg, key) - case "privateIpAddress": - err = unpopulate(val, "PrivateIPAddress", &v.PrivateIPAddress) - delete(rawMsg, key) - case "publicIpAddress": - err = unpopulate(val, "PublicIPAddress", &v.PublicIPAddress) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VPNGatewayNatRule. -func (v VPNGatewayNatRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", v.Etag) - populate(objectMap, "id", v.ID) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "type", v.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VPNGatewayNatRule. -func (v *VPNGatewayNatRule) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &v.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &v.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &v.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VPNGatewayNatRuleProperties. -func (v VPNGatewayNatRuleProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "egressVpnSiteLinkConnections", v.EgressVPNSiteLinkConnections) - populate(objectMap, "externalMappings", v.ExternalMappings) - populate(objectMap, "ipConfigurationId", v.IPConfigurationID) - populate(objectMap, "ingressVpnSiteLinkConnections", v.IngressVPNSiteLinkConnections) - populate(objectMap, "internalMappings", v.InternalMappings) - populate(objectMap, "mode", v.Mode) - populate(objectMap, "provisioningState", v.ProvisioningState) - populate(objectMap, "type", v.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VPNGatewayNatRuleProperties. -func (v *VPNGatewayNatRuleProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "egressVpnSiteLinkConnections": - err = unpopulate(val, "EgressVPNSiteLinkConnections", &v.EgressVPNSiteLinkConnections) - delete(rawMsg, key) - case "externalMappings": - err = unpopulate(val, "ExternalMappings", &v.ExternalMappings) - delete(rawMsg, key) - case "ipConfigurationId": - err = unpopulate(val, "IPConfigurationID", &v.IPConfigurationID) - delete(rawMsg, key) - case "ingressVpnSiteLinkConnections": - err = unpopulate(val, "IngressVPNSiteLinkConnections", &v.IngressVPNSiteLinkConnections) - delete(rawMsg, key) - case "internalMappings": - err = unpopulate(val, "InternalMappings", &v.InternalMappings) - delete(rawMsg, key) - case "mode": - err = unpopulate(val, "Mode", &v.Mode) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &v.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VPNGatewayPacketCaptureStartParameters. -func (v VPNGatewayPacketCaptureStartParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "filterData", v.FilterData) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VPNGatewayPacketCaptureStartParameters. -func (v *VPNGatewayPacketCaptureStartParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "filterData": - err = unpopulate(val, "FilterData", &v.FilterData) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VPNGatewayPacketCaptureStopParameters. -func (v VPNGatewayPacketCaptureStopParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "sasUrl", v.SasURL) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VPNGatewayPacketCaptureStopParameters. -func (v *VPNGatewayPacketCaptureStopParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "sasUrl": - err = unpopulate(val, "SasURL", &v.SasURL) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VPNGatewayProperties. -func (v VPNGatewayProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "bgpSettings", v.BgpSettings) - populate(objectMap, "connections", v.Connections) - populate(objectMap, "enableBgpRouteTranslationForNat", v.EnableBgpRouteTranslationForNat) - populate(objectMap, "ipConfigurations", v.IPConfigurations) - populate(objectMap, "isRoutingPreferenceInternet", v.IsRoutingPreferenceInternet) - populate(objectMap, "natRules", v.NatRules) - populate(objectMap, "provisioningState", v.ProvisioningState) - populate(objectMap, "vpnGatewayScaleUnit", v.VPNGatewayScaleUnit) - populate(objectMap, "virtualHub", v.VirtualHub) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VPNGatewayProperties. -func (v *VPNGatewayProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "bgpSettings": - err = unpopulate(val, "BgpSettings", &v.BgpSettings) - delete(rawMsg, key) - case "connections": - err = unpopulate(val, "Connections", &v.Connections) - delete(rawMsg, key) - case "enableBgpRouteTranslationForNat": - err = unpopulate(val, "EnableBgpRouteTranslationForNat", &v.EnableBgpRouteTranslationForNat) - delete(rawMsg, key) - case "ipConfigurations": - err = unpopulate(val, "IPConfigurations", &v.IPConfigurations) - delete(rawMsg, key) - case "isRoutingPreferenceInternet": - err = unpopulate(val, "IsRoutingPreferenceInternet", &v.IsRoutingPreferenceInternet) - delete(rawMsg, key) - case "natRules": - err = unpopulate(val, "NatRules", &v.NatRules) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) - delete(rawMsg, key) - case "vpnGatewayScaleUnit": - err = unpopulate(val, "VPNGatewayScaleUnit", &v.VPNGatewayScaleUnit) - delete(rawMsg, key) - case "virtualHub": - err = unpopulate(val, "VirtualHub", &v.VirtualHub) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VPNLinkBgpSettings. -func (v VPNLinkBgpSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "asn", v.Asn) - populate(objectMap, "bgpPeeringAddress", v.BgpPeeringAddress) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VPNLinkBgpSettings. -func (v *VPNLinkBgpSettings) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "asn": - err = unpopulate(val, "Asn", &v.Asn) - delete(rawMsg, key) - case "bgpPeeringAddress": - err = unpopulate(val, "BgpPeeringAddress", &v.BgpPeeringAddress) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VPNLinkProviderProperties. -func (v VPNLinkProviderProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "linkProviderName", v.LinkProviderName) - populate(objectMap, "linkSpeedInMbps", v.LinkSpeedInMbps) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VPNLinkProviderProperties. -func (v *VPNLinkProviderProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "linkProviderName": - err = unpopulate(val, "LinkProviderName", &v.LinkProviderName) - delete(rawMsg, key) - case "linkSpeedInMbps": - err = unpopulate(val, "LinkSpeedInMbps", &v.LinkSpeedInMbps) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VPNNatRuleMapping. -func (v VPNNatRuleMapping) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "addressSpace", v.AddressSpace) - populate(objectMap, "portRange", v.PortRange) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VPNNatRuleMapping. -func (v *VPNNatRuleMapping) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "addressSpace": - err = unpopulate(val, "AddressSpace", &v.AddressSpace) - delete(rawMsg, key) - case "portRange": - err = unpopulate(val, "PortRange", &v.PortRange) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VPNPacketCaptureStartParameters. -func (v VPNPacketCaptureStartParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "filterData", v.FilterData) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VPNPacketCaptureStartParameters. -func (v *VPNPacketCaptureStartParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "filterData": - err = unpopulate(val, "FilterData", &v.FilterData) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VPNPacketCaptureStopParameters. -func (v VPNPacketCaptureStopParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "sasUrl", v.SasURL) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VPNPacketCaptureStopParameters. -func (v *VPNPacketCaptureStopParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "sasUrl": - err = unpopulate(val, "SasURL", &v.SasURL) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VPNProfileResponse. -func (v VPNProfileResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "profileUrl", v.ProfileURL) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VPNProfileResponse. -func (v *VPNProfileResponse) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "profileUrl": - err = unpopulate(val, "ProfileURL", &v.ProfileURL) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VPNServerConfigRadiusClientRootCertificate. -func (v VPNServerConfigRadiusClientRootCertificate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "name", v.Name) - populate(objectMap, "thumbprint", v.Thumbprint) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VPNServerConfigRadiusClientRootCertificate. -func (v *VPNServerConfigRadiusClientRootCertificate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "thumbprint": - err = unpopulate(val, "Thumbprint", &v.Thumbprint) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VPNServerConfigRadiusServerRootCertificate. -func (v VPNServerConfigRadiusServerRootCertificate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "name", v.Name) - populate(objectMap, "publicCertData", v.PublicCertData) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VPNServerConfigRadiusServerRootCertificate. -func (v *VPNServerConfigRadiusServerRootCertificate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "publicCertData": - err = unpopulate(val, "PublicCertData", &v.PublicCertData) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VPNServerConfigVPNClientRevokedCertificate. -func (v VPNServerConfigVPNClientRevokedCertificate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "name", v.Name) - populate(objectMap, "thumbprint", v.Thumbprint) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VPNServerConfigVPNClientRevokedCertificate. -func (v *VPNServerConfigVPNClientRevokedCertificate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "thumbprint": - err = unpopulate(val, "Thumbprint", &v.Thumbprint) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VPNServerConfigVPNClientRootCertificate. -func (v VPNServerConfigVPNClientRootCertificate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "name", v.Name) - populate(objectMap, "publicCertData", v.PublicCertData) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VPNServerConfigVPNClientRootCertificate. -func (v *VPNServerConfigVPNClientRootCertificate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "publicCertData": - err = unpopulate(val, "PublicCertData", &v.PublicCertData) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VPNServerConfiguration. -func (v VPNServerConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", v.Etag) - populate(objectMap, "id", v.ID) - populate(objectMap, "location", v.Location) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "tags", v.Tags) - populate(objectMap, "type", v.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VPNServerConfiguration. -func (v *VPNServerConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &v.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &v.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &v.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &v.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &v.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VPNServerConfigurationPolicyGroup. -func (v VPNServerConfigurationPolicyGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", v.Etag) - populate(objectMap, "id", v.ID) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "type", v.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VPNServerConfigurationPolicyGroup. -func (v *VPNServerConfigurationPolicyGroup) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &v.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &v.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &v.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VPNServerConfigurationPolicyGroupMember. -func (v VPNServerConfigurationPolicyGroupMember) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "attributeType", v.AttributeType) - populate(objectMap, "attributeValue", v.AttributeValue) - populate(objectMap, "name", v.Name) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VPNServerConfigurationPolicyGroupMember. -func (v *VPNServerConfigurationPolicyGroupMember) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "attributeType": - err = unpopulate(val, "AttributeType", &v.AttributeType) - delete(rawMsg, key) - case "attributeValue": - err = unpopulate(val, "AttributeValue", &v.AttributeValue) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VPNServerConfigurationPolicyGroupProperties. -func (v VPNServerConfigurationPolicyGroupProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "isDefault", v.IsDefault) - populate(objectMap, "p2SConnectionConfigurations", v.P2SConnectionConfigurations) - populate(objectMap, "policyMembers", v.PolicyMembers) - populate(objectMap, "priority", v.Priority) - populate(objectMap, "provisioningState", v.ProvisioningState) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VPNServerConfigurationPolicyGroupProperties. -func (v *VPNServerConfigurationPolicyGroupProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "isDefault": - err = unpopulate(val, "IsDefault", &v.IsDefault) - delete(rawMsg, key) - case "p2SConnectionConfigurations": - err = unpopulate(val, "P2SConnectionConfigurations", &v.P2SConnectionConfigurations) - delete(rawMsg, key) - case "policyMembers": - err = unpopulate(val, "PolicyMembers", &v.PolicyMembers) - delete(rawMsg, key) - case "priority": - err = unpopulate(val, "Priority", &v.Priority) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VPNServerConfigurationProperties. -func (v VPNServerConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "aadAuthenticationParameters", v.AADAuthenticationParameters) - populate(objectMap, "configurationPolicyGroups", v.ConfigurationPolicyGroups) - populate(objectMap, "etag", v.Etag) - populate(objectMap, "name", v.Name) - populate(objectMap, "p2SVpnGateways", v.P2SVPNGateways) - populate(objectMap, "provisioningState", v.ProvisioningState) - populate(objectMap, "radiusClientRootCertificates", v.RadiusClientRootCertificates) - populate(objectMap, "radiusServerAddress", v.RadiusServerAddress) - populate(objectMap, "radiusServerRootCertificates", v.RadiusServerRootCertificates) - populate(objectMap, "radiusServerSecret", v.RadiusServerSecret) - populate(objectMap, "radiusServers", v.RadiusServers) - populate(objectMap, "vpnAuthenticationTypes", v.VPNAuthenticationTypes) - populate(objectMap, "vpnClientIpsecPolicies", v.VPNClientIPSecPolicies) - populate(objectMap, "vpnClientRevokedCertificates", v.VPNClientRevokedCertificates) - populate(objectMap, "vpnClientRootCertificates", v.VPNClientRootCertificates) - populate(objectMap, "vpnProtocols", v.VPNProtocols) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VPNServerConfigurationProperties. -func (v *VPNServerConfigurationProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "aadAuthenticationParameters": - err = unpopulate(val, "AADAuthenticationParameters", &v.AADAuthenticationParameters) - delete(rawMsg, key) - case "configurationPolicyGroups": - err = unpopulate(val, "ConfigurationPolicyGroups", &v.ConfigurationPolicyGroups) - delete(rawMsg, key) - case "etag": - err = unpopulate(val, "Etag", &v.Etag) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "p2SVpnGateways": - err = unpopulate(val, "P2SVPNGateways", &v.P2SVPNGateways) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) - delete(rawMsg, key) - case "radiusClientRootCertificates": - err = unpopulate(val, "RadiusClientRootCertificates", &v.RadiusClientRootCertificates) - delete(rawMsg, key) - case "radiusServerAddress": - err = unpopulate(val, "RadiusServerAddress", &v.RadiusServerAddress) - delete(rawMsg, key) - case "radiusServerRootCertificates": - err = unpopulate(val, "RadiusServerRootCertificates", &v.RadiusServerRootCertificates) - delete(rawMsg, key) - case "radiusServerSecret": - err = unpopulate(val, "RadiusServerSecret", &v.RadiusServerSecret) - delete(rawMsg, key) - case "radiusServers": - err = unpopulate(val, "RadiusServers", &v.RadiusServers) - delete(rawMsg, key) - case "vpnAuthenticationTypes": - err = unpopulate(val, "VPNAuthenticationTypes", &v.VPNAuthenticationTypes) - delete(rawMsg, key) - case "vpnClientIpsecPolicies": - err = unpopulate(val, "VPNClientIPSecPolicies", &v.VPNClientIPSecPolicies) - delete(rawMsg, key) - case "vpnClientRevokedCertificates": - err = unpopulate(val, "VPNClientRevokedCertificates", &v.VPNClientRevokedCertificates) - delete(rawMsg, key) - case "vpnClientRootCertificates": - err = unpopulate(val, "VPNClientRootCertificates", &v.VPNClientRootCertificates) - delete(rawMsg, key) - case "vpnProtocols": - err = unpopulate(val, "VPNProtocols", &v.VPNProtocols) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VPNServerConfigurationsResponse. -func (v VPNServerConfigurationsResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "vpnServerConfigurationResourceIds", v.VPNServerConfigurationResourceIDs) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VPNServerConfigurationsResponse. -func (v *VPNServerConfigurationsResponse) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "vpnServerConfigurationResourceIds": - err = unpopulate(val, "VPNServerConfigurationResourceIDs", &v.VPNServerConfigurationResourceIDs) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VPNSite. -func (v VPNSite) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", v.Etag) - populate(objectMap, "id", v.ID) - populate(objectMap, "location", v.Location) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "tags", v.Tags) - populate(objectMap, "type", v.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VPNSite. -func (v *VPNSite) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &v.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &v.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &v.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &v.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &v.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VPNSiteID. -func (v VPNSiteID) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "vpnSite", v.VPNSite) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VPNSiteID. -func (v *VPNSiteID) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "vpnSite": - err = unpopulate(val, "VPNSite", &v.VPNSite) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VPNSiteLink. -func (v VPNSiteLink) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", v.Etag) - populate(objectMap, "id", v.ID) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "type", v.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VPNSiteLink. -func (v *VPNSiteLink) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &v.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &v.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &v.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VPNSiteLinkConnection. -func (v VPNSiteLinkConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", v.Etag) - populate(objectMap, "id", v.ID) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "type", v.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VPNSiteLinkConnection. -func (v *VPNSiteLinkConnection) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &v.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &v.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &v.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VPNSiteLinkConnectionProperties. -func (v VPNSiteLinkConnectionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "connectionBandwidth", v.ConnectionBandwidth) - populate(objectMap, "connectionStatus", v.ConnectionStatus) - populate(objectMap, "egressBytesTransferred", v.EgressBytesTransferred) - populate(objectMap, "egressNatRules", v.EgressNatRules) - populate(objectMap, "enableBgp", v.EnableBgp) - populate(objectMap, "enableRateLimiting", v.EnableRateLimiting) - populate(objectMap, "ipsecPolicies", v.IPSecPolicies) - populate(objectMap, "ingressBytesTransferred", v.IngressBytesTransferred) - populate(objectMap, "ingressNatRules", v.IngressNatRules) - populate(objectMap, "provisioningState", v.ProvisioningState) - populate(objectMap, "routingWeight", v.RoutingWeight) - populate(objectMap, "sharedKey", v.SharedKey) - populate(objectMap, "useLocalAzureIpAddress", v.UseLocalAzureIPAddress) - populate(objectMap, "usePolicyBasedTrafficSelectors", v.UsePolicyBasedTrafficSelectors) - populate(objectMap, "vpnConnectionProtocolType", v.VPNConnectionProtocolType) - populate(objectMap, "vpnGatewayCustomBgpAddresses", v.VPNGatewayCustomBgpAddresses) - populate(objectMap, "vpnLinkConnectionMode", v.VPNLinkConnectionMode) - populate(objectMap, "vpnSiteLink", v.VPNSiteLink) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VPNSiteLinkConnectionProperties. -func (v *VPNSiteLinkConnectionProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "connectionBandwidth": - err = unpopulate(val, "ConnectionBandwidth", &v.ConnectionBandwidth) - delete(rawMsg, key) - case "connectionStatus": - err = unpopulate(val, "ConnectionStatus", &v.ConnectionStatus) - delete(rawMsg, key) - case "egressBytesTransferred": - err = unpopulate(val, "EgressBytesTransferred", &v.EgressBytesTransferred) - delete(rawMsg, key) - case "egressNatRules": - err = unpopulate(val, "EgressNatRules", &v.EgressNatRules) - delete(rawMsg, key) - case "enableBgp": - err = unpopulate(val, "EnableBgp", &v.EnableBgp) - delete(rawMsg, key) - case "enableRateLimiting": - err = unpopulate(val, "EnableRateLimiting", &v.EnableRateLimiting) - delete(rawMsg, key) - case "ipsecPolicies": - err = unpopulate(val, "IPSecPolicies", &v.IPSecPolicies) - delete(rawMsg, key) - case "ingressBytesTransferred": - err = unpopulate(val, "IngressBytesTransferred", &v.IngressBytesTransferred) - delete(rawMsg, key) - case "ingressNatRules": - err = unpopulate(val, "IngressNatRules", &v.IngressNatRules) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) - delete(rawMsg, key) - case "routingWeight": - err = unpopulate(val, "RoutingWeight", &v.RoutingWeight) - delete(rawMsg, key) - case "sharedKey": - err = unpopulate(val, "SharedKey", &v.SharedKey) - delete(rawMsg, key) - case "useLocalAzureIpAddress": - err = unpopulate(val, "UseLocalAzureIPAddress", &v.UseLocalAzureIPAddress) - delete(rawMsg, key) - case "usePolicyBasedTrafficSelectors": - err = unpopulate(val, "UsePolicyBasedTrafficSelectors", &v.UsePolicyBasedTrafficSelectors) - delete(rawMsg, key) - case "vpnConnectionProtocolType": - err = unpopulate(val, "VPNConnectionProtocolType", &v.VPNConnectionProtocolType) - delete(rawMsg, key) - case "vpnGatewayCustomBgpAddresses": - err = unpopulate(val, "VPNGatewayCustomBgpAddresses", &v.VPNGatewayCustomBgpAddresses) - delete(rawMsg, key) - case "vpnLinkConnectionMode": - err = unpopulate(val, "VPNLinkConnectionMode", &v.VPNLinkConnectionMode) - delete(rawMsg, key) - case "vpnSiteLink": - err = unpopulate(val, "VPNSiteLink", &v.VPNSiteLink) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VPNSiteLinkProperties. -func (v VPNSiteLinkProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "bgpProperties", v.BgpProperties) - populate(objectMap, "fqdn", v.Fqdn) - populate(objectMap, "ipAddress", v.IPAddress) - populate(objectMap, "linkProperties", v.LinkProperties) - populate(objectMap, "provisioningState", v.ProvisioningState) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VPNSiteLinkProperties. -func (v *VPNSiteLinkProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "bgpProperties": - err = unpopulate(val, "BgpProperties", &v.BgpProperties) - delete(rawMsg, key) - case "fqdn": - err = unpopulate(val, "Fqdn", &v.Fqdn) - delete(rawMsg, key) - case "ipAddress": - err = unpopulate(val, "IPAddress", &v.IPAddress) - delete(rawMsg, key) - case "linkProperties": - err = unpopulate(val, "LinkProperties", &v.LinkProperties) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VPNSiteProperties. -func (v VPNSiteProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "addressSpace", v.AddressSpace) - populate(objectMap, "bgpProperties", v.BgpProperties) - populate(objectMap, "deviceProperties", v.DeviceProperties) - populate(objectMap, "ipAddress", v.IPAddress) - populate(objectMap, "isSecuritySite", v.IsSecuritySite) - populate(objectMap, "o365Policy", v.O365Policy) - populate(objectMap, "provisioningState", v.ProvisioningState) - populate(objectMap, "siteKey", v.SiteKey) - populate(objectMap, "vpnSiteLinks", v.VPNSiteLinks) - populate(objectMap, "virtualWan", v.VirtualWan) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VPNSiteProperties. -func (v *VPNSiteProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "addressSpace": - err = unpopulate(val, "AddressSpace", &v.AddressSpace) - delete(rawMsg, key) - case "bgpProperties": - err = unpopulate(val, "BgpProperties", &v.BgpProperties) - delete(rawMsg, key) - case "deviceProperties": - err = unpopulate(val, "DeviceProperties", &v.DeviceProperties) - delete(rawMsg, key) - case "ipAddress": - err = unpopulate(val, "IPAddress", &v.IPAddress) - delete(rawMsg, key) - case "isSecuritySite": - err = unpopulate(val, "IsSecuritySite", &v.IsSecuritySite) - delete(rawMsg, key) - case "o365Policy": - err = unpopulate(val, "O365Policy", &v.O365Policy) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) - delete(rawMsg, key) - case "siteKey": - err = unpopulate(val, "SiteKey", &v.SiteKey) - delete(rawMsg, key) - case "vpnSiteLinks": - err = unpopulate(val, "VPNSiteLinks", &v.VPNSiteLinks) - delete(rawMsg, key) - case "virtualWan": - err = unpopulate(val, "VirtualWan", &v.VirtualWan) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VerificationIPFlowParameters. -func (v VerificationIPFlowParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "direction", v.Direction) - populate(objectMap, "localIPAddress", v.LocalIPAddress) - populate(objectMap, "localPort", v.LocalPort) - populate(objectMap, "protocol", v.Protocol) - populate(objectMap, "remoteIPAddress", v.RemoteIPAddress) - populate(objectMap, "remotePort", v.RemotePort) - populate(objectMap, "targetNicResourceId", v.TargetNicResourceID) - populate(objectMap, "targetResourceId", v.TargetResourceID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VerificationIPFlowParameters. -func (v *VerificationIPFlowParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "direction": - err = unpopulate(val, "Direction", &v.Direction) - delete(rawMsg, key) - case "localIPAddress": - err = unpopulate(val, "LocalIPAddress", &v.LocalIPAddress) - delete(rawMsg, key) - case "localPort": - err = unpopulate(val, "LocalPort", &v.LocalPort) - delete(rawMsg, key) - case "protocol": - err = unpopulate(val, "Protocol", &v.Protocol) - delete(rawMsg, key) - case "remoteIPAddress": - err = unpopulate(val, "RemoteIPAddress", &v.RemoteIPAddress) - delete(rawMsg, key) - case "remotePort": - err = unpopulate(val, "RemotePort", &v.RemotePort) - delete(rawMsg, key) - case "targetNicResourceId": - err = unpopulate(val, "TargetNicResourceID", &v.TargetNicResourceID) - delete(rawMsg, key) - case "targetResourceId": - err = unpopulate(val, "TargetResourceID", &v.TargetResourceID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VerificationIPFlowResult. -func (v VerificationIPFlowResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "access", v.Access) - populate(objectMap, "ruleName", v.RuleName) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VerificationIPFlowResult. -func (v *VerificationIPFlowResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "access": - err = unpopulate(val, "Access", &v.Access) - delete(rawMsg, key) - case "ruleName": - err = unpopulate(val, "RuleName", &v.RuleName) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualAppliance. -func (v VirtualAppliance) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", v.Etag) - populate(objectMap, "id", v.ID) - populate(objectMap, "identity", v.Identity) - populate(objectMap, "location", v.Location) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "tags", v.Tags) - populate(objectMap, "type", v.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualAppliance. -func (v *VirtualAppliance) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &v.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &v.ID) - delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &v.Identity) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &v.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &v.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &v.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualApplianceListResult. -func (v VirtualApplianceListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", v.NextLink) - populate(objectMap, "value", v.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualApplianceListResult. -func (v *VirtualApplianceListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &v.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &v.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualApplianceNicProperties. -func (v VirtualApplianceNicProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "name", v.Name) - populate(objectMap, "privateIpAddress", v.PrivateIPAddress) - populate(objectMap, "publicIpAddress", v.PublicIPAddress) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualApplianceNicProperties. -func (v *VirtualApplianceNicProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "privateIpAddress": - err = unpopulate(val, "PrivateIPAddress", &v.PrivateIPAddress) - delete(rawMsg, key) - case "publicIpAddress": - err = unpopulate(val, "PublicIPAddress", &v.PublicIPAddress) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualAppliancePropertiesFormat. -func (v VirtualAppliancePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "addressPrefix", v.AddressPrefix) - populate(objectMap, "bootStrapConfigurationBlobs", v.BootStrapConfigurationBlobs) - populate(objectMap, "cloudInitConfiguration", v.CloudInitConfiguration) - populate(objectMap, "cloudInitConfigurationBlobs", v.CloudInitConfigurationBlobs) - populate(objectMap, "inboundSecurityRules", v.InboundSecurityRules) - populate(objectMap, "nvaSku", v.NvaSKU) - populate(objectMap, "provisioningState", v.ProvisioningState) - populate(objectMap, "sshPublicKey", v.SSHPublicKey) - populate(objectMap, "virtualApplianceAsn", v.VirtualApplianceAsn) - populate(objectMap, "virtualApplianceNics", v.VirtualApplianceNics) - populate(objectMap, "virtualApplianceSites", v.VirtualApplianceSites) - populate(objectMap, "virtualHub", v.VirtualHub) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualAppliancePropertiesFormat. -func (v *VirtualAppliancePropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "addressPrefix": - err = unpopulate(val, "AddressPrefix", &v.AddressPrefix) - delete(rawMsg, key) - case "bootStrapConfigurationBlobs": - err = unpopulate(val, "BootStrapConfigurationBlobs", &v.BootStrapConfigurationBlobs) - delete(rawMsg, key) - case "cloudInitConfiguration": - err = unpopulate(val, "CloudInitConfiguration", &v.CloudInitConfiguration) - delete(rawMsg, key) - case "cloudInitConfigurationBlobs": - err = unpopulate(val, "CloudInitConfigurationBlobs", &v.CloudInitConfigurationBlobs) - delete(rawMsg, key) - case "inboundSecurityRules": - err = unpopulate(val, "InboundSecurityRules", &v.InboundSecurityRules) - delete(rawMsg, key) - case "nvaSku": - err = unpopulate(val, "NvaSKU", &v.NvaSKU) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) - delete(rawMsg, key) - case "sshPublicKey": - err = unpopulate(val, "SSHPublicKey", &v.SSHPublicKey) - delete(rawMsg, key) - case "virtualApplianceAsn": - err = unpopulate(val, "VirtualApplianceAsn", &v.VirtualApplianceAsn) - delete(rawMsg, key) - case "virtualApplianceNics": - err = unpopulate(val, "VirtualApplianceNics", &v.VirtualApplianceNics) - delete(rawMsg, key) - case "virtualApplianceSites": - err = unpopulate(val, "VirtualApplianceSites", &v.VirtualApplianceSites) - delete(rawMsg, key) - case "virtualHub": - err = unpopulate(val, "VirtualHub", &v.VirtualHub) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualApplianceSKU. -func (v VirtualApplianceSKU) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", v.Etag) - populate(objectMap, "id", v.ID) - populate(objectMap, "location", v.Location) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "tags", v.Tags) - populate(objectMap, "type", v.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualApplianceSKU. -func (v *VirtualApplianceSKU) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &v.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &v.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &v.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &v.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &v.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualApplianceSKUInstances. -func (v VirtualApplianceSKUInstances) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "instanceCount", v.InstanceCount) - populate(objectMap, "scaleUnit", v.ScaleUnit) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualApplianceSKUInstances. -func (v *VirtualApplianceSKUInstances) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "instanceCount": - err = unpopulate(val, "InstanceCount", &v.InstanceCount) - delete(rawMsg, key) - case "scaleUnit": - err = unpopulate(val, "ScaleUnit", &v.ScaleUnit) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualApplianceSKUListResult. -func (v VirtualApplianceSKUListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", v.NextLink) - populate(objectMap, "value", v.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualApplianceSKUListResult. -func (v *VirtualApplianceSKUListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &v.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &v.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualApplianceSKUProperties. -func (v VirtualApplianceSKUProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "bundledScaleUnit", v.BundledScaleUnit) - populate(objectMap, "marketPlaceVersion", v.MarketPlaceVersion) - populate(objectMap, "vendor", v.Vendor) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualApplianceSKUProperties. -func (v *VirtualApplianceSKUProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "bundledScaleUnit": - err = unpopulate(val, "BundledScaleUnit", &v.BundledScaleUnit) - delete(rawMsg, key) - case "marketPlaceVersion": - err = unpopulate(val, "MarketPlaceVersion", &v.MarketPlaceVersion) - delete(rawMsg, key) - case "vendor": - err = unpopulate(val, "Vendor", &v.Vendor) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualApplianceSKUPropertiesFormat. -func (v VirtualApplianceSKUPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "availableScaleUnits", v.AvailableScaleUnits) - populate(objectMap, "availableVersions", v.AvailableVersions) - populate(objectMap, "vendor", v.Vendor) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualApplianceSKUPropertiesFormat. -func (v *VirtualApplianceSKUPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "availableScaleUnits": - err = unpopulate(val, "AvailableScaleUnits", &v.AvailableScaleUnits) - delete(rawMsg, key) - case "availableVersions": - err = unpopulate(val, "AvailableVersions", &v.AvailableVersions) - delete(rawMsg, key) - case "vendor": - err = unpopulate(val, "Vendor", &v.Vendor) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualApplianceSite. -func (v VirtualApplianceSite) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", v.Etag) - populate(objectMap, "id", v.ID) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "type", v.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualApplianceSite. -func (v *VirtualApplianceSite) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &v.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &v.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &v.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualApplianceSiteListResult. -func (v VirtualApplianceSiteListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", v.NextLink) - populate(objectMap, "value", v.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualApplianceSiteListResult. -func (v *VirtualApplianceSiteListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &v.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &v.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualApplianceSiteProperties. -func (v VirtualApplianceSiteProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "addressPrefix", v.AddressPrefix) - populate(objectMap, "o365Policy", v.O365Policy) - populate(objectMap, "provisioningState", v.ProvisioningState) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualApplianceSiteProperties. -func (v *VirtualApplianceSiteProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "addressPrefix": - err = unpopulate(val, "AddressPrefix", &v.AddressPrefix) - delete(rawMsg, key) - case "o365Policy": - err = unpopulate(val, "O365Policy", &v.O365Policy) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualHub. -func (v VirtualHub) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", v.Etag) - populate(objectMap, "id", v.ID) - populate(objectMap, "kind", v.Kind) - populate(objectMap, "location", v.Location) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "tags", v.Tags) - populate(objectMap, "type", v.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualHub. -func (v *VirtualHub) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &v.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &v.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &v.Kind) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &v.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &v.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &v.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualHubEffectiveRoute. -func (v VirtualHubEffectiveRoute) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "addressPrefixes", v.AddressPrefixes) - populate(objectMap, "asPath", v.AsPath) - populate(objectMap, "nextHopType", v.NextHopType) - populate(objectMap, "nextHops", v.NextHops) - populate(objectMap, "routeOrigin", v.RouteOrigin) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualHubEffectiveRoute. -func (v *VirtualHubEffectiveRoute) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "addressPrefixes": - err = unpopulate(val, "AddressPrefixes", &v.AddressPrefixes) - delete(rawMsg, key) - case "asPath": - err = unpopulate(val, "AsPath", &v.AsPath) - delete(rawMsg, key) - case "nextHopType": - err = unpopulate(val, "NextHopType", &v.NextHopType) - delete(rawMsg, key) - case "nextHops": - err = unpopulate(val, "NextHops", &v.NextHops) - delete(rawMsg, key) - case "routeOrigin": - err = unpopulate(val, "RouteOrigin", &v.RouteOrigin) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualHubEffectiveRouteList. -func (v VirtualHubEffectiveRouteList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "value", v.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualHubEffectiveRouteList. -func (v *VirtualHubEffectiveRouteList) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "value": - err = unpopulate(val, "Value", &v.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualHubID. -func (v VirtualHubID) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", v.ID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualHubID. -func (v *VirtualHubID) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &v.ID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualHubProperties. -func (v VirtualHubProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "addressPrefix", v.AddressPrefix) - populate(objectMap, "allowBranchToBranchTraffic", v.AllowBranchToBranchTraffic) - populate(objectMap, "azureFirewall", v.AzureFirewall) - populate(objectMap, "bgpConnections", v.BgpConnections) - populate(objectMap, "expressRouteGateway", v.ExpressRouteGateway) - populate(objectMap, "hubRoutingPreference", v.HubRoutingPreference) - populate(objectMap, "ipConfigurations", v.IPConfigurations) - populate(objectMap, "p2SVpnGateway", v.P2SVPNGateway) - populate(objectMap, "preferredRoutingGateway", v.PreferredRoutingGateway) - populate(objectMap, "provisioningState", v.ProvisioningState) - populate(objectMap, "routeTable", v.RouteTable) - populate(objectMap, "routingState", v.RoutingState) - populate(objectMap, "sku", v.SKU) - populate(objectMap, "securityPartnerProvider", v.SecurityPartnerProvider) - populate(objectMap, "securityProviderName", v.SecurityProviderName) - populate(objectMap, "vpnGateway", v.VPNGateway) - populate(objectMap, "virtualHubRouteTableV2s", v.VirtualHubRouteTableV2S) - populate(objectMap, "virtualRouterAsn", v.VirtualRouterAsn) - populate(objectMap, "virtualRouterAutoScaleConfiguration", v.VirtualRouterAutoScaleConfiguration) - populate(objectMap, "virtualRouterIps", v.VirtualRouterIPs) - populate(objectMap, "virtualWan", v.VirtualWan) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualHubProperties. -func (v *VirtualHubProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "addressPrefix": - err = unpopulate(val, "AddressPrefix", &v.AddressPrefix) - delete(rawMsg, key) - case "allowBranchToBranchTraffic": - err = unpopulate(val, "AllowBranchToBranchTraffic", &v.AllowBranchToBranchTraffic) - delete(rawMsg, key) - case "azureFirewall": - err = unpopulate(val, "AzureFirewall", &v.AzureFirewall) - delete(rawMsg, key) - case "bgpConnections": - err = unpopulate(val, "BgpConnections", &v.BgpConnections) - delete(rawMsg, key) - case "expressRouteGateway": - err = unpopulate(val, "ExpressRouteGateway", &v.ExpressRouteGateway) - delete(rawMsg, key) - case "hubRoutingPreference": - err = unpopulate(val, "HubRoutingPreference", &v.HubRoutingPreference) - delete(rawMsg, key) - case "ipConfigurations": - err = unpopulate(val, "IPConfigurations", &v.IPConfigurations) - delete(rawMsg, key) - case "p2SVpnGateway": - err = unpopulate(val, "P2SVPNGateway", &v.P2SVPNGateway) - delete(rawMsg, key) - case "preferredRoutingGateway": - err = unpopulate(val, "PreferredRoutingGateway", &v.PreferredRoutingGateway) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) - delete(rawMsg, key) - case "routeTable": - err = unpopulate(val, "RouteTable", &v.RouteTable) - delete(rawMsg, key) - case "routingState": - err = unpopulate(val, "RoutingState", &v.RoutingState) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &v.SKU) - delete(rawMsg, key) - case "securityPartnerProvider": - err = unpopulate(val, "SecurityPartnerProvider", &v.SecurityPartnerProvider) - delete(rawMsg, key) - case "securityProviderName": - err = unpopulate(val, "SecurityProviderName", &v.SecurityProviderName) - delete(rawMsg, key) - case "vpnGateway": - err = unpopulate(val, "VPNGateway", &v.VPNGateway) - delete(rawMsg, key) - case "virtualHubRouteTableV2s": - err = unpopulate(val, "VirtualHubRouteTableV2S", &v.VirtualHubRouteTableV2S) - delete(rawMsg, key) - case "virtualRouterAsn": - err = unpopulate(val, "VirtualRouterAsn", &v.VirtualRouterAsn) - delete(rawMsg, key) - case "virtualRouterAutoScaleConfiguration": - err = unpopulate(val, "VirtualRouterAutoScaleConfiguration", &v.VirtualRouterAutoScaleConfiguration) - delete(rawMsg, key) - case "virtualRouterIps": - err = unpopulate(val, "VirtualRouterIPs", &v.VirtualRouterIPs) - delete(rawMsg, key) - case "virtualWan": - err = unpopulate(val, "VirtualWan", &v.VirtualWan) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualHubRoute. -func (v VirtualHubRoute) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "addressPrefixes", v.AddressPrefixes) - populate(objectMap, "nextHopIpAddress", v.NextHopIPAddress) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualHubRoute. -func (v *VirtualHubRoute) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "addressPrefixes": - err = unpopulate(val, "AddressPrefixes", &v.AddressPrefixes) - delete(rawMsg, key) - case "nextHopIpAddress": - err = unpopulate(val, "NextHopIPAddress", &v.NextHopIPAddress) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualHubRouteTable. -func (v VirtualHubRouteTable) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "routes", v.Routes) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualHubRouteTable. -func (v *VirtualHubRouteTable) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "routes": - err = unpopulate(val, "Routes", &v.Routes) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualHubRouteTableV2. -func (v VirtualHubRouteTableV2) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", v.Etag) - populate(objectMap, "id", v.ID) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualHubRouteTableV2. -func (v *VirtualHubRouteTableV2) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &v.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &v.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualHubRouteTableV2Properties. -func (v VirtualHubRouteTableV2Properties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "attachedConnections", v.AttachedConnections) - populate(objectMap, "provisioningState", v.ProvisioningState) - populate(objectMap, "routes", v.Routes) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualHubRouteTableV2Properties. -func (v *VirtualHubRouteTableV2Properties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "attachedConnections": - err = unpopulate(val, "AttachedConnections", &v.AttachedConnections) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) - delete(rawMsg, key) - case "routes": - err = unpopulate(val, "Routes", &v.Routes) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualHubRouteV2. -func (v VirtualHubRouteV2) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "destinationType", v.DestinationType) - populate(objectMap, "destinations", v.Destinations) - populate(objectMap, "nextHopType", v.NextHopType) - populate(objectMap, "nextHops", v.NextHops) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualHubRouteV2. -func (v *VirtualHubRouteV2) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "destinationType": - err = unpopulate(val, "DestinationType", &v.DestinationType) - delete(rawMsg, key) - case "destinations": - err = unpopulate(val, "Destinations", &v.Destinations) - delete(rawMsg, key) - case "nextHopType": - err = unpopulate(val, "NextHopType", &v.NextHopType) - delete(rawMsg, key) - case "nextHops": - err = unpopulate(val, "NextHops", &v.NextHops) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualNetwork. -func (v VirtualNetwork) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", v.Etag) - populate(objectMap, "extendedLocation", v.ExtendedLocation) - populate(objectMap, "id", v.ID) - populate(objectMap, "location", v.Location) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "tags", v.Tags) - populate(objectMap, "type", v.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetwork. -func (v *VirtualNetwork) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &v.Etag) - delete(rawMsg, key) - case "extendedLocation": - err = unpopulate(val, "ExtendedLocation", &v.ExtendedLocation) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &v.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &v.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &v.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &v.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkBgpCommunities. -func (v VirtualNetworkBgpCommunities) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "regionalCommunity", v.RegionalCommunity) - populate(objectMap, "virtualNetworkCommunity", v.VirtualNetworkCommunity) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkBgpCommunities. -func (v *VirtualNetworkBgpCommunities) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "regionalCommunity": - err = unpopulate(val, "RegionalCommunity", &v.RegionalCommunity) - delete(rawMsg, key) - case "virtualNetworkCommunity": - err = unpopulate(val, "VirtualNetworkCommunity", &v.VirtualNetworkCommunity) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkConnectionGatewayReference. -func (v VirtualNetworkConnectionGatewayReference) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", v.ID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkConnectionGatewayReference. -func (v *VirtualNetworkConnectionGatewayReference) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &v.ID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkEncryption. -func (v VirtualNetworkEncryption) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "enabled", v.Enabled) - populate(objectMap, "enforcement", v.Enforcement) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkEncryption. -func (v *VirtualNetworkEncryption) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "enabled": - err = unpopulate(val, "Enabled", &v.Enabled) - delete(rawMsg, key) - case "enforcement": - err = unpopulate(val, "Enforcement", &v.Enforcement) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkGateway. -func (v VirtualNetworkGateway) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", v.Etag) - populate(objectMap, "extendedLocation", v.ExtendedLocation) - populate(objectMap, "id", v.ID) - populate(objectMap, "location", v.Location) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "tags", v.Tags) - populate(objectMap, "type", v.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGateway. -func (v *VirtualNetworkGateway) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &v.Etag) - delete(rawMsg, key) - case "extendedLocation": - err = unpopulate(val, "ExtendedLocation", &v.ExtendedLocation) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &v.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &v.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &v.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &v.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkGatewayConnection. -func (v VirtualNetworkGatewayConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", v.Etag) - populate(objectMap, "id", v.ID) - populate(objectMap, "location", v.Location) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "tags", v.Tags) - populate(objectMap, "type", v.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewayConnection. -func (v *VirtualNetworkGatewayConnection) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &v.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &v.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &v.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &v.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &v.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkGatewayConnectionListEntity. -func (v VirtualNetworkGatewayConnectionListEntity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", v.Etag) - populate(objectMap, "id", v.ID) - populate(objectMap, "location", v.Location) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "tags", v.Tags) - populate(objectMap, "type", v.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewayConnectionListEntity. -func (v *VirtualNetworkGatewayConnectionListEntity) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &v.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &v.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &v.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &v.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &v.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkGatewayConnectionListEntityPropertiesFormat. -func (v VirtualNetworkGatewayConnectionListEntityPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "authorizationKey", v.AuthorizationKey) - populate(objectMap, "connectionMode", v.ConnectionMode) - populate(objectMap, "connectionProtocol", v.ConnectionProtocol) - populate(objectMap, "connectionStatus", v.ConnectionStatus) - populate(objectMap, "connectionType", v.ConnectionType) - populate(objectMap, "egressBytesTransferred", v.EgressBytesTransferred) - populate(objectMap, "enableBgp", v.EnableBgp) - populate(objectMap, "expressRouteGatewayBypass", v.ExpressRouteGatewayBypass) - populate(objectMap, "gatewayCustomBgpIpAddresses", v.GatewayCustomBgpIPAddresses) - populate(objectMap, "ipsecPolicies", v.IPSecPolicies) - populate(objectMap, "ingressBytesTransferred", v.IngressBytesTransferred) - populate(objectMap, "localNetworkGateway2", v.LocalNetworkGateway2) - populate(objectMap, "peer", v.Peer) - populate(objectMap, "provisioningState", v.ProvisioningState) - populate(objectMap, "resourceGuid", v.ResourceGUID) - populate(objectMap, "routingWeight", v.RoutingWeight) - populate(objectMap, "sharedKey", v.SharedKey) - populate(objectMap, "trafficSelectorPolicies", v.TrafficSelectorPolicies) - populate(objectMap, "tunnelConnectionStatus", v.TunnelConnectionStatus) - populate(objectMap, "usePolicyBasedTrafficSelectors", v.UsePolicyBasedTrafficSelectors) - populate(objectMap, "virtualNetworkGateway1", v.VirtualNetworkGateway1) - populate(objectMap, "virtualNetworkGateway2", v.VirtualNetworkGateway2) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewayConnectionListEntityPropertiesFormat. -func (v *VirtualNetworkGatewayConnectionListEntityPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "authorizationKey": - err = unpopulate(val, "AuthorizationKey", &v.AuthorizationKey) - delete(rawMsg, key) - case "connectionMode": - err = unpopulate(val, "ConnectionMode", &v.ConnectionMode) - delete(rawMsg, key) - case "connectionProtocol": - err = unpopulate(val, "ConnectionProtocol", &v.ConnectionProtocol) - delete(rawMsg, key) - case "connectionStatus": - err = unpopulate(val, "ConnectionStatus", &v.ConnectionStatus) - delete(rawMsg, key) - case "connectionType": - err = unpopulate(val, "ConnectionType", &v.ConnectionType) - delete(rawMsg, key) - case "egressBytesTransferred": - err = unpopulate(val, "EgressBytesTransferred", &v.EgressBytesTransferred) - delete(rawMsg, key) - case "enableBgp": - err = unpopulate(val, "EnableBgp", &v.EnableBgp) - delete(rawMsg, key) - case "expressRouteGatewayBypass": - err = unpopulate(val, "ExpressRouteGatewayBypass", &v.ExpressRouteGatewayBypass) - delete(rawMsg, key) - case "gatewayCustomBgpIpAddresses": - err = unpopulate(val, "GatewayCustomBgpIPAddresses", &v.GatewayCustomBgpIPAddresses) - delete(rawMsg, key) - case "ipsecPolicies": - err = unpopulate(val, "IPSecPolicies", &v.IPSecPolicies) - delete(rawMsg, key) - case "ingressBytesTransferred": - err = unpopulate(val, "IngressBytesTransferred", &v.IngressBytesTransferred) - delete(rawMsg, key) - case "localNetworkGateway2": - err = unpopulate(val, "LocalNetworkGateway2", &v.LocalNetworkGateway2) - delete(rawMsg, key) - case "peer": - err = unpopulate(val, "Peer", &v.Peer) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) - delete(rawMsg, key) - case "resourceGuid": - err = unpopulate(val, "ResourceGUID", &v.ResourceGUID) - delete(rawMsg, key) - case "routingWeight": - err = unpopulate(val, "RoutingWeight", &v.RoutingWeight) - delete(rawMsg, key) - case "sharedKey": - err = unpopulate(val, "SharedKey", &v.SharedKey) - delete(rawMsg, key) - case "trafficSelectorPolicies": - err = unpopulate(val, "TrafficSelectorPolicies", &v.TrafficSelectorPolicies) - delete(rawMsg, key) - case "tunnelConnectionStatus": - err = unpopulate(val, "TunnelConnectionStatus", &v.TunnelConnectionStatus) - delete(rawMsg, key) - case "usePolicyBasedTrafficSelectors": - err = unpopulate(val, "UsePolicyBasedTrafficSelectors", &v.UsePolicyBasedTrafficSelectors) - delete(rawMsg, key) - case "virtualNetworkGateway1": - err = unpopulate(val, "VirtualNetworkGateway1", &v.VirtualNetworkGateway1) - delete(rawMsg, key) - case "virtualNetworkGateway2": - err = unpopulate(val, "VirtualNetworkGateway2", &v.VirtualNetworkGateway2) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkGatewayConnectionListResult. -func (v VirtualNetworkGatewayConnectionListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", v.NextLink) - populate(objectMap, "value", v.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewayConnectionListResult. -func (v *VirtualNetworkGatewayConnectionListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &v.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &v.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkGatewayConnectionPropertiesFormat. -func (v VirtualNetworkGatewayConnectionPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "authorizationKey", v.AuthorizationKey) - populate(objectMap, "connectionMode", v.ConnectionMode) - populate(objectMap, "connectionProtocol", v.ConnectionProtocol) - populate(objectMap, "connectionStatus", v.ConnectionStatus) - populate(objectMap, "connectionType", v.ConnectionType) - populate(objectMap, "dpdTimeoutSeconds", v.DpdTimeoutSeconds) - populate(objectMap, "egressBytesTransferred", v.EgressBytesTransferred) - populate(objectMap, "egressNatRules", v.EgressNatRules) - populate(objectMap, "enableBgp", v.EnableBgp) - populate(objectMap, "expressRouteGatewayBypass", v.ExpressRouteGatewayBypass) - populate(objectMap, "gatewayCustomBgpIpAddresses", v.GatewayCustomBgpIPAddresses) - populate(objectMap, "ipsecPolicies", v.IPSecPolicies) - populate(objectMap, "ingressBytesTransferred", v.IngressBytesTransferred) - populate(objectMap, "ingressNatRules", v.IngressNatRules) - populate(objectMap, "localNetworkGateway2", v.LocalNetworkGateway2) - populate(objectMap, "peer", v.Peer) - populate(objectMap, "provisioningState", v.ProvisioningState) - populate(objectMap, "resourceGuid", v.ResourceGUID) - populate(objectMap, "routingWeight", v.RoutingWeight) - populate(objectMap, "sharedKey", v.SharedKey) - populate(objectMap, "trafficSelectorPolicies", v.TrafficSelectorPolicies) - populate(objectMap, "tunnelConnectionStatus", v.TunnelConnectionStatus) - populate(objectMap, "useLocalAzureIpAddress", v.UseLocalAzureIPAddress) - populate(objectMap, "usePolicyBasedTrafficSelectors", v.UsePolicyBasedTrafficSelectors) - populate(objectMap, "virtualNetworkGateway1", v.VirtualNetworkGateway1) - populate(objectMap, "virtualNetworkGateway2", v.VirtualNetworkGateway2) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewayConnectionPropertiesFormat. -func (v *VirtualNetworkGatewayConnectionPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "authorizationKey": - err = unpopulate(val, "AuthorizationKey", &v.AuthorizationKey) - delete(rawMsg, key) - case "connectionMode": - err = unpopulate(val, "ConnectionMode", &v.ConnectionMode) - delete(rawMsg, key) - case "connectionProtocol": - err = unpopulate(val, "ConnectionProtocol", &v.ConnectionProtocol) - delete(rawMsg, key) - case "connectionStatus": - err = unpopulate(val, "ConnectionStatus", &v.ConnectionStatus) - delete(rawMsg, key) - case "connectionType": - err = unpopulate(val, "ConnectionType", &v.ConnectionType) - delete(rawMsg, key) - case "dpdTimeoutSeconds": - err = unpopulate(val, "DpdTimeoutSeconds", &v.DpdTimeoutSeconds) - delete(rawMsg, key) - case "egressBytesTransferred": - err = unpopulate(val, "EgressBytesTransferred", &v.EgressBytesTransferred) - delete(rawMsg, key) - case "egressNatRules": - err = unpopulate(val, "EgressNatRules", &v.EgressNatRules) - delete(rawMsg, key) - case "enableBgp": - err = unpopulate(val, "EnableBgp", &v.EnableBgp) - delete(rawMsg, key) - case "expressRouteGatewayBypass": - err = unpopulate(val, "ExpressRouteGatewayBypass", &v.ExpressRouteGatewayBypass) - delete(rawMsg, key) - case "gatewayCustomBgpIpAddresses": - err = unpopulate(val, "GatewayCustomBgpIPAddresses", &v.GatewayCustomBgpIPAddresses) - delete(rawMsg, key) - case "ipsecPolicies": - err = unpopulate(val, "IPSecPolicies", &v.IPSecPolicies) - delete(rawMsg, key) - case "ingressBytesTransferred": - err = unpopulate(val, "IngressBytesTransferred", &v.IngressBytesTransferred) - delete(rawMsg, key) - case "ingressNatRules": - err = unpopulate(val, "IngressNatRules", &v.IngressNatRules) - delete(rawMsg, key) - case "localNetworkGateway2": - err = unpopulate(val, "LocalNetworkGateway2", &v.LocalNetworkGateway2) - delete(rawMsg, key) - case "peer": - err = unpopulate(val, "Peer", &v.Peer) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) - delete(rawMsg, key) - case "resourceGuid": - err = unpopulate(val, "ResourceGUID", &v.ResourceGUID) - delete(rawMsg, key) - case "routingWeight": - err = unpopulate(val, "RoutingWeight", &v.RoutingWeight) - delete(rawMsg, key) - case "sharedKey": - err = unpopulate(val, "SharedKey", &v.SharedKey) - delete(rawMsg, key) - case "trafficSelectorPolicies": - err = unpopulate(val, "TrafficSelectorPolicies", &v.TrafficSelectorPolicies) - delete(rawMsg, key) - case "tunnelConnectionStatus": - err = unpopulate(val, "TunnelConnectionStatus", &v.TunnelConnectionStatus) - delete(rawMsg, key) - case "useLocalAzureIpAddress": - err = unpopulate(val, "UseLocalAzureIPAddress", &v.UseLocalAzureIPAddress) - delete(rawMsg, key) - case "usePolicyBasedTrafficSelectors": - err = unpopulate(val, "UsePolicyBasedTrafficSelectors", &v.UsePolicyBasedTrafficSelectors) - delete(rawMsg, key) - case "virtualNetworkGateway1": - err = unpopulate(val, "VirtualNetworkGateway1", &v.VirtualNetworkGateway1) - delete(rawMsg, key) - case "virtualNetworkGateway2": - err = unpopulate(val, "VirtualNetworkGateway2", &v.VirtualNetworkGateway2) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkGatewayIPConfiguration. -func (v VirtualNetworkGatewayIPConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", v.Etag) - populate(objectMap, "id", v.ID) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewayIPConfiguration. -func (v *VirtualNetworkGatewayIPConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &v.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &v.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkGatewayIPConfigurationPropertiesFormat. -func (v VirtualNetworkGatewayIPConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "privateIPAddress", v.PrivateIPAddress) - populate(objectMap, "privateIPAllocationMethod", v.PrivateIPAllocationMethod) - populate(objectMap, "provisioningState", v.ProvisioningState) - populate(objectMap, "publicIPAddress", v.PublicIPAddress) - populate(objectMap, "subnet", v.Subnet) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewayIPConfigurationPropertiesFormat. -func (v *VirtualNetworkGatewayIPConfigurationPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "privateIPAddress": - err = unpopulate(val, "PrivateIPAddress", &v.PrivateIPAddress) - delete(rawMsg, key) - case "privateIPAllocationMethod": - err = unpopulate(val, "PrivateIPAllocationMethod", &v.PrivateIPAllocationMethod) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) - delete(rawMsg, key) - case "publicIPAddress": - err = unpopulate(val, "PublicIPAddress", &v.PublicIPAddress) - delete(rawMsg, key) - case "subnet": - err = unpopulate(val, "Subnet", &v.Subnet) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkGatewayListConnectionsResult. -func (v VirtualNetworkGatewayListConnectionsResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", v.NextLink) - populate(objectMap, "value", v.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewayListConnectionsResult. -func (v *VirtualNetworkGatewayListConnectionsResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &v.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &v.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkGatewayListResult. -func (v VirtualNetworkGatewayListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", v.NextLink) - populate(objectMap, "value", v.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewayListResult. -func (v *VirtualNetworkGatewayListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &v.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &v.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkGatewayNatRule. -func (v VirtualNetworkGatewayNatRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", v.Etag) - populate(objectMap, "id", v.ID) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "type", v.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewayNatRule. -func (v *VirtualNetworkGatewayNatRule) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &v.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &v.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &v.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkGatewayNatRuleProperties. -func (v VirtualNetworkGatewayNatRuleProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "externalMappings", v.ExternalMappings) - populate(objectMap, "ipConfigurationId", v.IPConfigurationID) - populate(objectMap, "internalMappings", v.InternalMappings) - populate(objectMap, "mode", v.Mode) - populate(objectMap, "provisioningState", v.ProvisioningState) - populate(objectMap, "type", v.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewayNatRuleProperties. -func (v *VirtualNetworkGatewayNatRuleProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "externalMappings": - err = unpopulate(val, "ExternalMappings", &v.ExternalMappings) - delete(rawMsg, key) - case "ipConfigurationId": - err = unpopulate(val, "IPConfigurationID", &v.IPConfigurationID) - delete(rawMsg, key) - case "internalMappings": - err = unpopulate(val, "InternalMappings", &v.InternalMappings) - delete(rawMsg, key) - case "mode": - err = unpopulate(val, "Mode", &v.Mode) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &v.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkGatewayPropertiesFormat. -func (v VirtualNetworkGatewayPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "activeActive", v.Active) - populate(objectMap, "bgpSettings", v.BgpSettings) - populate(objectMap, "customRoutes", v.CustomRoutes) - populate(objectMap, "disableIPSecReplayProtection", v.DisableIPSecReplayProtection) - populate(objectMap, "enableBgp", v.EnableBgp) - populate(objectMap, "enableBgpRouteTranslationForNat", v.EnableBgpRouteTranslationForNat) - populate(objectMap, "enableDnsForwarding", v.EnableDNSForwarding) - populate(objectMap, "enablePrivateIpAddress", v.EnablePrivateIPAddress) - populate(objectMap, "gatewayDefaultSite", v.GatewayDefaultSite) - populate(objectMap, "gatewayType", v.GatewayType) - populate(objectMap, "ipConfigurations", v.IPConfigurations) - populate(objectMap, "inboundDnsForwardingEndpoint", v.InboundDNSForwardingEndpoint) - populate(objectMap, "natRules", v.NatRules) - populate(objectMap, "provisioningState", v.ProvisioningState) - populate(objectMap, "resourceGuid", v.ResourceGUID) - populate(objectMap, "sku", v.SKU) - populate(objectMap, "vNetExtendedLocationResourceId", v.VNetExtendedLocationResourceID) - populate(objectMap, "vpnClientConfiguration", v.VPNClientConfiguration) - populate(objectMap, "vpnGatewayGeneration", v.VPNGatewayGeneration) - populate(objectMap, "vpnType", v.VPNType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewayPropertiesFormat. -func (v *VirtualNetworkGatewayPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "activeActive": - err = unpopulate(val, "Active", &v.Active) - delete(rawMsg, key) - case "bgpSettings": - err = unpopulate(val, "BgpSettings", &v.BgpSettings) - delete(rawMsg, key) - case "customRoutes": - err = unpopulate(val, "CustomRoutes", &v.CustomRoutes) - delete(rawMsg, key) - case "disableIPSecReplayProtection": - err = unpopulate(val, "DisableIPSecReplayProtection", &v.DisableIPSecReplayProtection) - delete(rawMsg, key) - case "enableBgp": - err = unpopulate(val, "EnableBgp", &v.EnableBgp) - delete(rawMsg, key) - case "enableBgpRouteTranslationForNat": - err = unpopulate(val, "EnableBgpRouteTranslationForNat", &v.EnableBgpRouteTranslationForNat) - delete(rawMsg, key) - case "enableDnsForwarding": - err = unpopulate(val, "EnableDNSForwarding", &v.EnableDNSForwarding) - delete(rawMsg, key) - case "enablePrivateIpAddress": - err = unpopulate(val, "EnablePrivateIPAddress", &v.EnablePrivateIPAddress) - delete(rawMsg, key) - case "gatewayDefaultSite": - err = unpopulate(val, "GatewayDefaultSite", &v.GatewayDefaultSite) - delete(rawMsg, key) - case "gatewayType": - err = unpopulate(val, "GatewayType", &v.GatewayType) - delete(rawMsg, key) - case "ipConfigurations": - err = unpopulate(val, "IPConfigurations", &v.IPConfigurations) - delete(rawMsg, key) - case "inboundDnsForwardingEndpoint": - err = unpopulate(val, "InboundDNSForwardingEndpoint", &v.InboundDNSForwardingEndpoint) - delete(rawMsg, key) - case "natRules": - err = unpopulate(val, "NatRules", &v.NatRules) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) - delete(rawMsg, key) - case "resourceGuid": - err = unpopulate(val, "ResourceGUID", &v.ResourceGUID) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &v.SKU) - delete(rawMsg, key) - case "vNetExtendedLocationResourceId": - err = unpopulate(val, "VNetExtendedLocationResourceID", &v.VNetExtendedLocationResourceID) - delete(rawMsg, key) - case "vpnClientConfiguration": - err = unpopulate(val, "VPNClientConfiguration", &v.VPNClientConfiguration) - delete(rawMsg, key) - case "vpnGatewayGeneration": - err = unpopulate(val, "VPNGatewayGeneration", &v.VPNGatewayGeneration) - delete(rawMsg, key) - case "vpnType": - err = unpopulate(val, "VPNType", &v.VPNType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkGatewaySKU. -func (v VirtualNetworkGatewaySKU) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "capacity", v.Capacity) - populate(objectMap, "name", v.Name) - populate(objectMap, "tier", v.Tier) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewaySKU. -func (v *VirtualNetworkGatewaySKU) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "capacity": - err = unpopulate(val, "Capacity", &v.Capacity) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "tier": - err = unpopulate(val, "Tier", &v.Tier) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkListResult. -func (v VirtualNetworkListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", v.NextLink) - populate(objectMap, "value", v.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkListResult. -func (v *VirtualNetworkListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &v.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &v.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkListUsageResult. -func (v VirtualNetworkListUsageResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", v.NextLink) - populate(objectMap, "value", v.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkListUsageResult. -func (v *VirtualNetworkListUsageResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &v.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &v.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkPeering. -func (v VirtualNetworkPeering) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", v.Etag) - populate(objectMap, "id", v.ID) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "type", v.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkPeering. -func (v *VirtualNetworkPeering) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &v.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &v.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &v.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkPeeringListResult. -func (v VirtualNetworkPeeringListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", v.NextLink) - populate(objectMap, "value", v.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkPeeringListResult. -func (v *VirtualNetworkPeeringListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &v.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &v.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkPeeringPropertiesFormat. -func (v VirtualNetworkPeeringPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "allowForwardedTraffic", v.AllowForwardedTraffic) - populate(objectMap, "allowGatewayTransit", v.AllowGatewayTransit) - populate(objectMap, "allowVirtualNetworkAccess", v.AllowVirtualNetworkAccess) - populate(objectMap, "doNotVerifyRemoteGateways", v.DoNotVerifyRemoteGateways) - populate(objectMap, "peeringState", v.PeeringState) - populate(objectMap, "peeringSyncLevel", v.PeeringSyncLevel) - populate(objectMap, "provisioningState", v.ProvisioningState) - populate(objectMap, "remoteAddressSpace", v.RemoteAddressSpace) - populate(objectMap, "remoteBgpCommunities", v.RemoteBgpCommunities) - populate(objectMap, "remoteVirtualNetwork", v.RemoteVirtualNetwork) - populate(objectMap, "remoteVirtualNetworkAddressSpace", v.RemoteVirtualNetworkAddressSpace) - populate(objectMap, "remoteVirtualNetworkEncryption", v.RemoteVirtualNetworkEncryption) - populate(objectMap, "resourceGuid", v.ResourceGUID) - populate(objectMap, "useRemoteGateways", v.UseRemoteGateways) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkPeeringPropertiesFormat. -func (v *VirtualNetworkPeeringPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "allowForwardedTraffic": - err = unpopulate(val, "AllowForwardedTraffic", &v.AllowForwardedTraffic) - delete(rawMsg, key) - case "allowGatewayTransit": - err = unpopulate(val, "AllowGatewayTransit", &v.AllowGatewayTransit) - delete(rawMsg, key) - case "allowVirtualNetworkAccess": - err = unpopulate(val, "AllowVirtualNetworkAccess", &v.AllowVirtualNetworkAccess) - delete(rawMsg, key) - case "doNotVerifyRemoteGateways": - err = unpopulate(val, "DoNotVerifyRemoteGateways", &v.DoNotVerifyRemoteGateways) - delete(rawMsg, key) - case "peeringState": - err = unpopulate(val, "PeeringState", &v.PeeringState) - delete(rawMsg, key) - case "peeringSyncLevel": - err = unpopulate(val, "PeeringSyncLevel", &v.PeeringSyncLevel) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) - delete(rawMsg, key) - case "remoteAddressSpace": - err = unpopulate(val, "RemoteAddressSpace", &v.RemoteAddressSpace) - delete(rawMsg, key) - case "remoteBgpCommunities": - err = unpopulate(val, "RemoteBgpCommunities", &v.RemoteBgpCommunities) - delete(rawMsg, key) - case "remoteVirtualNetwork": - err = unpopulate(val, "RemoteVirtualNetwork", &v.RemoteVirtualNetwork) - delete(rawMsg, key) - case "remoteVirtualNetworkAddressSpace": - err = unpopulate(val, "RemoteVirtualNetworkAddressSpace", &v.RemoteVirtualNetworkAddressSpace) - delete(rawMsg, key) - case "remoteVirtualNetworkEncryption": - err = unpopulate(val, "RemoteVirtualNetworkEncryption", &v.RemoteVirtualNetworkEncryption) - delete(rawMsg, key) - case "resourceGuid": - err = unpopulate(val, "ResourceGUID", &v.ResourceGUID) - delete(rawMsg, key) - case "useRemoteGateways": - err = unpopulate(val, "UseRemoteGateways", &v.UseRemoteGateways) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkPropertiesFormat. -func (v VirtualNetworkPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "addressSpace", v.AddressSpace) - populate(objectMap, "bgpCommunities", v.BgpCommunities) - populate(objectMap, "ddosProtectionPlan", v.DdosProtectionPlan) - populate(objectMap, "dhcpOptions", v.DhcpOptions) - populate(objectMap, "enableDdosProtection", v.EnableDdosProtection) - populate(objectMap, "enableVmProtection", v.EnableVMProtection) - populate(objectMap, "encryption", v.Encryption) - populate(objectMap, "flowTimeoutInMinutes", v.FlowTimeoutInMinutes) - populate(objectMap, "ipAllocations", v.IPAllocations) - populate(objectMap, "provisioningState", v.ProvisioningState) - populate(objectMap, "resourceGuid", v.ResourceGUID) - populate(objectMap, "subnets", v.Subnets) - populate(objectMap, "virtualNetworkPeerings", v.VirtualNetworkPeerings) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkPropertiesFormat. -func (v *VirtualNetworkPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "addressSpace": - err = unpopulate(val, "AddressSpace", &v.AddressSpace) - delete(rawMsg, key) - case "bgpCommunities": - err = unpopulate(val, "BgpCommunities", &v.BgpCommunities) - delete(rawMsg, key) - case "ddosProtectionPlan": - err = unpopulate(val, "DdosProtectionPlan", &v.DdosProtectionPlan) - delete(rawMsg, key) - case "dhcpOptions": - err = unpopulate(val, "DhcpOptions", &v.DhcpOptions) - delete(rawMsg, key) - case "enableDdosProtection": - err = unpopulate(val, "EnableDdosProtection", &v.EnableDdosProtection) - delete(rawMsg, key) - case "enableVmProtection": - err = unpopulate(val, "EnableVMProtection", &v.EnableVMProtection) - delete(rawMsg, key) - case "encryption": - err = unpopulate(val, "Encryption", &v.Encryption) - delete(rawMsg, key) - case "flowTimeoutInMinutes": - err = unpopulate(val, "FlowTimeoutInMinutes", &v.FlowTimeoutInMinutes) - delete(rawMsg, key) - case "ipAllocations": - err = unpopulate(val, "IPAllocations", &v.IPAllocations) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) - delete(rawMsg, key) - case "resourceGuid": - err = unpopulate(val, "ResourceGUID", &v.ResourceGUID) - delete(rawMsg, key) - case "subnets": - err = unpopulate(val, "Subnets", &v.Subnets) - delete(rawMsg, key) - case "virtualNetworkPeerings": - err = unpopulate(val, "VirtualNetworkPeerings", &v.VirtualNetworkPeerings) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkTap. -func (v VirtualNetworkTap) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", v.Etag) - populate(objectMap, "id", v.ID) - populate(objectMap, "location", v.Location) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "tags", v.Tags) - populate(objectMap, "type", v.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkTap. -func (v *VirtualNetworkTap) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &v.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &v.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &v.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &v.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &v.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkTapListResult. -func (v VirtualNetworkTapListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", v.NextLink) - populate(objectMap, "value", v.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkTapListResult. -func (v *VirtualNetworkTapListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &v.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &v.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkTapPropertiesFormat. -func (v VirtualNetworkTapPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "destinationLoadBalancerFrontEndIPConfiguration", v.DestinationLoadBalancerFrontEndIPConfiguration) - populate(objectMap, "destinationNetworkInterfaceIPConfiguration", v.DestinationNetworkInterfaceIPConfiguration) - populate(objectMap, "destinationPort", v.DestinationPort) - populate(objectMap, "networkInterfaceTapConfigurations", v.NetworkInterfaceTapConfigurations) - populate(objectMap, "provisioningState", v.ProvisioningState) - populate(objectMap, "resourceGuid", v.ResourceGUID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkTapPropertiesFormat. -func (v *VirtualNetworkTapPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "destinationLoadBalancerFrontEndIPConfiguration": - err = unpopulate(val, "DestinationLoadBalancerFrontEndIPConfiguration", &v.DestinationLoadBalancerFrontEndIPConfiguration) - delete(rawMsg, key) - case "destinationNetworkInterfaceIPConfiguration": - err = unpopulate(val, "DestinationNetworkInterfaceIPConfiguration", &v.DestinationNetworkInterfaceIPConfiguration) - delete(rawMsg, key) - case "destinationPort": - err = unpopulate(val, "DestinationPort", &v.DestinationPort) - delete(rawMsg, key) - case "networkInterfaceTapConfigurations": - err = unpopulate(val, "NetworkInterfaceTapConfigurations", &v.NetworkInterfaceTapConfigurations) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) - delete(rawMsg, key) - case "resourceGuid": - err = unpopulate(val, "ResourceGUID", &v.ResourceGUID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkUsage. -func (v VirtualNetworkUsage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "currentValue", v.CurrentValue) - populate(objectMap, "id", v.ID) - populate(objectMap, "limit", v.Limit) - populate(objectMap, "name", v.Name) - populate(objectMap, "unit", v.Unit) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkUsage. -func (v *VirtualNetworkUsage) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "currentValue": - err = unpopulate(val, "CurrentValue", &v.CurrentValue) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &v.ID) - delete(rawMsg, key) - case "limit": - err = unpopulate(val, "Limit", &v.Limit) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "unit": - err = unpopulate(val, "Unit", &v.Unit) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkUsageName. -func (v VirtualNetworkUsageName) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "localizedValue", v.LocalizedValue) - populate(objectMap, "value", v.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkUsageName. -func (v *VirtualNetworkUsageName) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "localizedValue": - err = unpopulate(val, "LocalizedValue", &v.LocalizedValue) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &v.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualRouter. -func (v VirtualRouter) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", v.Etag) - populate(objectMap, "id", v.ID) - populate(objectMap, "location", v.Location) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "tags", v.Tags) - populate(objectMap, "type", v.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualRouter. -func (v *VirtualRouter) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &v.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &v.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &v.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &v.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &v.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualRouterAutoScaleConfiguration. -func (v VirtualRouterAutoScaleConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "minCapacity", v.MinCapacity) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualRouterAutoScaleConfiguration. -func (v *VirtualRouterAutoScaleConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "minCapacity": - err = unpopulate(val, "MinCapacity", &v.MinCapacity) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualRouterListResult. -func (v VirtualRouterListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", v.NextLink) - populate(objectMap, "value", v.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualRouterListResult. -func (v *VirtualRouterListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &v.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &v.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualRouterPeering. -func (v VirtualRouterPeering) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", v.Etag) - populate(objectMap, "id", v.ID) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "type", v.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualRouterPeering. -func (v *VirtualRouterPeering) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &v.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &v.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &v.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualRouterPeeringListResult. -func (v VirtualRouterPeeringListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", v.NextLink) - populate(objectMap, "value", v.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualRouterPeeringListResult. -func (v *VirtualRouterPeeringListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &v.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &v.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualRouterPeeringProperties. -func (v VirtualRouterPeeringProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "peerAsn", v.PeerAsn) - populate(objectMap, "peerIp", v.PeerIP) - populate(objectMap, "provisioningState", v.ProvisioningState) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualRouterPeeringProperties. -func (v *VirtualRouterPeeringProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "peerAsn": - err = unpopulate(val, "PeerAsn", &v.PeerAsn) - delete(rawMsg, key) - case "peerIp": - err = unpopulate(val, "PeerIP", &v.PeerIP) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualRouterPropertiesFormat. -func (v VirtualRouterPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "hostedGateway", v.HostedGateway) - populate(objectMap, "hostedSubnet", v.HostedSubnet) - populate(objectMap, "peerings", v.Peerings) - populate(objectMap, "provisioningState", v.ProvisioningState) - populate(objectMap, "virtualRouterAsn", v.VirtualRouterAsn) - populate(objectMap, "virtualRouterIps", v.VirtualRouterIPs) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualRouterPropertiesFormat. -func (v *VirtualRouterPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "hostedGateway": - err = unpopulate(val, "HostedGateway", &v.HostedGateway) - delete(rawMsg, key) - case "hostedSubnet": - err = unpopulate(val, "HostedSubnet", &v.HostedSubnet) - delete(rawMsg, key) - case "peerings": - err = unpopulate(val, "Peerings", &v.Peerings) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) - delete(rawMsg, key) - case "virtualRouterAsn": - err = unpopulate(val, "VirtualRouterAsn", &v.VirtualRouterAsn) - delete(rawMsg, key) - case "virtualRouterIps": - err = unpopulate(val, "VirtualRouterIPs", &v.VirtualRouterIPs) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualWAN. -func (v VirtualWAN) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", v.Etag) - populate(objectMap, "id", v.ID) - populate(objectMap, "location", v.Location) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "tags", v.Tags) - populate(objectMap, "type", v.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualWAN. -func (v *VirtualWAN) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &v.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &v.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &v.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &v.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &v.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualWanProperties. -func (v VirtualWanProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "allowBranchToBranchTraffic", v.AllowBranchToBranchTraffic) - populate(objectMap, "allowVnetToVnetTraffic", v.AllowVnetToVnetTraffic) - populate(objectMap, "disableVpnEncryption", v.DisableVPNEncryption) - populate(objectMap, "office365LocalBreakoutCategory", v.Office365LocalBreakoutCategory) - populate(objectMap, "provisioningState", v.ProvisioningState) - populate(objectMap, "type", v.Type) - populate(objectMap, "vpnSites", v.VPNSites) - populate(objectMap, "virtualHubs", v.VirtualHubs) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualWanProperties. -func (v *VirtualWanProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "allowBranchToBranchTraffic": - err = unpopulate(val, "AllowBranchToBranchTraffic", &v.AllowBranchToBranchTraffic) - delete(rawMsg, key) - case "allowVnetToVnetTraffic": - err = unpopulate(val, "AllowVnetToVnetTraffic", &v.AllowVnetToVnetTraffic) - delete(rawMsg, key) - case "disableVpnEncryption": - err = unpopulate(val, "DisableVPNEncryption", &v.DisableVPNEncryption) - delete(rawMsg, key) - case "office365LocalBreakoutCategory": - err = unpopulate(val, "Office365LocalBreakoutCategory", &v.Office365LocalBreakoutCategory) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &v.Type) - delete(rawMsg, key) - case "vpnSites": - err = unpopulate(val, "VPNSites", &v.VPNSites) - delete(rawMsg, key) - case "virtualHubs": - err = unpopulate(val, "VirtualHubs", &v.VirtualHubs) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualWanSecurityProvider. -func (v VirtualWanSecurityProvider) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "name", v.Name) - populate(objectMap, "type", v.Type) - populate(objectMap, "url", v.URL) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualWanSecurityProvider. -func (v *VirtualWanSecurityProvider) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &v.Type) - delete(rawMsg, key) - case "url": - err = unpopulate(val, "URL", &v.URL) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualWanSecurityProviders. -func (v VirtualWanSecurityProviders) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "supportedProviders", v.SupportedProviders) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualWanSecurityProviders. -func (v *VirtualWanSecurityProviders) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "supportedProviders": - err = unpopulate(val, "SupportedProviders", &v.SupportedProviders) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualWanVPNProfileParameters. -func (v VirtualWanVPNProfileParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "authenticationMethod", v.AuthenticationMethod) - populate(objectMap, "vpnServerConfigurationResourceId", v.VPNServerConfigurationResourceID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualWanVPNProfileParameters. -func (v *VirtualWanVPNProfileParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "authenticationMethod": - err = unpopulate(val, "AuthenticationMethod", &v.AuthenticationMethod) - delete(rawMsg, key) - case "vpnServerConfigurationResourceId": - err = unpopulate(val, "VPNServerConfigurationResourceID", &v.VPNServerConfigurationResourceID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VnetRoute. -func (v VnetRoute) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "bgpConnections", v.BgpConnections) - populate(objectMap, "staticRoutes", v.StaticRoutes) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VnetRoute. -func (v *VnetRoute) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "bgpConnections": - err = unpopulate(val, "BgpConnections", &v.BgpConnections) - delete(rawMsg, key) - case "staticRoutes": - err = unpopulate(val, "StaticRoutes", &v.StaticRoutes) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Watcher. -func (w Watcher) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", w.Etag) - populate(objectMap, "id", w.ID) - populate(objectMap, "location", w.Location) - populate(objectMap, "name", w.Name) - populate(objectMap, "properties", w.Properties) - populate(objectMap, "tags", w.Tags) - populate(objectMap, "type", w.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Watcher. -func (w *Watcher) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", w, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &w.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &w.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &w.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &w.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &w.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &w.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &w.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", w, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type WatcherListResult. -func (w WatcherListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "value", w.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type WatcherListResult. -func (w *WatcherListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", w, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "value": - err = unpopulate(val, "Value", &w.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", w, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type WatcherPropertiesFormat. -func (w WatcherPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "provisioningState", w.ProvisioningState) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type WatcherPropertiesFormat. -func (w *WatcherPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", w, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &w.ProvisioningState) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", w, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type WebApplicationFirewallCustomRule. -func (w WebApplicationFirewallCustomRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "action", w.Action) - populate(objectMap, "etag", w.Etag) - populate(objectMap, "matchConditions", w.MatchConditions) - populate(objectMap, "name", w.Name) - populate(objectMap, "priority", w.Priority) - populate(objectMap, "ruleType", w.RuleType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type WebApplicationFirewallCustomRule. -func (w *WebApplicationFirewallCustomRule) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", w, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "action": - err = unpopulate(val, "Action", &w.Action) - delete(rawMsg, key) - case "etag": - err = unpopulate(val, "Etag", &w.Etag) - delete(rawMsg, key) - case "matchConditions": - err = unpopulate(val, "MatchConditions", &w.MatchConditions) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &w.Name) - delete(rawMsg, key) - case "priority": - err = unpopulate(val, "Priority", &w.Priority) - delete(rawMsg, key) - case "ruleType": - err = unpopulate(val, "RuleType", &w.RuleType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", w, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type WebApplicationFirewallPolicy. -func (w WebApplicationFirewallPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", w.Etag) - populate(objectMap, "id", w.ID) - populate(objectMap, "location", w.Location) - populate(objectMap, "name", w.Name) - populate(objectMap, "properties", w.Properties) - populate(objectMap, "tags", w.Tags) - populate(objectMap, "type", w.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type WebApplicationFirewallPolicy. -func (w *WebApplicationFirewallPolicy) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", w, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &w.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &w.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &w.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &w.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &w.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &w.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &w.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", w, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type WebApplicationFirewallPolicyListResult. -func (w WebApplicationFirewallPolicyListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", w.NextLink) - populate(objectMap, "value", w.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type WebApplicationFirewallPolicyListResult. -func (w *WebApplicationFirewallPolicyListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", w, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &w.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &w.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", w, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type WebApplicationFirewallPolicyPropertiesFormat. -func (w WebApplicationFirewallPolicyPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "applicationGateways", w.ApplicationGateways) - populate(objectMap, "customRules", w.CustomRules) - populate(objectMap, "httpListeners", w.HTTPListeners) - populate(objectMap, "managedRules", w.ManagedRules) - populate(objectMap, "pathBasedRules", w.PathBasedRules) - populate(objectMap, "policySettings", w.PolicySettings) - populate(objectMap, "provisioningState", w.ProvisioningState) - populate(objectMap, "resourceState", w.ResourceState) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type WebApplicationFirewallPolicyPropertiesFormat. -func (w *WebApplicationFirewallPolicyPropertiesFormat) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", w, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "applicationGateways": - err = unpopulate(val, "ApplicationGateways", &w.ApplicationGateways) - delete(rawMsg, key) - case "customRules": - err = unpopulate(val, "CustomRules", &w.CustomRules) - delete(rawMsg, key) - case "httpListeners": - err = unpopulate(val, "HTTPListeners", &w.HTTPListeners) - delete(rawMsg, key) - case "managedRules": - err = unpopulate(val, "ManagedRules", &w.ManagedRules) - delete(rawMsg, key) - case "pathBasedRules": - err = unpopulate(val, "PathBasedRules", &w.PathBasedRules) - delete(rawMsg, key) - case "policySettings": - err = unpopulate(val, "PolicySettings", &w.PolicySettings) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &w.ProvisioningState) - delete(rawMsg, key) - case "resourceState": - err = unpopulate(val, "ResourceState", &w.ResourceState) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", w, err) - } - } - return nil -} - -func populate(m map[string]interface{}, k string, v interface{}) { - if v == nil { - return - } else if azcore.IsNullValue(v) { - m[k] = nil - } else if !reflect.ValueOf(v).IsNil() { - m[k] = v - } -} - -func unpopulate(data json.RawMessage, fn string, v interface{}) error { - if data == nil { - return nil - } - if err := json.Unmarshal(data, v); err != nil { - return fmt.Errorf("struct field %s: %v", fn, err) - } - return nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/natgateways_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/natgateways_client.go deleted file mode 100644 index efd67fe8..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/natgateways_client.go +++ /dev/null @@ -1,426 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// NatGatewaysClient contains the methods for the NatGateways group. -// Don't use this type directly, use NewNatGatewaysClient() instead. -type NatGatewaysClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewNatGatewaysClient creates a new instance of NatGatewaysClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewNatGatewaysClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NatGatewaysClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &NatGatewaysClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates a nat gateway. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// natGatewayName - The name of the nat gateway. -// parameters - Parameters supplied to the create or update nat gateway operation. -// options - NatGatewaysClientBeginCreateOrUpdateOptions contains the optional parameters for the NatGatewaysClient.BeginCreateOrUpdate -// method. -func (client *NatGatewaysClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, natGatewayName string, parameters NatGateway, options *NatGatewaysClientBeginCreateOrUpdateOptions) (*runtime.Poller[NatGatewaysClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, natGatewayName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[NatGatewaysClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[NatGatewaysClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates or updates a nat gateway. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *NatGatewaysClient) createOrUpdate(ctx context.Context, resourceGroupName string, natGatewayName string, parameters NatGateway, options *NatGatewaysClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, natGatewayName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *NatGatewaysClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, natGatewayName string, parameters NatGateway, options *NatGatewaysClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways/{natGatewayName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if natGatewayName == "" { - return nil, errors.New("parameter natGatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{natGatewayName}", url.PathEscape(natGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginDelete - Deletes the specified nat gateway. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// natGatewayName - The name of the nat gateway. -// options - NatGatewaysClientBeginDeleteOptions contains the optional parameters for the NatGatewaysClient.BeginDelete method. -func (client *NatGatewaysClient) BeginDelete(ctx context.Context, resourceGroupName string, natGatewayName string, options *NatGatewaysClientBeginDeleteOptions) (*runtime.Poller[NatGatewaysClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, natGatewayName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[NatGatewaysClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[NatGatewaysClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes the specified nat gateway. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *NatGatewaysClient) deleteOperation(ctx context.Context, resourceGroupName string, natGatewayName string, options *NatGatewaysClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, natGatewayName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *NatGatewaysClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, natGatewayName string, options *NatGatewaysClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways/{natGatewayName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if natGatewayName == "" { - return nil, errors.New("parameter natGatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{natGatewayName}", url.PathEscape(natGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets the specified nat gateway in a specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// natGatewayName - The name of the nat gateway. -// options - NatGatewaysClientGetOptions contains the optional parameters for the NatGatewaysClient.Get method. -func (client *NatGatewaysClient) Get(ctx context.Context, resourceGroupName string, natGatewayName string, options *NatGatewaysClientGetOptions) (NatGatewaysClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, natGatewayName, options) - if err != nil { - return NatGatewaysClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return NatGatewaysClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return NatGatewaysClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *NatGatewaysClient) getCreateRequest(ctx context.Context, resourceGroupName string, natGatewayName string, options *NatGatewaysClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways/{natGatewayName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if natGatewayName == "" { - return nil, errors.New("parameter natGatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{natGatewayName}", url.PathEscape(natGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *NatGatewaysClient) getHandleResponse(resp *http.Response) (NatGatewaysClientGetResponse, error) { - result := NatGatewaysClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.NatGateway); err != nil { - return NatGatewaysClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Gets all nat gateways in a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// options - NatGatewaysClientListOptions contains the optional parameters for the NatGatewaysClient.List method. -func (client *NatGatewaysClient) NewListPager(resourceGroupName string, options *NatGatewaysClientListOptions) *runtime.Pager[NatGatewaysClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[NatGatewaysClientListResponse]{ - More: func(page NatGatewaysClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *NatGatewaysClientListResponse) (NatGatewaysClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return NatGatewaysClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return NatGatewaysClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return NatGatewaysClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *NatGatewaysClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *NatGatewaysClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *NatGatewaysClient) listHandleResponse(resp *http.Response) (NatGatewaysClientListResponse, error) { - result := NatGatewaysClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.NatGatewayListResult); err != nil { - return NatGatewaysClientListResponse{}, err - } - return result, nil -} - -// NewListAllPager - Gets all the Nat Gateways in a subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// options - NatGatewaysClientListAllOptions contains the optional parameters for the NatGatewaysClient.ListAll method. -func (client *NatGatewaysClient) NewListAllPager(options *NatGatewaysClientListAllOptions) *runtime.Pager[NatGatewaysClientListAllResponse] { - return runtime.NewPager(runtime.PagingHandler[NatGatewaysClientListAllResponse]{ - More: func(page NatGatewaysClientListAllResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *NatGatewaysClientListAllResponse) (NatGatewaysClientListAllResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listAllCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return NatGatewaysClientListAllResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return NatGatewaysClientListAllResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return NatGatewaysClientListAllResponse{}, runtime.NewResponseError(resp) - } - return client.listAllHandleResponse(resp) - }, - }) -} - -// listAllCreateRequest creates the ListAll request. -func (client *NatGatewaysClient) listAllCreateRequest(ctx context.Context, options *NatGatewaysClientListAllOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/natGateways" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listAllHandleResponse handles the ListAll response. -func (client *NatGatewaysClient) listAllHandleResponse(resp *http.Response) (NatGatewaysClientListAllResponse, error) { - result := NatGatewaysClientListAllResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.NatGatewayListResult); err != nil { - return NatGatewaysClientListAllResponse{}, err - } - return result, nil -} - -// UpdateTags - Updates nat gateway tags. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// natGatewayName - The name of the nat gateway. -// parameters - Parameters supplied to update nat gateway tags. -// options - NatGatewaysClientUpdateTagsOptions contains the optional parameters for the NatGatewaysClient.UpdateTags method. -func (client *NatGatewaysClient) UpdateTags(ctx context.Context, resourceGroupName string, natGatewayName string, parameters TagsObject, options *NatGatewaysClientUpdateTagsOptions) (NatGatewaysClientUpdateTagsResponse, error) { - req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, natGatewayName, parameters, options) - if err != nil { - return NatGatewaysClientUpdateTagsResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return NatGatewaysClientUpdateTagsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return NatGatewaysClientUpdateTagsResponse{}, runtime.NewResponseError(resp) - } - return client.updateTagsHandleResponse(resp) -} - -// updateTagsCreateRequest creates the UpdateTags request. -func (client *NatGatewaysClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, natGatewayName string, parameters TagsObject, options *NatGatewaysClientUpdateTagsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways/{natGatewayName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if natGatewayName == "" { - return nil, errors.New("parameter natGatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{natGatewayName}", url.PathEscape(natGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// updateTagsHandleResponse handles the UpdateTags response. -func (client *NatGatewaysClient) updateTagsHandleResponse(resp *http.Response) (NatGatewaysClientUpdateTagsResponse, error) { - result := NatGatewaysClientUpdateTagsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.NatGateway); err != nil { - return NatGatewaysClientUpdateTagsResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/natrules_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/natrules_client.go deleted file mode 100644 index 08c2a51d..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/natrules_client.go +++ /dev/null @@ -1,328 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// NatRulesClient contains the methods for the NatRules group. -// Don't use this type directly, use NewNatRulesClient() instead. -type NatRulesClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewNatRulesClient creates a new instance of NatRulesClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewNatRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NatRulesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &NatRulesClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates a nat rule to a scalable vpn gateway if it doesn't exist else updates the existing nat rules. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the VpnGateway. -// gatewayName - The name of the gateway. -// natRuleName - The name of the nat rule. -// natRuleParameters - Parameters supplied to create or Update a Nat Rule. -// options - NatRulesClientBeginCreateOrUpdateOptions contains the optional parameters for the NatRulesClient.BeginCreateOrUpdate -// method. -func (client *NatRulesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, gatewayName string, natRuleName string, natRuleParameters VPNGatewayNatRule, options *NatRulesClientBeginCreateOrUpdateOptions) (*runtime.Poller[NatRulesClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, gatewayName, natRuleName, natRuleParameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[NatRulesClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[NatRulesClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates a nat rule to a scalable vpn gateway if it doesn't exist else updates the existing nat rules. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *NatRulesClient) createOrUpdate(ctx context.Context, resourceGroupName string, gatewayName string, natRuleName string, natRuleParameters VPNGatewayNatRule, options *NatRulesClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, gatewayName, natRuleName, natRuleParameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *NatRulesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, natRuleName string, natRuleParameters VPNGatewayNatRule, options *NatRulesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/natRules/{natRuleName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if gatewayName == "" { - return nil, errors.New("parameter gatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) - if natRuleName == "" { - return nil, errors.New("parameter natRuleName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{natRuleName}", url.PathEscape(natRuleName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, natRuleParameters) -} - -// BeginDelete - Deletes a nat rule. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the VpnGateway. -// gatewayName - The name of the gateway. -// natRuleName - The name of the nat rule. -// options - NatRulesClientBeginDeleteOptions contains the optional parameters for the NatRulesClient.BeginDelete method. -func (client *NatRulesClient) BeginDelete(ctx context.Context, resourceGroupName string, gatewayName string, natRuleName string, options *NatRulesClientBeginDeleteOptions) (*runtime.Poller[NatRulesClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, gatewayName, natRuleName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[NatRulesClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[NatRulesClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes a nat rule. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *NatRulesClient) deleteOperation(ctx context.Context, resourceGroupName string, gatewayName string, natRuleName string, options *NatRulesClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, gatewayName, natRuleName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *NatRulesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, natRuleName string, options *NatRulesClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/natRules/{natRuleName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if gatewayName == "" { - return nil, errors.New("parameter gatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) - if natRuleName == "" { - return nil, errors.New("parameter natRuleName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{natRuleName}", url.PathEscape(natRuleName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Retrieves the details of a nat ruleGet. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the VpnGateway. -// gatewayName - The name of the gateway. -// natRuleName - The name of the nat rule. -// options - NatRulesClientGetOptions contains the optional parameters for the NatRulesClient.Get method. -func (client *NatRulesClient) Get(ctx context.Context, resourceGroupName string, gatewayName string, natRuleName string, options *NatRulesClientGetOptions) (NatRulesClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, gatewayName, natRuleName, options) - if err != nil { - return NatRulesClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return NatRulesClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return NatRulesClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *NatRulesClient) getCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, natRuleName string, options *NatRulesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/natRules/{natRuleName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if gatewayName == "" { - return nil, errors.New("parameter gatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) - if natRuleName == "" { - return nil, errors.New("parameter natRuleName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{natRuleName}", url.PathEscape(natRuleName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *NatRulesClient) getHandleResponse(resp *http.Response) (NatRulesClientGetResponse, error) { - result := NatRulesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VPNGatewayNatRule); err != nil { - return NatRulesClientGetResponse{}, err - } - return result, nil -} - -// NewListByVPNGatewayPager - Retrieves all nat rules for a particular virtual wan vpn gateway. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the VpnGateway. -// gatewayName - The name of the gateway. -// options - NatRulesClientListByVPNGatewayOptions contains the optional parameters for the NatRulesClient.ListByVPNGateway -// method. -func (client *NatRulesClient) NewListByVPNGatewayPager(resourceGroupName string, gatewayName string, options *NatRulesClientListByVPNGatewayOptions) *runtime.Pager[NatRulesClientListByVPNGatewayResponse] { - return runtime.NewPager(runtime.PagingHandler[NatRulesClientListByVPNGatewayResponse]{ - More: func(page NatRulesClientListByVPNGatewayResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *NatRulesClientListByVPNGatewayResponse) (NatRulesClientListByVPNGatewayResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByVPNGatewayCreateRequest(ctx, resourceGroupName, gatewayName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return NatRulesClientListByVPNGatewayResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return NatRulesClientListByVPNGatewayResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return NatRulesClientListByVPNGatewayResponse{}, runtime.NewResponseError(resp) - } - return client.listByVPNGatewayHandleResponse(resp) - }, - }) -} - -// listByVPNGatewayCreateRequest creates the ListByVPNGateway request. -func (client *NatRulesClient) listByVPNGatewayCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, options *NatRulesClientListByVPNGatewayOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/natRules" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if gatewayName == "" { - return nil, errors.New("parameter gatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByVPNGatewayHandleResponse handles the ListByVPNGateway response. -func (client *NatRulesClient) listByVPNGatewayHandleResponse(resp *http.Response) (NatRulesClientListByVPNGatewayResponse, error) { - result := NatRulesClientListByVPNGatewayResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ListVPNGatewayNatRulesResult); err != nil { - return NatRulesClientListByVPNGatewayResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/operations_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/operations_client.go deleted file mode 100644 index b46a8761..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/operations_client.go +++ /dev/null @@ -1,105 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" -) - -// OperationsClient contains the methods for the Operations group. -// Don't use this type directly, use NewOperationsClient() instead. -type OperationsClient struct { - host string - pl runtime.Pipeline -} - -// NewOperationsClient creates a new instance of OperationsClient with the specified values. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &OperationsClient{ - host: ep, - pl: pl, - } - return client, nil -} - -// NewListPager - Lists all of the available Network Rest API operations. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. -func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ - More: func(page OperationsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *OperationsClientListResponse) (OperationsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return OperationsClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return OperationsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return OperationsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *OperationsClient) listCreateRequest(ctx context.Context, options *OperationsClientListOptions) (*policy.Request, error) { - urlPath := "/providers/Microsoft.Network/operations" - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *OperationsClient) listHandleResponse(resp *http.Response) (OperationsClientListResponse, error) { - result := OperationsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.OperationListResult); err != nil { - return OperationsClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/p2svpngateways_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/p2svpngateways_client.go deleted file mode 100644 index 2ca605c9..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/p2svpngateways_client.go +++ /dev/null @@ -1,768 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// P2SVPNGatewaysClient contains the methods for the P2SVPNGateways group. -// Don't use this type directly, use NewP2SVPNGatewaysClient() instead. -type P2SVPNGatewaysClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewP2SVPNGatewaysClient creates a new instance of P2SVPNGatewaysClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewP2SVPNGatewaysClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*P2SVPNGatewaysClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &P2SVPNGatewaysClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the P2SVpnGateway. -// gatewayName - The name of the gateway. -// p2SVPNGatewayParameters - Parameters supplied to create or Update a virtual wan p2s vpn gateway. -// options - P2SVPNGatewaysClientBeginCreateOrUpdateOptions contains the optional parameters for the P2SVPNGatewaysClient.BeginCreateOrUpdate -// method. -func (client *P2SVPNGatewaysClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, gatewayName string, p2SVPNGatewayParameters P2SVPNGateway, options *P2SVPNGatewaysClientBeginCreateOrUpdateOptions) (*runtime.Poller[P2SVPNGatewaysClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, gatewayName, p2SVPNGatewayParameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[P2SVPNGatewaysClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[P2SVPNGatewaysClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *P2SVPNGatewaysClient) createOrUpdate(ctx context.Context, resourceGroupName string, gatewayName string, p2SVPNGatewayParameters P2SVPNGateway, options *P2SVPNGatewaysClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, gatewayName, p2SVPNGatewayParameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *P2SVPNGatewaysClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, p2SVPNGatewayParameters P2SVPNGateway, options *P2SVPNGatewaysClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if gatewayName == "" { - return nil, errors.New("parameter gatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, p2SVPNGatewayParameters) -} - -// BeginDelete - Deletes a virtual wan p2s vpn gateway. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the P2SVpnGateway. -// gatewayName - The name of the gateway. -// options - P2SVPNGatewaysClientBeginDeleteOptions contains the optional parameters for the P2SVPNGatewaysClient.BeginDelete -// method. -func (client *P2SVPNGatewaysClient) BeginDelete(ctx context.Context, resourceGroupName string, gatewayName string, options *P2SVPNGatewaysClientBeginDeleteOptions) (*runtime.Poller[P2SVPNGatewaysClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, gatewayName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[P2SVPNGatewaysClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[P2SVPNGatewaysClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes a virtual wan p2s vpn gateway. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *P2SVPNGatewaysClient) deleteOperation(ctx context.Context, resourceGroupName string, gatewayName string, options *P2SVPNGatewaysClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, gatewayName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *P2SVPNGatewaysClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, options *P2SVPNGatewaysClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if gatewayName == "" { - return nil, errors.New("parameter gatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginDisconnectP2SVPNConnections - Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the specified resource -// group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// p2SVPNGatewayName - The name of the P2S Vpn Gateway. -// request - The parameters are supplied to disconnect p2s vpn connections. -// options - P2SVPNGatewaysClientBeginDisconnectP2SVPNConnectionsOptions contains the optional parameters for the P2SVPNGatewaysClient.BeginDisconnectP2SVPNConnections -// method. -func (client *P2SVPNGatewaysClient) BeginDisconnectP2SVPNConnections(ctx context.Context, resourceGroupName string, p2SVPNGatewayName string, request P2SVPNConnectionRequest, options *P2SVPNGatewaysClientBeginDisconnectP2SVPNConnectionsOptions) (*runtime.Poller[P2SVPNGatewaysClientDisconnectP2SVPNConnectionsResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.disconnectP2SVPNConnections(ctx, resourceGroupName, p2SVPNGatewayName, request, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[P2SVPNGatewaysClientDisconnectP2SVPNConnectionsResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[P2SVPNGatewaysClientDisconnectP2SVPNConnectionsResponse](options.ResumeToken, client.pl, nil) - } -} - -// DisconnectP2SVPNConnections - Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the specified resource -// group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *P2SVPNGatewaysClient) disconnectP2SVPNConnections(ctx context.Context, resourceGroupName string, p2SVPNGatewayName string, request P2SVPNConnectionRequest, options *P2SVPNGatewaysClientBeginDisconnectP2SVPNConnectionsOptions) (*http.Response, error) { - req, err := client.disconnectP2SVPNConnectionsCreateRequest(ctx, resourceGroupName, p2SVPNGatewayName, request, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// disconnectP2SVPNConnectionsCreateRequest creates the DisconnectP2SVPNConnections request. -func (client *P2SVPNGatewaysClient) disconnectP2SVPNConnectionsCreateRequest(ctx context.Context, resourceGroupName string, p2SVPNGatewayName string, request P2SVPNConnectionRequest, options *P2SVPNGatewaysClientBeginDisconnectP2SVPNConnectionsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{p2sVpnGatewayName}/disconnectP2sVpnConnections" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if p2SVPNGatewayName == "" { - return nil, errors.New("parameter p2SVPNGatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{p2sVpnGatewayName}", url.PathEscape(p2SVPNGatewayName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, request) -} - -// BeginGenerateVPNProfile - Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// gatewayName - The name of the P2SVpnGateway. -// parameters - Parameters supplied to the generate P2SVpnGateway VPN client package operation. -// options - P2SVPNGatewaysClientBeginGenerateVPNProfileOptions contains the optional parameters for the P2SVPNGatewaysClient.BeginGenerateVPNProfile -// method. -func (client *P2SVPNGatewaysClient) BeginGenerateVPNProfile(ctx context.Context, resourceGroupName string, gatewayName string, parameters P2SVPNProfileParameters, options *P2SVPNGatewaysClientBeginGenerateVPNProfileOptions) (*runtime.Poller[P2SVPNGatewaysClientGenerateVPNProfileResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.generateVPNProfile(ctx, resourceGroupName, gatewayName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[P2SVPNGatewaysClientGenerateVPNProfileResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[P2SVPNGatewaysClientGenerateVPNProfileResponse](options.ResumeToken, client.pl, nil) - } -} - -// GenerateVPNProfile - Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *P2SVPNGatewaysClient) generateVPNProfile(ctx context.Context, resourceGroupName string, gatewayName string, parameters P2SVPNProfileParameters, options *P2SVPNGatewaysClientBeginGenerateVPNProfileOptions) (*http.Response, error) { - req, err := client.generateVPNProfileCreateRequest(ctx, resourceGroupName, gatewayName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// generateVPNProfileCreateRequest creates the GenerateVPNProfile request. -func (client *P2SVPNGatewaysClient) generateVPNProfileCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, parameters P2SVPNProfileParameters, options *P2SVPNGatewaysClientBeginGenerateVPNProfileOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}/generatevpnprofile" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if gatewayName == "" { - return nil, errors.New("parameter gatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// Get - Retrieves the details of a virtual wan p2s vpn gateway. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the P2SVpnGateway. -// gatewayName - The name of the gateway. -// options - P2SVPNGatewaysClientGetOptions contains the optional parameters for the P2SVPNGatewaysClient.Get method. -func (client *P2SVPNGatewaysClient) Get(ctx context.Context, resourceGroupName string, gatewayName string, options *P2SVPNGatewaysClientGetOptions) (P2SVPNGatewaysClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, gatewayName, options) - if err != nil { - return P2SVPNGatewaysClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return P2SVPNGatewaysClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return P2SVPNGatewaysClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *P2SVPNGatewaysClient) getCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, options *P2SVPNGatewaysClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if gatewayName == "" { - return nil, errors.New("parameter gatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *P2SVPNGatewaysClient) getHandleResponse(resp *http.Response) (P2SVPNGatewaysClientGetResponse, error) { - result := P2SVPNGatewaysClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.P2SVPNGateway); err != nil { - return P2SVPNGatewaysClientGetResponse{}, err - } - return result, nil -} - -// BeginGetP2SVPNConnectionHealth - Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified -// resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// gatewayName - The name of the P2SVpnGateway. -// options - P2SVPNGatewaysClientBeginGetP2SVPNConnectionHealthOptions contains the optional parameters for the P2SVPNGatewaysClient.BeginGetP2SVPNConnectionHealth -// method. -func (client *P2SVPNGatewaysClient) BeginGetP2SVPNConnectionHealth(ctx context.Context, resourceGroupName string, gatewayName string, options *P2SVPNGatewaysClientBeginGetP2SVPNConnectionHealthOptions) (*runtime.Poller[P2SVPNGatewaysClientGetP2SVPNConnectionHealthResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.getP2SVPNConnectionHealth(ctx, resourceGroupName, gatewayName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[P2SVPNGatewaysClientGetP2SVPNConnectionHealthResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[P2SVPNGatewaysClientGetP2SVPNConnectionHealthResponse](options.ResumeToken, client.pl, nil) - } -} - -// GetP2SVPNConnectionHealth - Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified -// resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *P2SVPNGatewaysClient) getP2SVPNConnectionHealth(ctx context.Context, resourceGroupName string, gatewayName string, options *P2SVPNGatewaysClientBeginGetP2SVPNConnectionHealthOptions) (*http.Response, error) { - req, err := client.getP2SVPNConnectionHealthCreateRequest(ctx, resourceGroupName, gatewayName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// getP2SVPNConnectionHealthCreateRequest creates the GetP2SVPNConnectionHealth request. -func (client *P2SVPNGatewaysClient) getP2SVPNConnectionHealthCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, options *P2SVPNGatewaysClientBeginGetP2SVPNConnectionHealthOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}/getP2sVpnConnectionHealth" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if gatewayName == "" { - return nil, errors.New("parameter gatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginGetP2SVPNConnectionHealthDetailed - Gets the sas url to get the connection health detail of P2S clients of the virtual -// wan P2SVpnGateway in the specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// gatewayName - The name of the P2SVpnGateway. -// request - Request parameters supplied to get p2s vpn connections detailed health. -// options - P2SVPNGatewaysClientBeginGetP2SVPNConnectionHealthDetailedOptions contains the optional parameters for the P2SVPNGatewaysClient.BeginGetP2SVPNConnectionHealthDetailed -// method. -func (client *P2SVPNGatewaysClient) BeginGetP2SVPNConnectionHealthDetailed(ctx context.Context, resourceGroupName string, gatewayName string, request P2SVPNConnectionHealthRequest, options *P2SVPNGatewaysClientBeginGetP2SVPNConnectionHealthDetailedOptions) (*runtime.Poller[P2SVPNGatewaysClientGetP2SVPNConnectionHealthDetailedResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.getP2SVPNConnectionHealthDetailed(ctx, resourceGroupName, gatewayName, request, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[P2SVPNGatewaysClientGetP2SVPNConnectionHealthDetailedResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[P2SVPNGatewaysClientGetP2SVPNConnectionHealthDetailedResponse](options.ResumeToken, client.pl, nil) - } -} - -// GetP2SVPNConnectionHealthDetailed - Gets the sas url to get the connection health detail of P2S clients of the virtual -// wan P2SVpnGateway in the specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *P2SVPNGatewaysClient) getP2SVPNConnectionHealthDetailed(ctx context.Context, resourceGroupName string, gatewayName string, request P2SVPNConnectionHealthRequest, options *P2SVPNGatewaysClientBeginGetP2SVPNConnectionHealthDetailedOptions) (*http.Response, error) { - req, err := client.getP2SVPNConnectionHealthDetailedCreateRequest(ctx, resourceGroupName, gatewayName, request, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// getP2SVPNConnectionHealthDetailedCreateRequest creates the GetP2SVPNConnectionHealthDetailed request. -func (client *P2SVPNGatewaysClient) getP2SVPNConnectionHealthDetailedCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, request P2SVPNConnectionHealthRequest, options *P2SVPNGatewaysClientBeginGetP2SVPNConnectionHealthDetailedOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}/getP2sVpnConnectionHealthDetailed" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if gatewayName == "" { - return nil, errors.New("parameter gatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, request) -} - -// NewListPager - Lists all the P2SVpnGateways in a subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// options - P2SVPNGatewaysClientListOptions contains the optional parameters for the P2SVPNGatewaysClient.List method. -func (client *P2SVPNGatewaysClient) NewListPager(options *P2SVPNGatewaysClientListOptions) *runtime.Pager[P2SVPNGatewaysClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[P2SVPNGatewaysClientListResponse]{ - More: func(page P2SVPNGatewaysClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *P2SVPNGatewaysClientListResponse) (P2SVPNGatewaysClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return P2SVPNGatewaysClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return P2SVPNGatewaysClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return P2SVPNGatewaysClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *P2SVPNGatewaysClient) listCreateRequest(ctx context.Context, options *P2SVPNGatewaysClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/p2svpnGateways" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *P2SVPNGatewaysClient) listHandleResponse(resp *http.Response) (P2SVPNGatewaysClientListResponse, error) { - result := P2SVPNGatewaysClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ListP2SVPNGatewaysResult); err != nil { - return P2SVPNGatewaysClientListResponse{}, err - } - return result, nil -} - -// NewListByResourceGroupPager - Lists all the P2SVpnGateways in a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the P2SVpnGateway. -// options - P2SVPNGatewaysClientListByResourceGroupOptions contains the optional parameters for the P2SVPNGatewaysClient.ListByResourceGroup -// method. -func (client *P2SVPNGatewaysClient) NewListByResourceGroupPager(resourceGroupName string, options *P2SVPNGatewaysClientListByResourceGroupOptions) *runtime.Pager[P2SVPNGatewaysClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[P2SVPNGatewaysClientListByResourceGroupResponse]{ - More: func(page P2SVPNGatewaysClientListByResourceGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *P2SVPNGatewaysClientListByResourceGroupResponse) (P2SVPNGatewaysClientListByResourceGroupResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return P2SVPNGatewaysClientListByResourceGroupResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return P2SVPNGatewaysClientListByResourceGroupResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return P2SVPNGatewaysClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) - } - return client.listByResourceGroupHandleResponse(resp) - }, - }) -} - -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *P2SVPNGatewaysClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *P2SVPNGatewaysClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *P2SVPNGatewaysClient) listByResourceGroupHandleResponse(resp *http.Response) (P2SVPNGatewaysClientListByResourceGroupResponse, error) { - result := P2SVPNGatewaysClientListByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ListP2SVPNGatewaysResult); err != nil { - return P2SVPNGatewaysClientListByResourceGroupResponse{}, err - } - return result, nil -} - -// BeginReset - Resets the primary of the p2s vpn gateway in the specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the P2SVpnGateway. -// gatewayName - The name of the gateway. -// options - P2SVPNGatewaysClientBeginResetOptions contains the optional parameters for the P2SVPNGatewaysClient.BeginReset -// method. -func (client *P2SVPNGatewaysClient) BeginReset(ctx context.Context, resourceGroupName string, gatewayName string, options *P2SVPNGatewaysClientBeginResetOptions) (*runtime.Poller[P2SVPNGatewaysClientResetResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.reset(ctx, resourceGroupName, gatewayName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[P2SVPNGatewaysClientResetResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[P2SVPNGatewaysClientResetResponse](options.ResumeToken, client.pl, nil) - } -} - -// Reset - Resets the primary of the p2s vpn gateway in the specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *P2SVPNGatewaysClient) reset(ctx context.Context, resourceGroupName string, gatewayName string, options *P2SVPNGatewaysClientBeginResetOptions) (*http.Response, error) { - req, err := client.resetCreateRequest(ctx, resourceGroupName, gatewayName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// resetCreateRequest creates the Reset request. -func (client *P2SVPNGatewaysClient) resetCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, options *P2SVPNGatewaysClientBeginResetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}/reset" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if gatewayName == "" { - return nil, errors.New("parameter gatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginUpdateTags - Updates virtual wan p2s vpn gateway tags. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the P2SVpnGateway. -// gatewayName - The name of the gateway. -// p2SVPNGatewayParameters - Parameters supplied to update a virtual wan p2s vpn gateway tags. -// options - P2SVPNGatewaysClientBeginUpdateTagsOptions contains the optional parameters for the P2SVPNGatewaysClient.BeginUpdateTags -// method. -func (client *P2SVPNGatewaysClient) BeginUpdateTags(ctx context.Context, resourceGroupName string, gatewayName string, p2SVPNGatewayParameters TagsObject, options *P2SVPNGatewaysClientBeginUpdateTagsOptions) (*runtime.Poller[P2SVPNGatewaysClientUpdateTagsResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.updateTags(ctx, resourceGroupName, gatewayName, p2SVPNGatewayParameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[P2SVPNGatewaysClientUpdateTagsResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[P2SVPNGatewaysClientUpdateTagsResponse](options.ResumeToken, client.pl, nil) - } -} - -// UpdateTags - Updates virtual wan p2s vpn gateway tags. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *P2SVPNGatewaysClient) updateTags(ctx context.Context, resourceGroupName string, gatewayName string, p2SVPNGatewayParameters TagsObject, options *P2SVPNGatewaysClientBeginUpdateTagsOptions) (*http.Response, error) { - req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, gatewayName, p2SVPNGatewayParameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// updateTagsCreateRequest creates the UpdateTags request. -func (client *P2SVPNGatewaysClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, p2SVPNGatewayParameters TagsObject, options *P2SVPNGatewaysClientBeginUpdateTagsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if gatewayName == "" { - return nil, errors.New("parameter gatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, p2SVPNGatewayParameters) -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/packetcaptures_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/packetcaptures_client.go deleted file mode 100644 index ce31b491..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/packetcaptures_client.go +++ /dev/null @@ -1,462 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// PacketCapturesClient contains the methods for the PacketCaptures group. -// Don't use this type directly, use NewPacketCapturesClient() instead. -type PacketCapturesClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewPacketCapturesClient creates a new instance of PacketCapturesClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewPacketCapturesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PacketCapturesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &PacketCapturesClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreate - Create and start a packet capture on the specified VM. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkWatcherName - The name of the network watcher. -// packetCaptureName - The name of the packet capture session. -// parameters - Parameters that define the create packet capture operation. -// options - PacketCapturesClientBeginCreateOptions contains the optional parameters for the PacketCapturesClient.BeginCreate -// method. -func (client *PacketCapturesClient) BeginCreate(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string, parameters PacketCapture, options *PacketCapturesClientBeginCreateOptions) (*runtime.Poller[PacketCapturesClientCreateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.create(ctx, resourceGroupName, networkWatcherName, packetCaptureName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[PacketCapturesClientCreateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[PacketCapturesClientCreateResponse](options.ResumeToken, client.pl, nil) - } -} - -// Create - Create and start a packet capture on the specified VM. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *PacketCapturesClient) create(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string, parameters PacketCapture, options *PacketCapturesClientBeginCreateOptions) (*http.Response, error) { - req, err := client.createCreateRequest(ctx, resourceGroupName, networkWatcherName, packetCaptureName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createCreateRequest creates the Create request. -func (client *PacketCapturesClient) createCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string, parameters PacketCapture, options *PacketCapturesClientBeginCreateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkWatcherName == "" { - return nil, errors.New("parameter networkWatcherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) - if packetCaptureName == "" { - return nil, errors.New("parameter packetCaptureName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{packetCaptureName}", url.PathEscape(packetCaptureName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginDelete - Deletes the specified packet capture session. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkWatcherName - The name of the network watcher. -// packetCaptureName - The name of the packet capture session. -// options - PacketCapturesClientBeginDeleteOptions contains the optional parameters for the PacketCapturesClient.BeginDelete -// method. -func (client *PacketCapturesClient) BeginDelete(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string, options *PacketCapturesClientBeginDeleteOptions) (*runtime.Poller[PacketCapturesClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, networkWatcherName, packetCaptureName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[PacketCapturesClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[PacketCapturesClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes the specified packet capture session. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *PacketCapturesClient) deleteOperation(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string, options *PacketCapturesClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, networkWatcherName, packetCaptureName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *PacketCapturesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string, options *PacketCapturesClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkWatcherName == "" { - return nil, errors.New("parameter networkWatcherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) - if packetCaptureName == "" { - return nil, errors.New("parameter packetCaptureName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{packetCaptureName}", url.PathEscape(packetCaptureName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets a packet capture session by name. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkWatcherName - The name of the network watcher. -// packetCaptureName - The name of the packet capture session. -// options - PacketCapturesClientGetOptions contains the optional parameters for the PacketCapturesClient.Get method. -func (client *PacketCapturesClient) Get(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string, options *PacketCapturesClientGetOptions) (PacketCapturesClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, networkWatcherName, packetCaptureName, options) - if err != nil { - return PacketCapturesClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return PacketCapturesClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PacketCapturesClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *PacketCapturesClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string, options *PacketCapturesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkWatcherName == "" { - return nil, errors.New("parameter networkWatcherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) - if packetCaptureName == "" { - return nil, errors.New("parameter packetCaptureName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{packetCaptureName}", url.PathEscape(packetCaptureName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *PacketCapturesClient) getHandleResponse(resp *http.Response) (PacketCapturesClientGetResponse, error) { - result := PacketCapturesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.PacketCaptureResult); err != nil { - return PacketCapturesClientGetResponse{}, err - } - return result, nil -} - -// BeginGetStatus - Query the status of a running packet capture session. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkWatcherName - The name of the Network Watcher resource. -// packetCaptureName - The name given to the packet capture session. -// options - PacketCapturesClientBeginGetStatusOptions contains the optional parameters for the PacketCapturesClient.BeginGetStatus -// method. -func (client *PacketCapturesClient) BeginGetStatus(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string, options *PacketCapturesClientBeginGetStatusOptions) (*runtime.Poller[PacketCapturesClientGetStatusResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.getStatus(ctx, resourceGroupName, networkWatcherName, packetCaptureName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[PacketCapturesClientGetStatusResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[PacketCapturesClientGetStatusResponse](options.ResumeToken, client.pl, nil) - } -} - -// GetStatus - Query the status of a running packet capture session. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *PacketCapturesClient) getStatus(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string, options *PacketCapturesClientBeginGetStatusOptions) (*http.Response, error) { - req, err := client.getStatusCreateRequest(ctx, resourceGroupName, networkWatcherName, packetCaptureName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// getStatusCreateRequest creates the GetStatus request. -func (client *PacketCapturesClient) getStatusCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string, options *PacketCapturesClientBeginGetStatusOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/queryStatus" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkWatcherName == "" { - return nil, errors.New("parameter networkWatcherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) - if packetCaptureName == "" { - return nil, errors.New("parameter packetCaptureName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{packetCaptureName}", url.PathEscape(packetCaptureName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// NewListPager - Lists all packet capture sessions within the specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkWatcherName - The name of the Network Watcher resource. -// options - PacketCapturesClientListOptions contains the optional parameters for the PacketCapturesClient.List method. -func (client *PacketCapturesClient) NewListPager(resourceGroupName string, networkWatcherName string, options *PacketCapturesClientListOptions) *runtime.Pager[PacketCapturesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[PacketCapturesClientListResponse]{ - More: func(page PacketCapturesClientListResponse) bool { - return false - }, - Fetcher: func(ctx context.Context, page *PacketCapturesClientListResponse) (PacketCapturesClientListResponse, error) { - req, err := client.listCreateRequest(ctx, resourceGroupName, networkWatcherName, options) - if err != nil { - return PacketCapturesClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return PacketCapturesClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PacketCapturesClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *PacketCapturesClient) listCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, options *PacketCapturesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkWatcherName == "" { - return nil, errors.New("parameter networkWatcherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *PacketCapturesClient) listHandleResponse(resp *http.Response) (PacketCapturesClientListResponse, error) { - result := PacketCapturesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.PacketCaptureListResult); err != nil { - return PacketCapturesClientListResponse{}, err - } - return result, nil -} - -// BeginStop - Stops a specified packet capture session. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkWatcherName - The name of the network watcher. -// packetCaptureName - The name of the packet capture session. -// options - PacketCapturesClientBeginStopOptions contains the optional parameters for the PacketCapturesClient.BeginStop -// method. -func (client *PacketCapturesClient) BeginStop(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string, options *PacketCapturesClientBeginStopOptions) (*runtime.Poller[PacketCapturesClientStopResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.stop(ctx, resourceGroupName, networkWatcherName, packetCaptureName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[PacketCapturesClientStopResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[PacketCapturesClientStopResponse](options.ResumeToken, client.pl, nil) - } -} - -// Stop - Stops a specified packet capture session. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *PacketCapturesClient) stop(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string, options *PacketCapturesClientBeginStopOptions) (*http.Response, error) { - req, err := client.stopCreateRequest(ctx, resourceGroupName, networkWatcherName, packetCaptureName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// stopCreateRequest creates the Stop request. -func (client *PacketCapturesClient) stopCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string, options *PacketCapturesClientBeginStopOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/stop" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkWatcherName == "" { - return nil, errors.New("parameter networkWatcherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) - if packetCaptureName == "" { - return nil, errors.New("parameter packetCaptureName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{packetCaptureName}", url.PathEscape(packetCaptureName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/peerexpressroutecircuitconnections_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/peerexpressroutecircuitconnections_client.go deleted file mode 100644 index cfa4b305..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/peerexpressroutecircuitconnections_client.go +++ /dev/null @@ -1,199 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// PeerExpressRouteCircuitConnectionsClient contains the methods for the PeerExpressRouteCircuitConnections group. -// Don't use this type directly, use NewPeerExpressRouteCircuitConnectionsClient() instead. -type PeerExpressRouteCircuitConnectionsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewPeerExpressRouteCircuitConnectionsClient creates a new instance of PeerExpressRouteCircuitConnectionsClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewPeerExpressRouteCircuitConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PeerExpressRouteCircuitConnectionsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &PeerExpressRouteCircuitConnectionsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// Get - Gets the specified Peer Express Route Circuit Connection from the specified express route circuit. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// circuitName - The name of the express route circuit. -// peeringName - The name of the peering. -// connectionName - The name of the peer express route circuit connection. -// options - PeerExpressRouteCircuitConnectionsClientGetOptions contains the optional parameters for the PeerExpressRouteCircuitConnectionsClient.Get -// method. -func (client *PeerExpressRouteCircuitConnectionsClient) Get(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, connectionName string, options *PeerExpressRouteCircuitConnectionsClientGetOptions) (PeerExpressRouteCircuitConnectionsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, circuitName, peeringName, connectionName, options) - if err != nil { - return PeerExpressRouteCircuitConnectionsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return PeerExpressRouteCircuitConnectionsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PeerExpressRouteCircuitConnectionsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *PeerExpressRouteCircuitConnectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, connectionName string, options *PeerExpressRouteCircuitConnectionsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/peerConnections/{connectionName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if circuitName == "" { - return nil, errors.New("parameter circuitName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{circuitName}", url.PathEscape(circuitName)) - if peeringName == "" { - return nil, errors.New("parameter peeringName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{peeringName}", url.PathEscape(peeringName)) - if connectionName == "" { - return nil, errors.New("parameter connectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *PeerExpressRouteCircuitConnectionsClient) getHandleResponse(resp *http.Response) (PeerExpressRouteCircuitConnectionsClientGetResponse, error) { - result := PeerExpressRouteCircuitConnectionsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.PeerExpressRouteCircuitConnection); err != nil { - return PeerExpressRouteCircuitConnectionsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Gets all global reach peer connections associated with a private peering in an express route circuit. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// circuitName - The name of the circuit. -// peeringName - The name of the peering. -// options - PeerExpressRouteCircuitConnectionsClientListOptions contains the optional parameters for the PeerExpressRouteCircuitConnectionsClient.List -// method. -func (client *PeerExpressRouteCircuitConnectionsClient) NewListPager(resourceGroupName string, circuitName string, peeringName string, options *PeerExpressRouteCircuitConnectionsClientListOptions) *runtime.Pager[PeerExpressRouteCircuitConnectionsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[PeerExpressRouteCircuitConnectionsClientListResponse]{ - More: func(page PeerExpressRouteCircuitConnectionsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *PeerExpressRouteCircuitConnectionsClientListResponse) (PeerExpressRouteCircuitConnectionsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, circuitName, peeringName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return PeerExpressRouteCircuitConnectionsClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return PeerExpressRouteCircuitConnectionsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PeerExpressRouteCircuitConnectionsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *PeerExpressRouteCircuitConnectionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, options *PeerExpressRouteCircuitConnectionsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/peerConnections" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if circuitName == "" { - return nil, errors.New("parameter circuitName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{circuitName}", url.PathEscape(circuitName)) - if peeringName == "" { - return nil, errors.New("parameter peeringName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{peeringName}", url.PathEscape(peeringName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *PeerExpressRouteCircuitConnectionsClient) listHandleResponse(resp *http.Response) (PeerExpressRouteCircuitConnectionsClientListResponse, error) { - result := PeerExpressRouteCircuitConnectionsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.PeerExpressRouteCircuitConnectionListResult); err != nil { - return PeerExpressRouteCircuitConnectionsClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/polymorphic_helpers.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/polymorphic_helpers.go deleted file mode 100644 index b109bf52..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/polymorphic_helpers.go +++ /dev/null @@ -1,209 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import "encoding/json" - -func unmarshalActiveBaseSecurityAdminRuleClassification(rawMsg json.RawMessage) (ActiveBaseSecurityAdminRuleClassification, error) { - if rawMsg == nil { - return nil, nil - } - var m map[string]interface{} - if err := json.Unmarshal(rawMsg, &m); err != nil { - return nil, err - } - var b ActiveBaseSecurityAdminRuleClassification - switch m["kind"] { - case string(EffectiveAdminRuleKindCustom): - b = &ActiveSecurityAdminRule{} - case string(EffectiveAdminRuleKindDefault): - b = &ActiveDefaultSecurityAdminRule{} - default: - b = &ActiveBaseSecurityAdminRule{} - } - return b, json.Unmarshal(rawMsg, b) -} - -func unmarshalActiveBaseSecurityAdminRuleClassificationArray(rawMsg json.RawMessage) ([]ActiveBaseSecurityAdminRuleClassification, error) { - if rawMsg == nil { - return nil, nil - } - var rawMessages []json.RawMessage - if err := json.Unmarshal(rawMsg, &rawMessages); err != nil { - return nil, err - } - fArray := make([]ActiveBaseSecurityAdminRuleClassification, len(rawMessages)) - for index, rawMessage := range rawMessages { - f, err := unmarshalActiveBaseSecurityAdminRuleClassification(rawMessage) - if err != nil { - return nil, err - } - fArray[index] = f - } - return fArray, nil -} - -func unmarshalBaseAdminRuleClassification(rawMsg json.RawMessage) (BaseAdminRuleClassification, error) { - if rawMsg == nil { - return nil, nil - } - var m map[string]interface{} - if err := json.Unmarshal(rawMsg, &m); err != nil { - return nil, err - } - var b BaseAdminRuleClassification - switch m["kind"] { - case string(AdminRuleKindCustom): - b = &AdminRule{} - case string(AdminRuleKindDefault): - b = &DefaultAdminRule{} - default: - b = &BaseAdminRule{} - } - return b, json.Unmarshal(rawMsg, b) -} - -func unmarshalBaseAdminRuleClassificationArray(rawMsg json.RawMessage) ([]BaseAdminRuleClassification, error) { - if rawMsg == nil { - return nil, nil - } - var rawMessages []json.RawMessage - if err := json.Unmarshal(rawMsg, &rawMessages); err != nil { - return nil, err - } - fArray := make([]BaseAdminRuleClassification, len(rawMessages)) - for index, rawMessage := range rawMessages { - f, err := unmarshalBaseAdminRuleClassification(rawMessage) - if err != nil { - return nil, err - } - fArray[index] = f - } - return fArray, nil -} - -func unmarshalEffectiveBaseSecurityAdminRuleClassification(rawMsg json.RawMessage) (EffectiveBaseSecurityAdminRuleClassification, error) { - if rawMsg == nil { - return nil, nil - } - var m map[string]interface{} - if err := json.Unmarshal(rawMsg, &m); err != nil { - return nil, err - } - var b EffectiveBaseSecurityAdminRuleClassification - switch m["kind"] { - case string(EffectiveAdminRuleKindCustom): - b = &EffectiveSecurityAdminRule{} - case string(EffectiveAdminRuleKindDefault): - b = &EffectiveDefaultSecurityAdminRule{} - default: - b = &EffectiveBaseSecurityAdminRule{} - } - return b, json.Unmarshal(rawMsg, b) -} - -func unmarshalEffectiveBaseSecurityAdminRuleClassificationArray(rawMsg json.RawMessage) ([]EffectiveBaseSecurityAdminRuleClassification, error) { - if rawMsg == nil { - return nil, nil - } - var rawMessages []json.RawMessage - if err := json.Unmarshal(rawMsg, &rawMessages); err != nil { - return nil, err - } - fArray := make([]EffectiveBaseSecurityAdminRuleClassification, len(rawMessages)) - for index, rawMessage := range rawMessages { - f, err := unmarshalEffectiveBaseSecurityAdminRuleClassification(rawMessage) - if err != nil { - return nil, err - } - fArray[index] = f - } - return fArray, nil -} - -func unmarshalFirewallPolicyRuleClassification(rawMsg json.RawMessage) (FirewallPolicyRuleClassification, error) { - if rawMsg == nil { - return nil, nil - } - var m map[string]interface{} - if err := json.Unmarshal(rawMsg, &m); err != nil { - return nil, err - } - var b FirewallPolicyRuleClassification - switch m["ruleType"] { - case string(FirewallPolicyRuleTypeApplicationRule): - b = &ApplicationRule{} - case string(FirewallPolicyRuleTypeNatRule): - b = &NatRule{} - case string(FirewallPolicyRuleTypeNetworkRule): - b = &Rule{} - default: - b = &FirewallPolicyRule{} - } - return b, json.Unmarshal(rawMsg, b) -} - -func unmarshalFirewallPolicyRuleClassificationArray(rawMsg json.RawMessage) ([]FirewallPolicyRuleClassification, error) { - if rawMsg == nil { - return nil, nil - } - var rawMessages []json.RawMessage - if err := json.Unmarshal(rawMsg, &rawMessages); err != nil { - return nil, err - } - fArray := make([]FirewallPolicyRuleClassification, len(rawMessages)) - for index, rawMessage := range rawMessages { - f, err := unmarshalFirewallPolicyRuleClassification(rawMessage) - if err != nil { - return nil, err - } - fArray[index] = f - } - return fArray, nil -} - -func unmarshalFirewallPolicyRuleCollectionClassification(rawMsg json.RawMessage) (FirewallPolicyRuleCollectionClassification, error) { - if rawMsg == nil { - return nil, nil - } - var m map[string]interface{} - if err := json.Unmarshal(rawMsg, &m); err != nil { - return nil, err - } - var b FirewallPolicyRuleCollectionClassification - switch m["ruleCollectionType"] { - case string(FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection): - b = &FirewallPolicyFilterRuleCollection{} - case string(FirewallPolicyRuleCollectionTypeFirewallPolicyNatRuleCollection): - b = &FirewallPolicyNatRuleCollection{} - default: - b = &FirewallPolicyRuleCollection{} - } - return b, json.Unmarshal(rawMsg, b) -} - -func unmarshalFirewallPolicyRuleCollectionClassificationArray(rawMsg json.RawMessage) ([]FirewallPolicyRuleCollectionClassification, error) { - if rawMsg == nil { - return nil, nil - } - var rawMessages []json.RawMessage - if err := json.Unmarshal(rawMsg, &rawMessages); err != nil { - return nil, err - } - fArray := make([]FirewallPolicyRuleCollectionClassification, len(rawMessages)) - for index, rawMessage := range rawMessages { - f, err := unmarshalFirewallPolicyRuleCollectionClassification(rawMessage) - if err != nil { - return nil, err - } - fArray[index] = f - } - return fArray, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/privatednszonegroups_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/privatednszonegroups_client.go deleted file mode 100644 index 18973d2e..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/privatednszonegroups_client.go +++ /dev/null @@ -1,330 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// PrivateDNSZoneGroupsClient contains the methods for the PrivateDNSZoneGroups group. -// Don't use this type directly, use NewPrivateDNSZoneGroupsClient() instead. -type PrivateDNSZoneGroupsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewPrivateDNSZoneGroupsClient creates a new instance of PrivateDNSZoneGroupsClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewPrivateDNSZoneGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateDNSZoneGroupsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &PrivateDNSZoneGroupsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates a private dns zone group in the specified private endpoint. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// privateEndpointName - The name of the private endpoint. -// privateDNSZoneGroupName - The name of the private dns zone group. -// parameters - Parameters supplied to the create or update private dns zone group operation. -// options - PrivateDNSZoneGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateDNSZoneGroupsClient.BeginCreateOrUpdate -// method. -func (client *PrivateDNSZoneGroupsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, privateEndpointName string, privateDNSZoneGroupName string, parameters PrivateDNSZoneGroup, options *PrivateDNSZoneGroupsClientBeginCreateOrUpdateOptions) (*runtime.Poller[PrivateDNSZoneGroupsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, privateEndpointName, privateDNSZoneGroupName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[PrivateDNSZoneGroupsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[PrivateDNSZoneGroupsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates or updates a private dns zone group in the specified private endpoint. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *PrivateDNSZoneGroupsClient) createOrUpdate(ctx context.Context, resourceGroupName string, privateEndpointName string, privateDNSZoneGroupName string, parameters PrivateDNSZoneGroup, options *PrivateDNSZoneGroupsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, privateEndpointName, privateDNSZoneGroupName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *PrivateDNSZoneGroupsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, privateEndpointName string, privateDNSZoneGroupName string, parameters PrivateDNSZoneGroup, options *PrivateDNSZoneGroupsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}/privateDnsZoneGroups/{privateDnsZoneGroupName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if privateEndpointName == "" { - return nil, errors.New("parameter privateEndpointName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{privateEndpointName}", url.PathEscape(privateEndpointName)) - if privateDNSZoneGroupName == "" { - return nil, errors.New("parameter privateDNSZoneGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{privateDnsZoneGroupName}", url.PathEscape(privateDNSZoneGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginDelete - Deletes the specified private dns zone group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// privateEndpointName - The name of the private endpoint. -// privateDNSZoneGroupName - The name of the private dns zone group. -// options - PrivateDNSZoneGroupsClientBeginDeleteOptions contains the optional parameters for the PrivateDNSZoneGroupsClient.BeginDelete -// method. -func (client *PrivateDNSZoneGroupsClient) BeginDelete(ctx context.Context, resourceGroupName string, privateEndpointName string, privateDNSZoneGroupName string, options *PrivateDNSZoneGroupsClientBeginDeleteOptions) (*runtime.Poller[PrivateDNSZoneGroupsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, privateEndpointName, privateDNSZoneGroupName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[PrivateDNSZoneGroupsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[PrivateDNSZoneGroupsClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes the specified private dns zone group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *PrivateDNSZoneGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, privateEndpointName string, privateDNSZoneGroupName string, options *PrivateDNSZoneGroupsClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, privateEndpointName, privateDNSZoneGroupName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *PrivateDNSZoneGroupsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, privateEndpointName string, privateDNSZoneGroupName string, options *PrivateDNSZoneGroupsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}/privateDnsZoneGroups/{privateDnsZoneGroupName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if privateEndpointName == "" { - return nil, errors.New("parameter privateEndpointName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{privateEndpointName}", url.PathEscape(privateEndpointName)) - if privateDNSZoneGroupName == "" { - return nil, errors.New("parameter privateDNSZoneGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{privateDnsZoneGroupName}", url.PathEscape(privateDNSZoneGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets the private dns zone group resource by specified private dns zone group name. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// privateEndpointName - The name of the private endpoint. -// privateDNSZoneGroupName - The name of the private dns zone group. -// options - PrivateDNSZoneGroupsClientGetOptions contains the optional parameters for the PrivateDNSZoneGroupsClient.Get -// method. -func (client *PrivateDNSZoneGroupsClient) Get(ctx context.Context, resourceGroupName string, privateEndpointName string, privateDNSZoneGroupName string, options *PrivateDNSZoneGroupsClientGetOptions) (PrivateDNSZoneGroupsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, privateEndpointName, privateDNSZoneGroupName, options) - if err != nil { - return PrivateDNSZoneGroupsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return PrivateDNSZoneGroupsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PrivateDNSZoneGroupsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *PrivateDNSZoneGroupsClient) getCreateRequest(ctx context.Context, resourceGroupName string, privateEndpointName string, privateDNSZoneGroupName string, options *PrivateDNSZoneGroupsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}/privateDnsZoneGroups/{privateDnsZoneGroupName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if privateEndpointName == "" { - return nil, errors.New("parameter privateEndpointName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{privateEndpointName}", url.PathEscape(privateEndpointName)) - if privateDNSZoneGroupName == "" { - return nil, errors.New("parameter privateDNSZoneGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{privateDnsZoneGroupName}", url.PathEscape(privateDNSZoneGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *PrivateDNSZoneGroupsClient) getHandleResponse(resp *http.Response) (PrivateDNSZoneGroupsClientGetResponse, error) { - result := PrivateDNSZoneGroupsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.PrivateDNSZoneGroup); err != nil { - return PrivateDNSZoneGroupsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Gets all private dns zone groups in a private endpoint. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// privateEndpointName - The name of the private endpoint. -// resourceGroupName - The name of the resource group. -// options - PrivateDNSZoneGroupsClientListOptions contains the optional parameters for the PrivateDNSZoneGroupsClient.List -// method. -func (client *PrivateDNSZoneGroupsClient) NewListPager(privateEndpointName string, resourceGroupName string, options *PrivateDNSZoneGroupsClientListOptions) *runtime.Pager[PrivateDNSZoneGroupsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[PrivateDNSZoneGroupsClientListResponse]{ - More: func(page PrivateDNSZoneGroupsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *PrivateDNSZoneGroupsClientListResponse) (PrivateDNSZoneGroupsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, privateEndpointName, resourceGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return PrivateDNSZoneGroupsClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return PrivateDNSZoneGroupsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PrivateDNSZoneGroupsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *PrivateDNSZoneGroupsClient) listCreateRequest(ctx context.Context, privateEndpointName string, resourceGroupName string, options *PrivateDNSZoneGroupsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}/privateDnsZoneGroups" - if privateEndpointName == "" { - return nil, errors.New("parameter privateEndpointName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{privateEndpointName}", url.PathEscape(privateEndpointName)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *PrivateDNSZoneGroupsClient) listHandleResponse(resp *http.Response) (PrivateDNSZoneGroupsClientListResponse, error) { - result := PrivateDNSZoneGroupsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.PrivateDNSZoneGroupListResult); err != nil { - return PrivateDNSZoneGroupsClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/privateendpoints_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/privateendpoints_client.go deleted file mode 100644 index 11cdb9bf..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/privateendpoints_client.go +++ /dev/null @@ -1,371 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// PrivateEndpointsClient contains the methods for the PrivateEndpoints group. -// Don't use this type directly, use NewPrivateEndpointsClient() instead. -type PrivateEndpointsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewPrivateEndpointsClient creates a new instance of PrivateEndpointsClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewPrivateEndpointsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateEndpointsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &PrivateEndpointsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates an private endpoint in the specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// privateEndpointName - The name of the private endpoint. -// parameters - Parameters supplied to the create or update private endpoint operation. -// options - PrivateEndpointsClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateEndpointsClient.BeginCreateOrUpdate -// method. -func (client *PrivateEndpointsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, privateEndpointName string, parameters PrivateEndpoint, options *PrivateEndpointsClientBeginCreateOrUpdateOptions) (*runtime.Poller[PrivateEndpointsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, privateEndpointName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[PrivateEndpointsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[PrivateEndpointsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates or updates an private endpoint in the specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *PrivateEndpointsClient) createOrUpdate(ctx context.Context, resourceGroupName string, privateEndpointName string, parameters PrivateEndpoint, options *PrivateEndpointsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, privateEndpointName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *PrivateEndpointsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, privateEndpointName string, parameters PrivateEndpoint, options *PrivateEndpointsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if privateEndpointName == "" { - return nil, errors.New("parameter privateEndpointName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{privateEndpointName}", url.PathEscape(privateEndpointName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginDelete - Deletes the specified private endpoint. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// privateEndpointName - The name of the private endpoint. -// options - PrivateEndpointsClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointsClient.BeginDelete -// method. -func (client *PrivateEndpointsClient) BeginDelete(ctx context.Context, resourceGroupName string, privateEndpointName string, options *PrivateEndpointsClientBeginDeleteOptions) (*runtime.Poller[PrivateEndpointsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, privateEndpointName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[PrivateEndpointsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[PrivateEndpointsClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes the specified private endpoint. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *PrivateEndpointsClient) deleteOperation(ctx context.Context, resourceGroupName string, privateEndpointName string, options *PrivateEndpointsClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, privateEndpointName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *PrivateEndpointsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, privateEndpointName string, options *PrivateEndpointsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if privateEndpointName == "" { - return nil, errors.New("parameter privateEndpointName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{privateEndpointName}", url.PathEscape(privateEndpointName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets the specified private endpoint by resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// privateEndpointName - The name of the private endpoint. -// options - PrivateEndpointsClientGetOptions contains the optional parameters for the PrivateEndpointsClient.Get method. -func (client *PrivateEndpointsClient) Get(ctx context.Context, resourceGroupName string, privateEndpointName string, options *PrivateEndpointsClientGetOptions) (PrivateEndpointsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, privateEndpointName, options) - if err != nil { - return PrivateEndpointsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return PrivateEndpointsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PrivateEndpointsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *PrivateEndpointsClient) getCreateRequest(ctx context.Context, resourceGroupName string, privateEndpointName string, options *PrivateEndpointsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if privateEndpointName == "" { - return nil, errors.New("parameter privateEndpointName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{privateEndpointName}", url.PathEscape(privateEndpointName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *PrivateEndpointsClient) getHandleResponse(resp *http.Response) (PrivateEndpointsClientGetResponse, error) { - result := PrivateEndpointsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpoint); err != nil { - return PrivateEndpointsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Gets all private endpoints in a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// options - PrivateEndpointsClientListOptions contains the optional parameters for the PrivateEndpointsClient.List method. -func (client *PrivateEndpointsClient) NewListPager(resourceGroupName string, options *PrivateEndpointsClientListOptions) *runtime.Pager[PrivateEndpointsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[PrivateEndpointsClientListResponse]{ - More: func(page PrivateEndpointsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *PrivateEndpointsClientListResponse) (PrivateEndpointsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return PrivateEndpointsClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return PrivateEndpointsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PrivateEndpointsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *PrivateEndpointsClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *PrivateEndpointsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *PrivateEndpointsClient) listHandleResponse(resp *http.Response) (PrivateEndpointsClientListResponse, error) { - result := PrivateEndpointsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointListResult); err != nil { - return PrivateEndpointsClientListResponse{}, err - } - return result, nil -} - -// NewListBySubscriptionPager - Gets all private endpoints in a subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// options - PrivateEndpointsClientListBySubscriptionOptions contains the optional parameters for the PrivateEndpointsClient.ListBySubscription -// method. -func (client *PrivateEndpointsClient) NewListBySubscriptionPager(options *PrivateEndpointsClientListBySubscriptionOptions) *runtime.Pager[PrivateEndpointsClientListBySubscriptionResponse] { - return runtime.NewPager(runtime.PagingHandler[PrivateEndpointsClientListBySubscriptionResponse]{ - More: func(page PrivateEndpointsClientListBySubscriptionResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *PrivateEndpointsClientListBySubscriptionResponse) (PrivateEndpointsClientListBySubscriptionResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listBySubscriptionCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return PrivateEndpointsClientListBySubscriptionResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return PrivateEndpointsClientListBySubscriptionResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PrivateEndpointsClientListBySubscriptionResponse{}, runtime.NewResponseError(resp) - } - return client.listBySubscriptionHandleResponse(resp) - }, - }) -} - -// listBySubscriptionCreateRequest creates the ListBySubscription request. -func (client *PrivateEndpointsClient) listBySubscriptionCreateRequest(ctx context.Context, options *PrivateEndpointsClientListBySubscriptionOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/privateEndpoints" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listBySubscriptionHandleResponse handles the ListBySubscription response. -func (client *PrivateEndpointsClient) listBySubscriptionHandleResponse(resp *http.Response) (PrivateEndpointsClientListBySubscriptionResponse, error) { - result := PrivateEndpointsClientListBySubscriptionResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointListResult); err != nil { - return PrivateEndpointsClientListBySubscriptionResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/privatelinkservices_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/privatelinkservices_client.go deleted file mode 100644 index 8def9ee2..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/privatelinkservices_client.go +++ /dev/null @@ -1,907 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// PrivateLinkServicesClient contains the methods for the PrivateLinkServices group. -// Don't use this type directly, use NewPrivateLinkServicesClient() instead. -type PrivateLinkServicesClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewPrivateLinkServicesClient creates a new instance of PrivateLinkServicesClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewPrivateLinkServicesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateLinkServicesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &PrivateLinkServicesClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCheckPrivateLinkServiceVisibility - Checks whether the subscription is visible to private link service. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// location - The location of the domain name. -// parameters - The request body of CheckPrivateLinkService API call. -// options - PrivateLinkServicesClientBeginCheckPrivateLinkServiceVisibilityOptions contains the optional parameters for the -// PrivateLinkServicesClient.BeginCheckPrivateLinkServiceVisibility method. -func (client *PrivateLinkServicesClient) BeginCheckPrivateLinkServiceVisibility(ctx context.Context, location string, parameters CheckPrivateLinkServiceVisibilityRequest, options *PrivateLinkServicesClientBeginCheckPrivateLinkServiceVisibilityOptions) (*runtime.Poller[PrivateLinkServicesClientCheckPrivateLinkServiceVisibilityResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.checkPrivateLinkServiceVisibility(ctx, location, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[PrivateLinkServicesClientCheckPrivateLinkServiceVisibilityResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[PrivateLinkServicesClientCheckPrivateLinkServiceVisibilityResponse](options.ResumeToken, client.pl, nil) - } -} - -// CheckPrivateLinkServiceVisibility - Checks whether the subscription is visible to private link service. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *PrivateLinkServicesClient) checkPrivateLinkServiceVisibility(ctx context.Context, location string, parameters CheckPrivateLinkServiceVisibilityRequest, options *PrivateLinkServicesClientBeginCheckPrivateLinkServiceVisibilityOptions) (*http.Response, error) { - req, err := client.checkPrivateLinkServiceVisibilityCreateRequest(ctx, location, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// checkPrivateLinkServiceVisibilityCreateRequest creates the CheckPrivateLinkServiceVisibility request. -func (client *PrivateLinkServicesClient) checkPrivateLinkServiceVisibilityCreateRequest(ctx context.Context, location string, parameters CheckPrivateLinkServiceVisibilityRequest, options *PrivateLinkServicesClientBeginCheckPrivateLinkServiceVisibilityOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginCheckPrivateLinkServiceVisibilityByResourceGroup - Checks whether the subscription is visible to private link service -// in the specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// location - The location of the domain name. -// resourceGroupName - The name of the resource group. -// parameters - The request body of CheckPrivateLinkService API call. -// options - PrivateLinkServicesClientBeginCheckPrivateLinkServiceVisibilityByResourceGroupOptions contains the optional parameters -// for the PrivateLinkServicesClient.BeginCheckPrivateLinkServiceVisibilityByResourceGroup method. -func (client *PrivateLinkServicesClient) BeginCheckPrivateLinkServiceVisibilityByResourceGroup(ctx context.Context, location string, resourceGroupName string, parameters CheckPrivateLinkServiceVisibilityRequest, options *PrivateLinkServicesClientBeginCheckPrivateLinkServiceVisibilityByResourceGroupOptions) (*runtime.Poller[PrivateLinkServicesClientCheckPrivateLinkServiceVisibilityByResourceGroupResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.checkPrivateLinkServiceVisibilityByResourceGroup(ctx, location, resourceGroupName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[PrivateLinkServicesClientCheckPrivateLinkServiceVisibilityByResourceGroupResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[PrivateLinkServicesClientCheckPrivateLinkServiceVisibilityByResourceGroupResponse](options.ResumeToken, client.pl, nil) - } -} - -// CheckPrivateLinkServiceVisibilityByResourceGroup - Checks whether the subscription is visible to private link service in -// the specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *PrivateLinkServicesClient) checkPrivateLinkServiceVisibilityByResourceGroup(ctx context.Context, location string, resourceGroupName string, parameters CheckPrivateLinkServiceVisibilityRequest, options *PrivateLinkServicesClientBeginCheckPrivateLinkServiceVisibilityByResourceGroupOptions) (*http.Response, error) { - req, err := client.checkPrivateLinkServiceVisibilityByResourceGroupCreateRequest(ctx, location, resourceGroupName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// checkPrivateLinkServiceVisibilityByResourceGroupCreateRequest creates the CheckPrivateLinkServiceVisibilityByResourceGroup request. -func (client *PrivateLinkServicesClient) checkPrivateLinkServiceVisibilityByResourceGroupCreateRequest(ctx context.Context, location string, resourceGroupName string, parameters CheckPrivateLinkServiceVisibilityRequest, options *PrivateLinkServicesClientBeginCheckPrivateLinkServiceVisibilityByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginCreateOrUpdate - Creates or updates an private link service in the specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the private link service. -// parameters - Parameters supplied to the create or update private link service operation. -// options - PrivateLinkServicesClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateLinkServicesClient.BeginCreateOrUpdate -// method. -func (client *PrivateLinkServicesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, parameters PrivateLinkService, options *PrivateLinkServicesClientBeginCreateOrUpdateOptions) (*runtime.Poller[PrivateLinkServicesClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, serviceName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[PrivateLinkServicesClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[PrivateLinkServicesClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates or updates an private link service in the specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *PrivateLinkServicesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, parameters PrivateLinkService, options *PrivateLinkServicesClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *PrivateLinkServicesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, parameters PrivateLinkService, options *PrivateLinkServicesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if serviceName == "" { - return nil, errors.New("parameter serviceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginDelete - Deletes the specified private link service. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the private link service. -// options - PrivateLinkServicesClientBeginDeleteOptions contains the optional parameters for the PrivateLinkServicesClient.BeginDelete -// method. -func (client *PrivateLinkServicesClient) BeginDelete(ctx context.Context, resourceGroupName string, serviceName string, options *PrivateLinkServicesClientBeginDeleteOptions) (*runtime.Poller[PrivateLinkServicesClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, serviceName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[PrivateLinkServicesClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[PrivateLinkServicesClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes the specified private link service. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *PrivateLinkServicesClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, options *PrivateLinkServicesClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *PrivateLinkServicesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, options *PrivateLinkServicesClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if serviceName == "" { - return nil, errors.New("parameter serviceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginDeletePrivateEndpointConnection - Delete private end point connection for a private link service in a subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the private link service. -// peConnectionName - The name of the private end point connection. -// options - PrivateLinkServicesClientBeginDeletePrivateEndpointConnectionOptions contains the optional parameters for the -// PrivateLinkServicesClient.BeginDeletePrivateEndpointConnection method. -func (client *PrivateLinkServicesClient) BeginDeletePrivateEndpointConnection(ctx context.Context, resourceGroupName string, serviceName string, peConnectionName string, options *PrivateLinkServicesClientBeginDeletePrivateEndpointConnectionOptions) (*runtime.Poller[PrivateLinkServicesClientDeletePrivateEndpointConnectionResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deletePrivateEndpointConnection(ctx, resourceGroupName, serviceName, peConnectionName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[PrivateLinkServicesClientDeletePrivateEndpointConnectionResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[PrivateLinkServicesClientDeletePrivateEndpointConnectionResponse](options.ResumeToken, client.pl, nil) - } -} - -// DeletePrivateEndpointConnection - Delete private end point connection for a private link service in a subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *PrivateLinkServicesClient) deletePrivateEndpointConnection(ctx context.Context, resourceGroupName string, serviceName string, peConnectionName string, options *PrivateLinkServicesClientBeginDeletePrivateEndpointConnectionOptions) (*http.Response, error) { - req, err := client.deletePrivateEndpointConnectionCreateRequest(ctx, resourceGroupName, serviceName, peConnectionName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deletePrivateEndpointConnectionCreateRequest creates the DeletePrivateEndpointConnection request. -func (client *PrivateLinkServicesClient) deletePrivateEndpointConnectionCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, peConnectionName string, options *PrivateLinkServicesClientBeginDeletePrivateEndpointConnectionOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}/privateEndpointConnections/{peConnectionName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if serviceName == "" { - return nil, errors.New("parameter serviceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) - if peConnectionName == "" { - return nil, errors.New("parameter peConnectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{peConnectionName}", url.PathEscape(peConnectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets the specified private link service by resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the private link service. -// options - PrivateLinkServicesClientGetOptions contains the optional parameters for the PrivateLinkServicesClient.Get method. -func (client *PrivateLinkServicesClient) Get(ctx context.Context, resourceGroupName string, serviceName string, options *PrivateLinkServicesClientGetOptions) (PrivateLinkServicesClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, options) - if err != nil { - return PrivateLinkServicesClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return PrivateLinkServicesClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PrivateLinkServicesClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *PrivateLinkServicesClient) getCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, options *PrivateLinkServicesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if serviceName == "" { - return nil, errors.New("parameter serviceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *PrivateLinkServicesClient) getHandleResponse(resp *http.Response) (PrivateLinkServicesClientGetResponse, error) { - result := PrivateLinkServicesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.PrivateLinkService); err != nil { - return PrivateLinkServicesClientGetResponse{}, err - } - return result, nil -} - -// GetPrivateEndpointConnection - Get the specific private end point connection by specific private link service in the resource -// group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the private link service. -// peConnectionName - The name of the private end point connection. -// options - PrivateLinkServicesClientGetPrivateEndpointConnectionOptions contains the optional parameters for the PrivateLinkServicesClient.GetPrivateEndpointConnection -// method. -func (client *PrivateLinkServicesClient) GetPrivateEndpointConnection(ctx context.Context, resourceGroupName string, serviceName string, peConnectionName string, options *PrivateLinkServicesClientGetPrivateEndpointConnectionOptions) (PrivateLinkServicesClientGetPrivateEndpointConnectionResponse, error) { - req, err := client.getPrivateEndpointConnectionCreateRequest(ctx, resourceGroupName, serviceName, peConnectionName, options) - if err != nil { - return PrivateLinkServicesClientGetPrivateEndpointConnectionResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return PrivateLinkServicesClientGetPrivateEndpointConnectionResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PrivateLinkServicesClientGetPrivateEndpointConnectionResponse{}, runtime.NewResponseError(resp) - } - return client.getPrivateEndpointConnectionHandleResponse(resp) -} - -// getPrivateEndpointConnectionCreateRequest creates the GetPrivateEndpointConnection request. -func (client *PrivateLinkServicesClient) getPrivateEndpointConnectionCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, peConnectionName string, options *PrivateLinkServicesClientGetPrivateEndpointConnectionOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}/privateEndpointConnections/{peConnectionName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if serviceName == "" { - return nil, errors.New("parameter serviceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) - if peConnectionName == "" { - return nil, errors.New("parameter peConnectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{peConnectionName}", url.PathEscape(peConnectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getPrivateEndpointConnectionHandleResponse handles the GetPrivateEndpointConnection response. -func (client *PrivateLinkServicesClient) getPrivateEndpointConnectionHandleResponse(resp *http.Response) (PrivateLinkServicesClientGetPrivateEndpointConnectionResponse, error) { - result := PrivateLinkServicesClientGetPrivateEndpointConnectionResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnection); err != nil { - return PrivateLinkServicesClientGetPrivateEndpointConnectionResponse{}, err - } - return result, nil -} - -// NewListPager - Gets all private link services in a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// options - PrivateLinkServicesClientListOptions contains the optional parameters for the PrivateLinkServicesClient.List -// method. -func (client *PrivateLinkServicesClient) NewListPager(resourceGroupName string, options *PrivateLinkServicesClientListOptions) *runtime.Pager[PrivateLinkServicesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[PrivateLinkServicesClientListResponse]{ - More: func(page PrivateLinkServicesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *PrivateLinkServicesClientListResponse) (PrivateLinkServicesClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return PrivateLinkServicesClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return PrivateLinkServicesClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PrivateLinkServicesClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *PrivateLinkServicesClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *PrivateLinkServicesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *PrivateLinkServicesClient) listHandleResponse(resp *http.Response) (PrivateLinkServicesClientListResponse, error) { - result := PrivateLinkServicesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.PrivateLinkServiceListResult); err != nil { - return PrivateLinkServicesClientListResponse{}, err - } - return result, nil -} - -// NewListAutoApprovedPrivateLinkServicesPager - Returns all of the private link service ids that can be linked to a Private -// Endpoint with auto approved in this subscription in this region. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// location - The location of the domain name. -// options - PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesOptions contains the optional parameters for the -// PrivateLinkServicesClient.ListAutoApprovedPrivateLinkServices method. -func (client *PrivateLinkServicesClient) NewListAutoApprovedPrivateLinkServicesPager(location string, options *PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesOptions) *runtime.Pager[PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesResponse] { - return runtime.NewPager(runtime.PagingHandler[PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesResponse]{ - More: func(page PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesResponse) (PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listAutoApprovedPrivateLinkServicesCreateRequest(ctx, location, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesResponse{}, runtime.NewResponseError(resp) - } - return client.listAutoApprovedPrivateLinkServicesHandleResponse(resp) - }, - }) -} - -// listAutoApprovedPrivateLinkServicesCreateRequest creates the ListAutoApprovedPrivateLinkServices request. -func (client *PrivateLinkServicesClient) listAutoApprovedPrivateLinkServicesCreateRequest(ctx context.Context, location string, options *PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/autoApprovedPrivateLinkServices" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listAutoApprovedPrivateLinkServicesHandleResponse handles the ListAutoApprovedPrivateLinkServices response. -func (client *PrivateLinkServicesClient) listAutoApprovedPrivateLinkServicesHandleResponse(resp *http.Response) (PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesResponse, error) { - result := PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.AutoApprovedPrivateLinkServicesResult); err != nil { - return PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesResponse{}, err - } - return result, nil -} - -// NewListAutoApprovedPrivateLinkServicesByResourceGroupPager - Returns all of the private link service ids that can be linked -// to a Private Endpoint with auto approved in this subscription in this region. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// location - The location of the domain name. -// resourceGroupName - The name of the resource group. -// options - PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesByResourceGroupOptions contains the optional parameters -// for the PrivateLinkServicesClient.ListAutoApprovedPrivateLinkServicesByResourceGroup method. -func (client *PrivateLinkServicesClient) NewListAutoApprovedPrivateLinkServicesByResourceGroupPager(location string, resourceGroupName string, options *PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesByResourceGroupOptions) *runtime.Pager[PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesByResourceGroupResponse]{ - More: func(page PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesByResourceGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesByResourceGroupResponse) (PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesByResourceGroupResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listAutoApprovedPrivateLinkServicesByResourceGroupCreateRequest(ctx, location, resourceGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesByResourceGroupResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesByResourceGroupResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesByResourceGroupResponse{}, runtime.NewResponseError(resp) - } - return client.listAutoApprovedPrivateLinkServicesByResourceGroupHandleResponse(resp) - }, - }) -} - -// listAutoApprovedPrivateLinkServicesByResourceGroupCreateRequest creates the ListAutoApprovedPrivateLinkServicesByResourceGroup request. -func (client *PrivateLinkServicesClient) listAutoApprovedPrivateLinkServicesByResourceGroupCreateRequest(ctx context.Context, location string, resourceGroupName string, options *PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/autoApprovedPrivateLinkServices" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listAutoApprovedPrivateLinkServicesByResourceGroupHandleResponse handles the ListAutoApprovedPrivateLinkServicesByResourceGroup response. -func (client *PrivateLinkServicesClient) listAutoApprovedPrivateLinkServicesByResourceGroupHandleResponse(resp *http.Response) (PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesByResourceGroupResponse, error) { - result := PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.AutoApprovedPrivateLinkServicesResult); err != nil { - return PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesByResourceGroupResponse{}, err - } - return result, nil -} - -// NewListBySubscriptionPager - Gets all private link service in a subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// options - PrivateLinkServicesClientListBySubscriptionOptions contains the optional parameters for the PrivateLinkServicesClient.ListBySubscription -// method. -func (client *PrivateLinkServicesClient) NewListBySubscriptionPager(options *PrivateLinkServicesClientListBySubscriptionOptions) *runtime.Pager[PrivateLinkServicesClientListBySubscriptionResponse] { - return runtime.NewPager(runtime.PagingHandler[PrivateLinkServicesClientListBySubscriptionResponse]{ - More: func(page PrivateLinkServicesClientListBySubscriptionResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *PrivateLinkServicesClientListBySubscriptionResponse) (PrivateLinkServicesClientListBySubscriptionResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listBySubscriptionCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return PrivateLinkServicesClientListBySubscriptionResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return PrivateLinkServicesClientListBySubscriptionResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PrivateLinkServicesClientListBySubscriptionResponse{}, runtime.NewResponseError(resp) - } - return client.listBySubscriptionHandleResponse(resp) - }, - }) -} - -// listBySubscriptionCreateRequest creates the ListBySubscription request. -func (client *PrivateLinkServicesClient) listBySubscriptionCreateRequest(ctx context.Context, options *PrivateLinkServicesClientListBySubscriptionOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/privateLinkServices" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listBySubscriptionHandleResponse handles the ListBySubscription response. -func (client *PrivateLinkServicesClient) listBySubscriptionHandleResponse(resp *http.Response) (PrivateLinkServicesClientListBySubscriptionResponse, error) { - result := PrivateLinkServicesClientListBySubscriptionResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.PrivateLinkServiceListResult); err != nil { - return PrivateLinkServicesClientListBySubscriptionResponse{}, err - } - return result, nil -} - -// NewListPrivateEndpointConnectionsPager - Gets all private end point connections for a specific private link service. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the private link service. -// options - PrivateLinkServicesClientListPrivateEndpointConnectionsOptions contains the optional parameters for the PrivateLinkServicesClient.ListPrivateEndpointConnections -// method. -func (client *PrivateLinkServicesClient) NewListPrivateEndpointConnectionsPager(resourceGroupName string, serviceName string, options *PrivateLinkServicesClientListPrivateEndpointConnectionsOptions) *runtime.Pager[PrivateLinkServicesClientListPrivateEndpointConnectionsResponse] { - return runtime.NewPager(runtime.PagingHandler[PrivateLinkServicesClientListPrivateEndpointConnectionsResponse]{ - More: func(page PrivateLinkServicesClientListPrivateEndpointConnectionsResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *PrivateLinkServicesClientListPrivateEndpointConnectionsResponse) (PrivateLinkServicesClientListPrivateEndpointConnectionsResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listPrivateEndpointConnectionsCreateRequest(ctx, resourceGroupName, serviceName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return PrivateLinkServicesClientListPrivateEndpointConnectionsResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return PrivateLinkServicesClientListPrivateEndpointConnectionsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PrivateLinkServicesClientListPrivateEndpointConnectionsResponse{}, runtime.NewResponseError(resp) - } - return client.listPrivateEndpointConnectionsHandleResponse(resp) - }, - }) -} - -// listPrivateEndpointConnectionsCreateRequest creates the ListPrivateEndpointConnections request. -func (client *PrivateLinkServicesClient) listPrivateEndpointConnectionsCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, options *PrivateLinkServicesClientListPrivateEndpointConnectionsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}/privateEndpointConnections" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if serviceName == "" { - return nil, errors.New("parameter serviceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listPrivateEndpointConnectionsHandleResponse handles the ListPrivateEndpointConnections response. -func (client *PrivateLinkServicesClient) listPrivateEndpointConnectionsHandleResponse(resp *http.Response) (PrivateLinkServicesClientListPrivateEndpointConnectionsResponse, error) { - result := PrivateLinkServicesClientListPrivateEndpointConnectionsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnectionListResult); err != nil { - return PrivateLinkServicesClientListPrivateEndpointConnectionsResponse{}, err - } - return result, nil -} - -// UpdatePrivateEndpointConnection - Approve or reject private end point connection for a private link service in a subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the private link service. -// peConnectionName - The name of the private end point connection. -// parameters - Parameters supplied to approve or reject the private end point connection. -// options - PrivateLinkServicesClientUpdatePrivateEndpointConnectionOptions contains the optional parameters for the PrivateLinkServicesClient.UpdatePrivateEndpointConnection -// method. -func (client *PrivateLinkServicesClient) UpdatePrivateEndpointConnection(ctx context.Context, resourceGroupName string, serviceName string, peConnectionName string, parameters PrivateEndpointConnection, options *PrivateLinkServicesClientUpdatePrivateEndpointConnectionOptions) (PrivateLinkServicesClientUpdatePrivateEndpointConnectionResponse, error) { - req, err := client.updatePrivateEndpointConnectionCreateRequest(ctx, resourceGroupName, serviceName, peConnectionName, parameters, options) - if err != nil { - return PrivateLinkServicesClientUpdatePrivateEndpointConnectionResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return PrivateLinkServicesClientUpdatePrivateEndpointConnectionResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PrivateLinkServicesClientUpdatePrivateEndpointConnectionResponse{}, runtime.NewResponseError(resp) - } - return client.updatePrivateEndpointConnectionHandleResponse(resp) -} - -// updatePrivateEndpointConnectionCreateRequest creates the UpdatePrivateEndpointConnection request. -func (client *PrivateLinkServicesClient) updatePrivateEndpointConnectionCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, peConnectionName string, parameters PrivateEndpointConnection, options *PrivateLinkServicesClientUpdatePrivateEndpointConnectionOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}/privateEndpointConnections/{peConnectionName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if serviceName == "" { - return nil, errors.New("parameter serviceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) - if peConnectionName == "" { - return nil, errors.New("parameter peConnectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{peConnectionName}", url.PathEscape(peConnectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// updatePrivateEndpointConnectionHandleResponse handles the UpdatePrivateEndpointConnection response. -func (client *PrivateLinkServicesClient) updatePrivateEndpointConnectionHandleResponse(resp *http.Response) (PrivateLinkServicesClientUpdatePrivateEndpointConnectionResponse, error) { - result := PrivateLinkServicesClientUpdatePrivateEndpointConnectionResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnection); err != nil { - return PrivateLinkServicesClientUpdatePrivateEndpointConnectionResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/profiles_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/profiles_client.go deleted file mode 100644 index d15852f6..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/profiles_client.go +++ /dev/null @@ -1,417 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// ProfilesClient contains the methods for the NetworkProfiles group. -// Don't use this type directly, use NewProfilesClient() instead. -type ProfilesClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewProfilesClient creates a new instance of ProfilesClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewProfilesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ProfilesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &ProfilesClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// CreateOrUpdate - Creates or updates a network profile. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkProfileName - The name of the network profile. -// parameters - Parameters supplied to the create or update network profile operation. -// options - ProfilesClientCreateOrUpdateOptions contains the optional parameters for the ProfilesClient.CreateOrUpdate method. -func (client *ProfilesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, networkProfileName string, parameters Profile, options *ProfilesClientCreateOrUpdateOptions) (ProfilesClientCreateOrUpdateResponse, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, networkProfileName, parameters, options) - if err != nil { - return ProfilesClientCreateOrUpdateResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ProfilesClientCreateOrUpdateResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return ProfilesClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) - } - return client.createOrUpdateHandleResponse(resp) -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ProfilesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkProfileName string, parameters Profile, options *ProfilesClientCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkProfiles/{networkProfileName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkProfileName == "" { - return nil, errors.New("parameter networkProfileName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkProfileName}", url.PathEscape(networkProfileName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// createOrUpdateHandleResponse handles the CreateOrUpdate response. -func (client *ProfilesClient) createOrUpdateHandleResponse(resp *http.Response) (ProfilesClientCreateOrUpdateResponse, error) { - result := ProfilesClientCreateOrUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.Profile); err != nil { - return ProfilesClientCreateOrUpdateResponse{}, err - } - return result, nil -} - -// BeginDelete - Deletes the specified network profile. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkProfileName - The name of the NetworkProfile. -// options - ProfilesClientBeginDeleteOptions contains the optional parameters for the ProfilesClient.BeginDelete method. -func (client *ProfilesClient) BeginDelete(ctx context.Context, resourceGroupName string, networkProfileName string, options *ProfilesClientBeginDeleteOptions) (*runtime.Poller[ProfilesClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, networkProfileName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ProfilesClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[ProfilesClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes the specified network profile. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *ProfilesClient) deleteOperation(ctx context.Context, resourceGroupName string, networkProfileName string, options *ProfilesClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, networkProfileName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *ProfilesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkProfileName string, options *ProfilesClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkProfiles/{networkProfileName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkProfileName == "" { - return nil, errors.New("parameter networkProfileName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkProfileName}", url.PathEscape(networkProfileName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets the specified network profile in a specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkProfileName - The name of the public IP prefix. -// options - ProfilesClientGetOptions contains the optional parameters for the ProfilesClient.Get method. -func (client *ProfilesClient) Get(ctx context.Context, resourceGroupName string, networkProfileName string, options *ProfilesClientGetOptions) (ProfilesClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, networkProfileName, options) - if err != nil { - return ProfilesClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ProfilesClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ProfilesClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *ProfilesClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkProfileName string, options *ProfilesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkProfiles/{networkProfileName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkProfileName == "" { - return nil, errors.New("parameter networkProfileName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkProfileName}", url.PathEscape(networkProfileName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *ProfilesClient) getHandleResponse(resp *http.Response) (ProfilesClientGetResponse, error) { - result := ProfilesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.Profile); err != nil { - return ProfilesClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Gets all network profiles in a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// options - ProfilesClientListOptions contains the optional parameters for the ProfilesClient.List method. -func (client *ProfilesClient) NewListPager(resourceGroupName string, options *ProfilesClientListOptions) *runtime.Pager[ProfilesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[ProfilesClientListResponse]{ - More: func(page ProfilesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ProfilesClientListResponse) (ProfilesClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return ProfilesClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ProfilesClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ProfilesClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *ProfilesClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *ProfilesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkProfiles" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *ProfilesClient) listHandleResponse(resp *http.Response) (ProfilesClientListResponse, error) { - result := ProfilesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ProfileListResult); err != nil { - return ProfilesClientListResponse{}, err - } - return result, nil -} - -// NewListAllPager - Gets all the network profiles in a subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// options - ProfilesClientListAllOptions contains the optional parameters for the ProfilesClient.ListAll method. -func (client *ProfilesClient) NewListAllPager(options *ProfilesClientListAllOptions) *runtime.Pager[ProfilesClientListAllResponse] { - return runtime.NewPager(runtime.PagingHandler[ProfilesClientListAllResponse]{ - More: func(page ProfilesClientListAllResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ProfilesClientListAllResponse) (ProfilesClientListAllResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listAllCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return ProfilesClientListAllResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ProfilesClientListAllResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ProfilesClientListAllResponse{}, runtime.NewResponseError(resp) - } - return client.listAllHandleResponse(resp) - }, - }) -} - -// listAllCreateRequest creates the ListAll request. -func (client *ProfilesClient) listAllCreateRequest(ctx context.Context, options *ProfilesClientListAllOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkProfiles" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listAllHandleResponse handles the ListAll response. -func (client *ProfilesClient) listAllHandleResponse(resp *http.Response) (ProfilesClientListAllResponse, error) { - result := ProfilesClientListAllResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ProfileListResult); err != nil { - return ProfilesClientListAllResponse{}, err - } - return result, nil -} - -// UpdateTags - Updates network profile tags. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkProfileName - The name of the network profile. -// parameters - Parameters supplied to update network profile tags. -// options - ProfilesClientUpdateTagsOptions contains the optional parameters for the ProfilesClient.UpdateTags method. -func (client *ProfilesClient) UpdateTags(ctx context.Context, resourceGroupName string, networkProfileName string, parameters TagsObject, options *ProfilesClientUpdateTagsOptions) (ProfilesClientUpdateTagsResponse, error) { - req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, networkProfileName, parameters, options) - if err != nil { - return ProfilesClientUpdateTagsResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ProfilesClientUpdateTagsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ProfilesClientUpdateTagsResponse{}, runtime.NewResponseError(resp) - } - return client.updateTagsHandleResponse(resp) -} - -// updateTagsCreateRequest creates the UpdateTags request. -func (client *ProfilesClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, networkProfileName string, parameters TagsObject, options *ProfilesClientUpdateTagsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkProfiles/{networkProfileName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkProfileName == "" { - return nil, errors.New("parameter networkProfileName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkProfileName}", url.PathEscape(networkProfileName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// updateTagsHandleResponse handles the UpdateTags response. -func (client *ProfilesClient) updateTagsHandleResponse(resp *http.Response) (ProfilesClientUpdateTagsResponse, error) { - result := ProfilesClientUpdateTagsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.Profile); err != nil { - return ProfilesClientUpdateTagsResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/publicipaddresses_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/publicipaddresses_client.go deleted file mode 100644 index d8b9246c..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/publicipaddresses_client.go +++ /dev/null @@ -1,902 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// PublicIPAddressesClient contains the methods for the PublicIPAddresses group. -// Don't use this type directly, use NewPublicIPAddressesClient() instead. -type PublicIPAddressesClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewPublicIPAddressesClient creates a new instance of PublicIPAddressesClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewPublicIPAddressesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PublicIPAddressesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &PublicIPAddressesClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates a static or dynamic public IP address. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// publicIPAddressName - The name of the public IP address. -// parameters - Parameters supplied to the create or update public IP address operation. -// options - PublicIPAddressesClientBeginCreateOrUpdateOptions contains the optional parameters for the PublicIPAddressesClient.BeginCreateOrUpdate -// method. -func (client *PublicIPAddressesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, publicIPAddressName string, parameters PublicIPAddress, options *PublicIPAddressesClientBeginCreateOrUpdateOptions) (*runtime.Poller[PublicIPAddressesClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, publicIPAddressName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[PublicIPAddressesClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[PublicIPAddressesClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates or updates a static or dynamic public IP address. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *PublicIPAddressesClient) createOrUpdate(ctx context.Context, resourceGroupName string, publicIPAddressName string, parameters PublicIPAddress, options *PublicIPAddressesClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, publicIPAddressName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *PublicIPAddressesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, publicIPAddressName string, parameters PublicIPAddress, options *PublicIPAddressesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if publicIPAddressName == "" { - return nil, errors.New("parameter publicIPAddressName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{publicIpAddressName}", url.PathEscape(publicIPAddressName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginDelete - Deletes the specified public IP address. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// publicIPAddressName - The name of the public IP address. -// options - PublicIPAddressesClientBeginDeleteOptions contains the optional parameters for the PublicIPAddressesClient.BeginDelete -// method. -func (client *PublicIPAddressesClient) BeginDelete(ctx context.Context, resourceGroupName string, publicIPAddressName string, options *PublicIPAddressesClientBeginDeleteOptions) (*runtime.Poller[PublicIPAddressesClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, publicIPAddressName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[PublicIPAddressesClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[PublicIPAddressesClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes the specified public IP address. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *PublicIPAddressesClient) deleteOperation(ctx context.Context, resourceGroupName string, publicIPAddressName string, options *PublicIPAddressesClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, publicIPAddressName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *PublicIPAddressesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, publicIPAddressName string, options *PublicIPAddressesClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if publicIPAddressName == "" { - return nil, errors.New("parameter publicIPAddressName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{publicIpAddressName}", url.PathEscape(publicIPAddressName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets the specified public IP address in a specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// publicIPAddressName - The name of the public IP address. -// options - PublicIPAddressesClientGetOptions contains the optional parameters for the PublicIPAddressesClient.Get method. -func (client *PublicIPAddressesClient) Get(ctx context.Context, resourceGroupName string, publicIPAddressName string, options *PublicIPAddressesClientGetOptions) (PublicIPAddressesClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, publicIPAddressName, options) - if err != nil { - return PublicIPAddressesClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return PublicIPAddressesClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PublicIPAddressesClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *PublicIPAddressesClient) getCreateRequest(ctx context.Context, resourceGroupName string, publicIPAddressName string, options *PublicIPAddressesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if publicIPAddressName == "" { - return nil, errors.New("parameter publicIPAddressName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{publicIpAddressName}", url.PathEscape(publicIPAddressName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *PublicIPAddressesClient) getHandleResponse(resp *http.Response) (PublicIPAddressesClientGetResponse, error) { - result := PublicIPAddressesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.PublicIPAddress); err != nil { - return PublicIPAddressesClientGetResponse{}, err - } - return result, nil -} - -// GetCloudServicePublicIPAddress - Get the specified public IP address in a cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// cloudServiceName - The name of the cloud service. -// roleInstanceName - The role instance name. -// networkInterfaceName - The name of the network interface. -// ipConfigurationName - The name of the IP configuration. -// publicIPAddressName - The name of the public IP Address. -// options - PublicIPAddressesClientGetCloudServicePublicIPAddressOptions contains the optional parameters for the PublicIPAddressesClient.GetCloudServicePublicIPAddress -// method. -func (client *PublicIPAddressesClient) GetCloudServicePublicIPAddress(ctx context.Context, resourceGroupName string, cloudServiceName string, roleInstanceName string, networkInterfaceName string, ipConfigurationName string, publicIPAddressName string, options *PublicIPAddressesClientGetCloudServicePublicIPAddressOptions) (PublicIPAddressesClientGetCloudServicePublicIPAddressResponse, error) { - req, err := client.getCloudServicePublicIPAddressCreateRequest(ctx, resourceGroupName, cloudServiceName, roleInstanceName, networkInterfaceName, ipConfigurationName, publicIPAddressName, options) - if err != nil { - return PublicIPAddressesClientGetCloudServicePublicIPAddressResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return PublicIPAddressesClientGetCloudServicePublicIPAddressResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PublicIPAddressesClientGetCloudServicePublicIPAddressResponse{}, runtime.NewResponseError(resp) - } - return client.getCloudServicePublicIPAddressHandleResponse(resp) -} - -// getCloudServicePublicIPAddressCreateRequest creates the GetCloudServicePublicIPAddress request. -func (client *PublicIPAddressesClient) getCloudServicePublicIPAddressCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, roleInstanceName string, networkInterfaceName string, ipConfigurationName string, publicIPAddressName string, options *PublicIPAddressesClientGetCloudServicePublicIPAddressOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses/{publicIpAddressName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if roleInstanceName == "" { - return nil, errors.New("parameter roleInstanceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{roleInstanceName}", url.PathEscape(roleInstanceName)) - if networkInterfaceName == "" { - return nil, errors.New("parameter networkInterfaceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkInterfaceName}", url.PathEscape(networkInterfaceName)) - if ipConfigurationName == "" { - return nil, errors.New("parameter ipConfigurationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{ipConfigurationName}", url.PathEscape(ipConfigurationName)) - if publicIPAddressName == "" { - return nil, errors.New("parameter publicIPAddressName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{publicIpAddressName}", url.PathEscape(publicIPAddressName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getCloudServicePublicIPAddressHandleResponse handles the GetCloudServicePublicIPAddress response. -func (client *PublicIPAddressesClient) getCloudServicePublicIPAddressHandleResponse(resp *http.Response) (PublicIPAddressesClientGetCloudServicePublicIPAddressResponse, error) { - result := PublicIPAddressesClientGetCloudServicePublicIPAddressResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.PublicIPAddress); err != nil { - return PublicIPAddressesClientGetCloudServicePublicIPAddressResponse{}, err - } - return result, nil -} - -// GetVirtualMachineScaleSetPublicIPAddress - Get the specified public IP address in a virtual machine scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-10-01 -// resourceGroupName - The name of the resource group. -// virtualMachineScaleSetName - The name of the virtual machine scale set. -// virtualmachineIndex - The virtual machine index. -// networkInterfaceName - The name of the network interface. -// ipConfigurationName - The name of the IP configuration. -// publicIPAddressName - The name of the public IP Address. -// options - PublicIPAddressesClientGetVirtualMachineScaleSetPublicIPAddressOptions contains the optional parameters for the -// PublicIPAddressesClient.GetVirtualMachineScaleSetPublicIPAddress method. -func (client *PublicIPAddressesClient) GetVirtualMachineScaleSetPublicIPAddress(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, ipConfigurationName string, publicIPAddressName string, options *PublicIPAddressesClientGetVirtualMachineScaleSetPublicIPAddressOptions) (PublicIPAddressesClientGetVirtualMachineScaleSetPublicIPAddressResponse, error) { - req, err := client.getVirtualMachineScaleSetPublicIPAddressCreateRequest(ctx, resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, publicIPAddressName, options) - if err != nil { - return PublicIPAddressesClientGetVirtualMachineScaleSetPublicIPAddressResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return PublicIPAddressesClientGetVirtualMachineScaleSetPublicIPAddressResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PublicIPAddressesClientGetVirtualMachineScaleSetPublicIPAddressResponse{}, runtime.NewResponseError(resp) - } - return client.getVirtualMachineScaleSetPublicIPAddressHandleResponse(resp) -} - -// getVirtualMachineScaleSetPublicIPAddressCreateRequest creates the GetVirtualMachineScaleSetPublicIPAddress request. -func (client *PublicIPAddressesClient) getVirtualMachineScaleSetPublicIPAddressCreateRequest(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, ipConfigurationName string, publicIPAddressName string, options *PublicIPAddressesClientGetVirtualMachineScaleSetPublicIPAddressOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses/{publicIpAddressName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualMachineScaleSetName == "" { - return nil, errors.New("parameter virtualMachineScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualMachineScaleSetName}", url.PathEscape(virtualMachineScaleSetName)) - if virtualmachineIndex == "" { - return nil, errors.New("parameter virtualmachineIndex cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualmachineIndex}", url.PathEscape(virtualmachineIndex)) - if networkInterfaceName == "" { - return nil, errors.New("parameter networkInterfaceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkInterfaceName}", url.PathEscape(networkInterfaceName)) - if ipConfigurationName == "" { - return nil, errors.New("parameter ipConfigurationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{ipConfigurationName}", url.PathEscape(ipConfigurationName)) - if publicIPAddressName == "" { - return nil, errors.New("parameter publicIPAddressName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{publicIpAddressName}", url.PathEscape(publicIPAddressName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-10-01") - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getVirtualMachineScaleSetPublicIPAddressHandleResponse handles the GetVirtualMachineScaleSetPublicIPAddress response. -func (client *PublicIPAddressesClient) getVirtualMachineScaleSetPublicIPAddressHandleResponse(resp *http.Response) (PublicIPAddressesClientGetVirtualMachineScaleSetPublicIPAddressResponse, error) { - result := PublicIPAddressesClientGetVirtualMachineScaleSetPublicIPAddressResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.PublicIPAddress); err != nil { - return PublicIPAddressesClientGetVirtualMachineScaleSetPublicIPAddressResponse{}, err - } - return result, nil -} - -// NewListPager - Gets all public IP addresses in a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// options - PublicIPAddressesClientListOptions contains the optional parameters for the PublicIPAddressesClient.List method. -func (client *PublicIPAddressesClient) NewListPager(resourceGroupName string, options *PublicIPAddressesClientListOptions) *runtime.Pager[PublicIPAddressesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[PublicIPAddressesClientListResponse]{ - More: func(page PublicIPAddressesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *PublicIPAddressesClientListResponse) (PublicIPAddressesClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return PublicIPAddressesClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return PublicIPAddressesClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PublicIPAddressesClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *PublicIPAddressesClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *PublicIPAddressesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *PublicIPAddressesClient) listHandleResponse(resp *http.Response) (PublicIPAddressesClientListResponse, error) { - result := PublicIPAddressesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.PublicIPAddressListResult); err != nil { - return PublicIPAddressesClientListResponse{}, err - } - return result, nil -} - -// NewListAllPager - Gets all the public IP addresses in a subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// options - PublicIPAddressesClientListAllOptions contains the optional parameters for the PublicIPAddressesClient.ListAll -// method. -func (client *PublicIPAddressesClient) NewListAllPager(options *PublicIPAddressesClientListAllOptions) *runtime.Pager[PublicIPAddressesClientListAllResponse] { - return runtime.NewPager(runtime.PagingHandler[PublicIPAddressesClientListAllResponse]{ - More: func(page PublicIPAddressesClientListAllResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *PublicIPAddressesClientListAllResponse) (PublicIPAddressesClientListAllResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listAllCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return PublicIPAddressesClientListAllResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return PublicIPAddressesClientListAllResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PublicIPAddressesClientListAllResponse{}, runtime.NewResponseError(resp) - } - return client.listAllHandleResponse(resp) - }, - }) -} - -// listAllCreateRequest creates the ListAll request. -func (client *PublicIPAddressesClient) listAllCreateRequest(ctx context.Context, options *PublicIPAddressesClientListAllOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPAddresses" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listAllHandleResponse handles the ListAll response. -func (client *PublicIPAddressesClient) listAllHandleResponse(resp *http.Response) (PublicIPAddressesClientListAllResponse, error) { - result := PublicIPAddressesClientListAllResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.PublicIPAddressListResult); err != nil { - return PublicIPAddressesClientListAllResponse{}, err - } - return result, nil -} - -// NewListCloudServicePublicIPAddressesPager - Gets information about all public IP addresses on a cloud service level. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// cloudServiceName - The name of the cloud service. -// options - PublicIPAddressesClientListCloudServicePublicIPAddressesOptions contains the optional parameters for the PublicIPAddressesClient.ListCloudServicePublicIPAddresses -// method. -func (client *PublicIPAddressesClient) NewListCloudServicePublicIPAddressesPager(resourceGroupName string, cloudServiceName string, options *PublicIPAddressesClientListCloudServicePublicIPAddressesOptions) *runtime.Pager[PublicIPAddressesClientListCloudServicePublicIPAddressesResponse] { - return runtime.NewPager(runtime.PagingHandler[PublicIPAddressesClientListCloudServicePublicIPAddressesResponse]{ - More: func(page PublicIPAddressesClientListCloudServicePublicIPAddressesResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *PublicIPAddressesClientListCloudServicePublicIPAddressesResponse) (PublicIPAddressesClientListCloudServicePublicIPAddressesResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCloudServicePublicIPAddressesCreateRequest(ctx, resourceGroupName, cloudServiceName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return PublicIPAddressesClientListCloudServicePublicIPAddressesResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return PublicIPAddressesClientListCloudServicePublicIPAddressesResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PublicIPAddressesClientListCloudServicePublicIPAddressesResponse{}, runtime.NewResponseError(resp) - } - return client.listCloudServicePublicIPAddressesHandleResponse(resp) - }, - }) -} - -// listCloudServicePublicIPAddressesCreateRequest creates the ListCloudServicePublicIPAddresses request. -func (client *PublicIPAddressesClient) listCloudServicePublicIPAddressesCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, options *PublicIPAddressesClientListCloudServicePublicIPAddressesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/publicipaddresses" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listCloudServicePublicIPAddressesHandleResponse handles the ListCloudServicePublicIPAddresses response. -func (client *PublicIPAddressesClient) listCloudServicePublicIPAddressesHandleResponse(resp *http.Response) (PublicIPAddressesClientListCloudServicePublicIPAddressesResponse, error) { - result := PublicIPAddressesClientListCloudServicePublicIPAddressesResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.PublicIPAddressListResult); err != nil { - return PublicIPAddressesClientListCloudServicePublicIPAddressesResponse{}, err - } - return result, nil -} - -// NewListCloudServiceRoleInstancePublicIPAddressesPager - Gets information about all public IP addresses in a role instance -// IP configuration in a cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// cloudServiceName - The name of the cloud service. -// roleInstanceName - The name of role instance. -// networkInterfaceName - The network interface name. -// ipConfigurationName - The IP configuration name. -// options - PublicIPAddressesClientListCloudServiceRoleInstancePublicIPAddressesOptions contains the optional parameters -// for the PublicIPAddressesClient.ListCloudServiceRoleInstancePublicIPAddresses method. -func (client *PublicIPAddressesClient) NewListCloudServiceRoleInstancePublicIPAddressesPager(resourceGroupName string, cloudServiceName string, roleInstanceName string, networkInterfaceName string, ipConfigurationName string, options *PublicIPAddressesClientListCloudServiceRoleInstancePublicIPAddressesOptions) *runtime.Pager[PublicIPAddressesClientListCloudServiceRoleInstancePublicIPAddressesResponse] { - return runtime.NewPager(runtime.PagingHandler[PublicIPAddressesClientListCloudServiceRoleInstancePublicIPAddressesResponse]{ - More: func(page PublicIPAddressesClientListCloudServiceRoleInstancePublicIPAddressesResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *PublicIPAddressesClientListCloudServiceRoleInstancePublicIPAddressesResponse) (PublicIPAddressesClientListCloudServiceRoleInstancePublicIPAddressesResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCloudServiceRoleInstancePublicIPAddressesCreateRequest(ctx, resourceGroupName, cloudServiceName, roleInstanceName, networkInterfaceName, ipConfigurationName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return PublicIPAddressesClientListCloudServiceRoleInstancePublicIPAddressesResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return PublicIPAddressesClientListCloudServiceRoleInstancePublicIPAddressesResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PublicIPAddressesClientListCloudServiceRoleInstancePublicIPAddressesResponse{}, runtime.NewResponseError(resp) - } - return client.listCloudServiceRoleInstancePublicIPAddressesHandleResponse(resp) - }, - }) -} - -// listCloudServiceRoleInstancePublicIPAddressesCreateRequest creates the ListCloudServiceRoleInstancePublicIPAddresses request. -func (client *PublicIPAddressesClient) listCloudServiceRoleInstancePublicIPAddressesCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, roleInstanceName string, networkInterfaceName string, ipConfigurationName string, options *PublicIPAddressesClientListCloudServiceRoleInstancePublicIPAddressesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if roleInstanceName == "" { - return nil, errors.New("parameter roleInstanceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{roleInstanceName}", url.PathEscape(roleInstanceName)) - if networkInterfaceName == "" { - return nil, errors.New("parameter networkInterfaceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkInterfaceName}", url.PathEscape(networkInterfaceName)) - if ipConfigurationName == "" { - return nil, errors.New("parameter ipConfigurationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{ipConfigurationName}", url.PathEscape(ipConfigurationName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listCloudServiceRoleInstancePublicIPAddressesHandleResponse handles the ListCloudServiceRoleInstancePublicIPAddresses response. -func (client *PublicIPAddressesClient) listCloudServiceRoleInstancePublicIPAddressesHandleResponse(resp *http.Response) (PublicIPAddressesClientListCloudServiceRoleInstancePublicIPAddressesResponse, error) { - result := PublicIPAddressesClientListCloudServiceRoleInstancePublicIPAddressesResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.PublicIPAddressListResult); err != nil { - return PublicIPAddressesClientListCloudServiceRoleInstancePublicIPAddressesResponse{}, err - } - return result, nil -} - -// NewListVirtualMachineScaleSetPublicIPAddressesPager - Gets information about all public IP addresses on a virtual machine -// scale set level. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-10-01 -// resourceGroupName - The name of the resource group. -// virtualMachineScaleSetName - The name of the virtual machine scale set. -// options - PublicIPAddressesClientListVirtualMachineScaleSetPublicIPAddressesOptions contains the optional parameters for -// the PublicIPAddressesClient.ListVirtualMachineScaleSetPublicIPAddresses method. -func (client *PublicIPAddressesClient) NewListVirtualMachineScaleSetPublicIPAddressesPager(resourceGroupName string, virtualMachineScaleSetName string, options *PublicIPAddressesClientListVirtualMachineScaleSetPublicIPAddressesOptions) *runtime.Pager[PublicIPAddressesClientListVirtualMachineScaleSetPublicIPAddressesResponse] { - return runtime.NewPager(runtime.PagingHandler[PublicIPAddressesClientListVirtualMachineScaleSetPublicIPAddressesResponse]{ - More: func(page PublicIPAddressesClientListVirtualMachineScaleSetPublicIPAddressesResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *PublicIPAddressesClientListVirtualMachineScaleSetPublicIPAddressesResponse) (PublicIPAddressesClientListVirtualMachineScaleSetPublicIPAddressesResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listVirtualMachineScaleSetPublicIPAddressesCreateRequest(ctx, resourceGroupName, virtualMachineScaleSetName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return PublicIPAddressesClientListVirtualMachineScaleSetPublicIPAddressesResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return PublicIPAddressesClientListVirtualMachineScaleSetPublicIPAddressesResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PublicIPAddressesClientListVirtualMachineScaleSetPublicIPAddressesResponse{}, runtime.NewResponseError(resp) - } - return client.listVirtualMachineScaleSetPublicIPAddressesHandleResponse(resp) - }, - }) -} - -// listVirtualMachineScaleSetPublicIPAddressesCreateRequest creates the ListVirtualMachineScaleSetPublicIPAddresses request. -func (client *PublicIPAddressesClient) listVirtualMachineScaleSetPublicIPAddressesCreateRequest(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, options *PublicIPAddressesClientListVirtualMachineScaleSetPublicIPAddressesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/publicipaddresses" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualMachineScaleSetName == "" { - return nil, errors.New("parameter virtualMachineScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualMachineScaleSetName}", url.PathEscape(virtualMachineScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-10-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listVirtualMachineScaleSetPublicIPAddressesHandleResponse handles the ListVirtualMachineScaleSetPublicIPAddresses response. -func (client *PublicIPAddressesClient) listVirtualMachineScaleSetPublicIPAddressesHandleResponse(resp *http.Response) (PublicIPAddressesClientListVirtualMachineScaleSetPublicIPAddressesResponse, error) { - result := PublicIPAddressesClientListVirtualMachineScaleSetPublicIPAddressesResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.PublicIPAddressListResult); err != nil { - return PublicIPAddressesClientListVirtualMachineScaleSetPublicIPAddressesResponse{}, err - } - return result, nil -} - -// NewListVirtualMachineScaleSetVMPublicIPAddressesPager - Gets information about all public IP addresses in a virtual machine -// IP configuration in a virtual machine scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2018-10-01 -// resourceGroupName - The name of the resource group. -// virtualMachineScaleSetName - The name of the virtual machine scale set. -// virtualmachineIndex - The virtual machine index. -// networkInterfaceName - The network interface name. -// ipConfigurationName - The IP configuration name. -// options - PublicIPAddressesClientListVirtualMachineScaleSetVMPublicIPAddressesOptions contains the optional parameters -// for the PublicIPAddressesClient.ListVirtualMachineScaleSetVMPublicIPAddresses method. -func (client *PublicIPAddressesClient) NewListVirtualMachineScaleSetVMPublicIPAddressesPager(resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, ipConfigurationName string, options *PublicIPAddressesClientListVirtualMachineScaleSetVMPublicIPAddressesOptions) *runtime.Pager[PublicIPAddressesClientListVirtualMachineScaleSetVMPublicIPAddressesResponse] { - return runtime.NewPager(runtime.PagingHandler[PublicIPAddressesClientListVirtualMachineScaleSetVMPublicIPAddressesResponse]{ - More: func(page PublicIPAddressesClientListVirtualMachineScaleSetVMPublicIPAddressesResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *PublicIPAddressesClientListVirtualMachineScaleSetVMPublicIPAddressesResponse) (PublicIPAddressesClientListVirtualMachineScaleSetVMPublicIPAddressesResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listVirtualMachineScaleSetVMPublicIPAddressesCreateRequest(ctx, resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return PublicIPAddressesClientListVirtualMachineScaleSetVMPublicIPAddressesResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return PublicIPAddressesClientListVirtualMachineScaleSetVMPublicIPAddressesResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PublicIPAddressesClientListVirtualMachineScaleSetVMPublicIPAddressesResponse{}, runtime.NewResponseError(resp) - } - return client.listVirtualMachineScaleSetVMPublicIPAddressesHandleResponse(resp) - }, - }) -} - -// listVirtualMachineScaleSetVMPublicIPAddressesCreateRequest creates the ListVirtualMachineScaleSetVMPublicIPAddresses request. -func (client *PublicIPAddressesClient) listVirtualMachineScaleSetVMPublicIPAddressesCreateRequest(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, ipConfigurationName string, options *PublicIPAddressesClientListVirtualMachineScaleSetVMPublicIPAddressesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualMachineScaleSetName == "" { - return nil, errors.New("parameter virtualMachineScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualMachineScaleSetName}", url.PathEscape(virtualMachineScaleSetName)) - if virtualmachineIndex == "" { - return nil, errors.New("parameter virtualmachineIndex cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualmachineIndex}", url.PathEscape(virtualmachineIndex)) - if networkInterfaceName == "" { - return nil, errors.New("parameter networkInterfaceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkInterfaceName}", url.PathEscape(networkInterfaceName)) - if ipConfigurationName == "" { - return nil, errors.New("parameter ipConfigurationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{ipConfigurationName}", url.PathEscape(ipConfigurationName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-10-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listVirtualMachineScaleSetVMPublicIPAddressesHandleResponse handles the ListVirtualMachineScaleSetVMPublicIPAddresses response. -func (client *PublicIPAddressesClient) listVirtualMachineScaleSetVMPublicIPAddressesHandleResponse(resp *http.Response) (PublicIPAddressesClientListVirtualMachineScaleSetVMPublicIPAddressesResponse, error) { - result := PublicIPAddressesClientListVirtualMachineScaleSetVMPublicIPAddressesResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.PublicIPAddressListResult); err != nil { - return PublicIPAddressesClientListVirtualMachineScaleSetVMPublicIPAddressesResponse{}, err - } - return result, nil -} - -// UpdateTags - Updates public IP address tags. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// publicIPAddressName - The name of the public IP address. -// parameters - Parameters supplied to update public IP address tags. -// options - PublicIPAddressesClientUpdateTagsOptions contains the optional parameters for the PublicIPAddressesClient.UpdateTags -// method. -func (client *PublicIPAddressesClient) UpdateTags(ctx context.Context, resourceGroupName string, publicIPAddressName string, parameters TagsObject, options *PublicIPAddressesClientUpdateTagsOptions) (PublicIPAddressesClientUpdateTagsResponse, error) { - req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, publicIPAddressName, parameters, options) - if err != nil { - return PublicIPAddressesClientUpdateTagsResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return PublicIPAddressesClientUpdateTagsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PublicIPAddressesClientUpdateTagsResponse{}, runtime.NewResponseError(resp) - } - return client.updateTagsHandleResponse(resp) -} - -// updateTagsCreateRequest creates the UpdateTags request. -func (client *PublicIPAddressesClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, publicIPAddressName string, parameters TagsObject, options *PublicIPAddressesClientUpdateTagsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if publicIPAddressName == "" { - return nil, errors.New("parameter publicIPAddressName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{publicIpAddressName}", url.PathEscape(publicIPAddressName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// updateTagsHandleResponse handles the UpdateTags response. -func (client *PublicIPAddressesClient) updateTagsHandleResponse(resp *http.Response) (PublicIPAddressesClientUpdateTagsResponse, error) { - result := PublicIPAddressesClientUpdateTagsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.PublicIPAddress); err != nil { - return PublicIPAddressesClientUpdateTagsResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/publicipprefixes_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/publicipprefixes_client.go deleted file mode 100644 index 7fde2c8b..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/publicipprefixes_client.go +++ /dev/null @@ -1,429 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// PublicIPPrefixesClient contains the methods for the PublicIPPrefixes group. -// Don't use this type directly, use NewPublicIPPrefixesClient() instead. -type PublicIPPrefixesClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewPublicIPPrefixesClient creates a new instance of PublicIPPrefixesClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewPublicIPPrefixesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PublicIPPrefixesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &PublicIPPrefixesClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates a static or dynamic public IP prefix. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// publicIPPrefixName - The name of the public IP prefix. -// parameters - Parameters supplied to the create or update public IP prefix operation. -// options - PublicIPPrefixesClientBeginCreateOrUpdateOptions contains the optional parameters for the PublicIPPrefixesClient.BeginCreateOrUpdate -// method. -func (client *PublicIPPrefixesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, publicIPPrefixName string, parameters PublicIPPrefix, options *PublicIPPrefixesClientBeginCreateOrUpdateOptions) (*runtime.Poller[PublicIPPrefixesClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, publicIPPrefixName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[PublicIPPrefixesClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[PublicIPPrefixesClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates or updates a static or dynamic public IP prefix. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *PublicIPPrefixesClient) createOrUpdate(ctx context.Context, resourceGroupName string, publicIPPrefixName string, parameters PublicIPPrefix, options *PublicIPPrefixesClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, publicIPPrefixName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *PublicIPPrefixesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, publicIPPrefixName string, parameters PublicIPPrefix, options *PublicIPPrefixesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if publicIPPrefixName == "" { - return nil, errors.New("parameter publicIPPrefixName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{publicIpPrefixName}", url.PathEscape(publicIPPrefixName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginDelete - Deletes the specified public IP prefix. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// publicIPPrefixName - The name of the PublicIpPrefix. -// options - PublicIPPrefixesClientBeginDeleteOptions contains the optional parameters for the PublicIPPrefixesClient.BeginDelete -// method. -func (client *PublicIPPrefixesClient) BeginDelete(ctx context.Context, resourceGroupName string, publicIPPrefixName string, options *PublicIPPrefixesClientBeginDeleteOptions) (*runtime.Poller[PublicIPPrefixesClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, publicIPPrefixName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[PublicIPPrefixesClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[PublicIPPrefixesClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes the specified public IP prefix. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *PublicIPPrefixesClient) deleteOperation(ctx context.Context, resourceGroupName string, publicIPPrefixName string, options *PublicIPPrefixesClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, publicIPPrefixName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *PublicIPPrefixesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, publicIPPrefixName string, options *PublicIPPrefixesClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if publicIPPrefixName == "" { - return nil, errors.New("parameter publicIPPrefixName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{publicIpPrefixName}", url.PathEscape(publicIPPrefixName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets the specified public IP prefix in a specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// publicIPPrefixName - The name of the public IP prefix. -// options - PublicIPPrefixesClientGetOptions contains the optional parameters for the PublicIPPrefixesClient.Get method. -func (client *PublicIPPrefixesClient) Get(ctx context.Context, resourceGroupName string, publicIPPrefixName string, options *PublicIPPrefixesClientGetOptions) (PublicIPPrefixesClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, publicIPPrefixName, options) - if err != nil { - return PublicIPPrefixesClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return PublicIPPrefixesClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PublicIPPrefixesClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *PublicIPPrefixesClient) getCreateRequest(ctx context.Context, resourceGroupName string, publicIPPrefixName string, options *PublicIPPrefixesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if publicIPPrefixName == "" { - return nil, errors.New("parameter publicIPPrefixName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{publicIpPrefixName}", url.PathEscape(publicIPPrefixName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *PublicIPPrefixesClient) getHandleResponse(resp *http.Response) (PublicIPPrefixesClientGetResponse, error) { - result := PublicIPPrefixesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.PublicIPPrefix); err != nil { - return PublicIPPrefixesClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Gets all public IP prefixes in a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// options - PublicIPPrefixesClientListOptions contains the optional parameters for the PublicIPPrefixesClient.List method. -func (client *PublicIPPrefixesClient) NewListPager(resourceGroupName string, options *PublicIPPrefixesClientListOptions) *runtime.Pager[PublicIPPrefixesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[PublicIPPrefixesClientListResponse]{ - More: func(page PublicIPPrefixesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *PublicIPPrefixesClientListResponse) (PublicIPPrefixesClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return PublicIPPrefixesClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return PublicIPPrefixesClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PublicIPPrefixesClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *PublicIPPrefixesClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *PublicIPPrefixesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *PublicIPPrefixesClient) listHandleResponse(resp *http.Response) (PublicIPPrefixesClientListResponse, error) { - result := PublicIPPrefixesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.PublicIPPrefixListResult); err != nil { - return PublicIPPrefixesClientListResponse{}, err - } - return result, nil -} - -// NewListAllPager - Gets all the public IP prefixes in a subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// options - PublicIPPrefixesClientListAllOptions contains the optional parameters for the PublicIPPrefixesClient.ListAll -// method. -func (client *PublicIPPrefixesClient) NewListAllPager(options *PublicIPPrefixesClientListAllOptions) *runtime.Pager[PublicIPPrefixesClientListAllResponse] { - return runtime.NewPager(runtime.PagingHandler[PublicIPPrefixesClientListAllResponse]{ - More: func(page PublicIPPrefixesClientListAllResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *PublicIPPrefixesClientListAllResponse) (PublicIPPrefixesClientListAllResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listAllCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return PublicIPPrefixesClientListAllResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return PublicIPPrefixesClientListAllResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PublicIPPrefixesClientListAllResponse{}, runtime.NewResponseError(resp) - } - return client.listAllHandleResponse(resp) - }, - }) -} - -// listAllCreateRequest creates the ListAll request. -func (client *PublicIPPrefixesClient) listAllCreateRequest(ctx context.Context, options *PublicIPPrefixesClientListAllOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPPrefixes" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listAllHandleResponse handles the ListAll response. -func (client *PublicIPPrefixesClient) listAllHandleResponse(resp *http.Response) (PublicIPPrefixesClientListAllResponse, error) { - result := PublicIPPrefixesClientListAllResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.PublicIPPrefixListResult); err != nil { - return PublicIPPrefixesClientListAllResponse{}, err - } - return result, nil -} - -// UpdateTags - Updates public IP prefix tags. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// publicIPPrefixName - The name of the public IP prefix. -// parameters - Parameters supplied to update public IP prefix tags. -// options - PublicIPPrefixesClientUpdateTagsOptions contains the optional parameters for the PublicIPPrefixesClient.UpdateTags -// method. -func (client *PublicIPPrefixesClient) UpdateTags(ctx context.Context, resourceGroupName string, publicIPPrefixName string, parameters TagsObject, options *PublicIPPrefixesClientUpdateTagsOptions) (PublicIPPrefixesClientUpdateTagsResponse, error) { - req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, publicIPPrefixName, parameters, options) - if err != nil { - return PublicIPPrefixesClientUpdateTagsResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return PublicIPPrefixesClientUpdateTagsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PublicIPPrefixesClientUpdateTagsResponse{}, runtime.NewResponseError(resp) - } - return client.updateTagsHandleResponse(resp) -} - -// updateTagsCreateRequest creates the UpdateTags request. -func (client *PublicIPPrefixesClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, publicIPPrefixName string, parameters TagsObject, options *PublicIPPrefixesClientUpdateTagsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if publicIPPrefixName == "" { - return nil, errors.New("parameter publicIPPrefixName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{publicIpPrefixName}", url.PathEscape(publicIPPrefixName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// updateTagsHandleResponse handles the UpdateTags response. -func (client *PublicIPPrefixesClient) updateTagsHandleResponse(resp *http.Response) (PublicIPPrefixesClientUpdateTagsResponse, error) { - result := PublicIPPrefixesClientUpdateTagsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.PublicIPPrefix); err != nil { - return PublicIPPrefixesClientUpdateTagsResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/resourcenavigationlinks_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/resourcenavigationlinks_client.go deleted file mode 100644 index ab023b92..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/resourcenavigationlinks_client.go +++ /dev/null @@ -1,119 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// ResourceNavigationLinksClient contains the methods for the ResourceNavigationLinks group. -// Don't use this type directly, use NewResourceNavigationLinksClient() instead. -type ResourceNavigationLinksClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewResourceNavigationLinksClient creates a new instance of ResourceNavigationLinksClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewResourceNavigationLinksClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ResourceNavigationLinksClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &ResourceNavigationLinksClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// List - Gets a list of resource navigation links for a subnet. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// virtualNetworkName - The name of the virtual network. -// subnetName - The name of the subnet. -// options - ResourceNavigationLinksClientListOptions contains the optional parameters for the ResourceNavigationLinksClient.List -// method. -func (client *ResourceNavigationLinksClient) List(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, options *ResourceNavigationLinksClientListOptions) (ResourceNavigationLinksClientListResponse, error) { - req, err := client.listCreateRequest(ctx, resourceGroupName, virtualNetworkName, subnetName, options) - if err != nil { - return ResourceNavigationLinksClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ResourceNavigationLinksClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ResourceNavigationLinksClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) -} - -// listCreateRequest creates the List request. -func (client *ResourceNavigationLinksClient) listCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, options *ResourceNavigationLinksClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/ResourceNavigationLinks" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualNetworkName == "" { - return nil, errors.New("parameter virtualNetworkName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkName}", url.PathEscape(virtualNetworkName)) - if subnetName == "" { - return nil, errors.New("parameter subnetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subnetName}", url.PathEscape(subnetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *ResourceNavigationLinksClient) listHandleResponse(resp *http.Response) (ResourceNavigationLinksClientListResponse, error) { - result := ResourceNavigationLinksClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ResourceNavigationLinksListResult); err != nil { - return ResourceNavigationLinksClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/response_types.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/response_types.go deleted file mode 100644 index 5faa4e56..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/response_types.go +++ /dev/null @@ -1,3102 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import "encoding/json" - -// AdminRuleCollectionsClientCreateOrUpdateResponse contains the response from method AdminRuleCollectionsClient.CreateOrUpdate. -type AdminRuleCollectionsClientCreateOrUpdateResponse struct { - AdminRuleCollection -} - -// AdminRuleCollectionsClientDeleteResponse contains the response from method AdminRuleCollectionsClient.Delete. -type AdminRuleCollectionsClientDeleteResponse struct { - // placeholder for future response values -} - -// AdminRuleCollectionsClientGetResponse contains the response from method AdminRuleCollectionsClient.Get. -type AdminRuleCollectionsClientGetResponse struct { - AdminRuleCollection -} - -// AdminRuleCollectionsClientListResponse contains the response from method AdminRuleCollectionsClient.List. -type AdminRuleCollectionsClientListResponse struct { - AdminRuleCollectionListResult -} - -// AdminRulesClientCreateOrUpdateResponse contains the response from method AdminRulesClient.CreateOrUpdate. -type AdminRulesClientCreateOrUpdateResponse struct { - BaseAdminRuleClassification -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AdminRulesClientCreateOrUpdateResponse. -func (a *AdminRulesClientCreateOrUpdateResponse) UnmarshalJSON(data []byte) error { - res, err := unmarshalBaseAdminRuleClassification(data) - if err != nil { - return err - } - a.BaseAdminRuleClassification = res - return nil -} - -// AdminRulesClientDeleteResponse contains the response from method AdminRulesClient.Delete. -type AdminRulesClientDeleteResponse struct { - // placeholder for future response values -} - -// AdminRulesClientGetResponse contains the response from method AdminRulesClient.Get. -type AdminRulesClientGetResponse struct { - BaseAdminRuleClassification -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AdminRulesClientGetResponse. -func (a *AdminRulesClientGetResponse) UnmarshalJSON(data []byte) error { - res, err := unmarshalBaseAdminRuleClassification(data) - if err != nil { - return err - } - a.BaseAdminRuleClassification = res - return nil -} - -// AdminRulesClientListResponse contains the response from method AdminRulesClient.List. -type AdminRulesClientListResponse struct { - AdminRuleListResult -} - -// ApplicationGatewayPrivateEndpointConnectionsClientDeleteResponse contains the response from method ApplicationGatewayPrivateEndpointConnectionsClient.Delete. -type ApplicationGatewayPrivateEndpointConnectionsClientDeleteResponse struct { - // placeholder for future response values -} - -// ApplicationGatewayPrivateEndpointConnectionsClientGetResponse contains the response from method ApplicationGatewayPrivateEndpointConnectionsClient.Get. -type ApplicationGatewayPrivateEndpointConnectionsClientGetResponse struct { - ApplicationGatewayPrivateEndpointConnection -} - -// ApplicationGatewayPrivateEndpointConnectionsClientListResponse contains the response from method ApplicationGatewayPrivateEndpointConnectionsClient.List. -type ApplicationGatewayPrivateEndpointConnectionsClientListResponse struct { - ApplicationGatewayPrivateEndpointConnectionListResult -} - -// ApplicationGatewayPrivateEndpointConnectionsClientUpdateResponse contains the response from method ApplicationGatewayPrivateEndpointConnectionsClient.Update. -type ApplicationGatewayPrivateEndpointConnectionsClientUpdateResponse struct { - ApplicationGatewayPrivateEndpointConnection -} - -// ApplicationGatewayPrivateLinkResourcesClientListResponse contains the response from method ApplicationGatewayPrivateLinkResourcesClient.List. -type ApplicationGatewayPrivateLinkResourcesClientListResponse struct { - ApplicationGatewayPrivateLinkResourceListResult -} - -// ApplicationGatewaysClientBackendHealthOnDemandResponse contains the response from method ApplicationGatewaysClient.BackendHealthOnDemand. -type ApplicationGatewaysClientBackendHealthOnDemandResponse struct { - ApplicationGatewayBackendHealthOnDemand -} - -// ApplicationGatewaysClientBackendHealthResponse contains the response from method ApplicationGatewaysClient.BackendHealth. -type ApplicationGatewaysClientBackendHealthResponse struct { - ApplicationGatewayBackendHealth -} - -// ApplicationGatewaysClientCreateOrUpdateResponse contains the response from method ApplicationGatewaysClient.CreateOrUpdate. -type ApplicationGatewaysClientCreateOrUpdateResponse struct { - ApplicationGateway -} - -// ApplicationGatewaysClientDeleteResponse contains the response from method ApplicationGatewaysClient.Delete. -type ApplicationGatewaysClientDeleteResponse struct { - // placeholder for future response values -} - -// ApplicationGatewaysClientGetResponse contains the response from method ApplicationGatewaysClient.Get. -type ApplicationGatewaysClientGetResponse struct { - ApplicationGateway -} - -// ApplicationGatewaysClientGetSSLPredefinedPolicyResponse contains the response from method ApplicationGatewaysClient.GetSSLPredefinedPolicy. -type ApplicationGatewaysClientGetSSLPredefinedPolicyResponse struct { - ApplicationGatewaySSLPredefinedPolicy -} - -// ApplicationGatewaysClientListAllResponse contains the response from method ApplicationGatewaysClient.ListAll. -type ApplicationGatewaysClientListAllResponse struct { - ApplicationGatewayListResult -} - -// ApplicationGatewaysClientListAvailableRequestHeadersResponse contains the response from method ApplicationGatewaysClient.ListAvailableRequestHeaders. -type ApplicationGatewaysClientListAvailableRequestHeadersResponse struct { - // Response for ApplicationGatewayAvailableRequestHeaders API service call. - StringArray []*string -} - -// ApplicationGatewaysClientListAvailableResponseHeadersResponse contains the response from method ApplicationGatewaysClient.ListAvailableResponseHeaders. -type ApplicationGatewaysClientListAvailableResponseHeadersResponse struct { - // Response for ApplicationGatewayAvailableResponseHeaders API service call. - StringArray []*string -} - -// ApplicationGatewaysClientListAvailableSSLOptionsResponse contains the response from method ApplicationGatewaysClient.ListAvailableSSLOptions. -type ApplicationGatewaysClientListAvailableSSLOptionsResponse struct { - ApplicationGatewayAvailableSSLOptions -} - -// ApplicationGatewaysClientListAvailableSSLPredefinedPoliciesResponse contains the response from method ApplicationGatewaysClient.ListAvailableSSLPredefinedPolicies. -type ApplicationGatewaysClientListAvailableSSLPredefinedPoliciesResponse struct { - ApplicationGatewayAvailableSSLPredefinedPolicies -} - -// ApplicationGatewaysClientListAvailableServerVariablesResponse contains the response from method ApplicationGatewaysClient.ListAvailableServerVariables. -type ApplicationGatewaysClientListAvailableServerVariablesResponse struct { - // Response for ApplicationGatewayAvailableServerVariables API service call. - StringArray []*string -} - -// ApplicationGatewaysClientListAvailableWafRuleSetsResponse contains the response from method ApplicationGatewaysClient.ListAvailableWafRuleSets. -type ApplicationGatewaysClientListAvailableWafRuleSetsResponse struct { - ApplicationGatewayAvailableWafRuleSetsResult -} - -// ApplicationGatewaysClientListResponse contains the response from method ApplicationGatewaysClient.List. -type ApplicationGatewaysClientListResponse struct { - ApplicationGatewayListResult -} - -// ApplicationGatewaysClientStartResponse contains the response from method ApplicationGatewaysClient.Start. -type ApplicationGatewaysClientStartResponse struct { - // placeholder for future response values -} - -// ApplicationGatewaysClientStopResponse contains the response from method ApplicationGatewaysClient.Stop. -type ApplicationGatewaysClientStopResponse struct { - // placeholder for future response values -} - -// ApplicationGatewaysClientUpdateTagsResponse contains the response from method ApplicationGatewaysClient.UpdateTags. -type ApplicationGatewaysClientUpdateTagsResponse struct { - ApplicationGateway -} - -// ApplicationSecurityGroupsClientCreateOrUpdateResponse contains the response from method ApplicationSecurityGroupsClient.CreateOrUpdate. -type ApplicationSecurityGroupsClientCreateOrUpdateResponse struct { - ApplicationSecurityGroup -} - -// ApplicationSecurityGroupsClientDeleteResponse contains the response from method ApplicationSecurityGroupsClient.Delete. -type ApplicationSecurityGroupsClientDeleteResponse struct { - // placeholder for future response values -} - -// ApplicationSecurityGroupsClientGetResponse contains the response from method ApplicationSecurityGroupsClient.Get. -type ApplicationSecurityGroupsClientGetResponse struct { - ApplicationSecurityGroup -} - -// ApplicationSecurityGroupsClientListAllResponse contains the response from method ApplicationSecurityGroupsClient.ListAll. -type ApplicationSecurityGroupsClientListAllResponse struct { - ApplicationSecurityGroupListResult -} - -// ApplicationSecurityGroupsClientListResponse contains the response from method ApplicationSecurityGroupsClient.List. -type ApplicationSecurityGroupsClientListResponse struct { - ApplicationSecurityGroupListResult -} - -// ApplicationSecurityGroupsClientUpdateTagsResponse contains the response from method ApplicationSecurityGroupsClient.UpdateTags. -type ApplicationSecurityGroupsClientUpdateTagsResponse struct { - ApplicationSecurityGroup -} - -// AvailableDelegationsClientListResponse contains the response from method AvailableDelegationsClient.List. -type AvailableDelegationsClientListResponse struct { - AvailableDelegationsResult -} - -// AvailableEndpointServicesClientListResponse contains the response from method AvailableEndpointServicesClient.List. -type AvailableEndpointServicesClientListResponse struct { - EndpointServicesListResult -} - -// AvailablePrivateEndpointTypesClientListByResourceGroupResponse contains the response from method AvailablePrivateEndpointTypesClient.ListByResourceGroup. -type AvailablePrivateEndpointTypesClientListByResourceGroupResponse struct { - AvailablePrivateEndpointTypesResult -} - -// AvailablePrivateEndpointTypesClientListResponse contains the response from method AvailablePrivateEndpointTypesClient.List. -type AvailablePrivateEndpointTypesClientListResponse struct { - AvailablePrivateEndpointTypesResult -} - -// AvailableResourceGroupDelegationsClientListResponse contains the response from method AvailableResourceGroupDelegationsClient.List. -type AvailableResourceGroupDelegationsClientListResponse struct { - AvailableDelegationsResult -} - -// AvailableServiceAliasesClientListByResourceGroupResponse contains the response from method AvailableServiceAliasesClient.ListByResourceGroup. -type AvailableServiceAliasesClientListByResourceGroupResponse struct { - AvailableServiceAliasesResult -} - -// AvailableServiceAliasesClientListResponse contains the response from method AvailableServiceAliasesClient.List. -type AvailableServiceAliasesClientListResponse struct { - AvailableServiceAliasesResult -} - -// AzureFirewallFqdnTagsClientListAllResponse contains the response from method AzureFirewallFqdnTagsClient.ListAll. -type AzureFirewallFqdnTagsClientListAllResponse struct { - AzureFirewallFqdnTagListResult -} - -// AzureFirewallsClientCreateOrUpdateResponse contains the response from method AzureFirewallsClient.CreateOrUpdate. -type AzureFirewallsClientCreateOrUpdateResponse struct { - AzureFirewall -} - -// AzureFirewallsClientDeleteResponse contains the response from method AzureFirewallsClient.Delete. -type AzureFirewallsClientDeleteResponse struct { - // placeholder for future response values -} - -// AzureFirewallsClientGetResponse contains the response from method AzureFirewallsClient.Get. -type AzureFirewallsClientGetResponse struct { - AzureFirewall -} - -// AzureFirewallsClientListAllResponse contains the response from method AzureFirewallsClient.ListAll. -type AzureFirewallsClientListAllResponse struct { - AzureFirewallListResult -} - -// AzureFirewallsClientListLearnedPrefixesResponse contains the response from method AzureFirewallsClient.ListLearnedPrefixes. -type AzureFirewallsClientListLearnedPrefixesResponse struct { - IPPrefixesList -} - -// AzureFirewallsClientListResponse contains the response from method AzureFirewallsClient.List. -type AzureFirewallsClientListResponse struct { - AzureFirewallListResult -} - -// AzureFirewallsClientUpdateTagsResponse contains the response from method AzureFirewallsClient.UpdateTags. -type AzureFirewallsClientUpdateTagsResponse struct { - AzureFirewall -} - -// BastionHostsClientCreateOrUpdateResponse contains the response from method BastionHostsClient.CreateOrUpdate. -type BastionHostsClientCreateOrUpdateResponse struct { - BastionHost -} - -// BastionHostsClientDeleteResponse contains the response from method BastionHostsClient.Delete. -type BastionHostsClientDeleteResponse struct { - // placeholder for future response values -} - -// BastionHostsClientGetResponse contains the response from method BastionHostsClient.Get. -type BastionHostsClientGetResponse struct { - BastionHost -} - -// BastionHostsClientListByResourceGroupResponse contains the response from method BastionHostsClient.ListByResourceGroup. -type BastionHostsClientListByResourceGroupResponse struct { - BastionHostListResult -} - -// BastionHostsClientListResponse contains the response from method BastionHostsClient.List. -type BastionHostsClientListResponse struct { - BastionHostListResult -} - -// BastionHostsClientUpdateTagsResponse contains the response from method BastionHostsClient.UpdateTags. -type BastionHostsClientUpdateTagsResponse struct { - BastionHost -} - -// BgpServiceCommunitiesClientListResponse contains the response from method BgpServiceCommunitiesClient.List. -type BgpServiceCommunitiesClientListResponse struct { - BgpServiceCommunityListResult -} - -// ConfigurationPolicyGroupsClientCreateOrUpdateResponse contains the response from method ConfigurationPolicyGroupsClient.CreateOrUpdate. -type ConfigurationPolicyGroupsClientCreateOrUpdateResponse struct { - VPNServerConfigurationPolicyGroup -} - -// ConfigurationPolicyGroupsClientDeleteResponse contains the response from method ConfigurationPolicyGroupsClient.Delete. -type ConfigurationPolicyGroupsClientDeleteResponse struct { - // placeholder for future response values -} - -// ConfigurationPolicyGroupsClientGetResponse contains the response from method ConfigurationPolicyGroupsClient.Get. -type ConfigurationPolicyGroupsClientGetResponse struct { - VPNServerConfigurationPolicyGroup -} - -// ConfigurationPolicyGroupsClientListByVPNServerConfigurationResponse contains the response from method ConfigurationPolicyGroupsClient.ListByVPNServerConfiguration. -type ConfigurationPolicyGroupsClientListByVPNServerConfigurationResponse struct { - ListVPNServerConfigurationPolicyGroupsResult -} - -// ConnectionMonitorsClientCreateOrUpdateResponse contains the response from method ConnectionMonitorsClient.CreateOrUpdate. -type ConnectionMonitorsClientCreateOrUpdateResponse struct { - ConnectionMonitorResult -} - -// ConnectionMonitorsClientDeleteResponse contains the response from method ConnectionMonitorsClient.Delete. -type ConnectionMonitorsClientDeleteResponse struct { - // placeholder for future response values -} - -// ConnectionMonitorsClientGetResponse contains the response from method ConnectionMonitorsClient.Get. -type ConnectionMonitorsClientGetResponse struct { - ConnectionMonitorResult -} - -// ConnectionMonitorsClientListResponse contains the response from method ConnectionMonitorsClient.List. -type ConnectionMonitorsClientListResponse struct { - ConnectionMonitorListResult -} - -// ConnectionMonitorsClientQueryResponse contains the response from method ConnectionMonitorsClient.Query. -type ConnectionMonitorsClientQueryResponse struct { - ConnectionMonitorQueryResult -} - -// ConnectionMonitorsClientStartResponse contains the response from method ConnectionMonitorsClient.Start. -type ConnectionMonitorsClientStartResponse struct { - // placeholder for future response values -} - -// ConnectionMonitorsClientStopResponse contains the response from method ConnectionMonitorsClient.Stop. -type ConnectionMonitorsClientStopResponse struct { - // placeholder for future response values -} - -// ConnectionMonitorsClientUpdateTagsResponse contains the response from method ConnectionMonitorsClient.UpdateTags. -type ConnectionMonitorsClientUpdateTagsResponse struct { - ConnectionMonitorResult -} - -// ConnectivityConfigurationsClientCreateOrUpdateResponse contains the response from method ConnectivityConfigurationsClient.CreateOrUpdate. -type ConnectivityConfigurationsClientCreateOrUpdateResponse struct { - ConnectivityConfiguration -} - -// ConnectivityConfigurationsClientDeleteResponse contains the response from method ConnectivityConfigurationsClient.Delete. -type ConnectivityConfigurationsClientDeleteResponse struct { - // placeholder for future response values -} - -// ConnectivityConfigurationsClientGetResponse contains the response from method ConnectivityConfigurationsClient.Get. -type ConnectivityConfigurationsClientGetResponse struct { - ConnectivityConfiguration -} - -// ConnectivityConfigurationsClientListResponse contains the response from method ConnectivityConfigurationsClient.List. -type ConnectivityConfigurationsClientListResponse struct { - ConnectivityConfigurationListResult -} - -// CustomIPPrefixesClientCreateOrUpdateResponse contains the response from method CustomIPPrefixesClient.CreateOrUpdate. -type CustomIPPrefixesClientCreateOrUpdateResponse struct { - CustomIPPrefix -} - -// CustomIPPrefixesClientDeleteResponse contains the response from method CustomIPPrefixesClient.Delete. -type CustomIPPrefixesClientDeleteResponse struct { - // placeholder for future response values -} - -// CustomIPPrefixesClientGetResponse contains the response from method CustomIPPrefixesClient.Get. -type CustomIPPrefixesClientGetResponse struct { - CustomIPPrefix -} - -// CustomIPPrefixesClientListAllResponse contains the response from method CustomIPPrefixesClient.ListAll. -type CustomIPPrefixesClientListAllResponse struct { - CustomIPPrefixListResult -} - -// CustomIPPrefixesClientListResponse contains the response from method CustomIPPrefixesClient.List. -type CustomIPPrefixesClientListResponse struct { - CustomIPPrefixListResult -} - -// CustomIPPrefixesClientUpdateTagsResponse contains the response from method CustomIPPrefixesClient.UpdateTags. -type CustomIPPrefixesClientUpdateTagsResponse struct { - CustomIPPrefix -} - -// DdosCustomPoliciesClientCreateOrUpdateResponse contains the response from method DdosCustomPoliciesClient.CreateOrUpdate. -type DdosCustomPoliciesClientCreateOrUpdateResponse struct { - DdosCustomPolicy -} - -// DdosCustomPoliciesClientDeleteResponse contains the response from method DdosCustomPoliciesClient.Delete. -type DdosCustomPoliciesClientDeleteResponse struct { - // placeholder for future response values -} - -// DdosCustomPoliciesClientGetResponse contains the response from method DdosCustomPoliciesClient.Get. -type DdosCustomPoliciesClientGetResponse struct { - DdosCustomPolicy -} - -// DdosCustomPoliciesClientUpdateTagsResponse contains the response from method DdosCustomPoliciesClient.UpdateTags. -type DdosCustomPoliciesClientUpdateTagsResponse struct { - DdosCustomPolicy -} - -// DdosProtectionPlansClientCreateOrUpdateResponse contains the response from method DdosProtectionPlansClient.CreateOrUpdate. -type DdosProtectionPlansClientCreateOrUpdateResponse struct { - DdosProtectionPlan -} - -// DdosProtectionPlansClientDeleteResponse contains the response from method DdosProtectionPlansClient.Delete. -type DdosProtectionPlansClientDeleteResponse struct { - // placeholder for future response values -} - -// DdosProtectionPlansClientGetResponse contains the response from method DdosProtectionPlansClient.Get. -type DdosProtectionPlansClientGetResponse struct { - DdosProtectionPlan -} - -// DdosProtectionPlansClientListByResourceGroupResponse contains the response from method DdosProtectionPlansClient.ListByResourceGroup. -type DdosProtectionPlansClientListByResourceGroupResponse struct { - DdosProtectionPlanListResult -} - -// DdosProtectionPlansClientListResponse contains the response from method DdosProtectionPlansClient.List. -type DdosProtectionPlansClientListResponse struct { - DdosProtectionPlanListResult -} - -// DdosProtectionPlansClientUpdateTagsResponse contains the response from method DdosProtectionPlansClient.UpdateTags. -type DdosProtectionPlansClientUpdateTagsResponse struct { - DdosProtectionPlan -} - -// DefaultSecurityRulesClientGetResponse contains the response from method DefaultSecurityRulesClient.Get. -type DefaultSecurityRulesClientGetResponse struct { - SecurityRule -} - -// DefaultSecurityRulesClientListResponse contains the response from method DefaultSecurityRulesClient.List. -type DefaultSecurityRulesClientListResponse struct { - SecurityRuleListResult -} - -// DscpConfigurationClientCreateOrUpdateResponse contains the response from method DscpConfigurationClient.CreateOrUpdate. -type DscpConfigurationClientCreateOrUpdateResponse struct { - DscpConfiguration -} - -// DscpConfigurationClientDeleteResponse contains the response from method DscpConfigurationClient.Delete. -type DscpConfigurationClientDeleteResponse struct { - // placeholder for future response values -} - -// DscpConfigurationClientGetResponse contains the response from method DscpConfigurationClient.Get. -type DscpConfigurationClientGetResponse struct { - DscpConfiguration -} - -// DscpConfigurationClientListAllResponse contains the response from method DscpConfigurationClient.ListAll. -type DscpConfigurationClientListAllResponse struct { - DscpConfigurationListResult -} - -// DscpConfigurationClientListResponse contains the response from method DscpConfigurationClient.List. -type DscpConfigurationClientListResponse struct { - DscpConfigurationListResult -} - -// ExpressRouteCircuitAuthorizationsClientCreateOrUpdateResponse contains the response from method ExpressRouteCircuitAuthorizationsClient.CreateOrUpdate. -type ExpressRouteCircuitAuthorizationsClientCreateOrUpdateResponse struct { - ExpressRouteCircuitAuthorization -} - -// ExpressRouteCircuitAuthorizationsClientDeleteResponse contains the response from method ExpressRouteCircuitAuthorizationsClient.Delete. -type ExpressRouteCircuitAuthorizationsClientDeleteResponse struct { - // placeholder for future response values -} - -// ExpressRouteCircuitAuthorizationsClientGetResponse contains the response from method ExpressRouteCircuitAuthorizationsClient.Get. -type ExpressRouteCircuitAuthorizationsClientGetResponse struct { - ExpressRouteCircuitAuthorization -} - -// ExpressRouteCircuitAuthorizationsClientListResponse contains the response from method ExpressRouteCircuitAuthorizationsClient.List. -type ExpressRouteCircuitAuthorizationsClientListResponse struct { - AuthorizationListResult -} - -// ExpressRouteCircuitConnectionsClientCreateOrUpdateResponse contains the response from method ExpressRouteCircuitConnectionsClient.CreateOrUpdate. -type ExpressRouteCircuitConnectionsClientCreateOrUpdateResponse struct { - ExpressRouteCircuitConnection -} - -// ExpressRouteCircuitConnectionsClientDeleteResponse contains the response from method ExpressRouteCircuitConnectionsClient.Delete. -type ExpressRouteCircuitConnectionsClientDeleteResponse struct { - // placeholder for future response values -} - -// ExpressRouteCircuitConnectionsClientGetResponse contains the response from method ExpressRouteCircuitConnectionsClient.Get. -type ExpressRouteCircuitConnectionsClientGetResponse struct { - ExpressRouteCircuitConnection -} - -// ExpressRouteCircuitConnectionsClientListResponse contains the response from method ExpressRouteCircuitConnectionsClient.List. -type ExpressRouteCircuitConnectionsClientListResponse struct { - ExpressRouteCircuitConnectionListResult -} - -// ExpressRouteCircuitPeeringsClientCreateOrUpdateResponse contains the response from method ExpressRouteCircuitPeeringsClient.CreateOrUpdate. -type ExpressRouteCircuitPeeringsClientCreateOrUpdateResponse struct { - ExpressRouteCircuitPeering -} - -// ExpressRouteCircuitPeeringsClientDeleteResponse contains the response from method ExpressRouteCircuitPeeringsClient.Delete. -type ExpressRouteCircuitPeeringsClientDeleteResponse struct { - // placeholder for future response values -} - -// ExpressRouteCircuitPeeringsClientGetResponse contains the response from method ExpressRouteCircuitPeeringsClient.Get. -type ExpressRouteCircuitPeeringsClientGetResponse struct { - ExpressRouteCircuitPeering -} - -// ExpressRouteCircuitPeeringsClientListResponse contains the response from method ExpressRouteCircuitPeeringsClient.List. -type ExpressRouteCircuitPeeringsClientListResponse struct { - ExpressRouteCircuitPeeringListResult -} - -// ExpressRouteCircuitsClientCreateOrUpdateResponse contains the response from method ExpressRouteCircuitsClient.CreateOrUpdate. -type ExpressRouteCircuitsClientCreateOrUpdateResponse struct { - ExpressRouteCircuit -} - -// ExpressRouteCircuitsClientDeleteResponse contains the response from method ExpressRouteCircuitsClient.Delete. -type ExpressRouteCircuitsClientDeleteResponse struct { - // placeholder for future response values -} - -// ExpressRouteCircuitsClientGetPeeringStatsResponse contains the response from method ExpressRouteCircuitsClient.GetPeeringStats. -type ExpressRouteCircuitsClientGetPeeringStatsResponse struct { - ExpressRouteCircuitStats -} - -// ExpressRouteCircuitsClientGetResponse contains the response from method ExpressRouteCircuitsClient.Get. -type ExpressRouteCircuitsClientGetResponse struct { - ExpressRouteCircuit -} - -// ExpressRouteCircuitsClientGetStatsResponse contains the response from method ExpressRouteCircuitsClient.GetStats. -type ExpressRouteCircuitsClientGetStatsResponse struct { - ExpressRouteCircuitStats -} - -// ExpressRouteCircuitsClientListAllResponse contains the response from method ExpressRouteCircuitsClient.ListAll. -type ExpressRouteCircuitsClientListAllResponse struct { - ExpressRouteCircuitListResult -} - -// ExpressRouteCircuitsClientListArpTableResponse contains the response from method ExpressRouteCircuitsClient.ListArpTable. -type ExpressRouteCircuitsClientListArpTableResponse struct { - ExpressRouteCircuitsArpTableListResult -} - -// ExpressRouteCircuitsClientListResponse contains the response from method ExpressRouteCircuitsClient.List. -type ExpressRouteCircuitsClientListResponse struct { - ExpressRouteCircuitListResult -} - -// ExpressRouteCircuitsClientListRoutesTableResponse contains the response from method ExpressRouteCircuitsClient.ListRoutesTable. -type ExpressRouteCircuitsClientListRoutesTableResponse struct { - ExpressRouteCircuitsRoutesTableListResult -} - -// ExpressRouteCircuitsClientListRoutesTableSummaryResponse contains the response from method ExpressRouteCircuitsClient.ListRoutesTableSummary. -type ExpressRouteCircuitsClientListRoutesTableSummaryResponse struct { - ExpressRouteCircuitsRoutesTableSummaryListResult -} - -// ExpressRouteCircuitsClientUpdateTagsResponse contains the response from method ExpressRouteCircuitsClient.UpdateTags. -type ExpressRouteCircuitsClientUpdateTagsResponse struct { - ExpressRouteCircuit -} - -// ExpressRouteConnectionsClientCreateOrUpdateResponse contains the response from method ExpressRouteConnectionsClient.CreateOrUpdate. -type ExpressRouteConnectionsClientCreateOrUpdateResponse struct { - ExpressRouteConnection -} - -// ExpressRouteConnectionsClientDeleteResponse contains the response from method ExpressRouteConnectionsClient.Delete. -type ExpressRouteConnectionsClientDeleteResponse struct { - // placeholder for future response values -} - -// ExpressRouteConnectionsClientGetResponse contains the response from method ExpressRouteConnectionsClient.Get. -type ExpressRouteConnectionsClientGetResponse struct { - ExpressRouteConnection -} - -// ExpressRouteConnectionsClientListResponse contains the response from method ExpressRouteConnectionsClient.List. -type ExpressRouteConnectionsClientListResponse struct { - ExpressRouteConnectionList -} - -// ExpressRouteCrossConnectionPeeringsClientCreateOrUpdateResponse contains the response from method ExpressRouteCrossConnectionPeeringsClient.CreateOrUpdate. -type ExpressRouteCrossConnectionPeeringsClientCreateOrUpdateResponse struct { - ExpressRouteCrossConnectionPeering -} - -// ExpressRouteCrossConnectionPeeringsClientDeleteResponse contains the response from method ExpressRouteCrossConnectionPeeringsClient.Delete. -type ExpressRouteCrossConnectionPeeringsClientDeleteResponse struct { - // placeholder for future response values -} - -// ExpressRouteCrossConnectionPeeringsClientGetResponse contains the response from method ExpressRouteCrossConnectionPeeringsClient.Get. -type ExpressRouteCrossConnectionPeeringsClientGetResponse struct { - ExpressRouteCrossConnectionPeering -} - -// ExpressRouteCrossConnectionPeeringsClientListResponse contains the response from method ExpressRouteCrossConnectionPeeringsClient.List. -type ExpressRouteCrossConnectionPeeringsClientListResponse struct { - ExpressRouteCrossConnectionPeeringList -} - -// ExpressRouteCrossConnectionsClientCreateOrUpdateResponse contains the response from method ExpressRouteCrossConnectionsClient.CreateOrUpdate. -type ExpressRouteCrossConnectionsClientCreateOrUpdateResponse struct { - ExpressRouteCrossConnection -} - -// ExpressRouteCrossConnectionsClientGetResponse contains the response from method ExpressRouteCrossConnectionsClient.Get. -type ExpressRouteCrossConnectionsClientGetResponse struct { - ExpressRouteCrossConnection -} - -// ExpressRouteCrossConnectionsClientListArpTableResponse contains the response from method ExpressRouteCrossConnectionsClient.ListArpTable. -type ExpressRouteCrossConnectionsClientListArpTableResponse struct { - ExpressRouteCircuitsArpTableListResult -} - -// ExpressRouteCrossConnectionsClientListByResourceGroupResponse contains the response from method ExpressRouteCrossConnectionsClient.ListByResourceGroup. -type ExpressRouteCrossConnectionsClientListByResourceGroupResponse struct { - ExpressRouteCrossConnectionListResult -} - -// ExpressRouteCrossConnectionsClientListResponse contains the response from method ExpressRouteCrossConnectionsClient.List. -type ExpressRouteCrossConnectionsClientListResponse struct { - ExpressRouteCrossConnectionListResult -} - -// ExpressRouteCrossConnectionsClientListRoutesTableResponse contains the response from method ExpressRouteCrossConnectionsClient.ListRoutesTable. -type ExpressRouteCrossConnectionsClientListRoutesTableResponse struct { - ExpressRouteCircuitsRoutesTableListResult -} - -// ExpressRouteCrossConnectionsClientListRoutesTableSummaryResponse contains the response from method ExpressRouteCrossConnectionsClient.ListRoutesTableSummary. -type ExpressRouteCrossConnectionsClientListRoutesTableSummaryResponse struct { - ExpressRouteCrossConnectionsRoutesTableSummaryListResult -} - -// ExpressRouteCrossConnectionsClientUpdateTagsResponse contains the response from method ExpressRouteCrossConnectionsClient.UpdateTags. -type ExpressRouteCrossConnectionsClientUpdateTagsResponse struct { - ExpressRouteCrossConnection -} - -// ExpressRouteGatewaysClientCreateOrUpdateResponse contains the response from method ExpressRouteGatewaysClient.CreateOrUpdate. -type ExpressRouteGatewaysClientCreateOrUpdateResponse struct { - ExpressRouteGateway -} - -// ExpressRouteGatewaysClientDeleteResponse contains the response from method ExpressRouteGatewaysClient.Delete. -type ExpressRouteGatewaysClientDeleteResponse struct { - // placeholder for future response values -} - -// ExpressRouteGatewaysClientGetResponse contains the response from method ExpressRouteGatewaysClient.Get. -type ExpressRouteGatewaysClientGetResponse struct { - ExpressRouteGateway -} - -// ExpressRouteGatewaysClientListByResourceGroupResponse contains the response from method ExpressRouteGatewaysClient.ListByResourceGroup. -type ExpressRouteGatewaysClientListByResourceGroupResponse struct { - ExpressRouteGatewayList -} - -// ExpressRouteGatewaysClientListBySubscriptionResponse contains the response from method ExpressRouteGatewaysClient.ListBySubscription. -type ExpressRouteGatewaysClientListBySubscriptionResponse struct { - ExpressRouteGatewayList -} - -// ExpressRouteGatewaysClientUpdateTagsResponse contains the response from method ExpressRouteGatewaysClient.UpdateTags. -type ExpressRouteGatewaysClientUpdateTagsResponse struct { - ExpressRouteGateway -} - -// ExpressRouteLinksClientGetResponse contains the response from method ExpressRouteLinksClient.Get. -type ExpressRouteLinksClientGetResponse struct { - ExpressRouteLink -} - -// ExpressRouteLinksClientListResponse contains the response from method ExpressRouteLinksClient.List. -type ExpressRouteLinksClientListResponse struct { - ExpressRouteLinkListResult -} - -// ExpressRoutePortAuthorizationsClientCreateOrUpdateResponse contains the response from method ExpressRoutePortAuthorizationsClient.CreateOrUpdate. -type ExpressRoutePortAuthorizationsClientCreateOrUpdateResponse struct { - ExpressRoutePortAuthorization -} - -// ExpressRoutePortAuthorizationsClientDeleteResponse contains the response from method ExpressRoutePortAuthorizationsClient.Delete. -type ExpressRoutePortAuthorizationsClientDeleteResponse struct { - // placeholder for future response values -} - -// ExpressRoutePortAuthorizationsClientGetResponse contains the response from method ExpressRoutePortAuthorizationsClient.Get. -type ExpressRoutePortAuthorizationsClientGetResponse struct { - ExpressRoutePortAuthorization -} - -// ExpressRoutePortAuthorizationsClientListResponse contains the response from method ExpressRoutePortAuthorizationsClient.List. -type ExpressRoutePortAuthorizationsClientListResponse struct { - ExpressRoutePortAuthorizationListResult -} - -// ExpressRoutePortsClientCreateOrUpdateResponse contains the response from method ExpressRoutePortsClient.CreateOrUpdate. -type ExpressRoutePortsClientCreateOrUpdateResponse struct { - ExpressRoutePort -} - -// ExpressRoutePortsClientDeleteResponse contains the response from method ExpressRoutePortsClient.Delete. -type ExpressRoutePortsClientDeleteResponse struct { - // placeholder for future response values -} - -// ExpressRoutePortsClientGenerateLOAResponse contains the response from method ExpressRoutePortsClient.GenerateLOA. -type ExpressRoutePortsClientGenerateLOAResponse struct { - GenerateExpressRoutePortsLOAResult -} - -// ExpressRoutePortsClientGetResponse contains the response from method ExpressRoutePortsClient.Get. -type ExpressRoutePortsClientGetResponse struct { - ExpressRoutePort -} - -// ExpressRoutePortsClientListByResourceGroupResponse contains the response from method ExpressRoutePortsClient.ListByResourceGroup. -type ExpressRoutePortsClientListByResourceGroupResponse struct { - ExpressRoutePortListResult -} - -// ExpressRoutePortsClientListResponse contains the response from method ExpressRoutePortsClient.List. -type ExpressRoutePortsClientListResponse struct { - ExpressRoutePortListResult -} - -// ExpressRoutePortsClientUpdateTagsResponse contains the response from method ExpressRoutePortsClient.UpdateTags. -type ExpressRoutePortsClientUpdateTagsResponse struct { - ExpressRoutePort -} - -// ExpressRoutePortsLocationsClientGetResponse contains the response from method ExpressRoutePortsLocationsClient.Get. -type ExpressRoutePortsLocationsClientGetResponse struct { - ExpressRoutePortsLocation -} - -// ExpressRoutePortsLocationsClientListResponse contains the response from method ExpressRoutePortsLocationsClient.List. -type ExpressRoutePortsLocationsClientListResponse struct { - ExpressRoutePortsLocationListResult -} - -// ExpressRouteProviderPortsLocationClientListResponse contains the response from method ExpressRouteProviderPortsLocationClient.List. -type ExpressRouteProviderPortsLocationClientListResponse struct { - ExpressRouteProviderPortListResult -} - -// ExpressRouteServiceProvidersClientListResponse contains the response from method ExpressRouteServiceProvidersClient.List. -type ExpressRouteServiceProvidersClientListResponse struct { - ExpressRouteServiceProviderListResult -} - -// FirewallPoliciesClientCreateOrUpdateResponse contains the response from method FirewallPoliciesClient.CreateOrUpdate. -type FirewallPoliciesClientCreateOrUpdateResponse struct { - FirewallPolicy -} - -// FirewallPoliciesClientDeleteResponse contains the response from method FirewallPoliciesClient.Delete. -type FirewallPoliciesClientDeleteResponse struct { - // placeholder for future response values -} - -// FirewallPoliciesClientGetResponse contains the response from method FirewallPoliciesClient.Get. -type FirewallPoliciesClientGetResponse struct { - FirewallPolicy -} - -// FirewallPoliciesClientListAllResponse contains the response from method FirewallPoliciesClient.ListAll. -type FirewallPoliciesClientListAllResponse struct { - FirewallPolicyListResult -} - -// FirewallPoliciesClientListResponse contains the response from method FirewallPoliciesClient.List. -type FirewallPoliciesClientListResponse struct { - FirewallPolicyListResult -} - -// FirewallPoliciesClientUpdateTagsResponse contains the response from method FirewallPoliciesClient.UpdateTags. -type FirewallPoliciesClientUpdateTagsResponse struct { - FirewallPolicy -} - -// FirewallPolicyIdpsSignaturesClientListResponse contains the response from method FirewallPolicyIdpsSignaturesClient.List. -type FirewallPolicyIdpsSignaturesClientListResponse struct { - QueryResults -} - -// FirewallPolicyIdpsSignaturesFilterValuesClientListResponse contains the response from method FirewallPolicyIdpsSignaturesFilterValuesClient.List. -type FirewallPolicyIdpsSignaturesFilterValuesClientListResponse struct { - SignatureOverridesFilterValuesResponse -} - -// FirewallPolicyIdpsSignaturesOverridesClientGetResponse contains the response from method FirewallPolicyIdpsSignaturesOverridesClient.Get. -type FirewallPolicyIdpsSignaturesOverridesClientGetResponse struct { - SignaturesOverrides -} - -// FirewallPolicyIdpsSignaturesOverridesClientListResponse contains the response from method FirewallPolicyIdpsSignaturesOverridesClient.List. -type FirewallPolicyIdpsSignaturesOverridesClientListResponse struct { - SignaturesOverridesList -} - -// FirewallPolicyIdpsSignaturesOverridesClientPatchResponse contains the response from method FirewallPolicyIdpsSignaturesOverridesClient.Patch. -type FirewallPolicyIdpsSignaturesOverridesClientPatchResponse struct { - SignaturesOverrides -} - -// FirewallPolicyIdpsSignaturesOverridesClientPutResponse contains the response from method FirewallPolicyIdpsSignaturesOverridesClient.Put. -type FirewallPolicyIdpsSignaturesOverridesClientPutResponse struct { - SignaturesOverrides -} - -// FirewallPolicyRuleCollectionGroupsClientCreateOrUpdateResponse contains the response from method FirewallPolicyRuleCollectionGroupsClient.CreateOrUpdate. -type FirewallPolicyRuleCollectionGroupsClientCreateOrUpdateResponse struct { - FirewallPolicyRuleCollectionGroup -} - -// FirewallPolicyRuleCollectionGroupsClientDeleteResponse contains the response from method FirewallPolicyRuleCollectionGroupsClient.Delete. -type FirewallPolicyRuleCollectionGroupsClientDeleteResponse struct { - // placeholder for future response values -} - -// FirewallPolicyRuleCollectionGroupsClientGetResponse contains the response from method FirewallPolicyRuleCollectionGroupsClient.Get. -type FirewallPolicyRuleCollectionGroupsClientGetResponse struct { - FirewallPolicyRuleCollectionGroup -} - -// FirewallPolicyRuleCollectionGroupsClientListResponse contains the response from method FirewallPolicyRuleCollectionGroupsClient.List. -type FirewallPolicyRuleCollectionGroupsClientListResponse struct { - FirewallPolicyRuleCollectionGroupListResult -} - -// FlowLogsClientCreateOrUpdateResponse contains the response from method FlowLogsClient.CreateOrUpdate. -type FlowLogsClientCreateOrUpdateResponse struct { - FlowLog -} - -// FlowLogsClientDeleteResponse contains the response from method FlowLogsClient.Delete. -type FlowLogsClientDeleteResponse struct { - // placeholder for future response values -} - -// FlowLogsClientGetResponse contains the response from method FlowLogsClient.Get. -type FlowLogsClientGetResponse struct { - FlowLog -} - -// FlowLogsClientListResponse contains the response from method FlowLogsClient.List. -type FlowLogsClientListResponse struct { - FlowLogListResult -} - -// FlowLogsClientUpdateTagsResponse contains the response from method FlowLogsClient.UpdateTags. -type FlowLogsClientUpdateTagsResponse struct { - FlowLog -} - -// GroupsClientCreateOrUpdateResponse contains the response from method GroupsClient.CreateOrUpdate. -type GroupsClientCreateOrUpdateResponse struct { - Group - // ETag contains the information returned from the ETag header response. - ETag *string -} - -// GroupsClientDeleteResponse contains the response from method GroupsClient.Delete. -type GroupsClientDeleteResponse struct { - // placeholder for future response values -} - -// GroupsClientGetResponse contains the response from method GroupsClient.Get. -type GroupsClientGetResponse struct { - Group -} - -// GroupsClientListResponse contains the response from method GroupsClient.List. -type GroupsClientListResponse struct { - GroupListResult -} - -// HubRouteTablesClientCreateOrUpdateResponse contains the response from method HubRouteTablesClient.CreateOrUpdate. -type HubRouteTablesClientCreateOrUpdateResponse struct { - HubRouteTable -} - -// HubRouteTablesClientDeleteResponse contains the response from method HubRouteTablesClient.Delete. -type HubRouteTablesClientDeleteResponse struct { - // placeholder for future response values -} - -// HubRouteTablesClientGetResponse contains the response from method HubRouteTablesClient.Get. -type HubRouteTablesClientGetResponse struct { - HubRouteTable -} - -// HubRouteTablesClientListResponse contains the response from method HubRouteTablesClient.List. -type HubRouteTablesClientListResponse struct { - ListHubRouteTablesResult -} - -// HubVirtualNetworkConnectionsClientCreateOrUpdateResponse contains the response from method HubVirtualNetworkConnectionsClient.CreateOrUpdate. -type HubVirtualNetworkConnectionsClientCreateOrUpdateResponse struct { - HubVirtualNetworkConnection -} - -// HubVirtualNetworkConnectionsClientDeleteResponse contains the response from method HubVirtualNetworkConnectionsClient.Delete. -type HubVirtualNetworkConnectionsClientDeleteResponse struct { - // placeholder for future response values -} - -// HubVirtualNetworkConnectionsClientGetResponse contains the response from method HubVirtualNetworkConnectionsClient.Get. -type HubVirtualNetworkConnectionsClientGetResponse struct { - HubVirtualNetworkConnection -} - -// HubVirtualNetworkConnectionsClientListResponse contains the response from method HubVirtualNetworkConnectionsClient.List. -type HubVirtualNetworkConnectionsClientListResponse struct { - ListHubVirtualNetworkConnectionsResult -} - -// IPAllocationsClientCreateOrUpdateResponse contains the response from method IPAllocationsClient.CreateOrUpdate. -type IPAllocationsClientCreateOrUpdateResponse struct { - IPAllocation -} - -// IPAllocationsClientDeleteResponse contains the response from method IPAllocationsClient.Delete. -type IPAllocationsClientDeleteResponse struct { - // placeholder for future response values -} - -// IPAllocationsClientGetResponse contains the response from method IPAllocationsClient.Get. -type IPAllocationsClientGetResponse struct { - IPAllocation -} - -// IPAllocationsClientListByResourceGroupResponse contains the response from method IPAllocationsClient.ListByResourceGroup. -type IPAllocationsClientListByResourceGroupResponse struct { - IPAllocationListResult -} - -// IPAllocationsClientListResponse contains the response from method IPAllocationsClient.List. -type IPAllocationsClientListResponse struct { - IPAllocationListResult -} - -// IPAllocationsClientUpdateTagsResponse contains the response from method IPAllocationsClient.UpdateTags. -type IPAllocationsClientUpdateTagsResponse struct { - IPAllocation -} - -// IPGroupsClientCreateOrUpdateResponse contains the response from method IPGroupsClient.CreateOrUpdate. -type IPGroupsClientCreateOrUpdateResponse struct { - IPGroup -} - -// IPGroupsClientDeleteResponse contains the response from method IPGroupsClient.Delete. -type IPGroupsClientDeleteResponse struct { - // placeholder for future response values -} - -// IPGroupsClientGetResponse contains the response from method IPGroupsClient.Get. -type IPGroupsClientGetResponse struct { - IPGroup -} - -// IPGroupsClientListByResourceGroupResponse contains the response from method IPGroupsClient.ListByResourceGroup. -type IPGroupsClientListByResourceGroupResponse struct { - IPGroupListResult -} - -// IPGroupsClientListResponse contains the response from method IPGroupsClient.List. -type IPGroupsClientListResponse struct { - IPGroupListResult -} - -// IPGroupsClientUpdateGroupsResponse contains the response from method IPGroupsClient.UpdateGroups. -type IPGroupsClientUpdateGroupsResponse struct { - IPGroup -} - -// InboundNatRulesClientCreateOrUpdateResponse contains the response from method InboundNatRulesClient.CreateOrUpdate. -type InboundNatRulesClientCreateOrUpdateResponse struct { - InboundNatRule -} - -// InboundNatRulesClientDeleteResponse contains the response from method InboundNatRulesClient.Delete. -type InboundNatRulesClientDeleteResponse struct { - // placeholder for future response values -} - -// InboundNatRulesClientGetResponse contains the response from method InboundNatRulesClient.Get. -type InboundNatRulesClientGetResponse struct { - InboundNatRule -} - -// InboundNatRulesClientListResponse contains the response from method InboundNatRulesClient.List. -type InboundNatRulesClientListResponse struct { - InboundNatRuleListResult -} - -// InboundSecurityRuleClientCreateOrUpdateResponse contains the response from method InboundSecurityRuleClient.CreateOrUpdate. -type InboundSecurityRuleClientCreateOrUpdateResponse struct { - InboundSecurityRule -} - -// InterfaceIPConfigurationsClientGetResponse contains the response from method InterfaceIPConfigurationsClient.Get. -type InterfaceIPConfigurationsClientGetResponse struct { - InterfaceIPConfiguration -} - -// InterfaceIPConfigurationsClientListResponse contains the response from method InterfaceIPConfigurationsClient.List. -type InterfaceIPConfigurationsClientListResponse struct { - InterfaceIPConfigurationListResult -} - -// InterfaceLoadBalancersClientListResponse contains the response from method InterfaceLoadBalancersClient.List. -type InterfaceLoadBalancersClientListResponse struct { - InterfaceLoadBalancerListResult -} - -// InterfaceTapConfigurationsClientCreateOrUpdateResponse contains the response from method InterfaceTapConfigurationsClient.CreateOrUpdate. -type InterfaceTapConfigurationsClientCreateOrUpdateResponse struct { - InterfaceTapConfiguration -} - -// InterfaceTapConfigurationsClientDeleteResponse contains the response from method InterfaceTapConfigurationsClient.Delete. -type InterfaceTapConfigurationsClientDeleteResponse struct { - // placeholder for future response values -} - -// InterfaceTapConfigurationsClientGetResponse contains the response from method InterfaceTapConfigurationsClient.Get. -type InterfaceTapConfigurationsClientGetResponse struct { - InterfaceTapConfiguration -} - -// InterfaceTapConfigurationsClientListResponse contains the response from method InterfaceTapConfigurationsClient.List. -type InterfaceTapConfigurationsClientListResponse struct { - InterfaceTapConfigurationListResult -} - -// InterfacesClientCreateOrUpdateResponse contains the response from method InterfacesClient.CreateOrUpdate. -type InterfacesClientCreateOrUpdateResponse struct { - Interface -} - -// InterfacesClientDeleteResponse contains the response from method InterfacesClient.Delete. -type InterfacesClientDeleteResponse struct { - // placeholder for future response values -} - -// InterfacesClientGetCloudServiceNetworkInterfaceResponse contains the response from method InterfacesClient.GetCloudServiceNetworkInterface. -type InterfacesClientGetCloudServiceNetworkInterfaceResponse struct { - Interface -} - -// InterfacesClientGetEffectiveRouteTableResponse contains the response from method InterfacesClient.GetEffectiveRouteTable. -type InterfacesClientGetEffectiveRouteTableResponse struct { - EffectiveRouteListResult -} - -// InterfacesClientGetResponse contains the response from method InterfacesClient.Get. -type InterfacesClientGetResponse struct { - Interface -} - -// InterfacesClientGetVirtualMachineScaleSetIPConfigurationResponse contains the response from method InterfacesClient.GetVirtualMachineScaleSetIPConfiguration. -type InterfacesClientGetVirtualMachineScaleSetIPConfigurationResponse struct { - InterfaceIPConfiguration -} - -// InterfacesClientGetVirtualMachineScaleSetNetworkInterfaceResponse contains the response from method InterfacesClient.GetVirtualMachineScaleSetNetworkInterface. -type InterfacesClientGetVirtualMachineScaleSetNetworkInterfaceResponse struct { - Interface -} - -// InterfacesClientListAllResponse contains the response from method InterfacesClient.ListAll. -type InterfacesClientListAllResponse struct { - InterfaceListResult -} - -// InterfacesClientListCloudServiceNetworkInterfacesResponse contains the response from method InterfacesClient.ListCloudServiceNetworkInterfaces. -type InterfacesClientListCloudServiceNetworkInterfacesResponse struct { - InterfaceListResult -} - -// InterfacesClientListCloudServiceRoleInstanceNetworkInterfacesResponse contains the response from method InterfacesClient.ListCloudServiceRoleInstanceNetworkInterfaces. -type InterfacesClientListCloudServiceRoleInstanceNetworkInterfacesResponse struct { - InterfaceListResult -} - -// InterfacesClientListEffectiveNetworkSecurityGroupsResponse contains the response from method InterfacesClient.ListEffectiveNetworkSecurityGroups. -type InterfacesClientListEffectiveNetworkSecurityGroupsResponse struct { - EffectiveNetworkSecurityGroupListResult -} - -// InterfacesClientListResponse contains the response from method InterfacesClient.List. -type InterfacesClientListResponse struct { - InterfaceListResult -} - -// InterfacesClientListVirtualMachineScaleSetIPConfigurationsResponse contains the response from method InterfacesClient.ListVirtualMachineScaleSetIPConfigurations. -type InterfacesClientListVirtualMachineScaleSetIPConfigurationsResponse struct { - InterfaceIPConfigurationListResult -} - -// InterfacesClientListVirtualMachineScaleSetNetworkInterfacesResponse contains the response from method InterfacesClient.ListVirtualMachineScaleSetNetworkInterfaces. -type InterfacesClientListVirtualMachineScaleSetNetworkInterfacesResponse struct { - InterfaceListResult -} - -// InterfacesClientListVirtualMachineScaleSetVMNetworkInterfacesResponse contains the response from method InterfacesClient.ListVirtualMachineScaleSetVMNetworkInterfaces. -type InterfacesClientListVirtualMachineScaleSetVMNetworkInterfacesResponse struct { - InterfaceListResult -} - -// InterfacesClientUpdateTagsResponse contains the response from method InterfacesClient.UpdateTags. -type InterfacesClientUpdateTagsResponse struct { - Interface -} - -// LoadBalancerBackendAddressPoolsClientCreateOrUpdateResponse contains the response from method LoadBalancerBackendAddressPoolsClient.CreateOrUpdate. -type LoadBalancerBackendAddressPoolsClientCreateOrUpdateResponse struct { - BackendAddressPool -} - -// LoadBalancerBackendAddressPoolsClientDeleteResponse contains the response from method LoadBalancerBackendAddressPoolsClient.Delete. -type LoadBalancerBackendAddressPoolsClientDeleteResponse struct { - // placeholder for future response values -} - -// LoadBalancerBackendAddressPoolsClientGetResponse contains the response from method LoadBalancerBackendAddressPoolsClient.Get. -type LoadBalancerBackendAddressPoolsClientGetResponse struct { - BackendAddressPool -} - -// LoadBalancerBackendAddressPoolsClientListResponse contains the response from method LoadBalancerBackendAddressPoolsClient.List. -type LoadBalancerBackendAddressPoolsClientListResponse struct { - LoadBalancerBackendAddressPoolListResult -} - -// LoadBalancerFrontendIPConfigurationsClientGetResponse contains the response from method LoadBalancerFrontendIPConfigurationsClient.Get. -type LoadBalancerFrontendIPConfigurationsClientGetResponse struct { - FrontendIPConfiguration -} - -// LoadBalancerFrontendIPConfigurationsClientListResponse contains the response from method LoadBalancerFrontendIPConfigurationsClient.List. -type LoadBalancerFrontendIPConfigurationsClientListResponse struct { - LoadBalancerFrontendIPConfigurationListResult -} - -// LoadBalancerLoadBalancingRulesClientGetResponse contains the response from method LoadBalancerLoadBalancingRulesClient.Get. -type LoadBalancerLoadBalancingRulesClientGetResponse struct { - LoadBalancingRule -} - -// LoadBalancerLoadBalancingRulesClientListResponse contains the response from method LoadBalancerLoadBalancingRulesClient.List. -type LoadBalancerLoadBalancingRulesClientListResponse struct { - LoadBalancerLoadBalancingRuleListResult -} - -// LoadBalancerNetworkInterfacesClientListResponse contains the response from method LoadBalancerNetworkInterfacesClient.List. -type LoadBalancerNetworkInterfacesClientListResponse struct { - InterfaceListResult -} - -// LoadBalancerOutboundRulesClientGetResponse contains the response from method LoadBalancerOutboundRulesClient.Get. -type LoadBalancerOutboundRulesClientGetResponse struct { - OutboundRule -} - -// LoadBalancerOutboundRulesClientListResponse contains the response from method LoadBalancerOutboundRulesClient.List. -type LoadBalancerOutboundRulesClientListResponse struct { - LoadBalancerOutboundRuleListResult -} - -// LoadBalancerProbesClientGetResponse contains the response from method LoadBalancerProbesClient.Get. -type LoadBalancerProbesClientGetResponse struct { - Probe -} - -// LoadBalancerProbesClientListResponse contains the response from method LoadBalancerProbesClient.List. -type LoadBalancerProbesClientListResponse struct { - LoadBalancerProbeListResult -} - -// LoadBalancersClientCreateOrUpdateResponse contains the response from method LoadBalancersClient.CreateOrUpdate. -type LoadBalancersClientCreateOrUpdateResponse struct { - LoadBalancer -} - -// LoadBalancersClientDeleteResponse contains the response from method LoadBalancersClient.Delete. -type LoadBalancersClientDeleteResponse struct { - // placeholder for future response values -} - -// LoadBalancersClientGetResponse contains the response from method LoadBalancersClient.Get. -type LoadBalancersClientGetResponse struct { - LoadBalancer -} - -// LoadBalancersClientListAllResponse contains the response from method LoadBalancersClient.ListAll. -type LoadBalancersClientListAllResponse struct { - LoadBalancerListResult -} - -// LoadBalancersClientListInboundNatRulePortMappingsResponse contains the response from method LoadBalancersClient.ListInboundNatRulePortMappings. -type LoadBalancersClientListInboundNatRulePortMappingsResponse struct { - BackendAddressInboundNatRulePortMappings -} - -// LoadBalancersClientListResponse contains the response from method LoadBalancersClient.List. -type LoadBalancersClientListResponse struct { - LoadBalancerListResult -} - -// LoadBalancersClientSwapPublicIPAddressesResponse contains the response from method LoadBalancersClient.SwapPublicIPAddresses. -type LoadBalancersClientSwapPublicIPAddressesResponse struct { - // placeholder for future response values -} - -// LoadBalancersClientUpdateTagsResponse contains the response from method LoadBalancersClient.UpdateTags. -type LoadBalancersClientUpdateTagsResponse struct { - LoadBalancer -} - -// LocalNetworkGatewaysClientCreateOrUpdateResponse contains the response from method LocalNetworkGatewaysClient.CreateOrUpdate. -type LocalNetworkGatewaysClientCreateOrUpdateResponse struct { - LocalNetworkGateway -} - -// LocalNetworkGatewaysClientDeleteResponse contains the response from method LocalNetworkGatewaysClient.Delete. -type LocalNetworkGatewaysClientDeleteResponse struct { - // placeholder for future response values -} - -// LocalNetworkGatewaysClientGetResponse contains the response from method LocalNetworkGatewaysClient.Get. -type LocalNetworkGatewaysClientGetResponse struct { - LocalNetworkGateway -} - -// LocalNetworkGatewaysClientListResponse contains the response from method LocalNetworkGatewaysClient.List. -type LocalNetworkGatewaysClientListResponse struct { - LocalNetworkGatewayListResult -} - -// LocalNetworkGatewaysClientUpdateTagsResponse contains the response from method LocalNetworkGatewaysClient.UpdateTags. -type LocalNetworkGatewaysClientUpdateTagsResponse struct { - LocalNetworkGateway -} - -// ManagementClientCheckDNSNameAvailabilityResponse contains the response from method ManagementClient.CheckDNSNameAvailability. -type ManagementClientCheckDNSNameAvailabilityResponse struct { - DNSNameAvailabilityResult -} - -// ManagementClientDeleteBastionShareableLinkResponse contains the response from method ManagementClient.DeleteBastionShareableLink. -type ManagementClientDeleteBastionShareableLinkResponse struct { - // placeholder for future response values -} - -// ManagementClientDisconnectActiveSessionsResponse contains the response from method ManagementClient.DisconnectActiveSessions. -type ManagementClientDisconnectActiveSessionsResponse struct { - BastionSessionDeleteResult -} - -// ManagementClientExpressRouteProviderPortResponse contains the response from method ManagementClient.ExpressRouteProviderPort. -type ManagementClientExpressRouteProviderPortResponse struct { - ExpressRouteProviderPort -} - -// ManagementClientGeneratevirtualwanvpnserverconfigurationvpnprofileResponse contains the response from method ManagementClient.Generatevirtualwanvpnserverconfigurationvpnprofile. -type ManagementClientGeneratevirtualwanvpnserverconfigurationvpnprofileResponse struct { - VPNProfileResponse -} - -// ManagementClientGetActiveSessionsResponse contains the response from method ManagementClient.GetActiveSessions. -type ManagementClientGetActiveSessionsResponse struct { - BastionActiveSessionListResult -} - -// ManagementClientGetBastionShareableLinkResponse contains the response from method ManagementClient.GetBastionShareableLink. -type ManagementClientGetBastionShareableLinkResponse struct { - BastionShareableLinkListResult -} - -// ManagementClientListActiveConnectivityConfigurationsResponse contains the response from method ManagementClient.ListActiveConnectivityConfigurations. -type ManagementClientListActiveConnectivityConfigurationsResponse struct { - ActiveConnectivityConfigurationsListResult -} - -// ManagementClientListActiveSecurityAdminRulesResponse contains the response from method ManagementClient.ListActiveSecurityAdminRules. -type ManagementClientListActiveSecurityAdminRulesResponse struct { - ActiveSecurityAdminRulesListResult -} - -// ManagementClientListNetworkManagerEffectiveConnectivityConfigurationsResponse contains the response from method ManagementClient.ListNetworkManagerEffectiveConnectivityConfigurations. -type ManagementClientListNetworkManagerEffectiveConnectivityConfigurationsResponse struct { - ManagerEffectiveConnectivityConfigurationListResult -} - -// ManagementClientListNetworkManagerEffectiveSecurityAdminRulesResponse contains the response from method ManagementClient.ListNetworkManagerEffectiveSecurityAdminRules. -type ManagementClientListNetworkManagerEffectiveSecurityAdminRulesResponse struct { - ManagerEffectiveSecurityAdminRulesListResult -} - -// ManagementClientPutBastionShareableLinkResponse contains the response from method ManagementClient.PutBastionShareableLink. -type ManagementClientPutBastionShareableLinkResponse struct { - BastionShareableLinkListResult -} - -// ManagementClientSupportedSecurityProvidersResponse contains the response from method ManagementClient.SupportedSecurityProviders. -type ManagementClientSupportedSecurityProvidersResponse struct { - VirtualWanSecurityProviders -} - -// ManagementGroupNetworkManagerConnectionsClientCreateOrUpdateResponse contains the response from method ManagementGroupNetworkManagerConnectionsClient.CreateOrUpdate. -type ManagementGroupNetworkManagerConnectionsClientCreateOrUpdateResponse struct { - ManagerConnection -} - -// ManagementGroupNetworkManagerConnectionsClientDeleteResponse contains the response from method ManagementGroupNetworkManagerConnectionsClient.Delete. -type ManagementGroupNetworkManagerConnectionsClientDeleteResponse struct { - // placeholder for future response values -} - -// ManagementGroupNetworkManagerConnectionsClientGetResponse contains the response from method ManagementGroupNetworkManagerConnectionsClient.Get. -type ManagementGroupNetworkManagerConnectionsClientGetResponse struct { - ManagerConnection -} - -// ManagementGroupNetworkManagerConnectionsClientListResponse contains the response from method ManagementGroupNetworkManagerConnectionsClient.List. -type ManagementGroupNetworkManagerConnectionsClientListResponse struct { - ManagerConnectionListResult -} - -// ManagerCommitsClientPostResponse contains the response from method ManagerCommitsClient.Post. -type ManagerCommitsClientPostResponse struct { - ManagerCommit -} - -// ManagerDeploymentStatusClientListResponse contains the response from method ManagerDeploymentStatusClient.List. -type ManagerDeploymentStatusClientListResponse struct { - ManagerDeploymentStatusListResult -} - -// ManagersClientCreateOrUpdateResponse contains the response from method ManagersClient.CreateOrUpdate. -type ManagersClientCreateOrUpdateResponse struct { - Manager -} - -// ManagersClientDeleteResponse contains the response from method ManagersClient.Delete. -type ManagersClientDeleteResponse struct { - // placeholder for future response values -} - -// ManagersClientGetResponse contains the response from method ManagersClient.Get. -type ManagersClientGetResponse struct { - Manager -} - -// ManagersClientListBySubscriptionResponse contains the response from method ManagersClient.ListBySubscription. -type ManagersClientListBySubscriptionResponse struct { - ManagerListResult -} - -// ManagersClientListResponse contains the response from method ManagersClient.List. -type ManagersClientListResponse struct { - ManagerListResult -} - -// ManagersClientPatchResponse contains the response from method ManagersClient.Patch. -type ManagersClientPatchResponse struct { - Manager -} - -// NatGatewaysClientCreateOrUpdateResponse contains the response from method NatGatewaysClient.CreateOrUpdate. -type NatGatewaysClientCreateOrUpdateResponse struct { - NatGateway -} - -// NatGatewaysClientDeleteResponse contains the response from method NatGatewaysClient.Delete. -type NatGatewaysClientDeleteResponse struct { - // placeholder for future response values -} - -// NatGatewaysClientGetResponse contains the response from method NatGatewaysClient.Get. -type NatGatewaysClientGetResponse struct { - NatGateway -} - -// NatGatewaysClientListAllResponse contains the response from method NatGatewaysClient.ListAll. -type NatGatewaysClientListAllResponse struct { - NatGatewayListResult -} - -// NatGatewaysClientListResponse contains the response from method NatGatewaysClient.List. -type NatGatewaysClientListResponse struct { - NatGatewayListResult -} - -// NatGatewaysClientUpdateTagsResponse contains the response from method NatGatewaysClient.UpdateTags. -type NatGatewaysClientUpdateTagsResponse struct { - NatGateway -} - -// NatRulesClientCreateOrUpdateResponse contains the response from method NatRulesClient.CreateOrUpdate. -type NatRulesClientCreateOrUpdateResponse struct { - VPNGatewayNatRule -} - -// NatRulesClientDeleteResponse contains the response from method NatRulesClient.Delete. -type NatRulesClientDeleteResponse struct { - // placeholder for future response values -} - -// NatRulesClientGetResponse contains the response from method NatRulesClient.Get. -type NatRulesClientGetResponse struct { - VPNGatewayNatRule -} - -// NatRulesClientListByVPNGatewayResponse contains the response from method NatRulesClient.ListByVPNGateway. -type NatRulesClientListByVPNGatewayResponse struct { - ListVPNGatewayNatRulesResult -} - -// OperationsClientListResponse contains the response from method OperationsClient.List. -type OperationsClientListResponse struct { - OperationListResult -} - -// P2SVPNGatewaysClientCreateOrUpdateResponse contains the response from method P2SVPNGatewaysClient.CreateOrUpdate. -type P2SVPNGatewaysClientCreateOrUpdateResponse struct { - P2SVPNGateway -} - -// P2SVPNGatewaysClientDeleteResponse contains the response from method P2SVPNGatewaysClient.Delete. -type P2SVPNGatewaysClientDeleteResponse struct { - // placeholder for future response values -} - -// P2SVPNGatewaysClientDisconnectP2SVPNConnectionsResponse contains the response from method P2SVPNGatewaysClient.DisconnectP2SVPNConnections. -type P2SVPNGatewaysClientDisconnectP2SVPNConnectionsResponse struct { - // placeholder for future response values -} - -// P2SVPNGatewaysClientGenerateVPNProfileResponse contains the response from method P2SVPNGatewaysClient.GenerateVPNProfile. -type P2SVPNGatewaysClientGenerateVPNProfileResponse struct { - VPNProfileResponse -} - -// P2SVPNGatewaysClientGetP2SVPNConnectionHealthDetailedResponse contains the response from method P2SVPNGatewaysClient.GetP2SVPNConnectionHealthDetailed. -type P2SVPNGatewaysClientGetP2SVPNConnectionHealthDetailedResponse struct { - P2SVPNConnectionHealth -} - -// P2SVPNGatewaysClientGetP2SVPNConnectionHealthResponse contains the response from method P2SVPNGatewaysClient.GetP2SVPNConnectionHealth. -type P2SVPNGatewaysClientGetP2SVPNConnectionHealthResponse struct { - P2SVPNGateway -} - -// P2SVPNGatewaysClientGetResponse contains the response from method P2SVPNGatewaysClient.Get. -type P2SVPNGatewaysClientGetResponse struct { - P2SVPNGateway -} - -// P2SVPNGatewaysClientListByResourceGroupResponse contains the response from method P2SVPNGatewaysClient.ListByResourceGroup. -type P2SVPNGatewaysClientListByResourceGroupResponse struct { - ListP2SVPNGatewaysResult -} - -// P2SVPNGatewaysClientListResponse contains the response from method P2SVPNGatewaysClient.List. -type P2SVPNGatewaysClientListResponse struct { - ListP2SVPNGatewaysResult -} - -// P2SVPNGatewaysClientResetResponse contains the response from method P2SVPNGatewaysClient.Reset. -type P2SVPNGatewaysClientResetResponse struct { - P2SVPNGateway -} - -// P2SVPNGatewaysClientUpdateTagsResponse contains the response from method P2SVPNGatewaysClient.UpdateTags. -type P2SVPNGatewaysClientUpdateTagsResponse struct { - P2SVPNGateway -} - -// PacketCapturesClientCreateResponse contains the response from method PacketCapturesClient.Create. -type PacketCapturesClientCreateResponse struct { - PacketCaptureResult -} - -// PacketCapturesClientDeleteResponse contains the response from method PacketCapturesClient.Delete. -type PacketCapturesClientDeleteResponse struct { - // placeholder for future response values -} - -// PacketCapturesClientGetResponse contains the response from method PacketCapturesClient.Get. -type PacketCapturesClientGetResponse struct { - PacketCaptureResult -} - -// PacketCapturesClientGetStatusResponse contains the response from method PacketCapturesClient.GetStatus. -type PacketCapturesClientGetStatusResponse struct { - PacketCaptureQueryStatusResult -} - -// PacketCapturesClientListResponse contains the response from method PacketCapturesClient.List. -type PacketCapturesClientListResponse struct { - PacketCaptureListResult -} - -// PacketCapturesClientStopResponse contains the response from method PacketCapturesClient.Stop. -type PacketCapturesClientStopResponse struct { - // placeholder for future response values -} - -// PeerExpressRouteCircuitConnectionsClientGetResponse contains the response from method PeerExpressRouteCircuitConnectionsClient.Get. -type PeerExpressRouteCircuitConnectionsClientGetResponse struct { - PeerExpressRouteCircuitConnection -} - -// PeerExpressRouteCircuitConnectionsClientListResponse contains the response from method PeerExpressRouteCircuitConnectionsClient.List. -type PeerExpressRouteCircuitConnectionsClientListResponse struct { - PeerExpressRouteCircuitConnectionListResult -} - -// PrivateDNSZoneGroupsClientCreateOrUpdateResponse contains the response from method PrivateDNSZoneGroupsClient.CreateOrUpdate. -type PrivateDNSZoneGroupsClientCreateOrUpdateResponse struct { - PrivateDNSZoneGroup -} - -// PrivateDNSZoneGroupsClientDeleteResponse contains the response from method PrivateDNSZoneGroupsClient.Delete. -type PrivateDNSZoneGroupsClientDeleteResponse struct { - // placeholder for future response values -} - -// PrivateDNSZoneGroupsClientGetResponse contains the response from method PrivateDNSZoneGroupsClient.Get. -type PrivateDNSZoneGroupsClientGetResponse struct { - PrivateDNSZoneGroup -} - -// PrivateDNSZoneGroupsClientListResponse contains the response from method PrivateDNSZoneGroupsClient.List. -type PrivateDNSZoneGroupsClientListResponse struct { - PrivateDNSZoneGroupListResult -} - -// PrivateEndpointsClientCreateOrUpdateResponse contains the response from method PrivateEndpointsClient.CreateOrUpdate. -type PrivateEndpointsClientCreateOrUpdateResponse struct { - PrivateEndpoint -} - -// PrivateEndpointsClientDeleteResponse contains the response from method PrivateEndpointsClient.Delete. -type PrivateEndpointsClientDeleteResponse struct { - // placeholder for future response values -} - -// PrivateEndpointsClientGetResponse contains the response from method PrivateEndpointsClient.Get. -type PrivateEndpointsClientGetResponse struct { - PrivateEndpoint -} - -// PrivateEndpointsClientListBySubscriptionResponse contains the response from method PrivateEndpointsClient.ListBySubscription. -type PrivateEndpointsClientListBySubscriptionResponse struct { - PrivateEndpointListResult -} - -// PrivateEndpointsClientListResponse contains the response from method PrivateEndpointsClient.List. -type PrivateEndpointsClientListResponse struct { - PrivateEndpointListResult -} - -// PrivateLinkServicesClientCheckPrivateLinkServiceVisibilityByResourceGroupResponse contains the response from method PrivateLinkServicesClient.CheckPrivateLinkServiceVisibilityByResourceGroup. -type PrivateLinkServicesClientCheckPrivateLinkServiceVisibilityByResourceGroupResponse struct { - PrivateLinkServiceVisibility -} - -// PrivateLinkServicesClientCheckPrivateLinkServiceVisibilityResponse contains the response from method PrivateLinkServicesClient.CheckPrivateLinkServiceVisibility. -type PrivateLinkServicesClientCheckPrivateLinkServiceVisibilityResponse struct { - PrivateLinkServiceVisibility -} - -// PrivateLinkServicesClientCreateOrUpdateResponse contains the response from method PrivateLinkServicesClient.CreateOrUpdate. -type PrivateLinkServicesClientCreateOrUpdateResponse struct { - PrivateLinkService -} - -// PrivateLinkServicesClientDeletePrivateEndpointConnectionResponse contains the response from method PrivateLinkServicesClient.DeletePrivateEndpointConnection. -type PrivateLinkServicesClientDeletePrivateEndpointConnectionResponse struct { - // placeholder for future response values -} - -// PrivateLinkServicesClientDeleteResponse contains the response from method PrivateLinkServicesClient.Delete. -type PrivateLinkServicesClientDeleteResponse struct { - // placeholder for future response values -} - -// PrivateLinkServicesClientGetPrivateEndpointConnectionResponse contains the response from method PrivateLinkServicesClient.GetPrivateEndpointConnection. -type PrivateLinkServicesClientGetPrivateEndpointConnectionResponse struct { - PrivateEndpointConnection -} - -// PrivateLinkServicesClientGetResponse contains the response from method PrivateLinkServicesClient.Get. -type PrivateLinkServicesClientGetResponse struct { - PrivateLinkService -} - -// PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesByResourceGroupResponse contains the response from method PrivateLinkServicesClient.ListAutoApprovedPrivateLinkServicesByResourceGroup. -type PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesByResourceGroupResponse struct { - AutoApprovedPrivateLinkServicesResult -} - -// PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesResponse contains the response from method PrivateLinkServicesClient.ListAutoApprovedPrivateLinkServices. -type PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesResponse struct { - AutoApprovedPrivateLinkServicesResult -} - -// PrivateLinkServicesClientListBySubscriptionResponse contains the response from method PrivateLinkServicesClient.ListBySubscription. -type PrivateLinkServicesClientListBySubscriptionResponse struct { - PrivateLinkServiceListResult -} - -// PrivateLinkServicesClientListPrivateEndpointConnectionsResponse contains the response from method PrivateLinkServicesClient.ListPrivateEndpointConnections. -type PrivateLinkServicesClientListPrivateEndpointConnectionsResponse struct { - PrivateEndpointConnectionListResult -} - -// PrivateLinkServicesClientListResponse contains the response from method PrivateLinkServicesClient.List. -type PrivateLinkServicesClientListResponse struct { - PrivateLinkServiceListResult -} - -// PrivateLinkServicesClientUpdatePrivateEndpointConnectionResponse contains the response from method PrivateLinkServicesClient.UpdatePrivateEndpointConnection. -type PrivateLinkServicesClientUpdatePrivateEndpointConnectionResponse struct { - PrivateEndpointConnection -} - -// ProfilesClientCreateOrUpdateResponse contains the response from method ProfilesClient.CreateOrUpdate. -type ProfilesClientCreateOrUpdateResponse struct { - Profile -} - -// ProfilesClientDeleteResponse contains the response from method ProfilesClient.Delete. -type ProfilesClientDeleteResponse struct { - // placeholder for future response values -} - -// ProfilesClientGetResponse contains the response from method ProfilesClient.Get. -type ProfilesClientGetResponse struct { - Profile -} - -// ProfilesClientListAllResponse contains the response from method ProfilesClient.ListAll. -type ProfilesClientListAllResponse struct { - ProfileListResult -} - -// ProfilesClientListResponse contains the response from method ProfilesClient.List. -type ProfilesClientListResponse struct { - ProfileListResult -} - -// ProfilesClientUpdateTagsResponse contains the response from method ProfilesClient.UpdateTags. -type ProfilesClientUpdateTagsResponse struct { - Profile -} - -// PublicIPAddressesClientCreateOrUpdateResponse contains the response from method PublicIPAddressesClient.CreateOrUpdate. -type PublicIPAddressesClientCreateOrUpdateResponse struct { - PublicIPAddress -} - -// PublicIPAddressesClientDeleteResponse contains the response from method PublicIPAddressesClient.Delete. -type PublicIPAddressesClientDeleteResponse struct { - // placeholder for future response values -} - -// PublicIPAddressesClientGetCloudServicePublicIPAddressResponse contains the response from method PublicIPAddressesClient.GetCloudServicePublicIPAddress. -type PublicIPAddressesClientGetCloudServicePublicIPAddressResponse struct { - PublicIPAddress -} - -// PublicIPAddressesClientGetResponse contains the response from method PublicIPAddressesClient.Get. -type PublicIPAddressesClientGetResponse struct { - PublicIPAddress -} - -// PublicIPAddressesClientGetVirtualMachineScaleSetPublicIPAddressResponse contains the response from method PublicIPAddressesClient.GetVirtualMachineScaleSetPublicIPAddress. -type PublicIPAddressesClientGetVirtualMachineScaleSetPublicIPAddressResponse struct { - PublicIPAddress -} - -// PublicIPAddressesClientListAllResponse contains the response from method PublicIPAddressesClient.ListAll. -type PublicIPAddressesClientListAllResponse struct { - PublicIPAddressListResult -} - -// PublicIPAddressesClientListCloudServicePublicIPAddressesResponse contains the response from method PublicIPAddressesClient.ListCloudServicePublicIPAddresses. -type PublicIPAddressesClientListCloudServicePublicIPAddressesResponse struct { - PublicIPAddressListResult -} - -// PublicIPAddressesClientListCloudServiceRoleInstancePublicIPAddressesResponse contains the response from method PublicIPAddressesClient.ListCloudServiceRoleInstancePublicIPAddresses. -type PublicIPAddressesClientListCloudServiceRoleInstancePublicIPAddressesResponse struct { - PublicIPAddressListResult -} - -// PublicIPAddressesClientListResponse contains the response from method PublicIPAddressesClient.List. -type PublicIPAddressesClientListResponse struct { - PublicIPAddressListResult -} - -// PublicIPAddressesClientListVirtualMachineScaleSetPublicIPAddressesResponse contains the response from method PublicIPAddressesClient.ListVirtualMachineScaleSetPublicIPAddresses. -type PublicIPAddressesClientListVirtualMachineScaleSetPublicIPAddressesResponse struct { - PublicIPAddressListResult -} - -// PublicIPAddressesClientListVirtualMachineScaleSetVMPublicIPAddressesResponse contains the response from method PublicIPAddressesClient.ListVirtualMachineScaleSetVMPublicIPAddresses. -type PublicIPAddressesClientListVirtualMachineScaleSetVMPublicIPAddressesResponse struct { - PublicIPAddressListResult -} - -// PublicIPAddressesClientUpdateTagsResponse contains the response from method PublicIPAddressesClient.UpdateTags. -type PublicIPAddressesClientUpdateTagsResponse struct { - PublicIPAddress -} - -// PublicIPPrefixesClientCreateOrUpdateResponse contains the response from method PublicIPPrefixesClient.CreateOrUpdate. -type PublicIPPrefixesClientCreateOrUpdateResponse struct { - PublicIPPrefix -} - -// PublicIPPrefixesClientDeleteResponse contains the response from method PublicIPPrefixesClient.Delete. -type PublicIPPrefixesClientDeleteResponse struct { - // placeholder for future response values -} - -// PublicIPPrefixesClientGetResponse contains the response from method PublicIPPrefixesClient.Get. -type PublicIPPrefixesClientGetResponse struct { - PublicIPPrefix -} - -// PublicIPPrefixesClientListAllResponse contains the response from method PublicIPPrefixesClient.ListAll. -type PublicIPPrefixesClientListAllResponse struct { - PublicIPPrefixListResult -} - -// PublicIPPrefixesClientListResponse contains the response from method PublicIPPrefixesClient.List. -type PublicIPPrefixesClientListResponse struct { - PublicIPPrefixListResult -} - -// PublicIPPrefixesClientUpdateTagsResponse contains the response from method PublicIPPrefixesClient.UpdateTags. -type PublicIPPrefixesClientUpdateTagsResponse struct { - PublicIPPrefix -} - -// ResourceNavigationLinksClientListResponse contains the response from method ResourceNavigationLinksClient.List. -type ResourceNavigationLinksClientListResponse struct { - ResourceNavigationLinksListResult -} - -// RouteFilterRulesClientCreateOrUpdateResponse contains the response from method RouteFilterRulesClient.CreateOrUpdate. -type RouteFilterRulesClientCreateOrUpdateResponse struct { - RouteFilterRule -} - -// RouteFilterRulesClientDeleteResponse contains the response from method RouteFilterRulesClient.Delete. -type RouteFilterRulesClientDeleteResponse struct { - // placeholder for future response values -} - -// RouteFilterRulesClientGetResponse contains the response from method RouteFilterRulesClient.Get. -type RouteFilterRulesClientGetResponse struct { - RouteFilterRule -} - -// RouteFilterRulesClientListByRouteFilterResponse contains the response from method RouteFilterRulesClient.ListByRouteFilter. -type RouteFilterRulesClientListByRouteFilterResponse struct { - RouteFilterRuleListResult -} - -// RouteFiltersClientCreateOrUpdateResponse contains the response from method RouteFiltersClient.CreateOrUpdate. -type RouteFiltersClientCreateOrUpdateResponse struct { - RouteFilter -} - -// RouteFiltersClientDeleteResponse contains the response from method RouteFiltersClient.Delete. -type RouteFiltersClientDeleteResponse struct { - // placeholder for future response values -} - -// RouteFiltersClientGetResponse contains the response from method RouteFiltersClient.Get. -type RouteFiltersClientGetResponse struct { - RouteFilter -} - -// RouteFiltersClientListByResourceGroupResponse contains the response from method RouteFiltersClient.ListByResourceGroup. -type RouteFiltersClientListByResourceGroupResponse struct { - RouteFilterListResult -} - -// RouteFiltersClientListResponse contains the response from method RouteFiltersClient.List. -type RouteFiltersClientListResponse struct { - RouteFilterListResult -} - -// RouteFiltersClientUpdateTagsResponse contains the response from method RouteFiltersClient.UpdateTags. -type RouteFiltersClientUpdateTagsResponse struct { - RouteFilter -} - -// RouteTablesClientCreateOrUpdateResponse contains the response from method RouteTablesClient.CreateOrUpdate. -type RouteTablesClientCreateOrUpdateResponse struct { - RouteTable -} - -// RouteTablesClientDeleteResponse contains the response from method RouteTablesClient.Delete. -type RouteTablesClientDeleteResponse struct { - // placeholder for future response values -} - -// RouteTablesClientGetResponse contains the response from method RouteTablesClient.Get. -type RouteTablesClientGetResponse struct { - RouteTable -} - -// RouteTablesClientListAllResponse contains the response from method RouteTablesClient.ListAll. -type RouteTablesClientListAllResponse struct { - RouteTableListResult -} - -// RouteTablesClientListResponse contains the response from method RouteTablesClient.List. -type RouteTablesClientListResponse struct { - RouteTableListResult -} - -// RouteTablesClientUpdateTagsResponse contains the response from method RouteTablesClient.UpdateTags. -type RouteTablesClientUpdateTagsResponse struct { - RouteTable -} - -// RoutesClientCreateOrUpdateResponse contains the response from method RoutesClient.CreateOrUpdate. -type RoutesClientCreateOrUpdateResponse struct { - Route -} - -// RoutesClientDeleteResponse contains the response from method RoutesClient.Delete. -type RoutesClientDeleteResponse struct { - // placeholder for future response values -} - -// RoutesClientGetResponse contains the response from method RoutesClient.Get. -type RoutesClientGetResponse struct { - Route -} - -// RoutesClientListResponse contains the response from method RoutesClient.List. -type RoutesClientListResponse struct { - RouteListResult -} - -// RoutingIntentClientCreateOrUpdateResponse contains the response from method RoutingIntentClient.CreateOrUpdate. -type RoutingIntentClientCreateOrUpdateResponse struct { - RoutingIntent -} - -// RoutingIntentClientDeleteResponse contains the response from method RoutingIntentClient.Delete. -type RoutingIntentClientDeleteResponse struct { - // placeholder for future response values -} - -// RoutingIntentClientGetResponse contains the response from method RoutingIntentClient.Get. -type RoutingIntentClientGetResponse struct { - RoutingIntent -} - -// RoutingIntentClientListResponse contains the response from method RoutingIntentClient.List. -type RoutingIntentClientListResponse struct { - ListRoutingIntentResult -} - -// ScopeConnectionsClientCreateOrUpdateResponse contains the response from method ScopeConnectionsClient.CreateOrUpdate. -type ScopeConnectionsClientCreateOrUpdateResponse struct { - ScopeConnection -} - -// ScopeConnectionsClientDeleteResponse contains the response from method ScopeConnectionsClient.Delete. -type ScopeConnectionsClientDeleteResponse struct { - // placeholder for future response values -} - -// ScopeConnectionsClientGetResponse contains the response from method ScopeConnectionsClient.Get. -type ScopeConnectionsClientGetResponse struct { - ScopeConnection -} - -// ScopeConnectionsClientListResponse contains the response from method ScopeConnectionsClient.List. -type ScopeConnectionsClientListResponse struct { - ScopeConnectionListResult -} - -// SecurityAdminConfigurationsClientCreateOrUpdateResponse contains the response from method SecurityAdminConfigurationsClient.CreateOrUpdate. -type SecurityAdminConfigurationsClientCreateOrUpdateResponse struct { - SecurityAdminConfiguration -} - -// SecurityAdminConfigurationsClientDeleteResponse contains the response from method SecurityAdminConfigurationsClient.Delete. -type SecurityAdminConfigurationsClientDeleteResponse struct { - // placeholder for future response values -} - -// SecurityAdminConfigurationsClientGetResponse contains the response from method SecurityAdminConfigurationsClient.Get. -type SecurityAdminConfigurationsClientGetResponse struct { - SecurityAdminConfiguration -} - -// SecurityAdminConfigurationsClientListResponse contains the response from method SecurityAdminConfigurationsClient.List. -type SecurityAdminConfigurationsClientListResponse struct { - SecurityAdminConfigurationListResult -} - -// SecurityGroupsClientCreateOrUpdateResponse contains the response from method SecurityGroupsClient.CreateOrUpdate. -type SecurityGroupsClientCreateOrUpdateResponse struct { - SecurityGroup -} - -// SecurityGroupsClientDeleteResponse contains the response from method SecurityGroupsClient.Delete. -type SecurityGroupsClientDeleteResponse struct { - // placeholder for future response values -} - -// SecurityGroupsClientGetResponse contains the response from method SecurityGroupsClient.Get. -type SecurityGroupsClientGetResponse struct { - SecurityGroup -} - -// SecurityGroupsClientListAllResponse contains the response from method SecurityGroupsClient.ListAll. -type SecurityGroupsClientListAllResponse struct { - SecurityGroupListResult -} - -// SecurityGroupsClientListResponse contains the response from method SecurityGroupsClient.List. -type SecurityGroupsClientListResponse struct { - SecurityGroupListResult -} - -// SecurityGroupsClientUpdateTagsResponse contains the response from method SecurityGroupsClient.UpdateTags. -type SecurityGroupsClientUpdateTagsResponse struct { - SecurityGroup -} - -// SecurityPartnerProvidersClientCreateOrUpdateResponse contains the response from method SecurityPartnerProvidersClient.CreateOrUpdate. -type SecurityPartnerProvidersClientCreateOrUpdateResponse struct { - SecurityPartnerProvider -} - -// SecurityPartnerProvidersClientDeleteResponse contains the response from method SecurityPartnerProvidersClient.Delete. -type SecurityPartnerProvidersClientDeleteResponse struct { - // placeholder for future response values -} - -// SecurityPartnerProvidersClientGetResponse contains the response from method SecurityPartnerProvidersClient.Get. -type SecurityPartnerProvidersClientGetResponse struct { - SecurityPartnerProvider -} - -// SecurityPartnerProvidersClientListByResourceGroupResponse contains the response from method SecurityPartnerProvidersClient.ListByResourceGroup. -type SecurityPartnerProvidersClientListByResourceGroupResponse struct { - SecurityPartnerProviderListResult -} - -// SecurityPartnerProvidersClientListResponse contains the response from method SecurityPartnerProvidersClient.List. -type SecurityPartnerProvidersClientListResponse struct { - SecurityPartnerProviderListResult -} - -// SecurityPartnerProvidersClientUpdateTagsResponse contains the response from method SecurityPartnerProvidersClient.UpdateTags. -type SecurityPartnerProvidersClientUpdateTagsResponse struct { - SecurityPartnerProvider -} - -// SecurityRulesClientCreateOrUpdateResponse contains the response from method SecurityRulesClient.CreateOrUpdate. -type SecurityRulesClientCreateOrUpdateResponse struct { - SecurityRule -} - -// SecurityRulesClientDeleteResponse contains the response from method SecurityRulesClient.Delete. -type SecurityRulesClientDeleteResponse struct { - // placeholder for future response values -} - -// SecurityRulesClientGetResponse contains the response from method SecurityRulesClient.Get. -type SecurityRulesClientGetResponse struct { - SecurityRule -} - -// SecurityRulesClientListResponse contains the response from method SecurityRulesClient.List. -type SecurityRulesClientListResponse struct { - SecurityRuleListResult -} - -// ServiceAssociationLinksClientListResponse contains the response from method ServiceAssociationLinksClient.List. -type ServiceAssociationLinksClientListResponse struct { - ServiceAssociationLinksListResult -} - -// ServiceEndpointPoliciesClientCreateOrUpdateResponse contains the response from method ServiceEndpointPoliciesClient.CreateOrUpdate. -type ServiceEndpointPoliciesClientCreateOrUpdateResponse struct { - ServiceEndpointPolicy -} - -// ServiceEndpointPoliciesClientDeleteResponse contains the response from method ServiceEndpointPoliciesClient.Delete. -type ServiceEndpointPoliciesClientDeleteResponse struct { - // placeholder for future response values -} - -// ServiceEndpointPoliciesClientGetResponse contains the response from method ServiceEndpointPoliciesClient.Get. -type ServiceEndpointPoliciesClientGetResponse struct { - ServiceEndpointPolicy -} - -// ServiceEndpointPoliciesClientListByResourceGroupResponse contains the response from method ServiceEndpointPoliciesClient.ListByResourceGroup. -type ServiceEndpointPoliciesClientListByResourceGroupResponse struct { - ServiceEndpointPolicyListResult -} - -// ServiceEndpointPoliciesClientListResponse contains the response from method ServiceEndpointPoliciesClient.List. -type ServiceEndpointPoliciesClientListResponse struct { - ServiceEndpointPolicyListResult -} - -// ServiceEndpointPoliciesClientUpdateTagsResponse contains the response from method ServiceEndpointPoliciesClient.UpdateTags. -type ServiceEndpointPoliciesClientUpdateTagsResponse struct { - ServiceEndpointPolicy -} - -// ServiceEndpointPolicyDefinitionsClientCreateOrUpdateResponse contains the response from method ServiceEndpointPolicyDefinitionsClient.CreateOrUpdate. -type ServiceEndpointPolicyDefinitionsClientCreateOrUpdateResponse struct { - ServiceEndpointPolicyDefinition -} - -// ServiceEndpointPolicyDefinitionsClientDeleteResponse contains the response from method ServiceEndpointPolicyDefinitionsClient.Delete. -type ServiceEndpointPolicyDefinitionsClientDeleteResponse struct { - // placeholder for future response values -} - -// ServiceEndpointPolicyDefinitionsClientGetResponse contains the response from method ServiceEndpointPolicyDefinitionsClient.Get. -type ServiceEndpointPolicyDefinitionsClientGetResponse struct { - ServiceEndpointPolicyDefinition -} - -// ServiceEndpointPolicyDefinitionsClientListByResourceGroupResponse contains the response from method ServiceEndpointPolicyDefinitionsClient.ListByResourceGroup. -type ServiceEndpointPolicyDefinitionsClientListByResourceGroupResponse struct { - ServiceEndpointPolicyDefinitionListResult -} - -// ServiceTagInformationClientListResponse contains the response from method ServiceTagInformationClient.List. -type ServiceTagInformationClientListResponse struct { - ServiceTagInformationListResult -} - -// ServiceTagsClientListResponse contains the response from method ServiceTagsClient.List. -type ServiceTagsClientListResponse struct { - ServiceTagsListResult -} - -// StaticMembersClientCreateOrUpdateResponse contains the response from method StaticMembersClient.CreateOrUpdate. -type StaticMembersClientCreateOrUpdateResponse struct { - StaticMember -} - -// StaticMembersClientDeleteResponse contains the response from method StaticMembersClient.Delete. -type StaticMembersClientDeleteResponse struct { - // placeholder for future response values -} - -// StaticMembersClientGetResponse contains the response from method StaticMembersClient.Get. -type StaticMembersClientGetResponse struct { - StaticMember -} - -// StaticMembersClientListResponse contains the response from method StaticMembersClient.List. -type StaticMembersClientListResponse struct { - StaticMemberListResult -} - -// SubnetsClientCreateOrUpdateResponse contains the response from method SubnetsClient.CreateOrUpdate. -type SubnetsClientCreateOrUpdateResponse struct { - Subnet -} - -// SubnetsClientDeleteResponse contains the response from method SubnetsClient.Delete. -type SubnetsClientDeleteResponse struct { - // placeholder for future response values -} - -// SubnetsClientGetResponse contains the response from method SubnetsClient.Get. -type SubnetsClientGetResponse struct { - Subnet -} - -// SubnetsClientListResponse contains the response from method SubnetsClient.List. -type SubnetsClientListResponse struct { - SubnetListResult -} - -// SubnetsClientPrepareNetworkPoliciesResponse contains the response from method SubnetsClient.PrepareNetworkPolicies. -type SubnetsClientPrepareNetworkPoliciesResponse struct { - // placeholder for future response values -} - -// SubnetsClientUnprepareNetworkPoliciesResponse contains the response from method SubnetsClient.UnprepareNetworkPolicies. -type SubnetsClientUnprepareNetworkPoliciesResponse struct { - // placeholder for future response values -} - -// SubscriptionNetworkManagerConnectionsClientCreateOrUpdateResponse contains the response from method SubscriptionNetworkManagerConnectionsClient.CreateOrUpdate. -type SubscriptionNetworkManagerConnectionsClientCreateOrUpdateResponse struct { - ManagerConnection -} - -// SubscriptionNetworkManagerConnectionsClientDeleteResponse contains the response from method SubscriptionNetworkManagerConnectionsClient.Delete. -type SubscriptionNetworkManagerConnectionsClientDeleteResponse struct { - // placeholder for future response values -} - -// SubscriptionNetworkManagerConnectionsClientGetResponse contains the response from method SubscriptionNetworkManagerConnectionsClient.Get. -type SubscriptionNetworkManagerConnectionsClientGetResponse struct { - ManagerConnection -} - -// SubscriptionNetworkManagerConnectionsClientListResponse contains the response from method SubscriptionNetworkManagerConnectionsClient.List. -type SubscriptionNetworkManagerConnectionsClientListResponse struct { - ManagerConnectionListResult -} - -// UsagesClientListResponse contains the response from method UsagesClient.List. -type UsagesClientListResponse struct { - UsagesListResult -} - -// VPNConnectionsClientCreateOrUpdateResponse contains the response from method VPNConnectionsClient.CreateOrUpdate. -type VPNConnectionsClientCreateOrUpdateResponse struct { - VPNConnection -} - -// VPNConnectionsClientDeleteResponse contains the response from method VPNConnectionsClient.Delete. -type VPNConnectionsClientDeleteResponse struct { - // placeholder for future response values -} - -// VPNConnectionsClientGetResponse contains the response from method VPNConnectionsClient.Get. -type VPNConnectionsClientGetResponse struct { - VPNConnection -} - -// VPNConnectionsClientListByVPNGatewayResponse contains the response from method VPNConnectionsClient.ListByVPNGateway. -type VPNConnectionsClientListByVPNGatewayResponse struct { - ListVPNConnectionsResult -} - -// VPNConnectionsClientStartPacketCaptureResponse contains the response from method VPNConnectionsClient.StartPacketCapture. -type VPNConnectionsClientStartPacketCaptureResponse struct { - Value *string -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VPNConnectionsClientStartPacketCaptureResponse. -func (v *VPNConnectionsClientStartPacketCaptureResponse) UnmarshalJSON(data []byte) error { - return json.Unmarshal(data, &v.Value) -} - -// VPNConnectionsClientStopPacketCaptureResponse contains the response from method VPNConnectionsClient.StopPacketCapture. -type VPNConnectionsClientStopPacketCaptureResponse struct { - Value *string -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VPNConnectionsClientStopPacketCaptureResponse. -func (v *VPNConnectionsClientStopPacketCaptureResponse) UnmarshalJSON(data []byte) error { - return json.Unmarshal(data, &v.Value) -} - -// VPNGatewaysClientCreateOrUpdateResponse contains the response from method VPNGatewaysClient.CreateOrUpdate. -type VPNGatewaysClientCreateOrUpdateResponse struct { - VPNGateway -} - -// VPNGatewaysClientDeleteResponse contains the response from method VPNGatewaysClient.Delete. -type VPNGatewaysClientDeleteResponse struct { - // placeholder for future response values -} - -// VPNGatewaysClientGetResponse contains the response from method VPNGatewaysClient.Get. -type VPNGatewaysClientGetResponse struct { - VPNGateway -} - -// VPNGatewaysClientListByResourceGroupResponse contains the response from method VPNGatewaysClient.ListByResourceGroup. -type VPNGatewaysClientListByResourceGroupResponse struct { - ListVPNGatewaysResult -} - -// VPNGatewaysClientListResponse contains the response from method VPNGatewaysClient.List. -type VPNGatewaysClientListResponse struct { - ListVPNGatewaysResult -} - -// VPNGatewaysClientResetResponse contains the response from method VPNGatewaysClient.Reset. -type VPNGatewaysClientResetResponse struct { - VPNGateway -} - -// VPNGatewaysClientStartPacketCaptureResponse contains the response from method VPNGatewaysClient.StartPacketCapture. -type VPNGatewaysClientStartPacketCaptureResponse struct { - Value *string -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VPNGatewaysClientStartPacketCaptureResponse. -func (v *VPNGatewaysClientStartPacketCaptureResponse) UnmarshalJSON(data []byte) error { - return json.Unmarshal(data, &v.Value) -} - -// VPNGatewaysClientStopPacketCaptureResponse contains the response from method VPNGatewaysClient.StopPacketCapture. -type VPNGatewaysClientStopPacketCaptureResponse struct { - Value *string -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VPNGatewaysClientStopPacketCaptureResponse. -func (v *VPNGatewaysClientStopPacketCaptureResponse) UnmarshalJSON(data []byte) error { - return json.Unmarshal(data, &v.Value) -} - -// VPNGatewaysClientUpdateTagsResponse contains the response from method VPNGatewaysClient.UpdateTags. -type VPNGatewaysClientUpdateTagsResponse struct { - VPNGateway -} - -// VPNLinkConnectionsClientGetIkeSasResponse contains the response from method VPNLinkConnectionsClient.GetIkeSas. -type VPNLinkConnectionsClientGetIkeSasResponse struct { - Value *string -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VPNLinkConnectionsClientGetIkeSasResponse. -func (v *VPNLinkConnectionsClientGetIkeSasResponse) UnmarshalJSON(data []byte) error { - return json.Unmarshal(data, &v.Value) -} - -// VPNLinkConnectionsClientListByVPNConnectionResponse contains the response from method VPNLinkConnectionsClient.ListByVPNConnection. -type VPNLinkConnectionsClientListByVPNConnectionResponse struct { - ListVPNSiteLinkConnectionsResult -} - -// VPNLinkConnectionsClientResetConnectionResponse contains the response from method VPNLinkConnectionsClient.ResetConnection. -type VPNLinkConnectionsClientResetConnectionResponse struct { - // placeholder for future response values -} - -// VPNServerConfigurationsAssociatedWithVirtualWanClientListResponse contains the response from method VPNServerConfigurationsAssociatedWithVirtualWanClient.List. -type VPNServerConfigurationsAssociatedWithVirtualWanClientListResponse struct { - VPNServerConfigurationsResponse -} - -// VPNServerConfigurationsClientCreateOrUpdateResponse contains the response from method VPNServerConfigurationsClient.CreateOrUpdate. -type VPNServerConfigurationsClientCreateOrUpdateResponse struct { - VPNServerConfiguration -} - -// VPNServerConfigurationsClientDeleteResponse contains the response from method VPNServerConfigurationsClient.Delete. -type VPNServerConfigurationsClientDeleteResponse struct { - // placeholder for future response values -} - -// VPNServerConfigurationsClientGetResponse contains the response from method VPNServerConfigurationsClient.Get. -type VPNServerConfigurationsClientGetResponse struct { - VPNServerConfiguration -} - -// VPNServerConfigurationsClientListByResourceGroupResponse contains the response from method VPNServerConfigurationsClient.ListByResourceGroup. -type VPNServerConfigurationsClientListByResourceGroupResponse struct { - ListVPNServerConfigurationsResult -} - -// VPNServerConfigurationsClientListResponse contains the response from method VPNServerConfigurationsClient.List. -type VPNServerConfigurationsClientListResponse struct { - ListVPNServerConfigurationsResult -} - -// VPNServerConfigurationsClientUpdateTagsResponse contains the response from method VPNServerConfigurationsClient.UpdateTags. -type VPNServerConfigurationsClientUpdateTagsResponse struct { - VPNServerConfiguration -} - -// VPNSiteLinkConnectionsClientGetResponse contains the response from method VPNSiteLinkConnectionsClient.Get. -type VPNSiteLinkConnectionsClientGetResponse struct { - VPNSiteLinkConnection -} - -// VPNSiteLinksClientGetResponse contains the response from method VPNSiteLinksClient.Get. -type VPNSiteLinksClientGetResponse struct { - VPNSiteLink -} - -// VPNSiteLinksClientListByVPNSiteResponse contains the response from method VPNSiteLinksClient.ListByVPNSite. -type VPNSiteLinksClientListByVPNSiteResponse struct { - ListVPNSiteLinksResult -} - -// VPNSitesClientCreateOrUpdateResponse contains the response from method VPNSitesClient.CreateOrUpdate. -type VPNSitesClientCreateOrUpdateResponse struct { - VPNSite -} - -// VPNSitesClientDeleteResponse contains the response from method VPNSitesClient.Delete. -type VPNSitesClientDeleteResponse struct { - // placeholder for future response values -} - -// VPNSitesClientGetResponse contains the response from method VPNSitesClient.Get. -type VPNSitesClientGetResponse struct { - VPNSite -} - -// VPNSitesClientListByResourceGroupResponse contains the response from method VPNSitesClient.ListByResourceGroup. -type VPNSitesClientListByResourceGroupResponse struct { - ListVPNSitesResult -} - -// VPNSitesClientListResponse contains the response from method VPNSitesClient.List. -type VPNSitesClientListResponse struct { - ListVPNSitesResult -} - -// VPNSitesClientUpdateTagsResponse contains the response from method VPNSitesClient.UpdateTags. -type VPNSitesClientUpdateTagsResponse struct { - VPNSite -} - -// VPNSitesConfigurationClientDownloadResponse contains the response from method VPNSitesConfigurationClient.Download. -type VPNSitesConfigurationClientDownloadResponse struct { - // placeholder for future response values -} - -// VirtualApplianceSKUsClientGetResponse contains the response from method VirtualApplianceSKUsClient.Get. -type VirtualApplianceSKUsClientGetResponse struct { - VirtualApplianceSKU -} - -// VirtualApplianceSKUsClientListResponse contains the response from method VirtualApplianceSKUsClient.List. -type VirtualApplianceSKUsClientListResponse struct { - VirtualApplianceSKUListResult -} - -// VirtualApplianceSitesClientCreateOrUpdateResponse contains the response from method VirtualApplianceSitesClient.CreateOrUpdate. -type VirtualApplianceSitesClientCreateOrUpdateResponse struct { - VirtualApplianceSite -} - -// VirtualApplianceSitesClientDeleteResponse contains the response from method VirtualApplianceSitesClient.Delete. -type VirtualApplianceSitesClientDeleteResponse struct { - // placeholder for future response values -} - -// VirtualApplianceSitesClientGetResponse contains the response from method VirtualApplianceSitesClient.Get. -type VirtualApplianceSitesClientGetResponse struct { - VirtualApplianceSite -} - -// VirtualApplianceSitesClientListResponse contains the response from method VirtualApplianceSitesClient.List. -type VirtualApplianceSitesClientListResponse struct { - VirtualApplianceSiteListResult -} - -// VirtualAppliancesClientCreateOrUpdateResponse contains the response from method VirtualAppliancesClient.CreateOrUpdate. -type VirtualAppliancesClientCreateOrUpdateResponse struct { - VirtualAppliance -} - -// VirtualAppliancesClientDeleteResponse contains the response from method VirtualAppliancesClient.Delete. -type VirtualAppliancesClientDeleteResponse struct { - // placeholder for future response values -} - -// VirtualAppliancesClientGetResponse contains the response from method VirtualAppliancesClient.Get. -type VirtualAppliancesClientGetResponse struct { - VirtualAppliance -} - -// VirtualAppliancesClientListByResourceGroupResponse contains the response from method VirtualAppliancesClient.ListByResourceGroup. -type VirtualAppliancesClientListByResourceGroupResponse struct { - VirtualApplianceListResult -} - -// VirtualAppliancesClientListResponse contains the response from method VirtualAppliancesClient.List. -type VirtualAppliancesClientListResponse struct { - VirtualApplianceListResult -} - -// VirtualAppliancesClientUpdateTagsResponse contains the response from method VirtualAppliancesClient.UpdateTags. -type VirtualAppliancesClientUpdateTagsResponse struct { - VirtualAppliance -} - -// VirtualHubBgpConnectionClientCreateOrUpdateResponse contains the response from method VirtualHubBgpConnectionClient.CreateOrUpdate. -type VirtualHubBgpConnectionClientCreateOrUpdateResponse struct { - BgpConnection -} - -// VirtualHubBgpConnectionClientDeleteResponse contains the response from method VirtualHubBgpConnectionClient.Delete. -type VirtualHubBgpConnectionClientDeleteResponse struct { - // placeholder for future response values -} - -// VirtualHubBgpConnectionClientGetResponse contains the response from method VirtualHubBgpConnectionClient.Get. -type VirtualHubBgpConnectionClientGetResponse struct { - BgpConnection -} - -// VirtualHubBgpConnectionsClientListAdvertisedRoutesResponse contains the response from method VirtualHubBgpConnectionsClient.ListAdvertisedRoutes. -type VirtualHubBgpConnectionsClientListAdvertisedRoutesResponse struct { - PeerRouteList -} - -// VirtualHubBgpConnectionsClientListLearnedRoutesResponse contains the response from method VirtualHubBgpConnectionsClient.ListLearnedRoutes. -type VirtualHubBgpConnectionsClientListLearnedRoutesResponse struct { - PeerRouteList -} - -// VirtualHubBgpConnectionsClientListResponse contains the response from method VirtualHubBgpConnectionsClient.List. -type VirtualHubBgpConnectionsClientListResponse struct { - ListVirtualHubBgpConnectionResults -} - -// VirtualHubIPConfigurationClientCreateOrUpdateResponse contains the response from method VirtualHubIPConfigurationClient.CreateOrUpdate. -type VirtualHubIPConfigurationClientCreateOrUpdateResponse struct { - HubIPConfiguration -} - -// VirtualHubIPConfigurationClientDeleteResponse contains the response from method VirtualHubIPConfigurationClient.Delete. -type VirtualHubIPConfigurationClientDeleteResponse struct { - // placeholder for future response values -} - -// VirtualHubIPConfigurationClientGetResponse contains the response from method VirtualHubIPConfigurationClient.Get. -type VirtualHubIPConfigurationClientGetResponse struct { - HubIPConfiguration -} - -// VirtualHubIPConfigurationClientListResponse contains the response from method VirtualHubIPConfigurationClient.List. -type VirtualHubIPConfigurationClientListResponse struct { - ListVirtualHubIPConfigurationResults -} - -// VirtualHubRouteTableV2SClientCreateOrUpdateResponse contains the response from method VirtualHubRouteTableV2SClient.CreateOrUpdate. -type VirtualHubRouteTableV2SClientCreateOrUpdateResponse struct { - VirtualHubRouteTableV2 -} - -// VirtualHubRouteTableV2SClientDeleteResponse contains the response from method VirtualHubRouteTableV2SClient.Delete. -type VirtualHubRouteTableV2SClientDeleteResponse struct { - // placeholder for future response values -} - -// VirtualHubRouteTableV2SClientGetResponse contains the response from method VirtualHubRouteTableV2SClient.Get. -type VirtualHubRouteTableV2SClientGetResponse struct { - VirtualHubRouteTableV2 -} - -// VirtualHubRouteTableV2SClientListResponse contains the response from method VirtualHubRouteTableV2SClient.List. -type VirtualHubRouteTableV2SClientListResponse struct { - ListVirtualHubRouteTableV2SResult -} - -// VirtualHubsClientCreateOrUpdateResponse contains the response from method VirtualHubsClient.CreateOrUpdate. -type VirtualHubsClientCreateOrUpdateResponse struct { - VirtualHub -} - -// VirtualHubsClientDeleteResponse contains the response from method VirtualHubsClient.Delete. -type VirtualHubsClientDeleteResponse struct { - // placeholder for future response values -} - -// VirtualHubsClientGetEffectiveVirtualHubRoutesResponse contains the response from method VirtualHubsClient.GetEffectiveVirtualHubRoutes. -type VirtualHubsClientGetEffectiveVirtualHubRoutesResponse struct { - // placeholder for future response values -} - -// VirtualHubsClientGetResponse contains the response from method VirtualHubsClient.Get. -type VirtualHubsClientGetResponse struct { - VirtualHub -} - -// VirtualHubsClientListByResourceGroupResponse contains the response from method VirtualHubsClient.ListByResourceGroup. -type VirtualHubsClientListByResourceGroupResponse struct { - ListVirtualHubsResult -} - -// VirtualHubsClientListResponse contains the response from method VirtualHubsClient.List. -type VirtualHubsClientListResponse struct { - ListVirtualHubsResult -} - -// VirtualHubsClientUpdateTagsResponse contains the response from method VirtualHubsClient.UpdateTags. -type VirtualHubsClientUpdateTagsResponse struct { - VirtualHub -} - -// VirtualNetworkGatewayConnectionsClientCreateOrUpdateResponse contains the response from method VirtualNetworkGatewayConnectionsClient.CreateOrUpdate. -type VirtualNetworkGatewayConnectionsClientCreateOrUpdateResponse struct { - VirtualNetworkGatewayConnection -} - -// VirtualNetworkGatewayConnectionsClientDeleteResponse contains the response from method VirtualNetworkGatewayConnectionsClient.Delete. -type VirtualNetworkGatewayConnectionsClientDeleteResponse struct { - // placeholder for future response values -} - -// VirtualNetworkGatewayConnectionsClientGetIkeSasResponse contains the response from method VirtualNetworkGatewayConnectionsClient.GetIkeSas. -type VirtualNetworkGatewayConnectionsClientGetIkeSasResponse struct { - Value *string -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewayConnectionsClientGetIkeSasResponse. -func (v *VirtualNetworkGatewayConnectionsClientGetIkeSasResponse) UnmarshalJSON(data []byte) error { - return json.Unmarshal(data, &v.Value) -} - -// VirtualNetworkGatewayConnectionsClientGetResponse contains the response from method VirtualNetworkGatewayConnectionsClient.Get. -type VirtualNetworkGatewayConnectionsClientGetResponse struct { - VirtualNetworkGatewayConnection -} - -// VirtualNetworkGatewayConnectionsClientGetSharedKeyResponse contains the response from method VirtualNetworkGatewayConnectionsClient.GetSharedKey. -type VirtualNetworkGatewayConnectionsClientGetSharedKeyResponse struct { - ConnectionSharedKey -} - -// VirtualNetworkGatewayConnectionsClientListResponse contains the response from method VirtualNetworkGatewayConnectionsClient.List. -type VirtualNetworkGatewayConnectionsClientListResponse struct { - VirtualNetworkGatewayConnectionListResult -} - -// VirtualNetworkGatewayConnectionsClientResetConnectionResponse contains the response from method VirtualNetworkGatewayConnectionsClient.ResetConnection. -type VirtualNetworkGatewayConnectionsClientResetConnectionResponse struct { - // placeholder for future response values -} - -// VirtualNetworkGatewayConnectionsClientResetSharedKeyResponse contains the response from method VirtualNetworkGatewayConnectionsClient.ResetSharedKey. -type VirtualNetworkGatewayConnectionsClientResetSharedKeyResponse struct { - ConnectionResetSharedKey -} - -// VirtualNetworkGatewayConnectionsClientSetSharedKeyResponse contains the response from method VirtualNetworkGatewayConnectionsClient.SetSharedKey. -type VirtualNetworkGatewayConnectionsClientSetSharedKeyResponse struct { - ConnectionSharedKey -} - -// VirtualNetworkGatewayConnectionsClientStartPacketCaptureResponse contains the response from method VirtualNetworkGatewayConnectionsClient.StartPacketCapture. -type VirtualNetworkGatewayConnectionsClientStartPacketCaptureResponse struct { - Value *string -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewayConnectionsClientStartPacketCaptureResponse. -func (v *VirtualNetworkGatewayConnectionsClientStartPacketCaptureResponse) UnmarshalJSON(data []byte) error { - return json.Unmarshal(data, &v.Value) -} - -// VirtualNetworkGatewayConnectionsClientStopPacketCaptureResponse contains the response from method VirtualNetworkGatewayConnectionsClient.StopPacketCapture. -type VirtualNetworkGatewayConnectionsClientStopPacketCaptureResponse struct { - Value *string -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewayConnectionsClientStopPacketCaptureResponse. -func (v *VirtualNetworkGatewayConnectionsClientStopPacketCaptureResponse) UnmarshalJSON(data []byte) error { - return json.Unmarshal(data, &v.Value) -} - -// VirtualNetworkGatewayConnectionsClientUpdateTagsResponse contains the response from method VirtualNetworkGatewayConnectionsClient.UpdateTags. -type VirtualNetworkGatewayConnectionsClientUpdateTagsResponse struct { - VirtualNetworkGatewayConnection -} - -// VirtualNetworkGatewayNatRulesClientCreateOrUpdateResponse contains the response from method VirtualNetworkGatewayNatRulesClient.CreateOrUpdate. -type VirtualNetworkGatewayNatRulesClientCreateOrUpdateResponse struct { - VirtualNetworkGatewayNatRule -} - -// VirtualNetworkGatewayNatRulesClientDeleteResponse contains the response from method VirtualNetworkGatewayNatRulesClient.Delete. -type VirtualNetworkGatewayNatRulesClientDeleteResponse struct { - // placeholder for future response values -} - -// VirtualNetworkGatewayNatRulesClientGetResponse contains the response from method VirtualNetworkGatewayNatRulesClient.Get. -type VirtualNetworkGatewayNatRulesClientGetResponse struct { - VirtualNetworkGatewayNatRule -} - -// VirtualNetworkGatewayNatRulesClientListByVirtualNetworkGatewayResponse contains the response from method VirtualNetworkGatewayNatRulesClient.ListByVirtualNetworkGateway. -type VirtualNetworkGatewayNatRulesClientListByVirtualNetworkGatewayResponse struct { - ListVirtualNetworkGatewayNatRulesResult -} - -// VirtualNetworkGatewaysClientCreateOrUpdateResponse contains the response from method VirtualNetworkGatewaysClient.CreateOrUpdate. -type VirtualNetworkGatewaysClientCreateOrUpdateResponse struct { - VirtualNetworkGateway -} - -// VirtualNetworkGatewaysClientDeleteResponse contains the response from method VirtualNetworkGatewaysClient.Delete. -type VirtualNetworkGatewaysClientDeleteResponse struct { - // placeholder for future response values -} - -// VirtualNetworkGatewaysClientDisconnectVirtualNetworkGatewayVPNConnectionsResponse contains the response from method VirtualNetworkGatewaysClient.DisconnectVirtualNetworkGatewayVPNConnections. -type VirtualNetworkGatewaysClientDisconnectVirtualNetworkGatewayVPNConnectionsResponse struct { - // placeholder for future response values -} - -// VirtualNetworkGatewaysClientGenerateVPNProfileResponse contains the response from method VirtualNetworkGatewaysClient.GenerateVPNProfile. -type VirtualNetworkGatewaysClientGenerateVPNProfileResponse struct { - Value *string -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewaysClientGenerateVPNProfileResponse. -func (v *VirtualNetworkGatewaysClientGenerateVPNProfileResponse) UnmarshalJSON(data []byte) error { - return json.Unmarshal(data, &v.Value) -} - -// VirtualNetworkGatewaysClientGeneratevpnclientpackageResponse contains the response from method VirtualNetworkGatewaysClient.Generatevpnclientpackage. -type VirtualNetworkGatewaysClientGeneratevpnclientpackageResponse struct { - Value *string -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewaysClientGeneratevpnclientpackageResponse. -func (v *VirtualNetworkGatewaysClientGeneratevpnclientpackageResponse) UnmarshalJSON(data []byte) error { - return json.Unmarshal(data, &v.Value) -} - -// VirtualNetworkGatewaysClientGetAdvertisedRoutesResponse contains the response from method VirtualNetworkGatewaysClient.GetAdvertisedRoutes. -type VirtualNetworkGatewaysClientGetAdvertisedRoutesResponse struct { - GatewayRouteListResult -} - -// VirtualNetworkGatewaysClientGetBgpPeerStatusResponse contains the response from method VirtualNetworkGatewaysClient.GetBgpPeerStatus. -type VirtualNetworkGatewaysClientGetBgpPeerStatusResponse struct { - BgpPeerStatusListResult -} - -// VirtualNetworkGatewaysClientGetLearnedRoutesResponse contains the response from method VirtualNetworkGatewaysClient.GetLearnedRoutes. -type VirtualNetworkGatewaysClientGetLearnedRoutesResponse struct { - GatewayRouteListResult -} - -// VirtualNetworkGatewaysClientGetResponse contains the response from method VirtualNetworkGatewaysClient.Get. -type VirtualNetworkGatewaysClientGetResponse struct { - VirtualNetworkGateway -} - -// VirtualNetworkGatewaysClientGetVPNProfilePackageURLResponse contains the response from method VirtualNetworkGatewaysClient.GetVPNProfilePackageURL. -type VirtualNetworkGatewaysClientGetVPNProfilePackageURLResponse struct { - Value *string -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewaysClientGetVPNProfilePackageURLResponse. -func (v *VirtualNetworkGatewaysClientGetVPNProfilePackageURLResponse) UnmarshalJSON(data []byte) error { - return json.Unmarshal(data, &v.Value) -} - -// VirtualNetworkGatewaysClientGetVpnclientConnectionHealthResponse contains the response from method VirtualNetworkGatewaysClient.GetVpnclientConnectionHealth. -type VirtualNetworkGatewaysClientGetVpnclientConnectionHealthResponse struct { - VPNClientConnectionHealthDetailListResult -} - -// VirtualNetworkGatewaysClientGetVpnclientIPSecParametersResponse contains the response from method VirtualNetworkGatewaysClient.GetVpnclientIPSecParameters. -type VirtualNetworkGatewaysClientGetVpnclientIPSecParametersResponse struct { - VPNClientIPsecParameters -} - -// VirtualNetworkGatewaysClientListConnectionsResponse contains the response from method VirtualNetworkGatewaysClient.ListConnections. -type VirtualNetworkGatewaysClientListConnectionsResponse struct { - VirtualNetworkGatewayListConnectionsResult -} - -// VirtualNetworkGatewaysClientListResponse contains the response from method VirtualNetworkGatewaysClient.List. -type VirtualNetworkGatewaysClientListResponse struct { - VirtualNetworkGatewayListResult -} - -// VirtualNetworkGatewaysClientResetResponse contains the response from method VirtualNetworkGatewaysClient.Reset. -type VirtualNetworkGatewaysClientResetResponse struct { - VirtualNetworkGateway -} - -// VirtualNetworkGatewaysClientResetVPNClientSharedKeyResponse contains the response from method VirtualNetworkGatewaysClient.ResetVPNClientSharedKey. -type VirtualNetworkGatewaysClientResetVPNClientSharedKeyResponse struct { - // placeholder for future response values -} - -// VirtualNetworkGatewaysClientSetVpnclientIPSecParametersResponse contains the response from method VirtualNetworkGatewaysClient.SetVpnclientIPSecParameters. -type VirtualNetworkGatewaysClientSetVpnclientIPSecParametersResponse struct { - VPNClientIPsecParameters -} - -// VirtualNetworkGatewaysClientStartPacketCaptureResponse contains the response from method VirtualNetworkGatewaysClient.StartPacketCapture. -type VirtualNetworkGatewaysClientStartPacketCaptureResponse struct { - Value *string -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewaysClientStartPacketCaptureResponse. -func (v *VirtualNetworkGatewaysClientStartPacketCaptureResponse) UnmarshalJSON(data []byte) error { - return json.Unmarshal(data, &v.Value) -} - -// VirtualNetworkGatewaysClientStopPacketCaptureResponse contains the response from method VirtualNetworkGatewaysClient.StopPacketCapture. -type VirtualNetworkGatewaysClientStopPacketCaptureResponse struct { - Value *string -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewaysClientStopPacketCaptureResponse. -func (v *VirtualNetworkGatewaysClientStopPacketCaptureResponse) UnmarshalJSON(data []byte) error { - return json.Unmarshal(data, &v.Value) -} - -// VirtualNetworkGatewaysClientSupportedVPNDevicesResponse contains the response from method VirtualNetworkGatewaysClient.SupportedVPNDevices. -type VirtualNetworkGatewaysClientSupportedVPNDevicesResponse struct { - Value *string -} - -// VirtualNetworkGatewaysClientUpdateTagsResponse contains the response from method VirtualNetworkGatewaysClient.UpdateTags. -type VirtualNetworkGatewaysClientUpdateTagsResponse struct { - VirtualNetworkGateway -} - -// VirtualNetworkGatewaysClientVPNDeviceConfigurationScriptResponse contains the response from method VirtualNetworkGatewaysClient.VPNDeviceConfigurationScript. -type VirtualNetworkGatewaysClientVPNDeviceConfigurationScriptResponse struct { - Value *string -} - -// VirtualNetworkPeeringsClientCreateOrUpdateResponse contains the response from method VirtualNetworkPeeringsClient.CreateOrUpdate. -type VirtualNetworkPeeringsClientCreateOrUpdateResponse struct { - VirtualNetworkPeering -} - -// VirtualNetworkPeeringsClientDeleteResponse contains the response from method VirtualNetworkPeeringsClient.Delete. -type VirtualNetworkPeeringsClientDeleteResponse struct { - // placeholder for future response values -} - -// VirtualNetworkPeeringsClientGetResponse contains the response from method VirtualNetworkPeeringsClient.Get. -type VirtualNetworkPeeringsClientGetResponse struct { - VirtualNetworkPeering -} - -// VirtualNetworkPeeringsClientListResponse contains the response from method VirtualNetworkPeeringsClient.List. -type VirtualNetworkPeeringsClientListResponse struct { - VirtualNetworkPeeringListResult -} - -// VirtualNetworkTapsClientCreateOrUpdateResponse contains the response from method VirtualNetworkTapsClient.CreateOrUpdate. -type VirtualNetworkTapsClientCreateOrUpdateResponse struct { - VirtualNetworkTap -} - -// VirtualNetworkTapsClientDeleteResponse contains the response from method VirtualNetworkTapsClient.Delete. -type VirtualNetworkTapsClientDeleteResponse struct { - // placeholder for future response values -} - -// VirtualNetworkTapsClientGetResponse contains the response from method VirtualNetworkTapsClient.Get. -type VirtualNetworkTapsClientGetResponse struct { - VirtualNetworkTap -} - -// VirtualNetworkTapsClientListAllResponse contains the response from method VirtualNetworkTapsClient.ListAll. -type VirtualNetworkTapsClientListAllResponse struct { - VirtualNetworkTapListResult -} - -// VirtualNetworkTapsClientListByResourceGroupResponse contains the response from method VirtualNetworkTapsClient.ListByResourceGroup. -type VirtualNetworkTapsClientListByResourceGroupResponse struct { - VirtualNetworkTapListResult -} - -// VirtualNetworkTapsClientUpdateTagsResponse contains the response from method VirtualNetworkTapsClient.UpdateTags. -type VirtualNetworkTapsClientUpdateTagsResponse struct { - VirtualNetworkTap -} - -// VirtualNetworksClientCheckIPAddressAvailabilityResponse contains the response from method VirtualNetworksClient.CheckIPAddressAvailability. -type VirtualNetworksClientCheckIPAddressAvailabilityResponse struct { - IPAddressAvailabilityResult -} - -// VirtualNetworksClientCreateOrUpdateResponse contains the response from method VirtualNetworksClient.CreateOrUpdate. -type VirtualNetworksClientCreateOrUpdateResponse struct { - VirtualNetwork -} - -// VirtualNetworksClientDeleteResponse contains the response from method VirtualNetworksClient.Delete. -type VirtualNetworksClientDeleteResponse struct { - // placeholder for future response values -} - -// VirtualNetworksClientGetResponse contains the response from method VirtualNetworksClient.Get. -type VirtualNetworksClientGetResponse struct { - VirtualNetwork -} - -// VirtualNetworksClientListAllResponse contains the response from method VirtualNetworksClient.ListAll. -type VirtualNetworksClientListAllResponse struct { - VirtualNetworkListResult -} - -// VirtualNetworksClientListResponse contains the response from method VirtualNetworksClient.List. -type VirtualNetworksClientListResponse struct { - VirtualNetworkListResult -} - -// VirtualNetworksClientListUsageResponse contains the response from method VirtualNetworksClient.ListUsage. -type VirtualNetworksClientListUsageResponse struct { - VirtualNetworkListUsageResult -} - -// VirtualNetworksClientUpdateTagsResponse contains the response from method VirtualNetworksClient.UpdateTags. -type VirtualNetworksClientUpdateTagsResponse struct { - VirtualNetwork -} - -// VirtualRouterPeeringsClientCreateOrUpdateResponse contains the response from method VirtualRouterPeeringsClient.CreateOrUpdate. -type VirtualRouterPeeringsClientCreateOrUpdateResponse struct { - VirtualRouterPeering -} - -// VirtualRouterPeeringsClientDeleteResponse contains the response from method VirtualRouterPeeringsClient.Delete. -type VirtualRouterPeeringsClientDeleteResponse struct { - // placeholder for future response values -} - -// VirtualRouterPeeringsClientGetResponse contains the response from method VirtualRouterPeeringsClient.Get. -type VirtualRouterPeeringsClientGetResponse struct { - VirtualRouterPeering -} - -// VirtualRouterPeeringsClientListResponse contains the response from method VirtualRouterPeeringsClient.List. -type VirtualRouterPeeringsClientListResponse struct { - VirtualRouterPeeringListResult -} - -// VirtualRoutersClientCreateOrUpdateResponse contains the response from method VirtualRoutersClient.CreateOrUpdate. -type VirtualRoutersClientCreateOrUpdateResponse struct { - VirtualRouter -} - -// VirtualRoutersClientDeleteResponse contains the response from method VirtualRoutersClient.Delete. -type VirtualRoutersClientDeleteResponse struct { - // placeholder for future response values -} - -// VirtualRoutersClientGetResponse contains the response from method VirtualRoutersClient.Get. -type VirtualRoutersClientGetResponse struct { - VirtualRouter -} - -// VirtualRoutersClientListByResourceGroupResponse contains the response from method VirtualRoutersClient.ListByResourceGroup. -type VirtualRoutersClientListByResourceGroupResponse struct { - VirtualRouterListResult -} - -// VirtualRoutersClientListResponse contains the response from method VirtualRoutersClient.List. -type VirtualRoutersClientListResponse struct { - VirtualRouterListResult -} - -// VirtualWansClientCreateOrUpdateResponse contains the response from method VirtualWansClient.CreateOrUpdate. -type VirtualWansClientCreateOrUpdateResponse struct { - VirtualWAN -} - -// VirtualWansClientDeleteResponse contains the response from method VirtualWansClient.Delete. -type VirtualWansClientDeleteResponse struct { - // placeholder for future response values -} - -// VirtualWansClientGetResponse contains the response from method VirtualWansClient.Get. -type VirtualWansClientGetResponse struct { - VirtualWAN -} - -// VirtualWansClientListByResourceGroupResponse contains the response from method VirtualWansClient.ListByResourceGroup. -type VirtualWansClientListByResourceGroupResponse struct { - ListVirtualWANsResult -} - -// VirtualWansClientListResponse contains the response from method VirtualWansClient.List. -type VirtualWansClientListResponse struct { - ListVirtualWANsResult -} - -// VirtualWansClientUpdateTagsResponse contains the response from method VirtualWansClient.UpdateTags. -type VirtualWansClientUpdateTagsResponse struct { - VirtualWAN -} - -// WatchersClientCheckConnectivityResponse contains the response from method WatchersClient.CheckConnectivity. -type WatchersClientCheckConnectivityResponse struct { - ConnectivityInformation -} - -// WatchersClientCreateOrUpdateResponse contains the response from method WatchersClient.CreateOrUpdate. -type WatchersClientCreateOrUpdateResponse struct { - Watcher -} - -// WatchersClientDeleteResponse contains the response from method WatchersClient.Delete. -type WatchersClientDeleteResponse struct { - // placeholder for future response values -} - -// WatchersClientGetAzureReachabilityReportResponse contains the response from method WatchersClient.GetAzureReachabilityReport. -type WatchersClientGetAzureReachabilityReportResponse struct { - AzureReachabilityReport -} - -// WatchersClientGetFlowLogStatusResponse contains the response from method WatchersClient.GetFlowLogStatus. -type WatchersClientGetFlowLogStatusResponse struct { - FlowLogInformation -} - -// WatchersClientGetNetworkConfigurationDiagnosticResponse contains the response from method WatchersClient.GetNetworkConfigurationDiagnostic. -type WatchersClientGetNetworkConfigurationDiagnosticResponse struct { - ConfigurationDiagnosticResponse -} - -// WatchersClientGetNextHopResponse contains the response from method WatchersClient.GetNextHop. -type WatchersClientGetNextHopResponse struct { - NextHopResult -} - -// WatchersClientGetResponse contains the response from method WatchersClient.Get. -type WatchersClientGetResponse struct { - Watcher -} - -// WatchersClientGetTopologyResponse contains the response from method WatchersClient.GetTopology. -type WatchersClientGetTopologyResponse struct { - Topology -} - -// WatchersClientGetTroubleshootingResponse contains the response from method WatchersClient.GetTroubleshooting. -type WatchersClientGetTroubleshootingResponse struct { - TroubleshootingResult -} - -// WatchersClientGetTroubleshootingResultResponse contains the response from method WatchersClient.GetTroubleshootingResult. -type WatchersClientGetTroubleshootingResultResponse struct { - TroubleshootingResult -} - -// WatchersClientGetVMSecurityRulesResponse contains the response from method WatchersClient.GetVMSecurityRules. -type WatchersClientGetVMSecurityRulesResponse struct { - SecurityGroupViewResult -} - -// WatchersClientListAllResponse contains the response from method WatchersClient.ListAll. -type WatchersClientListAllResponse struct { - WatcherListResult -} - -// WatchersClientListAvailableProvidersResponse contains the response from method WatchersClient.ListAvailableProviders. -type WatchersClientListAvailableProvidersResponse struct { - AvailableProvidersList -} - -// WatchersClientListResponse contains the response from method WatchersClient.List. -type WatchersClientListResponse struct { - WatcherListResult -} - -// WatchersClientSetFlowLogConfigurationResponse contains the response from method WatchersClient.SetFlowLogConfiguration. -type WatchersClientSetFlowLogConfigurationResponse struct { - FlowLogInformation -} - -// WatchersClientUpdateTagsResponse contains the response from method WatchersClient.UpdateTags. -type WatchersClientUpdateTagsResponse struct { - Watcher -} - -// WatchersClientVerifyIPFlowResponse contains the response from method WatchersClient.VerifyIPFlow. -type WatchersClientVerifyIPFlowResponse struct { - VerificationIPFlowResult -} - -// WebApplicationFirewallPoliciesClientCreateOrUpdateResponse contains the response from method WebApplicationFirewallPoliciesClient.CreateOrUpdate. -type WebApplicationFirewallPoliciesClientCreateOrUpdateResponse struct { - WebApplicationFirewallPolicy -} - -// WebApplicationFirewallPoliciesClientDeleteResponse contains the response from method WebApplicationFirewallPoliciesClient.Delete. -type WebApplicationFirewallPoliciesClientDeleteResponse struct { - // placeholder for future response values -} - -// WebApplicationFirewallPoliciesClientGetResponse contains the response from method WebApplicationFirewallPoliciesClient.Get. -type WebApplicationFirewallPoliciesClientGetResponse struct { - WebApplicationFirewallPolicy -} - -// WebApplicationFirewallPoliciesClientListAllResponse contains the response from method WebApplicationFirewallPoliciesClient.ListAll. -type WebApplicationFirewallPoliciesClientListAllResponse struct { - WebApplicationFirewallPolicyListResult -} - -// WebApplicationFirewallPoliciesClientListResponse contains the response from method WebApplicationFirewallPoliciesClient.List. -type WebApplicationFirewallPoliciesClientListResponse struct { - WebApplicationFirewallPolicyListResult -} - -// WebCategoriesClientGetResponse contains the response from method WebCategoriesClient.Get. -type WebCategoriesClientGetResponse struct { - AzureWebCategory -} - -// WebCategoriesClientListBySubscriptionResponse contains the response from method WebCategoriesClient.ListBySubscription. -type WebCategoriesClientListBySubscriptionResponse struct { - AzureWebCategoryListResult -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/routefilterrules_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/routefilterrules_client.go deleted file mode 100644 index 670948ab..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/routefilterrules_client.go +++ /dev/null @@ -1,329 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// RouteFilterRulesClient contains the methods for the RouteFilterRules group. -// Don't use this type directly, use NewRouteFilterRulesClient() instead. -type RouteFilterRulesClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewRouteFilterRulesClient creates a new instance of RouteFilterRulesClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewRouteFilterRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RouteFilterRulesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &RouteFilterRulesClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates a route in the specified route filter. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// routeFilterName - The name of the route filter. -// ruleName - The name of the route filter rule. -// routeFilterRuleParameters - Parameters supplied to the create or update route filter rule operation. -// options - RouteFilterRulesClientBeginCreateOrUpdateOptions contains the optional parameters for the RouteFilterRulesClient.BeginCreateOrUpdate -// method. -func (client *RouteFilterRulesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, routeFilterName string, ruleName string, routeFilterRuleParameters RouteFilterRule, options *RouteFilterRulesClientBeginCreateOrUpdateOptions) (*runtime.Poller[RouteFilterRulesClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[RouteFilterRulesClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[RouteFilterRulesClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates or updates a route in the specified route filter. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *RouteFilterRulesClient) createOrUpdate(ctx context.Context, resourceGroupName string, routeFilterName string, ruleName string, routeFilterRuleParameters RouteFilterRule, options *RouteFilterRulesClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *RouteFilterRulesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, routeFilterName string, ruleName string, routeFilterRuleParameters RouteFilterRule, options *RouteFilterRulesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if routeFilterName == "" { - return nil, errors.New("parameter routeFilterName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{routeFilterName}", url.PathEscape(routeFilterName)) - if ruleName == "" { - return nil, errors.New("parameter ruleName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{ruleName}", url.PathEscape(ruleName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, routeFilterRuleParameters) -} - -// BeginDelete - Deletes the specified rule from a route filter. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// routeFilterName - The name of the route filter. -// ruleName - The name of the rule. -// options - RouteFilterRulesClientBeginDeleteOptions contains the optional parameters for the RouteFilterRulesClient.BeginDelete -// method. -func (client *RouteFilterRulesClient) BeginDelete(ctx context.Context, resourceGroupName string, routeFilterName string, ruleName string, options *RouteFilterRulesClientBeginDeleteOptions) (*runtime.Poller[RouteFilterRulesClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, routeFilterName, ruleName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[RouteFilterRulesClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[RouteFilterRulesClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes the specified rule from a route filter. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *RouteFilterRulesClient) deleteOperation(ctx context.Context, resourceGroupName string, routeFilterName string, ruleName string, options *RouteFilterRulesClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, routeFilterName, ruleName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *RouteFilterRulesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, routeFilterName string, ruleName string, options *RouteFilterRulesClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if routeFilterName == "" { - return nil, errors.New("parameter routeFilterName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{routeFilterName}", url.PathEscape(routeFilterName)) - if ruleName == "" { - return nil, errors.New("parameter ruleName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{ruleName}", url.PathEscape(ruleName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets the specified rule from a route filter. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// routeFilterName - The name of the route filter. -// ruleName - The name of the rule. -// options - RouteFilterRulesClientGetOptions contains the optional parameters for the RouteFilterRulesClient.Get method. -func (client *RouteFilterRulesClient) Get(ctx context.Context, resourceGroupName string, routeFilterName string, ruleName string, options *RouteFilterRulesClientGetOptions) (RouteFilterRulesClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, routeFilterName, ruleName, options) - if err != nil { - return RouteFilterRulesClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return RouteFilterRulesClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return RouteFilterRulesClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *RouteFilterRulesClient) getCreateRequest(ctx context.Context, resourceGroupName string, routeFilterName string, ruleName string, options *RouteFilterRulesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if routeFilterName == "" { - return nil, errors.New("parameter routeFilterName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{routeFilterName}", url.PathEscape(routeFilterName)) - if ruleName == "" { - return nil, errors.New("parameter ruleName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{ruleName}", url.PathEscape(ruleName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *RouteFilterRulesClient) getHandleResponse(resp *http.Response) (RouteFilterRulesClientGetResponse, error) { - result := RouteFilterRulesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RouteFilterRule); err != nil { - return RouteFilterRulesClientGetResponse{}, err - } - return result, nil -} - -// NewListByRouteFilterPager - Gets all RouteFilterRules in a route filter. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// routeFilterName - The name of the route filter. -// options - RouteFilterRulesClientListByRouteFilterOptions contains the optional parameters for the RouteFilterRulesClient.ListByRouteFilter -// method. -func (client *RouteFilterRulesClient) NewListByRouteFilterPager(resourceGroupName string, routeFilterName string, options *RouteFilterRulesClientListByRouteFilterOptions) *runtime.Pager[RouteFilterRulesClientListByRouteFilterResponse] { - return runtime.NewPager(runtime.PagingHandler[RouteFilterRulesClientListByRouteFilterResponse]{ - More: func(page RouteFilterRulesClientListByRouteFilterResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *RouteFilterRulesClientListByRouteFilterResponse) (RouteFilterRulesClientListByRouteFilterResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByRouteFilterCreateRequest(ctx, resourceGroupName, routeFilterName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return RouteFilterRulesClientListByRouteFilterResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return RouteFilterRulesClientListByRouteFilterResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return RouteFilterRulesClientListByRouteFilterResponse{}, runtime.NewResponseError(resp) - } - return client.listByRouteFilterHandleResponse(resp) - }, - }) -} - -// listByRouteFilterCreateRequest creates the ListByRouteFilter request. -func (client *RouteFilterRulesClient) listByRouteFilterCreateRequest(ctx context.Context, resourceGroupName string, routeFilterName string, options *RouteFilterRulesClientListByRouteFilterOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if routeFilterName == "" { - return nil, errors.New("parameter routeFilterName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{routeFilterName}", url.PathEscape(routeFilterName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByRouteFilterHandleResponse handles the ListByRouteFilter response. -func (client *RouteFilterRulesClient) listByRouteFilterHandleResponse(resp *http.Response) (RouteFilterRulesClientListByRouteFilterResponse, error) { - result := RouteFilterRulesClientListByRouteFilterResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RouteFilterRuleListResult); err != nil { - return RouteFilterRulesClientListByRouteFilterResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/routefilters_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/routefilters_client.go deleted file mode 100644 index 37537cfc..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/routefilters_client.go +++ /dev/null @@ -1,428 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// RouteFiltersClient contains the methods for the RouteFilters group. -// Don't use this type directly, use NewRouteFiltersClient() instead. -type RouteFiltersClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewRouteFiltersClient creates a new instance of RouteFiltersClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewRouteFiltersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RouteFiltersClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &RouteFiltersClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates a route filter in a specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// routeFilterName - The name of the route filter. -// routeFilterParameters - Parameters supplied to the create or update route filter operation. -// options - RouteFiltersClientBeginCreateOrUpdateOptions contains the optional parameters for the RouteFiltersClient.BeginCreateOrUpdate -// method. -func (client *RouteFiltersClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, routeFilterName string, routeFilterParameters RouteFilter, options *RouteFiltersClientBeginCreateOrUpdateOptions) (*runtime.Poller[RouteFiltersClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, routeFilterName, routeFilterParameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[RouteFiltersClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[RouteFiltersClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates or updates a route filter in a specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *RouteFiltersClient) createOrUpdate(ctx context.Context, resourceGroupName string, routeFilterName string, routeFilterParameters RouteFilter, options *RouteFiltersClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, routeFilterName, routeFilterParameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *RouteFiltersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, routeFilterName string, routeFilterParameters RouteFilter, options *RouteFiltersClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if routeFilterName == "" { - return nil, errors.New("parameter routeFilterName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{routeFilterName}", url.PathEscape(routeFilterName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, routeFilterParameters) -} - -// BeginDelete - Deletes the specified route filter. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// routeFilterName - The name of the route filter. -// options - RouteFiltersClientBeginDeleteOptions contains the optional parameters for the RouteFiltersClient.BeginDelete -// method. -func (client *RouteFiltersClient) BeginDelete(ctx context.Context, resourceGroupName string, routeFilterName string, options *RouteFiltersClientBeginDeleteOptions) (*runtime.Poller[RouteFiltersClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, routeFilterName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[RouteFiltersClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[RouteFiltersClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes the specified route filter. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *RouteFiltersClient) deleteOperation(ctx context.Context, resourceGroupName string, routeFilterName string, options *RouteFiltersClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, routeFilterName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *RouteFiltersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, routeFilterName string, options *RouteFiltersClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if routeFilterName == "" { - return nil, errors.New("parameter routeFilterName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{routeFilterName}", url.PathEscape(routeFilterName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets the specified route filter. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// routeFilterName - The name of the route filter. -// options - RouteFiltersClientGetOptions contains the optional parameters for the RouteFiltersClient.Get method. -func (client *RouteFiltersClient) Get(ctx context.Context, resourceGroupName string, routeFilterName string, options *RouteFiltersClientGetOptions) (RouteFiltersClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, routeFilterName, options) - if err != nil { - return RouteFiltersClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return RouteFiltersClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return RouteFiltersClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *RouteFiltersClient) getCreateRequest(ctx context.Context, resourceGroupName string, routeFilterName string, options *RouteFiltersClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if routeFilterName == "" { - return nil, errors.New("parameter routeFilterName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{routeFilterName}", url.PathEscape(routeFilterName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *RouteFiltersClient) getHandleResponse(resp *http.Response) (RouteFiltersClientGetResponse, error) { - result := RouteFiltersClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RouteFilter); err != nil { - return RouteFiltersClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Gets all route filters in a subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// options - RouteFiltersClientListOptions contains the optional parameters for the RouteFiltersClient.List method. -func (client *RouteFiltersClient) NewListPager(options *RouteFiltersClientListOptions) *runtime.Pager[RouteFiltersClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[RouteFiltersClientListResponse]{ - More: func(page RouteFiltersClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *RouteFiltersClientListResponse) (RouteFiltersClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return RouteFiltersClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return RouteFiltersClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return RouteFiltersClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *RouteFiltersClient) listCreateRequest(ctx context.Context, options *RouteFiltersClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeFilters" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *RouteFiltersClient) listHandleResponse(resp *http.Response) (RouteFiltersClientListResponse, error) { - result := RouteFiltersClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RouteFilterListResult); err != nil { - return RouteFiltersClientListResponse{}, err - } - return result, nil -} - -// NewListByResourceGroupPager - Gets all route filters in a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// options - RouteFiltersClientListByResourceGroupOptions contains the optional parameters for the RouteFiltersClient.ListByResourceGroup -// method. -func (client *RouteFiltersClient) NewListByResourceGroupPager(resourceGroupName string, options *RouteFiltersClientListByResourceGroupOptions) *runtime.Pager[RouteFiltersClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[RouteFiltersClientListByResourceGroupResponse]{ - More: func(page RouteFiltersClientListByResourceGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *RouteFiltersClientListByResourceGroupResponse) (RouteFiltersClientListByResourceGroupResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return RouteFiltersClientListByResourceGroupResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return RouteFiltersClientListByResourceGroupResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return RouteFiltersClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) - } - return client.listByResourceGroupHandleResponse(resp) - }, - }) -} - -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *RouteFiltersClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *RouteFiltersClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *RouteFiltersClient) listByResourceGroupHandleResponse(resp *http.Response) (RouteFiltersClientListByResourceGroupResponse, error) { - result := RouteFiltersClientListByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RouteFilterListResult); err != nil { - return RouteFiltersClientListByResourceGroupResponse{}, err - } - return result, nil -} - -// UpdateTags - Updates tags of a route filter. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// routeFilterName - The name of the route filter. -// parameters - Parameters supplied to update route filter tags. -// options - RouteFiltersClientUpdateTagsOptions contains the optional parameters for the RouteFiltersClient.UpdateTags method. -func (client *RouteFiltersClient) UpdateTags(ctx context.Context, resourceGroupName string, routeFilterName string, parameters TagsObject, options *RouteFiltersClientUpdateTagsOptions) (RouteFiltersClientUpdateTagsResponse, error) { - req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, routeFilterName, parameters, options) - if err != nil { - return RouteFiltersClientUpdateTagsResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return RouteFiltersClientUpdateTagsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return RouteFiltersClientUpdateTagsResponse{}, runtime.NewResponseError(resp) - } - return client.updateTagsHandleResponse(resp) -} - -// updateTagsCreateRequest creates the UpdateTags request. -func (client *RouteFiltersClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, routeFilterName string, parameters TagsObject, options *RouteFiltersClientUpdateTagsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if routeFilterName == "" { - return nil, errors.New("parameter routeFilterName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{routeFilterName}", url.PathEscape(routeFilterName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// updateTagsHandleResponse handles the UpdateTags response. -func (client *RouteFiltersClient) updateTagsHandleResponse(resp *http.Response) (RouteFiltersClientUpdateTagsResponse, error) { - result := RouteFiltersClientUpdateTagsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RouteFilter); err != nil { - return RouteFiltersClientUpdateTagsResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/routes_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/routes_client.go deleted file mode 100644 index ad016312..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/routes_client.go +++ /dev/null @@ -1,327 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// RoutesClient contains the methods for the Routes group. -// Don't use this type directly, use NewRoutesClient() instead. -type RoutesClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewRoutesClient creates a new instance of RoutesClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewRoutesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RoutesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &RoutesClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates a route in the specified route table. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// routeTableName - The name of the route table. -// routeName - The name of the route. -// routeParameters - Parameters supplied to the create or update route operation. -// options - RoutesClientBeginCreateOrUpdateOptions contains the optional parameters for the RoutesClient.BeginCreateOrUpdate -// method. -func (client *RoutesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, routeTableName string, routeName string, routeParameters Route, options *RoutesClientBeginCreateOrUpdateOptions) (*runtime.Poller[RoutesClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, routeTableName, routeName, routeParameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[RoutesClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[RoutesClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates or updates a route in the specified route table. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *RoutesClient) createOrUpdate(ctx context.Context, resourceGroupName string, routeTableName string, routeName string, routeParameters Route, options *RoutesClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, routeTableName, routeName, routeParameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *RoutesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, routeTableName string, routeName string, routeParameters Route, options *RoutesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if routeTableName == "" { - return nil, errors.New("parameter routeTableName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{routeTableName}", url.PathEscape(routeTableName)) - if routeName == "" { - return nil, errors.New("parameter routeName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{routeName}", url.PathEscape(routeName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, routeParameters) -} - -// BeginDelete - Deletes the specified route from a route table. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// routeTableName - The name of the route table. -// routeName - The name of the route. -// options - RoutesClientBeginDeleteOptions contains the optional parameters for the RoutesClient.BeginDelete method. -func (client *RoutesClient) BeginDelete(ctx context.Context, resourceGroupName string, routeTableName string, routeName string, options *RoutesClientBeginDeleteOptions) (*runtime.Poller[RoutesClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, routeTableName, routeName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[RoutesClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[RoutesClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes the specified route from a route table. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *RoutesClient) deleteOperation(ctx context.Context, resourceGroupName string, routeTableName string, routeName string, options *RoutesClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, routeTableName, routeName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *RoutesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, routeTableName string, routeName string, options *RoutesClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if routeTableName == "" { - return nil, errors.New("parameter routeTableName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{routeTableName}", url.PathEscape(routeTableName)) - if routeName == "" { - return nil, errors.New("parameter routeName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{routeName}", url.PathEscape(routeName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets the specified route from a route table. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// routeTableName - The name of the route table. -// routeName - The name of the route. -// options - RoutesClientGetOptions contains the optional parameters for the RoutesClient.Get method. -func (client *RoutesClient) Get(ctx context.Context, resourceGroupName string, routeTableName string, routeName string, options *RoutesClientGetOptions) (RoutesClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, routeTableName, routeName, options) - if err != nil { - return RoutesClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return RoutesClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return RoutesClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *RoutesClient) getCreateRequest(ctx context.Context, resourceGroupName string, routeTableName string, routeName string, options *RoutesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if routeTableName == "" { - return nil, errors.New("parameter routeTableName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{routeTableName}", url.PathEscape(routeTableName)) - if routeName == "" { - return nil, errors.New("parameter routeName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{routeName}", url.PathEscape(routeName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *RoutesClient) getHandleResponse(resp *http.Response) (RoutesClientGetResponse, error) { - result := RoutesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.Route); err != nil { - return RoutesClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Gets all routes in a route table. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// routeTableName - The name of the route table. -// options - RoutesClientListOptions contains the optional parameters for the RoutesClient.List method. -func (client *RoutesClient) NewListPager(resourceGroupName string, routeTableName string, options *RoutesClientListOptions) *runtime.Pager[RoutesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[RoutesClientListResponse]{ - More: func(page RoutesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *RoutesClientListResponse) (RoutesClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, routeTableName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return RoutesClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return RoutesClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return RoutesClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *RoutesClient) listCreateRequest(ctx context.Context, resourceGroupName string, routeTableName string, options *RoutesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if routeTableName == "" { - return nil, errors.New("parameter routeTableName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{routeTableName}", url.PathEscape(routeTableName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *RoutesClient) listHandleResponse(resp *http.Response) (RoutesClientListResponse, error) { - result := RoutesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RouteListResult); err != nil { - return RoutesClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/routetables_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/routetables_client.go deleted file mode 100644 index 39f00e61..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/routetables_client.go +++ /dev/null @@ -1,426 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// RouteTablesClient contains the methods for the RouteTables group. -// Don't use this type directly, use NewRouteTablesClient() instead. -type RouteTablesClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewRouteTablesClient creates a new instance of RouteTablesClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewRouteTablesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RouteTablesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &RouteTablesClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Create or updates a route table in a specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// routeTableName - The name of the route table. -// parameters - Parameters supplied to the create or update route table operation. -// options - RouteTablesClientBeginCreateOrUpdateOptions contains the optional parameters for the RouteTablesClient.BeginCreateOrUpdate -// method. -func (client *RouteTablesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, routeTableName string, parameters RouteTable, options *RouteTablesClientBeginCreateOrUpdateOptions) (*runtime.Poller[RouteTablesClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, routeTableName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[RouteTablesClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[RouteTablesClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Create or updates a route table in a specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *RouteTablesClient) createOrUpdate(ctx context.Context, resourceGroupName string, routeTableName string, parameters RouteTable, options *RouteTablesClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, routeTableName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *RouteTablesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, routeTableName string, parameters RouteTable, options *RouteTablesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if routeTableName == "" { - return nil, errors.New("parameter routeTableName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{routeTableName}", url.PathEscape(routeTableName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginDelete - Deletes the specified route table. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// routeTableName - The name of the route table. -// options - RouteTablesClientBeginDeleteOptions contains the optional parameters for the RouteTablesClient.BeginDelete method. -func (client *RouteTablesClient) BeginDelete(ctx context.Context, resourceGroupName string, routeTableName string, options *RouteTablesClientBeginDeleteOptions) (*runtime.Poller[RouteTablesClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, routeTableName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[RouteTablesClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[RouteTablesClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes the specified route table. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *RouteTablesClient) deleteOperation(ctx context.Context, resourceGroupName string, routeTableName string, options *RouteTablesClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, routeTableName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *RouteTablesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, routeTableName string, options *RouteTablesClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if routeTableName == "" { - return nil, errors.New("parameter routeTableName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{routeTableName}", url.PathEscape(routeTableName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets the specified route table. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// routeTableName - The name of the route table. -// options - RouteTablesClientGetOptions contains the optional parameters for the RouteTablesClient.Get method. -func (client *RouteTablesClient) Get(ctx context.Context, resourceGroupName string, routeTableName string, options *RouteTablesClientGetOptions) (RouteTablesClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, routeTableName, options) - if err != nil { - return RouteTablesClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return RouteTablesClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return RouteTablesClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *RouteTablesClient) getCreateRequest(ctx context.Context, resourceGroupName string, routeTableName string, options *RouteTablesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if routeTableName == "" { - return nil, errors.New("parameter routeTableName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{routeTableName}", url.PathEscape(routeTableName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *RouteTablesClient) getHandleResponse(resp *http.Response) (RouteTablesClientGetResponse, error) { - result := RouteTablesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RouteTable); err != nil { - return RouteTablesClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Gets all route tables in a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// options - RouteTablesClientListOptions contains the optional parameters for the RouteTablesClient.List method. -func (client *RouteTablesClient) NewListPager(resourceGroupName string, options *RouteTablesClientListOptions) *runtime.Pager[RouteTablesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[RouteTablesClientListResponse]{ - More: func(page RouteTablesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *RouteTablesClientListResponse) (RouteTablesClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return RouteTablesClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return RouteTablesClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return RouteTablesClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *RouteTablesClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *RouteTablesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *RouteTablesClient) listHandleResponse(resp *http.Response) (RouteTablesClientListResponse, error) { - result := RouteTablesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RouteTableListResult); err != nil { - return RouteTablesClientListResponse{}, err - } - return result, nil -} - -// NewListAllPager - Gets all route tables in a subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// options - RouteTablesClientListAllOptions contains the optional parameters for the RouteTablesClient.ListAll method. -func (client *RouteTablesClient) NewListAllPager(options *RouteTablesClientListAllOptions) *runtime.Pager[RouteTablesClientListAllResponse] { - return runtime.NewPager(runtime.PagingHandler[RouteTablesClientListAllResponse]{ - More: func(page RouteTablesClientListAllResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *RouteTablesClientListAllResponse) (RouteTablesClientListAllResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listAllCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return RouteTablesClientListAllResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return RouteTablesClientListAllResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return RouteTablesClientListAllResponse{}, runtime.NewResponseError(resp) - } - return client.listAllHandleResponse(resp) - }, - }) -} - -// listAllCreateRequest creates the ListAll request. -func (client *RouteTablesClient) listAllCreateRequest(ctx context.Context, options *RouteTablesClientListAllOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeTables" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listAllHandleResponse handles the ListAll response. -func (client *RouteTablesClient) listAllHandleResponse(resp *http.Response) (RouteTablesClientListAllResponse, error) { - result := RouteTablesClientListAllResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RouteTableListResult); err != nil { - return RouteTablesClientListAllResponse{}, err - } - return result, nil -} - -// UpdateTags - Updates a route table tags. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// routeTableName - The name of the route table. -// parameters - Parameters supplied to update route table tags. -// options - RouteTablesClientUpdateTagsOptions contains the optional parameters for the RouteTablesClient.UpdateTags method. -func (client *RouteTablesClient) UpdateTags(ctx context.Context, resourceGroupName string, routeTableName string, parameters TagsObject, options *RouteTablesClientUpdateTagsOptions) (RouteTablesClientUpdateTagsResponse, error) { - req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, routeTableName, parameters, options) - if err != nil { - return RouteTablesClientUpdateTagsResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return RouteTablesClientUpdateTagsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return RouteTablesClientUpdateTagsResponse{}, runtime.NewResponseError(resp) - } - return client.updateTagsHandleResponse(resp) -} - -// updateTagsCreateRequest creates the UpdateTags request. -func (client *RouteTablesClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, routeTableName string, parameters TagsObject, options *RouteTablesClientUpdateTagsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if routeTableName == "" { - return nil, errors.New("parameter routeTableName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{routeTableName}", url.PathEscape(routeTableName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// updateTagsHandleResponse handles the UpdateTags response. -func (client *RouteTablesClient) updateTagsHandleResponse(resp *http.Response) (RouteTablesClientUpdateTagsResponse, error) { - result := RouteTablesClientUpdateTagsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RouteTable); err != nil { - return RouteTablesClientUpdateTagsResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/routingintent_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/routingintent_client.go deleted file mode 100644 index 26ef049d..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/routingintent_client.go +++ /dev/null @@ -1,328 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// RoutingIntentClient contains the methods for the RoutingIntent group. -// Don't use this type directly, use NewRoutingIntentClient() instead. -type RoutingIntentClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewRoutingIntentClient creates a new instance of RoutingIntentClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewRoutingIntentClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RoutingIntentClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &RoutingIntentClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates a RoutingIntent resource if it doesn't exist else updates the existing RoutingIntent. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the RoutingIntent. -// virtualHubName - The name of the VirtualHub. -// routingIntentName - The name of the per VirtualHub singleton Routing Intent resource. -// routingIntentParameters - Parameters supplied to create or update RoutingIntent. -// options - RoutingIntentClientBeginCreateOrUpdateOptions contains the optional parameters for the RoutingIntentClient.BeginCreateOrUpdate -// method. -func (client *RoutingIntentClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, virtualHubName string, routingIntentName string, routingIntentParameters RoutingIntent, options *RoutingIntentClientBeginCreateOrUpdateOptions) (*runtime.Poller[RoutingIntentClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, virtualHubName, routingIntentName, routingIntentParameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[RoutingIntentClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[RoutingIntentClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates a RoutingIntent resource if it doesn't exist else updates the existing RoutingIntent. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *RoutingIntentClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualHubName string, routingIntentName string, routingIntentParameters RoutingIntent, options *RoutingIntentClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, virtualHubName, routingIntentName, routingIntentParameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *RoutingIntentClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, routingIntentName string, routingIntentParameters RoutingIntent, options *RoutingIntentClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routingIntent/{routingIntentName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualHubName == "" { - return nil, errors.New("parameter virtualHubName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualHubName}", url.PathEscape(virtualHubName)) - if routingIntentName == "" { - return nil, errors.New("parameter routingIntentName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{routingIntentName}", url.PathEscape(routingIntentName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, routingIntentParameters) -} - -// BeginDelete - Deletes a RoutingIntent. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the RoutingIntent. -// virtualHubName - The name of the VirtualHub. -// routingIntentName - The name of the RoutingIntent. -// options - RoutingIntentClientBeginDeleteOptions contains the optional parameters for the RoutingIntentClient.BeginDelete -// method. -func (client *RoutingIntentClient) BeginDelete(ctx context.Context, resourceGroupName string, virtualHubName string, routingIntentName string, options *RoutingIntentClientBeginDeleteOptions) (*runtime.Poller[RoutingIntentClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, virtualHubName, routingIntentName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[RoutingIntentClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[RoutingIntentClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes a RoutingIntent. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *RoutingIntentClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualHubName string, routingIntentName string, options *RoutingIntentClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, virtualHubName, routingIntentName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *RoutingIntentClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, routingIntentName string, options *RoutingIntentClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routingIntent/{routingIntentName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualHubName == "" { - return nil, errors.New("parameter virtualHubName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualHubName}", url.PathEscape(virtualHubName)) - if routingIntentName == "" { - return nil, errors.New("parameter routingIntentName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{routingIntentName}", url.PathEscape(routingIntentName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Retrieves the details of a RoutingIntent. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the RoutingIntent. -// virtualHubName - The name of the VirtualHub. -// routingIntentName - The name of the RoutingIntent. -// options - RoutingIntentClientGetOptions contains the optional parameters for the RoutingIntentClient.Get method. -func (client *RoutingIntentClient) Get(ctx context.Context, resourceGroupName string, virtualHubName string, routingIntentName string, options *RoutingIntentClientGetOptions) (RoutingIntentClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, virtualHubName, routingIntentName, options) - if err != nil { - return RoutingIntentClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return RoutingIntentClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return RoutingIntentClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *RoutingIntentClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, routingIntentName string, options *RoutingIntentClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routingIntent/{routingIntentName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualHubName == "" { - return nil, errors.New("parameter virtualHubName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualHubName}", url.PathEscape(virtualHubName)) - if routingIntentName == "" { - return nil, errors.New("parameter routingIntentName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{routingIntentName}", url.PathEscape(routingIntentName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *RoutingIntentClient) getHandleResponse(resp *http.Response) (RoutingIntentClientGetResponse, error) { - result := RoutingIntentClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RoutingIntent); err != nil { - return RoutingIntentClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Retrieves the details of all RoutingIntent child resources of the VirtualHub. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the VirtualHub. -// virtualHubName - The name of the VirtualHub. -// options - RoutingIntentClientListOptions contains the optional parameters for the RoutingIntentClient.List method. -func (client *RoutingIntentClient) NewListPager(resourceGroupName string, virtualHubName string, options *RoutingIntentClientListOptions) *runtime.Pager[RoutingIntentClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[RoutingIntentClientListResponse]{ - More: func(page RoutingIntentClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *RoutingIntentClientListResponse) (RoutingIntentClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, virtualHubName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return RoutingIntentClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return RoutingIntentClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return RoutingIntentClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *RoutingIntentClient) listCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, options *RoutingIntentClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routingIntent" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualHubName == "" { - return nil, errors.New("parameter virtualHubName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualHubName}", url.PathEscape(virtualHubName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *RoutingIntentClient) listHandleResponse(resp *http.Response) (RoutingIntentClientListResponse, error) { - result := RoutingIntentClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ListRoutingIntentResult); err != nil { - return RoutingIntentClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/scopeconnections_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/scopeconnections_client.go deleted file mode 100644 index 84109e74..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/scopeconnections_client.go +++ /dev/null @@ -1,309 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strconv" - "strings" -) - -// ScopeConnectionsClient contains the methods for the ScopeConnections group. -// Don't use this type directly, use NewScopeConnectionsClient() instead. -type ScopeConnectionsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewScopeConnectionsClient creates a new instance of ScopeConnectionsClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewScopeConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ScopeConnectionsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &ScopeConnectionsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// CreateOrUpdate - Creates or updates scope connection from Network Manager -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkManagerName - The name of the network manager. -// scopeConnectionName - Name for the cross-tenant connection. -// parameters - Scope connection to be created/updated. -// options - ScopeConnectionsClientCreateOrUpdateOptions contains the optional parameters for the ScopeConnectionsClient.CreateOrUpdate -// method. -func (client *ScopeConnectionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, networkManagerName string, scopeConnectionName string, parameters ScopeConnection, options *ScopeConnectionsClientCreateOrUpdateOptions) (ScopeConnectionsClientCreateOrUpdateResponse, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, networkManagerName, scopeConnectionName, parameters, options) - if err != nil { - return ScopeConnectionsClientCreateOrUpdateResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ScopeConnectionsClientCreateOrUpdateResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return ScopeConnectionsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) - } - return client.createOrUpdateHandleResponse(resp) -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ScopeConnectionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, scopeConnectionName string, parameters ScopeConnection, options *ScopeConnectionsClientCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/scopeConnections/{scopeConnectionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkManagerName == "" { - return nil, errors.New("parameter networkManagerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) - if scopeConnectionName == "" { - return nil, errors.New("parameter scopeConnectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{scopeConnectionName}", url.PathEscape(scopeConnectionName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// createOrUpdateHandleResponse handles the CreateOrUpdate response. -func (client *ScopeConnectionsClient) createOrUpdateHandleResponse(resp *http.Response) (ScopeConnectionsClientCreateOrUpdateResponse, error) { - result := ScopeConnectionsClientCreateOrUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ScopeConnection); err != nil { - return ScopeConnectionsClientCreateOrUpdateResponse{}, err - } - return result, nil -} - -// Delete - Delete the pending scope connection created by this network manager. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkManagerName - The name of the network manager. -// scopeConnectionName - Name for the cross-tenant connection. -// options - ScopeConnectionsClientDeleteOptions contains the optional parameters for the ScopeConnectionsClient.Delete method. -func (client *ScopeConnectionsClient) Delete(ctx context.Context, resourceGroupName string, networkManagerName string, scopeConnectionName string, options *ScopeConnectionsClientDeleteOptions) (ScopeConnectionsClientDeleteResponse, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, networkManagerName, scopeConnectionName, options) - if err != nil { - return ScopeConnectionsClientDeleteResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ScopeConnectionsClientDeleteResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return ScopeConnectionsClientDeleteResponse{}, runtime.NewResponseError(resp) - } - return ScopeConnectionsClientDeleteResponse{}, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *ScopeConnectionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, scopeConnectionName string, options *ScopeConnectionsClientDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/scopeConnections/{scopeConnectionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkManagerName == "" { - return nil, errors.New("parameter networkManagerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) - if scopeConnectionName == "" { - return nil, errors.New("parameter scopeConnectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{scopeConnectionName}", url.PathEscape(scopeConnectionName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Get specified scope connection created by this Network Manager. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkManagerName - The name of the network manager. -// scopeConnectionName - Name for the cross-tenant connection. -// options - ScopeConnectionsClientGetOptions contains the optional parameters for the ScopeConnectionsClient.Get method. -func (client *ScopeConnectionsClient) Get(ctx context.Context, resourceGroupName string, networkManagerName string, scopeConnectionName string, options *ScopeConnectionsClientGetOptions) (ScopeConnectionsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, networkManagerName, scopeConnectionName, options) - if err != nil { - return ScopeConnectionsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ScopeConnectionsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ScopeConnectionsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *ScopeConnectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, scopeConnectionName string, options *ScopeConnectionsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/scopeConnections/{scopeConnectionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkManagerName == "" { - return nil, errors.New("parameter networkManagerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) - if scopeConnectionName == "" { - return nil, errors.New("parameter scopeConnectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{scopeConnectionName}", url.PathEscape(scopeConnectionName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *ScopeConnectionsClient) getHandleResponse(resp *http.Response) (ScopeConnectionsClientGetResponse, error) { - result := ScopeConnectionsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ScopeConnection); err != nil { - return ScopeConnectionsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - List all scope connections created by this network manager. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkManagerName - The name of the network manager. -// options - ScopeConnectionsClientListOptions contains the optional parameters for the ScopeConnectionsClient.List method. -func (client *ScopeConnectionsClient) NewListPager(resourceGroupName string, networkManagerName string, options *ScopeConnectionsClientListOptions) *runtime.Pager[ScopeConnectionsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[ScopeConnectionsClientListResponse]{ - More: func(page ScopeConnectionsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ScopeConnectionsClientListResponse) (ScopeConnectionsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, networkManagerName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return ScopeConnectionsClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ScopeConnectionsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ScopeConnectionsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *ScopeConnectionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, options *ScopeConnectionsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/scopeConnections" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkManagerName == "" { - return nil, errors.New("parameter networkManagerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - if options != nil && options.Top != nil { - reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) - } - if options != nil && options.SkipToken != nil { - reqQP.Set("$skipToken", *options.SkipToken) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *ScopeConnectionsClient) listHandleResponse(resp *http.Response) (ScopeConnectionsClientListResponse, error) { - result := ScopeConnectionsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ScopeConnectionListResult); err != nil { - return ScopeConnectionsClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/securityadminconfigurations_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/securityadminconfigurations_client.go deleted file mode 100644 index de20c46a..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/securityadminconfigurations_client.go +++ /dev/null @@ -1,332 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strconv" - "strings" -) - -// SecurityAdminConfigurationsClient contains the methods for the SecurityAdminConfigurations group. -// Don't use this type directly, use NewSecurityAdminConfigurationsClient() instead. -type SecurityAdminConfigurationsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewSecurityAdminConfigurationsClient creates a new instance of SecurityAdminConfigurationsClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewSecurityAdminConfigurationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SecurityAdminConfigurationsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &SecurityAdminConfigurationsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// CreateOrUpdate - Creates or updates a network manager security admin configuration. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkManagerName - The name of the network manager. -// configurationName - The name of the network manager Security Configuration. -// securityAdminConfiguration - The security admin configuration to create or update -// options - SecurityAdminConfigurationsClientCreateOrUpdateOptions contains the optional parameters for the SecurityAdminConfigurationsClient.CreateOrUpdate -// method. -func (client *SecurityAdminConfigurationsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, securityAdminConfiguration SecurityAdminConfiguration, options *SecurityAdminConfigurationsClientCreateOrUpdateOptions) (SecurityAdminConfigurationsClientCreateOrUpdateResponse, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, networkManagerName, configurationName, securityAdminConfiguration, options) - if err != nil { - return SecurityAdminConfigurationsClientCreateOrUpdateResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return SecurityAdminConfigurationsClientCreateOrUpdateResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return SecurityAdminConfigurationsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) - } - return client.createOrUpdateHandleResponse(resp) -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *SecurityAdminConfigurationsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, securityAdminConfiguration SecurityAdminConfiguration, options *SecurityAdminConfigurationsClientCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkManagerName == "" { - return nil, errors.New("parameter networkManagerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) - if configurationName == "" { - return nil, errors.New("parameter configurationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{configurationName}", url.PathEscape(configurationName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, securityAdminConfiguration) -} - -// createOrUpdateHandleResponse handles the CreateOrUpdate response. -func (client *SecurityAdminConfigurationsClient) createOrUpdateHandleResponse(resp *http.Response) (SecurityAdminConfigurationsClientCreateOrUpdateResponse, error) { - result := SecurityAdminConfigurationsClientCreateOrUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SecurityAdminConfiguration); err != nil { - return SecurityAdminConfigurationsClientCreateOrUpdateResponse{}, err - } - return result, nil -} - -// BeginDelete - Deletes a network manager security admin configuration. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkManagerName - The name of the network manager. -// configurationName - The name of the network manager Security Configuration. -// options - SecurityAdminConfigurationsClientBeginDeleteOptions contains the optional parameters for the SecurityAdminConfigurationsClient.BeginDelete -// method. -func (client *SecurityAdminConfigurationsClient) BeginDelete(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, options *SecurityAdminConfigurationsClientBeginDeleteOptions) (*runtime.Poller[SecurityAdminConfigurationsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, networkManagerName, configurationName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[SecurityAdminConfigurationsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[SecurityAdminConfigurationsClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes a network manager security admin configuration. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *SecurityAdminConfigurationsClient) deleteOperation(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, options *SecurityAdminConfigurationsClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, networkManagerName, configurationName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *SecurityAdminConfigurationsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, options *SecurityAdminConfigurationsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkManagerName == "" { - return nil, errors.New("parameter networkManagerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) - if configurationName == "" { - return nil, errors.New("parameter configurationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{configurationName}", url.PathEscape(configurationName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - if options != nil && options.Force != nil { - reqQP.Set("force", strconv.FormatBool(*options.Force)) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Retrieves a network manager security admin configuration. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkManagerName - The name of the network manager. -// configurationName - The name of the network manager Security Configuration. -// options - SecurityAdminConfigurationsClientGetOptions contains the optional parameters for the SecurityAdminConfigurationsClient.Get -// method. -func (client *SecurityAdminConfigurationsClient) Get(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, options *SecurityAdminConfigurationsClientGetOptions) (SecurityAdminConfigurationsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, networkManagerName, configurationName, options) - if err != nil { - return SecurityAdminConfigurationsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return SecurityAdminConfigurationsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SecurityAdminConfigurationsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *SecurityAdminConfigurationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, options *SecurityAdminConfigurationsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkManagerName == "" { - return nil, errors.New("parameter networkManagerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) - if configurationName == "" { - return nil, errors.New("parameter configurationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{configurationName}", url.PathEscape(configurationName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *SecurityAdminConfigurationsClient) getHandleResponse(resp *http.Response) (SecurityAdminConfigurationsClientGetResponse, error) { - result := SecurityAdminConfigurationsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SecurityAdminConfiguration); err != nil { - return SecurityAdminConfigurationsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Lists all the network manager security admin configurations in a network manager, in a paginated format. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkManagerName - The name of the network manager. -// options - SecurityAdminConfigurationsClientListOptions contains the optional parameters for the SecurityAdminConfigurationsClient.List -// method. -func (client *SecurityAdminConfigurationsClient) NewListPager(resourceGroupName string, networkManagerName string, options *SecurityAdminConfigurationsClientListOptions) *runtime.Pager[SecurityAdminConfigurationsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[SecurityAdminConfigurationsClientListResponse]{ - More: func(page SecurityAdminConfigurationsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *SecurityAdminConfigurationsClientListResponse) (SecurityAdminConfigurationsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, networkManagerName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return SecurityAdminConfigurationsClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return SecurityAdminConfigurationsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SecurityAdminConfigurationsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *SecurityAdminConfigurationsClient) listCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, options *SecurityAdminConfigurationsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkManagerName == "" { - return nil, errors.New("parameter networkManagerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - if options != nil && options.Top != nil { - reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) - } - if options != nil && options.SkipToken != nil { - reqQP.Set("$skipToken", *options.SkipToken) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *SecurityAdminConfigurationsClient) listHandleResponse(resp *http.Response) (SecurityAdminConfigurationsClientListResponse, error) { - result := SecurityAdminConfigurationsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SecurityAdminConfigurationListResult); err != nil { - return SecurityAdminConfigurationsClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/securitygroups_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/securitygroups_client.go deleted file mode 100644 index 8da5fdde..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/securitygroups_client.go +++ /dev/null @@ -1,428 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// SecurityGroupsClient contains the methods for the NetworkSecurityGroups group. -// Don't use this type directly, use NewSecurityGroupsClient() instead. -type SecurityGroupsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewSecurityGroupsClient creates a new instance of SecurityGroupsClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewSecurityGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SecurityGroupsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &SecurityGroupsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates a network security group in the specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkSecurityGroupName - The name of the network security group. -// parameters - Parameters supplied to the create or update network security group operation. -// options - SecurityGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the SecurityGroupsClient.BeginCreateOrUpdate -// method. -func (client *SecurityGroupsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, parameters SecurityGroup, options *SecurityGroupsClientBeginCreateOrUpdateOptions) (*runtime.Poller[SecurityGroupsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, networkSecurityGroupName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[SecurityGroupsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[SecurityGroupsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates or updates a network security group in the specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *SecurityGroupsClient) createOrUpdate(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, parameters SecurityGroup, options *SecurityGroupsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, networkSecurityGroupName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *SecurityGroupsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, parameters SecurityGroup, options *SecurityGroupsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkSecurityGroupName == "" { - return nil, errors.New("parameter networkSecurityGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkSecurityGroupName}", url.PathEscape(networkSecurityGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginDelete - Deletes the specified network security group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkSecurityGroupName - The name of the network security group. -// options - SecurityGroupsClientBeginDeleteOptions contains the optional parameters for the SecurityGroupsClient.BeginDelete -// method. -func (client *SecurityGroupsClient) BeginDelete(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, options *SecurityGroupsClientBeginDeleteOptions) (*runtime.Poller[SecurityGroupsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, networkSecurityGroupName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[SecurityGroupsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[SecurityGroupsClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes the specified network security group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *SecurityGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, options *SecurityGroupsClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, networkSecurityGroupName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *SecurityGroupsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, options *SecurityGroupsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkSecurityGroupName == "" { - return nil, errors.New("parameter networkSecurityGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkSecurityGroupName}", url.PathEscape(networkSecurityGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets the specified network security group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkSecurityGroupName - The name of the network security group. -// options - SecurityGroupsClientGetOptions contains the optional parameters for the SecurityGroupsClient.Get method. -func (client *SecurityGroupsClient) Get(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, options *SecurityGroupsClientGetOptions) (SecurityGroupsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, networkSecurityGroupName, options) - if err != nil { - return SecurityGroupsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return SecurityGroupsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SecurityGroupsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *SecurityGroupsClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, options *SecurityGroupsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkSecurityGroupName == "" { - return nil, errors.New("parameter networkSecurityGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkSecurityGroupName}", url.PathEscape(networkSecurityGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *SecurityGroupsClient) getHandleResponse(resp *http.Response) (SecurityGroupsClientGetResponse, error) { - result := SecurityGroupsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SecurityGroup); err != nil { - return SecurityGroupsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Gets all network security groups in a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// options - SecurityGroupsClientListOptions contains the optional parameters for the SecurityGroupsClient.List method. -func (client *SecurityGroupsClient) NewListPager(resourceGroupName string, options *SecurityGroupsClientListOptions) *runtime.Pager[SecurityGroupsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[SecurityGroupsClientListResponse]{ - More: func(page SecurityGroupsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *SecurityGroupsClientListResponse) (SecurityGroupsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return SecurityGroupsClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return SecurityGroupsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SecurityGroupsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *SecurityGroupsClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *SecurityGroupsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *SecurityGroupsClient) listHandleResponse(resp *http.Response) (SecurityGroupsClientListResponse, error) { - result := SecurityGroupsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SecurityGroupListResult); err != nil { - return SecurityGroupsClientListResponse{}, err - } - return result, nil -} - -// NewListAllPager - Gets all network security groups in a subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// options - SecurityGroupsClientListAllOptions contains the optional parameters for the SecurityGroupsClient.ListAll method. -func (client *SecurityGroupsClient) NewListAllPager(options *SecurityGroupsClientListAllOptions) *runtime.Pager[SecurityGroupsClientListAllResponse] { - return runtime.NewPager(runtime.PagingHandler[SecurityGroupsClientListAllResponse]{ - More: func(page SecurityGroupsClientListAllResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *SecurityGroupsClientListAllResponse) (SecurityGroupsClientListAllResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listAllCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return SecurityGroupsClientListAllResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return SecurityGroupsClientListAllResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SecurityGroupsClientListAllResponse{}, runtime.NewResponseError(resp) - } - return client.listAllHandleResponse(resp) - }, - }) -} - -// listAllCreateRequest creates the ListAll request. -func (client *SecurityGroupsClient) listAllCreateRequest(ctx context.Context, options *SecurityGroupsClientListAllOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkSecurityGroups" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listAllHandleResponse handles the ListAll response. -func (client *SecurityGroupsClient) listAllHandleResponse(resp *http.Response) (SecurityGroupsClientListAllResponse, error) { - result := SecurityGroupsClientListAllResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SecurityGroupListResult); err != nil { - return SecurityGroupsClientListAllResponse{}, err - } - return result, nil -} - -// UpdateTags - Updates a network security group tags. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkSecurityGroupName - The name of the network security group. -// parameters - Parameters supplied to update network security group tags. -// options - SecurityGroupsClientUpdateTagsOptions contains the optional parameters for the SecurityGroupsClient.UpdateTags -// method. -func (client *SecurityGroupsClient) UpdateTags(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, parameters TagsObject, options *SecurityGroupsClientUpdateTagsOptions) (SecurityGroupsClientUpdateTagsResponse, error) { - req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, networkSecurityGroupName, parameters, options) - if err != nil { - return SecurityGroupsClientUpdateTagsResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return SecurityGroupsClientUpdateTagsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SecurityGroupsClientUpdateTagsResponse{}, runtime.NewResponseError(resp) - } - return client.updateTagsHandleResponse(resp) -} - -// updateTagsCreateRequest creates the UpdateTags request. -func (client *SecurityGroupsClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, parameters TagsObject, options *SecurityGroupsClientUpdateTagsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkSecurityGroupName == "" { - return nil, errors.New("parameter networkSecurityGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkSecurityGroupName}", url.PathEscape(networkSecurityGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// updateTagsHandleResponse handles the UpdateTags response. -func (client *SecurityGroupsClient) updateTagsHandleResponse(resp *http.Response) (SecurityGroupsClientUpdateTagsResponse, error) { - result := SecurityGroupsClientUpdateTagsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SecurityGroup); err != nil { - return SecurityGroupsClientUpdateTagsResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/securitypartnerproviders_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/securitypartnerproviders_client.go deleted file mode 100644 index 98e55279..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/securitypartnerproviders_client.go +++ /dev/null @@ -1,428 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// SecurityPartnerProvidersClient contains the methods for the SecurityPartnerProviders group. -// Don't use this type directly, use NewSecurityPartnerProvidersClient() instead. -type SecurityPartnerProvidersClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewSecurityPartnerProvidersClient creates a new instance of SecurityPartnerProvidersClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewSecurityPartnerProvidersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SecurityPartnerProvidersClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &SecurityPartnerProvidersClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates the specified Security Partner Provider. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// securityPartnerProviderName - The name of the Security Partner Provider. -// parameters - Parameters supplied to the create or update Security Partner Provider operation. -// options - SecurityPartnerProvidersClientBeginCreateOrUpdateOptions contains the optional parameters for the SecurityPartnerProvidersClient.BeginCreateOrUpdate -// method. -func (client *SecurityPartnerProvidersClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, securityPartnerProviderName string, parameters SecurityPartnerProvider, options *SecurityPartnerProvidersClientBeginCreateOrUpdateOptions) (*runtime.Poller[SecurityPartnerProvidersClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, securityPartnerProviderName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[SecurityPartnerProvidersClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[SecurityPartnerProvidersClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates or updates the specified Security Partner Provider. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *SecurityPartnerProvidersClient) createOrUpdate(ctx context.Context, resourceGroupName string, securityPartnerProviderName string, parameters SecurityPartnerProvider, options *SecurityPartnerProvidersClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, securityPartnerProviderName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *SecurityPartnerProvidersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, securityPartnerProviderName string, parameters SecurityPartnerProvider, options *SecurityPartnerProvidersClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/securityPartnerProviders/{securityPartnerProviderName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if securityPartnerProviderName == "" { - return nil, errors.New("parameter securityPartnerProviderName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{securityPartnerProviderName}", url.PathEscape(securityPartnerProviderName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginDelete - Deletes the specified Security Partner Provider. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// securityPartnerProviderName - The name of the Security Partner Provider. -// options - SecurityPartnerProvidersClientBeginDeleteOptions contains the optional parameters for the SecurityPartnerProvidersClient.BeginDelete -// method. -func (client *SecurityPartnerProvidersClient) BeginDelete(ctx context.Context, resourceGroupName string, securityPartnerProviderName string, options *SecurityPartnerProvidersClientBeginDeleteOptions) (*runtime.Poller[SecurityPartnerProvidersClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, securityPartnerProviderName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[SecurityPartnerProvidersClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[SecurityPartnerProvidersClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes the specified Security Partner Provider. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *SecurityPartnerProvidersClient) deleteOperation(ctx context.Context, resourceGroupName string, securityPartnerProviderName string, options *SecurityPartnerProvidersClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, securityPartnerProviderName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *SecurityPartnerProvidersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, securityPartnerProviderName string, options *SecurityPartnerProvidersClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/securityPartnerProviders/{securityPartnerProviderName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if securityPartnerProviderName == "" { - return nil, errors.New("parameter securityPartnerProviderName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{securityPartnerProviderName}", url.PathEscape(securityPartnerProviderName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets the specified Security Partner Provider. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// securityPartnerProviderName - The name of the Security Partner Provider. -// options - SecurityPartnerProvidersClientGetOptions contains the optional parameters for the SecurityPartnerProvidersClient.Get -// method. -func (client *SecurityPartnerProvidersClient) Get(ctx context.Context, resourceGroupName string, securityPartnerProviderName string, options *SecurityPartnerProvidersClientGetOptions) (SecurityPartnerProvidersClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, securityPartnerProviderName, options) - if err != nil { - return SecurityPartnerProvidersClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return SecurityPartnerProvidersClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SecurityPartnerProvidersClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *SecurityPartnerProvidersClient) getCreateRequest(ctx context.Context, resourceGroupName string, securityPartnerProviderName string, options *SecurityPartnerProvidersClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/securityPartnerProviders/{securityPartnerProviderName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if securityPartnerProviderName == "" { - return nil, errors.New("parameter securityPartnerProviderName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{securityPartnerProviderName}", url.PathEscape(securityPartnerProviderName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *SecurityPartnerProvidersClient) getHandleResponse(resp *http.Response) (SecurityPartnerProvidersClientGetResponse, error) { - result := SecurityPartnerProvidersClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SecurityPartnerProvider); err != nil { - return SecurityPartnerProvidersClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Gets all the Security Partner Providers in a subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// options - SecurityPartnerProvidersClientListOptions contains the optional parameters for the SecurityPartnerProvidersClient.List -// method. -func (client *SecurityPartnerProvidersClient) NewListPager(options *SecurityPartnerProvidersClientListOptions) *runtime.Pager[SecurityPartnerProvidersClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[SecurityPartnerProvidersClientListResponse]{ - More: func(page SecurityPartnerProvidersClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *SecurityPartnerProvidersClientListResponse) (SecurityPartnerProvidersClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return SecurityPartnerProvidersClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return SecurityPartnerProvidersClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SecurityPartnerProvidersClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *SecurityPartnerProvidersClient) listCreateRequest(ctx context.Context, options *SecurityPartnerProvidersClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/securityPartnerProviders" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *SecurityPartnerProvidersClient) listHandleResponse(resp *http.Response) (SecurityPartnerProvidersClientListResponse, error) { - result := SecurityPartnerProvidersClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SecurityPartnerProviderListResult); err != nil { - return SecurityPartnerProvidersClientListResponse{}, err - } - return result, nil -} - -// NewListByResourceGroupPager - Lists all Security Partner Providers in a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// options - SecurityPartnerProvidersClientListByResourceGroupOptions contains the optional parameters for the SecurityPartnerProvidersClient.ListByResourceGroup -// method. -func (client *SecurityPartnerProvidersClient) NewListByResourceGroupPager(resourceGroupName string, options *SecurityPartnerProvidersClientListByResourceGroupOptions) *runtime.Pager[SecurityPartnerProvidersClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[SecurityPartnerProvidersClientListByResourceGroupResponse]{ - More: func(page SecurityPartnerProvidersClientListByResourceGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *SecurityPartnerProvidersClientListByResourceGroupResponse) (SecurityPartnerProvidersClientListByResourceGroupResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return SecurityPartnerProvidersClientListByResourceGroupResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return SecurityPartnerProvidersClientListByResourceGroupResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SecurityPartnerProvidersClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) - } - return client.listByResourceGroupHandleResponse(resp) - }, - }) -} - -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *SecurityPartnerProvidersClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *SecurityPartnerProvidersClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/securityPartnerProviders" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *SecurityPartnerProvidersClient) listByResourceGroupHandleResponse(resp *http.Response) (SecurityPartnerProvidersClientListByResourceGroupResponse, error) { - result := SecurityPartnerProvidersClientListByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SecurityPartnerProviderListResult); err != nil { - return SecurityPartnerProvidersClientListByResourceGroupResponse{}, err - } - return result, nil -} - -// UpdateTags - Updates tags of a Security Partner Provider resource. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// securityPartnerProviderName - The name of the Security Partner Provider. -// parameters - Parameters supplied to update Security Partner Provider tags. -// options - SecurityPartnerProvidersClientUpdateTagsOptions contains the optional parameters for the SecurityPartnerProvidersClient.UpdateTags -// method. -func (client *SecurityPartnerProvidersClient) UpdateTags(ctx context.Context, resourceGroupName string, securityPartnerProviderName string, parameters TagsObject, options *SecurityPartnerProvidersClientUpdateTagsOptions) (SecurityPartnerProvidersClientUpdateTagsResponse, error) { - req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, securityPartnerProviderName, parameters, options) - if err != nil { - return SecurityPartnerProvidersClientUpdateTagsResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return SecurityPartnerProvidersClientUpdateTagsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SecurityPartnerProvidersClientUpdateTagsResponse{}, runtime.NewResponseError(resp) - } - return client.updateTagsHandleResponse(resp) -} - -// updateTagsCreateRequest creates the UpdateTags request. -func (client *SecurityPartnerProvidersClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, securityPartnerProviderName string, parameters TagsObject, options *SecurityPartnerProvidersClientUpdateTagsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/securityPartnerProviders/{securityPartnerProviderName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if securityPartnerProviderName == "" { - return nil, errors.New("parameter securityPartnerProviderName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{securityPartnerProviderName}", url.PathEscape(securityPartnerProviderName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// updateTagsHandleResponse handles the UpdateTags response. -func (client *SecurityPartnerProvidersClient) updateTagsHandleResponse(resp *http.Response) (SecurityPartnerProvidersClientUpdateTagsResponse, error) { - result := SecurityPartnerProvidersClientUpdateTagsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SecurityPartnerProvider); err != nil { - return SecurityPartnerProvidersClientUpdateTagsResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/securityrules_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/securityrules_client.go deleted file mode 100644 index d2bae13b..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/securityrules_client.go +++ /dev/null @@ -1,328 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// SecurityRulesClient contains the methods for the SecurityRules group. -// Don't use this type directly, use NewSecurityRulesClient() instead. -type SecurityRulesClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewSecurityRulesClient creates a new instance of SecurityRulesClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewSecurityRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SecurityRulesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &SecurityRulesClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates a security rule in the specified network security group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkSecurityGroupName - The name of the network security group. -// securityRuleName - The name of the security rule. -// securityRuleParameters - Parameters supplied to the create or update network security rule operation. -// options - SecurityRulesClientBeginCreateOrUpdateOptions contains the optional parameters for the SecurityRulesClient.BeginCreateOrUpdate -// method. -func (client *SecurityRulesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, securityRuleName string, securityRuleParameters SecurityRule, options *SecurityRulesClientBeginCreateOrUpdateOptions) (*runtime.Poller[SecurityRulesClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[SecurityRulesClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[SecurityRulesClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates or updates a security rule in the specified network security group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *SecurityRulesClient) createOrUpdate(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, securityRuleName string, securityRuleParameters SecurityRule, options *SecurityRulesClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *SecurityRulesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, securityRuleName string, securityRuleParameters SecurityRule, options *SecurityRulesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkSecurityGroupName == "" { - return nil, errors.New("parameter networkSecurityGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkSecurityGroupName}", url.PathEscape(networkSecurityGroupName)) - if securityRuleName == "" { - return nil, errors.New("parameter securityRuleName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{securityRuleName}", url.PathEscape(securityRuleName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, securityRuleParameters) -} - -// BeginDelete - Deletes the specified network security rule. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkSecurityGroupName - The name of the network security group. -// securityRuleName - The name of the security rule. -// options - SecurityRulesClientBeginDeleteOptions contains the optional parameters for the SecurityRulesClient.BeginDelete -// method. -func (client *SecurityRulesClient) BeginDelete(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, securityRuleName string, options *SecurityRulesClientBeginDeleteOptions) (*runtime.Poller[SecurityRulesClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, networkSecurityGroupName, securityRuleName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[SecurityRulesClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[SecurityRulesClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes the specified network security rule. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *SecurityRulesClient) deleteOperation(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, securityRuleName string, options *SecurityRulesClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, networkSecurityGroupName, securityRuleName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *SecurityRulesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, securityRuleName string, options *SecurityRulesClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkSecurityGroupName == "" { - return nil, errors.New("parameter networkSecurityGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkSecurityGroupName}", url.PathEscape(networkSecurityGroupName)) - if securityRuleName == "" { - return nil, errors.New("parameter securityRuleName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{securityRuleName}", url.PathEscape(securityRuleName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Get the specified network security rule. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkSecurityGroupName - The name of the network security group. -// securityRuleName - The name of the security rule. -// options - SecurityRulesClientGetOptions contains the optional parameters for the SecurityRulesClient.Get method. -func (client *SecurityRulesClient) Get(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, securityRuleName string, options *SecurityRulesClientGetOptions) (SecurityRulesClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, networkSecurityGroupName, securityRuleName, options) - if err != nil { - return SecurityRulesClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return SecurityRulesClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SecurityRulesClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *SecurityRulesClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, securityRuleName string, options *SecurityRulesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkSecurityGroupName == "" { - return nil, errors.New("parameter networkSecurityGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkSecurityGroupName}", url.PathEscape(networkSecurityGroupName)) - if securityRuleName == "" { - return nil, errors.New("parameter securityRuleName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{securityRuleName}", url.PathEscape(securityRuleName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *SecurityRulesClient) getHandleResponse(resp *http.Response) (SecurityRulesClientGetResponse, error) { - result := SecurityRulesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SecurityRule); err != nil { - return SecurityRulesClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Gets all security rules in a network security group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkSecurityGroupName - The name of the network security group. -// options - SecurityRulesClientListOptions contains the optional parameters for the SecurityRulesClient.List method. -func (client *SecurityRulesClient) NewListPager(resourceGroupName string, networkSecurityGroupName string, options *SecurityRulesClientListOptions) *runtime.Pager[SecurityRulesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[SecurityRulesClientListResponse]{ - More: func(page SecurityRulesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *SecurityRulesClientListResponse) (SecurityRulesClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, networkSecurityGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return SecurityRulesClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return SecurityRulesClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SecurityRulesClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *SecurityRulesClient) listCreateRequest(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, options *SecurityRulesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkSecurityGroupName == "" { - return nil, errors.New("parameter networkSecurityGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkSecurityGroupName}", url.PathEscape(networkSecurityGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *SecurityRulesClient) listHandleResponse(resp *http.Response) (SecurityRulesClientListResponse, error) { - result := SecurityRulesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SecurityRuleListResult); err != nil { - return SecurityRulesClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/serviceassociationlinks_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/serviceassociationlinks_client.go deleted file mode 100644 index e105d482..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/serviceassociationlinks_client.go +++ /dev/null @@ -1,119 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// ServiceAssociationLinksClient contains the methods for the ServiceAssociationLinks group. -// Don't use this type directly, use NewServiceAssociationLinksClient() instead. -type ServiceAssociationLinksClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewServiceAssociationLinksClient creates a new instance of ServiceAssociationLinksClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewServiceAssociationLinksClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServiceAssociationLinksClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &ServiceAssociationLinksClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// List - Gets a list of service association links for a subnet. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// virtualNetworkName - The name of the virtual network. -// subnetName - The name of the subnet. -// options - ServiceAssociationLinksClientListOptions contains the optional parameters for the ServiceAssociationLinksClient.List -// method. -func (client *ServiceAssociationLinksClient) List(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, options *ServiceAssociationLinksClientListOptions) (ServiceAssociationLinksClientListResponse, error) { - req, err := client.listCreateRequest(ctx, resourceGroupName, virtualNetworkName, subnetName, options) - if err != nil { - return ServiceAssociationLinksClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ServiceAssociationLinksClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServiceAssociationLinksClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) -} - -// listCreateRequest creates the List request. -func (client *ServiceAssociationLinksClient) listCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, options *ServiceAssociationLinksClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/ServiceAssociationLinks" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualNetworkName == "" { - return nil, errors.New("parameter virtualNetworkName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkName}", url.PathEscape(virtualNetworkName)) - if subnetName == "" { - return nil, errors.New("parameter subnetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subnetName}", url.PathEscape(subnetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *ServiceAssociationLinksClient) listHandleResponse(resp *http.Response) (ServiceAssociationLinksClientListResponse, error) { - result := ServiceAssociationLinksClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ServiceAssociationLinksListResult); err != nil { - return ServiceAssociationLinksClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/serviceendpointpolicies_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/serviceendpointpolicies_client.go deleted file mode 100644 index 2f5aa7a4..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/serviceendpointpolicies_client.go +++ /dev/null @@ -1,431 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// ServiceEndpointPoliciesClient contains the methods for the ServiceEndpointPolicies group. -// Don't use this type directly, use NewServiceEndpointPoliciesClient() instead. -type ServiceEndpointPoliciesClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewServiceEndpointPoliciesClient creates a new instance of ServiceEndpointPoliciesClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewServiceEndpointPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServiceEndpointPoliciesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &ServiceEndpointPoliciesClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates a service Endpoint Policies. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// serviceEndpointPolicyName - The name of the service endpoint policy. -// parameters - Parameters supplied to the create or update service endpoint policy operation. -// options - ServiceEndpointPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the ServiceEndpointPoliciesClient.BeginCreateOrUpdate -// method. -func (client *ServiceEndpointPoliciesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, parameters ServiceEndpointPolicy, options *ServiceEndpointPoliciesClientBeginCreateOrUpdateOptions) (*runtime.Poller[ServiceEndpointPoliciesClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, serviceEndpointPolicyName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ServiceEndpointPoliciesClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[ServiceEndpointPoliciesClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates or updates a service Endpoint Policies. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *ServiceEndpointPoliciesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, parameters ServiceEndpointPolicy, options *ServiceEndpointPoliciesClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceEndpointPolicyName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ServiceEndpointPoliciesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, parameters ServiceEndpointPolicy, options *ServiceEndpointPoliciesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if serviceEndpointPolicyName == "" { - return nil, errors.New("parameter serviceEndpointPolicyName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serviceEndpointPolicyName}", url.PathEscape(serviceEndpointPolicyName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginDelete - Deletes the specified service endpoint policy. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// serviceEndpointPolicyName - The name of the service endpoint policy. -// options - ServiceEndpointPoliciesClientBeginDeleteOptions contains the optional parameters for the ServiceEndpointPoliciesClient.BeginDelete -// method. -func (client *ServiceEndpointPoliciesClient) BeginDelete(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, options *ServiceEndpointPoliciesClientBeginDeleteOptions) (*runtime.Poller[ServiceEndpointPoliciesClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, serviceEndpointPolicyName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ServiceEndpointPoliciesClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[ServiceEndpointPoliciesClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes the specified service endpoint policy. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *ServiceEndpointPoliciesClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, options *ServiceEndpointPoliciesClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceEndpointPolicyName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *ServiceEndpointPoliciesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, options *ServiceEndpointPoliciesClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if serviceEndpointPolicyName == "" { - return nil, errors.New("parameter serviceEndpointPolicyName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serviceEndpointPolicyName}", url.PathEscape(serviceEndpointPolicyName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets the specified service Endpoint Policies in a specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// serviceEndpointPolicyName - The name of the service endpoint policy. -// options - ServiceEndpointPoliciesClientGetOptions contains the optional parameters for the ServiceEndpointPoliciesClient.Get -// method. -func (client *ServiceEndpointPoliciesClient) Get(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, options *ServiceEndpointPoliciesClientGetOptions) (ServiceEndpointPoliciesClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, serviceEndpointPolicyName, options) - if err != nil { - return ServiceEndpointPoliciesClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ServiceEndpointPoliciesClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServiceEndpointPoliciesClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *ServiceEndpointPoliciesClient) getCreateRequest(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, options *ServiceEndpointPoliciesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if serviceEndpointPolicyName == "" { - return nil, errors.New("parameter serviceEndpointPolicyName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serviceEndpointPolicyName}", url.PathEscape(serviceEndpointPolicyName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *ServiceEndpointPoliciesClient) getHandleResponse(resp *http.Response) (ServiceEndpointPoliciesClientGetResponse, error) { - result := ServiceEndpointPoliciesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ServiceEndpointPolicy); err != nil { - return ServiceEndpointPoliciesClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Gets all the service endpoint policies in a subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// options - ServiceEndpointPoliciesClientListOptions contains the optional parameters for the ServiceEndpointPoliciesClient.List -// method. -func (client *ServiceEndpointPoliciesClient) NewListPager(options *ServiceEndpointPoliciesClientListOptions) *runtime.Pager[ServiceEndpointPoliciesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[ServiceEndpointPoliciesClientListResponse]{ - More: func(page ServiceEndpointPoliciesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ServiceEndpointPoliciesClientListResponse) (ServiceEndpointPoliciesClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return ServiceEndpointPoliciesClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ServiceEndpointPoliciesClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServiceEndpointPoliciesClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *ServiceEndpointPoliciesClient) listCreateRequest(ctx context.Context, options *ServiceEndpointPoliciesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/ServiceEndpointPolicies" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *ServiceEndpointPoliciesClient) listHandleResponse(resp *http.Response) (ServiceEndpointPoliciesClientListResponse, error) { - result := ServiceEndpointPoliciesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ServiceEndpointPolicyListResult); err != nil { - return ServiceEndpointPoliciesClientListResponse{}, err - } - return result, nil -} - -// NewListByResourceGroupPager - Gets all service endpoint Policies in a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// options - ServiceEndpointPoliciesClientListByResourceGroupOptions contains the optional parameters for the ServiceEndpointPoliciesClient.ListByResourceGroup -// method. -func (client *ServiceEndpointPoliciesClient) NewListByResourceGroupPager(resourceGroupName string, options *ServiceEndpointPoliciesClientListByResourceGroupOptions) *runtime.Pager[ServiceEndpointPoliciesClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[ServiceEndpointPoliciesClientListByResourceGroupResponse]{ - More: func(page ServiceEndpointPoliciesClientListByResourceGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ServiceEndpointPoliciesClientListByResourceGroupResponse) (ServiceEndpointPoliciesClientListByResourceGroupResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return ServiceEndpointPoliciesClientListByResourceGroupResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ServiceEndpointPoliciesClientListByResourceGroupResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServiceEndpointPoliciesClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) - } - return client.listByResourceGroupHandleResponse(resp) - }, - }) -} - -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *ServiceEndpointPoliciesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ServiceEndpointPoliciesClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *ServiceEndpointPoliciesClient) listByResourceGroupHandleResponse(resp *http.Response) (ServiceEndpointPoliciesClientListByResourceGroupResponse, error) { - result := ServiceEndpointPoliciesClientListByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ServiceEndpointPolicyListResult); err != nil { - return ServiceEndpointPoliciesClientListByResourceGroupResponse{}, err - } - return result, nil -} - -// UpdateTags - Updates tags of a service endpoint policy. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// serviceEndpointPolicyName - The name of the service endpoint policy. -// parameters - Parameters supplied to update service endpoint policy tags. -// options - ServiceEndpointPoliciesClientUpdateTagsOptions contains the optional parameters for the ServiceEndpointPoliciesClient.UpdateTags -// method. -func (client *ServiceEndpointPoliciesClient) UpdateTags(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, parameters TagsObject, options *ServiceEndpointPoliciesClientUpdateTagsOptions) (ServiceEndpointPoliciesClientUpdateTagsResponse, error) { - req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, serviceEndpointPolicyName, parameters, options) - if err != nil { - return ServiceEndpointPoliciesClientUpdateTagsResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ServiceEndpointPoliciesClientUpdateTagsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServiceEndpointPoliciesClientUpdateTagsResponse{}, runtime.NewResponseError(resp) - } - return client.updateTagsHandleResponse(resp) -} - -// updateTagsCreateRequest creates the UpdateTags request. -func (client *ServiceEndpointPoliciesClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, parameters TagsObject, options *ServiceEndpointPoliciesClientUpdateTagsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if serviceEndpointPolicyName == "" { - return nil, errors.New("parameter serviceEndpointPolicyName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serviceEndpointPolicyName}", url.PathEscape(serviceEndpointPolicyName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// updateTagsHandleResponse handles the UpdateTags response. -func (client *ServiceEndpointPoliciesClient) updateTagsHandleResponse(resp *http.Response) (ServiceEndpointPoliciesClientUpdateTagsResponse, error) { - result := ServiceEndpointPoliciesClientUpdateTagsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ServiceEndpointPolicy); err != nil { - return ServiceEndpointPoliciesClientUpdateTagsResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/serviceendpointpolicydefinitions_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/serviceendpointpolicydefinitions_client.go deleted file mode 100644 index e3ef3eee..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/serviceendpointpolicydefinitions_client.go +++ /dev/null @@ -1,330 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// ServiceEndpointPolicyDefinitionsClient contains the methods for the ServiceEndpointPolicyDefinitions group. -// Don't use this type directly, use NewServiceEndpointPolicyDefinitionsClient() instead. -type ServiceEndpointPolicyDefinitionsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewServiceEndpointPolicyDefinitionsClient creates a new instance of ServiceEndpointPolicyDefinitionsClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewServiceEndpointPolicyDefinitionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServiceEndpointPolicyDefinitionsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &ServiceEndpointPolicyDefinitionsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates a service endpoint policy definition in the specified service endpoint policy. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// serviceEndpointPolicyName - The name of the service endpoint policy. -// serviceEndpointPolicyDefinitionName - The name of the service endpoint policy definition name. -// serviceEndpointPolicyDefinitions - Parameters supplied to the create or update service endpoint policy operation. -// options - ServiceEndpointPolicyDefinitionsClientBeginCreateOrUpdateOptions contains the optional parameters for the ServiceEndpointPolicyDefinitionsClient.BeginCreateOrUpdate -// method. -func (client *ServiceEndpointPolicyDefinitionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, serviceEndpointPolicyDefinitionName string, serviceEndpointPolicyDefinitions ServiceEndpointPolicyDefinition, options *ServiceEndpointPolicyDefinitionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ServiceEndpointPolicyDefinitionsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, serviceEndpointPolicyDefinitions, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ServiceEndpointPolicyDefinitionsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[ServiceEndpointPolicyDefinitionsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates or updates a service endpoint policy definition in the specified service endpoint policy. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *ServiceEndpointPolicyDefinitionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, serviceEndpointPolicyDefinitionName string, serviceEndpointPolicyDefinitions ServiceEndpointPolicyDefinition, options *ServiceEndpointPolicyDefinitionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, serviceEndpointPolicyDefinitions, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ServiceEndpointPolicyDefinitionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, serviceEndpointPolicyDefinitionName string, serviceEndpointPolicyDefinitions ServiceEndpointPolicyDefinition, options *ServiceEndpointPolicyDefinitionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions/{serviceEndpointPolicyDefinitionName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if serviceEndpointPolicyName == "" { - return nil, errors.New("parameter serviceEndpointPolicyName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serviceEndpointPolicyName}", url.PathEscape(serviceEndpointPolicyName)) - if serviceEndpointPolicyDefinitionName == "" { - return nil, errors.New("parameter serviceEndpointPolicyDefinitionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serviceEndpointPolicyDefinitionName}", url.PathEscape(serviceEndpointPolicyDefinitionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, serviceEndpointPolicyDefinitions) -} - -// BeginDelete - Deletes the specified ServiceEndpoint policy definitions. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// serviceEndpointPolicyName - The name of the Service Endpoint Policy. -// serviceEndpointPolicyDefinitionName - The name of the service endpoint policy definition. -// options - ServiceEndpointPolicyDefinitionsClientBeginDeleteOptions contains the optional parameters for the ServiceEndpointPolicyDefinitionsClient.BeginDelete -// method. -func (client *ServiceEndpointPolicyDefinitionsClient) BeginDelete(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, serviceEndpointPolicyDefinitionName string, options *ServiceEndpointPolicyDefinitionsClientBeginDeleteOptions) (*runtime.Poller[ServiceEndpointPolicyDefinitionsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ServiceEndpointPolicyDefinitionsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[ServiceEndpointPolicyDefinitionsClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes the specified ServiceEndpoint policy definitions. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *ServiceEndpointPolicyDefinitionsClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, serviceEndpointPolicyDefinitionName string, options *ServiceEndpointPolicyDefinitionsClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *ServiceEndpointPolicyDefinitionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, serviceEndpointPolicyDefinitionName string, options *ServiceEndpointPolicyDefinitionsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions/{serviceEndpointPolicyDefinitionName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if serviceEndpointPolicyName == "" { - return nil, errors.New("parameter serviceEndpointPolicyName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serviceEndpointPolicyName}", url.PathEscape(serviceEndpointPolicyName)) - if serviceEndpointPolicyDefinitionName == "" { - return nil, errors.New("parameter serviceEndpointPolicyDefinitionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serviceEndpointPolicyDefinitionName}", url.PathEscape(serviceEndpointPolicyDefinitionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Get the specified service endpoint policy definitions from service endpoint policy. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// serviceEndpointPolicyName - The name of the service endpoint policy name. -// serviceEndpointPolicyDefinitionName - The name of the service endpoint policy definition name. -// options - ServiceEndpointPolicyDefinitionsClientGetOptions contains the optional parameters for the ServiceEndpointPolicyDefinitionsClient.Get -// method. -func (client *ServiceEndpointPolicyDefinitionsClient) Get(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, serviceEndpointPolicyDefinitionName string, options *ServiceEndpointPolicyDefinitionsClientGetOptions) (ServiceEndpointPolicyDefinitionsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, options) - if err != nil { - return ServiceEndpointPolicyDefinitionsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ServiceEndpointPolicyDefinitionsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServiceEndpointPolicyDefinitionsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *ServiceEndpointPolicyDefinitionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, serviceEndpointPolicyDefinitionName string, options *ServiceEndpointPolicyDefinitionsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions/{serviceEndpointPolicyDefinitionName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if serviceEndpointPolicyName == "" { - return nil, errors.New("parameter serviceEndpointPolicyName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serviceEndpointPolicyName}", url.PathEscape(serviceEndpointPolicyName)) - if serviceEndpointPolicyDefinitionName == "" { - return nil, errors.New("parameter serviceEndpointPolicyDefinitionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serviceEndpointPolicyDefinitionName}", url.PathEscape(serviceEndpointPolicyDefinitionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *ServiceEndpointPolicyDefinitionsClient) getHandleResponse(resp *http.Response) (ServiceEndpointPolicyDefinitionsClientGetResponse, error) { - result := ServiceEndpointPolicyDefinitionsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ServiceEndpointPolicyDefinition); err != nil { - return ServiceEndpointPolicyDefinitionsClientGetResponse{}, err - } - return result, nil -} - -// NewListByResourceGroupPager - Gets all service endpoint policy definitions in a service end point policy. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// serviceEndpointPolicyName - The name of the service endpoint policy name. -// options - ServiceEndpointPolicyDefinitionsClientListByResourceGroupOptions contains the optional parameters for the ServiceEndpointPolicyDefinitionsClient.ListByResourceGroup -// method. -func (client *ServiceEndpointPolicyDefinitionsClient) NewListByResourceGroupPager(resourceGroupName string, serviceEndpointPolicyName string, options *ServiceEndpointPolicyDefinitionsClientListByResourceGroupOptions) *runtime.Pager[ServiceEndpointPolicyDefinitionsClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[ServiceEndpointPolicyDefinitionsClientListByResourceGroupResponse]{ - More: func(page ServiceEndpointPolicyDefinitionsClientListByResourceGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ServiceEndpointPolicyDefinitionsClientListByResourceGroupResponse) (ServiceEndpointPolicyDefinitionsClientListByResourceGroupResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, serviceEndpointPolicyName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return ServiceEndpointPolicyDefinitionsClientListByResourceGroupResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ServiceEndpointPolicyDefinitionsClientListByResourceGroupResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServiceEndpointPolicyDefinitionsClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) - } - return client.listByResourceGroupHandleResponse(resp) - }, - }) -} - -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *ServiceEndpointPolicyDefinitionsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, options *ServiceEndpointPolicyDefinitionsClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if serviceEndpointPolicyName == "" { - return nil, errors.New("parameter serviceEndpointPolicyName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serviceEndpointPolicyName}", url.PathEscape(serviceEndpointPolicyName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *ServiceEndpointPolicyDefinitionsClient) listByResourceGroupHandleResponse(resp *http.Response) (ServiceEndpointPolicyDefinitionsClientListByResourceGroupResponse, error) { - result := ServiceEndpointPolicyDefinitionsClientListByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ServiceEndpointPolicyDefinitionListResult); err != nil { - return ServiceEndpointPolicyDefinitionsClientListByResourceGroupResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/servicetaginformation_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/servicetaginformation_client.go deleted file mode 100644 index 7d999e79..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/servicetaginformation_client.go +++ /dev/null @@ -1,131 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strconv" - "strings" -) - -// ServiceTagInformationClient contains the methods for the ServiceTagInformation group. -// Don't use this type directly, use NewServiceTagInformationClient() instead. -type ServiceTagInformationClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewServiceTagInformationClient creates a new instance of ServiceTagInformationClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewServiceTagInformationClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServiceTagInformationClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &ServiceTagInformationClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// NewListPager - Gets a list of service tag information resources with pagination. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// location - The location that will be used as a reference for cloud (not as a filter based on location, you will get the -// list of service tags with prefix details across all regions but limited to the cloud that -// your subscription belongs to). -// options - ServiceTagInformationClientListOptions contains the optional parameters for the ServiceTagInformationClient.List -// method. -func (client *ServiceTagInformationClient) NewListPager(location string, options *ServiceTagInformationClientListOptions) *runtime.Pager[ServiceTagInformationClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[ServiceTagInformationClientListResponse]{ - More: func(page ServiceTagInformationClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ServiceTagInformationClientListResponse) (ServiceTagInformationClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, location, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return ServiceTagInformationClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ServiceTagInformationClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServiceTagInformationClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *ServiceTagInformationClient) listCreateRequest(ctx context.Context, location string, options *ServiceTagInformationClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/serviceTagDetails" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - if options != nil && options.NoAddressPrefixes != nil { - reqQP.Set("noAddressPrefixes", strconv.FormatBool(*options.NoAddressPrefixes)) - } - if options != nil && options.TagName != nil { - reqQP.Set("tagName", *options.TagName) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *ServiceTagInformationClient) listHandleResponse(resp *http.Response) (ServiceTagInformationClientListResponse, error) { - result := ServiceTagInformationClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ServiceTagInformationListResult); err != nil { - return ServiceTagInformationClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/servicetags_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/servicetags_client.go deleted file mode 100644 index ba2e48c5..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/servicetags_client.go +++ /dev/null @@ -1,110 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// ServiceTagsClient contains the methods for the ServiceTags group. -// Don't use this type directly, use NewServiceTagsClient() instead. -type ServiceTagsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewServiceTagsClient creates a new instance of ServiceTagsClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewServiceTagsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServiceTagsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &ServiceTagsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// List - Gets a list of service tag information resources. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// location - The location that will be used as a reference for version (not as a filter based on location, you will get the -// list of service tags with prefix details across all regions but limited to the cloud that -// your subscription belongs to). -// options - ServiceTagsClientListOptions contains the optional parameters for the ServiceTagsClient.List method. -func (client *ServiceTagsClient) List(ctx context.Context, location string, options *ServiceTagsClientListOptions) (ServiceTagsClientListResponse, error) { - req, err := client.listCreateRequest(ctx, location, options) - if err != nil { - return ServiceTagsClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ServiceTagsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServiceTagsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) -} - -// listCreateRequest creates the List request. -func (client *ServiceTagsClient) listCreateRequest(ctx context.Context, location string, options *ServiceTagsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/serviceTags" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *ServiceTagsClient) listHandleResponse(resp *http.Response) (ServiceTagsClientListResponse, error) { - result := ServiceTagsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ServiceTagsListResult); err != nil { - return ServiceTagsClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/staticmembers_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/staticmembers_client.go deleted file mode 100644 index c3005ed7..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/staticmembers_client.go +++ /dev/null @@ -1,329 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strconv" - "strings" -) - -// StaticMembersClient contains the methods for the StaticMembers group. -// Don't use this type directly, use NewStaticMembersClient() instead. -type StaticMembersClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewStaticMembersClient creates a new instance of StaticMembersClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewStaticMembersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*StaticMembersClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &StaticMembersClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// CreateOrUpdate - Creates or updates a static member. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkManagerName - The name of the network manager. -// networkGroupName - The name of the network group. -// staticMemberName - The name of the static member. -// parameters - Parameters supplied to the specify the static member to create -// options - StaticMembersClientCreateOrUpdateOptions contains the optional parameters for the StaticMembersClient.CreateOrUpdate -// method. -func (client *StaticMembersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, networkManagerName string, networkGroupName string, staticMemberName string, parameters StaticMember, options *StaticMembersClientCreateOrUpdateOptions) (StaticMembersClientCreateOrUpdateResponse, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, networkManagerName, networkGroupName, staticMemberName, parameters, options) - if err != nil { - return StaticMembersClientCreateOrUpdateResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return StaticMembersClientCreateOrUpdateResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return StaticMembersClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) - } - return client.createOrUpdateHandleResponse(resp) -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *StaticMembersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, networkGroupName string, staticMemberName string, parameters StaticMember, options *StaticMembersClientCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/networkGroups/{networkGroupName}/staticMembers/{staticMemberName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkManagerName == "" { - return nil, errors.New("parameter networkManagerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) - if networkGroupName == "" { - return nil, errors.New("parameter networkGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkGroupName}", url.PathEscape(networkGroupName)) - if staticMemberName == "" { - return nil, errors.New("parameter staticMemberName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{staticMemberName}", url.PathEscape(staticMemberName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// createOrUpdateHandleResponse handles the CreateOrUpdate response. -func (client *StaticMembersClient) createOrUpdateHandleResponse(resp *http.Response) (StaticMembersClientCreateOrUpdateResponse, error) { - result := StaticMembersClientCreateOrUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.StaticMember); err != nil { - return StaticMembersClientCreateOrUpdateResponse{}, err - } - return result, nil -} - -// Delete - Deletes a static member. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkManagerName - The name of the network manager. -// networkGroupName - The name of the network group. -// staticMemberName - The name of the static member. -// options - StaticMembersClientDeleteOptions contains the optional parameters for the StaticMembersClient.Delete method. -func (client *StaticMembersClient) Delete(ctx context.Context, resourceGroupName string, networkManagerName string, networkGroupName string, staticMemberName string, options *StaticMembersClientDeleteOptions) (StaticMembersClientDeleteResponse, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, networkManagerName, networkGroupName, staticMemberName, options) - if err != nil { - return StaticMembersClientDeleteResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return StaticMembersClientDeleteResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return StaticMembersClientDeleteResponse{}, runtime.NewResponseError(resp) - } - return StaticMembersClientDeleteResponse{}, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *StaticMembersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, networkGroupName string, staticMemberName string, options *StaticMembersClientDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/networkGroups/{networkGroupName}/staticMembers/{staticMemberName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkManagerName == "" { - return nil, errors.New("parameter networkManagerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) - if networkGroupName == "" { - return nil, errors.New("parameter networkGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkGroupName}", url.PathEscape(networkGroupName)) - if staticMemberName == "" { - return nil, errors.New("parameter staticMemberName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{staticMemberName}", url.PathEscape(staticMemberName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets the specified static member. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkManagerName - The name of the network manager. -// networkGroupName - The name of the network group. -// staticMemberName - The name of the static member. -// options - StaticMembersClientGetOptions contains the optional parameters for the StaticMembersClient.Get method. -func (client *StaticMembersClient) Get(ctx context.Context, resourceGroupName string, networkManagerName string, networkGroupName string, staticMemberName string, options *StaticMembersClientGetOptions) (StaticMembersClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, networkManagerName, networkGroupName, staticMemberName, options) - if err != nil { - return StaticMembersClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return StaticMembersClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return StaticMembersClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *StaticMembersClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, networkGroupName string, staticMemberName string, options *StaticMembersClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/networkGroups/{networkGroupName}/staticMembers/{staticMemberName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkManagerName == "" { - return nil, errors.New("parameter networkManagerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) - if networkGroupName == "" { - return nil, errors.New("parameter networkGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkGroupName}", url.PathEscape(networkGroupName)) - if staticMemberName == "" { - return nil, errors.New("parameter staticMemberName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{staticMemberName}", url.PathEscape(staticMemberName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *StaticMembersClient) getHandleResponse(resp *http.Response) (StaticMembersClientGetResponse, error) { - result := StaticMembersClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.StaticMember); err != nil { - return StaticMembersClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Lists the specified static member. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkManagerName - The name of the network manager. -// networkGroupName - The name of the network group. -// options - StaticMembersClientListOptions contains the optional parameters for the StaticMembersClient.List method. -func (client *StaticMembersClient) NewListPager(resourceGroupName string, networkManagerName string, networkGroupName string, options *StaticMembersClientListOptions) *runtime.Pager[StaticMembersClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[StaticMembersClientListResponse]{ - More: func(page StaticMembersClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *StaticMembersClientListResponse) (StaticMembersClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, networkManagerName, networkGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return StaticMembersClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return StaticMembersClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return StaticMembersClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *StaticMembersClient) listCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, networkGroupName string, options *StaticMembersClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/networkGroups/{networkGroupName}/staticMembers" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkManagerName == "" { - return nil, errors.New("parameter networkManagerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) - if networkGroupName == "" { - return nil, errors.New("parameter networkGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkGroupName}", url.PathEscape(networkGroupName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - if options != nil && options.Top != nil { - reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) - } - if options != nil && options.SkipToken != nil { - reqQP.Set("$skipToken", *options.SkipToken) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *StaticMembersClient) listHandleResponse(resp *http.Response) (StaticMembersClientListResponse, error) { - result := StaticMembersClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.StaticMemberListResult); err != nil { - return StaticMembersClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/subnets_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/subnets_client.go deleted file mode 100644 index efbdce39..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/subnets_client.go +++ /dev/null @@ -1,472 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// SubnetsClient contains the methods for the Subnets group. -// Don't use this type directly, use NewSubnetsClient() instead. -type SubnetsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewSubnetsClient creates a new instance of SubnetsClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewSubnetsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SubnetsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &SubnetsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates a subnet in the specified virtual network. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// virtualNetworkName - The name of the virtual network. -// subnetName - The name of the subnet. -// subnetParameters - Parameters supplied to the create or update subnet operation. -// options - SubnetsClientBeginCreateOrUpdateOptions contains the optional parameters for the SubnetsClient.BeginCreateOrUpdate -// method. -func (client *SubnetsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, subnetParameters Subnet, options *SubnetsClientBeginCreateOrUpdateOptions) (*runtime.Poller[SubnetsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, virtualNetworkName, subnetName, subnetParameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[SubnetsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[SubnetsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates or updates a subnet in the specified virtual network. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *SubnetsClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, subnetParameters Subnet, options *SubnetsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, virtualNetworkName, subnetName, subnetParameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *SubnetsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, subnetParameters Subnet, options *SubnetsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualNetworkName == "" { - return nil, errors.New("parameter virtualNetworkName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkName}", url.PathEscape(virtualNetworkName)) - if subnetName == "" { - return nil, errors.New("parameter subnetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subnetName}", url.PathEscape(subnetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, subnetParameters) -} - -// BeginDelete - Deletes the specified subnet. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// virtualNetworkName - The name of the virtual network. -// subnetName - The name of the subnet. -// options - SubnetsClientBeginDeleteOptions contains the optional parameters for the SubnetsClient.BeginDelete method. -func (client *SubnetsClient) BeginDelete(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, options *SubnetsClientBeginDeleteOptions) (*runtime.Poller[SubnetsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, virtualNetworkName, subnetName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[SubnetsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[SubnetsClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes the specified subnet. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *SubnetsClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, options *SubnetsClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, virtualNetworkName, subnetName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *SubnetsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, options *SubnetsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualNetworkName == "" { - return nil, errors.New("parameter virtualNetworkName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkName}", url.PathEscape(virtualNetworkName)) - if subnetName == "" { - return nil, errors.New("parameter subnetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subnetName}", url.PathEscape(subnetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets the specified subnet by virtual network and resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// virtualNetworkName - The name of the virtual network. -// subnetName - The name of the subnet. -// options - SubnetsClientGetOptions contains the optional parameters for the SubnetsClient.Get method. -func (client *SubnetsClient) Get(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, options *SubnetsClientGetOptions) (SubnetsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, virtualNetworkName, subnetName, options) - if err != nil { - return SubnetsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return SubnetsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SubnetsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *SubnetsClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, options *SubnetsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualNetworkName == "" { - return nil, errors.New("parameter virtualNetworkName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkName}", url.PathEscape(virtualNetworkName)) - if subnetName == "" { - return nil, errors.New("parameter subnetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subnetName}", url.PathEscape(subnetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *SubnetsClient) getHandleResponse(resp *http.Response) (SubnetsClientGetResponse, error) { - result := SubnetsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.Subnet); err != nil { - return SubnetsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Gets all subnets in a virtual network. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// virtualNetworkName - The name of the virtual network. -// options - SubnetsClientListOptions contains the optional parameters for the SubnetsClient.List method. -func (client *SubnetsClient) NewListPager(resourceGroupName string, virtualNetworkName string, options *SubnetsClientListOptions) *runtime.Pager[SubnetsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[SubnetsClientListResponse]{ - More: func(page SubnetsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *SubnetsClientListResponse) (SubnetsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, virtualNetworkName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return SubnetsClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return SubnetsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SubnetsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *SubnetsClient) listCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, options *SubnetsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualNetworkName == "" { - return nil, errors.New("parameter virtualNetworkName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkName}", url.PathEscape(virtualNetworkName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *SubnetsClient) listHandleResponse(resp *http.Response) (SubnetsClientListResponse, error) { - result := SubnetsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SubnetListResult); err != nil { - return SubnetsClientListResponse{}, err - } - return result, nil -} - -// BeginPrepareNetworkPolicies - Prepares a subnet by applying network intent policies. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// virtualNetworkName - The name of the virtual network. -// subnetName - The name of the subnet. -// prepareNetworkPoliciesRequestParameters - Parameters supplied to prepare subnet by applying network intent policies. -// options - SubnetsClientBeginPrepareNetworkPoliciesOptions contains the optional parameters for the SubnetsClient.BeginPrepareNetworkPolicies -// method. -func (client *SubnetsClient) BeginPrepareNetworkPolicies(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, prepareNetworkPoliciesRequestParameters PrepareNetworkPoliciesRequest, options *SubnetsClientBeginPrepareNetworkPoliciesOptions) (*runtime.Poller[SubnetsClientPrepareNetworkPoliciesResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.prepareNetworkPolicies(ctx, resourceGroupName, virtualNetworkName, subnetName, prepareNetworkPoliciesRequestParameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[SubnetsClientPrepareNetworkPoliciesResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[SubnetsClientPrepareNetworkPoliciesResponse](options.ResumeToken, client.pl, nil) - } -} - -// PrepareNetworkPolicies - Prepares a subnet by applying network intent policies. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *SubnetsClient) prepareNetworkPolicies(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, prepareNetworkPoliciesRequestParameters PrepareNetworkPoliciesRequest, options *SubnetsClientBeginPrepareNetworkPoliciesOptions) (*http.Response, error) { - req, err := client.prepareNetworkPoliciesCreateRequest(ctx, resourceGroupName, virtualNetworkName, subnetName, prepareNetworkPoliciesRequestParameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// prepareNetworkPoliciesCreateRequest creates the PrepareNetworkPolicies request. -func (client *SubnetsClient) prepareNetworkPoliciesCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, prepareNetworkPoliciesRequestParameters PrepareNetworkPoliciesRequest, options *SubnetsClientBeginPrepareNetworkPoliciesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/PrepareNetworkPolicies" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualNetworkName == "" { - return nil, errors.New("parameter virtualNetworkName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkName}", url.PathEscape(virtualNetworkName)) - if subnetName == "" { - return nil, errors.New("parameter subnetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subnetName}", url.PathEscape(subnetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, prepareNetworkPoliciesRequestParameters) -} - -// BeginUnprepareNetworkPolicies - Unprepares a subnet by removing network intent policies. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// virtualNetworkName - The name of the virtual network. -// subnetName - The name of the subnet. -// unprepareNetworkPoliciesRequestParameters - Parameters supplied to unprepare subnet to remove network intent policies. -// options - SubnetsClientBeginUnprepareNetworkPoliciesOptions contains the optional parameters for the SubnetsClient.BeginUnprepareNetworkPolicies -// method. -func (client *SubnetsClient) BeginUnprepareNetworkPolicies(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, unprepareNetworkPoliciesRequestParameters UnprepareNetworkPoliciesRequest, options *SubnetsClientBeginUnprepareNetworkPoliciesOptions) (*runtime.Poller[SubnetsClientUnprepareNetworkPoliciesResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.unprepareNetworkPolicies(ctx, resourceGroupName, virtualNetworkName, subnetName, unprepareNetworkPoliciesRequestParameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[SubnetsClientUnprepareNetworkPoliciesResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[SubnetsClientUnprepareNetworkPoliciesResponse](options.ResumeToken, client.pl, nil) - } -} - -// UnprepareNetworkPolicies - Unprepares a subnet by removing network intent policies. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *SubnetsClient) unprepareNetworkPolicies(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, unprepareNetworkPoliciesRequestParameters UnprepareNetworkPoliciesRequest, options *SubnetsClientBeginUnprepareNetworkPoliciesOptions) (*http.Response, error) { - req, err := client.unprepareNetworkPoliciesCreateRequest(ctx, resourceGroupName, virtualNetworkName, subnetName, unprepareNetworkPoliciesRequestParameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// unprepareNetworkPoliciesCreateRequest creates the UnprepareNetworkPolicies request. -func (client *SubnetsClient) unprepareNetworkPoliciesCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, unprepareNetworkPoliciesRequestParameters UnprepareNetworkPoliciesRequest, options *SubnetsClientBeginUnprepareNetworkPoliciesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/UnprepareNetworkPolicies" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualNetworkName == "" { - return nil, errors.New("parameter virtualNetworkName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkName}", url.PathEscape(virtualNetworkName)) - if subnetName == "" { - return nil, errors.New("parameter subnetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subnetName}", url.PathEscape(subnetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, unprepareNetworkPoliciesRequestParameters) -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/subscriptionnetworkmanagerconnections_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/subscriptionnetworkmanagerconnections_client.go deleted file mode 100644 index 10780e97..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/subscriptionnetworkmanagerconnections_client.go +++ /dev/null @@ -1,272 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strconv" - "strings" -) - -// SubscriptionNetworkManagerConnectionsClient contains the methods for the SubscriptionNetworkManagerConnections group. -// Don't use this type directly, use NewSubscriptionNetworkManagerConnectionsClient() instead. -type SubscriptionNetworkManagerConnectionsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewSubscriptionNetworkManagerConnectionsClient creates a new instance of SubscriptionNetworkManagerConnectionsClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewSubscriptionNetworkManagerConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SubscriptionNetworkManagerConnectionsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &SubscriptionNetworkManagerConnectionsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// CreateOrUpdate - Create a network manager connection on this subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// networkManagerConnectionName - Name for the network manager connection. -// parameters - Network manager connection to be created/updated. -// options - SubscriptionNetworkManagerConnectionsClientCreateOrUpdateOptions contains the optional parameters for the SubscriptionNetworkManagerConnectionsClient.CreateOrUpdate -// method. -func (client *SubscriptionNetworkManagerConnectionsClient) CreateOrUpdate(ctx context.Context, networkManagerConnectionName string, parameters ManagerConnection, options *SubscriptionNetworkManagerConnectionsClientCreateOrUpdateOptions) (SubscriptionNetworkManagerConnectionsClientCreateOrUpdateResponse, error) { - req, err := client.createOrUpdateCreateRequest(ctx, networkManagerConnectionName, parameters, options) - if err != nil { - return SubscriptionNetworkManagerConnectionsClientCreateOrUpdateResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return SubscriptionNetworkManagerConnectionsClientCreateOrUpdateResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return SubscriptionNetworkManagerConnectionsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) - } - return client.createOrUpdateHandleResponse(resp) -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *SubscriptionNetworkManagerConnectionsClient) createOrUpdateCreateRequest(ctx context.Context, networkManagerConnectionName string, parameters ManagerConnection, options *SubscriptionNetworkManagerConnectionsClientCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkManagerConnections/{networkManagerConnectionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if networkManagerConnectionName == "" { - return nil, errors.New("parameter networkManagerConnectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkManagerConnectionName}", url.PathEscape(networkManagerConnectionName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// createOrUpdateHandleResponse handles the CreateOrUpdate response. -func (client *SubscriptionNetworkManagerConnectionsClient) createOrUpdateHandleResponse(resp *http.Response) (SubscriptionNetworkManagerConnectionsClientCreateOrUpdateResponse, error) { - result := SubscriptionNetworkManagerConnectionsClientCreateOrUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ManagerConnection); err != nil { - return SubscriptionNetworkManagerConnectionsClientCreateOrUpdateResponse{}, err - } - return result, nil -} - -// Delete - Delete specified connection created by this subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// networkManagerConnectionName - Name for the network manager connection. -// options - SubscriptionNetworkManagerConnectionsClientDeleteOptions contains the optional parameters for the SubscriptionNetworkManagerConnectionsClient.Delete -// method. -func (client *SubscriptionNetworkManagerConnectionsClient) Delete(ctx context.Context, networkManagerConnectionName string, options *SubscriptionNetworkManagerConnectionsClientDeleteOptions) (SubscriptionNetworkManagerConnectionsClientDeleteResponse, error) { - req, err := client.deleteCreateRequest(ctx, networkManagerConnectionName, options) - if err != nil { - return SubscriptionNetworkManagerConnectionsClientDeleteResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return SubscriptionNetworkManagerConnectionsClientDeleteResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return SubscriptionNetworkManagerConnectionsClientDeleteResponse{}, runtime.NewResponseError(resp) - } - return SubscriptionNetworkManagerConnectionsClientDeleteResponse{}, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *SubscriptionNetworkManagerConnectionsClient) deleteCreateRequest(ctx context.Context, networkManagerConnectionName string, options *SubscriptionNetworkManagerConnectionsClientDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkManagerConnections/{networkManagerConnectionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if networkManagerConnectionName == "" { - return nil, errors.New("parameter networkManagerConnectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkManagerConnectionName}", url.PathEscape(networkManagerConnectionName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Get a specified connection created by this subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// networkManagerConnectionName - Name for the network manager connection. -// options - SubscriptionNetworkManagerConnectionsClientGetOptions contains the optional parameters for the SubscriptionNetworkManagerConnectionsClient.Get -// method. -func (client *SubscriptionNetworkManagerConnectionsClient) Get(ctx context.Context, networkManagerConnectionName string, options *SubscriptionNetworkManagerConnectionsClientGetOptions) (SubscriptionNetworkManagerConnectionsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, networkManagerConnectionName, options) - if err != nil { - return SubscriptionNetworkManagerConnectionsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return SubscriptionNetworkManagerConnectionsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SubscriptionNetworkManagerConnectionsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *SubscriptionNetworkManagerConnectionsClient) getCreateRequest(ctx context.Context, networkManagerConnectionName string, options *SubscriptionNetworkManagerConnectionsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkManagerConnections/{networkManagerConnectionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if networkManagerConnectionName == "" { - return nil, errors.New("parameter networkManagerConnectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkManagerConnectionName}", url.PathEscape(networkManagerConnectionName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *SubscriptionNetworkManagerConnectionsClient) getHandleResponse(resp *http.Response) (SubscriptionNetworkManagerConnectionsClientGetResponse, error) { - result := SubscriptionNetworkManagerConnectionsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ManagerConnection); err != nil { - return SubscriptionNetworkManagerConnectionsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - List all network manager connections created by this subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// options - SubscriptionNetworkManagerConnectionsClientListOptions contains the optional parameters for the SubscriptionNetworkManagerConnectionsClient.List -// method. -func (client *SubscriptionNetworkManagerConnectionsClient) NewListPager(options *SubscriptionNetworkManagerConnectionsClientListOptions) *runtime.Pager[SubscriptionNetworkManagerConnectionsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[SubscriptionNetworkManagerConnectionsClientListResponse]{ - More: func(page SubscriptionNetworkManagerConnectionsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *SubscriptionNetworkManagerConnectionsClientListResponse) (SubscriptionNetworkManagerConnectionsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return SubscriptionNetworkManagerConnectionsClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return SubscriptionNetworkManagerConnectionsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SubscriptionNetworkManagerConnectionsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *SubscriptionNetworkManagerConnectionsClient) listCreateRequest(ctx context.Context, options *SubscriptionNetworkManagerConnectionsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkManagerConnections" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - if options != nil && options.Top != nil { - reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) - } - if options != nil && options.SkipToken != nil { - reqQP.Set("$skipToken", *options.SkipToken) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *SubscriptionNetworkManagerConnectionsClient) listHandleResponse(resp *http.Response) (SubscriptionNetworkManagerConnectionsClientListResponse, error) { - result := SubscriptionNetworkManagerConnectionsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ManagerConnectionListResult); err != nil { - return SubscriptionNetworkManagerConnectionsClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/time_rfc3339.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/time_rfc3339.go deleted file mode 100644 index c9d8a00e..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/time_rfc3339.go +++ /dev/null @@ -1,87 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" - "regexp" - "strings" - "time" -) - -const ( - utcLayoutJSON = `"2006-01-02T15:04:05.999999999"` - utcLayout = "2006-01-02T15:04:05.999999999" - rfc3339JSON = `"` + time.RFC3339Nano + `"` -) - -// Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. -var tzOffsetRegex = regexp.MustCompile(`(Z|z|\+|-)(\d+:\d+)*"*$`) - -type timeRFC3339 time.Time - -func (t timeRFC3339) MarshalJSON() (json []byte, err error) { - tt := time.Time(t) - return tt.MarshalJSON() -} - -func (t timeRFC3339) MarshalText() (text []byte, err error) { - tt := time.Time(t) - return tt.MarshalText() -} - -func (t *timeRFC3339) UnmarshalJSON(data []byte) error { - layout := utcLayoutJSON - if tzOffsetRegex.Match(data) { - layout = rfc3339JSON - } - return t.Parse(layout, string(data)) -} - -func (t *timeRFC3339) UnmarshalText(data []byte) (err error) { - layout := utcLayout - if tzOffsetRegex.Match(data) { - layout = time.RFC3339Nano - } - return t.Parse(layout, string(data)) -} - -func (t *timeRFC3339) Parse(layout, value string) error { - p, err := time.Parse(layout, strings.ToUpper(value)) - *t = timeRFC3339(p) - return err -} - -func populateTimeRFC3339(m map[string]interface{}, k string, t *time.Time) { - if t == nil { - return - } else if azcore.IsNullValue(t) { - m[k] = nil - return - } else if reflect.ValueOf(t).IsNil() { - return - } - m[k] = (*timeRFC3339)(t) -} - -func unpopulateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { - if data == nil || strings.EqualFold(string(data), "null") { - return nil - } - var aux timeRFC3339 - if err := json.Unmarshal(data, &aux); err != nil { - return fmt.Errorf("struct field %s: %v", fn, err) - } - *t = (*time.Time)(&aux) - return nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/usages_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/usages_client.go deleted file mode 100644 index 5af3a803..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/usages_client.go +++ /dev/null @@ -1,121 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// UsagesClient contains the methods for the Usages group. -// Don't use this type directly, use NewUsagesClient() instead. -type UsagesClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewUsagesClient creates a new instance of UsagesClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewUsagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*UsagesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &UsagesClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// NewListPager - List network usages for a subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// location - The location where resource usage is queried. -// options - UsagesClientListOptions contains the optional parameters for the UsagesClient.List method. -func (client *UsagesClient) NewListPager(location string, options *UsagesClientListOptions) *runtime.Pager[UsagesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[UsagesClientListResponse]{ - More: func(page UsagesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *UsagesClientListResponse) (UsagesClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, location, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return UsagesClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return UsagesClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return UsagesClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *UsagesClient) listCreateRequest(ctx context.Context, location string, options *UsagesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/usages" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *UsagesClient) listHandleResponse(resp *http.Response) (UsagesClientListResponse, error) { - result := UsagesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.UsagesListResult); err != nil { - return UsagesClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/virtualappliances_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/virtualappliances_client.go deleted file mode 100644 index 9850bb7c..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/virtualappliances_client.go +++ /dev/null @@ -1,429 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// VirtualAppliancesClient contains the methods for the NetworkVirtualAppliances group. -// Don't use this type directly, use NewVirtualAppliancesClient() instead. -type VirtualAppliancesClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewVirtualAppliancesClient creates a new instance of VirtualAppliancesClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewVirtualAppliancesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualAppliancesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &VirtualAppliancesClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates the specified Network Virtual Appliance. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkVirtualApplianceName - The name of Network Virtual Appliance. -// parameters - Parameters supplied to the create or update Network Virtual Appliance. -// options - VirtualAppliancesClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualAppliancesClient.BeginCreateOrUpdate -// method. -func (client *VirtualAppliancesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, parameters VirtualAppliance, options *VirtualAppliancesClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualAppliancesClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, networkVirtualApplianceName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VirtualAppliancesClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[VirtualAppliancesClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates or updates the specified Network Virtual Appliance. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VirtualAppliancesClient) createOrUpdate(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, parameters VirtualAppliance, options *VirtualAppliancesClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, networkVirtualApplianceName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *VirtualAppliancesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, parameters VirtualAppliance, options *VirtualAppliancesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkVirtualApplianceName == "" { - return nil, errors.New("parameter networkVirtualApplianceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkVirtualApplianceName}", url.PathEscape(networkVirtualApplianceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginDelete - Deletes the specified Network Virtual Appliance. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkVirtualApplianceName - The name of Network Virtual Appliance. -// options - VirtualAppliancesClientBeginDeleteOptions contains the optional parameters for the VirtualAppliancesClient.BeginDelete -// method. -func (client *VirtualAppliancesClient) BeginDelete(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, options *VirtualAppliancesClientBeginDeleteOptions) (*runtime.Poller[VirtualAppliancesClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, networkVirtualApplianceName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VirtualAppliancesClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[VirtualAppliancesClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes the specified Network Virtual Appliance. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VirtualAppliancesClient) deleteOperation(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, options *VirtualAppliancesClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, networkVirtualApplianceName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *VirtualAppliancesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, options *VirtualAppliancesClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkVirtualApplianceName == "" { - return nil, errors.New("parameter networkVirtualApplianceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkVirtualApplianceName}", url.PathEscape(networkVirtualApplianceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets the specified Network Virtual Appliance. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkVirtualApplianceName - The name of Network Virtual Appliance. -// options - VirtualAppliancesClientGetOptions contains the optional parameters for the VirtualAppliancesClient.Get method. -func (client *VirtualAppliancesClient) Get(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, options *VirtualAppliancesClientGetOptions) (VirtualAppliancesClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, networkVirtualApplianceName, options) - if err != nil { - return VirtualAppliancesClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualAppliancesClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualAppliancesClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *VirtualAppliancesClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, options *VirtualAppliancesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkVirtualApplianceName == "" { - return nil, errors.New("parameter networkVirtualApplianceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkVirtualApplianceName}", url.PathEscape(networkVirtualApplianceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *VirtualAppliancesClient) getHandleResponse(resp *http.Response) (VirtualAppliancesClientGetResponse, error) { - result := VirtualAppliancesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualAppliance); err != nil { - return VirtualAppliancesClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Gets all Network Virtual Appliances in a subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// options - VirtualAppliancesClientListOptions contains the optional parameters for the VirtualAppliancesClient.List method. -func (client *VirtualAppliancesClient) NewListPager(options *VirtualAppliancesClientListOptions) *runtime.Pager[VirtualAppliancesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualAppliancesClientListResponse]{ - More: func(page VirtualAppliancesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VirtualAppliancesClientListResponse) (VirtualAppliancesClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return VirtualAppliancesClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualAppliancesClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualAppliancesClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *VirtualAppliancesClient) listCreateRequest(ctx context.Context, options *VirtualAppliancesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkVirtualAppliances" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *VirtualAppliancesClient) listHandleResponse(resp *http.Response) (VirtualAppliancesClientListResponse, error) { - result := VirtualAppliancesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualApplianceListResult); err != nil { - return VirtualAppliancesClientListResponse{}, err - } - return result, nil -} - -// NewListByResourceGroupPager - Lists all Network Virtual Appliances in a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// options - VirtualAppliancesClientListByResourceGroupOptions contains the optional parameters for the VirtualAppliancesClient.ListByResourceGroup -// method. -func (client *VirtualAppliancesClient) NewListByResourceGroupPager(resourceGroupName string, options *VirtualAppliancesClientListByResourceGroupOptions) *runtime.Pager[VirtualAppliancesClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualAppliancesClientListByResourceGroupResponse]{ - More: func(page VirtualAppliancesClientListByResourceGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VirtualAppliancesClientListByResourceGroupResponse) (VirtualAppliancesClientListByResourceGroupResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return VirtualAppliancesClientListByResourceGroupResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualAppliancesClientListByResourceGroupResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualAppliancesClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) - } - return client.listByResourceGroupHandleResponse(resp) - }, - }) -} - -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *VirtualAppliancesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *VirtualAppliancesClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *VirtualAppliancesClient) listByResourceGroupHandleResponse(resp *http.Response) (VirtualAppliancesClientListByResourceGroupResponse, error) { - result := VirtualAppliancesClientListByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualApplianceListResult); err != nil { - return VirtualAppliancesClientListByResourceGroupResponse{}, err - } - return result, nil -} - -// UpdateTags - Updates a Network Virtual Appliance. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of Network Virtual Appliance. -// networkVirtualApplianceName - The name of Network Virtual Appliance being updated. -// parameters - Parameters supplied to Update Network Virtual Appliance Tags. -// options - VirtualAppliancesClientUpdateTagsOptions contains the optional parameters for the VirtualAppliancesClient.UpdateTags -// method. -func (client *VirtualAppliancesClient) UpdateTags(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, parameters TagsObject, options *VirtualAppliancesClientUpdateTagsOptions) (VirtualAppliancesClientUpdateTagsResponse, error) { - req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, networkVirtualApplianceName, parameters, options) - if err != nil { - return VirtualAppliancesClientUpdateTagsResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualAppliancesClientUpdateTagsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualAppliancesClientUpdateTagsResponse{}, runtime.NewResponseError(resp) - } - return client.updateTagsHandleResponse(resp) -} - -// updateTagsCreateRequest creates the UpdateTags request. -func (client *VirtualAppliancesClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, parameters TagsObject, options *VirtualAppliancesClientUpdateTagsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkVirtualApplianceName == "" { - return nil, errors.New("parameter networkVirtualApplianceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkVirtualApplianceName}", url.PathEscape(networkVirtualApplianceName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// updateTagsHandleResponse handles the UpdateTags response. -func (client *VirtualAppliancesClient) updateTagsHandleResponse(resp *http.Response) (VirtualAppliancesClientUpdateTagsResponse, error) { - result := VirtualAppliancesClientUpdateTagsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualAppliance); err != nil { - return VirtualAppliancesClientUpdateTagsResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/virtualappliancesites_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/virtualappliancesites_client.go deleted file mode 100644 index 77988982..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/virtualappliancesites_client.go +++ /dev/null @@ -1,330 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// VirtualApplianceSitesClient contains the methods for the VirtualApplianceSites group. -// Don't use this type directly, use NewVirtualApplianceSitesClient() instead. -type VirtualApplianceSitesClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewVirtualApplianceSitesClient creates a new instance of VirtualApplianceSitesClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewVirtualApplianceSitesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualApplianceSitesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &VirtualApplianceSitesClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates the specified Network Virtual Appliance Site. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkVirtualApplianceName - The name of the Network Virtual Appliance. -// siteName - The name of the site. -// parameters - Parameters supplied to the create or update Network Virtual Appliance Site operation. -// options - VirtualApplianceSitesClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualApplianceSitesClient.BeginCreateOrUpdate -// method. -func (client *VirtualApplianceSitesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, siteName string, parameters VirtualApplianceSite, options *VirtualApplianceSitesClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualApplianceSitesClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, networkVirtualApplianceName, siteName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VirtualApplianceSitesClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[VirtualApplianceSitesClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates or updates the specified Network Virtual Appliance Site. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VirtualApplianceSitesClient) createOrUpdate(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, siteName string, parameters VirtualApplianceSite, options *VirtualApplianceSitesClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, networkVirtualApplianceName, siteName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *VirtualApplianceSitesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, siteName string, parameters VirtualApplianceSite, options *VirtualApplianceSitesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/virtualApplianceSites/{siteName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkVirtualApplianceName == "" { - return nil, errors.New("parameter networkVirtualApplianceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkVirtualApplianceName}", url.PathEscape(networkVirtualApplianceName)) - if siteName == "" { - return nil, errors.New("parameter siteName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{siteName}", url.PathEscape(siteName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginDelete - Deletes the specified site from a Virtual Appliance. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkVirtualApplianceName - The name of the Network Virtual Appliance. -// siteName - The name of the site. -// options - VirtualApplianceSitesClientBeginDeleteOptions contains the optional parameters for the VirtualApplianceSitesClient.BeginDelete -// method. -func (client *VirtualApplianceSitesClient) BeginDelete(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, siteName string, options *VirtualApplianceSitesClientBeginDeleteOptions) (*runtime.Poller[VirtualApplianceSitesClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, networkVirtualApplianceName, siteName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VirtualApplianceSitesClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[VirtualApplianceSitesClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes the specified site from a Virtual Appliance. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VirtualApplianceSitesClient) deleteOperation(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, siteName string, options *VirtualApplianceSitesClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, networkVirtualApplianceName, siteName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *VirtualApplianceSitesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, siteName string, options *VirtualApplianceSitesClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/virtualApplianceSites/{siteName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkVirtualApplianceName == "" { - return nil, errors.New("parameter networkVirtualApplianceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkVirtualApplianceName}", url.PathEscape(networkVirtualApplianceName)) - if siteName == "" { - return nil, errors.New("parameter siteName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{siteName}", url.PathEscape(siteName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets the specified Virtual Appliance Site. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkVirtualApplianceName - The name of the Network Virtual Appliance. -// siteName - The name of the site. -// options - VirtualApplianceSitesClientGetOptions contains the optional parameters for the VirtualApplianceSitesClient.Get -// method. -func (client *VirtualApplianceSitesClient) Get(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, siteName string, options *VirtualApplianceSitesClientGetOptions) (VirtualApplianceSitesClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, networkVirtualApplianceName, siteName, options) - if err != nil { - return VirtualApplianceSitesClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualApplianceSitesClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualApplianceSitesClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *VirtualApplianceSitesClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, siteName string, options *VirtualApplianceSitesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/virtualApplianceSites/{siteName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkVirtualApplianceName == "" { - return nil, errors.New("parameter networkVirtualApplianceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkVirtualApplianceName}", url.PathEscape(networkVirtualApplianceName)) - if siteName == "" { - return nil, errors.New("parameter siteName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{siteName}", url.PathEscape(siteName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *VirtualApplianceSitesClient) getHandleResponse(resp *http.Response) (VirtualApplianceSitesClientGetResponse, error) { - result := VirtualApplianceSitesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualApplianceSite); err != nil { - return VirtualApplianceSitesClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Lists all Network Virtual Appliance Sites in a Network Virtual Appliance resource. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkVirtualApplianceName - The name of the Network Virtual Appliance. -// options - VirtualApplianceSitesClientListOptions contains the optional parameters for the VirtualApplianceSitesClient.List -// method. -func (client *VirtualApplianceSitesClient) NewListPager(resourceGroupName string, networkVirtualApplianceName string, options *VirtualApplianceSitesClientListOptions) *runtime.Pager[VirtualApplianceSitesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualApplianceSitesClientListResponse]{ - More: func(page VirtualApplianceSitesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VirtualApplianceSitesClientListResponse) (VirtualApplianceSitesClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, networkVirtualApplianceName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return VirtualApplianceSitesClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualApplianceSitesClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualApplianceSitesClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *VirtualApplianceSitesClient) listCreateRequest(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, options *VirtualApplianceSitesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/virtualApplianceSites" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkVirtualApplianceName == "" { - return nil, errors.New("parameter networkVirtualApplianceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkVirtualApplianceName}", url.PathEscape(networkVirtualApplianceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *VirtualApplianceSitesClient) listHandleResponse(resp *http.Response) (VirtualApplianceSitesClientListResponse, error) { - result := VirtualApplianceSitesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualApplianceSiteListResult); err != nil { - return VirtualApplianceSitesClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/virtualapplianceskus_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/virtualapplianceskus_client.go deleted file mode 100644 index 36cbd79b..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/virtualapplianceskus_client.go +++ /dev/null @@ -1,169 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// VirtualApplianceSKUsClient contains the methods for the VirtualApplianceSKUs group. -// Don't use this type directly, use NewVirtualApplianceSKUsClient() instead. -type VirtualApplianceSKUsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewVirtualApplianceSKUsClient creates a new instance of VirtualApplianceSKUsClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewVirtualApplianceSKUsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualApplianceSKUsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &VirtualApplianceSKUsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// Get - Retrieves a single available sku for network virtual appliance. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// skuName - Name of the Sku. -// options - VirtualApplianceSKUsClientGetOptions contains the optional parameters for the VirtualApplianceSKUsClient.Get -// method. -func (client *VirtualApplianceSKUsClient) Get(ctx context.Context, skuName string, options *VirtualApplianceSKUsClientGetOptions) (VirtualApplianceSKUsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, skuName, options) - if err != nil { - return VirtualApplianceSKUsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualApplianceSKUsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualApplianceSKUsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *VirtualApplianceSKUsClient) getCreateRequest(ctx context.Context, skuName string, options *VirtualApplianceSKUsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkVirtualApplianceSkus/{skuName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if skuName == "" { - return nil, errors.New("parameter skuName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{skuName}", url.PathEscape(skuName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *VirtualApplianceSKUsClient) getHandleResponse(resp *http.Response) (VirtualApplianceSKUsClientGetResponse, error) { - result := VirtualApplianceSKUsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualApplianceSKU); err != nil { - return VirtualApplianceSKUsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - List all SKUs available for a virtual appliance. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// options - VirtualApplianceSKUsClientListOptions contains the optional parameters for the VirtualApplianceSKUsClient.List -// method. -func (client *VirtualApplianceSKUsClient) NewListPager(options *VirtualApplianceSKUsClientListOptions) *runtime.Pager[VirtualApplianceSKUsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualApplianceSKUsClientListResponse]{ - More: func(page VirtualApplianceSKUsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VirtualApplianceSKUsClientListResponse) (VirtualApplianceSKUsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return VirtualApplianceSKUsClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualApplianceSKUsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualApplianceSKUsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *VirtualApplianceSKUsClient) listCreateRequest(ctx context.Context, options *VirtualApplianceSKUsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkVirtualApplianceSkus" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *VirtualApplianceSKUsClient) listHandleResponse(resp *http.Response) (VirtualApplianceSKUsClientListResponse, error) { - result := VirtualApplianceSKUsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualApplianceSKUListResult); err != nil { - return VirtualApplianceSKUsClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/virtualhubbgpconnection_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/virtualhubbgpconnection_client.go deleted file mode 100644 index 799f6d69..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/virtualhubbgpconnection_client.go +++ /dev/null @@ -1,260 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// VirtualHubBgpConnectionClient contains the methods for the VirtualHubBgpConnection group. -// Don't use this type directly, use NewVirtualHubBgpConnectionClient() instead. -type VirtualHubBgpConnectionClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewVirtualHubBgpConnectionClient creates a new instance of VirtualHubBgpConnectionClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewVirtualHubBgpConnectionClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualHubBgpConnectionClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &VirtualHubBgpConnectionClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates a VirtualHubBgpConnection resource if it doesn't exist else updates the existing VirtualHubBgpConnection. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the VirtualHub. -// virtualHubName - The name of the VirtualHub. -// connectionName - The name of the connection. -// parameters - Parameters of Bgp connection. -// options - VirtualHubBgpConnectionClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualHubBgpConnectionClient.BeginCreateOrUpdate -// method. -func (client *VirtualHubBgpConnectionClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string, parameters BgpConnection, options *VirtualHubBgpConnectionClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualHubBgpConnectionClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, virtualHubName, connectionName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VirtualHubBgpConnectionClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[VirtualHubBgpConnectionClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates a VirtualHubBgpConnection resource if it doesn't exist else updates the existing VirtualHubBgpConnection. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VirtualHubBgpConnectionClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string, parameters BgpConnection, options *VirtualHubBgpConnectionClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, virtualHubName, connectionName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *VirtualHubBgpConnectionClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string, parameters BgpConnection, options *VirtualHubBgpConnectionClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/bgpConnections/{connectionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualHubName == "" { - return nil, errors.New("parameter virtualHubName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualHubName}", url.PathEscape(virtualHubName)) - if connectionName == "" { - return nil, errors.New("parameter connectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginDelete - Deletes a VirtualHubBgpConnection. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the VirtualHubBgpConnection. -// virtualHubName - The name of the VirtualHub. -// connectionName - The name of the connection. -// options - VirtualHubBgpConnectionClientBeginDeleteOptions contains the optional parameters for the VirtualHubBgpConnectionClient.BeginDelete -// method. -func (client *VirtualHubBgpConnectionClient) BeginDelete(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string, options *VirtualHubBgpConnectionClientBeginDeleteOptions) (*runtime.Poller[VirtualHubBgpConnectionClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, virtualHubName, connectionName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VirtualHubBgpConnectionClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[VirtualHubBgpConnectionClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes a VirtualHubBgpConnection. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VirtualHubBgpConnectionClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string, options *VirtualHubBgpConnectionClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, virtualHubName, connectionName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *VirtualHubBgpConnectionClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string, options *VirtualHubBgpConnectionClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/bgpConnections/{connectionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualHubName == "" { - return nil, errors.New("parameter virtualHubName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualHubName}", url.PathEscape(virtualHubName)) - if connectionName == "" { - return nil, errors.New("parameter connectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Retrieves the details of a Virtual Hub Bgp Connection. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the VirtualHub. -// virtualHubName - The name of the VirtualHub. -// connectionName - The name of the connection. -// options - VirtualHubBgpConnectionClientGetOptions contains the optional parameters for the VirtualHubBgpConnectionClient.Get -// method. -func (client *VirtualHubBgpConnectionClient) Get(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string, options *VirtualHubBgpConnectionClientGetOptions) (VirtualHubBgpConnectionClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, virtualHubName, connectionName, options) - if err != nil { - return VirtualHubBgpConnectionClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualHubBgpConnectionClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualHubBgpConnectionClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *VirtualHubBgpConnectionClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string, options *VirtualHubBgpConnectionClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/bgpConnections/{connectionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualHubName == "" { - return nil, errors.New("parameter virtualHubName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualHubName}", url.PathEscape(virtualHubName)) - if connectionName == "" { - return nil, errors.New("parameter connectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *VirtualHubBgpConnectionClient) getHandleResponse(resp *http.Response) (VirtualHubBgpConnectionClientGetResponse, error) { - result := VirtualHubBgpConnectionClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.BgpConnection); err != nil { - return VirtualHubBgpConnectionClientGetResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/virtualhubbgpconnections_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/virtualhubbgpconnections_client.go deleted file mode 100644 index a3b73a19..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/virtualhubbgpconnections_client.go +++ /dev/null @@ -1,267 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// VirtualHubBgpConnectionsClient contains the methods for the VirtualHubBgpConnections group. -// Don't use this type directly, use NewVirtualHubBgpConnectionsClient() instead. -type VirtualHubBgpConnectionsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewVirtualHubBgpConnectionsClient creates a new instance of VirtualHubBgpConnectionsClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewVirtualHubBgpConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualHubBgpConnectionsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &VirtualHubBgpConnectionsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// NewListPager - Retrieves the details of all VirtualHubBgpConnections. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the VirtualHub. -// virtualHubName - The name of the VirtualHub. -// options - VirtualHubBgpConnectionsClientListOptions contains the optional parameters for the VirtualHubBgpConnectionsClient.List -// method. -func (client *VirtualHubBgpConnectionsClient) NewListPager(resourceGroupName string, virtualHubName string, options *VirtualHubBgpConnectionsClientListOptions) *runtime.Pager[VirtualHubBgpConnectionsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualHubBgpConnectionsClientListResponse]{ - More: func(page VirtualHubBgpConnectionsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VirtualHubBgpConnectionsClientListResponse) (VirtualHubBgpConnectionsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, virtualHubName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return VirtualHubBgpConnectionsClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualHubBgpConnectionsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualHubBgpConnectionsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *VirtualHubBgpConnectionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, options *VirtualHubBgpConnectionsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/bgpConnections" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualHubName == "" { - return nil, errors.New("parameter virtualHubName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualHubName}", url.PathEscape(virtualHubName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *VirtualHubBgpConnectionsClient) listHandleResponse(resp *http.Response) (VirtualHubBgpConnectionsClientListResponse, error) { - result := VirtualHubBgpConnectionsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ListVirtualHubBgpConnectionResults); err != nil { - return VirtualHubBgpConnectionsClientListResponse{}, err - } - return result, nil -} - -// BeginListAdvertisedRoutes - Retrieves a list of routes the virtual hub bgp connection is advertising to the specified peer. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// hubName - The name of the virtual hub. -// connectionName - The name of the virtual hub bgp connection. -// options - VirtualHubBgpConnectionsClientBeginListAdvertisedRoutesOptions contains the optional parameters for the VirtualHubBgpConnectionsClient.BeginListAdvertisedRoutes -// method. -func (client *VirtualHubBgpConnectionsClient) BeginListAdvertisedRoutes(ctx context.Context, resourceGroupName string, hubName string, connectionName string, options *VirtualHubBgpConnectionsClientBeginListAdvertisedRoutesOptions) (*runtime.Poller[VirtualHubBgpConnectionsClientListAdvertisedRoutesResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.listAdvertisedRoutes(ctx, resourceGroupName, hubName, connectionName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VirtualHubBgpConnectionsClientListAdvertisedRoutesResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[VirtualHubBgpConnectionsClientListAdvertisedRoutesResponse](options.ResumeToken, client.pl, nil) - } -} - -// ListAdvertisedRoutes - Retrieves a list of routes the virtual hub bgp connection is advertising to the specified peer. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VirtualHubBgpConnectionsClient) listAdvertisedRoutes(ctx context.Context, resourceGroupName string, hubName string, connectionName string, options *VirtualHubBgpConnectionsClientBeginListAdvertisedRoutesOptions) (*http.Response, error) { - req, err := client.listAdvertisedRoutesCreateRequest(ctx, resourceGroupName, hubName, connectionName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// listAdvertisedRoutesCreateRequest creates the ListAdvertisedRoutes request. -func (client *VirtualHubBgpConnectionsClient) listAdvertisedRoutesCreateRequest(ctx context.Context, resourceGroupName string, hubName string, connectionName string, options *VirtualHubBgpConnectionsClientBeginListAdvertisedRoutesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{hubName}/bgpConnections/{connectionName}/advertisedRoutes" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if hubName == "" { - return nil, errors.New("parameter hubName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{hubName}", url.PathEscape(hubName)) - if connectionName == "" { - return nil, errors.New("parameter connectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginListLearnedRoutes - Retrieves a list of routes the virtual hub bgp connection has learned. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// hubName - The name of the virtual hub. -// connectionName - The name of the virtual hub bgp connection. -// options - VirtualHubBgpConnectionsClientBeginListLearnedRoutesOptions contains the optional parameters for the VirtualHubBgpConnectionsClient.BeginListLearnedRoutes -// method. -func (client *VirtualHubBgpConnectionsClient) BeginListLearnedRoutes(ctx context.Context, resourceGroupName string, hubName string, connectionName string, options *VirtualHubBgpConnectionsClientBeginListLearnedRoutesOptions) (*runtime.Poller[VirtualHubBgpConnectionsClientListLearnedRoutesResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.listLearnedRoutes(ctx, resourceGroupName, hubName, connectionName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VirtualHubBgpConnectionsClientListLearnedRoutesResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[VirtualHubBgpConnectionsClientListLearnedRoutesResponse](options.ResumeToken, client.pl, nil) - } -} - -// ListLearnedRoutes - Retrieves a list of routes the virtual hub bgp connection has learned. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VirtualHubBgpConnectionsClient) listLearnedRoutes(ctx context.Context, resourceGroupName string, hubName string, connectionName string, options *VirtualHubBgpConnectionsClientBeginListLearnedRoutesOptions) (*http.Response, error) { - req, err := client.listLearnedRoutesCreateRequest(ctx, resourceGroupName, hubName, connectionName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// listLearnedRoutesCreateRequest creates the ListLearnedRoutes request. -func (client *VirtualHubBgpConnectionsClient) listLearnedRoutesCreateRequest(ctx context.Context, resourceGroupName string, hubName string, connectionName string, options *VirtualHubBgpConnectionsClientBeginListLearnedRoutesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{hubName}/bgpConnections/{connectionName}/learnedRoutes" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if hubName == "" { - return nil, errors.New("parameter hubName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{hubName}", url.PathEscape(hubName)) - if connectionName == "" { - return nil, errors.New("parameter connectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/virtualhubipconfiguration_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/virtualhubipconfiguration_client.go deleted file mode 100644 index 071fbf12..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/virtualhubipconfiguration_client.go +++ /dev/null @@ -1,330 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// VirtualHubIPConfigurationClient contains the methods for the VirtualHubIPConfiguration group. -// Don't use this type directly, use NewVirtualHubIPConfigurationClient() instead. -type VirtualHubIPConfigurationClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewVirtualHubIPConfigurationClient creates a new instance of VirtualHubIPConfigurationClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewVirtualHubIPConfigurationClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualHubIPConfigurationClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &VirtualHubIPConfigurationClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates a VirtualHubIpConfiguration resource if it doesn't exist else updates the existing VirtualHubIpConfiguration. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the VirtualHub. -// virtualHubName - The name of the VirtualHub. -// ipConfigName - The name of the ipconfig. -// parameters - Hub Ip Configuration parameters. -// options - VirtualHubIPConfigurationClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualHubIPConfigurationClient.BeginCreateOrUpdate -// method. -func (client *VirtualHubIPConfigurationClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, virtualHubName string, ipConfigName string, parameters HubIPConfiguration, options *VirtualHubIPConfigurationClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualHubIPConfigurationClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, virtualHubName, ipConfigName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VirtualHubIPConfigurationClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[VirtualHubIPConfigurationClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates a VirtualHubIpConfiguration resource if it doesn't exist else updates the existing VirtualHubIpConfiguration. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VirtualHubIPConfigurationClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualHubName string, ipConfigName string, parameters HubIPConfiguration, options *VirtualHubIPConfigurationClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, virtualHubName, ipConfigName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *VirtualHubIPConfigurationClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, ipConfigName string, parameters HubIPConfiguration, options *VirtualHubIPConfigurationClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/ipConfigurations/{ipConfigName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualHubName == "" { - return nil, errors.New("parameter virtualHubName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualHubName}", url.PathEscape(virtualHubName)) - if ipConfigName == "" { - return nil, errors.New("parameter ipConfigName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{ipConfigName}", url.PathEscape(ipConfigName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginDelete - Deletes a VirtualHubIpConfiguration. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the VirtualHubBgpConnection. -// virtualHubName - The name of the VirtualHub. -// ipConfigName - The name of the ipconfig. -// options - VirtualHubIPConfigurationClientBeginDeleteOptions contains the optional parameters for the VirtualHubIPConfigurationClient.BeginDelete -// method. -func (client *VirtualHubIPConfigurationClient) BeginDelete(ctx context.Context, resourceGroupName string, virtualHubName string, ipConfigName string, options *VirtualHubIPConfigurationClientBeginDeleteOptions) (*runtime.Poller[VirtualHubIPConfigurationClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, virtualHubName, ipConfigName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VirtualHubIPConfigurationClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[VirtualHubIPConfigurationClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes a VirtualHubIpConfiguration. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VirtualHubIPConfigurationClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualHubName string, ipConfigName string, options *VirtualHubIPConfigurationClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, virtualHubName, ipConfigName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *VirtualHubIPConfigurationClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, ipConfigName string, options *VirtualHubIPConfigurationClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/ipConfigurations/{ipConfigName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualHubName == "" { - return nil, errors.New("parameter virtualHubName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualHubName}", url.PathEscape(virtualHubName)) - if ipConfigName == "" { - return nil, errors.New("parameter ipConfigName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{ipConfigName}", url.PathEscape(ipConfigName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Retrieves the details of a Virtual Hub Ip configuration. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the VirtualHub. -// virtualHubName - The name of the VirtualHub. -// ipConfigName - The name of the ipconfig. -// options - VirtualHubIPConfigurationClientGetOptions contains the optional parameters for the VirtualHubIPConfigurationClient.Get -// method. -func (client *VirtualHubIPConfigurationClient) Get(ctx context.Context, resourceGroupName string, virtualHubName string, ipConfigName string, options *VirtualHubIPConfigurationClientGetOptions) (VirtualHubIPConfigurationClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, virtualHubName, ipConfigName, options) - if err != nil { - return VirtualHubIPConfigurationClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualHubIPConfigurationClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualHubIPConfigurationClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *VirtualHubIPConfigurationClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, ipConfigName string, options *VirtualHubIPConfigurationClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/ipConfigurations/{ipConfigName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualHubName == "" { - return nil, errors.New("parameter virtualHubName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualHubName}", url.PathEscape(virtualHubName)) - if ipConfigName == "" { - return nil, errors.New("parameter ipConfigName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{ipConfigName}", url.PathEscape(ipConfigName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *VirtualHubIPConfigurationClient) getHandleResponse(resp *http.Response) (VirtualHubIPConfigurationClientGetResponse, error) { - result := VirtualHubIPConfigurationClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.HubIPConfiguration); err != nil { - return VirtualHubIPConfigurationClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Retrieves the details of all VirtualHubIpConfigurations. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the VirtualHub. -// virtualHubName - The name of the VirtualHub. -// options - VirtualHubIPConfigurationClientListOptions contains the optional parameters for the VirtualHubIPConfigurationClient.List -// method. -func (client *VirtualHubIPConfigurationClient) NewListPager(resourceGroupName string, virtualHubName string, options *VirtualHubIPConfigurationClientListOptions) *runtime.Pager[VirtualHubIPConfigurationClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualHubIPConfigurationClientListResponse]{ - More: func(page VirtualHubIPConfigurationClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VirtualHubIPConfigurationClientListResponse) (VirtualHubIPConfigurationClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, virtualHubName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return VirtualHubIPConfigurationClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualHubIPConfigurationClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualHubIPConfigurationClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *VirtualHubIPConfigurationClient) listCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, options *VirtualHubIPConfigurationClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/ipConfigurations" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualHubName == "" { - return nil, errors.New("parameter virtualHubName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualHubName}", url.PathEscape(virtualHubName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *VirtualHubIPConfigurationClient) listHandleResponse(resp *http.Response) (VirtualHubIPConfigurationClientListResponse, error) { - result := VirtualHubIPConfigurationClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ListVirtualHubIPConfigurationResults); err != nil { - return VirtualHubIPConfigurationClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/virtualhubroutetablev2s_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/virtualhubroutetablev2s_client.go deleted file mode 100644 index 7d160561..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/virtualhubroutetablev2s_client.go +++ /dev/null @@ -1,330 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// VirtualHubRouteTableV2SClient contains the methods for the VirtualHubRouteTableV2S group. -// Don't use this type directly, use NewVirtualHubRouteTableV2SClient() instead. -type VirtualHubRouteTableV2SClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewVirtualHubRouteTableV2SClient creates a new instance of VirtualHubRouteTableV2SClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewVirtualHubRouteTableV2SClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualHubRouteTableV2SClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &VirtualHubRouteTableV2SClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates the existing VirtualHubRouteTableV2. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the VirtualHub. -// virtualHubName - The name of the VirtualHub. -// routeTableName - The name of the VirtualHubRouteTableV2. -// virtualHubRouteTableV2Parameters - Parameters supplied to create or update VirtualHubRouteTableV2. -// options - VirtualHubRouteTableV2SClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualHubRouteTableV2SClient.BeginCreateOrUpdate -// method. -func (client *VirtualHubRouteTableV2SClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string, virtualHubRouteTableV2Parameters VirtualHubRouteTableV2, options *VirtualHubRouteTableV2SClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualHubRouteTableV2SClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, virtualHubName, routeTableName, virtualHubRouteTableV2Parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VirtualHubRouteTableV2SClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[VirtualHubRouteTableV2SClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates the existing VirtualHubRouteTableV2. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VirtualHubRouteTableV2SClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string, virtualHubRouteTableV2Parameters VirtualHubRouteTableV2, options *VirtualHubRouteTableV2SClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, virtualHubName, routeTableName, virtualHubRouteTableV2Parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *VirtualHubRouteTableV2SClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string, virtualHubRouteTableV2Parameters VirtualHubRouteTableV2, options *VirtualHubRouteTableV2SClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routeTables/{routeTableName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualHubName == "" { - return nil, errors.New("parameter virtualHubName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualHubName}", url.PathEscape(virtualHubName)) - if routeTableName == "" { - return nil, errors.New("parameter routeTableName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{routeTableName}", url.PathEscape(routeTableName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, virtualHubRouteTableV2Parameters) -} - -// BeginDelete - Deletes a VirtualHubRouteTableV2. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the VirtualHubRouteTableV2. -// virtualHubName - The name of the VirtualHub. -// routeTableName - The name of the VirtualHubRouteTableV2. -// options - VirtualHubRouteTableV2SClientBeginDeleteOptions contains the optional parameters for the VirtualHubRouteTableV2SClient.BeginDelete -// method. -func (client *VirtualHubRouteTableV2SClient) BeginDelete(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string, options *VirtualHubRouteTableV2SClientBeginDeleteOptions) (*runtime.Poller[VirtualHubRouteTableV2SClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, virtualHubName, routeTableName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VirtualHubRouteTableV2SClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[VirtualHubRouteTableV2SClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes a VirtualHubRouteTableV2. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VirtualHubRouteTableV2SClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string, options *VirtualHubRouteTableV2SClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, virtualHubName, routeTableName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *VirtualHubRouteTableV2SClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string, options *VirtualHubRouteTableV2SClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routeTables/{routeTableName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualHubName == "" { - return nil, errors.New("parameter virtualHubName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualHubName}", url.PathEscape(virtualHubName)) - if routeTableName == "" { - return nil, errors.New("parameter routeTableName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{routeTableName}", url.PathEscape(routeTableName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Retrieves the details of a VirtualHubRouteTableV2. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the VirtualHubRouteTableV2. -// virtualHubName - The name of the VirtualHub. -// routeTableName - The name of the VirtualHubRouteTableV2. -// options - VirtualHubRouteTableV2SClientGetOptions contains the optional parameters for the VirtualHubRouteTableV2SClient.Get -// method. -func (client *VirtualHubRouteTableV2SClient) Get(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string, options *VirtualHubRouteTableV2SClientGetOptions) (VirtualHubRouteTableV2SClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, virtualHubName, routeTableName, options) - if err != nil { - return VirtualHubRouteTableV2SClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualHubRouteTableV2SClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualHubRouteTableV2SClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *VirtualHubRouteTableV2SClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string, options *VirtualHubRouteTableV2SClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routeTables/{routeTableName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualHubName == "" { - return nil, errors.New("parameter virtualHubName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualHubName}", url.PathEscape(virtualHubName)) - if routeTableName == "" { - return nil, errors.New("parameter routeTableName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{routeTableName}", url.PathEscape(routeTableName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *VirtualHubRouteTableV2SClient) getHandleResponse(resp *http.Response) (VirtualHubRouteTableV2SClientGetResponse, error) { - result := VirtualHubRouteTableV2SClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualHubRouteTableV2); err != nil { - return VirtualHubRouteTableV2SClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Retrieves the details of all VirtualHubRouteTableV2s. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the VirtualHub. -// virtualHubName - The name of the VirtualHub. -// options - VirtualHubRouteTableV2SClientListOptions contains the optional parameters for the VirtualHubRouteTableV2SClient.List -// method. -func (client *VirtualHubRouteTableV2SClient) NewListPager(resourceGroupName string, virtualHubName string, options *VirtualHubRouteTableV2SClientListOptions) *runtime.Pager[VirtualHubRouteTableV2SClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualHubRouteTableV2SClientListResponse]{ - More: func(page VirtualHubRouteTableV2SClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VirtualHubRouteTableV2SClientListResponse) (VirtualHubRouteTableV2SClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, virtualHubName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return VirtualHubRouteTableV2SClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualHubRouteTableV2SClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualHubRouteTableV2SClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *VirtualHubRouteTableV2SClient) listCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, options *VirtualHubRouteTableV2SClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routeTables" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualHubName == "" { - return nil, errors.New("parameter virtualHubName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualHubName}", url.PathEscape(virtualHubName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *VirtualHubRouteTableV2SClient) listHandleResponse(resp *http.Response) (VirtualHubRouteTableV2SClientListResponse, error) { - result := VirtualHubRouteTableV2SClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ListVirtualHubRouteTableV2SResult); err != nil { - return VirtualHubRouteTableV2SClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/virtualhubs_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/virtualhubs_client.go deleted file mode 100644 index 58b6b7d4..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/virtualhubs_client.go +++ /dev/null @@ -1,494 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// VirtualHubsClient contains the methods for the VirtualHubs group. -// Don't use this type directly, use NewVirtualHubsClient() instead. -type VirtualHubsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewVirtualHubsClient creates a new instance of VirtualHubsClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewVirtualHubsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualHubsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &VirtualHubsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the VirtualHub. -// virtualHubName - The name of the VirtualHub. -// virtualHubParameters - Parameters supplied to create or update VirtualHub. -// options - VirtualHubsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualHubsClient.BeginCreateOrUpdate -// method. -func (client *VirtualHubsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, virtualHubName string, virtualHubParameters VirtualHub, options *VirtualHubsClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualHubsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, virtualHubName, virtualHubParameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VirtualHubsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[VirtualHubsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VirtualHubsClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualHubName string, virtualHubParameters VirtualHub, options *VirtualHubsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, virtualHubName, virtualHubParameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *VirtualHubsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, virtualHubParameters VirtualHub, options *VirtualHubsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualHubName == "" { - return nil, errors.New("parameter virtualHubName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualHubName}", url.PathEscape(virtualHubName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, virtualHubParameters) -} - -// BeginDelete - Deletes a VirtualHub. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the VirtualHub. -// virtualHubName - The name of the VirtualHub. -// options - VirtualHubsClientBeginDeleteOptions contains the optional parameters for the VirtualHubsClient.BeginDelete method. -func (client *VirtualHubsClient) BeginDelete(ctx context.Context, resourceGroupName string, virtualHubName string, options *VirtualHubsClientBeginDeleteOptions) (*runtime.Poller[VirtualHubsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, virtualHubName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VirtualHubsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[VirtualHubsClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes a VirtualHub. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VirtualHubsClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualHubName string, options *VirtualHubsClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, virtualHubName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *VirtualHubsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, options *VirtualHubsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualHubName == "" { - return nil, errors.New("parameter virtualHubName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualHubName}", url.PathEscape(virtualHubName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Retrieves the details of a VirtualHub. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the VirtualHub. -// virtualHubName - The name of the VirtualHub. -// options - VirtualHubsClientGetOptions contains the optional parameters for the VirtualHubsClient.Get method. -func (client *VirtualHubsClient) Get(ctx context.Context, resourceGroupName string, virtualHubName string, options *VirtualHubsClientGetOptions) (VirtualHubsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, virtualHubName, options) - if err != nil { - return VirtualHubsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualHubsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualHubsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *VirtualHubsClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, options *VirtualHubsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualHubName == "" { - return nil, errors.New("parameter virtualHubName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualHubName}", url.PathEscape(virtualHubName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *VirtualHubsClient) getHandleResponse(resp *http.Response) (VirtualHubsClientGetResponse, error) { - result := VirtualHubsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualHub); err != nil { - return VirtualHubsClientGetResponse{}, err - } - return result, nil -} - -// BeginGetEffectiveVirtualHubRoutes - Gets the effective routes configured for the Virtual Hub resource or the specified -// resource . -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the VirtualHub. -// virtualHubName - The name of the VirtualHub. -// options - VirtualHubsClientBeginGetEffectiveVirtualHubRoutesOptions contains the optional parameters for the VirtualHubsClient.BeginGetEffectiveVirtualHubRoutes -// method. -func (client *VirtualHubsClient) BeginGetEffectiveVirtualHubRoutes(ctx context.Context, resourceGroupName string, virtualHubName string, options *VirtualHubsClientBeginGetEffectiveVirtualHubRoutesOptions) (*runtime.Poller[VirtualHubsClientGetEffectiveVirtualHubRoutesResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.getEffectiveVirtualHubRoutes(ctx, resourceGroupName, virtualHubName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VirtualHubsClientGetEffectiveVirtualHubRoutesResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[VirtualHubsClientGetEffectiveVirtualHubRoutesResponse](options.ResumeToken, client.pl, nil) - } -} - -// GetEffectiveVirtualHubRoutes - Gets the effective routes configured for the Virtual Hub resource or the specified resource -// . -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VirtualHubsClient) getEffectiveVirtualHubRoutes(ctx context.Context, resourceGroupName string, virtualHubName string, options *VirtualHubsClientBeginGetEffectiveVirtualHubRoutesOptions) (*http.Response, error) { - req, err := client.getEffectiveVirtualHubRoutesCreateRequest(ctx, resourceGroupName, virtualHubName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// getEffectiveVirtualHubRoutesCreateRequest creates the GetEffectiveVirtualHubRoutes request. -func (client *VirtualHubsClient) getEffectiveVirtualHubRoutesCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, options *VirtualHubsClientBeginGetEffectiveVirtualHubRoutesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/effectiveRoutes" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualHubName == "" { - return nil, errors.New("parameter virtualHubName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualHubName}", url.PathEscape(virtualHubName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.EffectiveRoutesParameters != nil { - return req, runtime.MarshalAsJSON(req, *options.EffectiveRoutesParameters) - } - return req, nil -} - -// NewListPager - Lists all the VirtualHubs in a subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// options - VirtualHubsClientListOptions contains the optional parameters for the VirtualHubsClient.List method. -func (client *VirtualHubsClient) NewListPager(options *VirtualHubsClientListOptions) *runtime.Pager[VirtualHubsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualHubsClientListResponse]{ - More: func(page VirtualHubsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VirtualHubsClientListResponse) (VirtualHubsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return VirtualHubsClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualHubsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualHubsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *VirtualHubsClient) listCreateRequest(ctx context.Context, options *VirtualHubsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualHubs" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *VirtualHubsClient) listHandleResponse(resp *http.Response) (VirtualHubsClientListResponse, error) { - result := VirtualHubsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ListVirtualHubsResult); err != nil { - return VirtualHubsClientListResponse{}, err - } - return result, nil -} - -// NewListByResourceGroupPager - Lists all the VirtualHubs in a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the VirtualHub. -// options - VirtualHubsClientListByResourceGroupOptions contains the optional parameters for the VirtualHubsClient.ListByResourceGroup -// method. -func (client *VirtualHubsClient) NewListByResourceGroupPager(resourceGroupName string, options *VirtualHubsClientListByResourceGroupOptions) *runtime.Pager[VirtualHubsClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualHubsClientListByResourceGroupResponse]{ - More: func(page VirtualHubsClientListByResourceGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VirtualHubsClientListByResourceGroupResponse) (VirtualHubsClientListByResourceGroupResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return VirtualHubsClientListByResourceGroupResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualHubsClientListByResourceGroupResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualHubsClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) - } - return client.listByResourceGroupHandleResponse(resp) - }, - }) -} - -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *VirtualHubsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *VirtualHubsClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *VirtualHubsClient) listByResourceGroupHandleResponse(resp *http.Response) (VirtualHubsClientListByResourceGroupResponse, error) { - result := VirtualHubsClientListByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ListVirtualHubsResult); err != nil { - return VirtualHubsClientListByResourceGroupResponse{}, err - } - return result, nil -} - -// UpdateTags - Updates VirtualHub tags. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the VirtualHub. -// virtualHubName - The name of the VirtualHub. -// virtualHubParameters - Parameters supplied to update VirtualHub tags. -// options - VirtualHubsClientUpdateTagsOptions contains the optional parameters for the VirtualHubsClient.UpdateTags method. -func (client *VirtualHubsClient) UpdateTags(ctx context.Context, resourceGroupName string, virtualHubName string, virtualHubParameters TagsObject, options *VirtualHubsClientUpdateTagsOptions) (VirtualHubsClientUpdateTagsResponse, error) { - req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, virtualHubName, virtualHubParameters, options) - if err != nil { - return VirtualHubsClientUpdateTagsResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualHubsClientUpdateTagsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualHubsClientUpdateTagsResponse{}, runtime.NewResponseError(resp) - } - return client.updateTagsHandleResponse(resp) -} - -// updateTagsCreateRequest creates the UpdateTags request. -func (client *VirtualHubsClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, virtualHubParameters TagsObject, options *VirtualHubsClientUpdateTagsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualHubName == "" { - return nil, errors.New("parameter virtualHubName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualHubName}", url.PathEscape(virtualHubName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, virtualHubParameters) -} - -// updateTagsHandleResponse handles the UpdateTags response. -func (client *VirtualHubsClient) updateTagsHandleResponse(resp *http.Response) (VirtualHubsClientUpdateTagsResponse, error) { - result := VirtualHubsClientUpdateTagsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualHub); err != nil { - return VirtualHubsClientUpdateTagsResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/virtualnetworkgatewayconnections_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/virtualnetworkgatewayconnections_client.go deleted file mode 100644 index 905f01bf..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/virtualnetworkgatewayconnections_client.go +++ /dev/null @@ -1,841 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// VirtualNetworkGatewayConnectionsClient contains the methods for the VirtualNetworkGatewayConnections group. -// Don't use this type directly, use NewVirtualNetworkGatewayConnectionsClient() instead. -type VirtualNetworkGatewayConnectionsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewVirtualNetworkGatewayConnectionsClient creates a new instance of VirtualNetworkGatewayConnectionsClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewVirtualNetworkGatewayConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualNetworkGatewayConnectionsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &VirtualNetworkGatewayConnectionsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates a virtual network gateway connection in the specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// virtualNetworkGatewayConnectionName - The name of the virtual network gateway connection. -// parameters - Parameters supplied to the create or update virtual network gateway connection operation. -// options - VirtualNetworkGatewayConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.BeginCreateOrUpdate -// method. -func (client *VirtualNetworkGatewayConnectionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters VirtualNetworkGatewayConnection, options *VirtualNetworkGatewayConnectionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualNetworkGatewayConnectionsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VirtualNetworkGatewayConnectionsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[VirtualNetworkGatewayConnectionsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates or updates a virtual network gateway connection in the specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VirtualNetworkGatewayConnectionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters VirtualNetworkGatewayConnection, options *VirtualNetworkGatewayConnectionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *VirtualNetworkGatewayConnectionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters VirtualNetworkGatewayConnection, options *VirtualNetworkGatewayConnectionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualNetworkGatewayConnectionName == "" { - return nil, errors.New("parameter virtualNetworkGatewayConnectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayConnectionName}", url.PathEscape(virtualNetworkGatewayConnectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginDelete - Deletes the specified virtual network Gateway connection. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// virtualNetworkGatewayConnectionName - The name of the virtual network gateway connection. -// options - VirtualNetworkGatewayConnectionsClientBeginDeleteOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.BeginDelete -// method. -func (client *VirtualNetworkGatewayConnectionsClient) BeginDelete(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, options *VirtualNetworkGatewayConnectionsClientBeginDeleteOptions) (*runtime.Poller[VirtualNetworkGatewayConnectionsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, virtualNetworkGatewayConnectionName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VirtualNetworkGatewayConnectionsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[VirtualNetworkGatewayConnectionsClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes the specified virtual network Gateway connection. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VirtualNetworkGatewayConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, options *VirtualNetworkGatewayConnectionsClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayConnectionName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *VirtualNetworkGatewayConnectionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, options *VirtualNetworkGatewayConnectionsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualNetworkGatewayConnectionName == "" { - return nil, errors.New("parameter virtualNetworkGatewayConnectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayConnectionName}", url.PathEscape(virtualNetworkGatewayConnectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets the specified virtual network gateway connection by resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// virtualNetworkGatewayConnectionName - The name of the virtual network gateway connection. -// options - VirtualNetworkGatewayConnectionsClientGetOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.Get -// method. -func (client *VirtualNetworkGatewayConnectionsClient) Get(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, options *VirtualNetworkGatewayConnectionsClientGetOptions) (VirtualNetworkGatewayConnectionsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayConnectionName, options) - if err != nil { - return VirtualNetworkGatewayConnectionsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualNetworkGatewayConnectionsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualNetworkGatewayConnectionsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *VirtualNetworkGatewayConnectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, options *VirtualNetworkGatewayConnectionsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualNetworkGatewayConnectionName == "" { - return nil, errors.New("parameter virtualNetworkGatewayConnectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayConnectionName}", url.PathEscape(virtualNetworkGatewayConnectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *VirtualNetworkGatewayConnectionsClient) getHandleResponse(resp *http.Response) (VirtualNetworkGatewayConnectionsClientGetResponse, error) { - result := VirtualNetworkGatewayConnectionsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualNetworkGatewayConnection); err != nil { - return VirtualNetworkGatewayConnectionsClientGetResponse{}, err - } - return result, nil -} - -// BeginGetIkeSas - Lists IKE Security Associations for the virtual network gateway connection in the specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// virtualNetworkGatewayConnectionName - The name of the virtual network gateway Connection. -// options - VirtualNetworkGatewayConnectionsClientBeginGetIkeSasOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.BeginGetIkeSas -// method. -func (client *VirtualNetworkGatewayConnectionsClient) BeginGetIkeSas(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, options *VirtualNetworkGatewayConnectionsClientBeginGetIkeSasOptions) (*runtime.Poller[VirtualNetworkGatewayConnectionsClientGetIkeSasResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.getIkeSas(ctx, resourceGroupName, virtualNetworkGatewayConnectionName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VirtualNetworkGatewayConnectionsClientGetIkeSasResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[VirtualNetworkGatewayConnectionsClientGetIkeSasResponse](options.ResumeToken, client.pl, nil) - } -} - -// GetIkeSas - Lists IKE Security Associations for the virtual network gateway connection in the specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VirtualNetworkGatewayConnectionsClient) getIkeSas(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, options *VirtualNetworkGatewayConnectionsClientBeginGetIkeSasOptions) (*http.Response, error) { - req, err := client.getIkeSasCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayConnectionName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// getIkeSasCreateRequest creates the GetIkeSas request. -func (client *VirtualNetworkGatewayConnectionsClient) getIkeSasCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, options *VirtualNetworkGatewayConnectionsClientBeginGetIkeSasOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/getikesas" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualNetworkGatewayConnectionName == "" { - return nil, errors.New("parameter virtualNetworkGatewayConnectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayConnectionName}", url.PathEscape(virtualNetworkGatewayConnectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// GetSharedKey - The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual -// network gateway connection shared key through Network resource provider. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// virtualNetworkGatewayConnectionName - The virtual network gateway connection shared key name. -// options - VirtualNetworkGatewayConnectionsClientGetSharedKeyOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.GetSharedKey -// method. -func (client *VirtualNetworkGatewayConnectionsClient) GetSharedKey(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, options *VirtualNetworkGatewayConnectionsClientGetSharedKeyOptions) (VirtualNetworkGatewayConnectionsClientGetSharedKeyResponse, error) { - req, err := client.getSharedKeyCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayConnectionName, options) - if err != nil { - return VirtualNetworkGatewayConnectionsClientGetSharedKeyResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualNetworkGatewayConnectionsClientGetSharedKeyResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualNetworkGatewayConnectionsClientGetSharedKeyResponse{}, runtime.NewResponseError(resp) - } - return client.getSharedKeyHandleResponse(resp) -} - -// getSharedKeyCreateRequest creates the GetSharedKey request. -func (client *VirtualNetworkGatewayConnectionsClient) getSharedKeyCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, options *VirtualNetworkGatewayConnectionsClientGetSharedKeyOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualNetworkGatewayConnectionName == "" { - return nil, errors.New("parameter virtualNetworkGatewayConnectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayConnectionName}", url.PathEscape(virtualNetworkGatewayConnectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getSharedKeyHandleResponse handles the GetSharedKey response. -func (client *VirtualNetworkGatewayConnectionsClient) getSharedKeyHandleResponse(resp *http.Response) (VirtualNetworkGatewayConnectionsClientGetSharedKeyResponse, error) { - result := VirtualNetworkGatewayConnectionsClientGetSharedKeyResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ConnectionSharedKey); err != nil { - return VirtualNetworkGatewayConnectionsClientGetSharedKeyResponse{}, err - } - return result, nil -} - -// NewListPager - The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections -// created. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// options - VirtualNetworkGatewayConnectionsClientListOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.List -// method. -func (client *VirtualNetworkGatewayConnectionsClient) NewListPager(resourceGroupName string, options *VirtualNetworkGatewayConnectionsClientListOptions) *runtime.Pager[VirtualNetworkGatewayConnectionsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualNetworkGatewayConnectionsClientListResponse]{ - More: func(page VirtualNetworkGatewayConnectionsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VirtualNetworkGatewayConnectionsClientListResponse) (VirtualNetworkGatewayConnectionsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return VirtualNetworkGatewayConnectionsClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualNetworkGatewayConnectionsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualNetworkGatewayConnectionsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *VirtualNetworkGatewayConnectionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *VirtualNetworkGatewayConnectionsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *VirtualNetworkGatewayConnectionsClient) listHandleResponse(resp *http.Response) (VirtualNetworkGatewayConnectionsClientListResponse, error) { - result := VirtualNetworkGatewayConnectionsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualNetworkGatewayConnectionListResult); err != nil { - return VirtualNetworkGatewayConnectionsClientListResponse{}, err - } - return result, nil -} - -// BeginResetConnection - Resets the virtual network gateway connection specified. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// virtualNetworkGatewayConnectionName - The name of the virtual network gateway Connection. -// options - VirtualNetworkGatewayConnectionsClientBeginResetConnectionOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.BeginResetConnection -// method. -func (client *VirtualNetworkGatewayConnectionsClient) BeginResetConnection(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, options *VirtualNetworkGatewayConnectionsClientBeginResetConnectionOptions) (*runtime.Poller[VirtualNetworkGatewayConnectionsClientResetConnectionResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.resetConnection(ctx, resourceGroupName, virtualNetworkGatewayConnectionName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VirtualNetworkGatewayConnectionsClientResetConnectionResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[VirtualNetworkGatewayConnectionsClientResetConnectionResponse](options.ResumeToken, client.pl, nil) - } -} - -// ResetConnection - Resets the virtual network gateway connection specified. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VirtualNetworkGatewayConnectionsClient) resetConnection(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, options *VirtualNetworkGatewayConnectionsClientBeginResetConnectionOptions) (*http.Response, error) { - req, err := client.resetConnectionCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayConnectionName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// resetConnectionCreateRequest creates the ResetConnection request. -func (client *VirtualNetworkGatewayConnectionsClient) resetConnectionCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, options *VirtualNetworkGatewayConnectionsClientBeginResetConnectionOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/resetconnection" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualNetworkGatewayConnectionName == "" { - return nil, errors.New("parameter virtualNetworkGatewayConnectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayConnectionName}", url.PathEscape(virtualNetworkGatewayConnectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginResetSharedKey - The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection -// shared key for passed virtual network gateway connection in the specified resource group -// through Network resource provider. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// virtualNetworkGatewayConnectionName - The virtual network gateway connection reset shared key Name. -// parameters - Parameters supplied to the begin reset virtual network gateway connection shared key operation through network -// resource provider. -// options - VirtualNetworkGatewayConnectionsClientBeginResetSharedKeyOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.BeginResetSharedKey -// method. -func (client *VirtualNetworkGatewayConnectionsClient) BeginResetSharedKey(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters ConnectionResetSharedKey, options *VirtualNetworkGatewayConnectionsClientBeginResetSharedKeyOptions) (*runtime.Poller[VirtualNetworkGatewayConnectionsClientResetSharedKeyResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.resetSharedKey(ctx, resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VirtualNetworkGatewayConnectionsClientResetSharedKeyResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[VirtualNetworkGatewayConnectionsClientResetSharedKeyResponse](options.ResumeToken, client.pl, nil) - } -} - -// ResetSharedKey - The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection -// shared key for passed virtual network gateway connection in the specified resource group -// through Network resource provider. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VirtualNetworkGatewayConnectionsClient) resetSharedKey(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters ConnectionResetSharedKey, options *VirtualNetworkGatewayConnectionsClientBeginResetSharedKeyOptions) (*http.Response, error) { - req, err := client.resetSharedKeyCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// resetSharedKeyCreateRequest creates the ResetSharedKey request. -func (client *VirtualNetworkGatewayConnectionsClient) resetSharedKeyCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters ConnectionResetSharedKey, options *VirtualNetworkGatewayConnectionsClientBeginResetSharedKeyOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey/reset" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualNetworkGatewayConnectionName == "" { - return nil, errors.New("parameter virtualNetworkGatewayConnectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayConnectionName}", url.PathEscape(virtualNetworkGatewayConnectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginSetSharedKey - The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection -// shared key for passed virtual network gateway connection in the specified resource group through -// Network resource provider. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// virtualNetworkGatewayConnectionName - The virtual network gateway connection name. -// parameters - Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation throughNetwork -// resource provider. -// options - VirtualNetworkGatewayConnectionsClientBeginSetSharedKeyOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.BeginSetSharedKey -// method. -func (client *VirtualNetworkGatewayConnectionsClient) BeginSetSharedKey(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters ConnectionSharedKey, options *VirtualNetworkGatewayConnectionsClientBeginSetSharedKeyOptions) (*runtime.Poller[VirtualNetworkGatewayConnectionsClientSetSharedKeyResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.setSharedKey(ctx, resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VirtualNetworkGatewayConnectionsClientSetSharedKeyResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[VirtualNetworkGatewayConnectionsClientSetSharedKeyResponse](options.ResumeToken, client.pl, nil) - } -} - -// SetSharedKey - The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared -// key for passed virtual network gateway connection in the specified resource group through -// Network resource provider. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VirtualNetworkGatewayConnectionsClient) setSharedKey(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters ConnectionSharedKey, options *VirtualNetworkGatewayConnectionsClientBeginSetSharedKeyOptions) (*http.Response, error) { - req, err := client.setSharedKeyCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// setSharedKeyCreateRequest creates the SetSharedKey request. -func (client *VirtualNetworkGatewayConnectionsClient) setSharedKeyCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters ConnectionSharedKey, options *VirtualNetworkGatewayConnectionsClientBeginSetSharedKeyOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualNetworkGatewayConnectionName == "" { - return nil, errors.New("parameter virtualNetworkGatewayConnectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayConnectionName}", url.PathEscape(virtualNetworkGatewayConnectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginStartPacketCapture - Starts packet capture on virtual network gateway connection in the specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// virtualNetworkGatewayConnectionName - The name of the virtual network gateway connection. -// options - VirtualNetworkGatewayConnectionsClientBeginStartPacketCaptureOptions contains the optional parameters for the -// VirtualNetworkGatewayConnectionsClient.BeginStartPacketCapture method. -func (client *VirtualNetworkGatewayConnectionsClient) BeginStartPacketCapture(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, options *VirtualNetworkGatewayConnectionsClientBeginStartPacketCaptureOptions) (*runtime.Poller[VirtualNetworkGatewayConnectionsClientStartPacketCaptureResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.startPacketCapture(ctx, resourceGroupName, virtualNetworkGatewayConnectionName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VirtualNetworkGatewayConnectionsClientStartPacketCaptureResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[VirtualNetworkGatewayConnectionsClientStartPacketCaptureResponse](options.ResumeToken, client.pl, nil) - } -} - -// StartPacketCapture - Starts packet capture on virtual network gateway connection in the specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VirtualNetworkGatewayConnectionsClient) startPacketCapture(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, options *VirtualNetworkGatewayConnectionsClientBeginStartPacketCaptureOptions) (*http.Response, error) { - req, err := client.startPacketCaptureCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayConnectionName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// startPacketCaptureCreateRequest creates the StartPacketCapture request. -func (client *VirtualNetworkGatewayConnectionsClient) startPacketCaptureCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, options *VirtualNetworkGatewayConnectionsClientBeginStartPacketCaptureOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/startPacketCapture" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualNetworkGatewayConnectionName == "" { - return nil, errors.New("parameter virtualNetworkGatewayConnectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayConnectionName}", url.PathEscape(virtualNetworkGatewayConnectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.Parameters != nil { - return req, runtime.MarshalAsJSON(req, *options.Parameters) - } - return req, nil -} - -// BeginStopPacketCapture - Stops packet capture on virtual network gateway connection in the specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// virtualNetworkGatewayConnectionName - The name of the virtual network gateway Connection. -// parameters - Virtual network gateway packet capture parameters supplied to stop packet capture on gateway connection. -// options - VirtualNetworkGatewayConnectionsClientBeginStopPacketCaptureOptions contains the optional parameters for the -// VirtualNetworkGatewayConnectionsClient.BeginStopPacketCapture method. -func (client *VirtualNetworkGatewayConnectionsClient) BeginStopPacketCapture(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters VPNPacketCaptureStopParameters, options *VirtualNetworkGatewayConnectionsClientBeginStopPacketCaptureOptions) (*runtime.Poller[VirtualNetworkGatewayConnectionsClientStopPacketCaptureResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.stopPacketCapture(ctx, resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VirtualNetworkGatewayConnectionsClientStopPacketCaptureResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[VirtualNetworkGatewayConnectionsClientStopPacketCaptureResponse](options.ResumeToken, client.pl, nil) - } -} - -// StopPacketCapture - Stops packet capture on virtual network gateway connection in the specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VirtualNetworkGatewayConnectionsClient) stopPacketCapture(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters VPNPacketCaptureStopParameters, options *VirtualNetworkGatewayConnectionsClientBeginStopPacketCaptureOptions) (*http.Response, error) { - req, err := client.stopPacketCaptureCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// stopPacketCaptureCreateRequest creates the StopPacketCapture request. -func (client *VirtualNetworkGatewayConnectionsClient) stopPacketCaptureCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters VPNPacketCaptureStopParameters, options *VirtualNetworkGatewayConnectionsClientBeginStopPacketCaptureOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/stopPacketCapture" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualNetworkGatewayConnectionName == "" { - return nil, errors.New("parameter virtualNetworkGatewayConnectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayConnectionName}", url.PathEscape(virtualNetworkGatewayConnectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginUpdateTags - Updates a virtual network gateway connection tags. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// virtualNetworkGatewayConnectionName - The name of the virtual network gateway connection. -// parameters - Parameters supplied to update virtual network gateway connection tags. -// options - VirtualNetworkGatewayConnectionsClientBeginUpdateTagsOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.BeginUpdateTags -// method. -func (client *VirtualNetworkGatewayConnectionsClient) BeginUpdateTags(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters TagsObject, options *VirtualNetworkGatewayConnectionsClientBeginUpdateTagsOptions) (*runtime.Poller[VirtualNetworkGatewayConnectionsClientUpdateTagsResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.updateTags(ctx, resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VirtualNetworkGatewayConnectionsClientUpdateTagsResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[VirtualNetworkGatewayConnectionsClientUpdateTagsResponse](options.ResumeToken, client.pl, nil) - } -} - -// UpdateTags - Updates a virtual network gateway connection tags. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VirtualNetworkGatewayConnectionsClient) updateTags(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters TagsObject, options *VirtualNetworkGatewayConnectionsClientBeginUpdateTagsOptions) (*http.Response, error) { - req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// updateTagsCreateRequest creates the UpdateTags request. -func (client *VirtualNetworkGatewayConnectionsClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters TagsObject, options *VirtualNetworkGatewayConnectionsClientBeginUpdateTagsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualNetworkGatewayConnectionName == "" { - return nil, errors.New("parameter virtualNetworkGatewayConnectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayConnectionName}", url.PathEscape(virtualNetworkGatewayConnectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/virtualnetworkgatewaynatrules_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/virtualnetworkgatewaynatrules_client.go deleted file mode 100644 index dfc2aaab..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/virtualnetworkgatewaynatrules_client.go +++ /dev/null @@ -1,332 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// VirtualNetworkGatewayNatRulesClient contains the methods for the VirtualNetworkGatewayNatRules group. -// Don't use this type directly, use NewVirtualNetworkGatewayNatRulesClient() instead. -type VirtualNetworkGatewayNatRulesClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewVirtualNetworkGatewayNatRulesClient creates a new instance of VirtualNetworkGatewayNatRulesClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewVirtualNetworkGatewayNatRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualNetworkGatewayNatRulesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &VirtualNetworkGatewayNatRulesClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates a nat rule to a scalable virtual network gateway if it doesn't exist else updates the existing -// nat rules. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the Virtual Network Gateway. -// virtualNetworkGatewayName - The name of the gateway. -// natRuleName - The name of the nat rule. -// natRuleParameters - Parameters supplied to create or Update a Nat Rule. -// options - VirtualNetworkGatewayNatRulesClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualNetworkGatewayNatRulesClient.BeginCreateOrUpdate -// method. -func (client *VirtualNetworkGatewayNatRulesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, natRuleName string, natRuleParameters VirtualNetworkGatewayNatRule, options *VirtualNetworkGatewayNatRulesClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualNetworkGatewayNatRulesClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, virtualNetworkGatewayName, natRuleName, natRuleParameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VirtualNetworkGatewayNatRulesClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[VirtualNetworkGatewayNatRulesClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates a nat rule to a scalable virtual network gateway if it doesn't exist else updates the existing -// nat rules. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VirtualNetworkGatewayNatRulesClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, natRuleName string, natRuleParameters VirtualNetworkGatewayNatRule, options *VirtualNetworkGatewayNatRulesClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayName, natRuleName, natRuleParameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *VirtualNetworkGatewayNatRulesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, natRuleName string, natRuleParameters VirtualNetworkGatewayNatRule, options *VirtualNetworkGatewayNatRulesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/natRules/{natRuleName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualNetworkGatewayName == "" { - return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) - if natRuleName == "" { - return nil, errors.New("parameter natRuleName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{natRuleName}", url.PathEscape(natRuleName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, natRuleParameters) -} - -// BeginDelete - Deletes a nat rule. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the Virtual Network Gateway. -// virtualNetworkGatewayName - The name of the gateway. -// natRuleName - The name of the nat rule. -// options - VirtualNetworkGatewayNatRulesClientBeginDeleteOptions contains the optional parameters for the VirtualNetworkGatewayNatRulesClient.BeginDelete -// method. -func (client *VirtualNetworkGatewayNatRulesClient) BeginDelete(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, natRuleName string, options *VirtualNetworkGatewayNatRulesClientBeginDeleteOptions) (*runtime.Poller[VirtualNetworkGatewayNatRulesClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, virtualNetworkGatewayName, natRuleName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VirtualNetworkGatewayNatRulesClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[VirtualNetworkGatewayNatRulesClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes a nat rule. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VirtualNetworkGatewayNatRulesClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, natRuleName string, options *VirtualNetworkGatewayNatRulesClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayName, natRuleName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *VirtualNetworkGatewayNatRulesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, natRuleName string, options *VirtualNetworkGatewayNatRulesClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/natRules/{natRuleName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualNetworkGatewayName == "" { - return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) - if natRuleName == "" { - return nil, errors.New("parameter natRuleName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{natRuleName}", url.PathEscape(natRuleName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Retrieves the details of a nat rule. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the Virtual Network Gateway. -// virtualNetworkGatewayName - The name of the gateway. -// natRuleName - The name of the nat rule. -// options - VirtualNetworkGatewayNatRulesClientGetOptions contains the optional parameters for the VirtualNetworkGatewayNatRulesClient.Get -// method. -func (client *VirtualNetworkGatewayNatRulesClient) Get(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, natRuleName string, options *VirtualNetworkGatewayNatRulesClientGetOptions) (VirtualNetworkGatewayNatRulesClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayName, natRuleName, options) - if err != nil { - return VirtualNetworkGatewayNatRulesClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualNetworkGatewayNatRulesClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualNetworkGatewayNatRulesClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *VirtualNetworkGatewayNatRulesClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, natRuleName string, options *VirtualNetworkGatewayNatRulesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/natRules/{natRuleName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualNetworkGatewayName == "" { - return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) - if natRuleName == "" { - return nil, errors.New("parameter natRuleName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{natRuleName}", url.PathEscape(natRuleName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *VirtualNetworkGatewayNatRulesClient) getHandleResponse(resp *http.Response) (VirtualNetworkGatewayNatRulesClientGetResponse, error) { - result := VirtualNetworkGatewayNatRulesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualNetworkGatewayNatRule); err != nil { - return VirtualNetworkGatewayNatRulesClientGetResponse{}, err - } - return result, nil -} - -// NewListByVirtualNetworkGatewayPager - Retrieves all nat rules for a particular virtual network gateway. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the virtual network gateway. -// virtualNetworkGatewayName - The name of the gateway. -// options - VirtualNetworkGatewayNatRulesClientListByVirtualNetworkGatewayOptions contains the optional parameters for the -// VirtualNetworkGatewayNatRulesClient.ListByVirtualNetworkGateway method. -func (client *VirtualNetworkGatewayNatRulesClient) NewListByVirtualNetworkGatewayPager(resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewayNatRulesClientListByVirtualNetworkGatewayOptions) *runtime.Pager[VirtualNetworkGatewayNatRulesClientListByVirtualNetworkGatewayResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualNetworkGatewayNatRulesClientListByVirtualNetworkGatewayResponse]{ - More: func(page VirtualNetworkGatewayNatRulesClientListByVirtualNetworkGatewayResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VirtualNetworkGatewayNatRulesClientListByVirtualNetworkGatewayResponse) (VirtualNetworkGatewayNatRulesClientListByVirtualNetworkGatewayResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByVirtualNetworkGatewayCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return VirtualNetworkGatewayNatRulesClientListByVirtualNetworkGatewayResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualNetworkGatewayNatRulesClientListByVirtualNetworkGatewayResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualNetworkGatewayNatRulesClientListByVirtualNetworkGatewayResponse{}, runtime.NewResponseError(resp) - } - return client.listByVirtualNetworkGatewayHandleResponse(resp) - }, - }) -} - -// listByVirtualNetworkGatewayCreateRequest creates the ListByVirtualNetworkGateway request. -func (client *VirtualNetworkGatewayNatRulesClient) listByVirtualNetworkGatewayCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewayNatRulesClientListByVirtualNetworkGatewayOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/natRules" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualNetworkGatewayName == "" { - return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByVirtualNetworkGatewayHandleResponse handles the ListByVirtualNetworkGateway response. -func (client *VirtualNetworkGatewayNatRulesClient) listByVirtualNetworkGatewayHandleResponse(resp *http.Response) (VirtualNetworkGatewayNatRulesClientListByVirtualNetworkGatewayResponse, error) { - result := VirtualNetworkGatewayNatRulesClientListByVirtualNetworkGatewayResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ListVirtualNetworkGatewayNatRulesResult); err != nil { - return VirtualNetworkGatewayNatRulesClientListByVirtualNetworkGatewayResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/virtualnetworkgateways_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/virtualnetworkgateways_client.go deleted file mode 100644 index 6151cdd7..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/virtualnetworkgateways_client.go +++ /dev/null @@ -1,1510 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// VirtualNetworkGatewaysClient contains the methods for the VirtualNetworkGateways group. -// Don't use this type directly, use NewVirtualNetworkGatewaysClient() instead. -type VirtualNetworkGatewaysClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewVirtualNetworkGatewaysClient creates a new instance of VirtualNetworkGatewaysClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewVirtualNetworkGatewaysClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualNetworkGatewaysClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &VirtualNetworkGatewaysClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates a virtual network gateway in the specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// virtualNetworkGatewayName - The name of the virtual network gateway. -// parameters - Parameters supplied to create or update virtual network gateway operation. -// options - VirtualNetworkGatewaysClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginCreateOrUpdate -// method. -func (client *VirtualNetworkGatewaysClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VirtualNetworkGateway, options *VirtualNetworkGatewaysClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualNetworkGatewaysClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, virtualNetworkGatewayName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VirtualNetworkGatewaysClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[VirtualNetworkGatewaysClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates or updates a virtual network gateway in the specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VirtualNetworkGatewaysClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VirtualNetworkGateway, options *VirtualNetworkGatewaysClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *VirtualNetworkGatewaysClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VirtualNetworkGateway, options *VirtualNetworkGatewaysClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualNetworkGatewayName == "" { - return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginDelete - Deletes the specified virtual network gateway. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// virtualNetworkGatewayName - The name of the virtual network gateway. -// options - VirtualNetworkGatewaysClientBeginDeleteOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginDelete -// method. -func (client *VirtualNetworkGatewaysClient) BeginDelete(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginDeleteOptions) (*runtime.Poller[VirtualNetworkGatewaysClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, virtualNetworkGatewayName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VirtualNetworkGatewaysClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[VirtualNetworkGatewaysClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes the specified virtual network gateway. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VirtualNetworkGatewaysClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *VirtualNetworkGatewaysClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualNetworkGatewayName == "" { - return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginDisconnectVirtualNetworkGatewayVPNConnections - Disconnect vpn connections of virtual network gateway in the specified -// resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// virtualNetworkGatewayName - The name of the virtual network gateway. -// request - The parameters are supplied to disconnect vpn connections. -// options - VirtualNetworkGatewaysClientBeginDisconnectVirtualNetworkGatewayVPNConnectionsOptions contains the optional parameters -// for the VirtualNetworkGatewaysClient.BeginDisconnectVirtualNetworkGatewayVPNConnections method. -func (client *VirtualNetworkGatewaysClient) BeginDisconnectVirtualNetworkGatewayVPNConnections(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, request P2SVPNConnectionRequest, options *VirtualNetworkGatewaysClientBeginDisconnectVirtualNetworkGatewayVPNConnectionsOptions) (*runtime.Poller[VirtualNetworkGatewaysClientDisconnectVirtualNetworkGatewayVPNConnectionsResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.disconnectVirtualNetworkGatewayVPNConnections(ctx, resourceGroupName, virtualNetworkGatewayName, request, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VirtualNetworkGatewaysClientDisconnectVirtualNetworkGatewayVPNConnectionsResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[VirtualNetworkGatewaysClientDisconnectVirtualNetworkGatewayVPNConnectionsResponse](options.ResumeToken, client.pl, nil) - } -} - -// DisconnectVirtualNetworkGatewayVPNConnections - Disconnect vpn connections of virtual network gateway in the specified -// resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VirtualNetworkGatewaysClient) disconnectVirtualNetworkGatewayVPNConnections(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, request P2SVPNConnectionRequest, options *VirtualNetworkGatewaysClientBeginDisconnectVirtualNetworkGatewayVPNConnectionsOptions) (*http.Response, error) { - req, err := client.disconnectVirtualNetworkGatewayVPNConnectionsCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayName, request, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// disconnectVirtualNetworkGatewayVPNConnectionsCreateRequest creates the DisconnectVirtualNetworkGatewayVPNConnections request. -func (client *VirtualNetworkGatewaysClient) disconnectVirtualNetworkGatewayVPNConnectionsCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, request P2SVPNConnectionRequest, options *VirtualNetworkGatewaysClientBeginDisconnectVirtualNetworkGatewayVPNConnectionsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/disconnectVirtualNetworkGatewayVpnConnections" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualNetworkGatewayName == "" { - return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, request) -} - -// BeginGenerateVPNProfile - Generates VPN profile for P2S client of the virtual network gateway in the specified resource -// group. Used for IKEV2 and radius based authentication. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// virtualNetworkGatewayName - The name of the virtual network gateway. -// parameters - Parameters supplied to the generate virtual network gateway VPN client package operation. -// options - VirtualNetworkGatewaysClientBeginGenerateVPNProfileOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginGenerateVPNProfile -// method. -func (client *VirtualNetworkGatewaysClient) BeginGenerateVPNProfile(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VPNClientParameters, options *VirtualNetworkGatewaysClientBeginGenerateVPNProfileOptions) (*runtime.Poller[VirtualNetworkGatewaysClientGenerateVPNProfileResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.generateVPNProfile(ctx, resourceGroupName, virtualNetworkGatewayName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VirtualNetworkGatewaysClientGenerateVPNProfileResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[VirtualNetworkGatewaysClientGenerateVPNProfileResponse](options.ResumeToken, client.pl, nil) - } -} - -// GenerateVPNProfile - Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. -// Used for IKEV2 and radius based authentication. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VirtualNetworkGatewaysClient) generateVPNProfile(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VPNClientParameters, options *VirtualNetworkGatewaysClientBeginGenerateVPNProfileOptions) (*http.Response, error) { - req, err := client.generateVPNProfileCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// generateVPNProfileCreateRequest creates the GenerateVPNProfile request. -func (client *VirtualNetworkGatewaysClient) generateVPNProfileCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VPNClientParameters, options *VirtualNetworkGatewaysClientBeginGenerateVPNProfileOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualNetworkGatewayName == "" { - return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginGeneratevpnclientpackage - Generates VPN client package for P2S client of the virtual network gateway in the specified -// resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// virtualNetworkGatewayName - The name of the virtual network gateway. -// parameters - Parameters supplied to the generate virtual network gateway VPN client package operation. -// options - VirtualNetworkGatewaysClientBeginGeneratevpnclientpackageOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginGeneratevpnclientpackage -// method. -func (client *VirtualNetworkGatewaysClient) BeginGeneratevpnclientpackage(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VPNClientParameters, options *VirtualNetworkGatewaysClientBeginGeneratevpnclientpackageOptions) (*runtime.Poller[VirtualNetworkGatewaysClientGeneratevpnclientpackageResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.generatevpnclientpackage(ctx, resourceGroupName, virtualNetworkGatewayName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VirtualNetworkGatewaysClientGeneratevpnclientpackageResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[VirtualNetworkGatewaysClientGeneratevpnclientpackageResponse](options.ResumeToken, client.pl, nil) - } -} - -// Generatevpnclientpackage - Generates VPN client package for P2S client of the virtual network gateway in the specified -// resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VirtualNetworkGatewaysClient) generatevpnclientpackage(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VPNClientParameters, options *VirtualNetworkGatewaysClientBeginGeneratevpnclientpackageOptions) (*http.Response, error) { - req, err := client.generatevpnclientpackageCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// generatevpnclientpackageCreateRequest creates the Generatevpnclientpackage request. -func (client *VirtualNetworkGatewaysClient) generatevpnclientpackageCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VPNClientParameters, options *VirtualNetworkGatewaysClientBeginGeneratevpnclientpackageOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualNetworkGatewayName == "" { - return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// Get - Gets the specified virtual network gateway by resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// virtualNetworkGatewayName - The name of the virtual network gateway. -// options - VirtualNetworkGatewaysClientGetOptions contains the optional parameters for the VirtualNetworkGatewaysClient.Get -// method. -func (client *VirtualNetworkGatewaysClient) Get(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientGetOptions) (VirtualNetworkGatewaysClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayName, options) - if err != nil { - return VirtualNetworkGatewaysClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualNetworkGatewaysClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualNetworkGatewaysClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *VirtualNetworkGatewaysClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualNetworkGatewayName == "" { - return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *VirtualNetworkGatewaysClient) getHandleResponse(resp *http.Response) (VirtualNetworkGatewaysClientGetResponse, error) { - result := VirtualNetworkGatewaysClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualNetworkGateway); err != nil { - return VirtualNetworkGatewaysClientGetResponse{}, err - } - return result, nil -} - -// BeginGetAdvertisedRoutes - This operation retrieves a list of routes the virtual network gateway is advertising to the -// specified peer. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// virtualNetworkGatewayName - The name of the virtual network gateway. -// peer - The IP address of the peer. -// options - VirtualNetworkGatewaysClientBeginGetAdvertisedRoutesOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginGetAdvertisedRoutes -// method. -func (client *VirtualNetworkGatewaysClient) BeginGetAdvertisedRoutes(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, peer string, options *VirtualNetworkGatewaysClientBeginGetAdvertisedRoutesOptions) (*runtime.Poller[VirtualNetworkGatewaysClientGetAdvertisedRoutesResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.getAdvertisedRoutes(ctx, resourceGroupName, virtualNetworkGatewayName, peer, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VirtualNetworkGatewaysClientGetAdvertisedRoutesResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[VirtualNetworkGatewaysClientGetAdvertisedRoutesResponse](options.ResumeToken, client.pl, nil) - } -} - -// GetAdvertisedRoutes - This operation retrieves a list of routes the virtual network gateway is advertising to the specified -// peer. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VirtualNetworkGatewaysClient) getAdvertisedRoutes(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, peer string, options *VirtualNetworkGatewaysClientBeginGetAdvertisedRoutesOptions) (*http.Response, error) { - req, err := client.getAdvertisedRoutesCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayName, peer, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// getAdvertisedRoutesCreateRequest creates the GetAdvertisedRoutes request. -func (client *VirtualNetworkGatewaysClient) getAdvertisedRoutesCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, peer string, options *VirtualNetworkGatewaysClientBeginGetAdvertisedRoutesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getAdvertisedRoutes" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualNetworkGatewayName == "" { - return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("peer", peer) - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginGetBgpPeerStatus - The GetBgpPeerStatus operation retrieves the status of all BGP peers. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// virtualNetworkGatewayName - The name of the virtual network gateway. -// options - VirtualNetworkGatewaysClientBeginGetBgpPeerStatusOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginGetBgpPeerStatus -// method. -func (client *VirtualNetworkGatewaysClient) BeginGetBgpPeerStatus(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginGetBgpPeerStatusOptions) (*runtime.Poller[VirtualNetworkGatewaysClientGetBgpPeerStatusResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.getBgpPeerStatus(ctx, resourceGroupName, virtualNetworkGatewayName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VirtualNetworkGatewaysClientGetBgpPeerStatusResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[VirtualNetworkGatewaysClientGetBgpPeerStatusResponse](options.ResumeToken, client.pl, nil) - } -} - -// GetBgpPeerStatus - The GetBgpPeerStatus operation retrieves the status of all BGP peers. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VirtualNetworkGatewaysClient) getBgpPeerStatus(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginGetBgpPeerStatusOptions) (*http.Response, error) { - req, err := client.getBgpPeerStatusCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// getBgpPeerStatusCreateRequest creates the GetBgpPeerStatus request. -func (client *VirtualNetworkGatewaysClient) getBgpPeerStatusCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginGetBgpPeerStatusOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getBgpPeerStatus" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualNetworkGatewayName == "" { - return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Peer != nil { - reqQP.Set("peer", *options.Peer) - } - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginGetLearnedRoutes - This operation retrieves a list of routes the virtual network gateway has learned, including routes -// learned from BGP peers. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// virtualNetworkGatewayName - The name of the virtual network gateway. -// options - VirtualNetworkGatewaysClientBeginGetLearnedRoutesOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginGetLearnedRoutes -// method. -func (client *VirtualNetworkGatewaysClient) BeginGetLearnedRoutes(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginGetLearnedRoutesOptions) (*runtime.Poller[VirtualNetworkGatewaysClientGetLearnedRoutesResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.getLearnedRoutes(ctx, resourceGroupName, virtualNetworkGatewayName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VirtualNetworkGatewaysClientGetLearnedRoutesResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[VirtualNetworkGatewaysClientGetLearnedRoutesResponse](options.ResumeToken, client.pl, nil) - } -} - -// GetLearnedRoutes - This operation retrieves a list of routes the virtual network gateway has learned, including routes -// learned from BGP peers. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VirtualNetworkGatewaysClient) getLearnedRoutes(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginGetLearnedRoutesOptions) (*http.Response, error) { - req, err := client.getLearnedRoutesCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// getLearnedRoutesCreateRequest creates the GetLearnedRoutes request. -func (client *VirtualNetworkGatewaysClient) getLearnedRoutesCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginGetLearnedRoutesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getLearnedRoutes" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualNetworkGatewayName == "" { - return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginGetVPNProfilePackageURL - 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. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// virtualNetworkGatewayName - The name of the virtual network gateway. -// options - VirtualNetworkGatewaysClientBeginGetVPNProfilePackageURLOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginGetVPNProfilePackageURL -// method. -func (client *VirtualNetworkGatewaysClient) BeginGetVPNProfilePackageURL(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginGetVPNProfilePackageURLOptions) (*runtime.Poller[VirtualNetworkGatewaysClientGetVPNProfilePackageURLResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.getVPNProfilePackageURL(ctx, resourceGroupName, virtualNetworkGatewayName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VirtualNetworkGatewaysClientGetVPNProfilePackageURLResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[VirtualNetworkGatewaysClientGetVPNProfilePackageURLResponse](options.ResumeToken, client.pl, nil) - } -} - -// 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. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VirtualNetworkGatewaysClient) getVPNProfilePackageURL(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginGetVPNProfilePackageURLOptions) (*http.Response, error) { - req, err := client.getVPNProfilePackageURLCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// getVPNProfilePackageURLCreateRequest creates the GetVPNProfilePackageURL request. -func (client *VirtualNetworkGatewaysClient) getVPNProfilePackageURLCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginGetVPNProfilePackageURLOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnprofilepackageurl" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualNetworkGatewayName == "" { - return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginGetVpnclientConnectionHealth - Get VPN client connection health detail per P2S client connection of the virtual network -// gateway in the specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// virtualNetworkGatewayName - The name of the virtual network gateway. -// options - VirtualNetworkGatewaysClientBeginGetVpnclientConnectionHealthOptions contains the optional parameters for the -// VirtualNetworkGatewaysClient.BeginGetVpnclientConnectionHealth method. -func (client *VirtualNetworkGatewaysClient) BeginGetVpnclientConnectionHealth(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginGetVpnclientConnectionHealthOptions) (*runtime.Poller[VirtualNetworkGatewaysClientGetVpnclientConnectionHealthResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.getVpnclientConnectionHealth(ctx, resourceGroupName, virtualNetworkGatewayName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VirtualNetworkGatewaysClientGetVpnclientConnectionHealthResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[VirtualNetworkGatewaysClientGetVpnclientConnectionHealthResponse](options.ResumeToken, client.pl, nil) - } -} - -// GetVpnclientConnectionHealth - Get VPN client connection health detail per P2S client connection of the virtual network -// gateway in the specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VirtualNetworkGatewaysClient) getVpnclientConnectionHealth(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginGetVpnclientConnectionHealthOptions) (*http.Response, error) { - req, err := client.getVpnclientConnectionHealthCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// getVpnclientConnectionHealthCreateRequest creates the GetVpnclientConnectionHealth request. -func (client *VirtualNetworkGatewaysClient) getVpnclientConnectionHealthCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginGetVpnclientConnectionHealthOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getVpnClientConnectionHealth" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualNetworkGatewayName == "" { - return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginGetVpnclientIPSecParameters - The Get VpnclientIpsecParameters operation retrieves information about the vpnclient -// ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource -// provider. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// virtualNetworkGatewayName - The virtual network gateway name. -// options - VirtualNetworkGatewaysClientBeginGetVpnclientIPSecParametersOptions contains the optional parameters for the -// VirtualNetworkGatewaysClient.BeginGetVpnclientIPSecParameters method. -func (client *VirtualNetworkGatewaysClient) BeginGetVpnclientIPSecParameters(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginGetVpnclientIPSecParametersOptions) (*runtime.Poller[VirtualNetworkGatewaysClientGetVpnclientIPSecParametersResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.getVpnclientIPSecParameters(ctx, resourceGroupName, virtualNetworkGatewayName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VirtualNetworkGatewaysClientGetVpnclientIPSecParametersResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[VirtualNetworkGatewaysClientGetVpnclientIPSecParametersResponse](options.ResumeToken, client.pl, nil) - } -} - -// GetVpnclientIPSecParameters - The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec -// policy for P2S client of virtual network gateway in the specified resource group through Network resource -// provider. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VirtualNetworkGatewaysClient) getVpnclientIPSecParameters(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginGetVpnclientIPSecParametersOptions) (*http.Response, error) { - req, err := client.getVpnclientIPSecParametersCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// getVpnclientIPSecParametersCreateRequest creates the GetVpnclientIPSecParameters request. -func (client *VirtualNetworkGatewaysClient) getVpnclientIPSecParametersCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginGetVpnclientIPSecParametersOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnclientipsecparameters" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualNetworkGatewayName == "" { - return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// NewListPager - Gets all virtual network gateways by resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// options - VirtualNetworkGatewaysClientListOptions contains the optional parameters for the VirtualNetworkGatewaysClient.List -// method. -func (client *VirtualNetworkGatewaysClient) NewListPager(resourceGroupName string, options *VirtualNetworkGatewaysClientListOptions) *runtime.Pager[VirtualNetworkGatewaysClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualNetworkGatewaysClientListResponse]{ - More: func(page VirtualNetworkGatewaysClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VirtualNetworkGatewaysClientListResponse) (VirtualNetworkGatewaysClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return VirtualNetworkGatewaysClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualNetworkGatewaysClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualNetworkGatewaysClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *VirtualNetworkGatewaysClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *VirtualNetworkGatewaysClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *VirtualNetworkGatewaysClient) listHandleResponse(resp *http.Response) (VirtualNetworkGatewaysClientListResponse, error) { - result := VirtualNetworkGatewaysClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualNetworkGatewayListResult); err != nil { - return VirtualNetworkGatewaysClientListResponse{}, err - } - return result, nil -} - -// NewListConnectionsPager - Gets all the connections in a virtual network gateway. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// virtualNetworkGatewayName - The name of the virtual network gateway. -// options - VirtualNetworkGatewaysClientListConnectionsOptions contains the optional parameters for the VirtualNetworkGatewaysClient.ListConnections -// method. -func (client *VirtualNetworkGatewaysClient) NewListConnectionsPager(resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientListConnectionsOptions) *runtime.Pager[VirtualNetworkGatewaysClientListConnectionsResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualNetworkGatewaysClientListConnectionsResponse]{ - More: func(page VirtualNetworkGatewaysClientListConnectionsResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VirtualNetworkGatewaysClientListConnectionsResponse) (VirtualNetworkGatewaysClientListConnectionsResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listConnectionsCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return VirtualNetworkGatewaysClientListConnectionsResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualNetworkGatewaysClientListConnectionsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualNetworkGatewaysClientListConnectionsResponse{}, runtime.NewResponseError(resp) - } - return client.listConnectionsHandleResponse(resp) - }, - }) -} - -// listConnectionsCreateRequest creates the ListConnections request. -func (client *VirtualNetworkGatewaysClient) listConnectionsCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientListConnectionsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/connections" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualNetworkGatewayName == "" { - return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listConnectionsHandleResponse handles the ListConnections response. -func (client *VirtualNetworkGatewaysClient) listConnectionsHandleResponse(resp *http.Response) (VirtualNetworkGatewaysClientListConnectionsResponse, error) { - result := VirtualNetworkGatewaysClientListConnectionsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualNetworkGatewayListConnectionsResult); err != nil { - return VirtualNetworkGatewaysClientListConnectionsResponse{}, err - } - return result, nil -} - -// BeginReset - Resets the primary of the virtual network gateway in the specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// virtualNetworkGatewayName - The name of the virtual network gateway. -// options - VirtualNetworkGatewaysClientBeginResetOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginReset -// method. -func (client *VirtualNetworkGatewaysClient) BeginReset(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginResetOptions) (*runtime.Poller[VirtualNetworkGatewaysClientResetResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.reset(ctx, resourceGroupName, virtualNetworkGatewayName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VirtualNetworkGatewaysClientResetResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[VirtualNetworkGatewaysClientResetResponse](options.ResumeToken, client.pl, nil) - } -} - -// Reset - Resets the primary of the virtual network gateway in the specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VirtualNetworkGatewaysClient) reset(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginResetOptions) (*http.Response, error) { - req, err := client.resetCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// resetCreateRequest creates the Reset request. -func (client *VirtualNetworkGatewaysClient) resetCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginResetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/reset" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualNetworkGatewayName == "" { - return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.GatewayVip != nil { - reqQP.Set("gatewayVip", *options.GatewayVip) - } - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginResetVPNClientSharedKey - Resets the VPN client shared key of the virtual network gateway in the specified resource -// group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// virtualNetworkGatewayName - The name of the virtual network gateway. -// options - VirtualNetworkGatewaysClientBeginResetVPNClientSharedKeyOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginResetVPNClientSharedKey -// method. -func (client *VirtualNetworkGatewaysClient) BeginResetVPNClientSharedKey(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginResetVPNClientSharedKeyOptions) (*runtime.Poller[VirtualNetworkGatewaysClientResetVPNClientSharedKeyResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.resetVPNClientSharedKey(ctx, resourceGroupName, virtualNetworkGatewayName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VirtualNetworkGatewaysClientResetVPNClientSharedKeyResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[VirtualNetworkGatewaysClientResetVPNClientSharedKeyResponse](options.ResumeToken, client.pl, nil) - } -} - -// ResetVPNClientSharedKey - Resets the VPN client shared key of the virtual network gateway in the specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VirtualNetworkGatewaysClient) resetVPNClientSharedKey(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginResetVPNClientSharedKeyOptions) (*http.Response, error) { - req, err := client.resetVPNClientSharedKeyCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// resetVPNClientSharedKeyCreateRequest creates the ResetVPNClientSharedKey request. -func (client *VirtualNetworkGatewaysClient) resetVPNClientSharedKeyCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginResetVPNClientSharedKeyOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/resetvpnclientsharedkey" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualNetworkGatewayName == "" { - return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginSetVpnclientIPSecParameters - The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client -// of virtual network gateway in the specified resource group through Network resource provider. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// virtualNetworkGatewayName - The name of the virtual network gateway. -// vpnclientIPSecParams - Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network Gateway P2S client -// operation through Network resource provider. -// options - VirtualNetworkGatewaysClientBeginSetVpnclientIPSecParametersOptions contains the optional parameters for the -// VirtualNetworkGatewaysClient.BeginSetVpnclientIPSecParameters method. -func (client *VirtualNetworkGatewaysClient) BeginSetVpnclientIPSecParameters(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, vpnclientIPSecParams VPNClientIPsecParameters, options *VirtualNetworkGatewaysClientBeginSetVpnclientIPSecParametersOptions) (*runtime.Poller[VirtualNetworkGatewaysClientSetVpnclientIPSecParametersResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.setVpnclientIPSecParameters(ctx, resourceGroupName, virtualNetworkGatewayName, vpnclientIPSecParams, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VirtualNetworkGatewaysClientSetVpnclientIPSecParametersResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[VirtualNetworkGatewaysClientSetVpnclientIPSecParametersResponse](options.ResumeToken, client.pl, nil) - } -} - -// SetVpnclientIPSecParameters - The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client -// of virtual network gateway in the specified resource group through Network resource provider. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VirtualNetworkGatewaysClient) setVpnclientIPSecParameters(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, vpnclientIPSecParams VPNClientIPsecParameters, options *VirtualNetworkGatewaysClientBeginSetVpnclientIPSecParametersOptions) (*http.Response, error) { - req, err := client.setVpnclientIPSecParametersCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayName, vpnclientIPSecParams, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// setVpnclientIPSecParametersCreateRequest creates the SetVpnclientIPSecParameters request. -func (client *VirtualNetworkGatewaysClient) setVpnclientIPSecParametersCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, vpnclientIPSecParams VPNClientIPsecParameters, options *VirtualNetworkGatewaysClientBeginSetVpnclientIPSecParametersOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/setvpnclientipsecparameters" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualNetworkGatewayName == "" { - return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, vpnclientIPSecParams) -} - -// BeginStartPacketCapture - Starts packet capture on virtual network gateway in the specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// virtualNetworkGatewayName - The name of the virtual network gateway. -// options - VirtualNetworkGatewaysClientBeginStartPacketCaptureOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginStartPacketCapture -// method. -func (client *VirtualNetworkGatewaysClient) BeginStartPacketCapture(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginStartPacketCaptureOptions) (*runtime.Poller[VirtualNetworkGatewaysClientStartPacketCaptureResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.startPacketCapture(ctx, resourceGroupName, virtualNetworkGatewayName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VirtualNetworkGatewaysClientStartPacketCaptureResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[VirtualNetworkGatewaysClientStartPacketCaptureResponse](options.ResumeToken, client.pl, nil) - } -} - -// StartPacketCapture - Starts packet capture on virtual network gateway in the specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VirtualNetworkGatewaysClient) startPacketCapture(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginStartPacketCaptureOptions) (*http.Response, error) { - req, err := client.startPacketCaptureCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// startPacketCaptureCreateRequest creates the StartPacketCapture request. -func (client *VirtualNetworkGatewaysClient) startPacketCaptureCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginStartPacketCaptureOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/startPacketCapture" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualNetworkGatewayName == "" { - return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.Parameters != nil { - return req, runtime.MarshalAsJSON(req, *options.Parameters) - } - return req, nil -} - -// BeginStopPacketCapture - Stops packet capture on virtual network gateway in the specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// virtualNetworkGatewayName - The name of the virtual network gateway. -// parameters - Virtual network gateway packet capture parameters supplied to stop packet capture on gateway. -// options - VirtualNetworkGatewaysClientBeginStopPacketCaptureOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginStopPacketCapture -// method. -func (client *VirtualNetworkGatewaysClient) BeginStopPacketCapture(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VPNPacketCaptureStopParameters, options *VirtualNetworkGatewaysClientBeginStopPacketCaptureOptions) (*runtime.Poller[VirtualNetworkGatewaysClientStopPacketCaptureResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.stopPacketCapture(ctx, resourceGroupName, virtualNetworkGatewayName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VirtualNetworkGatewaysClientStopPacketCaptureResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[VirtualNetworkGatewaysClientStopPacketCaptureResponse](options.ResumeToken, client.pl, nil) - } -} - -// StopPacketCapture - Stops packet capture on virtual network gateway in the specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VirtualNetworkGatewaysClient) stopPacketCapture(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VPNPacketCaptureStopParameters, options *VirtualNetworkGatewaysClientBeginStopPacketCaptureOptions) (*http.Response, error) { - req, err := client.stopPacketCaptureCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// stopPacketCaptureCreateRequest creates the StopPacketCapture request. -func (client *VirtualNetworkGatewaysClient) stopPacketCaptureCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VPNPacketCaptureStopParameters, options *VirtualNetworkGatewaysClientBeginStopPacketCaptureOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/stopPacketCapture" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualNetworkGatewayName == "" { - return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// SupportedVPNDevices - Gets a xml format representation for supported vpn devices. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// virtualNetworkGatewayName - The name of the virtual network gateway. -// options - VirtualNetworkGatewaysClientSupportedVPNDevicesOptions contains the optional parameters for the VirtualNetworkGatewaysClient.SupportedVPNDevices -// method. -func (client *VirtualNetworkGatewaysClient) SupportedVPNDevices(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientSupportedVPNDevicesOptions) (VirtualNetworkGatewaysClientSupportedVPNDevicesResponse, error) { - req, err := client.supportedVPNDevicesCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayName, options) - if err != nil { - return VirtualNetworkGatewaysClientSupportedVPNDevicesResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualNetworkGatewaysClientSupportedVPNDevicesResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualNetworkGatewaysClientSupportedVPNDevicesResponse{}, runtime.NewResponseError(resp) - } - return client.supportedVPNDevicesHandleResponse(resp) -} - -// supportedVPNDevicesCreateRequest creates the SupportedVPNDevices request. -func (client *VirtualNetworkGatewaysClient) supportedVPNDevicesCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientSupportedVPNDevicesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/supportedvpndevices" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualNetworkGatewayName == "" { - return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// supportedVPNDevicesHandleResponse handles the SupportedVPNDevices response. -func (client *VirtualNetworkGatewaysClient) supportedVPNDevicesHandleResponse(resp *http.Response) (VirtualNetworkGatewaysClientSupportedVPNDevicesResponse, error) { - result := VirtualNetworkGatewaysClientSupportedVPNDevicesResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.Value); err != nil { - return VirtualNetworkGatewaysClientSupportedVPNDevicesResponse{}, err - } - return result, nil -} - -// BeginUpdateTags - Updates a virtual network gateway tags. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// virtualNetworkGatewayName - The name of the virtual network gateway. -// parameters - Parameters supplied to update virtual network gateway tags. -// options - VirtualNetworkGatewaysClientBeginUpdateTagsOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginUpdateTags -// method. -func (client *VirtualNetworkGatewaysClient) BeginUpdateTags(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters TagsObject, options *VirtualNetworkGatewaysClientBeginUpdateTagsOptions) (*runtime.Poller[VirtualNetworkGatewaysClientUpdateTagsResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.updateTags(ctx, resourceGroupName, virtualNetworkGatewayName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VirtualNetworkGatewaysClientUpdateTagsResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[VirtualNetworkGatewaysClientUpdateTagsResponse](options.ResumeToken, client.pl, nil) - } -} - -// UpdateTags - Updates a virtual network gateway tags. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VirtualNetworkGatewaysClient) updateTags(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters TagsObject, options *VirtualNetworkGatewaysClientBeginUpdateTagsOptions) (*http.Response, error) { - req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// updateTagsCreateRequest creates the UpdateTags request. -func (client *VirtualNetworkGatewaysClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters TagsObject, options *VirtualNetworkGatewaysClientBeginUpdateTagsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualNetworkGatewayName == "" { - return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// VPNDeviceConfigurationScript - Gets a xml format representation for vpn device configuration script. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// virtualNetworkGatewayConnectionName - The name of the virtual network gateway connection for which the configuration script -// is generated. -// parameters - Parameters supplied to the generate vpn device script operation. -// options - VirtualNetworkGatewaysClientVPNDeviceConfigurationScriptOptions contains the optional parameters for the VirtualNetworkGatewaysClient.VPNDeviceConfigurationScript -// method. -func (client *VirtualNetworkGatewaysClient) VPNDeviceConfigurationScript(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters VPNDeviceScriptParameters, options *VirtualNetworkGatewaysClientVPNDeviceConfigurationScriptOptions) (VirtualNetworkGatewaysClientVPNDeviceConfigurationScriptResponse, error) { - req, err := client.vpnDeviceConfigurationScriptCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options) - if err != nil { - return VirtualNetworkGatewaysClientVPNDeviceConfigurationScriptResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualNetworkGatewaysClientVPNDeviceConfigurationScriptResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualNetworkGatewaysClientVPNDeviceConfigurationScriptResponse{}, runtime.NewResponseError(resp) - } - return client.vpnDeviceConfigurationScriptHandleResponse(resp) -} - -// vpnDeviceConfigurationScriptCreateRequest creates the VPNDeviceConfigurationScript request. -func (client *VirtualNetworkGatewaysClient) vpnDeviceConfigurationScriptCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters VPNDeviceScriptParameters, options *VirtualNetworkGatewaysClientVPNDeviceConfigurationScriptOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/vpndeviceconfigurationscript" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualNetworkGatewayConnectionName == "" { - return nil, errors.New("parameter virtualNetworkGatewayConnectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayConnectionName}", url.PathEscape(virtualNetworkGatewayConnectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// vpnDeviceConfigurationScriptHandleResponse handles the VPNDeviceConfigurationScript response. -func (client *VirtualNetworkGatewaysClient) vpnDeviceConfigurationScriptHandleResponse(resp *http.Response) (VirtualNetworkGatewaysClientVPNDeviceConfigurationScriptResponse, error) { - result := VirtualNetworkGatewaysClientVPNDeviceConfigurationScriptResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.Value); err != nil { - return VirtualNetworkGatewaysClientVPNDeviceConfigurationScriptResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/virtualnetworkpeerings_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/virtualnetworkpeerings_client.go deleted file mode 100644 index 07c38169..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/virtualnetworkpeerings_client.go +++ /dev/null @@ -1,333 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// VirtualNetworkPeeringsClient contains the methods for the VirtualNetworkPeerings group. -// Don't use this type directly, use NewVirtualNetworkPeeringsClient() instead. -type VirtualNetworkPeeringsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewVirtualNetworkPeeringsClient creates a new instance of VirtualNetworkPeeringsClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewVirtualNetworkPeeringsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualNetworkPeeringsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &VirtualNetworkPeeringsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates a peering in the specified virtual network. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// virtualNetworkName - The name of the virtual network. -// virtualNetworkPeeringName - The name of the peering. -// virtualNetworkPeeringParameters - Parameters supplied to the create or update virtual network peering operation. -// options - VirtualNetworkPeeringsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualNetworkPeeringsClient.BeginCreateOrUpdate -// method. -func (client *VirtualNetworkPeeringsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworkName string, virtualNetworkPeeringName string, virtualNetworkPeeringParameters VirtualNetworkPeering, options *VirtualNetworkPeeringsClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualNetworkPeeringsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VirtualNetworkPeeringsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[VirtualNetworkPeeringsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates or updates a peering in the specified virtual network. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VirtualNetworkPeeringsClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworkName string, virtualNetworkPeeringName string, virtualNetworkPeeringParameters VirtualNetworkPeering, options *VirtualNetworkPeeringsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *VirtualNetworkPeeringsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, virtualNetworkPeeringName string, virtualNetworkPeeringParameters VirtualNetworkPeering, options *VirtualNetworkPeeringsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualNetworkName == "" { - return nil, errors.New("parameter virtualNetworkName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkName}", url.PathEscape(virtualNetworkName)) - if virtualNetworkPeeringName == "" { - return nil, errors.New("parameter virtualNetworkPeeringName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkPeeringName}", url.PathEscape(virtualNetworkPeeringName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.SyncRemoteAddressSpace != nil { - reqQP.Set("syncRemoteAddressSpace", string(*options.SyncRemoteAddressSpace)) - } - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, virtualNetworkPeeringParameters) -} - -// BeginDelete - Deletes the specified virtual network peering. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// virtualNetworkName - The name of the virtual network. -// virtualNetworkPeeringName - The name of the virtual network peering. -// options - VirtualNetworkPeeringsClientBeginDeleteOptions contains the optional parameters for the VirtualNetworkPeeringsClient.BeginDelete -// method. -func (client *VirtualNetworkPeeringsClient) BeginDelete(ctx context.Context, resourceGroupName string, virtualNetworkName string, virtualNetworkPeeringName string, options *VirtualNetworkPeeringsClientBeginDeleteOptions) (*runtime.Poller[VirtualNetworkPeeringsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VirtualNetworkPeeringsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[VirtualNetworkPeeringsClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes the specified virtual network peering. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VirtualNetworkPeeringsClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualNetworkName string, virtualNetworkPeeringName string, options *VirtualNetworkPeeringsClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *VirtualNetworkPeeringsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, virtualNetworkPeeringName string, options *VirtualNetworkPeeringsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualNetworkName == "" { - return nil, errors.New("parameter virtualNetworkName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkName}", url.PathEscape(virtualNetworkName)) - if virtualNetworkPeeringName == "" { - return nil, errors.New("parameter virtualNetworkPeeringName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkPeeringName}", url.PathEscape(virtualNetworkPeeringName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets the specified virtual network peering. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// virtualNetworkName - The name of the virtual network. -// virtualNetworkPeeringName - The name of the virtual network peering. -// options - VirtualNetworkPeeringsClientGetOptions contains the optional parameters for the VirtualNetworkPeeringsClient.Get -// method. -func (client *VirtualNetworkPeeringsClient) Get(ctx context.Context, resourceGroupName string, virtualNetworkName string, virtualNetworkPeeringName string, options *VirtualNetworkPeeringsClientGetOptions) (VirtualNetworkPeeringsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, options) - if err != nil { - return VirtualNetworkPeeringsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualNetworkPeeringsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualNetworkPeeringsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *VirtualNetworkPeeringsClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, virtualNetworkPeeringName string, options *VirtualNetworkPeeringsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualNetworkName == "" { - return nil, errors.New("parameter virtualNetworkName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkName}", url.PathEscape(virtualNetworkName)) - if virtualNetworkPeeringName == "" { - return nil, errors.New("parameter virtualNetworkPeeringName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkPeeringName}", url.PathEscape(virtualNetworkPeeringName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *VirtualNetworkPeeringsClient) getHandleResponse(resp *http.Response) (VirtualNetworkPeeringsClientGetResponse, error) { - result := VirtualNetworkPeeringsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualNetworkPeering); err != nil { - return VirtualNetworkPeeringsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Gets all virtual network peerings in a virtual network. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// virtualNetworkName - The name of the virtual network. -// options - VirtualNetworkPeeringsClientListOptions contains the optional parameters for the VirtualNetworkPeeringsClient.List -// method. -func (client *VirtualNetworkPeeringsClient) NewListPager(resourceGroupName string, virtualNetworkName string, options *VirtualNetworkPeeringsClientListOptions) *runtime.Pager[VirtualNetworkPeeringsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualNetworkPeeringsClientListResponse]{ - More: func(page VirtualNetworkPeeringsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VirtualNetworkPeeringsClientListResponse) (VirtualNetworkPeeringsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, virtualNetworkName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return VirtualNetworkPeeringsClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualNetworkPeeringsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualNetworkPeeringsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *VirtualNetworkPeeringsClient) listCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, options *VirtualNetworkPeeringsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualNetworkName == "" { - return nil, errors.New("parameter virtualNetworkName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkName}", url.PathEscape(virtualNetworkName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *VirtualNetworkPeeringsClient) listHandleResponse(resp *http.Response) (VirtualNetworkPeeringsClientListResponse, error) { - result := VirtualNetworkPeeringsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualNetworkPeeringListResult); err != nil { - return VirtualNetworkPeeringsClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/virtualnetworks_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/virtualnetworks_client.go deleted file mode 100644 index 1a24f8e2..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/virtualnetworks_client.go +++ /dev/null @@ -1,557 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// VirtualNetworksClient contains the methods for the VirtualNetworks group. -// Don't use this type directly, use NewVirtualNetworksClient() instead. -type VirtualNetworksClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewVirtualNetworksClient creates a new instance of VirtualNetworksClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewVirtualNetworksClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualNetworksClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &VirtualNetworksClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// CheckIPAddressAvailability - Checks whether a private IP address is available for use. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// virtualNetworkName - The name of the virtual network. -// ipAddress - The private IP address to be verified. -// options - VirtualNetworksClientCheckIPAddressAvailabilityOptions contains the optional parameters for the VirtualNetworksClient.CheckIPAddressAvailability -// method. -func (client *VirtualNetworksClient) CheckIPAddressAvailability(ctx context.Context, resourceGroupName string, virtualNetworkName string, ipAddress string, options *VirtualNetworksClientCheckIPAddressAvailabilityOptions) (VirtualNetworksClientCheckIPAddressAvailabilityResponse, error) { - req, err := client.checkIPAddressAvailabilityCreateRequest(ctx, resourceGroupName, virtualNetworkName, ipAddress, options) - if err != nil { - return VirtualNetworksClientCheckIPAddressAvailabilityResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualNetworksClientCheckIPAddressAvailabilityResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualNetworksClientCheckIPAddressAvailabilityResponse{}, runtime.NewResponseError(resp) - } - return client.checkIPAddressAvailabilityHandleResponse(resp) -} - -// checkIPAddressAvailabilityCreateRequest creates the CheckIPAddressAvailability request. -func (client *VirtualNetworksClient) checkIPAddressAvailabilityCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, ipAddress string, options *VirtualNetworksClientCheckIPAddressAvailabilityOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/CheckIPAddressAvailability" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualNetworkName == "" { - return nil, errors.New("parameter virtualNetworkName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkName}", url.PathEscape(virtualNetworkName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("ipAddress", ipAddress) - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// checkIPAddressAvailabilityHandleResponse handles the CheckIPAddressAvailability response. -func (client *VirtualNetworksClient) checkIPAddressAvailabilityHandleResponse(resp *http.Response) (VirtualNetworksClientCheckIPAddressAvailabilityResponse, error) { - result := VirtualNetworksClientCheckIPAddressAvailabilityResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.IPAddressAvailabilityResult); err != nil { - return VirtualNetworksClientCheckIPAddressAvailabilityResponse{}, err - } - return result, nil -} - -// BeginCreateOrUpdate - Creates or updates a virtual network in the specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// virtualNetworkName - The name of the virtual network. -// parameters - Parameters supplied to the create or update virtual network operation. -// options - VirtualNetworksClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualNetworksClient.BeginCreateOrUpdate -// method. -func (client *VirtualNetworksClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworkName string, parameters VirtualNetwork, options *VirtualNetworksClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualNetworksClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, virtualNetworkName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VirtualNetworksClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[VirtualNetworksClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates or updates a virtual network in the specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VirtualNetworksClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworkName string, parameters VirtualNetwork, options *VirtualNetworksClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, virtualNetworkName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *VirtualNetworksClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, parameters VirtualNetwork, options *VirtualNetworksClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualNetworkName == "" { - return nil, errors.New("parameter virtualNetworkName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkName}", url.PathEscape(virtualNetworkName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginDelete - Deletes the specified virtual network. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// virtualNetworkName - The name of the virtual network. -// options - VirtualNetworksClientBeginDeleteOptions contains the optional parameters for the VirtualNetworksClient.BeginDelete -// method. -func (client *VirtualNetworksClient) BeginDelete(ctx context.Context, resourceGroupName string, virtualNetworkName string, options *VirtualNetworksClientBeginDeleteOptions) (*runtime.Poller[VirtualNetworksClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, virtualNetworkName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VirtualNetworksClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[VirtualNetworksClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes the specified virtual network. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VirtualNetworksClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualNetworkName string, options *VirtualNetworksClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, virtualNetworkName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *VirtualNetworksClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, options *VirtualNetworksClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualNetworkName == "" { - return nil, errors.New("parameter virtualNetworkName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkName}", url.PathEscape(virtualNetworkName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets the specified virtual network by resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// virtualNetworkName - The name of the virtual network. -// options - VirtualNetworksClientGetOptions contains the optional parameters for the VirtualNetworksClient.Get method. -func (client *VirtualNetworksClient) Get(ctx context.Context, resourceGroupName string, virtualNetworkName string, options *VirtualNetworksClientGetOptions) (VirtualNetworksClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, virtualNetworkName, options) - if err != nil { - return VirtualNetworksClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualNetworksClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualNetworksClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *VirtualNetworksClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, options *VirtualNetworksClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualNetworkName == "" { - return nil, errors.New("parameter virtualNetworkName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkName}", url.PathEscape(virtualNetworkName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *VirtualNetworksClient) getHandleResponse(resp *http.Response) (VirtualNetworksClientGetResponse, error) { - result := VirtualNetworksClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualNetwork); err != nil { - return VirtualNetworksClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Gets all virtual networks in a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// options - VirtualNetworksClientListOptions contains the optional parameters for the VirtualNetworksClient.List method. -func (client *VirtualNetworksClient) NewListPager(resourceGroupName string, options *VirtualNetworksClientListOptions) *runtime.Pager[VirtualNetworksClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualNetworksClientListResponse]{ - More: func(page VirtualNetworksClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VirtualNetworksClientListResponse) (VirtualNetworksClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return VirtualNetworksClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualNetworksClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualNetworksClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *VirtualNetworksClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *VirtualNetworksClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *VirtualNetworksClient) listHandleResponse(resp *http.Response) (VirtualNetworksClientListResponse, error) { - result := VirtualNetworksClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualNetworkListResult); err != nil { - return VirtualNetworksClientListResponse{}, err - } - return result, nil -} - -// NewListAllPager - Gets all virtual networks in a subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// options - VirtualNetworksClientListAllOptions contains the optional parameters for the VirtualNetworksClient.ListAll method. -func (client *VirtualNetworksClient) NewListAllPager(options *VirtualNetworksClientListAllOptions) *runtime.Pager[VirtualNetworksClientListAllResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualNetworksClientListAllResponse]{ - More: func(page VirtualNetworksClientListAllResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VirtualNetworksClientListAllResponse) (VirtualNetworksClientListAllResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listAllCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return VirtualNetworksClientListAllResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualNetworksClientListAllResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualNetworksClientListAllResponse{}, runtime.NewResponseError(resp) - } - return client.listAllHandleResponse(resp) - }, - }) -} - -// listAllCreateRequest creates the ListAll request. -func (client *VirtualNetworksClient) listAllCreateRequest(ctx context.Context, options *VirtualNetworksClientListAllOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualNetworks" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listAllHandleResponse handles the ListAll response. -func (client *VirtualNetworksClient) listAllHandleResponse(resp *http.Response) (VirtualNetworksClientListAllResponse, error) { - result := VirtualNetworksClientListAllResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualNetworkListResult); err != nil { - return VirtualNetworksClientListAllResponse{}, err - } - return result, nil -} - -// NewListUsagePager - Lists usage stats. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// virtualNetworkName - The name of the virtual network. -// options - VirtualNetworksClientListUsageOptions contains the optional parameters for the VirtualNetworksClient.ListUsage -// method. -func (client *VirtualNetworksClient) NewListUsagePager(resourceGroupName string, virtualNetworkName string, options *VirtualNetworksClientListUsageOptions) *runtime.Pager[VirtualNetworksClientListUsageResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualNetworksClientListUsageResponse]{ - More: func(page VirtualNetworksClientListUsageResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VirtualNetworksClientListUsageResponse) (VirtualNetworksClientListUsageResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listUsageCreateRequest(ctx, resourceGroupName, virtualNetworkName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return VirtualNetworksClientListUsageResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualNetworksClientListUsageResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualNetworksClientListUsageResponse{}, runtime.NewResponseError(resp) - } - return client.listUsageHandleResponse(resp) - }, - }) -} - -// listUsageCreateRequest creates the ListUsage request. -func (client *VirtualNetworksClient) listUsageCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, options *VirtualNetworksClientListUsageOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/usages" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualNetworkName == "" { - return nil, errors.New("parameter virtualNetworkName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkName}", url.PathEscape(virtualNetworkName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listUsageHandleResponse handles the ListUsage response. -func (client *VirtualNetworksClient) listUsageHandleResponse(resp *http.Response) (VirtualNetworksClientListUsageResponse, error) { - result := VirtualNetworksClientListUsageResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualNetworkListUsageResult); err != nil { - return VirtualNetworksClientListUsageResponse{}, err - } - return result, nil -} - -// UpdateTags - Updates a virtual network tags. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// virtualNetworkName - The name of the virtual network. -// parameters - Parameters supplied to update virtual network tags. -// options - VirtualNetworksClientUpdateTagsOptions contains the optional parameters for the VirtualNetworksClient.UpdateTags -// method. -func (client *VirtualNetworksClient) UpdateTags(ctx context.Context, resourceGroupName string, virtualNetworkName string, parameters TagsObject, options *VirtualNetworksClientUpdateTagsOptions) (VirtualNetworksClientUpdateTagsResponse, error) { - req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, virtualNetworkName, parameters, options) - if err != nil { - return VirtualNetworksClientUpdateTagsResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualNetworksClientUpdateTagsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualNetworksClientUpdateTagsResponse{}, runtime.NewResponseError(resp) - } - return client.updateTagsHandleResponse(resp) -} - -// updateTagsCreateRequest creates the UpdateTags request. -func (client *VirtualNetworksClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, parameters TagsObject, options *VirtualNetworksClientUpdateTagsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualNetworkName == "" { - return nil, errors.New("parameter virtualNetworkName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkName}", url.PathEscape(virtualNetworkName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// updateTagsHandleResponse handles the UpdateTags response. -func (client *VirtualNetworksClient) updateTagsHandleResponse(resp *http.Response) (VirtualNetworksClientUpdateTagsResponse, error) { - result := VirtualNetworksClientUpdateTagsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualNetwork); err != nil { - return VirtualNetworksClientUpdateTagsResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/virtualnetworktaps_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/virtualnetworktaps_client.go deleted file mode 100644 index 48f47abf..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/virtualnetworktaps_client.go +++ /dev/null @@ -1,427 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// VirtualNetworkTapsClient contains the methods for the VirtualNetworkTaps group. -// Don't use this type directly, use NewVirtualNetworkTapsClient() instead. -type VirtualNetworkTapsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewVirtualNetworkTapsClient creates a new instance of VirtualNetworkTapsClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewVirtualNetworkTapsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualNetworkTapsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &VirtualNetworkTapsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates a Virtual Network Tap. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// tapName - The name of the virtual network tap. -// parameters - Parameters supplied to the create or update virtual network tap operation. -// options - VirtualNetworkTapsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualNetworkTapsClient.BeginCreateOrUpdate -// method. -func (client *VirtualNetworkTapsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, tapName string, parameters VirtualNetworkTap, options *VirtualNetworkTapsClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualNetworkTapsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, tapName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VirtualNetworkTapsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[VirtualNetworkTapsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates or updates a Virtual Network Tap. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VirtualNetworkTapsClient) createOrUpdate(ctx context.Context, resourceGroupName string, tapName string, parameters VirtualNetworkTap, options *VirtualNetworkTapsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, tapName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *VirtualNetworkTapsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, tapName string, parameters VirtualNetworkTap, options *VirtualNetworkTapsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps/{tapName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if tapName == "" { - return nil, errors.New("parameter tapName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{tapName}", url.PathEscape(tapName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginDelete - Deletes the specified virtual network tap. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// tapName - The name of the virtual network tap. -// options - VirtualNetworkTapsClientBeginDeleteOptions contains the optional parameters for the VirtualNetworkTapsClient.BeginDelete -// method. -func (client *VirtualNetworkTapsClient) BeginDelete(ctx context.Context, resourceGroupName string, tapName string, options *VirtualNetworkTapsClientBeginDeleteOptions) (*runtime.Poller[VirtualNetworkTapsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, tapName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VirtualNetworkTapsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[VirtualNetworkTapsClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes the specified virtual network tap. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VirtualNetworkTapsClient) deleteOperation(ctx context.Context, resourceGroupName string, tapName string, options *VirtualNetworkTapsClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, tapName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *VirtualNetworkTapsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, tapName string, options *VirtualNetworkTapsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps/{tapName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if tapName == "" { - return nil, errors.New("parameter tapName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{tapName}", url.PathEscape(tapName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets information about the specified virtual network tap. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// tapName - The name of virtual network tap. -// options - VirtualNetworkTapsClientGetOptions contains the optional parameters for the VirtualNetworkTapsClient.Get method. -func (client *VirtualNetworkTapsClient) Get(ctx context.Context, resourceGroupName string, tapName string, options *VirtualNetworkTapsClientGetOptions) (VirtualNetworkTapsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, tapName, options) - if err != nil { - return VirtualNetworkTapsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualNetworkTapsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualNetworkTapsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *VirtualNetworkTapsClient) getCreateRequest(ctx context.Context, resourceGroupName string, tapName string, options *VirtualNetworkTapsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps/{tapName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if tapName == "" { - return nil, errors.New("parameter tapName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{tapName}", url.PathEscape(tapName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *VirtualNetworkTapsClient) getHandleResponse(resp *http.Response) (VirtualNetworkTapsClientGetResponse, error) { - result := VirtualNetworkTapsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualNetworkTap); err != nil { - return VirtualNetworkTapsClientGetResponse{}, err - } - return result, nil -} - -// NewListAllPager - Gets all the VirtualNetworkTaps in a subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// options - VirtualNetworkTapsClientListAllOptions contains the optional parameters for the VirtualNetworkTapsClient.ListAll -// method. -func (client *VirtualNetworkTapsClient) NewListAllPager(options *VirtualNetworkTapsClientListAllOptions) *runtime.Pager[VirtualNetworkTapsClientListAllResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualNetworkTapsClientListAllResponse]{ - More: func(page VirtualNetworkTapsClientListAllResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VirtualNetworkTapsClientListAllResponse) (VirtualNetworkTapsClientListAllResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listAllCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return VirtualNetworkTapsClientListAllResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualNetworkTapsClientListAllResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualNetworkTapsClientListAllResponse{}, runtime.NewResponseError(resp) - } - return client.listAllHandleResponse(resp) - }, - }) -} - -// listAllCreateRequest creates the ListAll request. -func (client *VirtualNetworkTapsClient) listAllCreateRequest(ctx context.Context, options *VirtualNetworkTapsClientListAllOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualNetworkTaps" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listAllHandleResponse handles the ListAll response. -func (client *VirtualNetworkTapsClient) listAllHandleResponse(resp *http.Response) (VirtualNetworkTapsClientListAllResponse, error) { - result := VirtualNetworkTapsClientListAllResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualNetworkTapListResult); err != nil { - return VirtualNetworkTapsClientListAllResponse{}, err - } - return result, nil -} - -// NewListByResourceGroupPager - Gets all the VirtualNetworkTaps in a subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// options - VirtualNetworkTapsClientListByResourceGroupOptions contains the optional parameters for the VirtualNetworkTapsClient.ListByResourceGroup -// method. -func (client *VirtualNetworkTapsClient) NewListByResourceGroupPager(resourceGroupName string, options *VirtualNetworkTapsClientListByResourceGroupOptions) *runtime.Pager[VirtualNetworkTapsClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualNetworkTapsClientListByResourceGroupResponse]{ - More: func(page VirtualNetworkTapsClientListByResourceGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VirtualNetworkTapsClientListByResourceGroupResponse) (VirtualNetworkTapsClientListByResourceGroupResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return VirtualNetworkTapsClientListByResourceGroupResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualNetworkTapsClientListByResourceGroupResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualNetworkTapsClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) - } - return client.listByResourceGroupHandleResponse(resp) - }, - }) -} - -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *VirtualNetworkTapsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *VirtualNetworkTapsClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *VirtualNetworkTapsClient) listByResourceGroupHandleResponse(resp *http.Response) (VirtualNetworkTapsClientListByResourceGroupResponse, error) { - result := VirtualNetworkTapsClientListByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualNetworkTapListResult); err != nil { - return VirtualNetworkTapsClientListByResourceGroupResponse{}, err - } - return result, nil -} - -// UpdateTags - Updates an VirtualNetworkTap tags. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// tapName - The name of the tap. -// tapParameters - Parameters supplied to update VirtualNetworkTap tags. -// options - VirtualNetworkTapsClientUpdateTagsOptions contains the optional parameters for the VirtualNetworkTapsClient.UpdateTags -// method. -func (client *VirtualNetworkTapsClient) UpdateTags(ctx context.Context, resourceGroupName string, tapName string, tapParameters TagsObject, options *VirtualNetworkTapsClientUpdateTagsOptions) (VirtualNetworkTapsClientUpdateTagsResponse, error) { - req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, tapName, tapParameters, options) - if err != nil { - return VirtualNetworkTapsClientUpdateTagsResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualNetworkTapsClientUpdateTagsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualNetworkTapsClientUpdateTagsResponse{}, runtime.NewResponseError(resp) - } - return client.updateTagsHandleResponse(resp) -} - -// updateTagsCreateRequest creates the UpdateTags request. -func (client *VirtualNetworkTapsClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, tapName string, tapParameters TagsObject, options *VirtualNetworkTapsClientUpdateTagsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps/{tapName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if tapName == "" { - return nil, errors.New("parameter tapName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{tapName}", url.PathEscape(tapName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, tapParameters) -} - -// updateTagsHandleResponse handles the UpdateTags response. -func (client *VirtualNetworkTapsClient) updateTagsHandleResponse(resp *http.Response) (VirtualNetworkTapsClientUpdateTagsResponse, error) { - result := VirtualNetworkTapsClientUpdateTagsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualNetworkTap); err != nil { - return VirtualNetworkTapsClientUpdateTagsResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/virtualrouterpeerings_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/virtualrouterpeerings_client.go deleted file mode 100644 index ce4d8b06..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/virtualrouterpeerings_client.go +++ /dev/null @@ -1,330 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// VirtualRouterPeeringsClient contains the methods for the VirtualRouterPeerings group. -// Don't use this type directly, use NewVirtualRouterPeeringsClient() instead. -type VirtualRouterPeeringsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewVirtualRouterPeeringsClient creates a new instance of VirtualRouterPeeringsClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewVirtualRouterPeeringsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualRouterPeeringsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &VirtualRouterPeeringsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates the specified Virtual Router Peering. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// virtualRouterName - The name of the Virtual Router. -// peeringName - The name of the Virtual Router Peering. -// parameters - Parameters supplied to the create or update Virtual Router Peering operation. -// options - VirtualRouterPeeringsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualRouterPeeringsClient.BeginCreateOrUpdate -// method. -func (client *VirtualRouterPeeringsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, virtualRouterName string, peeringName string, parameters VirtualRouterPeering, options *VirtualRouterPeeringsClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualRouterPeeringsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, virtualRouterName, peeringName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VirtualRouterPeeringsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[VirtualRouterPeeringsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates or updates the specified Virtual Router Peering. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VirtualRouterPeeringsClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualRouterName string, peeringName string, parameters VirtualRouterPeering, options *VirtualRouterPeeringsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, virtualRouterName, peeringName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *VirtualRouterPeeringsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualRouterName string, peeringName string, parameters VirtualRouterPeering, options *VirtualRouterPeeringsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}/peerings/{peeringName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualRouterName == "" { - return nil, errors.New("parameter virtualRouterName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualRouterName}", url.PathEscape(virtualRouterName)) - if peeringName == "" { - return nil, errors.New("parameter peeringName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{peeringName}", url.PathEscape(peeringName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginDelete - Deletes the specified peering from a Virtual Router. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// virtualRouterName - The name of the Virtual Router. -// peeringName - The name of the peering. -// options - VirtualRouterPeeringsClientBeginDeleteOptions contains the optional parameters for the VirtualRouterPeeringsClient.BeginDelete -// method. -func (client *VirtualRouterPeeringsClient) BeginDelete(ctx context.Context, resourceGroupName string, virtualRouterName string, peeringName string, options *VirtualRouterPeeringsClientBeginDeleteOptions) (*runtime.Poller[VirtualRouterPeeringsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, virtualRouterName, peeringName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VirtualRouterPeeringsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[VirtualRouterPeeringsClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes the specified peering from a Virtual Router. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VirtualRouterPeeringsClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualRouterName string, peeringName string, options *VirtualRouterPeeringsClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, virtualRouterName, peeringName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *VirtualRouterPeeringsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, virtualRouterName string, peeringName string, options *VirtualRouterPeeringsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}/peerings/{peeringName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualRouterName == "" { - return nil, errors.New("parameter virtualRouterName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualRouterName}", url.PathEscape(virtualRouterName)) - if peeringName == "" { - return nil, errors.New("parameter peeringName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{peeringName}", url.PathEscape(peeringName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets the specified Virtual Router Peering. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// virtualRouterName - The name of the Virtual Router. -// peeringName - The name of the Virtual Router Peering. -// options - VirtualRouterPeeringsClientGetOptions contains the optional parameters for the VirtualRouterPeeringsClient.Get -// method. -func (client *VirtualRouterPeeringsClient) Get(ctx context.Context, resourceGroupName string, virtualRouterName string, peeringName string, options *VirtualRouterPeeringsClientGetOptions) (VirtualRouterPeeringsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, virtualRouterName, peeringName, options) - if err != nil { - return VirtualRouterPeeringsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualRouterPeeringsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualRouterPeeringsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *VirtualRouterPeeringsClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualRouterName string, peeringName string, options *VirtualRouterPeeringsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}/peerings/{peeringName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualRouterName == "" { - return nil, errors.New("parameter virtualRouterName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualRouterName}", url.PathEscape(virtualRouterName)) - if peeringName == "" { - return nil, errors.New("parameter peeringName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{peeringName}", url.PathEscape(peeringName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *VirtualRouterPeeringsClient) getHandleResponse(resp *http.Response) (VirtualRouterPeeringsClientGetResponse, error) { - result := VirtualRouterPeeringsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualRouterPeering); err != nil { - return VirtualRouterPeeringsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Lists all Virtual Router Peerings in a Virtual Router resource. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// virtualRouterName - The name of the Virtual Router. -// options - VirtualRouterPeeringsClientListOptions contains the optional parameters for the VirtualRouterPeeringsClient.List -// method. -func (client *VirtualRouterPeeringsClient) NewListPager(resourceGroupName string, virtualRouterName string, options *VirtualRouterPeeringsClientListOptions) *runtime.Pager[VirtualRouterPeeringsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualRouterPeeringsClientListResponse]{ - More: func(page VirtualRouterPeeringsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VirtualRouterPeeringsClientListResponse) (VirtualRouterPeeringsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, virtualRouterName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return VirtualRouterPeeringsClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualRouterPeeringsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualRouterPeeringsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *VirtualRouterPeeringsClient) listCreateRequest(ctx context.Context, resourceGroupName string, virtualRouterName string, options *VirtualRouterPeeringsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}/peerings" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualRouterName == "" { - return nil, errors.New("parameter virtualRouterName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualRouterName}", url.PathEscape(virtualRouterName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *VirtualRouterPeeringsClient) listHandleResponse(resp *http.Response) (VirtualRouterPeeringsClientListResponse, error) { - result := VirtualRouterPeeringsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualRouterPeeringListResult); err != nil { - return VirtualRouterPeeringsClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/virtualrouters_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/virtualrouters_client.go deleted file mode 100644 index fd9765d7..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/virtualrouters_client.go +++ /dev/null @@ -1,371 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// VirtualRoutersClient contains the methods for the VirtualRouters group. -// Don't use this type directly, use NewVirtualRoutersClient() instead. -type VirtualRoutersClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewVirtualRoutersClient creates a new instance of VirtualRoutersClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewVirtualRoutersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualRoutersClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &VirtualRoutersClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates the specified Virtual Router. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// virtualRouterName - The name of the Virtual Router. -// parameters - Parameters supplied to the create or update Virtual Router. -// options - VirtualRoutersClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualRoutersClient.BeginCreateOrUpdate -// method. -func (client *VirtualRoutersClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, virtualRouterName string, parameters VirtualRouter, options *VirtualRoutersClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualRoutersClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, virtualRouterName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VirtualRoutersClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[VirtualRoutersClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates or updates the specified Virtual Router. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VirtualRoutersClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualRouterName string, parameters VirtualRouter, options *VirtualRoutersClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, virtualRouterName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *VirtualRoutersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualRouterName string, parameters VirtualRouter, options *VirtualRoutersClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualRouterName == "" { - return nil, errors.New("parameter virtualRouterName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualRouterName}", url.PathEscape(virtualRouterName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginDelete - Deletes the specified Virtual Router. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// virtualRouterName - The name of the Virtual Router. -// options - VirtualRoutersClientBeginDeleteOptions contains the optional parameters for the VirtualRoutersClient.BeginDelete -// method. -func (client *VirtualRoutersClient) BeginDelete(ctx context.Context, resourceGroupName string, virtualRouterName string, options *VirtualRoutersClientBeginDeleteOptions) (*runtime.Poller[VirtualRoutersClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, virtualRouterName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VirtualRoutersClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[VirtualRoutersClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes the specified Virtual Router. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VirtualRoutersClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualRouterName string, options *VirtualRoutersClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, virtualRouterName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *VirtualRoutersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, virtualRouterName string, options *VirtualRoutersClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualRouterName == "" { - return nil, errors.New("parameter virtualRouterName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualRouterName}", url.PathEscape(virtualRouterName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets the specified Virtual Router. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// virtualRouterName - The name of the Virtual Router. -// options - VirtualRoutersClientGetOptions contains the optional parameters for the VirtualRoutersClient.Get method. -func (client *VirtualRoutersClient) Get(ctx context.Context, resourceGroupName string, virtualRouterName string, options *VirtualRoutersClientGetOptions) (VirtualRoutersClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, virtualRouterName, options) - if err != nil { - return VirtualRoutersClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualRoutersClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualRoutersClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *VirtualRoutersClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualRouterName string, options *VirtualRoutersClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualRouterName == "" { - return nil, errors.New("parameter virtualRouterName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualRouterName}", url.PathEscape(virtualRouterName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *VirtualRoutersClient) getHandleResponse(resp *http.Response) (VirtualRoutersClientGetResponse, error) { - result := VirtualRoutersClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualRouter); err != nil { - return VirtualRoutersClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Gets all the Virtual Routers in a subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// options - VirtualRoutersClientListOptions contains the optional parameters for the VirtualRoutersClient.List method. -func (client *VirtualRoutersClient) NewListPager(options *VirtualRoutersClientListOptions) *runtime.Pager[VirtualRoutersClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualRoutersClientListResponse]{ - More: func(page VirtualRoutersClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VirtualRoutersClientListResponse) (VirtualRoutersClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return VirtualRoutersClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualRoutersClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualRoutersClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *VirtualRoutersClient) listCreateRequest(ctx context.Context, options *VirtualRoutersClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualRouters" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *VirtualRoutersClient) listHandleResponse(resp *http.Response) (VirtualRoutersClientListResponse, error) { - result := VirtualRoutersClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualRouterListResult); err != nil { - return VirtualRoutersClientListResponse{}, err - } - return result, nil -} - -// NewListByResourceGroupPager - Lists all Virtual Routers in a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// options - VirtualRoutersClientListByResourceGroupOptions contains the optional parameters for the VirtualRoutersClient.ListByResourceGroup -// method. -func (client *VirtualRoutersClient) NewListByResourceGroupPager(resourceGroupName string, options *VirtualRoutersClientListByResourceGroupOptions) *runtime.Pager[VirtualRoutersClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualRoutersClientListByResourceGroupResponse]{ - More: func(page VirtualRoutersClientListByResourceGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VirtualRoutersClientListByResourceGroupResponse) (VirtualRoutersClientListByResourceGroupResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return VirtualRoutersClientListByResourceGroupResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualRoutersClientListByResourceGroupResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualRoutersClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) - } - return client.listByResourceGroupHandleResponse(resp) - }, - }) -} - -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *VirtualRoutersClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *VirtualRoutersClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *VirtualRoutersClient) listByResourceGroupHandleResponse(resp *http.Response) (VirtualRoutersClientListByResourceGroupResponse, error) { - result := VirtualRoutersClientListByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualRouterListResult); err != nil { - return VirtualRoutersClientListByResourceGroupResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/virtualwans_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/virtualwans_client.go deleted file mode 100644 index 5afdc12b..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/virtualwans_client.go +++ /dev/null @@ -1,424 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// VirtualWansClient contains the methods for the VirtualWans group. -// Don't use this type directly, use NewVirtualWansClient() instead. -type VirtualWansClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewVirtualWansClient creates a new instance of VirtualWansClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewVirtualWansClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualWansClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &VirtualWansClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the VirtualWan. -// virtualWANName - The name of the VirtualWAN being created or updated. -// wanParameters - Parameters supplied to create or update VirtualWAN. -// options - VirtualWansClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualWansClient.BeginCreateOrUpdate -// method. -func (client *VirtualWansClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, virtualWANName string, wanParameters VirtualWAN, options *VirtualWansClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualWansClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, virtualWANName, wanParameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VirtualWansClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[VirtualWansClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VirtualWansClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualWANName string, wanParameters VirtualWAN, options *VirtualWansClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, virtualWANName, wanParameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *VirtualWansClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualWANName string, wanParameters VirtualWAN, options *VirtualWansClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualWANName == "" { - return nil, errors.New("parameter virtualWANName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{VirtualWANName}", url.PathEscape(virtualWANName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, wanParameters) -} - -// BeginDelete - Deletes a VirtualWAN. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the VirtualWan. -// virtualWANName - The name of the VirtualWAN being deleted. -// options - VirtualWansClientBeginDeleteOptions contains the optional parameters for the VirtualWansClient.BeginDelete method. -func (client *VirtualWansClient) BeginDelete(ctx context.Context, resourceGroupName string, virtualWANName string, options *VirtualWansClientBeginDeleteOptions) (*runtime.Poller[VirtualWansClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, virtualWANName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VirtualWansClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[VirtualWansClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes a VirtualWAN. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VirtualWansClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualWANName string, options *VirtualWansClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, virtualWANName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *VirtualWansClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, virtualWANName string, options *VirtualWansClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualWANName == "" { - return nil, errors.New("parameter virtualWANName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{VirtualWANName}", url.PathEscape(virtualWANName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Retrieves the details of a VirtualWAN. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the VirtualWan. -// virtualWANName - The name of the VirtualWAN being retrieved. -// options - VirtualWansClientGetOptions contains the optional parameters for the VirtualWansClient.Get method. -func (client *VirtualWansClient) Get(ctx context.Context, resourceGroupName string, virtualWANName string, options *VirtualWansClientGetOptions) (VirtualWansClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, virtualWANName, options) - if err != nil { - return VirtualWansClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualWansClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualWansClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *VirtualWansClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualWANName string, options *VirtualWansClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualWANName == "" { - return nil, errors.New("parameter virtualWANName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{VirtualWANName}", url.PathEscape(virtualWANName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *VirtualWansClient) getHandleResponse(resp *http.Response) (VirtualWansClientGetResponse, error) { - result := VirtualWansClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualWAN); err != nil { - return VirtualWansClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Lists all the VirtualWANs in a subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// options - VirtualWansClientListOptions contains the optional parameters for the VirtualWansClient.List method. -func (client *VirtualWansClient) NewListPager(options *VirtualWansClientListOptions) *runtime.Pager[VirtualWansClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualWansClientListResponse]{ - More: func(page VirtualWansClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VirtualWansClientListResponse) (VirtualWansClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return VirtualWansClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualWansClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualWansClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *VirtualWansClient) listCreateRequest(ctx context.Context, options *VirtualWansClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualWans" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *VirtualWansClient) listHandleResponse(resp *http.Response) (VirtualWansClientListResponse, error) { - result := VirtualWansClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ListVirtualWANsResult); err != nil { - return VirtualWansClientListResponse{}, err - } - return result, nil -} - -// NewListByResourceGroupPager - Lists all the VirtualWANs in a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the VirtualWan. -// options - VirtualWansClientListByResourceGroupOptions contains the optional parameters for the VirtualWansClient.ListByResourceGroup -// method. -func (client *VirtualWansClient) NewListByResourceGroupPager(resourceGroupName string, options *VirtualWansClientListByResourceGroupOptions) *runtime.Pager[VirtualWansClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualWansClientListByResourceGroupResponse]{ - More: func(page VirtualWansClientListByResourceGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VirtualWansClientListByResourceGroupResponse) (VirtualWansClientListByResourceGroupResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return VirtualWansClientListByResourceGroupResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualWansClientListByResourceGroupResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualWansClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) - } - return client.listByResourceGroupHandleResponse(resp) - }, - }) -} - -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *VirtualWansClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *VirtualWansClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *VirtualWansClient) listByResourceGroupHandleResponse(resp *http.Response) (VirtualWansClientListByResourceGroupResponse, error) { - result := VirtualWansClientListByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ListVirtualWANsResult); err != nil { - return VirtualWansClientListByResourceGroupResponse{}, err - } - return result, nil -} - -// UpdateTags - Updates a VirtualWAN tags. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the VirtualWan. -// virtualWANName - The name of the VirtualWAN being updated. -// wanParameters - Parameters supplied to Update VirtualWAN tags. -// options - VirtualWansClientUpdateTagsOptions contains the optional parameters for the VirtualWansClient.UpdateTags method. -func (client *VirtualWansClient) UpdateTags(ctx context.Context, resourceGroupName string, virtualWANName string, wanParameters TagsObject, options *VirtualWansClientUpdateTagsOptions) (VirtualWansClientUpdateTagsResponse, error) { - req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, virtualWANName, wanParameters, options) - if err != nil { - return VirtualWansClientUpdateTagsResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VirtualWansClientUpdateTagsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualWansClientUpdateTagsResponse{}, runtime.NewResponseError(resp) - } - return client.updateTagsHandleResponse(resp) -} - -// updateTagsCreateRequest creates the UpdateTags request. -func (client *VirtualWansClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, virtualWANName string, wanParameters TagsObject, options *VirtualWansClientUpdateTagsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualWANName == "" { - return nil, errors.New("parameter virtualWANName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{VirtualWANName}", url.PathEscape(virtualWANName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, wanParameters) -} - -// updateTagsHandleResponse handles the UpdateTags response. -func (client *VirtualWansClient) updateTagsHandleResponse(resp *http.Response) (VirtualWansClientUpdateTagsResponse, error) { - result := VirtualWansClientUpdateTagsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualWAN); err != nil { - return VirtualWansClientUpdateTagsResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/vpnconnections_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/vpnconnections_client.go deleted file mode 100644 index c11d4487..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/vpnconnections_client.go +++ /dev/null @@ -1,476 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// VPNConnectionsClient contains the methods for the VPNConnections group. -// Don't use this type directly, use NewVPNConnectionsClient() instead. -type VPNConnectionsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewVPNConnectionsClient creates a new instance of VPNConnectionsClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewVPNConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VPNConnectionsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &VPNConnectionsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing -// connection. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the VpnGateway. -// gatewayName - The name of the gateway. -// connectionName - The name of the connection. -// vpnConnectionParameters - Parameters supplied to create or Update a VPN Connection. -// options - VPNConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the VPNConnectionsClient.BeginCreateOrUpdate -// method. -func (client *VPNConnectionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, vpnConnectionParameters VPNConnection, options *VPNConnectionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[VPNConnectionsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, gatewayName, connectionName, vpnConnectionParameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VPNConnectionsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[VPNConnectionsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VPNConnectionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, vpnConnectionParameters VPNConnection, options *VPNConnectionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, gatewayName, connectionName, vpnConnectionParameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *VPNConnectionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, vpnConnectionParameters VPNConnection, options *VPNConnectionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if gatewayName == "" { - return nil, errors.New("parameter gatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) - if connectionName == "" { - return nil, errors.New("parameter connectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, vpnConnectionParameters) -} - -// BeginDelete - Deletes a vpn connection. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the VpnGateway. -// gatewayName - The name of the gateway. -// connectionName - The name of the connection. -// options - VPNConnectionsClientBeginDeleteOptions contains the optional parameters for the VPNConnectionsClient.BeginDelete -// method. -func (client *VPNConnectionsClient) BeginDelete(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, options *VPNConnectionsClientBeginDeleteOptions) (*runtime.Poller[VPNConnectionsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, gatewayName, connectionName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VPNConnectionsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[VPNConnectionsClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes a vpn connection. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VPNConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, options *VPNConnectionsClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, gatewayName, connectionName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *VPNConnectionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, options *VPNConnectionsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if gatewayName == "" { - return nil, errors.New("parameter gatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) - if connectionName == "" { - return nil, errors.New("parameter connectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Retrieves the details of a vpn connection. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the VpnGateway. -// gatewayName - The name of the gateway. -// connectionName - The name of the vpn connection. -// options - VPNConnectionsClientGetOptions contains the optional parameters for the VPNConnectionsClient.Get method. -func (client *VPNConnectionsClient) Get(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, options *VPNConnectionsClientGetOptions) (VPNConnectionsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, gatewayName, connectionName, options) - if err != nil { - return VPNConnectionsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VPNConnectionsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VPNConnectionsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *VPNConnectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, options *VPNConnectionsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if gatewayName == "" { - return nil, errors.New("parameter gatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) - if connectionName == "" { - return nil, errors.New("parameter connectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *VPNConnectionsClient) getHandleResponse(resp *http.Response) (VPNConnectionsClientGetResponse, error) { - result := VPNConnectionsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VPNConnection); err != nil { - return VPNConnectionsClientGetResponse{}, err - } - return result, nil -} - -// NewListByVPNGatewayPager - Retrieves all vpn connections for a particular virtual wan vpn gateway. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the VpnGateway. -// gatewayName - The name of the gateway. -// options - VPNConnectionsClientListByVPNGatewayOptions contains the optional parameters for the VPNConnectionsClient.ListByVPNGateway -// method. -func (client *VPNConnectionsClient) NewListByVPNGatewayPager(resourceGroupName string, gatewayName string, options *VPNConnectionsClientListByVPNGatewayOptions) *runtime.Pager[VPNConnectionsClientListByVPNGatewayResponse] { - return runtime.NewPager(runtime.PagingHandler[VPNConnectionsClientListByVPNGatewayResponse]{ - More: func(page VPNConnectionsClientListByVPNGatewayResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VPNConnectionsClientListByVPNGatewayResponse) (VPNConnectionsClientListByVPNGatewayResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByVPNGatewayCreateRequest(ctx, resourceGroupName, gatewayName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return VPNConnectionsClientListByVPNGatewayResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VPNConnectionsClientListByVPNGatewayResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VPNConnectionsClientListByVPNGatewayResponse{}, runtime.NewResponseError(resp) - } - return client.listByVPNGatewayHandleResponse(resp) - }, - }) -} - -// listByVPNGatewayCreateRequest creates the ListByVPNGateway request. -func (client *VPNConnectionsClient) listByVPNGatewayCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, options *VPNConnectionsClientListByVPNGatewayOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if gatewayName == "" { - return nil, errors.New("parameter gatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByVPNGatewayHandleResponse handles the ListByVPNGateway response. -func (client *VPNConnectionsClient) listByVPNGatewayHandleResponse(resp *http.Response) (VPNConnectionsClientListByVPNGatewayResponse, error) { - result := VPNConnectionsClientListByVPNGatewayResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ListVPNConnectionsResult); err != nil { - return VPNConnectionsClientListByVPNGatewayResponse{}, err - } - return result, nil -} - -// BeginStartPacketCapture - Starts packet capture on Vpn connection in the specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// gatewayName - The name of the gateway. -// vpnConnectionName - The name of the vpn connection. -// options - VPNConnectionsClientBeginStartPacketCaptureOptions contains the optional parameters for the VPNConnectionsClient.BeginStartPacketCapture -// method. -func (client *VPNConnectionsClient) BeginStartPacketCapture(ctx context.Context, resourceGroupName string, gatewayName string, vpnConnectionName string, options *VPNConnectionsClientBeginStartPacketCaptureOptions) (*runtime.Poller[VPNConnectionsClientStartPacketCaptureResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.startPacketCapture(ctx, resourceGroupName, gatewayName, vpnConnectionName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VPNConnectionsClientStartPacketCaptureResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[VPNConnectionsClientStartPacketCaptureResponse](options.ResumeToken, client.pl, nil) - } -} - -// StartPacketCapture - Starts packet capture on Vpn connection in the specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VPNConnectionsClient) startPacketCapture(ctx context.Context, resourceGroupName string, gatewayName string, vpnConnectionName string, options *VPNConnectionsClientBeginStartPacketCaptureOptions) (*http.Response, error) { - req, err := client.startPacketCaptureCreateRequest(ctx, resourceGroupName, gatewayName, vpnConnectionName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// startPacketCaptureCreateRequest creates the StartPacketCapture request. -func (client *VPNConnectionsClient) startPacketCaptureCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, vpnConnectionName string, options *VPNConnectionsClientBeginStartPacketCaptureOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{vpnConnectionName}/startpacketcapture" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if gatewayName == "" { - return nil, errors.New("parameter gatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) - if vpnConnectionName == "" { - return nil, errors.New("parameter vpnConnectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vpnConnectionName}", url.PathEscape(vpnConnectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.Parameters != nil { - return req, runtime.MarshalAsJSON(req, *options.Parameters) - } - return req, nil -} - -// BeginStopPacketCapture - Stops packet capture on Vpn connection in the specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// gatewayName - The name of the gateway. -// vpnConnectionName - The name of the vpn connection. -// options - VPNConnectionsClientBeginStopPacketCaptureOptions contains the optional parameters for the VPNConnectionsClient.BeginStopPacketCapture -// method. -func (client *VPNConnectionsClient) BeginStopPacketCapture(ctx context.Context, resourceGroupName string, gatewayName string, vpnConnectionName string, options *VPNConnectionsClientBeginStopPacketCaptureOptions) (*runtime.Poller[VPNConnectionsClientStopPacketCaptureResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.stopPacketCapture(ctx, resourceGroupName, gatewayName, vpnConnectionName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VPNConnectionsClientStopPacketCaptureResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[VPNConnectionsClientStopPacketCaptureResponse](options.ResumeToken, client.pl, nil) - } -} - -// StopPacketCapture - Stops packet capture on Vpn connection in the specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VPNConnectionsClient) stopPacketCapture(ctx context.Context, resourceGroupName string, gatewayName string, vpnConnectionName string, options *VPNConnectionsClientBeginStopPacketCaptureOptions) (*http.Response, error) { - req, err := client.stopPacketCaptureCreateRequest(ctx, resourceGroupName, gatewayName, vpnConnectionName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// stopPacketCaptureCreateRequest creates the StopPacketCapture request. -func (client *VPNConnectionsClient) stopPacketCaptureCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, vpnConnectionName string, options *VPNConnectionsClientBeginStopPacketCaptureOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{vpnConnectionName}/stoppacketcapture" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if gatewayName == "" { - return nil, errors.New("parameter gatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) - if vpnConnectionName == "" { - return nil, errors.New("parameter vpnConnectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vpnConnectionName}", url.PathEscape(vpnConnectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.Parameters != nil { - return req, runtime.MarshalAsJSON(req, *options.Parameters) - } - return req, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/vpngateways_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/vpngateways_client.go deleted file mode 100644 index 7496203c..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/vpngateways_client.go +++ /dev/null @@ -1,633 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// VPNGatewaysClient contains the methods for the VPNGateways group. -// Don't use this type directly, use NewVPNGatewaysClient() instead. -type VPNGatewaysClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewVPNGatewaysClient creates a new instance of VPNGatewaysClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewVPNGatewaysClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VPNGatewaysClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &VPNGatewaysClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the VpnGateway. -// gatewayName - The name of the gateway. -// vpnGatewayParameters - Parameters supplied to create or Update a virtual wan vpn gateway. -// options - VPNGatewaysClientBeginCreateOrUpdateOptions contains the optional parameters for the VPNGatewaysClient.BeginCreateOrUpdate -// method. -func (client *VPNGatewaysClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, gatewayName string, vpnGatewayParameters VPNGateway, options *VPNGatewaysClientBeginCreateOrUpdateOptions) (*runtime.Poller[VPNGatewaysClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, gatewayName, vpnGatewayParameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VPNGatewaysClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[VPNGatewaysClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VPNGatewaysClient) createOrUpdate(ctx context.Context, resourceGroupName string, gatewayName string, vpnGatewayParameters VPNGateway, options *VPNGatewaysClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, gatewayName, vpnGatewayParameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *VPNGatewaysClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, vpnGatewayParameters VPNGateway, options *VPNGatewaysClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if gatewayName == "" { - return nil, errors.New("parameter gatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, vpnGatewayParameters) -} - -// BeginDelete - Deletes a virtual wan vpn gateway. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the VpnGateway. -// gatewayName - The name of the gateway. -// options - VPNGatewaysClientBeginDeleteOptions contains the optional parameters for the VPNGatewaysClient.BeginDelete method. -func (client *VPNGatewaysClient) BeginDelete(ctx context.Context, resourceGroupName string, gatewayName string, options *VPNGatewaysClientBeginDeleteOptions) (*runtime.Poller[VPNGatewaysClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, gatewayName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VPNGatewaysClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[VPNGatewaysClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes a virtual wan vpn gateway. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VPNGatewaysClient) deleteOperation(ctx context.Context, resourceGroupName string, gatewayName string, options *VPNGatewaysClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, gatewayName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *VPNGatewaysClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, options *VPNGatewaysClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if gatewayName == "" { - return nil, errors.New("parameter gatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Retrieves the details of a virtual wan vpn gateway. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the VpnGateway. -// gatewayName - The name of the gateway. -// options - VPNGatewaysClientGetOptions contains the optional parameters for the VPNGatewaysClient.Get method. -func (client *VPNGatewaysClient) Get(ctx context.Context, resourceGroupName string, gatewayName string, options *VPNGatewaysClientGetOptions) (VPNGatewaysClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, gatewayName, options) - if err != nil { - return VPNGatewaysClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VPNGatewaysClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VPNGatewaysClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *VPNGatewaysClient) getCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, options *VPNGatewaysClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if gatewayName == "" { - return nil, errors.New("parameter gatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *VPNGatewaysClient) getHandleResponse(resp *http.Response) (VPNGatewaysClientGetResponse, error) { - result := VPNGatewaysClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VPNGateway); err != nil { - return VPNGatewaysClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Lists all the VpnGateways in a subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// options - VPNGatewaysClientListOptions contains the optional parameters for the VPNGatewaysClient.List method. -func (client *VPNGatewaysClient) NewListPager(options *VPNGatewaysClientListOptions) *runtime.Pager[VPNGatewaysClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[VPNGatewaysClientListResponse]{ - More: func(page VPNGatewaysClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VPNGatewaysClientListResponse) (VPNGatewaysClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return VPNGatewaysClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VPNGatewaysClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VPNGatewaysClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *VPNGatewaysClient) listCreateRequest(ctx context.Context, options *VPNGatewaysClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/vpnGateways" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *VPNGatewaysClient) listHandleResponse(resp *http.Response) (VPNGatewaysClientListResponse, error) { - result := VPNGatewaysClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ListVPNGatewaysResult); err != nil { - return VPNGatewaysClientListResponse{}, err - } - return result, nil -} - -// NewListByResourceGroupPager - Lists all the VpnGateways in a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the VpnGateway. -// options - VPNGatewaysClientListByResourceGroupOptions contains the optional parameters for the VPNGatewaysClient.ListByResourceGroup -// method. -func (client *VPNGatewaysClient) NewListByResourceGroupPager(resourceGroupName string, options *VPNGatewaysClientListByResourceGroupOptions) *runtime.Pager[VPNGatewaysClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[VPNGatewaysClientListByResourceGroupResponse]{ - More: func(page VPNGatewaysClientListByResourceGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VPNGatewaysClientListByResourceGroupResponse) (VPNGatewaysClientListByResourceGroupResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return VPNGatewaysClientListByResourceGroupResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VPNGatewaysClientListByResourceGroupResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VPNGatewaysClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) - } - return client.listByResourceGroupHandleResponse(resp) - }, - }) -} - -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *VPNGatewaysClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *VPNGatewaysClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *VPNGatewaysClient) listByResourceGroupHandleResponse(resp *http.Response) (VPNGatewaysClientListByResourceGroupResponse, error) { - result := VPNGatewaysClientListByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ListVPNGatewaysResult); err != nil { - return VPNGatewaysClientListByResourceGroupResponse{}, err - } - return result, nil -} - -// BeginReset - Resets the primary of the vpn gateway in the specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the VpnGateway. -// gatewayName - The name of the gateway. -// options - VPNGatewaysClientBeginResetOptions contains the optional parameters for the VPNGatewaysClient.BeginReset method. -func (client *VPNGatewaysClient) BeginReset(ctx context.Context, resourceGroupName string, gatewayName string, options *VPNGatewaysClientBeginResetOptions) (*runtime.Poller[VPNGatewaysClientResetResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.reset(ctx, resourceGroupName, gatewayName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VPNGatewaysClientResetResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[VPNGatewaysClientResetResponse](options.ResumeToken, client.pl, nil) - } -} - -// Reset - Resets the primary of the vpn gateway in the specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VPNGatewaysClient) reset(ctx context.Context, resourceGroupName string, gatewayName string, options *VPNGatewaysClientBeginResetOptions) (*http.Response, error) { - req, err := client.resetCreateRequest(ctx, resourceGroupName, gatewayName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// resetCreateRequest creates the Reset request. -func (client *VPNGatewaysClient) resetCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, options *VPNGatewaysClientBeginResetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/reset" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if gatewayName == "" { - return nil, errors.New("parameter gatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginStartPacketCapture - Starts packet capture on vpn gateway in the specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the VpnGateway. -// gatewayName - The name of the gateway. -// options - VPNGatewaysClientBeginStartPacketCaptureOptions contains the optional parameters for the VPNGatewaysClient.BeginStartPacketCapture -// method. -func (client *VPNGatewaysClient) BeginStartPacketCapture(ctx context.Context, resourceGroupName string, gatewayName string, options *VPNGatewaysClientBeginStartPacketCaptureOptions) (*runtime.Poller[VPNGatewaysClientStartPacketCaptureResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.startPacketCapture(ctx, resourceGroupName, gatewayName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VPNGatewaysClientStartPacketCaptureResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[VPNGatewaysClientStartPacketCaptureResponse](options.ResumeToken, client.pl, nil) - } -} - -// StartPacketCapture - Starts packet capture on vpn gateway in the specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VPNGatewaysClient) startPacketCapture(ctx context.Context, resourceGroupName string, gatewayName string, options *VPNGatewaysClientBeginStartPacketCaptureOptions) (*http.Response, error) { - req, err := client.startPacketCaptureCreateRequest(ctx, resourceGroupName, gatewayName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// startPacketCaptureCreateRequest creates the StartPacketCapture request. -func (client *VPNGatewaysClient) startPacketCaptureCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, options *VPNGatewaysClientBeginStartPacketCaptureOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/startpacketcapture" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if gatewayName == "" { - return nil, errors.New("parameter gatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.Parameters != nil { - return req, runtime.MarshalAsJSON(req, *options.Parameters) - } - return req, nil -} - -// BeginStopPacketCapture - Stops packet capture on vpn gateway in the specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the VpnGateway. -// gatewayName - The name of the gateway. -// options - VPNGatewaysClientBeginStopPacketCaptureOptions contains the optional parameters for the VPNGatewaysClient.BeginStopPacketCapture -// method. -func (client *VPNGatewaysClient) BeginStopPacketCapture(ctx context.Context, resourceGroupName string, gatewayName string, options *VPNGatewaysClientBeginStopPacketCaptureOptions) (*runtime.Poller[VPNGatewaysClientStopPacketCaptureResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.stopPacketCapture(ctx, resourceGroupName, gatewayName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VPNGatewaysClientStopPacketCaptureResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[VPNGatewaysClientStopPacketCaptureResponse](options.ResumeToken, client.pl, nil) - } -} - -// StopPacketCapture - Stops packet capture on vpn gateway in the specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VPNGatewaysClient) stopPacketCapture(ctx context.Context, resourceGroupName string, gatewayName string, options *VPNGatewaysClientBeginStopPacketCaptureOptions) (*http.Response, error) { - req, err := client.stopPacketCaptureCreateRequest(ctx, resourceGroupName, gatewayName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// stopPacketCaptureCreateRequest creates the StopPacketCapture request. -func (client *VPNGatewaysClient) stopPacketCaptureCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, options *VPNGatewaysClientBeginStopPacketCaptureOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/stoppacketcapture" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if gatewayName == "" { - return nil, errors.New("parameter gatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.Parameters != nil { - return req, runtime.MarshalAsJSON(req, *options.Parameters) - } - return req, nil -} - -// BeginUpdateTags - Updates virtual wan vpn gateway tags. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the VpnGateway. -// gatewayName - The name of the gateway. -// vpnGatewayParameters - Parameters supplied to update a virtual wan vpn gateway tags. -// options - VPNGatewaysClientBeginUpdateTagsOptions contains the optional parameters for the VPNGatewaysClient.BeginUpdateTags -// method. -func (client *VPNGatewaysClient) BeginUpdateTags(ctx context.Context, resourceGroupName string, gatewayName string, vpnGatewayParameters TagsObject, options *VPNGatewaysClientBeginUpdateTagsOptions) (*runtime.Poller[VPNGatewaysClientUpdateTagsResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.updateTags(ctx, resourceGroupName, gatewayName, vpnGatewayParameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VPNGatewaysClientUpdateTagsResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[VPNGatewaysClientUpdateTagsResponse](options.ResumeToken, client.pl, nil) - } -} - -// UpdateTags - Updates virtual wan vpn gateway tags. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VPNGatewaysClient) updateTags(ctx context.Context, resourceGroupName string, gatewayName string, vpnGatewayParameters TagsObject, options *VPNGatewaysClientBeginUpdateTagsOptions) (*http.Response, error) { - req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, gatewayName, vpnGatewayParameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// updateTagsCreateRequest creates the UpdateTags request. -func (client *VPNGatewaysClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, vpnGatewayParameters TagsObject, options *VPNGatewaysClientBeginUpdateTagsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if gatewayName == "" { - return nil, errors.New("parameter gatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, vpnGatewayParameters) -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/vpnlinkconnections_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/vpnlinkconnections_client.go deleted file mode 100644 index b1f0a90a..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/vpnlinkconnections_client.go +++ /dev/null @@ -1,282 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// VPNLinkConnectionsClient contains the methods for the VPNLinkConnections group. -// Don't use this type directly, use NewVPNLinkConnectionsClient() instead. -type VPNLinkConnectionsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewVPNLinkConnectionsClient creates a new instance of VPNLinkConnectionsClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewVPNLinkConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VPNLinkConnectionsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &VPNLinkConnectionsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginGetIkeSas - Lists IKE Security Associations for Vpn Site Link Connection in the specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// gatewayName - The name of the gateway. -// connectionName - The name of the vpn connection. -// linkConnectionName - The name of the vpn link connection. -// options - VPNLinkConnectionsClientBeginGetIkeSasOptions contains the optional parameters for the VPNLinkConnectionsClient.BeginGetIkeSas -// method. -func (client *VPNLinkConnectionsClient) BeginGetIkeSas(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, linkConnectionName string, options *VPNLinkConnectionsClientBeginGetIkeSasOptions) (*runtime.Poller[VPNLinkConnectionsClientGetIkeSasResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.getIkeSas(ctx, resourceGroupName, gatewayName, connectionName, linkConnectionName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VPNLinkConnectionsClientGetIkeSasResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[VPNLinkConnectionsClientGetIkeSasResponse](options.ResumeToken, client.pl, nil) - } -} - -// GetIkeSas - Lists IKE Security Associations for Vpn Site Link Connection in the specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VPNLinkConnectionsClient) getIkeSas(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, linkConnectionName string, options *VPNLinkConnectionsClientBeginGetIkeSasOptions) (*http.Response, error) { - req, err := client.getIkeSasCreateRequest(ctx, resourceGroupName, gatewayName, connectionName, linkConnectionName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// getIkeSasCreateRequest creates the GetIkeSas request. -func (client *VPNLinkConnectionsClient) getIkeSasCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, linkConnectionName string, options *VPNLinkConnectionsClientBeginGetIkeSasOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}/vpnLinkConnections/{linkConnectionName}/getikesas" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if gatewayName == "" { - return nil, errors.New("parameter gatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) - if connectionName == "" { - return nil, errors.New("parameter connectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) - if linkConnectionName == "" { - return nil, errors.New("parameter linkConnectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{linkConnectionName}", url.PathEscape(linkConnectionName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// NewListByVPNConnectionPager - Retrieves all vpn site link connections for a particular virtual wan vpn gateway vpn connection. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the vpn gateway. -// gatewayName - The name of the gateway. -// connectionName - The name of the vpn connection. -// options - VPNLinkConnectionsClientListByVPNConnectionOptions contains the optional parameters for the VPNLinkConnectionsClient.ListByVPNConnection -// method. -func (client *VPNLinkConnectionsClient) NewListByVPNConnectionPager(resourceGroupName string, gatewayName string, connectionName string, options *VPNLinkConnectionsClientListByVPNConnectionOptions) *runtime.Pager[VPNLinkConnectionsClientListByVPNConnectionResponse] { - return runtime.NewPager(runtime.PagingHandler[VPNLinkConnectionsClientListByVPNConnectionResponse]{ - More: func(page VPNLinkConnectionsClientListByVPNConnectionResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VPNLinkConnectionsClientListByVPNConnectionResponse) (VPNLinkConnectionsClientListByVPNConnectionResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByVPNConnectionCreateRequest(ctx, resourceGroupName, gatewayName, connectionName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return VPNLinkConnectionsClientListByVPNConnectionResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VPNLinkConnectionsClientListByVPNConnectionResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VPNLinkConnectionsClientListByVPNConnectionResponse{}, runtime.NewResponseError(resp) - } - return client.listByVPNConnectionHandleResponse(resp) - }, - }) -} - -// listByVPNConnectionCreateRequest creates the ListByVPNConnection request. -func (client *VPNLinkConnectionsClient) listByVPNConnectionCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, options *VPNLinkConnectionsClientListByVPNConnectionOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}/vpnLinkConnections" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if gatewayName == "" { - return nil, errors.New("parameter gatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) - if connectionName == "" { - return nil, errors.New("parameter connectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByVPNConnectionHandleResponse handles the ListByVPNConnection response. -func (client *VPNLinkConnectionsClient) listByVPNConnectionHandleResponse(resp *http.Response) (VPNLinkConnectionsClientListByVPNConnectionResponse, error) { - result := VPNLinkConnectionsClientListByVPNConnectionResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ListVPNSiteLinkConnectionsResult); err != nil { - return VPNLinkConnectionsClientListByVPNConnectionResponse{}, err - } - return result, nil -} - -// BeginResetConnection - Resets the VpnLink connection specified. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// gatewayName - The name of the gateway. -// connectionName - The name of the vpn connection. -// linkConnectionName - The name of the vpn link connection. -// options - VPNLinkConnectionsClientBeginResetConnectionOptions contains the optional parameters for the VPNLinkConnectionsClient.BeginResetConnection -// method. -func (client *VPNLinkConnectionsClient) BeginResetConnection(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, linkConnectionName string, options *VPNLinkConnectionsClientBeginResetConnectionOptions) (*runtime.Poller[VPNLinkConnectionsClientResetConnectionResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.resetConnection(ctx, resourceGroupName, gatewayName, connectionName, linkConnectionName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VPNLinkConnectionsClientResetConnectionResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[VPNLinkConnectionsClientResetConnectionResponse](options.ResumeToken, client.pl, nil) - } -} - -// ResetConnection - Resets the VpnLink connection specified. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VPNLinkConnectionsClient) resetConnection(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, linkConnectionName string, options *VPNLinkConnectionsClientBeginResetConnectionOptions) (*http.Response, error) { - req, err := client.resetConnectionCreateRequest(ctx, resourceGroupName, gatewayName, connectionName, linkConnectionName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// resetConnectionCreateRequest creates the ResetConnection request. -func (client *VPNLinkConnectionsClient) resetConnectionCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, linkConnectionName string, options *VPNLinkConnectionsClientBeginResetConnectionOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}/vpnLinkConnections/{linkConnectionName}/resetconnection" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if gatewayName == "" { - return nil, errors.New("parameter gatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) - if connectionName == "" { - return nil, errors.New("parameter connectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) - if linkConnectionName == "" { - return nil, errors.New("parameter linkConnectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{linkConnectionName}", url.PathEscape(linkConnectionName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/vpnserverconfigurations_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/vpnserverconfigurations_client.go deleted file mode 100644 index 56daac3d..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/vpnserverconfigurations_client.go +++ /dev/null @@ -1,428 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// VPNServerConfigurationsClient contains the methods for the VPNServerConfigurations group. -// Don't use this type directly, use NewVPNServerConfigurationsClient() instead. -type VPNServerConfigurationsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewVPNServerConfigurationsClient creates a new instance of VPNServerConfigurationsClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewVPNServerConfigurationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VPNServerConfigurationsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &VPNServerConfigurationsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates a VpnServerConfiguration resource if it doesn't exist else updates the existing VpnServerConfiguration. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the VpnServerConfiguration. -// vpnServerConfigurationName - The name of the VpnServerConfiguration being created or updated. -// vpnServerConfigurationParameters - Parameters supplied to create or update VpnServerConfiguration. -// options - VPNServerConfigurationsClientBeginCreateOrUpdateOptions contains the optional parameters for the VPNServerConfigurationsClient.BeginCreateOrUpdate -// method. -func (client *VPNServerConfigurationsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, vpnServerConfigurationParameters VPNServerConfiguration, options *VPNServerConfigurationsClientBeginCreateOrUpdateOptions) (*runtime.Poller[VPNServerConfigurationsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, vpnServerConfigurationName, vpnServerConfigurationParameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VPNServerConfigurationsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[VPNServerConfigurationsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates a VpnServerConfiguration resource if it doesn't exist else updates the existing VpnServerConfiguration. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VPNServerConfigurationsClient) createOrUpdate(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, vpnServerConfigurationParameters VPNServerConfiguration, options *VPNServerConfigurationsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, vpnServerConfigurationName, vpnServerConfigurationParameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *VPNServerConfigurationsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, vpnServerConfigurationParameters VPNServerConfiguration, options *VPNServerConfigurationsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vpnServerConfigurationName == "" { - return nil, errors.New("parameter vpnServerConfigurationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vpnServerConfigurationName}", url.PathEscape(vpnServerConfigurationName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, vpnServerConfigurationParameters) -} - -// BeginDelete - Deletes a VpnServerConfiguration. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the VpnServerConfiguration. -// vpnServerConfigurationName - The name of the VpnServerConfiguration being deleted. -// options - VPNServerConfigurationsClientBeginDeleteOptions contains the optional parameters for the VPNServerConfigurationsClient.BeginDelete -// method. -func (client *VPNServerConfigurationsClient) BeginDelete(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, options *VPNServerConfigurationsClientBeginDeleteOptions) (*runtime.Poller[VPNServerConfigurationsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, vpnServerConfigurationName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VPNServerConfigurationsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[VPNServerConfigurationsClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes a VpnServerConfiguration. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VPNServerConfigurationsClient) deleteOperation(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, options *VPNServerConfigurationsClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, vpnServerConfigurationName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *VPNServerConfigurationsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, options *VPNServerConfigurationsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vpnServerConfigurationName == "" { - return nil, errors.New("parameter vpnServerConfigurationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vpnServerConfigurationName}", url.PathEscape(vpnServerConfigurationName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Retrieves the details of a VpnServerConfiguration. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the VpnServerConfiguration. -// vpnServerConfigurationName - The name of the VpnServerConfiguration being retrieved. -// options - VPNServerConfigurationsClientGetOptions contains the optional parameters for the VPNServerConfigurationsClient.Get -// method. -func (client *VPNServerConfigurationsClient) Get(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, options *VPNServerConfigurationsClientGetOptions) (VPNServerConfigurationsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, vpnServerConfigurationName, options) - if err != nil { - return VPNServerConfigurationsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VPNServerConfigurationsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VPNServerConfigurationsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *VPNServerConfigurationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, options *VPNServerConfigurationsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vpnServerConfigurationName == "" { - return nil, errors.New("parameter vpnServerConfigurationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vpnServerConfigurationName}", url.PathEscape(vpnServerConfigurationName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *VPNServerConfigurationsClient) getHandleResponse(resp *http.Response) (VPNServerConfigurationsClientGetResponse, error) { - result := VPNServerConfigurationsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VPNServerConfiguration); err != nil { - return VPNServerConfigurationsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Lists all the VpnServerConfigurations in a subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// options - VPNServerConfigurationsClientListOptions contains the optional parameters for the VPNServerConfigurationsClient.List -// method. -func (client *VPNServerConfigurationsClient) NewListPager(options *VPNServerConfigurationsClientListOptions) *runtime.Pager[VPNServerConfigurationsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[VPNServerConfigurationsClientListResponse]{ - More: func(page VPNServerConfigurationsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VPNServerConfigurationsClientListResponse) (VPNServerConfigurationsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return VPNServerConfigurationsClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VPNServerConfigurationsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VPNServerConfigurationsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *VPNServerConfigurationsClient) listCreateRequest(ctx context.Context, options *VPNServerConfigurationsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/vpnServerConfigurations" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *VPNServerConfigurationsClient) listHandleResponse(resp *http.Response) (VPNServerConfigurationsClientListResponse, error) { - result := VPNServerConfigurationsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ListVPNServerConfigurationsResult); err != nil { - return VPNServerConfigurationsClientListResponse{}, err - } - return result, nil -} - -// NewListByResourceGroupPager - Lists all the vpnServerConfigurations in a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the VpnServerConfiguration. -// options - VPNServerConfigurationsClientListByResourceGroupOptions contains the optional parameters for the VPNServerConfigurationsClient.ListByResourceGroup -// method. -func (client *VPNServerConfigurationsClient) NewListByResourceGroupPager(resourceGroupName string, options *VPNServerConfigurationsClientListByResourceGroupOptions) *runtime.Pager[VPNServerConfigurationsClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[VPNServerConfigurationsClientListByResourceGroupResponse]{ - More: func(page VPNServerConfigurationsClientListByResourceGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VPNServerConfigurationsClientListByResourceGroupResponse) (VPNServerConfigurationsClientListByResourceGroupResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return VPNServerConfigurationsClientListByResourceGroupResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VPNServerConfigurationsClientListByResourceGroupResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VPNServerConfigurationsClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) - } - return client.listByResourceGroupHandleResponse(resp) - }, - }) -} - -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *VPNServerConfigurationsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *VPNServerConfigurationsClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *VPNServerConfigurationsClient) listByResourceGroupHandleResponse(resp *http.Response) (VPNServerConfigurationsClientListByResourceGroupResponse, error) { - result := VPNServerConfigurationsClientListByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ListVPNServerConfigurationsResult); err != nil { - return VPNServerConfigurationsClientListByResourceGroupResponse{}, err - } - return result, nil -} - -// UpdateTags - Updates VpnServerConfiguration tags. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the VpnServerConfiguration. -// vpnServerConfigurationName - The name of the VpnServerConfiguration being updated. -// vpnServerConfigurationParameters - Parameters supplied to update VpnServerConfiguration tags. -// options - VPNServerConfigurationsClientUpdateTagsOptions contains the optional parameters for the VPNServerConfigurationsClient.UpdateTags -// method. -func (client *VPNServerConfigurationsClient) UpdateTags(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, vpnServerConfigurationParameters TagsObject, options *VPNServerConfigurationsClientUpdateTagsOptions) (VPNServerConfigurationsClientUpdateTagsResponse, error) { - req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, vpnServerConfigurationName, vpnServerConfigurationParameters, options) - if err != nil { - return VPNServerConfigurationsClientUpdateTagsResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VPNServerConfigurationsClientUpdateTagsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VPNServerConfigurationsClientUpdateTagsResponse{}, runtime.NewResponseError(resp) - } - return client.updateTagsHandleResponse(resp) -} - -// updateTagsCreateRequest creates the UpdateTags request. -func (client *VPNServerConfigurationsClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, vpnServerConfigurationParameters TagsObject, options *VPNServerConfigurationsClientUpdateTagsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vpnServerConfigurationName == "" { - return nil, errors.New("parameter vpnServerConfigurationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vpnServerConfigurationName}", url.PathEscape(vpnServerConfigurationName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, vpnServerConfigurationParameters) -} - -// updateTagsHandleResponse handles the UpdateTags response. -func (client *VPNServerConfigurationsClient) updateTagsHandleResponse(resp *http.Response) (VPNServerConfigurationsClientUpdateTagsResponse, error) { - result := VPNServerConfigurationsClientUpdateTagsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VPNServerConfiguration); err != nil { - return VPNServerConfigurationsClientUpdateTagsResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/vpnserverconfigurationsassociatedwithvirtualwan_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/vpnserverconfigurationsassociatedwithvirtualwan_client.go deleted file mode 100644 index 6c05d6a4..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/vpnserverconfigurationsassociatedwithvirtualwan_client.go +++ /dev/null @@ -1,122 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// VPNServerConfigurationsAssociatedWithVirtualWanClient contains the methods for the VPNServerConfigurationsAssociatedWithVirtualWan group. -// Don't use this type directly, use NewVPNServerConfigurationsAssociatedWithVirtualWanClient() instead. -type VPNServerConfigurationsAssociatedWithVirtualWanClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewVPNServerConfigurationsAssociatedWithVirtualWanClient creates a new instance of VPNServerConfigurationsAssociatedWithVirtualWanClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewVPNServerConfigurationsAssociatedWithVirtualWanClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VPNServerConfigurationsAssociatedWithVirtualWanClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &VPNServerConfigurationsAssociatedWithVirtualWanClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginList - Gives the list of VpnServerConfigurations associated with Virtual Wan in a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name. -// virtualWANName - The name of the VirtualWAN whose associated VpnServerConfigurations is needed. -// options - VPNServerConfigurationsAssociatedWithVirtualWanClientBeginListOptions contains the optional parameters for the -// VPNServerConfigurationsAssociatedWithVirtualWanClient.BeginList method. -func (client *VPNServerConfigurationsAssociatedWithVirtualWanClient) BeginList(ctx context.Context, resourceGroupName string, virtualWANName string, options *VPNServerConfigurationsAssociatedWithVirtualWanClientBeginListOptions) (*runtime.Poller[VPNServerConfigurationsAssociatedWithVirtualWanClientListResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.listOperation(ctx, resourceGroupName, virtualWANName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VPNServerConfigurationsAssociatedWithVirtualWanClientListResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[VPNServerConfigurationsAssociatedWithVirtualWanClientListResponse](options.ResumeToken, client.pl, nil) - } -} - -// List - Gives the list of VpnServerConfigurations associated with Virtual Wan in a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VPNServerConfigurationsAssociatedWithVirtualWanClient) listOperation(ctx context.Context, resourceGroupName string, virtualWANName string, options *VPNServerConfigurationsAssociatedWithVirtualWanClientBeginListOptions) (*http.Response, error) { - req, err := client.listCreateRequest(ctx, resourceGroupName, virtualWANName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// listCreateRequest creates the List request. -func (client *VPNServerConfigurationsAssociatedWithVirtualWanClient) listCreateRequest(ctx context.Context, resourceGroupName string, virtualWANName string, options *VPNServerConfigurationsAssociatedWithVirtualWanClientBeginListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWANName}/vpnServerConfigurations" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualWANName == "" { - return nil, errors.New("parameter virtualWANName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualWANName}", url.PathEscape(virtualWANName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/vpnsitelinkconnections_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/vpnsitelinkconnections_client.go deleted file mode 100644 index 8d19bda4..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/vpnsitelinkconnections_client.go +++ /dev/null @@ -1,124 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// VPNSiteLinkConnectionsClient contains the methods for the VPNSiteLinkConnections group. -// Don't use this type directly, use NewVPNSiteLinkConnectionsClient() instead. -type VPNSiteLinkConnectionsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewVPNSiteLinkConnectionsClient creates a new instance of VPNSiteLinkConnectionsClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewVPNSiteLinkConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VPNSiteLinkConnectionsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &VPNSiteLinkConnectionsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// Get - Retrieves the details of a vpn site link connection. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the VpnGateway. -// gatewayName - The name of the gateway. -// connectionName - The name of the vpn connection. -// linkConnectionName - The name of the vpn connection. -// options - VPNSiteLinkConnectionsClientGetOptions contains the optional parameters for the VPNSiteLinkConnectionsClient.Get -// method. -func (client *VPNSiteLinkConnectionsClient) Get(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, linkConnectionName string, options *VPNSiteLinkConnectionsClientGetOptions) (VPNSiteLinkConnectionsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, gatewayName, connectionName, linkConnectionName, options) - if err != nil { - return VPNSiteLinkConnectionsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VPNSiteLinkConnectionsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VPNSiteLinkConnectionsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *VPNSiteLinkConnectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, linkConnectionName string, options *VPNSiteLinkConnectionsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}/vpnLinkConnections/{linkConnectionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if gatewayName == "" { - return nil, errors.New("parameter gatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) - if connectionName == "" { - return nil, errors.New("parameter connectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) - if linkConnectionName == "" { - return nil, errors.New("parameter linkConnectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{linkConnectionName}", url.PathEscape(linkConnectionName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *VPNSiteLinkConnectionsClient) getHandleResponse(resp *http.Response) (VPNSiteLinkConnectionsClientGetResponse, error) { - result := VPNSiteLinkConnectionsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VPNSiteLinkConnection); err != nil { - return VPNSiteLinkConnectionsClientGetResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/vpnsitelinks_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/vpnsitelinks_client.go deleted file mode 100644 index d6598e14..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/vpnsitelinks_client.go +++ /dev/null @@ -1,188 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// VPNSiteLinksClient contains the methods for the VPNSiteLinks group. -// Don't use this type directly, use NewVPNSiteLinksClient() instead. -type VPNSiteLinksClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewVPNSiteLinksClient creates a new instance of VPNSiteLinksClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewVPNSiteLinksClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VPNSiteLinksClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &VPNSiteLinksClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// Get - Retrieves the details of a VPN site link. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the VpnSite. -// vpnSiteName - The name of the VpnSite. -// vpnSiteLinkName - The name of the VpnSiteLink being retrieved. -// options - VPNSiteLinksClientGetOptions contains the optional parameters for the VPNSiteLinksClient.Get method. -func (client *VPNSiteLinksClient) Get(ctx context.Context, resourceGroupName string, vpnSiteName string, vpnSiteLinkName string, options *VPNSiteLinksClientGetOptions) (VPNSiteLinksClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, vpnSiteName, vpnSiteLinkName, options) - if err != nil { - return VPNSiteLinksClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VPNSiteLinksClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VPNSiteLinksClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *VPNSiteLinksClient) getCreateRequest(ctx context.Context, resourceGroupName string, vpnSiteName string, vpnSiteLinkName string, options *VPNSiteLinksClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}/vpnSiteLinks/{vpnSiteLinkName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vpnSiteName == "" { - return nil, errors.New("parameter vpnSiteName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vpnSiteName}", url.PathEscape(vpnSiteName)) - if vpnSiteLinkName == "" { - return nil, errors.New("parameter vpnSiteLinkName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vpnSiteLinkName}", url.PathEscape(vpnSiteLinkName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *VPNSiteLinksClient) getHandleResponse(resp *http.Response) (VPNSiteLinksClientGetResponse, error) { - result := VPNSiteLinksClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VPNSiteLink); err != nil { - return VPNSiteLinksClientGetResponse{}, err - } - return result, nil -} - -// NewListByVPNSitePager - Lists all the vpnSiteLinks in a resource group for a vpn site. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the VpnSite. -// vpnSiteName - The name of the VpnSite. -// options - VPNSiteLinksClientListByVPNSiteOptions contains the optional parameters for the VPNSiteLinksClient.ListByVPNSite -// method. -func (client *VPNSiteLinksClient) NewListByVPNSitePager(resourceGroupName string, vpnSiteName string, options *VPNSiteLinksClientListByVPNSiteOptions) *runtime.Pager[VPNSiteLinksClientListByVPNSiteResponse] { - return runtime.NewPager(runtime.PagingHandler[VPNSiteLinksClientListByVPNSiteResponse]{ - More: func(page VPNSiteLinksClientListByVPNSiteResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VPNSiteLinksClientListByVPNSiteResponse) (VPNSiteLinksClientListByVPNSiteResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByVPNSiteCreateRequest(ctx, resourceGroupName, vpnSiteName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return VPNSiteLinksClientListByVPNSiteResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VPNSiteLinksClientListByVPNSiteResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VPNSiteLinksClientListByVPNSiteResponse{}, runtime.NewResponseError(resp) - } - return client.listByVPNSiteHandleResponse(resp) - }, - }) -} - -// listByVPNSiteCreateRequest creates the ListByVPNSite request. -func (client *VPNSiteLinksClient) listByVPNSiteCreateRequest(ctx context.Context, resourceGroupName string, vpnSiteName string, options *VPNSiteLinksClientListByVPNSiteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}/vpnSiteLinks" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vpnSiteName == "" { - return nil, errors.New("parameter vpnSiteName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vpnSiteName}", url.PathEscape(vpnSiteName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByVPNSiteHandleResponse handles the ListByVPNSite response. -func (client *VPNSiteLinksClient) listByVPNSiteHandleResponse(resp *http.Response) (VPNSiteLinksClientListByVPNSiteResponse, error) { - result := VPNSiteLinksClientListByVPNSiteResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ListVPNSiteLinksResult); err != nil { - return VPNSiteLinksClientListByVPNSiteResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/vpnsites_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/vpnsites_client.go deleted file mode 100644 index daf1039b..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/vpnsites_client.go +++ /dev/null @@ -1,424 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// VPNSitesClient contains the methods for the VPNSites group. -// Don't use this type directly, use NewVPNSitesClient() instead. -type VPNSitesClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewVPNSitesClient creates a new instance of VPNSitesClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewVPNSitesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VPNSitesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &VPNSitesClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the VpnSite. -// vpnSiteName - The name of the VpnSite being created or updated. -// vpnSiteParameters - Parameters supplied to create or update VpnSite. -// options - VPNSitesClientBeginCreateOrUpdateOptions contains the optional parameters for the VPNSitesClient.BeginCreateOrUpdate -// method. -func (client *VPNSitesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, vpnSiteName string, vpnSiteParameters VPNSite, options *VPNSitesClientBeginCreateOrUpdateOptions) (*runtime.Poller[VPNSitesClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, vpnSiteName, vpnSiteParameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VPNSitesClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[VPNSitesClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VPNSitesClient) createOrUpdate(ctx context.Context, resourceGroupName string, vpnSiteName string, vpnSiteParameters VPNSite, options *VPNSitesClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, vpnSiteName, vpnSiteParameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *VPNSitesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, vpnSiteName string, vpnSiteParameters VPNSite, options *VPNSitesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vpnSiteName == "" { - return nil, errors.New("parameter vpnSiteName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vpnSiteName}", url.PathEscape(vpnSiteName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, vpnSiteParameters) -} - -// BeginDelete - Deletes a VpnSite. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the VpnSite. -// vpnSiteName - The name of the VpnSite being deleted. -// options - VPNSitesClientBeginDeleteOptions contains the optional parameters for the VPNSitesClient.BeginDelete method. -func (client *VPNSitesClient) BeginDelete(ctx context.Context, resourceGroupName string, vpnSiteName string, options *VPNSitesClientBeginDeleteOptions) (*runtime.Poller[VPNSitesClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, vpnSiteName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VPNSitesClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[VPNSitesClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes a VpnSite. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VPNSitesClient) deleteOperation(ctx context.Context, resourceGroupName string, vpnSiteName string, options *VPNSitesClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, vpnSiteName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *VPNSitesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, vpnSiteName string, options *VPNSitesClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vpnSiteName == "" { - return nil, errors.New("parameter vpnSiteName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vpnSiteName}", url.PathEscape(vpnSiteName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Retrieves the details of a VPN site. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the VpnSite. -// vpnSiteName - The name of the VpnSite being retrieved. -// options - VPNSitesClientGetOptions contains the optional parameters for the VPNSitesClient.Get method. -func (client *VPNSitesClient) Get(ctx context.Context, resourceGroupName string, vpnSiteName string, options *VPNSitesClientGetOptions) (VPNSitesClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, vpnSiteName, options) - if err != nil { - return VPNSitesClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VPNSitesClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VPNSitesClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *VPNSitesClient) getCreateRequest(ctx context.Context, resourceGroupName string, vpnSiteName string, options *VPNSitesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vpnSiteName == "" { - return nil, errors.New("parameter vpnSiteName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vpnSiteName}", url.PathEscape(vpnSiteName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *VPNSitesClient) getHandleResponse(resp *http.Response) (VPNSitesClientGetResponse, error) { - result := VPNSitesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VPNSite); err != nil { - return VPNSitesClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Lists all the VpnSites in a subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// options - VPNSitesClientListOptions contains the optional parameters for the VPNSitesClient.List method. -func (client *VPNSitesClient) NewListPager(options *VPNSitesClientListOptions) *runtime.Pager[VPNSitesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[VPNSitesClientListResponse]{ - More: func(page VPNSitesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VPNSitesClientListResponse) (VPNSitesClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return VPNSitesClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VPNSitesClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VPNSitesClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *VPNSitesClient) listCreateRequest(ctx context.Context, options *VPNSitesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/vpnSites" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *VPNSitesClient) listHandleResponse(resp *http.Response) (VPNSitesClientListResponse, error) { - result := VPNSitesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ListVPNSitesResult); err != nil { - return VPNSitesClientListResponse{}, err - } - return result, nil -} - -// NewListByResourceGroupPager - Lists all the vpnSites in a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the VpnSite. -// options - VPNSitesClientListByResourceGroupOptions contains the optional parameters for the VPNSitesClient.ListByResourceGroup -// method. -func (client *VPNSitesClient) NewListByResourceGroupPager(resourceGroupName string, options *VPNSitesClientListByResourceGroupOptions) *runtime.Pager[VPNSitesClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[VPNSitesClientListByResourceGroupResponse]{ - More: func(page VPNSitesClientListByResourceGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VPNSitesClientListByResourceGroupResponse) (VPNSitesClientListByResourceGroupResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return VPNSitesClientListByResourceGroupResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VPNSitesClientListByResourceGroupResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VPNSitesClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) - } - return client.listByResourceGroupHandleResponse(resp) - }, - }) -} - -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *VPNSitesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *VPNSitesClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *VPNSitesClient) listByResourceGroupHandleResponse(resp *http.Response) (VPNSitesClientListByResourceGroupResponse, error) { - result := VPNSitesClientListByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ListVPNSitesResult); err != nil { - return VPNSitesClientListByResourceGroupResponse{}, err - } - return result, nil -} - -// UpdateTags - Updates VpnSite tags. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name of the VpnSite. -// vpnSiteName - The name of the VpnSite being updated. -// vpnSiteParameters - Parameters supplied to update VpnSite tags. -// options - VPNSitesClientUpdateTagsOptions contains the optional parameters for the VPNSitesClient.UpdateTags method. -func (client *VPNSitesClient) UpdateTags(ctx context.Context, resourceGroupName string, vpnSiteName string, vpnSiteParameters TagsObject, options *VPNSitesClientUpdateTagsOptions) (VPNSitesClientUpdateTagsResponse, error) { - req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, vpnSiteName, vpnSiteParameters, options) - if err != nil { - return VPNSitesClientUpdateTagsResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VPNSitesClientUpdateTagsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VPNSitesClientUpdateTagsResponse{}, runtime.NewResponseError(resp) - } - return client.updateTagsHandleResponse(resp) -} - -// updateTagsCreateRequest creates the UpdateTags request. -func (client *VPNSitesClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, vpnSiteName string, vpnSiteParameters TagsObject, options *VPNSitesClientUpdateTagsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vpnSiteName == "" { - return nil, errors.New("parameter vpnSiteName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vpnSiteName}", url.PathEscape(vpnSiteName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, vpnSiteParameters) -} - -// updateTagsHandleResponse handles the UpdateTags response. -func (client *VPNSitesClient) updateTagsHandleResponse(resp *http.Response) (VPNSitesClientUpdateTagsResponse, error) { - result := VPNSitesClientUpdateTagsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VPNSite); err != nil { - return VPNSitesClientUpdateTagsResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/vpnsitesconfiguration_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/vpnsitesconfiguration_client.go deleted file mode 100644 index c8e233a5..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/vpnsitesconfiguration_client.go +++ /dev/null @@ -1,123 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// VPNSitesConfigurationClient contains the methods for the VPNSitesConfiguration group. -// Don't use this type directly, use NewVPNSitesConfigurationClient() instead. -type VPNSitesConfigurationClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewVPNSitesConfigurationClient creates a new instance of VPNSitesConfigurationClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewVPNSitesConfigurationClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VPNSitesConfigurationClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &VPNSitesConfigurationClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginDownload - Gives the sas-url to download the configurations for vpn-sites in a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The resource group name. -// virtualWANName - The name of the VirtualWAN for which configuration of all vpn-sites is needed. -// request - Parameters supplied to download vpn-sites configuration. -// options - VPNSitesConfigurationClientBeginDownloadOptions contains the optional parameters for the VPNSitesConfigurationClient.BeginDownload -// method. -func (client *VPNSitesConfigurationClient) BeginDownload(ctx context.Context, resourceGroupName string, virtualWANName string, request GetVPNSitesConfigurationRequest, options *VPNSitesConfigurationClientBeginDownloadOptions) (*runtime.Poller[VPNSitesConfigurationClientDownloadResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.download(ctx, resourceGroupName, virtualWANName, request, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VPNSitesConfigurationClientDownloadResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[VPNSitesConfigurationClientDownloadResponse](options.ResumeToken, client.pl, nil) - } -} - -// Download - Gives the sas-url to download the configurations for vpn-sites in a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *VPNSitesConfigurationClient) download(ctx context.Context, resourceGroupName string, virtualWANName string, request GetVPNSitesConfigurationRequest, options *VPNSitesConfigurationClientBeginDownloadOptions) (*http.Response, error) { - req, err := client.downloadCreateRequest(ctx, resourceGroupName, virtualWANName, request, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// downloadCreateRequest creates the Download request. -func (client *VPNSitesConfigurationClient) downloadCreateRequest(ctx context.Context, resourceGroupName string, virtualWANName string, request GetVPNSitesConfigurationRequest, options *VPNSitesConfigurationClientBeginDownloadOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWANName}/vpnConfiguration" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualWANName == "" { - return nil, errors.New("parameter virtualWANName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualWANName}", url.PathEscape(virtualWANName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, request) -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/watchers_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/watchers_client.go deleted file mode 100644 index 0aaaa605..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/watchers_client.go +++ /dev/null @@ -1,1199 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// WatchersClient contains the methods for the NetworkWatchers group. -// Don't use this type directly, use NewWatchersClient() instead. -type WatchersClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewWatchersClient creates a new instance of WatchersClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewWatchersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*WatchersClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &WatchersClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCheckConnectivity - 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. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the network watcher resource group. -// networkWatcherName - The name of the network watcher resource. -// parameters - Parameters that determine how the connectivity check will be performed. -// options - WatchersClientBeginCheckConnectivityOptions contains the optional parameters for the WatchersClient.BeginCheckConnectivity -// method. -func (client *WatchersClient) BeginCheckConnectivity(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters ConnectivityParameters, options *WatchersClientBeginCheckConnectivityOptions) (*runtime.Poller[WatchersClientCheckConnectivityResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.checkConnectivity(ctx, resourceGroupName, networkWatcherName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[WatchersClientCheckConnectivityResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[WatchersClientCheckConnectivityResponse](options.ResumeToken, client.pl, nil) - } -} - -// 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. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *WatchersClient) checkConnectivity(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters ConnectivityParameters, options *WatchersClientBeginCheckConnectivityOptions) (*http.Response, error) { - req, err := client.checkConnectivityCreateRequest(ctx, resourceGroupName, networkWatcherName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// checkConnectivityCreateRequest creates the CheckConnectivity request. -func (client *WatchersClient) checkConnectivityCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters ConnectivityParameters, options *WatchersClientBeginCheckConnectivityOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectivityCheck" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkWatcherName == "" { - return nil, errors.New("parameter networkWatcherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// CreateOrUpdate - Creates or updates a network watcher in the specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkWatcherName - The name of the network watcher. -// parameters - Parameters that define the network watcher resource. -// options - WatchersClientCreateOrUpdateOptions contains the optional parameters for the WatchersClient.CreateOrUpdate method. -func (client *WatchersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters Watcher, options *WatchersClientCreateOrUpdateOptions) (WatchersClientCreateOrUpdateResponse, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, networkWatcherName, parameters, options) - if err != nil { - return WatchersClientCreateOrUpdateResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return WatchersClientCreateOrUpdateResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return WatchersClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) - } - return client.createOrUpdateHandleResponse(resp) -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *WatchersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters Watcher, options *WatchersClientCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkWatcherName == "" { - return nil, errors.New("parameter networkWatcherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// createOrUpdateHandleResponse handles the CreateOrUpdate response. -func (client *WatchersClient) createOrUpdateHandleResponse(resp *http.Response) (WatchersClientCreateOrUpdateResponse, error) { - result := WatchersClientCreateOrUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.Watcher); err != nil { - return WatchersClientCreateOrUpdateResponse{}, err - } - return result, nil -} - -// BeginDelete - Deletes the specified network watcher resource. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkWatcherName - The name of the network watcher. -// options - WatchersClientBeginDeleteOptions contains the optional parameters for the WatchersClient.BeginDelete method. -func (client *WatchersClient) BeginDelete(ctx context.Context, resourceGroupName string, networkWatcherName string, options *WatchersClientBeginDeleteOptions) (*runtime.Poller[WatchersClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, networkWatcherName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[WatchersClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[WatchersClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes the specified network watcher resource. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *WatchersClient) deleteOperation(ctx context.Context, resourceGroupName string, networkWatcherName string, options *WatchersClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, networkWatcherName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *WatchersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, options *WatchersClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkWatcherName == "" { - return nil, errors.New("parameter networkWatcherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets the specified network watcher by resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkWatcherName - The name of the network watcher. -// options - WatchersClientGetOptions contains the optional parameters for the WatchersClient.Get method. -func (client *WatchersClient) Get(ctx context.Context, resourceGroupName string, networkWatcherName string, options *WatchersClientGetOptions) (WatchersClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, networkWatcherName, options) - if err != nil { - return WatchersClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return WatchersClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return WatchersClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *WatchersClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, options *WatchersClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkWatcherName == "" { - return nil, errors.New("parameter networkWatcherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *WatchersClient) getHandleResponse(resp *http.Response) (WatchersClientGetResponse, error) { - result := WatchersClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.Watcher); err != nil { - return WatchersClientGetResponse{}, err - } - return result, nil -} - -// BeginGetAzureReachabilityReport - NOTE: This feature is currently in preview and still being tested for stability. Gets -// the relative latency score for internet service providers from a specified location to Azure regions. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the network watcher resource group. -// networkWatcherName - The name of the network watcher resource. -// parameters - Parameters that determine Azure reachability report configuration. -// options - WatchersClientBeginGetAzureReachabilityReportOptions contains the optional parameters for the WatchersClient.BeginGetAzureReachabilityReport -// method. -func (client *WatchersClient) BeginGetAzureReachabilityReport(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters AzureReachabilityReportParameters, options *WatchersClientBeginGetAzureReachabilityReportOptions) (*runtime.Poller[WatchersClientGetAzureReachabilityReportResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.getAzureReachabilityReport(ctx, resourceGroupName, networkWatcherName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[WatchersClientGetAzureReachabilityReportResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[WatchersClientGetAzureReachabilityReportResponse](options.ResumeToken, client.pl, nil) - } -} - -// GetAzureReachabilityReport - NOTE: This feature is currently in preview and still being tested for stability. Gets the -// relative latency score for internet service providers from a specified location to Azure regions. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *WatchersClient) getAzureReachabilityReport(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters AzureReachabilityReportParameters, options *WatchersClientBeginGetAzureReachabilityReportOptions) (*http.Response, error) { - req, err := client.getAzureReachabilityReportCreateRequest(ctx, resourceGroupName, networkWatcherName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// getAzureReachabilityReportCreateRequest creates the GetAzureReachabilityReport request. -func (client *WatchersClient) getAzureReachabilityReportCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters AzureReachabilityReportParameters, options *WatchersClientBeginGetAzureReachabilityReportOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/azureReachabilityReport" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkWatcherName == "" { - return nil, errors.New("parameter networkWatcherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginGetFlowLogStatus - Queries status of flow log and traffic analytics (optional) on a specified resource. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the network watcher resource group. -// networkWatcherName - The name of the network watcher resource. -// parameters - Parameters that define a resource to query flow log and traffic analytics (optional) status. -// options - WatchersClientBeginGetFlowLogStatusOptions contains the optional parameters for the WatchersClient.BeginGetFlowLogStatus -// method. -func (client *WatchersClient) BeginGetFlowLogStatus(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters FlowLogStatusParameters, options *WatchersClientBeginGetFlowLogStatusOptions) (*runtime.Poller[WatchersClientGetFlowLogStatusResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.getFlowLogStatus(ctx, resourceGroupName, networkWatcherName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[WatchersClientGetFlowLogStatusResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[WatchersClientGetFlowLogStatusResponse](options.ResumeToken, client.pl, nil) - } -} - -// GetFlowLogStatus - Queries status of flow log and traffic analytics (optional) on a specified resource. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *WatchersClient) getFlowLogStatus(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters FlowLogStatusParameters, options *WatchersClientBeginGetFlowLogStatusOptions) (*http.Response, error) { - req, err := client.getFlowLogStatusCreateRequest(ctx, resourceGroupName, networkWatcherName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// getFlowLogStatusCreateRequest creates the GetFlowLogStatus request. -func (client *WatchersClient) getFlowLogStatusCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters FlowLogStatusParameters, options *WatchersClientBeginGetFlowLogStatusOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryFlowLogStatus" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkWatcherName == "" { - return nil, errors.New("parameter networkWatcherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginGetNetworkConfigurationDiagnostic - Gets Network Configuration Diagnostic data to help customers understand and debug -// network behavior. It provides detailed information on what security rules were applied to a specified traffic flow and -// the result of evaluating these rules. Customers must provide details of a flow like source, destination, protocol, etc. -// The API returns whether traffic was allowed or denied, the rules evaluated for -// the specified flow and the evaluation results. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkWatcherName - The name of the network watcher. -// parameters - Parameters to get network configuration diagnostic. -// options - WatchersClientBeginGetNetworkConfigurationDiagnosticOptions contains the optional parameters for the WatchersClient.BeginGetNetworkConfigurationDiagnostic -// method. -func (client *WatchersClient) BeginGetNetworkConfigurationDiagnostic(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters ConfigurationDiagnosticParameters, options *WatchersClientBeginGetNetworkConfigurationDiagnosticOptions) (*runtime.Poller[WatchersClientGetNetworkConfigurationDiagnosticResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.getNetworkConfigurationDiagnostic(ctx, resourceGroupName, networkWatcherName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[WatchersClientGetNetworkConfigurationDiagnosticResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[WatchersClientGetNetworkConfigurationDiagnosticResponse](options.ResumeToken, client.pl, nil) - } -} - -// GetNetworkConfigurationDiagnostic - Gets Network Configuration Diagnostic data to help customers understand and debug network -// behavior. It provides detailed information on what security rules were applied to a specified traffic flow and -// the result of evaluating these rules. Customers must provide details of a flow like source, destination, protocol, etc. -// The API returns whether traffic was allowed or denied, the rules evaluated for -// the specified flow and the evaluation results. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *WatchersClient) getNetworkConfigurationDiagnostic(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters ConfigurationDiagnosticParameters, options *WatchersClientBeginGetNetworkConfigurationDiagnosticOptions) (*http.Response, error) { - req, err := client.getNetworkConfigurationDiagnosticCreateRequest(ctx, resourceGroupName, networkWatcherName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// getNetworkConfigurationDiagnosticCreateRequest creates the GetNetworkConfigurationDiagnostic request. -func (client *WatchersClient) getNetworkConfigurationDiagnosticCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters ConfigurationDiagnosticParameters, options *WatchersClientBeginGetNetworkConfigurationDiagnosticOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/networkConfigurationDiagnostic" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkWatcherName == "" { - return nil, errors.New("parameter networkWatcherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginGetNextHop - Gets the next hop from the specified VM. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkWatcherName - The name of the network watcher. -// parameters - Parameters that define the source and destination endpoint. -// options - WatchersClientBeginGetNextHopOptions contains the optional parameters for the WatchersClient.BeginGetNextHop -// method. -func (client *WatchersClient) BeginGetNextHop(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters NextHopParameters, options *WatchersClientBeginGetNextHopOptions) (*runtime.Poller[WatchersClientGetNextHopResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.getNextHop(ctx, resourceGroupName, networkWatcherName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[WatchersClientGetNextHopResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[WatchersClientGetNextHopResponse](options.ResumeToken, client.pl, nil) - } -} - -// GetNextHop - Gets the next hop from the specified VM. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *WatchersClient) getNextHop(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters NextHopParameters, options *WatchersClientBeginGetNextHopOptions) (*http.Response, error) { - req, err := client.getNextHopCreateRequest(ctx, resourceGroupName, networkWatcherName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// getNextHopCreateRequest creates the GetNextHop request. -func (client *WatchersClient) getNextHopCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters NextHopParameters, options *WatchersClientBeginGetNextHopOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/nextHop" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkWatcherName == "" { - return nil, errors.New("parameter networkWatcherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// GetTopology - Gets the current network topology by resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkWatcherName - The name of the network watcher. -// parameters - Parameters that define the representation of topology. -// options - WatchersClientGetTopologyOptions contains the optional parameters for the WatchersClient.GetTopology method. -func (client *WatchersClient) GetTopology(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters TopologyParameters, options *WatchersClientGetTopologyOptions) (WatchersClientGetTopologyResponse, error) { - req, err := client.getTopologyCreateRequest(ctx, resourceGroupName, networkWatcherName, parameters, options) - if err != nil { - return WatchersClientGetTopologyResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return WatchersClientGetTopologyResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return WatchersClientGetTopologyResponse{}, runtime.NewResponseError(resp) - } - return client.getTopologyHandleResponse(resp) -} - -// getTopologyCreateRequest creates the GetTopology request. -func (client *WatchersClient) getTopologyCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters TopologyParameters, options *WatchersClientGetTopologyOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/topology" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkWatcherName == "" { - return nil, errors.New("parameter networkWatcherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// getTopologyHandleResponse handles the GetTopology response. -func (client *WatchersClient) getTopologyHandleResponse(resp *http.Response) (WatchersClientGetTopologyResponse, error) { - result := WatchersClientGetTopologyResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.Topology); err != nil { - return WatchersClientGetTopologyResponse{}, err - } - return result, nil -} - -// BeginGetTroubleshooting - Initiate troubleshooting on a specified resource. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkWatcherName - The name of the network watcher resource. -// parameters - Parameters that define the resource to troubleshoot. -// options - WatchersClientBeginGetTroubleshootingOptions contains the optional parameters for the WatchersClient.BeginGetTroubleshooting -// method. -func (client *WatchersClient) BeginGetTroubleshooting(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters TroubleshootingParameters, options *WatchersClientBeginGetTroubleshootingOptions) (*runtime.Poller[WatchersClientGetTroubleshootingResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.getTroubleshooting(ctx, resourceGroupName, networkWatcherName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[WatchersClientGetTroubleshootingResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[WatchersClientGetTroubleshootingResponse](options.ResumeToken, client.pl, nil) - } -} - -// GetTroubleshooting - Initiate troubleshooting on a specified resource. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *WatchersClient) getTroubleshooting(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters TroubleshootingParameters, options *WatchersClientBeginGetTroubleshootingOptions) (*http.Response, error) { - req, err := client.getTroubleshootingCreateRequest(ctx, resourceGroupName, networkWatcherName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// getTroubleshootingCreateRequest creates the GetTroubleshooting request. -func (client *WatchersClient) getTroubleshootingCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters TroubleshootingParameters, options *WatchersClientBeginGetTroubleshootingOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/troubleshoot" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkWatcherName == "" { - return nil, errors.New("parameter networkWatcherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginGetTroubleshootingResult - Get the last completed troubleshooting result on a specified resource. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkWatcherName - The name of the network watcher resource. -// parameters - Parameters that define the resource to query the troubleshooting result. -// options - WatchersClientBeginGetTroubleshootingResultOptions contains the optional parameters for the WatchersClient.BeginGetTroubleshootingResult -// method. -func (client *WatchersClient) BeginGetTroubleshootingResult(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters QueryTroubleshootingParameters, options *WatchersClientBeginGetTroubleshootingResultOptions) (*runtime.Poller[WatchersClientGetTroubleshootingResultResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.getTroubleshootingResult(ctx, resourceGroupName, networkWatcherName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[WatchersClientGetTroubleshootingResultResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[WatchersClientGetTroubleshootingResultResponse](options.ResumeToken, client.pl, nil) - } -} - -// GetTroubleshootingResult - Get the last completed troubleshooting result on a specified resource. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *WatchersClient) getTroubleshootingResult(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters QueryTroubleshootingParameters, options *WatchersClientBeginGetTroubleshootingResultOptions) (*http.Response, error) { - req, err := client.getTroubleshootingResultCreateRequest(ctx, resourceGroupName, networkWatcherName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// getTroubleshootingResultCreateRequest creates the GetTroubleshootingResult request. -func (client *WatchersClient) getTroubleshootingResultCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters QueryTroubleshootingParameters, options *WatchersClientBeginGetTroubleshootingResultOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryTroubleshootResult" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkWatcherName == "" { - return nil, errors.New("parameter networkWatcherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginGetVMSecurityRules - Gets the configured and effective security group rules on the specified VM. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkWatcherName - The name of the network watcher. -// parameters - Parameters that define the VM to check security groups for. -// options - WatchersClientBeginGetVMSecurityRulesOptions contains the optional parameters for the WatchersClient.BeginGetVMSecurityRules -// method. -func (client *WatchersClient) BeginGetVMSecurityRules(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters SecurityGroupViewParameters, options *WatchersClientBeginGetVMSecurityRulesOptions) (*runtime.Poller[WatchersClientGetVMSecurityRulesResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.getVMSecurityRules(ctx, resourceGroupName, networkWatcherName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[WatchersClientGetVMSecurityRulesResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[WatchersClientGetVMSecurityRulesResponse](options.ResumeToken, client.pl, nil) - } -} - -// GetVMSecurityRules - Gets the configured and effective security group rules on the specified VM. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *WatchersClient) getVMSecurityRules(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters SecurityGroupViewParameters, options *WatchersClientBeginGetVMSecurityRulesOptions) (*http.Response, error) { - req, err := client.getVMSecurityRulesCreateRequest(ctx, resourceGroupName, networkWatcherName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// getVMSecurityRulesCreateRequest creates the GetVMSecurityRules request. -func (client *WatchersClient) getVMSecurityRulesCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters SecurityGroupViewParameters, options *WatchersClientBeginGetVMSecurityRulesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/securityGroupView" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkWatcherName == "" { - return nil, errors.New("parameter networkWatcherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// NewListPager - Gets all network watchers by resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// options - WatchersClientListOptions contains the optional parameters for the WatchersClient.List method. -func (client *WatchersClient) NewListPager(resourceGroupName string, options *WatchersClientListOptions) *runtime.Pager[WatchersClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[WatchersClientListResponse]{ - More: func(page WatchersClientListResponse) bool { - return false - }, - Fetcher: func(ctx context.Context, page *WatchersClientListResponse) (WatchersClientListResponse, error) { - req, err := client.listCreateRequest(ctx, resourceGroupName, options) - if err != nil { - return WatchersClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return WatchersClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return WatchersClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *WatchersClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *WatchersClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *WatchersClient) listHandleResponse(resp *http.Response) (WatchersClientListResponse, error) { - result := WatchersClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.WatcherListResult); err != nil { - return WatchersClientListResponse{}, err - } - return result, nil -} - -// NewListAllPager - Gets all network watchers by subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// options - WatchersClientListAllOptions contains the optional parameters for the WatchersClient.ListAll method. -func (client *WatchersClient) NewListAllPager(options *WatchersClientListAllOptions) *runtime.Pager[WatchersClientListAllResponse] { - return runtime.NewPager(runtime.PagingHandler[WatchersClientListAllResponse]{ - More: func(page WatchersClientListAllResponse) bool { - return false - }, - Fetcher: func(ctx context.Context, page *WatchersClientListAllResponse) (WatchersClientListAllResponse, error) { - req, err := client.listAllCreateRequest(ctx, options) - if err != nil { - return WatchersClientListAllResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return WatchersClientListAllResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return WatchersClientListAllResponse{}, runtime.NewResponseError(resp) - } - return client.listAllHandleResponse(resp) - }, - }) -} - -// listAllCreateRequest creates the ListAll request. -func (client *WatchersClient) listAllCreateRequest(ctx context.Context, options *WatchersClientListAllOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkWatchers" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listAllHandleResponse handles the ListAll response. -func (client *WatchersClient) listAllHandleResponse(resp *http.Response) (WatchersClientListAllResponse, error) { - result := WatchersClientListAllResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.WatcherListResult); err != nil { - return WatchersClientListAllResponse{}, err - } - return result, nil -} - -// BeginListAvailableProviders - NOTE: This feature is currently in preview and still being tested for stability. Lists all -// available internet service providers for a specified Azure region. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the network watcher resource group. -// networkWatcherName - The name of the network watcher resource. -// parameters - Parameters that scope the list of available providers. -// options - WatchersClientBeginListAvailableProvidersOptions contains the optional parameters for the WatchersClient.BeginListAvailableProviders -// method. -func (client *WatchersClient) BeginListAvailableProviders(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters AvailableProvidersListParameters, options *WatchersClientBeginListAvailableProvidersOptions) (*runtime.Poller[WatchersClientListAvailableProvidersResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.listAvailableProviders(ctx, resourceGroupName, networkWatcherName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[WatchersClientListAvailableProvidersResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[WatchersClientListAvailableProvidersResponse](options.ResumeToken, client.pl, nil) - } -} - -// ListAvailableProviders - NOTE: This feature is currently in preview and still being tested for stability. Lists all available -// internet service providers for a specified Azure region. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *WatchersClient) listAvailableProviders(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters AvailableProvidersListParameters, options *WatchersClientBeginListAvailableProvidersOptions) (*http.Response, error) { - req, err := client.listAvailableProvidersCreateRequest(ctx, resourceGroupName, networkWatcherName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// listAvailableProvidersCreateRequest creates the ListAvailableProviders request. -func (client *WatchersClient) listAvailableProvidersCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters AvailableProvidersListParameters, options *WatchersClientBeginListAvailableProvidersOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/availableProvidersList" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkWatcherName == "" { - return nil, errors.New("parameter networkWatcherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginSetFlowLogConfiguration - Configures flow log and traffic analytics (optional) on a specified resource. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the network watcher resource group. -// networkWatcherName - The name of the network watcher resource. -// parameters - Parameters that define the configuration of flow log. -// options - WatchersClientBeginSetFlowLogConfigurationOptions contains the optional parameters for the WatchersClient.BeginSetFlowLogConfiguration -// method. -func (client *WatchersClient) BeginSetFlowLogConfiguration(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters FlowLogInformation, options *WatchersClientBeginSetFlowLogConfigurationOptions) (*runtime.Poller[WatchersClientSetFlowLogConfigurationResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.setFlowLogConfiguration(ctx, resourceGroupName, networkWatcherName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[WatchersClientSetFlowLogConfigurationResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[WatchersClientSetFlowLogConfigurationResponse](options.ResumeToken, client.pl, nil) - } -} - -// SetFlowLogConfiguration - Configures flow log and traffic analytics (optional) on a specified resource. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *WatchersClient) setFlowLogConfiguration(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters FlowLogInformation, options *WatchersClientBeginSetFlowLogConfigurationOptions) (*http.Response, error) { - req, err := client.setFlowLogConfigurationCreateRequest(ctx, resourceGroupName, networkWatcherName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// setFlowLogConfigurationCreateRequest creates the SetFlowLogConfiguration request. -func (client *WatchersClient) setFlowLogConfigurationCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters FlowLogInformation, options *WatchersClientBeginSetFlowLogConfigurationOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/configureFlowLog" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkWatcherName == "" { - return nil, errors.New("parameter networkWatcherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// UpdateTags - Updates a network watcher tags. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkWatcherName - The name of the network watcher. -// parameters - Parameters supplied to update network watcher tags. -// options - WatchersClientUpdateTagsOptions contains the optional parameters for the WatchersClient.UpdateTags method. -func (client *WatchersClient) UpdateTags(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters TagsObject, options *WatchersClientUpdateTagsOptions) (WatchersClientUpdateTagsResponse, error) { - req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, networkWatcherName, parameters, options) - if err != nil { - return WatchersClientUpdateTagsResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return WatchersClientUpdateTagsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return WatchersClientUpdateTagsResponse{}, runtime.NewResponseError(resp) - } - return client.updateTagsHandleResponse(resp) -} - -// updateTagsCreateRequest creates the UpdateTags request. -func (client *WatchersClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters TagsObject, options *WatchersClientUpdateTagsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkWatcherName == "" { - return nil, errors.New("parameter networkWatcherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// updateTagsHandleResponse handles the UpdateTags response. -func (client *WatchersClient) updateTagsHandleResponse(resp *http.Response) (WatchersClientUpdateTagsResponse, error) { - result := WatchersClientUpdateTagsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.Watcher); err != nil { - return WatchersClientUpdateTagsResponse{}, err - } - return result, nil -} - -// BeginVerifyIPFlow - Verify IP flow from the specified VM to a location given the currently configured NSG rules. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// networkWatcherName - The name of the network watcher. -// parameters - Parameters that define the IP flow to be verified. -// options - WatchersClientBeginVerifyIPFlowOptions contains the optional parameters for the WatchersClient.BeginVerifyIPFlow -// method. -func (client *WatchersClient) BeginVerifyIPFlow(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters VerificationIPFlowParameters, options *WatchersClientBeginVerifyIPFlowOptions) (*runtime.Poller[WatchersClientVerifyIPFlowResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.verifyIPFlow(ctx, resourceGroupName, networkWatcherName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[WatchersClientVerifyIPFlowResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[WatchersClientVerifyIPFlowResponse](options.ResumeToken, client.pl, nil) - } -} - -// VerifyIPFlow - Verify IP flow from the specified VM to a location given the currently configured NSG rules. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *WatchersClient) verifyIPFlow(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters VerificationIPFlowParameters, options *WatchersClientBeginVerifyIPFlowOptions) (*http.Response, error) { - req, err := client.verifyIPFlowCreateRequest(ctx, resourceGroupName, networkWatcherName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// verifyIPFlowCreateRequest creates the VerifyIPFlow request. -func (client *WatchersClient) verifyIPFlowCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters VerificationIPFlowParameters, options *WatchersClientBeginVerifyIPFlowOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/ipFlowVerify" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkWatcherName == "" { - return nil, errors.New("parameter networkWatcherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/webapplicationfirewallpolicies_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/webapplicationfirewallpolicies_client.go deleted file mode 100644 index af4a7cf5..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/webapplicationfirewallpolicies_client.go +++ /dev/null @@ -1,362 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// WebApplicationFirewallPoliciesClient contains the methods for the WebApplicationFirewallPolicies group. -// Don't use this type directly, use NewWebApplicationFirewallPoliciesClient() instead. -type WebApplicationFirewallPoliciesClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewWebApplicationFirewallPoliciesClient creates a new instance of WebApplicationFirewallPoliciesClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewWebApplicationFirewallPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*WebApplicationFirewallPoliciesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &WebApplicationFirewallPoliciesClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// CreateOrUpdate - Creates or update policy with specified rule set name within a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// policyName - The name of the policy. -// parameters - Policy to be created. -// options - WebApplicationFirewallPoliciesClientCreateOrUpdateOptions contains the optional parameters for the WebApplicationFirewallPoliciesClient.CreateOrUpdate -// method. -func (client *WebApplicationFirewallPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, policyName string, parameters WebApplicationFirewallPolicy, options *WebApplicationFirewallPoliciesClientCreateOrUpdateOptions) (WebApplicationFirewallPoliciesClientCreateOrUpdateResponse, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, policyName, parameters, options) - if err != nil { - return WebApplicationFirewallPoliciesClientCreateOrUpdateResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return WebApplicationFirewallPoliciesClientCreateOrUpdateResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return WebApplicationFirewallPoliciesClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) - } - return client.createOrUpdateHandleResponse(resp) -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *WebApplicationFirewallPoliciesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, policyName string, parameters WebApplicationFirewallPolicy, options *WebApplicationFirewallPoliciesClientCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/{policyName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if policyName == "" { - return nil, errors.New("parameter policyName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{policyName}", url.PathEscape(policyName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// createOrUpdateHandleResponse handles the CreateOrUpdate response. -func (client *WebApplicationFirewallPoliciesClient) createOrUpdateHandleResponse(resp *http.Response) (WebApplicationFirewallPoliciesClientCreateOrUpdateResponse, error) { - result := WebApplicationFirewallPoliciesClientCreateOrUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.WebApplicationFirewallPolicy); err != nil { - return WebApplicationFirewallPoliciesClientCreateOrUpdateResponse{}, err - } - return result, nil -} - -// BeginDelete - Deletes Policy. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// policyName - The name of the policy. -// options - WebApplicationFirewallPoliciesClientBeginDeleteOptions contains the optional parameters for the WebApplicationFirewallPoliciesClient.BeginDelete -// method. -func (client *WebApplicationFirewallPoliciesClient) BeginDelete(ctx context.Context, resourceGroupName string, policyName string, options *WebApplicationFirewallPoliciesClientBeginDeleteOptions) (*runtime.Poller[WebApplicationFirewallPoliciesClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, policyName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[WebApplicationFirewallPoliciesClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[WebApplicationFirewallPoliciesClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes Policy. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -func (client *WebApplicationFirewallPoliciesClient) deleteOperation(ctx context.Context, resourceGroupName string, policyName string, options *WebApplicationFirewallPoliciesClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, policyName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *WebApplicationFirewallPoliciesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, policyName string, options *WebApplicationFirewallPoliciesClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/{policyName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if policyName == "" { - return nil, errors.New("parameter policyName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{policyName}", url.PathEscape(policyName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Retrieve protection policy with specified name within a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// policyName - The name of the policy. -// options - WebApplicationFirewallPoliciesClientGetOptions contains the optional parameters for the WebApplicationFirewallPoliciesClient.Get -// method. -func (client *WebApplicationFirewallPoliciesClient) Get(ctx context.Context, resourceGroupName string, policyName string, options *WebApplicationFirewallPoliciesClientGetOptions) (WebApplicationFirewallPoliciesClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, policyName, options) - if err != nil { - return WebApplicationFirewallPoliciesClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return WebApplicationFirewallPoliciesClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return WebApplicationFirewallPoliciesClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *WebApplicationFirewallPoliciesClient) getCreateRequest(ctx context.Context, resourceGroupName string, policyName string, options *WebApplicationFirewallPoliciesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/{policyName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if policyName == "" { - return nil, errors.New("parameter policyName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{policyName}", url.PathEscape(policyName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *WebApplicationFirewallPoliciesClient) getHandleResponse(resp *http.Response) (WebApplicationFirewallPoliciesClientGetResponse, error) { - result := WebApplicationFirewallPoliciesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.WebApplicationFirewallPolicy); err != nil { - return WebApplicationFirewallPoliciesClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Lists all of the protection policies within a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group. -// options - WebApplicationFirewallPoliciesClientListOptions contains the optional parameters for the WebApplicationFirewallPoliciesClient.List -// method. -func (client *WebApplicationFirewallPoliciesClient) NewListPager(resourceGroupName string, options *WebApplicationFirewallPoliciesClientListOptions) *runtime.Pager[WebApplicationFirewallPoliciesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[WebApplicationFirewallPoliciesClientListResponse]{ - More: func(page WebApplicationFirewallPoliciesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *WebApplicationFirewallPoliciesClientListResponse) (WebApplicationFirewallPoliciesClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return WebApplicationFirewallPoliciesClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return WebApplicationFirewallPoliciesClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return WebApplicationFirewallPoliciesClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *WebApplicationFirewallPoliciesClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *WebApplicationFirewallPoliciesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *WebApplicationFirewallPoliciesClient) listHandleResponse(resp *http.Response) (WebApplicationFirewallPoliciesClientListResponse, error) { - result := WebApplicationFirewallPoliciesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.WebApplicationFirewallPolicyListResult); err != nil { - return WebApplicationFirewallPoliciesClientListResponse{}, err - } - return result, nil -} - -// NewListAllPager - Gets all the WAF policies in a subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// options - WebApplicationFirewallPoliciesClientListAllOptions contains the optional parameters for the WebApplicationFirewallPoliciesClient.ListAll -// method. -func (client *WebApplicationFirewallPoliciesClient) NewListAllPager(options *WebApplicationFirewallPoliciesClientListAllOptions) *runtime.Pager[WebApplicationFirewallPoliciesClientListAllResponse] { - return runtime.NewPager(runtime.PagingHandler[WebApplicationFirewallPoliciesClientListAllResponse]{ - More: func(page WebApplicationFirewallPoliciesClientListAllResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *WebApplicationFirewallPoliciesClientListAllResponse) (WebApplicationFirewallPoliciesClientListAllResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listAllCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return WebApplicationFirewallPoliciesClientListAllResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return WebApplicationFirewallPoliciesClientListAllResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return WebApplicationFirewallPoliciesClientListAllResponse{}, runtime.NewResponseError(resp) - } - return client.listAllHandleResponse(resp) - }, - }) -} - -// listAllCreateRequest creates the ListAll request. -func (client *WebApplicationFirewallPoliciesClient) listAllCreateRequest(ctx context.Context, options *WebApplicationFirewallPoliciesClientListAllOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listAllHandleResponse handles the ListAll response. -func (client *WebApplicationFirewallPoliciesClient) listAllHandleResponse(resp *http.Response) (WebApplicationFirewallPoliciesClientListAllResponse, error) { - result := WebApplicationFirewallPoliciesClientListAllResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.WebApplicationFirewallPolicyListResult); err != nil { - return WebApplicationFirewallPoliciesClientListAllResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/webcategories_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/webcategories_client.go deleted file mode 100644 index 6392afc4..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/webcategories_client.go +++ /dev/null @@ -1,171 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// WebCategoriesClient contains the methods for the WebCategories group. -// Don't use this type directly, use NewWebCategoriesClient() instead. -type WebCategoriesClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewWebCategoriesClient creates a new instance of WebCategoriesClient with the specified values. -// subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewWebCategoriesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*WebCategoriesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &WebCategoriesClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// Get - Gets the specified Azure Web Category. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// name - The name of the azureWebCategory. -// options - WebCategoriesClientGetOptions contains the optional parameters for the WebCategoriesClient.Get method. -func (client *WebCategoriesClient) Get(ctx context.Context, name string, options *WebCategoriesClientGetOptions) (WebCategoriesClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, name, options) - if err != nil { - return WebCategoriesClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return WebCategoriesClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return WebCategoriesClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *WebCategoriesClient) getCreateRequest(ctx context.Context, name string, options *WebCategoriesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/azureWebCategories/{name}" - if name == "" { - return nil, errors.New("parameter name cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *WebCategoriesClient) getHandleResponse(resp *http.Response) (WebCategoriesClientGetResponse, error) { - result := WebCategoriesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.AzureWebCategory); err != nil { - return WebCategoriesClientGetResponse{}, err - } - return result, nil -} - -// NewListBySubscriptionPager - Gets all the Azure Web Categories in a subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 -// options - WebCategoriesClientListBySubscriptionOptions contains the optional parameters for the WebCategoriesClient.ListBySubscription -// method. -func (client *WebCategoriesClient) NewListBySubscriptionPager(options *WebCategoriesClientListBySubscriptionOptions) *runtime.Pager[WebCategoriesClientListBySubscriptionResponse] { - return runtime.NewPager(runtime.PagingHandler[WebCategoriesClientListBySubscriptionResponse]{ - More: func(page WebCategoriesClientListBySubscriptionResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *WebCategoriesClientListBySubscriptionResponse) (WebCategoriesClientListBySubscriptionResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listBySubscriptionCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return WebCategoriesClientListBySubscriptionResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return WebCategoriesClientListBySubscriptionResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return WebCategoriesClientListBySubscriptionResponse{}, runtime.NewResponseError(resp) - } - return client.listBySubscriptionHandleResponse(resp) - }, - }) -} - -// listBySubscriptionCreateRequest creates the ListBySubscription request. -func (client *WebCategoriesClient) listBySubscriptionCreateRequest(ctx context.Context, options *WebCategoriesClientListBySubscriptionOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/azureWebCategories" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listBySubscriptionHandleResponse handles the ListBySubscription response. -func (client *WebCategoriesClient) listBySubscriptionHandleResponse(resp *http.Response) (WebCategoriesClientListBySubscriptionResponse, error) { - result := WebCategoriesClientListBySubscriptionResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.AzureWebCategoryListResult); err != nil { - return WebCategoriesClientListBySubscriptionResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/CHANGELOG.md b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/CHANGELOG.md deleted file mode 100644 index 52911e4c..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Change History - diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/_meta.json b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/_meta.json deleted file mode 100644 index ad0ecd94..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/_meta.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", - "readme": "/_/azure-rest-api-specs/specification/compute/resource-manager/readme.md", - "tag": "package-2019-12-01", - "use": "@microsoft.azure/autorest.go@2.1.187", - "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-2019-12-01 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/compute/resource-manager/readme.md", - "additional_properties": { - "additional_options": "--go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION" - } -} \ No newline at end of file diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/availabilitysets.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/availabilitysets.go deleted file mode 100644 index 8caf510e..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/availabilitysets.go +++ /dev/null @@ -1,652 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// AvailabilitySetsClient is the compute Client -type AvailabilitySetsClient struct { - BaseClient -} - -// NewAvailabilitySetsClient creates an instance of the AvailabilitySetsClient client. -func NewAvailabilitySetsClient(subscriptionID string) AvailabilitySetsClient { - return NewAvailabilitySetsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewAvailabilitySetsClientWithBaseURI creates an instance of the AvailabilitySetsClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewAvailabilitySetsClientWithBaseURI(baseURI string, subscriptionID string) AvailabilitySetsClient { - return AvailabilitySetsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create or update an availability set. -// Parameters: -// resourceGroupName - the name of the resource group. -// availabilitySetName - the name of the availability set. -// parameters - parameters supplied to the Create Availability Set operation. -func (client AvailabilitySetsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, availabilitySetName string, parameters AvailabilitySet) (result AvailabilitySet, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, availabilitySetName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "CreateOrUpdate", resp, "Failure responding to request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client AvailabilitySetsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, availabilitySetName string, parameters AvailabilitySet) (*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 = "2019-12-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.Compute/availabilitySets/{availabilitySetName}", 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 AvailabilitySetsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client AvailabilitySetsClient) CreateOrUpdateResponder(resp *http.Response) (result AvailabilitySet, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete an availability set. -// Parameters: -// resourceGroupName - the name of the resource group. -// availabilitySetName - the name of the availability set. -func (client AvailabilitySetsClient) Delete(ctx context.Context, resourceGroupName string, availabilitySetName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, availabilitySetName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Delete", resp, "Failure responding to request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client AvailabilitySetsClient) DeletePreparer(ctx context.Context, resourceGroupName string, availabilitySetName string) (*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 = "2019-12-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.Compute/availabilitySets/{availabilitySetName}", 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 AvailabilitySetsClient) DeleteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client AvailabilitySetsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieves information about an availability set. -// Parameters: -// resourceGroupName - the name of the resource group. -// availabilitySetName - the name of the availability set. -func (client AvailabilitySetsClient) Get(ctx context.Context, resourceGroupName string, availabilitySetName string) (result AvailabilitySet, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, availabilitySetName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client AvailabilitySetsClient) GetPreparer(ctx context.Context, resourceGroupName string, availabilitySetName string) (*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 = "2019-12-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.Compute/availabilitySets/{availabilitySetName}", 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 AvailabilitySetsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client AvailabilitySetsClient) GetResponder(resp *http.Response) (result AvailabilitySet, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists all availability sets in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client AvailabilitySetsClient) List(ctx context.Context, resourceGroupName string) (result AvailabilitySetListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.List") - defer func() { - sc := -1 - if result.aslr.Response.Response != nil { - sc = result.aslr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.aslr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "List", resp, "Failure sending request") - return - } - - result.aslr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "List", resp, "Failure responding to request") - return - } - if result.aslr.hasNextLink() && result.aslr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client AvailabilitySetsClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-12-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.Compute/availabilitySets", 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 AvailabilitySetsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client AvailabilitySetsClient) ListResponder(resp *http.Response) (result AvailabilitySetListResult, err error) { - err = autorest.Respond( - resp, - 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 AvailabilitySetsClient) listNextResults(ctx context.Context, lastResults AvailabilitySetListResult) (result AvailabilitySetListResult, err error) { - req, err := lastResults.availabilitySetListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "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, "compute.AvailabilitySetsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client AvailabilitySetsClient) ListComplete(ctx context.Context, resourceGroupName string) (result AvailabilitySetListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName) - return -} - -// ListAvailableSizes lists all available virtual machine sizes that can be used to create a new virtual machine in an -// existing availability set. -// Parameters: -// resourceGroupName - the name of the resource group. -// availabilitySetName - the name of the availability set. -func (client AvailabilitySetsClient) ListAvailableSizes(ctx context.Context, resourceGroupName string, availabilitySetName string) (result VirtualMachineSizeListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.ListAvailableSizes") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListAvailableSizesPreparer(ctx, resourceGroupName, availabilitySetName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListAvailableSizes", nil, "Failure preparing request") - return - } - - resp, err := client.ListAvailableSizesSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListAvailableSizes", resp, "Failure sending request") - return - } - - result, err = client.ListAvailableSizesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListAvailableSizes", resp, "Failure responding to request") - return - } - - return -} - -// ListAvailableSizesPreparer prepares the ListAvailableSizes request. -func (client AvailabilitySetsClient) ListAvailableSizesPreparer(ctx context.Context, resourceGroupName string, availabilitySetName string) (*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 = "2019-12-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.Compute/availabilitySets/{availabilitySetName}/vmSizes", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAvailableSizesSender sends the ListAvailableSizes request. The method will close the -// http.Response Body if it receives an error. -func (client AvailabilitySetsClient) ListAvailableSizesSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAvailableSizesResponder handles the response to the ListAvailableSizes request. The method always -// closes the http.Response Body. -func (client AvailabilitySetsClient) ListAvailableSizesResponder(resp *http.Response) (result VirtualMachineSizeListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListBySubscription lists all availability sets in a subscription. -// Parameters: -// expand - the expand expression to apply to the operation. Allowed values are 'instanceView'. -func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context, expand string) (result AvailabilitySetListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.ListBySubscription") - defer func() { - sc := -1 - if result.aslr.Response.Response != nil { - sc = result.aslr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listBySubscriptionNextResults - req, err := client.ListBySubscriptionPreparer(ctx, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListBySubscription", nil, "Failure preparing request") - return - } - - resp, err := client.ListBySubscriptionSender(req) - if err != nil { - result.aslr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListBySubscription", resp, "Failure sending request") - return - } - - result.aslr, err = client.ListBySubscriptionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListBySubscription", resp, "Failure responding to request") - return - } - if result.aslr.hasNextLink() && result.aslr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListBySubscriptionPreparer prepares the ListBySubscription request. -func (client AvailabilitySetsClient) ListBySubscriptionPreparer(ctx context.Context, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/availabilitySets", 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 AvailabilitySetsClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always -// closes the http.Response Body. -func (client AvailabilitySetsClient) ListBySubscriptionResponder(resp *http.Response) (result AvailabilitySetListResult, err error) { - err = autorest.Respond( - resp, - 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 AvailabilitySetsClient) listBySubscriptionNextResults(ctx context.Context, lastResults AvailabilitySetListResult) (result AvailabilitySetListResult, err error) { - req, err := lastResults.availabilitySetListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "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, "compute.AvailabilitySetsClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") - } - result, err = client.ListBySubscriptionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. -func (client AvailabilitySetsClient) ListBySubscriptionComplete(ctx context.Context, expand string) (result AvailabilitySetListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.ListBySubscription") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListBySubscription(ctx, expand) - return -} - -// Update update an availability set. -// Parameters: -// resourceGroupName - the name of the resource group. -// availabilitySetName - the name of the availability set. -// parameters - 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) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.Update") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - 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 - } - - 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 = "2019-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 client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client AvailabilitySetsClient) UpdateResponder(resp *http.Response) (result AvailabilitySet, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/client.go deleted file mode 100644 index c7c45431..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/client.go +++ /dev/null @@ -1,43 +0,0 @@ -// Deprecated: Please note, this package has been deprecated. A replacement package is available [github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute). We strongly encourage you to upgrade to continue receiving updates. See [Migration Guide](https://aka.ms/azsdk/golang/t2/migration) for guidance on upgrading. Refer to our [deprecation policy](https://azure.github.io/azure-sdk/policies_support.html) for more details. -// -// Package compute implements the Azure ARM Compute service API version . -// -// Compute Client -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "github.com/Azure/go-autorest/autorest" -) - -const ( - // DefaultBaseURI is the default URI used for the service Compute - DefaultBaseURI = "https://management.azure.com" -) - -// BaseClient is the base client for Compute. -type BaseClient struct { - autorest.Client - BaseURI string - SubscriptionID string -} - -// New creates an instance of the BaseClient client. -func New(subscriptionID string) BaseClient { - return NewWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewWithBaseURI creates an instance of the BaseClient client using a custom endpoint. Use this when interacting with -// an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func 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/compute/mgmt/2019-12-01/compute/containerservices.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/containerservices.go deleted file mode 100644 index b1c85461..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/containerservices.go +++ /dev/null @@ -1,538 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ContainerServicesClient is the compute Client -type ContainerServicesClient struct { - BaseClient -} - -// NewContainerServicesClient creates an instance of the ContainerServicesClient client. -func NewContainerServicesClient(subscriptionID string) ContainerServicesClient { - return NewContainerServicesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewContainerServicesClientWithBaseURI creates an instance of the ContainerServicesClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewContainerServicesClientWithBaseURI(baseURI string, subscriptionID string) ContainerServicesClient { - return ContainerServicesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a container service with the specified configuration of orchestrator, masters, and -// agents. -// Parameters: -// resourceGroupName - the name of the resource group. -// containerServiceName - the name of the container service in the specified subscription and resource group. -// parameters - 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 tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ContainerServicesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.ContainerServiceProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ContainerServiceProperties.CustomProfile", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ContainerServiceProperties.CustomProfile.Orchestrator", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "parameters.ContainerServiceProperties.ServicePrincipalProfile", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ContainerServiceProperties.ServicePrincipalProfile.ClientID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.ContainerServiceProperties.ServicePrincipalProfile.Secret", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "parameters.ContainerServiceProperties.MasterProfile", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.ContainerServiceProperties.MasterProfile.DNSPrefix", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "parameters.ContainerServiceProperties.AgentPoolProfiles", Name: validation.Null, Rule: true, Chain: nil}, - {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: nil}, - }}, - {Target: "parameters.ContainerServiceProperties.LinuxProfile", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.ContainerServiceProperties.LinuxProfile.AdminUsername", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.ContainerServiceProperties.LinuxProfile.AdminUsername", Name: validation.Pattern, Rule: `^[a-z][a-z0-9_-]*$`, Chain: nil}}}, - {Target: "parameters.ContainerServiceProperties.LinuxProfile.SSH", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.ContainerServiceProperties.LinuxProfile.SSH.PublicKeys", Name: validation.Null, Rule: true, Chain: nil}}}, - }}, - {Target: "parameters.ContainerServiceProperties.DiagnosticsProfile", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ContainerServiceProperties.DiagnosticsProfile.VMDiagnostics", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.ContainerServiceProperties.DiagnosticsProfile.VMDiagnostics.Enabled", Name: validation.Null, Rule: true, Chain: nil}}}, - }}, - }}}}}); err != nil { - return result, validation.NewError("compute.ContainerServicesClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, containerServiceName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ContainerServicesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, containerServiceName string, parameters ContainerService) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "containerServiceName": autorest.Encode("path", containerServiceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-01-31" - 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.ContainerService/containerServices/{containerServiceName}", 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 ContainerServicesClient) CreateOrUpdateSender(req *http.Request) (future ContainerServicesCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client ContainerServicesClient) CreateOrUpdateResponder(resp *http.Response) (result ContainerService, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified container service in the specified subscription and resource group. The operation does -// not delete other resources created as part of creating a container service, including storage accounts, VMs, and -// availability sets. All the other resources created with the container service are part of the same resource group -// and can be deleted individually. -// Parameters: -// resourceGroupName - the name of the resource group. -// containerServiceName - 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) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ContainerServicesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, containerServiceName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ContainerServicesClient) DeletePreparer(ctx context.Context, resourceGroupName string, containerServiceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "containerServiceName": autorest.Encode("path", containerServiceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-01-31" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}", 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 ContainerServicesClient) DeleteSender(req *http.Request) (future ContainerServicesDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client ContainerServicesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the properties of the specified container service in the specified subscription and resource group. The -// operation returns the properties including state, orchestrator, number of masters and agents, and FQDNs of masters -// and agents. -// Parameters: -// resourceGroupName - the name of the resource group. -// containerServiceName - 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) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ContainerServicesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, containerServiceName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ContainerServicesClient) GetPreparer(ctx context.Context, resourceGroupName string, containerServiceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "containerServiceName": autorest.Encode("path", containerServiceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-01-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.ContainerService/containerServices/{containerServiceName}", 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 ContainerServicesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ContainerServicesClient) GetResponder(resp *http.Response) (result ContainerService, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets a list of container services in the specified subscription. The operation returns properties of each -// container service including state, orchestrator, number of masters and agents, and FQDNs of masters and agents. -func (client ContainerServicesClient) List(ctx context.Context) (result ContainerServiceListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ContainerServicesClient.List") - defer func() { - sc := -1 - if result.cslr.Response.Response != nil { - sc = result.cslr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.cslr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "List", resp, "Failure sending request") - return - } - - result.cslr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "List", resp, "Failure responding to request") - return - } - if result.cslr.hasNextLink() && result.cslr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ContainerServicesClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-01-31" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/containerServices", 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 ContainerServicesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ContainerServicesClient) ListResponder(resp *http.Response) (result ContainerServiceListResult, err error) { - err = autorest.Respond( - resp, - 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 ContainerServicesClient) listNextResults(ctx context.Context, lastResults ContainerServiceListResult) (result ContainerServiceListResult, err error) { - req, err := lastResults.containerServiceListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "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, "compute.ContainerServicesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ContainerServicesClient) ListComplete(ctx context.Context) (result ContainerServiceListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ContainerServicesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} - -// ListByResourceGroup gets a list of container services in the specified subscription and resource group. The -// operation returns properties of each container service including state, orchestrator, number of masters and agents, -// and FQDNs of masters and agents. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client ContainerServicesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ContainerServiceListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ContainerServicesClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.cslr.Response.Response != nil { - sc = result.cslr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.cslr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.cslr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.cslr.hasNextLink() && result.cslr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client ContainerServicesClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-01-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.ContainerService/containerServices", pathParameters), - autorest.WithQueryParameters(queryParameters)) - 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 ContainerServicesClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client ContainerServicesClient) ListByResourceGroupResponder(resp *http.Response) (result ContainerServiceListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client ContainerServicesClient) listByResourceGroupNextResults(ctx context.Context, lastResults ContainerServiceListResult) (result ContainerServiceListResult, err error) { - req, err := lastResults.containerServiceListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client ContainerServicesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ContainerServiceListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ContainerServicesClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/dedicatedhostgroups.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/dedicatedhostgroups.go deleted file mode 100644 index 70f9358c..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/dedicatedhostgroups.go +++ /dev/null @@ -1,585 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// DedicatedHostGroupsClient is the compute Client -type DedicatedHostGroupsClient struct { - BaseClient -} - -// NewDedicatedHostGroupsClient creates an instance of the DedicatedHostGroupsClient client. -func NewDedicatedHostGroupsClient(subscriptionID string) DedicatedHostGroupsClient { - return NewDedicatedHostGroupsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewDedicatedHostGroupsClientWithBaseURI creates an instance of the DedicatedHostGroupsClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewDedicatedHostGroupsClientWithBaseURI(baseURI string, subscriptionID string) DedicatedHostGroupsClient { - return DedicatedHostGroupsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups -// please see [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596) -// Parameters: -// resourceGroupName - the name of the resource group. -// hostGroupName - the name of the dedicated host group. -// parameters - parameters supplied to the Create Dedicated Host Group. -func (client DedicatedHostGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, hostGroupName string, parameters DedicatedHostGroup) (result DedicatedHostGroup, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.DedicatedHostGroupProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.DedicatedHostGroupProperties.PlatformFaultDomainCount", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.DedicatedHostGroupProperties.PlatformFaultDomainCount", Name: validation.InclusiveMaximum, Rule: int64(3), Chain: nil}, - {Target: "parameters.DedicatedHostGroupProperties.PlatformFaultDomainCount", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, - }}, - }}}}}); err != nil { - return result, validation.NewError("compute.DedicatedHostGroupsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, hostGroupName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "CreateOrUpdate", resp, "Failure responding to request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client DedicatedHostGroupsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, hostGroupName string, parameters DedicatedHostGroup) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "hostGroupName": autorest.Encode("path", hostGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-12-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.Compute/hostGroups/{hostGroupName}", 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 DedicatedHostGroupsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client DedicatedHostGroupsClient) CreateOrUpdateResponder(resp *http.Response) (result DedicatedHostGroup, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete a dedicated host group. -// Parameters: -// resourceGroupName - the name of the resource group. -// hostGroupName - the name of the dedicated host group. -func (client DedicatedHostGroupsClient) Delete(ctx context.Context, resourceGroupName string, hostGroupName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupsClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, hostGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "Delete", resp, "Failure responding to request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client DedicatedHostGroupsClient) DeletePreparer(ctx context.Context, resourceGroupName string, hostGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "hostGroupName": autorest.Encode("path", hostGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-12-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.Compute/hostGroups/{hostGroupName}", 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 DedicatedHostGroupsClient) DeleteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client DedicatedHostGroupsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieves information about a dedicated host group. -// Parameters: -// resourceGroupName - the name of the resource group. -// hostGroupName - the name of the dedicated host group. -func (client DedicatedHostGroupsClient) Get(ctx context.Context, resourceGroupName string, hostGroupName string) (result DedicatedHostGroup, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, hostGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client DedicatedHostGroupsClient) GetPreparer(ctx context.Context, resourceGroupName string, hostGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "hostGroupName": autorest.Encode("path", hostGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-12-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.Compute/hostGroups/{hostGroupName}", 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 DedicatedHostGroupsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client DedicatedHostGroupsClient) GetResponder(resp *http.Response) (result DedicatedHostGroup, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByResourceGroup lists all of the dedicated host groups in the specified resource group. Use the nextLink -// property in the response to get the next page of dedicated host groups. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client DedicatedHostGroupsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result DedicatedHostGroupListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.dhglr.Response.Response != nil { - sc = result.dhglr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.dhglr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.dhglr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.dhglr.hasNextLink() && result.dhglr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client DedicatedHostGroupsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-12-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.Compute/hostGroups", pathParameters), - autorest.WithQueryParameters(queryParameters)) - 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 DedicatedHostGroupsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client DedicatedHostGroupsClient) ListByResourceGroupResponder(resp *http.Response) (result DedicatedHostGroupListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client DedicatedHostGroupsClient) listByResourceGroupNextResults(ctx context.Context, lastResults DedicatedHostGroupListResult) (result DedicatedHostGroupListResult, err error) { - req, err := lastResults.dedicatedHostGroupListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client DedicatedHostGroupsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result DedicatedHostGroupListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// ListBySubscription lists all of the dedicated host groups in the subscription. Use the nextLink property in the -// response to get the next page of dedicated host groups. -func (client DedicatedHostGroupsClient) ListBySubscription(ctx context.Context) (result DedicatedHostGroupListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupsClient.ListBySubscription") - defer func() { - sc := -1 - if result.dhglr.Response.Response != nil { - sc = result.dhglr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listBySubscriptionNextResults - req, err := client.ListBySubscriptionPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "ListBySubscription", nil, "Failure preparing request") - return - } - - resp, err := client.ListBySubscriptionSender(req) - if err != nil { - result.dhglr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "ListBySubscription", resp, "Failure sending request") - return - } - - result.dhglr, err = client.ListBySubscriptionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "ListBySubscription", resp, "Failure responding to request") - return - } - if result.dhglr.hasNextLink() && result.dhglr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListBySubscriptionPreparer prepares the ListBySubscription request. -func (client DedicatedHostGroupsClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/hostGroups", 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 DedicatedHostGroupsClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always -// closes the http.Response Body. -func (client DedicatedHostGroupsClient) ListBySubscriptionResponder(resp *http.Response) (result DedicatedHostGroupListResult, err error) { - err = autorest.Respond( - resp, - 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 DedicatedHostGroupsClient) listBySubscriptionNextResults(ctx context.Context, lastResults DedicatedHostGroupListResult) (result DedicatedHostGroupListResult, err error) { - req, err := lastResults.dedicatedHostGroupListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "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, "compute.DedicatedHostGroupsClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") - } - result, err = client.ListBySubscriptionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. -func (client DedicatedHostGroupsClient) ListBySubscriptionComplete(ctx context.Context) (result DedicatedHostGroupListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupsClient.ListBySubscription") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListBySubscription(ctx) - return -} - -// Update update an dedicated host group. -// Parameters: -// resourceGroupName - the name of the resource group. -// hostGroupName - the name of the dedicated host group. -// parameters - parameters supplied to the Update Dedicated Host Group operation. -func (client DedicatedHostGroupsClient) Update(ctx context.Context, resourceGroupName string, hostGroupName string, parameters DedicatedHostGroupUpdate) (result DedicatedHostGroup, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupsClient.Update") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, hostGroupName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "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.DedicatedHostGroupsClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "Update", resp, "Failure responding to request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client DedicatedHostGroupsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, hostGroupName string, parameters DedicatedHostGroupUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "hostGroupName": autorest.Encode("path", hostGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-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/hostGroups/{hostGroupName}", 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 DedicatedHostGroupsClient) UpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client DedicatedHostGroupsClient) UpdateResponder(resp *http.Response) (result DedicatedHostGroup, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/dedicatedhosts.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/dedicatedhosts.go deleted file mode 100644 index eebe2534..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/dedicatedhosts.go +++ /dev/null @@ -1,493 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// DedicatedHostsClient is the compute Client -type DedicatedHostsClient struct { - BaseClient -} - -// NewDedicatedHostsClient creates an instance of the DedicatedHostsClient client. -func NewDedicatedHostsClient(subscriptionID string) DedicatedHostsClient { - return NewDedicatedHostsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewDedicatedHostsClientWithBaseURI creates an instance of the DedicatedHostsClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewDedicatedHostsClientWithBaseURI(baseURI string, subscriptionID string) DedicatedHostsClient { - return DedicatedHostsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create or update a dedicated host . -// Parameters: -// resourceGroupName - the name of the resource group. -// hostGroupName - the name of the dedicated host group. -// hostName - the name of the dedicated host . -// parameters - parameters supplied to the Create Dedicated Host. -func (client DedicatedHostsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, parameters DedicatedHost) (result DedicatedHostsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.DedicatedHostProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.DedicatedHostProperties.PlatformFaultDomain", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.DedicatedHostProperties.PlatformFaultDomain", Name: validation.InclusiveMaximum, Rule: int64(2), Chain: nil}, - {Target: "parameters.DedicatedHostProperties.PlatformFaultDomain", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, - }}, - }}, - {Target: "parameters.Sku", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("compute.DedicatedHostsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, hostGroupName, hostName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client DedicatedHostsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, parameters DedicatedHost) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "hostGroupName": autorest.Encode("path", hostGroupName), - "hostName": autorest.Encode("path", hostName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-12-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.Compute/hostGroups/{hostGroupName}/hosts/{hostName}", 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 DedicatedHostsClient) CreateOrUpdateSender(req *http.Request) (future DedicatedHostsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client DedicatedHostsClient) CreateOrUpdateResponder(resp *http.Response) (result DedicatedHost, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete a dedicated host. -// Parameters: -// resourceGroupName - the name of the resource group. -// hostGroupName - the name of the dedicated host group. -// hostName - the name of the dedicated host. -func (client DedicatedHostsClient) Delete(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string) (result DedicatedHostsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, hostGroupName, hostName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client DedicatedHostsClient) DeletePreparer(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "hostGroupName": autorest.Encode("path", hostGroupName), - "hostName": autorest.Encode("path", hostName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-12-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.Compute/hostGroups/{hostGroupName}/hosts/{hostName}", 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 DedicatedHostsClient) DeleteSender(req *http.Request) (future DedicatedHostsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client DedicatedHostsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieves information about a dedicated host. -// Parameters: -// resourceGroupName - the name of the resource group. -// hostGroupName - the name of the dedicated host group. -// hostName - the name of the dedicated host. -// expand - the expand expression to apply on the operation. -func (client DedicatedHostsClient) Get(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, expand InstanceViewTypes) (result DedicatedHost, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, hostGroupName, hostName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client DedicatedHostsClient) GetPreparer(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, expand InstanceViewTypes) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "hostGroupName": autorest.Encode("path", hostGroupName), - "hostName": autorest.Encode("path", hostName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(string(expand)) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}", 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 DedicatedHostsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client DedicatedHostsClient) GetResponder(resp *http.Response) (result DedicatedHost, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByHostGroup lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in -// the response to get the next page of dedicated hosts. -// Parameters: -// resourceGroupName - the name of the resource group. -// hostGroupName - the name of the dedicated host group. -func (client DedicatedHostsClient) ListByHostGroup(ctx context.Context, resourceGroupName string, hostGroupName string) (result DedicatedHostListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostsClient.ListByHostGroup") - defer func() { - sc := -1 - if result.dhlr.Response.Response != nil { - sc = result.dhlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByHostGroupNextResults - req, err := client.ListByHostGroupPreparer(ctx, resourceGroupName, hostGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "ListByHostGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByHostGroupSender(req) - if err != nil { - result.dhlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "ListByHostGroup", resp, "Failure sending request") - return - } - - result.dhlr, err = client.ListByHostGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "ListByHostGroup", resp, "Failure responding to request") - return - } - if result.dhlr.hasNextLink() && result.dhlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByHostGroupPreparer prepares the ListByHostGroup request. -func (client DedicatedHostsClient) ListByHostGroupPreparer(ctx context.Context, resourceGroupName string, hostGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "hostGroupName": autorest.Encode("path", hostGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-12-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.Compute/hostGroups/{hostGroupName}/hosts", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByHostGroupSender sends the ListByHostGroup request. The method will close the -// http.Response Body if it receives an error. -func (client DedicatedHostsClient) ListByHostGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByHostGroupResponder handles the response to the ListByHostGroup request. The method always -// closes the http.Response Body. -func (client DedicatedHostsClient) ListByHostGroupResponder(resp *http.Response) (result DedicatedHostListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByHostGroupNextResults retrieves the next set of results, if any. -func (client DedicatedHostsClient) listByHostGroupNextResults(ctx context.Context, lastResults DedicatedHostListResult) (result DedicatedHostListResult, err error) { - req, err := lastResults.dedicatedHostListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "listByHostGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByHostGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "listByHostGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByHostGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "listByHostGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByHostGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client DedicatedHostsClient) ListByHostGroupComplete(ctx context.Context, resourceGroupName string, hostGroupName string) (result DedicatedHostListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostsClient.ListByHostGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByHostGroup(ctx, resourceGroupName, hostGroupName) - return -} - -// Update update an dedicated host . -// Parameters: -// resourceGroupName - the name of the resource group. -// hostGroupName - the name of the dedicated host group. -// hostName - the name of the dedicated host . -// parameters - parameters supplied to the Update Dedicated Host operation. -func (client DedicatedHostsClient) Update(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, parameters DedicatedHostUpdate) (result DedicatedHostsUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostsClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, hostGroupName, hostName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client DedicatedHostsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, parameters DedicatedHostUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "hostGroupName": autorest.Encode("path", hostGroupName), - "hostName": autorest.Encode("path", hostName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-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/hostGroups/{hostGroupName}/hosts/{hostName}", 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 DedicatedHostsClient) UpdateSender(req *http.Request) (future DedicatedHostsUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client DedicatedHostsClient) UpdateResponder(resp *http.Response) (result DedicatedHost, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/diskencryptionsets.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/diskencryptionsets.go deleted file mode 100644 index 7b232cdf..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/diskencryptionsets.go +++ /dev/null @@ -1,601 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// DiskEncryptionSetsClient is the compute Client -type DiskEncryptionSetsClient struct { - BaseClient -} - -// NewDiskEncryptionSetsClient creates an instance of the DiskEncryptionSetsClient client. -func NewDiskEncryptionSetsClient(subscriptionID string) DiskEncryptionSetsClient { - return NewDiskEncryptionSetsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewDiskEncryptionSetsClientWithBaseURI creates an instance of the DiskEncryptionSetsClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewDiskEncryptionSetsClientWithBaseURI(baseURI string, subscriptionID string) DiskEncryptionSetsClient { - return DiskEncryptionSetsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a disk encryption set -// Parameters: -// resourceGroupName - the name of the resource group. -// diskEncryptionSetName - the name of the disk encryption set that is being created. The name can't be changed -// after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The -// maximum name length is 80 characters. -// diskEncryptionSet - disk encryption set object supplied in the body of the Put disk encryption set -// operation. -func (client DiskEncryptionSetsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, diskEncryptionSet DiskEncryptionSet) (result DiskEncryptionSetsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: diskEncryptionSet, - Constraints: []validation.Constraint{{Target: "diskEncryptionSet.EncryptionSetProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "diskEncryptionSet.EncryptionSetProperties.ActiveKey", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "diskEncryptionSet.EncryptionSetProperties.ActiveKey.SourceVault", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "diskEncryptionSet.EncryptionSetProperties.ActiveKey.KeyURL", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}}}}); err != nil { - return result, validation.NewError("compute.DiskEncryptionSetsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, diskEncryptionSetName, diskEncryptionSet) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client DiskEncryptionSetsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, diskEncryptionSet DiskEncryptionSet) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diskEncryptionSetName": autorest.Encode("path", diskEncryptionSetName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-11-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.Compute/diskEncryptionSets/{diskEncryptionSetName}", pathParameters), - autorest.WithJSON(diskEncryptionSet), - 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 DiskEncryptionSetsClient) CreateOrUpdateSender(req *http.Request) (future DiskEncryptionSetsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client DiskEncryptionSetsClient) CreateOrUpdateResponder(resp *http.Response) (result DiskEncryptionSet, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a disk encryption set. -// Parameters: -// resourceGroupName - the name of the resource group. -// diskEncryptionSetName - the name of the disk encryption set that is being created. The name can't be changed -// after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The -// maximum name length is 80 characters. -func (client DiskEncryptionSetsClient) Delete(ctx context.Context, resourceGroupName string, diskEncryptionSetName string) (result DiskEncryptionSetsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, diskEncryptionSetName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client DiskEncryptionSetsClient) DeletePreparer(ctx context.Context, resourceGroupName string, diskEncryptionSetName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diskEncryptionSetName": autorest.Encode("path", diskEncryptionSetName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-11-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.Compute/diskEncryptionSets/{diskEncryptionSetName}", 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 DiskEncryptionSetsClient) DeleteSender(req *http.Request) (future DiskEncryptionSetsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client DiskEncryptionSetsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets information about a disk encryption set. -// Parameters: -// resourceGroupName - the name of the resource group. -// diskEncryptionSetName - the name of the disk encryption set that is being created. The name can't be changed -// after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The -// maximum name length is 80 characters. -func (client DiskEncryptionSetsClient) Get(ctx context.Context, resourceGroupName string, diskEncryptionSetName string) (result DiskEncryptionSet, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, diskEncryptionSetName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client DiskEncryptionSetsClient) GetPreparer(ctx context.Context, resourceGroupName string, diskEncryptionSetName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diskEncryptionSetName": autorest.Encode("path", diskEncryptionSetName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-11-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.Compute/diskEncryptionSets/{diskEncryptionSetName}", 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 DiskEncryptionSetsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client DiskEncryptionSetsClient) GetResponder(resp *http.Response) (result DiskEncryptionSet, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists all the disk encryption sets under a subscription. -func (client DiskEncryptionSetsClient) List(ctx context.Context) (result DiskEncryptionSetListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetsClient.List") - defer func() { - sc := -1 - if result.desl.Response.Response != nil { - sc = result.desl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.desl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "List", resp, "Failure sending request") - return - } - - result.desl, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "List", resp, "Failure responding to request") - return - } - if result.desl.hasNextLink() && result.desl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client DiskEncryptionSetsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-11-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/diskEncryptionSets", 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 DiskEncryptionSetsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client DiskEncryptionSetsClient) ListResponder(resp *http.Response) (result DiskEncryptionSetList, err error) { - err = autorest.Respond( - resp, - 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 DiskEncryptionSetsClient) listNextResults(ctx context.Context, lastResults DiskEncryptionSetList) (result DiskEncryptionSetList, err error) { - req, err := lastResults.diskEncryptionSetListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "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, "compute.DiskEncryptionSetsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client DiskEncryptionSetsClient) ListComplete(ctx context.Context) (result DiskEncryptionSetListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} - -// ListByResourceGroup lists all the disk encryption sets under a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client DiskEncryptionSetsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result DiskEncryptionSetListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.desl.Response.Response != nil { - sc = result.desl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.desl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.desl, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.desl.hasNextLink() && result.desl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client DiskEncryptionSetsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-11-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.Compute/diskEncryptionSets", pathParameters), - autorest.WithQueryParameters(queryParameters)) - 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 DiskEncryptionSetsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client DiskEncryptionSetsClient) ListByResourceGroupResponder(resp *http.Response) (result DiskEncryptionSetList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client DiskEncryptionSetsClient) listByResourceGroupNextResults(ctx context.Context, lastResults DiskEncryptionSetList) (result DiskEncryptionSetList, err error) { - req, err := lastResults.diskEncryptionSetListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client DiskEncryptionSetsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result DiskEncryptionSetListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// Update updates (patches) a disk encryption set. -// Parameters: -// resourceGroupName - the name of the resource group. -// diskEncryptionSetName - the name of the disk encryption set that is being created. The name can't be changed -// after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The -// maximum name length is 80 characters. -// diskEncryptionSet - disk encryption set object supplied in the body of the Patch disk encryption set -// operation. -func (client DiskEncryptionSetsClient) Update(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, diskEncryptionSet DiskEncryptionSetUpdate) (result DiskEncryptionSetsUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetsClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, diskEncryptionSetName, diskEncryptionSet) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client DiskEncryptionSetsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, diskEncryptionSet DiskEncryptionSetUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diskEncryptionSetName": autorest.Encode("path", diskEncryptionSetName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-11-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/diskEncryptionSets/{diskEncryptionSetName}", pathParameters), - autorest.WithJSON(diskEncryptionSet), - 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 DiskEncryptionSetsClient) UpdateSender(req *http.Request) (future DiskEncryptionSetsUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client DiskEncryptionSetsClient) UpdateResponder(resp *http.Response) (result DiskEncryptionSet, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - 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/2019-12-01/compute/disks.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/disks.go deleted file mode 100644 index d3c7af7f..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/disks.go +++ /dev/null @@ -1,774 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// DisksClient is the compute Client -type DisksClient struct { - BaseClient -} - -// NewDisksClient creates an instance of the DisksClient client. -func NewDisksClient(subscriptionID string) DisksClient { - return NewDisksClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewDisksClientWithBaseURI creates an instance of the DisksClient client using a custom endpoint. Use this when -// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewDisksClientWithBaseURI(baseURI string, subscriptionID string) DisksClient { - return DisksClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a disk. -// Parameters: -// resourceGroupName - the name of the resource group. -// diskName - 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 - 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 tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: disk, - Constraints: []validation.Constraint{{Target: "disk.DiskProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "disk.DiskProperties.CreationData", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "disk.DiskProperties.CreationData.ImageReference", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "disk.DiskProperties.CreationData.ImageReference.ID", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "disk.DiskProperties.CreationData.GalleryImageReference", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "disk.DiskProperties.CreationData.GalleryImageReference.ID", Name: validation.Null, Rule: true, Chain: nil}}}, - }}, - {Target: "disk.DiskProperties.EncryptionSettingsCollection", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "disk.DiskProperties.EncryptionSettingsCollection.Enabled", Name: validation.Null, Rule: true, Chain: nil}}}, - }}}}}); err != nil { - return result, validation.NewError("compute.DisksClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, diskName, disk) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client DisksClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, diskName string, disk Disk) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diskName": autorest.Encode("path", diskName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-11-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - disk.ManagedBy = nil - disk.ManagedByExtended = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}", pathParameters), - autorest.WithJSON(disk), - 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 DisksClient) CreateOrUpdateSender(req *http.Request) (future DisksCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client DisksClient) CreateOrUpdateResponder(resp *http.Response) (result Disk, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a disk. -// Parameters: -// resourceGroupName - the name of the resource group. -// diskName - 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) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, diskName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client DisksClient) DeletePreparer(ctx context.Context, resourceGroupName string, diskName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diskName": autorest.Encode("path", diskName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-11-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.Compute/disks/{diskName}", 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 DisksClient) DeleteSender(req *http.Request) (future DisksDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client DisksClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets information about a disk. -// Parameters: -// resourceGroupName - the name of the resource group. -// diskName - 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) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, diskName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.DisksClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client DisksClient) GetPreparer(ctx context.Context, resourceGroupName string, diskName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diskName": autorest.Encode("path", diskName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-11-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.Compute/disks/{diskName}", 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 DisksClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client DisksClient) GetResponder(resp *http.Response) (result Disk, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GrantAccess grants access to a disk. -// Parameters: -// resourceGroupName - the name of the resource group. -// diskName - 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 - 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 tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.GrantAccess") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - 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.NewError("compute.DisksClient", "GrantAccess", err.Error()) - } - - req, err := client.GrantAccessPreparer(ctx, resourceGroupName, diskName, grantAccessData) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "GrantAccess", nil, "Failure preparing request") - return - } - - result, err = client.GrantAccessSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "GrantAccess", result.Response(), "Failure sending request") - return - } - - return -} - -// GrantAccessPreparer prepares the GrantAccess request. -func (client DisksClient) GrantAccessPreparer(ctx context.Context, resourceGroupName string, diskName string, grantAccessData GrantAccessData) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diskName": autorest.Encode("path", diskName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-11-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.Compute/disks/{diskName}/beginGetAccess", pathParameters), - autorest.WithJSON(grantAccessData), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GrantAccessSender sends the GrantAccess request. The method will close the -// http.Response Body if it receives an error. -func (client DisksClient) GrantAccessSender(req *http.Request) (future DisksGrantAccessFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// GrantAccessResponder handles the response to the GrantAccess request. The method always -// closes the http.Response Body. -func (client DisksClient) GrantAccessResponder(resp *http.Response) (result AccessURI, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists all the disks under a subscription. -func (client DisksClient) List(ctx context.Context) (result DiskListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.List") - defer func() { - sc := -1 - if result.dl.Response.Response != nil { - sc = result.dl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.dl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.DisksClient", "List", resp, "Failure sending request") - return - } - - result.dl, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "List", resp, "Failure responding to request") - return - } - if result.dl.hasNextLink() && result.dl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client DisksClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-11-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/disks", 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 DisksClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client DisksClient) ListResponder(resp *http.Response) (result DiskList, err error) { - err = autorest.Respond( - resp, - 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 DisksClient) listNextResults(ctx context.Context, lastResults DiskList) (result DiskList, err error) { - req, err := lastResults.diskListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.DisksClient", "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, "compute.DisksClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client DisksClient) ListComplete(ctx context.Context) (result DiskListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} - -// ListByResourceGroup lists all the disks under a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client DisksClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result DiskListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.dl.Response.Response != nil { - sc = result.dl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.dl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.DisksClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.dl, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.dl.hasNextLink() && result.dl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client DisksClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-11-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.Compute/disks", pathParameters), - autorest.WithQueryParameters(queryParameters)) - 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 DisksClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client DisksClient) ListByResourceGroupResponder(resp *http.Response) (result DiskList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client DisksClient) listByResourceGroupNextResults(ctx context.Context, lastResults DiskList) (result DiskList, err error) { - req, err := lastResults.diskListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.DisksClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.DisksClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client DisksClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result DiskListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// RevokeAccess revokes access to a disk. -// Parameters: -// resourceGroupName - the name of the resource group. -// diskName - 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) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.RevokeAccess") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.RevokeAccessPreparer(ctx, resourceGroupName, diskName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "RevokeAccess", nil, "Failure preparing request") - return - } - - result, err = client.RevokeAccessSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "RevokeAccess", result.Response(), "Failure sending request") - return - } - - return -} - -// RevokeAccessPreparer prepares the RevokeAccess request. -func (client DisksClient) RevokeAccessPreparer(ctx context.Context, resourceGroupName string, diskName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diskName": autorest.Encode("path", diskName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-11-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.Compute/disks/{diskName}/endGetAccess", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RevokeAccessSender sends the RevokeAccess request. The method will close the -// http.Response Body if it receives an error. -func (client DisksClient) RevokeAccessSender(req *http.Request) (future DisksRevokeAccessFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// RevokeAccessResponder handles the response to the RevokeAccess request. The method always -// closes the http.Response Body. -func (client DisksClient) RevokeAccessResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Update updates (patches) a disk. -// Parameters: -// resourceGroupName - the name of the resource group. -// diskName - 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 - 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) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, diskName, disk) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client DisksClient) UpdatePreparer(ctx context.Context, resourceGroupName string, diskName string, disk DiskUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diskName": autorest.Encode("path", diskName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-11-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/disks/{diskName}", pathParameters), - autorest.WithJSON(disk), - 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 DisksClient) UpdateSender(req *http.Request) (future DisksUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client DisksClient) UpdateResponder(resp *http.Response) (result Disk, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - 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/2019-12-01/compute/enums.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/enums.go deleted file mode 100644 index e666bfc7..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/enums.go +++ /dev/null @@ -1,1393 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -// AccessLevel enumerates the values for access level. -type AccessLevel string - -const ( - // None ... - None AccessLevel = "None" - // Read ... - Read AccessLevel = "Read" - // Write ... - Write AccessLevel = "Write" -) - -// PossibleAccessLevelValues returns an array of possible values for the AccessLevel const type. -func PossibleAccessLevelValues() []AccessLevel { - return []AccessLevel{None, Read, Write} -} - -// AggregatedReplicationState enumerates the values for aggregated replication state. -type AggregatedReplicationState string - -const ( - // Completed ... - Completed AggregatedReplicationState = "Completed" - // Failed ... - Failed AggregatedReplicationState = "Failed" - // InProgress ... - InProgress AggregatedReplicationState = "InProgress" - // Unknown ... - Unknown AggregatedReplicationState = "Unknown" -) - -// PossibleAggregatedReplicationStateValues returns an array of possible values for the AggregatedReplicationState const type. -func PossibleAggregatedReplicationStateValues() []AggregatedReplicationState { - return []AggregatedReplicationState{Completed, Failed, InProgress, Unknown} -} - -// AvailabilitySetSkuTypes enumerates the values for availability set sku types. -type AvailabilitySetSkuTypes string - -const ( - // Aligned ... - Aligned AvailabilitySetSkuTypes = "Aligned" - // Classic ... - Classic AvailabilitySetSkuTypes = "Classic" -) - -// PossibleAvailabilitySetSkuTypesValues returns an array of possible values for the AvailabilitySetSkuTypes const type. -func PossibleAvailabilitySetSkuTypesValues() []AvailabilitySetSkuTypes { - return []AvailabilitySetSkuTypes{Aligned, Classic} -} - -// CachingTypes enumerates the values for caching types. -type CachingTypes string - -const ( - // CachingTypesNone ... - CachingTypesNone CachingTypes = "None" - // CachingTypesReadOnly ... - CachingTypesReadOnly CachingTypes = "ReadOnly" - // CachingTypesReadWrite ... - 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 - -const ( - // MicrosoftWindowsShellSetup ... - 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 - -const ( - // Custom ... - Custom ContainerServiceOrchestratorTypes = "Custom" - // DCOS ... - DCOS ContainerServiceOrchestratorTypes = "DCOS" - // Kubernetes ... - Kubernetes ContainerServiceOrchestratorTypes = "Kubernetes" - // Swarm ... - 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 - -const ( - // StandardA0 ... - StandardA0 ContainerServiceVMSizeTypes = "Standard_A0" - // StandardA1 ... - StandardA1 ContainerServiceVMSizeTypes = "Standard_A1" - // StandardA10 ... - StandardA10 ContainerServiceVMSizeTypes = "Standard_A10" - // StandardA11 ... - StandardA11 ContainerServiceVMSizeTypes = "Standard_A11" - // StandardA2 ... - StandardA2 ContainerServiceVMSizeTypes = "Standard_A2" - // StandardA3 ... - StandardA3 ContainerServiceVMSizeTypes = "Standard_A3" - // StandardA4 ... - StandardA4 ContainerServiceVMSizeTypes = "Standard_A4" - // StandardA5 ... - StandardA5 ContainerServiceVMSizeTypes = "Standard_A5" - // StandardA6 ... - StandardA6 ContainerServiceVMSizeTypes = "Standard_A6" - // StandardA7 ... - StandardA7 ContainerServiceVMSizeTypes = "Standard_A7" - // StandardA8 ... - StandardA8 ContainerServiceVMSizeTypes = "Standard_A8" - // StandardA9 ... - StandardA9 ContainerServiceVMSizeTypes = "Standard_A9" - // StandardD1 ... - StandardD1 ContainerServiceVMSizeTypes = "Standard_D1" - // StandardD11 ... - StandardD11 ContainerServiceVMSizeTypes = "Standard_D11" - // StandardD11V2 ... - StandardD11V2 ContainerServiceVMSizeTypes = "Standard_D11_v2" - // StandardD12 ... - StandardD12 ContainerServiceVMSizeTypes = "Standard_D12" - // StandardD12V2 ... - StandardD12V2 ContainerServiceVMSizeTypes = "Standard_D12_v2" - // StandardD13 ... - StandardD13 ContainerServiceVMSizeTypes = "Standard_D13" - // StandardD13V2 ... - StandardD13V2 ContainerServiceVMSizeTypes = "Standard_D13_v2" - // StandardD14 ... - StandardD14 ContainerServiceVMSizeTypes = "Standard_D14" - // StandardD14V2 ... - StandardD14V2 ContainerServiceVMSizeTypes = "Standard_D14_v2" - // StandardD1V2 ... - StandardD1V2 ContainerServiceVMSizeTypes = "Standard_D1_v2" - // StandardD2 ... - StandardD2 ContainerServiceVMSizeTypes = "Standard_D2" - // StandardD2V2 ... - StandardD2V2 ContainerServiceVMSizeTypes = "Standard_D2_v2" - // StandardD3 ... - StandardD3 ContainerServiceVMSizeTypes = "Standard_D3" - // StandardD3V2 ... - StandardD3V2 ContainerServiceVMSizeTypes = "Standard_D3_v2" - // StandardD4 ... - StandardD4 ContainerServiceVMSizeTypes = "Standard_D4" - // StandardD4V2 ... - StandardD4V2 ContainerServiceVMSizeTypes = "Standard_D4_v2" - // StandardD5V2 ... - StandardD5V2 ContainerServiceVMSizeTypes = "Standard_D5_v2" - // StandardDS1 ... - StandardDS1 ContainerServiceVMSizeTypes = "Standard_DS1" - // StandardDS11 ... - StandardDS11 ContainerServiceVMSizeTypes = "Standard_DS11" - // StandardDS12 ... - StandardDS12 ContainerServiceVMSizeTypes = "Standard_DS12" - // StandardDS13 ... - StandardDS13 ContainerServiceVMSizeTypes = "Standard_DS13" - // StandardDS14 ... - StandardDS14 ContainerServiceVMSizeTypes = "Standard_DS14" - // StandardDS2 ... - StandardDS2 ContainerServiceVMSizeTypes = "Standard_DS2" - // StandardDS3 ... - StandardDS3 ContainerServiceVMSizeTypes = "Standard_DS3" - // StandardDS4 ... - StandardDS4 ContainerServiceVMSizeTypes = "Standard_DS4" - // StandardG1 ... - StandardG1 ContainerServiceVMSizeTypes = "Standard_G1" - // StandardG2 ... - StandardG2 ContainerServiceVMSizeTypes = "Standard_G2" - // StandardG3 ... - StandardG3 ContainerServiceVMSizeTypes = "Standard_G3" - // StandardG4 ... - StandardG4 ContainerServiceVMSizeTypes = "Standard_G4" - // StandardG5 ... - StandardG5 ContainerServiceVMSizeTypes = "Standard_G5" - // StandardGS1 ... - StandardGS1 ContainerServiceVMSizeTypes = "Standard_GS1" - // StandardGS2 ... - StandardGS2 ContainerServiceVMSizeTypes = "Standard_GS2" - // StandardGS3 ... - StandardGS3 ContainerServiceVMSizeTypes = "Standard_GS3" - // StandardGS4 ... - StandardGS4 ContainerServiceVMSizeTypes = "Standard_GS4" - // StandardGS5 ... - 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} -} - -// DedicatedHostLicenseTypes enumerates the values for dedicated host license types. -type DedicatedHostLicenseTypes string - -const ( - // DedicatedHostLicenseTypesNone ... - DedicatedHostLicenseTypesNone DedicatedHostLicenseTypes = "None" - // DedicatedHostLicenseTypesWindowsServerHybrid ... - DedicatedHostLicenseTypesWindowsServerHybrid DedicatedHostLicenseTypes = "Windows_Server_Hybrid" - // DedicatedHostLicenseTypesWindowsServerPerpetual ... - DedicatedHostLicenseTypesWindowsServerPerpetual DedicatedHostLicenseTypes = "Windows_Server_Perpetual" -) - -// PossibleDedicatedHostLicenseTypesValues returns an array of possible values for the DedicatedHostLicenseTypes const type. -func PossibleDedicatedHostLicenseTypesValues() []DedicatedHostLicenseTypes { - return []DedicatedHostLicenseTypes{DedicatedHostLicenseTypesNone, DedicatedHostLicenseTypesWindowsServerHybrid, DedicatedHostLicenseTypesWindowsServerPerpetual} -} - -// DiffDiskOptions enumerates the values for diff disk options. -type DiffDiskOptions string - -const ( - // Local ... - Local DiffDiskOptions = "Local" -) - -// PossibleDiffDiskOptionsValues returns an array of possible values for the DiffDiskOptions const type. -func PossibleDiffDiskOptionsValues() []DiffDiskOptions { - return []DiffDiskOptions{Local} -} - -// DiffDiskPlacement enumerates the values for diff disk placement. -type DiffDiskPlacement string - -const ( - // CacheDisk ... - CacheDisk DiffDiskPlacement = "CacheDisk" - // ResourceDisk ... - ResourceDisk DiffDiskPlacement = "ResourceDisk" -) - -// PossibleDiffDiskPlacementValues returns an array of possible values for the DiffDiskPlacement const type. -func PossibleDiffDiskPlacementValues() []DiffDiskPlacement { - return []DiffDiskPlacement{CacheDisk, ResourceDisk} -} - -// DiskCreateOption enumerates the values for disk create option. -type DiskCreateOption string - -const ( - // Attach Disk will be attached to a VM. - Attach DiskCreateOption = "Attach" - // Copy Create a new disk or snapshot by copying from a disk or snapshot specified by the given - // sourceResourceId. - Copy DiskCreateOption = "Copy" - // Empty Create an empty data disk of a size given by diskSizeGB. - Empty DiskCreateOption = "Empty" - // FromImage Create a new disk from a platform image specified by the given imageReference or - // galleryImageReference. - FromImage DiskCreateOption = "FromImage" - // Import Create a disk by importing from a blob specified by a sourceUri in a storage account specified by - // storageAccountId. - Import DiskCreateOption = "Import" - // Restore Create a new disk by copying from a backup recovery point. - Restore DiskCreateOption = "Restore" - // Upload Create a new disk by obtaining a write token and using it to directly upload the contents of the - // disk. - Upload DiskCreateOption = "Upload" -) - -// PossibleDiskCreateOptionValues returns an array of possible values for the DiskCreateOption const type. -func PossibleDiskCreateOptionValues() []DiskCreateOption { - return []DiskCreateOption{Attach, Copy, Empty, FromImage, Import, Restore, Upload} -} - -// DiskCreateOptionTypes enumerates the values for disk create option types. -type DiskCreateOptionTypes string - -const ( - // DiskCreateOptionTypesAttach ... - DiskCreateOptionTypesAttach DiskCreateOptionTypes = "Attach" - // DiskCreateOptionTypesEmpty ... - DiskCreateOptionTypesEmpty DiskCreateOptionTypes = "Empty" - // DiskCreateOptionTypesFromImage ... - DiskCreateOptionTypesFromImage DiskCreateOptionTypes = "FromImage" -) - -// PossibleDiskCreateOptionTypesValues returns an array of possible values for the DiskCreateOptionTypes const type. -func PossibleDiskCreateOptionTypesValues() []DiskCreateOptionTypes { - return []DiskCreateOptionTypes{DiskCreateOptionTypesAttach, DiskCreateOptionTypesEmpty, DiskCreateOptionTypesFromImage} -} - -// DiskEncryptionSetIdentityType enumerates the values for disk encryption set identity type. -type DiskEncryptionSetIdentityType string - -const ( - // SystemAssigned ... - SystemAssigned DiskEncryptionSetIdentityType = "SystemAssigned" -) - -// PossibleDiskEncryptionSetIdentityTypeValues returns an array of possible values for the DiskEncryptionSetIdentityType const type. -func PossibleDiskEncryptionSetIdentityTypeValues() []DiskEncryptionSetIdentityType { - return []DiskEncryptionSetIdentityType{SystemAssigned} -} - -// DiskState enumerates the values for disk state. -type DiskState string - -const ( - // ActiveSAS The disk currently has an Active SAS Uri associated with it. - ActiveSAS DiskState = "ActiveSAS" - // ActiveUpload A disk is created for upload and a write token has been issued for uploading to it. - ActiveUpload DiskState = "ActiveUpload" - // Attached The disk is currently mounted to a running VM. - Attached DiskState = "Attached" - // ReadyToUpload A disk is ready to be created by upload by requesting a write token. - ReadyToUpload DiskState = "ReadyToUpload" - // Reserved The disk is mounted to a stopped-deallocated VM - Reserved DiskState = "Reserved" - // Unattached The disk is not being used and can be attached to a VM. - Unattached DiskState = "Unattached" -) - -// PossibleDiskStateValues returns an array of possible values for the DiskState const type. -func PossibleDiskStateValues() []DiskState { - return []DiskState{ActiveSAS, ActiveUpload, Attached, ReadyToUpload, Reserved, Unattached} -} - -// DiskStorageAccountTypes enumerates the values for disk storage account types. -type DiskStorageAccountTypes string - -const ( - // PremiumLRS Premium SSD locally redundant storage. Best for production and performance sensitive - // workloads. - PremiumLRS DiskStorageAccountTypes = "Premium_LRS" - // StandardLRS Standard HDD locally redundant storage. Best for backup, non-critical, and infrequent - // access. - StandardLRS DiskStorageAccountTypes = "Standard_LRS" - // StandardSSDLRS Standard SSD locally redundant storage. Best for web servers, lightly used enterprise - // applications and dev/test. - StandardSSDLRS DiskStorageAccountTypes = "StandardSSD_LRS" - // UltraSSDLRS Ultra SSD locally redundant storage. Best for IO-intensive workloads such as SAP HANA, top - // tier databases (for example, SQL, Oracle), and other transaction-heavy workloads. - UltraSSDLRS DiskStorageAccountTypes = "UltraSSD_LRS" -) - -// PossibleDiskStorageAccountTypesValues returns an array of possible values for the DiskStorageAccountTypes const type. -func PossibleDiskStorageAccountTypesValues() []DiskStorageAccountTypes { - return []DiskStorageAccountTypes{PremiumLRS, StandardLRS, StandardSSDLRS, UltraSSDLRS} -} - -// EncryptionType enumerates the values for encryption type. -type EncryptionType string - -const ( - // EncryptionAtRestWithCustomerKey Disk is encrypted with Customer managed key at rest. - EncryptionAtRestWithCustomerKey EncryptionType = "EncryptionAtRestWithCustomerKey" - // EncryptionAtRestWithPlatformKey Disk is encrypted with XStore managed key at rest. It is the default - // encryption type. - EncryptionAtRestWithPlatformKey EncryptionType = "EncryptionAtRestWithPlatformKey" -) - -// PossibleEncryptionTypeValues returns an array of possible values for the EncryptionType const type. -func PossibleEncryptionTypeValues() []EncryptionType { - return []EncryptionType{EncryptionAtRestWithCustomerKey, EncryptionAtRestWithPlatformKey} -} - -// HostCaching enumerates the values for host caching. -type HostCaching string - -const ( - // HostCachingNone ... - HostCachingNone HostCaching = "None" - // HostCachingReadOnly ... - HostCachingReadOnly HostCaching = "ReadOnly" - // HostCachingReadWrite ... - HostCachingReadWrite HostCaching = "ReadWrite" -) - -// PossibleHostCachingValues returns an array of possible values for the HostCaching const type. -func PossibleHostCachingValues() []HostCaching { - return []HostCaching{HostCachingNone, HostCachingReadOnly, HostCachingReadWrite} -} - -// HyperVGeneration enumerates the values for hyper v generation. -type HyperVGeneration string - -const ( - // V1 ... - V1 HyperVGeneration = "V1" - // V2 ... - V2 HyperVGeneration = "V2" -) - -// PossibleHyperVGenerationValues returns an array of possible values for the HyperVGeneration const type. -func PossibleHyperVGenerationValues() []HyperVGeneration { - return []HyperVGeneration{V1, V2} -} - -// HyperVGenerationType enumerates the values for hyper v generation type. -type HyperVGenerationType string - -const ( - // HyperVGenerationTypeV1 ... - HyperVGenerationTypeV1 HyperVGenerationType = "V1" - // HyperVGenerationTypeV2 ... - HyperVGenerationTypeV2 HyperVGenerationType = "V2" -) - -// PossibleHyperVGenerationTypeValues returns an array of possible values for the HyperVGenerationType const type. -func PossibleHyperVGenerationTypeValues() []HyperVGenerationType { - return []HyperVGenerationType{HyperVGenerationTypeV1, HyperVGenerationTypeV2} -} - -// HyperVGenerationTypes enumerates the values for hyper v generation types. -type HyperVGenerationTypes string - -const ( - // HyperVGenerationTypesV1 ... - HyperVGenerationTypesV1 HyperVGenerationTypes = "V1" - // HyperVGenerationTypesV2 ... - HyperVGenerationTypesV2 HyperVGenerationTypes = "V2" -) - -// PossibleHyperVGenerationTypesValues returns an array of possible values for the HyperVGenerationTypes const type. -func PossibleHyperVGenerationTypesValues() []HyperVGenerationTypes { - return []HyperVGenerationTypes{HyperVGenerationTypesV1, HyperVGenerationTypesV2} -} - -// InstanceViewTypes enumerates the values for instance view types. -type InstanceViewTypes string - -const ( - // InstanceView ... - 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 - -const ( - // FiveMins ... - FiveMins IntervalInMins = "FiveMins" - // SixtyMins ... - SixtyMins IntervalInMins = "SixtyMins" - // ThirtyMins ... - ThirtyMins IntervalInMins = "ThirtyMins" - // ThreeMins ... - 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 - -const ( - // IPv4 ... - IPv4 IPVersion = "IPv4" - // IPv6 ... - 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 - -const ( - // MaintenanceOperationResultCodeTypesMaintenanceAborted ... - MaintenanceOperationResultCodeTypesMaintenanceAborted MaintenanceOperationResultCodeTypes = "MaintenanceAborted" - // MaintenanceOperationResultCodeTypesMaintenanceCompleted ... - MaintenanceOperationResultCodeTypesMaintenanceCompleted MaintenanceOperationResultCodeTypes = "MaintenanceCompleted" - // MaintenanceOperationResultCodeTypesNone ... - MaintenanceOperationResultCodeTypesNone MaintenanceOperationResultCodeTypes = "None" - // MaintenanceOperationResultCodeTypesRetryLater ... - 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 - -const ( - // Generalized Generalized image. Needs to be provisioned during deployment time. - Generalized OperatingSystemStateTypes = "Generalized" - // Specialized Specialized image. Contains already provisioned OS Disk. - 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 - -const ( - // Linux ... - Linux OperatingSystemTypes = "Linux" - // Windows ... - Windows OperatingSystemTypes = "Windows" -) - -// PossibleOperatingSystemTypesValues returns an array of possible values for the OperatingSystemTypes const type. -func PossibleOperatingSystemTypesValues() []OperatingSystemTypes { - return []OperatingSystemTypes{Linux, Windows} -} - -// OrchestrationServiceNames enumerates the values for orchestration service names. -type OrchestrationServiceNames string - -const ( - // AutomaticRepairs ... - AutomaticRepairs OrchestrationServiceNames = "AutomaticRepairs" -) - -// PossibleOrchestrationServiceNamesValues returns an array of possible values for the OrchestrationServiceNames const type. -func PossibleOrchestrationServiceNamesValues() []OrchestrationServiceNames { - return []OrchestrationServiceNames{AutomaticRepairs} -} - -// OrchestrationServiceState enumerates the values for orchestration service state. -type OrchestrationServiceState string - -const ( - // NotRunning ... - NotRunning OrchestrationServiceState = "NotRunning" - // Running ... - Running OrchestrationServiceState = "Running" - // Suspended ... - Suspended OrchestrationServiceState = "Suspended" -) - -// PossibleOrchestrationServiceStateValues returns an array of possible values for the OrchestrationServiceState const type. -func PossibleOrchestrationServiceStateValues() []OrchestrationServiceState { - return []OrchestrationServiceState{NotRunning, Running, Suspended} -} - -// OrchestrationServiceStateAction enumerates the values for orchestration service state action. -type OrchestrationServiceStateAction string - -const ( - // Resume ... - Resume OrchestrationServiceStateAction = "Resume" - // Suspend ... - Suspend OrchestrationServiceStateAction = "Suspend" -) - -// PossibleOrchestrationServiceStateActionValues returns an array of possible values for the OrchestrationServiceStateAction const type. -func PossibleOrchestrationServiceStateActionValues() []OrchestrationServiceStateAction { - return []OrchestrationServiceStateAction{Resume, Suspend} -} - -// PassNames enumerates the values for pass names. -type PassNames string - -const ( - // OobeSystem ... - 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 - -const ( - // HTTP ... - HTTP ProtocolTypes = "Http" - // HTTPS ... - HTTPS ProtocolTypes = "Https" -) - -// PossibleProtocolTypesValues returns an array of possible values for the ProtocolTypes const type. -func PossibleProtocolTypesValues() []ProtocolTypes { - return []ProtocolTypes{HTTP, HTTPS} -} - -// ProvisioningState enumerates the values for provisioning state. -type ProvisioningState string - -const ( - // ProvisioningStateCreating ... - ProvisioningStateCreating ProvisioningState = "Creating" - // ProvisioningStateDeleting ... - ProvisioningStateDeleting ProvisioningState = "Deleting" - // ProvisioningStateFailed ... - ProvisioningStateFailed ProvisioningState = "Failed" - // ProvisioningStateMigrating ... - ProvisioningStateMigrating ProvisioningState = "Migrating" - // ProvisioningStateSucceeded ... - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - // ProvisioningStateUpdating ... - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. -func PossibleProvisioningStateValues() []ProvisioningState { - return []ProvisioningState{ProvisioningStateCreating, ProvisioningStateDeleting, ProvisioningStateFailed, ProvisioningStateMigrating, ProvisioningStateSucceeded, ProvisioningStateUpdating} -} - -// ProvisioningState1 enumerates the values for provisioning state 1. -type ProvisioningState1 string - -const ( - // ProvisioningState1Creating ... - ProvisioningState1Creating ProvisioningState1 = "Creating" - // ProvisioningState1Deleting ... - ProvisioningState1Deleting ProvisioningState1 = "Deleting" - // ProvisioningState1Failed ... - ProvisioningState1Failed ProvisioningState1 = "Failed" - // ProvisioningState1Migrating ... - ProvisioningState1Migrating ProvisioningState1 = "Migrating" - // ProvisioningState1Succeeded ... - ProvisioningState1Succeeded ProvisioningState1 = "Succeeded" - // ProvisioningState1Updating ... - ProvisioningState1Updating ProvisioningState1 = "Updating" -) - -// PossibleProvisioningState1Values returns an array of possible values for the ProvisioningState1 const type. -func PossibleProvisioningState1Values() []ProvisioningState1 { - return []ProvisioningState1{ProvisioningState1Creating, ProvisioningState1Deleting, ProvisioningState1Failed, ProvisioningState1Migrating, ProvisioningState1Succeeded, ProvisioningState1Updating} -} - -// ProvisioningState2 enumerates the values for provisioning state 2. -type ProvisioningState2 string - -const ( - // ProvisioningState2Creating ... - ProvisioningState2Creating ProvisioningState2 = "Creating" - // ProvisioningState2Deleting ... - ProvisioningState2Deleting ProvisioningState2 = "Deleting" - // ProvisioningState2Failed ... - ProvisioningState2Failed ProvisioningState2 = "Failed" - // ProvisioningState2Migrating ... - ProvisioningState2Migrating ProvisioningState2 = "Migrating" - // ProvisioningState2Succeeded ... - ProvisioningState2Succeeded ProvisioningState2 = "Succeeded" - // ProvisioningState2Updating ... - ProvisioningState2Updating ProvisioningState2 = "Updating" -) - -// PossibleProvisioningState2Values returns an array of possible values for the ProvisioningState2 const type. -func PossibleProvisioningState2Values() []ProvisioningState2 { - return []ProvisioningState2{ProvisioningState2Creating, ProvisioningState2Deleting, ProvisioningState2Failed, ProvisioningState2Migrating, ProvisioningState2Succeeded, ProvisioningState2Updating} -} - -// ProvisioningState3 enumerates the values for provisioning state 3. -type ProvisioningState3 string - -const ( - // ProvisioningState3Creating ... - ProvisioningState3Creating ProvisioningState3 = "Creating" - // ProvisioningState3Deleting ... - ProvisioningState3Deleting ProvisioningState3 = "Deleting" - // ProvisioningState3Failed ... - ProvisioningState3Failed ProvisioningState3 = "Failed" - // ProvisioningState3Migrating ... - ProvisioningState3Migrating ProvisioningState3 = "Migrating" - // ProvisioningState3Succeeded ... - ProvisioningState3Succeeded ProvisioningState3 = "Succeeded" - // ProvisioningState3Updating ... - ProvisioningState3Updating ProvisioningState3 = "Updating" -) - -// PossibleProvisioningState3Values returns an array of possible values for the ProvisioningState3 const type. -func PossibleProvisioningState3Values() []ProvisioningState3 { - return []ProvisioningState3{ProvisioningState3Creating, ProvisioningState3Deleting, ProvisioningState3Failed, ProvisioningState3Migrating, ProvisioningState3Succeeded, ProvisioningState3Updating} -} - -// ProximityPlacementGroupType enumerates the values for proximity placement group type. -type ProximityPlacementGroupType string - -const ( - // Standard ... - Standard ProximityPlacementGroupType = "Standard" - // Ultra ... - Ultra ProximityPlacementGroupType = "Ultra" -) - -// PossibleProximityPlacementGroupTypeValues returns an array of possible values for the ProximityPlacementGroupType const type. -func PossibleProximityPlacementGroupTypeValues() []ProximityPlacementGroupType { - return []ProximityPlacementGroupType{Standard, Ultra} -} - -// ReplicationState enumerates the values for replication state. -type ReplicationState string - -const ( - // ReplicationStateCompleted ... - ReplicationStateCompleted ReplicationState = "Completed" - // ReplicationStateFailed ... - ReplicationStateFailed ReplicationState = "Failed" - // ReplicationStateReplicating ... - ReplicationStateReplicating ReplicationState = "Replicating" - // ReplicationStateUnknown ... - ReplicationStateUnknown ReplicationState = "Unknown" -) - -// PossibleReplicationStateValues returns an array of possible values for the ReplicationState const type. -func PossibleReplicationStateValues() []ReplicationState { - return []ReplicationState{ReplicationStateCompleted, ReplicationStateFailed, ReplicationStateReplicating, ReplicationStateUnknown} -} - -// ReplicationStatusTypes enumerates the values for replication status types. -type ReplicationStatusTypes string - -const ( - // ReplicationStatusTypesReplicationStatus ... - ReplicationStatusTypesReplicationStatus ReplicationStatusTypes = "ReplicationStatus" -) - -// PossibleReplicationStatusTypesValues returns an array of possible values for the ReplicationStatusTypes const type. -func PossibleReplicationStatusTypesValues() []ReplicationStatusTypes { - return []ReplicationStatusTypes{ReplicationStatusTypesReplicationStatus} -} - -// ResourceIdentityType enumerates the values for resource identity type. -type ResourceIdentityType string - -const ( - // ResourceIdentityTypeNone ... - ResourceIdentityTypeNone ResourceIdentityType = "None" - // ResourceIdentityTypeSystemAssigned ... - ResourceIdentityTypeSystemAssigned ResourceIdentityType = "SystemAssigned" - // ResourceIdentityTypeSystemAssignedUserAssigned ... - ResourceIdentityTypeSystemAssignedUserAssigned ResourceIdentityType = "SystemAssigned, UserAssigned" - // ResourceIdentityTypeUserAssigned ... - 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 - -const ( - // ResourceSkuCapacityScaleTypeAutomatic ... - ResourceSkuCapacityScaleTypeAutomatic ResourceSkuCapacityScaleType = "Automatic" - // ResourceSkuCapacityScaleTypeManual ... - ResourceSkuCapacityScaleTypeManual ResourceSkuCapacityScaleType = "Manual" - // ResourceSkuCapacityScaleTypeNone ... - 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 - -const ( - // NotAvailableForSubscription ... - NotAvailableForSubscription ResourceSkuRestrictionsReasonCode = "NotAvailableForSubscription" - // QuotaID ... - 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 - -const ( - // Location ... - Location ResourceSkuRestrictionsType = "Location" - // Zone ... - 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 - -const ( - // Cancel ... - Cancel RollingUpgradeActionType = "Cancel" - // Start ... - 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 - -const ( - // RollingUpgradeStatusCodeCancelled ... - RollingUpgradeStatusCodeCancelled RollingUpgradeStatusCode = "Cancelled" - // RollingUpgradeStatusCodeCompleted ... - RollingUpgradeStatusCodeCompleted RollingUpgradeStatusCode = "Completed" - // RollingUpgradeStatusCodeFaulted ... - RollingUpgradeStatusCodeFaulted RollingUpgradeStatusCode = "Faulted" - // RollingUpgradeStatusCodeRollingForward ... - RollingUpgradeStatusCodeRollingForward RollingUpgradeStatusCode = "RollingForward" -) - -// PossibleRollingUpgradeStatusCodeValues returns an array of possible values for the RollingUpgradeStatusCode const type. -func PossibleRollingUpgradeStatusCodeValues() []RollingUpgradeStatusCode { - return []RollingUpgradeStatusCode{RollingUpgradeStatusCodeCancelled, RollingUpgradeStatusCodeCompleted, RollingUpgradeStatusCodeFaulted, RollingUpgradeStatusCodeRollingForward} -} - -// SettingNames enumerates the values for setting names. -type SettingNames string - -const ( - // AutoLogon ... - AutoLogon SettingNames = "AutoLogon" - // FirstLogonCommands ... - FirstLogonCommands SettingNames = "FirstLogonCommands" -) - -// PossibleSettingNamesValues returns an array of possible values for the SettingNames const type. -func PossibleSettingNamesValues() []SettingNames { - return []SettingNames{AutoLogon, FirstLogonCommands} -} - -// SnapshotStorageAccountTypes enumerates the values for snapshot storage account types. -type SnapshotStorageAccountTypes string - -const ( - // SnapshotStorageAccountTypesPremiumLRS Premium SSD locally redundant storage - SnapshotStorageAccountTypesPremiumLRS SnapshotStorageAccountTypes = "Premium_LRS" - // SnapshotStorageAccountTypesStandardLRS Standard HDD locally redundant storage - SnapshotStorageAccountTypesStandardLRS SnapshotStorageAccountTypes = "Standard_LRS" - // SnapshotStorageAccountTypesStandardZRS Standard zone redundant storage - SnapshotStorageAccountTypesStandardZRS SnapshotStorageAccountTypes = "Standard_ZRS" -) - -// PossibleSnapshotStorageAccountTypesValues returns an array of possible values for the SnapshotStorageAccountTypes const type. -func PossibleSnapshotStorageAccountTypesValues() []SnapshotStorageAccountTypes { - return []SnapshotStorageAccountTypes{SnapshotStorageAccountTypesPremiumLRS, SnapshotStorageAccountTypesStandardLRS, SnapshotStorageAccountTypesStandardZRS} -} - -// StatusLevelTypes enumerates the values for status level types. -type StatusLevelTypes string - -const ( - // Error ... - Error StatusLevelTypes = "Error" - // Info ... - Info StatusLevelTypes = "Info" - // Warning ... - Warning StatusLevelTypes = "Warning" -) - -// PossibleStatusLevelTypesValues returns an array of possible values for the StatusLevelTypes const type. -func PossibleStatusLevelTypesValues() []StatusLevelTypes { - return []StatusLevelTypes{Error, Info, Warning} -} - -// StorageAccountType enumerates the values for storage account type. -type StorageAccountType string - -const ( - // StorageAccountTypePremiumLRS ... - StorageAccountTypePremiumLRS StorageAccountType = "Premium_LRS" - // StorageAccountTypeStandardLRS ... - StorageAccountTypeStandardLRS StorageAccountType = "Standard_LRS" - // StorageAccountTypeStandardZRS ... - StorageAccountTypeStandardZRS StorageAccountType = "Standard_ZRS" -) - -// PossibleStorageAccountTypeValues returns an array of possible values for the StorageAccountType const type. -func PossibleStorageAccountTypeValues() []StorageAccountType { - return []StorageAccountType{StorageAccountTypePremiumLRS, StorageAccountTypeStandardLRS, StorageAccountTypeStandardZRS} -} - -// StorageAccountTypes enumerates the values for storage account types. -type StorageAccountTypes string - -const ( - // StorageAccountTypesPremiumLRS ... - StorageAccountTypesPremiumLRS StorageAccountTypes = "Premium_LRS" - // StorageAccountTypesStandardLRS ... - StorageAccountTypesStandardLRS StorageAccountTypes = "Standard_LRS" - // StorageAccountTypesStandardSSDLRS ... - StorageAccountTypesStandardSSDLRS StorageAccountTypes = "StandardSSD_LRS" - // StorageAccountTypesUltraSSDLRS ... - StorageAccountTypesUltraSSDLRS StorageAccountTypes = "UltraSSD_LRS" -) - -// PossibleStorageAccountTypesValues returns an array of possible values for the StorageAccountTypes const type. -func PossibleStorageAccountTypesValues() []StorageAccountTypes { - return []StorageAccountTypes{StorageAccountTypesPremiumLRS, StorageAccountTypesStandardLRS, StorageAccountTypesStandardSSDLRS, StorageAccountTypesUltraSSDLRS} -} - -// UpgradeMode enumerates the values for upgrade mode. -type UpgradeMode string - -const ( - // Automatic ... - Automatic UpgradeMode = "Automatic" - // Manual ... - Manual UpgradeMode = "Manual" - // Rolling ... - Rolling UpgradeMode = "Rolling" -) - -// PossibleUpgradeModeValues returns an array of possible values for the UpgradeMode const type. -func PossibleUpgradeModeValues() []UpgradeMode { - return []UpgradeMode{Automatic, Manual, Rolling} -} - -// UpgradeOperationInvoker enumerates the values for upgrade operation invoker. -type UpgradeOperationInvoker string - -const ( - // UpgradeOperationInvokerPlatform ... - UpgradeOperationInvokerPlatform UpgradeOperationInvoker = "Platform" - // UpgradeOperationInvokerUnknown ... - UpgradeOperationInvokerUnknown UpgradeOperationInvoker = "Unknown" - // UpgradeOperationInvokerUser ... - UpgradeOperationInvokerUser UpgradeOperationInvoker = "User" -) - -// PossibleUpgradeOperationInvokerValues returns an array of possible values for the UpgradeOperationInvoker const type. -func PossibleUpgradeOperationInvokerValues() []UpgradeOperationInvoker { - return []UpgradeOperationInvoker{UpgradeOperationInvokerPlatform, UpgradeOperationInvokerUnknown, UpgradeOperationInvokerUser} -} - -// UpgradeState enumerates the values for upgrade state. -type UpgradeState string - -const ( - // UpgradeStateCancelled ... - UpgradeStateCancelled UpgradeState = "Cancelled" - // UpgradeStateCompleted ... - UpgradeStateCompleted UpgradeState = "Completed" - // UpgradeStateFaulted ... - UpgradeStateFaulted UpgradeState = "Faulted" - // UpgradeStateRollingForward ... - UpgradeStateRollingForward UpgradeState = "RollingForward" -) - -// PossibleUpgradeStateValues returns an array of possible values for the UpgradeState const type. -func PossibleUpgradeStateValues() []UpgradeState { - return []UpgradeState{UpgradeStateCancelled, UpgradeStateCompleted, UpgradeStateFaulted, UpgradeStateRollingForward} -} - -// VirtualMachineEvictionPolicyTypes enumerates the values for virtual machine eviction policy types. -type VirtualMachineEvictionPolicyTypes string - -const ( - // Deallocate ... - Deallocate VirtualMachineEvictionPolicyTypes = "Deallocate" - // Delete ... - Delete VirtualMachineEvictionPolicyTypes = "Delete" -) - -// PossibleVirtualMachineEvictionPolicyTypesValues returns an array of possible values for the VirtualMachineEvictionPolicyTypes const type. -func PossibleVirtualMachineEvictionPolicyTypesValues() []VirtualMachineEvictionPolicyTypes { - return []VirtualMachineEvictionPolicyTypes{Deallocate, Delete} -} - -// VirtualMachinePriorityTypes enumerates the values for virtual machine priority types. -type VirtualMachinePriorityTypes string - -const ( - // Low ... - Low VirtualMachinePriorityTypes = "Low" - // Regular ... - Regular VirtualMachinePriorityTypes = "Regular" - // Spot ... - Spot VirtualMachinePriorityTypes = "Spot" -) - -// PossibleVirtualMachinePriorityTypesValues returns an array of possible values for the VirtualMachinePriorityTypes const type. -func PossibleVirtualMachinePriorityTypesValues() []VirtualMachinePriorityTypes { - return []VirtualMachinePriorityTypes{Low, Regular, Spot} -} - -// VirtualMachineScaleSetScaleInRules enumerates the values for virtual machine scale set scale in rules. -type VirtualMachineScaleSetScaleInRules string - -const ( - // Default ... - Default VirtualMachineScaleSetScaleInRules = "Default" - // NewestVM ... - NewestVM VirtualMachineScaleSetScaleInRules = "NewestVM" - // OldestVM ... - OldestVM VirtualMachineScaleSetScaleInRules = "OldestVM" -) - -// PossibleVirtualMachineScaleSetScaleInRulesValues returns an array of possible values for the VirtualMachineScaleSetScaleInRules const type. -func PossibleVirtualMachineScaleSetScaleInRulesValues() []VirtualMachineScaleSetScaleInRules { - return []VirtualMachineScaleSetScaleInRules{Default, NewestVM, OldestVM} -} - -// VirtualMachineScaleSetSkuScaleType enumerates the values for virtual machine scale set sku scale type. -type VirtualMachineScaleSetSkuScaleType string - -const ( - // VirtualMachineScaleSetSkuScaleTypeAutomatic ... - VirtualMachineScaleSetSkuScaleTypeAutomatic VirtualMachineScaleSetSkuScaleType = "Automatic" - // VirtualMachineScaleSetSkuScaleTypeNone ... - 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 - -const ( - // VirtualMachineSizeTypesBasicA0 ... - VirtualMachineSizeTypesBasicA0 VirtualMachineSizeTypes = "Basic_A0" - // VirtualMachineSizeTypesBasicA1 ... - VirtualMachineSizeTypesBasicA1 VirtualMachineSizeTypes = "Basic_A1" - // VirtualMachineSizeTypesBasicA2 ... - VirtualMachineSizeTypesBasicA2 VirtualMachineSizeTypes = "Basic_A2" - // VirtualMachineSizeTypesBasicA3 ... - VirtualMachineSizeTypesBasicA3 VirtualMachineSizeTypes = "Basic_A3" - // VirtualMachineSizeTypesBasicA4 ... - VirtualMachineSizeTypesBasicA4 VirtualMachineSizeTypes = "Basic_A4" - // VirtualMachineSizeTypesStandardA0 ... - VirtualMachineSizeTypesStandardA0 VirtualMachineSizeTypes = "Standard_A0" - // VirtualMachineSizeTypesStandardA1 ... - VirtualMachineSizeTypesStandardA1 VirtualMachineSizeTypes = "Standard_A1" - // VirtualMachineSizeTypesStandardA10 ... - VirtualMachineSizeTypesStandardA10 VirtualMachineSizeTypes = "Standard_A10" - // VirtualMachineSizeTypesStandardA11 ... - VirtualMachineSizeTypesStandardA11 VirtualMachineSizeTypes = "Standard_A11" - // VirtualMachineSizeTypesStandardA1V2 ... - VirtualMachineSizeTypesStandardA1V2 VirtualMachineSizeTypes = "Standard_A1_v2" - // VirtualMachineSizeTypesStandardA2 ... - VirtualMachineSizeTypesStandardA2 VirtualMachineSizeTypes = "Standard_A2" - // VirtualMachineSizeTypesStandardA2mV2 ... - VirtualMachineSizeTypesStandardA2mV2 VirtualMachineSizeTypes = "Standard_A2m_v2" - // VirtualMachineSizeTypesStandardA2V2 ... - VirtualMachineSizeTypesStandardA2V2 VirtualMachineSizeTypes = "Standard_A2_v2" - // VirtualMachineSizeTypesStandardA3 ... - VirtualMachineSizeTypesStandardA3 VirtualMachineSizeTypes = "Standard_A3" - // VirtualMachineSizeTypesStandardA4 ... - VirtualMachineSizeTypesStandardA4 VirtualMachineSizeTypes = "Standard_A4" - // VirtualMachineSizeTypesStandardA4mV2 ... - VirtualMachineSizeTypesStandardA4mV2 VirtualMachineSizeTypes = "Standard_A4m_v2" - // VirtualMachineSizeTypesStandardA4V2 ... - VirtualMachineSizeTypesStandardA4V2 VirtualMachineSizeTypes = "Standard_A4_v2" - // VirtualMachineSizeTypesStandardA5 ... - VirtualMachineSizeTypesStandardA5 VirtualMachineSizeTypes = "Standard_A5" - // VirtualMachineSizeTypesStandardA6 ... - VirtualMachineSizeTypesStandardA6 VirtualMachineSizeTypes = "Standard_A6" - // VirtualMachineSizeTypesStandardA7 ... - VirtualMachineSizeTypesStandardA7 VirtualMachineSizeTypes = "Standard_A7" - // VirtualMachineSizeTypesStandardA8 ... - VirtualMachineSizeTypesStandardA8 VirtualMachineSizeTypes = "Standard_A8" - // VirtualMachineSizeTypesStandardA8mV2 ... - VirtualMachineSizeTypesStandardA8mV2 VirtualMachineSizeTypes = "Standard_A8m_v2" - // VirtualMachineSizeTypesStandardA8V2 ... - VirtualMachineSizeTypesStandardA8V2 VirtualMachineSizeTypes = "Standard_A8_v2" - // VirtualMachineSizeTypesStandardA9 ... - VirtualMachineSizeTypesStandardA9 VirtualMachineSizeTypes = "Standard_A9" - // VirtualMachineSizeTypesStandardB1ms ... - VirtualMachineSizeTypesStandardB1ms VirtualMachineSizeTypes = "Standard_B1ms" - // VirtualMachineSizeTypesStandardB1s ... - VirtualMachineSizeTypesStandardB1s VirtualMachineSizeTypes = "Standard_B1s" - // VirtualMachineSizeTypesStandardB2ms ... - VirtualMachineSizeTypesStandardB2ms VirtualMachineSizeTypes = "Standard_B2ms" - // VirtualMachineSizeTypesStandardB2s ... - VirtualMachineSizeTypesStandardB2s VirtualMachineSizeTypes = "Standard_B2s" - // VirtualMachineSizeTypesStandardB4ms ... - VirtualMachineSizeTypesStandardB4ms VirtualMachineSizeTypes = "Standard_B4ms" - // VirtualMachineSizeTypesStandardB8ms ... - VirtualMachineSizeTypesStandardB8ms VirtualMachineSizeTypes = "Standard_B8ms" - // VirtualMachineSizeTypesStandardD1 ... - VirtualMachineSizeTypesStandardD1 VirtualMachineSizeTypes = "Standard_D1" - // VirtualMachineSizeTypesStandardD11 ... - VirtualMachineSizeTypesStandardD11 VirtualMachineSizeTypes = "Standard_D11" - // VirtualMachineSizeTypesStandardD11V2 ... - VirtualMachineSizeTypesStandardD11V2 VirtualMachineSizeTypes = "Standard_D11_v2" - // VirtualMachineSizeTypesStandardD12 ... - VirtualMachineSizeTypesStandardD12 VirtualMachineSizeTypes = "Standard_D12" - // VirtualMachineSizeTypesStandardD12V2 ... - VirtualMachineSizeTypesStandardD12V2 VirtualMachineSizeTypes = "Standard_D12_v2" - // VirtualMachineSizeTypesStandardD13 ... - VirtualMachineSizeTypesStandardD13 VirtualMachineSizeTypes = "Standard_D13" - // VirtualMachineSizeTypesStandardD13V2 ... - VirtualMachineSizeTypesStandardD13V2 VirtualMachineSizeTypes = "Standard_D13_v2" - // VirtualMachineSizeTypesStandardD14 ... - VirtualMachineSizeTypesStandardD14 VirtualMachineSizeTypes = "Standard_D14" - // VirtualMachineSizeTypesStandardD14V2 ... - VirtualMachineSizeTypesStandardD14V2 VirtualMachineSizeTypes = "Standard_D14_v2" - // VirtualMachineSizeTypesStandardD15V2 ... - VirtualMachineSizeTypesStandardD15V2 VirtualMachineSizeTypes = "Standard_D15_v2" - // VirtualMachineSizeTypesStandardD16sV3 ... - VirtualMachineSizeTypesStandardD16sV3 VirtualMachineSizeTypes = "Standard_D16s_v3" - // VirtualMachineSizeTypesStandardD16V3 ... - VirtualMachineSizeTypesStandardD16V3 VirtualMachineSizeTypes = "Standard_D16_v3" - // VirtualMachineSizeTypesStandardD1V2 ... - VirtualMachineSizeTypesStandardD1V2 VirtualMachineSizeTypes = "Standard_D1_v2" - // VirtualMachineSizeTypesStandardD2 ... - VirtualMachineSizeTypesStandardD2 VirtualMachineSizeTypes = "Standard_D2" - // VirtualMachineSizeTypesStandardD2sV3 ... - VirtualMachineSizeTypesStandardD2sV3 VirtualMachineSizeTypes = "Standard_D2s_v3" - // VirtualMachineSizeTypesStandardD2V2 ... - VirtualMachineSizeTypesStandardD2V2 VirtualMachineSizeTypes = "Standard_D2_v2" - // VirtualMachineSizeTypesStandardD2V3 ... - VirtualMachineSizeTypesStandardD2V3 VirtualMachineSizeTypes = "Standard_D2_v3" - // VirtualMachineSizeTypesStandardD3 ... - VirtualMachineSizeTypesStandardD3 VirtualMachineSizeTypes = "Standard_D3" - // VirtualMachineSizeTypesStandardD32sV3 ... - VirtualMachineSizeTypesStandardD32sV3 VirtualMachineSizeTypes = "Standard_D32s_v3" - // VirtualMachineSizeTypesStandardD32V3 ... - VirtualMachineSizeTypesStandardD32V3 VirtualMachineSizeTypes = "Standard_D32_v3" - // VirtualMachineSizeTypesStandardD3V2 ... - VirtualMachineSizeTypesStandardD3V2 VirtualMachineSizeTypes = "Standard_D3_v2" - // VirtualMachineSizeTypesStandardD4 ... - VirtualMachineSizeTypesStandardD4 VirtualMachineSizeTypes = "Standard_D4" - // VirtualMachineSizeTypesStandardD4sV3 ... - VirtualMachineSizeTypesStandardD4sV3 VirtualMachineSizeTypes = "Standard_D4s_v3" - // VirtualMachineSizeTypesStandardD4V2 ... - VirtualMachineSizeTypesStandardD4V2 VirtualMachineSizeTypes = "Standard_D4_v2" - // VirtualMachineSizeTypesStandardD4V3 ... - VirtualMachineSizeTypesStandardD4V3 VirtualMachineSizeTypes = "Standard_D4_v3" - // VirtualMachineSizeTypesStandardD5V2 ... - VirtualMachineSizeTypesStandardD5V2 VirtualMachineSizeTypes = "Standard_D5_v2" - // VirtualMachineSizeTypesStandardD64sV3 ... - VirtualMachineSizeTypesStandardD64sV3 VirtualMachineSizeTypes = "Standard_D64s_v3" - // VirtualMachineSizeTypesStandardD64V3 ... - VirtualMachineSizeTypesStandardD64V3 VirtualMachineSizeTypes = "Standard_D64_v3" - // VirtualMachineSizeTypesStandardD8sV3 ... - VirtualMachineSizeTypesStandardD8sV3 VirtualMachineSizeTypes = "Standard_D8s_v3" - // VirtualMachineSizeTypesStandardD8V3 ... - VirtualMachineSizeTypesStandardD8V3 VirtualMachineSizeTypes = "Standard_D8_v3" - // VirtualMachineSizeTypesStandardDS1 ... - VirtualMachineSizeTypesStandardDS1 VirtualMachineSizeTypes = "Standard_DS1" - // VirtualMachineSizeTypesStandardDS11 ... - VirtualMachineSizeTypesStandardDS11 VirtualMachineSizeTypes = "Standard_DS11" - // VirtualMachineSizeTypesStandardDS11V2 ... - VirtualMachineSizeTypesStandardDS11V2 VirtualMachineSizeTypes = "Standard_DS11_v2" - // VirtualMachineSizeTypesStandardDS12 ... - VirtualMachineSizeTypesStandardDS12 VirtualMachineSizeTypes = "Standard_DS12" - // VirtualMachineSizeTypesStandardDS12V2 ... - VirtualMachineSizeTypesStandardDS12V2 VirtualMachineSizeTypes = "Standard_DS12_v2" - // VirtualMachineSizeTypesStandardDS13 ... - VirtualMachineSizeTypesStandardDS13 VirtualMachineSizeTypes = "Standard_DS13" - // VirtualMachineSizeTypesStandardDS132V2 ... - VirtualMachineSizeTypesStandardDS132V2 VirtualMachineSizeTypes = "Standard_DS13-2_v2" - // VirtualMachineSizeTypesStandardDS134V2 ... - VirtualMachineSizeTypesStandardDS134V2 VirtualMachineSizeTypes = "Standard_DS13-4_v2" - // VirtualMachineSizeTypesStandardDS13V2 ... - VirtualMachineSizeTypesStandardDS13V2 VirtualMachineSizeTypes = "Standard_DS13_v2" - // VirtualMachineSizeTypesStandardDS14 ... - VirtualMachineSizeTypesStandardDS14 VirtualMachineSizeTypes = "Standard_DS14" - // VirtualMachineSizeTypesStandardDS144V2 ... - VirtualMachineSizeTypesStandardDS144V2 VirtualMachineSizeTypes = "Standard_DS14-4_v2" - // VirtualMachineSizeTypesStandardDS148V2 ... - VirtualMachineSizeTypesStandardDS148V2 VirtualMachineSizeTypes = "Standard_DS14-8_v2" - // VirtualMachineSizeTypesStandardDS14V2 ... - VirtualMachineSizeTypesStandardDS14V2 VirtualMachineSizeTypes = "Standard_DS14_v2" - // VirtualMachineSizeTypesStandardDS15V2 ... - VirtualMachineSizeTypesStandardDS15V2 VirtualMachineSizeTypes = "Standard_DS15_v2" - // VirtualMachineSizeTypesStandardDS1V2 ... - VirtualMachineSizeTypesStandardDS1V2 VirtualMachineSizeTypes = "Standard_DS1_v2" - // VirtualMachineSizeTypesStandardDS2 ... - VirtualMachineSizeTypesStandardDS2 VirtualMachineSizeTypes = "Standard_DS2" - // VirtualMachineSizeTypesStandardDS2V2 ... - VirtualMachineSizeTypesStandardDS2V2 VirtualMachineSizeTypes = "Standard_DS2_v2" - // VirtualMachineSizeTypesStandardDS3 ... - VirtualMachineSizeTypesStandardDS3 VirtualMachineSizeTypes = "Standard_DS3" - // VirtualMachineSizeTypesStandardDS3V2 ... - VirtualMachineSizeTypesStandardDS3V2 VirtualMachineSizeTypes = "Standard_DS3_v2" - // VirtualMachineSizeTypesStandardDS4 ... - VirtualMachineSizeTypesStandardDS4 VirtualMachineSizeTypes = "Standard_DS4" - // VirtualMachineSizeTypesStandardDS4V2 ... - VirtualMachineSizeTypesStandardDS4V2 VirtualMachineSizeTypes = "Standard_DS4_v2" - // VirtualMachineSizeTypesStandardDS5V2 ... - VirtualMachineSizeTypesStandardDS5V2 VirtualMachineSizeTypes = "Standard_DS5_v2" - // VirtualMachineSizeTypesStandardE16sV3 ... - VirtualMachineSizeTypesStandardE16sV3 VirtualMachineSizeTypes = "Standard_E16s_v3" - // VirtualMachineSizeTypesStandardE16V3 ... - VirtualMachineSizeTypesStandardE16V3 VirtualMachineSizeTypes = "Standard_E16_v3" - // VirtualMachineSizeTypesStandardE2sV3 ... - VirtualMachineSizeTypesStandardE2sV3 VirtualMachineSizeTypes = "Standard_E2s_v3" - // VirtualMachineSizeTypesStandardE2V3 ... - VirtualMachineSizeTypesStandardE2V3 VirtualMachineSizeTypes = "Standard_E2_v3" - // VirtualMachineSizeTypesStandardE3216V3 ... - VirtualMachineSizeTypesStandardE3216V3 VirtualMachineSizeTypes = "Standard_E32-16_v3" - // VirtualMachineSizeTypesStandardE328sV3 ... - VirtualMachineSizeTypesStandardE328sV3 VirtualMachineSizeTypes = "Standard_E32-8s_v3" - // VirtualMachineSizeTypesStandardE32sV3 ... - VirtualMachineSizeTypesStandardE32sV3 VirtualMachineSizeTypes = "Standard_E32s_v3" - // VirtualMachineSizeTypesStandardE32V3 ... - VirtualMachineSizeTypesStandardE32V3 VirtualMachineSizeTypes = "Standard_E32_v3" - // VirtualMachineSizeTypesStandardE4sV3 ... - VirtualMachineSizeTypesStandardE4sV3 VirtualMachineSizeTypes = "Standard_E4s_v3" - // VirtualMachineSizeTypesStandardE4V3 ... - VirtualMachineSizeTypesStandardE4V3 VirtualMachineSizeTypes = "Standard_E4_v3" - // VirtualMachineSizeTypesStandardE6416sV3 ... - VirtualMachineSizeTypesStandardE6416sV3 VirtualMachineSizeTypes = "Standard_E64-16s_v3" - // VirtualMachineSizeTypesStandardE6432sV3 ... - VirtualMachineSizeTypesStandardE6432sV3 VirtualMachineSizeTypes = "Standard_E64-32s_v3" - // VirtualMachineSizeTypesStandardE64sV3 ... - VirtualMachineSizeTypesStandardE64sV3 VirtualMachineSizeTypes = "Standard_E64s_v3" - // VirtualMachineSizeTypesStandardE64V3 ... - VirtualMachineSizeTypesStandardE64V3 VirtualMachineSizeTypes = "Standard_E64_v3" - // VirtualMachineSizeTypesStandardE8sV3 ... - VirtualMachineSizeTypesStandardE8sV3 VirtualMachineSizeTypes = "Standard_E8s_v3" - // VirtualMachineSizeTypesStandardE8V3 ... - VirtualMachineSizeTypesStandardE8V3 VirtualMachineSizeTypes = "Standard_E8_v3" - // VirtualMachineSizeTypesStandardF1 ... - VirtualMachineSizeTypesStandardF1 VirtualMachineSizeTypes = "Standard_F1" - // VirtualMachineSizeTypesStandardF16 ... - VirtualMachineSizeTypesStandardF16 VirtualMachineSizeTypes = "Standard_F16" - // VirtualMachineSizeTypesStandardF16s ... - VirtualMachineSizeTypesStandardF16s VirtualMachineSizeTypes = "Standard_F16s" - // VirtualMachineSizeTypesStandardF16sV2 ... - VirtualMachineSizeTypesStandardF16sV2 VirtualMachineSizeTypes = "Standard_F16s_v2" - // VirtualMachineSizeTypesStandardF1s ... - VirtualMachineSizeTypesStandardF1s VirtualMachineSizeTypes = "Standard_F1s" - // VirtualMachineSizeTypesStandardF2 ... - VirtualMachineSizeTypesStandardF2 VirtualMachineSizeTypes = "Standard_F2" - // VirtualMachineSizeTypesStandardF2s ... - VirtualMachineSizeTypesStandardF2s VirtualMachineSizeTypes = "Standard_F2s" - // VirtualMachineSizeTypesStandardF2sV2 ... - VirtualMachineSizeTypesStandardF2sV2 VirtualMachineSizeTypes = "Standard_F2s_v2" - // VirtualMachineSizeTypesStandardF32sV2 ... - VirtualMachineSizeTypesStandardF32sV2 VirtualMachineSizeTypes = "Standard_F32s_v2" - // VirtualMachineSizeTypesStandardF4 ... - VirtualMachineSizeTypesStandardF4 VirtualMachineSizeTypes = "Standard_F4" - // VirtualMachineSizeTypesStandardF4s ... - VirtualMachineSizeTypesStandardF4s VirtualMachineSizeTypes = "Standard_F4s" - // VirtualMachineSizeTypesStandardF4sV2 ... - VirtualMachineSizeTypesStandardF4sV2 VirtualMachineSizeTypes = "Standard_F4s_v2" - // VirtualMachineSizeTypesStandardF64sV2 ... - VirtualMachineSizeTypesStandardF64sV2 VirtualMachineSizeTypes = "Standard_F64s_v2" - // VirtualMachineSizeTypesStandardF72sV2 ... - VirtualMachineSizeTypesStandardF72sV2 VirtualMachineSizeTypes = "Standard_F72s_v2" - // VirtualMachineSizeTypesStandardF8 ... - VirtualMachineSizeTypesStandardF8 VirtualMachineSizeTypes = "Standard_F8" - // VirtualMachineSizeTypesStandardF8s ... - VirtualMachineSizeTypesStandardF8s VirtualMachineSizeTypes = "Standard_F8s" - // VirtualMachineSizeTypesStandardF8sV2 ... - VirtualMachineSizeTypesStandardF8sV2 VirtualMachineSizeTypes = "Standard_F8s_v2" - // VirtualMachineSizeTypesStandardG1 ... - VirtualMachineSizeTypesStandardG1 VirtualMachineSizeTypes = "Standard_G1" - // VirtualMachineSizeTypesStandardG2 ... - VirtualMachineSizeTypesStandardG2 VirtualMachineSizeTypes = "Standard_G2" - // VirtualMachineSizeTypesStandardG3 ... - VirtualMachineSizeTypesStandardG3 VirtualMachineSizeTypes = "Standard_G3" - // VirtualMachineSizeTypesStandardG4 ... - VirtualMachineSizeTypesStandardG4 VirtualMachineSizeTypes = "Standard_G4" - // VirtualMachineSizeTypesStandardG5 ... - VirtualMachineSizeTypesStandardG5 VirtualMachineSizeTypes = "Standard_G5" - // VirtualMachineSizeTypesStandardGS1 ... - VirtualMachineSizeTypesStandardGS1 VirtualMachineSizeTypes = "Standard_GS1" - // VirtualMachineSizeTypesStandardGS2 ... - VirtualMachineSizeTypesStandardGS2 VirtualMachineSizeTypes = "Standard_GS2" - // VirtualMachineSizeTypesStandardGS3 ... - VirtualMachineSizeTypesStandardGS3 VirtualMachineSizeTypes = "Standard_GS3" - // VirtualMachineSizeTypesStandardGS4 ... - VirtualMachineSizeTypesStandardGS4 VirtualMachineSizeTypes = "Standard_GS4" - // VirtualMachineSizeTypesStandardGS44 ... - VirtualMachineSizeTypesStandardGS44 VirtualMachineSizeTypes = "Standard_GS4-4" - // VirtualMachineSizeTypesStandardGS48 ... - VirtualMachineSizeTypesStandardGS48 VirtualMachineSizeTypes = "Standard_GS4-8" - // VirtualMachineSizeTypesStandardGS5 ... - VirtualMachineSizeTypesStandardGS5 VirtualMachineSizeTypes = "Standard_GS5" - // VirtualMachineSizeTypesStandardGS516 ... - VirtualMachineSizeTypesStandardGS516 VirtualMachineSizeTypes = "Standard_GS5-16" - // VirtualMachineSizeTypesStandardGS58 ... - VirtualMachineSizeTypesStandardGS58 VirtualMachineSizeTypes = "Standard_GS5-8" - // VirtualMachineSizeTypesStandardH16 ... - VirtualMachineSizeTypesStandardH16 VirtualMachineSizeTypes = "Standard_H16" - // VirtualMachineSizeTypesStandardH16m ... - VirtualMachineSizeTypesStandardH16m VirtualMachineSizeTypes = "Standard_H16m" - // VirtualMachineSizeTypesStandardH16mr ... - VirtualMachineSizeTypesStandardH16mr VirtualMachineSizeTypes = "Standard_H16mr" - // VirtualMachineSizeTypesStandardH16r ... - VirtualMachineSizeTypesStandardH16r VirtualMachineSizeTypes = "Standard_H16r" - // VirtualMachineSizeTypesStandardH8 ... - VirtualMachineSizeTypesStandardH8 VirtualMachineSizeTypes = "Standard_H8" - // VirtualMachineSizeTypesStandardH8m ... - VirtualMachineSizeTypesStandardH8m VirtualMachineSizeTypes = "Standard_H8m" - // VirtualMachineSizeTypesStandardL16s ... - VirtualMachineSizeTypesStandardL16s VirtualMachineSizeTypes = "Standard_L16s" - // VirtualMachineSizeTypesStandardL32s ... - VirtualMachineSizeTypesStandardL32s VirtualMachineSizeTypes = "Standard_L32s" - // VirtualMachineSizeTypesStandardL4s ... - VirtualMachineSizeTypesStandardL4s VirtualMachineSizeTypes = "Standard_L4s" - // VirtualMachineSizeTypesStandardL8s ... - VirtualMachineSizeTypesStandardL8s VirtualMachineSizeTypes = "Standard_L8s" - // VirtualMachineSizeTypesStandardM12832ms ... - VirtualMachineSizeTypesStandardM12832ms VirtualMachineSizeTypes = "Standard_M128-32ms" - // VirtualMachineSizeTypesStandardM12864ms ... - VirtualMachineSizeTypesStandardM12864ms VirtualMachineSizeTypes = "Standard_M128-64ms" - // VirtualMachineSizeTypesStandardM128ms ... - VirtualMachineSizeTypesStandardM128ms VirtualMachineSizeTypes = "Standard_M128ms" - // VirtualMachineSizeTypesStandardM128s ... - VirtualMachineSizeTypesStandardM128s VirtualMachineSizeTypes = "Standard_M128s" - // VirtualMachineSizeTypesStandardM6416ms ... - VirtualMachineSizeTypesStandardM6416ms VirtualMachineSizeTypes = "Standard_M64-16ms" - // VirtualMachineSizeTypesStandardM6432ms ... - VirtualMachineSizeTypesStandardM6432ms VirtualMachineSizeTypes = "Standard_M64-32ms" - // VirtualMachineSizeTypesStandardM64ms ... - VirtualMachineSizeTypesStandardM64ms VirtualMachineSizeTypes = "Standard_M64ms" - // VirtualMachineSizeTypesStandardM64s ... - VirtualMachineSizeTypesStandardM64s VirtualMachineSizeTypes = "Standard_M64s" - // VirtualMachineSizeTypesStandardNC12 ... - VirtualMachineSizeTypesStandardNC12 VirtualMachineSizeTypes = "Standard_NC12" - // VirtualMachineSizeTypesStandardNC12sV2 ... - VirtualMachineSizeTypesStandardNC12sV2 VirtualMachineSizeTypes = "Standard_NC12s_v2" - // VirtualMachineSizeTypesStandardNC12sV3 ... - VirtualMachineSizeTypesStandardNC12sV3 VirtualMachineSizeTypes = "Standard_NC12s_v3" - // VirtualMachineSizeTypesStandardNC24 ... - VirtualMachineSizeTypesStandardNC24 VirtualMachineSizeTypes = "Standard_NC24" - // VirtualMachineSizeTypesStandardNC24r ... - VirtualMachineSizeTypesStandardNC24r VirtualMachineSizeTypes = "Standard_NC24r" - // VirtualMachineSizeTypesStandardNC24rsV2 ... - VirtualMachineSizeTypesStandardNC24rsV2 VirtualMachineSizeTypes = "Standard_NC24rs_v2" - // VirtualMachineSizeTypesStandardNC24rsV3 ... - VirtualMachineSizeTypesStandardNC24rsV3 VirtualMachineSizeTypes = "Standard_NC24rs_v3" - // VirtualMachineSizeTypesStandardNC24sV2 ... - VirtualMachineSizeTypesStandardNC24sV2 VirtualMachineSizeTypes = "Standard_NC24s_v2" - // VirtualMachineSizeTypesStandardNC24sV3 ... - VirtualMachineSizeTypesStandardNC24sV3 VirtualMachineSizeTypes = "Standard_NC24s_v3" - // VirtualMachineSizeTypesStandardNC6 ... - VirtualMachineSizeTypesStandardNC6 VirtualMachineSizeTypes = "Standard_NC6" - // VirtualMachineSizeTypesStandardNC6sV2 ... - VirtualMachineSizeTypesStandardNC6sV2 VirtualMachineSizeTypes = "Standard_NC6s_v2" - // VirtualMachineSizeTypesStandardNC6sV3 ... - VirtualMachineSizeTypesStandardNC6sV3 VirtualMachineSizeTypes = "Standard_NC6s_v3" - // VirtualMachineSizeTypesStandardND12s ... - VirtualMachineSizeTypesStandardND12s VirtualMachineSizeTypes = "Standard_ND12s" - // VirtualMachineSizeTypesStandardND24rs ... - VirtualMachineSizeTypesStandardND24rs VirtualMachineSizeTypes = "Standard_ND24rs" - // VirtualMachineSizeTypesStandardND24s ... - VirtualMachineSizeTypesStandardND24s VirtualMachineSizeTypes = "Standard_ND24s" - // VirtualMachineSizeTypesStandardND6s ... - VirtualMachineSizeTypesStandardND6s VirtualMachineSizeTypes = "Standard_ND6s" - // VirtualMachineSizeTypesStandardNV12 ... - VirtualMachineSizeTypesStandardNV12 VirtualMachineSizeTypes = "Standard_NV12" - // VirtualMachineSizeTypesStandardNV24 ... - VirtualMachineSizeTypesStandardNV24 VirtualMachineSizeTypes = "Standard_NV24" - // VirtualMachineSizeTypesStandardNV6 ... - 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} -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/galleries.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/galleries.go deleted file mode 100644 index 0d32432e..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/galleries.go +++ /dev/null @@ -1,580 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// GalleriesClient is the compute Client -type GalleriesClient struct { - BaseClient -} - -// NewGalleriesClient creates an instance of the GalleriesClient client. -func NewGalleriesClient(subscriptionID string) GalleriesClient { - return NewGalleriesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewGalleriesClientWithBaseURI creates an instance of the GalleriesClient client using a custom endpoint. Use this -// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewGalleriesClientWithBaseURI(baseURI string, subscriptionID string) GalleriesClient { - return GalleriesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create or update a Shared Image Gallery. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Image Gallery. The allowed characters are alphabets and numbers with -// dots and periods allowed in the middle. The maximum length is 80 characters. -// gallery - parameters supplied to the create or update Shared Image Gallery operation. -func (client GalleriesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, gallery Gallery) (result GalleriesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleriesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, galleryName, gallery) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client GalleriesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, galleryName string, gallery Gallery) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-12-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.Compute/galleries/{galleryName}", pathParameters), - autorest.WithJSON(gallery), - 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 GalleriesClient) CreateOrUpdateSender(req *http.Request) (future GalleriesCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client GalleriesClient) CreateOrUpdateResponder(resp *http.Response) (result Gallery, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete a Shared Image Gallery. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Image Gallery to be deleted. -func (client GalleriesClient) Delete(ctx context.Context, resourceGroupName string, galleryName string) (result GalleriesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleriesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, galleryName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client GalleriesClient) DeletePreparer(ctx context.Context, resourceGroupName string, galleryName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-12-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.Compute/galleries/{galleryName}", 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 GalleriesClient) DeleteSender(req *http.Request) (future GalleriesDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client GalleriesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieves information about a Shared Image Gallery. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Image Gallery. -func (client GalleriesClient) Get(ctx context.Context, resourceGroupName string, galleryName string) (result Gallery, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleriesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, galleryName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client GalleriesClient) GetPreparer(ctx context.Context, resourceGroupName string, galleryName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-12-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.Compute/galleries/{galleryName}", 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 GalleriesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client GalleriesClient) GetResponder(resp *http.Response) (result Gallery, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List list galleries under a subscription. -func (client GalleriesClient) List(ctx context.Context) (result GalleryListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleriesClient.List") - defer func() { - sc := -1 - if result.gl.Response.Response != nil { - sc = result.gl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.gl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "List", resp, "Failure sending request") - return - } - - result.gl, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "List", resp, "Failure responding to request") - return - } - if result.gl.hasNextLink() && result.gl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client GalleriesClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/galleries", 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 GalleriesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client GalleriesClient) ListResponder(resp *http.Response) (result GalleryList, err error) { - err = autorest.Respond( - resp, - 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 GalleriesClient) listNextResults(ctx context.Context, lastResults GalleryList) (result GalleryList, err error) { - req, err := lastResults.galleryListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.GalleriesClient", "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, "compute.GalleriesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client GalleriesClient) ListComplete(ctx context.Context) (result GalleryListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleriesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} - -// ListByResourceGroup list galleries under a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client GalleriesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result GalleryListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleriesClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.gl.Response.Response != nil { - sc = result.gl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.gl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.gl, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.gl.hasNextLink() && result.gl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client GalleriesClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-12-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.Compute/galleries", pathParameters), - autorest.WithQueryParameters(queryParameters)) - 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 GalleriesClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client GalleriesClient) ListByResourceGroupResponder(resp *http.Response) (result GalleryList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client GalleriesClient) listByResourceGroupNextResults(ctx context.Context, lastResults GalleryList) (result GalleryList, err error) { - req, err := lastResults.galleryListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.GalleriesClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.GalleriesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client GalleriesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result GalleryListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleriesClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// Update update a Shared Image Gallery. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Image Gallery. The allowed characters are alphabets and numbers with -// dots and periods allowed in the middle. The maximum length is 80 characters. -// gallery - parameters supplied to the update Shared Image Gallery operation. -func (client GalleriesClient) Update(ctx context.Context, resourceGroupName string, galleryName string, gallery GalleryUpdate) (result GalleriesUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleriesClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, galleryName, gallery) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client GalleriesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, galleryName string, gallery GalleryUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-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/galleries/{galleryName}", pathParameters), - autorest.WithJSON(gallery), - 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 GalleriesClient) UpdateSender(req *http.Request) (future GalleriesUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client GalleriesClient) UpdateResponder(resp *http.Response) (result Gallery, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/galleryapplications.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/galleryapplications.go deleted file mode 100644 index 7886b4fe..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/galleryapplications.go +++ /dev/null @@ -1,485 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// GalleryApplicationsClient is the compute Client -type GalleryApplicationsClient struct { - BaseClient -} - -// NewGalleryApplicationsClient creates an instance of the GalleryApplicationsClient client. -func NewGalleryApplicationsClient(subscriptionID string) GalleryApplicationsClient { - return NewGalleryApplicationsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewGalleryApplicationsClientWithBaseURI creates an instance of the GalleryApplicationsClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewGalleryApplicationsClientWithBaseURI(baseURI string, subscriptionID string) GalleryApplicationsClient { - return GalleryApplicationsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create or update a gallery Application Definition. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Application Gallery in which the Application Definition is to be -// created. -// galleryApplicationName - the name of the gallery Application Definition to be created or updated. The -// allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The -// maximum length is 80 characters. -// galleryApplication - parameters supplied to the create or update gallery Application operation. -func (client GalleryApplicationsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplication GalleryApplication) (result GalleryApplicationsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplication) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client GalleryApplicationsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplication GalleryApplication) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryApplicationName": autorest.Encode("path", galleryApplicationName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-12-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.Compute/galleries/{galleryName}/applications/{galleryApplicationName}", pathParameters), - autorest.WithJSON(galleryApplication), - 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 GalleryApplicationsClient) CreateOrUpdateSender(req *http.Request) (future GalleryApplicationsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client GalleryApplicationsClient) CreateOrUpdateResponder(resp *http.Response) (result GalleryApplication, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete a gallery Application. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Application Gallery in which the Application Definition is to be -// deleted. -// galleryApplicationName - the name of the gallery Application Definition to be deleted. -func (client GalleryApplicationsClient) Delete(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string) (result GalleryApplicationsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, galleryName, galleryApplicationName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client GalleryApplicationsClient) DeletePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryApplicationName": autorest.Encode("path", galleryApplicationName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-12-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.Compute/galleries/{galleryName}/applications/{galleryApplicationName}", 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 GalleryApplicationsClient) DeleteSender(req *http.Request) (future GalleryApplicationsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client GalleryApplicationsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieves information about a gallery Application Definition. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Application Gallery from which the Application Definitions are to be -// retrieved. -// galleryApplicationName - the name of the gallery Application Definition to be retrieved. -func (client GalleryApplicationsClient) Get(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string) (result GalleryApplication, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, galleryName, galleryApplicationName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client GalleryApplicationsClient) GetPreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryApplicationName": autorest.Encode("path", galleryApplicationName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-12-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.Compute/galleries/{galleryName}/applications/{galleryApplicationName}", 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 GalleryApplicationsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client GalleryApplicationsClient) GetResponder(resp *http.Response) (result GalleryApplication, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByGallery list gallery Application Definitions in a gallery. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Application Gallery from which Application Definitions are to be -// listed. -func (client GalleryApplicationsClient) ListByGallery(ctx context.Context, resourceGroupName string, galleryName string) (result GalleryApplicationListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationsClient.ListByGallery") - defer func() { - sc := -1 - if result.gal.Response.Response != nil { - sc = result.gal.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByGalleryNextResults - req, err := client.ListByGalleryPreparer(ctx, resourceGroupName, galleryName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "ListByGallery", nil, "Failure preparing request") - return - } - - resp, err := client.ListByGallerySender(req) - if err != nil { - result.gal.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "ListByGallery", resp, "Failure sending request") - return - } - - result.gal, err = client.ListByGalleryResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "ListByGallery", resp, "Failure responding to request") - return - } - if result.gal.hasNextLink() && result.gal.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByGalleryPreparer prepares the ListByGallery request. -func (client GalleryApplicationsClient) ListByGalleryPreparer(ctx context.Context, resourceGroupName string, galleryName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-12-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.Compute/galleries/{galleryName}/applications", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByGallerySender sends the ListByGallery request. The method will close the -// http.Response Body if it receives an error. -func (client GalleryApplicationsClient) ListByGallerySender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByGalleryResponder handles the response to the ListByGallery request. The method always -// closes the http.Response Body. -func (client GalleryApplicationsClient) ListByGalleryResponder(resp *http.Response) (result GalleryApplicationList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByGalleryNextResults retrieves the next set of results, if any. -func (client GalleryApplicationsClient) listByGalleryNextResults(ctx context.Context, lastResults GalleryApplicationList) (result GalleryApplicationList, err error) { - req, err := lastResults.galleryApplicationListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "listByGalleryNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByGallerySender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "listByGalleryNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByGalleryResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "listByGalleryNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByGalleryComplete enumerates all values, automatically crossing page boundaries as required. -func (client GalleryApplicationsClient) ListByGalleryComplete(ctx context.Context, resourceGroupName string, galleryName string) (result GalleryApplicationListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationsClient.ListByGallery") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByGallery(ctx, resourceGroupName, galleryName) - return -} - -// Update update a gallery Application Definition. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Application Gallery in which the Application Definition is to be -// updated. -// galleryApplicationName - the name of the gallery Application Definition to be updated. The allowed -// characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum -// length is 80 characters. -// galleryApplication - parameters supplied to the update gallery Application operation. -func (client GalleryApplicationsClient) Update(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplication GalleryApplicationUpdate) (result GalleryApplicationsUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationsClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplication) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client GalleryApplicationsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplication GalleryApplicationUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryApplicationName": autorest.Encode("path", galleryApplicationName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-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/galleries/{galleryName}/applications/{galleryApplicationName}", pathParameters), - autorest.WithJSON(galleryApplication), - 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 GalleryApplicationsClient) UpdateSender(req *http.Request) (future GalleryApplicationsUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client GalleryApplicationsClient) UpdateResponder(resp *http.Response) (result GalleryApplication, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/galleryapplicationversions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/galleryapplicationversions.go deleted file mode 100644 index 3958d3bb..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/galleryapplicationversions.go +++ /dev/null @@ -1,514 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// GalleryApplicationVersionsClient is the compute Client -type GalleryApplicationVersionsClient struct { - BaseClient -} - -// NewGalleryApplicationVersionsClient creates an instance of the GalleryApplicationVersionsClient client. -func NewGalleryApplicationVersionsClient(subscriptionID string) GalleryApplicationVersionsClient { - return NewGalleryApplicationVersionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewGalleryApplicationVersionsClientWithBaseURI creates an instance of the GalleryApplicationVersionsClient client -// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign -// clouds, Azure stack). -func NewGalleryApplicationVersionsClientWithBaseURI(baseURI string, subscriptionID string) GalleryApplicationVersionsClient { - return GalleryApplicationVersionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create or update a gallery Application Version. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Application Gallery in which the Application Definition resides. -// galleryApplicationName - the name of the gallery Application Definition in which the Application Version is -// to be created. -// galleryApplicationVersionName - the name of the gallery Application Version to be created. Needs to follow -// semantic version name pattern: The allowed characters are digit and period. Digits must be within the range -// of a 32-bit integer. Format: .. -// galleryApplicationVersion - parameters supplied to the create or update gallery Application Version -// operation. -func (client GalleryApplicationVersionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, galleryApplicationVersion GalleryApplicationVersion) (result GalleryApplicationVersionsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: galleryApplicationVersion, - Constraints: []validation.Constraint{{Target: "galleryApplicationVersion.GalleryApplicationVersionProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "galleryApplicationVersion.GalleryApplicationVersionProperties.PublishingProfile", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "galleryApplicationVersion.GalleryApplicationVersionProperties.PublishingProfile.Source", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "galleryApplicationVersion.GalleryApplicationVersionProperties.PublishingProfile.Source.FileName", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "galleryApplicationVersion.GalleryApplicationVersionProperties.PublishingProfile.Source.MediaLink", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("compute.GalleryApplicationVersionsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, galleryApplicationVersion) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client GalleryApplicationVersionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, galleryApplicationVersion GalleryApplicationVersion) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryApplicationName": autorest.Encode("path", galleryApplicationName), - "galleryApplicationVersionName": autorest.Encode("path", galleryApplicationVersionName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-12-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.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}", pathParameters), - autorest.WithJSON(galleryApplicationVersion), - 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 GalleryApplicationVersionsClient) CreateOrUpdateSender(req *http.Request) (future GalleryApplicationVersionsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client GalleryApplicationVersionsClient) CreateOrUpdateResponder(resp *http.Response) (result GalleryApplicationVersion, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete a gallery Application Version. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Application Gallery in which the Application Definition resides. -// galleryApplicationName - the name of the gallery Application Definition in which the Application Version -// resides. -// galleryApplicationVersionName - the name of the gallery Application Version to be deleted. -func (client GalleryApplicationVersionsClient) Delete(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string) (result GalleryApplicationVersionsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client GalleryApplicationVersionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryApplicationName": autorest.Encode("path", galleryApplicationName), - "galleryApplicationVersionName": autorest.Encode("path", galleryApplicationVersionName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-12-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.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}", 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 GalleryApplicationVersionsClient) DeleteSender(req *http.Request) (future GalleryApplicationVersionsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client GalleryApplicationVersionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieves information about a gallery Application Version. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Application Gallery in which the Application Definition resides. -// galleryApplicationName - the name of the gallery Application Definition in which the Application Version -// resides. -// galleryApplicationVersionName - the name of the gallery Application Version to be retrieved. -// expand - the expand expression to apply on the operation. -func (client GalleryApplicationVersionsClient) Get(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, expand ReplicationStatusTypes) (result GalleryApplicationVersion, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client GalleryApplicationVersionsClient) GetPreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, expand ReplicationStatusTypes) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryApplicationName": autorest.Encode("path", galleryApplicationName), - "galleryApplicationVersionName": autorest.Encode("path", galleryApplicationVersionName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(string(expand)) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}", 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 GalleryApplicationVersionsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client GalleryApplicationVersionsClient) GetResponder(resp *http.Response) (result GalleryApplicationVersion, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByGalleryApplication list gallery Application Versions in a gallery Application Definition. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Application Gallery in which the Application Definition resides. -// galleryApplicationName - the name of the Shared Application Gallery Application Definition from which the -// Application Versions are to be listed. -func (client GalleryApplicationVersionsClient) ListByGalleryApplication(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string) (result GalleryApplicationVersionListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionsClient.ListByGalleryApplication") - defer func() { - sc := -1 - if result.gavl.Response.Response != nil { - sc = result.gavl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByGalleryApplicationNextResults - req, err := client.ListByGalleryApplicationPreparer(ctx, resourceGroupName, galleryName, galleryApplicationName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "ListByGalleryApplication", nil, "Failure preparing request") - return - } - - resp, err := client.ListByGalleryApplicationSender(req) - if err != nil { - result.gavl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "ListByGalleryApplication", resp, "Failure sending request") - return - } - - result.gavl, err = client.ListByGalleryApplicationResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "ListByGalleryApplication", resp, "Failure responding to request") - return - } - if result.gavl.hasNextLink() && result.gavl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByGalleryApplicationPreparer prepares the ListByGalleryApplication request. -func (client GalleryApplicationVersionsClient) ListByGalleryApplicationPreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryApplicationName": autorest.Encode("path", galleryApplicationName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-12-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.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByGalleryApplicationSender sends the ListByGalleryApplication request. The method will close the -// http.Response Body if it receives an error. -func (client GalleryApplicationVersionsClient) ListByGalleryApplicationSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByGalleryApplicationResponder handles the response to the ListByGalleryApplication request. The method always -// closes the http.Response Body. -func (client GalleryApplicationVersionsClient) ListByGalleryApplicationResponder(resp *http.Response) (result GalleryApplicationVersionList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByGalleryApplicationNextResults retrieves the next set of results, if any. -func (client GalleryApplicationVersionsClient) listByGalleryApplicationNextResults(ctx context.Context, lastResults GalleryApplicationVersionList) (result GalleryApplicationVersionList, err error) { - req, err := lastResults.galleryApplicationVersionListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "listByGalleryApplicationNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByGalleryApplicationSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "listByGalleryApplicationNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByGalleryApplicationResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "listByGalleryApplicationNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByGalleryApplicationComplete enumerates all values, automatically crossing page boundaries as required. -func (client GalleryApplicationVersionsClient) ListByGalleryApplicationComplete(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string) (result GalleryApplicationVersionListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionsClient.ListByGalleryApplication") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByGalleryApplication(ctx, resourceGroupName, galleryName, galleryApplicationName) - return -} - -// Update update a gallery Application Version. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Application Gallery in which the Application Definition resides. -// galleryApplicationName - the name of the gallery Application Definition in which the Application Version is -// to be updated. -// galleryApplicationVersionName - the name of the gallery Application Version to be updated. Needs to follow -// semantic version name pattern: The allowed characters are digit and period. Digits must be within the range -// of a 32-bit integer. Format: .. -// galleryApplicationVersion - parameters supplied to the update gallery Application Version operation. -func (client GalleryApplicationVersionsClient) Update(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, galleryApplicationVersion GalleryApplicationVersionUpdate) (result GalleryApplicationVersionsUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionsClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, galleryApplicationVersion) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client GalleryApplicationVersionsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, galleryApplicationVersion GalleryApplicationVersionUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryApplicationName": autorest.Encode("path", galleryApplicationName), - "galleryApplicationVersionName": autorest.Encode("path", galleryApplicationVersionName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-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/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}", pathParameters), - autorest.WithJSON(galleryApplicationVersion), - 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 GalleryApplicationVersionsClient) UpdateSender(req *http.Request) (future GalleryApplicationVersionsUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client GalleryApplicationVersionsClient) UpdateResponder(resp *http.Response) (result GalleryApplicationVersion, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/galleryimages.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/galleryimages.go deleted file mode 100644 index a57095cc..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/galleryimages.go +++ /dev/null @@ -1,492 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// GalleryImagesClient is the compute Client -type GalleryImagesClient struct { - BaseClient -} - -// NewGalleryImagesClient creates an instance of the GalleryImagesClient client. -func NewGalleryImagesClient(subscriptionID string) GalleryImagesClient { - return NewGalleryImagesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewGalleryImagesClientWithBaseURI creates an instance of the GalleryImagesClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewGalleryImagesClientWithBaseURI(baseURI string, subscriptionID string) GalleryImagesClient { - return GalleryImagesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create or update a gallery Image Definition. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Image Gallery in which the Image Definition is to be created. -// galleryImageName - the name of the gallery Image Definition to be created or updated. The allowed characters -// are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 -// characters. -// galleryImage - parameters supplied to the create or update gallery image operation. -func (client GalleryImagesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImage GalleryImage) (result GalleryImagesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImagesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: galleryImage, - Constraints: []validation.Constraint{{Target: "galleryImage.GalleryImageProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "galleryImage.GalleryImageProperties.Identifier", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "galleryImage.GalleryImageProperties.Identifier.Publisher", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "galleryImage.GalleryImageProperties.Identifier.Offer", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "galleryImage.GalleryImageProperties.Identifier.Sku", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}}}}); err != nil { - return result, validation.NewError("compute.GalleryImagesClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, galleryName, galleryImageName, galleryImage) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client GalleryImagesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImage GalleryImage) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryImageName": autorest.Encode("path", galleryImageName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-12-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.Compute/galleries/{galleryName}/images/{galleryImageName}", pathParameters), - autorest.WithJSON(galleryImage), - 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 GalleryImagesClient) CreateOrUpdateSender(req *http.Request) (future GalleryImagesCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client GalleryImagesClient) CreateOrUpdateResponder(resp *http.Response) (result GalleryImage, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete a gallery image. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Image Gallery in which the Image Definition is to be deleted. -// galleryImageName - the name of the gallery Image Definition to be deleted. -func (client GalleryImagesClient) Delete(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string) (result GalleryImagesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImagesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, galleryName, galleryImageName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client GalleryImagesClient) DeletePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryImageName": autorest.Encode("path", galleryImageName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-12-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.Compute/galleries/{galleryName}/images/{galleryImageName}", 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 GalleryImagesClient) DeleteSender(req *http.Request) (future GalleryImagesDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client GalleryImagesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieves information about a gallery Image Definition. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Image Gallery from which the Image Definitions are to be retrieved. -// galleryImageName - the name of the gallery Image Definition to be retrieved. -func (client GalleryImagesClient) Get(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string) (result GalleryImage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImagesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, galleryName, galleryImageName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client GalleryImagesClient) GetPreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryImageName": autorest.Encode("path", galleryImageName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-12-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.Compute/galleries/{galleryName}/images/{galleryImageName}", 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 GalleryImagesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client GalleryImagesClient) GetResponder(resp *http.Response) (result GalleryImage, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByGallery list gallery Image Definitions in a gallery. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Image Gallery from which Image Definitions are to be listed. -func (client GalleryImagesClient) ListByGallery(ctx context.Context, resourceGroupName string, galleryName string) (result GalleryImageListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImagesClient.ListByGallery") - defer func() { - sc := -1 - if result.gil.Response.Response != nil { - sc = result.gil.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByGalleryNextResults - req, err := client.ListByGalleryPreparer(ctx, resourceGroupName, galleryName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "ListByGallery", nil, "Failure preparing request") - return - } - - resp, err := client.ListByGallerySender(req) - if err != nil { - result.gil.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "ListByGallery", resp, "Failure sending request") - return - } - - result.gil, err = client.ListByGalleryResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "ListByGallery", resp, "Failure responding to request") - return - } - if result.gil.hasNextLink() && result.gil.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByGalleryPreparer prepares the ListByGallery request. -func (client GalleryImagesClient) ListByGalleryPreparer(ctx context.Context, resourceGroupName string, galleryName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-12-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.Compute/galleries/{galleryName}/images", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByGallerySender sends the ListByGallery request. The method will close the -// http.Response Body if it receives an error. -func (client GalleryImagesClient) ListByGallerySender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByGalleryResponder handles the response to the ListByGallery request. The method always -// closes the http.Response Body. -func (client GalleryImagesClient) ListByGalleryResponder(resp *http.Response) (result GalleryImageList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByGalleryNextResults retrieves the next set of results, if any. -func (client GalleryImagesClient) listByGalleryNextResults(ctx context.Context, lastResults GalleryImageList) (result GalleryImageList, err error) { - req, err := lastResults.galleryImageListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "listByGalleryNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByGallerySender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "listByGalleryNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByGalleryResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "listByGalleryNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByGalleryComplete enumerates all values, automatically crossing page boundaries as required. -func (client GalleryImagesClient) ListByGalleryComplete(ctx context.Context, resourceGroupName string, galleryName string) (result GalleryImageListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImagesClient.ListByGallery") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByGallery(ctx, resourceGroupName, galleryName) - return -} - -// Update update a gallery Image Definition. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Image Gallery in which the Image Definition is to be updated. -// galleryImageName - the name of the gallery Image Definition to be updated. The allowed characters are -// alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 -// characters. -// galleryImage - parameters supplied to the update gallery image operation. -func (client GalleryImagesClient) Update(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImage GalleryImageUpdate) (result GalleryImagesUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImagesClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, galleryName, galleryImageName, galleryImage) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client GalleryImagesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImage GalleryImageUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryImageName": autorest.Encode("path", galleryImageName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-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/galleries/{galleryName}/images/{galleryImageName}", pathParameters), - autorest.WithJSON(galleryImage), - 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 GalleryImagesClient) UpdateSender(req *http.Request) (future GalleryImagesUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client GalleryImagesClient) UpdateResponder(resp *http.Response) (result GalleryImage, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/galleryimageversions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/galleryimageversions.go deleted file mode 100644 index 5db43f68..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/galleryimageversions.go +++ /dev/null @@ -1,503 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// GalleryImageVersionsClient is the compute Client -type GalleryImageVersionsClient struct { - BaseClient -} - -// NewGalleryImageVersionsClient creates an instance of the GalleryImageVersionsClient client. -func NewGalleryImageVersionsClient(subscriptionID string) GalleryImageVersionsClient { - return NewGalleryImageVersionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewGalleryImageVersionsClientWithBaseURI creates an instance of the GalleryImageVersionsClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewGalleryImageVersionsClientWithBaseURI(baseURI string, subscriptionID string) GalleryImageVersionsClient { - return GalleryImageVersionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create or update a gallery Image Version. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Image Gallery in which the Image Definition resides. -// galleryImageName - the name of the gallery Image Definition in which the Image Version is to be created. -// galleryImageVersionName - the name of the gallery Image Version to be created. Needs to follow semantic -// version name pattern: The allowed characters are digit and period. Digits must be within the range of a -// 32-bit integer. Format: .. -// galleryImageVersion - parameters supplied to the create or update gallery Image Version operation. -func (client GalleryImageVersionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, galleryImageVersion GalleryImageVersion) (result GalleryImageVersionsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageVersionsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: galleryImageVersion, - Constraints: []validation.Constraint{{Target: "galleryImageVersion.GalleryImageVersionProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "galleryImageVersion.GalleryImageVersionProperties.StorageProfile", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("compute.GalleryImageVersionsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client GalleryImageVersionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, galleryImageVersion GalleryImageVersion) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryImageName": autorest.Encode("path", galleryImageName), - "galleryImageVersionName": autorest.Encode("path", galleryImageVersionName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-12-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.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}", pathParameters), - autorest.WithJSON(galleryImageVersion), - 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 GalleryImageVersionsClient) CreateOrUpdateSender(req *http.Request) (future GalleryImageVersionsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client GalleryImageVersionsClient) CreateOrUpdateResponder(resp *http.Response) (result GalleryImageVersion, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete a gallery Image Version. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Image Gallery in which the Image Definition resides. -// galleryImageName - the name of the gallery Image Definition in which the Image Version resides. -// galleryImageVersionName - the name of the gallery Image Version to be deleted. -func (client GalleryImageVersionsClient) Delete(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string) (result GalleryImageVersionsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageVersionsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, galleryName, galleryImageName, galleryImageVersionName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client GalleryImageVersionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryImageName": autorest.Encode("path", galleryImageName), - "galleryImageVersionName": autorest.Encode("path", galleryImageVersionName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-12-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.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}", 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 GalleryImageVersionsClient) DeleteSender(req *http.Request) (future GalleryImageVersionsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client GalleryImageVersionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieves information about a gallery Image Version. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Image Gallery in which the Image Definition resides. -// galleryImageName - the name of the gallery Image Definition in which the Image Version resides. -// galleryImageVersionName - the name of the gallery Image Version to be retrieved. -// expand - the expand expression to apply on the operation. -func (client GalleryImageVersionsClient) Get(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, expand ReplicationStatusTypes) (result GalleryImageVersion, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageVersionsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client GalleryImageVersionsClient) GetPreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, expand ReplicationStatusTypes) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryImageName": autorest.Encode("path", galleryImageName), - "galleryImageVersionName": autorest.Encode("path", galleryImageVersionName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(string(expand)) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}", 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 GalleryImageVersionsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client GalleryImageVersionsClient) GetResponder(resp *http.Response) (result GalleryImageVersion, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByGalleryImage list gallery Image Versions in a gallery Image Definition. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Image Gallery in which the Image Definition resides. -// galleryImageName - the name of the Shared Image Gallery Image Definition from which the Image Versions are -// to be listed. -func (client GalleryImageVersionsClient) ListByGalleryImage(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string) (result GalleryImageVersionListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageVersionsClient.ListByGalleryImage") - defer func() { - sc := -1 - if result.givl.Response.Response != nil { - sc = result.givl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByGalleryImageNextResults - req, err := client.ListByGalleryImagePreparer(ctx, resourceGroupName, galleryName, galleryImageName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "ListByGalleryImage", nil, "Failure preparing request") - return - } - - resp, err := client.ListByGalleryImageSender(req) - if err != nil { - result.givl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "ListByGalleryImage", resp, "Failure sending request") - return - } - - result.givl, err = client.ListByGalleryImageResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "ListByGalleryImage", resp, "Failure responding to request") - return - } - if result.givl.hasNextLink() && result.givl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByGalleryImagePreparer prepares the ListByGalleryImage request. -func (client GalleryImageVersionsClient) ListByGalleryImagePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryImageName": autorest.Encode("path", galleryImageName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-12-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.Compute/galleries/{galleryName}/images/{galleryImageName}/versions", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByGalleryImageSender sends the ListByGalleryImage request. The method will close the -// http.Response Body if it receives an error. -func (client GalleryImageVersionsClient) ListByGalleryImageSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByGalleryImageResponder handles the response to the ListByGalleryImage request. The method always -// closes the http.Response Body. -func (client GalleryImageVersionsClient) ListByGalleryImageResponder(resp *http.Response) (result GalleryImageVersionList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByGalleryImageNextResults retrieves the next set of results, if any. -func (client GalleryImageVersionsClient) listByGalleryImageNextResults(ctx context.Context, lastResults GalleryImageVersionList) (result GalleryImageVersionList, err error) { - req, err := lastResults.galleryImageVersionListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "listByGalleryImageNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByGalleryImageSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "listByGalleryImageNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByGalleryImageResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "listByGalleryImageNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByGalleryImageComplete enumerates all values, automatically crossing page boundaries as required. -func (client GalleryImageVersionsClient) ListByGalleryImageComplete(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string) (result GalleryImageVersionListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageVersionsClient.ListByGalleryImage") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByGalleryImage(ctx, resourceGroupName, galleryName, galleryImageName) - return -} - -// Update update a gallery Image Version. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Image Gallery in which the Image Definition resides. -// galleryImageName - the name of the gallery Image Definition in which the Image Version is to be updated. -// galleryImageVersionName - the name of the gallery Image Version to be updated. Needs to follow semantic -// version name pattern: The allowed characters are digit and period. Digits must be within the range of a -// 32-bit integer. Format: .. -// galleryImageVersion - parameters supplied to the update gallery Image Version operation. -func (client GalleryImageVersionsClient) Update(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, galleryImageVersion GalleryImageVersionUpdate) (result GalleryImageVersionsUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageVersionsClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client GalleryImageVersionsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, galleryImageVersion GalleryImageVersionUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryImageName": autorest.Encode("path", galleryImageName), - "galleryImageVersionName": autorest.Encode("path", galleryImageVersionName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-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/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}", pathParameters), - autorest.WithJSON(galleryImageVersion), - 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 GalleryImageVersionsClient) UpdateSender(req *http.Request) (future GalleryImageVersionsUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client GalleryImageVersionsClient) UpdateResponder(resp *http.Response) (result GalleryImageVersion, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/images.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/images.go deleted file mode 100644 index d0b4009a..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/images.go +++ /dev/null @@ -1,583 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ImagesClient is the compute Client -type ImagesClient struct { - BaseClient -} - -// NewImagesClient creates an instance of the ImagesClient client. -func NewImagesClient(subscriptionID string) ImagesClient { - return NewImagesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewImagesClientWithBaseURI creates an instance of the ImagesClient client using a custom endpoint. Use this when -// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewImagesClientWithBaseURI(baseURI string, subscriptionID string) ImagesClient { - return ImagesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create or update an image. -// Parameters: -// resourceGroupName - the name of the resource group. -// imageName - the name of the image. -// parameters - 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 tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ImagesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, imageName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ImagesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, imageName string, parameters Image) (*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 = "2019-12-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.Compute/images/{imageName}", 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 ImagesClient) CreateOrUpdateSender(req *http.Request) (future ImagesCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client ImagesClient) CreateOrUpdateResponder(resp *http.Response) (result Image, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes an Image. -// Parameters: -// resourceGroupName - the name of the resource group. -// imageName - the name of the image. -func (client ImagesClient) Delete(ctx context.Context, resourceGroupName string, imageName string) (result ImagesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ImagesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, imageName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ImagesClient) DeletePreparer(ctx context.Context, resourceGroupName string, imageName string) (*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 = "2019-12-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.Compute/images/{imageName}", 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 ImagesClient) DeleteSender(req *http.Request) (future ImagesDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client ImagesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets an image. -// Parameters: -// resourceGroupName - the name of the resource group. -// imageName - the name of the image. -// expand - the expand expression to apply on the operation. -func (client ImagesClient) Get(ctx context.Context, resourceGroupName string, imageName string, expand string) (result Image, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ImagesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, imageName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.ImagesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ImagesClient) GetPreparer(ctx context.Context, resourceGroupName string, imageName string, expand string) (*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 = "2019-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}", 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 ImagesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ImagesClient) GetResponder(resp *http.Response) (result Image, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets the list of Images in the subscription. Use nextLink property in the response to get the next page of -// Images. Do this till nextLink is null to fetch all the Images. -func (client ImagesClient) List(ctx context.Context) (result ImageListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ImagesClient.List") - defer func() { - sc := -1 - if result.ilr.Response.Response != nil { - sc = result.ilr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.ilr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.ImagesClient", "List", resp, "Failure sending request") - return - } - - result.ilr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesClient", "List", resp, "Failure responding to request") - return - } - if result.ilr.hasNextLink() && result.ilr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ImagesClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/images", 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 ImagesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ImagesClient) ListResponder(resp *http.Response) (result ImageListResult, err error) { - err = autorest.Respond( - resp, - 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 ImagesClient) listNextResults(ctx context.Context, lastResults ImageListResult) (result ImageListResult, err error) { - req, err := lastResults.imageListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.ImagesClient", "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, "compute.ImagesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ImagesClient) ListComplete(ctx context.Context) (result ImageListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ImagesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} - -// ListByResourceGroup gets the list of images under a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client ImagesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ImageListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ImagesClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.ilr.Response.Response != nil { - sc = result.ilr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.ilr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.ImagesClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.ilr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.ilr.hasNextLink() && result.ilr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client ImagesClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-12-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.Compute/images", pathParameters), - autorest.WithQueryParameters(queryParameters)) - 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 ImagesClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client ImagesClient) ListByResourceGroupResponder(resp *http.Response) (result ImageListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client ImagesClient) listByResourceGroupNextResults(ctx context.Context, lastResults ImageListResult) (result ImageListResult, err error) { - req, err := lastResults.imageListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.ImagesClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.ImagesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client ImagesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ImageListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ImagesClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// Update update an image. -// Parameters: -// resourceGroupName - the name of the resource group. -// imageName - the name of the image. -// parameters - parameters supplied to the Update Image operation. -func (client ImagesClient) Update(ctx context.Context, resourceGroupName string, imageName string, parameters ImageUpdate) (result ImagesUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ImagesClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - 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 = "2019-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) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - 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, - 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/2019-12-01/compute/loganalytics.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/loganalytics.go deleted file mode 100644 index e388b68e..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/loganalytics.go +++ /dev/null @@ -1,206 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// LogAnalyticsClient is the compute Client -type LogAnalyticsClient struct { - BaseClient -} - -// NewLogAnalyticsClient creates an instance of the LogAnalyticsClient client. -func NewLogAnalyticsClient(subscriptionID string) LogAnalyticsClient { - return NewLogAnalyticsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewLogAnalyticsClientWithBaseURI creates an instance of the LogAnalyticsClient client using a custom endpoint. Use -// this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewLogAnalyticsClientWithBaseURI(baseURI string, subscriptionID string) LogAnalyticsClient { - return LogAnalyticsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// ExportRequestRateByInterval export logs that show Api requests made by this subscription in the given time window to -// show throttling activities. -// Parameters: -// parameters - parameters supplied to the LogAnalytics getRequestRateByInterval Api. -// location - 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 tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LogAnalyticsClient.ExportRequestRateByInterval") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - 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.NewError("compute.LogAnalyticsClient", "ExportRequestRateByInterval", err.Error()) - } - - req, err := client.ExportRequestRateByIntervalPreparer(ctx, parameters, location) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.LogAnalyticsClient", "ExportRequestRateByInterval", nil, "Failure preparing request") - return - } - - result, err = client.ExportRequestRateByIntervalSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.LogAnalyticsClient", "ExportRequestRateByInterval", result.Response(), "Failure sending request") - return - } - - return -} - -// ExportRequestRateByIntervalPreparer prepares the ExportRequestRateByInterval request. -func (client LogAnalyticsClient) ExportRequestRateByIntervalPreparer(ctx context.Context, parameters RequestRateByIntervalInput, location string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-12-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.Compute/locations/{location}/logAnalytics/apiAccess/getRequestRateByInterval", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ExportRequestRateByIntervalSender sends the ExportRequestRateByInterval request. The method will close the -// http.Response Body if it receives an error. -func (client LogAnalyticsClient) ExportRequestRateByIntervalSender(req *http.Request) (future LogAnalyticsExportRequestRateByIntervalFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ExportRequestRateByIntervalResponder handles the response to the ExportRequestRateByInterval request. The method always -// closes the http.Response Body. -func (client LogAnalyticsClient) ExportRequestRateByIntervalResponder(resp *http.Response) (result LogAnalyticsOperationResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ExportThrottledRequests export logs that show total throttled Api requests for this subscription in the given time -// window. -// Parameters: -// parameters - parameters supplied to the LogAnalytics getThrottledRequests Api. -// location - 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 tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LogAnalyticsClient.ExportThrottledRequests") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - 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.NewError("compute.LogAnalyticsClient", "ExportThrottledRequests", err.Error()) - } - - req, err := client.ExportThrottledRequestsPreparer(ctx, parameters, location) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.LogAnalyticsClient", "ExportThrottledRequests", nil, "Failure preparing request") - return - } - - result, err = client.ExportThrottledRequestsSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.LogAnalyticsClient", "ExportThrottledRequests", result.Response(), "Failure sending request") - return - } - - return -} - -// ExportThrottledRequestsPreparer prepares the ExportThrottledRequests request. -func (client LogAnalyticsClient) ExportThrottledRequestsPreparer(ctx context.Context, parameters ThrottledRequestsInput, location string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-12-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.Compute/locations/{location}/logAnalytics/apiAccess/getThrottledRequests", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ExportThrottledRequestsSender sends the ExportThrottledRequests request. The method will close the -// http.Response Body if it receives an error. -func (client LogAnalyticsClient) ExportThrottledRequestsSender(req *http.Request) (future LogAnalyticsExportThrottledRequestsFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ExportThrottledRequestsResponder handles the response to the ExportThrottledRequests request. The method always -// closes the http.Response Body. -func (client LogAnalyticsClient) ExportThrottledRequestsResponder(resp *http.Response) (result LogAnalyticsOperationResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - 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/2019-12-01/compute/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/models.go deleted file mode 100644 index 4cb1fad4..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/models.go +++ /dev/null @@ -1,15500 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "encoding/json" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/date" - "github.com/Azure/go-autorest/autorest/to" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// The package's fully qualified name. -const fqdn = "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute" - -// AccessURI a disk access SAS uri. -type AccessURI struct { - autorest.Response `json:"-"` - // AccessSAS - READ-ONLY; A SAS uri for accessing a disk. - AccessSAS *string `json:"accessSAS,omitempty"` -} - -// MarshalJSON is the custom marshaler for AccessURI. -func (au AccessURI) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// AdditionalCapabilities enables or disables a capability on the virtual machine or virtual machine scale -// set. -type AdditionalCapabilities struct { - // UltraSSDEnabled - The flag that enables or disables a capability to have one or more managed data disks with UltraSSD_LRS storage account type on the VM or VMSS. Managed disks with storage account type UltraSSD_LRS can be added to a virtual machine or virtual machine scale set only if this property is enabled. - UltraSSDEnabled *bool `json:"ultraSSDEnabled,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. -type AdditionalUnattendContent struct { - // PassName - The pass name. Currently, the only allowable value is OobeSystem. Possible values include: 'OobeSystem' - PassName PassNames `json:"passName,omitempty"` - // ComponentName - The component name. Currently, the only allowable value is Microsoft-Windows-Shell-Setup. Possible values include: 'MicrosoftWindowsShellSetup' - ComponentName ComponentNames `json:"componentName,omitempty"` - // SettingName - Specifies the name of the setting to which the content applies. Possible values are: FirstLogonCommands and AutoLogon. Possible values include: 'AutoLogon', 'FirstLogonCommands' - SettingName SettingNames `json:"settingName,omitempty"` - // Content - Specifies the XML formatted content that is added to the unattend.xml file for the specified path and component. The XML must be less than 4KB and must include the root element for the setting or feature that is being inserted. - Content *string `json:"content,omitempty"` -} - -// APIEntityReference the API entity reference. -type APIEntityReference struct { - // ID - The ARM resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... - ID *string `json:"id,omitempty"` -} - -// APIError api error. -type APIError struct { - // Details - The Api error details - Details *[]APIErrorBase `json:"details,omitempty"` - // Innererror - The Api inner error - Innererror *InnerError `json:"innererror,omitempty"` - // Code - The error code. - Code *string `json:"code,omitempty"` - // Target - The target of the particular error. - Target *string `json:"target,omitempty"` - // Message - The error message. - Message *string `json:"message,omitempty"` -} - -// APIErrorBase api error base. -type APIErrorBase struct { - // Code - The error code. - Code *string `json:"code,omitempty"` - // Target - The target of the particular error. - Target *string `json:"target,omitempty"` - // Message - The error message. - Message *string `json:"message,omitempty"` -} - -// AutomaticOSUpgradePolicy the configuration parameters used for performing automatic OS upgrade. -type AutomaticOSUpgradePolicy struct { - // EnableAutomaticOSUpgrade - Indicates whether OS upgrades should automatically be applied to scale set instances in a rolling fashion when a newer version of the OS image becomes available. Default value is false.

      If this is set to true for Windows based scale sets, [enableAutomaticUpdates](https://docs.microsoft.com/dotnet/api/microsoft.azure.management.compute.models.windowsconfiguration.enableautomaticupdates?view=azure-dotnet) is automatically set to false and cannot be set to true. - EnableAutomaticOSUpgrade *bool `json:"enableAutomaticOSUpgrade,omitempty"` - // DisableAutomaticRollback - Whether OS image rollback feature should be disabled. Default value is false. - DisableAutomaticRollback *bool `json:"disableAutomaticRollback,omitempty"` -} - -// AutomaticOSUpgradeProperties describes automatic OS upgrade properties on the image. -type AutomaticOSUpgradeProperties struct { - // AutomaticOSUpgradeSupported - Specifies whether automatic OS upgrade is supported on the image. - AutomaticOSUpgradeSupported *bool `json:"automaticOSUpgradeSupported,omitempty"` -} - -// AutomaticRepairsPolicy specifies the configuration parameters for automatic repairs on the virtual -// machine scale set. -type AutomaticRepairsPolicy struct { - // Enabled - Specifies whether automatic repairs should be enabled on the virtual machine scale set. The default value is false. - Enabled *bool `json:"enabled,omitempty"` - // GracePeriod - The amount of time for which automatic repairs are suspended due to a state change on VM. The grace time starts after the state change has completed. This helps avoid premature or accidental repairs. The time duration should be specified in ISO 8601 format. The minimum allowed grace period is 30 minutes (PT30M), which is also the default value. The maximum allowed grace period is 90 minutes (PT90M). - GracePeriod *string `json:"gracePeriod,omitempty"` -} - -// 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 -// 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 maintenance, 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 AvailabilitySet struct { - autorest.Response `json:"-"` - *AvailabilitySetProperties `json:"properties,omitempty"` - // Sku - Sku of the availability set, only name is required to be set. See AvailabilitySetSkuTypes for possible set of values. Use 'Aligned' for virtual machines with managed disks and 'Classic' for virtual machines with unmanaged disks. Default value is 'Classic'. - Sku *Sku `json:"sku,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; 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 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.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. -type AvailabilitySetListResult struct { - autorest.Response `json:"-"` - // Value - The list of availability sets - Value *[]AvailabilitySet `json:"value,omitempty"` - // NextLink - The URI to fetch the next page of AvailabilitySets. Call ListNext() with this URI to fetch the next page of AvailabilitySets. - NextLink *string `json:"nextLink,omitempty"` -} - -// AvailabilitySetListResultIterator provides access to a complete listing of AvailabilitySet values. -type AvailabilitySetListResultIterator struct { - i int - page AvailabilitySetListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *AvailabilitySetListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *AvailabilitySetListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter AvailabilitySetListResultIterator) 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 AvailabilitySetListResultIterator) Response() AvailabilitySetListResult { - 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 AvailabilitySetListResultIterator) Value() AvailabilitySet { - if !iter.page.NotDone() { - return AvailabilitySet{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the AvailabilitySetListResultIterator type. -func NewAvailabilitySetListResultIterator(page AvailabilitySetListResultPage) AvailabilitySetListResultIterator { - return AvailabilitySetListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (aslr AvailabilitySetListResult) IsEmpty() bool { - return aslr.Value == nil || len(*aslr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (aslr AvailabilitySetListResult) hasNextLink() bool { - return aslr.NextLink != nil && len(*aslr.NextLink) != 0 -} - -// availabilitySetListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (aslr AvailabilitySetListResult) availabilitySetListResultPreparer(ctx context.Context) (*http.Request, error) { - if !aslr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(aslr.NextLink))) -} - -// AvailabilitySetListResultPage contains a page of AvailabilitySet values. -type AvailabilitySetListResultPage struct { - fn func(context.Context, AvailabilitySetListResult) (AvailabilitySetListResult, error) - aslr AvailabilitySetListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *AvailabilitySetListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.aslr) - if err != nil { - return err - } - page.aslr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *AvailabilitySetListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page AvailabilitySetListResultPage) NotDone() bool { - return !page.aslr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page AvailabilitySetListResultPage) Response() AvailabilitySetListResult { - return page.aslr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page AvailabilitySetListResultPage) Values() []AvailabilitySet { - if page.aslr.IsEmpty() { - return nil - } - return *page.aslr.Value -} - -// Creates a new instance of the AvailabilitySetListResultPage type. -func NewAvailabilitySetListResultPage(cur AvailabilitySetListResult, getNextPage func(context.Context, AvailabilitySetListResult) (AvailabilitySetListResult, error)) AvailabilitySetListResultPage { - return AvailabilitySetListResultPage{ - fn: getNextPage, - aslr: cur, - } -} - -// AvailabilitySetProperties the instance view of a resource. -type AvailabilitySetProperties struct { - // PlatformUpdateDomainCount - Update Domain count. - PlatformUpdateDomainCount *int32 `json:"platformUpdateDomainCount,omitempty"` - // PlatformFaultDomainCount - Fault Domain count. - PlatformFaultDomainCount *int32 `json:"platformFaultDomainCount,omitempty"` - // VirtualMachines - A list of references to all virtual machines in the availability set. - VirtualMachines *[]SubResource `json:"virtualMachines,omitempty"` - // ProximityPlacementGroup - Specifies information about the proximity placement group that the availability set should be assigned to.

      Minimum api-version: 2018-04-01. - ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` - // Statuses - READ-ONLY; The resource status information. - Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` -} - -// MarshalJSON is the custom marshaler for AvailabilitySetProperties. -func (asp AvailabilitySetProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if asp.PlatformUpdateDomainCount != nil { - objectMap["platformUpdateDomainCount"] = asp.PlatformUpdateDomainCount - } - if asp.PlatformFaultDomainCount != nil { - objectMap["platformFaultDomainCount"] = asp.PlatformFaultDomainCount - } - if asp.VirtualMachines != nil { - objectMap["virtualMachines"] = asp.VirtualMachines - } - if asp.ProximityPlacementGroup != nil { - objectMap["proximityPlacementGroup"] = asp.ProximityPlacementGroup - } - return json.Marshal(objectMap) -} - -// AvailabilitySetUpdate specifies information about the availability set that the virtual machine should -// be assigned to. Only tags may be updated. -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 -} - -// BillingProfile specifies the billing related details of a Azure Spot VM or VMSS.

      Minimum -// api-version: 2019-03-01. -type BillingProfile struct { - // MaxPrice - Specifies the maximum price you are willing to pay for a Azure Spot VM/VMSS. This price is in US Dollars.

      This price will be compared with the current Azure Spot price for the VM size. Also, the prices are compared at the time of create/update of Azure Spot VM/VMSS and the operation will only succeed if the maxPrice is greater than the current Azure Spot price.

      The maxPrice will also be used for evicting a Azure Spot VM/VMSS if the current Azure Spot price goes beyond the maxPrice after creation of VM/VMSS.

      Possible values are:

      - Any decimal value greater than zero. Example: 0.01538

      -1 – indicates default price to be up-to on-demand.

      You can set the maxPrice to -1 to indicate that the Azure Spot VM/VMSS should not be evicted for price reasons. Also, the default max price is -1 if it is not provided by you.

      Minimum api-version: 2019-03-01. - MaxPrice *float64 `json:"maxPrice,omitempty"` -} - -// BootDiagnostics boot Diagnostics is a debugging feature which allows you to view Console Output and -// Screenshot to diagnose VM status.

      You can easily view the output of your console log.

      -// 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"` - // StorageURI - Uri of the storage account to use for placing the console output and screenshot. - StorageURI *string `json:"storageUri,omitempty"` -} - -// BootDiagnosticsInstanceView the instance view of a virtual machine boot diagnostics. -type BootDiagnosticsInstanceView struct { - // ConsoleScreenshotBlobURI - READ-ONLY; The console screenshot blob URI. - ConsoleScreenshotBlobURI *string `json:"consoleScreenshotBlobUri,omitempty"` - // SerialConsoleLogBlobURI - READ-ONLY; The Linux serial console log blob Uri. - SerialConsoleLogBlobURI *string `json:"serialConsoleLogBlobUri,omitempty"` - // Status - READ-ONLY; The boot diagnostics status information for the VM.

      NOTE: It will be set only if there are errors encountered in enabling boot diagnostics. - Status *InstanceViewStatus `json:"status,omitempty"` -} - -// MarshalJSON is the custom marshaler for BootDiagnosticsInstanceView. -func (bdiv BootDiagnosticsInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// CloudError an error response from the Compute service. -type CloudError struct { - Error *APIError `json:"error,omitempty"` -} - -// ContainerService container service. -type ContainerService struct { - autorest.Response `json:"-"` - *ContainerServiceProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; 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 ContainerService. -func (cs ContainerService) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cs.ContainerServiceProperties != nil { - objectMap["properties"] = cs.ContainerServiceProperties - } - 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. -type ContainerServiceAgentPoolProfile struct { - // Name - Unique name of the agent pool profile in the context of the subscription and resource group. - 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', 'StandardA2', 'StandardA3', 'StandardA4', 'StandardA5', 'StandardA6', 'StandardA7', 'StandardA8', 'StandardA9', 'StandardA10', 'StandardA11', 'StandardD1', 'StandardD2', 'StandardD3', 'StandardD4', 'StandardD11', 'StandardD12', 'StandardD13', 'StandardD14', 'StandardD1V2', 'StandardD2V2', 'StandardD3V2', 'StandardD4V2', 'StandardD5V2', 'StandardD11V2', 'StandardD12V2', 'StandardD13V2', 'StandardD14V2', 'StandardG1', 'StandardG2', 'StandardG3', 'StandardG4', 'StandardG5', 'StandardDS1', 'StandardDS2', 'StandardDS3', 'StandardDS4', 'StandardDS11', 'StandardDS12', 'StandardDS13', 'StandardDS14', 'StandardGS1', 'StandardGS2', 'StandardGS3', 'StandardGS4', 'StandardGS5' - VMSize ContainerServiceVMSizeTypes `json:"vmSize,omitempty"` - // DNSPrefix - DNS prefix to be used to create the FQDN for the agent pool. - DNSPrefix *string `json:"dnsPrefix,omitempty"` - // Fqdn - READ-ONLY; FQDN for the agent pool. - Fqdn *string `json:"fqdn,omitempty"` -} - -// MarshalJSON is the custom marshaler for ContainerServiceAgentPoolProfile. -func (csapp ContainerServiceAgentPoolProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if csapp.Name != nil { - objectMap["name"] = csapp.Name - } - if csapp.Count != nil { - objectMap["count"] = csapp.Count - } - if csapp.VMSize != "" { - objectMap["vmSize"] = csapp.VMSize - } - if csapp.DNSPrefix != nil { - objectMap["dnsPrefix"] = csapp.DNSPrefix - } - return json.Marshal(objectMap) -} - -// ContainerServiceCustomProfile properties to configure a custom container service cluster. -type ContainerServiceCustomProfile struct { - // Orchestrator - The name of the custom orchestrator to use. - Orchestrator *string `json:"orchestrator,omitempty"` -} - -// ContainerServiceDiagnosticsProfile ... -type ContainerServiceDiagnosticsProfile struct { - // VMDiagnostics - Profile for the container service VM diagnostic agent. - VMDiagnostics *ContainerServiceVMDiagnostics `json:"vmDiagnostics,omitempty"` -} - -// ContainerServiceLinuxProfile profile for Linux VMs in the container service cluster. -type ContainerServiceLinuxProfile struct { - // AdminUsername - The administrator username to use for Linux VMs. - AdminUsername *string `json:"adminUsername,omitempty"` - // SSH - The ssh key configuration for Linux VMs. - SSH *ContainerServiceSSHConfiguration `json:"ssh,omitempty"` -} - -// ContainerServiceListResult the response from the List Container Services operation. -type ContainerServiceListResult struct { - autorest.Response `json:"-"` - // Value - the list of container services. - Value *[]ContainerService `json:"value,omitempty"` - // NextLink - The URL to get the next set of container service results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ContainerServiceListResultIterator provides access to a complete listing of ContainerService values. -type ContainerServiceListResultIterator struct { - i int - page ContainerServiceListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ContainerServiceListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ContainerServiceListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ContainerServiceListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ContainerServiceListResultIterator) 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 ContainerServiceListResultIterator) Response() ContainerServiceListResult { - 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 ContainerServiceListResultIterator) Value() ContainerService { - if !iter.page.NotDone() { - return ContainerService{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ContainerServiceListResultIterator type. -func NewContainerServiceListResultIterator(page ContainerServiceListResultPage) ContainerServiceListResultIterator { - return ContainerServiceListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (cslr ContainerServiceListResult) IsEmpty() bool { - return cslr.Value == nil || len(*cslr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (cslr ContainerServiceListResult) hasNextLink() bool { - return cslr.NextLink != nil && len(*cslr.NextLink) != 0 -} - -// containerServiceListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (cslr ContainerServiceListResult) containerServiceListResultPreparer(ctx context.Context) (*http.Request, error) { - if !cslr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(cslr.NextLink))) -} - -// ContainerServiceListResultPage contains a page of ContainerService values. -type ContainerServiceListResultPage struct { - fn func(context.Context, ContainerServiceListResult) (ContainerServiceListResult, error) - cslr ContainerServiceListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ContainerServiceListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ContainerServiceListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.cslr) - if err != nil { - return err - } - page.cslr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ContainerServiceListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ContainerServiceListResultPage) NotDone() bool { - return !page.cslr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ContainerServiceListResultPage) Response() ContainerServiceListResult { - return page.cslr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ContainerServiceListResultPage) Values() []ContainerService { - if page.cslr.IsEmpty() { - return nil - } - return *page.cslr.Value -} - -// Creates a new instance of the ContainerServiceListResultPage type. -func NewContainerServiceListResultPage(cur ContainerServiceListResult, getNextPage func(context.Context, ContainerServiceListResult) (ContainerServiceListResult, error)) ContainerServiceListResultPage { - return ContainerServiceListResultPage{ - fn: getNextPage, - cslr: cur, - } -} - -// ContainerServiceMasterProfile profile for the container service master. -type ContainerServiceMasterProfile struct { - // Count - Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, and 5. The default value is 1. - Count *int32 `json:"count,omitempty"` - // DNSPrefix - DNS prefix to be used to create the FQDN for master. - DNSPrefix *string `json:"dnsPrefix,omitempty"` - // Fqdn - READ-ONLY; FQDN for the master. - Fqdn *string `json:"fqdn,omitempty"` -} - -// MarshalJSON is the custom marshaler for ContainerServiceMasterProfile. -func (csmp ContainerServiceMasterProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if csmp.Count != nil { - objectMap["count"] = csmp.Count - } - if csmp.DNSPrefix != nil { - objectMap["dnsPrefix"] = csmp.DNSPrefix - } - return json.Marshal(objectMap) -} - -// ContainerServiceOrchestratorProfile profile for the container service orchestrator. -type ContainerServiceOrchestratorProfile struct { - // OrchestratorType - The orchestrator to use to manage container service cluster resources. Valid values are Swarm, DCOS, and Custom. Possible values include: 'Swarm', 'DCOS', 'Custom', 'Kubernetes' - OrchestratorType ContainerServiceOrchestratorTypes `json:"orchestratorType,omitempty"` -} - -// ContainerServiceProperties properties of the container service. -type ContainerServiceProperties struct { - // ProvisioningState - READ-ONLY; the current deployment or provisioning state, which only appears in the response. - ProvisioningState *string `json:"provisioningState,omitempty"` - // OrchestratorProfile - Properties of the orchestrator. - OrchestratorProfile *ContainerServiceOrchestratorProfile `json:"orchestratorProfile,omitempty"` - // CustomProfile - Properties for custom clusters. - CustomProfile *ContainerServiceCustomProfile `json:"customProfile,omitempty"` - // ServicePrincipalProfile - Properties for cluster service principals. - ServicePrincipalProfile *ContainerServiceServicePrincipalProfile `json:"servicePrincipalProfile,omitempty"` - // MasterProfile - Properties of master agents. - MasterProfile *ContainerServiceMasterProfile `json:"masterProfile,omitempty"` - // AgentPoolProfiles - Properties of the agent pool. - AgentPoolProfiles *[]ContainerServiceAgentPoolProfile `json:"agentPoolProfiles,omitempty"` - // WindowsProfile - Properties of Windows VMs. - WindowsProfile *ContainerServiceWindowsProfile `json:"windowsProfile,omitempty"` - // LinuxProfile - Properties of Linux VMs. - LinuxProfile *ContainerServiceLinuxProfile `json:"linuxProfile,omitempty"` - // DiagnosticsProfile - Properties of the diagnostic agent. - DiagnosticsProfile *ContainerServiceDiagnosticsProfile `json:"diagnosticsProfile,omitempty"` -} - -// MarshalJSON is the custom marshaler for ContainerServiceProperties. -func (csp ContainerServiceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if csp.OrchestratorProfile != nil { - objectMap["orchestratorProfile"] = csp.OrchestratorProfile - } - if csp.CustomProfile != nil { - objectMap["customProfile"] = csp.CustomProfile - } - if csp.ServicePrincipalProfile != nil { - objectMap["servicePrincipalProfile"] = csp.ServicePrincipalProfile - } - if csp.MasterProfile != nil { - objectMap["masterProfile"] = csp.MasterProfile - } - if csp.AgentPoolProfiles != nil { - objectMap["agentPoolProfiles"] = csp.AgentPoolProfiles - } - if csp.WindowsProfile != nil { - objectMap["windowsProfile"] = csp.WindowsProfile - } - if csp.LinuxProfile != nil { - objectMap["linuxProfile"] = csp.LinuxProfile - } - if csp.DiagnosticsProfile != nil { - objectMap["diagnosticsProfile"] = csp.DiagnosticsProfile - } - return json.Marshal(objectMap) -} - -// ContainerServicesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type ContainerServicesCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ContainerServicesClient) (ContainerService, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ContainerServicesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ContainerServicesCreateOrUpdateFuture.Result. -func (future *ContainerServicesCreateOrUpdateFuture) result(client ContainerServicesClient) (cs ContainerService, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ContainerServicesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - cs.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.ContainerServicesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if cs.Response.Response, err = future.GetResult(sender); err == nil && cs.Response.Response.StatusCode != http.StatusNoContent { - cs, err = client.CreateOrUpdateResponder(cs.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ContainerServicesCreateOrUpdateFuture", "Result", cs.Response.Response, "Failure responding to request") - } - } - return -} - -// ContainerServicesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ContainerServicesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ContainerServicesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ContainerServicesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ContainerServicesDeleteFuture.Result. -func (future *ContainerServicesDeleteFuture) result(client ContainerServicesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ContainerServicesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.ContainerServicesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// 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"` - // Secret - The secret password associated with the service principal. - Secret *string `json:"secret,omitempty"` -} - -// ContainerServiceSSHConfiguration SSH configuration for Linux-based VMs running on Azure. -type ContainerServiceSSHConfiguration struct { - // PublicKeys - the list of SSH public keys used to authenticate with Linux-based VMs. - PublicKeys *[]ContainerServiceSSHPublicKey `json:"publicKeys,omitempty"` -} - -// ContainerServiceSSHPublicKey contains information about SSH certificate public key data. -type ContainerServiceSSHPublicKey struct { - // KeyData - Certificate public key used to authenticate with VMs through SSH. The certificate must be in PEM format with or without headers. - KeyData *string `json:"keyData,omitempty"` -} - -// ContainerServiceVMDiagnostics profile for diagnostics on the container service VMs. -type ContainerServiceVMDiagnostics struct { - // Enabled - Whether the VM diagnostic agent is provisioned on the VM. - Enabled *bool `json:"enabled,omitempty"` - // StorageURI - READ-ONLY; The URI of the storage account where diagnostics are stored. - StorageURI *string `json:"storageUri,omitempty"` -} - -// MarshalJSON is the custom marshaler for ContainerServiceVMDiagnostics. -func (csvd ContainerServiceVMDiagnostics) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if csvd.Enabled != nil { - objectMap["enabled"] = csvd.Enabled - } - return json.Marshal(objectMap) -} - -// ContainerServiceWindowsProfile profile for Windows VMs in the container service cluster. -type ContainerServiceWindowsProfile struct { - // AdminUsername - The administrator username to use for Windows VMs. - AdminUsername *string `json:"adminUsername,omitempty"` - // AdminPassword - The administrator password to use for Windows VMs. - AdminPassword *string `json:"adminPassword,omitempty"` -} - -// CreationData data used when creating a disk. -type CreationData struct { - // CreateOption - This enumerates the possible sources of a disk's creation. Possible values include: 'Empty', 'Attach', 'FromImage', 'Import', 'Copy', 'Restore', 'Upload' - CreateOption DiskCreateOption `json:"createOption,omitempty"` - // StorageAccountID - Required if createOption is Import. The Azure Resource Manager identifier of the storage account containing the blob to import as a disk. - StorageAccountID *string `json:"storageAccountId,omitempty"` - // ImageReference - Disk source information. - ImageReference *ImageDiskReference `json:"imageReference,omitempty"` - // GalleryImageReference - Required if creating from a Gallery Image. The id of the ImageDiskReference will be the ARM id of the shared galley image version from which to create a disk. - GalleryImageReference *ImageDiskReference `json:"galleryImageReference,omitempty"` - // SourceURI - If createOption is Import, this is the URI of a blob to be imported into a managed disk. - SourceURI *string `json:"sourceUri,omitempty"` - // SourceResourceID - If createOption is Copy, this is the ARM id of the source snapshot or disk. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // SourceUniqueID - READ-ONLY; If this field is set, this is the unique id identifying the source of this resource. - SourceUniqueID *string `json:"sourceUniqueId,omitempty"` - // UploadSizeBytes - If createOption is Upload, this is the size of the contents of the upload including the VHD footer. This value should be between 20972032 (20 MiB + 512 bytes for the VHD footer) and 35183298347520 bytes (32 TiB + 512 bytes for the VHD footer). - UploadSizeBytes *int64 `json:"uploadSizeBytes,omitempty"` -} - -// MarshalJSON is the custom marshaler for CreationData. -func (cd CreationData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cd.CreateOption != "" { - objectMap["createOption"] = cd.CreateOption - } - if cd.StorageAccountID != nil { - objectMap["storageAccountId"] = cd.StorageAccountID - } - if cd.ImageReference != nil { - objectMap["imageReference"] = cd.ImageReference - } - if cd.GalleryImageReference != nil { - objectMap["galleryImageReference"] = cd.GalleryImageReference - } - if cd.SourceURI != nil { - objectMap["sourceUri"] = cd.SourceURI - } - if cd.SourceResourceID != nil { - objectMap["sourceResourceId"] = cd.SourceResourceID - } - if cd.UploadSizeBytes != nil { - objectMap["uploadSizeBytes"] = cd.UploadSizeBytes - } - return json.Marshal(objectMap) -} - -// DataDisk describes a data disk. -type DataDisk struct { - // Lun - Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM. - Lun *int32 `json:"lun,omitempty"` - // Name - The disk name. - Name *string `json:"name,omitempty"` - // Vhd - The virtual hard disk. - Vhd *VirtualHardDisk `json:"vhd,omitempty"` - // Image - 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. - Image *VirtualHardDisk `json:"image,omitempty"` - // Caching - Specifies the caching requirements.

      Possible values are:

      **None**

      **ReadOnly**

      **ReadWrite**

      Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' - Caching CachingTypes `json:"caching,omitempty"` - // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. - WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` - // CreateOption - Specifies how the virtual machine should be created.

      Possible values are:

      **Attach** \u2013 This value is used when you are using a specialized disk to create the virtual machine.

      **FromImage** \u2013 This value is used when you are using an image to create the virtual machine. If you are using a platform image, you also use the imageReference element described above. If you are using a marketplace image, you also use the plan element previously described. Possible values include: 'DiskCreateOptionTypesFromImage', 'DiskCreateOptionTypesEmpty', 'DiskCreateOptionTypesAttach' - CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` - // DiskSizeGB - Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image.

      This value cannot be larger than 1023 GB - DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` - // ManagedDisk - The managed disk parameters. - ManagedDisk *ManagedDiskParameters `json:"managedDisk,omitempty"` - // ToBeDetached - Specifies whether the data disk is in process of detachment from the VirtualMachine/VirtualMachineScaleset - ToBeDetached *bool `json:"toBeDetached,omitempty"` - // DiskIOPSReadWrite - READ-ONLY; Specifies the Read-Write IOPS for the managed disk when StorageAccountType is UltraSSD_LRS. Returned only for VirtualMachine ScaleSet VM disks. Can be updated only via updates to the VirtualMachine Scale Set. - DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` - // DiskMBpsReadWrite - READ-ONLY; Specifies the bandwidth in MB per second for the managed disk when StorageAccountType is UltraSSD_LRS. Returned only for VirtualMachine ScaleSet VM disks. Can be updated only via updates to the VirtualMachine Scale Set. - DiskMBpsReadWrite *int64 `json:"diskMBpsReadWrite,omitempty"` -} - -// MarshalJSON is the custom marshaler for DataDisk. -func (dd DataDisk) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dd.Lun != nil { - objectMap["lun"] = dd.Lun - } - if dd.Name != nil { - objectMap["name"] = dd.Name - } - if dd.Vhd != nil { - objectMap["vhd"] = dd.Vhd - } - if dd.Image != nil { - objectMap["image"] = dd.Image - } - if dd.Caching != "" { - objectMap["caching"] = dd.Caching - } - if dd.WriteAcceleratorEnabled != nil { - objectMap["writeAcceleratorEnabled"] = dd.WriteAcceleratorEnabled - } - if dd.CreateOption != "" { - objectMap["createOption"] = dd.CreateOption - } - if dd.DiskSizeGB != nil { - objectMap["diskSizeGB"] = dd.DiskSizeGB - } - if dd.ManagedDisk != nil { - objectMap["managedDisk"] = dd.ManagedDisk - } - if dd.ToBeDetached != nil { - objectMap["toBeDetached"] = dd.ToBeDetached - } - return json.Marshal(objectMap) -} - -// DataDiskImage contains the data disk images information. -type DataDiskImage struct { - // Lun - READ-ONLY; Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM. - Lun *int32 `json:"lun,omitempty"` -} - -// MarshalJSON is the custom marshaler for DataDiskImage. -func (ddi DataDiskImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// DataDiskImageEncryption contains encryption settings for a data disk image. -type DataDiskImageEncryption struct { - // Lun - This property specifies the logical unit number of the data disk. This value is used to identify data disks within the Virtual Machine and therefore must be unique for each data disk attached to the Virtual Machine. - Lun *int32 `json:"lun,omitempty"` - // DiskEncryptionSetID - A relative URI containing the resource ID of the disk encryption set. - DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` -} - -// DedicatedHost specifies information about the Dedicated host. -type DedicatedHost struct { - autorest.Response `json:"-"` - *DedicatedHostProperties `json:"properties,omitempty"` - // Sku - SKU of the dedicated host for Hardware Generation and VM family. Only name is required to be set. List Microsoft.Compute SKUs for a list of possible values. - Sku *Sku `json:"sku,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; 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 DedicatedHost. -func (dh DedicatedHost) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dh.DedicatedHostProperties != nil { - objectMap["properties"] = dh.DedicatedHostProperties - } - if dh.Sku != nil { - objectMap["sku"] = dh.Sku - } - if dh.Location != nil { - objectMap["location"] = dh.Location - } - if dh.Tags != nil { - objectMap["tags"] = dh.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for DedicatedHost struct. -func (dh *DedicatedHost) 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 dedicatedHostProperties DedicatedHostProperties - err = json.Unmarshal(*v, &dedicatedHostProperties) - if err != nil { - return err - } - dh.DedicatedHostProperties = &dedicatedHostProperties - } - case "sku": - if v != nil { - var sku Sku - err = json.Unmarshal(*v, &sku) - if err != nil { - return err - } - dh.Sku = &sku - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - dh.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - dh.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - dh.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - dh.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - dh.Tags = tags - } - } - } - - return nil -} - -// DedicatedHostAllocatableVM represents the dedicated host unutilized capacity in terms of a specific VM -// size. -type DedicatedHostAllocatableVM struct { - // VMSize - VM size in terms of which the unutilized capacity is represented. - VMSize *string `json:"vmSize,omitempty"` - // Count - Maximum number of VMs of size vmSize that can fit in the dedicated host's remaining capacity. - Count *float64 `json:"count,omitempty"` -} - -// DedicatedHostAvailableCapacity dedicated host unutilized capacity. -type DedicatedHostAvailableCapacity struct { - // AllocatableVMs - The unutilized capacity of the dedicated host represented in terms of each VM size that is allowed to be deployed to the dedicated host. - AllocatableVMs *[]DedicatedHostAllocatableVM `json:"allocatableVMs,omitempty"` -} - -// DedicatedHostGroup specifies information about the dedicated host group that the dedicated hosts should -// be assigned to.

      Currently, a dedicated host can only be added to a dedicated host group at -// creation time. An existing dedicated host cannot be added to another dedicated host group. -type DedicatedHostGroup struct { - autorest.Response `json:"-"` - *DedicatedHostGroupProperties `json:"properties,omitempty"` - // Zones - Availability Zone to use for this host group. Only single zone is supported. The zone can be assigned only during creation. If not provided, the group supports all zones in the region. If provided, enforces each host in the group to be in the same zone. - Zones *[]string `json:"zones,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; 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 DedicatedHostGroup. -func (dhg DedicatedHostGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dhg.DedicatedHostGroupProperties != nil { - objectMap["properties"] = dhg.DedicatedHostGroupProperties - } - if dhg.Zones != nil { - objectMap["zones"] = dhg.Zones - } - if dhg.Location != nil { - objectMap["location"] = dhg.Location - } - if dhg.Tags != nil { - objectMap["tags"] = dhg.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for DedicatedHostGroup struct. -func (dhg *DedicatedHostGroup) 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 dedicatedHostGroupProperties DedicatedHostGroupProperties - err = json.Unmarshal(*v, &dedicatedHostGroupProperties) - if err != nil { - return err - } - dhg.DedicatedHostGroupProperties = &dedicatedHostGroupProperties - } - case "zones": - if v != nil { - var zones []string - err = json.Unmarshal(*v, &zones) - if err != nil { - return err - } - dhg.Zones = &zones - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - dhg.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - dhg.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - dhg.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - dhg.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - dhg.Tags = tags - } - } - } - - return nil -} - -// DedicatedHostGroupListResult the List Dedicated Host Group with resource group response. -type DedicatedHostGroupListResult struct { - autorest.Response `json:"-"` - // Value - The list of dedicated host groups - Value *[]DedicatedHostGroup `json:"value,omitempty"` - // NextLink - The URI to fetch the next page of Dedicated Host Groups. Call ListNext() with this URI to fetch the next page of Dedicated Host Groups. - NextLink *string `json:"nextLink,omitempty"` -} - -// DedicatedHostGroupListResultIterator provides access to a complete listing of DedicatedHostGroup values. -type DedicatedHostGroupListResultIterator struct { - i int - page DedicatedHostGroupListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *DedicatedHostGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *DedicatedHostGroupListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter DedicatedHostGroupListResultIterator) 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 DedicatedHostGroupListResultIterator) Response() DedicatedHostGroupListResult { - 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 DedicatedHostGroupListResultIterator) Value() DedicatedHostGroup { - if !iter.page.NotDone() { - return DedicatedHostGroup{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the DedicatedHostGroupListResultIterator type. -func NewDedicatedHostGroupListResultIterator(page DedicatedHostGroupListResultPage) DedicatedHostGroupListResultIterator { - return DedicatedHostGroupListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (dhglr DedicatedHostGroupListResult) IsEmpty() bool { - return dhglr.Value == nil || len(*dhglr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (dhglr DedicatedHostGroupListResult) hasNextLink() bool { - return dhglr.NextLink != nil && len(*dhglr.NextLink) != 0 -} - -// dedicatedHostGroupListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (dhglr DedicatedHostGroupListResult) dedicatedHostGroupListResultPreparer(ctx context.Context) (*http.Request, error) { - if !dhglr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(dhglr.NextLink))) -} - -// DedicatedHostGroupListResultPage contains a page of DedicatedHostGroup values. -type DedicatedHostGroupListResultPage struct { - fn func(context.Context, DedicatedHostGroupListResult) (DedicatedHostGroupListResult, error) - dhglr DedicatedHostGroupListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *DedicatedHostGroupListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.dhglr) - if err != nil { - return err - } - page.dhglr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *DedicatedHostGroupListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page DedicatedHostGroupListResultPage) NotDone() bool { - return !page.dhglr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page DedicatedHostGroupListResultPage) Response() DedicatedHostGroupListResult { - return page.dhglr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page DedicatedHostGroupListResultPage) Values() []DedicatedHostGroup { - if page.dhglr.IsEmpty() { - return nil - } - return *page.dhglr.Value -} - -// Creates a new instance of the DedicatedHostGroupListResultPage type. -func NewDedicatedHostGroupListResultPage(cur DedicatedHostGroupListResult, getNextPage func(context.Context, DedicatedHostGroupListResult) (DedicatedHostGroupListResult, error)) DedicatedHostGroupListResultPage { - return DedicatedHostGroupListResultPage{ - fn: getNextPage, - dhglr: cur, - } -} - -// DedicatedHostGroupProperties dedicated Host Group Properties. -type DedicatedHostGroupProperties struct { - // PlatformFaultDomainCount - Number of fault domains that the host group can span. - PlatformFaultDomainCount *int32 `json:"platformFaultDomainCount,omitempty"` - // Hosts - READ-ONLY; A list of references to all dedicated hosts in the dedicated host group. - Hosts *[]SubResourceReadOnly `json:"hosts,omitempty"` -} - -// MarshalJSON is the custom marshaler for DedicatedHostGroupProperties. -func (dhgp DedicatedHostGroupProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dhgp.PlatformFaultDomainCount != nil { - objectMap["platformFaultDomainCount"] = dhgp.PlatformFaultDomainCount - } - return json.Marshal(objectMap) -} - -// DedicatedHostGroupUpdate specifies information about the dedicated host group that the dedicated host -// should be assigned to. Only tags may be updated. -type DedicatedHostGroupUpdate struct { - *DedicatedHostGroupProperties `json:"properties,omitempty"` - // Zones - Availability Zone to use for this host group. Only single zone is supported. The zone can be assigned only during creation. If not provided, the group supports all zones in the region. If provided, enforces each host in the group to be in the same zone. - Zones *[]string `json:"zones,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for DedicatedHostGroupUpdate. -func (dhgu DedicatedHostGroupUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dhgu.DedicatedHostGroupProperties != nil { - objectMap["properties"] = dhgu.DedicatedHostGroupProperties - } - if dhgu.Zones != nil { - objectMap["zones"] = dhgu.Zones - } - if dhgu.Tags != nil { - objectMap["tags"] = dhgu.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for DedicatedHostGroupUpdate struct. -func (dhgu *DedicatedHostGroupUpdate) 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 dedicatedHostGroupProperties DedicatedHostGroupProperties - err = json.Unmarshal(*v, &dedicatedHostGroupProperties) - if err != nil { - return err - } - dhgu.DedicatedHostGroupProperties = &dedicatedHostGroupProperties - } - case "zones": - if v != nil { - var zones []string - err = json.Unmarshal(*v, &zones) - if err != nil { - return err - } - dhgu.Zones = &zones - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - dhgu.Tags = tags - } - } - } - - return nil -} - -// DedicatedHostInstanceView the instance view of a dedicated host. -type DedicatedHostInstanceView struct { - // AssetID - READ-ONLY; Specifies the unique id of the dedicated physical machine on which the dedicated host resides. - AssetID *string `json:"assetId,omitempty"` - // AvailableCapacity - Unutilized capacity of the dedicated host. - AvailableCapacity *DedicatedHostAvailableCapacity `json:"availableCapacity,omitempty"` - // Statuses - The resource status information. - Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` -} - -// MarshalJSON is the custom marshaler for DedicatedHostInstanceView. -func (dhiv DedicatedHostInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dhiv.AvailableCapacity != nil { - objectMap["availableCapacity"] = dhiv.AvailableCapacity - } - if dhiv.Statuses != nil { - objectMap["statuses"] = dhiv.Statuses - } - return json.Marshal(objectMap) -} - -// DedicatedHostListResult the list dedicated host operation response. -type DedicatedHostListResult struct { - autorest.Response `json:"-"` - // Value - The list of dedicated hosts - Value *[]DedicatedHost `json:"value,omitempty"` - // NextLink - The URI to fetch the next page of dedicated hosts. Call ListNext() with this URI to fetch the next page of dedicated hosts. - NextLink *string `json:"nextLink,omitempty"` -} - -// DedicatedHostListResultIterator provides access to a complete listing of DedicatedHost values. -type DedicatedHostListResultIterator struct { - i int - page DedicatedHostListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *DedicatedHostListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *DedicatedHostListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter DedicatedHostListResultIterator) 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 DedicatedHostListResultIterator) Response() DedicatedHostListResult { - 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 DedicatedHostListResultIterator) Value() DedicatedHost { - if !iter.page.NotDone() { - return DedicatedHost{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the DedicatedHostListResultIterator type. -func NewDedicatedHostListResultIterator(page DedicatedHostListResultPage) DedicatedHostListResultIterator { - return DedicatedHostListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (dhlr DedicatedHostListResult) IsEmpty() bool { - return dhlr.Value == nil || len(*dhlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (dhlr DedicatedHostListResult) hasNextLink() bool { - return dhlr.NextLink != nil && len(*dhlr.NextLink) != 0 -} - -// dedicatedHostListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (dhlr DedicatedHostListResult) dedicatedHostListResultPreparer(ctx context.Context) (*http.Request, error) { - if !dhlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(dhlr.NextLink))) -} - -// DedicatedHostListResultPage contains a page of DedicatedHost values. -type DedicatedHostListResultPage struct { - fn func(context.Context, DedicatedHostListResult) (DedicatedHostListResult, error) - dhlr DedicatedHostListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *DedicatedHostListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.dhlr) - if err != nil { - return err - } - page.dhlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *DedicatedHostListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page DedicatedHostListResultPage) NotDone() bool { - return !page.dhlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page DedicatedHostListResultPage) Response() DedicatedHostListResult { - return page.dhlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page DedicatedHostListResultPage) Values() []DedicatedHost { - if page.dhlr.IsEmpty() { - return nil - } - return *page.dhlr.Value -} - -// Creates a new instance of the DedicatedHostListResultPage type. -func NewDedicatedHostListResultPage(cur DedicatedHostListResult, getNextPage func(context.Context, DedicatedHostListResult) (DedicatedHostListResult, error)) DedicatedHostListResultPage { - return DedicatedHostListResultPage{ - fn: getNextPage, - dhlr: cur, - } -} - -// DedicatedHostProperties properties of the dedicated host. -type DedicatedHostProperties struct { - // PlatformFaultDomain - Fault domain of the dedicated host within a dedicated host group. - PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"` - // AutoReplaceOnFailure - Specifies whether the dedicated host should be replaced automatically in case of a failure. The value is defaulted to 'true' when not provided. - AutoReplaceOnFailure *bool `json:"autoReplaceOnFailure,omitempty"` - // HostID - READ-ONLY; A unique id generated and assigned to the dedicated host by the platform.

      Does not change throughout the lifetime of the host. - HostID *string `json:"hostId,omitempty"` - // VirtualMachines - READ-ONLY; A list of references to all virtual machines in the Dedicated Host. - VirtualMachines *[]SubResourceReadOnly `json:"virtualMachines,omitempty"` - // LicenseType - Specifies the software license type that will be applied to the VMs deployed on the dedicated host.

      Possible values are:

      **None**

      **Windows_Server_Hybrid**

      **Windows_Server_Perpetual**

      Default: **None**. Possible values include: 'DedicatedHostLicenseTypesNone', 'DedicatedHostLicenseTypesWindowsServerHybrid', 'DedicatedHostLicenseTypesWindowsServerPerpetual' - LicenseType DedicatedHostLicenseTypes `json:"licenseType,omitempty"` - // ProvisioningTime - READ-ONLY; The date when the host was first provisioned. - ProvisioningTime *date.Time `json:"provisioningTime,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *string `json:"provisioningState,omitempty"` - // InstanceView - READ-ONLY; The dedicated host instance view. - InstanceView *DedicatedHostInstanceView `json:"instanceView,omitempty"` -} - -// MarshalJSON is the custom marshaler for DedicatedHostProperties. -func (dhp DedicatedHostProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dhp.PlatformFaultDomain != nil { - objectMap["platformFaultDomain"] = dhp.PlatformFaultDomain - } - if dhp.AutoReplaceOnFailure != nil { - objectMap["autoReplaceOnFailure"] = dhp.AutoReplaceOnFailure - } - if dhp.LicenseType != "" { - objectMap["licenseType"] = dhp.LicenseType - } - return json.Marshal(objectMap) -} - -// DedicatedHostsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type DedicatedHostsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DedicatedHostsClient) (DedicatedHost, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DedicatedHostsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DedicatedHostsCreateOrUpdateFuture.Result. -func (future *DedicatedHostsCreateOrUpdateFuture) result(client DedicatedHostsClient) (dh DedicatedHost, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - dh.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.DedicatedHostsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if dh.Response.Response, err = future.GetResult(sender); err == nil && dh.Response.Response.StatusCode != http.StatusNoContent { - dh, err = client.CreateOrUpdateResponder(dh.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsCreateOrUpdateFuture", "Result", dh.Response.Response, "Failure responding to request") - } - } - return -} - -// DedicatedHostsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type DedicatedHostsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DedicatedHostsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DedicatedHostsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DedicatedHostsDeleteFuture.Result. -func (future *DedicatedHostsDeleteFuture) result(client DedicatedHostsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.DedicatedHostsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// DedicatedHostsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type DedicatedHostsUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DedicatedHostsClient) (DedicatedHost, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DedicatedHostsUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DedicatedHostsUpdateFuture.Result. -func (future *DedicatedHostsUpdateFuture) result(client DedicatedHostsClient) (dh DedicatedHost, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - dh.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.DedicatedHostsUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if dh.Response.Response, err = future.GetResult(sender); err == nil && dh.Response.Response.StatusCode != http.StatusNoContent { - dh, err = client.UpdateResponder(dh.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsUpdateFuture", "Result", dh.Response.Response, "Failure responding to request") - } - } - return -} - -// DedicatedHostUpdate specifies information about the dedicated host. Only tags, autoReplaceOnFailure and -// licenseType may be updated. -type DedicatedHostUpdate struct { - *DedicatedHostProperties `json:"properties,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for DedicatedHostUpdate. -func (dhu DedicatedHostUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dhu.DedicatedHostProperties != nil { - objectMap["properties"] = dhu.DedicatedHostProperties - } - if dhu.Tags != nil { - objectMap["tags"] = dhu.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for DedicatedHostUpdate struct. -func (dhu *DedicatedHostUpdate) 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 dedicatedHostProperties DedicatedHostProperties - err = json.Unmarshal(*v, &dedicatedHostProperties) - if err != nil { - return err - } - dhu.DedicatedHostProperties = &dedicatedHostProperties - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - dhu.Tags = tags - } - } - } - - return nil -} - -// DiagnosticsProfile specifies the boot diagnostic settings state.

      Minimum api-version: -// 2015-06-15. -type DiagnosticsProfile struct { - // BootDiagnostics - Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to diagnose VM status.

      You can easily view the output of your console log.

      Azure also enables you to see a screenshot of the VM from the hypervisor. - BootDiagnostics *BootDiagnostics `json:"bootDiagnostics,omitempty"` -} - -// DiffDiskSettings describes the parameters of ephemeral disk settings that can be specified for operating -// system disk.

      NOTE: The ephemeral disk settings can only be specified for managed disk. -type DiffDiskSettings struct { - // Option - Specifies the ephemeral disk settings for operating system disk. Possible values include: 'Local' - Option DiffDiskOptions `json:"option,omitempty"` - // Placement - Specifies the ephemeral disk placement for operating system disk.

      Possible values are:

      **CacheDisk**

      **ResourceDisk**

      Default: **CacheDisk** if one is configured for the VM size otherwise **ResourceDisk** is used.

      Refer to VM size documentation for Windows VM at https://docs.microsoft.com/en-us/azure/virtual-machines/windows/sizes and Linux VM at https://docs.microsoft.com/en-us/azure/virtual-machines/linux/sizes to check which VM sizes exposes a cache disk. Possible values include: 'CacheDisk', 'ResourceDisk' - Placement DiffDiskPlacement `json:"placement,omitempty"` -} - -// Disallowed describes the disallowed disk types. -type Disallowed struct { - // DiskTypes - A list of disk types. - DiskTypes *[]string `json:"diskTypes,omitempty"` -} - -// Disk disk resource. -type Disk struct { - autorest.Response `json:"-"` - // ManagedBy - READ-ONLY; A relative URI containing the ID of the VM that has the disk attached. - ManagedBy *string `json:"managedBy,omitempty"` - // ManagedByExtended - READ-ONLY; List of relative URIs containing the IDs of the VMs that have the disk attached. maxShares should be set to a value greater than one for disks to allow attaching them to multiple VMs. - ManagedByExtended *[]string `json:"managedByExtended,omitempty"` - Sku *DiskSku `json:"sku,omitempty"` - // Zones - The Logical zone list for Disk. - Zones *[]string `json:"zones,omitempty"` - *DiskProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; 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 Disk. -func (d Disk) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - 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.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 "managedByExtended": - if v != nil { - var managedByExtended []string - err = json.Unmarshal(*v, &managedByExtended) - if err != nil { - return err - } - d.ManagedByExtended = &managedByExtended - } - 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 -} - -// DiskEncryptionSet disk encryption set resource. -type DiskEncryptionSet struct { - autorest.Response `json:"-"` - Identity *EncryptionSetIdentity `json:"identity,omitempty"` - *EncryptionSetProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; 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 DiskEncryptionSet. -func (desVar DiskEncryptionSet) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if desVar.Identity != nil { - objectMap["identity"] = desVar.Identity - } - if desVar.EncryptionSetProperties != nil { - objectMap["properties"] = desVar.EncryptionSetProperties - } - if desVar.Location != nil { - objectMap["location"] = desVar.Location - } - if desVar.Tags != nil { - objectMap["tags"] = desVar.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for DiskEncryptionSet struct. -func (desVar *DiskEncryptionSet) 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 EncryptionSetIdentity - err = json.Unmarshal(*v, &identity) - if err != nil { - return err - } - desVar.Identity = &identity - } - case "properties": - if v != nil { - var encryptionSetProperties EncryptionSetProperties - err = json.Unmarshal(*v, &encryptionSetProperties) - if err != nil { - return err - } - desVar.EncryptionSetProperties = &encryptionSetProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - desVar.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - desVar.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - desVar.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - desVar.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - desVar.Tags = tags - } - } - } - - return nil -} - -// DiskEncryptionSetList the List disk encryption set operation response. -type DiskEncryptionSetList struct { - autorest.Response `json:"-"` - // Value - A list of disk encryption sets. - Value *[]DiskEncryptionSet `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of disk encryption sets. Call ListNext() with this to fetch the next page of disk encryption sets. - NextLink *string `json:"nextLink,omitempty"` -} - -// DiskEncryptionSetListIterator provides access to a complete listing of DiskEncryptionSet values. -type DiskEncryptionSetListIterator struct { - i int - page DiskEncryptionSetListPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *DiskEncryptionSetListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *DiskEncryptionSetListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter DiskEncryptionSetListIterator) 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 DiskEncryptionSetListIterator) Response() DiskEncryptionSetList { - 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 DiskEncryptionSetListIterator) Value() DiskEncryptionSet { - if !iter.page.NotDone() { - return DiskEncryptionSet{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the DiskEncryptionSetListIterator type. -func NewDiskEncryptionSetListIterator(page DiskEncryptionSetListPage) DiskEncryptionSetListIterator { - return DiskEncryptionSetListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (desl DiskEncryptionSetList) IsEmpty() bool { - return desl.Value == nil || len(*desl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (desl DiskEncryptionSetList) hasNextLink() bool { - return desl.NextLink != nil && len(*desl.NextLink) != 0 -} - -// diskEncryptionSetListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (desl DiskEncryptionSetList) diskEncryptionSetListPreparer(ctx context.Context) (*http.Request, error) { - if !desl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(desl.NextLink))) -} - -// DiskEncryptionSetListPage contains a page of DiskEncryptionSet values. -type DiskEncryptionSetListPage struct { - fn func(context.Context, DiskEncryptionSetList) (DiskEncryptionSetList, error) - desl DiskEncryptionSetList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *DiskEncryptionSetListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.desl) - if err != nil { - return err - } - page.desl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *DiskEncryptionSetListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page DiskEncryptionSetListPage) NotDone() bool { - return !page.desl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page DiskEncryptionSetListPage) Response() DiskEncryptionSetList { - return page.desl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page DiskEncryptionSetListPage) Values() []DiskEncryptionSet { - if page.desl.IsEmpty() { - return nil - } - return *page.desl.Value -} - -// Creates a new instance of the DiskEncryptionSetListPage type. -func NewDiskEncryptionSetListPage(cur DiskEncryptionSetList, getNextPage func(context.Context, DiskEncryptionSetList) (DiskEncryptionSetList, error)) DiskEncryptionSetListPage { - return DiskEncryptionSetListPage{ - fn: getNextPage, - desl: cur, - } -} - -// DiskEncryptionSetParameters describes the parameter of customer managed disk encryption set resource id -// that can be specified for disk.

      NOTE: The disk encryption set resource id can only be specified -// for managed disk. Please refer https://aka.ms/mdssewithcmkoverview for more details. -type DiskEncryptionSetParameters struct { - // ID - Resource Id - ID *string `json:"id,omitempty"` -} - -// DiskEncryptionSetsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type DiskEncryptionSetsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DiskEncryptionSetsClient) (DiskEncryptionSet, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DiskEncryptionSetsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DiskEncryptionSetsCreateOrUpdateFuture.Result. -func (future *DiskEncryptionSetsCreateOrUpdateFuture) result(client DiskEncryptionSetsClient) (desVar DiskEncryptionSet, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - desVar.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.DiskEncryptionSetsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if desVar.Response.Response, err = future.GetResult(sender); err == nil && desVar.Response.Response.StatusCode != http.StatusNoContent { - desVar, err = client.CreateOrUpdateResponder(desVar.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsCreateOrUpdateFuture", "Result", desVar.Response.Response, "Failure responding to request") - } - } - return -} - -// DiskEncryptionSetsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type DiskEncryptionSetsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DiskEncryptionSetsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DiskEncryptionSetsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DiskEncryptionSetsDeleteFuture.Result. -func (future *DiskEncryptionSetsDeleteFuture) result(client DiskEncryptionSetsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.DiskEncryptionSetsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// DiskEncryptionSetsUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type DiskEncryptionSetsUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DiskEncryptionSetsClient) (DiskEncryptionSet, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DiskEncryptionSetsUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DiskEncryptionSetsUpdateFuture.Result. -func (future *DiskEncryptionSetsUpdateFuture) result(client DiskEncryptionSetsClient) (desVar DiskEncryptionSet, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - desVar.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.DiskEncryptionSetsUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if desVar.Response.Response, err = future.GetResult(sender); err == nil && desVar.Response.Response.StatusCode != http.StatusNoContent { - desVar, err = client.UpdateResponder(desVar.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsUpdateFuture", "Result", desVar.Response.Response, "Failure responding to request") - } - } - return -} - -// DiskEncryptionSettings describes a Encryption Settings for a Disk -type DiskEncryptionSettings struct { - // DiskEncryptionKey - Specifies the location of the disk encryption key, which is a Key Vault Secret. - DiskEncryptionKey *KeyVaultSecretReference `json:"diskEncryptionKey,omitempty"` - // KeyEncryptionKey - Specifies the location of the key encryption key in Key Vault. - KeyEncryptionKey *KeyVaultKeyReference `json:"keyEncryptionKey,omitempty"` - // Enabled - Specifies whether disk encryption should be enabled on the virtual machine. - Enabled *bool `json:"enabled,omitempty"` -} - -// DiskEncryptionSetUpdate disk encryption set update resource. -type DiskEncryptionSetUpdate struct { - *DiskEncryptionSetUpdateProperties `json:"properties,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for DiskEncryptionSetUpdate. -func (desu DiskEncryptionSetUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if desu.DiskEncryptionSetUpdateProperties != nil { - objectMap["properties"] = desu.DiskEncryptionSetUpdateProperties - } - if desu.Tags != nil { - objectMap["tags"] = desu.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for DiskEncryptionSetUpdate struct. -func (desu *DiskEncryptionSetUpdate) 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 diskEncryptionSetUpdateProperties DiskEncryptionSetUpdateProperties - err = json.Unmarshal(*v, &diskEncryptionSetUpdateProperties) - if err != nil { - return err - } - desu.DiskEncryptionSetUpdateProperties = &diskEncryptionSetUpdateProperties - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - desu.Tags = tags - } - } - } - - return nil -} - -// DiskEncryptionSetUpdateProperties disk encryption set resource update properties. -type DiskEncryptionSetUpdateProperties struct { - ActiveKey *KeyVaultAndKeyReference `json:"activeKey,omitempty"` -} - -// DiskImageEncryption this is the disk image encryption base class. -type DiskImageEncryption struct { - // DiskEncryptionSetID - A relative URI containing the resource ID of the disk encryption set. - DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` -} - -// DiskInstanceView the instance view of the disk. -type DiskInstanceView struct { - // Name - The disk name. - Name *string `json:"name,omitempty"` - // EncryptionSettings - Specifies the encryption settings for the OS Disk.

      Minimum api-version: 2015-06-15 - EncryptionSettings *[]DiskEncryptionSettings `json:"encryptionSettings,omitempty"` - // Statuses - The resource status information. - Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` -} - -// DiskList the List Disks operation response. -type DiskList struct { - autorest.Response `json:"-"` - // Value - A list of disks. - Value *[]Disk `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of disks. Call ListNext() with this to fetch the next page of disks. - NextLink *string `json:"nextLink,omitempty"` -} - -// DiskListIterator provides access to a complete listing of Disk values. -type DiskListIterator struct { - i int - page DiskListPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *DiskListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *DiskListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter DiskListIterator) 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 DiskListIterator) Response() DiskList { - 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 DiskListIterator) Value() Disk { - if !iter.page.NotDone() { - return Disk{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the DiskListIterator type. -func NewDiskListIterator(page DiskListPage) DiskListIterator { - return DiskListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (dl DiskList) IsEmpty() bool { - return dl.Value == nil || len(*dl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (dl DiskList) hasNextLink() bool { - return dl.NextLink != nil && len(*dl.NextLink) != 0 -} - -// diskListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (dl DiskList) diskListPreparer(ctx context.Context) (*http.Request, error) { - if !dl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(dl.NextLink))) -} - -// DiskListPage contains a page of Disk values. -type DiskListPage struct { - fn func(context.Context, DiskList) (DiskList, error) - dl DiskList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *DiskListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.dl) - if err != nil { - return err - } - page.dl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *DiskListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page DiskListPage) NotDone() bool { - return !page.dl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page DiskListPage) Response() DiskList { - return page.dl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page DiskListPage) Values() []Disk { - if page.dl.IsEmpty() { - return nil - } - return *page.dl.Value -} - -// Creates a new instance of the DiskListPage type. -func NewDiskListPage(cur DiskList, getNextPage func(context.Context, DiskList) (DiskList, error)) DiskListPage { - return DiskListPage{ - fn: getNextPage, - dl: cur, - } -} - -// DiskProperties disk resource properties. -type DiskProperties struct { - // TimeCreated - READ-ONLY; The time when the disk was created. - TimeCreated *date.Time `json:"timeCreated,omitempty"` - // OsType - The Operating System type. Possible values include: 'Windows', 'Linux' - OsType OperatingSystemTypes `json:"osType,omitempty"` - // HyperVGeneration - The hypervisor generation of the Virtual Machine. Applicable to OS disks only. Possible values include: 'V1', 'V2' - HyperVGeneration HyperVGeneration `json:"hyperVGeneration,omitempty"` - // CreationData - Disk source information. CreationData information cannot be changed after the disk has been created. - CreationData *CreationData `json:"creationData,omitempty"` - // DiskSizeGB - If creationData.createOption is Empty, this field is mandatory and it indicates the size of the disk to create. If this field is present for updates or creation with other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size. - DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` - // DiskSizeBytes - READ-ONLY; The size of the disk in bytes. This field is read only. - DiskSizeBytes *int64 `json:"diskSizeBytes,omitempty"` - // UniqueID - READ-ONLY; Unique Guid identifying the resource. - UniqueID *string `json:"uniqueId,omitempty"` - // EncryptionSettingsCollection - Encryption settings collection used for Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. - EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` - // ProvisioningState - READ-ONLY; The disk provisioning state. - ProvisioningState *string `json:"provisioningState,omitempty"` - // DiskIOPSReadWrite - The number of IOPS allowed for this disk; only settable for UltraSSD disks. One operation can transfer between 4k and 256k bytes. - DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` - // DiskMBpsReadWrite - The bandwidth allowed for this disk; only settable for UltraSSD disks. MBps means millions of bytes per second - MB here uses the ISO notation, of powers of 10. - DiskMBpsReadWrite *int64 `json:"diskMBpsReadWrite,omitempty"` - // DiskIOPSReadOnly - The total number of IOPS that will be allowed across all VMs mounting the shared disk as ReadOnly. One operation can transfer between 4k and 256k bytes. - DiskIOPSReadOnly *int64 `json:"diskIOPSReadOnly,omitempty"` - // DiskMBpsReadOnly - The total throughput (MBps) that will be allowed across all VMs mounting the shared disk as ReadOnly. MBps means millions of bytes per second - MB here uses the ISO notation, of powers of 10. - DiskMBpsReadOnly *int64 `json:"diskMBpsReadOnly,omitempty"` - // DiskState - READ-ONLY; The state of the disk. Possible values include: 'Unattached', 'Attached', 'Reserved', 'ActiveSAS', 'ReadyToUpload', 'ActiveUpload' - DiskState DiskState `json:"diskState,omitempty"` - // Encryption - Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. - Encryption *Encryption `json:"encryption,omitempty"` - // MaxShares - The maximum number of VMs that can attach to the disk at the same time. Value greater than one indicates a disk that can be mounted on multiple VMs at the same time. - MaxShares *int32 `json:"maxShares,omitempty"` - // ShareInfo - READ-ONLY; Details of the list of all VMs that have the disk attached. maxShares should be set to a value greater than one for disks to allow attaching them to multiple VMs. - ShareInfo *[]ShareInfoElement `json:"shareInfo,omitempty"` -} - -// MarshalJSON is the custom marshaler for DiskProperties. -func (dp DiskProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dp.OsType != "" { - objectMap["osType"] = dp.OsType - } - if dp.HyperVGeneration != "" { - objectMap["hyperVGeneration"] = dp.HyperVGeneration - } - if dp.CreationData != nil { - objectMap["creationData"] = dp.CreationData - } - if dp.DiskSizeGB != nil { - objectMap["diskSizeGB"] = dp.DiskSizeGB - } - if dp.EncryptionSettingsCollection != nil { - objectMap["encryptionSettingsCollection"] = dp.EncryptionSettingsCollection - } - if dp.DiskIOPSReadWrite != nil { - objectMap["diskIOPSReadWrite"] = dp.DiskIOPSReadWrite - } - if dp.DiskMBpsReadWrite != nil { - objectMap["diskMBpsReadWrite"] = dp.DiskMBpsReadWrite - } - if dp.DiskIOPSReadOnly != nil { - objectMap["diskIOPSReadOnly"] = dp.DiskIOPSReadOnly - } - if dp.DiskMBpsReadOnly != nil { - objectMap["diskMBpsReadOnly"] = dp.DiskMBpsReadOnly - } - if dp.Encryption != nil { - objectMap["encryption"] = dp.Encryption - } - if dp.MaxShares != nil { - objectMap["maxShares"] = dp.MaxShares - } - return json.Marshal(objectMap) -} - -// DisksCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type DisksCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DisksClient) (Disk, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DisksCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DisksCreateOrUpdateFuture.Result. -func (future *DisksCreateOrUpdateFuture) result(client DisksClient) (d Disk, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - d.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.DisksCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if d.Response.Response, err = future.GetResult(sender); err == nil && d.Response.Response.StatusCode != http.StatusNoContent { - d, err = client.CreateOrUpdateResponder(d.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksCreateOrUpdateFuture", "Result", d.Response.Response, "Failure responding to request") - } - } - return -} - -// DisksDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. -type DisksDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DisksClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DisksDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DisksDeleteFuture.Result. -func (future *DisksDeleteFuture) result(client DisksClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.DisksDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// DisksGrantAccessFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type DisksGrantAccessFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DisksClient) (AccessURI, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DisksGrantAccessFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DisksGrantAccessFuture.Result. -func (future *DisksGrantAccessFuture) result(client DisksClient) (au AccessURI, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksGrantAccessFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - au.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.DisksGrantAccessFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if au.Response.Response, err = future.GetResult(sender); err == nil && au.Response.Response.StatusCode != http.StatusNoContent { - au, err = client.GrantAccessResponder(au.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksGrantAccessFuture", "Result", au.Response.Response, "Failure responding to request") - } - } - return -} - -// DiskSku the disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, or UltraSSD_LRS. -type DiskSku struct { - // Name - The sku name. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS', 'UltraSSDLRS' - Name DiskStorageAccountTypes `json:"name,omitempty"` - // Tier - READ-ONLY; The sku tier. - Tier *string `json:"tier,omitempty"` -} - -// MarshalJSON is the custom marshaler for DiskSku. -func (ds DiskSku) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ds.Name != "" { - objectMap["name"] = ds.Name - } - return json.Marshal(objectMap) -} - -// DisksRevokeAccessFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type DisksRevokeAccessFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DisksClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DisksRevokeAccessFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DisksRevokeAccessFuture.Result. -func (future *DisksRevokeAccessFuture) result(client DisksClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksRevokeAccessFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.DisksRevokeAccessFuture") - return - } - ar.Response = future.Response() - return -} - -// DisksUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. -type DisksUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DisksClient) (Disk, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DisksUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DisksUpdateFuture.Result. -func (future *DisksUpdateFuture) result(client DisksClient) (d Disk, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - d.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.DisksUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if d.Response.Response, err = future.GetResult(sender); err == nil && d.Response.Response.StatusCode != http.StatusNoContent { - d, err = client.UpdateResponder(d.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksUpdateFuture", "Result", d.Response.Response, "Failure responding to request") - } - } - return -} - -// DiskUpdate disk update resource. -type DiskUpdate struct { - *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. -type DiskUpdateProperties struct { - // OsType - the Operating System type. Possible values include: 'Windows', 'Linux' - OsType OperatingSystemTypes `json:"osType,omitempty"` - // DiskSizeGB - If creationData.createOption is Empty, this field is mandatory and it indicates the size of the disk to create. If this field is present for updates or creation with other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size. - DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` - // EncryptionSettingsCollection - Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. - EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` - // DiskIOPSReadWrite - The number of IOPS allowed for this disk; only settable for UltraSSD disks. One operation can transfer between 4k and 256k bytes. - DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` - // DiskMBpsReadWrite - The bandwidth allowed for this disk; only settable for UltraSSD disks. MBps means millions of bytes per second - MB here uses the ISO notation, of powers of 10. - DiskMBpsReadWrite *int64 `json:"diskMBpsReadWrite,omitempty"` - // DiskIOPSReadOnly - The total number of IOPS that will be allowed across all VMs mounting the shared disk as ReadOnly. One operation can transfer between 4k and 256k bytes. - DiskIOPSReadOnly *int64 `json:"diskIOPSReadOnly,omitempty"` - // DiskMBpsReadOnly - The total throughput (MBps) that will be allowed across all VMs mounting the shared disk as ReadOnly. MBps means millions of bytes per second - MB here uses the ISO notation, of powers of 10. - DiskMBpsReadOnly *int64 `json:"diskMBpsReadOnly,omitempty"` - // MaxShares - The maximum number of VMs that can attach to the disk at the same time. Value greater than one indicates a disk that can be mounted on multiple VMs at the same time. - MaxShares *int32 `json:"maxShares,omitempty"` - // Encryption - Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. - Encryption *Encryption `json:"encryption,omitempty"` -} - -// Encryption encryption at rest settings for disk or snapshot -type Encryption struct { - // DiskEncryptionSetID - ResourceId of the disk encryption set to use for enabling encryption at rest. - DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` - // Type - The type of key used to encrypt the data of the disk. Possible values include: 'EncryptionAtRestWithPlatformKey', 'EncryptionAtRestWithCustomerKey' - Type EncryptionType `json:"type,omitempty"` -} - -// EncryptionImages optional. Allows users to provide customer managed keys for encrypting the OS and data -// disks in the gallery artifact. -type EncryptionImages struct { - OsDiskImage *OSDiskImageEncryption `json:"osDiskImage,omitempty"` - // DataDiskImages - A list of encryption specifications for data disk images. - DataDiskImages *[]DataDiskImageEncryption `json:"dataDiskImages,omitempty"` -} - -// EncryptionSetIdentity the managed identity for the disk encryption set. It should be given permission on -// the key vault before it can be used to encrypt disks. -type EncryptionSetIdentity struct { - // Type - The type of Managed Identity used by the DiskEncryptionSet. Only SystemAssigned is supported. Possible values include: 'SystemAssigned' - Type DiskEncryptionSetIdentityType `json:"type,omitempty"` - // PrincipalID - READ-ONLY; The object id of the Managed Identity Resource. This will be sent to the RP from ARM via the x-ms-identity-principal-id header in the PUT request if the resource has a systemAssigned(implicit) identity - PrincipalID *string `json:"principalId,omitempty"` - // TenantID - READ-ONLY; The tenant id of the Managed Identity Resource. This will be sent to the RP from ARM via the x-ms-client-tenant-id header in the PUT request if the resource has a systemAssigned(implicit) identity - TenantID *string `json:"tenantId,omitempty"` -} - -// MarshalJSON is the custom marshaler for EncryptionSetIdentity. -func (esi EncryptionSetIdentity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if esi.Type != "" { - objectMap["type"] = esi.Type - } - return json.Marshal(objectMap) -} - -// EncryptionSetProperties ... -type EncryptionSetProperties struct { - // ActiveKey - The key vault key which is currently used by this disk encryption set. - ActiveKey *KeyVaultAndKeyReference `json:"activeKey,omitempty"` - // PreviousKeys - READ-ONLY; A readonly collection of key vault keys previously used by this disk encryption set while a key rotation is in progress. It will be empty if there is no ongoing key rotation. - PreviousKeys *[]KeyVaultAndKeyReference `json:"previousKeys,omitempty"` - // ProvisioningState - READ-ONLY; The disk encryption set provisioning state. - ProvisioningState *string `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for EncryptionSetProperties. -func (esp EncryptionSetProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if esp.ActiveKey != nil { - objectMap["activeKey"] = esp.ActiveKey - } - return json.Marshal(objectMap) -} - -// EncryptionSettingsCollection encryption settings for disk or snapshot -type EncryptionSettingsCollection struct { - // Enabled - Set this flag to true and provide DiskEncryptionKey and optional KeyEncryptionKey to enable encryption. Set this flag to false and remove DiskEncryptionKey and KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the request object, the existing settings remain unchanged. - Enabled *bool `json:"enabled,omitempty"` - // EncryptionSettings - A collection of encryption settings, one for each disk volume. - EncryptionSettings *[]EncryptionSettingsElement `json:"encryptionSettings,omitempty"` - // EncryptionSettingsVersion - Describes what type of encryption is used for the disks. Once this field is set, it cannot be overwritten. '1.0' corresponds to Azure Disk Encryption with AAD app.'1.1' corresponds to Azure Disk Encryption. - EncryptionSettingsVersion *string `json:"encryptionSettingsVersion,omitempty"` -} - -// EncryptionSettingsElement encryption settings for one disk volume. -type EncryptionSettingsElement struct { - // DiskEncryptionKey - Key Vault Secret Url and vault id of the disk encryption key - DiskEncryptionKey *KeyVaultAndSecretReference `json:"diskEncryptionKey,omitempty"` - // KeyEncryptionKey - Key Vault Key Url and vault id of the key encryption key. KeyEncryptionKey is optional and when provided is used to unwrap the disk encryption key. - KeyEncryptionKey *KeyVaultAndKeyReference `json:"keyEncryptionKey,omitempty"` -} - -// GalleriesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type GalleriesCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(GalleriesClient) (Gallery, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GalleriesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GalleriesCreateOrUpdateFuture.Result. -func (future *GalleriesCreateOrUpdateFuture) result(client GalleriesClient) (g Gallery, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - g.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.GalleriesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if g.Response.Response, err = future.GetResult(sender); err == nil && g.Response.Response.StatusCode != http.StatusNoContent { - g, err = client.CreateOrUpdateResponder(g.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesCreateOrUpdateFuture", "Result", g.Response.Response, "Failure responding to request") - } - } - return -} - -// GalleriesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type GalleriesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(GalleriesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GalleriesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GalleriesDeleteFuture.Result. -func (future *GalleriesDeleteFuture) result(client GalleriesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.GalleriesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// GalleriesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type GalleriesUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(GalleriesClient) (Gallery, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GalleriesUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GalleriesUpdateFuture.Result. -func (future *GalleriesUpdateFuture) result(client GalleriesClient) (g Gallery, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - g.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.GalleriesUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if g.Response.Response, err = future.GetResult(sender); err == nil && g.Response.Response.StatusCode != http.StatusNoContent { - g, err = client.UpdateResponder(g.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesUpdateFuture", "Result", g.Response.Response, "Failure responding to request") - } - } - return -} - -// Gallery specifies information about the Shared Image Gallery that you want to create or update. -type Gallery struct { - autorest.Response `json:"-"` - *GalleryProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; 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 Gallery. -func (g Gallery) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if g.GalleryProperties != nil { - objectMap["properties"] = g.GalleryProperties - } - if g.Location != nil { - objectMap["location"] = g.Location - } - if g.Tags != nil { - objectMap["tags"] = g.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Gallery struct. -func (g *Gallery) 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 galleryProperties GalleryProperties - err = json.Unmarshal(*v, &galleryProperties) - if err != nil { - return err - } - g.GalleryProperties = &galleryProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - g.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - g.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - g.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - g.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - g.Tags = tags - } - } - } - - return nil -} - -// GalleryApplication specifies information about the gallery Application Definition that you want to -// create or update. -type GalleryApplication struct { - autorest.Response `json:"-"` - *GalleryApplicationProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; 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 GalleryApplication. -func (ga GalleryApplication) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ga.GalleryApplicationProperties != nil { - objectMap["properties"] = ga.GalleryApplicationProperties - } - if ga.Location != nil { - objectMap["location"] = ga.Location - } - if ga.Tags != nil { - objectMap["tags"] = ga.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for GalleryApplication struct. -func (ga *GalleryApplication) 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 galleryApplicationProperties GalleryApplicationProperties - err = json.Unmarshal(*v, &galleryApplicationProperties) - if err != nil { - return err - } - ga.GalleryApplicationProperties = &galleryApplicationProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ga.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ga.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - ga.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - ga.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - ga.Tags = tags - } - } - } - - return nil -} - -// GalleryApplicationList the List Gallery Applications operation response. -type GalleryApplicationList struct { - autorest.Response `json:"-"` - // Value - A list of Gallery Applications. - Value *[]GalleryApplication `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of Application Definitions in the Application Gallery. Call ListNext() with this to fetch the next page of gallery Application Definitions. - NextLink *string `json:"nextLink,omitempty"` -} - -// GalleryApplicationListIterator provides access to a complete listing of GalleryApplication values. -type GalleryApplicationListIterator struct { - i int - page GalleryApplicationListPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *GalleryApplicationListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *GalleryApplicationListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter GalleryApplicationListIterator) 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 GalleryApplicationListIterator) Response() GalleryApplicationList { - 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 GalleryApplicationListIterator) Value() GalleryApplication { - if !iter.page.NotDone() { - return GalleryApplication{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the GalleryApplicationListIterator type. -func NewGalleryApplicationListIterator(page GalleryApplicationListPage) GalleryApplicationListIterator { - return GalleryApplicationListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (gal GalleryApplicationList) IsEmpty() bool { - return gal.Value == nil || len(*gal.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (gal GalleryApplicationList) hasNextLink() bool { - return gal.NextLink != nil && len(*gal.NextLink) != 0 -} - -// galleryApplicationListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (gal GalleryApplicationList) galleryApplicationListPreparer(ctx context.Context) (*http.Request, error) { - if !gal.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(gal.NextLink))) -} - -// GalleryApplicationListPage contains a page of GalleryApplication values. -type GalleryApplicationListPage struct { - fn func(context.Context, GalleryApplicationList) (GalleryApplicationList, error) - gal GalleryApplicationList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *GalleryApplicationListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.gal) - if err != nil { - return err - } - page.gal = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *GalleryApplicationListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page GalleryApplicationListPage) NotDone() bool { - return !page.gal.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page GalleryApplicationListPage) Response() GalleryApplicationList { - return page.gal -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page GalleryApplicationListPage) Values() []GalleryApplication { - if page.gal.IsEmpty() { - return nil - } - return *page.gal.Value -} - -// Creates a new instance of the GalleryApplicationListPage type. -func NewGalleryApplicationListPage(cur GalleryApplicationList, getNextPage func(context.Context, GalleryApplicationList) (GalleryApplicationList, error)) GalleryApplicationListPage { - return GalleryApplicationListPage{ - fn: getNextPage, - gal: cur, - } -} - -// GalleryApplicationProperties describes the properties of a gallery Application Definition. -type GalleryApplicationProperties struct { - // Description - The description of this gallery Application Definition resource. This property is updatable. - Description *string `json:"description,omitempty"` - // Eula - The Eula agreement for the gallery Application Definition. - Eula *string `json:"eula,omitempty"` - // PrivacyStatementURI - The privacy statement uri. - PrivacyStatementURI *string `json:"privacyStatementUri,omitempty"` - // ReleaseNoteURI - The release note uri. - ReleaseNoteURI *string `json:"releaseNoteUri,omitempty"` - // EndOfLifeDate - The end of life date of the gallery Application Definition. This property can be used for decommissioning purposes. This property is updatable. - EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` - // SupportedOSType - This property allows you to specify the supported type of the OS that application is built for.

      Possible values are:

      **Windows**

      **Linux**. Possible values include: 'Windows', 'Linux' - SupportedOSType OperatingSystemTypes `json:"supportedOSType,omitempty"` -} - -// GalleryApplicationsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type GalleryApplicationsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(GalleryApplicationsClient) (GalleryApplication, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GalleryApplicationsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GalleryApplicationsCreateOrUpdateFuture.Result. -func (future *GalleryApplicationsCreateOrUpdateFuture) result(client GalleryApplicationsClient) (ga GalleryApplication, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ga.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ga.Response.Response, err = future.GetResult(sender); err == nil && ga.Response.Response.StatusCode != http.StatusNoContent { - ga, err = client.CreateOrUpdateResponder(ga.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsCreateOrUpdateFuture", "Result", ga.Response.Response, "Failure responding to request") - } - } - return -} - -// GalleryApplicationsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type GalleryApplicationsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(GalleryApplicationsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GalleryApplicationsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GalleryApplicationsDeleteFuture.Result. -func (future *GalleryApplicationsDeleteFuture) result(client GalleryApplicationsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// GalleryApplicationsUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type GalleryApplicationsUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(GalleryApplicationsClient) (GalleryApplication, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GalleryApplicationsUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GalleryApplicationsUpdateFuture.Result. -func (future *GalleryApplicationsUpdateFuture) result(client GalleryApplicationsClient) (ga GalleryApplication, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ga.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationsUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ga.Response.Response, err = future.GetResult(sender); err == nil && ga.Response.Response.StatusCode != http.StatusNoContent { - ga, err = client.UpdateResponder(ga.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsUpdateFuture", "Result", ga.Response.Response, "Failure responding to request") - } - } - return -} - -// GalleryApplicationUpdate specifies information about the gallery Application Definition that you want to -// update. -type GalleryApplicationUpdate struct { - *GalleryApplicationProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for GalleryApplicationUpdate. -func (gau GalleryApplicationUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if gau.GalleryApplicationProperties != nil { - objectMap["properties"] = gau.GalleryApplicationProperties - } - if gau.Tags != nil { - objectMap["tags"] = gau.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for GalleryApplicationUpdate struct. -func (gau *GalleryApplicationUpdate) 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 galleryApplicationProperties GalleryApplicationProperties - err = json.Unmarshal(*v, &galleryApplicationProperties) - if err != nil { - return err - } - gau.GalleryApplicationProperties = &galleryApplicationProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - gau.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - gau.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - gau.Type = &typeVar - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - gau.Tags = tags - } - } - } - - return nil -} - -// GalleryApplicationVersion specifies information about the gallery Application Version that you want to -// create or update. -type GalleryApplicationVersion struct { - autorest.Response `json:"-"` - *GalleryApplicationVersionProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; 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 GalleryApplicationVersion. -func (gav GalleryApplicationVersion) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if gav.GalleryApplicationVersionProperties != nil { - objectMap["properties"] = gav.GalleryApplicationVersionProperties - } - if gav.Location != nil { - objectMap["location"] = gav.Location - } - if gav.Tags != nil { - objectMap["tags"] = gav.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for GalleryApplicationVersion struct. -func (gav *GalleryApplicationVersion) 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 galleryApplicationVersionProperties GalleryApplicationVersionProperties - err = json.Unmarshal(*v, &galleryApplicationVersionProperties) - if err != nil { - return err - } - gav.GalleryApplicationVersionProperties = &galleryApplicationVersionProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - gav.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - gav.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - gav.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - gav.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - gav.Tags = tags - } - } - } - - return nil -} - -// GalleryApplicationVersionList the List Gallery Application version operation response. -type GalleryApplicationVersionList struct { - autorest.Response `json:"-"` - // Value - A list of gallery Application Versions. - Value *[]GalleryApplicationVersion `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of gallery Application Versions. Call ListNext() with this to fetch the next page of gallery Application Versions. - NextLink *string `json:"nextLink,omitempty"` -} - -// GalleryApplicationVersionListIterator provides access to a complete listing of GalleryApplicationVersion -// values. -type GalleryApplicationVersionListIterator struct { - i int - page GalleryApplicationVersionListPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *GalleryApplicationVersionListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *GalleryApplicationVersionListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter GalleryApplicationVersionListIterator) 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 GalleryApplicationVersionListIterator) Response() GalleryApplicationVersionList { - 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 GalleryApplicationVersionListIterator) Value() GalleryApplicationVersion { - if !iter.page.NotDone() { - return GalleryApplicationVersion{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the GalleryApplicationVersionListIterator type. -func NewGalleryApplicationVersionListIterator(page GalleryApplicationVersionListPage) GalleryApplicationVersionListIterator { - return GalleryApplicationVersionListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (gavl GalleryApplicationVersionList) IsEmpty() bool { - return gavl.Value == nil || len(*gavl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (gavl GalleryApplicationVersionList) hasNextLink() bool { - return gavl.NextLink != nil && len(*gavl.NextLink) != 0 -} - -// galleryApplicationVersionListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (gavl GalleryApplicationVersionList) galleryApplicationVersionListPreparer(ctx context.Context) (*http.Request, error) { - if !gavl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(gavl.NextLink))) -} - -// GalleryApplicationVersionListPage contains a page of GalleryApplicationVersion values. -type GalleryApplicationVersionListPage struct { - fn func(context.Context, GalleryApplicationVersionList) (GalleryApplicationVersionList, error) - gavl GalleryApplicationVersionList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *GalleryApplicationVersionListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.gavl) - if err != nil { - return err - } - page.gavl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *GalleryApplicationVersionListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page GalleryApplicationVersionListPage) NotDone() bool { - return !page.gavl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page GalleryApplicationVersionListPage) Response() GalleryApplicationVersionList { - return page.gavl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page GalleryApplicationVersionListPage) Values() []GalleryApplicationVersion { - if page.gavl.IsEmpty() { - return nil - } - return *page.gavl.Value -} - -// Creates a new instance of the GalleryApplicationVersionListPage type. -func NewGalleryApplicationVersionListPage(cur GalleryApplicationVersionList, getNextPage func(context.Context, GalleryApplicationVersionList) (GalleryApplicationVersionList, error)) GalleryApplicationVersionListPage { - return GalleryApplicationVersionListPage{ - fn: getNextPage, - gavl: cur, - } -} - -// GalleryApplicationVersionProperties describes the properties of a gallery Image Version. -type GalleryApplicationVersionProperties struct { - PublishingProfile *GalleryApplicationVersionPublishingProfile `json:"publishingProfile,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. Possible values include: 'ProvisioningState1Creating', 'ProvisioningState1Updating', 'ProvisioningState1Failed', 'ProvisioningState1Succeeded', 'ProvisioningState1Deleting', 'ProvisioningState1Migrating' - ProvisioningState ProvisioningState1 `json:"provisioningState,omitempty"` - // ReplicationStatus - READ-ONLY - ReplicationStatus *ReplicationStatus `json:"replicationStatus,omitempty"` -} - -// MarshalJSON is the custom marshaler for GalleryApplicationVersionProperties. -func (gavp GalleryApplicationVersionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if gavp.PublishingProfile != nil { - objectMap["publishingProfile"] = gavp.PublishingProfile - } - return json.Marshal(objectMap) -} - -// GalleryApplicationVersionPublishingProfile the publishing profile of a gallery Image Version. -type GalleryApplicationVersionPublishingProfile struct { - Source *UserArtifactSource `json:"source,omitempty"` - // ContentType - Optional. May be used to help process this file. The type of file contained in the source, e.g. zip, json, etc. - ContentType *string `json:"contentType,omitempty"` - // EnableHealthCheck - Optional. Whether or not this application reports health. - EnableHealthCheck *bool `json:"enableHealthCheck,omitempty"` - // TargetRegions - The target regions where the Image Version is going to be replicated to. This property is updatable. - TargetRegions *[]TargetRegion `json:"targetRegions,omitempty"` - // ReplicaCount - The number of replicas of the Image Version to be created per region. This property would take effect for a region when regionalReplicaCount is not specified. This property is updatable. - ReplicaCount *int32 `json:"replicaCount,omitempty"` - // ExcludeFromLatest - If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. - ExcludeFromLatest *bool `json:"excludeFromLatest,omitempty"` - // PublishedDate - READ-ONLY; The timestamp for when the gallery Image Version is published. - PublishedDate *date.Time `json:"publishedDate,omitempty"` - // EndOfLifeDate - The end of life date of the gallery Image Version. This property can be used for decommissioning purposes. This property is updatable. - EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` - // StorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable. Possible values include: 'StorageAccountTypeStandardLRS', 'StorageAccountTypeStandardZRS', 'StorageAccountTypePremiumLRS' - StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` -} - -// MarshalJSON is the custom marshaler for GalleryApplicationVersionPublishingProfile. -func (gavpp GalleryApplicationVersionPublishingProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if gavpp.Source != nil { - objectMap["source"] = gavpp.Source - } - if gavpp.ContentType != nil { - objectMap["contentType"] = gavpp.ContentType - } - if gavpp.EnableHealthCheck != nil { - objectMap["enableHealthCheck"] = gavpp.EnableHealthCheck - } - if gavpp.TargetRegions != nil { - objectMap["targetRegions"] = gavpp.TargetRegions - } - if gavpp.ReplicaCount != nil { - objectMap["replicaCount"] = gavpp.ReplicaCount - } - if gavpp.ExcludeFromLatest != nil { - objectMap["excludeFromLatest"] = gavpp.ExcludeFromLatest - } - if gavpp.EndOfLifeDate != nil { - objectMap["endOfLifeDate"] = gavpp.EndOfLifeDate - } - if gavpp.StorageAccountType != "" { - objectMap["storageAccountType"] = gavpp.StorageAccountType - } - return json.Marshal(objectMap) -} - -// GalleryApplicationVersionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type GalleryApplicationVersionsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(GalleryApplicationVersionsClient) (GalleryApplicationVersion, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GalleryApplicationVersionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GalleryApplicationVersionsCreateOrUpdateFuture.Result. -func (future *GalleryApplicationVersionsCreateOrUpdateFuture) result(client GalleryApplicationVersionsClient) (gav GalleryApplicationVersion, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - gav.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationVersionsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if gav.Response.Response, err = future.GetResult(sender); err == nil && gav.Response.Response.StatusCode != http.StatusNoContent { - gav, err = client.CreateOrUpdateResponder(gav.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsCreateOrUpdateFuture", "Result", gav.Response.Response, "Failure responding to request") - } - } - return -} - -// GalleryApplicationVersionsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type GalleryApplicationVersionsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(GalleryApplicationVersionsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GalleryApplicationVersionsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GalleryApplicationVersionsDeleteFuture.Result. -func (future *GalleryApplicationVersionsDeleteFuture) result(client GalleryApplicationVersionsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationVersionsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// GalleryApplicationVersionsUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type GalleryApplicationVersionsUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(GalleryApplicationVersionsClient) (GalleryApplicationVersion, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GalleryApplicationVersionsUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GalleryApplicationVersionsUpdateFuture.Result. -func (future *GalleryApplicationVersionsUpdateFuture) result(client GalleryApplicationVersionsClient) (gav GalleryApplicationVersion, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - gav.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationVersionsUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if gav.Response.Response, err = future.GetResult(sender); err == nil && gav.Response.Response.StatusCode != http.StatusNoContent { - gav, err = client.UpdateResponder(gav.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsUpdateFuture", "Result", gav.Response.Response, "Failure responding to request") - } - } - return -} - -// GalleryApplicationVersionUpdate specifies information about the gallery Application Version that you -// want to update. -type GalleryApplicationVersionUpdate struct { - *GalleryApplicationVersionProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for GalleryApplicationVersionUpdate. -func (gavu GalleryApplicationVersionUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if gavu.GalleryApplicationVersionProperties != nil { - objectMap["properties"] = gavu.GalleryApplicationVersionProperties - } - if gavu.Tags != nil { - objectMap["tags"] = gavu.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for GalleryApplicationVersionUpdate struct. -func (gavu *GalleryApplicationVersionUpdate) 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 galleryApplicationVersionProperties GalleryApplicationVersionProperties - err = json.Unmarshal(*v, &galleryApplicationVersionProperties) - if err != nil { - return err - } - gavu.GalleryApplicationVersionProperties = &galleryApplicationVersionProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - gavu.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - gavu.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - gavu.Type = &typeVar - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - gavu.Tags = tags - } - } - } - - return nil -} - -// GalleryArtifactPublishingProfileBase describes the basic gallery artifact publishing profile. -type GalleryArtifactPublishingProfileBase struct { - // TargetRegions - The target regions where the Image Version is going to be replicated to. This property is updatable. - TargetRegions *[]TargetRegion `json:"targetRegions,omitempty"` - // ReplicaCount - The number of replicas of the Image Version to be created per region. This property would take effect for a region when regionalReplicaCount is not specified. This property is updatable. - ReplicaCount *int32 `json:"replicaCount,omitempty"` - // ExcludeFromLatest - If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. - ExcludeFromLatest *bool `json:"excludeFromLatest,omitempty"` - // PublishedDate - READ-ONLY; The timestamp for when the gallery Image Version is published. - PublishedDate *date.Time `json:"publishedDate,omitempty"` - // EndOfLifeDate - The end of life date of the gallery Image Version. This property can be used for decommissioning purposes. This property is updatable. - EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` - // StorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable. Possible values include: 'StorageAccountTypeStandardLRS', 'StorageAccountTypeStandardZRS', 'StorageAccountTypePremiumLRS' - StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` -} - -// MarshalJSON is the custom marshaler for GalleryArtifactPublishingProfileBase. -func (gappb GalleryArtifactPublishingProfileBase) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if gappb.TargetRegions != nil { - objectMap["targetRegions"] = gappb.TargetRegions - } - if gappb.ReplicaCount != nil { - objectMap["replicaCount"] = gappb.ReplicaCount - } - if gappb.ExcludeFromLatest != nil { - objectMap["excludeFromLatest"] = gappb.ExcludeFromLatest - } - if gappb.EndOfLifeDate != nil { - objectMap["endOfLifeDate"] = gappb.EndOfLifeDate - } - if gappb.StorageAccountType != "" { - objectMap["storageAccountType"] = gappb.StorageAccountType - } - return json.Marshal(objectMap) -} - -// GalleryArtifactSource the source image from which the Image Version is going to be created. -type GalleryArtifactSource struct { - ManagedImage *ManagedArtifact `json:"managedImage,omitempty"` -} - -// GalleryArtifactVersionSource the gallery artifact version source. -type GalleryArtifactVersionSource struct { - // ID - The id of the gallery artifact version source. Can specify a disk uri, snapshot uri, or user image. - ID *string `json:"id,omitempty"` -} - -// GalleryDataDiskImage this is the data disk image. -type GalleryDataDiskImage struct { - // Lun - This property specifies the logical unit number of the data disk. This value is used to identify data disks within the Virtual Machine and therefore must be unique for each data disk attached to the Virtual Machine. - Lun *int32 `json:"lun,omitempty"` - // SizeInGB - READ-ONLY; This property indicates the size of the VHD to be created. - SizeInGB *int32 `json:"sizeInGB,omitempty"` - // HostCaching - The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'. Possible values include: 'HostCachingNone', 'HostCachingReadOnly', 'HostCachingReadWrite' - HostCaching HostCaching `json:"hostCaching,omitempty"` - Source *GalleryArtifactVersionSource `json:"source,omitempty"` -} - -// MarshalJSON is the custom marshaler for GalleryDataDiskImage. -func (gddi GalleryDataDiskImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if gddi.Lun != nil { - objectMap["lun"] = gddi.Lun - } - if gddi.HostCaching != "" { - objectMap["hostCaching"] = gddi.HostCaching - } - if gddi.Source != nil { - objectMap["source"] = gddi.Source - } - return json.Marshal(objectMap) -} - -// GalleryDiskImage this is the disk image base class. -type GalleryDiskImage struct { - // SizeInGB - READ-ONLY; This property indicates the size of the VHD to be created. - SizeInGB *int32 `json:"sizeInGB,omitempty"` - // HostCaching - The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'. Possible values include: 'HostCachingNone', 'HostCachingReadOnly', 'HostCachingReadWrite' - HostCaching HostCaching `json:"hostCaching,omitempty"` - Source *GalleryArtifactVersionSource `json:"source,omitempty"` -} - -// MarshalJSON is the custom marshaler for GalleryDiskImage. -func (gdi GalleryDiskImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if gdi.HostCaching != "" { - objectMap["hostCaching"] = gdi.HostCaching - } - if gdi.Source != nil { - objectMap["source"] = gdi.Source - } - return json.Marshal(objectMap) -} - -// GalleryIdentifier describes the gallery unique name. -type GalleryIdentifier struct { - // UniqueName - READ-ONLY; The unique name of the Shared Image Gallery. This name is generated automatically by Azure. - UniqueName *string `json:"uniqueName,omitempty"` -} - -// MarshalJSON is the custom marshaler for GalleryIdentifier. -func (gi GalleryIdentifier) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// GalleryImage specifies information about the gallery Image Definition that you want to create or update. -type GalleryImage struct { - autorest.Response `json:"-"` - *GalleryImageProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; 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 GalleryImage. -func (gi GalleryImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if gi.GalleryImageProperties != nil { - objectMap["properties"] = gi.GalleryImageProperties - } - if gi.Location != nil { - objectMap["location"] = gi.Location - } - if gi.Tags != nil { - objectMap["tags"] = gi.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for GalleryImage struct. -func (gi *GalleryImage) 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 galleryImageProperties GalleryImageProperties - err = json.Unmarshal(*v, &galleryImageProperties) - if err != nil { - return err - } - gi.GalleryImageProperties = &galleryImageProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - gi.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - gi.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - gi.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - gi.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - gi.Tags = tags - } - } - } - - return nil -} - -// GalleryImageIdentifier this is the gallery Image Definition identifier. -type GalleryImageIdentifier struct { - // Publisher - The name of the gallery Image Definition publisher. - Publisher *string `json:"publisher,omitempty"` - // Offer - The name of the gallery Image Definition offer. - Offer *string `json:"offer,omitempty"` - // Sku - The name of the gallery Image Definition SKU. - Sku *string `json:"sku,omitempty"` -} - -// GalleryImageList the List Gallery Images operation response. -type GalleryImageList struct { - autorest.Response `json:"-"` - // Value - A list of Shared Image Gallery images. - Value *[]GalleryImage `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of Image Definitions in the Shared Image Gallery. Call ListNext() with this to fetch the next page of gallery Image Definitions. - NextLink *string `json:"nextLink,omitempty"` -} - -// GalleryImageListIterator provides access to a complete listing of GalleryImage values. -type GalleryImageListIterator struct { - i int - page GalleryImageListPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *GalleryImageListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *GalleryImageListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter GalleryImageListIterator) 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 GalleryImageListIterator) Response() GalleryImageList { - 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 GalleryImageListIterator) Value() GalleryImage { - if !iter.page.NotDone() { - return GalleryImage{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the GalleryImageListIterator type. -func NewGalleryImageListIterator(page GalleryImageListPage) GalleryImageListIterator { - return GalleryImageListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (gil GalleryImageList) IsEmpty() bool { - return gil.Value == nil || len(*gil.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (gil GalleryImageList) hasNextLink() bool { - return gil.NextLink != nil && len(*gil.NextLink) != 0 -} - -// galleryImageListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (gil GalleryImageList) galleryImageListPreparer(ctx context.Context) (*http.Request, error) { - if !gil.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(gil.NextLink))) -} - -// GalleryImageListPage contains a page of GalleryImage values. -type GalleryImageListPage struct { - fn func(context.Context, GalleryImageList) (GalleryImageList, error) - gil GalleryImageList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *GalleryImageListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.gil) - if err != nil { - return err - } - page.gil = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *GalleryImageListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page GalleryImageListPage) NotDone() bool { - return !page.gil.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page GalleryImageListPage) Response() GalleryImageList { - return page.gil -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page GalleryImageListPage) Values() []GalleryImage { - if page.gil.IsEmpty() { - return nil - } - return *page.gil.Value -} - -// Creates a new instance of the GalleryImageListPage type. -func NewGalleryImageListPage(cur GalleryImageList, getNextPage func(context.Context, GalleryImageList) (GalleryImageList, error)) GalleryImageListPage { - return GalleryImageListPage{ - fn: getNextPage, - gil: cur, - } -} - -// GalleryImageProperties describes the properties of a gallery Image Definition. -type GalleryImageProperties struct { - // Description - The description of this gallery Image Definition resource. This property is updatable. - Description *string `json:"description,omitempty"` - // Eula - The Eula agreement for the gallery Image Definition. - Eula *string `json:"eula,omitempty"` - // PrivacyStatementURI - The privacy statement uri. - PrivacyStatementURI *string `json:"privacyStatementUri,omitempty"` - // ReleaseNoteURI - The release note uri. - ReleaseNoteURI *string `json:"releaseNoteUri,omitempty"` - // OsType - This property allows you to specify the type of the OS that is included in the disk when creating a VM from a managed image.

      Possible values are:

      **Windows**

      **Linux**. Possible values include: 'Windows', 'Linux' - OsType OperatingSystemTypes `json:"osType,omitempty"` - // OsState - This property allows the user to specify whether the virtual machines created under this image are 'Generalized' or 'Specialized'. Possible values include: 'Generalized', 'Specialized' - OsState OperatingSystemStateTypes `json:"osState,omitempty"` - // HyperVGeneration - The hypervisor generation of the Virtual Machine. Applicable to OS disks only. Possible values include: 'V1', 'V2' - HyperVGeneration HyperVGeneration `json:"hyperVGeneration,omitempty"` - // EndOfLifeDate - The end of life date of the gallery Image Definition. This property can be used for decommissioning purposes. This property is updatable. - EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` - Identifier *GalleryImageIdentifier `json:"identifier,omitempty"` - Recommended *RecommendedMachineConfiguration `json:"recommended,omitempty"` - Disallowed *Disallowed `json:"disallowed,omitempty"` - PurchasePlan *ImagePurchasePlan `json:"purchasePlan,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. Possible values include: 'ProvisioningState2Creating', 'ProvisioningState2Updating', 'ProvisioningState2Failed', 'ProvisioningState2Succeeded', 'ProvisioningState2Deleting', 'ProvisioningState2Migrating' - ProvisioningState ProvisioningState2 `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for GalleryImageProperties. -func (gip GalleryImageProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if gip.Description != nil { - objectMap["description"] = gip.Description - } - if gip.Eula != nil { - objectMap["eula"] = gip.Eula - } - if gip.PrivacyStatementURI != nil { - objectMap["privacyStatementUri"] = gip.PrivacyStatementURI - } - if gip.ReleaseNoteURI != nil { - objectMap["releaseNoteUri"] = gip.ReleaseNoteURI - } - if gip.OsType != "" { - objectMap["osType"] = gip.OsType - } - if gip.OsState != "" { - objectMap["osState"] = gip.OsState - } - if gip.HyperVGeneration != "" { - objectMap["hyperVGeneration"] = gip.HyperVGeneration - } - if gip.EndOfLifeDate != nil { - objectMap["endOfLifeDate"] = gip.EndOfLifeDate - } - if gip.Identifier != nil { - objectMap["identifier"] = gip.Identifier - } - if gip.Recommended != nil { - objectMap["recommended"] = gip.Recommended - } - if gip.Disallowed != nil { - objectMap["disallowed"] = gip.Disallowed - } - if gip.PurchasePlan != nil { - objectMap["purchasePlan"] = gip.PurchasePlan - } - return json.Marshal(objectMap) -} - -// GalleryImagesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type GalleryImagesCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(GalleryImagesClient) (GalleryImage, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GalleryImagesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GalleryImagesCreateOrUpdateFuture.Result. -func (future *GalleryImagesCreateOrUpdateFuture) result(client GalleryImagesClient) (gi GalleryImage, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImagesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - gi.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.GalleryImagesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if gi.Response.Response, err = future.GetResult(sender); err == nil && gi.Response.Response.StatusCode != http.StatusNoContent { - gi, err = client.CreateOrUpdateResponder(gi.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImagesCreateOrUpdateFuture", "Result", gi.Response.Response, "Failure responding to request") - } - } - return -} - -// GalleryImagesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type GalleryImagesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(GalleryImagesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GalleryImagesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GalleryImagesDeleteFuture.Result. -func (future *GalleryImagesDeleteFuture) result(client GalleryImagesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImagesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.GalleryImagesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// GalleryImagesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type GalleryImagesUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(GalleryImagesClient) (GalleryImage, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GalleryImagesUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GalleryImagesUpdateFuture.Result. -func (future *GalleryImagesUpdateFuture) result(client GalleryImagesClient) (gi GalleryImage, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImagesUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - gi.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.GalleryImagesUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if gi.Response.Response, err = future.GetResult(sender); err == nil && gi.Response.Response.StatusCode != http.StatusNoContent { - gi, err = client.UpdateResponder(gi.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImagesUpdateFuture", "Result", gi.Response.Response, "Failure responding to request") - } - } - return -} - -// GalleryImageUpdate specifies information about the gallery Image Definition that you want to update. -type GalleryImageUpdate struct { - *GalleryImageProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for GalleryImageUpdate. -func (giu GalleryImageUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if giu.GalleryImageProperties != nil { - objectMap["properties"] = giu.GalleryImageProperties - } - if giu.Tags != nil { - objectMap["tags"] = giu.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for GalleryImageUpdate struct. -func (giu *GalleryImageUpdate) 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 galleryImageProperties GalleryImageProperties - err = json.Unmarshal(*v, &galleryImageProperties) - if err != nil { - return err - } - giu.GalleryImageProperties = &galleryImageProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - giu.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - giu.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - giu.Type = &typeVar - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - giu.Tags = tags - } - } - } - - return nil -} - -// GalleryImageVersion specifies information about the gallery Image Version that you want to create or -// update. -type GalleryImageVersion struct { - autorest.Response `json:"-"` - *GalleryImageVersionProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; 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 GalleryImageVersion. -func (giv GalleryImageVersion) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if giv.GalleryImageVersionProperties != nil { - objectMap["properties"] = giv.GalleryImageVersionProperties - } - if giv.Location != nil { - objectMap["location"] = giv.Location - } - if giv.Tags != nil { - objectMap["tags"] = giv.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for GalleryImageVersion struct. -func (giv *GalleryImageVersion) 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 galleryImageVersionProperties GalleryImageVersionProperties - err = json.Unmarshal(*v, &galleryImageVersionProperties) - if err != nil { - return err - } - giv.GalleryImageVersionProperties = &galleryImageVersionProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - giv.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - giv.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - giv.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - giv.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - giv.Tags = tags - } - } - } - - return nil -} - -// GalleryImageVersionList the List Gallery Image version operation response. -type GalleryImageVersionList struct { - autorest.Response `json:"-"` - // Value - A list of gallery Image Versions. - Value *[]GalleryImageVersion `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of gallery Image Versions. Call ListNext() with this to fetch the next page of gallery Image Versions. - NextLink *string `json:"nextLink,omitempty"` -} - -// GalleryImageVersionListIterator provides access to a complete listing of GalleryImageVersion values. -type GalleryImageVersionListIterator struct { - i int - page GalleryImageVersionListPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *GalleryImageVersionListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageVersionListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *GalleryImageVersionListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter GalleryImageVersionListIterator) 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 GalleryImageVersionListIterator) Response() GalleryImageVersionList { - 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 GalleryImageVersionListIterator) Value() GalleryImageVersion { - if !iter.page.NotDone() { - return GalleryImageVersion{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the GalleryImageVersionListIterator type. -func NewGalleryImageVersionListIterator(page GalleryImageVersionListPage) GalleryImageVersionListIterator { - return GalleryImageVersionListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (givl GalleryImageVersionList) IsEmpty() bool { - return givl.Value == nil || len(*givl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (givl GalleryImageVersionList) hasNextLink() bool { - return givl.NextLink != nil && len(*givl.NextLink) != 0 -} - -// galleryImageVersionListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (givl GalleryImageVersionList) galleryImageVersionListPreparer(ctx context.Context) (*http.Request, error) { - if !givl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(givl.NextLink))) -} - -// GalleryImageVersionListPage contains a page of GalleryImageVersion values. -type GalleryImageVersionListPage struct { - fn func(context.Context, GalleryImageVersionList) (GalleryImageVersionList, error) - givl GalleryImageVersionList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *GalleryImageVersionListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageVersionListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.givl) - if err != nil { - return err - } - page.givl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *GalleryImageVersionListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page GalleryImageVersionListPage) NotDone() bool { - return !page.givl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page GalleryImageVersionListPage) Response() GalleryImageVersionList { - return page.givl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page GalleryImageVersionListPage) Values() []GalleryImageVersion { - if page.givl.IsEmpty() { - return nil - } - return *page.givl.Value -} - -// Creates a new instance of the GalleryImageVersionListPage type. -func NewGalleryImageVersionListPage(cur GalleryImageVersionList, getNextPage func(context.Context, GalleryImageVersionList) (GalleryImageVersionList, error)) GalleryImageVersionListPage { - return GalleryImageVersionListPage{ - fn: getNextPage, - givl: cur, - } -} - -// GalleryImageVersionProperties describes the properties of a gallery Image Version. -type GalleryImageVersionProperties struct { - PublishingProfile *GalleryImageVersionPublishingProfile `json:"publishingProfile,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. Possible values include: 'ProvisioningState3Creating', 'ProvisioningState3Updating', 'ProvisioningState3Failed', 'ProvisioningState3Succeeded', 'ProvisioningState3Deleting', 'ProvisioningState3Migrating' - ProvisioningState ProvisioningState3 `json:"provisioningState,omitempty"` - StorageProfile *GalleryImageVersionStorageProfile `json:"storageProfile,omitempty"` - // ReplicationStatus - READ-ONLY - ReplicationStatus *ReplicationStatus `json:"replicationStatus,omitempty"` -} - -// MarshalJSON is the custom marshaler for GalleryImageVersionProperties. -func (givp GalleryImageVersionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if givp.PublishingProfile != nil { - objectMap["publishingProfile"] = givp.PublishingProfile - } - if givp.StorageProfile != nil { - objectMap["storageProfile"] = givp.StorageProfile - } - return json.Marshal(objectMap) -} - -// GalleryImageVersionPublishingProfile the publishing profile of a gallery Image Version. -type GalleryImageVersionPublishingProfile struct { - // TargetRegions - The target regions where the Image Version is going to be replicated to. This property is updatable. - TargetRegions *[]TargetRegion `json:"targetRegions,omitempty"` - // ReplicaCount - The number of replicas of the Image Version to be created per region. This property would take effect for a region when regionalReplicaCount is not specified. This property is updatable. - ReplicaCount *int32 `json:"replicaCount,omitempty"` - // ExcludeFromLatest - If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. - ExcludeFromLatest *bool `json:"excludeFromLatest,omitempty"` - // PublishedDate - READ-ONLY; The timestamp for when the gallery Image Version is published. - PublishedDate *date.Time `json:"publishedDate,omitempty"` - // EndOfLifeDate - The end of life date of the gallery Image Version. This property can be used for decommissioning purposes. This property is updatable. - EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` - // StorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable. Possible values include: 'StorageAccountTypeStandardLRS', 'StorageAccountTypeStandardZRS', 'StorageAccountTypePremiumLRS' - StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` -} - -// MarshalJSON is the custom marshaler for GalleryImageVersionPublishingProfile. -func (givpp GalleryImageVersionPublishingProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if givpp.TargetRegions != nil { - objectMap["targetRegions"] = givpp.TargetRegions - } - if givpp.ReplicaCount != nil { - objectMap["replicaCount"] = givpp.ReplicaCount - } - if givpp.ExcludeFromLatest != nil { - objectMap["excludeFromLatest"] = givpp.ExcludeFromLatest - } - if givpp.EndOfLifeDate != nil { - objectMap["endOfLifeDate"] = givpp.EndOfLifeDate - } - if givpp.StorageAccountType != "" { - objectMap["storageAccountType"] = givpp.StorageAccountType - } - return json.Marshal(objectMap) -} - -// GalleryImageVersionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type GalleryImageVersionsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(GalleryImageVersionsClient) (GalleryImageVersion, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GalleryImageVersionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GalleryImageVersionsCreateOrUpdateFuture.Result. -func (future *GalleryImageVersionsCreateOrUpdateFuture) result(client GalleryImageVersionsClient) (giv GalleryImageVersion, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - giv.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.GalleryImageVersionsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if giv.Response.Response, err = future.GetResult(sender); err == nil && giv.Response.Response.StatusCode != http.StatusNoContent { - giv, err = client.CreateOrUpdateResponder(giv.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsCreateOrUpdateFuture", "Result", giv.Response.Response, "Failure responding to request") - } - } - return -} - -// GalleryImageVersionsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type GalleryImageVersionsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(GalleryImageVersionsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GalleryImageVersionsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GalleryImageVersionsDeleteFuture.Result. -func (future *GalleryImageVersionsDeleteFuture) result(client GalleryImageVersionsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.GalleryImageVersionsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// GalleryImageVersionStorageProfile this is the storage profile of a Gallery Image Version. -type GalleryImageVersionStorageProfile struct { - Source *GalleryArtifactVersionSource `json:"source,omitempty"` - OsDiskImage *GalleryOSDiskImage `json:"osDiskImage,omitempty"` - // DataDiskImages - A list of data disk images. - DataDiskImages *[]GalleryDataDiskImage `json:"dataDiskImages,omitempty"` -} - -// GalleryImageVersionsUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type GalleryImageVersionsUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(GalleryImageVersionsClient) (GalleryImageVersion, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GalleryImageVersionsUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GalleryImageVersionsUpdateFuture.Result. -func (future *GalleryImageVersionsUpdateFuture) result(client GalleryImageVersionsClient) (giv GalleryImageVersion, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - giv.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.GalleryImageVersionsUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if giv.Response.Response, err = future.GetResult(sender); err == nil && giv.Response.Response.StatusCode != http.StatusNoContent { - giv, err = client.UpdateResponder(giv.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsUpdateFuture", "Result", giv.Response.Response, "Failure responding to request") - } - } - return -} - -// GalleryImageVersionUpdate specifies information about the gallery Image Version that you want to update. -type GalleryImageVersionUpdate struct { - *GalleryImageVersionProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for GalleryImageVersionUpdate. -func (givu GalleryImageVersionUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if givu.GalleryImageVersionProperties != nil { - objectMap["properties"] = givu.GalleryImageVersionProperties - } - if givu.Tags != nil { - objectMap["tags"] = givu.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for GalleryImageVersionUpdate struct. -func (givu *GalleryImageVersionUpdate) 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 galleryImageVersionProperties GalleryImageVersionProperties - err = json.Unmarshal(*v, &galleryImageVersionProperties) - if err != nil { - return err - } - givu.GalleryImageVersionProperties = &galleryImageVersionProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - givu.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - givu.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - givu.Type = &typeVar - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - givu.Tags = tags - } - } - } - - return nil -} - -// GalleryList the List Galleries operation response. -type GalleryList struct { - autorest.Response `json:"-"` - // Value - A list of galleries. - Value *[]Gallery `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of galleries. Call ListNext() with this to fetch the next page of galleries. - NextLink *string `json:"nextLink,omitempty"` -} - -// GalleryListIterator provides access to a complete listing of Gallery values. -type GalleryListIterator struct { - i int - page GalleryListPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *GalleryListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *GalleryListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter GalleryListIterator) 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 GalleryListIterator) Response() GalleryList { - 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 GalleryListIterator) Value() Gallery { - if !iter.page.NotDone() { - return Gallery{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the GalleryListIterator type. -func NewGalleryListIterator(page GalleryListPage) GalleryListIterator { - return GalleryListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (gl GalleryList) IsEmpty() bool { - return gl.Value == nil || len(*gl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (gl GalleryList) hasNextLink() bool { - return gl.NextLink != nil && len(*gl.NextLink) != 0 -} - -// galleryListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (gl GalleryList) galleryListPreparer(ctx context.Context) (*http.Request, error) { - if !gl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(gl.NextLink))) -} - -// GalleryListPage contains a page of Gallery values. -type GalleryListPage struct { - fn func(context.Context, GalleryList) (GalleryList, error) - gl GalleryList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *GalleryListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.gl) - if err != nil { - return err - } - page.gl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *GalleryListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page GalleryListPage) NotDone() bool { - return !page.gl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page GalleryListPage) Response() GalleryList { - return page.gl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page GalleryListPage) Values() []Gallery { - if page.gl.IsEmpty() { - return nil - } - return *page.gl.Value -} - -// Creates a new instance of the GalleryListPage type. -func NewGalleryListPage(cur GalleryList, getNextPage func(context.Context, GalleryList) (GalleryList, error)) GalleryListPage { - return GalleryListPage{ - fn: getNextPage, - gl: cur, - } -} - -// GalleryOSDiskImage this is the OS disk image. -type GalleryOSDiskImage struct { - // SizeInGB - READ-ONLY; This property indicates the size of the VHD to be created. - SizeInGB *int32 `json:"sizeInGB,omitempty"` - // HostCaching - The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'. Possible values include: 'HostCachingNone', 'HostCachingReadOnly', 'HostCachingReadWrite' - HostCaching HostCaching `json:"hostCaching,omitempty"` - Source *GalleryArtifactVersionSource `json:"source,omitempty"` -} - -// MarshalJSON is the custom marshaler for GalleryOSDiskImage. -func (godi GalleryOSDiskImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if godi.HostCaching != "" { - objectMap["hostCaching"] = godi.HostCaching - } - if godi.Source != nil { - objectMap["source"] = godi.Source - } - return json.Marshal(objectMap) -} - -// GalleryProperties describes the properties of a Shared Image Gallery. -type GalleryProperties struct { - // Description - The description of this Shared Image Gallery resource. This property is updatable. - Description *string `json:"description,omitempty"` - Identifier *GalleryIdentifier `json:"identifier,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. Possible values include: 'ProvisioningStateCreating', 'ProvisioningStateUpdating', 'ProvisioningStateFailed', 'ProvisioningStateSucceeded', 'ProvisioningStateDeleting', 'ProvisioningStateMigrating' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for GalleryProperties. -func (gp GalleryProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if gp.Description != nil { - objectMap["description"] = gp.Description - } - if gp.Identifier != nil { - objectMap["identifier"] = gp.Identifier - } - return json.Marshal(objectMap) -} - -// GalleryUpdate specifies information about the Shared Image Gallery that you want to update. -type GalleryUpdate struct { - *GalleryProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for GalleryUpdate. -func (gu GalleryUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if gu.GalleryProperties != nil { - objectMap["properties"] = gu.GalleryProperties - } - if gu.Tags != nil { - objectMap["tags"] = gu.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for GalleryUpdate struct. -func (gu *GalleryUpdate) 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 galleryProperties GalleryProperties - err = json.Unmarshal(*v, &galleryProperties) - if err != nil { - return err - } - gu.GalleryProperties = &galleryProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - gu.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - gu.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - gu.Type = &typeVar - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - gu.Tags = tags - } - } - } - - return nil -} - -// GrantAccessData data used for requesting a SAS. -type GrantAccessData struct { - // Access - Possible values include: 'None', 'Read', 'Write' - Access AccessLevel `json:"access,omitempty"` - // DurationInSeconds - Time duration in seconds until the SAS access expires. - DurationInSeconds *int32 `json:"durationInSeconds,omitempty"` -} - -// 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](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"` -} - -// Image 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 Image struct { - autorest.Response `json:"-"` - *ImageProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; 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 Image. -func (i Image) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if i.ImageProperties != nil { - objectMap["properties"] = i.ImageProperties - } - 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. -type ImageDataDisk struct { - // Lun - Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM. - Lun *int32 `json:"lun,omitempty"` - // Snapshot - The snapshot. - Snapshot *SubResource `json:"snapshot,omitempty"` - // ManagedDisk - The managedDisk. - ManagedDisk *SubResource `json:"managedDisk,omitempty"` - // BlobURI - The Virtual Hard Disk. - BlobURI *string `json:"blobUri,omitempty"` - // Caching - Specifies the caching requirements.

      Possible values are:

      **None**

      **ReadOnly**

      **ReadWrite**

      Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' - Caching CachingTypes `json:"caching,omitempty"` - // DiskSizeGB - Specifies the size of empty data disks in gigabytes. This element can be used to overwrite the name of the disk in a virtual machine image.

      This value cannot be larger than 1023 GB - DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` - // StorageAccountType - Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot be used with OS Disk. Possible values include: 'StorageAccountTypesStandardLRS', 'StorageAccountTypesPremiumLRS', 'StorageAccountTypesStandardSSDLRS', 'StorageAccountTypesUltraSSDLRS' - StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` - // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed image disk. - DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` -} - -// ImageDisk describes a image disk. -type ImageDisk struct { - // Snapshot - The snapshot. - Snapshot *SubResource `json:"snapshot,omitempty"` - // ManagedDisk - The managedDisk. - ManagedDisk *SubResource `json:"managedDisk,omitempty"` - // BlobURI - The Virtual Hard Disk. - BlobURI *string `json:"blobUri,omitempty"` - // Caching - Specifies the caching requirements.

      Possible values are:

      **None**

      **ReadOnly**

      **ReadWrite**

      Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' - Caching CachingTypes `json:"caching,omitempty"` - // DiskSizeGB - Specifies the size of empty data disks in gigabytes. This element can be used to overwrite the name of the disk in a virtual machine image.

      This value cannot be larger than 1023 GB - DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` - // StorageAccountType - Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot be used with OS Disk. Possible values include: 'StorageAccountTypesStandardLRS', 'StorageAccountTypesPremiumLRS', 'StorageAccountTypesStandardSSDLRS', 'StorageAccountTypesUltraSSDLRS' - StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` - // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed image disk. - DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` -} - -// ImageDiskReference the source image used for creating the disk. -type ImageDiskReference struct { - // ID - A relative uri containing either a Platform Image Repository or user image reference. - ID *string `json:"id,omitempty"` - // Lun - If the disk is created from an image's data disk, this is an index that indicates which of the data disks in the image to use. For OS disks, this field is null. - Lun *int32 `json:"lun,omitempty"` -} - -// ImageListResult the List Image operation response. -type ImageListResult struct { - autorest.Response `json:"-"` - // Value - The list of Images. - Value *[]Image `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of Images. Call ListNext() with this to fetch the next page of Images. - NextLink *string `json:"nextLink,omitempty"` -} - -// ImageListResultIterator provides access to a complete listing of Image values. -type ImageListResultIterator struct { - i int - page ImageListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ImageListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ImageListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ImageListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ImageListResultIterator) 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 ImageListResultIterator) Response() ImageListResult { - 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 ImageListResultIterator) Value() Image { - if !iter.page.NotDone() { - return Image{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ImageListResultIterator type. -func NewImageListResultIterator(page ImageListResultPage) ImageListResultIterator { - return ImageListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (ilr ImageListResult) IsEmpty() bool { - return ilr.Value == nil || len(*ilr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (ilr ImageListResult) hasNextLink() bool { - return ilr.NextLink != nil && len(*ilr.NextLink) != 0 -} - -// imageListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (ilr ImageListResult) imageListResultPreparer(ctx context.Context) (*http.Request, error) { - if !ilr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(ilr.NextLink))) -} - -// ImageListResultPage contains a page of Image values. -type ImageListResultPage struct { - fn func(context.Context, ImageListResult) (ImageListResult, error) - ilr ImageListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ImageListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ImageListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.ilr) - if err != nil { - return err - } - page.ilr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ImageListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ImageListResultPage) NotDone() bool { - return !page.ilr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ImageListResultPage) Response() ImageListResult { - return page.ilr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ImageListResultPage) Values() []Image { - if page.ilr.IsEmpty() { - return nil - } - return *page.ilr.Value -} - -// Creates a new instance of the ImageListResultPage type. -func NewImageListResultPage(cur ImageListResult, getNextPage func(context.Context, ImageListResult) (ImageListResult, error)) ImageListResultPage { - return ImageListResultPage{ - fn: getNextPage, - ilr: cur, - } -} - -// ImageOSDisk describes an Operating System disk. -type ImageOSDisk struct { - // OsType - This property allows you to specify the type of the OS that is included in the disk if creating a VM from a custom image.

      Possible values are:

      **Windows**

      **Linux**. Possible values include: 'Windows', 'Linux' - OsType OperatingSystemTypes `json:"osType,omitempty"` - // OsState - The OS State. Possible values include: 'Generalized', 'Specialized' - OsState OperatingSystemStateTypes `json:"osState,omitempty"` - // Snapshot - The snapshot. - Snapshot *SubResource `json:"snapshot,omitempty"` - // ManagedDisk - The managedDisk. - ManagedDisk *SubResource `json:"managedDisk,omitempty"` - // BlobURI - The Virtual Hard Disk. - BlobURI *string `json:"blobUri,omitempty"` - // Caching - Specifies the caching requirements.

      Possible values are:

      **None**

      **ReadOnly**

      **ReadWrite**

      Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' - Caching CachingTypes `json:"caching,omitempty"` - // DiskSizeGB - Specifies the size of empty data disks in gigabytes. This element can be used to overwrite the name of the disk in a virtual machine image.

      This value cannot be larger than 1023 GB - DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` - // StorageAccountType - Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot be used with OS Disk. Possible values include: 'StorageAccountTypesStandardLRS', 'StorageAccountTypesPremiumLRS', 'StorageAccountTypesStandardSSDLRS', 'StorageAccountTypesUltraSSDLRS' - StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` - // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed image disk. - DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` -} - -// ImageProperties describes the properties of an Image. -type ImageProperties struct { - // SourceVirtualMachine - The source virtual machine from which Image is created. - SourceVirtualMachine *SubResource `json:"sourceVirtualMachine,omitempty"` - // StorageProfile - Specifies the storage settings for the virtual machine disks. - StorageProfile *ImageStorageProfile `json:"storageProfile,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state. - ProvisioningState *string `json:"provisioningState,omitempty"` - // HyperVGeneration - Gets the HyperVGenerationType of the VirtualMachine created from the image. Possible values include: 'HyperVGenerationTypesV1', 'HyperVGenerationTypesV2' - HyperVGeneration HyperVGenerationTypes `json:"hyperVGeneration,omitempty"` -} - -// MarshalJSON is the custom marshaler for ImageProperties. -func (IP ImageProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if IP.SourceVirtualMachine != nil { - objectMap["sourceVirtualMachine"] = IP.SourceVirtualMachine - } - if IP.StorageProfile != nil { - objectMap["storageProfile"] = IP.StorageProfile - } - if IP.HyperVGeneration != "" { - objectMap["hyperVGeneration"] = IP.HyperVGeneration - } - return json.Marshal(objectMap) -} - -// ImagePurchasePlan describes the gallery Image Definition purchase plan. This is used by marketplace -// images. -type ImagePurchasePlan struct { - // Name - The plan ID. - Name *string `json:"name,omitempty"` - // Publisher - The publisher ID. - Publisher *string `json:"publisher,omitempty"` - // Product - The product ID. - Product *string `json:"product,omitempty"` -} - -// ImageReference specifies information about the image to use. You can specify information about platform -// images, 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. NOTE: Image reference publisher and offer can only be set when you create the scale set. -type ImageReference struct { - // 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. - Offer *string `json:"offer,omitempty"` - // Sku - The image SKU. - 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"` - // ExactVersion - READ-ONLY; Specifies in decimal numbers, the version of platform image or marketplace image used to create the virtual machine. This readonly field differs from 'version', only if the value specified in 'version' field is 'latest'. - ExactVersion *string `json:"exactVersion,omitempty"` - // ID - Resource Id - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ImageReference. -func (ir ImageReference) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ir.Publisher != nil { - objectMap["publisher"] = ir.Publisher - } - if ir.Offer != nil { - objectMap["offer"] = ir.Offer - } - if ir.Sku != nil { - objectMap["sku"] = ir.Sku - } - if ir.Version != nil { - objectMap["version"] = ir.Version - } - if ir.ID != nil { - objectMap["id"] = ir.ID - } - return json.Marshal(objectMap) -} - -// ImagesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ImagesCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ImagesClient) (Image, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ImagesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ImagesCreateOrUpdateFuture.Result. -func (future *ImagesCreateOrUpdateFuture) result(client ImagesClient) (i Image, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - i.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.ImagesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if i.Response.Response, err = future.GetResult(sender); err == nil && i.Response.Response.StatusCode != http.StatusNoContent { - i, err = client.CreateOrUpdateResponder(i.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesCreateOrUpdateFuture", "Result", i.Response.Response, "Failure responding to request") - } - } - return -} - -// ImagesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. -type ImagesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ImagesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ImagesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ImagesDeleteFuture.Result. -func (future *ImagesDeleteFuture) result(client ImagesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.ImagesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// ImageStorageProfile describes a storage profile. -type ImageStorageProfile struct { - // 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). - OsDisk *ImageOSDisk `json:"osDisk,omitempty"` - // DataDisks - Specifies the parameters that are used to add a data disk to a 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). - DataDisks *[]ImageDataDisk `json:"dataDisks,omitempty"` - // ZoneResilient - Specifies whether an image is zone resilient or not. Default is false. Zone resilient images can be created only in regions that provide Zone Redundant Storage (ZRS). - ZoneResilient *bool `json:"zoneResilient,omitempty"` -} - -// ImagesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. -type ImagesUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ImagesClient) (Image, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ImagesUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ImagesUpdateFuture.Result. -func (future *ImagesUpdateFuture) result(client ImagesClient) (i Image, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - i.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.ImagesUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if i.Response.Response, err = future.GetResult(sender); err == nil && i.Response.Response.StatusCode != http.StatusNoContent { - i, err = client.UpdateResponder(i.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesUpdateFuture", "Result", i.Response.Response, "Failure responding to request") - } - } - return -} - -// ImageUpdate the source user image virtual hard disk. Only tags may be updated. -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 -type KeyVaultAndSecretReference struct { - // SourceVault - Resource id of the KeyVault containing the key or secret - SourceVault *SourceVault `json:"sourceVault,omitempty"` - // SecretURL - Url pointing to a key or secret in KeyVault - SecretURL *string `json:"secretUrl,omitempty"` -} - -// KeyVaultKeyReference describes a reference to Key Vault Key -type KeyVaultKeyReference struct { - // KeyURL - The URL referencing a key encryption key in Key Vault. - KeyURL *string `json:"keyUrl,omitempty"` - // SourceVault - The relative URL of the Key Vault containing the key. - SourceVault *SubResource `json:"sourceVault,omitempty"` -} - -// KeyVaultSecretReference describes a reference to Key Vault Secret -type KeyVaultSecretReference struct { - // SecretURL - The URL referencing a secret in a Key Vault. - SecretURL *string `json:"secretUrl,omitempty"` - // SourceVault - The relative URL of the Key Vault containing the secret. - SourceVault *SubResource `json:"sourceVault,omitempty"` -} - -// LinuxConfiguration specifies the Linux operating system settings on the virtual machine.

      For a -// list of supported Linux distributions, see [Linux on Azure-Endorsed -// Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) -//

      For running non-endorsed distributions, see [Information for Non-Endorsed -// Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). -type LinuxConfiguration struct { - // DisablePasswordAuthentication - Specifies whether password authentication should be disabled. - DisablePasswordAuthentication *bool `json:"disablePasswordAuthentication,omitempty"` - // SSH - Specifies the ssh key configuration for a Linux OS. - SSH *SSHConfiguration `json:"ssh,omitempty"` - // 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. - ProvisionVMAgent *bool `json:"provisionVMAgent,omitempty"` -} - -// ListUsagesResult the List Usages operation response. -type ListUsagesResult struct { - autorest.Response `json:"-"` - // Value - The list of compute resource usages. - Value *[]Usage `json:"value,omitempty"` - // NextLink - The URI to fetch the next page of compute resource usage information. Call ListNext() with this to fetch the next page of compute resource usage information. - NextLink *string `json:"nextLink,omitempty"` -} - -// ListUsagesResultIterator provides access to a complete listing of Usage values. -type ListUsagesResultIterator struct { - i int - page ListUsagesResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ListUsagesResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListUsagesResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ListUsagesResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ListUsagesResultIterator) 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 ListUsagesResultIterator) Response() ListUsagesResult { - 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 ListUsagesResultIterator) Value() Usage { - if !iter.page.NotDone() { - return Usage{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ListUsagesResultIterator type. -func NewListUsagesResultIterator(page ListUsagesResultPage) ListUsagesResultIterator { - return ListUsagesResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (lur ListUsagesResult) IsEmpty() bool { - return lur.Value == nil || len(*lur.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (lur ListUsagesResult) hasNextLink() bool { - return lur.NextLink != nil && len(*lur.NextLink) != 0 -} - -// listUsagesResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (lur ListUsagesResult) listUsagesResultPreparer(ctx context.Context) (*http.Request, error) { - if !lur.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(lur.NextLink))) -} - -// ListUsagesResultPage contains a page of Usage values. -type ListUsagesResultPage struct { - fn func(context.Context, ListUsagesResult) (ListUsagesResult, error) - lur ListUsagesResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ListUsagesResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListUsagesResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.lur) - if err != nil { - return err - } - page.lur = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ListUsagesResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ListUsagesResultPage) NotDone() bool { - return !page.lur.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ListUsagesResultPage) Response() ListUsagesResult { - return page.lur -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ListUsagesResultPage) Values() []Usage { - if page.lur.IsEmpty() { - return nil - } - return *page.lur.Value -} - -// Creates a new instance of the ListUsagesResultPage type. -func NewListUsagesResultPage(cur ListUsagesResult, getNextPage func(context.Context, ListUsagesResult) (ListUsagesResult, error)) ListUsagesResultPage { - return ListUsagesResultPage{ - fn: getNextPage, - lur: cur, - } -} - -// ListVirtualMachineExtensionImage ... -type ListVirtualMachineExtensionImage struct { - autorest.Response `json:"-"` - Value *[]VirtualMachineExtensionImage `json:"value,omitempty"` -} - -// ListVirtualMachineImageResource ... -type ListVirtualMachineImageResource struct { - autorest.Response `json:"-"` - Value *[]VirtualMachineImageResource `json:"value,omitempty"` -} - -// LogAnalyticsExportRequestRateByIntervalFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type LogAnalyticsExportRequestRateByIntervalFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(LogAnalyticsClient) (LogAnalyticsOperationResult, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *LogAnalyticsExportRequestRateByIntervalFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for LogAnalyticsExportRequestRateByIntervalFuture.Result. -func (future *LogAnalyticsExportRequestRateByIntervalFuture) result(client LogAnalyticsClient) (laor LogAnalyticsOperationResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportRequestRateByIntervalFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - laor.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.LogAnalyticsExportRequestRateByIntervalFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if laor.Response.Response, err = future.GetResult(sender); err == nil && laor.Response.Response.StatusCode != http.StatusNoContent { - laor, err = client.ExportRequestRateByIntervalResponder(laor.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportRequestRateByIntervalFuture", "Result", laor.Response.Response, "Failure responding to request") - } - } - return -} - -// LogAnalyticsExportThrottledRequestsFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type LogAnalyticsExportThrottledRequestsFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(LogAnalyticsClient) (LogAnalyticsOperationResult, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *LogAnalyticsExportThrottledRequestsFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for LogAnalyticsExportThrottledRequestsFuture.Result. -func (future *LogAnalyticsExportThrottledRequestsFuture) result(client LogAnalyticsClient) (laor LogAnalyticsOperationResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportThrottledRequestsFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - laor.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.LogAnalyticsExportThrottledRequestsFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if laor.Response.Response, err = future.GetResult(sender); err == nil && laor.Response.Response.StatusCode != http.StatusNoContent { - laor, err = client.ExportThrottledRequestsResponder(laor.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportThrottledRequestsFuture", "Result", laor.Response.Response, "Failure responding to request") - } - } - return -} - -// LogAnalyticsInputBase api input base class for LogAnalytics Api. -type LogAnalyticsInputBase struct { - // 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 - FromTime *date.Time `json:"fromTime,omitempty"` - // ToTime - To time of the query - ToTime *date.Time `json:"toTime,omitempty"` - // GroupByThrottlePolicy - Group query result by Throttle Policy applied. - GroupByThrottlePolicy *bool `json:"groupByThrottlePolicy,omitempty"` - // GroupByOperationName - Group query result by Operation Name. - GroupByOperationName *bool `json:"groupByOperationName,omitempty"` - // GroupByResourceName - Group query result by Resource Name. - GroupByResourceName *bool `json:"groupByResourceName,omitempty"` -} - -// LogAnalyticsOperationResult logAnalytics operation status response -type LogAnalyticsOperationResult struct { - autorest.Response `json:"-"` - // Properties - READ-ONLY; LogAnalyticsOutput - Properties *LogAnalyticsOutput `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for LogAnalyticsOperationResult. -func (laor LogAnalyticsOperationResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// LogAnalyticsOutput logAnalytics output properties -type LogAnalyticsOutput struct { - // Output - READ-ONLY; Output file Uri path to blob container. - Output *string `json:"output,omitempty"` -} - -// MarshalJSON is the custom marshaler for LogAnalyticsOutput. -func (lao LogAnalyticsOutput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// MaintenanceRedeployStatus maintenance Operation Status. -type MaintenanceRedeployStatus struct { - // IsCustomerInitiatedMaintenanceAllowed - True, if customer is allowed to perform Maintenance. - IsCustomerInitiatedMaintenanceAllowed *bool `json:"isCustomerInitiatedMaintenanceAllowed,omitempty"` - // PreMaintenanceWindowStartTime - Start Time for the Pre Maintenance Window. - PreMaintenanceWindowStartTime *date.Time `json:"preMaintenanceWindowStartTime,omitempty"` - // PreMaintenanceWindowEndTime - End Time for the Pre Maintenance Window. - PreMaintenanceWindowEndTime *date.Time `json:"preMaintenanceWindowEndTime,omitempty"` - // MaintenanceWindowStartTime - Start Time for the Maintenance Window. - MaintenanceWindowStartTime *date.Time `json:"maintenanceWindowStartTime,omitempty"` - // MaintenanceWindowEndTime - End Time for the Maintenance Window. - MaintenanceWindowEndTime *date.Time `json:"maintenanceWindowEndTime,omitempty"` - // LastOperationResultCode - The Last Maintenance Operation Result Code. Possible values include: 'MaintenanceOperationResultCodeTypesNone', 'MaintenanceOperationResultCodeTypesRetryLater', 'MaintenanceOperationResultCodeTypesMaintenanceAborted', 'MaintenanceOperationResultCodeTypesMaintenanceCompleted' - LastOperationResultCode MaintenanceOperationResultCodeTypes `json:"lastOperationResultCode,omitempty"` - // LastOperationMessage - Message returned for the last Maintenance Operation. - LastOperationMessage *string `json:"lastOperationMessage,omitempty"` -} - -// ManagedArtifact the managed artifact. -type ManagedArtifact struct { - // ID - The managed artifact id. - ID *string `json:"id,omitempty"` -} - -// ManagedDiskParameters the parameters of a managed disk. -type ManagedDiskParameters struct { - // StorageAccountType - Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot be used with OS Disk. Possible values include: 'StorageAccountTypesStandardLRS', 'StorageAccountTypesPremiumLRS', 'StorageAccountTypesStandardSSDLRS', 'StorageAccountTypesUltraSSDLRS' - StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` - // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed disk. - DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` - // ID - Resource Id - ID *string `json:"id,omitempty"` -} - -// NetworkInterfaceReference describes a network interface reference. -type NetworkInterfaceReference struct { - *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. -type NetworkInterfaceReferenceProperties struct { - // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface. - Primary *bool `json:"primary,omitempty"` -} - -// NetworkProfile specifies the network interfaces of the virtual machine. -type NetworkProfile struct { - // NetworkInterfaces - Specifies the list of resource Ids for the network interfaces associated with the virtual machine. - NetworkInterfaces *[]NetworkInterfaceReference `json:"networkInterfaces,omitempty"` -} - -// OperationListResult the List Compute Operation operation response. -type OperationListResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; The list of compute operations - Value *[]OperationValue `json:"value,omitempty"` -} - -// MarshalJSON is the custom marshaler for OperationListResult. -func (olr OperationListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// OperationValue describes the properties of a Compute Operation value. -type OperationValue struct { - // Origin - READ-ONLY; The origin of the compute operation. - Origin *string `json:"origin,omitempty"` - // Name - READ-ONLY; 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.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 - READ-ONLY; The display name of the compute operation. - Operation *string `json:"operation,omitempty"` - // Resource - READ-ONLY; The display name of the resource the operation applies to. - Resource *string `json:"resource,omitempty"` - // Description - READ-ONLY; The description of the operation. - Description *string `json:"description,omitempty"` - // Provider - READ-ONLY; The resource provider for the operation. - Provider *string `json:"provider,omitempty"` -} - -// MarshalJSON is the custom marshaler for OperationValueDisplay. -func (ovd OperationValueDisplay) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// OrchestrationServiceStateInput the input for OrchestrationServiceState -type OrchestrationServiceStateInput struct { - // ServiceName - The name of the service. Possible values include: 'AutomaticRepairs' - ServiceName OrchestrationServiceNames `json:"serviceName,omitempty"` - // Action - The action to be performed. Possible values include: 'Resume', 'Suspend' - Action OrchestrationServiceStateAction `json:"action,omitempty"` -} - -// OrchestrationServiceSummary summary for an orchestration service of a virtual machine scale set. -type OrchestrationServiceSummary struct { - // ServiceName - READ-ONLY; The name of the service. Possible values include: 'AutomaticRepairs', 'DummyOrchestrationServiceName' - ServiceName OrchestrationServiceNames `json:"serviceName,omitempty"` - // ServiceState - READ-ONLY; The current state of the service. Possible values include: 'NotRunning', 'Running', 'Suspended' - ServiceState OrchestrationServiceState `json:"serviceState,omitempty"` -} - -// MarshalJSON is the custom marshaler for OrchestrationServiceSummary. -func (oss OrchestrationServiceSummary) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// 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). -type OSDisk struct { - // OsType - This property allows you to specify the type of the OS that is included in the disk if creating a VM from user-image or a specialized VHD.

      Possible values are:

      **Windows**

      **Linux**. Possible values include: 'Windows', 'Linux' - OsType OperatingSystemTypes `json:"osType,omitempty"` - // EncryptionSettings - Specifies the encryption settings for the OS Disk.

      Minimum api-version: 2015-06-15 - EncryptionSettings *DiskEncryptionSettings `json:"encryptionSettings,omitempty"` - // Name - The disk name. - Name *string `json:"name,omitempty"` - // Vhd - The virtual hard disk. - Vhd *VirtualHardDisk `json:"vhd,omitempty"` - // Image - 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. - Image *VirtualHardDisk `json:"image,omitempty"` - // Caching - Specifies the caching requirements.

      Possible values are:

      **None**

      **ReadOnly**

      **ReadWrite**

      Default: **None** for Standard storage. **ReadOnly** for Premium storage. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' - Caching CachingTypes `json:"caching,omitempty"` - // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. - WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` - // DiffDiskSettings - Specifies the ephemeral Disk Settings for the operating system disk used by the virtual machine. - DiffDiskSettings *DiffDiskSettings `json:"diffDiskSettings,omitempty"` - // CreateOption - Specifies how the virtual machine should be created.

      Possible values are:

      **Attach** \u2013 This value is used when you are using a specialized disk to create the virtual machine.

      **FromImage** \u2013 This value is used when you are using an image to create the virtual machine. If you are using a platform image, you also use the imageReference element described above. If you are using a marketplace image, you also use the plan element previously described. Possible values include: 'DiskCreateOptionTypesFromImage', 'DiskCreateOptionTypesEmpty', 'DiskCreateOptionTypesAttach' - CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` - // DiskSizeGB - Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image.

      This value cannot be larger than 1023 GB - DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` - // ManagedDisk - The managed disk parameters. - ManagedDisk *ManagedDiskParameters `json:"managedDisk,omitempty"` -} - -// OSDiskImage contains the os disk image information. -type OSDiskImage struct { - // OperatingSystem - The operating system of the osDiskImage. Possible values include: 'Windows', 'Linux' - OperatingSystem OperatingSystemTypes `json:"operatingSystem,omitempty"` -} - -// OSDiskImageEncryption contains encryption settings for an OS disk image. -type OSDiskImageEncryption struct { - // DiskEncryptionSetID - A relative URI containing the resource ID of the disk encryption set. - DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` -} - -// OSProfile specifies the operating system settings for the virtual machine. Some of the settings cannot -// be changed once VM is provisioned. -type OSProfile struct { - // ComputerName - Specifies the host OS name of the virtual machine.

      This name cannot be updated after the VM is created.

      **Max-length (Windows):** 15 characters

      **Max-length (Linux):** 64 characters.

      For naming conventions and restrictions see [Azure infrastructure services implementation guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). - ComputerName *string `json:"computerName,omitempty"` - // AdminUsername - Specifies the name of the administrator account.

      This property cannot be updated after the VM is created.

      **Windows-only restriction:** Cannot end in "."

      **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5".

      **Minimum-length (Linux):** 1 character

      **Max-length (Linux):** 64 characters

      **Max-length (Windows):** 20 characters

    • For root access to the Linux VM, see [Using root privileges on Linux virtual machines in Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
    • For a list of built-in system users on Linux that should not be used in this field, see [Selecting User Names for Linux on Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) - AdminUsername *string `json:"adminUsername,omitempty"` - // AdminPassword - Specifies the password of the administrator account.

      **Minimum-length (Windows):** 8 characters

      **Minimum-length (Linux):** 6 characters

      **Max-length (Windows):** 123 characters

      **Max-length (Linux):** 72 characters

      **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled
      Has lower characters
      Has upper characters
      Has a digit
      Has a special character (Regex match [\W_])

      **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!"

      For resetting the password, see [How to reset the Remote Desktop service or its login password in a Windows VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json)

      For resetting root password, see [Manage users, SSH, and check or repair disks on Azure Linux VMs using the VMAccess Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) - AdminPassword *string `json:"adminPassword,omitempty"` - // CustomData - Specifies a base-64 encoded string of custom data. The base-64 encoded string is decoded to a binary array that is saved as a file on the Virtual Machine. The maximum length of the binary array is 65535 bytes.

      **Note: Do not pass any secrets or passwords in customData property**

      This property cannot be updated after the VM is created.

      customData is passed to the VM to be saved as a file, for more information see [Custom Data on Azure VMs](https://azure.microsoft.com/en-us/blog/custom-data-and-cloud-init-on-windows-azure/)

      For using cloud-init for your Linux VM, see [Using cloud-init to customize a Linux VM during creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) - CustomData *string `json:"customData,omitempty"` - // WindowsConfiguration - Specifies Windows operating system settings on the virtual machine. - WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"` - // LinuxConfiguration - Specifies the Linux operating system settings on the virtual machine.

      For a list of supported Linux distributions, see [Linux on Azure-Endorsed Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)

      For running non-endorsed distributions, see [Information for Non-Endorsed Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). - LinuxConfiguration *LinuxConfiguration `json:"linuxConfiguration,omitempty"` - // Secrets - Specifies set of certificates that should be installed onto the virtual machine. - Secrets *[]VaultSecretGroup `json:"secrets,omitempty"` - // AllowExtensionOperations - Specifies whether extension operations should be allowed on the virtual machine.

      This may only be set to False when no extensions are present on the virtual machine. - AllowExtensionOperations *bool `json:"allowExtensionOperations,omitempty"` - // RequireGuestProvisionSignal - Specifies whether the guest provision signal is required to infer provision success of the virtual machine. - RequireGuestProvisionSignal *bool `json:"requireGuestProvisionSignal,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**. -type Plan struct { - // Name - The plan ID. - Name *string `json:"name,omitempty"` - // Publisher - The publisher ID. - Publisher *string `json:"publisher,omitempty"` - // Product - Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference element. - Product *string `json:"product,omitempty"` - // PromotionCode - The promotion code. - PromotionCode *string `json:"promotionCode,omitempty"` -} - -// ProximityPlacementGroup specifies information about the proximity placement group. -type ProximityPlacementGroup struct { - autorest.Response `json:"-"` - // ProximityPlacementGroupProperties - Describes the properties of a Proximity Placement Group. - *ProximityPlacementGroupProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; 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 ProximityPlacementGroup. -func (ppg ProximityPlacementGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ppg.ProximityPlacementGroupProperties != nil { - objectMap["properties"] = ppg.ProximityPlacementGroupProperties - } - if ppg.Location != nil { - objectMap["location"] = ppg.Location - } - if ppg.Tags != nil { - objectMap["tags"] = ppg.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ProximityPlacementGroup struct. -func (ppg *ProximityPlacementGroup) 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 proximityPlacementGroupProperties ProximityPlacementGroupProperties - err = json.Unmarshal(*v, &proximityPlacementGroupProperties) - if err != nil { - return err - } - ppg.ProximityPlacementGroupProperties = &proximityPlacementGroupProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ppg.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ppg.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - ppg.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - ppg.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - ppg.Tags = tags - } - } - } - - return nil -} - -// ProximityPlacementGroupListResult the List Proximity Placement Group operation response. -type ProximityPlacementGroupListResult struct { - autorest.Response `json:"-"` - // Value - The list of proximity placement groups - Value *[]ProximityPlacementGroup `json:"value,omitempty"` - // NextLink - The URI to fetch the next page of proximity placement groups. - NextLink *string `json:"nextLink,omitempty"` -} - -// ProximityPlacementGroupListResultIterator provides access to a complete listing of -// ProximityPlacementGroup values. -type ProximityPlacementGroupListResultIterator struct { - i int - page ProximityPlacementGroupListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ProximityPlacementGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ProximityPlacementGroupListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ProximityPlacementGroupListResultIterator) 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 ProximityPlacementGroupListResultIterator) Response() ProximityPlacementGroupListResult { - 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 ProximityPlacementGroupListResultIterator) Value() ProximityPlacementGroup { - if !iter.page.NotDone() { - return ProximityPlacementGroup{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ProximityPlacementGroupListResultIterator type. -func NewProximityPlacementGroupListResultIterator(page ProximityPlacementGroupListResultPage) ProximityPlacementGroupListResultIterator { - return ProximityPlacementGroupListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (ppglr ProximityPlacementGroupListResult) IsEmpty() bool { - return ppglr.Value == nil || len(*ppglr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (ppglr ProximityPlacementGroupListResult) hasNextLink() bool { - return ppglr.NextLink != nil && len(*ppglr.NextLink) != 0 -} - -// proximityPlacementGroupListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (ppglr ProximityPlacementGroupListResult) proximityPlacementGroupListResultPreparer(ctx context.Context) (*http.Request, error) { - if !ppglr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(ppglr.NextLink))) -} - -// ProximityPlacementGroupListResultPage contains a page of ProximityPlacementGroup values. -type ProximityPlacementGroupListResultPage struct { - fn func(context.Context, ProximityPlacementGroupListResult) (ProximityPlacementGroupListResult, error) - ppglr ProximityPlacementGroupListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ProximityPlacementGroupListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.ppglr) - if err != nil { - return err - } - page.ppglr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ProximityPlacementGroupListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ProximityPlacementGroupListResultPage) NotDone() bool { - return !page.ppglr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ProximityPlacementGroupListResultPage) Response() ProximityPlacementGroupListResult { - return page.ppglr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ProximityPlacementGroupListResultPage) Values() []ProximityPlacementGroup { - if page.ppglr.IsEmpty() { - return nil - } - return *page.ppglr.Value -} - -// Creates a new instance of the ProximityPlacementGroupListResultPage type. -func NewProximityPlacementGroupListResultPage(cur ProximityPlacementGroupListResult, getNextPage func(context.Context, ProximityPlacementGroupListResult) (ProximityPlacementGroupListResult, error)) ProximityPlacementGroupListResultPage { - return ProximityPlacementGroupListResultPage{ - fn: getNextPage, - ppglr: cur, - } -} - -// ProximityPlacementGroupProperties describes the properties of a Proximity Placement Group. -type ProximityPlacementGroupProperties struct { - // ProximityPlacementGroupType - Specifies the type of the proximity placement group.

      Possible values are:

      **Standard** : Co-locate resources within an Azure region or Availability Zone.

      **Ultra** : For future use. Possible values include: 'Standard', 'Ultra' - ProximityPlacementGroupType ProximityPlacementGroupType `json:"proximityPlacementGroupType,omitempty"` - // VirtualMachines - READ-ONLY; A list of references to all virtual machines in the proximity placement group. - VirtualMachines *[]SubResourceWithColocationStatus `json:"virtualMachines,omitempty"` - // VirtualMachineScaleSets - READ-ONLY; A list of references to all virtual machine scale sets in the proximity placement group. - VirtualMachineScaleSets *[]SubResourceWithColocationStatus `json:"virtualMachineScaleSets,omitempty"` - // AvailabilitySets - READ-ONLY; A list of references to all availability sets in the proximity placement group. - AvailabilitySets *[]SubResourceWithColocationStatus `json:"availabilitySets,omitempty"` - // ColocationStatus - Describes colocation status of the Proximity Placement Group. - ColocationStatus *InstanceViewStatus `json:"colocationStatus,omitempty"` -} - -// MarshalJSON is the custom marshaler for ProximityPlacementGroupProperties. -func (ppgp ProximityPlacementGroupProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ppgp.ProximityPlacementGroupType != "" { - objectMap["proximityPlacementGroupType"] = ppgp.ProximityPlacementGroupType - } - if ppgp.ColocationStatus != nil { - objectMap["colocationStatus"] = ppgp.ColocationStatus - } - return json.Marshal(objectMap) -} - -// ProximityPlacementGroupUpdate specifies information about the proximity placement group. -type ProximityPlacementGroupUpdate struct { - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for ProximityPlacementGroupUpdate. -func (ppgu ProximityPlacementGroupUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ppgu.Tags != nil { - objectMap["tags"] = ppgu.Tags - } - return json.Marshal(objectMap) -} - -// PurchasePlan used for establishing the purchase context of any 3rd Party artifact through MarketPlace. -type PurchasePlan struct { - // Publisher - The publisher ID. - Publisher *string `json:"publisher,omitempty"` - // Name - The plan ID. - Name *string `json:"name,omitempty"` - // Product - Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference element. - Product *string `json:"product,omitempty"` -} - -// RecommendedMachineConfiguration the properties describe the recommended machine configuration for this -// Image Definition. These properties are updatable. -type RecommendedMachineConfiguration struct { - VCPUs *ResourceRange `json:"vCPUs,omitempty"` - Memory *ResourceRange `json:"memory,omitempty"` -} - -// RecoveryWalkResponse response after calling a manual recovery walk -type RecoveryWalkResponse struct { - autorest.Response `json:"-"` - // WalkPerformed - READ-ONLY; Whether the recovery walk was performed - WalkPerformed *bool `json:"walkPerformed,omitempty"` - // NextPlatformUpdateDomain - READ-ONLY; The next update domain that needs to be walked. Null means walk spanning all update domains has been completed - NextPlatformUpdateDomain *int32 `json:"nextPlatformUpdateDomain,omitempty"` -} - -// MarshalJSON is the custom marshaler for RecoveryWalkResponse. -func (rwr RecoveryWalkResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// RegionalReplicationStatus this is the regional replication status. -type RegionalReplicationStatus struct { - // Region - READ-ONLY; The region to which the gallery Image Version is being replicated to. - Region *string `json:"region,omitempty"` - // State - READ-ONLY; This is the regional replication state. Possible values include: 'ReplicationStateUnknown', 'ReplicationStateReplicating', 'ReplicationStateCompleted', 'ReplicationStateFailed' - State ReplicationState `json:"state,omitempty"` - // Details - READ-ONLY; The details of the replication status. - Details *string `json:"details,omitempty"` - // Progress - READ-ONLY; It indicates progress of the replication job. - Progress *int32 `json:"progress,omitempty"` -} - -// MarshalJSON is the custom marshaler for RegionalReplicationStatus. -func (rrs RegionalReplicationStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ReplicationStatus this is the replication status of the gallery Image Version. -type ReplicationStatus struct { - // AggregatedState - READ-ONLY; This is the aggregated replication status based on all the regional replication status flags. Possible values include: 'Unknown', 'InProgress', 'Completed', 'Failed' - AggregatedState AggregatedReplicationState `json:"aggregatedState,omitempty"` - // Summary - READ-ONLY; This is a summary of replication status for each region. - Summary *[]RegionalReplicationStatus `json:"summary,omitempty"` -} - -// MarshalJSON is the custom marshaler for ReplicationStatus. -func (rs ReplicationStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// 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 - FromTime *date.Time `json:"fromTime,omitempty"` - // ToTime - To time of the query - ToTime *date.Time `json:"toTime,omitempty"` - // GroupByThrottlePolicy - Group query result by Throttle Policy applied. - GroupByThrottlePolicy *bool `json:"groupByThrottlePolicy,omitempty"` - // GroupByOperationName - Group query result by Operation Name. - GroupByOperationName *bool `json:"groupByOperationName,omitempty"` - // GroupByResourceName - Group query result by Resource Name. - GroupByResourceName *bool `json:"groupByResourceName,omitempty"` -} - -// Resource the Resource model definition. -type Resource struct { - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; 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.Location != nil { - objectMap["location"] = r.Location - } - if r.Tags != nil { - objectMap["tags"] = r.Tags - } - return json.Marshal(objectMap) -} - -// ResourceRange describes the resource range. -type ResourceRange struct { - // Min - The minimum number of the resource. - Min *int32 `json:"min,omitempty"` - // Max - The maximum number of the resource. - Max *int32 `json:"max,omitempty"` -} - -// ResourceSku describes an available Compute SKU. -type ResourceSku struct { - // ResourceType - READ-ONLY; The type of resource the SKU applies to. - ResourceType *string `json:"resourceType,omitempty"` - // Name - READ-ONLY; The name of SKU. - Name *string `json:"name,omitempty"` - // Tier - READ-ONLY; Specifies the tier of virtual machines in a scale set.

      Possible Values:

      **Standard**

      **Basic** - Tier *string `json:"tier,omitempty"` - // Size - READ-ONLY; The Size of the SKU. - Size *string `json:"size,omitempty"` - // Family - READ-ONLY; The Family of this particular SKU. - Family *string `json:"family,omitempty"` - // Kind - READ-ONLY; The Kind of resources that are supported in this SKU. - Kind *string `json:"kind,omitempty"` - // Capacity - READ-ONLY; Specifies the number of virtual machines in the scale set. - Capacity *ResourceSkuCapacity `json:"capacity,omitempty"` - // Locations - READ-ONLY; The set of locations that the SKU is available. - Locations *[]string `json:"locations,omitempty"` - // LocationInfo - READ-ONLY; A list of locations and availability zones in those locations where the SKU is available. - LocationInfo *[]ResourceSkuLocationInfo `json:"locationInfo,omitempty"` - // APIVersions - READ-ONLY; The api versions that support this SKU. - APIVersions *[]string `json:"apiVersions,omitempty"` - // Costs - READ-ONLY; Metadata for retrieving price info. - Costs *[]ResourceSkuCosts `json:"costs,omitempty"` - // Capabilities - READ-ONLY; A name value pair to describe the capability. - Capabilities *[]ResourceSkuCapabilities `json:"capabilities,omitempty"` - // Restrictions - READ-ONLY; The restrictions because of which SKU cannot be used. This is empty if there are no restrictions. - Restrictions *[]ResourceSkuRestrictions `json:"restrictions,omitempty"` -} - -// MarshalJSON is the custom marshaler for ResourceSku. -func (rs ResourceSku) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ResourceSkuCapabilities describes The SKU capabilities object. -type ResourceSkuCapabilities struct { - // Name - READ-ONLY; An invariant to describe the feature. - Name *string `json:"name,omitempty"` - // Value - READ-ONLY; An invariant if the feature is measured by quantity. - Value *string `json:"value,omitempty"` -} - -// MarshalJSON is the custom marshaler for ResourceSkuCapabilities. -func (rsc ResourceSkuCapabilities) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ResourceSkuCapacity describes scaling information of a SKU. -type ResourceSkuCapacity struct { - // Minimum - READ-ONLY; The minimum capacity. - Minimum *int64 `json:"minimum,omitempty"` - // Maximum - READ-ONLY; The maximum capacity that can be set. - Maximum *int64 `json:"maximum,omitempty"` - // Default - READ-ONLY; The default capacity. - Default *int64 `json:"default,omitempty"` - // ScaleType - READ-ONLY; The scale type applicable to the sku. Possible values include: 'ResourceSkuCapacityScaleTypeAutomatic', 'ResourceSkuCapacityScaleTypeManual', 'ResourceSkuCapacityScaleTypeNone' - ScaleType ResourceSkuCapacityScaleType `json:"scaleType,omitempty"` -} - -// MarshalJSON is the custom marshaler for ResourceSkuCapacity. -func (rsc ResourceSkuCapacity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ResourceSkuCosts describes metadata for retrieving price info. -type ResourceSkuCosts struct { - // MeterID - READ-ONLY; Used for querying price from commerce. - MeterID *string `json:"meterID,omitempty"` - // Quantity - READ-ONLY; The multiplier is needed to extend the base metered cost. - Quantity *int64 `json:"quantity,omitempty"` - // ExtendedUnit - READ-ONLY; An invariant to show the extended unit. - ExtendedUnit *string `json:"extendedUnit,omitempty"` -} - -// MarshalJSON is the custom marshaler for ResourceSkuCosts. -func (rsc ResourceSkuCosts) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ResourceSkuLocationInfo ... -type ResourceSkuLocationInfo struct { - // Location - READ-ONLY; Location of the SKU - Location *string `json:"location,omitempty"` - // Zones - READ-ONLY; List of availability zones where the SKU is supported. - Zones *[]string `json:"zones,omitempty"` - // ZoneDetails - READ-ONLY; Details of capabilities available to a SKU in specific zones. - ZoneDetails *[]ResourceSkuZoneDetails `json:"zoneDetails,omitempty"` -} - -// MarshalJSON is the custom marshaler for ResourceSkuLocationInfo. -func (rsli ResourceSkuLocationInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ResourceSkuRestrictionInfo ... -type ResourceSkuRestrictionInfo struct { - // Locations - READ-ONLY; Locations where the SKU is restricted - Locations *[]string `json:"locations,omitempty"` - // Zones - READ-ONLY; List of availability zones where the SKU is restricted. - Zones *[]string `json:"zones,omitempty"` -} - -// MarshalJSON is the custom marshaler for ResourceSkuRestrictionInfo. -func (rsri ResourceSkuRestrictionInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ResourceSkuRestrictions describes scaling information of a SKU. -type ResourceSkuRestrictions struct { - // Type - READ-ONLY; The type of restrictions. Possible values include: 'Location', 'Zone' - Type ResourceSkuRestrictionsType `json:"type,omitempty"` - // Values - READ-ONLY; 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"` - // RestrictionInfo - READ-ONLY; The information about the restriction where the SKU cannot be used. - RestrictionInfo *ResourceSkuRestrictionInfo `json:"restrictionInfo,omitempty"` - // ReasonCode - READ-ONLY; The reason for restriction. Possible values include: 'QuotaID', 'NotAvailableForSubscription' - ReasonCode ResourceSkuRestrictionsReasonCode `json:"reasonCode,omitempty"` -} - -// MarshalJSON is the custom marshaler for ResourceSkuRestrictions. -func (rsr ResourceSkuRestrictions) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ResourceSkusResult the List Resource Skus operation response. -type ResourceSkusResult struct { - autorest.Response `json:"-"` - // Value - The list of skus available for the subscription. - Value *[]ResourceSku `json:"value,omitempty"` - // NextLink - The URI to fetch the next page of Resource Skus. Call ListNext() with this URI to fetch the next page of Resource Skus - NextLink *string `json:"nextLink,omitempty"` -} - -// ResourceSkusResultIterator provides access to a complete listing of ResourceSku values. -type ResourceSkusResultIterator struct { - i int - page ResourceSkusResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ResourceSkusResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkusResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ResourceSkusResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ResourceSkusResultIterator) 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 ResourceSkusResultIterator) Response() ResourceSkusResult { - 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 ResourceSkusResultIterator) Value() ResourceSku { - if !iter.page.NotDone() { - return ResourceSku{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ResourceSkusResultIterator type. -func NewResourceSkusResultIterator(page ResourceSkusResultPage) ResourceSkusResultIterator { - return ResourceSkusResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (rsr ResourceSkusResult) IsEmpty() bool { - return rsr.Value == nil || len(*rsr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (rsr ResourceSkusResult) hasNextLink() bool { - return rsr.NextLink != nil && len(*rsr.NextLink) != 0 -} - -// resourceSkusResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (rsr ResourceSkusResult) resourceSkusResultPreparer(ctx context.Context) (*http.Request, error) { - if !rsr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(rsr.NextLink))) -} - -// ResourceSkusResultPage contains a page of ResourceSku values. -type ResourceSkusResultPage struct { - fn func(context.Context, ResourceSkusResult) (ResourceSkusResult, error) - rsr ResourceSkusResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ResourceSkusResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkusResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.rsr) - if err != nil { - return err - } - page.rsr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ResourceSkusResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ResourceSkusResultPage) NotDone() bool { - return !page.rsr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ResourceSkusResultPage) Response() ResourceSkusResult { - return page.rsr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ResourceSkusResultPage) Values() []ResourceSku { - if page.rsr.IsEmpty() { - return nil - } - return *page.rsr.Value -} - -// Creates a new instance of the ResourceSkusResultPage type. -func NewResourceSkusResultPage(cur ResourceSkusResult, getNextPage func(context.Context, ResourceSkusResult) (ResourceSkusResult, error)) ResourceSkusResultPage { - return ResourceSkusResultPage{ - fn: getNextPage, - rsr: cur, - } -} - -// ResourceSkuZoneDetails describes The zonal capabilities of a SKU. -type ResourceSkuZoneDetails struct { - // Name - READ-ONLY; The set of zones that the SKU is available in with the specified capabilities. - Name *[]string `json:"name,omitempty"` - // Capabilities - READ-ONLY; A list of capabilities that are available for the SKU in the specified list of zones. - Capabilities *[]ResourceSkuCapabilities `json:"capabilities,omitempty"` -} - -// MarshalJSON is the custom marshaler for ResourceSkuZoneDetails. -func (rszd ResourceSkuZoneDetails) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// RollbackStatusInfo information about rollback on failed VM instances after a OS Upgrade operation. -type RollbackStatusInfo struct { - // SuccessfullyRolledbackInstanceCount - READ-ONLY; The number of instances which have been successfully rolled back. - SuccessfullyRolledbackInstanceCount *int32 `json:"successfullyRolledbackInstanceCount,omitempty"` - // FailedRolledbackInstanceCount - READ-ONLY; The number of instances which failed to rollback. - FailedRolledbackInstanceCount *int32 `json:"failedRolledbackInstanceCount,omitempty"` - // RollbackError - READ-ONLY; Error details if OS rollback failed. - RollbackError *APIError `json:"rollbackError,omitempty"` -} - -// MarshalJSON is the custom marshaler for RollbackStatusInfo. -func (rsi RollbackStatusInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// RollingUpgradePolicy the configuration parameters used while performing a rolling upgrade. -type RollingUpgradePolicy struct { - // MaxBatchInstancePercent - The maximum percent of total virtual machine instances that will be upgraded simultaneously by the rolling upgrade in one batch. As this is a maximum, unhealthy instances in previous or future batches can cause the percentage of instances in a batch to decrease to ensure higher reliability. The default value for this parameter is 20%. - MaxBatchInstancePercent *int32 `json:"maxBatchInstancePercent,omitempty"` - // MaxUnhealthyInstancePercent - The maximum percentage of the total virtual machine instances in the scale set that can be simultaneously unhealthy, either as a result of being upgraded, or by being found in an unhealthy state by the virtual machine health checks before the rolling upgrade aborts. This constraint will be checked prior to starting any batch. The default value for this parameter is 20%. - MaxUnhealthyInstancePercent *int32 `json:"maxUnhealthyInstancePercent,omitempty"` - // MaxUnhealthyUpgradedInstancePercent - The maximum percentage of upgraded virtual machine instances that can be found to be in an unhealthy state. This check will happen after each batch is upgraded. If this percentage is ever exceeded, the rolling update aborts. The default value for this parameter is 20%. - MaxUnhealthyUpgradedInstancePercent *int32 `json:"maxUnhealthyUpgradedInstancePercent,omitempty"` - // PauseTimeBetweenBatches - The wait time between completing the update for all virtual machines in one batch and starting the next batch. The time duration should be specified in ISO 8601 format. The default value is 0 seconds (PT0S). - PauseTimeBetweenBatches *string `json:"pauseTimeBetweenBatches,omitempty"` -} - -// RollingUpgradeProgressInfo information about the number of virtual machine instances in each upgrade -// state. -type RollingUpgradeProgressInfo struct { - // SuccessfulInstanceCount - READ-ONLY; The number of instances that have been successfully upgraded. - SuccessfulInstanceCount *int32 `json:"successfulInstanceCount,omitempty"` - // FailedInstanceCount - READ-ONLY; The number of instances that have failed to be upgraded successfully. - FailedInstanceCount *int32 `json:"failedInstanceCount,omitempty"` - // InProgressInstanceCount - READ-ONLY; The number of instances that are currently being upgraded. - InProgressInstanceCount *int32 `json:"inProgressInstanceCount,omitempty"` - // PendingInstanceCount - READ-ONLY; The number of instances that have not yet begun to be upgraded. - PendingInstanceCount *int32 `json:"pendingInstanceCount,omitempty"` -} - -// MarshalJSON is the custom marshaler for RollingUpgradeProgressInfo. -func (rupi RollingUpgradeProgressInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// RollingUpgradeRunningStatus information about the current running state of the overall upgrade. -type RollingUpgradeRunningStatus struct { - // Code - READ-ONLY; Code indicating the current status of the upgrade. Possible values include: 'RollingUpgradeStatusCodeRollingForward', 'RollingUpgradeStatusCodeCancelled', 'RollingUpgradeStatusCodeCompleted', 'RollingUpgradeStatusCodeFaulted' - Code RollingUpgradeStatusCode `json:"code,omitempty"` - // StartTime - READ-ONLY; Start time of the upgrade. - StartTime *date.Time `json:"startTime,omitempty"` - // LastAction - READ-ONLY; The last action performed on the rolling upgrade. Possible values include: 'Start', 'Cancel' - LastAction RollingUpgradeActionType `json:"lastAction,omitempty"` - // LastActionTime - READ-ONLY; Last action time of the upgrade. - LastActionTime *date.Time `json:"lastActionTime,omitempty"` -} - -// MarshalJSON is the custom marshaler for RollingUpgradeRunningStatus. -func (rurs RollingUpgradeRunningStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// RollingUpgradeStatusInfo the status of the latest virtual machine scale set rolling upgrade. -type RollingUpgradeStatusInfo struct { - autorest.Response `json:"-"` - *RollingUpgradeStatusInfoProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; 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 RollingUpgradeStatusInfo. -func (rusi RollingUpgradeStatusInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rusi.RollingUpgradeStatusInfoProperties != nil { - objectMap["properties"] = rusi.RollingUpgradeStatusInfoProperties - } - 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. -type RollingUpgradeStatusInfoProperties struct { - // Policy - READ-ONLY; The rolling upgrade policies applied for this upgrade. - Policy *RollingUpgradePolicy `json:"policy,omitempty"` - // RunningStatus - READ-ONLY; Information about the current running state of the overall upgrade. - RunningStatus *RollingUpgradeRunningStatus `json:"runningStatus,omitempty"` - // Progress - READ-ONLY; Information about the number of virtual machine instances in each upgrade state. - Progress *RollingUpgradeProgressInfo `json:"progress,omitempty"` - // Error - READ-ONLY; Error details for this upgrade, if there are any. - Error *APIError `json:"error,omitempty"` -} - -// MarshalJSON is the custom marshaler for RollingUpgradeStatusInfoProperties. -func (rusip RollingUpgradeStatusInfoProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// 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. - ID *string `json:"id,omitempty"` - // OsType - The Operating System type. Possible values include: 'Windows', 'Linux' - OsType OperatingSystemTypes `json:"osType,omitempty"` - // Label - The VM run command label. - Label *string `json:"label,omitempty"` - // Description - The VM run command description. - Description *string `json:"description,omitempty"` -} - -// RunCommandDocumentBase describes the properties of a Run Command metadata. -type RunCommandDocumentBase struct { - // Schema - The VM run command schema. - Schema *string `json:"$schema,omitempty"` - // ID - The VM run command id. - ID *string `json:"id,omitempty"` - // OsType - The Operating System type. Possible values include: 'Windows', 'Linux' - OsType OperatingSystemTypes `json:"osType,omitempty"` - // Label - The VM run command label. - Label *string `json:"label,omitempty"` - // Description - The VM run command description. - Description *string `json:"description,omitempty"` -} - -// RunCommandInput capture Virtual Machine parameters. -type RunCommandInput struct { - // CommandID - The run command id. - CommandID *string `json:"commandId,omitempty"` - // Script - Optional. The script to be executed. When this value is given, the given script will override the default script of the command. - Script *[]string `json:"script,omitempty"` - // Parameters - The run command parameters. - Parameters *[]RunCommandInputParameter `json:"parameters,omitempty"` -} - -// RunCommandInputParameter describes the properties of a run command parameter. -type RunCommandInputParameter struct { - // Name - The run command parameter name. - Name *string `json:"name,omitempty"` - // Value - The run command parameter value. - Value *string `json:"value,omitempty"` -} - -// RunCommandListResult the List Virtual Machine operation response. -type RunCommandListResult struct { - autorest.Response `json:"-"` - // Value - The list of virtual machine run commands. - Value *[]RunCommandDocumentBase `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of run commands. Call ListNext() with this to fetch the next page of run commands. - NextLink *string `json:"nextLink,omitempty"` -} - -// RunCommandListResultIterator provides access to a complete listing of RunCommandDocumentBase values. -type RunCommandListResultIterator struct { - i int - page RunCommandListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *RunCommandListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RunCommandListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *RunCommandListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter RunCommandListResultIterator) 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 RunCommandListResultIterator) Response() RunCommandListResult { - 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 RunCommandListResultIterator) Value() RunCommandDocumentBase { - if !iter.page.NotDone() { - return RunCommandDocumentBase{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the RunCommandListResultIterator type. -func NewRunCommandListResultIterator(page RunCommandListResultPage) RunCommandListResultIterator { - return RunCommandListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (rclr RunCommandListResult) IsEmpty() bool { - return rclr.Value == nil || len(*rclr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (rclr RunCommandListResult) hasNextLink() bool { - return rclr.NextLink != nil && len(*rclr.NextLink) != 0 -} - -// runCommandListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (rclr RunCommandListResult) runCommandListResultPreparer(ctx context.Context) (*http.Request, error) { - if !rclr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(rclr.NextLink))) -} - -// RunCommandListResultPage contains a page of RunCommandDocumentBase values. -type RunCommandListResultPage struct { - fn func(context.Context, RunCommandListResult) (RunCommandListResult, error) - rclr RunCommandListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *RunCommandListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RunCommandListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.rclr) - if err != nil { - return err - } - page.rclr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *RunCommandListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page RunCommandListResultPage) NotDone() bool { - return !page.rclr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page RunCommandListResultPage) Response() RunCommandListResult { - return page.rclr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page RunCommandListResultPage) Values() []RunCommandDocumentBase { - if page.rclr.IsEmpty() { - return nil - } - return *page.rclr.Value -} - -// Creates a new instance of the RunCommandListResultPage type. -func NewRunCommandListResultPage(cur RunCommandListResult, getNextPage func(context.Context, RunCommandListResult) (RunCommandListResult, error)) RunCommandListResultPage { - return RunCommandListResultPage{ - fn: getNextPage, - rclr: cur, - } -} - -// RunCommandParameterDefinition describes the properties of a run command parameter. -type RunCommandParameterDefinition struct { - // Name - The run command parameter name. - Name *string `json:"name,omitempty"` - // Type - The run command parameter type. - Type *string `json:"type,omitempty"` - // DefaultValue - The run command parameter default value. - DefaultValue *string `json:"defaultValue,omitempty"` - // Required - The run command parameter required. - Required *bool `json:"required,omitempty"` -} - -// RunCommandResult ... -type RunCommandResult struct { - autorest.Response `json:"-"` - // Value - Run command operation response. - Value *[]InstanceViewStatus `json:"value,omitempty"` -} - -// ScaleInPolicy describes a scale-in policy for a virtual machine scale set. -type ScaleInPolicy struct { - // Rules - The rules to be followed when scaling-in a virtual machine scale set.

      Possible values are:

      **Default** When a virtual machine scale set is scaled in, the scale set will first be balanced across zones if it is a zonal scale set. Then, it will be balanced across Fault Domains as far as possible. Within each Fault Domain, the virtual machines chosen for removal will be the newest ones that are not protected from scale-in.

      **OldestVM** When a virtual machine scale set is being scaled-in, the oldest virtual machines that are not protected from scale-in will be chosen for removal. For zonal virtual machine scale sets, the scale set will first be balanced across zones. Within each zone, the oldest virtual machines that are not protected will be chosen for removal.

      **NewestVM** When a virtual machine scale set is being scaled-in, the newest virtual machines that are not protected from scale-in will be chosen for removal. For zonal virtual machine scale sets, the scale set will first be balanced across zones. Within each zone, the newest virtual machines that are not protected will be chosen for removal.

      - Rules *[]VirtualMachineScaleSetScaleInRules `json:"rules,omitempty"` -} - -// ScheduledEventsProfile ... -type ScheduledEventsProfile struct { - // TerminateNotificationProfile - Specifies Terminate Scheduled Event related configurations. - TerminateNotificationProfile *TerminateNotificationProfile `json:"terminateNotificationProfile,omitempty"` -} - -// ShareInfoElement ... -type ShareInfoElement struct { - // VMURI - READ-ONLY; A relative URI containing the ID of the VM that has the disk attached. - VMURI *string `json:"vmUri,omitempty"` -} - -// MarshalJSON is the custom marshaler for ShareInfoElement. -func (sie ShareInfoElement) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// Sku describes a virtual machine scale set sku. NOTE: If the new VM SKU is not supported on the hardware -// the scale set is currently on, you need to deallocate the VMs in the scale set before you modify the SKU -// name. -type Sku struct { - // Name - The sku name. - Name *string `json:"name,omitempty"` - // Tier - Specifies the tier of virtual machines in a scale set.

      Possible Values:

      **Standard**

      **Basic** - Tier *string `json:"tier,omitempty"` - // Capacity - Specifies the number of virtual machines in the scale set. - Capacity *int64 `json:"capacity,omitempty"` -} - -// Snapshot snapshot resource. -type Snapshot struct { - autorest.Response `json:"-"` - // ManagedBy - READ-ONLY; Unused. Always Null. - ManagedBy *string `json:"managedBy,omitempty"` - Sku *SnapshotSku `json:"sku,omitempty"` - *SnapshotProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; 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 Snapshot. -func (s Snapshot) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if s.Sku != nil { - objectMap["sku"] = s.Sku - } - if s.SnapshotProperties != nil { - objectMap["properties"] = s.SnapshotProperties - } - 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 SnapshotSku - err = json.Unmarshal(*v, &sku) - if err != nil { - return err - } - s.Sku = &sku - } - 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 "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. -type SnapshotList struct { - autorest.Response `json:"-"` - // Value - A list of snapshots. - Value *[]Snapshot `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of snapshots. Call ListNext() with this to fetch the next page of snapshots. - NextLink *string `json:"nextLink,omitempty"` -} - -// SnapshotListIterator provides access to a complete listing of Snapshot values. -type SnapshotListIterator struct { - i int - page SnapshotListPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *SnapshotListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *SnapshotListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter SnapshotListIterator) 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 SnapshotListIterator) Response() SnapshotList { - 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 SnapshotListIterator) Value() Snapshot { - if !iter.page.NotDone() { - return Snapshot{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the SnapshotListIterator type. -func NewSnapshotListIterator(page SnapshotListPage) SnapshotListIterator { - return SnapshotListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (sl SnapshotList) IsEmpty() bool { - return sl.Value == nil || len(*sl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (sl SnapshotList) hasNextLink() bool { - return sl.NextLink != nil && len(*sl.NextLink) != 0 -} - -// snapshotListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (sl SnapshotList) snapshotListPreparer(ctx context.Context) (*http.Request, error) { - if !sl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(sl.NextLink))) -} - -// SnapshotListPage contains a page of Snapshot values. -type SnapshotListPage struct { - fn func(context.Context, SnapshotList) (SnapshotList, error) - sl SnapshotList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *SnapshotListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.sl) - if err != nil { - return err - } - page.sl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *SnapshotListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page SnapshotListPage) NotDone() bool { - return !page.sl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page SnapshotListPage) Response() SnapshotList { - return page.sl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page SnapshotListPage) Values() []Snapshot { - if page.sl.IsEmpty() { - return nil - } - return *page.sl.Value -} - -// Creates a new instance of the SnapshotListPage type. -func NewSnapshotListPage(cur SnapshotList, getNextPage func(context.Context, SnapshotList) (SnapshotList, error)) SnapshotListPage { - return SnapshotListPage{ - fn: getNextPage, - sl: cur, - } -} - -// SnapshotProperties snapshot resource properties. -type SnapshotProperties struct { - // TimeCreated - READ-ONLY; The time when the disk was created. - TimeCreated *date.Time `json:"timeCreated,omitempty"` - // OsType - The Operating System type. Possible values include: 'Windows', 'Linux' - OsType OperatingSystemTypes `json:"osType,omitempty"` - // HyperVGeneration - The hypervisor generation of the Virtual Machine. Applicable to OS disks only. Possible values include: 'V1', 'V2' - HyperVGeneration HyperVGeneration `json:"hyperVGeneration,omitempty"` - // CreationData - Disk source information. CreationData information cannot be changed after the disk has been created. - CreationData *CreationData `json:"creationData,omitempty"` - // DiskSizeGB - If creationData.createOption is Empty, this field is mandatory and it indicates the size of the disk to create. If this field is present for updates or creation with other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size. - DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` - // DiskSizeBytes - READ-ONLY; The size of the disk in bytes. This field is read only. - DiskSizeBytes *int64 `json:"diskSizeBytes,omitempty"` - // UniqueID - READ-ONLY; Unique Guid identifying the resource. - UniqueID *string `json:"uniqueId,omitempty"` - // EncryptionSettingsCollection - Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. - EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` - // ProvisioningState - READ-ONLY; The disk provisioning state. - ProvisioningState *string `json:"provisioningState,omitempty"` - // Incremental - Whether a snapshot is incremental. Incremental snapshots on the same disk occupy less space than full snapshots and can be diffed. - Incremental *bool `json:"incremental,omitempty"` - // Encryption - Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. - Encryption *Encryption `json:"encryption,omitempty"` -} - -// MarshalJSON is the custom marshaler for SnapshotProperties. -func (sp SnapshotProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sp.OsType != "" { - objectMap["osType"] = sp.OsType - } - if sp.HyperVGeneration != "" { - objectMap["hyperVGeneration"] = sp.HyperVGeneration - } - if sp.CreationData != nil { - objectMap["creationData"] = sp.CreationData - } - if sp.DiskSizeGB != nil { - objectMap["diskSizeGB"] = sp.DiskSizeGB - } - if sp.EncryptionSettingsCollection != nil { - objectMap["encryptionSettingsCollection"] = sp.EncryptionSettingsCollection - } - if sp.Incremental != nil { - objectMap["incremental"] = sp.Incremental - } - if sp.Encryption != nil { - objectMap["encryption"] = sp.Encryption - } - return json.Marshal(objectMap) -} - -// SnapshotsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type SnapshotsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(SnapshotsClient) (Snapshot, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *SnapshotsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for SnapshotsCreateOrUpdateFuture.Result. -func (future *SnapshotsCreateOrUpdateFuture) result(client SnapshotsClient) (s Snapshot, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - s.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.SnapshotsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { - s, err = client.CreateOrUpdateResponder(s.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsCreateOrUpdateFuture", "Result", s.Response.Response, "Failure responding to request") - } - } - return -} - -// SnapshotsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type SnapshotsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(SnapshotsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *SnapshotsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for SnapshotsDeleteFuture.Result. -func (future *SnapshotsDeleteFuture) result(client SnapshotsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.SnapshotsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// SnapshotsGrantAccessFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type SnapshotsGrantAccessFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(SnapshotsClient) (AccessURI, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *SnapshotsGrantAccessFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for SnapshotsGrantAccessFuture.Result. -func (future *SnapshotsGrantAccessFuture) result(client SnapshotsClient) (au AccessURI, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsGrantAccessFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - au.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.SnapshotsGrantAccessFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if au.Response.Response, err = future.GetResult(sender); err == nil && au.Response.Response.StatusCode != http.StatusNoContent { - au, err = client.GrantAccessResponder(au.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsGrantAccessFuture", "Result", au.Response.Response, "Failure responding to request") - } - } - return -} - -// SnapshotSku the snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. -type SnapshotSku struct { - // Name - The sku name. Possible values include: 'SnapshotStorageAccountTypesStandardLRS', 'SnapshotStorageAccountTypesPremiumLRS', 'SnapshotStorageAccountTypesStandardZRS' - Name SnapshotStorageAccountTypes `json:"name,omitempty"` - // Tier - READ-ONLY; The sku tier. - Tier *string `json:"tier,omitempty"` -} - -// MarshalJSON is the custom marshaler for SnapshotSku. -func (ss SnapshotSku) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ss.Name != "" { - objectMap["name"] = ss.Name - } - return json.Marshal(objectMap) -} - -// SnapshotsRevokeAccessFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type SnapshotsRevokeAccessFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(SnapshotsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *SnapshotsRevokeAccessFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for SnapshotsRevokeAccessFuture.Result. -func (future *SnapshotsRevokeAccessFuture) result(client SnapshotsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsRevokeAccessFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.SnapshotsRevokeAccessFuture") - return - } - ar.Response = future.Response() - return -} - -// SnapshotsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type SnapshotsUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(SnapshotsClient) (Snapshot, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *SnapshotsUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for SnapshotsUpdateFuture.Result. -func (future *SnapshotsUpdateFuture) result(client SnapshotsClient) (s Snapshot, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - s.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.SnapshotsUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { - s, err = client.UpdateResponder(s.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsUpdateFuture", "Result", s.Response.Response, "Failure responding to request") - } - } - return -} - -// SnapshotUpdate snapshot update resource. -type SnapshotUpdate struct { - *SnapshotUpdateProperties `json:"properties,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` - Sku *SnapshotSku `json:"sku,omitempty"` -} - -// MarshalJSON is the custom marshaler for SnapshotUpdate. -func (su SnapshotUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if su.SnapshotUpdateProperties != nil { - objectMap["properties"] = su.SnapshotUpdateProperties - } - 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 snapshotUpdateProperties SnapshotUpdateProperties - err = json.Unmarshal(*v, &snapshotUpdateProperties) - if err != nil { - return err - } - su.SnapshotUpdateProperties = &snapshotUpdateProperties - } - 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 SnapshotSku - err = json.Unmarshal(*v, &sku) - if err != nil { - return err - } - su.Sku = &sku - } - } - } - - return nil -} - -// SnapshotUpdateProperties snapshot resource update properties. -type SnapshotUpdateProperties struct { - // OsType - the Operating System type. Possible values include: 'Windows', 'Linux' - OsType OperatingSystemTypes `json:"osType,omitempty"` - // DiskSizeGB - If creationData.createOption is Empty, this field is mandatory and it indicates the size of the disk to create. If this field is present for updates or creation with other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size. - DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` - // EncryptionSettingsCollection - Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. - EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` - // Encryption - Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. - Encryption *Encryption `json:"encryption,omitempty"` -} - -// SourceVault the vault id is an Azure Resource Manager Resource id in the form -// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName} -type SourceVault struct { - // ID - Resource Id - ID *string `json:"id,omitempty"` -} - -// SSHConfiguration SSH configuration for Linux based VMs running on Azure -type SSHConfiguration struct { - // PublicKeys - The list of SSH public keys used to authenticate with linux based VMs. - 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. -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"` - // KeyData - SSH public key certificate used to authenticate with the VM through ssh. The key needs to be at least 2048-bit and in ssh-rsa format.

      For creating ssh keys, see [Create SSH keys on Linux and Mac for Linux VMs in Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-mac-create-ssh-keys?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). - KeyData *string `json:"keyData,omitempty"` -} - -// SSHPublicKeyGenerateKeyPairResult response from generation of an SSH key pair. -type SSHPublicKeyGenerateKeyPairResult struct { - autorest.Response `json:"-"` - // PrivateKey - Private key portion of the key pair used to authenticate to a virtual machine through ssh. The private key is returned in RFC3447 format and should be treated as a secret. - PrivateKey *string `json:"privateKey,omitempty"` - // PublicKey - Public key portion of the key pair used to authenticate to a virtual machine through ssh. The public key is in ssh-rsa format. - PublicKey *string `json:"publicKey,omitempty"` - // ID - The ARM resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{SshPublicKeyName} - ID *string `json:"id,omitempty"` -} - -// SSHPublicKeyResource specifies information about the SSH public key. -type SSHPublicKeyResource struct { - autorest.Response `json:"-"` - // SSHPublicKeyResourceProperties - Properties of the SSH public key. - *SSHPublicKeyResourceProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; 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 SSHPublicKeyResource. -func (spkr SSHPublicKeyResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if spkr.SSHPublicKeyResourceProperties != nil { - objectMap["properties"] = spkr.SSHPublicKeyResourceProperties - } - if spkr.Location != nil { - objectMap["location"] = spkr.Location - } - if spkr.Tags != nil { - objectMap["tags"] = spkr.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for SSHPublicKeyResource struct. -func (spkr *SSHPublicKeyResource) 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 SSHPublicKeyResourceProperties SSHPublicKeyResourceProperties - err = json.Unmarshal(*v, &SSHPublicKeyResourceProperties) - if err != nil { - return err - } - spkr.SSHPublicKeyResourceProperties = &SSHPublicKeyResourceProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - spkr.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - spkr.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - spkr.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - spkr.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - spkr.Tags = tags - } - } - } - - return nil -} - -// SSHPublicKeyResourceProperties properties of the SSH public key. -type SSHPublicKeyResourceProperties struct { - // PublicKey - SSH public key used to authenticate to a virtual machine through ssh. If this property is not initially provided when the resource is created, the publicKey property will be populated when generateKeyPair is called. If the public key is provided upon resource creation, the provided public key needs to be at least 2048-bit and in ssh-rsa format. - PublicKey *string `json:"publicKey,omitempty"` -} - -// SSHPublicKeysGroupListResult the list SSH public keys operation response. -type SSHPublicKeysGroupListResult struct { - autorest.Response `json:"-"` - // Value - The list of SSH public keys - Value *[]SSHPublicKeyResource `json:"value,omitempty"` - // NextLink - The URI to fetch the next page of SSH public keys. Call ListNext() with this URI to fetch the next page of SSH public keys. - NextLink *string `json:"nextLink,omitempty"` -} - -// SSHPublicKeysGroupListResultIterator provides access to a complete listing of SSHPublicKeyResource -// values. -type SSHPublicKeysGroupListResultIterator struct { - i int - page SSHPublicKeysGroupListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *SSHPublicKeysGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SSHPublicKeysGroupListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *SSHPublicKeysGroupListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter SSHPublicKeysGroupListResultIterator) 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 SSHPublicKeysGroupListResultIterator) Response() SSHPublicKeysGroupListResult { - 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 SSHPublicKeysGroupListResultIterator) Value() SSHPublicKeyResource { - if !iter.page.NotDone() { - return SSHPublicKeyResource{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the SSHPublicKeysGroupListResultIterator type. -func NewSSHPublicKeysGroupListResultIterator(page SSHPublicKeysGroupListResultPage) SSHPublicKeysGroupListResultIterator { - return SSHPublicKeysGroupListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (spkglr SSHPublicKeysGroupListResult) IsEmpty() bool { - return spkglr.Value == nil || len(*spkglr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (spkglr SSHPublicKeysGroupListResult) hasNextLink() bool { - return spkglr.NextLink != nil && len(*spkglr.NextLink) != 0 -} - -// sSHPublicKeysGroupListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (spkglr SSHPublicKeysGroupListResult) sSHPublicKeysGroupListResultPreparer(ctx context.Context) (*http.Request, error) { - if !spkglr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(spkglr.NextLink))) -} - -// SSHPublicKeysGroupListResultPage contains a page of SSHPublicKeyResource values. -type SSHPublicKeysGroupListResultPage struct { - fn func(context.Context, SSHPublicKeysGroupListResult) (SSHPublicKeysGroupListResult, error) - spkglr SSHPublicKeysGroupListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *SSHPublicKeysGroupListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SSHPublicKeysGroupListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.spkglr) - if err != nil { - return err - } - page.spkglr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *SSHPublicKeysGroupListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page SSHPublicKeysGroupListResultPage) NotDone() bool { - return !page.spkglr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page SSHPublicKeysGroupListResultPage) Response() SSHPublicKeysGroupListResult { - return page.spkglr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page SSHPublicKeysGroupListResultPage) Values() []SSHPublicKeyResource { - if page.spkglr.IsEmpty() { - return nil - } - return *page.spkglr.Value -} - -// Creates a new instance of the SSHPublicKeysGroupListResultPage type. -func NewSSHPublicKeysGroupListResultPage(cur SSHPublicKeysGroupListResult, getNextPage func(context.Context, SSHPublicKeysGroupListResult) (SSHPublicKeysGroupListResult, error)) SSHPublicKeysGroupListResultPage { - return SSHPublicKeysGroupListResultPage{ - fn: getNextPage, - spkglr: cur, - } -} - -// SSHPublicKeyUpdateResource specifies information about the SSH public key. -type SSHPublicKeyUpdateResource struct { - // SSHPublicKeyResourceProperties - Properties of the SSH public key. - *SSHPublicKeyResourceProperties `json:"properties,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for SSHPublicKeyUpdateResource. -func (spkur SSHPublicKeyUpdateResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if spkur.SSHPublicKeyResourceProperties != nil { - objectMap["properties"] = spkur.SSHPublicKeyResourceProperties - } - if spkur.Tags != nil { - objectMap["tags"] = spkur.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for SSHPublicKeyUpdateResource struct. -func (spkur *SSHPublicKeyUpdateResource) 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 SSHPublicKeyResourceProperties SSHPublicKeyResourceProperties - err = json.Unmarshal(*v, &SSHPublicKeyResourceProperties) - if err != nil { - return err - } - spkur.SSHPublicKeyResourceProperties = &SSHPublicKeyResourceProperties - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - spkur.Tags = tags - } - } - } - - return nil -} - -// StorageProfile specifies the storage settings for the virtual machine disks. -type StorageProfile struct { - // ImageReference - Specifies information about the image to use. You can specify information about platform images, 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. - ImageReference *ImageReference `json:"imageReference,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). - OsDisk *OSDisk `json:"osDisk,omitempty"` - // DataDisks - Specifies the parameters that are used to add a data disk to a 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). - DataDisks *[]DataDisk `json:"dataDisks,omitempty"` -} - -// SubResource ... -type SubResource struct { - // ID - Resource Id - ID *string `json:"id,omitempty"` -} - -// SubResourceReadOnly ... -type SubResourceReadOnly struct { - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for SubResourceReadOnly. -func (srro SubResourceReadOnly) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// SubResourceWithColocationStatus ... -type SubResourceWithColocationStatus struct { - // ColocationStatus - Describes colocation status of a resource in the Proximity Placement Group. - ColocationStatus *InstanceViewStatus `json:"colocationStatus,omitempty"` - // ID - Resource Id - ID *string `json:"id,omitempty"` -} - -// TargetRegion describes the target region information. -type TargetRegion struct { - // Name - The name of the region. - Name *string `json:"name,omitempty"` - // RegionalReplicaCount - The number of replicas of the Image Version to be created per region. This property is updatable. - RegionalReplicaCount *int32 `json:"regionalReplicaCount,omitempty"` - // StorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable. Possible values include: 'StorageAccountTypeStandardLRS', 'StorageAccountTypeStandardZRS', 'StorageAccountTypePremiumLRS' - StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` - Encryption *EncryptionImages `json:"encryption,omitempty"` -} - -// TerminateNotificationProfile ... -type TerminateNotificationProfile struct { - // NotBeforeTimeout - Configurable length of time a Virtual Machine being deleted will have to potentially approve the Terminate Scheduled Event before the event is auto approved (timed out). The configuration must be specified in ISO 8601 format, the default value is 5 minutes (PT5M) - NotBeforeTimeout *string `json:"notBeforeTimeout,omitempty"` - // Enable - Specifies whether the Terminate Scheduled event is enabled or disabled. - Enable *bool `json:"enable,omitempty"` -} - -// ThrottledRequestsInput api request input for LogAnalytics getThrottledRequests Api. -type ThrottledRequestsInput struct { - // 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 - FromTime *date.Time `json:"fromTime,omitempty"` - // ToTime - To time of the query - ToTime *date.Time `json:"toTime,omitempty"` - // GroupByThrottlePolicy - Group query result by Throttle Policy applied. - GroupByThrottlePolicy *bool `json:"groupByThrottlePolicy,omitempty"` - // GroupByOperationName - Group query result by Operation Name. - GroupByOperationName *bool `json:"groupByOperationName,omitempty"` - // GroupByResourceName - Group query result by Resource Name. - GroupByResourceName *bool `json:"groupByResourceName,omitempty"` -} - -// UpdateResource the Update Resource model definition. -type UpdateResource struct { - // Tags - Resource tags - 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) -} - -// UpdateResourceDefinition the Update Resource model definition. -type UpdateResourceDefinition struct { - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for UpdateResourceDefinition. -func (urd UpdateResourceDefinition) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if urd.Tags != nil { - objectMap["tags"] = urd.Tags - } - return json.Marshal(objectMap) -} - -// UpgradeOperationHistoricalStatusInfo virtual Machine Scale Set OS Upgrade History operation response. -type UpgradeOperationHistoricalStatusInfo struct { - // Properties - READ-ONLY; Information about the properties of the upgrade operation. - Properties *UpgradeOperationHistoricalStatusInfoProperties `json:"properties,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Location - READ-ONLY; Resource location - Location *string `json:"location,omitempty"` -} - -// MarshalJSON is the custom marshaler for UpgradeOperationHistoricalStatusInfo. -func (uohsi UpgradeOperationHistoricalStatusInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// UpgradeOperationHistoricalStatusInfoProperties describes each OS upgrade on the Virtual Machine Scale -// Set. -type UpgradeOperationHistoricalStatusInfoProperties struct { - // RunningStatus - READ-ONLY; Information about the overall status of the upgrade operation. - RunningStatus *UpgradeOperationHistoryStatus `json:"runningStatus,omitempty"` - // Progress - READ-ONLY; Counts of the VMs in each state. - Progress *RollingUpgradeProgressInfo `json:"progress,omitempty"` - // Error - READ-ONLY; Error Details for this upgrade if there are any. - Error *APIError `json:"error,omitempty"` - // StartedBy - READ-ONLY; Invoker of the Upgrade Operation. Possible values include: 'UpgradeOperationInvokerUnknown', 'UpgradeOperationInvokerUser', 'UpgradeOperationInvokerPlatform' - StartedBy UpgradeOperationInvoker `json:"startedBy,omitempty"` - // TargetImageReference - READ-ONLY; Image Reference details - TargetImageReference *ImageReference `json:"targetImageReference,omitempty"` - // RollbackInfo - READ-ONLY; Information about OS rollback if performed - RollbackInfo *RollbackStatusInfo `json:"rollbackInfo,omitempty"` -} - -// MarshalJSON is the custom marshaler for UpgradeOperationHistoricalStatusInfoProperties. -func (uohsip UpgradeOperationHistoricalStatusInfoProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// UpgradeOperationHistoryStatus information about the current running state of the overall upgrade. -type UpgradeOperationHistoryStatus struct { - // Code - READ-ONLY; Code indicating the current status of the upgrade. Possible values include: 'UpgradeStateRollingForward', 'UpgradeStateCancelled', 'UpgradeStateCompleted', 'UpgradeStateFaulted' - Code UpgradeState `json:"code,omitempty"` - // StartTime - READ-ONLY; Start time of the upgrade. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - READ-ONLY; End time of the upgrade. - EndTime *date.Time `json:"endTime,omitempty"` -} - -// MarshalJSON is the custom marshaler for UpgradeOperationHistoryStatus. -func (uohs UpgradeOperationHistoryStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// UpgradePolicy describes an upgrade policy - automatic, manual, or rolling. -type UpgradePolicy struct { - // Mode - Specifies the mode of an upgrade to virtual machines in the scale set.

      Possible values are:

      **Manual** - You control the application of updates to virtual machines in the scale set. You do this by using the manualUpgrade action.

      **Automatic** - All virtual machines in the scale set are automatically updated at the same time. Possible values include: 'Automatic', 'Manual', 'Rolling' - Mode UpgradeMode `json:"mode,omitempty"` - // RollingUpgradePolicy - The configuration parameters used while performing a rolling upgrade. - RollingUpgradePolicy *RollingUpgradePolicy `json:"rollingUpgradePolicy,omitempty"` - // AutomaticOSUpgradePolicy - Configuration parameters used for performing automatic OS Upgrade. - AutomaticOSUpgradePolicy *AutomaticOSUpgradePolicy `json:"automaticOSUpgradePolicy,omitempty"` -} - -// Usage describes Compute Resource Usage. -type Usage struct { - // Unit - An enum describing the unit of usage measurement. - Unit *string `json:"unit,omitempty"` - // CurrentValue - The current usage of the resource. - CurrentValue *int32 `json:"currentValue,omitempty"` - // Limit - The maximum permitted usage of the resource. - Limit *int64 `json:"limit,omitempty"` - // Name - The name of the type of usage. - Name *UsageName `json:"name,omitempty"` -} - -// UsageName the Usage Names. -type UsageName struct { - // Value - The name of the resource. - Value *string `json:"value,omitempty"` - // LocalizedValue - The localized name of the resource. - LocalizedValue *string `json:"localizedValue,omitempty"` -} - -// UserArtifactSource the source image from which the Image Version is going to be created. -type UserArtifactSource struct { - // FileName - Required. The fileName of the artifact. - FileName *string `json:"fileName,omitempty"` - // MediaLink - Required. The mediaLink of the artifact, must be a readable storage blob. - MediaLink *string `json:"mediaLink,omitempty"` -} - -// 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"` - // CertificateStore - For Windows VMs, specifies the certificate store on the Virtual Machine to which the certificate should be added. The specified certificate store is implicitly in the LocalMachine account.

      For Linux VMs, the certificate file is placed under the /var/lib/waagent directory, with the file name <UppercaseThumbprint>.crt for the X509 certificate file and <UppercaseThumbprint>.prv for private key. Both of these files are .pem formatted. - CertificateStore *string `json:"certificateStore,omitempty"` -} - -// VaultSecretGroup describes a set of certificates which are all in the same Key Vault. -type VaultSecretGroup struct { - // SourceVault - The relative URL of the Key Vault containing all of the certificates in VaultCertificates. - SourceVault *SubResource `json:"sourceVault,omitempty"` - // VaultCertificates - The list of key vault references in SourceVault which contain certificates. - VaultCertificates *[]VaultCertificate `json:"vaultCertificates,omitempty"` -} - -// VirtualHardDisk describes the uri of a disk. -type VirtualHardDisk struct { - // URI - Specifies the virtual hard disk's uri. - URI *string `json:"uri,omitempty"` -} - -// VirtualMachine describes a Virtual Machine. -type VirtualMachine struct { - autorest.Response `json:"-"` - // 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"` - // Resources - READ-ONLY; The virtual machine child extension resources. - Resources *[]VirtualMachineExtension `json:"resources,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"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; 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.Identity != nil { - objectMap["identity"] = VM.Identity - } - if VM.Zones != nil { - objectMap["zones"] = VM.Zones - } - 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. -type VirtualMachineAgentInstanceView struct { - // VMAgentVersion - The VM Agent full version. - VMAgentVersion *string `json:"vmAgentVersion,omitempty"` - // ExtensionHandlers - The virtual machine extension handler instance view. - ExtensionHandlers *[]VirtualMachineExtensionHandlerInstanceView `json:"extensionHandlers,omitempty"` - // Statuses - The resource status information. - Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` -} - -// VirtualMachineCaptureParameters capture Virtual Machine parameters. -type VirtualMachineCaptureParameters struct { - // VhdPrefix - The captured virtual hard disk's name prefix. - VhdPrefix *string `json:"vhdPrefix,omitempty"` - // DestinationContainerName - The destination container name. - DestinationContainerName *string `json:"destinationContainerName,omitempty"` - // OverwriteVhds - Specifies whether to overwrite the destination virtual hard disk, in case of conflict. - OverwriteVhds *bool `json:"overwriteVhds,omitempty"` -} - -// VirtualMachineCaptureResult output of virtual machine capture operation. -type VirtualMachineCaptureResult struct { - autorest.Response `json:"-"` - // Schema - READ-ONLY; the schema of the captured virtual machine - Schema *string `json:"$schema,omitempty"` - // ContentVersion - READ-ONLY; the version of the content - ContentVersion *string `json:"contentVersion,omitempty"` - // Parameters - READ-ONLY; parameters of the captured virtual machine - Parameters interface{} `json:"parameters,omitempty"` - // Resources - READ-ONLY; a list of resource items of the captured virtual machine - Resources *[]interface{} `json:"resources,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.ID != nil { - objectMap["id"] = vmcr.ID - } - return json.Marshal(objectMap) -} - -// VirtualMachineExtension describes a Virtual Machine Extension. -type VirtualMachineExtension struct { - autorest.Response `json:"-"` - *VirtualMachineExtensionProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; 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 VirtualMachineExtension. -func (vme VirtualMachineExtension) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vme.VirtualMachineExtensionProperties != nil { - objectMap["properties"] = vme.VirtualMachineExtensionProperties - } - 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. -type VirtualMachineExtensionHandlerInstanceView struct { - // Type - Specifies the type of the extension; an example is "CustomScriptExtension". - Type *string `json:"type,omitempty"` - // TypeHandlerVersion - Specifies the version of the script handler. - TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` - // Status - The extension handler status. - Status *InstanceViewStatus `json:"status,omitempty"` -} - -// VirtualMachineExtensionImage describes a Virtual Machine Extension Image. -type VirtualMachineExtensionImage struct { - autorest.Response `json:"-"` - *VirtualMachineExtensionImageProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; 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 VirtualMachineExtensionImage. -func (vmei VirtualMachineExtensionImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmei.VirtualMachineExtensionImageProperties != nil { - objectMap["properties"] = vmei.VirtualMachineExtensionImageProperties - } - 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. -type VirtualMachineExtensionImageProperties struct { - // OperatingSystem - The operating system this extension supports. - OperatingSystem *string `json:"operatingSystem,omitempty"` - // ComputeRole - The type of role (IaaS or PaaS) this extension supports. - ComputeRole *string `json:"computeRole,omitempty"` - // HandlerSchema - The schema defined by publisher, where extension consumers should provide settings in a matching schema. - HandlerSchema *string `json:"handlerSchema,omitempty"` - // VMScaleSetEnabled - Whether the extension can be used on xRP VMScaleSets. By default existing extensions are usable on scalesets, but there might be cases where a publisher wants to explicitly indicate the extension is only enabled for CRP VMs but not VMSS. - VMScaleSetEnabled *bool `json:"vmScaleSetEnabled,omitempty"` - // SupportsMultipleExtensions - Whether the handler can support multiple extensions. - SupportsMultipleExtensions *bool `json:"supportsMultipleExtensions,omitempty"` -} - -// VirtualMachineExtensionInstanceView the instance view of a virtual machine extension. -type VirtualMachineExtensionInstanceView struct { - // Name - The virtual machine extension name. - Name *string `json:"name,omitempty"` - // Type - Specifies the type of the extension; an example is "CustomScriptExtension". - Type *string `json:"type,omitempty"` - // TypeHandlerVersion - Specifies the version of the script handler. - TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` - // Substatuses - The resource status information. - Substatuses *[]InstanceViewStatus `json:"substatuses,omitempty"` - // Statuses - The resource status information. - Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` -} - -// VirtualMachineExtensionProperties describes the properties of a Virtual Machine Extension. -type VirtualMachineExtensionProperties struct { - // ForceUpdateTag - How the extension handler should be forced to update even if the extension configuration has not changed. - ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` - // Publisher - The name of the extension handler publisher. - Publisher *string `json:"publisher,omitempty"` - // Type - Specifies the type of the extension; an example is "CustomScriptExtension". - Type *string `json:"type,omitempty"` - // TypeHandlerVersion - Specifies the version of the script handler. - TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` - // 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 interface{} `json:"settings,omitempty"` - // ProtectedSettings - The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. - ProtectedSettings interface{} `json:"protectedSettings,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *string `json:"provisioningState,omitempty"` - // InstanceView - The virtual machine extension instance view. - InstanceView *VirtualMachineExtensionInstanceView `json:"instanceView,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineExtensionProperties. -func (vmep VirtualMachineExtensionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmep.ForceUpdateTag != nil { - objectMap["forceUpdateTag"] = vmep.ForceUpdateTag - } - if vmep.Publisher != nil { - objectMap["publisher"] = vmep.Publisher - } - if vmep.Type != nil { - objectMap["type"] = vmep.Type - } - if vmep.TypeHandlerVersion != nil { - objectMap["typeHandlerVersion"] = vmep.TypeHandlerVersion - } - if vmep.AutoUpgradeMinorVersion != nil { - objectMap["autoUpgradeMinorVersion"] = vmep.AutoUpgradeMinorVersion - } - if vmep.Settings != nil { - objectMap["settings"] = vmep.Settings - } - if vmep.ProtectedSettings != nil { - objectMap["protectedSettings"] = vmep.ProtectedSettings - } - if vmep.InstanceView != nil { - objectMap["instanceView"] = vmep.InstanceView - } - return json.Marshal(objectMap) -} - -// VirtualMachineExtensionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. -type VirtualMachineExtensionsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineExtensionsClient) (VirtualMachineExtension, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineExtensionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineExtensionsCreateOrUpdateFuture.Result. -func (future *VirtualMachineExtensionsCreateOrUpdateFuture) result(client VirtualMachineExtensionsClient) (vme VirtualMachineExtension, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vme.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineExtensionsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vme.Response.Response, err = future.GetResult(sender); err == nil && vme.Response.Response.StatusCode != http.StatusNoContent { - vme, err = client.CreateOrUpdateResponder(vme.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsCreateOrUpdateFuture", "Result", vme.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachineExtensionsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineExtensionsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineExtensionsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineExtensionsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineExtensionsDeleteFuture.Result. -func (future *VirtualMachineExtensionsDeleteFuture) result(client VirtualMachineExtensionsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineExtensionsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineExtensionsListResult the List Extension operation response -type VirtualMachineExtensionsListResult struct { - autorest.Response `json:"-"` - // Value - The list of extensions - Value *[]VirtualMachineExtension `json:"value,omitempty"` -} - -// VirtualMachineExtensionsUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineExtensionsUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineExtensionsClient) (VirtualMachineExtension, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineExtensionsUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineExtensionsUpdateFuture.Result. -func (future *VirtualMachineExtensionsUpdateFuture) result(client VirtualMachineExtensionsClient) (vme VirtualMachineExtension, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vme.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineExtensionsUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vme.Response.Response, err = future.GetResult(sender); err == nil && vme.Response.Response.StatusCode != http.StatusNoContent { - vme, err = client.UpdateResponder(vme.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsUpdateFuture", "Result", vme.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachineExtensionUpdate describes a Virtual Machine Extension. -type VirtualMachineExtensionUpdate struct { - *VirtualMachineExtensionUpdateProperties `json:"properties,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineExtensionUpdate. -func (vmeu VirtualMachineExtensionUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmeu.VirtualMachineExtensionUpdateProperties != nil { - objectMap["properties"] = vmeu.VirtualMachineExtensionUpdateProperties - } - if vmeu.Tags != nil { - objectMap["tags"] = vmeu.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualMachineExtensionUpdate struct. -func (vmeu *VirtualMachineExtensionUpdate) 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 virtualMachineExtensionUpdateProperties VirtualMachineExtensionUpdateProperties - err = json.Unmarshal(*v, &virtualMachineExtensionUpdateProperties) - if err != nil { - return err - } - vmeu.VirtualMachineExtensionUpdateProperties = &virtualMachineExtensionUpdateProperties - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - vmeu.Tags = tags - } - } - } - - return nil -} - -// VirtualMachineExtensionUpdateProperties describes the properties of a Virtual Machine Extension. -type VirtualMachineExtensionUpdateProperties struct { - // ForceUpdateTag - How the extension handler should be forced to update even if the extension configuration has not changed. - ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` - // Publisher - The name of the extension handler publisher. - Publisher *string `json:"publisher,omitempty"` - // Type - Specifies the type of the extension; an example is "CustomScriptExtension". - Type *string `json:"type,omitempty"` - // TypeHandlerVersion - Specifies the version of the script handler. - TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` - // 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 interface{} `json:"settings,omitempty"` - // ProtectedSettings - The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. - ProtectedSettings interface{} `json:"protectedSettings,omitempty"` -} - -// VirtualMachineHealthStatus the health status of the VM. -type VirtualMachineHealthStatus struct { - // Status - READ-ONLY; The health status information for the VM. - Status *InstanceViewStatus `json:"status,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineHealthStatus. -func (vmhs VirtualMachineHealthStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// VirtualMachineIdentity identity for the virtual machine. -type VirtualMachineIdentity struct { - // PrincipalID - READ-ONLY; The principal id of virtual machine identity. This property will only be provided for a system assigned identity. - PrincipalID *string `json:"principalId,omitempty"` - // TenantID - READ-ONLY; The tenant id associated with the virtual machine. This property will only be provided for a system assigned identity. - TenantID *string `json:"tenantId,omitempty"` - // Type - The type of identity used for the virtual machine. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the virtual machine. Possible values include: 'ResourceIdentityTypeSystemAssigned', 'ResourceIdentityTypeUserAssigned', 'ResourceIdentityTypeSystemAssignedUserAssigned', 'ResourceIdentityTypeNone' - Type ResourceIdentityType `json:"type,omitempty"` - // UserAssignedIdentities - The list of user identities associated with the Virtual Machine. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - UserAssignedIdentities map[string]*VirtualMachineIdentityUserAssignedIdentitiesValue `json:"userAssignedIdentities"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineIdentity. -func (vmi VirtualMachineIdentity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmi.Type != "" { - objectMap["type"] = vmi.Type - } - if vmi.UserAssignedIdentities != nil { - objectMap["userAssignedIdentities"] = vmi.UserAssignedIdentities - } - return json.Marshal(objectMap) -} - -// VirtualMachineIdentityUserAssignedIdentitiesValue ... -type VirtualMachineIdentityUserAssignedIdentitiesValue struct { - // PrincipalID - READ-ONLY; The principal id of user assigned identity. - PrincipalID *string `json:"principalId,omitempty"` - // ClientID - READ-ONLY; The client id of user assigned identity. - ClientID *string `json:"clientId,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineIdentityUserAssignedIdentitiesValue. -func (vmiAiv VirtualMachineIdentityUserAssignedIdentitiesValue) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// VirtualMachineImage describes a Virtual Machine Image. -type VirtualMachineImage struct { - 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"` - // 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. -type VirtualMachineImageProperties struct { - Plan *PurchasePlan `json:"plan,omitempty"` - OsDiskImage *OSDiskImage `json:"osDiskImage,omitempty"` - DataDiskImages *[]DataDiskImage `json:"dataDiskImages,omitempty"` - AutomaticOSUpgradeProperties *AutomaticOSUpgradeProperties `json:"automaticOSUpgradeProperties,omitempty"` - // HyperVGeneration - Possible values include: 'HyperVGenerationTypesV1', 'HyperVGenerationTypesV2' - HyperVGeneration HyperVGenerationTypes `json:"hyperVGeneration,omitempty"` -} - -// VirtualMachineImageResource virtual machine image resource information. -type VirtualMachineImageResource struct { - // 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"` - // 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. -type VirtualMachineInstanceView struct { - autorest.Response `json:"-"` - // PlatformUpdateDomain - Specifies the update domain of the virtual machine. - PlatformUpdateDomain *int32 `json:"platformUpdateDomain,omitempty"` - // PlatformFaultDomain - Specifies the fault domain of the virtual machine. - PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"` - // ComputerName - The computer name assigned to the virtual machine. - ComputerName *string `json:"computerName,omitempty"` - // OsName - The Operating System running on the virtual machine. - OsName *string `json:"osName,omitempty"` - // OsVersion - The version of Operating System running on the virtual machine. - OsVersion *string `json:"osVersion,omitempty"` - // HyperVGeneration - Specifies the HyperVGeneration Type associated with a resource. Possible values include: 'HyperVGenerationTypeV1', 'HyperVGenerationTypeV2' - HyperVGeneration HyperVGenerationType `json:"hyperVGeneration,omitempty"` - // RdpThumbPrint - The Remote desktop certificate thumbprint. - RdpThumbPrint *string `json:"rdpThumbPrint,omitempty"` - // VMAgent - The VM Agent running on the virtual machine. - VMAgent *VirtualMachineAgentInstanceView `json:"vmAgent,omitempty"` - // MaintenanceRedeployStatus - The Maintenance Operation status on the virtual machine. - MaintenanceRedeployStatus *MaintenanceRedeployStatus `json:"maintenanceRedeployStatus,omitempty"` - // Disks - The virtual machine disk information. - Disks *[]DiskInstanceView `json:"disks,omitempty"` - // Extensions - The extensions information. - Extensions *[]VirtualMachineExtensionInstanceView `json:"extensions,omitempty"` - // BootDiagnostics - Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to diagnose VM status.

      You can easily view the output of your console log.

      Azure also enables you to see a screenshot of the VM from the hypervisor. - BootDiagnostics *BootDiagnosticsInstanceView `json:"bootDiagnostics,omitempty"` - // Statuses - The resource status information. - Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` -} - -// VirtualMachineListResult the List Virtual Machine operation response. -type VirtualMachineListResult struct { - autorest.Response `json:"-"` - // Value - The list of virtual machines. - Value *[]VirtualMachine `json:"value,omitempty"` - // NextLink - The URI to fetch the next page of VMs. Call ListNext() with this URI to fetch the next page of Virtual Machines. - NextLink *string `json:"nextLink,omitempty"` -} - -// VirtualMachineListResultIterator provides access to a complete listing of VirtualMachine values. -type VirtualMachineListResultIterator struct { - i int - page VirtualMachineListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *VirtualMachineListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *VirtualMachineListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter VirtualMachineListResultIterator) 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 VirtualMachineListResultIterator) Response() VirtualMachineListResult { - 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 VirtualMachineListResultIterator) Value() VirtualMachine { - if !iter.page.NotDone() { - return VirtualMachine{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the VirtualMachineListResultIterator type. -func NewVirtualMachineListResultIterator(page VirtualMachineListResultPage) VirtualMachineListResultIterator { - return VirtualMachineListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (vmlr VirtualMachineListResult) IsEmpty() bool { - return vmlr.Value == nil || len(*vmlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (vmlr VirtualMachineListResult) hasNextLink() bool { - return vmlr.NextLink != nil && len(*vmlr.NextLink) != 0 -} - -// virtualMachineListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (vmlr VirtualMachineListResult) virtualMachineListResultPreparer(ctx context.Context) (*http.Request, error) { - if !vmlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(vmlr.NextLink))) -} - -// VirtualMachineListResultPage contains a page of VirtualMachine values. -type VirtualMachineListResultPage struct { - fn func(context.Context, VirtualMachineListResult) (VirtualMachineListResult, error) - vmlr VirtualMachineListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *VirtualMachineListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.vmlr) - if err != nil { - return err - } - page.vmlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *VirtualMachineListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page VirtualMachineListResultPage) NotDone() bool { - return !page.vmlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page VirtualMachineListResultPage) Response() VirtualMachineListResult { - return page.vmlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page VirtualMachineListResultPage) Values() []VirtualMachine { - if page.vmlr.IsEmpty() { - return nil - } - return *page.vmlr.Value -} - -// Creates a new instance of the VirtualMachineListResultPage type. -func NewVirtualMachineListResultPage(cur VirtualMachineListResult, getNextPage func(context.Context, VirtualMachineListResult) (VirtualMachineListResult, error)) VirtualMachineListResultPage { - return VirtualMachineListResultPage{ - fn: getNextPage, - vmlr: cur, - } -} - -// VirtualMachineProperties describes the properties of a Virtual Machine. -type VirtualMachineProperties struct { - // HardwareProfile - Specifies the hardware settings for the virtual machine. - HardwareProfile *HardwareProfile `json:"hardwareProfile,omitempty"` - // StorageProfile - Specifies the storage settings for the virtual machine disks. - StorageProfile *StorageProfile `json:"storageProfile,omitempty"` - // AdditionalCapabilities - Specifies additional capabilities enabled or disabled on the virtual machine. - AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` - // OsProfile - Specifies the operating system settings used while creating the virtual machine. Some of the settings cannot be changed once VM is provisioned. - OsProfile *OSProfile `json:"osProfile,omitempty"` - // NetworkProfile - Specifies the network interfaces of the virtual machine. - NetworkProfile *NetworkProfile `json:"networkProfile,omitempty"` - // DiagnosticsProfile - Specifies the boot diagnostic settings state.

      Minimum api-version: 2015-06-15. - DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` - // 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 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 maintenance, 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. The availability set to which the VM is being added should be under the same resource group as the availability set resource. An existing VM cannot be added to an availability set.

      This property cannot exist along with a non-null properties.virtualMachineScaleSet reference. - AvailabilitySet *SubResource `json:"availabilitySet,omitempty"` - // VirtualMachineScaleSet - Specifies information about the virtual machine scale set that the virtual machine should be assigned to. Virtual machines specified in the same virtual machine scale set are allocated to different nodes to maximize availability. Currently, a VM can only be added to virtual machine scale set at creation time. An existing VM cannot be added to a virtual machine scale set.

      This property cannot exist along with a non-null properties.availabilitySet reference.

      Minimum api‐version: 2019‐03‐01 - VirtualMachineScaleSet *SubResource `json:"virtualMachineScaleSet,omitempty"` - // ProximityPlacementGroup - Specifies information about the proximity placement group that the virtual machine should be assigned to.

      Minimum api-version: 2018-04-01. - ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` - // Priority - Specifies the priority for the virtual machine.

      Minimum api-version: 2019-03-01. Possible values include: 'Regular', 'Low', 'Spot' - Priority VirtualMachinePriorityTypes `json:"priority,omitempty"` - // EvictionPolicy - Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot scale set.

      For Azure Spot virtual machines, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2019-03-01.

      For Azure Spot scale sets, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2017-10-30-preview. Possible values include: 'Deallocate', 'Delete' - EvictionPolicy VirtualMachineEvictionPolicyTypes `json:"evictionPolicy,omitempty"` - // BillingProfile - Specifies the billing related details of a Azure Spot virtual machine.

      Minimum api-version: 2019-03-01. - BillingProfile *BillingProfile `json:"billingProfile,omitempty"` - // Host - Specifies information about the dedicated host that the virtual machine resides in.

      Minimum api-version: 2018-10-01. - Host *SubResource `json:"host,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *string `json:"provisioningState,omitempty"` - // InstanceView - READ-ONLY; The virtual machine instance view. - InstanceView *VirtualMachineInstanceView `json:"instanceView,omitempty"` - // LicenseType - Specifies that the image or disk that is being used was licensed on-premises. This element is only used for images that contain the Windows Server operating system.

      Possible values are:

      Windows_Client

      Windows_Server

      If this element is included in a request for an update, the value must match the initial value. This value cannot be updated.

      For more information, see [Azure Hybrid Use Benefit for Windows Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json)

      Minimum api-version: 2015-06-15 - LicenseType *string `json:"licenseType,omitempty"` - // VMID - READ-ONLY; Specifies the VM unique ID which is a 128-bits identifier that is encoded and stored in all Azure IaaS VMs SMBIOS and can be read using platform BIOS commands. - VMID *string `json:"vmId,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineProperties. -func (vmp VirtualMachineProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmp.HardwareProfile != nil { - objectMap["hardwareProfile"] = vmp.HardwareProfile - } - if vmp.StorageProfile != nil { - objectMap["storageProfile"] = vmp.StorageProfile - } - if vmp.AdditionalCapabilities != nil { - objectMap["additionalCapabilities"] = vmp.AdditionalCapabilities - } - if vmp.OsProfile != nil { - objectMap["osProfile"] = vmp.OsProfile - } - if vmp.NetworkProfile != nil { - objectMap["networkProfile"] = vmp.NetworkProfile - } - if vmp.DiagnosticsProfile != nil { - objectMap["diagnosticsProfile"] = vmp.DiagnosticsProfile - } - if vmp.AvailabilitySet != nil { - objectMap["availabilitySet"] = vmp.AvailabilitySet - } - if vmp.VirtualMachineScaleSet != nil { - objectMap["virtualMachineScaleSet"] = vmp.VirtualMachineScaleSet - } - if vmp.ProximityPlacementGroup != nil { - objectMap["proximityPlacementGroup"] = vmp.ProximityPlacementGroup - } - if vmp.Priority != "" { - objectMap["priority"] = vmp.Priority - } - if vmp.EvictionPolicy != "" { - objectMap["evictionPolicy"] = vmp.EvictionPolicy - } - if vmp.BillingProfile != nil { - objectMap["billingProfile"] = vmp.BillingProfile - } - if vmp.Host != nil { - objectMap["host"] = vmp.Host - } - if vmp.LicenseType != nil { - objectMap["licenseType"] = vmp.LicenseType - } - return json.Marshal(objectMap) -} - -// VirtualMachineReimageParameters parameters for Reimaging Virtual Machine. NOTE: Virtual Machine OS disk -// will always be reimaged -type VirtualMachineReimageParameters struct { - // TempDisk - Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage parameter is only supported for VM/VMSS with Ephemeral OS disk. - TempDisk *bool `json:"tempDisk,omitempty"` -} - -// VirtualMachineScaleSet describes a Virtual Machine Scale Set. -type VirtualMachineScaleSet struct { - autorest.Response `json:"-"` - // 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**. - Plan *Plan `json:"plan,omitempty"` - *VirtualMachineScaleSetProperties `json:"properties,omitempty"` - // Identity - The identity of the virtual machine scale set, if configured. - Identity *VirtualMachineScaleSetIdentity `json:"identity,omitempty"` - // Zones - The virtual machine scale set zones. NOTE: Availability zones can only be set when you create the scale set - Zones *[]string `json:"zones,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; 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.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. -type VirtualMachineScaleSetDataDisk struct { - // Name - The disk name. - Name *string `json:"name,omitempty"` - // Lun - Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM. - Lun *int32 `json:"lun,omitempty"` - // Caching - Specifies the caching requirements.

      Possible values are:

      **None**

      **ReadOnly**

      **ReadWrite**

      Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' - Caching CachingTypes `json:"caching,omitempty"` - // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. - WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` - // CreateOption - The create option. Possible values include: 'DiskCreateOptionTypesFromImage', 'DiskCreateOptionTypesEmpty', 'DiskCreateOptionTypesAttach' - CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` - // DiskSizeGB - Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image.

      This value cannot be larger than 1023 GB - DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` - // ManagedDisk - The managed disk parameters. - ManagedDisk *VirtualMachineScaleSetManagedDiskParameters `json:"managedDisk,omitempty"` - // DiskIOPSReadWrite - Specifies the Read-Write IOPS for the managed disk. Should be used only when StorageAccountType is UltraSSD_LRS. If not specified, a default value would be assigned based on diskSizeGB. - DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` - // DiskMBpsReadWrite - Specifies the bandwidth in MB per second for the managed disk. Should be used only when StorageAccountType is UltraSSD_LRS. If not specified, a default value would be assigned based on diskSizeGB. - DiskMBpsReadWrite *int64 `json:"diskMBpsReadWrite,omitempty"` -} - -// VirtualMachineScaleSetExtension describes a Virtual Machine Scale Set Extension. -type VirtualMachineScaleSetExtension struct { - autorest.Response `json:"-"` - // Name - The name of the extension. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - *VirtualMachineScaleSetExtensionProperties `json:"properties,omitempty"` - // ID - READ-ONLY; 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 - } - 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 "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vmsse.Type = &typeVar - } - 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. -type VirtualMachineScaleSetExtensionListResult struct { - autorest.Response `json:"-"` - // Value - The list of VM scale set extensions. - Value *[]VirtualMachineScaleSetExtension `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of VM scale set extensions. Call ListNext() with this to fetch the next page of VM scale set extensions. - NextLink *string `json:"nextLink,omitempty"` -} - -// VirtualMachineScaleSetExtensionListResultIterator provides access to a complete listing of -// VirtualMachineScaleSetExtension values. -type VirtualMachineScaleSetExtensionListResultIterator struct { - i int - page VirtualMachineScaleSetExtensionListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *VirtualMachineScaleSetExtensionListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *VirtualMachineScaleSetExtensionListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter VirtualMachineScaleSetExtensionListResultIterator) 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 VirtualMachineScaleSetExtensionListResultIterator) Response() VirtualMachineScaleSetExtensionListResult { - 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 VirtualMachineScaleSetExtensionListResultIterator) Value() VirtualMachineScaleSetExtension { - if !iter.page.NotDone() { - return VirtualMachineScaleSetExtension{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the VirtualMachineScaleSetExtensionListResultIterator type. -func NewVirtualMachineScaleSetExtensionListResultIterator(page VirtualMachineScaleSetExtensionListResultPage) VirtualMachineScaleSetExtensionListResultIterator { - return VirtualMachineScaleSetExtensionListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (vmsselr VirtualMachineScaleSetExtensionListResult) IsEmpty() bool { - return vmsselr.Value == nil || len(*vmsselr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (vmsselr VirtualMachineScaleSetExtensionListResult) hasNextLink() bool { - return vmsselr.NextLink != nil && len(*vmsselr.NextLink) != 0 -} - -// virtualMachineScaleSetExtensionListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (vmsselr VirtualMachineScaleSetExtensionListResult) virtualMachineScaleSetExtensionListResultPreparer(ctx context.Context) (*http.Request, error) { - if !vmsselr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(vmsselr.NextLink))) -} - -// VirtualMachineScaleSetExtensionListResultPage contains a page of VirtualMachineScaleSetExtension values. -type VirtualMachineScaleSetExtensionListResultPage struct { - fn func(context.Context, VirtualMachineScaleSetExtensionListResult) (VirtualMachineScaleSetExtensionListResult, error) - vmsselr VirtualMachineScaleSetExtensionListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *VirtualMachineScaleSetExtensionListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.vmsselr) - if err != nil { - return err - } - page.vmsselr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *VirtualMachineScaleSetExtensionListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page VirtualMachineScaleSetExtensionListResultPage) NotDone() bool { - return !page.vmsselr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page VirtualMachineScaleSetExtensionListResultPage) Response() VirtualMachineScaleSetExtensionListResult { - return page.vmsselr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page VirtualMachineScaleSetExtensionListResultPage) Values() []VirtualMachineScaleSetExtension { - if page.vmsselr.IsEmpty() { - return nil - } - return *page.vmsselr.Value -} - -// Creates a new instance of the VirtualMachineScaleSetExtensionListResultPage type. -func NewVirtualMachineScaleSetExtensionListResultPage(cur VirtualMachineScaleSetExtensionListResult, getNextPage func(context.Context, VirtualMachineScaleSetExtensionListResult) (VirtualMachineScaleSetExtensionListResult, error)) VirtualMachineScaleSetExtensionListResultPage { - return VirtualMachineScaleSetExtensionListResultPage{ - fn: getNextPage, - vmsselr: cur, - } -} - -// VirtualMachineScaleSetExtensionProfile describes a virtual machine scale set extension profile. -type VirtualMachineScaleSetExtensionProfile struct { - // Extensions - The virtual machine scale set child extension resources. - Extensions *[]VirtualMachineScaleSetExtension `json:"extensions,omitempty"` -} - -// VirtualMachineScaleSetExtensionProperties describes the properties of a Virtual Machine Scale Set -// Extension. -type VirtualMachineScaleSetExtensionProperties struct { - // ForceUpdateTag - If a value is provided and is different from the previous value, the extension handler will be forced to update even if the extension configuration has not changed. - ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` - // Publisher - The name of the extension handler publisher. - Publisher *string `json:"publisher,omitempty"` - // Type - Specifies the type of the extension; an example is "CustomScriptExtension". - Type *string `json:"type,omitempty"` - // TypeHandlerVersion - Specifies the version of the script handler. - TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` - // 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 interface{} `json:"settings,omitempty"` - // ProtectedSettings - The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. - ProtectedSettings interface{} `json:"protectedSettings,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *string `json:"provisioningState,omitempty"` - // ProvisionAfterExtensions - Collection of extension names after which this extension needs to be provisioned. - ProvisionAfterExtensions *[]string `json:"provisionAfterExtensions,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetExtensionProperties. -func (vmssep VirtualMachineScaleSetExtensionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmssep.ForceUpdateTag != nil { - objectMap["forceUpdateTag"] = vmssep.ForceUpdateTag - } - if vmssep.Publisher != nil { - objectMap["publisher"] = vmssep.Publisher - } - if vmssep.Type != nil { - objectMap["type"] = vmssep.Type - } - if vmssep.TypeHandlerVersion != nil { - objectMap["typeHandlerVersion"] = vmssep.TypeHandlerVersion - } - if vmssep.AutoUpgradeMinorVersion != nil { - objectMap["autoUpgradeMinorVersion"] = vmssep.AutoUpgradeMinorVersion - } - if vmssep.Settings != nil { - objectMap["settings"] = vmssep.Settings - } - if vmssep.ProtectedSettings != nil { - objectMap["protectedSettings"] = vmssep.ProtectedSettings - } - if vmssep.ProvisionAfterExtensions != nil { - objectMap["provisionAfterExtensions"] = vmssep.ProvisionAfterExtensions - } - return json.Marshal(objectMap) -} - -// VirtualMachineScaleSetExtensionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type VirtualMachineScaleSetExtensionsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetExtensionsClient) (VirtualMachineScaleSetExtension, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetExtensionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetExtensionsCreateOrUpdateFuture.Result. -func (future *VirtualMachineScaleSetExtensionsCreateOrUpdateFuture) result(client VirtualMachineScaleSetExtensionsClient) (vmsse VirtualMachineScaleSetExtension, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vmsse.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetExtensionsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vmsse.Response.Response, err = future.GetResult(sender); err == nil && vmsse.Response.Response.StatusCode != http.StatusNoContent { - vmsse, err = client.CreateOrUpdateResponder(vmsse.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsCreateOrUpdateFuture", "Result", vmsse.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachineScaleSetExtensionsDeleteFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. -type VirtualMachineScaleSetExtensionsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetExtensionsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetExtensionsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetExtensionsDeleteFuture.Result. -func (future *VirtualMachineScaleSetExtensionsDeleteFuture) result(client VirtualMachineScaleSetExtensionsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetExtensionsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetExtensionsUpdateFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. -type VirtualMachineScaleSetExtensionsUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetExtensionsClient) (VirtualMachineScaleSetExtension, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetExtensionsUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetExtensionsUpdateFuture.Result. -func (future *VirtualMachineScaleSetExtensionsUpdateFuture) result(client VirtualMachineScaleSetExtensionsClient) (vmsse VirtualMachineScaleSetExtension, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vmsse.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetExtensionsUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vmsse.Response.Response, err = future.GetResult(sender); err == nil && vmsse.Response.Response.StatusCode != http.StatusNoContent { - vmsse, err = client.UpdateResponder(vmsse.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsUpdateFuture", "Result", vmsse.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachineScaleSetExtensionUpdate describes a Virtual Machine Scale Set Extension. -type VirtualMachineScaleSetExtensionUpdate struct { - // Name - READ-ONLY; The name of the extension. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - *VirtualMachineScaleSetExtensionProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetExtensionUpdate. -func (vmsseu VirtualMachineScaleSetExtensionUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmsseu.VirtualMachineScaleSetExtensionProperties != nil { - objectMap["properties"] = vmsseu.VirtualMachineScaleSetExtensionProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetExtensionUpdate struct. -func (vmsseu *VirtualMachineScaleSetExtensionUpdate) 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 - } - vmsseu.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vmsseu.Type = &typeVar - } - case "properties": - if v != nil { - var virtualMachineScaleSetExtensionProperties VirtualMachineScaleSetExtensionProperties - err = json.Unmarshal(*v, &virtualMachineScaleSetExtensionProperties) - if err != nil { - return err - } - vmsseu.VirtualMachineScaleSetExtensionProperties = &virtualMachineScaleSetExtensionProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vmsseu.ID = &ID - } - } - } - - return nil -} - -// VirtualMachineScaleSetIdentity identity for the virtual machine scale set. -type VirtualMachineScaleSetIdentity struct { - // PrincipalID - READ-ONLY; The principal id of virtual machine scale set identity. This property will only be provided for a system assigned identity. - PrincipalID *string `json:"principalId,omitempty"` - // TenantID - READ-ONLY; The tenant id associated with the virtual machine scale set. This property will only be provided for a system assigned identity. - TenantID *string `json:"tenantId,omitempty"` - // Type - The type of identity used for the virtual machine scale set. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the virtual machine scale set. Possible values include: 'ResourceIdentityTypeSystemAssigned', 'ResourceIdentityTypeUserAssigned', 'ResourceIdentityTypeSystemAssignedUserAssigned', 'ResourceIdentityTypeNone' - Type ResourceIdentityType `json:"type,omitempty"` - // UserAssignedIdentities - The list of user identities associated with the virtual machine scale set. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - UserAssignedIdentities map[string]*VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue `json:"userAssignedIdentities"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetIdentity. -func (vmssi VirtualMachineScaleSetIdentity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmssi.Type != "" { - objectMap["type"] = vmssi.Type - } - if vmssi.UserAssignedIdentities != nil { - objectMap["userAssignedIdentities"] = vmssi.UserAssignedIdentities - } - return json.Marshal(objectMap) -} - -// VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue ... -type VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue struct { - // PrincipalID - READ-ONLY; The principal id of user assigned identity. - PrincipalID *string `json:"principalId,omitempty"` - // ClientID - READ-ONLY; The client id of user assigned identity. - ClientID *string `json:"clientId,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue. -func (vmssiAiv VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// VirtualMachineScaleSetInstanceView the instance view of a virtual machine scale set. -type VirtualMachineScaleSetInstanceView struct { - autorest.Response `json:"-"` - // VirtualMachine - READ-ONLY; The instance view status summary for the virtual machine scale set. - VirtualMachine *VirtualMachineScaleSetInstanceViewStatusesSummary `json:"virtualMachine,omitempty"` - // Extensions - READ-ONLY; The extensions information. - Extensions *[]VirtualMachineScaleSetVMExtensionsSummary `json:"extensions,omitempty"` - // Statuses - The resource status information. - Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` - // OrchestrationServices - READ-ONLY; The orchestration services information. - OrchestrationServices *[]OrchestrationServiceSummary `json:"orchestrationServices,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetInstanceView. -func (vmssiv VirtualMachineScaleSetInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmssiv.Statuses != nil { - objectMap["statuses"] = vmssiv.Statuses - } - return json.Marshal(objectMap) -} - -// VirtualMachineScaleSetInstanceViewStatusesSummary instance view statuses summary for virtual machines of -// a virtual machine scale set. -type VirtualMachineScaleSetInstanceViewStatusesSummary struct { - // StatusesSummary - READ-ONLY; The extensions information. - StatusesSummary *[]VirtualMachineStatusCodeCount `json:"statusesSummary,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetInstanceViewStatusesSummary. -func (vmssivss VirtualMachineScaleSetInstanceViewStatusesSummary) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// VirtualMachineScaleSetIPConfiguration describes a virtual machine scale set network profile's IP -// configuration. -type VirtualMachineScaleSetIPConfiguration struct { - // 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 configuration properties. -type VirtualMachineScaleSetIPConfigurationProperties struct { - // Subnet - Specifies the identifier of the subnet. - Subnet *APIEntityReference `json:"subnet,omitempty"` - // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface. - Primary *bool `json:"primary,omitempty"` - // PublicIPAddressConfiguration - The publicIPAddressConfiguration. - PublicIPAddressConfiguration *VirtualMachineScaleSetPublicIPAddressConfiguration `json:"publicIPAddressConfiguration,omitempty"` - // PrivateIPAddressVersion - Available from Api-Version 2017-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6' - PrivateIPAddressVersion IPVersion `json:"privateIPAddressVersion,omitempty"` - // ApplicationGatewayBackendAddressPools - Specifies an array of references to backend address pools of application gateways. A scale set can reference backend address pools of multiple application gateways. Multiple scale sets cannot use the same application gateway. - ApplicationGatewayBackendAddressPools *[]SubResource `json:"applicationGatewayBackendAddressPools,omitempty"` - // ApplicationSecurityGroups - Specifies an array of references to application security group. - ApplicationSecurityGroups *[]SubResource `json:"applicationSecurityGroups,omitempty"` - // LoadBalancerBackendAddressPools - Specifies an array of references to backend address pools of load balancers. A scale set can reference backend address pools of one public and one internal load balancer. Multiple scale sets cannot use the same basic sku load balancer. - LoadBalancerBackendAddressPools *[]SubResource `json:"loadBalancerBackendAddressPools,omitempty"` - // LoadBalancerInboundNatPools - Specifies an array of references to inbound Nat pools of the load balancers. A scale set can reference inbound nat pools of one public and one internal load balancer. Multiple scale sets cannot use the same basic sku load balancer. - LoadBalancerInboundNatPools *[]SubResource `json:"loadBalancerInboundNatPools,omitempty"` -} - -// VirtualMachineScaleSetIPTag contains the IP tag associated with the public IP address. -type VirtualMachineScaleSetIPTag struct { - // IPTagType - IP tag type. Example: FirstPartyUsage. - IPTagType *string `json:"ipTagType,omitempty"` - // Tag - IP tag associated with the public IP. Example: SQL, Storage etc. - Tag *string `json:"tag,omitempty"` -} - -// VirtualMachineScaleSetListOSUpgradeHistory list of Virtual Machine Scale Set OS Upgrade History -// operation response. -type VirtualMachineScaleSetListOSUpgradeHistory struct { - autorest.Response `json:"-"` - // Value - The list of OS upgrades performed on the virtual machine scale set. - Value *[]UpgradeOperationHistoricalStatusInfo `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of OS Upgrade History. Call ListNext() with this to fetch the next page of history of upgrades. - NextLink *string `json:"nextLink,omitempty"` -} - -// VirtualMachineScaleSetListOSUpgradeHistoryIterator provides access to a complete listing of -// UpgradeOperationHistoricalStatusInfo values. -type VirtualMachineScaleSetListOSUpgradeHistoryIterator struct { - i int - page VirtualMachineScaleSetListOSUpgradeHistoryPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *VirtualMachineScaleSetListOSUpgradeHistoryIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListOSUpgradeHistoryIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *VirtualMachineScaleSetListOSUpgradeHistoryIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter VirtualMachineScaleSetListOSUpgradeHistoryIterator) 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 VirtualMachineScaleSetListOSUpgradeHistoryIterator) Response() VirtualMachineScaleSetListOSUpgradeHistory { - 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 VirtualMachineScaleSetListOSUpgradeHistoryIterator) Value() UpgradeOperationHistoricalStatusInfo { - if !iter.page.NotDone() { - return UpgradeOperationHistoricalStatusInfo{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the VirtualMachineScaleSetListOSUpgradeHistoryIterator type. -func NewVirtualMachineScaleSetListOSUpgradeHistoryIterator(page VirtualMachineScaleSetListOSUpgradeHistoryPage) VirtualMachineScaleSetListOSUpgradeHistoryIterator { - return VirtualMachineScaleSetListOSUpgradeHistoryIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (vmsslouh VirtualMachineScaleSetListOSUpgradeHistory) IsEmpty() bool { - return vmsslouh.Value == nil || len(*vmsslouh.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (vmsslouh VirtualMachineScaleSetListOSUpgradeHistory) hasNextLink() bool { - return vmsslouh.NextLink != nil && len(*vmsslouh.NextLink) != 0 -} - -// virtualMachineScaleSetListOSUpgradeHistoryPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (vmsslouh VirtualMachineScaleSetListOSUpgradeHistory) virtualMachineScaleSetListOSUpgradeHistoryPreparer(ctx context.Context) (*http.Request, error) { - if !vmsslouh.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(vmsslouh.NextLink))) -} - -// VirtualMachineScaleSetListOSUpgradeHistoryPage contains a page of UpgradeOperationHistoricalStatusInfo -// values. -type VirtualMachineScaleSetListOSUpgradeHistoryPage struct { - fn func(context.Context, VirtualMachineScaleSetListOSUpgradeHistory) (VirtualMachineScaleSetListOSUpgradeHistory, error) - vmsslouh VirtualMachineScaleSetListOSUpgradeHistory -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *VirtualMachineScaleSetListOSUpgradeHistoryPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListOSUpgradeHistoryPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.vmsslouh) - if err != nil { - return err - } - page.vmsslouh = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *VirtualMachineScaleSetListOSUpgradeHistoryPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page VirtualMachineScaleSetListOSUpgradeHistoryPage) NotDone() bool { - return !page.vmsslouh.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page VirtualMachineScaleSetListOSUpgradeHistoryPage) Response() VirtualMachineScaleSetListOSUpgradeHistory { - return page.vmsslouh -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page VirtualMachineScaleSetListOSUpgradeHistoryPage) Values() []UpgradeOperationHistoricalStatusInfo { - if page.vmsslouh.IsEmpty() { - return nil - } - return *page.vmsslouh.Value -} - -// Creates a new instance of the VirtualMachineScaleSetListOSUpgradeHistoryPage type. -func NewVirtualMachineScaleSetListOSUpgradeHistoryPage(cur VirtualMachineScaleSetListOSUpgradeHistory, getNextPage func(context.Context, VirtualMachineScaleSetListOSUpgradeHistory) (VirtualMachineScaleSetListOSUpgradeHistory, error)) VirtualMachineScaleSetListOSUpgradeHistoryPage { - return VirtualMachineScaleSetListOSUpgradeHistoryPage{ - fn: getNextPage, - vmsslouh: cur, - } -} - -// VirtualMachineScaleSetListResult the List Virtual Machine operation response. -type VirtualMachineScaleSetListResult struct { - autorest.Response `json:"-"` - // Value - The list of virtual machine scale sets. - Value *[]VirtualMachineScaleSet `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of Virtual Machine Scale Sets. Call ListNext() with this to fetch the next page of VMSS. - NextLink *string `json:"nextLink,omitempty"` -} - -// VirtualMachineScaleSetListResultIterator provides access to a complete listing of VirtualMachineScaleSet -// values. -type VirtualMachineScaleSetListResultIterator struct { - i int - page VirtualMachineScaleSetListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *VirtualMachineScaleSetListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *VirtualMachineScaleSetListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter VirtualMachineScaleSetListResultIterator) 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 VirtualMachineScaleSetListResultIterator) Response() VirtualMachineScaleSetListResult { - 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 VirtualMachineScaleSetListResultIterator) Value() VirtualMachineScaleSet { - if !iter.page.NotDone() { - return VirtualMachineScaleSet{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the VirtualMachineScaleSetListResultIterator type. -func NewVirtualMachineScaleSetListResultIterator(page VirtualMachineScaleSetListResultPage) VirtualMachineScaleSetListResultIterator { - return VirtualMachineScaleSetListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (vmsslr VirtualMachineScaleSetListResult) IsEmpty() bool { - return vmsslr.Value == nil || len(*vmsslr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (vmsslr VirtualMachineScaleSetListResult) hasNextLink() bool { - return vmsslr.NextLink != nil && len(*vmsslr.NextLink) != 0 -} - -// virtualMachineScaleSetListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (vmsslr VirtualMachineScaleSetListResult) virtualMachineScaleSetListResultPreparer(ctx context.Context) (*http.Request, error) { - if !vmsslr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(vmsslr.NextLink))) -} - -// VirtualMachineScaleSetListResultPage contains a page of VirtualMachineScaleSet values. -type VirtualMachineScaleSetListResultPage struct { - fn func(context.Context, VirtualMachineScaleSetListResult) (VirtualMachineScaleSetListResult, error) - vmsslr VirtualMachineScaleSetListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *VirtualMachineScaleSetListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.vmsslr) - if err != nil { - return err - } - page.vmsslr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *VirtualMachineScaleSetListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page VirtualMachineScaleSetListResultPage) NotDone() bool { - return !page.vmsslr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page VirtualMachineScaleSetListResultPage) Response() VirtualMachineScaleSetListResult { - return page.vmsslr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page VirtualMachineScaleSetListResultPage) Values() []VirtualMachineScaleSet { - if page.vmsslr.IsEmpty() { - return nil - } - return *page.vmsslr.Value -} - -// Creates a new instance of the VirtualMachineScaleSetListResultPage type. -func NewVirtualMachineScaleSetListResultPage(cur VirtualMachineScaleSetListResult, getNextPage func(context.Context, VirtualMachineScaleSetListResult) (VirtualMachineScaleSetListResult, error)) VirtualMachineScaleSetListResultPage { - return VirtualMachineScaleSetListResultPage{ - fn: getNextPage, - vmsslr: cur, - } -} - -// VirtualMachineScaleSetListSkusResult the Virtual Machine Scale Set List Skus operation response. -type VirtualMachineScaleSetListSkusResult struct { - autorest.Response `json:"-"` - // Value - The list of skus available for the virtual machine scale set. - Value *[]VirtualMachineScaleSetSku `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of Virtual Machine Scale Set Skus. Call ListNext() with this to fetch the next page of VMSS Skus. - NextLink *string `json:"nextLink,omitempty"` -} - -// VirtualMachineScaleSetListSkusResultIterator provides access to a complete listing of -// VirtualMachineScaleSetSku values. -type VirtualMachineScaleSetListSkusResultIterator struct { - i int - page VirtualMachineScaleSetListSkusResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *VirtualMachineScaleSetListSkusResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListSkusResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *VirtualMachineScaleSetListSkusResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter VirtualMachineScaleSetListSkusResultIterator) 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 VirtualMachineScaleSetListSkusResultIterator) Response() VirtualMachineScaleSetListSkusResult { - 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 VirtualMachineScaleSetListSkusResultIterator) Value() VirtualMachineScaleSetSku { - if !iter.page.NotDone() { - return VirtualMachineScaleSetSku{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the VirtualMachineScaleSetListSkusResultIterator type. -func NewVirtualMachineScaleSetListSkusResultIterator(page VirtualMachineScaleSetListSkusResultPage) VirtualMachineScaleSetListSkusResultIterator { - return VirtualMachineScaleSetListSkusResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (vmsslsr VirtualMachineScaleSetListSkusResult) IsEmpty() bool { - return vmsslsr.Value == nil || len(*vmsslsr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (vmsslsr VirtualMachineScaleSetListSkusResult) hasNextLink() bool { - return vmsslsr.NextLink != nil && len(*vmsslsr.NextLink) != 0 -} - -// virtualMachineScaleSetListSkusResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (vmsslsr VirtualMachineScaleSetListSkusResult) virtualMachineScaleSetListSkusResultPreparer(ctx context.Context) (*http.Request, error) { - if !vmsslsr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(vmsslsr.NextLink))) -} - -// VirtualMachineScaleSetListSkusResultPage contains a page of VirtualMachineScaleSetSku values. -type VirtualMachineScaleSetListSkusResultPage struct { - fn func(context.Context, VirtualMachineScaleSetListSkusResult) (VirtualMachineScaleSetListSkusResult, error) - vmsslsr VirtualMachineScaleSetListSkusResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *VirtualMachineScaleSetListSkusResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListSkusResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.vmsslsr) - if err != nil { - return err - } - page.vmsslsr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *VirtualMachineScaleSetListSkusResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page VirtualMachineScaleSetListSkusResultPage) NotDone() bool { - return !page.vmsslsr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page VirtualMachineScaleSetListSkusResultPage) Response() VirtualMachineScaleSetListSkusResult { - return page.vmsslsr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page VirtualMachineScaleSetListSkusResultPage) Values() []VirtualMachineScaleSetSku { - if page.vmsslsr.IsEmpty() { - return nil - } - return *page.vmsslsr.Value -} - -// Creates a new instance of the VirtualMachineScaleSetListSkusResultPage type. -func NewVirtualMachineScaleSetListSkusResultPage(cur VirtualMachineScaleSetListSkusResult, getNextPage func(context.Context, VirtualMachineScaleSetListSkusResult) (VirtualMachineScaleSetListSkusResult, error)) VirtualMachineScaleSetListSkusResultPage { - return VirtualMachineScaleSetListSkusResultPage{ - fn: getNextPage, - vmsslsr: cur, - } -} - -// VirtualMachineScaleSetListWithLinkResult the List Virtual Machine operation response. -type VirtualMachineScaleSetListWithLinkResult struct { - autorest.Response `json:"-"` - // Value - The list of virtual machine scale sets. - Value *[]VirtualMachineScaleSet `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of Virtual Machine Scale Sets. Call ListNext() with this to fetch the next page of Virtual Machine Scale Sets. - NextLink *string `json:"nextLink,omitempty"` -} - -// VirtualMachineScaleSetListWithLinkResultIterator provides access to a complete listing of -// VirtualMachineScaleSet values. -type VirtualMachineScaleSetListWithLinkResultIterator struct { - i int - page VirtualMachineScaleSetListWithLinkResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *VirtualMachineScaleSetListWithLinkResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListWithLinkResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *VirtualMachineScaleSetListWithLinkResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter VirtualMachineScaleSetListWithLinkResultIterator) 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 VirtualMachineScaleSetListWithLinkResultIterator) Response() VirtualMachineScaleSetListWithLinkResult { - 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 VirtualMachineScaleSetListWithLinkResultIterator) Value() VirtualMachineScaleSet { - if !iter.page.NotDone() { - return VirtualMachineScaleSet{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the VirtualMachineScaleSetListWithLinkResultIterator type. -func NewVirtualMachineScaleSetListWithLinkResultIterator(page VirtualMachineScaleSetListWithLinkResultPage) VirtualMachineScaleSetListWithLinkResultIterator { - return VirtualMachineScaleSetListWithLinkResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (vmsslwlr VirtualMachineScaleSetListWithLinkResult) IsEmpty() bool { - return vmsslwlr.Value == nil || len(*vmsslwlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (vmsslwlr VirtualMachineScaleSetListWithLinkResult) hasNextLink() bool { - return vmsslwlr.NextLink != nil && len(*vmsslwlr.NextLink) != 0 -} - -// virtualMachineScaleSetListWithLinkResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (vmsslwlr VirtualMachineScaleSetListWithLinkResult) virtualMachineScaleSetListWithLinkResultPreparer(ctx context.Context) (*http.Request, error) { - if !vmsslwlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(vmsslwlr.NextLink))) -} - -// VirtualMachineScaleSetListWithLinkResultPage contains a page of VirtualMachineScaleSet values. -type VirtualMachineScaleSetListWithLinkResultPage struct { - fn func(context.Context, VirtualMachineScaleSetListWithLinkResult) (VirtualMachineScaleSetListWithLinkResult, error) - vmsslwlr VirtualMachineScaleSetListWithLinkResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *VirtualMachineScaleSetListWithLinkResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListWithLinkResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.vmsslwlr) - if err != nil { - return err - } - page.vmsslwlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *VirtualMachineScaleSetListWithLinkResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page VirtualMachineScaleSetListWithLinkResultPage) NotDone() bool { - return !page.vmsslwlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page VirtualMachineScaleSetListWithLinkResultPage) Response() VirtualMachineScaleSetListWithLinkResult { - return page.vmsslwlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page VirtualMachineScaleSetListWithLinkResultPage) Values() []VirtualMachineScaleSet { - if page.vmsslwlr.IsEmpty() { - return nil - } - return *page.vmsslwlr.Value -} - -// Creates a new instance of the VirtualMachineScaleSetListWithLinkResultPage type. -func NewVirtualMachineScaleSetListWithLinkResultPage(cur VirtualMachineScaleSetListWithLinkResult, getNextPage func(context.Context, VirtualMachineScaleSetListWithLinkResult) (VirtualMachineScaleSetListWithLinkResult, error)) VirtualMachineScaleSetListWithLinkResultPage { - return VirtualMachineScaleSetListWithLinkResultPage{ - fn: getNextPage, - vmsslwlr: cur, - } -} - -// VirtualMachineScaleSetManagedDiskParameters describes the parameters of a ScaleSet managed disk. -type VirtualMachineScaleSetManagedDiskParameters struct { - // StorageAccountType - Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot be used with OS Disk. Possible values include: 'StorageAccountTypesStandardLRS', 'StorageAccountTypesPremiumLRS', 'StorageAccountTypesStandardSSDLRS', 'StorageAccountTypesUltraSSDLRS' - StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` - // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed disk. - DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` -} - -// VirtualMachineScaleSetNetworkConfiguration describes a virtual machine scale set network profile's -// network configurations. -type VirtualMachineScaleSetNetworkConfiguration struct { - // 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 -// configuration's DNS settings. -type VirtualMachineScaleSetNetworkConfigurationDNSSettings struct { - // DNSServers - List of DNS servers IP addresses - DNSServers *[]string `json:"dnsServers,omitempty"` -} - -// VirtualMachineScaleSetNetworkConfigurationProperties describes a virtual machine scale set network -// profile's IP configuration. -type VirtualMachineScaleSetNetworkConfigurationProperties struct { - // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface. - Primary *bool `json:"primary,omitempty"` - // EnableAcceleratedNetworking - Specifies whether the network interface is accelerated networking-enabled. - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - // NetworkSecurityGroup - The network security group. - NetworkSecurityGroup *SubResource `json:"networkSecurityGroup,omitempty"` - // DNSSettings - The dns settings to be applied on the network interfaces. - DNSSettings *VirtualMachineScaleSetNetworkConfigurationDNSSettings `json:"dnsSettings,omitempty"` - // IPConfigurations - Specifies the IP configurations of the network interface. - IPConfigurations *[]VirtualMachineScaleSetIPConfiguration `json:"ipConfigurations,omitempty"` - // EnableIPForwarding - Whether IP forwarding enabled on this NIC. - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` -} - -// VirtualMachineScaleSetNetworkProfile describes a virtual machine scale set network profile. -type VirtualMachineScaleSetNetworkProfile struct { - // HealthProbe - A reference to a load balancer probe used to determine the health of an instance in the virtual machine scale set. The reference will be in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. - HealthProbe *APIEntityReference `json:"healthProbe,omitempty"` - // NetworkInterfaceConfigurations - The list of network configurations. - NetworkInterfaceConfigurations *[]VirtualMachineScaleSetNetworkConfiguration `json:"networkInterfaceConfigurations,omitempty"` -} - -// VirtualMachineScaleSetOSDisk describes a virtual machine scale set operating system disk. -type VirtualMachineScaleSetOSDisk struct { - // Name - The disk name. - Name *string `json:"name,omitempty"` - // Caching - Specifies the caching requirements.

      Possible values are:

      **None**

      **ReadOnly**

      **ReadWrite**

      Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' - Caching CachingTypes `json:"caching,omitempty"` - // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. - WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` - // CreateOption - Specifies how the virtual machines in the scale set should be created.

      The only allowed value is: **FromImage** \u2013 This value is used when you are using an image to create the virtual machine. If you are using a platform image, you also use the imageReference element described above. If you are using a marketplace image, you also use the plan element previously described. Possible values include: 'DiskCreateOptionTypesFromImage', 'DiskCreateOptionTypesEmpty', 'DiskCreateOptionTypesAttach' - CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` - // DiffDiskSettings - Specifies the ephemeral disk Settings for the operating system disk used by the virtual machine scale set. - DiffDiskSettings *DiffDiskSettings `json:"diffDiskSettings,omitempty"` - // DiskSizeGB - Specifies the size of the operating system disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image.

      This value cannot be larger than 1023 GB - DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` - // OsType - This property allows you to specify the type of the OS that is included in the disk if creating a VM from user-image or a specialized VHD.

      Possible values are:

      **Windows**

      **Linux**. Possible values include: 'Windows', 'Linux' - OsType OperatingSystemTypes `json:"osType,omitempty"` - // Image - Specifies information about the unmanaged user image to base the scale set on. - Image *VirtualHardDisk `json:"image,omitempty"` - // VhdContainers - Specifies the container urls that are used to store operating system disks for the scale set. - VhdContainers *[]string `json:"vhdContainers,omitempty"` - // ManagedDisk - The managed disk parameters. - ManagedDisk *VirtualMachineScaleSetManagedDiskParameters `json:"managedDisk,omitempty"` -} - -// VirtualMachineScaleSetOSProfile describes a virtual machine scale set OS profile. -type VirtualMachineScaleSetOSProfile struct { - // ComputerNamePrefix - Specifies the computer name prefix for all of the virtual machines in the scale set. Computer name prefixes must be 1 to 15 characters long. - ComputerNamePrefix *string `json:"computerNamePrefix,omitempty"` - // AdminUsername - Specifies the name of the administrator account.

      **Windows-only restriction:** Cannot end in "."

      **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5".

      **Minimum-length (Linux):** 1 character

      **Max-length (Linux):** 64 characters

      **Max-length (Windows):** 20 characters

    • For root access to the Linux VM, see [Using root privileges on Linux virtual machines in Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
    • For a list of built-in system users on Linux that should not be used in this field, see [Selecting User Names for Linux on Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) - AdminUsername *string `json:"adminUsername,omitempty"` - // AdminPassword - Specifies the password of the administrator account.

      **Minimum-length (Windows):** 8 characters

      **Minimum-length (Linux):** 6 characters

      **Max-length (Windows):** 123 characters

      **Max-length (Linux):** 72 characters

      **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled
      Has lower characters
      Has upper characters
      Has a digit
      Has a special character (Regex match [\W_])

      **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!"

      For resetting the password, see [How to reset the Remote Desktop service or its login password in a Windows VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json)

      For resetting root password, see [Manage users, SSH, and check or repair disks on Azure Linux VMs using the VMAccess Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) - AdminPassword *string `json:"adminPassword,omitempty"` - // CustomData - Specifies a base-64 encoded string of custom data. The base-64 encoded string is decoded to a binary array that is saved as a file on the Virtual Machine. The maximum length of the binary array is 65535 bytes.

      For using cloud-init for your VM, see [Using cloud-init to customize a Linux VM during creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) - CustomData *string `json:"customData,omitempty"` - // WindowsConfiguration - Specifies Windows operating system settings on the virtual machine. - WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"` - // LinuxConfiguration - Specifies the Linux operating system settings on the virtual machine.

      For a list of supported Linux distributions, see [Linux on Azure-Endorsed Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)

      For running non-endorsed distributions, see [Information for Non-Endorsed Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). - LinuxConfiguration *LinuxConfiguration `json:"linuxConfiguration,omitempty"` - // Secrets - Specifies set of certificates that should be installed onto the virtual machines in the scale set. - Secrets *[]VaultSecretGroup `json:"secrets,omitempty"` -} - -// VirtualMachineScaleSetProperties describes the properties of a Virtual Machine Scale Set. -type VirtualMachineScaleSetProperties struct { - // UpgradePolicy - The upgrade policy. - UpgradePolicy *UpgradePolicy `json:"upgradePolicy,omitempty"` - // AutomaticRepairsPolicy - Policy for automatic repairs. - AutomaticRepairsPolicy *AutomaticRepairsPolicy `json:"automaticRepairsPolicy,omitempty"` - // VirtualMachineProfile - The virtual machine profile. - VirtualMachineProfile *VirtualMachineScaleSetVMProfile `json:"virtualMachineProfile,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *string `json:"provisioningState,omitempty"` - // Overprovision - Specifies whether the Virtual Machine Scale Set should be overprovisioned. - Overprovision *bool `json:"overprovision,omitempty"` - // DoNotRunExtensionsOnOverprovisionedVMs - When Overprovision is enabled, extensions are launched only on the requested number of VMs which are finally kept. This property will hence ensure that the extensions do not run on the extra overprovisioned VMs. - DoNotRunExtensionsOnOverprovisionedVMs *bool `json:"doNotRunExtensionsOnOverprovisionedVMs,omitempty"` - // UniqueID - READ-ONLY; Specifies the ID which uniquely identifies a Virtual Machine Scale Set. - UniqueID *string `json:"uniqueId,omitempty"` - // SinglePlacementGroup - When true this limits the scale set to a single placement group, of max size 100 virtual machines. NOTE: If singlePlacementGroup is true, it may be modified to false. However, if singlePlacementGroup is false, it may not be modified to true. - SinglePlacementGroup *bool `json:"singlePlacementGroup,omitempty"` - // ZoneBalance - Whether to force strictly even Virtual Machine distribution cross x-zones in case there is zone outage. - ZoneBalance *bool `json:"zoneBalance,omitempty"` - // PlatformFaultDomainCount - Fault Domain count for each placement group. - PlatformFaultDomainCount *int32 `json:"platformFaultDomainCount,omitempty"` - // ProximityPlacementGroup - Specifies information about the proximity placement group that the virtual machine scale set should be assigned to.

      Minimum api-version: 2018-04-01. - ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` - // AdditionalCapabilities - Specifies additional capabilities enabled or disabled on the Virtual Machines in the Virtual Machine Scale Set. For instance: whether the Virtual Machines have the capability to support attaching managed data disks with UltraSSD_LRS storage account type. - AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` - // ScaleInPolicy - Specifies the scale-in policy that decides which virtual machines are chosen for removal when a Virtual Machine Scale Set is scaled-in. - ScaleInPolicy *ScaleInPolicy `json:"scaleInPolicy,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetProperties. -func (vmssp VirtualMachineScaleSetProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmssp.UpgradePolicy != nil { - objectMap["upgradePolicy"] = vmssp.UpgradePolicy - } - if vmssp.AutomaticRepairsPolicy != nil { - objectMap["automaticRepairsPolicy"] = vmssp.AutomaticRepairsPolicy - } - if vmssp.VirtualMachineProfile != nil { - objectMap["virtualMachineProfile"] = vmssp.VirtualMachineProfile - } - if vmssp.Overprovision != nil { - objectMap["overprovision"] = vmssp.Overprovision - } - if vmssp.DoNotRunExtensionsOnOverprovisionedVMs != nil { - objectMap["doNotRunExtensionsOnOverprovisionedVMs"] = vmssp.DoNotRunExtensionsOnOverprovisionedVMs - } - if vmssp.SinglePlacementGroup != nil { - objectMap["singlePlacementGroup"] = vmssp.SinglePlacementGroup - } - if vmssp.ZoneBalance != nil { - objectMap["zoneBalance"] = vmssp.ZoneBalance - } - if vmssp.PlatformFaultDomainCount != nil { - objectMap["platformFaultDomainCount"] = vmssp.PlatformFaultDomainCount - } - if vmssp.ProximityPlacementGroup != nil { - objectMap["proximityPlacementGroup"] = vmssp.ProximityPlacementGroup - } - if vmssp.AdditionalCapabilities != nil { - objectMap["additionalCapabilities"] = vmssp.AdditionalCapabilities - } - if vmssp.ScaleInPolicy != nil { - objectMap["scaleInPolicy"] = vmssp.ScaleInPolicy - } - return json.Marshal(objectMap) -} - -// VirtualMachineScaleSetPublicIPAddressConfiguration describes a virtual machines scale set IP -// Configuration's PublicIPAddress configuration -type VirtualMachineScaleSetPublicIPAddressConfiguration struct { - // Name - The publicIP address configuration name. - Name *string `json:"name,omitempty"` - *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 { - // DomainNameLabel - The Domain name label.The concatenation of the domain name label and vm index will be the domain name labels of the PublicIPAddress resources that will be created - DomainNameLabel *string `json:"domainNameLabel,omitempty"` -} - -// VirtualMachineScaleSetPublicIPAddressConfigurationProperties describes a virtual machines scale set IP -// Configuration's PublicIPAddress configuration -type VirtualMachineScaleSetPublicIPAddressConfigurationProperties struct { - // IdleTimeoutInMinutes - The idle timeout of the public IP address. - IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` - // DNSSettings - The dns settings to be applied on the publicIP addresses . - DNSSettings *VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings `json:"dnsSettings,omitempty"` - // IPTags - The list of IP tags associated with the public IP address. - IPTags *[]VirtualMachineScaleSetIPTag `json:"ipTags,omitempty"` - // PublicIPPrefix - The PublicIPPrefix from which to allocate publicIP addresses. - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - // PublicIPAddressVersion - Available from Api-Version 2019-07-01 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6' - PublicIPAddressVersion IPVersion `json:"publicIPAddressVersion,omitempty"` -} - -// VirtualMachineScaleSetReimageParameters describes a Virtual Machine Scale Set VM Reimage Parameters. -type VirtualMachineScaleSetReimageParameters struct { - // InstanceIds - The virtual machine scale set instance ids. Omitting the virtual machine scale set instance ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - InstanceIds *[]string `json:"instanceIds,omitempty"` - // TempDisk - Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage parameter is only supported for VM/VMSS with Ephemeral OS disk. - TempDisk *bool `json:"tempDisk,omitempty"` -} - -// VirtualMachineScaleSetRollingUpgradesCancelFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type VirtualMachineScaleSetRollingUpgradesCancelFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetRollingUpgradesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetRollingUpgradesCancelFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetRollingUpgradesCancelFuture.Result. -func (future *VirtualMachineScaleSetRollingUpgradesCancelFuture) result(client VirtualMachineScaleSetRollingUpgradesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesCancelFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetRollingUpgradesCancelFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture an abstraction for monitoring and -// retrieving the results of a long-running operation. -type VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetRollingUpgradesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture.Result. -func (future *VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture) result(client VirtualMachineScaleSetRollingUpgradesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture an abstraction for monitoring and retrieving -// the results of a long-running operation. -type VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetRollingUpgradesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture.Result. -func (future *VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture) result(client VirtualMachineScaleSetRollingUpgradesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. -type VirtualMachineScaleSetsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetsClient) (VirtualMachineScaleSet, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetsCreateOrUpdateFuture.Result. -func (future *VirtualMachineScaleSetsCreateOrUpdateFuture) result(client VirtualMachineScaleSetsClient) (vmss VirtualMachineScaleSet, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vmss.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vmss.Response.Response, err = future.GetResult(sender); err == nil && vmss.Response.Response.StatusCode != http.StatusNoContent { - vmss, err = client.CreateOrUpdateResponder(vmss.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsCreateOrUpdateFuture", "Result", vmss.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachineScaleSetsDeallocateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetsDeallocateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetsDeallocateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetsDeallocateFuture.Result. -func (future *VirtualMachineScaleSetsDeallocateFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsDeallocateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsDeallocateFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetsDeleteFuture.Result. -func (future *VirtualMachineScaleSetsDeleteFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetsDeleteInstancesFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. -type VirtualMachineScaleSetsDeleteInstancesFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetsDeleteInstancesFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetsDeleteInstancesFuture.Result. -func (future *VirtualMachineScaleSetsDeleteInstancesFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsDeleteInstancesFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsDeleteInstancesFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetSku describes an available virtual machine scale set sku. -type VirtualMachineScaleSetSku struct { - // ResourceType - READ-ONLY; The type of resource the sku applies to. - ResourceType *string `json:"resourceType,omitempty"` - // Sku - READ-ONLY; The Sku. - Sku *Sku `json:"sku,omitempty"` - // Capacity - READ-ONLY; Specifies the number of virtual machines in the scale set. - Capacity *VirtualMachineScaleSetSkuCapacity `json:"capacity,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetSku. -func (vmsss VirtualMachineScaleSetSku) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// VirtualMachineScaleSetSkuCapacity describes scaling information of a sku. -type VirtualMachineScaleSetSkuCapacity struct { - // Minimum - READ-ONLY; The minimum capacity. - Minimum *int64 `json:"minimum,omitempty"` - // Maximum - READ-ONLY; The maximum capacity that can be set. - Maximum *int64 `json:"maximum,omitempty"` - // DefaultCapacity - READ-ONLY; The default capacity. - DefaultCapacity *int64 `json:"defaultCapacity,omitempty"` - // ScaleType - READ-ONLY; The scale type applicable to the sku. Possible values include: 'VirtualMachineScaleSetSkuScaleTypeAutomatic', 'VirtualMachineScaleSetSkuScaleTypeNone' - ScaleType VirtualMachineScaleSetSkuScaleType `json:"scaleType,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetSkuCapacity. -func (vmsssc VirtualMachineScaleSetSkuCapacity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// VirtualMachineScaleSetsPerformMaintenanceFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type VirtualMachineScaleSetsPerformMaintenanceFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetsPerformMaintenanceFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetsPerformMaintenanceFuture.Result. -func (future *VirtualMachineScaleSetsPerformMaintenanceFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsPerformMaintenanceFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsPerformMaintenanceFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetsPowerOffFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetsPowerOffFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetsPowerOffFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetsPowerOffFuture.Result. -func (future *VirtualMachineScaleSetsPowerOffFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsPowerOffFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsPowerOffFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetsRedeployFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetsRedeployFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetsRedeployFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetsRedeployFuture.Result. -func (future *VirtualMachineScaleSetsRedeployFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsRedeployFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsRedeployFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetsReimageAllFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetsReimageAllFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetsReimageAllFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetsReimageAllFuture.Result. -func (future *VirtualMachineScaleSetsReimageAllFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsReimageAllFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsReimageAllFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetsReimageFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetsReimageFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetsReimageFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetsReimageFuture.Result. -func (future *VirtualMachineScaleSetsReimageFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsReimageFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsReimageFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetsRestartFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetsRestartFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetsRestartFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetsRestartFuture.Result. -func (future *VirtualMachineScaleSetsRestartFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsRestartFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsRestartFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetsSetOrchestrationServiceStateFuture an abstraction for monitoring and retrieving -// the results of a long-running operation. -type VirtualMachineScaleSetsSetOrchestrationServiceStateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetsSetOrchestrationServiceStateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetsSetOrchestrationServiceStateFuture.Result. -func (future *VirtualMachineScaleSetsSetOrchestrationServiceStateFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsSetOrchestrationServiceStateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsSetOrchestrationServiceStateFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetsStartFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetsStartFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetsStartFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetsStartFuture.Result. -func (future *VirtualMachineScaleSetsStartFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsStartFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsStartFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetStorageProfile describes a virtual machine scale set storage profile. -type VirtualMachineScaleSetStorageProfile struct { - // ImageReference - Specifies information about the image to use. You can specify information about platform images, 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. - ImageReference *ImageReference `json:"imageReference,omitempty"` - // OsDisk - Specifies information about the operating system disk used by the virtual machines in the scale set.

      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). - OsDisk *VirtualMachineScaleSetOSDisk `json:"osDisk,omitempty"` - // DataDisks - Specifies the parameters that are used to add data disks to the virtual machines in the scale set.

      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). - DataDisks *[]VirtualMachineScaleSetDataDisk `json:"dataDisks,omitempty"` -} - -// VirtualMachineScaleSetsUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetsUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetsClient) (VirtualMachineScaleSet, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetsUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetsUpdateFuture.Result. -func (future *VirtualMachineScaleSetsUpdateFuture) result(client VirtualMachineScaleSetsClient) (vmss VirtualMachineScaleSet, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vmss.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vmss.Response.Response, err = future.GetResult(sender); err == nil && vmss.Response.Response.StatusCode != http.StatusNoContent { - vmss, err = client.UpdateResponder(vmss.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsUpdateFuture", "Result", vmss.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachineScaleSetsUpdateInstancesFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. -type VirtualMachineScaleSetsUpdateInstancesFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetsUpdateInstancesFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetsUpdateInstancesFuture.Result. -func (future *VirtualMachineScaleSetsUpdateInstancesFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsUpdateInstancesFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsUpdateInstancesFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetUpdate describes a Virtual Machine Scale Set. -type VirtualMachineScaleSetUpdate struct { - // 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. - Plan *Plan `json:"plan,omitempty"` - *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. NOTE: The subnet of a scale set may be modified as long as the original subnet and the -// new subnet are in the same virtual network -type VirtualMachineScaleSetUpdateIPConfiguration struct { - // 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 configuration properties. -type VirtualMachineScaleSetUpdateIPConfigurationProperties struct { - // Subnet - The subnet. - Subnet *APIEntityReference `json:"subnet,omitempty"` - // Primary - Specifies the primary IP Configuration in case the network interface has more than one IP Configuration. - Primary *bool `json:"primary,omitempty"` - // PublicIPAddressConfiguration - The publicIPAddressConfiguration. - PublicIPAddressConfiguration *VirtualMachineScaleSetUpdatePublicIPAddressConfiguration `json:"publicIPAddressConfiguration,omitempty"` - // PrivateIPAddressVersion - Available from Api-Version 2017-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6' - PrivateIPAddressVersion IPVersion `json:"privateIPAddressVersion,omitempty"` - // ApplicationGatewayBackendAddressPools - The application gateway backend address pools. - ApplicationGatewayBackendAddressPools *[]SubResource `json:"applicationGatewayBackendAddressPools,omitempty"` - // ApplicationSecurityGroups - Specifies an array of references to application security group. - ApplicationSecurityGroups *[]SubResource `json:"applicationSecurityGroups,omitempty"` - // LoadBalancerBackendAddressPools - The load balancer backend address pools. - LoadBalancerBackendAddressPools *[]SubResource `json:"loadBalancerBackendAddressPools,omitempty"` - // LoadBalancerInboundNatPools - The load balancer inbound nat pools. - LoadBalancerInboundNatPools *[]SubResource `json:"loadBalancerInboundNatPools,omitempty"` -} - -// VirtualMachineScaleSetUpdateNetworkConfiguration describes a virtual machine scale set network profile's -// network configurations. -type VirtualMachineScaleSetUpdateNetworkConfiguration struct { - // 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. -type VirtualMachineScaleSetUpdateNetworkConfigurationProperties struct { - // Primary - Whether this is a primary NIC on a virtual machine. - Primary *bool `json:"primary,omitempty"` - // EnableAcceleratedNetworking - Specifies whether the network interface is accelerated networking-enabled. - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - // NetworkSecurityGroup - The network security group. - NetworkSecurityGroup *SubResource `json:"networkSecurityGroup,omitempty"` - // DNSSettings - The dns settings to be applied on the network interfaces. - DNSSettings *VirtualMachineScaleSetNetworkConfigurationDNSSettings `json:"dnsSettings,omitempty"` - // IPConfigurations - The virtual machine scale set IP Configuration. - IPConfigurations *[]VirtualMachineScaleSetUpdateIPConfiguration `json:"ipConfigurations,omitempty"` - // EnableIPForwarding - Whether IP forwarding enabled on this NIC. - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` -} - -// VirtualMachineScaleSetUpdateNetworkProfile describes a virtual machine scale set network profile. -type VirtualMachineScaleSetUpdateNetworkProfile struct { - // HealthProbe - A reference to a load balancer probe used to determine the health of an instance in the virtual machine scale set. The reference will be in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. - HealthProbe *APIEntityReference `json:"healthProbe,omitempty"` - // NetworkInterfaceConfigurations - The list of network configurations. - NetworkInterfaceConfigurations *[]VirtualMachineScaleSetUpdateNetworkConfiguration `json:"networkInterfaceConfigurations,omitempty"` -} - -// VirtualMachineScaleSetUpdateOSDisk describes virtual machine scale set operating system disk Update -// Object. This should be used for Updating VMSS OS Disk. -type VirtualMachineScaleSetUpdateOSDisk struct { - // Caching - The caching type. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' - Caching CachingTypes `json:"caching,omitempty"` - // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. - WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` - // DiskSizeGB - Specifies the size of the operating system disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image.

      This value cannot be larger than 1023 GB - DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` - // Image - The Source User Image VirtualHardDisk. This VirtualHardDisk will be copied before using it to attach to the Virtual Machine. If SourceImage is provided, the destination VirtualHardDisk should not exist. - Image *VirtualHardDisk `json:"image,omitempty"` - // VhdContainers - The list of virtual hard disk container uris. - VhdContainers *[]string `json:"vhdContainers,omitempty"` - // ManagedDisk - The managed disk parameters. - ManagedDisk *VirtualMachineScaleSetManagedDiskParameters `json:"managedDisk,omitempty"` -} - -// VirtualMachineScaleSetUpdateOSProfile describes a virtual machine scale set OS profile. -type VirtualMachineScaleSetUpdateOSProfile struct { - // CustomData - A base-64 encoded string of custom data. - CustomData *string `json:"customData,omitempty"` - // WindowsConfiguration - The Windows Configuration of the OS profile. - WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"` - // LinuxConfiguration - The Linux Configuration of the OS profile. - LinuxConfiguration *LinuxConfiguration `json:"linuxConfiguration,omitempty"` - // Secrets - The List of certificates for addition to the VM. - Secrets *[]VaultSecretGroup `json:"secrets,omitempty"` -} - -// VirtualMachineScaleSetUpdateProperties describes the properties of a Virtual Machine Scale Set. -type VirtualMachineScaleSetUpdateProperties struct { - // UpgradePolicy - The upgrade policy. - UpgradePolicy *UpgradePolicy `json:"upgradePolicy,omitempty"` - // AutomaticRepairsPolicy - Policy for automatic repairs. - AutomaticRepairsPolicy *AutomaticRepairsPolicy `json:"automaticRepairsPolicy,omitempty"` - // VirtualMachineProfile - The virtual machine profile. - VirtualMachineProfile *VirtualMachineScaleSetUpdateVMProfile `json:"virtualMachineProfile,omitempty"` - // Overprovision - Specifies whether the Virtual Machine Scale Set should be overprovisioned. - Overprovision *bool `json:"overprovision,omitempty"` - // DoNotRunExtensionsOnOverprovisionedVMs - When Overprovision is enabled, extensions are launched only on the requested number of VMs which are finally kept. This property will hence ensure that the extensions do not run on the extra overprovisioned VMs. - DoNotRunExtensionsOnOverprovisionedVMs *bool `json:"doNotRunExtensionsOnOverprovisionedVMs,omitempty"` - // SinglePlacementGroup - When true this limits the scale set to a single placement group, of max size 100 virtual machines. NOTE: If singlePlacementGroup is true, it may be modified to false. However, if singlePlacementGroup is false, it may not be modified to true. - SinglePlacementGroup *bool `json:"singlePlacementGroup,omitempty"` - // AdditionalCapabilities - Specifies additional capabilities enabled or disabled on the Virtual Machines in the Virtual Machine Scale Set. For instance: whether the Virtual Machines have the capability to support attaching managed data disks with UltraSSD_LRS storage account type. - AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` - // ScaleInPolicy - Specifies the scale-in policy that decides which virtual machines are chosen for removal when a Virtual Machine Scale Set is scaled-in. - ScaleInPolicy *ScaleInPolicy `json:"scaleInPolicy,omitempty"` - // ProximityPlacementGroup - Specifies information about the proximity placement group that the virtual machine scale set should be assigned to.

      Minimum api-version: 2018-04-01. - ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` -} - -// 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 { - // IdleTimeoutInMinutes - The idle timeout of the public IP address. - IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` - // DNSSettings - The dns settings to be applied on the publicIP addresses . - DNSSettings *VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings `json:"dnsSettings,omitempty"` -} - -// VirtualMachineScaleSetUpdateStorageProfile describes a virtual machine scale set storage profile. -type VirtualMachineScaleSetUpdateStorageProfile struct { - // ImageReference - The image reference. - ImageReference *ImageReference `json:"imageReference,omitempty"` - // OsDisk - The OS disk. - OsDisk *VirtualMachineScaleSetUpdateOSDisk `json:"osDisk,omitempty"` - // DataDisks - The data disks. - DataDisks *[]VirtualMachineScaleSetDataDisk `json:"dataDisks,omitempty"` -} - -// VirtualMachineScaleSetUpdateVMProfile describes a virtual machine scale set virtual machine profile. -type VirtualMachineScaleSetUpdateVMProfile struct { - // OsProfile - The virtual machine scale set OS profile. - OsProfile *VirtualMachineScaleSetUpdateOSProfile `json:"osProfile,omitempty"` - // StorageProfile - The virtual machine scale set storage profile. - StorageProfile *VirtualMachineScaleSetUpdateStorageProfile `json:"storageProfile,omitempty"` - // NetworkProfile - The virtual machine scale set network profile. - NetworkProfile *VirtualMachineScaleSetUpdateNetworkProfile `json:"networkProfile,omitempty"` - // DiagnosticsProfile - The virtual machine scale set diagnostics profile. - DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` - // ExtensionProfile - The virtual machine scale set extension profile. - ExtensionProfile *VirtualMachineScaleSetExtensionProfile `json:"extensionProfile,omitempty"` - // LicenseType - The license type, which is for bring your own license scenario. - LicenseType *string `json:"licenseType,omitempty"` - // BillingProfile - Specifies the billing related details of a Azure Spot VMSS.

      Minimum api-version: 2019-03-01. - BillingProfile *BillingProfile `json:"billingProfile,omitempty"` - // ScheduledEventsProfile - Specifies Scheduled Event related configurations. - ScheduledEventsProfile *ScheduledEventsProfile `json:"scheduledEventsProfile,omitempty"` -} - -// VirtualMachineScaleSetVM describes a virtual machine scale set virtual machine. -type VirtualMachineScaleSetVM struct { - autorest.Response `json:"-"` - // InstanceID - READ-ONLY; The virtual machine instance ID. - InstanceID *string `json:"instanceId,omitempty"` - // Sku - READ-ONLY; The virtual machine SKU. - Sku *Sku `json:"sku,omitempty"` - *VirtualMachineScaleSetVMProperties `json:"properties,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"` - // Resources - READ-ONLY; The virtual machine child extension resources. - Resources *[]VirtualMachineExtension `json:"resources,omitempty"` - // Zones - READ-ONLY; The virtual machine zones. - Zones *[]string `json:"zones,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; 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 VirtualMachineScaleSetVM. -func (vmssv VirtualMachineScaleSetVM) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmssv.VirtualMachineScaleSetVMProperties != nil { - objectMap["properties"] = vmssv.VirtualMachineScaleSetVMProperties - } - if vmssv.Plan != nil { - objectMap["plan"] = vmssv.Plan - } - 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 "zones": - if v != nil { - var zones []string - err = json.Unmarshal(*v, &zones) - if err != nil { - return err - } - vmssv.Zones = &zones - } - 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 -} - -// VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetVMExtensionsClient) (VirtualMachineExtension, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture.Result. -func (future *VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture) result(client VirtualMachineScaleSetVMExtensionsClient) (vme VirtualMachineExtension, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vme.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vme.Response.Response, err = future.GetResult(sender); err == nil && vme.Response.Response.StatusCode != http.StatusNoContent { - vme, err = client.CreateOrUpdateResponder(vme.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture", "Result", vme.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachineScaleSetVMExtensionsDeleteFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type VirtualMachineScaleSetVMExtensionsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetVMExtensionsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetVMExtensionsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetVMExtensionsDeleteFuture.Result. -func (future *VirtualMachineScaleSetVMExtensionsDeleteFuture) result(client VirtualMachineScaleSetVMExtensionsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMExtensionsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetVMExtensionsSummary extensions summary for virtual machines of a virtual machine -// scale set. -type VirtualMachineScaleSetVMExtensionsSummary struct { - // Name - READ-ONLY; The extension name. - Name *string `json:"name,omitempty"` - // StatusesSummary - READ-ONLY; The extensions information. - StatusesSummary *[]VirtualMachineStatusCodeCount `json:"statusesSummary,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMExtensionsSummary. -func (vmssves VirtualMachineScaleSetVMExtensionsSummary) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// VirtualMachineScaleSetVMExtensionsUpdateFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type VirtualMachineScaleSetVMExtensionsUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetVMExtensionsClient) (VirtualMachineExtension, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetVMExtensionsUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetVMExtensionsUpdateFuture.Result. -func (future *VirtualMachineScaleSetVMExtensionsUpdateFuture) result(client VirtualMachineScaleSetVMExtensionsClient) (vme VirtualMachineExtension, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vme.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMExtensionsUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vme.Response.Response, err = future.GetResult(sender); err == nil && vme.Response.Response.StatusCode != http.StatusNoContent { - vme, err = client.UpdateResponder(vme.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsUpdateFuture", "Result", vme.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachineScaleSetVMInstanceIDs specifies a list of virtual machine instance IDs from the VM scale -// set. -type VirtualMachineScaleSetVMInstanceIDs struct { - // InstanceIds - The virtual machine scale set instance ids. Omitting the virtual machine scale set instance ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - InstanceIds *[]string `json:"instanceIds,omitempty"` -} - -// 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"` -} - -// VirtualMachineScaleSetVMInstanceView the instance view of a virtual machine scale set VM. -type VirtualMachineScaleSetVMInstanceView struct { - autorest.Response `json:"-"` - // PlatformUpdateDomain - The Update Domain count. - PlatformUpdateDomain *int32 `json:"platformUpdateDomain,omitempty"` - // PlatformFaultDomain - The Fault Domain count. - PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"` - // RdpThumbPrint - The Remote desktop certificate thumbprint. - RdpThumbPrint *string `json:"rdpThumbPrint,omitempty"` - // VMAgent - The VM Agent running on the virtual machine. - VMAgent *VirtualMachineAgentInstanceView `json:"vmAgent,omitempty"` - // MaintenanceRedeployStatus - The Maintenance Operation status on the virtual machine. - MaintenanceRedeployStatus *MaintenanceRedeployStatus `json:"maintenanceRedeployStatus,omitempty"` - // Disks - The disks information. - Disks *[]DiskInstanceView `json:"disks,omitempty"` - // Extensions - The extensions information. - Extensions *[]VirtualMachineExtensionInstanceView `json:"extensions,omitempty"` - // VMHealth - READ-ONLY; The health status for the VM. - VMHealth *VirtualMachineHealthStatus `json:"vmHealth,omitempty"` - // BootDiagnostics - Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to diagnose VM status.

      You can easily view the output of your console log.

      Azure also enables you to see a screenshot of the VM from the hypervisor. - BootDiagnostics *BootDiagnosticsInstanceView `json:"bootDiagnostics,omitempty"` - // Statuses - The resource status information. - Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` - // PlacementGroupID - The placement group in which the VM is running. If the VM is deallocated it will not have a placementGroupId. - PlacementGroupID *string `json:"placementGroupId,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMInstanceView. -func (vmssviv VirtualMachineScaleSetVMInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmssviv.PlatformUpdateDomain != nil { - objectMap["platformUpdateDomain"] = vmssviv.PlatformUpdateDomain - } - if vmssviv.PlatformFaultDomain != nil { - objectMap["platformFaultDomain"] = vmssviv.PlatformFaultDomain - } - if vmssviv.RdpThumbPrint != nil { - objectMap["rdpThumbPrint"] = vmssviv.RdpThumbPrint - } - if vmssviv.VMAgent != nil { - objectMap["vmAgent"] = vmssviv.VMAgent - } - if vmssviv.MaintenanceRedeployStatus != nil { - objectMap["maintenanceRedeployStatus"] = vmssviv.MaintenanceRedeployStatus - } - if vmssviv.Disks != nil { - objectMap["disks"] = vmssviv.Disks - } - if vmssviv.Extensions != nil { - objectMap["extensions"] = vmssviv.Extensions - } - if vmssviv.BootDiagnostics != nil { - objectMap["bootDiagnostics"] = vmssviv.BootDiagnostics - } - if vmssviv.Statuses != nil { - objectMap["statuses"] = vmssviv.Statuses - } - if vmssviv.PlacementGroupID != nil { - objectMap["placementGroupId"] = vmssviv.PlacementGroupID - } - return json.Marshal(objectMap) -} - -// VirtualMachineScaleSetVMListResult the List Virtual Machine Scale Set VMs operation response. -type VirtualMachineScaleSetVMListResult struct { - autorest.Response `json:"-"` - // Value - The list of virtual machine scale sets VMs. - Value *[]VirtualMachineScaleSetVM `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of Virtual Machine Scale Set VMs. Call ListNext() with this to fetch the next page of VMSS VMs - NextLink *string `json:"nextLink,omitempty"` -} - -// VirtualMachineScaleSetVMListResultIterator provides access to a complete listing of -// VirtualMachineScaleSetVM values. -type VirtualMachineScaleSetVMListResultIterator struct { - i int - page VirtualMachineScaleSetVMListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *VirtualMachineScaleSetVMListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *VirtualMachineScaleSetVMListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter VirtualMachineScaleSetVMListResultIterator) 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 VirtualMachineScaleSetVMListResultIterator) Response() VirtualMachineScaleSetVMListResult { - 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 VirtualMachineScaleSetVMListResultIterator) Value() VirtualMachineScaleSetVM { - if !iter.page.NotDone() { - return VirtualMachineScaleSetVM{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the VirtualMachineScaleSetVMListResultIterator type. -func NewVirtualMachineScaleSetVMListResultIterator(page VirtualMachineScaleSetVMListResultPage) VirtualMachineScaleSetVMListResultIterator { - return VirtualMachineScaleSetVMListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (vmssvlr VirtualMachineScaleSetVMListResult) IsEmpty() bool { - return vmssvlr.Value == nil || len(*vmssvlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (vmssvlr VirtualMachineScaleSetVMListResult) hasNextLink() bool { - return vmssvlr.NextLink != nil && len(*vmssvlr.NextLink) != 0 -} - -// virtualMachineScaleSetVMListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (vmssvlr VirtualMachineScaleSetVMListResult) virtualMachineScaleSetVMListResultPreparer(ctx context.Context) (*http.Request, error) { - if !vmssvlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(vmssvlr.NextLink))) -} - -// VirtualMachineScaleSetVMListResultPage contains a page of VirtualMachineScaleSetVM values. -type VirtualMachineScaleSetVMListResultPage struct { - fn func(context.Context, VirtualMachineScaleSetVMListResult) (VirtualMachineScaleSetVMListResult, error) - vmssvlr VirtualMachineScaleSetVMListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *VirtualMachineScaleSetVMListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.vmssvlr) - if err != nil { - return err - } - page.vmssvlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *VirtualMachineScaleSetVMListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page VirtualMachineScaleSetVMListResultPage) NotDone() bool { - return !page.vmssvlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page VirtualMachineScaleSetVMListResultPage) Response() VirtualMachineScaleSetVMListResult { - return page.vmssvlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page VirtualMachineScaleSetVMListResultPage) Values() []VirtualMachineScaleSetVM { - if page.vmssvlr.IsEmpty() { - return nil - } - return *page.vmssvlr.Value -} - -// Creates a new instance of the VirtualMachineScaleSetVMListResultPage type. -func NewVirtualMachineScaleSetVMListResultPage(cur VirtualMachineScaleSetVMListResult, getNextPage func(context.Context, VirtualMachineScaleSetVMListResult) (VirtualMachineScaleSetVMListResult, error)) VirtualMachineScaleSetVMListResultPage { - return VirtualMachineScaleSetVMListResultPage{ - fn: getNextPage, - vmssvlr: cur, - } -} - -// VirtualMachineScaleSetVMNetworkProfileConfiguration describes a virtual machine scale set VM network -// profile. -type VirtualMachineScaleSetVMNetworkProfileConfiguration struct { - // NetworkInterfaceConfigurations - The list of network configurations. - NetworkInterfaceConfigurations *[]VirtualMachineScaleSetNetworkConfiguration `json:"networkInterfaceConfigurations,omitempty"` -} - -// VirtualMachineScaleSetVMProfile describes a virtual machine scale set virtual machine profile. -type VirtualMachineScaleSetVMProfile struct { - // OsProfile - Specifies the operating system settings for the virtual machines in the scale set. - OsProfile *VirtualMachineScaleSetOSProfile `json:"osProfile,omitempty"` - // StorageProfile - Specifies the storage settings for the virtual machine disks. - StorageProfile *VirtualMachineScaleSetStorageProfile `json:"storageProfile,omitempty"` - // NetworkProfile - Specifies properties of the network interfaces of the virtual machines in the scale set. - NetworkProfile *VirtualMachineScaleSetNetworkProfile `json:"networkProfile,omitempty"` - // DiagnosticsProfile - Specifies the boot diagnostic settings state.

      Minimum api-version: 2015-06-15. - DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` - // ExtensionProfile - Specifies a collection of settings for extensions installed on virtual machines in the scale set. - ExtensionProfile *VirtualMachineScaleSetExtensionProfile `json:"extensionProfile,omitempty"` - // LicenseType - Specifies that the image or disk that is being used was licensed on-premises. This element is only used for images that contain the Windows Server operating system.

      Possible values are:

      Windows_Client

      Windows_Server

      If this element is included in a request for an update, the value must match the initial value. This value cannot be updated.

      For more information, see [Azure Hybrid Use Benefit for Windows Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json)

      Minimum api-version: 2015-06-15 - LicenseType *string `json:"licenseType,omitempty"` - // Priority - Specifies the priority for the virtual machines in the scale set.

      Minimum api-version: 2017-10-30-preview. Possible values include: 'Regular', 'Low', 'Spot' - Priority VirtualMachinePriorityTypes `json:"priority,omitempty"` - // EvictionPolicy - Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot scale set.

      For Azure Spot virtual machines, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2019-03-01.

      For Azure Spot scale sets, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2017-10-30-preview. Possible values include: 'Deallocate', 'Delete' - EvictionPolicy VirtualMachineEvictionPolicyTypes `json:"evictionPolicy,omitempty"` - // BillingProfile - Specifies the billing related details of a Azure Spot VMSS.

      Minimum api-version: 2019-03-01. - BillingProfile *BillingProfile `json:"billingProfile,omitempty"` - // ScheduledEventsProfile - Specifies Scheduled Event related configurations. - ScheduledEventsProfile *ScheduledEventsProfile `json:"scheduledEventsProfile,omitempty"` -} - -// VirtualMachineScaleSetVMProperties describes the properties of a virtual machine scale set virtual -// machine. -type VirtualMachineScaleSetVMProperties struct { - // LatestModelApplied - READ-ONLY; Specifies whether the latest model has been applied to the virtual machine. - LatestModelApplied *bool `json:"latestModelApplied,omitempty"` - // VMID - READ-ONLY; Azure VM unique ID. - VMID *string `json:"vmId,omitempty"` - // InstanceView - READ-ONLY; The virtual machine instance view. - InstanceView *VirtualMachineScaleSetVMInstanceView `json:"instanceView,omitempty"` - // HardwareProfile - Specifies the hardware settings for the virtual machine. - HardwareProfile *HardwareProfile `json:"hardwareProfile,omitempty"` - // StorageProfile - Specifies the storage settings for the virtual machine disks. - StorageProfile *StorageProfile `json:"storageProfile,omitempty"` - // AdditionalCapabilities - Specifies additional capabilities enabled or disabled on the virtual machine in the scale set. For instance: whether the virtual machine has the capability to support attaching managed data disks with UltraSSD_LRS storage account type. - AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` - // OsProfile - Specifies the operating system settings for the virtual machine. - OsProfile *OSProfile `json:"osProfile,omitempty"` - // NetworkProfile - Specifies the network interfaces of the virtual machine. - NetworkProfile *NetworkProfile `json:"networkProfile,omitempty"` - // NetworkProfileConfiguration - Specifies the network profile configuration of the virtual machine. - NetworkProfileConfiguration *VirtualMachineScaleSetVMNetworkProfileConfiguration `json:"networkProfileConfiguration,omitempty"` - // DiagnosticsProfile - Specifies the boot diagnostic settings state.

      Minimum api-version: 2015-06-15. - DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` - // 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 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 maintenance, 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. - AvailabilitySet *SubResource `json:"availabilitySet,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *string `json:"provisioningState,omitempty"` - // LicenseType - Specifies that the image or disk that is being used was licensed on-premises. This element is only used for images that contain the Windows Server operating system.

      Possible values are:

      Windows_Client

      Windows_Server

      If this element is included in a request for an update, the value must match the initial value. This value cannot be updated.

      For more information, see [Azure Hybrid Use Benefit for Windows Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json)

      Minimum api-version: 2015-06-15 - LicenseType *string `json:"licenseType,omitempty"` - // ModelDefinitionApplied - READ-ONLY; Specifies whether the model applied to the virtual machine is the model of the virtual machine scale set or the customized model for the virtual machine. - ModelDefinitionApplied *string `json:"modelDefinitionApplied,omitempty"` - // ProtectionPolicy - Specifies the protection policy of the virtual machine. - ProtectionPolicy *VirtualMachineScaleSetVMProtectionPolicy `json:"protectionPolicy,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMProperties. -func (vmssvp VirtualMachineScaleSetVMProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmssvp.HardwareProfile != nil { - objectMap["hardwareProfile"] = vmssvp.HardwareProfile - } - if vmssvp.StorageProfile != nil { - objectMap["storageProfile"] = vmssvp.StorageProfile - } - if vmssvp.AdditionalCapabilities != nil { - objectMap["additionalCapabilities"] = vmssvp.AdditionalCapabilities - } - if vmssvp.OsProfile != nil { - objectMap["osProfile"] = vmssvp.OsProfile - } - if vmssvp.NetworkProfile != nil { - objectMap["networkProfile"] = vmssvp.NetworkProfile - } - if vmssvp.NetworkProfileConfiguration != nil { - objectMap["networkProfileConfiguration"] = vmssvp.NetworkProfileConfiguration - } - if vmssvp.DiagnosticsProfile != nil { - objectMap["diagnosticsProfile"] = vmssvp.DiagnosticsProfile - } - if vmssvp.AvailabilitySet != nil { - objectMap["availabilitySet"] = vmssvp.AvailabilitySet - } - if vmssvp.LicenseType != nil { - objectMap["licenseType"] = vmssvp.LicenseType - } - if vmssvp.ProtectionPolicy != nil { - objectMap["protectionPolicy"] = vmssvp.ProtectionPolicy - } - return json.Marshal(objectMap) -} - -// VirtualMachineScaleSetVMProtectionPolicy the protection policy of a virtual machine scale set VM. -type VirtualMachineScaleSetVMProtectionPolicy struct { - // ProtectFromScaleIn - Indicates that the virtual machine scale set VM shouldn't be considered for deletion during a scale-in operation. - ProtectFromScaleIn *bool `json:"protectFromScaleIn,omitempty"` - // ProtectFromScaleSetActions - Indicates that model updates or actions (including scale-in) initiated on the virtual machine scale set should not be applied to the virtual machine scale set VM. - ProtectFromScaleSetActions *bool `json:"protectFromScaleSetActions,omitempty"` -} - -// VirtualMachineScaleSetVMReimageParameters describes a Virtual Machine Scale Set VM Reimage Parameters. -type VirtualMachineScaleSetVMReimageParameters struct { - // TempDisk - Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage parameter is only supported for VM/VMSS with Ephemeral OS disk. - TempDisk *bool `json:"tempDisk,omitempty"` -} - -// VirtualMachineScaleSetVMsDeallocateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetVMsDeallocateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetVMsDeallocateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetVMsDeallocateFuture.Result. -func (future *VirtualMachineScaleSetVMsDeallocateFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsDeallocateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsDeallocateFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetVMsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetVMsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetVMsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetVMsDeleteFuture.Result. -func (future *VirtualMachineScaleSetVMsDeleteFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetVMsPerformMaintenanceFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type VirtualMachineScaleSetVMsPerformMaintenanceFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetVMsPerformMaintenanceFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetVMsPerformMaintenanceFuture.Result. -func (future *VirtualMachineScaleSetVMsPerformMaintenanceFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsPerformMaintenanceFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsPerformMaintenanceFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetVMsPowerOffFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetVMsPowerOffFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetVMsPowerOffFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetVMsPowerOffFuture.Result. -func (future *VirtualMachineScaleSetVMsPowerOffFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsPowerOffFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsPowerOffFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetVMsRedeployFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetVMsRedeployFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetVMsRedeployFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetVMsRedeployFuture.Result. -func (future *VirtualMachineScaleSetVMsRedeployFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsRedeployFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsRedeployFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetVMsReimageAllFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetVMsReimageAllFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetVMsReimageAllFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetVMsReimageAllFuture.Result. -func (future *VirtualMachineScaleSetVMsReimageAllFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsReimageAllFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsReimageAllFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetVMsReimageFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetVMsReimageFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetVMsReimageFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetVMsReimageFuture.Result. -func (future *VirtualMachineScaleSetVMsReimageFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsReimageFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsReimageFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetVMsRestartFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetVMsRestartFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetVMsRestartFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetVMsRestartFuture.Result. -func (future *VirtualMachineScaleSetVMsRestartFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsRestartFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsRestartFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetVMsRunCommandFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetVMsRunCommandFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetVMsClient) (RunCommandResult, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetVMsRunCommandFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetVMsRunCommandFuture.Result. -func (future *VirtualMachineScaleSetVMsRunCommandFuture) result(client VirtualMachineScaleSetVMsClient) (rcr RunCommandResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsRunCommandFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - rcr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsRunCommandFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if rcr.Response.Response, err = future.GetResult(sender); err == nil && rcr.Response.Response.StatusCode != http.StatusNoContent { - rcr, err = client.RunCommandResponder(rcr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsRunCommandFuture", "Result", rcr.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachineScaleSetVMsStartFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetVMsStartFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetVMsStartFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetVMsStartFuture.Result. -func (future *VirtualMachineScaleSetVMsStartFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsStartFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsStartFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetVMsUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetVMsUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetVMsClient) (VirtualMachineScaleSetVM, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetVMsUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetVMsUpdateFuture.Result. -func (future *VirtualMachineScaleSetVMsUpdateFuture) result(client VirtualMachineScaleSetVMsClient) (vmssv VirtualMachineScaleSetVM, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vmssv.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vmssv.Response.Response, err = future.GetResult(sender); err == nil && vmssv.Response.Response.StatusCode != http.StatusNoContent { - vmssv, err = client.UpdateResponder(vmssv.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsUpdateFuture", "Result", vmssv.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachinesCaptureFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VirtualMachinesCaptureFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachinesClient) (VirtualMachineCaptureResult, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachinesCaptureFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachinesCaptureFuture.Result. -func (future *VirtualMachinesCaptureFuture) result(client VirtualMachinesClient) (vmcr VirtualMachineCaptureResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesCaptureFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vmcr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesCaptureFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vmcr.Response.Response, err = future.GetResult(sender); err == nil && vmcr.Response.Response.StatusCode != http.StatusNoContent { - vmcr, err = client.CaptureResponder(vmcr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesCaptureFuture", "Result", vmcr.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachinesConvertToManagedDisksFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachinesConvertToManagedDisksFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachinesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachinesConvertToManagedDisksFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachinesConvertToManagedDisksFuture.Result. -func (future *VirtualMachinesConvertToManagedDisksFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesConvertToManagedDisksFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesConvertToManagedDisksFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachinesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachinesCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachinesClient) (VirtualMachine, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachinesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachinesCreateOrUpdateFuture.Result. -func (future *VirtualMachinesCreateOrUpdateFuture) result(client VirtualMachinesClient) (VM VirtualMachine, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - VM.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if VM.Response.Response, err = future.GetResult(sender); err == nil && VM.Response.Response.StatusCode != http.StatusNoContent { - VM, err = client.CreateOrUpdateResponder(VM.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesCreateOrUpdateFuture", "Result", VM.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachinesDeallocateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachinesDeallocateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachinesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachinesDeallocateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachinesDeallocateFuture.Result. -func (future *VirtualMachinesDeallocateFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesDeallocateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesDeallocateFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachinesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VirtualMachinesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachinesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachinesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachinesDeleteFuture.Result. -func (future *VirtualMachinesDeleteFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineSize describes the properties of a VM size. -type VirtualMachineSize struct { - // Name - The name of the virtual machine size. - Name *string `json:"name,omitempty"` - // NumberOfCores - The number of cores supported by the virtual machine size. - NumberOfCores *int32 `json:"numberOfCores,omitempty"` - // OsDiskSizeInMB - The OS disk size, in MB, allowed by the virtual machine size. - OsDiskSizeInMB *int32 `json:"osDiskSizeInMB,omitempty"` - // ResourceDiskSizeInMB - The resource disk size, in MB, allowed by the virtual machine size. - ResourceDiskSizeInMB *int32 `json:"resourceDiskSizeInMB,omitempty"` - // MemoryInMB - The amount of memory, in MB, supported by the virtual machine size. - MemoryInMB *int32 `json:"memoryInMB,omitempty"` - // MaxDataDiskCount - The maximum number of data disks that can be attached to the virtual machine size. - MaxDataDiskCount *int32 `json:"maxDataDiskCount,omitempty"` -} - -// VirtualMachineSizeListResult the List Virtual Machine operation response. -type VirtualMachineSizeListResult struct { - autorest.Response `json:"-"` - // Value - The list of virtual machine sizes. - Value *[]VirtualMachineSize `json:"value,omitempty"` -} - -// VirtualMachinesPerformMaintenanceFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachinesPerformMaintenanceFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachinesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachinesPerformMaintenanceFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachinesPerformMaintenanceFuture.Result. -func (future *VirtualMachinesPerformMaintenanceFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesPerformMaintenanceFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesPerformMaintenanceFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachinesPowerOffFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VirtualMachinesPowerOffFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachinesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachinesPowerOffFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachinesPowerOffFuture.Result. -func (future *VirtualMachinesPowerOffFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesPowerOffFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesPowerOffFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachinesReapplyFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VirtualMachinesReapplyFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachinesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachinesReapplyFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachinesReapplyFuture.Result. -func (future *VirtualMachinesReapplyFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesReapplyFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesReapplyFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachinesRedeployFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VirtualMachinesRedeployFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachinesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachinesRedeployFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachinesRedeployFuture.Result. -func (future *VirtualMachinesRedeployFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRedeployFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesRedeployFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachinesReimageFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VirtualMachinesReimageFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachinesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachinesReimageFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachinesReimageFuture.Result. -func (future *VirtualMachinesReimageFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesReimageFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesReimageFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachinesRestartFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VirtualMachinesRestartFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachinesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachinesRestartFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachinesRestartFuture.Result. -func (future *VirtualMachinesRestartFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRestartFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesRestartFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachinesRunCommandFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachinesRunCommandFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachinesClient) (RunCommandResult, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachinesRunCommandFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachinesRunCommandFuture.Result. -func (future *VirtualMachinesRunCommandFuture) result(client VirtualMachinesClient) (rcr RunCommandResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRunCommandFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - rcr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesRunCommandFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if rcr.Response.Response, err = future.GetResult(sender); err == nil && rcr.Response.Response.StatusCode != http.StatusNoContent { - rcr, err = client.RunCommandResponder(rcr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRunCommandFuture", "Result", rcr.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachinesStartFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VirtualMachinesStartFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachinesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachinesStartFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachinesStartFuture.Result. -func (future *VirtualMachinesStartFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesStartFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesStartFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineStatusCodeCount the status code and count of the virtual machine scale set instance view -// status summary. -type VirtualMachineStatusCodeCount struct { - // Code - READ-ONLY; The instance view status code. - Code *string `json:"code,omitempty"` - // Count - READ-ONLY; The number of instances having a particular status code. - Count *int32 `json:"count,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineStatusCodeCount. -func (vmscc VirtualMachineStatusCodeCount) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// VirtualMachinesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VirtualMachinesUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachinesClient) (VirtualMachine, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachinesUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachinesUpdateFuture.Result. -func (future *VirtualMachinesUpdateFuture) result(client VirtualMachinesClient) (VM VirtualMachine, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - VM.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if VM.Response.Response, err = future.GetResult(sender); err == nil && VM.Response.Response.StatusCode != http.StatusNoContent { - VM, err = client.UpdateResponder(VM.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesUpdateFuture", "Result", VM.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachineUpdate describes a Virtual Machine Update. -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 -} - -// VMScaleSetConvertToSinglePlacementGroupInput ... -type VMScaleSetConvertToSinglePlacementGroupInput struct { - // ActivePlacementGroupID - Id of the placement group in which you want future virtual machine instances to be placed. To query placement group Id, please use Virtual Machine Scale Set VMs - Get API. If not provided, the platform will choose one with maximum number of virtual machine instances. - ActivePlacementGroupID *string `json:"activePlacementGroupId,omitempty"` -} - -// 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. - ProvisionVMAgent *bool `json:"provisionVMAgent,omitempty"` - // EnableAutomaticUpdates - Indicates whether Automatic Updates is enabled for the Windows virtual machine. Default value is true.

      For virtual machine scale sets, this property can be updated and updates will take effect on OS reprovisioning. - EnableAutomaticUpdates *bool `json:"enableAutomaticUpdates,omitempty"` - // TimeZone - Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time".

      Possible values can be [TimeZoneInfo.Id](https://docs.microsoft.com/en-us/dotnet/api/system.timezoneinfo.id?#System_TimeZoneInfo_Id) value from time zones returned by [TimeZoneInfo.GetSystemTimeZones](https://docs.microsoft.com/en-us/dotnet/api/system.timezoneinfo.getsystemtimezones). - TimeZone *string `json:"timeZone,omitempty"` - // AdditionalUnattendContent - Specifies additional base-64 encoded XML formatted information that can be included in the Unattend.xml file, which is used by Windows Setup. - AdditionalUnattendContent *[]AdditionalUnattendContent `json:"additionalUnattendContent,omitempty"` - // WinRM - Specifies the Windows Remote Management listeners. This enables remote Windows PowerShell. - WinRM *WinRMConfiguration `json:"winRM,omitempty"` -} - -// WinRMConfiguration describes Windows Remote Management configuration of the VM -type WinRMConfiguration struct { - // Listeners - The list of Windows Remote Management listeners - Listeners *[]WinRMListener `json:"listeners,omitempty"` -} - -// WinRMListener describes Protocol and thumbprint of Windows Remote Management listener -type WinRMListener struct { - // Protocol - Specifies the protocol of WinRM listener.

      Possible values are:
      **http**

      **https**. Possible values include: 'HTTP', 'HTTPS' - Protocol ProtocolTypes `json:"protocol,omitempty"` - // 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"` -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/operations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/operations.go deleted file mode 100644 index 516c9a37..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/operations.go +++ /dev/null @@ -1,98 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// 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 using a custom endpoint. Use this -// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -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) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - 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 - } - - return -} - -// ListPreparer prepares the List request. -func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - const APIVersion = "2019-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 client.Send(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, - 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/2019-12-01/compute/proximityplacementgroups.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/proximityplacementgroups.go deleted file mode 100644 index 9eae7232..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/proximityplacementgroups.go +++ /dev/null @@ -1,575 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ProximityPlacementGroupsClient is the compute Client -type ProximityPlacementGroupsClient struct { - BaseClient -} - -// NewProximityPlacementGroupsClient creates an instance of the ProximityPlacementGroupsClient client. -func NewProximityPlacementGroupsClient(subscriptionID string) ProximityPlacementGroupsClient { - return NewProximityPlacementGroupsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewProximityPlacementGroupsClientWithBaseURI creates an instance of the ProximityPlacementGroupsClient client using -// a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign -// clouds, Azure stack). -func NewProximityPlacementGroupsClientWithBaseURI(baseURI string, subscriptionID string) ProximityPlacementGroupsClient { - return ProximityPlacementGroupsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create or update a proximity placement group. -// Parameters: -// resourceGroupName - the name of the resource group. -// proximityPlacementGroupName - the name of the proximity placement group. -// parameters - parameters supplied to the Create Proximity Placement Group operation. -func (client ProximityPlacementGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, parameters ProximityPlacementGroup) (result ProximityPlacementGroup, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, proximityPlacementGroupName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "CreateOrUpdate", resp, "Failure responding to request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ProximityPlacementGroupsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, parameters ProximityPlacementGroup) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "proximityPlacementGroupName": autorest.Encode("path", proximityPlacementGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-12-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.Compute/proximityPlacementGroups/{proximityPlacementGroupName}", 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 ProximityPlacementGroupsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client ProximityPlacementGroupsClient) CreateOrUpdateResponder(resp *http.Response) (result ProximityPlacementGroup, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete a proximity placement group. -// Parameters: -// resourceGroupName - the name of the resource group. -// proximityPlacementGroupName - the name of the proximity placement group. -func (client ProximityPlacementGroupsClient) Delete(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupsClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, proximityPlacementGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "Delete", resp, "Failure responding to request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ProximityPlacementGroupsClient) DeletePreparer(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "proximityPlacementGroupName": autorest.Encode("path", proximityPlacementGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-12-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.Compute/proximityPlacementGroups/{proximityPlacementGroupName}", 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 ProximityPlacementGroupsClient) DeleteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client ProximityPlacementGroupsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieves information about a proximity placement group . -// Parameters: -// resourceGroupName - the name of the resource group. -// proximityPlacementGroupName - the name of the proximity placement group. -// includeColocationStatus - includeColocationStatus=true enables fetching the colocation status of all the -// resources in the proximity placement group. -func (client ProximityPlacementGroupsClient) Get(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, includeColocationStatus string) (result ProximityPlacementGroup, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, proximityPlacementGroupName, includeColocationStatus) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ProximityPlacementGroupsClient) GetPreparer(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, includeColocationStatus string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "proximityPlacementGroupName": autorest.Encode("path", proximityPlacementGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(includeColocationStatus) > 0 { - queryParameters["includeColocationStatus"] = autorest.Encode("query", includeColocationStatus) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups/{proximityPlacementGroupName}", 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 ProximityPlacementGroupsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ProximityPlacementGroupsClient) GetResponder(resp *http.Response) (result ProximityPlacementGroup, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByResourceGroup lists all proximity placement groups in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client ProximityPlacementGroupsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ProximityPlacementGroupListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.ppglr.Response.Response != nil { - sc = result.ppglr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.ppglr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.ppglr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.ppglr.hasNextLink() && result.ppglr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client ProximityPlacementGroupsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-12-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.Compute/proximityPlacementGroups", pathParameters), - autorest.WithQueryParameters(queryParameters)) - 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 ProximityPlacementGroupsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client ProximityPlacementGroupsClient) ListByResourceGroupResponder(resp *http.Response) (result ProximityPlacementGroupListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client ProximityPlacementGroupsClient) listByResourceGroupNextResults(ctx context.Context, lastResults ProximityPlacementGroupListResult) (result ProximityPlacementGroupListResult, err error) { - req, err := lastResults.proximityPlacementGroupListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client ProximityPlacementGroupsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ProximityPlacementGroupListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// ListBySubscription lists all proximity placement groups in a subscription. -func (client ProximityPlacementGroupsClient) ListBySubscription(ctx context.Context) (result ProximityPlacementGroupListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupsClient.ListBySubscription") - defer func() { - sc := -1 - if result.ppglr.Response.Response != nil { - sc = result.ppglr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listBySubscriptionNextResults - req, err := client.ListBySubscriptionPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "ListBySubscription", nil, "Failure preparing request") - return - } - - resp, err := client.ListBySubscriptionSender(req) - if err != nil { - result.ppglr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "ListBySubscription", resp, "Failure sending request") - return - } - - result.ppglr, err = client.ListBySubscriptionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "ListBySubscription", resp, "Failure responding to request") - return - } - if result.ppglr.hasNextLink() && result.ppglr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListBySubscriptionPreparer prepares the ListBySubscription request. -func (client ProximityPlacementGroupsClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/proximityPlacementGroups", 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 ProximityPlacementGroupsClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always -// closes the http.Response Body. -func (client ProximityPlacementGroupsClient) ListBySubscriptionResponder(resp *http.Response) (result ProximityPlacementGroupListResult, err error) { - err = autorest.Respond( - resp, - 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 ProximityPlacementGroupsClient) listBySubscriptionNextResults(ctx context.Context, lastResults ProximityPlacementGroupListResult) (result ProximityPlacementGroupListResult, err error) { - req, err := lastResults.proximityPlacementGroupListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "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, "compute.ProximityPlacementGroupsClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") - } - result, err = client.ListBySubscriptionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. -func (client ProximityPlacementGroupsClient) ListBySubscriptionComplete(ctx context.Context) (result ProximityPlacementGroupListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupsClient.ListBySubscription") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListBySubscription(ctx) - return -} - -// Update update a proximity placement group. -// Parameters: -// resourceGroupName - the name of the resource group. -// proximityPlacementGroupName - the name of the proximity placement group. -// parameters - parameters supplied to the Update Proximity Placement Group operation. -func (client ProximityPlacementGroupsClient) Update(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, parameters ProximityPlacementGroupUpdate) (result ProximityPlacementGroup, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupsClient.Update") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, proximityPlacementGroupName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "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.ProximityPlacementGroupsClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "Update", resp, "Failure responding to request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client ProximityPlacementGroupsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, parameters ProximityPlacementGroupUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "proximityPlacementGroupName": autorest.Encode("path", proximityPlacementGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-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/proximityPlacementGroups/{proximityPlacementGroupName}", 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 ProximityPlacementGroupsClient) UpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client ProximityPlacementGroupsClient) UpdateResponder(resp *http.Response) (result ProximityPlacementGroup, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/resourceskus.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/resourceskus.go deleted file mode 100644 index 9c967d93..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/resourceskus.go +++ /dev/null @@ -1,149 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ResourceSkusClient is the compute Client -type ResourceSkusClient struct { - BaseClient -} - -// NewResourceSkusClient creates an instance of the ResourceSkusClient client. -func NewResourceSkusClient(subscriptionID string) ResourceSkusClient { - return NewResourceSkusClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewResourceSkusClientWithBaseURI creates an instance of the ResourceSkusClient client using a custom endpoint. Use -// this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewResourceSkusClientWithBaseURI(baseURI string, subscriptionID string) ResourceSkusClient { - return ResourceSkusClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List gets the list of Microsoft.Compute SKUs available for your Subscription. -// Parameters: -// filter - the filter to apply on the operation. Only **location** filter is supported currently. -func (client ResourceSkusClient) List(ctx context.Context, filter string) (result ResourceSkusResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkusClient.List") - defer func() { - sc := -1 - if result.rsr.Response.Response != nil { - sc = result.rsr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, filter) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ResourceSkusClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.rsr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.ResourceSkusClient", "List", resp, "Failure sending request") - return - } - - result.rsr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ResourceSkusClient", "List", resp, "Failure responding to request") - return - } - if result.rsr.hasNextLink() && result.rsr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ResourceSkusClient) ListPreparer(ctx context.Context, filter string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-04-01" - 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}/providers/Microsoft.Compute/skus", 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 ResourceSkusClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ResourceSkusClient) ListResponder(resp *http.Response) (result ResourceSkusResult, err error) { - err = autorest.Respond( - resp, - 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 ResourceSkusClient) listNextResults(ctx context.Context, lastResults ResourceSkusResult) (result ResourceSkusResult, err error) { - req, err := lastResults.resourceSkusResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.ResourceSkusClient", "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, "compute.ResourceSkusClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ResourceSkusClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ResourceSkusClient) ListComplete(ctx context.Context, filter string) (result ResourceSkusResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkusClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, filter) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/snapshots.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/snapshots.go deleted file mode 100644 index 986664e4..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/snapshots.go +++ /dev/null @@ -1,767 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// SnapshotsClient is the compute Client -type SnapshotsClient struct { - BaseClient -} - -// NewSnapshotsClient creates an instance of the SnapshotsClient client. -func NewSnapshotsClient(subscriptionID string) SnapshotsClient { - return NewSnapshotsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewSnapshotsClientWithBaseURI creates an instance of the SnapshotsClient client using a custom endpoint. Use this -// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewSnapshotsClientWithBaseURI(baseURI string, subscriptionID string) SnapshotsClient { - return SnapshotsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a snapshot. -// Parameters: -// resourceGroupName - the name of the resource group. -// snapshotName - 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 - 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 tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: snapshot, - Constraints: []validation.Constraint{{Target: "snapshot.SnapshotProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "snapshot.SnapshotProperties.CreationData", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "snapshot.SnapshotProperties.CreationData.ImageReference", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "snapshot.SnapshotProperties.CreationData.ImageReference.ID", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "snapshot.SnapshotProperties.CreationData.GalleryImageReference", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "snapshot.SnapshotProperties.CreationData.GalleryImageReference.ID", Name: validation.Null, Rule: true, Chain: nil}}}, - }}, - {Target: "snapshot.SnapshotProperties.EncryptionSettingsCollection", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "snapshot.SnapshotProperties.EncryptionSettingsCollection.Enabled", Name: validation.Null, Rule: true, Chain: nil}}}, - }}}}}); err != nil { - return result, validation.NewError("compute.SnapshotsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, snapshotName, snapshot) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client SnapshotsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, snapshotName string, snapshot Snapshot) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "snapshotName": autorest.Encode("path", snapshotName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-11-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - snapshot.ManagedBy = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}", pathParameters), - autorest.WithJSON(snapshot), - 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 SnapshotsClient) CreateOrUpdateSender(req *http.Request) (future SnapshotsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client SnapshotsClient) CreateOrUpdateResponder(resp *http.Response) (result Snapshot, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a snapshot. -// Parameters: -// resourceGroupName - the name of the resource group. -// snapshotName - 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) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, snapshotName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client SnapshotsClient) DeletePreparer(ctx context.Context, resourceGroupName string, snapshotName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "snapshotName": autorest.Encode("path", snapshotName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-11-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.Compute/snapshots/{snapshotName}", 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 SnapshotsClient) DeleteSender(req *http.Request) (future SnapshotsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client SnapshotsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets information about a snapshot. -// Parameters: -// resourceGroupName - the name of the resource group. -// snapshotName - 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) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, snapshotName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client SnapshotsClient) GetPreparer(ctx context.Context, resourceGroupName string, snapshotName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "snapshotName": autorest.Encode("path", snapshotName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-11-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.Compute/snapshots/{snapshotName}", 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 SnapshotsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client SnapshotsClient) GetResponder(resp *http.Response) (result Snapshot, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GrantAccess grants access to a snapshot. -// Parameters: -// resourceGroupName - the name of the resource group. -// snapshotName - 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 - 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 tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.GrantAccess") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - 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.NewError("compute.SnapshotsClient", "GrantAccess", err.Error()) - } - - req, err := client.GrantAccessPreparer(ctx, resourceGroupName, snapshotName, grantAccessData) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "GrantAccess", nil, "Failure preparing request") - return - } - - result, err = client.GrantAccessSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "GrantAccess", result.Response(), "Failure sending request") - return - } - - return -} - -// GrantAccessPreparer prepares the GrantAccess request. -func (client SnapshotsClient) GrantAccessPreparer(ctx context.Context, resourceGroupName string, snapshotName string, grantAccessData GrantAccessData) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "snapshotName": autorest.Encode("path", snapshotName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-11-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.Compute/snapshots/{snapshotName}/beginGetAccess", pathParameters), - autorest.WithJSON(grantAccessData), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GrantAccessSender sends the GrantAccess request. The method will close the -// http.Response Body if it receives an error. -func (client SnapshotsClient) GrantAccessSender(req *http.Request) (future SnapshotsGrantAccessFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// GrantAccessResponder handles the response to the GrantAccess request. The method always -// closes the http.Response Body. -func (client SnapshotsClient) GrantAccessResponder(resp *http.Response) (result AccessURI, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists snapshots under a subscription. -func (client SnapshotsClient) List(ctx context.Context) (result SnapshotListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.List") - defer func() { - sc := -1 - if result.sl.Response.Response != nil { - sc = result.sl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.sl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "List", resp, "Failure sending request") - return - } - - result.sl, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "List", resp, "Failure responding to request") - return - } - if result.sl.hasNextLink() && result.sl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client SnapshotsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-11-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/snapshots", 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 SnapshotsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client SnapshotsClient) ListResponder(resp *http.Response) (result SnapshotList, err error) { - err = autorest.Respond( - resp, - 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 SnapshotsClient) listNextResults(ctx context.Context, lastResults SnapshotList) (result SnapshotList, err error) { - req, err := lastResults.snapshotListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.SnapshotsClient", "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, "compute.SnapshotsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client SnapshotsClient) ListComplete(ctx context.Context) (result SnapshotListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} - -// ListByResourceGroup lists snapshots under a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client SnapshotsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result SnapshotListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.sl.Response.Response != nil { - sc = result.sl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.sl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.sl, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.sl.hasNextLink() && result.sl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client SnapshotsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-11-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.Compute/snapshots", pathParameters), - autorest.WithQueryParameters(queryParameters)) - 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 SnapshotsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client SnapshotsClient) ListByResourceGroupResponder(resp *http.Response) (result SnapshotList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client SnapshotsClient) listByResourceGroupNextResults(ctx context.Context, lastResults SnapshotList) (result SnapshotList, err error) { - req, err := lastResults.snapshotListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.SnapshotsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.SnapshotsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client SnapshotsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result SnapshotListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// RevokeAccess revokes access to a snapshot. -// Parameters: -// resourceGroupName - the name of the resource group. -// snapshotName - 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) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.RevokeAccess") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.RevokeAccessPreparer(ctx, resourceGroupName, snapshotName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "RevokeAccess", nil, "Failure preparing request") - return - } - - result, err = client.RevokeAccessSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "RevokeAccess", result.Response(), "Failure sending request") - return - } - - return -} - -// RevokeAccessPreparer prepares the RevokeAccess request. -func (client SnapshotsClient) RevokeAccessPreparer(ctx context.Context, resourceGroupName string, snapshotName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "snapshotName": autorest.Encode("path", snapshotName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-11-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.Compute/snapshots/{snapshotName}/endGetAccess", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RevokeAccessSender sends the RevokeAccess request. The method will close the -// http.Response Body if it receives an error. -func (client SnapshotsClient) RevokeAccessSender(req *http.Request) (future SnapshotsRevokeAccessFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// RevokeAccessResponder handles the response to the RevokeAccess request. The method always -// closes the http.Response Body. -func (client SnapshotsClient) RevokeAccessResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Update updates (patches) a snapshot. -// Parameters: -// resourceGroupName - the name of the resource group. -// snapshotName - 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 - 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) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, snapshotName, snapshot) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client SnapshotsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, snapshotName string, snapshot SnapshotUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "snapshotName": autorest.Encode("path", snapshotName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-11-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/snapshots/{snapshotName}", pathParameters), - autorest.WithJSON(snapshot), - 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 SnapshotsClient) UpdateSender(req *http.Request) (future SnapshotsUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client SnapshotsClient) UpdateResponder(resp *http.Response) (result Snapshot, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - 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/2019-12-01/compute/sshpublickeys.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/sshpublickeys.go deleted file mode 100644 index 017269b6..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/sshpublickeys.go +++ /dev/null @@ -1,649 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// SSHPublicKeysClient is the compute Client -type SSHPublicKeysClient struct { - BaseClient -} - -// NewSSHPublicKeysClient creates an instance of the SSHPublicKeysClient client. -func NewSSHPublicKeysClient(subscriptionID string) SSHPublicKeysClient { - return NewSSHPublicKeysClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewSSHPublicKeysClientWithBaseURI creates an instance of the SSHPublicKeysClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewSSHPublicKeysClientWithBaseURI(baseURI string, subscriptionID string) SSHPublicKeysClient { - return SSHPublicKeysClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Create creates a new SSH public key resource. -// Parameters: -// resourceGroupName - the name of the resource group. -// SSHPublicKeyName - the name of the SSH public key. -// parameters - parameters supplied to create the SSH public key. -func (client SSHPublicKeysClient) Create(ctx context.Context, resourceGroupName string, SSHPublicKeyName string, parameters SSHPublicKeyResource) (result SSHPublicKeyResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SSHPublicKeysClient.Create") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreatePreparer(ctx, resourceGroupName, SSHPublicKeyName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "Create", nil, "Failure preparing request") - return - } - - resp, err := client.CreateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "Create", resp, "Failure sending request") - return - } - - result, err = client.CreateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "Create", resp, "Failure responding to request") - return - } - - return -} - -// CreatePreparer prepares the Create request. -func (client SSHPublicKeysClient) CreatePreparer(ctx context.Context, resourceGroupName string, SSHPublicKeyName string, parameters SSHPublicKeyResource) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "sshPublicKeyName": autorest.Encode("path", SSHPublicKeyName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-12-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.Compute/sshPublicKeys/{sshPublicKeyName}", pathParameters), - autorest.WithJSON(parameters), - 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 SSHPublicKeysClient) CreateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateResponder handles the response to the Create request. The method always -// closes the http.Response Body. -func (client SSHPublicKeysClient) CreateResponder(resp *http.Response) (result SSHPublicKeyResource, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete an SSH public key. -// Parameters: -// resourceGroupName - the name of the resource group. -// SSHPublicKeyName - the name of the SSH public key. -func (client SSHPublicKeysClient) Delete(ctx context.Context, resourceGroupName string, SSHPublicKeyName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SSHPublicKeysClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, SSHPublicKeyName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "Delete", resp, "Failure responding to request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client SSHPublicKeysClient) DeletePreparer(ctx context.Context, resourceGroupName string, SSHPublicKeyName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "sshPublicKeyName": autorest.Encode("path", SSHPublicKeyName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-12-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.Compute/sshPublicKeys/{sshPublicKeyName}", 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 SSHPublicKeysClient) DeleteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client SSHPublicKeysClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// GenerateKeyPair generates and returns a public/private key pair and populates the SSH public key resource with the -// public key. The length of the key will be 3072 bits. This operation can only be performed once per SSH public key -// resource. -// Parameters: -// resourceGroupName - the name of the resource group. -// SSHPublicKeyName - the name of the SSH public key. -func (client SSHPublicKeysClient) GenerateKeyPair(ctx context.Context, resourceGroupName string, SSHPublicKeyName string) (result SSHPublicKeyGenerateKeyPairResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SSHPublicKeysClient.GenerateKeyPair") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GenerateKeyPairPreparer(ctx, resourceGroupName, SSHPublicKeyName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "GenerateKeyPair", nil, "Failure preparing request") - return - } - - resp, err := client.GenerateKeyPairSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "GenerateKeyPair", resp, "Failure sending request") - return - } - - result, err = client.GenerateKeyPairResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "GenerateKeyPair", resp, "Failure responding to request") - return - } - - return -} - -// GenerateKeyPairPreparer prepares the GenerateKeyPair request. -func (client SSHPublicKeysClient) GenerateKeyPairPreparer(ctx context.Context, resourceGroupName string, SSHPublicKeyName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "sshPublicKeyName": autorest.Encode("path", SSHPublicKeyName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-12-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.Compute/sshPublicKeys/{sshPublicKeyName}/generateKeyPair", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GenerateKeyPairSender sends the GenerateKeyPair request. The method will close the -// http.Response Body if it receives an error. -func (client SSHPublicKeysClient) GenerateKeyPairSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GenerateKeyPairResponder handles the response to the GenerateKeyPair request. The method always -// closes the http.Response Body. -func (client SSHPublicKeysClient) GenerateKeyPairResponder(resp *http.Response) (result SSHPublicKeyGenerateKeyPairResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Get retrieves information about an SSH public key. -// Parameters: -// resourceGroupName - the name of the resource group. -// SSHPublicKeyName - the name of the SSH public key. -func (client SSHPublicKeysClient) Get(ctx context.Context, resourceGroupName string, SSHPublicKeyName string) (result SSHPublicKeyResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SSHPublicKeysClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, SSHPublicKeyName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client SSHPublicKeysClient) GetPreparer(ctx context.Context, resourceGroupName string, SSHPublicKeyName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "sshPublicKeyName": autorest.Encode("path", SSHPublicKeyName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-12-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.Compute/sshPublicKeys/{sshPublicKeyName}", 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 SSHPublicKeysClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client SSHPublicKeysClient) GetResponder(resp *http.Response) (result SSHPublicKeyResource, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByResourceGroup lists all of the SSH public keys in the specified resource group. Use the nextLink property in -// the response to get the next page of SSH public keys. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client SSHPublicKeysClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result SSHPublicKeysGroupListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SSHPublicKeysClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.spkglr.Response.Response != nil { - sc = result.spkglr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.spkglr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.spkglr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.spkglr.hasNextLink() && result.spkglr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client SSHPublicKeysClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-12-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.Compute/sshPublicKeys", pathParameters), - autorest.WithQueryParameters(queryParameters)) - 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 SSHPublicKeysClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client SSHPublicKeysClient) ListByResourceGroupResponder(resp *http.Response) (result SSHPublicKeysGroupListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client SSHPublicKeysClient) listByResourceGroupNextResults(ctx context.Context, lastResults SSHPublicKeysGroupListResult) (result SSHPublicKeysGroupListResult, err error) { - req, err := lastResults.sSHPublicKeysGroupListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client SSHPublicKeysClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result SSHPublicKeysGroupListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SSHPublicKeysClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// ListBySubscription lists all of the SSH public keys in the subscription. Use the nextLink property in the response -// to get the next page of SSH public keys. -func (client SSHPublicKeysClient) ListBySubscription(ctx context.Context) (result SSHPublicKeysGroupListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SSHPublicKeysClient.ListBySubscription") - defer func() { - sc := -1 - if result.spkglr.Response.Response != nil { - sc = result.spkglr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listBySubscriptionNextResults - req, err := client.ListBySubscriptionPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "ListBySubscription", nil, "Failure preparing request") - return - } - - resp, err := client.ListBySubscriptionSender(req) - if err != nil { - result.spkglr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "ListBySubscription", resp, "Failure sending request") - return - } - - result.spkglr, err = client.ListBySubscriptionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "ListBySubscription", resp, "Failure responding to request") - return - } - if result.spkglr.hasNextLink() && result.spkglr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListBySubscriptionPreparer prepares the ListBySubscription request. -func (client SSHPublicKeysClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/sshPublicKeys", 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 SSHPublicKeysClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always -// closes the http.Response Body. -func (client SSHPublicKeysClient) ListBySubscriptionResponder(resp *http.Response) (result SSHPublicKeysGroupListResult, err error) { - err = autorest.Respond( - resp, - 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 SSHPublicKeysClient) listBySubscriptionNextResults(ctx context.Context, lastResults SSHPublicKeysGroupListResult) (result SSHPublicKeysGroupListResult, err error) { - req, err := lastResults.sSHPublicKeysGroupListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "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, "compute.SSHPublicKeysClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") - } - result, err = client.ListBySubscriptionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. -func (client SSHPublicKeysClient) ListBySubscriptionComplete(ctx context.Context) (result SSHPublicKeysGroupListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SSHPublicKeysClient.ListBySubscription") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListBySubscription(ctx) - return -} - -// Update updates a new SSH public key resource. -// Parameters: -// resourceGroupName - the name of the resource group. -// SSHPublicKeyName - the name of the SSH public key. -// parameters - parameters supplied to update the SSH public key. -func (client SSHPublicKeysClient) Update(ctx context.Context, resourceGroupName string, SSHPublicKeyName string, parameters SSHPublicKeyUpdateResource) (result SSHPublicKeyResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SSHPublicKeysClient.Update") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, SSHPublicKeyName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "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.SSHPublicKeysClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "Update", resp, "Failure responding to request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client SSHPublicKeysClient) UpdatePreparer(ctx context.Context, resourceGroupName string, SSHPublicKeyName string, parameters SSHPublicKeyUpdateResource) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "sshPublicKeyName": autorest.Encode("path", SSHPublicKeyName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-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/sshPublicKeys/{sshPublicKeyName}", 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 SSHPublicKeysClient) UpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client SSHPublicKeysClient) UpdateResponder(resp *http.Response) (result SSHPublicKeyResource, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/usage.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/usage.go deleted file mode 100644 index 3231cc19..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/usage.go +++ /dev/null @@ -1,155 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// UsageClient is the compute Client -type UsageClient struct { - BaseClient -} - -// NewUsageClient creates an instance of the UsageClient client. -func NewUsageClient(subscriptionID string) UsageClient { - return NewUsageClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewUsageClientWithBaseURI creates an instance of the UsageClient client using a custom endpoint. Use this when -// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewUsageClientWithBaseURI(baseURI string, subscriptionID string) UsageClient { - return UsageClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List gets, for the specified location, the current compute resource usage information as well as the limits for -// compute resources under the subscription. -// Parameters: -// location - the location for which resource usage is queried. -func (client UsageClient) List(ctx context.Context, location string) (result ListUsagesResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/UsageClient.List") - defer func() { - sc := -1 - if result.lur.Response.Response != nil { - sc = result.lur.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - 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.NewError("compute.UsageClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, location) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.UsageClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.lur.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.UsageClient", "List", resp, "Failure sending request") - return - } - - result.lur, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.UsageClient", "List", resp, "Failure responding to request") - return - } - if result.lur.hasNextLink() && result.lur.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client UsageClient) ListPreparer(ctx context.Context, location string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/usages", 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 UsageClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client UsageClient) ListResponder(resp *http.Response) (result ListUsagesResult, err error) { - err = autorest.Respond( - resp, - 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 UsageClient) listNextResults(ctx context.Context, lastResults ListUsagesResult) (result ListUsagesResult, err error) { - req, err := lastResults.listUsagesResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.UsageClient", "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, "compute.UsageClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.UsageClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client UsageClient) ListComplete(ctx context.Context, location string) (result ListUsagesResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/UsageClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, location) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/version.go deleted file mode 100644 index a4893da4..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/version.go +++ /dev/null @@ -1,19 +0,0 @@ -package compute - -import "github.com/Azure/azure-sdk-for-go/version" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -// UserAgent returns the UserAgent string to use when sending http.Requests. -func UserAgent() string { - return "Azure-SDK-For-Go/" + Version() + " compute/2019-12-01" -} - -// Version returns the semantic version (see http://semver.org) of the client. -func Version() string { - return version.Number -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachineextensionimages.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachineextensionimages.go deleted file mode 100644 index 334f878d..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachineextensionimages.go +++ /dev/null @@ -1,270 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualMachineExtensionImagesClient is the compute Client -type VirtualMachineExtensionImagesClient struct { - BaseClient -} - -// NewVirtualMachineExtensionImagesClient creates an instance of the VirtualMachineExtensionImagesClient client. -func NewVirtualMachineExtensionImagesClient(subscriptionID string) VirtualMachineExtensionImagesClient { - return NewVirtualMachineExtensionImagesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualMachineExtensionImagesClientWithBaseURI creates an instance of the VirtualMachineExtensionImagesClient -// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI -// (sovereign clouds, Azure stack). -func NewVirtualMachineExtensionImagesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineExtensionImagesClient { - return VirtualMachineExtensionImagesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get gets a virtual machine extension image. -// Parameters: -// location - the name of a supported Azure region. -func (client VirtualMachineExtensionImagesClient) Get(ctx context.Context, location string, publisherName string, typeParameter string, version string) (result VirtualMachineExtensionImage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineExtensionImagesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, location, publisherName, typeParameter, version) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualMachineExtensionImagesClient) GetPreparer(ctx context.Context, location string, publisherName string, typeParameter string, version string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "publisherName": autorest.Encode("path", publisherName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "type": autorest.Encode("path", typeParameter), - "version": autorest.Encode("path", version), - } - - const APIVersion = "2019-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions/{version}", 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 VirtualMachineExtensionImagesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualMachineExtensionImagesClient) GetResponder(resp *http.Response) (result VirtualMachineExtensionImage, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListTypes gets a list of virtual machine extension image types. -// Parameters: -// location - the name of a supported Azure region. -func (client VirtualMachineExtensionImagesClient) ListTypes(ctx context.Context, location string, publisherName string) (result ListVirtualMachineExtensionImage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineExtensionImagesClient.ListTypes") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListTypesPreparer(ctx, location, publisherName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "ListTypes", nil, "Failure preparing request") - return - } - - resp, err := client.ListTypesSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "ListTypes", resp, "Failure sending request") - return - } - - result, err = client.ListTypesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "ListTypes", resp, "Failure responding to request") - return - } - - return -} - -// ListTypesPreparer prepares the ListTypes request. -func (client VirtualMachineExtensionImagesClient) ListTypesPreparer(ctx context.Context, location string, publisherName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "publisherName": autorest.Encode("path", publisherName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListTypesSender sends the ListTypes request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineExtensionImagesClient) ListTypesSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListTypesResponder handles the response to the ListTypes request. The method always -// closes the http.Response Body. -func (client VirtualMachineExtensionImagesClient) ListTypesResponder(resp *http.Response) (result ListVirtualMachineExtensionImage, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListVersions gets a list of virtual machine extension image versions. -// Parameters: -// location - the name of a supported Azure region. -// filter - the filter to apply on the operation. -func (client VirtualMachineExtensionImagesClient) ListVersions(ctx context.Context, location string, publisherName string, typeParameter string, filter string, top *int32, orderby string) (result ListVirtualMachineExtensionImage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineExtensionImagesClient.ListVersions") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListVersionsPreparer(ctx, location, publisherName, typeParameter, filter, top, orderby) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "ListVersions", nil, "Failure preparing request") - return - } - - resp, err := client.ListVersionsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "ListVersions", resp, "Failure sending request") - return - } - - result, err = client.ListVersionsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "ListVersions", resp, "Failure responding to request") - return - } - - return -} - -// ListVersionsPreparer prepares the ListVersions request. -func (client VirtualMachineExtensionImagesClient) ListVersionsPreparer(ctx context.Context, location string, publisherName string, typeParameter string, filter string, top *int32, orderby string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "publisherName": autorest.Encode("path", publisherName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "type": autorest.Encode("path", typeParameter), - } - - const APIVersion = "2019-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if top != nil { - queryParameters["$top"] = autorest.Encode("query", *top) - } - if len(orderby) > 0 { - queryParameters["$orderby"] = autorest.Encode("query", orderby) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListVersionsSender sends the ListVersions request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineExtensionImagesClient) ListVersionsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListVersionsResponder handles the response to the ListVersions request. The method always -// closes the http.Response Body. -func (client VirtualMachineExtensionImagesClient) ListVersionsResponder(resp *http.Response) (result ListVirtualMachineExtensionImage, err error) { - err = autorest.Respond( - resp, - 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/compute/mgmt/2019-12-01/compute/virtualmachineextensions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachineextensions.go deleted file mode 100644 index e31db946..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachineextensions.go +++ /dev/null @@ -1,442 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualMachineExtensionsClient is the compute Client -type VirtualMachineExtensionsClient struct { - BaseClient -} - -// NewVirtualMachineExtensionsClient creates an instance of the VirtualMachineExtensionsClient client. -func NewVirtualMachineExtensionsClient(subscriptionID string) VirtualMachineExtensionsClient { - return NewVirtualMachineExtensionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualMachineExtensionsClientWithBaseURI creates an instance of the VirtualMachineExtensionsClient client using -// a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign -// clouds, Azure stack). -func NewVirtualMachineExtensionsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineExtensionsClient { - return VirtualMachineExtensionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate the operation to create or update the extension. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine where the extension should be created or updated. -// VMExtensionName - the name of the virtual machine extension. -// extensionParameters - 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) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineExtensionsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, VMName, VMExtensionName, extensionParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VirtualMachineExtensionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string, extensionParameters VirtualMachineExtension) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmExtensionName": autorest.Encode("path", VMExtensionName), - "vmName": autorest.Encode("path", VMName), - } - - const APIVersion = "2019-12-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.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}", pathParameters), - autorest.WithJSON(extensionParameters), - 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 VirtualMachineExtensionsClient) CreateOrUpdateSender(req *http.Request) (future VirtualMachineExtensionsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client VirtualMachineExtensionsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualMachineExtension, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete the operation to delete the extension. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine where the extension should be deleted. -// VMExtensionName - the name of the virtual machine extension. -func (client VirtualMachineExtensionsClient) Delete(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string) (result VirtualMachineExtensionsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineExtensionsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, VMName, VMExtensionName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VirtualMachineExtensionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmExtensionName": autorest.Encode("path", VMExtensionName), - "vmName": autorest.Encode("path", VMName), - } - - const APIVersion = "2019-12-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.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}", 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 VirtualMachineExtensionsClient) DeleteSender(req *http.Request) (future VirtualMachineExtensionsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VirtualMachineExtensionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get the operation to get the extension. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine containing the extension. -// VMExtensionName - the name of the virtual machine extension. -// expand - 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) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineExtensionsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, VMName, VMExtensionName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualMachineExtensionsClient) GetPreparer(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmExtensionName": autorest.Encode("path", VMExtensionName), - "vmName": autorest.Encode("path", VMName), - } - - const APIVersion = "2019-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}", 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 VirtualMachineExtensionsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualMachineExtensionsClient) GetResponder(resp *http.Response) (result VirtualMachineExtension, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List the operation to get all extensions of a Virtual Machine. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine containing the extension. -// expand - the expand expression to apply on the operation. -func (client VirtualMachineExtensionsClient) List(ctx context.Context, resourceGroupName string, VMName string, expand string) (result VirtualMachineExtensionsListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineExtensionsClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListPreparer(ctx, resourceGroupName, VMName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "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.VirtualMachineExtensionsClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualMachineExtensionsClient) ListPreparer(ctx context.Context, resourceGroupName string, VMName string, expand string) (*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 = "2019-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions", 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 VirtualMachineExtensionsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualMachineExtensionsClient) ListResponder(resp *http.Response) (result VirtualMachineExtensionsListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Update the operation to update the extension. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine where the extension should be updated. -// VMExtensionName - the name of the virtual machine extension. -// extensionParameters - parameters supplied to the Update Virtual Machine Extension operation. -func (client VirtualMachineExtensionsClient) Update(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string, extensionParameters VirtualMachineExtensionUpdate) (result VirtualMachineExtensionsUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineExtensionsClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, VMName, VMExtensionName, extensionParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client VirtualMachineExtensionsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string, extensionParameters VirtualMachineExtensionUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmExtensionName": autorest.Encode("path", VMExtensionName), - "vmName": autorest.Encode("path", VMName), - } - - const APIVersion = "2019-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}/extensions/{vmExtensionName}", pathParameters), - autorest.WithJSON(extensionParameters), - 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 VirtualMachineExtensionsClient) UpdateSender(req *http.Request) (future VirtualMachineExtensionsUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client VirtualMachineExtensionsClient) UpdateResponder(resp *http.Response) (result VirtualMachineExtension, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachineimages.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachineimages.go deleted file mode 100644 index 2032e8e2..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachineimages.go +++ /dev/null @@ -1,432 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualMachineImagesClient is the compute Client -type VirtualMachineImagesClient struct { - BaseClient -} - -// NewVirtualMachineImagesClient creates an instance of the VirtualMachineImagesClient client. -func NewVirtualMachineImagesClient(subscriptionID string) VirtualMachineImagesClient { - return NewVirtualMachineImagesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualMachineImagesClientWithBaseURI creates an instance of the VirtualMachineImagesClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewVirtualMachineImagesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineImagesClient { - return VirtualMachineImagesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get gets a virtual machine image. -// Parameters: -// location - the name of a supported Azure region. -// publisherName - a valid image publisher. -// offer - a valid image publisher offer. -// skus - a valid image SKU. -// version - 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) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineImagesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, location, publisherName, offer, skus, version) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualMachineImagesClient) GetPreparer(ctx context.Context, location string, publisherName string, offer string, skus string, version string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "offer": autorest.Encode("path", offer), - "publisherName": autorest.Encode("path", publisherName), - "skus": autorest.Encode("path", skus), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "version": autorest.Encode("path", version), - } - - const APIVersion = "2019-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions/{version}", 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 VirtualMachineImagesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualMachineImagesClient) GetResponder(resp *http.Response) (result VirtualMachineImage, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. -// Parameters: -// location - the name of a supported Azure region. -// publisherName - a valid image publisher. -// offer - a valid image publisher offer. -// skus - a valid image SKU. -// expand - the expand expression to apply on the operation. -func (client VirtualMachineImagesClient) List(ctx context.Context, location string, publisherName string, offer string, skus string, expand string, top *int32, orderby string) (result ListVirtualMachineImageResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineImagesClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListPreparer(ctx, location, publisherName, offer, skus, expand, top, orderby) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "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.VirtualMachineImagesClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualMachineImagesClient) ListPreparer(ctx context.Context, location string, publisherName string, offer string, skus string, expand string, top *int32, orderby string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "offer": autorest.Encode("path", offer), - "publisherName": autorest.Encode("path", publisherName), - "skus": autorest.Encode("path", skus), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - if top != nil { - queryParameters["$top"] = autorest.Encode("query", *top) - } - if len(orderby) > 0 { - queryParameters["$orderby"] = autorest.Encode("query", orderby) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions", 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 VirtualMachineImagesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualMachineImagesClient) ListResponder(resp *http.Response) (result ListVirtualMachineImageResource, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListOffers gets a list of virtual machine image offers for the specified location and publisher. -// Parameters: -// location - the name of a supported Azure region. -// publisherName - a valid image publisher. -func (client VirtualMachineImagesClient) ListOffers(ctx context.Context, location string, publisherName string) (result ListVirtualMachineImageResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineImagesClient.ListOffers") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListOffersPreparer(ctx, location, publisherName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListOffers", nil, "Failure preparing request") - return - } - - resp, err := client.ListOffersSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListOffers", resp, "Failure sending request") - return - } - - result, err = client.ListOffersResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListOffers", resp, "Failure responding to request") - return - } - - return -} - -// ListOffersPreparer prepares the ListOffers request. -func (client VirtualMachineImagesClient) ListOffersPreparer(ctx context.Context, location string, publisherName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "publisherName": autorest.Encode("path", publisherName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListOffersSender sends the ListOffers request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineImagesClient) ListOffersSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListOffersResponder handles the response to the ListOffers request. The method always -// closes the http.Response Body. -func (client VirtualMachineImagesClient) ListOffersResponder(resp *http.Response) (result ListVirtualMachineImageResource, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListPublishers gets a list of virtual machine image publishers for the specified Azure location. -// Parameters: -// location - the name of a supported Azure region. -func (client VirtualMachineImagesClient) ListPublishers(ctx context.Context, location string) (result ListVirtualMachineImageResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineImagesClient.ListPublishers") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListPublishersPreparer(ctx, location) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListPublishers", nil, "Failure preparing request") - return - } - - resp, err := client.ListPublishersSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListPublishers", resp, "Failure sending request") - return - } - - result, err = client.ListPublishersResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListPublishers", resp, "Failure responding to request") - return - } - - return -} - -// ListPublishersPreparer prepares the ListPublishers request. -func (client VirtualMachineImagesClient) ListPublishersPreparer(ctx context.Context, location string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListPublishersSender sends the ListPublishers request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineImagesClient) ListPublishersSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListPublishersResponder handles the response to the ListPublishers request. The method always -// closes the http.Response Body. -func (client VirtualMachineImagesClient) ListPublishersResponder(resp *http.Response) (result ListVirtualMachineImageResource, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListSkus gets a list of virtual machine image SKUs for the specified location, publisher, and offer. -// Parameters: -// location - the name of a supported Azure region. -// publisherName - a valid image publisher. -// offer - a valid image publisher offer. -func (client VirtualMachineImagesClient) ListSkus(ctx context.Context, location string, publisherName string, offer string) (result ListVirtualMachineImageResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineImagesClient.ListSkus") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListSkusPreparer(ctx, location, publisherName, offer) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListSkus", nil, "Failure preparing request") - return - } - - resp, err := client.ListSkusSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListSkus", resp, "Failure sending request") - return - } - - result, err = client.ListSkusResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListSkus", resp, "Failure responding to request") - return - } - - return -} - -// ListSkusPreparer prepares the ListSkus request. -func (client VirtualMachineImagesClient) ListSkusPreparer(ctx context.Context, location string, publisherName string, offer string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "offer": autorest.Encode("path", offer), - "publisherName": autorest.Encode("path", publisherName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSkusSender sends the ListSkus request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineImagesClient) ListSkusSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListSkusResponder handles the response to the ListSkus request. The method always -// closes the http.Response Body. -func (client VirtualMachineImagesClient) ListSkusResponder(resp *http.Response) (result ListVirtualMachineImageResource, err error) { - err = autorest.Respond( - resp, - 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/compute/mgmt/2019-12-01/compute/virtualmachineruncommands.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachineruncommands.go deleted file mode 100644 index 250d8156..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachineruncommands.go +++ /dev/null @@ -1,237 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualMachineRunCommandsClient is the compute Client -type VirtualMachineRunCommandsClient struct { - BaseClient -} - -// NewVirtualMachineRunCommandsClient creates an instance of the VirtualMachineRunCommandsClient client. -func NewVirtualMachineRunCommandsClient(subscriptionID string) VirtualMachineRunCommandsClient { - return NewVirtualMachineRunCommandsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualMachineRunCommandsClientWithBaseURI creates an instance of the VirtualMachineRunCommandsClient client -// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign -// clouds, Azure stack). -func NewVirtualMachineRunCommandsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineRunCommandsClient { - return VirtualMachineRunCommandsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get gets specific run command for a subscription in a location. -// Parameters: -// location - the location upon which run commands is queried. -// commandID - the command id. -func (client VirtualMachineRunCommandsClient) Get(ctx context.Context, location string, commandID string) (result RunCommandDocument, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineRunCommandsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: location, - Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("compute.VirtualMachineRunCommandsClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, location, commandID) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualMachineRunCommandsClient) GetPreparer(ctx context.Context, location string, commandID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "commandId": autorest.Encode("path", commandID), - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/runCommands/{commandId}", 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 VirtualMachineRunCommandsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualMachineRunCommandsClient) GetResponder(resp *http.Response) (result RunCommandDocument, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists all available run commands for a subscription in a location. -// Parameters: -// location - the location upon which run commands is queried. -func (client VirtualMachineRunCommandsClient) List(ctx context.Context, location string) (result RunCommandListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineRunCommandsClient.List") - defer func() { - sc := -1 - if result.rclr.Response.Response != nil { - sc = result.rclr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - 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.NewError("compute.VirtualMachineRunCommandsClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, location) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.rclr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "List", resp, "Failure sending request") - return - } - - result.rclr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "List", resp, "Failure responding to request") - return - } - if result.rclr.hasNextLink() && result.rclr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualMachineRunCommandsClient) ListPreparer(ctx context.Context, location string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/runCommands", 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 VirtualMachineRunCommandsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualMachineRunCommandsClient) ListResponder(resp *http.Response) (result RunCommandListResult, err error) { - err = autorest.Respond( - resp, - 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 VirtualMachineRunCommandsClient) listNextResults(ctx context.Context, lastResults RunCommandListResult) (result RunCommandListResult, err error) { - req, err := lastResults.runCommandListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "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, "compute.VirtualMachineRunCommandsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualMachineRunCommandsClient) ListComplete(ctx context.Context, location string) (result RunCommandListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineRunCommandsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, location) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachines.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachines.go deleted file mode 100644 index c872f43d..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachines.go +++ /dev/null @@ -1,1945 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualMachinesClient is the compute Client -type VirtualMachinesClient struct { - BaseClient -} - -// NewVirtualMachinesClient creates an instance of the VirtualMachinesClient client. -func NewVirtualMachinesClient(subscriptionID string) VirtualMachinesClient { - return NewVirtualMachinesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualMachinesClientWithBaseURI creates an instance of the VirtualMachinesClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewVirtualMachinesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachinesClient { - return VirtualMachinesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Capture captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create -// similar VMs. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -// parameters - parameters supplied to the Capture Virtual Machine operation. -func (client VirtualMachinesClient) Capture(ctx context.Context, resourceGroupName string, VMName string, parameters VirtualMachineCaptureParameters) (result VirtualMachinesCaptureFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Capture") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - 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.NewError("compute.VirtualMachinesClient", "Capture", err.Error()) - } - - req, err := client.CapturePreparer(ctx, resourceGroupName, VMName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Capture", nil, "Failure preparing request") - return - } - - result, err = client.CaptureSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Capture", result.Response(), "Failure sending request") - return - } - - return -} - -// CapturePreparer prepares the Capture request. -func (client VirtualMachinesClient) CapturePreparer(ctx context.Context, resourceGroupName string, VMName string, parameters VirtualMachineCaptureParameters) (*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 = "2019-12-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.Compute/virtualMachines/{vmName}/capture", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CaptureSender sends the Capture request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) CaptureSender(req *http.Request) (future VirtualMachinesCaptureFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CaptureResponder handles the response to the Capture request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) CaptureResponder(resp *http.Response) (result VirtualMachineCaptureResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ConvertToManagedDisks converts virtual machine disks from blob-based to managed disks. Virtual machine must be -// stop-deallocated before invoking this operation.
      For Windows, please refer to [Convert a virtual machine from -// unmanaged disks to managed -// disks.](https://docs.microsoft.com/en-us/azure/virtual-machines/windows/convert-unmanaged-to-managed-disks).
      For -// Linux, please refer to [Convert a virtual machine from unmanaged disks to managed -// disks.](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/convert-unmanaged-to-managed-disks). -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -func (client VirtualMachinesClient) ConvertToManagedDisks(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachinesConvertToManagedDisksFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.ConvertToManagedDisks") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ConvertToManagedDisksPreparer(ctx, resourceGroupName, VMName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ConvertToManagedDisks", nil, "Failure preparing request") - return - } - - result, err = client.ConvertToManagedDisksSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ConvertToManagedDisks", result.Response(), "Failure sending request") - return - } - - return -} - -// ConvertToManagedDisksPreparer prepares the ConvertToManagedDisks request. -func (client VirtualMachinesClient) ConvertToManagedDisksPreparer(ctx context.Context, resourceGroupName string, VMName string) (*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 = "2019-12-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.Compute/virtualMachines/{vmName}/convertToManagedDisks", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ConvertToManagedDisksSender sends the ConvertToManagedDisks request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) ConvertToManagedDisksSender(req *http.Request) (future VirtualMachinesConvertToManagedDisksFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ConvertToManagedDisksResponder handles the response to the ConvertToManagedDisks request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) ConvertToManagedDisksResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// CreateOrUpdate the operation to create or update a virtual machine. Please note some properties can be set only -// during virtual machine creation. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -// parameters - parameters supplied to the Create Virtual Machine operation. -func (client VirtualMachinesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, VMName string, parameters VirtualMachine) (result VirtualMachinesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.VirtualMachineProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineProperties.StorageProfile", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineProperties.StorageProfile.OsDisk", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineProperties.StorageProfile.OsDisk.EncryptionSettings", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineProperties.StorageProfile.OsDisk.EncryptionSettings.DiskEncryptionKey", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineProperties.StorageProfile.OsDisk.EncryptionSettings.DiskEncryptionKey.SecretURL", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.VirtualMachineProperties.StorageProfile.OsDisk.EncryptionSettings.DiskEncryptionKey.SourceVault", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "parameters.VirtualMachineProperties.StorageProfile.OsDisk.EncryptionSettings.KeyEncryptionKey", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineProperties.StorageProfile.OsDisk.EncryptionSettings.KeyEncryptionKey.KeyURL", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.VirtualMachineProperties.StorageProfile.OsDisk.EncryptionSettings.KeyEncryptionKey.SourceVault", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("compute.VirtualMachinesClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, VMName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VirtualMachinesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, VMName string, parameters VirtualMachine) (*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 = "2019-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Resources = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}", 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 VirtualMachinesClient) CreateOrUpdateSender(req *http.Request) (future VirtualMachinesCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualMachine, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Deallocate shuts down the virtual machine and releases the compute resources. You are not billed for the compute -// resources that this virtual machine uses. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -func (client VirtualMachinesClient) Deallocate(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachinesDeallocateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Deallocate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeallocatePreparer(ctx, resourceGroupName, VMName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Deallocate", nil, "Failure preparing request") - return - } - - result, err = client.DeallocateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Deallocate", result.Response(), "Failure sending request") - return - } - - return -} - -// DeallocatePreparer prepares the Deallocate request. -func (client VirtualMachinesClient) DeallocatePreparer(ctx context.Context, resourceGroupName string, VMName string) (*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 = "2019-12-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.Compute/virtualMachines/{vmName}/deallocate", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeallocateSender sends the Deallocate request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) DeallocateSender(req *http.Request) (future VirtualMachinesDeallocateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeallocateResponder handles the response to the Deallocate request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) DeallocateResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Delete the operation to delete a virtual machine. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -func (client VirtualMachinesClient) Delete(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachinesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, VMName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VirtualMachinesClient) DeletePreparer(ctx context.Context, resourceGroupName string, VMName string) (*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 = "2019-12-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.Compute/virtualMachines/{vmName}", 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 VirtualMachinesClient) DeleteSender(req *http.Request) (future VirtualMachinesDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Generalize sets the OS state of the virtual machine to generalized. It is recommended to sysprep the virtual machine -// before performing this operation.
      For Windows, please refer to [Create a managed image of a generalized VM in -// Azure](https://docs.microsoft.com/en-us/azure/virtual-machines/windows/capture-image-resource).
      For Linux, please -// refer to [How to create an image of a virtual machine or -// VHD](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/capture-image). -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -func (client VirtualMachinesClient) Generalize(ctx context.Context, resourceGroupName string, VMName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Generalize") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GeneralizePreparer(ctx, resourceGroupName, VMName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Generalize", nil, "Failure preparing request") - return - } - - resp, err := client.GeneralizeSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Generalize", resp, "Failure sending request") - return - } - - result, err = client.GeneralizeResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Generalize", resp, "Failure responding to request") - return - } - - return -} - -// GeneralizePreparer prepares the Generalize request. -func (client VirtualMachinesClient) GeneralizePreparer(ctx context.Context, resourceGroupName string, VMName string) (*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 = "2019-12-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.Compute/virtualMachines/{vmName}/generalize", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GeneralizeSender sends the Generalize request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) GeneralizeSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GeneralizeResponder handles the response to the Generalize request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) GeneralizeResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieves information about the model view or the instance view of a virtual machine. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -// expand - 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) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, VMName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualMachinesClient) GetPreparer(ctx context.Context, resourceGroupName string, VMName string, expand InstanceViewTypes) (*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 = "2019-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(string(expand)) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}", 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 VirtualMachinesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) GetResponder(resp *http.Response) (result VirtualMachine, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// InstanceView retrieves information about the run-time state of a virtual machine. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -func (client VirtualMachinesClient) InstanceView(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachineInstanceView, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.InstanceView") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.InstanceViewPreparer(ctx, resourceGroupName, VMName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "InstanceView", nil, "Failure preparing request") - return - } - - resp, err := client.InstanceViewSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "InstanceView", resp, "Failure sending request") - return - } - - result, err = client.InstanceViewResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "InstanceView", resp, "Failure responding to request") - return - } - - return -} - -// InstanceViewPreparer prepares the InstanceView request. -func (client VirtualMachinesClient) InstanceViewPreparer(ctx context.Context, resourceGroupName string, VMName string) (*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 = "2019-12-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.Compute/virtualMachines/{vmName}/instanceView", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// InstanceViewSender sends the InstanceView request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) InstanceViewSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// InstanceViewResponder handles the response to the InstanceView request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) InstanceViewResponder(resp *http.Response) (result VirtualMachineInstanceView, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to -// get the next page of virtual machines. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client VirtualMachinesClient) List(ctx context.Context, resourceGroupName string) (result VirtualMachineListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.List") - defer func() { - sc := -1 - if result.vmlr.Response.Response != nil { - sc = result.vmlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.vmlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "List", resp, "Failure sending request") - return - } - - result.vmlr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "List", resp, "Failure responding to request") - return - } - if result.vmlr.hasNextLink() && result.vmlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualMachinesClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-12-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.Compute/virtualMachines", 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 VirtualMachinesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) ListResponder(resp *http.Response) (result VirtualMachineListResult, err error) { - err = autorest.Respond( - resp, - 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 VirtualMachinesClient) listNextResults(ctx context.Context, lastResults VirtualMachineListResult) (result VirtualMachineListResult, err error) { - req, err := lastResults.virtualMachineListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "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, "compute.VirtualMachinesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualMachinesClient) ListComplete(ctx context.Context, resourceGroupName string) (result VirtualMachineListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName) - return -} - -// ListAll lists all of the virtual machines in the specified subscription. Use the nextLink property in the response -// to get the next page of virtual machines. -// Parameters: -// statusOnly - statusOnly=true enables fetching run time status of all Virtual Machines in the subscription. -func (client VirtualMachinesClient) ListAll(ctx context.Context, statusOnly string) (result VirtualMachineListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.ListAll") - defer func() { - sc := -1 - if result.vmlr.Response.Response != nil { - sc = result.vmlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listAllNextResults - req, err := client.ListAllPreparer(ctx, statusOnly) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListAll", nil, "Failure preparing request") - return - } - - resp, err := client.ListAllSender(req) - if err != nil { - result.vmlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListAll", resp, "Failure sending request") - return - } - - result.vmlr, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListAll", resp, "Failure responding to request") - return - } - if result.vmlr.hasNextLink() && result.vmlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListAllPreparer prepares the ListAll request. -func (client VirtualMachinesClient) ListAllPreparer(ctx context.Context, statusOnly string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(statusOnly) > 0 { - queryParameters["statusOnly"] = autorest.Encode("query", statusOnly) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachines", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAllSender sends the ListAll request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) ListAllSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAllResponder handles the response to the ListAll request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) ListAllResponder(resp *http.Response) (result VirtualMachineListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listAllNextResults retrieves the next set of results, if any. -func (client VirtualMachinesClient) listAllNextResults(ctx context.Context, lastResults VirtualMachineListResult) (result VirtualMachineListResult, err error) { - req, err := lastResults.virtualMachineListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "listAllNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListAllSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "listAllNextResults", resp, "Failure sending next results request") - } - result, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "listAllNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListAllComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualMachinesClient) ListAllComplete(ctx context.Context, statusOnly string) (result VirtualMachineListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.ListAll") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListAll(ctx, statusOnly) - return -} - -// ListAvailableSizes lists all available virtual machine sizes to which the specified virtual machine can be resized. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -func (client VirtualMachinesClient) ListAvailableSizes(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachineSizeListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.ListAvailableSizes") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListAvailableSizesPreparer(ctx, resourceGroupName, VMName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListAvailableSizes", nil, "Failure preparing request") - return - } - - resp, err := client.ListAvailableSizesSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListAvailableSizes", resp, "Failure sending request") - return - } - - result, err = client.ListAvailableSizesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListAvailableSizes", resp, "Failure responding to request") - return - } - - return -} - -// ListAvailableSizesPreparer prepares the ListAvailableSizes request. -func (client VirtualMachinesClient) ListAvailableSizesPreparer(ctx context.Context, resourceGroupName string, VMName string) (*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 = "2019-12-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.Compute/virtualMachines/{vmName}/vmSizes", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAvailableSizesSender sends the ListAvailableSizes request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) ListAvailableSizesSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAvailableSizesResponder handles the response to the ListAvailableSizes request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) ListAvailableSizesResponder(resp *http.Response) (result VirtualMachineSizeListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByLocation gets all the virtual machines under the specified subscription for the specified location. -// Parameters: -// location - the location for which virtual machines under the subscription are queried. -func (client VirtualMachinesClient) ListByLocation(ctx context.Context, location string) (result VirtualMachineListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.ListByLocation") - defer func() { - sc := -1 - if result.vmlr.Response.Response != nil { - sc = result.vmlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - 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.NewError("compute.VirtualMachinesClient", "ListByLocation", err.Error()) - } - - result.fn = client.listByLocationNextResults - req, err := client.ListByLocationPreparer(ctx, location) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListByLocation", nil, "Failure preparing request") - return - } - - resp, err := client.ListByLocationSender(req) - if err != nil { - result.vmlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListByLocation", resp, "Failure sending request") - return - } - - result.vmlr, err = client.ListByLocationResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListByLocation", resp, "Failure responding to request") - return - } - if result.vmlr.hasNextLink() && result.vmlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByLocationPreparer prepares the ListByLocation request. -func (client VirtualMachinesClient) ListByLocationPreparer(ctx context.Context, location string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/virtualMachines", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByLocationSender sends the ListByLocation request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) ListByLocationSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByLocationResponder handles the response to the ListByLocation request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) ListByLocationResponder(resp *http.Response) (result VirtualMachineListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByLocationNextResults retrieves the next set of results, if any. -func (client VirtualMachinesClient) listByLocationNextResults(ctx context.Context, lastResults VirtualMachineListResult) (result VirtualMachineListResult, err error) { - req, err := lastResults.virtualMachineListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "listByLocationNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByLocationSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "listByLocationNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByLocationResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "listByLocationNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByLocationComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualMachinesClient) ListByLocationComplete(ctx context.Context, location string) (result VirtualMachineListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.ListByLocation") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByLocation(ctx, location) - return -} - -// PerformMaintenance shuts down the virtual machine, moves it to an already updated node, and powers it back on during -// the self-service phase of planned maintenance. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -func (client VirtualMachinesClient) PerformMaintenance(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachinesPerformMaintenanceFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.PerformMaintenance") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.PerformMaintenancePreparer(ctx, resourceGroupName, VMName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "PerformMaintenance", nil, "Failure preparing request") - return - } - - result, err = client.PerformMaintenanceSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "PerformMaintenance", result.Response(), "Failure sending request") - return - } - - return -} - -// PerformMaintenancePreparer prepares the PerformMaintenance request. -func (client VirtualMachinesClient) PerformMaintenancePreparer(ctx context.Context, resourceGroupName string, VMName string) (*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 = "2019-12-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.Compute/virtualMachines/{vmName}/performMaintenance", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// PerformMaintenanceSender sends the PerformMaintenance request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) PerformMaintenanceSender(req *http.Request) (future VirtualMachinesPerformMaintenanceFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// PerformMaintenanceResponder handles the response to the PerformMaintenance request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) PerformMaintenanceResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// PowerOff the operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same -// provisioned resources. You are still charged for this virtual machine. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -// skipShutdown - the parameter to request non-graceful VM shutdown. True value for this flag indicates -// non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not -// specified -func (client VirtualMachinesClient) PowerOff(ctx context.Context, resourceGroupName string, VMName string, skipShutdown *bool) (result VirtualMachinesPowerOffFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.PowerOff") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.PowerOffPreparer(ctx, resourceGroupName, VMName, skipShutdown) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "PowerOff", nil, "Failure preparing request") - return - } - - result, err = client.PowerOffSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "PowerOff", result.Response(), "Failure sending request") - return - } - - return -} - -// PowerOffPreparer prepares the PowerOff request. -func (client VirtualMachinesClient) PowerOffPreparer(ctx context.Context, resourceGroupName string, VMName string, skipShutdown *bool) (*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 = "2019-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if skipShutdown != nil { - queryParameters["skipShutdown"] = autorest.Encode("query", *skipShutdown) - } else { - queryParameters["skipShutdown"] = autorest.Encode("query", false) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/powerOff", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// PowerOffSender sends the PowerOff request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) PowerOffSender(req *http.Request) (future VirtualMachinesPowerOffFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// PowerOffResponder handles the response to the PowerOff request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) PowerOffResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Reapply the operation to reapply a virtual machine's state. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -func (client VirtualMachinesClient) Reapply(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachinesReapplyFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Reapply") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ReapplyPreparer(ctx, resourceGroupName, VMName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Reapply", nil, "Failure preparing request") - return - } - - result, err = client.ReapplySender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Reapply", result.Response(), "Failure sending request") - return - } - - return -} - -// ReapplyPreparer prepares the Reapply request. -func (client VirtualMachinesClient) ReapplyPreparer(ctx context.Context, resourceGroupName string, VMName string) (*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 = "2019-12-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.Compute/virtualMachines/{vmName}/reapply", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ReapplySender sends the Reapply request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) ReapplySender(req *http.Request) (future VirtualMachinesReapplyFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ReapplyResponder handles the response to the Reapply request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) ReapplyResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Redeploy shuts down the virtual machine, moves it to a new node, and powers it back on. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -func (client VirtualMachinesClient) Redeploy(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachinesRedeployFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Redeploy") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.RedeployPreparer(ctx, resourceGroupName, VMName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Redeploy", nil, "Failure preparing request") - return - } - - result, err = client.RedeploySender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Redeploy", result.Response(), "Failure sending request") - return - } - - return -} - -// RedeployPreparer prepares the Redeploy request. -func (client VirtualMachinesClient) RedeployPreparer(ctx context.Context, resourceGroupName string, VMName string) (*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 = "2019-12-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.Compute/virtualMachines/{vmName}/redeploy", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RedeploySender sends the Redeploy request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) RedeploySender(req *http.Request) (future VirtualMachinesRedeployFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// RedeployResponder handles the response to the Redeploy request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) RedeployResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Reimage reimages the virtual machine which has an ephemeral OS disk back to its initial state. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -// parameters - parameters supplied to the Reimage Virtual Machine operation. -func (client VirtualMachinesClient) Reimage(ctx context.Context, resourceGroupName string, VMName string, parameters *VirtualMachineReimageParameters) (result VirtualMachinesReimageFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Reimage") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ReimagePreparer(ctx, resourceGroupName, VMName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Reimage", nil, "Failure preparing request") - return - } - - result, err = client.ReimageSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Reimage", result.Response(), "Failure sending request") - return - } - - return -} - -// ReimagePreparer prepares the Reimage request. -func (client VirtualMachinesClient) ReimagePreparer(ctx context.Context, resourceGroupName string, VMName string, parameters *VirtualMachineReimageParameters) (*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 = "2019-12-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.Compute/virtualMachines/{vmName}/reimage", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if parameters != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(parameters)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ReimageSender sends the Reimage request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) ReimageSender(req *http.Request) (future VirtualMachinesReimageFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ReimageResponder handles the response to the Reimage request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) ReimageResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Restart the operation to restart a virtual machine. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -func (client VirtualMachinesClient) Restart(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachinesRestartFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Restart") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.RestartPreparer(ctx, resourceGroupName, VMName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Restart", nil, "Failure preparing request") - return - } - - result, err = client.RestartSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Restart", result.Response(), "Failure sending request") - return - } - - return -} - -// RestartPreparer prepares the Restart request. -func (client VirtualMachinesClient) RestartPreparer(ctx context.Context, resourceGroupName string, VMName string) (*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 = "2019-12-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.Compute/virtualMachines/{vmName}/restart", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RestartSender sends the Restart request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) RestartSender(req *http.Request) (future VirtualMachinesRestartFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// RestartResponder handles the response to the Restart request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) RestartResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// RunCommand run command on the VM. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -// parameters - parameters supplied to the Run command operation. -func (client VirtualMachinesClient) RunCommand(ctx context.Context, resourceGroupName string, VMName string, parameters RunCommandInput) (result VirtualMachinesRunCommandFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.RunCommand") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - 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.NewError("compute.VirtualMachinesClient", "RunCommand", err.Error()) - } - - req, err := client.RunCommandPreparer(ctx, resourceGroupName, VMName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "RunCommand", nil, "Failure preparing request") - return - } - - result, err = client.RunCommandSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "RunCommand", result.Response(), "Failure sending request") - return - } - - return -} - -// RunCommandPreparer prepares the RunCommand request. -func (client VirtualMachinesClient) RunCommandPreparer(ctx context.Context, resourceGroupName string, VMName string, parameters RunCommandInput) (*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 = "2019-12-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.Compute/virtualMachines/{vmName}/runCommand", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RunCommandSender sends the RunCommand request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) RunCommandSender(req *http.Request) (future VirtualMachinesRunCommandFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// RunCommandResponder handles the response to the RunCommand request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) RunCommandResponder(resp *http.Response) (result RunCommandResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// SimulateEviction the operation to simulate the eviction of spot virtual machine. The eviction will occur within 30 -// minutes of calling the API -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -func (client VirtualMachinesClient) SimulateEviction(ctx context.Context, resourceGroupName string, VMName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.SimulateEviction") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.SimulateEvictionPreparer(ctx, resourceGroupName, VMName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "SimulateEviction", nil, "Failure preparing request") - return - } - - resp, err := client.SimulateEvictionSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "SimulateEviction", resp, "Failure sending request") - return - } - - result, err = client.SimulateEvictionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "SimulateEviction", resp, "Failure responding to request") - return - } - - return -} - -// SimulateEvictionPreparer prepares the SimulateEviction request. -func (client VirtualMachinesClient) SimulateEvictionPreparer(ctx context.Context, resourceGroupName string, VMName string) (*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 = "2019-12-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.Compute/virtualMachines/{vmName}/simulateEviction", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// SimulateEvictionSender sends the SimulateEviction request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) SimulateEvictionSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// SimulateEvictionResponder handles the response to the SimulateEviction request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) SimulateEvictionResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Start the operation to start a virtual machine. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -func (client VirtualMachinesClient) Start(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachinesStartFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Start") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.StartPreparer(ctx, resourceGroupName, VMName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Start", nil, "Failure preparing request") - return - } - - result, err = client.StartSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Start", result.Response(), "Failure sending request") - return - } - - return -} - -// StartPreparer prepares the Start request. -func (client VirtualMachinesClient) StartPreparer(ctx context.Context, resourceGroupName string, VMName string) (*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 = "2019-12-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.Compute/virtualMachines/{vmName}/start", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// StartSender sends the Start request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) StartSender(req *http.Request) (future VirtualMachinesStartFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// StartResponder handles the response to the Start request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) StartResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Update the operation to update a virtual machine. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -// parameters - 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) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - 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 = "2019-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) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - 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, - 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/2019-12-01/compute/virtualmachinescalesetextensions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinescalesetextensions.go deleted file mode 100644 index c5835208..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinescalesetextensions.go +++ /dev/null @@ -1,483 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualMachineScaleSetExtensionsClient is the compute Client -type VirtualMachineScaleSetExtensionsClient struct { - BaseClient -} - -// NewVirtualMachineScaleSetExtensionsClient creates an instance of the VirtualMachineScaleSetExtensionsClient client. -func NewVirtualMachineScaleSetExtensionsClient(subscriptionID string) VirtualMachineScaleSetExtensionsClient { - return NewVirtualMachineScaleSetExtensionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualMachineScaleSetExtensionsClientWithBaseURI creates an instance of the -// VirtualMachineScaleSetExtensionsClient client using a custom endpoint. Use this when interacting with an Azure -// cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewVirtualMachineScaleSetExtensionsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineScaleSetExtensionsClient { - return VirtualMachineScaleSetExtensionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate the operation to create or update an extension. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set where the extension should be create or updated. -// vmssExtensionName - the name of the VM scale set extension. -// extensionParameters - parameters supplied to the Create VM scale set Extension operation. -func (client VirtualMachineScaleSetExtensionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, VMScaleSetName string, vmssExtensionName string, extensionParameters VirtualMachineScaleSetExtension) (result VirtualMachineScaleSetExtensionsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, VMScaleSetName, vmssExtensionName, extensionParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VirtualMachineScaleSetExtensionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, vmssExtensionName string, extensionParameters VirtualMachineScaleSetExtension) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - "vmssExtensionName": autorest.Encode("path", vmssExtensionName), - } - - const APIVersion = "2019-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - extensionParameters.Type = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}", pathParameters), - autorest.WithJSON(extensionParameters), - 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 VirtualMachineScaleSetExtensionsClient) CreateOrUpdateSender(req *http.Request) (future VirtualMachineScaleSetExtensionsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetExtensionsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualMachineScaleSetExtension, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete the operation to delete the extension. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set where the extension should be deleted. -// vmssExtensionName - the name of the VM scale set extension. -func (client VirtualMachineScaleSetExtensionsClient) Delete(ctx context.Context, resourceGroupName string, VMScaleSetName string, vmssExtensionName string) (result VirtualMachineScaleSetExtensionsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, VMScaleSetName, vmssExtensionName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VirtualMachineScaleSetExtensionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, vmssExtensionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - "vmssExtensionName": autorest.Encode("path", vmssExtensionName), - } - - const APIVersion = "2019-12-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.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}", 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 VirtualMachineScaleSetExtensionsClient) DeleteSender(req *http.Request) (future VirtualMachineScaleSetExtensionsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetExtensionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get the operation to get the extension. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set containing the extension. -// vmssExtensionName - the name of the VM scale set extension. -// expand - 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) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, VMScaleSetName, vmssExtensionName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualMachineScaleSetExtensionsClient) GetPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, vmssExtensionName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - "vmssExtensionName": autorest.Encode("path", vmssExtensionName), - } - - const APIVersion = "2019-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}", 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 VirtualMachineScaleSetExtensionsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetExtensionsClient) GetResponder(resp *http.Response) (result VirtualMachineScaleSetExtension, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets a list of all extensions in a VM scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - 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) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionsClient.List") - defer func() { - sc := -1 - if result.vmsselr.Response.Response != nil { - sc = result.vmsselr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, VMScaleSetName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.vmsselr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "List", resp, "Failure sending request") - return - } - - result.vmsselr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "List", resp, "Failure responding to request") - return - } - if result.vmsselr.hasNextLink() && result.vmsselr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualMachineScaleSetExtensionsClient) ListPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-12-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.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions", 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 VirtualMachineScaleSetExtensionsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetExtensionsClient) ListResponder(resp *http.Response) (result VirtualMachineScaleSetExtensionListResult, err error) { - err = autorest.Respond( - resp, - 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 VirtualMachineScaleSetExtensionsClient) listNextResults(ctx context.Context, lastResults VirtualMachineScaleSetExtensionListResult) (result VirtualMachineScaleSetExtensionListResult, err error) { - req, err := lastResults.virtualMachineScaleSetExtensionListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "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, "compute.VirtualMachineScaleSetExtensionsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualMachineScaleSetExtensionsClient) ListComplete(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetExtensionListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, VMScaleSetName) - return -} - -// Update the operation to update an extension. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set where the extension should be updated. -// vmssExtensionName - the name of the VM scale set extension. -// extensionParameters - parameters supplied to the Update VM scale set Extension operation. -func (client VirtualMachineScaleSetExtensionsClient) Update(ctx context.Context, resourceGroupName string, VMScaleSetName string, vmssExtensionName string, extensionParameters VirtualMachineScaleSetExtensionUpdate) (result VirtualMachineScaleSetExtensionsUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionsClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, VMScaleSetName, vmssExtensionName, extensionParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client VirtualMachineScaleSetExtensionsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, vmssExtensionName string, extensionParameters VirtualMachineScaleSetExtensionUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - "vmssExtensionName": autorest.Encode("path", vmssExtensionName), - } - - const APIVersion = "2019-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - extensionParameters.Name = nil - extensionParameters.Type = nil - 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/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}", pathParameters), - autorest.WithJSON(extensionParameters), - 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 VirtualMachineScaleSetExtensionsClient) UpdateSender(req *http.Request) (future VirtualMachineScaleSetExtensionsUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetExtensionsClient) UpdateResponder(resp *http.Response) (result VirtualMachineScaleSetExtension, err error) { - err = autorest.Respond( - resp, - 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/2019-12-01/compute/virtualmachinescalesetrollingupgrades.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinescalesetrollingupgrades.go deleted file mode 100644 index b0d5b63e..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinescalesetrollingupgrades.go +++ /dev/null @@ -1,346 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualMachineScaleSetRollingUpgradesClient is the compute Client -type VirtualMachineScaleSetRollingUpgradesClient struct { - BaseClient -} - -// NewVirtualMachineScaleSetRollingUpgradesClient creates an instance of the -// VirtualMachineScaleSetRollingUpgradesClient client. -func NewVirtualMachineScaleSetRollingUpgradesClient(subscriptionID string) VirtualMachineScaleSetRollingUpgradesClient { - return NewVirtualMachineScaleSetRollingUpgradesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualMachineScaleSetRollingUpgradesClientWithBaseURI creates an instance of the -// VirtualMachineScaleSetRollingUpgradesClient client using a custom endpoint. Use this when interacting with an Azure -// cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewVirtualMachineScaleSetRollingUpgradesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineScaleSetRollingUpgradesClient { - return VirtualMachineScaleSetRollingUpgradesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Cancel cancels the current virtual machine scale set rolling upgrade. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -func (client VirtualMachineScaleSetRollingUpgradesClient) Cancel(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetRollingUpgradesCancelFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetRollingUpgradesClient.Cancel") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CancelPreparer(ctx, resourceGroupName, VMScaleSetName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "Cancel", nil, "Failure preparing request") - return - } - - result, err = client.CancelSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "Cancel", result.Response(), "Failure sending request") - return - } - - return -} - -// CancelPreparer prepares the Cancel request. -func (client VirtualMachineScaleSetRollingUpgradesClient) CancelPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-12-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.Compute/virtualMachineScaleSets/{vmScaleSetName}/rollingUpgrades/cancel", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CancelSender sends the Cancel request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetRollingUpgradesClient) CancelSender(req *http.Request) (future VirtualMachineScaleSetRollingUpgradesCancelFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CancelResponder handles the response to the Cancel request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetRollingUpgradesClient) CancelResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// GetLatest gets the status of the latest virtual machine scale set rolling upgrade. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -func (client VirtualMachineScaleSetRollingUpgradesClient) GetLatest(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result RollingUpgradeStatusInfo, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetRollingUpgradesClient.GetLatest") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetLatestPreparer(ctx, resourceGroupName, VMScaleSetName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "GetLatest", nil, "Failure preparing request") - return - } - - resp, err := client.GetLatestSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "GetLatest", resp, "Failure sending request") - return - } - - result, err = client.GetLatestResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "GetLatest", resp, "Failure responding to request") - return - } - - return -} - -// GetLatestPreparer prepares the GetLatest request. -func (client VirtualMachineScaleSetRollingUpgradesClient) GetLatestPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-12-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.Compute/virtualMachineScaleSets/{vmScaleSetName}/rollingUpgrades/latest", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetLatestSender sends the GetLatest request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetRollingUpgradesClient) GetLatestSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetLatestResponder handles the response to the GetLatest request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetRollingUpgradesClient) GetLatestResponder(resp *http.Response) (result RollingUpgradeStatusInfo, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// StartExtensionUpgrade starts a rolling upgrade to move all extensions for all virtual machine scale set instances to -// the latest available extension version. Instances which are already running the latest extension versions are not -// affected. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -func (client VirtualMachineScaleSetRollingUpgradesClient) StartExtensionUpgrade(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetRollingUpgradesClient.StartExtensionUpgrade") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.StartExtensionUpgradePreparer(ctx, resourceGroupName, VMScaleSetName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "StartExtensionUpgrade", nil, "Failure preparing request") - return - } - - result, err = client.StartExtensionUpgradeSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "StartExtensionUpgrade", result.Response(), "Failure sending request") - return - } - - return -} - -// StartExtensionUpgradePreparer prepares the StartExtensionUpgrade request. -func (client VirtualMachineScaleSetRollingUpgradesClient) StartExtensionUpgradePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-12-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.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensionRollingUpgrade", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// StartExtensionUpgradeSender sends the StartExtensionUpgrade request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetRollingUpgradesClient) StartExtensionUpgradeSender(req *http.Request) (future VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// StartExtensionUpgradeResponder handles the response to the StartExtensionUpgrade request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetRollingUpgradesClient) StartExtensionUpgradeResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// StartOSUpgrade starts a rolling upgrade to move all virtual machine scale set instances to the latest available -// Platform Image OS version. Instances which are already running the latest available OS version are not affected. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -func (client VirtualMachineScaleSetRollingUpgradesClient) StartOSUpgrade(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetRollingUpgradesClient.StartOSUpgrade") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.StartOSUpgradePreparer(ctx, resourceGroupName, VMScaleSetName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "StartOSUpgrade", nil, "Failure preparing request") - return - } - - result, err = client.StartOSUpgradeSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "StartOSUpgrade", result.Response(), "Failure sending request") - return - } - - return -} - -// StartOSUpgradePreparer prepares the StartOSUpgrade request. -func (client VirtualMachineScaleSetRollingUpgradesClient) StartOSUpgradePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-12-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.Compute/virtualMachineScaleSets/{vmScaleSetName}/osRollingUpgrade", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// StartOSUpgradeSender sends the StartOSUpgrade request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetRollingUpgradesClient) StartOSUpgradeSender(req *http.Request) (future VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// StartOSUpgradeResponder handles the response to the StartOSUpgrade request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetRollingUpgradesClient) StartOSUpgradeResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinescalesets.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinescalesets.go deleted file mode 100644 index a14352bd..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinescalesets.go +++ /dev/null @@ -1,2018 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualMachineScaleSetsClient is the compute Client -type VirtualMachineScaleSetsClient struct { - BaseClient -} - -// NewVirtualMachineScaleSetsClient creates an instance of the VirtualMachineScaleSetsClient client. -func NewVirtualMachineScaleSetsClient(subscriptionID string) VirtualMachineScaleSetsClient { - return NewVirtualMachineScaleSetsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualMachineScaleSetsClientWithBaseURI creates an instance of the VirtualMachineScaleSetsClient client using a -// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, -// Azure stack). -func NewVirtualMachineScaleSetsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineScaleSetsClient { - return VirtualMachineScaleSetsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// ConvertToSinglePlacementGroup converts SinglePlacementGroup property to true for a existing virtual machine scale -// set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the virtual machine scale set to create or update. -// parameters - the input object for ConvertToSinglePlacementGroup API. -func (client VirtualMachineScaleSetsClient) ConvertToSinglePlacementGroup(ctx context.Context, resourceGroupName string, VMScaleSetName string, parameters VMScaleSetConvertToSinglePlacementGroupInput) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.ConvertToSinglePlacementGroup") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ConvertToSinglePlacementGroupPreparer(ctx, resourceGroupName, VMScaleSetName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ConvertToSinglePlacementGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ConvertToSinglePlacementGroupSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ConvertToSinglePlacementGroup", resp, "Failure sending request") - return - } - - result, err = client.ConvertToSinglePlacementGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ConvertToSinglePlacementGroup", resp, "Failure responding to request") - return - } - - return -} - -// ConvertToSinglePlacementGroupPreparer prepares the ConvertToSinglePlacementGroup request. -func (client VirtualMachineScaleSetsClient) ConvertToSinglePlacementGroupPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, parameters VMScaleSetConvertToSinglePlacementGroupInput) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-12-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.Compute/virtualMachineScaleSets/{vmScaleSetName}/convertToSinglePlacementGroup", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ConvertToSinglePlacementGroupSender sends the ConvertToSinglePlacementGroup request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) ConvertToSinglePlacementGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ConvertToSinglePlacementGroupResponder handles the response to the ConvertToSinglePlacementGroup request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) ConvertToSinglePlacementGroupResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// CreateOrUpdate create or update a VM scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set to create or update. -// parameters - the scale set object. -func (client VirtualMachineScaleSetsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, VMScaleSetName string, parameters VirtualMachineScaleSet) (result VirtualMachineScaleSetsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxBatchInstancePercent", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxBatchInstancePercent", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, - {Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxBatchInstancePercent", Name: validation.InclusiveMinimum, Rule: int64(5), Chain: nil}, - }}, - {Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxUnhealthyInstancePercent", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxUnhealthyInstancePercent", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, - {Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxUnhealthyInstancePercent", Name: validation.InclusiveMinimum, Rule: int64(5), Chain: nil}, - }}, - {Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxUnhealthyUpgradedInstancePercent", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxUnhealthyUpgradedInstancePercent", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, - {Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxUnhealthyUpgradedInstancePercent", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, - }}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("compute.VirtualMachineScaleSetsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, VMScaleSetName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VirtualMachineScaleSetsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, parameters VirtualMachineScaleSet) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-12-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.Compute/virtualMachineScaleSets/{vmScaleSetName}", 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 VirtualMachineScaleSetsClient) CreateOrUpdateSender(req *http.Request) (future VirtualMachineScaleSetsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualMachineScaleSet, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// 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. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// VMInstanceIDs - 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) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.Deallocate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeallocatePreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Deallocate", nil, "Failure preparing request") - return - } - - result, err = client.DeallocateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Deallocate", result.Response(), "Failure sending request") - return - } - - return -} - -// DeallocatePreparer prepares the Deallocate request. -func (client VirtualMachineScaleSetsClient) DeallocatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-12-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.Compute/virtualMachineScaleSets/{vmScaleSetName}/deallocate", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if VMInstanceIDs != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(VMInstanceIDs)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeallocateSender sends the Deallocate request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) DeallocateSender(req *http.Request) (future VirtualMachineScaleSetsDeallocateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeallocateResponder handles the response to the Deallocate request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) DeallocateResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Delete deletes a VM scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -func (client VirtualMachineScaleSetsClient) Delete(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, VMScaleSetName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VirtualMachineScaleSetsClient) DeletePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-12-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.Compute/virtualMachineScaleSets/{vmScaleSetName}", 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 VirtualMachineScaleSetsClient) DeleteSender(req *http.Request) (future VirtualMachineScaleSetsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// DeleteInstances deletes virtual machines in a VM scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// VMInstanceIDs - 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 tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.DeleteInstances") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - 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.NewError("compute.VirtualMachineScaleSetsClient", "DeleteInstances", err.Error()) - } - - req, err := client.DeleteInstancesPreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "DeleteInstances", nil, "Failure preparing request") - return - } - - result, err = client.DeleteInstancesSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "DeleteInstances", result.Response(), "Failure sending request") - return - } - - return -} - -// DeleteInstancesPreparer prepares the DeleteInstances request. -func (client VirtualMachineScaleSetsClient) DeleteInstancesPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-12-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.Compute/virtualMachineScaleSets/{vmScaleSetName}/delete", pathParameters), - autorest.WithJSON(VMInstanceIDs), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteInstancesSender sends the DeleteInstances request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) DeleteInstancesSender(req *http.Request) (future VirtualMachineScaleSetsDeleteInstancesFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteInstancesResponder handles the response to the DeleteInstances request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) DeleteInstancesResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// ForceRecoveryServiceFabricPlatformUpdateDomainWalk manual platform update domain walk to update virtual machines in -// a service fabric virtual machine scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// platformUpdateDomain - the platform update domain for which a manual recovery walk is requested -func (client VirtualMachineScaleSetsClient) ForceRecoveryServiceFabricPlatformUpdateDomainWalk(ctx context.Context, resourceGroupName string, VMScaleSetName string, platformUpdateDomain int32) (result RecoveryWalkResponse, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.ForceRecoveryServiceFabricPlatformUpdateDomainWalk") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ForceRecoveryServiceFabricPlatformUpdateDomainWalkPreparer(ctx, resourceGroupName, VMScaleSetName, platformUpdateDomain) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ForceRecoveryServiceFabricPlatformUpdateDomainWalk", nil, "Failure preparing request") - return - } - - resp, err := client.ForceRecoveryServiceFabricPlatformUpdateDomainWalkSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ForceRecoveryServiceFabricPlatformUpdateDomainWalk", resp, "Failure sending request") - return - } - - result, err = client.ForceRecoveryServiceFabricPlatformUpdateDomainWalkResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ForceRecoveryServiceFabricPlatformUpdateDomainWalk", resp, "Failure responding to request") - return - } - - return -} - -// ForceRecoveryServiceFabricPlatformUpdateDomainWalkPreparer prepares the ForceRecoveryServiceFabricPlatformUpdateDomainWalk request. -func (client VirtualMachineScaleSetsClient) ForceRecoveryServiceFabricPlatformUpdateDomainWalkPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, platformUpdateDomain int32) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - "platformUpdateDomain": autorest.Encode("query", platformUpdateDomain), - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/forceRecoveryServiceFabricPlatformUpdateDomainWalk", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ForceRecoveryServiceFabricPlatformUpdateDomainWalkSender sends the ForceRecoveryServiceFabricPlatformUpdateDomainWalk request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) ForceRecoveryServiceFabricPlatformUpdateDomainWalkSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ForceRecoveryServiceFabricPlatformUpdateDomainWalkResponder handles the response to the ForceRecoveryServiceFabricPlatformUpdateDomainWalk request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) ForceRecoveryServiceFabricPlatformUpdateDomainWalkResponder(resp *http.Response) (result RecoveryWalkResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Get display information about a virtual machine scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -func (client VirtualMachineScaleSetsClient) Get(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSet, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, VMScaleSetName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualMachineScaleSetsClient) GetPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-12-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.Compute/virtualMachineScaleSets/{vmScaleSetName}", 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 VirtualMachineScaleSetsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) GetResponder(resp *http.Response) (result VirtualMachineScaleSet, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetInstanceView gets the status of a VM scale set instance. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -func (client VirtualMachineScaleSetsClient) GetInstanceView(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetInstanceView, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.GetInstanceView") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetInstanceViewPreparer(ctx, resourceGroupName, VMScaleSetName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "GetInstanceView", nil, "Failure preparing request") - return - } - - resp, err := client.GetInstanceViewSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "GetInstanceView", resp, "Failure sending request") - return - } - - result, err = client.GetInstanceViewResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "GetInstanceView", resp, "Failure responding to request") - return - } - - return -} - -// GetInstanceViewPreparer prepares the GetInstanceView request. -func (client VirtualMachineScaleSetsClient) GetInstanceViewPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-12-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.Compute/virtualMachineScaleSets/{vmScaleSetName}/instanceView", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetInstanceViewSender sends the GetInstanceView request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) GetInstanceViewSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetInstanceViewResponder handles the response to the GetInstanceView request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) GetInstanceViewResponder(resp *http.Response) (result VirtualMachineScaleSetInstanceView, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetOSUpgradeHistory gets list of OS upgrades on a VM scale set instance. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -func (client VirtualMachineScaleSetsClient) GetOSUpgradeHistory(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetListOSUpgradeHistoryPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.GetOSUpgradeHistory") - defer func() { - sc := -1 - if result.vmsslouh.Response.Response != nil { - sc = result.vmsslouh.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.getOSUpgradeHistoryNextResults - req, err := client.GetOSUpgradeHistoryPreparer(ctx, resourceGroupName, VMScaleSetName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "GetOSUpgradeHistory", nil, "Failure preparing request") - return - } - - resp, err := client.GetOSUpgradeHistorySender(req) - if err != nil { - result.vmsslouh.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "GetOSUpgradeHistory", resp, "Failure sending request") - return - } - - result.vmsslouh, err = client.GetOSUpgradeHistoryResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "GetOSUpgradeHistory", resp, "Failure responding to request") - return - } - if result.vmsslouh.hasNextLink() && result.vmsslouh.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// GetOSUpgradeHistoryPreparer prepares the GetOSUpgradeHistory request. -func (client VirtualMachineScaleSetsClient) GetOSUpgradeHistoryPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-12-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.Compute/virtualMachineScaleSets/{vmScaleSetName}/osUpgradeHistory", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetOSUpgradeHistorySender sends the GetOSUpgradeHistory request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) GetOSUpgradeHistorySender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetOSUpgradeHistoryResponder handles the response to the GetOSUpgradeHistory request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) GetOSUpgradeHistoryResponder(resp *http.Response) (result VirtualMachineScaleSetListOSUpgradeHistory, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// getOSUpgradeHistoryNextResults retrieves the next set of results, if any. -func (client VirtualMachineScaleSetsClient) getOSUpgradeHistoryNextResults(ctx context.Context, lastResults VirtualMachineScaleSetListOSUpgradeHistory) (result VirtualMachineScaleSetListOSUpgradeHistory, err error) { - req, err := lastResults.virtualMachineScaleSetListOSUpgradeHistoryPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "getOSUpgradeHistoryNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.GetOSUpgradeHistorySender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "getOSUpgradeHistoryNextResults", resp, "Failure sending next results request") - } - result, err = client.GetOSUpgradeHistoryResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "getOSUpgradeHistoryNextResults", resp, "Failure responding to next results request") - } - return -} - -// GetOSUpgradeHistoryComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualMachineScaleSetsClient) GetOSUpgradeHistoryComplete(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetListOSUpgradeHistoryIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.GetOSUpgradeHistory") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.GetOSUpgradeHistory(ctx, resourceGroupName, VMScaleSetName) - return -} - -// List gets a list of all VM scale sets under a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client VirtualMachineScaleSetsClient) List(ctx context.Context, resourceGroupName string) (result VirtualMachineScaleSetListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.List") - defer func() { - sc := -1 - if result.vmsslr.Response.Response != nil { - sc = result.vmsslr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.vmsslr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "List", resp, "Failure sending request") - return - } - - result.vmsslr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "List", resp, "Failure responding to request") - return - } - if result.vmsslr.hasNextLink() && result.vmsslr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualMachineScaleSetsClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-12-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.Compute/virtualMachineScaleSets", 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 VirtualMachineScaleSetsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) ListResponder(resp *http.Response) (result VirtualMachineScaleSetListResult, err error) { - err = autorest.Respond( - resp, - 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 VirtualMachineScaleSetsClient) listNextResults(ctx context.Context, lastResults VirtualMachineScaleSetListResult) (result VirtualMachineScaleSetListResult, err error) { - req, err := lastResults.virtualMachineScaleSetListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "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, "compute.VirtualMachineScaleSetsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualMachineScaleSetsClient) ListComplete(ctx context.Context, resourceGroupName string) (result VirtualMachineScaleSetListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName) - return -} - -// ListAll gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use -// nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all -// the VM Scale Sets. -func (client VirtualMachineScaleSetsClient) ListAll(ctx context.Context) (result VirtualMachineScaleSetListWithLinkResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.ListAll") - defer func() { - sc := -1 - if result.vmsslwlr.Response.Response != nil { - sc = result.vmsslwlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listAllNextResults - req, err := client.ListAllPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListAll", nil, "Failure preparing request") - return - } - - resp, err := client.ListAllSender(req) - if err != nil { - result.vmsslwlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListAll", resp, "Failure sending request") - return - } - - result.vmsslwlr, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListAll", resp, "Failure responding to request") - return - } - if result.vmsslwlr.hasNextLink() && result.vmsslwlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListAllPreparer prepares the ListAll request. -func (client VirtualMachineScaleSetsClient) ListAllPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachineScaleSets", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAllSender sends the ListAll request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) ListAllSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAllResponder handles the response to the ListAll request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) ListAllResponder(resp *http.Response) (result VirtualMachineScaleSetListWithLinkResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listAllNextResults retrieves the next set of results, if any. -func (client VirtualMachineScaleSetsClient) listAllNextResults(ctx context.Context, lastResults VirtualMachineScaleSetListWithLinkResult) (result VirtualMachineScaleSetListWithLinkResult, err error) { - req, err := lastResults.virtualMachineScaleSetListWithLinkResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "listAllNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListAllSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "listAllNextResults", resp, "Failure sending next results request") - } - result, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "listAllNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListAllComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualMachineScaleSetsClient) ListAllComplete(ctx context.Context) (result VirtualMachineScaleSetListWithLinkResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.ListAll") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListAll(ctx) - return -} - -// ListSkus gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed -// for each SKU. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -func (client VirtualMachineScaleSetsClient) ListSkus(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetListSkusResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.ListSkus") - defer func() { - sc := -1 - if result.vmsslsr.Response.Response != nil { - sc = result.vmsslsr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listSkusNextResults - req, err := client.ListSkusPreparer(ctx, resourceGroupName, VMScaleSetName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListSkus", nil, "Failure preparing request") - return - } - - resp, err := client.ListSkusSender(req) - if err != nil { - result.vmsslsr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListSkus", resp, "Failure sending request") - return - } - - result.vmsslsr, err = client.ListSkusResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListSkus", resp, "Failure responding to request") - return - } - if result.vmsslsr.hasNextLink() && result.vmsslsr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListSkusPreparer prepares the ListSkus request. -func (client VirtualMachineScaleSetsClient) ListSkusPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-12-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.Compute/virtualMachineScaleSets/{vmScaleSetName}/skus", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSkusSender sends the ListSkus request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) ListSkusSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListSkusResponder handles the response to the ListSkus request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) ListSkusResponder(resp *http.Response) (result VirtualMachineScaleSetListSkusResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listSkusNextResults retrieves the next set of results, if any. -func (client VirtualMachineScaleSetsClient) listSkusNextResults(ctx context.Context, lastResults VirtualMachineScaleSetListSkusResult) (result VirtualMachineScaleSetListSkusResult, err error) { - req, err := lastResults.virtualMachineScaleSetListSkusResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "listSkusNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSkusSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "listSkusNextResults", resp, "Failure sending next results request") - } - result, err = client.ListSkusResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "listSkusNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListSkusComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualMachineScaleSetsClient) ListSkusComplete(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetListSkusResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.ListSkus") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListSkus(ctx, resourceGroupName, VMScaleSetName) - return -} - -// PerformMaintenance perform maintenance on one or more virtual machines in a VM scale set. Operation on instances -// which are not eligible for perform maintenance will be failed. Please refer to best practices for more details: -// https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// VMInstanceIDs - a list of virtual machine instance IDs from the VM scale set. -func (client VirtualMachineScaleSetsClient) PerformMaintenance(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (result VirtualMachineScaleSetsPerformMaintenanceFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.PerformMaintenance") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.PerformMaintenancePreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "PerformMaintenance", nil, "Failure preparing request") - return - } - - result, err = client.PerformMaintenanceSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "PerformMaintenance", result.Response(), "Failure sending request") - return - } - - return -} - -// PerformMaintenancePreparer prepares the PerformMaintenance request. -func (client VirtualMachineScaleSetsClient) PerformMaintenancePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-12-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.Compute/virtualMachineScaleSets/{vmScaleSetName}/performMaintenance", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if VMInstanceIDs != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(VMInstanceIDs)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// PerformMaintenanceSender sends the PerformMaintenance request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) PerformMaintenanceSender(req *http.Request) (future VirtualMachineScaleSetsPerformMaintenanceFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// PerformMaintenanceResponder handles the response to the PerformMaintenance request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) PerformMaintenanceResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// 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. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// VMInstanceIDs - a list of virtual machine instance IDs from the VM scale set. -// skipShutdown - the parameter to request non-graceful VM shutdown. True value for this flag indicates -// non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not -// specified -func (client VirtualMachineScaleSetsClient) PowerOff(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs, skipShutdown *bool) (result VirtualMachineScaleSetsPowerOffFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.PowerOff") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.PowerOffPreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs, skipShutdown) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "PowerOff", nil, "Failure preparing request") - return - } - - result, err = client.PowerOffSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "PowerOff", result.Response(), "Failure sending request") - return - } - - return -} - -// PowerOffPreparer prepares the PowerOff request. -func (client VirtualMachineScaleSetsClient) PowerOffPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs, skipShutdown *bool) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if skipShutdown != nil { - queryParameters["skipShutdown"] = autorest.Encode("query", *skipShutdown) - } else { - queryParameters["skipShutdown"] = autorest.Encode("query", false) - } - - preparer := autorest.CreatePreparer( - 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), - autorest.WithQueryParameters(queryParameters)) - if VMInstanceIDs != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(VMInstanceIDs)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// PowerOffSender sends the PowerOff request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) PowerOffSender(req *http.Request) (future VirtualMachineScaleSetsPowerOffFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// PowerOffResponder handles the response to the PowerOff request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) PowerOffResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Redeploy shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers -// them back on. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// VMInstanceIDs - a list of virtual machine instance IDs from the VM scale set. -func (client VirtualMachineScaleSetsClient) Redeploy(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (result VirtualMachineScaleSetsRedeployFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.Redeploy") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.RedeployPreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Redeploy", nil, "Failure preparing request") - return - } - - result, err = client.RedeploySender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Redeploy", result.Response(), "Failure sending request") - return - } - - return -} - -// RedeployPreparer prepares the Redeploy request. -func (client VirtualMachineScaleSetsClient) RedeployPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-12-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.Compute/virtualMachineScaleSets/{vmScaleSetName}/redeploy", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if VMInstanceIDs != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(VMInstanceIDs)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RedeploySender sends the Redeploy request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) RedeploySender(req *http.Request) (future VirtualMachineScaleSetsRedeployFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// RedeployResponder handles the response to the Redeploy request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) RedeployResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Reimage reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a -// ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// VMScaleSetReimageInput - parameters for Reimaging VM ScaleSet. -func (client VirtualMachineScaleSetsClient) Reimage(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMScaleSetReimageInput *VirtualMachineScaleSetReimageParameters) (result VirtualMachineScaleSetsReimageFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.Reimage") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ReimagePreparer(ctx, resourceGroupName, VMScaleSetName, VMScaleSetReimageInput) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Reimage", nil, "Failure preparing request") - return - } - - result, err = client.ReimageSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Reimage", result.Response(), "Failure sending request") - return - } - - return -} - -// ReimagePreparer prepares the Reimage request. -func (client VirtualMachineScaleSetsClient) ReimagePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMScaleSetReimageInput *VirtualMachineScaleSetReimageParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-12-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.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimage", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if VMScaleSetReimageInput != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(VMScaleSetReimageInput)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ReimageSender sends the Reimage request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) ReimageSender(req *http.Request) (future VirtualMachineScaleSetsReimageFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ReimageResponder handles the response to the Reimage request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) ReimageResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// 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. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// VMInstanceIDs - 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) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.ReimageAll") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ReimageAllPreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ReimageAll", nil, "Failure preparing request") - return - } - - result, err = client.ReimageAllSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ReimageAll", result.Response(), "Failure sending request") - return - } - - return -} - -// ReimageAllPreparer prepares the ReimageAll request. -func (client VirtualMachineScaleSetsClient) ReimageAllPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-12-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.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimageall", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if VMInstanceIDs != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(VMInstanceIDs)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ReimageAllSender sends the ReimageAll request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) ReimageAllSender(req *http.Request) (future VirtualMachineScaleSetsReimageAllFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ReimageAllResponder handles the response to the ReimageAll request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) ReimageAllResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Restart restarts one or more virtual machines in a VM scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// VMInstanceIDs - 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) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.Restart") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.RestartPreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Restart", nil, "Failure preparing request") - return - } - - result, err = client.RestartSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Restart", result.Response(), "Failure sending request") - return - } - - return -} - -// RestartPreparer prepares the Restart request. -func (client VirtualMachineScaleSetsClient) RestartPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-12-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.Compute/virtualMachineScaleSets/{vmScaleSetName}/restart", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if VMInstanceIDs != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(VMInstanceIDs)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RestartSender sends the Restart request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) RestartSender(req *http.Request) (future VirtualMachineScaleSetsRestartFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// RestartResponder handles the response to the Restart request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) RestartResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// SetOrchestrationServiceState changes ServiceState property for a given service -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the virtual machine scale set to create or update. -// parameters - the input object for SetOrchestrationServiceState API. -func (client VirtualMachineScaleSetsClient) SetOrchestrationServiceState(ctx context.Context, resourceGroupName string, VMScaleSetName string, parameters OrchestrationServiceStateInput) (result VirtualMachineScaleSetsSetOrchestrationServiceStateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.SetOrchestrationServiceState") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.SetOrchestrationServiceStatePreparer(ctx, resourceGroupName, VMScaleSetName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "SetOrchestrationServiceState", nil, "Failure preparing request") - return - } - - result, err = client.SetOrchestrationServiceStateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "SetOrchestrationServiceState", result.Response(), "Failure sending request") - return - } - - return -} - -// SetOrchestrationServiceStatePreparer prepares the SetOrchestrationServiceState request. -func (client VirtualMachineScaleSetsClient) SetOrchestrationServiceStatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, parameters OrchestrationServiceStateInput) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-12-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.Compute/virtualMachineScaleSets/{vmScaleSetName}/setOrchestrationServiceState", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// SetOrchestrationServiceStateSender sends the SetOrchestrationServiceState request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) SetOrchestrationServiceStateSender(req *http.Request) (future VirtualMachineScaleSetsSetOrchestrationServiceStateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// SetOrchestrationServiceStateResponder handles the response to the SetOrchestrationServiceState request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) SetOrchestrationServiceStateResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Start starts one or more virtual machines in a VM scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// VMInstanceIDs - 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) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.Start") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.StartPreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Start", nil, "Failure preparing request") - return - } - - result, err = client.StartSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Start", result.Response(), "Failure sending request") - return - } - - return -} - -// StartPreparer prepares the Start request. -func (client VirtualMachineScaleSetsClient) StartPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-12-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.Compute/virtualMachineScaleSets/{vmScaleSetName}/start", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if VMInstanceIDs != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(VMInstanceIDs)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// StartSender sends the Start request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) StartSender(req *http.Request) (future VirtualMachineScaleSetsStartFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// StartResponder handles the response to the Start request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) StartResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Update update a VM scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set to create or update. -// parameters - the scale set object. -func (client VirtualMachineScaleSetsClient) Update(ctx context.Context, resourceGroupName string, VMScaleSetName string, parameters VirtualMachineScaleSetUpdate) (result VirtualMachineScaleSetsUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, VMScaleSetName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client VirtualMachineScaleSetsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, parameters VirtualMachineScaleSetUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-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/virtualMachineScaleSets/{vmScaleSetName}", 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 VirtualMachineScaleSetsClient) UpdateSender(req *http.Request) (future VirtualMachineScaleSetsUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) UpdateResponder(resp *http.Response) (result VirtualMachineScaleSet, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// UpdateInstances upgrades one or more virtual machines to the latest SKU set in the VM scale set model. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// VMInstanceIDs - 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 tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.UpdateInstances") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - 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.NewError("compute.VirtualMachineScaleSetsClient", "UpdateInstances", err.Error()) - } - - req, err := client.UpdateInstancesPreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "UpdateInstances", nil, "Failure preparing request") - return - } - - result, err = client.UpdateInstancesSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "UpdateInstances", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdateInstancesPreparer prepares the UpdateInstances request. -func (client VirtualMachineScaleSetsClient) UpdateInstancesPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-12-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.Compute/virtualMachineScaleSets/{vmScaleSetName}/manualupgrade", pathParameters), - autorest.WithJSON(VMInstanceIDs), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateInstancesSender sends the UpdateInstances request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) UpdateInstancesSender(req *http.Request) (future VirtualMachineScaleSetsUpdateInstancesFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateInstancesResponder handles the response to the UpdateInstances request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) UpdateInstancesResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinescalesetvmextensions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinescalesetvmextensions.go deleted file mode 100644 index d028fd0f..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinescalesetvmextensions.go +++ /dev/null @@ -1,453 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualMachineScaleSetVMExtensionsClient is the compute Client -type VirtualMachineScaleSetVMExtensionsClient struct { - BaseClient -} - -// NewVirtualMachineScaleSetVMExtensionsClient creates an instance of the VirtualMachineScaleSetVMExtensionsClient -// client. -func NewVirtualMachineScaleSetVMExtensionsClient(subscriptionID string) VirtualMachineScaleSetVMExtensionsClient { - return NewVirtualMachineScaleSetVMExtensionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualMachineScaleSetVMExtensionsClientWithBaseURI creates an instance of the -// VirtualMachineScaleSetVMExtensionsClient client using a custom endpoint. Use this when interacting with an Azure -// cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewVirtualMachineScaleSetVMExtensionsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineScaleSetVMExtensionsClient { - return VirtualMachineScaleSetVMExtensionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate the operation to create or update the VMSS VM extension. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -// VMExtensionName - the name of the virtual machine extension. -// extensionParameters - parameters supplied to the Create Virtual Machine Extension operation. -func (client VirtualMachineScaleSetVMExtensionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string, extensionParameters VirtualMachineExtension) (result VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMExtensionsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, VMExtensionName, extensionParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VirtualMachineScaleSetVMExtensionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string, extensionParameters VirtualMachineExtension) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmExtensionName": autorest.Encode("path", VMExtensionName), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-12-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.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}", pathParameters), - autorest.WithJSON(extensionParameters), - 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 VirtualMachineScaleSetVMExtensionsClient) CreateOrUpdateSender(req *http.Request) (future VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMExtensionsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualMachineExtension, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete the operation to delete the VMSS VM extension. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -// VMExtensionName - the name of the virtual machine extension. -func (client VirtualMachineScaleSetVMExtensionsClient) Delete(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string) (result VirtualMachineScaleSetVMExtensionsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMExtensionsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, VMExtensionName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VirtualMachineScaleSetVMExtensionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmExtensionName": autorest.Encode("path", VMExtensionName), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-12-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.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}", 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 VirtualMachineScaleSetVMExtensionsClient) DeleteSender(req *http.Request) (future VirtualMachineScaleSetVMExtensionsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMExtensionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get the operation to get the VMSS VM extension. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -// VMExtensionName - the name of the virtual machine extension. -// expand - the expand expression to apply on the operation. -func (client VirtualMachineScaleSetVMExtensionsClient) Get(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string, expand string) (result VirtualMachineExtension, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMExtensionsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, VMExtensionName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualMachineScaleSetVMExtensionsClient) GetPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmExtensionName": autorest.Encode("path", VMExtensionName), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}", 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 VirtualMachineScaleSetVMExtensionsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMExtensionsClient) GetResponder(resp *http.Response) (result VirtualMachineExtension, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List the operation to get all extensions of an instance in Virtual Machine Scaleset. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -// expand - the expand expression to apply on the operation. -func (client VirtualMachineScaleSetVMExtensionsClient) List(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, expand string) (result VirtualMachineExtensionsListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMExtensionsClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "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.VirtualMachineScaleSetVMExtensionsClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualMachineScaleSetVMExtensionsClient) ListPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions", 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 VirtualMachineScaleSetVMExtensionsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMExtensionsClient) ListResponder(resp *http.Response) (result VirtualMachineExtensionsListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Update the operation to update the VMSS VM extension. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -// VMExtensionName - the name of the virtual machine extension. -// extensionParameters - parameters supplied to the Update Virtual Machine Extension operation. -func (client VirtualMachineScaleSetVMExtensionsClient) Update(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string, extensionParameters VirtualMachineExtensionUpdate) (result VirtualMachineScaleSetVMExtensionsUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMExtensionsClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, VMExtensionName, extensionParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client VirtualMachineScaleSetVMExtensionsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string, extensionParameters VirtualMachineExtensionUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmExtensionName": autorest.Encode("path", VMExtensionName), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-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/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}", pathParameters), - autorest.WithJSON(extensionParameters), - 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 VirtualMachineScaleSetVMExtensionsClient) UpdateSender(req *http.Request) (future VirtualMachineScaleSetVMExtensionsUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMExtensionsClient) UpdateResponder(resp *http.Response) (result VirtualMachineExtension, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinescalesetvms.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinescalesetvms.go deleted file mode 100644 index 3f5dcbfa..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinescalesetvms.go +++ /dev/null @@ -1,1341 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualMachineScaleSetVMsClient is the compute Client -type VirtualMachineScaleSetVMsClient struct { - BaseClient -} - -// NewVirtualMachineScaleSetVMsClient creates an instance of the VirtualMachineScaleSetVMsClient client. -func NewVirtualMachineScaleSetVMsClient(subscriptionID string) VirtualMachineScaleSetVMsClient { - return NewVirtualMachineScaleSetVMsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualMachineScaleSetVMsClientWithBaseURI creates an instance of the VirtualMachineScaleSetVMsClient client -// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign -// clouds, Azure stack). -func NewVirtualMachineScaleSetVMsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineScaleSetVMsClient { - return VirtualMachineScaleSetVMsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Deallocate deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the -// compute resources it uses. You are not billed for the compute resources of this virtual machine once it is -// deallocated. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -func (client VirtualMachineScaleSetVMsClient) Deallocate(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMsDeallocateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.Deallocate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeallocatePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Deallocate", nil, "Failure preparing request") - return - } - - result, err = client.DeallocateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Deallocate", result.Response(), "Failure sending request") - return - } - - return -} - -// DeallocatePreparer prepares the Deallocate request. -func (client VirtualMachineScaleSetVMsClient) DeallocatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-12-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.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/deallocate", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeallocateSender sends the Deallocate request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetVMsClient) DeallocateSender(req *http.Request) (future VirtualMachineScaleSetVMsDeallocateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeallocateResponder handles the response to the Deallocate request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMsClient) DeallocateResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Delete deletes a virtual machine from a VM scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -func (client VirtualMachineScaleSetVMsClient) Delete(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VirtualMachineScaleSetVMsClient) DeletePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-12-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.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}", 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 VirtualMachineScaleSetVMsClient) DeleteSender(req *http.Request) (future VirtualMachineScaleSetVMsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets a virtual machine from a VM scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -// expand - the expand expression to apply on the operation. -func (client VirtualMachineScaleSetVMsClient) Get(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, expand InstanceViewTypes) (result VirtualMachineScaleSetVM, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualMachineScaleSetVMsClient) GetPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, expand InstanceViewTypes) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(string(expand)) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}", 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 VirtualMachineScaleSetVMsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMsClient) GetResponder(resp *http.Response) (result VirtualMachineScaleSetVM, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetInstanceView gets the status of a virtual machine from a VM scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -func (client VirtualMachineScaleSetVMsClient) GetInstanceView(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMInstanceView, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.GetInstanceView") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetInstanceViewPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "GetInstanceView", nil, "Failure preparing request") - return - } - - resp, err := client.GetInstanceViewSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "GetInstanceView", resp, "Failure sending request") - return - } - - result, err = client.GetInstanceViewResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "GetInstanceView", resp, "Failure responding to request") - return - } - - return -} - -// GetInstanceViewPreparer prepares the GetInstanceView request. -func (client VirtualMachineScaleSetVMsClient) GetInstanceViewPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-12-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.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/instanceView", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetInstanceViewSender sends the GetInstanceView request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetVMsClient) GetInstanceViewSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetInstanceViewResponder handles the response to the GetInstanceView request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMsClient) GetInstanceViewResponder(resp *http.Response) (result VirtualMachineScaleSetVMInstanceView, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets a list of all virtual machines in a VM scale sets. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualMachineScaleSetName - the name of the VM scale set. -// filter - the filter to apply to the operation. Allowed values are 'startswith(instanceView/statuses/code, -// 'PowerState') eq true', 'properties/latestModelApplied eq true', 'properties/latestModelApplied eq false'. -// selectParameter - the list parameters. Allowed values are 'instanceView', 'instanceView/statuses'. -// expand - the expand expression to apply to the operation. Allowed values are 'instanceView'. -func (client VirtualMachineScaleSetVMsClient) List(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, filter string, selectParameter string, expand string) (result VirtualMachineScaleSetVMListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.List") - defer func() { - sc := -1 - if result.vmssvlr.Response.Response != nil { - sc = result.vmssvlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, virtualMachineScaleSetName, filter, selectParameter, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.vmssvlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "List", resp, "Failure sending request") - return - } - - result.vmssvlr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "List", resp, "Failure responding to request") - return - } - if result.vmssvlr.hasNextLink() && result.vmssvlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualMachineScaleSetVMsClient) ListPreparer(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, filter string, selectParameter string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualMachineScaleSetName": autorest.Encode("path", virtualMachineScaleSetName), - } - - const APIVersion = "2019-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines", 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 VirtualMachineScaleSetVMsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMsClient) ListResponder(resp *http.Response) (result VirtualMachineScaleSetVMListResult, err error) { - err = autorest.Respond( - resp, - 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 VirtualMachineScaleSetVMsClient) listNextResults(ctx context.Context, lastResults VirtualMachineScaleSetVMListResult) (result VirtualMachineScaleSetVMListResult, err error) { - req, err := lastResults.virtualMachineScaleSetVMListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "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, "compute.VirtualMachineScaleSetVMsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualMachineScaleSetVMsClient) ListComplete(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, filter string, selectParameter string, expand string) (result VirtualMachineScaleSetVMListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, virtualMachineScaleSetName, filter, selectParameter, expand) - return -} - -// PerformMaintenance shuts down the virtual machine in a VMScaleSet, moves it to an already updated node, and powers -// it back on during the self-service phase of planned maintenance. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -func (client VirtualMachineScaleSetVMsClient) PerformMaintenance(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMsPerformMaintenanceFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.PerformMaintenance") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.PerformMaintenancePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "PerformMaintenance", nil, "Failure preparing request") - return - } - - result, err = client.PerformMaintenanceSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "PerformMaintenance", result.Response(), "Failure sending request") - return - } - - return -} - -// PerformMaintenancePreparer prepares the PerformMaintenance request. -func (client VirtualMachineScaleSetVMsClient) PerformMaintenancePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-12-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.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/performMaintenance", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// PerformMaintenanceSender sends the PerformMaintenance request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetVMsClient) PerformMaintenanceSender(req *http.Request) (future VirtualMachineScaleSetVMsPerformMaintenanceFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// PerformMaintenanceResponder handles the response to the PerformMaintenance request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMsClient) PerformMaintenanceResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// 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. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -// skipShutdown - the parameter to request non-graceful VM shutdown. True value for this flag indicates -// non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not -// specified -func (client VirtualMachineScaleSetVMsClient) PowerOff(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, skipShutdown *bool) (result VirtualMachineScaleSetVMsPowerOffFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.PowerOff") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.PowerOffPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, skipShutdown) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "PowerOff", nil, "Failure preparing request") - return - } - - result, err = client.PowerOffSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "PowerOff", result.Response(), "Failure sending request") - return - } - - return -} - -// PowerOffPreparer prepares the PowerOff request. -func (client VirtualMachineScaleSetVMsClient) PowerOffPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, skipShutdown *bool) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if skipShutdown != nil { - queryParameters["skipShutdown"] = autorest.Encode("query", *skipShutdown) - } else { - queryParameters["skipShutdown"] = autorest.Encode("query", false) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/poweroff", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// PowerOffSender sends the PowerOff request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetVMsClient) PowerOffSender(req *http.Request) (future VirtualMachineScaleSetVMsPowerOffFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// PowerOffResponder handles the response to the PowerOff request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMsClient) PowerOffResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Redeploy shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back -// on. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -func (client VirtualMachineScaleSetVMsClient) Redeploy(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMsRedeployFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.Redeploy") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.RedeployPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Redeploy", nil, "Failure preparing request") - return - } - - result, err = client.RedeploySender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Redeploy", result.Response(), "Failure sending request") - return - } - - return -} - -// RedeployPreparer prepares the Redeploy request. -func (client VirtualMachineScaleSetVMsClient) RedeployPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-12-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.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/redeploy", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RedeploySender sends the Redeploy request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetVMsClient) RedeploySender(req *http.Request) (future VirtualMachineScaleSetVMsRedeployFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// RedeployResponder handles the response to the Redeploy request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMsClient) RedeployResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Reimage reimages (upgrade the operating system) a specific virtual machine in a VM scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -// VMScaleSetVMReimageInput - parameters for the Reimaging Virtual machine in ScaleSet. -func (client VirtualMachineScaleSetVMsClient) Reimage(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMScaleSetVMReimageInput *VirtualMachineScaleSetVMReimageParameters) (result VirtualMachineScaleSetVMsReimageFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.Reimage") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ReimagePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, VMScaleSetVMReimageInput) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Reimage", nil, "Failure preparing request") - return - } - - result, err = client.ReimageSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Reimage", result.Response(), "Failure sending request") - return - } - - return -} - -// ReimagePreparer prepares the Reimage request. -func (client VirtualMachineScaleSetVMsClient) ReimagePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMScaleSetVMReimageInput *VirtualMachineScaleSetVMReimageParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-12-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.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/reimage", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if VMScaleSetVMReimageInput != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(VMScaleSetVMReimageInput)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ReimageSender sends the Reimage request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetVMsClient) ReimageSender(req *http.Request) (future VirtualMachineScaleSetVMsReimageFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ReimageResponder handles the response to the Reimage request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMsClient) ReimageResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// 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. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -func (client VirtualMachineScaleSetVMsClient) ReimageAll(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMsReimageAllFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.ReimageAll") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ReimageAllPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "ReimageAll", nil, "Failure preparing request") - return - } - - result, err = client.ReimageAllSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "ReimageAll", result.Response(), "Failure sending request") - return - } - - return -} - -// ReimageAllPreparer prepares the ReimageAll request. -func (client VirtualMachineScaleSetVMsClient) ReimageAllPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-12-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.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/reimageall", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ReimageAllSender sends the ReimageAll request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetVMsClient) ReimageAllSender(req *http.Request) (future VirtualMachineScaleSetVMsReimageAllFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ReimageAllResponder handles the response to the ReimageAll request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMsClient) ReimageAllResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Restart restarts a virtual machine in a VM scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -func (client VirtualMachineScaleSetVMsClient) Restart(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMsRestartFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.Restart") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.RestartPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Restart", nil, "Failure preparing request") - return - } - - result, err = client.RestartSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Restart", result.Response(), "Failure sending request") - return - } - - return -} - -// RestartPreparer prepares the Restart request. -func (client VirtualMachineScaleSetVMsClient) RestartPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-12-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.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/restart", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RestartSender sends the Restart request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetVMsClient) RestartSender(req *http.Request) (future VirtualMachineScaleSetVMsRestartFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// RestartResponder handles the response to the Restart request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMsClient) RestartResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// RunCommand run command on a virtual machine in a VM scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -// parameters - parameters supplied to the Run command operation. -func (client VirtualMachineScaleSetVMsClient) RunCommand(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, parameters RunCommandInput) (result VirtualMachineScaleSetVMsRunCommandFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.RunCommand") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - 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.NewError("compute.VirtualMachineScaleSetVMsClient", "RunCommand", err.Error()) - } - - req, err := client.RunCommandPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "RunCommand", nil, "Failure preparing request") - return - } - - result, err = client.RunCommandSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "RunCommand", result.Response(), "Failure sending request") - return - } - - return -} - -// RunCommandPreparer prepares the RunCommand request. -func (client VirtualMachineScaleSetVMsClient) RunCommandPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, parameters RunCommandInput) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-12-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.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/runCommand", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RunCommandSender sends the RunCommand request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetVMsClient) RunCommandSender(req *http.Request) (future VirtualMachineScaleSetVMsRunCommandFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// RunCommandResponder handles the response to the RunCommand request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMsClient) RunCommandResponder(resp *http.Response) (result RunCommandResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// SimulateEviction the operation to simulate the eviction of spot virtual machine in a VM scale set. The eviction will -// occur within 30 minutes of calling the API -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -func (client VirtualMachineScaleSetVMsClient) SimulateEviction(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.SimulateEviction") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.SimulateEvictionPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "SimulateEviction", nil, "Failure preparing request") - return - } - - resp, err := client.SimulateEvictionSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "SimulateEviction", resp, "Failure sending request") - return - } - - result, err = client.SimulateEvictionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "SimulateEviction", resp, "Failure responding to request") - return - } - - return -} - -// SimulateEvictionPreparer prepares the SimulateEviction request. -func (client VirtualMachineScaleSetVMsClient) SimulateEvictionPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-12-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.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/simulateEviction", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// SimulateEvictionSender sends the SimulateEviction request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetVMsClient) SimulateEvictionSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// SimulateEvictionResponder handles the response to the SimulateEviction request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMsClient) SimulateEvictionResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Start starts a virtual machine in a VM scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -func (client VirtualMachineScaleSetVMsClient) Start(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMsStartFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.Start") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.StartPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Start", nil, "Failure preparing request") - return - } - - result, err = client.StartSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Start", result.Response(), "Failure sending request") - return - } - - return -} - -// StartPreparer prepares the Start request. -func (client VirtualMachineScaleSetVMsClient) StartPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-12-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.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/start", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// StartSender sends the Start request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetVMsClient) StartSender(req *http.Request) (future VirtualMachineScaleSetVMsStartFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// StartResponder handles the response to the Start request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMsClient) StartResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Update updates a virtual machine of a VM scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set where the extension should be create or updated. -// instanceID - the instance ID of the virtual machine. -// parameters - parameters supplied to the Update Virtual Machine Scale Sets VM operation. -func (client VirtualMachineScaleSetVMsClient) Update(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, parameters VirtualMachineScaleSetVM) (result VirtualMachineScaleSetVMsUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetVMProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetVMProperties.StorageProfile", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetVMProperties.StorageProfile.OsDisk", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetVMProperties.StorageProfile.OsDisk.EncryptionSettings", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetVMProperties.StorageProfile.OsDisk.EncryptionSettings.DiskEncryptionKey", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetVMProperties.StorageProfile.OsDisk.EncryptionSettings.DiskEncryptionKey.SecretURL", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.VirtualMachineScaleSetVMProperties.StorageProfile.OsDisk.EncryptionSettings.DiskEncryptionKey.SourceVault", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "parameters.VirtualMachineScaleSetVMProperties.StorageProfile.OsDisk.EncryptionSettings.KeyEncryptionKey", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetVMProperties.StorageProfile.OsDisk.EncryptionSettings.KeyEncryptionKey.KeyURL", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.VirtualMachineScaleSetVMProperties.StorageProfile.OsDisk.EncryptionSettings.KeyEncryptionKey.SourceVault", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("compute.VirtualMachineScaleSetVMsClient", "Update", err.Error()) - } - - req, err := client.UpdatePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client VirtualMachineScaleSetVMsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, parameters VirtualMachineScaleSetVM) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.InstanceID = nil - parameters.Sku = nil - parameters.Resources = nil - parameters.Zones = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}", 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 VirtualMachineScaleSetVMsClient) UpdateSender(req *http.Request) (future VirtualMachineScaleSetVMsUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMsClient) UpdateResponder(resp *http.Response) (result VirtualMachineScaleSetVM, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - 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/2019-12-01/compute/virtualmachinesizes.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinesizes.go deleted file mode 100644 index caa2b60e..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinesizes.go +++ /dev/null @@ -1,114 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualMachineSizesClient is the compute Client -type VirtualMachineSizesClient struct { - BaseClient -} - -// NewVirtualMachineSizesClient creates an instance of the VirtualMachineSizesClient client. -func NewVirtualMachineSizesClient(subscriptionID string) VirtualMachineSizesClient { - return NewVirtualMachineSizesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualMachineSizesClientWithBaseURI creates an instance of the VirtualMachineSizesClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewVirtualMachineSizesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineSizesClient { - return VirtualMachineSizesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List this API is deprecated. Use [Resources -// Skus](https://docs.microsoft.com/en-us/rest/api/compute/resourceskus/list) -// Parameters: -// location - the location upon which virtual-machine-sizes is queried. -func (client VirtualMachineSizesClient) List(ctx context.Context, location string) (result VirtualMachineSizeListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineSizesClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: location, - Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("compute.VirtualMachineSizesClient", "List", err.Error()) - } - - req, err := client.ListPreparer(ctx, location) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineSizesClient", "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.VirtualMachineSizesClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineSizesClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualMachineSizesClient) ListPreparer(ctx context.Context, location string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/vmSizes", 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 VirtualMachineSizesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualMachineSizesClient) ListResponder(resp *http.Response) (result VirtualMachineSizeListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/CHANGELOG.md b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/CHANGELOG.md deleted file mode 100644 index 52911e4c..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Change History - diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/_meta.json b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/_meta.json deleted file mode 100644 index 2af6e17d..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/_meta.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commit": "dad644cc6d0c88991f291eda37e18f27c16739b2", - "readme": "/_/azure-rest-api-specs/specification/compute/resource-manager/readme.md", - "tag": "package-2022-08-01", - "use": "@microsoft.azure/autorest.go@2.1.188", - "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.188 --tag=package-2022-08-01 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION --debug /_/azure-rest-api-specs/specification/compute/resource-manager/readme.md", - "additional_properties": { - "additional_options": "--go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION --debug" - } -} \ No newline at end of file diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/availabilitysets.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/availabilitysets.go deleted file mode 100644 index 90fce14e..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/availabilitysets.go +++ /dev/null @@ -1,652 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// AvailabilitySetsClient is the compute Client -type AvailabilitySetsClient struct { - BaseClient -} - -// NewAvailabilitySetsClient creates an instance of the AvailabilitySetsClient client. -func NewAvailabilitySetsClient(subscriptionID string) AvailabilitySetsClient { - return NewAvailabilitySetsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewAvailabilitySetsClientWithBaseURI creates an instance of the AvailabilitySetsClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewAvailabilitySetsClientWithBaseURI(baseURI string, subscriptionID string) AvailabilitySetsClient { - return AvailabilitySetsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create or update an availability set. -// Parameters: -// resourceGroupName - the name of the resource group. -// availabilitySetName - the name of the availability set. -// parameters - parameters supplied to the Create Availability Set operation. -func (client AvailabilitySetsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, availabilitySetName string, parameters AvailabilitySet) (result AvailabilitySet, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, availabilitySetName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "CreateOrUpdate", resp, "Failure responding to request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client AvailabilitySetsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, availabilitySetName string, parameters AvailabilitySet) (*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 = "2022-08-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.Compute/availabilitySets/{availabilitySetName}", 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 AvailabilitySetsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client AvailabilitySetsClient) CreateOrUpdateResponder(resp *http.Response) (result AvailabilitySet, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete an availability set. -// Parameters: -// resourceGroupName - the name of the resource group. -// availabilitySetName - the name of the availability set. -func (client AvailabilitySetsClient) Delete(ctx context.Context, resourceGroupName string, availabilitySetName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, availabilitySetName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Delete", resp, "Failure responding to request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client AvailabilitySetsClient) DeletePreparer(ctx context.Context, resourceGroupName string, availabilitySetName string) (*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 = "2022-08-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.Compute/availabilitySets/{availabilitySetName}", 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 AvailabilitySetsClient) DeleteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client AvailabilitySetsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieves information about an availability set. -// Parameters: -// resourceGroupName - the name of the resource group. -// availabilitySetName - the name of the availability set. -func (client AvailabilitySetsClient) Get(ctx context.Context, resourceGroupName string, availabilitySetName string) (result AvailabilitySet, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, availabilitySetName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client AvailabilitySetsClient) GetPreparer(ctx context.Context, resourceGroupName string, availabilitySetName string) (*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 = "2022-08-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.Compute/availabilitySets/{availabilitySetName}", 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 AvailabilitySetsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client AvailabilitySetsClient) GetResponder(resp *http.Response) (result AvailabilitySet, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists all availability sets in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client AvailabilitySetsClient) List(ctx context.Context, resourceGroupName string) (result AvailabilitySetListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.List") - defer func() { - sc := -1 - if result.aslr.Response.Response != nil { - sc = result.aslr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.aslr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "List", resp, "Failure sending request") - return - } - - result.aslr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "List", resp, "Failure responding to request") - return - } - if result.aslr.hasNextLink() && result.aslr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client AvailabilitySetsClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-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.Compute/availabilitySets", 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 AvailabilitySetsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client AvailabilitySetsClient) ListResponder(resp *http.Response) (result AvailabilitySetListResult, err error) { - err = autorest.Respond( - resp, - 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 AvailabilitySetsClient) listNextResults(ctx context.Context, lastResults AvailabilitySetListResult) (result AvailabilitySetListResult, err error) { - req, err := lastResults.availabilitySetListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "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, "compute.AvailabilitySetsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client AvailabilitySetsClient) ListComplete(ctx context.Context, resourceGroupName string) (result AvailabilitySetListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName) - return -} - -// ListAvailableSizes lists all available virtual machine sizes that can be used to create a new virtual machine in an -// existing availability set. -// Parameters: -// resourceGroupName - the name of the resource group. -// availabilitySetName - the name of the availability set. -func (client AvailabilitySetsClient) ListAvailableSizes(ctx context.Context, resourceGroupName string, availabilitySetName string) (result VirtualMachineSizeListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.ListAvailableSizes") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListAvailableSizesPreparer(ctx, resourceGroupName, availabilitySetName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListAvailableSizes", nil, "Failure preparing request") - return - } - - resp, err := client.ListAvailableSizesSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListAvailableSizes", resp, "Failure sending request") - return - } - - result, err = client.ListAvailableSizesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListAvailableSizes", resp, "Failure responding to request") - return - } - - return -} - -// ListAvailableSizesPreparer prepares the ListAvailableSizes request. -func (client AvailabilitySetsClient) ListAvailableSizesPreparer(ctx context.Context, resourceGroupName string, availabilitySetName string) (*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 = "2022-08-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.Compute/availabilitySets/{availabilitySetName}/vmSizes", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAvailableSizesSender sends the ListAvailableSizes request. The method will close the -// http.Response Body if it receives an error. -func (client AvailabilitySetsClient) ListAvailableSizesSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAvailableSizesResponder handles the response to the ListAvailableSizes request. The method always -// closes the http.Response Body. -func (client AvailabilitySetsClient) ListAvailableSizesResponder(resp *http.Response) (result VirtualMachineSizeListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListBySubscription lists all availability sets in a subscription. -// Parameters: -// expand - the expand expression to apply to the operation. Allowed values are 'instanceView'. -func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context, expand string) (result AvailabilitySetListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.ListBySubscription") - defer func() { - sc := -1 - if result.aslr.Response.Response != nil { - sc = result.aslr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listBySubscriptionNextResults - req, err := client.ListBySubscriptionPreparer(ctx, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListBySubscription", nil, "Failure preparing request") - return - } - - resp, err := client.ListBySubscriptionSender(req) - if err != nil { - result.aslr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListBySubscription", resp, "Failure sending request") - return - } - - result.aslr, err = client.ListBySubscriptionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListBySubscription", resp, "Failure responding to request") - return - } - if result.aslr.hasNextLink() && result.aslr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListBySubscriptionPreparer prepares the ListBySubscription request. -func (client AvailabilitySetsClient) ListBySubscriptionPreparer(ctx context.Context, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/availabilitySets", 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 AvailabilitySetsClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always -// closes the http.Response Body. -func (client AvailabilitySetsClient) ListBySubscriptionResponder(resp *http.Response) (result AvailabilitySetListResult, err error) { - err = autorest.Respond( - resp, - 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 AvailabilitySetsClient) listBySubscriptionNextResults(ctx context.Context, lastResults AvailabilitySetListResult) (result AvailabilitySetListResult, err error) { - req, err := lastResults.availabilitySetListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "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, "compute.AvailabilitySetsClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") - } - result, err = client.ListBySubscriptionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. -func (client AvailabilitySetsClient) ListBySubscriptionComplete(ctx context.Context, expand string) (result AvailabilitySetListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.ListBySubscription") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListBySubscription(ctx, expand) - return -} - -// Update update an availability set. -// Parameters: -// resourceGroupName - the name of the resource group. -// availabilitySetName - the name of the availability set. -// parameters - 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) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.Update") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - 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 - } - - 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 = "2022-08-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 client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client AvailabilitySetsClient) UpdateResponder(resp *http.Response) (result AvailabilitySet, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/capacityreservationgroups.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/capacityreservationgroups.go deleted file mode 100644 index b8d39801..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/capacityreservationgroups.go +++ /dev/null @@ -1,596 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// CapacityReservationGroupsClient is the compute Client -type CapacityReservationGroupsClient struct { - BaseClient -} - -// NewCapacityReservationGroupsClient creates an instance of the CapacityReservationGroupsClient client. -func NewCapacityReservationGroupsClient(subscriptionID string) CapacityReservationGroupsClient { - return NewCapacityReservationGroupsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewCapacityReservationGroupsClientWithBaseURI creates an instance of the CapacityReservationGroupsClient client -// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign -// clouds, Azure stack). -func NewCapacityReservationGroupsClientWithBaseURI(baseURI string, subscriptionID string) CapacityReservationGroupsClient { - return CapacityReservationGroupsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate the operation to create or update a capacity reservation group. When updating a capacity reservation -// group, only tags may be modified. Please refer to https://aka.ms/CapacityReservation for more details. -// Parameters: -// resourceGroupName - the name of the resource group. -// capacityReservationGroupName - the name of the capacity reservation group. -// parameters - parameters supplied to the Create capacity reservation Group. -func (client CapacityReservationGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, parameters CapacityReservationGroup) (result CapacityReservationGroup, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CapacityReservationGroupsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, capacityReservationGroupName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "CreateOrUpdate", resp, "Failure responding to request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client CapacityReservationGroupsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, parameters CapacityReservationGroup) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "capacityReservationGroupName": autorest.Encode("path", capacityReservationGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-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.Compute/capacityReservationGroups/{capacityReservationGroupName}", 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 CapacityReservationGroupsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client CapacityReservationGroupsClient) CreateOrUpdateResponder(resp *http.Response) (result CapacityReservationGroup, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete the operation to delete a capacity reservation group. This operation is allowed only if all the associated -// resources are disassociated from the reservation group and all capacity reservations under the reservation group -// have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. -// Parameters: -// resourceGroupName - the name of the resource group. -// capacityReservationGroupName - the name of the capacity reservation group. -func (client CapacityReservationGroupsClient) Delete(ctx context.Context, resourceGroupName string, capacityReservationGroupName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CapacityReservationGroupsClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, capacityReservationGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "Delete", resp, "Failure responding to request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client CapacityReservationGroupsClient) DeletePreparer(ctx context.Context, resourceGroupName string, capacityReservationGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "capacityReservationGroupName": autorest.Encode("path", capacityReservationGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-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.Compute/capacityReservationGroups/{capacityReservationGroupName}", 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 CapacityReservationGroupsClient) DeleteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client CapacityReservationGroupsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get the operation that retrieves information about a capacity reservation group. -// Parameters: -// resourceGroupName - the name of the resource group. -// capacityReservationGroupName - the name of the capacity reservation group. -// expand - the expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance -// views of the capacity reservations under the capacity reservation group which is a snapshot of the runtime -// properties of a capacity reservation that is managed by the platform and can change outside of control plane -// operations. -func (client CapacityReservationGroupsClient) Get(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, expand CapacityReservationGroupInstanceViewTypes) (result CapacityReservationGroup, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CapacityReservationGroupsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, capacityReservationGroupName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client CapacityReservationGroupsClient) GetPreparer(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, expand CapacityReservationGroupInstanceViewTypes) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "capacityReservationGroupName": autorest.Encode("path", capacityReservationGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(string(expand)) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}", 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 CapacityReservationGroupsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client CapacityReservationGroupsClient) GetResponder(resp *http.Response) (result CapacityReservationGroup, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByResourceGroup lists all of the capacity reservation groups in the specified resource group. Use the nextLink -// property in the response to get the next page of capacity reservation groups. -// Parameters: -// resourceGroupName - the name of the resource group. -// expand - the expand expression to apply on the operation. Based on the expand param(s) specified we return -// Virtual Machine or ScaleSet VM Instance or both resource Ids which are associated to capacity reservation -// group in the response. -func (client CapacityReservationGroupsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, expand ExpandTypesForGetCapacityReservationGroups) (result CapacityReservationGroupListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CapacityReservationGroupsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.crglr.Response.Response != nil { - sc = result.crglr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.crglr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.crglr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.crglr.hasNextLink() && result.crglr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client CapacityReservationGroupsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string, expand ExpandTypesForGetCapacityReservationGroups) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(string(expand)) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups", pathParameters), - autorest.WithQueryParameters(queryParameters)) - 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 CapacityReservationGroupsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client CapacityReservationGroupsClient) ListByResourceGroupResponder(resp *http.Response) (result CapacityReservationGroupListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client CapacityReservationGroupsClient) listByResourceGroupNextResults(ctx context.Context, lastResults CapacityReservationGroupListResult) (result CapacityReservationGroupListResult, err error) { - req, err := lastResults.capacityReservationGroupListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client CapacityReservationGroupsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, expand ExpandTypesForGetCapacityReservationGroups) (result CapacityReservationGroupListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CapacityReservationGroupsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName, expand) - return -} - -// ListBySubscription lists all of the capacity reservation groups in the subscription. Use the nextLink property in -// the response to get the next page of capacity reservation groups. -// Parameters: -// expand - the expand expression to apply on the operation. Based on the expand param(s) specified we return -// Virtual Machine or ScaleSet VM Instance or both resource Ids which are associated to capacity reservation -// group in the response. -func (client CapacityReservationGroupsClient) ListBySubscription(ctx context.Context, expand ExpandTypesForGetCapacityReservationGroups) (result CapacityReservationGroupListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CapacityReservationGroupsClient.ListBySubscription") - defer func() { - sc := -1 - if result.crglr.Response.Response != nil { - sc = result.crglr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listBySubscriptionNextResults - req, err := client.ListBySubscriptionPreparer(ctx, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "ListBySubscription", nil, "Failure preparing request") - return - } - - resp, err := client.ListBySubscriptionSender(req) - if err != nil { - result.crglr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "ListBySubscription", resp, "Failure sending request") - return - } - - result.crglr, err = client.ListBySubscriptionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "ListBySubscription", resp, "Failure responding to request") - return - } - if result.crglr.hasNextLink() && result.crglr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListBySubscriptionPreparer prepares the ListBySubscription request. -func (client CapacityReservationGroupsClient) ListBySubscriptionPreparer(ctx context.Context, expand ExpandTypesForGetCapacityReservationGroups) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(string(expand)) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/capacityReservationGroups", 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 CapacityReservationGroupsClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always -// closes the http.Response Body. -func (client CapacityReservationGroupsClient) ListBySubscriptionResponder(resp *http.Response) (result CapacityReservationGroupListResult, err error) { - err = autorest.Respond( - resp, - 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 CapacityReservationGroupsClient) listBySubscriptionNextResults(ctx context.Context, lastResults CapacityReservationGroupListResult) (result CapacityReservationGroupListResult, err error) { - req, err := lastResults.capacityReservationGroupListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "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, "compute.CapacityReservationGroupsClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") - } - result, err = client.ListBySubscriptionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. -func (client CapacityReservationGroupsClient) ListBySubscriptionComplete(ctx context.Context, expand ExpandTypesForGetCapacityReservationGroups) (result CapacityReservationGroupListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CapacityReservationGroupsClient.ListBySubscription") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListBySubscription(ctx, expand) - return -} - -// Update the operation to update a capacity reservation group. When updating a capacity reservation group, only tags -// may be modified. -// Parameters: -// resourceGroupName - the name of the resource group. -// capacityReservationGroupName - the name of the capacity reservation group. -// parameters - parameters supplied to the Update capacity reservation Group operation. -func (client CapacityReservationGroupsClient) Update(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, parameters CapacityReservationGroupUpdate) (result CapacityReservationGroup, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CapacityReservationGroupsClient.Update") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, capacityReservationGroupName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "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.CapacityReservationGroupsClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "Update", resp, "Failure responding to request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client CapacityReservationGroupsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, parameters CapacityReservationGroupUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "capacityReservationGroupName": autorest.Encode("path", capacityReservationGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-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/capacityReservationGroups/{capacityReservationGroupName}", 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 CapacityReservationGroupsClient) UpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client CapacityReservationGroupsClient) UpdateResponder(resp *http.Response) (result CapacityReservationGroup, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/capacityreservations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/capacityreservations.go deleted file mode 100644 index d8f7e2ca..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/capacityreservations.go +++ /dev/null @@ -1,493 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// CapacityReservationsClient is the compute Client -type CapacityReservationsClient struct { - BaseClient -} - -// NewCapacityReservationsClient creates an instance of the CapacityReservationsClient client. -func NewCapacityReservationsClient(subscriptionID string) CapacityReservationsClient { - return NewCapacityReservationsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewCapacityReservationsClientWithBaseURI creates an instance of the CapacityReservationsClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewCapacityReservationsClientWithBaseURI(baseURI string, subscriptionID string) CapacityReservationsClient { - return CapacityReservationsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate the operation to create or update a capacity reservation. Please note some properties can be set only -// during capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. -// Parameters: -// resourceGroupName - the name of the resource group. -// capacityReservationGroupName - the name of the capacity reservation group. -// capacityReservationName - the name of the capacity reservation. -// parameters - parameters supplied to the Create capacity reservation. -func (client CapacityReservationsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, parameters CapacityReservation) (result CapacityReservationsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CapacityReservationsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.Sku", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("compute.CapacityReservationsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CapacityReservationsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CapacityReservationsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client CapacityReservationsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, parameters CapacityReservation) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "capacityReservationGroupName": autorest.Encode("path", capacityReservationGroupName), - "capacityReservationName": autorest.Encode("path", capacityReservationName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-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.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName}", 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 CapacityReservationsClient) CreateOrUpdateSender(req *http.Request) (future CapacityReservationsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client CapacityReservationsClient) CreateOrUpdateResponder(resp *http.Response) (result CapacityReservation, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete the operation to delete a capacity reservation. This operation is allowed only when all the associated -// resources are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for -// more details. -// Parameters: -// resourceGroupName - the name of the resource group. -// capacityReservationGroupName - the name of the capacity reservation group. -// capacityReservationName - the name of the capacity reservation. -func (client CapacityReservationsClient) Delete(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string) (result CapacityReservationsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CapacityReservationsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, capacityReservationGroupName, capacityReservationName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CapacityReservationsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CapacityReservationsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client CapacityReservationsClient) DeletePreparer(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "capacityReservationGroupName": autorest.Encode("path", capacityReservationGroupName), - "capacityReservationName": autorest.Encode("path", capacityReservationName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-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.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName}", 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 CapacityReservationsClient) DeleteSender(req *http.Request) (future CapacityReservationsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client CapacityReservationsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get the operation that retrieves information about the capacity reservation. -// Parameters: -// resourceGroupName - the name of the resource group. -// capacityReservationGroupName - the name of the capacity reservation group. -// capacityReservationName - the name of the capacity reservation. -// expand - the expand expression to apply on the operation. 'InstanceView' retrieves a snapshot of the runtime -// properties of the capacity reservation that is managed by the platform and can change outside of control -// plane operations. -func (client CapacityReservationsClient) Get(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, expand CapacityReservationInstanceViewTypes) (result CapacityReservation, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CapacityReservationsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, capacityReservationGroupName, capacityReservationName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CapacityReservationsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.CapacityReservationsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CapacityReservationsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client CapacityReservationsClient) GetPreparer(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, expand CapacityReservationInstanceViewTypes) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "capacityReservationGroupName": autorest.Encode("path", capacityReservationGroupName), - "capacityReservationName": autorest.Encode("path", capacityReservationName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(string(expand)) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName}", 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 CapacityReservationsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client CapacityReservationsClient) GetResponder(resp *http.Response) (result CapacityReservation, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByCapacityReservationGroup lists all of the capacity reservations in the specified capacity reservation group. -// Use the nextLink property in the response to get the next page of capacity reservations. -// Parameters: -// resourceGroupName - the name of the resource group. -// capacityReservationGroupName - the name of the capacity reservation group. -func (client CapacityReservationsClient) ListByCapacityReservationGroup(ctx context.Context, resourceGroupName string, capacityReservationGroupName string) (result CapacityReservationListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CapacityReservationsClient.ListByCapacityReservationGroup") - defer func() { - sc := -1 - if result.crlr.Response.Response != nil { - sc = result.crlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByCapacityReservationGroupNextResults - req, err := client.ListByCapacityReservationGroupPreparer(ctx, resourceGroupName, capacityReservationGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CapacityReservationsClient", "ListByCapacityReservationGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByCapacityReservationGroupSender(req) - if err != nil { - result.crlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.CapacityReservationsClient", "ListByCapacityReservationGroup", resp, "Failure sending request") - return - } - - result.crlr, err = client.ListByCapacityReservationGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CapacityReservationsClient", "ListByCapacityReservationGroup", resp, "Failure responding to request") - return - } - if result.crlr.hasNextLink() && result.crlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByCapacityReservationGroupPreparer prepares the ListByCapacityReservationGroup request. -func (client CapacityReservationsClient) ListByCapacityReservationGroupPreparer(ctx context.Context, resourceGroupName string, capacityReservationGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "capacityReservationGroupName": autorest.Encode("path", capacityReservationGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-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.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByCapacityReservationGroupSender sends the ListByCapacityReservationGroup request. The method will close the -// http.Response Body if it receives an error. -func (client CapacityReservationsClient) ListByCapacityReservationGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByCapacityReservationGroupResponder handles the response to the ListByCapacityReservationGroup request. The method always -// closes the http.Response Body. -func (client CapacityReservationsClient) ListByCapacityReservationGroupResponder(resp *http.Response) (result CapacityReservationListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByCapacityReservationGroupNextResults retrieves the next set of results, if any. -func (client CapacityReservationsClient) listByCapacityReservationGroupNextResults(ctx context.Context, lastResults CapacityReservationListResult) (result CapacityReservationListResult, err error) { - req, err := lastResults.capacityReservationListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.CapacityReservationsClient", "listByCapacityReservationGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByCapacityReservationGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.CapacityReservationsClient", "listByCapacityReservationGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByCapacityReservationGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CapacityReservationsClient", "listByCapacityReservationGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByCapacityReservationGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client CapacityReservationsClient) ListByCapacityReservationGroupComplete(ctx context.Context, resourceGroupName string, capacityReservationGroupName string) (result CapacityReservationListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CapacityReservationsClient.ListByCapacityReservationGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByCapacityReservationGroup(ctx, resourceGroupName, capacityReservationGroupName) - return -} - -// Update the operation to update a capacity reservation. -// Parameters: -// resourceGroupName - the name of the resource group. -// capacityReservationGroupName - the name of the capacity reservation group. -// capacityReservationName - the name of the capacity reservation. -// parameters - parameters supplied to the Update capacity reservation operation. -func (client CapacityReservationsClient) Update(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, parameters CapacityReservationUpdate) (result CapacityReservationsUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CapacityReservationsClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CapacityReservationsClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CapacityReservationsClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client CapacityReservationsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, parameters CapacityReservationUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "capacityReservationGroupName": autorest.Encode("path", capacityReservationGroupName), - "capacityReservationName": autorest.Encode("path", capacityReservationName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-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/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName}", 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 CapacityReservationsClient) UpdateSender(req *http.Request) (future CapacityReservationsUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client CapacityReservationsClient) UpdateResponder(resp *http.Response) (result CapacityReservation, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - 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/2022-08-01/compute/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/client.go deleted file mode 100644 index c7c45431..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/client.go +++ /dev/null @@ -1,43 +0,0 @@ -// Deprecated: Please note, this package has been deprecated. A replacement package is available [github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute). We strongly encourage you to upgrade to continue receiving updates. See [Migration Guide](https://aka.ms/azsdk/golang/t2/migration) for guidance on upgrading. Refer to our [deprecation policy](https://azure.github.io/azure-sdk/policies_support.html) for more details. -// -// Package compute implements the Azure ARM Compute service API version . -// -// Compute Client -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "github.com/Azure/go-autorest/autorest" -) - -const ( - // DefaultBaseURI is the default URI used for the service Compute - DefaultBaseURI = "https://management.azure.com" -) - -// BaseClient is the base client for Compute. -type BaseClient struct { - autorest.Client - BaseURI string - SubscriptionID string -} - -// New creates an instance of the BaseClient client. -func New(subscriptionID string) BaseClient { - return NewWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewWithBaseURI creates an instance of the BaseClient client using a custom endpoint. Use this when interacting with -// an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func 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/compute/mgmt/2022-08-01/compute/cloudserviceoperatingsystems.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/cloudserviceoperatingsystems.go deleted file mode 100644 index 31ee54e5..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/cloudserviceoperatingsystems.go +++ /dev/null @@ -1,422 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// CloudServiceOperatingSystemsClient is the compute Client -type CloudServiceOperatingSystemsClient struct { - BaseClient -} - -// NewCloudServiceOperatingSystemsClient creates an instance of the CloudServiceOperatingSystemsClient client. -func NewCloudServiceOperatingSystemsClient(subscriptionID string) CloudServiceOperatingSystemsClient { - return NewCloudServiceOperatingSystemsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewCloudServiceOperatingSystemsClientWithBaseURI creates an instance of the CloudServiceOperatingSystemsClient -// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI -// (sovereign clouds, Azure stack). -func NewCloudServiceOperatingSystemsClientWithBaseURI(baseURI string, subscriptionID string) CloudServiceOperatingSystemsClient { - return CloudServiceOperatingSystemsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// GetOSFamily gets properties of a guest operating system family that can be specified in the XML service -// configuration (.cscfg) for a cloud service. -// Parameters: -// location - name of the location that the OS family pertains to. -// osFamilyName - name of the OS family. -func (client CloudServiceOperatingSystemsClient) GetOSFamily(ctx context.Context, location string, osFamilyName string) (result OSFamily, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceOperatingSystemsClient.GetOSFamily") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetOSFamilyPreparer(ctx, location, osFamilyName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceOperatingSystemsClient", "GetOSFamily", nil, "Failure preparing request") - return - } - - resp, err := client.GetOSFamilySender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.CloudServiceOperatingSystemsClient", "GetOSFamily", resp, "Failure sending request") - return - } - - result, err = client.GetOSFamilyResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceOperatingSystemsClient", "GetOSFamily", resp, "Failure responding to request") - return - } - - return -} - -// GetOSFamilyPreparer prepares the GetOSFamily request. -func (client CloudServiceOperatingSystemsClient) GetOSFamilyPreparer(ctx context.Context, location string, osFamilyName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "osFamilyName": autorest.Encode("path", osFamilyName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-04-04" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/cloudServiceOsFamilies/{osFamilyName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetOSFamilySender sends the GetOSFamily request. The method will close the -// http.Response Body if it receives an error. -func (client CloudServiceOperatingSystemsClient) GetOSFamilySender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetOSFamilyResponder handles the response to the GetOSFamily request. The method always -// closes the http.Response Body. -func (client CloudServiceOperatingSystemsClient) GetOSFamilyResponder(resp *http.Response) (result OSFamily, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetOSVersion gets properties of a guest operating system version that can be specified in the XML service -// configuration (.cscfg) for a cloud service. -// Parameters: -// location - name of the location that the OS version pertains to. -// osVersionName - name of the OS version. -func (client CloudServiceOperatingSystemsClient) GetOSVersion(ctx context.Context, location string, osVersionName string) (result OSVersion, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceOperatingSystemsClient.GetOSVersion") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetOSVersionPreparer(ctx, location, osVersionName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceOperatingSystemsClient", "GetOSVersion", nil, "Failure preparing request") - return - } - - resp, err := client.GetOSVersionSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.CloudServiceOperatingSystemsClient", "GetOSVersion", resp, "Failure sending request") - return - } - - result, err = client.GetOSVersionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceOperatingSystemsClient", "GetOSVersion", resp, "Failure responding to request") - return - } - - return -} - -// GetOSVersionPreparer prepares the GetOSVersion request. -func (client CloudServiceOperatingSystemsClient) GetOSVersionPreparer(ctx context.Context, location string, osVersionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "osVersionName": autorest.Encode("path", osVersionName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-04-04" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/cloudServiceOsVersions/{osVersionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetOSVersionSender sends the GetOSVersion request. The method will close the -// http.Response Body if it receives an error. -func (client CloudServiceOperatingSystemsClient) GetOSVersionSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetOSVersionResponder handles the response to the GetOSVersion request. The method always -// closes the http.Response Body. -func (client CloudServiceOperatingSystemsClient) GetOSVersionResponder(resp *http.Response) (result OSVersion, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListOSFamilies gets a list of all guest operating system families available to be specified in the XML service -// configuration (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS -// Families. Do this till nextLink is null to fetch all the OS Families. -// Parameters: -// location - name of the location that the OS families pertain to. -func (client CloudServiceOperatingSystemsClient) ListOSFamilies(ctx context.Context, location string) (result OSFamilyListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceOperatingSystemsClient.ListOSFamilies") - defer func() { - sc := -1 - if result.oflr.Response.Response != nil { - sc = result.oflr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listOSFamiliesNextResults - req, err := client.ListOSFamiliesPreparer(ctx, location) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceOperatingSystemsClient", "ListOSFamilies", nil, "Failure preparing request") - return - } - - resp, err := client.ListOSFamiliesSender(req) - if err != nil { - result.oflr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.CloudServiceOperatingSystemsClient", "ListOSFamilies", resp, "Failure sending request") - return - } - - result.oflr, err = client.ListOSFamiliesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceOperatingSystemsClient", "ListOSFamilies", resp, "Failure responding to request") - return - } - if result.oflr.hasNextLink() && result.oflr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListOSFamiliesPreparer prepares the ListOSFamilies request. -func (client CloudServiceOperatingSystemsClient) ListOSFamiliesPreparer(ctx context.Context, location string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-04-04" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/cloudServiceOsFamilies", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListOSFamiliesSender sends the ListOSFamilies request. The method will close the -// http.Response Body if it receives an error. -func (client CloudServiceOperatingSystemsClient) ListOSFamiliesSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListOSFamiliesResponder handles the response to the ListOSFamilies request. The method always -// closes the http.Response Body. -func (client CloudServiceOperatingSystemsClient) ListOSFamiliesResponder(resp *http.Response) (result OSFamilyListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listOSFamiliesNextResults retrieves the next set of results, if any. -func (client CloudServiceOperatingSystemsClient) listOSFamiliesNextResults(ctx context.Context, lastResults OSFamilyListResult) (result OSFamilyListResult, err error) { - req, err := lastResults.oSFamilyListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.CloudServiceOperatingSystemsClient", "listOSFamiliesNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListOSFamiliesSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.CloudServiceOperatingSystemsClient", "listOSFamiliesNextResults", resp, "Failure sending next results request") - } - result, err = client.ListOSFamiliesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceOperatingSystemsClient", "listOSFamiliesNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListOSFamiliesComplete enumerates all values, automatically crossing page boundaries as required. -func (client CloudServiceOperatingSystemsClient) ListOSFamiliesComplete(ctx context.Context, location string) (result OSFamilyListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceOperatingSystemsClient.ListOSFamilies") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListOSFamilies(ctx, location) - return -} - -// ListOSVersions gets a list of all guest operating system versions available to be specified in the XML service -// configuration (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS -// versions. Do this till nextLink is null to fetch all the OS versions. -// Parameters: -// location - name of the location that the OS versions pertain to. -func (client CloudServiceOperatingSystemsClient) ListOSVersions(ctx context.Context, location string) (result OSVersionListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceOperatingSystemsClient.ListOSVersions") - defer func() { - sc := -1 - if result.ovlr.Response.Response != nil { - sc = result.ovlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listOSVersionsNextResults - req, err := client.ListOSVersionsPreparer(ctx, location) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceOperatingSystemsClient", "ListOSVersions", nil, "Failure preparing request") - return - } - - resp, err := client.ListOSVersionsSender(req) - if err != nil { - result.ovlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.CloudServiceOperatingSystemsClient", "ListOSVersions", resp, "Failure sending request") - return - } - - result.ovlr, err = client.ListOSVersionsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceOperatingSystemsClient", "ListOSVersions", resp, "Failure responding to request") - return - } - if result.ovlr.hasNextLink() && result.ovlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListOSVersionsPreparer prepares the ListOSVersions request. -func (client CloudServiceOperatingSystemsClient) ListOSVersionsPreparer(ctx context.Context, location string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-04-04" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/cloudServiceOsVersions", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListOSVersionsSender sends the ListOSVersions request. The method will close the -// http.Response Body if it receives an error. -func (client CloudServiceOperatingSystemsClient) ListOSVersionsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListOSVersionsResponder handles the response to the ListOSVersions request. The method always -// closes the http.Response Body. -func (client CloudServiceOperatingSystemsClient) ListOSVersionsResponder(resp *http.Response) (result OSVersionListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listOSVersionsNextResults retrieves the next set of results, if any. -func (client CloudServiceOperatingSystemsClient) listOSVersionsNextResults(ctx context.Context, lastResults OSVersionListResult) (result OSVersionListResult, err error) { - req, err := lastResults.oSVersionListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.CloudServiceOperatingSystemsClient", "listOSVersionsNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListOSVersionsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.CloudServiceOperatingSystemsClient", "listOSVersionsNextResults", resp, "Failure sending next results request") - } - result, err = client.ListOSVersionsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceOperatingSystemsClient", "listOSVersionsNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListOSVersionsComplete enumerates all values, automatically crossing page boundaries as required. -func (client CloudServiceOperatingSystemsClient) ListOSVersionsComplete(ctx context.Context, location string) (result OSVersionListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceOperatingSystemsClient.ListOSVersions") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListOSVersions(ctx, location) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/cloudserviceroleinstances.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/cloudserviceroleinstances.go deleted file mode 100644 index f29213d9..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/cloudserviceroleinstances.go +++ /dev/null @@ -1,715 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// CloudServiceRoleInstancesClient is the compute Client -type CloudServiceRoleInstancesClient struct { - BaseClient -} - -// NewCloudServiceRoleInstancesClient creates an instance of the CloudServiceRoleInstancesClient client. -func NewCloudServiceRoleInstancesClient(subscriptionID string) CloudServiceRoleInstancesClient { - return NewCloudServiceRoleInstancesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewCloudServiceRoleInstancesClientWithBaseURI creates an instance of the CloudServiceRoleInstancesClient client -// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign -// clouds, Azure stack). -func NewCloudServiceRoleInstancesClientWithBaseURI(baseURI string, subscriptionID string) CloudServiceRoleInstancesClient { - return CloudServiceRoleInstancesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Delete deletes a role instance from a cloud service. -// Parameters: -// roleInstanceName - name of the role instance. -// resourceGroupName - name of the resource group. -// cloudServiceName - name of the cloud service. -func (client CloudServiceRoleInstancesClient) Delete(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string) (result CloudServiceRoleInstancesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceRoleInstancesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, roleInstanceName, resourceGroupName, cloudServiceName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client CloudServiceRoleInstancesClient) DeletePreparer(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "cloudServiceName": autorest.Encode("path", cloudServiceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "roleInstanceName": autorest.Encode("path", roleInstanceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-04-04" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}", 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 CloudServiceRoleInstancesClient) DeleteSender(req *http.Request) (future CloudServiceRoleInstancesDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client CloudServiceRoleInstancesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets a role instance from a cloud service. -// Parameters: -// roleInstanceName - name of the role instance. -// resourceGroupName - name of the resource group. -// cloudServiceName - name of the cloud service. -// expand - the expand expression to apply to the operation. 'UserData' is not supported for cloud services. -func (client CloudServiceRoleInstancesClient) Get(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, expand InstanceViewTypes) (result RoleInstance, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceRoleInstancesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, roleInstanceName, resourceGroupName, cloudServiceName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client CloudServiceRoleInstancesClient) GetPreparer(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, expand InstanceViewTypes) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "cloudServiceName": autorest.Encode("path", cloudServiceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "roleInstanceName": autorest.Encode("path", roleInstanceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-04-04" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(string(expand)) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}", 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 CloudServiceRoleInstancesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client CloudServiceRoleInstancesClient) GetResponder(resp *http.Response) (result RoleInstance, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetInstanceView retrieves information about the run-time state of a role instance in a cloud service. -// Parameters: -// roleInstanceName - name of the role instance. -// resourceGroupName - name of the resource group. -// cloudServiceName - name of the cloud service. -func (client CloudServiceRoleInstancesClient) GetInstanceView(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string) (result RoleInstanceInstanceView, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceRoleInstancesClient.GetInstanceView") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetInstanceViewPreparer(ctx, roleInstanceName, resourceGroupName, cloudServiceName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesClient", "GetInstanceView", nil, "Failure preparing request") - return - } - - resp, err := client.GetInstanceViewSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesClient", "GetInstanceView", resp, "Failure sending request") - return - } - - result, err = client.GetInstanceViewResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesClient", "GetInstanceView", resp, "Failure responding to request") - return - } - - return -} - -// GetInstanceViewPreparer prepares the GetInstanceView request. -func (client CloudServiceRoleInstancesClient) GetInstanceViewPreparer(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "cloudServiceName": autorest.Encode("path", cloudServiceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "roleInstanceName": autorest.Encode("path", roleInstanceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-04-04" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/instanceView", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetInstanceViewSender sends the GetInstanceView request. The method will close the -// http.Response Body if it receives an error. -func (client CloudServiceRoleInstancesClient) GetInstanceViewSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetInstanceViewResponder handles the response to the GetInstanceView request. The method always -// closes the http.Response Body. -func (client CloudServiceRoleInstancesClient) GetInstanceViewResponder(resp *http.Response) (result RoleInstanceInstanceView, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetRemoteDesktopFile gets a remote desktop file for a role instance in a cloud service. -// Parameters: -// roleInstanceName - name of the role instance. -// resourceGroupName - name of the resource group. -// cloudServiceName - name of the cloud service. -func (client CloudServiceRoleInstancesClient) GetRemoteDesktopFile(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string) (result ReadCloser, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceRoleInstancesClient.GetRemoteDesktopFile") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetRemoteDesktopFilePreparer(ctx, roleInstanceName, resourceGroupName, cloudServiceName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesClient", "GetRemoteDesktopFile", nil, "Failure preparing request") - return - } - - resp, err := client.GetRemoteDesktopFileSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesClient", "GetRemoteDesktopFile", resp, "Failure sending request") - return - } - - result, err = client.GetRemoteDesktopFileResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesClient", "GetRemoteDesktopFile", resp, "Failure responding to request") - return - } - - return -} - -// GetRemoteDesktopFilePreparer prepares the GetRemoteDesktopFile request. -func (client CloudServiceRoleInstancesClient) GetRemoteDesktopFilePreparer(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "cloudServiceName": autorest.Encode("path", cloudServiceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "roleInstanceName": autorest.Encode("path", roleInstanceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-04-04" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/remoteDesktopFile", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetRemoteDesktopFileSender sends the GetRemoteDesktopFile request. The method will close the -// http.Response Body if it receives an error. -func (client CloudServiceRoleInstancesClient) GetRemoteDesktopFileSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetRemoteDesktopFileResponder handles the response to the GetRemoteDesktopFile request. The method always -// closes the http.Response Body. -func (client CloudServiceRoleInstancesClient) GetRemoteDesktopFileResponder(resp *http.Response) (result ReadCloser, err error) { - result.Value = &resp.Body - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK)) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets the list of all role instances in a cloud service. Use nextLink property in the response to get the next -// page of role instances. Do this till nextLink is null to fetch all the role instances. -// Parameters: -// resourceGroupName - name of the resource group. -// cloudServiceName - name of the cloud service. -// expand - the expand expression to apply to the operation. 'UserData' is not supported for cloud services. -func (client CloudServiceRoleInstancesClient) List(ctx context.Context, resourceGroupName string, cloudServiceName string, expand InstanceViewTypes) (result RoleInstanceListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceRoleInstancesClient.List") - defer func() { - sc := -1 - if result.rilr.Response.Response != nil { - sc = result.rilr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, cloudServiceName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.rilr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesClient", "List", resp, "Failure sending request") - return - } - - result.rilr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesClient", "List", resp, "Failure responding to request") - return - } - if result.rilr.hasNextLink() && result.rilr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client CloudServiceRoleInstancesClient) ListPreparer(ctx context.Context, resourceGroupName string, cloudServiceName string, expand InstanceViewTypes) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "cloudServiceName": autorest.Encode("path", cloudServiceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-04-04" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(string(expand)) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances", 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 CloudServiceRoleInstancesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client CloudServiceRoleInstancesClient) ListResponder(resp *http.Response) (result RoleInstanceListResult, err error) { - err = autorest.Respond( - resp, - 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 CloudServiceRoleInstancesClient) listNextResults(ctx context.Context, lastResults RoleInstanceListResult) (result RoleInstanceListResult, err error) { - req, err := lastResults.roleInstanceListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesClient", "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, "compute.CloudServiceRoleInstancesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client CloudServiceRoleInstancesClient) ListComplete(ctx context.Context, resourceGroupName string, cloudServiceName string, expand InstanceViewTypes) (result RoleInstanceListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceRoleInstancesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, cloudServiceName, expand) - return -} - -// Rebuild the Rebuild Role Instance asynchronous operation reinstalls the operating system on instances of web roles -// or worker roles and initializes the storage resources that are used by them. If you do not want to initialize -// storage resources, you can use Reimage Role Instance. -// Parameters: -// roleInstanceName - name of the role instance. -// resourceGroupName - name of the resource group. -// cloudServiceName - name of the cloud service. -func (client CloudServiceRoleInstancesClient) Rebuild(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string) (result CloudServiceRoleInstancesRebuildFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceRoleInstancesClient.Rebuild") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.RebuildPreparer(ctx, roleInstanceName, resourceGroupName, cloudServiceName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesClient", "Rebuild", nil, "Failure preparing request") - return - } - - result, err = client.RebuildSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesClient", "Rebuild", result.Response(), "Failure sending request") - return - } - - return -} - -// RebuildPreparer prepares the Rebuild request. -func (client CloudServiceRoleInstancesClient) RebuildPreparer(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "cloudServiceName": autorest.Encode("path", cloudServiceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "roleInstanceName": autorest.Encode("path", roleInstanceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-04-04" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/rebuild", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RebuildSender sends the Rebuild request. The method will close the -// http.Response Body if it receives an error. -func (client CloudServiceRoleInstancesClient) RebuildSender(req *http.Request) (future CloudServiceRoleInstancesRebuildFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// RebuildResponder handles the response to the Rebuild request. The method always -// closes the http.Response Body. -func (client CloudServiceRoleInstancesClient) RebuildResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Reimage the Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web roles -// or worker roles. -// Parameters: -// roleInstanceName - name of the role instance. -// resourceGroupName - name of the resource group. -// cloudServiceName - name of the cloud service. -func (client CloudServiceRoleInstancesClient) Reimage(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string) (result CloudServiceRoleInstancesReimageFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceRoleInstancesClient.Reimage") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ReimagePreparer(ctx, roleInstanceName, resourceGroupName, cloudServiceName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesClient", "Reimage", nil, "Failure preparing request") - return - } - - result, err = client.ReimageSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesClient", "Reimage", result.Response(), "Failure sending request") - return - } - - return -} - -// ReimagePreparer prepares the Reimage request. -func (client CloudServiceRoleInstancesClient) ReimagePreparer(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "cloudServiceName": autorest.Encode("path", cloudServiceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "roleInstanceName": autorest.Encode("path", roleInstanceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-04-04" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/reimage", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ReimageSender sends the Reimage request. The method will close the -// http.Response Body if it receives an error. -func (client CloudServiceRoleInstancesClient) ReimageSender(req *http.Request) (future CloudServiceRoleInstancesReimageFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ReimageResponder handles the response to the Reimage request. The method always -// closes the http.Response Body. -func (client CloudServiceRoleInstancesClient) ReimageResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Restart the Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud service. -// Parameters: -// roleInstanceName - name of the role instance. -// resourceGroupName - name of the resource group. -// cloudServiceName - name of the cloud service. -func (client CloudServiceRoleInstancesClient) Restart(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string) (result CloudServiceRoleInstancesRestartFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceRoleInstancesClient.Restart") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.RestartPreparer(ctx, roleInstanceName, resourceGroupName, cloudServiceName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesClient", "Restart", nil, "Failure preparing request") - return - } - - result, err = client.RestartSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesClient", "Restart", result.Response(), "Failure sending request") - return - } - - return -} - -// RestartPreparer prepares the Restart request. -func (client CloudServiceRoleInstancesClient) RestartPreparer(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "cloudServiceName": autorest.Encode("path", cloudServiceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "roleInstanceName": autorest.Encode("path", roleInstanceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-04-04" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/restart", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RestartSender sends the Restart request. The method will close the -// http.Response Body if it receives an error. -func (client CloudServiceRoleInstancesClient) RestartSender(req *http.Request) (future CloudServiceRoleInstancesRestartFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// RestartResponder handles the response to the Restart request. The method always -// closes the http.Response Body. -func (client CloudServiceRoleInstancesClient) RestartResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/cloudserviceroles.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/cloudserviceroles.go deleted file mode 100644 index a67f6351..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/cloudserviceroles.go +++ /dev/null @@ -1,229 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// CloudServiceRolesClient is the compute Client -type CloudServiceRolesClient struct { - BaseClient -} - -// NewCloudServiceRolesClient creates an instance of the CloudServiceRolesClient client. -func NewCloudServiceRolesClient(subscriptionID string) CloudServiceRolesClient { - return NewCloudServiceRolesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewCloudServiceRolesClientWithBaseURI creates an instance of the CloudServiceRolesClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewCloudServiceRolesClientWithBaseURI(baseURI string, subscriptionID string) CloudServiceRolesClient { - return CloudServiceRolesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get gets a role from a cloud service. -// Parameters: -// roleName - name of the role. -// resourceGroupName - name of the resource group. -// cloudServiceName - name of the cloud service. -func (client CloudServiceRolesClient) Get(ctx context.Context, roleName string, resourceGroupName string, cloudServiceName string) (result CloudServiceRole, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceRolesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, roleName, resourceGroupName, cloudServiceName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceRolesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.CloudServiceRolesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceRolesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client CloudServiceRolesClient) GetPreparer(ctx context.Context, roleName string, resourceGroupName string, cloudServiceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "cloudServiceName": autorest.Encode("path", cloudServiceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "roleName": autorest.Encode("path", roleName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-04-04" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roles/{roleName}", 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 CloudServiceRolesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client CloudServiceRolesClient) GetResponder(resp *http.Response) (result CloudServiceRole, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets a list of all roles in a cloud service. Use nextLink property in the response to get the next page of -// roles. Do this till nextLink is null to fetch all the roles. -// Parameters: -// resourceGroupName - name of the resource group. -// cloudServiceName - name of the cloud service. -func (client CloudServiceRolesClient) List(ctx context.Context, resourceGroupName string, cloudServiceName string) (result CloudServiceRoleListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceRolesClient.List") - defer func() { - sc := -1 - if result.csrlr.Response.Response != nil { - sc = result.csrlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, cloudServiceName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceRolesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.csrlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.CloudServiceRolesClient", "List", resp, "Failure sending request") - return - } - - result.csrlr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceRolesClient", "List", resp, "Failure responding to request") - return - } - if result.csrlr.hasNextLink() && result.csrlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client CloudServiceRolesClient) ListPreparer(ctx context.Context, resourceGroupName string, cloudServiceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "cloudServiceName": autorest.Encode("path", cloudServiceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-04-04" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roles", 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 CloudServiceRolesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client CloudServiceRolesClient) ListResponder(resp *http.Response) (result CloudServiceRoleListResult, err error) { - err = autorest.Respond( - resp, - 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 CloudServiceRolesClient) listNextResults(ctx context.Context, lastResults CloudServiceRoleListResult) (result CloudServiceRoleListResult, err error) { - req, err := lastResults.cloudServiceRoleListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.CloudServiceRolesClient", "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, "compute.CloudServiceRolesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceRolesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client CloudServiceRolesClient) ListComplete(ctx context.Context, resourceGroupName string, cloudServiceName string) (result CloudServiceRoleListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceRolesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, cloudServiceName) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/cloudservices.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/cloudservices.go deleted file mode 100644 index e467efb8..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/cloudservices.go +++ /dev/null @@ -1,1198 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// CloudServicesClient is the compute Client -type CloudServicesClient struct { - BaseClient -} - -// NewCloudServicesClient creates an instance of the CloudServicesClient client. -func NewCloudServicesClient(subscriptionID string) CloudServicesClient { - return NewCloudServicesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewCloudServicesClientWithBaseURI creates an instance of the CloudServicesClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewCloudServicesClientWithBaseURI(baseURI string, subscriptionID string) CloudServicesClient { - return CloudServicesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create or update a cloud service. Please note some properties can be set only during cloud service -// creation. -// Parameters: -// resourceGroupName - name of the resource group. -// cloudServiceName - name of the cloud service. -// parameters - the cloud service object. -func (client CloudServicesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, cloudServiceName string, parameters *CloudService) (result CloudServicesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServicesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.Location", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("compute.CloudServicesClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, cloudServiceName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client CloudServicesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, cloudServiceName string, parameters *CloudService) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "cloudServiceName": autorest.Encode("path", cloudServiceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-04-04" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.ID = nil - parameters.Name = nil - parameters.Type = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if parameters != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(parameters)) - } - 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 CloudServicesClient) CreateOrUpdateSender(req *http.Request) (future CloudServicesCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client CloudServicesClient) CreateOrUpdateResponder(resp *http.Response) (result CloudService, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a cloud service. -// Parameters: -// resourceGroupName - name of the resource group. -// cloudServiceName - name of the cloud service. -func (client CloudServicesClient) Delete(ctx context.Context, resourceGroupName string, cloudServiceName string) (result CloudServicesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServicesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, cloudServiceName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client CloudServicesClient) DeletePreparer(ctx context.Context, resourceGroupName string, cloudServiceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "cloudServiceName": autorest.Encode("path", cloudServiceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-04-04" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}", 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 CloudServicesClient) DeleteSender(req *http.Request) (future CloudServicesDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client CloudServicesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// DeleteInstances deletes role instances in a cloud service. -// Parameters: -// resourceGroupName - name of the resource group. -// cloudServiceName - name of the cloud service. -// parameters - list of cloud service role instance names. -func (client CloudServicesClient) DeleteInstances(ctx context.Context, resourceGroupName string, cloudServiceName string, parameters *RoleInstances) (result CloudServicesDeleteInstancesFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServicesClient.DeleteInstances") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.RoleInstances", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("compute.CloudServicesClient", "DeleteInstances", err.Error()) - } - - req, err := client.DeleteInstancesPreparer(ctx, resourceGroupName, cloudServiceName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "DeleteInstances", nil, "Failure preparing request") - return - } - - result, err = client.DeleteInstancesSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "DeleteInstances", result.Response(), "Failure sending request") - return - } - - return -} - -// DeleteInstancesPreparer prepares the DeleteInstances request. -func (client CloudServicesClient) DeleteInstancesPreparer(ctx context.Context, resourceGroupName string, cloudServiceName string, parameters *RoleInstances) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "cloudServiceName": autorest.Encode("path", cloudServiceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-04-04" - 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.Compute/cloudServices/{cloudServiceName}/delete", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if parameters != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(parameters)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteInstancesSender sends the DeleteInstances request. The method will close the -// http.Response Body if it receives an error. -func (client CloudServicesClient) DeleteInstancesSender(req *http.Request) (future CloudServicesDeleteInstancesFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteInstancesResponder handles the response to the DeleteInstances request. The method always -// closes the http.Response Body. -func (client CloudServicesClient) DeleteInstancesResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get display information about a cloud service. -// Parameters: -// resourceGroupName - name of the resource group. -// cloudServiceName - name of the cloud service. -func (client CloudServicesClient) Get(ctx context.Context, resourceGroupName string, cloudServiceName string) (result CloudService, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServicesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, cloudServiceName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client CloudServicesClient) GetPreparer(ctx context.Context, resourceGroupName string, cloudServiceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "cloudServiceName": autorest.Encode("path", cloudServiceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-04-04" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}", 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 CloudServicesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client CloudServicesClient) GetResponder(resp *http.Response) (result CloudService, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetInstanceView gets the status of a cloud service. -// Parameters: -// resourceGroupName - name of the resource group. -// cloudServiceName - name of the cloud service. -func (client CloudServicesClient) GetInstanceView(ctx context.Context, resourceGroupName string, cloudServiceName string) (result CloudServiceInstanceView, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServicesClient.GetInstanceView") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetInstanceViewPreparer(ctx, resourceGroupName, cloudServiceName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "GetInstanceView", nil, "Failure preparing request") - return - } - - resp, err := client.GetInstanceViewSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "GetInstanceView", resp, "Failure sending request") - return - } - - result, err = client.GetInstanceViewResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "GetInstanceView", resp, "Failure responding to request") - return - } - - return -} - -// GetInstanceViewPreparer prepares the GetInstanceView request. -func (client CloudServicesClient) GetInstanceViewPreparer(ctx context.Context, resourceGroupName string, cloudServiceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "cloudServiceName": autorest.Encode("path", cloudServiceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-04-04" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/instanceView", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetInstanceViewSender sends the GetInstanceView request. The method will close the -// http.Response Body if it receives an error. -func (client CloudServicesClient) GetInstanceViewSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetInstanceViewResponder handles the response to the GetInstanceView request. The method always -// closes the http.Response Body. -func (client CloudServicesClient) GetInstanceViewResponder(resp *http.Response) (result CloudServiceInstanceView, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets a list of all cloud services under a resource group. Use nextLink property in the response to get the next -// page of Cloud Services. Do this till nextLink is null to fetch all the Cloud Services. -// Parameters: -// resourceGroupName - name of the resource group. -func (client CloudServicesClient) List(ctx context.Context, resourceGroupName string) (result CloudServiceListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServicesClient.List") - defer func() { - sc := -1 - if result.cslr.Response.Response != nil { - sc = result.cslr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.cslr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "List", resp, "Failure sending request") - return - } - - result.cslr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "List", resp, "Failure responding to request") - return - } - if result.cslr.hasNextLink() && result.cslr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client CloudServicesClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-04-04" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices", 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 CloudServicesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client CloudServicesClient) ListResponder(resp *http.Response) (result CloudServiceListResult, err error) { - err = autorest.Respond( - resp, - 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 CloudServicesClient) listNextResults(ctx context.Context, lastResults CloudServiceListResult) (result CloudServiceListResult, err error) { - req, err := lastResults.cloudServiceListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.CloudServicesClient", "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, "compute.CloudServicesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client CloudServicesClient) ListComplete(ctx context.Context, resourceGroupName string) (result CloudServiceListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServicesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName) - return -} - -// ListAll gets a list of all cloud services in the subscription, regardless of the associated resource group. Use -// nextLink property in the response to get the next page of Cloud Services. Do this till nextLink is null to fetch all -// the Cloud Services. -func (client CloudServicesClient) ListAll(ctx context.Context) (result CloudServiceListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServicesClient.ListAll") - defer func() { - sc := -1 - if result.cslr.Response.Response != nil { - sc = result.cslr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listAllNextResults - req, err := client.ListAllPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "ListAll", nil, "Failure preparing request") - return - } - - resp, err := client.ListAllSender(req) - if err != nil { - result.cslr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "ListAll", resp, "Failure sending request") - return - } - - result.cslr, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "ListAll", resp, "Failure responding to request") - return - } - if result.cslr.hasNextLink() && result.cslr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListAllPreparer prepares the ListAll request. -func (client CloudServicesClient) ListAllPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-04-04" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/cloudServices", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAllSender sends the ListAll request. The method will close the -// http.Response Body if it receives an error. -func (client CloudServicesClient) ListAllSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAllResponder handles the response to the ListAll request. The method always -// closes the http.Response Body. -func (client CloudServicesClient) ListAllResponder(resp *http.Response) (result CloudServiceListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listAllNextResults retrieves the next set of results, if any. -func (client CloudServicesClient) listAllNextResults(ctx context.Context, lastResults CloudServiceListResult) (result CloudServiceListResult, err error) { - req, err := lastResults.cloudServiceListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.CloudServicesClient", "listAllNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListAllSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.CloudServicesClient", "listAllNextResults", resp, "Failure sending next results request") - } - result, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "listAllNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListAllComplete enumerates all values, automatically crossing page boundaries as required. -func (client CloudServicesClient) ListAllComplete(ctx context.Context) (result CloudServiceListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServicesClient.ListAll") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListAll(ctx) - return -} - -// PowerOff power off the cloud service. Note that resources are still attached and you are getting charged for the -// resources. -// Parameters: -// resourceGroupName - name of the resource group. -// cloudServiceName - name of the cloud service. -func (client CloudServicesClient) PowerOff(ctx context.Context, resourceGroupName string, cloudServiceName string) (result CloudServicesPowerOffFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServicesClient.PowerOff") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.PowerOffPreparer(ctx, resourceGroupName, cloudServiceName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "PowerOff", nil, "Failure preparing request") - return - } - - result, err = client.PowerOffSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "PowerOff", result.Response(), "Failure sending request") - return - } - - return -} - -// PowerOffPreparer prepares the PowerOff request. -func (client CloudServicesClient) PowerOffPreparer(ctx context.Context, resourceGroupName string, cloudServiceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "cloudServiceName": autorest.Encode("path", cloudServiceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-04-04" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/poweroff", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// PowerOffSender sends the PowerOff request. The method will close the -// http.Response Body if it receives an error. -func (client CloudServicesClient) PowerOffSender(req *http.Request) (future CloudServicesPowerOffFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// PowerOffResponder handles the response to the PowerOff request. The method always -// closes the http.Response Body. -func (client CloudServicesClient) PowerOffResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Rebuild rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and -// initializes the storage resources that are used by them. If you do not want to initialize storage resources, you can -// use Reimage Role Instances. -// Parameters: -// resourceGroupName - name of the resource group. -// cloudServiceName - name of the cloud service. -// parameters - list of cloud service role instance names. -func (client CloudServicesClient) Rebuild(ctx context.Context, resourceGroupName string, cloudServiceName string, parameters *RoleInstances) (result CloudServicesRebuildFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServicesClient.Rebuild") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.RoleInstances", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("compute.CloudServicesClient", "Rebuild", err.Error()) - } - - req, err := client.RebuildPreparer(ctx, resourceGroupName, cloudServiceName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "Rebuild", nil, "Failure preparing request") - return - } - - result, err = client.RebuildSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "Rebuild", result.Response(), "Failure sending request") - return - } - - return -} - -// RebuildPreparer prepares the Rebuild request. -func (client CloudServicesClient) RebuildPreparer(ctx context.Context, resourceGroupName string, cloudServiceName string, parameters *RoleInstances) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "cloudServiceName": autorest.Encode("path", cloudServiceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-04-04" - 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.Compute/cloudServices/{cloudServiceName}/rebuild", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if parameters != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(parameters)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RebuildSender sends the Rebuild request. The method will close the -// http.Response Body if it receives an error. -func (client CloudServicesClient) RebuildSender(req *http.Request) (future CloudServicesRebuildFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// RebuildResponder handles the response to the Rebuild request. The method always -// closes the http.Response Body. -func (client CloudServicesClient) RebuildResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Reimage reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. -// Parameters: -// resourceGroupName - name of the resource group. -// cloudServiceName - name of the cloud service. -// parameters - list of cloud service role instance names. -func (client CloudServicesClient) Reimage(ctx context.Context, resourceGroupName string, cloudServiceName string, parameters *RoleInstances) (result CloudServicesReimageFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServicesClient.Reimage") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.RoleInstances", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("compute.CloudServicesClient", "Reimage", err.Error()) - } - - req, err := client.ReimagePreparer(ctx, resourceGroupName, cloudServiceName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "Reimage", nil, "Failure preparing request") - return - } - - result, err = client.ReimageSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "Reimage", result.Response(), "Failure sending request") - return - } - - return -} - -// ReimagePreparer prepares the Reimage request. -func (client CloudServicesClient) ReimagePreparer(ctx context.Context, resourceGroupName string, cloudServiceName string, parameters *RoleInstances) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "cloudServiceName": autorest.Encode("path", cloudServiceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-04-04" - 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.Compute/cloudServices/{cloudServiceName}/reimage", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if parameters != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(parameters)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ReimageSender sends the Reimage request. The method will close the -// http.Response Body if it receives an error. -func (client CloudServicesClient) ReimageSender(req *http.Request) (future CloudServicesReimageFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ReimageResponder handles the response to the Reimage request. The method always -// closes the http.Response Body. -func (client CloudServicesClient) ReimageResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Restart restarts one or more role instances in a cloud service. -// Parameters: -// resourceGroupName - name of the resource group. -// cloudServiceName - name of the cloud service. -// parameters - list of cloud service role instance names. -func (client CloudServicesClient) Restart(ctx context.Context, resourceGroupName string, cloudServiceName string, parameters *RoleInstances) (result CloudServicesRestartFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServicesClient.Restart") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.RoleInstances", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("compute.CloudServicesClient", "Restart", err.Error()) - } - - req, err := client.RestartPreparer(ctx, resourceGroupName, cloudServiceName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "Restart", nil, "Failure preparing request") - return - } - - result, err = client.RestartSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "Restart", result.Response(), "Failure sending request") - return - } - - return -} - -// RestartPreparer prepares the Restart request. -func (client CloudServicesClient) RestartPreparer(ctx context.Context, resourceGroupName string, cloudServiceName string, parameters *RoleInstances) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "cloudServiceName": autorest.Encode("path", cloudServiceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-04-04" - 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.Compute/cloudServices/{cloudServiceName}/restart", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if parameters != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(parameters)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RestartSender sends the Restart request. The method will close the -// http.Response Body if it receives an error. -func (client CloudServicesClient) RestartSender(req *http.Request) (future CloudServicesRestartFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// RestartResponder handles the response to the Restart request. The method always -// closes the http.Response Body. -func (client CloudServicesClient) RestartResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Start starts the cloud service. -// Parameters: -// resourceGroupName - name of the resource group. -// cloudServiceName - name of the cloud service. -func (client CloudServicesClient) Start(ctx context.Context, resourceGroupName string, cloudServiceName string) (result CloudServicesStartFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServicesClient.Start") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.StartPreparer(ctx, resourceGroupName, cloudServiceName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "Start", nil, "Failure preparing request") - return - } - - result, err = client.StartSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "Start", result.Response(), "Failure sending request") - return - } - - return -} - -// StartPreparer prepares the Start request. -func (client CloudServicesClient) StartPreparer(ctx context.Context, resourceGroupName string, cloudServiceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "cloudServiceName": autorest.Encode("path", cloudServiceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-04-04" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/start", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// StartSender sends the Start request. The method will close the -// http.Response Body if it receives an error. -func (client CloudServicesClient) StartSender(req *http.Request) (future CloudServicesStartFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// StartResponder handles the response to the Start request. The method always -// closes the http.Response Body. -func (client CloudServicesClient) StartResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Update update a cloud service. -// Parameters: -// resourceGroupName - name of the resource group. -// cloudServiceName - name of the cloud service. -// parameters - the cloud service object. -func (client CloudServicesClient) Update(ctx context.Context, resourceGroupName string, cloudServiceName string, parameters *CloudServiceUpdate) (result CloudServicesUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServicesClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, cloudServiceName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client CloudServicesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, cloudServiceName string, parameters *CloudServiceUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "cloudServiceName": autorest.Encode("path", cloudServiceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-04-04" - 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/cloudServices/{cloudServiceName}", 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 CloudServicesClient) UpdateSender(req *http.Request) (future CloudServicesUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client CloudServicesClient) UpdateResponder(resp *http.Response) (result CloudService, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/cloudservicesupdatedomain.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/cloudservicesupdatedomain.go deleted file mode 100644 index 74f7d76a..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/cloudservicesupdatedomain.go +++ /dev/null @@ -1,319 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// CloudServicesUpdateDomainClient is the compute Client -type CloudServicesUpdateDomainClient struct { - BaseClient -} - -// NewCloudServicesUpdateDomainClient creates an instance of the CloudServicesUpdateDomainClient client. -func NewCloudServicesUpdateDomainClient(subscriptionID string) CloudServicesUpdateDomainClient { - return NewCloudServicesUpdateDomainClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewCloudServicesUpdateDomainClientWithBaseURI creates an instance of the CloudServicesUpdateDomainClient client -// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign -// clouds, Azure stack). -func NewCloudServicesUpdateDomainClientWithBaseURI(baseURI string, subscriptionID string) CloudServicesUpdateDomainClient { - return CloudServicesUpdateDomainClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// GetUpdateDomain gets the specified update domain of a cloud service. Use nextLink property in the response to get -// the next page of update domains. Do this till nextLink is null to fetch all the update domains. -// Parameters: -// resourceGroupName - name of the resource group. -// cloudServiceName - name of the cloud service. -// updateDomain - specifies an integer value that identifies the update domain. Update domains are identified -// with a zero-based index: the first update domain has an ID of 0, the second has an ID of 1, and so on. -func (client CloudServicesUpdateDomainClient) GetUpdateDomain(ctx context.Context, resourceGroupName string, cloudServiceName string, updateDomain int32) (result UpdateDomain, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServicesUpdateDomainClient.GetUpdateDomain") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetUpdateDomainPreparer(ctx, resourceGroupName, cloudServiceName, updateDomain) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesUpdateDomainClient", "GetUpdateDomain", nil, "Failure preparing request") - return - } - - resp, err := client.GetUpdateDomainSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.CloudServicesUpdateDomainClient", "GetUpdateDomain", resp, "Failure sending request") - return - } - - result, err = client.GetUpdateDomainResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesUpdateDomainClient", "GetUpdateDomain", resp, "Failure responding to request") - return - } - - return -} - -// GetUpdateDomainPreparer prepares the GetUpdateDomain request. -func (client CloudServicesUpdateDomainClient) GetUpdateDomainPreparer(ctx context.Context, resourceGroupName string, cloudServiceName string, updateDomain int32) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "cloudServiceName": autorest.Encode("path", cloudServiceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "updateDomain": autorest.Encode("path", updateDomain), - } - - const APIVersion = "2022-04-04" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/updateDomains/{updateDomain}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetUpdateDomainSender sends the GetUpdateDomain request. The method will close the -// http.Response Body if it receives an error. -func (client CloudServicesUpdateDomainClient) GetUpdateDomainSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetUpdateDomainResponder handles the response to the GetUpdateDomain request. The method always -// closes the http.Response Body. -func (client CloudServicesUpdateDomainClient) GetUpdateDomainResponder(resp *http.Response) (result UpdateDomain, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListUpdateDomains gets a list of all update domains in a cloud service. -// Parameters: -// resourceGroupName - name of the resource group. -// cloudServiceName - name of the cloud service. -func (client CloudServicesUpdateDomainClient) ListUpdateDomains(ctx context.Context, resourceGroupName string, cloudServiceName string) (result UpdateDomainListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServicesUpdateDomainClient.ListUpdateDomains") - defer func() { - sc := -1 - if result.udlr.Response.Response != nil { - sc = result.udlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listUpdateDomainsNextResults - req, err := client.ListUpdateDomainsPreparer(ctx, resourceGroupName, cloudServiceName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesUpdateDomainClient", "ListUpdateDomains", nil, "Failure preparing request") - return - } - - resp, err := client.ListUpdateDomainsSender(req) - if err != nil { - result.udlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.CloudServicesUpdateDomainClient", "ListUpdateDomains", resp, "Failure sending request") - return - } - - result.udlr, err = client.ListUpdateDomainsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesUpdateDomainClient", "ListUpdateDomains", resp, "Failure responding to request") - return - } - if result.udlr.hasNextLink() && result.udlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListUpdateDomainsPreparer prepares the ListUpdateDomains request. -func (client CloudServicesUpdateDomainClient) ListUpdateDomainsPreparer(ctx context.Context, resourceGroupName string, cloudServiceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "cloudServiceName": autorest.Encode("path", cloudServiceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-04-04" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/updateDomains", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListUpdateDomainsSender sends the ListUpdateDomains request. The method will close the -// http.Response Body if it receives an error. -func (client CloudServicesUpdateDomainClient) ListUpdateDomainsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListUpdateDomainsResponder handles the response to the ListUpdateDomains request. The method always -// closes the http.Response Body. -func (client CloudServicesUpdateDomainClient) ListUpdateDomainsResponder(resp *http.Response) (result UpdateDomainListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listUpdateDomainsNextResults retrieves the next set of results, if any. -func (client CloudServicesUpdateDomainClient) listUpdateDomainsNextResults(ctx context.Context, lastResults UpdateDomainListResult) (result UpdateDomainListResult, err error) { - req, err := lastResults.updateDomainListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.CloudServicesUpdateDomainClient", "listUpdateDomainsNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListUpdateDomainsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.CloudServicesUpdateDomainClient", "listUpdateDomainsNextResults", resp, "Failure sending next results request") - } - result, err = client.ListUpdateDomainsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesUpdateDomainClient", "listUpdateDomainsNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListUpdateDomainsComplete enumerates all values, automatically crossing page boundaries as required. -func (client CloudServicesUpdateDomainClient) ListUpdateDomainsComplete(ctx context.Context, resourceGroupName string, cloudServiceName string) (result UpdateDomainListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServicesUpdateDomainClient.ListUpdateDomains") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListUpdateDomains(ctx, resourceGroupName, cloudServiceName) - return -} - -// WalkUpdateDomain updates the role instances in the specified update domain. -// Parameters: -// resourceGroupName - name of the resource group. -// cloudServiceName - name of the cloud service. -// updateDomain - specifies an integer value that identifies the update domain. Update domains are identified -// with a zero-based index: the first update domain has an ID of 0, the second has an ID of 1, and so on. -// parameters - the update domain object. -func (client CloudServicesUpdateDomainClient) WalkUpdateDomain(ctx context.Context, resourceGroupName string, cloudServiceName string, updateDomain int32, parameters *UpdateDomain) (result CloudServicesUpdateDomainWalkUpdateDomainFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServicesUpdateDomainClient.WalkUpdateDomain") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.WalkUpdateDomainPreparer(ctx, resourceGroupName, cloudServiceName, updateDomain, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesUpdateDomainClient", "WalkUpdateDomain", nil, "Failure preparing request") - return - } - - result, err = client.WalkUpdateDomainSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesUpdateDomainClient", "WalkUpdateDomain", result.Response(), "Failure sending request") - return - } - - return -} - -// WalkUpdateDomainPreparer prepares the WalkUpdateDomain request. -func (client CloudServicesUpdateDomainClient) WalkUpdateDomainPreparer(ctx context.Context, resourceGroupName string, cloudServiceName string, updateDomain int32, parameters *UpdateDomain) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "cloudServiceName": autorest.Encode("path", cloudServiceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "updateDomain": autorest.Encode("path", updateDomain), - } - - const APIVersion = "2022-04-04" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.ID = nil - parameters.Name = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/updateDomains/{updateDomain}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if parameters != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(parameters)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// WalkUpdateDomainSender sends the WalkUpdateDomain request. The method will close the -// http.Response Body if it receives an error. -func (client CloudServicesUpdateDomainClient) WalkUpdateDomainSender(req *http.Request) (future CloudServicesUpdateDomainWalkUpdateDomainFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// WalkUpdateDomainResponder handles the response to the WalkUpdateDomain request. The method always -// closes the http.Response Body. -func (client CloudServicesUpdateDomainClient) WalkUpdateDomainResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/communitygalleries.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/communitygalleries.go deleted file mode 100644 index 6a6335a1..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/communitygalleries.go +++ /dev/null @@ -1,108 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// CommunityGalleriesClient is the compute Client -type CommunityGalleriesClient struct { - BaseClient -} - -// NewCommunityGalleriesClient creates an instance of the CommunityGalleriesClient client. -func NewCommunityGalleriesClient(subscriptionID string) CommunityGalleriesClient { - return NewCommunityGalleriesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewCommunityGalleriesClientWithBaseURI creates an instance of the CommunityGalleriesClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewCommunityGalleriesClientWithBaseURI(baseURI string, subscriptionID string) CommunityGalleriesClient { - return CommunityGalleriesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get get a community gallery by gallery public name. -// Parameters: -// location - resource location. -// publicGalleryName - the public name of the community gallery. -func (client CommunityGalleriesClient) Get(ctx context.Context, location string, publicGalleryName string) (result CommunityGallery, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CommunityGalleriesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, location, publicGalleryName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CommunityGalleriesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.CommunityGalleriesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CommunityGalleriesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client CommunityGalleriesClient) GetPreparer(ctx context.Context, location string, publicGalleryName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "publicGalleryName": autorest.Encode("path", publicGalleryName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}", 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 CommunityGalleriesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client CommunityGalleriesClient) GetResponder(resp *http.Response) (result CommunityGallery, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/communitygalleryimages.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/communitygalleryimages.go deleted file mode 100644 index b77c378c..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/communitygalleryimages.go +++ /dev/null @@ -1,228 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// CommunityGalleryImagesClient is the compute Client -type CommunityGalleryImagesClient struct { - BaseClient -} - -// NewCommunityGalleryImagesClient creates an instance of the CommunityGalleryImagesClient client. -func NewCommunityGalleryImagesClient(subscriptionID string) CommunityGalleryImagesClient { - return NewCommunityGalleryImagesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewCommunityGalleryImagesClientWithBaseURI creates an instance of the CommunityGalleryImagesClient client using a -// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, -// Azure stack). -func NewCommunityGalleryImagesClientWithBaseURI(baseURI string, subscriptionID string) CommunityGalleryImagesClient { - return CommunityGalleryImagesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get get a community gallery image. -// Parameters: -// location - resource location. -// publicGalleryName - the public name of the community gallery. -// galleryImageName - the name of the community gallery image definition. -func (client CommunityGalleryImagesClient) Get(ctx context.Context, location string, publicGalleryName string, galleryImageName string) (result CommunityGalleryImage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CommunityGalleryImagesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, location, publicGalleryName, galleryImageName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CommunityGalleryImagesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.CommunityGalleryImagesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CommunityGalleryImagesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client CommunityGalleryImagesClient) GetPreparer(ctx context.Context, location string, publicGalleryName string, galleryImageName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryImageName": autorest.Encode("path", galleryImageName), - "location": autorest.Encode("path", location), - "publicGalleryName": autorest.Encode("path", publicGalleryName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}/images/{galleryImageName}", 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 CommunityGalleryImagesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client CommunityGalleryImagesClient) GetResponder(resp *http.Response) (result CommunityGalleryImage, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List list community gallery images inside a gallery. -// Parameters: -// location - resource location. -// publicGalleryName - the public name of the community gallery. -func (client CommunityGalleryImagesClient) List(ctx context.Context, location string, publicGalleryName string) (result CommunityGalleryImageListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CommunityGalleryImagesClient.List") - defer func() { - sc := -1 - if result.cgil.Response.Response != nil { - sc = result.cgil.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, location, publicGalleryName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CommunityGalleryImagesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.cgil.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.CommunityGalleryImagesClient", "List", resp, "Failure sending request") - return - } - - result.cgil, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CommunityGalleryImagesClient", "List", resp, "Failure responding to request") - return - } - if result.cgil.hasNextLink() && result.cgil.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client CommunityGalleryImagesClient) ListPreparer(ctx context.Context, location string, publicGalleryName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "publicGalleryName": autorest.Encode("path", publicGalleryName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}/images", 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 CommunityGalleryImagesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client CommunityGalleryImagesClient) ListResponder(resp *http.Response) (result CommunityGalleryImageList, err error) { - err = autorest.Respond( - resp, - 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 CommunityGalleryImagesClient) listNextResults(ctx context.Context, lastResults CommunityGalleryImageList) (result CommunityGalleryImageList, err error) { - req, err := lastResults.communityGalleryImageListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.CommunityGalleryImagesClient", "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, "compute.CommunityGalleryImagesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CommunityGalleryImagesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client CommunityGalleryImagesClient) ListComplete(ctx context.Context, location string, publicGalleryName string) (result CommunityGalleryImageListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CommunityGalleryImagesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, location, publicGalleryName) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/communitygalleryimageversions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/communitygalleryimageversions.go deleted file mode 100644 index dfa0ea75..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/communitygalleryimageversions.go +++ /dev/null @@ -1,234 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// CommunityGalleryImageVersionsClient is the compute Client -type CommunityGalleryImageVersionsClient struct { - BaseClient -} - -// NewCommunityGalleryImageVersionsClient creates an instance of the CommunityGalleryImageVersionsClient client. -func NewCommunityGalleryImageVersionsClient(subscriptionID string) CommunityGalleryImageVersionsClient { - return NewCommunityGalleryImageVersionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewCommunityGalleryImageVersionsClientWithBaseURI creates an instance of the CommunityGalleryImageVersionsClient -// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI -// (sovereign clouds, Azure stack). -func NewCommunityGalleryImageVersionsClientWithBaseURI(baseURI string, subscriptionID string) CommunityGalleryImageVersionsClient { - return CommunityGalleryImageVersionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get get a community gallery image version. -// Parameters: -// location - resource location. -// publicGalleryName - the public name of the community gallery. -// galleryImageName - the name of the community gallery image definition. -// galleryImageVersionName - the name of the community gallery image version. Needs to follow semantic version -// name pattern: The allowed characters are digit and period. Digits must be within the range of a 32-bit -// integer. Format: .. -func (client CommunityGalleryImageVersionsClient) Get(ctx context.Context, location string, publicGalleryName string, galleryImageName string, galleryImageVersionName string) (result CommunityGalleryImageVersion, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CommunityGalleryImageVersionsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, location, publicGalleryName, galleryImageName, galleryImageVersionName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CommunityGalleryImageVersionsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.CommunityGalleryImageVersionsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CommunityGalleryImageVersionsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client CommunityGalleryImageVersionsClient) GetPreparer(ctx context.Context, location string, publicGalleryName string, galleryImageName string, galleryImageVersionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryImageName": autorest.Encode("path", galleryImageName), - "galleryImageVersionName": autorest.Encode("path", galleryImageVersionName), - "location": autorest.Encode("path", location), - "publicGalleryName": autorest.Encode("path", publicGalleryName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}", 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 CommunityGalleryImageVersionsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client CommunityGalleryImageVersionsClient) GetResponder(resp *http.Response) (result CommunityGalleryImageVersion, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List list community gallery image versions inside an image. -// Parameters: -// location - resource location. -// publicGalleryName - the public name of the community gallery. -// galleryImageName - the name of the community gallery image definition. -func (client CommunityGalleryImageVersionsClient) List(ctx context.Context, location string, publicGalleryName string, galleryImageName string) (result CommunityGalleryImageVersionListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CommunityGalleryImageVersionsClient.List") - defer func() { - sc := -1 - if result.cgivl.Response.Response != nil { - sc = result.cgivl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, location, publicGalleryName, galleryImageName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CommunityGalleryImageVersionsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.cgivl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.CommunityGalleryImageVersionsClient", "List", resp, "Failure sending request") - return - } - - result.cgivl, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CommunityGalleryImageVersionsClient", "List", resp, "Failure responding to request") - return - } - if result.cgivl.hasNextLink() && result.cgivl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client CommunityGalleryImageVersionsClient) ListPreparer(ctx context.Context, location string, publicGalleryName string, galleryImageName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryImageName": autorest.Encode("path", galleryImageName), - "location": autorest.Encode("path", location), - "publicGalleryName": autorest.Encode("path", publicGalleryName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}/images/{galleryImageName}/versions", 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 CommunityGalleryImageVersionsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client CommunityGalleryImageVersionsClient) ListResponder(resp *http.Response) (result CommunityGalleryImageVersionList, err error) { - err = autorest.Respond( - resp, - 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 CommunityGalleryImageVersionsClient) listNextResults(ctx context.Context, lastResults CommunityGalleryImageVersionList) (result CommunityGalleryImageVersionList, err error) { - req, err := lastResults.communityGalleryImageVersionListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.CommunityGalleryImageVersionsClient", "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, "compute.CommunityGalleryImageVersionsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CommunityGalleryImageVersionsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client CommunityGalleryImageVersionsClient) ListComplete(ctx context.Context, location string, publicGalleryName string, galleryImageName string) (result CommunityGalleryImageVersionListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CommunityGalleryImageVersionsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, location, publicGalleryName, galleryImageName) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/dedicatedhostgroups.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/dedicatedhostgroups.go deleted file mode 100644 index 0165ab39..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/dedicatedhostgroups.go +++ /dev/null @@ -1,589 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// DedicatedHostGroupsClient is the compute Client -type DedicatedHostGroupsClient struct { - BaseClient -} - -// NewDedicatedHostGroupsClient creates an instance of the DedicatedHostGroupsClient client. -func NewDedicatedHostGroupsClient(subscriptionID string) DedicatedHostGroupsClient { - return NewDedicatedHostGroupsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewDedicatedHostGroupsClientWithBaseURI creates an instance of the DedicatedHostGroupsClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewDedicatedHostGroupsClientWithBaseURI(baseURI string, subscriptionID string) DedicatedHostGroupsClient { - return DedicatedHostGroupsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups -// please see [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596) -// Parameters: -// resourceGroupName - the name of the resource group. -// hostGroupName - the name of the dedicated host group. -// parameters - parameters supplied to the Create Dedicated Host Group. -func (client DedicatedHostGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, hostGroupName string, parameters DedicatedHostGroup) (result DedicatedHostGroup, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.DedicatedHostGroupProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.DedicatedHostGroupProperties.PlatformFaultDomainCount", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.DedicatedHostGroupProperties.PlatformFaultDomainCount", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}}}, - }}}}}); err != nil { - return result, validation.NewError("compute.DedicatedHostGroupsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, hostGroupName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "CreateOrUpdate", resp, "Failure responding to request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client DedicatedHostGroupsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, hostGroupName string, parameters DedicatedHostGroup) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "hostGroupName": autorest.Encode("path", hostGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-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.Compute/hostGroups/{hostGroupName}", 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 DedicatedHostGroupsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client DedicatedHostGroupsClient) CreateOrUpdateResponder(resp *http.Response) (result DedicatedHostGroup, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete a dedicated host group. -// Parameters: -// resourceGroupName - the name of the resource group. -// hostGroupName - the name of the dedicated host group. -func (client DedicatedHostGroupsClient) Delete(ctx context.Context, resourceGroupName string, hostGroupName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupsClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, hostGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "Delete", resp, "Failure responding to request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client DedicatedHostGroupsClient) DeletePreparer(ctx context.Context, resourceGroupName string, hostGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "hostGroupName": autorest.Encode("path", hostGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-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.Compute/hostGroups/{hostGroupName}", 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 DedicatedHostGroupsClient) DeleteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client DedicatedHostGroupsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieves information about a dedicated host group. -// Parameters: -// resourceGroupName - the name of the resource group. -// hostGroupName - the name of the dedicated host group. -// expand - the expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance -// views of the dedicated hosts under the dedicated host group. 'UserData' is not supported for dedicated host -// group. -func (client DedicatedHostGroupsClient) Get(ctx context.Context, resourceGroupName string, hostGroupName string, expand InstanceViewTypes) (result DedicatedHostGroup, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, hostGroupName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client DedicatedHostGroupsClient) GetPreparer(ctx context.Context, resourceGroupName string, hostGroupName string, expand InstanceViewTypes) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "hostGroupName": autorest.Encode("path", hostGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(string(expand)) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}", 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 DedicatedHostGroupsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client DedicatedHostGroupsClient) GetResponder(resp *http.Response) (result DedicatedHostGroup, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByResourceGroup lists all of the dedicated host groups in the specified resource group. Use the nextLink -// property in the response to get the next page of dedicated host groups. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client DedicatedHostGroupsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result DedicatedHostGroupListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.dhglr.Response.Response != nil { - sc = result.dhglr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.dhglr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.dhglr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.dhglr.hasNextLink() && result.dhglr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client DedicatedHostGroupsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-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.Compute/hostGroups", pathParameters), - autorest.WithQueryParameters(queryParameters)) - 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 DedicatedHostGroupsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client DedicatedHostGroupsClient) ListByResourceGroupResponder(resp *http.Response) (result DedicatedHostGroupListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client DedicatedHostGroupsClient) listByResourceGroupNextResults(ctx context.Context, lastResults DedicatedHostGroupListResult) (result DedicatedHostGroupListResult, err error) { - req, err := lastResults.dedicatedHostGroupListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client DedicatedHostGroupsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result DedicatedHostGroupListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// ListBySubscription lists all of the dedicated host groups in the subscription. Use the nextLink property in the -// response to get the next page of dedicated host groups. -func (client DedicatedHostGroupsClient) ListBySubscription(ctx context.Context) (result DedicatedHostGroupListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupsClient.ListBySubscription") - defer func() { - sc := -1 - if result.dhglr.Response.Response != nil { - sc = result.dhglr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listBySubscriptionNextResults - req, err := client.ListBySubscriptionPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "ListBySubscription", nil, "Failure preparing request") - return - } - - resp, err := client.ListBySubscriptionSender(req) - if err != nil { - result.dhglr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "ListBySubscription", resp, "Failure sending request") - return - } - - result.dhglr, err = client.ListBySubscriptionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "ListBySubscription", resp, "Failure responding to request") - return - } - if result.dhglr.hasNextLink() && result.dhglr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListBySubscriptionPreparer prepares the ListBySubscription request. -func (client DedicatedHostGroupsClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/hostGroups", 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 DedicatedHostGroupsClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always -// closes the http.Response Body. -func (client DedicatedHostGroupsClient) ListBySubscriptionResponder(resp *http.Response) (result DedicatedHostGroupListResult, err error) { - err = autorest.Respond( - resp, - 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 DedicatedHostGroupsClient) listBySubscriptionNextResults(ctx context.Context, lastResults DedicatedHostGroupListResult) (result DedicatedHostGroupListResult, err error) { - req, err := lastResults.dedicatedHostGroupListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "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, "compute.DedicatedHostGroupsClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") - } - result, err = client.ListBySubscriptionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. -func (client DedicatedHostGroupsClient) ListBySubscriptionComplete(ctx context.Context) (result DedicatedHostGroupListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupsClient.ListBySubscription") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListBySubscription(ctx) - return -} - -// Update update an dedicated host group. -// Parameters: -// resourceGroupName - the name of the resource group. -// hostGroupName - the name of the dedicated host group. -// parameters - parameters supplied to the Update Dedicated Host Group operation. -func (client DedicatedHostGroupsClient) Update(ctx context.Context, resourceGroupName string, hostGroupName string, parameters DedicatedHostGroupUpdate) (result DedicatedHostGroup, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupsClient.Update") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, hostGroupName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "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.DedicatedHostGroupsClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "Update", resp, "Failure responding to request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client DedicatedHostGroupsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, hostGroupName string, parameters DedicatedHostGroupUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "hostGroupName": autorest.Encode("path", hostGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-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/hostGroups/{hostGroupName}", 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 DedicatedHostGroupsClient) UpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client DedicatedHostGroupsClient) UpdateResponder(resp *http.Response) (result DedicatedHostGroup, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/dedicatedhosts.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/dedicatedhosts.go deleted file mode 100644 index 2e52a6e1..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/dedicatedhosts.go +++ /dev/null @@ -1,575 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// DedicatedHostsClient is the compute Client -type DedicatedHostsClient struct { - BaseClient -} - -// NewDedicatedHostsClient creates an instance of the DedicatedHostsClient client. -func NewDedicatedHostsClient(subscriptionID string) DedicatedHostsClient { - return NewDedicatedHostsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewDedicatedHostsClientWithBaseURI creates an instance of the DedicatedHostsClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewDedicatedHostsClientWithBaseURI(baseURI string, subscriptionID string) DedicatedHostsClient { - return DedicatedHostsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create or update a dedicated host . -// Parameters: -// resourceGroupName - the name of the resource group. -// hostGroupName - the name of the dedicated host group. -// hostName - the name of the dedicated host . -// parameters - parameters supplied to the Create Dedicated Host. -func (client DedicatedHostsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, parameters DedicatedHost) (result DedicatedHostsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.DedicatedHostProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.DedicatedHostProperties.PlatformFaultDomain", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.DedicatedHostProperties.PlatformFaultDomain", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}, - }}, - {Target: "parameters.Sku", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("compute.DedicatedHostsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, hostGroupName, hostName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client DedicatedHostsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, parameters DedicatedHost) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "hostGroupName": autorest.Encode("path", hostGroupName), - "hostName": autorest.Encode("path", hostName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-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.Compute/hostGroups/{hostGroupName}/hosts/{hostName}", 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 DedicatedHostsClient) CreateOrUpdateSender(req *http.Request) (future DedicatedHostsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client DedicatedHostsClient) CreateOrUpdateResponder(resp *http.Response) (result DedicatedHost, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete a dedicated host. -// Parameters: -// resourceGroupName - the name of the resource group. -// hostGroupName - the name of the dedicated host group. -// hostName - the name of the dedicated host. -func (client DedicatedHostsClient) Delete(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string) (result DedicatedHostsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, hostGroupName, hostName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client DedicatedHostsClient) DeletePreparer(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "hostGroupName": autorest.Encode("path", hostGroupName), - "hostName": autorest.Encode("path", hostName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-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.Compute/hostGroups/{hostGroupName}/hosts/{hostName}", 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 DedicatedHostsClient) DeleteSender(req *http.Request) (future DedicatedHostsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client DedicatedHostsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieves information about a dedicated host. -// Parameters: -// resourceGroupName - the name of the resource group. -// hostGroupName - the name of the dedicated host group. -// hostName - the name of the dedicated host. -// expand - the expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance -// views of the dedicated host. 'UserData' is not supported for dedicated host. -func (client DedicatedHostsClient) Get(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, expand InstanceViewTypes) (result DedicatedHost, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, hostGroupName, hostName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client DedicatedHostsClient) GetPreparer(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, expand InstanceViewTypes) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "hostGroupName": autorest.Encode("path", hostGroupName), - "hostName": autorest.Encode("path", hostName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(string(expand)) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}", 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 DedicatedHostsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client DedicatedHostsClient) GetResponder(resp *http.Response) (result DedicatedHost, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByHostGroup lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in -// the response to get the next page of dedicated hosts. -// Parameters: -// resourceGroupName - the name of the resource group. -// hostGroupName - the name of the dedicated host group. -func (client DedicatedHostsClient) ListByHostGroup(ctx context.Context, resourceGroupName string, hostGroupName string) (result DedicatedHostListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostsClient.ListByHostGroup") - defer func() { - sc := -1 - if result.dhlr.Response.Response != nil { - sc = result.dhlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByHostGroupNextResults - req, err := client.ListByHostGroupPreparer(ctx, resourceGroupName, hostGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "ListByHostGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByHostGroupSender(req) - if err != nil { - result.dhlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "ListByHostGroup", resp, "Failure sending request") - return - } - - result.dhlr, err = client.ListByHostGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "ListByHostGroup", resp, "Failure responding to request") - return - } - if result.dhlr.hasNextLink() && result.dhlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByHostGroupPreparer prepares the ListByHostGroup request. -func (client DedicatedHostsClient) ListByHostGroupPreparer(ctx context.Context, resourceGroupName string, hostGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "hostGroupName": autorest.Encode("path", hostGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-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.Compute/hostGroups/{hostGroupName}/hosts", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByHostGroupSender sends the ListByHostGroup request. The method will close the -// http.Response Body if it receives an error. -func (client DedicatedHostsClient) ListByHostGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByHostGroupResponder handles the response to the ListByHostGroup request. The method always -// closes the http.Response Body. -func (client DedicatedHostsClient) ListByHostGroupResponder(resp *http.Response) (result DedicatedHostListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByHostGroupNextResults retrieves the next set of results, if any. -func (client DedicatedHostsClient) listByHostGroupNextResults(ctx context.Context, lastResults DedicatedHostListResult) (result DedicatedHostListResult, err error) { - req, err := lastResults.dedicatedHostListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "listByHostGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByHostGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "listByHostGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByHostGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "listByHostGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByHostGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client DedicatedHostsClient) ListByHostGroupComplete(ctx context.Context, resourceGroupName string, hostGroupName string) (result DedicatedHostListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostsClient.ListByHostGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByHostGroup(ctx, resourceGroupName, hostGroupName) - return -} - -// Restart restart the dedicated host. The operation will complete successfully once the dedicated host has restarted -// and is running. To determine the health of VMs deployed on the dedicated host after the restart check the Resource -// Health Center in the Azure Portal. Please refer to -// https://docs.microsoft.com/azure/service-health/resource-health-overview for more details. -// Parameters: -// resourceGroupName - the name of the resource group. -// hostGroupName - the name of the dedicated host group. -// hostName - the name of the dedicated host. -func (client DedicatedHostsClient) Restart(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string) (result DedicatedHostsRestartFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostsClient.Restart") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.RestartPreparer(ctx, resourceGroupName, hostGroupName, hostName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "Restart", nil, "Failure preparing request") - return - } - - result, err = client.RestartSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "Restart", result.Response(), "Failure sending request") - return - } - - return -} - -// RestartPreparer prepares the Restart request. -func (client DedicatedHostsClient) RestartPreparer(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "hostGroupName": autorest.Encode("path", hostGroupName), - "hostName": autorest.Encode("path", hostName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-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.Compute/hostGroups/{hostGroupName}/hosts/{hostName}/restart", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RestartSender sends the Restart request. The method will close the -// http.Response Body if it receives an error. -func (client DedicatedHostsClient) RestartSender(req *http.Request) (future DedicatedHostsRestartFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// RestartResponder handles the response to the Restart request. The method always -// closes the http.Response Body. -func (client DedicatedHostsClient) RestartResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// Update update an dedicated host . -// Parameters: -// resourceGroupName - the name of the resource group. -// hostGroupName - the name of the dedicated host group. -// hostName - the name of the dedicated host . -// parameters - parameters supplied to the Update Dedicated Host operation. -func (client DedicatedHostsClient) Update(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, parameters DedicatedHostUpdate) (result DedicatedHostsUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostsClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, hostGroupName, hostName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client DedicatedHostsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, parameters DedicatedHostUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "hostGroupName": autorest.Encode("path", hostGroupName), - "hostName": autorest.Encode("path", hostName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-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/hostGroups/{hostGroupName}/hosts/{hostName}", 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 DedicatedHostsClient) UpdateSender(req *http.Request) (future DedicatedHostsUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client DedicatedHostsClient) UpdateResponder(resp *http.Response) (result DedicatedHost, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/diskaccesses.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/diskaccesses.go deleted file mode 100644 index f7e51959..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/diskaccesses.go +++ /dev/null @@ -1,1045 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// DiskAccessesClient is the compute Client -type DiskAccessesClient struct { - BaseClient -} - -// NewDiskAccessesClient creates an instance of the DiskAccessesClient client. -func NewDiskAccessesClient(subscriptionID string) DiskAccessesClient { - return NewDiskAccessesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewDiskAccessesClientWithBaseURI creates an instance of the DiskAccessesClient client using a custom endpoint. Use -// this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewDiskAccessesClientWithBaseURI(baseURI string, subscriptionID string) DiskAccessesClient { - return DiskAccessesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a disk access resource -// Parameters: -// resourceGroupName - the name of the resource group. -// diskAccessName - the name of the disk access resource that is being created. The name can't be changed after -// the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The -// maximum name length is 80 characters. -// diskAccess - disk access object supplied in the body of the Put disk access operation. -func (client DiskAccessesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, diskAccessName string, diskAccess DiskAccess) (result DiskAccessesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskAccessesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, diskAccessName, diskAccess) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client DiskAccessesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, diskAccessName string, diskAccess DiskAccess) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diskAccessName": autorest.Encode("path", diskAccessName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-02" - 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.Compute/diskAccesses/{diskAccessName}", pathParameters), - autorest.WithJSON(diskAccess), - 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 DiskAccessesClient) CreateOrUpdateSender(req *http.Request) (future DiskAccessesCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client DiskAccessesClient) CreateOrUpdateResponder(resp *http.Response) (result DiskAccess, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a disk access resource. -// Parameters: -// resourceGroupName - the name of the resource group. -// diskAccessName - the name of the disk access resource that is being created. The name can't be changed after -// the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The -// maximum name length is 80 characters. -func (client DiskAccessesClient) Delete(ctx context.Context, resourceGroupName string, diskAccessName string) (result DiskAccessesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskAccessesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, diskAccessName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client DiskAccessesClient) DeletePreparer(ctx context.Context, resourceGroupName string, diskAccessName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diskAccessName": autorest.Encode("path", diskAccessName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-02" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}", 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 DiskAccessesClient) DeleteSender(req *http.Request) (future DiskAccessesDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client DiskAccessesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// DeleteAPrivateEndpointConnection deletes a private endpoint connection under a disk access resource. -// Parameters: -// resourceGroupName - the name of the resource group. -// diskAccessName - the name of the disk access resource that is being created. The name can't be changed after -// the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The -// maximum name length is 80 characters. -// privateEndpointConnectionName - the name of the private endpoint connection. -func (client DiskAccessesClient) DeleteAPrivateEndpointConnection(ctx context.Context, resourceGroupName string, diskAccessName string, privateEndpointConnectionName string) (result DiskAccessesDeleteAPrivateEndpointConnectionFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskAccessesClient.DeleteAPrivateEndpointConnection") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeleteAPrivateEndpointConnectionPreparer(ctx, resourceGroupName, diskAccessName, privateEndpointConnectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "DeleteAPrivateEndpointConnection", nil, "Failure preparing request") - return - } - - result, err = client.DeleteAPrivateEndpointConnectionSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "DeleteAPrivateEndpointConnection", result.Response(), "Failure sending request") - return - } - - return -} - -// DeleteAPrivateEndpointConnectionPreparer prepares the DeleteAPrivateEndpointConnection request. -func (client DiskAccessesClient) DeleteAPrivateEndpointConnectionPreparer(ctx context.Context, resourceGroupName string, diskAccessName string, privateEndpointConnectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diskAccessName": autorest.Encode("path", diskAccessName), - "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-02" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteAPrivateEndpointConnectionSender sends the DeleteAPrivateEndpointConnection request. The method will close the -// http.Response Body if it receives an error. -func (client DiskAccessesClient) DeleteAPrivateEndpointConnectionSender(req *http.Request) (future DiskAccessesDeleteAPrivateEndpointConnectionFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteAPrivateEndpointConnectionResponder handles the response to the DeleteAPrivateEndpointConnection request. The method always -// closes the http.Response Body. -func (client DiskAccessesClient) DeleteAPrivateEndpointConnectionResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets information about a disk access resource. -// Parameters: -// resourceGroupName - the name of the resource group. -// diskAccessName - the name of the disk access resource that is being created. The name can't be changed after -// the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The -// maximum name length is 80 characters. -func (client DiskAccessesClient) Get(ctx context.Context, resourceGroupName string, diskAccessName string) (result DiskAccess, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskAccessesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, diskAccessName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client DiskAccessesClient) GetPreparer(ctx context.Context, resourceGroupName string, diskAccessName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diskAccessName": autorest.Encode("path", diskAccessName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-02" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}", 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 DiskAccessesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client DiskAccessesClient) GetResponder(resp *http.Response) (result DiskAccess, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetAPrivateEndpointConnection gets information about a private endpoint connection under a disk access resource. -// Parameters: -// resourceGroupName - the name of the resource group. -// diskAccessName - the name of the disk access resource that is being created. The name can't be changed after -// the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The -// maximum name length is 80 characters. -// privateEndpointConnectionName - the name of the private endpoint connection. -func (client DiskAccessesClient) GetAPrivateEndpointConnection(ctx context.Context, resourceGroupName string, diskAccessName string, privateEndpointConnectionName string) (result PrivateEndpointConnection, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskAccessesClient.GetAPrivateEndpointConnection") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetAPrivateEndpointConnectionPreparer(ctx, resourceGroupName, diskAccessName, privateEndpointConnectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "GetAPrivateEndpointConnection", nil, "Failure preparing request") - return - } - - resp, err := client.GetAPrivateEndpointConnectionSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "GetAPrivateEndpointConnection", resp, "Failure sending request") - return - } - - result, err = client.GetAPrivateEndpointConnectionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "GetAPrivateEndpointConnection", resp, "Failure responding to request") - return - } - - return -} - -// GetAPrivateEndpointConnectionPreparer prepares the GetAPrivateEndpointConnection request. -func (client DiskAccessesClient) GetAPrivateEndpointConnectionPreparer(ctx context.Context, resourceGroupName string, diskAccessName string, privateEndpointConnectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diskAccessName": autorest.Encode("path", diskAccessName), - "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-02" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetAPrivateEndpointConnectionSender sends the GetAPrivateEndpointConnection request. The method will close the -// http.Response Body if it receives an error. -func (client DiskAccessesClient) GetAPrivateEndpointConnectionSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetAPrivateEndpointConnectionResponder handles the response to the GetAPrivateEndpointConnection request. The method always -// closes the http.Response Body. -func (client DiskAccessesClient) GetAPrivateEndpointConnectionResponder(resp *http.Response) (result PrivateEndpointConnection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetPrivateLinkResources gets the private link resources possible under disk access resource -// Parameters: -// resourceGroupName - the name of the resource group. -// diskAccessName - the name of the disk access resource that is being created. The name can't be changed after -// the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The -// maximum name length is 80 characters. -func (client DiskAccessesClient) GetPrivateLinkResources(ctx context.Context, resourceGroupName string, diskAccessName string) (result PrivateLinkResourceListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskAccessesClient.GetPrivateLinkResources") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPrivateLinkResourcesPreparer(ctx, resourceGroupName, diskAccessName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "GetPrivateLinkResources", nil, "Failure preparing request") - return - } - - resp, err := client.GetPrivateLinkResourcesSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "GetPrivateLinkResources", resp, "Failure sending request") - return - } - - result, err = client.GetPrivateLinkResourcesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "GetPrivateLinkResources", resp, "Failure responding to request") - return - } - - return -} - -// GetPrivateLinkResourcesPreparer prepares the GetPrivateLinkResources request. -func (client DiskAccessesClient) GetPrivateLinkResourcesPreparer(ctx context.Context, resourceGroupName string, diskAccessName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diskAccessName": autorest.Encode("path", diskAccessName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-02" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateLinkResources", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetPrivateLinkResourcesSender sends the GetPrivateLinkResources request. The method will close the -// http.Response Body if it receives an error. -func (client DiskAccessesClient) GetPrivateLinkResourcesSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetPrivateLinkResourcesResponder handles the response to the GetPrivateLinkResources request. The method always -// closes the http.Response Body. -func (client DiskAccessesClient) GetPrivateLinkResourcesResponder(resp *http.Response) (result PrivateLinkResourceListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists all the disk access resources under a subscription. -func (client DiskAccessesClient) List(ctx context.Context) (result DiskAccessListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskAccessesClient.List") - defer func() { - sc := -1 - if result.dal.Response.Response != nil { - sc = result.dal.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.dal.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "List", resp, "Failure sending request") - return - } - - result.dal, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "List", resp, "Failure responding to request") - return - } - if result.dal.hasNextLink() && result.dal.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client DiskAccessesClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-02" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/diskAccesses", 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 DiskAccessesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client DiskAccessesClient) ListResponder(resp *http.Response) (result DiskAccessList, err error) { - err = autorest.Respond( - resp, - 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 DiskAccessesClient) listNextResults(ctx context.Context, lastResults DiskAccessList) (result DiskAccessList, err error) { - req, err := lastResults.diskAccessListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "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, "compute.DiskAccessesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client DiskAccessesClient) ListComplete(ctx context.Context) (result DiskAccessListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskAccessesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} - -// ListByResourceGroup lists all the disk access resources under a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client DiskAccessesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result DiskAccessListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskAccessesClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.dal.Response.Response != nil { - sc = result.dal.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.dal.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.dal, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.dal.hasNextLink() && result.dal.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client DiskAccessesClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-02" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses", pathParameters), - autorest.WithQueryParameters(queryParameters)) - 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 DiskAccessesClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client DiskAccessesClient) ListByResourceGroupResponder(resp *http.Response) (result DiskAccessList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client DiskAccessesClient) listByResourceGroupNextResults(ctx context.Context, lastResults DiskAccessList) (result DiskAccessList, err error) { - req, err := lastResults.diskAccessListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client DiskAccessesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result DiskAccessListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskAccessesClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// ListPrivateEndpointConnections list information about private endpoint connections under a disk access resource -// Parameters: -// resourceGroupName - the name of the resource group. -// diskAccessName - the name of the disk access resource that is being created. The name can't be changed after -// the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The -// maximum name length is 80 characters. -func (client DiskAccessesClient) ListPrivateEndpointConnections(ctx context.Context, resourceGroupName string, diskAccessName string) (result PrivateEndpointConnectionListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskAccessesClient.ListPrivateEndpointConnections") - defer func() { - sc := -1 - if result.peclr.Response.Response != nil { - sc = result.peclr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listPrivateEndpointConnectionsNextResults - req, err := client.ListPrivateEndpointConnectionsPreparer(ctx, resourceGroupName, diskAccessName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "ListPrivateEndpointConnections", nil, "Failure preparing request") - return - } - - resp, err := client.ListPrivateEndpointConnectionsSender(req) - if err != nil { - result.peclr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "ListPrivateEndpointConnections", resp, "Failure sending request") - return - } - - result.peclr, err = client.ListPrivateEndpointConnectionsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "ListPrivateEndpointConnections", resp, "Failure responding to request") - return - } - if result.peclr.hasNextLink() && result.peclr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPrivateEndpointConnectionsPreparer prepares the ListPrivateEndpointConnections request. -func (client DiskAccessesClient) ListPrivateEndpointConnectionsPreparer(ctx context.Context, resourceGroupName string, diskAccessName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diskAccessName": autorest.Encode("path", diskAccessName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-02" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListPrivateEndpointConnectionsSender sends the ListPrivateEndpointConnections request. The method will close the -// http.Response Body if it receives an error. -func (client DiskAccessesClient) ListPrivateEndpointConnectionsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListPrivateEndpointConnectionsResponder handles the response to the ListPrivateEndpointConnections request. The method always -// closes the http.Response Body. -func (client DiskAccessesClient) ListPrivateEndpointConnectionsResponder(resp *http.Response) (result PrivateEndpointConnectionListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listPrivateEndpointConnectionsNextResults retrieves the next set of results, if any. -func (client DiskAccessesClient) listPrivateEndpointConnectionsNextResults(ctx context.Context, lastResults PrivateEndpointConnectionListResult) (result PrivateEndpointConnectionListResult, err error) { - req, err := lastResults.privateEndpointConnectionListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "listPrivateEndpointConnectionsNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListPrivateEndpointConnectionsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "listPrivateEndpointConnectionsNextResults", resp, "Failure sending next results request") - } - result, err = client.ListPrivateEndpointConnectionsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "listPrivateEndpointConnectionsNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListPrivateEndpointConnectionsComplete enumerates all values, automatically crossing page boundaries as required. -func (client DiskAccessesClient) ListPrivateEndpointConnectionsComplete(ctx context.Context, resourceGroupName string, diskAccessName string) (result PrivateEndpointConnectionListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskAccessesClient.ListPrivateEndpointConnections") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListPrivateEndpointConnections(ctx, resourceGroupName, diskAccessName) - return -} - -// Update updates (patches) a disk access resource. -// Parameters: -// resourceGroupName - the name of the resource group. -// diskAccessName - the name of the disk access resource that is being created. The name can't be changed after -// the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The -// maximum name length is 80 characters. -// diskAccess - disk access object supplied in the body of the Patch disk access operation. -func (client DiskAccessesClient) Update(ctx context.Context, resourceGroupName string, diskAccessName string, diskAccess DiskAccessUpdate) (result DiskAccessesUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskAccessesClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, diskAccessName, diskAccess) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client DiskAccessesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, diskAccessName string, diskAccess DiskAccessUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diskAccessName": autorest.Encode("path", diskAccessName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-02" - 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/diskAccesses/{diskAccessName}", pathParameters), - autorest.WithJSON(diskAccess), - 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 DiskAccessesClient) UpdateSender(req *http.Request) (future DiskAccessesUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client DiskAccessesClient) UpdateResponder(resp *http.Response) (result DiskAccess, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// UpdateAPrivateEndpointConnection approve or reject a private endpoint connection under disk access resource, this -// can't be used to create a new private endpoint connection. -// Parameters: -// resourceGroupName - the name of the resource group. -// diskAccessName - the name of the disk access resource that is being created. The name can't be changed after -// the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The -// maximum name length is 80 characters. -// privateEndpointConnectionName - the name of the private endpoint connection. -// privateEndpointConnection - private endpoint connection object supplied in the body of the Put private -// endpoint connection operation. -func (client DiskAccessesClient) UpdateAPrivateEndpointConnection(ctx context.Context, resourceGroupName string, diskAccessName string, privateEndpointConnectionName string, privateEndpointConnection PrivateEndpointConnection) (result DiskAccessesUpdateAPrivateEndpointConnectionFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskAccessesClient.UpdateAPrivateEndpointConnection") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: privateEndpointConnection, - Constraints: []validation.Constraint{{Target: "privateEndpointConnection.PrivateEndpointConnectionProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "privateEndpointConnection.PrivateEndpointConnectionProperties.PrivateLinkServiceConnectionState", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("compute.DiskAccessesClient", "UpdateAPrivateEndpointConnection", err.Error()) - } - - req, err := client.UpdateAPrivateEndpointConnectionPreparer(ctx, resourceGroupName, diskAccessName, privateEndpointConnectionName, privateEndpointConnection) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "UpdateAPrivateEndpointConnection", nil, "Failure preparing request") - return - } - - result, err = client.UpdateAPrivateEndpointConnectionSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "UpdateAPrivateEndpointConnection", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdateAPrivateEndpointConnectionPreparer prepares the UpdateAPrivateEndpointConnection request. -func (client DiskAccessesClient) UpdateAPrivateEndpointConnectionPreparer(ctx context.Context, resourceGroupName string, diskAccessName string, privateEndpointConnectionName string, privateEndpointConnection PrivateEndpointConnection) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diskAccessName": autorest.Encode("path", diskAccessName), - "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-02" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - privateEndpointConnection.ID = nil - privateEndpointConnection.Name = nil - privateEndpointConnection.Type = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), - autorest.WithJSON(privateEndpointConnection), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateAPrivateEndpointConnectionSender sends the UpdateAPrivateEndpointConnection request. The method will close the -// http.Response Body if it receives an error. -func (client DiskAccessesClient) UpdateAPrivateEndpointConnectionSender(req *http.Request) (future DiskAccessesUpdateAPrivateEndpointConnectionFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateAPrivateEndpointConnectionResponder handles the response to the UpdateAPrivateEndpointConnection request. The method always -// closes the http.Response Body. -func (client DiskAccessesClient) UpdateAPrivateEndpointConnectionResponder(resp *http.Response) (result PrivateEndpointConnection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - 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/2022-08-01/compute/diskencryptionsets.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/diskencryptionsets.go deleted file mode 100644 index ed5632a3..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/diskencryptionsets.go +++ /dev/null @@ -1,719 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// DiskEncryptionSetsClient is the compute Client -type DiskEncryptionSetsClient struct { - BaseClient -} - -// NewDiskEncryptionSetsClient creates an instance of the DiskEncryptionSetsClient client. -func NewDiskEncryptionSetsClient(subscriptionID string) DiskEncryptionSetsClient { - return NewDiskEncryptionSetsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewDiskEncryptionSetsClientWithBaseURI creates an instance of the DiskEncryptionSetsClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewDiskEncryptionSetsClientWithBaseURI(baseURI string, subscriptionID string) DiskEncryptionSetsClient { - return DiskEncryptionSetsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a disk encryption set -// Parameters: -// resourceGroupName - the name of the resource group. -// diskEncryptionSetName - the name of the disk encryption set that is being created. The name can't be changed -// after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The -// maximum name length is 80 characters. -// diskEncryptionSet - disk encryption set object supplied in the body of the Put disk encryption set -// operation. -func (client DiskEncryptionSetsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, diskEncryptionSet DiskEncryptionSet) (result DiskEncryptionSetsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: diskEncryptionSet, - Constraints: []validation.Constraint{{Target: "diskEncryptionSet.EncryptionSetProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "diskEncryptionSet.EncryptionSetProperties.ActiveKey", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "diskEncryptionSet.EncryptionSetProperties.ActiveKey.KeyURL", Name: validation.Null, Rule: true, Chain: nil}}}, - }}}}}); err != nil { - return result, validation.NewError("compute.DiskEncryptionSetsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, diskEncryptionSetName, diskEncryptionSet) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client DiskEncryptionSetsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, diskEncryptionSet DiskEncryptionSet) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diskEncryptionSetName": autorest.Encode("path", diskEncryptionSetName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-02" - 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.Compute/diskEncryptionSets/{diskEncryptionSetName}", pathParameters), - autorest.WithJSON(diskEncryptionSet), - 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 DiskEncryptionSetsClient) CreateOrUpdateSender(req *http.Request) (future DiskEncryptionSetsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client DiskEncryptionSetsClient) CreateOrUpdateResponder(resp *http.Response) (result DiskEncryptionSet, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a disk encryption set. -// Parameters: -// resourceGroupName - the name of the resource group. -// diskEncryptionSetName - the name of the disk encryption set that is being created. The name can't be changed -// after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The -// maximum name length is 80 characters. -func (client DiskEncryptionSetsClient) Delete(ctx context.Context, resourceGroupName string, diskEncryptionSetName string) (result DiskEncryptionSetsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, diskEncryptionSetName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client DiskEncryptionSetsClient) DeletePreparer(ctx context.Context, resourceGroupName string, diskEncryptionSetName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diskEncryptionSetName": autorest.Encode("path", diskEncryptionSetName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-02" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}", 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 DiskEncryptionSetsClient) DeleteSender(req *http.Request) (future DiskEncryptionSetsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client DiskEncryptionSetsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets information about a disk encryption set. -// Parameters: -// resourceGroupName - the name of the resource group. -// diskEncryptionSetName - the name of the disk encryption set that is being created. The name can't be changed -// after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The -// maximum name length is 80 characters. -func (client DiskEncryptionSetsClient) Get(ctx context.Context, resourceGroupName string, diskEncryptionSetName string) (result DiskEncryptionSet, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, diskEncryptionSetName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client DiskEncryptionSetsClient) GetPreparer(ctx context.Context, resourceGroupName string, diskEncryptionSetName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diskEncryptionSetName": autorest.Encode("path", diskEncryptionSetName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-02" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}", 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 DiskEncryptionSetsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client DiskEncryptionSetsClient) GetResponder(resp *http.Response) (result DiskEncryptionSet, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists all the disk encryption sets under a subscription. -func (client DiskEncryptionSetsClient) List(ctx context.Context) (result DiskEncryptionSetListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetsClient.List") - defer func() { - sc := -1 - if result.desl.Response.Response != nil { - sc = result.desl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.desl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "List", resp, "Failure sending request") - return - } - - result.desl, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "List", resp, "Failure responding to request") - return - } - if result.desl.hasNextLink() && result.desl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client DiskEncryptionSetsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-02" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/diskEncryptionSets", 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 DiskEncryptionSetsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client DiskEncryptionSetsClient) ListResponder(resp *http.Response) (result DiskEncryptionSetList, err error) { - err = autorest.Respond( - resp, - 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 DiskEncryptionSetsClient) listNextResults(ctx context.Context, lastResults DiskEncryptionSetList) (result DiskEncryptionSetList, err error) { - req, err := lastResults.diskEncryptionSetListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "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, "compute.DiskEncryptionSetsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client DiskEncryptionSetsClient) ListComplete(ctx context.Context) (result DiskEncryptionSetListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} - -// ListAssociatedResources lists all resources that are encrypted with this disk encryption set. -// Parameters: -// resourceGroupName - the name of the resource group. -// diskEncryptionSetName - the name of the disk encryption set that is being created. The name can't be changed -// after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The -// maximum name length is 80 characters. -func (client DiskEncryptionSetsClient) ListAssociatedResources(ctx context.Context, resourceGroupName string, diskEncryptionSetName string) (result ResourceURIListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetsClient.ListAssociatedResources") - defer func() { - sc := -1 - if result.rul.Response.Response != nil { - sc = result.rul.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listAssociatedResourcesNextResults - req, err := client.ListAssociatedResourcesPreparer(ctx, resourceGroupName, diskEncryptionSetName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "ListAssociatedResources", nil, "Failure preparing request") - return - } - - resp, err := client.ListAssociatedResourcesSender(req) - if err != nil { - result.rul.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "ListAssociatedResources", resp, "Failure sending request") - return - } - - result.rul, err = client.ListAssociatedResourcesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "ListAssociatedResources", resp, "Failure responding to request") - return - } - if result.rul.hasNextLink() && result.rul.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListAssociatedResourcesPreparer prepares the ListAssociatedResources request. -func (client DiskEncryptionSetsClient) ListAssociatedResourcesPreparer(ctx context.Context, resourceGroupName string, diskEncryptionSetName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diskEncryptionSetName": autorest.Encode("path", diskEncryptionSetName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-02" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}/associatedResources", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAssociatedResourcesSender sends the ListAssociatedResources request. The method will close the -// http.Response Body if it receives an error. -func (client DiskEncryptionSetsClient) ListAssociatedResourcesSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAssociatedResourcesResponder handles the response to the ListAssociatedResources request. The method always -// closes the http.Response Body. -func (client DiskEncryptionSetsClient) ListAssociatedResourcesResponder(resp *http.Response) (result ResourceURIList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listAssociatedResourcesNextResults retrieves the next set of results, if any. -func (client DiskEncryptionSetsClient) listAssociatedResourcesNextResults(ctx context.Context, lastResults ResourceURIList) (result ResourceURIList, err error) { - req, err := lastResults.resourceURIListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "listAssociatedResourcesNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListAssociatedResourcesSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "listAssociatedResourcesNextResults", resp, "Failure sending next results request") - } - result, err = client.ListAssociatedResourcesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "listAssociatedResourcesNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListAssociatedResourcesComplete enumerates all values, automatically crossing page boundaries as required. -func (client DiskEncryptionSetsClient) ListAssociatedResourcesComplete(ctx context.Context, resourceGroupName string, diskEncryptionSetName string) (result ResourceURIListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetsClient.ListAssociatedResources") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListAssociatedResources(ctx, resourceGroupName, diskEncryptionSetName) - return -} - -// ListByResourceGroup lists all the disk encryption sets under a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client DiskEncryptionSetsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result DiskEncryptionSetListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.desl.Response.Response != nil { - sc = result.desl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.desl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.desl, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.desl.hasNextLink() && result.desl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client DiskEncryptionSetsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-02" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets", pathParameters), - autorest.WithQueryParameters(queryParameters)) - 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 DiskEncryptionSetsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client DiskEncryptionSetsClient) ListByResourceGroupResponder(resp *http.Response) (result DiskEncryptionSetList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client DiskEncryptionSetsClient) listByResourceGroupNextResults(ctx context.Context, lastResults DiskEncryptionSetList) (result DiskEncryptionSetList, err error) { - req, err := lastResults.diskEncryptionSetListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client DiskEncryptionSetsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result DiskEncryptionSetListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// Update updates (patches) a disk encryption set. -// Parameters: -// resourceGroupName - the name of the resource group. -// diskEncryptionSetName - the name of the disk encryption set that is being created. The name can't be changed -// after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The -// maximum name length is 80 characters. -// diskEncryptionSet - disk encryption set object supplied in the body of the Patch disk encryption set -// operation. -func (client DiskEncryptionSetsClient) Update(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, diskEncryptionSet DiskEncryptionSetUpdate) (result DiskEncryptionSetsUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetsClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, diskEncryptionSetName, diskEncryptionSet) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client DiskEncryptionSetsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, diskEncryptionSet DiskEncryptionSetUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diskEncryptionSetName": autorest.Encode("path", diskEncryptionSetName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-02" - 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/diskEncryptionSets/{diskEncryptionSetName}", pathParameters), - autorest.WithJSON(diskEncryptionSet), - 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 DiskEncryptionSetsClient) UpdateSender(req *http.Request) (future DiskEncryptionSetsUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client DiskEncryptionSetsClient) UpdateResponder(resp *http.Response) (result DiskEncryptionSet, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - 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/2022-08-01/compute/diskrestorepoint.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/diskrestorepoint.go deleted file mode 100644 index 2f38511c..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/diskrestorepoint.go +++ /dev/null @@ -1,407 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// DiskRestorePointClient is the compute Client -type DiskRestorePointClient struct { - BaseClient -} - -// NewDiskRestorePointClient creates an instance of the DiskRestorePointClient client. -func NewDiskRestorePointClient(subscriptionID string) DiskRestorePointClient { - return NewDiskRestorePointClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewDiskRestorePointClientWithBaseURI creates an instance of the DiskRestorePointClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewDiskRestorePointClientWithBaseURI(baseURI string, subscriptionID string) DiskRestorePointClient { - return DiskRestorePointClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get get disk restorePoint resource -// Parameters: -// resourceGroupName - the name of the resource group. -// restorePointCollectionName - the name of the restore point collection that the disk restore point belongs. -// VMRestorePointName - the name of the vm restore point that the disk disk restore point belongs. -// diskRestorePointName - the name of the disk restore point created. -func (client DiskRestorePointClient) Get(ctx context.Context, resourceGroupName string, restorePointCollectionName string, VMRestorePointName string, diskRestorePointName string) (result DiskRestorePoint, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskRestorePointClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, restorePointCollectionName, VMRestorePointName, diskRestorePointName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskRestorePointClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.DiskRestorePointClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskRestorePointClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client DiskRestorePointClient) GetPreparer(ctx context.Context, resourceGroupName string, restorePointCollectionName string, VMRestorePointName string, diskRestorePointName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diskRestorePointName": autorest.Encode("path", diskRestorePointName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "restorePointCollectionName": autorest.Encode("path", restorePointCollectionName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmRestorePointName": autorest.Encode("path", VMRestorePointName), - } - - const APIVersion = "2022-07-02" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints/{diskRestorePointName}", 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 DiskRestorePointClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client DiskRestorePointClient) GetResponder(resp *http.Response) (result DiskRestorePoint, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GrantAccess grants access to a diskRestorePoint. -// Parameters: -// resourceGroupName - the name of the resource group. -// restorePointCollectionName - the name of the restore point collection that the disk restore point belongs. -// VMRestorePointName - the name of the vm restore point that the disk disk restore point belongs. -// diskRestorePointName - the name of the disk restore point created. -// grantAccessData - access data object supplied in the body of the get disk access operation. -func (client DiskRestorePointClient) GrantAccess(ctx context.Context, resourceGroupName string, restorePointCollectionName string, VMRestorePointName string, diskRestorePointName string, grantAccessData GrantAccessData) (result DiskRestorePointGrantAccessFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskRestorePointClient.GrantAccess") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - 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.NewError("compute.DiskRestorePointClient", "GrantAccess", err.Error()) - } - - req, err := client.GrantAccessPreparer(ctx, resourceGroupName, restorePointCollectionName, VMRestorePointName, diskRestorePointName, grantAccessData) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskRestorePointClient", "GrantAccess", nil, "Failure preparing request") - return - } - - result, err = client.GrantAccessSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskRestorePointClient", "GrantAccess", result.Response(), "Failure sending request") - return - } - - return -} - -// GrantAccessPreparer prepares the GrantAccess request. -func (client DiskRestorePointClient) GrantAccessPreparer(ctx context.Context, resourceGroupName string, restorePointCollectionName string, VMRestorePointName string, diskRestorePointName string, grantAccessData GrantAccessData) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diskRestorePointName": autorest.Encode("path", diskRestorePointName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "restorePointCollectionName": autorest.Encode("path", restorePointCollectionName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmRestorePointName": autorest.Encode("path", VMRestorePointName), - } - - const APIVersion = "2022-07-02" - 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.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints/{diskRestorePointName}/beginGetAccess", pathParameters), - autorest.WithJSON(grantAccessData), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GrantAccessSender sends the GrantAccess request. The method will close the -// http.Response Body if it receives an error. -func (client DiskRestorePointClient) GrantAccessSender(req *http.Request) (future DiskRestorePointGrantAccessFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// GrantAccessResponder handles the response to the GrantAccess request. The method always -// closes the http.Response Body. -func (client DiskRestorePointClient) GrantAccessResponder(resp *http.Response) (result AccessURI, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByRestorePoint lists diskRestorePoints under a vmRestorePoint. -// Parameters: -// resourceGroupName - the name of the resource group. -// restorePointCollectionName - the name of the restore point collection that the disk restore point belongs. -// VMRestorePointName - the name of the vm restore point that the disk disk restore point belongs. -func (client DiskRestorePointClient) ListByRestorePoint(ctx context.Context, resourceGroupName string, restorePointCollectionName string, VMRestorePointName string) (result DiskRestorePointListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskRestorePointClient.ListByRestorePoint") - defer func() { - sc := -1 - if result.drpl.Response.Response != nil { - sc = result.drpl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByRestorePointNextResults - req, err := client.ListByRestorePointPreparer(ctx, resourceGroupName, restorePointCollectionName, VMRestorePointName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskRestorePointClient", "ListByRestorePoint", nil, "Failure preparing request") - return - } - - resp, err := client.ListByRestorePointSender(req) - if err != nil { - result.drpl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.DiskRestorePointClient", "ListByRestorePoint", resp, "Failure sending request") - return - } - - result.drpl, err = client.ListByRestorePointResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskRestorePointClient", "ListByRestorePoint", resp, "Failure responding to request") - return - } - if result.drpl.hasNextLink() && result.drpl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByRestorePointPreparer prepares the ListByRestorePoint request. -func (client DiskRestorePointClient) ListByRestorePointPreparer(ctx context.Context, resourceGroupName string, restorePointCollectionName string, VMRestorePointName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "restorePointCollectionName": autorest.Encode("path", restorePointCollectionName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmRestorePointName": autorest.Encode("path", VMRestorePointName), - } - - const APIVersion = "2022-07-02" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByRestorePointSender sends the ListByRestorePoint request. The method will close the -// http.Response Body if it receives an error. -func (client DiskRestorePointClient) ListByRestorePointSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByRestorePointResponder handles the response to the ListByRestorePoint request. The method always -// closes the http.Response Body. -func (client DiskRestorePointClient) ListByRestorePointResponder(resp *http.Response) (result DiskRestorePointList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByRestorePointNextResults retrieves the next set of results, if any. -func (client DiskRestorePointClient) listByRestorePointNextResults(ctx context.Context, lastResults DiskRestorePointList) (result DiskRestorePointList, err error) { - req, err := lastResults.diskRestorePointListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.DiskRestorePointClient", "listByRestorePointNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByRestorePointSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.DiskRestorePointClient", "listByRestorePointNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByRestorePointResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskRestorePointClient", "listByRestorePointNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByRestorePointComplete enumerates all values, automatically crossing page boundaries as required. -func (client DiskRestorePointClient) ListByRestorePointComplete(ctx context.Context, resourceGroupName string, restorePointCollectionName string, VMRestorePointName string) (result DiskRestorePointListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskRestorePointClient.ListByRestorePoint") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByRestorePoint(ctx, resourceGroupName, restorePointCollectionName, VMRestorePointName) - return -} - -// RevokeAccess revokes access to a diskRestorePoint. -// Parameters: -// resourceGroupName - the name of the resource group. -// restorePointCollectionName - the name of the restore point collection that the disk restore point belongs. -// VMRestorePointName - the name of the vm restore point that the disk disk restore point belongs. -// diskRestorePointName - the name of the disk restore point created. -func (client DiskRestorePointClient) RevokeAccess(ctx context.Context, resourceGroupName string, restorePointCollectionName string, VMRestorePointName string, diskRestorePointName string) (result DiskRestorePointRevokeAccessFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskRestorePointClient.RevokeAccess") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.RevokeAccessPreparer(ctx, resourceGroupName, restorePointCollectionName, VMRestorePointName, diskRestorePointName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskRestorePointClient", "RevokeAccess", nil, "Failure preparing request") - return - } - - result, err = client.RevokeAccessSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskRestorePointClient", "RevokeAccess", result.Response(), "Failure sending request") - return - } - - return -} - -// RevokeAccessPreparer prepares the RevokeAccess request. -func (client DiskRestorePointClient) RevokeAccessPreparer(ctx context.Context, resourceGroupName string, restorePointCollectionName string, VMRestorePointName string, diskRestorePointName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diskRestorePointName": autorest.Encode("path", diskRestorePointName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "restorePointCollectionName": autorest.Encode("path", restorePointCollectionName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmRestorePointName": autorest.Encode("path", VMRestorePointName), - } - - const APIVersion = "2022-07-02" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints/{diskRestorePointName}/endGetAccess", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RevokeAccessSender sends the RevokeAccess request. The method will close the -// http.Response Body if it receives an error. -func (client DiskRestorePointClient) RevokeAccessSender(req *http.Request) (future DiskRestorePointRevokeAccessFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// RevokeAccessResponder handles the response to the RevokeAccess request. The method always -// closes the http.Response Body. -func (client DiskRestorePointClient) RevokeAccessResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/disks.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/disks.go deleted file mode 100644 index a8a4f411..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/disks.go +++ /dev/null @@ -1,774 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// DisksClient is the compute Client -type DisksClient struct { - BaseClient -} - -// NewDisksClient creates an instance of the DisksClient client. -func NewDisksClient(subscriptionID string) DisksClient { - return NewDisksClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewDisksClientWithBaseURI creates an instance of the DisksClient client using a custom endpoint. Use this when -// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewDisksClientWithBaseURI(baseURI string, subscriptionID string) DisksClient { - return DisksClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a disk. -// Parameters: -// resourceGroupName - the name of the resource group. -// diskName - 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 - 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 tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: disk, - Constraints: []validation.Constraint{{Target: "disk.DiskProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "disk.DiskProperties.PurchasePlan", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "disk.DiskProperties.PurchasePlan.Publisher", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "disk.DiskProperties.PurchasePlan.Name", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "disk.DiskProperties.PurchasePlan.Product", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "disk.DiskProperties.CreationData", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "disk.DiskProperties.EncryptionSettingsCollection", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "disk.DiskProperties.EncryptionSettingsCollection.Enabled", Name: validation.Null, Rule: true, Chain: nil}}}, - }}}}}); err != nil { - return result, validation.NewError("compute.DisksClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, diskName, disk) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client DisksClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, diskName string, disk Disk) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diskName": autorest.Encode("path", diskName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-02" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - disk.ManagedBy = nil - disk.ManagedByExtended = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}", pathParameters), - autorest.WithJSON(disk), - 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 DisksClient) CreateOrUpdateSender(req *http.Request) (future DisksCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client DisksClient) CreateOrUpdateResponder(resp *http.Response) (result Disk, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a disk. -// Parameters: -// resourceGroupName - the name of the resource group. -// diskName - 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) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, diskName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client DisksClient) DeletePreparer(ctx context.Context, resourceGroupName string, diskName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diskName": autorest.Encode("path", diskName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-02" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}", 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 DisksClient) DeleteSender(req *http.Request) (future DisksDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client DisksClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets information about a disk. -// Parameters: -// resourceGroupName - the name of the resource group. -// diskName - 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) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, diskName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.DisksClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client DisksClient) GetPreparer(ctx context.Context, resourceGroupName string, diskName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diskName": autorest.Encode("path", diskName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-02" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}", 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 DisksClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client DisksClient) GetResponder(resp *http.Response) (result Disk, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GrantAccess grants access to a disk. -// Parameters: -// resourceGroupName - the name of the resource group. -// diskName - 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 - 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 tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.GrantAccess") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - 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.NewError("compute.DisksClient", "GrantAccess", err.Error()) - } - - req, err := client.GrantAccessPreparer(ctx, resourceGroupName, diskName, grantAccessData) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "GrantAccess", nil, "Failure preparing request") - return - } - - result, err = client.GrantAccessSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "GrantAccess", result.Response(), "Failure sending request") - return - } - - return -} - -// GrantAccessPreparer prepares the GrantAccess request. -func (client DisksClient) GrantAccessPreparer(ctx context.Context, resourceGroupName string, diskName string, grantAccessData GrantAccessData) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diskName": autorest.Encode("path", diskName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-02" - 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.Compute/disks/{diskName}/beginGetAccess", pathParameters), - autorest.WithJSON(grantAccessData), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GrantAccessSender sends the GrantAccess request. The method will close the -// http.Response Body if it receives an error. -func (client DisksClient) GrantAccessSender(req *http.Request) (future DisksGrantAccessFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// GrantAccessResponder handles the response to the GrantAccess request. The method always -// closes the http.Response Body. -func (client DisksClient) GrantAccessResponder(resp *http.Response) (result AccessURI, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists all the disks under a subscription. -func (client DisksClient) List(ctx context.Context) (result DiskListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.List") - defer func() { - sc := -1 - if result.dl.Response.Response != nil { - sc = result.dl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.dl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.DisksClient", "List", resp, "Failure sending request") - return - } - - result.dl, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "List", resp, "Failure responding to request") - return - } - if result.dl.hasNextLink() && result.dl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client DisksClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-02" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/disks", 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 DisksClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client DisksClient) ListResponder(resp *http.Response) (result DiskList, err error) { - err = autorest.Respond( - resp, - 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 DisksClient) listNextResults(ctx context.Context, lastResults DiskList) (result DiskList, err error) { - req, err := lastResults.diskListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.DisksClient", "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, "compute.DisksClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client DisksClient) ListComplete(ctx context.Context) (result DiskListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} - -// ListByResourceGroup lists all the disks under a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client DisksClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result DiskListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.dl.Response.Response != nil { - sc = result.dl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.dl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.DisksClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.dl, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.dl.hasNextLink() && result.dl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client DisksClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-02" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks", pathParameters), - autorest.WithQueryParameters(queryParameters)) - 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 DisksClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client DisksClient) ListByResourceGroupResponder(resp *http.Response) (result DiskList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client DisksClient) listByResourceGroupNextResults(ctx context.Context, lastResults DiskList) (result DiskList, err error) { - req, err := lastResults.diskListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.DisksClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.DisksClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client DisksClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result DiskListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// RevokeAccess revokes access to a disk. -// Parameters: -// resourceGroupName - the name of the resource group. -// diskName - 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) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.RevokeAccess") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.RevokeAccessPreparer(ctx, resourceGroupName, diskName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "RevokeAccess", nil, "Failure preparing request") - return - } - - result, err = client.RevokeAccessSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "RevokeAccess", result.Response(), "Failure sending request") - return - } - - return -} - -// RevokeAccessPreparer prepares the RevokeAccess request. -func (client DisksClient) RevokeAccessPreparer(ctx context.Context, resourceGroupName string, diskName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diskName": autorest.Encode("path", diskName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-02" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/endGetAccess", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RevokeAccessSender sends the RevokeAccess request. The method will close the -// http.Response Body if it receives an error. -func (client DisksClient) RevokeAccessSender(req *http.Request) (future DisksRevokeAccessFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// RevokeAccessResponder handles the response to the RevokeAccess request. The method always -// closes the http.Response Body. -func (client DisksClient) RevokeAccessResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Update updates (patches) a disk. -// Parameters: -// resourceGroupName - the name of the resource group. -// diskName - 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 - 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) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, diskName, disk) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client DisksClient) UpdatePreparer(ctx context.Context, resourceGroupName string, diskName string, disk DiskUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diskName": autorest.Encode("path", diskName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-02" - 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/disks/{diskName}", pathParameters), - autorest.WithJSON(disk), - 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 DisksClient) UpdateSender(req *http.Request) (future DisksUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client DisksClient) UpdateResponder(resp *http.Response) (result Disk, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - 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/2022-08-01/compute/enums.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/enums.go deleted file mode 100644 index cf404eb9..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/enums.go +++ /dev/null @@ -1,2248 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -// AccessLevel enumerates the values for access level. -type AccessLevel string - -const ( - // None ... - None AccessLevel = "None" - // Read ... - Read AccessLevel = "Read" - // Write ... - Write AccessLevel = "Write" -) - -// PossibleAccessLevelValues returns an array of possible values for the AccessLevel const type. -func PossibleAccessLevelValues() []AccessLevel { - return []AccessLevel{None, Read, Write} -} - -// AggregatedReplicationState enumerates the values for aggregated replication state. -type AggregatedReplicationState string - -const ( - // Completed ... - Completed AggregatedReplicationState = "Completed" - // Failed ... - Failed AggregatedReplicationState = "Failed" - // InProgress ... - InProgress AggregatedReplicationState = "InProgress" - // Unknown ... - Unknown AggregatedReplicationState = "Unknown" -) - -// PossibleAggregatedReplicationStateValues returns an array of possible values for the AggregatedReplicationState const type. -func PossibleAggregatedReplicationStateValues() []AggregatedReplicationState { - return []AggregatedReplicationState{Completed, Failed, InProgress, Unknown} -} - -// Architecture enumerates the values for architecture. -type Architecture string - -const ( - // Arm64 ... - Arm64 Architecture = "Arm64" - // X64 ... - X64 Architecture = "x64" -) - -// PossibleArchitectureValues returns an array of possible values for the Architecture const type. -func PossibleArchitectureValues() []Architecture { - return []Architecture{Arm64, X64} -} - -// ArchitectureTypes enumerates the values for architecture types. -type ArchitectureTypes string - -const ( - // ArchitectureTypesArm64 ... - ArchitectureTypesArm64 ArchitectureTypes = "Arm64" - // ArchitectureTypesX64 ... - ArchitectureTypesX64 ArchitectureTypes = "x64" -) - -// PossibleArchitectureTypesValues returns an array of possible values for the ArchitectureTypes const type. -func PossibleArchitectureTypesValues() []ArchitectureTypes { - return []ArchitectureTypes{ArchitectureTypesArm64, ArchitectureTypesX64} -} - -// AvailabilitySetSkuTypes enumerates the values for availability set sku types. -type AvailabilitySetSkuTypes string - -const ( - // Aligned ... - Aligned AvailabilitySetSkuTypes = "Aligned" - // Classic ... - Classic AvailabilitySetSkuTypes = "Classic" -) - -// PossibleAvailabilitySetSkuTypesValues returns an array of possible values for the AvailabilitySetSkuTypes const type. -func PossibleAvailabilitySetSkuTypesValues() []AvailabilitySetSkuTypes { - return []AvailabilitySetSkuTypes{Aligned, Classic} -} - -// CachingTypes enumerates the values for caching types. -type CachingTypes string - -const ( - // CachingTypesNone ... - CachingTypesNone CachingTypes = "None" - // CachingTypesReadOnly ... - CachingTypesReadOnly CachingTypes = "ReadOnly" - // CachingTypesReadWrite ... - CachingTypesReadWrite CachingTypes = "ReadWrite" -) - -// PossibleCachingTypesValues returns an array of possible values for the CachingTypes const type. -func PossibleCachingTypesValues() []CachingTypes { - return []CachingTypes{CachingTypesNone, CachingTypesReadOnly, CachingTypesReadWrite} -} - -// CapacityReservationGroupInstanceViewTypes enumerates the values for capacity reservation group instance view -// types. -type CapacityReservationGroupInstanceViewTypes string - -const ( - // InstanceView ... - InstanceView CapacityReservationGroupInstanceViewTypes = "instanceView" -) - -// PossibleCapacityReservationGroupInstanceViewTypesValues returns an array of possible values for the CapacityReservationGroupInstanceViewTypes const type. -func PossibleCapacityReservationGroupInstanceViewTypesValues() []CapacityReservationGroupInstanceViewTypes { - return []CapacityReservationGroupInstanceViewTypes{InstanceView} -} - -// CapacityReservationInstanceViewTypes enumerates the values for capacity reservation instance view types. -type CapacityReservationInstanceViewTypes string - -const ( - // CapacityReservationInstanceViewTypesInstanceView ... - CapacityReservationInstanceViewTypesInstanceView CapacityReservationInstanceViewTypes = "instanceView" -) - -// PossibleCapacityReservationInstanceViewTypesValues returns an array of possible values for the CapacityReservationInstanceViewTypes const type. -func PossibleCapacityReservationInstanceViewTypesValues() []CapacityReservationInstanceViewTypes { - return []CapacityReservationInstanceViewTypes{CapacityReservationInstanceViewTypesInstanceView} -} - -// CloudServiceSlotType enumerates the values for cloud service slot type. -type CloudServiceSlotType string - -const ( - // Production ... - Production CloudServiceSlotType = "Production" - // Staging ... - Staging CloudServiceSlotType = "Staging" -) - -// PossibleCloudServiceSlotTypeValues returns an array of possible values for the CloudServiceSlotType const type. -func PossibleCloudServiceSlotTypeValues() []CloudServiceSlotType { - return []CloudServiceSlotType{Production, Staging} -} - -// CloudServiceUpgradeMode enumerates the values for cloud service upgrade mode. -type CloudServiceUpgradeMode string - -const ( - // Auto ... - Auto CloudServiceUpgradeMode = "Auto" - // Manual ... - Manual CloudServiceUpgradeMode = "Manual" - // Simultaneous ... - Simultaneous CloudServiceUpgradeMode = "Simultaneous" -) - -// PossibleCloudServiceUpgradeModeValues returns an array of possible values for the CloudServiceUpgradeMode const type. -func PossibleCloudServiceUpgradeModeValues() []CloudServiceUpgradeMode { - return []CloudServiceUpgradeMode{Auto, Manual, Simultaneous} -} - -// ComponentNames enumerates the values for component names. -type ComponentNames string - -const ( - // MicrosoftWindowsShellSetup ... - MicrosoftWindowsShellSetup ComponentNames = "Microsoft-Windows-Shell-Setup" -) - -// PossibleComponentNamesValues returns an array of possible values for the ComponentNames const type. -func PossibleComponentNamesValues() []ComponentNames { - return []ComponentNames{MicrosoftWindowsShellSetup} -} - -// ConfidentialVMEncryptionType enumerates the values for confidential vm encryption type. -type ConfidentialVMEncryptionType string - -const ( - // EncryptedVMGuestStateOnlyWithPmk ... - EncryptedVMGuestStateOnlyWithPmk ConfidentialVMEncryptionType = "EncryptedVMGuestStateOnlyWithPmk" - // EncryptedWithCmk ... - EncryptedWithCmk ConfidentialVMEncryptionType = "EncryptedWithCmk" - // EncryptedWithPmk ... - EncryptedWithPmk ConfidentialVMEncryptionType = "EncryptedWithPmk" -) - -// PossibleConfidentialVMEncryptionTypeValues returns an array of possible values for the ConfidentialVMEncryptionType const type. -func PossibleConfidentialVMEncryptionTypeValues() []ConfidentialVMEncryptionType { - return []ConfidentialVMEncryptionType{EncryptedVMGuestStateOnlyWithPmk, EncryptedWithCmk, EncryptedWithPmk} -} - -// ConsistencyModeTypes enumerates the values for consistency mode types. -type ConsistencyModeTypes string - -const ( - // ApplicationConsistent ... - ApplicationConsistent ConsistencyModeTypes = "ApplicationConsistent" - // CrashConsistent ... - CrashConsistent ConsistencyModeTypes = "CrashConsistent" - // FileSystemConsistent ... - FileSystemConsistent ConsistencyModeTypes = "FileSystemConsistent" -) - -// PossibleConsistencyModeTypesValues returns an array of possible values for the ConsistencyModeTypes const type. -func PossibleConsistencyModeTypesValues() []ConsistencyModeTypes { - return []ConsistencyModeTypes{ApplicationConsistent, CrashConsistent, FileSystemConsistent} -} - -// DataAccessAuthMode enumerates the values for data access auth mode. -type DataAccessAuthMode string - -const ( - // DataAccessAuthModeAzureActiveDirectory When export/upload URL is used, the system checks if the user has - // an identity in Azure Active Directory and has necessary permissions to export/upload the data. Please - // refer to aka.ms/DisksAzureADAuth. - DataAccessAuthModeAzureActiveDirectory DataAccessAuthMode = "AzureActiveDirectory" - // DataAccessAuthModeNone No additional authentication would be performed when accessing export/upload URL. - DataAccessAuthModeNone DataAccessAuthMode = "None" -) - -// PossibleDataAccessAuthModeValues returns an array of possible values for the DataAccessAuthMode const type. -func PossibleDataAccessAuthModeValues() []DataAccessAuthMode { - return []DataAccessAuthMode{DataAccessAuthModeAzureActiveDirectory, DataAccessAuthModeNone} -} - -// DedicatedHostLicenseTypes enumerates the values for dedicated host license types. -type DedicatedHostLicenseTypes string - -const ( - // DedicatedHostLicenseTypesNone ... - DedicatedHostLicenseTypesNone DedicatedHostLicenseTypes = "None" - // DedicatedHostLicenseTypesWindowsServerHybrid ... - DedicatedHostLicenseTypesWindowsServerHybrid DedicatedHostLicenseTypes = "Windows_Server_Hybrid" - // DedicatedHostLicenseTypesWindowsServerPerpetual ... - DedicatedHostLicenseTypesWindowsServerPerpetual DedicatedHostLicenseTypes = "Windows_Server_Perpetual" -) - -// PossibleDedicatedHostLicenseTypesValues returns an array of possible values for the DedicatedHostLicenseTypes const type. -func PossibleDedicatedHostLicenseTypesValues() []DedicatedHostLicenseTypes { - return []DedicatedHostLicenseTypes{DedicatedHostLicenseTypesNone, DedicatedHostLicenseTypesWindowsServerHybrid, DedicatedHostLicenseTypesWindowsServerPerpetual} -} - -// DeleteOptions enumerates the values for delete options. -type DeleteOptions string - -const ( - // Delete ... - Delete DeleteOptions = "Delete" - // Detach ... - Detach DeleteOptions = "Detach" -) - -// PossibleDeleteOptionsValues returns an array of possible values for the DeleteOptions const type. -func PossibleDeleteOptionsValues() []DeleteOptions { - return []DeleteOptions{Delete, Detach} -} - -// DiffDiskOptions enumerates the values for diff disk options. -type DiffDiskOptions string - -const ( - // Local ... - Local DiffDiskOptions = "Local" -) - -// PossibleDiffDiskOptionsValues returns an array of possible values for the DiffDiskOptions const type. -func PossibleDiffDiskOptionsValues() []DiffDiskOptions { - return []DiffDiskOptions{Local} -} - -// DiffDiskPlacement enumerates the values for diff disk placement. -type DiffDiskPlacement string - -const ( - // CacheDisk ... - CacheDisk DiffDiskPlacement = "CacheDisk" - // ResourceDisk ... - ResourceDisk DiffDiskPlacement = "ResourceDisk" -) - -// PossibleDiffDiskPlacementValues returns an array of possible values for the DiffDiskPlacement const type. -func PossibleDiffDiskPlacementValues() []DiffDiskPlacement { - return []DiffDiskPlacement{CacheDisk, ResourceDisk} -} - -// DiskControllerTypes enumerates the values for disk controller types. -type DiskControllerTypes string - -const ( - // NVMe ... - NVMe DiskControllerTypes = "NVMe" - // SCSI ... - SCSI DiskControllerTypes = "SCSI" -) - -// PossibleDiskControllerTypesValues returns an array of possible values for the DiskControllerTypes const type. -func PossibleDiskControllerTypesValues() []DiskControllerTypes { - return []DiskControllerTypes{NVMe, SCSI} -} - -// DiskCreateOption enumerates the values for disk create option. -type DiskCreateOption string - -const ( - // Attach Disk will be attached to a VM. - Attach DiskCreateOption = "Attach" - // Copy Create a new disk or snapshot by copying from a disk or snapshot specified by the given - // sourceResourceId. - Copy DiskCreateOption = "Copy" - // CopyStart Create a new disk by using a deep copy process, where the resource creation is considered - // complete only after all data has been copied from the source. - CopyStart DiskCreateOption = "CopyStart" - // Empty Create an empty data disk of a size given by diskSizeGB. - Empty DiskCreateOption = "Empty" - // FromImage Create a new disk from a platform image specified by the given imageReference or - // galleryImageReference. - FromImage DiskCreateOption = "FromImage" - // Import Create a disk by importing from a blob specified by a sourceUri in a storage account specified by - // storageAccountId. - Import DiskCreateOption = "Import" - // ImportSecure Similar to Import create option. Create a new Trusted Launch VM or Confidential VM - // supported disk by importing additional blob for VM guest state specified by securityDataUri in storage - // account specified by storageAccountId - ImportSecure DiskCreateOption = "ImportSecure" - // Restore Create a new disk by copying from a backup recovery point. - Restore DiskCreateOption = "Restore" - // Upload Create a new disk by obtaining a write token and using it to directly upload the contents of the - // disk. - Upload DiskCreateOption = "Upload" - // UploadPreparedSecure Similar to Upload create option. Create a new Trusted Launch VM or Confidential VM - // supported disk and upload using write token in both disk and VM guest state - UploadPreparedSecure DiskCreateOption = "UploadPreparedSecure" -) - -// PossibleDiskCreateOptionValues returns an array of possible values for the DiskCreateOption const type. -func PossibleDiskCreateOptionValues() []DiskCreateOption { - return []DiskCreateOption{Attach, Copy, CopyStart, Empty, FromImage, Import, ImportSecure, Restore, Upload, UploadPreparedSecure} -} - -// DiskCreateOptionTypes enumerates the values for disk create option types. -type DiskCreateOptionTypes string - -const ( - // DiskCreateOptionTypesAttach ... - DiskCreateOptionTypesAttach DiskCreateOptionTypes = "Attach" - // DiskCreateOptionTypesEmpty ... - DiskCreateOptionTypesEmpty DiskCreateOptionTypes = "Empty" - // DiskCreateOptionTypesFromImage ... - DiskCreateOptionTypesFromImage DiskCreateOptionTypes = "FromImage" -) - -// PossibleDiskCreateOptionTypesValues returns an array of possible values for the DiskCreateOptionTypes const type. -func PossibleDiskCreateOptionTypesValues() []DiskCreateOptionTypes { - return []DiskCreateOptionTypes{DiskCreateOptionTypesAttach, DiskCreateOptionTypesEmpty, DiskCreateOptionTypesFromImage} -} - -// DiskDeleteOptionTypes enumerates the values for disk delete option types. -type DiskDeleteOptionTypes string - -const ( - // DiskDeleteOptionTypesDelete ... - DiskDeleteOptionTypesDelete DiskDeleteOptionTypes = "Delete" - // DiskDeleteOptionTypesDetach ... - DiskDeleteOptionTypesDetach DiskDeleteOptionTypes = "Detach" -) - -// PossibleDiskDeleteOptionTypesValues returns an array of possible values for the DiskDeleteOptionTypes const type. -func PossibleDiskDeleteOptionTypesValues() []DiskDeleteOptionTypes { - return []DiskDeleteOptionTypes{DiskDeleteOptionTypesDelete, DiskDeleteOptionTypesDetach} -} - -// DiskDetachOptionTypes enumerates the values for disk detach option types. -type DiskDetachOptionTypes string - -const ( - // ForceDetach ... - ForceDetach DiskDetachOptionTypes = "ForceDetach" -) - -// PossibleDiskDetachOptionTypesValues returns an array of possible values for the DiskDetachOptionTypes const type. -func PossibleDiskDetachOptionTypesValues() []DiskDetachOptionTypes { - return []DiskDetachOptionTypes{ForceDetach} -} - -// DiskEncryptionSetIdentityType enumerates the values for disk encryption set identity type. -type DiskEncryptionSetIdentityType string - -const ( - // DiskEncryptionSetIdentityTypeNone ... - DiskEncryptionSetIdentityTypeNone DiskEncryptionSetIdentityType = "None" - // DiskEncryptionSetIdentityTypeSystemAssigned ... - DiskEncryptionSetIdentityTypeSystemAssigned DiskEncryptionSetIdentityType = "SystemAssigned" - // DiskEncryptionSetIdentityTypeSystemAssignedUserAssigned ... - DiskEncryptionSetIdentityTypeSystemAssignedUserAssigned DiskEncryptionSetIdentityType = "SystemAssigned, UserAssigned" - // DiskEncryptionSetIdentityTypeUserAssigned ... - DiskEncryptionSetIdentityTypeUserAssigned DiskEncryptionSetIdentityType = "UserAssigned" -) - -// PossibleDiskEncryptionSetIdentityTypeValues returns an array of possible values for the DiskEncryptionSetIdentityType const type. -func PossibleDiskEncryptionSetIdentityTypeValues() []DiskEncryptionSetIdentityType { - return []DiskEncryptionSetIdentityType{DiskEncryptionSetIdentityTypeNone, DiskEncryptionSetIdentityTypeSystemAssigned, DiskEncryptionSetIdentityTypeSystemAssignedUserAssigned, DiskEncryptionSetIdentityTypeUserAssigned} -} - -// DiskEncryptionSetType enumerates the values for disk encryption set type. -type DiskEncryptionSetType string - -const ( - // ConfidentialVMEncryptedWithCustomerKey Confidential VM supported disk and VM guest state would be - // encrypted with customer managed key. - ConfidentialVMEncryptedWithCustomerKey DiskEncryptionSetType = "ConfidentialVmEncryptedWithCustomerKey" - // EncryptionAtRestWithCustomerKey Resource using diskEncryptionSet would be encrypted at rest with - // Customer managed key that can be changed and revoked by a customer. - EncryptionAtRestWithCustomerKey DiskEncryptionSetType = "EncryptionAtRestWithCustomerKey" - // EncryptionAtRestWithPlatformAndCustomerKeys Resource using diskEncryptionSet would be encrypted at rest - // with two layers of encryption. One of the keys is Customer managed and the other key is Platform - // managed. - EncryptionAtRestWithPlatformAndCustomerKeys DiskEncryptionSetType = "EncryptionAtRestWithPlatformAndCustomerKeys" -) - -// PossibleDiskEncryptionSetTypeValues returns an array of possible values for the DiskEncryptionSetType const type. -func PossibleDiskEncryptionSetTypeValues() []DiskEncryptionSetType { - return []DiskEncryptionSetType{ConfidentialVMEncryptedWithCustomerKey, EncryptionAtRestWithCustomerKey, EncryptionAtRestWithPlatformAndCustomerKeys} -} - -// DiskSecurityTypes enumerates the values for disk security types. -type DiskSecurityTypes string - -const ( - // ConfidentialVMDiskEncryptedWithCustomerKey Indicates Confidential VM disk with both OS disk and VM guest - // state encrypted with a customer managed key - ConfidentialVMDiskEncryptedWithCustomerKey DiskSecurityTypes = "ConfidentialVM_DiskEncryptedWithCustomerKey" - // ConfidentialVMDiskEncryptedWithPlatformKey Indicates Confidential VM disk with both OS disk and VM guest - // state encrypted with a platform managed key - ConfidentialVMDiskEncryptedWithPlatformKey DiskSecurityTypes = "ConfidentialVM_DiskEncryptedWithPlatformKey" - // ConfidentialVMVMGuestStateOnlyEncryptedWithPlatformKey Indicates Confidential VM disk with only VM guest - // state encrypted - ConfidentialVMVMGuestStateOnlyEncryptedWithPlatformKey DiskSecurityTypes = "ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey" - // TrustedLaunch Trusted Launch provides security features such as secure boot and virtual Trusted Platform - // Module (vTPM) - TrustedLaunch DiskSecurityTypes = "TrustedLaunch" -) - -// PossibleDiskSecurityTypesValues returns an array of possible values for the DiskSecurityTypes const type. -func PossibleDiskSecurityTypesValues() []DiskSecurityTypes { - return []DiskSecurityTypes{ConfidentialVMDiskEncryptedWithCustomerKey, ConfidentialVMDiskEncryptedWithPlatformKey, ConfidentialVMVMGuestStateOnlyEncryptedWithPlatformKey, TrustedLaunch} -} - -// DiskState enumerates the values for disk state. -type DiskState string - -const ( - // ActiveSAS The disk currently has an Active SAS Uri associated with it. - ActiveSAS DiskState = "ActiveSAS" - // ActiveSASFrozen The disk is attached to a VM in hibernated state and has an active SAS URI associated - // with it. - ActiveSASFrozen DiskState = "ActiveSASFrozen" - // ActiveUpload A disk is created for upload and a write token has been issued for uploading to it. - ActiveUpload DiskState = "ActiveUpload" - // Attached The disk is currently attached to a running VM. - Attached DiskState = "Attached" - // Frozen The disk is attached to a VM which is in hibernated state. - Frozen DiskState = "Frozen" - // ReadyToUpload A disk is ready to be created by upload by requesting a write token. - ReadyToUpload DiskState = "ReadyToUpload" - // Reserved The disk is attached to a stopped-deallocated VM. - Reserved DiskState = "Reserved" - // Unattached The disk is not being used and can be attached to a VM. - Unattached DiskState = "Unattached" -) - -// PossibleDiskStateValues returns an array of possible values for the DiskState const type. -func PossibleDiskStateValues() []DiskState { - return []DiskState{ActiveSAS, ActiveSASFrozen, ActiveUpload, Attached, Frozen, ReadyToUpload, Reserved, Unattached} -} - -// DiskStorageAccountTypes enumerates the values for disk storage account types. -type DiskStorageAccountTypes string - -const ( - // PremiumLRS Premium SSD locally redundant storage. Best for production and performance sensitive - // workloads. - PremiumLRS DiskStorageAccountTypes = "Premium_LRS" - // PremiumV2LRS Premium SSD v2 locally redundant storage. Best for production and performance-sensitive - // workloads that consistently require low latency and high IOPS and throughput. - PremiumV2LRS DiskStorageAccountTypes = "PremiumV2_LRS" - // PremiumZRS Premium SSD zone redundant storage. Best for the production workloads that need storage - // resiliency against zone failures. - PremiumZRS DiskStorageAccountTypes = "Premium_ZRS" - // StandardLRS Standard HDD locally redundant storage. Best for backup, non-critical, and infrequent - // access. - StandardLRS DiskStorageAccountTypes = "Standard_LRS" - // StandardSSDLRS Standard SSD locally redundant storage. Best for web servers, lightly used enterprise - // applications and dev/test. - StandardSSDLRS DiskStorageAccountTypes = "StandardSSD_LRS" - // StandardSSDZRS Standard SSD zone redundant storage. Best for web servers, lightly used enterprise - // applications and dev/test that need storage resiliency against zone failures. - StandardSSDZRS DiskStorageAccountTypes = "StandardSSD_ZRS" - // UltraSSDLRS Ultra SSD locally redundant storage. Best for IO-intensive workloads such as SAP HANA, top - // tier databases (for example, SQL, Oracle), and other transaction-heavy workloads. - UltraSSDLRS DiskStorageAccountTypes = "UltraSSD_LRS" -) - -// PossibleDiskStorageAccountTypesValues returns an array of possible values for the DiskStorageAccountTypes const type. -func PossibleDiskStorageAccountTypesValues() []DiskStorageAccountTypes { - return []DiskStorageAccountTypes{PremiumLRS, PremiumV2LRS, PremiumZRS, StandardLRS, StandardSSDLRS, StandardSSDZRS, UltraSSDLRS} -} - -// EncryptionType enumerates the values for encryption type. -type EncryptionType string - -const ( - // EncryptionTypeEncryptionAtRestWithCustomerKey Disk is encrypted at rest with Customer managed key that - // can be changed and revoked by a customer. - EncryptionTypeEncryptionAtRestWithCustomerKey EncryptionType = "EncryptionAtRestWithCustomerKey" - // EncryptionTypeEncryptionAtRestWithPlatformAndCustomerKeys Disk is encrypted at rest with 2 layers of - // encryption. One of the keys is Customer managed and the other key is Platform managed. - EncryptionTypeEncryptionAtRestWithPlatformAndCustomerKeys EncryptionType = "EncryptionAtRestWithPlatformAndCustomerKeys" - // EncryptionTypeEncryptionAtRestWithPlatformKey Disk is encrypted at rest with Platform managed key. It is - // the default encryption type. This is not a valid encryption type for disk encryption sets. - EncryptionTypeEncryptionAtRestWithPlatformKey EncryptionType = "EncryptionAtRestWithPlatformKey" -) - -// PossibleEncryptionTypeValues returns an array of possible values for the EncryptionType const type. -func PossibleEncryptionTypeValues() []EncryptionType { - return []EncryptionType{EncryptionTypeEncryptionAtRestWithCustomerKey, EncryptionTypeEncryptionAtRestWithPlatformAndCustomerKeys, EncryptionTypeEncryptionAtRestWithPlatformKey} -} - -// ExecutionState enumerates the values for execution state. -type ExecutionState string - -const ( - // ExecutionStateCanceled ... - ExecutionStateCanceled ExecutionState = "Canceled" - // ExecutionStateFailed ... - ExecutionStateFailed ExecutionState = "Failed" - // ExecutionStatePending ... - ExecutionStatePending ExecutionState = "Pending" - // ExecutionStateRunning ... - ExecutionStateRunning ExecutionState = "Running" - // ExecutionStateSucceeded ... - ExecutionStateSucceeded ExecutionState = "Succeeded" - // ExecutionStateTimedOut ... - ExecutionStateTimedOut ExecutionState = "TimedOut" - // ExecutionStateUnknown ... - ExecutionStateUnknown ExecutionState = "Unknown" -) - -// PossibleExecutionStateValues returns an array of possible values for the ExecutionState const type. -func PossibleExecutionStateValues() []ExecutionState { - return []ExecutionState{ExecutionStateCanceled, ExecutionStateFailed, ExecutionStatePending, ExecutionStateRunning, ExecutionStateSucceeded, ExecutionStateTimedOut, ExecutionStateUnknown} -} - -// ExpandTypesForGetCapacityReservationGroups enumerates the values for expand types for get capacity -// reservation groups. -type ExpandTypesForGetCapacityReservationGroups string - -const ( - // VirtualMachineScaleSetVMsref ... - VirtualMachineScaleSetVMsref ExpandTypesForGetCapacityReservationGroups = "virtualMachineScaleSetVMs/$ref" - // VirtualMachinesref ... - VirtualMachinesref ExpandTypesForGetCapacityReservationGroups = "virtualMachines/$ref" -) - -// PossibleExpandTypesForGetCapacityReservationGroupsValues returns an array of possible values for the ExpandTypesForGetCapacityReservationGroups const type. -func PossibleExpandTypesForGetCapacityReservationGroupsValues() []ExpandTypesForGetCapacityReservationGroups { - return []ExpandTypesForGetCapacityReservationGroups{VirtualMachineScaleSetVMsref, VirtualMachinesref} -} - -// ExpandTypesForGetVMScaleSets enumerates the values for expand types for get vm scale sets. -type ExpandTypesForGetVMScaleSets string - -const ( - // UserData ... - UserData ExpandTypesForGetVMScaleSets = "userData" -) - -// PossibleExpandTypesForGetVMScaleSetsValues returns an array of possible values for the ExpandTypesForGetVMScaleSets const type. -func PossibleExpandTypesForGetVMScaleSetsValues() []ExpandTypesForGetVMScaleSets { - return []ExpandTypesForGetVMScaleSets{UserData} -} - -// ExtendedLocationType enumerates the values for extended location type. -type ExtendedLocationType string - -const ( - // EdgeZone ... - EdgeZone ExtendedLocationType = "EdgeZone" -) - -// PossibleExtendedLocationTypeValues returns an array of possible values for the ExtendedLocationType const type. -func PossibleExtendedLocationTypeValues() []ExtendedLocationType { - return []ExtendedLocationType{EdgeZone} -} - -// ExtendedLocationTypes enumerates the values for extended location types. -type ExtendedLocationTypes string - -const ( - // ExtendedLocationTypesEdgeZone ... - ExtendedLocationTypesEdgeZone ExtendedLocationTypes = "EdgeZone" -) - -// PossibleExtendedLocationTypesValues returns an array of possible values for the ExtendedLocationTypes const type. -func PossibleExtendedLocationTypesValues() []ExtendedLocationTypes { - return []ExtendedLocationTypes{ExtendedLocationTypesEdgeZone} -} - -// GalleryExpandParams enumerates the values for gallery expand params. -type GalleryExpandParams string - -const ( - // SharingProfileGroups ... - SharingProfileGroups GalleryExpandParams = "SharingProfile/Groups" -) - -// PossibleGalleryExpandParamsValues returns an array of possible values for the GalleryExpandParams const type. -func PossibleGalleryExpandParamsValues() []GalleryExpandParams { - return []GalleryExpandParams{SharingProfileGroups} -} - -// GalleryExtendedLocationType enumerates the values for gallery extended location type. -type GalleryExtendedLocationType string - -const ( - // GalleryExtendedLocationTypeEdgeZone ... - GalleryExtendedLocationTypeEdgeZone GalleryExtendedLocationType = "EdgeZone" - // GalleryExtendedLocationTypeUnknown ... - GalleryExtendedLocationTypeUnknown GalleryExtendedLocationType = "Unknown" -) - -// PossibleGalleryExtendedLocationTypeValues returns an array of possible values for the GalleryExtendedLocationType const type. -func PossibleGalleryExtendedLocationTypeValues() []GalleryExtendedLocationType { - return []GalleryExtendedLocationType{GalleryExtendedLocationTypeEdgeZone, GalleryExtendedLocationTypeUnknown} -} - -// GalleryProvisioningState enumerates the values for gallery provisioning state. -type GalleryProvisioningState string - -const ( - // GalleryProvisioningStateCreating ... - GalleryProvisioningStateCreating GalleryProvisioningState = "Creating" - // GalleryProvisioningStateDeleting ... - GalleryProvisioningStateDeleting GalleryProvisioningState = "Deleting" - // GalleryProvisioningStateFailed ... - GalleryProvisioningStateFailed GalleryProvisioningState = "Failed" - // GalleryProvisioningStateMigrating ... - GalleryProvisioningStateMigrating GalleryProvisioningState = "Migrating" - // GalleryProvisioningStateSucceeded ... - GalleryProvisioningStateSucceeded GalleryProvisioningState = "Succeeded" - // GalleryProvisioningStateUpdating ... - GalleryProvisioningStateUpdating GalleryProvisioningState = "Updating" -) - -// PossibleGalleryProvisioningStateValues returns an array of possible values for the GalleryProvisioningState const type. -func PossibleGalleryProvisioningStateValues() []GalleryProvisioningState { - return []GalleryProvisioningState{GalleryProvisioningStateCreating, GalleryProvisioningStateDeleting, GalleryProvisioningStateFailed, GalleryProvisioningStateMigrating, GalleryProvisioningStateSucceeded, GalleryProvisioningStateUpdating} -} - -// GallerySharingPermissionTypes enumerates the values for gallery sharing permission types. -type GallerySharingPermissionTypes string - -const ( - // Community ... - Community GallerySharingPermissionTypes = "Community" - // Groups ... - Groups GallerySharingPermissionTypes = "Groups" - // Private ... - Private GallerySharingPermissionTypes = "Private" -) - -// PossibleGallerySharingPermissionTypesValues returns an array of possible values for the GallerySharingPermissionTypes const type. -func PossibleGallerySharingPermissionTypesValues() []GallerySharingPermissionTypes { - return []GallerySharingPermissionTypes{Community, Groups, Private} -} - -// HostCaching enumerates the values for host caching. -type HostCaching string - -const ( - // HostCachingNone ... - HostCachingNone HostCaching = "None" - // HostCachingReadOnly ... - HostCachingReadOnly HostCaching = "ReadOnly" - // HostCachingReadWrite ... - HostCachingReadWrite HostCaching = "ReadWrite" -) - -// PossibleHostCachingValues returns an array of possible values for the HostCaching const type. -func PossibleHostCachingValues() []HostCaching { - return []HostCaching{HostCachingNone, HostCachingReadOnly, HostCachingReadWrite} -} - -// HyperVGeneration enumerates the values for hyper v generation. -type HyperVGeneration string - -const ( - // V1 ... - V1 HyperVGeneration = "V1" - // V2 ... - V2 HyperVGeneration = "V2" -) - -// PossibleHyperVGenerationValues returns an array of possible values for the HyperVGeneration const type. -func PossibleHyperVGenerationValues() []HyperVGeneration { - return []HyperVGeneration{V1, V2} -} - -// HyperVGenerationType enumerates the values for hyper v generation type. -type HyperVGenerationType string - -const ( - // HyperVGenerationTypeV1 ... - HyperVGenerationTypeV1 HyperVGenerationType = "V1" - // HyperVGenerationTypeV2 ... - HyperVGenerationTypeV2 HyperVGenerationType = "V2" -) - -// PossibleHyperVGenerationTypeValues returns an array of possible values for the HyperVGenerationType const type. -func PossibleHyperVGenerationTypeValues() []HyperVGenerationType { - return []HyperVGenerationType{HyperVGenerationTypeV1, HyperVGenerationTypeV2} -} - -// HyperVGenerationTypes enumerates the values for hyper v generation types. -type HyperVGenerationTypes string - -const ( - // HyperVGenerationTypesV1 ... - HyperVGenerationTypesV1 HyperVGenerationTypes = "V1" - // HyperVGenerationTypesV2 ... - HyperVGenerationTypesV2 HyperVGenerationTypes = "V2" -) - -// PossibleHyperVGenerationTypesValues returns an array of possible values for the HyperVGenerationTypes const type. -func PossibleHyperVGenerationTypesValues() []HyperVGenerationTypes { - return []HyperVGenerationTypes{HyperVGenerationTypesV1, HyperVGenerationTypesV2} -} - -// InstanceViewTypes enumerates the values for instance view types. -type InstanceViewTypes string - -const ( - // InstanceViewTypesInstanceView ... - InstanceViewTypesInstanceView InstanceViewTypes = "instanceView" - // InstanceViewTypesUserData ... - InstanceViewTypesUserData InstanceViewTypes = "userData" -) - -// PossibleInstanceViewTypesValues returns an array of possible values for the InstanceViewTypes const type. -func PossibleInstanceViewTypesValues() []InstanceViewTypes { - return []InstanceViewTypes{InstanceViewTypesInstanceView, InstanceViewTypesUserData} -} - -// IntervalInMins enumerates the values for interval in mins. -type IntervalInMins string - -const ( - // FiveMins ... - FiveMins IntervalInMins = "FiveMins" - // SixtyMins ... - SixtyMins IntervalInMins = "SixtyMins" - // ThirtyMins ... - ThirtyMins IntervalInMins = "ThirtyMins" - // ThreeMins ... - 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 - -const ( - // IPv4 ... - IPv4 IPVersion = "IPv4" - // IPv6 ... - IPv6 IPVersion = "IPv6" -) - -// PossibleIPVersionValues returns an array of possible values for the IPVersion const type. -func PossibleIPVersionValues() []IPVersion { - return []IPVersion{IPv4, IPv6} -} - -// IPVersions enumerates the values for ip versions. -type IPVersions string - -const ( - // IPVersionsIPv4 ... - IPVersionsIPv4 IPVersions = "IPv4" - // IPVersionsIPv6 ... - IPVersionsIPv6 IPVersions = "IPv6" -) - -// PossibleIPVersionsValues returns an array of possible values for the IPVersions const type. -func PossibleIPVersionsValues() []IPVersions { - return []IPVersions{IPVersionsIPv4, IPVersionsIPv6} -} - -// LinuxPatchAssessmentMode enumerates the values for linux patch assessment mode. -type LinuxPatchAssessmentMode string - -const ( - // AutomaticByPlatform ... - AutomaticByPlatform LinuxPatchAssessmentMode = "AutomaticByPlatform" - // ImageDefault ... - ImageDefault LinuxPatchAssessmentMode = "ImageDefault" -) - -// PossibleLinuxPatchAssessmentModeValues returns an array of possible values for the LinuxPatchAssessmentMode const type. -func PossibleLinuxPatchAssessmentModeValues() []LinuxPatchAssessmentMode { - return []LinuxPatchAssessmentMode{AutomaticByPlatform, ImageDefault} -} - -// LinuxVMGuestPatchAutomaticByPlatformRebootSetting enumerates the values for linux vm guest patch automatic -// by platform reboot setting. -type LinuxVMGuestPatchAutomaticByPlatformRebootSetting string - -const ( - // LinuxVMGuestPatchAutomaticByPlatformRebootSettingAlways ... - LinuxVMGuestPatchAutomaticByPlatformRebootSettingAlways LinuxVMGuestPatchAutomaticByPlatformRebootSetting = "Always" - // LinuxVMGuestPatchAutomaticByPlatformRebootSettingIfRequired ... - LinuxVMGuestPatchAutomaticByPlatformRebootSettingIfRequired LinuxVMGuestPatchAutomaticByPlatformRebootSetting = "IfRequired" - // LinuxVMGuestPatchAutomaticByPlatformRebootSettingNever ... - LinuxVMGuestPatchAutomaticByPlatformRebootSettingNever LinuxVMGuestPatchAutomaticByPlatformRebootSetting = "Never" - // LinuxVMGuestPatchAutomaticByPlatformRebootSettingUnknown ... - LinuxVMGuestPatchAutomaticByPlatformRebootSettingUnknown LinuxVMGuestPatchAutomaticByPlatformRebootSetting = "Unknown" -) - -// PossibleLinuxVMGuestPatchAutomaticByPlatformRebootSettingValues returns an array of possible values for the LinuxVMGuestPatchAutomaticByPlatformRebootSetting const type. -func PossibleLinuxVMGuestPatchAutomaticByPlatformRebootSettingValues() []LinuxVMGuestPatchAutomaticByPlatformRebootSetting { - return []LinuxVMGuestPatchAutomaticByPlatformRebootSetting{LinuxVMGuestPatchAutomaticByPlatformRebootSettingAlways, LinuxVMGuestPatchAutomaticByPlatformRebootSettingIfRequired, LinuxVMGuestPatchAutomaticByPlatformRebootSettingNever, LinuxVMGuestPatchAutomaticByPlatformRebootSettingUnknown} -} - -// LinuxVMGuestPatchMode enumerates the values for linux vm guest patch mode. -type LinuxVMGuestPatchMode string - -const ( - // LinuxVMGuestPatchModeAutomaticByPlatform ... - LinuxVMGuestPatchModeAutomaticByPlatform LinuxVMGuestPatchMode = "AutomaticByPlatform" - // LinuxVMGuestPatchModeImageDefault ... - LinuxVMGuestPatchModeImageDefault LinuxVMGuestPatchMode = "ImageDefault" -) - -// PossibleLinuxVMGuestPatchModeValues returns an array of possible values for the LinuxVMGuestPatchMode const type. -func PossibleLinuxVMGuestPatchModeValues() []LinuxVMGuestPatchMode { - return []LinuxVMGuestPatchMode{LinuxVMGuestPatchModeAutomaticByPlatform, LinuxVMGuestPatchModeImageDefault} -} - -// MaintenanceOperationResultCodeTypes enumerates the values for maintenance operation result code types. -type MaintenanceOperationResultCodeTypes string - -const ( - // MaintenanceOperationResultCodeTypesMaintenanceAborted ... - MaintenanceOperationResultCodeTypesMaintenanceAborted MaintenanceOperationResultCodeTypes = "MaintenanceAborted" - // MaintenanceOperationResultCodeTypesMaintenanceCompleted ... - MaintenanceOperationResultCodeTypesMaintenanceCompleted MaintenanceOperationResultCodeTypes = "MaintenanceCompleted" - // MaintenanceOperationResultCodeTypesNone ... - MaintenanceOperationResultCodeTypesNone MaintenanceOperationResultCodeTypes = "None" - // MaintenanceOperationResultCodeTypesRetryLater ... - MaintenanceOperationResultCodeTypesRetryLater MaintenanceOperationResultCodeTypes = "RetryLater" -) - -// PossibleMaintenanceOperationResultCodeTypesValues returns an array of possible values for the MaintenanceOperationResultCodeTypes const type. -func PossibleMaintenanceOperationResultCodeTypesValues() []MaintenanceOperationResultCodeTypes { - return []MaintenanceOperationResultCodeTypes{MaintenanceOperationResultCodeTypesMaintenanceAborted, MaintenanceOperationResultCodeTypesMaintenanceCompleted, MaintenanceOperationResultCodeTypesNone, MaintenanceOperationResultCodeTypesRetryLater} -} - -// NetworkAccessPolicy enumerates the values for network access policy. -type NetworkAccessPolicy string - -const ( - // AllowAll The disk can be exported or uploaded to from any network. - AllowAll NetworkAccessPolicy = "AllowAll" - // AllowPrivate The disk can be exported or uploaded to using a DiskAccess resource's private endpoints. - AllowPrivate NetworkAccessPolicy = "AllowPrivate" - // DenyAll The disk cannot be exported. - DenyAll NetworkAccessPolicy = "DenyAll" -) - -// PossibleNetworkAccessPolicyValues returns an array of possible values for the NetworkAccessPolicy const type. -func PossibleNetworkAccessPolicyValues() []NetworkAccessPolicy { - return []NetworkAccessPolicy{AllowAll, AllowPrivate, DenyAll} -} - -// NetworkAPIVersion enumerates the values for network api version. -type NetworkAPIVersion string - -const ( - // TwoZeroTwoZeroHyphenMinusOneOneHyphenMinusZeroOne ... - TwoZeroTwoZeroHyphenMinusOneOneHyphenMinusZeroOne NetworkAPIVersion = "2020-11-01" -) - -// PossibleNetworkAPIVersionValues returns an array of possible values for the NetworkAPIVersion const type. -func PossibleNetworkAPIVersionValues() []NetworkAPIVersion { - return []NetworkAPIVersion{TwoZeroTwoZeroHyphenMinusOneOneHyphenMinusZeroOne} -} - -// OperatingSystemStateTypes enumerates the values for operating system state types. -type OperatingSystemStateTypes string - -const ( - // Generalized Generalized image. Needs to be provisioned during deployment time. - Generalized OperatingSystemStateTypes = "Generalized" - // Specialized Specialized image. Contains already provisioned OS Disk. - Specialized OperatingSystemStateTypes = "Specialized" -) - -// PossibleOperatingSystemStateTypesValues returns an array of possible values for the OperatingSystemStateTypes const type. -func PossibleOperatingSystemStateTypesValues() []OperatingSystemStateTypes { - return []OperatingSystemStateTypes{Generalized, Specialized} -} - -// OperatingSystemType enumerates the values for operating system type. -type OperatingSystemType string - -const ( - // Linux ... - Linux OperatingSystemType = "Linux" - // Windows ... - Windows OperatingSystemType = "Windows" -) - -// PossibleOperatingSystemTypeValues returns an array of possible values for the OperatingSystemType const type. -func PossibleOperatingSystemTypeValues() []OperatingSystemType { - return []OperatingSystemType{Linux, Windows} -} - -// OperatingSystemTypes enumerates the values for operating system types. -type OperatingSystemTypes string - -const ( - // OperatingSystemTypesLinux ... - OperatingSystemTypesLinux OperatingSystemTypes = "Linux" - // OperatingSystemTypesWindows ... - OperatingSystemTypesWindows OperatingSystemTypes = "Windows" -) - -// PossibleOperatingSystemTypesValues returns an array of possible values for the OperatingSystemTypes const type. -func PossibleOperatingSystemTypesValues() []OperatingSystemTypes { - return []OperatingSystemTypes{OperatingSystemTypesLinux, OperatingSystemTypesWindows} -} - -// OrchestrationMode enumerates the values for orchestration mode. -type OrchestrationMode string - -const ( - // Flexible ... - Flexible OrchestrationMode = "Flexible" - // Uniform ... - Uniform OrchestrationMode = "Uniform" -) - -// PossibleOrchestrationModeValues returns an array of possible values for the OrchestrationMode const type. -func PossibleOrchestrationModeValues() []OrchestrationMode { - return []OrchestrationMode{Flexible, Uniform} -} - -// OrchestrationServiceNames enumerates the values for orchestration service names. -type OrchestrationServiceNames string - -const ( - // AutomaticRepairs ... - AutomaticRepairs OrchestrationServiceNames = "AutomaticRepairs" -) - -// PossibleOrchestrationServiceNamesValues returns an array of possible values for the OrchestrationServiceNames const type. -func PossibleOrchestrationServiceNamesValues() []OrchestrationServiceNames { - return []OrchestrationServiceNames{AutomaticRepairs} -} - -// OrchestrationServiceState enumerates the values for orchestration service state. -type OrchestrationServiceState string - -const ( - // NotRunning ... - NotRunning OrchestrationServiceState = "NotRunning" - // Running ... - Running OrchestrationServiceState = "Running" - // Suspended ... - Suspended OrchestrationServiceState = "Suspended" -) - -// PossibleOrchestrationServiceStateValues returns an array of possible values for the OrchestrationServiceState const type. -func PossibleOrchestrationServiceStateValues() []OrchestrationServiceState { - return []OrchestrationServiceState{NotRunning, Running, Suspended} -} - -// OrchestrationServiceStateAction enumerates the values for orchestration service state action. -type OrchestrationServiceStateAction string - -const ( - // Resume ... - Resume OrchestrationServiceStateAction = "Resume" - // Suspend ... - Suspend OrchestrationServiceStateAction = "Suspend" -) - -// PossibleOrchestrationServiceStateActionValues returns an array of possible values for the OrchestrationServiceStateAction const type. -func PossibleOrchestrationServiceStateActionValues() []OrchestrationServiceStateAction { - return []OrchestrationServiceStateAction{Resume, Suspend} -} - -// PassNames enumerates the values for pass names. -type PassNames string - -const ( - // OobeSystem ... - OobeSystem PassNames = "OobeSystem" -) - -// PossiblePassNamesValues returns an array of possible values for the PassNames const type. -func PossiblePassNamesValues() []PassNames { - return []PassNames{OobeSystem} -} - -// PatchAssessmentState enumerates the values for patch assessment state. -type PatchAssessmentState string - -const ( - // PatchAssessmentStateAvailable ... - PatchAssessmentStateAvailable PatchAssessmentState = "Available" - // PatchAssessmentStateUnknown ... - PatchAssessmentStateUnknown PatchAssessmentState = "Unknown" -) - -// PossiblePatchAssessmentStateValues returns an array of possible values for the PatchAssessmentState const type. -func PossiblePatchAssessmentStateValues() []PatchAssessmentState { - return []PatchAssessmentState{PatchAssessmentStateAvailable, PatchAssessmentStateUnknown} -} - -// PatchInstallationState enumerates the values for patch installation state. -type PatchInstallationState string - -const ( - // PatchInstallationStateExcluded ... - PatchInstallationStateExcluded PatchInstallationState = "Excluded" - // PatchInstallationStateFailed ... - PatchInstallationStateFailed PatchInstallationState = "Failed" - // PatchInstallationStateInstalled ... - PatchInstallationStateInstalled PatchInstallationState = "Installed" - // PatchInstallationStateNotSelected ... - PatchInstallationStateNotSelected PatchInstallationState = "NotSelected" - // PatchInstallationStatePending ... - PatchInstallationStatePending PatchInstallationState = "Pending" - // PatchInstallationStateUnknown ... - PatchInstallationStateUnknown PatchInstallationState = "Unknown" -) - -// PossiblePatchInstallationStateValues returns an array of possible values for the PatchInstallationState const type. -func PossiblePatchInstallationStateValues() []PatchInstallationState { - return []PatchInstallationState{PatchInstallationStateExcluded, PatchInstallationStateFailed, PatchInstallationStateInstalled, PatchInstallationStateNotSelected, PatchInstallationStatePending, PatchInstallationStateUnknown} -} - -// PatchOperationStatus enumerates the values for patch operation status. -type PatchOperationStatus string - -const ( - // PatchOperationStatusCompletedWithWarnings ... - PatchOperationStatusCompletedWithWarnings PatchOperationStatus = "CompletedWithWarnings" - // PatchOperationStatusFailed ... - PatchOperationStatusFailed PatchOperationStatus = "Failed" - // PatchOperationStatusInProgress ... - PatchOperationStatusInProgress PatchOperationStatus = "InProgress" - // PatchOperationStatusSucceeded ... - PatchOperationStatusSucceeded PatchOperationStatus = "Succeeded" - // PatchOperationStatusUnknown ... - PatchOperationStatusUnknown PatchOperationStatus = "Unknown" -) - -// PossiblePatchOperationStatusValues returns an array of possible values for the PatchOperationStatus const type. -func PossiblePatchOperationStatusValues() []PatchOperationStatus { - return []PatchOperationStatus{PatchOperationStatusCompletedWithWarnings, PatchOperationStatusFailed, PatchOperationStatusInProgress, PatchOperationStatusSucceeded, PatchOperationStatusUnknown} -} - -// PrivateEndpointConnectionProvisioningState enumerates the values for private endpoint connection -// provisioning state. -type PrivateEndpointConnectionProvisioningState string - -const ( - // PrivateEndpointConnectionProvisioningStateCreating ... - PrivateEndpointConnectionProvisioningStateCreating PrivateEndpointConnectionProvisioningState = "Creating" - // PrivateEndpointConnectionProvisioningStateDeleting ... - PrivateEndpointConnectionProvisioningStateDeleting PrivateEndpointConnectionProvisioningState = "Deleting" - // PrivateEndpointConnectionProvisioningStateFailed ... - PrivateEndpointConnectionProvisioningStateFailed PrivateEndpointConnectionProvisioningState = "Failed" - // PrivateEndpointConnectionProvisioningStateSucceeded ... - PrivateEndpointConnectionProvisioningStateSucceeded PrivateEndpointConnectionProvisioningState = "Succeeded" -) - -// PossiblePrivateEndpointConnectionProvisioningStateValues returns an array of possible values for the PrivateEndpointConnectionProvisioningState const type. -func PossiblePrivateEndpointConnectionProvisioningStateValues() []PrivateEndpointConnectionProvisioningState { - return []PrivateEndpointConnectionProvisioningState{PrivateEndpointConnectionProvisioningStateCreating, PrivateEndpointConnectionProvisioningStateDeleting, PrivateEndpointConnectionProvisioningStateFailed, PrivateEndpointConnectionProvisioningStateSucceeded} -} - -// PrivateEndpointServiceConnectionStatus enumerates the values for private endpoint service connection status. -type PrivateEndpointServiceConnectionStatus string - -const ( - // Approved ... - Approved PrivateEndpointServiceConnectionStatus = "Approved" - // Pending ... - Pending PrivateEndpointServiceConnectionStatus = "Pending" - // Rejected ... - Rejected PrivateEndpointServiceConnectionStatus = "Rejected" -) - -// PossiblePrivateEndpointServiceConnectionStatusValues returns an array of possible values for the PrivateEndpointServiceConnectionStatus const type. -func PossiblePrivateEndpointServiceConnectionStatusValues() []PrivateEndpointServiceConnectionStatus { - return []PrivateEndpointServiceConnectionStatus{Approved, Pending, Rejected} -} - -// ProtocolTypes enumerates the values for protocol types. -type ProtocolTypes string - -const ( - // HTTP ... - HTTP ProtocolTypes = "Http" - // HTTPS ... - HTTPS ProtocolTypes = "Https" -) - -// PossibleProtocolTypesValues returns an array of possible values for the ProtocolTypes const type. -func PossibleProtocolTypesValues() []ProtocolTypes { - return []ProtocolTypes{HTTP, HTTPS} -} - -// ProximityPlacementGroupType enumerates the values for proximity placement group type. -type ProximityPlacementGroupType string - -const ( - // Standard ... - Standard ProximityPlacementGroupType = "Standard" - // Ultra ... - Ultra ProximityPlacementGroupType = "Ultra" -) - -// PossibleProximityPlacementGroupTypeValues returns an array of possible values for the ProximityPlacementGroupType const type. -func PossibleProximityPlacementGroupTypeValues() []ProximityPlacementGroupType { - return []ProximityPlacementGroupType{Standard, Ultra} -} - -// PublicIPAddressSkuName enumerates the values for public ip address sku name. -type PublicIPAddressSkuName string - -const ( - // PublicIPAddressSkuNameBasic ... - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - // PublicIPAddressSkuNameStandard ... - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -// PossiblePublicIPAddressSkuNameValues returns an array of possible values for the PublicIPAddressSkuName const type. -func PossiblePublicIPAddressSkuNameValues() []PublicIPAddressSkuName { - return []PublicIPAddressSkuName{PublicIPAddressSkuNameBasic, PublicIPAddressSkuNameStandard} -} - -// PublicIPAddressSkuTier enumerates the values for public ip address sku tier. -type PublicIPAddressSkuTier string - -const ( - // Global ... - Global PublicIPAddressSkuTier = "Global" - // Regional ... - Regional PublicIPAddressSkuTier = "Regional" -) - -// PossiblePublicIPAddressSkuTierValues returns an array of possible values for the PublicIPAddressSkuTier const type. -func PossiblePublicIPAddressSkuTierValues() []PublicIPAddressSkuTier { - return []PublicIPAddressSkuTier{Global, Regional} -} - -// PublicIPAllocationMethod enumerates the values for public ip allocation method. -type PublicIPAllocationMethod string - -const ( - // Dynamic ... - Dynamic PublicIPAllocationMethod = "Dynamic" - // Static ... - Static PublicIPAllocationMethod = "Static" -) - -// PossiblePublicIPAllocationMethodValues returns an array of possible values for the PublicIPAllocationMethod const type. -func PossiblePublicIPAllocationMethodValues() []PublicIPAllocationMethod { - return []PublicIPAllocationMethod{Dynamic, Static} -} - -// PublicNetworkAccess enumerates the values for public network access. -type PublicNetworkAccess string - -const ( - // Disabled You cannot access the underlying data of the disk publicly on the internet even when - // NetworkAccessPolicy is set to AllowAll. You can access the data via the SAS URI only from your trusted - // Azure VNET when NetworkAccessPolicy is set to AllowPrivate. - Disabled PublicNetworkAccess = "Disabled" - // Enabled You can generate a SAS URI to access the underlying data of the disk publicly on the internet - // when NetworkAccessPolicy is set to AllowAll. You can access the data via the SAS URI only from your - // trusted Azure VNET when NetworkAccessPolicy is set to AllowPrivate. - Enabled PublicNetworkAccess = "Enabled" -) - -// PossiblePublicNetworkAccessValues returns an array of possible values for the PublicNetworkAccess const type. -func PossiblePublicNetworkAccessValues() []PublicNetworkAccess { - return []PublicNetworkAccess{Disabled, Enabled} -} - -// RepairAction enumerates the values for repair action. -type RepairAction string - -const ( - // Reimage ... - Reimage RepairAction = "Reimage" - // Replace ... - Replace RepairAction = "Replace" - // Restart ... - Restart RepairAction = "Restart" -) - -// PossibleRepairActionValues returns an array of possible values for the RepairAction const type. -func PossibleRepairActionValues() []RepairAction { - return []RepairAction{Reimage, Replace, Restart} -} - -// ReplicationMode enumerates the values for replication mode. -type ReplicationMode string - -const ( - // Full ... - Full ReplicationMode = "Full" - // Shallow ... - Shallow ReplicationMode = "Shallow" -) - -// PossibleReplicationModeValues returns an array of possible values for the ReplicationMode const type. -func PossibleReplicationModeValues() []ReplicationMode { - return []ReplicationMode{Full, Shallow} -} - -// ReplicationState enumerates the values for replication state. -type ReplicationState string - -const ( - // ReplicationStateCompleted ... - ReplicationStateCompleted ReplicationState = "Completed" - // ReplicationStateFailed ... - ReplicationStateFailed ReplicationState = "Failed" - // ReplicationStateReplicating ... - ReplicationStateReplicating ReplicationState = "Replicating" - // ReplicationStateUnknown ... - ReplicationStateUnknown ReplicationState = "Unknown" -) - -// PossibleReplicationStateValues returns an array of possible values for the ReplicationState const type. -func PossibleReplicationStateValues() []ReplicationState { - return []ReplicationState{ReplicationStateCompleted, ReplicationStateFailed, ReplicationStateReplicating, ReplicationStateUnknown} -} - -// ReplicationStatusTypes enumerates the values for replication status types. -type ReplicationStatusTypes string - -const ( - // ReplicationStatusTypesReplicationStatus ... - ReplicationStatusTypesReplicationStatus ReplicationStatusTypes = "ReplicationStatus" -) - -// PossibleReplicationStatusTypesValues returns an array of possible values for the ReplicationStatusTypes const type. -func PossibleReplicationStatusTypesValues() []ReplicationStatusTypes { - return []ReplicationStatusTypes{ReplicationStatusTypesReplicationStatus} -} - -// ResourceIdentityType enumerates the values for resource identity type. -type ResourceIdentityType string - -const ( - // ResourceIdentityTypeNone ... - ResourceIdentityTypeNone ResourceIdentityType = "None" - // ResourceIdentityTypeSystemAssigned ... - ResourceIdentityTypeSystemAssigned ResourceIdentityType = "SystemAssigned" - // ResourceIdentityTypeSystemAssignedUserAssigned ... - ResourceIdentityTypeSystemAssignedUserAssigned ResourceIdentityType = "SystemAssigned, UserAssigned" - // ResourceIdentityTypeUserAssigned ... - 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 - -const ( - // ResourceSkuCapacityScaleTypeAutomatic ... - ResourceSkuCapacityScaleTypeAutomatic ResourceSkuCapacityScaleType = "Automatic" - // ResourceSkuCapacityScaleTypeManual ... - ResourceSkuCapacityScaleTypeManual ResourceSkuCapacityScaleType = "Manual" - // ResourceSkuCapacityScaleTypeNone ... - 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 - -const ( - // NotAvailableForSubscription ... - NotAvailableForSubscription ResourceSkuRestrictionsReasonCode = "NotAvailableForSubscription" - // QuotaID ... - 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 - -const ( - // Location ... - Location ResourceSkuRestrictionsType = "Location" - // Zone ... - Zone ResourceSkuRestrictionsType = "Zone" -) - -// PossibleResourceSkuRestrictionsTypeValues returns an array of possible values for the ResourceSkuRestrictionsType const type. -func PossibleResourceSkuRestrictionsTypeValues() []ResourceSkuRestrictionsType { - return []ResourceSkuRestrictionsType{Location, Zone} -} - -// RestorePointCollectionExpandOptions enumerates the values for restore point collection expand options. -type RestorePointCollectionExpandOptions string - -const ( - // RestorePoints ... - RestorePoints RestorePointCollectionExpandOptions = "restorePoints" -) - -// PossibleRestorePointCollectionExpandOptionsValues returns an array of possible values for the RestorePointCollectionExpandOptions const type. -func PossibleRestorePointCollectionExpandOptionsValues() []RestorePointCollectionExpandOptions { - return []RestorePointCollectionExpandOptions{RestorePoints} -} - -// RestorePointExpandOptions enumerates the values for restore point expand options. -type RestorePointExpandOptions string - -const ( - // RestorePointExpandOptionsInstanceView ... - RestorePointExpandOptionsInstanceView RestorePointExpandOptions = "instanceView" -) - -// PossibleRestorePointExpandOptionsValues returns an array of possible values for the RestorePointExpandOptions const type. -func PossibleRestorePointExpandOptionsValues() []RestorePointExpandOptions { - return []RestorePointExpandOptions{RestorePointExpandOptionsInstanceView} -} - -// RollingUpgradeActionType enumerates the values for rolling upgrade action type. -type RollingUpgradeActionType string - -const ( - // Cancel ... - Cancel RollingUpgradeActionType = "Cancel" - // Start ... - 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 - -const ( - // RollingUpgradeStatusCodeCancelled ... - RollingUpgradeStatusCodeCancelled RollingUpgradeStatusCode = "Cancelled" - // RollingUpgradeStatusCodeCompleted ... - RollingUpgradeStatusCodeCompleted RollingUpgradeStatusCode = "Completed" - // RollingUpgradeStatusCodeFaulted ... - RollingUpgradeStatusCodeFaulted RollingUpgradeStatusCode = "Faulted" - // RollingUpgradeStatusCodeRollingForward ... - RollingUpgradeStatusCodeRollingForward RollingUpgradeStatusCode = "RollingForward" -) - -// PossibleRollingUpgradeStatusCodeValues returns an array of possible values for the RollingUpgradeStatusCode const type. -func PossibleRollingUpgradeStatusCodeValues() []RollingUpgradeStatusCode { - return []RollingUpgradeStatusCode{RollingUpgradeStatusCodeCancelled, RollingUpgradeStatusCodeCompleted, RollingUpgradeStatusCodeFaulted, RollingUpgradeStatusCodeRollingForward} -} - -// SecurityEncryptionTypes enumerates the values for security encryption types. -type SecurityEncryptionTypes string - -const ( - // DiskWithVMGuestState ... - DiskWithVMGuestState SecurityEncryptionTypes = "DiskWithVMGuestState" - // VMGuestStateOnly ... - VMGuestStateOnly SecurityEncryptionTypes = "VMGuestStateOnly" -) - -// PossibleSecurityEncryptionTypesValues returns an array of possible values for the SecurityEncryptionTypes const type. -func PossibleSecurityEncryptionTypesValues() []SecurityEncryptionTypes { - return []SecurityEncryptionTypes{DiskWithVMGuestState, VMGuestStateOnly} -} - -// SecurityTypes enumerates the values for security types. -type SecurityTypes string - -const ( - // SecurityTypesConfidentialVM ... - SecurityTypesConfidentialVM SecurityTypes = "ConfidentialVM" - // SecurityTypesTrustedLaunch ... - SecurityTypesTrustedLaunch SecurityTypes = "TrustedLaunch" -) - -// PossibleSecurityTypesValues returns an array of possible values for the SecurityTypes const type. -func PossibleSecurityTypesValues() []SecurityTypes { - return []SecurityTypes{SecurityTypesConfidentialVM, SecurityTypesTrustedLaunch} -} - -// SelectPermissions enumerates the values for select permissions. -type SelectPermissions string - -const ( - // Permissions ... - Permissions SelectPermissions = "Permissions" -) - -// PossibleSelectPermissionsValues returns an array of possible values for the SelectPermissions const type. -func PossibleSelectPermissionsValues() []SelectPermissions { - return []SelectPermissions{Permissions} -} - -// SettingNames enumerates the values for setting names. -type SettingNames string - -const ( - // AutoLogon ... - AutoLogon SettingNames = "AutoLogon" - // FirstLogonCommands ... - FirstLogonCommands SettingNames = "FirstLogonCommands" -) - -// PossibleSettingNamesValues returns an array of possible values for the SettingNames const type. -func PossibleSettingNamesValues() []SettingNames { - return []SettingNames{AutoLogon, FirstLogonCommands} -} - -// SharedGalleryHostCaching enumerates the values for shared gallery host caching. -type SharedGalleryHostCaching string - -const ( - // SharedGalleryHostCachingNone ... - SharedGalleryHostCachingNone SharedGalleryHostCaching = "None" - // SharedGalleryHostCachingReadOnly ... - SharedGalleryHostCachingReadOnly SharedGalleryHostCaching = "ReadOnly" - // SharedGalleryHostCachingReadWrite ... - SharedGalleryHostCachingReadWrite SharedGalleryHostCaching = "ReadWrite" -) - -// PossibleSharedGalleryHostCachingValues returns an array of possible values for the SharedGalleryHostCaching const type. -func PossibleSharedGalleryHostCachingValues() []SharedGalleryHostCaching { - return []SharedGalleryHostCaching{SharedGalleryHostCachingNone, SharedGalleryHostCachingReadOnly, SharedGalleryHostCachingReadWrite} -} - -// SharedToValues enumerates the values for shared to values. -type SharedToValues string - -const ( - // Tenant ... - Tenant SharedToValues = "tenant" -) - -// PossibleSharedToValuesValues returns an array of possible values for the SharedToValues const type. -func PossibleSharedToValuesValues() []SharedToValues { - return []SharedToValues{Tenant} -} - -// SharingProfileGroupTypes enumerates the values for sharing profile group types. -type SharingProfileGroupTypes string - -const ( - // AADTenants ... - AADTenants SharingProfileGroupTypes = "AADTenants" - // Subscriptions ... - Subscriptions SharingProfileGroupTypes = "Subscriptions" -) - -// PossibleSharingProfileGroupTypesValues returns an array of possible values for the SharingProfileGroupTypes const type. -func PossibleSharingProfileGroupTypesValues() []SharingProfileGroupTypes { - return []SharingProfileGroupTypes{AADTenants, Subscriptions} -} - -// SharingState enumerates the values for sharing state. -type SharingState string - -const ( - // SharingStateFailed ... - SharingStateFailed SharingState = "Failed" - // SharingStateInProgress ... - SharingStateInProgress SharingState = "InProgress" - // SharingStateSucceeded ... - SharingStateSucceeded SharingState = "Succeeded" - // SharingStateUnknown ... - SharingStateUnknown SharingState = "Unknown" -) - -// PossibleSharingStateValues returns an array of possible values for the SharingState const type. -func PossibleSharingStateValues() []SharingState { - return []SharingState{SharingStateFailed, SharingStateInProgress, SharingStateSucceeded, SharingStateUnknown} -} - -// SharingUpdateOperationTypes enumerates the values for sharing update operation types. -type SharingUpdateOperationTypes string - -const ( - // Add ... - Add SharingUpdateOperationTypes = "Add" - // EnableCommunity ... - EnableCommunity SharingUpdateOperationTypes = "EnableCommunity" - // Remove ... - Remove SharingUpdateOperationTypes = "Remove" - // Reset ... - Reset SharingUpdateOperationTypes = "Reset" -) - -// PossibleSharingUpdateOperationTypesValues returns an array of possible values for the SharingUpdateOperationTypes const type. -func PossibleSharingUpdateOperationTypesValues() []SharingUpdateOperationTypes { - return []SharingUpdateOperationTypes{Add, EnableCommunity, Remove, Reset} -} - -// SnapshotStorageAccountTypes enumerates the values for snapshot storage account types. -type SnapshotStorageAccountTypes string - -const ( - // SnapshotStorageAccountTypesPremiumLRS Premium SSD locally redundant storage - SnapshotStorageAccountTypesPremiumLRS SnapshotStorageAccountTypes = "Premium_LRS" - // SnapshotStorageAccountTypesStandardLRS Standard HDD locally redundant storage - SnapshotStorageAccountTypesStandardLRS SnapshotStorageAccountTypes = "Standard_LRS" - // SnapshotStorageAccountTypesStandardZRS Standard zone redundant storage - SnapshotStorageAccountTypesStandardZRS SnapshotStorageAccountTypes = "Standard_ZRS" -) - -// PossibleSnapshotStorageAccountTypesValues returns an array of possible values for the SnapshotStorageAccountTypes const type. -func PossibleSnapshotStorageAccountTypesValues() []SnapshotStorageAccountTypes { - return []SnapshotStorageAccountTypes{SnapshotStorageAccountTypesPremiumLRS, SnapshotStorageAccountTypesStandardLRS, SnapshotStorageAccountTypesStandardZRS} -} - -// StatusLevelTypes enumerates the values for status level types. -type StatusLevelTypes string - -const ( - // Error ... - Error StatusLevelTypes = "Error" - // Info ... - Info StatusLevelTypes = "Info" - // Warning ... - Warning StatusLevelTypes = "Warning" -) - -// PossibleStatusLevelTypesValues returns an array of possible values for the StatusLevelTypes const type. -func PossibleStatusLevelTypesValues() []StatusLevelTypes { - return []StatusLevelTypes{Error, Info, Warning} -} - -// StorageAccountType enumerates the values for storage account type. -type StorageAccountType string - -const ( - // StorageAccountTypePremiumLRS ... - StorageAccountTypePremiumLRS StorageAccountType = "Premium_LRS" - // StorageAccountTypeStandardLRS ... - StorageAccountTypeStandardLRS StorageAccountType = "Standard_LRS" - // StorageAccountTypeStandardZRS ... - StorageAccountTypeStandardZRS StorageAccountType = "Standard_ZRS" -) - -// PossibleStorageAccountTypeValues returns an array of possible values for the StorageAccountType const type. -func PossibleStorageAccountTypeValues() []StorageAccountType { - return []StorageAccountType{StorageAccountTypePremiumLRS, StorageAccountTypeStandardLRS, StorageAccountTypeStandardZRS} -} - -// StorageAccountTypes enumerates the values for storage account types. -type StorageAccountTypes string - -const ( - // StorageAccountTypesPremiumLRS ... - StorageAccountTypesPremiumLRS StorageAccountTypes = "Premium_LRS" - // StorageAccountTypesPremiumV2LRS ... - StorageAccountTypesPremiumV2LRS StorageAccountTypes = "PremiumV2_LRS" - // StorageAccountTypesPremiumZRS ... - StorageAccountTypesPremiumZRS StorageAccountTypes = "Premium_ZRS" - // StorageAccountTypesStandardLRS ... - StorageAccountTypesStandardLRS StorageAccountTypes = "Standard_LRS" - // StorageAccountTypesStandardSSDLRS ... - StorageAccountTypesStandardSSDLRS StorageAccountTypes = "StandardSSD_LRS" - // StorageAccountTypesStandardSSDZRS ... - StorageAccountTypesStandardSSDZRS StorageAccountTypes = "StandardSSD_ZRS" - // StorageAccountTypesUltraSSDLRS ... - StorageAccountTypesUltraSSDLRS StorageAccountTypes = "UltraSSD_LRS" -) - -// PossibleStorageAccountTypesValues returns an array of possible values for the StorageAccountTypes const type. -func PossibleStorageAccountTypesValues() []StorageAccountTypes { - return []StorageAccountTypes{StorageAccountTypesPremiumLRS, StorageAccountTypesPremiumV2LRS, StorageAccountTypesPremiumZRS, StorageAccountTypesStandardLRS, StorageAccountTypesStandardSSDLRS, StorageAccountTypesStandardSSDZRS, StorageAccountTypesUltraSSDLRS} -} - -// UpgradeMode enumerates the values for upgrade mode. -type UpgradeMode string - -const ( - // UpgradeModeAutomatic ... - UpgradeModeAutomatic UpgradeMode = "Automatic" - // UpgradeModeManual ... - UpgradeModeManual UpgradeMode = "Manual" - // UpgradeModeRolling ... - UpgradeModeRolling UpgradeMode = "Rolling" -) - -// PossibleUpgradeModeValues returns an array of possible values for the UpgradeMode const type. -func PossibleUpgradeModeValues() []UpgradeMode { - return []UpgradeMode{UpgradeModeAutomatic, UpgradeModeManual, UpgradeModeRolling} -} - -// UpgradeOperationInvoker enumerates the values for upgrade operation invoker. -type UpgradeOperationInvoker string - -const ( - // UpgradeOperationInvokerPlatform ... - UpgradeOperationInvokerPlatform UpgradeOperationInvoker = "Platform" - // UpgradeOperationInvokerUnknown ... - UpgradeOperationInvokerUnknown UpgradeOperationInvoker = "Unknown" - // UpgradeOperationInvokerUser ... - UpgradeOperationInvokerUser UpgradeOperationInvoker = "User" -) - -// PossibleUpgradeOperationInvokerValues returns an array of possible values for the UpgradeOperationInvoker const type. -func PossibleUpgradeOperationInvokerValues() []UpgradeOperationInvoker { - return []UpgradeOperationInvoker{UpgradeOperationInvokerPlatform, UpgradeOperationInvokerUnknown, UpgradeOperationInvokerUser} -} - -// UpgradeState enumerates the values for upgrade state. -type UpgradeState string - -const ( - // UpgradeStateCancelled ... - UpgradeStateCancelled UpgradeState = "Cancelled" - // UpgradeStateCompleted ... - UpgradeStateCompleted UpgradeState = "Completed" - // UpgradeStateFaulted ... - UpgradeStateFaulted UpgradeState = "Faulted" - // UpgradeStateRollingForward ... - UpgradeStateRollingForward UpgradeState = "RollingForward" -) - -// PossibleUpgradeStateValues returns an array of possible values for the UpgradeState const type. -func PossibleUpgradeStateValues() []UpgradeState { - return []UpgradeState{UpgradeStateCancelled, UpgradeStateCompleted, UpgradeStateFaulted, UpgradeStateRollingForward} -} - -// VirtualMachineEvictionPolicyTypes enumerates the values for virtual machine eviction policy types. -type VirtualMachineEvictionPolicyTypes string - -const ( - // VirtualMachineEvictionPolicyTypesDeallocate ... - VirtualMachineEvictionPolicyTypesDeallocate VirtualMachineEvictionPolicyTypes = "Deallocate" - // VirtualMachineEvictionPolicyTypesDelete ... - VirtualMachineEvictionPolicyTypesDelete VirtualMachineEvictionPolicyTypes = "Delete" -) - -// PossibleVirtualMachineEvictionPolicyTypesValues returns an array of possible values for the VirtualMachineEvictionPolicyTypes const type. -func PossibleVirtualMachineEvictionPolicyTypesValues() []VirtualMachineEvictionPolicyTypes { - return []VirtualMachineEvictionPolicyTypes{VirtualMachineEvictionPolicyTypesDeallocate, VirtualMachineEvictionPolicyTypesDelete} -} - -// VirtualMachinePriorityTypes enumerates the values for virtual machine priority types. -type VirtualMachinePriorityTypes string - -const ( - // Low ... - Low VirtualMachinePriorityTypes = "Low" - // Regular ... - Regular VirtualMachinePriorityTypes = "Regular" - // Spot ... - Spot VirtualMachinePriorityTypes = "Spot" -) - -// PossibleVirtualMachinePriorityTypesValues returns an array of possible values for the VirtualMachinePriorityTypes const type. -func PossibleVirtualMachinePriorityTypesValues() []VirtualMachinePriorityTypes { - return []VirtualMachinePriorityTypes{Low, Regular, Spot} -} - -// VirtualMachineScaleSetScaleInRules enumerates the values for virtual machine scale set scale in rules. -type VirtualMachineScaleSetScaleInRules string - -const ( - // Default ... - Default VirtualMachineScaleSetScaleInRules = "Default" - // NewestVM ... - NewestVM VirtualMachineScaleSetScaleInRules = "NewestVM" - // OldestVM ... - OldestVM VirtualMachineScaleSetScaleInRules = "OldestVM" -) - -// PossibleVirtualMachineScaleSetScaleInRulesValues returns an array of possible values for the VirtualMachineScaleSetScaleInRules const type. -func PossibleVirtualMachineScaleSetScaleInRulesValues() []VirtualMachineScaleSetScaleInRules { - return []VirtualMachineScaleSetScaleInRules{Default, NewestVM, OldestVM} -} - -// VirtualMachineScaleSetSkuScaleType enumerates the values for virtual machine scale set sku scale type. -type VirtualMachineScaleSetSkuScaleType string - -const ( - // VirtualMachineScaleSetSkuScaleTypeAutomatic ... - VirtualMachineScaleSetSkuScaleTypeAutomatic VirtualMachineScaleSetSkuScaleType = "Automatic" - // VirtualMachineScaleSetSkuScaleTypeNone ... - 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 - -const ( - // BasicA0 ... - BasicA0 VirtualMachineSizeTypes = "Basic_A0" - // BasicA1 ... - BasicA1 VirtualMachineSizeTypes = "Basic_A1" - // BasicA2 ... - BasicA2 VirtualMachineSizeTypes = "Basic_A2" - // BasicA3 ... - BasicA3 VirtualMachineSizeTypes = "Basic_A3" - // BasicA4 ... - BasicA4 VirtualMachineSizeTypes = "Basic_A4" - // StandardA0 ... - StandardA0 VirtualMachineSizeTypes = "Standard_A0" - // StandardA1 ... - StandardA1 VirtualMachineSizeTypes = "Standard_A1" - // StandardA10 ... - StandardA10 VirtualMachineSizeTypes = "Standard_A10" - // StandardA11 ... - StandardA11 VirtualMachineSizeTypes = "Standard_A11" - // StandardA1V2 ... - StandardA1V2 VirtualMachineSizeTypes = "Standard_A1_v2" - // StandardA2 ... - StandardA2 VirtualMachineSizeTypes = "Standard_A2" - // StandardA2mV2 ... - StandardA2mV2 VirtualMachineSizeTypes = "Standard_A2m_v2" - // StandardA2V2 ... - StandardA2V2 VirtualMachineSizeTypes = "Standard_A2_v2" - // StandardA3 ... - StandardA3 VirtualMachineSizeTypes = "Standard_A3" - // StandardA4 ... - StandardA4 VirtualMachineSizeTypes = "Standard_A4" - // StandardA4mV2 ... - StandardA4mV2 VirtualMachineSizeTypes = "Standard_A4m_v2" - // StandardA4V2 ... - StandardA4V2 VirtualMachineSizeTypes = "Standard_A4_v2" - // StandardA5 ... - StandardA5 VirtualMachineSizeTypes = "Standard_A5" - // StandardA6 ... - StandardA6 VirtualMachineSizeTypes = "Standard_A6" - // StandardA7 ... - StandardA7 VirtualMachineSizeTypes = "Standard_A7" - // StandardA8 ... - StandardA8 VirtualMachineSizeTypes = "Standard_A8" - // StandardA8mV2 ... - StandardA8mV2 VirtualMachineSizeTypes = "Standard_A8m_v2" - // StandardA8V2 ... - StandardA8V2 VirtualMachineSizeTypes = "Standard_A8_v2" - // StandardA9 ... - StandardA9 VirtualMachineSizeTypes = "Standard_A9" - // StandardB1ms ... - StandardB1ms VirtualMachineSizeTypes = "Standard_B1ms" - // StandardB1s ... - StandardB1s VirtualMachineSizeTypes = "Standard_B1s" - // StandardB2ms ... - StandardB2ms VirtualMachineSizeTypes = "Standard_B2ms" - // StandardB2s ... - StandardB2s VirtualMachineSizeTypes = "Standard_B2s" - // StandardB4ms ... - StandardB4ms VirtualMachineSizeTypes = "Standard_B4ms" - // StandardB8ms ... - StandardB8ms VirtualMachineSizeTypes = "Standard_B8ms" - // StandardD1 ... - StandardD1 VirtualMachineSizeTypes = "Standard_D1" - // StandardD11 ... - StandardD11 VirtualMachineSizeTypes = "Standard_D11" - // StandardD11V2 ... - StandardD11V2 VirtualMachineSizeTypes = "Standard_D11_v2" - // StandardD12 ... - StandardD12 VirtualMachineSizeTypes = "Standard_D12" - // StandardD12V2 ... - StandardD12V2 VirtualMachineSizeTypes = "Standard_D12_v2" - // StandardD13 ... - StandardD13 VirtualMachineSizeTypes = "Standard_D13" - // StandardD13V2 ... - StandardD13V2 VirtualMachineSizeTypes = "Standard_D13_v2" - // StandardD14 ... - StandardD14 VirtualMachineSizeTypes = "Standard_D14" - // StandardD14V2 ... - StandardD14V2 VirtualMachineSizeTypes = "Standard_D14_v2" - // StandardD15V2 ... - StandardD15V2 VirtualMachineSizeTypes = "Standard_D15_v2" - // StandardD16sV3 ... - StandardD16sV3 VirtualMachineSizeTypes = "Standard_D16s_v3" - // StandardD16V3 ... - StandardD16V3 VirtualMachineSizeTypes = "Standard_D16_v3" - // StandardD1V2 ... - StandardD1V2 VirtualMachineSizeTypes = "Standard_D1_v2" - // StandardD2 ... - StandardD2 VirtualMachineSizeTypes = "Standard_D2" - // StandardD2sV3 ... - StandardD2sV3 VirtualMachineSizeTypes = "Standard_D2s_v3" - // StandardD2V2 ... - StandardD2V2 VirtualMachineSizeTypes = "Standard_D2_v2" - // StandardD2V3 ... - StandardD2V3 VirtualMachineSizeTypes = "Standard_D2_v3" - // StandardD3 ... - StandardD3 VirtualMachineSizeTypes = "Standard_D3" - // StandardD32sV3 ... - StandardD32sV3 VirtualMachineSizeTypes = "Standard_D32s_v3" - // StandardD32V3 ... - StandardD32V3 VirtualMachineSizeTypes = "Standard_D32_v3" - // StandardD3V2 ... - StandardD3V2 VirtualMachineSizeTypes = "Standard_D3_v2" - // StandardD4 ... - StandardD4 VirtualMachineSizeTypes = "Standard_D4" - // StandardD4sV3 ... - StandardD4sV3 VirtualMachineSizeTypes = "Standard_D4s_v3" - // StandardD4V2 ... - StandardD4V2 VirtualMachineSizeTypes = "Standard_D4_v2" - // StandardD4V3 ... - StandardD4V3 VirtualMachineSizeTypes = "Standard_D4_v3" - // StandardD5V2 ... - StandardD5V2 VirtualMachineSizeTypes = "Standard_D5_v2" - // StandardD64sV3 ... - StandardD64sV3 VirtualMachineSizeTypes = "Standard_D64s_v3" - // StandardD64V3 ... - StandardD64V3 VirtualMachineSizeTypes = "Standard_D64_v3" - // StandardD8sV3 ... - StandardD8sV3 VirtualMachineSizeTypes = "Standard_D8s_v3" - // StandardD8V3 ... - StandardD8V3 VirtualMachineSizeTypes = "Standard_D8_v3" - // StandardDS1 ... - StandardDS1 VirtualMachineSizeTypes = "Standard_DS1" - // StandardDS11 ... - StandardDS11 VirtualMachineSizeTypes = "Standard_DS11" - // StandardDS11V2 ... - StandardDS11V2 VirtualMachineSizeTypes = "Standard_DS11_v2" - // StandardDS12 ... - StandardDS12 VirtualMachineSizeTypes = "Standard_DS12" - // StandardDS12V2 ... - StandardDS12V2 VirtualMachineSizeTypes = "Standard_DS12_v2" - // StandardDS13 ... - StandardDS13 VirtualMachineSizeTypes = "Standard_DS13" - // StandardDS132V2 ... - StandardDS132V2 VirtualMachineSizeTypes = "Standard_DS13-2_v2" - // StandardDS134V2 ... - StandardDS134V2 VirtualMachineSizeTypes = "Standard_DS13-4_v2" - // StandardDS13V2 ... - StandardDS13V2 VirtualMachineSizeTypes = "Standard_DS13_v2" - // StandardDS14 ... - StandardDS14 VirtualMachineSizeTypes = "Standard_DS14" - // StandardDS144V2 ... - StandardDS144V2 VirtualMachineSizeTypes = "Standard_DS14-4_v2" - // StandardDS148V2 ... - StandardDS148V2 VirtualMachineSizeTypes = "Standard_DS14-8_v2" - // StandardDS14V2 ... - StandardDS14V2 VirtualMachineSizeTypes = "Standard_DS14_v2" - // StandardDS15V2 ... - StandardDS15V2 VirtualMachineSizeTypes = "Standard_DS15_v2" - // StandardDS1V2 ... - StandardDS1V2 VirtualMachineSizeTypes = "Standard_DS1_v2" - // StandardDS2 ... - StandardDS2 VirtualMachineSizeTypes = "Standard_DS2" - // StandardDS2V2 ... - StandardDS2V2 VirtualMachineSizeTypes = "Standard_DS2_v2" - // StandardDS3 ... - StandardDS3 VirtualMachineSizeTypes = "Standard_DS3" - // StandardDS3V2 ... - StandardDS3V2 VirtualMachineSizeTypes = "Standard_DS3_v2" - // StandardDS4 ... - StandardDS4 VirtualMachineSizeTypes = "Standard_DS4" - // StandardDS4V2 ... - StandardDS4V2 VirtualMachineSizeTypes = "Standard_DS4_v2" - // StandardDS5V2 ... - StandardDS5V2 VirtualMachineSizeTypes = "Standard_DS5_v2" - // StandardE16sV3 ... - StandardE16sV3 VirtualMachineSizeTypes = "Standard_E16s_v3" - // StandardE16V3 ... - StandardE16V3 VirtualMachineSizeTypes = "Standard_E16_v3" - // StandardE2sV3 ... - StandardE2sV3 VirtualMachineSizeTypes = "Standard_E2s_v3" - // StandardE2V3 ... - StandardE2V3 VirtualMachineSizeTypes = "Standard_E2_v3" - // StandardE3216V3 ... - StandardE3216V3 VirtualMachineSizeTypes = "Standard_E32-16_v3" - // StandardE328sV3 ... - StandardE328sV3 VirtualMachineSizeTypes = "Standard_E32-8s_v3" - // StandardE32sV3 ... - StandardE32sV3 VirtualMachineSizeTypes = "Standard_E32s_v3" - // StandardE32V3 ... - StandardE32V3 VirtualMachineSizeTypes = "Standard_E32_v3" - // StandardE4sV3 ... - StandardE4sV3 VirtualMachineSizeTypes = "Standard_E4s_v3" - // StandardE4V3 ... - StandardE4V3 VirtualMachineSizeTypes = "Standard_E4_v3" - // StandardE6416sV3 ... - StandardE6416sV3 VirtualMachineSizeTypes = "Standard_E64-16s_v3" - // StandardE6432sV3 ... - StandardE6432sV3 VirtualMachineSizeTypes = "Standard_E64-32s_v3" - // StandardE64sV3 ... - StandardE64sV3 VirtualMachineSizeTypes = "Standard_E64s_v3" - // StandardE64V3 ... - StandardE64V3 VirtualMachineSizeTypes = "Standard_E64_v3" - // StandardE8sV3 ... - StandardE8sV3 VirtualMachineSizeTypes = "Standard_E8s_v3" - // StandardE8V3 ... - StandardE8V3 VirtualMachineSizeTypes = "Standard_E8_v3" - // StandardF1 ... - StandardF1 VirtualMachineSizeTypes = "Standard_F1" - // StandardF16 ... - StandardF16 VirtualMachineSizeTypes = "Standard_F16" - // StandardF16s ... - StandardF16s VirtualMachineSizeTypes = "Standard_F16s" - // StandardF16sV2 ... - StandardF16sV2 VirtualMachineSizeTypes = "Standard_F16s_v2" - // StandardF1s ... - StandardF1s VirtualMachineSizeTypes = "Standard_F1s" - // StandardF2 ... - StandardF2 VirtualMachineSizeTypes = "Standard_F2" - // StandardF2s ... - StandardF2s VirtualMachineSizeTypes = "Standard_F2s" - // StandardF2sV2 ... - StandardF2sV2 VirtualMachineSizeTypes = "Standard_F2s_v2" - // StandardF32sV2 ... - StandardF32sV2 VirtualMachineSizeTypes = "Standard_F32s_v2" - // StandardF4 ... - StandardF4 VirtualMachineSizeTypes = "Standard_F4" - // StandardF4s ... - StandardF4s VirtualMachineSizeTypes = "Standard_F4s" - // StandardF4sV2 ... - StandardF4sV2 VirtualMachineSizeTypes = "Standard_F4s_v2" - // StandardF64sV2 ... - StandardF64sV2 VirtualMachineSizeTypes = "Standard_F64s_v2" - // StandardF72sV2 ... - StandardF72sV2 VirtualMachineSizeTypes = "Standard_F72s_v2" - // StandardF8 ... - StandardF8 VirtualMachineSizeTypes = "Standard_F8" - // StandardF8s ... - StandardF8s VirtualMachineSizeTypes = "Standard_F8s" - // StandardF8sV2 ... - StandardF8sV2 VirtualMachineSizeTypes = "Standard_F8s_v2" - // StandardG1 ... - StandardG1 VirtualMachineSizeTypes = "Standard_G1" - // StandardG2 ... - StandardG2 VirtualMachineSizeTypes = "Standard_G2" - // StandardG3 ... - StandardG3 VirtualMachineSizeTypes = "Standard_G3" - // StandardG4 ... - StandardG4 VirtualMachineSizeTypes = "Standard_G4" - // StandardG5 ... - StandardG5 VirtualMachineSizeTypes = "Standard_G5" - // StandardGS1 ... - StandardGS1 VirtualMachineSizeTypes = "Standard_GS1" - // StandardGS2 ... - StandardGS2 VirtualMachineSizeTypes = "Standard_GS2" - // StandardGS3 ... - StandardGS3 VirtualMachineSizeTypes = "Standard_GS3" - // StandardGS4 ... - StandardGS4 VirtualMachineSizeTypes = "Standard_GS4" - // StandardGS44 ... - StandardGS44 VirtualMachineSizeTypes = "Standard_GS4-4" - // StandardGS48 ... - StandardGS48 VirtualMachineSizeTypes = "Standard_GS4-8" - // StandardGS5 ... - StandardGS5 VirtualMachineSizeTypes = "Standard_GS5" - // StandardGS516 ... - StandardGS516 VirtualMachineSizeTypes = "Standard_GS5-16" - // StandardGS58 ... - StandardGS58 VirtualMachineSizeTypes = "Standard_GS5-8" - // StandardH16 ... - StandardH16 VirtualMachineSizeTypes = "Standard_H16" - // StandardH16m ... - StandardH16m VirtualMachineSizeTypes = "Standard_H16m" - // StandardH16mr ... - StandardH16mr VirtualMachineSizeTypes = "Standard_H16mr" - // StandardH16r ... - StandardH16r VirtualMachineSizeTypes = "Standard_H16r" - // StandardH8 ... - StandardH8 VirtualMachineSizeTypes = "Standard_H8" - // StandardH8m ... - StandardH8m VirtualMachineSizeTypes = "Standard_H8m" - // StandardL16s ... - StandardL16s VirtualMachineSizeTypes = "Standard_L16s" - // StandardL32s ... - StandardL32s VirtualMachineSizeTypes = "Standard_L32s" - // StandardL4s ... - StandardL4s VirtualMachineSizeTypes = "Standard_L4s" - // StandardL8s ... - StandardL8s VirtualMachineSizeTypes = "Standard_L8s" - // StandardM12832ms ... - StandardM12832ms VirtualMachineSizeTypes = "Standard_M128-32ms" - // StandardM12864ms ... - StandardM12864ms VirtualMachineSizeTypes = "Standard_M128-64ms" - // StandardM128ms ... - StandardM128ms VirtualMachineSizeTypes = "Standard_M128ms" - // StandardM128s ... - StandardM128s VirtualMachineSizeTypes = "Standard_M128s" - // StandardM6416ms ... - StandardM6416ms VirtualMachineSizeTypes = "Standard_M64-16ms" - // StandardM6432ms ... - StandardM6432ms VirtualMachineSizeTypes = "Standard_M64-32ms" - // StandardM64ms ... - StandardM64ms VirtualMachineSizeTypes = "Standard_M64ms" - // StandardM64s ... - StandardM64s VirtualMachineSizeTypes = "Standard_M64s" - // StandardNC12 ... - StandardNC12 VirtualMachineSizeTypes = "Standard_NC12" - // StandardNC12sV2 ... - StandardNC12sV2 VirtualMachineSizeTypes = "Standard_NC12s_v2" - // StandardNC12sV3 ... - StandardNC12sV3 VirtualMachineSizeTypes = "Standard_NC12s_v3" - // StandardNC24 ... - StandardNC24 VirtualMachineSizeTypes = "Standard_NC24" - // StandardNC24r ... - StandardNC24r VirtualMachineSizeTypes = "Standard_NC24r" - // StandardNC24rsV2 ... - StandardNC24rsV2 VirtualMachineSizeTypes = "Standard_NC24rs_v2" - // StandardNC24rsV3 ... - StandardNC24rsV3 VirtualMachineSizeTypes = "Standard_NC24rs_v3" - // StandardNC24sV2 ... - StandardNC24sV2 VirtualMachineSizeTypes = "Standard_NC24s_v2" - // StandardNC24sV3 ... - StandardNC24sV3 VirtualMachineSizeTypes = "Standard_NC24s_v3" - // StandardNC6 ... - StandardNC6 VirtualMachineSizeTypes = "Standard_NC6" - // StandardNC6sV2 ... - StandardNC6sV2 VirtualMachineSizeTypes = "Standard_NC6s_v2" - // StandardNC6sV3 ... - StandardNC6sV3 VirtualMachineSizeTypes = "Standard_NC6s_v3" - // StandardND12s ... - StandardND12s VirtualMachineSizeTypes = "Standard_ND12s" - // StandardND24rs ... - StandardND24rs VirtualMachineSizeTypes = "Standard_ND24rs" - // StandardND24s ... - StandardND24s VirtualMachineSizeTypes = "Standard_ND24s" - // StandardND6s ... - StandardND6s VirtualMachineSizeTypes = "Standard_ND6s" - // StandardNV12 ... - StandardNV12 VirtualMachineSizeTypes = "Standard_NV12" - // StandardNV24 ... - StandardNV24 VirtualMachineSizeTypes = "Standard_NV24" - // StandardNV6 ... - StandardNV6 VirtualMachineSizeTypes = "Standard_NV6" -) - -// PossibleVirtualMachineSizeTypesValues returns an array of possible values for the VirtualMachineSizeTypes const type. -func PossibleVirtualMachineSizeTypesValues() []VirtualMachineSizeTypes { - return []VirtualMachineSizeTypes{BasicA0, BasicA1, BasicA2, BasicA3, BasicA4, 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, StandardD12, StandardD12V2, StandardD13, StandardD13V2, StandardD14, StandardD14V2, StandardD15V2, StandardD16sV3, StandardD16V3, StandardD1V2, StandardD2, StandardD2sV3, StandardD2V2, StandardD2V3, StandardD3, StandardD32sV3, StandardD32V3, StandardD3V2, StandardD4, StandardD4sV3, StandardD4V2, StandardD4V3, StandardD5V2, StandardD64sV3, StandardD64V3, StandardD8sV3, StandardD8V3, StandardDS1, StandardDS11, StandardDS11V2, StandardDS12, StandardDS12V2, StandardDS13, StandardDS132V2, StandardDS134V2, StandardDS13V2, StandardDS14, StandardDS144V2, StandardDS148V2, StandardDS14V2, StandardDS15V2, StandardDS1V2, StandardDS2, StandardDS2V2, StandardDS3, StandardDS3V2, StandardDS4, StandardDS4V2, StandardDS5V2, StandardE16sV3, StandardE16V3, StandardE2sV3, StandardE2V3, StandardE3216V3, 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} -} - -// VMDiskTypes enumerates the values for vm disk types. -type VMDiskTypes string - -const ( - // VMDiskTypesNone ... - VMDiskTypesNone VMDiskTypes = "None" - // VMDiskTypesUnmanaged ... - VMDiskTypesUnmanaged VMDiskTypes = "Unmanaged" -) - -// PossibleVMDiskTypesValues returns an array of possible values for the VMDiskTypes const type. -func PossibleVMDiskTypesValues() []VMDiskTypes { - return []VMDiskTypes{VMDiskTypesNone, VMDiskTypesUnmanaged} -} - -// VMGuestPatchClassificationLinux enumerates the values for vm guest patch classification linux. -type VMGuestPatchClassificationLinux string - -const ( - // Critical ... - Critical VMGuestPatchClassificationLinux = "Critical" - // Other ... - Other VMGuestPatchClassificationLinux = "Other" - // Security ... - Security VMGuestPatchClassificationLinux = "Security" -) - -// PossibleVMGuestPatchClassificationLinuxValues returns an array of possible values for the VMGuestPatchClassificationLinux const type. -func PossibleVMGuestPatchClassificationLinuxValues() []VMGuestPatchClassificationLinux { - return []VMGuestPatchClassificationLinux{Critical, Other, Security} -} - -// VMGuestPatchClassificationWindows enumerates the values for vm guest patch classification windows. -type VMGuestPatchClassificationWindows string - -const ( - // VMGuestPatchClassificationWindowsCritical ... - VMGuestPatchClassificationWindowsCritical VMGuestPatchClassificationWindows = "Critical" - // VMGuestPatchClassificationWindowsDefinition ... - VMGuestPatchClassificationWindowsDefinition VMGuestPatchClassificationWindows = "Definition" - // VMGuestPatchClassificationWindowsFeaturePack ... - VMGuestPatchClassificationWindowsFeaturePack VMGuestPatchClassificationWindows = "FeaturePack" - // VMGuestPatchClassificationWindowsSecurity ... - VMGuestPatchClassificationWindowsSecurity VMGuestPatchClassificationWindows = "Security" - // VMGuestPatchClassificationWindowsServicePack ... - VMGuestPatchClassificationWindowsServicePack VMGuestPatchClassificationWindows = "ServicePack" - // VMGuestPatchClassificationWindowsTools ... - VMGuestPatchClassificationWindowsTools VMGuestPatchClassificationWindows = "Tools" - // VMGuestPatchClassificationWindowsUpdateRollUp ... - VMGuestPatchClassificationWindowsUpdateRollUp VMGuestPatchClassificationWindows = "UpdateRollUp" - // VMGuestPatchClassificationWindowsUpdates ... - VMGuestPatchClassificationWindowsUpdates VMGuestPatchClassificationWindows = "Updates" -) - -// PossibleVMGuestPatchClassificationWindowsValues returns an array of possible values for the VMGuestPatchClassificationWindows const type. -func PossibleVMGuestPatchClassificationWindowsValues() []VMGuestPatchClassificationWindows { - return []VMGuestPatchClassificationWindows{VMGuestPatchClassificationWindowsCritical, VMGuestPatchClassificationWindowsDefinition, VMGuestPatchClassificationWindowsFeaturePack, VMGuestPatchClassificationWindowsSecurity, VMGuestPatchClassificationWindowsServicePack, VMGuestPatchClassificationWindowsTools, VMGuestPatchClassificationWindowsUpdateRollUp, VMGuestPatchClassificationWindowsUpdates} -} - -// VMGuestPatchRebootBehavior enumerates the values for vm guest patch reboot behavior. -type VMGuestPatchRebootBehavior string - -const ( - // VMGuestPatchRebootBehaviorAlwaysRequiresReboot ... - VMGuestPatchRebootBehaviorAlwaysRequiresReboot VMGuestPatchRebootBehavior = "AlwaysRequiresReboot" - // VMGuestPatchRebootBehaviorCanRequestReboot ... - VMGuestPatchRebootBehaviorCanRequestReboot VMGuestPatchRebootBehavior = "CanRequestReboot" - // VMGuestPatchRebootBehaviorNeverReboots ... - VMGuestPatchRebootBehaviorNeverReboots VMGuestPatchRebootBehavior = "NeverReboots" - // VMGuestPatchRebootBehaviorUnknown ... - VMGuestPatchRebootBehaviorUnknown VMGuestPatchRebootBehavior = "Unknown" -) - -// PossibleVMGuestPatchRebootBehaviorValues returns an array of possible values for the VMGuestPatchRebootBehavior const type. -func PossibleVMGuestPatchRebootBehaviorValues() []VMGuestPatchRebootBehavior { - return []VMGuestPatchRebootBehavior{VMGuestPatchRebootBehaviorAlwaysRequiresReboot, VMGuestPatchRebootBehaviorCanRequestReboot, VMGuestPatchRebootBehaviorNeverReboots, VMGuestPatchRebootBehaviorUnknown} -} - -// VMGuestPatchRebootSetting enumerates the values for vm guest patch reboot setting. -type VMGuestPatchRebootSetting string - -const ( - // Always ... - Always VMGuestPatchRebootSetting = "Always" - // IfRequired ... - IfRequired VMGuestPatchRebootSetting = "IfRequired" - // Never ... - Never VMGuestPatchRebootSetting = "Never" -) - -// PossibleVMGuestPatchRebootSettingValues returns an array of possible values for the VMGuestPatchRebootSetting const type. -func PossibleVMGuestPatchRebootSettingValues() []VMGuestPatchRebootSetting { - return []VMGuestPatchRebootSetting{Always, IfRequired, Never} -} - -// VMGuestPatchRebootStatus enumerates the values for vm guest patch reboot status. -type VMGuestPatchRebootStatus string - -const ( - // VMGuestPatchRebootStatusCompleted ... - VMGuestPatchRebootStatusCompleted VMGuestPatchRebootStatus = "Completed" - // VMGuestPatchRebootStatusFailed ... - VMGuestPatchRebootStatusFailed VMGuestPatchRebootStatus = "Failed" - // VMGuestPatchRebootStatusNotNeeded ... - VMGuestPatchRebootStatusNotNeeded VMGuestPatchRebootStatus = "NotNeeded" - // VMGuestPatchRebootStatusRequired ... - VMGuestPatchRebootStatusRequired VMGuestPatchRebootStatus = "Required" - // VMGuestPatchRebootStatusStarted ... - VMGuestPatchRebootStatusStarted VMGuestPatchRebootStatus = "Started" - // VMGuestPatchRebootStatusUnknown ... - VMGuestPatchRebootStatusUnknown VMGuestPatchRebootStatus = "Unknown" -) - -// PossibleVMGuestPatchRebootStatusValues returns an array of possible values for the VMGuestPatchRebootStatus const type. -func PossibleVMGuestPatchRebootStatusValues() []VMGuestPatchRebootStatus { - return []VMGuestPatchRebootStatus{VMGuestPatchRebootStatusCompleted, VMGuestPatchRebootStatusFailed, VMGuestPatchRebootStatusNotNeeded, VMGuestPatchRebootStatusRequired, VMGuestPatchRebootStatusStarted, VMGuestPatchRebootStatusUnknown} -} - -// WindowsPatchAssessmentMode enumerates the values for windows patch assessment mode. -type WindowsPatchAssessmentMode string - -const ( - // WindowsPatchAssessmentModeAutomaticByPlatform ... - WindowsPatchAssessmentModeAutomaticByPlatform WindowsPatchAssessmentMode = "AutomaticByPlatform" - // WindowsPatchAssessmentModeImageDefault ... - WindowsPatchAssessmentModeImageDefault WindowsPatchAssessmentMode = "ImageDefault" -) - -// PossibleWindowsPatchAssessmentModeValues returns an array of possible values for the WindowsPatchAssessmentMode const type. -func PossibleWindowsPatchAssessmentModeValues() []WindowsPatchAssessmentMode { - return []WindowsPatchAssessmentMode{WindowsPatchAssessmentModeAutomaticByPlatform, WindowsPatchAssessmentModeImageDefault} -} - -// WindowsVMGuestPatchAutomaticByPlatformRebootSetting enumerates the values for windows vm guest patch -// automatic by platform reboot setting. -type WindowsVMGuestPatchAutomaticByPlatformRebootSetting string - -const ( - // WindowsVMGuestPatchAutomaticByPlatformRebootSettingAlways ... - WindowsVMGuestPatchAutomaticByPlatformRebootSettingAlways WindowsVMGuestPatchAutomaticByPlatformRebootSetting = "Always" - // WindowsVMGuestPatchAutomaticByPlatformRebootSettingIfRequired ... - WindowsVMGuestPatchAutomaticByPlatformRebootSettingIfRequired WindowsVMGuestPatchAutomaticByPlatformRebootSetting = "IfRequired" - // WindowsVMGuestPatchAutomaticByPlatformRebootSettingNever ... - WindowsVMGuestPatchAutomaticByPlatformRebootSettingNever WindowsVMGuestPatchAutomaticByPlatformRebootSetting = "Never" - // WindowsVMGuestPatchAutomaticByPlatformRebootSettingUnknown ... - WindowsVMGuestPatchAutomaticByPlatformRebootSettingUnknown WindowsVMGuestPatchAutomaticByPlatformRebootSetting = "Unknown" -) - -// PossibleWindowsVMGuestPatchAutomaticByPlatformRebootSettingValues returns an array of possible values for the WindowsVMGuestPatchAutomaticByPlatformRebootSetting const type. -func PossibleWindowsVMGuestPatchAutomaticByPlatformRebootSettingValues() []WindowsVMGuestPatchAutomaticByPlatformRebootSetting { - return []WindowsVMGuestPatchAutomaticByPlatformRebootSetting{WindowsVMGuestPatchAutomaticByPlatformRebootSettingAlways, WindowsVMGuestPatchAutomaticByPlatformRebootSettingIfRequired, WindowsVMGuestPatchAutomaticByPlatformRebootSettingNever, WindowsVMGuestPatchAutomaticByPlatformRebootSettingUnknown} -} - -// WindowsVMGuestPatchMode enumerates the values for windows vm guest patch mode. -type WindowsVMGuestPatchMode string - -const ( - // WindowsVMGuestPatchModeAutomaticByOS ... - WindowsVMGuestPatchModeAutomaticByOS WindowsVMGuestPatchMode = "AutomaticByOS" - // WindowsVMGuestPatchModeAutomaticByPlatform ... - WindowsVMGuestPatchModeAutomaticByPlatform WindowsVMGuestPatchMode = "AutomaticByPlatform" - // WindowsVMGuestPatchModeManual ... - WindowsVMGuestPatchModeManual WindowsVMGuestPatchMode = "Manual" -) - -// PossibleWindowsVMGuestPatchModeValues returns an array of possible values for the WindowsVMGuestPatchMode const type. -func PossibleWindowsVMGuestPatchModeValues() []WindowsVMGuestPatchMode { - return []WindowsVMGuestPatchMode{WindowsVMGuestPatchModeAutomaticByOS, WindowsVMGuestPatchModeAutomaticByPlatform, WindowsVMGuestPatchModeManual} -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/galleries.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/galleries.go deleted file mode 100644 index 334db1f6..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/galleries.go +++ /dev/null @@ -1,588 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// GalleriesClient is the compute Client -type GalleriesClient struct { - BaseClient -} - -// NewGalleriesClient creates an instance of the GalleriesClient client. -func NewGalleriesClient(subscriptionID string) GalleriesClient { - return NewGalleriesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewGalleriesClientWithBaseURI creates an instance of the GalleriesClient client using a custom endpoint. Use this -// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewGalleriesClientWithBaseURI(baseURI string, subscriptionID string) GalleriesClient { - return GalleriesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create or update a Shared Image Gallery. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Image Gallery. The allowed characters are alphabets and numbers with -// dots and periods allowed in the middle. The maximum length is 80 characters. -// gallery - parameters supplied to the create or update Shared Image Gallery operation. -func (client GalleriesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, gallery Gallery) (result GalleriesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleriesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, galleryName, gallery) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client GalleriesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, galleryName string, gallery Gallery) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - 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.Compute/galleries/{galleryName}", pathParameters), - autorest.WithJSON(gallery), - 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 GalleriesClient) CreateOrUpdateSender(req *http.Request) (future GalleriesCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client GalleriesClient) CreateOrUpdateResponder(resp *http.Response) (result Gallery, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete a Shared Image Gallery. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Image Gallery to be deleted. -func (client GalleriesClient) Delete(ctx context.Context, resourceGroupName string, galleryName string) (result GalleriesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleriesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, galleryName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client GalleriesClient) DeletePreparer(ctx context.Context, resourceGroupName string, galleryName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}", 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 GalleriesClient) DeleteSender(req *http.Request) (future GalleriesDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client GalleriesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieves information about a Shared Image Gallery. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Image Gallery. -// selectParameter - the select expression to apply on the operation. -// expand - the expand query option to apply on the operation. -func (client GalleriesClient) Get(ctx context.Context, resourceGroupName string, galleryName string, selectParameter SelectPermissions, expand GalleryExpandParams) (result Gallery, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleriesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, galleryName, selectParameter, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client GalleriesClient) GetPreparer(ctx context.Context, resourceGroupName string, galleryName string, selectParameter SelectPermissions, expand GalleryExpandParams) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(string(selectParameter)) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if len(string(expand)) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}", 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 GalleriesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client GalleriesClient) GetResponder(resp *http.Response) (result Gallery, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List list galleries under a subscription. -func (client GalleriesClient) List(ctx context.Context) (result GalleryListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleriesClient.List") - defer func() { - sc := -1 - if result.gl.Response.Response != nil { - sc = result.gl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.gl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "List", resp, "Failure sending request") - return - } - - result.gl, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "List", resp, "Failure responding to request") - return - } - if result.gl.hasNextLink() && result.gl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client GalleriesClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/galleries", 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 GalleriesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client GalleriesClient) ListResponder(resp *http.Response) (result GalleryList, err error) { - err = autorest.Respond( - resp, - 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 GalleriesClient) listNextResults(ctx context.Context, lastResults GalleryList) (result GalleryList, err error) { - req, err := lastResults.galleryListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.GalleriesClient", "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, "compute.GalleriesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client GalleriesClient) ListComplete(ctx context.Context) (result GalleryListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleriesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} - -// ListByResourceGroup list galleries under a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client GalleriesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result GalleryListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleriesClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.gl.Response.Response != nil { - sc = result.gl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.gl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.gl, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.gl.hasNextLink() && result.gl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client GalleriesClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries", pathParameters), - autorest.WithQueryParameters(queryParameters)) - 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 GalleriesClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client GalleriesClient) ListByResourceGroupResponder(resp *http.Response) (result GalleryList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client GalleriesClient) listByResourceGroupNextResults(ctx context.Context, lastResults GalleryList) (result GalleryList, err error) { - req, err := lastResults.galleryListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.GalleriesClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.GalleriesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client GalleriesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result GalleryListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleriesClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// Update update a Shared Image Gallery. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Image Gallery. The allowed characters are alphabets and numbers with -// dots and periods allowed in the middle. The maximum length is 80 characters. -// gallery - parameters supplied to the update Shared Image Gallery operation. -func (client GalleriesClient) Update(ctx context.Context, resourceGroupName string, galleryName string, gallery GalleryUpdate) (result GalleriesUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleriesClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, galleryName, gallery) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client GalleriesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, galleryName string, gallery GalleryUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - 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/galleries/{galleryName}", pathParameters), - autorest.WithJSON(gallery), - 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 GalleriesClient) UpdateSender(req *http.Request) (future GalleriesUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client GalleriesClient) UpdateResponder(resp *http.Response) (result Gallery, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/galleryapplications.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/galleryapplications.go deleted file mode 100644 index d1599af6..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/galleryapplications.go +++ /dev/null @@ -1,485 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// GalleryApplicationsClient is the compute Client -type GalleryApplicationsClient struct { - BaseClient -} - -// NewGalleryApplicationsClient creates an instance of the GalleryApplicationsClient client. -func NewGalleryApplicationsClient(subscriptionID string) GalleryApplicationsClient { - return NewGalleryApplicationsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewGalleryApplicationsClientWithBaseURI creates an instance of the GalleryApplicationsClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewGalleryApplicationsClientWithBaseURI(baseURI string, subscriptionID string) GalleryApplicationsClient { - return GalleryApplicationsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create or update a gallery Application Definition. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Application Gallery in which the Application Definition is to be -// created. -// galleryApplicationName - the name of the gallery Application Definition to be created or updated. The -// allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The -// maximum length is 80 characters. -// galleryApplication - parameters supplied to the create or update gallery Application operation. -func (client GalleryApplicationsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplication GalleryApplication) (result GalleryApplicationsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplication) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client GalleryApplicationsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplication GalleryApplication) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryApplicationName": autorest.Encode("path", galleryApplicationName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - 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.Compute/galleries/{galleryName}/applications/{galleryApplicationName}", pathParameters), - autorest.WithJSON(galleryApplication), - 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 GalleryApplicationsClient) CreateOrUpdateSender(req *http.Request) (future GalleryApplicationsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client GalleryApplicationsClient) CreateOrUpdateResponder(resp *http.Response) (result GalleryApplication, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete a gallery Application. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Application Gallery in which the Application Definition is to be -// deleted. -// galleryApplicationName - the name of the gallery Application Definition to be deleted. -func (client GalleryApplicationsClient) Delete(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string) (result GalleryApplicationsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, galleryName, galleryApplicationName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client GalleryApplicationsClient) DeletePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryApplicationName": autorest.Encode("path", galleryApplicationName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}", 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 GalleryApplicationsClient) DeleteSender(req *http.Request) (future GalleryApplicationsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client GalleryApplicationsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieves information about a gallery Application Definition. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Application Gallery from which the Application Definitions are to be -// retrieved. -// galleryApplicationName - the name of the gallery Application Definition to be retrieved. -func (client GalleryApplicationsClient) Get(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string) (result GalleryApplication, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, galleryName, galleryApplicationName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client GalleryApplicationsClient) GetPreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryApplicationName": autorest.Encode("path", galleryApplicationName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}", 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 GalleryApplicationsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client GalleryApplicationsClient) GetResponder(resp *http.Response) (result GalleryApplication, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByGallery list gallery Application Definitions in a gallery. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Application Gallery from which Application Definitions are to be -// listed. -func (client GalleryApplicationsClient) ListByGallery(ctx context.Context, resourceGroupName string, galleryName string) (result GalleryApplicationListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationsClient.ListByGallery") - defer func() { - sc := -1 - if result.gal.Response.Response != nil { - sc = result.gal.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByGalleryNextResults - req, err := client.ListByGalleryPreparer(ctx, resourceGroupName, galleryName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "ListByGallery", nil, "Failure preparing request") - return - } - - resp, err := client.ListByGallerySender(req) - if err != nil { - result.gal.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "ListByGallery", resp, "Failure sending request") - return - } - - result.gal, err = client.ListByGalleryResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "ListByGallery", resp, "Failure responding to request") - return - } - if result.gal.hasNextLink() && result.gal.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByGalleryPreparer prepares the ListByGallery request. -func (client GalleryApplicationsClient) ListByGalleryPreparer(ctx context.Context, resourceGroupName string, galleryName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByGallerySender sends the ListByGallery request. The method will close the -// http.Response Body if it receives an error. -func (client GalleryApplicationsClient) ListByGallerySender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByGalleryResponder handles the response to the ListByGallery request. The method always -// closes the http.Response Body. -func (client GalleryApplicationsClient) ListByGalleryResponder(resp *http.Response) (result GalleryApplicationList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByGalleryNextResults retrieves the next set of results, if any. -func (client GalleryApplicationsClient) listByGalleryNextResults(ctx context.Context, lastResults GalleryApplicationList) (result GalleryApplicationList, err error) { - req, err := lastResults.galleryApplicationListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "listByGalleryNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByGallerySender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "listByGalleryNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByGalleryResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "listByGalleryNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByGalleryComplete enumerates all values, automatically crossing page boundaries as required. -func (client GalleryApplicationsClient) ListByGalleryComplete(ctx context.Context, resourceGroupName string, galleryName string) (result GalleryApplicationListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationsClient.ListByGallery") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByGallery(ctx, resourceGroupName, galleryName) - return -} - -// Update update a gallery Application Definition. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Application Gallery in which the Application Definition is to be -// updated. -// galleryApplicationName - the name of the gallery Application Definition to be updated. The allowed -// characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum -// length is 80 characters. -// galleryApplication - parameters supplied to the update gallery Application operation. -func (client GalleryApplicationsClient) Update(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplication GalleryApplicationUpdate) (result GalleryApplicationsUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationsClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplication) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client GalleryApplicationsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplication GalleryApplicationUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryApplicationName": autorest.Encode("path", galleryApplicationName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - 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/galleries/{galleryName}/applications/{galleryApplicationName}", pathParameters), - autorest.WithJSON(galleryApplication), - 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 GalleryApplicationsClient) UpdateSender(req *http.Request) (future GalleryApplicationsUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client GalleryApplicationsClient) UpdateResponder(resp *http.Response) (result GalleryApplication, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/galleryapplicationversions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/galleryapplicationversions.go deleted file mode 100644 index 364a3c02..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/galleryapplicationversions.go +++ /dev/null @@ -1,516 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// GalleryApplicationVersionsClient is the compute Client -type GalleryApplicationVersionsClient struct { - BaseClient -} - -// NewGalleryApplicationVersionsClient creates an instance of the GalleryApplicationVersionsClient client. -func NewGalleryApplicationVersionsClient(subscriptionID string) GalleryApplicationVersionsClient { - return NewGalleryApplicationVersionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewGalleryApplicationVersionsClientWithBaseURI creates an instance of the GalleryApplicationVersionsClient client -// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign -// clouds, Azure stack). -func NewGalleryApplicationVersionsClientWithBaseURI(baseURI string, subscriptionID string) GalleryApplicationVersionsClient { - return GalleryApplicationVersionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create or update a gallery Application Version. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Application Gallery in which the Application Definition resides. -// galleryApplicationName - the name of the gallery Application Definition in which the Application Version is -// to be created. -// galleryApplicationVersionName - the name of the gallery Application Version to be created. Needs to follow -// semantic version name pattern: The allowed characters are digit and period. Digits must be within the range -// of a 32-bit integer. Format: .. -// galleryApplicationVersion - parameters supplied to the create or update gallery Application Version -// operation. -func (client GalleryApplicationVersionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, galleryApplicationVersion GalleryApplicationVersion) (result GalleryApplicationVersionsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: galleryApplicationVersion, - Constraints: []validation.Constraint{{Target: "galleryApplicationVersion.GalleryApplicationVersionProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "galleryApplicationVersion.GalleryApplicationVersionProperties.PublishingProfile", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "galleryApplicationVersion.GalleryApplicationVersionProperties.PublishingProfile.Source", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "galleryApplicationVersion.GalleryApplicationVersionProperties.PublishingProfile.Source.MediaLink", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "galleryApplicationVersion.GalleryApplicationVersionProperties.PublishingProfile.ManageActions", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "galleryApplicationVersion.GalleryApplicationVersionProperties.PublishingProfile.ManageActions.Install", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "galleryApplicationVersion.GalleryApplicationVersionProperties.PublishingProfile.ManageActions.Remove", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("compute.GalleryApplicationVersionsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, galleryApplicationVersion) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client GalleryApplicationVersionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, galleryApplicationVersion GalleryApplicationVersion) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryApplicationName": autorest.Encode("path", galleryApplicationName), - "galleryApplicationVersionName": autorest.Encode("path", galleryApplicationVersionName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - 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.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}", pathParameters), - autorest.WithJSON(galleryApplicationVersion), - 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 GalleryApplicationVersionsClient) CreateOrUpdateSender(req *http.Request) (future GalleryApplicationVersionsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client GalleryApplicationVersionsClient) CreateOrUpdateResponder(resp *http.Response) (result GalleryApplicationVersion, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete a gallery Application Version. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Application Gallery in which the Application Definition resides. -// galleryApplicationName - the name of the gallery Application Definition in which the Application Version -// resides. -// galleryApplicationVersionName - the name of the gallery Application Version to be deleted. -func (client GalleryApplicationVersionsClient) Delete(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string) (result GalleryApplicationVersionsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client GalleryApplicationVersionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryApplicationName": autorest.Encode("path", galleryApplicationName), - "galleryApplicationVersionName": autorest.Encode("path", galleryApplicationVersionName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}", 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 GalleryApplicationVersionsClient) DeleteSender(req *http.Request) (future GalleryApplicationVersionsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client GalleryApplicationVersionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieves information about a gallery Application Version. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Application Gallery in which the Application Definition resides. -// galleryApplicationName - the name of the gallery Application Definition in which the Application Version -// resides. -// galleryApplicationVersionName - the name of the gallery Application Version to be retrieved. -// expand - the expand expression to apply on the operation. -func (client GalleryApplicationVersionsClient) Get(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, expand ReplicationStatusTypes) (result GalleryApplicationVersion, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client GalleryApplicationVersionsClient) GetPreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, expand ReplicationStatusTypes) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryApplicationName": autorest.Encode("path", galleryApplicationName), - "galleryApplicationVersionName": autorest.Encode("path", galleryApplicationVersionName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(string(expand)) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}", 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 GalleryApplicationVersionsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client GalleryApplicationVersionsClient) GetResponder(resp *http.Response) (result GalleryApplicationVersion, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByGalleryApplication list gallery Application Versions in a gallery Application Definition. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Application Gallery in which the Application Definition resides. -// galleryApplicationName - the name of the Shared Application Gallery Application Definition from which the -// Application Versions are to be listed. -func (client GalleryApplicationVersionsClient) ListByGalleryApplication(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string) (result GalleryApplicationVersionListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionsClient.ListByGalleryApplication") - defer func() { - sc := -1 - if result.gavl.Response.Response != nil { - sc = result.gavl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByGalleryApplicationNextResults - req, err := client.ListByGalleryApplicationPreparer(ctx, resourceGroupName, galleryName, galleryApplicationName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "ListByGalleryApplication", nil, "Failure preparing request") - return - } - - resp, err := client.ListByGalleryApplicationSender(req) - if err != nil { - result.gavl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "ListByGalleryApplication", resp, "Failure sending request") - return - } - - result.gavl, err = client.ListByGalleryApplicationResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "ListByGalleryApplication", resp, "Failure responding to request") - return - } - if result.gavl.hasNextLink() && result.gavl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByGalleryApplicationPreparer prepares the ListByGalleryApplication request. -func (client GalleryApplicationVersionsClient) ListByGalleryApplicationPreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryApplicationName": autorest.Encode("path", galleryApplicationName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByGalleryApplicationSender sends the ListByGalleryApplication request. The method will close the -// http.Response Body if it receives an error. -func (client GalleryApplicationVersionsClient) ListByGalleryApplicationSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByGalleryApplicationResponder handles the response to the ListByGalleryApplication request. The method always -// closes the http.Response Body. -func (client GalleryApplicationVersionsClient) ListByGalleryApplicationResponder(resp *http.Response) (result GalleryApplicationVersionList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByGalleryApplicationNextResults retrieves the next set of results, if any. -func (client GalleryApplicationVersionsClient) listByGalleryApplicationNextResults(ctx context.Context, lastResults GalleryApplicationVersionList) (result GalleryApplicationVersionList, err error) { - req, err := lastResults.galleryApplicationVersionListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "listByGalleryApplicationNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByGalleryApplicationSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "listByGalleryApplicationNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByGalleryApplicationResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "listByGalleryApplicationNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByGalleryApplicationComplete enumerates all values, automatically crossing page boundaries as required. -func (client GalleryApplicationVersionsClient) ListByGalleryApplicationComplete(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string) (result GalleryApplicationVersionListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionsClient.ListByGalleryApplication") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByGalleryApplication(ctx, resourceGroupName, galleryName, galleryApplicationName) - return -} - -// Update update a gallery Application Version. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Application Gallery in which the Application Definition resides. -// galleryApplicationName - the name of the gallery Application Definition in which the Application Version is -// to be updated. -// galleryApplicationVersionName - the name of the gallery Application Version to be updated. Needs to follow -// semantic version name pattern: The allowed characters are digit and period. Digits must be within the range -// of a 32-bit integer. Format: .. -// galleryApplicationVersion - parameters supplied to the update gallery Application Version operation. -func (client GalleryApplicationVersionsClient) Update(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, galleryApplicationVersion GalleryApplicationVersionUpdate) (result GalleryApplicationVersionsUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionsClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, galleryApplicationVersion) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client GalleryApplicationVersionsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, galleryApplicationVersion GalleryApplicationVersionUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryApplicationName": autorest.Encode("path", galleryApplicationName), - "galleryApplicationVersionName": autorest.Encode("path", galleryApplicationVersionName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - 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/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}", pathParameters), - autorest.WithJSON(galleryApplicationVersion), - 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 GalleryApplicationVersionsClient) UpdateSender(req *http.Request) (future GalleryApplicationVersionsUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client GalleryApplicationVersionsClient) UpdateResponder(resp *http.Response) (result GalleryApplicationVersion, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/galleryimages.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/galleryimages.go deleted file mode 100644 index 61283069..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/galleryimages.go +++ /dev/null @@ -1,492 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// GalleryImagesClient is the compute Client -type GalleryImagesClient struct { - BaseClient -} - -// NewGalleryImagesClient creates an instance of the GalleryImagesClient client. -func NewGalleryImagesClient(subscriptionID string) GalleryImagesClient { - return NewGalleryImagesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewGalleryImagesClientWithBaseURI creates an instance of the GalleryImagesClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewGalleryImagesClientWithBaseURI(baseURI string, subscriptionID string) GalleryImagesClient { - return GalleryImagesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create or update a gallery image definition. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Image Gallery in which the Image Definition is to be created. -// galleryImageName - the name of the gallery image definition to be created or updated. The allowed characters -// are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 -// characters. -// galleryImage - parameters supplied to the create or update gallery image operation. -func (client GalleryImagesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImage GalleryImage) (result GalleryImagesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImagesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: galleryImage, - Constraints: []validation.Constraint{{Target: "galleryImage.GalleryImageProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "galleryImage.GalleryImageProperties.Identifier", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "galleryImage.GalleryImageProperties.Identifier.Publisher", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "galleryImage.GalleryImageProperties.Identifier.Offer", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "galleryImage.GalleryImageProperties.Identifier.Sku", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}}}}); err != nil { - return result, validation.NewError("compute.GalleryImagesClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, galleryName, galleryImageName, galleryImage) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client GalleryImagesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImage GalleryImage) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryImageName": autorest.Encode("path", galleryImageName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - 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.Compute/galleries/{galleryName}/images/{galleryImageName}", pathParameters), - autorest.WithJSON(galleryImage), - 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 GalleryImagesClient) CreateOrUpdateSender(req *http.Request) (future GalleryImagesCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client GalleryImagesClient) CreateOrUpdateResponder(resp *http.Response) (result GalleryImage, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete a gallery image. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Image Gallery in which the Image Definition is to be deleted. -// galleryImageName - the name of the gallery image definition to be deleted. -func (client GalleryImagesClient) Delete(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string) (result GalleryImagesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImagesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, galleryName, galleryImageName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client GalleryImagesClient) DeletePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryImageName": autorest.Encode("path", galleryImageName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}", 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 GalleryImagesClient) DeleteSender(req *http.Request) (future GalleryImagesDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client GalleryImagesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieves information about a gallery image definition. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Image Gallery from which the Image Definitions are to be retrieved. -// galleryImageName - the name of the gallery image definition to be retrieved. -func (client GalleryImagesClient) Get(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string) (result GalleryImage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImagesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, galleryName, galleryImageName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client GalleryImagesClient) GetPreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryImageName": autorest.Encode("path", galleryImageName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}", 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 GalleryImagesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client GalleryImagesClient) GetResponder(resp *http.Response) (result GalleryImage, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByGallery list gallery image definitions in a gallery. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Image Gallery from which Image Definitions are to be listed. -func (client GalleryImagesClient) ListByGallery(ctx context.Context, resourceGroupName string, galleryName string) (result GalleryImageListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImagesClient.ListByGallery") - defer func() { - sc := -1 - if result.gil.Response.Response != nil { - sc = result.gil.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByGalleryNextResults - req, err := client.ListByGalleryPreparer(ctx, resourceGroupName, galleryName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "ListByGallery", nil, "Failure preparing request") - return - } - - resp, err := client.ListByGallerySender(req) - if err != nil { - result.gil.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "ListByGallery", resp, "Failure sending request") - return - } - - result.gil, err = client.ListByGalleryResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "ListByGallery", resp, "Failure responding to request") - return - } - if result.gil.hasNextLink() && result.gil.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByGalleryPreparer prepares the ListByGallery request. -func (client GalleryImagesClient) ListByGalleryPreparer(ctx context.Context, resourceGroupName string, galleryName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByGallerySender sends the ListByGallery request. The method will close the -// http.Response Body if it receives an error. -func (client GalleryImagesClient) ListByGallerySender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByGalleryResponder handles the response to the ListByGallery request. The method always -// closes the http.Response Body. -func (client GalleryImagesClient) ListByGalleryResponder(resp *http.Response) (result GalleryImageList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByGalleryNextResults retrieves the next set of results, if any. -func (client GalleryImagesClient) listByGalleryNextResults(ctx context.Context, lastResults GalleryImageList) (result GalleryImageList, err error) { - req, err := lastResults.galleryImageListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "listByGalleryNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByGallerySender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "listByGalleryNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByGalleryResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "listByGalleryNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByGalleryComplete enumerates all values, automatically crossing page boundaries as required. -func (client GalleryImagesClient) ListByGalleryComplete(ctx context.Context, resourceGroupName string, galleryName string) (result GalleryImageListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImagesClient.ListByGallery") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByGallery(ctx, resourceGroupName, galleryName) - return -} - -// Update update a gallery image definition. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Image Gallery in which the Image Definition is to be updated. -// galleryImageName - the name of the gallery image definition to be updated. The allowed characters are -// alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 -// characters. -// galleryImage - parameters supplied to the update gallery image operation. -func (client GalleryImagesClient) Update(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImage GalleryImageUpdate) (result GalleryImagesUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImagesClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, galleryName, galleryImageName, galleryImage) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client GalleryImagesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImage GalleryImageUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryImageName": autorest.Encode("path", galleryImageName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - 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/galleries/{galleryName}/images/{galleryImageName}", pathParameters), - autorest.WithJSON(galleryImage), - 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 GalleryImagesClient) UpdateSender(req *http.Request) (future GalleryImagesUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client GalleryImagesClient) UpdateResponder(resp *http.Response) (result GalleryImage, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/galleryimageversions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/galleryimageversions.go deleted file mode 100644 index e0610884..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/galleryimageversions.go +++ /dev/null @@ -1,503 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// GalleryImageVersionsClient is the compute Client -type GalleryImageVersionsClient struct { - BaseClient -} - -// NewGalleryImageVersionsClient creates an instance of the GalleryImageVersionsClient client. -func NewGalleryImageVersionsClient(subscriptionID string) GalleryImageVersionsClient { - return NewGalleryImageVersionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewGalleryImageVersionsClientWithBaseURI creates an instance of the GalleryImageVersionsClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewGalleryImageVersionsClientWithBaseURI(baseURI string, subscriptionID string) GalleryImageVersionsClient { - return GalleryImageVersionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create or update a gallery image version. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Image Gallery in which the Image Definition resides. -// galleryImageName - the name of the gallery image definition in which the Image Version is to be created. -// galleryImageVersionName - the name of the gallery image version to be created. Needs to follow semantic -// version name pattern: The allowed characters are digit and period. Digits must be within the range of a -// 32-bit integer. Format: .. -// galleryImageVersion - parameters supplied to the create or update gallery image version operation. -func (client GalleryImageVersionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, galleryImageVersion GalleryImageVersion) (result GalleryImageVersionsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageVersionsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: galleryImageVersion, - Constraints: []validation.Constraint{{Target: "galleryImageVersion.GalleryImageVersionProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "galleryImageVersion.GalleryImageVersionProperties.StorageProfile", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("compute.GalleryImageVersionsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client GalleryImageVersionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, galleryImageVersion GalleryImageVersion) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryImageName": autorest.Encode("path", galleryImageName), - "galleryImageVersionName": autorest.Encode("path", galleryImageVersionName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - 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.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}", pathParameters), - autorest.WithJSON(galleryImageVersion), - 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 GalleryImageVersionsClient) CreateOrUpdateSender(req *http.Request) (future GalleryImageVersionsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client GalleryImageVersionsClient) CreateOrUpdateResponder(resp *http.Response) (result GalleryImageVersion, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete a gallery image version. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Image Gallery in which the Image Definition resides. -// galleryImageName - the name of the gallery image definition in which the Image Version resides. -// galleryImageVersionName - the name of the gallery image version to be deleted. -func (client GalleryImageVersionsClient) Delete(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string) (result GalleryImageVersionsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageVersionsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, galleryName, galleryImageName, galleryImageVersionName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client GalleryImageVersionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryImageName": autorest.Encode("path", galleryImageName), - "galleryImageVersionName": autorest.Encode("path", galleryImageVersionName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}", 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 GalleryImageVersionsClient) DeleteSender(req *http.Request) (future GalleryImageVersionsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client GalleryImageVersionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieves information about a gallery image version. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Image Gallery in which the Image Definition resides. -// galleryImageName - the name of the gallery image definition in which the Image Version resides. -// galleryImageVersionName - the name of the gallery image version to be retrieved. -// expand - the expand expression to apply on the operation. -func (client GalleryImageVersionsClient) Get(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, expand ReplicationStatusTypes) (result GalleryImageVersion, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageVersionsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client GalleryImageVersionsClient) GetPreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, expand ReplicationStatusTypes) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryImageName": autorest.Encode("path", galleryImageName), - "galleryImageVersionName": autorest.Encode("path", galleryImageVersionName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(string(expand)) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}", 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 GalleryImageVersionsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client GalleryImageVersionsClient) GetResponder(resp *http.Response) (result GalleryImageVersion, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByGalleryImage list gallery image versions in a gallery image definition. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Image Gallery in which the Image Definition resides. -// galleryImageName - the name of the Shared Image Gallery Image Definition from which the Image Versions are -// to be listed. -func (client GalleryImageVersionsClient) ListByGalleryImage(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string) (result GalleryImageVersionListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageVersionsClient.ListByGalleryImage") - defer func() { - sc := -1 - if result.givl.Response.Response != nil { - sc = result.givl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByGalleryImageNextResults - req, err := client.ListByGalleryImagePreparer(ctx, resourceGroupName, galleryName, galleryImageName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "ListByGalleryImage", nil, "Failure preparing request") - return - } - - resp, err := client.ListByGalleryImageSender(req) - if err != nil { - result.givl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "ListByGalleryImage", resp, "Failure sending request") - return - } - - result.givl, err = client.ListByGalleryImageResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "ListByGalleryImage", resp, "Failure responding to request") - return - } - if result.givl.hasNextLink() && result.givl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByGalleryImagePreparer prepares the ListByGalleryImage request. -func (client GalleryImageVersionsClient) ListByGalleryImagePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryImageName": autorest.Encode("path", galleryImageName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByGalleryImageSender sends the ListByGalleryImage request. The method will close the -// http.Response Body if it receives an error. -func (client GalleryImageVersionsClient) ListByGalleryImageSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByGalleryImageResponder handles the response to the ListByGalleryImage request. The method always -// closes the http.Response Body. -func (client GalleryImageVersionsClient) ListByGalleryImageResponder(resp *http.Response) (result GalleryImageVersionList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByGalleryImageNextResults retrieves the next set of results, if any. -func (client GalleryImageVersionsClient) listByGalleryImageNextResults(ctx context.Context, lastResults GalleryImageVersionList) (result GalleryImageVersionList, err error) { - req, err := lastResults.galleryImageVersionListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "listByGalleryImageNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByGalleryImageSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "listByGalleryImageNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByGalleryImageResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "listByGalleryImageNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByGalleryImageComplete enumerates all values, automatically crossing page boundaries as required. -func (client GalleryImageVersionsClient) ListByGalleryImageComplete(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string) (result GalleryImageVersionListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageVersionsClient.ListByGalleryImage") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByGalleryImage(ctx, resourceGroupName, galleryName, galleryImageName) - return -} - -// Update update a gallery image version. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Image Gallery in which the Image Definition resides. -// galleryImageName - the name of the gallery image definition in which the Image Version is to be updated. -// galleryImageVersionName - the name of the gallery image version to be updated. Needs to follow semantic -// version name pattern: The allowed characters are digit and period. Digits must be within the range of a -// 32-bit integer. Format: .. -// galleryImageVersion - parameters supplied to the update gallery image version operation. -func (client GalleryImageVersionsClient) Update(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, galleryImageVersion GalleryImageVersionUpdate) (result GalleryImageVersionsUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageVersionsClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client GalleryImageVersionsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, galleryImageVersion GalleryImageVersionUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryImageName": autorest.Encode("path", galleryImageName), - "galleryImageVersionName": autorest.Encode("path", galleryImageVersionName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - 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/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}", pathParameters), - autorest.WithJSON(galleryImageVersion), - 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 GalleryImageVersionsClient) UpdateSender(req *http.Request) (future GalleryImageVersionsUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client GalleryImageVersionsClient) UpdateResponder(resp *http.Response) (result GalleryImageVersion, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/gallerysharingprofile.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/gallerysharingprofile.go deleted file mode 100644 index 311d7e7c..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/gallerysharingprofile.go +++ /dev/null @@ -1,114 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// GallerySharingProfileClient is the compute Client -type GallerySharingProfileClient struct { - BaseClient -} - -// NewGallerySharingProfileClient creates an instance of the GallerySharingProfileClient client. -func NewGallerySharingProfileClient(subscriptionID string) GallerySharingProfileClient { - return NewGallerySharingProfileClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewGallerySharingProfileClientWithBaseURI creates an instance of the GallerySharingProfileClient client using a -// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, -// Azure stack). -func NewGallerySharingProfileClientWithBaseURI(baseURI string, subscriptionID string) GallerySharingProfileClient { - return GallerySharingProfileClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Update update sharing profile of a gallery. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Image Gallery. -// sharingUpdate - parameters supplied to the update gallery sharing profile. -func (client GallerySharingProfileClient) Update(ctx context.Context, resourceGroupName string, galleryName string, sharingUpdate SharingUpdate) (result GallerySharingProfileUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GallerySharingProfileClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, galleryName, sharingUpdate) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GallerySharingProfileClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GallerySharingProfileClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client GallerySharingProfileClient) UpdatePreparer(ctx context.Context, resourceGroupName string, galleryName string, sharingUpdate SharingUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - 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.Compute/galleries/{galleryName}/share", pathParameters), - autorest.WithJSON(sharingUpdate), - 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 GallerySharingProfileClient) UpdateSender(req *http.Request) (future GallerySharingProfileUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client GallerySharingProfileClient) UpdateResponder(resp *http.Response) (result SharingUpdate, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - 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/2022-08-01/compute/images.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/images.go deleted file mode 100644 index 6c41cf7c..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/images.go +++ /dev/null @@ -1,583 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ImagesClient is the compute Client -type ImagesClient struct { - BaseClient -} - -// NewImagesClient creates an instance of the ImagesClient client. -func NewImagesClient(subscriptionID string) ImagesClient { - return NewImagesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewImagesClientWithBaseURI creates an instance of the ImagesClient client using a custom endpoint. Use this when -// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewImagesClientWithBaseURI(baseURI string, subscriptionID string) ImagesClient { - return ImagesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create or update an image. -// Parameters: -// resourceGroupName - the name of the resource group. -// imageName - the name of the image. -// parameters - 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 tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ImagesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, imageName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ImagesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, imageName string, parameters Image) (*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 = "2022-08-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.Compute/images/{imageName}", 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 ImagesClient) CreateOrUpdateSender(req *http.Request) (future ImagesCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client ImagesClient) CreateOrUpdateResponder(resp *http.Response) (result Image, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes an Image. -// Parameters: -// resourceGroupName - the name of the resource group. -// imageName - the name of the image. -func (client ImagesClient) Delete(ctx context.Context, resourceGroupName string, imageName string) (result ImagesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ImagesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, imageName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ImagesClient) DeletePreparer(ctx context.Context, resourceGroupName string, imageName string) (*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 = "2022-08-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.Compute/images/{imageName}", 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 ImagesClient) DeleteSender(req *http.Request) (future ImagesDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client ImagesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets an image. -// Parameters: -// resourceGroupName - the name of the resource group. -// imageName - the name of the image. -// expand - the expand expression to apply on the operation. -func (client ImagesClient) Get(ctx context.Context, resourceGroupName string, imageName string, expand string) (result Image, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ImagesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, imageName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.ImagesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ImagesClient) GetPreparer(ctx context.Context, resourceGroupName string, imageName string, expand string) (*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 = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}", 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 ImagesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ImagesClient) GetResponder(resp *http.Response) (result Image, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets the list of Images in the subscription. Use nextLink property in the response to get the next page of -// Images. Do this till nextLink is null to fetch all the Images. -func (client ImagesClient) List(ctx context.Context) (result ImageListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ImagesClient.List") - defer func() { - sc := -1 - if result.ilr.Response.Response != nil { - sc = result.ilr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.ilr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.ImagesClient", "List", resp, "Failure sending request") - return - } - - result.ilr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesClient", "List", resp, "Failure responding to request") - return - } - if result.ilr.hasNextLink() && result.ilr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ImagesClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/images", 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 ImagesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ImagesClient) ListResponder(resp *http.Response) (result ImageListResult, err error) { - err = autorest.Respond( - resp, - 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 ImagesClient) listNextResults(ctx context.Context, lastResults ImageListResult) (result ImageListResult, err error) { - req, err := lastResults.imageListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.ImagesClient", "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, "compute.ImagesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ImagesClient) ListComplete(ctx context.Context) (result ImageListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ImagesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} - -// ListByResourceGroup gets the list of images under a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client ImagesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ImageListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ImagesClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.ilr.Response.Response != nil { - sc = result.ilr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.ilr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.ImagesClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.ilr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.ilr.hasNextLink() && result.ilr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client ImagesClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-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.Compute/images", pathParameters), - autorest.WithQueryParameters(queryParameters)) - 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 ImagesClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client ImagesClient) ListByResourceGroupResponder(resp *http.Response) (result ImageListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client ImagesClient) listByResourceGroupNextResults(ctx context.Context, lastResults ImageListResult) (result ImageListResult, err error) { - req, err := lastResults.imageListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.ImagesClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.ImagesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client ImagesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ImageListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ImagesClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// Update update an image. -// Parameters: -// resourceGroupName - the name of the resource group. -// imageName - the name of the image. -// parameters - parameters supplied to the Update Image operation. -func (client ImagesClient) Update(ctx context.Context, resourceGroupName string, imageName string, parameters ImageUpdate) (result ImagesUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ImagesClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - 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 = "2022-08-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) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - 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, - 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/2022-08-01/compute/loganalytics.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/loganalytics.go deleted file mode 100644 index 9182f969..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/loganalytics.go +++ /dev/null @@ -1,206 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// LogAnalyticsClient is the compute Client -type LogAnalyticsClient struct { - BaseClient -} - -// NewLogAnalyticsClient creates an instance of the LogAnalyticsClient client. -func NewLogAnalyticsClient(subscriptionID string) LogAnalyticsClient { - return NewLogAnalyticsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewLogAnalyticsClientWithBaseURI creates an instance of the LogAnalyticsClient client using a custom endpoint. Use -// this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewLogAnalyticsClientWithBaseURI(baseURI string, subscriptionID string) LogAnalyticsClient { - return LogAnalyticsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// ExportRequestRateByInterval export logs that show Api requests made by this subscription in the given time window to -// show throttling activities. -// Parameters: -// parameters - parameters supplied to the LogAnalytics getRequestRateByInterval Api. -// location - 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 tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LogAnalyticsClient.ExportRequestRateByInterval") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - 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.NewError("compute.LogAnalyticsClient", "ExportRequestRateByInterval", err.Error()) - } - - req, err := client.ExportRequestRateByIntervalPreparer(ctx, parameters, location) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.LogAnalyticsClient", "ExportRequestRateByInterval", nil, "Failure preparing request") - return - } - - result, err = client.ExportRequestRateByIntervalSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.LogAnalyticsClient", "ExportRequestRateByInterval", result.Response(), "Failure sending request") - return - } - - return -} - -// ExportRequestRateByIntervalPreparer prepares the ExportRequestRateByInterval request. -func (client LogAnalyticsClient) ExportRequestRateByIntervalPreparer(ctx context.Context, parameters RequestRateByIntervalInput, location string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-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.Compute/locations/{location}/logAnalytics/apiAccess/getRequestRateByInterval", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ExportRequestRateByIntervalSender sends the ExportRequestRateByInterval request. The method will close the -// http.Response Body if it receives an error. -func (client LogAnalyticsClient) ExportRequestRateByIntervalSender(req *http.Request) (future LogAnalyticsExportRequestRateByIntervalFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ExportRequestRateByIntervalResponder handles the response to the ExportRequestRateByInterval request. The method always -// closes the http.Response Body. -func (client LogAnalyticsClient) ExportRequestRateByIntervalResponder(resp *http.Response) (result LogAnalyticsOperationResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ExportThrottledRequests export logs that show total throttled Api requests for this subscription in the given time -// window. -// Parameters: -// parameters - parameters supplied to the LogAnalytics getThrottledRequests Api. -// location - 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 tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LogAnalyticsClient.ExportThrottledRequests") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - 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.NewError("compute.LogAnalyticsClient", "ExportThrottledRequests", err.Error()) - } - - req, err := client.ExportThrottledRequestsPreparer(ctx, parameters, location) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.LogAnalyticsClient", "ExportThrottledRequests", nil, "Failure preparing request") - return - } - - result, err = client.ExportThrottledRequestsSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.LogAnalyticsClient", "ExportThrottledRequests", result.Response(), "Failure sending request") - return - } - - return -} - -// ExportThrottledRequestsPreparer prepares the ExportThrottledRequests request. -func (client LogAnalyticsClient) ExportThrottledRequestsPreparer(ctx context.Context, parameters ThrottledRequestsInput, location string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-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.Compute/locations/{location}/logAnalytics/apiAccess/getThrottledRequests", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ExportThrottledRequestsSender sends the ExportThrottledRequests request. The method will close the -// http.Response Body if it receives an error. -func (client LogAnalyticsClient) ExportThrottledRequestsSender(req *http.Request) (future LogAnalyticsExportThrottledRequestsFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ExportThrottledRequestsResponder handles the response to the ExportThrottledRequests request. The method always -// closes the http.Response Body. -func (client LogAnalyticsClient) ExportThrottledRequestsResponder(resp *http.Response) (result LogAnalyticsOperationResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - 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/2022-08-01/compute/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/models.go deleted file mode 100644 index 5580543b..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/models.go +++ /dev/null @@ -1,24333 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "encoding/json" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/date" - "github.com/Azure/go-autorest/autorest/to" - "github.com/Azure/go-autorest/tracing" - "io" - "net/http" -) - -// The package's fully qualified name. -const fqdn = "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute" - -// AccessURI a disk access SAS uri. -type AccessURI struct { - autorest.Response `json:"-"` - // AccessSAS - READ-ONLY; A SAS uri for accessing a disk. - AccessSAS *string `json:"accessSAS,omitempty"` - // SecurityDataAccessSAS - READ-ONLY; A SAS uri for accessing a VM guest state. - SecurityDataAccessSAS *string `json:"securityDataAccessSAS,omitempty"` -} - -// MarshalJSON is the custom marshaler for AccessURI. -func (au AccessURI) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// AdditionalCapabilities enables or disables a capability on the virtual machine or virtual machine scale -// set. -type AdditionalCapabilities struct { - // UltraSSDEnabled - The flag that enables or disables a capability to have one or more managed data disks with UltraSSD_LRS storage account type on the VM or VMSS. Managed disks with storage account type UltraSSD_LRS can be added to a virtual machine or virtual machine scale set only if this property is enabled. - UltraSSDEnabled *bool `json:"ultraSSDEnabled,omitempty"` - // HibernationEnabled - The flag that enables or disables hibernation capability on the VM. - HibernationEnabled *bool `json:"hibernationEnabled,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. -type AdditionalUnattendContent struct { - // PassName - The pass name. Currently, the only allowable value is OobeSystem. Possible values include: 'OobeSystem' - PassName PassNames `json:"passName,omitempty"` - // ComponentName - The component name. Currently, the only allowable value is Microsoft-Windows-Shell-Setup. Possible values include: 'MicrosoftWindowsShellSetup' - ComponentName ComponentNames `json:"componentName,omitempty"` - // SettingName - Specifies the name of the setting to which the content applies. Possible values are: FirstLogonCommands and AutoLogon. Possible values include: 'AutoLogon', 'FirstLogonCommands' - SettingName SettingNames `json:"settingName,omitempty"` - // Content - Specifies the XML formatted content that is added to the unattend.xml file for the specified path and component. The XML must be less than 4KB and must include the root element for the setting or feature that is being inserted. - Content *string `json:"content,omitempty"` -} - -// APIEntityReference the API entity reference. -type APIEntityReference struct { - // ID - The ARM resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... - ID *string `json:"id,omitempty"` -} - -// APIError api error. -type APIError struct { - // Details - The Api error details - Details *[]APIErrorBase `json:"details,omitempty"` - // Innererror - The Api inner error - Innererror *InnerError `json:"innererror,omitempty"` - // Code - The error code. - Code *string `json:"code,omitempty"` - // Target - The target of the particular error. - Target *string `json:"target,omitempty"` - // Message - The error message. - Message *string `json:"message,omitempty"` -} - -// APIErrorBase api error base. -type APIErrorBase struct { - // Code - The error code. - Code *string `json:"code,omitempty"` - // Target - The target of the particular error. - Target *string `json:"target,omitempty"` - // Message - The error message. - Message *string `json:"message,omitempty"` -} - -// ApplicationProfile contains the list of gallery applications that should be made available to the -// VM/VMSS -type ApplicationProfile struct { - // GalleryApplications - Specifies the gallery applications that should be made available to the VM/VMSS - GalleryApplications *[]VMGalleryApplication `json:"galleryApplications,omitempty"` -} - -// AutomaticOSUpgradePolicy the configuration parameters used for performing automatic OS upgrade. -type AutomaticOSUpgradePolicy struct { - // EnableAutomaticOSUpgrade - Indicates whether OS upgrades should automatically be applied to scale set instances in a rolling fashion when a newer version of the OS image becomes available. Default value is false.

      If this is set to true for Windows based scale sets, [enableAutomaticUpdates](https://docs.microsoft.com/dotnet/api/microsoft.azure.management.compute.models.windowsconfiguration.enableautomaticupdates?view=azure-dotnet) is automatically set to false and cannot be set to true. - EnableAutomaticOSUpgrade *bool `json:"enableAutomaticOSUpgrade,omitempty"` - // DisableAutomaticRollback - Whether OS image rollback feature should be disabled. Default value is false. - DisableAutomaticRollback *bool `json:"disableAutomaticRollback,omitempty"` - // UseRollingUpgradePolicy - Indicates whether rolling upgrade policy should be used during Auto OS Upgrade. Default value is false. Auto OS Upgrade will fallback to the default policy if no policy is defined on the VMSS. - UseRollingUpgradePolicy *bool `json:"useRollingUpgradePolicy,omitempty"` -} - -// AutomaticOSUpgradeProperties describes automatic OS upgrade properties on the image. -type AutomaticOSUpgradeProperties struct { - // AutomaticOSUpgradeSupported - Specifies whether automatic OS upgrade is supported on the image. - AutomaticOSUpgradeSupported *bool `json:"automaticOSUpgradeSupported,omitempty"` -} - -// AutomaticRepairsPolicy specifies the configuration parameters for automatic repairs on the virtual -// machine scale set. -type AutomaticRepairsPolicy struct { - // Enabled - Specifies whether automatic repairs should be enabled on the virtual machine scale set. The default value is false. - Enabled *bool `json:"enabled,omitempty"` - // GracePeriod - The amount of time for which automatic repairs are suspended due to a state change on VM. The grace time starts after the state change has completed. This helps avoid premature or accidental repairs. The time duration should be specified in ISO 8601 format. The minimum allowed grace period is 10 minutes (PT10M), which is also the default value. The maximum allowed grace period is 90 minutes (PT90M). - GracePeriod *string `json:"gracePeriod,omitempty"` - // RepairAction - Type of repair action (replace, restart, reimage) that will be used for repairing unhealthy virtual machines in the scale set. Default value is replace. Possible values include: 'Replace', 'Restart', 'Reimage' - RepairAction RepairAction `json:"repairAction,omitempty"` -} - -// 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 [Availability sets -// overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview).

      For -// more information on Azure planned maintenance, see [Maintenance and updates for Virtual Machines in -// Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates)

      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:"-"` - *AvailabilitySetProperties `json:"properties,omitempty"` - // Sku - Sku of the availability set, only name is required to be set. See AvailabilitySetSkuTypes for possible set of values. Use 'Aligned' for virtual machines with managed disks and 'Classic' for virtual machines with unmanaged disks. Default value is 'Classic'. - Sku *Sku `json:"sku,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; 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 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.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. -type AvailabilitySetListResult struct { - autorest.Response `json:"-"` - // Value - The list of availability sets - Value *[]AvailabilitySet `json:"value,omitempty"` - // NextLink - The URI to fetch the next page of AvailabilitySets. Call ListNext() with this URI to fetch the next page of AvailabilitySets. - NextLink *string `json:"nextLink,omitempty"` -} - -// AvailabilitySetListResultIterator provides access to a complete listing of AvailabilitySet values. -type AvailabilitySetListResultIterator struct { - i int - page AvailabilitySetListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *AvailabilitySetListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *AvailabilitySetListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter AvailabilitySetListResultIterator) 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 AvailabilitySetListResultIterator) Response() AvailabilitySetListResult { - 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 AvailabilitySetListResultIterator) Value() AvailabilitySet { - if !iter.page.NotDone() { - return AvailabilitySet{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the AvailabilitySetListResultIterator type. -func NewAvailabilitySetListResultIterator(page AvailabilitySetListResultPage) AvailabilitySetListResultIterator { - return AvailabilitySetListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (aslr AvailabilitySetListResult) IsEmpty() bool { - return aslr.Value == nil || len(*aslr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (aslr AvailabilitySetListResult) hasNextLink() bool { - return aslr.NextLink != nil && len(*aslr.NextLink) != 0 -} - -// availabilitySetListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (aslr AvailabilitySetListResult) availabilitySetListResultPreparer(ctx context.Context) (*http.Request, error) { - if !aslr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(aslr.NextLink))) -} - -// AvailabilitySetListResultPage contains a page of AvailabilitySet values. -type AvailabilitySetListResultPage struct { - fn func(context.Context, AvailabilitySetListResult) (AvailabilitySetListResult, error) - aslr AvailabilitySetListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *AvailabilitySetListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.aslr) - if err != nil { - return err - } - page.aslr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *AvailabilitySetListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page AvailabilitySetListResultPage) NotDone() bool { - return !page.aslr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page AvailabilitySetListResultPage) Response() AvailabilitySetListResult { - return page.aslr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page AvailabilitySetListResultPage) Values() []AvailabilitySet { - if page.aslr.IsEmpty() { - return nil - } - return *page.aslr.Value -} - -// Creates a new instance of the AvailabilitySetListResultPage type. -func NewAvailabilitySetListResultPage(cur AvailabilitySetListResult, getNextPage func(context.Context, AvailabilitySetListResult) (AvailabilitySetListResult, error)) AvailabilitySetListResultPage { - return AvailabilitySetListResultPage{ - fn: getNextPage, - aslr: cur, - } -} - -// AvailabilitySetProperties the instance view of a resource. -type AvailabilitySetProperties struct { - // PlatformUpdateDomainCount - Update Domain count. - PlatformUpdateDomainCount *int32 `json:"platformUpdateDomainCount,omitempty"` - // PlatformFaultDomainCount - Fault Domain count. - PlatformFaultDomainCount *int32 `json:"platformFaultDomainCount,omitempty"` - // VirtualMachines - A list of references to all virtual machines in the availability set. - VirtualMachines *[]SubResource `json:"virtualMachines,omitempty"` - // ProximityPlacementGroup - Specifies information about the proximity placement group that the availability set should be assigned to.

      Minimum api-version: 2018-04-01. - ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` - // Statuses - READ-ONLY; The resource status information. - Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` -} - -// MarshalJSON is the custom marshaler for AvailabilitySetProperties. -func (asp AvailabilitySetProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if asp.PlatformUpdateDomainCount != nil { - objectMap["platformUpdateDomainCount"] = asp.PlatformUpdateDomainCount - } - if asp.PlatformFaultDomainCount != nil { - objectMap["platformFaultDomainCount"] = asp.PlatformFaultDomainCount - } - if asp.VirtualMachines != nil { - objectMap["virtualMachines"] = asp.VirtualMachines - } - if asp.ProximityPlacementGroup != nil { - objectMap["proximityPlacementGroup"] = asp.ProximityPlacementGroup - } - return json.Marshal(objectMap) -} - -// AvailabilitySetUpdate specifies information about the availability set that the virtual machine should -// be assigned to. Only tags may be updated. -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 -} - -// AvailablePatchSummary describes the properties of an virtual machine instance view for available patch -// summary. -type AvailablePatchSummary struct { - // Status - READ-ONLY; The overall success or failure status of the operation. It remains "InProgress" until the operation completes. At that point it will become "Unknown", "Failed", "Succeeded", or "CompletedWithWarnings.". Possible values include: 'PatchOperationStatusUnknown', 'PatchOperationStatusInProgress', 'PatchOperationStatusFailed', 'PatchOperationStatusSucceeded', 'PatchOperationStatusCompletedWithWarnings' - Status PatchOperationStatus `json:"status,omitempty"` - // AssessmentActivityID - READ-ONLY; The activity ID of the operation that produced this result. It is used to correlate across CRP and extension logs. - AssessmentActivityID *string `json:"assessmentActivityId,omitempty"` - // RebootPending - READ-ONLY; The overall reboot status of the VM. It will be true when partially installed patches require a reboot to complete installation but the reboot has not yet occurred. - RebootPending *bool `json:"rebootPending,omitempty"` - // CriticalAndSecurityPatchCount - READ-ONLY; The number of critical or security patches that have been detected as available and not yet installed. - CriticalAndSecurityPatchCount *int32 `json:"criticalAndSecurityPatchCount,omitempty"` - // OtherPatchCount - READ-ONLY; The number of all available patches excluding critical and security. - OtherPatchCount *int32 `json:"otherPatchCount,omitempty"` - // StartTime - READ-ONLY; The UTC timestamp when the operation began. - StartTime *date.Time `json:"startTime,omitempty"` - // LastModifiedTime - READ-ONLY; The UTC timestamp when the operation began. - LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` - // Error - READ-ONLY; The errors that were encountered during execution of the operation. The details array contains the list of them. - Error *APIError `json:"error,omitempty"` -} - -// MarshalJSON is the custom marshaler for AvailablePatchSummary. -func (aps AvailablePatchSummary) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// BillingProfile specifies the billing related details of a Azure Spot VM or VMSS.

      Minimum -// api-version: 2019-03-01. -type BillingProfile struct { - // MaxPrice - Specifies the maximum price you are willing to pay for a Azure Spot VM/VMSS. This price is in US Dollars.

      This price will be compared with the current Azure Spot price for the VM size. Also, the prices are compared at the time of create/update of Azure Spot VM/VMSS and the operation will only succeed if the maxPrice is greater than the current Azure Spot price.

      The maxPrice will also be used for evicting a Azure Spot VM/VMSS if the current Azure Spot price goes beyond the maxPrice after creation of VM/VMSS.

      Possible values are:

      - Any decimal value greater than zero. Example: 0.01538

      -1 – indicates default price to be up-to on-demand.

      You can set the maxPrice to -1 to indicate that the Azure Spot VM/VMSS should not be evicted for price reasons. Also, the default max price is -1 if it is not provided by you.

      Minimum api-version: 2019-03-01. - MaxPrice *float64 `json:"maxPrice,omitempty"` -} - -// BootDiagnostics boot Diagnostics is a debugging feature which allows you to view Console Output and -// Screenshot to diagnose VM status.

      You can easily view the output of your console log.

      -// 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"` - // StorageURI - Uri of the storage account to use for placing the console output and screenshot.

      If storageUri is not specified while enabling boot diagnostics, managed storage will be used. - StorageURI *string `json:"storageUri,omitempty"` -} - -// BootDiagnosticsInstanceView the instance view of a virtual machine boot diagnostics. -type BootDiagnosticsInstanceView struct { - // ConsoleScreenshotBlobURI - READ-ONLY; The console screenshot blob URI.

      NOTE: This will **not** be set if boot diagnostics is currently enabled with managed storage. - ConsoleScreenshotBlobURI *string `json:"consoleScreenshotBlobUri,omitempty"` - // SerialConsoleLogBlobURI - READ-ONLY; The serial console log blob Uri.

      NOTE: This will **not** be set if boot diagnostics is currently enabled with managed storage. - SerialConsoleLogBlobURI *string `json:"serialConsoleLogBlobUri,omitempty"` - // Status - READ-ONLY; The boot diagnostics status information for the VM.

      NOTE: It will be set only if there are errors encountered in enabling boot diagnostics. - Status *InstanceViewStatus `json:"status,omitempty"` -} - -// MarshalJSON is the custom marshaler for BootDiagnosticsInstanceView. -func (bdiv BootDiagnosticsInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// CapacityReservation specifies information about the capacity reservation. -type CapacityReservation struct { - autorest.Response `json:"-"` - *CapacityReservationProperties `json:"properties,omitempty"` - // Sku - SKU of the resource for which capacity needs be reserved. The SKU name and capacity is required to be set. Currently VM Skus with the capability called 'CapacityReservationSupported' set to true are supported. Refer to List Microsoft.Compute SKUs in a region (https://docs.microsoft.com/rest/api/compute/resourceskus/list) for supported values. - Sku *Sku `json:"sku,omitempty"` - // Zones - Availability Zone to use for this capacity reservation. The zone has to be single value and also should be part for the list of zones specified during the capacity reservation group creation. The zone can be assigned only during creation. If not provided, the reservation supports only non-zonal deployments. If provided, enforces VM/VMSS using this capacity reservation to be in same zone. - Zones *[]string `json:"zones,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; 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 CapacityReservation. -func (cr CapacityReservation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cr.CapacityReservationProperties != nil { - objectMap["properties"] = cr.CapacityReservationProperties - } - if cr.Sku != nil { - objectMap["sku"] = cr.Sku - } - if cr.Zones != nil { - objectMap["zones"] = cr.Zones - } - if cr.Location != nil { - objectMap["location"] = cr.Location - } - if cr.Tags != nil { - objectMap["tags"] = cr.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for CapacityReservation struct. -func (cr *CapacityReservation) 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 capacityReservationProperties CapacityReservationProperties - err = json.Unmarshal(*v, &capacityReservationProperties) - if err != nil { - return err - } - cr.CapacityReservationProperties = &capacityReservationProperties - } - case "sku": - if v != nil { - var sku Sku - err = json.Unmarshal(*v, &sku) - if err != nil { - return err - } - cr.Sku = &sku - } - case "zones": - if v != nil { - var zones []string - err = json.Unmarshal(*v, &zones) - if err != nil { - return err - } - cr.Zones = &zones - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - cr.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - cr.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - cr.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - cr.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - cr.Tags = tags - } - } - } - - return nil -} - -// CapacityReservationGroup specifies information about the capacity reservation group that the capacity -// reservations should be assigned to.

      Currently, a capacity reservation can only be added to a -// capacity reservation group at creation time. An existing capacity reservation cannot be added or moved -// to another capacity reservation group. -type CapacityReservationGroup struct { - autorest.Response `json:"-"` - *CapacityReservationGroupProperties `json:"properties,omitempty"` - // Zones - Availability Zones to use for this capacity reservation group. The zones can be assigned only during creation. If not provided, the group supports only regional resources in the region. If provided, enforces each capacity reservation in the group to be in one of the zones. - Zones *[]string `json:"zones,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; 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 CapacityReservationGroup. -func (crg CapacityReservationGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if crg.CapacityReservationGroupProperties != nil { - objectMap["properties"] = crg.CapacityReservationGroupProperties - } - if crg.Zones != nil { - objectMap["zones"] = crg.Zones - } - if crg.Location != nil { - objectMap["location"] = crg.Location - } - if crg.Tags != nil { - objectMap["tags"] = crg.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for CapacityReservationGroup struct. -func (crg *CapacityReservationGroup) 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 capacityReservationGroupProperties CapacityReservationGroupProperties - err = json.Unmarshal(*v, &capacityReservationGroupProperties) - if err != nil { - return err - } - crg.CapacityReservationGroupProperties = &capacityReservationGroupProperties - } - case "zones": - if v != nil { - var zones []string - err = json.Unmarshal(*v, &zones) - if err != nil { - return err - } - crg.Zones = &zones - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - crg.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - crg.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - crg.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - crg.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - crg.Tags = tags - } - } - } - - return nil -} - -// CapacityReservationGroupInstanceView ... -type CapacityReservationGroupInstanceView struct { - // CapacityReservations - READ-ONLY; List of instance view of the capacity reservations under the capacity reservation group. - CapacityReservations *[]CapacityReservationInstanceViewWithName `json:"capacityReservations,omitempty"` -} - -// MarshalJSON is the custom marshaler for CapacityReservationGroupInstanceView. -func (crgiv CapacityReservationGroupInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// CapacityReservationGroupListResult the List capacity reservation group with resource group response. -type CapacityReservationGroupListResult struct { - autorest.Response `json:"-"` - // Value - The list of capacity reservation groups - Value *[]CapacityReservationGroup `json:"value,omitempty"` - // NextLink - The URI to fetch the next page of capacity reservation groups. Call ListNext() with this URI to fetch the next page of capacity reservation groups. - NextLink *string `json:"nextLink,omitempty"` -} - -// CapacityReservationGroupListResultIterator provides access to a complete listing of -// CapacityReservationGroup values. -type CapacityReservationGroupListResultIterator struct { - i int - page CapacityReservationGroupListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *CapacityReservationGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CapacityReservationGroupListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *CapacityReservationGroupListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter CapacityReservationGroupListResultIterator) 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 CapacityReservationGroupListResultIterator) Response() CapacityReservationGroupListResult { - 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 CapacityReservationGroupListResultIterator) Value() CapacityReservationGroup { - if !iter.page.NotDone() { - return CapacityReservationGroup{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the CapacityReservationGroupListResultIterator type. -func NewCapacityReservationGroupListResultIterator(page CapacityReservationGroupListResultPage) CapacityReservationGroupListResultIterator { - return CapacityReservationGroupListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (crglr CapacityReservationGroupListResult) IsEmpty() bool { - return crglr.Value == nil || len(*crglr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (crglr CapacityReservationGroupListResult) hasNextLink() bool { - return crglr.NextLink != nil && len(*crglr.NextLink) != 0 -} - -// capacityReservationGroupListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (crglr CapacityReservationGroupListResult) capacityReservationGroupListResultPreparer(ctx context.Context) (*http.Request, error) { - if !crglr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(crglr.NextLink))) -} - -// CapacityReservationGroupListResultPage contains a page of CapacityReservationGroup values. -type CapacityReservationGroupListResultPage struct { - fn func(context.Context, CapacityReservationGroupListResult) (CapacityReservationGroupListResult, error) - crglr CapacityReservationGroupListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *CapacityReservationGroupListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CapacityReservationGroupListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.crglr) - if err != nil { - return err - } - page.crglr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *CapacityReservationGroupListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page CapacityReservationGroupListResultPage) NotDone() bool { - return !page.crglr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page CapacityReservationGroupListResultPage) Response() CapacityReservationGroupListResult { - return page.crglr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page CapacityReservationGroupListResultPage) Values() []CapacityReservationGroup { - if page.crglr.IsEmpty() { - return nil - } - return *page.crglr.Value -} - -// Creates a new instance of the CapacityReservationGroupListResultPage type. -func NewCapacityReservationGroupListResultPage(cur CapacityReservationGroupListResult, getNextPage func(context.Context, CapacityReservationGroupListResult) (CapacityReservationGroupListResult, error)) CapacityReservationGroupListResultPage { - return CapacityReservationGroupListResultPage{ - fn: getNextPage, - crglr: cur, - } -} - -// CapacityReservationGroupProperties capacity reservation group Properties. -type CapacityReservationGroupProperties struct { - // CapacityReservations - READ-ONLY; A list of all capacity reservation resource ids that belong to capacity reservation group. - CapacityReservations *[]SubResourceReadOnly `json:"capacityReservations,omitempty"` - // VirtualMachinesAssociated - READ-ONLY; A list of references to all virtual machines associated to the capacity reservation group. - VirtualMachinesAssociated *[]SubResourceReadOnly `json:"virtualMachinesAssociated,omitempty"` - // InstanceView - READ-ONLY; The capacity reservation group instance view which has the list of instance views for all the capacity reservations that belong to the capacity reservation group. - InstanceView *CapacityReservationGroupInstanceView `json:"instanceView,omitempty"` -} - -// MarshalJSON is the custom marshaler for CapacityReservationGroupProperties. -func (crgp CapacityReservationGroupProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// CapacityReservationGroupUpdate specifies information about the capacity reservation group. Only tags can -// be updated. -type CapacityReservationGroupUpdate struct { - *CapacityReservationGroupProperties `json:"properties,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for CapacityReservationGroupUpdate. -func (crgu CapacityReservationGroupUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if crgu.CapacityReservationGroupProperties != nil { - objectMap["properties"] = crgu.CapacityReservationGroupProperties - } - if crgu.Tags != nil { - objectMap["tags"] = crgu.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for CapacityReservationGroupUpdate struct. -func (crgu *CapacityReservationGroupUpdate) 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 capacityReservationGroupProperties CapacityReservationGroupProperties - err = json.Unmarshal(*v, &capacityReservationGroupProperties) - if err != nil { - return err - } - crgu.CapacityReservationGroupProperties = &capacityReservationGroupProperties - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - crgu.Tags = tags - } - } - } - - return nil -} - -// CapacityReservationInstanceView the instance view of a capacity reservation that provides as snapshot of -// the runtime properties of the capacity reservation that is managed by the platform and can change -// outside of control plane operations. -type CapacityReservationInstanceView struct { - // UtilizationInfo - Unutilized capacity of the capacity reservation. - UtilizationInfo *CapacityReservationUtilization `json:"utilizationInfo,omitempty"` - // Statuses - The resource status information. - Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` -} - -// CapacityReservationInstanceViewWithName the instance view of a capacity reservation that includes the -// name of the capacity reservation. It is used for the response to the instance view of a capacity -// reservation group. -type CapacityReservationInstanceViewWithName struct { - // Name - READ-ONLY; The name of the capacity reservation. - Name *string `json:"name,omitempty"` - // UtilizationInfo - Unutilized capacity of the capacity reservation. - UtilizationInfo *CapacityReservationUtilization `json:"utilizationInfo,omitempty"` - // Statuses - The resource status information. - Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` -} - -// MarshalJSON is the custom marshaler for CapacityReservationInstanceViewWithName. -func (crivwn CapacityReservationInstanceViewWithName) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if crivwn.UtilizationInfo != nil { - objectMap["utilizationInfo"] = crivwn.UtilizationInfo - } - if crivwn.Statuses != nil { - objectMap["statuses"] = crivwn.Statuses - } - return json.Marshal(objectMap) -} - -// CapacityReservationListResult the list capacity reservation operation response. -type CapacityReservationListResult struct { - autorest.Response `json:"-"` - // Value - The list of capacity reservations - Value *[]CapacityReservation `json:"value,omitempty"` - // NextLink - The URI to fetch the next page of capacity reservations. Call ListNext() with this URI to fetch the next page of capacity reservations. - NextLink *string `json:"nextLink,omitempty"` -} - -// CapacityReservationListResultIterator provides access to a complete listing of CapacityReservation -// values. -type CapacityReservationListResultIterator struct { - i int - page CapacityReservationListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *CapacityReservationListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CapacityReservationListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *CapacityReservationListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter CapacityReservationListResultIterator) 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 CapacityReservationListResultIterator) Response() CapacityReservationListResult { - 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 CapacityReservationListResultIterator) Value() CapacityReservation { - if !iter.page.NotDone() { - return CapacityReservation{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the CapacityReservationListResultIterator type. -func NewCapacityReservationListResultIterator(page CapacityReservationListResultPage) CapacityReservationListResultIterator { - return CapacityReservationListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (crlr CapacityReservationListResult) IsEmpty() bool { - return crlr.Value == nil || len(*crlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (crlr CapacityReservationListResult) hasNextLink() bool { - return crlr.NextLink != nil && len(*crlr.NextLink) != 0 -} - -// capacityReservationListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (crlr CapacityReservationListResult) capacityReservationListResultPreparer(ctx context.Context) (*http.Request, error) { - if !crlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(crlr.NextLink))) -} - -// CapacityReservationListResultPage contains a page of CapacityReservation values. -type CapacityReservationListResultPage struct { - fn func(context.Context, CapacityReservationListResult) (CapacityReservationListResult, error) - crlr CapacityReservationListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *CapacityReservationListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CapacityReservationListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.crlr) - if err != nil { - return err - } - page.crlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *CapacityReservationListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page CapacityReservationListResultPage) NotDone() bool { - return !page.crlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page CapacityReservationListResultPage) Response() CapacityReservationListResult { - return page.crlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page CapacityReservationListResultPage) Values() []CapacityReservation { - if page.crlr.IsEmpty() { - return nil - } - return *page.crlr.Value -} - -// Creates a new instance of the CapacityReservationListResultPage type. -func NewCapacityReservationListResultPage(cur CapacityReservationListResult, getNextPage func(context.Context, CapacityReservationListResult) (CapacityReservationListResult, error)) CapacityReservationListResultPage { - return CapacityReservationListResultPage{ - fn: getNextPage, - crlr: cur, - } -} - -// CapacityReservationProfile the parameters of a capacity reservation Profile. -type CapacityReservationProfile struct { - // CapacityReservationGroup - Specifies the capacity reservation group resource id that should be used for allocating the virtual machine or scaleset vm instances provided enough capacity has been reserved. Please refer to https://aka.ms/CapacityReservation for more details. - CapacityReservationGroup *SubResource `json:"capacityReservationGroup,omitempty"` -} - -// CapacityReservationProperties properties of the Capacity reservation. -type CapacityReservationProperties struct { - // ReservationID - READ-ONLY; A unique id generated and assigned to the capacity reservation by the platform which does not change throughout the lifetime of the resource. - ReservationID *string `json:"reservationId,omitempty"` - // PlatformFaultDomainCount - READ-ONLY; Specifies the value of fault domain count that Capacity Reservation supports for requested VM size.
      NOTE: The fault domain count specified for a resource (like virtual machines scale set) must be less than or equal to this value if it deploys using capacity reservation.

      Minimum api-version: 2022-08-01. - PlatformFaultDomainCount *int32 `json:"platformFaultDomainCount,omitempty"` - // VirtualMachinesAssociated - READ-ONLY; A list of all virtual machine resource ids that are associated with the capacity reservation. - VirtualMachinesAssociated *[]SubResourceReadOnly `json:"virtualMachinesAssociated,omitempty"` - // ProvisioningTime - READ-ONLY; The date time when the capacity reservation was last updated. - ProvisioningTime *date.Time `json:"provisioningTime,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *string `json:"provisioningState,omitempty"` - // InstanceView - READ-ONLY; The Capacity reservation instance view. - InstanceView *CapacityReservationInstanceView `json:"instanceView,omitempty"` - // TimeCreated - READ-ONLY; Specifies the time at which the Capacity Reservation resource was created.

      Minimum api-version: 2021-11-01. - TimeCreated *date.Time `json:"timeCreated,omitempty"` -} - -// MarshalJSON is the custom marshaler for CapacityReservationProperties. -func (crp CapacityReservationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// CapacityReservationsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type CapacityReservationsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(CapacityReservationsClient) (CapacityReservation, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *CapacityReservationsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for CapacityReservationsCreateOrUpdateFuture.Result. -func (future *CapacityReservationsCreateOrUpdateFuture) result(client CapacityReservationsClient) (cr CapacityReservation, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CapacityReservationsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - cr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.CapacityReservationsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if cr.Response.Response, err = future.GetResult(sender); err == nil && cr.Response.Response.StatusCode != http.StatusNoContent { - cr, err = client.CreateOrUpdateResponder(cr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CapacityReservationsCreateOrUpdateFuture", "Result", cr.Response.Response, "Failure responding to request") - } - } - return -} - -// CapacityReservationsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type CapacityReservationsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(CapacityReservationsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *CapacityReservationsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for CapacityReservationsDeleteFuture.Result. -func (future *CapacityReservationsDeleteFuture) result(client CapacityReservationsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CapacityReservationsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.CapacityReservationsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// CapacityReservationsUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type CapacityReservationsUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(CapacityReservationsClient) (CapacityReservation, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *CapacityReservationsUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for CapacityReservationsUpdateFuture.Result. -func (future *CapacityReservationsUpdateFuture) result(client CapacityReservationsClient) (cr CapacityReservation, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CapacityReservationsUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - cr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.CapacityReservationsUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if cr.Response.Response, err = future.GetResult(sender); err == nil && cr.Response.Response.StatusCode != http.StatusNoContent { - cr, err = client.UpdateResponder(cr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CapacityReservationsUpdateFuture", "Result", cr.Response.Response, "Failure responding to request") - } - } - return -} - -// CapacityReservationUpdate specifies information about the capacity reservation. Only tags and -// sku.capacity can be updated. -type CapacityReservationUpdate struct { - *CapacityReservationProperties `json:"properties,omitempty"` - // Sku - SKU of the resource for which capacity needs be reserved. The SKU name and capacity is required to be set. Currently VM Skus with the capability called 'CapacityReservationSupported' set to true are supported. Refer to List Microsoft.Compute SKUs in a region (https://docs.microsoft.com/rest/api/compute/resourceskus/list) for supported values. - Sku *Sku `json:"sku,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for CapacityReservationUpdate. -func (cru CapacityReservationUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cru.CapacityReservationProperties != nil { - objectMap["properties"] = cru.CapacityReservationProperties - } - if cru.Sku != nil { - objectMap["sku"] = cru.Sku - } - if cru.Tags != nil { - objectMap["tags"] = cru.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for CapacityReservationUpdate struct. -func (cru *CapacityReservationUpdate) 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 capacityReservationProperties CapacityReservationProperties - err = json.Unmarshal(*v, &capacityReservationProperties) - if err != nil { - return err - } - cru.CapacityReservationProperties = &capacityReservationProperties - } - case "sku": - if v != nil { - var sku Sku - err = json.Unmarshal(*v, &sku) - if err != nil { - return err - } - cru.Sku = &sku - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - cru.Tags = tags - } - } - } - - return nil -} - -// CapacityReservationUtilization represents the capacity reservation utilization in terms of resources -// allocated. -type CapacityReservationUtilization struct { - // CurrentCapacity - READ-ONLY; The value provides the current capacity of the VM size which was reserved successfully and for which the customer is getting billed.

      Minimum api-version: 2022-08-01. - CurrentCapacity *int32 `json:"currentCapacity,omitempty"` - // VirtualMachinesAllocated - READ-ONLY; A list of all virtual machines resource ids allocated against the capacity reservation. - VirtualMachinesAllocated *[]SubResourceReadOnly `json:"virtualMachinesAllocated,omitempty"` -} - -// MarshalJSON is the custom marshaler for CapacityReservationUtilization. -func (cru CapacityReservationUtilization) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// CloudError an error response from the Compute service. -type CloudError struct { - Error *APIError `json:"error,omitempty"` -} - -// CloudService describes the cloud service. -type CloudService struct { - autorest.Response `json:"-"` - // ID - READ-ONLY; Resource Id. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - Properties *CloudServiceProperties `json:"properties,omitempty"` - SystemData *SystemData `json:"systemData,omitempty"` -} - -// MarshalJSON is the custom marshaler for CloudService. -func (cs CloudService) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cs.Location != nil { - objectMap["location"] = cs.Location - } - if cs.Tags != nil { - objectMap["tags"] = cs.Tags - } - if cs.Properties != nil { - objectMap["properties"] = cs.Properties - } - if cs.SystemData != nil { - objectMap["systemData"] = cs.SystemData - } - return json.Marshal(objectMap) -} - -// CloudServiceExtensionProfile describes a cloud service extension profile. -type CloudServiceExtensionProfile struct { - // Extensions - List of extensions for the cloud service. - Extensions *[]Extension `json:"extensions,omitempty"` -} - -// CloudServiceExtensionProperties extension Properties. -type CloudServiceExtensionProperties struct { - // Publisher - The name of the extension handler publisher. - Publisher *string `json:"publisher,omitempty"` - // Type - Specifies the type of the extension. - Type *string `json:"type,omitempty"` - // TypeHandlerVersion - Specifies the version of the extension. Specifies the version of the extension. If this element is not specified or an asterisk (*) is used as the value, the latest version of the extension is used. If the value is specified with a major version number and an asterisk as the minor version number (X.), the latest minor version of the specified major version is selected. If a major version number and a minor version number are specified (X.Y), the specific extension version is selected. If a version is specified, an auto-upgrade is performed on the role instance. - TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` - // AutoUpgradeMinorVersion - Explicitly specify whether platform can automatically upgrade typeHandlerVersion to higher minor versions when they become available. - AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` - // Settings - Public settings for the extension. For JSON extensions, this is the JSON settings for the extension. For XML Extension (like RDP), this is the XML setting for the extension. - Settings interface{} `json:"settings,omitempty"` - // ProtectedSettings - Protected settings for the extension which are encrypted before sent to the role instance. - ProtectedSettings interface{} `json:"protectedSettings,omitempty"` - ProtectedSettingsFromKeyVault *CloudServiceVaultAndSecretReference `json:"protectedSettingsFromKeyVault,omitempty"` - // ForceUpdateTag - Tag to force apply the provided public and protected settings. - // Changing the tag value allows for re-running the extension without changing any of the public or protected settings. - // If forceUpdateTag is not changed, updates to public or protected settings would still be applied by the handler. - // If neither forceUpdateTag nor any of public or protected settings change, extension would flow to the role instance with the same sequence-number, and - // it is up to handler implementation whether to re-run it or not - ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *string `json:"provisioningState,omitempty"` - // RolesAppliedTo - Optional list of roles to apply this extension. If property is not specified or '*' is specified, extension is applied to all roles in the cloud service. - RolesAppliedTo *[]string `json:"rolesAppliedTo,omitempty"` -} - -// MarshalJSON is the custom marshaler for CloudServiceExtensionProperties. -func (csep CloudServiceExtensionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if csep.Publisher != nil { - objectMap["publisher"] = csep.Publisher - } - if csep.Type != nil { - objectMap["type"] = csep.Type - } - if csep.TypeHandlerVersion != nil { - objectMap["typeHandlerVersion"] = csep.TypeHandlerVersion - } - if csep.AutoUpgradeMinorVersion != nil { - objectMap["autoUpgradeMinorVersion"] = csep.AutoUpgradeMinorVersion - } - if csep.Settings != nil { - objectMap["settings"] = csep.Settings - } - if csep.ProtectedSettings != nil { - objectMap["protectedSettings"] = csep.ProtectedSettings - } - if csep.ProtectedSettingsFromKeyVault != nil { - objectMap["protectedSettingsFromKeyVault"] = csep.ProtectedSettingsFromKeyVault - } - if csep.ForceUpdateTag != nil { - objectMap["forceUpdateTag"] = csep.ForceUpdateTag - } - if csep.RolesAppliedTo != nil { - objectMap["rolesAppliedTo"] = csep.RolesAppliedTo - } - return json.Marshal(objectMap) -} - -// CloudServiceInstanceView instanceView of CloudService as a whole -type CloudServiceInstanceView struct { - autorest.Response `json:"-"` - RoleInstance *InstanceViewStatusesSummary `json:"roleInstance,omitempty"` - // SdkVersion - READ-ONLY; The version of the SDK that was used to generate the package for the cloud service. - SdkVersion *string `json:"sdkVersion,omitempty"` - // PrivateIds - READ-ONLY; Specifies a list of unique identifiers generated internally for the cloud service.

      NOTE: If you are using Azure Diagnostics extension, this property can be used as 'DeploymentId' for querying details. - PrivateIds *[]string `json:"privateIds,omitempty"` - // Statuses - READ-ONLY - Statuses *[]ResourceInstanceViewStatus `json:"statuses,omitempty"` -} - -// MarshalJSON is the custom marshaler for CloudServiceInstanceView. -func (csiv CloudServiceInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if csiv.RoleInstance != nil { - objectMap["roleInstance"] = csiv.RoleInstance - } - return json.Marshal(objectMap) -} - -// CloudServiceListResult the list operation result. -type CloudServiceListResult struct { - autorest.Response `json:"-"` - // Value - The list of resources. - Value *[]CloudService `json:"value,omitempty"` - // NextLink - The URI to fetch the next page of resources. Use this to get the next page of resources. Do this till nextLink is null to fetch all the resources. - NextLink *string `json:"nextLink,omitempty"` -} - -// CloudServiceListResultIterator provides access to a complete listing of CloudService values. -type CloudServiceListResultIterator struct { - i int - page CloudServiceListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *CloudServiceListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *CloudServiceListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter CloudServiceListResultIterator) 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 CloudServiceListResultIterator) Response() CloudServiceListResult { - 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 CloudServiceListResultIterator) Value() CloudService { - if !iter.page.NotDone() { - return CloudService{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the CloudServiceListResultIterator type. -func NewCloudServiceListResultIterator(page CloudServiceListResultPage) CloudServiceListResultIterator { - return CloudServiceListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (cslr CloudServiceListResult) IsEmpty() bool { - return cslr.Value == nil || len(*cslr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (cslr CloudServiceListResult) hasNextLink() bool { - return cslr.NextLink != nil && len(*cslr.NextLink) != 0 -} - -// cloudServiceListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (cslr CloudServiceListResult) cloudServiceListResultPreparer(ctx context.Context) (*http.Request, error) { - if !cslr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(cslr.NextLink))) -} - -// CloudServiceListResultPage contains a page of CloudService values. -type CloudServiceListResultPage struct { - fn func(context.Context, CloudServiceListResult) (CloudServiceListResult, error) - cslr CloudServiceListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *CloudServiceListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.cslr) - if err != nil { - return err - } - page.cslr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *CloudServiceListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page CloudServiceListResultPage) NotDone() bool { - return !page.cslr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page CloudServiceListResultPage) Response() CloudServiceListResult { - return page.cslr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page CloudServiceListResultPage) Values() []CloudService { - if page.cslr.IsEmpty() { - return nil - } - return *page.cslr.Value -} - -// Creates a new instance of the CloudServiceListResultPage type. -func NewCloudServiceListResultPage(cur CloudServiceListResult, getNextPage func(context.Context, CloudServiceListResult) (CloudServiceListResult, error)) CloudServiceListResultPage { - return CloudServiceListResultPage{ - fn: getNextPage, - cslr: cur, - } -} - -// CloudServiceNetworkProfile network Profile for the cloud service. -type CloudServiceNetworkProfile struct { - // LoadBalancerConfigurations - List of Load balancer configurations. Cloud service can have up to two load balancer configurations, corresponding to a Public Load Balancer and an Internal Load Balancer. - LoadBalancerConfigurations *[]LoadBalancerConfiguration `json:"loadBalancerConfigurations,omitempty"` - // SlotType - Possible values include: 'Production', 'Staging' - SlotType CloudServiceSlotType `json:"slotType,omitempty"` - // SwappableCloudService - The id reference of the cloud service containing the target IP with which the subject cloud service can perform a swap. This property cannot be updated once it is set. The swappable cloud service referred by this id must be present otherwise an error will be thrown. - SwappableCloudService *SubResource `json:"swappableCloudService,omitempty"` -} - -// CloudServiceOsProfile describes the OS profile for the cloud service. -type CloudServiceOsProfile struct { - // Secrets - Specifies set of certificates that should be installed onto the role instances. - Secrets *[]CloudServiceVaultSecretGroup `json:"secrets,omitempty"` -} - -// CloudServiceProperties cloud service properties -type CloudServiceProperties struct { - // PackageURL - Specifies a URL that refers to the location of the service package in the Blob service. The service package URL can be Shared Access Signature (SAS) URI from any storage account. - // This is a write-only property and is not returned in GET calls. - PackageURL *string `json:"packageUrl,omitempty"` - // Configuration - Specifies the XML service configuration (.cscfg) for the cloud service. - Configuration *string `json:"configuration,omitempty"` - // ConfigurationURL - Specifies a URL that refers to the location of the service configuration in the Blob service. The service package URL can be Shared Access Signature (SAS) URI from any storage account. - // This is a write-only property and is not returned in GET calls. - ConfigurationURL *string `json:"configurationUrl,omitempty"` - // StartCloudService - (Optional) Indicates whether to start the cloud service immediately after it is created. The default value is `true`. - // If false, the service model is still deployed, but the code is not run immediately. Instead, the service is PoweredOff until you call Start, at which time the service will be started. A deployed service still incurs charges, even if it is poweredoff. - StartCloudService *bool `json:"startCloudService,omitempty"` - // AllowModelOverride - (Optional) Indicates whether the role sku properties (roleProfile.roles.sku) specified in the model/template should override the role instance count and vm size specified in the .cscfg and .csdef respectively. - // The default value is `false`. - AllowModelOverride *bool `json:"allowModelOverride,omitempty"` - // UpgradeMode - Possible values include: 'Auto', 'Manual', 'Simultaneous' - UpgradeMode CloudServiceUpgradeMode `json:"upgradeMode,omitempty"` - RoleProfile *CloudServiceRoleProfile `json:"roleProfile,omitempty"` - OsProfile *CloudServiceOsProfile `json:"osProfile,omitempty"` - NetworkProfile *CloudServiceNetworkProfile `json:"networkProfile,omitempty"` - ExtensionProfile *CloudServiceExtensionProfile `json:"extensionProfile,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *string `json:"provisioningState,omitempty"` - // UniqueID - READ-ONLY; The unique identifier for the cloud service. - UniqueID *string `json:"uniqueId,omitempty"` -} - -// MarshalJSON is the custom marshaler for CloudServiceProperties. -func (csp CloudServiceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if csp.PackageURL != nil { - objectMap["packageUrl"] = csp.PackageURL - } - if csp.Configuration != nil { - objectMap["configuration"] = csp.Configuration - } - if csp.ConfigurationURL != nil { - objectMap["configurationUrl"] = csp.ConfigurationURL - } - if csp.StartCloudService != nil { - objectMap["startCloudService"] = csp.StartCloudService - } - if csp.AllowModelOverride != nil { - objectMap["allowModelOverride"] = csp.AllowModelOverride - } - if csp.UpgradeMode != "" { - objectMap["upgradeMode"] = csp.UpgradeMode - } - if csp.RoleProfile != nil { - objectMap["roleProfile"] = csp.RoleProfile - } - if csp.OsProfile != nil { - objectMap["osProfile"] = csp.OsProfile - } - if csp.NetworkProfile != nil { - objectMap["networkProfile"] = csp.NetworkProfile - } - if csp.ExtensionProfile != nil { - objectMap["extensionProfile"] = csp.ExtensionProfile - } - return json.Marshal(objectMap) -} - -// CloudServiceRole describes a role of the cloud service. -type CloudServiceRole struct { - autorest.Response `json:"-"` - // ID - READ-ONLY; Resource id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Location - READ-ONLY; Resource location - Location *string `json:"location,omitempty"` - Sku *CloudServiceRoleSku `json:"sku,omitempty"` - Properties *CloudServiceRoleProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for CloudServiceRole. -func (csr CloudServiceRole) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if csr.Sku != nil { - objectMap["sku"] = csr.Sku - } - if csr.Properties != nil { - objectMap["properties"] = csr.Properties - } - return json.Marshal(objectMap) -} - -// CloudServiceRoleInstancesDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type CloudServiceRoleInstancesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(CloudServiceRoleInstancesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *CloudServiceRoleInstancesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for CloudServiceRoleInstancesDeleteFuture.Result. -func (future *CloudServiceRoleInstancesDeleteFuture) result(client CloudServiceRoleInstancesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.CloudServiceRoleInstancesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// CloudServiceRoleInstancesRebuildFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type CloudServiceRoleInstancesRebuildFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(CloudServiceRoleInstancesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *CloudServiceRoleInstancesRebuildFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for CloudServiceRoleInstancesRebuildFuture.Result. -func (future *CloudServiceRoleInstancesRebuildFuture) result(client CloudServiceRoleInstancesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesRebuildFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.CloudServiceRoleInstancesRebuildFuture") - return - } - ar.Response = future.Response() - return -} - -// CloudServiceRoleInstancesReimageFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type CloudServiceRoleInstancesReimageFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(CloudServiceRoleInstancesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *CloudServiceRoleInstancesReimageFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for CloudServiceRoleInstancesReimageFuture.Result. -func (future *CloudServiceRoleInstancesReimageFuture) result(client CloudServiceRoleInstancesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesReimageFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.CloudServiceRoleInstancesReimageFuture") - return - } - ar.Response = future.Response() - return -} - -// CloudServiceRoleInstancesRestartFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type CloudServiceRoleInstancesRestartFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(CloudServiceRoleInstancesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *CloudServiceRoleInstancesRestartFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for CloudServiceRoleInstancesRestartFuture.Result. -func (future *CloudServiceRoleInstancesRestartFuture) result(client CloudServiceRoleInstancesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesRestartFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.CloudServiceRoleInstancesRestartFuture") - return - } - ar.Response = future.Response() - return -} - -// CloudServiceRoleListResult the list operation result. -type CloudServiceRoleListResult struct { - autorest.Response `json:"-"` - // Value - The list of resources. - Value *[]CloudServiceRole `json:"value,omitempty"` - // NextLink - The URI to fetch the next page of resources. Use this to get the next page of resources. Do this till nextLink is null to fetch all the resources. - NextLink *string `json:"nextLink,omitempty"` -} - -// CloudServiceRoleListResultIterator provides access to a complete listing of CloudServiceRole values. -type CloudServiceRoleListResultIterator struct { - i int - page CloudServiceRoleListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *CloudServiceRoleListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceRoleListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *CloudServiceRoleListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter CloudServiceRoleListResultIterator) 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 CloudServiceRoleListResultIterator) Response() CloudServiceRoleListResult { - 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 CloudServiceRoleListResultIterator) Value() CloudServiceRole { - if !iter.page.NotDone() { - return CloudServiceRole{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the CloudServiceRoleListResultIterator type. -func NewCloudServiceRoleListResultIterator(page CloudServiceRoleListResultPage) CloudServiceRoleListResultIterator { - return CloudServiceRoleListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (csrlr CloudServiceRoleListResult) IsEmpty() bool { - return csrlr.Value == nil || len(*csrlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (csrlr CloudServiceRoleListResult) hasNextLink() bool { - return csrlr.NextLink != nil && len(*csrlr.NextLink) != 0 -} - -// cloudServiceRoleListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (csrlr CloudServiceRoleListResult) cloudServiceRoleListResultPreparer(ctx context.Context) (*http.Request, error) { - if !csrlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(csrlr.NextLink))) -} - -// CloudServiceRoleListResultPage contains a page of CloudServiceRole values. -type CloudServiceRoleListResultPage struct { - fn func(context.Context, CloudServiceRoleListResult) (CloudServiceRoleListResult, error) - csrlr CloudServiceRoleListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *CloudServiceRoleListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceRoleListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.csrlr) - if err != nil { - return err - } - page.csrlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *CloudServiceRoleListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page CloudServiceRoleListResultPage) NotDone() bool { - return !page.csrlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page CloudServiceRoleListResultPage) Response() CloudServiceRoleListResult { - return page.csrlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page CloudServiceRoleListResultPage) Values() []CloudServiceRole { - if page.csrlr.IsEmpty() { - return nil - } - return *page.csrlr.Value -} - -// Creates a new instance of the CloudServiceRoleListResultPage type. -func NewCloudServiceRoleListResultPage(cur CloudServiceRoleListResult, getNextPage func(context.Context, CloudServiceRoleListResult) (CloudServiceRoleListResult, error)) CloudServiceRoleListResultPage { - return CloudServiceRoleListResultPage{ - fn: getNextPage, - csrlr: cur, - } -} - -// CloudServiceRoleProfile describes the role profile for the cloud service. -type CloudServiceRoleProfile struct { - // Roles - List of roles for the cloud service. - Roles *[]CloudServiceRoleProfileProperties `json:"roles,omitempty"` -} - -// CloudServiceRoleProfileProperties describes the role properties. -type CloudServiceRoleProfileProperties struct { - // Name - Resource name. - Name *string `json:"name,omitempty"` - Sku *CloudServiceRoleSku `json:"sku,omitempty"` -} - -// CloudServiceRoleProperties the cloud service role properties. -type CloudServiceRoleProperties struct { - // UniqueID - READ-ONLY; Specifies the ID which uniquely identifies a cloud service role. - UniqueID *string `json:"uniqueId,omitempty"` -} - -// MarshalJSON is the custom marshaler for CloudServiceRoleProperties. -func (csrp CloudServiceRoleProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// CloudServiceRoleSku describes the cloud service role sku. -type CloudServiceRoleSku struct { - // Name - The sku name. NOTE: If the new SKU is not supported on the hardware the cloud service is currently on, you need to delete and recreate the cloud service or move back to the old sku. - Name *string `json:"name,omitempty"` - // Tier - Specifies the tier of the cloud service. Possible Values are

      **Standard**

      **Basic** - Tier *string `json:"tier,omitempty"` - // Capacity - Specifies the number of role instances in the cloud service. - Capacity *int64 `json:"capacity,omitempty"` -} - -// CloudServicesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type CloudServicesCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(CloudServicesClient) (CloudService, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *CloudServicesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for CloudServicesCreateOrUpdateFuture.Result. -func (future *CloudServicesCreateOrUpdateFuture) result(client CloudServicesClient) (cs CloudService, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - cs.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.CloudServicesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if cs.Response.Response, err = future.GetResult(sender); err == nil && cs.Response.Response.StatusCode != http.StatusNoContent { - cs, err = client.CreateOrUpdateResponder(cs.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesCreateOrUpdateFuture", "Result", cs.Response.Response, "Failure responding to request") - } - } - return -} - -// CloudServicesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type CloudServicesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(CloudServicesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *CloudServicesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for CloudServicesDeleteFuture.Result. -func (future *CloudServicesDeleteFuture) result(client CloudServicesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.CloudServicesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// CloudServicesDeleteInstancesFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type CloudServicesDeleteInstancesFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(CloudServicesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *CloudServicesDeleteInstancesFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for CloudServicesDeleteInstancesFuture.Result. -func (future *CloudServicesDeleteInstancesFuture) result(client CloudServicesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesDeleteInstancesFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.CloudServicesDeleteInstancesFuture") - return - } - ar.Response = future.Response() - return -} - -// CloudServicesPowerOffFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type CloudServicesPowerOffFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(CloudServicesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *CloudServicesPowerOffFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for CloudServicesPowerOffFuture.Result. -func (future *CloudServicesPowerOffFuture) result(client CloudServicesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesPowerOffFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.CloudServicesPowerOffFuture") - return - } - ar.Response = future.Response() - return -} - -// CloudServicesRebuildFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type CloudServicesRebuildFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(CloudServicesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *CloudServicesRebuildFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for CloudServicesRebuildFuture.Result. -func (future *CloudServicesRebuildFuture) result(client CloudServicesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesRebuildFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.CloudServicesRebuildFuture") - return - } - ar.Response = future.Response() - return -} - -// CloudServicesReimageFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type CloudServicesReimageFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(CloudServicesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *CloudServicesReimageFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for CloudServicesReimageFuture.Result. -func (future *CloudServicesReimageFuture) result(client CloudServicesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesReimageFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.CloudServicesReimageFuture") - return - } - ar.Response = future.Response() - return -} - -// CloudServicesRestartFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type CloudServicesRestartFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(CloudServicesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *CloudServicesRestartFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for CloudServicesRestartFuture.Result. -func (future *CloudServicesRestartFuture) result(client CloudServicesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesRestartFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.CloudServicesRestartFuture") - return - } - ar.Response = future.Response() - return -} - -// CloudServicesStartFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type CloudServicesStartFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(CloudServicesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *CloudServicesStartFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for CloudServicesStartFuture.Result. -func (future *CloudServicesStartFuture) result(client CloudServicesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesStartFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.CloudServicesStartFuture") - return - } - ar.Response = future.Response() - return -} - -// CloudServicesUpdateDomainWalkUpdateDomainFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type CloudServicesUpdateDomainWalkUpdateDomainFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(CloudServicesUpdateDomainClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *CloudServicesUpdateDomainWalkUpdateDomainFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for CloudServicesUpdateDomainWalkUpdateDomainFuture.Result. -func (future *CloudServicesUpdateDomainWalkUpdateDomainFuture) result(client CloudServicesUpdateDomainClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesUpdateDomainWalkUpdateDomainFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.CloudServicesUpdateDomainWalkUpdateDomainFuture") - return - } - ar.Response = future.Response() - return -} - -// CloudServicesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type CloudServicesUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(CloudServicesClient) (CloudService, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *CloudServicesUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for CloudServicesUpdateFuture.Result. -func (future *CloudServicesUpdateFuture) result(client CloudServicesClient) (cs CloudService, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - cs.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.CloudServicesUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if cs.Response.Response, err = future.GetResult(sender); err == nil && cs.Response.Response.StatusCode != http.StatusNoContent { - cs, err = client.UpdateResponder(cs.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesUpdateFuture", "Result", cs.Response.Response, "Failure responding to request") - } - } - return -} - -// CloudServiceUpdate ... -type CloudServiceUpdate struct { - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for CloudServiceUpdate. -func (csu CloudServiceUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if csu.Tags != nil { - objectMap["tags"] = csu.Tags - } - return json.Marshal(objectMap) -} - -// CloudServiceVaultAndSecretReference protected settings for the extension, referenced using KeyVault -// which are encrypted before sent to the role instance. -type CloudServiceVaultAndSecretReference struct { - // SourceVault - The ARM Resource ID of the Key Vault - SourceVault *SubResource `json:"sourceVault,omitempty"` - // SecretURL - Secret URL which contains the protected settings of the extension - SecretURL *string `json:"secretUrl,omitempty"` -} - -// CloudServiceVaultCertificate describes a single certificate reference in a Key Vault, and where the -// certificate should reside on the role instance. -type CloudServiceVaultCertificate struct { - // CertificateURL - This is the URL of a certificate that has been uploaded to Key Vault as a secret. - CertificateURL *string `json:"certificateUrl,omitempty"` -} - -// CloudServiceVaultSecretGroup describes a set of certificates which are all in the same Key Vault. -type CloudServiceVaultSecretGroup struct { - // SourceVault - The relative URL of the Key Vault containing all of the certificates in VaultCertificates. - SourceVault *SubResource `json:"sourceVault,omitempty"` - // VaultCertificates - The list of key vault references in SourceVault which contain certificates. - VaultCertificates *[]CloudServiceVaultCertificate `json:"vaultCertificates,omitempty"` -} - -// CommunityGallery specifies information about the Community Gallery that you want to create or update. -type CommunityGallery struct { - autorest.Response `json:"-"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Location - READ-ONLY; Resource location - Location *string `json:"location,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - *CommunityGalleryIdentifier `json:"identifier,omitempty"` -} - -// MarshalJSON is the custom marshaler for CommunityGallery. -func (cg CommunityGallery) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cg.CommunityGalleryIdentifier != nil { - objectMap["identifier"] = cg.CommunityGalleryIdentifier - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for CommunityGallery struct. -func (cg *CommunityGallery) 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 - } - cg.Name = &name - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - cg.Location = &location - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - cg.Type = &typeVar - } - case "identifier": - if v != nil { - var communityGalleryIdentifier CommunityGalleryIdentifier - err = json.Unmarshal(*v, &communityGalleryIdentifier) - if err != nil { - return err - } - cg.CommunityGalleryIdentifier = &communityGalleryIdentifier - } - } - } - - return nil -} - -// CommunityGalleryIdentifier the identifier information of community gallery. -type CommunityGalleryIdentifier struct { - // UniqueID - The unique id of this community gallery. - UniqueID *string `json:"uniqueId,omitempty"` -} - -// CommunityGalleryImage specifies information about the gallery image definition that you want to create -// or update. -type CommunityGalleryImage struct { - autorest.Response `json:"-"` - *CommunityGalleryImageProperties `json:"properties,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Location - READ-ONLY; Resource location - Location *string `json:"location,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - *CommunityGalleryIdentifier `json:"identifier,omitempty"` -} - -// MarshalJSON is the custom marshaler for CommunityGalleryImage. -func (cgiVar CommunityGalleryImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cgiVar.CommunityGalleryImageProperties != nil { - objectMap["properties"] = cgiVar.CommunityGalleryImageProperties - } - if cgiVar.CommunityGalleryIdentifier != nil { - objectMap["identifier"] = cgiVar.CommunityGalleryIdentifier - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for CommunityGalleryImage struct. -func (cgiVar *CommunityGalleryImage) 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 communityGalleryImageProperties CommunityGalleryImageProperties - err = json.Unmarshal(*v, &communityGalleryImageProperties) - if err != nil { - return err - } - cgiVar.CommunityGalleryImageProperties = &communityGalleryImageProperties - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - cgiVar.Name = &name - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - cgiVar.Location = &location - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - cgiVar.Type = &typeVar - } - case "identifier": - if v != nil { - var communityGalleryIdentifier CommunityGalleryIdentifier - err = json.Unmarshal(*v, &communityGalleryIdentifier) - if err != nil { - return err - } - cgiVar.CommunityGalleryIdentifier = &communityGalleryIdentifier - } - } - } - - return nil -} - -// CommunityGalleryImageList the List Community Gallery Images operation response. -type CommunityGalleryImageList struct { - autorest.Response `json:"-"` - // Value - A list of community gallery images. - Value *[]CommunityGalleryImage `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of community gallery images. Call ListNext() with this to fetch the next page of community gallery images. - NextLink *string `json:"nextLink,omitempty"` -} - -// CommunityGalleryImageListIterator provides access to a complete listing of CommunityGalleryImage values. -type CommunityGalleryImageListIterator struct { - i int - page CommunityGalleryImageListPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *CommunityGalleryImageListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CommunityGalleryImageListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *CommunityGalleryImageListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter CommunityGalleryImageListIterator) 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 CommunityGalleryImageListIterator) Response() CommunityGalleryImageList { - 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 CommunityGalleryImageListIterator) Value() CommunityGalleryImage { - if !iter.page.NotDone() { - return CommunityGalleryImage{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the CommunityGalleryImageListIterator type. -func NewCommunityGalleryImageListIterator(page CommunityGalleryImageListPage) CommunityGalleryImageListIterator { - return CommunityGalleryImageListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (cgil CommunityGalleryImageList) IsEmpty() bool { - return cgil.Value == nil || len(*cgil.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (cgil CommunityGalleryImageList) hasNextLink() bool { - return cgil.NextLink != nil && len(*cgil.NextLink) != 0 -} - -// communityGalleryImageListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (cgil CommunityGalleryImageList) communityGalleryImageListPreparer(ctx context.Context) (*http.Request, error) { - if !cgil.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(cgil.NextLink))) -} - -// CommunityGalleryImageListPage contains a page of CommunityGalleryImage values. -type CommunityGalleryImageListPage struct { - fn func(context.Context, CommunityGalleryImageList) (CommunityGalleryImageList, error) - cgil CommunityGalleryImageList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *CommunityGalleryImageListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CommunityGalleryImageListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.cgil) - if err != nil { - return err - } - page.cgil = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *CommunityGalleryImageListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page CommunityGalleryImageListPage) NotDone() bool { - return !page.cgil.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page CommunityGalleryImageListPage) Response() CommunityGalleryImageList { - return page.cgil -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page CommunityGalleryImageListPage) Values() []CommunityGalleryImage { - if page.cgil.IsEmpty() { - return nil - } - return *page.cgil.Value -} - -// Creates a new instance of the CommunityGalleryImageListPage type. -func NewCommunityGalleryImageListPage(cur CommunityGalleryImageList, getNextPage func(context.Context, CommunityGalleryImageList) (CommunityGalleryImageList, error)) CommunityGalleryImageListPage { - return CommunityGalleryImageListPage{ - fn: getNextPage, - cgil: cur, - } -} - -// CommunityGalleryImageProperties describes the properties of a gallery image definition. -type CommunityGalleryImageProperties struct { - // OsType - This property allows you to specify the type of the OS that is included in the disk when creating a VM from a managed image.

      Possible values are:

      **Windows**

      **Linux**. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' - OsType OperatingSystemTypes `json:"osType,omitempty"` - // OsState - This property allows the user to specify whether the virtual machines created under this image are 'Generalized' or 'Specialized'. Possible values include: 'Generalized', 'Specialized' - OsState OperatingSystemStateTypes `json:"osState,omitempty"` - // EndOfLifeDate - The end of life date of the gallery image definition. This property can be used for decommissioning purposes. This property is updatable. - EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` - Identifier *GalleryImageIdentifier `json:"identifier,omitempty"` - Recommended *RecommendedMachineConfiguration `json:"recommended,omitempty"` - Disallowed *Disallowed `json:"disallowed,omitempty"` - // HyperVGeneration - The hypervisor generation of the Virtual Machine. Applicable to OS disks only. Possible values include: 'V1', 'V2' - HyperVGeneration HyperVGeneration `json:"hyperVGeneration,omitempty"` - // Features - A list of gallery image features. - Features *[]GalleryImageFeature `json:"features,omitempty"` - PurchasePlan *ImagePurchasePlan `json:"purchasePlan,omitempty"` - // Architecture - Possible values include: 'X64', 'Arm64' - Architecture Architecture `json:"architecture,omitempty"` - // PrivacyStatementURI - Privacy statement uri for the current community gallery image. - PrivacyStatementURI *string `json:"privacyStatementUri,omitempty"` - // Eula - End-user license agreement for the current community gallery image. - Eula *string `json:"eula,omitempty"` -} - -// CommunityGalleryImageVersion specifies information about the gallery image version that you want to -// create or update. -type CommunityGalleryImageVersion struct { - autorest.Response `json:"-"` - *CommunityGalleryImageVersionProperties `json:"properties,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Location - READ-ONLY; Resource location - Location *string `json:"location,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - *CommunityGalleryIdentifier `json:"identifier,omitempty"` -} - -// MarshalJSON is the custom marshaler for CommunityGalleryImageVersion. -func (cgiv CommunityGalleryImageVersion) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cgiv.CommunityGalleryImageVersionProperties != nil { - objectMap["properties"] = cgiv.CommunityGalleryImageVersionProperties - } - if cgiv.CommunityGalleryIdentifier != nil { - objectMap["identifier"] = cgiv.CommunityGalleryIdentifier - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for CommunityGalleryImageVersion struct. -func (cgiv *CommunityGalleryImageVersion) 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 communityGalleryImageVersionProperties CommunityGalleryImageVersionProperties - err = json.Unmarshal(*v, &communityGalleryImageVersionProperties) - if err != nil { - return err - } - cgiv.CommunityGalleryImageVersionProperties = &communityGalleryImageVersionProperties - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - cgiv.Name = &name - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - cgiv.Location = &location - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - cgiv.Type = &typeVar - } - case "identifier": - if v != nil { - var communityGalleryIdentifier CommunityGalleryIdentifier - err = json.Unmarshal(*v, &communityGalleryIdentifier) - if err != nil { - return err - } - cgiv.CommunityGalleryIdentifier = &communityGalleryIdentifier - } - } - } - - return nil -} - -// CommunityGalleryImageVersionList the List Community Gallery Image versions operation response. -type CommunityGalleryImageVersionList struct { - autorest.Response `json:"-"` - // Value - A list of community gallery image versions. - Value *[]CommunityGalleryImageVersion `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of community gallery image versions. Call ListNext() with this to fetch the next page of community gallery image versions. - NextLink *string `json:"nextLink,omitempty"` -} - -// CommunityGalleryImageVersionListIterator provides access to a complete listing of -// CommunityGalleryImageVersion values. -type CommunityGalleryImageVersionListIterator struct { - i int - page CommunityGalleryImageVersionListPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *CommunityGalleryImageVersionListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CommunityGalleryImageVersionListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *CommunityGalleryImageVersionListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter CommunityGalleryImageVersionListIterator) 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 CommunityGalleryImageVersionListIterator) Response() CommunityGalleryImageVersionList { - 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 CommunityGalleryImageVersionListIterator) Value() CommunityGalleryImageVersion { - if !iter.page.NotDone() { - return CommunityGalleryImageVersion{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the CommunityGalleryImageVersionListIterator type. -func NewCommunityGalleryImageVersionListIterator(page CommunityGalleryImageVersionListPage) CommunityGalleryImageVersionListIterator { - return CommunityGalleryImageVersionListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (cgivl CommunityGalleryImageVersionList) IsEmpty() bool { - return cgivl.Value == nil || len(*cgivl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (cgivl CommunityGalleryImageVersionList) hasNextLink() bool { - return cgivl.NextLink != nil && len(*cgivl.NextLink) != 0 -} - -// communityGalleryImageVersionListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (cgivl CommunityGalleryImageVersionList) communityGalleryImageVersionListPreparer(ctx context.Context) (*http.Request, error) { - if !cgivl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(cgivl.NextLink))) -} - -// CommunityGalleryImageVersionListPage contains a page of CommunityGalleryImageVersion values. -type CommunityGalleryImageVersionListPage struct { - fn func(context.Context, CommunityGalleryImageVersionList) (CommunityGalleryImageVersionList, error) - cgivl CommunityGalleryImageVersionList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *CommunityGalleryImageVersionListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CommunityGalleryImageVersionListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.cgivl) - if err != nil { - return err - } - page.cgivl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *CommunityGalleryImageVersionListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page CommunityGalleryImageVersionListPage) NotDone() bool { - return !page.cgivl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page CommunityGalleryImageVersionListPage) Response() CommunityGalleryImageVersionList { - return page.cgivl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page CommunityGalleryImageVersionListPage) Values() []CommunityGalleryImageVersion { - if page.cgivl.IsEmpty() { - return nil - } - return *page.cgivl.Value -} - -// Creates a new instance of the CommunityGalleryImageVersionListPage type. -func NewCommunityGalleryImageVersionListPage(cur CommunityGalleryImageVersionList, getNextPage func(context.Context, CommunityGalleryImageVersionList) (CommunityGalleryImageVersionList, error)) CommunityGalleryImageVersionListPage { - return CommunityGalleryImageVersionListPage{ - fn: getNextPage, - cgivl: cur, - } -} - -// CommunityGalleryImageVersionProperties describes the properties of a gallery image version. -type CommunityGalleryImageVersionProperties struct { - // PublishedDate - The published date of the gallery image version Definition. This property can be used for decommissioning purposes. This property is updatable. - PublishedDate *date.Time `json:"publishedDate,omitempty"` - // EndOfLifeDate - The end of life date of the gallery image version Definition. This property can be used for decommissioning purposes. This property is updatable. - EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` - // ExcludeFromLatest - If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. - ExcludeFromLatest *bool `json:"excludeFromLatest,omitempty"` - // StorageProfile - Describes the storage profile of the image version. - StorageProfile *SharedGalleryImageVersionStorageProfile `json:"storageProfile,omitempty"` -} - -// CommunityGalleryInfo information of community gallery if current gallery is shared to community -type CommunityGalleryInfo struct { - // PublisherURI - The link to the publisher website. Visible to all users. - PublisherURI *string `json:"publisherUri,omitempty"` - // PublisherContact - Community gallery publisher support email. The email address of the publisher. Visible to all users. - PublisherContact *string `json:"publisherContact,omitempty"` - // Eula - End-user license agreement for community gallery image. - Eula *string `json:"eula,omitempty"` - // PublicNamePrefix - The prefix of the gallery name that will be displayed publicly. Visible to all users. - PublicNamePrefix *string `json:"publicNamePrefix,omitempty"` - // CommunityGalleryEnabled - READ-ONLY; Contains info about whether community gallery sharing is enabled. - CommunityGalleryEnabled *bool `json:"communityGalleryEnabled,omitempty"` - // PublicNames - READ-ONLY; Community gallery public name list. - PublicNames *[]string `json:"publicNames,omitempty"` -} - -// MarshalJSON is the custom marshaler for CommunityGalleryInfo. -func (cgiVar CommunityGalleryInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cgiVar.PublisherURI != nil { - objectMap["publisherUri"] = cgiVar.PublisherURI - } - if cgiVar.PublisherContact != nil { - objectMap["publisherContact"] = cgiVar.PublisherContact - } - if cgiVar.Eula != nil { - objectMap["eula"] = cgiVar.Eula - } - if cgiVar.PublicNamePrefix != nil { - objectMap["publicNamePrefix"] = cgiVar.PublicNamePrefix - } - return json.Marshal(objectMap) -} - -// CopyCompletionError indicates the error details if the background copy of a resource created via the -// CopyStart operation fails. -type CopyCompletionError struct { - // ErrorCode - Indicates the error code if the background copy of a resource created via the CopyStart operation fails. - ErrorCode *string `json:"errorCode,omitempty"` - // ErrorMessage - Indicates the error message if the background copy of a resource created via the CopyStart operation fails. - ErrorMessage *string `json:"errorMessage,omitempty"` -} - -// CreationData data used when creating a disk. -type CreationData struct { - // CreateOption - This enumerates the possible sources of a disk's creation. Possible values include: 'Empty', 'Attach', 'FromImage', 'Import', 'Copy', 'Restore', 'Upload', 'CopyStart', 'ImportSecure', 'UploadPreparedSecure' - CreateOption DiskCreateOption `json:"createOption,omitempty"` - // StorageAccountID - Required if createOption is Import. The Azure Resource Manager identifier of the storage account containing the blob to import as a disk. - StorageAccountID *string `json:"storageAccountId,omitempty"` - // ImageReference - Disk source information for PIR or user images. - ImageReference *ImageDiskReference `json:"imageReference,omitempty"` - // GalleryImageReference - Required if creating from a Gallery Image. The id/sharedGalleryImageId/communityGalleryImageId of the ImageDiskReference will be the ARM id of the shared galley image version from which to create a disk. - GalleryImageReference *ImageDiskReference `json:"galleryImageReference,omitempty"` - // SourceURI - If createOption is Import, this is the URI of a blob to be imported into a managed disk. - SourceURI *string `json:"sourceUri,omitempty"` - // SourceResourceID - If createOption is Copy, this is the ARM id of the source snapshot or disk. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // SourceUniqueID - READ-ONLY; If this field is set, this is the unique id identifying the source of this resource. - SourceUniqueID *string `json:"sourceUniqueId,omitempty"` - // UploadSizeBytes - If createOption is Upload, this is the size of the contents of the upload including the VHD footer. This value should be between 20972032 (20 MiB + 512 bytes for the VHD footer) and 35183298347520 bytes (32 TiB + 512 bytes for the VHD footer). - UploadSizeBytes *int64 `json:"uploadSizeBytes,omitempty"` - // LogicalSectorSize - Logical sector size in bytes for Ultra disks. Supported values are 512 ad 4096. 4096 is the default. - LogicalSectorSize *int32 `json:"logicalSectorSize,omitempty"` - // SecurityDataURI - If createOption is ImportSecure, this is the URI of a blob to be imported into VM guest state. - SecurityDataURI *string `json:"securityDataUri,omitempty"` - // PerformancePlus - Set this flag to true to get a boost on the performance target of the disk deployed, see here on the respective performance target. This flag can only be set on disk creation time and cannot be disabled after enabled. - PerformancePlus *bool `json:"performancePlus,omitempty"` -} - -// MarshalJSON is the custom marshaler for CreationData. -func (cd CreationData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cd.CreateOption != "" { - objectMap["createOption"] = cd.CreateOption - } - if cd.StorageAccountID != nil { - objectMap["storageAccountId"] = cd.StorageAccountID - } - if cd.ImageReference != nil { - objectMap["imageReference"] = cd.ImageReference - } - if cd.GalleryImageReference != nil { - objectMap["galleryImageReference"] = cd.GalleryImageReference - } - if cd.SourceURI != nil { - objectMap["sourceUri"] = cd.SourceURI - } - if cd.SourceResourceID != nil { - objectMap["sourceResourceId"] = cd.SourceResourceID - } - if cd.UploadSizeBytes != nil { - objectMap["uploadSizeBytes"] = cd.UploadSizeBytes - } - if cd.LogicalSectorSize != nil { - objectMap["logicalSectorSize"] = cd.LogicalSectorSize - } - if cd.SecurityDataURI != nil { - objectMap["securityDataUri"] = cd.SecurityDataURI - } - if cd.PerformancePlus != nil { - objectMap["performancePlus"] = cd.PerformancePlus - } - return json.Marshal(objectMap) -} - -// DataDisk describes a data disk. -type DataDisk struct { - // Lun - Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM. - Lun *int32 `json:"lun,omitempty"` - // Name - The disk name. - Name *string `json:"name,omitempty"` - // Vhd - The virtual hard disk. - Vhd *VirtualHardDisk `json:"vhd,omitempty"` - // Image - 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. - Image *VirtualHardDisk `json:"image,omitempty"` - // Caching - Specifies the caching requirements.

      Possible values are:

      **None**

      **ReadOnly**

      **ReadWrite**

      Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' - Caching CachingTypes `json:"caching,omitempty"` - // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. - WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` - // CreateOption - Specifies how the virtual machine should be created.

      Possible values are:

      **Attach** \u2013 This value is used when you are using a specialized disk to create the virtual machine.

      **FromImage** \u2013 This value is used when you are using an image to create the virtual machine. If you are using a platform image, you also use the imageReference element described above. If you are using a marketplace image, you also use the plan element previously described. Possible values include: 'DiskCreateOptionTypesFromImage', 'DiskCreateOptionTypesEmpty', 'DiskCreateOptionTypesAttach' - CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` - // DiskSizeGB - Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image.

      diskSizeGB is the number of bytes x 1024^3 for the disk and the value cannot be larger than 1023 - DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` - // ManagedDisk - The managed disk parameters. - ManagedDisk *ManagedDiskParameters `json:"managedDisk,omitempty"` - // ToBeDetached - Specifies whether the data disk is in process of detachment from the VirtualMachine/VirtualMachineScaleset - ToBeDetached *bool `json:"toBeDetached,omitempty"` - // DiskIOPSReadWrite - READ-ONLY; Specifies the Read-Write IOPS for the managed disk when StorageAccountType is UltraSSD_LRS. Returned only for VirtualMachine ScaleSet VM disks. Can be updated only via updates to the VirtualMachine Scale Set. - DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` - // DiskMBpsReadWrite - READ-ONLY; Specifies the bandwidth in MB per second for the managed disk when StorageAccountType is UltraSSD_LRS. Returned only for VirtualMachine ScaleSet VM disks. Can be updated only via updates to the VirtualMachine Scale Set. - DiskMBpsReadWrite *int64 `json:"diskMBpsReadWrite,omitempty"` - // DetachOption - Specifies the detach behavior to be used while detaching a disk or which is already in the process of detachment from the virtual machine. Supported values: **ForceDetach**.

      detachOption: **ForceDetach** is applicable only for managed data disks. If a previous detachment attempt of the data disk did not complete due to an unexpected failure from the virtual machine and the disk is still not released then use force-detach as a last resort option to detach the disk forcibly from the VM. All writes might not have been flushed when using this detach behavior.

      This feature is still in preview mode and is not supported for VirtualMachineScaleSet. To force-detach a data disk update toBeDetached to 'true' along with setting detachOption: 'ForceDetach'. Possible values include: 'ForceDetach' - DetachOption DiskDetachOptionTypes `json:"detachOption,omitempty"` - // DeleteOption - Specifies whether data disk should be deleted or detached upon VM deletion.

      Possible values:

      **Delete** If this value is used, the data disk is deleted when VM is deleted.

      **Detach** If this value is used, the data disk is retained after VM is deleted.

      The default value is set to **detach**. Possible values include: 'DiskDeleteOptionTypesDelete', 'DiskDeleteOptionTypesDetach' - DeleteOption DiskDeleteOptionTypes `json:"deleteOption,omitempty"` -} - -// MarshalJSON is the custom marshaler for DataDisk. -func (dd DataDisk) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dd.Lun != nil { - objectMap["lun"] = dd.Lun - } - if dd.Name != nil { - objectMap["name"] = dd.Name - } - if dd.Vhd != nil { - objectMap["vhd"] = dd.Vhd - } - if dd.Image != nil { - objectMap["image"] = dd.Image - } - if dd.Caching != "" { - objectMap["caching"] = dd.Caching - } - if dd.WriteAcceleratorEnabled != nil { - objectMap["writeAcceleratorEnabled"] = dd.WriteAcceleratorEnabled - } - if dd.CreateOption != "" { - objectMap["createOption"] = dd.CreateOption - } - if dd.DiskSizeGB != nil { - objectMap["diskSizeGB"] = dd.DiskSizeGB - } - if dd.ManagedDisk != nil { - objectMap["managedDisk"] = dd.ManagedDisk - } - if dd.ToBeDetached != nil { - objectMap["toBeDetached"] = dd.ToBeDetached - } - if dd.DetachOption != "" { - objectMap["detachOption"] = dd.DetachOption - } - if dd.DeleteOption != "" { - objectMap["deleteOption"] = dd.DeleteOption - } - return json.Marshal(objectMap) -} - -// DataDiskImage contains the data disk images information. -type DataDiskImage struct { - // Lun - READ-ONLY; Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM. - Lun *int32 `json:"lun,omitempty"` -} - -// MarshalJSON is the custom marshaler for DataDiskImage. -func (ddi DataDiskImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// DataDiskImageEncryption contains encryption settings for a data disk image. -type DataDiskImageEncryption struct { - // Lun - This property specifies the logical unit number of the data disk. This value is used to identify data disks within the Virtual Machine and therefore must be unique for each data disk attached to the Virtual Machine. - Lun *int32 `json:"lun,omitempty"` - // DiskEncryptionSetID - A relative URI containing the resource ID of the disk encryption set. - DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` -} - -// DedicatedHost specifies information about the Dedicated host. -type DedicatedHost struct { - autorest.Response `json:"-"` - *DedicatedHostProperties `json:"properties,omitempty"` - // Sku - SKU of the dedicated host for Hardware Generation and VM family. Only name is required to be set. List Microsoft.Compute SKUs for a list of possible values. - Sku *Sku `json:"sku,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; 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 DedicatedHost. -func (dh DedicatedHost) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dh.DedicatedHostProperties != nil { - objectMap["properties"] = dh.DedicatedHostProperties - } - if dh.Sku != nil { - objectMap["sku"] = dh.Sku - } - if dh.Location != nil { - objectMap["location"] = dh.Location - } - if dh.Tags != nil { - objectMap["tags"] = dh.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for DedicatedHost struct. -func (dh *DedicatedHost) 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 dedicatedHostProperties DedicatedHostProperties - err = json.Unmarshal(*v, &dedicatedHostProperties) - if err != nil { - return err - } - dh.DedicatedHostProperties = &dedicatedHostProperties - } - case "sku": - if v != nil { - var sku Sku - err = json.Unmarshal(*v, &sku) - if err != nil { - return err - } - dh.Sku = &sku - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - dh.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - dh.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - dh.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - dh.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - dh.Tags = tags - } - } - } - - return nil -} - -// DedicatedHostAllocatableVM represents the dedicated host unutilized capacity in terms of a specific VM -// size. -type DedicatedHostAllocatableVM struct { - // VMSize - VM size in terms of which the unutilized capacity is represented. - VMSize *string `json:"vmSize,omitempty"` - // Count - Maximum number of VMs of size vmSize that can fit in the dedicated host's remaining capacity. - Count *float64 `json:"count,omitempty"` -} - -// DedicatedHostAvailableCapacity dedicated host unutilized capacity. -type DedicatedHostAvailableCapacity struct { - // AllocatableVMs - The unutilized capacity of the dedicated host represented in terms of each VM size that is allowed to be deployed to the dedicated host. - AllocatableVMs *[]DedicatedHostAllocatableVM `json:"allocatableVMs,omitempty"` -} - -// DedicatedHostGroup specifies information about the dedicated host group that the dedicated hosts should -// be assigned to.

      Currently, a dedicated host can only be added to a dedicated host group at -// creation time. An existing dedicated host cannot be added to another dedicated host group. -type DedicatedHostGroup struct { - autorest.Response `json:"-"` - *DedicatedHostGroupProperties `json:"properties,omitempty"` - // Zones - Availability Zone to use for this host group. Only single zone is supported. The zone can be assigned only during creation. If not provided, the group supports all zones in the region. If provided, enforces each host in the group to be in the same zone. - Zones *[]string `json:"zones,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; 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 DedicatedHostGroup. -func (dhg DedicatedHostGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dhg.DedicatedHostGroupProperties != nil { - objectMap["properties"] = dhg.DedicatedHostGroupProperties - } - if dhg.Zones != nil { - objectMap["zones"] = dhg.Zones - } - if dhg.Location != nil { - objectMap["location"] = dhg.Location - } - if dhg.Tags != nil { - objectMap["tags"] = dhg.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for DedicatedHostGroup struct. -func (dhg *DedicatedHostGroup) 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 dedicatedHostGroupProperties DedicatedHostGroupProperties - err = json.Unmarshal(*v, &dedicatedHostGroupProperties) - if err != nil { - return err - } - dhg.DedicatedHostGroupProperties = &dedicatedHostGroupProperties - } - case "zones": - if v != nil { - var zones []string - err = json.Unmarshal(*v, &zones) - if err != nil { - return err - } - dhg.Zones = &zones - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - dhg.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - dhg.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - dhg.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - dhg.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - dhg.Tags = tags - } - } - } - - return nil -} - -// DedicatedHostGroupInstanceView ... -type DedicatedHostGroupInstanceView struct { - // Hosts - List of instance view of the dedicated hosts under the dedicated host group. - Hosts *[]DedicatedHostInstanceViewWithName `json:"hosts,omitempty"` -} - -// DedicatedHostGroupListResult the List Dedicated Host Group with resource group response. -type DedicatedHostGroupListResult struct { - autorest.Response `json:"-"` - // Value - The list of dedicated host groups - Value *[]DedicatedHostGroup `json:"value,omitempty"` - // NextLink - The URI to fetch the next page of Dedicated Host Groups. Call ListNext() with this URI to fetch the next page of Dedicated Host Groups. - NextLink *string `json:"nextLink,omitempty"` -} - -// DedicatedHostGroupListResultIterator provides access to a complete listing of DedicatedHostGroup values. -type DedicatedHostGroupListResultIterator struct { - i int - page DedicatedHostGroupListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *DedicatedHostGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *DedicatedHostGroupListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter DedicatedHostGroupListResultIterator) 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 DedicatedHostGroupListResultIterator) Response() DedicatedHostGroupListResult { - 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 DedicatedHostGroupListResultIterator) Value() DedicatedHostGroup { - if !iter.page.NotDone() { - return DedicatedHostGroup{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the DedicatedHostGroupListResultIterator type. -func NewDedicatedHostGroupListResultIterator(page DedicatedHostGroupListResultPage) DedicatedHostGroupListResultIterator { - return DedicatedHostGroupListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (dhglr DedicatedHostGroupListResult) IsEmpty() bool { - return dhglr.Value == nil || len(*dhglr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (dhglr DedicatedHostGroupListResult) hasNextLink() bool { - return dhglr.NextLink != nil && len(*dhglr.NextLink) != 0 -} - -// dedicatedHostGroupListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (dhglr DedicatedHostGroupListResult) dedicatedHostGroupListResultPreparer(ctx context.Context) (*http.Request, error) { - if !dhglr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(dhglr.NextLink))) -} - -// DedicatedHostGroupListResultPage contains a page of DedicatedHostGroup values. -type DedicatedHostGroupListResultPage struct { - fn func(context.Context, DedicatedHostGroupListResult) (DedicatedHostGroupListResult, error) - dhglr DedicatedHostGroupListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *DedicatedHostGroupListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.dhglr) - if err != nil { - return err - } - page.dhglr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *DedicatedHostGroupListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page DedicatedHostGroupListResultPage) NotDone() bool { - return !page.dhglr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page DedicatedHostGroupListResultPage) Response() DedicatedHostGroupListResult { - return page.dhglr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page DedicatedHostGroupListResultPage) Values() []DedicatedHostGroup { - if page.dhglr.IsEmpty() { - return nil - } - return *page.dhglr.Value -} - -// Creates a new instance of the DedicatedHostGroupListResultPage type. -func NewDedicatedHostGroupListResultPage(cur DedicatedHostGroupListResult, getNextPage func(context.Context, DedicatedHostGroupListResult) (DedicatedHostGroupListResult, error)) DedicatedHostGroupListResultPage { - return DedicatedHostGroupListResultPage{ - fn: getNextPage, - dhglr: cur, - } -} - -// DedicatedHostGroupProperties dedicated Host Group Properties. -type DedicatedHostGroupProperties struct { - // PlatformFaultDomainCount - Number of fault domains that the host group can span. - PlatformFaultDomainCount *int32 `json:"platformFaultDomainCount,omitempty"` - // Hosts - READ-ONLY; A list of references to all dedicated hosts in the dedicated host group. - Hosts *[]SubResourceReadOnly `json:"hosts,omitempty"` - // InstanceView - READ-ONLY; The dedicated host group instance view, which has the list of instance view of the dedicated hosts under the dedicated host group. - InstanceView *DedicatedHostGroupInstanceView `json:"instanceView,omitempty"` - // SupportAutomaticPlacement - Specifies whether virtual machines or virtual machine scale sets can be placed automatically on the dedicated host group. Automatic placement means resources are allocated on dedicated hosts, that are chosen by Azure, under the dedicated host group. The value is defaulted to 'false' when not provided.

      Minimum api-version: 2020-06-01. - SupportAutomaticPlacement *bool `json:"supportAutomaticPlacement,omitempty"` - // AdditionalCapabilities - Enables or disables a capability on the dedicated host group.

      Minimum api-version: 2022-03-01. - AdditionalCapabilities *DedicatedHostGroupPropertiesAdditionalCapabilities `json:"additionalCapabilities,omitempty"` -} - -// MarshalJSON is the custom marshaler for DedicatedHostGroupProperties. -func (dhgp DedicatedHostGroupProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dhgp.PlatformFaultDomainCount != nil { - objectMap["platformFaultDomainCount"] = dhgp.PlatformFaultDomainCount - } - if dhgp.SupportAutomaticPlacement != nil { - objectMap["supportAutomaticPlacement"] = dhgp.SupportAutomaticPlacement - } - if dhgp.AdditionalCapabilities != nil { - objectMap["additionalCapabilities"] = dhgp.AdditionalCapabilities - } - return json.Marshal(objectMap) -} - -// DedicatedHostGroupPropertiesAdditionalCapabilities enables or disables a capability on the dedicated -// host group.

      Minimum api-version: 2022-03-01. -type DedicatedHostGroupPropertiesAdditionalCapabilities struct { - // UltraSSDEnabled - The flag that enables or disables a capability to have UltraSSD Enabled Virtual Machines on Dedicated Hosts of the Dedicated Host Group. For the Virtual Machines to be UltraSSD Enabled, UltraSSDEnabled flag for the resource needs to be set true as well. The value is defaulted to 'false' when not provided. Please refer to https://docs.microsoft.com/en-us/azure/virtual-machines/disks-enable-ultra-ssd for more details on Ultra SSD feature.

      NOTE: The ultraSSDEnabled setting can only be enabled for Host Groups that are created as zonal.

      Minimum api-version: 2022-03-01. - UltraSSDEnabled *bool `json:"ultraSSDEnabled,omitempty"` -} - -// DedicatedHostGroupUpdate specifies information about the dedicated host group that the dedicated host -// should be assigned to. Only tags may be updated. -type DedicatedHostGroupUpdate struct { - *DedicatedHostGroupProperties `json:"properties,omitempty"` - // Zones - Availability Zone to use for this host group. Only single zone is supported. The zone can be assigned only during creation. If not provided, the group supports all zones in the region. If provided, enforces each host in the group to be in the same zone. - Zones *[]string `json:"zones,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for DedicatedHostGroupUpdate. -func (dhgu DedicatedHostGroupUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dhgu.DedicatedHostGroupProperties != nil { - objectMap["properties"] = dhgu.DedicatedHostGroupProperties - } - if dhgu.Zones != nil { - objectMap["zones"] = dhgu.Zones - } - if dhgu.Tags != nil { - objectMap["tags"] = dhgu.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for DedicatedHostGroupUpdate struct. -func (dhgu *DedicatedHostGroupUpdate) 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 dedicatedHostGroupProperties DedicatedHostGroupProperties - err = json.Unmarshal(*v, &dedicatedHostGroupProperties) - if err != nil { - return err - } - dhgu.DedicatedHostGroupProperties = &dedicatedHostGroupProperties - } - case "zones": - if v != nil { - var zones []string - err = json.Unmarshal(*v, &zones) - if err != nil { - return err - } - dhgu.Zones = &zones - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - dhgu.Tags = tags - } - } - } - - return nil -} - -// DedicatedHostInstanceView the instance view of a dedicated host. -type DedicatedHostInstanceView struct { - // AssetID - READ-ONLY; Specifies the unique id of the dedicated physical machine on which the dedicated host resides. - AssetID *string `json:"assetId,omitempty"` - // AvailableCapacity - Unutilized capacity of the dedicated host. - AvailableCapacity *DedicatedHostAvailableCapacity `json:"availableCapacity,omitempty"` - // Statuses - The resource status information. - Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` -} - -// MarshalJSON is the custom marshaler for DedicatedHostInstanceView. -func (dhiv DedicatedHostInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dhiv.AvailableCapacity != nil { - objectMap["availableCapacity"] = dhiv.AvailableCapacity - } - if dhiv.Statuses != nil { - objectMap["statuses"] = dhiv.Statuses - } - return json.Marshal(objectMap) -} - -// DedicatedHostInstanceViewWithName the instance view of a dedicated host that includes the name of the -// dedicated host. It is used for the response to the instance view of a dedicated host group. -type DedicatedHostInstanceViewWithName struct { - // Name - READ-ONLY; The name of the dedicated host. - Name *string `json:"name,omitempty"` - // AssetID - READ-ONLY; Specifies the unique id of the dedicated physical machine on which the dedicated host resides. - AssetID *string `json:"assetId,omitempty"` - // AvailableCapacity - Unutilized capacity of the dedicated host. - AvailableCapacity *DedicatedHostAvailableCapacity `json:"availableCapacity,omitempty"` - // Statuses - The resource status information. - Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` -} - -// MarshalJSON is the custom marshaler for DedicatedHostInstanceViewWithName. -func (dhivwn DedicatedHostInstanceViewWithName) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dhivwn.AvailableCapacity != nil { - objectMap["availableCapacity"] = dhivwn.AvailableCapacity - } - if dhivwn.Statuses != nil { - objectMap["statuses"] = dhivwn.Statuses - } - return json.Marshal(objectMap) -} - -// DedicatedHostListResult the list dedicated host operation response. -type DedicatedHostListResult struct { - autorest.Response `json:"-"` - // Value - The list of dedicated hosts - Value *[]DedicatedHost `json:"value,omitempty"` - // NextLink - The URI to fetch the next page of dedicated hosts. Call ListNext() with this URI to fetch the next page of dedicated hosts. - NextLink *string `json:"nextLink,omitempty"` -} - -// DedicatedHostListResultIterator provides access to a complete listing of DedicatedHost values. -type DedicatedHostListResultIterator struct { - i int - page DedicatedHostListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *DedicatedHostListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *DedicatedHostListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter DedicatedHostListResultIterator) 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 DedicatedHostListResultIterator) Response() DedicatedHostListResult { - 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 DedicatedHostListResultIterator) Value() DedicatedHost { - if !iter.page.NotDone() { - return DedicatedHost{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the DedicatedHostListResultIterator type. -func NewDedicatedHostListResultIterator(page DedicatedHostListResultPage) DedicatedHostListResultIterator { - return DedicatedHostListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (dhlr DedicatedHostListResult) IsEmpty() bool { - return dhlr.Value == nil || len(*dhlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (dhlr DedicatedHostListResult) hasNextLink() bool { - return dhlr.NextLink != nil && len(*dhlr.NextLink) != 0 -} - -// dedicatedHostListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (dhlr DedicatedHostListResult) dedicatedHostListResultPreparer(ctx context.Context) (*http.Request, error) { - if !dhlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(dhlr.NextLink))) -} - -// DedicatedHostListResultPage contains a page of DedicatedHost values. -type DedicatedHostListResultPage struct { - fn func(context.Context, DedicatedHostListResult) (DedicatedHostListResult, error) - dhlr DedicatedHostListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *DedicatedHostListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.dhlr) - if err != nil { - return err - } - page.dhlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *DedicatedHostListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page DedicatedHostListResultPage) NotDone() bool { - return !page.dhlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page DedicatedHostListResultPage) Response() DedicatedHostListResult { - return page.dhlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page DedicatedHostListResultPage) Values() []DedicatedHost { - if page.dhlr.IsEmpty() { - return nil - } - return *page.dhlr.Value -} - -// Creates a new instance of the DedicatedHostListResultPage type. -func NewDedicatedHostListResultPage(cur DedicatedHostListResult, getNextPage func(context.Context, DedicatedHostListResult) (DedicatedHostListResult, error)) DedicatedHostListResultPage { - return DedicatedHostListResultPage{ - fn: getNextPage, - dhlr: cur, - } -} - -// DedicatedHostProperties properties of the dedicated host. -type DedicatedHostProperties struct { - // PlatformFaultDomain - Fault domain of the dedicated host within a dedicated host group. - PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"` - // AutoReplaceOnFailure - Specifies whether the dedicated host should be replaced automatically in case of a failure. The value is defaulted to 'true' when not provided. - AutoReplaceOnFailure *bool `json:"autoReplaceOnFailure,omitempty"` - // HostID - READ-ONLY; A unique id generated and assigned to the dedicated host by the platform.

      Does not change throughout the lifetime of the host. - HostID *string `json:"hostId,omitempty"` - // VirtualMachines - READ-ONLY; A list of references to all virtual machines in the Dedicated Host. - VirtualMachines *[]SubResourceReadOnly `json:"virtualMachines,omitempty"` - // LicenseType - Specifies the software license type that will be applied to the VMs deployed on the dedicated host.

      Possible values are:

      **None**

      **Windows_Server_Hybrid**

      **Windows_Server_Perpetual**

      Default: **None**. Possible values include: 'DedicatedHostLicenseTypesNone', 'DedicatedHostLicenseTypesWindowsServerHybrid', 'DedicatedHostLicenseTypesWindowsServerPerpetual' - LicenseType DedicatedHostLicenseTypes `json:"licenseType,omitempty"` - // ProvisioningTime - READ-ONLY; The date when the host was first provisioned. - ProvisioningTime *date.Time `json:"provisioningTime,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *string `json:"provisioningState,omitempty"` - // InstanceView - READ-ONLY; The dedicated host instance view. - InstanceView *DedicatedHostInstanceView `json:"instanceView,omitempty"` - // TimeCreated - READ-ONLY; Specifies the time at which the Dedicated Host resource was created.

      Minimum api-version: 2021-11-01. - TimeCreated *date.Time `json:"timeCreated,omitempty"` -} - -// MarshalJSON is the custom marshaler for DedicatedHostProperties. -func (dhp DedicatedHostProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dhp.PlatformFaultDomain != nil { - objectMap["platformFaultDomain"] = dhp.PlatformFaultDomain - } - if dhp.AutoReplaceOnFailure != nil { - objectMap["autoReplaceOnFailure"] = dhp.AutoReplaceOnFailure - } - if dhp.LicenseType != "" { - objectMap["licenseType"] = dhp.LicenseType - } - return json.Marshal(objectMap) -} - -// DedicatedHostsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type DedicatedHostsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DedicatedHostsClient) (DedicatedHost, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DedicatedHostsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DedicatedHostsCreateOrUpdateFuture.Result. -func (future *DedicatedHostsCreateOrUpdateFuture) result(client DedicatedHostsClient) (dh DedicatedHost, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - dh.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.DedicatedHostsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if dh.Response.Response, err = future.GetResult(sender); err == nil && dh.Response.Response.StatusCode != http.StatusNoContent { - dh, err = client.CreateOrUpdateResponder(dh.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsCreateOrUpdateFuture", "Result", dh.Response.Response, "Failure responding to request") - } - } - return -} - -// DedicatedHostsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type DedicatedHostsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DedicatedHostsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DedicatedHostsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DedicatedHostsDeleteFuture.Result. -func (future *DedicatedHostsDeleteFuture) result(client DedicatedHostsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.DedicatedHostsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// DedicatedHostsRestartFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type DedicatedHostsRestartFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DedicatedHostsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DedicatedHostsRestartFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DedicatedHostsRestartFuture.Result. -func (future *DedicatedHostsRestartFuture) result(client DedicatedHostsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsRestartFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.DedicatedHostsRestartFuture") - return - } - ar.Response = future.Response() - return -} - -// DedicatedHostsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type DedicatedHostsUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DedicatedHostsClient) (DedicatedHost, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DedicatedHostsUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DedicatedHostsUpdateFuture.Result. -func (future *DedicatedHostsUpdateFuture) result(client DedicatedHostsClient) (dh DedicatedHost, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - dh.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.DedicatedHostsUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if dh.Response.Response, err = future.GetResult(sender); err == nil && dh.Response.Response.StatusCode != http.StatusNoContent { - dh, err = client.UpdateResponder(dh.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsUpdateFuture", "Result", dh.Response.Response, "Failure responding to request") - } - } - return -} - -// DedicatedHostUpdate specifies information about the dedicated host. Only tags, autoReplaceOnFailure and -// licenseType may be updated. -type DedicatedHostUpdate struct { - *DedicatedHostProperties `json:"properties,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for DedicatedHostUpdate. -func (dhu DedicatedHostUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dhu.DedicatedHostProperties != nil { - objectMap["properties"] = dhu.DedicatedHostProperties - } - if dhu.Tags != nil { - objectMap["tags"] = dhu.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for DedicatedHostUpdate struct. -func (dhu *DedicatedHostUpdate) 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 dedicatedHostProperties DedicatedHostProperties - err = json.Unmarshal(*v, &dedicatedHostProperties) - if err != nil { - return err - } - dhu.DedicatedHostProperties = &dedicatedHostProperties - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - dhu.Tags = tags - } - } - } - - return nil -} - -// DiagnosticsProfile specifies the boot diagnostic settings state.

      Minimum api-version: -// 2015-06-15. -type DiagnosticsProfile struct { - // BootDiagnostics - Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to diagnose VM status.
      **NOTE**: If storageUri is being specified then ensure that the storage account is in the same region and subscription as the VM.

      You can easily view the output of your console log.

      Azure also enables you to see a screenshot of the VM from the hypervisor. - BootDiagnostics *BootDiagnostics `json:"bootDiagnostics,omitempty"` -} - -// DiffDiskSettings describes the parameters of ephemeral disk settings that can be specified for operating -// system disk.

      NOTE: The ephemeral disk settings can only be specified for managed disk. -type DiffDiskSettings struct { - // Option - Specifies the ephemeral disk settings for operating system disk. Possible values include: 'Local' - Option DiffDiskOptions `json:"option,omitempty"` - // Placement - Specifies the ephemeral disk placement for operating system disk.

      Possible values are:

      **CacheDisk**

      **ResourceDisk**

      Default: **CacheDisk** if one is configured for the VM size otherwise **ResourceDisk** is used.

      Refer to VM size documentation for Windows VM at https://docs.microsoft.com/azure/virtual-machines/windows/sizes and Linux VM at https://docs.microsoft.com/azure/virtual-machines/linux/sizes to check which VM sizes exposes a cache disk. Possible values include: 'CacheDisk', 'ResourceDisk' - Placement DiffDiskPlacement `json:"placement,omitempty"` -} - -// Disallowed describes the disallowed disk types. -type Disallowed struct { - // DiskTypes - A list of disk types. - DiskTypes *[]string `json:"diskTypes,omitempty"` -} - -// DisallowedConfiguration specifies the disallowed configuration for a virtual machine image. -type DisallowedConfiguration struct { - // VMDiskType - VM disk types which are disallowed. Possible values include: 'VMDiskTypesNone', 'VMDiskTypesUnmanaged' - VMDiskType VMDiskTypes `json:"vmDiskType,omitempty"` -} - -// Disk disk resource. -type Disk struct { - autorest.Response `json:"-"` - // ManagedBy - READ-ONLY; A relative URI containing the ID of the VM that has the disk attached. - ManagedBy *string `json:"managedBy,omitempty"` - // ManagedByExtended - READ-ONLY; List of relative URIs containing the IDs of the VMs that have the disk attached. maxShares should be set to a value greater than one for disks to allow attaching them to multiple VMs. - ManagedByExtended *[]string `json:"managedByExtended,omitempty"` - Sku *DiskSku `json:"sku,omitempty"` - // Zones - The Logical zone list for Disk. - Zones *[]string `json:"zones,omitempty"` - // ExtendedLocation - The extended location where the disk will be created. Extended location cannot be changed. - ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` - *DiskProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; 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 Disk. -func (d Disk) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if d.Sku != nil { - objectMap["sku"] = d.Sku - } - if d.Zones != nil { - objectMap["zones"] = d.Zones - } - if d.ExtendedLocation != nil { - objectMap["extendedLocation"] = d.ExtendedLocation - } - if d.DiskProperties != nil { - objectMap["properties"] = d.DiskProperties - } - 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 "managedByExtended": - if v != nil { - var managedByExtended []string - err = json.Unmarshal(*v, &managedByExtended) - if err != nil { - return err - } - d.ManagedByExtended = &managedByExtended - } - 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 "extendedLocation": - if v != nil { - var extendedLocation ExtendedLocation - err = json.Unmarshal(*v, &extendedLocation) - if err != nil { - return err - } - d.ExtendedLocation = &extendedLocation - } - 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 -} - -// DiskAccess disk access resource. -type DiskAccess struct { - autorest.Response `json:"-"` - *DiskAccessProperties `json:"properties,omitempty"` - // ExtendedLocation - The extended location where the disk access will be created. Extended location cannot be changed. - ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; 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 DiskAccess. -func (da DiskAccess) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if da.DiskAccessProperties != nil { - objectMap["properties"] = da.DiskAccessProperties - } - if da.ExtendedLocation != nil { - objectMap["extendedLocation"] = da.ExtendedLocation - } - if da.Location != nil { - objectMap["location"] = da.Location - } - if da.Tags != nil { - objectMap["tags"] = da.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for DiskAccess struct. -func (da *DiskAccess) 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 diskAccessProperties DiskAccessProperties - err = json.Unmarshal(*v, &diskAccessProperties) - if err != nil { - return err - } - da.DiskAccessProperties = &diskAccessProperties - } - case "extendedLocation": - if v != nil { - var extendedLocation ExtendedLocation - err = json.Unmarshal(*v, &extendedLocation) - if err != nil { - return err - } - da.ExtendedLocation = &extendedLocation - } - 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 - } - } - } - - return nil -} - -// DiskAccessesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type DiskAccessesCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DiskAccessesClient) (DiskAccess, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DiskAccessesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DiskAccessesCreateOrUpdateFuture.Result. -func (future *DiskAccessesCreateOrUpdateFuture) result(client DiskAccessesClient) (da DiskAccess, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskAccessesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - da.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.DiskAccessesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if da.Response.Response, err = future.GetResult(sender); err == nil && da.Response.Response.StatusCode != http.StatusNoContent { - da, err = client.CreateOrUpdateResponder(da.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskAccessesCreateOrUpdateFuture", "Result", da.Response.Response, "Failure responding to request") - } - } - return -} - -// DiskAccessesDeleteAPrivateEndpointConnectionFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type DiskAccessesDeleteAPrivateEndpointConnectionFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DiskAccessesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DiskAccessesDeleteAPrivateEndpointConnectionFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DiskAccessesDeleteAPrivateEndpointConnectionFuture.Result. -func (future *DiskAccessesDeleteAPrivateEndpointConnectionFuture) result(client DiskAccessesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskAccessesDeleteAPrivateEndpointConnectionFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.DiskAccessesDeleteAPrivateEndpointConnectionFuture") - return - } - ar.Response = future.Response() - return -} - -// DiskAccessesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type DiskAccessesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DiskAccessesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DiskAccessesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DiskAccessesDeleteFuture.Result. -func (future *DiskAccessesDeleteFuture) result(client DiskAccessesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskAccessesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.DiskAccessesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// DiskAccessesUpdateAPrivateEndpointConnectionFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type DiskAccessesUpdateAPrivateEndpointConnectionFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DiskAccessesClient) (PrivateEndpointConnection, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DiskAccessesUpdateAPrivateEndpointConnectionFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DiskAccessesUpdateAPrivateEndpointConnectionFuture.Result. -func (future *DiskAccessesUpdateAPrivateEndpointConnectionFuture) result(client DiskAccessesClient) (pec PrivateEndpointConnection, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskAccessesUpdateAPrivateEndpointConnectionFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - pec.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.DiskAccessesUpdateAPrivateEndpointConnectionFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if pec.Response.Response, err = future.GetResult(sender); err == nil && pec.Response.Response.StatusCode != http.StatusNoContent { - pec, err = client.UpdateAPrivateEndpointConnectionResponder(pec.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskAccessesUpdateAPrivateEndpointConnectionFuture", "Result", pec.Response.Response, "Failure responding to request") - } - } - return -} - -// DiskAccessesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type DiskAccessesUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DiskAccessesClient) (DiskAccess, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DiskAccessesUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DiskAccessesUpdateFuture.Result. -func (future *DiskAccessesUpdateFuture) result(client DiskAccessesClient) (da DiskAccess, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskAccessesUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - da.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.DiskAccessesUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if da.Response.Response, err = future.GetResult(sender); err == nil && da.Response.Response.StatusCode != http.StatusNoContent { - da, err = client.UpdateResponder(da.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskAccessesUpdateFuture", "Result", da.Response.Response, "Failure responding to request") - } - } - return -} - -// DiskAccessList the List disk access operation response. -type DiskAccessList struct { - autorest.Response `json:"-"` - // Value - A list of disk access resources. - Value *[]DiskAccess `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of disk access resources. Call ListNext() with this to fetch the next page of disk access resources. - NextLink *string `json:"nextLink,omitempty"` -} - -// DiskAccessListIterator provides access to a complete listing of DiskAccess values. -type DiskAccessListIterator struct { - i int - page DiskAccessListPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *DiskAccessListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskAccessListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *DiskAccessListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter DiskAccessListIterator) 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 DiskAccessListIterator) Response() DiskAccessList { - 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 DiskAccessListIterator) Value() DiskAccess { - if !iter.page.NotDone() { - return DiskAccess{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the DiskAccessListIterator type. -func NewDiskAccessListIterator(page DiskAccessListPage) DiskAccessListIterator { - return DiskAccessListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (dal DiskAccessList) IsEmpty() bool { - return dal.Value == nil || len(*dal.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (dal DiskAccessList) hasNextLink() bool { - return dal.NextLink != nil && len(*dal.NextLink) != 0 -} - -// diskAccessListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (dal DiskAccessList) diskAccessListPreparer(ctx context.Context) (*http.Request, error) { - if !dal.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(dal.NextLink))) -} - -// DiskAccessListPage contains a page of DiskAccess values. -type DiskAccessListPage struct { - fn func(context.Context, DiskAccessList) (DiskAccessList, error) - dal DiskAccessList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *DiskAccessListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskAccessListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.dal) - if err != nil { - return err - } - page.dal = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *DiskAccessListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page DiskAccessListPage) NotDone() bool { - return !page.dal.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page DiskAccessListPage) Response() DiskAccessList { - return page.dal -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page DiskAccessListPage) Values() []DiskAccess { - if page.dal.IsEmpty() { - return nil - } - return *page.dal.Value -} - -// Creates a new instance of the DiskAccessListPage type. -func NewDiskAccessListPage(cur DiskAccessList, getNextPage func(context.Context, DiskAccessList) (DiskAccessList, error)) DiskAccessListPage { - return DiskAccessListPage{ - fn: getNextPage, - dal: cur, - } -} - -// DiskAccessProperties ... -type DiskAccessProperties struct { - // PrivateEndpointConnections - READ-ONLY; A readonly collection of private endpoint connections created on the disk. Currently only one endpoint connection is supported. - PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` - // ProvisioningState - READ-ONLY; The disk access resource provisioning state. - ProvisioningState *string `json:"provisioningState,omitempty"` - // TimeCreated - READ-ONLY; The time when the disk access was created. - TimeCreated *date.Time `json:"timeCreated,omitempty"` -} - -// MarshalJSON is the custom marshaler for DiskAccessProperties. -func (dap DiskAccessProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// DiskAccessUpdate used for updating a disk access resource. -type DiskAccessUpdate struct { - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for DiskAccessUpdate. -func (dau DiskAccessUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dau.Tags != nil { - objectMap["tags"] = dau.Tags - } - return json.Marshal(objectMap) -} - -// DiskEncryptionSet disk encryption set resource. -type DiskEncryptionSet struct { - autorest.Response `json:"-"` - Identity *EncryptionSetIdentity `json:"identity,omitempty"` - *EncryptionSetProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; 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 DiskEncryptionSet. -func (desVar DiskEncryptionSet) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if desVar.Identity != nil { - objectMap["identity"] = desVar.Identity - } - if desVar.EncryptionSetProperties != nil { - objectMap["properties"] = desVar.EncryptionSetProperties - } - if desVar.Location != nil { - objectMap["location"] = desVar.Location - } - if desVar.Tags != nil { - objectMap["tags"] = desVar.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for DiskEncryptionSet struct. -func (desVar *DiskEncryptionSet) 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 EncryptionSetIdentity - err = json.Unmarshal(*v, &identity) - if err != nil { - return err - } - desVar.Identity = &identity - } - case "properties": - if v != nil { - var encryptionSetProperties EncryptionSetProperties - err = json.Unmarshal(*v, &encryptionSetProperties) - if err != nil { - return err - } - desVar.EncryptionSetProperties = &encryptionSetProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - desVar.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - desVar.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - desVar.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - desVar.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - desVar.Tags = tags - } - } - } - - return nil -} - -// DiskEncryptionSetList the List disk encryption set operation response. -type DiskEncryptionSetList struct { - autorest.Response `json:"-"` - // Value - A list of disk encryption sets. - Value *[]DiskEncryptionSet `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of disk encryption sets. Call ListNext() with this to fetch the next page of disk encryption sets. - NextLink *string `json:"nextLink,omitempty"` -} - -// DiskEncryptionSetListIterator provides access to a complete listing of DiskEncryptionSet values. -type DiskEncryptionSetListIterator struct { - i int - page DiskEncryptionSetListPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *DiskEncryptionSetListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *DiskEncryptionSetListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter DiskEncryptionSetListIterator) 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 DiskEncryptionSetListIterator) Response() DiskEncryptionSetList { - 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 DiskEncryptionSetListIterator) Value() DiskEncryptionSet { - if !iter.page.NotDone() { - return DiskEncryptionSet{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the DiskEncryptionSetListIterator type. -func NewDiskEncryptionSetListIterator(page DiskEncryptionSetListPage) DiskEncryptionSetListIterator { - return DiskEncryptionSetListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (desl DiskEncryptionSetList) IsEmpty() bool { - return desl.Value == nil || len(*desl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (desl DiskEncryptionSetList) hasNextLink() bool { - return desl.NextLink != nil && len(*desl.NextLink) != 0 -} - -// diskEncryptionSetListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (desl DiskEncryptionSetList) diskEncryptionSetListPreparer(ctx context.Context) (*http.Request, error) { - if !desl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(desl.NextLink))) -} - -// DiskEncryptionSetListPage contains a page of DiskEncryptionSet values. -type DiskEncryptionSetListPage struct { - fn func(context.Context, DiskEncryptionSetList) (DiskEncryptionSetList, error) - desl DiskEncryptionSetList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *DiskEncryptionSetListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.desl) - if err != nil { - return err - } - page.desl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *DiskEncryptionSetListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page DiskEncryptionSetListPage) NotDone() bool { - return !page.desl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page DiskEncryptionSetListPage) Response() DiskEncryptionSetList { - return page.desl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page DiskEncryptionSetListPage) Values() []DiskEncryptionSet { - if page.desl.IsEmpty() { - return nil - } - return *page.desl.Value -} - -// Creates a new instance of the DiskEncryptionSetListPage type. -func NewDiskEncryptionSetListPage(cur DiskEncryptionSetList, getNextPage func(context.Context, DiskEncryptionSetList) (DiskEncryptionSetList, error)) DiskEncryptionSetListPage { - return DiskEncryptionSetListPage{ - fn: getNextPage, - desl: cur, - } -} - -// DiskEncryptionSetParameters describes the parameter of customer managed disk encryption set resource id -// that can be specified for disk.

      NOTE: The disk encryption set resource id can only be specified -// for managed disk. Please refer https://aka.ms/mdssewithcmkoverview for more details. -type DiskEncryptionSetParameters struct { - // ID - Resource Id - ID *string `json:"id,omitempty"` -} - -// DiskEncryptionSetsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type DiskEncryptionSetsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DiskEncryptionSetsClient) (DiskEncryptionSet, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DiskEncryptionSetsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DiskEncryptionSetsCreateOrUpdateFuture.Result. -func (future *DiskEncryptionSetsCreateOrUpdateFuture) result(client DiskEncryptionSetsClient) (desVar DiskEncryptionSet, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - desVar.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.DiskEncryptionSetsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if desVar.Response.Response, err = future.GetResult(sender); err == nil && desVar.Response.Response.StatusCode != http.StatusNoContent { - desVar, err = client.CreateOrUpdateResponder(desVar.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsCreateOrUpdateFuture", "Result", desVar.Response.Response, "Failure responding to request") - } - } - return -} - -// DiskEncryptionSetsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type DiskEncryptionSetsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DiskEncryptionSetsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DiskEncryptionSetsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DiskEncryptionSetsDeleteFuture.Result. -func (future *DiskEncryptionSetsDeleteFuture) result(client DiskEncryptionSetsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.DiskEncryptionSetsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// DiskEncryptionSetsUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type DiskEncryptionSetsUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DiskEncryptionSetsClient) (DiskEncryptionSet, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DiskEncryptionSetsUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DiskEncryptionSetsUpdateFuture.Result. -func (future *DiskEncryptionSetsUpdateFuture) result(client DiskEncryptionSetsClient) (desVar DiskEncryptionSet, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - desVar.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.DiskEncryptionSetsUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if desVar.Response.Response, err = future.GetResult(sender); err == nil && desVar.Response.Response.StatusCode != http.StatusNoContent { - desVar, err = client.UpdateResponder(desVar.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsUpdateFuture", "Result", desVar.Response.Response, "Failure responding to request") - } - } - return -} - -// DiskEncryptionSettings describes a Encryption Settings for a Disk -type DiskEncryptionSettings struct { - // DiskEncryptionKey - Specifies the location of the disk encryption key, which is a Key Vault Secret. - DiskEncryptionKey *KeyVaultSecretReference `json:"diskEncryptionKey,omitempty"` - // KeyEncryptionKey - Specifies the location of the key encryption key in Key Vault. - KeyEncryptionKey *KeyVaultKeyReference `json:"keyEncryptionKey,omitempty"` - // Enabled - Specifies whether disk encryption should be enabled on the virtual machine. - Enabled *bool `json:"enabled,omitempty"` -} - -// DiskEncryptionSetUpdate disk encryption set update resource. -type DiskEncryptionSetUpdate struct { - *DiskEncryptionSetUpdateProperties `json:"properties,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` - Identity *EncryptionSetIdentity `json:"identity,omitempty"` -} - -// MarshalJSON is the custom marshaler for DiskEncryptionSetUpdate. -func (desu DiskEncryptionSetUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if desu.DiskEncryptionSetUpdateProperties != nil { - objectMap["properties"] = desu.DiskEncryptionSetUpdateProperties - } - if desu.Tags != nil { - objectMap["tags"] = desu.Tags - } - if desu.Identity != nil { - objectMap["identity"] = desu.Identity - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for DiskEncryptionSetUpdate struct. -func (desu *DiskEncryptionSetUpdate) 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 diskEncryptionSetUpdateProperties DiskEncryptionSetUpdateProperties - err = json.Unmarshal(*v, &diskEncryptionSetUpdateProperties) - if err != nil { - return err - } - desu.DiskEncryptionSetUpdateProperties = &diskEncryptionSetUpdateProperties - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - desu.Tags = tags - } - case "identity": - if v != nil { - var identity EncryptionSetIdentity - err = json.Unmarshal(*v, &identity) - if err != nil { - return err - } - desu.Identity = &identity - } - } - } - - return nil -} - -// DiskEncryptionSetUpdateProperties disk encryption set resource update properties. -type DiskEncryptionSetUpdateProperties struct { - // EncryptionType - Possible values include: 'EncryptionAtRestWithCustomerKey', 'EncryptionAtRestWithPlatformAndCustomerKeys', 'ConfidentialVMEncryptedWithCustomerKey' - EncryptionType DiskEncryptionSetType `json:"encryptionType,omitempty"` - ActiveKey *KeyForDiskEncryptionSet `json:"activeKey,omitempty"` - // RotationToLatestKeyVersionEnabled - Set this flag to true to enable auto-updating of this disk encryption set to the latest key version. - RotationToLatestKeyVersionEnabled *bool `json:"rotationToLatestKeyVersionEnabled,omitempty"` - // FederatedClientID - Multi-tenant application client id to access key vault in a different tenant. Setting the value to 'None' will clear the property. - FederatedClientID *string `json:"federatedClientId,omitempty"` -} - -// DiskImageEncryption this is the disk image encryption base class. -type DiskImageEncryption struct { - // DiskEncryptionSetID - A relative URI containing the resource ID of the disk encryption set. - DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` -} - -// DiskInstanceView the instance view of the disk. -type DiskInstanceView struct { - // Name - The disk name. - Name *string `json:"name,omitempty"` - // EncryptionSettings - Specifies the encryption settings for the OS Disk.

      Minimum api-version: 2015-06-15 - EncryptionSettings *[]DiskEncryptionSettings `json:"encryptionSettings,omitempty"` - // Statuses - The resource status information. - Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` -} - -// DiskList the List Disks operation response. -type DiskList struct { - autorest.Response `json:"-"` - // Value - A list of disks. - Value *[]Disk `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of disks. Call ListNext() with this to fetch the next page of disks. - NextLink *string `json:"nextLink,omitempty"` -} - -// DiskListIterator provides access to a complete listing of Disk values. -type DiskListIterator struct { - i int - page DiskListPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *DiskListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *DiskListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter DiskListIterator) 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 DiskListIterator) Response() DiskList { - 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 DiskListIterator) Value() Disk { - if !iter.page.NotDone() { - return Disk{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the DiskListIterator type. -func NewDiskListIterator(page DiskListPage) DiskListIterator { - return DiskListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (dl DiskList) IsEmpty() bool { - return dl.Value == nil || len(*dl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (dl DiskList) hasNextLink() bool { - return dl.NextLink != nil && len(*dl.NextLink) != 0 -} - -// diskListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (dl DiskList) diskListPreparer(ctx context.Context) (*http.Request, error) { - if !dl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(dl.NextLink))) -} - -// DiskListPage contains a page of Disk values. -type DiskListPage struct { - fn func(context.Context, DiskList) (DiskList, error) - dl DiskList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *DiskListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.dl) - if err != nil { - return err - } - page.dl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *DiskListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page DiskListPage) NotDone() bool { - return !page.dl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page DiskListPage) Response() DiskList { - return page.dl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page DiskListPage) Values() []Disk { - if page.dl.IsEmpty() { - return nil - } - return *page.dl.Value -} - -// Creates a new instance of the DiskListPage type. -func NewDiskListPage(cur DiskList, getNextPage func(context.Context, DiskList) (DiskList, error)) DiskListPage { - return DiskListPage{ - fn: getNextPage, - dl: cur, - } -} - -// DiskProperties disk resource properties. -type DiskProperties struct { - // TimeCreated - READ-ONLY; The time when the disk was created. - TimeCreated *date.Time `json:"timeCreated,omitempty"` - // OsType - The Operating System type. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' - OsType OperatingSystemTypes `json:"osType,omitempty"` - // HyperVGeneration - The hypervisor generation of the Virtual Machine. Applicable to OS disks only. Possible values include: 'V1', 'V2' - HyperVGeneration HyperVGeneration `json:"hyperVGeneration,omitempty"` - // PurchasePlan - Purchase plan information for the the image from which the OS disk was created. E.g. - {name: 2019-Datacenter, publisher: MicrosoftWindowsServer, product: WindowsServer} - PurchasePlan *PurchasePlan `json:"purchasePlan,omitempty"` - // SupportedCapabilities - List of supported capabilities for the image from which the OS disk was created. - SupportedCapabilities *SupportedCapabilities `json:"supportedCapabilities,omitempty"` - // CreationData - Disk source information. CreationData information cannot be changed after the disk has been created. - CreationData *CreationData `json:"creationData,omitempty"` - // DiskSizeGB - If creationData.createOption is Empty, this field is mandatory and it indicates the size of the disk to create. If this field is present for updates or creation with other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size. - DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` - // DiskSizeBytes - READ-ONLY; The size of the disk in bytes. This field is read only. - DiskSizeBytes *int64 `json:"diskSizeBytes,omitempty"` - // UniqueID - READ-ONLY; Unique Guid identifying the resource. - UniqueID *string `json:"uniqueId,omitempty"` - // EncryptionSettingsCollection - Encryption settings collection used for Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. - EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` - // ProvisioningState - READ-ONLY; The disk provisioning state. - ProvisioningState *string `json:"provisioningState,omitempty"` - // DiskIOPSReadWrite - The number of IOPS allowed for this disk; only settable for UltraSSD disks. One operation can transfer between 4k and 256k bytes. - DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` - // DiskMBpsReadWrite - The bandwidth allowed for this disk; only settable for UltraSSD disks. MBps means millions of bytes per second - MB here uses the ISO notation, of powers of 10. - DiskMBpsReadWrite *int64 `json:"diskMBpsReadWrite,omitempty"` - // DiskIOPSReadOnly - The total number of IOPS that will be allowed across all VMs mounting the shared disk as ReadOnly. One operation can transfer between 4k and 256k bytes. - DiskIOPSReadOnly *int64 `json:"diskIOPSReadOnly,omitempty"` - // DiskMBpsReadOnly - The total throughput (MBps) that will be allowed across all VMs mounting the shared disk as ReadOnly. MBps means millions of bytes per second - MB here uses the ISO notation, of powers of 10. - DiskMBpsReadOnly *int64 `json:"diskMBpsReadOnly,omitempty"` - // DiskState - The state of the disk. Possible values include: 'Unattached', 'Attached', 'Reserved', 'Frozen', 'ActiveSAS', 'ActiveSASFrozen', 'ReadyToUpload', 'ActiveUpload' - DiskState DiskState `json:"diskState,omitempty"` - // Encryption - Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. - Encryption *Encryption `json:"encryption,omitempty"` - // MaxShares - The maximum number of VMs that can attach to the disk at the same time. Value greater than one indicates a disk that can be mounted on multiple VMs at the same time. - MaxShares *int32 `json:"maxShares,omitempty"` - // ShareInfo - READ-ONLY; Details of the list of all VMs that have the disk attached. maxShares should be set to a value greater than one for disks to allow attaching them to multiple VMs. - ShareInfo *[]ShareInfoElement `json:"shareInfo,omitempty"` - // NetworkAccessPolicy - Possible values include: 'AllowAll', 'AllowPrivate', 'DenyAll' - NetworkAccessPolicy NetworkAccessPolicy `json:"networkAccessPolicy,omitempty"` - // DiskAccessID - ARM id of the DiskAccess resource for using private endpoints on disks. - DiskAccessID *string `json:"diskAccessId,omitempty"` - // BurstingEnabledTime - READ-ONLY; Latest time when bursting was last enabled on a disk. - BurstingEnabledTime *date.Time `json:"burstingEnabledTime,omitempty"` - // Tier - Performance tier of the disk (e.g, P4, S10) as described here: https://azure.microsoft.com/en-us/pricing/details/managed-disks/. Does not apply to Ultra disks. - Tier *string `json:"tier,omitempty"` - // BurstingEnabled - Set to true to enable bursting beyond the provisioned performance target of the disk. Bursting is disabled by default. Does not apply to Ultra disks. - BurstingEnabled *bool `json:"burstingEnabled,omitempty"` - // PropertyUpdatesInProgress - READ-ONLY; Properties of the disk for which update is pending. - PropertyUpdatesInProgress *PropertyUpdatesInProgress `json:"propertyUpdatesInProgress,omitempty"` - // SupportsHibernation - Indicates the OS on a disk supports hibernation. - SupportsHibernation *bool `json:"supportsHibernation,omitempty"` - // SecurityProfile - Contains the security related information for the resource. - SecurityProfile *DiskSecurityProfile `json:"securityProfile,omitempty"` - // CompletionPercent - Percentage complete for the background copy when a resource is created via the CopyStart operation. - CompletionPercent *float64 `json:"completionPercent,omitempty"` - // PublicNetworkAccess - Possible values include: 'Enabled', 'Disabled' - PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` - // DataAccessAuthMode - Possible values include: 'DataAccessAuthModeAzureActiveDirectory', 'DataAccessAuthModeNone' - DataAccessAuthMode DataAccessAuthMode `json:"dataAccessAuthMode,omitempty"` - // OptimizedForFrequentAttach - Setting this property to true improves reliability and performance of data disks that are frequently (more than 5 times a day) by detached from one virtual machine and attached to another. This property should not be set for disks that are not detached and attached frequently as it causes the disks to not align with the fault domain of the virtual machine. - OptimizedForFrequentAttach *bool `json:"optimizedForFrequentAttach,omitempty"` -} - -// MarshalJSON is the custom marshaler for DiskProperties. -func (dp DiskProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dp.OsType != "" { - objectMap["osType"] = dp.OsType - } - if dp.HyperVGeneration != "" { - objectMap["hyperVGeneration"] = dp.HyperVGeneration - } - if dp.PurchasePlan != nil { - objectMap["purchasePlan"] = dp.PurchasePlan - } - if dp.SupportedCapabilities != nil { - objectMap["supportedCapabilities"] = dp.SupportedCapabilities - } - if dp.CreationData != nil { - objectMap["creationData"] = dp.CreationData - } - if dp.DiskSizeGB != nil { - objectMap["diskSizeGB"] = dp.DiskSizeGB - } - if dp.EncryptionSettingsCollection != nil { - objectMap["encryptionSettingsCollection"] = dp.EncryptionSettingsCollection - } - if dp.DiskIOPSReadWrite != nil { - objectMap["diskIOPSReadWrite"] = dp.DiskIOPSReadWrite - } - if dp.DiskMBpsReadWrite != nil { - objectMap["diskMBpsReadWrite"] = dp.DiskMBpsReadWrite - } - if dp.DiskIOPSReadOnly != nil { - objectMap["diskIOPSReadOnly"] = dp.DiskIOPSReadOnly - } - if dp.DiskMBpsReadOnly != nil { - objectMap["diskMBpsReadOnly"] = dp.DiskMBpsReadOnly - } - if dp.DiskState != "" { - objectMap["diskState"] = dp.DiskState - } - if dp.Encryption != nil { - objectMap["encryption"] = dp.Encryption - } - if dp.MaxShares != nil { - objectMap["maxShares"] = dp.MaxShares - } - if dp.NetworkAccessPolicy != "" { - objectMap["networkAccessPolicy"] = dp.NetworkAccessPolicy - } - if dp.DiskAccessID != nil { - objectMap["diskAccessId"] = dp.DiskAccessID - } - if dp.Tier != nil { - objectMap["tier"] = dp.Tier - } - if dp.BurstingEnabled != nil { - objectMap["burstingEnabled"] = dp.BurstingEnabled - } - if dp.SupportsHibernation != nil { - objectMap["supportsHibernation"] = dp.SupportsHibernation - } - if dp.SecurityProfile != nil { - objectMap["securityProfile"] = dp.SecurityProfile - } - if dp.CompletionPercent != nil { - objectMap["completionPercent"] = dp.CompletionPercent - } - if dp.PublicNetworkAccess != "" { - objectMap["publicNetworkAccess"] = dp.PublicNetworkAccess - } - if dp.DataAccessAuthMode != "" { - objectMap["dataAccessAuthMode"] = dp.DataAccessAuthMode - } - if dp.OptimizedForFrequentAttach != nil { - objectMap["optimizedForFrequentAttach"] = dp.OptimizedForFrequentAttach - } - return json.Marshal(objectMap) -} - -// DiskRestorePoint properties of disk restore point -type DiskRestorePoint struct { - autorest.Response `json:"-"` - *DiskRestorePointProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for DiskRestorePoint. -func (drp DiskRestorePoint) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if drp.DiskRestorePointProperties != nil { - objectMap["properties"] = drp.DiskRestorePointProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for DiskRestorePoint struct. -func (drp *DiskRestorePoint) 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 diskRestorePointProperties DiskRestorePointProperties - err = json.Unmarshal(*v, &diskRestorePointProperties) - if err != nil { - return err - } - drp.DiskRestorePointProperties = &diskRestorePointProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - drp.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - drp.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - drp.Type = &typeVar - } - } - } - - return nil -} - -// DiskRestorePointGrantAccessFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type DiskRestorePointGrantAccessFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DiskRestorePointClient) (AccessURI, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DiskRestorePointGrantAccessFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DiskRestorePointGrantAccessFuture.Result. -func (future *DiskRestorePointGrantAccessFuture) result(client DiskRestorePointClient) (au AccessURI, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskRestorePointGrantAccessFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - au.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.DiskRestorePointGrantAccessFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if au.Response.Response, err = future.GetResult(sender); err == nil && au.Response.Response.StatusCode != http.StatusNoContent { - au, err = client.GrantAccessResponder(au.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskRestorePointGrantAccessFuture", "Result", au.Response.Response, "Failure responding to request") - } - } - return -} - -// DiskRestorePointInstanceView the instance view of a disk restore point. -type DiskRestorePointInstanceView struct { - // ID - Disk restore point Id. - ID *string `json:"id,omitempty"` - // ReplicationStatus - The disk restore point replication status information. - ReplicationStatus *DiskRestorePointReplicationStatus `json:"replicationStatus,omitempty"` -} - -// DiskRestorePointList the List Disk Restore Points operation response. -type DiskRestorePointList struct { - autorest.Response `json:"-"` - // Value - A list of disk restore points. - Value *[]DiskRestorePoint `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of disk restore points. Call ListNext() with this to fetch the next page of disk restore points. - NextLink *string `json:"nextLink,omitempty"` -} - -// DiskRestorePointListIterator provides access to a complete listing of DiskRestorePoint values. -type DiskRestorePointListIterator struct { - i int - page DiskRestorePointListPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *DiskRestorePointListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskRestorePointListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *DiskRestorePointListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter DiskRestorePointListIterator) 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 DiskRestorePointListIterator) Response() DiskRestorePointList { - 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 DiskRestorePointListIterator) Value() DiskRestorePoint { - if !iter.page.NotDone() { - return DiskRestorePoint{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the DiskRestorePointListIterator type. -func NewDiskRestorePointListIterator(page DiskRestorePointListPage) DiskRestorePointListIterator { - return DiskRestorePointListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (drpl DiskRestorePointList) IsEmpty() bool { - return drpl.Value == nil || len(*drpl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (drpl DiskRestorePointList) hasNextLink() bool { - return drpl.NextLink != nil && len(*drpl.NextLink) != 0 -} - -// diskRestorePointListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (drpl DiskRestorePointList) diskRestorePointListPreparer(ctx context.Context) (*http.Request, error) { - if !drpl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(drpl.NextLink))) -} - -// DiskRestorePointListPage contains a page of DiskRestorePoint values. -type DiskRestorePointListPage struct { - fn func(context.Context, DiskRestorePointList) (DiskRestorePointList, error) - drpl DiskRestorePointList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *DiskRestorePointListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskRestorePointListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.drpl) - if err != nil { - return err - } - page.drpl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *DiskRestorePointListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page DiskRestorePointListPage) NotDone() bool { - return !page.drpl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page DiskRestorePointListPage) Response() DiskRestorePointList { - return page.drpl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page DiskRestorePointListPage) Values() []DiskRestorePoint { - if page.drpl.IsEmpty() { - return nil - } - return *page.drpl.Value -} - -// Creates a new instance of the DiskRestorePointListPage type. -func NewDiskRestorePointListPage(cur DiskRestorePointList, getNextPage func(context.Context, DiskRestorePointList) (DiskRestorePointList, error)) DiskRestorePointListPage { - return DiskRestorePointListPage{ - fn: getNextPage, - drpl: cur, - } -} - -// DiskRestorePointProperties properties of an incremental disk restore point -type DiskRestorePointProperties struct { - // TimeCreated - READ-ONLY; The timestamp of restorePoint creation - TimeCreated *date.Time `json:"timeCreated,omitempty"` - // SourceResourceID - READ-ONLY; arm id of source disk or source disk restore point. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // OsType - READ-ONLY; The Operating System type. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' - OsType OperatingSystemTypes `json:"osType,omitempty"` - // HyperVGeneration - The hypervisor generation of the Virtual Machine. Applicable to OS disks only. Possible values include: 'V1', 'V2' - HyperVGeneration HyperVGeneration `json:"hyperVGeneration,omitempty"` - // PurchasePlan - Purchase plan information for the the image from which the OS disk was created. - PurchasePlan *PurchasePlan `json:"purchasePlan,omitempty"` - // SupportedCapabilities - List of supported capabilities for the image from which the OS disk was created. - SupportedCapabilities *SupportedCapabilities `json:"supportedCapabilities,omitempty"` - // FamilyID - READ-ONLY; id of the backing snapshot's MIS family - FamilyID *string `json:"familyId,omitempty"` - // SourceUniqueID - READ-ONLY; unique incarnation id of the source disk - SourceUniqueID *string `json:"sourceUniqueId,omitempty"` - // Encryption - READ-ONLY; Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. - Encryption *Encryption `json:"encryption,omitempty"` - // SupportsHibernation - Indicates the OS on a disk supports hibernation. - SupportsHibernation *bool `json:"supportsHibernation,omitempty"` - // NetworkAccessPolicy - Possible values include: 'AllowAll', 'AllowPrivate', 'DenyAll' - NetworkAccessPolicy NetworkAccessPolicy `json:"networkAccessPolicy,omitempty"` - // PublicNetworkAccess - Possible values include: 'Enabled', 'Disabled' - PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` - // DiskAccessID - ARM id of the DiskAccess resource for using private endpoints on disks. - DiskAccessID *string `json:"diskAccessId,omitempty"` - // CompletionPercent - Percentage complete for the background copy of disk restore point when source resource is from a different region. - CompletionPercent *float64 `json:"completionPercent,omitempty"` - // ReplicationState - READ-ONLY; Replication state of disk restore point when source resource is from a different region. - ReplicationState *string `json:"replicationState,omitempty"` - // SourceResourceLocation - READ-ONLY; Location of source disk or source disk restore point when source resource is from a different region. - SourceResourceLocation *string `json:"sourceResourceLocation,omitempty"` - // SecurityProfile - Contains the security related information for the resource. - SecurityProfile *DiskSecurityProfile `json:"securityProfile,omitempty"` -} - -// MarshalJSON is the custom marshaler for DiskRestorePointProperties. -func (drpp DiskRestorePointProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if drpp.HyperVGeneration != "" { - objectMap["hyperVGeneration"] = drpp.HyperVGeneration - } - if drpp.PurchasePlan != nil { - objectMap["purchasePlan"] = drpp.PurchasePlan - } - if drpp.SupportedCapabilities != nil { - objectMap["supportedCapabilities"] = drpp.SupportedCapabilities - } - if drpp.SupportsHibernation != nil { - objectMap["supportsHibernation"] = drpp.SupportsHibernation - } - if drpp.NetworkAccessPolicy != "" { - objectMap["networkAccessPolicy"] = drpp.NetworkAccessPolicy - } - if drpp.PublicNetworkAccess != "" { - objectMap["publicNetworkAccess"] = drpp.PublicNetworkAccess - } - if drpp.DiskAccessID != nil { - objectMap["diskAccessId"] = drpp.DiskAccessID - } - if drpp.CompletionPercent != nil { - objectMap["completionPercent"] = drpp.CompletionPercent - } - if drpp.SecurityProfile != nil { - objectMap["securityProfile"] = drpp.SecurityProfile - } - return json.Marshal(objectMap) -} - -// DiskRestorePointReplicationStatus the instance view of a disk restore point. -type DiskRestorePointReplicationStatus struct { - // Status - The resource status information. - Status *InstanceViewStatus `json:"status,omitempty"` - // CompletionPercent - Replication completion percentage. - CompletionPercent *int32 `json:"completionPercent,omitempty"` -} - -// DiskRestorePointRevokeAccessFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type DiskRestorePointRevokeAccessFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DiskRestorePointClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DiskRestorePointRevokeAccessFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DiskRestorePointRevokeAccessFuture.Result. -func (future *DiskRestorePointRevokeAccessFuture) result(client DiskRestorePointClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskRestorePointRevokeAccessFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.DiskRestorePointRevokeAccessFuture") - return - } - ar.Response = future.Response() - return -} - -// DisksCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type DisksCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DisksClient) (Disk, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DisksCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DisksCreateOrUpdateFuture.Result. -func (future *DisksCreateOrUpdateFuture) result(client DisksClient) (d Disk, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - d.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.DisksCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if d.Response.Response, err = future.GetResult(sender); err == nil && d.Response.Response.StatusCode != http.StatusNoContent { - d, err = client.CreateOrUpdateResponder(d.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksCreateOrUpdateFuture", "Result", d.Response.Response, "Failure responding to request") - } - } - return -} - -// DisksDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. -type DisksDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DisksClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DisksDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DisksDeleteFuture.Result. -func (future *DisksDeleteFuture) result(client DisksClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.DisksDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// DiskSecurityProfile contains the security related information for the resource. -type DiskSecurityProfile struct { - // SecurityType - Possible values include: 'TrustedLaunch', 'ConfidentialVMVMGuestStateOnlyEncryptedWithPlatformKey', 'ConfidentialVMDiskEncryptedWithPlatformKey', 'ConfidentialVMDiskEncryptedWithCustomerKey' - SecurityType DiskSecurityTypes `json:"securityType,omitempty"` - // SecureVMDiskEncryptionSetID - ResourceId of the disk encryption set associated to Confidential VM supported disk encrypted with customer managed key - SecureVMDiskEncryptionSetID *string `json:"secureVMDiskEncryptionSetId,omitempty"` -} - -// DisksGrantAccessFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type DisksGrantAccessFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DisksClient) (AccessURI, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DisksGrantAccessFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DisksGrantAccessFuture.Result. -func (future *DisksGrantAccessFuture) result(client DisksClient) (au AccessURI, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksGrantAccessFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - au.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.DisksGrantAccessFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if au.Response.Response, err = future.GetResult(sender); err == nil && au.Response.Response.StatusCode != http.StatusNoContent { - au, err = client.GrantAccessResponder(au.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksGrantAccessFuture", "Result", au.Response.Response, "Failure responding to request") - } - } - return -} - -// DiskSku the disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, UltraSSD_LRS, -// Premium_ZRS, StandardSSD_ZRS, or PremiumV2_LRS. -type DiskSku struct { - // Name - The sku name. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS', 'UltraSSDLRS', 'PremiumZRS', 'StandardSSDZRS', 'PremiumV2LRS' - Name DiskStorageAccountTypes `json:"name,omitempty"` - // Tier - READ-ONLY; The sku tier. - Tier *string `json:"tier,omitempty"` -} - -// MarshalJSON is the custom marshaler for DiskSku. -func (ds DiskSku) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ds.Name != "" { - objectMap["name"] = ds.Name - } - return json.Marshal(objectMap) -} - -// DisksRevokeAccessFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type DisksRevokeAccessFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DisksClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DisksRevokeAccessFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DisksRevokeAccessFuture.Result. -func (future *DisksRevokeAccessFuture) result(client DisksClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksRevokeAccessFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.DisksRevokeAccessFuture") - return - } - ar.Response = future.Response() - return -} - -// DisksUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. -type DisksUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DisksClient) (Disk, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DisksUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DisksUpdateFuture.Result. -func (future *DisksUpdateFuture) result(client DisksClient) (d Disk, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - d.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.DisksUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if d.Response.Response, err = future.GetResult(sender); err == nil && d.Response.Response.StatusCode != http.StatusNoContent { - d, err = client.UpdateResponder(d.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksUpdateFuture", "Result", d.Response.Response, "Failure responding to request") - } - } - return -} - -// DiskUpdate disk update resource. -type DiskUpdate struct { - *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. -type DiskUpdateProperties struct { - // OsType - the Operating System type. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' - OsType OperatingSystemTypes `json:"osType,omitempty"` - // DiskSizeGB - If creationData.createOption is Empty, this field is mandatory and it indicates the size of the disk to create. If this field is present for updates or creation with other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size. - DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` - // EncryptionSettingsCollection - Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. - EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` - // DiskIOPSReadWrite - The number of IOPS allowed for this disk; only settable for UltraSSD disks. One operation can transfer between 4k and 256k bytes. - DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` - // DiskMBpsReadWrite - The bandwidth allowed for this disk; only settable for UltraSSD disks. MBps means millions of bytes per second - MB here uses the ISO notation, of powers of 10. - DiskMBpsReadWrite *int64 `json:"diskMBpsReadWrite,omitempty"` - // DiskIOPSReadOnly - The total number of IOPS that will be allowed across all VMs mounting the shared disk as ReadOnly. One operation can transfer between 4k and 256k bytes. - DiskIOPSReadOnly *int64 `json:"diskIOPSReadOnly,omitempty"` - // DiskMBpsReadOnly - The total throughput (MBps) that will be allowed across all VMs mounting the shared disk as ReadOnly. MBps means millions of bytes per second - MB here uses the ISO notation, of powers of 10. - DiskMBpsReadOnly *int64 `json:"diskMBpsReadOnly,omitempty"` - // MaxShares - The maximum number of VMs that can attach to the disk at the same time. Value greater than one indicates a disk that can be mounted on multiple VMs at the same time. - MaxShares *int32 `json:"maxShares,omitempty"` - // Encryption - Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. - Encryption *Encryption `json:"encryption,omitempty"` - // NetworkAccessPolicy - Possible values include: 'AllowAll', 'AllowPrivate', 'DenyAll' - NetworkAccessPolicy NetworkAccessPolicy `json:"networkAccessPolicy,omitempty"` - // DiskAccessID - ARM id of the DiskAccess resource for using private endpoints on disks. - DiskAccessID *string `json:"diskAccessId,omitempty"` - // Tier - Performance tier of the disk (e.g, P4, S10) as described here: https://azure.microsoft.com/en-us/pricing/details/managed-disks/. Does not apply to Ultra disks. - Tier *string `json:"tier,omitempty"` - // BurstingEnabled - Set to true to enable bursting beyond the provisioned performance target of the disk. Bursting is disabled by default. Does not apply to Ultra disks. - BurstingEnabled *bool `json:"burstingEnabled,omitempty"` - // PurchasePlan - Purchase plan information to be added on the OS disk - PurchasePlan *PurchasePlan `json:"purchasePlan,omitempty"` - // SupportedCapabilities - List of supported capabilities to be added on the OS disk. - SupportedCapabilities *SupportedCapabilities `json:"supportedCapabilities,omitempty"` - // PropertyUpdatesInProgress - READ-ONLY; Properties of the disk for which update is pending. - PropertyUpdatesInProgress *PropertyUpdatesInProgress `json:"propertyUpdatesInProgress,omitempty"` - // SupportsHibernation - Indicates the OS on a disk supports hibernation. - SupportsHibernation *bool `json:"supportsHibernation,omitempty"` - // PublicNetworkAccess - Possible values include: 'Enabled', 'Disabled' - PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` - // DataAccessAuthMode - Possible values include: 'DataAccessAuthModeAzureActiveDirectory', 'DataAccessAuthModeNone' - DataAccessAuthMode DataAccessAuthMode `json:"dataAccessAuthMode,omitempty"` - // OptimizedForFrequentAttach - Setting this property to true improves reliability and performance of data disks that are frequently (more than 5 times a day) by detached from one virtual machine and attached to another. This property should not be set for disks that are not detached and attached frequently as it causes the disks to not align with the fault domain of the virtual machine. - OptimizedForFrequentAttach *bool `json:"optimizedForFrequentAttach,omitempty"` -} - -// MarshalJSON is the custom marshaler for DiskUpdateProperties. -func (dup DiskUpdateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dup.OsType != "" { - objectMap["osType"] = dup.OsType - } - if dup.DiskSizeGB != nil { - objectMap["diskSizeGB"] = dup.DiskSizeGB - } - if dup.EncryptionSettingsCollection != nil { - objectMap["encryptionSettingsCollection"] = dup.EncryptionSettingsCollection - } - if dup.DiskIOPSReadWrite != nil { - objectMap["diskIOPSReadWrite"] = dup.DiskIOPSReadWrite - } - if dup.DiskMBpsReadWrite != nil { - objectMap["diskMBpsReadWrite"] = dup.DiskMBpsReadWrite - } - if dup.DiskIOPSReadOnly != nil { - objectMap["diskIOPSReadOnly"] = dup.DiskIOPSReadOnly - } - if dup.DiskMBpsReadOnly != nil { - objectMap["diskMBpsReadOnly"] = dup.DiskMBpsReadOnly - } - if dup.MaxShares != nil { - objectMap["maxShares"] = dup.MaxShares - } - if dup.Encryption != nil { - objectMap["encryption"] = dup.Encryption - } - if dup.NetworkAccessPolicy != "" { - objectMap["networkAccessPolicy"] = dup.NetworkAccessPolicy - } - if dup.DiskAccessID != nil { - objectMap["diskAccessId"] = dup.DiskAccessID - } - if dup.Tier != nil { - objectMap["tier"] = dup.Tier - } - if dup.BurstingEnabled != nil { - objectMap["burstingEnabled"] = dup.BurstingEnabled - } - if dup.PurchasePlan != nil { - objectMap["purchasePlan"] = dup.PurchasePlan - } - if dup.SupportedCapabilities != nil { - objectMap["supportedCapabilities"] = dup.SupportedCapabilities - } - if dup.SupportsHibernation != nil { - objectMap["supportsHibernation"] = dup.SupportsHibernation - } - if dup.PublicNetworkAccess != "" { - objectMap["publicNetworkAccess"] = dup.PublicNetworkAccess - } - if dup.DataAccessAuthMode != "" { - objectMap["dataAccessAuthMode"] = dup.DataAccessAuthMode - } - if dup.OptimizedForFrequentAttach != nil { - objectMap["optimizedForFrequentAttach"] = dup.OptimizedForFrequentAttach - } - return json.Marshal(objectMap) -} - -// Encryption encryption at rest settings for disk or snapshot -type Encryption struct { - // DiskEncryptionSetID - ResourceId of the disk encryption set to use for enabling encryption at rest. - DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` - // Type - Possible values include: 'EncryptionTypeEncryptionAtRestWithPlatformKey', 'EncryptionTypeEncryptionAtRestWithCustomerKey', 'EncryptionTypeEncryptionAtRestWithPlatformAndCustomerKeys' - Type EncryptionType `json:"type,omitempty"` -} - -// EncryptionImages optional. Allows users to provide customer managed keys for encrypting the OS and data -// disks in the gallery artifact. -type EncryptionImages struct { - OsDiskImage *OSDiskImageEncryption `json:"osDiskImage,omitempty"` - // DataDiskImages - A list of encryption specifications for data disk images. - DataDiskImages *[]DataDiskImageEncryption `json:"dataDiskImages,omitempty"` -} - -// EncryptionSetIdentity the managed identity for the disk encryption set. It should be given permission on -// the key vault before it can be used to encrypt disks. -type EncryptionSetIdentity struct { - // Type - The type of Managed Identity used by the DiskEncryptionSet. Only SystemAssigned is supported for new creations. Disk Encryption Sets can be updated with Identity type None during migration of subscription to a new Azure Active Directory tenant; it will cause the encrypted resources to lose access to the keys. Possible values include: 'DiskEncryptionSetIdentityTypeSystemAssigned', 'DiskEncryptionSetIdentityTypeUserAssigned', 'DiskEncryptionSetIdentityTypeSystemAssignedUserAssigned', 'DiskEncryptionSetIdentityTypeNone' - Type DiskEncryptionSetIdentityType `json:"type,omitempty"` - // PrincipalID - READ-ONLY; The object id of the Managed Identity Resource. This will be sent to the RP from ARM via the x-ms-identity-principal-id header in the PUT request if the resource has a systemAssigned(implicit) identity - PrincipalID *string `json:"principalId,omitempty"` - // TenantID - READ-ONLY; The tenant id of the Managed Identity Resource. This will be sent to the RP from ARM via the x-ms-client-tenant-id header in the PUT request if the resource has a systemAssigned(implicit) identity - TenantID *string `json:"tenantId,omitempty"` - // UserAssignedIdentities - The list of user identities associated with the disk encryption set. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - UserAssignedIdentities map[string]*UserAssignedIdentitiesValue `json:"userAssignedIdentities"` -} - -// MarshalJSON is the custom marshaler for EncryptionSetIdentity. -func (esi EncryptionSetIdentity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if esi.Type != "" { - objectMap["type"] = esi.Type - } - if esi.UserAssignedIdentities != nil { - objectMap["userAssignedIdentities"] = esi.UserAssignedIdentities - } - return json.Marshal(objectMap) -} - -// EncryptionSetProperties ... -type EncryptionSetProperties struct { - // EncryptionType - Possible values include: 'EncryptionAtRestWithCustomerKey', 'EncryptionAtRestWithPlatformAndCustomerKeys', 'ConfidentialVMEncryptedWithCustomerKey' - EncryptionType DiskEncryptionSetType `json:"encryptionType,omitempty"` - // ActiveKey - The key vault key which is currently used by this disk encryption set. - ActiveKey *KeyForDiskEncryptionSet `json:"activeKey,omitempty"` - // PreviousKeys - READ-ONLY; A readonly collection of key vault keys previously used by this disk encryption set while a key rotation is in progress. It will be empty if there is no ongoing key rotation. - PreviousKeys *[]KeyForDiskEncryptionSet `json:"previousKeys,omitempty"` - // ProvisioningState - READ-ONLY; The disk encryption set provisioning state. - ProvisioningState *string `json:"provisioningState,omitempty"` - // RotationToLatestKeyVersionEnabled - Set this flag to true to enable auto-updating of this disk encryption set to the latest key version. - RotationToLatestKeyVersionEnabled *bool `json:"rotationToLatestKeyVersionEnabled,omitempty"` - // LastKeyRotationTimestamp - READ-ONLY; The time when the active key of this disk encryption set was updated. - LastKeyRotationTimestamp *date.Time `json:"lastKeyRotationTimestamp,omitempty"` - // AutoKeyRotationError - READ-ONLY; The error that was encountered during auto-key rotation. If an error is present, then auto-key rotation will not be attempted until the error on this disk encryption set is fixed. - AutoKeyRotationError *APIError `json:"autoKeyRotationError,omitempty"` - // FederatedClientID - Multi-tenant application client id to access key vault in a different tenant. Setting the value to 'None' will clear the property. - FederatedClientID *string `json:"federatedClientId,omitempty"` -} - -// MarshalJSON is the custom marshaler for EncryptionSetProperties. -func (esp EncryptionSetProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if esp.EncryptionType != "" { - objectMap["encryptionType"] = esp.EncryptionType - } - if esp.ActiveKey != nil { - objectMap["activeKey"] = esp.ActiveKey - } - if esp.RotationToLatestKeyVersionEnabled != nil { - objectMap["rotationToLatestKeyVersionEnabled"] = esp.RotationToLatestKeyVersionEnabled - } - if esp.FederatedClientID != nil { - objectMap["federatedClientId"] = esp.FederatedClientID - } - return json.Marshal(objectMap) -} - -// EncryptionSettingsCollection encryption settings for disk or snapshot -type EncryptionSettingsCollection struct { - // Enabled - Set this flag to true and provide DiskEncryptionKey and optional KeyEncryptionKey to enable encryption. Set this flag to false and remove DiskEncryptionKey and KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the request object, the existing settings remain unchanged. - Enabled *bool `json:"enabled,omitempty"` - // EncryptionSettings - A collection of encryption settings, one for each disk volume. - EncryptionSettings *[]EncryptionSettingsElement `json:"encryptionSettings,omitempty"` - // EncryptionSettingsVersion - Describes what type of encryption is used for the disks. Once this field is set, it cannot be overwritten. '1.0' corresponds to Azure Disk Encryption with AAD app.'1.1' corresponds to Azure Disk Encryption. - EncryptionSettingsVersion *string `json:"encryptionSettingsVersion,omitempty"` -} - -// EncryptionSettingsElement encryption settings for one disk volume. -type EncryptionSettingsElement struct { - // DiskEncryptionKey - Key Vault Secret Url and vault id of the disk encryption key - DiskEncryptionKey *KeyVaultAndSecretReference `json:"diskEncryptionKey,omitempty"` - // KeyEncryptionKey - Key Vault Key Url and vault id of the key encryption key. KeyEncryptionKey is optional and when provided is used to unwrap the disk encryption key. - KeyEncryptionKey *KeyVaultAndKeyReference `json:"keyEncryptionKey,omitempty"` -} - -// ExtendedLocation the complex type of the extended location. -type ExtendedLocation struct { - // Name - The name of the extended location. - Name *string `json:"name,omitempty"` - // Type - The type of the extended location. Possible values include: 'ExtendedLocationTypesEdgeZone' - Type ExtendedLocationTypes `json:"type,omitempty"` -} - -// Extension describes a cloud service Extension. -type Extension struct { - // Name - The name of the extension. - Name *string `json:"name,omitempty"` - Properties *CloudServiceExtensionProperties `json:"properties,omitempty"` -} - -// GalleriesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type GalleriesCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(GalleriesClient) (Gallery, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GalleriesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GalleriesCreateOrUpdateFuture.Result. -func (future *GalleriesCreateOrUpdateFuture) result(client GalleriesClient) (g Gallery, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - g.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.GalleriesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if g.Response.Response, err = future.GetResult(sender); err == nil && g.Response.Response.StatusCode != http.StatusNoContent { - g, err = client.CreateOrUpdateResponder(g.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesCreateOrUpdateFuture", "Result", g.Response.Response, "Failure responding to request") - } - } - return -} - -// GalleriesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type GalleriesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(GalleriesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GalleriesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GalleriesDeleteFuture.Result. -func (future *GalleriesDeleteFuture) result(client GalleriesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.GalleriesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// GalleriesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type GalleriesUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(GalleriesClient) (Gallery, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GalleriesUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GalleriesUpdateFuture.Result. -func (future *GalleriesUpdateFuture) result(client GalleriesClient) (g Gallery, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - g.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.GalleriesUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if g.Response.Response, err = future.GetResult(sender); err == nil && g.Response.Response.StatusCode != http.StatusNoContent { - g, err = client.UpdateResponder(g.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesUpdateFuture", "Result", g.Response.Response, "Failure responding to request") - } - } - return -} - -// Gallery specifies information about the Shared Image Gallery that you want to create or update. -type Gallery struct { - autorest.Response `json:"-"` - *GalleryProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; 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 Gallery. -func (g Gallery) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if g.GalleryProperties != nil { - objectMap["properties"] = g.GalleryProperties - } - if g.Location != nil { - objectMap["location"] = g.Location - } - if g.Tags != nil { - objectMap["tags"] = g.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Gallery struct. -func (g *Gallery) 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 galleryProperties GalleryProperties - err = json.Unmarshal(*v, &galleryProperties) - if err != nil { - return err - } - g.GalleryProperties = &galleryProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - g.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - g.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - g.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - g.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - g.Tags = tags - } - } - } - - return nil -} - -// GalleryApplication specifies information about the gallery Application Definition that you want to -// create or update. -type GalleryApplication struct { - autorest.Response `json:"-"` - *GalleryApplicationProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; 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 GalleryApplication. -func (ga GalleryApplication) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ga.GalleryApplicationProperties != nil { - objectMap["properties"] = ga.GalleryApplicationProperties - } - if ga.Location != nil { - objectMap["location"] = ga.Location - } - if ga.Tags != nil { - objectMap["tags"] = ga.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for GalleryApplication struct. -func (ga *GalleryApplication) 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 galleryApplicationProperties GalleryApplicationProperties - err = json.Unmarshal(*v, &galleryApplicationProperties) - if err != nil { - return err - } - ga.GalleryApplicationProperties = &galleryApplicationProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ga.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ga.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - ga.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - ga.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - ga.Tags = tags - } - } - } - - return nil -} - -// GalleryApplicationList the List Gallery Applications operation response. -type GalleryApplicationList struct { - autorest.Response `json:"-"` - // Value - A list of Gallery Applications. - Value *[]GalleryApplication `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of Application Definitions in the Application Gallery. Call ListNext() with this to fetch the next page of gallery Application Definitions. - NextLink *string `json:"nextLink,omitempty"` -} - -// GalleryApplicationListIterator provides access to a complete listing of GalleryApplication values. -type GalleryApplicationListIterator struct { - i int - page GalleryApplicationListPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *GalleryApplicationListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *GalleryApplicationListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter GalleryApplicationListIterator) 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 GalleryApplicationListIterator) Response() GalleryApplicationList { - 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 GalleryApplicationListIterator) Value() GalleryApplication { - if !iter.page.NotDone() { - return GalleryApplication{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the GalleryApplicationListIterator type. -func NewGalleryApplicationListIterator(page GalleryApplicationListPage) GalleryApplicationListIterator { - return GalleryApplicationListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (gal GalleryApplicationList) IsEmpty() bool { - return gal.Value == nil || len(*gal.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (gal GalleryApplicationList) hasNextLink() bool { - return gal.NextLink != nil && len(*gal.NextLink) != 0 -} - -// galleryApplicationListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (gal GalleryApplicationList) galleryApplicationListPreparer(ctx context.Context) (*http.Request, error) { - if !gal.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(gal.NextLink))) -} - -// GalleryApplicationListPage contains a page of GalleryApplication values. -type GalleryApplicationListPage struct { - fn func(context.Context, GalleryApplicationList) (GalleryApplicationList, error) - gal GalleryApplicationList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *GalleryApplicationListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.gal) - if err != nil { - return err - } - page.gal = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *GalleryApplicationListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page GalleryApplicationListPage) NotDone() bool { - return !page.gal.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page GalleryApplicationListPage) Response() GalleryApplicationList { - return page.gal -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page GalleryApplicationListPage) Values() []GalleryApplication { - if page.gal.IsEmpty() { - return nil - } - return *page.gal.Value -} - -// Creates a new instance of the GalleryApplicationListPage type. -func NewGalleryApplicationListPage(cur GalleryApplicationList, getNextPage func(context.Context, GalleryApplicationList) (GalleryApplicationList, error)) GalleryApplicationListPage { - return GalleryApplicationListPage{ - fn: getNextPage, - gal: cur, - } -} - -// GalleryApplicationProperties describes the properties of a gallery Application Definition. -type GalleryApplicationProperties struct { - // Description - The description of this gallery Application Definition resource. This property is updatable. - Description *string `json:"description,omitempty"` - // Eula - The Eula agreement for the gallery Application Definition. - Eula *string `json:"eula,omitempty"` - // PrivacyStatementURI - The privacy statement uri. - PrivacyStatementURI *string `json:"privacyStatementUri,omitempty"` - // ReleaseNoteURI - The release note uri. - ReleaseNoteURI *string `json:"releaseNoteUri,omitempty"` - // EndOfLifeDate - The end of life date of the gallery Application Definition. This property can be used for decommissioning purposes. This property is updatable. - EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` - // SupportedOSType - This property allows you to specify the supported type of the OS that application is built for.

      Possible values are:

      **Windows**

      **Linux**. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' - SupportedOSType OperatingSystemTypes `json:"supportedOSType,omitempty"` -} - -// GalleryApplicationsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type GalleryApplicationsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(GalleryApplicationsClient) (GalleryApplication, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GalleryApplicationsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GalleryApplicationsCreateOrUpdateFuture.Result. -func (future *GalleryApplicationsCreateOrUpdateFuture) result(client GalleryApplicationsClient) (ga GalleryApplication, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ga.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ga.Response.Response, err = future.GetResult(sender); err == nil && ga.Response.Response.StatusCode != http.StatusNoContent { - ga, err = client.CreateOrUpdateResponder(ga.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsCreateOrUpdateFuture", "Result", ga.Response.Response, "Failure responding to request") - } - } - return -} - -// GalleryApplicationsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type GalleryApplicationsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(GalleryApplicationsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GalleryApplicationsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GalleryApplicationsDeleteFuture.Result. -func (future *GalleryApplicationsDeleteFuture) result(client GalleryApplicationsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// GalleryApplicationsUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type GalleryApplicationsUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(GalleryApplicationsClient) (GalleryApplication, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GalleryApplicationsUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GalleryApplicationsUpdateFuture.Result. -func (future *GalleryApplicationsUpdateFuture) result(client GalleryApplicationsClient) (ga GalleryApplication, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ga.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationsUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ga.Response.Response, err = future.GetResult(sender); err == nil && ga.Response.Response.StatusCode != http.StatusNoContent { - ga, err = client.UpdateResponder(ga.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsUpdateFuture", "Result", ga.Response.Response, "Failure responding to request") - } - } - return -} - -// GalleryApplicationUpdate specifies information about the gallery Application Definition that you want to -// update. -type GalleryApplicationUpdate struct { - *GalleryApplicationProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for GalleryApplicationUpdate. -func (gau GalleryApplicationUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if gau.GalleryApplicationProperties != nil { - objectMap["properties"] = gau.GalleryApplicationProperties - } - if gau.Tags != nil { - objectMap["tags"] = gau.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for GalleryApplicationUpdate struct. -func (gau *GalleryApplicationUpdate) 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 galleryApplicationProperties GalleryApplicationProperties - err = json.Unmarshal(*v, &galleryApplicationProperties) - if err != nil { - return err - } - gau.GalleryApplicationProperties = &galleryApplicationProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - gau.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - gau.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - gau.Type = &typeVar - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - gau.Tags = tags - } - } - } - - return nil -} - -// GalleryApplicationVersion specifies information about the gallery Application Version that you want to -// create or update. -type GalleryApplicationVersion struct { - autorest.Response `json:"-"` - *GalleryApplicationVersionProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; 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 GalleryApplicationVersion. -func (gav GalleryApplicationVersion) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if gav.GalleryApplicationVersionProperties != nil { - objectMap["properties"] = gav.GalleryApplicationVersionProperties - } - if gav.Location != nil { - objectMap["location"] = gav.Location - } - if gav.Tags != nil { - objectMap["tags"] = gav.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for GalleryApplicationVersion struct. -func (gav *GalleryApplicationVersion) 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 galleryApplicationVersionProperties GalleryApplicationVersionProperties - err = json.Unmarshal(*v, &galleryApplicationVersionProperties) - if err != nil { - return err - } - gav.GalleryApplicationVersionProperties = &galleryApplicationVersionProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - gav.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - gav.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - gav.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - gav.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - gav.Tags = tags - } - } - } - - return nil -} - -// GalleryApplicationVersionList the List Gallery Application version operation response. -type GalleryApplicationVersionList struct { - autorest.Response `json:"-"` - // Value - A list of gallery Application Versions. - Value *[]GalleryApplicationVersion `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of gallery Application Versions. Call ListNext() with this to fetch the next page of gallery Application Versions. - NextLink *string `json:"nextLink,omitempty"` -} - -// GalleryApplicationVersionListIterator provides access to a complete listing of GalleryApplicationVersion -// values. -type GalleryApplicationVersionListIterator struct { - i int - page GalleryApplicationVersionListPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *GalleryApplicationVersionListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *GalleryApplicationVersionListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter GalleryApplicationVersionListIterator) 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 GalleryApplicationVersionListIterator) Response() GalleryApplicationVersionList { - 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 GalleryApplicationVersionListIterator) Value() GalleryApplicationVersion { - if !iter.page.NotDone() { - return GalleryApplicationVersion{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the GalleryApplicationVersionListIterator type. -func NewGalleryApplicationVersionListIterator(page GalleryApplicationVersionListPage) GalleryApplicationVersionListIterator { - return GalleryApplicationVersionListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (gavl GalleryApplicationVersionList) IsEmpty() bool { - return gavl.Value == nil || len(*gavl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (gavl GalleryApplicationVersionList) hasNextLink() bool { - return gavl.NextLink != nil && len(*gavl.NextLink) != 0 -} - -// galleryApplicationVersionListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (gavl GalleryApplicationVersionList) galleryApplicationVersionListPreparer(ctx context.Context) (*http.Request, error) { - if !gavl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(gavl.NextLink))) -} - -// GalleryApplicationVersionListPage contains a page of GalleryApplicationVersion values. -type GalleryApplicationVersionListPage struct { - fn func(context.Context, GalleryApplicationVersionList) (GalleryApplicationVersionList, error) - gavl GalleryApplicationVersionList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *GalleryApplicationVersionListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.gavl) - if err != nil { - return err - } - page.gavl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *GalleryApplicationVersionListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page GalleryApplicationVersionListPage) NotDone() bool { - return !page.gavl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page GalleryApplicationVersionListPage) Response() GalleryApplicationVersionList { - return page.gavl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page GalleryApplicationVersionListPage) Values() []GalleryApplicationVersion { - if page.gavl.IsEmpty() { - return nil - } - return *page.gavl.Value -} - -// Creates a new instance of the GalleryApplicationVersionListPage type. -func NewGalleryApplicationVersionListPage(cur GalleryApplicationVersionList, getNextPage func(context.Context, GalleryApplicationVersionList) (GalleryApplicationVersionList, error)) GalleryApplicationVersionListPage { - return GalleryApplicationVersionListPage{ - fn: getNextPage, - gavl: cur, - } -} - -// GalleryApplicationVersionProperties describes the properties of a gallery image version. -type GalleryApplicationVersionProperties struct { - PublishingProfile *GalleryApplicationVersionPublishingProfile `json:"publishingProfile,omitempty"` - // ProvisioningState - READ-ONLY; Possible values include: 'GalleryProvisioningStateCreating', 'GalleryProvisioningStateUpdating', 'GalleryProvisioningStateFailed', 'GalleryProvisioningStateSucceeded', 'GalleryProvisioningStateDeleting', 'GalleryProvisioningStateMigrating' - ProvisioningState GalleryProvisioningState `json:"provisioningState,omitempty"` - // ReplicationStatus - READ-ONLY - ReplicationStatus *ReplicationStatus `json:"replicationStatus,omitempty"` -} - -// MarshalJSON is the custom marshaler for GalleryApplicationVersionProperties. -func (gavp GalleryApplicationVersionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if gavp.PublishingProfile != nil { - objectMap["publishingProfile"] = gavp.PublishingProfile - } - return json.Marshal(objectMap) -} - -// GalleryApplicationVersionPublishingProfile the publishing profile of a gallery image version. -type GalleryApplicationVersionPublishingProfile struct { - Source *UserArtifactSource `json:"source,omitempty"` - ManageActions *UserArtifactManage `json:"manageActions,omitempty"` - Settings *UserArtifactSettings `json:"settings,omitempty"` - // AdvancedSettings - Optional. Additional settings to pass to the vm-application-manager extension. For advanced use only. - AdvancedSettings map[string]*string `json:"advancedSettings"` - // EnableHealthCheck - Optional. Whether or not this application reports health. - EnableHealthCheck *bool `json:"enableHealthCheck,omitempty"` - // TargetRegions - The target regions where the Image Version is going to be replicated to. This property is updatable. - TargetRegions *[]TargetRegion `json:"targetRegions,omitempty"` - // ReplicaCount - The number of replicas of the Image Version to be created per region. This property would take effect for a region when regionalReplicaCount is not specified. This property is updatable. - ReplicaCount *int32 `json:"replicaCount,omitempty"` - // ExcludeFromLatest - If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. - ExcludeFromLatest *bool `json:"excludeFromLatest,omitempty"` - // PublishedDate - READ-ONLY; The timestamp for when the gallery image version is published. - PublishedDate *date.Time `json:"publishedDate,omitempty"` - // EndOfLifeDate - The end of life date of the gallery image version. This property can be used for decommissioning purposes. This property is updatable. - EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` - // StorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable. Possible values include: 'StorageAccountTypeStandardLRS', 'StorageAccountTypeStandardZRS', 'StorageAccountTypePremiumLRS' - StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` - // ReplicationMode - Optional parameter which specifies the mode to be used for replication. This property is not updatable. Possible values include: 'Full', 'Shallow' - ReplicationMode ReplicationMode `json:"replicationMode,omitempty"` - // TargetExtendedLocations - The target extended locations where the Image Version is going to be replicated to. This property is updatable. - TargetExtendedLocations *[]GalleryTargetExtendedLocation `json:"targetExtendedLocations,omitempty"` -} - -// MarshalJSON is the custom marshaler for GalleryApplicationVersionPublishingProfile. -func (gavpp GalleryApplicationVersionPublishingProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if gavpp.Source != nil { - objectMap["source"] = gavpp.Source - } - if gavpp.ManageActions != nil { - objectMap["manageActions"] = gavpp.ManageActions - } - if gavpp.Settings != nil { - objectMap["settings"] = gavpp.Settings - } - if gavpp.AdvancedSettings != nil { - objectMap["advancedSettings"] = gavpp.AdvancedSettings - } - if gavpp.EnableHealthCheck != nil { - objectMap["enableHealthCheck"] = gavpp.EnableHealthCheck - } - if gavpp.TargetRegions != nil { - objectMap["targetRegions"] = gavpp.TargetRegions - } - if gavpp.ReplicaCount != nil { - objectMap["replicaCount"] = gavpp.ReplicaCount - } - if gavpp.ExcludeFromLatest != nil { - objectMap["excludeFromLatest"] = gavpp.ExcludeFromLatest - } - if gavpp.EndOfLifeDate != nil { - objectMap["endOfLifeDate"] = gavpp.EndOfLifeDate - } - if gavpp.StorageAccountType != "" { - objectMap["storageAccountType"] = gavpp.StorageAccountType - } - if gavpp.ReplicationMode != "" { - objectMap["replicationMode"] = gavpp.ReplicationMode - } - if gavpp.TargetExtendedLocations != nil { - objectMap["targetExtendedLocations"] = gavpp.TargetExtendedLocations - } - return json.Marshal(objectMap) -} - -// GalleryApplicationVersionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type GalleryApplicationVersionsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(GalleryApplicationVersionsClient) (GalleryApplicationVersion, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GalleryApplicationVersionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GalleryApplicationVersionsCreateOrUpdateFuture.Result. -func (future *GalleryApplicationVersionsCreateOrUpdateFuture) result(client GalleryApplicationVersionsClient) (gav GalleryApplicationVersion, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - gav.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationVersionsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if gav.Response.Response, err = future.GetResult(sender); err == nil && gav.Response.Response.StatusCode != http.StatusNoContent { - gav, err = client.CreateOrUpdateResponder(gav.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsCreateOrUpdateFuture", "Result", gav.Response.Response, "Failure responding to request") - } - } - return -} - -// GalleryApplicationVersionsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type GalleryApplicationVersionsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(GalleryApplicationVersionsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GalleryApplicationVersionsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GalleryApplicationVersionsDeleteFuture.Result. -func (future *GalleryApplicationVersionsDeleteFuture) result(client GalleryApplicationVersionsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationVersionsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// GalleryApplicationVersionsUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type GalleryApplicationVersionsUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(GalleryApplicationVersionsClient) (GalleryApplicationVersion, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GalleryApplicationVersionsUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GalleryApplicationVersionsUpdateFuture.Result. -func (future *GalleryApplicationVersionsUpdateFuture) result(client GalleryApplicationVersionsClient) (gav GalleryApplicationVersion, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - gav.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationVersionsUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if gav.Response.Response, err = future.GetResult(sender); err == nil && gav.Response.Response.StatusCode != http.StatusNoContent { - gav, err = client.UpdateResponder(gav.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsUpdateFuture", "Result", gav.Response.Response, "Failure responding to request") - } - } - return -} - -// GalleryApplicationVersionUpdate specifies information about the gallery Application Version that you -// want to update. -type GalleryApplicationVersionUpdate struct { - *GalleryApplicationVersionProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for GalleryApplicationVersionUpdate. -func (gavu GalleryApplicationVersionUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if gavu.GalleryApplicationVersionProperties != nil { - objectMap["properties"] = gavu.GalleryApplicationVersionProperties - } - if gavu.Tags != nil { - objectMap["tags"] = gavu.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for GalleryApplicationVersionUpdate struct. -func (gavu *GalleryApplicationVersionUpdate) 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 galleryApplicationVersionProperties GalleryApplicationVersionProperties - err = json.Unmarshal(*v, &galleryApplicationVersionProperties) - if err != nil { - return err - } - gavu.GalleryApplicationVersionProperties = &galleryApplicationVersionProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - gavu.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - gavu.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - gavu.Type = &typeVar - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - gavu.Tags = tags - } - } - } - - return nil -} - -// GalleryArtifactPublishingProfileBase describes the basic gallery artifact publishing profile. -type GalleryArtifactPublishingProfileBase struct { - // TargetRegions - The target regions where the Image Version is going to be replicated to. This property is updatable. - TargetRegions *[]TargetRegion `json:"targetRegions,omitempty"` - // ReplicaCount - The number of replicas of the Image Version to be created per region. This property would take effect for a region when regionalReplicaCount is not specified. This property is updatable. - ReplicaCount *int32 `json:"replicaCount,omitempty"` - // ExcludeFromLatest - If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. - ExcludeFromLatest *bool `json:"excludeFromLatest,omitempty"` - // PublishedDate - READ-ONLY; The timestamp for when the gallery image version is published. - PublishedDate *date.Time `json:"publishedDate,omitempty"` - // EndOfLifeDate - The end of life date of the gallery image version. This property can be used for decommissioning purposes. This property is updatable. - EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` - // StorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable. Possible values include: 'StorageAccountTypeStandardLRS', 'StorageAccountTypeStandardZRS', 'StorageAccountTypePremiumLRS' - StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` - // ReplicationMode - Optional parameter which specifies the mode to be used for replication. This property is not updatable. Possible values include: 'Full', 'Shallow' - ReplicationMode ReplicationMode `json:"replicationMode,omitempty"` - // TargetExtendedLocations - The target extended locations where the Image Version is going to be replicated to. This property is updatable. - TargetExtendedLocations *[]GalleryTargetExtendedLocation `json:"targetExtendedLocations,omitempty"` -} - -// MarshalJSON is the custom marshaler for GalleryArtifactPublishingProfileBase. -func (gappb GalleryArtifactPublishingProfileBase) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if gappb.TargetRegions != nil { - objectMap["targetRegions"] = gappb.TargetRegions - } - if gappb.ReplicaCount != nil { - objectMap["replicaCount"] = gappb.ReplicaCount - } - if gappb.ExcludeFromLatest != nil { - objectMap["excludeFromLatest"] = gappb.ExcludeFromLatest - } - if gappb.EndOfLifeDate != nil { - objectMap["endOfLifeDate"] = gappb.EndOfLifeDate - } - if gappb.StorageAccountType != "" { - objectMap["storageAccountType"] = gappb.StorageAccountType - } - if gappb.ReplicationMode != "" { - objectMap["replicationMode"] = gappb.ReplicationMode - } - if gappb.TargetExtendedLocations != nil { - objectMap["targetExtendedLocations"] = gappb.TargetExtendedLocations - } - return json.Marshal(objectMap) -} - -// GalleryArtifactSource the source image from which the Image Version is going to be created. -type GalleryArtifactSource struct { - ManagedImage *ManagedArtifact `json:"managedImage,omitempty"` -} - -// GalleryArtifactVersionSource the gallery artifact version source. -type GalleryArtifactVersionSource struct { - // ID - The id of the gallery artifact version source. Can specify a disk uri, snapshot uri, user image or storage account resource. - ID *string `json:"id,omitempty"` - // URI - The uri of the gallery artifact version source. Currently used to specify vhd/blob source. - URI *string `json:"uri,omitempty"` -} - -// GalleryDataDiskImage this is the data disk image. -type GalleryDataDiskImage struct { - // Lun - This property specifies the logical unit number of the data disk. This value is used to identify data disks within the Virtual Machine and therefore must be unique for each data disk attached to the Virtual Machine. - Lun *int32 `json:"lun,omitempty"` - // SizeInGB - READ-ONLY; This property indicates the size of the VHD to be created. - SizeInGB *int32 `json:"sizeInGB,omitempty"` - // HostCaching - The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'. Possible values include: 'HostCachingNone', 'HostCachingReadOnly', 'HostCachingReadWrite' - HostCaching HostCaching `json:"hostCaching,omitempty"` - Source *GalleryArtifactVersionSource `json:"source,omitempty"` -} - -// MarshalJSON is the custom marshaler for GalleryDataDiskImage. -func (gddi GalleryDataDiskImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if gddi.Lun != nil { - objectMap["lun"] = gddi.Lun - } - if gddi.HostCaching != "" { - objectMap["hostCaching"] = gddi.HostCaching - } - if gddi.Source != nil { - objectMap["source"] = gddi.Source - } - return json.Marshal(objectMap) -} - -// GalleryDiskImage this is the disk image base class. -type GalleryDiskImage struct { - // SizeInGB - READ-ONLY; This property indicates the size of the VHD to be created. - SizeInGB *int32 `json:"sizeInGB,omitempty"` - // HostCaching - The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'. Possible values include: 'HostCachingNone', 'HostCachingReadOnly', 'HostCachingReadWrite' - HostCaching HostCaching `json:"hostCaching,omitempty"` - Source *GalleryArtifactVersionSource `json:"source,omitempty"` -} - -// MarshalJSON is the custom marshaler for GalleryDiskImage. -func (gdi GalleryDiskImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if gdi.HostCaching != "" { - objectMap["hostCaching"] = gdi.HostCaching - } - if gdi.Source != nil { - objectMap["source"] = gdi.Source - } - return json.Marshal(objectMap) -} - -// GalleryExtendedLocation the name of the extended location. -type GalleryExtendedLocation struct { - Name *string `json:"name,omitempty"` - // Type - Possible values include: 'GalleryExtendedLocationTypeEdgeZone', 'GalleryExtendedLocationTypeUnknown' - Type GalleryExtendedLocationType `json:"type,omitempty"` -} - -// GalleryIdentifier describes the gallery unique name. -type GalleryIdentifier struct { - // UniqueName - READ-ONLY; The unique name of the Shared Image Gallery. This name is generated automatically by Azure. - UniqueName *string `json:"uniqueName,omitempty"` -} - -// MarshalJSON is the custom marshaler for GalleryIdentifier. -func (gi GalleryIdentifier) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// GalleryImage specifies information about the gallery image definition that you want to create or update. -type GalleryImage struct { - autorest.Response `json:"-"` - *GalleryImageProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; 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 GalleryImage. -func (gi GalleryImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if gi.GalleryImageProperties != nil { - objectMap["properties"] = gi.GalleryImageProperties - } - if gi.Location != nil { - objectMap["location"] = gi.Location - } - if gi.Tags != nil { - objectMap["tags"] = gi.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for GalleryImage struct. -func (gi *GalleryImage) 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 galleryImageProperties GalleryImageProperties - err = json.Unmarshal(*v, &galleryImageProperties) - if err != nil { - return err - } - gi.GalleryImageProperties = &galleryImageProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - gi.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - gi.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - gi.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - gi.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - gi.Tags = tags - } - } - } - - return nil -} - -// GalleryImageFeature a feature for gallery image. -type GalleryImageFeature struct { - // Name - The name of the gallery image feature. - Name *string `json:"name,omitempty"` - // Value - The value of the gallery image feature. - Value *string `json:"value,omitempty"` -} - -// GalleryImageIdentifier this is the gallery image definition identifier. -type GalleryImageIdentifier struct { - // Publisher - The name of the gallery image definition publisher. - Publisher *string `json:"publisher,omitempty"` - // Offer - The name of the gallery image definition offer. - Offer *string `json:"offer,omitempty"` - // Sku - The name of the gallery image definition SKU. - Sku *string `json:"sku,omitempty"` -} - -// GalleryImageList the List Gallery Images operation response. -type GalleryImageList struct { - autorest.Response `json:"-"` - // Value - A list of Shared Image Gallery images. - Value *[]GalleryImage `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of Image Definitions in the Shared Image Gallery. Call ListNext() with this to fetch the next page of gallery image definitions. - NextLink *string `json:"nextLink,omitempty"` -} - -// GalleryImageListIterator provides access to a complete listing of GalleryImage values. -type GalleryImageListIterator struct { - i int - page GalleryImageListPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *GalleryImageListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *GalleryImageListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter GalleryImageListIterator) 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 GalleryImageListIterator) Response() GalleryImageList { - 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 GalleryImageListIterator) Value() GalleryImage { - if !iter.page.NotDone() { - return GalleryImage{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the GalleryImageListIterator type. -func NewGalleryImageListIterator(page GalleryImageListPage) GalleryImageListIterator { - return GalleryImageListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (gil GalleryImageList) IsEmpty() bool { - return gil.Value == nil || len(*gil.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (gil GalleryImageList) hasNextLink() bool { - return gil.NextLink != nil && len(*gil.NextLink) != 0 -} - -// galleryImageListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (gil GalleryImageList) galleryImageListPreparer(ctx context.Context) (*http.Request, error) { - if !gil.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(gil.NextLink))) -} - -// GalleryImageListPage contains a page of GalleryImage values. -type GalleryImageListPage struct { - fn func(context.Context, GalleryImageList) (GalleryImageList, error) - gil GalleryImageList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *GalleryImageListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.gil) - if err != nil { - return err - } - page.gil = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *GalleryImageListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page GalleryImageListPage) NotDone() bool { - return !page.gil.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page GalleryImageListPage) Response() GalleryImageList { - return page.gil -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page GalleryImageListPage) Values() []GalleryImage { - if page.gil.IsEmpty() { - return nil - } - return *page.gil.Value -} - -// Creates a new instance of the GalleryImageListPage type. -func NewGalleryImageListPage(cur GalleryImageList, getNextPage func(context.Context, GalleryImageList) (GalleryImageList, error)) GalleryImageListPage { - return GalleryImageListPage{ - fn: getNextPage, - gil: cur, - } -} - -// GalleryImageProperties describes the properties of a gallery image definition. -type GalleryImageProperties struct { - // Description - The description of this gallery image definition resource. This property is updatable. - Description *string `json:"description,omitempty"` - // Eula - The Eula agreement for the gallery image definition. - Eula *string `json:"eula,omitempty"` - // PrivacyStatementURI - The privacy statement uri. - PrivacyStatementURI *string `json:"privacyStatementUri,omitempty"` - // ReleaseNoteURI - The release note uri. - ReleaseNoteURI *string `json:"releaseNoteUri,omitempty"` - // OsType - This property allows you to specify the type of the OS that is included in the disk when creating a VM from a managed image.

      Possible values are:

      **Windows**

      **Linux**. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' - OsType OperatingSystemTypes `json:"osType,omitempty"` - // OsState - This property allows the user to specify whether the virtual machines created under this image are 'Generalized' or 'Specialized'. Possible values include: 'Generalized', 'Specialized' - OsState OperatingSystemStateTypes `json:"osState,omitempty"` - // HyperVGeneration - The hypervisor generation of the Virtual Machine. Applicable to OS disks only. Possible values include: 'V1', 'V2' - HyperVGeneration HyperVGeneration `json:"hyperVGeneration,omitempty"` - // EndOfLifeDate - The end of life date of the gallery image definition. This property can be used for decommissioning purposes. This property is updatable. - EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` - Identifier *GalleryImageIdentifier `json:"identifier,omitempty"` - Recommended *RecommendedMachineConfiguration `json:"recommended,omitempty"` - Disallowed *Disallowed `json:"disallowed,omitempty"` - PurchasePlan *ImagePurchasePlan `json:"purchasePlan,omitempty"` - // ProvisioningState - READ-ONLY; Possible values include: 'GalleryProvisioningStateCreating', 'GalleryProvisioningStateUpdating', 'GalleryProvisioningStateFailed', 'GalleryProvisioningStateSucceeded', 'GalleryProvisioningStateDeleting', 'GalleryProvisioningStateMigrating' - ProvisioningState GalleryProvisioningState `json:"provisioningState,omitempty"` - // Features - A list of gallery image features. - Features *[]GalleryImageFeature `json:"features,omitempty"` - // Architecture - Possible values include: 'X64', 'Arm64' - Architecture Architecture `json:"architecture,omitempty"` -} - -// MarshalJSON is the custom marshaler for GalleryImageProperties. -func (gip GalleryImageProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if gip.Description != nil { - objectMap["description"] = gip.Description - } - if gip.Eula != nil { - objectMap["eula"] = gip.Eula - } - if gip.PrivacyStatementURI != nil { - objectMap["privacyStatementUri"] = gip.PrivacyStatementURI - } - if gip.ReleaseNoteURI != nil { - objectMap["releaseNoteUri"] = gip.ReleaseNoteURI - } - if gip.OsType != "" { - objectMap["osType"] = gip.OsType - } - if gip.OsState != "" { - objectMap["osState"] = gip.OsState - } - if gip.HyperVGeneration != "" { - objectMap["hyperVGeneration"] = gip.HyperVGeneration - } - if gip.EndOfLifeDate != nil { - objectMap["endOfLifeDate"] = gip.EndOfLifeDate - } - if gip.Identifier != nil { - objectMap["identifier"] = gip.Identifier - } - if gip.Recommended != nil { - objectMap["recommended"] = gip.Recommended - } - if gip.Disallowed != nil { - objectMap["disallowed"] = gip.Disallowed - } - if gip.PurchasePlan != nil { - objectMap["purchasePlan"] = gip.PurchasePlan - } - if gip.Features != nil { - objectMap["features"] = gip.Features - } - if gip.Architecture != "" { - objectMap["architecture"] = gip.Architecture - } - return json.Marshal(objectMap) -} - -// GalleryImagesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type GalleryImagesCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(GalleryImagesClient) (GalleryImage, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GalleryImagesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GalleryImagesCreateOrUpdateFuture.Result. -func (future *GalleryImagesCreateOrUpdateFuture) result(client GalleryImagesClient) (gi GalleryImage, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImagesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - gi.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.GalleryImagesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if gi.Response.Response, err = future.GetResult(sender); err == nil && gi.Response.Response.StatusCode != http.StatusNoContent { - gi, err = client.CreateOrUpdateResponder(gi.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImagesCreateOrUpdateFuture", "Result", gi.Response.Response, "Failure responding to request") - } - } - return -} - -// GalleryImagesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type GalleryImagesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(GalleryImagesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GalleryImagesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GalleryImagesDeleteFuture.Result. -func (future *GalleryImagesDeleteFuture) result(client GalleryImagesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImagesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.GalleryImagesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// GalleryImagesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type GalleryImagesUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(GalleryImagesClient) (GalleryImage, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GalleryImagesUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GalleryImagesUpdateFuture.Result. -func (future *GalleryImagesUpdateFuture) result(client GalleryImagesClient) (gi GalleryImage, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImagesUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - gi.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.GalleryImagesUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if gi.Response.Response, err = future.GetResult(sender); err == nil && gi.Response.Response.StatusCode != http.StatusNoContent { - gi, err = client.UpdateResponder(gi.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImagesUpdateFuture", "Result", gi.Response.Response, "Failure responding to request") - } - } - return -} - -// GalleryImageUpdate specifies information about the gallery image definition that you want to update. -type GalleryImageUpdate struct { - *GalleryImageProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for GalleryImageUpdate. -func (giu GalleryImageUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if giu.GalleryImageProperties != nil { - objectMap["properties"] = giu.GalleryImageProperties - } - if giu.Tags != nil { - objectMap["tags"] = giu.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for GalleryImageUpdate struct. -func (giu *GalleryImageUpdate) 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 galleryImageProperties GalleryImageProperties - err = json.Unmarshal(*v, &galleryImageProperties) - if err != nil { - return err - } - giu.GalleryImageProperties = &galleryImageProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - giu.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - giu.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - giu.Type = &typeVar - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - giu.Tags = tags - } - } - } - - return nil -} - -// GalleryImageVersion specifies information about the gallery image version that you want to create or -// update. -type GalleryImageVersion struct { - autorest.Response `json:"-"` - *GalleryImageVersionProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; 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 GalleryImageVersion. -func (giv GalleryImageVersion) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if giv.GalleryImageVersionProperties != nil { - objectMap["properties"] = giv.GalleryImageVersionProperties - } - if giv.Location != nil { - objectMap["location"] = giv.Location - } - if giv.Tags != nil { - objectMap["tags"] = giv.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for GalleryImageVersion struct. -func (giv *GalleryImageVersion) 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 galleryImageVersionProperties GalleryImageVersionProperties - err = json.Unmarshal(*v, &galleryImageVersionProperties) - if err != nil { - return err - } - giv.GalleryImageVersionProperties = &galleryImageVersionProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - giv.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - giv.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - giv.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - giv.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - giv.Tags = tags - } - } - } - - return nil -} - -// GalleryImageVersionList the List Gallery Image version operation response. -type GalleryImageVersionList struct { - autorest.Response `json:"-"` - // Value - A list of gallery image versions. - Value *[]GalleryImageVersion `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of gallery image versions. Call ListNext() with this to fetch the next page of gallery image versions. - NextLink *string `json:"nextLink,omitempty"` -} - -// GalleryImageVersionListIterator provides access to a complete listing of GalleryImageVersion values. -type GalleryImageVersionListIterator struct { - i int - page GalleryImageVersionListPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *GalleryImageVersionListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageVersionListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *GalleryImageVersionListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter GalleryImageVersionListIterator) 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 GalleryImageVersionListIterator) Response() GalleryImageVersionList { - 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 GalleryImageVersionListIterator) Value() GalleryImageVersion { - if !iter.page.NotDone() { - return GalleryImageVersion{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the GalleryImageVersionListIterator type. -func NewGalleryImageVersionListIterator(page GalleryImageVersionListPage) GalleryImageVersionListIterator { - return GalleryImageVersionListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (givl GalleryImageVersionList) IsEmpty() bool { - return givl.Value == nil || len(*givl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (givl GalleryImageVersionList) hasNextLink() bool { - return givl.NextLink != nil && len(*givl.NextLink) != 0 -} - -// galleryImageVersionListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (givl GalleryImageVersionList) galleryImageVersionListPreparer(ctx context.Context) (*http.Request, error) { - if !givl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(givl.NextLink))) -} - -// GalleryImageVersionListPage contains a page of GalleryImageVersion values. -type GalleryImageVersionListPage struct { - fn func(context.Context, GalleryImageVersionList) (GalleryImageVersionList, error) - givl GalleryImageVersionList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *GalleryImageVersionListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageVersionListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.givl) - if err != nil { - return err - } - page.givl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *GalleryImageVersionListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page GalleryImageVersionListPage) NotDone() bool { - return !page.givl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page GalleryImageVersionListPage) Response() GalleryImageVersionList { - return page.givl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page GalleryImageVersionListPage) Values() []GalleryImageVersion { - if page.givl.IsEmpty() { - return nil - } - return *page.givl.Value -} - -// Creates a new instance of the GalleryImageVersionListPage type. -func NewGalleryImageVersionListPage(cur GalleryImageVersionList, getNextPage func(context.Context, GalleryImageVersionList) (GalleryImageVersionList, error)) GalleryImageVersionListPage { - return GalleryImageVersionListPage{ - fn: getNextPage, - givl: cur, - } -} - -// GalleryImageVersionProperties describes the properties of a gallery image version. -type GalleryImageVersionProperties struct { - PublishingProfile *GalleryImageVersionPublishingProfile `json:"publishingProfile,omitempty"` - // ProvisioningState - READ-ONLY; Possible values include: 'GalleryProvisioningStateCreating', 'GalleryProvisioningStateUpdating', 'GalleryProvisioningStateFailed', 'GalleryProvisioningStateSucceeded', 'GalleryProvisioningStateDeleting', 'GalleryProvisioningStateMigrating' - ProvisioningState GalleryProvisioningState `json:"provisioningState,omitempty"` - StorageProfile *GalleryImageVersionStorageProfile `json:"storageProfile,omitempty"` - // ReplicationStatus - READ-ONLY - ReplicationStatus *ReplicationStatus `json:"replicationStatus,omitempty"` -} - -// MarshalJSON is the custom marshaler for GalleryImageVersionProperties. -func (givp GalleryImageVersionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if givp.PublishingProfile != nil { - objectMap["publishingProfile"] = givp.PublishingProfile - } - if givp.StorageProfile != nil { - objectMap["storageProfile"] = givp.StorageProfile - } - return json.Marshal(objectMap) -} - -// GalleryImageVersionPublishingProfile the publishing profile of a gallery image Version. -type GalleryImageVersionPublishingProfile struct { - // TargetRegions - The target regions where the Image Version is going to be replicated to. This property is updatable. - TargetRegions *[]TargetRegion `json:"targetRegions,omitempty"` - // ReplicaCount - The number of replicas of the Image Version to be created per region. This property would take effect for a region when regionalReplicaCount is not specified. This property is updatable. - ReplicaCount *int32 `json:"replicaCount,omitempty"` - // ExcludeFromLatest - If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. - ExcludeFromLatest *bool `json:"excludeFromLatest,omitempty"` - // PublishedDate - READ-ONLY; The timestamp for when the gallery image version is published. - PublishedDate *date.Time `json:"publishedDate,omitempty"` - // EndOfLifeDate - The end of life date of the gallery image version. This property can be used for decommissioning purposes. This property is updatable. - EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` - // StorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable. Possible values include: 'StorageAccountTypeStandardLRS', 'StorageAccountTypeStandardZRS', 'StorageAccountTypePremiumLRS' - StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` - // ReplicationMode - Optional parameter which specifies the mode to be used for replication. This property is not updatable. Possible values include: 'Full', 'Shallow' - ReplicationMode ReplicationMode `json:"replicationMode,omitempty"` - // TargetExtendedLocations - The target extended locations where the Image Version is going to be replicated to. This property is updatable. - TargetExtendedLocations *[]GalleryTargetExtendedLocation `json:"targetExtendedLocations,omitempty"` -} - -// MarshalJSON is the custom marshaler for GalleryImageVersionPublishingProfile. -func (givpp GalleryImageVersionPublishingProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if givpp.TargetRegions != nil { - objectMap["targetRegions"] = givpp.TargetRegions - } - if givpp.ReplicaCount != nil { - objectMap["replicaCount"] = givpp.ReplicaCount - } - if givpp.ExcludeFromLatest != nil { - objectMap["excludeFromLatest"] = givpp.ExcludeFromLatest - } - if givpp.EndOfLifeDate != nil { - objectMap["endOfLifeDate"] = givpp.EndOfLifeDate - } - if givpp.StorageAccountType != "" { - objectMap["storageAccountType"] = givpp.StorageAccountType - } - if givpp.ReplicationMode != "" { - objectMap["replicationMode"] = givpp.ReplicationMode - } - if givpp.TargetExtendedLocations != nil { - objectMap["targetExtendedLocations"] = givpp.TargetExtendedLocations - } - return json.Marshal(objectMap) -} - -// GalleryImageVersionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type GalleryImageVersionsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(GalleryImageVersionsClient) (GalleryImageVersion, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GalleryImageVersionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GalleryImageVersionsCreateOrUpdateFuture.Result. -func (future *GalleryImageVersionsCreateOrUpdateFuture) result(client GalleryImageVersionsClient) (giv GalleryImageVersion, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - giv.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.GalleryImageVersionsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if giv.Response.Response, err = future.GetResult(sender); err == nil && giv.Response.Response.StatusCode != http.StatusNoContent { - giv, err = client.CreateOrUpdateResponder(giv.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsCreateOrUpdateFuture", "Result", giv.Response.Response, "Failure responding to request") - } - } - return -} - -// GalleryImageVersionsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type GalleryImageVersionsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(GalleryImageVersionsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GalleryImageVersionsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GalleryImageVersionsDeleteFuture.Result. -func (future *GalleryImageVersionsDeleteFuture) result(client GalleryImageVersionsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.GalleryImageVersionsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// GalleryImageVersionStorageProfile this is the storage profile of a Gallery Image Version. -type GalleryImageVersionStorageProfile struct { - Source *GalleryArtifactVersionSource `json:"source,omitempty"` - OsDiskImage *GalleryOSDiskImage `json:"osDiskImage,omitempty"` - // DataDiskImages - A list of data disk images. - DataDiskImages *[]GalleryDataDiskImage `json:"dataDiskImages,omitempty"` -} - -// GalleryImageVersionsUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type GalleryImageVersionsUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(GalleryImageVersionsClient) (GalleryImageVersion, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GalleryImageVersionsUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GalleryImageVersionsUpdateFuture.Result. -func (future *GalleryImageVersionsUpdateFuture) result(client GalleryImageVersionsClient) (giv GalleryImageVersion, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - giv.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.GalleryImageVersionsUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if giv.Response.Response, err = future.GetResult(sender); err == nil && giv.Response.Response.StatusCode != http.StatusNoContent { - giv, err = client.UpdateResponder(giv.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsUpdateFuture", "Result", giv.Response.Response, "Failure responding to request") - } - } - return -} - -// GalleryImageVersionUpdate specifies information about the gallery image version that you want to update. -type GalleryImageVersionUpdate struct { - *GalleryImageVersionProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for GalleryImageVersionUpdate. -func (givu GalleryImageVersionUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if givu.GalleryImageVersionProperties != nil { - objectMap["properties"] = givu.GalleryImageVersionProperties - } - if givu.Tags != nil { - objectMap["tags"] = givu.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for GalleryImageVersionUpdate struct. -func (givu *GalleryImageVersionUpdate) 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 galleryImageVersionProperties GalleryImageVersionProperties - err = json.Unmarshal(*v, &galleryImageVersionProperties) - if err != nil { - return err - } - givu.GalleryImageVersionProperties = &galleryImageVersionProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - givu.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - givu.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - givu.Type = &typeVar - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - givu.Tags = tags - } - } - } - - return nil -} - -// GalleryList the List Galleries operation response. -type GalleryList struct { - autorest.Response `json:"-"` - // Value - A list of galleries. - Value *[]Gallery `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of galleries. Call ListNext() with this to fetch the next page of galleries. - NextLink *string `json:"nextLink,omitempty"` -} - -// GalleryListIterator provides access to a complete listing of Gallery values. -type GalleryListIterator struct { - i int - page GalleryListPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *GalleryListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *GalleryListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter GalleryListIterator) 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 GalleryListIterator) Response() GalleryList { - 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 GalleryListIterator) Value() Gallery { - if !iter.page.NotDone() { - return Gallery{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the GalleryListIterator type. -func NewGalleryListIterator(page GalleryListPage) GalleryListIterator { - return GalleryListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (gl GalleryList) IsEmpty() bool { - return gl.Value == nil || len(*gl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (gl GalleryList) hasNextLink() bool { - return gl.NextLink != nil && len(*gl.NextLink) != 0 -} - -// galleryListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (gl GalleryList) galleryListPreparer(ctx context.Context) (*http.Request, error) { - if !gl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(gl.NextLink))) -} - -// GalleryListPage contains a page of Gallery values. -type GalleryListPage struct { - fn func(context.Context, GalleryList) (GalleryList, error) - gl GalleryList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *GalleryListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.gl) - if err != nil { - return err - } - page.gl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *GalleryListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page GalleryListPage) NotDone() bool { - return !page.gl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page GalleryListPage) Response() GalleryList { - return page.gl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page GalleryListPage) Values() []Gallery { - if page.gl.IsEmpty() { - return nil - } - return *page.gl.Value -} - -// Creates a new instance of the GalleryListPage type. -func NewGalleryListPage(cur GalleryList, getNextPage func(context.Context, GalleryList) (GalleryList, error)) GalleryListPage { - return GalleryListPage{ - fn: getNextPage, - gl: cur, - } -} - -// GalleryOSDiskImage this is the OS disk image. -type GalleryOSDiskImage struct { - // SizeInGB - READ-ONLY; This property indicates the size of the VHD to be created. - SizeInGB *int32 `json:"sizeInGB,omitempty"` - // HostCaching - The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'. Possible values include: 'HostCachingNone', 'HostCachingReadOnly', 'HostCachingReadWrite' - HostCaching HostCaching `json:"hostCaching,omitempty"` - Source *GalleryArtifactVersionSource `json:"source,omitempty"` -} - -// MarshalJSON is the custom marshaler for GalleryOSDiskImage. -func (godi GalleryOSDiskImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if godi.HostCaching != "" { - objectMap["hostCaching"] = godi.HostCaching - } - if godi.Source != nil { - objectMap["source"] = godi.Source - } - return json.Marshal(objectMap) -} - -// GalleryProperties describes the properties of a Shared Image Gallery. -type GalleryProperties struct { - // Description - The description of this Shared Image Gallery resource. This property is updatable. - Description *string `json:"description,omitempty"` - Identifier *GalleryIdentifier `json:"identifier,omitempty"` - // ProvisioningState - READ-ONLY; Possible values include: 'GalleryProvisioningStateCreating', 'GalleryProvisioningStateUpdating', 'GalleryProvisioningStateFailed', 'GalleryProvisioningStateSucceeded', 'GalleryProvisioningStateDeleting', 'GalleryProvisioningStateMigrating' - ProvisioningState GalleryProvisioningState `json:"provisioningState,omitempty"` - SharingProfile *SharingProfile `json:"sharingProfile,omitempty"` - SoftDeletePolicy *SoftDeletePolicy `json:"softDeletePolicy,omitempty"` - // SharingStatus - READ-ONLY - SharingStatus *SharingStatus `json:"sharingStatus,omitempty"` -} - -// MarshalJSON is the custom marshaler for GalleryProperties. -func (gp GalleryProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if gp.Description != nil { - objectMap["description"] = gp.Description - } - if gp.Identifier != nil { - objectMap["identifier"] = gp.Identifier - } - if gp.SharingProfile != nil { - objectMap["sharingProfile"] = gp.SharingProfile - } - if gp.SoftDeletePolicy != nil { - objectMap["softDeletePolicy"] = gp.SoftDeletePolicy - } - return json.Marshal(objectMap) -} - -// GallerySharingProfileUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type GallerySharingProfileUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(GallerySharingProfileClient) (SharingUpdate, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GallerySharingProfileUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GallerySharingProfileUpdateFuture.Result. -func (future *GallerySharingProfileUpdateFuture) result(client GallerySharingProfileClient) (su SharingUpdate, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GallerySharingProfileUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - su.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.GallerySharingProfileUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if su.Response.Response, err = future.GetResult(sender); err == nil && su.Response.Response.StatusCode != http.StatusNoContent { - su, err = client.UpdateResponder(su.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GallerySharingProfileUpdateFuture", "Result", su.Response.Response, "Failure responding to request") - } - } - return -} - -// GalleryTargetExtendedLocation ... -type GalleryTargetExtendedLocation struct { - // Name - The name of the region. - Name *string `json:"name,omitempty"` - ExtendedLocation *GalleryExtendedLocation `json:"extendedLocation,omitempty"` - // ExtendedLocationReplicaCount - The number of replicas of the Image Version to be created per extended location. This property is updatable. - ExtendedLocationReplicaCount *int32 `json:"extendedLocationReplicaCount,omitempty"` - // StorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable. Possible values include: 'StorageAccountTypeStandardLRS', 'StorageAccountTypeStandardZRS', 'StorageAccountTypePremiumLRS' - StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` - Encryption *EncryptionImages `json:"encryption,omitempty"` -} - -// GalleryUpdate specifies information about the Shared Image Gallery that you want to update. -type GalleryUpdate struct { - *GalleryProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for GalleryUpdate. -func (gu GalleryUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if gu.GalleryProperties != nil { - objectMap["properties"] = gu.GalleryProperties - } - if gu.Tags != nil { - objectMap["tags"] = gu.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for GalleryUpdate struct. -func (gu *GalleryUpdate) 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 galleryProperties GalleryProperties - err = json.Unmarshal(*v, &galleryProperties) - if err != nil { - return err - } - gu.GalleryProperties = &galleryProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - gu.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - gu.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - gu.Type = &typeVar - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - gu.Tags = tags - } - } - } - - return nil -} - -// GrantAccessData data used for requesting a SAS. -type GrantAccessData struct { - // Access - Possible values include: 'None', 'Read', 'Write' - Access AccessLevel `json:"access,omitempty"` - // DurationInSeconds - Time duration in seconds until the SAS access expires. - DurationInSeconds *int32 `json:"durationInSeconds,omitempty"` - // GetSecureVMGuestStateSAS - Set this flag to true to get additional SAS for VM guest state - GetSecureVMGuestStateSAS *bool `json:"getSecureVMGuestStateSAS,omitempty"` -} - -// HardwareProfile specifies the hardware settings for the virtual machine. -type HardwareProfile struct { - // VMSize - Specifies the size of the virtual machine.

      The enum data type is currently deprecated and will be removed by December 23rd 2023.

      Recommended way to get the list of available sizes is using 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/resourceskus/list)

      [List all available virtual machine sizes for resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). For more information about virtual machine sizes, see [Sizes for virtual machines](https://docs.microsoft.com/azure/virtual-machines/sizes).

      The available VM sizes depend on region and availability set. Possible values include: 'BasicA0', 'BasicA1', 'BasicA2', 'BasicA3', 'BasicA4', 'StandardA0', 'StandardA1', 'StandardA2', 'StandardA3', 'StandardA4', 'StandardA5', 'StandardA6', 'StandardA7', 'StandardA8', 'StandardA9', 'StandardA10', 'StandardA11', 'StandardA1V2', 'StandardA2V2', 'StandardA4V2', 'StandardA8V2', 'StandardA2mV2', 'StandardA4mV2', 'StandardA8mV2', 'StandardB1s', 'StandardB1ms', 'StandardB2s', 'StandardB2ms', 'StandardB4ms', 'StandardB8ms', 'StandardD1', 'StandardD2', 'StandardD3', 'StandardD4', 'StandardD11', 'StandardD12', 'StandardD13', 'StandardD14', 'StandardD1V2', 'StandardD2V2', 'StandardD3V2', 'StandardD4V2', 'StandardD5V2', 'StandardD2V3', 'StandardD4V3', 'StandardD8V3', 'StandardD16V3', 'StandardD32V3', 'StandardD64V3', 'StandardD2sV3', 'StandardD4sV3', 'StandardD8sV3', 'StandardD16sV3', 'StandardD32sV3', 'StandardD64sV3', 'StandardD11V2', 'StandardD12V2', 'StandardD13V2', 'StandardD14V2', 'StandardD15V2', 'StandardDS1', 'StandardDS2', 'StandardDS3', 'StandardDS4', 'StandardDS11', 'StandardDS12', 'StandardDS13', 'StandardDS14', 'StandardDS1V2', 'StandardDS2V2', 'StandardDS3V2', 'StandardDS4V2', 'StandardDS5V2', 'StandardDS11V2', 'StandardDS12V2', 'StandardDS13V2', 'StandardDS14V2', 'StandardDS15V2', 'StandardDS134V2', 'StandardDS132V2', 'StandardDS148V2', 'StandardDS144V2', 'StandardE2V3', 'StandardE4V3', 'StandardE8V3', 'StandardE16V3', 'StandardE32V3', 'StandardE64V3', 'StandardE2sV3', 'StandardE4sV3', 'StandardE8sV3', 'StandardE16sV3', 'StandardE32sV3', 'StandardE64sV3', 'StandardE3216V3', 'StandardE328sV3', 'StandardE6432sV3', 'StandardE6416sV3', 'StandardF1', 'StandardF2', 'StandardF4', 'StandardF8', 'StandardF16', 'StandardF1s', 'StandardF2s', 'StandardF4s', 'StandardF8s', 'StandardF16s', 'StandardF2sV2', 'StandardF4sV2', 'StandardF8sV2', 'StandardF16sV2', 'StandardF32sV2', 'StandardF64sV2', 'StandardF72sV2', 'StandardG1', 'StandardG2', 'StandardG3', 'StandardG4', 'StandardG5', 'StandardGS1', 'StandardGS2', 'StandardGS3', 'StandardGS4', 'StandardGS5', 'StandardGS48', 'StandardGS44', 'StandardGS516', 'StandardGS58', 'StandardH8', 'StandardH16', 'StandardH8m', 'StandardH16m', 'StandardH16r', 'StandardH16mr', 'StandardL4s', 'StandardL8s', 'StandardL16s', 'StandardL32s', 'StandardM64s', 'StandardM64ms', 'StandardM128s', 'StandardM128ms', 'StandardM6432ms', 'StandardM6416ms', 'StandardM12864ms', 'StandardM12832ms', 'StandardNC6', 'StandardNC12', 'StandardNC24', 'StandardNC24r', 'StandardNC6sV2', 'StandardNC12sV2', 'StandardNC24sV2', 'StandardNC24rsV2', 'StandardNC6sV3', 'StandardNC12sV3', 'StandardNC24sV3', 'StandardNC24rsV3', 'StandardND6s', 'StandardND12s', 'StandardND24s', 'StandardND24rs', 'StandardNV6', 'StandardNV12', 'StandardNV24' - VMSize VirtualMachineSizeTypes `json:"vmSize,omitempty"` - // VMSizeProperties - Specifies the properties for customizing the size of the virtual machine. Minimum api-version: 2021-07-01.

      This feature is still in preview mode and is not supported for VirtualMachineScaleSet.

      Please follow the instructions in [VM Customization](https://aka.ms/vmcustomization) for more details. - VMSizeProperties *VMSizeProperties `json:"vmSizeProperties,omitempty"` -} - -// Image 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 Image struct { - autorest.Response `json:"-"` - *ImageProperties `json:"properties,omitempty"` - // ExtendedLocation - The extended location of the Image. - ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; 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 Image. -func (i Image) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if i.ImageProperties != nil { - objectMap["properties"] = i.ImageProperties - } - if i.ExtendedLocation != nil { - objectMap["extendedLocation"] = i.ExtendedLocation - } - 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 "extendedLocation": - if v != nil { - var extendedLocation ExtendedLocation - err = json.Unmarshal(*v, &extendedLocation) - if err != nil { - return err - } - i.ExtendedLocation = &extendedLocation - } - 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. -type ImageDataDisk struct { - // Lun - Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM. - Lun *int32 `json:"lun,omitempty"` - // Snapshot - The snapshot. - Snapshot *SubResource `json:"snapshot,omitempty"` - // ManagedDisk - The managedDisk. - ManagedDisk *SubResource `json:"managedDisk,omitempty"` - // BlobURI - The Virtual Hard Disk. - BlobURI *string `json:"blobUri,omitempty"` - // Caching - Specifies the caching requirements.

      Possible values are:

      **None**

      **ReadOnly**

      **ReadWrite**

      Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' - Caching CachingTypes `json:"caching,omitempty"` - // DiskSizeGB - Specifies the size of empty data disks in gigabytes. This element can be used to overwrite the name of the disk in a virtual machine image.

      This value cannot be larger than 1023 GB - DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` - // StorageAccountType - Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot be used with OS Disk. Possible values include: 'StorageAccountTypesStandardLRS', 'StorageAccountTypesPremiumLRS', 'StorageAccountTypesStandardSSDLRS', 'StorageAccountTypesUltraSSDLRS', 'StorageAccountTypesPremiumZRS', 'StorageAccountTypesStandardSSDZRS', 'StorageAccountTypesPremiumV2LRS' - StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` - // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed image disk. - DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` -} - -// ImageDisk describes a image disk. -type ImageDisk struct { - // Snapshot - The snapshot. - Snapshot *SubResource `json:"snapshot,omitempty"` - // ManagedDisk - The managedDisk. - ManagedDisk *SubResource `json:"managedDisk,omitempty"` - // BlobURI - The Virtual Hard Disk. - BlobURI *string `json:"blobUri,omitempty"` - // Caching - Specifies the caching requirements.

      Possible values are:

      **None**

      **ReadOnly**

      **ReadWrite**

      Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' - Caching CachingTypes `json:"caching,omitempty"` - // DiskSizeGB - Specifies the size of empty data disks in gigabytes. This element can be used to overwrite the name of the disk in a virtual machine image.

      This value cannot be larger than 1023 GB - DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` - // StorageAccountType - Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot be used with OS Disk. Possible values include: 'StorageAccountTypesStandardLRS', 'StorageAccountTypesPremiumLRS', 'StorageAccountTypesStandardSSDLRS', 'StorageAccountTypesUltraSSDLRS', 'StorageAccountTypesPremiumZRS', 'StorageAccountTypesStandardSSDZRS', 'StorageAccountTypesPremiumV2LRS' - StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` - // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed image disk. - DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` -} - -// ImageDiskReference the source image used for creating the disk. -type ImageDiskReference struct { - // ID - A relative uri containing either a Platform Image Repository, user image, or Azure Compute Gallery image reference. - ID *string `json:"id,omitempty"` - // SharedGalleryImageID - A relative uri containing a direct shared Azure Compute Gallery image reference. - SharedGalleryImageID *string `json:"sharedGalleryImageId,omitempty"` - // CommunityGalleryImageID - A relative uri containing a community Azure Compute Gallery image reference. - CommunityGalleryImageID *string `json:"communityGalleryImageId,omitempty"` - // Lun - If the disk is created from an image's data disk, this is an index that indicates which of the data disks in the image to use. For OS disks, this field is null. - Lun *int32 `json:"lun,omitempty"` -} - -// ImageListResult the List Image operation response. -type ImageListResult struct { - autorest.Response `json:"-"` - // Value - The list of Images. - Value *[]Image `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of Images. Call ListNext() with this to fetch the next page of Images. - NextLink *string `json:"nextLink,omitempty"` -} - -// ImageListResultIterator provides access to a complete listing of Image values. -type ImageListResultIterator struct { - i int - page ImageListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ImageListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ImageListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ImageListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ImageListResultIterator) 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 ImageListResultIterator) Response() ImageListResult { - 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 ImageListResultIterator) Value() Image { - if !iter.page.NotDone() { - return Image{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ImageListResultIterator type. -func NewImageListResultIterator(page ImageListResultPage) ImageListResultIterator { - return ImageListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (ilr ImageListResult) IsEmpty() bool { - return ilr.Value == nil || len(*ilr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (ilr ImageListResult) hasNextLink() bool { - return ilr.NextLink != nil && len(*ilr.NextLink) != 0 -} - -// imageListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (ilr ImageListResult) imageListResultPreparer(ctx context.Context) (*http.Request, error) { - if !ilr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(ilr.NextLink))) -} - -// ImageListResultPage contains a page of Image values. -type ImageListResultPage struct { - fn func(context.Context, ImageListResult) (ImageListResult, error) - ilr ImageListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ImageListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ImageListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.ilr) - if err != nil { - return err - } - page.ilr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ImageListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ImageListResultPage) NotDone() bool { - return !page.ilr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ImageListResultPage) Response() ImageListResult { - return page.ilr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ImageListResultPage) Values() []Image { - if page.ilr.IsEmpty() { - return nil - } - return *page.ilr.Value -} - -// Creates a new instance of the ImageListResultPage type. -func NewImageListResultPage(cur ImageListResult, getNextPage func(context.Context, ImageListResult) (ImageListResult, error)) ImageListResultPage { - return ImageListResultPage{ - fn: getNextPage, - ilr: cur, - } -} - -// ImageOSDisk describes an Operating System disk. -type ImageOSDisk struct { - // OsType - This property allows you to specify the type of the OS that is included in the disk if creating a VM from a custom image.

      Possible values are:

      **Windows**

      **Linux**. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' - OsType OperatingSystemTypes `json:"osType,omitempty"` - // OsState - The OS State. For managed images, use Generalized. Possible values include: 'Generalized', 'Specialized' - OsState OperatingSystemStateTypes `json:"osState,omitempty"` - // Snapshot - The snapshot. - Snapshot *SubResource `json:"snapshot,omitempty"` - // ManagedDisk - The managedDisk. - ManagedDisk *SubResource `json:"managedDisk,omitempty"` - // BlobURI - The Virtual Hard Disk. - BlobURI *string `json:"blobUri,omitempty"` - // Caching - Specifies the caching requirements.

      Possible values are:

      **None**

      **ReadOnly**

      **ReadWrite**

      Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' - Caching CachingTypes `json:"caching,omitempty"` - // DiskSizeGB - Specifies the size of empty data disks in gigabytes. This element can be used to overwrite the name of the disk in a virtual machine image.

      This value cannot be larger than 1023 GB - DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` - // StorageAccountType - Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot be used with OS Disk. Possible values include: 'StorageAccountTypesStandardLRS', 'StorageAccountTypesPremiumLRS', 'StorageAccountTypesStandardSSDLRS', 'StorageAccountTypesUltraSSDLRS', 'StorageAccountTypesPremiumZRS', 'StorageAccountTypesStandardSSDZRS', 'StorageAccountTypesPremiumV2LRS' - StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` - // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed image disk. - DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` -} - -// ImageProperties describes the properties of an Image. -type ImageProperties struct { - // SourceVirtualMachine - The source virtual machine from which Image is created. - SourceVirtualMachine *SubResource `json:"sourceVirtualMachine,omitempty"` - // StorageProfile - Specifies the storage settings for the virtual machine disks. - StorageProfile *ImageStorageProfile `json:"storageProfile,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state. - ProvisioningState *string `json:"provisioningState,omitempty"` - // HyperVGeneration - Specifies the HyperVGenerationType of the VirtualMachine created from the image. From API Version 2019-03-01 if the image source is a blob, then we need the user to specify the value, if the source is managed resource like disk or snapshot, we may require the user to specify the property if we cannot deduce it from the source managed resource. Possible values include: 'HyperVGenerationTypesV1', 'HyperVGenerationTypesV2' - HyperVGeneration HyperVGenerationTypes `json:"hyperVGeneration,omitempty"` -} - -// MarshalJSON is the custom marshaler for ImageProperties. -func (IP ImageProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if IP.SourceVirtualMachine != nil { - objectMap["sourceVirtualMachine"] = IP.SourceVirtualMachine - } - if IP.StorageProfile != nil { - objectMap["storageProfile"] = IP.StorageProfile - } - if IP.HyperVGeneration != "" { - objectMap["hyperVGeneration"] = IP.HyperVGeneration - } - return json.Marshal(objectMap) -} - -// ImagePurchasePlan describes the gallery image definition purchase plan. This is used by marketplace -// images. -type ImagePurchasePlan struct { - // Name - The plan ID. - Name *string `json:"name,omitempty"` - // Publisher - The publisher ID. - Publisher *string `json:"publisher,omitempty"` - // Product - The product ID. - Product *string `json:"product,omitempty"` -} - -// ImageReference specifies information about the image to use. You can specify information about platform -// images, 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. NOTE: Image reference publisher and offer can only be set when you create the scale set. -type ImageReference struct { - // 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. - Offer *string `json:"offer,omitempty"` - // Sku - The image SKU. - 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. Please do not use field 'version' for gallery image deployment, gallery image should always use 'id' field for deployment, to use 'latest' version of gallery image, just set '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageName}' in the 'id' field without version input. - Version *string `json:"version,omitempty"` - // ExactVersion - READ-ONLY; Specifies in decimal numbers, the version of platform image or marketplace image used to create the virtual machine. This readonly field differs from 'version', only if the value specified in 'version' field is 'latest'. - ExactVersion *string `json:"exactVersion,omitempty"` - // SharedGalleryImageID - Specified the shared gallery image unique id for vm deployment. This can be fetched from shared gallery image GET call. - SharedGalleryImageID *string `json:"sharedGalleryImageId,omitempty"` - // CommunityGalleryImageID - Specified the community gallery image unique id for vm deployment. This can be fetched from community gallery image GET call. - CommunityGalleryImageID *string `json:"communityGalleryImageId,omitempty"` - // ID - Resource Id - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ImageReference. -func (ir ImageReference) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ir.Publisher != nil { - objectMap["publisher"] = ir.Publisher - } - if ir.Offer != nil { - objectMap["offer"] = ir.Offer - } - if ir.Sku != nil { - objectMap["sku"] = ir.Sku - } - if ir.Version != nil { - objectMap["version"] = ir.Version - } - if ir.SharedGalleryImageID != nil { - objectMap["sharedGalleryImageId"] = ir.SharedGalleryImageID - } - if ir.CommunityGalleryImageID != nil { - objectMap["communityGalleryImageId"] = ir.CommunityGalleryImageID - } - if ir.ID != nil { - objectMap["id"] = ir.ID - } - return json.Marshal(objectMap) -} - -// ImagesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ImagesCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ImagesClient) (Image, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ImagesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ImagesCreateOrUpdateFuture.Result. -func (future *ImagesCreateOrUpdateFuture) result(client ImagesClient) (i Image, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - i.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.ImagesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if i.Response.Response, err = future.GetResult(sender); err == nil && i.Response.Response.StatusCode != http.StatusNoContent { - i, err = client.CreateOrUpdateResponder(i.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesCreateOrUpdateFuture", "Result", i.Response.Response, "Failure responding to request") - } - } - return -} - -// ImagesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. -type ImagesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ImagesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ImagesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ImagesDeleteFuture.Result. -func (future *ImagesDeleteFuture) result(client ImagesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.ImagesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// ImageStorageProfile describes a storage profile. -type ImageStorageProfile struct { - // 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/managed-disks-overview). - OsDisk *ImageOSDisk `json:"osDisk,omitempty"` - // DataDisks - Specifies the parameters that are used to add a data disk to a virtual machine.

      For more information about disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). - DataDisks *[]ImageDataDisk `json:"dataDisks,omitempty"` - // ZoneResilient - Specifies whether an image is zone resilient or not. Default is false. Zone resilient images can be created only in regions that provide Zone Redundant Storage (ZRS). - ZoneResilient *bool `json:"zoneResilient,omitempty"` -} - -// ImagesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. -type ImagesUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ImagesClient) (Image, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ImagesUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ImagesUpdateFuture.Result. -func (future *ImagesUpdateFuture) result(client ImagesClient) (i Image, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - i.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.ImagesUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if i.Response.Response, err = future.GetResult(sender); err == nil && i.Response.Response.StatusCode != http.StatusNoContent { - i, err = client.UpdateResponder(i.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesUpdateFuture", "Result", i.Response.Response, "Failure responding to request") - } - } - return -} - -// ImageUpdate the source user image virtual hard disk. Only tags may be updated. -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"` -} - -// InstanceSku the role instance SKU. -type InstanceSku struct { - // Name - READ-ONLY; The sku name. - Name *string `json:"name,omitempty"` - // Tier - READ-ONLY; The tier of the cloud service role instance. - Tier *string `json:"tier,omitempty"` -} - -// MarshalJSON is the custom marshaler for InstanceSku. -func (is InstanceSku) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// 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"` -} - -// InstanceViewStatusesSummary instance view statuses. -type InstanceViewStatusesSummary struct { - // StatusesSummary - READ-ONLY; The summary. - StatusesSummary *[]StatusCodeCount `json:"statusesSummary,omitempty"` -} - -// MarshalJSON is the custom marshaler for InstanceViewStatusesSummary. -func (ivss InstanceViewStatusesSummary) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// KeyForDiskEncryptionSet key Vault Key Url to be used for server side encryption of Managed Disks and -// Snapshots -type KeyForDiskEncryptionSet struct { - // SourceVault - Resource id of the KeyVault containing the key or secret. This property is optional and cannot be used if the KeyVault subscription is not the same as the Disk Encryption Set subscription. - SourceVault *SourceVault `json:"sourceVault,omitempty"` - // KeyURL - Fully versioned Key Url pointing to a key in KeyVault. Version segment of the Url is required regardless of rotationToLatestKeyVersionEnabled value. - KeyURL *string `json:"keyUrl,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 -type KeyVaultAndSecretReference struct { - // SourceVault - Resource id of the KeyVault containing the key or secret - SourceVault *SourceVault `json:"sourceVault,omitempty"` - // SecretURL - Url pointing to a key or secret in KeyVault - SecretURL *string `json:"secretUrl,omitempty"` -} - -// KeyVaultKeyReference describes a reference to Key Vault Key -type KeyVaultKeyReference struct { - // KeyURL - The URL referencing a key encryption key in Key Vault. - KeyURL *string `json:"keyUrl,omitempty"` - // SourceVault - The relative URL of the Key Vault containing the key. - SourceVault *SubResource `json:"sourceVault,omitempty"` -} - -// KeyVaultSecretReference describes a reference to Key Vault Secret -type KeyVaultSecretReference struct { - // SecretURL - The URL referencing a secret in a Key Vault. - SecretURL *string `json:"secretUrl,omitempty"` - // SourceVault - The relative URL of the Key Vault containing the secret. - SourceVault *SubResource `json:"sourceVault,omitempty"` -} - -// LastPatchInstallationSummary describes the properties of the last installed patch summary. -type LastPatchInstallationSummary struct { - // Status - READ-ONLY; The overall success or failure status of the operation. It remains "InProgress" until the operation completes. At that point it will become "Unknown", "Failed", "Succeeded", or "CompletedWithWarnings.". Possible values include: 'PatchOperationStatusUnknown', 'PatchOperationStatusInProgress', 'PatchOperationStatusFailed', 'PatchOperationStatusSucceeded', 'PatchOperationStatusCompletedWithWarnings' - Status PatchOperationStatus `json:"status,omitempty"` - // InstallationActivityID - READ-ONLY; The activity ID of the operation that produced this result. It is used to correlate across CRP and extension logs. - InstallationActivityID *string `json:"installationActivityId,omitempty"` - // MaintenanceWindowExceeded - READ-ONLY; Describes whether the operation ran out of time before it completed all its intended actions - MaintenanceWindowExceeded *bool `json:"maintenanceWindowExceeded,omitempty"` - // NotSelectedPatchCount - READ-ONLY; The number of all available patches but not going to be installed because it didn't match a classification or inclusion list entry. - NotSelectedPatchCount *int32 `json:"notSelectedPatchCount,omitempty"` - // ExcludedPatchCount - READ-ONLY; The number of all available patches but excluded explicitly by a customer-specified exclusion list match. - ExcludedPatchCount *int32 `json:"excludedPatchCount,omitempty"` - // PendingPatchCount - READ-ONLY; The number of all available patches expected to be installed over the course of the patch installation operation. - PendingPatchCount *int32 `json:"pendingPatchCount,omitempty"` - // InstalledPatchCount - READ-ONLY; The count of patches that successfully installed. - InstalledPatchCount *int32 `json:"installedPatchCount,omitempty"` - // FailedPatchCount - READ-ONLY; The count of patches that failed installation. - FailedPatchCount *int32 `json:"failedPatchCount,omitempty"` - // StartTime - READ-ONLY; The UTC timestamp when the operation began. - StartTime *date.Time `json:"startTime,omitempty"` - // LastModifiedTime - READ-ONLY; The UTC timestamp when the operation began. - LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` - // Error - READ-ONLY; The errors that were encountered during execution of the operation. The details array contains the list of them. - Error *APIError `json:"error,omitempty"` -} - -// MarshalJSON is the custom marshaler for LastPatchInstallationSummary. -func (lpis LastPatchInstallationSummary) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// LinuxConfiguration specifies the Linux operating system settings on the virtual machine.

      For a -// list of supported Linux distributions, see [Linux on Azure-Endorsed -// Distributions](https://docs.microsoft.com/azure/virtual-machines/linux/endorsed-distros). -type LinuxConfiguration struct { - // DisablePasswordAuthentication - Specifies whether password authentication should be disabled. - DisablePasswordAuthentication *bool `json:"disablePasswordAuthentication,omitempty"` - // SSH - Specifies the ssh key configuration for a Linux OS. - SSH *SSHConfiguration `json:"ssh,omitempty"` - // 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. - ProvisionVMAgent *bool `json:"provisionVMAgent,omitempty"` - // PatchSettings - [Preview Feature] Specifies settings related to VM Guest Patching on Linux. - PatchSettings *LinuxPatchSettings `json:"patchSettings,omitempty"` - // EnableVMAgentPlatformUpdates - Indicates whether VMAgent Platform Updates is enabled for the Linux virtual machine. Default value is false. - EnableVMAgentPlatformUpdates *bool `json:"enableVMAgentPlatformUpdates,omitempty"` -} - -// LinuxParameters input for InstallPatches on a Linux VM, as directly received by the API -type LinuxParameters struct { - // ClassificationsToInclude - The update classifications to select when installing patches for Linux. - ClassificationsToInclude *[]VMGuestPatchClassificationLinux `json:"classificationsToInclude,omitempty"` - // PackageNameMasksToInclude - packages to include in the patch operation. Format: packageName_packageVersion - PackageNameMasksToInclude *[]string `json:"packageNameMasksToInclude,omitempty"` - // PackageNameMasksToExclude - packages to exclude in the patch operation. Format: packageName_packageVersion - PackageNameMasksToExclude *[]string `json:"packageNameMasksToExclude,omitempty"` - // MaintenanceRunID - This is used as a maintenance run identifier for Auto VM Guest Patching in Linux. - MaintenanceRunID *string `json:"maintenanceRunId,omitempty"` -} - -// LinuxPatchSettings specifies settings related to VM Guest Patching on Linux. -type LinuxPatchSettings struct { - // PatchMode - Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual machines associated to virtual machine scale set with OrchestrationMode as Flexible.

      Possible values are:

      **ImageDefault** - The virtual machine's default patching configuration is used.

      **AutomaticByPlatform** - The virtual machine will be automatically updated by the platform. The property provisionVMAgent must be true. Possible values include: 'LinuxVMGuestPatchModeImageDefault', 'LinuxVMGuestPatchModeAutomaticByPlatform' - PatchMode LinuxVMGuestPatchMode `json:"patchMode,omitempty"` - // AssessmentMode - Specifies the mode of VM Guest Patch Assessment for the IaaS virtual machine.

      Possible values are:

      **ImageDefault** - You control the timing of patch assessments on a virtual machine.

      **AutomaticByPlatform** - The platform will trigger periodic patch assessments. The property provisionVMAgent must be true. Possible values include: 'ImageDefault', 'AutomaticByPlatform' - AssessmentMode LinuxPatchAssessmentMode `json:"assessmentMode,omitempty"` - // AutomaticByPlatformSettings - Specifies additional settings for patch mode AutomaticByPlatform in VM Guest Patching on Linux. - AutomaticByPlatformSettings *LinuxVMGuestPatchAutomaticByPlatformSettings `json:"automaticByPlatformSettings,omitempty"` -} - -// LinuxVMGuestPatchAutomaticByPlatformSettings specifies additional settings to be applied when patch mode -// AutomaticByPlatform is selected in Linux patch settings. -type LinuxVMGuestPatchAutomaticByPlatformSettings struct { - // RebootSetting - Specifies the reboot setting for all AutomaticByPlatform patch installation operations. Possible values include: 'LinuxVMGuestPatchAutomaticByPlatformRebootSettingUnknown', 'LinuxVMGuestPatchAutomaticByPlatformRebootSettingIfRequired', 'LinuxVMGuestPatchAutomaticByPlatformRebootSettingNever', 'LinuxVMGuestPatchAutomaticByPlatformRebootSettingAlways' - RebootSetting LinuxVMGuestPatchAutomaticByPlatformRebootSetting `json:"rebootSetting,omitempty"` -} - -// ListUsagesResult the List Usages operation response. -type ListUsagesResult struct { - autorest.Response `json:"-"` - // Value - The list of compute resource usages. - Value *[]Usage `json:"value,omitempty"` - // NextLink - The URI to fetch the next page of compute resource usage information. Call ListNext() with this to fetch the next page of compute resource usage information. - NextLink *string `json:"nextLink,omitempty"` -} - -// ListUsagesResultIterator provides access to a complete listing of Usage values. -type ListUsagesResultIterator struct { - i int - page ListUsagesResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ListUsagesResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListUsagesResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ListUsagesResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ListUsagesResultIterator) 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 ListUsagesResultIterator) Response() ListUsagesResult { - 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 ListUsagesResultIterator) Value() Usage { - if !iter.page.NotDone() { - return Usage{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ListUsagesResultIterator type. -func NewListUsagesResultIterator(page ListUsagesResultPage) ListUsagesResultIterator { - return ListUsagesResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (lur ListUsagesResult) IsEmpty() bool { - return lur.Value == nil || len(*lur.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (lur ListUsagesResult) hasNextLink() bool { - return lur.NextLink != nil && len(*lur.NextLink) != 0 -} - -// listUsagesResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (lur ListUsagesResult) listUsagesResultPreparer(ctx context.Context) (*http.Request, error) { - if !lur.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(lur.NextLink))) -} - -// ListUsagesResultPage contains a page of Usage values. -type ListUsagesResultPage struct { - fn func(context.Context, ListUsagesResult) (ListUsagesResult, error) - lur ListUsagesResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ListUsagesResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListUsagesResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.lur) - if err != nil { - return err - } - page.lur = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ListUsagesResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ListUsagesResultPage) NotDone() bool { - return !page.lur.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ListUsagesResultPage) Response() ListUsagesResult { - return page.lur -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ListUsagesResultPage) Values() []Usage { - if page.lur.IsEmpty() { - return nil - } - return *page.lur.Value -} - -// Creates a new instance of the ListUsagesResultPage type. -func NewListUsagesResultPage(cur ListUsagesResult, getNextPage func(context.Context, ListUsagesResult) (ListUsagesResult, error)) ListUsagesResultPage { - return ListUsagesResultPage{ - fn: getNextPage, - lur: cur, - } -} - -// ListVirtualMachineExtensionImage ... -type ListVirtualMachineExtensionImage struct { - autorest.Response `json:"-"` - Value *[]VirtualMachineExtensionImage `json:"value,omitempty"` -} - -// ListVirtualMachineImageResource ... -type ListVirtualMachineImageResource struct { - autorest.Response `json:"-"` - Value *[]VirtualMachineImageResource `json:"value,omitempty"` -} - -// LoadBalancerConfiguration describes the load balancer configuration. -type LoadBalancerConfiguration struct { - // ID - Resource Id - ID *string `json:"id,omitempty"` - // Name - The name of the Load balancer - Name *string `json:"name,omitempty"` - // Properties - Properties of the load balancer configuration. - Properties *LoadBalancerConfigurationProperties `json:"properties,omitempty"` -} - -// LoadBalancerConfigurationProperties describes the properties of the load balancer configuration. -type LoadBalancerConfigurationProperties struct { - // FrontendIPConfigurations - Specifies the frontend IP to be used for the load balancer. Only IPv4 frontend IP address is supported. Each load balancer configuration must have exactly one frontend IP configuration. - FrontendIPConfigurations *[]LoadBalancerFrontendIPConfiguration `json:"frontendIPConfigurations,omitempty"` -} - -// LoadBalancerFrontendIPConfiguration specifies the frontend IP to be used for the load balancer. Only -// IPv4 frontend IP address is supported. Each load balancer configuration must have exactly one frontend -// IP configuration. -type LoadBalancerFrontendIPConfiguration struct { - // Name - The name of the resource that is unique within the set of frontend IP configurations used by the load balancer. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Properties - Properties of load balancer frontend ip configuration. - Properties *LoadBalancerFrontendIPConfigurationProperties `json:"properties,omitempty"` -} - -// LoadBalancerFrontendIPConfigurationProperties describes a cloud service IP Configuration -type LoadBalancerFrontendIPConfigurationProperties struct { - // PublicIPAddress - The reference to the public ip address resource. - PublicIPAddress *SubResource `json:"publicIPAddress,omitempty"` - // Subnet - The reference to the virtual network subnet resource. - Subnet *SubResource `json:"subnet,omitempty"` - // PrivateIPAddress - The virtual network private IP address of the IP configuration. - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` -} - -// LogAnalyticsExportRequestRateByIntervalFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type LogAnalyticsExportRequestRateByIntervalFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(LogAnalyticsClient) (LogAnalyticsOperationResult, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *LogAnalyticsExportRequestRateByIntervalFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for LogAnalyticsExportRequestRateByIntervalFuture.Result. -func (future *LogAnalyticsExportRequestRateByIntervalFuture) result(client LogAnalyticsClient) (laor LogAnalyticsOperationResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportRequestRateByIntervalFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - laor.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.LogAnalyticsExportRequestRateByIntervalFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if laor.Response.Response, err = future.GetResult(sender); err == nil && laor.Response.Response.StatusCode != http.StatusNoContent { - laor, err = client.ExportRequestRateByIntervalResponder(laor.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportRequestRateByIntervalFuture", "Result", laor.Response.Response, "Failure responding to request") - } - } - return -} - -// LogAnalyticsExportThrottledRequestsFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type LogAnalyticsExportThrottledRequestsFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(LogAnalyticsClient) (LogAnalyticsOperationResult, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *LogAnalyticsExportThrottledRequestsFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for LogAnalyticsExportThrottledRequestsFuture.Result. -func (future *LogAnalyticsExportThrottledRequestsFuture) result(client LogAnalyticsClient) (laor LogAnalyticsOperationResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportThrottledRequestsFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - laor.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.LogAnalyticsExportThrottledRequestsFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if laor.Response.Response, err = future.GetResult(sender); err == nil && laor.Response.Response.StatusCode != http.StatusNoContent { - laor, err = client.ExportThrottledRequestsResponder(laor.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportThrottledRequestsFuture", "Result", laor.Response.Response, "Failure responding to request") - } - } - return -} - -// LogAnalyticsInputBase api input base class for LogAnalytics Api. -type LogAnalyticsInputBase struct { - // 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 - FromTime *date.Time `json:"fromTime,omitempty"` - // ToTime - To time of the query - ToTime *date.Time `json:"toTime,omitempty"` - // GroupByThrottlePolicy - Group query result by Throttle Policy applied. - GroupByThrottlePolicy *bool `json:"groupByThrottlePolicy,omitempty"` - // GroupByOperationName - Group query result by Operation Name. - GroupByOperationName *bool `json:"groupByOperationName,omitempty"` - // GroupByResourceName - Group query result by Resource Name. - GroupByResourceName *bool `json:"groupByResourceName,omitempty"` - // GroupByClientApplicationID - Group query result by Client Application ID. - GroupByClientApplicationID *bool `json:"groupByClientApplicationId,omitempty"` - // GroupByUserAgent - Group query result by User Agent. - GroupByUserAgent *bool `json:"groupByUserAgent,omitempty"` -} - -// LogAnalyticsOperationResult logAnalytics operation status response -type LogAnalyticsOperationResult struct { - autorest.Response `json:"-"` - // Properties - READ-ONLY; LogAnalyticsOutput - Properties *LogAnalyticsOutput `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for LogAnalyticsOperationResult. -func (laor LogAnalyticsOperationResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// LogAnalyticsOutput logAnalytics output properties -type LogAnalyticsOutput struct { - // Output - READ-ONLY; Output file Uri path to blob container. - Output *string `json:"output,omitempty"` -} - -// MarshalJSON is the custom marshaler for LogAnalyticsOutput. -func (lao LogAnalyticsOutput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// MaintenanceRedeployStatus maintenance Operation Status. -type MaintenanceRedeployStatus struct { - // IsCustomerInitiatedMaintenanceAllowed - True, if customer is allowed to perform Maintenance. - IsCustomerInitiatedMaintenanceAllowed *bool `json:"isCustomerInitiatedMaintenanceAllowed,omitempty"` - // PreMaintenanceWindowStartTime - Start Time for the Pre Maintenance Window. - PreMaintenanceWindowStartTime *date.Time `json:"preMaintenanceWindowStartTime,omitempty"` - // PreMaintenanceWindowEndTime - End Time for the Pre Maintenance Window. - PreMaintenanceWindowEndTime *date.Time `json:"preMaintenanceWindowEndTime,omitempty"` - // MaintenanceWindowStartTime - Start Time for the Maintenance Window. - MaintenanceWindowStartTime *date.Time `json:"maintenanceWindowStartTime,omitempty"` - // MaintenanceWindowEndTime - End Time for the Maintenance Window. - MaintenanceWindowEndTime *date.Time `json:"maintenanceWindowEndTime,omitempty"` - // LastOperationResultCode - The Last Maintenance Operation Result Code. Possible values include: 'MaintenanceOperationResultCodeTypesNone', 'MaintenanceOperationResultCodeTypesRetryLater', 'MaintenanceOperationResultCodeTypesMaintenanceAborted', 'MaintenanceOperationResultCodeTypesMaintenanceCompleted' - LastOperationResultCode MaintenanceOperationResultCodeTypes `json:"lastOperationResultCode,omitempty"` - // LastOperationMessage - Message returned for the last Maintenance Operation. - LastOperationMessage *string `json:"lastOperationMessage,omitempty"` -} - -// ManagedArtifact the managed artifact. -type ManagedArtifact struct { - // ID - The managed artifact id. - ID *string `json:"id,omitempty"` -} - -// ManagedDiskParameters the parameters of a managed disk. -type ManagedDiskParameters struct { - // StorageAccountType - Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot be used with OS Disk. Possible values include: 'StorageAccountTypesStandardLRS', 'StorageAccountTypesPremiumLRS', 'StorageAccountTypesStandardSSDLRS', 'StorageAccountTypesUltraSSDLRS', 'StorageAccountTypesPremiumZRS', 'StorageAccountTypesStandardSSDZRS', 'StorageAccountTypesPremiumV2LRS' - StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` - // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed disk. - DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` - // SecurityProfile - Specifies the security profile for the managed disk. - SecurityProfile *VMDiskSecurityProfile `json:"securityProfile,omitempty"` - // ID - Resource Id - ID *string `json:"id,omitempty"` -} - -// NetworkInterfaceReference describes a network interface reference. -type NetworkInterfaceReference struct { - *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. -type NetworkInterfaceReferenceProperties struct { - // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface. - Primary *bool `json:"primary,omitempty"` - // DeleteOption - Specify what happens to the network interface when the VM is deleted. Possible values include: 'Delete', 'Detach' - DeleteOption DeleteOptions `json:"deleteOption,omitempty"` -} - -// NetworkProfile specifies the network interfaces or the networking configuration of the virtual machine. -type NetworkProfile struct { - // NetworkInterfaces - Specifies the list of resource Ids for the network interfaces associated with the virtual machine. - NetworkInterfaces *[]NetworkInterfaceReference `json:"networkInterfaces,omitempty"` - // NetworkAPIVersion - specifies the Microsoft.Network API version used when creating networking resources in the Network Interface Configurations. Possible values include: 'TwoZeroTwoZeroHyphenMinusOneOneHyphenMinusZeroOne' - NetworkAPIVersion NetworkAPIVersion `json:"networkApiVersion,omitempty"` - // NetworkInterfaceConfigurations - Specifies the networking configurations that will be used to create the virtual machine networking resources. - NetworkInterfaceConfigurations *[]VirtualMachineNetworkInterfaceConfiguration `json:"networkInterfaceConfigurations,omitempty"` -} - -// OperationListResult the List Compute Operation operation response. -type OperationListResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; The list of compute operations - Value *[]OperationValue `json:"value,omitempty"` -} - -// MarshalJSON is the custom marshaler for OperationListResult. -func (olr OperationListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// OperationValue describes the properties of a Compute Operation value. -type OperationValue struct { - // Origin - READ-ONLY; The origin of the compute operation. - Origin *string `json:"origin,omitempty"` - // Name - READ-ONLY; 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.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 - READ-ONLY; The display name of the compute operation. - Operation *string `json:"operation,omitempty"` - // Resource - READ-ONLY; The display name of the resource the operation applies to. - Resource *string `json:"resource,omitempty"` - // Description - READ-ONLY; The description of the operation. - Description *string `json:"description,omitempty"` - // Provider - READ-ONLY; The resource provider for the operation. - Provider *string `json:"provider,omitempty"` -} - -// MarshalJSON is the custom marshaler for OperationValueDisplay. -func (ovd OperationValueDisplay) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// OrchestrationServiceStateInput the input for OrchestrationServiceState -type OrchestrationServiceStateInput struct { - // ServiceName - The name of the service. Possible values include: 'AutomaticRepairs' - ServiceName OrchestrationServiceNames `json:"serviceName,omitempty"` - // Action - The action to be performed. Possible values include: 'Resume', 'Suspend' - Action OrchestrationServiceStateAction `json:"action,omitempty"` -} - -// OrchestrationServiceSummary summary for an orchestration service of a virtual machine scale set. -type OrchestrationServiceSummary struct { - // ServiceName - READ-ONLY; The name of the service. Possible values include: 'AutomaticRepairs', 'DummyOrchestrationServiceName' - ServiceName OrchestrationServiceNames `json:"serviceName,omitempty"` - // ServiceState - READ-ONLY; The current state of the service. Possible values include: 'NotRunning', 'Running', 'Suspended' - ServiceState OrchestrationServiceState `json:"serviceState,omitempty"` -} - -// MarshalJSON is the custom marshaler for OrchestrationServiceSummary. -func (oss OrchestrationServiceSummary) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// 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/managed-disks-overview). -type OSDisk struct { - // OsType - This property allows you to specify the type of the OS that is included in the disk if creating a VM from user-image or a specialized VHD.

      Possible values are:

      **Windows**

      **Linux**. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' - OsType OperatingSystemTypes `json:"osType,omitempty"` - // EncryptionSettings - Specifies the encryption settings for the OS Disk.

      Minimum api-version: 2015-06-15 - EncryptionSettings *DiskEncryptionSettings `json:"encryptionSettings,omitempty"` - // Name - The disk name. - Name *string `json:"name,omitempty"` - // Vhd - The virtual hard disk. - Vhd *VirtualHardDisk `json:"vhd,omitempty"` - // Image - 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. - Image *VirtualHardDisk `json:"image,omitempty"` - // Caching - Specifies the caching requirements.

      Possible values are:

      **None**

      **ReadOnly**

      **ReadWrite**

      Default: **None** for Standard storage. **ReadOnly** for Premium storage. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' - Caching CachingTypes `json:"caching,omitempty"` - // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. - WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` - // DiffDiskSettings - Specifies the ephemeral Disk Settings for the operating system disk used by the virtual machine. - DiffDiskSettings *DiffDiskSettings `json:"diffDiskSettings,omitempty"` - // CreateOption - Specifies how the virtual machine should be created.

      Possible values are:

      **Attach** \u2013 This value is used when you are using a specialized disk to create the virtual machine.

      **FromImage** \u2013 This value is used when you are using an image to create the virtual machine. If you are using a platform image, you also use the imageReference element described above. If you are using a marketplace image, you also use the plan element previously described. Possible values include: 'DiskCreateOptionTypesFromImage', 'DiskCreateOptionTypesEmpty', 'DiskCreateOptionTypesAttach' - CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` - // DiskSizeGB - Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image.

      diskSizeGB is the number of bytes x 1024^3 for the disk and the value cannot be larger than 1023 - DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` - // ManagedDisk - The managed disk parameters. - ManagedDisk *ManagedDiskParameters `json:"managedDisk,omitempty"` - // DeleteOption - Specifies whether OS Disk should be deleted or detached upon VM deletion.

      Possible values:

      **Delete** If this value is used, the OS disk is deleted when VM is deleted.

      **Detach** If this value is used, the os disk is retained after VM is deleted.

      The default value is set to **detach**. For an ephemeral OS Disk, the default value is set to **Delete**. User cannot change the delete option for ephemeral OS Disk. Possible values include: 'DiskDeleteOptionTypesDelete', 'DiskDeleteOptionTypesDetach' - DeleteOption DiskDeleteOptionTypes `json:"deleteOption,omitempty"` -} - -// OSDiskImage contains the os disk image information. -type OSDiskImage struct { - // OperatingSystem - The operating system of the osDiskImage. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' - OperatingSystem OperatingSystemTypes `json:"operatingSystem,omitempty"` -} - -// OSDiskImageEncryption contains encryption settings for an OS disk image. -type OSDiskImageEncryption struct { - // SecurityProfile - This property specifies the security profile of an OS disk image. - SecurityProfile *OSDiskImageSecurityProfile `json:"securityProfile,omitempty"` - // DiskEncryptionSetID - A relative URI containing the resource ID of the disk encryption set. - DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` -} - -// OSDiskImageSecurityProfile contains security profile for an OS disk image. -type OSDiskImageSecurityProfile struct { - // ConfidentialVMEncryptionType - confidential VM encryption types. Possible values include: 'EncryptedVMGuestStateOnlyWithPmk', 'EncryptedWithPmk', 'EncryptedWithCmk' - ConfidentialVMEncryptionType ConfidentialVMEncryptionType `json:"confidentialVMEncryptionType,omitempty"` - // SecureVMDiskEncryptionSetID - secure VM disk encryption set id - SecureVMDiskEncryptionSetID *string `json:"secureVMDiskEncryptionSetId,omitempty"` -} - -// OSFamily describes a cloud service OS family. -type OSFamily struct { - autorest.Response `json:"-"` - // ID - READ-ONLY; Resource Id. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - READ-ONLY; Resource location. - Location *string `json:"location,omitempty"` - Properties *OSFamilyProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for OSFamily. -func (of OSFamily) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if of.Properties != nil { - objectMap["properties"] = of.Properties - } - return json.Marshal(objectMap) -} - -// OSFamilyListResult the list operation result. -type OSFamilyListResult struct { - autorest.Response `json:"-"` - // Value - The list of resources. - Value *[]OSFamily `json:"value,omitempty"` - // NextLink - The URI to fetch the next page of resources. Use this to get the next page of resources. Do this till nextLink is null to fetch all the resources. - NextLink *string `json:"nextLink,omitempty"` -} - -// OSFamilyListResultIterator provides access to a complete listing of OSFamily values. -type OSFamilyListResultIterator struct { - i int - page OSFamilyListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *OSFamilyListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/OSFamilyListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *OSFamilyListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter OSFamilyListResultIterator) 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 OSFamilyListResultIterator) Response() OSFamilyListResult { - 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 OSFamilyListResultIterator) Value() OSFamily { - if !iter.page.NotDone() { - return OSFamily{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the OSFamilyListResultIterator type. -func NewOSFamilyListResultIterator(page OSFamilyListResultPage) OSFamilyListResultIterator { - return OSFamilyListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (oflr OSFamilyListResult) IsEmpty() bool { - return oflr.Value == nil || len(*oflr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (oflr OSFamilyListResult) hasNextLink() bool { - return oflr.NextLink != nil && len(*oflr.NextLink) != 0 -} - -// oSFamilyListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (oflr OSFamilyListResult) oSFamilyListResultPreparer(ctx context.Context) (*http.Request, error) { - if !oflr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(oflr.NextLink))) -} - -// OSFamilyListResultPage contains a page of OSFamily values. -type OSFamilyListResultPage struct { - fn func(context.Context, OSFamilyListResult) (OSFamilyListResult, error) - oflr OSFamilyListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *OSFamilyListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/OSFamilyListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.oflr) - if err != nil { - return err - } - page.oflr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *OSFamilyListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page OSFamilyListResultPage) NotDone() bool { - return !page.oflr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page OSFamilyListResultPage) Response() OSFamilyListResult { - return page.oflr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page OSFamilyListResultPage) Values() []OSFamily { - if page.oflr.IsEmpty() { - return nil - } - return *page.oflr.Value -} - -// Creates a new instance of the OSFamilyListResultPage type. -func NewOSFamilyListResultPage(cur OSFamilyListResult, getNextPage func(context.Context, OSFamilyListResult) (OSFamilyListResult, error)) OSFamilyListResultPage { - return OSFamilyListResultPage{ - fn: getNextPage, - oflr: cur, - } -} - -// OSFamilyProperties OS family properties. -type OSFamilyProperties struct { - // Name - READ-ONLY; The OS family name. - Name *string `json:"name,omitempty"` - // Label - READ-ONLY; The OS family label. - Label *string `json:"label,omitempty"` - // Versions - READ-ONLY; List of OS versions belonging to this family. - Versions *[]OSVersionPropertiesBase `json:"versions,omitempty"` -} - -// MarshalJSON is the custom marshaler for OSFamilyProperties. -func (ofp OSFamilyProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// OSProfile specifies the operating system settings for the virtual machine. Some of the settings cannot -// be changed once VM is provisioned. -type OSProfile struct { - // ComputerName - Specifies the host OS name of the virtual machine.

      This name cannot be updated after the VM is created.

      **Max-length (Windows):** 15 characters

      **Max-length (Linux):** 64 characters.

      For naming conventions and restrictions see [Azure infrastructure services implementation guidelines](https://docs.microsoft.com/azure/azure-resource-manager/management/resource-name-rules). - ComputerName *string `json:"computerName,omitempty"` - // AdminUsername - Specifies the name of the administrator account.

      This property cannot be updated after the VM is created.

      **Windows-only restriction:** Cannot end in "."

      **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5".

      **Minimum-length (Linux):** 1 character

      **Max-length (Linux):** 64 characters

      **Max-length (Windows):** 20 characters. - AdminUsername *string `json:"adminUsername,omitempty"` - // AdminPassword - Specifies the password of the administrator account.

      **Minimum-length (Windows):** 8 characters

      **Minimum-length (Linux):** 6 characters

      **Max-length (Windows):** 123 characters

      **Max-length (Linux):** 72 characters

      **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled
      Has lower characters
      Has upper characters
      Has a digit
      Has a special character (Regex match [\W_])

      **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!"

      For resetting the password, see [How to reset the Remote Desktop service or its login password in a Windows VM](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/reset-rdp)

      For resetting root password, see [Manage users, SSH, and check or repair disks on Azure Linux VMs using the VMAccess Extension](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection) - AdminPassword *string `json:"adminPassword,omitempty"` - // CustomData - Specifies a base-64 encoded string of custom data. The base-64 encoded string is decoded to a binary array that is saved as a file on the Virtual Machine. The maximum length of the binary array is 65535 bytes.

      **Note: Do not pass any secrets or passwords in customData property**

      This property cannot be updated after the VM is created.

      customData is passed to the VM to be saved as a file, for more information see [Custom Data on Azure VMs](https://azure.microsoft.com/blog/custom-data-and-cloud-init-on-windows-azure/)

      For using cloud-init for your Linux VM, see [Using cloud-init to customize a Linux VM during creation](https://docs.microsoft.com/azure/virtual-machines/linux/using-cloud-init) - CustomData *string `json:"customData,omitempty"` - // WindowsConfiguration - Specifies Windows operating system settings on the virtual machine. - WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"` - // LinuxConfiguration - Specifies the Linux operating system settings on the virtual machine.

      For a list of supported Linux distributions, see [Linux on Azure-Endorsed Distributions](https://docs.microsoft.com/azure/virtual-machines/linux/endorsed-distros). - LinuxConfiguration *LinuxConfiguration `json:"linuxConfiguration,omitempty"` - // Secrets - Specifies set of certificates that should be installed onto the virtual machine. To install certificates on a virtual machine it is recommended to use the [Azure Key Vault virtual machine extension for Linux](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux) or the [Azure Key Vault virtual machine extension for Windows](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows). - Secrets *[]VaultSecretGroup `json:"secrets,omitempty"` - // AllowExtensionOperations - Specifies whether extension operations should be allowed on the virtual machine.

      This may only be set to False when no extensions are present on the virtual machine. - AllowExtensionOperations *bool `json:"allowExtensionOperations,omitempty"` - // RequireGuestProvisionSignal - Optional property which must either be set to True or omitted. - RequireGuestProvisionSignal *bool `json:"requireGuestProvisionSignal,omitempty"` -} - -// OSVersion describes a cloud service OS version. -type OSVersion struct { - autorest.Response `json:"-"` - // ID - READ-ONLY; Resource Id. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - READ-ONLY; Resource location. - Location *string `json:"location,omitempty"` - Properties *OSVersionProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for OSVersion. -func (ov OSVersion) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ov.Properties != nil { - objectMap["properties"] = ov.Properties - } - return json.Marshal(objectMap) -} - -// OSVersionListResult the list operation result. -type OSVersionListResult struct { - autorest.Response `json:"-"` - // Value - The list of resources. - Value *[]OSVersion `json:"value,omitempty"` - // NextLink - The URI to fetch the next page of resources. Use this to get the next page of resources. Do this till nextLink is null to fetch all the resources. - NextLink *string `json:"nextLink,omitempty"` -} - -// OSVersionListResultIterator provides access to a complete listing of OSVersion values. -type OSVersionListResultIterator struct { - i int - page OSVersionListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *OSVersionListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/OSVersionListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *OSVersionListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter OSVersionListResultIterator) 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 OSVersionListResultIterator) Response() OSVersionListResult { - 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 OSVersionListResultIterator) Value() OSVersion { - if !iter.page.NotDone() { - return OSVersion{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the OSVersionListResultIterator type. -func NewOSVersionListResultIterator(page OSVersionListResultPage) OSVersionListResultIterator { - return OSVersionListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (ovlr OSVersionListResult) IsEmpty() bool { - return ovlr.Value == nil || len(*ovlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (ovlr OSVersionListResult) hasNextLink() bool { - return ovlr.NextLink != nil && len(*ovlr.NextLink) != 0 -} - -// oSVersionListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (ovlr OSVersionListResult) oSVersionListResultPreparer(ctx context.Context) (*http.Request, error) { - if !ovlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(ovlr.NextLink))) -} - -// OSVersionListResultPage contains a page of OSVersion values. -type OSVersionListResultPage struct { - fn func(context.Context, OSVersionListResult) (OSVersionListResult, error) - ovlr OSVersionListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *OSVersionListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/OSVersionListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.ovlr) - if err != nil { - return err - } - page.ovlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *OSVersionListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page OSVersionListResultPage) NotDone() bool { - return !page.ovlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page OSVersionListResultPage) Response() OSVersionListResult { - return page.ovlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page OSVersionListResultPage) Values() []OSVersion { - if page.ovlr.IsEmpty() { - return nil - } - return *page.ovlr.Value -} - -// Creates a new instance of the OSVersionListResultPage type. -func NewOSVersionListResultPage(cur OSVersionListResult, getNextPage func(context.Context, OSVersionListResult) (OSVersionListResult, error)) OSVersionListResultPage { - return OSVersionListResultPage{ - fn: getNextPage, - ovlr: cur, - } -} - -// OSVersionProperties OS version properties. -type OSVersionProperties struct { - // Family - READ-ONLY; The family of this OS version. - Family *string `json:"family,omitempty"` - // FamilyLabel - READ-ONLY; The family label of this OS version. - FamilyLabel *string `json:"familyLabel,omitempty"` - // Version - READ-ONLY; The OS version. - Version *string `json:"version,omitempty"` - // Label - READ-ONLY; The OS version label. - Label *string `json:"label,omitempty"` - // IsDefault - READ-ONLY; Specifies whether this is the default OS version for its family. - IsDefault *bool `json:"isDefault,omitempty"` - // IsActive - READ-ONLY; Specifies whether this OS version is active. - IsActive *bool `json:"isActive,omitempty"` -} - -// MarshalJSON is the custom marshaler for OSVersionProperties. -func (ovp OSVersionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// OSVersionPropertiesBase configuration view of an OS version. -type OSVersionPropertiesBase struct { - // Version - READ-ONLY; The OS version. - Version *string `json:"version,omitempty"` - // Label - READ-ONLY; The OS version label. - Label *string `json:"label,omitempty"` - // IsDefault - READ-ONLY; Specifies whether this is the default OS version for its family. - IsDefault *bool `json:"isDefault,omitempty"` - // IsActive - READ-ONLY; Specifies whether this OS version is active. - IsActive *bool `json:"isActive,omitempty"` -} - -// MarshalJSON is the custom marshaler for OSVersionPropertiesBase. -func (ovpb OSVersionPropertiesBase) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// PatchInstallationDetail information about a specific patch that was encountered during an installation -// action. -type PatchInstallationDetail struct { - // PatchID - READ-ONLY; A unique identifier for the patch. - PatchID *string `json:"patchId,omitempty"` - // Name - READ-ONLY; The friendly name of the patch. - Name *string `json:"name,omitempty"` - // Version - READ-ONLY; The version string of the package. It may conform to Semantic Versioning. Only applies to Linux. - Version *string `json:"version,omitempty"` - // KbID - READ-ONLY; The KBID of the patch. Only applies to Windows patches. - KbID *string `json:"kbId,omitempty"` - // Classifications - READ-ONLY; The classification(s) of the patch as provided by the patch publisher. - Classifications *[]string `json:"classifications,omitempty"` - // InstallationState - READ-ONLY; The state of the patch after the installation operation completed. Possible values include: 'PatchInstallationStateUnknown', 'PatchInstallationStateInstalled', 'PatchInstallationStateFailed', 'PatchInstallationStateExcluded', 'PatchInstallationStateNotSelected', 'PatchInstallationStatePending' - InstallationState PatchInstallationState `json:"installationState,omitempty"` -} - -// MarshalJSON is the custom marshaler for PatchInstallationDetail. -func (pid PatchInstallationDetail) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// PatchSettings specifies settings related to VM Guest Patching on Windows. -type PatchSettings struct { - // PatchMode - Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual machines associated to virtual machine scale set with OrchestrationMode as Flexible.

      Possible values are:

      **Manual** - You control the application of patches to a virtual machine. You do this by applying patches manually inside the VM. In this mode, automatic updates are disabled; the property WindowsConfiguration.enableAutomaticUpdates must be false

      **AutomaticByOS** - The virtual machine will automatically be updated by the OS. The property WindowsConfiguration.enableAutomaticUpdates must be true.

      **AutomaticByPlatform** - the virtual machine will automatically updated by the platform. The properties provisionVMAgent and WindowsConfiguration.enableAutomaticUpdates must be true. Possible values include: 'WindowsVMGuestPatchModeManual', 'WindowsVMGuestPatchModeAutomaticByOS', 'WindowsVMGuestPatchModeAutomaticByPlatform' - PatchMode WindowsVMGuestPatchMode `json:"patchMode,omitempty"` - // EnableHotpatching - Enables customers to patch their Azure VMs without requiring a reboot. For enableHotpatching, the 'provisionVMAgent' must be set to true and 'patchMode' must be set to 'AutomaticByPlatform'. - EnableHotpatching *bool `json:"enableHotpatching,omitempty"` - // AssessmentMode - Specifies the mode of VM Guest patch assessment for the IaaS virtual machine.

      Possible values are:

      **ImageDefault** - You control the timing of patch assessments on a virtual machine.

      **AutomaticByPlatform** - The platform will trigger periodic patch assessments. The property provisionVMAgent must be true. Possible values include: 'WindowsPatchAssessmentModeImageDefault', 'WindowsPatchAssessmentModeAutomaticByPlatform' - AssessmentMode WindowsPatchAssessmentMode `json:"assessmentMode,omitempty"` - // AutomaticByPlatformSettings - Specifies additional settings for patch mode AutomaticByPlatform in VM Guest Patching on Windows. - AutomaticByPlatformSettings *WindowsVMGuestPatchAutomaticByPlatformSettings `json:"automaticByPlatformSettings,omitempty"` -} - -// PirCommunityGalleryResource base information about the community gallery resource in pir. -type PirCommunityGalleryResource struct { - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Location - READ-ONLY; Resource location - Location *string `json:"location,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - *CommunityGalleryIdentifier `json:"identifier,omitempty"` -} - -// MarshalJSON is the custom marshaler for PirCommunityGalleryResource. -func (pcgr PirCommunityGalleryResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if pcgr.CommunityGalleryIdentifier != nil { - objectMap["identifier"] = pcgr.CommunityGalleryIdentifier - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for PirCommunityGalleryResource struct. -func (pcgr *PirCommunityGalleryResource) 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 - } - pcgr.Name = &name - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - pcgr.Location = &location - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - pcgr.Type = &typeVar - } - case "identifier": - if v != nil { - var communityGalleryIdentifier CommunityGalleryIdentifier - err = json.Unmarshal(*v, &communityGalleryIdentifier) - if err != nil { - return err - } - pcgr.CommunityGalleryIdentifier = &communityGalleryIdentifier - } - } - } - - return nil -} - -// PirResource the Resource model definition. -type PirResource struct { - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Location - READ-ONLY; Resource location - Location *string `json:"location,omitempty"` -} - -// MarshalJSON is the custom marshaler for PirResource. -func (pr PirResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// PirSharedGalleryResource base information about the shared gallery resource in pir. -type PirSharedGalleryResource struct { - *SharedGalleryIdentifier `json:"identifier,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Location - READ-ONLY; Resource location - Location *string `json:"location,omitempty"` -} - -// MarshalJSON is the custom marshaler for PirSharedGalleryResource. -func (psgr PirSharedGalleryResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if psgr.SharedGalleryIdentifier != nil { - objectMap["identifier"] = psgr.SharedGalleryIdentifier - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for PirSharedGalleryResource struct. -func (psgr *PirSharedGalleryResource) 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 "identifier": - if v != nil { - var sharedGalleryIdentifier SharedGalleryIdentifier - err = json.Unmarshal(*v, &sharedGalleryIdentifier) - if err != nil { - return err - } - psgr.SharedGalleryIdentifier = &sharedGalleryIdentifier - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - psgr.Name = &name - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - psgr.Location = &location - } - } - } - - return nil -} - -// 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 { - // Name - The plan ID. - Name *string `json:"name,omitempty"` - // Publisher - The publisher ID. - Publisher *string `json:"publisher,omitempty"` - // Product - Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference element. - Product *string `json:"product,omitempty"` - // PromotionCode - The promotion code. - PromotionCode *string `json:"promotionCode,omitempty"` -} - -// PriorityMixPolicy specifies the target splits for Spot and Regular priority VMs within a scale set with -// flexible orchestration mode.

      With this property the customer is able to specify the base number -// of regular priority VMs created as the VMSS flex instance scales out and the split between Spot and -// Regular priority VMs after this base target has been reached. -type PriorityMixPolicy struct { - // BaseRegularPriorityCount - The base number of regular priority VMs that will be created in this scale set as it scales out. - BaseRegularPriorityCount *int32 `json:"baseRegularPriorityCount,omitempty"` - // RegularPriorityPercentageAboveBase - The percentage of VM instances, after the base regular priority count has been reached, that are expected to use regular priority. - RegularPriorityPercentageAboveBase *int32 `json:"regularPriorityPercentageAboveBase,omitempty"` -} - -// PrivateEndpoint the Private Endpoint resource. -type PrivateEndpoint struct { - // ID - READ-ONLY; The ARM identifier for Private Endpoint - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for PrivateEndpoint. -func (peVar PrivateEndpoint) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// PrivateEndpointConnection the Private Endpoint Connection resource. -type PrivateEndpointConnection struct { - autorest.Response `json:"-"` - // PrivateEndpointConnectionProperties - Resource properties. - *PrivateEndpointConnectionProperties `json:"properties,omitempty"` - // ID - READ-ONLY; private endpoint connection Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; private endpoint connection name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; private endpoint connection type - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for PrivateEndpointConnection. -func (pec PrivateEndpointConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if pec.PrivateEndpointConnectionProperties != nil { - objectMap["properties"] = pec.PrivateEndpointConnectionProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for PrivateEndpointConnection struct. -func (pec *PrivateEndpointConnection) 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 privateEndpointConnectionProperties PrivateEndpointConnectionProperties - err = json.Unmarshal(*v, &privateEndpointConnectionProperties) - if err != nil { - return err - } - pec.PrivateEndpointConnectionProperties = &privateEndpointConnectionProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - pec.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - pec.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - pec.Type = &typeVar - } - } - } - - return nil -} - -// PrivateEndpointConnectionListResult a list of private link resources -type PrivateEndpointConnectionListResult struct { - autorest.Response `json:"-"` - // Value - Array of private endpoint connections - Value *[]PrivateEndpointConnection `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of snapshots. Call ListNext() with this to fetch the next page of snapshots. - NextLink *string `json:"nextLink,omitempty"` -} - -// PrivateEndpointConnectionListResultIterator provides access to a complete listing of -// PrivateEndpointConnection values. -type PrivateEndpointConnectionListResultIterator struct { - i int - page PrivateEndpointConnectionListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *PrivateEndpointConnectionListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *PrivateEndpointConnectionListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter PrivateEndpointConnectionListResultIterator) 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 PrivateEndpointConnectionListResultIterator) Response() PrivateEndpointConnectionListResult { - 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 PrivateEndpointConnectionListResultIterator) Value() PrivateEndpointConnection { - if !iter.page.NotDone() { - return PrivateEndpointConnection{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the PrivateEndpointConnectionListResultIterator type. -func NewPrivateEndpointConnectionListResultIterator(page PrivateEndpointConnectionListResultPage) PrivateEndpointConnectionListResultIterator { - return PrivateEndpointConnectionListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (peclr PrivateEndpointConnectionListResult) IsEmpty() bool { - return peclr.Value == nil || len(*peclr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (peclr PrivateEndpointConnectionListResult) hasNextLink() bool { - return peclr.NextLink != nil && len(*peclr.NextLink) != 0 -} - -// privateEndpointConnectionListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (peclr PrivateEndpointConnectionListResult) privateEndpointConnectionListResultPreparer(ctx context.Context) (*http.Request, error) { - if !peclr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(peclr.NextLink))) -} - -// PrivateEndpointConnectionListResultPage contains a page of PrivateEndpointConnection values. -type PrivateEndpointConnectionListResultPage struct { - fn func(context.Context, PrivateEndpointConnectionListResult) (PrivateEndpointConnectionListResult, error) - peclr PrivateEndpointConnectionListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *PrivateEndpointConnectionListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.peclr) - if err != nil { - return err - } - page.peclr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *PrivateEndpointConnectionListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page PrivateEndpointConnectionListResultPage) NotDone() bool { - return !page.peclr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page PrivateEndpointConnectionListResultPage) Response() PrivateEndpointConnectionListResult { - return page.peclr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page PrivateEndpointConnectionListResultPage) Values() []PrivateEndpointConnection { - if page.peclr.IsEmpty() { - return nil - } - return *page.peclr.Value -} - -// Creates a new instance of the PrivateEndpointConnectionListResultPage type. -func NewPrivateEndpointConnectionListResultPage(cur PrivateEndpointConnectionListResult, getNextPage func(context.Context, PrivateEndpointConnectionListResult) (PrivateEndpointConnectionListResult, error)) PrivateEndpointConnectionListResultPage { - return PrivateEndpointConnectionListResultPage{ - fn: getNextPage, - peclr: cur, - } -} - -// PrivateEndpointConnectionProperties properties of the PrivateEndpointConnectProperties. -type PrivateEndpointConnectionProperties struct { - // PrivateEndpoint - READ-ONLY; The resource of private end point. - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - // PrivateLinkServiceConnectionState - A collection of information about the state of the connection between DiskAccess and Virtual Network. - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - // ProvisioningState - The provisioning state of the private endpoint connection resource. Possible values include: 'PrivateEndpointConnectionProvisioningStateSucceeded', 'PrivateEndpointConnectionProvisioningStateCreating', 'PrivateEndpointConnectionProvisioningStateDeleting', 'PrivateEndpointConnectionProvisioningStateFailed' - ProvisioningState PrivateEndpointConnectionProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for PrivateEndpointConnectionProperties. -func (pecp PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if pecp.PrivateLinkServiceConnectionState != nil { - objectMap["privateLinkServiceConnectionState"] = pecp.PrivateLinkServiceConnectionState - } - if pecp.ProvisioningState != "" { - objectMap["provisioningState"] = pecp.ProvisioningState - } - return json.Marshal(objectMap) -} - -// PrivateLinkResource a private link resource -type PrivateLinkResource struct { - // PrivateLinkResourceProperties - Resource properties. - *PrivateLinkResourceProperties `json:"properties,omitempty"` - // ID - READ-ONLY; private link resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; private link resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; private link resource type - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for PrivateLinkResource. -func (plr PrivateLinkResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if plr.PrivateLinkResourceProperties != nil { - objectMap["properties"] = plr.PrivateLinkResourceProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for PrivateLinkResource struct. -func (plr *PrivateLinkResource) 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 privateLinkResourceProperties PrivateLinkResourceProperties - err = json.Unmarshal(*v, &privateLinkResourceProperties) - if err != nil { - return err - } - plr.PrivateLinkResourceProperties = &privateLinkResourceProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - plr.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - plr.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - plr.Type = &typeVar - } - } - } - - return nil -} - -// PrivateLinkResourceListResult a list of private link resources -type PrivateLinkResourceListResult struct { - autorest.Response `json:"-"` - // Value - Array of private link resources - Value *[]PrivateLinkResource `json:"value,omitempty"` -} - -// PrivateLinkResourceProperties properties of a private link resource. -type PrivateLinkResourceProperties struct { - // GroupID - READ-ONLY; The private link resource group id. - GroupID *string `json:"groupId,omitempty"` - // RequiredMembers - READ-ONLY; The private link resource required member names. - RequiredMembers *[]string `json:"requiredMembers,omitempty"` - // RequiredZoneNames - The private link resource DNS zone name. - RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"` -} - -// MarshalJSON is the custom marshaler for PrivateLinkResourceProperties. -func (plrp PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if plrp.RequiredZoneNames != nil { - objectMap["requiredZoneNames"] = plrp.RequiredZoneNames - } - return json.Marshal(objectMap) -} - -// PrivateLinkServiceConnectionState a collection of information about the state of the connection between -// service consumer and provider. -type PrivateLinkServiceConnectionState struct { - // Status - Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. Possible values include: 'Pending', 'Approved', 'Rejected' - Status PrivateEndpointServiceConnectionStatus `json:"status,omitempty"` - // Description - The reason for approval/rejection of the connection. - Description *string `json:"description,omitempty"` - // ActionsRequired - A message indicating if changes on the service provider require any updates on the consumer. - ActionsRequired *string `json:"actionsRequired,omitempty"` -} - -// PropertyUpdatesInProgress properties of the disk for which update is pending. -type PropertyUpdatesInProgress struct { - // TargetTier - The target performance tier of the disk if a tier change operation is in progress. - TargetTier *string `json:"targetTier,omitempty"` -} - -// ProximityPlacementGroup specifies information about the proximity placement group. -type ProximityPlacementGroup struct { - autorest.Response `json:"-"` - // ProximityPlacementGroupProperties - Describes the properties of a Proximity Placement Group. - *ProximityPlacementGroupProperties `json:"properties,omitempty"` - // Zones - Specifies the Availability Zone where virtual machine, virtual machine scale set or availability set associated with the proximity placement group can be created. - Zones *[]string `json:"zones,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; 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 ProximityPlacementGroup. -func (ppg ProximityPlacementGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ppg.ProximityPlacementGroupProperties != nil { - objectMap["properties"] = ppg.ProximityPlacementGroupProperties - } - if ppg.Zones != nil { - objectMap["zones"] = ppg.Zones - } - if ppg.Location != nil { - objectMap["location"] = ppg.Location - } - if ppg.Tags != nil { - objectMap["tags"] = ppg.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ProximityPlacementGroup struct. -func (ppg *ProximityPlacementGroup) 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 proximityPlacementGroupProperties ProximityPlacementGroupProperties - err = json.Unmarshal(*v, &proximityPlacementGroupProperties) - if err != nil { - return err - } - ppg.ProximityPlacementGroupProperties = &proximityPlacementGroupProperties - } - case "zones": - if v != nil { - var zones []string - err = json.Unmarshal(*v, &zones) - if err != nil { - return err - } - ppg.Zones = &zones - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ppg.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ppg.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - ppg.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - ppg.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - ppg.Tags = tags - } - } - } - - return nil -} - -// ProximityPlacementGroupListResult the List Proximity Placement Group operation response. -type ProximityPlacementGroupListResult struct { - autorest.Response `json:"-"` - // Value - The list of proximity placement groups - Value *[]ProximityPlacementGroup `json:"value,omitempty"` - // NextLink - The URI to fetch the next page of proximity placement groups. - NextLink *string `json:"nextLink,omitempty"` -} - -// ProximityPlacementGroupListResultIterator provides access to a complete listing of -// ProximityPlacementGroup values. -type ProximityPlacementGroupListResultIterator struct { - i int - page ProximityPlacementGroupListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ProximityPlacementGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ProximityPlacementGroupListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ProximityPlacementGroupListResultIterator) 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 ProximityPlacementGroupListResultIterator) Response() ProximityPlacementGroupListResult { - 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 ProximityPlacementGroupListResultIterator) Value() ProximityPlacementGroup { - if !iter.page.NotDone() { - return ProximityPlacementGroup{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ProximityPlacementGroupListResultIterator type. -func NewProximityPlacementGroupListResultIterator(page ProximityPlacementGroupListResultPage) ProximityPlacementGroupListResultIterator { - return ProximityPlacementGroupListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (ppglr ProximityPlacementGroupListResult) IsEmpty() bool { - return ppglr.Value == nil || len(*ppglr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (ppglr ProximityPlacementGroupListResult) hasNextLink() bool { - return ppglr.NextLink != nil && len(*ppglr.NextLink) != 0 -} - -// proximityPlacementGroupListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (ppglr ProximityPlacementGroupListResult) proximityPlacementGroupListResultPreparer(ctx context.Context) (*http.Request, error) { - if !ppglr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(ppglr.NextLink))) -} - -// ProximityPlacementGroupListResultPage contains a page of ProximityPlacementGroup values. -type ProximityPlacementGroupListResultPage struct { - fn func(context.Context, ProximityPlacementGroupListResult) (ProximityPlacementGroupListResult, error) - ppglr ProximityPlacementGroupListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ProximityPlacementGroupListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.ppglr) - if err != nil { - return err - } - page.ppglr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ProximityPlacementGroupListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ProximityPlacementGroupListResultPage) NotDone() bool { - return !page.ppglr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ProximityPlacementGroupListResultPage) Response() ProximityPlacementGroupListResult { - return page.ppglr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ProximityPlacementGroupListResultPage) Values() []ProximityPlacementGroup { - if page.ppglr.IsEmpty() { - return nil - } - return *page.ppglr.Value -} - -// Creates a new instance of the ProximityPlacementGroupListResultPage type. -func NewProximityPlacementGroupListResultPage(cur ProximityPlacementGroupListResult, getNextPage func(context.Context, ProximityPlacementGroupListResult) (ProximityPlacementGroupListResult, error)) ProximityPlacementGroupListResultPage { - return ProximityPlacementGroupListResultPage{ - fn: getNextPage, - ppglr: cur, - } -} - -// ProximityPlacementGroupProperties describes the properties of a Proximity Placement Group. -type ProximityPlacementGroupProperties struct { - // ProximityPlacementGroupType - Specifies the type of the proximity placement group.

      Possible values are:

      **Standard** : Co-locate resources within an Azure region or Availability Zone.

      **Ultra** : For future use. Possible values include: 'Standard', 'Ultra' - ProximityPlacementGroupType ProximityPlacementGroupType `json:"proximityPlacementGroupType,omitempty"` - // VirtualMachines - READ-ONLY; A list of references to all virtual machines in the proximity placement group. - VirtualMachines *[]SubResourceWithColocationStatus `json:"virtualMachines,omitempty"` - // VirtualMachineScaleSets - READ-ONLY; A list of references to all virtual machine scale sets in the proximity placement group. - VirtualMachineScaleSets *[]SubResourceWithColocationStatus `json:"virtualMachineScaleSets,omitempty"` - // AvailabilitySets - READ-ONLY; A list of references to all availability sets in the proximity placement group. - AvailabilitySets *[]SubResourceWithColocationStatus `json:"availabilitySets,omitempty"` - // ColocationStatus - Describes colocation status of the Proximity Placement Group. - ColocationStatus *InstanceViewStatus `json:"colocationStatus,omitempty"` - // Intent - Specifies the user intent of the proximity placement group. - Intent *ProximityPlacementGroupPropertiesIntent `json:"intent,omitempty"` -} - -// MarshalJSON is the custom marshaler for ProximityPlacementGroupProperties. -func (ppgp ProximityPlacementGroupProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ppgp.ProximityPlacementGroupType != "" { - objectMap["proximityPlacementGroupType"] = ppgp.ProximityPlacementGroupType - } - if ppgp.ColocationStatus != nil { - objectMap["colocationStatus"] = ppgp.ColocationStatus - } - if ppgp.Intent != nil { - objectMap["intent"] = ppgp.Intent - } - return json.Marshal(objectMap) -} - -// ProximityPlacementGroupPropertiesIntent specifies the user intent of the proximity placement group. -type ProximityPlacementGroupPropertiesIntent struct { - // VMSizes - Specifies possible sizes of virtual machines that can be created in the proximity placement group. - VMSizes *[]string `json:"vmSizes,omitempty"` -} - -// ProximityPlacementGroupUpdate specifies information about the proximity placement group. -type ProximityPlacementGroupUpdate struct { - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for ProximityPlacementGroupUpdate. -func (ppgu ProximityPlacementGroupUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ppgu.Tags != nil { - objectMap["tags"] = ppgu.Tags - } - return json.Marshal(objectMap) -} - -// ProxyOnlyResource the ProxyOnly Resource model definition. -type ProxyOnlyResource struct { - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for ProxyOnlyResource. -func (por ProxyOnlyResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ProxyResource the resource model definition for an Azure Resource Manager proxy resource. It will not -// have tags and a location -type ProxyResource struct { - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for ProxyResource. -func (pr ProxyResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// PublicIPAddressSku describes the public IP Sku. It can only be set with OrchestrationMode as Flexible. -type PublicIPAddressSku struct { - // Name - Specify public IP sku name. Possible values include: 'PublicIPAddressSkuNameBasic', 'PublicIPAddressSkuNameStandard' - Name PublicIPAddressSkuName `json:"name,omitempty"` - // Tier - Specify public IP sku tier. Possible values include: 'Regional', 'Global' - Tier PublicIPAddressSkuTier `json:"tier,omitempty"` -} - -// PurchasePlan used for establishing the purchase context of any 3rd Party artifact through MarketPlace. -type PurchasePlan struct { - // Publisher - The publisher ID. - Publisher *string `json:"publisher,omitempty"` - // Name - The plan ID. - Name *string `json:"name,omitempty"` - // Product - Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference element. - Product *string `json:"product,omitempty"` - // PromotionCode - The Offer Promotion Code. - PromotionCode *string `json:"promotionCode,omitempty"` -} - -// ReadCloser ... -type ReadCloser struct { - autorest.Response `json:"-"` - Value *io.ReadCloser `json:"value,omitempty"` -} - -// RecommendedMachineConfiguration the properties describe the recommended machine configuration for this -// Image Definition. These properties are updatable. -type RecommendedMachineConfiguration struct { - VCPUs *ResourceRange `json:"vCPUs,omitempty"` - Memory *ResourceRange `json:"memory,omitempty"` -} - -// RecoveryWalkResponse response after calling a manual recovery walk -type RecoveryWalkResponse struct { - autorest.Response `json:"-"` - // WalkPerformed - READ-ONLY; Whether the recovery walk was performed - WalkPerformed *bool `json:"walkPerformed,omitempty"` - // NextPlatformUpdateDomain - READ-ONLY; The next update domain that needs to be walked. Null means walk spanning all update domains has been completed - NextPlatformUpdateDomain *int32 `json:"nextPlatformUpdateDomain,omitempty"` -} - -// MarshalJSON is the custom marshaler for RecoveryWalkResponse. -func (rwr RecoveryWalkResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// RegionalReplicationStatus this is the regional replication status. -type RegionalReplicationStatus struct { - // Region - READ-ONLY; The region to which the gallery image version is being replicated to. - Region *string `json:"region,omitempty"` - // State - READ-ONLY; This is the regional replication state. Possible values include: 'ReplicationStateUnknown', 'ReplicationStateReplicating', 'ReplicationStateCompleted', 'ReplicationStateFailed' - State ReplicationState `json:"state,omitempty"` - // Details - READ-ONLY; The details of the replication status. - Details *string `json:"details,omitempty"` - // Progress - READ-ONLY; It indicates progress of the replication job. - Progress *int32 `json:"progress,omitempty"` -} - -// MarshalJSON is the custom marshaler for RegionalReplicationStatus. -func (rrs RegionalReplicationStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// RegionalSharingStatus gallery regional sharing status -type RegionalSharingStatus struct { - // Region - Region name - Region *string `json:"region,omitempty"` - // State - Gallery sharing state in current region. Possible values include: 'SharingStateSucceeded', 'SharingStateInProgress', 'SharingStateFailed', 'SharingStateUnknown' - State SharingState `json:"state,omitempty"` - // Details - Details of gallery regional sharing failure. - Details *string `json:"details,omitempty"` -} - -// ReplicationStatus this is the replication status of the gallery image version. -type ReplicationStatus struct { - // AggregatedState - READ-ONLY; This is the aggregated replication status based on all the regional replication status flags. Possible values include: 'Unknown', 'InProgress', 'Completed', 'Failed' - AggregatedState AggregatedReplicationState `json:"aggregatedState,omitempty"` - // Summary - READ-ONLY; This is a summary of replication status for each region. - Summary *[]RegionalReplicationStatus `json:"summary,omitempty"` -} - -// MarshalJSON is the custom marshaler for ReplicationStatus. -func (rs ReplicationStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// 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 - FromTime *date.Time `json:"fromTime,omitempty"` - // ToTime - To time of the query - ToTime *date.Time `json:"toTime,omitempty"` - // GroupByThrottlePolicy - Group query result by Throttle Policy applied. - GroupByThrottlePolicy *bool `json:"groupByThrottlePolicy,omitempty"` - // GroupByOperationName - Group query result by Operation Name. - GroupByOperationName *bool `json:"groupByOperationName,omitempty"` - // GroupByResourceName - Group query result by Resource Name. - GroupByResourceName *bool `json:"groupByResourceName,omitempty"` - // GroupByClientApplicationID - Group query result by Client Application ID. - GroupByClientApplicationID *bool `json:"groupByClientApplicationId,omitempty"` - // GroupByUserAgent - Group query result by User Agent. - GroupByUserAgent *bool `json:"groupByUserAgent,omitempty"` -} - -// Resource the Resource model definition. -type Resource struct { - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; 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.Location != nil { - objectMap["location"] = r.Location - } - if r.Tags != nil { - objectMap["tags"] = r.Tags - } - return json.Marshal(objectMap) -} - -// ResourceInstanceViewStatus instance view status. -type ResourceInstanceViewStatus struct { - // Code - READ-ONLY; The status code. - Code *string `json:"code,omitempty"` - // DisplayStatus - READ-ONLY; The short localizable label for the status. - DisplayStatus *string `json:"displayStatus,omitempty"` - // Message - READ-ONLY; The detailed status message, including for alerts and error messages. - Message *string `json:"message,omitempty"` - // Time - READ-ONLY; The time of the status. - Time *date.Time `json:"time,omitempty"` - // Level - The level code. Possible values include: 'Info', 'Warning', 'Error' - Level StatusLevelTypes `json:"level,omitempty"` -} - -// MarshalJSON is the custom marshaler for ResourceInstanceViewStatus. -func (rivs ResourceInstanceViewStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rivs.Level != "" { - objectMap["level"] = rivs.Level - } - return json.Marshal(objectMap) -} - -// ResourceRange describes the resource range. -type ResourceRange struct { - // Min - The minimum number of the resource. - Min *int32 `json:"min,omitempty"` - // Max - The maximum number of the resource. - Max *int32 `json:"max,omitempty"` -} - -// ResourceSku describes an available Compute SKU. -type ResourceSku struct { - // ResourceType - READ-ONLY; The type of resource the SKU applies to. - ResourceType *string `json:"resourceType,omitempty"` - // Name - READ-ONLY; The name of SKU. - Name *string `json:"name,omitempty"` - // Tier - READ-ONLY; Specifies the tier of virtual machines in a scale set.

      Possible Values:

      **Standard**

      **Basic** - Tier *string `json:"tier,omitempty"` - // Size - READ-ONLY; The Size of the SKU. - Size *string `json:"size,omitempty"` - // Family - READ-ONLY; The Family of this particular SKU. - Family *string `json:"family,omitempty"` - // Kind - READ-ONLY; The Kind of resources that are supported in this SKU. - Kind *string `json:"kind,omitempty"` - // Capacity - READ-ONLY; Specifies the number of virtual machines in the scale set. - Capacity *ResourceSkuCapacity `json:"capacity,omitempty"` - // Locations - READ-ONLY; The set of locations that the SKU is available. - Locations *[]string `json:"locations,omitempty"` - // LocationInfo - READ-ONLY; A list of locations and availability zones in those locations where the SKU is available. - LocationInfo *[]ResourceSkuLocationInfo `json:"locationInfo,omitempty"` - // APIVersions - READ-ONLY; The api versions that support this SKU. - APIVersions *[]string `json:"apiVersions,omitempty"` - // Costs - READ-ONLY; Metadata for retrieving price info. - Costs *[]ResourceSkuCosts `json:"costs,omitempty"` - // Capabilities - READ-ONLY; A name value pair to describe the capability. - Capabilities *[]ResourceSkuCapabilities `json:"capabilities,omitempty"` - // Restrictions - READ-ONLY; The restrictions because of which SKU cannot be used. This is empty if there are no restrictions. - Restrictions *[]ResourceSkuRestrictions `json:"restrictions,omitempty"` -} - -// MarshalJSON is the custom marshaler for ResourceSku. -func (rs ResourceSku) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ResourceSkuCapabilities describes The SKU capabilities object. -type ResourceSkuCapabilities struct { - // Name - READ-ONLY; An invariant to describe the feature. - Name *string `json:"name,omitempty"` - // Value - READ-ONLY; An invariant if the feature is measured by quantity. - Value *string `json:"value,omitempty"` -} - -// MarshalJSON is the custom marshaler for ResourceSkuCapabilities. -func (rsc ResourceSkuCapabilities) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ResourceSkuCapacity describes scaling information of a SKU. -type ResourceSkuCapacity struct { - // Minimum - READ-ONLY; The minimum capacity. - Minimum *int64 `json:"minimum,omitempty"` - // Maximum - READ-ONLY; The maximum capacity that can be set. - Maximum *int64 `json:"maximum,omitempty"` - // Default - READ-ONLY; The default capacity. - Default *int64 `json:"default,omitempty"` - // ScaleType - READ-ONLY; The scale type applicable to the sku. Possible values include: 'ResourceSkuCapacityScaleTypeAutomatic', 'ResourceSkuCapacityScaleTypeManual', 'ResourceSkuCapacityScaleTypeNone' - ScaleType ResourceSkuCapacityScaleType `json:"scaleType,omitempty"` -} - -// MarshalJSON is the custom marshaler for ResourceSkuCapacity. -func (rsc ResourceSkuCapacity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ResourceSkuCosts describes metadata for retrieving price info. -type ResourceSkuCosts struct { - // MeterID - READ-ONLY; Used for querying price from commerce. - MeterID *string `json:"meterID,omitempty"` - // Quantity - READ-ONLY; The multiplier is needed to extend the base metered cost. - Quantity *int64 `json:"quantity,omitempty"` - // ExtendedUnit - READ-ONLY; An invariant to show the extended unit. - ExtendedUnit *string `json:"extendedUnit,omitempty"` -} - -// MarshalJSON is the custom marshaler for ResourceSkuCosts. -func (rsc ResourceSkuCosts) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ResourceSkuLocationInfo describes an available Compute SKU Location Information. -type ResourceSkuLocationInfo struct { - // Location - READ-ONLY; Location of the SKU - Location *string `json:"location,omitempty"` - // Zones - READ-ONLY; List of availability zones where the SKU is supported. - Zones *[]string `json:"zones,omitempty"` - // ZoneDetails - READ-ONLY; Details of capabilities available to a SKU in specific zones. - ZoneDetails *[]ResourceSkuZoneDetails `json:"zoneDetails,omitempty"` - // ExtendedLocations - READ-ONLY; The names of extended locations. - ExtendedLocations *[]string `json:"extendedLocations,omitempty"` - // Type - READ-ONLY; The type of the extended location. Possible values include: 'EdgeZone' - Type ExtendedLocationType `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for ResourceSkuLocationInfo. -func (rsli ResourceSkuLocationInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ResourceSkuRestrictionInfo describes an available Compute SKU Restriction Information. -type ResourceSkuRestrictionInfo struct { - // Locations - READ-ONLY; Locations where the SKU is restricted - Locations *[]string `json:"locations,omitempty"` - // Zones - READ-ONLY; List of availability zones where the SKU is restricted. - Zones *[]string `json:"zones,omitempty"` -} - -// MarshalJSON is the custom marshaler for ResourceSkuRestrictionInfo. -func (rsri ResourceSkuRestrictionInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ResourceSkuRestrictions describes scaling information of a SKU. -type ResourceSkuRestrictions struct { - // Type - READ-ONLY; The type of restrictions. Possible values include: 'Location', 'Zone' - Type ResourceSkuRestrictionsType `json:"type,omitempty"` - // Values - READ-ONLY; 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"` - // RestrictionInfo - READ-ONLY; The information about the restriction where the SKU cannot be used. - RestrictionInfo *ResourceSkuRestrictionInfo `json:"restrictionInfo,omitempty"` - // ReasonCode - READ-ONLY; The reason for restriction. Possible values include: 'QuotaID', 'NotAvailableForSubscription' - ReasonCode ResourceSkuRestrictionsReasonCode `json:"reasonCode,omitempty"` -} - -// MarshalJSON is the custom marshaler for ResourceSkuRestrictions. -func (rsr ResourceSkuRestrictions) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ResourceSkusResult the List Resource Skus operation response. -type ResourceSkusResult struct { - autorest.Response `json:"-"` - // Value - The list of skus available for the subscription. - Value *[]ResourceSku `json:"value,omitempty"` - // NextLink - The URI to fetch the next page of Resource Skus. Call ListNext() with this URI to fetch the next page of Resource Skus - NextLink *string `json:"nextLink,omitempty"` -} - -// ResourceSkusResultIterator provides access to a complete listing of ResourceSku values. -type ResourceSkusResultIterator struct { - i int - page ResourceSkusResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ResourceSkusResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkusResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ResourceSkusResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ResourceSkusResultIterator) 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 ResourceSkusResultIterator) Response() ResourceSkusResult { - 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 ResourceSkusResultIterator) Value() ResourceSku { - if !iter.page.NotDone() { - return ResourceSku{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ResourceSkusResultIterator type. -func NewResourceSkusResultIterator(page ResourceSkusResultPage) ResourceSkusResultIterator { - return ResourceSkusResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (rsr ResourceSkusResult) IsEmpty() bool { - return rsr.Value == nil || len(*rsr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (rsr ResourceSkusResult) hasNextLink() bool { - return rsr.NextLink != nil && len(*rsr.NextLink) != 0 -} - -// resourceSkusResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (rsr ResourceSkusResult) resourceSkusResultPreparer(ctx context.Context) (*http.Request, error) { - if !rsr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(rsr.NextLink))) -} - -// ResourceSkusResultPage contains a page of ResourceSku values. -type ResourceSkusResultPage struct { - fn func(context.Context, ResourceSkusResult) (ResourceSkusResult, error) - rsr ResourceSkusResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ResourceSkusResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkusResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.rsr) - if err != nil { - return err - } - page.rsr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ResourceSkusResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ResourceSkusResultPage) NotDone() bool { - return !page.rsr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ResourceSkusResultPage) Response() ResourceSkusResult { - return page.rsr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ResourceSkusResultPage) Values() []ResourceSku { - if page.rsr.IsEmpty() { - return nil - } - return *page.rsr.Value -} - -// Creates a new instance of the ResourceSkusResultPage type. -func NewResourceSkusResultPage(cur ResourceSkusResult, getNextPage func(context.Context, ResourceSkusResult) (ResourceSkusResult, error)) ResourceSkusResultPage { - return ResourceSkusResultPage{ - fn: getNextPage, - rsr: cur, - } -} - -// ResourceSkuZoneDetails describes The zonal capabilities of a SKU. -type ResourceSkuZoneDetails struct { - // Name - READ-ONLY; The set of zones that the SKU is available in with the specified capabilities. - Name *[]string `json:"name,omitempty"` - // Capabilities - READ-ONLY; A list of capabilities that are available for the SKU in the specified list of zones. - Capabilities *[]ResourceSkuCapabilities `json:"capabilities,omitempty"` -} - -// MarshalJSON is the custom marshaler for ResourceSkuZoneDetails. -func (rszd ResourceSkuZoneDetails) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ResourceURIList the List resources which are encrypted with the disk encryption set. -type ResourceURIList struct { - autorest.Response `json:"-"` - // Value - A list of IDs or Owner IDs of resources which are encrypted with the disk encryption set. - Value *[]string `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of encrypted resources. Call ListNext() with this to fetch the next page of encrypted resources. - NextLink *string `json:"nextLink,omitempty"` -} - -// ResourceURIListIterator provides access to a complete listing of string values. -type ResourceURIListIterator struct { - i int - page ResourceURIListPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ResourceURIListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResourceURIListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ResourceURIListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ResourceURIListIterator) 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 ResourceURIListIterator) Response() ResourceURIList { - 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 ResourceURIListIterator) Value() string { - if !iter.page.NotDone() { - return "" - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ResourceURIListIterator type. -func NewResourceURIListIterator(page ResourceURIListPage) ResourceURIListIterator { - return ResourceURIListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (rul ResourceURIList) IsEmpty() bool { - return rul.Value == nil || len(*rul.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (rul ResourceURIList) hasNextLink() bool { - return rul.NextLink != nil && len(*rul.NextLink) != 0 -} - -// resourceURIListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (rul ResourceURIList) resourceURIListPreparer(ctx context.Context) (*http.Request, error) { - if !rul.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(rul.NextLink))) -} - -// ResourceURIListPage contains a page of string values. -type ResourceURIListPage struct { - fn func(context.Context, ResourceURIList) (ResourceURIList, error) - rul ResourceURIList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ResourceURIListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResourceURIListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.rul) - if err != nil { - return err - } - page.rul = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ResourceURIListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ResourceURIListPage) NotDone() bool { - return !page.rul.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ResourceURIListPage) Response() ResourceURIList { - return page.rul -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ResourceURIListPage) Values() []string { - if page.rul.IsEmpty() { - return nil - } - return *page.rul.Value -} - -// Creates a new instance of the ResourceURIListPage type. -func NewResourceURIListPage(cur ResourceURIList, getNextPage func(context.Context, ResourceURIList) (ResourceURIList, error)) ResourceURIListPage { - return ResourceURIListPage{ - fn: getNextPage, - rul: cur, - } -} - -// ResourceWithOptionalLocation the Resource model definition with location property as optional. -type ResourceWithOptionalLocation struct { - // Location - Resource location - Location *string `json:"location,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for ResourceWithOptionalLocation. -func (rwol ResourceWithOptionalLocation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rwol.Location != nil { - objectMap["location"] = rwol.Location - } - if rwol.Tags != nil { - objectMap["tags"] = rwol.Tags - } - return json.Marshal(objectMap) -} - -// RestorePoint restore Point details. -type RestorePoint struct { - autorest.Response `json:"-"` - *RestorePointProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,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 - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for RestorePoint struct. -func (rp *RestorePoint) 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 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 - } - } - } - - return nil -} - -// RestorePointCollection create or update Restore Point collection parameters. -type RestorePointCollection struct { - autorest.Response `json:"-"` - *RestorePointCollectionProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; 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 RestorePointCollection. -func (RPCVar RestorePointCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if RPCVar.RestorePointCollectionProperties != nil { - objectMap["properties"] = RPCVar.RestorePointCollectionProperties - } - if RPCVar.Location != nil { - objectMap["location"] = RPCVar.Location - } - if RPCVar.Tags != nil { - objectMap["tags"] = RPCVar.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for RestorePointCollection struct. -func (RPCVar *RestorePointCollection) 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 restorePointCollectionProperties RestorePointCollectionProperties - err = json.Unmarshal(*v, &restorePointCollectionProperties) - if err != nil { - return err - } - RPCVar.RestorePointCollectionProperties = &restorePointCollectionProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - RPCVar.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - RPCVar.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - RPCVar.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - RPCVar.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - RPCVar.Tags = tags - } - } - } - - return nil -} - -// RestorePointCollectionListResult the List restore point collection operation response. -type RestorePointCollectionListResult struct { - autorest.Response `json:"-"` - // Value - Gets the list of restore point collections. - Value *[]RestorePointCollection `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of RestorePointCollections. Call ListNext() with this to fetch the next page of RestorePointCollections - NextLink *string `json:"nextLink,omitempty"` -} - -// RestorePointCollectionListResultIterator provides access to a complete listing of RestorePointCollection -// values. -type RestorePointCollectionListResultIterator struct { - i int - page RestorePointCollectionListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *RestorePointCollectionListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RestorePointCollectionListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *RestorePointCollectionListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter RestorePointCollectionListResultIterator) 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 RestorePointCollectionListResultIterator) Response() RestorePointCollectionListResult { - 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 RestorePointCollectionListResultIterator) Value() RestorePointCollection { - if !iter.page.NotDone() { - return RestorePointCollection{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the RestorePointCollectionListResultIterator type. -func NewRestorePointCollectionListResultIterator(page RestorePointCollectionListResultPage) RestorePointCollectionListResultIterator { - return RestorePointCollectionListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (rpclr RestorePointCollectionListResult) IsEmpty() bool { - return rpclr.Value == nil || len(*rpclr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (rpclr RestorePointCollectionListResult) hasNextLink() bool { - return rpclr.NextLink != nil && len(*rpclr.NextLink) != 0 -} - -// restorePointCollectionListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (rpclr RestorePointCollectionListResult) restorePointCollectionListResultPreparer(ctx context.Context) (*http.Request, error) { - if !rpclr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(rpclr.NextLink))) -} - -// RestorePointCollectionListResultPage contains a page of RestorePointCollection values. -type RestorePointCollectionListResultPage struct { - fn func(context.Context, RestorePointCollectionListResult) (RestorePointCollectionListResult, error) - rpclr RestorePointCollectionListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *RestorePointCollectionListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RestorePointCollectionListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.rpclr) - if err != nil { - return err - } - page.rpclr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *RestorePointCollectionListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page RestorePointCollectionListResultPage) NotDone() bool { - return !page.rpclr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page RestorePointCollectionListResultPage) Response() RestorePointCollectionListResult { - return page.rpclr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page RestorePointCollectionListResultPage) Values() []RestorePointCollection { - if page.rpclr.IsEmpty() { - return nil - } - return *page.rpclr.Value -} - -// Creates a new instance of the RestorePointCollectionListResultPage type. -func NewRestorePointCollectionListResultPage(cur RestorePointCollectionListResult, getNextPage func(context.Context, RestorePointCollectionListResult) (RestorePointCollectionListResult, error)) RestorePointCollectionListResultPage { - return RestorePointCollectionListResultPage{ - fn: getNextPage, - rpclr: cur, - } -} - -// RestorePointCollectionProperties the restore point collection properties. -type RestorePointCollectionProperties struct { - Source *RestorePointCollectionSourceProperties `json:"source,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the restore point collection. - ProvisioningState *string `json:"provisioningState,omitempty"` - // RestorePointCollectionID - READ-ONLY; The unique id of the restore point collection. - RestorePointCollectionID *string `json:"restorePointCollectionId,omitempty"` - // RestorePoints - READ-ONLY; A list containing all restore points created under this restore point collection. - RestorePoints *[]RestorePoint `json:"restorePoints,omitempty"` -} - -// MarshalJSON is the custom marshaler for RestorePointCollectionProperties. -func (rpcp RestorePointCollectionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rpcp.Source != nil { - objectMap["source"] = rpcp.Source - } - return json.Marshal(objectMap) -} - -// RestorePointCollectionsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type RestorePointCollectionsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(RestorePointCollectionsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *RestorePointCollectionsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for RestorePointCollectionsDeleteFuture.Result. -func (future *RestorePointCollectionsDeleteFuture) result(client RestorePointCollectionsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.RestorePointCollectionsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.RestorePointCollectionsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// RestorePointCollectionSourceProperties the properties of the source resource that this restore point -// collection is created from. -type RestorePointCollectionSourceProperties struct { - // Location - READ-ONLY; Location of the source resource used to create this restore point collection. - Location *string `json:"location,omitempty"` - // ID - Resource Id of the source resource used to create this restore point collection - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for RestorePointCollectionSourceProperties. -func (rpcsp RestorePointCollectionSourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rpcsp.ID != nil { - objectMap["id"] = rpcsp.ID - } - return json.Marshal(objectMap) -} - -// RestorePointCollectionUpdate update Restore Point collection parameters. -type RestorePointCollectionUpdate struct { - *RestorePointCollectionProperties `json:"properties,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for RestorePointCollectionUpdate. -func (rpcu RestorePointCollectionUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rpcu.RestorePointCollectionProperties != nil { - objectMap["properties"] = rpcu.RestorePointCollectionProperties - } - if rpcu.Tags != nil { - objectMap["tags"] = rpcu.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for RestorePointCollectionUpdate struct. -func (rpcu *RestorePointCollectionUpdate) 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 restorePointCollectionProperties RestorePointCollectionProperties - err = json.Unmarshal(*v, &restorePointCollectionProperties) - if err != nil { - return err - } - rpcu.RestorePointCollectionProperties = &restorePointCollectionProperties - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - rpcu.Tags = tags - } - } - } - - return nil -} - -// RestorePointInstanceView the instance view of a restore point. -type RestorePointInstanceView struct { - // DiskRestorePoints - The disk restore points information. - DiskRestorePoints *[]DiskRestorePointInstanceView `json:"diskRestorePoints,omitempty"` - // Statuses - The resource status information. - Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` -} - -// RestorePointProperties the restore point properties. -type RestorePointProperties struct { - // ExcludeDisks - List of disk resource ids that the customer wishes to exclude from the restore point. If no disks are specified, all disks will be included. - ExcludeDisks *[]APIEntityReference `json:"excludeDisks,omitempty"` - // SourceMetadata - READ-ONLY; Gets the details of the VM captured at the time of the restore point creation. - SourceMetadata *RestorePointSourceMetadata `json:"sourceMetadata,omitempty"` - // ProvisioningState - READ-ONLY; Gets the provisioning state of the restore point. - ProvisioningState *string `json:"provisioningState,omitempty"` - // ConsistencyMode - ConsistencyMode of the RestorePoint. Can be specified in the input while creating a restore point. For now, only CrashConsistent is accepted as a valid input. Please refer to https://aka.ms/RestorePoints for more details. Possible values include: 'CrashConsistent', 'FileSystemConsistent', 'ApplicationConsistent' - ConsistencyMode ConsistencyModeTypes `json:"consistencyMode,omitempty"` - // TimeCreated - Gets the creation time of the restore point. - TimeCreated *date.Time `json:"timeCreated,omitempty"` - // SourceRestorePoint - Resource Id of the source restore point from which a copy needs to be created. - SourceRestorePoint *APIEntityReference `json:"sourceRestorePoint,omitempty"` - // InstanceView - READ-ONLY; The restore point instance view. - InstanceView *RestorePointInstanceView `json:"instanceView,omitempty"` -} - -// MarshalJSON is the custom marshaler for RestorePointProperties. -func (rpp RestorePointProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rpp.ExcludeDisks != nil { - objectMap["excludeDisks"] = rpp.ExcludeDisks - } - if rpp.ConsistencyMode != "" { - objectMap["consistencyMode"] = rpp.ConsistencyMode - } - if rpp.TimeCreated != nil { - objectMap["timeCreated"] = rpp.TimeCreated - } - if rpp.SourceRestorePoint != nil { - objectMap["sourceRestorePoint"] = rpp.SourceRestorePoint - } - return json.Marshal(objectMap) -} - -// RestorePointsCreateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type RestorePointsCreateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(RestorePointsClient) (RestorePoint, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *RestorePointsCreateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for RestorePointsCreateFuture.Result. -func (future *RestorePointsCreateFuture) result(client RestorePointsClient) (rp RestorePoint, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.RestorePointsCreateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - rp.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.RestorePointsCreateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { - rp, err = client.CreateResponder(rp.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.RestorePointsCreateFuture", "Result", rp.Response.Response, "Failure responding to request") - } - } - return -} - -// RestorePointsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type RestorePointsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(RestorePointsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *RestorePointsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for RestorePointsDeleteFuture.Result. -func (future *RestorePointsDeleteFuture) result(client RestorePointsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.RestorePointsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.RestorePointsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// RestorePointSourceMetadata describes the properties of the Virtual Machine for which the restore point -// was created. The properties provided are a subset and the snapshot of the overall Virtual Machine -// properties captured at the time of the restore point creation. -type RestorePointSourceMetadata struct { - // HardwareProfile - Gets the hardware profile. - HardwareProfile *HardwareProfile `json:"hardwareProfile,omitempty"` - // StorageProfile - Gets the storage profile. - StorageProfile *RestorePointSourceVMStorageProfile `json:"storageProfile,omitempty"` - // OsProfile - Gets the OS profile. - OsProfile *OSProfile `json:"osProfile,omitempty"` - // DiagnosticsProfile - Gets the diagnostics profile. - DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` - // LicenseType - Gets the license type, which is for bring your own license scenario. - LicenseType *string `json:"licenseType,omitempty"` - // VMID - Gets the virtual machine unique id. - VMID *string `json:"vmId,omitempty"` - // SecurityProfile - Gets the security profile. - SecurityProfile *SecurityProfile `json:"securityProfile,omitempty"` - // Location - Location of the VM from which the restore point was created. - Location *string `json:"location,omitempty"` -} - -// RestorePointSourceVMDataDisk describes a data disk. -type RestorePointSourceVMDataDisk struct { - // Lun - Gets the logical unit number. - Lun *int32 `json:"lun,omitempty"` - // Name - Gets the disk name. - Name *string `json:"name,omitempty"` - // Caching - Gets the caching type. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' - Caching CachingTypes `json:"caching,omitempty"` - // DiskSizeGB - Gets the initial disk size in GB for blank data disks, and the new desired size for existing OS and Data disks. - DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` - // ManagedDisk - Gets the managed disk details - ManagedDisk *ManagedDiskParameters `json:"managedDisk,omitempty"` - // DiskRestorePoint - Gets the disk restore point Id. - DiskRestorePoint *APIEntityReference `json:"diskRestorePoint,omitempty"` -} - -// RestorePointSourceVMOSDisk describes an Operating System disk. -type RestorePointSourceVMOSDisk struct { - // OsType - Gets the Operating System type. Possible values include: 'Windows', 'Linux' - OsType OperatingSystemType `json:"osType,omitempty"` - // EncryptionSettings - Gets the disk encryption settings. - EncryptionSettings *DiskEncryptionSettings `json:"encryptionSettings,omitempty"` - // Name - Gets the disk name. - Name *string `json:"name,omitempty"` - // Caching - Gets the caching type. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' - Caching CachingTypes `json:"caching,omitempty"` - // DiskSizeGB - Gets the disk size in GB. - DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` - // ManagedDisk - Gets the managed disk details - ManagedDisk *ManagedDiskParameters `json:"managedDisk,omitempty"` - // DiskRestorePoint - Gets the disk restore point Id. - DiskRestorePoint *APIEntityReference `json:"diskRestorePoint,omitempty"` -} - -// RestorePointSourceVMStorageProfile describes the storage profile. -type RestorePointSourceVMStorageProfile struct { - // OsDisk - Gets the OS disk of the VM captured at the time of the restore point creation. - OsDisk *RestorePointSourceVMOSDisk `json:"osDisk,omitempty"` - // DataDisks - Gets the data disks of the VM captured at the time of the restore point creation. - DataDisks *[]RestorePointSourceVMDataDisk `json:"dataDisks,omitempty"` -} - -// RetrieveBootDiagnosticsDataResult the SAS URIs of the console screenshot and serial log blobs. -type RetrieveBootDiagnosticsDataResult struct { - autorest.Response `json:"-"` - // ConsoleScreenshotBlobURI - READ-ONLY; The console screenshot blob URI - ConsoleScreenshotBlobURI *string `json:"consoleScreenshotBlobUri,omitempty"` - // SerialConsoleLogBlobURI - READ-ONLY; The serial console log blob URI. - SerialConsoleLogBlobURI *string `json:"serialConsoleLogBlobUri,omitempty"` -} - -// MarshalJSON is the custom marshaler for RetrieveBootDiagnosticsDataResult. -func (rbddr RetrieveBootDiagnosticsDataResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// RoleInstance describes the cloud service role instance. -type RoleInstance struct { - autorest.Response `json:"-"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource Name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource Type. - Type *string `json:"type,omitempty"` - // Location - READ-ONLY; Resource Location. - Location *string `json:"location,omitempty"` - // Tags - READ-ONLY; Resource tags. - Tags map[string]*string `json:"tags"` - Sku *InstanceSku `json:"sku,omitempty"` - Properties *RoleInstanceProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for RoleInstance. -func (ri RoleInstance) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ri.Sku != nil { - objectMap["sku"] = ri.Sku - } - if ri.Properties != nil { - objectMap["properties"] = ri.Properties - } - return json.Marshal(objectMap) -} - -// RoleInstanceInstanceView the instance view of the role instance. -type RoleInstanceInstanceView struct { - autorest.Response `json:"-"` - // PlatformUpdateDomain - READ-ONLY; The Update Domain. - PlatformUpdateDomain *int32 `json:"platformUpdateDomain,omitempty"` - // PlatformFaultDomain - READ-ONLY; The Fault Domain. - PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"` - // PrivateID - READ-ONLY; Specifies a unique identifier generated internally for the cloud service associated with this role instance.

      NOTE: If you are using Azure Diagnostics extension, this property can be used as 'DeploymentId' for querying details. - PrivateID *string `json:"privateId,omitempty"` - // Statuses - READ-ONLY - Statuses *[]ResourceInstanceViewStatus `json:"statuses,omitempty"` -} - -// MarshalJSON is the custom marshaler for RoleInstanceInstanceView. -func (riiv RoleInstanceInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// RoleInstanceListResult the list operation result. -type RoleInstanceListResult struct { - autorest.Response `json:"-"` - // Value - The list of resources. - Value *[]RoleInstance `json:"value,omitempty"` - // NextLink - The URI to fetch the next page of resources. Use this to get the next page of resources. Do this till nextLink is null to fetch all the resources. - NextLink *string `json:"nextLink,omitempty"` -} - -// RoleInstanceListResultIterator provides access to a complete listing of RoleInstance values. -type RoleInstanceListResultIterator struct { - i int - page RoleInstanceListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *RoleInstanceListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RoleInstanceListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *RoleInstanceListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter RoleInstanceListResultIterator) 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 RoleInstanceListResultIterator) Response() RoleInstanceListResult { - 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 RoleInstanceListResultIterator) Value() RoleInstance { - if !iter.page.NotDone() { - return RoleInstance{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the RoleInstanceListResultIterator type. -func NewRoleInstanceListResultIterator(page RoleInstanceListResultPage) RoleInstanceListResultIterator { - return RoleInstanceListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (rilr RoleInstanceListResult) IsEmpty() bool { - return rilr.Value == nil || len(*rilr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (rilr RoleInstanceListResult) hasNextLink() bool { - return rilr.NextLink != nil && len(*rilr.NextLink) != 0 -} - -// roleInstanceListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (rilr RoleInstanceListResult) roleInstanceListResultPreparer(ctx context.Context) (*http.Request, error) { - if !rilr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(rilr.NextLink))) -} - -// RoleInstanceListResultPage contains a page of RoleInstance values. -type RoleInstanceListResultPage struct { - fn func(context.Context, RoleInstanceListResult) (RoleInstanceListResult, error) - rilr RoleInstanceListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *RoleInstanceListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RoleInstanceListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.rilr) - if err != nil { - return err - } - page.rilr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *RoleInstanceListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page RoleInstanceListResultPage) NotDone() bool { - return !page.rilr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page RoleInstanceListResultPage) Response() RoleInstanceListResult { - return page.rilr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page RoleInstanceListResultPage) Values() []RoleInstance { - if page.rilr.IsEmpty() { - return nil - } - return *page.rilr.Value -} - -// Creates a new instance of the RoleInstanceListResultPage type. -func NewRoleInstanceListResultPage(cur RoleInstanceListResult, getNextPage func(context.Context, RoleInstanceListResult) (RoleInstanceListResult, error)) RoleInstanceListResultPage { - return RoleInstanceListResultPage{ - fn: getNextPage, - rilr: cur, - } -} - -// RoleInstanceNetworkProfile describes the network profile for the role instance. -type RoleInstanceNetworkProfile struct { - // NetworkInterfaces - READ-ONLY; Specifies the list of resource Ids for the network interfaces associated with the role instance. - NetworkInterfaces *[]SubResource `json:"networkInterfaces,omitempty"` -} - -// MarshalJSON is the custom marshaler for RoleInstanceNetworkProfile. -func (rinp RoleInstanceNetworkProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// RoleInstanceProperties role instance properties. -type RoleInstanceProperties struct { - NetworkProfile *RoleInstanceNetworkProfile `json:"networkProfile,omitempty"` - InstanceView *RoleInstanceInstanceView `json:"instanceView,omitempty"` -} - -// RoleInstances specifies a list of role instances from the cloud service. -type RoleInstances struct { - // RoleInstances - List of cloud service role instance names. Value of '*' will signify all role instances of the cloud service. - RoleInstances *[]string `json:"roleInstances,omitempty"` -} - -// RollbackStatusInfo information about rollback on failed VM instances after a OS Upgrade operation. -type RollbackStatusInfo struct { - // SuccessfullyRolledbackInstanceCount - READ-ONLY; The number of instances which have been successfully rolled back. - SuccessfullyRolledbackInstanceCount *int32 `json:"successfullyRolledbackInstanceCount,omitempty"` - // FailedRolledbackInstanceCount - READ-ONLY; The number of instances which failed to rollback. - FailedRolledbackInstanceCount *int32 `json:"failedRolledbackInstanceCount,omitempty"` - // RollbackError - READ-ONLY; Error details if OS rollback failed. - RollbackError *APIError `json:"rollbackError,omitempty"` -} - -// MarshalJSON is the custom marshaler for RollbackStatusInfo. -func (rsi RollbackStatusInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// RollingUpgradePolicy the configuration parameters used while performing a rolling upgrade. -type RollingUpgradePolicy struct { - // MaxBatchInstancePercent - The maximum percent of total virtual machine instances that will be upgraded simultaneously by the rolling upgrade in one batch. As this is a maximum, unhealthy instances in previous or future batches can cause the percentage of instances in a batch to decrease to ensure higher reliability. The default value for this parameter is 20%. - MaxBatchInstancePercent *int32 `json:"maxBatchInstancePercent,omitempty"` - // MaxUnhealthyInstancePercent - The maximum percentage of the total virtual machine instances in the scale set that can be simultaneously unhealthy, either as a result of being upgraded, or by being found in an unhealthy state by the virtual machine health checks before the rolling upgrade aborts. This constraint will be checked prior to starting any batch. The default value for this parameter is 20%. - MaxUnhealthyInstancePercent *int32 `json:"maxUnhealthyInstancePercent,omitempty"` - // MaxUnhealthyUpgradedInstancePercent - The maximum percentage of upgraded virtual machine instances that can be found to be in an unhealthy state. This check will happen after each batch is upgraded. If this percentage is ever exceeded, the rolling update aborts. The default value for this parameter is 20%. - MaxUnhealthyUpgradedInstancePercent *int32 `json:"maxUnhealthyUpgradedInstancePercent,omitempty"` - // PauseTimeBetweenBatches - The wait time between completing the update for all virtual machines in one batch and starting the next batch. The time duration should be specified in ISO 8601 format. The default value is 0 seconds (PT0S). - PauseTimeBetweenBatches *string `json:"pauseTimeBetweenBatches,omitempty"` - // EnableCrossZoneUpgrade - Allow VMSS to ignore AZ boundaries when constructing upgrade batches. Take into consideration the Update Domain and maxBatchInstancePercent to determine the batch size. - EnableCrossZoneUpgrade *bool `json:"enableCrossZoneUpgrade,omitempty"` - // PrioritizeUnhealthyInstances - Upgrade all unhealthy instances in a scale set before any healthy instances. - PrioritizeUnhealthyInstances *bool `json:"prioritizeUnhealthyInstances,omitempty"` -} - -// RollingUpgradeProgressInfo information about the number of virtual machine instances in each upgrade -// state. -type RollingUpgradeProgressInfo struct { - // SuccessfulInstanceCount - READ-ONLY; The number of instances that have been successfully upgraded. - SuccessfulInstanceCount *int32 `json:"successfulInstanceCount,omitempty"` - // FailedInstanceCount - READ-ONLY; The number of instances that have failed to be upgraded successfully. - FailedInstanceCount *int32 `json:"failedInstanceCount,omitempty"` - // InProgressInstanceCount - READ-ONLY; The number of instances that are currently being upgraded. - InProgressInstanceCount *int32 `json:"inProgressInstanceCount,omitempty"` - // PendingInstanceCount - READ-ONLY; The number of instances that have not yet begun to be upgraded. - PendingInstanceCount *int32 `json:"pendingInstanceCount,omitempty"` -} - -// MarshalJSON is the custom marshaler for RollingUpgradeProgressInfo. -func (rupi RollingUpgradeProgressInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// RollingUpgradeRunningStatus information about the current running state of the overall upgrade. -type RollingUpgradeRunningStatus struct { - // Code - READ-ONLY; Code indicating the current status of the upgrade. Possible values include: 'RollingUpgradeStatusCodeRollingForward', 'RollingUpgradeStatusCodeCancelled', 'RollingUpgradeStatusCodeCompleted', 'RollingUpgradeStatusCodeFaulted' - Code RollingUpgradeStatusCode `json:"code,omitempty"` - // StartTime - READ-ONLY; Start time of the upgrade. - StartTime *date.Time `json:"startTime,omitempty"` - // LastAction - READ-ONLY; The last action performed on the rolling upgrade. Possible values include: 'Start', 'Cancel' - LastAction RollingUpgradeActionType `json:"lastAction,omitempty"` - // LastActionTime - READ-ONLY; Last action time of the upgrade. - LastActionTime *date.Time `json:"lastActionTime,omitempty"` -} - -// MarshalJSON is the custom marshaler for RollingUpgradeRunningStatus. -func (rurs RollingUpgradeRunningStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// RollingUpgradeStatusInfo the status of the latest virtual machine scale set rolling upgrade. -type RollingUpgradeStatusInfo struct { - autorest.Response `json:"-"` - *RollingUpgradeStatusInfoProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; 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 RollingUpgradeStatusInfo. -func (rusi RollingUpgradeStatusInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rusi.RollingUpgradeStatusInfoProperties != nil { - objectMap["properties"] = rusi.RollingUpgradeStatusInfoProperties - } - 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. -type RollingUpgradeStatusInfoProperties struct { - // Policy - READ-ONLY; The rolling upgrade policies applied for this upgrade. - Policy *RollingUpgradePolicy `json:"policy,omitempty"` - // RunningStatus - READ-ONLY; Information about the current running state of the overall upgrade. - RunningStatus *RollingUpgradeRunningStatus `json:"runningStatus,omitempty"` - // Progress - READ-ONLY; Information about the number of virtual machine instances in each upgrade state. - Progress *RollingUpgradeProgressInfo `json:"progress,omitempty"` - // Error - READ-ONLY; Error details for this upgrade, if there are any. - Error *APIError `json:"error,omitempty"` -} - -// MarshalJSON is the custom marshaler for RollingUpgradeStatusInfoProperties. -func (rusip RollingUpgradeStatusInfoProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// 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. - ID *string `json:"id,omitempty"` - // OsType - The Operating System type. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' - OsType OperatingSystemTypes `json:"osType,omitempty"` - // Label - The VM run command label. - Label *string `json:"label,omitempty"` - // Description - The VM run command description. - Description *string `json:"description,omitempty"` -} - -// RunCommandDocumentBase describes the properties of a Run Command metadata. -type RunCommandDocumentBase struct { - // Schema - The VM run command schema. - Schema *string `json:"$schema,omitempty"` - // ID - The VM run command id. - ID *string `json:"id,omitempty"` - // OsType - The Operating System type. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' - OsType OperatingSystemTypes `json:"osType,omitempty"` - // Label - The VM run command label. - Label *string `json:"label,omitempty"` - // Description - The VM run command description. - Description *string `json:"description,omitempty"` -} - -// RunCommandInput capture Virtual Machine parameters. -type RunCommandInput struct { - // CommandID - The run command id. - CommandID *string `json:"commandId,omitempty"` - // Script - Optional. The script to be executed. When this value is given, the given script will override the default script of the command. - Script *[]string `json:"script,omitempty"` - // Parameters - The run command parameters. - Parameters *[]RunCommandInputParameter `json:"parameters,omitempty"` -} - -// RunCommandInputParameter describes the properties of a run command parameter. -type RunCommandInputParameter struct { - // Name - The run command parameter name. - Name *string `json:"name,omitempty"` - // Value - The run command parameter value. - Value *string `json:"value,omitempty"` -} - -// RunCommandListResult the List Virtual Machine operation response. -type RunCommandListResult struct { - autorest.Response `json:"-"` - // Value - The list of virtual machine run commands. - Value *[]RunCommandDocumentBase `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of run commands. Call ListNext() with this to fetch the next page of run commands. - NextLink *string `json:"nextLink,omitempty"` -} - -// RunCommandListResultIterator provides access to a complete listing of RunCommandDocumentBase values. -type RunCommandListResultIterator struct { - i int - page RunCommandListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *RunCommandListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RunCommandListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *RunCommandListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter RunCommandListResultIterator) 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 RunCommandListResultIterator) Response() RunCommandListResult { - 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 RunCommandListResultIterator) Value() RunCommandDocumentBase { - if !iter.page.NotDone() { - return RunCommandDocumentBase{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the RunCommandListResultIterator type. -func NewRunCommandListResultIterator(page RunCommandListResultPage) RunCommandListResultIterator { - return RunCommandListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (rclr RunCommandListResult) IsEmpty() bool { - return rclr.Value == nil || len(*rclr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (rclr RunCommandListResult) hasNextLink() bool { - return rclr.NextLink != nil && len(*rclr.NextLink) != 0 -} - -// runCommandListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (rclr RunCommandListResult) runCommandListResultPreparer(ctx context.Context) (*http.Request, error) { - if !rclr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(rclr.NextLink))) -} - -// RunCommandListResultPage contains a page of RunCommandDocumentBase values. -type RunCommandListResultPage struct { - fn func(context.Context, RunCommandListResult) (RunCommandListResult, error) - rclr RunCommandListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *RunCommandListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RunCommandListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.rclr) - if err != nil { - return err - } - page.rclr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *RunCommandListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page RunCommandListResultPage) NotDone() bool { - return !page.rclr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page RunCommandListResultPage) Response() RunCommandListResult { - return page.rclr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page RunCommandListResultPage) Values() []RunCommandDocumentBase { - if page.rclr.IsEmpty() { - return nil - } - return *page.rclr.Value -} - -// Creates a new instance of the RunCommandListResultPage type. -func NewRunCommandListResultPage(cur RunCommandListResult, getNextPage func(context.Context, RunCommandListResult) (RunCommandListResult, error)) RunCommandListResultPage { - return RunCommandListResultPage{ - fn: getNextPage, - rclr: cur, - } -} - -// RunCommandParameterDefinition describes the properties of a run command parameter. -type RunCommandParameterDefinition struct { - // Name - The run command parameter name. - Name *string `json:"name,omitempty"` - // Type - The run command parameter type. - Type *string `json:"type,omitempty"` - // DefaultValue - The run command parameter default value. - DefaultValue *string `json:"defaultValue,omitempty"` - // Required - The run command parameter required. - Required *bool `json:"required,omitempty"` -} - -// RunCommandResult ... -type RunCommandResult struct { - autorest.Response `json:"-"` - // Value - Run command operation response. - Value *[]InstanceViewStatus `json:"value,omitempty"` -} - -// ScaleInPolicy describes a scale-in policy for a virtual machine scale set. -type ScaleInPolicy struct { - // Rules - The rules to be followed when scaling-in a virtual machine scale set.

      Possible values are:

      **Default** When a virtual machine scale set is scaled in, the scale set will first be balanced across zones if it is a zonal scale set. Then, it will be balanced across Fault Domains as far as possible. Within each Fault Domain, the virtual machines chosen for removal will be the newest ones that are not protected from scale-in.

      **OldestVM** When a virtual machine scale set is being scaled-in, the oldest virtual machines that are not protected from scale-in will be chosen for removal. For zonal virtual machine scale sets, the scale set will first be balanced across zones. Within each zone, the oldest virtual machines that are not protected will be chosen for removal.

      **NewestVM** When a virtual machine scale set is being scaled-in, the newest virtual machines that are not protected from scale-in will be chosen for removal. For zonal virtual machine scale sets, the scale set will first be balanced across zones. Within each zone, the newest virtual machines that are not protected will be chosen for removal.

      - Rules *[]VirtualMachineScaleSetScaleInRules `json:"rules,omitempty"` - // ForceDeletion - This property allows you to specify if virtual machines chosen for removal have to be force deleted when a virtual machine scale set is being scaled-in.(Feature in Preview) - ForceDeletion *bool `json:"forceDeletion,omitempty"` -} - -// ScheduledEventsProfile ... -type ScheduledEventsProfile struct { - // TerminateNotificationProfile - Specifies Terminate Scheduled Event related configurations. - TerminateNotificationProfile *TerminateNotificationProfile `json:"terminateNotificationProfile,omitempty"` -} - -// SecurityProfile specifies the Security profile settings for the virtual machine or virtual machine scale -// set. -type SecurityProfile struct { - // UefiSettings - Specifies the security settings like secure boot and vTPM used while creating the virtual machine.

      Minimum api-version: 2020-12-01 - UefiSettings *UefiSettings `json:"uefiSettings,omitempty"` - // EncryptionAtHost - This property can be used by user in the request to enable or disable the Host Encryption for the virtual machine or virtual machine scale set. This will enable the encryption for all the disks including Resource/Temp disk at host itself.

      Default: The Encryption at host will be disabled unless this property is set to true for the resource. - EncryptionAtHost *bool `json:"encryptionAtHost,omitempty"` - // SecurityType - Specifies the SecurityType of the virtual machine. It has to be set to any specified value to enable UefiSettings.

      Default: UefiSettings will not be enabled unless this property is set. Possible values include: 'SecurityTypesTrustedLaunch', 'SecurityTypesConfidentialVM' - SecurityType SecurityTypes `json:"securityType,omitempty"` -} - -// SharedGallery specifies information about the Shared Gallery that you want to create or update. -type SharedGallery struct { - autorest.Response `json:"-"` - *SharedGalleryIdentifier `json:"identifier,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Location - READ-ONLY; Resource location - Location *string `json:"location,omitempty"` -} - -// MarshalJSON is the custom marshaler for SharedGallery. -func (sg SharedGallery) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sg.SharedGalleryIdentifier != nil { - objectMap["identifier"] = sg.SharedGalleryIdentifier - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for SharedGallery struct. -func (sg *SharedGallery) 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 "identifier": - if v != nil { - var sharedGalleryIdentifier SharedGalleryIdentifier - err = json.Unmarshal(*v, &sharedGalleryIdentifier) - if err != nil { - return err - } - sg.SharedGalleryIdentifier = &sharedGalleryIdentifier - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - sg.Name = &name - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - sg.Location = &location - } - } - } - - return nil -} - -// SharedGalleryDataDiskImage this is the data disk image. -type SharedGalleryDataDiskImage struct { - // Lun - This property specifies the logical unit number of the data disk. This value is used to identify data disks within the Virtual Machine and therefore must be unique for each data disk attached to the Virtual Machine. - Lun *int32 `json:"lun,omitempty"` - // DiskSizeGB - READ-ONLY; This property indicates the size of the VHD to be created. - DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` - // HostCaching - The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'. Possible values include: 'SharedGalleryHostCachingNone', 'SharedGalleryHostCachingReadOnly', 'SharedGalleryHostCachingReadWrite' - HostCaching SharedGalleryHostCaching `json:"hostCaching,omitempty"` -} - -// MarshalJSON is the custom marshaler for SharedGalleryDataDiskImage. -func (sgddi SharedGalleryDataDiskImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sgddi.Lun != nil { - objectMap["lun"] = sgddi.Lun - } - if sgddi.HostCaching != "" { - objectMap["hostCaching"] = sgddi.HostCaching - } - return json.Marshal(objectMap) -} - -// SharedGalleryDiskImage this is the disk image base class. -type SharedGalleryDiskImage struct { - // DiskSizeGB - READ-ONLY; This property indicates the size of the VHD to be created. - DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` - // HostCaching - The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'. Possible values include: 'SharedGalleryHostCachingNone', 'SharedGalleryHostCachingReadOnly', 'SharedGalleryHostCachingReadWrite' - HostCaching SharedGalleryHostCaching `json:"hostCaching,omitempty"` -} - -// MarshalJSON is the custom marshaler for SharedGalleryDiskImage. -func (sgdi SharedGalleryDiskImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sgdi.HostCaching != "" { - objectMap["hostCaching"] = sgdi.HostCaching - } - return json.Marshal(objectMap) -} - -// SharedGalleryIdentifier the identifier information of shared gallery. -type SharedGalleryIdentifier struct { - // UniqueID - The unique id of this shared gallery. - UniqueID *string `json:"uniqueId,omitempty"` -} - -// SharedGalleryImage specifies information about the gallery image definition that you want to create or -// update. -type SharedGalleryImage struct { - autorest.Response `json:"-"` - *SharedGalleryImageProperties `json:"properties,omitempty"` - *SharedGalleryIdentifier `json:"identifier,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Location - READ-ONLY; Resource location - Location *string `json:"location,omitempty"` -} - -// MarshalJSON is the custom marshaler for SharedGalleryImage. -func (sgi SharedGalleryImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sgi.SharedGalleryImageProperties != nil { - objectMap["properties"] = sgi.SharedGalleryImageProperties - } - if sgi.SharedGalleryIdentifier != nil { - objectMap["identifier"] = sgi.SharedGalleryIdentifier - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for SharedGalleryImage struct. -func (sgi *SharedGalleryImage) 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 sharedGalleryImageProperties SharedGalleryImageProperties - err = json.Unmarshal(*v, &sharedGalleryImageProperties) - if err != nil { - return err - } - sgi.SharedGalleryImageProperties = &sharedGalleryImageProperties - } - case "identifier": - if v != nil { - var sharedGalleryIdentifier SharedGalleryIdentifier - err = json.Unmarshal(*v, &sharedGalleryIdentifier) - if err != nil { - return err - } - sgi.SharedGalleryIdentifier = &sharedGalleryIdentifier - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - sgi.Name = &name - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - sgi.Location = &location - } - } - } - - return nil -} - -// SharedGalleryImageList the List Shared Gallery Images operation response. -type SharedGalleryImageList struct { - autorest.Response `json:"-"` - // Value - A list of shared gallery images. - Value *[]SharedGalleryImage `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of shared gallery images. Call ListNext() with this to fetch the next page of shared gallery images. - NextLink *string `json:"nextLink,omitempty"` -} - -// SharedGalleryImageListIterator provides access to a complete listing of SharedGalleryImage values. -type SharedGalleryImageListIterator struct { - i int - page SharedGalleryImageListPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *SharedGalleryImageListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SharedGalleryImageListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *SharedGalleryImageListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter SharedGalleryImageListIterator) 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 SharedGalleryImageListIterator) Response() SharedGalleryImageList { - 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 SharedGalleryImageListIterator) Value() SharedGalleryImage { - if !iter.page.NotDone() { - return SharedGalleryImage{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the SharedGalleryImageListIterator type. -func NewSharedGalleryImageListIterator(page SharedGalleryImageListPage) SharedGalleryImageListIterator { - return SharedGalleryImageListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (sgil SharedGalleryImageList) IsEmpty() bool { - return sgil.Value == nil || len(*sgil.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (sgil SharedGalleryImageList) hasNextLink() bool { - return sgil.NextLink != nil && len(*sgil.NextLink) != 0 -} - -// sharedGalleryImageListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (sgil SharedGalleryImageList) sharedGalleryImageListPreparer(ctx context.Context) (*http.Request, error) { - if !sgil.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(sgil.NextLink))) -} - -// SharedGalleryImageListPage contains a page of SharedGalleryImage values. -type SharedGalleryImageListPage struct { - fn func(context.Context, SharedGalleryImageList) (SharedGalleryImageList, error) - sgil SharedGalleryImageList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *SharedGalleryImageListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SharedGalleryImageListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.sgil) - if err != nil { - return err - } - page.sgil = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *SharedGalleryImageListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page SharedGalleryImageListPage) NotDone() bool { - return !page.sgil.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page SharedGalleryImageListPage) Response() SharedGalleryImageList { - return page.sgil -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page SharedGalleryImageListPage) Values() []SharedGalleryImage { - if page.sgil.IsEmpty() { - return nil - } - return *page.sgil.Value -} - -// Creates a new instance of the SharedGalleryImageListPage type. -func NewSharedGalleryImageListPage(cur SharedGalleryImageList, getNextPage func(context.Context, SharedGalleryImageList) (SharedGalleryImageList, error)) SharedGalleryImageListPage { - return SharedGalleryImageListPage{ - fn: getNextPage, - sgil: cur, - } -} - -// SharedGalleryImageProperties describes the properties of a gallery image definition. -type SharedGalleryImageProperties struct { - // OsType - This property allows you to specify the type of the OS that is included in the disk when creating a VM from a managed image.

      Possible values are:

      **Windows**

      **Linux**. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' - OsType OperatingSystemTypes `json:"osType,omitempty"` - // OsState - This property allows the user to specify whether the virtual machines created under this image are 'Generalized' or 'Specialized'. Possible values include: 'Generalized', 'Specialized' - OsState OperatingSystemStateTypes `json:"osState,omitempty"` - // EndOfLifeDate - The end of life date of the gallery image definition. This property can be used for decommissioning purposes. This property is updatable. - EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` - Identifier *GalleryImageIdentifier `json:"identifier,omitempty"` - Recommended *RecommendedMachineConfiguration `json:"recommended,omitempty"` - Disallowed *Disallowed `json:"disallowed,omitempty"` - // HyperVGeneration - The hypervisor generation of the Virtual Machine. Applicable to OS disks only. Possible values include: 'V1', 'V2' - HyperVGeneration HyperVGeneration `json:"hyperVGeneration,omitempty"` - // Features - A list of gallery image features. - Features *[]GalleryImageFeature `json:"features,omitempty"` - PurchasePlan *ImagePurchasePlan `json:"purchasePlan,omitempty"` - // Architecture - Possible values include: 'X64', 'Arm64' - Architecture Architecture `json:"architecture,omitempty"` -} - -// SharedGalleryImageVersion specifies information about the gallery image version that you want to create -// or update. -type SharedGalleryImageVersion struct { - autorest.Response `json:"-"` - *SharedGalleryImageVersionProperties `json:"properties,omitempty"` - *SharedGalleryIdentifier `json:"identifier,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Location - READ-ONLY; Resource location - Location *string `json:"location,omitempty"` -} - -// MarshalJSON is the custom marshaler for SharedGalleryImageVersion. -func (sgiv SharedGalleryImageVersion) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sgiv.SharedGalleryImageVersionProperties != nil { - objectMap["properties"] = sgiv.SharedGalleryImageVersionProperties - } - if sgiv.SharedGalleryIdentifier != nil { - objectMap["identifier"] = sgiv.SharedGalleryIdentifier - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for SharedGalleryImageVersion struct. -func (sgiv *SharedGalleryImageVersion) 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 sharedGalleryImageVersionProperties SharedGalleryImageVersionProperties - err = json.Unmarshal(*v, &sharedGalleryImageVersionProperties) - if err != nil { - return err - } - sgiv.SharedGalleryImageVersionProperties = &sharedGalleryImageVersionProperties - } - case "identifier": - if v != nil { - var sharedGalleryIdentifier SharedGalleryIdentifier - err = json.Unmarshal(*v, &sharedGalleryIdentifier) - if err != nil { - return err - } - sgiv.SharedGalleryIdentifier = &sharedGalleryIdentifier - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - sgiv.Name = &name - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - sgiv.Location = &location - } - } - } - - return nil -} - -// SharedGalleryImageVersionList the List Shared Gallery Image versions operation response. -type SharedGalleryImageVersionList struct { - autorest.Response `json:"-"` - // Value - A list of shared gallery images versions. - Value *[]SharedGalleryImageVersion `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of shared gallery image versions. Call ListNext() with this to fetch the next page of shared gallery image versions. - NextLink *string `json:"nextLink,omitempty"` -} - -// SharedGalleryImageVersionListIterator provides access to a complete listing of SharedGalleryImageVersion -// values. -type SharedGalleryImageVersionListIterator struct { - i int - page SharedGalleryImageVersionListPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *SharedGalleryImageVersionListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SharedGalleryImageVersionListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *SharedGalleryImageVersionListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter SharedGalleryImageVersionListIterator) 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 SharedGalleryImageVersionListIterator) Response() SharedGalleryImageVersionList { - 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 SharedGalleryImageVersionListIterator) Value() SharedGalleryImageVersion { - if !iter.page.NotDone() { - return SharedGalleryImageVersion{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the SharedGalleryImageVersionListIterator type. -func NewSharedGalleryImageVersionListIterator(page SharedGalleryImageVersionListPage) SharedGalleryImageVersionListIterator { - return SharedGalleryImageVersionListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (sgivl SharedGalleryImageVersionList) IsEmpty() bool { - return sgivl.Value == nil || len(*sgivl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (sgivl SharedGalleryImageVersionList) hasNextLink() bool { - return sgivl.NextLink != nil && len(*sgivl.NextLink) != 0 -} - -// sharedGalleryImageVersionListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (sgivl SharedGalleryImageVersionList) sharedGalleryImageVersionListPreparer(ctx context.Context) (*http.Request, error) { - if !sgivl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(sgivl.NextLink))) -} - -// SharedGalleryImageVersionListPage contains a page of SharedGalleryImageVersion values. -type SharedGalleryImageVersionListPage struct { - fn func(context.Context, SharedGalleryImageVersionList) (SharedGalleryImageVersionList, error) - sgivl SharedGalleryImageVersionList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *SharedGalleryImageVersionListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SharedGalleryImageVersionListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.sgivl) - if err != nil { - return err - } - page.sgivl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *SharedGalleryImageVersionListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page SharedGalleryImageVersionListPage) NotDone() bool { - return !page.sgivl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page SharedGalleryImageVersionListPage) Response() SharedGalleryImageVersionList { - return page.sgivl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page SharedGalleryImageVersionListPage) Values() []SharedGalleryImageVersion { - if page.sgivl.IsEmpty() { - return nil - } - return *page.sgivl.Value -} - -// Creates a new instance of the SharedGalleryImageVersionListPage type. -func NewSharedGalleryImageVersionListPage(cur SharedGalleryImageVersionList, getNextPage func(context.Context, SharedGalleryImageVersionList) (SharedGalleryImageVersionList, error)) SharedGalleryImageVersionListPage { - return SharedGalleryImageVersionListPage{ - fn: getNextPage, - sgivl: cur, - } -} - -// SharedGalleryImageVersionProperties describes the properties of a gallery image version. -type SharedGalleryImageVersionProperties struct { - // PublishedDate - The published date of the gallery image version Definition. This property can be used for decommissioning purposes. This property is updatable. - PublishedDate *date.Time `json:"publishedDate,omitempty"` - // EndOfLifeDate - The end of life date of the gallery image version Definition. This property can be used for decommissioning purposes. This property is updatable. - EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` - // ExcludeFromLatest - If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. - ExcludeFromLatest *bool `json:"excludeFromLatest,omitempty"` - // StorageProfile - Describes the storage profile of the image version. - StorageProfile *SharedGalleryImageVersionStorageProfile `json:"storageProfile,omitempty"` -} - -// SharedGalleryImageVersionStorageProfile this is the storage profile of a Gallery Image Version. -type SharedGalleryImageVersionStorageProfile struct { - OsDiskImage *SharedGalleryOSDiskImage `json:"osDiskImage,omitempty"` - // DataDiskImages - A list of data disk images. - DataDiskImages *[]SharedGalleryDataDiskImage `json:"dataDiskImages,omitempty"` -} - -// SharedGalleryList the List Shared Galleries operation response. -type SharedGalleryList struct { - autorest.Response `json:"-"` - // Value - A list of shared galleries. - Value *[]SharedGallery `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of shared galleries. Call ListNext() with this to fetch the next page of shared galleries. - NextLink *string `json:"nextLink,omitempty"` -} - -// SharedGalleryListIterator provides access to a complete listing of SharedGallery values. -type SharedGalleryListIterator struct { - i int - page SharedGalleryListPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *SharedGalleryListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SharedGalleryListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *SharedGalleryListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter SharedGalleryListIterator) 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 SharedGalleryListIterator) Response() SharedGalleryList { - 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 SharedGalleryListIterator) Value() SharedGallery { - if !iter.page.NotDone() { - return SharedGallery{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the SharedGalleryListIterator type. -func NewSharedGalleryListIterator(page SharedGalleryListPage) SharedGalleryListIterator { - return SharedGalleryListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (sgl SharedGalleryList) IsEmpty() bool { - return sgl.Value == nil || len(*sgl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (sgl SharedGalleryList) hasNextLink() bool { - return sgl.NextLink != nil && len(*sgl.NextLink) != 0 -} - -// sharedGalleryListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (sgl SharedGalleryList) sharedGalleryListPreparer(ctx context.Context) (*http.Request, error) { - if !sgl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(sgl.NextLink))) -} - -// SharedGalleryListPage contains a page of SharedGallery values. -type SharedGalleryListPage struct { - fn func(context.Context, SharedGalleryList) (SharedGalleryList, error) - sgl SharedGalleryList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *SharedGalleryListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SharedGalleryListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.sgl) - if err != nil { - return err - } - page.sgl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *SharedGalleryListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page SharedGalleryListPage) NotDone() bool { - return !page.sgl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page SharedGalleryListPage) Response() SharedGalleryList { - return page.sgl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page SharedGalleryListPage) Values() []SharedGallery { - if page.sgl.IsEmpty() { - return nil - } - return *page.sgl.Value -} - -// Creates a new instance of the SharedGalleryListPage type. -func NewSharedGalleryListPage(cur SharedGalleryList, getNextPage func(context.Context, SharedGalleryList) (SharedGalleryList, error)) SharedGalleryListPage { - return SharedGalleryListPage{ - fn: getNextPage, - sgl: cur, - } -} - -// SharedGalleryOSDiskImage this is the OS disk image. -type SharedGalleryOSDiskImage struct { - // DiskSizeGB - READ-ONLY; This property indicates the size of the VHD to be created. - DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` - // HostCaching - The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'. Possible values include: 'SharedGalleryHostCachingNone', 'SharedGalleryHostCachingReadOnly', 'SharedGalleryHostCachingReadWrite' - HostCaching SharedGalleryHostCaching `json:"hostCaching,omitempty"` -} - -// MarshalJSON is the custom marshaler for SharedGalleryOSDiskImage. -func (sgodi SharedGalleryOSDiskImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sgodi.HostCaching != "" { - objectMap["hostCaching"] = sgodi.HostCaching - } - return json.Marshal(objectMap) -} - -// ShareInfoElement ... -type ShareInfoElement struct { - // VMURI - READ-ONLY; A relative URI containing the ID of the VM that has the disk attached. - VMURI *string `json:"vmUri,omitempty"` -} - -// MarshalJSON is the custom marshaler for ShareInfoElement. -func (sie ShareInfoElement) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// SharingProfile profile for gallery sharing to subscription or tenant -type SharingProfile struct { - // Permissions - This property allows you to specify the permission of sharing gallery.

      Possible values are:

      **Private**

      **Groups**

      **Community**. Possible values include: 'Private', 'Groups', 'Community' - Permissions GallerySharingPermissionTypes `json:"permissions,omitempty"` - // Groups - READ-ONLY; A list of sharing profile groups. - Groups *[]SharingProfileGroup `json:"groups,omitempty"` - // CommunityGalleryInfo - Information of community gallery if current gallery is shared to community. - CommunityGalleryInfo *CommunityGalleryInfo `json:"communityGalleryInfo,omitempty"` -} - -// MarshalJSON is the custom marshaler for SharingProfile. -func (sp SharingProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sp.Permissions != "" { - objectMap["permissions"] = sp.Permissions - } - if sp.CommunityGalleryInfo != nil { - objectMap["communityGalleryInfo"] = sp.CommunityGalleryInfo - } - return json.Marshal(objectMap) -} - -// SharingProfileGroup group of the gallery sharing profile -type SharingProfileGroup struct { - // Type - This property allows you to specify the type of sharing group.

      Possible values are:

      **Subscriptions**

      **AADTenants**. Possible values include: 'Subscriptions', 'AADTenants' - Type SharingProfileGroupTypes `json:"type,omitempty"` - // Ids - A list of subscription/tenant ids the gallery is aimed to be shared to. - Ids *[]string `json:"ids,omitempty"` -} - -// SharingStatus sharing status of current gallery. -type SharingStatus struct { - // AggregatedState - Aggregated sharing state of current gallery. Possible values include: 'SharingStateSucceeded', 'SharingStateInProgress', 'SharingStateFailed', 'SharingStateUnknown' - AggregatedState SharingState `json:"aggregatedState,omitempty"` - // Summary - Summary of all regional sharing status. - Summary *[]RegionalSharingStatus `json:"summary,omitempty"` -} - -// SharingUpdate specifies information about the gallery sharing profile update. -type SharingUpdate struct { - autorest.Response `json:"-"` - // OperationType - This property allows you to specify the operation type of gallery sharing update.

      Possible values are:

      **Add**

      **Remove**

      **Reset**. Possible values include: 'Add', 'Remove', 'Reset', 'EnableCommunity' - OperationType SharingUpdateOperationTypes `json:"operationType,omitempty"` - // Groups - A list of sharing profile groups. - Groups *[]SharingProfileGroup `json:"groups,omitempty"` -} - -// Sku describes a virtual machine scale set sku. NOTE: If the new VM SKU is not supported on the hardware -// the scale set is currently on, you need to deallocate the VMs in the scale set before you modify the SKU -// name. -type Sku struct { - // Name - The sku name. - Name *string `json:"name,omitempty"` - // Tier - Specifies the tier of virtual machines in a scale set.

      Possible Values:

      **Standard**

      **Basic** - Tier *string `json:"tier,omitempty"` - // Capacity - Specifies the number of virtual machines in the scale set. - Capacity *int64 `json:"capacity,omitempty"` -} - -// Snapshot snapshot resource. -type Snapshot struct { - autorest.Response `json:"-"` - // ManagedBy - READ-ONLY; Unused. Always Null. - ManagedBy *string `json:"managedBy,omitempty"` - Sku *SnapshotSku `json:"sku,omitempty"` - // ExtendedLocation - The extended location where the snapshot will be created. Extended location cannot be changed. - ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` - *SnapshotProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; 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 Snapshot. -func (s Snapshot) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if s.Sku != nil { - objectMap["sku"] = s.Sku - } - if s.ExtendedLocation != nil { - objectMap["extendedLocation"] = s.ExtendedLocation - } - if s.SnapshotProperties != nil { - objectMap["properties"] = s.SnapshotProperties - } - 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 SnapshotSku - err = json.Unmarshal(*v, &sku) - if err != nil { - return err - } - s.Sku = &sku - } - case "extendedLocation": - if v != nil { - var extendedLocation ExtendedLocation - err = json.Unmarshal(*v, &extendedLocation) - if err != nil { - return err - } - s.ExtendedLocation = &extendedLocation - } - 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 "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. -type SnapshotList struct { - autorest.Response `json:"-"` - // Value - A list of snapshots. - Value *[]Snapshot `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of snapshots. Call ListNext() with this to fetch the next page of snapshots. - NextLink *string `json:"nextLink,omitempty"` -} - -// SnapshotListIterator provides access to a complete listing of Snapshot values. -type SnapshotListIterator struct { - i int - page SnapshotListPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *SnapshotListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *SnapshotListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter SnapshotListIterator) 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 SnapshotListIterator) Response() SnapshotList { - 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 SnapshotListIterator) Value() Snapshot { - if !iter.page.NotDone() { - return Snapshot{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the SnapshotListIterator type. -func NewSnapshotListIterator(page SnapshotListPage) SnapshotListIterator { - return SnapshotListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (sl SnapshotList) IsEmpty() bool { - return sl.Value == nil || len(*sl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (sl SnapshotList) hasNextLink() bool { - return sl.NextLink != nil && len(*sl.NextLink) != 0 -} - -// snapshotListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (sl SnapshotList) snapshotListPreparer(ctx context.Context) (*http.Request, error) { - if !sl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(sl.NextLink))) -} - -// SnapshotListPage contains a page of Snapshot values. -type SnapshotListPage struct { - fn func(context.Context, SnapshotList) (SnapshotList, error) - sl SnapshotList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *SnapshotListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.sl) - if err != nil { - return err - } - page.sl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *SnapshotListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page SnapshotListPage) NotDone() bool { - return !page.sl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page SnapshotListPage) Response() SnapshotList { - return page.sl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page SnapshotListPage) Values() []Snapshot { - if page.sl.IsEmpty() { - return nil - } - return *page.sl.Value -} - -// Creates a new instance of the SnapshotListPage type. -func NewSnapshotListPage(cur SnapshotList, getNextPage func(context.Context, SnapshotList) (SnapshotList, error)) SnapshotListPage { - return SnapshotListPage{ - fn: getNextPage, - sl: cur, - } -} - -// SnapshotProperties snapshot resource properties. -type SnapshotProperties struct { - // TimeCreated - READ-ONLY; The time when the snapshot was created. - TimeCreated *date.Time `json:"timeCreated,omitempty"` - // OsType - The Operating System type. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' - OsType OperatingSystemTypes `json:"osType,omitempty"` - // HyperVGeneration - The hypervisor generation of the Virtual Machine. Applicable to OS disks only. Possible values include: 'V1', 'V2' - HyperVGeneration HyperVGeneration `json:"hyperVGeneration,omitempty"` - // PurchasePlan - Purchase plan information for the image from which the source disk for the snapshot was originally created. - PurchasePlan *PurchasePlan `json:"purchasePlan,omitempty"` - // SupportedCapabilities - List of supported capabilities for the image from which the source disk from the snapshot was originally created. - SupportedCapabilities *SupportedCapabilities `json:"supportedCapabilities,omitempty"` - // CreationData - Disk source information. CreationData information cannot be changed after the disk has been created. - CreationData *CreationData `json:"creationData,omitempty"` - // DiskSizeGB - If creationData.createOption is Empty, this field is mandatory and it indicates the size of the disk to create. If this field is present for updates or creation with other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size. - DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` - // DiskSizeBytes - READ-ONLY; The size of the disk in bytes. This field is read only. - DiskSizeBytes *int64 `json:"diskSizeBytes,omitempty"` - // DiskState - The state of the snapshot. Possible values include: 'Unattached', 'Attached', 'Reserved', 'Frozen', 'ActiveSAS', 'ActiveSASFrozen', 'ReadyToUpload', 'ActiveUpload' - DiskState DiskState `json:"diskState,omitempty"` - // UniqueID - READ-ONLY; Unique Guid identifying the resource. - UniqueID *string `json:"uniqueId,omitempty"` - // EncryptionSettingsCollection - Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. - EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` - // ProvisioningState - READ-ONLY; The disk provisioning state. - ProvisioningState *string `json:"provisioningState,omitempty"` - // Incremental - Whether a snapshot is incremental. Incremental snapshots on the same disk occupy less space than full snapshots and can be diffed. - Incremental *bool `json:"incremental,omitempty"` - // IncrementalSnapshotFamilyID - READ-ONLY; Incremental snapshots for a disk share an incremental snapshot family id. The Get Page Range Diff API can only be called on incremental snapshots with the same family id. - IncrementalSnapshotFamilyID *string `json:"incrementalSnapshotFamilyId,omitempty"` - // Encryption - Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. - Encryption *Encryption `json:"encryption,omitempty"` - // NetworkAccessPolicy - Possible values include: 'AllowAll', 'AllowPrivate', 'DenyAll' - NetworkAccessPolicy NetworkAccessPolicy `json:"networkAccessPolicy,omitempty"` - // DiskAccessID - ARM id of the DiskAccess resource for using private endpoints on disks. - DiskAccessID *string `json:"diskAccessId,omitempty"` - // SecurityProfile - Contains the security related information for the resource. - SecurityProfile *DiskSecurityProfile `json:"securityProfile,omitempty"` - // SupportsHibernation - Indicates the OS on a snapshot supports hibernation. - SupportsHibernation *bool `json:"supportsHibernation,omitempty"` - // PublicNetworkAccess - Possible values include: 'Enabled', 'Disabled' - PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` - // CompletionPercent - Percentage complete for the background copy when a resource is created via the CopyStart operation. - CompletionPercent *float64 `json:"completionPercent,omitempty"` - // CopyCompletionError - Indicates the error details if the background copy of a resource created via the CopyStart operation fails. - CopyCompletionError *CopyCompletionError `json:"copyCompletionError,omitempty"` - // DataAccessAuthMode - Possible values include: 'DataAccessAuthModeAzureActiveDirectory', 'DataAccessAuthModeNone' - DataAccessAuthMode DataAccessAuthMode `json:"dataAccessAuthMode,omitempty"` -} - -// MarshalJSON is the custom marshaler for SnapshotProperties. -func (sp SnapshotProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sp.OsType != "" { - objectMap["osType"] = sp.OsType - } - if sp.HyperVGeneration != "" { - objectMap["hyperVGeneration"] = sp.HyperVGeneration - } - if sp.PurchasePlan != nil { - objectMap["purchasePlan"] = sp.PurchasePlan - } - if sp.SupportedCapabilities != nil { - objectMap["supportedCapabilities"] = sp.SupportedCapabilities - } - if sp.CreationData != nil { - objectMap["creationData"] = sp.CreationData - } - if sp.DiskSizeGB != nil { - objectMap["diskSizeGB"] = sp.DiskSizeGB - } - if sp.DiskState != "" { - objectMap["diskState"] = sp.DiskState - } - if sp.EncryptionSettingsCollection != nil { - objectMap["encryptionSettingsCollection"] = sp.EncryptionSettingsCollection - } - if sp.Incremental != nil { - objectMap["incremental"] = sp.Incremental - } - if sp.Encryption != nil { - objectMap["encryption"] = sp.Encryption - } - if sp.NetworkAccessPolicy != "" { - objectMap["networkAccessPolicy"] = sp.NetworkAccessPolicy - } - if sp.DiskAccessID != nil { - objectMap["diskAccessId"] = sp.DiskAccessID - } - if sp.SecurityProfile != nil { - objectMap["securityProfile"] = sp.SecurityProfile - } - if sp.SupportsHibernation != nil { - objectMap["supportsHibernation"] = sp.SupportsHibernation - } - if sp.PublicNetworkAccess != "" { - objectMap["publicNetworkAccess"] = sp.PublicNetworkAccess - } - if sp.CompletionPercent != nil { - objectMap["completionPercent"] = sp.CompletionPercent - } - if sp.CopyCompletionError != nil { - objectMap["copyCompletionError"] = sp.CopyCompletionError - } - if sp.DataAccessAuthMode != "" { - objectMap["dataAccessAuthMode"] = sp.DataAccessAuthMode - } - return json.Marshal(objectMap) -} - -// SnapshotsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type SnapshotsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(SnapshotsClient) (Snapshot, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *SnapshotsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for SnapshotsCreateOrUpdateFuture.Result. -func (future *SnapshotsCreateOrUpdateFuture) result(client SnapshotsClient) (s Snapshot, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - s.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.SnapshotsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { - s, err = client.CreateOrUpdateResponder(s.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsCreateOrUpdateFuture", "Result", s.Response.Response, "Failure responding to request") - } - } - return -} - -// SnapshotsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type SnapshotsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(SnapshotsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *SnapshotsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for SnapshotsDeleteFuture.Result. -func (future *SnapshotsDeleteFuture) result(client SnapshotsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.SnapshotsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// SnapshotsGrantAccessFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type SnapshotsGrantAccessFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(SnapshotsClient) (AccessURI, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *SnapshotsGrantAccessFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for SnapshotsGrantAccessFuture.Result. -func (future *SnapshotsGrantAccessFuture) result(client SnapshotsClient) (au AccessURI, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsGrantAccessFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - au.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.SnapshotsGrantAccessFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if au.Response.Response, err = future.GetResult(sender); err == nil && au.Response.Response.StatusCode != http.StatusNoContent { - au, err = client.GrantAccessResponder(au.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsGrantAccessFuture", "Result", au.Response.Response, "Failure responding to request") - } - } - return -} - -// SnapshotSku the snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. This is an -// optional parameter for incremental snapshot and the default behavior is the SKU will be set to the same -// sku as the previous snapshot -type SnapshotSku struct { - // Name - The sku name. Possible values include: 'SnapshotStorageAccountTypesStandardLRS', 'SnapshotStorageAccountTypesPremiumLRS', 'SnapshotStorageAccountTypesStandardZRS' - Name SnapshotStorageAccountTypes `json:"name,omitempty"` - // Tier - READ-ONLY; The sku tier. - Tier *string `json:"tier,omitempty"` -} - -// MarshalJSON is the custom marshaler for SnapshotSku. -func (ss SnapshotSku) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ss.Name != "" { - objectMap["name"] = ss.Name - } - return json.Marshal(objectMap) -} - -// SnapshotsRevokeAccessFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type SnapshotsRevokeAccessFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(SnapshotsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *SnapshotsRevokeAccessFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for SnapshotsRevokeAccessFuture.Result. -func (future *SnapshotsRevokeAccessFuture) result(client SnapshotsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsRevokeAccessFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.SnapshotsRevokeAccessFuture") - return - } - ar.Response = future.Response() - return -} - -// SnapshotsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type SnapshotsUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(SnapshotsClient) (Snapshot, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *SnapshotsUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for SnapshotsUpdateFuture.Result. -func (future *SnapshotsUpdateFuture) result(client SnapshotsClient) (s Snapshot, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - s.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.SnapshotsUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { - s, err = client.UpdateResponder(s.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsUpdateFuture", "Result", s.Response.Response, "Failure responding to request") - } - } - return -} - -// SnapshotUpdate snapshot update resource. -type SnapshotUpdate struct { - *SnapshotUpdateProperties `json:"properties,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` - Sku *SnapshotSku `json:"sku,omitempty"` -} - -// MarshalJSON is the custom marshaler for SnapshotUpdate. -func (su SnapshotUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if su.SnapshotUpdateProperties != nil { - objectMap["properties"] = su.SnapshotUpdateProperties - } - 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 snapshotUpdateProperties SnapshotUpdateProperties - err = json.Unmarshal(*v, &snapshotUpdateProperties) - if err != nil { - return err - } - su.SnapshotUpdateProperties = &snapshotUpdateProperties - } - 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 SnapshotSku - err = json.Unmarshal(*v, &sku) - if err != nil { - return err - } - su.Sku = &sku - } - } - } - - return nil -} - -// SnapshotUpdateProperties snapshot resource update properties. -type SnapshotUpdateProperties struct { - // OsType - the Operating System type. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' - OsType OperatingSystemTypes `json:"osType,omitempty"` - // DiskSizeGB - If creationData.createOption is Empty, this field is mandatory and it indicates the size of the disk to create. If this field is present for updates or creation with other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size. - DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` - // EncryptionSettingsCollection - Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. - EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` - // Encryption - Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. - Encryption *Encryption `json:"encryption,omitempty"` - // NetworkAccessPolicy - Possible values include: 'AllowAll', 'AllowPrivate', 'DenyAll' - NetworkAccessPolicy NetworkAccessPolicy `json:"networkAccessPolicy,omitempty"` - // DiskAccessID - ARM id of the DiskAccess resource for using private endpoints on disks. - DiskAccessID *string `json:"diskAccessId,omitempty"` - // SupportsHibernation - Indicates the OS on a snapshot supports hibernation. - SupportsHibernation *bool `json:"supportsHibernation,omitempty"` - // PublicNetworkAccess - Possible values include: 'Enabled', 'Disabled' - PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` - // DataAccessAuthMode - Possible values include: 'DataAccessAuthModeAzureActiveDirectory', 'DataAccessAuthModeNone' - DataAccessAuthMode DataAccessAuthMode `json:"dataAccessAuthMode,omitempty"` - // SupportedCapabilities - List of supported capabilities for the image from which the OS disk was created. - SupportedCapabilities *SupportedCapabilities `json:"supportedCapabilities,omitempty"` -} - -// SoftDeletePolicy contains information about the soft deletion policy of the gallery. -type SoftDeletePolicy struct { - // IsSoftDeleteEnabled - Enables soft-deletion for resources in this gallery, allowing them to be recovered within retention time. - IsSoftDeleteEnabled *bool `json:"isSoftDeleteEnabled,omitempty"` -} - -// SourceVault the vault id is an Azure Resource Manager Resource id in the form -// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName} -type SourceVault struct { - // ID - Resource Id - ID *string `json:"id,omitempty"` -} - -// SpotRestorePolicy specifies the Spot-Try-Restore properties for the virtual machine scale set.

      -// With this property customer can enable or disable automatic restore of the evicted Spot VMSS VM -// instances opportunistically based on capacity availability and pricing constraint. -type SpotRestorePolicy struct { - // Enabled - Enables the Spot-Try-Restore feature where evicted VMSS SPOT instances will be tried to be restored opportunistically based on capacity availability and pricing constraints - Enabled *bool `json:"enabled,omitempty"` - // RestoreTimeout - Timeout value expressed as an ISO 8601 time duration after which the platform will not try to restore the VMSS SPOT instances - RestoreTimeout *string `json:"restoreTimeout,omitempty"` -} - -// SSHConfiguration SSH configuration for Linux based VMs running on Azure -type SSHConfiguration struct { - // PublicKeys - The list of SSH public keys used to authenticate with linux based VMs. - 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. -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"` - // KeyData - SSH public key certificate used to authenticate with the VM through ssh. The key needs to be at least 2048-bit and in ssh-rsa format.

      For creating ssh keys, see [Create SSH keys on Linux and Mac for Linux VMs in Azure]https://docs.microsoft.com/azure/virtual-machines/linux/create-ssh-keys-detailed). - KeyData *string `json:"keyData,omitempty"` -} - -// SSHPublicKeyGenerateKeyPairResult response from generation of an SSH key pair. -type SSHPublicKeyGenerateKeyPairResult struct { - autorest.Response `json:"-"` - // PrivateKey - Private key portion of the key pair used to authenticate to a virtual machine through ssh. The private key is returned in RFC3447 format and should be treated as a secret. - PrivateKey *string `json:"privateKey,omitempty"` - // PublicKey - Public key portion of the key pair used to authenticate to a virtual machine through ssh. The public key is in ssh-rsa format. - PublicKey *string `json:"publicKey,omitempty"` - // ID - The ARM resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{SshPublicKeyName} - ID *string `json:"id,omitempty"` -} - -// SSHPublicKeyResource specifies information about the SSH public key. -type SSHPublicKeyResource struct { - autorest.Response `json:"-"` - // SSHPublicKeyResourceProperties - Properties of the SSH public key. - *SSHPublicKeyResourceProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; 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 SSHPublicKeyResource. -func (spkr SSHPublicKeyResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if spkr.SSHPublicKeyResourceProperties != nil { - objectMap["properties"] = spkr.SSHPublicKeyResourceProperties - } - if spkr.Location != nil { - objectMap["location"] = spkr.Location - } - if spkr.Tags != nil { - objectMap["tags"] = spkr.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for SSHPublicKeyResource struct. -func (spkr *SSHPublicKeyResource) 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 SSHPublicKeyResourceProperties SSHPublicKeyResourceProperties - err = json.Unmarshal(*v, &SSHPublicKeyResourceProperties) - if err != nil { - return err - } - spkr.SSHPublicKeyResourceProperties = &SSHPublicKeyResourceProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - spkr.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - spkr.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - spkr.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - spkr.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - spkr.Tags = tags - } - } - } - - return nil -} - -// SSHPublicKeyResourceProperties properties of the SSH public key. -type SSHPublicKeyResourceProperties struct { - // PublicKey - SSH public key used to authenticate to a virtual machine through ssh. If this property is not initially provided when the resource is created, the publicKey property will be populated when generateKeyPair is called. If the public key is provided upon resource creation, the provided public key needs to be at least 2048-bit and in ssh-rsa format. - PublicKey *string `json:"publicKey,omitempty"` -} - -// SSHPublicKeysGroupListResult the list SSH public keys operation response. -type SSHPublicKeysGroupListResult struct { - autorest.Response `json:"-"` - // Value - The list of SSH public keys - Value *[]SSHPublicKeyResource `json:"value,omitempty"` - // NextLink - The URI to fetch the next page of SSH public keys. Call ListNext() with this URI to fetch the next page of SSH public keys. - NextLink *string `json:"nextLink,omitempty"` -} - -// SSHPublicKeysGroupListResultIterator provides access to a complete listing of SSHPublicKeyResource -// values. -type SSHPublicKeysGroupListResultIterator struct { - i int - page SSHPublicKeysGroupListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *SSHPublicKeysGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SSHPublicKeysGroupListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *SSHPublicKeysGroupListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter SSHPublicKeysGroupListResultIterator) 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 SSHPublicKeysGroupListResultIterator) Response() SSHPublicKeysGroupListResult { - 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 SSHPublicKeysGroupListResultIterator) Value() SSHPublicKeyResource { - if !iter.page.NotDone() { - return SSHPublicKeyResource{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the SSHPublicKeysGroupListResultIterator type. -func NewSSHPublicKeysGroupListResultIterator(page SSHPublicKeysGroupListResultPage) SSHPublicKeysGroupListResultIterator { - return SSHPublicKeysGroupListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (spkglr SSHPublicKeysGroupListResult) IsEmpty() bool { - return spkglr.Value == nil || len(*spkglr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (spkglr SSHPublicKeysGroupListResult) hasNextLink() bool { - return spkglr.NextLink != nil && len(*spkglr.NextLink) != 0 -} - -// sSHPublicKeysGroupListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (spkglr SSHPublicKeysGroupListResult) sSHPublicKeysGroupListResultPreparer(ctx context.Context) (*http.Request, error) { - if !spkglr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(spkglr.NextLink))) -} - -// SSHPublicKeysGroupListResultPage contains a page of SSHPublicKeyResource values. -type SSHPublicKeysGroupListResultPage struct { - fn func(context.Context, SSHPublicKeysGroupListResult) (SSHPublicKeysGroupListResult, error) - spkglr SSHPublicKeysGroupListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *SSHPublicKeysGroupListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SSHPublicKeysGroupListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.spkglr) - if err != nil { - return err - } - page.spkglr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *SSHPublicKeysGroupListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page SSHPublicKeysGroupListResultPage) NotDone() bool { - return !page.spkglr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page SSHPublicKeysGroupListResultPage) Response() SSHPublicKeysGroupListResult { - return page.spkglr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page SSHPublicKeysGroupListResultPage) Values() []SSHPublicKeyResource { - if page.spkglr.IsEmpty() { - return nil - } - return *page.spkglr.Value -} - -// Creates a new instance of the SSHPublicKeysGroupListResultPage type. -func NewSSHPublicKeysGroupListResultPage(cur SSHPublicKeysGroupListResult, getNextPage func(context.Context, SSHPublicKeysGroupListResult) (SSHPublicKeysGroupListResult, error)) SSHPublicKeysGroupListResultPage { - return SSHPublicKeysGroupListResultPage{ - fn: getNextPage, - spkglr: cur, - } -} - -// SSHPublicKeyUpdateResource specifies information about the SSH public key. -type SSHPublicKeyUpdateResource struct { - // SSHPublicKeyResourceProperties - Properties of the SSH public key. - *SSHPublicKeyResourceProperties `json:"properties,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for SSHPublicKeyUpdateResource. -func (spkur SSHPublicKeyUpdateResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if spkur.SSHPublicKeyResourceProperties != nil { - objectMap["properties"] = spkur.SSHPublicKeyResourceProperties - } - if spkur.Tags != nil { - objectMap["tags"] = spkur.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for SSHPublicKeyUpdateResource struct. -func (spkur *SSHPublicKeyUpdateResource) 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 SSHPublicKeyResourceProperties SSHPublicKeyResourceProperties - err = json.Unmarshal(*v, &SSHPublicKeyResourceProperties) - if err != nil { - return err - } - spkur.SSHPublicKeyResourceProperties = &SSHPublicKeyResourceProperties - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - spkur.Tags = tags - } - } - } - - return nil -} - -// StatusCodeCount the status code and count of the cloud service instance view statuses -type StatusCodeCount struct { - // Code - READ-ONLY; The instance view status code - Code *string `json:"code,omitempty"` - // Count - READ-ONLY; Number of instances having this status code - Count *int32 `json:"count,omitempty"` -} - -// MarshalJSON is the custom marshaler for StatusCodeCount. -func (scc StatusCodeCount) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// StorageProfile specifies the storage settings for the virtual machine disks. -type StorageProfile struct { - // ImageReference - Specifies information about the image to use. You can specify information about platform images, 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. - ImageReference *ImageReference `json:"imageReference,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/managed-disks-overview). - OsDisk *OSDisk `json:"osDisk,omitempty"` - // DataDisks - Specifies the parameters that are used to add a data disk to a virtual machine.

      For more information about disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). - DataDisks *[]DataDisk `json:"dataDisks,omitempty"` - // DiskControllerType - Specifies the disk controller type configured for the VM.

      NOTE: This property will be set to the default disk controller type if not specified provided virtual machine is being created as a hyperVGeneration: V2 based on the capabilities of the operating system disk and VM size from the the specified minimum api version.
      You need to deallocate the VM before updating its disk controller type unless you are updating the VM size in the VM configuration which implicitly deallocates and reallocates the VM.

      Minimum api-version: 2022-08-01. Possible values include: 'SCSI', 'NVMe' - DiskControllerType DiskControllerTypes `json:"diskControllerType,omitempty"` -} - -// SubResource ... -type SubResource struct { - // ID - Resource Id - ID *string `json:"id,omitempty"` -} - -// SubResourceReadOnly ... -type SubResourceReadOnly struct { - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for SubResourceReadOnly. -func (srro SubResourceReadOnly) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// SubResourceWithColocationStatus ... -type SubResourceWithColocationStatus struct { - // ColocationStatus - Describes colocation status of a resource in the Proximity Placement Group. - ColocationStatus *InstanceViewStatus `json:"colocationStatus,omitempty"` - // ID - Resource Id - ID *string `json:"id,omitempty"` -} - -// SupportedCapabilities list of supported capabilities persisted on the disk resource for VM use. -type SupportedCapabilities struct { - // DiskControllerTypes - The disk controllers that an OS disk supports. If set it can be SCSI or SCSI, NVME or NVME, SCSI. - DiskControllerTypes *string `json:"diskControllerTypes,omitempty"` - // AcceleratedNetwork - True if the image from which the OS disk is created supports accelerated networking. - AcceleratedNetwork *bool `json:"acceleratedNetwork,omitempty"` - // Architecture - CPU architecture supported by an OS disk. Possible values include: 'X64', 'Arm64' - Architecture Architecture `json:"architecture,omitempty"` -} - -// SystemData the system meta data relating to this resource. -type SystemData struct { - // CreatedAt - READ-ONLY; Specifies the time in UTC at which the Cloud Service (extended support) resource was created.
      Minimum api-version: 2022-04-04. - CreatedAt *date.Time `json:"createdAt,omitempty"` - // LastModifiedAt - READ-ONLY; Specifies the time in UTC at which the Cloud Service (extended support) resource was last modified.
      Minimum api-version: 2022-04-04. - LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"` -} - -// MarshalJSON is the custom marshaler for SystemData. -func (sd SystemData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// TargetRegion describes the target region information. -type TargetRegion struct { - // Name - The name of the region. - Name *string `json:"name,omitempty"` - // RegionalReplicaCount - The number of replicas of the Image Version to be created per region. This property is updatable. - RegionalReplicaCount *int32 `json:"regionalReplicaCount,omitempty"` - // StorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable. Possible values include: 'StorageAccountTypeStandardLRS', 'StorageAccountTypeStandardZRS', 'StorageAccountTypePremiumLRS' - StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` - Encryption *EncryptionImages `json:"encryption,omitempty"` -} - -// TerminateNotificationProfile ... -type TerminateNotificationProfile struct { - // NotBeforeTimeout - Configurable length of time a Virtual Machine being deleted will have to potentially approve the Terminate Scheduled Event before the event is auto approved (timed out). The configuration must be specified in ISO 8601 format, the default value is 5 minutes (PT5M) - NotBeforeTimeout *string `json:"notBeforeTimeout,omitempty"` - // Enable - Specifies whether the Terminate Scheduled event is enabled or disabled. - Enable *bool `json:"enable,omitempty"` -} - -// ThrottledRequestsInput api request input for LogAnalytics getThrottledRequests Api. -type ThrottledRequestsInput struct { - // 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 - FromTime *date.Time `json:"fromTime,omitempty"` - // ToTime - To time of the query - ToTime *date.Time `json:"toTime,omitempty"` - // GroupByThrottlePolicy - Group query result by Throttle Policy applied. - GroupByThrottlePolicy *bool `json:"groupByThrottlePolicy,omitempty"` - // GroupByOperationName - Group query result by Operation Name. - GroupByOperationName *bool `json:"groupByOperationName,omitempty"` - // GroupByResourceName - Group query result by Resource Name. - GroupByResourceName *bool `json:"groupByResourceName,omitempty"` - // GroupByClientApplicationID - Group query result by Client Application ID. - GroupByClientApplicationID *bool `json:"groupByClientApplicationId,omitempty"` - // GroupByUserAgent - Group query result by User Agent. - GroupByUserAgent *bool `json:"groupByUserAgent,omitempty"` -} - -// UefiSettings specifies the security settings like secure boot and vTPM used while creating the virtual -// machine.

      Minimum api-version: 2020-12-01 -type UefiSettings struct { - // SecureBootEnabled - Specifies whether secure boot should be enabled on the virtual machine.

      Minimum api-version: 2020-12-01 - SecureBootEnabled *bool `json:"secureBootEnabled,omitempty"` - // VTpmEnabled - Specifies whether vTPM should be enabled on the virtual machine.

      Minimum api-version: 2020-12-01 - VTpmEnabled *bool `json:"vTpmEnabled,omitempty"` -} - -// UpdateDomain defines an update domain for the cloud service. -type UpdateDomain struct { - autorest.Response `json:"-"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource Name - Name *string `json:"name,omitempty"` -} - -// MarshalJSON is the custom marshaler for UpdateDomain. -func (ud UpdateDomain) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// UpdateDomainListResult the list operation result. -type UpdateDomainListResult struct { - autorest.Response `json:"-"` - // Value - The list of resources. - Value *[]UpdateDomain `json:"value,omitempty"` - // NextLink - The URI to fetch the next page of resources. Use this to get the next page of resources. Do this till nextLink is null to fetch all the resources. - NextLink *string `json:"nextLink,omitempty"` -} - -// UpdateDomainListResultIterator provides access to a complete listing of UpdateDomain values. -type UpdateDomainListResultIterator struct { - i int - page UpdateDomainListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *UpdateDomainListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/UpdateDomainListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *UpdateDomainListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter UpdateDomainListResultIterator) 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 UpdateDomainListResultIterator) Response() UpdateDomainListResult { - 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 UpdateDomainListResultIterator) Value() UpdateDomain { - if !iter.page.NotDone() { - return UpdateDomain{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the UpdateDomainListResultIterator type. -func NewUpdateDomainListResultIterator(page UpdateDomainListResultPage) UpdateDomainListResultIterator { - return UpdateDomainListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (udlr UpdateDomainListResult) IsEmpty() bool { - return udlr.Value == nil || len(*udlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (udlr UpdateDomainListResult) hasNextLink() bool { - return udlr.NextLink != nil && len(*udlr.NextLink) != 0 -} - -// updateDomainListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (udlr UpdateDomainListResult) updateDomainListResultPreparer(ctx context.Context) (*http.Request, error) { - if !udlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(udlr.NextLink))) -} - -// UpdateDomainListResultPage contains a page of UpdateDomain values. -type UpdateDomainListResultPage struct { - fn func(context.Context, UpdateDomainListResult) (UpdateDomainListResult, error) - udlr UpdateDomainListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *UpdateDomainListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/UpdateDomainListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.udlr) - if err != nil { - return err - } - page.udlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *UpdateDomainListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page UpdateDomainListResultPage) NotDone() bool { - return !page.udlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page UpdateDomainListResultPage) Response() UpdateDomainListResult { - return page.udlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page UpdateDomainListResultPage) Values() []UpdateDomain { - if page.udlr.IsEmpty() { - return nil - } - return *page.udlr.Value -} - -// Creates a new instance of the UpdateDomainListResultPage type. -func NewUpdateDomainListResultPage(cur UpdateDomainListResult, getNextPage func(context.Context, UpdateDomainListResult) (UpdateDomainListResult, error)) UpdateDomainListResultPage { - return UpdateDomainListResultPage{ - fn: getNextPage, - udlr: cur, - } -} - -// UpdateResource the Update Resource model definition. -type UpdateResource struct { - // Tags - Resource tags - 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) -} - -// UpdateResourceDefinition the Update Resource model definition. -type UpdateResourceDefinition struct { - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for UpdateResourceDefinition. -func (urd UpdateResourceDefinition) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if urd.Tags != nil { - objectMap["tags"] = urd.Tags - } - return json.Marshal(objectMap) -} - -// UpgradeOperationHistoricalStatusInfo virtual Machine Scale Set OS Upgrade History operation response. -type UpgradeOperationHistoricalStatusInfo struct { - // Properties - READ-ONLY; Information about the properties of the upgrade operation. - Properties *UpgradeOperationHistoricalStatusInfoProperties `json:"properties,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Location - READ-ONLY; Resource location - Location *string `json:"location,omitempty"` -} - -// MarshalJSON is the custom marshaler for UpgradeOperationHistoricalStatusInfo. -func (uohsi UpgradeOperationHistoricalStatusInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// UpgradeOperationHistoricalStatusInfoProperties describes each OS upgrade on the Virtual Machine Scale -// Set. -type UpgradeOperationHistoricalStatusInfoProperties struct { - // RunningStatus - READ-ONLY; Information about the overall status of the upgrade operation. - RunningStatus *UpgradeOperationHistoryStatus `json:"runningStatus,omitempty"` - // Progress - READ-ONLY; Counts of the VMs in each state. - Progress *RollingUpgradeProgressInfo `json:"progress,omitempty"` - // Error - READ-ONLY; Error Details for this upgrade if there are any. - Error *APIError `json:"error,omitempty"` - // StartedBy - READ-ONLY; Invoker of the Upgrade Operation. Possible values include: 'UpgradeOperationInvokerUnknown', 'UpgradeOperationInvokerUser', 'UpgradeOperationInvokerPlatform' - StartedBy UpgradeOperationInvoker `json:"startedBy,omitempty"` - // TargetImageReference - READ-ONLY; Image Reference details - TargetImageReference *ImageReference `json:"targetImageReference,omitempty"` - // RollbackInfo - READ-ONLY; Information about OS rollback if performed - RollbackInfo *RollbackStatusInfo `json:"rollbackInfo,omitempty"` -} - -// MarshalJSON is the custom marshaler for UpgradeOperationHistoricalStatusInfoProperties. -func (uohsip UpgradeOperationHistoricalStatusInfoProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// UpgradeOperationHistoryStatus information about the current running state of the overall upgrade. -type UpgradeOperationHistoryStatus struct { - // Code - READ-ONLY; Code indicating the current status of the upgrade. Possible values include: 'UpgradeStateRollingForward', 'UpgradeStateCancelled', 'UpgradeStateCompleted', 'UpgradeStateFaulted' - Code UpgradeState `json:"code,omitempty"` - // StartTime - READ-ONLY; Start time of the upgrade. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - READ-ONLY; End time of the upgrade. - EndTime *date.Time `json:"endTime,omitempty"` -} - -// MarshalJSON is the custom marshaler for UpgradeOperationHistoryStatus. -func (uohs UpgradeOperationHistoryStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// UpgradePolicy describes an upgrade policy - automatic, manual, or rolling. -type UpgradePolicy struct { - // Mode - Specifies the mode of an upgrade to virtual machines in the scale set.

      Possible values are:

      **Manual** - You control the application of updates to virtual machines in the scale set. You do this by using the manualUpgrade action.

      **Automatic** - All virtual machines in the scale set are automatically updated at the same time. Possible values include: 'UpgradeModeAutomatic', 'UpgradeModeManual', 'UpgradeModeRolling' - Mode UpgradeMode `json:"mode,omitempty"` - // RollingUpgradePolicy - The configuration parameters used while performing a rolling upgrade. - RollingUpgradePolicy *RollingUpgradePolicy `json:"rollingUpgradePolicy,omitempty"` - // AutomaticOSUpgradePolicy - Configuration parameters used for performing automatic OS Upgrade. - AutomaticOSUpgradePolicy *AutomaticOSUpgradePolicy `json:"automaticOSUpgradePolicy,omitempty"` -} - -// Usage describes Compute Resource Usage. -type Usage struct { - // Unit - An enum describing the unit of usage measurement. - Unit *string `json:"unit,omitempty"` - // CurrentValue - The current usage of the resource. - CurrentValue *int32 `json:"currentValue,omitempty"` - // Limit - The maximum permitted usage of the resource. - Limit *int64 `json:"limit,omitempty"` - // Name - The name of the type of usage. - Name *UsageName `json:"name,omitempty"` -} - -// UsageName the Usage Names. -type UsageName struct { - // Value - The name of the resource. - Value *string `json:"value,omitempty"` - // LocalizedValue - The localized name of the resource. - LocalizedValue *string `json:"localizedValue,omitempty"` -} - -// UserArtifactManage ... -type UserArtifactManage struct { - // Install - Required. The path and arguments to install the gallery application. This is limited to 4096 characters. - Install *string `json:"install,omitempty"` - // Remove - Required. The path and arguments to remove the gallery application. This is limited to 4096 characters. - Remove *string `json:"remove,omitempty"` - // Update - Optional. The path and arguments to update the gallery application. If not present, then update operation will invoke remove command on the previous version and install command on the current version of the gallery application. This is limited to 4096 characters. - Update *string `json:"update,omitempty"` -} - -// UserArtifactSettings additional settings for the VM app that contains the target package and config file -// name when it is deployed to target VM or VM scale set. -type UserArtifactSettings struct { - // PackageFileName - Optional. The name to assign the downloaded package file on the VM. This is limited to 4096 characters. If not specified, the package file will be named the same as the Gallery Application name. - PackageFileName *string `json:"packageFileName,omitempty"` - // ConfigFileName - Optional. The name to assign the downloaded config file on the VM. This is limited to 4096 characters. If not specified, the config file will be named the Gallery Application name appended with "_config". - ConfigFileName *string `json:"configFileName,omitempty"` -} - -// UserArtifactSource the source image from which the Image Version is going to be created. -type UserArtifactSource struct { - // MediaLink - Required. The mediaLink of the artifact, must be a readable storage page blob. - MediaLink *string `json:"mediaLink,omitempty"` - // DefaultConfigurationLink - Optional. The defaultConfigurationLink of the artifact, must be a readable storage page blob. - DefaultConfigurationLink *string `json:"defaultConfigurationLink,omitempty"` -} - -// UserAssignedIdentitiesValue ... -type UserAssignedIdentitiesValue struct { - // PrincipalID - READ-ONLY; The principal id of user assigned identity. - PrincipalID *string `json:"principalId,omitempty"` - // ClientID - READ-ONLY; The client id of user assigned identity. - ClientID *string `json:"clientId,omitempty"` -} - -// MarshalJSON is the custom marshaler for UserAssignedIdentitiesValue. -func (uaiv UserAssignedIdentitiesValue) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// 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":""
      }
      To install certificates on a virtual machine it is recommended to use the [Azure Key Vault virtual machine extension for Linux](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux) or the [Azure Key Vault virtual machine extension for Windows](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows). - CertificateURL *string `json:"certificateUrl,omitempty"` - // CertificateStore - For Windows VMs, specifies the certificate store on the Virtual Machine to which the certificate should be added. The specified certificate store is implicitly in the LocalMachine account.

      For Linux VMs, the certificate file is placed under the /var/lib/waagent directory, with the file name <UppercaseThumbprint>.crt for the X509 certificate file and <UppercaseThumbprint>.prv for private key. Both of these files are .pem formatted. - CertificateStore *string `json:"certificateStore,omitempty"` -} - -// VaultSecretGroup describes a set of certificates which are all in the same Key Vault. -type VaultSecretGroup struct { - // SourceVault - The relative URL of the Key Vault containing all of the certificates in VaultCertificates. - SourceVault *SubResource `json:"sourceVault,omitempty"` - // VaultCertificates - The list of key vault references in SourceVault which contain certificates. - VaultCertificates *[]VaultCertificate `json:"vaultCertificates,omitempty"` -} - -// VirtualHardDisk describes the uri of a disk. -type VirtualHardDisk struct { - // URI - Specifies the virtual hard disk's uri. - URI *string `json:"uri,omitempty"` -} - -// VirtualMachine describes a Virtual Machine. -type VirtualMachine struct { - autorest.Response `json:"-"` - // 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"` - // Resources - READ-ONLY; The virtual machine child extension resources. - Resources *[]VirtualMachineExtension `json:"resources,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"` - // ExtendedLocation - The extended location of the Virtual Machine. - ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; 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.Identity != nil { - objectMap["identity"] = VM.Identity - } - if VM.Zones != nil { - objectMap["zones"] = VM.Zones - } - if VM.ExtendedLocation != nil { - objectMap["extendedLocation"] = VM.ExtendedLocation - } - 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 "extendedLocation": - if v != nil { - var extendedLocation ExtendedLocation - err = json.Unmarshal(*v, &extendedLocation) - if err != nil { - return err - } - VM.ExtendedLocation = &extendedLocation - } - 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. -type VirtualMachineAgentInstanceView struct { - // VMAgentVersion - The VM Agent full version. - VMAgentVersion *string `json:"vmAgentVersion,omitempty"` - // ExtensionHandlers - The virtual machine extension handler instance view. - ExtensionHandlers *[]VirtualMachineExtensionHandlerInstanceView `json:"extensionHandlers,omitempty"` - // Statuses - The resource status information. - Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` -} - -// VirtualMachineAssessPatchesResult describes the properties of an AssessPatches result. -type VirtualMachineAssessPatchesResult struct { - autorest.Response `json:"-"` - // Status - READ-ONLY; The overall success or failure status of the operation. It remains "InProgress" until the operation completes. At that point it will become "Unknown", "Failed", "Succeeded", or "CompletedWithWarnings.". Possible values include: 'PatchOperationStatusUnknown', 'PatchOperationStatusInProgress', 'PatchOperationStatusFailed', 'PatchOperationStatusSucceeded', 'PatchOperationStatusCompletedWithWarnings' - Status PatchOperationStatus `json:"status,omitempty"` - // AssessmentActivityID - READ-ONLY; The activity ID of the operation that produced this result. It is used to correlate across CRP and extension logs. - AssessmentActivityID *string `json:"assessmentActivityId,omitempty"` - // RebootPending - READ-ONLY; The overall reboot status of the VM. It will be true when partially installed patches require a reboot to complete installation but the reboot has not yet occurred. - RebootPending *bool `json:"rebootPending,omitempty"` - // CriticalAndSecurityPatchCount - READ-ONLY; The number of critical or security patches that have been detected as available and not yet installed. - CriticalAndSecurityPatchCount *int32 `json:"criticalAndSecurityPatchCount,omitempty"` - // OtherPatchCount - READ-ONLY; The number of all available patches excluding critical and security. - OtherPatchCount *int32 `json:"otherPatchCount,omitempty"` - // StartDateTime - READ-ONLY; The UTC timestamp when the operation began. - StartDateTime *date.Time `json:"startDateTime,omitempty"` - // AvailablePatches - READ-ONLY; The list of patches that have been detected as available for installation. - AvailablePatches *[]VirtualMachineSoftwarePatchProperties `json:"availablePatches,omitempty"` - // Error - READ-ONLY; The errors that were encountered during execution of the operation. The details array contains the list of them. - Error *APIError `json:"error,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineAssessPatchesResult. -func (vmapr VirtualMachineAssessPatchesResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// VirtualMachineCaptureParameters capture Virtual Machine parameters. -type VirtualMachineCaptureParameters struct { - // VhdPrefix - The captured virtual hard disk's name prefix. - VhdPrefix *string `json:"vhdPrefix,omitempty"` - // DestinationContainerName - The destination container name. - DestinationContainerName *string `json:"destinationContainerName,omitempty"` - // OverwriteVhds - Specifies whether to overwrite the destination virtual hard disk, in case of conflict. - OverwriteVhds *bool `json:"overwriteVhds,omitempty"` -} - -// VirtualMachineCaptureResult output of virtual machine capture operation. -type VirtualMachineCaptureResult struct { - autorest.Response `json:"-"` - // Schema - READ-ONLY; the schema of the captured virtual machine - Schema *string `json:"$schema,omitempty"` - // ContentVersion - READ-ONLY; the version of the content - ContentVersion *string `json:"contentVersion,omitempty"` - // Parameters - READ-ONLY; parameters of the captured virtual machine - Parameters interface{} `json:"parameters,omitempty"` - // Resources - READ-ONLY; a list of resource items of the captured virtual machine - Resources *[]interface{} `json:"resources,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.ID != nil { - objectMap["id"] = vmcr.ID - } - return json.Marshal(objectMap) -} - -// VirtualMachineExtension describes a Virtual Machine Extension. -type VirtualMachineExtension struct { - autorest.Response `json:"-"` - *VirtualMachineExtensionProperties `json:"properties,omitempty"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Tags - Resource tags - 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.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 "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - vme.Location = &location - } - 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 "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. -type VirtualMachineExtensionHandlerInstanceView struct { - // Type - Specifies the type of the extension; an example is "CustomScriptExtension". - Type *string `json:"type,omitempty"` - // TypeHandlerVersion - Specifies the version of the script handler. - TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` - // Status - The extension handler status. - Status *InstanceViewStatus `json:"status,omitempty"` -} - -// VirtualMachineExtensionImage describes a Virtual Machine Extension Image. -type VirtualMachineExtensionImage struct { - autorest.Response `json:"-"` - *VirtualMachineExtensionImageProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; 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 VirtualMachineExtensionImage. -func (vmei VirtualMachineExtensionImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmei.VirtualMachineExtensionImageProperties != nil { - objectMap["properties"] = vmei.VirtualMachineExtensionImageProperties - } - 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. -type VirtualMachineExtensionImageProperties struct { - // OperatingSystem - The operating system this extension supports. - OperatingSystem *string `json:"operatingSystem,omitempty"` - // ComputeRole - The type of role (IaaS or PaaS) this extension supports. - ComputeRole *string `json:"computeRole,omitempty"` - // HandlerSchema - The schema defined by publisher, where extension consumers should provide settings in a matching schema. - HandlerSchema *string `json:"handlerSchema,omitempty"` - // VMScaleSetEnabled - Whether the extension can be used on xRP VMScaleSets. By default existing extensions are usable on scalesets, but there might be cases where a publisher wants to explicitly indicate the extension is only enabled for CRP VMs but not VMSS. - VMScaleSetEnabled *bool `json:"vmScaleSetEnabled,omitempty"` - // SupportsMultipleExtensions - Whether the handler can support multiple extensions. - SupportsMultipleExtensions *bool `json:"supportsMultipleExtensions,omitempty"` -} - -// VirtualMachineExtensionInstanceView the instance view of a virtual machine extension. -type VirtualMachineExtensionInstanceView struct { - // Name - The virtual machine extension name. - Name *string `json:"name,omitempty"` - // Type - Specifies the type of the extension; an example is "CustomScriptExtension". - Type *string `json:"type,omitempty"` - // TypeHandlerVersion - Specifies the version of the script handler. - TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` - // Substatuses - The resource status information. - Substatuses *[]InstanceViewStatus `json:"substatuses,omitempty"` - // Statuses - The resource status information. - Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` -} - -// VirtualMachineExtensionProperties describes the properties of a Virtual Machine Extension. -type VirtualMachineExtensionProperties struct { - // ForceUpdateTag - How the extension handler should be forced to update even if the extension configuration has not changed. - ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` - // Publisher - The name of the extension handler publisher. - Publisher *string `json:"publisher,omitempty"` - // Type - Specifies the type of the extension; an example is "CustomScriptExtension". - Type *string `json:"type,omitempty"` - // TypeHandlerVersion - Specifies the version of the script handler. - TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` - // 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"` - // EnableAutomaticUpgrade - Indicates whether the extension should be automatically upgraded by the platform if there is a newer version of the extension available. - EnableAutomaticUpgrade *bool `json:"enableAutomaticUpgrade,omitempty"` - // Settings - Json formatted public settings for the extension. - Settings interface{} `json:"settings,omitempty"` - // ProtectedSettings - The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. - ProtectedSettings interface{} `json:"protectedSettings,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *string `json:"provisioningState,omitempty"` - // InstanceView - The virtual machine extension instance view. - InstanceView *VirtualMachineExtensionInstanceView `json:"instanceView,omitempty"` - // SuppressFailures - Indicates whether failures stemming from the extension will be suppressed (Operational failures such as not connecting to the VM will not be suppressed regardless of this value). The default is false. - SuppressFailures *bool `json:"suppressFailures,omitempty"` - // ProtectedSettingsFromKeyVault - The extensions protected settings that are passed by reference, and consumed from key vault - ProtectedSettingsFromKeyVault *KeyVaultSecretReference `json:"protectedSettingsFromKeyVault,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineExtensionProperties. -func (vmep VirtualMachineExtensionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmep.ForceUpdateTag != nil { - objectMap["forceUpdateTag"] = vmep.ForceUpdateTag - } - if vmep.Publisher != nil { - objectMap["publisher"] = vmep.Publisher - } - if vmep.Type != nil { - objectMap["type"] = vmep.Type - } - if vmep.TypeHandlerVersion != nil { - objectMap["typeHandlerVersion"] = vmep.TypeHandlerVersion - } - if vmep.AutoUpgradeMinorVersion != nil { - objectMap["autoUpgradeMinorVersion"] = vmep.AutoUpgradeMinorVersion - } - if vmep.EnableAutomaticUpgrade != nil { - objectMap["enableAutomaticUpgrade"] = vmep.EnableAutomaticUpgrade - } - if vmep.Settings != nil { - objectMap["settings"] = vmep.Settings - } - if vmep.ProtectedSettings != nil { - objectMap["protectedSettings"] = vmep.ProtectedSettings - } - if vmep.InstanceView != nil { - objectMap["instanceView"] = vmep.InstanceView - } - if vmep.SuppressFailures != nil { - objectMap["suppressFailures"] = vmep.SuppressFailures - } - if vmep.ProtectedSettingsFromKeyVault != nil { - objectMap["protectedSettingsFromKeyVault"] = vmep.ProtectedSettingsFromKeyVault - } - return json.Marshal(objectMap) -} - -// VirtualMachineExtensionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. -type VirtualMachineExtensionsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineExtensionsClient) (VirtualMachineExtension, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineExtensionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineExtensionsCreateOrUpdateFuture.Result. -func (future *VirtualMachineExtensionsCreateOrUpdateFuture) result(client VirtualMachineExtensionsClient) (vme VirtualMachineExtension, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vme.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineExtensionsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vme.Response.Response, err = future.GetResult(sender); err == nil && vme.Response.Response.StatusCode != http.StatusNoContent { - vme, err = client.CreateOrUpdateResponder(vme.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsCreateOrUpdateFuture", "Result", vme.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachineExtensionsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineExtensionsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineExtensionsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineExtensionsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineExtensionsDeleteFuture.Result. -func (future *VirtualMachineExtensionsDeleteFuture) result(client VirtualMachineExtensionsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineExtensionsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineExtensionsListResult the List Extension operation response -type VirtualMachineExtensionsListResult struct { - autorest.Response `json:"-"` - // Value - The list of extensions - Value *[]VirtualMachineExtension `json:"value,omitempty"` -} - -// VirtualMachineExtensionsUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineExtensionsUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineExtensionsClient) (VirtualMachineExtension, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineExtensionsUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineExtensionsUpdateFuture.Result. -func (future *VirtualMachineExtensionsUpdateFuture) result(client VirtualMachineExtensionsClient) (vme VirtualMachineExtension, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vme.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineExtensionsUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vme.Response.Response, err = future.GetResult(sender); err == nil && vme.Response.Response.StatusCode != http.StatusNoContent { - vme, err = client.UpdateResponder(vme.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsUpdateFuture", "Result", vme.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachineExtensionUpdate describes a Virtual Machine Extension. -type VirtualMachineExtensionUpdate struct { - *VirtualMachineExtensionUpdateProperties `json:"properties,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineExtensionUpdate. -func (vmeu VirtualMachineExtensionUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmeu.VirtualMachineExtensionUpdateProperties != nil { - objectMap["properties"] = vmeu.VirtualMachineExtensionUpdateProperties - } - if vmeu.Tags != nil { - objectMap["tags"] = vmeu.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualMachineExtensionUpdate struct. -func (vmeu *VirtualMachineExtensionUpdate) 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 virtualMachineExtensionUpdateProperties VirtualMachineExtensionUpdateProperties - err = json.Unmarshal(*v, &virtualMachineExtensionUpdateProperties) - if err != nil { - return err - } - vmeu.VirtualMachineExtensionUpdateProperties = &virtualMachineExtensionUpdateProperties - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - vmeu.Tags = tags - } - } - } - - return nil -} - -// VirtualMachineExtensionUpdateProperties describes the properties of a Virtual Machine Extension. -type VirtualMachineExtensionUpdateProperties struct { - // ForceUpdateTag - How the extension handler should be forced to update even if the extension configuration has not changed. - ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` - // Publisher - The name of the extension handler publisher. - Publisher *string `json:"publisher,omitempty"` - // Type - Specifies the type of the extension; an example is "CustomScriptExtension". - Type *string `json:"type,omitempty"` - // TypeHandlerVersion - Specifies the version of the script handler. - TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` - // 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"` - // EnableAutomaticUpgrade - Indicates whether the extension should be automatically upgraded by the platform if there is a newer version of the extension available. - EnableAutomaticUpgrade *bool `json:"enableAutomaticUpgrade,omitempty"` - // Settings - Json formatted public settings for the extension. - Settings interface{} `json:"settings,omitempty"` - // ProtectedSettings - The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. - ProtectedSettings interface{} `json:"protectedSettings,omitempty"` - // SuppressFailures - Indicates whether failures stemming from the extension will be suppressed (Operational failures such as not connecting to the VM will not be suppressed regardless of this value). The default is false. - SuppressFailures *bool `json:"suppressFailures,omitempty"` - // ProtectedSettingsFromKeyVault - The extensions protected settings that are passed by reference, and consumed from key vault - ProtectedSettingsFromKeyVault *KeyVaultSecretReference `json:"protectedSettingsFromKeyVault,omitempty"` -} - -// VirtualMachineHealthStatus the health status of the VM. -type VirtualMachineHealthStatus struct { - // Status - READ-ONLY; The health status information for the VM. - Status *InstanceViewStatus `json:"status,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineHealthStatus. -func (vmhs VirtualMachineHealthStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// VirtualMachineIdentity identity for the virtual machine. -type VirtualMachineIdentity struct { - // PrincipalID - READ-ONLY; The principal id of virtual machine identity. This property will only be provided for a system assigned identity. - PrincipalID *string `json:"principalId,omitempty"` - // TenantID - READ-ONLY; The tenant id associated with the virtual machine. This property will only be provided for a system assigned identity. - TenantID *string `json:"tenantId,omitempty"` - // Type - The type of identity used for the virtual machine. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the virtual machine. Possible values include: 'ResourceIdentityTypeSystemAssigned', 'ResourceIdentityTypeUserAssigned', 'ResourceIdentityTypeSystemAssignedUserAssigned', 'ResourceIdentityTypeNone' - Type ResourceIdentityType `json:"type,omitempty"` - // UserAssignedIdentities - The list of user identities associated with the Virtual Machine. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - UserAssignedIdentities map[string]*UserAssignedIdentitiesValue `json:"userAssignedIdentities"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineIdentity. -func (vmi VirtualMachineIdentity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmi.Type != "" { - objectMap["type"] = vmi.Type - } - if vmi.UserAssignedIdentities != nil { - objectMap["userAssignedIdentities"] = vmi.UserAssignedIdentities - } - return json.Marshal(objectMap) -} - -// VirtualMachineImage describes a Virtual Machine Image. -type VirtualMachineImage struct { - 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"` - // ExtendedLocation - The extended location of the Virtual Machine. - ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` - // 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.ExtendedLocation != nil { - objectMap["extendedLocation"] = vmi.ExtendedLocation - } - 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 "extendedLocation": - if v != nil { - var extendedLocation ExtendedLocation - err = json.Unmarshal(*v, &extendedLocation) - if err != nil { - return err - } - vmi.ExtendedLocation = &extendedLocation - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vmi.ID = &ID - } - } - } - - return nil -} - -// VirtualMachineImageFeature specifies additional capabilities supported by the image -type VirtualMachineImageFeature struct { - // Name - The name of the feature. - Name *string `json:"name,omitempty"` - // Value - The corresponding value for the feature. - Value *string `json:"value,omitempty"` -} - -// VirtualMachineImageProperties describes the properties of a Virtual Machine Image. -type VirtualMachineImageProperties struct { - Plan *PurchasePlan `json:"plan,omitempty"` - OsDiskImage *OSDiskImage `json:"osDiskImage,omitempty"` - DataDiskImages *[]DataDiskImage `json:"dataDiskImages,omitempty"` - AutomaticOSUpgradeProperties *AutomaticOSUpgradeProperties `json:"automaticOSUpgradeProperties,omitempty"` - // HyperVGeneration - Possible values include: 'HyperVGenerationTypesV1', 'HyperVGenerationTypesV2' - HyperVGeneration HyperVGenerationTypes `json:"hyperVGeneration,omitempty"` - // Disallowed - Specifies disallowed configuration for the VirtualMachine created from the image - Disallowed *DisallowedConfiguration `json:"disallowed,omitempty"` - Features *[]VirtualMachineImageFeature `json:"features,omitempty"` - // Architecture - Possible values include: 'ArchitectureTypesX64', 'ArchitectureTypesArm64' - Architecture ArchitectureTypes `json:"architecture,omitempty"` -} - -// VirtualMachineImageResource virtual machine image resource information. -type VirtualMachineImageResource struct { - // 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"` - // ExtendedLocation - The extended location of the Virtual Machine. - ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` - // 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.ExtendedLocation != nil { - objectMap["extendedLocation"] = vmir.ExtendedLocation - } - if vmir.ID != nil { - objectMap["id"] = vmir.ID - } - return json.Marshal(objectMap) -} - -// VirtualMachineInstallPatchesParameters input for InstallPatches as directly received by the API -type VirtualMachineInstallPatchesParameters struct { - // MaximumDuration - Specifies the maximum amount of time that the operation will run. It must be an ISO 8601-compliant duration string such as PT4H (4 hours) - MaximumDuration *string `json:"maximumDuration,omitempty"` - // RebootSetting - Defines when it is acceptable to reboot a VM during a software update operation. Possible values include: 'IfRequired', 'Never', 'Always' - RebootSetting VMGuestPatchRebootSetting `json:"rebootSetting,omitempty"` - // WindowsParameters - Input for InstallPatches on a Windows VM, as directly received by the API - WindowsParameters *WindowsParameters `json:"windowsParameters,omitempty"` - // LinuxParameters - Input for InstallPatches on a Linux VM, as directly received by the API - LinuxParameters *LinuxParameters `json:"linuxParameters,omitempty"` -} - -// VirtualMachineInstallPatchesResult the result summary of an installation operation. -type VirtualMachineInstallPatchesResult struct { - autorest.Response `json:"-"` - // Status - READ-ONLY; The overall success or failure status of the operation. It remains "InProgress" until the operation completes. At that point it will become "Failed", "Succeeded", "Unknown" or "CompletedWithWarnings.". Possible values include: 'PatchOperationStatusUnknown', 'PatchOperationStatusInProgress', 'PatchOperationStatusFailed', 'PatchOperationStatusSucceeded', 'PatchOperationStatusCompletedWithWarnings' - Status PatchOperationStatus `json:"status,omitempty"` - // InstallationActivityID - READ-ONLY; The activity ID of the operation that produced this result. It is used to correlate across CRP and extension logs. - InstallationActivityID *string `json:"installationActivityId,omitempty"` - // RebootStatus - READ-ONLY; The reboot state of the VM following completion of the operation. Possible values include: 'VMGuestPatchRebootStatusUnknown', 'VMGuestPatchRebootStatusNotNeeded', 'VMGuestPatchRebootStatusRequired', 'VMGuestPatchRebootStatusStarted', 'VMGuestPatchRebootStatusFailed', 'VMGuestPatchRebootStatusCompleted' - RebootStatus VMGuestPatchRebootStatus `json:"rebootStatus,omitempty"` - // MaintenanceWindowExceeded - READ-ONLY; Whether the operation ran out of time before it completed all its intended actions. - MaintenanceWindowExceeded *bool `json:"maintenanceWindowExceeded,omitempty"` - // ExcludedPatchCount - READ-ONLY; The number of patches that were not installed due to the user blocking their installation. - ExcludedPatchCount *int32 `json:"excludedPatchCount,omitempty"` - // NotSelectedPatchCount - READ-ONLY; The number of patches that were detected as available for install, but did not meet the operation's criteria. - NotSelectedPatchCount *int32 `json:"notSelectedPatchCount,omitempty"` - // PendingPatchCount - READ-ONLY; The number of patches that were identified as meeting the installation criteria, but were not able to be installed. Typically this happens when maintenanceWindowExceeded == true. - PendingPatchCount *int32 `json:"pendingPatchCount,omitempty"` - // InstalledPatchCount - READ-ONLY; The number of patches successfully installed. - InstalledPatchCount *int32 `json:"installedPatchCount,omitempty"` - // FailedPatchCount - READ-ONLY; The number of patches that could not be installed due to some issue. See errors for details. - FailedPatchCount *int32 `json:"failedPatchCount,omitempty"` - // Patches - READ-ONLY; The patches that were installed during the operation. - Patches *[]PatchInstallationDetail `json:"patches,omitempty"` - // StartDateTime - READ-ONLY; The UTC timestamp when the operation began. - StartDateTime *date.Time `json:"startDateTime,omitempty"` - // Error - READ-ONLY; The errors that were encountered during execution of the operation. The details array contains the list of them. - Error *APIError `json:"error,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineInstallPatchesResult. -func (vmipr VirtualMachineInstallPatchesResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// VirtualMachineInstanceView the instance view of a virtual machine. -type VirtualMachineInstanceView struct { - autorest.Response `json:"-"` - // PlatformUpdateDomain - Specifies the update domain of the virtual machine. - PlatformUpdateDomain *int32 `json:"platformUpdateDomain,omitempty"` - // PlatformFaultDomain - Specifies the fault domain of the virtual machine. - PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"` - // ComputerName - The computer name assigned to the virtual machine. - ComputerName *string `json:"computerName,omitempty"` - // OsName - The Operating System running on the virtual machine. - OsName *string `json:"osName,omitempty"` - // OsVersion - The version of Operating System running on the virtual machine. - OsVersion *string `json:"osVersion,omitempty"` - // HyperVGeneration - Specifies the HyperVGeneration Type associated with a resource. Possible values include: 'HyperVGenerationTypeV1', 'HyperVGenerationTypeV2' - HyperVGeneration HyperVGenerationType `json:"hyperVGeneration,omitempty"` - // RdpThumbPrint - The Remote desktop certificate thumbprint. - RdpThumbPrint *string `json:"rdpThumbPrint,omitempty"` - // VMAgent - The VM Agent running on the virtual machine. - VMAgent *VirtualMachineAgentInstanceView `json:"vmAgent,omitempty"` - // MaintenanceRedeployStatus - The Maintenance Operation status on the virtual machine. - MaintenanceRedeployStatus *MaintenanceRedeployStatus `json:"maintenanceRedeployStatus,omitempty"` - // Disks - The virtual machine disk information. - Disks *[]DiskInstanceView `json:"disks,omitempty"` - // Extensions - The extensions information. - Extensions *[]VirtualMachineExtensionInstanceView `json:"extensions,omitempty"` - // VMHealth - READ-ONLY; The health status for the VM. - VMHealth *VirtualMachineHealthStatus `json:"vmHealth,omitempty"` - // BootDiagnostics - Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to diagnose VM status.

      You can easily view the output of your console log.

      Azure also enables you to see a screenshot of the VM from the hypervisor. - BootDiagnostics *BootDiagnosticsInstanceView `json:"bootDiagnostics,omitempty"` - // AssignedHost - READ-ONLY; Resource id of the dedicated host, on which the virtual machine is allocated through automatic placement, when the virtual machine is associated with a dedicated host group that has automatic placement enabled.

      Minimum api-version: 2020-06-01. - AssignedHost *string `json:"assignedHost,omitempty"` - // Statuses - The resource status information. - Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` - // PatchStatus - [Preview Feature] The status of virtual machine patch operations. - PatchStatus *VirtualMachinePatchStatus `json:"patchStatus,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineInstanceView. -func (vmiv VirtualMachineInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmiv.PlatformUpdateDomain != nil { - objectMap["platformUpdateDomain"] = vmiv.PlatformUpdateDomain - } - if vmiv.PlatformFaultDomain != nil { - objectMap["platformFaultDomain"] = vmiv.PlatformFaultDomain - } - if vmiv.ComputerName != nil { - objectMap["computerName"] = vmiv.ComputerName - } - if vmiv.OsName != nil { - objectMap["osName"] = vmiv.OsName - } - if vmiv.OsVersion != nil { - objectMap["osVersion"] = vmiv.OsVersion - } - if vmiv.HyperVGeneration != "" { - objectMap["hyperVGeneration"] = vmiv.HyperVGeneration - } - if vmiv.RdpThumbPrint != nil { - objectMap["rdpThumbPrint"] = vmiv.RdpThumbPrint - } - if vmiv.VMAgent != nil { - objectMap["vmAgent"] = vmiv.VMAgent - } - if vmiv.MaintenanceRedeployStatus != nil { - objectMap["maintenanceRedeployStatus"] = vmiv.MaintenanceRedeployStatus - } - if vmiv.Disks != nil { - objectMap["disks"] = vmiv.Disks - } - if vmiv.Extensions != nil { - objectMap["extensions"] = vmiv.Extensions - } - if vmiv.BootDiagnostics != nil { - objectMap["bootDiagnostics"] = vmiv.BootDiagnostics - } - if vmiv.Statuses != nil { - objectMap["statuses"] = vmiv.Statuses - } - if vmiv.PatchStatus != nil { - objectMap["patchStatus"] = vmiv.PatchStatus - } - return json.Marshal(objectMap) -} - -// VirtualMachineIPTag contains the IP tag associated with the public IP address. -type VirtualMachineIPTag struct { - // IPTagType - IP tag type. Example: FirstPartyUsage. - IPTagType *string `json:"ipTagType,omitempty"` - // Tag - IP tag associated with the public IP. Example: SQL, Storage etc. - Tag *string `json:"tag,omitempty"` -} - -// VirtualMachineListResult the List Virtual Machine operation response. -type VirtualMachineListResult struct { - autorest.Response `json:"-"` - // Value - The list of virtual machines. - Value *[]VirtualMachine `json:"value,omitempty"` - // NextLink - The URI to fetch the next page of VMs. Call ListNext() with this URI to fetch the next page of Virtual Machines. - NextLink *string `json:"nextLink,omitempty"` -} - -// VirtualMachineListResultIterator provides access to a complete listing of VirtualMachine values. -type VirtualMachineListResultIterator struct { - i int - page VirtualMachineListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *VirtualMachineListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *VirtualMachineListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter VirtualMachineListResultIterator) 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 VirtualMachineListResultIterator) Response() VirtualMachineListResult { - 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 VirtualMachineListResultIterator) Value() VirtualMachine { - if !iter.page.NotDone() { - return VirtualMachine{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the VirtualMachineListResultIterator type. -func NewVirtualMachineListResultIterator(page VirtualMachineListResultPage) VirtualMachineListResultIterator { - return VirtualMachineListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (vmlr VirtualMachineListResult) IsEmpty() bool { - return vmlr.Value == nil || len(*vmlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (vmlr VirtualMachineListResult) hasNextLink() bool { - return vmlr.NextLink != nil && len(*vmlr.NextLink) != 0 -} - -// virtualMachineListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (vmlr VirtualMachineListResult) virtualMachineListResultPreparer(ctx context.Context) (*http.Request, error) { - if !vmlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(vmlr.NextLink))) -} - -// VirtualMachineListResultPage contains a page of VirtualMachine values. -type VirtualMachineListResultPage struct { - fn func(context.Context, VirtualMachineListResult) (VirtualMachineListResult, error) - vmlr VirtualMachineListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *VirtualMachineListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.vmlr) - if err != nil { - return err - } - page.vmlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *VirtualMachineListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page VirtualMachineListResultPage) NotDone() bool { - return !page.vmlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page VirtualMachineListResultPage) Response() VirtualMachineListResult { - return page.vmlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page VirtualMachineListResultPage) Values() []VirtualMachine { - if page.vmlr.IsEmpty() { - return nil - } - return *page.vmlr.Value -} - -// Creates a new instance of the VirtualMachineListResultPage type. -func NewVirtualMachineListResultPage(cur VirtualMachineListResult, getNextPage func(context.Context, VirtualMachineListResult) (VirtualMachineListResult, error)) VirtualMachineListResultPage { - return VirtualMachineListResultPage{ - fn: getNextPage, - vmlr: cur, - } -} - -// VirtualMachineNetworkInterfaceConfiguration describes a virtual machine network interface -// configurations. -type VirtualMachineNetworkInterfaceConfiguration struct { - // Name - The network interface configuration name. - Name *string `json:"name,omitempty"` - *VirtualMachineNetworkInterfaceConfigurationProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineNetworkInterfaceConfiguration. -func (vmnic VirtualMachineNetworkInterfaceConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmnic.Name != nil { - objectMap["name"] = vmnic.Name - } - if vmnic.VirtualMachineNetworkInterfaceConfigurationProperties != nil { - objectMap["properties"] = vmnic.VirtualMachineNetworkInterfaceConfigurationProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualMachineNetworkInterfaceConfiguration struct. -func (vmnic *VirtualMachineNetworkInterfaceConfiguration) 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 - } - vmnic.Name = &name - } - case "properties": - if v != nil { - var virtualMachineNetworkInterfaceConfigurationProperties VirtualMachineNetworkInterfaceConfigurationProperties - err = json.Unmarshal(*v, &virtualMachineNetworkInterfaceConfigurationProperties) - if err != nil { - return err - } - vmnic.VirtualMachineNetworkInterfaceConfigurationProperties = &virtualMachineNetworkInterfaceConfigurationProperties - } - } - } - - return nil -} - -// VirtualMachineNetworkInterfaceConfigurationProperties describes a virtual machine network profile's IP -// configuration. -type VirtualMachineNetworkInterfaceConfigurationProperties struct { - // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface. - Primary *bool `json:"primary,omitempty"` - // DeleteOption - Specify what happens to the network interface when the VM is deleted. Possible values include: 'Delete', 'Detach' - DeleteOption DeleteOptions `json:"deleteOption,omitempty"` - // EnableAcceleratedNetworking - Specifies whether the network interface is accelerated networking-enabled. - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - // DisableTCPStateTracking - Specifies whether the network interface is disabled for tcp state tracking. - DisableTCPStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - // EnableFpga - Specifies whether the network interface is FPGA networking-enabled. - EnableFpga *bool `json:"enableFpga,omitempty"` - // EnableIPForwarding - Whether IP forwarding enabled on this NIC. - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - // NetworkSecurityGroup - The network security group. - NetworkSecurityGroup *SubResource `json:"networkSecurityGroup,omitempty"` - // DNSSettings - The dns settings to be applied on the network interfaces. - DNSSettings *VirtualMachineNetworkInterfaceDNSSettingsConfiguration `json:"dnsSettings,omitempty"` - // IPConfigurations - Specifies the IP configurations of the network interface. - IPConfigurations *[]VirtualMachineNetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` -} - -// VirtualMachineNetworkInterfaceDNSSettingsConfiguration describes a virtual machines network -// configuration's DNS settings. -type VirtualMachineNetworkInterfaceDNSSettingsConfiguration struct { - // DNSServers - List of DNS servers IP addresses - DNSServers *[]string `json:"dnsServers,omitempty"` -} - -// VirtualMachineNetworkInterfaceIPConfiguration describes a virtual machine network profile's IP -// configuration. -type VirtualMachineNetworkInterfaceIPConfiguration struct { - // Name - The IP configuration name. - Name *string `json:"name,omitempty"` - *VirtualMachineNetworkInterfaceIPConfigurationProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineNetworkInterfaceIPConfiguration. -func (vmniic VirtualMachineNetworkInterfaceIPConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmniic.Name != nil { - objectMap["name"] = vmniic.Name - } - if vmniic.VirtualMachineNetworkInterfaceIPConfigurationProperties != nil { - objectMap["properties"] = vmniic.VirtualMachineNetworkInterfaceIPConfigurationProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualMachineNetworkInterfaceIPConfiguration struct. -func (vmniic *VirtualMachineNetworkInterfaceIPConfiguration) 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 - } - vmniic.Name = &name - } - case "properties": - if v != nil { - var virtualMachineNetworkInterfaceIPConfigurationProperties VirtualMachineNetworkInterfaceIPConfigurationProperties - err = json.Unmarshal(*v, &virtualMachineNetworkInterfaceIPConfigurationProperties) - if err != nil { - return err - } - vmniic.VirtualMachineNetworkInterfaceIPConfigurationProperties = &virtualMachineNetworkInterfaceIPConfigurationProperties - } - } - } - - return nil -} - -// VirtualMachineNetworkInterfaceIPConfigurationProperties describes a virtual machine network interface IP -// configuration properties. -type VirtualMachineNetworkInterfaceIPConfigurationProperties struct { - // Subnet - Specifies the identifier of the subnet. - Subnet *SubResource `json:"subnet,omitempty"` - // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface. - Primary *bool `json:"primary,omitempty"` - // PublicIPAddressConfiguration - The publicIPAddressConfiguration. - PublicIPAddressConfiguration *VirtualMachinePublicIPAddressConfiguration `json:"publicIPAddressConfiguration,omitempty"` - // PrivateIPAddressVersion - Available from Api-Version 2017-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPVersionsIPv4', 'IPVersionsIPv6' - PrivateIPAddressVersion IPVersions `json:"privateIPAddressVersion,omitempty"` - // ApplicationSecurityGroups - Specifies an array of references to application security group. - ApplicationSecurityGroups *[]SubResource `json:"applicationSecurityGroups,omitempty"` - // ApplicationGatewayBackendAddressPools - Specifies an array of references to backend address pools of application gateways. A virtual machine can reference backend address pools of multiple application gateways. Multiple virtual machines cannot use the same application gateway. - ApplicationGatewayBackendAddressPools *[]SubResource `json:"applicationGatewayBackendAddressPools,omitempty"` - // LoadBalancerBackendAddressPools - Specifies an array of references to backend address pools of load balancers. A virtual machine can reference backend address pools of one public and one internal load balancer. [Multiple virtual machines cannot use the same basic sku load balancer]. - LoadBalancerBackendAddressPools *[]SubResource `json:"loadBalancerBackendAddressPools,omitempty"` -} - -// VirtualMachinePatchStatus the status of virtual machine patch operations. -type VirtualMachinePatchStatus struct { - // AvailablePatchSummary - The available patch summary of the latest assessment operation for the virtual machine. - AvailablePatchSummary *AvailablePatchSummary `json:"availablePatchSummary,omitempty"` - // LastPatchInstallationSummary - The installation summary of the latest installation operation for the virtual machine. - LastPatchInstallationSummary *LastPatchInstallationSummary `json:"lastPatchInstallationSummary,omitempty"` - // ConfigurationStatuses - READ-ONLY; The enablement status of the specified patchMode - ConfigurationStatuses *[]InstanceViewStatus `json:"configurationStatuses,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachinePatchStatus. -func (vmps VirtualMachinePatchStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmps.AvailablePatchSummary != nil { - objectMap["availablePatchSummary"] = vmps.AvailablePatchSummary - } - if vmps.LastPatchInstallationSummary != nil { - objectMap["lastPatchInstallationSummary"] = vmps.LastPatchInstallationSummary - } - return json.Marshal(objectMap) -} - -// VirtualMachineProperties describes the properties of a Virtual Machine. -type VirtualMachineProperties struct { - // HardwareProfile - Specifies the hardware settings for the virtual machine. - HardwareProfile *HardwareProfile `json:"hardwareProfile,omitempty"` - // StorageProfile - Specifies the storage settings for the virtual machine disks. - StorageProfile *StorageProfile `json:"storageProfile,omitempty"` - // AdditionalCapabilities - Specifies additional capabilities enabled or disabled on the virtual machine. - AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` - // OsProfile - Specifies the operating system settings used while creating the virtual machine. Some of the settings cannot be changed once VM is provisioned. - OsProfile *OSProfile `json:"osProfile,omitempty"` - // NetworkProfile - Specifies the network interfaces of the virtual machine. - NetworkProfile *NetworkProfile `json:"networkProfile,omitempty"` - // SecurityProfile - Specifies the Security related profile settings for the virtual machine. - SecurityProfile *SecurityProfile `json:"securityProfile,omitempty"` - // DiagnosticsProfile - Specifies the boot diagnostic settings state.

      Minimum api-version: 2015-06-15. - DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` - // 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 [Availability sets overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview).

      For more information on Azure planned maintenance, see [Maintenance and updates for Virtual Machines in Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates)

      Currently, a VM can only be added to availability set at creation time. The availability set to which the VM is being added should be under the same resource group as the availability set resource. An existing VM cannot be added to an availability set.

      This property cannot exist along with a non-null properties.virtualMachineScaleSet reference. - AvailabilitySet *SubResource `json:"availabilitySet,omitempty"` - // VirtualMachineScaleSet - Specifies information about the virtual machine scale set that the virtual machine should be assigned to. Virtual machines specified in the same virtual machine scale set are allocated to different nodes to maximize availability. Currently, a VM can only be added to virtual machine scale set at creation time. An existing VM cannot be added to a virtual machine scale set.

      This property cannot exist along with a non-null properties.availabilitySet reference.

      Minimum api‐version: 2019‐03‐01 - VirtualMachineScaleSet *SubResource `json:"virtualMachineScaleSet,omitempty"` - // ProximityPlacementGroup - Specifies information about the proximity placement group that the virtual machine should be assigned to.

      Minimum api-version: 2018-04-01. - ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` - // Priority - Specifies the priority for the virtual machine.

      Minimum api-version: 2019-03-01. Possible values include: 'Regular', 'Low', 'Spot' - Priority VirtualMachinePriorityTypes `json:"priority,omitempty"` - // EvictionPolicy - Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot scale set.

      For Azure Spot virtual machines, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2019-03-01.

      For Azure Spot scale sets, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2017-10-30-preview. Possible values include: 'VirtualMachineEvictionPolicyTypesDeallocate', 'VirtualMachineEvictionPolicyTypesDelete' - EvictionPolicy VirtualMachineEvictionPolicyTypes `json:"evictionPolicy,omitempty"` - // BillingProfile - Specifies the billing related details of a Azure Spot virtual machine.

      Minimum api-version: 2019-03-01. - BillingProfile *BillingProfile `json:"billingProfile,omitempty"` - // Host - Specifies information about the dedicated host that the virtual machine resides in.

      Minimum api-version: 2018-10-01. - Host *SubResource `json:"host,omitempty"` - // HostGroup - Specifies information about the dedicated host group that the virtual machine resides in.

      Minimum api-version: 2020-06-01.

      NOTE: User cannot specify both host and hostGroup properties. - HostGroup *SubResource `json:"hostGroup,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *string `json:"provisioningState,omitempty"` - // InstanceView - READ-ONLY; The virtual machine instance view. - InstanceView *VirtualMachineInstanceView `json:"instanceView,omitempty"` - // LicenseType - Specifies that the image or disk that is being used was licensed on-premises.

      Possible values for Windows Server operating system are:

      Windows_Client

      Windows_Server

      Possible values for Linux Server operating system are:

      RHEL_BYOS (for RHEL)

      SLES_BYOS (for SUSE)

      For more information, see [Azure Hybrid Use Benefit for Windows Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing)

      [Azure Hybrid Use Benefit for Linux Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux)

      Minimum api-version: 2015-06-15 - LicenseType *string `json:"licenseType,omitempty"` - // VMID - READ-ONLY; Specifies the VM unique ID which is a 128-bits identifier that is encoded and stored in all Azure IaaS VMs SMBIOS and can be read using platform BIOS commands. - VMID *string `json:"vmId,omitempty"` - // ExtensionsTimeBudget - Specifies the time alloted for all extensions to start. The time duration should be between 15 minutes and 120 minutes (inclusive) and should be specified in ISO 8601 format. The default value is 90 minutes (PT1H30M).

      Minimum api-version: 2020-06-01 - ExtensionsTimeBudget *string `json:"extensionsTimeBudget,omitempty"` - // PlatformFaultDomain - Specifies the scale set logical fault domain into which the Virtual Machine will be created. By default, the Virtual Machine will by automatically assigned to a fault domain that best maintains balance across available fault domains.
    • This is applicable only if the 'virtualMachineScaleSet' property of this Virtual Machine is set.
    • The Virtual Machine Scale Set that is referenced, must have 'platformFaultDomainCount' > 1.
    • This property cannot be updated once the Virtual Machine is created.
    • Fault domain assignment can be viewed in the Virtual Machine Instance View.

      Minimum api‐version: 2020‐12‐01 - PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"` - // ScheduledEventsProfile - Specifies Scheduled Event related configurations. - ScheduledEventsProfile *ScheduledEventsProfile `json:"scheduledEventsProfile,omitempty"` - // UserData - UserData for the VM, which must be base-64 encoded. Customer should not pass any secrets in here.

      Minimum api-version: 2021-03-01 - UserData *string `json:"userData,omitempty"` - // CapacityReservation - Specifies information about the capacity reservation that is used to allocate virtual machine.

      Minimum api-version: 2021-04-01. - CapacityReservation *CapacityReservationProfile `json:"capacityReservation,omitempty"` - // ApplicationProfile - Specifies the gallery applications that should be made available to the VM/VMSS - ApplicationProfile *ApplicationProfile `json:"applicationProfile,omitempty"` - // TimeCreated - READ-ONLY; Specifies the time at which the Virtual Machine resource was created.

      Minimum api-version: 2021-11-01. - TimeCreated *date.Time `json:"timeCreated,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineProperties. -func (vmp VirtualMachineProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmp.HardwareProfile != nil { - objectMap["hardwareProfile"] = vmp.HardwareProfile - } - if vmp.StorageProfile != nil { - objectMap["storageProfile"] = vmp.StorageProfile - } - if vmp.AdditionalCapabilities != nil { - objectMap["additionalCapabilities"] = vmp.AdditionalCapabilities - } - if vmp.OsProfile != nil { - objectMap["osProfile"] = vmp.OsProfile - } - if vmp.NetworkProfile != nil { - objectMap["networkProfile"] = vmp.NetworkProfile - } - if vmp.SecurityProfile != nil { - objectMap["securityProfile"] = vmp.SecurityProfile - } - if vmp.DiagnosticsProfile != nil { - objectMap["diagnosticsProfile"] = vmp.DiagnosticsProfile - } - if vmp.AvailabilitySet != nil { - objectMap["availabilitySet"] = vmp.AvailabilitySet - } - if vmp.VirtualMachineScaleSet != nil { - objectMap["virtualMachineScaleSet"] = vmp.VirtualMachineScaleSet - } - if vmp.ProximityPlacementGroup != nil { - objectMap["proximityPlacementGroup"] = vmp.ProximityPlacementGroup - } - if vmp.Priority != "" { - objectMap["priority"] = vmp.Priority - } - if vmp.EvictionPolicy != "" { - objectMap["evictionPolicy"] = vmp.EvictionPolicy - } - if vmp.BillingProfile != nil { - objectMap["billingProfile"] = vmp.BillingProfile - } - if vmp.Host != nil { - objectMap["host"] = vmp.Host - } - if vmp.HostGroup != nil { - objectMap["hostGroup"] = vmp.HostGroup - } - if vmp.LicenseType != nil { - objectMap["licenseType"] = vmp.LicenseType - } - if vmp.ExtensionsTimeBudget != nil { - objectMap["extensionsTimeBudget"] = vmp.ExtensionsTimeBudget - } - if vmp.PlatformFaultDomain != nil { - objectMap["platformFaultDomain"] = vmp.PlatformFaultDomain - } - if vmp.ScheduledEventsProfile != nil { - objectMap["scheduledEventsProfile"] = vmp.ScheduledEventsProfile - } - if vmp.UserData != nil { - objectMap["userData"] = vmp.UserData - } - if vmp.CapacityReservation != nil { - objectMap["capacityReservation"] = vmp.CapacityReservation - } - if vmp.ApplicationProfile != nil { - objectMap["applicationProfile"] = vmp.ApplicationProfile - } - return json.Marshal(objectMap) -} - -// VirtualMachinePublicIPAddressConfiguration describes a virtual machines IP Configuration's -// PublicIPAddress configuration -type VirtualMachinePublicIPAddressConfiguration struct { - // Name - The publicIP address configuration name. - Name *string `json:"name,omitempty"` - *VirtualMachinePublicIPAddressConfigurationProperties `json:"properties,omitempty"` - Sku *PublicIPAddressSku `json:"sku,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachinePublicIPAddressConfiguration. -func (vmpiac VirtualMachinePublicIPAddressConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmpiac.Name != nil { - objectMap["name"] = vmpiac.Name - } - if vmpiac.VirtualMachinePublicIPAddressConfigurationProperties != nil { - objectMap["properties"] = vmpiac.VirtualMachinePublicIPAddressConfigurationProperties - } - if vmpiac.Sku != nil { - objectMap["sku"] = vmpiac.Sku - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualMachinePublicIPAddressConfiguration struct. -func (vmpiac *VirtualMachinePublicIPAddressConfiguration) 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 - } - vmpiac.Name = &name - } - case "properties": - if v != nil { - var virtualMachinePublicIPAddressConfigurationProperties VirtualMachinePublicIPAddressConfigurationProperties - err = json.Unmarshal(*v, &virtualMachinePublicIPAddressConfigurationProperties) - if err != nil { - return err - } - vmpiac.VirtualMachinePublicIPAddressConfigurationProperties = &virtualMachinePublicIPAddressConfigurationProperties - } - case "sku": - if v != nil { - var sku PublicIPAddressSku - err = json.Unmarshal(*v, &sku) - if err != nil { - return err - } - vmpiac.Sku = &sku - } - } - } - - return nil -} - -// VirtualMachinePublicIPAddressConfigurationProperties describes a virtual machines IP Configuration's -// PublicIPAddress configuration -type VirtualMachinePublicIPAddressConfigurationProperties struct { - // IdleTimeoutInMinutes - The idle timeout of the public IP address. - IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` - // DeleteOption - Specify what happens to the public IP address when the VM is deleted. Possible values include: 'Delete', 'Detach' - DeleteOption DeleteOptions `json:"deleteOption,omitempty"` - // DNSSettings - The dns settings to be applied on the publicIP addresses . - DNSSettings *VirtualMachinePublicIPAddressDNSSettingsConfiguration `json:"dnsSettings,omitempty"` - // IPTags - The list of IP tags associated with the public IP address. - IPTags *[]VirtualMachineIPTag `json:"ipTags,omitempty"` - // PublicIPPrefix - The PublicIPPrefix from which to allocate publicIP addresses. - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - // PublicIPAddressVersion - Available from Api-Version 2019-07-01 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPVersionsIPv4', 'IPVersionsIPv6' - PublicIPAddressVersion IPVersions `json:"publicIPAddressVersion,omitempty"` - // PublicIPAllocationMethod - Specify the public IP allocation type. Possible values include: 'Dynamic', 'Static' - PublicIPAllocationMethod PublicIPAllocationMethod `json:"publicIPAllocationMethod,omitempty"` -} - -// VirtualMachinePublicIPAddressDNSSettingsConfiguration describes a virtual machines network -// configuration's DNS settings. -type VirtualMachinePublicIPAddressDNSSettingsConfiguration struct { - // DomainNameLabel - The Domain name label prefix of the PublicIPAddress resources that will be created. The generated name label is the concatenation of the domain name label and vm network profile unique ID. - DomainNameLabel *string `json:"domainNameLabel,omitempty"` -} - -// VirtualMachineReimageParameters parameters for Reimaging Virtual Machine. NOTE: Virtual Machine OS disk -// will always be reimaged -type VirtualMachineReimageParameters struct { - // TempDisk - Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage parameter is only supported for VM/VMSS with Ephemeral OS disk. - TempDisk *bool `json:"tempDisk,omitempty"` -} - -// VirtualMachineRunCommand describes a Virtual Machine run command. -type VirtualMachineRunCommand struct { - autorest.Response `json:"-"` - *VirtualMachineRunCommandProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; 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 VirtualMachineRunCommand. -func (vmrc VirtualMachineRunCommand) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmrc.VirtualMachineRunCommandProperties != nil { - objectMap["properties"] = vmrc.VirtualMachineRunCommandProperties - } - if vmrc.Location != nil { - objectMap["location"] = vmrc.Location - } - if vmrc.Tags != nil { - objectMap["tags"] = vmrc.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualMachineRunCommand struct. -func (vmrc *VirtualMachineRunCommand) 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 virtualMachineRunCommandProperties VirtualMachineRunCommandProperties - err = json.Unmarshal(*v, &virtualMachineRunCommandProperties) - if err != nil { - return err - } - vmrc.VirtualMachineRunCommandProperties = &virtualMachineRunCommandProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vmrc.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vmrc.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vmrc.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - vmrc.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - vmrc.Tags = tags - } - } - } - - return nil -} - -// VirtualMachineRunCommandInstanceView the instance view of a virtual machine run command. -type VirtualMachineRunCommandInstanceView struct { - // ExecutionState - Script execution status. Possible values include: 'ExecutionStateUnknown', 'ExecutionStatePending', 'ExecutionStateRunning', 'ExecutionStateFailed', 'ExecutionStateSucceeded', 'ExecutionStateTimedOut', 'ExecutionStateCanceled' - ExecutionState ExecutionState `json:"executionState,omitempty"` - // ExecutionMessage - Communicate script configuration errors or execution messages. - ExecutionMessage *string `json:"executionMessage,omitempty"` - // ExitCode - Exit code returned from script execution. - ExitCode *int32 `json:"exitCode,omitempty"` - // Output - Script output stream. - Output *string `json:"output,omitempty"` - // Error - Script error stream. - Error *string `json:"error,omitempty"` - // StartTime - Script start time. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - Script end time. - EndTime *date.Time `json:"endTime,omitempty"` - // Statuses - The resource status information. - Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` -} - -// VirtualMachineRunCommandProperties describes the properties of a Virtual Machine run command. -type VirtualMachineRunCommandProperties struct { - // Source - The source of the run command script. - Source *VirtualMachineRunCommandScriptSource `json:"source,omitempty"` - // Parameters - The parameters used by the script. - Parameters *[]RunCommandInputParameter `json:"parameters,omitempty"` - // ProtectedParameters - The parameters used by the script. - ProtectedParameters *[]RunCommandInputParameter `json:"protectedParameters,omitempty"` - // AsyncExecution - Optional. If set to true, provisioning will complete as soon as the script starts and will not wait for script to complete. - AsyncExecution *bool `json:"asyncExecution,omitempty"` - // RunAsUser - Specifies the user account on the VM when executing the run command. - RunAsUser *string `json:"runAsUser,omitempty"` - // RunAsPassword - Specifies the user account password on the VM when executing the run command. - RunAsPassword *string `json:"runAsPassword,omitempty"` - // TimeoutInSeconds - The timeout in seconds to execute the run command. - TimeoutInSeconds *int32 `json:"timeoutInSeconds,omitempty"` - // OutputBlobURI - Specifies the Azure storage blob where script output stream will be uploaded. - OutputBlobURI *string `json:"outputBlobUri,omitempty"` - // ErrorBlobURI - Specifies the Azure storage blob where script error stream will be uploaded. - ErrorBlobURI *string `json:"errorBlobUri,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *string `json:"provisioningState,omitempty"` - // InstanceView - READ-ONLY; The virtual machine run command instance view. - InstanceView *VirtualMachineRunCommandInstanceView `json:"instanceView,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineRunCommandProperties. -func (vmrcp VirtualMachineRunCommandProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmrcp.Source != nil { - objectMap["source"] = vmrcp.Source - } - if vmrcp.Parameters != nil { - objectMap["parameters"] = vmrcp.Parameters - } - if vmrcp.ProtectedParameters != nil { - objectMap["protectedParameters"] = vmrcp.ProtectedParameters - } - if vmrcp.AsyncExecution != nil { - objectMap["asyncExecution"] = vmrcp.AsyncExecution - } - if vmrcp.RunAsUser != nil { - objectMap["runAsUser"] = vmrcp.RunAsUser - } - if vmrcp.RunAsPassword != nil { - objectMap["runAsPassword"] = vmrcp.RunAsPassword - } - if vmrcp.TimeoutInSeconds != nil { - objectMap["timeoutInSeconds"] = vmrcp.TimeoutInSeconds - } - if vmrcp.OutputBlobURI != nil { - objectMap["outputBlobUri"] = vmrcp.OutputBlobURI - } - if vmrcp.ErrorBlobURI != nil { - objectMap["errorBlobUri"] = vmrcp.ErrorBlobURI - } - return json.Marshal(objectMap) -} - -// VirtualMachineRunCommandsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type VirtualMachineRunCommandsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineRunCommandsClient) (VirtualMachineRunCommand, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineRunCommandsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineRunCommandsCreateOrUpdateFuture.Result. -func (future *VirtualMachineRunCommandsCreateOrUpdateFuture) result(client VirtualMachineRunCommandsClient) (vmrc VirtualMachineRunCommand, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vmrc.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineRunCommandsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vmrc.Response.Response, err = future.GetResult(sender); err == nil && vmrc.Response.Response.StatusCode != http.StatusNoContent { - vmrc, err = client.CreateOrUpdateResponder(vmrc.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsCreateOrUpdateFuture", "Result", vmrc.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachineRunCommandScriptSource describes the script sources for run command. -type VirtualMachineRunCommandScriptSource struct { - // Script - Specifies the script content to be executed on the VM. - Script *string `json:"script,omitempty"` - // ScriptURI - Specifies the script download location. - ScriptURI *string `json:"scriptUri,omitempty"` - // CommandID - Specifies a commandId of predefined built-in script. - CommandID *string `json:"commandId,omitempty"` -} - -// VirtualMachineRunCommandsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineRunCommandsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineRunCommandsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineRunCommandsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineRunCommandsDeleteFuture.Result. -func (future *VirtualMachineRunCommandsDeleteFuture) result(client VirtualMachineRunCommandsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineRunCommandsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineRunCommandsListResult the List run command operation response -type VirtualMachineRunCommandsListResult struct { - autorest.Response `json:"-"` - // Value - The list of run commands - Value *[]VirtualMachineRunCommand `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of run commands. - NextLink *string `json:"nextLink,omitempty"` -} - -// VirtualMachineRunCommandsListResultIterator provides access to a complete listing of -// VirtualMachineRunCommand values. -type VirtualMachineRunCommandsListResultIterator struct { - i int - page VirtualMachineRunCommandsListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *VirtualMachineRunCommandsListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineRunCommandsListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *VirtualMachineRunCommandsListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter VirtualMachineRunCommandsListResultIterator) 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 VirtualMachineRunCommandsListResultIterator) Response() VirtualMachineRunCommandsListResult { - 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 VirtualMachineRunCommandsListResultIterator) Value() VirtualMachineRunCommand { - if !iter.page.NotDone() { - return VirtualMachineRunCommand{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the VirtualMachineRunCommandsListResultIterator type. -func NewVirtualMachineRunCommandsListResultIterator(page VirtualMachineRunCommandsListResultPage) VirtualMachineRunCommandsListResultIterator { - return VirtualMachineRunCommandsListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (vmrclr VirtualMachineRunCommandsListResult) IsEmpty() bool { - return vmrclr.Value == nil || len(*vmrclr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (vmrclr VirtualMachineRunCommandsListResult) hasNextLink() bool { - return vmrclr.NextLink != nil && len(*vmrclr.NextLink) != 0 -} - -// virtualMachineRunCommandsListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (vmrclr VirtualMachineRunCommandsListResult) virtualMachineRunCommandsListResultPreparer(ctx context.Context) (*http.Request, error) { - if !vmrclr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(vmrclr.NextLink))) -} - -// VirtualMachineRunCommandsListResultPage contains a page of VirtualMachineRunCommand values. -type VirtualMachineRunCommandsListResultPage struct { - fn func(context.Context, VirtualMachineRunCommandsListResult) (VirtualMachineRunCommandsListResult, error) - vmrclr VirtualMachineRunCommandsListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *VirtualMachineRunCommandsListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineRunCommandsListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.vmrclr) - if err != nil { - return err - } - page.vmrclr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *VirtualMachineRunCommandsListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page VirtualMachineRunCommandsListResultPage) NotDone() bool { - return !page.vmrclr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page VirtualMachineRunCommandsListResultPage) Response() VirtualMachineRunCommandsListResult { - return page.vmrclr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page VirtualMachineRunCommandsListResultPage) Values() []VirtualMachineRunCommand { - if page.vmrclr.IsEmpty() { - return nil - } - return *page.vmrclr.Value -} - -// Creates a new instance of the VirtualMachineRunCommandsListResultPage type. -func NewVirtualMachineRunCommandsListResultPage(cur VirtualMachineRunCommandsListResult, getNextPage func(context.Context, VirtualMachineRunCommandsListResult) (VirtualMachineRunCommandsListResult, error)) VirtualMachineRunCommandsListResultPage { - return VirtualMachineRunCommandsListResultPage{ - fn: getNextPage, - vmrclr: cur, - } -} - -// VirtualMachineRunCommandsUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineRunCommandsUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineRunCommandsClient) (VirtualMachineRunCommand, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineRunCommandsUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineRunCommandsUpdateFuture.Result. -func (future *VirtualMachineRunCommandsUpdateFuture) result(client VirtualMachineRunCommandsClient) (vmrc VirtualMachineRunCommand, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vmrc.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineRunCommandsUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vmrc.Response.Response, err = future.GetResult(sender); err == nil && vmrc.Response.Response.StatusCode != http.StatusNoContent { - vmrc, err = client.UpdateResponder(vmrc.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsUpdateFuture", "Result", vmrc.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachineRunCommandUpdate describes a Virtual Machine run command. -type VirtualMachineRunCommandUpdate struct { - *VirtualMachineRunCommandProperties `json:"properties,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineRunCommandUpdate. -func (vmrcu VirtualMachineRunCommandUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmrcu.VirtualMachineRunCommandProperties != nil { - objectMap["properties"] = vmrcu.VirtualMachineRunCommandProperties - } - if vmrcu.Tags != nil { - objectMap["tags"] = vmrcu.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualMachineRunCommandUpdate struct. -func (vmrcu *VirtualMachineRunCommandUpdate) 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 virtualMachineRunCommandProperties VirtualMachineRunCommandProperties - err = json.Unmarshal(*v, &virtualMachineRunCommandProperties) - if err != nil { - return err - } - vmrcu.VirtualMachineRunCommandProperties = &virtualMachineRunCommandProperties - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - vmrcu.Tags = tags - } - } - } - - return nil -} - -// VirtualMachinesAssessPatchesFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachinesAssessPatchesFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachinesClient) (VirtualMachineAssessPatchesResult, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachinesAssessPatchesFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachinesAssessPatchesFuture.Result. -func (future *VirtualMachinesAssessPatchesFuture) result(client VirtualMachinesClient) (vmapr VirtualMachineAssessPatchesResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesAssessPatchesFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vmapr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesAssessPatchesFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vmapr.Response.Response, err = future.GetResult(sender); err == nil && vmapr.Response.Response.StatusCode != http.StatusNoContent { - vmapr, err = client.AssessPatchesResponder(vmapr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesAssessPatchesFuture", "Result", vmapr.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachineScaleSet describes a Virtual Machine Scale Set. -type VirtualMachineScaleSet struct { - autorest.Response `json:"-"` - // 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**. - Plan *Plan `json:"plan,omitempty"` - *VirtualMachineScaleSetProperties `json:"properties,omitempty"` - // Identity - The identity of the virtual machine scale set, if configured. - Identity *VirtualMachineScaleSetIdentity `json:"identity,omitempty"` - // Zones - The virtual machine scale set zones. NOTE: Availability zones can only be set when you create the scale set - Zones *[]string `json:"zones,omitempty"` - // ExtendedLocation - The extended location of the Virtual Machine Scale Set. - ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; 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.ExtendedLocation != nil { - objectMap["extendedLocation"] = vmss.ExtendedLocation - } - 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 "extendedLocation": - if v != nil { - var extendedLocation ExtendedLocation - err = json.Unmarshal(*v, &extendedLocation) - if err != nil { - return err - } - vmss.ExtendedLocation = &extendedLocation - } - 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. -type VirtualMachineScaleSetDataDisk struct { - // Name - The disk name. - Name *string `json:"name,omitempty"` - // Lun - Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM. - Lun *int32 `json:"lun,omitempty"` - // Caching - Specifies the caching requirements.

      Possible values are:

      **None**

      **ReadOnly**

      **ReadWrite**

      Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' - Caching CachingTypes `json:"caching,omitempty"` - // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. - WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` - // CreateOption - The create option. Possible values include: 'DiskCreateOptionTypesFromImage', 'DiskCreateOptionTypesEmpty', 'DiskCreateOptionTypesAttach' - CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` - // DiskSizeGB - Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image.

      diskSizeGB is the number of bytes x 1024^3 for the disk and the value cannot be larger than 1023 - DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` - // ManagedDisk - The managed disk parameters. - ManagedDisk *VirtualMachineScaleSetManagedDiskParameters `json:"managedDisk,omitempty"` - // DiskIOPSReadWrite - Specifies the Read-Write IOPS for the managed disk. Should be used only when StorageAccountType is UltraSSD_LRS. If not specified, a default value would be assigned based on diskSizeGB. - DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` - // DiskMBpsReadWrite - Specifies the bandwidth in MB per second for the managed disk. Should be used only when StorageAccountType is UltraSSD_LRS. If not specified, a default value would be assigned based on diskSizeGB. - DiskMBpsReadWrite *int64 `json:"diskMBpsReadWrite,omitempty"` - // DeleteOption - Specifies whether data disk should be deleted or detached upon VMSS Flex deletion (This feature is available for VMSS with Flexible OrchestrationMode only).

      Possible values:

      **Delete** If this value is used, the data disk is deleted when the VMSS Flex VM is deleted.

      **Detach** If this value is used, the data disk is retained after VMSS Flex VM is deleted.

      The default value is set to **Delete**. Possible values include: 'DiskDeleteOptionTypesDelete', 'DiskDeleteOptionTypesDetach' - DeleteOption DiskDeleteOptionTypes `json:"deleteOption,omitempty"` -} - -// VirtualMachineScaleSetExtension describes a Virtual Machine Scale Set Extension. -type VirtualMachineScaleSetExtension struct { - autorest.Response `json:"-"` - // Name - The name of the extension. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - *VirtualMachineScaleSetExtensionProperties `json:"properties,omitempty"` - // ID - READ-ONLY; 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 - } - 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 "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vmsse.Type = &typeVar - } - 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. -type VirtualMachineScaleSetExtensionListResult struct { - autorest.Response `json:"-"` - // Value - The list of VM scale set extensions. - Value *[]VirtualMachineScaleSetExtension `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of VM scale set extensions. Call ListNext() with this to fetch the next page of VM scale set extensions. - NextLink *string `json:"nextLink,omitempty"` -} - -// VirtualMachineScaleSetExtensionListResultIterator provides access to a complete listing of -// VirtualMachineScaleSetExtension values. -type VirtualMachineScaleSetExtensionListResultIterator struct { - i int - page VirtualMachineScaleSetExtensionListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *VirtualMachineScaleSetExtensionListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *VirtualMachineScaleSetExtensionListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter VirtualMachineScaleSetExtensionListResultIterator) 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 VirtualMachineScaleSetExtensionListResultIterator) Response() VirtualMachineScaleSetExtensionListResult { - 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 VirtualMachineScaleSetExtensionListResultIterator) Value() VirtualMachineScaleSetExtension { - if !iter.page.NotDone() { - return VirtualMachineScaleSetExtension{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the VirtualMachineScaleSetExtensionListResultIterator type. -func NewVirtualMachineScaleSetExtensionListResultIterator(page VirtualMachineScaleSetExtensionListResultPage) VirtualMachineScaleSetExtensionListResultIterator { - return VirtualMachineScaleSetExtensionListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (vmsselr VirtualMachineScaleSetExtensionListResult) IsEmpty() bool { - return vmsselr.Value == nil || len(*vmsselr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (vmsselr VirtualMachineScaleSetExtensionListResult) hasNextLink() bool { - return vmsselr.NextLink != nil && len(*vmsselr.NextLink) != 0 -} - -// virtualMachineScaleSetExtensionListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (vmsselr VirtualMachineScaleSetExtensionListResult) virtualMachineScaleSetExtensionListResultPreparer(ctx context.Context) (*http.Request, error) { - if !vmsselr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(vmsselr.NextLink))) -} - -// VirtualMachineScaleSetExtensionListResultPage contains a page of VirtualMachineScaleSetExtension values. -type VirtualMachineScaleSetExtensionListResultPage struct { - fn func(context.Context, VirtualMachineScaleSetExtensionListResult) (VirtualMachineScaleSetExtensionListResult, error) - vmsselr VirtualMachineScaleSetExtensionListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *VirtualMachineScaleSetExtensionListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.vmsselr) - if err != nil { - return err - } - page.vmsselr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *VirtualMachineScaleSetExtensionListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page VirtualMachineScaleSetExtensionListResultPage) NotDone() bool { - return !page.vmsselr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page VirtualMachineScaleSetExtensionListResultPage) Response() VirtualMachineScaleSetExtensionListResult { - return page.vmsselr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page VirtualMachineScaleSetExtensionListResultPage) Values() []VirtualMachineScaleSetExtension { - if page.vmsselr.IsEmpty() { - return nil - } - return *page.vmsselr.Value -} - -// Creates a new instance of the VirtualMachineScaleSetExtensionListResultPage type. -func NewVirtualMachineScaleSetExtensionListResultPage(cur VirtualMachineScaleSetExtensionListResult, getNextPage func(context.Context, VirtualMachineScaleSetExtensionListResult) (VirtualMachineScaleSetExtensionListResult, error)) VirtualMachineScaleSetExtensionListResultPage { - return VirtualMachineScaleSetExtensionListResultPage{ - fn: getNextPage, - vmsselr: cur, - } -} - -// VirtualMachineScaleSetExtensionProfile describes a virtual machine scale set extension profile. -type VirtualMachineScaleSetExtensionProfile struct { - // Extensions - The virtual machine scale set child extension resources. - Extensions *[]VirtualMachineScaleSetExtension `json:"extensions,omitempty"` - // ExtensionsTimeBudget - Specifies the time alloted for all extensions to start. The time duration should be between 15 minutes and 120 minutes (inclusive) and should be specified in ISO 8601 format. The default value is 90 minutes (PT1H30M).

      Minimum api-version: 2020-06-01 - ExtensionsTimeBudget *string `json:"extensionsTimeBudget,omitempty"` -} - -// VirtualMachineScaleSetExtensionProperties describes the properties of a Virtual Machine Scale Set -// Extension. -type VirtualMachineScaleSetExtensionProperties struct { - // ForceUpdateTag - If a value is provided and is different from the previous value, the extension handler will be forced to update even if the extension configuration has not changed. - ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` - // Publisher - The name of the extension handler publisher. - Publisher *string `json:"publisher,omitempty"` - // Type - Specifies the type of the extension; an example is "CustomScriptExtension". - Type *string `json:"type,omitempty"` - // TypeHandlerVersion - Specifies the version of the script handler. - TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` - // 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"` - // EnableAutomaticUpgrade - Indicates whether the extension should be automatically upgraded by the platform if there is a newer version of the extension available. - EnableAutomaticUpgrade *bool `json:"enableAutomaticUpgrade,omitempty"` - // Settings - Json formatted public settings for the extension. - Settings interface{} `json:"settings,omitempty"` - // ProtectedSettings - The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. - ProtectedSettings interface{} `json:"protectedSettings,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *string `json:"provisioningState,omitempty"` - // ProvisionAfterExtensions - Collection of extension names after which this extension needs to be provisioned. - ProvisionAfterExtensions *[]string `json:"provisionAfterExtensions,omitempty"` - // SuppressFailures - Indicates whether failures stemming from the extension will be suppressed (Operational failures such as not connecting to the VM will not be suppressed regardless of this value). The default is false. - SuppressFailures *bool `json:"suppressFailures,omitempty"` - // ProtectedSettingsFromKeyVault - The extensions protected settings that are passed by reference, and consumed from key vault - ProtectedSettingsFromKeyVault *KeyVaultSecretReference `json:"protectedSettingsFromKeyVault,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetExtensionProperties. -func (vmssep VirtualMachineScaleSetExtensionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmssep.ForceUpdateTag != nil { - objectMap["forceUpdateTag"] = vmssep.ForceUpdateTag - } - if vmssep.Publisher != nil { - objectMap["publisher"] = vmssep.Publisher - } - if vmssep.Type != nil { - objectMap["type"] = vmssep.Type - } - if vmssep.TypeHandlerVersion != nil { - objectMap["typeHandlerVersion"] = vmssep.TypeHandlerVersion - } - if vmssep.AutoUpgradeMinorVersion != nil { - objectMap["autoUpgradeMinorVersion"] = vmssep.AutoUpgradeMinorVersion - } - if vmssep.EnableAutomaticUpgrade != nil { - objectMap["enableAutomaticUpgrade"] = vmssep.EnableAutomaticUpgrade - } - if vmssep.Settings != nil { - objectMap["settings"] = vmssep.Settings - } - if vmssep.ProtectedSettings != nil { - objectMap["protectedSettings"] = vmssep.ProtectedSettings - } - if vmssep.ProvisionAfterExtensions != nil { - objectMap["provisionAfterExtensions"] = vmssep.ProvisionAfterExtensions - } - if vmssep.SuppressFailures != nil { - objectMap["suppressFailures"] = vmssep.SuppressFailures - } - if vmssep.ProtectedSettingsFromKeyVault != nil { - objectMap["protectedSettingsFromKeyVault"] = vmssep.ProtectedSettingsFromKeyVault - } - return json.Marshal(objectMap) -} - -// VirtualMachineScaleSetExtensionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type VirtualMachineScaleSetExtensionsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetExtensionsClient) (VirtualMachineScaleSetExtension, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetExtensionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetExtensionsCreateOrUpdateFuture.Result. -func (future *VirtualMachineScaleSetExtensionsCreateOrUpdateFuture) result(client VirtualMachineScaleSetExtensionsClient) (vmsse VirtualMachineScaleSetExtension, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vmsse.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetExtensionsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vmsse.Response.Response, err = future.GetResult(sender); err == nil && vmsse.Response.Response.StatusCode != http.StatusNoContent { - vmsse, err = client.CreateOrUpdateResponder(vmsse.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsCreateOrUpdateFuture", "Result", vmsse.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachineScaleSetExtensionsDeleteFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. -type VirtualMachineScaleSetExtensionsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetExtensionsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetExtensionsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetExtensionsDeleteFuture.Result. -func (future *VirtualMachineScaleSetExtensionsDeleteFuture) result(client VirtualMachineScaleSetExtensionsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetExtensionsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetExtensionsUpdateFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. -type VirtualMachineScaleSetExtensionsUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetExtensionsClient) (VirtualMachineScaleSetExtension, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetExtensionsUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetExtensionsUpdateFuture.Result. -func (future *VirtualMachineScaleSetExtensionsUpdateFuture) result(client VirtualMachineScaleSetExtensionsClient) (vmsse VirtualMachineScaleSetExtension, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vmsse.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetExtensionsUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vmsse.Response.Response, err = future.GetResult(sender); err == nil && vmsse.Response.Response.StatusCode != http.StatusNoContent { - vmsse, err = client.UpdateResponder(vmsse.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsUpdateFuture", "Result", vmsse.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachineScaleSetExtensionUpdate describes a Virtual Machine Scale Set Extension. -type VirtualMachineScaleSetExtensionUpdate struct { - // Name - READ-ONLY; The name of the extension. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - *VirtualMachineScaleSetExtensionProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetExtensionUpdate. -func (vmsseu VirtualMachineScaleSetExtensionUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmsseu.VirtualMachineScaleSetExtensionProperties != nil { - objectMap["properties"] = vmsseu.VirtualMachineScaleSetExtensionProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetExtensionUpdate struct. -func (vmsseu *VirtualMachineScaleSetExtensionUpdate) 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 - } - vmsseu.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vmsseu.Type = &typeVar - } - case "properties": - if v != nil { - var virtualMachineScaleSetExtensionProperties VirtualMachineScaleSetExtensionProperties - err = json.Unmarshal(*v, &virtualMachineScaleSetExtensionProperties) - if err != nil { - return err - } - vmsseu.VirtualMachineScaleSetExtensionProperties = &virtualMachineScaleSetExtensionProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vmsseu.ID = &ID - } - } - } - - return nil -} - -// VirtualMachineScaleSetHardwareProfile specifies the hardware settings for the virtual machine scale set. -type VirtualMachineScaleSetHardwareProfile struct { - // VMSizeProperties - Specifies the properties for customizing the size of the virtual machine. Minimum api-version: 2021-11-01.

      Please follow the instructions in [VM Customization](https://aka.ms/vmcustomization) for more details. - VMSizeProperties *VMSizeProperties `json:"vmSizeProperties,omitempty"` -} - -// VirtualMachineScaleSetIdentity identity for the virtual machine scale set. -type VirtualMachineScaleSetIdentity struct { - // PrincipalID - READ-ONLY; The principal id of virtual machine scale set identity. This property will only be provided for a system assigned identity. - PrincipalID *string `json:"principalId,omitempty"` - // TenantID - READ-ONLY; The tenant id associated with the virtual machine scale set. This property will only be provided for a system assigned identity. - TenantID *string `json:"tenantId,omitempty"` - // Type - The type of identity used for the virtual machine scale set. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the virtual machine scale set. Possible values include: 'ResourceIdentityTypeSystemAssigned', 'ResourceIdentityTypeUserAssigned', 'ResourceIdentityTypeSystemAssignedUserAssigned', 'ResourceIdentityTypeNone' - Type ResourceIdentityType `json:"type,omitempty"` - // UserAssignedIdentities - The list of user identities associated with the virtual machine scale set. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - UserAssignedIdentities map[string]*UserAssignedIdentitiesValue `json:"userAssignedIdentities"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetIdentity. -func (vmssi VirtualMachineScaleSetIdentity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmssi.Type != "" { - objectMap["type"] = vmssi.Type - } - if vmssi.UserAssignedIdentities != nil { - objectMap["userAssignedIdentities"] = vmssi.UserAssignedIdentities - } - return json.Marshal(objectMap) -} - -// VirtualMachineScaleSetInstanceView the instance view of a virtual machine scale set. -type VirtualMachineScaleSetInstanceView struct { - autorest.Response `json:"-"` - // VirtualMachine - READ-ONLY; The instance view status summary for the virtual machine scale set. - VirtualMachine *VirtualMachineScaleSetInstanceViewStatusesSummary `json:"virtualMachine,omitempty"` - // Extensions - READ-ONLY; The extensions information. - Extensions *[]VirtualMachineScaleSetVMExtensionsSummary `json:"extensions,omitempty"` - // Statuses - The resource status information. - Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` - // OrchestrationServices - READ-ONLY; The orchestration services information. - OrchestrationServices *[]OrchestrationServiceSummary `json:"orchestrationServices,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetInstanceView. -func (vmssiv VirtualMachineScaleSetInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmssiv.Statuses != nil { - objectMap["statuses"] = vmssiv.Statuses - } - return json.Marshal(objectMap) -} - -// VirtualMachineScaleSetInstanceViewStatusesSummary instance view statuses summary for virtual machines of -// a virtual machine scale set. -type VirtualMachineScaleSetInstanceViewStatusesSummary struct { - // StatusesSummary - READ-ONLY; The extensions information. - StatusesSummary *[]VirtualMachineStatusCodeCount `json:"statusesSummary,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetInstanceViewStatusesSummary. -func (vmssivss VirtualMachineScaleSetInstanceViewStatusesSummary) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// VirtualMachineScaleSetIPConfiguration describes a virtual machine scale set network profile's IP -// configuration. -type VirtualMachineScaleSetIPConfiguration struct { - // 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 configuration properties. -type VirtualMachineScaleSetIPConfigurationProperties struct { - // Subnet - Specifies the identifier of the subnet. - Subnet *APIEntityReference `json:"subnet,omitempty"` - // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface. - Primary *bool `json:"primary,omitempty"` - // PublicIPAddressConfiguration - The publicIPAddressConfiguration. - PublicIPAddressConfiguration *VirtualMachineScaleSetPublicIPAddressConfiguration `json:"publicIPAddressConfiguration,omitempty"` - // PrivateIPAddressVersion - Available from Api-Version 2017-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6' - PrivateIPAddressVersion IPVersion `json:"privateIPAddressVersion,omitempty"` - // ApplicationGatewayBackendAddressPools - Specifies an array of references to backend address pools of application gateways. A scale set can reference backend address pools of multiple application gateways. Multiple scale sets cannot use the same application gateway. - ApplicationGatewayBackendAddressPools *[]SubResource `json:"applicationGatewayBackendAddressPools,omitempty"` - // ApplicationSecurityGroups - Specifies an array of references to application security group. - ApplicationSecurityGroups *[]SubResource `json:"applicationSecurityGroups,omitempty"` - // LoadBalancerBackendAddressPools - Specifies an array of references to backend address pools of load balancers. A scale set can reference backend address pools of one public and one internal load balancer. Multiple scale sets cannot use the same basic sku load balancer. - LoadBalancerBackendAddressPools *[]SubResource `json:"loadBalancerBackendAddressPools,omitempty"` - // LoadBalancerInboundNatPools - Specifies an array of references to inbound Nat pools of the load balancers. A scale set can reference inbound nat pools of one public and one internal load balancer. Multiple scale sets cannot use the same basic sku load balancer. - LoadBalancerInboundNatPools *[]SubResource `json:"loadBalancerInboundNatPools,omitempty"` -} - -// VirtualMachineScaleSetIPTag contains the IP tag associated with the public IP address. -type VirtualMachineScaleSetIPTag struct { - // IPTagType - IP tag type. Example: FirstPartyUsage. - IPTagType *string `json:"ipTagType,omitempty"` - // Tag - IP tag associated with the public IP. Example: SQL, Storage etc. - Tag *string `json:"tag,omitempty"` -} - -// VirtualMachineScaleSetListOSUpgradeHistory list of Virtual Machine Scale Set OS Upgrade History -// operation response. -type VirtualMachineScaleSetListOSUpgradeHistory struct { - autorest.Response `json:"-"` - // Value - The list of OS upgrades performed on the virtual machine scale set. - Value *[]UpgradeOperationHistoricalStatusInfo `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of OS Upgrade History. Call ListNext() with this to fetch the next page of history of upgrades. - NextLink *string `json:"nextLink,omitempty"` -} - -// VirtualMachineScaleSetListOSUpgradeHistoryIterator provides access to a complete listing of -// UpgradeOperationHistoricalStatusInfo values. -type VirtualMachineScaleSetListOSUpgradeHistoryIterator struct { - i int - page VirtualMachineScaleSetListOSUpgradeHistoryPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *VirtualMachineScaleSetListOSUpgradeHistoryIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListOSUpgradeHistoryIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *VirtualMachineScaleSetListOSUpgradeHistoryIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter VirtualMachineScaleSetListOSUpgradeHistoryIterator) 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 VirtualMachineScaleSetListOSUpgradeHistoryIterator) Response() VirtualMachineScaleSetListOSUpgradeHistory { - 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 VirtualMachineScaleSetListOSUpgradeHistoryIterator) Value() UpgradeOperationHistoricalStatusInfo { - if !iter.page.NotDone() { - return UpgradeOperationHistoricalStatusInfo{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the VirtualMachineScaleSetListOSUpgradeHistoryIterator type. -func NewVirtualMachineScaleSetListOSUpgradeHistoryIterator(page VirtualMachineScaleSetListOSUpgradeHistoryPage) VirtualMachineScaleSetListOSUpgradeHistoryIterator { - return VirtualMachineScaleSetListOSUpgradeHistoryIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (vmsslouh VirtualMachineScaleSetListOSUpgradeHistory) IsEmpty() bool { - return vmsslouh.Value == nil || len(*vmsslouh.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (vmsslouh VirtualMachineScaleSetListOSUpgradeHistory) hasNextLink() bool { - return vmsslouh.NextLink != nil && len(*vmsslouh.NextLink) != 0 -} - -// virtualMachineScaleSetListOSUpgradeHistoryPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (vmsslouh VirtualMachineScaleSetListOSUpgradeHistory) virtualMachineScaleSetListOSUpgradeHistoryPreparer(ctx context.Context) (*http.Request, error) { - if !vmsslouh.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(vmsslouh.NextLink))) -} - -// VirtualMachineScaleSetListOSUpgradeHistoryPage contains a page of UpgradeOperationHistoricalStatusInfo -// values. -type VirtualMachineScaleSetListOSUpgradeHistoryPage struct { - fn func(context.Context, VirtualMachineScaleSetListOSUpgradeHistory) (VirtualMachineScaleSetListOSUpgradeHistory, error) - vmsslouh VirtualMachineScaleSetListOSUpgradeHistory -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *VirtualMachineScaleSetListOSUpgradeHistoryPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListOSUpgradeHistoryPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.vmsslouh) - if err != nil { - return err - } - page.vmsslouh = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *VirtualMachineScaleSetListOSUpgradeHistoryPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page VirtualMachineScaleSetListOSUpgradeHistoryPage) NotDone() bool { - return !page.vmsslouh.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page VirtualMachineScaleSetListOSUpgradeHistoryPage) Response() VirtualMachineScaleSetListOSUpgradeHistory { - return page.vmsslouh -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page VirtualMachineScaleSetListOSUpgradeHistoryPage) Values() []UpgradeOperationHistoricalStatusInfo { - if page.vmsslouh.IsEmpty() { - return nil - } - return *page.vmsslouh.Value -} - -// Creates a new instance of the VirtualMachineScaleSetListOSUpgradeHistoryPage type. -func NewVirtualMachineScaleSetListOSUpgradeHistoryPage(cur VirtualMachineScaleSetListOSUpgradeHistory, getNextPage func(context.Context, VirtualMachineScaleSetListOSUpgradeHistory) (VirtualMachineScaleSetListOSUpgradeHistory, error)) VirtualMachineScaleSetListOSUpgradeHistoryPage { - return VirtualMachineScaleSetListOSUpgradeHistoryPage{ - fn: getNextPage, - vmsslouh: cur, - } -} - -// VirtualMachineScaleSetListResult the List Virtual Machine operation response. -type VirtualMachineScaleSetListResult struct { - autorest.Response `json:"-"` - // Value - The list of virtual machine scale sets. - Value *[]VirtualMachineScaleSet `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of Virtual Machine Scale Sets. Call ListNext() with this to fetch the next page of VMSS. - NextLink *string `json:"nextLink,omitempty"` -} - -// VirtualMachineScaleSetListResultIterator provides access to a complete listing of VirtualMachineScaleSet -// values. -type VirtualMachineScaleSetListResultIterator struct { - i int - page VirtualMachineScaleSetListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *VirtualMachineScaleSetListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *VirtualMachineScaleSetListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter VirtualMachineScaleSetListResultIterator) 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 VirtualMachineScaleSetListResultIterator) Response() VirtualMachineScaleSetListResult { - 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 VirtualMachineScaleSetListResultIterator) Value() VirtualMachineScaleSet { - if !iter.page.NotDone() { - return VirtualMachineScaleSet{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the VirtualMachineScaleSetListResultIterator type. -func NewVirtualMachineScaleSetListResultIterator(page VirtualMachineScaleSetListResultPage) VirtualMachineScaleSetListResultIterator { - return VirtualMachineScaleSetListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (vmsslr VirtualMachineScaleSetListResult) IsEmpty() bool { - return vmsslr.Value == nil || len(*vmsslr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (vmsslr VirtualMachineScaleSetListResult) hasNextLink() bool { - return vmsslr.NextLink != nil && len(*vmsslr.NextLink) != 0 -} - -// virtualMachineScaleSetListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (vmsslr VirtualMachineScaleSetListResult) virtualMachineScaleSetListResultPreparer(ctx context.Context) (*http.Request, error) { - if !vmsslr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(vmsslr.NextLink))) -} - -// VirtualMachineScaleSetListResultPage contains a page of VirtualMachineScaleSet values. -type VirtualMachineScaleSetListResultPage struct { - fn func(context.Context, VirtualMachineScaleSetListResult) (VirtualMachineScaleSetListResult, error) - vmsslr VirtualMachineScaleSetListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *VirtualMachineScaleSetListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.vmsslr) - if err != nil { - return err - } - page.vmsslr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *VirtualMachineScaleSetListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page VirtualMachineScaleSetListResultPage) NotDone() bool { - return !page.vmsslr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page VirtualMachineScaleSetListResultPage) Response() VirtualMachineScaleSetListResult { - return page.vmsslr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page VirtualMachineScaleSetListResultPage) Values() []VirtualMachineScaleSet { - if page.vmsslr.IsEmpty() { - return nil - } - return *page.vmsslr.Value -} - -// Creates a new instance of the VirtualMachineScaleSetListResultPage type. -func NewVirtualMachineScaleSetListResultPage(cur VirtualMachineScaleSetListResult, getNextPage func(context.Context, VirtualMachineScaleSetListResult) (VirtualMachineScaleSetListResult, error)) VirtualMachineScaleSetListResultPage { - return VirtualMachineScaleSetListResultPage{ - fn: getNextPage, - vmsslr: cur, - } -} - -// VirtualMachineScaleSetListSkusResult the Virtual Machine Scale Set List Skus operation response. -type VirtualMachineScaleSetListSkusResult struct { - autorest.Response `json:"-"` - // Value - The list of skus available for the virtual machine scale set. - Value *[]VirtualMachineScaleSetSku `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of Virtual Machine Scale Set Skus. Call ListNext() with this to fetch the next page of VMSS Skus. - NextLink *string `json:"nextLink,omitempty"` -} - -// VirtualMachineScaleSetListSkusResultIterator provides access to a complete listing of -// VirtualMachineScaleSetSku values. -type VirtualMachineScaleSetListSkusResultIterator struct { - i int - page VirtualMachineScaleSetListSkusResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *VirtualMachineScaleSetListSkusResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListSkusResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *VirtualMachineScaleSetListSkusResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter VirtualMachineScaleSetListSkusResultIterator) 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 VirtualMachineScaleSetListSkusResultIterator) Response() VirtualMachineScaleSetListSkusResult { - 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 VirtualMachineScaleSetListSkusResultIterator) Value() VirtualMachineScaleSetSku { - if !iter.page.NotDone() { - return VirtualMachineScaleSetSku{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the VirtualMachineScaleSetListSkusResultIterator type. -func NewVirtualMachineScaleSetListSkusResultIterator(page VirtualMachineScaleSetListSkusResultPage) VirtualMachineScaleSetListSkusResultIterator { - return VirtualMachineScaleSetListSkusResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (vmsslsr VirtualMachineScaleSetListSkusResult) IsEmpty() bool { - return vmsslsr.Value == nil || len(*vmsslsr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (vmsslsr VirtualMachineScaleSetListSkusResult) hasNextLink() bool { - return vmsslsr.NextLink != nil && len(*vmsslsr.NextLink) != 0 -} - -// virtualMachineScaleSetListSkusResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (vmsslsr VirtualMachineScaleSetListSkusResult) virtualMachineScaleSetListSkusResultPreparer(ctx context.Context) (*http.Request, error) { - if !vmsslsr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(vmsslsr.NextLink))) -} - -// VirtualMachineScaleSetListSkusResultPage contains a page of VirtualMachineScaleSetSku values. -type VirtualMachineScaleSetListSkusResultPage struct { - fn func(context.Context, VirtualMachineScaleSetListSkusResult) (VirtualMachineScaleSetListSkusResult, error) - vmsslsr VirtualMachineScaleSetListSkusResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *VirtualMachineScaleSetListSkusResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListSkusResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.vmsslsr) - if err != nil { - return err - } - page.vmsslsr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *VirtualMachineScaleSetListSkusResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page VirtualMachineScaleSetListSkusResultPage) NotDone() bool { - return !page.vmsslsr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page VirtualMachineScaleSetListSkusResultPage) Response() VirtualMachineScaleSetListSkusResult { - return page.vmsslsr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page VirtualMachineScaleSetListSkusResultPage) Values() []VirtualMachineScaleSetSku { - if page.vmsslsr.IsEmpty() { - return nil - } - return *page.vmsslsr.Value -} - -// Creates a new instance of the VirtualMachineScaleSetListSkusResultPage type. -func NewVirtualMachineScaleSetListSkusResultPage(cur VirtualMachineScaleSetListSkusResult, getNextPage func(context.Context, VirtualMachineScaleSetListSkusResult) (VirtualMachineScaleSetListSkusResult, error)) VirtualMachineScaleSetListSkusResultPage { - return VirtualMachineScaleSetListSkusResultPage{ - fn: getNextPage, - vmsslsr: cur, - } -} - -// VirtualMachineScaleSetListWithLinkResult the List Virtual Machine operation response. -type VirtualMachineScaleSetListWithLinkResult struct { - autorest.Response `json:"-"` - // Value - The list of virtual machine scale sets. - Value *[]VirtualMachineScaleSet `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of Virtual Machine Scale Sets. Call ListNext() with this to fetch the next page of Virtual Machine Scale Sets. - NextLink *string `json:"nextLink,omitempty"` -} - -// VirtualMachineScaleSetListWithLinkResultIterator provides access to a complete listing of -// VirtualMachineScaleSet values. -type VirtualMachineScaleSetListWithLinkResultIterator struct { - i int - page VirtualMachineScaleSetListWithLinkResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *VirtualMachineScaleSetListWithLinkResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListWithLinkResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *VirtualMachineScaleSetListWithLinkResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter VirtualMachineScaleSetListWithLinkResultIterator) 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 VirtualMachineScaleSetListWithLinkResultIterator) Response() VirtualMachineScaleSetListWithLinkResult { - 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 VirtualMachineScaleSetListWithLinkResultIterator) Value() VirtualMachineScaleSet { - if !iter.page.NotDone() { - return VirtualMachineScaleSet{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the VirtualMachineScaleSetListWithLinkResultIterator type. -func NewVirtualMachineScaleSetListWithLinkResultIterator(page VirtualMachineScaleSetListWithLinkResultPage) VirtualMachineScaleSetListWithLinkResultIterator { - return VirtualMachineScaleSetListWithLinkResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (vmsslwlr VirtualMachineScaleSetListWithLinkResult) IsEmpty() bool { - return vmsslwlr.Value == nil || len(*vmsslwlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (vmsslwlr VirtualMachineScaleSetListWithLinkResult) hasNextLink() bool { - return vmsslwlr.NextLink != nil && len(*vmsslwlr.NextLink) != 0 -} - -// virtualMachineScaleSetListWithLinkResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (vmsslwlr VirtualMachineScaleSetListWithLinkResult) virtualMachineScaleSetListWithLinkResultPreparer(ctx context.Context) (*http.Request, error) { - if !vmsslwlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(vmsslwlr.NextLink))) -} - -// VirtualMachineScaleSetListWithLinkResultPage contains a page of VirtualMachineScaleSet values. -type VirtualMachineScaleSetListWithLinkResultPage struct { - fn func(context.Context, VirtualMachineScaleSetListWithLinkResult) (VirtualMachineScaleSetListWithLinkResult, error) - vmsslwlr VirtualMachineScaleSetListWithLinkResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *VirtualMachineScaleSetListWithLinkResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListWithLinkResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.vmsslwlr) - if err != nil { - return err - } - page.vmsslwlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *VirtualMachineScaleSetListWithLinkResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page VirtualMachineScaleSetListWithLinkResultPage) NotDone() bool { - return !page.vmsslwlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page VirtualMachineScaleSetListWithLinkResultPage) Response() VirtualMachineScaleSetListWithLinkResult { - return page.vmsslwlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page VirtualMachineScaleSetListWithLinkResultPage) Values() []VirtualMachineScaleSet { - if page.vmsslwlr.IsEmpty() { - return nil - } - return *page.vmsslwlr.Value -} - -// Creates a new instance of the VirtualMachineScaleSetListWithLinkResultPage type. -func NewVirtualMachineScaleSetListWithLinkResultPage(cur VirtualMachineScaleSetListWithLinkResult, getNextPage func(context.Context, VirtualMachineScaleSetListWithLinkResult) (VirtualMachineScaleSetListWithLinkResult, error)) VirtualMachineScaleSetListWithLinkResultPage { - return VirtualMachineScaleSetListWithLinkResultPage{ - fn: getNextPage, - vmsslwlr: cur, - } -} - -// VirtualMachineScaleSetManagedDiskParameters describes the parameters of a ScaleSet managed disk. -type VirtualMachineScaleSetManagedDiskParameters struct { - // StorageAccountType - Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot be used with OS Disk. Possible values include: 'StorageAccountTypesStandardLRS', 'StorageAccountTypesPremiumLRS', 'StorageAccountTypesStandardSSDLRS', 'StorageAccountTypesUltraSSDLRS', 'StorageAccountTypesPremiumZRS', 'StorageAccountTypesStandardSSDZRS', 'StorageAccountTypesPremiumV2LRS' - StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` - // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed disk. - DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` - // SecurityProfile - Specifies the security profile for the managed disk. - SecurityProfile *VMDiskSecurityProfile `json:"securityProfile,omitempty"` -} - -// VirtualMachineScaleSetNetworkConfiguration describes a virtual machine scale set network profile's -// network configurations. -type VirtualMachineScaleSetNetworkConfiguration struct { - // 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 -// configuration's DNS settings. -type VirtualMachineScaleSetNetworkConfigurationDNSSettings struct { - // DNSServers - List of DNS servers IP addresses - DNSServers *[]string `json:"dnsServers,omitempty"` -} - -// VirtualMachineScaleSetNetworkConfigurationProperties describes a virtual machine scale set network -// profile's IP configuration. -type VirtualMachineScaleSetNetworkConfigurationProperties struct { - // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface. - Primary *bool `json:"primary,omitempty"` - // EnableAcceleratedNetworking - Specifies whether the network interface is accelerated networking-enabled. - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - // DisableTCPStateTracking - Specifies whether the network interface is disabled for tcp state tracking. - DisableTCPStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - // EnableFpga - Specifies whether the network interface is FPGA networking-enabled. - EnableFpga *bool `json:"enableFpga,omitempty"` - // NetworkSecurityGroup - The network security group. - NetworkSecurityGroup *SubResource `json:"networkSecurityGroup,omitempty"` - // DNSSettings - The dns settings to be applied on the network interfaces. - DNSSettings *VirtualMachineScaleSetNetworkConfigurationDNSSettings `json:"dnsSettings,omitempty"` - // IPConfigurations - Specifies the IP configurations of the network interface. - IPConfigurations *[]VirtualMachineScaleSetIPConfiguration `json:"ipConfigurations,omitempty"` - // EnableIPForwarding - Whether IP forwarding enabled on this NIC. - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - // DeleteOption - Specify what happens to the network interface when the VM is deleted. Possible values include: 'Delete', 'Detach' - DeleteOption DeleteOptions `json:"deleteOption,omitempty"` -} - -// VirtualMachineScaleSetNetworkProfile describes a virtual machine scale set network profile. -type VirtualMachineScaleSetNetworkProfile struct { - // HealthProbe - A reference to a load balancer probe used to determine the health of an instance in the virtual machine scale set. The reference will be in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. - HealthProbe *APIEntityReference `json:"healthProbe,omitempty"` - // NetworkInterfaceConfigurations - The list of network configurations. - NetworkInterfaceConfigurations *[]VirtualMachineScaleSetNetworkConfiguration `json:"networkInterfaceConfigurations,omitempty"` - // NetworkAPIVersion - specifies the Microsoft.Network API version used when creating networking resources in the Network Interface Configurations for Virtual Machine Scale Set with orchestration mode 'Flexible'. Possible values include: 'TwoZeroTwoZeroHyphenMinusOneOneHyphenMinusZeroOne' - NetworkAPIVersion NetworkAPIVersion `json:"networkApiVersion,omitempty"` -} - -// VirtualMachineScaleSetOSDisk describes a virtual machine scale set operating system disk. -type VirtualMachineScaleSetOSDisk struct { - // Name - The disk name. - Name *string `json:"name,omitempty"` - // Caching - Specifies the caching requirements.

      Possible values are:

      **None**

      **ReadOnly**

      **ReadWrite**

      Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' - Caching CachingTypes `json:"caching,omitempty"` - // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. - WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` - // CreateOption - Specifies how the virtual machines in the scale set should be created.

      The only allowed value is: **FromImage** \u2013 This value is used when you are using an image to create the virtual machine. If you are using a platform image, you also use the imageReference element described above. If you are using a marketplace image, you also use the plan element previously described. Possible values include: 'DiskCreateOptionTypesFromImage', 'DiskCreateOptionTypesEmpty', 'DiskCreateOptionTypesAttach' - CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` - // DiffDiskSettings - Specifies the ephemeral disk Settings for the operating system disk used by the virtual machine scale set. - DiffDiskSettings *DiffDiskSettings `json:"diffDiskSettings,omitempty"` - // DiskSizeGB - Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image.

      diskSizeGB is the number of bytes x 1024^3 for the disk and the value cannot be larger than 1023 - DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` - // OsType - This property allows you to specify the type of the OS that is included in the disk if creating a VM from user-image or a specialized VHD.

      Possible values are:

      **Windows**

      **Linux**. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' - OsType OperatingSystemTypes `json:"osType,omitempty"` - // Image - Specifies information about the unmanaged user image to base the scale set on. - Image *VirtualHardDisk `json:"image,omitempty"` - // VhdContainers - Specifies the container urls that are used to store operating system disks for the scale set. - VhdContainers *[]string `json:"vhdContainers,omitempty"` - // ManagedDisk - The managed disk parameters. - ManagedDisk *VirtualMachineScaleSetManagedDiskParameters `json:"managedDisk,omitempty"` - // DeleteOption - Specifies whether OS Disk should be deleted or detached upon VMSS Flex deletion (This feature is available for VMSS with Flexible OrchestrationMode only).

      Possible values:

      **Delete** If this value is used, the OS disk is deleted when VMSS Flex VM is deleted.

      **Detach** If this value is used, the OS disk is retained after VMSS Flex VM is deleted.

      The default value is set to **Delete**. For an Ephemeral OS Disk, the default value is set to **Delete**. User cannot change the delete option for Ephemeral OS Disk. Possible values include: 'DiskDeleteOptionTypesDelete', 'DiskDeleteOptionTypesDetach' - DeleteOption DiskDeleteOptionTypes `json:"deleteOption,omitempty"` -} - -// VirtualMachineScaleSetOSProfile describes a virtual machine scale set OS profile. -type VirtualMachineScaleSetOSProfile struct { - // ComputerNamePrefix - Specifies the computer name prefix for all of the virtual machines in the scale set. Computer name prefixes must be 1 to 15 characters long. - ComputerNamePrefix *string `json:"computerNamePrefix,omitempty"` - // AdminUsername - Specifies the name of the administrator account.

      **Windows-only restriction:** Cannot end in "."

      **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5".

      **Minimum-length (Linux):** 1 character

      **Max-length (Linux):** 64 characters

      **Max-length (Windows):** 20 characters - AdminUsername *string `json:"adminUsername,omitempty"` - // AdminPassword - Specifies the password of the administrator account.

      **Minimum-length (Windows):** 8 characters

      **Minimum-length (Linux):** 6 characters

      **Max-length (Windows):** 123 characters

      **Max-length (Linux):** 72 characters

      **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled
      Has lower characters
      Has upper characters
      Has a digit
      Has a special character (Regex match [\W_])

      **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!"

      For resetting the password, see [How to reset the Remote Desktop service or its login password in a Windows VM](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/reset-rdp)

      For resetting root password, see [Manage users, SSH, and check or repair disks on Azure Linux VMs using the VMAccess Extension](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection) - AdminPassword *string `json:"adminPassword,omitempty"` - // CustomData - Specifies a base-64 encoded string of custom data. The base-64 encoded string is decoded to a binary array that is saved as a file on the Virtual Machine. The maximum length of the binary array is 65535 bytes.

      For using cloud-init for your VM, see [Using cloud-init to customize a Linux VM during creation](https://docs.microsoft.com/azure/virtual-machines/linux/using-cloud-init) - CustomData *string `json:"customData,omitempty"` - // WindowsConfiguration - Specifies Windows operating system settings on the virtual machine. - WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"` - // LinuxConfiguration - Specifies the Linux operating system settings on the virtual machine.

      For a list of supported Linux distributions, see [Linux on Azure-Endorsed Distributions](https://docs.microsoft.com/azure/virtual-machines/linux/endorsed-distros). - LinuxConfiguration *LinuxConfiguration `json:"linuxConfiguration,omitempty"` - // Secrets - Specifies set of certificates that should be installed onto the virtual machines in the scale set. To install certificates on a virtual machine it is recommended to use the [Azure Key Vault virtual machine extension for Linux](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux) or the [Azure Key Vault virtual machine extension for Windows](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows). - Secrets *[]VaultSecretGroup `json:"secrets,omitempty"` - // AllowExtensionOperations - Specifies whether extension operations should be allowed on the virtual machine scale set.

      This may only be set to False when no extensions are present on the virtual machine scale set. - AllowExtensionOperations *bool `json:"allowExtensionOperations,omitempty"` -} - -// VirtualMachineScaleSetProperties describes the properties of a Virtual Machine Scale Set. -type VirtualMachineScaleSetProperties struct { - // UpgradePolicy - The upgrade policy. - UpgradePolicy *UpgradePolicy `json:"upgradePolicy,omitempty"` - // AutomaticRepairsPolicy - Policy for automatic repairs. - AutomaticRepairsPolicy *AutomaticRepairsPolicy `json:"automaticRepairsPolicy,omitempty"` - // VirtualMachineProfile - The virtual machine profile. - VirtualMachineProfile *VirtualMachineScaleSetVMProfile `json:"virtualMachineProfile,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *string `json:"provisioningState,omitempty"` - // Overprovision - Specifies whether the Virtual Machine Scale Set should be overprovisioned. - Overprovision *bool `json:"overprovision,omitempty"` - // DoNotRunExtensionsOnOverprovisionedVMs - When Overprovision is enabled, extensions are launched only on the requested number of VMs which are finally kept. This property will hence ensure that the extensions do not run on the extra overprovisioned VMs. - DoNotRunExtensionsOnOverprovisionedVMs *bool `json:"doNotRunExtensionsOnOverprovisionedVMs,omitempty"` - // UniqueID - READ-ONLY; Specifies the ID which uniquely identifies a Virtual Machine Scale Set. - UniqueID *string `json:"uniqueId,omitempty"` - // SinglePlacementGroup - When true this limits the scale set to a single placement group, of max size 100 virtual machines. NOTE: If singlePlacementGroup is true, it may be modified to false. However, if singlePlacementGroup is false, it may not be modified to true. - SinglePlacementGroup *bool `json:"singlePlacementGroup,omitempty"` - // ZoneBalance - Whether to force strictly even Virtual Machine distribution cross x-zones in case there is zone outage. zoneBalance property can only be set if the zones property of the scale set contains more than one zone. If there are no zones or only one zone specified, then zoneBalance property should not be set. - ZoneBalance *bool `json:"zoneBalance,omitempty"` - // PlatformFaultDomainCount - Fault Domain count for each placement group. - PlatformFaultDomainCount *int32 `json:"platformFaultDomainCount,omitempty"` - // ProximityPlacementGroup - Specifies information about the proximity placement group that the virtual machine scale set should be assigned to.

      Minimum api-version: 2018-04-01. - ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` - // HostGroup - Specifies information about the dedicated host group that the virtual machine scale set resides in.

      Minimum api-version: 2020-06-01. - HostGroup *SubResource `json:"hostGroup,omitempty"` - // AdditionalCapabilities - Specifies additional capabilities enabled or disabled on the Virtual Machines in the Virtual Machine Scale Set. For instance: whether the Virtual Machines have the capability to support attaching managed data disks with UltraSSD_LRS storage account type. - AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` - // ScaleInPolicy - Specifies the policies applied when scaling in Virtual Machines in the Virtual Machine Scale Set. - ScaleInPolicy *ScaleInPolicy `json:"scaleInPolicy,omitempty"` - // OrchestrationMode - Specifies the orchestration mode for the virtual machine scale set. Possible values include: 'Uniform', 'Flexible' - OrchestrationMode OrchestrationMode `json:"orchestrationMode,omitempty"` - // SpotRestorePolicy - Specifies the Spot Restore properties for the virtual machine scale set. - SpotRestorePolicy *SpotRestorePolicy `json:"spotRestorePolicy,omitempty"` - // PriorityMixPolicy - Specifies the desired targets for mixing Spot and Regular priority VMs within the same VMSS Flex instance. - PriorityMixPolicy *PriorityMixPolicy `json:"priorityMixPolicy,omitempty"` - // TimeCreated - READ-ONLY; Specifies the time at which the Virtual Machine Scale Set resource was created.

      Minimum api-version: 2021-11-01. - TimeCreated *date.Time `json:"timeCreated,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetProperties. -func (vmssp VirtualMachineScaleSetProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmssp.UpgradePolicy != nil { - objectMap["upgradePolicy"] = vmssp.UpgradePolicy - } - if vmssp.AutomaticRepairsPolicy != nil { - objectMap["automaticRepairsPolicy"] = vmssp.AutomaticRepairsPolicy - } - if vmssp.VirtualMachineProfile != nil { - objectMap["virtualMachineProfile"] = vmssp.VirtualMachineProfile - } - if vmssp.Overprovision != nil { - objectMap["overprovision"] = vmssp.Overprovision - } - if vmssp.DoNotRunExtensionsOnOverprovisionedVMs != nil { - objectMap["doNotRunExtensionsOnOverprovisionedVMs"] = vmssp.DoNotRunExtensionsOnOverprovisionedVMs - } - if vmssp.SinglePlacementGroup != nil { - objectMap["singlePlacementGroup"] = vmssp.SinglePlacementGroup - } - if vmssp.ZoneBalance != nil { - objectMap["zoneBalance"] = vmssp.ZoneBalance - } - if vmssp.PlatformFaultDomainCount != nil { - objectMap["platformFaultDomainCount"] = vmssp.PlatformFaultDomainCount - } - if vmssp.ProximityPlacementGroup != nil { - objectMap["proximityPlacementGroup"] = vmssp.ProximityPlacementGroup - } - if vmssp.HostGroup != nil { - objectMap["hostGroup"] = vmssp.HostGroup - } - if vmssp.AdditionalCapabilities != nil { - objectMap["additionalCapabilities"] = vmssp.AdditionalCapabilities - } - if vmssp.ScaleInPolicy != nil { - objectMap["scaleInPolicy"] = vmssp.ScaleInPolicy - } - if vmssp.OrchestrationMode != "" { - objectMap["orchestrationMode"] = vmssp.OrchestrationMode - } - if vmssp.SpotRestorePolicy != nil { - objectMap["spotRestorePolicy"] = vmssp.SpotRestorePolicy - } - if vmssp.PriorityMixPolicy != nil { - objectMap["priorityMixPolicy"] = vmssp.PriorityMixPolicy - } - return json.Marshal(objectMap) -} - -// VirtualMachineScaleSetPublicIPAddressConfiguration describes a virtual machines scale set IP -// Configuration's PublicIPAddress configuration -type VirtualMachineScaleSetPublicIPAddressConfiguration struct { - // Name - The publicIP address configuration name. - Name *string `json:"name,omitempty"` - *VirtualMachineScaleSetPublicIPAddressConfigurationProperties `json:"properties,omitempty"` - Sku *PublicIPAddressSku `json:"sku,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 - } - if vmsspiac.Sku != nil { - objectMap["sku"] = vmsspiac.Sku - } - 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 - } - case "sku": - if v != nil { - var sku PublicIPAddressSku - err = json.Unmarshal(*v, &sku) - if err != nil { - return err - } - vmsspiac.Sku = &sku - } - } - } - - return nil -} - -// VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings describes a virtual machines scale sets -// network configuration's DNS settings. -type VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings struct { - // DomainNameLabel - The Domain name label.The concatenation of the domain name label and vm index will be the domain name labels of the PublicIPAddress resources that will be created - DomainNameLabel *string `json:"domainNameLabel,omitempty"` -} - -// VirtualMachineScaleSetPublicIPAddressConfigurationProperties describes a virtual machines scale set IP -// Configuration's PublicIPAddress configuration -type VirtualMachineScaleSetPublicIPAddressConfigurationProperties struct { - // IdleTimeoutInMinutes - The idle timeout of the public IP address. - IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` - // DNSSettings - The dns settings to be applied on the publicIP addresses . - DNSSettings *VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings `json:"dnsSettings,omitempty"` - // IPTags - The list of IP tags associated with the public IP address. - IPTags *[]VirtualMachineScaleSetIPTag `json:"ipTags,omitempty"` - // PublicIPPrefix - The PublicIPPrefix from which to allocate publicIP addresses. - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - // PublicIPAddressVersion - Available from Api-Version 2019-07-01 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6' - PublicIPAddressVersion IPVersion `json:"publicIPAddressVersion,omitempty"` - // DeleteOption - Specify what happens to the public IP when the VM is deleted. Possible values include: 'Delete', 'Detach' - DeleteOption DeleteOptions `json:"deleteOption,omitempty"` -} - -// VirtualMachineScaleSetReimageParameters describes a Virtual Machine Scale Set VM Reimage Parameters. -type VirtualMachineScaleSetReimageParameters struct { - // InstanceIds - The virtual machine scale set instance ids. Omitting the virtual machine scale set instance ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - InstanceIds *[]string `json:"instanceIds,omitempty"` - // TempDisk - Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage parameter is only supported for VM/VMSS with Ephemeral OS disk. - TempDisk *bool `json:"tempDisk,omitempty"` -} - -// VirtualMachineScaleSetRollingUpgradesCancelFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type VirtualMachineScaleSetRollingUpgradesCancelFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetRollingUpgradesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetRollingUpgradesCancelFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetRollingUpgradesCancelFuture.Result. -func (future *VirtualMachineScaleSetRollingUpgradesCancelFuture) result(client VirtualMachineScaleSetRollingUpgradesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesCancelFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetRollingUpgradesCancelFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture an abstraction for monitoring and -// retrieving the results of a long-running operation. -type VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetRollingUpgradesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture.Result. -func (future *VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture) result(client VirtualMachineScaleSetRollingUpgradesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture an abstraction for monitoring and retrieving -// the results of a long-running operation. -type VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetRollingUpgradesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture.Result. -func (future *VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture) result(client VirtualMachineScaleSetRollingUpgradesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. -type VirtualMachineScaleSetsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetsClient) (VirtualMachineScaleSet, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetsCreateOrUpdateFuture.Result. -func (future *VirtualMachineScaleSetsCreateOrUpdateFuture) result(client VirtualMachineScaleSetsClient) (vmss VirtualMachineScaleSet, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vmss.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vmss.Response.Response, err = future.GetResult(sender); err == nil && vmss.Response.Response.StatusCode != http.StatusNoContent { - vmss, err = client.CreateOrUpdateResponder(vmss.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsCreateOrUpdateFuture", "Result", vmss.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachineScaleSetsDeallocateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetsDeallocateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetsDeallocateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetsDeallocateFuture.Result. -func (future *VirtualMachineScaleSetsDeallocateFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsDeallocateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsDeallocateFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetsDeleteFuture.Result. -func (future *VirtualMachineScaleSetsDeleteFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetsDeleteInstancesFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. -type VirtualMachineScaleSetsDeleteInstancesFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetsDeleteInstancesFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetsDeleteInstancesFuture.Result. -func (future *VirtualMachineScaleSetsDeleteInstancesFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsDeleteInstancesFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsDeleteInstancesFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetSku describes an available virtual machine scale set sku. -type VirtualMachineScaleSetSku struct { - // ResourceType - READ-ONLY; The type of resource the sku applies to. - ResourceType *string `json:"resourceType,omitempty"` - // Sku - READ-ONLY; The Sku. - Sku *Sku `json:"sku,omitempty"` - // Capacity - READ-ONLY; Specifies the number of virtual machines in the scale set. - Capacity *VirtualMachineScaleSetSkuCapacity `json:"capacity,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetSku. -func (vmsss VirtualMachineScaleSetSku) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// VirtualMachineScaleSetSkuCapacity describes scaling information of a sku. -type VirtualMachineScaleSetSkuCapacity struct { - // Minimum - READ-ONLY; The minimum capacity. - Minimum *int64 `json:"minimum,omitempty"` - // Maximum - READ-ONLY; The maximum capacity that can be set. - Maximum *int64 `json:"maximum,omitempty"` - // DefaultCapacity - READ-ONLY; The default capacity. - DefaultCapacity *int64 `json:"defaultCapacity,omitempty"` - // ScaleType - READ-ONLY; The scale type applicable to the sku. Possible values include: 'VirtualMachineScaleSetSkuScaleTypeAutomatic', 'VirtualMachineScaleSetSkuScaleTypeNone' - ScaleType VirtualMachineScaleSetSkuScaleType `json:"scaleType,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetSkuCapacity. -func (vmsssc VirtualMachineScaleSetSkuCapacity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// VirtualMachineScaleSetsPerformMaintenanceFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type VirtualMachineScaleSetsPerformMaintenanceFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetsPerformMaintenanceFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetsPerformMaintenanceFuture.Result. -func (future *VirtualMachineScaleSetsPerformMaintenanceFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsPerformMaintenanceFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsPerformMaintenanceFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetsPowerOffFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetsPowerOffFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetsPowerOffFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetsPowerOffFuture.Result. -func (future *VirtualMachineScaleSetsPowerOffFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsPowerOffFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsPowerOffFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetsRedeployFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetsRedeployFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetsRedeployFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetsRedeployFuture.Result. -func (future *VirtualMachineScaleSetsRedeployFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsRedeployFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsRedeployFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetsReimageAllFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetsReimageAllFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetsReimageAllFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetsReimageAllFuture.Result. -func (future *VirtualMachineScaleSetsReimageAllFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsReimageAllFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsReimageAllFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetsReimageFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetsReimageFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetsReimageFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetsReimageFuture.Result. -func (future *VirtualMachineScaleSetsReimageFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsReimageFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsReimageFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetsRestartFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetsRestartFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetsRestartFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetsRestartFuture.Result. -func (future *VirtualMachineScaleSetsRestartFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsRestartFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsRestartFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetsSetOrchestrationServiceStateFuture an abstraction for monitoring and retrieving -// the results of a long-running operation. -type VirtualMachineScaleSetsSetOrchestrationServiceStateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetsSetOrchestrationServiceStateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetsSetOrchestrationServiceStateFuture.Result. -func (future *VirtualMachineScaleSetsSetOrchestrationServiceStateFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsSetOrchestrationServiceStateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsSetOrchestrationServiceStateFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetsStartFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetsStartFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetsStartFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetsStartFuture.Result. -func (future *VirtualMachineScaleSetsStartFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsStartFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsStartFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetStorageProfile describes a virtual machine scale set storage profile. -type VirtualMachineScaleSetStorageProfile struct { - // ImageReference - Specifies information about the image to use. You can specify information about platform images, 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. - ImageReference *ImageReference `json:"imageReference,omitempty"` - // OsDisk - Specifies information about the operating system disk used by the virtual machines in the scale set.

      For more information about disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). - OsDisk *VirtualMachineScaleSetOSDisk `json:"osDisk,omitempty"` - // DataDisks - Specifies the parameters that are used to add data disks to the virtual machines in the scale set.

      For more information about disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). - DataDisks *[]VirtualMachineScaleSetDataDisk `json:"dataDisks,omitempty"` - DiskControllerType *string `json:"diskControllerType,omitempty"` -} - -// VirtualMachineScaleSetsUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetsUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetsClient) (VirtualMachineScaleSet, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetsUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetsUpdateFuture.Result. -func (future *VirtualMachineScaleSetsUpdateFuture) result(client VirtualMachineScaleSetsClient) (vmss VirtualMachineScaleSet, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vmss.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vmss.Response.Response, err = future.GetResult(sender); err == nil && vmss.Response.Response.StatusCode != http.StatusNoContent { - vmss, err = client.UpdateResponder(vmss.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsUpdateFuture", "Result", vmss.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachineScaleSetsUpdateInstancesFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. -type VirtualMachineScaleSetsUpdateInstancesFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetsUpdateInstancesFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetsUpdateInstancesFuture.Result. -func (future *VirtualMachineScaleSetsUpdateInstancesFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsUpdateInstancesFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsUpdateInstancesFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetUpdate describes a Virtual Machine Scale Set. -type VirtualMachineScaleSetUpdate struct { - // 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. - Plan *Plan `json:"plan,omitempty"` - *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. NOTE: The subnet of a scale set may be modified as long as the original subnet and the -// new subnet are in the same virtual network -type VirtualMachineScaleSetUpdateIPConfiguration struct { - // 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 configuration properties. -type VirtualMachineScaleSetUpdateIPConfigurationProperties struct { - // Subnet - The subnet. - Subnet *APIEntityReference `json:"subnet,omitempty"` - // Primary - Specifies the primary IP Configuration in case the network interface has more than one IP Configuration. - Primary *bool `json:"primary,omitempty"` - // PublicIPAddressConfiguration - The publicIPAddressConfiguration. - PublicIPAddressConfiguration *VirtualMachineScaleSetUpdatePublicIPAddressConfiguration `json:"publicIPAddressConfiguration,omitempty"` - // PrivateIPAddressVersion - Available from Api-Version 2017-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6' - PrivateIPAddressVersion IPVersion `json:"privateIPAddressVersion,omitempty"` - // ApplicationGatewayBackendAddressPools - The application gateway backend address pools. - ApplicationGatewayBackendAddressPools *[]SubResource `json:"applicationGatewayBackendAddressPools,omitempty"` - // ApplicationSecurityGroups - Specifies an array of references to application security group. - ApplicationSecurityGroups *[]SubResource `json:"applicationSecurityGroups,omitempty"` - // LoadBalancerBackendAddressPools - The load balancer backend address pools. - LoadBalancerBackendAddressPools *[]SubResource `json:"loadBalancerBackendAddressPools,omitempty"` - // LoadBalancerInboundNatPools - The load balancer inbound nat pools. - LoadBalancerInboundNatPools *[]SubResource `json:"loadBalancerInboundNatPools,omitempty"` -} - -// VirtualMachineScaleSetUpdateNetworkConfiguration describes a virtual machine scale set network profile's -// network configurations. -type VirtualMachineScaleSetUpdateNetworkConfiguration struct { - // 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. -type VirtualMachineScaleSetUpdateNetworkConfigurationProperties struct { - // Primary - Whether this is a primary NIC on a virtual machine. - Primary *bool `json:"primary,omitempty"` - // EnableAcceleratedNetworking - Specifies whether the network interface is accelerated networking-enabled. - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - // DisableTCPStateTracking - Specifies whether the network interface is disabled for tcp state tracking. - DisableTCPStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - // EnableFpga - Specifies whether the network interface is FPGA networking-enabled. - EnableFpga *bool `json:"enableFpga,omitempty"` - // NetworkSecurityGroup - The network security group. - NetworkSecurityGroup *SubResource `json:"networkSecurityGroup,omitempty"` - // DNSSettings - The dns settings to be applied on the network interfaces. - DNSSettings *VirtualMachineScaleSetNetworkConfigurationDNSSettings `json:"dnsSettings,omitempty"` - // IPConfigurations - The virtual machine scale set IP Configuration. - IPConfigurations *[]VirtualMachineScaleSetUpdateIPConfiguration `json:"ipConfigurations,omitempty"` - // EnableIPForwarding - Whether IP forwarding enabled on this NIC. - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - // DeleteOption - Specify what happens to the network interface when the VM is deleted. Possible values include: 'Delete', 'Detach' - DeleteOption DeleteOptions `json:"deleteOption,omitempty"` -} - -// VirtualMachineScaleSetUpdateNetworkProfile describes a virtual machine scale set network profile. -type VirtualMachineScaleSetUpdateNetworkProfile struct { - // HealthProbe - A reference to a load balancer probe used to determine the health of an instance in the virtual machine scale set. The reference will be in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. - HealthProbe *APIEntityReference `json:"healthProbe,omitempty"` - // NetworkInterfaceConfigurations - The list of network configurations. - NetworkInterfaceConfigurations *[]VirtualMachineScaleSetUpdateNetworkConfiguration `json:"networkInterfaceConfigurations,omitempty"` - // NetworkAPIVersion - specifies the Microsoft.Network API version used when creating networking resources in the Network Interface Configurations for Virtual Machine Scale Set with orchestration mode 'Flexible'. Possible values include: 'TwoZeroTwoZeroHyphenMinusOneOneHyphenMinusZeroOne' - NetworkAPIVersion NetworkAPIVersion `json:"networkApiVersion,omitempty"` -} - -// VirtualMachineScaleSetUpdateOSDisk describes virtual machine scale set operating system disk Update -// Object. This should be used for Updating VMSS OS Disk. -type VirtualMachineScaleSetUpdateOSDisk struct { - // Caching - The caching type. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' - Caching CachingTypes `json:"caching,omitempty"` - // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. - WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` - // DiskSizeGB - Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image.

      diskSizeGB is the number of bytes x 1024^3 for the disk and the value cannot be larger than 1023 - DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` - // Image - The Source User Image VirtualHardDisk. This VirtualHardDisk will be copied before using it to attach to the Virtual Machine. If SourceImage is provided, the destination VirtualHardDisk should not exist. - Image *VirtualHardDisk `json:"image,omitempty"` - // VhdContainers - The list of virtual hard disk container uris. - VhdContainers *[]string `json:"vhdContainers,omitempty"` - // ManagedDisk - The managed disk parameters. - ManagedDisk *VirtualMachineScaleSetManagedDiskParameters `json:"managedDisk,omitempty"` - // DeleteOption - Specifies whether OS Disk should be deleted or detached upon VMSS Flex deletion (This feature is available for VMSS with Flexible OrchestrationMode only).

      Possible values:

      **Delete** If this value is used, the OS disk is deleted when VMSS Flex VM is deleted.

      **Detach** If this value is used, the OS disk is retained after VMSS Flex VM is deleted.

      The default value is set to **Delete**. For an Ephemeral OS Disk, the default value is set to **Delete**. User cannot change the delete option for Ephemeral OS Disk. Possible values include: 'DiskDeleteOptionTypesDelete', 'DiskDeleteOptionTypesDetach' - DeleteOption DiskDeleteOptionTypes `json:"deleteOption,omitempty"` -} - -// VirtualMachineScaleSetUpdateOSProfile describes a virtual machine scale set OS profile. -type VirtualMachineScaleSetUpdateOSProfile struct { - // CustomData - A base-64 encoded string of custom data. - CustomData *string `json:"customData,omitempty"` - // WindowsConfiguration - The Windows Configuration of the OS profile. - WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"` - // LinuxConfiguration - The Linux Configuration of the OS profile. - LinuxConfiguration *LinuxConfiguration `json:"linuxConfiguration,omitempty"` - // Secrets - The List of certificates for addition to the VM. - Secrets *[]VaultSecretGroup `json:"secrets,omitempty"` -} - -// VirtualMachineScaleSetUpdateProperties describes the properties of a Virtual Machine Scale Set. -type VirtualMachineScaleSetUpdateProperties struct { - // UpgradePolicy - The upgrade policy. - UpgradePolicy *UpgradePolicy `json:"upgradePolicy,omitempty"` - // AutomaticRepairsPolicy - Policy for automatic repairs. - AutomaticRepairsPolicy *AutomaticRepairsPolicy `json:"automaticRepairsPolicy,omitempty"` - // VirtualMachineProfile - The virtual machine profile. - VirtualMachineProfile *VirtualMachineScaleSetUpdateVMProfile `json:"virtualMachineProfile,omitempty"` - // Overprovision - Specifies whether the Virtual Machine Scale Set should be overprovisioned. - Overprovision *bool `json:"overprovision,omitempty"` - // DoNotRunExtensionsOnOverprovisionedVMs - When Overprovision is enabled, extensions are launched only on the requested number of VMs which are finally kept. This property will hence ensure that the extensions do not run on the extra overprovisioned VMs. - DoNotRunExtensionsOnOverprovisionedVMs *bool `json:"doNotRunExtensionsOnOverprovisionedVMs,omitempty"` - // SinglePlacementGroup - When true this limits the scale set to a single placement group, of max size 100 virtual machines. NOTE: If singlePlacementGroup is true, it may be modified to false. However, if singlePlacementGroup is false, it may not be modified to true. - SinglePlacementGroup *bool `json:"singlePlacementGroup,omitempty"` - // AdditionalCapabilities - Specifies additional capabilities enabled or disabled on the Virtual Machines in the Virtual Machine Scale Set. For instance: whether the Virtual Machines have the capability to support attaching managed data disks with UltraSSD_LRS storage account type. - AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` - // ScaleInPolicy - Specifies the policies applied when scaling in Virtual Machines in the Virtual Machine Scale Set. - ScaleInPolicy *ScaleInPolicy `json:"scaleInPolicy,omitempty"` - // ProximityPlacementGroup - Specifies information about the proximity placement group that the virtual machine scale set should be assigned to.

      Minimum api-version: 2018-04-01. - ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` -} - -// 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 { - // IdleTimeoutInMinutes - The idle timeout of the public IP address. - IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` - // DNSSettings - The dns settings to be applied on the publicIP addresses . - DNSSettings *VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings `json:"dnsSettings,omitempty"` - // PublicIPPrefix - The PublicIPPrefix from which to allocate publicIP addresses. - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - // DeleteOption - Specify what happens to the public IP when the VM is deleted. Possible values include: 'Delete', 'Detach' - DeleteOption DeleteOptions `json:"deleteOption,omitempty"` -} - -// VirtualMachineScaleSetUpdateStorageProfile describes a virtual machine scale set storage profile. -type VirtualMachineScaleSetUpdateStorageProfile struct { - // ImageReference - The image reference. - ImageReference *ImageReference `json:"imageReference,omitempty"` - // OsDisk - The OS disk. - OsDisk *VirtualMachineScaleSetUpdateOSDisk `json:"osDisk,omitempty"` - // DataDisks - The data disks. - DataDisks *[]VirtualMachineScaleSetDataDisk `json:"dataDisks,omitempty"` - DiskControllerType *string `json:"diskControllerType,omitempty"` -} - -// VirtualMachineScaleSetUpdateVMProfile describes a virtual machine scale set virtual machine profile. -type VirtualMachineScaleSetUpdateVMProfile struct { - // OsProfile - The virtual machine scale set OS profile. - OsProfile *VirtualMachineScaleSetUpdateOSProfile `json:"osProfile,omitempty"` - // StorageProfile - The virtual machine scale set storage profile. - StorageProfile *VirtualMachineScaleSetUpdateStorageProfile `json:"storageProfile,omitempty"` - // NetworkProfile - The virtual machine scale set network profile. - NetworkProfile *VirtualMachineScaleSetUpdateNetworkProfile `json:"networkProfile,omitempty"` - // SecurityProfile - The virtual machine scale set Security profile - SecurityProfile *SecurityProfile `json:"securityProfile,omitempty"` - // DiagnosticsProfile - The virtual machine scale set diagnostics profile. - DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` - // ExtensionProfile - The virtual machine scale set extension profile. - ExtensionProfile *VirtualMachineScaleSetExtensionProfile `json:"extensionProfile,omitempty"` - // LicenseType - The license type, which is for bring your own license scenario. - LicenseType *string `json:"licenseType,omitempty"` - // BillingProfile - Specifies the billing related details of a Azure Spot VMSS.

      Minimum api-version: 2019-03-01. - BillingProfile *BillingProfile `json:"billingProfile,omitempty"` - // ScheduledEventsProfile - Specifies Scheduled Event related configurations. - ScheduledEventsProfile *ScheduledEventsProfile `json:"scheduledEventsProfile,omitempty"` - // UserData - UserData for the VM, which must be base-64 encoded. Customer should not pass any secrets in here.

      Minimum api-version: 2021-03-01 - UserData *string `json:"userData,omitempty"` - // HardwareProfile - Specifies the hardware profile related details of a scale set.

      Minimum api-version: 2021-11-01. - HardwareProfile *VirtualMachineScaleSetHardwareProfile `json:"hardwareProfile,omitempty"` -} - -// VirtualMachineScaleSetVM describes a virtual machine scale set virtual machine. -type VirtualMachineScaleSetVM struct { - autorest.Response `json:"-"` - // InstanceID - READ-ONLY; The virtual machine instance ID. - InstanceID *string `json:"instanceId,omitempty"` - // Sku - READ-ONLY; The virtual machine SKU. - Sku *Sku `json:"sku,omitempty"` - *VirtualMachineScaleSetVMProperties `json:"properties,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"` - // Resources - READ-ONLY; The virtual machine child extension resources. - Resources *[]VirtualMachineExtension `json:"resources,omitempty"` - // Zones - READ-ONLY; The virtual machine zones. - Zones *[]string `json:"zones,omitempty"` - // Identity - The identity of the virtual machine, if configured. - Identity *VirtualMachineIdentity `json:"identity,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; 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 VirtualMachineScaleSetVM. -func (vmssv VirtualMachineScaleSetVM) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmssv.VirtualMachineScaleSetVMProperties != nil { - objectMap["properties"] = vmssv.VirtualMachineScaleSetVMProperties - } - if vmssv.Plan != nil { - objectMap["plan"] = vmssv.Plan - } - if vmssv.Identity != nil { - objectMap["identity"] = vmssv.Identity - } - 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 "zones": - if v != nil { - var zones []string - err = json.Unmarshal(*v, &zones) - if err != nil { - return err - } - vmssv.Zones = &zones - } - case "identity": - if v != nil { - var identity VirtualMachineIdentity - err = json.Unmarshal(*v, &identity) - if err != nil { - return err - } - vmssv.Identity = &identity - } - 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 -} - -// VirtualMachineScaleSetVMExtension describes a VMSS VM Extension. -type VirtualMachineScaleSetVMExtension struct { - autorest.Response `json:"-"` - // Name - READ-ONLY; The name of the extension. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - *VirtualMachineExtensionProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMExtension. -func (vmssve VirtualMachineScaleSetVMExtension) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmssve.VirtualMachineExtensionProperties != nil { - objectMap["properties"] = vmssve.VirtualMachineExtensionProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetVMExtension struct. -func (vmssve *VirtualMachineScaleSetVMExtension) 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 - } - vmssve.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vmssve.Type = &typeVar - } - case "properties": - if v != nil { - var virtualMachineExtensionProperties VirtualMachineExtensionProperties - err = json.Unmarshal(*v, &virtualMachineExtensionProperties) - if err != nil { - return err - } - vmssve.VirtualMachineExtensionProperties = &virtualMachineExtensionProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vmssve.ID = &ID - } - } - } - - return nil -} - -// VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetVMExtensionsClient) (VirtualMachineScaleSetVMExtension, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture.Result. -func (future *VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture) result(client VirtualMachineScaleSetVMExtensionsClient) (vmssve VirtualMachineScaleSetVMExtension, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vmssve.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vmssve.Response.Response, err = future.GetResult(sender); err == nil && vmssve.Response.Response.StatusCode != http.StatusNoContent { - vmssve, err = client.CreateOrUpdateResponder(vmssve.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture", "Result", vmssve.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachineScaleSetVMExtensionsDeleteFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type VirtualMachineScaleSetVMExtensionsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetVMExtensionsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetVMExtensionsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetVMExtensionsDeleteFuture.Result. -func (future *VirtualMachineScaleSetVMExtensionsDeleteFuture) result(client VirtualMachineScaleSetVMExtensionsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMExtensionsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetVMExtensionsListResult the List VMSS VM Extension operation response -type VirtualMachineScaleSetVMExtensionsListResult struct { - autorest.Response `json:"-"` - // Value - The list of VMSS VM extensions - Value *[]VirtualMachineScaleSetVMExtension `json:"value,omitempty"` -} - -// VirtualMachineScaleSetVMExtensionsSummary extensions summary for virtual machines of a virtual machine -// scale set. -type VirtualMachineScaleSetVMExtensionsSummary struct { - // Name - READ-ONLY; The extension name. - Name *string `json:"name,omitempty"` - // StatusesSummary - READ-ONLY; The extensions information. - StatusesSummary *[]VirtualMachineStatusCodeCount `json:"statusesSummary,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMExtensionsSummary. -func (vmssves VirtualMachineScaleSetVMExtensionsSummary) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// VirtualMachineScaleSetVMExtensionsUpdateFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type VirtualMachineScaleSetVMExtensionsUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetVMExtensionsClient) (VirtualMachineScaleSetVMExtension, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetVMExtensionsUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetVMExtensionsUpdateFuture.Result. -func (future *VirtualMachineScaleSetVMExtensionsUpdateFuture) result(client VirtualMachineScaleSetVMExtensionsClient) (vmssve VirtualMachineScaleSetVMExtension, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vmssve.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMExtensionsUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vmssve.Response.Response, err = future.GetResult(sender); err == nil && vmssve.Response.Response.StatusCode != http.StatusNoContent { - vmssve, err = client.UpdateResponder(vmssve.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsUpdateFuture", "Result", vmssve.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachineScaleSetVMExtensionUpdate describes a VMSS VM Extension. -type VirtualMachineScaleSetVMExtensionUpdate struct { - // Name - READ-ONLY; The name of the extension. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - *VirtualMachineExtensionUpdateProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMExtensionUpdate. -func (vmssveu VirtualMachineScaleSetVMExtensionUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmssveu.VirtualMachineExtensionUpdateProperties != nil { - objectMap["properties"] = vmssveu.VirtualMachineExtensionUpdateProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetVMExtensionUpdate struct. -func (vmssveu *VirtualMachineScaleSetVMExtensionUpdate) 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 - } - vmssveu.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vmssveu.Type = &typeVar - } - case "properties": - if v != nil { - var virtualMachineExtensionUpdateProperties VirtualMachineExtensionUpdateProperties - err = json.Unmarshal(*v, &virtualMachineExtensionUpdateProperties) - if err != nil { - return err - } - vmssveu.VirtualMachineExtensionUpdateProperties = &virtualMachineExtensionUpdateProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vmssveu.ID = &ID - } - } - } - - return nil -} - -// VirtualMachineScaleSetVMInstanceIDs specifies a list of virtual machine instance IDs from the VM scale -// set. -type VirtualMachineScaleSetVMInstanceIDs struct { - // InstanceIds - The virtual machine scale set instance ids. Omitting the virtual machine scale set instance ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - InstanceIds *[]string `json:"instanceIds,omitempty"` -} - -// 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"` -} - -// VirtualMachineScaleSetVMInstanceView the instance view of a virtual machine scale set VM. -type VirtualMachineScaleSetVMInstanceView struct { - autorest.Response `json:"-"` - // PlatformUpdateDomain - The Update Domain count. - PlatformUpdateDomain *int32 `json:"platformUpdateDomain,omitempty"` - // PlatformFaultDomain - The Fault Domain count. - PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"` - // RdpThumbPrint - The Remote desktop certificate thumbprint. - RdpThumbPrint *string `json:"rdpThumbPrint,omitempty"` - // VMAgent - The VM Agent running on the virtual machine. - VMAgent *VirtualMachineAgentInstanceView `json:"vmAgent,omitempty"` - // MaintenanceRedeployStatus - The Maintenance Operation status on the virtual machine. - MaintenanceRedeployStatus *MaintenanceRedeployStatus `json:"maintenanceRedeployStatus,omitempty"` - // Disks - The disks information. - Disks *[]DiskInstanceView `json:"disks,omitempty"` - // Extensions - The extensions information. - Extensions *[]VirtualMachineExtensionInstanceView `json:"extensions,omitempty"` - // VMHealth - READ-ONLY; The health status for the VM. - VMHealth *VirtualMachineHealthStatus `json:"vmHealth,omitempty"` - // BootDiagnostics - Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to diagnose VM status.

      You can easily view the output of your console log.

      Azure also enables you to see a screenshot of the VM from the hypervisor. - BootDiagnostics *BootDiagnosticsInstanceView `json:"bootDiagnostics,omitempty"` - // Statuses - The resource status information. - Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` - // AssignedHost - READ-ONLY; Resource id of the dedicated host, on which the virtual machine is allocated through automatic placement, when the virtual machine is associated with a dedicated host group that has automatic placement enabled.

      Minimum api-version: 2020-06-01. - AssignedHost *string `json:"assignedHost,omitempty"` - // PlacementGroupID - The placement group in which the VM is running. If the VM is deallocated it will not have a placementGroupId. - PlacementGroupID *string `json:"placementGroupId,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMInstanceView. -func (vmssviv VirtualMachineScaleSetVMInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmssviv.PlatformUpdateDomain != nil { - objectMap["platformUpdateDomain"] = vmssviv.PlatformUpdateDomain - } - if vmssviv.PlatformFaultDomain != nil { - objectMap["platformFaultDomain"] = vmssviv.PlatformFaultDomain - } - if vmssviv.RdpThumbPrint != nil { - objectMap["rdpThumbPrint"] = vmssviv.RdpThumbPrint - } - if vmssviv.VMAgent != nil { - objectMap["vmAgent"] = vmssviv.VMAgent - } - if vmssviv.MaintenanceRedeployStatus != nil { - objectMap["maintenanceRedeployStatus"] = vmssviv.MaintenanceRedeployStatus - } - if vmssviv.Disks != nil { - objectMap["disks"] = vmssviv.Disks - } - if vmssviv.Extensions != nil { - objectMap["extensions"] = vmssviv.Extensions - } - if vmssviv.BootDiagnostics != nil { - objectMap["bootDiagnostics"] = vmssviv.BootDiagnostics - } - if vmssviv.Statuses != nil { - objectMap["statuses"] = vmssviv.Statuses - } - if vmssviv.PlacementGroupID != nil { - objectMap["placementGroupId"] = vmssviv.PlacementGroupID - } - return json.Marshal(objectMap) -} - -// VirtualMachineScaleSetVMListResult the List Virtual Machine Scale Set VMs operation response. -type VirtualMachineScaleSetVMListResult struct { - autorest.Response `json:"-"` - // Value - The list of virtual machine scale sets VMs. - Value *[]VirtualMachineScaleSetVM `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of Virtual Machine Scale Set VMs. Call ListNext() with this to fetch the next page of VMSS VMs - NextLink *string `json:"nextLink,omitempty"` -} - -// VirtualMachineScaleSetVMListResultIterator provides access to a complete listing of -// VirtualMachineScaleSetVM values. -type VirtualMachineScaleSetVMListResultIterator struct { - i int - page VirtualMachineScaleSetVMListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *VirtualMachineScaleSetVMListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *VirtualMachineScaleSetVMListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter VirtualMachineScaleSetVMListResultIterator) 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 VirtualMachineScaleSetVMListResultIterator) Response() VirtualMachineScaleSetVMListResult { - 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 VirtualMachineScaleSetVMListResultIterator) Value() VirtualMachineScaleSetVM { - if !iter.page.NotDone() { - return VirtualMachineScaleSetVM{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the VirtualMachineScaleSetVMListResultIterator type. -func NewVirtualMachineScaleSetVMListResultIterator(page VirtualMachineScaleSetVMListResultPage) VirtualMachineScaleSetVMListResultIterator { - return VirtualMachineScaleSetVMListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (vmssvlr VirtualMachineScaleSetVMListResult) IsEmpty() bool { - return vmssvlr.Value == nil || len(*vmssvlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (vmssvlr VirtualMachineScaleSetVMListResult) hasNextLink() bool { - return vmssvlr.NextLink != nil && len(*vmssvlr.NextLink) != 0 -} - -// virtualMachineScaleSetVMListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (vmssvlr VirtualMachineScaleSetVMListResult) virtualMachineScaleSetVMListResultPreparer(ctx context.Context) (*http.Request, error) { - if !vmssvlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(vmssvlr.NextLink))) -} - -// VirtualMachineScaleSetVMListResultPage contains a page of VirtualMachineScaleSetVM values. -type VirtualMachineScaleSetVMListResultPage struct { - fn func(context.Context, VirtualMachineScaleSetVMListResult) (VirtualMachineScaleSetVMListResult, error) - vmssvlr VirtualMachineScaleSetVMListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *VirtualMachineScaleSetVMListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.vmssvlr) - if err != nil { - return err - } - page.vmssvlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *VirtualMachineScaleSetVMListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page VirtualMachineScaleSetVMListResultPage) NotDone() bool { - return !page.vmssvlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page VirtualMachineScaleSetVMListResultPage) Response() VirtualMachineScaleSetVMListResult { - return page.vmssvlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page VirtualMachineScaleSetVMListResultPage) Values() []VirtualMachineScaleSetVM { - if page.vmssvlr.IsEmpty() { - return nil - } - return *page.vmssvlr.Value -} - -// Creates a new instance of the VirtualMachineScaleSetVMListResultPage type. -func NewVirtualMachineScaleSetVMListResultPage(cur VirtualMachineScaleSetVMListResult, getNextPage func(context.Context, VirtualMachineScaleSetVMListResult) (VirtualMachineScaleSetVMListResult, error)) VirtualMachineScaleSetVMListResultPage { - return VirtualMachineScaleSetVMListResultPage{ - fn: getNextPage, - vmssvlr: cur, - } -} - -// VirtualMachineScaleSetVMNetworkProfileConfiguration describes a virtual machine scale set VM network -// profile. -type VirtualMachineScaleSetVMNetworkProfileConfiguration struct { - // NetworkInterfaceConfigurations - The list of network configurations. - NetworkInterfaceConfigurations *[]VirtualMachineScaleSetNetworkConfiguration `json:"networkInterfaceConfigurations,omitempty"` -} - -// VirtualMachineScaleSetVMProfile describes a virtual machine scale set virtual machine profile. -type VirtualMachineScaleSetVMProfile struct { - // OsProfile - Specifies the operating system settings for the virtual machines in the scale set. - OsProfile *VirtualMachineScaleSetOSProfile `json:"osProfile,omitempty"` - // StorageProfile - Specifies the storage settings for the virtual machine disks. - StorageProfile *VirtualMachineScaleSetStorageProfile `json:"storageProfile,omitempty"` - // NetworkProfile - Specifies properties of the network interfaces of the virtual machines in the scale set. - NetworkProfile *VirtualMachineScaleSetNetworkProfile `json:"networkProfile,omitempty"` - // SecurityProfile - Specifies the Security related profile settings for the virtual machines in the scale set. - SecurityProfile *SecurityProfile `json:"securityProfile,omitempty"` - // DiagnosticsProfile - Specifies the boot diagnostic settings state.

      Minimum api-version: 2015-06-15. - DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` - // ExtensionProfile - Specifies a collection of settings for extensions installed on virtual machines in the scale set. - ExtensionProfile *VirtualMachineScaleSetExtensionProfile `json:"extensionProfile,omitempty"` - // LicenseType - Specifies that the image or disk that is being used was licensed on-premises.

      Possible values for Windows Server operating system are:

      Windows_Client

      Windows_Server

      Possible values for Linux Server operating system are:

      RHEL_BYOS (for RHEL)

      SLES_BYOS (for SUSE)

      For more information, see [Azure Hybrid Use Benefit for Windows Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing)

      [Azure Hybrid Use Benefit for Linux Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux)

      Minimum api-version: 2015-06-15 - LicenseType *string `json:"licenseType,omitempty"` - // Priority - Specifies the priority for the virtual machines in the scale set.

      Minimum api-version: 2017-10-30-preview. Possible values include: 'Regular', 'Low', 'Spot' - Priority VirtualMachinePriorityTypes `json:"priority,omitempty"` - // EvictionPolicy - Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot scale set.

      For Azure Spot virtual machines, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2019-03-01.

      For Azure Spot scale sets, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2017-10-30-preview. Possible values include: 'VirtualMachineEvictionPolicyTypesDeallocate', 'VirtualMachineEvictionPolicyTypesDelete' - EvictionPolicy VirtualMachineEvictionPolicyTypes `json:"evictionPolicy,omitempty"` - // BillingProfile - Specifies the billing related details of a Azure Spot VMSS.

      Minimum api-version: 2019-03-01. - BillingProfile *BillingProfile `json:"billingProfile,omitempty"` - // ScheduledEventsProfile - Specifies Scheduled Event related configurations. - ScheduledEventsProfile *ScheduledEventsProfile `json:"scheduledEventsProfile,omitempty"` - // UserData - UserData for the virtual machines in the scale set, which must be base-64 encoded. Customer should not pass any secrets in here.

      Minimum api-version: 2021-03-01 - UserData *string `json:"userData,omitempty"` - // CapacityReservation - Specifies the capacity reservation related details of a scale set.

      Minimum api-version: 2021-04-01. - CapacityReservation *CapacityReservationProfile `json:"capacityReservation,omitempty"` - // ApplicationProfile - Specifies the gallery applications that should be made available to the VM/VMSS - ApplicationProfile *ApplicationProfile `json:"applicationProfile,omitempty"` - // HardwareProfile - Specifies the hardware profile related details of a scale set.

      Minimum api-version: 2021-11-01. - HardwareProfile *VirtualMachineScaleSetHardwareProfile `json:"hardwareProfile,omitempty"` -} - -// VirtualMachineScaleSetVMProperties describes the properties of a virtual machine scale set virtual -// machine. -type VirtualMachineScaleSetVMProperties struct { - // LatestModelApplied - READ-ONLY; Specifies whether the latest model has been applied to the virtual machine. - LatestModelApplied *bool `json:"latestModelApplied,omitempty"` - // VMID - READ-ONLY; Azure VM unique ID. - VMID *string `json:"vmId,omitempty"` - // InstanceView - READ-ONLY; The virtual machine instance view. - InstanceView *VirtualMachineScaleSetVMInstanceView `json:"instanceView,omitempty"` - // HardwareProfile - Specifies the hardware settings for the virtual machine. - HardwareProfile *HardwareProfile `json:"hardwareProfile,omitempty"` - // StorageProfile - Specifies the storage settings for the virtual machine disks. - StorageProfile *StorageProfile `json:"storageProfile,omitempty"` - // AdditionalCapabilities - Specifies additional capabilities enabled or disabled on the virtual machine in the scale set. For instance: whether the virtual machine has the capability to support attaching managed data disks with UltraSSD_LRS storage account type. - AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` - // OsProfile - Specifies the operating system settings for the virtual machine. - OsProfile *OSProfile `json:"osProfile,omitempty"` - // SecurityProfile - Specifies the Security related profile settings for the virtual machine. - SecurityProfile *SecurityProfile `json:"securityProfile,omitempty"` - // NetworkProfile - Specifies the network interfaces of the virtual machine. - NetworkProfile *NetworkProfile `json:"networkProfile,omitempty"` - // NetworkProfileConfiguration - Specifies the network profile configuration of the virtual machine. - NetworkProfileConfiguration *VirtualMachineScaleSetVMNetworkProfileConfiguration `json:"networkProfileConfiguration,omitempty"` - // DiagnosticsProfile - Specifies the boot diagnostic settings state.

      Minimum api-version: 2015-06-15. - DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` - // 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 [Availability sets overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview).

      For more information on Azure planned maintenance, see [Maintenance and updates for Virtual Machines in Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates)

      Currently, a VM can only be added to availability set at creation time. An existing VM cannot be added to an availability set. - AvailabilitySet *SubResource `json:"availabilitySet,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *string `json:"provisioningState,omitempty"` - // LicenseType - Specifies that the image or disk that is being used was licensed on-premises.

      Possible values for Windows Server operating system are:

      Windows_Client

      Windows_Server

      Possible values for Linux Server operating system are:

      RHEL_BYOS (for RHEL)

      SLES_BYOS (for SUSE)

      For more information, see [Azure Hybrid Use Benefit for Windows Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing)

      [Azure Hybrid Use Benefit for Linux Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux)

      Minimum api-version: 2015-06-15 - LicenseType *string `json:"licenseType,omitempty"` - // ModelDefinitionApplied - READ-ONLY; Specifies whether the model applied to the virtual machine is the model of the virtual machine scale set or the customized model for the virtual machine. - ModelDefinitionApplied *string `json:"modelDefinitionApplied,omitempty"` - // ProtectionPolicy - Specifies the protection policy of the virtual machine. - ProtectionPolicy *VirtualMachineScaleSetVMProtectionPolicy `json:"protectionPolicy,omitempty"` - // UserData - UserData for the VM, which must be base-64 encoded. Customer should not pass any secrets in here.

      Minimum api-version: 2021-03-01 - UserData *string `json:"userData,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMProperties. -func (vmssvp VirtualMachineScaleSetVMProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmssvp.HardwareProfile != nil { - objectMap["hardwareProfile"] = vmssvp.HardwareProfile - } - if vmssvp.StorageProfile != nil { - objectMap["storageProfile"] = vmssvp.StorageProfile - } - if vmssvp.AdditionalCapabilities != nil { - objectMap["additionalCapabilities"] = vmssvp.AdditionalCapabilities - } - if vmssvp.OsProfile != nil { - objectMap["osProfile"] = vmssvp.OsProfile - } - if vmssvp.SecurityProfile != nil { - objectMap["securityProfile"] = vmssvp.SecurityProfile - } - if vmssvp.NetworkProfile != nil { - objectMap["networkProfile"] = vmssvp.NetworkProfile - } - if vmssvp.NetworkProfileConfiguration != nil { - objectMap["networkProfileConfiguration"] = vmssvp.NetworkProfileConfiguration - } - if vmssvp.DiagnosticsProfile != nil { - objectMap["diagnosticsProfile"] = vmssvp.DiagnosticsProfile - } - if vmssvp.AvailabilitySet != nil { - objectMap["availabilitySet"] = vmssvp.AvailabilitySet - } - if vmssvp.LicenseType != nil { - objectMap["licenseType"] = vmssvp.LicenseType - } - if vmssvp.ProtectionPolicy != nil { - objectMap["protectionPolicy"] = vmssvp.ProtectionPolicy - } - if vmssvp.UserData != nil { - objectMap["userData"] = vmssvp.UserData - } - return json.Marshal(objectMap) -} - -// VirtualMachineScaleSetVMProtectionPolicy the protection policy of a virtual machine scale set VM. -type VirtualMachineScaleSetVMProtectionPolicy struct { - // ProtectFromScaleIn - Indicates that the virtual machine scale set VM shouldn't be considered for deletion during a scale-in operation. - ProtectFromScaleIn *bool `json:"protectFromScaleIn,omitempty"` - // ProtectFromScaleSetActions - Indicates that model updates or actions (including scale-in) initiated on the virtual machine scale set should not be applied to the virtual machine scale set VM. - ProtectFromScaleSetActions *bool `json:"protectFromScaleSetActions,omitempty"` -} - -// VirtualMachineScaleSetVMReimageParameters describes a Virtual Machine Scale Set VM Reimage Parameters. -type VirtualMachineScaleSetVMReimageParameters struct { - // TempDisk - Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage parameter is only supported for VM/VMSS with Ephemeral OS disk. - TempDisk *bool `json:"tempDisk,omitempty"` -} - -// VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetVMRunCommandsClient) (VirtualMachineRunCommand, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture.Result. -func (future *VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture) result(client VirtualMachineScaleSetVMRunCommandsClient) (vmrc VirtualMachineRunCommand, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vmrc.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vmrc.Response.Response, err = future.GetResult(sender); err == nil && vmrc.Response.Response.StatusCode != http.StatusNoContent { - vmrc, err = client.CreateOrUpdateResponder(vmrc.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture", "Result", vmrc.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachineScaleSetVMRunCommandsDeleteFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type VirtualMachineScaleSetVMRunCommandsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetVMRunCommandsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetVMRunCommandsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetVMRunCommandsDeleteFuture.Result. -func (future *VirtualMachineScaleSetVMRunCommandsDeleteFuture) result(client VirtualMachineScaleSetVMRunCommandsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMRunCommandsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetVMRunCommandsUpdateFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type VirtualMachineScaleSetVMRunCommandsUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetVMRunCommandsClient) (VirtualMachineRunCommand, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetVMRunCommandsUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetVMRunCommandsUpdateFuture.Result. -func (future *VirtualMachineScaleSetVMRunCommandsUpdateFuture) result(client VirtualMachineScaleSetVMRunCommandsClient) (vmrc VirtualMachineRunCommand, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vmrc.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMRunCommandsUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vmrc.Response.Response, err = future.GetResult(sender); err == nil && vmrc.Response.Response.StatusCode != http.StatusNoContent { - vmrc, err = client.UpdateResponder(vmrc.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsUpdateFuture", "Result", vmrc.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachineScaleSetVMsDeallocateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetVMsDeallocateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetVMsDeallocateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetVMsDeallocateFuture.Result. -func (future *VirtualMachineScaleSetVMsDeallocateFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsDeallocateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsDeallocateFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetVMsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetVMsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetVMsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetVMsDeleteFuture.Result. -func (future *VirtualMachineScaleSetVMsDeleteFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetVMsPerformMaintenanceFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type VirtualMachineScaleSetVMsPerformMaintenanceFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetVMsPerformMaintenanceFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetVMsPerformMaintenanceFuture.Result. -func (future *VirtualMachineScaleSetVMsPerformMaintenanceFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsPerformMaintenanceFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsPerformMaintenanceFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetVMsPowerOffFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetVMsPowerOffFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetVMsPowerOffFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetVMsPowerOffFuture.Result. -func (future *VirtualMachineScaleSetVMsPowerOffFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsPowerOffFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsPowerOffFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetVMsRedeployFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetVMsRedeployFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetVMsRedeployFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetVMsRedeployFuture.Result. -func (future *VirtualMachineScaleSetVMsRedeployFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsRedeployFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsRedeployFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetVMsReimageAllFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetVMsReimageAllFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetVMsReimageAllFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetVMsReimageAllFuture.Result. -func (future *VirtualMachineScaleSetVMsReimageAllFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsReimageAllFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsReimageAllFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetVMsReimageFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetVMsReimageFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetVMsReimageFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetVMsReimageFuture.Result. -func (future *VirtualMachineScaleSetVMsReimageFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsReimageFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsReimageFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetVMsRestartFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetVMsRestartFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetVMsRestartFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetVMsRestartFuture.Result. -func (future *VirtualMachineScaleSetVMsRestartFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsRestartFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsRestartFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetVMsRunCommandFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetVMsRunCommandFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetVMsClient) (RunCommandResult, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetVMsRunCommandFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetVMsRunCommandFuture.Result. -func (future *VirtualMachineScaleSetVMsRunCommandFuture) result(client VirtualMachineScaleSetVMsClient) (rcr RunCommandResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsRunCommandFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - rcr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsRunCommandFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if rcr.Response.Response, err = future.GetResult(sender); err == nil && rcr.Response.Response.StatusCode != http.StatusNoContent { - rcr, err = client.RunCommandResponder(rcr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsRunCommandFuture", "Result", rcr.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachineScaleSetVMsStartFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetVMsStartFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetVMsStartFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetVMsStartFuture.Result. -func (future *VirtualMachineScaleSetVMsStartFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsStartFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsStartFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetVMsUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetVMsUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetVMsClient) (VirtualMachineScaleSetVM, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetVMsUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetVMsUpdateFuture.Result. -func (future *VirtualMachineScaleSetVMsUpdateFuture) result(client VirtualMachineScaleSetVMsClient) (vmssv VirtualMachineScaleSetVM, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vmssv.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vmssv.Response.Response, err = future.GetResult(sender); err == nil && vmssv.Response.Response.StatusCode != http.StatusNoContent { - vmssv, err = client.UpdateResponder(vmssv.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsUpdateFuture", "Result", vmssv.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachinesCaptureFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VirtualMachinesCaptureFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachinesClient) (VirtualMachineCaptureResult, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachinesCaptureFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachinesCaptureFuture.Result. -func (future *VirtualMachinesCaptureFuture) result(client VirtualMachinesClient) (vmcr VirtualMachineCaptureResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesCaptureFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vmcr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesCaptureFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vmcr.Response.Response, err = future.GetResult(sender); err == nil && vmcr.Response.Response.StatusCode != http.StatusNoContent { - vmcr, err = client.CaptureResponder(vmcr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesCaptureFuture", "Result", vmcr.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachinesConvertToManagedDisksFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachinesConvertToManagedDisksFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachinesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachinesConvertToManagedDisksFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachinesConvertToManagedDisksFuture.Result. -func (future *VirtualMachinesConvertToManagedDisksFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesConvertToManagedDisksFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesConvertToManagedDisksFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachinesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachinesCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachinesClient) (VirtualMachine, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachinesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachinesCreateOrUpdateFuture.Result. -func (future *VirtualMachinesCreateOrUpdateFuture) result(client VirtualMachinesClient) (VM VirtualMachine, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - VM.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if VM.Response.Response, err = future.GetResult(sender); err == nil && VM.Response.Response.StatusCode != http.StatusNoContent { - VM, err = client.CreateOrUpdateResponder(VM.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesCreateOrUpdateFuture", "Result", VM.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachinesDeallocateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachinesDeallocateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachinesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachinesDeallocateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachinesDeallocateFuture.Result. -func (future *VirtualMachinesDeallocateFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesDeallocateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesDeallocateFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachinesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VirtualMachinesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachinesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachinesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachinesDeleteFuture.Result. -func (future *VirtualMachinesDeleteFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachinesInstallPatchesFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachinesInstallPatchesFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachinesClient) (VirtualMachineInstallPatchesResult, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachinesInstallPatchesFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachinesInstallPatchesFuture.Result. -func (future *VirtualMachinesInstallPatchesFuture) result(client VirtualMachinesClient) (vmipr VirtualMachineInstallPatchesResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesInstallPatchesFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vmipr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesInstallPatchesFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vmipr.Response.Response, err = future.GetResult(sender); err == nil && vmipr.Response.Response.StatusCode != http.StatusNoContent { - vmipr, err = client.InstallPatchesResponder(vmipr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesInstallPatchesFuture", "Result", vmipr.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachineSize describes the properties of a VM size. -type VirtualMachineSize struct { - // Name - The name of the virtual machine size. - Name *string `json:"name,omitempty"` - // NumberOfCores - The number of cores supported by the virtual machine size. For Constrained vCPU capable VM sizes, this number represents the total vCPUs of quota that the VM uses. For accurate vCPU count, please refer to https://docs.microsoft.com/azure/virtual-machines/constrained-vcpu or https://docs.microsoft.com/rest/api/compute/resourceskus/list - NumberOfCores *int32 `json:"numberOfCores,omitempty"` - // OsDiskSizeInMB - The OS disk size, in MB, allowed by the virtual machine size. - OsDiskSizeInMB *int32 `json:"osDiskSizeInMB,omitempty"` - // ResourceDiskSizeInMB - The resource disk size, in MB, allowed by the virtual machine size. - ResourceDiskSizeInMB *int32 `json:"resourceDiskSizeInMB,omitempty"` - // MemoryInMB - The amount of memory, in MB, supported by the virtual machine size. - MemoryInMB *int32 `json:"memoryInMB,omitempty"` - // MaxDataDiskCount - The maximum number of data disks that can be attached to the virtual machine size. - MaxDataDiskCount *int32 `json:"maxDataDiskCount,omitempty"` -} - -// VirtualMachineSizeListResult the List Virtual Machine operation response. -type VirtualMachineSizeListResult struct { - autorest.Response `json:"-"` - // Value - The list of virtual machine sizes. - Value *[]VirtualMachineSize `json:"value,omitempty"` -} - -// VirtualMachineSoftwarePatchProperties describes the properties of a Virtual Machine software patch. -type VirtualMachineSoftwarePatchProperties struct { - // PatchID - READ-ONLY; A unique identifier for the patch. - PatchID *string `json:"patchId,omitempty"` - // Name - READ-ONLY; The friendly name of the patch. - Name *string `json:"name,omitempty"` - // Version - READ-ONLY; The version number of the patch. This property applies only to Linux patches. - Version *string `json:"version,omitempty"` - // KbID - READ-ONLY; The KBID of the patch. Only applies to Windows patches. - KbID *string `json:"kbId,omitempty"` - // Classifications - READ-ONLY; The classification(s) of the patch as provided by the patch publisher. - Classifications *[]string `json:"classifications,omitempty"` - // RebootBehavior - READ-ONLY; Describes the reboot requirements of the patch. Possible values include: 'VMGuestPatchRebootBehaviorUnknown', 'VMGuestPatchRebootBehaviorNeverReboots', 'VMGuestPatchRebootBehaviorAlwaysRequiresReboot', 'VMGuestPatchRebootBehaviorCanRequestReboot' - RebootBehavior VMGuestPatchRebootBehavior `json:"rebootBehavior,omitempty"` - // ActivityID - READ-ONLY; The activity ID of the operation that produced this result. It is used to correlate across CRP and extension logs. - ActivityID *string `json:"activityId,omitempty"` - // PublishedDate - READ-ONLY; The UTC timestamp when the repository published this patch. - PublishedDate *date.Time `json:"publishedDate,omitempty"` - // LastModifiedDateTime - READ-ONLY; The UTC timestamp of the last update to this patch record. - LastModifiedDateTime *date.Time `json:"lastModifiedDateTime,omitempty"` - // AssessmentState - READ-ONLY; Describes the availability of a given patch. Possible values include: 'PatchAssessmentStateUnknown', 'PatchAssessmentStateAvailable' - AssessmentState PatchAssessmentState `json:"assessmentState,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineSoftwarePatchProperties. -func (vmspp VirtualMachineSoftwarePatchProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// VirtualMachinesPerformMaintenanceFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachinesPerformMaintenanceFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachinesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachinesPerformMaintenanceFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachinesPerformMaintenanceFuture.Result. -func (future *VirtualMachinesPerformMaintenanceFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesPerformMaintenanceFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesPerformMaintenanceFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachinesPowerOffFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VirtualMachinesPowerOffFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachinesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachinesPowerOffFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachinesPowerOffFuture.Result. -func (future *VirtualMachinesPowerOffFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesPowerOffFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesPowerOffFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachinesReapplyFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VirtualMachinesReapplyFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachinesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachinesReapplyFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachinesReapplyFuture.Result. -func (future *VirtualMachinesReapplyFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesReapplyFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesReapplyFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachinesRedeployFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VirtualMachinesRedeployFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachinesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachinesRedeployFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachinesRedeployFuture.Result. -func (future *VirtualMachinesRedeployFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRedeployFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesRedeployFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachinesReimageFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VirtualMachinesReimageFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachinesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachinesReimageFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachinesReimageFuture.Result. -func (future *VirtualMachinesReimageFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesReimageFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesReimageFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachinesRestartFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VirtualMachinesRestartFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachinesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachinesRestartFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachinesRestartFuture.Result. -func (future *VirtualMachinesRestartFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRestartFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesRestartFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachinesRunCommandFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachinesRunCommandFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachinesClient) (RunCommandResult, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachinesRunCommandFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachinesRunCommandFuture.Result. -func (future *VirtualMachinesRunCommandFuture) result(client VirtualMachinesClient) (rcr RunCommandResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRunCommandFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - rcr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesRunCommandFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if rcr.Response.Response, err = future.GetResult(sender); err == nil && rcr.Response.Response.StatusCode != http.StatusNoContent { - rcr, err = client.RunCommandResponder(rcr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRunCommandFuture", "Result", rcr.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachinesStartFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VirtualMachinesStartFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachinesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachinesStartFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachinesStartFuture.Result. -func (future *VirtualMachinesStartFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesStartFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesStartFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineStatusCodeCount the status code and count of the virtual machine scale set instance view -// status summary. -type VirtualMachineStatusCodeCount struct { - // Code - READ-ONLY; The instance view status code. - Code *string `json:"code,omitempty"` - // Count - READ-ONLY; The number of instances having a particular status code. - Count *int32 `json:"count,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineStatusCodeCount. -func (vmscc VirtualMachineStatusCodeCount) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// VirtualMachinesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VirtualMachinesUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachinesClient) (VirtualMachine, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachinesUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachinesUpdateFuture.Result. -func (future *VirtualMachinesUpdateFuture) result(client VirtualMachinesClient) (VM VirtualMachine, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - VM.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if VM.Response.Response, err = future.GetResult(sender); err == nil && VM.Response.Response.StatusCode != http.StatusNoContent { - VM, err = client.UpdateResponder(VM.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesUpdateFuture", "Result", VM.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachineUpdate describes a Virtual Machine Update. -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 -} - -// VMDiskSecurityProfile specifies the security profile settings for the managed disk.

      NOTE: It -// can only be set for Confidential VMs -type VMDiskSecurityProfile struct { - // SecurityEncryptionType - Specifies the EncryptionType of the managed disk.
      It is set to DiskWithVMGuestState for encryption of the managed disk along with VMGuestState blob, and VMGuestStateOnly for encryption of just the VMGuestState blob.

      NOTE: It can be set for only Confidential VMs. Possible values include: 'VMGuestStateOnly', 'DiskWithVMGuestState' - SecurityEncryptionType SecurityEncryptionTypes `json:"securityEncryptionType,omitempty"` - // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed disk that is used for Customer Managed Key encrypted ConfidentialVM OS Disk and VMGuest blob. - DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` -} - -// VMGalleryApplication specifies the required information to reference a compute gallery application -// version -type VMGalleryApplication struct { - // Tags - Optional, Specifies a passthrough value for more generic context. - Tags *string `json:"tags,omitempty"` - // Order - Optional, Specifies the order in which the packages have to be installed - Order *int32 `json:"order,omitempty"` - // PackageReferenceID - Specifies the GalleryApplicationVersion resource id on the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{application}/versions/{version} - PackageReferenceID *string `json:"packageReferenceId,omitempty"` - // ConfigurationReference - Optional, Specifies the uri to an azure blob that will replace the default configuration for the package if provided - ConfigurationReference *string `json:"configurationReference,omitempty"` - // TreatFailureAsDeploymentFailure - Optional, If true, any failure for any operation in the VmApplication will fail the deployment - TreatFailureAsDeploymentFailure *bool `json:"treatFailureAsDeploymentFailure,omitempty"` - // EnableAutomaticUpgrade - If set to true, when a new Gallery Application version is available in PIR/SIG, it will be automatically updated for the VM/VMSS - EnableAutomaticUpgrade *bool `json:"enableAutomaticUpgrade,omitempty"` -} - -// VMImagesInEdgeZoneListResult the List VmImages in EdgeZone operation response. -type VMImagesInEdgeZoneListResult struct { - autorest.Response `json:"-"` - // Value - The list of VMImages in EdgeZone - Value *[]VirtualMachineImageResource `json:"value,omitempty"` - // NextLink - The URI to fetch the next page of VMImages in EdgeZone. Call ListNext() with this URI to fetch the next page of VmImages. - NextLink *string `json:"nextLink,omitempty"` -} - -// VMScaleSetConvertToSinglePlacementGroupInput ... -type VMScaleSetConvertToSinglePlacementGroupInput struct { - // ActivePlacementGroupID - Id of the placement group in which you want future virtual machine instances to be placed. To query placement group Id, please use Virtual Machine Scale Set VMs - Get API. If not provided, the platform will choose one with maximum number of virtual machine instances. - ActivePlacementGroupID *string `json:"activePlacementGroupId,omitempty"` -} - -// VMSizeProperties specifies VM Size Property settings on the virtual machine. -type VMSizeProperties struct { - // VCPUsAvailable - Specifies the number of vCPUs available for the VM.

      When this property is not specified in the request body the default behavior is to set it to the value of vCPUs available for that VM size exposed in api response of [List all available virtual machine sizes in a region](https://docs.microsoft.com/en-us/rest/api/compute/resource-skus/list) . - VCPUsAvailable *int32 `json:"vCPUsAvailable,omitempty"` - // VCPUsPerCore - Specifies the vCPU to physical core ratio.

      When this property is not specified in the request body the default behavior is set to the value of vCPUsPerCore for the VM Size exposed in api response of [List all available virtual machine sizes in a region](https://docs.microsoft.com/en-us/rest/api/compute/resource-skus/list)

      Setting this property to 1 also means that hyper-threading is disabled. - VCPUsPerCore *int32 `json:"vCPUsPerCore,omitempty"` -} - -// 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. - ProvisionVMAgent *bool `json:"provisionVMAgent,omitempty"` - // EnableAutomaticUpdates - Indicates whether Automatic Updates is enabled for the Windows virtual machine. Default value is true.

      For virtual machine scale sets, this property can be updated and updates will take effect on OS reprovisioning. - EnableAutomaticUpdates *bool `json:"enableAutomaticUpdates,omitempty"` - // TimeZone - Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time".

      Possible values can be [TimeZoneInfo.Id](https://docs.microsoft.com/dotnet/api/system.timezoneinfo.id?#System_TimeZoneInfo_Id) value from time zones returned by [TimeZoneInfo.GetSystemTimeZones](https://docs.microsoft.com/dotnet/api/system.timezoneinfo.getsystemtimezones). - TimeZone *string `json:"timeZone,omitempty"` - // AdditionalUnattendContent - Specifies additional base-64 encoded XML formatted information that can be included in the Unattend.xml file, which is used by Windows Setup. - AdditionalUnattendContent *[]AdditionalUnattendContent `json:"additionalUnattendContent,omitempty"` - // PatchSettings - [Preview Feature] Specifies settings related to VM Guest Patching on Windows. - PatchSettings *PatchSettings `json:"patchSettings,omitempty"` - // WinRM - Specifies the Windows Remote Management listeners. This enables remote Windows PowerShell. - WinRM *WinRMConfiguration `json:"winRM,omitempty"` - // EnableVMAgentPlatformUpdates - Indicates whether VMAgent Platform Updates is enabled for the Windows virtual machine. Default value is false. - EnableVMAgentPlatformUpdates *bool `json:"enableVMAgentPlatformUpdates,omitempty"` -} - -// WindowsParameters input for InstallPatches on a Windows VM, as directly received by the API -type WindowsParameters struct { - // ClassificationsToInclude - The update classifications to select when installing patches for Windows. - ClassificationsToInclude *[]VMGuestPatchClassificationWindows `json:"classificationsToInclude,omitempty"` - // KbNumbersToInclude - Kbs to include in the patch operation - KbNumbersToInclude *[]string `json:"kbNumbersToInclude,omitempty"` - // KbNumbersToExclude - Kbs to exclude in the patch operation - KbNumbersToExclude *[]string `json:"kbNumbersToExclude,omitempty"` - // ExcludeKbsRequiringReboot - Filters out Kbs that don't have an InstallationRebootBehavior of 'NeverReboots' when this is set to true. - ExcludeKbsRequiringReboot *bool `json:"excludeKbsRequiringReboot,omitempty"` - // MaxPatchPublishDate - This is used to install patches that were published on or before this given max published date. - MaxPatchPublishDate *date.Time `json:"maxPatchPublishDate,omitempty"` -} - -// WindowsVMGuestPatchAutomaticByPlatformSettings specifies additional settings to be applied when patch -// mode AutomaticByPlatform is selected in Windows patch settings. -type WindowsVMGuestPatchAutomaticByPlatformSettings struct { - // RebootSetting - Specifies the reboot setting for all AutomaticByPlatform patch installation operations. Possible values include: 'WindowsVMGuestPatchAutomaticByPlatformRebootSettingUnknown', 'WindowsVMGuestPatchAutomaticByPlatformRebootSettingIfRequired', 'WindowsVMGuestPatchAutomaticByPlatformRebootSettingNever', 'WindowsVMGuestPatchAutomaticByPlatformRebootSettingAlways' - RebootSetting WindowsVMGuestPatchAutomaticByPlatformRebootSetting `json:"rebootSetting,omitempty"` -} - -// WinRMConfiguration describes Windows Remote Management configuration of the VM -type WinRMConfiguration struct { - // Listeners - The list of Windows Remote Management listeners - Listeners *[]WinRMListener `json:"listeners,omitempty"` -} - -// WinRMListener describes Protocol and thumbprint of Windows Remote Management listener -type WinRMListener struct { - // Protocol - Specifies the protocol of WinRM listener.

      Possible values are:
      **http**

      **https**. Possible values include: 'HTTP', 'HTTPS' - Protocol ProtocolTypes `json:"protocol,omitempty"` - // 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":""
      }
      To install certificates on a virtual machine it is recommended to use the [Azure Key Vault virtual machine extension for Linux](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux) or the [Azure Key Vault virtual machine extension for Windows](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows). - CertificateURL *string `json:"certificateUrl,omitempty"` -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/operations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/operations.go deleted file mode 100644 index 3f4a51a3..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/operations.go +++ /dev/null @@ -1,98 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// 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 using a custom endpoint. Use this -// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -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) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - 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 - } - - return -} - -// ListPreparer prepares the List request. -func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - const APIVersion = "2022-08-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 client.Send(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, - 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/2022-08-01/compute/proximityplacementgroups.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/proximityplacementgroups.go deleted file mode 100644 index cc7766f7..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/proximityplacementgroups.go +++ /dev/null @@ -1,575 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ProximityPlacementGroupsClient is the compute Client -type ProximityPlacementGroupsClient struct { - BaseClient -} - -// NewProximityPlacementGroupsClient creates an instance of the ProximityPlacementGroupsClient client. -func NewProximityPlacementGroupsClient(subscriptionID string) ProximityPlacementGroupsClient { - return NewProximityPlacementGroupsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewProximityPlacementGroupsClientWithBaseURI creates an instance of the ProximityPlacementGroupsClient client using -// a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign -// clouds, Azure stack). -func NewProximityPlacementGroupsClientWithBaseURI(baseURI string, subscriptionID string) ProximityPlacementGroupsClient { - return ProximityPlacementGroupsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create or update a proximity placement group. -// Parameters: -// resourceGroupName - the name of the resource group. -// proximityPlacementGroupName - the name of the proximity placement group. -// parameters - parameters supplied to the Create Proximity Placement Group operation. -func (client ProximityPlacementGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, parameters ProximityPlacementGroup) (result ProximityPlacementGroup, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, proximityPlacementGroupName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "CreateOrUpdate", resp, "Failure responding to request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ProximityPlacementGroupsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, parameters ProximityPlacementGroup) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "proximityPlacementGroupName": autorest.Encode("path", proximityPlacementGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-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.Compute/proximityPlacementGroups/{proximityPlacementGroupName}", 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 ProximityPlacementGroupsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client ProximityPlacementGroupsClient) CreateOrUpdateResponder(resp *http.Response) (result ProximityPlacementGroup, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete a proximity placement group. -// Parameters: -// resourceGroupName - the name of the resource group. -// proximityPlacementGroupName - the name of the proximity placement group. -func (client ProximityPlacementGroupsClient) Delete(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupsClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, proximityPlacementGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "Delete", resp, "Failure responding to request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ProximityPlacementGroupsClient) DeletePreparer(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "proximityPlacementGroupName": autorest.Encode("path", proximityPlacementGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-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.Compute/proximityPlacementGroups/{proximityPlacementGroupName}", 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 ProximityPlacementGroupsClient) DeleteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client ProximityPlacementGroupsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieves information about a proximity placement group . -// Parameters: -// resourceGroupName - the name of the resource group. -// proximityPlacementGroupName - the name of the proximity placement group. -// includeColocationStatus - includeColocationStatus=true enables fetching the colocation status of all the -// resources in the proximity placement group. -func (client ProximityPlacementGroupsClient) Get(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, includeColocationStatus string) (result ProximityPlacementGroup, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, proximityPlacementGroupName, includeColocationStatus) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ProximityPlacementGroupsClient) GetPreparer(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, includeColocationStatus string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "proximityPlacementGroupName": autorest.Encode("path", proximityPlacementGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(includeColocationStatus) > 0 { - queryParameters["includeColocationStatus"] = autorest.Encode("query", includeColocationStatus) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups/{proximityPlacementGroupName}", 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 ProximityPlacementGroupsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ProximityPlacementGroupsClient) GetResponder(resp *http.Response) (result ProximityPlacementGroup, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByResourceGroup lists all proximity placement groups in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client ProximityPlacementGroupsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ProximityPlacementGroupListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.ppglr.Response.Response != nil { - sc = result.ppglr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.ppglr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.ppglr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.ppglr.hasNextLink() && result.ppglr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client ProximityPlacementGroupsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-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.Compute/proximityPlacementGroups", pathParameters), - autorest.WithQueryParameters(queryParameters)) - 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 ProximityPlacementGroupsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client ProximityPlacementGroupsClient) ListByResourceGroupResponder(resp *http.Response) (result ProximityPlacementGroupListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client ProximityPlacementGroupsClient) listByResourceGroupNextResults(ctx context.Context, lastResults ProximityPlacementGroupListResult) (result ProximityPlacementGroupListResult, err error) { - req, err := lastResults.proximityPlacementGroupListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client ProximityPlacementGroupsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ProximityPlacementGroupListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// ListBySubscription lists all proximity placement groups in a subscription. -func (client ProximityPlacementGroupsClient) ListBySubscription(ctx context.Context) (result ProximityPlacementGroupListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupsClient.ListBySubscription") - defer func() { - sc := -1 - if result.ppglr.Response.Response != nil { - sc = result.ppglr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listBySubscriptionNextResults - req, err := client.ListBySubscriptionPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "ListBySubscription", nil, "Failure preparing request") - return - } - - resp, err := client.ListBySubscriptionSender(req) - if err != nil { - result.ppglr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "ListBySubscription", resp, "Failure sending request") - return - } - - result.ppglr, err = client.ListBySubscriptionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "ListBySubscription", resp, "Failure responding to request") - return - } - if result.ppglr.hasNextLink() && result.ppglr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListBySubscriptionPreparer prepares the ListBySubscription request. -func (client ProximityPlacementGroupsClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/proximityPlacementGroups", 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 ProximityPlacementGroupsClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always -// closes the http.Response Body. -func (client ProximityPlacementGroupsClient) ListBySubscriptionResponder(resp *http.Response) (result ProximityPlacementGroupListResult, err error) { - err = autorest.Respond( - resp, - 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 ProximityPlacementGroupsClient) listBySubscriptionNextResults(ctx context.Context, lastResults ProximityPlacementGroupListResult) (result ProximityPlacementGroupListResult, err error) { - req, err := lastResults.proximityPlacementGroupListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "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, "compute.ProximityPlacementGroupsClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") - } - result, err = client.ListBySubscriptionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. -func (client ProximityPlacementGroupsClient) ListBySubscriptionComplete(ctx context.Context) (result ProximityPlacementGroupListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupsClient.ListBySubscription") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListBySubscription(ctx) - return -} - -// Update update a proximity placement group. -// Parameters: -// resourceGroupName - the name of the resource group. -// proximityPlacementGroupName - the name of the proximity placement group. -// parameters - parameters supplied to the Update Proximity Placement Group operation. -func (client ProximityPlacementGroupsClient) Update(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, parameters ProximityPlacementGroupUpdate) (result ProximityPlacementGroup, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupsClient.Update") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, proximityPlacementGroupName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "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.ProximityPlacementGroupsClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "Update", resp, "Failure responding to request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client ProximityPlacementGroupsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, parameters ProximityPlacementGroupUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "proximityPlacementGroupName": autorest.Encode("path", proximityPlacementGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-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/proximityPlacementGroups/{proximityPlacementGroupName}", 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 ProximityPlacementGroupsClient) UpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client ProximityPlacementGroupsClient) UpdateResponder(resp *http.Response) (result ProximityPlacementGroup, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/resourceskus.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/resourceskus.go deleted file mode 100644 index 35266973..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/resourceskus.go +++ /dev/null @@ -1,153 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ResourceSkusClient is the compute Client -type ResourceSkusClient struct { - BaseClient -} - -// NewResourceSkusClient creates an instance of the ResourceSkusClient client. -func NewResourceSkusClient(subscriptionID string) ResourceSkusClient { - return NewResourceSkusClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewResourceSkusClientWithBaseURI creates an instance of the ResourceSkusClient client using a custom endpoint. Use -// this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewResourceSkusClientWithBaseURI(baseURI string, subscriptionID string) ResourceSkusClient { - return ResourceSkusClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List gets the list of Microsoft.Compute SKUs available for your Subscription. -// Parameters: -// filter - the filter to apply on the operation. Only **location** filter is supported currently. -// includeExtendedLocations - to Include Extended Locations information or not in the response. -func (client ResourceSkusClient) List(ctx context.Context, filter string, includeExtendedLocations string) (result ResourceSkusResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkusClient.List") - defer func() { - sc := -1 - if result.rsr.Response.Response != nil { - sc = result.rsr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, filter, includeExtendedLocations) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ResourceSkusClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.rsr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.ResourceSkusClient", "List", resp, "Failure sending request") - return - } - - result.rsr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ResourceSkusClient", "List", resp, "Failure responding to request") - return - } - if result.rsr.hasNextLink() && result.rsr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ResourceSkusClient) ListPreparer(ctx context.Context, filter string, includeExtendedLocations string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2021-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if len(includeExtendedLocations) > 0 { - queryParameters["includeExtendedLocations"] = autorest.Encode("query", includeExtendedLocations) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/skus", 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 ResourceSkusClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ResourceSkusClient) ListResponder(resp *http.Response) (result ResourceSkusResult, err error) { - err = autorest.Respond( - resp, - 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 ResourceSkusClient) listNextResults(ctx context.Context, lastResults ResourceSkusResult) (result ResourceSkusResult, err error) { - req, err := lastResults.resourceSkusResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.ResourceSkusClient", "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, "compute.ResourceSkusClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ResourceSkusClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ResourceSkusClient) ListComplete(ctx context.Context, filter string, includeExtendedLocations string) (result ResourceSkusResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkusClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, filter, includeExtendedLocations) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/restorepointcollections.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/restorepointcollections.go deleted file mode 100644 index 469f8e2b..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/restorepointcollections.go +++ /dev/null @@ -1,582 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// RestorePointCollectionsClient is the compute Client -type RestorePointCollectionsClient struct { - BaseClient -} - -// NewRestorePointCollectionsClient creates an instance of the RestorePointCollectionsClient client. -func NewRestorePointCollectionsClient(subscriptionID string) RestorePointCollectionsClient { - return NewRestorePointCollectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewRestorePointCollectionsClientWithBaseURI creates an instance of the RestorePointCollectionsClient client using a -// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, -// Azure stack). -func NewRestorePointCollectionsClientWithBaseURI(baseURI string, subscriptionID string) RestorePointCollectionsClient { - return RestorePointCollectionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate the operation to create or update the restore point collection. Please refer to -// https://aka.ms/RestorePoints for more details. When updating a restore point collection, only tags may be modified. -// Parameters: -// resourceGroupName - the name of the resource group. -// restorePointCollectionName - the name of the restore point collection. -// parameters - parameters supplied to the Create or Update restore point collection operation. -func (client RestorePointCollectionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, restorePointCollectionName string, parameters RestorePointCollection) (result RestorePointCollection, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RestorePointCollectionsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, restorePointCollectionName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.RestorePointCollectionsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.RestorePointCollectionsClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.RestorePointCollectionsClient", "CreateOrUpdate", resp, "Failure responding to request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client RestorePointCollectionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, restorePointCollectionName string, parameters RestorePointCollection) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "restorePointCollectionName": autorest.Encode("path", restorePointCollectionName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-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.Compute/restorePointCollections/{restorePointCollectionName}", 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 RestorePointCollectionsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client RestorePointCollectionsClient) CreateOrUpdateResponder(resp *http.Response) (result RestorePointCollection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete the operation to delete the restore point collection. This operation will also delete all the contained -// restore points. -// Parameters: -// resourceGroupName - the name of the resource group. -// restorePointCollectionName - the name of the Restore Point Collection. -func (client RestorePointCollectionsClient) Delete(ctx context.Context, resourceGroupName string, restorePointCollectionName string) (result RestorePointCollectionsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RestorePointCollectionsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, restorePointCollectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.RestorePointCollectionsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.RestorePointCollectionsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client RestorePointCollectionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, restorePointCollectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "restorePointCollectionName": autorest.Encode("path", restorePointCollectionName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-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.Compute/restorePointCollections/{restorePointCollectionName}", 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 RestorePointCollectionsClient) DeleteSender(req *http.Request) (future RestorePointCollectionsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client RestorePointCollectionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get the operation to get the restore point collection. -// Parameters: -// resourceGroupName - the name of the resource group. -// restorePointCollectionName - the name of the restore point collection. -// expand - the expand expression to apply on the operation. If expand=restorePoints, server will return all -// contained restore points in the restorePointCollection. -func (client RestorePointCollectionsClient) Get(ctx context.Context, resourceGroupName string, restorePointCollectionName string, expand RestorePointCollectionExpandOptions) (result RestorePointCollection, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RestorePointCollectionsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, restorePointCollectionName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.RestorePointCollectionsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.RestorePointCollectionsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.RestorePointCollectionsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client RestorePointCollectionsClient) GetPreparer(ctx context.Context, resourceGroupName string, restorePointCollectionName string, expand RestorePointCollectionExpandOptions) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "restorePointCollectionName": autorest.Encode("path", restorePointCollectionName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(string(expand)) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}", 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 RestorePointCollectionsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client RestorePointCollectionsClient) GetResponder(resp *http.Response) (result RestorePointCollection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets the list of restore point collections in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client RestorePointCollectionsClient) List(ctx context.Context, resourceGroupName string) (result RestorePointCollectionListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RestorePointCollectionsClient.List") - defer func() { - sc := -1 - if result.rpclr.Response.Response != nil { - sc = result.rpclr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.RestorePointCollectionsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.rpclr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.RestorePointCollectionsClient", "List", resp, "Failure sending request") - return - } - - result.rpclr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.RestorePointCollectionsClient", "List", resp, "Failure responding to request") - return - } - if result.rpclr.hasNextLink() && result.rpclr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client RestorePointCollectionsClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-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.Compute/restorePointCollections", 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 RestorePointCollectionsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client RestorePointCollectionsClient) ListResponder(resp *http.Response) (result RestorePointCollectionListResult, err error) { - err = autorest.Respond( - resp, - 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 RestorePointCollectionsClient) listNextResults(ctx context.Context, lastResults RestorePointCollectionListResult) (result RestorePointCollectionListResult, err error) { - req, err := lastResults.restorePointCollectionListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.RestorePointCollectionsClient", "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, "compute.RestorePointCollectionsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.RestorePointCollectionsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client RestorePointCollectionsClient) ListComplete(ctx context.Context, resourceGroupName string) (result RestorePointCollectionListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RestorePointCollectionsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName) - return -} - -// ListAll gets the list of restore point collections in the subscription. Use nextLink property in the response to get -// the next page of restore point collections. Do this till nextLink is not null to fetch all the restore point -// collections. -func (client RestorePointCollectionsClient) ListAll(ctx context.Context) (result RestorePointCollectionListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RestorePointCollectionsClient.ListAll") - defer func() { - sc := -1 - if result.rpclr.Response.Response != nil { - sc = result.rpclr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listAllNextResults - req, err := client.ListAllPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.RestorePointCollectionsClient", "ListAll", nil, "Failure preparing request") - return - } - - resp, err := client.ListAllSender(req) - if err != nil { - result.rpclr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.RestorePointCollectionsClient", "ListAll", resp, "Failure sending request") - return - } - - result.rpclr, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.RestorePointCollectionsClient", "ListAll", resp, "Failure responding to request") - return - } - if result.rpclr.hasNextLink() && result.rpclr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListAllPreparer prepares the ListAll request. -func (client RestorePointCollectionsClient) ListAllPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/restorePointCollections", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAllSender sends the ListAll request. The method will close the -// http.Response Body if it receives an error. -func (client RestorePointCollectionsClient) ListAllSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAllResponder handles the response to the ListAll request. The method always -// closes the http.Response Body. -func (client RestorePointCollectionsClient) ListAllResponder(resp *http.Response) (result RestorePointCollectionListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listAllNextResults retrieves the next set of results, if any. -func (client RestorePointCollectionsClient) listAllNextResults(ctx context.Context, lastResults RestorePointCollectionListResult) (result RestorePointCollectionListResult, err error) { - req, err := lastResults.restorePointCollectionListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.RestorePointCollectionsClient", "listAllNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListAllSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.RestorePointCollectionsClient", "listAllNextResults", resp, "Failure sending next results request") - } - result, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.RestorePointCollectionsClient", "listAllNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListAllComplete enumerates all values, automatically crossing page boundaries as required. -func (client RestorePointCollectionsClient) ListAllComplete(ctx context.Context) (result RestorePointCollectionListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RestorePointCollectionsClient.ListAll") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListAll(ctx) - return -} - -// Update the operation to update the restore point collection. -// Parameters: -// resourceGroupName - the name of the resource group. -// restorePointCollectionName - the name of the restore point collection. -// parameters - parameters supplied to the Update restore point collection operation. -func (client RestorePointCollectionsClient) Update(ctx context.Context, resourceGroupName string, restorePointCollectionName string, parameters RestorePointCollectionUpdate) (result RestorePointCollection, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RestorePointCollectionsClient.Update") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, restorePointCollectionName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.RestorePointCollectionsClient", "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.RestorePointCollectionsClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.RestorePointCollectionsClient", "Update", resp, "Failure responding to request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client RestorePointCollectionsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, restorePointCollectionName string, parameters RestorePointCollectionUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "restorePointCollectionName": autorest.Encode("path", restorePointCollectionName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-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/restorePointCollections/{restorePointCollectionName}", 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 RestorePointCollectionsClient) UpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client RestorePointCollectionsClient) UpdateResponder(resp *http.Response) (result RestorePointCollection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/restorepoints.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/restorepoints.go deleted file mode 100644 index 5e00d6ff..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/restorepoints.go +++ /dev/null @@ -1,302 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// RestorePointsClient is the compute Client -type RestorePointsClient struct { - BaseClient -} - -// NewRestorePointsClient creates an instance of the RestorePointsClient client. -func NewRestorePointsClient(subscriptionID string) RestorePointsClient { - return NewRestorePointsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewRestorePointsClientWithBaseURI creates an instance of the RestorePointsClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewRestorePointsClientWithBaseURI(baseURI string, subscriptionID string) RestorePointsClient { - return RestorePointsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Create the operation to create the restore point. Updating properties of an existing restore point is not allowed -// Parameters: -// resourceGroupName - the name of the resource group. -// restorePointCollectionName - the name of the restore point collection. -// restorePointName - the name of the restore point. -// parameters - parameters supplied to the Create restore point operation. -func (client RestorePointsClient) Create(ctx context.Context, resourceGroupName string, restorePointCollectionName string, restorePointName string, parameters RestorePoint) (result RestorePointsCreateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RestorePointsClient.Create") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.RestorePointProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.RestorePointProperties.SourceMetadata", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.RestorePointProperties.SourceMetadata.StorageProfile", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.RestorePointProperties.SourceMetadata.StorageProfile.OsDisk", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.RestorePointProperties.SourceMetadata.StorageProfile.OsDisk.EncryptionSettings", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.RestorePointProperties.SourceMetadata.StorageProfile.OsDisk.EncryptionSettings.DiskEncryptionKey", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.RestorePointProperties.SourceMetadata.StorageProfile.OsDisk.EncryptionSettings.DiskEncryptionKey.SecretURL", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.RestorePointProperties.SourceMetadata.StorageProfile.OsDisk.EncryptionSettings.DiskEncryptionKey.SourceVault", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "parameters.RestorePointProperties.SourceMetadata.StorageProfile.OsDisk.EncryptionSettings.KeyEncryptionKey", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.RestorePointProperties.SourceMetadata.StorageProfile.OsDisk.EncryptionSettings.KeyEncryptionKey.KeyURL", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.RestorePointProperties.SourceMetadata.StorageProfile.OsDisk.EncryptionSettings.KeyEncryptionKey.SourceVault", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}, - }}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("compute.RestorePointsClient", "Create", err.Error()) - } - - req, err := client.CreatePreparer(ctx, resourceGroupName, restorePointCollectionName, restorePointName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.RestorePointsClient", "Create", nil, "Failure preparing request") - return - } - - result, err = client.CreateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.RestorePointsClient", "Create", result.Response(), "Failure sending request") - return - } - - return -} - -// CreatePreparer prepares the Create request. -func (client RestorePointsClient) CreatePreparer(ctx context.Context, resourceGroupName string, restorePointCollectionName string, restorePointName string, parameters RestorePoint) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "restorePointCollectionName": autorest.Encode("path", restorePointCollectionName), - "restorePointName": autorest.Encode("path", restorePointName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-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.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{restorePointName}", pathParameters), - autorest.WithJSON(parameters), - 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 RestorePointsClient) CreateSender(req *http.Request) (future RestorePointsCreateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateResponder handles the response to the Create request. The method always -// closes the http.Response Body. -func (client RestorePointsClient) CreateResponder(resp *http.Response) (result RestorePoint, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete the operation to delete the restore point. -// Parameters: -// resourceGroupName - the name of the resource group. -// restorePointCollectionName - the name of the Restore Point Collection. -// restorePointName - the name of the restore point. -func (client RestorePointsClient) Delete(ctx context.Context, resourceGroupName string, restorePointCollectionName string, restorePointName string) (result RestorePointsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RestorePointsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, restorePointCollectionName, restorePointName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.RestorePointsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.RestorePointsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client RestorePointsClient) DeletePreparer(ctx context.Context, resourceGroupName string, restorePointCollectionName string, restorePointName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "restorePointCollectionName": autorest.Encode("path", restorePointCollectionName), - "restorePointName": autorest.Encode("path", restorePointName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-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.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{restorePointName}", 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 RestorePointsClient) DeleteSender(req *http.Request) (future RestorePointsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client RestorePointsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get the operation to get the restore point. -// Parameters: -// resourceGroupName - the name of the resource group. -// restorePointCollectionName - the name of the restore point collection. -// restorePointName - the name of the restore point. -// expand - the expand expression to apply on the operation. 'InstanceView' retrieves information about the -// run-time state of a restore point. -func (client RestorePointsClient) Get(ctx context.Context, resourceGroupName string, restorePointCollectionName string, restorePointName string, expand RestorePointExpandOptions) (result RestorePoint, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RestorePointsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, restorePointCollectionName, restorePointName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.RestorePointsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.RestorePointsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.RestorePointsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client RestorePointsClient) GetPreparer(ctx context.Context, resourceGroupName string, restorePointCollectionName string, restorePointName string, expand RestorePointExpandOptions) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "restorePointCollectionName": autorest.Encode("path", restorePointCollectionName), - "restorePointName": autorest.Encode("path", restorePointName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(string(expand)) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{restorePointName}", 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 RestorePointsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client RestorePointsClient) GetResponder(resp *http.Response) (result RestorePoint, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/sharedgalleries.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/sharedgalleries.go deleted file mode 100644 index e15a36d7..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/sharedgalleries.go +++ /dev/null @@ -1,227 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// SharedGalleriesClient is the compute Client -type SharedGalleriesClient struct { - BaseClient -} - -// NewSharedGalleriesClient creates an instance of the SharedGalleriesClient client. -func NewSharedGalleriesClient(subscriptionID string) SharedGalleriesClient { - return NewSharedGalleriesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewSharedGalleriesClientWithBaseURI creates an instance of the SharedGalleriesClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewSharedGalleriesClientWithBaseURI(baseURI string, subscriptionID string) SharedGalleriesClient { - return SharedGalleriesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get get a shared gallery by subscription id or tenant id. -// Parameters: -// location - resource location. -// galleryUniqueName - the unique name of the Shared Gallery. -func (client SharedGalleriesClient) Get(ctx context.Context, location string, galleryUniqueName string) (result SharedGallery, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SharedGalleriesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, location, galleryUniqueName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SharedGalleriesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.SharedGalleriesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SharedGalleriesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client SharedGalleriesClient) GetPreparer(ctx context.Context, location string, galleryUniqueName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryUniqueName": autorest.Encode("path", galleryUniqueName), - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}", 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 SharedGalleriesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client SharedGalleriesClient) GetResponder(resp *http.Response) (result SharedGallery, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List list shared galleries by subscription id or tenant id. -// Parameters: -// location - resource location. -// sharedTo - the query parameter to decide what shared galleries to fetch when doing listing operations. -func (client SharedGalleriesClient) List(ctx context.Context, location string, sharedTo SharedToValues) (result SharedGalleryListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SharedGalleriesClient.List") - defer func() { - sc := -1 - if result.sgl.Response.Response != nil { - sc = result.sgl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, location, sharedTo) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SharedGalleriesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.sgl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.SharedGalleriesClient", "List", resp, "Failure sending request") - return - } - - result.sgl, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SharedGalleriesClient", "List", resp, "Failure responding to request") - return - } - if result.sgl.hasNextLink() && result.sgl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client SharedGalleriesClient) ListPreparer(ctx context.Context, location string, sharedTo SharedToValues) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(string(sharedTo)) > 0 { - queryParameters["sharedTo"] = autorest.Encode("query", sharedTo) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries", 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 SharedGalleriesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client SharedGalleriesClient) ListResponder(resp *http.Response) (result SharedGalleryList, err error) { - err = autorest.Respond( - resp, - 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 SharedGalleriesClient) listNextResults(ctx context.Context, lastResults SharedGalleryList) (result SharedGalleryList, err error) { - req, err := lastResults.sharedGalleryListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.SharedGalleriesClient", "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, "compute.SharedGalleriesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SharedGalleriesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client SharedGalleriesClient) ListComplete(ctx context.Context, location string, sharedTo SharedToValues) (result SharedGalleryListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SharedGalleriesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, location, sharedTo) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/sharedgalleryimages.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/sharedgalleryimages.go deleted file mode 100644 index 70c7cde6..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/sharedgalleryimages.go +++ /dev/null @@ -1,233 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// SharedGalleryImagesClient is the compute Client -type SharedGalleryImagesClient struct { - BaseClient -} - -// NewSharedGalleryImagesClient creates an instance of the SharedGalleryImagesClient client. -func NewSharedGalleryImagesClient(subscriptionID string) SharedGalleryImagesClient { - return NewSharedGalleryImagesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewSharedGalleryImagesClientWithBaseURI creates an instance of the SharedGalleryImagesClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewSharedGalleryImagesClientWithBaseURI(baseURI string, subscriptionID string) SharedGalleryImagesClient { - return SharedGalleryImagesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get get a shared gallery image by subscription id or tenant id. -// Parameters: -// location - resource location. -// galleryUniqueName - the unique name of the Shared Gallery. -// galleryImageName - the name of the Shared Gallery Image Definition from which the Image Versions are to be -// listed. -func (client SharedGalleryImagesClient) Get(ctx context.Context, location string, galleryUniqueName string, galleryImageName string) (result SharedGalleryImage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SharedGalleryImagesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, location, galleryUniqueName, galleryImageName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SharedGalleryImagesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.SharedGalleryImagesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SharedGalleryImagesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client SharedGalleryImagesClient) GetPreparer(ctx context.Context, location string, galleryUniqueName string, galleryImageName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryImageName": autorest.Encode("path", galleryImageName), - "galleryUniqueName": autorest.Encode("path", galleryUniqueName), - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}/images/{galleryImageName}", 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 SharedGalleryImagesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client SharedGalleryImagesClient) GetResponder(resp *http.Response) (result SharedGalleryImage, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List list shared gallery images by subscription id or tenant id. -// Parameters: -// location - resource location. -// galleryUniqueName - the unique name of the Shared Gallery. -// sharedTo - the query parameter to decide what shared galleries to fetch when doing listing operations. -func (client SharedGalleryImagesClient) List(ctx context.Context, location string, galleryUniqueName string, sharedTo SharedToValues) (result SharedGalleryImageListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SharedGalleryImagesClient.List") - defer func() { - sc := -1 - if result.sgil.Response.Response != nil { - sc = result.sgil.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, location, galleryUniqueName, sharedTo) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SharedGalleryImagesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.sgil.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.SharedGalleryImagesClient", "List", resp, "Failure sending request") - return - } - - result.sgil, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SharedGalleryImagesClient", "List", resp, "Failure responding to request") - return - } - if result.sgil.hasNextLink() && result.sgil.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client SharedGalleryImagesClient) ListPreparer(ctx context.Context, location string, galleryUniqueName string, sharedTo SharedToValues) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryUniqueName": autorest.Encode("path", galleryUniqueName), - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(string(sharedTo)) > 0 { - queryParameters["sharedTo"] = autorest.Encode("query", sharedTo) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}/images", 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 SharedGalleryImagesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client SharedGalleryImagesClient) ListResponder(resp *http.Response) (result SharedGalleryImageList, err error) { - err = autorest.Respond( - resp, - 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 SharedGalleryImagesClient) listNextResults(ctx context.Context, lastResults SharedGalleryImageList) (result SharedGalleryImageList, err error) { - req, err := lastResults.sharedGalleryImageListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.SharedGalleryImagesClient", "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, "compute.SharedGalleryImagesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SharedGalleryImagesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client SharedGalleryImagesClient) ListComplete(ctx context.Context, location string, galleryUniqueName string, sharedTo SharedToValues) (result SharedGalleryImageListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SharedGalleryImagesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, location, galleryUniqueName, sharedTo) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/sharedgalleryimageversions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/sharedgalleryimageversions.go deleted file mode 100644 index ea3a76bb..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/sharedgalleryimageversions.go +++ /dev/null @@ -1,240 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// SharedGalleryImageVersionsClient is the compute Client -type SharedGalleryImageVersionsClient struct { - BaseClient -} - -// NewSharedGalleryImageVersionsClient creates an instance of the SharedGalleryImageVersionsClient client. -func NewSharedGalleryImageVersionsClient(subscriptionID string) SharedGalleryImageVersionsClient { - return NewSharedGalleryImageVersionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewSharedGalleryImageVersionsClientWithBaseURI creates an instance of the SharedGalleryImageVersionsClient client -// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign -// clouds, Azure stack). -func NewSharedGalleryImageVersionsClientWithBaseURI(baseURI string, subscriptionID string) SharedGalleryImageVersionsClient { - return SharedGalleryImageVersionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get get a shared gallery image version by subscription id or tenant id. -// Parameters: -// location - resource location. -// galleryUniqueName - the unique name of the Shared Gallery. -// galleryImageName - the name of the Shared Gallery Image Definition from which the Image Versions are to be -// listed. -// galleryImageVersionName - the name of the gallery image version to be created. Needs to follow semantic -// version name pattern: The allowed characters are digit and period. Digits must be within the range of a -// 32-bit integer. Format: .. -func (client SharedGalleryImageVersionsClient) Get(ctx context.Context, location string, galleryUniqueName string, galleryImageName string, galleryImageVersionName string) (result SharedGalleryImageVersion, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SharedGalleryImageVersionsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, location, galleryUniqueName, galleryImageName, galleryImageVersionName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SharedGalleryImageVersionsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.SharedGalleryImageVersionsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SharedGalleryImageVersionsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client SharedGalleryImageVersionsClient) GetPreparer(ctx context.Context, location string, galleryUniqueName string, galleryImageName string, galleryImageVersionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryImageName": autorest.Encode("path", galleryImageName), - "galleryImageVersionName": autorest.Encode("path", galleryImageVersionName), - "galleryUniqueName": autorest.Encode("path", galleryUniqueName), - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}/images/{galleryImageName}/versions/{galleryImageVersionName}", 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 SharedGalleryImageVersionsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client SharedGalleryImageVersionsClient) GetResponder(resp *http.Response) (result SharedGalleryImageVersion, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List list shared gallery image versions by subscription id or tenant id. -// Parameters: -// location - resource location. -// galleryUniqueName - the unique name of the Shared Gallery. -// galleryImageName - the name of the Shared Gallery Image Definition from which the Image Versions are to be -// listed. -// sharedTo - the query parameter to decide what shared galleries to fetch when doing listing operations. -func (client SharedGalleryImageVersionsClient) List(ctx context.Context, location string, galleryUniqueName string, galleryImageName string, sharedTo SharedToValues) (result SharedGalleryImageVersionListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SharedGalleryImageVersionsClient.List") - defer func() { - sc := -1 - if result.sgivl.Response.Response != nil { - sc = result.sgivl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, location, galleryUniqueName, galleryImageName, sharedTo) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SharedGalleryImageVersionsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.sgivl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.SharedGalleryImageVersionsClient", "List", resp, "Failure sending request") - return - } - - result.sgivl, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SharedGalleryImageVersionsClient", "List", resp, "Failure responding to request") - return - } - if result.sgivl.hasNextLink() && result.sgivl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client SharedGalleryImageVersionsClient) ListPreparer(ctx context.Context, location string, galleryUniqueName string, galleryImageName string, sharedTo SharedToValues) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryImageName": autorest.Encode("path", galleryImageName), - "galleryUniqueName": autorest.Encode("path", galleryUniqueName), - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(string(sharedTo)) > 0 { - queryParameters["sharedTo"] = autorest.Encode("query", sharedTo) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}/images/{galleryImageName}/versions", 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 SharedGalleryImageVersionsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client SharedGalleryImageVersionsClient) ListResponder(resp *http.Response) (result SharedGalleryImageVersionList, err error) { - err = autorest.Respond( - resp, - 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 SharedGalleryImageVersionsClient) listNextResults(ctx context.Context, lastResults SharedGalleryImageVersionList) (result SharedGalleryImageVersionList, err error) { - req, err := lastResults.sharedGalleryImageVersionListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.SharedGalleryImageVersionsClient", "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, "compute.SharedGalleryImageVersionsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SharedGalleryImageVersionsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client SharedGalleryImageVersionsClient) ListComplete(ctx context.Context, location string, galleryUniqueName string, galleryImageName string, sharedTo SharedToValues) (result SharedGalleryImageVersionListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SharedGalleryImageVersionsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, location, galleryUniqueName, galleryImageName, sharedTo) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/snapshots.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/snapshots.go deleted file mode 100644 index 54eb26c5..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/snapshots.go +++ /dev/null @@ -1,777 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// SnapshotsClient is the compute Client -type SnapshotsClient struct { - BaseClient -} - -// NewSnapshotsClient creates an instance of the SnapshotsClient client. -func NewSnapshotsClient(subscriptionID string) SnapshotsClient { - return NewSnapshotsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewSnapshotsClientWithBaseURI creates an instance of the SnapshotsClient client using a custom endpoint. Use this -// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewSnapshotsClientWithBaseURI(baseURI string, subscriptionID string) SnapshotsClient { - return SnapshotsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a snapshot. -// Parameters: -// resourceGroupName - the name of the resource group. -// snapshotName - 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 - 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 tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: snapshot, - Constraints: []validation.Constraint{{Target: "snapshot.SnapshotProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "snapshot.SnapshotProperties.PurchasePlan", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "snapshot.SnapshotProperties.PurchasePlan.Publisher", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "snapshot.SnapshotProperties.PurchasePlan.Name", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "snapshot.SnapshotProperties.PurchasePlan.Product", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "snapshot.SnapshotProperties.CreationData", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "snapshot.SnapshotProperties.EncryptionSettingsCollection", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "snapshot.SnapshotProperties.EncryptionSettingsCollection.Enabled", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "snapshot.SnapshotProperties.CopyCompletionError", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "snapshot.SnapshotProperties.CopyCompletionError.ErrorCode", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "snapshot.SnapshotProperties.CopyCompletionError.ErrorMessage", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}}}}); err != nil { - return result, validation.NewError("compute.SnapshotsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, snapshotName, snapshot) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client SnapshotsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, snapshotName string, snapshot Snapshot) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "snapshotName": autorest.Encode("path", snapshotName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-02" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - snapshot.ManagedBy = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}", pathParameters), - autorest.WithJSON(snapshot), - 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 SnapshotsClient) CreateOrUpdateSender(req *http.Request) (future SnapshotsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client SnapshotsClient) CreateOrUpdateResponder(resp *http.Response) (result Snapshot, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a snapshot. -// Parameters: -// resourceGroupName - the name of the resource group. -// snapshotName - 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) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, snapshotName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client SnapshotsClient) DeletePreparer(ctx context.Context, resourceGroupName string, snapshotName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "snapshotName": autorest.Encode("path", snapshotName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-02" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}", 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 SnapshotsClient) DeleteSender(req *http.Request) (future SnapshotsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client SnapshotsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets information about a snapshot. -// Parameters: -// resourceGroupName - the name of the resource group. -// snapshotName - 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) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, snapshotName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client SnapshotsClient) GetPreparer(ctx context.Context, resourceGroupName string, snapshotName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "snapshotName": autorest.Encode("path", snapshotName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-02" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}", 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 SnapshotsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client SnapshotsClient) GetResponder(resp *http.Response) (result Snapshot, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GrantAccess grants access to a snapshot. -// Parameters: -// resourceGroupName - the name of the resource group. -// snapshotName - 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 - 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 tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.GrantAccess") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - 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.NewError("compute.SnapshotsClient", "GrantAccess", err.Error()) - } - - req, err := client.GrantAccessPreparer(ctx, resourceGroupName, snapshotName, grantAccessData) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "GrantAccess", nil, "Failure preparing request") - return - } - - result, err = client.GrantAccessSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "GrantAccess", result.Response(), "Failure sending request") - return - } - - return -} - -// GrantAccessPreparer prepares the GrantAccess request. -func (client SnapshotsClient) GrantAccessPreparer(ctx context.Context, resourceGroupName string, snapshotName string, grantAccessData GrantAccessData) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "snapshotName": autorest.Encode("path", snapshotName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-02" - 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.Compute/snapshots/{snapshotName}/beginGetAccess", pathParameters), - autorest.WithJSON(grantAccessData), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GrantAccessSender sends the GrantAccess request. The method will close the -// http.Response Body if it receives an error. -func (client SnapshotsClient) GrantAccessSender(req *http.Request) (future SnapshotsGrantAccessFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// GrantAccessResponder handles the response to the GrantAccess request. The method always -// closes the http.Response Body. -func (client SnapshotsClient) GrantAccessResponder(resp *http.Response) (result AccessURI, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists snapshots under a subscription. -func (client SnapshotsClient) List(ctx context.Context) (result SnapshotListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.List") - defer func() { - sc := -1 - if result.sl.Response.Response != nil { - sc = result.sl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.sl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "List", resp, "Failure sending request") - return - } - - result.sl, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "List", resp, "Failure responding to request") - return - } - if result.sl.hasNextLink() && result.sl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client SnapshotsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-02" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/snapshots", 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 SnapshotsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client SnapshotsClient) ListResponder(resp *http.Response) (result SnapshotList, err error) { - err = autorest.Respond( - resp, - 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 SnapshotsClient) listNextResults(ctx context.Context, lastResults SnapshotList) (result SnapshotList, err error) { - req, err := lastResults.snapshotListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.SnapshotsClient", "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, "compute.SnapshotsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client SnapshotsClient) ListComplete(ctx context.Context) (result SnapshotListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} - -// ListByResourceGroup lists snapshots under a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client SnapshotsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result SnapshotListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.sl.Response.Response != nil { - sc = result.sl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.sl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.sl, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.sl.hasNextLink() && result.sl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client SnapshotsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-02" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots", pathParameters), - autorest.WithQueryParameters(queryParameters)) - 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 SnapshotsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client SnapshotsClient) ListByResourceGroupResponder(resp *http.Response) (result SnapshotList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client SnapshotsClient) listByResourceGroupNextResults(ctx context.Context, lastResults SnapshotList) (result SnapshotList, err error) { - req, err := lastResults.snapshotListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.SnapshotsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.SnapshotsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client SnapshotsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result SnapshotListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// RevokeAccess revokes access to a snapshot. -// Parameters: -// resourceGroupName - the name of the resource group. -// snapshotName - 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) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.RevokeAccess") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.RevokeAccessPreparer(ctx, resourceGroupName, snapshotName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "RevokeAccess", nil, "Failure preparing request") - return - } - - result, err = client.RevokeAccessSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "RevokeAccess", result.Response(), "Failure sending request") - return - } - - return -} - -// RevokeAccessPreparer prepares the RevokeAccess request. -func (client SnapshotsClient) RevokeAccessPreparer(ctx context.Context, resourceGroupName string, snapshotName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "snapshotName": autorest.Encode("path", snapshotName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-02" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/endGetAccess", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RevokeAccessSender sends the RevokeAccess request. The method will close the -// http.Response Body if it receives an error. -func (client SnapshotsClient) RevokeAccessSender(req *http.Request) (future SnapshotsRevokeAccessFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// RevokeAccessResponder handles the response to the RevokeAccess request. The method always -// closes the http.Response Body. -func (client SnapshotsClient) RevokeAccessResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Update updates (patches) a snapshot. -// Parameters: -// resourceGroupName - the name of the resource group. -// snapshotName - 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 - 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) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, snapshotName, snapshot) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client SnapshotsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, snapshotName string, snapshot SnapshotUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "snapshotName": autorest.Encode("path", snapshotName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-02" - 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/snapshots/{snapshotName}", pathParameters), - autorest.WithJSON(snapshot), - 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 SnapshotsClient) UpdateSender(req *http.Request) (future SnapshotsUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client SnapshotsClient) UpdateResponder(resp *http.Response) (result Snapshot, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - 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/2022-08-01/compute/sshpublickeys.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/sshpublickeys.go deleted file mode 100644 index f293af11..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/sshpublickeys.go +++ /dev/null @@ -1,649 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// SSHPublicKeysClient is the compute Client -type SSHPublicKeysClient struct { - BaseClient -} - -// NewSSHPublicKeysClient creates an instance of the SSHPublicKeysClient client. -func NewSSHPublicKeysClient(subscriptionID string) SSHPublicKeysClient { - return NewSSHPublicKeysClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewSSHPublicKeysClientWithBaseURI creates an instance of the SSHPublicKeysClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewSSHPublicKeysClientWithBaseURI(baseURI string, subscriptionID string) SSHPublicKeysClient { - return SSHPublicKeysClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Create creates a new SSH public key resource. -// Parameters: -// resourceGroupName - the name of the resource group. -// SSHPublicKeyName - the name of the SSH public key. -// parameters - parameters supplied to create the SSH public key. -func (client SSHPublicKeysClient) Create(ctx context.Context, resourceGroupName string, SSHPublicKeyName string, parameters SSHPublicKeyResource) (result SSHPublicKeyResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SSHPublicKeysClient.Create") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreatePreparer(ctx, resourceGroupName, SSHPublicKeyName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "Create", nil, "Failure preparing request") - return - } - - resp, err := client.CreateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "Create", resp, "Failure sending request") - return - } - - result, err = client.CreateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "Create", resp, "Failure responding to request") - return - } - - return -} - -// CreatePreparer prepares the Create request. -func (client SSHPublicKeysClient) CreatePreparer(ctx context.Context, resourceGroupName string, SSHPublicKeyName string, parameters SSHPublicKeyResource) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "sshPublicKeyName": autorest.Encode("path", SSHPublicKeyName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-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.Compute/sshPublicKeys/{sshPublicKeyName}", pathParameters), - autorest.WithJSON(parameters), - 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 SSHPublicKeysClient) CreateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateResponder handles the response to the Create request. The method always -// closes the http.Response Body. -func (client SSHPublicKeysClient) CreateResponder(resp *http.Response) (result SSHPublicKeyResource, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete an SSH public key. -// Parameters: -// resourceGroupName - the name of the resource group. -// SSHPublicKeyName - the name of the SSH public key. -func (client SSHPublicKeysClient) Delete(ctx context.Context, resourceGroupName string, SSHPublicKeyName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SSHPublicKeysClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, SSHPublicKeyName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "Delete", resp, "Failure responding to request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client SSHPublicKeysClient) DeletePreparer(ctx context.Context, resourceGroupName string, SSHPublicKeyName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "sshPublicKeyName": autorest.Encode("path", SSHPublicKeyName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-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.Compute/sshPublicKeys/{sshPublicKeyName}", 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 SSHPublicKeysClient) DeleteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client SSHPublicKeysClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// GenerateKeyPair generates and returns a public/private key pair and populates the SSH public key resource with the -// public key. The length of the key will be 3072 bits. This operation can only be performed once per SSH public key -// resource. -// Parameters: -// resourceGroupName - the name of the resource group. -// SSHPublicKeyName - the name of the SSH public key. -func (client SSHPublicKeysClient) GenerateKeyPair(ctx context.Context, resourceGroupName string, SSHPublicKeyName string) (result SSHPublicKeyGenerateKeyPairResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SSHPublicKeysClient.GenerateKeyPair") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GenerateKeyPairPreparer(ctx, resourceGroupName, SSHPublicKeyName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "GenerateKeyPair", nil, "Failure preparing request") - return - } - - resp, err := client.GenerateKeyPairSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "GenerateKeyPair", resp, "Failure sending request") - return - } - - result, err = client.GenerateKeyPairResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "GenerateKeyPair", resp, "Failure responding to request") - return - } - - return -} - -// GenerateKeyPairPreparer prepares the GenerateKeyPair request. -func (client SSHPublicKeysClient) GenerateKeyPairPreparer(ctx context.Context, resourceGroupName string, SSHPublicKeyName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "sshPublicKeyName": autorest.Encode("path", SSHPublicKeyName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-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.Compute/sshPublicKeys/{sshPublicKeyName}/generateKeyPair", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GenerateKeyPairSender sends the GenerateKeyPair request. The method will close the -// http.Response Body if it receives an error. -func (client SSHPublicKeysClient) GenerateKeyPairSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GenerateKeyPairResponder handles the response to the GenerateKeyPair request. The method always -// closes the http.Response Body. -func (client SSHPublicKeysClient) GenerateKeyPairResponder(resp *http.Response) (result SSHPublicKeyGenerateKeyPairResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Get retrieves information about an SSH public key. -// Parameters: -// resourceGroupName - the name of the resource group. -// SSHPublicKeyName - the name of the SSH public key. -func (client SSHPublicKeysClient) Get(ctx context.Context, resourceGroupName string, SSHPublicKeyName string) (result SSHPublicKeyResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SSHPublicKeysClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, SSHPublicKeyName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client SSHPublicKeysClient) GetPreparer(ctx context.Context, resourceGroupName string, SSHPublicKeyName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "sshPublicKeyName": autorest.Encode("path", SSHPublicKeyName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-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.Compute/sshPublicKeys/{sshPublicKeyName}", 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 SSHPublicKeysClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client SSHPublicKeysClient) GetResponder(resp *http.Response) (result SSHPublicKeyResource, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByResourceGroup lists all of the SSH public keys in the specified resource group. Use the nextLink property in -// the response to get the next page of SSH public keys. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client SSHPublicKeysClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result SSHPublicKeysGroupListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SSHPublicKeysClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.spkglr.Response.Response != nil { - sc = result.spkglr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.spkglr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.spkglr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.spkglr.hasNextLink() && result.spkglr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client SSHPublicKeysClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-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.Compute/sshPublicKeys", pathParameters), - autorest.WithQueryParameters(queryParameters)) - 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 SSHPublicKeysClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client SSHPublicKeysClient) ListByResourceGroupResponder(resp *http.Response) (result SSHPublicKeysGroupListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client SSHPublicKeysClient) listByResourceGroupNextResults(ctx context.Context, lastResults SSHPublicKeysGroupListResult) (result SSHPublicKeysGroupListResult, err error) { - req, err := lastResults.sSHPublicKeysGroupListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client SSHPublicKeysClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result SSHPublicKeysGroupListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SSHPublicKeysClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// ListBySubscription lists all of the SSH public keys in the subscription. Use the nextLink property in the response -// to get the next page of SSH public keys. -func (client SSHPublicKeysClient) ListBySubscription(ctx context.Context) (result SSHPublicKeysGroupListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SSHPublicKeysClient.ListBySubscription") - defer func() { - sc := -1 - if result.spkglr.Response.Response != nil { - sc = result.spkglr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listBySubscriptionNextResults - req, err := client.ListBySubscriptionPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "ListBySubscription", nil, "Failure preparing request") - return - } - - resp, err := client.ListBySubscriptionSender(req) - if err != nil { - result.spkglr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "ListBySubscription", resp, "Failure sending request") - return - } - - result.spkglr, err = client.ListBySubscriptionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "ListBySubscription", resp, "Failure responding to request") - return - } - if result.spkglr.hasNextLink() && result.spkglr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListBySubscriptionPreparer prepares the ListBySubscription request. -func (client SSHPublicKeysClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/sshPublicKeys", 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 SSHPublicKeysClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always -// closes the http.Response Body. -func (client SSHPublicKeysClient) ListBySubscriptionResponder(resp *http.Response) (result SSHPublicKeysGroupListResult, err error) { - err = autorest.Respond( - resp, - 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 SSHPublicKeysClient) listBySubscriptionNextResults(ctx context.Context, lastResults SSHPublicKeysGroupListResult) (result SSHPublicKeysGroupListResult, err error) { - req, err := lastResults.sSHPublicKeysGroupListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "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, "compute.SSHPublicKeysClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") - } - result, err = client.ListBySubscriptionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. -func (client SSHPublicKeysClient) ListBySubscriptionComplete(ctx context.Context) (result SSHPublicKeysGroupListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SSHPublicKeysClient.ListBySubscription") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListBySubscription(ctx) - return -} - -// Update updates a new SSH public key resource. -// Parameters: -// resourceGroupName - the name of the resource group. -// SSHPublicKeyName - the name of the SSH public key. -// parameters - parameters supplied to update the SSH public key. -func (client SSHPublicKeysClient) Update(ctx context.Context, resourceGroupName string, SSHPublicKeyName string, parameters SSHPublicKeyUpdateResource) (result SSHPublicKeyResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SSHPublicKeysClient.Update") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, SSHPublicKeyName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "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.SSHPublicKeysClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "Update", resp, "Failure responding to request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client SSHPublicKeysClient) UpdatePreparer(ctx context.Context, resourceGroupName string, SSHPublicKeyName string, parameters SSHPublicKeyUpdateResource) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "sshPublicKeyName": autorest.Encode("path", SSHPublicKeyName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-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/sshPublicKeys/{sshPublicKeyName}", 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 SSHPublicKeysClient) UpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client SSHPublicKeysClient) UpdateResponder(resp *http.Response) (result SSHPublicKeyResource, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/usage.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/usage.go deleted file mode 100644 index 8af0c7de..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/usage.go +++ /dev/null @@ -1,155 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// UsageClient is the compute Client -type UsageClient struct { - BaseClient -} - -// NewUsageClient creates an instance of the UsageClient client. -func NewUsageClient(subscriptionID string) UsageClient { - return NewUsageClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewUsageClientWithBaseURI creates an instance of the UsageClient client using a custom endpoint. Use this when -// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewUsageClientWithBaseURI(baseURI string, subscriptionID string) UsageClient { - return UsageClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List gets, for the specified location, the current compute resource usage information as well as the limits for -// compute resources under the subscription. -// Parameters: -// location - the location for which resource usage is queried. -func (client UsageClient) List(ctx context.Context, location string) (result ListUsagesResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/UsageClient.List") - defer func() { - sc := -1 - if result.lur.Response.Response != nil { - sc = result.lur.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - 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.NewError("compute.UsageClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, location) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.UsageClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.lur.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.UsageClient", "List", resp, "Failure sending request") - return - } - - result.lur, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.UsageClient", "List", resp, "Failure responding to request") - return - } - if result.lur.hasNextLink() && result.lur.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client UsageClient) ListPreparer(ctx context.Context, location string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/usages", 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 UsageClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client UsageClient) ListResponder(resp *http.Response) (result ListUsagesResult, err error) { - err = autorest.Respond( - resp, - 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 UsageClient) listNextResults(ctx context.Context, lastResults ListUsagesResult) (result ListUsagesResult, err error) { - req, err := lastResults.listUsagesResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.UsageClient", "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, "compute.UsageClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.UsageClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client UsageClient) ListComplete(ctx context.Context, location string) (result ListUsagesResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/UsageClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, location) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/version.go deleted file mode 100644 index d7dcad9c..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/version.go +++ /dev/null @@ -1,19 +0,0 @@ -package compute - -import "github.com/Azure/azure-sdk-for-go/version" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -// UserAgent returns the UserAgent string to use when sending http.Requests. -func UserAgent() string { - return "Azure-SDK-For-Go/" + Version() + " compute/2022-08-01" -} - -// Version returns the semantic version (see http://semver.org) of the client. -func Version() string { - return version.Number -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachineextensionimages.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachineextensionimages.go deleted file mode 100644 index 5ebc7b48..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachineextensionimages.go +++ /dev/null @@ -1,270 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualMachineExtensionImagesClient is the compute Client -type VirtualMachineExtensionImagesClient struct { - BaseClient -} - -// NewVirtualMachineExtensionImagesClient creates an instance of the VirtualMachineExtensionImagesClient client. -func NewVirtualMachineExtensionImagesClient(subscriptionID string) VirtualMachineExtensionImagesClient { - return NewVirtualMachineExtensionImagesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualMachineExtensionImagesClientWithBaseURI creates an instance of the VirtualMachineExtensionImagesClient -// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI -// (sovereign clouds, Azure stack). -func NewVirtualMachineExtensionImagesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineExtensionImagesClient { - return VirtualMachineExtensionImagesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get gets a virtual machine extension image. -// Parameters: -// location - the name of a supported Azure region. -func (client VirtualMachineExtensionImagesClient) Get(ctx context.Context, location string, publisherName string, typeParameter string, version string) (result VirtualMachineExtensionImage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineExtensionImagesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, location, publisherName, typeParameter, version) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualMachineExtensionImagesClient) GetPreparer(ctx context.Context, location string, publisherName string, typeParameter string, version string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "publisherName": autorest.Encode("path", publisherName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "type": autorest.Encode("path", typeParameter), - "version": autorest.Encode("path", version), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions/{version}", 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 VirtualMachineExtensionImagesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualMachineExtensionImagesClient) GetResponder(resp *http.Response) (result VirtualMachineExtensionImage, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListTypes gets a list of virtual machine extension image types. -// Parameters: -// location - the name of a supported Azure region. -func (client VirtualMachineExtensionImagesClient) ListTypes(ctx context.Context, location string, publisherName string) (result ListVirtualMachineExtensionImage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineExtensionImagesClient.ListTypes") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListTypesPreparer(ctx, location, publisherName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "ListTypes", nil, "Failure preparing request") - return - } - - resp, err := client.ListTypesSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "ListTypes", resp, "Failure sending request") - return - } - - result, err = client.ListTypesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "ListTypes", resp, "Failure responding to request") - return - } - - return -} - -// ListTypesPreparer prepares the ListTypes request. -func (client VirtualMachineExtensionImagesClient) ListTypesPreparer(ctx context.Context, location string, publisherName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "publisherName": autorest.Encode("path", publisherName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListTypesSender sends the ListTypes request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineExtensionImagesClient) ListTypesSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListTypesResponder handles the response to the ListTypes request. The method always -// closes the http.Response Body. -func (client VirtualMachineExtensionImagesClient) ListTypesResponder(resp *http.Response) (result ListVirtualMachineExtensionImage, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListVersions gets a list of virtual machine extension image versions. -// Parameters: -// location - the name of a supported Azure region. -// filter - the filter to apply on the operation. -func (client VirtualMachineExtensionImagesClient) ListVersions(ctx context.Context, location string, publisherName string, typeParameter string, filter string, top *int32, orderby string) (result ListVirtualMachineExtensionImage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineExtensionImagesClient.ListVersions") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListVersionsPreparer(ctx, location, publisherName, typeParameter, filter, top, orderby) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "ListVersions", nil, "Failure preparing request") - return - } - - resp, err := client.ListVersionsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "ListVersions", resp, "Failure sending request") - return - } - - result, err = client.ListVersionsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "ListVersions", resp, "Failure responding to request") - return - } - - return -} - -// ListVersionsPreparer prepares the ListVersions request. -func (client VirtualMachineExtensionImagesClient) ListVersionsPreparer(ctx context.Context, location string, publisherName string, typeParameter string, filter string, top *int32, orderby string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "publisherName": autorest.Encode("path", publisherName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "type": autorest.Encode("path", typeParameter), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if top != nil { - queryParameters["$top"] = autorest.Encode("query", *top) - } - if len(orderby) > 0 { - queryParameters["$orderby"] = autorest.Encode("query", orderby) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListVersionsSender sends the ListVersions request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineExtensionImagesClient) ListVersionsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListVersionsResponder handles the response to the ListVersions request. The method always -// closes the http.Response Body. -func (client VirtualMachineExtensionImagesClient) ListVersionsResponder(resp *http.Response) (result ListVirtualMachineExtensionImage, err error) { - err = autorest.Respond( - resp, - 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/compute/mgmt/2022-08-01/compute/virtualmachineextensions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachineextensions.go deleted file mode 100644 index 4835d9d6..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachineextensions.go +++ /dev/null @@ -1,454 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualMachineExtensionsClient is the compute Client -type VirtualMachineExtensionsClient struct { - BaseClient -} - -// NewVirtualMachineExtensionsClient creates an instance of the VirtualMachineExtensionsClient client. -func NewVirtualMachineExtensionsClient(subscriptionID string) VirtualMachineExtensionsClient { - return NewVirtualMachineExtensionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualMachineExtensionsClientWithBaseURI creates an instance of the VirtualMachineExtensionsClient client using -// a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign -// clouds, Azure stack). -func NewVirtualMachineExtensionsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineExtensionsClient { - return VirtualMachineExtensionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate the operation to create or update the extension. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine where the extension should be created or updated. -// VMExtensionName - the name of the virtual machine extension. -// extensionParameters - 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) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineExtensionsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: extensionParameters, - Constraints: []validation.Constraint{{Target: "extensionParameters.VirtualMachineExtensionProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "extensionParameters.VirtualMachineExtensionProperties.ProtectedSettingsFromKeyVault", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "extensionParameters.VirtualMachineExtensionProperties.ProtectedSettingsFromKeyVault.SecretURL", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "extensionParameters.VirtualMachineExtensionProperties.ProtectedSettingsFromKeyVault.SourceVault", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}}}}); err != nil { - return result, validation.NewError("compute.VirtualMachineExtensionsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, VMName, VMExtensionName, extensionParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VirtualMachineExtensionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string, extensionParameters VirtualMachineExtension) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmExtensionName": autorest.Encode("path", VMExtensionName), - "vmName": autorest.Encode("path", VMName), - } - - const APIVersion = "2022-08-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.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}", pathParameters), - autorest.WithJSON(extensionParameters), - 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 VirtualMachineExtensionsClient) CreateOrUpdateSender(req *http.Request) (future VirtualMachineExtensionsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client VirtualMachineExtensionsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualMachineExtension, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete the operation to delete the extension. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine where the extension should be deleted. -// VMExtensionName - the name of the virtual machine extension. -func (client VirtualMachineExtensionsClient) Delete(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string) (result VirtualMachineExtensionsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineExtensionsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, VMName, VMExtensionName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VirtualMachineExtensionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmExtensionName": autorest.Encode("path", VMExtensionName), - "vmName": autorest.Encode("path", VMName), - } - - const APIVersion = "2022-08-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.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}", 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 VirtualMachineExtensionsClient) DeleteSender(req *http.Request) (future VirtualMachineExtensionsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VirtualMachineExtensionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get the operation to get the extension. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine containing the extension. -// VMExtensionName - the name of the virtual machine extension. -// expand - 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) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineExtensionsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, VMName, VMExtensionName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualMachineExtensionsClient) GetPreparer(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmExtensionName": autorest.Encode("path", VMExtensionName), - "vmName": autorest.Encode("path", VMName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}", 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 VirtualMachineExtensionsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualMachineExtensionsClient) GetResponder(resp *http.Response) (result VirtualMachineExtension, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List the operation to get all extensions of a Virtual Machine. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine containing the extension. -// expand - the expand expression to apply on the operation. -func (client VirtualMachineExtensionsClient) List(ctx context.Context, resourceGroupName string, VMName string, expand string) (result VirtualMachineExtensionsListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineExtensionsClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListPreparer(ctx, resourceGroupName, VMName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "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.VirtualMachineExtensionsClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualMachineExtensionsClient) ListPreparer(ctx context.Context, resourceGroupName string, VMName string, expand string) (*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 = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions", 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 VirtualMachineExtensionsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualMachineExtensionsClient) ListResponder(resp *http.Response) (result VirtualMachineExtensionsListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Update the operation to update the extension. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine where the extension should be updated. -// VMExtensionName - the name of the virtual machine extension. -// extensionParameters - parameters supplied to the Update Virtual Machine Extension operation. -func (client VirtualMachineExtensionsClient) Update(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string, extensionParameters VirtualMachineExtensionUpdate) (result VirtualMachineExtensionsUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineExtensionsClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, VMName, VMExtensionName, extensionParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client VirtualMachineExtensionsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string, extensionParameters VirtualMachineExtensionUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmExtensionName": autorest.Encode("path", VMExtensionName), - "vmName": autorest.Encode("path", VMName), - } - - const APIVersion = "2022-08-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}/extensions/{vmExtensionName}", pathParameters), - autorest.WithJSON(extensionParameters), - 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 VirtualMachineExtensionsClient) UpdateSender(req *http.Request) (future VirtualMachineExtensionsUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client VirtualMachineExtensionsClient) UpdateResponder(resp *http.Response) (result VirtualMachineExtension, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachineimages.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachineimages.go deleted file mode 100644 index 65b20c30..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachineimages.go +++ /dev/null @@ -1,508 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualMachineImagesClient is the compute Client -type VirtualMachineImagesClient struct { - BaseClient -} - -// NewVirtualMachineImagesClient creates an instance of the VirtualMachineImagesClient client. -func NewVirtualMachineImagesClient(subscriptionID string) VirtualMachineImagesClient { - return NewVirtualMachineImagesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualMachineImagesClientWithBaseURI creates an instance of the VirtualMachineImagesClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewVirtualMachineImagesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineImagesClient { - return VirtualMachineImagesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get gets a virtual machine image. -// Parameters: -// location - the name of a supported Azure region. -// publisherName - a valid image publisher. -// offer - a valid image publisher offer. -// skus - a valid image SKU. -// version - 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) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineImagesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, location, publisherName, offer, skus, version) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualMachineImagesClient) GetPreparer(ctx context.Context, location string, publisherName string, offer string, skus string, version string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "offer": autorest.Encode("path", offer), - "publisherName": autorest.Encode("path", publisherName), - "skus": autorest.Encode("path", skus), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "version": autorest.Encode("path", version), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions/{version}", 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 VirtualMachineImagesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualMachineImagesClient) GetResponder(resp *http.Response) (result VirtualMachineImage, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. -// Parameters: -// location - the name of a supported Azure region. -// publisherName - a valid image publisher. -// offer - a valid image publisher offer. -// skus - a valid image SKU. -// expand - the expand expression to apply on the operation. -func (client VirtualMachineImagesClient) List(ctx context.Context, location string, publisherName string, offer string, skus string, expand string, top *int32, orderby string) (result ListVirtualMachineImageResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineImagesClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListPreparer(ctx, location, publisherName, offer, skus, expand, top, orderby) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "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.VirtualMachineImagesClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualMachineImagesClient) ListPreparer(ctx context.Context, location string, publisherName string, offer string, skus string, expand string, top *int32, orderby string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "offer": autorest.Encode("path", offer), - "publisherName": autorest.Encode("path", publisherName), - "skus": autorest.Encode("path", skus), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - if top != nil { - queryParameters["$top"] = autorest.Encode("query", *top) - } - if len(orderby) > 0 { - queryParameters["$orderby"] = autorest.Encode("query", orderby) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions", 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 VirtualMachineImagesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualMachineImagesClient) ListResponder(resp *http.Response) (result ListVirtualMachineImageResource, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByEdgeZone gets a list of all virtual machine image versions for the specified edge zone -// Parameters: -// location - the name of a supported Azure region. -// edgeZone - the name of the edge zone. -func (client VirtualMachineImagesClient) ListByEdgeZone(ctx context.Context, location string, edgeZone string) (result VMImagesInEdgeZoneListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineImagesClient.ListByEdgeZone") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListByEdgeZonePreparer(ctx, location, edgeZone) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListByEdgeZone", nil, "Failure preparing request") - return - } - - resp, err := client.ListByEdgeZoneSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListByEdgeZone", resp, "Failure sending request") - return - } - - result, err = client.ListByEdgeZoneResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListByEdgeZone", resp, "Failure responding to request") - return - } - - return -} - -// ListByEdgeZonePreparer prepares the ListByEdgeZone request. -func (client VirtualMachineImagesClient) ListByEdgeZonePreparer(ctx context.Context, location string, edgeZone string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "edgeZone": autorest.Encode("path", edgeZone), - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/vmimages", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByEdgeZoneSender sends the ListByEdgeZone request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineImagesClient) ListByEdgeZoneSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByEdgeZoneResponder handles the response to the ListByEdgeZone request. The method always -// closes the http.Response Body. -func (client VirtualMachineImagesClient) ListByEdgeZoneResponder(resp *http.Response) (result VMImagesInEdgeZoneListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListOffers gets a list of virtual machine image offers for the specified location and publisher. -// Parameters: -// location - the name of a supported Azure region. -// publisherName - a valid image publisher. -func (client VirtualMachineImagesClient) ListOffers(ctx context.Context, location string, publisherName string) (result ListVirtualMachineImageResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineImagesClient.ListOffers") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListOffersPreparer(ctx, location, publisherName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListOffers", nil, "Failure preparing request") - return - } - - resp, err := client.ListOffersSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListOffers", resp, "Failure sending request") - return - } - - result, err = client.ListOffersResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListOffers", resp, "Failure responding to request") - return - } - - return -} - -// ListOffersPreparer prepares the ListOffers request. -func (client VirtualMachineImagesClient) ListOffersPreparer(ctx context.Context, location string, publisherName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "publisherName": autorest.Encode("path", publisherName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListOffersSender sends the ListOffers request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineImagesClient) ListOffersSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListOffersResponder handles the response to the ListOffers request. The method always -// closes the http.Response Body. -func (client VirtualMachineImagesClient) ListOffersResponder(resp *http.Response) (result ListVirtualMachineImageResource, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListPublishers gets a list of virtual machine image publishers for the specified Azure location. -// Parameters: -// location - the name of a supported Azure region. -func (client VirtualMachineImagesClient) ListPublishers(ctx context.Context, location string) (result ListVirtualMachineImageResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineImagesClient.ListPublishers") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListPublishersPreparer(ctx, location) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListPublishers", nil, "Failure preparing request") - return - } - - resp, err := client.ListPublishersSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListPublishers", resp, "Failure sending request") - return - } - - result, err = client.ListPublishersResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListPublishers", resp, "Failure responding to request") - return - } - - return -} - -// ListPublishersPreparer prepares the ListPublishers request. -func (client VirtualMachineImagesClient) ListPublishersPreparer(ctx context.Context, location string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListPublishersSender sends the ListPublishers request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineImagesClient) ListPublishersSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListPublishersResponder handles the response to the ListPublishers request. The method always -// closes the http.Response Body. -func (client VirtualMachineImagesClient) ListPublishersResponder(resp *http.Response) (result ListVirtualMachineImageResource, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListSkus gets a list of virtual machine image SKUs for the specified location, publisher, and offer. -// Parameters: -// location - the name of a supported Azure region. -// publisherName - a valid image publisher. -// offer - a valid image publisher offer. -func (client VirtualMachineImagesClient) ListSkus(ctx context.Context, location string, publisherName string, offer string) (result ListVirtualMachineImageResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineImagesClient.ListSkus") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListSkusPreparer(ctx, location, publisherName, offer) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListSkus", nil, "Failure preparing request") - return - } - - resp, err := client.ListSkusSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListSkus", resp, "Failure sending request") - return - } - - result, err = client.ListSkusResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListSkus", resp, "Failure responding to request") - return - } - - return -} - -// ListSkusPreparer prepares the ListSkus request. -func (client VirtualMachineImagesClient) ListSkusPreparer(ctx context.Context, location string, publisherName string, offer string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "offer": autorest.Encode("path", offer), - "publisherName": autorest.Encode("path", publisherName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSkusSender sends the ListSkus request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineImagesClient) ListSkusSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListSkusResponder handles the response to the ListSkus request. The method always -// closes the http.Response Body. -func (client VirtualMachineImagesClient) ListSkusResponder(resp *http.Response) (result ListVirtualMachineImageResource, err error) { - err = autorest.Respond( - resp, - 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/compute/mgmt/2022-08-01/compute/virtualmachineimagesedgezone.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachineimagesedgezone.go deleted file mode 100644 index 33ca2cbe..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachineimagesedgezone.go +++ /dev/null @@ -1,445 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualMachineImagesEdgeZoneClient is the compute Client -type VirtualMachineImagesEdgeZoneClient struct { - BaseClient -} - -// NewVirtualMachineImagesEdgeZoneClient creates an instance of the VirtualMachineImagesEdgeZoneClient client. -func NewVirtualMachineImagesEdgeZoneClient(subscriptionID string) VirtualMachineImagesEdgeZoneClient { - return NewVirtualMachineImagesEdgeZoneClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualMachineImagesEdgeZoneClientWithBaseURI creates an instance of the VirtualMachineImagesEdgeZoneClient -// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI -// (sovereign clouds, Azure stack). -func NewVirtualMachineImagesEdgeZoneClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineImagesEdgeZoneClient { - return VirtualMachineImagesEdgeZoneClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get gets a virtual machine image in an edge zone. -// Parameters: -// location - the name of a supported Azure region. -// edgeZone - the name of the edge zone. -// publisherName - a valid image publisher. -// offer - a valid image publisher offer. -// skus - a valid image SKU. -// version - a valid image SKU version. -func (client VirtualMachineImagesEdgeZoneClient) Get(ctx context.Context, location string, edgeZone string, publisherName string, offer string, skus string, version string) (result VirtualMachineImage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineImagesEdgeZoneClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, location, edgeZone, publisherName, offer, skus, version) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesEdgeZoneClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesEdgeZoneClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesEdgeZoneClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualMachineImagesEdgeZoneClient) GetPreparer(ctx context.Context, location string, edgeZone string, publisherName string, offer string, skus string, version string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "edgeZone": autorest.Encode("path", edgeZone), - "location": autorest.Encode("path", location), - "offer": autorest.Encode("path", offer), - "publisherName": autorest.Encode("path", publisherName), - "skus": autorest.Encode("path", skus), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "version": autorest.Encode("path", version), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions/{version}", 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 VirtualMachineImagesEdgeZoneClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualMachineImagesEdgeZoneClient) GetResponder(resp *http.Response) (result VirtualMachineImage, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and -// SKU. -// Parameters: -// location - the name of a supported Azure region. -// edgeZone - the name of the edge zone. -// publisherName - a valid image publisher. -// offer - a valid image publisher offer. -// skus - a valid image SKU. -// expand - the expand expression to apply on the operation. -// top - an integer value specifying the number of images to return that matches supplied values. -// orderby - specifies the order of the results returned. Formatted as an OData query. -func (client VirtualMachineImagesEdgeZoneClient) List(ctx context.Context, location string, edgeZone string, publisherName string, offer string, skus string, expand string, top *int32, orderby string) (result ListVirtualMachineImageResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineImagesEdgeZoneClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListPreparer(ctx, location, edgeZone, publisherName, offer, skus, expand, top, orderby) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesEdgeZoneClient", "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.VirtualMachineImagesEdgeZoneClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesEdgeZoneClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualMachineImagesEdgeZoneClient) ListPreparer(ctx context.Context, location string, edgeZone string, publisherName string, offer string, skus string, expand string, top *int32, orderby string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "edgeZone": autorest.Encode("path", edgeZone), - "location": autorest.Encode("path", location), - "offer": autorest.Encode("path", offer), - "publisherName": autorest.Encode("path", publisherName), - "skus": autorest.Encode("path", skus), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - if top != nil { - queryParameters["$top"] = autorest.Encode("query", *top) - } - if len(orderby) > 0 { - queryParameters["$orderby"] = autorest.Encode("query", orderby) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions", 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 VirtualMachineImagesEdgeZoneClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualMachineImagesEdgeZoneClient) ListResponder(resp *http.Response) (result ListVirtualMachineImageResource, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListOffers gets a list of virtual machine image offers for the specified location, edge zone and publisher. -// Parameters: -// location - the name of a supported Azure region. -// edgeZone - the name of the edge zone. -// publisherName - a valid image publisher. -func (client VirtualMachineImagesEdgeZoneClient) ListOffers(ctx context.Context, location string, edgeZone string, publisherName string) (result ListVirtualMachineImageResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineImagesEdgeZoneClient.ListOffers") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListOffersPreparer(ctx, location, edgeZone, publisherName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesEdgeZoneClient", "ListOffers", nil, "Failure preparing request") - return - } - - resp, err := client.ListOffersSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesEdgeZoneClient", "ListOffers", resp, "Failure sending request") - return - } - - result, err = client.ListOffersResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesEdgeZoneClient", "ListOffers", resp, "Failure responding to request") - return - } - - return -} - -// ListOffersPreparer prepares the ListOffers request. -func (client VirtualMachineImagesEdgeZoneClient) ListOffersPreparer(ctx context.Context, location string, edgeZone string, publisherName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "edgeZone": autorest.Encode("path", edgeZone), - "location": autorest.Encode("path", location), - "publisherName": autorest.Encode("path", publisherName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/publishers/{publisherName}/artifacttypes/vmimage/offers", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListOffersSender sends the ListOffers request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineImagesEdgeZoneClient) ListOffersSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListOffersResponder handles the response to the ListOffers request. The method always -// closes the http.Response Body. -func (client VirtualMachineImagesEdgeZoneClient) ListOffersResponder(resp *http.Response) (result ListVirtualMachineImageResource, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListPublishers gets a list of virtual machine image publishers for the specified Azure location and edge zone. -// Parameters: -// location - the name of a supported Azure region. -// edgeZone - the name of the edge zone. -func (client VirtualMachineImagesEdgeZoneClient) ListPublishers(ctx context.Context, location string, edgeZone string) (result ListVirtualMachineImageResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineImagesEdgeZoneClient.ListPublishers") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListPublishersPreparer(ctx, location, edgeZone) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesEdgeZoneClient", "ListPublishers", nil, "Failure preparing request") - return - } - - resp, err := client.ListPublishersSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesEdgeZoneClient", "ListPublishers", resp, "Failure sending request") - return - } - - result, err = client.ListPublishersResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesEdgeZoneClient", "ListPublishers", resp, "Failure responding to request") - return - } - - return -} - -// ListPublishersPreparer prepares the ListPublishers request. -func (client VirtualMachineImagesEdgeZoneClient) ListPublishersPreparer(ctx context.Context, location string, edgeZone string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "edgeZone": autorest.Encode("path", edgeZone), - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/publishers", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListPublishersSender sends the ListPublishers request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineImagesEdgeZoneClient) ListPublishersSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListPublishersResponder handles the response to the ListPublishers request. The method always -// closes the http.Response Body. -func (client VirtualMachineImagesEdgeZoneClient) ListPublishersResponder(resp *http.Response) (result ListVirtualMachineImageResource, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListSkus gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. -// Parameters: -// location - the name of a supported Azure region. -// edgeZone - the name of the edge zone. -// publisherName - a valid image publisher. -// offer - a valid image publisher offer. -func (client VirtualMachineImagesEdgeZoneClient) ListSkus(ctx context.Context, location string, edgeZone string, publisherName string, offer string) (result ListVirtualMachineImageResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineImagesEdgeZoneClient.ListSkus") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListSkusPreparer(ctx, location, edgeZone, publisherName, offer) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesEdgeZoneClient", "ListSkus", nil, "Failure preparing request") - return - } - - resp, err := client.ListSkusSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesEdgeZoneClient", "ListSkus", resp, "Failure sending request") - return - } - - result, err = client.ListSkusResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesEdgeZoneClient", "ListSkus", resp, "Failure responding to request") - return - } - - return -} - -// ListSkusPreparer prepares the ListSkus request. -func (client VirtualMachineImagesEdgeZoneClient) ListSkusPreparer(ctx context.Context, location string, edgeZone string, publisherName string, offer string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "edgeZone": autorest.Encode("path", edgeZone), - "location": autorest.Encode("path", location), - "offer": autorest.Encode("path", offer), - "publisherName": autorest.Encode("path", publisherName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSkusSender sends the ListSkus request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineImagesEdgeZoneClient) ListSkusSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListSkusResponder handles the response to the ListSkus request. The method always -// closes the http.Response Body. -func (client VirtualMachineImagesEdgeZoneClient) ListSkusResponder(resp *http.Response) (result ListVirtualMachineImageResource, err error) { - err = autorest.Respond( - resp, - 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/compute/mgmt/2022-08-01/compute/virtualmachineruncommands.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachineruncommands.go deleted file mode 100644 index be46b192..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachineruncommands.go +++ /dev/null @@ -1,689 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualMachineRunCommandsClient is the compute Client -type VirtualMachineRunCommandsClient struct { - BaseClient -} - -// NewVirtualMachineRunCommandsClient creates an instance of the VirtualMachineRunCommandsClient client. -func NewVirtualMachineRunCommandsClient(subscriptionID string) VirtualMachineRunCommandsClient { - return NewVirtualMachineRunCommandsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualMachineRunCommandsClientWithBaseURI creates an instance of the VirtualMachineRunCommandsClient client -// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign -// clouds, Azure stack). -func NewVirtualMachineRunCommandsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineRunCommandsClient { - return VirtualMachineRunCommandsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate the operation to create or update the run command. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine where the run command should be created or updated. -// runCommandName - the name of the virtual machine run command. -// runCommand - parameters supplied to the Create Virtual Machine RunCommand operation. -func (client VirtualMachineRunCommandsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, VMName string, runCommandName string, runCommand VirtualMachineRunCommand) (result VirtualMachineRunCommandsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineRunCommandsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, VMName, runCommandName, runCommand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VirtualMachineRunCommandsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, VMName string, runCommandName string, runCommand VirtualMachineRunCommand) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "runCommandName": autorest.Encode("path", runCommandName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmName": autorest.Encode("path", VMName), - } - - const APIVersion = "2022-08-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.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}", pathParameters), - autorest.WithJSON(runCommand), - 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 VirtualMachineRunCommandsClient) CreateOrUpdateSender(req *http.Request) (future VirtualMachineRunCommandsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client VirtualMachineRunCommandsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualMachineRunCommand, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete the operation to delete the run command. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine where the run command should be deleted. -// runCommandName - the name of the virtual machine run command. -func (client VirtualMachineRunCommandsClient) Delete(ctx context.Context, resourceGroupName string, VMName string, runCommandName string) (result VirtualMachineRunCommandsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineRunCommandsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, VMName, runCommandName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VirtualMachineRunCommandsClient) DeletePreparer(ctx context.Context, resourceGroupName string, VMName string, runCommandName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "runCommandName": autorest.Encode("path", runCommandName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmName": autorest.Encode("path", VMName), - } - - const APIVersion = "2022-08-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.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}", 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 VirtualMachineRunCommandsClient) DeleteSender(req *http.Request) (future VirtualMachineRunCommandsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VirtualMachineRunCommandsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets specific run command for a subscription in a location. -// Parameters: -// location - the location upon which run commands is queried. -// commandID - the command id. -func (client VirtualMachineRunCommandsClient) Get(ctx context.Context, location string, commandID string) (result RunCommandDocument, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineRunCommandsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: location, - Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("compute.VirtualMachineRunCommandsClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, location, commandID) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualMachineRunCommandsClient) GetPreparer(ctx context.Context, location string, commandID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "commandId": autorest.Encode("path", commandID), - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/runCommands/{commandId}", 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 VirtualMachineRunCommandsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualMachineRunCommandsClient) GetResponder(resp *http.Response) (result RunCommandDocument, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetByVirtualMachine the operation to get the run command. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine containing the run command. -// runCommandName - the name of the virtual machine run command. -// expand - the expand expression to apply on the operation. -func (client VirtualMachineRunCommandsClient) GetByVirtualMachine(ctx context.Context, resourceGroupName string, VMName string, runCommandName string, expand string) (result VirtualMachineRunCommand, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineRunCommandsClient.GetByVirtualMachine") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetByVirtualMachinePreparer(ctx, resourceGroupName, VMName, runCommandName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "GetByVirtualMachine", nil, "Failure preparing request") - return - } - - resp, err := client.GetByVirtualMachineSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "GetByVirtualMachine", resp, "Failure sending request") - return - } - - result, err = client.GetByVirtualMachineResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "GetByVirtualMachine", resp, "Failure responding to request") - return - } - - return -} - -// GetByVirtualMachinePreparer prepares the GetByVirtualMachine request. -func (client VirtualMachineRunCommandsClient) GetByVirtualMachinePreparer(ctx context.Context, resourceGroupName string, VMName string, runCommandName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "runCommandName": autorest.Encode("path", runCommandName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmName": autorest.Encode("path", VMName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetByVirtualMachineSender sends the GetByVirtualMachine request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineRunCommandsClient) GetByVirtualMachineSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetByVirtualMachineResponder handles the response to the GetByVirtualMachine request. The method always -// closes the http.Response Body. -func (client VirtualMachineRunCommandsClient) GetByVirtualMachineResponder(resp *http.Response) (result VirtualMachineRunCommand, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists all available run commands for a subscription in a location. -// Parameters: -// location - the location upon which run commands is queried. -func (client VirtualMachineRunCommandsClient) List(ctx context.Context, location string) (result RunCommandListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineRunCommandsClient.List") - defer func() { - sc := -1 - if result.rclr.Response.Response != nil { - sc = result.rclr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - 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.NewError("compute.VirtualMachineRunCommandsClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, location) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.rclr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "List", resp, "Failure sending request") - return - } - - result.rclr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "List", resp, "Failure responding to request") - return - } - if result.rclr.hasNextLink() && result.rclr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualMachineRunCommandsClient) ListPreparer(ctx context.Context, location string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/runCommands", 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 VirtualMachineRunCommandsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualMachineRunCommandsClient) ListResponder(resp *http.Response) (result RunCommandListResult, err error) { - err = autorest.Respond( - resp, - 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 VirtualMachineRunCommandsClient) listNextResults(ctx context.Context, lastResults RunCommandListResult) (result RunCommandListResult, err error) { - req, err := lastResults.runCommandListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "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, "compute.VirtualMachineRunCommandsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualMachineRunCommandsClient) ListComplete(ctx context.Context, location string) (result RunCommandListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineRunCommandsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, location) - return -} - -// ListByVirtualMachine the operation to get all run commands of a Virtual Machine. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine containing the run command. -// expand - the expand expression to apply on the operation. -func (client VirtualMachineRunCommandsClient) ListByVirtualMachine(ctx context.Context, resourceGroupName string, VMName string, expand string) (result VirtualMachineRunCommandsListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineRunCommandsClient.ListByVirtualMachine") - defer func() { - sc := -1 - if result.vmrclr.Response.Response != nil { - sc = result.vmrclr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByVirtualMachineNextResults - req, err := client.ListByVirtualMachinePreparer(ctx, resourceGroupName, VMName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "ListByVirtualMachine", nil, "Failure preparing request") - return - } - - resp, err := client.ListByVirtualMachineSender(req) - if err != nil { - result.vmrclr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "ListByVirtualMachine", resp, "Failure sending request") - return - } - - result.vmrclr, err = client.ListByVirtualMachineResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "ListByVirtualMachine", resp, "Failure responding to request") - return - } - if result.vmrclr.hasNextLink() && result.vmrclr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByVirtualMachinePreparer prepares the ListByVirtualMachine request. -func (client VirtualMachineRunCommandsClient) ListByVirtualMachinePreparer(ctx context.Context, resourceGroupName string, VMName string, expand string) (*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 = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByVirtualMachineSender sends the ListByVirtualMachine request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineRunCommandsClient) ListByVirtualMachineSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByVirtualMachineResponder handles the response to the ListByVirtualMachine request. The method always -// closes the http.Response Body. -func (client VirtualMachineRunCommandsClient) ListByVirtualMachineResponder(resp *http.Response) (result VirtualMachineRunCommandsListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByVirtualMachineNextResults retrieves the next set of results, if any. -func (client VirtualMachineRunCommandsClient) listByVirtualMachineNextResults(ctx context.Context, lastResults VirtualMachineRunCommandsListResult) (result VirtualMachineRunCommandsListResult, err error) { - req, err := lastResults.virtualMachineRunCommandsListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "listByVirtualMachineNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByVirtualMachineSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "listByVirtualMachineNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByVirtualMachineResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "listByVirtualMachineNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByVirtualMachineComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualMachineRunCommandsClient) ListByVirtualMachineComplete(ctx context.Context, resourceGroupName string, VMName string, expand string) (result VirtualMachineRunCommandsListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineRunCommandsClient.ListByVirtualMachine") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByVirtualMachine(ctx, resourceGroupName, VMName, expand) - return -} - -// Update the operation to update the run command. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine where the run command should be updated. -// runCommandName - the name of the virtual machine run command. -// runCommand - parameters supplied to the Update Virtual Machine RunCommand operation. -func (client VirtualMachineRunCommandsClient) Update(ctx context.Context, resourceGroupName string, VMName string, runCommandName string, runCommand VirtualMachineRunCommandUpdate) (result VirtualMachineRunCommandsUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineRunCommandsClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, VMName, runCommandName, runCommand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client VirtualMachineRunCommandsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, VMName string, runCommandName string, runCommand VirtualMachineRunCommandUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "runCommandName": autorest.Encode("path", runCommandName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmName": autorest.Encode("path", VMName), - } - - const APIVersion = "2022-08-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}/runCommands/{runCommandName}", pathParameters), - autorest.WithJSON(runCommand), - 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 VirtualMachineRunCommandsClient) UpdateSender(req *http.Request) (future VirtualMachineRunCommandsUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client VirtualMachineRunCommandsClient) UpdateResponder(resp *http.Response) (result VirtualMachineRunCommand, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachines.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachines.go deleted file mode 100644 index d9c7043e..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachines.go +++ /dev/null @@ -1,2205 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualMachinesClient is the compute Client -type VirtualMachinesClient struct { - BaseClient -} - -// NewVirtualMachinesClient creates an instance of the VirtualMachinesClient client. -func NewVirtualMachinesClient(subscriptionID string) VirtualMachinesClient { - return NewVirtualMachinesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualMachinesClientWithBaseURI creates an instance of the VirtualMachinesClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewVirtualMachinesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachinesClient { - return VirtualMachinesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// AssessPatches assess patches on the VM. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -func (client VirtualMachinesClient) AssessPatches(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachinesAssessPatchesFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.AssessPatches") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.AssessPatchesPreparer(ctx, resourceGroupName, VMName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "AssessPatches", nil, "Failure preparing request") - return - } - - result, err = client.AssessPatchesSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "AssessPatches", result.Response(), "Failure sending request") - return - } - - return -} - -// AssessPatchesPreparer prepares the AssessPatches request. -func (client VirtualMachinesClient) AssessPatchesPreparer(ctx context.Context, resourceGroupName string, VMName string) (*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 = "2022-08-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.Compute/virtualMachines/{vmName}/assessPatches", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// AssessPatchesSender sends the AssessPatches request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) AssessPatchesSender(req *http.Request) (future VirtualMachinesAssessPatchesFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// AssessPatchesResponder handles the response to the AssessPatches request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) AssessPatchesResponder(resp *http.Response) (result VirtualMachineAssessPatchesResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Capture captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create -// similar VMs. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -// parameters - parameters supplied to the Capture Virtual Machine operation. -func (client VirtualMachinesClient) Capture(ctx context.Context, resourceGroupName string, VMName string, parameters VirtualMachineCaptureParameters) (result VirtualMachinesCaptureFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Capture") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - 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.NewError("compute.VirtualMachinesClient", "Capture", err.Error()) - } - - req, err := client.CapturePreparer(ctx, resourceGroupName, VMName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Capture", nil, "Failure preparing request") - return - } - - result, err = client.CaptureSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Capture", result.Response(), "Failure sending request") - return - } - - return -} - -// CapturePreparer prepares the Capture request. -func (client VirtualMachinesClient) CapturePreparer(ctx context.Context, resourceGroupName string, VMName string, parameters VirtualMachineCaptureParameters) (*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 = "2022-08-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.Compute/virtualMachines/{vmName}/capture", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CaptureSender sends the Capture request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) CaptureSender(req *http.Request) (future VirtualMachinesCaptureFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CaptureResponder handles the response to the Capture request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) CaptureResponder(resp *http.Response) (result VirtualMachineCaptureResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ConvertToManagedDisks converts virtual machine disks from blob-based to managed disks. Virtual machine must be -// stop-deallocated before invoking this operation. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -func (client VirtualMachinesClient) ConvertToManagedDisks(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachinesConvertToManagedDisksFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.ConvertToManagedDisks") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ConvertToManagedDisksPreparer(ctx, resourceGroupName, VMName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ConvertToManagedDisks", nil, "Failure preparing request") - return - } - - result, err = client.ConvertToManagedDisksSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ConvertToManagedDisks", result.Response(), "Failure sending request") - return - } - - return -} - -// ConvertToManagedDisksPreparer prepares the ConvertToManagedDisks request. -func (client VirtualMachinesClient) ConvertToManagedDisksPreparer(ctx context.Context, resourceGroupName string, VMName string) (*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 = "2022-08-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.Compute/virtualMachines/{vmName}/convertToManagedDisks", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ConvertToManagedDisksSender sends the ConvertToManagedDisks request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) ConvertToManagedDisksSender(req *http.Request) (future VirtualMachinesConvertToManagedDisksFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ConvertToManagedDisksResponder handles the response to the ConvertToManagedDisks request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) ConvertToManagedDisksResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// CreateOrUpdate the operation to create or update a virtual machine. Please note some properties can be set only -// during virtual machine creation. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -// parameters - parameters supplied to the Create Virtual Machine operation. -func (client VirtualMachinesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, VMName string, parameters VirtualMachine) (result VirtualMachinesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.VirtualMachineProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineProperties.StorageProfile", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineProperties.StorageProfile.OsDisk", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineProperties.StorageProfile.OsDisk.EncryptionSettings", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineProperties.StorageProfile.OsDisk.EncryptionSettings.DiskEncryptionKey", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineProperties.StorageProfile.OsDisk.EncryptionSettings.DiskEncryptionKey.SecretURL", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.VirtualMachineProperties.StorageProfile.OsDisk.EncryptionSettings.DiskEncryptionKey.SourceVault", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "parameters.VirtualMachineProperties.StorageProfile.OsDisk.EncryptionSettings.KeyEncryptionKey", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineProperties.StorageProfile.OsDisk.EncryptionSettings.KeyEncryptionKey.KeyURL", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.VirtualMachineProperties.StorageProfile.OsDisk.EncryptionSettings.KeyEncryptionKey.SourceVault", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("compute.VirtualMachinesClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, VMName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VirtualMachinesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, VMName string, parameters VirtualMachine) (*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 = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Resources = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}", 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 VirtualMachinesClient) CreateOrUpdateSender(req *http.Request) (future VirtualMachinesCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualMachine, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Deallocate shuts down the virtual machine and releases the compute resources. You are not billed for the compute -// resources that this virtual machine uses. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -// hibernate - optional parameter to hibernate a virtual machine. (Feature in Preview) -func (client VirtualMachinesClient) Deallocate(ctx context.Context, resourceGroupName string, VMName string, hibernate *bool) (result VirtualMachinesDeallocateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Deallocate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeallocatePreparer(ctx, resourceGroupName, VMName, hibernate) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Deallocate", nil, "Failure preparing request") - return - } - - result, err = client.DeallocateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Deallocate", result.Response(), "Failure sending request") - return - } - - return -} - -// DeallocatePreparer prepares the Deallocate request. -func (client VirtualMachinesClient) DeallocatePreparer(ctx context.Context, resourceGroupName string, VMName string, hibernate *bool) (*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 = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if hibernate != nil { - queryParameters["hibernate"] = autorest.Encode("query", *hibernate) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/deallocate", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeallocateSender sends the Deallocate request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) DeallocateSender(req *http.Request) (future VirtualMachinesDeallocateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeallocateResponder handles the response to the Deallocate request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) DeallocateResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Delete the operation to delete a virtual machine. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -// forceDeletion - optional parameter to force delete virtual machines. -func (client VirtualMachinesClient) Delete(ctx context.Context, resourceGroupName string, VMName string, forceDeletion *bool) (result VirtualMachinesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, VMName, forceDeletion) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VirtualMachinesClient) DeletePreparer(ctx context.Context, resourceGroupName string, VMName string, forceDeletion *bool) (*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 = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if forceDeletion != nil { - queryParameters["forceDeletion"] = autorest.Encode("query", *forceDeletion) - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}", 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 VirtualMachinesClient) DeleteSender(req *http.Request) (future VirtualMachinesDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Generalize sets the OS state of the virtual machine to generalized. It is recommended to sysprep the virtual machine -// before performing this operation.
      For Windows, please refer to [Create a managed image of a generalized VM in -// Azure](https://docs.microsoft.com/azure/virtual-machines/windows/capture-image-resource).
      For Linux, please refer -// to [How to create an image of a virtual machine or -// VHD](https://docs.microsoft.com/azure/virtual-machines/linux/capture-image). -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -func (client VirtualMachinesClient) Generalize(ctx context.Context, resourceGroupName string, VMName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Generalize") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GeneralizePreparer(ctx, resourceGroupName, VMName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Generalize", nil, "Failure preparing request") - return - } - - resp, err := client.GeneralizeSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Generalize", resp, "Failure sending request") - return - } - - result, err = client.GeneralizeResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Generalize", resp, "Failure responding to request") - return - } - - return -} - -// GeneralizePreparer prepares the Generalize request. -func (client VirtualMachinesClient) GeneralizePreparer(ctx context.Context, resourceGroupName string, VMName string) (*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 = "2022-08-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.Compute/virtualMachines/{vmName}/generalize", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GeneralizeSender sends the Generalize request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) GeneralizeSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GeneralizeResponder handles the response to the Generalize request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) GeneralizeResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieves information about the model view or the instance view of a virtual machine. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -// expand - the expand expression to apply on the operation. 'InstanceView' retrieves a snapshot of the runtime -// properties of the virtual machine that is managed by the platform and can change outside of control plane -// operations. 'UserData' retrieves the UserData property as part of the VM model view that was provided by the -// user during the VM Create/Update operation. -func (client VirtualMachinesClient) Get(ctx context.Context, resourceGroupName string, VMName string, expand InstanceViewTypes) (result VirtualMachine, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, VMName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualMachinesClient) GetPreparer(ctx context.Context, resourceGroupName string, VMName string, expand InstanceViewTypes) (*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 = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(string(expand)) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}", 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 VirtualMachinesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) GetResponder(resp *http.Response) (result VirtualMachine, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// InstallPatches installs patches on the VM. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -// installPatchesInput - input for InstallPatches as directly received by the API -func (client VirtualMachinesClient) InstallPatches(ctx context.Context, resourceGroupName string, VMName string, installPatchesInput VirtualMachineInstallPatchesParameters) (result VirtualMachinesInstallPatchesFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.InstallPatches") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.InstallPatchesPreparer(ctx, resourceGroupName, VMName, installPatchesInput) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "InstallPatches", nil, "Failure preparing request") - return - } - - result, err = client.InstallPatchesSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "InstallPatches", result.Response(), "Failure sending request") - return - } - - return -} - -// InstallPatchesPreparer prepares the InstallPatches request. -func (client VirtualMachinesClient) InstallPatchesPreparer(ctx context.Context, resourceGroupName string, VMName string, installPatchesInput VirtualMachineInstallPatchesParameters) (*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 = "2022-08-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.Compute/virtualMachines/{vmName}/installPatches", pathParameters), - autorest.WithJSON(installPatchesInput), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// InstallPatchesSender sends the InstallPatches request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) InstallPatchesSender(req *http.Request) (future VirtualMachinesInstallPatchesFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// InstallPatchesResponder handles the response to the InstallPatches request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) InstallPatchesResponder(resp *http.Response) (result VirtualMachineInstallPatchesResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// InstanceView retrieves information about the run-time state of a virtual machine. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -func (client VirtualMachinesClient) InstanceView(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachineInstanceView, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.InstanceView") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.InstanceViewPreparer(ctx, resourceGroupName, VMName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "InstanceView", nil, "Failure preparing request") - return - } - - resp, err := client.InstanceViewSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "InstanceView", resp, "Failure sending request") - return - } - - result, err = client.InstanceViewResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "InstanceView", resp, "Failure responding to request") - return - } - - return -} - -// InstanceViewPreparer prepares the InstanceView request. -func (client VirtualMachinesClient) InstanceViewPreparer(ctx context.Context, resourceGroupName string, VMName string) (*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 = "2022-08-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.Compute/virtualMachines/{vmName}/instanceView", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// InstanceViewSender sends the InstanceView request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) InstanceViewSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// InstanceViewResponder handles the response to the InstanceView request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) InstanceViewResponder(resp *http.Response) (result VirtualMachineInstanceView, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to -// get the next page of virtual machines. -// Parameters: -// resourceGroupName - the name of the resource group. -// filter - the system query option to filter VMs returned in the response. Allowed value is -// 'virtualMachineScaleSet/id' eq -// /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}' -func (client VirtualMachinesClient) List(ctx context.Context, resourceGroupName string, filter string) (result VirtualMachineListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.List") - defer func() { - sc := -1 - if result.vmlr.Response.Response != nil { - sc = result.vmlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, filter) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.vmlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "List", resp, "Failure sending request") - return - } - - result.vmlr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "List", resp, "Failure responding to request") - return - } - if result.vmlr.hasNextLink() && result.vmlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualMachinesClient) ListPreparer(ctx context.Context, resourceGroupName string, filter string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - 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.Compute/virtualMachines", 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 VirtualMachinesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) ListResponder(resp *http.Response) (result VirtualMachineListResult, err error) { - err = autorest.Respond( - resp, - 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 VirtualMachinesClient) listNextResults(ctx context.Context, lastResults VirtualMachineListResult) (result VirtualMachineListResult, err error) { - req, err := lastResults.virtualMachineListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "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, "compute.VirtualMachinesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualMachinesClient) ListComplete(ctx context.Context, resourceGroupName string, filter string) (result VirtualMachineListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, filter) - return -} - -// ListAll lists all of the virtual machines in the specified subscription. Use the nextLink property in the response -// to get the next page of virtual machines. -// Parameters: -// statusOnly - statusOnly=true enables fetching run time status of all Virtual Machines in the subscription. -// filter - the system query option to filter VMs returned in the response. Allowed value is -// 'virtualMachineScaleSet/id' eq -// /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}' -func (client VirtualMachinesClient) ListAll(ctx context.Context, statusOnly string, filter string) (result VirtualMachineListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.ListAll") - defer func() { - sc := -1 - if result.vmlr.Response.Response != nil { - sc = result.vmlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listAllNextResults - req, err := client.ListAllPreparer(ctx, statusOnly, filter) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListAll", nil, "Failure preparing request") - return - } - - resp, err := client.ListAllSender(req) - if err != nil { - result.vmlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListAll", resp, "Failure sending request") - return - } - - result.vmlr, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListAll", resp, "Failure responding to request") - return - } - if result.vmlr.hasNextLink() && result.vmlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListAllPreparer prepares the ListAll request. -func (client VirtualMachinesClient) ListAllPreparer(ctx context.Context, statusOnly string, filter string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(statusOnly) > 0 { - queryParameters["statusOnly"] = autorest.Encode("query", statusOnly) - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachines", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAllSender sends the ListAll request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) ListAllSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAllResponder handles the response to the ListAll request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) ListAllResponder(resp *http.Response) (result VirtualMachineListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listAllNextResults retrieves the next set of results, if any. -func (client VirtualMachinesClient) listAllNextResults(ctx context.Context, lastResults VirtualMachineListResult) (result VirtualMachineListResult, err error) { - req, err := lastResults.virtualMachineListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "listAllNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListAllSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "listAllNextResults", resp, "Failure sending next results request") - } - result, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "listAllNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListAllComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualMachinesClient) ListAllComplete(ctx context.Context, statusOnly string, filter string) (result VirtualMachineListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.ListAll") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListAll(ctx, statusOnly, filter) - return -} - -// ListAvailableSizes lists all available virtual machine sizes to which the specified virtual machine can be resized. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -func (client VirtualMachinesClient) ListAvailableSizes(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachineSizeListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.ListAvailableSizes") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListAvailableSizesPreparer(ctx, resourceGroupName, VMName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListAvailableSizes", nil, "Failure preparing request") - return - } - - resp, err := client.ListAvailableSizesSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListAvailableSizes", resp, "Failure sending request") - return - } - - result, err = client.ListAvailableSizesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListAvailableSizes", resp, "Failure responding to request") - return - } - - return -} - -// ListAvailableSizesPreparer prepares the ListAvailableSizes request. -func (client VirtualMachinesClient) ListAvailableSizesPreparer(ctx context.Context, resourceGroupName string, VMName string) (*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 = "2022-08-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.Compute/virtualMachines/{vmName}/vmSizes", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAvailableSizesSender sends the ListAvailableSizes request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) ListAvailableSizesSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAvailableSizesResponder handles the response to the ListAvailableSizes request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) ListAvailableSizesResponder(resp *http.Response) (result VirtualMachineSizeListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByLocation gets all the virtual machines under the specified subscription for the specified location. -// Parameters: -// location - the location for which virtual machines under the subscription are queried. -func (client VirtualMachinesClient) ListByLocation(ctx context.Context, location string) (result VirtualMachineListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.ListByLocation") - defer func() { - sc := -1 - if result.vmlr.Response.Response != nil { - sc = result.vmlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - 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.NewError("compute.VirtualMachinesClient", "ListByLocation", err.Error()) - } - - result.fn = client.listByLocationNextResults - req, err := client.ListByLocationPreparer(ctx, location) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListByLocation", nil, "Failure preparing request") - return - } - - resp, err := client.ListByLocationSender(req) - if err != nil { - result.vmlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListByLocation", resp, "Failure sending request") - return - } - - result.vmlr, err = client.ListByLocationResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListByLocation", resp, "Failure responding to request") - return - } - if result.vmlr.hasNextLink() && result.vmlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByLocationPreparer prepares the ListByLocation request. -func (client VirtualMachinesClient) ListByLocationPreparer(ctx context.Context, location string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/virtualMachines", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByLocationSender sends the ListByLocation request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) ListByLocationSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByLocationResponder handles the response to the ListByLocation request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) ListByLocationResponder(resp *http.Response) (result VirtualMachineListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByLocationNextResults retrieves the next set of results, if any. -func (client VirtualMachinesClient) listByLocationNextResults(ctx context.Context, lastResults VirtualMachineListResult) (result VirtualMachineListResult, err error) { - req, err := lastResults.virtualMachineListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "listByLocationNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByLocationSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "listByLocationNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByLocationResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "listByLocationNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByLocationComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualMachinesClient) ListByLocationComplete(ctx context.Context, location string) (result VirtualMachineListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.ListByLocation") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByLocation(ctx, location) - return -} - -// PerformMaintenance the operation to perform maintenance on a virtual machine. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -func (client VirtualMachinesClient) PerformMaintenance(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachinesPerformMaintenanceFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.PerformMaintenance") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.PerformMaintenancePreparer(ctx, resourceGroupName, VMName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "PerformMaintenance", nil, "Failure preparing request") - return - } - - result, err = client.PerformMaintenanceSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "PerformMaintenance", result.Response(), "Failure sending request") - return - } - - return -} - -// PerformMaintenancePreparer prepares the PerformMaintenance request. -func (client VirtualMachinesClient) PerformMaintenancePreparer(ctx context.Context, resourceGroupName string, VMName string) (*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 = "2022-08-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.Compute/virtualMachines/{vmName}/performMaintenance", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// PerformMaintenanceSender sends the PerformMaintenance request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) PerformMaintenanceSender(req *http.Request) (future VirtualMachinesPerformMaintenanceFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// PerformMaintenanceResponder handles the response to the PerformMaintenance request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) PerformMaintenanceResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// PowerOff the operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same -// provisioned resources. You are still charged for this virtual machine. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -// skipShutdown - the parameter to request non-graceful VM shutdown. True value for this flag indicates -// non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not -// specified -func (client VirtualMachinesClient) PowerOff(ctx context.Context, resourceGroupName string, VMName string, skipShutdown *bool) (result VirtualMachinesPowerOffFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.PowerOff") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.PowerOffPreparer(ctx, resourceGroupName, VMName, skipShutdown) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "PowerOff", nil, "Failure preparing request") - return - } - - result, err = client.PowerOffSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "PowerOff", result.Response(), "Failure sending request") - return - } - - return -} - -// PowerOffPreparer prepares the PowerOff request. -func (client VirtualMachinesClient) PowerOffPreparer(ctx context.Context, resourceGroupName string, VMName string, skipShutdown *bool) (*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 = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if skipShutdown != nil { - queryParameters["skipShutdown"] = autorest.Encode("query", *skipShutdown) - } else { - queryParameters["skipShutdown"] = autorest.Encode("query", false) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/powerOff", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// PowerOffSender sends the PowerOff request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) PowerOffSender(req *http.Request) (future VirtualMachinesPowerOffFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// PowerOffResponder handles the response to the PowerOff request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) PowerOffResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Reapply the operation to reapply a virtual machine's state. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -func (client VirtualMachinesClient) Reapply(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachinesReapplyFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Reapply") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ReapplyPreparer(ctx, resourceGroupName, VMName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Reapply", nil, "Failure preparing request") - return - } - - result, err = client.ReapplySender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Reapply", result.Response(), "Failure sending request") - return - } - - return -} - -// ReapplyPreparer prepares the Reapply request. -func (client VirtualMachinesClient) ReapplyPreparer(ctx context.Context, resourceGroupName string, VMName string) (*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 = "2022-08-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.Compute/virtualMachines/{vmName}/reapply", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ReapplySender sends the Reapply request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) ReapplySender(req *http.Request) (future VirtualMachinesReapplyFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ReapplyResponder handles the response to the Reapply request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) ReapplyResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Redeploy shuts down the virtual machine, moves it to a new node, and powers it back on. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -func (client VirtualMachinesClient) Redeploy(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachinesRedeployFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Redeploy") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.RedeployPreparer(ctx, resourceGroupName, VMName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Redeploy", nil, "Failure preparing request") - return - } - - result, err = client.RedeploySender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Redeploy", result.Response(), "Failure sending request") - return - } - - return -} - -// RedeployPreparer prepares the Redeploy request. -func (client VirtualMachinesClient) RedeployPreparer(ctx context.Context, resourceGroupName string, VMName string) (*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 = "2022-08-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.Compute/virtualMachines/{vmName}/redeploy", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RedeploySender sends the Redeploy request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) RedeploySender(req *http.Request) (future VirtualMachinesRedeployFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// RedeployResponder handles the response to the Redeploy request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) RedeployResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Reimage reimages the virtual machine which has an ephemeral OS disk back to its initial state. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -// parameters - parameters supplied to the Reimage Virtual Machine operation. -func (client VirtualMachinesClient) Reimage(ctx context.Context, resourceGroupName string, VMName string, parameters *VirtualMachineReimageParameters) (result VirtualMachinesReimageFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Reimage") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ReimagePreparer(ctx, resourceGroupName, VMName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Reimage", nil, "Failure preparing request") - return - } - - result, err = client.ReimageSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Reimage", result.Response(), "Failure sending request") - return - } - - return -} - -// ReimagePreparer prepares the Reimage request. -func (client VirtualMachinesClient) ReimagePreparer(ctx context.Context, resourceGroupName string, VMName string, parameters *VirtualMachineReimageParameters) (*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 = "2022-08-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.Compute/virtualMachines/{vmName}/reimage", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if parameters != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(parameters)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ReimageSender sends the Reimage request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) ReimageSender(req *http.Request) (future VirtualMachinesReimageFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ReimageResponder handles the response to the Reimage request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) ReimageResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Restart the operation to restart a virtual machine. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -func (client VirtualMachinesClient) Restart(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachinesRestartFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Restart") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.RestartPreparer(ctx, resourceGroupName, VMName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Restart", nil, "Failure preparing request") - return - } - - result, err = client.RestartSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Restart", result.Response(), "Failure sending request") - return - } - - return -} - -// RestartPreparer prepares the Restart request. -func (client VirtualMachinesClient) RestartPreparer(ctx context.Context, resourceGroupName string, VMName string) (*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 = "2022-08-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.Compute/virtualMachines/{vmName}/restart", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RestartSender sends the Restart request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) RestartSender(req *http.Request) (future VirtualMachinesRestartFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// RestartResponder handles the response to the Restart request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) RestartResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// RetrieveBootDiagnosticsData the operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -// sasURIExpirationTimeInMinutes - expiration duration in minutes for the SAS URIs with a value between 1 to -// 1440 minutes.

      NOTE: If not specified, SAS URIs will be generated with a default expiration duration -// of 120 minutes. -func (client VirtualMachinesClient) RetrieveBootDiagnosticsData(ctx context.Context, resourceGroupName string, VMName string, sasURIExpirationTimeInMinutes *int32) (result RetrieveBootDiagnosticsDataResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.RetrieveBootDiagnosticsData") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.RetrieveBootDiagnosticsDataPreparer(ctx, resourceGroupName, VMName, sasURIExpirationTimeInMinutes) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "RetrieveBootDiagnosticsData", nil, "Failure preparing request") - return - } - - resp, err := client.RetrieveBootDiagnosticsDataSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "RetrieveBootDiagnosticsData", resp, "Failure sending request") - return - } - - result, err = client.RetrieveBootDiagnosticsDataResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "RetrieveBootDiagnosticsData", resp, "Failure responding to request") - return - } - - return -} - -// RetrieveBootDiagnosticsDataPreparer prepares the RetrieveBootDiagnosticsData request. -func (client VirtualMachinesClient) RetrieveBootDiagnosticsDataPreparer(ctx context.Context, resourceGroupName string, VMName string, sasURIExpirationTimeInMinutes *int32) (*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 = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if sasURIExpirationTimeInMinutes != nil { - queryParameters["sasUriExpirationTimeInMinutes"] = autorest.Encode("query", *sasURIExpirationTimeInMinutes) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/retrieveBootDiagnosticsData", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RetrieveBootDiagnosticsDataSender sends the RetrieveBootDiagnosticsData request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) RetrieveBootDiagnosticsDataSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// RetrieveBootDiagnosticsDataResponder handles the response to the RetrieveBootDiagnosticsData request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) RetrieveBootDiagnosticsDataResponder(resp *http.Response) (result RetrieveBootDiagnosticsDataResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// RunCommand run command on the VM. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -// parameters - parameters supplied to the Run command operation. -func (client VirtualMachinesClient) RunCommand(ctx context.Context, resourceGroupName string, VMName string, parameters RunCommandInput) (result VirtualMachinesRunCommandFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.RunCommand") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - 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.NewError("compute.VirtualMachinesClient", "RunCommand", err.Error()) - } - - req, err := client.RunCommandPreparer(ctx, resourceGroupName, VMName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "RunCommand", nil, "Failure preparing request") - return - } - - result, err = client.RunCommandSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "RunCommand", result.Response(), "Failure sending request") - return - } - - return -} - -// RunCommandPreparer prepares the RunCommand request. -func (client VirtualMachinesClient) RunCommandPreparer(ctx context.Context, resourceGroupName string, VMName string, parameters RunCommandInput) (*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 = "2022-08-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.Compute/virtualMachines/{vmName}/runCommand", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RunCommandSender sends the RunCommand request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) RunCommandSender(req *http.Request) (future VirtualMachinesRunCommandFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// RunCommandResponder handles the response to the RunCommand request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) RunCommandResponder(resp *http.Response) (result RunCommandResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// SimulateEviction the operation to simulate the eviction of spot virtual machine. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -func (client VirtualMachinesClient) SimulateEviction(ctx context.Context, resourceGroupName string, VMName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.SimulateEviction") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.SimulateEvictionPreparer(ctx, resourceGroupName, VMName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "SimulateEviction", nil, "Failure preparing request") - return - } - - resp, err := client.SimulateEvictionSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "SimulateEviction", resp, "Failure sending request") - return - } - - result, err = client.SimulateEvictionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "SimulateEviction", resp, "Failure responding to request") - return - } - - return -} - -// SimulateEvictionPreparer prepares the SimulateEviction request. -func (client VirtualMachinesClient) SimulateEvictionPreparer(ctx context.Context, resourceGroupName string, VMName string) (*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 = "2022-08-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.Compute/virtualMachines/{vmName}/simulateEviction", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// SimulateEvictionSender sends the SimulateEviction request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) SimulateEvictionSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// SimulateEvictionResponder handles the response to the SimulateEviction request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) SimulateEvictionResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Start the operation to start a virtual machine. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -func (client VirtualMachinesClient) Start(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachinesStartFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Start") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.StartPreparer(ctx, resourceGroupName, VMName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Start", nil, "Failure preparing request") - return - } - - result, err = client.StartSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Start", result.Response(), "Failure sending request") - return - } - - return -} - -// StartPreparer prepares the Start request. -func (client VirtualMachinesClient) StartPreparer(ctx context.Context, resourceGroupName string, VMName string) (*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 = "2022-08-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.Compute/virtualMachines/{vmName}/start", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// StartSender sends the Start request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) StartSender(req *http.Request) (future VirtualMachinesStartFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// StartResponder handles the response to the Start request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) StartResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Update the operation to update a virtual machine. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -// parameters - 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) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - 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 = "2022-08-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) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - 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, - 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/2022-08-01/compute/virtualmachinescalesetextensions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachinescalesetextensions.go deleted file mode 100644 index d790ab51..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachinescalesetextensions.go +++ /dev/null @@ -1,495 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualMachineScaleSetExtensionsClient is the compute Client -type VirtualMachineScaleSetExtensionsClient struct { - BaseClient -} - -// NewVirtualMachineScaleSetExtensionsClient creates an instance of the VirtualMachineScaleSetExtensionsClient client. -func NewVirtualMachineScaleSetExtensionsClient(subscriptionID string) VirtualMachineScaleSetExtensionsClient { - return NewVirtualMachineScaleSetExtensionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualMachineScaleSetExtensionsClientWithBaseURI creates an instance of the -// VirtualMachineScaleSetExtensionsClient client using a custom endpoint. Use this when interacting with an Azure -// cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewVirtualMachineScaleSetExtensionsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineScaleSetExtensionsClient { - return VirtualMachineScaleSetExtensionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate the operation to create or update an extension. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set where the extension should be create or updated. -// vmssExtensionName - the name of the VM scale set extension. -// extensionParameters - parameters supplied to the Create VM scale set Extension operation. -func (client VirtualMachineScaleSetExtensionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, VMScaleSetName string, vmssExtensionName string, extensionParameters VirtualMachineScaleSetExtension) (result VirtualMachineScaleSetExtensionsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: extensionParameters, - Constraints: []validation.Constraint{{Target: "extensionParameters.VirtualMachineScaleSetExtensionProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "extensionParameters.VirtualMachineScaleSetExtensionProperties.ProtectedSettingsFromKeyVault", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "extensionParameters.VirtualMachineScaleSetExtensionProperties.ProtectedSettingsFromKeyVault.SecretURL", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "extensionParameters.VirtualMachineScaleSetExtensionProperties.ProtectedSettingsFromKeyVault.SourceVault", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}}}}); err != nil { - return result, validation.NewError("compute.VirtualMachineScaleSetExtensionsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, VMScaleSetName, vmssExtensionName, extensionParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VirtualMachineScaleSetExtensionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, vmssExtensionName string, extensionParameters VirtualMachineScaleSetExtension) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - "vmssExtensionName": autorest.Encode("path", vmssExtensionName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - extensionParameters.Type = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}", pathParameters), - autorest.WithJSON(extensionParameters), - 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 VirtualMachineScaleSetExtensionsClient) CreateOrUpdateSender(req *http.Request) (future VirtualMachineScaleSetExtensionsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetExtensionsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualMachineScaleSetExtension, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete the operation to delete the extension. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set where the extension should be deleted. -// vmssExtensionName - the name of the VM scale set extension. -func (client VirtualMachineScaleSetExtensionsClient) Delete(ctx context.Context, resourceGroupName string, VMScaleSetName string, vmssExtensionName string) (result VirtualMachineScaleSetExtensionsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, VMScaleSetName, vmssExtensionName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VirtualMachineScaleSetExtensionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, vmssExtensionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - "vmssExtensionName": autorest.Encode("path", vmssExtensionName), - } - - const APIVersion = "2022-08-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.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}", 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 VirtualMachineScaleSetExtensionsClient) DeleteSender(req *http.Request) (future VirtualMachineScaleSetExtensionsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetExtensionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get the operation to get the extension. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set containing the extension. -// vmssExtensionName - the name of the VM scale set extension. -// expand - 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) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, VMScaleSetName, vmssExtensionName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualMachineScaleSetExtensionsClient) GetPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, vmssExtensionName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - "vmssExtensionName": autorest.Encode("path", vmssExtensionName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}", 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 VirtualMachineScaleSetExtensionsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetExtensionsClient) GetResponder(resp *http.Response) (result VirtualMachineScaleSetExtension, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets a list of all extensions in a VM scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - 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) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionsClient.List") - defer func() { - sc := -1 - if result.vmsselr.Response.Response != nil { - sc = result.vmsselr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, VMScaleSetName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.vmsselr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "List", resp, "Failure sending request") - return - } - - result.vmsselr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "List", resp, "Failure responding to request") - return - } - if result.vmsselr.hasNextLink() && result.vmsselr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualMachineScaleSetExtensionsClient) ListPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-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.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions", 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 VirtualMachineScaleSetExtensionsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetExtensionsClient) ListResponder(resp *http.Response) (result VirtualMachineScaleSetExtensionListResult, err error) { - err = autorest.Respond( - resp, - 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 VirtualMachineScaleSetExtensionsClient) listNextResults(ctx context.Context, lastResults VirtualMachineScaleSetExtensionListResult) (result VirtualMachineScaleSetExtensionListResult, err error) { - req, err := lastResults.virtualMachineScaleSetExtensionListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "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, "compute.VirtualMachineScaleSetExtensionsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualMachineScaleSetExtensionsClient) ListComplete(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetExtensionListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, VMScaleSetName) - return -} - -// Update the operation to update an extension. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set where the extension should be updated. -// vmssExtensionName - the name of the VM scale set extension. -// extensionParameters - parameters supplied to the Update VM scale set Extension operation. -func (client VirtualMachineScaleSetExtensionsClient) Update(ctx context.Context, resourceGroupName string, VMScaleSetName string, vmssExtensionName string, extensionParameters VirtualMachineScaleSetExtensionUpdate) (result VirtualMachineScaleSetExtensionsUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionsClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, VMScaleSetName, vmssExtensionName, extensionParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client VirtualMachineScaleSetExtensionsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, vmssExtensionName string, extensionParameters VirtualMachineScaleSetExtensionUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - "vmssExtensionName": autorest.Encode("path", vmssExtensionName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - extensionParameters.Name = nil - extensionParameters.Type = nil - 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/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}", pathParameters), - autorest.WithJSON(extensionParameters), - 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 VirtualMachineScaleSetExtensionsClient) UpdateSender(req *http.Request) (future VirtualMachineScaleSetExtensionsUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetExtensionsClient) UpdateResponder(resp *http.Response) (result VirtualMachineScaleSetExtension, err error) { - err = autorest.Respond( - resp, - 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/2022-08-01/compute/virtualmachinescalesetrollingupgrades.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachinescalesetrollingupgrades.go deleted file mode 100644 index f1fe6196..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachinescalesetrollingupgrades.go +++ /dev/null @@ -1,346 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualMachineScaleSetRollingUpgradesClient is the compute Client -type VirtualMachineScaleSetRollingUpgradesClient struct { - BaseClient -} - -// NewVirtualMachineScaleSetRollingUpgradesClient creates an instance of the -// VirtualMachineScaleSetRollingUpgradesClient client. -func NewVirtualMachineScaleSetRollingUpgradesClient(subscriptionID string) VirtualMachineScaleSetRollingUpgradesClient { - return NewVirtualMachineScaleSetRollingUpgradesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualMachineScaleSetRollingUpgradesClientWithBaseURI creates an instance of the -// VirtualMachineScaleSetRollingUpgradesClient client using a custom endpoint. Use this when interacting with an Azure -// cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewVirtualMachineScaleSetRollingUpgradesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineScaleSetRollingUpgradesClient { - return VirtualMachineScaleSetRollingUpgradesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Cancel cancels the current virtual machine scale set rolling upgrade. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -func (client VirtualMachineScaleSetRollingUpgradesClient) Cancel(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetRollingUpgradesCancelFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetRollingUpgradesClient.Cancel") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CancelPreparer(ctx, resourceGroupName, VMScaleSetName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "Cancel", nil, "Failure preparing request") - return - } - - result, err = client.CancelSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "Cancel", result.Response(), "Failure sending request") - return - } - - return -} - -// CancelPreparer prepares the Cancel request. -func (client VirtualMachineScaleSetRollingUpgradesClient) CancelPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-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.Compute/virtualMachineScaleSets/{vmScaleSetName}/rollingUpgrades/cancel", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CancelSender sends the Cancel request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetRollingUpgradesClient) CancelSender(req *http.Request) (future VirtualMachineScaleSetRollingUpgradesCancelFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CancelResponder handles the response to the Cancel request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetRollingUpgradesClient) CancelResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// GetLatest gets the status of the latest virtual machine scale set rolling upgrade. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -func (client VirtualMachineScaleSetRollingUpgradesClient) GetLatest(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result RollingUpgradeStatusInfo, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetRollingUpgradesClient.GetLatest") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetLatestPreparer(ctx, resourceGroupName, VMScaleSetName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "GetLatest", nil, "Failure preparing request") - return - } - - resp, err := client.GetLatestSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "GetLatest", resp, "Failure sending request") - return - } - - result, err = client.GetLatestResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "GetLatest", resp, "Failure responding to request") - return - } - - return -} - -// GetLatestPreparer prepares the GetLatest request. -func (client VirtualMachineScaleSetRollingUpgradesClient) GetLatestPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-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.Compute/virtualMachineScaleSets/{vmScaleSetName}/rollingUpgrades/latest", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetLatestSender sends the GetLatest request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetRollingUpgradesClient) GetLatestSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetLatestResponder handles the response to the GetLatest request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetRollingUpgradesClient) GetLatestResponder(resp *http.Response) (result RollingUpgradeStatusInfo, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// StartExtensionUpgrade starts a rolling upgrade to move all extensions for all virtual machine scale set instances to -// the latest available extension version. Instances which are already running the latest extension versions are not -// affected. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -func (client VirtualMachineScaleSetRollingUpgradesClient) StartExtensionUpgrade(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetRollingUpgradesClient.StartExtensionUpgrade") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.StartExtensionUpgradePreparer(ctx, resourceGroupName, VMScaleSetName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "StartExtensionUpgrade", nil, "Failure preparing request") - return - } - - result, err = client.StartExtensionUpgradeSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "StartExtensionUpgrade", result.Response(), "Failure sending request") - return - } - - return -} - -// StartExtensionUpgradePreparer prepares the StartExtensionUpgrade request. -func (client VirtualMachineScaleSetRollingUpgradesClient) StartExtensionUpgradePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-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.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensionRollingUpgrade", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// StartExtensionUpgradeSender sends the StartExtensionUpgrade request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetRollingUpgradesClient) StartExtensionUpgradeSender(req *http.Request) (future VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// StartExtensionUpgradeResponder handles the response to the StartExtensionUpgrade request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetRollingUpgradesClient) StartExtensionUpgradeResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// StartOSUpgrade starts a rolling upgrade to move all virtual machine scale set instances to the latest available -// Platform Image OS version. Instances which are already running the latest available OS version are not affected. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -func (client VirtualMachineScaleSetRollingUpgradesClient) StartOSUpgrade(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetRollingUpgradesClient.StartOSUpgrade") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.StartOSUpgradePreparer(ctx, resourceGroupName, VMScaleSetName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "StartOSUpgrade", nil, "Failure preparing request") - return - } - - result, err = client.StartOSUpgradeSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "StartOSUpgrade", result.Response(), "Failure sending request") - return - } - - return -} - -// StartOSUpgradePreparer prepares the StartOSUpgrade request. -func (client VirtualMachineScaleSetRollingUpgradesClient) StartOSUpgradePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-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.Compute/virtualMachineScaleSets/{vmScaleSetName}/osRollingUpgrade", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// StartOSUpgradeSender sends the StartOSUpgrade request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetRollingUpgradesClient) StartOSUpgradeSender(req *http.Request) (future VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// StartOSUpgradeResponder handles the response to the StartOSUpgrade request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetRollingUpgradesClient) StartOSUpgradeResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachinescalesets.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachinescalesets.go deleted file mode 100644 index 6d0f4c52..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachinescalesets.go +++ /dev/null @@ -1,2170 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualMachineScaleSetsClient is the compute Client -type VirtualMachineScaleSetsClient struct { - BaseClient -} - -// NewVirtualMachineScaleSetsClient creates an instance of the VirtualMachineScaleSetsClient client. -func NewVirtualMachineScaleSetsClient(subscriptionID string) VirtualMachineScaleSetsClient { - return NewVirtualMachineScaleSetsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualMachineScaleSetsClientWithBaseURI creates an instance of the VirtualMachineScaleSetsClient client using a -// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, -// Azure stack). -func NewVirtualMachineScaleSetsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineScaleSetsClient { - return VirtualMachineScaleSetsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// ConvertToSinglePlacementGroup converts SinglePlacementGroup property to false for a existing virtual machine scale -// set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the virtual machine scale set to create or update. -// parameters - the input object for ConvertToSinglePlacementGroup API. -func (client VirtualMachineScaleSetsClient) ConvertToSinglePlacementGroup(ctx context.Context, resourceGroupName string, VMScaleSetName string, parameters VMScaleSetConvertToSinglePlacementGroupInput) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.ConvertToSinglePlacementGroup") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ConvertToSinglePlacementGroupPreparer(ctx, resourceGroupName, VMScaleSetName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ConvertToSinglePlacementGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ConvertToSinglePlacementGroupSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ConvertToSinglePlacementGroup", resp, "Failure sending request") - return - } - - result, err = client.ConvertToSinglePlacementGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ConvertToSinglePlacementGroup", resp, "Failure responding to request") - return - } - - return -} - -// ConvertToSinglePlacementGroupPreparer prepares the ConvertToSinglePlacementGroup request. -func (client VirtualMachineScaleSetsClient) ConvertToSinglePlacementGroupPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, parameters VMScaleSetConvertToSinglePlacementGroupInput) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-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.Compute/virtualMachineScaleSets/{vmScaleSetName}/convertToSinglePlacementGroup", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ConvertToSinglePlacementGroupSender sends the ConvertToSinglePlacementGroup request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) ConvertToSinglePlacementGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ConvertToSinglePlacementGroupResponder handles the response to the ConvertToSinglePlacementGroup request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) ConvertToSinglePlacementGroupResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// CreateOrUpdate create or update a VM scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set to create or update. -// parameters - the scale set object. -func (client VirtualMachineScaleSetsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, VMScaleSetName string, parameters VirtualMachineScaleSet) (result VirtualMachineScaleSetsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxBatchInstancePercent", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxBatchInstancePercent", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, - {Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxBatchInstancePercent", Name: validation.InclusiveMinimum, Rule: int64(5), Chain: nil}, - }}, - {Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxUnhealthyInstancePercent", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxUnhealthyInstancePercent", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, - {Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxUnhealthyInstancePercent", Name: validation.InclusiveMinimum, Rule: int64(5), Chain: nil}, - }}, - {Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxUnhealthyUpgradedInstancePercent", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxUnhealthyUpgradedInstancePercent", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, - {Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxUnhealthyUpgradedInstancePercent", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, - }}, - }}, - }}, - {Target: "parameters.VirtualMachineScaleSetProperties.PriorityMixPolicy", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.PriorityMixPolicy.BaseRegularPriorityCount", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.PriorityMixPolicy.BaseRegularPriorityCount", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}, - {Target: "parameters.VirtualMachineScaleSetProperties.PriorityMixPolicy.RegularPriorityPercentageAboveBase", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.PriorityMixPolicy.RegularPriorityPercentageAboveBase", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, - {Target: "parameters.VirtualMachineScaleSetProperties.PriorityMixPolicy.RegularPriorityPercentageAboveBase", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("compute.VirtualMachineScaleSetsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, VMScaleSetName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VirtualMachineScaleSetsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, parameters VirtualMachineScaleSet) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-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.Compute/virtualMachineScaleSets/{vmScaleSetName}", 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 VirtualMachineScaleSetsClient) CreateOrUpdateSender(req *http.Request) (future VirtualMachineScaleSetsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualMachineScaleSet, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// 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. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// VMInstanceIDs - 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) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.Deallocate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeallocatePreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Deallocate", nil, "Failure preparing request") - return - } - - result, err = client.DeallocateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Deallocate", result.Response(), "Failure sending request") - return - } - - return -} - -// DeallocatePreparer prepares the Deallocate request. -func (client VirtualMachineScaleSetsClient) DeallocatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-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.Compute/virtualMachineScaleSets/{vmScaleSetName}/deallocate", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if VMInstanceIDs != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(VMInstanceIDs)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeallocateSender sends the Deallocate request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) DeallocateSender(req *http.Request) (future VirtualMachineScaleSetsDeallocateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeallocateResponder handles the response to the Deallocate request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) DeallocateResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Delete deletes a VM scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// forceDeletion - optional parameter to force delete a VM scale set. (Feature in Preview) -func (client VirtualMachineScaleSetsClient) Delete(ctx context.Context, resourceGroupName string, VMScaleSetName string, forceDeletion *bool) (result VirtualMachineScaleSetsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, VMScaleSetName, forceDeletion) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VirtualMachineScaleSetsClient) DeletePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, forceDeletion *bool) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if forceDeletion != nil { - queryParameters["forceDeletion"] = autorest.Encode("query", *forceDeletion) - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}", 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 VirtualMachineScaleSetsClient) DeleteSender(req *http.Request) (future VirtualMachineScaleSetsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// DeleteInstances deletes virtual machines in a VM scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// VMInstanceIDs - a list of virtual machine instance IDs from the VM scale set. -// forceDeletion - optional parameter to force delete virtual machines from the VM scale set. (Feature in -// Preview) -func (client VirtualMachineScaleSetsClient) DeleteInstances(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs, forceDeletion *bool) (result VirtualMachineScaleSetsDeleteInstancesFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.DeleteInstances") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - 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.NewError("compute.VirtualMachineScaleSetsClient", "DeleteInstances", err.Error()) - } - - req, err := client.DeleteInstancesPreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs, forceDeletion) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "DeleteInstances", nil, "Failure preparing request") - return - } - - result, err = client.DeleteInstancesSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "DeleteInstances", result.Response(), "Failure sending request") - return - } - - return -} - -// DeleteInstancesPreparer prepares the DeleteInstances request. -func (client VirtualMachineScaleSetsClient) DeleteInstancesPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs, forceDeletion *bool) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if forceDeletion != nil { - queryParameters["forceDeletion"] = autorest.Encode("query", *forceDeletion) - } - - preparer := autorest.CreatePreparer( - 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), - autorest.WithJSON(VMInstanceIDs), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteInstancesSender sends the DeleteInstances request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) DeleteInstancesSender(req *http.Request) (future VirtualMachineScaleSetsDeleteInstancesFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteInstancesResponder handles the response to the DeleteInstances request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) DeleteInstancesResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// ForceRecoveryServiceFabricPlatformUpdateDomainWalk manual platform update domain walk to update virtual machines in -// a service fabric virtual machine scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// platformUpdateDomain - the platform update domain for which a manual recovery walk is requested -// zone - the zone in which the manual recovery walk is requested for cross zone virtual machine scale set -// placementGroupID - the placement group id for which the manual recovery walk is requested. -func (client VirtualMachineScaleSetsClient) ForceRecoveryServiceFabricPlatformUpdateDomainWalk(ctx context.Context, resourceGroupName string, VMScaleSetName string, platformUpdateDomain int32, zone string, placementGroupID string) (result RecoveryWalkResponse, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.ForceRecoveryServiceFabricPlatformUpdateDomainWalk") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ForceRecoveryServiceFabricPlatformUpdateDomainWalkPreparer(ctx, resourceGroupName, VMScaleSetName, platformUpdateDomain, zone, placementGroupID) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ForceRecoveryServiceFabricPlatformUpdateDomainWalk", nil, "Failure preparing request") - return - } - - resp, err := client.ForceRecoveryServiceFabricPlatformUpdateDomainWalkSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ForceRecoveryServiceFabricPlatformUpdateDomainWalk", resp, "Failure sending request") - return - } - - result, err = client.ForceRecoveryServiceFabricPlatformUpdateDomainWalkResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ForceRecoveryServiceFabricPlatformUpdateDomainWalk", resp, "Failure responding to request") - return - } - - return -} - -// ForceRecoveryServiceFabricPlatformUpdateDomainWalkPreparer prepares the ForceRecoveryServiceFabricPlatformUpdateDomainWalk request. -func (client VirtualMachineScaleSetsClient) ForceRecoveryServiceFabricPlatformUpdateDomainWalkPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, platformUpdateDomain int32, zone string, placementGroupID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - "platformUpdateDomain": autorest.Encode("query", platformUpdateDomain), - } - if len(zone) > 0 { - queryParameters["zone"] = autorest.Encode("query", zone) - } - if len(placementGroupID) > 0 { - queryParameters["placementGroupId"] = autorest.Encode("query", placementGroupID) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/forceRecoveryServiceFabricPlatformUpdateDomainWalk", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ForceRecoveryServiceFabricPlatformUpdateDomainWalkSender sends the ForceRecoveryServiceFabricPlatformUpdateDomainWalk request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) ForceRecoveryServiceFabricPlatformUpdateDomainWalkSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ForceRecoveryServiceFabricPlatformUpdateDomainWalkResponder handles the response to the ForceRecoveryServiceFabricPlatformUpdateDomainWalk request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) ForceRecoveryServiceFabricPlatformUpdateDomainWalkResponder(resp *http.Response) (result RecoveryWalkResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Get display information about a virtual machine scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// expand - the expand expression to apply on the operation. 'UserData' retrieves the UserData property of the -// VM scale set that was provided by the user during the VM scale set Create/Update operation -func (client VirtualMachineScaleSetsClient) Get(ctx context.Context, resourceGroupName string, VMScaleSetName string, expand ExpandTypesForGetVMScaleSets) (result VirtualMachineScaleSet, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, VMScaleSetName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualMachineScaleSetsClient) GetPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, expand ExpandTypesForGetVMScaleSets) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(string(expand)) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}", 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 VirtualMachineScaleSetsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) GetResponder(resp *http.Response) (result VirtualMachineScaleSet, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetInstanceView gets the status of a VM scale set instance. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -func (client VirtualMachineScaleSetsClient) GetInstanceView(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetInstanceView, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.GetInstanceView") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetInstanceViewPreparer(ctx, resourceGroupName, VMScaleSetName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "GetInstanceView", nil, "Failure preparing request") - return - } - - resp, err := client.GetInstanceViewSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "GetInstanceView", resp, "Failure sending request") - return - } - - result, err = client.GetInstanceViewResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "GetInstanceView", resp, "Failure responding to request") - return - } - - return -} - -// GetInstanceViewPreparer prepares the GetInstanceView request. -func (client VirtualMachineScaleSetsClient) GetInstanceViewPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-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.Compute/virtualMachineScaleSets/{vmScaleSetName}/instanceView", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetInstanceViewSender sends the GetInstanceView request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) GetInstanceViewSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetInstanceViewResponder handles the response to the GetInstanceView request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) GetInstanceViewResponder(resp *http.Response) (result VirtualMachineScaleSetInstanceView, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetOSUpgradeHistory gets list of OS upgrades on a VM scale set instance. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -func (client VirtualMachineScaleSetsClient) GetOSUpgradeHistory(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetListOSUpgradeHistoryPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.GetOSUpgradeHistory") - defer func() { - sc := -1 - if result.vmsslouh.Response.Response != nil { - sc = result.vmsslouh.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.getOSUpgradeHistoryNextResults - req, err := client.GetOSUpgradeHistoryPreparer(ctx, resourceGroupName, VMScaleSetName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "GetOSUpgradeHistory", nil, "Failure preparing request") - return - } - - resp, err := client.GetOSUpgradeHistorySender(req) - if err != nil { - result.vmsslouh.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "GetOSUpgradeHistory", resp, "Failure sending request") - return - } - - result.vmsslouh, err = client.GetOSUpgradeHistoryResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "GetOSUpgradeHistory", resp, "Failure responding to request") - return - } - if result.vmsslouh.hasNextLink() && result.vmsslouh.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// GetOSUpgradeHistoryPreparer prepares the GetOSUpgradeHistory request. -func (client VirtualMachineScaleSetsClient) GetOSUpgradeHistoryPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-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.Compute/virtualMachineScaleSets/{vmScaleSetName}/osUpgradeHistory", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetOSUpgradeHistorySender sends the GetOSUpgradeHistory request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) GetOSUpgradeHistorySender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetOSUpgradeHistoryResponder handles the response to the GetOSUpgradeHistory request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) GetOSUpgradeHistoryResponder(resp *http.Response) (result VirtualMachineScaleSetListOSUpgradeHistory, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// getOSUpgradeHistoryNextResults retrieves the next set of results, if any. -func (client VirtualMachineScaleSetsClient) getOSUpgradeHistoryNextResults(ctx context.Context, lastResults VirtualMachineScaleSetListOSUpgradeHistory) (result VirtualMachineScaleSetListOSUpgradeHistory, err error) { - req, err := lastResults.virtualMachineScaleSetListOSUpgradeHistoryPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "getOSUpgradeHistoryNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.GetOSUpgradeHistorySender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "getOSUpgradeHistoryNextResults", resp, "Failure sending next results request") - } - result, err = client.GetOSUpgradeHistoryResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "getOSUpgradeHistoryNextResults", resp, "Failure responding to next results request") - } - return -} - -// GetOSUpgradeHistoryComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualMachineScaleSetsClient) GetOSUpgradeHistoryComplete(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetListOSUpgradeHistoryIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.GetOSUpgradeHistory") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.GetOSUpgradeHistory(ctx, resourceGroupName, VMScaleSetName) - return -} - -// List gets a list of all VM scale sets under a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client VirtualMachineScaleSetsClient) List(ctx context.Context, resourceGroupName string) (result VirtualMachineScaleSetListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.List") - defer func() { - sc := -1 - if result.vmsslr.Response.Response != nil { - sc = result.vmsslr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.vmsslr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "List", resp, "Failure sending request") - return - } - - result.vmsslr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "List", resp, "Failure responding to request") - return - } - if result.vmsslr.hasNextLink() && result.vmsslr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualMachineScaleSetsClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-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.Compute/virtualMachineScaleSets", 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 VirtualMachineScaleSetsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) ListResponder(resp *http.Response) (result VirtualMachineScaleSetListResult, err error) { - err = autorest.Respond( - resp, - 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 VirtualMachineScaleSetsClient) listNextResults(ctx context.Context, lastResults VirtualMachineScaleSetListResult) (result VirtualMachineScaleSetListResult, err error) { - req, err := lastResults.virtualMachineScaleSetListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "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, "compute.VirtualMachineScaleSetsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualMachineScaleSetsClient) ListComplete(ctx context.Context, resourceGroupName string) (result VirtualMachineScaleSetListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName) - return -} - -// ListAll gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use -// nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all -// the VM Scale Sets. -func (client VirtualMachineScaleSetsClient) ListAll(ctx context.Context) (result VirtualMachineScaleSetListWithLinkResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.ListAll") - defer func() { - sc := -1 - if result.vmsslwlr.Response.Response != nil { - sc = result.vmsslwlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listAllNextResults - req, err := client.ListAllPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListAll", nil, "Failure preparing request") - return - } - - resp, err := client.ListAllSender(req) - if err != nil { - result.vmsslwlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListAll", resp, "Failure sending request") - return - } - - result.vmsslwlr, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListAll", resp, "Failure responding to request") - return - } - if result.vmsslwlr.hasNextLink() && result.vmsslwlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListAllPreparer prepares the ListAll request. -func (client VirtualMachineScaleSetsClient) ListAllPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachineScaleSets", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAllSender sends the ListAll request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) ListAllSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAllResponder handles the response to the ListAll request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) ListAllResponder(resp *http.Response) (result VirtualMachineScaleSetListWithLinkResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listAllNextResults retrieves the next set of results, if any. -func (client VirtualMachineScaleSetsClient) listAllNextResults(ctx context.Context, lastResults VirtualMachineScaleSetListWithLinkResult) (result VirtualMachineScaleSetListWithLinkResult, err error) { - req, err := lastResults.virtualMachineScaleSetListWithLinkResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "listAllNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListAllSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "listAllNextResults", resp, "Failure sending next results request") - } - result, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "listAllNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListAllComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualMachineScaleSetsClient) ListAllComplete(ctx context.Context) (result VirtualMachineScaleSetListWithLinkResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.ListAll") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListAll(ctx) - return -} - -// ListByLocation gets all the VM scale sets under the specified subscription for the specified location. -// Parameters: -// location - the location for which VM scale sets under the subscription are queried. -func (client VirtualMachineScaleSetsClient) ListByLocation(ctx context.Context, location string) (result VirtualMachineScaleSetListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.ListByLocation") - defer func() { - sc := -1 - if result.vmsslr.Response.Response != nil { - sc = result.vmsslr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - 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.NewError("compute.VirtualMachineScaleSetsClient", "ListByLocation", err.Error()) - } - - result.fn = client.listByLocationNextResults - req, err := client.ListByLocationPreparer(ctx, location) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListByLocation", nil, "Failure preparing request") - return - } - - resp, err := client.ListByLocationSender(req) - if err != nil { - result.vmsslr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListByLocation", resp, "Failure sending request") - return - } - - result.vmsslr, err = client.ListByLocationResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListByLocation", resp, "Failure responding to request") - return - } - if result.vmsslr.hasNextLink() && result.vmsslr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByLocationPreparer prepares the ListByLocation request. -func (client VirtualMachineScaleSetsClient) ListByLocationPreparer(ctx context.Context, location string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/virtualMachineScaleSets", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByLocationSender sends the ListByLocation request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) ListByLocationSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByLocationResponder handles the response to the ListByLocation request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) ListByLocationResponder(resp *http.Response) (result VirtualMachineScaleSetListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByLocationNextResults retrieves the next set of results, if any. -func (client VirtualMachineScaleSetsClient) listByLocationNextResults(ctx context.Context, lastResults VirtualMachineScaleSetListResult) (result VirtualMachineScaleSetListResult, err error) { - req, err := lastResults.virtualMachineScaleSetListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "listByLocationNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByLocationSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "listByLocationNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByLocationResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "listByLocationNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByLocationComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualMachineScaleSetsClient) ListByLocationComplete(ctx context.Context, location string) (result VirtualMachineScaleSetListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.ListByLocation") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByLocation(ctx, location) - return -} - -// ListSkus gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed -// for each SKU. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -func (client VirtualMachineScaleSetsClient) ListSkus(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetListSkusResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.ListSkus") - defer func() { - sc := -1 - if result.vmsslsr.Response.Response != nil { - sc = result.vmsslsr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listSkusNextResults - req, err := client.ListSkusPreparer(ctx, resourceGroupName, VMScaleSetName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListSkus", nil, "Failure preparing request") - return - } - - resp, err := client.ListSkusSender(req) - if err != nil { - result.vmsslsr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListSkus", resp, "Failure sending request") - return - } - - result.vmsslsr, err = client.ListSkusResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListSkus", resp, "Failure responding to request") - return - } - if result.vmsslsr.hasNextLink() && result.vmsslsr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListSkusPreparer prepares the ListSkus request. -func (client VirtualMachineScaleSetsClient) ListSkusPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-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.Compute/virtualMachineScaleSets/{vmScaleSetName}/skus", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSkusSender sends the ListSkus request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) ListSkusSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListSkusResponder handles the response to the ListSkus request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) ListSkusResponder(resp *http.Response) (result VirtualMachineScaleSetListSkusResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listSkusNextResults retrieves the next set of results, if any. -func (client VirtualMachineScaleSetsClient) listSkusNextResults(ctx context.Context, lastResults VirtualMachineScaleSetListSkusResult) (result VirtualMachineScaleSetListSkusResult, err error) { - req, err := lastResults.virtualMachineScaleSetListSkusResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "listSkusNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSkusSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "listSkusNextResults", resp, "Failure sending next results request") - } - result, err = client.ListSkusResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "listSkusNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListSkusComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualMachineScaleSetsClient) ListSkusComplete(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetListSkusResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.ListSkus") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListSkus(ctx, resourceGroupName, VMScaleSetName) - return -} - -// PerformMaintenance perform maintenance on one or more virtual machines in a VM scale set. Operation on instances -// which are not eligible for perform maintenance will be failed. Please refer to best practices for more details: -// https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// VMInstanceIDs - a list of virtual machine instance IDs from the VM scale set. -func (client VirtualMachineScaleSetsClient) PerformMaintenance(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (result VirtualMachineScaleSetsPerformMaintenanceFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.PerformMaintenance") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.PerformMaintenancePreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "PerformMaintenance", nil, "Failure preparing request") - return - } - - result, err = client.PerformMaintenanceSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "PerformMaintenance", result.Response(), "Failure sending request") - return - } - - return -} - -// PerformMaintenancePreparer prepares the PerformMaintenance request. -func (client VirtualMachineScaleSetsClient) PerformMaintenancePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-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.Compute/virtualMachineScaleSets/{vmScaleSetName}/performMaintenance", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if VMInstanceIDs != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(VMInstanceIDs)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// PerformMaintenanceSender sends the PerformMaintenance request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) PerformMaintenanceSender(req *http.Request) (future VirtualMachineScaleSetsPerformMaintenanceFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// PerformMaintenanceResponder handles the response to the PerformMaintenance request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) PerformMaintenanceResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// 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. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// VMInstanceIDs - a list of virtual machine instance IDs from the VM scale set. -// skipShutdown - the parameter to request non-graceful VM shutdown. True value for this flag indicates -// non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not -// specified -func (client VirtualMachineScaleSetsClient) PowerOff(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs, skipShutdown *bool) (result VirtualMachineScaleSetsPowerOffFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.PowerOff") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.PowerOffPreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs, skipShutdown) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "PowerOff", nil, "Failure preparing request") - return - } - - result, err = client.PowerOffSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "PowerOff", result.Response(), "Failure sending request") - return - } - - return -} - -// PowerOffPreparer prepares the PowerOff request. -func (client VirtualMachineScaleSetsClient) PowerOffPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs, skipShutdown *bool) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if skipShutdown != nil { - queryParameters["skipShutdown"] = autorest.Encode("query", *skipShutdown) - } else { - queryParameters["skipShutdown"] = autorest.Encode("query", false) - } - - preparer := autorest.CreatePreparer( - 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), - autorest.WithQueryParameters(queryParameters)) - if VMInstanceIDs != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(VMInstanceIDs)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// PowerOffSender sends the PowerOff request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) PowerOffSender(req *http.Request) (future VirtualMachineScaleSetsPowerOffFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// PowerOffResponder handles the response to the PowerOff request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) PowerOffResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Redeploy shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers -// them back on. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// VMInstanceIDs - a list of virtual machine instance IDs from the VM scale set. -func (client VirtualMachineScaleSetsClient) Redeploy(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (result VirtualMachineScaleSetsRedeployFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.Redeploy") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.RedeployPreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Redeploy", nil, "Failure preparing request") - return - } - - result, err = client.RedeploySender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Redeploy", result.Response(), "Failure sending request") - return - } - - return -} - -// RedeployPreparer prepares the Redeploy request. -func (client VirtualMachineScaleSetsClient) RedeployPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-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.Compute/virtualMachineScaleSets/{vmScaleSetName}/redeploy", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if VMInstanceIDs != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(VMInstanceIDs)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RedeploySender sends the Redeploy request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) RedeploySender(req *http.Request) (future VirtualMachineScaleSetsRedeployFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// RedeployResponder handles the response to the Redeploy request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) RedeployResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Reimage reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a -// ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// VMScaleSetReimageInput - parameters for Reimaging VM ScaleSet. -func (client VirtualMachineScaleSetsClient) Reimage(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMScaleSetReimageInput *VirtualMachineScaleSetReimageParameters) (result VirtualMachineScaleSetsReimageFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.Reimage") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ReimagePreparer(ctx, resourceGroupName, VMScaleSetName, VMScaleSetReimageInput) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Reimage", nil, "Failure preparing request") - return - } - - result, err = client.ReimageSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Reimage", result.Response(), "Failure sending request") - return - } - - return -} - -// ReimagePreparer prepares the Reimage request. -func (client VirtualMachineScaleSetsClient) ReimagePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMScaleSetReimageInput *VirtualMachineScaleSetReimageParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-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.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimage", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if VMScaleSetReimageInput != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(VMScaleSetReimageInput)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ReimageSender sends the Reimage request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) ReimageSender(req *http.Request) (future VirtualMachineScaleSetsReimageFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ReimageResponder handles the response to the Reimage request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) ReimageResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// 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. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// VMInstanceIDs - 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) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.ReimageAll") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ReimageAllPreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ReimageAll", nil, "Failure preparing request") - return - } - - result, err = client.ReimageAllSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ReimageAll", result.Response(), "Failure sending request") - return - } - - return -} - -// ReimageAllPreparer prepares the ReimageAll request. -func (client VirtualMachineScaleSetsClient) ReimageAllPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-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.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimageall", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if VMInstanceIDs != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(VMInstanceIDs)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ReimageAllSender sends the ReimageAll request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) ReimageAllSender(req *http.Request) (future VirtualMachineScaleSetsReimageAllFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ReimageAllResponder handles the response to the ReimageAll request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) ReimageAllResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Restart restarts one or more virtual machines in a VM scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// VMInstanceIDs - 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) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.Restart") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.RestartPreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Restart", nil, "Failure preparing request") - return - } - - result, err = client.RestartSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Restart", result.Response(), "Failure sending request") - return - } - - return -} - -// RestartPreparer prepares the Restart request. -func (client VirtualMachineScaleSetsClient) RestartPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-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.Compute/virtualMachineScaleSets/{vmScaleSetName}/restart", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if VMInstanceIDs != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(VMInstanceIDs)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RestartSender sends the Restart request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) RestartSender(req *http.Request) (future VirtualMachineScaleSetsRestartFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// RestartResponder handles the response to the Restart request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) RestartResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// SetOrchestrationServiceState changes ServiceState property for a given service -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the virtual machine scale set to create or update. -// parameters - the input object for SetOrchestrationServiceState API. -func (client VirtualMachineScaleSetsClient) SetOrchestrationServiceState(ctx context.Context, resourceGroupName string, VMScaleSetName string, parameters OrchestrationServiceStateInput) (result VirtualMachineScaleSetsSetOrchestrationServiceStateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.SetOrchestrationServiceState") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.SetOrchestrationServiceStatePreparer(ctx, resourceGroupName, VMScaleSetName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "SetOrchestrationServiceState", nil, "Failure preparing request") - return - } - - result, err = client.SetOrchestrationServiceStateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "SetOrchestrationServiceState", result.Response(), "Failure sending request") - return - } - - return -} - -// SetOrchestrationServiceStatePreparer prepares the SetOrchestrationServiceState request. -func (client VirtualMachineScaleSetsClient) SetOrchestrationServiceStatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, parameters OrchestrationServiceStateInput) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-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.Compute/virtualMachineScaleSets/{vmScaleSetName}/setOrchestrationServiceState", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// SetOrchestrationServiceStateSender sends the SetOrchestrationServiceState request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) SetOrchestrationServiceStateSender(req *http.Request) (future VirtualMachineScaleSetsSetOrchestrationServiceStateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// SetOrchestrationServiceStateResponder handles the response to the SetOrchestrationServiceState request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) SetOrchestrationServiceStateResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Start starts one or more virtual machines in a VM scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// VMInstanceIDs - 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) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.Start") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.StartPreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Start", nil, "Failure preparing request") - return - } - - result, err = client.StartSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Start", result.Response(), "Failure sending request") - return - } - - return -} - -// StartPreparer prepares the Start request. -func (client VirtualMachineScaleSetsClient) StartPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-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.Compute/virtualMachineScaleSets/{vmScaleSetName}/start", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if VMInstanceIDs != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(VMInstanceIDs)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// StartSender sends the Start request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) StartSender(req *http.Request) (future VirtualMachineScaleSetsStartFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// StartResponder handles the response to the Start request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) StartResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Update update a VM scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set to create or update. -// parameters - the scale set object. -func (client VirtualMachineScaleSetsClient) Update(ctx context.Context, resourceGroupName string, VMScaleSetName string, parameters VirtualMachineScaleSetUpdate) (result VirtualMachineScaleSetsUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, VMScaleSetName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client VirtualMachineScaleSetsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, parameters VirtualMachineScaleSetUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-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/virtualMachineScaleSets/{vmScaleSetName}", 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 VirtualMachineScaleSetsClient) UpdateSender(req *http.Request) (future VirtualMachineScaleSetsUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) UpdateResponder(resp *http.Response) (result VirtualMachineScaleSet, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// UpdateInstances upgrades one or more virtual machines to the latest SKU set in the VM scale set model. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// VMInstanceIDs - 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 tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.UpdateInstances") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - 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.NewError("compute.VirtualMachineScaleSetsClient", "UpdateInstances", err.Error()) - } - - req, err := client.UpdateInstancesPreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "UpdateInstances", nil, "Failure preparing request") - return - } - - result, err = client.UpdateInstancesSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "UpdateInstances", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdateInstancesPreparer prepares the UpdateInstances request. -func (client VirtualMachineScaleSetsClient) UpdateInstancesPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-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.Compute/virtualMachineScaleSets/{vmScaleSetName}/manualupgrade", pathParameters), - autorest.WithJSON(VMInstanceIDs), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateInstancesSender sends the UpdateInstances request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) UpdateInstancesSender(req *http.Request) (future VirtualMachineScaleSetsUpdateInstancesFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateInstancesResponder handles the response to the UpdateInstances request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) UpdateInstancesResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachinescalesetvmextensions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachinescalesetvmextensions.go deleted file mode 100644 index 72992a54..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachinescalesetvmextensions.go +++ /dev/null @@ -1,469 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualMachineScaleSetVMExtensionsClient is the compute Client -type VirtualMachineScaleSetVMExtensionsClient struct { - BaseClient -} - -// NewVirtualMachineScaleSetVMExtensionsClient creates an instance of the VirtualMachineScaleSetVMExtensionsClient -// client. -func NewVirtualMachineScaleSetVMExtensionsClient(subscriptionID string) VirtualMachineScaleSetVMExtensionsClient { - return NewVirtualMachineScaleSetVMExtensionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualMachineScaleSetVMExtensionsClientWithBaseURI creates an instance of the -// VirtualMachineScaleSetVMExtensionsClient client using a custom endpoint. Use this when interacting with an Azure -// cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewVirtualMachineScaleSetVMExtensionsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineScaleSetVMExtensionsClient { - return VirtualMachineScaleSetVMExtensionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate the operation to create or update the VMSS VM extension. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -// VMExtensionName - the name of the virtual machine extension. -// extensionParameters - parameters supplied to the Create Virtual Machine Extension operation. -func (client VirtualMachineScaleSetVMExtensionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string, extensionParameters VirtualMachineScaleSetVMExtension) (result VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMExtensionsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: extensionParameters, - Constraints: []validation.Constraint{{Target: "extensionParameters.VirtualMachineExtensionProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "extensionParameters.VirtualMachineExtensionProperties.ProtectedSettingsFromKeyVault", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "extensionParameters.VirtualMachineExtensionProperties.ProtectedSettingsFromKeyVault.SecretURL", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "extensionParameters.VirtualMachineExtensionProperties.ProtectedSettingsFromKeyVault.SourceVault", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}}}}); err != nil { - return result, validation.NewError("compute.VirtualMachineScaleSetVMExtensionsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, VMExtensionName, extensionParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VirtualMachineScaleSetVMExtensionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string, extensionParameters VirtualMachineScaleSetVMExtension) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmExtensionName": autorest.Encode("path", VMExtensionName), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - extensionParameters.Name = nil - extensionParameters.Type = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}", pathParameters), - autorest.WithJSON(extensionParameters), - 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 VirtualMachineScaleSetVMExtensionsClient) CreateOrUpdateSender(req *http.Request) (future VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMExtensionsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualMachineScaleSetVMExtension, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete the operation to delete the VMSS VM extension. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -// VMExtensionName - the name of the virtual machine extension. -func (client VirtualMachineScaleSetVMExtensionsClient) Delete(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string) (result VirtualMachineScaleSetVMExtensionsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMExtensionsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, VMExtensionName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VirtualMachineScaleSetVMExtensionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmExtensionName": autorest.Encode("path", VMExtensionName), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-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.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}", 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 VirtualMachineScaleSetVMExtensionsClient) DeleteSender(req *http.Request) (future VirtualMachineScaleSetVMExtensionsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMExtensionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get the operation to get the VMSS VM extension. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -// VMExtensionName - the name of the virtual machine extension. -// expand - the expand expression to apply on the operation. -func (client VirtualMachineScaleSetVMExtensionsClient) Get(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string, expand string) (result VirtualMachineScaleSetVMExtension, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMExtensionsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, VMExtensionName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualMachineScaleSetVMExtensionsClient) GetPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmExtensionName": autorest.Encode("path", VMExtensionName), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}", 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 VirtualMachineScaleSetVMExtensionsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMExtensionsClient) GetResponder(resp *http.Response) (result VirtualMachineScaleSetVMExtension, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List the operation to get all extensions of an instance in Virtual Machine Scaleset. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -// expand - the expand expression to apply on the operation. -func (client VirtualMachineScaleSetVMExtensionsClient) List(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, expand string) (result VirtualMachineScaleSetVMExtensionsListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMExtensionsClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "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.VirtualMachineScaleSetVMExtensionsClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualMachineScaleSetVMExtensionsClient) ListPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions", 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 VirtualMachineScaleSetVMExtensionsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMExtensionsClient) ListResponder(resp *http.Response) (result VirtualMachineScaleSetVMExtensionsListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Update the operation to update the VMSS VM extension. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -// VMExtensionName - the name of the virtual machine extension. -// extensionParameters - parameters supplied to the Update Virtual Machine Extension operation. -func (client VirtualMachineScaleSetVMExtensionsClient) Update(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string, extensionParameters VirtualMachineScaleSetVMExtensionUpdate) (result VirtualMachineScaleSetVMExtensionsUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMExtensionsClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, VMExtensionName, extensionParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client VirtualMachineScaleSetVMExtensionsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string, extensionParameters VirtualMachineScaleSetVMExtensionUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmExtensionName": autorest.Encode("path", VMExtensionName), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - extensionParameters.Name = nil - extensionParameters.Type = nil - 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/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}", pathParameters), - autorest.WithJSON(extensionParameters), - 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 VirtualMachineScaleSetVMExtensionsClient) UpdateSender(req *http.Request) (future VirtualMachineScaleSetVMExtensionsUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMExtensionsClient) UpdateResponder(resp *http.Response) (result VirtualMachineScaleSetVMExtension, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachinescalesetvmruncommands.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachinescalesetvmruncommands.go deleted file mode 100644 index fb95c143..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachinescalesetvmruncommands.go +++ /dev/null @@ -1,495 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualMachineScaleSetVMRunCommandsClient is the compute Client -type VirtualMachineScaleSetVMRunCommandsClient struct { - BaseClient -} - -// NewVirtualMachineScaleSetVMRunCommandsClient creates an instance of the VirtualMachineScaleSetVMRunCommandsClient -// client. -func NewVirtualMachineScaleSetVMRunCommandsClient(subscriptionID string) VirtualMachineScaleSetVMRunCommandsClient { - return NewVirtualMachineScaleSetVMRunCommandsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualMachineScaleSetVMRunCommandsClientWithBaseURI creates an instance of the -// VirtualMachineScaleSetVMRunCommandsClient client using a custom endpoint. Use this when interacting with an Azure -// cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewVirtualMachineScaleSetVMRunCommandsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineScaleSetVMRunCommandsClient { - return VirtualMachineScaleSetVMRunCommandsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate the operation to create or update the VMSS VM run command. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -// runCommandName - the name of the virtual machine run command. -// runCommand - parameters supplied to the Create Virtual Machine RunCommand operation. -func (client VirtualMachineScaleSetVMRunCommandsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, runCommandName string, runCommand VirtualMachineRunCommand) (result VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMRunCommandsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, runCommandName, runCommand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VirtualMachineScaleSetVMRunCommandsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, runCommandName string, runCommand VirtualMachineRunCommand) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "runCommandName": autorest.Encode("path", runCommandName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-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.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}", pathParameters), - autorest.WithJSON(runCommand), - 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 VirtualMachineScaleSetVMRunCommandsClient) CreateOrUpdateSender(req *http.Request) (future VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMRunCommandsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualMachineRunCommand, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete the operation to delete the VMSS VM run command. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -// runCommandName - the name of the virtual machine run command. -func (client VirtualMachineScaleSetVMRunCommandsClient) Delete(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, runCommandName string) (result VirtualMachineScaleSetVMRunCommandsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMRunCommandsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, runCommandName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VirtualMachineScaleSetVMRunCommandsClient) DeletePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, runCommandName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "runCommandName": autorest.Encode("path", runCommandName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-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.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}", 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 VirtualMachineScaleSetVMRunCommandsClient) DeleteSender(req *http.Request) (future VirtualMachineScaleSetVMRunCommandsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMRunCommandsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get the operation to get the VMSS VM run command. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -// runCommandName - the name of the virtual machine run command. -// expand - the expand expression to apply on the operation. -func (client VirtualMachineScaleSetVMRunCommandsClient) Get(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, runCommandName string, expand string) (result VirtualMachineRunCommand, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMRunCommandsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, runCommandName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualMachineScaleSetVMRunCommandsClient) GetPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, runCommandName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "runCommandName": autorest.Encode("path", runCommandName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}", 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 VirtualMachineScaleSetVMRunCommandsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMRunCommandsClient) GetResponder(resp *http.Response) (result VirtualMachineRunCommand, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List the operation to get all run commands of an instance in Virtual Machine Scaleset. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -// expand - the expand expression to apply on the operation. -func (client VirtualMachineScaleSetVMRunCommandsClient) List(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, expand string) (result VirtualMachineRunCommandsListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMRunCommandsClient.List") - defer func() { - sc := -1 - if result.vmrclr.Response.Response != nil { - sc = result.vmrclr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.vmrclr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsClient", "List", resp, "Failure sending request") - return - } - - result.vmrclr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsClient", "List", resp, "Failure responding to request") - return - } - if result.vmrclr.hasNextLink() && result.vmrclr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualMachineScaleSetVMRunCommandsClient) ListPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands", 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 VirtualMachineScaleSetVMRunCommandsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMRunCommandsClient) ListResponder(resp *http.Response) (result VirtualMachineRunCommandsListResult, err error) { - err = autorest.Respond( - resp, - 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 VirtualMachineScaleSetVMRunCommandsClient) listNextResults(ctx context.Context, lastResults VirtualMachineRunCommandsListResult) (result VirtualMachineRunCommandsListResult, err error) { - req, err := lastResults.virtualMachineRunCommandsListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsClient", "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, "compute.VirtualMachineScaleSetVMRunCommandsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualMachineScaleSetVMRunCommandsClient) ListComplete(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, expand string) (result VirtualMachineRunCommandsListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMRunCommandsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, VMScaleSetName, instanceID, expand) - return -} - -// Update the operation to update the VMSS VM run command. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -// runCommandName - the name of the virtual machine run command. -// runCommand - parameters supplied to the Update Virtual Machine RunCommand operation. -func (client VirtualMachineScaleSetVMRunCommandsClient) Update(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, runCommandName string, runCommand VirtualMachineRunCommandUpdate) (result VirtualMachineScaleSetVMRunCommandsUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMRunCommandsClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, runCommandName, runCommand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client VirtualMachineScaleSetVMRunCommandsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, runCommandName string, runCommand VirtualMachineRunCommandUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "runCommandName": autorest.Encode("path", runCommandName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-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/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}", pathParameters), - autorest.WithJSON(runCommand), - 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 VirtualMachineScaleSetVMRunCommandsClient) UpdateSender(req *http.Request) (future VirtualMachineScaleSetVMRunCommandsUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMRunCommandsClient) UpdateResponder(resp *http.Response) (result VirtualMachineRunCommand, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachinescalesetvms.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachinescalesetvms.go deleted file mode 100644 index 6514dd7c..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachinescalesetvms.go +++ /dev/null @@ -1,1430 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualMachineScaleSetVMsClient is the compute Client -type VirtualMachineScaleSetVMsClient struct { - BaseClient -} - -// NewVirtualMachineScaleSetVMsClient creates an instance of the VirtualMachineScaleSetVMsClient client. -func NewVirtualMachineScaleSetVMsClient(subscriptionID string) VirtualMachineScaleSetVMsClient { - return NewVirtualMachineScaleSetVMsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualMachineScaleSetVMsClientWithBaseURI creates an instance of the VirtualMachineScaleSetVMsClient client -// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign -// clouds, Azure stack). -func NewVirtualMachineScaleSetVMsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineScaleSetVMsClient { - return VirtualMachineScaleSetVMsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Deallocate deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the -// compute resources it uses. You are not billed for the compute resources of this virtual machine once it is -// deallocated. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -func (client VirtualMachineScaleSetVMsClient) Deallocate(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMsDeallocateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.Deallocate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeallocatePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Deallocate", nil, "Failure preparing request") - return - } - - result, err = client.DeallocateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Deallocate", result.Response(), "Failure sending request") - return - } - - return -} - -// DeallocatePreparer prepares the Deallocate request. -func (client VirtualMachineScaleSetVMsClient) DeallocatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-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.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/deallocate", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeallocateSender sends the Deallocate request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetVMsClient) DeallocateSender(req *http.Request) (future VirtualMachineScaleSetVMsDeallocateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeallocateResponder handles the response to the Deallocate request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMsClient) DeallocateResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Delete deletes a virtual machine from a VM scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -// forceDeletion - optional parameter to force delete a virtual machine from a VM scale set. (Feature in -// Preview) -func (client VirtualMachineScaleSetVMsClient) Delete(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, forceDeletion *bool) (result VirtualMachineScaleSetVMsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, forceDeletion) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VirtualMachineScaleSetVMsClient) DeletePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, forceDeletion *bool) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if forceDeletion != nil { - queryParameters["forceDeletion"] = autorest.Encode("query", *forceDeletion) - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}", 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 VirtualMachineScaleSetVMsClient) DeleteSender(req *http.Request) (future VirtualMachineScaleSetVMsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets a virtual machine from a VM scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -// expand - the expand expression to apply on the operation. 'InstanceView' will retrieve the instance view of -// the virtual machine. 'UserData' will retrieve the UserData of the virtual machine. -func (client VirtualMachineScaleSetVMsClient) Get(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, expand InstanceViewTypes) (result VirtualMachineScaleSetVM, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualMachineScaleSetVMsClient) GetPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, expand InstanceViewTypes) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(string(expand)) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}", 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 VirtualMachineScaleSetVMsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMsClient) GetResponder(resp *http.Response) (result VirtualMachineScaleSetVM, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetInstanceView gets the status of a virtual machine from a VM scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -func (client VirtualMachineScaleSetVMsClient) GetInstanceView(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMInstanceView, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.GetInstanceView") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetInstanceViewPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "GetInstanceView", nil, "Failure preparing request") - return - } - - resp, err := client.GetInstanceViewSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "GetInstanceView", resp, "Failure sending request") - return - } - - result, err = client.GetInstanceViewResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "GetInstanceView", resp, "Failure responding to request") - return - } - - return -} - -// GetInstanceViewPreparer prepares the GetInstanceView request. -func (client VirtualMachineScaleSetVMsClient) GetInstanceViewPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-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.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/instanceView", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetInstanceViewSender sends the GetInstanceView request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetVMsClient) GetInstanceViewSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetInstanceViewResponder handles the response to the GetInstanceView request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMsClient) GetInstanceViewResponder(resp *http.Response) (result VirtualMachineScaleSetVMInstanceView, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets a list of all virtual machines in a VM scale sets. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualMachineScaleSetName - the name of the VM scale set. -// filter - the filter to apply to the operation. Allowed values are 'startswith(instanceView/statuses/code, -// 'PowerState') eq true', 'properties/latestModelApplied eq true', 'properties/latestModelApplied eq false'. -// selectParameter - the list parameters. Allowed values are 'instanceView', 'instanceView/statuses'. -// expand - the expand expression to apply to the operation. Allowed values are 'instanceView'. -func (client VirtualMachineScaleSetVMsClient) List(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, filter string, selectParameter string, expand string) (result VirtualMachineScaleSetVMListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.List") - defer func() { - sc := -1 - if result.vmssvlr.Response.Response != nil { - sc = result.vmssvlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, virtualMachineScaleSetName, filter, selectParameter, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.vmssvlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "List", resp, "Failure sending request") - return - } - - result.vmssvlr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "List", resp, "Failure responding to request") - return - } - if result.vmssvlr.hasNextLink() && result.vmssvlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualMachineScaleSetVMsClient) ListPreparer(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, filter string, selectParameter string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualMachineScaleSetName": autorest.Encode("path", virtualMachineScaleSetName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines", 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 VirtualMachineScaleSetVMsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMsClient) ListResponder(resp *http.Response) (result VirtualMachineScaleSetVMListResult, err error) { - err = autorest.Respond( - resp, - 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 VirtualMachineScaleSetVMsClient) listNextResults(ctx context.Context, lastResults VirtualMachineScaleSetVMListResult) (result VirtualMachineScaleSetVMListResult, err error) { - req, err := lastResults.virtualMachineScaleSetVMListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "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, "compute.VirtualMachineScaleSetVMsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualMachineScaleSetVMsClient) ListComplete(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, filter string, selectParameter string, expand string) (result VirtualMachineScaleSetVMListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, virtualMachineScaleSetName, filter, selectParameter, expand) - return -} - -// PerformMaintenance performs maintenance on a virtual machine in a VM scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -func (client VirtualMachineScaleSetVMsClient) PerformMaintenance(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMsPerformMaintenanceFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.PerformMaintenance") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.PerformMaintenancePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "PerformMaintenance", nil, "Failure preparing request") - return - } - - result, err = client.PerformMaintenanceSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "PerformMaintenance", result.Response(), "Failure sending request") - return - } - - return -} - -// PerformMaintenancePreparer prepares the PerformMaintenance request. -func (client VirtualMachineScaleSetVMsClient) PerformMaintenancePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-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.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/performMaintenance", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// PerformMaintenanceSender sends the PerformMaintenance request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetVMsClient) PerformMaintenanceSender(req *http.Request) (future VirtualMachineScaleSetVMsPerformMaintenanceFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// PerformMaintenanceResponder handles the response to the PerformMaintenance request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMsClient) PerformMaintenanceResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// 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. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -// skipShutdown - the parameter to request non-graceful VM shutdown. True value for this flag indicates -// non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not -// specified -func (client VirtualMachineScaleSetVMsClient) PowerOff(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, skipShutdown *bool) (result VirtualMachineScaleSetVMsPowerOffFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.PowerOff") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.PowerOffPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, skipShutdown) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "PowerOff", nil, "Failure preparing request") - return - } - - result, err = client.PowerOffSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "PowerOff", result.Response(), "Failure sending request") - return - } - - return -} - -// PowerOffPreparer prepares the PowerOff request. -func (client VirtualMachineScaleSetVMsClient) PowerOffPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, skipShutdown *bool) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if skipShutdown != nil { - queryParameters["skipShutdown"] = autorest.Encode("query", *skipShutdown) - } else { - queryParameters["skipShutdown"] = autorest.Encode("query", false) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/poweroff", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// PowerOffSender sends the PowerOff request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetVMsClient) PowerOffSender(req *http.Request) (future VirtualMachineScaleSetVMsPowerOffFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// PowerOffResponder handles the response to the PowerOff request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMsClient) PowerOffResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Redeploy shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back -// on. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -func (client VirtualMachineScaleSetVMsClient) Redeploy(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMsRedeployFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.Redeploy") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.RedeployPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Redeploy", nil, "Failure preparing request") - return - } - - result, err = client.RedeploySender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Redeploy", result.Response(), "Failure sending request") - return - } - - return -} - -// RedeployPreparer prepares the Redeploy request. -func (client VirtualMachineScaleSetVMsClient) RedeployPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-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.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/redeploy", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RedeploySender sends the Redeploy request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetVMsClient) RedeploySender(req *http.Request) (future VirtualMachineScaleSetVMsRedeployFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// RedeployResponder handles the response to the Redeploy request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMsClient) RedeployResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Reimage reimages (upgrade the operating system) a specific virtual machine in a VM scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -// VMScaleSetVMReimageInput - parameters for the Reimaging Virtual machine in ScaleSet. -func (client VirtualMachineScaleSetVMsClient) Reimage(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMScaleSetVMReimageInput *VirtualMachineScaleSetVMReimageParameters) (result VirtualMachineScaleSetVMsReimageFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.Reimage") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ReimagePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, VMScaleSetVMReimageInput) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Reimage", nil, "Failure preparing request") - return - } - - result, err = client.ReimageSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Reimage", result.Response(), "Failure sending request") - return - } - - return -} - -// ReimagePreparer prepares the Reimage request. -func (client VirtualMachineScaleSetVMsClient) ReimagePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMScaleSetVMReimageInput *VirtualMachineScaleSetVMReimageParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-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.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/reimage", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if VMScaleSetVMReimageInput != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(VMScaleSetVMReimageInput)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ReimageSender sends the Reimage request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetVMsClient) ReimageSender(req *http.Request) (future VirtualMachineScaleSetVMsReimageFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ReimageResponder handles the response to the Reimage request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMsClient) ReimageResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// 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. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -func (client VirtualMachineScaleSetVMsClient) ReimageAll(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMsReimageAllFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.ReimageAll") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ReimageAllPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "ReimageAll", nil, "Failure preparing request") - return - } - - result, err = client.ReimageAllSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "ReimageAll", result.Response(), "Failure sending request") - return - } - - return -} - -// ReimageAllPreparer prepares the ReimageAll request. -func (client VirtualMachineScaleSetVMsClient) ReimageAllPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-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.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/reimageall", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ReimageAllSender sends the ReimageAll request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetVMsClient) ReimageAllSender(req *http.Request) (future VirtualMachineScaleSetVMsReimageAllFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ReimageAllResponder handles the response to the ReimageAll request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMsClient) ReimageAllResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Restart restarts a virtual machine in a VM scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -func (client VirtualMachineScaleSetVMsClient) Restart(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMsRestartFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.Restart") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.RestartPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Restart", nil, "Failure preparing request") - return - } - - result, err = client.RestartSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Restart", result.Response(), "Failure sending request") - return - } - - return -} - -// RestartPreparer prepares the Restart request. -func (client VirtualMachineScaleSetVMsClient) RestartPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-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.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/restart", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RestartSender sends the Restart request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetVMsClient) RestartSender(req *http.Request) (future VirtualMachineScaleSetVMsRestartFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// RestartResponder handles the response to the Restart request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMsClient) RestartResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// RetrieveBootDiagnosticsData the operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM -// scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -// sasURIExpirationTimeInMinutes - expiration duration in minutes for the SAS URIs with a value between 1 to -// 1440 minutes.

      NOTE: If not specified, SAS URIs will be generated with a default expiration duration -// of 120 minutes. -func (client VirtualMachineScaleSetVMsClient) RetrieveBootDiagnosticsData(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, sasURIExpirationTimeInMinutes *int32) (result RetrieveBootDiagnosticsDataResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.RetrieveBootDiagnosticsData") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.RetrieveBootDiagnosticsDataPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, sasURIExpirationTimeInMinutes) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "RetrieveBootDiagnosticsData", nil, "Failure preparing request") - return - } - - resp, err := client.RetrieveBootDiagnosticsDataSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "RetrieveBootDiagnosticsData", resp, "Failure sending request") - return - } - - result, err = client.RetrieveBootDiagnosticsDataResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "RetrieveBootDiagnosticsData", resp, "Failure responding to request") - return - } - - return -} - -// RetrieveBootDiagnosticsDataPreparer prepares the RetrieveBootDiagnosticsData request. -func (client VirtualMachineScaleSetVMsClient) RetrieveBootDiagnosticsDataPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, sasURIExpirationTimeInMinutes *int32) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if sasURIExpirationTimeInMinutes != nil { - queryParameters["sasUriExpirationTimeInMinutes"] = autorest.Encode("query", *sasURIExpirationTimeInMinutes) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/retrieveBootDiagnosticsData", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RetrieveBootDiagnosticsDataSender sends the RetrieveBootDiagnosticsData request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetVMsClient) RetrieveBootDiagnosticsDataSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// RetrieveBootDiagnosticsDataResponder handles the response to the RetrieveBootDiagnosticsData request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMsClient) RetrieveBootDiagnosticsDataResponder(resp *http.Response) (result RetrieveBootDiagnosticsDataResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// RunCommand run command on a virtual machine in a VM scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -// parameters - parameters supplied to the Run command operation. -func (client VirtualMachineScaleSetVMsClient) RunCommand(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, parameters RunCommandInput) (result VirtualMachineScaleSetVMsRunCommandFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.RunCommand") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - 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.NewError("compute.VirtualMachineScaleSetVMsClient", "RunCommand", err.Error()) - } - - req, err := client.RunCommandPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "RunCommand", nil, "Failure preparing request") - return - } - - result, err = client.RunCommandSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "RunCommand", result.Response(), "Failure sending request") - return - } - - return -} - -// RunCommandPreparer prepares the RunCommand request. -func (client VirtualMachineScaleSetVMsClient) RunCommandPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, parameters RunCommandInput) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-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.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/runCommand", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RunCommandSender sends the RunCommand request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetVMsClient) RunCommandSender(req *http.Request) (future VirtualMachineScaleSetVMsRunCommandFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// RunCommandResponder handles the response to the RunCommand request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMsClient) RunCommandResponder(resp *http.Response) (result RunCommandResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// SimulateEviction the operation to simulate the eviction of spot virtual machine in a VM scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -func (client VirtualMachineScaleSetVMsClient) SimulateEviction(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.SimulateEviction") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.SimulateEvictionPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "SimulateEviction", nil, "Failure preparing request") - return - } - - resp, err := client.SimulateEvictionSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "SimulateEviction", resp, "Failure sending request") - return - } - - result, err = client.SimulateEvictionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "SimulateEviction", resp, "Failure responding to request") - return - } - - return -} - -// SimulateEvictionPreparer prepares the SimulateEviction request. -func (client VirtualMachineScaleSetVMsClient) SimulateEvictionPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-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.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/simulateEviction", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// SimulateEvictionSender sends the SimulateEviction request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetVMsClient) SimulateEvictionSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// SimulateEvictionResponder handles the response to the SimulateEviction request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMsClient) SimulateEvictionResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Start starts a virtual machine in a VM scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -func (client VirtualMachineScaleSetVMsClient) Start(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMsStartFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.Start") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.StartPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Start", nil, "Failure preparing request") - return - } - - result, err = client.StartSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Start", result.Response(), "Failure sending request") - return - } - - return -} - -// StartPreparer prepares the Start request. -func (client VirtualMachineScaleSetVMsClient) StartPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-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.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/start", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// StartSender sends the Start request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetVMsClient) StartSender(req *http.Request) (future VirtualMachineScaleSetVMsStartFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// StartResponder handles the response to the Start request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMsClient) StartResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Update updates a virtual machine of a VM scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set where the extension should be create or updated. -// instanceID - the instance ID of the virtual machine. -// parameters - parameters supplied to the Update Virtual Machine Scale Sets VM operation. -func (client VirtualMachineScaleSetVMsClient) Update(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, parameters VirtualMachineScaleSetVM) (result VirtualMachineScaleSetVMsUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetVMProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetVMProperties.StorageProfile", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetVMProperties.StorageProfile.OsDisk", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetVMProperties.StorageProfile.OsDisk.EncryptionSettings", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetVMProperties.StorageProfile.OsDisk.EncryptionSettings.DiskEncryptionKey", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetVMProperties.StorageProfile.OsDisk.EncryptionSettings.DiskEncryptionKey.SecretURL", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.VirtualMachineScaleSetVMProperties.StorageProfile.OsDisk.EncryptionSettings.DiskEncryptionKey.SourceVault", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "parameters.VirtualMachineScaleSetVMProperties.StorageProfile.OsDisk.EncryptionSettings.KeyEncryptionKey", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetVMProperties.StorageProfile.OsDisk.EncryptionSettings.KeyEncryptionKey.KeyURL", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.VirtualMachineScaleSetVMProperties.StorageProfile.OsDisk.EncryptionSettings.KeyEncryptionKey.SourceVault", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("compute.VirtualMachineScaleSetVMsClient", "Update", err.Error()) - } - - req, err := client.UpdatePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client VirtualMachineScaleSetVMsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, parameters VirtualMachineScaleSetVM) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.InstanceID = nil - parameters.Sku = nil - parameters.Resources = nil - parameters.Zones = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}", 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 VirtualMachineScaleSetVMsClient) UpdateSender(req *http.Request) (future VirtualMachineScaleSetVMsUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMsClient) UpdateResponder(resp *http.Response) (result VirtualMachineScaleSetVM, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - 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/2022-08-01/compute/virtualmachinesizes.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachinesizes.go deleted file mode 100644 index cdbf6579..00000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachinesizes.go +++ /dev/null @@ -1,113 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualMachineSizesClient is the compute Client -type VirtualMachineSizesClient struct { - BaseClient -} - -// NewVirtualMachineSizesClient creates an instance of the VirtualMachineSizesClient client. -func NewVirtualMachineSizesClient(subscriptionID string) VirtualMachineSizesClient { - return NewVirtualMachineSizesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualMachineSizesClientWithBaseURI creates an instance of the VirtualMachineSizesClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewVirtualMachineSizesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineSizesClient { - return VirtualMachineSizesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List this API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list) -// Parameters: -// location - the location upon which virtual-machine-sizes is queried. -func (client VirtualMachineSizesClient) List(ctx context.Context, location string) (result VirtualMachineSizeListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineSizesClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: location, - Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("compute.VirtualMachineSizesClient", "List", err.Error()) - } - - req, err := client.ListPreparer(ctx, location) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineSizesClient", "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.VirtualMachineSizesClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineSizesClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualMachineSizesClient) ListPreparer(ctx context.Context, location string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/vmSizes", 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 VirtualMachineSizesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualMachineSizesClient) ListResponder(resp *http.Response) (result VirtualMachineSizeListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/go-autorest/autorest/adal/README.md b/vendor/github.com/Azure/go-autorest/autorest/adal/README.md index b11eb078..97434ea7 100644 --- a/vendor/github.com/Azure/go-autorest/autorest/adal/README.md +++ b/vendor/github.com/Azure/go-autorest/autorest/adal/README.md @@ -160,7 +160,7 @@ if (err == nil) { ```Go certificatePath := "./example-app.pfx" -certData, err := ioutil.ReadFile(certificatePath) +certData, err := os.ReadFile(certificatePath) if err != nil { return nil, fmt.Errorf("failed to read the certificate file (%s): %v", certificatePath, err) } diff --git a/vendor/github.com/Azure/go-autorest/autorest/adal/devicetoken.go b/vendor/github.com/Azure/go-autorest/autorest/adal/devicetoken.go index 9daa4b58..f040e2ac 100644 --- a/vendor/github.com/Azure/go-autorest/autorest/adal/devicetoken.go +++ b/vendor/github.com/Azure/go-autorest/autorest/adal/devicetoken.go @@ -27,7 +27,7 @@ import ( "context" "encoding/json" "fmt" - "io/ioutil" + "io" "net/http" "net/url" "strings" @@ -116,7 +116,7 @@ func InitiateDeviceAuthWithContext(ctx context.Context, sender Sender, oauthConf } s := v.Encode() - body := ioutil.NopCloser(strings.NewReader(s)) + body := io.NopCloser(strings.NewReader(s)) req, err := http.NewRequest(http.MethodPost, oauthConfig.DeviceCodeEndpoint.String(), body) if err != nil { @@ -131,7 +131,7 @@ func InitiateDeviceAuthWithContext(ctx context.Context, sender Sender, oauthConf } defer resp.Body.Close() - rb, err := ioutil.ReadAll(resp.Body) + rb, err := io.ReadAll(resp.Body) if err != nil { return nil, fmt.Errorf("%s %s: %s", logPrefix, errCodeHandlingFails, err.Error()) } @@ -175,7 +175,7 @@ func CheckForUserCompletionWithContext(ctx context.Context, sender Sender, code } s := v.Encode() - body := ioutil.NopCloser(strings.NewReader(s)) + body := io.NopCloser(strings.NewReader(s)) req, err := http.NewRequest(http.MethodPost, code.OAuthConfig.TokenEndpoint.String(), body) if err != nil { @@ -190,7 +190,7 @@ func CheckForUserCompletionWithContext(ctx context.Context, sender Sender, code } defer resp.Body.Close() - rb, err := ioutil.ReadAll(resp.Body) + rb, err := io.ReadAll(resp.Body) if err != nil { return nil, fmt.Errorf("%s %s: %s", logPrefix, errTokenHandlingFails, err.Error()) } diff --git a/vendor/github.com/Azure/go-autorest/autorest/adal/persist.go b/vendor/github.com/Azure/go-autorest/autorest/adal/persist.go index 2a974a39..fb54a432 100644 --- a/vendor/github.com/Azure/go-autorest/autorest/adal/persist.go +++ b/vendor/github.com/Azure/go-autorest/autorest/adal/persist.go @@ -20,7 +20,6 @@ import ( "encoding/json" "errors" "fmt" - "io/ioutil" "os" "path/filepath" @@ -62,7 +61,7 @@ func SaveToken(path string, mode os.FileMode, token Token) error { return fmt.Errorf("failed to create directory (%s) to store token in: %v", dir, err) } - newFile, err := ioutil.TempFile(dir, "token") + newFile, err := os.CreateTemp(dir, "token") if err != nil { return fmt.Errorf("failed to create the temp file to write the token: %v", err) } 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 2a24ab80..67baecd8 100644 --- a/vendor/github.com/Azure/go-autorest/autorest/adal/token.go +++ b/vendor/github.com/Azure/go-autorest/autorest/adal/token.go @@ -25,7 +25,6 @@ import ( "errors" "fmt" "io" - "io/ioutil" "math" "net/http" "net/url" @@ -1061,7 +1060,7 @@ func (spt *ServicePrincipalToken) refreshInternal(ctx context.Context, resource } else if msiSecret.clientResourceID != "" { data.Set("msi_res_id", msiSecret.clientResourceID) } - req.Body = ioutil.NopCloser(strings.NewReader(data.Encode())) + req.Body = io.NopCloser(strings.NewReader(data.Encode())) req.Header.Set("Content-Type", "application/x-www-form-urlencoded") break case msiTypeIMDS: @@ -1096,7 +1095,7 @@ func (spt *ServicePrincipalToken) refreshInternal(ctx context.Context, resource } s := v.Encode() - body := ioutil.NopCloser(strings.NewReader(s)) + body := io.NopCloser(strings.NewReader(s)) req.ContentLength = int64(len(s)) req.Header.Set(contentType, mimeTypeFormPost) req.Body = body @@ -1113,7 +1112,7 @@ func (spt *ServicePrincipalToken) refreshInternal(ctx context.Context, resource logger.Instance.WriteResponse(resp, logger.Filter{Body: authBodyFilter}) defer resp.Body.Close() - rb, err := ioutil.ReadAll(resp.Body) + rb, err := io.ReadAll(resp.Body) if resp.StatusCode != http.StatusOK { if err != nil { @@ -1235,7 +1234,7 @@ func retryForIMDS(sender Sender, req *http.Request, maxAttempts int) (resp *http for attempt < maxAttempts { if resp != nil && resp.Body != nil { - io.Copy(ioutil.Discard, resp.Body) + io.Copy(io.Discard, resp.Body) resp.Body.Close() } resp, err = sender.Do(req) diff --git a/vendor/github.com/Azure/skewer/.gitignore b/vendor/github.com/Azure/skewer/.gitignore deleted file mode 100644 index 76f28a69..00000000 --- a/vendor/github.com/Azure/skewer/.gitignore +++ /dev/null @@ -1,18 +0,0 @@ -# Binaries for programs and plugins -*.exe -*.exe~ -*.dll -*.so -*.dylib - -# Test binary, built with `go test -c` -*.test - -# Output of the go coverage tool, specifically when used with LiteIDE -*.out - -# Coverage output -coverage.* - -# Dependency directories (remove the comment below to include it) -# vendor/ diff --git a/vendor/github.com/Azure/skewer/.golangci.yml b/vendor/github.com/Azure/skewer/.golangci.yml deleted file mode 100644 index 56cded87..00000000 --- a/vendor/github.com/Azure/skewer/.golangci.yml +++ /dev/null @@ -1,136 +0,0 @@ -linters-settings: - depguard: - list-type: blacklist - packages: - # logging is allowed only by logutils.Log, logrus - # is allowed to use only in logutils package - - github.com/sirupsen/logrus - packages-with-error-message: - - github.com/sirupsen/logrus: "logging is allowed only by logutils.Log" - dupl: - threshold: 100 - exhaustive: - default-signifies-exhaustive: false - funlen: - lines: 100 - statements: 50 - gci: - local-prefixes: github.com/golangci/golangci-lint - goconst: - min-len: 2 - min-occurrences: 2 - gocritic: - enabled-tags: - - diagnostic - - experimental - - opinionated - - performance - - style - disabled-checks: - - dupImport # https://github.com/go-critic/go-critic/issues/845 - - ifElseChain - - octalLiteral - - whyNoLint - - wrapperFunc - gocyclo: - min-complexity: 15 - goimports: - local-prefixes: github.com/golangci/golangci-lint - golint: - min-confidence: 0 - gomnd: - settings: - mnd: - # don't include the "operation" and "assign" - checks: argument,case,condition,return - govet: - check-shadowing: true - - lll: - line-length: 140 - maligned: - suggest-new: true - misspell: - locale: US - nolintlint: - allow-leading-space: true # don't require machine-readable nolint directives (i.e. with no leading space) - allow-unused: true # report any unused nolint directives - require-explanation: false # don't require an explanation for nolint directives - require-specific: false # don't require nolint directives to be specific about which linter is being skipped - -linters: - # please, do not use `enable-all`: it's deprecated and will be removed soon. - # inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint - disable-all: true - enable: - - bodyclose - - deadcode - - depguard - - dogsled - - dupl - - errcheck - - exhaustive - - funlen - - gochecknoinits - - goconst - - gocritic - - gocyclo - - gofmt - - goimports - - gomnd - - goprintffuncname - - gosec - - gosimple - - govet - - ineffassign - - lll - - misspell - - nakedret - - noctx - - nolintlint - - rowserrcheck - - staticcheck - - structcheck - - stylecheck - - typecheck - - unconvert - - unparam - - unused - - varcheck - - whitespace - - # don't enable: - # - asciicheck - # - gochecknoglobals - # - gocognit - # - godot - # - godox - # - goerr113 - # - maligned - # - nestif - # - prealloc - # - testpackage - # - wsl - -issues: - # Excluding configuration per-path, per-linter, per-text and per-source - exclude-rules: - - path: _test\.go - linters: - - gomnd - - # https://github.com/go-critic/go-critic/issues/926 - - linters: - - gocritic - text: "unnecessaryDefer:" - -run: - skip-dirs: - - test/testdata - -# golangci.com configuration -# https://github.com/golangci/golangci/wiki/Configuration -service: - golangci-lint-version: 1.30.x # use the fixed version to not introduce new linters unexpectedly - prepare: - - echo "here I can run custom commands, but no preparation needed for this repo" \ No newline at end of file diff --git a/vendor/github.com/Azure/skewer/CODE_OF_CONDUCT.md b/vendor/github.com/Azure/skewer/CODE_OF_CONDUCT.md deleted file mode 100644 index f9ba8cf6..00000000 --- a/vendor/github.com/Azure/skewer/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,9 +0,0 @@ -# Microsoft Open Source Code of Conduct - -This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). - -Resources: - -- [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/) -- [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) -- Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns diff --git a/vendor/github.com/Azure/skewer/LICENSE b/vendor/github.com/Azure/skewer/LICENSE deleted file mode 100644 index 48ea6616..00000000 --- a/vendor/github.com/Azure/skewer/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) Microsoft Corporation. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE diff --git a/vendor/github.com/Azure/skewer/README.md b/vendor/github.com/Azure/skewer/README.md deleted file mode 100644 index fccb5f57..00000000 --- a/vendor/github.com/Azure/skewer/README.md +++ /dev/null @@ -1,138 +0,0 @@ -# skewer [![GoDoc](https://godoc.org/github.com/Azure/skewer?status.svg)](https://godoc.org/github.com/Azure/skewer) [![codecov](https://codecov.io/gh/azure/skewer/branch/main/graph/badge.svg)](https://codecov.io/gh/azure/skewer) - -A package to simplify working with Azure's Resource SKU APIs by wrapping -the existing Azure SDK for Go. - -## Usage - -This package requires an existing, authorized Azure client. Here is a -complete example using the simplest methods. - -```go -package main - -import ( - "context" - "fmt" - - "github.com/Azure/go-autorest/autorest/azure/auth" - "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute" //nolint:staticcheck - - "github.com/Azure/skewer" -) - -func main() { - // Create an authorizer - authorizer, err := auth.NewAuthorizerFromEnvironment() - if err != nil { - fmt.Printf("failed to get authorizer: %s", err) - os.Exit(1) - } - - // Create a skus client - client := compute.NewResourceSkusClient(sub) - client.Authorizer = authorizer - - // Now we can use the client... - resourceSkuIterator, err := client.ListComplete(context.Background(), "eastus") - if err != nil { - fmt.Printf("failed to list skus: %s", err) - os.Exit(1) - } - - // or instantiate a cache for this package! - cache, err := skewer.NewCache(context.Background(), skewer.WithLocation("eastus"), skewer.WithResourceClient(client)) - if err != nil { - fmt.Printf("failed to instantiate sku cache: %s", err) - os.Exit(1) - } -} -``` - -Once we have a cache, we can query against its contents: -```go -sku, found := cache.Get(context.Background, "standard_d4s_v3", skewer.VirtualMachines, "eastus") -if !found { - return fmt.Errorf("expected to find virtual machine sku standard_d4s_v3") -} - -// Check for capabilities -if sku.IsEphemeralOSDiskSupported() { - fmt.Println("SKU %s supports ephemeral OS disk!", sku.GetName()) -} - -cpu, err := sku.VCPU() -if err != nil { - return fmt.Errorf("failed to parse cpu from sku: %s", err) -} - -memory, err := sku.Memory() -if err != nil { - return fmt.Errorf("failed to parse memory from sku: %s", err) -} - -fmt.Printf("vm sku %s has %d vCPU cores and %.2fGi of memory", sku.GetName(), cpu, memory) -``` - -# Development - -This project uses a simple [justfile](https://github.com/casey/just) for -make-like functionality. The commands are simple enough to run on their -own if you do not want to install just. - -For each command below like `just $CMD`, the full manual commands are -below separated by one line. - -Default: tidy, fmt, lint, test and calculate coverage. -``` -$ just -$ -$ go mod tidy -$ go fmt -$ golangci-lint run --fix -$ go test -v -race -coverprofile=coverage.out -covermode=atomic ./... -$ go tool cover -html=coverage.out -o coverage.html -``` - -Clean up dependencies: -``` -$ just tidy -$ -$ go mod tidy -``` - -Format: -``` -$ just fmt -$ -$ go fmt -``` - -Lint: -``` -$ just lint -$ -$ golangci-lint run --fix -``` - -Test and calculate coverage: -``` -$ just cover -$ -$ go test -v -race -coverprofile=coverage.out -covermode=atomic ./... -$ go tool cover -html=coverage.out -o coverage.html -``` - -# Contributing - -This project welcomes contributions and suggestions. Most contributions require you to agree to a -Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us -the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com. - -When you submit a pull request, a CLA bot will automatically determine whether you need to provide -a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions -provided by the bot. You will only need to do this once across all repos using our CLA. - -This project has adopted the [Microsoft Open Source Code of Conduct](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. diff --git a/vendor/github.com/Azure/skewer/SECURITY.md b/vendor/github.com/Azure/skewer/SECURITY.md deleted file mode 100644 index f7b89984..00000000 --- a/vendor/github.com/Azure/skewer/SECURITY.md +++ /dev/null @@ -1,41 +0,0 @@ - - -## Security - -Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/). - -If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://docs.microsoft.com/en-us/previous-versions/tn-archive/cc751383(v=technet.10)), please report it to us as described below. - -## Reporting Security Issues - -**Please do not report security vulnerabilities through public GitHub issues.** - -Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://msrc.microsoft.com/create-report). - -If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://www.microsoft.com/en-us/msrc/pgp-key-msrc). - -You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc). - -Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: - - * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) - * Full paths of source file(s) related to the manifestation of the issue - * The location of the affected source code (tag/branch/commit or direct URL) - * Any special configuration required to reproduce the issue - * Step-by-step instructions to reproduce the issue - * Proof-of-concept or exploit code (if possible) - * Impact of the issue, including how an attacker might exploit the issue - -This information will help us triage your report more quickly. - -If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://microsoft.com/msrc/bounty) page for more details about our active programs. - -## Preferred Languages - -We prefer all communications to be in English. - -## Policy - -Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://www.microsoft.com/en-us/msrc/cvd). - - \ No newline at end of file diff --git a/vendor/github.com/Azure/skewer/cache.go b/vendor/github.com/Azure/skewer/cache.go deleted file mode 100644 index 5248d812..00000000 --- a/vendor/github.com/Azure/skewer/cache.go +++ /dev/null @@ -1,375 +0,0 @@ -package skewer - -import ( - "context" - "fmt" - "strings" -) - -// Config contains configuration options for a cache. -type Config struct { - location string - includeExtendedLocations string - filter string - client client -} - -// Cache stores a list of known skus, possibly fetched with a provided client -type Cache struct { - config *Config - data []SKU -} - -// Option describes functional options to customize the listing behavior of the cache. -type Option func(c *Config) (*Config, error) - -// WithLocation is a functional option to filter skus by location -func WithLocation(location string) Option { - return func(c *Config) (*Config, error) { - c.location = location - c.filter = fmt.Sprintf("location eq '%s'", location) - return c, nil - } -} - -// WithExtendedLocations is a functional option to include extended locations -func WithExtendedLocations() Option { - return func(c *Config) (*Config, error) { - c.includeExtendedLocations = "true" - return c, nil - } -} - -// ErrClientNil will be returned when a user attempts to create a cache -// without a client and use it. -type ErrClientNil struct { -} - -func (e *ErrClientNil) Error() string { - return "cache requires a client provided by functional options to refresh" -} - -// ErrClientNotNil will be returned when a user attempts to set two -// clients on the same cache. -type ErrClientNotNil struct { -} - -func (e *ErrClientNotNil) Error() string { - return "only provide one client option when instantiating a cache" -} - -// WithClient is a functional option to use a cache -// backed by a client meeting the skewer signature. -func WithClient(client client) Option { - return func(c *Config) (*Config, error) { - if c.client != nil { - return nil, &ErrClientNotNil{} - } - c.client = client - return c, nil - } -} - -// WithResourceClient is a functional option to use a cache -// backed by a ResourceClient. -func WithResourceClient(client ResourceClient) Option { - return func(c *Config) (*Config, error) { - if c.client != nil { - return nil, &ErrClientNotNil{} - } - c.client = newWrappedResourceClient(client) - return c, nil - } -} - -// WithResourceProviderClient is a functional option to use a cache -// backed by a ResourceProviderClient. -func WithResourceProviderClient(client ResourceProviderClient) Option { - return func(c *Config) (*Config, error) { - if c.client != nil { - return nil, &ErrClientNotNil{} - } - resourceClient := newWrappedResourceProviderClient(client) - c.client = newWrappedResourceClient(resourceClient) - return c, nil - } -} - -// NewCacheFunc describes the live cache instantiation signature. Used -// for testing. -type NewCacheFunc func(ctx context.Context, opts ...Option) (*Cache, error) - -// NewCache instantiates a cache of resource sku data with a ResourceClient -// client, optionally with additional filtering by location. The -// accepted client interface matches the real Azure clients (it returns -// a paginated iterator). -func NewCache(ctx context.Context, opts ...Option) (*Cache, error) { - config := &Config{} - - for _, optionFn := range opts { - var err error - if config, err = optionFn(config); err != nil { - return nil, err - } - } - - if config.client == nil { - return nil, &ErrClientNil{} - } - - c := &Cache{ - config: config, - } - - if err := c.refresh(ctx); err != nil { - return nil, err - } - - return c, nil -} - -// NewStaticCache initializes a cache with data and no ability to refresh. Used for testing. -func NewStaticCache(data []SKU, opts ...Option) (*Cache, error) { - config := &Config{} - - for _, optionFn := range opts { - var err error - if config, err = optionFn(config); err != nil { - return nil, err - } - } - - c := &Cache{ - data: data, - config: config, - } - - return c, nil -} - -func (c *Cache) refresh(ctx context.Context) error { - data, err := c.config.client.List(ctx, c.config.filter, c.config.includeExtendedLocations) - if err != nil { - return err - } - - c.data = Wrap(data) - - return nil -} - -// ErrMultipleSKUsMatch will be returned when multiple skus match a -// fully qualified triple of resource type, location and name. This should usually not happen. -type ErrMultipleSKUsMatch struct { - Name string - Location string - Type string -} - -func (e *ErrMultipleSKUsMatch) Error() string { - return fmt.Sprintf("found multiple skus matching type: %s, name %s, and location %s", e.Type, e.Name, e.Location) -} - -// ErrSKUNotFound will be returned when no skus match a fully qualified -// triple of resource type, location and name. The SKU may not exist. -type ErrSKUNotFound struct { - Name string - Location string - Type string -} - -func (e *ErrSKUNotFound) Error() string { - return fmt.Sprintf("failed to find any skus matching type: %s, name %s, and location %s", e.Type, e.Name, e.Location) -} - -// Get returns the first matching resource of a given name and type in a location. -func (c *Cache) Get(ctx context.Context, name, resourceType, location string) (SKU, error) { - filtered := Filter(c.data, []FilterFn{ - ResourceTypeFilter(resourceType), - NameFilter(name), - LocationFilter(location), - }...) - - if len(filtered) > 1 { - return SKU{}, &ErrMultipleSKUsMatch{ - Name: name, - Location: location, - Type: resourceType, - } - } - - if len(filtered) < 1 { - return SKU{}, &ErrSKUNotFound{ - Name: name, - Location: location, - Type: resourceType, - } - } - - return filtered[0], nil -} - -// List returns all resource types for this location. -func (c *Cache) List(ctx context.Context, filters ...FilterFn) []SKU { - return Filter(c.data, filters...) -} - -// GetVirtualMachines returns the list of all virtual machines *SKUs in a given azure location. -func (c *Cache) GetVirtualMachines(ctx context.Context) []SKU { - return Filter(c.data, ResourceTypeFilter(VirtualMachines)) -} - -// GetVirtualMachineAvailabilityZones returns all virtual machine zones available in a given location. -func (c *Cache) GetVirtualMachineAvailabilityZones(ctx context.Context) []string { - return c.GetAvailabilityZones(ctx, ResourceTypeFilter(VirtualMachines)) -} - -// GetVirtualMachineAvailabilityZonesForSize returns all virtual machine zones available in a given location. -func (c *Cache) GetVirtualMachineAvailabilityZonesForSize(ctx context.Context, size string) []string { - return c.GetAvailabilityZones(ctx, ResourceTypeFilter(VirtualMachines), NameFilter(size)) -} - -// GetAvailabilityZones returns the list of all availability zones in a given azure location. -func (c *Cache) GetAvailabilityZones(ctx context.Context, filters ...FilterFn) []string { - allZones := make(map[string]bool) - - Map(c.data, func(s *SKU) SKU { - if All(s, filters) { - for zone := range s.AvailabilityZones(c.config.location) { - allZones[zone] = true - } - } - return SKU{} - }) - - result := make([]string, 0, len(allZones)) - for zone := range allZones { - result = append(result, zone) - } - - return result -} - -// Equal compares two configs. -func (c *Config) Equal(other *Config) bool { - if c == nil && other == nil { - return true - } - if c == nil && other != nil { - return false - } - if c != nil && other == nil { - return false - } - return c.location == other.location && - c.filter == other.filter -} - -// Equal compares two caches. -func (c *Cache) Equal(other *Cache) bool { - if c == nil && other == nil { - return true - } - if c == nil && other != nil { - return false - } - if c != nil && other == nil { - return false - } - if c != nil && other != nil { - return c.config.Equal(other.config) - } - if len(c.data) != len(other.data) { - return false - } - for i := range c.data { - if c.data[i] != other.data[i] { - return false - } - } - return true -} - -// All returns true if the provided sku meets all provided conditions. -func All(sku *SKU, conditions []FilterFn) bool { - for _, condition := range conditions { - if !condition(sku) { - return false - } - } - return true -} - -// Filter returns a new slice containing all values in the slice that -// satisfy all filterFn predicates. -func Filter(skus []SKU, filterFn ...FilterFn) []SKU { - if skus == nil { - return nil - } - - filtered := make([]SKU, 0) - for i := range skus { - if All(&skus[i], filterFn) { - filtered = append(filtered, skus[i]) - } - } - - return filtered -} - -// Map returns a new slice containing the results of applying the -// mapFn to each value in the original slice. -func Map(skus []SKU, fn MapFn) []SKU { - if skus == nil { - return nil - } - - mapped := make([]SKU, 0, len(skus)) - for i := range skus { - mapped = append(mapped, fn(&skus[i])) - } - - return mapped -} - -// FilterFn is a convenience type for filtering. -type FilterFn func(*SKU) bool - -// ResourceTypeFilter produces a filter function for any resource type. -func ResourceTypeFilter(resourceType string) func(*SKU) bool { - return func(s *SKU) bool { - return s.IsResourceType(resourceType) - } -} - -// NameFilter produces a filter function for the name of a resource sku. -func NameFilter(name string) func(*SKU) bool { - return func(s *SKU) bool { - return strings.EqualFold(s.GetName(), name) - } -} - -// LocationFilter matches against a SKU listing the given location -func LocationFilter(location string) func(*SKU) bool { - return func(s *SKU) bool { - return s.HasLocation(normalizeLocation(location)) - } -} - -// UnsafeLocationFilter produces a filter function for the location of a -// resource sku. -// This function dangerously ignores all SKUS without a properly -// specified location. Use this only if you know what you are doing. -func UnsafeLocationFilter(location string) func(*SKU) bool { - return func(s *SKU) bool { - // TODO(ace): how to handle better? - want, err := s.GetLocation() - if err != nil { - return false - } - return locationEquals(want, location) - } -} - -// MapFn is a convenience type for mapping. -type MapFn func(*SKU) SKU diff --git a/vendor/github.com/Azure/skewer/clients.go b/vendor/github.com/Azure/skewer/clients.go deleted file mode 100644 index ab90c85a..00000000 --- a/vendor/github.com/Azure/skewer/clients.go +++ /dev/null @@ -1,63 +0,0 @@ -package skewer - -import ( - "context" - - "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute" //nolint:staticcheck - "github.com/pkg/errors" -) - -// wrappedResourceClient defines a wrapper for the typical Azure client -// signature to collect all resource skus from the iterator returned by ListComplete(). -type wrappedResourceClient struct { - client ResourceClient -} - -func newWrappedResourceClient(client ResourceClient) *wrappedResourceClient { - return &wrappedResourceClient{client} -} - -// List greedily traverses all returned sku pages -func (w *wrappedResourceClient) List(ctx context.Context, filter, includeExtendedLocations string) ([]compute.ResourceSku, error) { - return iterate(ctx, filter, includeExtendedLocations, w.client.ListComplete) -} - -// wrappedResourceProviderClient defines a wrapper for the typical Azure client -// signature to collect all resource skus from the iterator returned by -// List(). It only differs from wrappedResourceClient in signature. -type wrappedResourceProviderClient struct { - client ResourceProviderClient -} - -func newWrappedResourceProviderClient(client ResourceProviderClient) *wrappedResourceProviderClient { - return &wrappedResourceProviderClient{client} -} - -//nolint:lll -func (w *wrappedResourceProviderClient) ListComplete(ctx context.Context, filter, includeExtendedLocations string) (compute.ResourceSkusResultIterator, error) { - page, err := w.client.List(ctx, filter, includeExtendedLocations) - if err != nil { - return compute.ResourceSkusResultIterator{}, nil - } - return compute.NewResourceSkusResultIterator(page), nil -} - -type iterFunc func(context.Context, string, string) (compute.ResourceSkusResultIterator, error) - -// iterate invokes fn to get an iterator, then drains it into an array. -func iterate(ctx context.Context, filter, includeExtendedLocations string, fn iterFunc) ([]compute.ResourceSku, error) { - iter, err := fn(ctx, filter, includeExtendedLocations) - if err != nil { - return nil, errors.Wrap(err, "could not list resource skus") - } - - var skus []compute.ResourceSku - for iter.NotDone() { - skus = append(skus, iter.Value()) - if err := iter.NextWithContext(ctx); err != nil { - return nil, errors.Wrap(err, "could not iterate resource skus") - } - } - - return skus, nil -} diff --git a/vendor/github.com/Azure/skewer/const.go b/vendor/github.com/Azure/skewer/const.go deleted file mode 100644 index 1b6f8fb1..00000000 --- a/vendor/github.com/Azure/skewer/const.go +++ /dev/null @@ -1,68 +0,0 @@ -package skewer - -const ( - // VirtualMachines is the . - VirtualMachines = "virtualMachines" - // Disks is a convenience constant to filter resource SKUs to only include disks. - Disks = "disks" -) - -// Supported models an enum of possible boolean values for resource support in the Azure API. -type Supported string - -const ( - // CapabilitySupported is an enum value for the string "True" returned when a SKU supports a binary capability. - CapabilitySupported Supported = "True" - // CapabilityUnsupported is an enum value for the string "False" returned when a SKU does not support a binary capability. - CapabilityUnsupported Supported = "False" -) - -const ( - // EphemeralOSDisk identifies the capability for ephemeral os support. - EphemeralOSDisk = "EphemeralOSDiskSupported" - // AcceleratedNetworking identifies the capability for accelerated networking support. - AcceleratedNetworking = "AcceleratedNetworkingEnabled" - // VCPUs identifies the capability for the number of vCPUS. - VCPUs = "vCPUs" - // GPUs identifies the capability for the number of GPUS. - GPUs = "GPUs" - // MemoryGB identifies the capability for memory capacity. - MemoryGB = "MemoryGB" - // HyperVGenerations identifies the hyper-v generations this vm sku supports. - HyperVGenerations = "HyperVGenerations" - // EncryptionAtHost identifies the capability for accelerated networking support. - EncryptionAtHost = "EncryptionAtHostSupported" - // UltraSSDAvailable identifies the capability for ultra ssd - // enablement. - UltraSSDAvailable = "UltraSSDAvailable" - // CachedDiskBytes identifies the maximum size of the cache disk for - // a vm. - CachedDiskBytes = "CachedDiskBytes" - // MaxResourceVolumeMB identifies the maximum size of the temporary - // disk for a vm. - MaxResourceVolumeMB = "MaxResourceVolumeMB" - // CapabilityPremiumIO identifies the capability for PremiumIO. - CapabilityPremiumIO = "PremiumIO" - // CapabilityCpuArchitectureType identifies the type of CPU architecture (x64,Arm64). - CapabilityCPUArchitectureType = "CpuArchitectureType" - // CapabilityTrustedLaunchDisabled identifes whether TrustedLaunch is disabled. - CapabilityTrustedLaunchDisabled = "TrustedLaunchDisabled" - // CapabilityConfidentialComputingType identifies the type of ConfidentialComputing. - CapabilityConfidentialComputingType = "ConfidentialComputingType" - // ConfidentialComputingTypeSNP denoted the "SNP" ConfidentialComputing. - ConfidentialComputingTypeSNP = "SNP" -) - -const ( - // HyperVGeneration1 identifies a sku which supports HyperV - // Generation 1. - HyperVGeneration1 = "V1" - // HyperVGeneration2 identifies a sku which supports HyperV - // Generation 2. - HyperVGeneration2 = "V2" -) - -const ( - ten = 10 - sixtyFour = 64 -) diff --git a/vendor/github.com/Azure/skewer/interface.go b/vendor/github.com/Azure/skewer/interface.go deleted file mode 100644 index 9cb506b6..00000000 --- a/vendor/github.com/Azure/skewer/interface.go +++ /dev/null @@ -1,24 +0,0 @@ -package skewer - -import ( - "context" - - "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute" //nolint:staticcheck -) - -// ResourceClient is the required Azure client interface used to populate skewer's data. -type ResourceClient interface { - ListComplete(ctx context.Context, filter, includeExtendedLocations string) (compute.ResourceSkusResultIterator, error) -} - -// ResourceProviderClient is a convenience interface for uses cases -// specific to Azure resource providers. -type ResourceProviderClient interface { - List(ctx context.Context, filter, includeExtendedLocations string) (compute.ResourceSkusResultPage, error) -} - -// client defines the internal interface required by the skewer Cache. -// TODO(ace): implement a lazy iterator with caching (and a cursor?) -type client interface { - List(ctx context.Context, filter, includeExtendedLocations string) ([]compute.ResourceSku, error) -} diff --git a/vendor/github.com/Azure/skewer/justfile b/vendor/github.com/Azure/skewer/justfile deleted file mode 100644 index e044d853..00000000 --- a/vendor/github.com/Azure/skewer/justfile +++ /dev/null @@ -1,17 +0,0 @@ -default: tidy fmt lint cover - -cover: tidy fmt - go test -v -race -coverprofile=coverage.out -covermode=atomic ./... - go tool cover -html=coverage.out -o coverage.html - -fmt: - gofmt -l -w -s . - -lint: tidy fmt - golangci-lint run --fix - -test: tidy fmt - go test -v -race ./... - -tidy: - go mod tidy diff --git a/vendor/github.com/Azure/skewer/sku.go b/vendor/github.com/Azure/skewer/sku.go deleted file mode 100644 index 565f82fa..00000000 --- a/vendor/github.com/Azure/skewer/sku.go +++ /dev/null @@ -1,574 +0,0 @@ -package skewer - -import ( - "fmt" - "strconv" - "strings" - - "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute" //nolint:staticcheck - "github.com/pkg/errors" -) - -// SKU wraps an Azure compute SKU with richer functionality -type SKU compute.ResourceSku - -// ErrCapabilityNotFound will be returned when a capability could not be -// found, even without a value. -type ErrCapabilityNotFound struct { - capability string -} - -func (e *ErrCapabilityNotFound) Error() string { - return e.capability + "CapabilityNotFound" -} - -// ErrCapabilityValueNil will be returned when a capability was found by -// name but the value was nil. -type ErrCapabilityValueNil struct { - capability string -} - -func (e *ErrCapabilityValueNil) Error() string { - return e.capability + "CapabilityValueNil" -} - -// ErrCapabilityValueParse will be returned when a capability was found by -// name but there was error parsing the capability. -type ErrCapabilityValueParse struct { - capability string - value string - err error -} - -func (e *ErrCapabilityValueParse) Error() string { - return fmt.Sprintf("%sCapabilityValueParse: failed to parse string '%s' as int64, error: '%s'", e.capability, e.value, e.err) -} - -// VCPU returns the number of vCPUs this SKU supports. -func (s *SKU) VCPU() (int64, error) { - return s.GetCapabilityIntegerQuantity(VCPUs) -} - -// GPU returns the number of GPU this SKU supports. -func (s *SKU) GPU() (int64, error) { - return s.GetCapabilityIntegerQuantity(GPUs) -} - -// Memory returns the amount of memory this SKU supports. -func (s *SKU) Memory() (float64, error) { - return s.GetCapabilityFloatQuantity(MemoryGB) -} - -// MaxCachedDiskBytes returns the number of bytes available for the -// cache if it exists on this VM size. -func (s *SKU) MaxCachedDiskBytes() (int64, error) { - return s.GetCapabilityIntegerQuantity(CachedDiskBytes) -} - -// MaxResourceVolumeMB returns the number of bytes available for the -// cache if it exists on this VM size. -func (s *SKU) MaxResourceVolumeMB() (int64, error) { - return s.GetCapabilityIntegerQuantity(MaxResourceVolumeMB) -} - -// IsEncryptionAtHostSupported returns true when Encryption at Host is -// supported for the VM size. -func (s *SKU) IsEncryptionAtHostSupported() bool { - return s.HasCapability(EncryptionAtHost) -} - -// From ultra SSD documentation -// https://docs.microsoft.com/en-us/azure/virtual-machines/disks-enable-ultra-ssd -// Ultra SSD can be either supported on -// - "Single VMs" without availability zone support, or -// - On availability zones -// So provide functions to test both cases - -// IsUltraSSDAvailableWithoutAvailabilityZone returns true when a VM size has ultra SSD enabled -// in the region -func (s *SKU) IsUltraSSDAvailableWithoutAvailabilityZone() bool { - return s.HasCapability(UltraSSDAvailable) -} - -// IsUltraSSDAvailableInAvailabilityZone returns true when a VM size has ultra SSD enabled -// in the given availability zone -func (s *SKU) IsUltraSSDAvailableInAvailabilityZone(zone string) bool { - return s.HasCapabilityInZone(UltraSSDAvailable, zone) -} - -// IsUltraSSDAvailable returns true when a VM size has ultra SSD enabled -// in at least 1 unrestricted zone. -// -// Deprecated: use either IsUltraSSDAvailableWithoutAvailabilityZone or IsUltraSSDAvailableInAvailabilityZone -func (s *SKU) IsUltraSSDAvailable() bool { - return s.HasZonalCapability(UltraSSDAvailable) -} - -// IsEphemeralOSDiskSupported returns true when the VM size supports -// ephemeral OS. -func (s *SKU) IsEphemeralOSDiskSupported() bool { - return s.HasCapability(EphemeralOSDisk) -} - -// IsAcceleratedNetworkingSupported returns true when the VM size supports -// accelerated networking. -func (s *SKU) IsAcceleratedNetworkingSupported() bool { - return s.HasCapability(AcceleratedNetworking) -} - -// IsPremiumIO returns true when the VM size supports PremiumIO. -func (s *SKU) IsPremiumIO() bool { - return s.HasCapability(CapabilityPremiumIO) -} - -// IsHyperVGen1Supported returns true when the VM size supports -// accelerated networking. -func (s *SKU) IsHyperVGen1Supported() bool { - return s.HasCapabilityWithSeparator(HyperVGenerations, HyperVGeneration1) -} - -// IsHyperVGen2Supported returns true when the VM size supports -// accelerated networking. -func (s *SKU) IsHyperVGen2Supported() bool { - return s.HasCapabilityWithSeparator(HyperVGenerations, HyperVGeneration2) -} - -// GetCPUArchitectureType returns cpu arch for the VM size. -// It errors if value is nil or not found. -func (s *SKU) GetCPUArchitectureType() (string, error) { - return s.GetCapabilityString(CapabilityCPUArchitectureType) -} - -// GetCapabilityIntegerQuantity retrieves and parses the value of an -// integer numeric capability with the provided name. It errors if the -// capability is not found, the value was nil, or the value could not be -// parsed as an integer. -func (s *SKU) GetCapabilityIntegerQuantity(name string) (int64, error) { - if s.Capabilities == nil { - return -1, &ErrCapabilityNotFound{name} - } - for _, capability := range *s.Capabilities { - if capability.Name != nil && *capability.Name == name { - if capability.Value != nil { - intVal, err := strconv.ParseInt(*capability.Value, ten, sixtyFour) - if err != nil { - return -1, &ErrCapabilityValueParse{name, *capability.Value, err} - } - return intVal, nil - } - return -1, &ErrCapabilityValueNil{name} - } - } - return -1, &ErrCapabilityNotFound{name} -} - -// GetCapabilityFloatQuantity retrieves and parses the value of a -// floating point numeric capability with the provided name. It errors -// if the capability is not found, the value was nil, or the value could -// not be parsed as an integer. -func (s *SKU) GetCapabilityFloatQuantity(name string) (float64, error) { - if s.Capabilities == nil { - return -1, &ErrCapabilityNotFound{name} - } - for _, capability := range *s.Capabilities { - if capability.Name != nil && *capability.Name == name { - if capability.Value != nil { - intVal, err := strconv.ParseFloat(*capability.Value, sixtyFour) - if err != nil { - return -1, &ErrCapabilityValueParse{name, *capability.Value, err} - } - return intVal, nil - } - return -1, &ErrCapabilityValueNil{name} - } - } - return -1, &ErrCapabilityNotFound{name} -} - -// GetCapabilityString retrieves string capability with the provided name. -// It errors if the capability is not found or the value was nil -func (s *SKU) GetCapabilityString(name string) (string, error) { - if s.Capabilities == nil { - return "", &ErrCapabilityNotFound{name} - } - for _, capability := range *s.Capabilities { - if capability.Name != nil && *capability.Name == name { - if capability.Value != nil { - return *capability.Value, nil - } - return "", &ErrCapabilityValueNil{name} - } - } - return "", &ErrCapabilityNotFound{name} -} - -// HasCapability return true for a capability which can be either -// supported or not. Examples include "EphemeralOSDiskSupported", -// "EncryptionAtHostSupported", "AcceleratedNetworkingEnabled", and -// "RdmaEnabled" -func (s *SKU) HasCapability(name string) bool { - if s.Capabilities == nil { - return false - } - for _, capability := range *s.Capabilities { - if capability.Name != nil && strings.EqualFold(*capability.Name, name) { - return capability.Value != nil && strings.EqualFold(*capability.Value, string(CapabilitySupported)) - } - } - return false -} - -// HasZonalCapability return true for a capability which can be either -// supported or not. Examples include "UltraSSDAvailable". -// This function only checks that zone details suggest support: it will -// return true for a whole location even when only one zone supports the -// feature. Currently, the only real scenario that appears to use -// zoneDetails is UltraSSDAvailable which always lists all regions as -// available. -// For per zone capability check, use "HasCapabilityInZone" -func (s *SKU) HasZonalCapability(name string) bool { - if s.LocationInfo == nil { - return false - } - for _, locationInfo := range *s.LocationInfo { - if locationInfo.ZoneDetails == nil { - continue - } - for _, zoneDetails := range *locationInfo.ZoneDetails { - if zoneDetails.Capabilities == nil { - continue - } - for _, capability := range *zoneDetails.Capabilities { - if capability.Name != nil && strings.EqualFold(*capability.Name, name) { - if capability.Value != nil && strings.EqualFold(*capability.Value, string(CapabilitySupported)) { - return true - } - } - } - } - } - return false -} - -// HasCapabilityInZone return true if the specified capability name is supported in the -// specified zone. -func (s *SKU) HasCapabilityInZone(name, zone string) bool { - if s.LocationInfo == nil { - return false - } - for _, locationInfo := range *s.LocationInfo { - if locationInfo.ZoneDetails == nil { - continue - } - for _, zoneDetails := range *locationInfo.ZoneDetails { - if zoneDetails.Capabilities == nil { - continue - } - foundZone := false - if zoneDetails.Name != nil { - for _, zoneName := range *zoneDetails.Name { - if strings.EqualFold(zone, zoneName) { - foundZone = true - break - } - } - } - if !foundZone { - continue - } - - for _, capability := range *zoneDetails.Capabilities { - if capability.Name != nil && strings.EqualFold(*capability.Name, name) { - if capability.Value != nil && strings.EqualFold(*capability.Value, string(CapabilitySupported)) { - return true - } - } - } - } - } - return false -} - -// HasCapabilityWithSeparator return true for a capability which may be -// exposed as a comma-separated list. We check that the list contains -// the desired substring. An example is "HyperVGenerations" which may be -// "V1,V2" -func (s *SKU) HasCapabilityWithSeparator(name, value string) bool { - if s.Capabilities == nil { - return false - } - for _, capability := range *s.Capabilities { - if capability.Name != nil && strings.EqualFold(*capability.Name, name) { - return capability.Value != nil && strings.Contains(normalizeLocation(*capability.Value), normalizeLocation(value)) - } - } - return false -} - -// HasCapabilityWithMinCapacity returns true when the SKU has a -// capability with the requested name, and the value is greater than or -// equal to the desired value. -// "MaxResourceVolumeMB", "OSVhdSizeMB", "vCPUs", -// "MemoryGB","MaxDataDiskCount", "CombinedTempDiskAndCachedIOPS", -// "CombinedTempDiskAndCachedReadBytesPerSecond", -// "CombinedTempDiskAndCachedWriteBytesPerSecond", "UncachedDiskIOPS", -// and "UncachedDiskBytesPerSecond" -func (s *SKU) HasCapabilityWithMinCapacity(name string, value int64) (bool, error) { - if s.Capabilities == nil { - return false, nil - } - for _, capability := range *s.Capabilities { - if capability.Name != nil && strings.EqualFold(*capability.Name, name) { - if capability.Value != nil { - intVal, err := strconv.ParseInt(*capability.Value, ten, sixtyFour) - if err != nil { - return false, errors.Wrapf(err, "failed to parse string '%s' as int64", *capability.Value) - } - if intVal >= value { - return true, nil - } - } - return false, nil - } - } - return false, nil -} - -// IsAvailable returns true when the requested location matches one on -// the sku, and there are no total restrictions on the location. -func (s *SKU) IsAvailable(location string) bool { - if s.LocationInfo == nil { - return false - } - for _, locationInfo := range *s.LocationInfo { - if locationInfo.Location != nil { - if locationEquals(*locationInfo.Location, location) { - if s.Restrictions != nil { - for _, restriction := range *s.Restrictions { - // Can't deploy to any zones in this location. We're done. - if restriction.Type == compute.Location { - return false - } - } - } - return true - } - } - } - return false -} - -// IsRestricted returns true when a location restriction exists for -// this SKU. -func (s *SKU) IsRestricted(location string) bool { - if s.Restrictions == nil { - return false - } - for _, restriction := range *s.Restrictions { - if restriction.Values == nil { - continue - } - for _, candidate := range *restriction.Values { - // Can't deploy in this location. We're done. - if locationEquals(candidate, location) && restriction.Type == compute.Location { - return true - } - } - } - return false -} - -// IsResourceType returns true when the wrapped SKU has the provided -// value as its resource type. This may be used to filter using values -// such as "virtualMachines", "disks", "availabilitySets", "snapshots", -// and "hostGroups/hosts". -func (s *SKU) IsResourceType(t string) bool { - return s.ResourceType != nil && strings.EqualFold(*s.ResourceType, t) -} - -// GetResourceType returns the name of this resource sku. It normalizes pointers -// to the empty string for comparison purposes. For example, -// "virtualMachines" for a virtual machine. -func (s *SKU) GetResourceType() string { - if s.ResourceType == nil { - return "" - } - return *s.ResourceType -} - -// GetName returns the name of this resource sku. It normalizes pointers -// to the empty string for comparison purposes. For example, -// "Standard_D8s_v3" for a virtual machine. -func (s *SKU) GetName() string { - if s.Name == nil { - return "" - } - - return *s.Name -} - -// GetFamilyName returns the family name of this resource sku. It normalizes pointers -// to the empty string for comparison purposes. For example, -// "standardDSv2Family" for a virtual machine. -func (s *SKU) GetFamilyName() string { - if s.Family == nil { - return "" - } - - return *s.Family -} - -// GetSize returns the size of this resource sku. It normalizes pointers -// to the empty string for comparison purposes. For example, -// "M416ms_v2" for a virtual machine. -func (s *SKU) GetSize() string { - if s.Size == nil { - return "" - } - - return *s.Size -} - -func (s *SKU) GetVMSize() (*VMSizeType, error) { - return getVMSize(s.GetSize()) -} - -// GetLocation returns the location for a given SKU. -func (s *SKU) GetLocation() (string, error) { - if s.Locations == nil { - return "", fmt.Errorf("sku had nil location array") - } - - if len(*s.Locations) < 1 { - return "", fmt.Errorf("sku had no locations") - } - - if len(*s.Locations) > 1 { - return "", fmt.Errorf("sku had multiple locations, refusing to disambiguate") - } - - return (*s.Locations)[0], nil -} - -// HasLocation returns true if the given sku exposes this region for deployment. -func (s *SKU) HasLocation(location string) bool { - if s.Locations == nil { - return false - } - - for _, candidate := range *s.Locations { - if locationEquals(candidate, location) { - return true - } - } - - return false -} - -// HasLocationRestriction returns true if the location is restricted for -// this sku. -func (s *SKU) HasLocationRestriction(location string) bool { - if s.Restrictions == nil { - return false - } - - for _, restriction := range *s.Restrictions { - if restriction.Type != compute.Location { - continue - } - if restriction.Values == nil { - continue - } - for _, candidate := range *restriction.Values { - if locationEquals(candidate, location) { - return true - } - } - } - - return false -} - -// IsConfidentialComputingTypeSNP return true if ConfidentialComputingType is SNP for this sku. -func (s *SKU) IsConfidentialComputingTypeSNP() (bool, error) { - return s.HasCapabilityWithSeparator(CapabilityConfidentialComputingType, ConfidentialComputingTypeSNP), nil -} - -// Official documentation for Trusted Launch states: -// The response will be similar to the following form: -// IsTrustedLaunchEnabled True in the output indicates that the Generation 2 VM size does not support Trusted launch. -// If it's a Generation 2 VM size and TrustedLaunchDisabled is not part of the output, -// it implies that Trusted launch is supported for that VM size. -func (s *SKU) IsTrustedLaunchEnabled() (bool, error) { - if s.IsHyperVGen2Supported() { - if !s.HasCapabilityWithSeparator(CapabilityTrustedLaunchDisabled, string(CapabilitySupported)) { - return true, nil - } - } - return false, nil -} - -// AvailabilityZones returns the list of Availability Zones which have this resource SKU available and unrestricted. -func (s *SKU) AvailabilityZones(location string) map[string]bool { //nolint:gocyclo - if s.LocationInfo == nil { - return nil - } - - // Use map for easy deletion and iteration - availableZones := make(map[string]bool) - restrictedZones := make(map[string]bool) - - for _, locationInfo := range *s.LocationInfo { - if locationInfo.Location == nil { - continue - } - if locationEquals(*locationInfo.Location, location) { - // add all zones - if locationInfo.Zones != nil { - for _, zone := range *locationInfo.Zones { - availableZones[zone] = true - } - } - - // iterate restrictions, remove any restricted zones for this location - if s.Restrictions != nil { - for _, restriction := range *s.Restrictions { - if restriction.Values != nil { - for _, candidate := range *restriction.Values { - if locationEquals(candidate, location) { - if restriction.Type == compute.Location { - // Can't deploy in this location. We're done. - return nil - } - - if restriction.RestrictionInfo != nil && restriction.RestrictionInfo.Zones != nil { - // remove restricted zones - for _, zone := range *restriction.RestrictionInfo.Zones { - restrictedZones[zone] = true - } - } - } - } - } - } - } - } - } - - for zone := range restrictedZones { - delete(availableZones, zone) - } - - return availableZones -} - -// Equal returns true when two skus have the same location, type, and name. -func (s *SKU) Equal(other *SKU) bool { - location, localErr := s.GetLocation() - otherLocation, otherErr := s.GetLocation() - return strings.EqualFold(s.GetResourceType(), other.GetResourceType()) && - strings.EqualFold(s.GetName(), other.GetName()) && - locationEquals(location, otherLocation) && - localErr != nil && - otherErr != nil -} diff --git a/vendor/github.com/Azure/skewer/strings.go b/vendor/github.com/Azure/skewer/strings.go deleted file mode 100644 index 133a5680..00000000 --- a/vendor/github.com/Azure/skewer/strings.go +++ /dev/null @@ -1,20 +0,0 @@ -package skewer - -import ( - "strings" - "unicode" -) - -func normalizeLocation(input string) string { - var output string - for _, c := range input { - if !unicode.IsSpace(c) { - output += string(c) - } - } - return strings.ToLower(output) -} - -func locationEquals(a, b string) bool { - return normalizeLocation(a) == normalizeLocation(b) -} diff --git a/vendor/github.com/Azure/skewer/vmsize.go b/vendor/github.com/Azure/skewer/vmsize.go deleted file mode 100644 index 3f79a0ce..00000000 --- a/vendor/github.com/Azure/skewer/vmsize.go +++ /dev/null @@ -1,131 +0,0 @@ -package skewer - -import ( - "fmt" - "regexp" - "strconv" -) - -// This file adds support for more capabilities based on VM naming conventions that includes vmsize parsing. -// VM naming conventions are documented at: https://docs.microsoft.com/en-us/azure/virtual-machines/vm-naming-conventions -// Note: Some common capabilities like familyName and VCPUs, which can also be -// fetched using the ResourceSKU API, are not included here. They can be found in sku.go. - -var skuSizeScheme = regexp.MustCompile( - `^([A-Z])([A-Z]?)([0-9]+)-?((?:[0-9]+)?)((?:[abcdilmtspPr]+|C+|NP)?)_?(?:([A-Z][0-9]+)_?)?(_cc_)?((?:[vV][1-9])?)?(_Promo)?$`, -) - -// unParsableVMSizes map holds vmSize strings that cannot be easily parsed with skuSizeScheme. -var unParsableVMSizes = map[string]VMSizeType{ - "M416s_8_v2": { - Family: "M", - Subfamily: nil, - Cpus: "416", - CpusConstrained: nil, - AdditiveFeatures: []rune{'s'}, - AcceleratorType: nil, - ConfidentialChildCapability: false, - Version: "v2", - PromoVersion: false, - Series: "Ms_v2", - }, -} - -type VMSizeType struct { - Family string - Subfamily *string - Cpus string - CpusConstrained *string - AdditiveFeatures []rune - AcceleratorType *string - ConfidentialChildCapability bool - Version string - PromoVersion bool - Series string -} - -// parseVMSize parses the VM size and returns the parts as a map. -func parseVMSize(vmSizeName string) ([]string, error) { - parts := skuSizeScheme.FindStringSubmatch(vmSizeName) - if parts == nil || len(parts) < 10 { - return nil, fmt.Errorf("could not parse VM size %s", vmSizeName) - } - return parts, nil -} - -// getVMSize is a helper function used by GetVMSize() in sku.go -func getVMSize(vmSizeName string) (*VMSizeType, error) { - vmSize := VMSizeType{} - - parts, err := parseVMSize(vmSizeName) - if err != nil { - if vmSizeVal, ok := unParsableVMSizes[vmSizeName]; ok { - return &vmSizeVal, nil - } - return nil, err - } - - // [Family] - ([A-Z]): Captures a single uppercase letter. - vmSize.Family = parts[1] - - // [Sub-family]* - ([A-Z]?): Optionally captures another uppercase letter. - if len(parts[2]) > 0 { - vmSize.Subfamily = &parts[2] - } - - // [# of vCPUs] - ([0-9]+): Captures one or more digits. - vmSize.Cpus = parts[3] - - // [Constrained vCPUs]* - // -?: Optionally captures a hyphen. - // ((?:[0-9]+)?): Optionally captures another sequence of one or more digits. - if len(parts[4]) > 0 { - _, err := strconv.Atoi(parts[4]) - if err != nil { - return nil, fmt.Errorf("converting constrained CPUs, %w", err) - } - vmSize.CpusConstrained = &parts[4] - } - - // [Additive Features] - // ((?:[abcdilmtspPr]+|C+|NP)?): Captures a sequence of letters representing certain attributes. - // It can capture combinations like 'abcdilmtspPr' or 'C+' or 'NP'. - vmSize.AdditiveFeatures = []rune(parts[5]) - - // [Accelerator Type]* - // _?: Optionally captures an underscore. - // (?:([A-Z][0-9]+)_?)?: Optionally captures a pattern that starts with an uppercase letter followed by digits, - // followed by an optional underscore. - if len(parts[6]) > 0 { - vmSize.AcceleratorType = &parts[6] - } - - // [Confidential Child Capability]* - only AKS - // (_cc_)?: Optionally captures the string "cc" with underscores on both sides. - if parts[7] == "_cc_" { - vmSize.ConfidentialChildCapability = true - } - - // [Version]* - // Optionally captures the pattern 'v' or 'V' followed by a digit from 1 to 9. - vmSize.Version = parts[8] - - // [Promo]* - // (_Promo)?: Optionally captures the string "_Promo". - if parts[9] == "_Promo" { - vmSize.PromoVersion = true - } - - // [Series] - subfamily := "" - if vmSize.Subfamily != nil { - subfamily = *vmSize.Subfamily - } - version := "" - if len(vmSize.Version) > 0 { - version = "_" + vmSize.Version - } - vmSize.Series = vmSize.Family + subfamily + string(vmSize.AdditiveFeatures) + version - - return &vmSize, nil -} diff --git a/vendor/github.com/Azure/skewer/wrap.go b/vendor/github.com/Azure/skewer/wrap.go deleted file mode 100644 index 711555da..00000000 --- a/vendor/github.com/Azure/skewer/wrap.go +++ /dev/null @@ -1,13 +0,0 @@ -package skewer - -import "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute" //nolint:staticcheck - -// Wrap takes an array of compute resource skus and wraps them into an -// array of our richer type. -func Wrap(in []compute.ResourceSku) []SKU { - out := make([]SKU, len(in)) - for index, value := range in { - out[index] = SKU(value) - } - return out -} diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/local/server.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/local/server.go deleted file mode 100644 index 04236ff3..00000000 --- a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/local/server.go +++ /dev/null @@ -1,177 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -// Package local contains a local HTTP server used with interactive authentication. -package local - -import ( - "context" - "fmt" - "net" - "net/http" - "strconv" - "strings" - "time" -) - -var okPage = []byte(` - - - - - Authentication Complete - - -

      Authentication complete. You can return to the application. Feel free to close this browser tab.

      - - -`) - -const failPage = ` - - - - - Authentication Failed - - -

      Authentication failed. You can return to the application. Feel free to close this browser tab.

      -

      Error details: error %s error_description: %s

      - - -` - -// Result is the result from the redirect. -type Result struct { - // Code is the code sent by the authority server. - Code string - // Err is set if there was an error. - Err error -} - -// Server is an HTTP server. -type Server struct { - // Addr is the address the server is listening on. - Addr string - resultCh chan Result - s *http.Server - reqState string -} - -// New creates a local HTTP server and starts it. -func New(reqState string, port int) (*Server, error) { - var l net.Listener - var err error - var portStr string - if port > 0 { - // use port provided by caller - l, err = net.Listen("tcp", fmt.Sprintf("localhost:%d", port)) - portStr = strconv.FormatInt(int64(port), 10) - } else { - // find a free port - for i := 0; i < 10; i++ { - l, err = net.Listen("tcp", "localhost:0") - if err != nil { - continue - } - addr := l.Addr().String() - portStr = addr[strings.LastIndex(addr, ":")+1:] - break - } - } - if err != nil { - return nil, err - } - - serv := &Server{ - Addr: fmt.Sprintf("http://localhost:%s", portStr), - s: &http.Server{Addr: "localhost:0", ReadHeaderTimeout: time.Second}, - reqState: reqState, - resultCh: make(chan Result, 1), - } - serv.s.Handler = http.HandlerFunc(serv.handler) - - if err := serv.start(l); err != nil { - return nil, err - } - - return serv, nil -} - -func (s *Server) start(l net.Listener) error { - go func() { - err := s.s.Serve(l) - if err != nil { - select { - case s.resultCh <- Result{Err: err}: - default: - } - } - }() - - return nil -} - -// Result gets the result of the redirect operation. Once a single result is returned, the server -// is shutdown. ctx deadline will be honored. -func (s *Server) Result(ctx context.Context) Result { - select { - case <-ctx.Done(): - return Result{Err: ctx.Err()} - case r := <-s.resultCh: - return r - } -} - -// Shutdown shuts down the server. -func (s *Server) Shutdown() { - // Note: You might get clever and think you can do this in handler() as a defer, you can't. - _ = s.s.Shutdown(context.Background()) -} - -func (s *Server) putResult(r Result) { - select { - case s.resultCh <- r: - default: - } -} - -func (s *Server) handler(w http.ResponseWriter, r *http.Request) { - q := r.URL.Query() - - headerErr := q.Get("error") - if headerErr != "" { - desc := q.Get("error_description") - // Note: It is a little weird we handle some errors by not going to the failPage. If they all should, - // change this to s.error() and make s.error() write the failPage instead of an error code. - _, _ = w.Write([]byte(fmt.Sprintf(failPage, headerErr, desc))) - s.putResult(Result{Err: fmt.Errorf(desc)}) - return - } - - respState := q.Get("state") - switch respState { - case s.reqState: - case "": - s.error(w, http.StatusInternalServerError, "server didn't send OAuth state") - return - default: - s.error(w, http.StatusInternalServerError, "mismatched OAuth state, req(%s), resp(%s)", s.reqState, respState) - return - } - - code := q.Get("code") - if code == "" { - s.error(w, http.StatusInternalServerError, "authorization code missing in query string") - return - } - - _, _ = w.Write(okPage) - s.putResult(Result{Code: code}) -} - -func (s *Server) error(w http.ResponseWriter, code int, str string, i ...interface{}) { - err := fmt.Errorf(str, i...) - http.Error(w, err.Error(), code) - s.putResult(Result{Err: err}) -} diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/public/public.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/public/public.go deleted file mode 100644 index 392e5e43..00000000 --- a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/public/public.go +++ /dev/null @@ -1,756 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -/* -Package public provides a client for authentication of "public" applications. A "public" -application is defined as an app that runs on client devices (android, ios, windows, linux, ...). -These devices are "untrusted" and access resources via web APIs that must authenticate. -*/ -package public - -/* -Design note: - -public.Client uses client.Base as an embedded type. client.Base statically assigns its attributes -during creation. As it doesn't have any pointers in it, anything borrowed from it, such as -Base.AuthParams is a copy that is free to be manipulated here. -*/ - -// TODO(msal): This should have example code for each method on client using Go's example doc framework. -// base usage details should be includee in the package documentation. - -import ( - "context" - "crypto/rand" - "crypto/sha256" - "encoding/base64" - "errors" - "fmt" - "net/url" - "reflect" - "strconv" - - "github.com/AzureAD/microsoft-authentication-library-for-go/apps/cache" - "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base" - "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/local" - "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth" - "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops" - "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/accesstokens" - "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority" - "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/options" - "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/shared" - "github.com/google/uuid" - "github.com/pkg/browser" -) - -// AuthResult contains the results of one token acquisition operation. -// For details see https://aka.ms/msal-net-authenticationresult -type AuthResult = base.AuthResult - -type AuthenticationScheme = authority.AuthenticationScheme - -type Account = shared.Account - -var errNoAccount = errors.New("no account was specified with public.WithSilentAccount(), or the specified account is invalid") - -// clientOptions configures the Client's behavior. -type clientOptions struct { - accessor cache.ExportReplace - authority string - capabilities []string - disableInstanceDiscovery bool - httpClient ops.HTTPClient -} - -func (p *clientOptions) validate() error { - u, err := url.Parse(p.authority) - if err != nil { - return fmt.Errorf("Authority options cannot be URL parsed: %w", err) - } - if u.Scheme != "https" { - return fmt.Errorf("Authority(%s) did not start with https://", u.String()) - } - return nil -} - -// Option is an optional argument to the New constructor. -type Option func(o *clientOptions) - -// WithAuthority allows for a custom authority to be set. This must be a valid https url. -func WithAuthority(authority string) Option { - return func(o *clientOptions) { - o.authority = authority - } -} - -// WithCache provides an accessor that will read and write authentication data to an externally managed cache. -func WithCache(accessor cache.ExportReplace) Option { - return func(o *clientOptions) { - o.accessor = accessor - } -} - -// WithClientCapabilities allows configuring one or more client capabilities such as "CP1" -func WithClientCapabilities(capabilities []string) Option { - return func(o *clientOptions) { - // there's no danger of sharing the slice's underlying memory with the application because - // this slice is simply passed to base.WithClientCapabilities, which copies its data - o.capabilities = capabilities - } -} - -// WithHTTPClient allows for a custom HTTP client to be set. -func WithHTTPClient(httpClient ops.HTTPClient) Option { - return func(o *clientOptions) { - o.httpClient = httpClient - } -} - -// WithInstanceDiscovery set to false to disable authority validation (to support private cloud scenarios) -func WithInstanceDiscovery(enabled bool) Option { - return func(o *clientOptions) { - o.disableInstanceDiscovery = !enabled - } -} - -// Client is a representation of authentication client for public applications as defined in the -// package doc. For more information, visit https://docs.microsoft.com/azure/active-directory/develop/msal-client-applications. -type Client struct { - base base.Client -} - -// New is the constructor for Client. -func New(clientID string, options ...Option) (Client, error) { - opts := clientOptions{ - authority: base.AuthorityPublicCloud, - httpClient: shared.DefaultClient, - } - - for _, o := range options { - o(&opts) - } - if err := opts.validate(); err != nil { - return Client{}, err - } - - base, err := base.New(clientID, opts.authority, oauth.New(opts.httpClient), base.WithCacheAccessor(opts.accessor), base.WithClientCapabilities(opts.capabilities), base.WithInstanceDiscovery(!opts.disableInstanceDiscovery)) - if err != nil { - return Client{}, err - } - return Client{base}, nil -} - -// authCodeURLOptions contains options for AuthCodeURL -type authCodeURLOptions struct { - claims, loginHint, tenantID, domainHint string -} - -// AuthCodeURLOption is implemented by options for AuthCodeURL -type AuthCodeURLOption interface { - authCodeURLOption() -} - -// AuthCodeURL creates a URL used to acquire an authorization code. -// -// Options: [WithClaims], [WithDomainHint], [WithLoginHint], [WithTenantID] -func (pca Client) AuthCodeURL(ctx context.Context, clientID, redirectURI string, scopes []string, opts ...AuthCodeURLOption) (string, error) { - o := authCodeURLOptions{} - if err := options.ApplyOptions(&o, opts); err != nil { - return "", err - } - ap, err := pca.base.AuthParams.WithTenant(o.tenantID) - if err != nil { - return "", err - } - ap.Claims = o.claims - ap.LoginHint = o.loginHint - ap.DomainHint = o.domainHint - return pca.base.AuthCodeURL(ctx, clientID, redirectURI, scopes, ap) -} - -// WithClaims sets additional claims to request for the token, such as those required by conditional access policies. -// Use this option when Azure AD returned a claims challenge for a prior request. The argument must be decoded. -// This option is valid for any token acquisition method. -func WithClaims(claims string) interface { - AcquireByAuthCodeOption - AcquireByDeviceCodeOption - AcquireByUsernamePasswordOption - AcquireInteractiveOption - AcquireSilentOption - AuthCodeURLOption - options.CallOption -} { - return struct { - AcquireByAuthCodeOption - AcquireByDeviceCodeOption - AcquireByUsernamePasswordOption - AcquireInteractiveOption - AcquireSilentOption - AuthCodeURLOption - options.CallOption - }{ - CallOption: options.NewCallOption( - func(a any) error { - switch t := a.(type) { - case *acquireTokenByAuthCodeOptions: - t.claims = claims - case *acquireTokenByDeviceCodeOptions: - t.claims = claims - case *acquireTokenByUsernamePasswordOptions: - t.claims = claims - case *acquireTokenSilentOptions: - t.claims = claims - case *authCodeURLOptions: - t.claims = claims - case *interactiveAuthOptions: - t.claims = claims - default: - return fmt.Errorf("unexpected options type %T", a) - } - return nil - }, - ), - } -} - -// WithAuthenticationScheme is an extensibility mechanism designed to be used only by Azure Arc for proof of possession access tokens. -func WithAuthenticationScheme(authnScheme AuthenticationScheme) interface { - AcquireSilentOption - AcquireInteractiveOption - AcquireByUsernamePasswordOption - options.CallOption -} { - return struct { - AcquireSilentOption - AcquireInteractiveOption - AcquireByUsernamePasswordOption - options.CallOption - }{ - CallOption: options.NewCallOption( - func(a any) error { - switch t := a.(type) { - case *acquireTokenSilentOptions: - t.authnScheme = authnScheme - case *interactiveAuthOptions: - t.authnScheme = authnScheme - case *acquireTokenByUsernamePasswordOptions: - t.authnScheme = authnScheme - default: - return fmt.Errorf("unexpected options type %T", a) - } - return nil - }, - ), - } -} - -// WithTenantID specifies a tenant for a single authentication. It may be different than the tenant set in [New] by [WithAuthority]. -// This option is valid for any token acquisition method. -func WithTenantID(tenantID string) interface { - AcquireByAuthCodeOption - AcquireByDeviceCodeOption - AcquireByUsernamePasswordOption - AcquireInteractiveOption - AcquireSilentOption - AuthCodeURLOption - options.CallOption -} { - return struct { - AcquireByAuthCodeOption - AcquireByDeviceCodeOption - AcquireByUsernamePasswordOption - AcquireInteractiveOption - AcquireSilentOption - AuthCodeURLOption - options.CallOption - }{ - CallOption: options.NewCallOption( - func(a any) error { - switch t := a.(type) { - case *acquireTokenByAuthCodeOptions: - t.tenantID = tenantID - case *acquireTokenByDeviceCodeOptions: - t.tenantID = tenantID - case *acquireTokenByUsernamePasswordOptions: - t.tenantID = tenantID - case *acquireTokenSilentOptions: - t.tenantID = tenantID - case *authCodeURLOptions: - t.tenantID = tenantID - case *interactiveAuthOptions: - t.tenantID = tenantID - default: - return fmt.Errorf("unexpected options type %T", a) - } - return nil - }, - ), - } -} - -// acquireTokenSilentOptions are all the optional settings to an AcquireTokenSilent() call. -// These are set by using various AcquireTokenSilentOption functions. -type acquireTokenSilentOptions struct { - account Account - claims, tenantID string - authnScheme AuthenticationScheme -} - -// AcquireSilentOption is implemented by options for AcquireTokenSilent -type AcquireSilentOption interface { - acquireSilentOption() -} - -// WithSilentAccount uses the passed account during an AcquireTokenSilent() call. -func WithSilentAccount(account Account) interface { - AcquireSilentOption - options.CallOption -} { - return struct { - AcquireSilentOption - options.CallOption - }{ - CallOption: options.NewCallOption( - func(a any) error { - switch t := a.(type) { - case *acquireTokenSilentOptions: - t.account = account - default: - return fmt.Errorf("unexpected options type %T", a) - } - return nil - }, - ), - } -} - -// AcquireTokenSilent acquires a token from either the cache or using a refresh token. -// -// Options: [WithClaims], [WithSilentAccount], [WithTenantID] -func (pca Client) AcquireTokenSilent(ctx context.Context, scopes []string, opts ...AcquireSilentOption) (AuthResult, error) { - o := acquireTokenSilentOptions{} - if err := options.ApplyOptions(&o, opts); err != nil { - return AuthResult{}, err - } - // an account is required to find user tokens in the cache - if reflect.ValueOf(o.account).IsZero() { - return AuthResult{}, errNoAccount - } - - silentParameters := base.AcquireTokenSilentParameters{ - Scopes: scopes, - Account: o.account, - Claims: o.claims, - RequestType: accesstokens.ATPublic, - IsAppCache: false, - TenantID: o.tenantID, - AuthnScheme: o.authnScheme, - } - - return pca.base.AcquireTokenSilent(ctx, silentParameters) -} - -// acquireTokenByUsernamePasswordOptions contains optional configuration for AcquireTokenByUsernamePassword -type acquireTokenByUsernamePasswordOptions struct { - claims, tenantID string - authnScheme AuthenticationScheme -} - -// AcquireByUsernamePasswordOption is implemented by options for AcquireTokenByUsernamePassword -type AcquireByUsernamePasswordOption interface { - acquireByUsernamePasswordOption() -} - -// AcquireTokenByUsernamePassword acquires a security token from the authority, via Username/Password Authentication. -// NOTE: this flow is NOT recommended. -// -// Options: [WithClaims], [WithTenantID] -func (pca Client) AcquireTokenByUsernamePassword(ctx context.Context, scopes []string, username, password string, opts ...AcquireByUsernamePasswordOption) (AuthResult, error) { - o := acquireTokenByUsernamePasswordOptions{} - if err := options.ApplyOptions(&o, opts); err != nil { - return AuthResult{}, err - } - authParams, err := pca.base.AuthParams.WithTenant(o.tenantID) - if err != nil { - return AuthResult{}, err - } - authParams.Scopes = scopes - authParams.AuthorizationType = authority.ATUsernamePassword - authParams.Claims = o.claims - authParams.Username = username - authParams.Password = password - if o.authnScheme != nil { - authParams.AuthnScheme = o.authnScheme - } - - token, err := pca.base.Token.UsernamePassword(ctx, authParams) - if err != nil { - return AuthResult{}, err - } - return pca.base.AuthResultFromToken(ctx, authParams, token, true) -} - -type DeviceCodeResult = accesstokens.DeviceCodeResult - -// DeviceCode provides the results of the device code flows first stage (containing the code) -// that must be entered on the second device and provides a method to retrieve the AuthenticationResult -// once that code has been entered and verified. -type DeviceCode struct { - // Result holds the information about the device code (such as the code). - Result DeviceCodeResult - - authParams authority.AuthParams - client Client - dc oauth.DeviceCode -} - -// AuthenticationResult retreives the AuthenticationResult once the user enters the code -// on the second device. Until then it blocks until the .AcquireTokenByDeviceCode() context -// is cancelled or the token expires. -func (d DeviceCode) AuthenticationResult(ctx context.Context) (AuthResult, error) { - token, err := d.dc.Token(ctx) - if err != nil { - return AuthResult{}, err - } - return d.client.base.AuthResultFromToken(ctx, d.authParams, token, true) -} - -// acquireTokenByDeviceCodeOptions contains optional configuration for AcquireTokenByDeviceCode -type acquireTokenByDeviceCodeOptions struct { - claims, tenantID string -} - -// AcquireByDeviceCodeOption is implemented by options for AcquireTokenByDeviceCode -type AcquireByDeviceCodeOption interface { - acquireByDeviceCodeOptions() -} - -// AcquireTokenByDeviceCode acquires a security token from the authority, by acquiring a device code and using that to acquire the token. -// Users need to create an AcquireTokenDeviceCodeParameters instance and pass it in. -// -// Options: [WithClaims], [WithTenantID] -func (pca Client) AcquireTokenByDeviceCode(ctx context.Context, scopes []string, opts ...AcquireByDeviceCodeOption) (DeviceCode, error) { - o := acquireTokenByDeviceCodeOptions{} - if err := options.ApplyOptions(&o, opts); err != nil { - return DeviceCode{}, err - } - authParams, err := pca.base.AuthParams.WithTenant(o.tenantID) - if err != nil { - return DeviceCode{}, err - } - authParams.Scopes = scopes - authParams.AuthorizationType = authority.ATDeviceCode - authParams.Claims = o.claims - - dc, err := pca.base.Token.DeviceCode(ctx, authParams) - if err != nil { - return DeviceCode{}, err - } - - return DeviceCode{Result: dc.Result, authParams: authParams, client: pca, dc: dc}, nil -} - -// acquireTokenByAuthCodeOptions contains the optional parameters used to acquire an access token using the authorization code flow. -type acquireTokenByAuthCodeOptions struct { - challenge, claims, tenantID string -} - -// AcquireByAuthCodeOption is implemented by options for AcquireTokenByAuthCode -type AcquireByAuthCodeOption interface { - acquireByAuthCodeOption() -} - -// WithChallenge allows you to provide a code for the .AcquireTokenByAuthCode() call. -func WithChallenge(challenge string) interface { - AcquireByAuthCodeOption - options.CallOption -} { - return struct { - AcquireByAuthCodeOption - options.CallOption - }{ - CallOption: options.NewCallOption( - func(a any) error { - switch t := a.(type) { - case *acquireTokenByAuthCodeOptions: - t.challenge = challenge - default: - return fmt.Errorf("unexpected options type %T", a) - } - return nil - }, - ), - } -} - -// AcquireTokenByAuthCode is a request to acquire a security token from the authority, using an authorization code. -// The specified redirect URI must be the same URI that was used when the authorization code was requested. -// -// Options: [WithChallenge], [WithClaims], [WithTenantID] -func (pca Client) AcquireTokenByAuthCode(ctx context.Context, code string, redirectURI string, scopes []string, opts ...AcquireByAuthCodeOption) (AuthResult, error) { - o := acquireTokenByAuthCodeOptions{} - if err := options.ApplyOptions(&o, opts); err != nil { - return AuthResult{}, err - } - - params := base.AcquireTokenAuthCodeParameters{ - Scopes: scopes, - Code: code, - Challenge: o.challenge, - Claims: o.claims, - AppType: accesstokens.ATPublic, - RedirectURI: redirectURI, - TenantID: o.tenantID, - } - - return pca.base.AcquireTokenByAuthCode(ctx, params) -} - -// Accounts gets all the accounts in the token cache. -// If there are no accounts in the cache the returned slice is empty. -func (pca Client) Accounts(ctx context.Context) ([]Account, error) { - return pca.base.AllAccounts(ctx) -} - -// RemoveAccount signs the account out and forgets account from token cache. -func (pca Client) RemoveAccount(ctx context.Context, account Account) error { - return pca.base.RemoveAccount(ctx, account) -} - -// interactiveAuthOptions contains the optional parameters used to acquire an access token for interactive auth code flow. -type interactiveAuthOptions struct { - claims, domainHint, loginHint, redirectURI, tenantID string - openURL func(url string) error - authnScheme AuthenticationScheme -} - -// AcquireInteractiveOption is implemented by options for AcquireTokenInteractive -type AcquireInteractiveOption interface { - acquireInteractiveOption() -} - -// WithLoginHint pre-populates the login prompt with a username. -func WithLoginHint(username string) interface { - AcquireInteractiveOption - AuthCodeURLOption - options.CallOption -} { - return struct { - AcquireInteractiveOption - AuthCodeURLOption - options.CallOption - }{ - CallOption: options.NewCallOption( - func(a any) error { - switch t := a.(type) { - case *authCodeURLOptions: - t.loginHint = username - case *interactiveAuthOptions: - t.loginHint = username - default: - return fmt.Errorf("unexpected options type %T", a) - } - return nil - }, - ), - } -} - -// WithDomainHint adds the IdP domain as domain_hint query parameter in the auth url. -func WithDomainHint(domain string) interface { - AcquireInteractiveOption - AuthCodeURLOption - options.CallOption -} { - return struct { - AcquireInteractiveOption - AuthCodeURLOption - options.CallOption - }{ - CallOption: options.NewCallOption( - func(a any) error { - switch t := a.(type) { - case *authCodeURLOptions: - t.domainHint = domain - case *interactiveAuthOptions: - t.domainHint = domain - default: - return fmt.Errorf("unexpected options type %T", a) - } - return nil - }, - ), - } -} - -// WithRedirectURI sets a port for the local server used in interactive authentication, for -// example http://localhost:port. All URI components other than the port are ignored. -func WithRedirectURI(redirectURI string) interface { - AcquireInteractiveOption - options.CallOption -} { - return struct { - AcquireInteractiveOption - options.CallOption - }{ - CallOption: options.NewCallOption( - func(a any) error { - switch t := a.(type) { - case *interactiveAuthOptions: - t.redirectURI = redirectURI - default: - return fmt.Errorf("unexpected options type %T", a) - } - return nil - }, - ), - } -} - -// WithOpenURL allows you to provide a function to open the browser to complete the interactive login, instead of launching the system default browser. -func WithOpenURL(openURL func(url string) error) interface { - AcquireInteractiveOption - options.CallOption -} { - return struct { - AcquireInteractiveOption - options.CallOption - }{ - CallOption: options.NewCallOption( - func(a any) error { - switch t := a.(type) { - case *interactiveAuthOptions: - t.openURL = openURL - default: - return fmt.Errorf("unexpected options type %T", a) - } - return nil - }, - ), - } -} - -// AcquireTokenInteractive acquires a security token from the authority using the default web browser to select the account. -// https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-authentication-flows#interactive-and-non-interactive-authentication -// -// Options: [WithDomainHint], [WithLoginHint], [WithOpenURL], [WithRedirectURI], [WithTenantID] -func (pca Client) AcquireTokenInteractive(ctx context.Context, scopes []string, opts ...AcquireInteractiveOption) (AuthResult, error) { - o := interactiveAuthOptions{} - if err := options.ApplyOptions(&o, opts); err != nil { - return AuthResult{}, err - } - // the code verifier is a random 32-byte sequence that's been base-64 encoded without padding. - // it's used to prevent MitM attacks during auth code flow, see https://tools.ietf.org/html/rfc7636 - cv, challenge, err := codeVerifier() - if err != nil { - return AuthResult{}, err - } - var redirectURL *url.URL - if o.redirectURI != "" { - redirectURL, err = url.Parse(o.redirectURI) - if err != nil { - return AuthResult{}, err - } - } - if o.openURL == nil { - o.openURL = browser.OpenURL - } - authParams, err := pca.base.AuthParams.WithTenant(o.tenantID) - if err != nil { - return AuthResult{}, err - } - authParams.Scopes = scopes - authParams.AuthorizationType = authority.ATInteractive - authParams.Claims = o.claims - authParams.CodeChallenge = challenge - authParams.CodeChallengeMethod = "S256" - authParams.LoginHint = o.loginHint - authParams.DomainHint = o.domainHint - authParams.State = uuid.New().String() - authParams.Prompt = "select_account" - if o.authnScheme != nil { - authParams.AuthnScheme = o.authnScheme - } - res, err := pca.browserLogin(ctx, redirectURL, authParams, o.openURL) - if err != nil { - return AuthResult{}, err - } - authParams.Redirecturi = res.redirectURI - - req, err := accesstokens.NewCodeChallengeRequest(authParams, accesstokens.ATPublic, nil, res.authCode, cv) - if err != nil { - return AuthResult{}, err - } - - token, err := pca.base.Token.AuthCode(ctx, req) - if err != nil { - return AuthResult{}, err - } - - return pca.base.AuthResultFromToken(ctx, authParams, token, true) -} - -type interactiveAuthResult struct { - authCode string - redirectURI string -} - -// parses the port number from the provided URL. -// returns 0 if nil or no port is specified. -func parsePort(u *url.URL) (int, error) { - if u == nil { - return 0, nil - } - p := u.Port() - if p == "" { - return 0, nil - } - return strconv.Atoi(p) -} - -// browserLogin calls openURL and waits for a user to log in -func (pca Client) browserLogin(ctx context.Context, redirectURI *url.URL, params authority.AuthParams, openURL func(string) error) (interactiveAuthResult, error) { - // start local redirect server so login can call us back - port, err := parsePort(redirectURI) - if err != nil { - return interactiveAuthResult{}, err - } - srv, err := local.New(params.State, port) - if err != nil { - return interactiveAuthResult{}, err - } - defer srv.Shutdown() - params.Scopes = accesstokens.AppendDefaultScopes(params) - authURL, err := pca.base.AuthCodeURL(ctx, params.ClientID, srv.Addr, params.Scopes, params) - if err != nil { - return interactiveAuthResult{}, err - } - // open browser window so user can select credentials - if err := openURL(authURL); err != nil { - return interactiveAuthResult{}, err - } - // now wait until the logic calls us back - res := srv.Result(ctx) - if res.Err != nil { - return interactiveAuthResult{}, res.Err - } - return interactiveAuthResult{ - authCode: res.Code, - redirectURI: srv.Addr, - }, nil -} - -// creates a code verifier string along with its SHA256 hash which -// is used as the challenge when requesting an auth code. -// used in interactive auth flow for PKCE. -func codeVerifier() (codeVerifier string, challenge string, err error) { - cvBytes := make([]byte, 32) - if _, err = rand.Read(cvBytes); err != nil { - return - } - codeVerifier = base64.RawURLEncoding.EncodeToString(cvBytes) - // for PKCE, create a hash of the code verifier - cvh := sha256.Sum256([]byte(codeVerifier)) - challenge = base64.RawURLEncoding.EncodeToString(cvh[:]) - return -} diff --git a/vendor/github.com/aws/karpenter-core/pkg/apis/apis.go b/vendor/github.com/aws/karpenter-core/pkg/apis/apis.go deleted file mode 100644 index 000eb0ef..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/apis/apis.go +++ /dev/null @@ -1,49 +0,0 @@ -/* -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. -*/ - -package apis - -import ( - _ "embed" - - "github.com/samber/lo" - v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" - "k8s.io/apimachinery/pkg/runtime" - - "github.com/aws/karpenter-core/pkg/apis/settings" - "github.com/aws/karpenter-core/pkg/apis/v1alpha5" - "github.com/aws/karpenter-core/pkg/utils/functional" -) - -var ( - // Builder includes all types within the apis package - Builder = runtime.NewSchemeBuilder( - v1alpha5.SchemeBuilder.AddToScheme, - ) - // AddToScheme may be used to add all resources defined in the project to a Scheme - AddToScheme = Builder.AddToScheme - Settings = []settings.Injectable{&settings.Settings{}} -) - -//go:generate controller-gen crd object:headerFile="../../hack/boilerplate.go.txt" paths="./..." output:crd:artifacts:config=crds -var ( - //go:embed crds/karpenter.sh_provisioners.yaml - ProvisionerCRD []byte - //go:embed crds/karpenter.sh_machines.yaml - MachineCRD []byte - CRDs = []*v1.CustomResourceDefinition{ - lo.Must(functional.Unmarshal[v1.CustomResourceDefinition](ProvisionerCRD)), - lo.Must(functional.Unmarshal[v1.CustomResourceDefinition](MachineCRD)), - } -) diff --git a/vendor/github.com/aws/karpenter-core/pkg/apis/crds/karpenter.sh_machines.yaml b/vendor/github.com/aws/karpenter-core/pkg/apis/crds/karpenter.sh_machines.yaml deleted file mode 100644 index a812fdb2..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/apis/crds/karpenter.sh_machines.yaml +++ /dev/null @@ -1,354 +0,0 @@ ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.12.0 - name: machines.karpenter.sh -spec: - group: karpenter.sh - names: - categories: - - karpenter - kind: Machine - listKind: MachineList - plural: machines - singular: machine - scope: Cluster - versions: - - additionalPrinterColumns: - - jsonPath: .metadata.labels.node\.kubernetes\.io/instance-type - name: Type - type: string - - jsonPath: .metadata.labels.topology\.kubernetes\.io/zone - name: Zone - type: string - - jsonPath: .status.nodeName - name: Node - type: string - - jsonPath: .status.conditions[?(@.type=="Ready")].status - name: Ready - type: string - - jsonPath: .metadata.creationTimestamp - name: Age - type: date - - jsonPath: .metadata.labels.karpenter\.sh/capacity-type - name: Capacity - priority: 1 - type: string - - jsonPath: .metadata.labels.karpenter\.sh/provisioner-name - name: Provisioner - priority: 1 - type: string - - jsonPath: .spec.machineTemplateRef.name - name: Template - priority: 1 - type: string - name: v1alpha5 - schema: - openAPIV3Schema: - description: Machine is the Schema for the Machines API - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: MachineSpec describes the desired state of the Machine - properties: - kubelet: - description: Kubelet are options passed to the kubelet when provisioning - nodes - properties: - clusterDNS: - description: clusterDNS is a list of IP addresses for the cluster - DNS server. Note that not all providers may use all addresses. - items: - type: string - type: array - containerRuntime: - description: ContainerRuntime is the container runtime to be used - with your worker nodes. - type: string - cpuCFSQuota: - description: CPUCFSQuota enables CPU CFS quota enforcement for - containers that specify CPU limits. - type: boolean - evictionHard: - additionalProperties: - type: string - description: EvictionHard is the map of signal names to quantities - that define hard eviction thresholds - type: object - evictionMaxPodGracePeriod: - description: EvictionMaxPodGracePeriod is the maximum allowed - grace period (in seconds) to use when terminating pods in response - to soft eviction thresholds being met. - format: int32 - type: integer - evictionSoft: - additionalProperties: - type: string - description: EvictionSoft is the map of signal names to quantities - that define soft eviction thresholds - type: object - evictionSoftGracePeriod: - additionalProperties: - type: string - description: EvictionSoftGracePeriod is the map of signal names - to quantities that define grace periods for each eviction signal - type: object - imageGCHighThresholdPercent: - description: ImageGCHighThresholdPercent is the percent of disk - usage after which image garbage collection is always run. The - percent is calculated by dividing this field value by 100, so - this field must be between 0 and 100, inclusive. When specified, - the value must be greater than ImageGCLowThresholdPercent. - format: int32 - maximum: 100 - minimum: 0 - type: integer - imageGCLowThresholdPercent: - description: ImageGCLowThresholdPercent is the percent of disk - usage before which image garbage collection is never run. Lowest - disk usage to garbage collect to. The percent is calculated - by dividing this field value by 100, so the field value must - be between 0 and 100, inclusive. When specified, the value must - be less than imageGCHighThresholdPercent - format: int32 - maximum: 100 - minimum: 0 - type: integer - kubeReserved: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: KubeReserved contains resources reserved for Kubernetes - system components. - type: object - maxPods: - description: MaxPods is an override for the maximum number of - pods that can run on a worker node instance. - format: int32 - minimum: 0 - type: integer - podsPerCore: - description: PodsPerCore is an override for the number of pods - that can run on a worker node instance based on the number of - cpu cores. This value cannot exceed MaxPods, so, if MaxPods - is a lower value, that value will be used. - format: int32 - minimum: 0 - type: integer - systemReserved: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: SystemReserved contains resources reserved for OS - system daemons and kernel memory. - type: object - type: object - machineTemplateRef: - description: MachineTemplateRef is a reference to an object that defines - provider specific configuration - properties: - apiVersion: - description: API version of the referent - type: string - kind: - description: 'Kind of the referent; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds"' - type: string - name: - description: 'Name of the referent; More info: http://kubernetes.io/docs/user-guide/identifiers#names' - type: string - required: - - name - type: object - requirements: - description: Requirements are layered with Labels and applied to every - node. - items: - description: A node selector requirement is a selector that contains - values, a key, and an operator that relates the key and values. - properties: - key: - description: The label key that the selector applies to. - type: string - operator: - description: Represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and - Lt. - type: string - values: - description: An array of string values. If the operator is In - or NotIn, the values array must be non-empty. If the operator - is Exists or DoesNotExist, the values array must be empty. - If the operator is Gt or Lt, the values array must have a - single element, which will be interpreted as an integer. This - array is replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - resources: - description: Resources models the resource requirements for the Machine - to launch - properties: - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: Requests describes the minimum required resources - for the Machine to launch - type: object - type: object - startupTaints: - description: StartupTaints are taints that are applied to nodes upon - startup which are expected to be removed automatically within a - short period of time, typically by a DaemonSet that tolerates the - taint. These are commonly used by daemonsets to allow initialization - and enforce startup ordering. StartupTaints are ignored for provisioning - purposes in that pods are not required to tolerate a StartupTaint - in order to have nodes provisioned for them. - items: - description: The node this Taint is attached to has the "effect" - on any pod that does not tolerate the Taint. - properties: - effect: - description: Required. The effect of the taint on pods that - do not tolerate the taint. Valid effects are NoSchedule, PreferNoSchedule - and NoExecute. - type: string - key: - description: Required. The taint key to be applied to a node. - type: string - timeAdded: - description: TimeAdded represents the time at which the taint - was added. It is only written for NoExecute taints. - format: date-time - type: string - value: - description: The taint value corresponding to the taint key. - type: string - required: - - effect - - key - type: object - type: array - taints: - description: Taints will be applied to the machine's node. - items: - description: The node this Taint is attached to has the "effect" - on any pod that does not tolerate the Taint. - properties: - effect: - description: Required. The effect of the taint on pods that - do not tolerate the taint. Valid effects are NoSchedule, PreferNoSchedule - and NoExecute. - type: string - key: - description: Required. The taint key to be applied to a node. - type: string - timeAdded: - description: TimeAdded represents the time at which the taint - was added. It is only written for NoExecute taints. - format: date-time - type: string - value: - description: The taint value corresponding to the taint key. - type: string - required: - - effect - - key - type: object - type: array - type: object - status: - description: MachineStatus defines the observed state of Machine - properties: - allocatable: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: Allocatable is the estimated allocatable capacity of - the machine - type: object - capacity: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: Capacity is the estimated full capacity of the machine - type: object - conditions: - description: Conditions contains signals for health and readiness - items: - description: 'Condition defines a readiness condition for a Knative - resource. See: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties' - properties: - lastTransitionTime: - description: LastTransitionTime is the last time the condition - transitioned from one status to another. We use VolatileTime - in place of metav1.Time to exclude this from creating equality.Semantic - differences (all other things held constant). - type: string - message: - description: A human readable message indicating details about - the transition. - type: string - reason: - description: The reason for the condition's last transition. - type: string - severity: - description: Severity with which to treat failures of this type - of condition. When this is not specified, it defaults to Error. - type: string - status: - description: Status of the condition, one of True, False, Unknown. - type: string - type: - description: Type of condition. - type: string - required: - - status - - type - type: object - type: array - nodeName: - description: NodeName is the name of the corresponding node object - type: string - providerID: - description: ProviderID of the corresponding node object - type: string - type: object - type: object - served: true - storage: true - subresources: - status: {} diff --git a/vendor/github.com/aws/karpenter-core/pkg/apis/crds/karpenter.sh_provisioners.yaml b/vendor/github.com/aws/karpenter-core/pkg/apis/crds/karpenter.sh_provisioners.yaml deleted file mode 100644 index 42edcffe..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/apis/crds/karpenter.sh_provisioners.yaml +++ /dev/null @@ -1,373 +0,0 @@ ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.12.0 - name: provisioners.karpenter.sh -spec: - group: karpenter.sh - names: - categories: - - karpenter - kind: Provisioner - listKind: ProvisionerList - plural: provisioners - singular: provisioner - scope: Cluster - versions: - - name: v1alpha5 - schema: - openAPIV3Schema: - description: Provisioner is the Schema for the Provisioners API - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: ProvisionerSpec is the top level provisioner specification. - Provisioners launch nodes in response to pods that are unschedulable. - A single provisioner is capable of managing a diverse set of nodes. - Node properties are determined from a combination of provisioner and - pod scheduling constraints. - properties: - annotations: - additionalProperties: - type: string - description: Annotations are applied to every node. - type: object - consolidation: - description: Consolidation are the consolidation parameters - properties: - enabled: - description: Enabled enables consolidation if it has been set - type: boolean - type: object - kubeletConfiguration: - description: KubeletConfiguration are options passed to the kubelet - when provisioning nodes - properties: - clusterDNS: - description: clusterDNS is a list of IP addresses for the cluster - DNS server. Note that not all providers may use all addresses. - items: - type: string - type: array - containerRuntime: - description: ContainerRuntime is the container runtime to be used - with your worker nodes. - type: string - cpuCFSQuota: - description: CPUCFSQuota enables CPU CFS quota enforcement for - containers that specify CPU limits. - type: boolean - evictionHard: - additionalProperties: - type: string - description: EvictionHard is the map of signal names to quantities - that define hard eviction thresholds - type: object - evictionMaxPodGracePeriod: - description: EvictionMaxPodGracePeriod is the maximum allowed - grace period (in seconds) to use when terminating pods in response - to soft eviction thresholds being met. - format: int32 - type: integer - evictionSoft: - additionalProperties: - type: string - description: EvictionSoft is the map of signal names to quantities - that define soft eviction thresholds - type: object - evictionSoftGracePeriod: - additionalProperties: - type: string - description: EvictionSoftGracePeriod is the map of signal names - to quantities that define grace periods for each eviction signal - type: object - imageGCHighThresholdPercent: - description: ImageGCHighThresholdPercent is the percent of disk - usage after which image garbage collection is always run. The - percent is calculated by dividing this field value by 100, so - this field must be between 0 and 100, inclusive. When specified, - the value must be greater than ImageGCLowThresholdPercent. - format: int32 - maximum: 100 - minimum: 0 - type: integer - imageGCLowThresholdPercent: - description: ImageGCLowThresholdPercent is the percent of disk - usage before which image garbage collection is never run. Lowest - disk usage to garbage collect to. The percent is calculated - by dividing this field value by 100, so the field value must - be between 0 and 100, inclusive. When specified, the value must - be less than imageGCHighThresholdPercent - format: int32 - maximum: 100 - minimum: 0 - type: integer - kubeReserved: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: KubeReserved contains resources reserved for Kubernetes - system components. - type: object - maxPods: - description: MaxPods is an override for the maximum number of - pods that can run on a worker node instance. - format: int32 - minimum: 0 - type: integer - podsPerCore: - description: PodsPerCore is an override for the number of pods - that can run on a worker node instance based on the number of - cpu cores. This value cannot exceed MaxPods, so, if MaxPods - is a lower value, that value will be used. - format: int32 - minimum: 0 - type: integer - systemReserved: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: SystemReserved contains resources reserved for OS - system daemons and kernel memory. - type: object - type: object - labels: - additionalProperties: - type: string - description: Labels are layered with Requirements and applied to every - node. - type: object - limits: - description: Limits define a set of bounds for provisioning capacity. - properties: - resources: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: Resources contains all the allocatable resources - that Karpenter supports for limiting. - type: object - type: object - provider: - description: Provider contains fields specific to your cloudprovider. - type: object - x-kubernetes-preserve-unknown-fields: true - providerRef: - description: ProviderRef is a reference to a dedicated CRD for the - chosen provider, that holds additional configuration options - properties: - apiVersion: - description: API version of the referent - type: string - kind: - description: 'Kind of the referent; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds"' - type: string - name: - description: 'Name of the referent; More info: http://kubernetes.io/docs/user-guide/identifiers#names' - type: string - required: - - name - type: object - requirements: - description: Requirements are layered with Labels and applied to every - node. - items: - description: A node selector requirement is a selector that contains - values, a key, and an operator that relates the key and values. - properties: - key: - description: The label key that the selector applies to. - type: string - operator: - description: Represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and - Lt. - type: string - values: - description: An array of string values. If the operator is In - or NotIn, the values array must be non-empty. If the operator - is Exists or DoesNotExist, the values array must be empty. - If the operator is Gt or Lt, the values array must have a - single element, which will be interpreted as an integer. This - array is replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - startupTaints: - description: StartupTaints are taints that are applied to nodes upon - startup which are expected to be removed automatically within a - short period of time, typically by a DaemonSet that tolerates the - taint. These are commonly used by daemonsets to allow initialization - and enforce startup ordering. StartupTaints are ignored for provisioning - purposes in that pods are not required to tolerate a StartupTaint - in order to have nodes provisioned for them. - items: - description: The node this Taint is attached to has the "effect" - on any pod that does not tolerate the Taint. - properties: - effect: - description: Required. The effect of the taint on pods that - do not tolerate the taint. Valid effects are NoSchedule, PreferNoSchedule - and NoExecute. - type: string - key: - description: Required. The taint key to be applied to a node. - type: string - timeAdded: - description: TimeAdded represents the time at which the taint - was added. It is only written for NoExecute taints. - format: date-time - type: string - value: - description: The taint value corresponding to the taint key. - type: string - required: - - effect - - key - type: object - type: array - taints: - description: Taints will be applied to every node launched by the - Provisioner. If specified, the provisioner will not provision nodes - for pods that do not have matching tolerations. Additional taints - will be created that match pod tolerations on a per-node basis. - items: - description: The node this Taint is attached to has the "effect" - on any pod that does not tolerate the Taint. - properties: - effect: - description: Required. The effect of the taint on pods that - do not tolerate the taint. Valid effects are NoSchedule, PreferNoSchedule - and NoExecute. - type: string - key: - description: Required. The taint key to be applied to a node. - type: string - timeAdded: - description: TimeAdded represents the time at which the taint - was added. It is only written for NoExecute taints. - format: date-time - type: string - value: - description: The taint value corresponding to the taint key. - type: string - required: - - effect - - key - type: object - type: array - ttlSecondsAfterEmpty: - description: "TTLSecondsAfterEmpty is the number of seconds the controller - will wait before attempting to delete a node, measured from when - the node is detected to be empty. A Node is considered to be empty - when it does not have pods scheduled to it, excluding daemonsets. - \n Termination due to no utilization is disabled if this field is - not set." - format: int64 - type: integer - ttlSecondsUntilExpired: - description: "TTLSecondsUntilExpired is the number of seconds the - controller will wait before terminating a node, measured from when - the node is created. This is useful to implement features like eventually - consistent node upgrade, memory leak protection, and disruption - testing. \n Termination due to expiration is disabled if this field - is not set." - format: int64 - type: integer - weight: - description: Weight is the priority given to the provisioner during - scheduling. A higher numerical weight indicates that this provisioner - will be ordered ahead of other provisioners with lower weights. - A provisioner with no weight will be treated as if it is a provisioner - with a weight of 0. - format: int32 - maximum: 100 - minimum: 1 - type: integer - type: object - status: - description: ProvisionerStatus defines the observed state of Provisioner - properties: - conditions: - description: Conditions is the set of conditions required for this - provisioner to scale its target, and indicates whether or not those - conditions are met. - items: - description: 'Condition defines a readiness condition for a Knative - resource. See: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties' - properties: - lastTransitionTime: - description: LastTransitionTime is the last time the condition - transitioned from one status to another. We use VolatileTime - in place of metav1.Time to exclude this from creating equality.Semantic - differences (all other things held constant). - type: string - message: - description: A human readable message indicating details about - the transition. - type: string - reason: - description: The reason for the condition's last transition. - type: string - severity: - description: Severity with which to treat failures of this type - of condition. When this is not specified, it defaults to Error. - type: string - status: - description: Status of the condition, one of True, False, Unknown. - type: string - type: - description: Type of condition. - type: string - required: - - status - - type - type: object - type: array - lastScaleTime: - description: LastScaleTime is the last time the Provisioner scaled - the number of nodes - format: date-time - type: string - resources: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: Resources is the list of resources that have been provisioned. - type: object - type: object - type: object - served: true - storage: true - subresources: - status: {} diff --git a/vendor/github.com/aws/karpenter-core/pkg/apis/settings/settings.go b/vendor/github.com/aws/karpenter-core/pkg/apis/settings/settings.go deleted file mode 100644 index 54b6260e..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/apis/settings/settings.go +++ /dev/null @@ -1,110 +0,0 @@ -/* -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. -*/ - -package settings - -import ( - "context" - "fmt" - "time" - - "go.uber.org/multierr" - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "knative.dev/pkg/configmap" -) - -type settingsKeyType struct{} - -var ContextKey = settingsKeyType{} - -var defaultSettings = &Settings{ - BatchMaxDuration: &metav1.Duration{Duration: time.Second * 10}, - BatchIdleDuration: &metav1.Duration{Duration: time.Second * 1}, - DriftEnabled: false, -} - -// +k8s:deepcopy-gen=true -type Settings struct { - BatchMaxDuration *metav1.Duration - BatchIdleDuration *metav1.Duration - // This feature flag is temporary and will be removed in the near future. - DriftEnabled bool -} - -func (*Settings) ConfigMap() string { - return "gpu-provisioner-global-settings" -} - -// Inject creates a Settings from the supplied ConfigMap -func (*Settings) Inject(ctx context.Context, cm *v1.ConfigMap) (context.Context, error) { - s := defaultSettings.DeepCopy() - - if err := configmap.Parse(cm.Data, - AsMetaDuration("batchMaxDuration", &s.BatchMaxDuration), - AsMetaDuration("batchIdleDuration", &s.BatchIdleDuration), - configmap.AsBool("featureGates.driftEnabled", &s.DriftEnabled), - ); err != nil { - return ctx, fmt.Errorf("parsing settings, %w", err) - } - if err := s.Validate(); err != nil { - return ctx, fmt.Errorf("validating settings, %w", err) - } - return ToContext(ctx, s), nil -} - -func (in *Settings) Validate() (err error) { - if in.BatchMaxDuration == nil { - err = multierr.Append(err, fmt.Errorf("batchMaxDuration is required")) - } else if in.BatchMaxDuration.Duration <= 0 { - err = multierr.Append(err, fmt.Errorf("batchMaxDuration cannot be negative")) - } - if in.BatchIdleDuration == nil { - err = multierr.Append(err, fmt.Errorf("batchIdleDuration is required")) - } else if in.BatchIdleDuration.Duration <= 0 { - err = multierr.Append(err, fmt.Errorf("batchIdleDuration cannot be negative")) - } - return err -} - -// AsMetaDuration parses the value at key as a time.Duration into the target, if it exists. -func AsMetaDuration(key string, target **metav1.Duration) configmap.ParseFunc { - return func(data map[string]string) error { - if raw, ok := data[key]; ok { - if raw == "" { - *target = nil - return nil - } - val, err := time.ParseDuration(raw) - if err != nil { - return fmt.Errorf("failed to parse %q: %w", key, err) - } - *target = &metav1.Duration{Duration: val} - } - return nil - } -} - -func ToContext(ctx context.Context, s *Settings) context.Context { - return context.WithValue(ctx, ContextKey, s) -} - -func FromContext(ctx context.Context) *Settings { - data := ctx.Value(ContextKey) - if data == nil { - // This is developer error if this happens, so we should panic - panic("settings doesn't exist in context") - } - return data.(*Settings) -} diff --git a/vendor/github.com/aws/karpenter-core/pkg/apis/settings/zz_generated.deepcopy.go b/vendor/github.com/aws/karpenter-core/pkg/apis/settings/zz_generated.deepcopy.go deleted file mode 100644 index d73c49f1..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/apis/settings/zz_generated.deepcopy.go +++ /dev/null @@ -1,49 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* -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 controller-gen. DO NOT EDIT. - -package settings - -import ( - "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Settings) DeepCopyInto(out *Settings) { - *out = *in - if in.BatchMaxDuration != nil { - in, out := &in.BatchMaxDuration, &out.BatchMaxDuration - *out = new(v1.Duration) - **out = **in - } - if in.BatchIdleDuration != nil { - in, out := &in.BatchIdleDuration, &out.BatchIdleDuration - *out = new(v1.Duration) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Settings. -func (in *Settings) DeepCopy() *Settings { - if in == nil { - return nil - } - out := new(Settings) - in.DeepCopyInto(out) - return out -} diff --git a/vendor/github.com/aws/karpenter-core/pkg/apis/v1alpha5/limits.go b/vendor/github.com/aws/karpenter-core/pkg/apis/v1alpha5/limits.go deleted file mode 100644 index 4dcee021..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/apis/v1alpha5/limits.go +++ /dev/null @@ -1,41 +0,0 @@ -/* -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. -*/ - -package v1alpha5 - -import ( - "fmt" - - v1 "k8s.io/api/core/v1" -) - -// Limits define bounds on the resources being provisioned by Karpenter -type Limits struct { - // Resources contains all the allocatable resources that Karpenter supports for limiting. - Resources v1.ResourceList `json:"resources,omitempty"` -} - -func (l *Limits) ExceededBy(resources v1.ResourceList) error { - if l == nil || l.Resources == nil { - return nil - } - for resourceName, usage := range resources { - if limit, ok := l.Resources[resourceName]; ok { - if usage.Cmp(limit) > 0 { - return fmt.Errorf("%s resource usage of %v exceeds limit of %v", resourceName, usage.AsDec(), limit.AsDec()) - } - } - } - return nil -} diff --git a/vendor/github.com/aws/karpenter-core/pkg/apis/v1alpha5/machine_status.go b/vendor/github.com/aws/karpenter-core/pkg/apis/v1alpha5/machine_status.go deleted file mode 100644 index cb699d8b..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/apis/v1alpha5/machine_status.go +++ /dev/null @@ -1,66 +0,0 @@ -/* -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. -*/ - -package v1alpha5 - -import ( - v1 "k8s.io/api/core/v1" - "knative.dev/pkg/apis" -) - -// MachineStatus defines the observed state of Machine -type MachineStatus struct { - // NodeName is the name of the corresponding node object - // +optional - NodeName string `json:"nodeName,omitempty"` - // ProviderID of the corresponding node object - // +optional - ProviderID string `json:"providerID,omitempty"` - // Capacity is the estimated full capacity of the machine - // +optional - Capacity v1.ResourceList `json:"capacity,omitempty"` - // Allocatable is the estimated allocatable capacity of the machine - // +optional - Allocatable v1.ResourceList `json:"allocatable,omitempty"` - // Conditions contains signals for health and readiness - // +optional - Conditions apis.Conditions `json:"conditions,omitempty"` -} - -func (in *Machine) StatusConditions() apis.ConditionManager { - return apis.NewLivingConditionSet(LivingConditions...).Manage(in) -} - -var LivingConditions = []apis.ConditionType{ - MachineLaunched, - MachineRegistered, - MachineInitialized, -} - -var ( - MachineLaunched apis.ConditionType = "MachineLaunched" - MachineRegistered apis.ConditionType = "MachineRegistered" - MachineInitialized apis.ConditionType = "MachineInitialized" - MachineDrifted apis.ConditionType = "MachineDrifted" - MachineEmpty apis.ConditionType = "MachineEmpty" - MachineExpired apis.ConditionType = "MachineExpired" -) - -func (in *Machine) GetConditions() apis.Conditions { - return in.Status.Conditions -} - -func (in *Machine) SetConditions(conditions apis.Conditions) { - in.Status.Conditions = conditions -} diff --git a/vendor/github.com/aws/karpenter-core/pkg/apis/v1alpha5/provisioner.go b/vendor/github.com/aws/karpenter-core/pkg/apis/v1alpha5/provisioner.go deleted file mode 100644 index 3b1e0782..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/apis/v1alpha5/provisioner.go +++ /dev/null @@ -1,136 +0,0 @@ -/* -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. -*/ - -package v1alpha5 - -import ( - "encoding/json" - "sort" - - "github.com/samber/lo" - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "knative.dev/pkg/ptr" -) - -// ProvisionerSpec is the top level provisioner specification. Provisioners -// launch nodes in response to pods that are unschedulable. A single provisioner -// is capable of managing a diverse set of nodes. Node properties are determined -// from a combination of provisioner and pod scheduling constraints. -type ProvisionerSpec struct { - // Annotations are applied to every node. - //+optional - Annotations map[string]string `json:"annotations,omitempty"` - // Labels are layered with Requirements and applied to every node. - //+optional - Labels map[string]string `json:"labels,omitempty"` - // Taints will be applied to every node launched by the Provisioner. If - // specified, the provisioner will not provision nodes for pods that do not - // have matching tolerations. Additional taints will be created that match - // pod tolerations on a per-node basis. - // +optional - Taints []v1.Taint `json:"taints,omitempty"` - // StartupTaints are taints that are applied to nodes upon startup which are expected to be removed automatically - // within a short period of time, typically by a DaemonSet that tolerates the taint. These are commonly used by - // daemonsets to allow initialization and enforce startup ordering. StartupTaints are ignored for provisioning - // purposes in that pods are not required to tolerate a StartupTaint in order to have nodes provisioned for them. - // +optional - StartupTaints []v1.Taint `json:"startupTaints,omitempty"` - // Requirements are layered with Labels and applied to every node. - Requirements []v1.NodeSelectorRequirement `json:"requirements,omitempty"` - // KubeletConfiguration are options passed to the kubelet when provisioning nodes - //+optional - KubeletConfiguration *KubeletConfiguration `json:"kubeletConfiguration,omitempty"` - // Provider contains fields specific to your cloudprovider. - // +kubebuilder:pruning:PreserveUnknownFields - Provider *Provider `json:"provider,omitempty"` - // ProviderRef is a reference to a dedicated CRD for the chosen provider, that holds - // additional configuration options - // +optional - ProviderRef *MachineTemplateRef `json:"providerRef,omitempty"` - // TTLSecondsAfterEmpty is the number of seconds the controller will wait - // before attempting to delete a node, measured from when the node is - // detected to be empty. A Node is considered to be empty when it does not - // have pods scheduled to it, excluding daemonsets. - // - // Termination due to no utilization is disabled if this field is not set. - // +optional - TTLSecondsAfterEmpty *int64 `json:"ttlSecondsAfterEmpty,omitempty"` - // TTLSecondsUntilExpired is the number of seconds the controller will wait - // before terminating a node, measured from when the node is created. This - // is useful to implement features like eventually consistent node upgrade, - // memory leak protection, and disruption testing. - // - // Termination due to expiration is disabled if this field is not set. - // +optional - TTLSecondsUntilExpired *int64 `json:"ttlSecondsUntilExpired,omitempty"` - // Limits define a set of bounds for provisioning capacity. - Limits *Limits `json:"limits,omitempty"` - // Weight is the priority given to the provisioner during scheduling. A higher - // numerical weight indicates that this provisioner will be ordered - // ahead of other provisioners with lower weights. A provisioner with no weight - // will be treated as if it is a provisioner with a weight of 0. - // +kubebuilder:validation:Minimum:=1 - // +kubebuilder:validation:Maximum:=100 - // +optional - Weight *int32 `json:"weight,omitempty"` - // Consolidation are the consolidation parameters - // +optional - Consolidation *Consolidation `json:"consolidation,omitempty"` -} - -type Consolidation struct { - // Enabled enables consolidation if it has been set - Enabled *bool `json:"enabled,omitempty"` -} - -// +kubebuilder:object:generate=false -type Provider = runtime.RawExtension - -func ProviderAnnotation(p *Provider) map[string]string { - if p == nil { - return nil - } - raw := lo.Must(json.Marshal(p)) // Provider should already have been validated so this shouldn't fail - return map[string]string{ProviderCompatabilityAnnotationKey: string(raw)} -} - -// Provisioner is the Schema for the Provisioners API -// +kubebuilder:object:root=true -// +kubebuilder:resource:path=provisioners,scope=Cluster,categories=karpenter -// +kubebuilder:subresource:status -type Provisioner struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec ProvisionerSpec `json:"spec,omitempty"` - Status ProvisionerStatus `json:"status,omitempty"` -} - -// ProvisionerList contains a list of Provisioner -// +kubebuilder:object:root=true -type ProvisionerList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []Provisioner `json:"items"` -} - -// OrderByWeight orders the provisioners in the ProvisionerList -// by their priority weight in-place -func (pl *ProvisionerList) OrderByWeight() { - sort.Slice(pl.Items, func(a, b int) bool { - return ptr.Int32Value(pl.Items[a].Spec.Weight) > ptr.Int32Value(pl.Items[b].Spec.Weight) - }) -} diff --git a/vendor/github.com/aws/karpenter-core/pkg/apis/v1alpha5/provisioner_status.go b/vendor/github.com/aws/karpenter-core/pkg/apis/v1alpha5/provisioner_status.go deleted file mode 100644 index 1f16fff5..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/apis/v1alpha5/provisioner_status.go +++ /dev/null @@ -1,51 +0,0 @@ -/* -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. -*/ - -package v1alpha5 - -import ( - v1 "k8s.io/api/core/v1" - "knative.dev/pkg/apis" -) - -// ProvisionerStatus defines the observed state of Provisioner -type ProvisionerStatus struct { - // LastScaleTime is the last time the Provisioner scaled the number - // of nodes - // +optional - // +kubebuilder:validation:Format="date-time" - LastScaleTime *apis.VolatileTime `json:"lastScaleTime,omitempty"` - - // Conditions is the set of conditions required for this provisioner to scale - // its target, and indicates whether or not those conditions are met. - // +optional - Conditions apis.Conditions `json:"conditions,omitempty"` - - // Resources is the list of resources that have been provisioned. - Resources v1.ResourceList `json:"resources,omitempty"` -} - -func (p *Provisioner) StatusConditions() apis.ConditionManager { - return apis.NewLivingConditionSet( - Active, - ).Manage(p) -} - -func (p *Provisioner) GetConditions() apis.Conditions { - return p.Status.Conditions -} - -func (p *Provisioner) SetConditions(conditions apis.Conditions) { - p.Status.Conditions = conditions -} diff --git a/vendor/github.com/aws/karpenter-core/pkg/apis/v1alpha5/provisioner_validation.go b/vendor/github.com/aws/karpenter-core/pkg/apis/v1alpha5/provisioner_validation.go deleted file mode 100644 index e1ac3a35..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/apis/v1alpha5/provisioner_validation.go +++ /dev/null @@ -1,339 +0,0 @@ -/* -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. -*/ - -package v1alpha5 - -import ( - "context" - "fmt" - "strconv" - "strings" - - "github.com/samber/lo" - "go.uber.org/multierr" - admissionregistrationv1 "k8s.io/api/admissionregistration/v1" - v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/resource" - "k8s.io/apimachinery/pkg/util/sets" - "k8s.io/apimachinery/pkg/util/validation" - "knative.dev/pkg/apis" - "knative.dev/pkg/ptr" -) - -var ( - SupportedNodeSelectorOps = sets.NewString( - string(v1.NodeSelectorOpIn), - string(v1.NodeSelectorOpNotIn), - string(v1.NodeSelectorOpGt), - string(v1.NodeSelectorOpLt), - string(v1.NodeSelectorOpExists), - string(v1.NodeSelectorOpDoesNotExist), - ) - - SupportedReservedResources = sets.NewString( - v1.ResourceCPU.String(), - v1.ResourceMemory.String(), - v1.ResourceEphemeralStorage.String(), - "pid", - ) - - SupportedEvictionSignals = sets.NewString( - "memory.available", - "nodefs.available", - "nodefs.inodesFree", - "imagefs.available", - "imagefs.inodesFree", - "pid.available", - ) -) - -const ( - providerPath = "provider" - providerRefPath = "providerRef" -) - -func (p *Provisioner) SupportedVerbs() []admissionregistrationv1.OperationType { - return []admissionregistrationv1.OperationType{ - admissionregistrationv1.Create, - admissionregistrationv1.Update, - } -} - -func (p *Provisioner) Validate(ctx context.Context) (errs *apis.FieldError) { - return errs.Also( - apis.ValidateObjectMetadata(p).ViaField("metadata"), - p.Spec.validate(ctx).ViaField("spec"), - ) -} - -func (s *ProvisionerSpec) validate(ctx context.Context) (errs *apis.FieldError) { - return errs.Also( - s.validateTTLSecondsUntilExpired(), - s.validateTTLSecondsAfterEmpty(), - s.Validate(ctx), - ) -} - -func (s *ProvisionerSpec) validateTTLSecondsUntilExpired() (errs *apis.FieldError) { - if ptr.Int64Value(s.TTLSecondsUntilExpired) < 0 { - return errs.Also(apis.ErrInvalidValue("cannot be negative", "ttlSecondsUntilExpired")) - } - return errs -} - -func (s *ProvisionerSpec) validateTTLSecondsAfterEmpty() (errs *apis.FieldError) { - if ptr.Int64Value(s.TTLSecondsAfterEmpty) < 0 { - return errs.Also(apis.ErrInvalidValue("cannot be negative", "ttlSecondsAfterEmpty")) - } - // TTLSecondsAfterEmpty and consolidation are mutually exclusive - if s.Consolidation != nil && ptr.BoolValue(s.Consolidation.Enabled) && s.TTLSecondsAfterEmpty != nil { - return errs.Also(apis.ErrMultipleOneOf("ttlSecondsAfterEmpty", "consolidation.enabled")) - } - return errs -} - -// Validate the constraints -func (s *ProvisionerSpec) Validate(_ context.Context) (errs *apis.FieldError) { - return errs.Also( - s.validateProvider(), - s.validateLabels(), - s.validateTaints(), - s.validateRequirements(), - s.validateKubeletConfiguration().ViaField("kubeletConfiguration"), - ) -} - -func (s *ProvisionerSpec) validateLabels() (errs *apis.FieldError) { - for key, value := range s.Labels { - if key == ProvisionerNameLabelKey { - errs = errs.Also(apis.ErrInvalidKeyName(key, "labels", "restricted")) - } - for _, err := range validation.IsQualifiedName(key) { - errs = errs.Also(apis.ErrInvalidKeyName(key, "labels", err)) - } - for _, err := range validation.IsValidLabelValue(value) { - errs = errs.Also(apis.ErrInvalidValue(fmt.Sprintf("%s, %s", value, err), fmt.Sprintf("labels[%s]", key))) - } - if err := IsRestrictedLabel(key); err != nil { - errs = errs.Also(apis.ErrInvalidKeyName(key, "labels", err.Error())) - } - } - return errs -} - -type taintKeyEffect struct { - Key string - Effect v1.TaintEffect -} - -func (s *ProvisionerSpec) validateTaints() (errs *apis.FieldError) { - existing := map[taintKeyEffect]struct{}{} - errs = errs.Also(s.validateTaintsField(s.Taints, existing, "taints")) - errs = errs.Also(s.validateTaintsField(s.StartupTaints, existing, "startupTaints")) - return errs -} - -func (s *ProvisionerSpec) validateTaintsField(taints []v1.Taint, existing map[taintKeyEffect]struct{}, fieldName string) *apis.FieldError { - var errs *apis.FieldError - for i, taint := range taints { - // Validate Key - if len(taint.Key) == 0 { - errs = errs.Also(apis.ErrInvalidArrayValue(errs, fieldName, i)) - } - for _, err := range validation.IsQualifiedName(taint.Key) { - errs = errs.Also(apis.ErrInvalidArrayValue(err, fieldName, i)) - } - // Validate Value - if len(taint.Value) != 0 { - for _, err := range validation.IsQualifiedName(taint.Value) { - errs = errs.Also(apis.ErrInvalidArrayValue(err, fieldName, i)) - } - } - // Validate effect - switch taint.Effect { - case v1.TaintEffectNoSchedule, v1.TaintEffectPreferNoSchedule, v1.TaintEffectNoExecute, "": - default: - errs = errs.Also(apis.ErrInvalidArrayValue(taint.Effect, "effect", i)) - } - - // Check for duplicate Key/Effect pairs - key := taintKeyEffect{Key: taint.Key, Effect: taint.Effect} - if _, ok := existing[key]; ok { - errs = errs.Also(apis.ErrGeneric(fmt.Sprintf("duplicate taint Key/Effect pair %s=%s", taint.Key, taint.Effect), apis.CurrentField). - ViaFieldIndex("taints", i)) - } - existing[key] = struct{}{} - } - return errs -} - -// This function is used by the provisioner validation webhook to verify the provisioner requirements. -// When this function is called, the provisioner's requirments do not include the requirements from labels. -// Provisioner requirements only support well known labels. -func (s *ProvisionerSpec) validateRequirements() (errs *apis.FieldError) { - for i, requirement := range s.Requirements { - if requirement.Key == ProvisionerNameLabelKey { - errs = errs.Also(apis.ErrInvalidArrayValue(fmt.Sprintf("%s is restricted", requirement.Key), "requirements", i)) - } - if err := ValidateRequirement(requirement); err != nil { - errs = errs.Also(apis.ErrInvalidArrayValue(err, "requirements", i)) - } - } - return errs -} - -// validateProvider checks if exactly one of provider and providerRef are set -func (s *ProvisionerSpec) validateProvider() *apis.FieldError { - if s.Provider != nil && s.ProviderRef != nil { - return apis.ErrMultipleOneOf(providerPath, providerRefPath) - } - if s.Provider == nil && s.ProviderRef == nil { - return apis.ErrMissingOneOf(providerPath, providerRefPath) - } - return nil -} - -func (s *ProvisionerSpec) validateKubeletConfiguration() (errs *apis.FieldError) { - if s.KubeletConfiguration == nil { - return - } - return errs.Also( - validateEvictionThresholds(s.KubeletConfiguration.EvictionHard, "evictionHard"), - validateEvictionThresholds(s.KubeletConfiguration.EvictionSoft, "evictionSoft"), - validateReservedResources(s.KubeletConfiguration.KubeReserved, "kubeReserved"), - validateReservedResources(s.KubeletConfiguration.SystemReserved, "systemReserved"), - s.KubeletConfiguration.validateImageGCHighThresholdPercent(), - s.KubeletConfiguration.validateImageGCLowThresholdPercent(), - s.KubeletConfiguration.validateEvictionSoftGracePeriod(), - s.KubeletConfiguration.validateEvictionSoftPairs(), - ) -} - -func (kc *KubeletConfiguration) validateEvictionSoftGracePeriod() (errs *apis.FieldError) { - for k := range kc.EvictionSoftGracePeriod { - if !SupportedEvictionSignals.Has(k) { - errs = errs.Also(apis.ErrInvalidKeyName(k, "evictionSoftGracePeriod")) - } - } - return errs -} - -func (kc *KubeletConfiguration) validateEvictionSoftPairs() (errs *apis.FieldError) { - evictionSoftKeys := sets.NewString(lo.Keys(kc.EvictionSoft)...) - evictionSoftGracePeriodKeys := sets.NewString(lo.Keys(kc.EvictionSoftGracePeriod)...) - - evictionSoftDiff := evictionSoftKeys.Difference(evictionSoftGracePeriodKeys) - for k := range evictionSoftDiff { - errs = errs.Also(apis.ErrInvalidKeyName(k, "evictionSoft", "Key does not have a matching evictionSoftGracePeriod")) - } - evictionSoftGracePeriodDiff := evictionSoftGracePeriodKeys.Difference(evictionSoftKeys) - for k := range evictionSoftGracePeriodDiff { - errs = errs.Also(apis.ErrInvalidKeyName(k, "evictionSoftGracePeriod", "Key does not have a matching evictionSoft threshold value")) - } - return errs -} - -func validateReservedResources(m v1.ResourceList, fieldName string) (errs *apis.FieldError) { - for k, v := range m { - if !SupportedReservedResources.Has(k.String()) { - errs = errs.Also(apis.ErrInvalidKeyName(k.String(), fieldName)) - } - if v.Value() < 0 { - errs = errs.Also(apis.ErrInvalidValue(v.String(), fmt.Sprintf(`%s["%s"]`, fieldName, k), "Value cannot be a negative resource quantity")) - } - } - return errs -} - -func validateEvictionThresholds(m map[string]string, fieldName string) (errs *apis.FieldError) { - if m == nil { - return - } - for k, v := range m { - if !SupportedEvictionSignals.Has(k) { - errs = errs.Also(apis.ErrInvalidKeyName(k, fieldName)) - } - if strings.HasSuffix(v, "%") { - p, err := strconv.ParseFloat(strings.Trim(v, "%"), 64) - if err != nil { - errs = errs.Also(apis.ErrInvalidValue(v, fmt.Sprintf(`%s["%s"]`, fieldName, k), fmt.Sprintf("Value could not be parsed as a percentage value, %v", err.Error()))) - } - if p < 0 { - errs = errs.Also(apis.ErrInvalidValue(v, fmt.Sprintf(`%s["%s"]`, fieldName, k), "Percentage values cannot be negative")) - } - if p > 100 { - errs = errs.Also(apis.ErrInvalidValue(v, fmt.Sprintf(`%s["%s"]`, fieldName, k), "Percentage values cannot be greater than 100")) - } - } else { - _, err := resource.ParseQuantity(v) - if err != nil { - errs = errs.Also(apis.ErrInvalidValue(v, fmt.Sprintf("%s[%s]", fieldName, k), fmt.Sprintf("Value could not be parsed as a resource quantity, %v", err.Error()))) - } - } - } - return errs -} - -func ValidateRequirement(requirement v1.NodeSelectorRequirement) error { //nolint:gocyclo - var errs error - if normalized, ok := NormalizedLabels[requirement.Key]; ok { - requirement.Key = normalized - } - if !SupportedNodeSelectorOps.Has(string(requirement.Operator)) { - errs = multierr.Append(errs, fmt.Errorf("key %s has an unsupported operator %s not in %s", requirement.Key, requirement.Operator, SupportedNodeSelectorOps.UnsortedList())) - } - if e := IsRestrictedLabel(requirement.Key); e != nil { - errs = multierr.Append(errs, e) - } - for _, err := range validation.IsQualifiedName(requirement.Key) { - errs = multierr.Append(errs, fmt.Errorf("key %s is not a qualified name, %s", requirement.Key, err)) - } - for _, value := range requirement.Values { - for _, err := range validation.IsValidLabelValue(value) { - errs = multierr.Append(errs, fmt.Errorf("invalid value %s for key %s, %s", value, requirement.Key, err)) - } - } - if requirement.Operator == v1.NodeSelectorOpIn && len(requirement.Values) == 0 { - errs = multierr.Append(errs, fmt.Errorf("key %s with operator %s must have a value defined", requirement.Key, requirement.Operator)) - } - if requirement.Operator == v1.NodeSelectorOpGt || requirement.Operator == v1.NodeSelectorOpLt { - if len(requirement.Values) != 1 { - errs = multierr.Append(errs, fmt.Errorf("key %s with operator %s must have a single positive integer value", requirement.Key, requirement.Operator)) - } else { - value, err := strconv.Atoi(requirement.Values[0]) - if err != nil || value < 0 { - errs = multierr.Append(errs, fmt.Errorf("key %s with operator %s must have a single positive integer value", requirement.Key, requirement.Operator)) - } - } - } - return errs -} - -// Validate validateImageGCHighThresholdPercent -func (kc *KubeletConfiguration) validateImageGCHighThresholdPercent() (errs *apis.FieldError) { - if kc.ImageGCHighThresholdPercent != nil && ptr.Int32Value(kc.ImageGCHighThresholdPercent) < ptr.Int32Value(kc.ImageGCLowThresholdPercent) { - return errs.Also(apis.ErrInvalidValue("must be greater than imageGCLowThresholdPercent", "imageGCHighThresholdPercent")) - } - - return errs -} - -// Validate imageGCLowThresholdPercent -func (kc *KubeletConfiguration) validateImageGCLowThresholdPercent() (errs *apis.FieldError) { - if kc.ImageGCHighThresholdPercent != nil && ptr.Int32Value(kc.ImageGCLowThresholdPercent) > ptr.Int32Value(kc.ImageGCHighThresholdPercent) { - return errs.Also(apis.ErrInvalidValue("must be less than imageGCHighThresholdPercent", "imageGCLowThresholdPercent")) - } - - return errs -} diff --git a/vendor/github.com/aws/karpenter-core/pkg/apis/v1alpha5/register.go b/vendor/github.com/aws/karpenter-core/pkg/apis/v1alpha5/register.go deleted file mode 100644 index d92bfa46..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/apis/v1alpha5/register.go +++ /dev/null @@ -1,50 +0,0 @@ -/* -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. -*/ - -package v1alpha5 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "knative.dev/pkg/apis" -) - -const ( - Group = "karpenter.sh" - ExtensionsGroup = "extensions." + Group - CompatabilityGroup = "compatibility." + Group - TestingGroup = "testing." + Group // Exclusively used for labeling/discovery in testing -) - -var ( - SchemeGroupVersion = schema.GroupVersion{Group: Group, Version: "v1alpha5"} - SchemeBuilder = runtime.NewSchemeBuilder(func(scheme *runtime.Scheme) error { - scheme.AddKnownTypes(SchemeGroupVersion, - &Provisioner{}, - &ProvisionerList{}, - &Machine{}, - &MachineList{}, - ) - metav1.AddToGroupVersion(scheme, SchemeGroupVersion) - return nil - }) -) - -const ( - // Active is a condition implemented by all resources. It indicates that the - // controller is able to take actions: it's correctly configured, can make - // necessary API calls, and isn't disabled. - Active apis.ConditionType = "Active" -) diff --git a/vendor/github.com/aws/karpenter-core/pkg/cloudprovider/types.go b/vendor/github.com/aws/karpenter-core/pkg/cloudprovider/types.go deleted file mode 100644 index a4b99142..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/cloudprovider/types.go +++ /dev/null @@ -1,211 +0,0 @@ -/* -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. -*/ - -package cloudprovider - -import ( - "context" - "errors" - "fmt" - "math" - "sort" - - "github.com/samber/lo" - v1 "k8s.io/api/core/v1" - - "github.com/aws/karpenter-core/pkg/apis/v1alpha5" - "github.com/aws/karpenter-core/pkg/scheduling" - "github.com/aws/karpenter-core/pkg/utils/resources" -) - -// CloudProvider interface is implemented by cloud providers to support provisioning. -type CloudProvider interface { - // Create launches a machine with the given resource requests and requirements and returns a hydrated - // machine back with resolved machine labels for the launched machine - Create(context.Context, *v1alpha5.Machine) (*v1alpha5.Machine, error) - // Delete removes a machine from the cloudprovider by its provider id - Delete(context.Context, *v1alpha5.Machine) error - // Get retrieves a machine from the cloudprovider by its provider id - Get(context.Context, string) (*v1alpha5.Machine, error) - // List retrieves all machines from the cloudprovider - List(context.Context) ([]*v1alpha5.Machine, error) - // GetInstanceTypes returns instance types supported by the cloudprovider. - // Availability of types or zone may vary by provisioner or over time. Regardless of - // availability, the GetInstanceTypes method should always return all instance types, - // even those with no offerings available. - GetInstanceTypes(context.Context, *v1alpha5.Provisioner) ([]*InstanceType, error) - // IsMachineDrifted returns whether a machine has drifted from the provisioning requirements - // it is tied to. - IsMachineDrifted(context.Context, *v1alpha5.Machine) (bool, error) - // Name returns the CloudProvider implementation name. - Name() string -} - -type InstanceTypes []*InstanceType - -func (its InstanceTypes) OrderByPrice(reqs scheduling.Requirements) InstanceTypes { - // Order instance types so that we get the cheapest instance types of the available offerings - sort.Slice(its, func(i, j int) bool { - iPrice := math.MaxFloat64 - jPrice := math.MaxFloat64 - if len(its[i].Offerings.Available().Requirements(reqs)) > 0 { - iPrice = its[i].Offerings.Available().Requirements(reqs).Cheapest().Price - } - if len(its[j].Offerings.Available().Requirements(reqs)) > 0 { - jPrice = its[j].Offerings.Available().Requirements(reqs).Cheapest().Price - } - if iPrice == jPrice { - return its[i].Name < its[j].Name - } - return iPrice < jPrice - }) - return its -} - -// InstanceType describes the properties of a potential node (either concrete attributes of an instance of this type -// or supported options in the case of arrays) -type InstanceType struct { - // Name of the instance type, must correspond to v1.LabelInstanceTypeStable - Name string - // Requirements returns a flexible set of properties that may be selected - // for scheduling. Must be defined for every well known label, even if empty. - Requirements scheduling.Requirements - // Note that though this is an array it is expected that all the Offerings are unique from one another - Offerings Offerings - // Resources are the full resource capacities for this instance type - Capacity v1.ResourceList - // Overhead is the amount of resource overhead expected to be used by kubelet and any other system daemons outside - // of Kubernetes. - Overhead *InstanceTypeOverhead -} - -func (i *InstanceType) Allocatable() v1.ResourceList { - return resources.Subtract(i.Capacity, i.Overhead.Total()) -} - -type InstanceTypeOverhead struct { - // KubeReserved returns the default resources allocated to kubernetes system daemons by default - KubeReserved v1.ResourceList - // SystemReserved returns the default resources allocated to the OS system daemons by default - SystemReserved v1.ResourceList - // EvictionThreshold returns the resources used to maintain a hard eviction threshold - EvictionThreshold v1.ResourceList -} - -func (i InstanceTypeOverhead) Total() v1.ResourceList { - return resources.Merge(i.KubeReserved, i.SystemReserved, i.EvictionThreshold) -} - -// An Offering describes where an InstanceType is available to be used, with the expectation that its properties -// may be tightly coupled (e.g. the availability of an instance type in some zone is scoped to a capacity type) -type Offering struct { - CapacityType string - Zone string - Price float64 - // Available is added so that Offerings can return all offerings that have ever existed for an instance type, - // so we can get historical pricing data for calculating savings in consolidation - Available bool -} - -type Offerings []Offering - -// Get gets the offering from an offering slice that matches the -// passed zone and capacity type -func (ofs Offerings) Get(ct, zone string) (Offering, bool) { - return lo.Find(ofs, func(of Offering) bool { - return of.CapacityType == ct && of.Zone == zone - }) -} - -// Available filters the available offerings from the returned offerings -func (ofs Offerings) Available() Offerings { - return lo.Filter(ofs, func(o Offering, _ int) bool { - return o.Available - }) -} - -// Requirements filters the offerings based on the passed requirements -func (ofs Offerings) Requirements(reqs scheduling.Requirements) Offerings { - return lo.Filter(ofs, func(offering Offering, _ int) bool { - return (!reqs.Has(v1.LabelTopologyZone) || reqs.Get(v1.LabelTopologyZone).Has(offering.Zone)) && - (!reqs.Has(v1alpha5.LabelCapacityType) || reqs.Get(v1alpha5.LabelCapacityType).Has(offering.CapacityType)) - }) -} - -// Cheapest returns the cheapest offering from the returned offerings -func (ofs Offerings) Cheapest() Offering { - return lo.MinBy(ofs, func(a, b Offering) bool { - return a.Price < b.Price - }) -} - -// MachineNotFoundError is an error type returned by CloudProviders when the reason for failure is NotFound -type MachineNotFoundError struct { - error -} - -func NewMachineNotFoundError(err error) *MachineNotFoundError { - return &MachineNotFoundError{ - error: err, - } -} - -func (e *MachineNotFoundError) Error() string { - return fmt.Sprintf("machine not found, %s", e.error) -} - -func IsMachineNotFoundError(err error) bool { - if err == nil { - return false - } - var mnfErr *MachineNotFoundError - return errors.As(err, &mnfErr) -} - -func IgnoreMachineNotFoundError(err error) error { - if IsMachineNotFoundError(err) { - return nil - } - return err -} - -// InsufficientCapacityError is an error type returned by CloudProviders when a launch fails due to a lack of capacity from machine requirements -type InsufficientCapacityError struct { - error -} - -func NewInsufficientCapacityError(err error) *InsufficientCapacityError { - return &InsufficientCapacityError{ - error: err, - } -} - -func (e *InsufficientCapacityError) Error() string { - return fmt.Sprintf("insufficient capacity, %s", e.error) -} - -func IsInsufficientCapacityError(err error) bool { - if err == nil { - return false - } - var icErr *InsufficientCapacityError - return errors.As(err, &icErr) -} - -func IgnoreInsufficientCapacityError(err error) error { - if IsInsufficientCapacityError(err) { - return nil - } - return err -} diff --git a/vendor/github.com/aws/karpenter-core/pkg/controllers/consistency/controller.go b/vendor/github.com/aws/karpenter-core/pkg/controllers/consistency/controller.go deleted file mode 100644 index 63d9bcd6..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/controllers/consistency/controller.go +++ /dev/null @@ -1,127 +0,0 @@ -/* -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. -*/ - -package consistency - -import ( - "context" - "fmt" - "reflect" - "time" - - "github.com/patrickmn/go-cache" - "github.com/prometheus/client_golang/prometheus" - v1 "k8s.io/api/core/v1" - "k8s.io/utils/clock" - "knative.dev/pkg/logging" - controllerruntime "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/controller" - "sigs.k8s.io/controller-runtime/pkg/manager" - "sigs.k8s.io/controller-runtime/pkg/reconcile" - "sigs.k8s.io/controller-runtime/pkg/source" - - "github.com/aws/karpenter-core/pkg/apis/v1alpha5" - "github.com/aws/karpenter-core/pkg/cloudprovider" - "github.com/aws/karpenter-core/pkg/events" - corecontroller "github.com/aws/karpenter-core/pkg/operator/controller" - machineutil "github.com/aws/karpenter-core/pkg/utils/machine" -) - -var _ corecontroller.TypedController[*v1alpha5.Machine] = (*Controller)(nil) - -type Controller struct { - clock clock.Clock - kubeClient client.Client - checks []Check - recorder events.Recorder - lastScanned *cache.Cache -} - -type Issue string - -type Check interface { - // Check performs the consistency check, this should return a list of slice discovered, or an empty - // slice if no issues were found - Check(context.Context, *v1.Node, *v1alpha5.Machine) ([]Issue, error) -} - -// scanPeriod is how often we inspect and report issues that are found. -const scanPeriod = 10 * time.Minute - -func NewController(clk clock.Clock, kubeClient client.Client, recorder events.Recorder, - provider cloudprovider.CloudProvider) corecontroller.Controller { - - return corecontroller.Typed[*v1alpha5.Machine](kubeClient, &Controller{ - clock: clk, - kubeClient: kubeClient, - recorder: recorder, - lastScanned: cache.New(scanPeriod, 1*time.Minute), - checks: []Check{ - NewTermination(kubeClient), - NewNodeShape(provider), - }}, - ) -} - -func (c *Controller) Name() string { - return "consistency" -} - -func (c *Controller) Reconcile(ctx context.Context, machine *v1alpha5.Machine) (reconcile.Result, error) { - if machine.Status.ProviderID == "" { - return reconcile.Result{}, nil - } - // If we get an event before we should check for consistency checks, we ignore and wait - if lastTime, ok := c.lastScanned.Get(client.ObjectKeyFromObject(machine).String()); ok { - if lastTime, ok := lastTime.(time.Time); ok { - remaining := scanPeriod - c.clock.Since(lastTime) - return reconcile.Result{RequeueAfter: remaining}, nil - } - // the above should always succeed - return reconcile.Result{RequeueAfter: scanPeriod}, nil - } - c.lastScanned.SetDefault(client.ObjectKeyFromObject(machine).String(), c.clock.Now()) - - // We assume the invariant that there is a single node for a single machine. If this invariant is violated, - // then we assume this is bubbled up through the machine lifecycle controller and don't perform consistency checks - node, err := machineutil.NodeForMachine(ctx, c.kubeClient, machine) - if err != nil { - return reconcile.Result{}, machineutil.IgnoreDuplicateNodeError(machineutil.IgnoreNodeNotFoundError(err)) - } - for _, check := range c.checks { - issues, err := check.Check(ctx, node, machine) - if err != nil { - return reconcile.Result{}, fmt.Errorf("checking node with %T, %w", check, err) - } - for _, issue := range issues { - logging.FromContext(ctx).Errorf("check failed, %s", issue) - consistencyErrors.With(prometheus.Labels{checkLabel: reflect.TypeOf(check).Elem().Name()}).Inc() - c.recorder.Publish(CheckEvent(machine, string(issue))) - } - } - return reconcile.Result{RequeueAfter: scanPeriod}, nil -} - -func (c *Controller) Builder(ctx context.Context, m manager.Manager) corecontroller.Builder { - return corecontroller.Adapt(controllerruntime. - NewControllerManagedBy(m). - For(&v1alpha5.Machine{}). - Watches( - &source.Kind{Type: &v1.Node{}}, - machineutil.NodeEventHandler(ctx, c.kubeClient), - ). - WithOptions(controller.Options{MaxConcurrentReconciles: 10}), - ) -} diff --git a/vendor/github.com/aws/karpenter-core/pkg/controllers/consistency/metrics.go b/vendor/github.com/aws/karpenter-core/pkg/controllers/consistency/metrics.go deleted file mode 100644 index 1e522744..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/controllers/consistency/metrics.go +++ /dev/null @@ -1,41 +0,0 @@ -/* -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. -*/ - -package consistency - -import ( - "github.com/prometheus/client_golang/prometheus" - crmetrics "sigs.k8s.io/controller-runtime/pkg/metrics" - - "github.com/aws/karpenter-core/pkg/metrics" -) - -func init() { - crmetrics.Registry.MustRegister(consistencyErrors) -} - -const ( - checkLabel = "check" - consistencySubsystem = "consistency" -) - -var consistencyErrors = prometheus.NewCounterVec( - prometheus.CounterOpts{ - Namespace: metrics.Namespace, - Subsystem: consistencySubsystem, - Name: "errors", - Help: "Number of consistency checks that have failed.", - }, - []string{checkLabel}, -) diff --git a/vendor/github.com/aws/karpenter-core/pkg/controllers/controllers.go b/vendor/github.com/aws/karpenter-core/pkg/controllers/controllers.go deleted file mode 100644 index 3ea2880e..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/controllers/controllers.go +++ /dev/null @@ -1,70 +0,0 @@ -/* -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. -*/ - -package controllers - -import ( - "context" - - "k8s.io/client-go/kubernetes" - "k8s.io/utils/clock" - "sigs.k8s.io/controller-runtime/pkg/client" - - "github.com/aws/karpenter-core/pkg/cloudprovider" - "github.com/aws/karpenter-core/pkg/controllers/consistency" - machinedisruption "github.com/aws/karpenter-core/pkg/controllers/machine/disruption" - machinegarbagecollection "github.com/aws/karpenter-core/pkg/controllers/machine/garbagecollection" - machinelifecycle "github.com/aws/karpenter-core/pkg/controllers/machine/lifecycle" - machinetermination "github.com/aws/karpenter-core/pkg/controllers/machine/termination" - "github.com/aws/karpenter-core/pkg/controllers/state" - "github.com/aws/karpenter-core/pkg/controllers/termination" - "github.com/aws/karpenter-core/pkg/controllers/termination/terminator" - "github.com/aws/karpenter-core/pkg/events" - "github.com/aws/karpenter-core/pkg/operator/controller" -) - -func NewControllers( - ctx context.Context, - clock clock.Clock, - kubeClient client.Client, - kubernetesInterface kubernetes.Interface, - cluster *state.Cluster, - recorder events.Recorder, - cloudProvider cloudprovider.CloudProvider, -) []controller.Controller { - - //provisioner := provisioning.NewProvisioner(kubeClient, kubernetesInterface.CoreV1(), recorder, cloudProvider, cluster) - terminator := terminator.NewTerminator(clock, kubeClient, terminator.NewEvictionQueue(ctx, kubernetesInterface.CoreV1(), recorder)) - - return []controller.Controller{ - //provisioner, - //metricsstate.NewController(cluster), - //deprovisioning.NewController(clock, kubeClient, provisioner, cloudProvider, recorder, cluster), - //provisioning.NewController(kubeClient, provisioner, recorder), - //informer.NewDaemonSetController(kubeClient, cluster), - //informer.NewNodeController(kubeClient, cluster), - //informer.NewPodController(kubeClient, cluster), - //informer.NewProvisionerController(kubeClient, cluster), - //informer.NewMachineController(kubeClient, cluster), - termination.NewController(kubeClient, cloudProvider, terminator, recorder), - //metricspod.NewController(kubeClient), - //metricsprovisioner.NewController(kubeClient), - //counter.NewController(kubeClient, cluster), - consistency.NewController(clock, kubeClient, recorder, cloudProvider), - machinelifecycle.NewController(clock, kubeClient, cloudProvider, recorder), - machinegarbagecollection.NewController(clock, kubeClient, cloudProvider), - machinetermination.NewController(kubeClient, cloudProvider), - machinedisruption.NewController(clock, kubeClient, cluster, cloudProvider), - } -} diff --git a/vendor/github.com/aws/karpenter-core/pkg/controllers/counter/controller.go b/vendor/github.com/aws/karpenter-core/pkg/controllers/counter/controller.go deleted file mode 100644 index 461c2aa0..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/controllers/counter/controller.go +++ /dev/null @@ -1,114 +0,0 @@ -/* -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. -*/ - -package counter - -import ( - "context" - "time" - - "k8s.io/apimachinery/pkg/api/equality" - "k8s.io/apimachinery/pkg/api/resource" - - "github.com/aws/karpenter-core/pkg/apis/v1alpha5" - "github.com/aws/karpenter-core/pkg/controllers/state" - corecontroller "github.com/aws/karpenter-core/pkg/operator/controller" - "github.com/aws/karpenter-core/pkg/utils/functional" - - v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/types" - controllerruntime "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/controller" - "sigs.k8s.io/controller-runtime/pkg/handler" - "sigs.k8s.io/controller-runtime/pkg/manager" - "sigs.k8s.io/controller-runtime/pkg/reconcile" - "sigs.k8s.io/controller-runtime/pkg/source" - - "github.com/aws/karpenter-core/pkg/utils/resources" -) - -var _ corecontroller.TypedController[*v1alpha5.Provisioner] = (*Controller)(nil) - -// Controller for the resource -type Controller struct { - kubeClient client.Client - cluster *state.Cluster -} - -// NewController is a constructor -func NewController(kubeClient client.Client, cluster *state.Cluster) corecontroller.Controller { - return corecontroller.Typed[*v1alpha5.Provisioner](kubeClient, &Controller{ - kubeClient: kubeClient, - cluster: cluster, - }) -} - -func (c *Controller) Name() string { - return "counter" -} - -// Reconcile a control loop for the resource -func (c *Controller) Reconcile(ctx context.Context, provisioner *v1alpha5.Provisioner) (reconcile.Result, error) { - // We need to ensure that our internal cluster state mechanism is synced before we proceed - // Otherwise, we have the potential to patch over the status with a lower value for the provisioner resource - // counts on startup - if !c.cluster.Synced(ctx) { - return reconcile.Result{RequeueAfter: time.Second}, nil - } - stored := provisioner.DeepCopy() - // Determine resource usage and update provisioner.status.resources - provisioner.Status.Resources = c.resourceCountsFor(provisioner.Name) - if !equality.Semantic.DeepEqual(stored, provisioner) { - if err := c.kubeClient.Status().Patch(ctx, provisioner, client.MergeFrom(stored)); err != nil { - return reconcile.Result{}, err - } - } - return reconcile.Result{}, nil -} - -func (c *Controller) resourceCountsFor(provisionerName string) v1.ResourceList { - var res v1.ResourceList - // Record all resources provisioned by the provisioners, we look at the cluster state nodes as their capacity - // is accurately reported even for nodes that haven't fully started yet. This allows us to update our provisioner - // status immediately upon node creation instead of waiting for the node to become ready. - c.cluster.ForEachNode(func(n *state.StateNode) bool { - // Don't count nodes that we are planning to delete. This is to ensure that we are consistent throughout - // our provisioning and deprovisioning loops - if n.MarkedForDeletion() { - return true - } - if n.Labels()[v1alpha5.ProvisionerNameLabelKey] == provisionerName { - res = resources.Merge(res, n.Capacity()) - } - return true - }) - return functional.FilterMap(res, func(_ v1.ResourceName, v resource.Quantity) bool { return !v.IsZero() }) -} - -func (c *Controller) Builder(_ context.Context, m manager.Manager) corecontroller.Builder { - return corecontroller.Adapt(controllerruntime. - NewControllerManagedBy(m). - For(&v1alpha5.Provisioner{}). - Watches( - &source.Kind{Type: &v1.Node{}}, - handler.EnqueueRequestsFromMapFunc(func(o client.Object) []reconcile.Request { - if name, ok := o.GetLabels()[v1alpha5.ProvisionerNameLabelKey]; ok { - return []reconcile.Request{{NamespacedName: types.NamespacedName{Name: name}}} - } - return nil - }), - ). - WithOptions(controller.Options{MaxConcurrentReconciles: 10})) -} diff --git a/vendor/github.com/aws/karpenter-core/pkg/controllers/deprovisioning/consolidation.go b/vendor/github.com/aws/karpenter-core/pkg/controllers/deprovisioning/consolidation.go deleted file mode 100644 index 8187b81e..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/controllers/deprovisioning/consolidation.go +++ /dev/null @@ -1,200 +0,0 @@ -/* -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. -*/ - -package deprovisioning - -import ( - "context" - "errors" - "fmt" - "sort" - "time" - - v1 "k8s.io/api/core/v1" - "k8s.io/utils/clock" - "knative.dev/pkg/ptr" - "sigs.k8s.io/controller-runtime/pkg/client" - - "github.com/aws/karpenter-core/pkg/apis/v1alpha5" - "github.com/aws/karpenter-core/pkg/cloudprovider" - deprovisioningevents "github.com/aws/karpenter-core/pkg/controllers/deprovisioning/events" - "github.com/aws/karpenter-core/pkg/controllers/provisioning" - "github.com/aws/karpenter-core/pkg/controllers/state" - "github.com/aws/karpenter-core/pkg/events" - "github.com/aws/karpenter-core/pkg/metrics" - "github.com/aws/karpenter-core/pkg/scheduling" -) - -// consolidation is the base consolidation controller that provides common functionality used across the different -// consolidation methods. -type consolidation struct { - clock clock.Clock - cluster *state.Cluster - kubeClient client.Client - provisioner *provisioning.Provisioner - cloudProvider cloudprovider.CloudProvider - recorder events.Recorder - lastConsolidationState int64 -} - -func makeConsolidation(clock clock.Clock, cluster *state.Cluster, kubeClient client.Client, provisioner *provisioning.Provisioner, - cloudProvider cloudprovider.CloudProvider, recorder events.Recorder) consolidation { - return consolidation{ - clock: clock, - cluster: cluster, - kubeClient: kubeClient, - provisioner: provisioner, - cloudProvider: cloudProvider, - recorder: recorder, - lastConsolidationState: 0, - } -} - -// consolidationTTL is the TTL between creating a consolidation command and validating that it still works. -const consolidationTTL = 15 * time.Second - -// string is the string representation of the deprovisioner -func (c *consolidation) String() string { - return metrics.ConsolidationReason -} - -// sortAndFilterCandidates orders deprovisionable nodes by the disruptionCost, removing any that we already know won't -// be viable consolidation options. -func (c *consolidation) sortAndFilterCandidates(ctx context.Context, nodes []*Candidate) ([]*Candidate, error) { - candidates, err := filterCandidates(ctx, c.kubeClient, c.recorder, nodes) - if err != nil { - return nil, fmt.Errorf("filtering candidates, %w", err) - } - - sort.Slice(candidates, func(i int, j int) bool { - return candidates[i].disruptionCost < candidates[j].disruptionCost - }) - return candidates, nil -} - -// ShouldDeprovision is a predicate used to filter deprovisionable nodes -func (c *consolidation) ShouldDeprovision(_ context.Context, cn *Candidate) bool { - if val, ok := cn.Annotations()[v1alpha5.DoNotConsolidateNodeAnnotationKey]; ok { - c.recorder.Publish(deprovisioningevents.Unconsolidatable(cn.Node, cn.Machine, fmt.Sprintf("%s annotation exists", v1alpha5.DoNotConsolidateNodeAnnotationKey))...) - return val != "true" - } - if cn.provisioner == nil { - c.recorder.Publish(deprovisioningevents.Unconsolidatable(cn.Node, cn.Machine, "provisioner is unknown")...) - return false - } - if cn.provisioner.Spec.Consolidation == nil || !ptr.BoolValue(cn.provisioner.Spec.Consolidation.Enabled) { - c.recorder.Publish(deprovisioningevents.Unconsolidatable(cn.Node, cn.Machine, fmt.Sprintf("provisioner %s has consolidation disabled", cn.provisioner.Name))...) - return false - } - return true -} - -// computeConsolidation computes a consolidation action to take -// -// nolint:gocyclo -func (c *consolidation) computeConsolidation(ctx context.Context, candidates ...*Candidate) (Command, error) { - // Run scheduling simulation to compute consolidation option - results, err := simulateScheduling(ctx, c.kubeClient, c.cluster, c.provisioner, candidates...) - if err != nil { - // if a candidate node is now deleting, just retry - if errors.Is(err, errCandidateDeleting) { - return Command{}, nil - } - return Command{}, err - } - - // if not all of the pods were scheduled, we can't do anything - if !results.AllPodsScheduled() { - // This method is used by multi-node consolidation as well, so we'll only report in the single node case - if len(candidates) == 1 { - c.recorder.Publish(deprovisioningevents.Unconsolidatable(candidates[0].Node, candidates[0].Machine, results.PodSchedulingErrors())...) - } - return Command{}, nil - } - - // were we able to schedule all the pods on the inflight candidates? - if len(results.NewMachines) == 0 { - return Command{ - candidates: candidates, - }, nil - } - - // we're not going to turn a single node into multiple candidates - if len(results.NewMachines) != 1 { - if len(candidates) == 1 { - c.recorder.Publish(deprovisioningevents.Unconsolidatable(candidates[0].Node, candidates[0].Machine, fmt.Sprintf("can't remove without creating %d candidates", len(results.NewMachines)))...) - } - return Command{}, nil - } - - // get the current node price based on the offering - // fallback if we can't find the specific zonal pricing data - nodesPrice, err := getCandidatePrices(candidates) - if err != nil { - return Command{}, fmt.Errorf("getting offering price from candidate node, %w", err) - } - results.NewMachines[0].InstanceTypeOptions = filterByPrice(results.NewMachines[0].InstanceTypeOptions, results.NewMachines[0].Requirements, nodesPrice) - if len(results.NewMachines[0].InstanceTypeOptions) == 0 { - if len(candidates) == 1 { - c.recorder.Publish(deprovisioningevents.Unconsolidatable(candidates[0].Node, candidates[0].Machine, "can't replace with a cheaper node")...) - } - // no instance types remain after filtering by price - return Command{}, nil - } - - // If the existing candidates are all spot and the replacement is spot, we don't consolidate. We don't have a reliable - // mechanism to determine if this replacement makes sense given instance type availability (e.g. we may replace - // a spot node with one that is less available and more likely to be reclaimed). - allExistingAreSpot := true - for _, cn := range candidates { - if cn.capacityType != v1alpha5.CapacityTypeSpot { - allExistingAreSpot = false - } - } - - if allExistingAreSpot && - results.NewMachines[0].Requirements.Get(v1alpha5.LabelCapacityType).Has(v1alpha5.CapacityTypeSpot) { - if len(candidates) == 1 { - c.recorder.Publish(deprovisioningevents.Unconsolidatable(candidates[0].Node, candidates[0].Machine, "can't replace a spot node with a spot node")...) - } - return Command{}, nil - } - - // We are consolidating a node from OD -> [OD,Spot] but have filtered the instance types by cost based on the - // assumption, that the spot variant will launch. We also need to add a requirement to the node to ensure that if - // spot capacity is insufficient we don't replace the node with a more expensive on-demand node. Instead the launch - // should fail and we'll just leave the node alone. - ctReq := results.NewMachines[0].Requirements.Get(v1alpha5.LabelCapacityType) - if ctReq.Has(v1alpha5.CapacityTypeSpot) && ctReq.Has(v1alpha5.CapacityTypeOnDemand) { - results.NewMachines[0].Requirements.Add(scheduling.NewRequirement(v1alpha5.LabelCapacityType, v1.NodeSelectorOpIn, v1alpha5.CapacityTypeSpot)) - } - - return Command{ - candidates: candidates, - replacements: results.NewMachines, - }, nil -} - -// getCandidatePrices returns the sum of the prices of the given candidate nodes -func getCandidatePrices(candidates []*Candidate) (float64, error) { - var price float64 - for _, c := range candidates { - offering, ok := c.instanceType.Offerings.Get(c.capacityType, c.zone) - if !ok { - return 0.0, fmt.Errorf("unable to determine offering for %s/%s/%s", c.instanceType.Name, c.capacityType, c.zone) - } - price += offering.Price - } - return price, nil -} diff --git a/vendor/github.com/aws/karpenter-core/pkg/controllers/deprovisioning/controller.go b/vendor/github.com/aws/karpenter-core/pkg/controllers/deprovisioning/controller.go deleted file mode 100644 index 4781cee5..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/controllers/deprovisioning/controller.go +++ /dev/null @@ -1,347 +0,0 @@ -/* -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. -*/ - -package deprovisioning - -import ( - "context" - "fmt" - "sync" - "time" - - "github.com/avast/retry-go" - "github.com/prometheus/client_golang/prometheus" - "github.com/samber/lo" - "go.uber.org/multierr" - v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/types" - "k8s.io/client-go/util/workqueue" - "k8s.io/utils/clock" - "knative.dev/pkg/logging" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/manager" - "sigs.k8s.io/controller-runtime/pkg/reconcile" - - "github.com/aws/karpenter-core/pkg/apis/v1alpha5" - "github.com/aws/karpenter-core/pkg/cloudprovider" - deprovisioningevents "github.com/aws/karpenter-core/pkg/controllers/deprovisioning/events" - "github.com/aws/karpenter-core/pkg/controllers/provisioning" - "github.com/aws/karpenter-core/pkg/controllers/state" - "github.com/aws/karpenter-core/pkg/events" - "github.com/aws/karpenter-core/pkg/metrics" - "github.com/aws/karpenter-core/pkg/operator/controller" -) - -// Controller is the deprovisioning controller. -type Controller struct { - kubeClient client.Client - cluster *state.Cluster - provisioner *provisioning.Provisioner - recorder events.Recorder - clock clock.Clock - cloudProvider cloudprovider.CloudProvider - deprovisioners []Deprovisioner - mu sync.Mutex - lastRun map[string]time.Time -} - -// pollingPeriod that we inspect cluster to look for opportunities to deprovision -const pollingPeriod = 10 * time.Second -const immediately = time.Millisecond - -var errCandidateDeleting = fmt.Errorf("candidate is deleting") - -// waitRetryOptions are the retry options used when waiting on a machine to become ready or to be deleted -// readiness can take some time as the node needs to come up, have any daemonset extended resoruce plugins register, etc. -// deletion can take some time in the case of restrictive PDBs that throttle the rate at which the node is drained -var waitRetryOptions = []retry.Option{ - retry.Delay(2 * time.Second), - retry.LastErrorOnly(true), - retry.Attempts(60), - retry.MaxDelay(10 * time.Second), // 22 + (60-5)*10 =~ 9.5 minutes in total -} - -func NewController(clk clock.Clock, kubeClient client.Client, provisioner *provisioning.Provisioner, - cp cloudprovider.CloudProvider, recorder events.Recorder, cluster *state.Cluster) *Controller { - - return &Controller{ - clock: clk, - kubeClient: kubeClient, - cluster: cluster, - provisioner: provisioner, - recorder: recorder, - cloudProvider: cp, - lastRun: map[string]time.Time{}, - deprovisioners: []Deprovisioner{ - // Expire any machines that must be deleted, allowing their pods to potentially land on currently - NewExpiration(clk, kubeClient, cluster, provisioner, recorder), - // Terminate any machines that have drifted from provisioning specifications, allowing the pods to reschedule. - NewDrift(kubeClient, cluster, provisioner, recorder), - // Delete any remaining empty machines as there is zero cost in terms of disruption. Emptiness and - // emptyNodeConsolidation are mutually exclusive, only one of these will operate - NewEmptiness(clk), - NewEmptyMachineConsolidation(clk, cluster, kubeClient, provisioner, cp, recorder), - // Attempt to identify multiple machines that we can consolidate simultaneously to reduce pod churn - NewMultiMachineConsolidation(clk, cluster, kubeClient, provisioner, cp, recorder), - // And finally fall back our single machines consolidation to further reduce cluster cost. - NewSingleMachineConsolidation(clk, cluster, kubeClient, provisioner, cp, recorder), - }, - } -} - -func (c *Controller) Name() string { - return "deprovisioning" -} - -func (c *Controller) Builder(_ context.Context, m manager.Manager) controller.Builder { - return controller.NewSingletonManagedBy(m) -} - -func (c *Controller) Reconcile(ctx context.Context, _ reconcile.Request) (reconcile.Result, error) { - // this won't catch if the reconcile loop hangs forever, but it will catch other issues - c.logAbnormalRuns(ctx) - defer c.logAbnormalRuns(ctx) - c.recordRun("deprovisioning-loop") - - // We need to ensure that our internal cluster state mechanism is synced before we proceed - // with making any scheduling decision off of our state nodes. Otherwise, we have the potential to make - // a scheduling decision based on a smaller subset of nodes in our cluster state than actually exist. - if !c.cluster.Synced(ctx) { - logging.FromContext(ctx).Debugf("waiting on cluster sync") - return reconcile.Result{RequeueAfter: time.Second}, nil - } - // Attempt different deprovisioning methods. We'll only let one method perform an action - isConsolidated := c.cluster.Consolidated() - for _, d := range c.deprovisioners { - c.recordRun(fmt.Sprintf("%T", d)) - success, err := c.deprovision(ctx, d) - if err != nil { - return reconcile.Result{}, fmt.Errorf("deprovisioning via %q, %w", d, err) - } - if success { - return reconcile.Result{RequeueAfter: immediately}, nil - } - } - - if !isConsolidated { - // Mark cluster as consolidated, only if the deprovisioners ran and were not able to perform any work. - c.cluster.SetConsolidated(true) - } - // All deprovisioners did nothing, so return nothing to do - return reconcile.Result{RequeueAfter: pollingPeriod}, nil -} - -func (c *Controller) deprovision(ctx context.Context, deprovisioner Deprovisioner) (bool, error) { - defer metrics.Measure(deprovisioningDurationHistogram.WithLabelValues(deprovisioner.String()))() - candidates, err := GetCandidates(ctx, c.cluster, c.kubeClient, c.recorder, c.clock, c.cloudProvider, deprovisioner.ShouldDeprovision) - if err != nil { - return false, fmt.Errorf("determining candidates, %w", err) - } - // If there are no candidate nodes, move to the next deprovisioner - if len(candidates) == 0 { - return false, nil - } - - // Determine the deprovisioning action - cmd, err := deprovisioner.ComputeCommand(ctx, candidates...) - if err != nil { - return false, fmt.Errorf("computing deprovisioning decision, %w", err) - } - if cmd.Action() == NoOpAction { - return false, nil - } - - // Attempt to deprovision - if err := c.executeCommand(ctx, deprovisioner, cmd); err != nil { - return false, fmt.Errorf("deprovisioning candidates, %w", err) - } - - return true, nil -} - -func (c *Controller) executeCommand(ctx context.Context, d Deprovisioner, command Command) error { - deprovisioningActionsPerformedCounter.With(map[string]string{ - // TODO: make this just command.Action() since we've added the deprovisioner as its own label. - actionLabel: fmt.Sprintf("%s/%s", d, command.Action()), - deprovisionerLabel: d.String(), - }).Inc() - logging.FromContext(ctx).Infof("deprovisioning via %s %s", d, command) - - reason := fmt.Sprintf("%s/%s", d, command.Action()) - if command.Action() == ReplaceAction { - if err := c.launchReplacementMachines(ctx, command, reason); err != nil { - // If we failed to launch the replacement, don't deprovision. If this is some permanent failure, - // we don't want to disrupt workloads with no way to provision new nodes for them. - return fmt.Errorf("launching replacement machine, %w", err) - } - } - - for _, candidate := range command.candidates { - c.recorder.Publish(deprovisioningevents.Terminating(candidate.Node, candidate.Machine, command.String())...) - - if err := c.kubeClient.Delete(ctx, candidate.Machine); err != nil { - if errors.IsNotFound(err) { - continue - } - logging.FromContext(ctx).Errorf("terminating machine, %s", err) - } else { - metrics.MachinesTerminatedCounter.With(prometheus.Labels{ - metrics.ReasonLabel: reason, - metrics.ProvisionerLabel: candidate.provisioner.Name, - }).Inc() - } - } - - // We wait for nodes to delete to ensure we don't start another round of deprovisioning until this node is fully - // deleted. - for _, oldCandidate := range command.candidates { - c.waitForDeletion(ctx, oldCandidate.Machine) - } - return nil -} - -// launchReplacementMachines launches replacement machines and blocks until it is ready -// nolint:gocyclo -func (c *Controller) launchReplacementMachines(ctx context.Context, action Command, reason string) error { - defer metrics.Measure(deprovisioningReplacementNodeInitializedHistogram)() - candidateNodeNames := lo.Map(action.candidates, func(c *Candidate, _ int) string { return c.Node.Name }) - - // cordon the old nodes before we launch the replacements to prevent new pods from scheduling to the old nodes - if err := c.setNodesUnschedulable(ctx, true, candidateNodeNames...); err != nil { - return fmt.Errorf("cordoning nodes, %w", err) - } - - machineNames, err := c.provisioner.LaunchMachines(ctx, action.replacements, provisioning.WithReason(reason)) - if err != nil { - // uncordon the nodes as the launch may fail (e.g. ICE) - err = multierr.Append(err, c.setNodesUnschedulable(ctx, false, candidateNodeNames...)) - return err - } - if len(machineNames) != len(action.replacements) { - // shouldn't ever occur since a partially failed LaunchMachines should return an error - return fmt.Errorf("expected %d machines, got %d", len(action.replacements), len(machineNames)) - } - - // We have the new machines created at the API server so mark the old machines for deletion - c.cluster.MarkForDeletion(candidateNodeNames...) - - errs := make([]error, len(machineNames)) - workqueue.ParallelizeUntil(ctx, len(machineNames), len(machineNames), func(i int) { - // machine never became ready or the machines that we tried to launch got Insufficient Capacity or some - // other transient error - errs[i] = c.waitForReadiness(ctx, action, machineNames[i]) - }) - if err = multierr.Combine(errs...); err != nil { - c.cluster.UnmarkForDeletion(candidateNodeNames...) - return multierr.Combine(c.setNodesUnschedulable(ctx, false, candidateNodeNames...), - fmt.Errorf("timed out checking machine readiness, %w", err)) - } - return nil -} - -// TODO @njtran: Allow to bypass this check for certain deprovisioners -func (c *Controller) waitForReadiness(ctx context.Context, action Command, name string) error { - // Wait for the machine to be initialized - var once sync.Once - pollStart := time.Now() - return retry.Do(func() error { - machine := &v1alpha5.Machine{} - if err := c.kubeClient.Get(ctx, types.NamespacedName{Name: name}, machine); err != nil { - // If the machine was deleted after a few seconds (to give the cache time to update), then we assume - // that the machine was deleted due to an Insufficient Capacity error - if errors.IsNotFound(err) && c.clock.Since(pollStart) > time.Second*5 { - return retry.Unrecoverable(fmt.Errorf("getting machine, %w", err)) - } - return fmt.Errorf("getting machine, %w", err) - } - once.Do(func() { - c.recorder.Publish(deprovisioningevents.Launching(machine, action.String())) - }) - if !machine.StatusConditions().GetCondition(v1alpha5.MachineInitialized).IsTrue() { - // make the user aware of why deprovisioning is paused - c.recorder.Publish(deprovisioningevents.WaitingOnReadiness(machine)) - return fmt.Errorf("machine is not initialized") - } - return nil - }, waitRetryOptions...) -} - -// waitForDeletion waits for the specified machine to be removed from the API server. This deletion can take some period -// of time if there are PDBs that govern pods on the machine as we need to wait until the node drains before -// it's actually deleted. -func (c *Controller) waitForDeletion(ctx context.Context, machine *v1alpha5.Machine) { - if err := retry.Do(func() error { - m := &v1alpha5.Machine{} - nerr := c.kubeClient.Get(ctx, client.ObjectKeyFromObject(machine), m) - // We expect the not machine found error, at which point we know the machine is deleted. - if errors.IsNotFound(nerr) { - return nil - } - // make the user aware of why deprovisioning is paused - c.recorder.Publish(deprovisioningevents.WaitingOnDeletion(machine)) - if nerr != nil { - return fmt.Errorf("expected machine to be not found, %w", nerr) - } - // the machine still exists - return fmt.Errorf("expected machine to be not found") - }, waitRetryOptions..., - ); err != nil { - logging.FromContext(ctx).Errorf("Waiting on machine deletion, %s", err) - } -} - -func (c *Controller) setNodesUnschedulable(ctx context.Context, isUnschedulable bool, names ...string) error { - var multiErr error - for _, name := range names { - node := &v1.Node{} - if err := c.kubeClient.Get(ctx, client.ObjectKey{Name: name}, node); err != nil { - multiErr = multierr.Append(multiErr, fmt.Errorf("getting node, %w", err)) - } - - // node is being deleted already, so no need to un-cordon - if !isUnschedulable && !node.DeletionTimestamp.IsZero() { - continue - } - - // already matches the state we want to be in - if node.Spec.Unschedulable == isUnschedulable { - continue - } - - stored := node.DeepCopy() - node.Spec.Unschedulable = isUnschedulable - if err := c.kubeClient.Patch(ctx, node, client.MergeFrom(stored)); err != nil { - multiErr = multierr.Append(multiErr, fmt.Errorf("patching node %s, %w", node.Name, err)) - } - } - return multiErr -} - -func (c *Controller) recordRun(s string) { - c.mu.Lock() - defer c.mu.Unlock() - c.lastRun[s] = c.clock.Now() -} - -func (c *Controller) logAbnormalRuns(ctx context.Context) { - const AbnormalTimeLimit = 15 * time.Minute - c.mu.Lock() - defer c.mu.Unlock() - for name, runTime := range c.lastRun { - if timeSince := c.clock.Since(runTime); timeSince > AbnormalTimeLimit { - logging.FromContext(ctx).Debugf("abnormal time between runs of %s = %s", name, timeSince) - } - } -} diff --git a/vendor/github.com/aws/karpenter-core/pkg/controllers/deprovisioning/drift.go b/vendor/github.com/aws/karpenter-core/pkg/controllers/deprovisioning/drift.go deleted file mode 100644 index a29c7b0f..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/controllers/deprovisioning/drift.go +++ /dev/null @@ -1,106 +0,0 @@ -/* -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. -*/ - -package deprovisioning - -import ( - "context" - "errors" - "fmt" - - "knative.dev/pkg/logging" - "sigs.k8s.io/controller-runtime/pkg/client" - - "github.com/samber/lo" - - "github.com/aws/karpenter-core/pkg/apis/settings" - "github.com/aws/karpenter-core/pkg/apis/v1alpha5" - "github.com/aws/karpenter-core/pkg/controllers/provisioning" - "github.com/aws/karpenter-core/pkg/controllers/state" - "github.com/aws/karpenter-core/pkg/events" - "github.com/aws/karpenter-core/pkg/metrics" -) - -// Drift is a subreconciler that deletes drifted machines. -type Drift struct { - kubeClient client.Client - cluster *state.Cluster - provisioner *provisioning.Provisioner - recorder events.Recorder -} - -func NewDrift(kubeClient client.Client, cluster *state.Cluster, provisioner *provisioning.Provisioner, recorder events.Recorder) *Drift { - return &Drift{ - kubeClient: kubeClient, - cluster: cluster, - provisioner: provisioner, - recorder: recorder, - } -} - -// ShouldDeprovision is a predicate used to filter deprovisionable machines -func (d *Drift) ShouldDeprovision(ctx context.Context, c *Candidate) bool { - return settings.FromContext(ctx).DriftEnabled && - c.Machine.StatusConditions().GetCondition(v1alpha5.MachineDrifted) != nil && - c.Machine.StatusConditions().GetCondition(v1alpha5.MachineDrifted).IsTrue() -} - -// ComputeCommand generates a deprovisioning command given deprovisionable machines -func (d *Drift) ComputeCommand(ctx context.Context, nodes ...*Candidate) (Command, error) { - candidates, err := filterCandidates(ctx, d.kubeClient, d.recorder, nodes) - if err != nil { - return Command{}, fmt.Errorf("filtering candidates, %w", err) - } - deprovisioningEligibleMachinesGauge.WithLabelValues(d.String()).Set(float64(len(candidates))) - - // Deprovision all empty drifted nodes, as they require no scheduling simulations. - if empty := lo.Filter(candidates, func(c *Candidate, _ int) bool { - return len(c.pods) == 0 - }); len(empty) > 0 { - return Command{ - candidates: empty, - }, nil - } - - for _, candidate := range candidates { - // Check if we need to create any machines. - results, err := simulateScheduling(ctx, d.kubeClient, d.cluster, d.provisioner, candidate) - if err != nil { - // if a candidate machine is now deleting, just retry - if errors.Is(err, errCandidateDeleting) { - continue - } - return Command{}, err - } - // Log when all pods can't schedule, as the command will get executed immediately. - if !results.AllPodsScheduled() { - logging.FromContext(ctx).With("machine", candidate.Machine.Name, "node", candidate.Node.Name).Debug("Continuing to terminate drifted machine after scheduling simulation failed to schedule all pods %s", results.PodSchedulingErrors()) - } - if len(results.NewMachines) == 0 { - return Command{ - candidates: []*Candidate{candidate}, - }, nil - } - return Command{ - candidates: []*Candidate{candidate}, - replacements: results.NewMachines, - }, nil - } - return Command{}, nil -} - -// String is the string representation of the deprovisioner -func (d *Drift) String() string { - return metrics.DriftReason -} diff --git a/vendor/github.com/aws/karpenter-core/pkg/controllers/deprovisioning/emptiness.go b/vendor/github.com/aws/karpenter-core/pkg/controllers/deprovisioning/emptiness.go deleted file mode 100644 index 5dac048f..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/controllers/deprovisioning/emptiness.go +++ /dev/null @@ -1,60 +0,0 @@ -/* -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. -*/ - -package deprovisioning - -import ( - "context" - - "github.com/samber/lo" - "k8s.io/utils/clock" - - "github.com/aws/karpenter-core/pkg/metrics" - machineutil "github.com/aws/karpenter-core/pkg/utils/machine" -) - -// Emptiness is a subreconciler that deletes empty machines. -// Emptiness will respect TTLSecondsAfterEmpty -type Emptiness struct { - clock clock.Clock -} - -func NewEmptiness(clk clock.Clock) *Emptiness { - return &Emptiness{ - clock: clk, - } -} - -// ShouldDeprovision is a predicate used to filter deprovisionable machines -func (e *Emptiness) ShouldDeprovision(_ context.Context, c *Candidate) bool { - return c.provisioner.Spec.TTLSecondsAfterEmpty != nil && - machineutil.IsPastEmptinessTTL(c.Machine, e.clock, c.provisioner) -} - -// ComputeCommand generates a deprovisioning command given deprovisionable machines -func (e *Emptiness) ComputeCommand(_ context.Context, candidates ...*Candidate) (Command, error) { - emptyCandidates := lo.Filter(candidates, func(cn *Candidate, _ int) bool { - return cn.Machine.DeletionTimestamp.IsZero() && len(cn.pods) == 0 - }) - deprovisioningEligibleMachinesGauge.WithLabelValues(e.String()).Set(float64(len(candidates))) - - return Command{ - candidates: emptyCandidates, - }, nil -} - -// string is the string representation of the deprovisioner -func (e *Emptiness) String() string { - return metrics.EmptinessReason -} diff --git a/vendor/github.com/aws/karpenter-core/pkg/controllers/deprovisioning/emptymachineconsolidation.go b/vendor/github.com/aws/karpenter-core/pkg/controllers/deprovisioning/emptymachineconsolidation.go deleted file mode 100644 index 5356ce83..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/controllers/deprovisioning/emptymachineconsolidation.go +++ /dev/null @@ -1,87 +0,0 @@ -/* -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. -*/ - -package deprovisioning - -import ( - "context" - "errors" - "fmt" - - "github.com/samber/lo" - "k8s.io/utils/clock" - "knative.dev/pkg/logging" - "sigs.k8s.io/controller-runtime/pkg/client" - - "github.com/aws/karpenter-core/pkg/cloudprovider" - "github.com/aws/karpenter-core/pkg/controllers/provisioning" - "github.com/aws/karpenter-core/pkg/controllers/state" - "github.com/aws/karpenter-core/pkg/events" -) - -// EmptyMachineConsolidation is the consolidation controller that performs multi-machine consolidation of entirely empty machines -type EmptyMachineConsolidation struct { - consolidation -} - -func NewEmptyMachineConsolidation(clk clock.Clock, cluster *state.Cluster, kubeClient client.Client, - provisioner *provisioning.Provisioner, cp cloudprovider.CloudProvider, recorder events.Recorder) *EmptyMachineConsolidation { - return &EmptyMachineConsolidation{consolidation: makeConsolidation(clk, cluster, kubeClient, provisioner, cp, recorder)} -} - -// ComputeCommand generates a deprovisioning command given deprovisionable machines -func (c *EmptyMachineConsolidation) ComputeCommand(ctx context.Context, candidates ...*Candidate) (Command, error) { - if c.cluster.Consolidated() { - return Command{}, nil - } - candidates, err := c.sortAndFilterCandidates(ctx, candidates) - if err != nil { - return Command{}, fmt.Errorf("sorting candidates, %w", err) - } - deprovisioningEligibleMachinesGauge.WithLabelValues(c.String()).Set(float64(len(candidates))) - - // select the entirely empty nodes - emptyCandidates := lo.Filter(candidates, func(n *Candidate, _ int) bool { return len(n.pods) == 0 }) - if len(emptyCandidates) == 0 { - return Command{}, nil - } - - cmd := Command{ - candidates: emptyCandidates, - } - - // empty machine consolidation doesn't use Validation as we get to take advantage of cluster.IsNodeNominated. This - // lets us avoid a scheduling simulation (which is performed periodically while pending pods exist and drives - // cluster.IsNodeNominated already). - select { - case <-ctx.Done(): - return Command{}, errors.New("interrupted") - case <-c.clock.After(consolidationTTL): - } - validationCandidates, err := GetCandidates(ctx, c.cluster, c.kubeClient, c.recorder, c.clock, c.cloudProvider, c.ShouldDeprovision) - if err != nil { - logging.FromContext(ctx).Errorf("computing validation candidates %s", err) - return Command{}, err - } - candidatesToDelete := mapCandidates(cmd.candidates, validationCandidates) - - // the deletion of empty machines is easy to validate, we just ensure that all the candidatesToDelete are still empty and that - // the machine isn't a target of a recent scheduling simulation - for _, n := range candidatesToDelete { - if len(n.pods) != 0 || c.cluster.IsNodeNominated(n.Name()) { - return Command{}, fmt.Errorf("command is no longer valid, %s", cmd) - } - } - return cmd, nil -} diff --git a/vendor/github.com/aws/karpenter-core/pkg/controllers/deprovisioning/events/events.go b/vendor/github.com/aws/karpenter-core/pkg/controllers/deprovisioning/events/events.go deleted file mode 100644 index 17c0f60b..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/controllers/deprovisioning/events/events.go +++ /dev/null @@ -1,114 +0,0 @@ -/* -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. -*/ - -package events - -import ( - "fmt" - "time" - - v1 "k8s.io/api/core/v1" - - "github.com/aws/karpenter-core/pkg/apis/v1alpha5" - "github.com/aws/karpenter-core/pkg/events" -) - -func Launching(machine *v1alpha5.Machine, reason string) events.Event { - return events.Event{ - InvolvedObject: machine, - Type: v1.EventTypeNormal, - Reason: "DeprovisioningLaunching", - Message: fmt.Sprintf("Launching machine for %s", reason), - DedupeValues: []string{machine.Name, reason}, - } -} - -func WaitingOnReadiness(machine *v1alpha5.Machine) events.Event { - return events.Event{ - InvolvedObject: machine, - Type: v1.EventTypeNormal, - Reason: "DeprovisioningWaitingReadiness", - Message: "Waiting on readiness to continue deprovisioning", - DedupeValues: []string{machine.Name}, - } -} - -func WaitingOnDeletion(machine *v1alpha5.Machine) events.Event { - return events.Event{ - InvolvedObject: machine, - Type: v1.EventTypeNormal, - Reason: "DeprovisioningWaitingDeletion", - Message: "Waiting on deletion to continue deprovisioning", - DedupeValues: []string{machine.Name}, - } -} - -func Terminating(node *v1.Node, machine *v1alpha5.Machine, reason string) []events.Event { - return []events.Event{ - { - InvolvedObject: node, - Type: v1.EventTypeNormal, - Reason: "DeprovisioningTerminating", - Message: fmt.Sprintf("Deprovisioning node via %s", reason), - DedupeValues: []string{node.Name, reason}, - }, - { - InvolvedObject: machine, - Type: v1.EventTypeNormal, - Reason: "DeprovisioningTerminating", - Message: fmt.Sprintf("Deprovisioning machine via %s", reason), - DedupeValues: []string{machine.Name, reason}, - }, - } -} - -func Unconsolidatable(node *v1.Node, machine *v1alpha5.Machine, reason string) []events.Event { - return []events.Event{ - { - InvolvedObject: node, - Type: v1.EventTypeNormal, - Reason: "Unconsolidatable", - Message: reason, - DedupeValues: []string{node.Name}, - DedupeTimeout: time.Minute * 15, - }, - { - InvolvedObject: machine, - Type: v1.EventTypeNormal, - Reason: "Unconsolidatable", - Message: reason, - DedupeValues: []string{machine.Name}, - DedupeTimeout: time.Minute * 15, - }, - } -} - -func Blocked(node *v1.Node, machine *v1alpha5.Machine, reason string) []events.Event { - return []events.Event{ - { - InvolvedObject: node, - Type: v1.EventTypeNormal, - Reason: "DeprovisioningBlocked", - Message: fmt.Sprintf("Cannot deprovision node due to %s", reason), - DedupeValues: []string{node.Name, reason}, - }, - { - InvolvedObject: machine, - Type: v1.EventTypeNormal, - Reason: "DeprovisioningBlocked", - Message: fmt.Sprintf("Cannot deprovision machine due to %s", reason), - DedupeValues: []string{machine.Name, reason}, - }, - } -} diff --git a/vendor/github.com/aws/karpenter-core/pkg/controllers/deprovisioning/expiration.go b/vendor/github.com/aws/karpenter-core/pkg/controllers/deprovisioning/expiration.go deleted file mode 100644 index edafc7a7..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/controllers/deprovisioning/expiration.go +++ /dev/null @@ -1,124 +0,0 @@ -/* -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. -*/ - -package deprovisioning - -import ( - "context" - "errors" - "fmt" - "sort" - "time" - - "k8s.io/utils/clock" - - "knative.dev/pkg/logging" - "knative.dev/pkg/ptr" - "sigs.k8s.io/controller-runtime/pkg/client" - - "github.com/samber/lo" - - "github.com/aws/karpenter-core/pkg/apis/v1alpha5" - "github.com/aws/karpenter-core/pkg/controllers/provisioning" - "github.com/aws/karpenter-core/pkg/controllers/state" - "github.com/aws/karpenter-core/pkg/events" - "github.com/aws/karpenter-core/pkg/metrics" - machineutil "github.com/aws/karpenter-core/pkg/utils/machine" -) - -// Expiration is a subreconciler that deletes empty nodes. -// Expiration will respect TTLSecondsAfterEmpty -type Expiration struct { - clock clock.Clock - kubeClient client.Client - cluster *state.Cluster - provisioner *provisioning.Provisioner - recorder events.Recorder -} - -func NewExpiration(clk clock.Clock, kubeClient client.Client, cluster *state.Cluster, provisioner *provisioning.Provisioner, recorder events.Recorder) *Expiration { - return &Expiration{ - clock: clk, - kubeClient: kubeClient, - cluster: cluster, - provisioner: provisioner, - recorder: recorder, - } -} - -// ShouldDeprovision is a predicate used to filter deprovisionable nodes -func (e *Expiration) ShouldDeprovision(_ context.Context, c *Candidate) bool { - return c.provisioner.Spec.TTLSecondsUntilExpired != nil && - c.Machine.StatusConditions().GetCondition(v1alpha5.MachineExpired) != nil && - c.Machine.StatusConditions().GetCondition(v1alpha5.MachineExpired).IsTrue() -} - -// SortCandidates orders expired nodes by when they've expired -func (e *Expiration) filterAndSortCandidates(ctx context.Context, nodes []*Candidate) ([]*Candidate, error) { - candidates, err := filterCandidates(ctx, e.kubeClient, e.recorder, nodes) - if err != nil { - return nil, fmt.Errorf("filtering candidates, %w", err) - } - sort.Slice(candidates, func(i int, j int) bool { - return machineutil.GetExpirationTime(candidates[i].Machine, candidates[i].provisioner).Before(machineutil.GetExpirationTime(candidates[j].Machine, candidates[j].provisioner)) - }) - return candidates, nil -} - -// ComputeCommand generates a deprovisioning command given deprovisionable nodes -func (e *Expiration) ComputeCommand(ctx context.Context, nodes ...*Candidate) (Command, error) { - candidates, err := e.filterAndSortCandidates(ctx, nodes) - if err != nil { - return Command{}, fmt.Errorf("filtering candidates, %w", err) - } - deprovisioningEligibleMachinesGauge.WithLabelValues(e.String()).Set(float64(len(candidates))) - - // Deprovision all empty expired nodes, as they require no scheduling simulations. - if empty := lo.Filter(candidates, func(c *Candidate, _ int) bool { - return len(c.pods) == 0 - }); len(empty) > 0 { - return Command{ - candidates: empty, - }, nil - } - - for _, candidate := range candidates { - // Check if we need to create any nodes. - results, err := simulateScheduling(ctx, e.kubeClient, e.cluster, e.provisioner, candidate) - if err != nil { - // if a candidate node is now deleting, just retry - if errors.Is(err, errCandidateDeleting) { - continue - } - return Command{}, err - } - // Log when all pods can't schedule, as the command will get executed immediately. - if !results.AllPodsScheduled() { - logging.FromContext(ctx).With("node", candidate.Name).Debugf("continuing to expire node after scheduling simulation failed to schedule all pods, %s", results.PodSchedulingErrors()) - } - - logging.FromContext(ctx).With("ttl", time.Duration(ptr.Int64Value(candidates[0].provisioner.Spec.TTLSecondsUntilExpired))*time.Second). - With("delay", time.Since(machineutil.GetExpirationTime(candidates[0].Machine, candidates[0].provisioner))).Infof("triggering termination for expired node after TTL") - return Command{ - candidates: []*Candidate{candidate}, - replacements: results.NewMachines, - }, nil - } - return Command{}, nil -} - -// String is the string representation of the deprovisioner -func (e *Expiration) String() string { - return metrics.ExpirationReason -} diff --git a/vendor/github.com/aws/karpenter-core/pkg/controllers/deprovisioning/helpers.go b/vendor/github.com/aws/karpenter-core/pkg/controllers/deprovisioning/helpers.go deleted file mode 100644 index 1978271a..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/controllers/deprovisioning/helpers.go +++ /dev/null @@ -1,270 +0,0 @@ -/* -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. -*/ - -package deprovisioning - -import ( - "context" - "fmt" - "math" - "strconv" - - "github.com/samber/lo" - - "github.com/aws/karpenter-core/pkg/apis/v1alpha5" - "github.com/aws/karpenter-core/pkg/cloudprovider" - deprovisioningevents "github.com/aws/karpenter-core/pkg/controllers/deprovisioning/events" - "github.com/aws/karpenter-core/pkg/controllers/provisioning" - pscheduling "github.com/aws/karpenter-core/pkg/controllers/provisioning/scheduling" - "github.com/aws/karpenter-core/pkg/controllers/state" - "github.com/aws/karpenter-core/pkg/events" - "github.com/aws/karpenter-core/pkg/scheduling" - "github.com/aws/karpenter-core/pkg/utils/pod" - - v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/util/sets" - "k8s.io/utils/clock" - "knative.dev/pkg/logging" - "sigs.k8s.io/controller-runtime/pkg/client" -) - -func filterCandidates(ctx context.Context, kubeClient client.Client, recorder events.Recorder, nodes []*Candidate) ([]*Candidate, error) { - pdbs, err := NewPDBLimits(ctx, kubeClient) - if err != nil { - return nil, fmt.Errorf("tracking PodDisruptionBudgets, %w", err) - } - - // filter out nodes that can't be terminated - nodes = lo.Filter(nodes, func(cn *Candidate, _ int) bool { - if !cn.Node.DeletionTimestamp.IsZero() { - recorder.Publish(deprovisioningevents.Blocked(cn.Node, cn.Machine, "in the process of deletion")...) - return false - } - if pdb, ok := pdbs.CanEvictPods(cn.pods); !ok { - recorder.Publish(deprovisioningevents.Blocked(cn.Node, cn.Machine, fmt.Sprintf("pdb %s prevents pod evictions", pdb))...) - return false - } - if p, ok := hasDoNotEvictPod(cn); ok { - recorder.Publish(deprovisioningevents.Blocked(cn.Node, cn.Machine, fmt.Sprintf("pod %s/%s has do not evict annotation", p.Namespace, p.Name))...) - return false - } - return true - }) - return nodes, nil -} - -//nolint:gocyclo -func simulateScheduling(ctx context.Context, kubeClient client.Client, cluster *state.Cluster, provisioner *provisioning.Provisioner, - candidates ...*Candidate) (*pscheduling.Results, error) { - - candidateNames := sets.NewString(lo.Map(candidates, func(t *Candidate, i int) string { return t.Name() })...) - nodes := cluster.Nodes() - deletingNodes := nodes.Deleting() - stateNodes := lo.Filter(nodes.Active(), func(n *state.StateNode, _ int) bool { - return !candidateNames.Has(n.Name()) - }) - - // We do one final check to ensure that the node that we are attempting to consolidate isn't - // already handled for deletion by some other controller. This could happen if the node was markedForDeletion - // between returning the candidates and getting the stateNodes above - if _, ok := lo.Find(deletingNodes, func(n *state.StateNode) bool { - return candidateNames.Has(n.Name()) - }); ok { - return nil, errCandidateDeleting - } - - // We get the pods that are on nodes that are deleting - deletingNodePods, err := deletingNodes.Pods(ctx, kubeClient) - if err != nil { - return nil, fmt.Errorf("failed to get pods from deleting nodes, %w", err) - } - // start by getting all pending pods - pods, err := provisioner.GetPendingPods(ctx) - if err != nil { - return nil, fmt.Errorf("determining pending pods, %w", err) - } - - for _, n := range candidates { - pods = append(pods, n.pods...) - } - pods = append(pods, deletingNodePods...) - scheduler, err := provisioner.NewScheduler(ctx, pods, stateNodes, pscheduling.SchedulerOptions{ - SimulationMode: true, - }) - - if err != nil { - return nil, fmt.Errorf("creating scheduler, %w", err) - } - - results, err := scheduler.Solve(ctx, pods) - if err != nil { - return nil, fmt.Errorf("simulating scheduling, %w", err) - } - - // check if the scheduling relied on an existing node that isn't ready yet, if so we fail - // to schedule since we want to assume that we can delete a node and its pods will immediately - // move to an existing node which won't occur if that node isn't ready. - for _, n := range results.ExistingNodes { - if !n.Initialized() { - for _, p := range n.Pods { - results.PodErrors[p] = fmt.Errorf("would schedule against a non-initialized node %s", n.Name()) - } - } - } - - return results, nil -} - -// instanceTypesAreSubset returns true if the lhs slice of instance types are a subset of the rhs. -func instanceTypesAreSubset(lhs []*cloudprovider.InstanceType, rhs []*cloudprovider.InstanceType) bool { - rhsNames := sets.NewString(lo.Map(rhs, func(t *cloudprovider.InstanceType, i int) string { return t.Name })...) - lhsNames := sets.NewString(lo.Map(lhs, func(t *cloudprovider.InstanceType, i int) string { return t.Name })...) - return len(rhsNames.Intersection(lhsNames)) == len(lhsNames) -} - -// GetPodEvictionCost returns the disruption cost computed for evicting the given pod. -func GetPodEvictionCost(ctx context.Context, p *v1.Pod) float64 { - cost := 1.0 - podDeletionCostStr, ok := p.Annotations[v1.PodDeletionCost] - if ok { - podDeletionCost, err := strconv.ParseFloat(podDeletionCostStr, 64) - if err != nil { - logging.FromContext(ctx).Errorf("parsing %s=%s from pod %s, %s", - v1.PodDeletionCost, podDeletionCostStr, client.ObjectKeyFromObject(p), err) - } else { - // the pod deletion disruptionCost is in [-2147483647, 2147483647] - // the min pod disruptionCost makes one pod ~ -15 pods, and the max pod disruptionCost to ~ 17 pods. - cost += podDeletionCost / math.Pow(2, 27.0) - } - } - // the scheduling priority is in [-2147483648, 1000000000] - if p.Spec.Priority != nil { - cost += float64(*p.Spec.Priority) / math.Pow(2, 25) - } - - // overall we clamp the pod cost to the range [-10.0, 10.0] with the default being 1.0 - return clamp(-10.0, cost, 10.0) -} - -func filterByPrice(options []*cloudprovider.InstanceType, reqs scheduling.Requirements, price float64) []*cloudprovider.InstanceType { - var result []*cloudprovider.InstanceType - for _, it := range options { - launchPrice := worstLaunchPrice(it.Offerings.Available(), reqs) - if launchPrice < price { - result = append(result, it) - } - } - return result -} - -func disruptionCost(ctx context.Context, pods []*v1.Pod) float64 { - cost := 0.0 - for _, p := range pods { - cost += GetPodEvictionCost(ctx, p) - } - return cost -} - -// GetCandidates returns nodes that appear to be currently deprovisionable based off of their provisioner -func GetCandidates(ctx context.Context, cluster *state.Cluster, kubeClient client.Client, recorder events.Recorder, clk clock.Clock, cloudProvider cloudprovider.CloudProvider, shouldDeprovision CandidateFilter) ([]*Candidate, error) { - provisionerMap, provisionerToInstanceTypes, err := buildProvisionerMap(ctx, kubeClient, cloudProvider) - if err != nil { - return nil, err - } - candidates := lo.FilterMap(cluster.Nodes(), func(n *state.StateNode, _ int) (*Candidate, bool) { - cn, e := NewCandidate(ctx, kubeClient, recorder, clk, n, provisionerMap, provisionerToInstanceTypes) - return cn, e == nil - }) - // Filter only the valid candidates that we should deprovision - return lo.Filter(candidates, func(c *Candidate, _ int) bool { return shouldDeprovision(ctx, c) }), nil -} - -// buildProvisionerMap builds a provName -> provisioner map and a provName -> instanceName -> instance type map -func buildProvisionerMap(ctx context.Context, kubeClient client.Client, cloudProvider cloudprovider.CloudProvider) (map[string]*v1alpha5.Provisioner, map[string]map[string]*cloudprovider.InstanceType, error) { - provisioners := map[string]*v1alpha5.Provisioner{} - var provList v1alpha5.ProvisionerList - if err := kubeClient.List(ctx, &provList); err != nil { - return nil, nil, fmt.Errorf("listing provisioners, %w", err) - } - instanceTypesByProvisioner := map[string]map[string]*cloudprovider.InstanceType{} - for i := range provList.Items { - p := &provList.Items[i] - provisioners[p.Name] = p - - provInstanceTypes, err := cloudProvider.GetInstanceTypes(ctx, p) - if err != nil { - return nil, nil, fmt.Errorf("listing instance types for %s, %w", p.Name, err) - } - instanceTypesByProvisioner[p.Name] = map[string]*cloudprovider.InstanceType{} - for _, it := range provInstanceTypes { - instanceTypesByProvisioner[p.Name][it.Name] = it - } - } - return provisioners, instanceTypesByProvisioner, nil -} - -// mapCandidates maps the list of proposed candidates with the current state -func mapCandidates(proposed, current []*Candidate) []*Candidate { - proposedNames := sets.NewString(lo.Map(proposed, func(c *Candidate, i int) string { return c.Name() })...) - return lo.Filter(current, func(c *Candidate, _ int) bool { - return proposedNames.Has(c.Name()) - }) -} - -// worstLaunchPrice gets the worst-case launch price from the offerings that are offered -// on an instance type. If the instance type has a spot offering available, then it uses the spot offering -// to get the launch price; else, it uses the on-demand launch price -func worstLaunchPrice(ofs []cloudprovider.Offering, reqs scheduling.Requirements) float64 { - // We prefer to launch spot offerings, so we will get the worst price based on the node requirements - if reqs.Get(v1alpha5.LabelCapacityType).Has(v1alpha5.CapacityTypeSpot) { - spotOfferings := lo.Filter(ofs, func(of cloudprovider.Offering, _ int) bool { - return of.CapacityType == v1alpha5.CapacityTypeSpot && reqs.Get(v1.LabelTopologyZone).Has(of.Zone) - }) - if len(spotOfferings) > 0 { - return lo.MaxBy(spotOfferings, func(of1, of2 cloudprovider.Offering) bool { - return of1.Price > of2.Price - }).Price - } - } - if reqs.Get(v1alpha5.LabelCapacityType).Has(v1alpha5.CapacityTypeOnDemand) { - onDemandOfferings := lo.Filter(ofs, func(of cloudprovider.Offering, _ int) bool { - return of.CapacityType == v1alpha5.CapacityTypeOnDemand && reqs.Get(v1.LabelTopologyZone).Has(of.Zone) - }) - if len(onDemandOfferings) > 0 { - return lo.MaxBy(onDemandOfferings, func(of1, of2 cloudprovider.Offering) bool { - return of1.Price > of2.Price - }).Price - } - } - return math.MaxFloat64 -} - -func clamp(min, val, max float64) float64 { - if val < min { - return min - } - if val > max { - return max - } - return val -} - -func hasDoNotEvictPod(c *Candidate) (*v1.Pod, bool) { - return lo.Find(c.pods, func(p *v1.Pod) bool { - if pod.IsTerminating(p) || pod.IsTerminal(p) || pod.IsOwnedByNode(p) { - return false - } - return pod.HasDoNotEvict(p) - }) -} diff --git a/vendor/github.com/aws/karpenter-core/pkg/controllers/deprovisioning/metrics.go b/vendor/github.com/aws/karpenter-core/pkg/controllers/deprovisioning/metrics.go deleted file mode 100644 index 77f31528..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/controllers/deprovisioning/metrics.go +++ /dev/null @@ -1,73 +0,0 @@ -/* -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. -*/ - -package deprovisioning - -import ( - "github.com/prometheus/client_golang/prometheus" - crmetrics "sigs.k8s.io/controller-runtime/pkg/metrics" - - "github.com/aws/karpenter-core/pkg/metrics" -) - -func init() { - crmetrics.Registry.MustRegister(deprovisioningDurationHistogram) - crmetrics.Registry.MustRegister(deprovisioningReplacementNodeInitializedHistogram) - crmetrics.Registry.MustRegister(deprovisioningActionsPerformedCounter) - crmetrics.Registry.MustRegister(deprovisioningEligibleMachinesGauge) -} - -const ( - deprovisioningSubsystem = "deprovisioning" - deprovisionerLabel = "deprovisioner" - actionLabel = "action" -) - -var ( - deprovisioningDurationHistogram = prometheus.NewHistogramVec( - prometheus.HistogramOpts{ - Namespace: metrics.Namespace, - Subsystem: deprovisioningSubsystem, - Name: "evaluation_duration_seconds", - Help: "Duration of the deprovisioning evaluation process in seconds.", - Buckets: metrics.DurationBuckets(), - }, - []string{"method"}) - deprovisioningReplacementNodeInitializedHistogram = prometheus.NewHistogram( - prometheus.HistogramOpts{ - Namespace: metrics.Namespace, - Subsystem: deprovisioningSubsystem, - Name: "replacement_machine_initialized_seconds", - Help: "Amount of time required for a replacement machine to become initialized.", - Buckets: metrics.DurationBuckets(), - }) - deprovisioningActionsPerformedCounter = prometheus.NewCounterVec( - prometheus.CounterOpts{ - Namespace: metrics.Namespace, - Subsystem: deprovisioningSubsystem, - Name: "actions_performed", - Help: "Number of deprovisioning actions performed. Labeled by deprovisioner.", - }, - []string{actionLabel, deprovisionerLabel}, - ) - deprovisioningEligibleMachinesGauge = prometheus.NewGaugeVec( - prometheus.GaugeOpts{ - Namespace: metrics.Namespace, - Subsystem: deprovisioningSubsystem, - Name: "eligible_machines", - Help: "Number of machines eligible for deprovisioning by Karpenter. Labeled by deprovisioner", - }, - []string{deprovisionerLabel}, - ) -) diff --git a/vendor/github.com/aws/karpenter-core/pkg/controllers/deprovisioning/multimachineconsolidation.go b/vendor/github.com/aws/karpenter-core/pkg/controllers/deprovisioning/multimachineconsolidation.go deleted file mode 100644 index 511f1d81..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/controllers/deprovisioning/multimachineconsolidation.go +++ /dev/null @@ -1,169 +0,0 @@ -/* -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. -*/ - -package deprovisioning - -import ( - "context" - "fmt" - "math" - - "k8s.io/apimachinery/pkg/util/sets" - "k8s.io/utils/clock" - "knative.dev/pkg/logging" - "sigs.k8s.io/controller-runtime/pkg/client" - - "github.com/aws/karpenter-core/pkg/cloudprovider" - "github.com/aws/karpenter-core/pkg/controllers/provisioning" - "github.com/aws/karpenter-core/pkg/controllers/provisioning/scheduling" - "github.com/aws/karpenter-core/pkg/controllers/state" - "github.com/aws/karpenter-core/pkg/events" -) - -type MultiMachineConsolidation struct { - consolidation -} - -func NewMultiMachineConsolidation(clk clock.Clock, cluster *state.Cluster, kubeClient client.Client, - provisioner *provisioning.Provisioner, cp cloudprovider.CloudProvider, recorder events.Recorder) *MultiMachineConsolidation { - return &MultiMachineConsolidation{makeConsolidation(clk, cluster, kubeClient, provisioner, cp, recorder)} -} - -func (m *MultiMachineConsolidation) ComputeCommand(ctx context.Context, candidates ...*Candidate) (Command, error) { - if m.cluster.Consolidated() { - return Command{}, nil - } - candidates, err := m.sortAndFilterCandidates(ctx, candidates) - if err != nil { - return Command{}, fmt.Errorf("sorting candidates, %w", err) - } - deprovisioningEligibleMachinesGauge.WithLabelValues(m.String()).Set(float64(len(candidates))) - - // For now, we will consider up to every machine in the cluster, might be configurable in the future. - maxParallel := len(candidates) - cmd, err := m.firstNMachineConsolidationOption(ctx, candidates, maxParallel) - if err != nil { - return Command{}, err - } - if cmd.Action() == NoOpAction { - return cmd, nil - } - - v := NewValidation(consolidationTTL, m.clock, m.cluster, m.kubeClient, m.provisioner, m.cloudProvider, m.recorder) - isValid, err := v.IsValid(ctx, cmd) - if err != nil { - return Command{}, fmt.Errorf("validating, %w", err) - } - - if !isValid { - logging.FromContext(ctx).Debugf("consolidation command is no longer valid, %s", cmd) - return Command{}, nil - } - return cmd, nil -} - -// firstNMachineConsolidationOption looks at the first N machines to determine if they can all be consolidated at once. The -// machines are sorted by increasing disruption order which correlates to likelihood if being able to consolidate the machine -func (m *MultiMachineConsolidation) firstNMachineConsolidationOption(ctx context.Context, candidates []*Candidate, max int) (Command, error) { - // we always operate on at least two machines at once, for single machines standard consolidation will find all solutions - if len(candidates) < 2 { - return Command{}, nil - } - min := 1 - if len(candidates) <= max { - max = len(candidates) - 1 - } - - lastSavedCommand := Command{} - // binary search to find the maximum number of machines we can terminate - for min <= max { - mid := (min + max) / 2 - - candidatesToConsolidate := candidates[0 : mid+1] - - cmd, err := m.computeConsolidation(ctx, candidatesToConsolidate...) - if err != nil { - return Command{}, err - } - - // ensure that the action is sensical for replacements, see explanation on filterOutSameType for why this is - // required - replacementHasValidInstanceTypes := false - if cmd.Action() == ReplaceAction { - cmd.replacements[0].InstanceTypeOptions = filterOutSameType(cmd.replacements[0], candidatesToConsolidate) - replacementHasValidInstanceTypes = len(cmd.replacements[0].InstanceTypeOptions) > 0 - } - - // replacementHasValidInstanceTypes will be false if the replacement action has valid instance types remaining after filtering. - if replacementHasValidInstanceTypes || cmd.Action() == DeleteAction { - // we can consolidate machines [0,mid] - lastSavedCommand = cmd - min = mid + 1 - } else { - max = mid - 1 - } - } - return lastSavedCommand, nil -} - -// filterOutSameType filters out instance types that are more expensive than the cheapest instance type that is being -// consolidated if the list of replacement instance types include one of the instance types that is being removed -// -// This handles the following potential consolidation result: -// machines=[t3a.2xlarge, t3a.2xlarge, t3a.small] -> 1 of t3a.small, t3a.xlarge, t3a.2xlarge -// -// In this case, we shouldn't perform this consolidation at all. This is equivalent to just -// deleting the 2x t3a.xlarge machines. This code will identify that t3a.small is in both lists and filter -// out any instance type that is the same or more expensive than the t3a.small -// -// For another scenario: -// machines=[t3a.2xlarge, t3a.2xlarge, t3a.small] -> 1 of t3a.nano, t3a.small, t3a.xlarge, t3a.2xlarge -// -// This code sees that t3a.small is the cheapest type in both lists and filters it and anything more expensive out -// leaving the valid consolidation: -// machines=[t3a.2xlarge, t3a.2xlarge, t3a.small] -> 1 of t3a.nano -func filterOutSameType(newMachine *scheduling.Machine, consolidate []*Candidate) []*cloudprovider.InstanceType { - existingInstanceTypes := sets.NewString() - pricesByInstanceType := map[string]float64{} - - // get the price of the cheapest machine that we currently are considering deleting indexed by instance type - for _, c := range consolidate { - existingInstanceTypes.Insert(c.instanceType.Name) - of, ok := c.instanceType.Offerings.Get(c.capacityType, c.zone) - if !ok { - continue - } - existingPrice, ok := pricesByInstanceType[c.instanceType.Name] - if !ok { - existingPrice = math.MaxFloat64 - } - if of.Price < existingPrice { - pricesByInstanceType[c.instanceType.Name] = of.Price - } - } - - maxPrice := math.MaxFloat64 - for _, it := range newMachine.InstanceTypeOptions { - // we are considering replacing multiple machines with a single machine of one of the same types, so the replacement - // machine must be cheaper than the price of the existing machine, or we should just keep that one and do a - // deletion only to reduce cluster disruption (fewer pods will re-schedule). - if existingInstanceTypes.Has(it.Name) { - if pricesByInstanceType[it.Name] < maxPrice { - maxPrice = pricesByInstanceType[it.Name] - } - } - } - - return filterByPrice(newMachine.InstanceTypeOptions, newMachine.Requirements, maxPrice) -} diff --git a/vendor/github.com/aws/karpenter-core/pkg/controllers/deprovisioning/pdblimits.go b/vendor/github.com/aws/karpenter-core/pkg/controllers/deprovisioning/pdblimits.go deleted file mode 100644 index 3645d25b..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/controllers/deprovisioning/pdblimits.go +++ /dev/null @@ -1,88 +0,0 @@ -/* -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. -*/ - -package deprovisioning - -import ( - "context" - - v1 "k8s.io/api/core/v1" - policyv1 "k8s.io/api/policy/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "sigs.k8s.io/controller-runtime/pkg/client" -) - -// PDBLimits is used to evaluate if evicting a list of pods is possible. -type PDBLimits struct { - ctx context.Context - kubeClient client.Client - pdbs []*pdbItem -} - -func NewPDBLimits(ctx context.Context, kubeClient client.Client) (*PDBLimits, error) { - ps := &PDBLimits{ - ctx: ctx, - kubeClient: kubeClient, - } - - var pdbList policyv1.PodDisruptionBudgetList - if err := kubeClient.List(ctx, &pdbList); err != nil { - return nil, err - } - for _, pdb := range pdbList.Items { - pi, err := newPdb(pdb) - if err != nil { - return nil, err - } - ps.pdbs = append(ps.pdbs, pi) - } - - return ps, nil -} - -// CanEvictPods returns true if every pod in the list is evictable. They may not all be evictable simultaneously, but -// for every PDB that controls the pods at least one pod can be evicted. -func (s *PDBLimits) CanEvictPods(pods []*v1.Pod) (client.ObjectKey, bool) { - for _, pod := range pods { - for _, pdb := range s.pdbs { - if pdb.name.Namespace == pod.ObjectMeta.Namespace { - if pdb.selector.Matches(labels.Set(pod.Labels)) { - if pdb.disruptionsAllowed == 0 { - return pdb.name, false - } - } - } - } - } - return client.ObjectKey{}, true -} - -type pdbItem struct { - name client.ObjectKey - selector labels.Selector - disruptionsAllowed int32 -} - -func newPdb(pdb policyv1.PodDisruptionBudget) (*pdbItem, error) { - selector, err := metav1.LabelSelectorAsSelector(pdb.Spec.Selector) - if err != nil { - return nil, err - } - return &pdbItem{ - name: client.ObjectKeyFromObject(&pdb), - selector: selector, - disruptionsAllowed: pdb.Status.DisruptionsAllowed, - }, nil -} diff --git a/vendor/github.com/aws/karpenter-core/pkg/controllers/deprovisioning/singlemachineconsolidation.go b/vendor/github.com/aws/karpenter-core/pkg/controllers/deprovisioning/singlemachineconsolidation.go deleted file mode 100644 index f930eb0f..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/controllers/deprovisioning/singlemachineconsolidation.go +++ /dev/null @@ -1,76 +0,0 @@ -/* -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. -*/ - -package deprovisioning - -import ( - "context" - "fmt" - - "k8s.io/utils/clock" - "knative.dev/pkg/logging" - "sigs.k8s.io/controller-runtime/pkg/client" - - "github.com/aws/karpenter-core/pkg/cloudprovider" - "github.com/aws/karpenter-core/pkg/controllers/provisioning" - "github.com/aws/karpenter-core/pkg/controllers/state" - "github.com/aws/karpenter-core/pkg/events" -) - -// SingleMachineConsolidation is the consolidation controller that performs single machine consolidation. -type SingleMachineConsolidation struct { - consolidation -} - -func NewSingleMachineConsolidation(clk clock.Clock, cluster *state.Cluster, kubeClient client.Client, provisioner *provisioning.Provisioner, - cp cloudprovider.CloudProvider, recorder events.Recorder) *SingleMachineConsolidation { - return &SingleMachineConsolidation{consolidation: makeConsolidation(clk, cluster, kubeClient, provisioner, cp, recorder)} -} - -// ComputeCommand generates a deprovisioning command given deprovisionable machines -// nolint:gocyclo -func (c *SingleMachineConsolidation) ComputeCommand(ctx context.Context, candidates ...*Candidate) (Command, error) { - if c.cluster.Consolidated() { - return Command{}, nil - } - candidates, err := c.sortAndFilterCandidates(ctx, candidates) - if err != nil { - return Command{}, fmt.Errorf("sorting candidates, %w", err) - } - deprovisioningEligibleMachinesGauge.WithLabelValues(c.String()).Set(float64(len(candidates))) - - v := NewValidation(consolidationTTL, c.clock, c.cluster, c.kubeClient, c.provisioner, c.cloudProvider, c.recorder) - for _, candidate := range candidates { - // compute a possible consolidation option - cmd, err := c.computeConsolidation(ctx, candidate) - if err != nil { - logging.FromContext(ctx).Errorf("computing consolidation %s", err) - continue - } - if cmd.Action() == NoOpAction { - continue - } - - isValid, err := v.IsValid(ctx, cmd) - if err != nil { - logging.FromContext(ctx).Errorf("validating consolidation %s", err) - continue - } - if !isValid { - return Command{}, fmt.Errorf("command is no longer valid, %s", cmd) - } - return cmd, nil - } - return Command{}, nil -} diff --git a/vendor/github.com/aws/karpenter-core/pkg/controllers/deprovisioning/types.go b/vendor/github.com/aws/karpenter-core/pkg/controllers/deprovisioning/types.go deleted file mode 100644 index 3235b04b..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/controllers/deprovisioning/types.go +++ /dev/null @@ -1,204 +0,0 @@ -/* -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. -*/ - -package deprovisioning - -import ( - "bytes" - "context" - "fmt" - - v1 "k8s.io/api/core/v1" - "k8s.io/utils/clock" - "knative.dev/pkg/logging" - "sigs.k8s.io/controller-runtime/pkg/client" - - "github.com/aws/karpenter-core/pkg/apis/v1alpha5" - "github.com/aws/karpenter-core/pkg/cloudprovider" - deprovisioningevents "github.com/aws/karpenter-core/pkg/controllers/deprovisioning/events" - "github.com/aws/karpenter-core/pkg/controllers/provisioning/scheduling" - "github.com/aws/karpenter-core/pkg/controllers/state" - "github.com/aws/karpenter-core/pkg/events" -) - -type Deprovisioner interface { - ShouldDeprovision(context.Context, *Candidate) bool - ComputeCommand(context.Context, ...*Candidate) (Command, error) - String() string -} - -type CandidateFilter func(context.Context, *Candidate) bool - -// Candidate is a state.StateNode that we are considering for deprovisioning along with extra information to be used in -// making that determination -type Candidate struct { - *state.StateNode - instanceType *cloudprovider.InstanceType - provisioner *v1alpha5.Provisioner - zone string - capacityType string - disruptionCost float64 - pods []*v1.Pod -} - -//nolint:gocyclo -func NewCandidate(ctx context.Context, kubeClient client.Client, recorder events.Recorder, clk clock.Clock, node *state.StateNode, - provisionerMap map[string]*v1alpha5.Provisioner, provisionerToInstanceTypes map[string]map[string]*cloudprovider.InstanceType) (*Candidate, error) { - - if node.Node == nil || node.Machine == nil { - return nil, fmt.Errorf("state node doesn't contain both a node and a machine") - } - // check whether the node has all the labels we need - for _, label := range []string{ - v1alpha5.LabelCapacityType, - v1.LabelTopologyZone, - v1alpha5.ProvisionerNameLabelKey, - } { - if _, ok := node.Labels()[label]; !ok { - // This means that we don't own the candidate which means we shouldn't fire an event for it - if label != v1alpha5.ProvisionerNameLabelKey { - recorder.Publish(deprovisioningevents.Blocked(node.Node, node.Machine, fmt.Sprintf("required label %q doesn't exist", label))...) - } - return nil, fmt.Errorf("state node doesn't have required label '%s'", label) - } - } - - provisioner := provisionerMap[node.Labels()[v1alpha5.ProvisionerNameLabelKey]] - instanceTypeMap := provisionerToInstanceTypes[node.Labels()[v1alpha5.ProvisionerNameLabelKey]] - // skip any nodes where we can't determine the provisioner - if provisioner == nil || instanceTypeMap == nil { - recorder.Publish(deprovisioningevents.Blocked(node.Node, node.Machine, fmt.Sprintf("owning provisioner %q not found", node.Labels()[v1alpha5.ProvisionerNameLabelKey]))...) - return nil, fmt.Errorf("provisioner '%s' can't be resolved for state node", node.Labels()[v1alpha5.ProvisionerNameLabelKey]) - } - instanceType := instanceTypeMap[node.Labels()[v1.LabelInstanceTypeStable]] - // skip any nodes that we can't determine the instance of - if instanceType == nil { - recorder.Publish(deprovisioningevents.Blocked(node.Node, node.Machine, fmt.Sprintf("instance type %q not found", node.Labels()[v1.LabelInstanceTypeStable]))...) - return nil, fmt.Errorf("instance type '%s' can't be resolved", node.Labels()[v1.LabelInstanceTypeStable]) - } - - // skip any nodes that are already marked for deletion and being handled - if node.MarkedForDeletion() { - recorder.Publish(deprovisioningevents.Blocked(node.Node, node.Machine, "machine is marked for deletion")...) - return nil, fmt.Errorf("state node is marked for deletion") - } - // skip nodes that aren't initialized - // This also means that the real Node doesn't exist for it - if !node.Initialized() { - recorder.Publish(deprovisioningevents.Blocked(node.Node, node.Machine, "machine is not initialized")...) - return nil, fmt.Errorf("state node isn't initialized") - } - // skip the node if it is nominated by a recent provisioning pass to be the target of a pending pod. - if node.Nominated() { - recorder.Publish(deprovisioningevents.Blocked(node.Node, node.Machine, "machine is nominated")...) - return nil, fmt.Errorf("state node is nominated") - } - - pods, err := node.Pods(ctx, kubeClient) - if err != nil { - logging.FromContext(ctx).Errorf("Determining node pods, %s", err) - return nil, fmt.Errorf("getting pods from state node, %w", err) - } - cn := &Candidate{ - StateNode: node.DeepCopy(), - instanceType: instanceType, - provisioner: provisioner, - capacityType: node.Labels()[v1alpha5.LabelCapacityType], - zone: node.Labels()[v1.LabelTopologyZone], - pods: pods, - } - cn.disruptionCost = disruptionCost(ctx, pods) * cn.lifetimeRemaining(clk) - return cn, nil -} - -// lifetimeRemaining calculates the fraction of node lifetime remaining in the range [0.0, 1.0]. If the TTLSecondsUntilExpired -// is non-zero, we use it to scale down the disruption costs of nodes that are going to expire. Just after creation, the -// disruption cost is highest, and it approaches zero as the node ages towards its expiration time. -func (c *Candidate) lifetimeRemaining(clock clock.Clock) float64 { - remaining := 1.0 - if c.provisioner.Spec.TTLSecondsUntilExpired != nil { - ageInSeconds := clock.Since(c.Node.CreationTimestamp.Time).Seconds() - totalLifetimeSeconds := float64(*c.provisioner.Spec.TTLSecondsUntilExpired) - lifetimeRemainingSeconds := totalLifetimeSeconds - ageInSeconds - remaining = clamp(0.0, lifetimeRemainingSeconds/totalLifetimeSeconds, 1.0) - } - return remaining -} - -type Command struct { - candidates []*Candidate - replacements []*scheduling.Machine -} - -type Action string - -var ( - NoOpAction Action = "no-op" - ReplaceAction Action = "replace" - DeleteAction Action = "delete" -) - -func (o Command) Action() Action { - switch { - case len(o.candidates) > 0 && len(o.replacements) > 0: - return ReplaceAction - case len(o.candidates) > 0 && len(o.replacements) == 0: - return DeleteAction - default: - return NoOpAction - } -} - -func (o Command) String() string { - var buf bytes.Buffer - fmt.Fprintf(&buf, "%s, terminating %d machines ", o.Action(), len(o.candidates)) - for i, old := range o.candidates { - if i != 0 { - fmt.Fprint(&buf, ", ") - } - fmt.Fprintf(&buf, "%s", old.Name()) - fmt.Fprintf(&buf, "/%s", old.instanceType.Name) - fmt.Fprintf(&buf, "/%s", old.capacityType) - } - if len(o.replacements) == 0 { - return buf.String() - } - odMachines := 0 - spotMachines := 0 - for _, machine := range o.replacements { - ct := machine.Requirements.Get(v1alpha5.LabelCapacityType) - if ct.Has(v1alpha5.CapacityTypeOnDemand) { - odMachines++ - } - if ct.Has(v1alpha5.CapacityTypeSpot) { - spotMachines++ - } - } - // Print list of instance types for the first replacements. - if len(o.replacements) > 1 { - fmt.Fprintf(&buf, " and replacing with %d spot and %d on-demand machines from types %s", - spotMachines, odMachines, - scheduling.InstanceTypeList(o.replacements[0].InstanceTypeOptions)) - return buf.String() - } - ct := o.replacements[0].Requirements.Get(v1alpha5.LabelCapacityType) - machineDesc := "machine" - if ct.Len() == 1 { - machineDesc = fmt.Sprintf("%s machine", ct.Any()) - } - fmt.Fprintf(&buf, " and replacing with %s from types %s", - machineDesc, - scheduling.InstanceTypeList(o.replacements[0].InstanceTypeOptions)) - return buf.String() -} diff --git a/vendor/github.com/aws/karpenter-core/pkg/controllers/deprovisioning/validation.go b/vendor/github.com/aws/karpenter-core/pkg/controllers/deprovisioning/validation.go deleted file mode 100644 index edc90eaf..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/controllers/deprovisioning/validation.go +++ /dev/null @@ -1,181 +0,0 @@ -/* -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. -*/ - -package deprovisioning - -import ( - "context" - "errors" - "fmt" - "sync" - "time" - - "k8s.io/utils/clock" - "knative.dev/pkg/ptr" - "sigs.k8s.io/controller-runtime/pkg/client" - - "github.com/aws/karpenter-core/pkg/apis/v1alpha5" - "github.com/aws/karpenter-core/pkg/cloudprovider" - "github.com/aws/karpenter-core/pkg/controllers/provisioning" - "github.com/aws/karpenter-core/pkg/controllers/state" - "github.com/aws/karpenter-core/pkg/events" -) - -// Validation is used to perform validation on a consolidation command. It makes an assumption that when re-used, all -// of the commands passed to IsValid were constructed based off of the same consolidation state. This allows it to -// skip the validation TTL for all but the first command. -type Validation struct { - validationPeriod time.Duration - start time.Time - clock clock.Clock - cluster *state.Cluster - kubeClient client.Client - cloudProvider cloudprovider.CloudProvider - provisioner *provisioning.Provisioner - once sync.Once - recorder events.Recorder - // validationCandidates are the cached validation candidates. We capture these when validating the first command and reuse them for - // validating subsequent commands. - validationCandidates []*Candidate -} - -func NewValidation(validationPeriod time.Duration, clk clock.Clock, cluster *state.Cluster, kubeClient client.Client, provisioner *provisioning.Provisioner, cp cloudprovider.CloudProvider, recorder events.Recorder) *Validation { - return &Validation{ - validationPeriod: validationPeriod, - clock: clk, - cluster: cluster, - kubeClient: kubeClient, - provisioner: provisioner, - cloudProvider: cp, - recorder: recorder, - } -} - -func (v *Validation) IsValid(ctx context.Context, cmd Command) (bool, error) { - var err error - v.once.Do(func() { - v.start = v.clock.Now() - }) - - waitDuration := v.validationPeriod - v.clock.Since(v.start) - if waitDuration > 0 { - select { - case <-ctx.Done(): - return false, errors.New("context canceled") - case <-v.clock.After(waitDuration): - } - } - if len(v.validationCandidates) == 0 { - v.validationCandidates, err = GetCandidates(ctx, v.cluster, v.kubeClient, v.recorder, v.clock, v.cloudProvider, v.ShouldDeprovision) - if err != nil { - return false, fmt.Errorf("constructing validation candidates, %w", err) - } - } - nodes, err := filterCandidates(ctx, v.kubeClient, v.recorder, cmd.candidates) - if err != nil { - return false, fmt.Errorf("filtering candidates, %w", err) - } - // If we filtered out any candidates, return false as some nodes in the consolidation decision have changed. - if len(nodes) != len(cmd.candidates) { - return false, nil - } - // a candidate we are about to delete is a target of a currently pending pod, wait for that to settle - // before continuing consolidation - for _, n := range cmd.candidates { - if v.cluster.IsNodeNominated(n.Name()) { - return false, nil - } - } - - isValid, err := v.ValidateCommand(ctx, cmd, v.validationCandidates) - if err != nil { - return false, fmt.Errorf("validating command, %w", err) - } - - return isValid, nil -} - -// ShouldDeprovision is a predicate used to filter deprovisionable nodes -func (v *Validation) ShouldDeprovision(_ context.Context, c *Candidate) bool { - if val, ok := c.Annotations()[v1alpha5.DoNotConsolidateNodeAnnotationKey]; ok { - return val != "true" - } - return c.provisioner != nil && c.provisioner.Spec.Consolidation != nil && ptr.BoolValue(c.provisioner.Spec.Consolidation.Enabled) -} - -// ValidateCommand validates a command for a deprovisioner -func (v *Validation) ValidateCommand(ctx context.Context, cmd Command, candidates []*Candidate) (bool, error) { - // map from candidates we are about to remove back into candidates with cluster state - candidates = mapCandidates(cmd.candidates, candidates) - - // None of the chosen candidate are valid for execution, so retry - if len(candidates) == 0 { - return false, nil - } - - results, err := simulateScheduling(ctx, v.kubeClient, v.cluster, v.provisioner, candidates...) - if err != nil { - return false, fmt.Errorf("simluating scheduling, %w", err) - } - if !results.AllPodsScheduled() { - return false, nil - } - - // We want to ensure that the re-simulated scheduling using the current cluster state produces the same result. - // There are three possible options for the number of new candidates that we need to handle: - // len(newMachines) == 0, as long as we weren't expecting a new machine, this is valid - // len(newMachines) > 1, something in the cluster changed so that the candidates we were going to delete can no longer - // be deleted without producing more than one machine - // len(newMachines) == 1, as long as the machine looks like what we were expecting, this is valid - if len(results.NewMachines) == 0 { - if len(cmd.replacements) == 0 { - // scheduling produced zero new machines and we weren't expecting any, so this is valid. - return true, nil - } - // if it produced no new machines, but we were expecting one we should re-simulate as there is likely a better - // consolidation option now - return false, nil - } - - // we need more than one replacement machine which is never valid currently (all of our node replacement is m->1, never m->n) - if len(results.NewMachines) > 1 { - return false, nil - } - - // we now know that scheduling simulation wants to create one new machine - if len(cmd.replacements) == 0 { - // but we weren't expecting any new nodes, so this is invalid - return false, nil - } - - // We know that the scheduling simulation wants to create a new machine and that the command we are verifying wants - // to create a new machine. The scheduling simulation doesn't apply any filtering to instance types, so it may include - // instance types that we don't want to launch which were filtered out when the lifecycleCommand was created. To - // check if our lifecycleCommand is valid, we just want to ensure that the list of instance types we are considering - // creating are a subset of what scheduling says we should create. We check for a subset since the scheduling - // simulation here does no price filtering, so it will include more expensive types. - // - // This is necessary since consolidation only wants cheaper machines. Suppose consolidation determined we should delete - // a 4xlarge and replace it with a 2xlarge. If things have changed and the scheduling simulation we just performed - // now says that we need to launch a 4xlarge. It's still launching the correct number of machines, but it's just - // as expensive or possibly more so we shouldn't validate. - if !instanceTypesAreSubset(cmd.replacements[0].InstanceTypeOptions, results.NewMachines[0].InstanceTypeOptions) { - return false, nil - } - - // Now we know: - // - current scheduling simulation says to create a new machine with types T = {T_0, T_1, ..., T_n} - // - our lifecycle command says to create a machine with types {U_0, U_1, ..., U_n} where U is a subset of T - return true, nil -} diff --git a/vendor/github.com/aws/karpenter-core/pkg/controllers/machine/disruption/controller.go b/vendor/github.com/aws/karpenter-core/pkg/controllers/machine/disruption/controller.go deleted file mode 100644 index 5221e657..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/controllers/machine/disruption/controller.go +++ /dev/null @@ -1,154 +0,0 @@ -/* -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. -*/ - -package disruption - -import ( - "context" - - "go.uber.org/multierr" - v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/equality" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/utils/clock" - controllerruntime "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/builder" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/controller" - "sigs.k8s.io/controller-runtime/pkg/event" - "sigs.k8s.io/controller-runtime/pkg/manager" - "sigs.k8s.io/controller-runtime/pkg/predicate" - "sigs.k8s.io/controller-runtime/pkg/reconcile" - "sigs.k8s.io/controller-runtime/pkg/source" - - "github.com/aws/karpenter-core/pkg/apis/v1alpha5" - "github.com/aws/karpenter-core/pkg/cloudprovider" - "github.com/aws/karpenter-core/pkg/controllers/state" - corecontroller "github.com/aws/karpenter-core/pkg/operator/controller" - machineutil "github.com/aws/karpenter-core/pkg/utils/machine" - "github.com/aws/karpenter-core/pkg/utils/result" - - "github.com/azure/gpu-provisioner/pkg/staticprovisioner" -) - -type machineReconciler interface { - Reconcile(context.Context, *v1alpha5.Provisioner, *v1alpha5.Machine) (reconcile.Result, error) -} - -var _ corecontroller.TypedController[*v1alpha5.Machine] = (*Controller)(nil) - -// Controller is a disruption controller that adds StatusConditions to Machines when they meet certain disruption conditions -// e.g. When the Machine has surpassed its owning provisioner's expirationTTL, then it is marked as "Expired" in the StatusConditions -type Controller struct { - kubeClient client.Client - - drift *Drift - expiration *Expiration - emptiness *Emptiness -} - -// NewController constructs a machine disruption controller -func NewController(clk clock.Clock, kubeClient client.Client, cluster *state.Cluster, cloudProvider cloudprovider.CloudProvider) corecontroller.Controller { - return corecontroller.Typed[*v1alpha5.Machine](kubeClient, &Controller{ - kubeClient: kubeClient, - drift: &Drift{cloudProvider: cloudProvider}, - expiration: &Expiration{kubeClient: kubeClient, clock: clk}, - emptiness: &Emptiness{kubeClient: kubeClient, cluster: cluster, clock: clk}, - }) -} - -func (c *Controller) Name() string { - return "machine.disruption" -} - -// Reconcile executes a control loop for the resource -func (c *Controller) Reconcile(ctx context.Context, machine *v1alpha5.Machine) (reconcile.Result, error) { - stored := machine.DeepCopy() - if _, ok := machine.Labels[v1alpha5.ProvisionerNameLabelKey]; !ok { - return reconcile.Result{}, nil - } - if !machine.DeletionTimestamp.IsZero() { - return reconcile.Result{}, nil - } - // provisioner := &v1alpha5.Provisioner{} - // if err := c.kubeClient.Get(ctx, types.NamespacedName{Name: machine.Labels[v1alpha5.ProvisionerNameLabelKey]}, provisioner); err != nil { - // return reconcile.Result{}, client.IgnoreNotFound(err) - // } - provisioner := staticprovisioner.Sp - - var results []reconcile.Result - var errs error - reconcilers := []machineReconciler{ - c.expiration, - c.drift, - c.emptiness, - } - for _, reconciler := range reconcilers { - res, err := reconciler.Reconcile(ctx, provisioner, machine) - errs = multierr.Append(errs, err) - results = append(results, res) - } - if !equality.Semantic.DeepEqual(stored, machine) { - if err := c.kubeClient.Status().Update(ctx, machine); err != nil { - if errors.IsConflict(err) { - return reconcile.Result{Requeue: true}, nil - } - return reconcile.Result{}, client.IgnoreNotFound(err) - } - } - return result.Min(results...), errs -} - -func (c *Controller) Builder(ctx context.Context, m manager.Manager) corecontroller.Builder { - return corecontroller.Adapt(controllerruntime. - NewControllerManagedBy(m). - For(&v1alpha5.Machine{}, builder.WithPredicates( - predicate.Or( - predicate.GenerationChangedPredicate{}, - predicate.Funcs{ - UpdateFunc: func(e event.UpdateEvent) bool { - oldMachine := e.ObjectOld.(*v1alpha5.Machine) - newMachine := e.ObjectNew.(*v1alpha5.Machine) - - // One of the status conditions that affects disruption has changed - // which means that we should re-consider this for disruption - for _, cond := range v1alpha5.LivingConditions { - if !equality.Semantic.DeepEqual( - oldMachine.StatusConditions().GetCondition(cond), - newMachine.StatusConditions().GetCondition(cond), - ) { - return true - } - } - return false - }, - }, - ), - )). - WithEventFilter(machineutil.KaitoMachinePredicate). - WithOptions(controller.Options{MaxConcurrentReconciles: 10}). - // Watches( - // &source.Kind{Type: &v1alpha5.Provisioner{}}, - // machineutil.ProvisionerEventHandler(ctx, c.kubeClient), - // ). - Watches( - &source.Kind{Type: &v1.Node{}}, - machineutil.NodeEventHandler(ctx, c.kubeClient), - ). - Watches( - &source.Kind{Type: &v1.Pod{}}, - machineutil.PodEventHandler(ctx, c.kubeClient), - ), - ) -} diff --git a/vendor/github.com/aws/karpenter-core/pkg/controllers/machine/disruption/drift.go b/vendor/github.com/aws/karpenter-core/pkg/controllers/machine/disruption/drift.go deleted file mode 100644 index 85331eae..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/controllers/machine/disruption/drift.go +++ /dev/null @@ -1,80 +0,0 @@ -/* -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. -*/ - -package disruption - -import ( - "context" - "fmt" - "time" - - v1 "k8s.io/api/core/v1" - "knative.dev/pkg/apis" - "knative.dev/pkg/logging" - "sigs.k8s.io/controller-runtime/pkg/reconcile" - - "github.com/aws/karpenter-core/pkg/apis/settings" - "github.com/aws/karpenter-core/pkg/apis/v1alpha5" - "github.com/aws/karpenter-core/pkg/cloudprovider" -) - -// Drift is a machine sub-controller that adds or removes status conditions on drifted machines -type Drift struct { - cloudProvider cloudprovider.CloudProvider -} - -func (d *Drift) Reconcile(ctx context.Context, _ *v1alpha5.Provisioner, machine *v1alpha5.Machine) (reconcile.Result, error) { - hasDriftedCondition := machine.StatusConditions().GetCondition(v1alpha5.MachineDrifted) != nil - - // From here there are three scenarios to handle: - // 1. If drift is not enabled but the machine is drifted, remove the status condition - if !settings.FromContext(ctx).DriftEnabled { - _ = machine.StatusConditions().ClearCondition(v1alpha5.MachineDrifted) - if hasDriftedCondition { - logging.FromContext(ctx).Debugf("removing drift status condition from machine as drift has been disabled") - } - return reconcile.Result{}, nil - } - // 2. If Machine is not launched, remove the drift status condition - if launchCond := machine.StatusConditions().GetCondition(v1alpha5.MachineLaunched); launchCond == nil || launchCond.IsFalse() { - _ = machine.StatusConditions().ClearCondition(v1alpha5.MachineDrifted) - if hasDriftedCondition { - logging.FromContext(ctx).Debugf("removing drift status condition from machine as machine isn't launched") - } - return reconcile.Result{}, nil - } - drifted, err := d.cloudProvider.IsMachineDrifted(ctx, machine) - if err != nil { - return reconcile.Result{}, cloudprovider.IgnoreMachineNotFoundError(fmt.Errorf("getting drift for machine, %w", err)) - } - // 3. Otherwise, if the machine isn't drifted, but has the status condition, remove it. - if !drifted { - _ = machine.StatusConditions().ClearCondition(v1alpha5.MachineDrifted) - if hasDriftedCondition { - logging.FromContext(ctx).Debugf("removing drifted status condition from machine") - } - return reconcile.Result{RequeueAfter: 5 * time.Minute}, nil - } - // 4. Finally, if the machine is drifted, but doesn't have status condition, add it. - machine.StatusConditions().SetCondition(apis.Condition{ - Type: v1alpha5.MachineDrifted, - Status: v1.ConditionTrue, - Severity: apis.ConditionSeverityWarning, - }) - if !hasDriftedCondition { - logging.FromContext(ctx).Debugf("marking machine as drifted") - } - // Requeue after 5 minutes for the cache TTL - return reconcile.Result{RequeueAfter: 5 * time.Minute}, nil -} diff --git a/vendor/github.com/aws/karpenter-core/pkg/controllers/machine/disruption/emptiness.go b/vendor/github.com/aws/karpenter-core/pkg/controllers/machine/disruption/emptiness.go deleted file mode 100644 index 06e983da..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/controllers/machine/disruption/emptiness.go +++ /dev/null @@ -1,109 +0,0 @@ -/* -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. -*/ - -package disruption - -import ( - "context" - "fmt" - "time" - - v1 "k8s.io/api/core/v1" - "k8s.io/utils/clock" - "knative.dev/pkg/apis" - "knative.dev/pkg/logging" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/reconcile" - - "github.com/aws/karpenter-core/pkg/apis/v1alpha5" - "github.com/aws/karpenter-core/pkg/controllers/state" - machineutil "github.com/aws/karpenter-core/pkg/utils/machine" - "github.com/aws/karpenter-core/pkg/utils/node" -) - -// Emptiness is a machine sub-controller that adds or removes status conditions on empty machines based on TTLSecondsAfterEmpty -type Emptiness struct { - kubeClient client.Client - cluster *state.Cluster - clock clock.Clock -} - -//nolint:gocyclo -func (e *Emptiness) Reconcile(ctx context.Context, provisioner *v1alpha5.Provisioner, machine *v1alpha5.Machine) (reconcile.Result, error) { - hasEmptyCondition := machine.StatusConditions().GetCondition(v1alpha5.MachineEmpty) != nil - - // From here there are three scenarios to handle: - // 1. If TTLSecondsAfterEmpty is not configured, remove the emptiness status condition - if provisioner.Spec.TTLSecondsAfterEmpty == nil { - if hasEmptyCondition { - _ = machine.StatusConditions().ClearCondition(v1alpha5.MachineEmpty) - logging.FromContext(ctx).Debugf("removing emptiness status condition from machine since emptiness is disabled") - } - return reconcile.Result{}, nil - } - // 2. If Machine is not initialized, remove the emptiness status condition - if initCond := machine.StatusConditions().GetCondition(v1alpha5.MachineInitialized); initCond == nil || initCond.IsFalse() { - if hasEmptyCondition { - _ = machine.StatusConditions().ClearCondition(v1alpha5.MachineEmpty) - logging.FromContext(ctx).Debugf("removing emptiness status condition from machine since machine isn't initialized") - } - return reconcile.Result{}, nil - } - // Get the node to check for pods scheduled to it - n, err := machineutil.NodeForMachine(ctx, e.kubeClient, machine) - if err != nil { - // 3. If Machine -> Node mapping doesn't exist, remove the emptiness status condition - if machineutil.IsDuplicateNodeError(err) || machineutil.IsNodeNotFoundError(err) { - _ = machine.StatusConditions().ClearCondition(v1alpha5.MachineEmpty) - if hasEmptyCondition { - logging.FromContext(ctx).Debugf("removing emptiness status condition from machine since machine doesn't have a single node mapping") - } - return reconcile.Result{}, nil - } - return reconcile.Result{}, err - } - // Node is empty, but it is in-use per the last scheduling round, so we don't consider it empty - // We perform a short requeue if the node is nominated, so we can check the node for emptiness when the node - // nomination time ends since we don't watch node nomination events - // 4. If the Node is nominated for pods to schedule to it, remove the emptiness status condition - if e.cluster.IsNodeNominated(n.Name) { - _ = machine.StatusConditions().ClearCondition(v1alpha5.MachineEmpty) - if hasEmptyCondition { - logging.FromContext(ctx).Debugf("removing emptiness status condition from machine since machine is nominated for pods") - } - return reconcile.Result{RequeueAfter: time.Second * 30}, nil - } - pods, err := node.GetNodePods(ctx, e.kubeClient, n) - if err != nil { - return reconcile.Result{}, fmt.Errorf("retrieving node pods, %w", err) - } - // 5. If there are pods that are actively scheduled to the Node, remove the emptiness status condition - if len(pods) > 0 { - _ = machine.StatusConditions().ClearCondition(v1alpha5.MachineEmpty) - if hasEmptyCondition { - logging.FromContext(ctx).Debugf("removing emptiness status condition from node") - } - return reconcile.Result{}, nil - } - // 6. Otherwise, add the emptiness status condition - machine.StatusConditions().SetCondition(apis.Condition{ - Type: v1alpha5.MachineEmpty, - Status: v1.ConditionTrue, - Severity: apis.ConditionSeverityWarning, - }) - if !hasEmptyCondition { - logging.FromContext(ctx).Debugf("marking machine as empty") - } - return reconcile.Result{}, nil -} diff --git a/vendor/github.com/aws/karpenter-core/pkg/controllers/machine/disruption/expiration.go b/vendor/github.com/aws/karpenter-core/pkg/controllers/machine/disruption/expiration.go deleted file mode 100644 index 2ec673a6..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/controllers/machine/disruption/expiration.go +++ /dev/null @@ -1,89 +0,0 @@ -/* -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. -*/ - -package disruption - -import ( - "context" - "time" - - v1 "k8s.io/api/core/v1" - "k8s.io/utils/clock" - "knative.dev/pkg/apis" - "knative.dev/pkg/logging" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/reconcile" - - "github.com/aws/karpenter-core/pkg/apis/v1alpha5" - machineutil "github.com/aws/karpenter-core/pkg/utils/machine" -) - -// Expiration is a machine sub-controller that adds or removes status conditions on expired machines based on TTLSecondsUntilExpired -type Expiration struct { - kubeClient client.Client - clock clock.Clock -} - -//nolint:gocyclo -func (e *Expiration) Reconcile(ctx context.Context, provisioner *v1alpha5.Provisioner, machine *v1alpha5.Machine) (reconcile.Result, error) { - hasExpiredCondition := machine.StatusConditions().GetCondition(v1alpha5.MachineExpired) != nil - - // From here there are three scenarios to handle: - // 1. If TTLSecondsUntilExpired is not configured, remove the expired status condition - if provisioner.Spec.TTLSecondsUntilExpired == nil { - _ = machine.StatusConditions().ClearCondition(v1alpha5.MachineExpired) - if hasExpiredCondition { - logging.FromContext(ctx).Debugf("removing expiration status condition from machine as expiration has been disabled") - } - return reconcile.Result{}, nil - } - node, err := machineutil.NodeForMachine(ctx, e.kubeClient, machine) - if machineutil.IgnoreNodeNotFoundError(machineutil.IgnoreDuplicateNodeError(err)) != nil { - return reconcile.Result{}, err - } - // We do the expiration check in this way since there is still a migration path for creating Machines from Nodes - // In this case, we need to make sure that we take the older of the two for expiration - // TODO @joinnis: This check that takes the minimum between the Node and Machine CreationTimestamps can be removed - // once machine migration is ripped out, which should happen when apis and Karpenter are promoted to v1 - var expired bool - var expirationTime time.Time - if node == nil || machine.CreationTimestamp.Before(&node.CreationTimestamp) { - expired = machineutil.IsExpired(machine, e.clock, provisioner) - expirationTime = machineutil.GetExpirationTime(machine, provisioner) - } else { - expired = machineutil.IsExpired(node, e.clock, provisioner) - expirationTime = machineutil.GetExpirationTime(machine, provisioner) - } - // 2. If the machine isn't expired, remove the status condition. - if !expired { - _ = machine.StatusConditions().ClearCondition(v1alpha5.MachineExpired) - if hasExpiredCondition { - logging.FromContext(ctx).Debugf("removing expired status condition from machine") - } - // If the machine isn't expired and doesn't have the status condition, return. - // Use t.Sub(clock.Now()) instead of time.Until() to ensure we're using the injected clock. - return reconcile.Result{RequeueAfter: expirationTime.Sub(e.clock.Now())}, nil - } - // 3. Otherwise, if the machine is expired, but doesn't have the status condition, add it. - machine.StatusConditions().SetCondition(apis.Condition{ - Type: v1alpha5.MachineExpired, - Status: v1.ConditionTrue, - Severity: apis.ConditionSeverityWarning, - }) - if !hasExpiredCondition { - logging.FromContext(ctx).Debugf("marking machine as expired") - } - - return reconcile.Result{}, nil -} diff --git a/vendor/github.com/aws/karpenter-core/pkg/controllers/machine/garbagecollection/controller.go b/vendor/github.com/aws/karpenter-core/pkg/controllers/machine/garbagecollection/controller.go deleted file mode 100644 index 809d6494..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/controllers/machine/garbagecollection/controller.go +++ /dev/null @@ -1,345 +0,0 @@ -/* -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. -*/ - -package garbagecollection - -import ( - "context" - "fmt" - "sync/atomic" - "time" - - "github.com/prometheus/client_golang/prometheus" - "github.com/samber/lo" - "go.uber.org/multierr" - v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/equality" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/client-go/util/workqueue" - "k8s.io/utils/clock" - "knative.dev/pkg/logging" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" - "sigs.k8s.io/controller-runtime/pkg/manager" - "sigs.k8s.io/controller-runtime/pkg/reconcile" - - "github.com/aws/karpenter-core/pkg/apis/v1alpha5" - "github.com/aws/karpenter-core/pkg/cloudprovider" - "github.com/aws/karpenter-core/pkg/metrics" - corecontroller "github.com/aws/karpenter-core/pkg/operator/controller" - "github.com/aws/karpenter-core/pkg/utils/sets" -) - -const ( - NodeHeartBeatAnnotationKey = "NodeHeartBeatTimeStamp" -) - -var ( - KaitoMachineLabels = []string{"kaito.sh/workspace", "kaito.sh/ragengine"} -) - -type Controller struct { - clock clock.Clock - kubeClient client.Client - cloudProvider cloudprovider.CloudProvider -} - -func NewController(c clock.Clock, kubeClient client.Client, cloudProvider cloudprovider.CloudProvider) corecontroller.Controller { - return &Controller{ - clock: c, - kubeClient: kubeClient, - cloudProvider: cloudProvider, - } -} - -func (c *Controller) Name() string { - return "machine.garbagecollection" -} - -func (c *Controller) Reconcile(ctx context.Context, _ reconcile.Request) (reconcile.Result, error) { - merr := c.reconcileMachines(ctx) - nerr := c.reconcileNodes(ctx) - cerr := c.reconcileCloudProviderInstances(ctx) - - return reconcile.Result{RequeueAfter: time.Minute * 2}, multierr.Combine(merr, nerr, cerr) -} - -// gpu-provisioner: node name conflict means two machines are linked to the same node. -// AKS APIs only support PUT not POST for creating a new agent pool. The name conflict during -// creation will not return error. The latest create call will update the agent pool unconditionally. -// We cannot completlely avoid the conflict. -// But since we use machine name as agent pool name, the chance of hitting agent pool name conflict is very low. -// We rely on periodic checks to remediate the conflict if any. -func (c *Controller) remediateNodeNameConflict(ctx context.Context) error { - machineList1 := &v1alpha5.MachineList{} - if err := c.kubeClient.List(ctx, machineList1, client.HasLabels([]string{"kaito.sh/workspace"})); err != nil { - return err - } - machineList2 := &v1alpha5.MachineList{} - if err := c.kubeClient.List(ctx, machineList2, client.HasLabels([]string{"kaito.sh/ragengine"})); err != nil { - return err - } - - machineListCombined := append(machineList1.Items, machineList2.Items...) - nodeToMachineMap := make(map[string][]*v1alpha5.Machine) - - for i, _ := range machineListCombined { - if node, linked := machineListCombined[i].Annotations[v1alpha5.MachineLinkedAnnotationKey]; linked { - if _, ok := nodeToMachineMap[node]; !ok { - nodeToMachineMap[node] = []*v1alpha5.Machine{&machineListCombined[i]} - } else { - nodeToMachineMap[node] = append(nodeToMachineMap[node], &machineListCombined[i]) - } - } - } - - for _, v := range nodeToMachineMap { - // Detect node name conflict, the remediation is to remove extra machines. - if len(v) > 1 { - // There is no particular order to decide which ones should be deleted. - for i := 1; i < len(v); i++ { - stored := v[i].DeepCopy() - updated := v[i].DeepCopy() - updated.Annotations[v1alpha5.MachineLinkedAnnotationKey] = "" - updated.Status.ProviderID = "" - controllerutil.RemoveFinalizer(updated, v1alpha5.TerminationFinalizer) - - updatedCopy := updated.DeepCopy() - if err := c.kubeClient.Patch(ctx, updated, client.MergeFrom(stored)); client.IgnoreNotFound(err) != nil { - return err - } - if err := c.kubeClient.Status().Patch(ctx, updatedCopy, client.MergeFrom(stored)); client.IgnoreNotFound(err) != nil { - return err - } - // After clear the provider id, we are safe to delete the machine. - if err := c.kubeClient.Delete(ctx, stored); client.IgnoreNotFound(err) != nil { - return err - } - logging.FromContext(ctx).Debugf("delete machine %s because it has a node name conflict with machine %s", v[i].Name, v[0].Name) - } - } - } - return nil -} - -func (c *Controller) reconcileNodes(ctx context.Context) error { - nodeList := &v1.NodeList{} - if err := c.kubeClient.List(ctx, nodeList); err != nil { - return err - } - - kaitoMachines, err := c.ListAllKaitoMachines(ctx) - if err != nil { - return err - } - - machineNames := sets.New[string](lo.FilterMap(kaitoMachines, func(m v1alpha5.Machine, _ int) (string, bool) { - return m.Name, true - })...) - - deletedGarbageNodes := lo.Filter(lo.ToSlicePtr(nodeList.Items), func(n *v1.Node, _ int) bool { - _, ok := n.Labels[v1alpha5.ProvisionerNameLabelKey] - if ok && n.Spec.ProviderID != "" { - // We rely on a strong assumption here: the machine name is equal to the agent pool name. - machine := n.Labels["kubernetes.azure.com/agentpool"] - if !machineNames.Has(machine) { - return true - } - } - return false - }) - - errs := make([]error, len(deletedGarbageNodes)) - workqueue.ParallelizeUntil(ctx, 20, len(deletedGarbageNodes), func(i int) { - // We delete nodes to trigger the node finalization and deletion flow. - if err := c.kubeClient.Delete(ctx, deletedGarbageNodes[i]); client.IgnoreNotFound(err) != nil { - errs[i] = err - return - } - logging.FromContext(ctx).Debugf("garbage collecting node %s since the linked machine does not exist", deletedGarbageNodes[i].Name) - }) - return multierr.Combine(errs...) -} - -// gpu-provisioner: leverage the two minutes perodic check to update machine readiness heartbeat. -func (c *Controller) reconcileMachines(ctx context.Context) error { - kaitoMachines, err := c.ListAllKaitoMachines(ctx) - if err != nil { - return err - } - - // The NotReady nodes are excluded from the list. - cloudProviderMachines, err := c.cloudProvider.List(ctx) - if err != nil { - return err - } - cloudProviderMachines = lo.Filter(cloudProviderMachines, func(m *v1alpha5.Machine, _ int) bool { - return m.DeletionTimestamp.IsZero() - }) - cloudProviderProviderIDs := sets.New[string](lo.FilterMap(cloudProviderMachines, func(m *v1alpha5.Machine, _ int) (string, bool) { - // skip leaked cloudporiver instances - if len(m.Status.ProviderID) == 0 { - return "", false - } - - return m.Status.ProviderID, true - })...) - - deletedGarbageMachines := lo.Filter(lo.ToSlicePtr(kaitoMachines), func(m *v1alpha5.Machine, _ int) bool { - // The assumption is that any clean up work should be done in 10 minutes. - // The node gc will cover any problems caused by this force deletion. - return !m.DeletionTimestamp.IsZero() && metav1.Now().After((*m.DeletionTimestamp).Add(time.Minute*10)) - }) - - rfErrs := c.batchDeleteMachines(ctx, deletedGarbageMachines, true, "to be delete but blocked by finializer for more than 10 minutes") - - // Check all machine heartbeats. - hbMachines := lo.Filter(lo.ToSlicePtr(kaitoMachines), func(m *v1alpha5.Machine, _ int) bool { - return m.StatusConditions().GetCondition(v1alpha5.MachineLaunched).IsTrue() && - m.DeletionTimestamp.IsZero() - }) - - var hbUpdated atomic.Uint64 - deletedNotReadyMachines := []*v1alpha5.Machine{} - // Update machine heartbeat. - hbErrs := make([]error, len(hbMachines)) - workqueue.ParallelizeUntil(ctx, 20, len(hbMachines), func(i int) { - stored := hbMachines[i].DeepCopy() - updated := hbMachines[i].DeepCopy() - - if cloudProviderProviderIDs.Has(stored.Status.ProviderID) { - hbUpdated.Add(1) - if updated.Annotations == nil { - updated.Annotations = make(map[string]string) - } - - timeStr, _ := metav1.NewTime(time.Now()).MarshalJSON() - updated.Annotations[NodeHeartBeatAnnotationKey] = string(timeStr) - - // If the machine was not ready, it becomes ready after getting the heartbeat. - updated.StatusConditions().MarkTrue("Ready") - } else { - logging.FromContext(ctx).Debugf(fmt.Sprintf("machine %s does not receive hb", stored.Name)) - updated.StatusConditions().MarkFalse("Ready", "NodeNotReady", "Node status is NotReady") - } - statusCopy := updated.DeepCopy() - updateCopy := updated.DeepCopy() - if err := c.kubeClient.Patch(ctx, updated, client.MergeFrom(stored)); err != nil { - hbErrs[i] = client.IgnoreNotFound(err) - return - } - if err := c.kubeClient.Status().Patch(ctx, statusCopy, client.MergeFrom(stored)); err != nil { - hbErrs[i] = client.IgnoreNotFound(err) - return - } - if !updateCopy.StatusConditions().IsHappy() && - c.clock.Since(updateCopy.StatusConditions().GetCondition("Ready").LastTransitionTime.Inner.Time) > time.Minute*10 { - deletedNotReadyMachines = append(deletedNotReadyMachines, updateCopy) - } - }) - if len(hbMachines) > 0 { - logging.FromContext(ctx).Debugf(fmt.Sprintf("Update heartbeat for %d out of %d machines", hbUpdated.Load(), len(hbMachines))) - } - errs := c.batchDeleteMachines(ctx, deletedNotReadyMachines, false, "being NotReady for more than 10 minutes") - errs = append(errs, hbErrs...) - errs = append(errs, rfErrs...) - return multierr.Combine(errs...) -} - -// reconcileCloudProviderInstances is used to garbage leaked cloudprovider isntances. -func (c *Controller) reconcileCloudProviderInstances(ctx context.Context) error { - kaitoMachines, err := c.ListAllKaitoMachines(ctx) - if err != nil { - return err - } - - currentMachineNames := sets.New[string](lo.FilterMap(kaitoMachines, func(m v1alpha5.Machine, _ int) (string, bool) { - return m.Name, true - })...) - - // list all agentpools for garbaging leaked ones. - cloudProviderInstances, err := c.cloudProvider.List(ctx) - if err != nil { - return err - } - - cloudProviderInstancesWithoutNodes := lo.Filter(cloudProviderInstances, func(m *v1alpha5.Machine, _ int) bool { - // skip cloudporiver instances that have associated nodes - return len(m.Status.ProviderID) == 0 - }) - - deletedCloudProviderInstances := lo.Filter(cloudProviderInstancesWithoutNodes, func(m *v1alpha5.Machine, _ int) bool { - // cloudProviderInstance has no associated node and Machines, this Instance is a leaked one. - return !currentMachineNames.Has(m.Name) - }) - logging.FromContext(ctx).Infof("currentMachineNames=%v, cloudprovider instances: total count=%d, leaked count=%d", currentMachineNames.List(), len(cloudProviderInstances), len(deletedCloudProviderInstances)) - - errs := make([]error, len(deletedCloudProviderInstances)) - workqueue.ParallelizeUntil(ctx, 20, len(deletedCloudProviderInstances), func(i int) { - if err := c.cloudProvider.Delete(ctx, deletedCloudProviderInstances[i]); err != nil { - logging.FromContext(ctx).Infof("failed to delete leaked cloudprovider machine(%s), %v", deletedCloudProviderInstances[i].Name, err) - errs[i] = err - return - } - logging.FromContext(ctx).Infof("delete leaked cloudprovider machine: %s successfully", deletedCloudProviderInstances[i].Name) - }) - - return multierr.Combine(errs...) -} - -func (c *Controller) batchDeleteMachines(ctx context.Context, machines []*v1alpha5.Machine, removeFinalizer bool, msg string) []error { - errs := make([]error, len(machines)) - workqueue.ParallelizeUntil(ctx, 20, len(machines), func(i int) { - if removeFinalizer { - stored := machines[i].DeepCopy() - updated := machines[i].DeepCopy() - controllerutil.RemoveFinalizer(updated, v1alpha5.TerminationFinalizer) - if !equality.Semantic.DeepEqual(stored, updated) { - if err := c.kubeClient.Patch(ctx, updated, client.MergeFrom(stored)); client.IgnoreNotFound(err) != nil { - errs[i] = err - return - } - } - } else if err := c.kubeClient.Delete(ctx, machines[i]); client.IgnoreNotFound(err) != nil { - errs[i] = err - return - } - logging.FromContext(ctx). - With("provisioner", machines[i].Labels[v1alpha5.ProvisionerNameLabelKey], "machine", machines[i].Name, "provider-id", machines[i].Status.ProviderID). - Debugf("garbage collecting machine with reason: %s", msg) - metrics.MachinesTerminatedCounter.With(prometheus.Labels{ - metrics.ReasonLabel: "garbage_collected", - metrics.ProvisionerLabel: machines[i].Labels[v1alpha5.ProvisionerNameLabelKey], - }).Inc() - }) - return errs -} - -func (c *Controller) ListAllKaitoMachines(ctx context.Context) ([]v1alpha5.Machine, error) { - kaitoMachines := make([]v1alpha5.Machine, 0) - - for i := range KaitoMachineLabels { - machineList := &v1alpha5.MachineList{} - if err := c.kubeClient.List(ctx, machineList, client.HasLabels([]string{KaitoMachineLabels[i]})); err != nil { - return kaitoMachines, err - } - - kaitoMachines = append(kaitoMachines, machineList.Items...) - } - return kaitoMachines, nil -} - -func (c *Controller) Builder(_ context.Context, m manager.Manager) corecontroller.Builder { - return corecontroller.NewSingletonManagedBy(m) -} diff --git a/vendor/github.com/aws/karpenter-core/pkg/controllers/machine/lifecycle/initialization.go b/vendor/github.com/aws/karpenter-core/pkg/controllers/machine/lifecycle/initialization.go deleted file mode 100644 index ccc2b428..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/controllers/machine/lifecycle/initialization.go +++ /dev/null @@ -1,147 +0,0 @@ -/* -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. -*/ - -package lifecycle - -import ( - "context" - "fmt" - - "github.com/prometheus/client_golang/prometheus" - "github.com/samber/lo" - v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/equality" - "knative.dev/pkg/logging" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/reconcile" - - "github.com/aws/karpenter-core/pkg/apis/v1alpha5" - "github.com/aws/karpenter-core/pkg/metrics" - "github.com/aws/karpenter-core/pkg/scheduling" - machineutil "github.com/aws/karpenter-core/pkg/utils/machine" - nodeutil "github.com/aws/karpenter-core/pkg/utils/node" - "github.com/aws/karpenter-core/pkg/utils/resources" -) - -type Initialization struct { - kubeClient client.Client -} - -// Reconcile checks for initialization based on if: -// a) its current status is set to Ready -// b) all the startup taints have been removed from the node -// c) all extended resources have been registered -// This method handles both nil provisioners and nodes without extended resources gracefully. -func (i *Initialization) Reconcile(ctx context.Context, machine *v1alpha5.Machine) (reconcile.Result, error) { - if machine.StatusConditions().GetCondition(v1alpha5.MachineInitialized).IsTrue() { - return reconcile.Result{}, nil - } - if !machine.StatusConditions().GetCondition(v1alpha5.MachineLaunched).IsTrue() { - machine.StatusConditions().MarkFalse(v1alpha5.MachineInitialized, "MachineNotLaunched", "Machine is not launched") - return reconcile.Result{}, nil - } - ctx = logging.WithLogger(ctx, logging.FromContext(ctx).With("provider-id", machine.Status.ProviderID)) - node, err := machineutil.NodeForMachine(ctx, i.kubeClient, machine) - if err != nil { - machine.StatusConditions().MarkFalse(v1alpha5.MachineInitialized, "NodeNotFound", "Node not registered with cluster") - return reconcile.Result{}, nil //nolint:nilerr - } - ctx = logging.WithLogger(ctx, logging.FromContext(ctx).With("node", node.Name)) - if nodeutil.GetCondition(node, v1.NodeReady).Status != v1.ConditionTrue { - machine.StatusConditions().MarkFalse(v1alpha5.MachineInitialized, "NodeNotReady", "Node status is NotReady") - return reconcile.Result{}, nil - } - if taint, ok := StartupTaintsRemoved(node, machine); !ok { - machine.StatusConditions().MarkFalse(v1alpha5.MachineInitialized, "StartupTaintsExist", "StartupTaint %q still exists", formatTaint(taint)) - return reconcile.Result{}, nil - } - if taint, ok := KnownEphemeralTaintsRemoved(node); !ok { - machine.StatusConditions().MarkFalse(v1alpha5.MachineInitialized, "KnownEphemeralTaintsExist", "KnownEphemeralTaint %q still exists", formatTaint(taint)) - return reconcile.Result{}, nil - } - if name, ok := RequestedResourcesRegistered(node, machine); !ok { - machine.StatusConditions().MarkFalse(v1alpha5.MachineInitialized, "ResourceNotRegistered", "Resource %q was requested but not registered", name) - return reconcile.Result{}, nil - } - stored := node.DeepCopy() - node.Labels = lo.Assign(node.Labels, map[string]string{v1alpha5.LabelNodeInitialized: "true"}) - if !equality.Semantic.DeepEqual(stored, node) { - if err = i.kubeClient.Patch(ctx, node, client.MergeFrom(stored)); err != nil { - return reconcile.Result{}, err - } - } - logging.FromContext(ctx).Debugf("initialized machine") - machine.StatusConditions().MarkTrue(v1alpha5.MachineInitialized) - metrics.MachinesInitializedCounter.With(prometheus.Labels{ - metrics.ProvisionerLabel: machine.Labels[v1alpha5.ProvisionerNameLabelKey], - }).Inc() - return reconcile.Result{}, nil -} - -// KnownEphemeralTaintsRemoved validates whether all the ephemeral taints are removed -func KnownEphemeralTaintsRemoved(node *v1.Node) (*v1.Taint, bool) { - for _, knownTaint := range scheduling.KnownEphemeralTaints { - // if the node still has a known ephemeral taint applied, it's not ready - for i := range node.Spec.Taints { - if knownTaint.MatchTaint(&node.Spec.Taints[i]) { - return &node.Spec.Taints[i], false - } - } - } - return nil, true -} - -// StartupTaintsRemoved returns true if there are no startup taints registered for the provisioner, or if all startup -// taints have been removed from the node -func StartupTaintsRemoved(node *v1.Node, machine *v1alpha5.Machine) (*v1.Taint, bool) { - if machine != nil { - for _, startupTaint := range machine.Spec.StartupTaints { - for i := range node.Spec.Taints { - // if the node still has a startup taint applied, it's not ready - if startupTaint.MatchTaint(&node.Spec.Taints[i]) { - return &node.Spec.Taints[i], false - } - } - } - } - return nil, true -} - -// RequestedResourcesRegistered returns true if there are no extended resources on the node, or they have all been -// registered by device plugins -func RequestedResourcesRegistered(node *v1.Node, machine *v1alpha5.Machine) (v1.ResourceName, bool) { - for resourceName, quantity := range machine.Spec.Resources.Requests { - if quantity.IsZero() { - continue - } - // kubelet will zero out both the capacity and allocatable for an extended resource on startup, so if our - // annotation says the resource should be there, but it's zero'd in both then the device plugin hasn't - // registered it yet. - // We wait on allocatable since this is the value that is used in scheduling - if resourceName != v1.ResourceStorage && resources.IsZero(node.Status.Allocatable[resourceName]) { - return resourceName, false - } - } - return "", true -} - -func formatTaint(taint *v1.Taint) string { - if taint == nil { - return "" - } - if taint.Value == "" { - return fmt.Sprintf("%s:%s", taint.Key, taint.Effect) - } - return fmt.Sprintf("%s=%s:%s", taint.Key, taint.Value, taint.Effect) -} diff --git a/vendor/github.com/aws/karpenter-core/pkg/controllers/machine/lifecycle/launch.go b/vendor/github.com/aws/karpenter-core/pkg/controllers/machine/lifecycle/launch.go deleted file mode 100644 index 2d33a949..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/controllers/machine/lifecycle/launch.go +++ /dev/null @@ -1,159 +0,0 @@ -/* -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. -*/ - -package lifecycle - -import ( - "context" - "fmt" - - "github.com/patrickmn/go-cache" - "github.com/prometheus/client_golang/prometheus" - "github.com/samber/lo" - v1 "k8s.io/api/core/v1" - "knative.dev/pkg/logging" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/reconcile" - - "github.com/aws/karpenter-core/pkg/apis/v1alpha5" - "github.com/aws/karpenter-core/pkg/cloudprovider" - "github.com/aws/karpenter-core/pkg/events" - "github.com/aws/karpenter-core/pkg/metrics" - "github.com/aws/karpenter-core/pkg/scheduling" -) - -type Launch struct { - kubeClient client.Client - cloudProvider cloudprovider.CloudProvider - cache *cache.Cache // exists due to eventual consistency on the cache - recorder events.Recorder -} - -func (l *Launch) Reconcile(ctx context.Context, machine *v1alpha5.Machine) (reconcile.Result, error) { - if machine.StatusConditions().GetCondition(v1alpha5.MachineLaunched).IsTrue() { - return reconcile.Result{}, nil - } - - var err error - var created *v1alpha5.Machine - - // One of the following scenarios can happen with a Machine that isn't marked as launched: - // 1. It was already launched by the CloudProvider but the client-go cache wasn't updated quickly enough or - // patching failed on the status. In this case, we use the in-memory cached value for the created machine. - // 2. It is a "linked" machine, which implies that the CloudProvider Machine already exists for the Machine CR, but we - // need to grab info from the CloudProvider to get details on the machine. - // 3. It is a standard machine launch where we should call CloudProvider Create() and fill in details of the launched - // machine into the Machine CR. - if ret, ok := l.cache.Get(string(machine.UID)); ok { - created = ret.(*v1alpha5.Machine) - } else if _, ok := machine.Annotations[v1alpha5.MachineLinkedAnnotationKey]; ok { - created, err = l.linkMachine(ctx, machine) - } else { - created, err = l.launchMachine(ctx, machine) - } - // Either the machine launch/linking failed or the machine was deleted due to InsufficientCapacity/NotFound - if err != nil || created == nil { - return reconcile.Result{}, err - } - l.cache.SetDefault(string(machine.UID), created) - PopulateMachineDetails(machine, created) - machine.StatusConditions().MarkTrue(v1alpha5.MachineLaunched) - metrics.MachinesLaunchedCounter.With(prometheus.Labels{ - metrics.ProvisionerLabel: machine.Labels[v1alpha5.ProvisionerNameLabelKey], - }).Inc() - return reconcile.Result{}, nil -} - -func (l *Launch) linkMachine(ctx context.Context, machine *v1alpha5.Machine) (*v1alpha5.Machine, error) { - ctx = logging.WithLogger(ctx, logging.FromContext(ctx).With("provider-id", machine.Annotations[v1alpha5.MachineLinkedAnnotationKey])) - created, err := l.cloudProvider.Get(ctx, machine.Annotations[v1alpha5.MachineLinkedAnnotationKey]) - if err != nil { - if !cloudprovider.IsMachineNotFoundError(err) { - machine.StatusConditions().MarkFalse(v1alpha5.MachineLaunched, "LinkFailed", truncateMessage(err.Error())) - return nil, fmt.Errorf("linking machine, %w", err) - } - if err = l.kubeClient.Delete(ctx, machine); err != nil { - return nil, client.IgnoreNotFound(err) - } - logging.FromContext(ctx).Debugf("garbage collected machine with no cloudprovider representation") - metrics.MachinesTerminatedCounter.With(prometheus.Labels{ - metrics.ReasonLabel: "garbage_collected", - metrics.ProvisionerLabel: machine.Labels[v1alpha5.ProvisionerNameLabelKey], - }).Inc() - return nil, nil - } - logging.FromContext(ctx).With( - "provider-id", created.Status.ProviderID, - "instance-type", created.Labels[v1.LabelInstanceTypeStable], - "zone", created.Labels[v1.LabelTopologyZone], - "capacity-type", created.Labels[v1alpha5.LabelCapacityType], - "allocatable", created.Status.Allocatable).Infof("linked machine") - return created, nil -} - -func (l *Launch) launchMachine(ctx context.Context, machine *v1alpha5.Machine) (*v1alpha5.Machine, error) { - created, err := l.cloudProvider.Create(ctx, machine) - if err != nil { - switch { - case cloudprovider.IsInsufficientCapacityError(err): - l.recorder.Publish(events.Event{ - InvolvedObject: machine, - Type: v1.EventTypeWarning, - Reason: "InsufficientCapacityError", - Message: fmt.Sprintf("Machine %s event: %s", machine.Name, err), - DedupeValues: []string{machine.Name}, - }) - logging.FromContext(ctx).Error(err) - if err = l.kubeClient.Delete(ctx, machine); err != nil { - return nil, client.IgnoreNotFound(err) - } - metrics.MachinesTerminatedCounter.With(prometheus.Labels{ - metrics.ReasonLabel: "insufficient_capacity", - metrics.ProvisionerLabel: machine.Labels[v1alpha5.ProvisionerNameLabelKey], - }).Inc() - return nil, nil - default: - machine.StatusConditions().MarkFalse(v1alpha5.MachineLaunched, "LaunchFailed", truncateMessage(err.Error())) - return nil, fmt.Errorf("creating machine, %w", err) - } - } - logging.FromContext(ctx).With( - "provider-id", created.Status.ProviderID, - "instance-type", created.Labels[v1.LabelInstanceTypeStable], - "zone", created.Labels[v1.LabelTopologyZone], - "capacity-type", created.Labels[v1alpha5.LabelCapacityType], - "allocatable", created.Status.Allocatable).Infof("launched machine") - return created, nil -} - -func PopulateMachineDetails(machine, retrieved *v1alpha5.Machine) { - // These are ordered in priority order so that user-defined machine labels and requirements trump retrieved labels - // or the static machine labels - machine.Labels = lo.Assign( - retrieved.Labels, // CloudProvider-resolved labels - scheduling.NewNodeSelectorRequirements(machine.Spec.Requirements...).Labels(), // Single-value requirement resolved labels - machine.Labels, // User-defined labels - ) - machine.Annotations = lo.Assign(machine.Annotations, retrieved.Annotations) - machine.Status.ProviderID = retrieved.Status.ProviderID - machine.Status.Allocatable = retrieved.Status.Allocatable - machine.Status.Capacity = retrieved.Status.Capacity -} - -func truncateMessage(msg string) string { - if len(msg) < 800 { - return msg - } - return msg[:800] + "..." -} diff --git a/vendor/github.com/aws/karpenter-core/pkg/controllers/machine/lifecycle/registration.go b/vendor/github.com/aws/karpenter-core/pkg/controllers/machine/lifecycle/registration.go deleted file mode 100644 index f1585085..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/controllers/machine/lifecycle/registration.go +++ /dev/null @@ -1,142 +0,0 @@ -/* -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. -*/ - -package lifecycle - -import ( - "context" - "fmt" - - "github.com/prometheus/client_golang/prometheus" - "github.com/samber/lo" - v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/equality" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "knative.dev/pkg/logging" - "knative.dev/pkg/ptr" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" - "sigs.k8s.io/controller-runtime/pkg/reconcile" - - "github.com/aws/karpenter-core/pkg/apis/v1alpha5" - "github.com/aws/karpenter-core/pkg/metrics" - "github.com/aws/karpenter-core/pkg/scheduling" - machineutil "github.com/aws/karpenter-core/pkg/utils/machine" -) - -type Registration struct { - kubeClient client.Client -} - -func (r *Registration) Reconcile(ctx context.Context, machine *v1alpha5.Machine) (reconcile.Result, error) { - if machine.StatusConditions().GetCondition(v1alpha5.MachineRegistered).IsTrue() { - // TODO @joinnis: Remove the back-propagation of this label onto the Node once all Nodes are guaranteed to have this label - // We can assume that all nodes will have this label and no back-propagation will be required once we hit v1 - return reconcile.Result{}, r.backPropagateRegistrationLabel(ctx, machine) - } - if !machine.StatusConditions().GetCondition(v1alpha5.MachineLaunched).IsTrue() { - machine.StatusConditions().MarkFalse(v1alpha5.MachineRegistered, "MachineNotLaunched", "Machine is not launched") - return reconcile.Result{}, nil - } - - ctx = logging.WithLogger(ctx, logging.FromContext(ctx).With("provider-id", machine.Status.ProviderID)) - node, err := machineutil.NodeForMachine(ctx, r.kubeClient, machine) - if err != nil { - if machineutil.IsNodeNotFoundError(err) { - machine.StatusConditions().MarkFalse(v1alpha5.MachineRegistered, "NodeNotFound", "Node not registered with cluster") - return reconcile.Result{}, nil - } - if machineutil.IsDuplicateNodeError(err) { - machine.StatusConditions().MarkFalse(v1alpha5.MachineRegistered, "MultipleNodesFound", "Invariant violated, machine matched multiple nodes") - return reconcile.Result{}, nil - } - return reconcile.Result{}, fmt.Errorf("getting node for machine, %w", err) - } - ctx = logging.WithLogger(ctx, logging.FromContext(ctx).With("node", node.Name)) - if err = r.syncNode(ctx, machine, node); err != nil { - return reconcile.Result{}, fmt.Errorf("syncing node, %w", err) - } - logging.FromContext(ctx).Debugf("registered machine") - machine.StatusConditions().MarkTrue(v1alpha5.MachineRegistered) - machine.Status.NodeName = node.Name - // gpu-provisioner: update allocatable and capactity from node as well - machine.Status.Allocatable = node.Status.Allocatable - machine.Status.Capacity = node.Status.Capacity - - metrics.MachinesRegisteredCounter.With(prometheus.Labels{ - metrics.ProvisionerLabel: machine.Labels[v1alpha5.ProvisionerNameLabelKey], - }).Inc() - // If the machine is linked, then the node already existed so we don't mark it as created - if _, ok := machine.Annotations[v1alpha5.MachineLinkedAnnotationKey]; !ok { - metrics.NodesCreatedCounter.With(prometheus.Labels{ - metrics.ProvisionerLabel: machine.Labels[v1alpha5.ProvisionerNameLabelKey], - }).Inc() - } - return reconcile.Result{}, nil -} - -func (r *Registration) syncNode(ctx context.Context, machine *v1alpha5.Machine, node *v1.Node) error { - stored := node.DeepCopy() - controllerutil.AddFinalizer(node, v1alpha5.TerminationFinalizer) - - // Remove any provisioner owner references since we own them - node.OwnerReferences = lo.Reject(node.OwnerReferences, func(o metav1.OwnerReference, _ int) bool { - return o.Kind == "Provisioner" - }) - node.OwnerReferences = append(node.OwnerReferences, metav1.OwnerReference{ - APIVersion: v1alpha5.SchemeGroupVersion.String(), - Kind: "Machine", - Name: machine.Name, - UID: machine.UID, - BlockOwnerDeletion: ptr.Bool(true), - }) - - // If the machine isn't registered as linked, then sync it - // This prevents us from messing with nodes that already exist and are scheduled - if _, ok := machine.Annotations[v1alpha5.MachineLinkedAnnotationKey]; !ok { - node.Labels = lo.Assign(node.Labels, machine.Labels) - node.Annotations = lo.Assign(node.Annotations, machine.Annotations) - // Sync all taints inside of Machine into the Machine taints - node.Spec.Taints = scheduling.Taints(node.Spec.Taints).Merge(machine.Spec.Taints) - node.Spec.Taints = scheduling.Taints(node.Spec.Taints).Merge(machine.Spec.StartupTaints) - } - node.Labels = lo.Assign(node.Labels, map[string]string{ - v1alpha5.LabelNodeRegistered: "true", - }) - if !equality.Semantic.DeepEqual(stored, node) { - if err := r.kubeClient.Patch(ctx, node, client.MergeFrom(stored)); err != nil { - return fmt.Errorf("syncing node labels, %w", err) - } - } - return nil -} - -// backPropagateRegistrationLabel ports the `karpenter.sh/registered` label onto nodes that are registered by the Machine -// but don't have this label on the Node yet -func (r *Registration) backPropagateRegistrationLabel(ctx context.Context, machine *v1alpha5.Machine) error { - node, err := machineutil.NodeForMachine(ctx, r.kubeClient, machine) - stored := node.DeepCopy() - if err != nil { - return machineutil.IgnoreDuplicateNodeError(machineutil.IgnoreNodeNotFoundError(err)) - } - node.Labels = lo.Assign(node.Labels, map[string]string{ - v1alpha5.LabelNodeRegistered: "true", - }) - if !equality.Semantic.DeepEqual(stored, node) { - if err := r.kubeClient.Patch(ctx, node, client.MergeFrom(stored)); err != nil { - return fmt.Errorf("syncing node registration label, %w", err) - } - } - return nil -} diff --git a/vendor/github.com/aws/karpenter-core/pkg/controllers/machine/termination/controller.go b/vendor/github.com/aws/karpenter-core/pkg/controllers/machine/termination/controller.go deleted file mode 100644 index 178a4985..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/controllers/machine/termination/controller.go +++ /dev/null @@ -1,128 +0,0 @@ -/* -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. -*/ - -package termination - -import ( - "context" - "fmt" - "time" - - "golang.org/x/time/rate" - v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/equality" - "k8s.io/client-go/util/workqueue" - "knative.dev/pkg/logging" - controllerruntime "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/builder" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/controller" - "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" - "sigs.k8s.io/controller-runtime/pkg/event" - "sigs.k8s.io/controller-runtime/pkg/manager" - "sigs.k8s.io/controller-runtime/pkg/predicate" - "sigs.k8s.io/controller-runtime/pkg/reconcile" - "sigs.k8s.io/controller-runtime/pkg/source" - - "github.com/aws/karpenter-core/pkg/apis/v1alpha5" - "github.com/aws/karpenter-core/pkg/cloudprovider" - corecontroller "github.com/aws/karpenter-core/pkg/operator/controller" - machineutil "github.com/aws/karpenter-core/pkg/utils/machine" -) - -var _ corecontroller.FinalizingTypedController[*v1alpha5.Machine] = (*Controller)(nil) - -// Controller is a Machine Termination controller that triggers deletion of the Node and the -// CloudProvider Machine through its graceful termination mechanism -type Controller struct { - kubeClient client.Client - cloudProvider cloudprovider.CloudProvider -} - -// NewController is a constructor for the Machine Controller -func NewController(kubeClient client.Client, cloudProvider cloudprovider.CloudProvider) corecontroller.Controller { - return corecontroller.Typed[*v1alpha5.Machine](kubeClient, &Controller{ - kubeClient: kubeClient, - cloudProvider: cloudProvider, - }) -} - -func (*Controller) Name() string { - return "machine.termination" -} - -func (c *Controller) Reconcile(_ context.Context, _ *v1alpha5.Machine) (reconcile.Result, error) { - return reconcile.Result{}, nil -} - -func (c *Controller) Finalize(ctx context.Context, machine *v1alpha5.Machine) (reconcile.Result, error) { - ctx = logging.WithLogger(ctx, logging.FromContext(ctx).With("node", machine.Status.NodeName, "provisioner", machine.Labels[v1alpha5.ProvisionerNameLabelKey], "provider-id", machine.Status.ProviderID)) - stored := machine.DeepCopy() - if !controllerutil.ContainsFinalizer(machine, v1alpha5.TerminationFinalizer) { - return reconcile.Result{}, nil - } - nodes, err := machineutil.AllNodesForMachine(ctx, c.kubeClient, machine) - if err != nil { - return reconcile.Result{}, err - } - for _, node := range nodes { - // We delete nodes to trigger the node finalization and deletion flow - if err = c.kubeClient.Delete(ctx, node); client.IgnoreNotFound(err) != nil { - return reconcile.Result{}, err - } - } - // We wait until all the nodes associated with this machine have completed their deletion before triggering the finalization of the machine - if len(nodes) > 0 { - return reconcile.Result{}, nil - } - if machine.Status.ProviderID != "" || machine.Annotations[v1alpha5.MachineLinkedAnnotationKey] != "" { - if err := c.cloudProvider.Delete(ctx, machine); cloudprovider.IgnoreMachineNotFoundError(err) != nil { - return reconcile.Result{}, fmt.Errorf("terminating cloudprovider instance, %w", err) - } - } - controllerutil.RemoveFinalizer(machine, v1alpha5.TerminationFinalizer) - if !equality.Semantic.DeepEqual(stored, machine) { - if err := c.kubeClient.Patch(ctx, machine, client.MergeFrom(stored)); err != nil { - return reconcile.Result{}, client.IgnoreNotFound(fmt.Errorf("removing machine termination finalizer, %w", err)) - } - logging.FromContext(ctx).Infof("deleted machine") - } - return reconcile.Result{}, nil -} - -func (c *Controller) Builder(ctx context.Context, m manager.Manager) corecontroller.Builder { - return corecontroller.Adapt(controllerruntime. - NewControllerManagedBy(m). - For(&v1alpha5.Machine{}). - WithEventFilter(predicate.GenerationChangedPredicate{}). - WithEventFilter(machineutil.KaitoMachinePredicate). - Watches( - &source.Kind{Type: &v1.Node{}}, - machineutil.NodeEventHandler(ctx, c.kubeClient), - // Watch for node deletion events - builder.WithPredicates(predicate.Funcs{ - CreateFunc: func(e event.CreateEvent) bool { return false }, - UpdateFunc: func(e event.UpdateEvent) bool { return false }, - DeleteFunc: func(e event.DeleteEvent) bool { return true }, - }), - ). - WithOptions(controller.Options{ - RateLimiter: workqueue.NewMaxOfRateLimiter( - workqueue.NewItemExponentialFailureRateLimiter(time.Second, time.Minute), - // 10 qps, 100 bucket size - &workqueue.BucketRateLimiter{Limiter: rate.NewLimiter(rate.Limit(10), 100)}, - ), - MaxConcurrentReconciles: 100, // higher concurrency limit since we want fast reaction to termination - })) -} diff --git a/vendor/github.com/aws/karpenter-core/pkg/controllers/metrics/pod/controller.go b/vendor/github.com/aws/karpenter-core/pkg/controllers/metrics/pod/controller.go deleted file mode 100644 index bab8f76c..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/controllers/metrics/pod/controller.go +++ /dev/null @@ -1,216 +0,0 @@ -/* -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. -*/ - -package pod - -import ( - "context" - "fmt" - "strings" - "sync" - - "github.com/prometheus/client_golang/prometheus" - v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/util/sets" - "knative.dev/pkg/logging" - controllerruntime "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/manager" - crmetrics "sigs.k8s.io/controller-runtime/pkg/metrics" - "sigs.k8s.io/controller-runtime/pkg/reconcile" - - "github.com/aws/karpenter-core/pkg/apis/v1alpha5" - "github.com/aws/karpenter-core/pkg/metrics" - "github.com/aws/karpenter-core/pkg/operator/controller" -) - -const ( - podName = "name" - podNameSpace = "namespace" - ownerSelfLink = "owner" - podHostName = "node" - podProvisioner = "provisioner" - podHostZone = "zone" - podHostArchitecture = "arch" - podHostCapacityType = "capacity_type" - podHostInstanceType = "instance_type" - podPhase = "phase" - - phasePending = "Pending" -) - -var ( - podGaugeVec = prometheus.NewGaugeVec( - prometheus.GaugeOpts{ - Namespace: "karpenter", - Subsystem: "pods", - Name: "state", - Help: "Pod state is the current state of pods. This metric can be used several ways as it is labeled by the pod name, namespace, owner, node, provisioner name, zone, architecture, capacity type, instance type and pod phase.", - }, - labelNames(), - ) - - podStartupTimeSummary = prometheus.NewSummary( - prometheus.SummaryOpts{ - Namespace: "karpenter", - Subsystem: "pods", - Name: "startup_time_seconds", - Help: "The time from pod creation until the pod is running.", - Objectives: metrics.SummaryObjectives(), - }, - ) -) - -// Controller for the resource -type Controller struct { - kubeClient client.Client - - // labelsMap keeps track of the pod gauge for gauge deletion - // podKey (types.NamespacedName) -> prometheus.Labels - labelsMap sync.Map - pendingPods sets.String -} - -func init() { - crmetrics.Registry.MustRegister(podGaugeVec) - crmetrics.Registry.MustRegister(podStartupTimeSummary) -} - -func labelNames() []string { - return []string{ - podName, - podNameSpace, - ownerSelfLink, - podHostName, - podProvisioner, - podHostZone, - podHostArchitecture, - podHostCapacityType, - podHostInstanceType, - podPhase, - } -} - -// NewController constructs a podController instance -func NewController(kubeClient client.Client) controller.Controller { - return &Controller{ - kubeClient: kubeClient, - pendingPods: sets.NewString(), - } -} - -func (c *Controller) Name() string { - return "pod_metrics" -} - -// Reconcile executes a termination control loop for the resource -func (c *Controller) Reconcile(ctx context.Context, req reconcile.Request) (reconcile.Result, error) { - ctx = logging.WithLogger(ctx, logging.FromContext(ctx).Named(c.Name()).With("pod", req.Name)) - - // Remove the previous gauge on CREATE/UPDATE/DELETE - c.cleanup(req.NamespacedName) - - // Retrieve pod from reconcile request - pod := &v1.Pod{} - if err := c.kubeClient.Get(ctx, req.NamespacedName, pod); err != nil { - return reconcile.Result{}, client.IgnoreNotFound(err) - } - - c.record(ctx, pod) - return reconcile.Result{}, nil -} - -func (c *Controller) cleanup(podKey types.NamespacedName) { - if labels, ok := c.labelsMap.Load(podKey); ok { - podGaugeVec.Delete(labels.(prometheus.Labels)) - c.labelsMap.Delete(podKey) - } -} - -func (c *Controller) record(ctx context.Context, pod *v1.Pod) { - // Record pods state metric - labels := c.makeLabels(ctx, pod) - podGaugeVec.With(labels).Set(float64(1)) - c.labelsMap.Store(client.ObjectKeyFromObject(pod), labels) - - // Record pods startup time metric - var condition *v1.PodCondition - for i := range pod.Status.Conditions { - if pod.Status.Conditions[i].Type == v1.PodReady { - condition = &pod.Status.Conditions[i] - } - } - - podKey := client.ObjectKeyFromObject(pod).String() - if pod.Status.Phase == phasePending { - c.pendingPods.Insert(podKey) - } else if c.pendingPods.Has(podKey) && condition != nil { - podStartupTimeSummary.Observe(condition.LastTransitionTime.Sub(pod.CreationTimestamp.Time).Seconds()) - c.pendingPods.Delete(podKey) - } -} - -// makeLabels creates the makeLabels using the current state of the pod -func (c *Controller) makeLabels(ctx context.Context, pod *v1.Pod) prometheus.Labels { - metricLabels := prometheus.Labels{} - metricLabels[podName] = pod.GetName() - metricLabels[podNameSpace] = pod.GetNamespace() - // Selflink has been deprecated after v.1.20 - // Manually generate the selflink for the first owner reference - // Currently we do not support multiple owner references - selflink := "" - if len(pod.GetOwnerReferences()) > 0 { - ownerreference := pod.GetOwnerReferences()[0] - selflink = fmt.Sprintf("/apis/%s/namespaces/%s/%ss/%s", ownerreference.APIVersion, pod.Namespace, strings.ToLower(ownerreference.Kind), ownerreference.Name) - } - metricLabels[ownerSelfLink] = selflink - metricLabels[podHostName] = pod.Spec.NodeName - metricLabels[podPhase] = string(pod.Status.Phase) - node := &v1.Node{} - if err := c.kubeClient.Get(ctx, types.NamespacedName{Name: pod.Spec.NodeName}, node); err != nil { - metricLabels[podHostZone] = "N/A" - metricLabels[podHostArchitecture] = "N/A" - metricLabels[podHostCapacityType] = "N/A" - metricLabels[podHostInstanceType] = "N/A" - if provisionerName, ok := pod.Spec.NodeSelector[v1alpha5.ProvisionerNameLabelKey]; ok { - metricLabels[podProvisioner] = provisionerName - } else { - metricLabels[podProvisioner] = "N/A" - } - } else { - metricLabels[podHostZone] = node.Labels[v1.LabelTopologyZone] - metricLabels[podHostArchitecture] = node.Labels[v1.LabelArchStable] - if capacityType, ok := node.Labels[v1alpha5.LabelCapacityType]; !ok { - metricLabels[podHostCapacityType] = "N/A" - } else { - metricLabels[podHostCapacityType] = capacityType - } - metricLabels[podHostInstanceType] = node.Labels[v1.LabelInstanceTypeStable] - if provisionerName, ok := node.Labels[v1alpha5.ProvisionerNameLabelKey]; !ok { - metricLabels[podProvisioner] = "N/A" - } else { - metricLabels[podProvisioner] = provisionerName - } - } - return metricLabels -} - -func (c *Controller) Builder(_ context.Context, m manager.Manager) controller.Builder { - return controller.Adapt( - controllerruntime. - NewControllerManagedBy(m). - For(&v1.Pod{}), - ) -} diff --git a/vendor/github.com/aws/karpenter-core/pkg/controllers/metrics/provisioner/controller.go b/vendor/github.com/aws/karpenter-core/pkg/controllers/metrics/provisioner/controller.go deleted file mode 100644 index 014a01c2..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/controllers/metrics/provisioner/controller.go +++ /dev/null @@ -1,205 +0,0 @@ -/* -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. -*/ - -package provisioner - -import ( - "context" - "fmt" - "strings" - "sync" - "time" - - "k8s.io/apimachinery/pkg/api/resource" - "k8s.io/apimachinery/pkg/types" - "knative.dev/pkg/logging" - - "github.com/prometheus/client_golang/prometheus" - v1 "k8s.io/api/core/v1" - controllerruntime "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/manager" - crmetrics "sigs.k8s.io/controller-runtime/pkg/metrics" - "sigs.k8s.io/controller-runtime/pkg/reconcile" - - "github.com/aws/karpenter-core/pkg/apis/v1alpha5" - corecontroller "github.com/aws/karpenter-core/pkg/operator/controller" - - "github.com/gpu-provisioner/pkg/staticprovisioner" -) - -const ( - provisionerResourceType = "resource_type" - provisionerName = "provisioner" -) - -var ( - limitGaugeVec = prometheus.NewGaugeVec( - prometheus.GaugeOpts{ - Namespace: "karpenter", - Subsystem: "provisioner", - Name: "limit", - Help: "The Provisioner Limits are the limits specified on the provisioner that restrict the quantity of resources provisioned. Labeled by provisioner name and resource type.", - }, - labelNames(), - ) - usageGaugeVec = prometheus.NewGaugeVec( - prometheus.GaugeOpts{ - Namespace: "karpenter", - Subsystem: "provisioner", - Name: "usage", - Help: "The Provisioner Usage is the amount of resources that have been provisioned by a particular provisioner. Labeled by provisioner name and resource type.", - }, - labelNames(), - ) - usagePctGaugeVec = prometheus.NewGaugeVec( - prometheus.GaugeOpts{ - Namespace: "karpenter", - Subsystem: "provisioner", - Name: "usage_pct", - Help: "The Provisioner Usage Percentage is the percentage of each resource used based on the resources provisioned and the limits that have been configured in the range [0,100]. Labeled by provisioner name and resource type.", - }, - labelNames(), - ) -) - -func init() { - crmetrics.Registry.MustRegister(limitGaugeVec) - crmetrics.Registry.MustRegister(usageGaugeVec) - crmetrics.Registry.MustRegister(usagePctGaugeVec) -} - -func labelNames() []string { - return []string{ - provisionerResourceType, - provisionerName, - } -} - -type Controller struct { - kubeClient client.Client - - // labelCollection keeps track of gauges for gauge deletion - // provisionerKey (types.NamespacedName) -> []prometheus.Labels - labelCollection sync.Map -} - -// NewController constructs a controller instance -func NewController(kubeClient client.Client) corecontroller.Controller { - return &Controller{ - kubeClient: kubeClient, - } -} - -func (c *Controller) Name() string { - return "provisioner_metrics" -} - -// Reconcile executes a termination control loop for the resource -func (c *Controller) Reconcile(ctx context.Context, req reconcile.Request) (reconcile.Result, error) { - ctx = logging.WithLogger(ctx, logging.FromContext(ctx).Named(c.Name()).With("provisioner", req.Name)) - - // Remove the previous gauge on CREATE/UPDATE/DELETE - c.cleanup(req.NamespacedName) - - // Retrieve provisioner from reconcile request - // provisioner := &v1alpha5.Provisioner{} - // if err := c.kubeClient.Get(ctx, req.NamespacedName, provisioner); err != nil { - // return reconcile.Result{}, client.IgnoreNotFound(err) - // } - provisioner := staticprovisioner.Sp - - c.record(ctx, provisioner) - // periodically update our metrics per provisioner even if nothing has changed - return reconcile.Result{RequeueAfter: 5 * time.Minute}, nil -} - -func (c *Controller) cleanup(provisionerKey types.NamespacedName) { - if labelSet, ok := c.labelCollection.Load(provisionerKey); ok { - for _, labels := range labelSet.([]prometheus.Labels) { - limitGaugeVec.Delete(labels) - usageGaugeVec.Delete(labels) - usagePctGaugeVec.Delete(labels) - } - c.labelCollection.Delete(provisionerKey) - } -} - -func (c *Controller) record(ctx context.Context, provisioner *v1alpha5.Provisioner) { - if err := c.set(provisioner, provisioner.Status.Resources, usageGaugeVec); err != nil { - logging.FromContext(ctx).Errorf("generating gauge: %s", err) - } - if provisioner.Spec.Limits == nil { - // can't generate our limits or usagePct gauges if there are no limits - return - } - if err := c.set(provisioner, provisioner.Spec.Limits.Resources, limitGaugeVec); err != nil { - logging.FromContext(ctx).Errorf("generating gauge: %s", err) - } - usage := v1.ResourceList{} - for k, v := range provisioner.Spec.Limits.Resources { - limitValue := v.AsApproximateFloat64() - usedValue := provisioner.Status.Resources[k] - if limitValue == 0 { - usage[k] = *resource.NewQuantity(100, resource.DecimalSI) - } else { - usage[k] = *resource.NewQuantity(int64(usedValue.AsApproximateFloat64()/limitValue*100), resource.DecimalSI) - } - } - if err := c.set(provisioner, usage, usagePctGaugeVec); err != nil { - logging.FromContext(ctx).Errorf("generating gauge: %s", err) - } -} - -// set updates the value for the node gauge for each resource type passed through the resource list -func (c *Controller) set(provisioner *v1alpha5.Provisioner, resourceList v1.ResourceList, gaugeVec *prometheus.GaugeVec) error { - provisionerKey := client.ObjectKeyFromObject(provisioner) - - var labels []prometheus.Labels - for resourceName, quantity := range resourceList { - resourceTypeName := strings.ReplaceAll(strings.ToLower(string(resourceName)), "-", "_") - - label := c.makeLabels(provisioner, resourceTypeName) - labels = append(labels, label) - // Store the label we are about to add to the label collection - c.labelCollection.Store(provisionerKey, labels) - - // gets existing gauge or gets a new one if it doesn't exist - gauge, err := gaugeVec.GetMetricWith(label) - if err != nil { - return fmt.Errorf("creating or getting gauge: %w", err) - } - if resourceName == v1.ResourceCPU { - gauge.Set(float64(quantity.MilliValue()) / float64(1000)) - } else { - gauge.Set(float64(quantity.Value())) - } - } - return nil -} - -func (c *Controller) makeLabels(provisioner *v1alpha5.Provisioner, resourceTypeName string) prometheus.Labels { - return prometheus.Labels{ - provisionerResourceType: resourceTypeName, - provisionerName: provisioner.Name, - } -} - -func (c *Controller) Builder(_ context.Context, m manager.Manager) corecontroller.Builder { - return corecontroller.Adapt( - controllerruntime. - NewControllerManagedBy(m). - For(&v1alpha5.Provisioner{}), - ) -} diff --git a/vendor/github.com/aws/karpenter-core/pkg/controllers/metrics/state/controller.go b/vendor/github.com/aws/karpenter-core/pkg/controllers/metrics/state/controller.go deleted file mode 100644 index 74380630..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/controllers/metrics/state/controller.go +++ /dev/null @@ -1,56 +0,0 @@ -/* -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. -*/ - -package metrics - -import ( - "context" - "time" - - "sigs.k8s.io/controller-runtime/pkg/manager" - "sigs.k8s.io/controller-runtime/pkg/reconcile" - - "github.com/aws/karpenter-core/pkg/controllers/metrics/state/scraper" - "github.com/aws/karpenter-core/pkg/controllers/state" - "github.com/aws/karpenter-core/pkg/operator/controller" -) - -const pollingPeriod = 5 * time.Second - -type Controller struct { - cluster *state.Cluster - scrapers []scraper.Scraper -} - -func NewController(cluster *state.Cluster) *Controller { - return &Controller{ - cluster: cluster, - scrapers: []scraper.Scraper{scraper.NewNodeScraper(cluster)}, - } -} - -func (c *Controller) Name() string { - return "metric_scraper" -} - -func (c *Controller) Builder(_ context.Context, mgr manager.Manager) controller.Builder { - return controller.NewSingletonManagedBy(mgr) -} - -func (c *Controller) Reconcile(ctx context.Context, _ reconcile.Request) (reconcile.Result, error) { - for _, scraper := range c.scrapers { - scraper.Scrape(ctx) - } - return reconcile.Result{RequeueAfter: pollingPeriod}, nil -} diff --git a/vendor/github.com/aws/karpenter-core/pkg/controllers/metrics/state/scraper/node.go b/vendor/github.com/aws/karpenter-core/pkg/controllers/metrics/state/scraper/node.go deleted file mode 100644 index f971291d..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/controllers/metrics/state/scraper/node.go +++ /dev/null @@ -1,276 +0,0 @@ -/* -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. -*/ - -package scraper - -import ( - "bytes" - "context" - "sort" - "strings" - - "github.com/prometheus/client_golang/prometheus" - "github.com/samber/lo" - v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/util/sets" - "sigs.k8s.io/controller-runtime/pkg/metrics" - - "github.com/aws/karpenter-core/pkg/apis/v1alpha5" - "github.com/aws/karpenter-core/pkg/controllers/state" - "github.com/aws/karpenter-core/pkg/utils/resources" -) - -const ( - resourceType = "resource_type" - nodeName = "node_name" - nodeProvisioner = "provisioner" - nodePhase = "phase" -) - -var ( - allocatableGaugeVec = prometheus.NewGaugeVec( - prometheus.GaugeOpts{ - Namespace: "karpenter", - Subsystem: "nodes", - Name: "allocatable", - Help: "Node allocatable are the resources allocatable by nodes.", - }, - nodeLabelNames(), - ) - - podRequestsGaugeVec = prometheus.NewGaugeVec( - prometheus.GaugeOpts{ - Namespace: "karpenter", - Subsystem: "nodes", - Name: "total_pod_requests", - Help: "Node total pod requests are the resources requested by non-DaemonSet pods bound to nodes.", - }, - nodeLabelNames(), - ) - - podLimitsGaugeVec = prometheus.NewGaugeVec( - prometheus.GaugeOpts{ - Namespace: "karpenter", - Subsystem: "nodes", - Name: "total_pod_limits", - Help: "Node total pod limits are the resources specified by non-DaemonSet pod limits.", - }, - nodeLabelNames(), - ) - - daemonRequestsGaugeVec = prometheus.NewGaugeVec( - prometheus.GaugeOpts{ - Namespace: "karpenter", - Subsystem: "nodes", - Name: "total_daemon_requests", - Help: "Node total daemon requests are the resource requested by DaemonSet pods bound to nodes.", - }, - nodeLabelNames(), - ) - - daemonLimitsGaugeVec = prometheus.NewGaugeVec( - prometheus.GaugeOpts{ - Namespace: "karpenter", - Subsystem: "nodes", - Name: "total_daemon_limits", - Help: "Node total daemon limits are the resources specified by DaemonSet pod limits.", - }, - nodeLabelNames(), - ) - - overheadGaugeVec = prometheus.NewGaugeVec( - prometheus.GaugeOpts{ - Namespace: "karpenter", - Subsystem: "nodes", - Name: "system_overhead", - Help: "Node system daemon overhead are the resources reserved for system overhead, the difference between the node's capacity and allocatable values are reported by the status.", - }, - nodeLabelNames(), - ) - - wellKnownLabels = getWellKnownLabels() -) - -func nodeLabelNames() []string { - return append( - lo.Values(wellKnownLabels), - resourceType, - nodeName, - nodeProvisioner, - nodePhase, - ) -} - -func forEachGaugeVec(f func(*prometheus.GaugeVec)) { - for _, gauge := range []*prometheus.GaugeVec{ - allocatableGaugeVec, - podRequestsGaugeVec, - podLimitsGaugeVec, - daemonRequestsGaugeVec, - daemonLimitsGaugeVec, - overheadGaugeVec, - } { - f(gauge) - } -} - -func init() { - forEachGaugeVec(func(g *prometheus.GaugeVec) { - metrics.Registry.MustRegister(g) - }) -} - -type NodeScraper struct { - cluster *state.Cluster - gaugeLabels map[*prometheus.GaugeVec]map[string]prometheus.Labels -} - -func NewNodeScraper(cluster *state.Cluster) *NodeScraper { - return &NodeScraper{ - cluster: cluster, - gaugeLabels: func() map[*prometheus.GaugeVec]map[string]prometheus.Labels { - m := make(map[*prometheus.GaugeVec]map[string]prometheus.Labels) - forEachGaugeVec(func(g *prometheus.GaugeVec) { - m[g] = make(map[string]prometheus.Labels) - }) - return m - }(), - } -} - -func (ns *NodeScraper) Scrape(_ context.Context) { - currentGaugeLabels := make(map[*prometheus.GaugeVec]sets.String) - forEachGaugeVec(func(g *prometheus.GaugeVec) { - currentGaugeLabels[g] = sets.NewString() - }) - - // Populate metrics - ns.cluster.ForEachNode(func(n *state.StateNode) bool { - if n.Node == nil { - return true - } - for gaugeVec, resourceList := range map[*prometheus.GaugeVec]v1.ResourceList{ - overheadGaugeVec: ns.getSystemOverhead(n.Node), - podRequestsGaugeVec: resources.Subtract(n.PodRequests(), n.DaemonSetRequests()), - podLimitsGaugeVec: resources.Subtract(n.PodLimits(), n.DaemonSetLimits()), - daemonRequestsGaugeVec: n.DaemonSetRequests(), - daemonLimitsGaugeVec: n.DaemonSetLimits(), - allocatableGaugeVec: n.Node.Status.Allocatable, - } { - for _, labels := range ns.set(gaugeVec, n.Node, resourceList) { - key := labelsToString(labels) - ns.gaugeLabels[gaugeVec][key] = labels - currentGaugeLabels[gaugeVec].Insert(key) - } - } - return true - }) - - // Remove stale gauges - forEachGaugeVec(func(g *prometheus.GaugeVec) { - for labelsKey := range sets.NewString(lo.Keys(ns.gaugeLabels[g])...).Difference(currentGaugeLabels[g]) { - g.Delete(ns.gaugeLabels[g][labelsKey]) - delete(ns.gaugeLabels[g], labelsKey) - } - }) -} - -// set the value for the node gauge and returns a slice of the labels for the gauges set -func (ns *NodeScraper) set(gaugeVec *prometheus.GaugeVec, node *v1.Node, resourceList v1.ResourceList) []prometheus.Labels { - gaugeLabels := []prometheus.Labels{} - for resourceName, quantity := range resourceList { - // Reformat resource type to be consistent with Prometheus naming conventions (snake_case) - resourceLabels := ns.getNodeLabels(node, strings.ReplaceAll(strings.ToLower(string(resourceName)), "-", "_")) - gaugeLabels = append(gaugeLabels, resourceLabels) - if resourceName == v1.ResourceCPU { - gaugeVec.With(resourceLabels).Set(float64(quantity.MilliValue()) / float64(1000)) - } else { - gaugeVec.With(resourceLabels).Set(float64(quantity.Value())) - } - } - return gaugeLabels -} - -func (ns *NodeScraper) getSystemOverhead(node *v1.Node) v1.ResourceList { - systemOverhead := v1.ResourceList{} - if len(node.Status.Allocatable) > 0 { - // calculating system daemons overhead - for resourceName, quantity := range node.Status.Allocatable { - overhead := node.Status.Capacity[resourceName] - overhead.Sub(quantity) - systemOverhead[resourceName] = overhead - } - } - return systemOverhead -} - -func (ns *NodeScraper) getNodeLabels(node *v1.Node, resourceTypeName string) prometheus.Labels { - metricLabels := prometheus.Labels{} - metricLabels[resourceType] = resourceTypeName - metricLabels[nodeName] = node.GetName() - metricLabels[nodeProvisioner] = node.Labels[v1alpha5.ProvisionerNameLabelKey] - metricLabels[nodePhase] = string(node.Status.Phase) - - // Populate well known labels - for wellKnownLabel, label := range wellKnownLabels { - if value, ok := node.Labels[wellKnownLabel]; !ok { - metricLabels[label] = "N/A" - } else { - metricLabels[label] = value - } - } - - return metricLabels -} - -func getWellKnownLabels() map[string]string { - labels := make(map[string]string) - for wellKnownLabel := range v1alpha5.WellKnownLabels { - if parts := strings.Split(wellKnownLabel, "/"); len(parts) == 2 { - label := parts[1] - // Reformat label names to be consistent with Prometheus naming conventions (snake_case) - label = strings.ReplaceAll(strings.ToLower(label), "-", "_") - labels[wellKnownLabel] = label - } - } - return labels -} - -func labelsToString(labels prometheus.Labels) string { - // this function is called often and shows up in profiling, so its optimized - // a bit to run ~2x faster than a more standard approach - keyValues := make([]string, 0, len(labels)) - sz := 0 - for k, v := range labels { - keyValues = append(keyValues, k) - // len(key + len(value) + len(="",) - sz += len(k) + len(v) + 4 - } - sort.Strings(keyValues) - - var buf bytes.Buffer - // grow the buffer to the size needed to avoid allocations - buf.Grow(sz) - for i, k := range keyValues { - if i > 0 { - buf.WriteByte(',') - } - // much faster to append a string than to format a string - buf.WriteString(k) - buf.WriteString("=\"") - buf.WriteString(labels[k]) - buf.WriteString("\"") - } - return buf.String() -} diff --git a/vendor/github.com/aws/karpenter-core/pkg/controllers/provisioning/controller.go b/vendor/github.com/aws/karpenter-core/pkg/controllers/provisioning/controller.go deleted file mode 100644 index 72efb344..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/controllers/provisioning/controller.go +++ /dev/null @@ -1,74 +0,0 @@ -/* -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. -*/ - -package provisioning - -import ( - "context" - "time" - - v1 "k8s.io/api/core/v1" - controllerruntime "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/controller" - "sigs.k8s.io/controller-runtime/pkg/manager" - "sigs.k8s.io/controller-runtime/pkg/reconcile" - - "github.com/aws/karpenter-core/pkg/events" - corecontroller "github.com/aws/karpenter-core/pkg/operator/controller" - "github.com/aws/karpenter-core/pkg/utils/pod" -) - -var _ corecontroller.TypedController[*v1.Pod] = (*Controller)(nil) - -// Controller for the resource -type Controller struct { - kubeClient client.Client - provisioner *Provisioner - recorder events.Recorder -} - -// NewController constructs a controller instance -func NewController(kubeClient client.Client, provisioner *Provisioner, recorder events.Recorder) corecontroller.Controller { - return corecontroller.Typed[*v1.Pod](kubeClient, &Controller{ - kubeClient: kubeClient, - provisioner: provisioner, - recorder: recorder, - }) -} - -func (c *Controller) Name() string { - return "provisioner_trigger" -} - -// Reconcile the resource -func (c *Controller) Reconcile(_ context.Context, p *v1.Pod) (reconcile.Result, error) { - if !pod.IsProvisionable(p) { - return reconcile.Result{}, nil - } - c.provisioner.Trigger() - // Continue to requeue until the pod is no longer provisionable. Pods may - // not be scheduled as expected if new pods are created while nodes are - // coming online. Even if a provisioning loop is successful, the pod may - // require another provisioning loop to become schedulable. - return reconcile.Result{RequeueAfter: 10 * time.Second}, nil -} - -func (c *Controller) Builder(_ context.Context, m manager.Manager) corecontroller.Builder { - return corecontroller.Adapt(controllerruntime. - NewControllerManagedBy(m). - For(&v1.Pod{}). - WithOptions(controller.Options{MaxConcurrentReconciles: 10}), - ) -} diff --git a/vendor/github.com/aws/karpenter-core/pkg/controllers/provisioning/provisioner.go b/vendor/github.com/aws/karpenter-core/pkg/controllers/provisioning/provisioner.go deleted file mode 100644 index 89c56d6e..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/controllers/provisioning/provisioner.go +++ /dev/null @@ -1,439 +0,0 @@ -/* -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. -*/ - -package provisioning - -import ( - "context" - "fmt" - "strings" - "time" - - "github.com/prometheus/client_golang/prometheus" - "github.com/samber/lo" - "go.uber.org/multierr" - appsv1 "k8s.io/api/apps/v1" - v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/util/sets" - corev1 "k8s.io/client-go/kubernetes/typed/core/v1" - "k8s.io/client-go/util/workqueue" - "knative.dev/pkg/logging" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/manager" - "sigs.k8s.io/controller-runtime/pkg/reconcile" - - "github.com/aws/karpenter-core/pkg/apis/v1alpha5" - schedulingevents "github.com/aws/karpenter-core/pkg/controllers/provisioning/scheduling/events" - "github.com/aws/karpenter-core/pkg/operator/controller" - "github.com/aws/karpenter-core/pkg/scheduling" - "github.com/aws/karpenter-core/pkg/utils/functional" - "github.com/aws/karpenter-core/pkg/utils/pretty" - - "github.com/aws/karpenter-core/pkg/cloudprovider" - scheduler "github.com/aws/karpenter-core/pkg/controllers/provisioning/scheduling" - "github.com/aws/karpenter-core/pkg/controllers/state" - "github.com/aws/karpenter-core/pkg/events" - "github.com/aws/karpenter-core/pkg/metrics" - "github.com/aws/karpenter-core/pkg/utils/pod" -) - -// LaunchOptions are the set of options that can be used to trigger certain -// actions and configuration during scheduling -type LaunchOptions struct { - RecordPodNomination bool - Reason string -} - -// RecordPodNomination causes nominate pod events to be recorded against the node. -func RecordPodNomination(o LaunchOptions) LaunchOptions { - o.RecordPodNomination = true - return o -} - -func WithReason(reason string) func(LaunchOptions) LaunchOptions { - return func(o LaunchOptions) LaunchOptions { - o.Reason = reason - return o - } -} - -// Provisioner waits for enqueued pods, batches them, creates capacity and binds the pods to the capacity. -type Provisioner struct { - cloudProvider cloudprovider.CloudProvider - kubeClient client.Client - coreV1Client corev1.CoreV1Interface - batcher *Batcher - volumeTopology *scheduler.VolumeTopology - cluster *state.Cluster - recorder events.Recorder - cm *pretty.ChangeMonitor -} - -func NewProvisioner(kubeClient client.Client, coreV1Client corev1.CoreV1Interface, - recorder events.Recorder, cloudProvider cloudprovider.CloudProvider, cluster *state.Cluster) *Provisioner { - p := &Provisioner{ - batcher: NewBatcher(), - cloudProvider: cloudProvider, - kubeClient: kubeClient, - coreV1Client: coreV1Client, - volumeTopology: scheduler.NewVolumeTopology(kubeClient), - cluster: cluster, - recorder: recorder, - cm: pretty.NewChangeMonitor(), - } - return p -} - -func (p *Provisioner) Name() string { - return "provisioner" -} - -func (p *Provisioner) Trigger() { - p.batcher.Trigger() -} - -func (p *Provisioner) Builder(_ context.Context, mgr manager.Manager) controller.Builder { - return controller.NewSingletonManagedBy(mgr) -} - -func (p *Provisioner) Reconcile(ctx context.Context, _ reconcile.Request) (result reconcile.Result, err error) { - // Batch pods - if triggered := p.batcher.Wait(ctx); !triggered { - return reconcile.Result{}, nil - } - // We need to ensure that our internal cluster state mechanism is synced before we proceed - // with making any scheduling decision off of our state nodes. Otherwise, we have the potential to make - // a scheduling decision based on a smaller subset of nodes in our cluster state than actually exist. - if !p.cluster.Synced(ctx) { - logging.FromContext(ctx).Debugf("waiting on cluster sync") - return reconcile.Result{RequeueAfter: time.Second}, nil - } - - // Schedule pods to potential nodes, exit if nothing to do - results, err := p.Schedule(ctx) - if err != nil { - return reconcile.Result{}, err - } - if len(results.NewMachines) == 0 { - return reconcile.Result{}, nil - } - _, err = p.LaunchMachines(ctx, results.NewMachines, WithReason(metrics.ProvisioningReason), RecordPodNomination) - return reconcile.Result{}, err -} - -// LaunchMachines launches nodes passed into the function in parallel. It returns a slice of the successfully created node -// names as well as a multierr of any errors that occurred while launching nodes -func (p *Provisioner) LaunchMachines(ctx context.Context, machines []*scheduler.Machine, opts ...functional.Option[LaunchOptions]) ([]string, error) { - // Launch capacity and bind pods - errs := make([]error, len(machines)) - machineNames := make([]string, len(machines)) - workqueue.ParallelizeUntil(ctx, len(machines), len(machines), func(i int) { - // create a new context to avoid a data race on the ctx variable - if machineName, err := p.Launch(ctx, machines[i], opts...); err != nil { - errs[i] = fmt.Errorf("launching machine, %w", err) - } else { - machineNames[i] = machineName - } - }) - return machineNames, multierr.Combine(errs...) -} - -func (p *Provisioner) GetPendingPods(ctx context.Context) ([]*v1.Pod, error) { - var podList v1.PodList - if err := p.kubeClient.List(ctx, &podList, client.MatchingFields{"spec.nodeName": ""}); err != nil { - return nil, fmt.Errorf("listing pods, %w", err) - } - var pods []*v1.Pod - for i := range podList.Items { - po := podList.Items[i] - // filter for provisionable pods first so we don't check for validity/PVCs on pods we won't provision anyway - // (e.g. those owned by daemonsets) - if !pod.IsProvisionable(&po) { - continue - } - if err := p.Validate(ctx, &po); err != nil { - logging.FromContext(ctx).With("pod", client.ObjectKeyFromObject(&po)).Debugf("ignoring pod, %s", err) - continue - } - - p.consolidationWarnings(ctx, po) - pods = append(pods, &po) - } - return pods, nil -} - -// consolidationWarnings potentially writes logs warning about possible unexpected interactions between scheduling -// constraints and consolidation -func (p *Provisioner) consolidationWarnings(ctx context.Context, po v1.Pod) { - // We have pending pods that have preferred anti-affinity or topology spread constraints. These can interact - // unexpectedly with consolidation so we warn once per hour when we see these pods. - if po.Spec.Affinity != nil && po.Spec.Affinity.PodAntiAffinity != nil { - if len(po.Spec.Affinity.PodAntiAffinity.PreferredDuringSchedulingIgnoredDuringExecution) != 0 { - if p.cm.HasChanged(string(po.UID), "pod-antiaffinity") { - logging.FromContext(ctx).Infof("pod %s has a preferred Anti-Affinity which can prevent consolidation", client.ObjectKeyFromObject(&po)) - } - } - } - for _, tsc := range po.Spec.TopologySpreadConstraints { - if tsc.WhenUnsatisfiable == v1.ScheduleAnyway { - if p.cm.HasChanged(string(po.UID), "pod-topology-spread") { - logging.FromContext(ctx).Infof("pod %s has a preferred TopologySpreadConstraint which can prevent consolidation", client.ObjectKeyFromObject(&po)) - } - } - } -} - -//nolint:gocyclo -func (p *Provisioner) NewScheduler(ctx context.Context, pods []*v1.Pod, stateNodes []*state.StateNode, opts scheduler.SchedulerOptions) (*scheduler.Scheduler, error) { - // Build node templates - var machines []*scheduler.MachineTemplate - var provisionerList v1alpha5.ProvisionerList - instanceTypes := map[string][]*cloudprovider.InstanceType{} - domains := map[string]sets.String{} - if err := p.kubeClient.List(ctx, &provisionerList); err != nil { - return nil, fmt.Errorf("listing provisioners, %w", err) - } - - // nodeTemplates generated from provisioners are ordered by weight - // since they are stored within a slice and scheduling - // will always attempt to schedule on the first nodeTemplate - provisionerList.OrderByWeight() - - for i := range provisionerList.Items { - provisioner := &provisionerList.Items[i] - if !provisioner.DeletionTimestamp.IsZero() { - continue - } - // Create node template - machines = append(machines, scheduler.NewMachineTemplate(provisioner)) - // Get instance type options - instanceTypeOptions, err := p.cloudProvider.GetInstanceTypes(ctx, provisioner) - if err != nil { - return nil, fmt.Errorf("getting instance types, %w", err) - } - instanceTypes[provisioner.Name] = append(instanceTypes[provisioner.Name], instanceTypeOptions...) - - // Construct Topology Domains - for _, instanceType := range instanceTypeOptions { - // We need to intersect the instance type requirements with the current provisioner requirements. This - // ensures that something like zones from an instance type don't expand the universe of valid domains. - requirements := scheduling.NewNodeSelectorRequirements(provisioner.Spec.Requirements...) - requirements.Add(instanceType.Requirements.Values()...) - - for key, requirement := range requirements { - //This code used to execute a Union between domains[key] and requirement.Values(). - //The downside of this is that Union is immutable and takes a copy of the set it is executed upon. - //This resulted in a lot of memory pressure on the heap and poor performance - //https://github.com/aws/karpenter/issues/3565 - if domains[key] == nil { - domains[key] = sets.NewString(requirement.Values()...) - } else { - domains[key].Insert(requirement.Values()...) - } - } - } - - for key, requirement := range scheduling.NewNodeSelectorRequirements(provisioner.Spec.Requirements...) { - if requirement.Operator() == v1.NodeSelectorOpIn { - //The following is a performance optimisation, for the explanation see the comment above - if domains[key] == nil { - domains[key] = sets.NewString(requirement.Values()...) - } else { - domains[key].Insert(requirement.Values()...) - } - } - } - } - - if len(machines) == 0 { - return nil, fmt.Errorf("no provisioners found") - } - - // inject topology constraints - pods = p.injectTopology(ctx, pods) - - // Calculate cluster topology - topology, err := scheduler.NewTopology(ctx, p.kubeClient, p.cluster, domains, pods) - if err != nil { - return nil, fmt.Errorf("tracking topology counts, %w", err) - } - daemonSetPods, err := p.getDaemonSetPods(ctx) - if err != nil { - return nil, fmt.Errorf("getting daemon pods, %w", err) - } - return scheduler.NewScheduler(ctx, p.kubeClient, machines, provisionerList.Items, p.cluster, stateNodes, topology, instanceTypes, daemonSetPods, p.recorder, opts), nil -} - -func (p *Provisioner) Schedule(ctx context.Context) (*scheduler.Results, error) { - defer metrics.Measure(schedulingDuration)() - - // We collect the nodes with their used capacities before we get the list of pending pods. This ensures that - // the node capacities we schedule against are always >= what the actual capacity is at any given instance. This - // prevents over-provisioning at the cost of potentially under-provisioning which will self-heal during the next - // scheduling loop when we Launch a new node. When this order is reversed, our node capacity may be reduced by pods - // that have bound which we then provision new un-needed capacity for. - // ------- - // We don't consider the nodes that are MarkedForDeletion since this capacity shouldn't be considered - // as persistent capacity for the cluster (since it will soon be removed). Additionally, we are scheduling for - // the pods that are on these nodes so the MarkedForDeletion node capacity can't be considered. - nodes := p.cluster.Nodes() - - // Get pods, exit if nothing to do - pendingPods, err := p.GetPendingPods(ctx) - if err != nil { - return nil, err - } - // Get pods from nodes that are preparing for deletion - // We do this after getting the pending pods so that we undershoot if pods are - // actively migrating from a node that is being deleted - // NOTE: The assumption is that these nodes are cordoned and no additional pods will schedule to them - deletingNodePods, err := nodes.Deleting().Pods(ctx, p.kubeClient) - if err != nil { - return nil, err - } - pods := append(pendingPods, deletingNodePods...) - // nothing to schedule, so just return success - if len(pods) == 0 { - return &scheduler.Results{}, nil - } - scheduler, err := p.NewScheduler(ctx, pods, nodes.Active(), scheduler.SchedulerOptions{}) - if err != nil { - return nil, fmt.Errorf("creating scheduler, %w", err) - } - return scheduler.Solve(ctx, pods) -} - -func (p *Provisioner) Launch(ctx context.Context, m *scheduler.Machine, opts ...functional.Option[LaunchOptions]) (string, error) { - ctx = logging.WithLogger(ctx, logging.FromContext(ctx).With("provisioner", m.Labels[v1alpha5.ProvisionerNameLabelKey])) - - // Check limits - latest := &v1alpha5.Provisioner{} - if err := p.kubeClient.Get(ctx, types.NamespacedName{Name: m.ProvisionerName}, latest); err != nil { - return "", fmt.Errorf("getting current resource usage, %w", err) - } - if err := latest.Spec.Limits.ExceededBy(latest.Status.Resources); err != nil { - return "", err - } - options := functional.ResolveOptions(opts...) - - machine := m.ToMachine(latest) - if err := p.kubeClient.Create(ctx, machine); err != nil { - return "", err - } - instanceTypeRequirement, _ := lo.Find(machine.Spec.Requirements, func(req v1.NodeSelectorRequirement) bool { return req.Key == v1.LabelInstanceTypeStable }) - logging.FromContext(ctx).With("requests", machine.Spec.Resources.Requests, "instance-types", instanceTypeList(instanceTypeRequirement.Values)).Infof("created machine") - p.cluster.NominateNodeForPod(ctx, machine.Name) - metrics.MachinesCreatedCounter.With(prometheus.Labels{ - metrics.ReasonLabel: options.Reason, - metrics.ProvisionerLabel: machine.Labels[v1alpha5.ProvisionerNameLabelKey], - }).Inc() - if functional.ResolveOptions(opts...).RecordPodNomination { - for _, pod := range m.Pods { - p.recorder.Publish(schedulingevents.NominatePod(pod, nil, machine)) - } - } - return machine.Name, nil -} - -func instanceTypeList(names []string) string { - var itSb strings.Builder - for i, name := range names { - // print the first 5 instance types only (indices 0-4) - if i > 4 { - lo.Must(fmt.Fprintf(&itSb, " and %d other(s)", len(names)-i)) - break - } else if i > 0 { - lo.Must(fmt.Fprint(&itSb, ", ")) - } - lo.Must(fmt.Fprint(&itSb, name)) - } - return itSb.String() -} - -func (p *Provisioner) getDaemonSetPods(ctx context.Context) ([]*v1.Pod, error) { - daemonSetList := &appsv1.DaemonSetList{} - if err := p.kubeClient.List(ctx, daemonSetList); err != nil { - return nil, fmt.Errorf("listing daemonsets, %w", err) - } - - return lo.Map(daemonSetList.Items, func(d appsv1.DaemonSet, _ int) *v1.Pod { - pod := p.cluster.GetDaemonSetPod(&d) - if pod == nil { - pod = &v1.Pod{Spec: d.Spec.Template.Spec} - } - return pod - }), nil -} - -func (p *Provisioner) Validate(ctx context.Context, pod *v1.Pod) error { - return multierr.Combine( - validateProvisionerNameCanExist(pod), - validateAffinity(pod), - p.volumeTopology.ValidatePersistentVolumeClaims(ctx, pod), - ) -} - -// validateProvisionerNameCanExist provides a more clear error message in the event of scheduling a pod that specifically doesn't -// want to run on a Karpenter node (e.g. a Karpenter controller replica). -func validateProvisionerNameCanExist(p *v1.Pod) error { - for _, req := range scheduling.NewPodRequirements(p) { - if req.Key == v1alpha5.ProvisionerNameLabelKey && req.Operator() == v1.NodeSelectorOpDoesNotExist { - return fmt.Errorf("configured to not run on a Karpenter provisioned node via %s %s requirement", - v1alpha5.ProvisionerNameLabelKey, v1.NodeSelectorOpDoesNotExist) - } - } - return nil -} - -func (p *Provisioner) injectTopology(ctx context.Context, pods []*v1.Pod) []*v1.Pod { - var schedulablePods []*v1.Pod - for _, pod := range pods { - if err := p.volumeTopology.Inject(ctx, pod); err != nil { - logging.FromContext(ctx).With("pod", client.ObjectKeyFromObject(pod)).Errorf("getting volume topology requirements, %s", err) - } else { - schedulablePods = append(schedulablePods, pod) - } - } - return schedulablePods -} - -func validateAffinity(p *v1.Pod) (errs error) { - if p.Spec.Affinity == nil { - return nil - } - if p.Spec.Affinity.NodeAffinity != nil { - for _, term := range p.Spec.Affinity.NodeAffinity.PreferredDuringSchedulingIgnoredDuringExecution { - errs = multierr.Append(errs, validateNodeSelectorTerm(term.Preference)) - } - if p.Spec.Affinity.NodeAffinity.RequiredDuringSchedulingIgnoredDuringExecution != nil { - for _, term := range p.Spec.Affinity.NodeAffinity.RequiredDuringSchedulingIgnoredDuringExecution.NodeSelectorTerms { - errs = multierr.Append(errs, validateNodeSelectorTerm(term)) - } - } - } - return errs -} - -func validateNodeSelectorTerm(term v1.NodeSelectorTerm) (errs error) { - if term.MatchFields != nil { - errs = multierr.Append(errs, fmt.Errorf("node selector term with matchFields is not supported")) - } - if term.MatchExpressions != nil { - for _, requirement := range term.MatchExpressions { - errs = multierr.Append(errs, v1alpha5.ValidateRequirement(requirement)) - } - } - return errs -} diff --git a/vendor/github.com/aws/karpenter-core/pkg/controllers/provisioning/scheduling/machinetemplate.go b/vendor/github.com/aws/karpenter-core/pkg/controllers/provisioning/scheduling/machinetemplate.go deleted file mode 100644 index c341e205..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/controllers/provisioning/scheduling/machinetemplate.go +++ /dev/null @@ -1,111 +0,0 @@ -/* -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. -*/ - -package scheduling - -import ( - "fmt" - - "github.com/samber/lo" - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "knative.dev/pkg/ptr" - - "github.com/aws/karpenter-core/pkg/apis/v1alpha5" - "github.com/aws/karpenter-core/pkg/cloudprovider" - "github.com/aws/karpenter-core/pkg/scheduling" -) - -// MachineTemplate encapsulates the fields required to create a node and mirrors -// the fields in Provisioner. These structs are maintained separately in order -// for fields like Requirements to be able to be stored more efficiently. -type MachineTemplate struct { - ProvisionerName string - InstanceTypeOptions cloudprovider.InstanceTypes - Provider *v1alpha5.Provider - ProviderRef *v1alpha5.MachineTemplateRef - Annotations map[string]string - Labels map[string]string - Taints scheduling.Taints - StartupTaints scheduling.Taints - Requirements scheduling.Requirements - Requests v1.ResourceList - Kubelet *v1alpha5.KubeletConfiguration -} - -func NewMachineTemplate(provisioner *v1alpha5.Provisioner) *MachineTemplate { - labels := lo.Assign(provisioner.Spec.Labels, map[string]string{v1alpha5.ProvisionerNameLabelKey: provisioner.Name}) - requirements := scheduling.NewRequirements() - requirements.Add(scheduling.NewNodeSelectorRequirements(provisioner.Spec.Requirements...).Values()...) - requirements.Add(scheduling.NewLabelRequirements(labels).Values()...) - return &MachineTemplate{ - ProvisionerName: provisioner.Name, - Provider: provisioner.Spec.Provider, - ProviderRef: provisioner.Spec.ProviderRef, - Kubelet: provisioner.Spec.KubeletConfiguration, - Annotations: provisioner.Spec.Annotations, - Labels: labels, - Taints: provisioner.Spec.Taints, - StartupTaints: provisioner.Spec.StartupTaints, - Requirements: requirements, - } -} - -func (i *MachineTemplate) ToNode() *v1.Node { - return &v1.Node{ - ObjectMeta: metav1.ObjectMeta{ - Labels: lo.Assign(i.Labels, i.Requirements.Labels()), - Annotations: i.Annotations, - Finalizers: []string{v1alpha5.TerminationFinalizer}, - }, - Spec: v1.NodeSpec{ - Taints: append(i.Taints, i.StartupTaints...), - }, - } -} - -func (i *MachineTemplate) ToMachine(owner *v1alpha5.Provisioner) *v1alpha5.Machine { - // Order the instance types by price and only take the first 100 of them to decrease the instance type size in the requirements - instanceTypes := lo.Slice(i.InstanceTypeOptions.OrderByPrice(i.Requirements), 0, 100) - i.Requirements.Add(scheduling.NewRequirement(v1.LabelInstanceTypeStable, v1.NodeSelectorOpIn, lo.Map(instanceTypes, func(i *cloudprovider.InstanceType, _ int) string { - return i.Name - })...)) - m := &v1alpha5.Machine{ - ObjectMeta: metav1.ObjectMeta{ - GenerateName: fmt.Sprintf("%s-", i.ProvisionerName), - Annotations: lo.Assign(i.Annotations, v1alpha5.ProviderAnnotation(i.Provider)), - Labels: i.Labels, - OwnerReferences: []metav1.OwnerReference{ - { - APIVersion: v1alpha5.SchemeGroupVersion.String(), - Kind: "Provisioner", - Name: owner.Name, - UID: owner.UID, - BlockOwnerDeletion: ptr.Bool(true), - }, - }, - }, - Spec: v1alpha5.MachineSpec{ - Taints: i.Taints, - StartupTaints: i.StartupTaints, - Requirements: i.Requirements.NodeSelectorRequirements(), - Kubelet: i.Kubelet, - Resources: v1alpha5.ResourceRequirements{ - Requests: i.Requests, - }, - MachineTemplateRef: i.ProviderRef, - }, - } - return m -} diff --git a/vendor/github.com/aws/karpenter-core/pkg/controllers/provisioning/scheduling/scheduler.go b/vendor/github.com/aws/karpenter-core/pkg/controllers/provisioning/scheduling/scheduler.go deleted file mode 100644 index 663b096d..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/controllers/provisioning/scheduling/scheduler.go +++ /dev/null @@ -1,367 +0,0 @@ -/* -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. -*/ - -package scheduling - -import ( - "bytes" - "context" - "fmt" - "sort" - - "github.com/samber/lo" - "go.uber.org/multierr" - v1 "k8s.io/api/core/v1" - "knative.dev/pkg/logging" - "sigs.k8s.io/controller-runtime/pkg/client" - - "github.com/aws/karpenter-core/pkg/apis/v1alpha5" - "github.com/aws/karpenter-core/pkg/cloudprovider" - schedulingevents "github.com/aws/karpenter-core/pkg/controllers/provisioning/scheduling/events" - "github.com/aws/karpenter-core/pkg/controllers/state" - "github.com/aws/karpenter-core/pkg/events" - "github.com/aws/karpenter-core/pkg/scheduling" - "github.com/aws/karpenter-core/pkg/utils/resources" -) - -// SchedulerOptions can be used to control the scheduling, these options are currently only used during consolidation. -type SchedulerOptions struct { - // SimulationMode if true will prevent recording of the pod nomination decisions as events - SimulationMode bool -} - -func NewScheduler(ctx context.Context, kubeClient client.Client, machines []*MachineTemplate, - provisioners []v1alpha5.Provisioner, cluster *state.Cluster, stateNodes []*state.StateNode, topology *Topology, - instanceTypes map[string][]*cloudprovider.InstanceType, daemonSetPods []*v1.Pod, - recorder events.Recorder, opts SchedulerOptions) *Scheduler { - - // if any of the provisioners add a taint with a prefer no schedule effect, we add a toleration for the taint - // during preference relaxation - toleratePreferNoSchedule := false - for _, prov := range provisioners { - for _, taint := range prov.Spec.Taints { - if taint.Effect == v1.TaintEffectPreferNoSchedule { - toleratePreferNoSchedule = true - } - } - } - - s := &Scheduler{ - ctx: ctx, - kubeClient: kubeClient, - machineTemplates: machines, - topology: topology, - cluster: cluster, - instanceTypes: instanceTypes, - daemonOverhead: getDaemonOverhead(machines, daemonSetPods), - recorder: recorder, - opts: opts, - preferences: &Preferences{ToleratePreferNoSchedule: toleratePreferNoSchedule}, - remainingResources: map[string]v1.ResourceList{}, - } - for _, provisioner := range provisioners { - if provisioner.Spec.Limits != nil { - s.remainingResources[provisioner.Name] = provisioner.Spec.Limits.Resources - } - } - s.calculateExistingMachines(stateNodes, daemonSetPods) - return s -} - -type Scheduler struct { - ctx context.Context - newMachines []*Machine - existingNodes []*ExistingNode - machineTemplates []*MachineTemplate - remainingResources map[string]v1.ResourceList // provisioner name -> remaining resources for that provisioner - instanceTypes map[string][]*cloudprovider.InstanceType - daemonOverhead map[*MachineTemplate]v1.ResourceList - preferences *Preferences - topology *Topology - cluster *state.Cluster - recorder events.Recorder - opts SchedulerOptions - kubeClient client.Client -} - -// Results contains the results of the scheduling operation -type Results struct { - NewMachines []*Machine - ExistingNodes []*ExistingNode - PodErrors map[*v1.Pod]error -} - -func (r Results) AllPodsScheduled() bool { - return len(r.PodErrors) == 0 -} - -// PodSchedulingErrors creates a string that describes why pods wouldn't schedule that is suitable for presentation -func (r Results) PodSchedulingErrors() string { - if len(r.PodErrors) == 0 { - return "No Pod Scheduling Errors" - } - var msg bytes.Buffer - fmt.Fprintf(&msg, "not all pods would schedule, ") - const MaxErrors = 5 - numErrors := 0 - for k, err := range r.PodErrors { - fmt.Fprintf(&msg, "%s/%s => %s ", k.Namespace, k.Name, err) - numErrors++ - if numErrors >= MaxErrors { - fmt.Fprintf(&msg, " and %d other(s)", len(r.PodErrors)-MaxErrors) - break - } - } - return msg.String() -} - -func (s *Scheduler) Solve(ctx context.Context, pods []*v1.Pod) (*Results, error) { - // We loop trying to schedule unschedulable pods as long as we are making progress. This solves a few - // issues including pods with affinity to another pod in the batch. We could topo-sort to solve this, but it wouldn't - // solve the problem of scheduling pods where a particular order is needed to prevent a max-skew violation. E.g. if we - // had 5xA pods and 5xB pods were they have a zonal topology spread, but A can only go in one zone and B in another. - // We need to schedule them alternating, A, B, A, B, .... and this solution also solves that as well. - errors := map[*v1.Pod]error{} - q := NewQueue(pods...) - for { - // Try the next pod - pod, ok := q.Pop() - if !ok { - break - } - - // Schedule to existing nodes or create a new node - if errors[pod] = s.add(ctx, pod); errors[pod] == nil { - continue - } - - // If unsuccessful, relax the pod and recompute topology - relaxed := s.preferences.Relax(ctx, pod) - q.Push(pod, relaxed) - if relaxed { - if err := s.topology.Update(ctx, pod); err != nil { - logging.FromContext(ctx).Errorf("updating topology, %s", err) - } - } - } - - for _, m := range s.newMachines { - m.FinalizeScheduling() - } - if !s.opts.SimulationMode { - s.recordSchedulingResults(ctx, pods, q.List(), errors) - } - // clear any nil errors so we can know that len(PodErrors) == 0 => all pods scheduled - for k, v := range errors { - if v == nil { - delete(errors, k) - } - } - return &Results{ - NewMachines: s.newMachines, - ExistingNodes: s.existingNodes, - PodErrors: errors, - }, nil -} - -func (s *Scheduler) recordSchedulingResults(ctx context.Context, pods []*v1.Pod, failedToSchedule []*v1.Pod, errors map[*v1.Pod]error) { - // Report failures and nominations - for _, pod := range failedToSchedule { - logging.FromContext(ctx).With("pod", client.ObjectKeyFromObject(pod)).Errorf("Could not schedule pod, %s", errors[pod]) - s.recorder.Publish(schedulingevents.PodFailedToSchedule(pod, errors[pod])) - } - - for _, existing := range s.existingNodes { - if len(existing.Pods) > 0 { - s.cluster.NominateNodeForPod(ctx, existing.Name()) - } - for _, pod := range existing.Pods { - s.recorder.Publish(schedulingevents.NominatePod(pod, existing.Node, existing.Machine)) - } - } - - // Report new nodes, or exit to avoid log spam - newCount := 0 - for _, machine := range s.newMachines { - newCount += len(machine.Pods) - } - if newCount == 0 { - return - } - logging.FromContext(ctx).With("pods", len(pods)).Infof("found provisionable pod(s)") - logging.FromContext(ctx).With("machines", len(s.newMachines), "pods", newCount).Infof("computed new machine(s) to fit pod(s)") - // Report in flight newNodes, or exit to avoid log spam - inflightCount := 0 - existingCount := 0 - for _, node := range lo.Filter(s.existingNodes, func(node *ExistingNode, _ int) bool { return len(node.Pods) > 0 }) { - inflightCount++ - existingCount += len(node.Pods) - } - if existingCount == 0 { - return - } - logging.FromContext(ctx).Infof("computed %d unready node(s) will fit %d pod(s)", inflightCount, existingCount) -} - -func (s *Scheduler) add(ctx context.Context, pod *v1.Pod) error { - // first try to schedule against an in-flight real node - for _, node := range s.existingNodes { - if err := node.Add(ctx, s.kubeClient, pod); err == nil { - return nil - } - } - - // Consider using https://pkg.go.dev/container/heap - sort.Slice(s.newMachines, func(a, b int) bool { return len(s.newMachines[a].Pods) < len(s.newMachines[b].Pods) }) - - // Pick existing node that we are about to create - for _, machine := range s.newMachines { - if err := machine.Add(ctx, pod); err == nil { - return nil - } - } - - // Create new node - var errs error - for _, machineTemplate := range s.machineTemplates { - instanceTypes := s.instanceTypes[machineTemplate.ProvisionerName] - // if limits have been applied to the provisioner, ensure we filter instance types to avoid violating those limits - if remaining, ok := s.remainingResources[machineTemplate.ProvisionerName]; ok { - instanceTypes = filterByRemainingResources(s.instanceTypes[machineTemplate.ProvisionerName], remaining) - if len(instanceTypes) == 0 { - errs = multierr.Append(errs, fmt.Errorf("all available instance types exceed limits for provisioner: %q", machineTemplate.ProvisionerName)) - continue - } else if len(s.instanceTypes[machineTemplate.ProvisionerName]) != len(instanceTypes) && !s.opts.SimulationMode { - logging.FromContext(ctx).With("provisioner", machineTemplate.ProvisionerName).Debugf("%d out of %d instance types were excluded because they would breach provisioner limits", - len(s.instanceTypes[machineTemplate.ProvisionerName])-len(instanceTypes), len(s.instanceTypes[machineTemplate.ProvisionerName])) - } - } - - machine := NewMachine(machineTemplate, s.topology, s.daemonOverhead[machineTemplate], instanceTypes) - if err := machine.Add(ctx, pod); err != nil { - errs = multierr.Append(errs, fmt.Errorf("incompatible with provisioner %q, daemonset overhead=%s, %w", - machineTemplate.ProvisionerName, - resources.String(s.daemonOverhead[machineTemplate]), - err)) - continue - } - // we will launch this machine and need to track its maximum possible resource usage against our remaining resources - s.newMachines = append(s.newMachines, machine) - s.remainingResources[machineTemplate.ProvisionerName] = subtractMax(s.remainingResources[machineTemplate.ProvisionerName], machine.InstanceTypeOptions) - return nil - } - return errs -} - -func (s *Scheduler) calculateExistingMachines(stateNodes []*state.StateNode, daemonSetPods []*v1.Pod) { - // create our existing nodes - for _, node := range stateNodes { - if !node.Owned() { - // ignoring this node as it wasn't launched by us - continue - } - // Calculate any daemonsets that should schedule to the inflight node - var daemons []*v1.Pod - for _, p := range daemonSetPods { - if err := scheduling.Taints(node.Taints()).Tolerates(p); err != nil { - continue - } - if err := scheduling.NewLabelRequirements(node.Labels()).Compatible(scheduling.NewPodRequirements(p)); err != nil { - continue - } - daemons = append(daemons, p) - } - s.existingNodes = append(s.existingNodes, NewExistingNode(node, s.topology, resources.RequestsForPods(daemons...))) - - // We don't use the status field and instead recompute the remaining resources to ensure we have a consistent view - // of the cluster during scheduling. Depending on how node creation falls out, this will also work for cases where - // we don't create Machine resources. - if _, ok := s.remainingResources[node.Labels()[v1alpha5.ProvisionerNameLabelKey]]; ok { - s.remainingResources[node.Labels()[v1alpha5.ProvisionerNameLabelKey]] = resources.Subtract(s.remainingResources[node.Labels()[v1alpha5.ProvisionerNameLabelKey]], node.Capacity()) - } - } - // Order the existing nodes for scheduling with initialized nodes first - // This is done specifically for consolidation where we want to make sure we schedule to initialized nodes - // before we attempt to schedule un-initialized ones - sort.SliceStable(s.existingNodes, func(i, j int) bool { - if s.existingNodes[i].Initialized() && !s.existingNodes[j].Initialized() { - return true - } - if !s.existingNodes[i].Initialized() && s.existingNodes[j].Initialized() { - return false - } - return s.existingNodes[i].Name() < s.existingNodes[j].Name() - }) -} - -func getDaemonOverhead(nodeTemplates []*MachineTemplate, daemonSetPods []*v1.Pod) map[*MachineTemplate]v1.ResourceList { - overhead := map[*MachineTemplate]v1.ResourceList{} - - for _, nodeTemplate := range nodeTemplates { - var daemons []*v1.Pod - for _, p := range daemonSetPods { - if err := nodeTemplate.Taints.Tolerates(p); err != nil { - continue - } - if err := nodeTemplate.Requirements.Compatible(scheduling.NewPodRequirements(p)); err != nil { - continue - } - daemons = append(daemons, p) - } - overhead[nodeTemplate] = resources.RequestsForPods(daemons...) - } - return overhead -} - -// subtractMax returns the remaining resources after subtracting the max resource quantity per instance type. To avoid -// overshooting out, we need to pessimistically assume that if e.g. we request a 2, 4 or 8 CPU instance type -// that the 8 CPU instance type is all that will be available. This could cause a batch of pods to take multiple rounds -// to schedule. -func subtractMax(remaining v1.ResourceList, instanceTypes []*cloudprovider.InstanceType) v1.ResourceList { - // shouldn't occur, but to be safe - if len(instanceTypes) == 0 { - return remaining - } - var allInstanceResources []v1.ResourceList - for _, it := range instanceTypes { - allInstanceResources = append(allInstanceResources, it.Capacity) - } - result := v1.ResourceList{} - itResources := resources.MaxResources(allInstanceResources...) - for k, v := range remaining { - cp := v.DeepCopy() - cp.Sub(itResources[k]) - result[k] = cp - } - return result -} - -// filterByRemainingResources is used to filter out instance types that if launched would exceed the provisioner limits -func filterByRemainingResources(instanceTypes []*cloudprovider.InstanceType, remaining v1.ResourceList) []*cloudprovider.InstanceType { - var filtered []*cloudprovider.InstanceType - for _, it := range instanceTypes { - itResources := it.Capacity - viableInstance := true - for resourceName, remainingQuantity := range remaining { - // if the instance capacity is greater than the remaining quantity for this resource - if resources.Cmp(itResources[resourceName], remainingQuantity) > 0 { - viableInstance = false - } - } - if viableInstance { - filtered = append(filtered, it) - } - } - return filtered -} diff --git a/vendor/github.com/aws/karpenter-core/pkg/controllers/state/statenode.go b/vendor/github.com/aws/karpenter-core/pkg/controllers/state/statenode.go deleted file mode 100644 index 2e06ef71..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/controllers/state/statenode.go +++ /dev/null @@ -1,357 +0,0 @@ -/* -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. -*/ - -package state - -import ( - "context" - "time" - - "github.com/samber/lo" - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" - "sigs.k8s.io/controller-runtime/pkg/client" - - "github.com/aws/karpenter-core/pkg/apis/settings" - "github.com/aws/karpenter-core/pkg/apis/v1alpha5" - "github.com/aws/karpenter-core/pkg/scheduling" - nodeutils "github.com/aws/karpenter-core/pkg/utils/node" - podutils "github.com/aws/karpenter-core/pkg/utils/pod" - "github.com/aws/karpenter-core/pkg/utils/resources" -) - -// StateNodes is a typed version of a list of *Node -// nolint: revive -type StateNodes []*StateNode - -// Active filters StateNodes that are not in a MarkedForDeletion state -func (n StateNodes) Active() StateNodes { - return lo.Filter(n, func(node *StateNode, _ int) bool { - return !node.MarkedForDeletion() - }) -} - -// Deleting filters StateNodes that are in a MarkedForDeletion state -func (n StateNodes) Deleting() StateNodes { - return lo.Filter(n, func(node *StateNode, _ int) bool { - return node.MarkedForDeletion() - }) -} - -// Pods gets the pods assigned to all StateNodes based on the kubernetes api-server bindings -func (n StateNodes) Pods(ctx context.Context, c client.Client) ([]*v1.Pod, error) { - var pods []*v1.Pod - for _, node := range n { - p, err := node.Pods(ctx, c) - if err != nil { - return nil, err - } - pods = append(pods, p...) - } - return pods, nil -} - -// StateNode is a cached version of a node in the cluster that maintains state which is expensive to compute every time it's -// needed. This currently contains node utilization across all the allocatable resources, but will soon be used to -// compute topology information. -// +k8s:deepcopy-gen=true -// nolint: revive -type StateNode struct { - Node *v1.Node - Machine *v1alpha5.Machine - - inflightAllocatable v1.ResourceList // TODO @joinnis: This can be removed when machine is added - inflightCapacity v1.ResourceList // TODO @joinnis: This can be removed when machine is added - startupTaints []v1.Taint // TODO: @joinnis: This can be removed when machine is added - - // daemonSetRequests is the total amount of resources that have been requested by daemon sets. This allows users - // of the Node to identify the remaining resources that we expect future daemonsets to consume. - daemonSetRequests map[types.NamespacedName]v1.ResourceList - daemonSetLimits map[types.NamespacedName]v1.ResourceList - - podRequests map[types.NamespacedName]v1.ResourceList - podLimits map[types.NamespacedName]v1.ResourceList - - hostPortUsage *scheduling.HostPortUsage - volumeUsage *scheduling.VolumeUsage - volumeLimits scheduling.VolumeCount - - markedForDeletion bool - nominatedUntil metav1.Time -} - -func NewNode() *StateNode { - return &StateNode{ - inflightAllocatable: v1.ResourceList{}, - inflightCapacity: v1.ResourceList{}, - startupTaints: []v1.Taint{}, - daemonSetRequests: map[types.NamespacedName]v1.ResourceList{}, - daemonSetLimits: map[types.NamespacedName]v1.ResourceList{}, - podRequests: map[types.NamespacedName]v1.ResourceList{}, - podLimits: map[types.NamespacedName]v1.ResourceList{}, - hostPortUsage: &scheduling.HostPortUsage{}, - volumeUsage: scheduling.NewVolumeUsage(), - volumeLimits: scheduling.VolumeCount{}, - } -} - -func (in *StateNode) Name() string { - if in.Node == nil { - return in.Machine.Name - } - if in.Machine == nil { - return in.Node.Name - } - // TODO @joinnis: The !in.Initialized() check can be removed when we can assume that all nodes have the v1alpha5.NodeRegisteredLabel on them - // We can assume that all nodes will have this label and no back-propagation will be required once we hit v1 - if !in.Registered() && !in.Initialized() { - return in.Machine.Name - } - return in.Node.Name -} - -// Pods gets the pods assigned to the Node based on the kubernetes api-server bindings -func (in *StateNode) Pods(ctx context.Context, c client.Client) ([]*v1.Pod, error) { - if in.Node == nil { - return nil, nil - } - return nodeutils.GetNodePods(ctx, c, in.Node) -} - -func (in *StateNode) HostName() string { - if in.Labels()[v1.LabelHostname] == "" { - return in.Name() - } - return in.Labels()[v1.LabelHostname] -} - -func (in *StateNode) Annotations() map[string]string { - // If the machine exists and the state node isn't initialized - // use the machine representation of the annotations - if in.Node == nil { - return in.Machine.Annotations - } - if in.Machine == nil { - return in.Node.Annotations - } - // TODO @joinnis: The !in.Initialized() check can be removed when we can assume that all nodes have the v1alpha5.NodeRegisteredLabel on them - // We can assume that all nodes will have this label and no back-propagation will be required once we hit v1 - if !in.Registered() && !in.Initialized() { - return in.Machine.Annotations - } - return in.Node.Annotations -} - -func (in *StateNode) Labels() map[string]string { - // If the machine exists and the state node isn't registered - // use the machine representation of the labels - if in.Node == nil { - return in.Machine.Labels - } - if in.Machine == nil { - return in.Node.Labels - } - // TODO @joinnis: The !in.Initialized() check can be removed when we can assume that all nodes have the v1alpha5.NodeRegisteredLabel on them - // We can assume that all nodes will have this label and no back-propagation will be required once we hit v1 - if !in.Registered() && !in.Initialized() { - return in.Machine.Labels - } - return in.Node.Labels -} - -func (in *StateNode) Taints() []v1.Taint { - // Only consider startup taints until the node is initialized. Without this, if the startup taint is generic and - // re-appears on the node for a different reason (e.g. the node is cordoned) we will assume that pods can - // schedule against the node in the future incorrectly. - ephemeralTaints := scheduling.KnownEphemeralTaints - if !in.Initialized() && in.Owned() { - if in.Machine != nil { - ephemeralTaints = append(ephemeralTaints, in.Machine.Spec.StartupTaints...) - } else { - ephemeralTaints = append(ephemeralTaints, in.startupTaints...) - } - } - - var taints []v1.Taint - // TODO @joinnis: The !in.Initialized() check can be removed when we can assume that all nodes have the v1alpha5.NodeRegisteredLabel on them - // We can assume that all nodes will have this label and no back-propagation will be required once we hit v1 - if !in.Registered() && !in.Initialized() && in.Machine != nil { - taints = in.Machine.Spec.Taints - } else { - taints = in.Node.Spec.Taints - } - return lo.Reject(taints, func(taint v1.Taint, _ int) bool { - _, found := lo.Find(ephemeralTaints, func(t v1.Taint) bool { - return t.MatchTaint(&taint) - }) - return found - }) -} - -func (in *StateNode) Registered() bool { - if in.Node != nil { - return in.Node.Labels[v1alpha5.LabelNodeRegistered] == "true" - } - return false -} - -func (in *StateNode) Initialized() bool { - if in.Node != nil { - return in.Node.Labels[v1alpha5.LabelNodeInitialized] == "true" - } - return false -} - -func (in *StateNode) Capacity() v1.ResourceList { - if !in.Initialized() && in.Machine != nil { - // Override any zero quantity values in the node status - if in.Node != nil { - ret := lo.Assign(in.Node.Status.Capacity) - for resourceName, quantity := range in.Machine.Status.Capacity { - if resources.IsZero(ret[resourceName]) { - ret[resourceName] = quantity - } - } - return ret - } - return in.Machine.Status.Capacity - } - // TODO @joinnis: Remove this when machine migration is complete - if !in.Initialized() && in.Owned() { - // Override any zero quantity values in the node status - ret := lo.Assign(in.Node.Status.Capacity) - for resourceName, quantity := range in.inflightCapacity { - if resources.IsZero(ret[resourceName]) { - ret[resourceName] = quantity - } - } - return ret - } - return in.Node.Status.Capacity -} - -func (in *StateNode) Allocatable() v1.ResourceList { - if !in.Initialized() && in.Machine != nil { - // Override any zero quantity values in the node status - if in.Node != nil { - ret := lo.Assign(in.Node.Status.Allocatable) - for resourceName, quantity := range in.Machine.Status.Allocatable { - if resources.IsZero(ret[resourceName]) { - ret[resourceName] = quantity - } - } - return ret - } - return in.Machine.Status.Allocatable - } - // TODO @joinnis: Remove this when machine migration is complete - if !in.Initialized() && in.Owned() { - // Override any zero quantity values in the node status - ret := lo.Assign(in.Node.Status.Allocatable) - for resourceName, quantity := range in.inflightAllocatable { - if resources.IsZero(ret[resourceName]) { - ret[resourceName] = quantity - } - } - return ret - } - return in.Node.Status.Allocatable -} - -// Available is allocatable minus anything allocated to pods. -func (in *StateNode) Available() v1.ResourceList { - return resources.Subtract(in.Allocatable(), in.PodRequests()) -} - -func (in *StateNode) DaemonSetRequests() v1.ResourceList { - return resources.Merge(lo.Values(in.daemonSetRequests)...) -} - -func (in *StateNode) DaemonSetLimits() v1.ResourceList { - return resources.Merge(lo.Values(in.daemonSetLimits)...) -} - -func (in *StateNode) HostPortUsage() *scheduling.HostPortUsage { - return in.hostPortUsage -} - -func (in *StateNode) VolumeUsage() *scheduling.VolumeUsage { - return in.volumeUsage -} - -func (in *StateNode) VolumeLimits() scheduling.VolumeCount { - return in.volumeLimits -} - -func (in *StateNode) PodRequests() v1.ResourceList { - return resources.Merge(lo.Values(in.podRequests)...) -} - -func (in *StateNode) PodLimits() v1.ResourceList { - return resources.Merge(lo.Values(in.podLimits)...) -} - -func (in *StateNode) MarkedForDeletion() bool { - // The Node is marked for the Deletion if: - // 1. The Node has explicitly MarkedForDeletion - // 2. The Node has a Machine counterpart and is actively deleting - // 3. The Node has no Machine counterpart and is actively deleting - return in.markedForDeletion || - (in.Machine != nil && !in.Machine.DeletionTimestamp.IsZero()) || - (in.Node != nil && in.Machine == nil && !in.Node.DeletionTimestamp.IsZero()) -} - -func (in *StateNode) Nominate(ctx context.Context) { - in.nominatedUntil = metav1.Time{Time: time.Now().Add(nominationWindow(ctx))} -} - -func (in *StateNode) Nominated() bool { - return in.nominatedUntil.After(time.Now()) -} - -func (in *StateNode) Owned() bool { - return in.Labels()[v1alpha5.ProvisionerNameLabelKey] != "" -} - -func (in *StateNode) updateForPod(ctx context.Context, kubeClient client.Client, pod *v1.Pod) { - podKey := client.ObjectKeyFromObject(pod) - - in.podRequests[podKey] = resources.RequestsForPods(pod) - in.podLimits[podKey] = resources.LimitsForPods(pod) - // if it's a daemonset, we track what it has requested separately - if podutils.IsOwnedByDaemonSet(pod) { - in.daemonSetRequests[podKey] = resources.RequestsForPods(pod) - in.daemonSetLimits[podKey] = resources.LimitsForPods(pod) - } - in.hostPortUsage.Add(ctx, pod) - in.volumeUsage.Add(ctx, kubeClient, pod) -} - -func (in *StateNode) cleanupForPod(podKey types.NamespacedName) { - in.hostPortUsage.DeletePod(podKey) - in.volumeUsage.DeletePod(podKey) - delete(in.podRequests, podKey) - delete(in.podLimits, podKey) - delete(in.daemonSetRequests, podKey) - delete(in.daemonSetLimits, podKey) -} - -func nominationWindow(ctx context.Context) time.Duration { - nominationPeriod := 2 * settings.FromContext(ctx).BatchMaxDuration.Duration - if nominationPeriod < 10*time.Second { - nominationPeriod = 10 * time.Second - } - return nominationPeriod -} diff --git a/vendor/github.com/aws/karpenter-core/pkg/controllers/termination/controller.go b/vendor/github.com/aws/karpenter-core/pkg/controllers/termination/controller.go deleted file mode 100644 index 3efda1a0..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/controllers/termination/controller.go +++ /dev/null @@ -1,151 +0,0 @@ -/* -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. -*/ - -package termination - -import ( - "context" - "fmt" - "time" - - "github.com/prometheus/client_golang/prometheus" - "golang.org/x/time/rate" - v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/equality" - "k8s.io/client-go/util/workqueue" - "knative.dev/pkg/logging" - controllerruntime "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/controller" - "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" - "sigs.k8s.io/controller-runtime/pkg/manager" - "sigs.k8s.io/controller-runtime/pkg/reconcile" - - "github.com/aws/karpenter-core/pkg/apis/v1alpha5" - "github.com/aws/karpenter-core/pkg/cloudprovider" - "github.com/aws/karpenter-core/pkg/controllers/termination/terminator" - terminatorevents "github.com/aws/karpenter-core/pkg/controllers/termination/terminator/events" - "github.com/aws/karpenter-core/pkg/events" - "github.com/aws/karpenter-core/pkg/metrics" - corecontroller "github.com/aws/karpenter-core/pkg/operator/controller" - machineutil "github.com/aws/karpenter-core/pkg/utils/machine" -) - -var _ corecontroller.FinalizingTypedController[*v1.Node] = (*Controller)(nil) - -// Controller for the resource -type Controller struct { - kubeClient client.Client - cloudProvider cloudprovider.CloudProvider - terminator *terminator.Terminator - recorder events.Recorder -} - -// NewController constructs a controller instance -func NewController(kubeClient client.Client, cloudProvider cloudprovider.CloudProvider, terminator *terminator.Terminator, recorder events.Recorder) corecontroller.Controller { - return corecontroller.Typed[*v1.Node](kubeClient, &Controller{ - kubeClient: kubeClient, - cloudProvider: cloudProvider, - terminator: terminator, - recorder: recorder, - }) -} - -func (c *Controller) Name() string { - return "termination" -} - -func (c *Controller) Reconcile(_ context.Context, _ *v1.Node) (reconcile.Result, error) { - return reconcile.Result{}, nil -} - -//nolint:gocyclo -func (c *Controller) Finalize(ctx context.Context, node *v1.Node) (reconcile.Result, error) { - if !controllerutil.ContainsFinalizer(node, v1alpha5.TerminationFinalizer) { - return reconcile.Result{}, nil - } - if err := c.deleteAllMachines(ctx, node); err != nil { - return reconcile.Result{}, fmt.Errorf("deleting machines, %w", err) - } - if err := c.terminator.Cordon(ctx, node); err != nil { - return reconcile.Result{}, fmt.Errorf("cordoning node, %w", err) - } - if err := c.terminator.Drain(ctx, node); err != nil { - if !terminator.IsNodeDrainError(err) { - return reconcile.Result{}, fmt.Errorf("draining node, %w", err) - } - c.recorder.Publish(terminatorevents.NodeFailedToDrain(node, err)) - // If the underlying machine no longer exists. - if _, err := c.cloudProvider.Get(ctx, node.Spec.ProviderID); err != nil { - if cloudprovider.IsMachineNotFoundError(err) { - return reconcile.Result{}, c.removeFinalizer(ctx, node) - } - return reconcile.Result{}, fmt.Errorf("getting machine, %w", err) - } - return reconcile.Result{RequeueAfter: 1 * time.Second}, nil - } - - if err := c.cloudProvider.Delete(ctx, machineutil.NewFromNode(node)); cloudprovider.IgnoreMachineNotFoundError(err) != nil { - return reconcile.Result{}, fmt.Errorf("terminating cloudprovider instance, %w", err) - } - return reconcile.Result{}, c.removeFinalizer(ctx, node) -} - -func (c *Controller) deleteAllMachines(ctx context.Context, node *v1.Node) error { - machineList := &v1alpha5.MachineList{} - if err := c.kubeClient.List(ctx, machineList, client.MatchingFields{"status.providerID": node.Spec.ProviderID}); err != nil { - return err - } - for i := range machineList.Items { - if err := c.kubeClient.Delete(ctx, &machineList.Items[i]); err != nil { - return client.IgnoreNotFound(err) - } - } - return nil -} - -func (c *Controller) removeFinalizer(ctx context.Context, n *v1.Node) error { - stored := n.DeepCopy() - controllerutil.RemoveFinalizer(n, v1alpha5.TerminationFinalizer) - if !equality.Semantic.DeepEqual(stored, n) { - if err := c.kubeClient.Patch(ctx, n, client.MergeFrom(stored)); err != nil { - return client.IgnoreNotFound(fmt.Errorf("patching node, %w", err)) - } - metrics.NodesTerminatedCounter.With(prometheus.Labels{ - metrics.ProvisionerLabel: n.Labels[v1alpha5.ProvisionerNameLabelKey], - }).Inc() - // We use stored.DeletionTimestamp since the api-server may give back a node after the patch without a deletionTimestamp - TerminationSummary.With(prometheus.Labels{ - metrics.ProvisionerLabel: n.Labels[v1alpha5.ProvisionerNameLabelKey], - }).Observe(time.Since(stored.DeletionTimestamp.Time).Seconds()) - logging.FromContext(ctx).Infof("deleted node") - } - return nil -} - -func (c *Controller) Builder(_ context.Context, m manager.Manager) corecontroller.Builder { - return corecontroller.Adapt(controllerruntime. - NewControllerManagedBy(m). - For(&v1.Node{}). - WithOptions( - controller.Options{ - RateLimiter: workqueue.NewMaxOfRateLimiter( - workqueue.NewItemExponentialFailureRateLimiter(100*time.Millisecond, 10*time.Second), - // 10 qps, 100 bucket size - &workqueue.BucketRateLimiter{Limiter: rate.NewLimiter(rate.Limit(10), 100)}, - ), - MaxConcurrentReconciles: 100, - }, - )) -} diff --git a/vendor/github.com/aws/karpenter-core/pkg/controllers/termination/terminator/events/events.go b/vendor/github.com/aws/karpenter-core/pkg/controllers/termination/terminator/events/events.go deleted file mode 100644 index 019d5eec..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/controllers/termination/terminator/events/events.go +++ /dev/null @@ -1,43 +0,0 @@ -/* -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. -*/ - -package events - -import ( - "fmt" - - v1 "k8s.io/api/core/v1" - - "github.com/aws/karpenter-core/pkg/events" -) - -func EvictPod(pod *v1.Pod) events.Event { - return events.Event{ - InvolvedObject: pod, - Type: v1.EventTypeNormal, - Reason: "Evicted", - Message: "Evicted pod", - DedupeValues: []string{pod.Name}, - } -} - -func NodeFailedToDrain(node *v1.Node, err error) events.Event { - return events.Event{ - InvolvedObject: node, - Type: v1.EventTypeWarning, - Reason: "FailedDraining", - Message: fmt.Sprintf("Failed to drain node, %s", err), - DedupeValues: []string{node.Name}, - } -} diff --git a/vendor/github.com/aws/karpenter-core/pkg/controllers/termination/terminator/eviction.go b/vendor/github.com/aws/karpenter-core/pkg/controllers/termination/terminator/eviction.go deleted file mode 100644 index cbea0fdb..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/controllers/termination/terminator/eviction.go +++ /dev/null @@ -1,134 +0,0 @@ -/* -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. -*/ - -package terminator - -import ( - "context" - "errors" - "fmt" - "time" - - set "github.com/deckarep/golang-set" - v1 "k8s.io/api/core/v1" - "k8s.io/api/policy/v1beta1" - apierrors "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" - corev1 "k8s.io/client-go/kubernetes/typed/core/v1" - "k8s.io/client-go/util/workqueue" - "knative.dev/pkg/logging" - "sigs.k8s.io/controller-runtime/pkg/client" - - terminatorevents "github.com/aws/karpenter-core/pkg/controllers/termination/terminator/events" - "github.com/aws/karpenter-core/pkg/events" -) - -const ( - evictionQueueBaseDelay = 100 * time.Millisecond - evictionQueueMaxDelay = 10 * time.Second -) - -type NodeDrainError struct { - error -} - -func NewNodeDrainError(err error) *NodeDrainError { - return &NodeDrainError{error: err} -} - -func IsNodeDrainError(err error) bool { - if err == nil { - return false - } - var nodeDrainErr *NodeDrainError - return errors.As(err, &nodeDrainErr) -} - -type EvictionQueue struct { - workqueue.RateLimitingInterface - set.Set - - coreV1Client corev1.CoreV1Interface - recorder events.Recorder -} - -func NewEvictionQueue(ctx context.Context, coreV1Client corev1.CoreV1Interface, recorder events.Recorder) *EvictionQueue { - queue := &EvictionQueue{ - RateLimitingInterface: workqueue.NewRateLimitingQueue(workqueue.NewItemExponentialFailureRateLimiter(evictionQueueBaseDelay, evictionQueueMaxDelay)), - Set: set.NewSet(), - coreV1Client: coreV1Client, - recorder: recorder, - } - go queue.Start(logging.WithLogger(ctx, logging.FromContext(ctx).Named("eviction"))) - return queue -} - -// Add adds pods to the EvictionQueue -func (e *EvictionQueue) Add(pods ...*v1.Pod) { - for _, pod := range pods { - if nn := client.ObjectKeyFromObject(pod); !e.Set.Contains(nn) { - e.Set.Add(nn) - e.RateLimitingInterface.Add(nn) - } - } -} - -func (e *EvictionQueue) Start(ctx context.Context) { - for { - // Get pod from queue. This waits until queue is non-empty. - item, shutdown := e.RateLimitingInterface.Get() - if shutdown { - break - } - nn := item.(types.NamespacedName) - // Evict pod - if e.evict(ctx, nn) { - e.RateLimitingInterface.Forget(nn) - e.Set.Remove(nn) - e.RateLimitingInterface.Done(nn) - continue - } - e.RateLimitingInterface.Done(nn) - // Requeue pod if eviction failed - e.RateLimitingInterface.AddRateLimited(nn) - } - logging.FromContext(ctx).Errorf("EvictionQueue is broken and has shutdown") -} - -// evict returns true if successful eviction call, and false if not an eviction-related error -func (e *EvictionQueue) evict(ctx context.Context, nn types.NamespacedName) bool { - ctx = logging.WithLogger(ctx, logging.FromContext(ctx).With("pod", nn)) - err := e.coreV1Client.Pods(nn.Namespace).Evict(ctx, &v1beta1.Eviction{ - ObjectMeta: metav1.ObjectMeta{Name: nn.Name, Namespace: nn.Namespace}, - }) - // status codes for the eviction API are defined here: - // https://kubernetes.io/docs/concepts/scheduling-eviction/api-eviction/#how-api-initiated-eviction-works - if apierrors.IsNotFound(err) { // 404 - return true - } - if apierrors.IsTooManyRequests(err) { // 429 - PDB violation - e.recorder.Publish(terminatorevents.NodeFailedToDrain(&v1.Node{ObjectMeta: metav1.ObjectMeta{ - Name: nn.Name, - Namespace: nn.Namespace, - }}, fmt.Errorf("evicting pod %s/%s violates a PDB", nn.Namespace, nn.Name))) - return false - } - if err != nil { - logging.FromContext(ctx).Errorf("evicting pod, %s", err) - return false - } - e.recorder.Publish(terminatorevents.EvictPod(&v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: nn.Name, Namespace: nn.Namespace}})) - return true -} diff --git a/vendor/github.com/aws/karpenter-core/pkg/controllers/termination/terminator/terminator.go b/vendor/github.com/aws/karpenter-core/pkg/controllers/termination/terminator/terminator.go deleted file mode 100644 index 4aecf57c..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/controllers/termination/terminator/terminator.go +++ /dev/null @@ -1,145 +0,0 @@ -/* -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. -*/ - -package terminator - -import ( - "context" - "fmt" - "time" - - "github.com/samber/lo" - v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/equality" - "k8s.io/utils/clock" - "knative.dev/pkg/logging" - "sigs.k8s.io/controller-runtime/pkg/client" - - podutil "github.com/aws/karpenter-core/pkg/utils/pod" -) - -type Terminator struct { - clock clock.Clock - kubeClient client.Client - evictionQueue *EvictionQueue -} - -func NewTerminator(clk clock.Clock, kubeClient client.Client, eq *EvictionQueue) *Terminator { - return &Terminator{ - clock: clk, - kubeClient: kubeClient, - evictionQueue: eq, - } -} - -// Cordon cordons a node -func (t *Terminator) Cordon(ctx context.Context, node *v1.Node) error { - stored := node.DeepCopy() - node.Spec.Unschedulable = true - // Adding this label to the node ensures that the node is removed from the load-balancer target group - // while it is draining and before it is terminated. This prevents 500s coming prior to health check - // when the load balancer controller hasn't yet determined that the node and underlying connections are gone - // https://github.com/aws/aws-node-termination-handler/issues/316 - // https://github.com/aws/karpenter/pull/2518 - node.Labels = lo.Assign(node.Labels, map[string]string{ - v1.LabelNodeExcludeBalancers: "karpenter", - }) - if !equality.Semantic.DeepEqual(node, stored) { - if err := t.kubeClient.Patch(ctx, node, client.MergeFrom(stored)); err != nil { - return err - } - logging.FromContext(ctx).Infof("cordoned node") - } - return nil -} - -// Drain evicts pods from the node and returns true when all pods are evicted -// https://kubernetes.io/docs/concepts/architecture/nodes/#graceful-node-shutdown -func (t *Terminator) Drain(ctx context.Context, node *v1.Node) error { - // Get evictable pods - pods, err := t.getPods(ctx, node) - if err != nil { - return fmt.Errorf("listing pods for node, %w", err) - } - var podsToEvict []*v1.Pod - // Skip node due to pods that are not able to be evicted - for _, p := range pods { - // Ignore if unschedulable is tolerated, since they will reschedule - if podutil.ToleratesUnschedulableTaint(p) { - continue - } - // Ignore static mirror pods - if podutil.IsOwnedByNode(p) { - continue - } - podsToEvict = append(podsToEvict, p) - } - // Enqueue for eviction - t.evict(podsToEvict) - - if len(podsToEvict) > 0 { - return NewNodeDrainError(fmt.Errorf("%d pods are waiting to be evicted", len(podsToEvict))) - } - return nil -} - -// getPods returns a list of evictable pods for the node -func (t *Terminator) getPods(ctx context.Context, node *v1.Node) ([]*v1.Pod, error) { - podList := &v1.PodList{} - if err := t.kubeClient.List(ctx, podList, client.MatchingFields{"spec.nodeName": node.Name}); err != nil { - return nil, fmt.Errorf("listing pods on node, %w", err) - } - var pods []*v1.Pod - for _, p := range podList.Items { - // Ignore if the pod is complete and doesn't need to be evicted - if podutil.IsTerminal(lo.ToPtr(p)) { - continue - } - // Ignore if kubelet is partitioned and pods are beyond graceful termination window - if t.isStuckTerminating(lo.ToPtr(p)) { - continue - } - pods = append(pods, lo.ToPtr(p)) - } - return pods, nil -} - -func (t *Terminator) evict(pods []*v1.Pod) { - // 1. Prioritize noncritical pods https://kubernetes.io/docs/concepts/architecture/nodes/#graceful-node-shutdown - critical := []*v1.Pod{} - nonCritical := []*v1.Pod{} - for _, pod := range pods { - if !pod.DeletionTimestamp.IsZero() { - continue - } - if pod.Spec.PriorityClassName == "system-cluster-critical" || pod.Spec.PriorityClassName == "system-node-critical" { - critical = append(critical, pod) - } else { - nonCritical = append(nonCritical, pod) - } - } - // 2. Evict critical pods if all noncritical are evicted - if len(nonCritical) == 0 { - t.evictionQueue.Add(critical...) - } else { - t.evictionQueue.Add(nonCritical...) - } -} - -func (t *Terminator) isStuckTerminating(pod *v1.Pod) bool { - if pod.DeletionTimestamp == nil { - return false - } - return t.clock.Now().After(pod.DeletionTimestamp.Time.Add(1 * time.Minute)) -} diff --git a/vendor/github.com/aws/karpenter-core/pkg/metrics/metrics.go b/vendor/github.com/aws/karpenter-core/pkg/metrics/metrics.go deleted file mode 100644 index 83d9b1f0..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/metrics/metrics.go +++ /dev/null @@ -1,112 +0,0 @@ -/* -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. -*/ - -package metrics - -import ( - "github.com/prometheus/client_golang/prometheus" - crmetrics "sigs.k8s.io/controller-runtime/pkg/metrics" -) - -const ( - nodeSubsystem = "nodes" - machineSubsystem = "machines" -) - -var ( - MachinesCreatedCounter = prometheus.NewCounterVec( - prometheus.CounterOpts{ - Namespace: Namespace, - Subsystem: machineSubsystem, - Name: "created", - Help: "Number of machines created in total by Karpenter. Labeled by reason the machine was created and the owning provisioner.", - }, - []string{ - ReasonLabel, - ProvisionerLabel, - }, - ) - MachinesTerminatedCounter = prometheus.NewCounterVec( - prometheus.CounterOpts{ - Namespace: Namespace, - Subsystem: machineSubsystem, - Name: "terminated", - Help: "Number of machines terminated in total by Karpenter. Labeled by reason the machine was terminated.", - }, - []string{ - ReasonLabel, - ProvisionerLabel, - }, - ) - MachinesLaunchedCounter = prometheus.NewCounterVec( - prometheus.CounterOpts{ - Namespace: Namespace, - Subsystem: machineSubsystem, - Name: "launched", - Help: "Number of machines launched in total by Karpenter. Labeled by the owning provisioner.", - }, - []string{ - ProvisionerLabel, - }, - ) - MachinesRegisteredCounter = prometheus.NewCounterVec( - prometheus.CounterOpts{ - Namespace: Namespace, - Subsystem: machineSubsystem, - Name: "registered", - Help: "Number of machines registered in total by Karpenter. Labeled by the owning provisioner.", - }, - []string{ - ProvisionerLabel, - }, - ) - MachinesInitializedCounter = prometheus.NewCounterVec( - prometheus.CounterOpts{ - Namespace: Namespace, - Subsystem: machineSubsystem, - Name: "initialized", - Help: "Number of machines initialized in total by Karpenter. Labeled by the owning provisioner.", - }, - []string{ - ProvisionerLabel, - }, - ) - NodesCreatedCounter = prometheus.NewCounterVec( - prometheus.CounterOpts{ - Namespace: Namespace, - Subsystem: nodeSubsystem, - Name: "created", - Help: "Number of nodes created in total by Karpenter. Labeled by owning provisioner.", - }, - []string{ - ProvisionerLabel, - }, - ) - NodesTerminatedCounter = prometheus.NewCounterVec( - prometheus.CounterOpts{ - Namespace: Namespace, - Subsystem: nodeSubsystem, - Name: "terminated", - Help: "Number of nodes terminated in total by Karpenter. Labeled by owning provisioner.", - }, - []string{ - ProvisionerLabel, - }, - ) -) - -func init() { - crmetrics.Registry.MustRegister(MachinesCreatedCounter, MachinesTerminatedCounter, MachinesLaunchedCounter, - MachinesRegisteredCounter, MachinesInitializedCounter, NodesCreatedCounter, NodesTerminatedCounter) -} diff --git a/vendor/github.com/aws/karpenter-core/pkg/operator/controller/controller.go b/vendor/github.com/aws/karpenter-core/pkg/operator/controller/controller.go deleted file mode 100644 index 500d88ab..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/operator/controller/controller.go +++ /dev/null @@ -1,61 +0,0 @@ -/* -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. -*/ - -package controller - -import ( - "context" - - controllerruntime "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/manager" - "sigs.k8s.io/controller-runtime/pkg/reconcile" -) - -type Reconciler interface { - reconcile.Reconciler - // Name is the name of the Reconciler for metrics and logging - Name() string -} - -// Controller defines a controller that can be registered with controller-runtime -type Controller interface { - Reconciler - - // Builder returns a Builder registered with the manager that can be wrapped - // with other Builders and completed later to complete registration to the manager - Builder(context.Context, manager.Manager) Builder -} - -// Builder is a struct, that when complete, registers the passed reconciler with the manager stored -// insider of the builder. Typed reference implementations, see controllerruntime.Builder -type Builder interface { - // Complete builds a builder by registering the Reconciler with the manager - Complete(Reconciler) error -} - -// Adapter adapts a controllerruntime.Builder into the Builder interface -type Adapter struct { - builder *controllerruntime.Builder -} - -func Adapt(builder *controllerruntime.Builder) Builder { - return &Adapter{ - builder: builder, - } -} - -func (a *Adapter) Complete(r Reconciler) error { - a.builder = a.builder.Named(r.Name()) - return a.builder.Complete(r) -} diff --git a/vendor/github.com/aws/karpenter-core/pkg/operator/controller/singleton.go b/vendor/github.com/aws/karpenter-core/pkg/operator/controller/singleton.go deleted file mode 100644 index e4022632..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/operator/controller/singleton.go +++ /dev/null @@ -1,176 +0,0 @@ -/* -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. -*/ - -package controller - -import ( - "context" - "errors" - "time" - - "github.com/prometheus/client_golang/prometheus" - "k8s.io/client-go/util/workqueue" - "knative.dev/pkg/logging" - "sigs.k8s.io/controller-runtime/pkg/manager" - crmetrics "sigs.k8s.io/controller-runtime/pkg/metrics" - "sigs.k8s.io/controller-runtime/pkg/ratelimiter" - "sigs.k8s.io/controller-runtime/pkg/reconcile" - - "github.com/aws/karpenter-core/pkg/metrics" -) - -type SingletonBuilder struct { - mgr manager.Manager -} - -func NewSingletonManagedBy(m manager.Manager) SingletonBuilder { - return SingletonBuilder{ - mgr: m, - } -} - -func (b SingletonBuilder) Complete(r Reconciler) error { - return b.mgr.Add(newSingleton(r)) -} - -type Singleton struct { - Reconciler - rateLimiter ratelimiter.RateLimiter -} - -func newSingleton(r Reconciler) *Singleton { - s := &Singleton{ - Reconciler: r, - rateLimiter: workqueue.DefaultItemBasedRateLimiter(), - } - s.initMetrics() - return s -} - -// initMetrics is effectively the same metrics initialization function used by controller-runtime -// https://github.com/kubernetes-sigs/controller-runtime/blob/main/pkg/internal/controller/controller.go -func (s *Singleton) initMetrics() { - activeWorkers.WithLabelValues(s.Name()).Set(0) - reconcileErrors.WithLabelValues(s.Name()).Add(0) - reconcileTotal.WithLabelValues(s.Name(), labelError).Add(0) - reconcileTotal.WithLabelValues(s.Name(), labelRequeueAfter).Add(0) - reconcileTotal.WithLabelValues(s.Name(), labelRequeue).Add(0) - reconcileTotal.WithLabelValues(s.Name(), labelSuccess).Add(0) - workerCount.WithLabelValues(s.Name()).Set(float64(1)) -} - -var singletonRequest = reconcile.Request{} - -func (s *Singleton) Start(ctx context.Context) error { - ctx = logging.WithLogger(ctx, logging.FromContext(ctx).Named(s.Name())) - logging.FromContext(ctx).Infof("starting controller") - defer logging.FromContext(ctx).Infof("stopping controller") - - for { - select { - case <-time.After(s.reconcile(ctx)): - case <-ctx.Done(): - return nil - } - } -} - -func (s *Singleton) reconcile(ctx context.Context) time.Duration { - activeWorkers.WithLabelValues(s.Name()).Inc() - defer activeWorkers.WithLabelValues(s.Name()).Dec() - - measureDuration := metrics.Measure(reconcileDuration.WithLabelValues(s.Name())) - res, err := s.Reconcile(ctx, singletonRequest) - measureDuration() // Observe the length of time between the function creation and now - - switch { - case err != nil: - reconcileErrors.WithLabelValues(s.Name()).Inc() - reconcileTotal.WithLabelValues(s.Name(), labelError).Inc() - logging.FromContext(ctx).Error(err) - return s.rateLimiter.When(singletonRequest) - case res.Requeue: - reconcileTotal.WithLabelValues(s.Name(), labelRequeue).Inc() - return s.rateLimiter.When(singletonRequest) - default: - s.rateLimiter.Forget(singletonRequest) - switch { - case res.RequeueAfter > 0: - reconcileTotal.WithLabelValues(s.Name(), labelRequeueAfter).Inc() - return res.RequeueAfter - default: - reconcileTotal.WithLabelValues(s.Name(), labelSuccess).Inc() - return time.Duration(0) - } - } -} - -func (s *Singleton) NeedLeaderElection() bool { - return true -} - -func init() { - mergeMetrics() -} - -const ( - labelError = "error" - labelRequeueAfter = "requeue_after" - labelRequeue = "requeue" - labelSuccess = "success" -) - -// Metrics below are copied metrics fired by controller-runtime in its /internal package. This is leveraged -// so that we can fire to the same namespace as users expect other controller-runtime metrics to be fired -// https://github.com/kubernetes-sigs/controller-runtime/blob/main/pkg/internal/controller/metrics/metrics.go -var ( - reconcileTotal = prometheus.NewCounterVec(prometheus.CounterOpts{ - Name: "controller_runtime_reconcile_total", - Help: "Total number of reconciliations per controller", - }, []string{"controller", "result"}) - reconcileDuration = prometheus.NewHistogramVec(prometheus.HistogramOpts{ - Name: "controller_runtime_reconcile_time_seconds", - Help: "Length of time per reconciliation per controller", - Buckets: metrics.DurationBuckets(), - }, []string{"controller"}) - reconcileErrors = prometheus.NewCounterVec(prometheus.CounterOpts{ - Name: "controller_runtime_reconcile_errors_total", - Help: "Total number of reconciliation errors per controller", - }, []string{"controller"}) - workerCount = prometheus.NewGaugeVec(prometheus.GaugeOpts{ - Name: "controller_runtime_max_concurrent_reconciles", - Help: "Maximum number of concurrent reconciles per controller", - }, []string{"controller"}) - activeWorkers = prometheus.NewGaugeVec(prometheus.GaugeOpts{ - Name: "controller_runtime_active_workers", - Help: "Number of currently used workers per controller", - }, []string{"controller"}) -) - -// mergeMetrics merges the singletonMetrics with metrics already registered in the controller-runtime metrics registry -// https://github.com/kubernetes-sigs/controller-runtime/blob/main/pkg/internal/controller/metrics/metrics.go -// We know that all these metrics should be registered by controller-runtime so we should switch over -func mergeMetrics() { - err := &prometheus.AlreadyRegisteredError{} - errors.As(crmetrics.Registry.Register(reconcileTotal), err) - reconcileTotal = err.ExistingCollector.(*prometheus.CounterVec) - errors.As(crmetrics.Registry.Register(reconcileDuration), err) - reconcileDuration = err.ExistingCollector.(*prometheus.HistogramVec) - errors.As(crmetrics.Registry.Register(reconcileErrors), err) - reconcileErrors = err.ExistingCollector.(*prometheus.CounterVec) - errors.As(crmetrics.Registry.Register(workerCount), err) - workerCount = err.ExistingCollector.(*prometheus.GaugeVec) - errors.As(crmetrics.Registry.Register(activeWorkers), err) - activeWorkers = err.ExistingCollector.(*prometheus.GaugeVec) -} diff --git a/vendor/github.com/aws/karpenter-core/pkg/operator/controller/typed.go b/vendor/github.com/aws/karpenter-core/pkg/operator/controller/typed.go deleted file mode 100644 index 68ff06a7..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/operator/controller/typed.go +++ /dev/null @@ -1,84 +0,0 @@ -/* -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. -*/ - -package controller - -import ( - "context" - "reflect" - "strings" - - "github.com/samber/lo" - "knative.dev/pkg/logging" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/client/apiutil" - "sigs.k8s.io/controller-runtime/pkg/manager" - "sigs.k8s.io/controller-runtime/pkg/reconcile" - - "github.com/aws/karpenter-core/pkg/operator/injection" - "github.com/aws/karpenter-core/pkg/operator/scheme" -) - -type TypedController[T client.Object] interface { - Reconcile(context.Context, T) (reconcile.Result, error) - Name() string - Builder(context.Context, manager.Manager) Builder -} - -type FinalizingTypedController[T client.Object] interface { - TypedController[T] - - Finalize(context.Context, T) (reconcile.Result, error) -} - -type typedDecorator[T client.Object] struct { - kubeClient client.Client - typedController TypedController[T] -} - -func Typed[T client.Object](kubeClient client.Client, typedController TypedController[T]) Controller { - return &typedDecorator[T]{ - kubeClient: kubeClient, - typedController: typedController, - } -} - -func (t *typedDecorator[T]) Name() string { - return t.typedController.Name() -} - -func (t *typedDecorator[T]) Reconcile(ctx context.Context, req reconcile.Request) (reconcile.Result, error) { - obj := reflect.New(reflect.TypeOf(*new(T)).Elem()).Interface().(T) // Create a new pointer to a client.Object - ctx = logging.WithLogger(ctx, logging.FromContext(ctx). - Named(t.typedController.Name()). - With( - strings.ToLower(lo.Must(apiutil.GVKForObject(obj, scheme.Scheme)).Kind), - lo.Ternary(req.NamespacedName.Namespace != "", req.NamespacedName.String(), req.Name), - ), - ) - ctx = injection.WithControllerName(ctx, t.typedController.Name()) - - if err := t.kubeClient.Get(ctx, req.NamespacedName, obj); err != nil { - return reconcile.Result{}, client.IgnoreNotFound(err) - } - finalizingTypedController, ok := t.typedController.(FinalizingTypedController[T]) - if !obj.GetDeletionTimestamp().IsZero() && ok { - return finalizingTypedController.Finalize(ctx, obj) - } - return t.typedController.Reconcile(ctx, obj) -} - -func (t *typedDecorator[T]) Builder(ctx context.Context, m manager.Manager) Builder { - return t.typedController.Builder(ctx, m) -} diff --git a/vendor/github.com/aws/karpenter-core/pkg/operator/injection/injection.go b/vendor/github.com/aws/karpenter-core/pkg/operator/injection/injection.go deleted file mode 100644 index c399eaaf..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/operator/injection/injection.go +++ /dev/null @@ -1,111 +0,0 @@ -/* -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. -*/ - -package injection - -import ( - "context" - "fmt" - "time" - - "github.com/samber/lo" - v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/types" - "k8s.io/client-go/informers" - "k8s.io/client-go/kubernetes" - "k8s.io/client-go/rest" - "k8s.io/client-go/tools/cache" - "knative.dev/pkg/system" - - "github.com/aws/karpenter-core/pkg/apis/settings" - "github.com/aws/karpenter-core/pkg/operator/options" -) - -type optionsKey struct{} - -func WithOptions(ctx context.Context, opts options.Options) context.Context { - return context.WithValue(ctx, optionsKey{}, opts) -} - -func GetOptions(ctx context.Context) options.Options { - retval := ctx.Value(optionsKey{}) - if retval == nil { - return options.Options{} - } - return retval.(options.Options) -} - -type configKey struct{} - -func WithConfig(ctx context.Context, config *rest.Config) context.Context { - return context.WithValue(ctx, configKey{}, config) -} - -func GetConfig(ctx context.Context) *rest.Config { - retval := ctx.Value(configKey{}) - if retval == nil { - return nil - } - return retval.(*rest.Config) -} - -type controllerNameKeyType struct{} - -var controllerNameKey = controllerNameKeyType{} - -func WithControllerName(ctx context.Context, name string) context.Context { - return context.WithValue(ctx, controllerNameKey, name) -} - -func GetControllerName(ctx context.Context) string { - name := ctx.Value(controllerNameKey) - if name == nil { - return "" - } - return name.(string) -} - -// WithSettingsOrDie injects the settings into the context for all configMaps passed through the registrations -// NOTE: Settings are resolved statically into the global context.Context at startup. This was changed from updating them -// dynamically at runtime due to the necessity of having to build logic around re-queueing to ensure that settings are -// properly reloaded for things like feature gates -func WithSettingsOrDie(ctx context.Context, kubernetesInterface kubernetes.Interface, settings ...settings.Injectable) context.Context { - cancelCtx, cancel := context.WithCancel(ctx) - defer cancel() - - factory := informers.NewSharedInformerFactoryWithOptions(kubernetesInterface, time.Second*30, informers.WithNamespace(system.Namespace())) - informer := factory.Core().V1().ConfigMaps().Informer() - factory.Start(cancelCtx.Done()) - - for _, setting := range settings { - cm := lo.Must(waitForConfigMap(ctx, setting.ConfigMap(), informer)) - ctx = lo.Must(setting.Inject(ctx, cm)) - } - return ctx -} - -// waitForConfigMap waits until all registered configMaps in the settingsStore are created -func waitForConfigMap(ctx context.Context, name string, informer cache.SharedIndexInformer) (*v1.ConfigMap, error) { - for { - configMap, exists, err := informer.GetStore().GetByKey(types.NamespacedName{Namespace: system.Namespace(), Name: name}.String()) - if configMap != nil && exists && err == nil { - return configMap.(*v1.ConfigMap), nil - } - select { - case <-ctx.Done(): - return nil, fmt.Errorf("context canceled") - case <-time.After(time.Millisecond * 500): - } - } -} diff --git a/vendor/github.com/aws/karpenter-core/pkg/operator/logger.go b/vendor/github.com/aws/karpenter-core/pkg/operator/logger.go deleted file mode 100644 index a1911e91..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/operator/logger.go +++ /dev/null @@ -1,84 +0,0 @@ -/* -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. -*/ - -package operator - -import ( - "context" - "log" - - "github.com/go-logr/logr" - "github.com/go-logr/zapr" - "go.uber.org/zap" - "go.uber.org/zap/zapio" - "k8s.io/client-go/rest" - "k8s.io/klog/v2" - "knative.dev/pkg/configmap/informer" - "knative.dev/pkg/injection" - "knative.dev/pkg/injection/sharedmain" - "knative.dev/pkg/logging" -) - -// NewLogger returns a configured *zap.SugaredLogger. The logger is -// configured by the ConfigMap `config-logging` and live updates the level. -func NewLogger(ctx context.Context, componentName string, config *rest.Config, cmw *informer.InformedWatcher) *zap.SugaredLogger { - ctx, startInformers := injection.EnableInjectionOrDie(logging.WithLogger(ctx, zap.NewNop().Sugar()), config) - logger, atomicLevel := sharedmain.SetupLoggerOrDie(ctx, componentName) - rest.SetDefaultWarningHandler(&logging.WarningHandler{Logger: logger}) - sharedmain.WatchLoggingConfigOrDie(ctx, cmw, logger, atomicLevel, componentName) - startInformers() - return logger -} - -// ConfigureGlobalLoggers sets up any package-wide loggers like "log" or "klog" that are utilized by other packages -// to use the configured *zap.SugaredLogger from the context -func ConfigureGlobalLoggers(ctx context.Context) { - klog.SetLogger(zapr.NewLogger(logging.FromContext(ctx).Desugar())) - w := &zapio.Writer{Log: logging.FromContext(ctx).Desugar(), Level: zap.DebugLevel} - log.SetFlags(0) - log.SetOutput(w) -} - -type ignoreDebugEventsSink struct { - name string - sink logr.LogSink -} - -func (i ignoreDebugEventsSink) Init(ri logr.RuntimeInfo) { - i.sink.Init(ri) -} -func (i ignoreDebugEventsSink) Enabled(level int) bool { return i.sink.Enabled(level) } -func (i ignoreDebugEventsSink) Info(level int, msg string, keysAndValues ...interface{}) { - // ignore debug "events" logs - if level == 1 && i.name == "events" { - return - } - i.sink.Info(level, msg, keysAndValues...) -} -func (i ignoreDebugEventsSink) Error(err error, msg string, keysAndValues ...interface{}) { - i.sink.Error(err, msg, keysAndValues...) -} -func (i ignoreDebugEventsSink) WithValues(keysAndValues ...interface{}) logr.LogSink { - return i.sink.WithValues(keysAndValues...) -} -func (i ignoreDebugEventsSink) WithName(name string) logr.LogSink { - return &ignoreDebugEventsSink{name: name, sink: i.sink.WithName(name)} -} - -// ignoreDebugEvents wraps the logger with one that ignores any debug logs coming from a logger named "events". This -// prevents every event we write from creating a debug log which spams the log file during scale-ups due to recording -// pod scheduling decisions as events for visibility. -func ignoreDebugEvents(logger logr.Logger) logr.Logger { - return logr.New(&ignoreDebugEventsSink{sink: logger.GetSink()}) -} diff --git a/vendor/github.com/aws/karpenter-core/pkg/operator/operator.go b/vendor/github.com/aws/karpenter-core/pkg/operator/operator.go deleted file mode 100644 index f08b2f1a..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/operator/operator.go +++ /dev/null @@ -1,205 +0,0 @@ -/* -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. -*/ - -package operator - -import ( - "context" - "fmt" - "io" - "net/http" - "sync" - "time" - - "github.com/go-logr/zapr" - "github.com/samber/lo" - v1 "k8s.io/api/core/v1" - "k8s.io/client-go/kubernetes" - "k8s.io/client-go/tools/leaderelection/resourcelock" - "k8s.io/client-go/util/flowcontrol" - "k8s.io/utils/clock" - "knative.dev/pkg/configmap/informer" - knativeinjection "knative.dev/pkg/injection" - "knative.dev/pkg/injection/sharedmain" - "knative.dev/pkg/logging" - "knative.dev/pkg/signals" - "knative.dev/pkg/system" - "knative.dev/pkg/webhook" - controllerruntime "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/healthz" - "sigs.k8s.io/controller-runtime/pkg/manager" - - "github.com/aws/karpenter-core/pkg/apis" - "github.com/aws/karpenter-core/pkg/apis/v1alpha5" - "github.com/aws/karpenter-core/pkg/events" - corecontroller "github.com/aws/karpenter-core/pkg/operator/controller" - "github.com/aws/karpenter-core/pkg/operator/injection" - "github.com/aws/karpenter-core/pkg/operator/options" - "github.com/aws/karpenter-core/pkg/operator/scheme" -) - -const ( - appName = "karpenter" - component = "controller" -) - -type Operator struct { - manager.Manager - - KubernetesInterface kubernetes.Interface - EventRecorder events.Recorder - Clock clock.Clock - - webhooks []knativeinjection.ControllerConstructor -} - -// NewOperator instantiates a controller manager or panics -func NewOperator() (context.Context, *Operator) { - // Root Context - ctx := signals.NewContext() - ctx = knativeinjection.WithNamespaceScope(ctx, system.Namespace()) - // TODO: This can be removed if we eventually decide that we need leader election. Having leader election has resulted in the webhook - // having issues described in https://github.com/aws/karpenter/issues/2562 so these issues need to be resolved if this line is removed - ctx = sharedmain.WithHADisabled(ctx) // Disable leader election for webhook - - // Options - opts := options.New().MustParse() - ctx = injection.WithOptions(ctx, *opts) - - // Webhook - ctx = webhook.WithOptions(ctx, webhook.Options{ - Port: opts.WebhookPort, - ServiceName: opts.ServiceName, - SecretName: fmt.Sprintf("%s-cert", opts.ServiceName), - GracePeriod: 5 * time.Second, - }) - - // Client Config - config := controllerruntime.GetConfigOrDie() - config.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(float32(opts.KubeClientQPS), opts.KubeClientBurst) - config.UserAgent = appName - - // Client - kubernetesInterface := kubernetes.NewForConfigOrDie(config) - configMapWatcher := informer.NewInformedWatcher(kubernetesInterface, system.Namespace()) - lo.Must0(configMapWatcher.Start(ctx.Done())) - - // Logging - logger := NewLogger(ctx, component, config, configMapWatcher) - ctx = logging.WithLogger(ctx, logger) - ConfigureGlobalLoggers(ctx) - - // Inject settings from the ConfigMap(s) into the context - ctx = injection.WithSettingsOrDie(ctx, kubernetesInterface, apis.Settings...) - - // Manager - mgr, err := controllerruntime.NewManager(config, controllerruntime.Options{ - Logger: ignoreDebugEvents(zapr.NewLogger(logger.Desugar())), - LeaderElection: opts.EnableLeaderElection, - LeaderElectionID: "karpenter-leader-election", - LeaderElectionResourceLock: resourcelock.LeasesResourceLock, - Scheme: scheme.Scheme, - MetricsBindAddress: fmt.Sprintf(":%d", opts.MetricsPort), - HealthProbeBindAddress: fmt.Sprintf(":%d", opts.HealthProbePort), - BaseContext: func() context.Context { - ctx := context.Background() - ctx = logging.WithLogger(ctx, logger) - ctx = injection.WithSettingsOrDie(ctx, kubernetesInterface, apis.Settings...) - ctx = injection.WithConfig(ctx, config) - ctx = injection.WithOptions(ctx, *opts) - return ctx - }, - }) - mgr = lo.Must(mgr, err, "failed to setup manager") - if opts.EnableProfiling { - registerPprof(mgr) - } - lo.Must0(mgr.GetFieldIndexer().IndexField(ctx, &v1.Pod{}, "spec.nodeName", func(o client.Object) []string { - return []string{o.(*v1.Pod).Spec.NodeName} - }), "failed to setup pod indexer") - lo.Must0(mgr.GetFieldIndexer().IndexField(ctx, &v1.Node{}, "spec.providerID", func(o client.Object) []string { - return []string{o.(*v1.Node).Spec.ProviderID} - }), "failed to setup node provider id indexer") - lo.Must0(mgr.GetFieldIndexer().IndexField(ctx, &v1alpha5.Machine{}, "status.providerID", func(o client.Object) []string { - return []string{o.(*v1alpha5.Machine).Status.ProviderID} - }), "failed to setup machine provider id indexer") - - return ctx, &Operator{ - Manager: mgr, - KubernetesInterface: kubernetesInterface, - EventRecorder: events.NewRecorder(mgr.GetEventRecorderFor(appName)), - Clock: clock.RealClock{}, - } -} - -func (o *Operator) WithControllers(ctx context.Context, controllers ...corecontroller.Controller) *Operator { - for _, c := range controllers { - lo.Must0(c.Builder(ctx, o.Manager).Complete(c), "failed to register controller") - } - lo.Must0(o.Manager.AddHealthzCheck("healthz", healthz.Ping), "failed to setup liveness probe") - lo.Must0(o.Manager.AddReadyzCheck("readyz", healthz.Ping), "failed to setup readiness probe") - return o -} - -func (o *Operator) WithWebhooks(ctx context.Context, webhooks ...knativeinjection.ControllerConstructor) *Operator { - if !injection.GetOptions(ctx).DisableWebhook { - o.webhooks = append(o.webhooks, webhooks...) - lo.Must0(o.Manager.AddReadyzCheck("webhooks", webhookChecker(ctx))) - lo.Must0(o.Manager.AddHealthzCheck("webhooks", webhookChecker(ctx))) - } - return o -} - -func (o *Operator) Start(ctx context.Context) { - wg := &sync.WaitGroup{} - wg.Add(1) - go func() { - defer wg.Done() - lo.Must0(o.Manager.Start(ctx)) - }() - if injection.GetOptions(ctx).DisableWebhook { - logging.FromContext(ctx).Infof("webhook disabled") - } else { - wg.Add(1) - go func() { - defer wg.Done() - sharedmain.MainWithConfig(sharedmain.WithHealthProbesDisabled(ctx), "webhook", o.GetConfig(), o.webhooks...) - }() - } - wg.Wait() -} - -func webhookChecker(ctx context.Context) healthz.Checker { - // TODO: Add knative health check port for webhooks when health port can be configured - // Issue: https://github.com/knative/pkg/issues/2765 - return func(req *http.Request) (err error) { - res, err := http.Get(fmt.Sprintf("http://localhost:%d", injection.GetOptions(ctx).WebhookPort)) - // If the webhook connection errors out, liveness/readiness should fail - if err != nil { - return err - } - // Close the body to avoid leaking file descriptors - // Always read the body so we can re-use the connection: https://stackoverflow.com/questions/17948827/reusing-http-connections-in-go - _, _ = io.ReadAll(res.Body) - res.Body.Close() - - // If there is a server-side error or path not found, - // consider liveness to have failed - if res.StatusCode >= 500 || res.StatusCode == 404 { - return fmt.Errorf("webhook probe failed with status code %d", res.StatusCode) - } - return nil - } -} diff --git a/vendor/github.com/aws/karpenter-core/pkg/operator/options/options.go b/vendor/github.com/aws/karpenter-core/pkg/operator/options/options.go deleted file mode 100644 index 2266fb7f..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/operator/options/options.go +++ /dev/null @@ -1,79 +0,0 @@ -/* -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. -*/ - -package options - -import ( - "errors" - "flag" - "os" - "runtime/debug" - - "github.com/aws/karpenter-core/pkg/utils/env" -) - -// Options for running this binary -type Options struct { - *flag.FlagSet - // Vendor Neutral - ServiceName string - DisableWebhook bool - WebhookPort int - MetricsPort int - HealthProbePort int - KubeClientQPS int - KubeClientBurst int - EnableProfiling bool - EnableLeaderElection bool - MemoryLimit int64 -} - -// New creates an Options struct and registers CLI flags and environment variables to fill-in the Options struct fields -func New() *Options { - opts := &Options{} - f := flag.NewFlagSet("karpenter", flag.ContinueOnError) - opts.FlagSet = f - - // Vendor Neutral - f.StringVar(&opts.ServiceName, "karpenter-service", env.WithDefaultString("KARPENTER_SERVICE", ""), "The Karpenter Service name for the dynamic webhook certificate") - f.BoolVar(&opts.DisableWebhook, "disable-webhook", env.WithDefaultBool("DISABLE_WEBHOOK", false), "Disable the admission and validation webhooks") - f.IntVar(&opts.WebhookPort, "webhook-port", env.WithDefaultInt("WEBHOOK_PORT", 8443), "The port the webhook endpoint binds to for validation and mutation of resources") - f.IntVar(&opts.MetricsPort, "metrics-port", env.WithDefaultInt("METRICS_PORT", 8000), "The port the metric endpoint binds to for operating metrics about the controller itself") - f.IntVar(&opts.HealthProbePort, "health-probe-port", env.WithDefaultInt("HEALTH_PROBE_PORT", 8081), "The port the health probe endpoint binds to for reporting controller health") - f.IntVar(&opts.KubeClientQPS, "kube-client-qps", env.WithDefaultInt("KUBE_CLIENT_QPS", 200), "The smoothed rate of qps to kube-apiserver") - f.IntVar(&opts.KubeClientBurst, "kube-client-burst", env.WithDefaultInt("KUBE_CLIENT_BURST", 300), "The maximum allowed burst of queries to the kube-apiserver") - f.BoolVar(&opts.EnableProfiling, "enable-profiling", env.WithDefaultBool("ENABLE_PROFILING", false), "Enable the profiling on the metric endpoint") - f.BoolVar(&opts.EnableLeaderElection, "leader-elect", env.WithDefaultBool("LEADER_ELECT", true), "Start leader election client and gain leadership before executing the main loop. Enable this when running replicated components for high availability.") - f.Int64Var(&opts.MemoryLimit, "memory-limit", env.WithDefaultInt64("MEMORY_LIMIT", -1), "Memory limit on the container running the controller. The GC soft memory limit is set to 90% of this value.") - - if opts.MemoryLimit > 0 { - newLimit := int64(float64(opts.MemoryLimit) * 0.9) - debug.SetMemoryLimit(newLimit) - } - return opts -} - -// MustParse reads the user passed flags, environment variables, and default values. -// Options are valided and panics if an error is returned -func (o *Options) MustParse() *Options { - err := o.Parse(os.Args[1:]) - - if errors.Is(err, flag.ErrHelp) { - os.Exit(0) - } - if err != nil { - panic(err) - } - return o -} diff --git a/vendor/github.com/aws/karpenter-core/pkg/operator/profiling.go b/vendor/github.com/aws/karpenter-core/pkg/operator/profiling.go deleted file mode 100644 index b0622046..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/operator/profiling.go +++ /dev/null @@ -1,40 +0,0 @@ -/* -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. -*/ - -package operator - -import ( - "net/http" - "net/http/pprof" - - "github.com/samber/lo" - "sigs.k8s.io/controller-runtime/pkg/manager" -) - -func registerPprof(manager manager.Manager) { - for path, handler := range map[string]http.Handler{ - "/debug/pprof/": http.HandlerFunc(pprof.Index), - "/debug/pprof/cmdline": http.HandlerFunc(pprof.Cmdline), - "/debug/pprof/profile": http.HandlerFunc(pprof.Profile), - "/debug/pprof/symbol": http.HandlerFunc(pprof.Symbol), - "/debug/pprof/trace": http.HandlerFunc(pprof.Trace), - "/debug/pprof/allocs": pprof.Handler("allocs"), - "/debug/pprof/heap": pprof.Handler("heap"), - "/debug/pprof/block": pprof.Handler("block"), - "/debug/pprof/goroutine": pprof.Handler("goroutine"), - "/debug/pprof/threadcreate": pprof.Handler("threadcreate"), - } { - lo.Must0(manager.AddMetricsExtraHandler(path, handler), "setting up profiling") - } -} diff --git a/vendor/github.com/aws/karpenter-core/pkg/scheduling/hostportusage.go b/vendor/github.com/aws/karpenter-core/pkg/scheduling/hostportusage.go deleted file mode 100644 index 5d49f268..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/scheduling/hostportusage.go +++ /dev/null @@ -1,144 +0,0 @@ -/* -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. -*/ - -package scheduling - -import ( - "context" - "fmt" - "net" - - v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/types" - "knative.dev/pkg/logging" - "sigs.k8s.io/controller-runtime/pkg/client" -) - -// HostPortUsage tracks HostPort usage within a node. On a node, each used by pods bound -// to the node must be unique. We need to track this to keep an accurate concept of what pods can potentially schedule -// together. -type HostPortUsage struct { - reserved map[types.NamespacedName][]entry -} - -type entry struct { - ip net.IP - port int32 - protocol v1.Protocol -} - -func (e entry) String() string { - return fmt.Sprintf("IP=%s Port=%d Proto=%s", e.ip, e.port, e.protocol) -} - -func (e entry) matches(rhs entry) bool { - if e.protocol != rhs.protocol { - return false - } - if e.port != rhs.port { - return false - } - // If IPs are unequal, they don't match unless one is an unspecified address "0.0.0.0" or the IPv6 address "::". - if !e.ip.Equal(rhs.ip) && !e.ip.IsUnspecified() && !rhs.ip.IsUnspecified() { - return false - } - return true -} - -func NewHostPortUsage() *HostPortUsage { - return &HostPortUsage{ - reserved: map[types.NamespacedName][]entry{}, - } -} - -// Add adds a port to the HostPortUsage, returning an error in the case of a conflict -func (u *HostPortUsage) Add(ctx context.Context, pod *v1.Pod) { - newUsage, err := u.validate(pod) - if err != nil { - logging.FromContext(ctx).Errorf("invariant violated registering host port usage, %s, please file an issue", err) - } - u.reserved[client.ObjectKeyFromObject(pod)] = newUsage -} - -// Validate performs host port conflict validation to allow for determining if we can schedule the pod to the node -// before doing so. -func (u *HostPortUsage) Validate(pod *v1.Pod) error { - _, err := u.validate(pod) - return err -} - -func (u *HostPortUsage) validate(pod *v1.Pod) ([]entry, error) { - newUsage := getHostPorts(pod) - for _, newEntry := range newUsage { - for podKey, entries := range u.reserved { - for _, existing := range entries { - if newEntry.matches(existing) && podKey != client.ObjectKeyFromObject(pod) { - return nil, fmt.Errorf("%s conflicts with existing HostPort configuration %s", newEntry, existing) - } - } - } - } - return newUsage, nil -} - -// DeletePod deletes all host port usage from the HostPortUsage that were created by the pod with the given name. -func (u *HostPortUsage) DeletePod(key types.NamespacedName) { - delete(u.reserved, key) -} - -func (u *HostPortUsage) DeepCopy() *HostPortUsage { - if u == nil { - return nil - } - out := &HostPortUsage{} - u.DeepCopyInto(out) - return out -} - -func (u *HostPortUsage) DeepCopyInto(out *HostPortUsage) { - out.reserved = map[types.NamespacedName][]entry{} - for k, v := range u.reserved { - for _, e := range v { - out.reserved[k] = append(out.reserved[k], entry{ - ip: e.ip, - port: e.port, - protocol: e.protocol, - }) - } - } -} - -func getHostPorts(pod *v1.Pod) []entry { - var usage []entry - for _, c := range pod.Spec.Containers { - for _, p := range c.Ports { - if p.HostPort == 0 { - continue - } - // Per the K8s docs, "If you don't specify the hostIP and protocol explicitly, Kubernetes will use 0.0.0.0 - // as the default hostIP and TCP as the default protocol." In testing, and looking at the code the protocol - // is defaulted to TCP, but it leaves the IP empty. - hostIP := p.HostIP - if hostIP == "" { - hostIP = "0.0.0.0" - } - usage = append(usage, entry{ - ip: net.ParseIP(hostIP), - port: p.HostPort, - protocol: p.Protocol, - }) - } - } - return usage -} diff --git a/vendor/github.com/aws/karpenter-core/pkg/scheduling/requirements.go b/vendor/github.com/aws/karpenter-core/pkg/scheduling/requirements.go deleted file mode 100644 index 340eb8c6..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/scheduling/requirements.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -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. -*/ - -package scheduling - -import ( - "fmt" - "sort" - "strings" - - "github.com/samber/lo" - "go.uber.org/multierr" - v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/util/sets" - - "github.com/aws/karpenter-core/pkg/apis/v1alpha5" -) - -// Requirements are an efficient set representation under the hood. Since its underlying -// types are slices and maps, this type should not be used as a pointer. -type Requirements map[string]*Requirement - -func NewRequirements(requirements ...*Requirement) Requirements { - r := Requirements{} - for _, requirement := range requirements { - r.Add(requirement) - } - return r -} - -// NewRequirements constructs requirements from NodeSelectorRequirements -func NewNodeSelectorRequirements(requirements ...v1.NodeSelectorRequirement) Requirements { - r := NewRequirements() - for _, requirement := range requirements { - r.Add(NewRequirement(requirement.Key, requirement.Operator, requirement.Values...)) - } - return r -} - -// NewLabelRequirements constructs requirements from labels -func NewLabelRequirements(labels map[string]string) Requirements { - requirements := NewRequirements() - for key, value := range labels { - requirements.Add(NewRequirement(key, v1.NodeSelectorOpIn, value)) - } - return requirements -} - -// NewPodRequirements constructs requirements from a pod -func NewPodRequirements(pod *v1.Pod) Requirements { - requirements := NewLabelRequirements(pod.Spec.NodeSelector) - if pod.Spec.Affinity == nil || pod.Spec.Affinity.NodeAffinity == nil { - return requirements - } - // The legal operators for pod affinity and anti-affinity are In, NotIn, Exists, DoesNotExist. - // Select heaviest preference and treat as a requirement. An outer loop will iteratively unconstrain them if unsatisfiable. - if preferred := pod.Spec.Affinity.NodeAffinity.PreferredDuringSchedulingIgnoredDuringExecution; len(preferred) > 0 { - sort.Slice(preferred, func(i int, j int) bool { return preferred[i].Weight > preferred[j].Weight }) - requirements.Add(NewNodeSelectorRequirements(preferred[0].Preference.MatchExpressions...).Values()...) - } - // Select first requirement. An outer loop will iteratively remove OR requirements if unsatisfiable - if pod.Spec.Affinity.NodeAffinity.RequiredDuringSchedulingIgnoredDuringExecution != nil && - len(pod.Spec.Affinity.NodeAffinity.RequiredDuringSchedulingIgnoredDuringExecution.NodeSelectorTerms) > 0 { - requirements.Add(NewNodeSelectorRequirements(pod.Spec.Affinity.NodeAffinity.RequiredDuringSchedulingIgnoredDuringExecution.NodeSelectorTerms[0].MatchExpressions...).Values()...) - } - return requirements -} - -func (r Requirements) NodeSelectorRequirements() []v1.NodeSelectorRequirement { - return lo.Map(lo.Values(r), func(req *Requirement, _ int) v1.NodeSelectorRequirement { - return req.NodeSelectorRequirement() - }) -} - -// Add requirements to provided requirements. Mutates existing requirements -func (r Requirements) Add(requirements ...*Requirement) { - for _, requirement := range requirements { - if existing, ok := r[requirement.Key]; ok { - requirement = requirement.Intersection(existing) - } - r[requirement.Key] = requirement - } -} - -// Keys returns unique set of the label keys from the requirements -func (r Requirements) Keys() sets.String { - keys := sets.NewString() - for key := range r { - keys.Insert(key) - } - return keys -} - -func (r Requirements) Values() []*Requirement { - return lo.Values(r) -} - -func (r Requirements) Has(key string) bool { - _, ok := r[key] - return ok -} - -func (r Requirements) Get(key string) *Requirement { - if _, ok := r[key]; !ok { - // If not defined, allow any values with the exists operator - return NewRequirement(key, v1.NodeSelectorOpExists) - } - return r[key] -} - -// Compatible ensures the provided requirements can be met. -func (r Requirements) Compatible(requirements Requirements) (errs error) { - // Custom Labels must intersect, but if not defined are denied. - for key := range requirements.Keys().Difference(v1alpha5.WellKnownLabels) { - if operator := requirements.Get(key).Operator(); r.Has(key) || operator == v1.NodeSelectorOpNotIn || operator == v1.NodeSelectorOpDoesNotExist { - continue - } - errs = multierr.Append(errs, fmt.Errorf("label %q does not have known values%s", key, labelHint(r, key))) - } - // Well Known Labels must intersect, but if not defined, are allowed. - return multierr.Append(errs, r.Intersects(requirements)) -} - -// editDistance is an implementation of edit distance from Algorithms/DPV -func editDistance(s, t string) int { - min := func(a, b, c int) int { - m := a - if b < m { - m = b - } - if c < m { - m = c - } - return m - } - - m := len(s) - n := len(t) - if m == 0 { - return n - } - if n == 0 { - return m - } - prevRow := make([]int, n) - curRow := make([]int, n) - for j := 1; j < n; j++ { - prevRow[j] = j - } - for i := 1; i < m; i++ { - for j := 1; j < n; j++ { - diff := 0 - if s[i] != t[j] { - diff = 1 - } - curRow[j] = min(prevRow[j]+1, curRow[j-1]+1, prevRow[j-1]+diff) - } - prevRow, curRow = curRow, prevRow - } - return prevRow[n-1] -} - -func labelHint(r Requirements, key string) string { - for wellKnown := range v1alpha5.WellKnownLabels { - if strings.Contains(wellKnown, key) || editDistance(key, wellKnown) < len(wellKnown)/5 { - return fmt.Sprintf(" (typo of %q?)", wellKnown) - } - } - for existing := range r { - if strings.Contains(existing, key) || editDistance(key, existing) < len(existing)/5 { - return fmt.Sprintf(" (typo of %q?)", existing) - } - } - return "" -} - -// Intersects returns errors if the requirements don't have overlapping values, undefined keys are allowed -func (r Requirements) Intersects(requirements Requirements) (errs error) { - for key := range r.Keys().Intersection(requirements.Keys()) { - existing := r.Get(key) - incoming := requirements.Get(key) - // There must be some value, except - if existing.Intersection(incoming).Len() == 0 { - // where the incoming requirement has operator { NotIn, DoesNotExist } - if operator := incoming.Operator(); operator == v1.NodeSelectorOpNotIn || operator == v1.NodeSelectorOpDoesNotExist { - // and the existing requirement has operator { NotIn, DoesNotExist } - if operator := existing.Operator(); operator == v1.NodeSelectorOpNotIn || operator == v1.NodeSelectorOpDoesNotExist { - continue - } - } - errs = multierr.Append(errs, fmt.Errorf("key %s, %s not in %s", key, incoming, existing)) - } - } - return errs -} - -func (r Requirements) Labels() map[string]string { - labels := map[string]string{} - for key, requirement := range r { - if !v1alpha5.IsRestrictedNodeLabel(key) { - if value := requirement.Any(); value != "" { - labels[key] = value - } - } - } - return labels -} - -func (r Requirements) String() string { - requirements := lo.Reject(r.Values(), func(requirement *Requirement, _ int) bool { return v1alpha5.RestrictedLabels.Has(requirement.Key) }) - stringRequirements := lo.Map(requirements, func(requirement *Requirement, _ int) string { return requirement.String() }) - sort.Strings(stringRequirements) - return strings.Join(stringRequirements, ", ") -} diff --git a/vendor/github.com/aws/karpenter-core/pkg/scheduling/volumeusage.go b/vendor/github.com/aws/karpenter-core/pkg/scheduling/volumeusage.go deleted file mode 100644 index 7093d1ce..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/scheduling/volumeusage.go +++ /dev/null @@ -1,311 +0,0 @@ -/* -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. -*/ - -package scheduling - -import ( - "context" - "fmt" - "sort" - - "github.com/samber/lo" - csitranslation "k8s.io/csi-translation-lib" - "knative.dev/pkg/logging" - - v1 "k8s.io/api/core/v1" - storagev1 "k8s.io/api/storage/v1" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/util/sets" - "sigs.k8s.io/controller-runtime/pkg/client" - - "github.com/aws/karpenter-core/pkg/utils/pretty" -) - -const ( - IsDefaultStorageClassAnnotation = "storageclass.kubernetes.io/is-default-class" -) - -// translator is a CSI Translator that translates in-tree plugin names to their out-of-tree CSI driver names -var translator = csitranslation.New() - -// changeMonitor is a change monitor for global volumeUsage logging -var changeMonitor = pretty.NewChangeMonitor() - -// VolumeUsage tracks volume limits on a per node basis. The number of volumes that can be mounted varies by instance -// type. We need to be aware and track the mounted volume usage to inform our awareness of which pods can schedule to -// which nodes. -type VolumeUsage struct { - volumes volumes - podVolumes map[types.NamespacedName]volumes -} - -func NewVolumeUsage() *VolumeUsage { - return &VolumeUsage{ - volumes: volumes{}, - podVolumes: map[types.NamespacedName]volumes{}, - } -} - -type volumes map[string]sets.String - -func (u volumes) Add(provisioner string, pvcID string) { - existing, ok := u[provisioner] - if !ok { - existing = sets.NewString() - u[provisioner] = existing - } - existing.Insert(pvcID) -} - -func (u volumes) union(vol volumes) volumes { - cp := volumes{} - for k, v := range u { - cp[k] = sets.NewString(v.List()...) - } - for k, v := range vol { - existing, ok := cp[k] - if !ok { - existing = sets.NewString() - cp[k] = existing - } - existing.Insert(v.List()...) - } - return cp -} - -func (u volumes) insert(volumes volumes) { - for k, v := range volumes { - existing, ok := u[k] - if !ok { - existing = sets.NewString() - u[k] = existing - } - existing.Insert(v.List()...) - } -} - -func (u volumes) copy() volumes { - cp := volumes{} - for k, v := range u { - cp[k] = sets.NewString(v.List()...) - } - return cp -} - -func (v *VolumeUsage) Add(ctx context.Context, kubeClient client.Client, pod *v1.Pod) { - podVolumes, err := v.validate(ctx, kubeClient, pod) - if err != nil { - logging.FromContext(ctx).Errorf("inconsistent state error adding volume, %s, please file an issue", err) - } - v.podVolumes[client.ObjectKeyFromObject(pod)] = podVolumes - v.volumes = v.volumes.union(podVolumes) -} - -// VolumeCount stores a mapping between the driver name that provides volumes -// and the number of volumes associated with that driver -type VolumeCount map[string]int - -// Exceeds returns true if the volume count exceeds the limits provided. If there is no value for a storage provider, it -// is treated as unlimited. -func (c VolumeCount) Exceeds(limits VolumeCount) bool { - for k, v := range c { - limit, hasLimit := limits[k] - if !hasLimit { - continue - } - if v > limit { - return true - } - } - return false -} - -// Fits returns true if the rhs 'fits' within the volume count. -func (c VolumeCount) Fits(rhs VolumeCount) bool { - for k, v := range rhs { - limit, hasLimit := c[k] - if !hasLimit { - continue - } - if v > limit { - return false - } - } - return true -} - -func (v *VolumeUsage) Validate(ctx context.Context, kubeClient client.Client, pod *v1.Pod) (VolumeCount, error) { - podVolumes, err := v.validate(ctx, kubeClient, pod) - if err != nil { - return nil, err - } - result := VolumeCount{} - for k, v := range v.volumes.union(podVolumes) { - result[k] += len(v) - } - return result, nil -} - -//nolint:gocyclo -func (v *VolumeUsage) validate(ctx context.Context, kubeClient client.Client, pod *v1.Pod) (volumes, error) { - ctx = logging.WithLogger(ctx, logging.FromContext(ctx).With("pod", pod.Name)) - podPVCs := volumes{} - defaultStorageClassName, err := v.discoverDefaultStorageClassName(ctx, kubeClient) - if err != nil { - return nil, fmt.Errorf("discovering default storage class, %w", err) - } - for _, volume := range pod.Spec.Volumes { - ctx = logging.WithLogger(ctx, logging.FromContext(ctx).With("volume", volume.Name)) - var pvcID string - var storageClassName *string - var volumeName string - var pvc v1.PersistentVolumeClaim - if volume.PersistentVolumeClaim != nil { - if err := kubeClient.Get(ctx, client.ObjectKey{Namespace: pod.Namespace, Name: volume.PersistentVolumeClaim.ClaimName}, &pvc); err != nil { - return nil, err - } - pvcID = fmt.Sprintf("%s/%s", pod.Namespace, volume.PersistentVolumeClaim.ClaimName) - storageClassName = pvc.Spec.StorageClassName - if storageClassName == nil || *storageClassName == "" { - storageClassName = defaultStorageClassName - } - volumeName = pvc.Spec.VolumeName - } else if volume.Ephemeral != nil { - // generated name per https://kubernetes.io/docs/concepts/storage/ephemeral-volumes/#persistentvolumeclaim-naming - pvcID = fmt.Sprintf("%s/%s-%s", pod.Namespace, pod.Name, volume.Name) - storageClassName = volume.Ephemeral.VolumeClaimTemplate.Spec.StorageClassName - if storageClassName == nil || *storageClassName == "" { - storageClassName = defaultStorageClassName - } - volumeName = volume.Ephemeral.VolumeClaimTemplate.Spec.VolumeName - } else { - continue - } - driverName, err := v.resolveDriver(ctx, kubeClient, volumeName, storageClassName) - if err != nil { - return nil, err - } - // might be a non-CSI driver, something we don't currently handle - if driverName != "" { - podPVCs.Add(driverName, pvcID) - } - } - return podPVCs, nil -} - -func (v *VolumeUsage) discoverDefaultStorageClassName(ctx context.Context, kubeClient client.Client) (*string, error) { - storageClassList := &storagev1.StorageClassList{} - if err := kubeClient.List(ctx, storageClassList); err != nil { - return nil, err - } - // Find all StorageClasses that have the default annotation - defaults := lo.Filter(storageClassList.Items, func(sc storagev1.StorageClass, _ int) bool { - return sc.Annotations[IsDefaultStorageClassAnnotation] == "true" - }) - if len(defaults) == 0 { - return nil, nil - } - // Sort the default StorageClasses by timestamp and take the newest one - // https://github.com/kubernetes/kubernetes/pull/110559 - sort.Slice(defaults, func(i, j int) bool { - return defaults[i].CreationTimestamp.After(defaults[j].CreationTimestamp.Time) - }) - return lo.ToPtr(defaults[0].Name), nil -} - -// resolveDriver resolves the storage driver name in the following order: -// 1. If the PV associated with the pod volume is using CSI.driver in its spec, then use that name -// 2. If the StorageClass associated with the PV has a Provisioner -func (v *VolumeUsage) resolveDriver(ctx context.Context, kubeClient client.Client, volumeName string, storageClassName *string) (string, error) { - // We can track the volume usage by the CSI Driver name which is pulled from the storage class for dynamic - // volumes, or if it's bound/static we can pull the volume name - if volumeName != "" { - driverName, err := v.driverFromVolume(ctx, kubeClient, volumeName) - if err != nil { - return "", err - } - if driverName != "" { - return driverName, nil - } - } - if storageClassName != nil && *storageClassName != "" { - driverName, err := v.driverFromSC(ctx, kubeClient, *storageClassName) - if err != nil { - return "", err - } - if driverName != "" { - return driverName, nil - } - } - // Driver name wasn't able to resolve for this volume. In this case, we just ignore the - // volume and move on to the other volumes that the pod has - return "", nil -} - -// driverFromSC resolves the storage driver name by getting the Provisioner name from the StorageClass -func (v *VolumeUsage) driverFromSC(ctx context.Context, kubeClient client.Client, storageClassName string) (string, error) { - var sc storagev1.StorageClass - if err := kubeClient.Get(ctx, client.ObjectKey{Name: storageClassName}, &sc); err != nil { - return "", err - } - // Check if the provisioner name is an in-tree plugin name - if csiName, err := translator.GetCSINameFromInTreeName(sc.Provisioner); err == nil { - if changeMonitor.HasChanged(fmt.Sprintf("sc/%s", storageClassName), nil) { - logging.FromContext(ctx).With("storage-class", sc.Name, "provisioner", sc.Provisioner).Errorf("StorageClass .spec.provisioner uses an in-tree storage plugin which is unsupported by Karpenter and is deprecated by Kubernetes. Scale-ups may fail because Karpenter will not discover driver limits. Create a new StorageClass with a .spec.provisioner referencing the CSI driver plugin name '%s'.", csiName) - } - } - return sc.Provisioner, nil -} - -// driverFromVolume resolves the storage driver name by getting the CSI spec from inside the PersistentVolume -func (v *VolumeUsage) driverFromVolume(ctx context.Context, kubeClient client.Client, volumeName string) (string, error) { - var pv v1.PersistentVolume - if err := kubeClient.Get(ctx, client.ObjectKey{Name: volumeName}, &pv); err != nil { - return "", err - } - if pv.Spec.CSI != nil { - return pv.Spec.CSI.Driver, nil - } else if pv.Spec.AWSElasticBlockStore != nil { - if changeMonitor.HasChanged(fmt.Sprintf("pv/%s", pv.Name), nil) { - logging.FromContext(ctx).With("persistent-volume", pv.Name).Errorf("PersistentVolume source 'AWSElasticBlockStore' uses an in-tree storage plugin which is unsupported by Karpenter and is deprecated by Kubernetes. Scale-ups may fail because Karpenter will not discover driver limits. Use a PersistentVolume that references the 'CSI' volume source for Karpenter auto-scaling support.") - } - } - return "", nil -} - -func (v *VolumeUsage) DeletePod(key types.NamespacedName) { - delete(v.podVolumes, key) - // volume names could be duplicated, so we re-create our volumes - v.volumes = volumes{} - for _, c := range v.podVolumes { - v.volumes.insert(c) - } -} - -func (v *VolumeUsage) DeepCopy() *VolumeUsage { - if v == nil { - return nil - } - out := &VolumeUsage{} - v.DeepCopyInto(out) - return out -} - -func (v *VolumeUsage) DeepCopyInto(out *VolumeUsage) { - out.volumes = v.volumes.copy() - out.podVolumes = map[types.NamespacedName]volumes{} - for k, v := range v.podVolumes { - out.podVolumes[k] = v.copy() - } -} diff --git a/vendor/github.com/aws/karpenter-core/pkg/test/provisioner.go b/vendor/github.com/aws/karpenter-core/pkg/test/provisioner.go deleted file mode 100644 index 63f1b475..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/test/provisioner.go +++ /dev/null @@ -1,99 +0,0 @@ -/* -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. -*/ - -package test - -import ( - "encoding/json" - "fmt" - - "github.com/imdario/mergo" - "github.com/samber/lo" - v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/resource" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - - "github.com/aws/karpenter-core/pkg/apis/v1alpha5" -) - -// ProvisionerOptions customizes a Provisioner. -type ProvisionerOptions struct { - metav1.ObjectMeta - Limits v1.ResourceList - Provider interface{} - ProviderRef *v1alpha5.MachineTemplateRef - Kubelet *v1alpha5.KubeletConfiguration - Annotations map[string]string - Labels map[string]string - Taints []v1.Taint - StartupTaints []v1.Taint - Requirements []v1.NodeSelectorRequirement - Status v1alpha5.ProvisionerStatus - TTLSecondsUntilExpired *int64 - Weight *int32 - TTLSecondsAfterEmpty *int64 - Consolidation *v1alpha5.Consolidation -} - -// Provisioner creates a test provisioner with defaults that can be overridden by ProvisionerOptions. -// Overrides are applied in order, with a last write wins semantic. -func Provisioner(overrides ...ProvisionerOptions) *v1alpha5.Provisioner { - options := ProvisionerOptions{} - for _, opts := range overrides { - if err := mergo.Merge(&options, opts, mergo.WithOverride); err != nil { - panic(fmt.Sprintf("Failed to merge provisioner options: %s", err)) - } - } - if options.Name == "" { - options.Name = RandomName() - } - if options.Limits == nil { - options.Limits = v1.ResourceList{v1.ResourceCPU: resource.MustParse("2000")} - } - raw := &runtime.RawExtension{} - lo.Must0(raw.UnmarshalJSON(lo.Must(json.Marshal(options.Provider)))) - - provisioner := &v1alpha5.Provisioner{ - ObjectMeta: ObjectMeta(options.ObjectMeta), - Spec: v1alpha5.ProvisionerSpec{ - Requirements: options.Requirements, - KubeletConfiguration: options.Kubelet, - ProviderRef: options.ProviderRef, - Taints: options.Taints, - StartupTaints: options.StartupTaints, - Annotations: options.Annotations, - Labels: lo.Assign(options.Labels, map[string]string{DiscoveryLabel: "unspecified"}), // For node cleanup discovery - Limits: &v1alpha5.Limits{Resources: options.Limits}, - TTLSecondsAfterEmpty: options.TTLSecondsAfterEmpty, - TTLSecondsUntilExpired: options.TTLSecondsUntilExpired, - Weight: options.Weight, - Consolidation: options.Consolidation, - Provider: raw, - }, - Status: options.Status, - } - - if options.ProviderRef == nil { - if options.Provider == nil { - options.Provider = struct{}{} - } - provider, err := json.Marshal(options.Provider) - if err != nil { - panic(err.Error()) - } - provisioner.Spec.Provider = &runtime.RawExtension{Raw: provider} - } - return provisioner -} diff --git a/vendor/github.com/aws/karpenter-core/pkg/test/settings.go b/vendor/github.com/aws/karpenter-core/pkg/test/settings.go deleted file mode 100644 index 21f7696e..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/test/settings.go +++ /dev/null @@ -1,45 +0,0 @@ -/* -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. -*/ - -package test - -import ( - "fmt" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - "github.com/imdario/mergo" - - "github.com/aws/karpenter-core/pkg/apis/settings" -) - -func Settings(overrides ...settings.Settings) *settings.Settings { - options := settings.Settings{} - for _, opts := range overrides { - if err := mergo.Merge(&options, opts, mergo.WithOverride); err != nil { - panic(fmt.Sprintf("Failed to merge pod options: %s", err)) - } - } - if options.BatchMaxDuration == nil { - options.BatchMaxDuration = &metav1.Duration{} - } - if options.BatchIdleDuration == nil { - options.BatchIdleDuration = &metav1.Duration{} - } - return &settings.Settings{ - BatchMaxDuration: options.BatchMaxDuration, - BatchIdleDuration: options.BatchIdleDuration, - DriftEnabled: options.DriftEnabled, - } -} diff --git a/vendor/github.com/aws/karpenter-core/pkg/utils/functional/functional.go b/vendor/github.com/aws/karpenter-core/pkg/utils/functional/functional.go deleted file mode 100644 index 0c3c5884..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/utils/functional/functional.go +++ /dev/null @@ -1,76 +0,0 @@ -/* -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. -*/ - -package functional - -import ( - "strings" - - "k8s.io/apimachinery/pkg/util/yaml" -) - -type Pair[A, B any] struct { - First A - Second B -} - -type Option[T any] func(T) T - -func ResolveOptions[T any](opts ...Option[T]) T { - o := *new(T) - for _, opt := range opts { - if opt != nil { - o = opt(o) - } - } - return o -} - -// HasAnyPrefix returns true if any of the provided prefixes match the given string s -func HasAnyPrefix(s string, prefixes ...string) bool { - for _, prefix := range prefixes { - if strings.HasPrefix(s, prefix) { - return true - } - } - return false -} - -// SplitCommaSeparatedString splits a string by commas, removes whitespace, and returns -// a slice of strings -func SplitCommaSeparatedString(value string) []string { - var result []string - for _, value := range strings.Split(value, ",") { - result = append(result, strings.TrimSpace(value)) - } - return result -} - -func Unmarshal[T any](raw []byte) (*T, error) { - t := *new(T) - if err := yaml.Unmarshal(raw, &t); err != nil { - return nil, err - } - return &t, nil -} - -func FilterMap[K comparable, V any](m map[K]V, f func(K, V) bool) map[K]V { - ret := map[K]V{} - for k, v := range m { - if f(k, v) { - ret[k] = v - } - } - return ret -} diff --git a/vendor/github.com/aws/karpenter-core/pkg/utils/machine/machine.go b/vendor/github.com/aws/karpenter-core/pkg/utils/machine/machine.go deleted file mode 100644 index 3a5ef574..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/utils/machine/machine.go +++ /dev/null @@ -1,289 +0,0 @@ -/* -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. -*/ - -package machine - -import ( - "context" - "errors" - "fmt" - "strings" - "time" - - "github.com/samber/lo" - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" - "k8s.io/utils/clock" - "knative.dev/pkg/ptr" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/handler" - "sigs.k8s.io/controller-runtime/pkg/predicate" - "sigs.k8s.io/controller-runtime/pkg/reconcile" - - "github.com/aws/karpenter-core/pkg/apis/v1alpha5" - "github.com/aws/karpenter-core/pkg/scheduling" -) - -var selector1, _ = predicate.LabelSelectorPredicate(metav1.LabelSelector{ - MatchExpressions: []metav1.LabelSelectorRequirement{ - {Key: "kaito.sh/workspace", Operator: metav1.LabelSelectorOpExists}, - }, -}) -var selector2, _ = predicate.LabelSelectorPredicate(metav1.LabelSelector{ - MatchExpressions: []metav1.LabelSelectorRequirement{ - {Key: "kaito.sh/ragengine", Operator: metav1.LabelSelectorOpExists}, - }, -}) -var KaitoMachinePredicate = predicate.Or(selector1, selector2) - -// EventHandler is a watcher on v1alpha5.Machine that maps Machines to Nodes based on provider ids -// and enqueues reconcile.Requests for the Nodes -func EventHandler(ctx context.Context, c client.Client) handler.EventHandler { - return handler.EnqueueRequestsFromMapFunc(func(o client.Object) []reconcile.Request { - machine := o.(*v1alpha5.Machine) - nodeList := &v1.NodeList{} - if machine.Status.ProviderID == "" { - return nil - } - if err := c.List(ctx, nodeList, client.MatchingFields{"spec.providerID": machine.Status.ProviderID}); err != nil { - return nil - } - return lo.Map(nodeList.Items, func(n v1.Node, _ int) reconcile.Request { - return reconcile.Request{ - NamespacedName: client.ObjectKeyFromObject(&n), - } - }) - }) -} - -// PodEventHandler is a watcher on v1.Pods that maps Pods to Machine based on the node names -// and enqueues reconcile.Requests for the Machines -func PodEventHandler(ctx context.Context, c client.Client) handler.EventHandler { - return handler.EnqueueRequestsFromMapFunc(func(o client.Object) (requests []reconcile.Request) { - if name := o.(*v1.Pod).Spec.NodeName; name != "" { - node := &v1.Node{} - if err := c.Get(ctx, types.NamespacedName{Name: name}, node); err != nil { - return []reconcile.Request{} - } - machineList := &v1alpha5.MachineList{} - if err := c.List(ctx, machineList, client.MatchingFields{"status.providerID": node.Spec.ProviderID}); err != nil { - return []reconcile.Request{} - } - return lo.Map(machineList.Items, func(m v1alpha5.Machine, _ int) reconcile.Request { - return reconcile.Request{ - NamespacedName: client.ObjectKeyFromObject(&m), - } - }) - } - return requests - }) -} - -// NodeEventHandler is a watcher on v1.Node that maps Nodes to Machines based on provider ids -// and enqueues reconcile.Requests for the Machines -func NodeEventHandler(ctx context.Context, c client.Client) handler.EventHandler { - return handler.EnqueueRequestsFromMapFunc(func(o client.Object) []reconcile.Request { - node := o.(*v1.Node) - machineList := &v1alpha5.MachineList{} - if err := c.List(ctx, machineList, client.MatchingFields{"status.providerID": node.Spec.ProviderID}); err != nil { - return []reconcile.Request{} - } - return lo.Map(machineList.Items, func(m v1alpha5.Machine, _ int) reconcile.Request { - return reconcile.Request{ - NamespacedName: client.ObjectKeyFromObject(&m), - } - }) - }) -} - -// ProvisionerEventHandler is a watcher on v1alpha5.Machine that maps Provisioner to Machines based -// on the v1alpha5.ProvsionerNameLabelKey and enqueues reconcile.Requests for the Machine -func ProvisionerEventHandler(ctx context.Context, c client.Client) handler.EventHandler { - return handler.EnqueueRequestsFromMapFunc(func(o client.Object) (requests []reconcile.Request) { - machineList := &v1alpha5.MachineList{} - if err := c.List(ctx, machineList, client.MatchingLabels(map[string]string{v1alpha5.ProvisionerNameLabelKey: o.GetName()})); err != nil { - return requests - } - return lo.Map(machineList.Items, func(machine v1alpha5.Machine, _ int) reconcile.Request { - return reconcile.Request{NamespacedName: types.NamespacedName{Name: machine.Name}} - }) - }) -} - -// NodeNotFoundError is an error returned when no v1.Nodes are found matching the passed providerID -type NodeNotFoundError struct { - ProviderID string -} - -func (e *NodeNotFoundError) Error() string { - return fmt.Sprintf("no nodes found for provider id '%s'", e.ProviderID) -} - -func IsNodeNotFoundError(err error) bool { - if err == nil { - return false - } - nnfErr := &NodeNotFoundError{} - return errors.As(err, &nnfErr) -} - -func IgnoreNodeNotFoundError(err error) error { - if !IsNodeNotFoundError(err) { - return err - } - return nil -} - -// DuplicateNodeError is an error returned when multiple v1.Nodes are found matching the passed providerID -type DuplicateNodeError struct { - ProviderID string -} - -func (e *DuplicateNodeError) Error() string { - return fmt.Sprintf("multiple found for provider id '%s'", e.ProviderID) -} - -func IsDuplicateNodeError(err error) bool { - if err == nil { - return false - } - dnErr := &DuplicateNodeError{} - return errors.As(err, &dnErr) -} - -func IgnoreDuplicateNodeError(err error) error { - if !IsDuplicateNodeError(err) { - return err - } - return nil -} - -// NodeForMachine is a helper function that takes a v1alpha5.Machine and attempts to find the matching v1.Node by its providerID -// This function will return errors if: -// 1. No v1.Nodes match the v1alpha5.Machine providerID -// 2. Multiple v1.Nodes match the v1alpha5.Machine providerID -func NodeForMachine(ctx context.Context, c client.Client, machine *v1alpha5.Machine) (*v1.Node, error) { - nodes, err := AllNodesForMachine(ctx, c, machine) - if err != nil { - return nil, err - } - // If the providerID is defined, use that value; else, use the machine linked annotation if it's on the machine - providerID := lo.Ternary(machine.Status.ProviderID != "", machine.Status.ProviderID, machine.Annotations[v1alpha5.MachineLinkedAnnotationKey]) - if len(nodes) > 1 { - return nil, &DuplicateNodeError{ProviderID: providerID} - } - if len(nodes) == 0 { - return nil, &NodeNotFoundError{ProviderID: providerID} - } - return nodes[0], nil -} - -// AllNodesForMachine is a helper function that takes a v1alpha5.Machine and finds ALL matching v1.Nodes by their providerID -// If the providerID is not resolved for a Machine, then no Nodes will map to it -func AllNodesForMachine(ctx context.Context, c client.Client, machine *v1alpha5.Machine) ([]*v1.Node, error) { - // If the providerID is defined, use that value; else, use the machine linked annotation if it's on the machine - providerID := lo.Ternary(machine.Status.ProviderID != "", machine.Status.ProviderID, machine.Annotations[v1alpha5.MachineLinkedAnnotationKey]) - // Machines that have no resolved providerID have no nodes mapped to them - if providerID == "" { - // check common failures caused by bad input - msg := machine.StatusConditions().GetCondition(v1alpha5.MachineLaunched).GetMessage() - if machine.StatusConditions().GetCondition(v1alpha5.MachineLaunched).IsFalse() && - (msg == "all requested instance types were unavailable during launch" || - strings.Contains(msg, "is not allowed in your subscription in location")) { - return nil, nil // Not recoverable, does not consider as an error - - } else { - return nil, fmt.Errorf("The machine has not been associated with any node yet") - } - } - nodeList := v1.NodeList{} - if err := c.List(ctx, &nodeList, client.MatchingFields{"spec.providerID": providerID}); err != nil { - return nil, fmt.Errorf("listing nodes, %w", err) - } - return lo.ToSlicePtr(nodeList.Items), nil -} - -// New converts a node into a Machine using known values from the node and provisioner spec values -// Deprecated: This Machine generator function can be removed when v1beta1 migration has completed. -func New(node *v1.Node, provisioner *v1alpha5.Provisioner) *v1alpha5.Machine { - machine := NewFromNode(node) - machine.Annotations = lo.Assign(provisioner.Annotations, v1alpha5.ProviderAnnotation(provisioner.Spec.Provider)) - machine.Labels = lo.Assign(provisioner.Labels, map[string]string{v1alpha5.ProvisionerNameLabelKey: provisioner.Name}) - machine.OwnerReferences = []metav1.OwnerReference{ - { - APIVersion: v1alpha5.SchemeGroupVersion.String(), - Kind: "Provisioner", - Name: provisioner.Name, - UID: provisioner.UID, - BlockOwnerDeletion: ptr.Bool(true), - }, - } - machine.Spec.Kubelet = provisioner.Spec.KubeletConfiguration - machine.Spec.Taints = provisioner.Spec.Taints - machine.Spec.StartupTaints = provisioner.Spec.StartupTaints - machine.Spec.Requirements = provisioner.Spec.Requirements - machine.Spec.MachineTemplateRef = provisioner.Spec.ProviderRef - return machine -} - -// NewFromNode converts a node into a pseudo-Machine using known values from the node -// Deprecated: This Machine generator function can be removed when v1beta1 migration has completed. -func NewFromNode(node *v1.Node) *v1alpha5.Machine { - m := &v1alpha5.Machine{ - ObjectMeta: metav1.ObjectMeta{ - Name: node.Name, - Annotations: node.Annotations, - Labels: node.Labels, - Finalizers: []string{v1alpha5.TerminationFinalizer}, - }, - Spec: v1alpha5.MachineSpec{ - Taints: node.Spec.Taints, - Requirements: scheduling.NewLabelRequirements(node.Labels).NodeSelectorRequirements(), - Resources: v1alpha5.ResourceRequirements{ - Requests: node.Status.Allocatable, - }, - }, - Status: v1alpha5.MachineStatus{ - ProviderID: node.Spec.ProviderID, - Capacity: node.Status.Capacity, - Allocatable: node.Status.Allocatable, - }, - } - if _, ok := node.Labels[v1alpha5.LabelNodeInitialized]; ok { - m.StatusConditions().MarkTrue(v1alpha5.MachineInitialized) - } - m.StatusConditions().MarkTrue(v1alpha5.MachineLaunched) - m.StatusConditions().MarkTrue(v1alpha5.MachineRegistered) - return m -} - -func IsPastEmptinessTTL(machine *v1alpha5.Machine, clock clock.Clock, provisioner *v1alpha5.Provisioner) bool { - return machine.StatusConditions().GetCondition(v1alpha5.MachineEmpty) != nil && - machine.StatusConditions().GetCondition(v1alpha5.MachineEmpty).IsTrue() && - !clock.Now().Before(machine.StatusConditions().GetCondition(v1alpha5.MachineEmpty).LastTransitionTime.Inner.Add(time.Duration(lo.FromPtr(provisioner.Spec.TTLSecondsAfterEmpty))*time.Second)) -} - -func IsExpired(obj client.Object, clock clock.Clock, provisioner *v1alpha5.Provisioner) bool { - return clock.Now().After(GetExpirationTime(obj, provisioner)) -} - -func GetExpirationTime(obj client.Object, provisioner *v1alpha5.Provisioner) time.Time { - if provisioner == nil || provisioner.Spec.TTLSecondsUntilExpired == nil || obj == nil { - // If not defined, return some much larger time. - return time.Date(5000, 0, 0, 0, 0, 0, 0, time.UTC) - } - expirationTTL := time.Duration(ptr.Int64Value(provisioner.Spec.TTLSecondsUntilExpired)) * time.Second - return obj.GetCreationTimestamp().Add(expirationTTL) -} diff --git a/vendor/github.com/aws/karpenter-core/pkg/utils/node/node.go b/vendor/github.com/aws/karpenter-core/pkg/utils/node/node.go deleted file mode 100644 index f0d184ff..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/utils/node/node.go +++ /dev/null @@ -1,58 +0,0 @@ -/* -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. -*/ - -package node - -import ( - "context" - "fmt" - - v1 "k8s.io/api/core/v1" - "sigs.k8s.io/controller-runtime/pkg/client" - - "github.com/aws/karpenter-core/pkg/utils/pod" -) - -// GetNodePods gets the list of schedulable pods from a variadic list of nodes -// It ignores pods that are owned by the node, a daemonset or are in a terminal -// or terminating state -func GetNodePods(ctx context.Context, kubeClient client.Client, nodes ...*v1.Node) ([]*v1.Pod, error) { - var pods []*v1.Pod - for _, node := range nodes { - var podList v1.PodList - if err := kubeClient.List(ctx, &podList, client.MatchingFields{"spec.nodeName": node.Name}); err != nil { - return nil, fmt.Errorf("listing pods, %w", err) - } - for i := range podList.Items { - // these pods don't need to be rescheduled - if pod.IsOwnedByNode(&podList.Items[i]) || - pod.IsOwnedByDaemonSet(&podList.Items[i]) || - pod.IsTerminal(&podList.Items[i]) || - pod.IsTerminating(&podList.Items[i]) { - continue - } - pods = append(pods, &podList.Items[i]) - } - } - return pods, nil -} - -func GetCondition(n *v1.Node, match v1.NodeConditionType) v1.NodeCondition { - for _, condition := range n.Status.Conditions { - if condition.Type == match { - return condition - } - } - return v1.NodeCondition{} -} diff --git a/vendor/github.com/aws/karpenter-core/pkg/utils/pod/scheduling.go b/vendor/github.com/aws/karpenter-core/pkg/utils/pod/scheduling.go deleted file mode 100644 index 5048cb71..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/utils/pod/scheduling.go +++ /dev/null @@ -1,106 +0,0 @@ -/* -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. -*/ - -package pod - -import ( - v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/runtime/schema" - - "github.com/aws/karpenter-core/pkg/apis/v1alpha5" - "github.com/aws/karpenter-core/pkg/scheduling" -) - -func IsProvisionable(pod *v1.Pod) bool { - return !IsScheduled(pod) && - !IsPreempting(pod) && - FailedToSchedule(pod) && - !IsOwnedByDaemonSet(pod) && - !IsOwnedByNode(pod) -} - -func FailedToSchedule(pod *v1.Pod) bool { - for _, condition := range pod.Status.Conditions { - if condition.Type == v1.PodScheduled && condition.Reason == v1.PodReasonUnschedulable { - return true - } - } - return false -} - -func IsScheduled(pod *v1.Pod) bool { - return pod.Spec.NodeName != "" -} - -func IsPreempting(pod *v1.Pod) bool { - return pod.Status.NominatedNodeName != "" -} - -func IsTerminal(pod *v1.Pod) bool { - return pod.Status.Phase == v1.PodFailed || pod.Status.Phase == v1.PodSucceeded -} - -func IsTerminating(pod *v1.Pod) bool { - return pod.DeletionTimestamp != nil -} - -func IsOwnedByDaemonSet(pod *v1.Pod) bool { - return IsOwnedBy(pod, []schema.GroupVersionKind{ - {Group: "apps", Version: "v1", Kind: "DaemonSet"}, - }) -} - -// IsOwnedByNode returns true if the pod is a static pod owned by a specific node -func IsOwnedByNode(pod *v1.Pod) bool { - return IsOwnedBy(pod, []schema.GroupVersionKind{ - {Version: "v1", Kind: "Node"}, - }) -} - -func IsOwnedBy(pod *v1.Pod, gvks []schema.GroupVersionKind) bool { - for _, ignoredOwner := range gvks { - for _, owner := range pod.ObjectMeta.OwnerReferences { - if owner.APIVersion == ignoredOwner.GroupVersion().String() && owner.Kind == ignoredOwner.Kind { - return true - } - } - } - return false -} - -func HasDoNotEvict(pod *v1.Pod) bool { - if pod.Annotations == nil { - return false - } - return pod.Annotations[v1alpha5.DoNotEvictPodAnnotationKey] == "true" -} - -// HasUnschedulableToleration returns true if the pod tolerates node.kubernetes.io/unschedulable taint -func ToleratesUnschedulableTaint(pod *v1.Pod) bool { - return (scheduling.Taints{{Key: v1.TaintNodeUnschedulable, Effect: v1.TaintEffectNoSchedule}}).Tolerates(pod) == nil -} - -// HasRequiredPodAntiAffinity returns true if a non-empty PodAntiAffinity/RequiredDuringSchedulingIgnoredDuringExecution -// is defined in the pod spec -func HasRequiredPodAntiAffinity(pod *v1.Pod) bool { - return HasPodAntiAffinity(pod) && - len(pod.Spec.Affinity.PodAntiAffinity.RequiredDuringSchedulingIgnoredDuringExecution) != 0 -} - -// HasPodAntiAffinity returns true if a non-empty PodAntiAffinity is defined in the pod spec -func HasPodAntiAffinity(pod *v1.Pod) bool { - return pod.Spec.Affinity != nil && pod.Spec.Affinity.PodAntiAffinity != nil && - (len(pod.Spec.Affinity.PodAntiAffinity.RequiredDuringSchedulingIgnoredDuringExecution) != 0 || - len(pod.Spec.Affinity.PodAntiAffinity.PreferredDuringSchedulingIgnoredDuringExecution) != 0) -} diff --git a/vendor/github.com/aws/karpenter-core/pkg/utils/sets/sets.go b/vendor/github.com/aws/karpenter-core/pkg/utils/sets/sets.go deleted file mode 100644 index 37e0cabf..00000000 --- a/vendor/github.com/aws/karpenter-core/pkg/utils/sets/sets.go +++ /dev/null @@ -1,178 +0,0 @@ -/* -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. -*/ - -package sets - -type Empty struct{} - -// Set implements a generic implementation of k8s.io/apimachinery/pkg/util/sets -// TODO: Remove our local generic implementation when migrating to a later version of -// https://github.com/kubernetes/apimachinery/blob/master/pkg/util/sets/set.go -type Set[T comparable] map[T]Empty - -func New[T comparable](items ...T) Set[T] { - ss := make(Set[T], len(items)) - ss.Insert(items...) - return ss -} - -// Insert adds items to the set. -func (s Set[T]) Insert(items ...T) Set[T] { - for _, item := range items { - s[item] = Empty{} - } - return s -} - -// Delete removes all items from the set. -func (s Set[T]) Delete(items ...T) Set[T] { - for _, item := range items { - delete(s, item) - } - return s -} - -// Has returns true if and only if item is contained in the set. -func (s Set[T]) Has(item T) bool { - _, contained := s[item] - return contained -} - -// HasAll returns true if and only if all items are contained in the set. -func (s Set[T]) HasAll(items ...T) bool { - for _, item := range items { - if !s.Has(item) { - return false - } - } - return true -} - -// HasAny returns true if any items are contained in the set. -func (s Set[T]) HasAny(items ...T) bool { - for _, item := range items { - if s.Has(item) { - return true - } - } - return false -} - -// Clone returns a new set which is a copy of the current set. -func (s Set[T]) Clone() Set[T] { - result := make(Set[T], len(s)) - for key := range s { - result.Insert(key) - } - return result -} - -// Difference returns a set of objects that are not in s2 -// For example: -// s1 = {a1, a2, a3} -// s2 = {a1, a2, a4, a5} -// s1.Difference(s2) = {a3} -// s2.Difference(s1) = {a4, a5} -func (s Set[T]) Difference(s2 Set[T]) Set[T] { - result := New[T]() - for key := range s { - if !s2.Has(key) { - result.Insert(key) - } - } - return result -} - -// Union returns a new set which includes items in either s1 or s2. -// For example: -// s1 = {a1, a2} -// s2 = {a3, a4} -// s1.Union(s2) = {a1, a2, a3, a4} -// s2.Union(s1) = {a1, a2, a3, a4} -func (s Set[T]) Union(s2 Set[T]) Set[T] { - result := s.Clone() - for key := range s2 { - result.Insert(key) - } - return result -} - -// Intersection returns a new set which includes the item in BOTH s1 and s2 -// For example: -// s1 = {a1, a2} -// s2 = {a2, a3} -// s1.Intersection(s2) = {a2} -func (s Set[T]) Intersection(s2 Set[T]) Set[T] { - var walk, other Set[T] - result := New[T]() - if s.Len() < s2.Len() { - walk = s - other = s2 - } else { - walk = s2 - other = s - } - for key := range walk { - if other.Has(key) { - result.Insert(key) - } - } - return result -} - -// IsSuperset returns true if and only if s1 is a superset of s2. -func (s Set[T]) IsSuperset(s2 Set[T]) bool { - for item := range s2 { - if !s.Has(item) { - return false - } - } - return true -} - -func (s Set[T]) Equal(s2 Set[T]) bool { - if s.Len() != s2.Len() { - return false - } - for item := range s2 { - if !s.Has(item) { - return false - } - } - return true -} - -// List returns the slice with contents in random order. -func (s Set[T]) List() []T { - res := make([]T, 0, len(s)) - for key := range s { - res = append(res, key) - } - return res -} - -// PopAny returns a single element from the set. -func (s Set[T]) PopAny() (T, bool) { - for key := range s { - s.Delete(key) - return key, true - } - var zeroValue T - return zeroValue, false -} - -// Len returns the size of the set. -func (s Set[T]) Len() int { - return len(s) -} diff --git a/vendor/github.com/awslabs/operatorpkg/LICENSE b/vendor/github.com/awslabs/operatorpkg/LICENSE new file mode 100644 index 00000000..67db8588 --- /dev/null +++ b/vendor/github.com/awslabs/operatorpkg/LICENSE @@ -0,0 +1,175 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. diff --git a/vendor/github.com/aws/karpenter-core/NOTICE b/vendor/github.com/awslabs/operatorpkg/NOTICE similarity index 87% rename from vendor/github.com/aws/karpenter-core/NOTICE rename to vendor/github.com/awslabs/operatorpkg/NOTICE index 63c76caf..616fc588 100644 --- a/vendor/github.com/aws/karpenter-core/NOTICE +++ b/vendor/github.com/awslabs/operatorpkg/NOTICE @@ -1,2 +1 @@ -Karpenter Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/vendor/github.com/awslabs/operatorpkg/controller/controller.go b/vendor/github.com/awslabs/operatorpkg/controller/controller.go new file mode 100644 index 00000000..c72aac1e --- /dev/null +++ b/vendor/github.com/awslabs/operatorpkg/controller/controller.go @@ -0,0 +1,12 @@ +package controller + +import ( + "context" + + "sigs.k8s.io/controller-runtime/pkg/manager" +) + +// Controller is a reconciler that allows registration with a controller-runtime Manager +type Controller interface { + Register(context.Context, manager.Manager) error +} diff --git a/vendor/github.com/awslabs/operatorpkg/metrics/metrics.go b/vendor/github.com/awslabs/operatorpkg/metrics/metrics.go new file mode 100644 index 00000000..ac8f67ec --- /dev/null +++ b/vendor/github.com/awslabs/operatorpkg/metrics/metrics.go @@ -0,0 +1,129 @@ +package metrics + +import ( + "context" + "net/url" + "strings" + "time" + + "github.com/prometheus/client_golang/prometheus" + "github.com/samber/lo" + clientmetrics "k8s.io/client-go/tools/metrics" +) + +// This package adds client-go metrics that can be surfaced through the Prometheus metrics server +// This is based on the reference implementation that was pulled out in controller-runtime in https://github.com/kubernetes-sigs/controller-runtime/pull/2298 + +var ( + requestResult = prometheus.NewCounterVec( + prometheus.CounterOpts{ + Name: "client_go_request_total", + Help: "Number of HTTP requests, partitioned by status code and method.", + }, + []string{"code", "method"}, + ) + requestLatency = prometheus.NewHistogramVec(prometheus.HistogramOpts{ + Name: "client_go_request_duration_seconds", + Help: "Request latency in seconds. Broken down by verb, group, version, kind, and subresource.", + Buckets: prometheus.ExponentialBuckets(0.001, 1.5, 20), + }, []string{"verb", "group", "version", "kind", "subresource"}) +) + +// RegisterClientMetrics sets up the client latency and result metrics from client-go. +func RegisterClientMetrics(r prometheus.Registerer) { + // register the metrics with our registry + r.MustRegister(requestResult, requestLatency) + + clientmetrics.RequestLatency = &latencyAdapter{metric: requestLatency} + clientmetrics.RequestResult = &resultAdapter{metric: requestResult} +} + +type resultAdapter struct { + metric *prometheus.CounterVec +} + +func (r *resultAdapter) Increment(_ context.Context, code, method, _ string) { + r.metric.WithLabelValues(code, method).Inc() +} + +// latencyAdapter implements LatencyMetric. +type latencyAdapter struct { + metric *prometheus.HistogramVec +} + +// Observe increments the request latency metric for the given verb/group/version/kind/subresource. +func (l *latencyAdapter) Observe(_ context.Context, verb string, u url.URL, latency time.Duration) { + if data := parsePath(u.Path); data != nil { + // We update the "verb" to better reflect the action being taken by client-go + switch verb { + case "POST": + verb = "CREATE" + case "GET": + if !strings.Contains(u.Path, "{name}") { + verb = "LIST" + } + case "PUT": + if !strings.Contains(u.Path, "{name}") { + verb = "CREATE" + } else { + verb = "UPDATE" + } + } + l.metric.With(prometheus.Labels{ + "verb": verb, + "group": data.group, + "version": data.version, + "kind": data.kind, + "subresource": data.subresource, + }).Observe(latency.Seconds()) + } +} + +// pathData stores data parsed out from the URL path +type pathData struct { + group string + version string + kind string + subresource string +} + +// parsePath parses out the URL called from client-go to return back the group, version, kind, and subresource +// urls are formatted similar to /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name} or /apis/karpenter.sh/v1beta1/nodeclaims/{name} +func parsePath(path string) *pathData { + parts := strings.Split(path, "/")[1:] + + var groupIdx, versionIdx, kindIdx int + switch parts[0] { + case "api": + groupIdx = 0 + case "apis": + groupIdx = 1 + default: + return nil + } + // If the url is too short, then it's not interesting to us + if len(parts) < groupIdx+3 { + return nil + } + // This resource is namespaced and the resource is not the namespace + if parts[groupIdx+2] == "namespaces" && len(parts) > groupIdx+4 { + versionIdx = groupIdx + 1 + kindIdx = versionIdx + 3 + } else { + versionIdx = groupIdx + 1 + kindIdx = versionIdx + 1 + } + + // If we have a subresource, it's going to be two indices after the kind + var subresource string + if len(parts) == kindIdx+3 { + subresource = parts[kindIdx+2] + } + return &pathData{ + // If the group index is 0, this is part of the core API, so there's no group + group: lo.Ternary(groupIdx == 0, "", parts[groupIdx]), + version: parts[versionIdx], + kind: parts[kindIdx], + subresource: subresource, + } +} diff --git a/vendor/github.com/awslabs/operatorpkg/object/object.go b/vendor/github.com/awslabs/operatorpkg/object/object.go new file mode 100644 index 00000000..32fb02fb --- /dev/null +++ b/vendor/github.com/awslabs/operatorpkg/object/object.go @@ -0,0 +1,52 @@ +package object + +import ( + "fmt" + "reflect" + + "github.com/samber/lo" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/types" + "k8s.io/client-go/kubernetes/scheme" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/client/apiutil" + "sigs.k8s.io/yaml" +) + +// GroupVersionKindNamespacedName uniquely identifies an object +type GroupVersionKindNamespacedName struct { + schema.GroupVersionKind + types.NamespacedName +} + +// GVKNN returns a GroupVersionKindNamespacedName that uniquely identifies the object +func GVKNN(o client.Object) GroupVersionKindNamespacedName { + return GroupVersionKindNamespacedName{ + GroupVersionKind: GVK(o), + NamespacedName: client.ObjectKeyFromObject(o), + } +} + +func (gvknn GroupVersionKindNamespacedName) String() string { + str := fmt.Sprintf("%s/%s", gvknn.Group, gvknn.Kind) + if gvknn.Namespace != "" { + str += "/" + gvknn.Namespace + } + str += "/" + gvknn.Name + return str +} + +func GVK(o runtime.Object) schema.GroupVersionKind { + return lo.Must(apiutil.GVKForObject(o, scheme.Scheme)) +} + +func New[T any]() T { + return reflect.New(reflect.TypeOf(*new(T)).Elem()).Interface().(T) +} + +func Unmarshal[T any](raw []byte) *T { + t := *new(T) + lo.Must0(yaml.Unmarshal(raw, &t)) + return &t +} diff --git a/vendor/github.com/awslabs/operatorpkg/option/function.go b/vendor/github.com/awslabs/operatorpkg/option/function.go new file mode 100644 index 00000000..b5f98dfc --- /dev/null +++ b/vendor/github.com/awslabs/operatorpkg/option/function.go @@ -0,0 +1,13 @@ +package option + +type Function[T any] func(*T) + +func Resolve[T any](opts ...Function[T]) *T { + o := new(T) + for _, opt := range opts { + if opt != nil { + opt(o) + } + } + return o +} diff --git a/vendor/github.com/awslabs/operatorpkg/singleton/controller.go b/vendor/github.com/awslabs/operatorpkg/singleton/controller.go new file mode 100644 index 00000000..6255c978 --- /dev/null +++ b/vendor/github.com/awslabs/operatorpkg/singleton/controller.go @@ -0,0 +1,38 @@ +package singleton + +import ( + "context" + "time" + + "k8s.io/client-go/util/workqueue" + "sigs.k8s.io/controller-runtime/pkg/event" + "sigs.k8s.io/controller-runtime/pkg/handler" + "sigs.k8s.io/controller-runtime/pkg/reconcile" + "sigs.k8s.io/controller-runtime/pkg/source" +) + +const ( + // RequeueImmediately is a constant that allows for immediate RequeueAfter when you want to run your + // singleton controller as hot as possible in a fast requeuing loop + RequeueImmediately = 1 * time.Nanosecond +) + +type Reconciler interface { + Reconcile(ctx context.Context) (reconcile.Result, error) +} + +func AsReconciler(reconciler Reconciler) reconcile.Reconciler { + return reconcile.Func(func(ctx context.Context, r reconcile.Request) (reconcile.Result, error) { + return reconciler.Reconcile(ctx) + }) +} + +func Source() source.Source { + eventSource := make(chan event.GenericEvent, 1) + eventSource <- event.GenericEvent{} + return source.Channel(eventSource, handler.Funcs{ + GenericFunc: func(_ context.Context, _ event.GenericEvent, queue workqueue.RateLimitingInterface) { + queue.Add(reconcile.Request{}) + }, + }) +} diff --git a/vendor/github.com/awslabs/operatorpkg/status/condition.go b/vendor/github.com/awslabs/operatorpkg/status/condition.go new file mode 100644 index 00000000..cd1fc640 --- /dev/null +++ b/vendor/github.com/awslabs/operatorpkg/status/condition.go @@ -0,0 +1,58 @@ +// Inspired by https://github.com/knative/pkg/tree/97c7258e3a98b81459936bc7a29dc6a9540fa357/apis, +// but we chose to diverge due to the unacceptably large dependency closure of knative/pkg. +package status + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "sigs.k8s.io/controller-runtime/pkg/client" +) + +type Object interface { + client.Object + GetConditions() []Condition + SetConditions([]Condition) + StatusConditions() ConditionSet +} + +// ConditionType is a upper-camel-cased condition type. +type ConditionType string + +const ( + // ConditionReady specifies that the resource is ready. + // For long-running resources. + ConditionReady = "Ready" + // ConditionSucceeded specifies that the resource has finished. + // For resource which run to completion. + ConditionSucceeded = "Succeeded" +) + +// Condition aliases the upstream type and adds additional helper methods +type Condition metav1.Condition + +func (c *Condition) IsTrue() bool { + if c == nil { + return false + } + return c.Status == metav1.ConditionTrue +} + +func (c *Condition) IsFalse() bool { + if c == nil { + return false + } + return c.Status == metav1.ConditionFalse +} + +func (c *Condition) IsUnknown() bool { + if c == nil { + return true + } + return c.Status == metav1.ConditionUnknown +} + +func (c *Condition) GetStatus() metav1.ConditionStatus { + if c == nil { + return metav1.ConditionUnknown + } + return c.Status +} diff --git a/vendor/github.com/awslabs/operatorpkg/status/condition_set.go b/vendor/github.com/awslabs/operatorpkg/status/condition_set.go new file mode 100644 index 00000000..ce5d88e7 --- /dev/null +++ b/vendor/github.com/awslabs/operatorpkg/status/condition_set.go @@ -0,0 +1,244 @@ +// Inspired by https://github.com/knative/pkg/tree/97c7258e3a98b81459936bc7a29dc6a9540fa357/apis, +// but we chose to diverge due to the unacceptably large dependency closure of knative/pkg. +package status + +import ( + "fmt" + "reflect" + "sort" + "strings" + + "github.com/samber/lo" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// ConditionTypes is an abstract collection of the possible ConditionType values +// that a particular resource might expose. It also holds the "root condition" +// for that resource, which we define to be one of Ready or Succeeded depending +// on whether it is a Living or Batch process respectively. +type ConditionTypes struct { + root string + dependents []string +} + +// NewReadyConditions returns a ConditionTypes to hold the conditions for the +// resource. ConditionReady is used as the root condition. +// The set of condition types provided are those of the terminal subconditions. +func NewReadyConditions(d ...string) ConditionTypes { + return newConditionTypes(ConditionReady, d...) +} + +// NewSucceededConditions returns a ConditionTypes to hold the conditions for the +// batch resource. ConditionSucceeded is used as the root condition. +// The set of condition types provided are those of the terminal subconditions. +func NewSucceededConditions(d ...string) ConditionTypes { + return newConditionTypes(ConditionSucceeded, d...) +} + +func newConditionTypes(root string, dependents ...string) ConditionTypes { + return ConditionTypes{ + root: root, + dependents: lo.Reject(lo.Uniq(dependents), func(c string, _ int) bool { return c == root }), + } +} + +// ConditionSet provides methods for evaluating Conditions. +// +k8s:deepcopy-gen=false +type ConditionSet struct { + ConditionTypes + object Object +} + +// For creates a ConditionSet from an object using the original +// ConditionTypes as a reference. Status must be a pointer to a struct. +func (r ConditionTypes) For(object Object) ConditionSet { + cs := ConditionSet{object: object, ConditionTypes: r} + // Set known conditions Unknown if not set. + for _, t := range append(r.dependents, r.root) { + if cs.Get(t) == nil { + cs.SetUnknown(t) + } + } + return cs +} + +// Root returns the root Condition, typically "Ready" or "Succeeded" +func (c ConditionSet) Root() *Condition { + if c.object == nil { + return nil + } + return c.Get(c.root) +} + +func (c ConditionSet) List() []Condition { + if c.object == nil { + return nil + } + return c.object.GetConditions() +} + +// Get finds and returns the Condition that matches the ConditionType +// previously set on Conditions. +func (c ConditionSet) Get(t string) *Condition { + if c.object == nil { + return nil + } + if condition, found := lo.Find(c.object.GetConditions(), func(c Condition) bool { return c.Type == t }); found { + return &condition + } + return nil +} + +// IsTrue returns true if all condition types are true. +func (c ConditionSet) IsTrue(conditionTypes ...string) bool { + for _, conditionType := range conditionTypes { + if !c.Get(conditionType).IsTrue() { + return false + } + } + return true +} + +// Set sets or updates the Condition on Conditions for Condition.Type. +// If there is an update, Conditions are stored back sorted. +func (c ConditionSet) Set(condition Condition) (modified bool) { + conditionType := condition.Type + var conditions []Condition + for _, c := range c.object.GetConditions() { + if c.Type != conditionType { + conditions = append(conditions, c) + } else { + // If we'd only update the LastTransitionTime, then return. + condition.LastTransitionTime = c.LastTransitionTime + if reflect.DeepEqual(condition, c) { + return false + } + } + } + condition.LastTransitionTime = metav1.Now() + conditions = append(conditions, condition) + // Sorted for convenience of the consumer, i.e. kubectl. + sort.Slice(conditions, func(i, j int) bool { return conditions[i].Type < conditions[j].Type }) + c.object.SetConditions(conditions) + + // Recompute the root condition after setting any other condition + c.recomputeRootCondition(conditionType) + return true +} + +// Clear removes the abnormal condition that matches the ConditionType +// Not implemented for normal conditions +func (c ConditionSet) Clear(t string) error { + var conditions []Condition + + if c.object == nil { + return nil + } + // Normal conditions are not handled as they can't be nil + if t == c.root || lo.Contains(c.dependents, t) { + return fmt.Errorf("clearing normal conditions not implemented") + } + cond := c.Get(t) + if cond == nil { + return nil + } + for _, c := range c.object.GetConditions() { + if c.Type != t { + conditions = append(conditions, c) + } + } + + // Sorted for convenience of the consumer, i.e. kubectl. + sort.Slice(conditions, func(i, j int) bool { return conditions[i].Type < conditions[j].Type }) + c.object.SetConditions(conditions) + + return nil +} + +// SetTrue sets the status of conditionType to true with the reason, and then marks the root condition to +// true if all other dependents are also true. +func (c ConditionSet) SetTrue(conditionType string) (modified bool) { + return c.SetTrueWithReason(conditionType, conditionType, "") +} + +// SetTrueWithReason sets the status of conditionType to true with the reason, and then marks the root condition to +// true if all other dependents are also true. +func (c ConditionSet) SetTrueWithReason(conditionType string, reason, message string) (modified bool) { + return c.Set(Condition{ + Type: conditionType, + Status: metav1.ConditionTrue, + Reason: reason, + Message: message, + }) +} + +// SetUnknown sets the status of conditionType to Unknown and also sets the root condition +// to Unknown if no other dependent condition is in an error state. +func (c ConditionSet) SetUnknown(conditionType string) (modified bool) { + return c.SetUnknownWithReason(conditionType, "AwaitingReconciliation", "object is awaiting reconciliation") +} + +// SetUnknownWithReason sets the status of conditionType to Unknown with the reason, and also sets the root condition +// to Unknown if no other dependent condition is in an error state. +func (c ConditionSet) SetUnknownWithReason(conditionType string, reason, message string) (modified bool) { + return c.Set(Condition{ + Type: conditionType, + Status: metav1.ConditionUnknown, + Reason: reason, + Message: message, + }) +} + +// SetFalse sets the status of conditionType and the root condition to False. +func (c ConditionSet) SetFalse(conditionType string, reason, message string) (modified bool) { + return c.Set(Condition{ + Type: conditionType, + Status: metav1.ConditionFalse, + Reason: reason, + Message: message, + }) +} + +// recomputeRootCondition marks the root condition to true if all other dependents are also true. +func (c ConditionSet) recomputeRootCondition(conditionType string) { + if conditionType == c.root { + return + } + if conditions := c.findUnhealthyDependents(); len(conditions) == 0 { + c.SetTrue(c.root) + } else { + c.Set(Condition{ + Type: c.root, + // The root condition is no longer unknown as soon as any are false + Status: lo.Ternary( + lo.ContainsBy(conditions, func(condition Condition) bool { return condition.IsFalse() }), + metav1.ConditionFalse, + metav1.ConditionUnknown, + ), + Reason: "UnhealthyDependents", + Message: strings.Join(lo.Map(conditions, func(condition Condition, _ int) string { + return fmt.Sprintf("%s=%s", condition.Type, condition.Status) + }), ", "), + }) + } +} + +func (c ConditionSet) findUnhealthyDependents() []Condition { + if len(c.dependents) == 0 { + return nil + } + // Get dependent conditions + conditions := c.object.GetConditions() + conditions = lo.Filter(conditions, func(condition Condition, _ int) bool { + return lo.Contains(c.dependents, condition.Type) + }) + conditions = lo.Filter(conditions, func(condition Condition, _ int) bool { + return condition.IsFalse() || condition.IsUnknown() + }) + + // Sort set conditions by time. + sort.Slice(conditions, func(i, j int) bool { + return conditions[i].LastTransitionTime.After(conditions[j].LastTransitionTime.Time) + }) + return conditions +} diff --git a/vendor/github.com/awslabs/operatorpkg/status/controller.go b/vendor/github.com/awslabs/operatorpkg/status/controller.go new file mode 100644 index 00000000..6e7ba76c --- /dev/null +++ b/vendor/github.com/awslabs/operatorpkg/status/controller.go @@ -0,0 +1,262 @@ +package status + +import ( + "context" + "fmt" + "sync" + "time" + + "github.com/awslabs/operatorpkg/object" + "github.com/prometheus/client_golang/prometheus" + "github.com/samber/lo" + v1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/client-go/tools/record" + controllerruntime "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/controller" + "sigs.k8s.io/controller-runtime/pkg/manager" + "sigs.k8s.io/controller-runtime/pkg/metrics" + "sigs.k8s.io/controller-runtime/pkg/reconcile" +) + +const ( + MetricLabelGroup = "group" + MetricLabelKind = "kind" + MetricLabelNamespace = "namespace" + MetricLabelName = "name" + MetricLabelConditionType = "type" + MetricLabelConditionStatus = "status" + MetricLabelConditionReason = "reason" +) + +const ( + MetricNamespace = "operator" + MetricSubsystem = "status_condition" +) + +type Controller[T Object] struct { + kubeClient client.Client + eventRecorder record.EventRecorder + observedConditions sync.Map // map[reconcile.Request]ConditionSet +} + +func NewController[T Object](client client.Client, eventRecorder record.EventRecorder) *Controller[T] { + return &Controller[T]{ + kubeClient: client, + eventRecorder: eventRecorder, + } +} + +func (c *Controller[T]) Register(_ context.Context, m manager.Manager) error { + return controllerruntime.NewControllerManagedBy(m). + For(object.New[T]()). + WithOptions(controller.Options{MaxConcurrentReconciles: 10}). + Named("status"). + Complete(c) +} + +func (c *Controller[T]) Reconcile(ctx context.Context, req reconcile.Request) (reconcile.Result, error) { + o := object.New[T]() + gvk := object.GVK(o) + + if err := c.kubeClient.Get(ctx, req.NamespacedName, o); err != nil { + if errors.IsNotFound(err) { + ConditionCount.DeletePartialMatch(prometheus.Labels{ + MetricLabelGroup: gvk.Group, + MetricLabelKind: gvk.Kind, + MetricLabelNamespace: req.Namespace, + MetricLabelName: req.Name, + }) + ConditionCurrentStatusSeconds.DeletePartialMatch(prometheus.Labels{ + MetricLabelGroup: gvk.Group, + MetricLabelKind: gvk.Kind, + MetricLabelNamespace: req.Namespace, + MetricLabelName: req.Name, + }) + return reconcile.Result{}, nil + } + return reconcile.Result{}, fmt.Errorf("getting object, %w", err) + } + + currentConditions := o.StatusConditions() + observedConditions := ConditionSet{} + if v, ok := c.observedConditions.Load(req); ok { + observedConditions = v.(ConditionSet) + } + c.observedConditions.Store(req, currentConditions) + + // Detect and record condition counts + for _, condition := range o.GetConditions() { + ConditionCount.With(prometheus.Labels{ + MetricLabelGroup: gvk.Group, + MetricLabelKind: gvk.Kind, + MetricLabelNamespace: req.Namespace, + MetricLabelName: req.Name, + MetricLabelConditionType: condition.Type, + MetricLabelConditionStatus: string(condition.Status), + MetricLabelConditionReason: condition.Reason, + }).Set(1) + ConditionCurrentStatusSeconds.With(prometheus.Labels{ + MetricLabelGroup: gvk.Group, + MetricLabelKind: gvk.Kind, + MetricLabelNamespace: req.Namespace, + MetricLabelName: req.Name, + MetricLabelConditionType: condition.Type, + MetricLabelConditionStatus: string(condition.Status), + MetricLabelConditionReason: condition.Reason, + }).Set(time.Since(condition.LastTransitionTime.Time).Seconds()) + } + for _, observedCondition := range observedConditions.List() { + if currentCondition := currentConditions.Get(observedCondition.Type); currentCondition == nil || currentCondition.Status != observedCondition.Status { + ConditionCount.Delete(prometheus.Labels{ + MetricLabelGroup: gvk.Group, + MetricLabelKind: gvk.Kind, + MetricLabelNamespace: req.Namespace, + MetricLabelName: req.Name, + MetricLabelConditionType: observedCondition.Type, + MetricLabelConditionStatus: string(observedCondition.Status), + MetricLabelConditionReason: observedCondition.Reason, + }) + ConditionCurrentStatusSeconds.Delete(prometheus.Labels{ + MetricLabelGroup: gvk.Group, + MetricLabelKind: gvk.Kind, + MetricLabelNamespace: req.Namespace, + MetricLabelName: req.Name, + MetricLabelConditionType: observedCondition.Type, + MetricLabelConditionStatus: string(observedCondition.Status), + MetricLabelConditionReason: observedCondition.Reason, + }) + } + } + + // Detect and record status transitions. This approach is best effort, + // since we may batch multiple writes within a single reconcile loop. + // It's exceedingly difficult to atomically track all changes to an + // object, since the Kubernetes is evenutally consistent by design. + // Despite this, we can catch the majority of transition by remembering + // what we saw last, and reporting observed changes. + // + // We rejected the alternative of tracking these changes within the + // condition library itself, since you cannot guarantee that a + // transition made in memory was successfully persisted. + // + // Automatic monitoring systems must assume that these observations are + // lossy, specifically for when a condition transition rapidly. However, + // for the common case, we want to alert when a transition took a long + // time, and our likelyhood of observing this is much higher. + for _, condition := range currentConditions.List() { + observedCondition := observedConditions.Get(condition.Type) + if observedCondition.GetStatus() == condition.GetStatus() { + continue + } + // A condition transitions if it either didn't exist before or it has changed + ConditionTransitionsTotal.With(prometheus.Labels{ + MetricLabelGroup: gvk.Group, + MetricLabelKind: gvk.Kind, + MetricLabelConditionType: condition.Type, + MetricLabelConditionStatus: string(condition.Status), + MetricLabelConditionReason: condition.Reason, + }).Inc() + if observedCondition == nil { + continue + } + duration := condition.LastTransitionTime.Time.Sub(observedCondition.LastTransitionTime.Time).Seconds() + ConditionDuration.With(prometheus.Labels{ + MetricLabelGroup: gvk.Group, + MetricLabelKind: gvk.Kind, + MetricLabelConditionType: observedCondition.Type, + MetricLabelConditionStatus: string(observedCondition.Status), + }).Observe(duration) + c.eventRecorder.Event(o, v1.EventTypeNormal, condition.Type, fmt.Sprintf("Status condition transitioned, Type: %s, Status: %s -> %s, Reason: %s%s", + condition.Type, + observedCondition.Status, + condition.Status, + condition.Reason, + lo.Ternary(condition.Message != "", fmt.Sprintf(", Message: %s", condition.Message), ""), + )) + } + return reconcile.Result{RequeueAfter: time.Second * 10}, nil +} + +// Cardinality is limited to # objects * # conditions * # objectives +var ConditionDuration = prometheus.NewHistogramVec( + prometheus.HistogramOpts{ + Namespace: MetricNamespace, + Subsystem: MetricSubsystem, + Name: "transition_seconds", + Help: "The amount of time a condition was in a given state before transitioning. e.g. Alarm := P99(Updated=False) > 5 minutes", + }, + []string{ + MetricLabelGroup, + MetricLabelKind, + MetricLabelConditionType, + MetricLabelConditionStatus, + }, +) + +// Cardinality is limited to # objects * # conditions +var ConditionCount = prometheus.NewGaugeVec( + prometheus.GaugeOpts{ + Namespace: MetricNamespace, + Subsystem: MetricSubsystem, + Name: "count", + Help: "The number of an condition for a given object, type and status. e.g. Alarm := Available=False > 0", + }, + []string{ + MetricLabelNamespace, + MetricLabelName, + MetricLabelGroup, + MetricLabelKind, + MetricLabelConditionType, + MetricLabelConditionStatus, + MetricLabelConditionReason, + }, +) + +// Cardinality is limited to # objects * # conditions +// NOTE: This metric is based on a requeue so it won't show the current status seconds with extremely high accuracy. +// This metric is useful for aggreations. If you need a high accuracy metric, use operator_status_condition_last_transition_time_seconds +var ConditionCurrentStatusSeconds = prometheus.NewGaugeVec( + prometheus.GaugeOpts{ + Namespace: MetricNamespace, + Subsystem: MetricSubsystem, + Name: "current_status_seconds", + Help: "The current amount of time in seconds that a status condition has been in a specific state. Alarm := P99(Updated=Unknown) > 5 minutes", + }, + []string{ + MetricLabelNamespace, + MetricLabelName, + MetricLabelGroup, + MetricLabelKind, + MetricLabelConditionType, + MetricLabelConditionStatus, + MetricLabelConditionReason, + }, +) + +// Cardinality is limited to # objects * # conditions +var ConditionTransitionsTotal = prometheus.NewCounterVec( + prometheus.CounterOpts{ + Namespace: MetricNamespace, + Subsystem: MetricSubsystem, + Name: "transitions_total", + Help: "The count of transitions of a given object, type and status.", + }, + []string{ + MetricLabelGroup, + MetricLabelKind, + MetricLabelConditionType, + MetricLabelConditionStatus, + MetricLabelConditionReason, + }, +) + +func init() { + metrics.Registry.MustRegister( + ConditionCount, + ConditionDuration, + ConditionTransitionsTotal, + ConditionCurrentStatusSeconds, + ) +} diff --git a/vendor/github.com/awslabs/operatorpkg/status/doc.go b/vendor/github.com/awslabs/operatorpkg/status/doc.go new file mode 100644 index 00000000..ae9feac9 --- /dev/null +++ b/vendor/github.com/awslabs/operatorpkg/status/doc.go @@ -0,0 +1,3 @@ +// +k8s:deepcopy-gen=package,register +// +kubebuilder:object:generate=false +package status // doc.go is discovered by codegen diff --git a/vendor/github.com/awslabs/operatorpkg/status/zz_generated.deepcopy.go b/vendor/github.com/awslabs/operatorpkg/status/zz_generated.deepcopy.go new file mode 100644 index 00000000..84fcea33 --- /dev/null +++ b/vendor/github.com/awslabs/operatorpkg/status/zz_generated.deepcopy.go @@ -0,0 +1,24 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +// Code generated by controller-gen. DO NOT EDIT. + +package status + +import () + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Condition) DeepCopyInto(out *Condition) { + *out = *in + in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Condition. +func (in *Condition) DeepCopy() *Condition { + if in == nil { + return nil + } + out := new(Condition) + in.DeepCopyInto(out) + return out +} diff --git a/vendor/github.com/benbjohnson/clock/LICENSE b/vendor/github.com/benbjohnson/clock/LICENSE deleted file mode 100644 index ce212cb1..00000000 --- a/vendor/github.com/benbjohnson/clock/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Ben Johnson - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/github.com/benbjohnson/clock/README.md b/vendor/github.com/benbjohnson/clock/README.md deleted file mode 100644 index ee37dfe1..00000000 --- a/vendor/github.com/benbjohnson/clock/README.md +++ /dev/null @@ -1,104 +0,0 @@ -clock -===== - -Clock is a small library for mocking time in Go. It provides an interface -around the standard library's [`time`][time] package so that the application -can use the realtime clock while tests can use the mock clock. - -[time]: http://golang.org/pkg/time/ - - -## Usage - -### Realtime Clock - -Your application can maintain a `Clock` variable that will allow realtime and -mock clocks to be interchangeable. For example, if you had an `Application` type: - -```go -import "github.com/benbjohnson/clock" - -type Application struct { - Clock clock.Clock -} -``` - -You could initialize it to use the realtime clock like this: - -```go -var app Application -app.Clock = clock.New() -... -``` - -Then all timers and time-related functionality should be performed from the -`Clock` variable. - - -### Mocking time - -In your tests, you will want to use a `Mock` clock: - -```go -import ( - "testing" - - "github.com/benbjohnson/clock" -) - -func TestApplication_DoSomething(t *testing.T) { - mock := clock.NewMock() - app := Application{Clock: mock} - ... -} -``` - -Now that you've initialized your application to use the mock clock, you can -adjust the time programmatically. The mock clock always starts from the Unix -epoch (midnight UTC on Jan 1, 1970). - - -### Controlling time - -The mock clock provides the same functions that the standard library's `time` -package provides. For example, to find the current time, you use the `Now()` -function: - -```go -mock := clock.NewMock() - -// Find the current time. -mock.Now().UTC() // 1970-01-01 00:00:00 +0000 UTC - -// Move the clock forward. -mock.Add(2 * time.Hour) - -// Check the time again. It's 2 hours later! -mock.Now().UTC() // 1970-01-01 02:00:00 +0000 UTC -``` - -Timers and Tickers are also controlled by this same mock clock. They will only -execute when the clock is moved forward: - -```go -mock := clock.NewMock() -count := 0 - -// Kick off a timer to increment every 1 mock second. -go func() { - ticker := clock.Ticker(1 * time.Second) - for { - <-ticker.C - count++ - } -}() -runtime.Gosched() - -// Move the clock forward 10 seconds. -mock.Add(10 * time.Second) - -// This prints 10. -fmt.Println(count) -``` - - diff --git a/vendor/github.com/benbjohnson/clock/clock.go b/vendor/github.com/benbjohnson/clock/clock.go deleted file mode 100644 index 6a4edb2e..00000000 --- a/vendor/github.com/benbjohnson/clock/clock.go +++ /dev/null @@ -1,340 +0,0 @@ -package clock - -import ( - "sort" - "sync" - "time" -) - -// Clock represents an interface to the functions in the standard library time -// package. Two implementations are available in the clock package. The first -// is a real-time clock which simply wraps the time package's functions. The -// second is a mock clock which will only change when -// programmatically adjusted. -type Clock interface { - After(d time.Duration) <-chan time.Time - AfterFunc(d time.Duration, f func()) *Timer - Now() time.Time - Since(t time.Time) time.Duration - Sleep(d time.Duration) - Tick(d time.Duration) <-chan time.Time - Ticker(d time.Duration) *Ticker - Timer(d time.Duration) *Timer -} - -// New returns an instance of a real-time clock. -func New() Clock { - return &clock{} -} - -// clock implements a real-time clock by simply wrapping the time package functions. -type clock struct{} - -func (c *clock) After(d time.Duration) <-chan time.Time { return time.After(d) } - -func (c *clock) AfterFunc(d time.Duration, f func()) *Timer { - return &Timer{timer: time.AfterFunc(d, f)} -} - -func (c *clock) Now() time.Time { return time.Now() } - -func (c *clock) Since(t time.Time) time.Duration { return time.Since(t) } - -func (c *clock) Sleep(d time.Duration) { time.Sleep(d) } - -func (c *clock) Tick(d time.Duration) <-chan time.Time { return time.Tick(d) } - -func (c *clock) Ticker(d time.Duration) *Ticker { - t := time.NewTicker(d) - return &Ticker{C: t.C, ticker: t} -} - -func (c *clock) Timer(d time.Duration) *Timer { - t := time.NewTimer(d) - return &Timer{C: t.C, timer: t} -} - -// Mock represents a mock clock that only moves forward programmatically. -// It can be preferable to a real-time clock when testing time-based functionality. -type Mock struct { - mu sync.Mutex - now time.Time // current time - timers clockTimers // tickers & timers -} - -// NewMock returns an instance of a mock clock. -// The current time of the mock clock on initialization is the Unix epoch. -func NewMock() *Mock { - return &Mock{now: time.Unix(0, 0)} -} - -// Add moves the current time of the mock clock forward by the specified duration. -// This should only be called from a single goroutine at a time. -func (m *Mock) Add(d time.Duration) { - // Calculate the final current time. - t := m.now.Add(d) - - // Continue to execute timers until there are no more before the new time. - for { - if !m.runNextTimer(t) { - break - } - } - - // Ensure that we end with the new time. - m.mu.Lock() - m.now = t - m.mu.Unlock() - - // Give a small buffer to make sure that other goroutines get handled. - gosched() -} - -// Set sets the current time of the mock clock to a specific one. -// This should only be called from a single goroutine at a time. -func (m *Mock) Set(t time.Time) { - // Continue to execute timers until there are no more before the new time. - for { - if !m.runNextTimer(t) { - break - } - } - - // Ensure that we end with the new time. - m.mu.Lock() - m.now = t - m.mu.Unlock() - - // Give a small buffer to make sure that other goroutines get handled. - gosched() -} - -// runNextTimer executes the next timer in chronological order and moves the -// current time to the timer's next tick time. The next time is not executed if -// its next time is after the max time. Returns true if a timer was executed. -func (m *Mock) runNextTimer(max time.Time) bool { - m.mu.Lock() - - // Sort timers by time. - sort.Sort(m.timers) - - // If we have no more timers then exit. - if len(m.timers) == 0 { - m.mu.Unlock() - return false - } - - // Retrieve next timer. Exit if next tick is after new time. - t := m.timers[0] - if t.Next().After(max) { - m.mu.Unlock() - return false - } - - // Move "now" forward and unlock clock. - m.now = t.Next() - m.mu.Unlock() - - // Execute timer. - t.Tick(m.now) - return true -} - -// After waits for the duration to elapse and then sends the current time on the returned channel. -func (m *Mock) After(d time.Duration) <-chan time.Time { - return m.Timer(d).C -} - -// AfterFunc waits for the duration to elapse and then executes a function. -// A Timer is returned that can be stopped. -func (m *Mock) AfterFunc(d time.Duration, f func()) *Timer { - t := m.Timer(d) - t.C = nil - t.fn = f - return t -} - -// Now returns the current wall time on the mock clock. -func (m *Mock) Now() time.Time { - m.mu.Lock() - defer m.mu.Unlock() - return m.now -} - -// Since returns time since the mock clock's wall time. -func (m *Mock) Since(t time.Time) time.Duration { - return m.Now().Sub(t) -} - -// Sleep pauses the goroutine for the given duration on the mock clock. -// The clock must be moved forward in a separate goroutine. -func (m *Mock) Sleep(d time.Duration) { - <-m.After(d) -} - -// Tick is a convenience function for Ticker(). -// It will return a ticker channel that cannot be stopped. -func (m *Mock) Tick(d time.Duration) <-chan time.Time { - return m.Ticker(d).C -} - -// Ticker creates a new instance of Ticker. -func (m *Mock) Ticker(d time.Duration) *Ticker { - m.mu.Lock() - defer m.mu.Unlock() - ch := make(chan time.Time, 1) - t := &Ticker{ - C: ch, - c: ch, - mock: m, - d: d, - next: m.now.Add(d), - } - m.timers = append(m.timers, (*internalTicker)(t)) - return t -} - -// Timer creates a new instance of Timer. -func (m *Mock) Timer(d time.Duration) *Timer { - m.mu.Lock() - defer m.mu.Unlock() - ch := make(chan time.Time, 1) - t := &Timer{ - C: ch, - c: ch, - mock: m, - next: m.now.Add(d), - stopped: false, - } - m.timers = append(m.timers, (*internalTimer)(t)) - return t -} - -func (m *Mock) removeClockTimer(t clockTimer) { - for i, timer := range m.timers { - if timer == t { - copy(m.timers[i:], m.timers[i+1:]) - m.timers[len(m.timers)-1] = nil - m.timers = m.timers[:len(m.timers)-1] - break - } - } - sort.Sort(m.timers) -} - -// clockTimer represents an object with an associated start time. -type clockTimer interface { - Next() time.Time - Tick(time.Time) -} - -// clockTimers represents a list of sortable timers. -type clockTimers []clockTimer - -func (a clockTimers) Len() int { return len(a) } -func (a clockTimers) Swap(i, j int) { a[i], a[j] = a[j], a[i] } -func (a clockTimers) Less(i, j int) bool { return a[i].Next().Before(a[j].Next()) } - -// Timer represents a single event. -// The current time will be sent on C, unless the timer was created by AfterFunc. -type Timer struct { - C <-chan time.Time - c chan time.Time - timer *time.Timer // realtime impl, if set - next time.Time // next tick time - mock *Mock // mock clock, if set - fn func() // AfterFunc function, if set - stopped bool // True if stopped, false if running -} - -// Stop turns off the ticker. -func (t *Timer) Stop() bool { - if t.timer != nil { - return t.timer.Stop() - } - - t.mock.mu.Lock() - registered := !t.stopped - t.mock.removeClockTimer((*internalTimer)(t)) - t.stopped = true - t.mock.mu.Unlock() - return registered -} - -// Reset changes the expiry time of the timer -func (t *Timer) Reset(d time.Duration) bool { - if t.timer != nil { - return t.timer.Reset(d) - } - - t.mock.mu.Lock() - t.next = t.mock.now.Add(d) - defer t.mock.mu.Unlock() - - registered := !t.stopped - if t.stopped { - t.mock.timers = append(t.mock.timers, (*internalTimer)(t)) - } - - t.stopped = false - return registered -} - -type internalTimer Timer - -func (t *internalTimer) Next() time.Time { return t.next } -func (t *internalTimer) Tick(now time.Time) { - t.mock.mu.Lock() - if t.fn != nil { - t.fn() - } else { - t.c <- now - } - t.mock.removeClockTimer((*internalTimer)(t)) - t.stopped = true - t.mock.mu.Unlock() - gosched() -} - -// Ticker holds a channel that receives "ticks" at regular intervals. -type Ticker struct { - C <-chan time.Time - c chan time.Time - ticker *time.Ticker // realtime impl, if set - next time.Time // next tick time - mock *Mock // mock clock, if set - d time.Duration // time between ticks -} - -// Stop turns off the ticker. -func (t *Ticker) Stop() { - if t.ticker != nil { - t.ticker.Stop() - } else { - t.mock.mu.Lock() - t.mock.removeClockTimer((*internalTicker)(t)) - t.mock.mu.Unlock() - } -} - -// Reset resets the ticker to a new duration. -func (t *Ticker) Reset(dur time.Duration) { - if t.ticker != nil { - t.ticker.Reset(dur) - } -} - -type internalTicker Ticker - -func (t *internalTicker) Next() time.Time { return t.next } -func (t *internalTicker) Tick(now time.Time) { - select { - case t.c <- now: - default: - } - t.next = now.Add(t.d) - gosched() -} - -// Sleep momentarily so that other goroutines can process. -func gosched() { time.Sleep(1 * time.Millisecond) } diff --git a/vendor/github.com/deckarep/golang-set/README.md b/vendor/github.com/deckarep/golang-set/README.md deleted file mode 100644 index c3b50b2c..00000000 --- a/vendor/github.com/deckarep/golang-set/README.md +++ /dev/null @@ -1,95 +0,0 @@ -[![Build Status](https://travis-ci.org/deckarep/golang-set.svg?branch=master)](https://travis-ci.org/deckarep/golang-set) -[![Go Report Card](https://goreportcard.com/badge/github.com/deckarep/golang-set)](https://goreportcard.com/report/github.com/deckarep/golang-set) -[![GoDoc](https://godoc.org/github.com/deckarep/golang-set?status.svg)](http://godoc.org/github.com/deckarep/golang-set) - -## golang-set - - -The missing set collection for the Go language. Until Go has sets built-in...use this. - -Coming from Python one of the things I miss is the superbly wonderful set collection. This is my attempt to mimic the primary features of the set from Python. -You can of course argue that there is no need for a set in Go, otherwise the creators would have added one to the standard library. To those I say simply ignore this repository -and carry-on and to the rest that find this useful please contribute in helping me make it better by: - -* Helping to make more idiomatic improvements to the code. -* Helping to increase the performance of it. ~~(So far, no attempt has been made, but since it uses a map internally, I expect it to be mostly performant.)~~ -* Helping to make the unit-tests more robust and kick-ass. -* Helping to fill in the [documentation.](http://godoc.org/github.com/deckarep/golang-set) -* Simply offering feedback and suggestions. (Positive, constructive feedback is appreciated.) - -I have to give some credit for helping seed the idea with this post on [stackoverflow.](http://programmers.stackexchange.com/questions/177428/sets-data-structure-in-golang) - -*Update* - as of 3/9/2014, you can use a compile-time generic version of this package in the [gen](http://clipperhouse.github.io/gen/) framework. This framework allows you to use the golang-set in a completely generic and type-safe way by allowing you to generate a supporting .go file based on your custom types. - -## Features (as of 9/22/2014) - -* a CartesianProduct() method has been added with unit-tests: [Read more about the cartesian product](http://en.wikipedia.org/wiki/Cartesian_product) - -## Features (as of 9/15/2014) - -* a PowerSet() method has been added with unit-tests: [Read more about the Power set](http://en.wikipedia.org/wiki/Power_set) - -## Features (as of 4/22/2014) - -* One common interface to both implementations -* Two set implementations to choose from - * a thread-safe implementation designed for concurrent use - * a non-thread-safe implementation designed for performance -* 75 benchmarks for both implementations -* 35 unit tests for both implementations -* 14 concurrent tests for the thread-safe implementation - - - -Please see the unit test file for additional usage examples. The Python set documentation will also do a better job than I can of explaining how a set typically [works.](http://docs.python.org/2/library/sets.html) Please keep in mind -however that the Python set is a built-in type and supports additional features and syntax that make it awesome. - -## Examples but not exhaustive: - -```go -requiredClasses := mapset.NewSet() -requiredClasses.Add("Cooking") -requiredClasses.Add("English") -requiredClasses.Add("Math") -requiredClasses.Add("Biology") - -scienceSlice := []interface{}{"Biology", "Chemistry"} -scienceClasses := mapset.NewSetFromSlice(scienceSlice) - -electiveClasses := mapset.NewSet() -electiveClasses.Add("Welding") -electiveClasses.Add("Music") -electiveClasses.Add("Automotive") - -bonusClasses := mapset.NewSet() -bonusClasses.Add("Go Programming") -bonusClasses.Add("Python Programming") - -//Show me all the available classes I can take -allClasses := requiredClasses.Union(scienceClasses).Union(electiveClasses).Union(bonusClasses) -fmt.Println(allClasses) //Set{Cooking, English, Math, Chemistry, Welding, Biology, Music, Automotive, Go Programming, Python Programming} - - -//Is cooking considered a science class? -fmt.Println(scienceClasses.Contains("Cooking")) //false - -//Show me all classes that are not science classes, since I hate science. -fmt.Println(allClasses.Difference(scienceClasses)) //Set{Music, Automotive, Go Programming, Python Programming, Cooking, English, Math, Welding} - -//Which science classes are also required classes? -fmt.Println(scienceClasses.Intersect(requiredClasses)) //Set{Biology} - -//How many bonus classes do you offer? -fmt.Println(bonusClasses.Cardinality()) //2 - -//Do you have the following classes? Welding, Automotive and English? -fmt.Println(allClasses.IsSuperset(mapset.NewSetFromSlice([]interface{}{"Welding", "Automotive", "English"}))) //true -``` - -Thanks! - --Ralph - -[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/deckarep/golang-set/trend.png)](https://bitdeli.com/free "Bitdeli Badge") - -[![Analytics](https://ga-beacon.appspot.com/UA-42584447-2/deckarep/golang-set)](https://github.com/igrigorik/ga-beacon) diff --git a/vendor/github.com/deckarep/golang-set/iterator.go b/vendor/github.com/deckarep/golang-set/iterator.go deleted file mode 100644 index 9dfecade..00000000 --- a/vendor/github.com/deckarep/golang-set/iterator.go +++ /dev/null @@ -1,58 +0,0 @@ -/* -Open Source Initiative OSI - The MIT License (MIT):Licensing - -The MIT License (MIT) -Copyright (c) 2013 Ralph Caraveo (deckarep@gmail.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ - -package mapset - -// Iterator defines an iterator over a Set, its C channel can be used to range over the Set's -// elements. -type Iterator struct { - C <-chan interface{} - stop chan struct{} -} - -// Stop stops the Iterator, no further elements will be received on C, C will be closed. -func (i *Iterator) Stop() { - // Allows for Stop() to be called multiple times - // (close() panics when called on already closed channel) - defer func() { - recover() - }() - - close(i.stop) - - // Exhaust any remaining elements. - for range i.C { - } -} - -// newIterator returns a new Iterator instance together with its item and stop channels. -func newIterator() (*Iterator, chan<- interface{}, <-chan struct{}) { - itemChan := make(chan interface{}) - stopChan := make(chan struct{}) - return &Iterator{ - C: itemChan, - stop: stopChan, - }, itemChan, stopChan -} diff --git a/vendor/github.com/deckarep/golang-set/set.go b/vendor/github.com/deckarep/golang-set/set.go deleted file mode 100644 index 29eb2e5a..00000000 --- a/vendor/github.com/deckarep/golang-set/set.go +++ /dev/null @@ -1,217 +0,0 @@ -/* -Open Source Initiative OSI - The MIT License (MIT):Licensing - -The MIT License (MIT) -Copyright (c) 2013 Ralph Caraveo (deckarep@gmail.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ - -// Package mapset implements a simple and generic set collection. -// Items stored within it are unordered and unique. It supports -// typical set operations: membership testing, intersection, union, -// difference, symmetric difference and cloning. -// -// Package mapset provides two implementations of the Set -// interface. The default implementation is safe for concurrent -// access, but a non-thread-safe implementation is also provided for -// programs that can benefit from the slight speed improvement and -// that can enforce mutual exclusion through other means. -package mapset - -// Set is the primary interface provided by the mapset package. It -// represents an unordered set of data and a large number of -// operations that can be applied to that set. -type Set interface { - // Adds an element to the set. Returns whether - // the item was added. - Add(i interface{}) bool - - // Returns the number of elements in the set. - Cardinality() int - - // Removes all elements from the set, leaving - // the empty set. - Clear() - - // Returns a clone of the set using the same - // implementation, duplicating all keys. - Clone() Set - - // Returns whether the given items - // are all in the set. - Contains(i ...interface{}) bool - - // Returns the difference between this set - // and other. The returned set will contain - // all elements of this set that are not also - // elements of other. - // - // Note that the argument to Difference - // must be of the same type as the receiver - // of the method. Otherwise, Difference will - // panic. - Difference(other Set) Set - - // Determines if two sets are equal to each - // other. If they have the same cardinality - // and contain the same elements, they are - // considered equal. The order in which - // the elements were added is irrelevant. - // - // Note that the argument to Equal must be - // of the same type as the receiver of the - // method. Otherwise, Equal will panic. - Equal(other Set) bool - - // Returns a new set containing only the elements - // that exist only in both sets. - // - // Note that the argument to Intersect - // must be of the same type as the receiver - // of the method. Otherwise, Intersect will - // panic. - Intersect(other Set) Set - - // Determines if every element in this set is in - // the other set but the two sets are not equal. - // - // Note that the argument to IsProperSubset - // must be of the same type as the receiver - // of the method. Otherwise, IsProperSubset - // will panic. - IsProperSubset(other Set) bool - - // Determines if every element in the other set - // is in this set but the two sets are not - // equal. - // - // Note that the argument to IsSuperset - // must be of the same type as the receiver - // of the method. Otherwise, IsSuperset will - // panic. - IsProperSuperset(other Set) bool - - // Determines if every element in this set is in - // the other set. - // - // Note that the argument to IsSubset - // must be of the same type as the receiver - // of the method. Otherwise, IsSubset will - // panic. - IsSubset(other Set) bool - - // Determines if every element in the other set - // is in this set. - // - // Note that the argument to IsSuperset - // must be of the same type as the receiver - // of the method. Otherwise, IsSuperset will - // panic. - IsSuperset(other Set) bool - - // Iterates over elements and executes the passed func against each element. - // If passed func returns true, stop iteration at the time. - Each(func(interface{}) bool) - - // Returns a channel of elements that you can - // range over. - Iter() <-chan interface{} - - // Returns an Iterator object that you can - // use to range over the set. - Iterator() *Iterator - - // Remove a single element from the set. - Remove(i interface{}) - - // Provides a convenient string representation - // of the current state of the set. - String() string - - // Returns a new set with all elements which are - // in either this set or the other set but not in both. - // - // Note that the argument to SymmetricDifference - // must be of the same type as the receiver - // of the method. Otherwise, SymmetricDifference - // will panic. - SymmetricDifference(other Set) Set - - // Returns a new set with all elements in both sets. - // - // Note that the argument to Union must be of the - - // same type as the receiver of the method. - // Otherwise, IsSuperset will panic. - Union(other Set) Set - - // Pop removes and returns an arbitrary item from the set. - Pop() interface{} - - // Returns all subsets of a given set (Power Set). - PowerSet() Set - - // Returns the Cartesian Product of two sets. - CartesianProduct(other Set) Set - - // Returns the members of the set as a slice. - ToSlice() []interface{} -} - -// NewSet creates and returns a reference to an empty set. Operations -// on the resulting set are thread-safe. -func NewSet(s ...interface{}) Set { - set := newThreadSafeSet() - for _, item := range s { - set.Add(item) - } - return &set -} - -// NewSetWith creates and returns a new set with the given elements. -// Operations on the resulting set are thread-safe. -func NewSetWith(elts ...interface{}) Set { - return NewSetFromSlice(elts) -} - -// NewSetFromSlice creates and returns a reference to a set from an -// existing slice. Operations on the resulting set are thread-safe. -func NewSetFromSlice(s []interface{}) Set { - a := NewSet(s...) - return a -} - -// NewThreadUnsafeSet creates and returns a reference to an empty set. -// Operations on the resulting set are not thread-safe. -func NewThreadUnsafeSet() Set { - set := newThreadUnsafeSet() - return &set -} - -// NewThreadUnsafeSetFromSlice creates and returns a reference to a -// set from an existing slice. Operations on the resulting set are -// not thread-safe. -func NewThreadUnsafeSetFromSlice(s []interface{}) Set { - a := NewThreadUnsafeSet() - for _, item := range s { - a.Add(item) - } - return a -} diff --git a/vendor/github.com/deckarep/golang-set/threadsafe.go b/vendor/github.com/deckarep/golang-set/threadsafe.go deleted file mode 100644 index 269b4ab0..00000000 --- a/vendor/github.com/deckarep/golang-set/threadsafe.go +++ /dev/null @@ -1,283 +0,0 @@ -/* -Open Source Initiative OSI - The MIT License (MIT):Licensing - -The MIT License (MIT) -Copyright (c) 2013 Ralph Caraveo (deckarep@gmail.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ - -package mapset - -import "sync" - -type threadSafeSet struct { - s threadUnsafeSet - sync.RWMutex -} - -func newThreadSafeSet() threadSafeSet { - return threadSafeSet{s: newThreadUnsafeSet()} -} - -func (set *threadSafeSet) Add(i interface{}) bool { - set.Lock() - ret := set.s.Add(i) - set.Unlock() - return ret -} - -func (set *threadSafeSet) Contains(i ...interface{}) bool { - set.RLock() - ret := set.s.Contains(i...) - set.RUnlock() - return ret -} - -func (set *threadSafeSet) IsSubset(other Set) bool { - o := other.(*threadSafeSet) - - set.RLock() - o.RLock() - - ret := set.s.IsSubset(&o.s) - set.RUnlock() - o.RUnlock() - return ret -} - -func (set *threadSafeSet) IsProperSubset(other Set) bool { - o := other.(*threadSafeSet) - - set.RLock() - defer set.RUnlock() - o.RLock() - defer o.RUnlock() - - return set.s.IsProperSubset(&o.s) -} - -func (set *threadSafeSet) IsSuperset(other Set) bool { - return other.IsSubset(set) -} - -func (set *threadSafeSet) IsProperSuperset(other Set) bool { - return other.IsProperSubset(set) -} - -func (set *threadSafeSet) Union(other Set) Set { - o := other.(*threadSafeSet) - - set.RLock() - o.RLock() - - unsafeUnion := set.s.Union(&o.s).(*threadUnsafeSet) - ret := &threadSafeSet{s: *unsafeUnion} - set.RUnlock() - o.RUnlock() - return ret -} - -func (set *threadSafeSet) Intersect(other Set) Set { - o := other.(*threadSafeSet) - - set.RLock() - o.RLock() - - unsafeIntersection := set.s.Intersect(&o.s).(*threadUnsafeSet) - ret := &threadSafeSet{s: *unsafeIntersection} - set.RUnlock() - o.RUnlock() - return ret -} - -func (set *threadSafeSet) Difference(other Set) Set { - o := other.(*threadSafeSet) - - set.RLock() - o.RLock() - - unsafeDifference := set.s.Difference(&o.s).(*threadUnsafeSet) - ret := &threadSafeSet{s: *unsafeDifference} - set.RUnlock() - o.RUnlock() - return ret -} - -func (set *threadSafeSet) SymmetricDifference(other Set) Set { - o := other.(*threadSafeSet) - - set.RLock() - o.RLock() - - unsafeDifference := set.s.SymmetricDifference(&o.s).(*threadUnsafeSet) - ret := &threadSafeSet{s: *unsafeDifference} - set.RUnlock() - o.RUnlock() - return ret -} - -func (set *threadSafeSet) Clear() { - set.Lock() - set.s = newThreadUnsafeSet() - set.Unlock() -} - -func (set *threadSafeSet) Remove(i interface{}) { - set.Lock() - delete(set.s, i) - set.Unlock() -} - -func (set *threadSafeSet) Cardinality() int { - set.RLock() - defer set.RUnlock() - return len(set.s) -} - -func (set *threadSafeSet) Each(cb func(interface{}) bool) { - set.RLock() - for elem := range set.s { - if cb(elem) { - break - } - } - set.RUnlock() -} - -func (set *threadSafeSet) Iter() <-chan interface{} { - ch := make(chan interface{}) - go func() { - set.RLock() - - for elem := range set.s { - ch <- elem - } - close(ch) - set.RUnlock() - }() - - return ch -} - -func (set *threadSafeSet) Iterator() *Iterator { - iterator, ch, stopCh := newIterator() - - go func() { - set.RLock() - L: - for elem := range set.s { - select { - case <-stopCh: - break L - case ch <- elem: - } - } - close(ch) - set.RUnlock() - }() - - return iterator -} - -func (set *threadSafeSet) Equal(other Set) bool { - o := other.(*threadSafeSet) - - set.RLock() - o.RLock() - - ret := set.s.Equal(&o.s) - set.RUnlock() - o.RUnlock() - return ret -} - -func (set *threadSafeSet) Clone() Set { - set.RLock() - - unsafeClone := set.s.Clone().(*threadUnsafeSet) - ret := &threadSafeSet{s: *unsafeClone} - set.RUnlock() - return ret -} - -func (set *threadSafeSet) String() string { - set.RLock() - ret := set.s.String() - set.RUnlock() - return ret -} - -func (set *threadSafeSet) PowerSet() Set { - set.RLock() - unsafePowerSet := set.s.PowerSet().(*threadUnsafeSet) - set.RUnlock() - - ret := &threadSafeSet{s: newThreadUnsafeSet()} - for subset := range unsafePowerSet.Iter() { - unsafeSubset := subset.(*threadUnsafeSet) - ret.Add(&threadSafeSet{s: *unsafeSubset}) - } - return ret -} - -func (set *threadSafeSet) Pop() interface{} { - set.Lock() - defer set.Unlock() - return set.s.Pop() -} - -func (set *threadSafeSet) CartesianProduct(other Set) Set { - o := other.(*threadSafeSet) - - set.RLock() - o.RLock() - - unsafeCartProduct := set.s.CartesianProduct(&o.s).(*threadUnsafeSet) - ret := &threadSafeSet{s: *unsafeCartProduct} - set.RUnlock() - o.RUnlock() - return ret -} - -func (set *threadSafeSet) ToSlice() []interface{} { - keys := make([]interface{}, 0, set.Cardinality()) - set.RLock() - for elem := range set.s { - keys = append(keys, elem) - } - set.RUnlock() - return keys -} - -func (set *threadSafeSet) MarshalJSON() ([]byte, error) { - set.RLock() - b, err := set.s.MarshalJSON() - set.RUnlock() - - return b, err -} - -func (set *threadSafeSet) UnmarshalJSON(p []byte) error { - set.RLock() - err := set.s.UnmarshalJSON(p) - set.RUnlock() - - return err -} diff --git a/vendor/github.com/deckarep/golang-set/threadunsafe.go b/vendor/github.com/deckarep/golang-set/threadunsafe.go deleted file mode 100644 index 927eb231..00000000 --- a/vendor/github.com/deckarep/golang-set/threadunsafe.go +++ /dev/null @@ -1,340 +0,0 @@ -/* -Open Source Initiative OSI - The MIT License (MIT):Licensing - -The MIT License (MIT) -Copyright (c) 2013 Ralph Caraveo (deckarep@gmail.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ - -package mapset - -import ( - "bytes" - "encoding/json" - "fmt" - "reflect" - "strings" -) - -type threadUnsafeSet map[interface{}]struct{} - -// An OrderedPair represents a 2-tuple of values. -type OrderedPair struct { - First interface{} - Second interface{} -} - -func newThreadUnsafeSet() threadUnsafeSet { - return make(threadUnsafeSet) -} - -// Equal says whether two 2-tuples contain the same values in the same order. -func (pair *OrderedPair) Equal(other OrderedPair) bool { - if pair.First == other.First && - pair.Second == other.Second { - return true - } - - return false -} - -func (set *threadUnsafeSet) Add(i interface{}) bool { - _, found := (*set)[i] - if found { - return false //False if it existed already - } - - (*set)[i] = struct{}{} - return true -} - -func (set *threadUnsafeSet) Contains(i ...interface{}) bool { - for _, val := range i { - if _, ok := (*set)[val]; !ok { - return false - } - } - return true -} - -func (set *threadUnsafeSet) IsSubset(other Set) bool { - _ = other.(*threadUnsafeSet) - if set.Cardinality() > other.Cardinality() { - return false - } - for elem := range *set { - if !other.Contains(elem) { - return false - } - } - return true -} - -func (set *threadUnsafeSet) IsProperSubset(other Set) bool { - return set.IsSubset(other) && !set.Equal(other) -} - -func (set *threadUnsafeSet) IsSuperset(other Set) bool { - return other.IsSubset(set) -} - -func (set *threadUnsafeSet) IsProperSuperset(other Set) bool { - return set.IsSuperset(other) && !set.Equal(other) -} - -func (set *threadUnsafeSet) Union(other Set) Set { - o := other.(*threadUnsafeSet) - - unionedSet := newThreadUnsafeSet() - - for elem := range *set { - unionedSet.Add(elem) - } - for elem := range *o { - unionedSet.Add(elem) - } - return &unionedSet -} - -func (set *threadUnsafeSet) Intersect(other Set) Set { - o := other.(*threadUnsafeSet) - - intersection := newThreadUnsafeSet() - // loop over smaller set - if set.Cardinality() < other.Cardinality() { - for elem := range *set { - if other.Contains(elem) { - intersection.Add(elem) - } - } - } else { - for elem := range *o { - if set.Contains(elem) { - intersection.Add(elem) - } - } - } - return &intersection -} - -func (set *threadUnsafeSet) Difference(other Set) Set { - _ = other.(*threadUnsafeSet) - - difference := newThreadUnsafeSet() - for elem := range *set { - if !other.Contains(elem) { - difference.Add(elem) - } - } - return &difference -} - -func (set *threadUnsafeSet) SymmetricDifference(other Set) Set { - _ = other.(*threadUnsafeSet) - - aDiff := set.Difference(other) - bDiff := other.Difference(set) - return aDiff.Union(bDiff) -} - -func (set *threadUnsafeSet) Clear() { - *set = newThreadUnsafeSet() -} - -func (set *threadUnsafeSet) Remove(i interface{}) { - delete(*set, i) -} - -func (set *threadUnsafeSet) Cardinality() int { - return len(*set) -} - -func (set *threadUnsafeSet) Each(cb func(interface{}) bool) { - for elem := range *set { - if cb(elem) { - break - } - } -} - -func (set *threadUnsafeSet) Iter() <-chan interface{} { - ch := make(chan interface{}) - go func() { - for elem := range *set { - ch <- elem - } - close(ch) - }() - - return ch -} - -func (set *threadUnsafeSet) Iterator() *Iterator { - iterator, ch, stopCh := newIterator() - - go func() { - L: - for elem := range *set { - select { - case <-stopCh: - break L - case ch <- elem: - } - } - close(ch) - }() - - return iterator -} - -func (set *threadUnsafeSet) Equal(other Set) bool { - _ = other.(*threadUnsafeSet) - - if set.Cardinality() != other.Cardinality() { - return false - } - for elem := range *set { - if !other.Contains(elem) { - return false - } - } - return true -} - -func (set *threadUnsafeSet) Clone() Set { - clonedSet := newThreadUnsafeSet() - for elem := range *set { - clonedSet.Add(elem) - } - return &clonedSet -} - -func (set *threadUnsafeSet) String() string { - items := make([]string, 0, len(*set)) - - for elem := range *set { - items = append(items, fmt.Sprintf("%v", elem)) - } - return fmt.Sprintf("Set{%s}", strings.Join(items, ", ")) -} - -// String outputs a 2-tuple in the form "(A, B)". -func (pair OrderedPair) String() string { - return fmt.Sprintf("(%v, %v)", pair.First, pair.Second) -} - -func (set *threadUnsafeSet) Pop() interface{} { - for item := range *set { - delete(*set, item) - return item - } - return nil -} - -func (set *threadUnsafeSet) PowerSet() Set { - powSet := NewThreadUnsafeSet() - nullset := newThreadUnsafeSet() - powSet.Add(&nullset) - - for es := range *set { - u := newThreadUnsafeSet() - j := powSet.Iter() - for er := range j { - p := newThreadUnsafeSet() - if reflect.TypeOf(er).Name() == "" { - k := er.(*threadUnsafeSet) - for ek := range *(k) { - p.Add(ek) - } - } else { - p.Add(er) - } - p.Add(es) - u.Add(&p) - } - - powSet = powSet.Union(&u) - } - - return powSet -} - -func (set *threadUnsafeSet) CartesianProduct(other Set) Set { - o := other.(*threadUnsafeSet) - cartProduct := NewThreadUnsafeSet() - - for i := range *set { - for j := range *o { - elem := OrderedPair{First: i, Second: j} - cartProduct.Add(elem) - } - } - - return cartProduct -} - -func (set *threadUnsafeSet) ToSlice() []interface{} { - keys := make([]interface{}, 0, set.Cardinality()) - for elem := range *set { - keys = append(keys, elem) - } - - return keys -} - -// MarshalJSON creates a JSON array from the set, it marshals all elements -func (set *threadUnsafeSet) MarshalJSON() ([]byte, error) { - items := make([]string, 0, set.Cardinality()) - - for elem := range *set { - b, err := json.Marshal(elem) - if err != nil { - return nil, err - } - - items = append(items, string(b)) - } - - return []byte(fmt.Sprintf("[%s]", strings.Join(items, ","))), nil -} - -// UnmarshalJSON recreates a set from a JSON array, it only decodes -// primitive types. Numbers are decoded as json.Number. -func (set *threadUnsafeSet) UnmarshalJSON(b []byte) error { - var i []interface{} - - d := json.NewDecoder(bytes.NewReader(b)) - d.UseNumber() - err := d.Decode(&i) - if err != nil { - return err - } - - for _, v := range i { - switch t := v.(type) { - case []interface{}, map[string]interface{}: - continue - default: - set.Add(t) - } - } - - return nil -} diff --git a/vendor/github.com/emicklei/go-restful/v3/CHANGES.md b/vendor/github.com/emicklei/go-restful/v3/CHANGES.md index 74a37815..5edd5a7c 100644 --- a/vendor/github.com/emicklei/go-restful/v3/CHANGES.md +++ b/vendor/github.com/emicklei/go-restful/v3/CHANGES.md @@ -1,10 +1,30 @@ # Change history of go-restful -## [v3.9.0] - 20221-07-21 +## [v3.11.0] - 2023-08-19 + +- restored behavior as <= v3.9.0 with option to change path strategy using TrimRightSlashEnabled. + +## [v3.10.2] - 2023-03-09 - DO NOT USE + +- introduced MergePathStrategy to be able to revert behaviour of path concatenation to 3.9.0 + see comment in Readme how to customize this behaviour. + +## [v3.10.1] - 2022-11-19 - DO NOT USE + +- fix broken 3.10.0 by using path package for joining paths + +## [v3.10.0] - 2022-10-11 - BROKEN + +- changed tokenizer to match std route match behavior; do not trimright the path (#511) +- Add MIME_ZIP (#512) +- Add MIME_ZIP and HEADER_ContentDisposition (#513) +- Changed how to get query parameter issue #510 + +## [v3.9.0] - 2022-07-21 - add support for http.Handler implementations to work as FilterFunction, issue #504 (thanks to https://github.com/ggicci) -## [v3.8.0] - 20221-06-06 +## [v3.8.0] - 2022-06-06 - use exact matching of allowed domain entries, issue #489 (#493) - this changes fixes [security] Authorization Bypass Through User-Controlled Key diff --git a/vendor/github.com/emicklei/go-restful/v3/README.md b/vendor/github.com/emicklei/go-restful/v3/README.md index 0625359d..e3e30080 100644 --- a/vendor/github.com/emicklei/go-restful/v3/README.md +++ b/vendor/github.com/emicklei/go-restful/v3/README.md @@ -79,7 +79,7 @@ func (u UserResource) findUser(request *restful.Request, response *restful.Respo - Content encoding (gzip,deflate) of request and response payloads - Automatic responses on OPTIONS (using a filter) - Automatic CORS request handling (using a filter) -- API declaration for Swagger UI ([go-restful-openapi](https://github.com/emicklei/go-restful-openapi), see [go-restful-swagger12](https://github.com/emicklei/go-restful-swagger12)) +- API declaration for Swagger UI ([go-restful-openapi](https://github.com/emicklei/go-restful-openapi)) - Panic recovery to produce HTTP 500, customizable using RecoverHandler(...) - Route errors produce HTTP 404/405/406/415 errors, customizable using ServiceErrorHandler(...) - Configurable (trace) logging @@ -96,6 +96,7 @@ There are several hooks to customize the behavior of the go-restful package. - Compression - Encoders for other serializers - Use [jsoniter](https://github.com/json-iterator/go) by building this package using a build tag, e.g. `go build -tags=jsoniter .` +- Use the package variable `TrimRightSlashEnabled` (default true) to control the behavior of matching routes that end with a slash `/` ## Resources @@ -108,4 +109,4 @@ There are several hooks to customize the behavior of the go-restful package. Type ```git shortlog -s``` for a full list of contributors. -© 2012 - 2022, http://ernestmicklei.com. MIT License. Contributions are welcome. +© 2012 - 2023, http://ernestmicklei.com. MIT License. Contributions are welcome. diff --git a/vendor/github.com/emicklei/go-restful/v3/constants.go b/vendor/github.com/emicklei/go-restful/v3/constants.go index 203439c5..2328bde6 100644 --- a/vendor/github.com/emicklei/go-restful/v3/constants.go +++ b/vendor/github.com/emicklei/go-restful/v3/constants.go @@ -7,12 +7,14 @@ package restful const ( MIME_XML = "application/xml" // Accept or Content-Type used in Consumes() and/or Produces() MIME_JSON = "application/json" // Accept or Content-Type used in Consumes() and/or Produces() + MIME_ZIP = "application/zip" // Accept or Content-Type used in Consumes() and/or Produces() MIME_OCTET = "application/octet-stream" // If Content-Type is not present in request, use the default HEADER_Allow = "Allow" HEADER_Accept = "Accept" HEADER_Origin = "Origin" HEADER_ContentType = "Content-Type" + HEADER_ContentDisposition = "Content-Disposition" HEADER_LastModified = "Last-Modified" HEADER_AcceptEncoding = "Accept-Encoding" HEADER_ContentEncoding = "Content-Encoding" diff --git a/vendor/github.com/emicklei/go-restful/v3/request.go b/vendor/github.com/emicklei/go-restful/v3/request.go index 5725a075..0020095e 100644 --- a/vendor/github.com/emicklei/go-restful/v3/request.go +++ b/vendor/github.com/emicklei/go-restful/v3/request.go @@ -31,7 +31,8 @@ func NewRequest(httpRequest *http.Request) *Request { // a "Unable to unmarshal content of type:" response is returned. // Valid values are restful.MIME_JSON and restful.MIME_XML // Example: -// restful.DefaultRequestContentType(restful.MIME_JSON) +// +// restful.DefaultRequestContentType(restful.MIME_JSON) func DefaultRequestContentType(mime string) { defaultRequestContentType = mime } @@ -48,7 +49,7 @@ func (r *Request) PathParameters() map[string]string { // QueryParameter returns the (first) Query parameter value by its name func (r *Request) QueryParameter(name string) string { - return r.Request.FormValue(name) + return r.Request.URL.Query().Get(name) } // QueryParameters returns the all the query parameters values by name diff --git a/vendor/github.com/emicklei/go-restful/v3/response.go b/vendor/github.com/emicklei/go-restful/v3/response.go index 8f0b56aa..a41a92cc 100644 --- a/vendor/github.com/emicklei/go-restful/v3/response.go +++ b/vendor/github.com/emicklei/go-restful/v3/response.go @@ -109,6 +109,9 @@ func (r *Response) EntityWriter() (EntityReaderWriter, bool) { if DefaultResponseMimeType == MIME_XML { return entityAccessRegistry.accessorAt(MIME_XML) } + if DefaultResponseMimeType == MIME_ZIP { + return entityAccessRegistry.accessorAt(MIME_ZIP) + } // Fallback to whatever the route says it can produce. // https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html for _, each := range r.routeProduces { diff --git a/vendor/github.com/emicklei/go-restful/v3/route.go b/vendor/github.com/emicklei/go-restful/v3/route.go index 193f4a6b..306c44be 100644 --- a/vendor/github.com/emicklei/go-restful/v3/route.go +++ b/vendor/github.com/emicklei/go-restful/v3/route.go @@ -40,7 +40,8 @@ type Route struct { ParameterDocs []*Parameter ResponseErrors map[int]ResponseError DefaultResponse *ResponseError - ReadSample, WriteSample interface{} // structs that model an example request or response payload + ReadSample, WriteSample interface{} // structs that model an example request or response payload + WriteSamples []interface{} // if more than one return types is possible (oneof) then this will contain multiple values // Extra information used to store custom information about the route. Metadata map[string]interface{} @@ -164,7 +165,13 @@ func tokenizePath(path string) []string { if "/" == path { return nil } - return strings.Split(strings.Trim(path, "/"), "/") + if TrimRightSlashEnabled { + // 3.9.0 + return strings.Split(strings.Trim(path, "/"), "/") + } else { + // 3.10.2 + return strings.Split(strings.TrimLeft(path, "/"), "/") + } } // for debugging @@ -176,3 +183,9 @@ func (r *Route) String() string { func (r *Route) EnableContentEncoding(enabled bool) { r.contentEncodingEnabled = &enabled } + +// TrimRightSlashEnabled controls whether +// - path on route building is using path.Join +// - the path of the incoming request is trimmed of its slash suffux. +// Value of true matches the behavior of <= 3.9.0 +var TrimRightSlashEnabled = true diff --git a/vendor/github.com/emicklei/go-restful/v3/route_builder.go b/vendor/github.com/emicklei/go-restful/v3/route_builder.go index 23641b6d..75168c12 100644 --- a/vendor/github.com/emicklei/go-restful/v3/route_builder.go +++ b/vendor/github.com/emicklei/go-restful/v3/route_builder.go @@ -7,6 +7,7 @@ package restful import ( "fmt" "os" + "path" "reflect" "runtime" "strings" @@ -30,27 +31,29 @@ type RouteBuilder struct { typeNameHandleFunc TypeNameHandleFunction // required // documentation - doc string - notes string - operation string - readSample, writeSample interface{} - parameters []*Parameter - errorMap map[int]ResponseError - defaultResponse *ResponseError - metadata map[string]interface{} - extensions map[string]interface{} - deprecated bool - contentEncodingEnabled *bool + doc string + notes string + operation string + readSample interface{} + writeSamples []interface{} + parameters []*Parameter + errorMap map[int]ResponseError + defaultResponse *ResponseError + metadata map[string]interface{} + extensions map[string]interface{} + deprecated bool + contentEncodingEnabled *bool } // Do evaluates each argument with the RouteBuilder itself. // This allows you to follow DRY principles without breaking the fluent programming style. // Example: -// ws.Route(ws.DELETE("/{name}").To(t.deletePerson).Do(Returns200, Returns500)) // -// func Returns500(b *RouteBuilder) { -// b.Returns(500, "Internal Server Error", restful.ServiceError{}) -// } +// ws.Route(ws.DELETE("/{name}").To(t.deletePerson).Do(Returns200, Returns500)) +// +// func Returns500(b *RouteBuilder) { +// b.Returns(500, "Internal Server Error", restful.ServiceError{}) +// } func (b *RouteBuilder) Do(oneArgBlocks ...func(*RouteBuilder)) *RouteBuilder { for _, each := range oneArgBlocks { each(b) @@ -133,9 +136,9 @@ func (b RouteBuilder) ParameterNamed(name string) (p *Parameter) { return p } -// Writes tells what resource type will be written as the response payload. Optional. -func (b *RouteBuilder) Writes(sample interface{}) *RouteBuilder { - b.writeSample = sample +// Writes tells which one of the resource types will be written as the response payload. Optional. +func (b *RouteBuilder) Writes(samples ...interface{}) *RouteBuilder { + b.writeSamples = samples // oneof return b } @@ -340,19 +343,29 @@ func (b *RouteBuilder) Build() Route { ResponseErrors: b.errorMap, DefaultResponse: b.defaultResponse, ReadSample: b.readSample, - WriteSample: b.writeSample, + WriteSamples: b.writeSamples, Metadata: b.metadata, Deprecated: b.deprecated, contentEncodingEnabled: b.contentEncodingEnabled, allowedMethodsWithoutContentType: b.allowedMethodsWithoutContentType, } + // set WriteSample if one specified + if len(b.writeSamples) == 1 { + route.WriteSample = b.writeSamples[0] + } route.Extensions = b.extensions route.postBuild() return route } -func concatPath(path1, path2 string) string { - return strings.TrimRight(path1, "/") + "/" + strings.TrimLeft(path2, "/") +// merge two paths using the current (package global) merge path strategy. +func concatPath(rootPath, routePath string) string { + + if TrimRightSlashEnabled { + return strings.TrimRight(rootPath, "/") + "/" + strings.TrimLeft(routePath, "/") + } else { + return path.Join(rootPath, routePath) + } } var anonymousFuncCount int32 diff --git a/vendor/github.com/evanphx/json-patch/.gitignore b/vendor/github.com/evanphx/json-patch/.gitignore new file mode 100644 index 00000000..b7ed7f95 --- /dev/null +++ b/vendor/github.com/evanphx/json-patch/.gitignore @@ -0,0 +1,6 @@ +# editor and IDE paraphernalia +.idea +.vscode + +# macOS paraphernalia +.DS_Store diff --git a/vendor/github.com/pkg/browser/LICENSE b/vendor/github.com/evanphx/json-patch/LICENSE similarity index 72% rename from vendor/github.com/pkg/browser/LICENSE rename to vendor/github.com/evanphx/json-patch/LICENSE index 65f78fb6..df76d7d7 100644 --- a/vendor/github.com/pkg/browser/LICENSE +++ b/vendor/github.com/evanphx/json-patch/LICENSE @@ -1,23 +1,25 @@ -Copyright (c) 2014, Dave Cheney +Copyright (c) 2014, Evan Phoenix All rights reserved. -Redistribution and use in source and binary forms, with or without +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. +* Neither the name of the Evan Phoenix nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/evanphx/json-patch/README.md b/vendor/github.com/evanphx/json-patch/README.md new file mode 100644 index 00000000..28e35169 --- /dev/null +++ b/vendor/github.com/evanphx/json-patch/README.md @@ -0,0 +1,317 @@ +# JSON-Patch +`jsonpatch` is a library which provides functionality for both applying +[RFC6902 JSON patches](http://tools.ietf.org/html/rfc6902) against documents, as +well as for calculating & applying [RFC7396 JSON merge patches](https://tools.ietf.org/html/rfc7396). + +[![GoDoc](https://godoc.org/github.com/evanphx/json-patch?status.svg)](http://godoc.org/github.com/evanphx/json-patch) +[![Build Status](https://travis-ci.org/evanphx/json-patch.svg?branch=master)](https://travis-ci.org/evanphx/json-patch) +[![Report Card](https://goreportcard.com/badge/github.com/evanphx/json-patch)](https://goreportcard.com/report/github.com/evanphx/json-patch) + +# Get It! + +**Latest and greatest**: +```bash +go get -u github.com/evanphx/json-patch/v5 +``` + +**Stable Versions**: +* Version 5: `go get -u gopkg.in/evanphx/json-patch.v5` +* Version 4: `go get -u gopkg.in/evanphx/json-patch.v4` + +(previous versions below `v3` are unavailable) + +# Use It! +* [Create and apply a merge patch](#create-and-apply-a-merge-patch) +* [Create and apply a JSON Patch](#create-and-apply-a-json-patch) +* [Comparing JSON documents](#comparing-json-documents) +* [Combine merge patches](#combine-merge-patches) + + +# Configuration + +* There is a global configuration variable `jsonpatch.SupportNegativeIndices`. + This defaults to `true` and enables the non-standard practice of allowing + negative indices to mean indices starting at the end of an array. This + functionality can be disabled by setting `jsonpatch.SupportNegativeIndices = + false`. + +* There is a global configuration variable `jsonpatch.AccumulatedCopySizeLimit`, + which limits the total size increase in bytes caused by "copy" operations in a + patch. It defaults to 0, which means there is no limit. + +These global variables control the behavior of `jsonpatch.Apply`. + +An alternative to `jsonpatch.Apply` is `jsonpatch.ApplyWithOptions` whose behavior +is controlled by an `options` parameter of type `*jsonpatch.ApplyOptions`. + +Structure `jsonpatch.ApplyOptions` includes the configuration options above +and adds two new options: `AllowMissingPathOnRemove` and `EnsurePathExistsOnAdd`. + +When `AllowMissingPathOnRemove` is set to `true`, `jsonpatch.ApplyWithOptions` will ignore +`remove` operations whose `path` points to a non-existent location in the JSON document. +`AllowMissingPathOnRemove` defaults to `false` which will lead to `jsonpatch.ApplyWithOptions` +returning an error when hitting a missing `path` on `remove`. + +When `EnsurePathExistsOnAdd` is set to `true`, `jsonpatch.ApplyWithOptions` will make sure +that `add` operations produce all the `path` elements that are missing from the target object. + +Use `jsonpatch.NewApplyOptions` to create an instance of `jsonpatch.ApplyOptions` +whose values are populated from the global configuration variables. + +## Create and apply a merge patch +Given both an original JSON document and a modified JSON document, you can create +a [Merge Patch](https://tools.ietf.org/html/rfc7396) document. + +It can describe the changes needed to convert from the original to the +modified JSON document. + +Once you have a merge patch, you can apply it to other JSON documents using the +`jsonpatch.MergePatch(document, patch)` function. + +```go +package main + +import ( + "fmt" + + jsonpatch "github.com/evanphx/json-patch" +) + +func main() { + // Let's create a merge patch from these two documents... + original := []byte(`{"name": "John", "age": 24, "height": 3.21}`) + target := []byte(`{"name": "Jane", "age": 24}`) + + patch, err := jsonpatch.CreateMergePatch(original, target) + if err != nil { + panic(err) + } + + // Now lets apply the patch against a different JSON document... + + alternative := []byte(`{"name": "Tina", "age": 28, "height": 3.75}`) + modifiedAlternative, err := jsonpatch.MergePatch(alternative, patch) + + fmt.Printf("patch document: %s\n", patch) + fmt.Printf("updated alternative doc: %s\n", modifiedAlternative) +} +``` + +When ran, you get the following output: + +```bash +$ go run main.go +patch document: {"height":null,"name":"Jane"} +updated alternative doc: {"age":28,"name":"Jane"} +``` + +## Create and apply a JSON Patch +You can create patch objects using `DecodePatch([]byte)`, which can then +be applied against JSON documents. + +The following is an example of creating a patch from two operations, and +applying it against a JSON document. + +```go +package main + +import ( + "fmt" + + jsonpatch "github.com/evanphx/json-patch" +) + +func main() { + original := []byte(`{"name": "John", "age": 24, "height": 3.21}`) + patchJSON := []byte(`[ + {"op": "replace", "path": "/name", "value": "Jane"}, + {"op": "remove", "path": "/height"} + ]`) + + patch, err := jsonpatch.DecodePatch(patchJSON) + if err != nil { + panic(err) + } + + modified, err := patch.Apply(original) + if err != nil { + panic(err) + } + + fmt.Printf("Original document: %s\n", original) + fmt.Printf("Modified document: %s\n", modified) +} +``` + +When ran, you get the following output: + +```bash +$ go run main.go +Original document: {"name": "John", "age": 24, "height": 3.21} +Modified document: {"age":24,"name":"Jane"} +``` + +## Comparing JSON documents +Due to potential whitespace and ordering differences, one cannot simply compare +JSON strings or byte-arrays directly. + +As such, you can instead use `jsonpatch.Equal(document1, document2)` to +determine if two JSON documents are _structurally_ equal. This ignores +whitespace differences, and key-value ordering. + +```go +package main + +import ( + "fmt" + + jsonpatch "github.com/evanphx/json-patch" +) + +func main() { + original := []byte(`{"name": "John", "age": 24, "height": 3.21}`) + similar := []byte(` + { + "age": 24, + "height": 3.21, + "name": "John" + } + `) + different := []byte(`{"name": "Jane", "age": 20, "height": 3.37}`) + + if jsonpatch.Equal(original, similar) { + fmt.Println(`"original" is structurally equal to "similar"`) + } + + if !jsonpatch.Equal(original, different) { + fmt.Println(`"original" is _not_ structurally equal to "different"`) + } +} +``` + +When ran, you get the following output: +```bash +$ go run main.go +"original" is structurally equal to "similar" +"original" is _not_ structurally equal to "different" +``` + +## Combine merge patches +Given two JSON merge patch documents, it is possible to combine them into a +single merge patch which can describe both set of changes. + +The resulting merge patch can be used such that applying it results in a +document structurally similar as merging each merge patch to the document +in succession. + +```go +package main + +import ( + "fmt" + + jsonpatch "github.com/evanphx/json-patch" +) + +func main() { + original := []byte(`{"name": "John", "age": 24, "height": 3.21}`) + + nameAndHeight := []byte(`{"height":null,"name":"Jane"}`) + ageAndEyes := []byte(`{"age":4.23,"eyes":"blue"}`) + + // Let's combine these merge patch documents... + combinedPatch, err := jsonpatch.MergeMergePatches(nameAndHeight, ageAndEyes) + if err != nil { + panic(err) + } + + // Apply each patch individual against the original document + withoutCombinedPatch, err := jsonpatch.MergePatch(original, nameAndHeight) + if err != nil { + panic(err) + } + + withoutCombinedPatch, err = jsonpatch.MergePatch(withoutCombinedPatch, ageAndEyes) + if err != nil { + panic(err) + } + + // Apply the combined patch against the original document + + withCombinedPatch, err := jsonpatch.MergePatch(original, combinedPatch) + if err != nil { + panic(err) + } + + // Do both result in the same thing? They should! + if jsonpatch.Equal(withCombinedPatch, withoutCombinedPatch) { + fmt.Println("Both JSON documents are structurally the same!") + } + + fmt.Printf("combined merge patch: %s", combinedPatch) +} +``` + +When ran, you get the following output: +```bash +$ go run main.go +Both JSON documents are structurally the same! +combined merge patch: {"age":4.23,"eyes":"blue","height":null,"name":"Jane"} +``` + +# CLI for comparing JSON documents +You can install the commandline program `json-patch`. + +This program can take multiple JSON patch documents as arguments, +and fed a JSON document from `stdin`. It will apply the patch(es) against +the document and output the modified doc. + +**patch.1.json** +```json +[ + {"op": "replace", "path": "/name", "value": "Jane"}, + {"op": "remove", "path": "/height"} +] +``` + +**patch.2.json** +```json +[ + {"op": "add", "path": "/address", "value": "123 Main St"}, + {"op": "replace", "path": "/age", "value": "21"} +] +``` + +**document.json** +```json +{ + "name": "John", + "age": 24, + "height": 3.21 +} +``` + +You can then run: + +```bash +$ go install github.com/evanphx/json-patch/cmd/json-patch +$ cat document.json | json-patch -p patch.1.json -p patch.2.json +{"address":"123 Main St","age":"21","name":"Jane"} +``` + +# Help It! +Contributions are welcomed! Leave [an issue](https://github.com/evanphx/json-patch/issues) +or [create a PR](https://github.com/evanphx/json-patch/compare). + + +Before creating a pull request, we'd ask that you make sure tests are passing +and that you have added new tests when applicable. + +Contributors can run tests using: + +```bash +go test -cover ./... +``` + +Builds for pull requests are tested automatically +using [TravisCI](https://travis-ci.org/evanphx/json-patch). diff --git a/vendor/github.com/evanphx/json-patch/errors.go b/vendor/github.com/evanphx/json-patch/errors.go new file mode 100644 index 00000000..75304b44 --- /dev/null +++ b/vendor/github.com/evanphx/json-patch/errors.go @@ -0,0 +1,38 @@ +package jsonpatch + +import "fmt" + +// AccumulatedCopySizeError is an error type returned when the accumulated size +// increase caused by copy operations in a patch operation has exceeded the +// limit. +type AccumulatedCopySizeError struct { + limit int64 + accumulated int64 +} + +// NewAccumulatedCopySizeError returns an AccumulatedCopySizeError. +func NewAccumulatedCopySizeError(l, a int64) *AccumulatedCopySizeError { + return &AccumulatedCopySizeError{limit: l, accumulated: a} +} + +// Error implements the error interface. +func (a *AccumulatedCopySizeError) Error() string { + return fmt.Sprintf("Unable to complete the copy, the accumulated size increase of copy is %d, exceeding the limit %d", a.accumulated, a.limit) +} + +// ArraySizeError is an error type returned when the array size has exceeded +// the limit. +type ArraySizeError struct { + limit int + size int +} + +// NewArraySizeError returns an ArraySizeError. +func NewArraySizeError(l, s int) *ArraySizeError { + return &ArraySizeError{limit: l, size: s} +} + +// Error implements the error interface. +func (a *ArraySizeError) Error() string { + return fmt.Sprintf("Unable to create array of size %d, limit is %d", a.size, a.limit) +} diff --git a/vendor/github.com/evanphx/json-patch/merge.go b/vendor/github.com/evanphx/json-patch/merge.go new file mode 100644 index 00000000..ad88d401 --- /dev/null +++ b/vendor/github.com/evanphx/json-patch/merge.go @@ -0,0 +1,389 @@ +package jsonpatch + +import ( + "bytes" + "encoding/json" + "fmt" + "reflect" +) + +func merge(cur, patch *lazyNode, mergeMerge bool) *lazyNode { + curDoc, err := cur.intoDoc() + + if err != nil { + pruneNulls(patch) + return patch + } + + patchDoc, err := patch.intoDoc() + + if err != nil { + return patch + } + + mergeDocs(curDoc, patchDoc, mergeMerge) + + return cur +} + +func mergeDocs(doc, patch *partialDoc, mergeMerge bool) { + for k, v := range *patch { + if v == nil { + if mergeMerge { + (*doc)[k] = nil + } else { + delete(*doc, k) + } + } else { + cur, ok := (*doc)[k] + + if !ok || cur == nil { + if !mergeMerge { + pruneNulls(v) + } + + (*doc)[k] = v + } else { + (*doc)[k] = merge(cur, v, mergeMerge) + } + } + } +} + +func pruneNulls(n *lazyNode) { + sub, err := n.intoDoc() + + if err == nil { + pruneDocNulls(sub) + } else { + ary, err := n.intoAry() + + if err == nil { + pruneAryNulls(ary) + } + } +} + +func pruneDocNulls(doc *partialDoc) *partialDoc { + for k, v := range *doc { + if v == nil { + delete(*doc, k) + } else { + pruneNulls(v) + } + } + + return doc +} + +func pruneAryNulls(ary *partialArray) *partialArray { + newAry := []*lazyNode{} + + for _, v := range *ary { + if v != nil { + pruneNulls(v) + } + newAry = append(newAry, v) + } + + *ary = newAry + + return ary +} + +var ErrBadJSONDoc = fmt.Errorf("Invalid JSON Document") +var ErrBadJSONPatch = fmt.Errorf("Invalid JSON Patch") +var errBadMergeTypes = fmt.Errorf("Mismatched JSON Documents") + +// MergeMergePatches merges two merge patches together, such that +// applying this resulting merged merge patch to a document yields the same +// as merging each merge patch to the document in succession. +func MergeMergePatches(patch1Data, patch2Data []byte) ([]byte, error) { + return doMergePatch(patch1Data, patch2Data, true) +} + +// MergePatch merges the patchData into the docData. +func MergePatch(docData, patchData []byte) ([]byte, error) { + return doMergePatch(docData, patchData, false) +} + +func doMergePatch(docData, patchData []byte, mergeMerge bool) ([]byte, error) { + doc := &partialDoc{} + + docErr := json.Unmarshal(docData, doc) + + patch := &partialDoc{} + + patchErr := json.Unmarshal(patchData, patch) + + if _, ok := docErr.(*json.SyntaxError); ok { + return nil, ErrBadJSONDoc + } + + if _, ok := patchErr.(*json.SyntaxError); ok { + return nil, ErrBadJSONPatch + } + + if docErr == nil && *doc == nil { + return nil, ErrBadJSONDoc + } + + if patchErr == nil && *patch == nil { + return nil, ErrBadJSONPatch + } + + if docErr != nil || patchErr != nil { + // Not an error, just not a doc, so we turn straight into the patch + if patchErr == nil { + if mergeMerge { + doc = patch + } else { + doc = pruneDocNulls(patch) + } + } else { + patchAry := &partialArray{} + patchErr = json.Unmarshal(patchData, patchAry) + + if patchErr != nil { + return nil, ErrBadJSONPatch + } + + pruneAryNulls(patchAry) + + out, patchErr := json.Marshal(patchAry) + + if patchErr != nil { + return nil, ErrBadJSONPatch + } + + return out, nil + } + } else { + mergeDocs(doc, patch, mergeMerge) + } + + return json.Marshal(doc) +} + +// resemblesJSONArray indicates whether the byte-slice "appears" to be +// a JSON array or not. +// False-positives are possible, as this function does not check the internal +// structure of the array. It only checks that the outer syntax is present and +// correct. +func resemblesJSONArray(input []byte) bool { + input = bytes.TrimSpace(input) + + hasPrefix := bytes.HasPrefix(input, []byte("[")) + hasSuffix := bytes.HasSuffix(input, []byte("]")) + + return hasPrefix && hasSuffix +} + +// CreateMergePatch will return a merge patch document capable of converting +// the original document(s) to the modified document(s). +// The parameters can be bytes of either two JSON Documents, or two arrays of +// JSON documents. +// The merge patch returned follows the specification defined at http://tools.ietf.org/html/draft-ietf-appsawg-json-merge-patch-07 +func CreateMergePatch(originalJSON, modifiedJSON []byte) ([]byte, error) { + originalResemblesArray := resemblesJSONArray(originalJSON) + modifiedResemblesArray := resemblesJSONArray(modifiedJSON) + + // Do both byte-slices seem like JSON arrays? + if originalResemblesArray && modifiedResemblesArray { + return createArrayMergePatch(originalJSON, modifiedJSON) + } + + // Are both byte-slices are not arrays? Then they are likely JSON objects... + if !originalResemblesArray && !modifiedResemblesArray { + return createObjectMergePatch(originalJSON, modifiedJSON) + } + + // None of the above? Then return an error because of mismatched types. + return nil, errBadMergeTypes +} + +// createObjectMergePatch will return a merge-patch document capable of +// converting the original document to the modified document. +func createObjectMergePatch(originalJSON, modifiedJSON []byte) ([]byte, error) { + originalDoc := map[string]interface{}{} + modifiedDoc := map[string]interface{}{} + + err := json.Unmarshal(originalJSON, &originalDoc) + if err != nil { + return nil, ErrBadJSONDoc + } + + err = json.Unmarshal(modifiedJSON, &modifiedDoc) + if err != nil { + return nil, ErrBadJSONDoc + } + + dest, err := getDiff(originalDoc, modifiedDoc) + if err != nil { + return nil, err + } + + return json.Marshal(dest) +} + +// createArrayMergePatch will return an array of merge-patch documents capable +// of converting the original document to the modified document for each +// pair of JSON documents provided in the arrays. +// Arrays of mismatched sizes will result in an error. +func createArrayMergePatch(originalJSON, modifiedJSON []byte) ([]byte, error) { + originalDocs := []json.RawMessage{} + modifiedDocs := []json.RawMessage{} + + err := json.Unmarshal(originalJSON, &originalDocs) + if err != nil { + return nil, ErrBadJSONDoc + } + + err = json.Unmarshal(modifiedJSON, &modifiedDocs) + if err != nil { + return nil, ErrBadJSONDoc + } + + total := len(originalDocs) + if len(modifiedDocs) != total { + return nil, ErrBadJSONDoc + } + + result := []json.RawMessage{} + for i := 0; i < len(originalDocs); i++ { + original := originalDocs[i] + modified := modifiedDocs[i] + + patch, err := createObjectMergePatch(original, modified) + if err != nil { + return nil, err + } + + result = append(result, json.RawMessage(patch)) + } + + return json.Marshal(result) +} + +// Returns true if the array matches (must be json types). +// As is idiomatic for go, an empty array is not the same as a nil array. +func matchesArray(a, b []interface{}) bool { + if len(a) != len(b) { + return false + } + if (a == nil && b != nil) || (a != nil && b == nil) { + return false + } + for i := range a { + if !matchesValue(a[i], b[i]) { + return false + } + } + return true +} + +// Returns true if the values matches (must be json types) +// The types of the values must match, otherwise it will always return false +// If two map[string]interface{} are given, all elements must match. +func matchesValue(av, bv interface{}) bool { + if reflect.TypeOf(av) != reflect.TypeOf(bv) { + return false + } + switch at := av.(type) { + case string: + bt := bv.(string) + if bt == at { + return true + } + case float64: + bt := bv.(float64) + if bt == at { + return true + } + case bool: + bt := bv.(bool) + if bt == at { + return true + } + case nil: + // Both nil, fine. + return true + case map[string]interface{}: + bt := bv.(map[string]interface{}) + if len(bt) != len(at) { + return false + } + for key := range bt { + av, aOK := at[key] + bv, bOK := bt[key] + if aOK != bOK { + return false + } + if !matchesValue(av, bv) { + return false + } + } + return true + case []interface{}: + bt := bv.([]interface{}) + return matchesArray(at, bt) + } + return false +} + +// getDiff returns the (recursive) difference between a and b as a map[string]interface{}. +func getDiff(a, b map[string]interface{}) (map[string]interface{}, error) { + into := map[string]interface{}{} + for key, bv := range b { + av, ok := a[key] + // value was added + if !ok { + into[key] = bv + continue + } + // If types have changed, replace completely + if reflect.TypeOf(av) != reflect.TypeOf(bv) { + into[key] = bv + continue + } + // Types are the same, compare values + switch at := av.(type) { + case map[string]interface{}: + bt := bv.(map[string]interface{}) + dst := make(map[string]interface{}, len(bt)) + dst, err := getDiff(at, bt) + if err != nil { + return nil, err + } + if len(dst) > 0 { + into[key] = dst + } + case string, float64, bool: + if !matchesValue(av, bv) { + into[key] = bv + } + case []interface{}: + bt := bv.([]interface{}) + if !matchesArray(at, bt) { + into[key] = bv + } + case nil: + switch bv.(type) { + case nil: + // Both nil, fine. + default: + into[key] = bv + } + default: + panic(fmt.Sprintf("Unknown type:%T in key %s", av, key)) + } + } + // Now add all deleted values as nil + for key := range a { + _, found := b[key] + if !found { + into[key] = nil + } + } + return into, nil +} diff --git a/vendor/github.com/evanphx/json-patch/patch.go b/vendor/github.com/evanphx/json-patch/patch.go new file mode 100644 index 00000000..4bce5936 --- /dev/null +++ b/vendor/github.com/evanphx/json-patch/patch.go @@ -0,0 +1,809 @@ +package jsonpatch + +import ( + "bytes" + "encoding/json" + "fmt" + "strconv" + "strings" + + "github.com/pkg/errors" +) + +const ( + eRaw = iota + eDoc + eAry +) + +var ( + // SupportNegativeIndices decides whether to support non-standard practice of + // allowing negative indices to mean indices starting at the end of an array. + // Default to true. + SupportNegativeIndices bool = true + // AccumulatedCopySizeLimit limits the total size increase in bytes caused by + // "copy" operations in a patch. + AccumulatedCopySizeLimit int64 = 0 +) + +var ( + ErrTestFailed = errors.New("test failed") + ErrMissing = errors.New("missing value") + ErrUnknownType = errors.New("unknown object type") + ErrInvalid = errors.New("invalid state detected") + ErrInvalidIndex = errors.New("invalid index referenced") +) + +type lazyNode struct { + raw *json.RawMessage + doc partialDoc + ary partialArray + which int +} + +// Operation is a single JSON-Patch step, such as a single 'add' operation. +type Operation map[string]*json.RawMessage + +// Patch is an ordered collection of Operations. +type Patch []Operation + +type partialDoc map[string]*lazyNode +type partialArray []*lazyNode + +type container interface { + get(key string) (*lazyNode, error) + set(key string, val *lazyNode) error + add(key string, val *lazyNode) error + remove(key string) error +} + +func newLazyNode(raw *json.RawMessage) *lazyNode { + return &lazyNode{raw: raw, doc: nil, ary: nil, which: eRaw} +} + +func (n *lazyNode) MarshalJSON() ([]byte, error) { + switch n.which { + case eRaw: + return json.Marshal(n.raw) + case eDoc: + return json.Marshal(n.doc) + case eAry: + return json.Marshal(n.ary) + default: + return nil, ErrUnknownType + } +} + +func (n *lazyNode) UnmarshalJSON(data []byte) error { + dest := make(json.RawMessage, len(data)) + copy(dest, data) + n.raw = &dest + n.which = eRaw + return nil +} + +func deepCopy(src *lazyNode) (*lazyNode, int, error) { + if src == nil { + return nil, 0, nil + } + a, err := src.MarshalJSON() + if err != nil { + return nil, 0, err + } + sz := len(a) + ra := make(json.RawMessage, sz) + copy(ra, a) + return newLazyNode(&ra), sz, nil +} + +func (n *lazyNode) intoDoc() (*partialDoc, error) { + if n.which == eDoc { + return &n.doc, nil + } + + if n.raw == nil { + return nil, ErrInvalid + } + + err := json.Unmarshal(*n.raw, &n.doc) + + if err != nil { + return nil, err + } + + n.which = eDoc + return &n.doc, nil +} + +func (n *lazyNode) intoAry() (*partialArray, error) { + if n.which == eAry { + return &n.ary, nil + } + + if n.raw == nil { + return nil, ErrInvalid + } + + err := json.Unmarshal(*n.raw, &n.ary) + + if err != nil { + return nil, err + } + + n.which = eAry + return &n.ary, nil +} + +func (n *lazyNode) compact() []byte { + buf := &bytes.Buffer{} + + if n.raw == nil { + return nil + } + + err := json.Compact(buf, *n.raw) + + if err != nil { + return *n.raw + } + + return buf.Bytes() +} + +func (n *lazyNode) tryDoc() bool { + if n.raw == nil { + return false + } + + err := json.Unmarshal(*n.raw, &n.doc) + + if err != nil { + return false + } + + n.which = eDoc + return true +} + +func (n *lazyNode) tryAry() bool { + if n.raw == nil { + return false + } + + err := json.Unmarshal(*n.raw, &n.ary) + + if err != nil { + return false + } + + n.which = eAry + return true +} + +func (n *lazyNode) equal(o *lazyNode) bool { + if n.which == eRaw { + if !n.tryDoc() && !n.tryAry() { + if o.which != eRaw { + return false + } + + return bytes.Equal(n.compact(), o.compact()) + } + } + + if n.which == eDoc { + if o.which == eRaw { + if !o.tryDoc() { + return false + } + } + + if o.which != eDoc { + return false + } + + if len(n.doc) != len(o.doc) { + return false + } + + for k, v := range n.doc { + ov, ok := o.doc[k] + + if !ok { + return false + } + + if (v == nil) != (ov == nil) { + return false + } + + if v == nil && ov == nil { + continue + } + + if !v.equal(ov) { + return false + } + } + + return true + } + + if o.which != eAry && !o.tryAry() { + return false + } + + if len(n.ary) != len(o.ary) { + return false + } + + for idx, val := range n.ary { + if !val.equal(o.ary[idx]) { + return false + } + } + + return true +} + +// Kind reads the "op" field of the Operation. +func (o Operation) Kind() string { + if obj, ok := o["op"]; ok && obj != nil { + var op string + + err := json.Unmarshal(*obj, &op) + + if err != nil { + return "unknown" + } + + return op + } + + return "unknown" +} + +// Path reads the "path" field of the Operation. +func (o Operation) Path() (string, error) { + if obj, ok := o["path"]; ok && obj != nil { + var op string + + err := json.Unmarshal(*obj, &op) + + if err != nil { + return "unknown", err + } + + return op, nil + } + + return "unknown", errors.Wrapf(ErrMissing, "operation missing path field") +} + +// From reads the "from" field of the Operation. +func (o Operation) From() (string, error) { + if obj, ok := o["from"]; ok && obj != nil { + var op string + + err := json.Unmarshal(*obj, &op) + + if err != nil { + return "unknown", err + } + + return op, nil + } + + return "unknown", errors.Wrapf(ErrMissing, "operation, missing from field") +} + +func (o Operation) value() *lazyNode { + if obj, ok := o["value"]; ok { + return newLazyNode(obj) + } + + return nil +} + +// ValueInterface decodes the operation value into an interface. +func (o Operation) ValueInterface() (interface{}, error) { + if obj, ok := o["value"]; ok && obj != nil { + var v interface{} + + err := json.Unmarshal(*obj, &v) + + if err != nil { + return nil, err + } + + return v, nil + } + + return nil, errors.Wrapf(ErrMissing, "operation, missing value field") +} + +func isArray(buf []byte) bool { +Loop: + for _, c := range buf { + switch c { + case ' ': + case '\n': + case '\t': + continue + case '[': + return true + default: + break Loop + } + } + + return false +} + +func findObject(pd *container, path string) (container, string) { + doc := *pd + + split := strings.Split(path, "/") + + if len(split) < 2 { + return nil, "" + } + + parts := split[1 : len(split)-1] + + key := split[len(split)-1] + + var err error + + for _, part := range parts { + + next, ok := doc.get(decodePatchKey(part)) + + if next == nil || ok != nil { + return nil, "" + } + + if isArray(*next.raw) { + doc, err = next.intoAry() + + if err != nil { + return nil, "" + } + } else { + doc, err = next.intoDoc() + + if err != nil { + return nil, "" + } + } + } + + return doc, decodePatchKey(key) +} + +func (d *partialDoc) set(key string, val *lazyNode) error { + (*d)[key] = val + return nil +} + +func (d *partialDoc) add(key string, val *lazyNode) error { + (*d)[key] = val + return nil +} + +func (d *partialDoc) get(key string) (*lazyNode, error) { + return (*d)[key], nil +} + +func (d *partialDoc) remove(key string) error { + _, ok := (*d)[key] + if !ok { + return errors.Wrapf(ErrMissing, "Unable to remove nonexistent key: %s", key) + } + + delete(*d, key) + return nil +} + +// set should only be used to implement the "replace" operation, so "key" must +// be an already existing index in "d". +func (d *partialArray) set(key string, val *lazyNode) error { + idx, err := strconv.Atoi(key) + if err != nil { + return err + } + + if idx < 0 { + if !SupportNegativeIndices { + return errors.Wrapf(ErrInvalidIndex, "Unable to access invalid index: %d", idx) + } + if idx < -len(*d) { + return errors.Wrapf(ErrInvalidIndex, "Unable to access invalid index: %d", idx) + } + idx += len(*d) + } + + (*d)[idx] = val + return nil +} + +func (d *partialArray) add(key string, val *lazyNode) error { + if key == "-" { + *d = append(*d, val) + return nil + } + + idx, err := strconv.Atoi(key) + if err != nil { + return errors.Wrapf(err, "value was not a proper array index: '%s'", key) + } + + sz := len(*d) + 1 + + ary := make([]*lazyNode, sz) + + cur := *d + + if idx >= len(ary) { + return errors.Wrapf(ErrInvalidIndex, "Unable to access invalid index: %d", idx) + } + + if idx < 0 { + if !SupportNegativeIndices { + return errors.Wrapf(ErrInvalidIndex, "Unable to access invalid index: %d", idx) + } + if idx < -len(ary) { + return errors.Wrapf(ErrInvalidIndex, "Unable to access invalid index: %d", idx) + } + idx += len(ary) + } + + copy(ary[0:idx], cur[0:idx]) + ary[idx] = val + copy(ary[idx+1:], cur[idx:]) + + *d = ary + return nil +} + +func (d *partialArray) get(key string) (*lazyNode, error) { + idx, err := strconv.Atoi(key) + + if err != nil { + return nil, err + } + + if idx < 0 { + if !SupportNegativeIndices { + return nil, errors.Wrapf(ErrInvalidIndex, "Unable to access invalid index: %d", idx) + } + if idx < -len(*d) { + return nil, errors.Wrapf(ErrInvalidIndex, "Unable to access invalid index: %d", idx) + } + idx += len(*d) + } + + if idx >= len(*d) { + return nil, errors.Wrapf(ErrInvalidIndex, "Unable to access invalid index: %d", idx) + } + + return (*d)[idx], nil +} + +func (d *partialArray) remove(key string) error { + idx, err := strconv.Atoi(key) + if err != nil { + return err + } + + cur := *d + + if idx >= len(cur) { + return errors.Wrapf(ErrInvalidIndex, "Unable to access invalid index: %d", idx) + } + + if idx < 0 { + if !SupportNegativeIndices { + return errors.Wrapf(ErrInvalidIndex, "Unable to access invalid index: %d", idx) + } + if idx < -len(cur) { + return errors.Wrapf(ErrInvalidIndex, "Unable to access invalid index: %d", idx) + } + idx += len(cur) + } + + ary := make([]*lazyNode, len(cur)-1) + + copy(ary[0:idx], cur[0:idx]) + copy(ary[idx:], cur[idx+1:]) + + *d = ary + return nil + +} + +func (p Patch) add(doc *container, op Operation) error { + path, err := op.Path() + if err != nil { + return errors.Wrapf(ErrMissing, "add operation failed to decode path") + } + + con, key := findObject(doc, path) + + if con == nil { + return errors.Wrapf(ErrMissing, "add operation does not apply: doc is missing path: \"%s\"", path) + } + + err = con.add(key, op.value()) + if err != nil { + return errors.Wrapf(err, "error in add for path: '%s'", path) + } + + return nil +} + +func (p Patch) remove(doc *container, op Operation) error { + path, err := op.Path() + if err != nil { + return errors.Wrapf(ErrMissing, "remove operation failed to decode path") + } + + con, key := findObject(doc, path) + + if con == nil { + return errors.Wrapf(ErrMissing, "remove operation does not apply: doc is missing path: \"%s\"", path) + } + + err = con.remove(key) + if err != nil { + return errors.Wrapf(err, "error in remove for path: '%s'", path) + } + + return nil +} + +func (p Patch) replace(doc *container, op Operation) error { + path, err := op.Path() + if err != nil { + return errors.Wrapf(err, "replace operation failed to decode path") + } + + con, key := findObject(doc, path) + + if con == nil { + return errors.Wrapf(ErrMissing, "replace operation does not apply: doc is missing path: %s", path) + } + + _, ok := con.get(key) + if ok != nil { + return errors.Wrapf(ErrMissing, "replace operation does not apply: doc is missing key: %s", path) + } + + err = con.set(key, op.value()) + if err != nil { + return errors.Wrapf(err, "error in remove for path: '%s'", path) + } + + return nil +} + +func (p Patch) move(doc *container, op Operation) error { + from, err := op.From() + if err != nil { + return errors.Wrapf(err, "move operation failed to decode from") + } + + con, key := findObject(doc, from) + + if con == nil { + return errors.Wrapf(ErrMissing, "move operation does not apply: doc is missing from path: %s", from) + } + + val, err := con.get(key) + if err != nil { + return errors.Wrapf(err, "error in move for path: '%s'", key) + } + + err = con.remove(key) + if err != nil { + return errors.Wrapf(err, "error in move for path: '%s'", key) + } + + path, err := op.Path() + if err != nil { + return errors.Wrapf(err, "move operation failed to decode path") + } + + con, key = findObject(doc, path) + + if con == nil { + return errors.Wrapf(ErrMissing, "move operation does not apply: doc is missing destination path: %s", path) + } + + err = con.add(key, val) + if err != nil { + return errors.Wrapf(err, "error in move for path: '%s'", path) + } + + return nil +} + +func (p Patch) test(doc *container, op Operation) error { + path, err := op.Path() + if err != nil { + return errors.Wrapf(err, "test operation failed to decode path") + } + + con, key := findObject(doc, path) + + if con == nil { + return errors.Wrapf(ErrMissing, "test operation does not apply: is missing path: %s", path) + } + + val, err := con.get(key) + if err != nil { + return errors.Wrapf(err, "error in test for path: '%s'", path) + } + + if val == nil { + if op.value().raw == nil { + return nil + } + return errors.Wrapf(ErrTestFailed, "testing value %s failed", path) + } else if op.value() == nil { + return errors.Wrapf(ErrTestFailed, "testing value %s failed", path) + } + + if val.equal(op.value()) { + return nil + } + + return errors.Wrapf(ErrTestFailed, "testing value %s failed", path) +} + +func (p Patch) copy(doc *container, op Operation, accumulatedCopySize *int64) error { + from, err := op.From() + if err != nil { + return errors.Wrapf(err, "copy operation failed to decode from") + } + + con, key := findObject(doc, from) + + if con == nil { + return errors.Wrapf(ErrMissing, "copy operation does not apply: doc is missing from path: %s", from) + } + + val, err := con.get(key) + if err != nil { + return errors.Wrapf(err, "error in copy for from: '%s'", from) + } + + path, err := op.Path() + if err != nil { + return errors.Wrapf(ErrMissing, "copy operation failed to decode path") + } + + con, key = findObject(doc, path) + + if con == nil { + return errors.Wrapf(ErrMissing, "copy operation does not apply: doc is missing destination path: %s", path) + } + + valCopy, sz, err := deepCopy(val) + if err != nil { + return errors.Wrapf(err, "error while performing deep copy") + } + + (*accumulatedCopySize) += int64(sz) + if AccumulatedCopySizeLimit > 0 && *accumulatedCopySize > AccumulatedCopySizeLimit { + return NewAccumulatedCopySizeError(AccumulatedCopySizeLimit, *accumulatedCopySize) + } + + err = con.add(key, valCopy) + if err != nil { + return errors.Wrapf(err, "error while adding value during copy") + } + + return nil +} + +// Equal indicates if 2 JSON documents have the same structural equality. +func Equal(a, b []byte) bool { + ra := make(json.RawMessage, len(a)) + copy(ra, a) + la := newLazyNode(&ra) + + rb := make(json.RawMessage, len(b)) + copy(rb, b) + lb := newLazyNode(&rb) + + return la.equal(lb) +} + +// DecodePatch decodes the passed JSON document as an RFC 6902 patch. +func DecodePatch(buf []byte) (Patch, error) { + var p Patch + + err := json.Unmarshal(buf, &p) + + if err != nil { + return nil, err + } + + return p, nil +} + +// Apply mutates a JSON document according to the patch, and returns the new +// document. +func (p Patch) Apply(doc []byte) ([]byte, error) { + return p.ApplyIndent(doc, "") +} + +// ApplyIndent mutates a JSON document according to the patch, and returns the new +// document indented. +func (p Patch) ApplyIndent(doc []byte, indent string) ([]byte, error) { + if len(doc) == 0 { + return doc, nil + } + + var pd container + if doc[0] == '[' { + pd = &partialArray{} + } else { + pd = &partialDoc{} + } + + err := json.Unmarshal(doc, pd) + + if err != nil { + return nil, err + } + + err = nil + + var accumulatedCopySize int64 + + for _, op := range p { + switch op.Kind() { + case "add": + err = p.add(&pd, op) + case "remove": + err = p.remove(&pd, op) + case "replace": + err = p.replace(&pd, op) + case "move": + err = p.move(&pd, op) + case "test": + err = p.test(&pd, op) + case "copy": + err = p.copy(&pd, op, &accumulatedCopySize) + default: + err = fmt.Errorf("Unexpected kind: %s", op.Kind()) + } + + if err != nil { + return nil, err + } + } + + if indent != "" { + return json.MarshalIndent(pd, "", indent) + } + + return json.Marshal(pd) +} + +// From http://tools.ietf.org/html/rfc6901#section-4 : +// +// Evaluation of each reference token begins by decoding any escaped +// character sequence. This is performed by first transforming any +// occurrence of the sequence '~1' to '/', and then transforming any +// occurrence of the sequence '~0' to '~'. + +var ( + rfc6901Decoder = strings.NewReplacer("~1", "/", "~0", "~") +) + +func decodePatchKey(k string) string { + return rfc6901Decoder.Replace(k) +} diff --git a/vendor/github.com/evanphx/json-patch/v5/internal/json/decode.go b/vendor/github.com/evanphx/json-patch/v5/internal/json/decode.go new file mode 100644 index 00000000..e9bb0efe --- /dev/null +++ b/vendor/github.com/evanphx/json-patch/v5/internal/json/decode.go @@ -0,0 +1,1385 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Represents JSON data structure using native Go types: booleans, floats, +// strings, arrays, and maps. + +package json + +import ( + "encoding" + "encoding/base64" + "fmt" + "reflect" + "strconv" + "strings" + "sync" + "unicode" + "unicode/utf16" + "unicode/utf8" +) + +// Unmarshal parses the JSON-encoded data and stores the result +// in the value pointed to by v. If v is nil or not a pointer, +// Unmarshal returns an InvalidUnmarshalError. +// +// Unmarshal uses the inverse of the encodings that +// Marshal uses, allocating maps, slices, and pointers as necessary, +// with the following additional rules: +// +// To unmarshal JSON into a pointer, Unmarshal first handles the case of +// the JSON being the JSON literal null. In that case, Unmarshal sets +// the pointer to nil. Otherwise, Unmarshal unmarshals the JSON into +// the value pointed at by the pointer. If the pointer is nil, Unmarshal +// allocates a new value for it to point to. +// +// To unmarshal JSON into a value implementing the Unmarshaler interface, +// Unmarshal calls that value's UnmarshalJSON method, including +// when the input is a JSON null. +// Otherwise, if the value implements encoding.TextUnmarshaler +// and the input is a JSON quoted string, Unmarshal calls that value's +// UnmarshalText method with the unquoted form of the string. +// +// To unmarshal JSON into a struct, Unmarshal matches incoming object +// keys to the keys used by Marshal (either the struct field name or its tag), +// preferring an exact match but also accepting a case-insensitive match. By +// default, object keys which don't have a corresponding struct field are +// ignored (see Decoder.DisallowUnknownFields for an alternative). +// +// To unmarshal JSON into an interface value, +// Unmarshal stores one of these in the interface value: +// +// bool, for JSON booleans +// float64, for JSON numbers +// string, for JSON strings +// []interface{}, for JSON arrays +// map[string]interface{}, for JSON objects +// nil for JSON null +// +// To unmarshal a JSON array into a slice, Unmarshal resets the slice length +// to zero and then appends each element to the slice. +// As a special case, to unmarshal an empty JSON array into a slice, +// Unmarshal replaces the slice with a new empty slice. +// +// To unmarshal a JSON array into a Go array, Unmarshal decodes +// JSON array elements into corresponding Go array elements. +// If the Go array is smaller than the JSON array, +// the additional JSON array elements are discarded. +// If the JSON array is smaller than the Go array, +// the additional Go array elements are set to zero values. +// +// To unmarshal a JSON object into a map, Unmarshal first establishes a map to +// use. If the map is nil, Unmarshal allocates a new map. Otherwise Unmarshal +// reuses the existing map, keeping existing entries. Unmarshal then stores +// key-value pairs from the JSON object into the map. The map's key type must +// either be any string type, an integer, implement json.Unmarshaler, or +// implement encoding.TextUnmarshaler. +// +// If the JSON-encoded data contain a syntax error, Unmarshal returns a SyntaxError. +// +// If a JSON value is not appropriate for a given target type, +// or if a JSON number overflows the target type, Unmarshal +// skips that field and completes the unmarshaling as best it can. +// If no more serious errors are encountered, Unmarshal returns +// an UnmarshalTypeError describing the earliest such error. In any +// case, it's not guaranteed that all the remaining fields following +// the problematic one will be unmarshaled into the target object. +// +// The JSON null value unmarshals into an interface, map, pointer, or slice +// by setting that Go value to nil. Because null is often used in JSON to mean +// “not present,” unmarshaling a JSON null into any other Go type has no effect +// on the value and produces no error. +// +// When unmarshaling quoted strings, invalid UTF-8 or +// invalid UTF-16 surrogate pairs are not treated as an error. +// Instead, they are replaced by the Unicode replacement +// character U+FFFD. +func Unmarshal(data []byte, v any) error { + // Check for well-formedness. + // Avoids filling out half a data structure + // before discovering a JSON syntax error. + d := ds.Get().(*decodeState) + defer ds.Put(d) + //var d decodeState + d.useNumber = true + err := checkValid(data, &d.scan) + if err != nil { + return err + } + + d.init(data) + return d.unmarshal(v) +} + +var ds = sync.Pool{ + New: func() any { + return new(decodeState) + }, +} + +func UnmarshalWithKeys(data []byte, v any) ([]string, error) { + // Check for well-formedness. + // Avoids filling out half a data structure + // before discovering a JSON syntax error. + + d := ds.Get().(*decodeState) + defer ds.Put(d) + //var d decodeState + d.useNumber = true + err := checkValid(data, &d.scan) + if err != nil { + return nil, err + } + + d.init(data) + err = d.unmarshal(v) + if err != nil { + return nil, err + } + + return d.lastKeys, nil +} + +func UnmarshalValid(data []byte, v any) error { + // Check for well-formedness. + // Avoids filling out half a data structure + // before discovering a JSON syntax error. + d := ds.Get().(*decodeState) + defer ds.Put(d) + //var d decodeState + d.useNumber = true + + d.init(data) + return d.unmarshal(v) +} + +func UnmarshalValidWithKeys(data []byte, v any) ([]string, error) { + // Check for well-formedness. + // Avoids filling out half a data structure + // before discovering a JSON syntax error. + + d := ds.Get().(*decodeState) + defer ds.Put(d) + //var d decodeState + d.useNumber = true + + d.init(data) + err := d.unmarshal(v) + if err != nil { + return nil, err + } + + return d.lastKeys, nil +} + +// Unmarshaler is the interface implemented by types +// that can unmarshal a JSON description of themselves. +// The input can be assumed to be a valid encoding of +// a JSON value. UnmarshalJSON must copy the JSON data +// if it wishes to retain the data after returning. +// +// By convention, to approximate the behavior of Unmarshal itself, +// Unmarshalers implement UnmarshalJSON([]byte("null")) as a no-op. +type Unmarshaler interface { + UnmarshalJSON([]byte) error +} + +// An UnmarshalTypeError describes a JSON value that was +// not appropriate for a value of a specific Go type. +type UnmarshalTypeError struct { + Value string // description of JSON value - "bool", "array", "number -5" + Type reflect.Type // type of Go value it could not be assigned to + Offset int64 // error occurred after reading Offset bytes + Struct string // name of the struct type containing the field + Field string // the full path from root node to the field +} + +func (e *UnmarshalTypeError) Error() string { + if e.Struct != "" || e.Field != "" { + return "json: cannot unmarshal " + e.Value + " into Go struct field " + e.Struct + "." + e.Field + " of type " + e.Type.String() + } + return "json: cannot unmarshal " + e.Value + " into Go value of type " + e.Type.String() +} + +// An UnmarshalFieldError describes a JSON object key that +// led to an unexported (and therefore unwritable) struct field. +// +// Deprecated: No longer used; kept for compatibility. +type UnmarshalFieldError struct { + Key string + Type reflect.Type + Field reflect.StructField +} + +func (e *UnmarshalFieldError) Error() string { + return "json: cannot unmarshal object key " + strconv.Quote(e.Key) + " into unexported field " + e.Field.Name + " of type " + e.Type.String() +} + +// An InvalidUnmarshalError describes an invalid argument passed to Unmarshal. +// (The argument to Unmarshal must be a non-nil pointer.) +type InvalidUnmarshalError struct { + Type reflect.Type +} + +func (e *InvalidUnmarshalError) Error() string { + if e.Type == nil { + return "json: Unmarshal(nil)" + } + + if e.Type.Kind() != reflect.Pointer { + return "json: Unmarshal(non-pointer " + e.Type.String() + ")" + } + return "json: Unmarshal(nil " + e.Type.String() + ")" +} + +func (d *decodeState) unmarshal(v any) error { + rv := reflect.ValueOf(v) + if rv.Kind() != reflect.Pointer || rv.IsNil() { + return &InvalidUnmarshalError{reflect.TypeOf(v)} + } + + d.scan.reset() + d.scanWhile(scanSkipSpace) + // We decode rv not rv.Elem because the Unmarshaler interface + // test must be applied at the top level of the value. + err := d.value(rv) + if err != nil { + return d.addErrorContext(err) + } + return d.savedError +} + +// A Number represents a JSON number literal. +type Number string + +// String returns the literal text of the number. +func (n Number) String() string { return string(n) } + +// Float64 returns the number as a float64. +func (n Number) Float64() (float64, error) { + return strconv.ParseFloat(string(n), 64) +} + +// Int64 returns the number as an int64. +func (n Number) Int64() (int64, error) { + return strconv.ParseInt(string(n), 10, 64) +} + +// An errorContext provides context for type errors during decoding. +type errorContext struct { + Struct reflect.Type + FieldStack []string +} + +// decodeState represents the state while decoding a JSON value. +type decodeState struct { + data []byte + off int // next read offset in data + opcode int // last read result + scan scanner + errorContext *errorContext + savedError error + useNumber bool + disallowUnknownFields bool + lastKeys []string +} + +// readIndex returns the position of the last byte read. +func (d *decodeState) readIndex() int { + return d.off - 1 +} + +// phasePanicMsg is used as a panic message when we end up with something that +// shouldn't happen. It can indicate a bug in the JSON decoder, or that +// something is editing the data slice while the decoder executes. +const phasePanicMsg = "JSON decoder out of sync - data changing underfoot?" + +func (d *decodeState) init(data []byte) *decodeState { + d.data = data + d.off = 0 + d.savedError = nil + if d.errorContext != nil { + d.errorContext.Struct = nil + // Reuse the allocated space for the FieldStack slice. + d.errorContext.FieldStack = d.errorContext.FieldStack[:0] + } + return d +} + +// saveError saves the first err it is called with, +// for reporting at the end of the unmarshal. +func (d *decodeState) saveError(err error) { + if d.savedError == nil { + d.savedError = d.addErrorContext(err) + } +} + +// addErrorContext returns a new error enhanced with information from d.errorContext +func (d *decodeState) addErrorContext(err error) error { + if d.errorContext != nil && (d.errorContext.Struct != nil || len(d.errorContext.FieldStack) > 0) { + switch err := err.(type) { + case *UnmarshalTypeError: + err.Struct = d.errorContext.Struct.Name() + err.Field = strings.Join(d.errorContext.FieldStack, ".") + } + } + return err +} + +// skip scans to the end of what was started. +func (d *decodeState) skip() { + s, data, i := &d.scan, d.data, d.off + depth := len(s.parseState) + for { + op := s.step(s, data[i]) + i++ + if len(s.parseState) < depth { + d.off = i + d.opcode = op + return + } + } +} + +// scanNext processes the byte at d.data[d.off]. +func (d *decodeState) scanNext() { + if d.off < len(d.data) { + d.opcode = d.scan.step(&d.scan, d.data[d.off]) + d.off++ + } else { + d.opcode = d.scan.eof() + d.off = len(d.data) + 1 // mark processed EOF with len+1 + } +} + +// scanWhile processes bytes in d.data[d.off:] until it +// receives a scan code not equal to op. +func (d *decodeState) scanWhile(op int) { + s, data, i := &d.scan, d.data, d.off + for i < len(data) { + newOp := s.step(s, data[i]) + i++ + if newOp != op { + d.opcode = newOp + d.off = i + return + } + } + + d.off = len(data) + 1 // mark processed EOF with len+1 + d.opcode = d.scan.eof() +} + +// rescanLiteral is similar to scanWhile(scanContinue), but it specialises the +// common case where we're decoding a literal. The decoder scans the input +// twice, once for syntax errors and to check the length of the value, and the +// second to perform the decoding. +// +// Only in the second step do we use decodeState to tokenize literals, so we +// know there aren't any syntax errors. We can take advantage of that knowledge, +// and scan a literal's bytes much more quickly. +func (d *decodeState) rescanLiteral() { + data, i := d.data, d.off +Switch: + switch data[i-1] { + case '"': // string + for ; i < len(data); i++ { + switch data[i] { + case '\\': + i++ // escaped char + case '"': + i++ // tokenize the closing quote too + break Switch + } + } + case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '-': // number + for ; i < len(data); i++ { + switch data[i] { + case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', + '.', 'e', 'E', '+', '-': + default: + break Switch + } + } + case 't': // true + i += len("rue") + case 'f': // false + i += len("alse") + case 'n': // null + i += len("ull") + } + if i < len(data) { + d.opcode = stateEndValue(&d.scan, data[i]) + } else { + d.opcode = scanEnd + } + d.off = i + 1 +} + +// value consumes a JSON value from d.data[d.off-1:], decoding into v, and +// reads the following byte ahead. If v is invalid, the value is discarded. +// The first byte of the value has been read already. +func (d *decodeState) value(v reflect.Value) error { + switch d.opcode { + default: + panic(phasePanicMsg) + + case scanBeginArray: + if v.IsValid() { + if err := d.array(v); err != nil { + return err + } + } else { + d.skip() + } + d.scanNext() + + case scanBeginObject: + if v.IsValid() { + if err := d.object(v); err != nil { + return err + } + } else { + d.skip() + } + d.scanNext() + + case scanBeginLiteral: + // All bytes inside literal return scanContinue op code. + start := d.readIndex() + d.rescanLiteral() + + if v.IsValid() { + if err := d.literalStore(d.data[start:d.readIndex()], v, false); err != nil { + return err + } + } + } + return nil +} + +type unquotedValue struct{} + +// valueQuoted is like value but decodes a +// quoted string literal or literal null into an interface value. +// If it finds anything other than a quoted string literal or null, +// valueQuoted returns unquotedValue{}. +func (d *decodeState) valueQuoted() any { + switch d.opcode { + default: + panic(phasePanicMsg) + + case scanBeginArray, scanBeginObject: + d.skip() + d.scanNext() + + case scanBeginLiteral: + v := d.literalInterface() + switch v.(type) { + case nil, string: + return v + } + } + return unquotedValue{} +} + +// indirect walks down v allocating pointers as needed, +// until it gets to a non-pointer. +// If it encounters an Unmarshaler, indirect stops and returns that. +// If decodingNull is true, indirect stops at the first settable pointer so it +// can be set to nil. +func indirect(v reflect.Value, decodingNull bool) (Unmarshaler, encoding.TextUnmarshaler, reflect.Value) { + // Issue #24153 indicates that it is generally not a guaranteed property + // that you may round-trip a reflect.Value by calling Value.Addr().Elem() + // and expect the value to still be settable for values derived from + // unexported embedded struct fields. + // + // The logic below effectively does this when it first addresses the value + // (to satisfy possible pointer methods) and continues to dereference + // subsequent pointers as necessary. + // + // After the first round-trip, we set v back to the original value to + // preserve the original RW flags contained in reflect.Value. + v0 := v + haveAddr := false + + // If v is a named type and is addressable, + // start with its address, so that if the type has pointer methods, + // we find them. + if v.Kind() != reflect.Pointer && v.Type().Name() != "" && v.CanAddr() { + haveAddr = true + v = v.Addr() + } + for { + // Load value from interface, but only if the result will be + // usefully addressable. + if v.Kind() == reflect.Interface && !v.IsNil() { + e := v.Elem() + if e.Kind() == reflect.Pointer && !e.IsNil() && (!decodingNull || e.Elem().Kind() == reflect.Pointer) { + haveAddr = false + v = e + continue + } + } + + if v.Kind() != reflect.Pointer { + break + } + + if decodingNull && v.CanSet() { + break + } + + // Prevent infinite loop if v is an interface pointing to its own address: + // var v interface{} + // v = &v + if v.Elem().Kind() == reflect.Interface && v.Elem().Elem() == v { + v = v.Elem() + break + } + if v.IsNil() { + v.Set(reflect.New(v.Type().Elem())) + } + if v.Type().NumMethod() > 0 && v.CanInterface() { + if u, ok := v.Interface().(Unmarshaler); ok { + return u, nil, reflect.Value{} + } + if !decodingNull { + if u, ok := v.Interface().(encoding.TextUnmarshaler); ok { + return nil, u, reflect.Value{} + } + } + } + + if haveAddr { + v = v0 // restore original value after round-trip Value.Addr().Elem() + haveAddr = false + } else { + v = v.Elem() + } + } + return nil, nil, v +} + +// array consumes an array from d.data[d.off-1:], decoding into v. +// The first byte of the array ('[') has been read already. +func (d *decodeState) array(v reflect.Value) error { + // Check for unmarshaler. + u, ut, pv := indirect(v, false) + if u != nil { + start := d.readIndex() + d.skip() + return u.UnmarshalJSON(d.data[start:d.off]) + } + if ut != nil { + d.saveError(&UnmarshalTypeError{Value: "array", Type: v.Type(), Offset: int64(d.off)}) + d.skip() + return nil + } + v = pv + + // Check type of target. + switch v.Kind() { + case reflect.Interface: + if v.NumMethod() == 0 { + // Decoding into nil interface? Switch to non-reflect code. + ai := d.arrayInterface() + v.Set(reflect.ValueOf(ai)) + return nil + } + // Otherwise it's invalid. + fallthrough + default: + d.saveError(&UnmarshalTypeError{Value: "array", Type: v.Type(), Offset: int64(d.off)}) + d.skip() + return nil + case reflect.Array, reflect.Slice: + break + } + + i := 0 + for { + // Look ahead for ] - can only happen on first iteration. + d.scanWhile(scanSkipSpace) + if d.opcode == scanEndArray { + break + } + + // Get element of array, growing if necessary. + if v.Kind() == reflect.Slice { + // Grow slice if necessary + if i >= v.Cap() { + newcap := v.Cap() + v.Cap()/2 + if newcap < 4 { + newcap = 4 + } + newv := reflect.MakeSlice(v.Type(), v.Len(), newcap) + reflect.Copy(newv, v) + v.Set(newv) + } + if i >= v.Len() { + v.SetLen(i + 1) + } + } + + if i < v.Len() { + // Decode into element. + if err := d.value(v.Index(i)); err != nil { + return err + } + } else { + // Ran out of fixed array: skip. + if err := d.value(reflect.Value{}); err != nil { + return err + } + } + i++ + + // Next token must be , or ]. + if d.opcode == scanSkipSpace { + d.scanWhile(scanSkipSpace) + } + if d.opcode == scanEndArray { + break + } + if d.opcode != scanArrayValue { + panic(phasePanicMsg) + } + } + + if i < v.Len() { + if v.Kind() == reflect.Array { + // Array. Zero the rest. + z := reflect.Zero(v.Type().Elem()) + for ; i < v.Len(); i++ { + v.Index(i).Set(z) + } + } else { + v.SetLen(i) + } + } + if i == 0 && v.Kind() == reflect.Slice { + v.Set(reflect.MakeSlice(v.Type(), 0, 0)) + } + return nil +} + +var nullLiteral = []byte("null") +var textUnmarshalerType = reflect.TypeOf((*encoding.TextUnmarshaler)(nil)).Elem() + +// object consumes an object from d.data[d.off-1:], decoding into v. +// The first byte ('{') of the object has been read already. +func (d *decodeState) object(v reflect.Value) error { + // Check for unmarshaler. + u, ut, pv := indirect(v, false) + if u != nil { + start := d.readIndex() + d.skip() + return u.UnmarshalJSON(d.data[start:d.off]) + } + if ut != nil { + d.saveError(&UnmarshalTypeError{Value: "object", Type: v.Type(), Offset: int64(d.off)}) + d.skip() + return nil + } + v = pv + t := v.Type() + + // Decoding into nil interface? Switch to non-reflect code. + if v.Kind() == reflect.Interface && v.NumMethod() == 0 { + oi := d.objectInterface() + v.Set(reflect.ValueOf(oi)) + return nil + } + + var fields structFields + + // Check type of target: + // struct or + // map[T1]T2 where T1 is string, an integer type, + // or an encoding.TextUnmarshaler + switch v.Kind() { + case reflect.Map: + // Map key must either have string kind, have an integer kind, + // or be an encoding.TextUnmarshaler. + switch t.Key().Kind() { + case reflect.String, + reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, + reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: + default: + if !reflect.PointerTo(t.Key()).Implements(textUnmarshalerType) { + d.saveError(&UnmarshalTypeError{Value: "object", Type: t, Offset: int64(d.off)}) + d.skip() + return nil + } + } + if v.IsNil() { + v.Set(reflect.MakeMap(t)) + } + case reflect.Struct: + fields = cachedTypeFields(t) + // ok + default: + d.saveError(&UnmarshalTypeError{Value: "object", Type: t, Offset: int64(d.off)}) + d.skip() + return nil + } + + var mapElem reflect.Value + var origErrorContext errorContext + if d.errorContext != nil { + origErrorContext = *d.errorContext + } + + var keys []string + + for { + // Read opening " of string key or closing }. + d.scanWhile(scanSkipSpace) + if d.opcode == scanEndObject { + // closing } - can only happen on first iteration. + break + } + if d.opcode != scanBeginLiteral { + panic(phasePanicMsg) + } + + // Read key. + start := d.readIndex() + d.rescanLiteral() + item := d.data[start:d.readIndex()] + key, ok := unquoteBytes(item) + if !ok { + panic(phasePanicMsg) + } + + keys = append(keys, string(key)) + + // Figure out field corresponding to key. + var subv reflect.Value + destring := false // whether the value is wrapped in a string to be decoded first + + if v.Kind() == reflect.Map { + elemType := t.Elem() + if !mapElem.IsValid() { + mapElem = reflect.New(elemType).Elem() + } else { + mapElem.Set(reflect.Zero(elemType)) + } + subv = mapElem + } else { + var f *field + if i, ok := fields.nameIndex[string(key)]; ok { + // Found an exact name match. + f = &fields.list[i] + } else { + // Fall back to the expensive case-insensitive + // linear search. + for i := range fields.list { + ff := &fields.list[i] + if ff.equalFold(ff.nameBytes, key) { + f = ff + break + } + } + } + if f != nil { + subv = v + destring = f.quoted + for _, i := range f.index { + if subv.Kind() == reflect.Pointer { + if subv.IsNil() { + // If a struct embeds a pointer to an unexported type, + // it is not possible to set a newly allocated value + // since the field is unexported. + // + // See https://golang.org/issue/21357 + if !subv.CanSet() { + d.saveError(fmt.Errorf("json: cannot set embedded pointer to unexported struct: %v", subv.Type().Elem())) + // Invalidate subv to ensure d.value(subv) skips over + // the JSON value without assigning it to subv. + subv = reflect.Value{} + destring = false + break + } + subv.Set(reflect.New(subv.Type().Elem())) + } + subv = subv.Elem() + } + subv = subv.Field(i) + } + if d.errorContext == nil { + d.errorContext = new(errorContext) + } + d.errorContext.FieldStack = append(d.errorContext.FieldStack, f.name) + d.errorContext.Struct = t + } else if d.disallowUnknownFields { + d.saveError(fmt.Errorf("json: unknown field %q", key)) + } + } + + // Read : before value. + if d.opcode == scanSkipSpace { + d.scanWhile(scanSkipSpace) + } + if d.opcode != scanObjectKey { + panic(phasePanicMsg) + } + d.scanWhile(scanSkipSpace) + + if destring { + switch qv := d.valueQuoted().(type) { + case nil: + if err := d.literalStore(nullLiteral, subv, false); err != nil { + return err + } + case string: + if err := d.literalStore([]byte(qv), subv, true); err != nil { + return err + } + default: + d.saveError(fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal unquoted value into %v", subv.Type())) + } + } else { + if err := d.value(subv); err != nil { + return err + } + } + + // Write value back to map; + // if using struct, subv points into struct already. + if v.Kind() == reflect.Map { + kt := t.Key() + var kv reflect.Value + switch { + case reflect.PointerTo(kt).Implements(textUnmarshalerType): + kv = reflect.New(kt) + if err := d.literalStore(item, kv, true); err != nil { + return err + } + kv = kv.Elem() + case kt.Kind() == reflect.String: + kv = reflect.ValueOf(key).Convert(kt) + default: + switch kt.Kind() { + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + s := string(key) + n, err := strconv.ParseInt(s, 10, 64) + if err != nil || reflect.Zero(kt).OverflowInt(n) { + d.saveError(&UnmarshalTypeError{Value: "number " + s, Type: kt, Offset: int64(start + 1)}) + break + } + kv = reflect.ValueOf(n).Convert(kt) + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: + s := string(key) + n, err := strconv.ParseUint(s, 10, 64) + if err != nil || reflect.Zero(kt).OverflowUint(n) { + d.saveError(&UnmarshalTypeError{Value: "number " + s, Type: kt, Offset: int64(start + 1)}) + break + } + kv = reflect.ValueOf(n).Convert(kt) + default: + panic("json: Unexpected key type") // should never occur + } + } + if kv.IsValid() { + v.SetMapIndex(kv, subv) + } + } + + // Next token must be , or }. + if d.opcode == scanSkipSpace { + d.scanWhile(scanSkipSpace) + } + if d.errorContext != nil { + // Reset errorContext to its original state. + // Keep the same underlying array for FieldStack, to reuse the + // space and avoid unnecessary allocs. + d.errorContext.FieldStack = d.errorContext.FieldStack[:len(origErrorContext.FieldStack)] + d.errorContext.Struct = origErrorContext.Struct + } + if d.opcode == scanEndObject { + break + } + if d.opcode != scanObjectValue { + panic(phasePanicMsg) + } + } + + if v.Kind() == reflect.Map { + d.lastKeys = keys + } + return nil +} + +// convertNumber converts the number literal s to a float64 or a Number +// depending on the setting of d.useNumber. +func (d *decodeState) convertNumber(s string) (any, error) { + if d.useNumber { + return Number(s), nil + } + f, err := strconv.ParseFloat(s, 64) + if err != nil { + return nil, &UnmarshalTypeError{Value: "number " + s, Type: reflect.TypeOf(0.0), Offset: int64(d.off)} + } + return f, nil +} + +var numberType = reflect.TypeOf(Number("")) + +// literalStore decodes a literal stored in item into v. +// +// fromQuoted indicates whether this literal came from unwrapping a +// string from the ",string" struct tag option. this is used only to +// produce more helpful error messages. +func (d *decodeState) literalStore(item []byte, v reflect.Value, fromQuoted bool) error { + // Check for unmarshaler. + if len(item) == 0 { + //Empty string given + d.saveError(fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal %q into %v", item, v.Type())) + return nil + } + isNull := item[0] == 'n' // null + u, ut, pv := indirect(v, isNull) + if u != nil { + return u.UnmarshalJSON(item) + } + if ut != nil { + if item[0] != '"' { + if fromQuoted { + d.saveError(fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal %q into %v", item, v.Type())) + return nil + } + val := "number" + switch item[0] { + case 'n': + val = "null" + case 't', 'f': + val = "bool" + } + d.saveError(&UnmarshalTypeError{Value: val, Type: v.Type(), Offset: int64(d.readIndex())}) + return nil + } + s, ok := unquoteBytes(item) + if !ok { + if fromQuoted { + return fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal %q into %v", item, v.Type()) + } + panic(phasePanicMsg) + } + return ut.UnmarshalText(s) + } + + v = pv + + switch c := item[0]; c { + case 'n': // null + // The main parser checks that only true and false can reach here, + // but if this was a quoted string input, it could be anything. + if fromQuoted && string(item) != "null" { + d.saveError(fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal %q into %v", item, v.Type())) + break + } + switch v.Kind() { + case reflect.Interface, reflect.Pointer, reflect.Map, reflect.Slice: + v.Set(reflect.Zero(v.Type())) + // otherwise, ignore null for primitives/string + } + case 't', 'f': // true, false + value := item[0] == 't' + // The main parser checks that only true and false can reach here, + // but if this was a quoted string input, it could be anything. + if fromQuoted && string(item) != "true" && string(item) != "false" { + d.saveError(fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal %q into %v", item, v.Type())) + break + } + switch v.Kind() { + default: + if fromQuoted { + d.saveError(fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal %q into %v", item, v.Type())) + } else { + d.saveError(&UnmarshalTypeError{Value: "bool", Type: v.Type(), Offset: int64(d.readIndex())}) + } + case reflect.Bool: + v.SetBool(value) + case reflect.Interface: + if v.NumMethod() == 0 { + v.Set(reflect.ValueOf(value)) + } else { + d.saveError(&UnmarshalTypeError{Value: "bool", Type: v.Type(), Offset: int64(d.readIndex())}) + } + } + + case '"': // string + s, ok := unquoteBytes(item) + if !ok { + if fromQuoted { + return fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal %q into %v", item, v.Type()) + } + panic(phasePanicMsg) + } + switch v.Kind() { + default: + d.saveError(&UnmarshalTypeError{Value: "string", Type: v.Type(), Offset: int64(d.readIndex())}) + case reflect.Slice: + if v.Type().Elem().Kind() != reflect.Uint8 { + d.saveError(&UnmarshalTypeError{Value: "string", Type: v.Type(), Offset: int64(d.readIndex())}) + break + } + b := make([]byte, base64.StdEncoding.DecodedLen(len(s))) + n, err := base64.StdEncoding.Decode(b, s) + if err != nil { + d.saveError(err) + break + } + v.SetBytes(b[:n]) + case reflect.String: + if v.Type() == numberType && !isValidNumber(string(s)) { + return fmt.Errorf("json: invalid number literal, trying to unmarshal %q into Number", item) + } + v.SetString(string(s)) + case reflect.Interface: + if v.NumMethod() == 0 { + v.Set(reflect.ValueOf(string(s))) + } else { + d.saveError(&UnmarshalTypeError{Value: "string", Type: v.Type(), Offset: int64(d.readIndex())}) + } + } + + default: // number + if c != '-' && (c < '0' || c > '9') { + if fromQuoted { + return fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal %q into %v", item, v.Type()) + } + panic(phasePanicMsg) + } + s := string(item) + switch v.Kind() { + default: + if v.Kind() == reflect.String && v.Type() == numberType { + // s must be a valid number, because it's + // already been tokenized. + v.SetString(s) + break + } + if fromQuoted { + return fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal %q into %v", item, v.Type()) + } + d.saveError(&UnmarshalTypeError{Value: "number", Type: v.Type(), Offset: int64(d.readIndex())}) + case reflect.Interface: + n, err := d.convertNumber(s) + if err != nil { + d.saveError(err) + break + } + if v.NumMethod() != 0 { + d.saveError(&UnmarshalTypeError{Value: "number", Type: v.Type(), Offset: int64(d.readIndex())}) + break + } + v.Set(reflect.ValueOf(n)) + + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + n, err := strconv.ParseInt(s, 10, 64) + if err != nil || v.OverflowInt(n) { + d.saveError(&UnmarshalTypeError{Value: "number " + s, Type: v.Type(), Offset: int64(d.readIndex())}) + break + } + v.SetInt(n) + + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: + n, err := strconv.ParseUint(s, 10, 64) + if err != nil || v.OverflowUint(n) { + d.saveError(&UnmarshalTypeError{Value: "number " + s, Type: v.Type(), Offset: int64(d.readIndex())}) + break + } + v.SetUint(n) + + case reflect.Float32, reflect.Float64: + n, err := strconv.ParseFloat(s, v.Type().Bits()) + if err != nil || v.OverflowFloat(n) { + d.saveError(&UnmarshalTypeError{Value: "number " + s, Type: v.Type(), Offset: int64(d.readIndex())}) + break + } + v.SetFloat(n) + } + } + return nil +} + +// The xxxInterface routines build up a value to be stored +// in an empty interface. They are not strictly necessary, +// but they avoid the weight of reflection in this common case. + +// valueInterface is like value but returns interface{} +func (d *decodeState) valueInterface() (val any) { + switch d.opcode { + default: + panic(phasePanicMsg) + case scanBeginArray: + val = d.arrayInterface() + d.scanNext() + case scanBeginObject: + val = d.objectInterface() + d.scanNext() + case scanBeginLiteral: + val = d.literalInterface() + } + return +} + +// arrayInterface is like array but returns []interface{}. +func (d *decodeState) arrayInterface() []any { + var v = make([]any, 0) + for { + // Look ahead for ] - can only happen on first iteration. + d.scanWhile(scanSkipSpace) + if d.opcode == scanEndArray { + break + } + + v = append(v, d.valueInterface()) + + // Next token must be , or ]. + if d.opcode == scanSkipSpace { + d.scanWhile(scanSkipSpace) + } + if d.opcode == scanEndArray { + break + } + if d.opcode != scanArrayValue { + panic(phasePanicMsg) + } + } + return v +} + +// objectInterface is like object but returns map[string]interface{}. +func (d *decodeState) objectInterface() map[string]any { + m := make(map[string]any) + for { + // Read opening " of string key or closing }. + d.scanWhile(scanSkipSpace) + if d.opcode == scanEndObject { + // closing } - can only happen on first iteration. + break + } + if d.opcode != scanBeginLiteral { + panic(phasePanicMsg) + } + + // Read string key. + start := d.readIndex() + d.rescanLiteral() + item := d.data[start:d.readIndex()] + key, ok := unquote(item) + if !ok { + panic(phasePanicMsg) + } + + // Read : before value. + if d.opcode == scanSkipSpace { + d.scanWhile(scanSkipSpace) + } + if d.opcode != scanObjectKey { + panic(phasePanicMsg) + } + d.scanWhile(scanSkipSpace) + + // Read value. + m[key] = d.valueInterface() + + // Next token must be , or }. + if d.opcode == scanSkipSpace { + d.scanWhile(scanSkipSpace) + } + if d.opcode == scanEndObject { + break + } + if d.opcode != scanObjectValue { + panic(phasePanicMsg) + } + } + return m +} + +// literalInterface consumes and returns a literal from d.data[d.off-1:] and +// it reads the following byte ahead. The first byte of the literal has been +// read already (that's how the caller knows it's a literal). +func (d *decodeState) literalInterface() any { + // All bytes inside literal return scanContinue op code. + start := d.readIndex() + d.rescanLiteral() + + item := d.data[start:d.readIndex()] + + switch c := item[0]; c { + case 'n': // null + return nil + + case 't', 'f': // true, false + return c == 't' + + case '"': // string + s, ok := unquote(item) + if !ok { + panic(phasePanicMsg) + } + return s + + default: // number + if c != '-' && (c < '0' || c > '9') { + panic(phasePanicMsg) + } + n, err := d.convertNumber(string(item)) + if err != nil { + d.saveError(err) + } + return n + } +} + +// getu4 decodes \uXXXX from the beginning of s, returning the hex value, +// or it returns -1. +func getu4(s []byte) rune { + if len(s) < 6 || s[0] != '\\' || s[1] != 'u' { + return -1 + } + var r rune + for _, c := range s[2:6] { + switch { + case '0' <= c && c <= '9': + c = c - '0' + case 'a' <= c && c <= 'f': + c = c - 'a' + 10 + case 'A' <= c && c <= 'F': + c = c - 'A' + 10 + default: + return -1 + } + r = r*16 + rune(c) + } + return r +} + +// unquote converts a quoted JSON string literal s into an actual string t. +// The rules are different than for Go, so cannot use strconv.Unquote. +func unquote(s []byte) (t string, ok bool) { + s, ok = unquoteBytes(s) + t = string(s) + return +} + +func unquoteBytes(s []byte) (t []byte, ok bool) { + if len(s) < 2 || s[0] != '"' || s[len(s)-1] != '"' { + return + } + s = s[1 : len(s)-1] + + // Check for unusual characters. If there are none, + // then no unquoting is needed, so return a slice of the + // original bytes. + r := 0 + for r < len(s) { + c := s[r] + if c == '\\' || c == '"' || c < ' ' { + break + } + if c < utf8.RuneSelf { + r++ + continue + } + rr, size := utf8.DecodeRune(s[r:]) + if rr == utf8.RuneError && size == 1 { + break + } + r += size + } + if r == len(s) { + return s, true + } + + b := make([]byte, len(s)+2*utf8.UTFMax) + w := copy(b, s[0:r]) + for r < len(s) { + // Out of room? Can only happen if s is full of + // malformed UTF-8 and we're replacing each + // byte with RuneError. + if w >= len(b)-2*utf8.UTFMax { + nb := make([]byte, (len(b)+utf8.UTFMax)*2) + copy(nb, b[0:w]) + b = nb + } + switch c := s[r]; { + case c == '\\': + r++ + if r >= len(s) { + return + } + switch s[r] { + default: + return + case '"', '\\', '/', '\'': + b[w] = s[r] + r++ + w++ + case 'b': + b[w] = '\b' + r++ + w++ + case 'f': + b[w] = '\f' + r++ + w++ + case 'n': + b[w] = '\n' + r++ + w++ + case 'r': + b[w] = '\r' + r++ + w++ + case 't': + b[w] = '\t' + r++ + w++ + case 'u': + r-- + rr := getu4(s[r:]) + if rr < 0 { + return + } + r += 6 + if utf16.IsSurrogate(rr) { + rr1 := getu4(s[r:]) + if dec := utf16.DecodeRune(rr, rr1); dec != unicode.ReplacementChar { + // A valid pair; consume. + r += 6 + w += utf8.EncodeRune(b[w:], dec) + break + } + // Invalid surrogate; fall back to replacement rune. + rr = unicode.ReplacementChar + } + w += utf8.EncodeRune(b[w:], rr) + } + + // Quote, control characters are invalid. + case c == '"', c < ' ': + return + + // ASCII + case c < utf8.RuneSelf: + b[w] = c + r++ + w++ + + // Coerce to well-formed UTF-8. + default: + rr, size := utf8.DecodeRune(s[r:]) + r += size + w += utf8.EncodeRune(b[w:], rr) + } + } + return b[0:w], true +} diff --git a/vendor/github.com/evanphx/json-patch/v5/internal/json/encode.go b/vendor/github.com/evanphx/json-patch/v5/internal/json/encode.go new file mode 100644 index 00000000..2e6eca44 --- /dev/null +++ b/vendor/github.com/evanphx/json-patch/v5/internal/json/encode.go @@ -0,0 +1,1486 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package json implements encoding and decoding of JSON as defined in +// RFC 7159. The mapping between JSON and Go values is described +// in the documentation for the Marshal and Unmarshal functions. +// +// See "JSON and Go" for an introduction to this package: +// https://golang.org/doc/articles/json_and_go.html +package json + +import ( + "bytes" + "encoding" + "encoding/base64" + "fmt" + "math" + "reflect" + "sort" + "strconv" + "strings" + "sync" + "unicode" + "unicode/utf8" +) + +// Marshal returns the JSON encoding of v. +// +// Marshal traverses the value v recursively. +// If an encountered value implements the Marshaler interface +// and is not a nil pointer, Marshal calls its MarshalJSON method +// to produce JSON. If no MarshalJSON method is present but the +// value implements encoding.TextMarshaler instead, Marshal calls +// its MarshalText method and encodes the result as a JSON string. +// The nil pointer exception is not strictly necessary +// but mimics a similar, necessary exception in the behavior of +// UnmarshalJSON. +// +// Otherwise, Marshal uses the following type-dependent default encodings: +// +// Boolean values encode as JSON booleans. +// +// Floating point, integer, and Number values encode as JSON numbers. +// +// String values encode as JSON strings coerced to valid UTF-8, +// replacing invalid bytes with the Unicode replacement rune. +// So that the JSON will be safe to embed inside HTML